2 * Mesa 3-D graphics library
4 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
5 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
29 * Display lists management functions.
35 #include "api_arrayelt.h"
37 #include "api_loopback.h"
38 #include "draw_validate.h"
39 #include "atifragshader.h"
41 #include "bufferobj.h"
48 #include "framebuffer.h"
49 #include "glapi/glapi.h"
50 #include "glformats.h"
58 #include "samplerobj.h"
59 #include "shaderapi.h"
62 #include "texstorage.h"
65 #include "arbprogram.h"
66 #include "transformfeedback.h"
68 #include "math/m_matrix.h"
70 #include "main/dispatch.h"
75 #define USE_BITMAP_ATLAS 1
80 * Other parts of Mesa (such as the VBO module) can plug into the display
81 * list system. This structure describes new display list instructions.
83 struct gl_list_instruction
86 void (*Execute
)( struct gl_context
*ctx
, void *data
);
87 void (*Destroy
)( struct gl_context
*ctx
, void *data
);
88 void (*Print
)( struct gl_context
*ctx
, void *data
, FILE *f
);
92 #define MAX_DLIST_EXT_OPCODES 16
95 * Used by device drivers to hook new commands into display lists.
97 struct gl_list_extensions
99 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
108 * \param ctx GL context.
110 * Checks if dd_function_table::SaveNeedFlush is marked to flush
111 * stored (save) vertices, and calls vbo_save_SaveFlushVertices if so.
113 #define SAVE_FLUSH_VERTICES(ctx) \
115 if (ctx->Driver.SaveNeedFlush) \
116 vbo_save_SaveFlushVertices(ctx); \
121 * Macro to assert that the API call was made outside the
122 * glBegin()/glEnd() pair, with return value.
124 * \param ctx GL context.
125 * \param retval value to return value in case the assertion fails.
127 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
129 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
130 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
136 * Macro to assert that the API call was made outside the
137 * glBegin()/glEnd() pair.
139 * \param ctx GL context.
141 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
143 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
144 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
150 * Macro to assert that the API call was made outside the
151 * glBegin()/glEnd() pair and flush the vertices.
153 * \param ctx GL context.
155 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
157 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
158 SAVE_FLUSH_VERTICES(ctx); \
162 * Macro to assert that the API call was made outside the
163 * glBegin()/glEnd() pair and flush the vertices, with return value.
165 * \param ctx GL context.
166 * \param retval value to return value in case the assertion fails.
168 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) \
170 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
171 SAVE_FLUSH_VERTICES(ctx); \
176 * Display list opcodes.
178 * The fact that these identifiers are assigned consecutive
179 * integer values starting at 0 is very important, see InstSize array usage)
183 OPCODE_INVALID
= -1, /* Force signed enum */
189 OPCODE_BLEND_EQUATION
,
190 OPCODE_BLEND_EQUATION_SEPARATE
,
191 OPCODE_BLEND_FUNC_SEPARATE
,
193 OPCODE_BLEND_EQUATION_I
,
194 OPCODE_BLEND_EQUATION_SEPARATE_I
,
196 OPCODE_BLEND_FUNC_SEPARATE_I
,
205 OPCODE_CLEAR_STENCIL
,
206 OPCODE_CLEAR_BUFFER_IV
,
207 OPCODE_CLEAR_BUFFER_UIV
,
208 OPCODE_CLEAR_BUFFER_FV
,
209 OPCODE_CLEAR_BUFFER_FI
,
212 OPCODE_COLOR_MASK_INDEXED
,
213 OPCODE_COLOR_MATERIAL
,
215 OPCODE_COPY_TEX_IMAGE1D
,
216 OPCODE_COPY_TEX_IMAGE2D
,
217 OPCODE_COPY_TEX_SUB_IMAGE1D
,
218 OPCODE_COPY_TEX_SUB_IMAGE2D
,
219 OPCODE_COPY_TEX_SUB_IMAGE3D
,
225 OPCODE_DISABLE_INDEXED
,
229 OPCODE_ENABLE_INDEXED
,
243 OPCODE_LOAD_IDENTITY
,
256 OPCODE_PIXEL_TRANSFER
,
259 OPCODE_POINT_PARAMETERS
,
261 OPCODE_POLYGON_STIPPLE
,
262 OPCODE_POLYGON_OFFSET
,
266 OPCODE_PRIORITIZE_TEXTURE
,
275 OPCODE_SELECT_TEXTURE_SGIS
,
276 OPCODE_SELECT_TEXTURE_COORD_SET
,
287 OPCODE_TEX_SUB_IMAGE1D
,
288 OPCODE_TEX_SUB_IMAGE2D
,
289 OPCODE_TEX_SUB_IMAGE3D
,
293 /* ARB_viewport_array */
294 OPCODE_VIEWPORT_ARRAY_V
,
295 OPCODE_VIEWPORT_INDEXED_F
,
296 OPCODE_VIEWPORT_INDEXED_FV
,
297 OPCODE_SCISSOR_ARRAY_V
,
298 OPCODE_SCISSOR_INDEXED
,
299 OPCODE_SCISSOR_INDEXED_V
,
300 OPCODE_DEPTH_ARRAY_V
,
301 OPCODE_DEPTH_INDEXED
,
302 /* GL_ARB_multitexture */
303 OPCODE_ACTIVE_TEXTURE
,
304 /* GL_ARB_texture_compression */
305 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
306 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
307 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
308 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
309 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
310 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
311 /* GL_ARB_multisample */
312 OPCODE_SAMPLE_COVERAGE
,
313 /* GL_ARB_window_pos */
314 OPCODE_WINDOW_POS_ARB
,
315 /* GL_ARB_vertex_program */
316 OPCODE_BIND_PROGRAM_ARB
,
317 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
318 /* GL_EXT_stencil_two_side */
319 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
320 /* GL_EXT_depth_bounds_test */
321 OPCODE_DEPTH_BOUNDS_EXT
,
322 /* GL_ARB_vertex/fragment_program */
323 OPCODE_PROGRAM_STRING_ARB
,
324 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
325 /* GL_ARB_occlusion_query */
326 OPCODE_BEGIN_QUERY_ARB
,
327 OPCODE_END_QUERY_ARB
,
328 /* GL_ARB_draw_buffers */
329 OPCODE_DRAW_BUFFERS_ARB
,
330 /* GL_ATI_fragment_shader */
331 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
332 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
334 OPCODE_STENCIL_FUNC_SEPARATE
,
335 OPCODE_STENCIL_OP_SEPARATE
,
336 OPCODE_STENCIL_MASK_SEPARATE
,
337 /* GL_NV_primitive_restart */
338 OPCODE_PRIMITIVE_RESTART_NV
,
339 /* GL_ARB_shader_objects */
357 OPCODE_UNIFORM_MATRIX22
,
358 OPCODE_UNIFORM_MATRIX33
,
359 OPCODE_UNIFORM_MATRIX44
,
360 OPCODE_UNIFORM_MATRIX23
,
361 OPCODE_UNIFORM_MATRIX32
,
362 OPCODE_UNIFORM_MATRIX24
,
363 OPCODE_UNIFORM_MATRIX42
,
364 OPCODE_UNIFORM_MATRIX34
,
365 OPCODE_UNIFORM_MATRIX43
,
377 /* GL_ARB_gpu_shader_fp64 */
386 OPCODE_UNIFORM_MATRIX22D
,
387 OPCODE_UNIFORM_MATRIX33D
,
388 OPCODE_UNIFORM_MATRIX44D
,
389 OPCODE_UNIFORM_MATRIX23D
,
390 OPCODE_UNIFORM_MATRIX32D
,
391 OPCODE_UNIFORM_MATRIX24D
,
392 OPCODE_UNIFORM_MATRIX42D
,
393 OPCODE_UNIFORM_MATRIX34D
,
394 OPCODE_UNIFORM_MATRIX43D
,
396 /* OpenGL 4.0 / GL_ARB_tessellation_shader */
397 OPCODE_PATCH_PARAMETER_I
,
398 OPCODE_PATCH_PARAMETER_FV_INNER
,
399 OPCODE_PATCH_PARAMETER_FV_OUTER
,
401 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
402 OPCODE_USE_PROGRAM_STAGES
,
403 OPCODE_PROGRAM_UNIFORM_1F
,
404 OPCODE_PROGRAM_UNIFORM_2F
,
405 OPCODE_PROGRAM_UNIFORM_3F
,
406 OPCODE_PROGRAM_UNIFORM_4F
,
407 OPCODE_PROGRAM_UNIFORM_1FV
,
408 OPCODE_PROGRAM_UNIFORM_2FV
,
409 OPCODE_PROGRAM_UNIFORM_3FV
,
410 OPCODE_PROGRAM_UNIFORM_4FV
,
411 OPCODE_PROGRAM_UNIFORM_1D
,
412 OPCODE_PROGRAM_UNIFORM_2D
,
413 OPCODE_PROGRAM_UNIFORM_3D
,
414 OPCODE_PROGRAM_UNIFORM_4D
,
415 OPCODE_PROGRAM_UNIFORM_1DV
,
416 OPCODE_PROGRAM_UNIFORM_2DV
,
417 OPCODE_PROGRAM_UNIFORM_3DV
,
418 OPCODE_PROGRAM_UNIFORM_4DV
,
419 OPCODE_PROGRAM_UNIFORM_1I
,
420 OPCODE_PROGRAM_UNIFORM_2I
,
421 OPCODE_PROGRAM_UNIFORM_3I
,
422 OPCODE_PROGRAM_UNIFORM_4I
,
423 OPCODE_PROGRAM_UNIFORM_1IV
,
424 OPCODE_PROGRAM_UNIFORM_2IV
,
425 OPCODE_PROGRAM_UNIFORM_3IV
,
426 OPCODE_PROGRAM_UNIFORM_4IV
,
427 OPCODE_PROGRAM_UNIFORM_1UI
,
428 OPCODE_PROGRAM_UNIFORM_2UI
,
429 OPCODE_PROGRAM_UNIFORM_3UI
,
430 OPCODE_PROGRAM_UNIFORM_4UI
,
431 OPCODE_PROGRAM_UNIFORM_1UIV
,
432 OPCODE_PROGRAM_UNIFORM_2UIV
,
433 OPCODE_PROGRAM_UNIFORM_3UIV
,
434 OPCODE_PROGRAM_UNIFORM_4UIV
,
435 OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
436 OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
437 OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
438 OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
439 OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
440 OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
441 OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
442 OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
443 OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
444 OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
445 OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
446 OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
447 OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
448 OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
449 OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
450 OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
451 OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
452 OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
454 /* GL_ARB_clip_control */
457 /* GL_ARB_color_buffer_float */
460 /* GL_EXT_framebuffer_blit */
461 OPCODE_BLIT_FRAMEBUFFER
,
463 /* Vertex attributes -- fallback for when optimized display
464 * list build isn't active.
487 /* GL_EXT_provoking_vertex */
488 OPCODE_PROVOKING_VERTEX
,
490 /* GL_EXT_transform_feedback */
491 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
492 OPCODE_END_TRANSFORM_FEEDBACK
,
493 OPCODE_BIND_TRANSFORM_FEEDBACK
,
494 OPCODE_PAUSE_TRANSFORM_FEEDBACK
,
495 OPCODE_RESUME_TRANSFORM_FEEDBACK
,
496 OPCODE_DRAW_TRANSFORM_FEEDBACK
,
498 /* GL_EXT_texture_integer */
500 OPCODE_CLEARCOLOR_UI
,
501 OPCODE_TEXPARAMETER_I
,
502 OPCODE_TEXPARAMETER_UI
,
504 /* GL_ARB_instanced_arrays */
505 OPCODE_VERTEX_ATTRIB_DIVISOR
,
507 /* GL_NV_texture_barrier */
508 OPCODE_TEXTURE_BARRIER_NV
,
510 /* GL_ARB_sampler_object */
512 OPCODE_SAMPLER_PARAMETERIV
,
513 OPCODE_SAMPLER_PARAMETERFV
,
514 OPCODE_SAMPLER_PARAMETERIIV
,
515 OPCODE_SAMPLER_PARAMETERUIV
,
517 /* ARB_compute_shader */
518 OPCODE_DISPATCH_COMPUTE
,
523 /* GL_NV_conditional_render */
524 OPCODE_BEGIN_CONDITIONAL_RENDER
,
525 OPCODE_END_CONDITIONAL_RENDER
,
527 /* ARB_timer_query */
528 OPCODE_QUERY_COUNTER
,
530 /* ARB_transform_feedback3 */
531 OPCODE_BEGIN_QUERY_INDEXED
,
532 OPCODE_END_QUERY_INDEXED
,
533 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
,
535 /* ARB_transform_feedback_instanced */
536 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
,
537 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
,
539 /* ARB_uniform_buffer_object */
540 OPCODE_UNIFORM_BLOCK_BINDING
,
542 /* ARB_shader_subroutines */
543 OPCODE_UNIFORM_SUBROUTINES
,
545 /* EXT_polygon_offset_clamp */
546 OPCODE_POLYGON_OFFSET_CLAMP
,
548 /* EXT_window_rectangles */
549 OPCODE_WINDOW_RECTANGLES
,
551 /* NV_conservative_raster */
552 OPCODE_SUBPIXEL_PRECISION_BIAS
,
554 /* NV_conservative_raster_dilate */
555 OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
,
557 /* NV_conservative_raster_pre_snap_triangles */
558 OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
,
560 /* EXT_direct_state_access */
563 OPCODE_MATRIX_ROTATE
,
565 OPCODE_MATRIX_TRANSLATE
,
566 OPCODE_MATRIX_LOAD_IDENTITY
,
568 OPCODE_MATRIX_FRUSTUM
,
571 OPCODE_TEXTUREPARAMETER_F
,
572 OPCODE_TEXTUREPARAMETER_I
,
573 OPCODE_TEXTURE_IMAGE1D
,
574 OPCODE_TEXTURE_IMAGE2D
,
575 OPCODE_TEXTURE_IMAGE3D
,
576 OPCODE_TEXTURE_SUB_IMAGE1D
,
577 OPCODE_TEXTURE_SUB_IMAGE2D
,
578 OPCODE_TEXTURE_SUB_IMAGE3D
,
579 OPCODE_COPY_TEXTURE_IMAGE1D
,
580 OPCODE_COPY_TEXTURE_IMAGE2D
,
581 OPCODE_COPY_TEXTURE_SUB_IMAGE1D
,
582 OPCODE_COPY_TEXTURE_SUB_IMAGE2D
,
583 OPCODE_COPY_TEXTURE_SUB_IMAGE3D
,
584 OPCODE_BIND_MULTITEXTURE
,
585 OPCODE_MULTITEXPARAMETER_F
,
586 OPCODE_MULTITEXPARAMETER_I
,
587 OPCODE_MULTITEX_IMAGE1D
,
588 OPCODE_MULTITEX_IMAGE2D
,
589 OPCODE_MULTITEX_IMAGE3D
,
590 OPCODE_MULTITEX_SUB_IMAGE1D
,
591 OPCODE_MULTITEX_SUB_IMAGE2D
,
592 OPCODE_MULTITEX_SUB_IMAGE3D
,
593 OPCODE_COPY_MULTITEX_IMAGE1D
,
594 OPCODE_COPY_MULTITEX_IMAGE2D
,
595 OPCODE_COPY_MULTITEX_SUB_IMAGE1D
,
596 OPCODE_COPY_MULTITEX_SUB_IMAGE2D
,
597 OPCODE_COPY_MULTITEX_SUB_IMAGE3D
,
599 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
601 /* The following three are meta instructions */
602 OPCODE_ERROR
, /* raise compiled-in error */
604 OPCODE_NOP
, /* No-op (used for 8-byte alignment */
614 * Display list instructions are stored as sequences of "nodes". Nodes
615 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
616 * are linked together with a pointer.
618 * Each instruction in the display list is stored as a sequence of
619 * contiguous nodes in memory.
620 * Each node is the union of a variety of data types.
622 * Note, all of these members should be 4 bytes in size or less for the
623 * sake of compact display lists. We store 8-byte pointers in a pair of
624 * these nodes using the save/get_pointer() functions below.
642 typedef union gl_dlist_node Node
;
645 /** How many 4-byte dwords to store a pointer */
646 #define POINTER_DWORDS (sizeof(void *) / 4)
648 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
649 * space for display lists. The following types and functions are
650 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
655 GLuint dwords
[POINTER_DWORDS
];
660 * Save a 4 or 8-byte pointer at dest (and dest+1).
663 save_pointer(Node
*dest
, void *src
)
668 STATIC_ASSERT(POINTER_DWORDS
== 1 || POINTER_DWORDS
== 2);
669 STATIC_ASSERT(sizeof(Node
) == 4);
673 for (i
= 0; i
< POINTER_DWORDS
; i
++)
674 dest
[i
].ui
= p
.dwords
[i
];
679 * Retrieve a 4 or 8-byte pointer from node (node+1).
682 get_pointer(const Node
*node
)
687 for (i
= 0; i
< POINTER_DWORDS
; i
++)
688 p
.dwords
[i
] = node
[i
].ui
;
695 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
712 #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \
714 union float64_pair tmp; \
716 n[idx].ui = tmp.uint32[0]; \
717 n[idx+1].ui = tmp.uint32[1]; \
722 * How many nodes to allocate at a time. Note that bulk vertex data
723 * from glBegin/glVertex/glEnd primitives will typically wind up in
724 * a VBO, and not directly in the display list itself.
726 #define BLOCK_SIZE 256
731 * Number of nodes of storage needed for each instruction.
732 * Sizes for dynamically allocated opcodes are stored in the context struct.
734 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
737 void mesa_print_display_list(GLuint list
);
741 * Does the given display list only contain a single glBitmap call?
744 is_bitmap_list(const struct gl_display_list
*dlist
)
746 const Node
*n
= dlist
->Head
;
747 if (n
[0].opcode
== OPCODE_BITMAP
) {
748 n
+= InstSize
[OPCODE_BITMAP
];
749 if (n
[0].opcode
== OPCODE_END_OF_LIST
)
757 * Is the given display list an empty list?
760 is_empty_list(const struct gl_display_list
*dlist
)
762 const Node
*n
= dlist
->Head
;
763 return n
[0].opcode
== OPCODE_END_OF_LIST
;
768 * Delete/free a gl_bitmap_atlas. Called during context tear-down.
771 _mesa_delete_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
)
774 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
782 * Lookup a gl_bitmap_atlas by listBase ID.
784 static struct gl_bitmap_atlas
*
785 lookup_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
787 struct gl_bitmap_atlas
*atlas
;
789 assert(listBase
> 0);
790 atlas
= _mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
);
796 * Create new bitmap atlas and insert into hash table.
798 static struct gl_bitmap_atlas
*
799 alloc_bitmap_atlas(struct gl_context
*ctx
, GLuint listBase
)
801 struct gl_bitmap_atlas
*atlas
;
803 assert(listBase
> 0);
804 assert(_mesa_HashLookup(ctx
->Shared
->BitmapAtlas
, listBase
) == NULL
);
806 atlas
= calloc(1, sizeof(*atlas
));
808 _mesa_HashInsert(ctx
->Shared
->BitmapAtlas
, listBase
, atlas
);
816 * Try to build a bitmap atlas. This involves examining a sequence of
817 * display lists which contain glBitmap commands and putting the bitmap
818 * images into a texture map (the atlas).
819 * If we succeed, gl_bitmap_atlas::complete will be set to true.
820 * If we fail, gl_bitmap_atlas::incomplete will be set to true.
823 build_bitmap_atlas(struct gl_context
*ctx
, struct gl_bitmap_atlas
*atlas
,
826 unsigned i
, row_height
= 0, xpos
= 0, ypos
= 0;
831 assert(!atlas
->complete
);
832 assert(atlas
->numBitmaps
> 0);
834 /* We use a rectangle texture (non-normalized coords) for the atlas */
835 assert(ctx
->Extensions
.NV_texture_rectangle
);
836 assert(ctx
->Const
.MaxTextureRectSize
>= 1024);
838 atlas
->texWidth
= 1024;
839 atlas
->texHeight
= 0; /* determined below */
841 atlas
->glyphs
= malloc(atlas
->numBitmaps
* sizeof(atlas
->glyphs
[0]));
842 if (!atlas
->glyphs
) {
844 atlas
->incomplete
= true;
848 /* Loop over the display lists. They should all contain a single glBitmap
849 * call. If not, bail out. Also, compute the position and sizes of each
850 * bitmap in the atlas to determine the texture atlas size.
852 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
853 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
855 struct gl_bitmap_glyph
*g
= &atlas
->glyphs
[i
];
856 unsigned bitmap_width
, bitmap_height
;
857 float bitmap_xmove
, bitmap_ymove
, bitmap_xorig
, bitmap_yorig
;
859 if (!list
|| is_empty_list(list
)) {
861 atlas
->numBitmaps
= i
;
865 if (!is_bitmap_list(list
)) {
866 /* This list does not contain exactly one glBitmap command. Give up. */
867 atlas
->incomplete
= true;
871 /* get bitmap info from the display list command */
873 assert(n
[0].opcode
== OPCODE_BITMAP
);
874 bitmap_width
= n
[1].i
;
875 bitmap_height
= n
[2].i
;
876 bitmap_xorig
= n
[3].f
;
877 bitmap_yorig
= n
[4].f
;
878 bitmap_xmove
= n
[5].f
;
879 bitmap_ymove
= n
[6].f
;
881 if (xpos
+ bitmap_width
> atlas
->texWidth
) {
882 /* advance to the next row of the texture */
888 /* save the bitmap's position in the atlas */
892 g
->h
= bitmap_height
;
893 g
->xorig
= bitmap_xorig
;
894 g
->yorig
= bitmap_yorig
;
895 g
->xmove
= bitmap_xmove
;
896 g
->ymove
= bitmap_ymove
;
898 xpos
+= bitmap_width
;
900 /* keep track of tallest bitmap in the row */
901 row_height
= MAX2(row_height
, bitmap_height
);
904 /* Now we know the texture height */
905 atlas
->texHeight
= ypos
+ row_height
;
907 if (atlas
->texHeight
== 0) {
908 /* no glyphs found, give up */
911 else if (atlas
->texHeight
> ctx
->Const
.MaxTextureRectSize
) {
912 /* too large, give up */
916 /* Create atlas texture (texture ID is irrelevant) */
917 atlas
->texObj
= ctx
->Driver
.NewTextureObject(ctx
, 999, GL_TEXTURE_RECTANGLE
);
918 if (!atlas
->texObj
) {
922 atlas
->texObj
->Sampler
.MinFilter
= GL_NEAREST
;
923 atlas
->texObj
->Sampler
.MagFilter
= GL_NEAREST
;
924 atlas
->texObj
->MaxLevel
= 0;
925 atlas
->texObj
->Immutable
= GL_TRUE
;
927 atlas
->texImage
= _mesa_get_tex_image(ctx
, atlas
->texObj
,
928 GL_TEXTURE_RECTANGLE
, 0);
929 if (!atlas
->texImage
) {
933 _mesa_init_teximage_fields(ctx
, atlas
->texImage
,
934 atlas
->texWidth
, atlas
->texHeight
, 1, 0,
935 GL_ALPHA
, MESA_FORMAT_A_UNORM8
);
937 /* alloc image storage */
938 if (!ctx
->Driver
.AllocTextureImageBuffer(ctx
, atlas
->texImage
)) {
942 /* map teximage, load with bitmap glyphs */
943 ctx
->Driver
.MapTextureImage(ctx
, atlas
->texImage
, 0,
944 0, 0, atlas
->texWidth
, atlas
->texHeight
,
945 GL_MAP_WRITE_BIT
, &map
, &map_stride
);
950 /* Background/clear pixels are 0xff, foreground/set pixels are 0x0 */
951 memset(map
, 0xff, map_stride
* atlas
->texHeight
);
953 for (i
= 0; i
< atlas
->numBitmaps
; i
++) {
954 const struct gl_display_list
*list
= _mesa_lookup_list(ctx
, listBase
+ i
);
955 const Node
*n
= list
->Head
;
957 assert(n
[0].opcode
== OPCODE_BITMAP
||
958 n
[0].opcode
== OPCODE_END_OF_LIST
);
960 if (n
[0].opcode
== OPCODE_BITMAP
) {
961 unsigned bitmap_width
= n
[1].i
;
962 unsigned bitmap_height
= n
[2].i
;
963 unsigned xpos
= atlas
->glyphs
[i
].x
;
964 unsigned ypos
= atlas
->glyphs
[i
].y
;
965 const void *bitmap_image
= get_pointer(&n
[7]);
967 assert(atlas
->glyphs
[i
].w
== bitmap_width
);
968 assert(atlas
->glyphs
[i
].h
== bitmap_height
);
970 /* put the bitmap image into the texture image */
971 _mesa_expand_bitmap(bitmap_width
, bitmap_height
,
972 &ctx
->DefaultPacking
, bitmap_image
,
973 map
+ map_stride
* ypos
+ xpos
, /* dest addr */
978 ctx
->Driver
.UnmapTextureImage(ctx
, atlas
->texImage
, 0);
980 atlas
->complete
= true;
985 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Display list bitmap atlas");
988 ctx
->Driver
.DeleteTexture(ctx
, atlas
->texObj
);
991 atlas
->glyphs
= NULL
;
992 atlas
->incomplete
= true;
997 * Allocate a gl_display_list object with an initial block of storage.
998 * \param count how many display list nodes/tokens to allocate
1000 static struct gl_display_list
*
1001 make_list(GLuint name
, GLuint count
)
1003 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
1005 dlist
->Head
= malloc(sizeof(Node
) * count
);
1006 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
1007 /* All InstSize[] entries must be non-zero */
1008 InstSize
[OPCODE_END_OF_LIST
] = 1;
1014 * Lookup function to just encapsulate casting.
1016 struct gl_display_list
*
1017 _mesa_lookup_list(struct gl_context
*ctx
, GLuint list
)
1019 return (struct gl_display_list
*)
1020 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
1024 /** Is the given opcode an extension code? */
1025 static inline GLboolean
1026 is_ext_opcode(OpCode opcode
)
1028 return (opcode
>= OPCODE_EXT_0
);
1032 /** Destroy an extended opcode instruction */
1034 ext_opcode_destroy(struct gl_context
*ctx
, Node
*node
)
1036 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1038 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
1039 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1044 /** Execute an extended opcode instruction */
1046 ext_opcode_execute(struct gl_context
*ctx
, Node
*node
)
1048 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1050 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
1051 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1056 /** Print an extended opcode instruction */
1058 ext_opcode_print(struct gl_context
*ctx
, Node
*node
, FILE *f
)
1060 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
1062 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1], f
);
1063 step
= ctx
->ListExt
->Opcode
[i
].Size
;
1069 * Delete the named display list, but don't remove from hash table.
1070 * \param dlist - display list pointer
1073 _mesa_delete_list(struct gl_context
*ctx
, struct gl_display_list
*dlist
)
1078 n
= block
= dlist
->Head
;
1080 done
= block
? GL_FALSE
: GL_TRUE
;
1082 const OpCode opcode
= n
[0].opcode
;
1084 /* check for extension opcodes first */
1085 if (is_ext_opcode(opcode
)) {
1086 n
+= ext_opcode_destroy(ctx
, n
);
1090 /* for some commands, we need to free malloc'd memory */
1092 free(get_pointer(&n
[6]));
1095 free(get_pointer(&n
[10]));
1097 case OPCODE_CALL_LISTS
:
1098 free(get_pointer(&n
[3]));
1100 case OPCODE_DRAW_PIXELS
:
1101 free(get_pointer(&n
[5]));
1104 free(get_pointer(&n
[7]));
1106 case OPCODE_POLYGON_STIPPLE
:
1107 free(get_pointer(&n
[1]));
1109 case OPCODE_TEX_IMAGE1D
:
1110 free(get_pointer(&n
[8]));
1112 case OPCODE_TEX_IMAGE2D
:
1113 free(get_pointer(&n
[9]));
1115 case OPCODE_TEX_IMAGE3D
:
1116 free(get_pointer(&n
[10]));
1118 case OPCODE_TEX_SUB_IMAGE1D
:
1119 free(get_pointer(&n
[7]));
1121 case OPCODE_TEX_SUB_IMAGE2D
:
1122 free(get_pointer(&n
[9]));
1124 case OPCODE_TEX_SUB_IMAGE3D
:
1125 free(get_pointer(&n
[11]));
1127 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
1128 free(get_pointer(&n
[7]));
1130 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
1131 free(get_pointer(&n
[8]));
1133 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
1134 free(get_pointer(&n
[9]));
1136 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
1137 free(get_pointer(&n
[7]));
1139 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
1140 free(get_pointer(&n
[9]));
1142 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
1143 free(get_pointer(&n
[11]));
1145 case OPCODE_PROGRAM_STRING_ARB
:
1146 free(get_pointer(&n
[4])); /* program string */
1148 case OPCODE_UNIFORM_1FV
:
1149 case OPCODE_UNIFORM_2FV
:
1150 case OPCODE_UNIFORM_3FV
:
1151 case OPCODE_UNIFORM_4FV
:
1152 case OPCODE_UNIFORM_1DV
:
1153 case OPCODE_UNIFORM_2DV
:
1154 case OPCODE_UNIFORM_3DV
:
1155 case OPCODE_UNIFORM_4DV
:
1156 case OPCODE_UNIFORM_1IV
:
1157 case OPCODE_UNIFORM_2IV
:
1158 case OPCODE_UNIFORM_3IV
:
1159 case OPCODE_UNIFORM_4IV
:
1160 case OPCODE_UNIFORM_1UIV
:
1161 case OPCODE_UNIFORM_2UIV
:
1162 case OPCODE_UNIFORM_3UIV
:
1163 case OPCODE_UNIFORM_4UIV
:
1164 free(get_pointer(&n
[3]));
1166 case OPCODE_UNIFORM_MATRIX22
:
1167 case OPCODE_UNIFORM_MATRIX33
:
1168 case OPCODE_UNIFORM_MATRIX44
:
1169 case OPCODE_UNIFORM_MATRIX24
:
1170 case OPCODE_UNIFORM_MATRIX42
:
1171 case OPCODE_UNIFORM_MATRIX23
:
1172 case OPCODE_UNIFORM_MATRIX32
:
1173 case OPCODE_UNIFORM_MATRIX34
:
1174 case OPCODE_UNIFORM_MATRIX43
:
1175 case OPCODE_UNIFORM_MATRIX22D
:
1176 case OPCODE_UNIFORM_MATRIX33D
:
1177 case OPCODE_UNIFORM_MATRIX44D
:
1178 case OPCODE_UNIFORM_MATRIX24D
:
1179 case OPCODE_UNIFORM_MATRIX42D
:
1180 case OPCODE_UNIFORM_MATRIX23D
:
1181 case OPCODE_UNIFORM_MATRIX32D
:
1182 case OPCODE_UNIFORM_MATRIX34D
:
1183 case OPCODE_UNIFORM_MATRIX43D
:
1184 free(get_pointer(&n
[4]));
1186 case OPCODE_PROGRAM_UNIFORM_1FV
:
1187 case OPCODE_PROGRAM_UNIFORM_2FV
:
1188 case OPCODE_PROGRAM_UNIFORM_3FV
:
1189 case OPCODE_PROGRAM_UNIFORM_4FV
:
1190 case OPCODE_PROGRAM_UNIFORM_1DV
:
1191 case OPCODE_PROGRAM_UNIFORM_2DV
:
1192 case OPCODE_PROGRAM_UNIFORM_3DV
:
1193 case OPCODE_PROGRAM_UNIFORM_4DV
:
1194 case OPCODE_PROGRAM_UNIFORM_1IV
:
1195 case OPCODE_PROGRAM_UNIFORM_2IV
:
1196 case OPCODE_PROGRAM_UNIFORM_3IV
:
1197 case OPCODE_PROGRAM_UNIFORM_4IV
:
1198 case OPCODE_PROGRAM_UNIFORM_1UIV
:
1199 case OPCODE_PROGRAM_UNIFORM_2UIV
:
1200 case OPCODE_PROGRAM_UNIFORM_3UIV
:
1201 case OPCODE_PROGRAM_UNIFORM_4UIV
:
1202 free(get_pointer(&n
[4]));
1204 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
1205 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
1206 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
1207 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
1208 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
1209 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
1210 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
1211 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
1212 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
1213 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
1214 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
1215 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
1216 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
1217 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
1218 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
1219 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
1220 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
1221 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
1222 free(get_pointer(&n
[5]));
1224 case OPCODE_PIXEL_MAP
:
1225 free(get_pointer(&n
[3]));
1227 case OPCODE_VIEWPORT_ARRAY_V
:
1228 case OPCODE_SCISSOR_ARRAY_V
:
1229 case OPCODE_DEPTH_ARRAY_V
:
1230 case OPCODE_UNIFORM_SUBROUTINES
:
1231 case OPCODE_WINDOW_RECTANGLES
:
1232 free(get_pointer(&n
[3]));
1234 case OPCODE_TEXTURE_IMAGE1D
:
1235 case OPCODE_MULTITEX_IMAGE1D
:
1236 free(get_pointer(&n
[9]));
1238 case OPCODE_TEXTURE_IMAGE2D
:
1239 case OPCODE_MULTITEX_IMAGE2D
:
1240 free(get_pointer(&n
[10]));
1242 case OPCODE_TEXTURE_IMAGE3D
:
1243 case OPCODE_MULTITEX_IMAGE3D
:
1244 free(get_pointer(&n
[11]));
1246 case OPCODE_TEXTURE_SUB_IMAGE1D
:
1247 case OPCODE_MULTITEX_SUB_IMAGE1D
:
1248 free(get_pointer(&n
[8]));
1250 case OPCODE_TEXTURE_SUB_IMAGE2D
:
1251 case OPCODE_MULTITEX_SUB_IMAGE2D
:
1252 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
1253 free(get_pointer(&n
[10]));
1255 case OPCODE_TEXTURE_SUB_IMAGE3D
:
1256 case OPCODE_MULTITEX_SUB_IMAGE3D
:
1257 free(get_pointer(&n
[12]));
1259 case OPCODE_CONTINUE
:
1260 n
= (Node
*) get_pointer(&n
[1]);
1264 case OPCODE_END_OF_LIST
:
1269 /* just increment 'n' pointer, below */
1273 if (opcode
!= OPCODE_CONTINUE
) {
1274 assert(InstSize
[opcode
] > 0);
1275 n
+= InstSize
[opcode
];
1286 * Called by _mesa_HashWalk() to check if a display list which is being
1287 * deleted belongs to a bitmap texture atlas.
1290 check_atlas_for_deleted_list(GLuint atlas_id
, void *data
, void *userData
)
1292 struct gl_bitmap_atlas
*atlas
= (struct gl_bitmap_atlas
*) data
;
1293 GLuint list_id
= *((GLuint
*) userData
); /* the list being deleted */
1295 /* See if the list_id falls in the range contained in this texture atlas */
1296 if (atlas
->complete
&&
1297 list_id
>= atlas_id
&&
1298 list_id
< atlas_id
+ atlas
->numBitmaps
) {
1299 /* Mark the atlas as incomplete so it doesn't get used. But don't
1300 * delete it yet since we don't want to try to recreate it in the next
1303 atlas
->complete
= false;
1304 atlas
->incomplete
= true;
1310 * Destroy a display list and remove from hash table.
1311 * \param list - display list number
1314 destroy_list(struct gl_context
*ctx
, GLuint list
)
1316 struct gl_display_list
*dlist
;
1321 dlist
= _mesa_lookup_list(ctx
, list
);
1325 if (is_bitmap_list(dlist
)) {
1326 /* If we're destroying a simple glBitmap display list, there's a
1327 * chance that we're destroying a bitmap image that's in a texture
1328 * atlas. Examine all atlases to see if that's the case. There's
1329 * usually few (if any) atlases so this isn't expensive.
1331 _mesa_HashWalk(ctx
->Shared
->BitmapAtlas
,
1332 check_atlas_for_deleted_list
, &list
);
1335 _mesa_delete_list(ctx
, dlist
);
1336 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
1341 * Translate the nth element of list from <type> to GLint.
1344 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
1356 bptr
= (GLbyte
*) list
;
1357 return (GLint
) bptr
[n
];
1358 case GL_UNSIGNED_BYTE
:
1359 ubptr
= (GLubyte
*) list
;
1360 return (GLint
) ubptr
[n
];
1362 sptr
= (GLshort
*) list
;
1363 return (GLint
) sptr
[n
];
1364 case GL_UNSIGNED_SHORT
:
1365 usptr
= (GLushort
*) list
;
1366 return (GLint
) usptr
[n
];
1368 iptr
= (GLint
*) list
;
1370 case GL_UNSIGNED_INT
:
1371 uiptr
= (GLuint
*) list
;
1372 return (GLint
) uiptr
[n
];
1374 fptr
= (GLfloat
*) list
;
1375 return (GLint
) floorf(fptr
[n
]);
1377 ubptr
= ((GLubyte
*) list
) + 2 * n
;
1378 return (GLint
) ubptr
[0] * 256
1381 ubptr
= ((GLubyte
*) list
) + 3 * n
;
1382 return (GLint
) ubptr
[0] * 65536
1383 + (GLint
) ubptr
[1] * 256
1386 ubptr
= ((GLubyte
*) list
) + 4 * n
;
1387 return (GLint
) ubptr
[0] * 16777216
1388 + (GLint
) ubptr
[1] * 65536
1389 + (GLint
) ubptr
[2] * 256
1398 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1399 * If width < 0 or height < 0 or format or type are invalid we'll just
1400 * return NULL. We will not generate an error since OpenGL command
1401 * arguments aren't error-checked until the command is actually executed
1402 * (not when they're compiled).
1403 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1406 unpack_image(struct gl_context
*ctx
, GLuint dimensions
,
1407 GLsizei width
, GLsizei height
, GLsizei depth
,
1408 GLenum format
, GLenum type
, const GLvoid
* pixels
,
1409 const struct gl_pixelstore_attrib
*unpack
)
1411 if (width
<= 0 || height
<= 0) {
1415 if (_mesa_bytes_per_pixel(format
, type
) < 0) {
1416 /* bad format and/or type */
1420 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
1424 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1425 format
, type
, pixels
, unpack
);
1426 if (pixels
&& !image
) {
1427 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1431 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
,
1432 depth
, format
, type
, INT_MAX
, pixels
)) {
1433 const GLubyte
*map
, *src
;
1437 ctx
->Driver
.MapBufferRange(ctx
, 0, unpack
->BufferObj
->Size
,
1438 GL_MAP_READ_BIT
, unpack
->BufferObj
,
1441 /* unable to map src buffer! */
1442 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
1446 src
= ADD_POINTERS(map
, pixels
);
1447 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
1448 format
, type
, src
, unpack
);
1450 ctx
->Driver
.UnmapBuffer(ctx
, unpack
->BufferObj
, MAP_INTERNAL
);
1453 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
1459 _mesa_error(ctx
, GL_INVALID_OPERATION
, "invalid PBO access");
1464 /** Return copy of memory */
1466 memdup(const void *src
, GLsizei bytes
)
1468 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
1470 memcpy(b
, src
, bytes
);
1476 * Allocate space for a display list instruction (opcode + payload space).
1477 * \param opcode the instruction opcode (OPCODE_* value)
1478 * \param bytes instruction payload size (not counting opcode)
1479 * \param align8 does the payload need to be 8-byte aligned?
1480 * This is only relevant in 64-bit environments.
1481 * \return pointer to allocated memory (the payload will be at pointer+1)
1484 dlist_alloc(struct gl_context
*ctx
, OpCode opcode
, GLuint bytes
, bool align8
)
1486 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
1487 const GLuint contNodes
= 1 + POINTER_DWORDS
; /* size of continue info */
1491 assert(bytes
<= BLOCK_SIZE
* sizeof(Node
));
1493 if (opcode
< OPCODE_EXT_0
) {
1494 if (InstSize
[opcode
] == 0) {
1495 /* save instruction size now */
1496 InstSize
[opcode
] = numNodes
;
1499 /* make sure instruction size agrees */
1500 assert(numNodes
== InstSize
[opcode
]);
1504 if (sizeof(void *) > sizeof(Node
) && align8
1505 && ctx
->ListState
.CurrentPos
% 2 == 0) {
1506 /* The opcode would get placed at node[0] and the payload would start
1507 * at node[1]. But the payload needs to be at an even offset (8-byte
1516 if (ctx
->ListState
.CurrentPos
+ nopNode
+ numNodes
+ contNodes
1518 /* This block is full. Allocate a new block and chain to it */
1520 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1521 n
[0].opcode
= OPCODE_CONTINUE
;
1522 newblock
= malloc(sizeof(Node
) * BLOCK_SIZE
);
1524 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
1528 /* a fresh block should be 8-byte aligned on 64-bit systems */
1529 assert(((GLintptr
) newblock
) % sizeof(void *) == 0);
1531 save_pointer(&n
[1], newblock
);
1532 ctx
->ListState
.CurrentBlock
= newblock
;
1533 ctx
->ListState
.CurrentPos
= 0;
1535 /* Display list nodes are always 4 bytes. If we need 8-byte alignment
1536 * we have to insert a NOP so that the payload of the real opcode lands
1537 * on an even location:
1538 * node[0] = OPCODE_NOP
1539 * node[1] = OPCODE_x;
1540 * node[2] = start of payload
1542 nopNode
= sizeof(void *) > sizeof(Node
) && align8
;
1545 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
1547 assert(ctx
->ListState
.CurrentPos
% 2 == 0); /* even value */
1548 n
[0].opcode
= OPCODE_NOP
;
1550 /* The "real" opcode will now be at an odd location and the payload
1551 * will be at an even location.
1554 ctx
->ListState
.CurrentPos
+= nopNode
+ numNodes
;
1556 n
[0].opcode
= opcode
;
1564 * Allocate space for a display list instruction. Used by callers outside
1565 * this file for things like VBO vertex data.
1567 * \param opcode the instruction opcode (OPCODE_* value)
1568 * \param bytes instruction size in bytes, not counting opcode.
1569 * \return pointer to the usable data area (not including the internal
1573 _mesa_dlist_alloc(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1575 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, false);
1577 return n
+ 1; /* return pointer to payload area, after opcode */
1584 * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
1585 * aligned in 64-bit environments, 4-byte aligned otherwise.
1588 _mesa_dlist_alloc_aligned(struct gl_context
*ctx
, GLuint opcode
, GLuint bytes
)
1590 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
, true);
1592 return n
+ 1; /* return pointer to payload area, after opcode */
1599 * This function allows modules and drivers to get their own opcodes
1600 * for extending display list functionality.
1601 * \param ctx the rendering context
1602 * \param size number of bytes for storing the new display list command
1603 * \param execute function to execute the new display list command
1604 * \param destroy function to destroy the new display list command
1605 * \param print function to print the new display list command
1606 * \return the new opcode number or -1 if error
1609 _mesa_dlist_alloc_opcode(struct gl_context
*ctx
,
1611 void (*execute
) (struct gl_context
*, void *),
1612 void (*destroy
) (struct gl_context
*, void *),
1613 void (*print
) (struct gl_context
*, void *, FILE *))
1615 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
1616 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
1617 ctx
->ListExt
->Opcode
[i
].Size
=
1618 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
1619 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
1620 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
1621 ctx
->ListExt
->Opcode
[i
].Print
= print
;
1622 return i
+ OPCODE_EXT_0
;
1629 * Allocate space for a display list instruction. The space is basically
1630 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1631 * function parameter, node[2] is the second parameter, etc.
1633 * \param opcode one of OPCODE_x
1634 * \param nparams number of function parameters
1635 * \return pointer to start of instruction space
1637 static inline Node
*
1638 alloc_instruction(struct gl_context
*ctx
, OpCode opcode
, GLuint nparams
)
1640 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
), false);
1645 * Called by EndList to try to reduce memory used for the list.
1648 trim_list(struct gl_context
*ctx
)
1650 /* If the list we're ending only has one allocated block of nodes/tokens
1651 * and its size isn't a full block size, realloc the block to use less
1652 * memory. This is important for apps that create many small display
1653 * lists and apps that use glXUseXFont (many lists each containing one
1655 * Note: we currently only trim display lists that allocated one block
1656 * of tokens. That hits the short list case which is what we're mainly
1657 * concerned with. Trimming longer lists would involve traversing the
1658 * linked list of blocks.
1660 struct gl_dlist_state
*list
= &ctx
->ListState
;
1662 if ((list
->CurrentList
->Head
== list
->CurrentBlock
) &&
1663 (list
->CurrentPos
< BLOCK_SIZE
)) {
1664 /* There's only one block and it's not full, so realloc */
1665 GLuint newSize
= list
->CurrentPos
* sizeof(Node
);
1666 list
->CurrentList
->Head
=
1667 list
->CurrentBlock
= realloc(list
->CurrentBlock
, newSize
);
1668 if (!list
->CurrentBlock
) {
1669 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glEndList");
1677 * Display List compilation functions
1679 static void GLAPIENTRY
1680 save_Accum(GLenum op
, GLfloat value
)
1682 GET_CURRENT_CONTEXT(ctx
);
1684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1685 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
1690 if (ctx
->ExecuteFlag
) {
1691 CALL_Accum(ctx
->Exec
, (op
, value
));
1696 static void GLAPIENTRY
1697 save_AlphaFunc(GLenum func
, GLclampf ref
)
1699 GET_CURRENT_CONTEXT(ctx
);
1701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1702 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1705 n
[2].f
= (GLfloat
) ref
;
1707 if (ctx
->ExecuteFlag
) {
1708 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1713 static void GLAPIENTRY
1714 save_BindTexture(GLenum target
, GLuint texture
)
1716 GET_CURRENT_CONTEXT(ctx
);
1718 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1719 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1724 if (ctx
->ExecuteFlag
) {
1725 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1730 static void GLAPIENTRY
1731 save_Bitmap(GLsizei width
, GLsizei height
,
1732 GLfloat xorig
, GLfloat yorig
,
1733 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1735 GET_CURRENT_CONTEXT(ctx
);
1737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1738 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 6 + POINTER_DWORDS
);
1740 n
[1].i
= (GLint
) width
;
1741 n
[2].i
= (GLint
) height
;
1747 unpack_image(ctx
, 2, width
, height
, 1, GL_COLOR_INDEX
,
1748 GL_BITMAP
, pixels
, &ctx
->Unpack
));
1750 if (ctx
->ExecuteFlag
) {
1751 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1752 xorig
, yorig
, xmove
, ymove
, pixels
));
1757 static void GLAPIENTRY
1758 save_BlendEquation(GLenum mode
)
1760 GET_CURRENT_CONTEXT(ctx
);
1762 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1763 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1767 if (ctx
->ExecuteFlag
) {
1768 CALL_BlendEquation(ctx
->Exec
, (mode
));
1773 static void GLAPIENTRY
1774 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1776 GET_CURRENT_CONTEXT(ctx
);
1778 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1779 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1784 if (ctx
->ExecuteFlag
) {
1785 CALL_BlendEquationSeparate(ctx
->Exec
, (modeRGB
, modeA
));
1790 static void GLAPIENTRY
1791 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1792 GLenum sfactorA
, GLenum dfactorA
)
1794 GET_CURRENT_CONTEXT(ctx
);
1796 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1797 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1799 n
[1].e
= sfactorRGB
;
1800 n
[2].e
= dfactorRGB
;
1804 if (ctx
->ExecuteFlag
) {
1805 CALL_BlendFuncSeparate(ctx
->Exec
,
1806 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1811 static void GLAPIENTRY
1812 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1814 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1818 static void GLAPIENTRY
1819 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1821 GET_CURRENT_CONTEXT(ctx
);
1823 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1824 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1831 if (ctx
->ExecuteFlag
) {
1832 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1836 /* GL_ARB_draw_buffers_blend */
1837 static void GLAPIENTRY
1838 save_BlendFuncSeparatei(GLuint buf
, GLenum sfactorRGB
, GLenum dfactorRGB
,
1839 GLenum sfactorA
, GLenum dfactorA
)
1841 GET_CURRENT_CONTEXT(ctx
);
1843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1844 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE_I
, 5);
1847 n
[2].e
= sfactorRGB
;
1848 n
[3].e
= dfactorRGB
;
1852 if (ctx
->ExecuteFlag
) {
1853 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (buf
, sfactorRGB
, dfactorRGB
,
1854 sfactorA
, dfactorA
));
1858 /* GL_ARB_draw_buffers_blend */
1859 static void GLAPIENTRY
1860 save_BlendFunci(GLuint buf
, GLenum sfactor
, GLenum dfactor
)
1862 GET_CURRENT_CONTEXT(ctx
);
1864 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1865 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_I
, 3);
1871 if (ctx
->ExecuteFlag
) {
1872 CALL_BlendFunciARB(ctx
->Exec
, (buf
, sfactor
, dfactor
));
1876 /* GL_ARB_draw_buffers_blend */
1877 static void GLAPIENTRY
1878 save_BlendEquationi(GLuint buf
, GLenum mode
)
1880 GET_CURRENT_CONTEXT(ctx
);
1882 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1883 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_I
, 2);
1888 if (ctx
->ExecuteFlag
) {
1889 CALL_BlendEquationiARB(ctx
->Exec
, (buf
, mode
));
1893 /* GL_ARB_draw_buffers_blend */
1894 static void GLAPIENTRY
1895 save_BlendEquationSeparatei(GLuint buf
, GLenum modeRGB
, GLenum modeA
)
1897 GET_CURRENT_CONTEXT(ctx
);
1899 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1900 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE_I
, 3);
1906 if (ctx
->ExecuteFlag
) {
1907 CALL_BlendEquationSeparateiARB(ctx
->Exec
, (buf
, modeRGB
, modeA
));
1912 /* GL_ARB_draw_instanced. */
1913 static void GLAPIENTRY
1914 save_DrawArraysInstancedARB(UNUSED GLenum mode
,
1916 UNUSED GLsizei count
,
1917 UNUSED GLsizei primcount
)
1919 GET_CURRENT_CONTEXT(ctx
);
1920 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1921 "glDrawArraysInstanced() during display list compile");
1924 static void GLAPIENTRY
1925 save_DrawElementsInstancedARB(UNUSED GLenum mode
,
1926 UNUSED GLsizei count
,
1928 UNUSED
const GLvoid
*indices
,
1929 UNUSED GLsizei primcount
)
1931 GET_CURRENT_CONTEXT(ctx
);
1932 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1933 "glDrawElementsInstanced() during display list compile");
1936 static void GLAPIENTRY
1937 save_DrawElementsInstancedBaseVertexARB(UNUSED GLenum mode
,
1938 UNUSED GLsizei count
,
1940 UNUSED
const GLvoid
*indices
,
1941 UNUSED GLsizei primcount
,
1942 UNUSED GLint basevertex
)
1944 GET_CURRENT_CONTEXT(ctx
);
1945 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1946 "glDrawElementsInstancedBaseVertex() during display list compile");
1949 /* GL_ARB_base_instance. */
1950 static void GLAPIENTRY
1951 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode
,
1953 UNUSED GLsizei count
,
1954 UNUSED GLsizei primcount
,
1955 UNUSED GLuint baseinstance
)
1957 GET_CURRENT_CONTEXT(ctx
);
1958 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1959 "glDrawArraysInstancedBaseInstance() during display list compile");
1962 static void APIENTRY
1963 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode
,
1964 UNUSED GLsizei count
,
1966 UNUSED
const void *indices
,
1967 UNUSED GLsizei primcount
,
1968 UNUSED GLuint baseinstance
)
1970 GET_CURRENT_CONTEXT(ctx
);
1971 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1972 "glDrawElementsInstancedBaseInstance() during display list compile");
1975 static void APIENTRY
1976 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode
,
1977 UNUSED GLsizei count
,
1979 UNUSED
const void *indices
,
1980 UNUSED GLsizei primcount
,
1981 UNUSED GLint basevertex
,
1982 UNUSED GLuint baseinstance
)
1984 GET_CURRENT_CONTEXT(ctx
);
1985 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1986 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1989 static void APIENTRY
1990 save_DrawArraysIndirect(UNUSED GLenum mode
,
1991 UNUSED
const void *indirect
)
1993 GET_CURRENT_CONTEXT(ctx
);
1994 _mesa_error(ctx
, GL_INVALID_OPERATION
,
1995 "glDrawArraysIndirect() during display list compile");
1998 static void APIENTRY
1999 save_DrawElementsIndirect(UNUSED GLenum mode
,
2001 UNUSED
const void *indirect
)
2003 GET_CURRENT_CONTEXT(ctx
);
2004 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2005 "glDrawElementsIndirect() during display list compile");
2008 static void APIENTRY
2009 save_MultiDrawArraysIndirect(UNUSED GLenum mode
,
2010 UNUSED
const void *indirect
,
2011 UNUSED GLsizei primcount
,
2012 UNUSED GLsizei stride
)
2014 GET_CURRENT_CONTEXT(ctx
);
2015 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2016 "glMultiDrawArraysIndirect() during display list compile");
2019 static void APIENTRY
2020 save_MultiDrawElementsIndirect(UNUSED GLenum mode
,
2022 UNUSED
const void *indirect
,
2023 UNUSED GLsizei primcount
,
2024 UNUSED GLsizei stride
)
2026 GET_CURRENT_CONTEXT(ctx
);
2027 _mesa_error(ctx
, GL_INVALID_OPERATION
,
2028 "glMultiDrawElementsIndirect() during display list compile");
2032 * While building a display list we cache some OpenGL state.
2033 * Under some circumstances we need to invalidate that state (immediately
2034 * when we start compiling a list, or after glCallList(s)).
2037 invalidate_saved_current_state(struct gl_context
*ctx
)
2041 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
2042 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
2044 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
2045 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
2047 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
2049 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
2053 static void GLAPIENTRY
2054 save_CallList(GLuint list
)
2056 GET_CURRENT_CONTEXT(ctx
);
2058 SAVE_FLUSH_VERTICES(ctx
);
2060 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
2065 /* After this, we don't know what state we're in. Invalidate all
2066 * cached information previously gathered:
2068 invalidate_saved_current_state( ctx
);
2070 if (ctx
->ExecuteFlag
) {
2071 _mesa_CallList(list
);
2076 static void GLAPIENTRY
2077 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
2079 GET_CURRENT_CONTEXT(ctx
);
2084 SAVE_FLUSH_VERTICES(ctx
);
2088 case GL_UNSIGNED_BYTE
:
2092 case GL_UNSIGNED_SHORT
:
2100 case GL_UNSIGNED_INT
:
2109 if (num
> 0 && type_size
> 0) {
2110 /* create a copy of the array of list IDs to save in the display list */
2111 lists_copy
= memdup(lists
, num
* type_size
);
2116 n
= alloc_instruction(ctx
, OPCODE_CALL_LISTS
, 2 + POINTER_DWORDS
);
2120 save_pointer(&n
[3], lists_copy
);
2123 /* After this, we don't know what state we're in. Invalidate all
2124 * cached information previously gathered:
2126 invalidate_saved_current_state( ctx
);
2128 if (ctx
->ExecuteFlag
) {
2129 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
2134 static void GLAPIENTRY
2135 save_Clear(GLbitfield mask
)
2137 GET_CURRENT_CONTEXT(ctx
);
2139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2140 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
2144 if (ctx
->ExecuteFlag
) {
2145 CALL_Clear(ctx
->Exec
, (mask
));
2150 static void GLAPIENTRY
2151 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
2153 GET_CURRENT_CONTEXT(ctx
);
2155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2156 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
2159 n
[2].i
= drawbuffer
;
2161 if (buffer
== GL_COLOR
) {
2172 if (ctx
->ExecuteFlag
) {
2173 CALL_ClearBufferiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2178 static void GLAPIENTRY
2179 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
2181 GET_CURRENT_CONTEXT(ctx
);
2183 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2184 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
2187 n
[2].i
= drawbuffer
;
2189 if (buffer
== GL_COLOR
) {
2200 if (ctx
->ExecuteFlag
) {
2201 CALL_ClearBufferuiv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2206 static void GLAPIENTRY
2207 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
2209 GET_CURRENT_CONTEXT(ctx
);
2211 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2212 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
2215 n
[2].i
= drawbuffer
;
2217 if (buffer
== GL_COLOR
) {
2228 if (ctx
->ExecuteFlag
) {
2229 CALL_ClearBufferfv(ctx
->Exec
, (buffer
, drawbuffer
, value
));
2234 static void GLAPIENTRY
2235 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
2236 GLfloat depth
, GLint stencil
)
2238 GET_CURRENT_CONTEXT(ctx
);
2240 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2241 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
2244 n
[2].i
= drawbuffer
;
2248 if (ctx
->ExecuteFlag
) {
2249 CALL_ClearBufferfi(ctx
->Exec
, (buffer
, drawbuffer
, depth
, stencil
));
2254 static void GLAPIENTRY
2255 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
2257 GET_CURRENT_CONTEXT(ctx
);
2259 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2260 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
2267 if (ctx
->ExecuteFlag
) {
2268 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
2273 static void GLAPIENTRY
2274 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
2276 GET_CURRENT_CONTEXT(ctx
);
2278 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2279 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
2286 if (ctx
->ExecuteFlag
) {
2287 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
2292 static void GLAPIENTRY
2293 save_ClearDepth(GLclampd depth
)
2295 GET_CURRENT_CONTEXT(ctx
);
2297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2298 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
2300 n
[1].f
= (GLfloat
) depth
;
2302 if (ctx
->ExecuteFlag
) {
2303 CALL_ClearDepth(ctx
->Exec
, (depth
));
2308 static void GLAPIENTRY
2309 save_ClearIndex(GLfloat c
)
2311 GET_CURRENT_CONTEXT(ctx
);
2313 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2314 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
2318 if (ctx
->ExecuteFlag
) {
2319 CALL_ClearIndex(ctx
->Exec
, (c
));
2324 static void GLAPIENTRY
2325 save_ClearStencil(GLint s
)
2327 GET_CURRENT_CONTEXT(ctx
);
2329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2330 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
2334 if (ctx
->ExecuteFlag
) {
2335 CALL_ClearStencil(ctx
->Exec
, (s
));
2340 static void GLAPIENTRY
2341 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
2343 GET_CURRENT_CONTEXT(ctx
);
2345 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2346 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
2349 n
[2].f
= (GLfloat
) equ
[0];
2350 n
[3].f
= (GLfloat
) equ
[1];
2351 n
[4].f
= (GLfloat
) equ
[2];
2352 n
[5].f
= (GLfloat
) equ
[3];
2354 if (ctx
->ExecuteFlag
) {
2355 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
2361 static void GLAPIENTRY
2362 save_ColorMask(GLboolean red
, GLboolean green
,
2363 GLboolean blue
, GLboolean alpha
)
2365 GET_CURRENT_CONTEXT(ctx
);
2367 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2368 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
2375 if (ctx
->ExecuteFlag
) {
2376 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
2381 static void GLAPIENTRY
2382 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
2383 GLboolean blue
, GLboolean alpha
)
2385 GET_CURRENT_CONTEXT(ctx
);
2387 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2388 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
2396 if (ctx
->ExecuteFlag
) {
2397 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
2402 static void GLAPIENTRY
2403 save_ColorMaterial(GLenum face
, GLenum mode
)
2405 GET_CURRENT_CONTEXT(ctx
);
2407 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2409 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
2414 if (ctx
->ExecuteFlag
) {
2415 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
2420 static void GLAPIENTRY
2421 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
2423 GET_CURRENT_CONTEXT(ctx
);
2425 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2426 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
2430 n
[3].i
= (GLint
) width
;
2431 n
[4].i
= (GLint
) height
;
2434 if (ctx
->ExecuteFlag
) {
2435 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
2441 static void GLAPIENTRY
2442 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
2443 GLint x
, GLint y
, GLsizei width
, GLint border
)
2445 GET_CURRENT_CONTEXT(ctx
);
2447 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2448 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
2452 n
[3].e
= internalformat
;
2458 if (ctx
->ExecuteFlag
) {
2459 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
2460 x
, y
, width
, border
));
2465 static void GLAPIENTRY
2466 save_CopyTexImage2D(GLenum target
, GLint level
,
2467 GLenum internalformat
,
2468 GLint x
, GLint y
, GLsizei width
,
2469 GLsizei height
, GLint border
)
2471 GET_CURRENT_CONTEXT(ctx
);
2473 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2474 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
2478 n
[3].e
= internalformat
;
2485 if (ctx
->ExecuteFlag
) {
2486 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
2487 x
, y
, width
, height
, border
));
2493 static void GLAPIENTRY
2494 save_CopyTexSubImage1D(GLenum target
, GLint level
,
2495 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
2497 GET_CURRENT_CONTEXT(ctx
);
2499 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2500 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
2509 if (ctx
->ExecuteFlag
) {
2510 CALL_CopyTexSubImage1D(ctx
->Exec
,
2511 (target
, level
, xoffset
, x
, y
, width
));
2516 static void GLAPIENTRY
2517 save_CopyTexSubImage2D(GLenum target
, GLint level
,
2518 GLint xoffset
, GLint yoffset
,
2519 GLint x
, GLint y
, GLsizei width
, GLint height
)
2521 GET_CURRENT_CONTEXT(ctx
);
2523 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2524 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
2535 if (ctx
->ExecuteFlag
) {
2536 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
2537 x
, y
, width
, height
));
2542 static void GLAPIENTRY
2543 save_CopyTexSubImage3D(GLenum target
, GLint level
,
2544 GLint xoffset
, GLint yoffset
, GLint zoffset
,
2545 GLint x
, GLint y
, GLsizei width
, GLint height
)
2547 GET_CURRENT_CONTEXT(ctx
);
2549 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2550 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
2562 if (ctx
->ExecuteFlag
) {
2563 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
2564 xoffset
, yoffset
, zoffset
,
2565 x
, y
, width
, height
));
2570 static void GLAPIENTRY
2571 save_CullFace(GLenum mode
)
2573 GET_CURRENT_CONTEXT(ctx
);
2575 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2576 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
2580 if (ctx
->ExecuteFlag
) {
2581 CALL_CullFace(ctx
->Exec
, (mode
));
2586 static void GLAPIENTRY
2587 save_DepthFunc(GLenum func
)
2589 GET_CURRENT_CONTEXT(ctx
);
2591 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2592 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
2596 if (ctx
->ExecuteFlag
) {
2597 CALL_DepthFunc(ctx
->Exec
, (func
));
2602 static void GLAPIENTRY
2603 save_DepthMask(GLboolean mask
)
2605 GET_CURRENT_CONTEXT(ctx
);
2607 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2608 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2612 if (ctx
->ExecuteFlag
) {
2613 CALL_DepthMask(ctx
->Exec
, (mask
));
2618 static void GLAPIENTRY
2619 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2621 GET_CURRENT_CONTEXT(ctx
);
2623 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2624 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2626 n
[1].f
= (GLfloat
) nearval
;
2627 n
[2].f
= (GLfloat
) farval
;
2629 if (ctx
->ExecuteFlag
) {
2630 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2635 static void GLAPIENTRY
2636 save_Disable(GLenum cap
)
2638 GET_CURRENT_CONTEXT(ctx
);
2640 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2641 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2645 if (ctx
->ExecuteFlag
) {
2646 CALL_Disable(ctx
->Exec
, (cap
));
2651 static void GLAPIENTRY
2652 save_DisableIndexed(GLuint index
, GLenum cap
)
2654 GET_CURRENT_CONTEXT(ctx
);
2656 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2657 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2662 if (ctx
->ExecuteFlag
) {
2663 CALL_Disablei(ctx
->Exec
, (index
, cap
));
2668 static void GLAPIENTRY
2669 save_DrawBuffer(GLenum mode
)
2671 GET_CURRENT_CONTEXT(ctx
);
2673 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2674 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2678 if (ctx
->ExecuteFlag
) {
2679 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2684 static void GLAPIENTRY
2685 save_DrawPixels(GLsizei width
, GLsizei height
,
2686 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2688 GET_CURRENT_CONTEXT(ctx
);
2691 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2693 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 4 + POINTER_DWORDS
);
2700 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2701 pixels
, &ctx
->Unpack
));
2703 if (ctx
->ExecuteFlag
) {
2704 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2710 static void GLAPIENTRY
2711 save_Enable(GLenum cap
)
2713 GET_CURRENT_CONTEXT(ctx
);
2715 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2716 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2720 if (ctx
->ExecuteFlag
) {
2721 CALL_Enable(ctx
->Exec
, (cap
));
2727 static void GLAPIENTRY
2728 save_EnableIndexed(GLuint index
, GLenum cap
)
2730 GET_CURRENT_CONTEXT(ctx
);
2732 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2733 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2738 if (ctx
->ExecuteFlag
) {
2739 CALL_Enablei(ctx
->Exec
, (index
, cap
));
2745 static void GLAPIENTRY
2746 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2748 GET_CURRENT_CONTEXT(ctx
);
2750 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2751 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2757 if (ctx
->ExecuteFlag
) {
2758 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2763 static void GLAPIENTRY
2764 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2766 GET_CURRENT_CONTEXT(ctx
);
2768 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2769 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2777 if (ctx
->ExecuteFlag
) {
2778 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2785 static void GLAPIENTRY
2786 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2788 GET_CURRENT_CONTEXT(ctx
);
2790 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2791 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2799 if (ctx
->ExecuteFlag
) {
2800 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2805 static void GLAPIENTRY
2806 save_Fogf(GLenum pname
, GLfloat param
)
2810 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2811 save_Fogfv(pname
, parray
);
2815 static void GLAPIENTRY
2816 save_Fogiv(GLenum pname
, const GLint
*params
)
2821 case GL_FOG_DENSITY
:
2825 case GL_FOG_COORDINATE_SOURCE
:
2826 p
[0] = (GLfloat
) *params
;
2832 p
[0] = INT_TO_FLOAT(params
[0]);
2833 p
[1] = INT_TO_FLOAT(params
[1]);
2834 p
[2] = INT_TO_FLOAT(params
[2]);
2835 p
[3] = INT_TO_FLOAT(params
[3]);
2838 /* Error will be caught later in gl_Fogfv */
2839 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2841 save_Fogfv(pname
, p
);
2845 static void GLAPIENTRY
2846 save_Fogi(GLenum pname
, GLint param
)
2850 parray
[1] = parray
[2] = parray
[3] = 0;
2851 save_Fogiv(pname
, parray
);
2855 static void GLAPIENTRY
2856 save_FrontFace(GLenum mode
)
2858 GET_CURRENT_CONTEXT(ctx
);
2860 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2861 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2865 if (ctx
->ExecuteFlag
) {
2866 CALL_FrontFace(ctx
->Exec
, (mode
));
2871 static void GLAPIENTRY
2872 save_Frustum(GLdouble left
, GLdouble right
,
2873 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2875 GET_CURRENT_CONTEXT(ctx
);
2877 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2878 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2880 n
[1].f
= (GLfloat
) left
;
2881 n
[2].f
= (GLfloat
) right
;
2882 n
[3].f
= (GLfloat
) bottom
;
2883 n
[4].f
= (GLfloat
) top
;
2884 n
[5].f
= (GLfloat
) nearval
;
2885 n
[6].f
= (GLfloat
) farval
;
2887 if (ctx
->ExecuteFlag
) {
2888 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2893 static void GLAPIENTRY
2894 save_Hint(GLenum target
, GLenum mode
)
2896 GET_CURRENT_CONTEXT(ctx
);
2898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2899 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2904 if (ctx
->ExecuteFlag
) {
2905 CALL_Hint(ctx
->Exec
, (target
, mode
));
2910 static void GLAPIENTRY
2911 save_IndexMask(GLuint mask
)
2913 GET_CURRENT_CONTEXT(ctx
);
2915 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2916 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2920 if (ctx
->ExecuteFlag
) {
2921 CALL_IndexMask(ctx
->Exec
, (mask
));
2926 static void GLAPIENTRY
2927 save_InitNames(void)
2929 GET_CURRENT_CONTEXT(ctx
);
2930 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2931 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2932 if (ctx
->ExecuteFlag
) {
2933 CALL_InitNames(ctx
->Exec
, ());
2938 static void GLAPIENTRY
2939 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2941 GET_CURRENT_CONTEXT(ctx
);
2943 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2944 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2962 case GL_SPOT_DIRECTION
:
2965 case GL_SPOT_EXPONENT
:
2968 case GL_SPOT_CUTOFF
:
2971 case GL_CONSTANT_ATTENUATION
:
2974 case GL_LINEAR_ATTENUATION
:
2977 case GL_QUADRATIC_ATTENUATION
:
2983 for (i
= 0; i
< nParams
; i
++) {
2984 n
[3 + i
].f
= params
[i
];
2987 if (ctx
->ExecuteFlag
) {
2988 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2993 static void GLAPIENTRY
2994 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2998 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2999 save_Lightfv(light
, pname
, parray
);
3003 static void GLAPIENTRY
3004 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
3011 fparam
[0] = INT_TO_FLOAT(params
[0]);
3012 fparam
[1] = INT_TO_FLOAT(params
[1]);
3013 fparam
[2] = INT_TO_FLOAT(params
[2]);
3014 fparam
[3] = INT_TO_FLOAT(params
[3]);
3017 fparam
[0] = (GLfloat
) params
[0];
3018 fparam
[1] = (GLfloat
) params
[1];
3019 fparam
[2] = (GLfloat
) params
[2];
3020 fparam
[3] = (GLfloat
) params
[3];
3022 case GL_SPOT_DIRECTION
:
3023 fparam
[0] = (GLfloat
) params
[0];
3024 fparam
[1] = (GLfloat
) params
[1];
3025 fparam
[2] = (GLfloat
) params
[2];
3027 case GL_SPOT_EXPONENT
:
3028 case GL_SPOT_CUTOFF
:
3029 case GL_CONSTANT_ATTENUATION
:
3030 case GL_LINEAR_ATTENUATION
:
3031 case GL_QUADRATIC_ATTENUATION
:
3032 fparam
[0] = (GLfloat
) params
[0];
3035 /* error will be caught later in gl_Lightfv */
3038 save_Lightfv(light
, pname
, fparam
);
3042 static void GLAPIENTRY
3043 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
3047 parray
[1] = parray
[2] = parray
[3] = 0;
3048 save_Lightiv(light
, pname
, parray
);
3052 static void GLAPIENTRY
3053 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
3055 GET_CURRENT_CONTEXT(ctx
);
3057 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3058 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
3066 if (ctx
->ExecuteFlag
) {
3067 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
3072 static void GLAPIENTRY
3073 save_LightModelf(GLenum pname
, GLfloat param
)
3077 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3078 save_LightModelfv(pname
, parray
);
3082 static void GLAPIENTRY
3083 save_LightModeliv(GLenum pname
, const GLint
*params
)
3087 case GL_LIGHT_MODEL_AMBIENT
:
3088 fparam
[0] = INT_TO_FLOAT(params
[0]);
3089 fparam
[1] = INT_TO_FLOAT(params
[1]);
3090 fparam
[2] = INT_TO_FLOAT(params
[2]);
3091 fparam
[3] = INT_TO_FLOAT(params
[3]);
3093 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
3094 case GL_LIGHT_MODEL_TWO_SIDE
:
3095 case GL_LIGHT_MODEL_COLOR_CONTROL
:
3096 fparam
[0] = (GLfloat
) params
[0];
3102 /* Error will be caught later in gl_LightModelfv */
3103 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
3105 save_LightModelfv(pname
, fparam
);
3109 static void GLAPIENTRY
3110 save_LightModeli(GLenum pname
, GLint param
)
3114 parray
[1] = parray
[2] = parray
[3] = 0;
3115 save_LightModeliv(pname
, parray
);
3119 static void GLAPIENTRY
3120 save_LineStipple(GLint factor
, GLushort pattern
)
3122 GET_CURRENT_CONTEXT(ctx
);
3124 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3125 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
3130 if (ctx
->ExecuteFlag
) {
3131 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
3136 static void GLAPIENTRY
3137 save_LineWidth(GLfloat width
)
3139 GET_CURRENT_CONTEXT(ctx
);
3141 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3142 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
3146 if (ctx
->ExecuteFlag
) {
3147 CALL_LineWidth(ctx
->Exec
, (width
));
3152 static void GLAPIENTRY
3153 save_ListBase(GLuint base
)
3155 GET_CURRENT_CONTEXT(ctx
);
3157 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3158 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
3162 if (ctx
->ExecuteFlag
) {
3163 CALL_ListBase(ctx
->Exec
, (base
));
3168 static void GLAPIENTRY
3169 save_LoadIdentity(void)
3171 GET_CURRENT_CONTEXT(ctx
);
3172 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3173 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
3174 if (ctx
->ExecuteFlag
) {
3175 CALL_LoadIdentity(ctx
->Exec
, ());
3180 static void GLAPIENTRY
3181 save_LoadMatrixf(const GLfloat
* m
)
3183 GET_CURRENT_CONTEXT(ctx
);
3185 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3186 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
3189 for (i
= 0; i
< 16; i
++) {
3193 if (ctx
->ExecuteFlag
) {
3194 CALL_LoadMatrixf(ctx
->Exec
, (m
));
3199 static void GLAPIENTRY
3200 save_LoadMatrixd(const GLdouble
* m
)
3204 for (i
= 0; i
< 16; i
++) {
3205 f
[i
] = (GLfloat
) m
[i
];
3207 save_LoadMatrixf(f
);
3211 static void GLAPIENTRY
3212 save_LoadName(GLuint name
)
3214 GET_CURRENT_CONTEXT(ctx
);
3216 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3217 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
3221 if (ctx
->ExecuteFlag
) {
3222 CALL_LoadName(ctx
->Exec
, (name
));
3227 static void GLAPIENTRY
3228 save_LogicOp(GLenum opcode
)
3230 GET_CURRENT_CONTEXT(ctx
);
3232 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3233 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
3237 if (ctx
->ExecuteFlag
) {
3238 CALL_LogicOp(ctx
->Exec
, (opcode
));
3243 static void GLAPIENTRY
3244 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
3245 GLint order
, const GLdouble
* points
)
3247 GET_CURRENT_CONTEXT(ctx
);
3249 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3250 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3252 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
3254 n
[2].f
= (GLfloat
) u1
;
3255 n
[3].f
= (GLfloat
) u2
;
3256 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3258 save_pointer(&n
[6], pnts
);
3260 if (ctx
->ExecuteFlag
) {
3261 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3265 static void GLAPIENTRY
3266 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
3267 GLint order
, const GLfloat
* points
)
3269 GET_CURRENT_CONTEXT(ctx
);
3271 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3272 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 5 + POINTER_DWORDS
);
3274 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
3278 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
3280 save_pointer(&n
[6], pnts
);
3282 if (ctx
->ExecuteFlag
) {
3283 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
3288 static void GLAPIENTRY
3289 save_Map2d(GLenum target
,
3290 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
3291 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
3292 const GLdouble
* points
)
3294 GET_CURRENT_CONTEXT(ctx
);
3296 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3297 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3299 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
3300 vstride
, vorder
, points
);
3302 n
[2].f
= (GLfloat
) u1
;
3303 n
[3].f
= (GLfloat
) u2
;
3304 n
[4].f
= (GLfloat
) v1
;
3305 n
[5].f
= (GLfloat
) v2
;
3306 /* XXX verify these strides are correct */
3307 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3308 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3311 save_pointer(&n
[10], pnts
);
3313 if (ctx
->ExecuteFlag
) {
3314 CALL_Map2d(ctx
->Exec
, (target
,
3315 u1
, u2
, ustride
, uorder
,
3316 v1
, v2
, vstride
, vorder
, points
));
3321 static void GLAPIENTRY
3322 save_Map2f(GLenum target
,
3323 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
3324 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
3325 const GLfloat
* points
)
3327 GET_CURRENT_CONTEXT(ctx
);
3329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3330 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 9 + POINTER_DWORDS
);
3332 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
3333 vstride
, vorder
, points
);
3339 /* XXX verify these strides are correct */
3340 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
3341 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
3344 save_pointer(&n
[10], pnts
);
3346 if (ctx
->ExecuteFlag
) {
3347 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
3348 v1
, v2
, vstride
, vorder
, points
));
3353 static void GLAPIENTRY
3354 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
3356 GET_CURRENT_CONTEXT(ctx
);
3358 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3359 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
3365 if (ctx
->ExecuteFlag
) {
3366 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
3371 static void GLAPIENTRY
3372 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
3374 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
3378 static void GLAPIENTRY
3379 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
3380 GLint vn
, GLfloat v1
, GLfloat v2
)
3382 GET_CURRENT_CONTEXT(ctx
);
3384 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3385 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
3394 if (ctx
->ExecuteFlag
) {
3395 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
3401 static void GLAPIENTRY
3402 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
3403 GLint vn
, GLdouble v1
, GLdouble v2
)
3405 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
3406 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
3410 static void GLAPIENTRY
3411 save_MatrixMode(GLenum mode
)
3413 GET_CURRENT_CONTEXT(ctx
);
3415 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3416 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
3420 if (ctx
->ExecuteFlag
) {
3421 CALL_MatrixMode(ctx
->Exec
, (mode
));
3426 static void GLAPIENTRY
3427 save_MultMatrixf(const GLfloat
* m
)
3429 GET_CURRENT_CONTEXT(ctx
);
3431 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3432 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
3435 for (i
= 0; i
< 16; i
++) {
3439 if (ctx
->ExecuteFlag
) {
3440 CALL_MultMatrixf(ctx
->Exec
, (m
));
3445 static void GLAPIENTRY
3446 save_MultMatrixd(const GLdouble
* m
)
3450 for (i
= 0; i
< 16; i
++) {
3451 f
[i
] = (GLfloat
) m
[i
];
3453 save_MultMatrixf(f
);
3457 static void GLAPIENTRY
3458 save_NewList(GLuint name
, GLenum mode
)
3460 GET_CURRENT_CONTEXT(ctx
);
3461 /* It's an error to call this function while building a display list */
3462 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
3469 static void GLAPIENTRY
3470 save_Ortho(GLdouble left
, GLdouble right
,
3471 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
3473 GET_CURRENT_CONTEXT(ctx
);
3475 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3476 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
3478 n
[1].f
= (GLfloat
) left
;
3479 n
[2].f
= (GLfloat
) right
;
3480 n
[3].f
= (GLfloat
) bottom
;
3481 n
[4].f
= (GLfloat
) top
;
3482 n
[5].f
= (GLfloat
) nearval
;
3483 n
[6].f
= (GLfloat
) farval
;
3485 if (ctx
->ExecuteFlag
) {
3486 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
3491 static void GLAPIENTRY
3492 save_PatchParameteri(GLenum pname
, const GLint value
)
3494 GET_CURRENT_CONTEXT(ctx
);
3496 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3497 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_I
, 2);
3502 if (ctx
->ExecuteFlag
) {
3503 CALL_PatchParameteri(ctx
->Exec
, (pname
, value
));
3508 static void GLAPIENTRY
3509 save_PatchParameterfv(GLenum pname
, const GLfloat
*params
)
3511 GET_CURRENT_CONTEXT(ctx
);
3513 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3515 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3516 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_OUTER
, 5);
3518 assert(pname
== GL_PATCH_DEFAULT_INNER_LEVEL
);
3519 n
= alloc_instruction(ctx
, OPCODE_PATCH_PARAMETER_FV_INNER
, 3);
3523 if (pname
== GL_PATCH_DEFAULT_OUTER_LEVEL
) {
3533 if (ctx
->ExecuteFlag
) {
3534 CALL_PatchParameterfv(ctx
->Exec
, (pname
, params
));
3539 static void GLAPIENTRY
3540 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
3542 GET_CURRENT_CONTEXT(ctx
);
3544 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3545 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 2 + POINTER_DWORDS
);
3549 save_pointer(&n
[3], memdup(values
, mapsize
* sizeof(GLfloat
)));
3551 if (ctx
->ExecuteFlag
) {
3552 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
3557 static void GLAPIENTRY
3558 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
3560 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3562 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3563 for (i
= 0; i
< mapsize
; i
++) {
3564 fvalues
[i
] = (GLfloat
) values
[i
];
3568 for (i
= 0; i
< mapsize
; i
++) {
3569 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
3572 save_PixelMapfv(map
, mapsize
, fvalues
);
3576 static void GLAPIENTRY
3577 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
3579 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
3581 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
3582 for (i
= 0; i
< mapsize
; i
++) {
3583 fvalues
[i
] = (GLfloat
) values
[i
];
3587 for (i
= 0; i
< mapsize
; i
++) {
3588 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
3591 save_PixelMapfv(map
, mapsize
, fvalues
);
3595 static void GLAPIENTRY
3596 save_PixelTransferf(GLenum pname
, GLfloat param
)
3598 GET_CURRENT_CONTEXT(ctx
);
3600 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3601 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
3606 if (ctx
->ExecuteFlag
) {
3607 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3612 static void GLAPIENTRY
3613 save_PixelTransferi(GLenum pname
, GLint param
)
3615 save_PixelTransferf(pname
, (GLfloat
) param
);
3619 static void GLAPIENTRY
3620 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3622 GET_CURRENT_CONTEXT(ctx
);
3624 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3625 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3630 if (ctx
->ExecuteFlag
) {
3631 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3636 static void GLAPIENTRY
3637 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3639 GET_CURRENT_CONTEXT(ctx
);
3641 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3642 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3649 if (ctx
->ExecuteFlag
) {
3650 CALL_PointParameterfv(ctx
->Exec
, (pname
, params
));
3655 static void GLAPIENTRY
3656 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3660 parray
[1] = parray
[2] = 0.0F
;
3661 save_PointParameterfvEXT(pname
, parray
);
3664 static void GLAPIENTRY
3665 save_PointParameteriNV(GLenum pname
, GLint param
)
3668 parray
[0] = (GLfloat
) param
;
3669 parray
[1] = parray
[2] = 0.0F
;
3670 save_PointParameterfvEXT(pname
, parray
);
3673 static void GLAPIENTRY
3674 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3677 parray
[0] = (GLfloat
) param
[0];
3678 parray
[1] = parray
[2] = 0.0F
;
3679 save_PointParameterfvEXT(pname
, parray
);
3683 static void GLAPIENTRY
3684 save_PointSize(GLfloat size
)
3686 GET_CURRENT_CONTEXT(ctx
);
3688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3689 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3693 if (ctx
->ExecuteFlag
) {
3694 CALL_PointSize(ctx
->Exec
, (size
));
3699 static void GLAPIENTRY
3700 save_PolygonMode(GLenum face
, GLenum mode
)
3702 GET_CURRENT_CONTEXT(ctx
);
3704 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3705 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3710 if (ctx
->ExecuteFlag
) {
3711 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3716 static void GLAPIENTRY
3717 save_PolygonStipple(const GLubyte
* pattern
)
3719 GET_CURRENT_CONTEXT(ctx
);
3722 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3724 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, POINTER_DWORDS
);
3727 unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3728 pattern
, &ctx
->Unpack
));
3730 if (ctx
->ExecuteFlag
) {
3731 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3736 static void GLAPIENTRY
3737 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3739 GET_CURRENT_CONTEXT(ctx
);
3741 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3742 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3747 if (ctx
->ExecuteFlag
) {
3748 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3753 static void GLAPIENTRY
3754 save_PolygonOffsetClampEXT(GLfloat factor
, GLfloat units
, GLfloat clamp
)
3756 GET_CURRENT_CONTEXT(ctx
);
3758 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3759 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET_CLAMP
, 3);
3765 if (ctx
->ExecuteFlag
) {
3766 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (factor
, units
, clamp
));
3770 static void GLAPIENTRY
3771 save_PopAttrib(void)
3773 GET_CURRENT_CONTEXT(ctx
);
3774 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3775 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3776 if (ctx
->ExecuteFlag
) {
3777 CALL_PopAttrib(ctx
->Exec
, ());
3782 static void GLAPIENTRY
3783 save_PopMatrix(void)
3785 GET_CURRENT_CONTEXT(ctx
);
3786 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3787 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3788 if (ctx
->ExecuteFlag
) {
3789 CALL_PopMatrix(ctx
->Exec
, ());
3794 static void GLAPIENTRY
3797 GET_CURRENT_CONTEXT(ctx
);
3798 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3799 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3800 if (ctx
->ExecuteFlag
) {
3801 CALL_PopName(ctx
->Exec
, ());
3806 static void GLAPIENTRY
3807 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3808 const GLclampf
* priorities
)
3810 GET_CURRENT_CONTEXT(ctx
);
3812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3814 for (i
= 0; i
< num
; i
++) {
3816 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3818 n
[1].ui
= textures
[i
];
3819 n
[2].f
= priorities
[i
];
3822 if (ctx
->ExecuteFlag
) {
3823 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3828 static void GLAPIENTRY
3829 save_PushAttrib(GLbitfield mask
)
3831 GET_CURRENT_CONTEXT(ctx
);
3833 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3834 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3838 if (ctx
->ExecuteFlag
) {
3839 CALL_PushAttrib(ctx
->Exec
, (mask
));
3844 static void GLAPIENTRY
3845 save_PushMatrix(void)
3847 GET_CURRENT_CONTEXT(ctx
);
3848 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3849 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3850 if (ctx
->ExecuteFlag
) {
3851 CALL_PushMatrix(ctx
->Exec
, ());
3856 static void GLAPIENTRY
3857 save_PushName(GLuint name
)
3859 GET_CURRENT_CONTEXT(ctx
);
3861 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3862 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3866 if (ctx
->ExecuteFlag
) {
3867 CALL_PushName(ctx
->Exec
, (name
));
3872 static void GLAPIENTRY
3873 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3875 GET_CURRENT_CONTEXT(ctx
);
3877 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3878 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3885 if (ctx
->ExecuteFlag
) {
3886 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3890 static void GLAPIENTRY
3891 save_RasterPos2d(GLdouble x
, GLdouble y
)
3893 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3896 static void GLAPIENTRY
3897 save_RasterPos2f(GLfloat x
, GLfloat y
)
3899 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3902 static void GLAPIENTRY
3903 save_RasterPos2i(GLint x
, GLint y
)
3905 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3908 static void GLAPIENTRY
3909 save_RasterPos2s(GLshort x
, GLshort y
)
3911 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3914 static void GLAPIENTRY
3915 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3917 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3920 static void GLAPIENTRY
3921 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3923 save_RasterPos4f(x
, y
, z
, 1.0F
);
3926 static void GLAPIENTRY
3927 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3929 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3932 static void GLAPIENTRY
3933 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3935 save_RasterPos4f(x
, y
, z
, 1.0F
);
3938 static void GLAPIENTRY
3939 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3941 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3944 static void GLAPIENTRY
3945 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3947 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3950 static void GLAPIENTRY
3951 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3953 save_RasterPos4f(x
, y
, z
, w
);
3956 static void GLAPIENTRY
3957 save_RasterPos2dv(const GLdouble
* v
)
3959 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3962 static void GLAPIENTRY
3963 save_RasterPos2fv(const GLfloat
* v
)
3965 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3968 static void GLAPIENTRY
3969 save_RasterPos2iv(const GLint
* v
)
3971 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3974 static void GLAPIENTRY
3975 save_RasterPos2sv(const GLshort
* v
)
3977 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3980 static void GLAPIENTRY
3981 save_RasterPos3dv(const GLdouble
* v
)
3983 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3986 static void GLAPIENTRY
3987 save_RasterPos3fv(const GLfloat
* v
)
3989 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3992 static void GLAPIENTRY
3993 save_RasterPos3iv(const GLint
* v
)
3995 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3998 static void GLAPIENTRY
3999 save_RasterPos3sv(const GLshort
* v
)
4001 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
4004 static void GLAPIENTRY
4005 save_RasterPos4dv(const GLdouble
* v
)
4007 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4008 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4011 static void GLAPIENTRY
4012 save_RasterPos4fv(const GLfloat
* v
)
4014 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4017 static void GLAPIENTRY
4018 save_RasterPos4iv(const GLint
* v
)
4020 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
4021 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4024 static void GLAPIENTRY
4025 save_RasterPos4sv(const GLshort
* v
)
4027 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
4031 static void GLAPIENTRY
4032 save_PassThrough(GLfloat token
)
4034 GET_CURRENT_CONTEXT(ctx
);
4036 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4037 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
4041 if (ctx
->ExecuteFlag
) {
4042 CALL_PassThrough(ctx
->Exec
, (token
));
4047 static void GLAPIENTRY
4048 save_ReadBuffer(GLenum mode
)
4050 GET_CURRENT_CONTEXT(ctx
);
4052 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4053 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
4057 if (ctx
->ExecuteFlag
) {
4058 CALL_ReadBuffer(ctx
->Exec
, (mode
));
4063 static void GLAPIENTRY
4064 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
4066 GET_CURRENT_CONTEXT(ctx
);
4068 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4069 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
4076 if (ctx
->ExecuteFlag
) {
4077 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
4082 static void GLAPIENTRY
4083 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
4085 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4089 static void GLAPIENTRY
4090 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
4092 GET_CURRENT_CONTEXT(ctx
);
4094 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4095 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
4101 if (ctx
->ExecuteFlag
) {
4102 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
4107 static void GLAPIENTRY
4108 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
4110 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4114 static void GLAPIENTRY
4115 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4117 GET_CURRENT_CONTEXT(ctx
);
4119 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4120 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
4127 if (ctx
->ExecuteFlag
) {
4128 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
4133 static void GLAPIENTRY
4134 save_ShadeModel(GLenum mode
)
4136 GET_CURRENT_CONTEXT(ctx
);
4138 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
4140 if (ctx
->ExecuteFlag
) {
4141 CALL_ShadeModel(ctx
->Exec
, (mode
));
4144 /* Don't compile this call if it's a no-op.
4145 * By avoiding this state change we have a better chance of
4146 * coalescing subsequent drawing commands into one batch.
4148 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
4151 SAVE_FLUSH_VERTICES(ctx
);
4153 ctx
->ListState
.Current
.ShadeModel
= mode
;
4155 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
4162 static void GLAPIENTRY
4163 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
4165 GET_CURRENT_CONTEXT(ctx
);
4167 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4168 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
4174 if (ctx
->ExecuteFlag
) {
4175 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
4180 static void GLAPIENTRY
4181 save_StencilMask(GLuint mask
)
4183 GET_CURRENT_CONTEXT(ctx
);
4185 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4186 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
4190 if (ctx
->ExecuteFlag
) {
4191 CALL_StencilMask(ctx
->Exec
, (mask
));
4196 static void GLAPIENTRY
4197 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
4199 GET_CURRENT_CONTEXT(ctx
);
4201 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4202 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
4208 if (ctx
->ExecuteFlag
) {
4209 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
4214 static void GLAPIENTRY
4215 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
4217 GET_CURRENT_CONTEXT(ctx
);
4219 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4220 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4227 if (ctx
->ExecuteFlag
) {
4228 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
4233 static void GLAPIENTRY
4234 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
4237 GET_CURRENT_CONTEXT(ctx
);
4239 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4241 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4249 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
4256 if (ctx
->ExecuteFlag
) {
4257 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
4258 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
4263 static void GLAPIENTRY
4264 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
4266 GET_CURRENT_CONTEXT(ctx
);
4268 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4269 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
4274 if (ctx
->ExecuteFlag
) {
4275 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
4280 static void GLAPIENTRY
4281 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
4283 GET_CURRENT_CONTEXT(ctx
);
4285 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4286 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
4293 if (ctx
->ExecuteFlag
) {
4294 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
4299 static void GLAPIENTRY
4300 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4302 GET_CURRENT_CONTEXT(ctx
);
4304 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4305 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
4309 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4317 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
4320 if (ctx
->ExecuteFlag
) {
4321 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
4326 static void GLAPIENTRY
4327 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
4330 parray
[0] = (GLfloat
) param
;
4331 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4332 save_TexEnvfv(target
, pname
, parray
);
4336 static void GLAPIENTRY
4337 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
4340 p
[0] = (GLfloat
) param
;
4341 p
[1] = p
[2] = p
[3] = 0.0F
;
4342 save_TexEnvfv(target
, pname
, p
);
4346 static void GLAPIENTRY
4347 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
4350 if (pname
== GL_TEXTURE_ENV_COLOR
) {
4351 p
[0] = INT_TO_FLOAT(param
[0]);
4352 p
[1] = INT_TO_FLOAT(param
[1]);
4353 p
[2] = INT_TO_FLOAT(param
[2]);
4354 p
[3] = INT_TO_FLOAT(param
[3]);
4357 p
[0] = (GLfloat
) param
[0];
4358 p
[1] = p
[2] = p
[3] = 0.0F
;
4360 save_TexEnvfv(target
, pname
, p
);
4364 static void GLAPIENTRY
4365 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
4367 GET_CURRENT_CONTEXT(ctx
);
4369 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4370 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
4379 if (ctx
->ExecuteFlag
) {
4380 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
4385 static void GLAPIENTRY
4386 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
4389 p
[0] = (GLfloat
) params
[0];
4390 p
[1] = (GLfloat
) params
[1];
4391 p
[2] = (GLfloat
) params
[2];
4392 p
[3] = (GLfloat
) params
[3];
4393 save_TexGenfv(coord
, pname
, p
);
4397 static void GLAPIENTRY
4398 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
4401 parray
[0] = (GLfloat
) param
;
4402 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4403 save_TexGenfv(coord
, pname
, parray
);
4407 static void GLAPIENTRY
4408 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
4411 p
[0] = (GLfloat
) params
[0];
4412 p
[1] = (GLfloat
) params
[1];
4413 p
[2] = (GLfloat
) params
[2];
4414 p
[3] = (GLfloat
) params
[3];
4415 save_TexGenfv(coord
, pname
, p
);
4419 static void GLAPIENTRY
4420 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
4424 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4425 save_TexGenfv(coord
, pname
, parray
);
4429 static void GLAPIENTRY
4430 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
4434 parray
[1] = parray
[2] = parray
[3] = 0;
4435 save_TexGeniv(coord
, pname
, parray
);
4439 static void GLAPIENTRY
4440 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
4442 GET_CURRENT_CONTEXT(ctx
);
4444 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4445 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
4454 if (ctx
->ExecuteFlag
) {
4455 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
4460 static void GLAPIENTRY
4461 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
4465 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
4466 save_TexParameterfv(target
, pname
, parray
);
4470 static void GLAPIENTRY
4471 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
4474 fparam
[0] = (GLfloat
) param
;
4475 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4476 save_TexParameterfv(target
, pname
, fparam
);
4480 static void GLAPIENTRY
4481 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
4484 fparam
[0] = (GLfloat
) params
[0];
4485 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
4486 save_TexParameterfv(target
, pname
, fparam
);
4490 static void GLAPIENTRY
4491 save_TexImage1D(GLenum target
,
4492 GLint level
, GLint components
,
4493 GLsizei width
, GLint border
,
4494 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4496 GET_CURRENT_CONTEXT(ctx
);
4497 if (target
== GL_PROXY_TEXTURE_1D
) {
4498 /* don't compile, execute immediately */
4499 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4500 border
, format
, type
, pixels
));
4504 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4505 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 7 + POINTER_DWORDS
);
4509 n
[3].i
= components
;
4510 n
[4].i
= (GLint
) width
;
4515 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4516 pixels
, &ctx
->Unpack
));
4518 if (ctx
->ExecuteFlag
) {
4519 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
4520 border
, format
, type
, pixels
));
4526 static void GLAPIENTRY
4527 save_TexImage2D(GLenum target
,
4528 GLint level
, GLint components
,
4529 GLsizei width
, GLsizei height
, GLint border
,
4530 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4532 GET_CURRENT_CONTEXT(ctx
);
4533 if (target
== GL_PROXY_TEXTURE_2D
) {
4534 /* don't compile, execute immediately */
4535 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4536 height
, border
, format
, type
, pixels
));
4540 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4541 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 8 + POINTER_DWORDS
);
4545 n
[3].i
= components
;
4546 n
[4].i
= (GLint
) width
;
4547 n
[5].i
= (GLint
) height
;
4552 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4553 pixels
, &ctx
->Unpack
));
4555 if (ctx
->ExecuteFlag
) {
4556 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
4557 height
, border
, format
, type
, pixels
));
4563 static void GLAPIENTRY
4564 save_TexImage3D(GLenum target
,
4565 GLint level
, GLint internalFormat
,
4566 GLsizei width
, GLsizei height
, GLsizei depth
,
4568 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4570 GET_CURRENT_CONTEXT(ctx
);
4571 if (target
== GL_PROXY_TEXTURE_3D
) {
4572 /* don't compile, execute immediately */
4573 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4574 height
, depth
, border
, format
, type
,
4579 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4580 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 9 + POINTER_DWORDS
);
4584 n
[3].i
= (GLint
) internalFormat
;
4585 n
[4].i
= (GLint
) width
;
4586 n
[5].i
= (GLint
) height
;
4587 n
[6].i
= (GLint
) depth
;
4591 save_pointer(&n
[10],
4592 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4593 pixels
, &ctx
->Unpack
));
4595 if (ctx
->ExecuteFlag
) {
4596 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4597 height
, depth
, border
, format
, type
,
4604 static void GLAPIENTRY
4605 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4606 GLsizei width
, GLenum format
, GLenum type
,
4607 const GLvoid
* pixels
)
4609 GET_CURRENT_CONTEXT(ctx
);
4612 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4614 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 6 + POINTER_DWORDS
);
4619 n
[4].i
= (GLint
) width
;
4623 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4624 pixels
, &ctx
->Unpack
));
4626 if (ctx
->ExecuteFlag
) {
4627 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4628 format
, type
, pixels
));
4633 static void GLAPIENTRY
4634 save_TexSubImage2D(GLenum target
, GLint level
,
4635 GLint xoffset
, GLint yoffset
,
4636 GLsizei width
, GLsizei height
,
4637 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4639 GET_CURRENT_CONTEXT(ctx
);
4642 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4644 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 8 + POINTER_DWORDS
);
4650 n
[5].i
= (GLint
) width
;
4651 n
[6].i
= (GLint
) height
;
4655 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4656 pixels
, &ctx
->Unpack
));
4658 if (ctx
->ExecuteFlag
) {
4659 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4660 width
, height
, format
, type
, pixels
));
4665 static void GLAPIENTRY
4666 save_TexSubImage3D(GLenum target
, GLint level
,
4667 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4668 GLsizei width
, GLsizei height
, GLsizei depth
,
4669 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4671 GET_CURRENT_CONTEXT(ctx
);
4674 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4676 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 10 + POINTER_DWORDS
);
4683 n
[6].i
= (GLint
) width
;
4684 n
[7].i
= (GLint
) height
;
4685 n
[8].i
= (GLint
) depth
;
4688 save_pointer(&n
[11],
4689 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4690 pixels
, &ctx
->Unpack
));
4692 if (ctx
->ExecuteFlag
) {
4693 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4694 xoffset
, yoffset
, zoffset
,
4695 width
, height
, depth
, format
, type
,
4701 static void GLAPIENTRY
4702 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4704 GET_CURRENT_CONTEXT(ctx
);
4706 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4707 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4713 if (ctx
->ExecuteFlag
) {
4714 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4719 static void GLAPIENTRY
4720 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4722 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4727 static void GLAPIENTRY
4728 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4730 GET_CURRENT_CONTEXT(ctx
);
4732 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4733 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4737 n
[3].i
= (GLint
) width
;
4738 n
[4].i
= (GLint
) height
;
4740 if (ctx
->ExecuteFlag
) {
4741 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4745 static void GLAPIENTRY
4746 save_ViewportIndexedf(GLuint index
, GLfloat x
, GLfloat y
, GLfloat width
,
4749 GET_CURRENT_CONTEXT(ctx
);
4751 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4752 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_F
, 5);
4760 if (ctx
->ExecuteFlag
) {
4761 CALL_ViewportIndexedf(ctx
->Exec
, (index
, x
, y
, width
, height
));
4765 static void GLAPIENTRY
4766 save_ViewportIndexedfv(GLuint index
, const GLfloat
*v
)
4768 GET_CURRENT_CONTEXT(ctx
);
4770 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4771 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_INDEXED_FV
, 5);
4779 if (ctx
->ExecuteFlag
) {
4780 CALL_ViewportIndexedfv(ctx
->Exec
, (index
, v
));
4784 static void GLAPIENTRY
4785 save_ViewportArrayv(GLuint first
, GLsizei count
, const GLfloat
*v
)
4787 GET_CURRENT_CONTEXT(ctx
);
4789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4790 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT_ARRAY_V
, 2 + POINTER_DWORDS
);
4794 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
4796 if (ctx
->ExecuteFlag
) {
4797 CALL_ViewportArrayv(ctx
->Exec
, (first
, count
, v
));
4801 static void GLAPIENTRY
4802 save_ScissorIndexed(GLuint index
, GLint left
, GLint bottom
, GLsizei width
,
4805 GET_CURRENT_CONTEXT(ctx
);
4807 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4808 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED
, 5);
4816 if (ctx
->ExecuteFlag
) {
4817 CALL_ScissorIndexed(ctx
->Exec
, (index
, left
, bottom
, width
, height
));
4821 static void GLAPIENTRY
4822 save_ScissorIndexedv(GLuint index
, const GLint
*v
)
4824 GET_CURRENT_CONTEXT(ctx
);
4826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4827 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_INDEXED_V
, 5);
4835 if (ctx
->ExecuteFlag
) {
4836 CALL_ScissorIndexedv(ctx
->Exec
, (index
, v
));
4840 static void GLAPIENTRY
4841 save_ScissorArrayv(GLuint first
, GLsizei count
, const GLint
*v
)
4843 GET_CURRENT_CONTEXT(ctx
);
4845 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4846 n
= alloc_instruction(ctx
, OPCODE_SCISSOR_ARRAY_V
, 2 + POINTER_DWORDS
);
4850 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLint
)));
4852 if (ctx
->ExecuteFlag
) {
4853 CALL_ScissorArrayv(ctx
->Exec
, (first
, count
, v
));
4857 static void GLAPIENTRY
4858 save_DepthRangeIndexed(GLuint index
, GLclampd n
, GLclampd f
)
4860 GET_CURRENT_CONTEXT(ctx
);
4862 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4863 node
= alloc_instruction(ctx
, OPCODE_DEPTH_INDEXED
, 3);
4866 /* Mesa stores these as floats internally so we deliberately convert
4867 * them to a float here.
4872 if (ctx
->ExecuteFlag
) {
4873 CALL_DepthRangeIndexed(ctx
->Exec
, (index
, n
, f
));
4877 static void GLAPIENTRY
4878 save_DepthRangeArrayv(GLuint first
, GLsizei count
, const GLclampd
*v
)
4880 GET_CURRENT_CONTEXT(ctx
);
4882 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4883 n
= alloc_instruction(ctx
, OPCODE_DEPTH_ARRAY_V
, 2 + POINTER_DWORDS
);
4887 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLclampd
)));
4889 if (ctx
->ExecuteFlag
) {
4890 CALL_DepthRangeArrayv(ctx
->Exec
, (first
, count
, v
));
4894 static void GLAPIENTRY
4895 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4897 GET_CURRENT_CONTEXT(ctx
);
4899 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4900 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4907 if (ctx
->ExecuteFlag
) {
4908 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4912 static void GLAPIENTRY
4913 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4915 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4918 static void GLAPIENTRY
4919 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4921 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4924 static void GLAPIENTRY
4925 save_WindowPos2iMESA(GLint x
, GLint y
)
4927 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4930 static void GLAPIENTRY
4931 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4933 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4936 static void GLAPIENTRY
4937 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4939 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4942 static void GLAPIENTRY
4943 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4945 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4948 static void GLAPIENTRY
4949 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4951 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4954 static void GLAPIENTRY
4955 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4957 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4960 static void GLAPIENTRY
4961 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4963 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4966 static void GLAPIENTRY
4967 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4969 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4972 static void GLAPIENTRY
4973 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4975 save_WindowPos4fMESA(x
, y
, z
, w
);
4978 static void GLAPIENTRY
4979 save_WindowPos2dvMESA(const GLdouble
* v
)
4981 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4984 static void GLAPIENTRY
4985 save_WindowPos2fvMESA(const GLfloat
* v
)
4987 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4990 static void GLAPIENTRY
4991 save_WindowPos2ivMESA(const GLint
* v
)
4993 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4996 static void GLAPIENTRY
4997 save_WindowPos2svMESA(const GLshort
* v
)
4999 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
5002 static void GLAPIENTRY
5003 save_WindowPos3dvMESA(const GLdouble
* v
)
5005 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5008 static void GLAPIENTRY
5009 save_WindowPos3fvMESA(const GLfloat
* v
)
5011 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5014 static void GLAPIENTRY
5015 save_WindowPos3ivMESA(const GLint
* v
)
5017 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
5020 static void GLAPIENTRY
5021 save_WindowPos3svMESA(const GLshort
* v
)
5023 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
5026 static void GLAPIENTRY
5027 save_WindowPos4dvMESA(const GLdouble
* v
)
5029 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5030 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5033 static void GLAPIENTRY
5034 save_WindowPos4fvMESA(const GLfloat
* v
)
5036 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5039 static void GLAPIENTRY
5040 save_WindowPos4ivMESA(const GLint
* v
)
5042 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
5043 (GLfloat
) v
[2], (GLfloat
) v
[3]);
5046 static void GLAPIENTRY
5047 save_WindowPos4svMESA(const GLshort
* v
)
5049 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
5054 /* GL_ARB_multitexture */
5055 static void GLAPIENTRY
5056 save_ActiveTextureARB(GLenum target
)
5058 GET_CURRENT_CONTEXT(ctx
);
5060 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5061 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
5065 if (ctx
->ExecuteFlag
) {
5066 CALL_ActiveTexture(ctx
->Exec
, (target
));
5071 /* GL_ARB_transpose_matrix */
5073 static void GLAPIENTRY
5074 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
5077 _math_transposefd(tm
, m
);
5078 save_LoadMatrixf(tm
);
5082 static void GLAPIENTRY
5083 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
5086 _math_transposef(tm
, m
);
5087 save_LoadMatrixf(tm
);
5091 static void GLAPIENTRY
5092 save_MultTransposeMatrixdARB(const GLdouble m
[16])
5095 _math_transposefd(tm
, m
);
5096 save_MultMatrixf(tm
);
5100 static void GLAPIENTRY
5101 save_MultTransposeMatrixfARB(const GLfloat m
[16])
5104 _math_transposef(tm
, m
);
5105 save_MultMatrixf(tm
);
5108 static GLvoid
*copy_data(const GLvoid
*data
, GLsizei size
, const char *func
)
5110 GET_CURRENT_CONTEXT(ctx
);
5116 image
= malloc(size
);
5118 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "%s", func
);
5121 memcpy(image
, data
, size
);
5127 /* GL_ARB_texture_compression */
5128 static void GLAPIENTRY
5129 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
5130 GLenum internalFormat
, GLsizei width
,
5131 GLint border
, GLsizei imageSize
,
5132 const GLvoid
* data
)
5134 GET_CURRENT_CONTEXT(ctx
);
5135 if (target
== GL_PROXY_TEXTURE_1D
) {
5136 /* don't compile, execute immediately */
5137 CALL_CompressedTexImage1D(ctx
->Exec
, (target
, level
, internalFormat
,
5138 width
, border
, imageSize
,
5143 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5145 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
,
5146 6 + POINTER_DWORDS
);
5150 n
[3].e
= internalFormat
;
5151 n
[4].i
= (GLint
) width
;
5155 copy_data(data
, imageSize
, "glCompressedTexImage1DARB"));
5157 if (ctx
->ExecuteFlag
) {
5158 CALL_CompressedTexImage1D(ctx
->Exec
,
5159 (target
, level
, internalFormat
, width
,
5160 border
, imageSize
, data
));
5166 static void GLAPIENTRY
5167 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
5168 GLenum internalFormat
, GLsizei width
,
5169 GLsizei height
, GLint border
, GLsizei imageSize
,
5170 const GLvoid
* data
)
5172 GET_CURRENT_CONTEXT(ctx
);
5173 if (target
== GL_PROXY_TEXTURE_2D
) {
5174 /* don't compile, execute immediately */
5175 CALL_CompressedTexImage2D(ctx
->Exec
, (target
, level
, internalFormat
,
5176 width
, height
, border
,
5181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5183 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
,
5184 7 + POINTER_DWORDS
);
5188 n
[3].e
= internalFormat
;
5189 n
[4].i
= (GLint
) width
;
5190 n
[5].i
= (GLint
) height
;
5194 copy_data(data
, imageSize
, "glCompressedTexImage2DARB"));
5196 if (ctx
->ExecuteFlag
) {
5197 CALL_CompressedTexImage2D(ctx
->Exec
,
5198 (target
, level
, internalFormat
, width
,
5199 height
, border
, imageSize
, data
));
5205 static void GLAPIENTRY
5206 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
5207 GLenum internalFormat
, GLsizei width
,
5208 GLsizei height
, GLsizei depth
, GLint border
,
5209 GLsizei imageSize
, const GLvoid
* data
)
5211 GET_CURRENT_CONTEXT(ctx
);
5212 if (target
== GL_PROXY_TEXTURE_3D
) {
5213 /* don't compile, execute immediately */
5214 CALL_CompressedTexImage3D(ctx
->Exec
, (target
, level
, internalFormat
,
5215 width
, height
, depth
, border
,
5220 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5222 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
,
5223 8 + POINTER_DWORDS
);
5227 n
[3].e
= internalFormat
;
5228 n
[4].i
= (GLint
) width
;
5229 n
[5].i
= (GLint
) height
;
5230 n
[6].i
= (GLint
) depth
;
5234 copy_data(data
, imageSize
, "glCompressedTexImage3DARB"));
5236 if (ctx
->ExecuteFlag
) {
5237 CALL_CompressedTexImage3D(ctx
->Exec
,
5238 (target
, level
, internalFormat
, width
,
5239 height
, depth
, border
, imageSize
,
5246 static void GLAPIENTRY
5247 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
5248 GLsizei width
, GLenum format
,
5249 GLsizei imageSize
, const GLvoid
* data
)
5252 GET_CURRENT_CONTEXT(ctx
);
5253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5255 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
5256 6 + POINTER_DWORDS
);
5261 n
[4].i
= (GLint
) width
;
5265 copy_data(data
, imageSize
, "glCompressedTexSubImage1DARB"));
5267 if (ctx
->ExecuteFlag
) {
5268 CALL_CompressedTexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
,
5269 width
, format
, imageSize
,
5275 static void GLAPIENTRY
5276 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
5277 GLint yoffset
, GLsizei width
, GLsizei height
,
5278 GLenum format
, GLsizei imageSize
,
5279 const GLvoid
* data
)
5282 GET_CURRENT_CONTEXT(ctx
);
5283 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5285 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
5286 8 + POINTER_DWORDS
);
5292 n
[5].i
= (GLint
) width
;
5293 n
[6].i
= (GLint
) height
;
5297 copy_data(data
, imageSize
, "glCompressedTexSubImage2DARB"));
5299 if (ctx
->ExecuteFlag
) {
5300 CALL_CompressedTexSubImage2D(ctx
->Exec
,
5301 (target
, level
, xoffset
, yoffset
, width
,
5302 height
, format
, imageSize
, data
));
5307 static void GLAPIENTRY
5308 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
5309 GLint yoffset
, GLint zoffset
, GLsizei width
,
5310 GLsizei height
, GLsizei depth
, GLenum format
,
5311 GLsizei imageSize
, const GLvoid
* data
)
5314 GET_CURRENT_CONTEXT(ctx
);
5315 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5317 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
5318 10 + POINTER_DWORDS
);
5325 n
[6].i
= (GLint
) width
;
5326 n
[7].i
= (GLint
) height
;
5327 n
[8].i
= (GLint
) depth
;
5329 n
[10].i
= imageSize
;
5330 save_pointer(&n
[11],
5331 copy_data(data
, imageSize
, "glCompressedTexSubImage3DARB"));
5333 if (ctx
->ExecuteFlag
) {
5334 CALL_CompressedTexSubImage3D(ctx
->Exec
,
5335 (target
, level
, xoffset
, yoffset
,
5336 zoffset
, width
, height
, depth
, format
,
5342 /* GL_ARB_multisample */
5343 static void GLAPIENTRY
5344 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
5346 GET_CURRENT_CONTEXT(ctx
);
5348 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5349 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
5354 if (ctx
->ExecuteFlag
) {
5355 CALL_SampleCoverage(ctx
->Exec
, (value
, invert
));
5361 * GL_ARB_vertex_program
5363 static void GLAPIENTRY
5364 save_BindProgramARB(GLenum target
, GLuint id
)
5366 GET_CURRENT_CONTEXT(ctx
);
5368 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5369 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_ARB
, 2);
5374 if (ctx
->ExecuteFlag
) {
5375 CALL_BindProgramARB(ctx
->Exec
, (target
, id
));
5379 static void GLAPIENTRY
5380 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
5381 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5383 GET_CURRENT_CONTEXT(ctx
);
5385 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5386 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5395 if (ctx
->ExecuteFlag
) {
5396 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5401 static void GLAPIENTRY
5402 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
5403 const GLfloat
*params
)
5405 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
5406 params
[2], params
[3]);
5410 static void GLAPIENTRY
5411 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5412 const GLfloat
* params
)
5414 GET_CURRENT_CONTEXT(ctx
);
5416 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5420 const GLfloat
* p
= params
;
5422 for (i
= 0 ; i
< count
; i
++) {
5423 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
5436 if (ctx
->ExecuteFlag
) {
5437 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5442 static void GLAPIENTRY
5443 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
5444 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5446 save_ProgramEnvParameter4fARB(target
, index
,
5448 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
5452 static void GLAPIENTRY
5453 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
5454 const GLdouble
*params
)
5456 save_ProgramEnvParameter4fARB(target
, index
,
5457 (GLfloat
) params
[0],
5458 (GLfloat
) params
[1],
5459 (GLfloat
) params
[2], (GLfloat
) params
[3]);
5463 static void GLAPIENTRY
5464 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
5465 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5467 GET_CURRENT_CONTEXT(ctx
);
5469 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5470 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5479 if (ctx
->ExecuteFlag
) {
5480 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5485 static void GLAPIENTRY
5486 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
5487 const GLfloat
*params
)
5489 GET_CURRENT_CONTEXT(ctx
);
5491 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5492 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5501 if (ctx
->ExecuteFlag
) {
5502 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
5507 static void GLAPIENTRY
5508 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
5509 const GLfloat
*params
)
5511 GET_CURRENT_CONTEXT(ctx
);
5513 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5517 const GLfloat
* p
= params
;
5519 for (i
= 0 ; i
< count
; i
++) {
5520 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5533 if (ctx
->ExecuteFlag
) {
5534 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
5539 static void GLAPIENTRY
5540 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
5541 GLdouble x
, GLdouble y
,
5542 GLdouble z
, GLdouble w
)
5544 GET_CURRENT_CONTEXT(ctx
);
5546 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5547 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5551 n
[3].f
= (GLfloat
) x
;
5552 n
[4].f
= (GLfloat
) y
;
5553 n
[5].f
= (GLfloat
) z
;
5554 n
[6].f
= (GLfloat
) w
;
5556 if (ctx
->ExecuteFlag
) {
5557 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
5562 static void GLAPIENTRY
5563 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
5564 const GLdouble
*params
)
5566 GET_CURRENT_CONTEXT(ctx
);
5568 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5569 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
5573 n
[3].f
= (GLfloat
) params
[0];
5574 n
[4].f
= (GLfloat
) params
[1];
5575 n
[5].f
= (GLfloat
) params
[2];
5576 n
[6].f
= (GLfloat
) params
[3];
5578 if (ctx
->ExecuteFlag
) {
5579 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5584 /* GL_EXT_stencil_two_side */
5585 static void GLAPIENTRY
5586 save_ActiveStencilFaceEXT(GLenum face
)
5588 GET_CURRENT_CONTEXT(ctx
);
5590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5591 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5595 if (ctx
->ExecuteFlag
) {
5596 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5601 /* GL_EXT_depth_bounds_test */
5602 static void GLAPIENTRY
5603 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5605 GET_CURRENT_CONTEXT(ctx
);
5607 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5608 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5610 n
[1].f
= (GLfloat
) zmin
;
5611 n
[2].f
= (GLfloat
) zmax
;
5613 if (ctx
->ExecuteFlag
) {
5614 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5620 static void GLAPIENTRY
5621 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5622 const GLvoid
* string
)
5624 GET_CURRENT_CONTEXT(ctx
);
5627 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5629 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 3 + POINTER_DWORDS
);
5631 GLubyte
*programCopy
= malloc(len
);
5633 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5636 memcpy(programCopy
, string
, len
);
5640 save_pointer(&n
[4], programCopy
);
5642 if (ctx
->ExecuteFlag
) {
5643 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5648 static void GLAPIENTRY
5649 save_BeginQueryARB(GLenum target
, GLuint id
)
5651 GET_CURRENT_CONTEXT(ctx
);
5653 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5654 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5659 if (ctx
->ExecuteFlag
) {
5660 CALL_BeginQuery(ctx
->Exec
, (target
, id
));
5664 static void GLAPIENTRY
5665 save_EndQueryARB(GLenum target
)
5667 GET_CURRENT_CONTEXT(ctx
);
5669 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5670 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5674 if (ctx
->ExecuteFlag
) {
5675 CALL_EndQuery(ctx
->Exec
, (target
));
5679 static void GLAPIENTRY
5680 save_QueryCounter(GLuint id
, GLenum target
)
5682 GET_CURRENT_CONTEXT(ctx
);
5684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5685 n
= alloc_instruction(ctx
, OPCODE_QUERY_COUNTER
, 2);
5690 if (ctx
->ExecuteFlag
) {
5691 CALL_QueryCounter(ctx
->Exec
, (id
, target
));
5695 static void GLAPIENTRY
5696 save_BeginQueryIndexed(GLenum target
, GLuint index
, GLuint id
)
5698 GET_CURRENT_CONTEXT(ctx
);
5700 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5701 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_INDEXED
, 3);
5707 if (ctx
->ExecuteFlag
) {
5708 CALL_BeginQueryIndexed(ctx
->Exec
, (target
, index
, id
));
5712 static void GLAPIENTRY
5713 save_EndQueryIndexed(GLenum target
, GLuint index
)
5715 GET_CURRENT_CONTEXT(ctx
);
5717 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5718 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_INDEXED
, 2);
5723 if (ctx
->ExecuteFlag
) {
5724 CALL_EndQueryIndexed(ctx
->Exec
, (target
, index
));
5729 static void GLAPIENTRY
5730 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5732 GET_CURRENT_CONTEXT(ctx
);
5734 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5735 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5739 if (count
> MAX_DRAW_BUFFERS
)
5740 count
= MAX_DRAW_BUFFERS
;
5741 for (i
= 0; i
< count
; i
++) {
5742 n
[2 + i
].e
= buffers
[i
];
5745 if (ctx
->ExecuteFlag
) {
5746 CALL_DrawBuffers(ctx
->Exec
, (count
, buffers
));
5750 static void GLAPIENTRY
5751 save_BindFragmentShaderATI(GLuint id
)
5753 GET_CURRENT_CONTEXT(ctx
);
5756 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5760 if (ctx
->ExecuteFlag
) {
5761 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5765 static void GLAPIENTRY
5766 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5768 GET_CURRENT_CONTEXT(ctx
);
5771 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5779 if (ctx
->ExecuteFlag
) {
5780 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5784 static void GLAPIENTRY
5785 save_Attr1fNV(GLenum attr
, GLfloat x
)
5787 GET_CURRENT_CONTEXT(ctx
);
5789 SAVE_FLUSH_VERTICES(ctx
);
5790 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5796 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5797 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5798 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5800 if (ctx
->ExecuteFlag
) {
5801 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5805 static void GLAPIENTRY
5806 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5808 GET_CURRENT_CONTEXT(ctx
);
5810 SAVE_FLUSH_VERTICES(ctx
);
5811 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5818 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5819 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5820 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5822 if (ctx
->ExecuteFlag
) {
5823 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5827 static void GLAPIENTRY
5828 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5830 GET_CURRENT_CONTEXT(ctx
);
5832 SAVE_FLUSH_VERTICES(ctx
);
5833 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5841 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5842 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5843 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5845 if (ctx
->ExecuteFlag
) {
5846 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5850 static void GLAPIENTRY
5851 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5853 GET_CURRENT_CONTEXT(ctx
);
5855 SAVE_FLUSH_VERTICES(ctx
);
5856 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5865 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5866 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5867 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5869 if (ctx
->ExecuteFlag
) {
5870 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5875 static void GLAPIENTRY
5876 save_Attr1fARB(GLenum attr
, GLfloat x
)
5878 GET_CURRENT_CONTEXT(ctx
);
5880 SAVE_FLUSH_VERTICES(ctx
);
5881 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5887 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5888 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5889 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5891 if (ctx
->ExecuteFlag
) {
5892 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5896 static void GLAPIENTRY
5897 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5899 GET_CURRENT_CONTEXT(ctx
);
5901 SAVE_FLUSH_VERTICES(ctx
);
5902 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5909 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5910 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5911 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5913 if (ctx
->ExecuteFlag
) {
5914 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5918 static void GLAPIENTRY
5919 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5921 GET_CURRENT_CONTEXT(ctx
);
5923 SAVE_FLUSH_VERTICES(ctx
);
5924 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5932 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5933 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5934 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5936 if (ctx
->ExecuteFlag
) {
5937 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5941 static void GLAPIENTRY
5942 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5944 GET_CURRENT_CONTEXT(ctx
);
5946 SAVE_FLUSH_VERTICES(ctx
);
5947 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5956 assert(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5957 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5958 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5960 if (ctx
->ExecuteFlag
) {
5961 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5966 static void GLAPIENTRY
5967 save_EvalCoord1f(GLfloat x
)
5969 GET_CURRENT_CONTEXT(ctx
);
5971 SAVE_FLUSH_VERTICES(ctx
);
5972 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5976 if (ctx
->ExecuteFlag
) {
5977 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5981 static void GLAPIENTRY
5982 save_EvalCoord1fv(const GLfloat
* v
)
5984 save_EvalCoord1f(v
[0]);
5987 static void GLAPIENTRY
5988 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5990 GET_CURRENT_CONTEXT(ctx
);
5992 SAVE_FLUSH_VERTICES(ctx
);
5993 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5998 if (ctx
->ExecuteFlag
) {
5999 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
6003 static void GLAPIENTRY
6004 save_EvalCoord2fv(const GLfloat
* v
)
6006 save_EvalCoord2f(v
[0], v
[1]);
6010 static void GLAPIENTRY
6011 save_EvalPoint1(GLint x
)
6013 GET_CURRENT_CONTEXT(ctx
);
6015 SAVE_FLUSH_VERTICES(ctx
);
6016 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
6020 if (ctx
->ExecuteFlag
) {
6021 CALL_EvalPoint1(ctx
->Exec
, (x
));
6025 static void GLAPIENTRY
6026 save_EvalPoint2(GLint x
, GLint y
)
6028 GET_CURRENT_CONTEXT(ctx
);
6030 SAVE_FLUSH_VERTICES(ctx
);
6031 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
6036 if (ctx
->ExecuteFlag
) {
6037 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
6041 static void GLAPIENTRY
6042 save_Indexf(GLfloat x
)
6044 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
6047 static void GLAPIENTRY
6048 save_Indexfv(const GLfloat
* v
)
6050 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
6053 static void GLAPIENTRY
6054 save_EdgeFlag(GLboolean x
)
6056 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0f
: 0.0f
);
6061 * Compare 'count' elements of vectors 'a' and 'b'.
6062 * \return GL_TRUE if equal, GL_FALSE if different.
6064 static inline GLboolean
6065 compare_vec(const GLfloat
*a
, const GLfloat
*b
, GLuint count
)
6067 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
6072 * This glMaterial function is used for glMaterial calls that are outside
6073 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
6075 static void GLAPIENTRY
6076 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
6078 GET_CURRENT_CONTEXT(ctx
);
6086 case GL_FRONT_AND_BACK
:
6089 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(face)");
6098 case GL_AMBIENT_AND_DIFFUSE
:
6104 case GL_COLOR_INDEXES
:
6108 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glMaterial(pname)");
6112 if (ctx
->ExecuteFlag
) {
6113 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
6116 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
6118 /* Try to eliminate redundant statechanges. Because it is legal to
6119 * call glMaterial even inside begin/end calls, don't need to worry
6120 * about ctx->Driver.CurrentSavePrimitive here.
6122 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
6123 if (bitmask
& (1 << i
)) {
6124 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
6125 compare_vec(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
6126 /* no change in material value */
6127 bitmask
&= ~(1 << i
);
6130 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
6131 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
6136 /* If this call has no effect, return early */
6140 SAVE_FLUSH_VERTICES(ctx
);
6142 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
6146 for (i
= 0; i
< args
; i
++)
6147 n
[3 + i
].f
= param
[i
];
6151 static void GLAPIENTRY
6152 save_Begin(GLenum mode
)
6154 GET_CURRENT_CONTEXT(ctx
);
6156 if (!_mesa_is_valid_prim_mode(ctx
, mode
)) {
6157 /* compile this error into the display list */
6158 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "glBegin(mode)");
6160 else if (_mesa_inside_dlist_begin_end(ctx
)) {
6161 /* compile this error into the display list */
6162 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive glBegin");
6165 ctx
->Driver
.CurrentSavePrimitive
= mode
;
6167 vbo_save_NotifyBegin(ctx
, mode
, false);
6171 static void GLAPIENTRY
6174 GET_CURRENT_CONTEXT(ctx
);
6175 SAVE_FLUSH_VERTICES(ctx
);
6176 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
6177 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
6178 if (ctx
->ExecuteFlag
) {
6179 CALL_End(ctx
->Exec
, ());
6183 static void GLAPIENTRY
6184 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
6186 GET_CURRENT_CONTEXT(ctx
);
6188 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6189 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
6196 if (ctx
->ExecuteFlag
) {
6197 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
6202 static void GLAPIENTRY
6203 save_Vertex2f(GLfloat x
, GLfloat y
)
6205 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
6208 static void GLAPIENTRY
6209 save_Vertex2fv(const GLfloat
* v
)
6211 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
6214 static void GLAPIENTRY
6215 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
6217 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
6220 static void GLAPIENTRY
6221 save_Vertex3fv(const GLfloat
* v
)
6223 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
6226 static void GLAPIENTRY
6227 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6229 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
6232 static void GLAPIENTRY
6233 save_Vertex4fv(const GLfloat
* v
)
6235 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
6238 static void GLAPIENTRY
6239 save_TexCoord1f(GLfloat x
)
6241 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
6244 static void GLAPIENTRY
6245 save_TexCoord1fv(const GLfloat
* v
)
6247 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
6250 static void GLAPIENTRY
6251 save_TexCoord2f(GLfloat x
, GLfloat y
)
6253 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
6256 static void GLAPIENTRY
6257 save_TexCoord2fv(const GLfloat
* v
)
6259 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
6262 static void GLAPIENTRY
6263 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
6265 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
6268 static void GLAPIENTRY
6269 save_TexCoord3fv(const GLfloat
* v
)
6271 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
6274 static void GLAPIENTRY
6275 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6277 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
6280 static void GLAPIENTRY
6281 save_TexCoord4fv(const GLfloat
* v
)
6283 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
6286 static void GLAPIENTRY
6287 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
6289 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
6292 static void GLAPIENTRY
6293 save_Normal3fv(const GLfloat
* v
)
6295 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
6298 static void GLAPIENTRY
6299 save_FogCoordfEXT(GLfloat x
)
6301 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
6304 static void GLAPIENTRY
6305 save_FogCoordfvEXT(const GLfloat
* v
)
6307 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
6310 static void GLAPIENTRY
6311 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
6313 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
6316 static void GLAPIENTRY
6317 save_Color3fv(const GLfloat
* v
)
6319 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
6322 static void GLAPIENTRY
6323 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6325 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
6328 static void GLAPIENTRY
6329 save_Color4fv(const GLfloat
* v
)
6331 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
6334 static void GLAPIENTRY
6335 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
6337 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
6340 static void GLAPIENTRY
6341 save_SecondaryColor3fvEXT(const GLfloat
* v
)
6343 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
6347 /* Just call the respective ATTR for texcoord
6349 static void GLAPIENTRY
6350 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
6352 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6353 save_Attr1fNV(attr
, x
);
6356 static void GLAPIENTRY
6357 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
6359 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6360 save_Attr1fNV(attr
, v
[0]);
6363 static void GLAPIENTRY
6364 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
6366 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6367 save_Attr2fNV(attr
, x
, y
);
6370 static void GLAPIENTRY
6371 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
6373 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6374 save_Attr2fNV(attr
, v
[0], v
[1]);
6377 static void GLAPIENTRY
6378 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
6380 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6381 save_Attr3fNV(attr
, x
, y
, z
);
6384 static void GLAPIENTRY
6385 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
6387 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6388 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
6391 static void GLAPIENTRY
6392 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
6393 GLfloat z
, GLfloat w
)
6395 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6396 save_Attr4fNV(attr
, x
, y
, z
, w
);
6399 static void GLAPIENTRY
6400 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
6402 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
6403 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
6408 * Record a GL_INVALID_VALUE error when an invalid vertex attribute
6414 GET_CURRENT_CONTEXT(ctx
);
6415 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
6420 static void GLAPIENTRY
6421 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
6423 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6424 save_Attr1fARB(index
, x
);
6429 static void GLAPIENTRY
6430 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
6432 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6433 save_Attr1fARB(index
, v
[0]);
6438 static void GLAPIENTRY
6439 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6441 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6442 save_Attr2fARB(index
, x
, y
);
6447 static void GLAPIENTRY
6448 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6450 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6451 save_Attr2fARB(index
, v
[0], v
[1]);
6456 static void GLAPIENTRY
6457 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6459 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6460 save_Attr3fARB(index
, x
, y
, z
);
6465 static void GLAPIENTRY
6466 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6468 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6469 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6474 static void GLAPIENTRY
6475 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6478 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6479 save_Attr4fARB(index
, x
, y
, z
, w
);
6484 static void GLAPIENTRY
6485 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6487 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6488 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6493 static void GLAPIENTRY
6494 save_VertexAttribL1d(GLuint index
, GLdouble x
)
6496 GET_CURRENT_CONTEXT(ctx
);
6498 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6500 SAVE_FLUSH_VERTICES(ctx
);
6501 n
= alloc_instruction(ctx
, OPCODE_ATTR_1D
, 3);
6504 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6507 ctx
->ListState
.ActiveAttribSize
[index
] = 1;
6508 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2], sizeof(GLdouble
));
6510 if (ctx
->ExecuteFlag
) {
6511 CALL_VertexAttribL1d(ctx
->Exec
, (index
, x
));
6518 static void GLAPIENTRY
6519 save_VertexAttribL1dv(GLuint index
, const GLdouble
*v
)
6521 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6522 save_VertexAttribL1d(index
, v
[0]);
6527 static void GLAPIENTRY
6528 save_VertexAttribL2d(GLuint index
, GLdouble x
, GLdouble y
)
6530 GET_CURRENT_CONTEXT(ctx
);
6532 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6534 SAVE_FLUSH_VERTICES(ctx
);
6535 n
= alloc_instruction(ctx
, OPCODE_ATTR_2D
, 5);
6538 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6539 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6542 ctx
->ListState
.ActiveAttribSize
[index
] = 2;
6543 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6544 2 * sizeof(GLdouble
));
6546 if (ctx
->ExecuteFlag
) {
6547 CALL_VertexAttribL2d(ctx
->Exec
, (index
, x
, y
));
6554 static void GLAPIENTRY
6555 save_VertexAttribL2dv(GLuint index
, const GLdouble
*v
)
6557 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6558 save_VertexAttribL2d(index
, v
[0], v
[1]);
6563 static void GLAPIENTRY
6564 save_VertexAttribL3d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
)
6566 GET_CURRENT_CONTEXT(ctx
);
6568 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6570 SAVE_FLUSH_VERTICES(ctx
);
6571 n
= alloc_instruction(ctx
, OPCODE_ATTR_3D
, 7);
6574 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6575 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6576 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6579 ctx
->ListState
.ActiveAttribSize
[index
] = 3;
6580 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6581 3 * sizeof(GLdouble
));
6583 if (ctx
->ExecuteFlag
) {
6584 CALL_VertexAttribL3d(ctx
->Exec
, (index
, x
, y
, z
));
6591 static void GLAPIENTRY
6592 save_VertexAttribL3dv(GLuint index
, const GLdouble
*v
)
6594 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6595 save_VertexAttribL3d(index
, v
[0], v
[1], v
[2]);
6600 static void GLAPIENTRY
6601 save_VertexAttribL4d(GLuint index
, GLdouble x
, GLdouble y
, GLdouble z
,
6604 GET_CURRENT_CONTEXT(ctx
);
6606 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
) {
6608 SAVE_FLUSH_VERTICES(ctx
);
6609 n
= alloc_instruction(ctx
, OPCODE_ATTR_4D
, 9);
6612 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
6613 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
6614 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
6615 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
6618 ctx
->ListState
.ActiveAttribSize
[index
] = 4;
6619 memcpy(ctx
->ListState
.CurrentAttrib
[index
], &n
[2],
6620 4 * sizeof(GLdouble
));
6622 if (ctx
->ExecuteFlag
) {
6623 CALL_VertexAttribL4d(ctx
->Exec
, (index
, x
, y
, z
, w
));
6630 static void GLAPIENTRY
6631 save_VertexAttribL4dv(GLuint index
, const GLdouble
*v
)
6633 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6634 save_VertexAttribL4d(index
, v
[0], v
[1], v
[2], v
[3]);
6639 static void GLAPIENTRY
6640 save_PrimitiveRestartNV(void)
6642 /* Note: this is used when outside a glBegin/End pair in a display list */
6643 GET_CURRENT_CONTEXT(ctx
);
6644 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6645 (void) alloc_instruction(ctx
, OPCODE_PRIMITIVE_RESTART_NV
, 0);
6646 if (ctx
->ExecuteFlag
) {
6647 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
6652 static void GLAPIENTRY
6653 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6654 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6655 GLbitfield mask
, GLenum filter
)
6657 GET_CURRENT_CONTEXT(ctx
);
6659 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6660 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6673 if (ctx
->ExecuteFlag
) {
6674 CALL_BlitFramebuffer(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6675 dstX0
, dstY0
, dstX1
, dstY1
,
6681 /** GL_EXT_provoking_vertex */
6682 static void GLAPIENTRY
6683 save_ProvokingVertexEXT(GLenum mode
)
6685 GET_CURRENT_CONTEXT(ctx
);
6687 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6688 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6692 if (ctx
->ExecuteFlag
) {
6693 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
6694 _mesa_ProvokingVertex(mode
);
6699 /** GL_EXT_transform_feedback */
6700 static void GLAPIENTRY
6701 save_BeginTransformFeedback(GLenum mode
)
6703 GET_CURRENT_CONTEXT(ctx
);
6705 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6706 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6710 if (ctx
->ExecuteFlag
) {
6711 CALL_BeginTransformFeedback(ctx
->Exec
, (mode
));
6716 /** GL_EXT_transform_feedback */
6717 static void GLAPIENTRY
6718 save_EndTransformFeedback(void)
6720 GET_CURRENT_CONTEXT(ctx
);
6721 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6722 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6723 if (ctx
->ExecuteFlag
) {
6724 CALL_EndTransformFeedback(ctx
->Exec
, ());
6728 static void GLAPIENTRY
6729 save_BindTransformFeedback(GLenum target
, GLuint name
)
6731 GET_CURRENT_CONTEXT(ctx
);
6733 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6734 n
= alloc_instruction(ctx
, OPCODE_BIND_TRANSFORM_FEEDBACK
, 2);
6739 if (ctx
->ExecuteFlag
) {
6740 CALL_BindTransformFeedback(ctx
->Exec
, (target
, name
));
6744 static void GLAPIENTRY
6745 save_PauseTransformFeedback(void)
6747 GET_CURRENT_CONTEXT(ctx
);
6748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6749 (void) alloc_instruction(ctx
, OPCODE_PAUSE_TRANSFORM_FEEDBACK
, 0);
6750 if (ctx
->ExecuteFlag
) {
6751 CALL_PauseTransformFeedback(ctx
->Exec
, ());
6755 static void GLAPIENTRY
6756 save_ResumeTransformFeedback(void)
6758 GET_CURRENT_CONTEXT(ctx
);
6759 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6760 (void) alloc_instruction(ctx
, OPCODE_RESUME_TRANSFORM_FEEDBACK
, 0);
6761 if (ctx
->ExecuteFlag
) {
6762 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
6766 static void GLAPIENTRY
6767 save_DrawTransformFeedback(GLenum mode
, GLuint name
)
6769 GET_CURRENT_CONTEXT(ctx
);
6771 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6772 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK
, 2);
6777 if (ctx
->ExecuteFlag
) {
6778 CALL_DrawTransformFeedback(ctx
->Exec
, (mode
, name
));
6782 static void GLAPIENTRY
6783 save_DrawTransformFeedbackStream(GLenum mode
, GLuint name
, GLuint stream
)
6785 GET_CURRENT_CONTEXT(ctx
);
6787 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6788 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
, 3);
6794 if (ctx
->ExecuteFlag
) {
6795 CALL_DrawTransformFeedbackStream(ctx
->Exec
, (mode
, name
, stream
));
6799 static void GLAPIENTRY
6800 save_DrawTransformFeedbackInstanced(GLenum mode
, GLuint name
,
6803 GET_CURRENT_CONTEXT(ctx
);
6805 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6806 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
, 3);
6810 n
[3].si
= primcount
;
6812 if (ctx
->ExecuteFlag
) {
6813 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
, (mode
, name
, primcount
));
6817 static void GLAPIENTRY
6818 save_DrawTransformFeedbackStreamInstanced(GLenum mode
, GLuint name
,
6819 GLuint stream
, GLsizei primcount
)
6821 GET_CURRENT_CONTEXT(ctx
);
6823 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6824 n
= alloc_instruction(ctx
, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
, 4);
6829 n
[4].si
= primcount
;
6831 if (ctx
->ExecuteFlag
) {
6832 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
, (mode
, name
, stream
,
6837 static void GLAPIENTRY
6838 save_DispatchCompute(GLuint num_groups_x
, GLuint num_groups_y
,
6839 GLuint num_groups_z
)
6841 GET_CURRENT_CONTEXT(ctx
);
6843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6844 n
= alloc_instruction(ctx
, OPCODE_DISPATCH_COMPUTE
, 3);
6846 n
[1].ui
= num_groups_x
;
6847 n
[2].ui
= num_groups_y
;
6848 n
[3].ui
= num_groups_z
;
6850 if (ctx
->ExecuteFlag
) {
6851 CALL_DispatchCompute(ctx
->Exec
, (num_groups_x
, num_groups_y
,
6856 static void GLAPIENTRY
6857 save_DispatchComputeIndirect(GLintptr indirect
)
6859 GET_CURRENT_CONTEXT(ctx
);
6860 _mesa_error(ctx
, GL_INVALID_OPERATION
,
6861 "glDispatchComputeIndirect() during display list compile");
6864 static void GLAPIENTRY
6865 save_UseProgram(GLuint program
)
6867 GET_CURRENT_CONTEXT(ctx
);
6869 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6870 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6874 if (ctx
->ExecuteFlag
) {
6875 CALL_UseProgram(ctx
->Exec
, (program
));
6880 static void GLAPIENTRY
6881 save_Uniform1fARB(GLint location
, GLfloat x
)
6883 GET_CURRENT_CONTEXT(ctx
);
6885 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6886 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6891 if (ctx
->ExecuteFlag
) {
6892 CALL_Uniform1f(ctx
->Exec
, (location
, x
));
6897 static void GLAPIENTRY
6898 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6900 GET_CURRENT_CONTEXT(ctx
);
6902 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6903 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6909 if (ctx
->ExecuteFlag
) {
6910 CALL_Uniform2f(ctx
->Exec
, (location
, x
, y
));
6915 static void GLAPIENTRY
6916 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6918 GET_CURRENT_CONTEXT(ctx
);
6920 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6921 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6928 if (ctx
->ExecuteFlag
) {
6929 CALL_Uniform3f(ctx
->Exec
, (location
, x
, y
, z
));
6934 static void GLAPIENTRY
6935 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6937 GET_CURRENT_CONTEXT(ctx
);
6939 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6940 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6948 if (ctx
->ExecuteFlag
) {
6949 CALL_Uniform4f(ctx
->Exec
, (location
, x
, y
, z
, w
));
6954 static void GLAPIENTRY
6955 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6957 GET_CURRENT_CONTEXT(ctx
);
6959 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6960 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 2 + POINTER_DWORDS
);
6964 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLfloat
)));
6966 if (ctx
->ExecuteFlag
) {
6967 CALL_Uniform1fv(ctx
->Exec
, (location
, count
, v
));
6971 static void GLAPIENTRY
6972 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6974 GET_CURRENT_CONTEXT(ctx
);
6976 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6977 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 2 + POINTER_DWORDS
);
6981 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLfloat
)));
6983 if (ctx
->ExecuteFlag
) {
6984 CALL_Uniform2fv(ctx
->Exec
, (location
, count
, v
));
6988 static void GLAPIENTRY
6989 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6991 GET_CURRENT_CONTEXT(ctx
);
6993 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6994 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 2 + POINTER_DWORDS
);
6998 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7000 if (ctx
->ExecuteFlag
) {
7001 CALL_Uniform3fv(ctx
->Exec
, (location
, count
, v
));
7005 static void GLAPIENTRY
7006 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
7008 GET_CURRENT_CONTEXT(ctx
);
7010 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7011 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 2 + POINTER_DWORDS
);
7015 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7017 if (ctx
->ExecuteFlag
) {
7018 CALL_Uniform4fv(ctx
->Exec
, (location
, count
, v
));
7023 static void GLAPIENTRY
7024 save_Uniform1d(GLint location
, GLdouble x
)
7026 GET_CURRENT_CONTEXT(ctx
);
7028 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7029 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1D
, 3);
7032 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7034 if (ctx
->ExecuteFlag
) {
7035 CALL_Uniform1d(ctx
->Exec
, (location
, x
));
7040 static void GLAPIENTRY
7041 save_Uniform2d(GLint location
, GLdouble x
, GLdouble y
)
7043 GET_CURRENT_CONTEXT(ctx
);
7045 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7046 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2D
, 5);
7049 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7050 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7052 if (ctx
->ExecuteFlag
) {
7053 CALL_Uniform2d(ctx
->Exec
, (location
, x
, y
));
7058 static void GLAPIENTRY
7059 save_Uniform3d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
)
7061 GET_CURRENT_CONTEXT(ctx
);
7063 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7064 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3D
, 7);
7067 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7068 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7069 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7071 if (ctx
->ExecuteFlag
) {
7072 CALL_Uniform3d(ctx
->Exec
, (location
, x
, y
, z
));
7077 static void GLAPIENTRY
7078 save_Uniform4d(GLint location
, GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
7080 GET_CURRENT_CONTEXT(ctx
);
7082 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7083 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4D
, 9);
7086 ASSIGN_DOUBLE_TO_NODES(n
, 2, x
);
7087 ASSIGN_DOUBLE_TO_NODES(n
, 4, y
);
7088 ASSIGN_DOUBLE_TO_NODES(n
, 6, z
);
7089 ASSIGN_DOUBLE_TO_NODES(n
, 8, w
);
7091 if (ctx
->ExecuteFlag
) {
7092 CALL_Uniform4d(ctx
->Exec
, (location
, x
, y
, z
, w
));
7097 static void GLAPIENTRY
7098 save_Uniform1dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7100 GET_CURRENT_CONTEXT(ctx
);
7102 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7103 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1DV
, 2 + POINTER_DWORDS
);
7107 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLdouble
)));
7109 if (ctx
->ExecuteFlag
) {
7110 CALL_Uniform1dv(ctx
->Exec
, (location
, count
, v
));
7115 static void GLAPIENTRY
7116 save_Uniform2dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7118 GET_CURRENT_CONTEXT(ctx
);
7120 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7121 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2DV
, 2 + POINTER_DWORDS
);
7125 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLdouble
)));
7127 if (ctx
->ExecuteFlag
) {
7128 CALL_Uniform2dv(ctx
->Exec
, (location
, count
, v
));
7133 static void GLAPIENTRY
7134 save_Uniform3dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7136 GET_CURRENT_CONTEXT(ctx
);
7138 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7139 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3DV
, 2 + POINTER_DWORDS
);
7143 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLdouble
)));
7145 if (ctx
->ExecuteFlag
) {
7146 CALL_Uniform3dv(ctx
->Exec
, (location
, count
, v
));
7151 static void GLAPIENTRY
7152 save_Uniform4dv(GLint location
, GLsizei count
, const GLdouble
*v
)
7154 GET_CURRENT_CONTEXT(ctx
);
7156 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7157 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4DV
, 2 + POINTER_DWORDS
);
7161 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLdouble
)));
7163 if (ctx
->ExecuteFlag
) {
7164 CALL_Uniform4dv(ctx
->Exec
, (location
, count
, v
));
7169 static void GLAPIENTRY
7170 save_Uniform1iARB(GLint location
, GLint x
)
7172 GET_CURRENT_CONTEXT(ctx
);
7174 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7175 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
7180 if (ctx
->ExecuteFlag
) {
7181 CALL_Uniform1i(ctx
->Exec
, (location
, x
));
7185 static void GLAPIENTRY
7186 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
7188 GET_CURRENT_CONTEXT(ctx
);
7190 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7191 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
7197 if (ctx
->ExecuteFlag
) {
7198 CALL_Uniform2i(ctx
->Exec
, (location
, x
, y
));
7202 static void GLAPIENTRY
7203 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
7205 GET_CURRENT_CONTEXT(ctx
);
7207 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7208 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
7215 if (ctx
->ExecuteFlag
) {
7216 CALL_Uniform3i(ctx
->Exec
, (location
, x
, y
, z
));
7220 static void GLAPIENTRY
7221 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
7223 GET_CURRENT_CONTEXT(ctx
);
7225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7226 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
7234 if (ctx
->ExecuteFlag
) {
7235 CALL_Uniform4i(ctx
->Exec
, (location
, x
, y
, z
, w
));
7241 static void GLAPIENTRY
7242 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7244 GET_CURRENT_CONTEXT(ctx
);
7246 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7247 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 2 + POINTER_DWORDS
);
7251 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(GLint
)));
7253 if (ctx
->ExecuteFlag
) {
7254 CALL_Uniform1iv(ctx
->Exec
, (location
, count
, v
));
7258 static void GLAPIENTRY
7259 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7261 GET_CURRENT_CONTEXT(ctx
);
7263 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7264 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 2 + POINTER_DWORDS
);
7268 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(GLint
)));
7270 if (ctx
->ExecuteFlag
) {
7271 CALL_Uniform2iv(ctx
->Exec
, (location
, count
, v
));
7275 static void GLAPIENTRY
7276 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7278 GET_CURRENT_CONTEXT(ctx
);
7280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7281 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 2 + POINTER_DWORDS
);
7285 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(GLint
)));
7287 if (ctx
->ExecuteFlag
) {
7288 CALL_Uniform3iv(ctx
->Exec
, (location
, count
, v
));
7292 static void GLAPIENTRY
7293 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
7295 GET_CURRENT_CONTEXT(ctx
);
7297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7298 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 2 + POINTER_DWORDS
);
7302 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7304 if (ctx
->ExecuteFlag
) {
7305 CALL_Uniform4iv(ctx
->Exec
, (location
, count
, v
));
7311 static void GLAPIENTRY
7312 save_Uniform1ui(GLint location
, GLuint x
)
7314 GET_CURRENT_CONTEXT(ctx
);
7316 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7317 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
7322 if (ctx
->ExecuteFlag
) {
7323 CALL_Uniform1ui(ctx
->Exec
, (location
, x
));
7327 static void GLAPIENTRY
7328 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
7330 GET_CURRENT_CONTEXT(ctx
);
7332 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7333 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
7339 if (ctx
->ExecuteFlag
) {
7340 CALL_Uniform2ui(ctx
->Exec
, (location
, x
, y
));
7344 static void GLAPIENTRY
7345 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
7347 GET_CURRENT_CONTEXT(ctx
);
7349 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7350 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
7357 if (ctx
->ExecuteFlag
) {
7358 CALL_Uniform3ui(ctx
->Exec
, (location
, x
, y
, z
));
7362 static void GLAPIENTRY
7363 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
7365 GET_CURRENT_CONTEXT(ctx
);
7367 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7368 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
7376 if (ctx
->ExecuteFlag
) {
7377 CALL_Uniform4ui(ctx
->Exec
, (location
, x
, y
, z
, w
));
7383 static void GLAPIENTRY
7384 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7386 GET_CURRENT_CONTEXT(ctx
);
7388 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7389 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 2 + POINTER_DWORDS
);
7393 save_pointer(&n
[3], memdup(v
, count
* 1 * sizeof(*v
)));
7395 if (ctx
->ExecuteFlag
) {
7396 CALL_Uniform1uiv(ctx
->Exec
, (location
, count
, v
));
7400 static void GLAPIENTRY
7401 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7403 GET_CURRENT_CONTEXT(ctx
);
7405 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7406 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 2 + POINTER_DWORDS
);
7410 save_pointer(&n
[3], memdup(v
, count
* 2 * sizeof(*v
)));
7412 if (ctx
->ExecuteFlag
) {
7413 CALL_Uniform2uiv(ctx
->Exec
, (location
, count
, v
));
7417 static void GLAPIENTRY
7418 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7420 GET_CURRENT_CONTEXT(ctx
);
7422 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7423 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 2 + POINTER_DWORDS
);
7427 save_pointer(&n
[3], memdup(v
, count
* 3 * sizeof(*v
)));
7429 if (ctx
->ExecuteFlag
) {
7430 CALL_Uniform3uiv(ctx
->Exec
, (location
, count
, v
));
7434 static void GLAPIENTRY
7435 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
7437 GET_CURRENT_CONTEXT(ctx
);
7439 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7440 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 2 + POINTER_DWORDS
);
7444 save_pointer(&n
[3], memdup(v
, count
* 4 * sizeof(*v
)));
7446 if (ctx
->ExecuteFlag
) {
7447 CALL_Uniform4uiv(ctx
->Exec
, (location
, count
, v
));
7453 static void GLAPIENTRY
7454 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7457 GET_CURRENT_CONTEXT(ctx
);
7459 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7460 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 3 + POINTER_DWORDS
);
7465 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLfloat
)));
7467 if (ctx
->ExecuteFlag
) {
7468 CALL_UniformMatrix2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7472 static void GLAPIENTRY
7473 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7476 GET_CURRENT_CONTEXT(ctx
);
7478 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7479 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 3 + POINTER_DWORDS
);
7484 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLfloat
)));
7486 if (ctx
->ExecuteFlag
) {
7487 CALL_UniformMatrix3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7491 static void GLAPIENTRY
7492 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
7495 GET_CURRENT_CONTEXT(ctx
);
7497 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7498 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 3 + POINTER_DWORDS
);
7503 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLfloat
)));
7505 if (ctx
->ExecuteFlag
) {
7506 CALL_UniformMatrix4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7511 static void GLAPIENTRY
7512 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7515 GET_CURRENT_CONTEXT(ctx
);
7517 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7518 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 3 + POINTER_DWORDS
);
7523 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLfloat
)));
7525 if (ctx
->ExecuteFlag
) {
7526 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7530 static void GLAPIENTRY
7531 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7534 GET_CURRENT_CONTEXT(ctx
);
7536 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7537 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 3 + POINTER_DWORDS
);
7542 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLfloat
)));
7544 if (ctx
->ExecuteFlag
) {
7545 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7550 static void GLAPIENTRY
7551 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7554 GET_CURRENT_CONTEXT(ctx
);
7556 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7557 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 3 + POINTER_DWORDS
);
7562 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLfloat
)));
7564 if (ctx
->ExecuteFlag
) {
7565 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7569 static void GLAPIENTRY
7570 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
7573 GET_CURRENT_CONTEXT(ctx
);
7575 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7576 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 3 + POINTER_DWORDS
);
7581 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLfloat
)));
7583 if (ctx
->ExecuteFlag
) {
7584 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7589 static void GLAPIENTRY
7590 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
7593 GET_CURRENT_CONTEXT(ctx
);
7595 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7596 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 3 + POINTER_DWORDS
);
7601 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLfloat
)));
7603 if (ctx
->ExecuteFlag
) {
7604 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7608 static void GLAPIENTRY
7609 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
7612 GET_CURRENT_CONTEXT(ctx
);
7614 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7615 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 3 + POINTER_DWORDS
);
7620 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLfloat
)));
7622 if (ctx
->ExecuteFlag
) {
7623 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
7628 static void GLAPIENTRY
7629 save_UniformMatrix2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7632 GET_CURRENT_CONTEXT(ctx
);
7634 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7635 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22D
, 3 + POINTER_DWORDS
);
7640 save_pointer(&n
[4], memdup(m
, count
* 2 * 2 * sizeof(GLdouble
)));
7642 if (ctx
->ExecuteFlag
) {
7643 CALL_UniformMatrix2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7647 static void GLAPIENTRY
7648 save_UniformMatrix3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7651 GET_CURRENT_CONTEXT(ctx
);
7653 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7654 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33D
, 3 + POINTER_DWORDS
);
7659 save_pointer(&n
[4], memdup(m
, count
* 3 * 3 * sizeof(GLdouble
)));
7661 if (ctx
->ExecuteFlag
) {
7662 CALL_UniformMatrix3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7666 static void GLAPIENTRY
7667 save_UniformMatrix4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7670 GET_CURRENT_CONTEXT(ctx
);
7672 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7673 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44D
, 3 + POINTER_DWORDS
);
7678 save_pointer(&n
[4], memdup(m
, count
* 4 * 4 * sizeof(GLdouble
)));
7680 if (ctx
->ExecuteFlag
) {
7681 CALL_UniformMatrix4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7686 static void GLAPIENTRY
7687 save_UniformMatrix2x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7690 GET_CURRENT_CONTEXT(ctx
);
7692 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7693 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23D
, 3 + POINTER_DWORDS
);
7698 save_pointer(&n
[4], memdup(m
, count
* 2 * 3 * sizeof(GLdouble
)));
7700 if (ctx
->ExecuteFlag
) {
7701 CALL_UniformMatrix2x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7706 static void GLAPIENTRY
7707 save_UniformMatrix3x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7710 GET_CURRENT_CONTEXT(ctx
);
7712 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7713 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32D
, 3 + POINTER_DWORDS
);
7718 save_pointer(&n
[4], memdup(m
, count
* 3 * 2 * sizeof(GLdouble
)));
7720 if (ctx
->ExecuteFlag
) {
7721 CALL_UniformMatrix3x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7726 static void GLAPIENTRY
7727 save_UniformMatrix2x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7730 GET_CURRENT_CONTEXT(ctx
);
7732 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7733 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24D
, 3 + POINTER_DWORDS
);
7738 save_pointer(&n
[4], memdup(m
, count
* 2 * 4 * sizeof(GLdouble
)));
7740 if (ctx
->ExecuteFlag
) {
7741 CALL_UniformMatrix2x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7745 static void GLAPIENTRY
7746 save_UniformMatrix4x2dv(GLint location
, GLsizei count
, GLboolean transpose
,
7749 GET_CURRENT_CONTEXT(ctx
);
7751 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7752 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42D
, 3 + POINTER_DWORDS
);
7757 save_pointer(&n
[4], memdup(m
, count
* 4 * 2 * sizeof(GLdouble
)));
7759 if (ctx
->ExecuteFlag
) {
7760 CALL_UniformMatrix4x2dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7765 static void GLAPIENTRY
7766 save_UniformMatrix3x4dv(GLint location
, GLsizei count
, GLboolean transpose
,
7769 GET_CURRENT_CONTEXT(ctx
);
7771 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7772 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34D
, 3 + POINTER_DWORDS
);
7777 save_pointer(&n
[4], memdup(m
, count
* 3 * 4 * sizeof(GLdouble
)));
7779 if (ctx
->ExecuteFlag
) {
7780 CALL_UniformMatrix3x4dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7785 static void GLAPIENTRY
7786 save_UniformMatrix4x3dv(GLint location
, GLsizei count
, GLboolean transpose
,
7789 GET_CURRENT_CONTEXT(ctx
);
7791 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7792 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43D
, 3 + POINTER_DWORDS
);
7797 save_pointer(&n
[4], memdup(m
, count
* 4 * 3 * sizeof(GLdouble
)));
7799 if (ctx
->ExecuteFlag
) {
7800 CALL_UniformMatrix4x3dv(ctx
->Exec
, (location
, count
, transpose
, m
));
7805 static void GLAPIENTRY
7806 save_UseProgramStages(GLuint pipeline
, GLbitfield stages
, GLuint program
)
7808 GET_CURRENT_CONTEXT(ctx
);
7810 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7811 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM_STAGES
, 3);
7817 if (ctx
->ExecuteFlag
) {
7818 CALL_UseProgramStages(ctx
->Exec
, (pipeline
, stages
, program
));
7822 static void GLAPIENTRY
7823 save_ProgramUniform1f(GLuint program
, GLint location
, GLfloat x
)
7825 GET_CURRENT_CONTEXT(ctx
);
7827 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7828 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1F
, 3);
7834 if (ctx
->ExecuteFlag
) {
7835 CALL_ProgramUniform1f(ctx
->Exec
, (program
, location
, x
));
7839 static void GLAPIENTRY
7840 save_ProgramUniform2f(GLuint program
, GLint location
, GLfloat x
, GLfloat y
)
7842 GET_CURRENT_CONTEXT(ctx
);
7844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7845 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2F
, 4);
7852 if (ctx
->ExecuteFlag
) {
7853 CALL_ProgramUniform2f(ctx
->Exec
, (program
, location
, x
, y
));
7857 static void GLAPIENTRY
7858 save_ProgramUniform3f(GLuint program
, GLint location
,
7859 GLfloat x
, GLfloat y
, GLfloat z
)
7861 GET_CURRENT_CONTEXT(ctx
);
7863 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7864 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3F
, 5);
7872 if (ctx
->ExecuteFlag
) {
7873 CALL_ProgramUniform3f(ctx
->Exec
, (program
, location
, x
, y
, z
));
7877 static void GLAPIENTRY
7878 save_ProgramUniform4f(GLuint program
, GLint location
,
7879 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
7881 GET_CURRENT_CONTEXT(ctx
);
7883 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7884 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4F
, 6);
7893 if (ctx
->ExecuteFlag
) {
7894 CALL_ProgramUniform4f(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
7898 static void GLAPIENTRY
7899 save_ProgramUniform1fv(GLuint program
, GLint location
, GLsizei count
,
7902 GET_CURRENT_CONTEXT(ctx
);
7904 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7905 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1FV
, 3 + POINTER_DWORDS
);
7910 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLfloat
)));
7912 if (ctx
->ExecuteFlag
) {
7913 CALL_ProgramUniform1fv(ctx
->Exec
, (program
, location
, count
, v
));
7917 static void GLAPIENTRY
7918 save_ProgramUniform2fv(GLuint program
, GLint location
, GLsizei count
,
7921 GET_CURRENT_CONTEXT(ctx
);
7923 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7924 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2FV
, 3 + POINTER_DWORDS
);
7929 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLfloat
)));
7931 if (ctx
->ExecuteFlag
) {
7932 CALL_ProgramUniform2fv(ctx
->Exec
, (program
, location
, count
, v
));
7936 static void GLAPIENTRY
7937 save_ProgramUniform3fv(GLuint program
, GLint location
, GLsizei count
,
7940 GET_CURRENT_CONTEXT(ctx
);
7942 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7943 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3FV
, 3 + POINTER_DWORDS
);
7948 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLfloat
)));
7950 if (ctx
->ExecuteFlag
) {
7951 CALL_ProgramUniform3fv(ctx
->Exec
, (program
, location
, count
, v
));
7955 static void GLAPIENTRY
7956 save_ProgramUniform4fv(GLuint program
, GLint location
, GLsizei count
,
7959 GET_CURRENT_CONTEXT(ctx
);
7961 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7962 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4FV
, 3 + POINTER_DWORDS
);
7967 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLfloat
)));
7969 if (ctx
->ExecuteFlag
) {
7970 CALL_ProgramUniform4fv(ctx
->Exec
, (program
, location
, count
, v
));
7974 static void GLAPIENTRY
7975 save_ProgramUniform1d(GLuint program
, GLint location
, GLdouble x
)
7977 GET_CURRENT_CONTEXT(ctx
);
7979 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7980 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1D
, 4);
7984 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
7986 if (ctx
->ExecuteFlag
) {
7987 CALL_ProgramUniform1d(ctx
->Exec
, (program
, location
, x
));
7991 static void GLAPIENTRY
7992 save_ProgramUniform2d(GLuint program
, GLint location
, GLdouble x
, GLdouble y
)
7994 GET_CURRENT_CONTEXT(ctx
);
7996 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
7997 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2D
, 6);
8001 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8002 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8004 if (ctx
->ExecuteFlag
) {
8005 CALL_ProgramUniform2d(ctx
->Exec
, (program
, location
, x
, y
));
8009 static void GLAPIENTRY
8010 save_ProgramUniform3d(GLuint program
, GLint location
,
8011 GLdouble x
, GLdouble y
, GLdouble z
)
8013 GET_CURRENT_CONTEXT(ctx
);
8015 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8016 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3D
, 8);
8020 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8021 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8022 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8024 if (ctx
->ExecuteFlag
) {
8025 CALL_ProgramUniform3d(ctx
->Exec
, (program
, location
, x
, y
, z
));
8029 static void GLAPIENTRY
8030 save_ProgramUniform4d(GLuint program
, GLint location
,
8031 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
8033 GET_CURRENT_CONTEXT(ctx
);
8035 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8036 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4D
, 10);
8040 ASSIGN_DOUBLE_TO_NODES(n
, 3, x
);
8041 ASSIGN_DOUBLE_TO_NODES(n
, 5, y
);
8042 ASSIGN_DOUBLE_TO_NODES(n
, 7, z
);
8043 ASSIGN_DOUBLE_TO_NODES(n
, 9, w
);
8045 if (ctx
->ExecuteFlag
) {
8046 CALL_ProgramUniform4d(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8050 static void GLAPIENTRY
8051 save_ProgramUniform1dv(GLuint program
, GLint location
, GLsizei count
,
8054 GET_CURRENT_CONTEXT(ctx
);
8056 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8057 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1DV
, 3 + POINTER_DWORDS
);
8062 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLdouble
)));
8064 if (ctx
->ExecuteFlag
) {
8065 CALL_ProgramUniform1dv(ctx
->Exec
, (program
, location
, count
, v
));
8069 static void GLAPIENTRY
8070 save_ProgramUniform2dv(GLuint program
, GLint location
, GLsizei count
,
8073 GET_CURRENT_CONTEXT(ctx
);
8075 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8076 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2DV
, 3 + POINTER_DWORDS
);
8081 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLdouble
)));
8083 if (ctx
->ExecuteFlag
) {
8084 CALL_ProgramUniform2dv(ctx
->Exec
, (program
, location
, count
, v
));
8088 static void GLAPIENTRY
8089 save_ProgramUniform3dv(GLuint program
, GLint location
, GLsizei count
,
8092 GET_CURRENT_CONTEXT(ctx
);
8094 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8095 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3DV
, 3 + POINTER_DWORDS
);
8100 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLdouble
)));
8102 if (ctx
->ExecuteFlag
) {
8103 CALL_ProgramUniform3dv(ctx
->Exec
, (program
, location
, count
, v
));
8107 static void GLAPIENTRY
8108 save_ProgramUniform4dv(GLuint program
, GLint location
, GLsizei count
,
8111 GET_CURRENT_CONTEXT(ctx
);
8113 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8114 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4DV
, 3 + POINTER_DWORDS
);
8119 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLdouble
)));
8121 if (ctx
->ExecuteFlag
) {
8122 CALL_ProgramUniform4dv(ctx
->Exec
, (program
, location
, count
, v
));
8126 static void GLAPIENTRY
8127 save_ProgramUniform1i(GLuint program
, GLint location
, GLint x
)
8129 GET_CURRENT_CONTEXT(ctx
);
8131 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8132 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1I
, 3);
8138 if (ctx
->ExecuteFlag
) {
8139 CALL_ProgramUniform1i(ctx
->Exec
, (program
, location
, x
));
8143 static void GLAPIENTRY
8144 save_ProgramUniform2i(GLuint program
, GLint location
, GLint x
, GLint y
)
8146 GET_CURRENT_CONTEXT(ctx
);
8148 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8149 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2I
, 4);
8156 if (ctx
->ExecuteFlag
) {
8157 CALL_ProgramUniform2i(ctx
->Exec
, (program
, location
, x
, y
));
8161 static void GLAPIENTRY
8162 save_ProgramUniform3i(GLuint program
, GLint location
,
8163 GLint x
, GLint y
, GLint z
)
8165 GET_CURRENT_CONTEXT(ctx
);
8167 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8168 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3I
, 5);
8176 if (ctx
->ExecuteFlag
) {
8177 CALL_ProgramUniform3i(ctx
->Exec
, (program
, location
, x
, y
, z
));
8181 static void GLAPIENTRY
8182 save_ProgramUniform4i(GLuint program
, GLint location
,
8183 GLint x
, GLint y
, GLint z
, GLint w
)
8185 GET_CURRENT_CONTEXT(ctx
);
8187 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8188 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4I
, 6);
8197 if (ctx
->ExecuteFlag
) {
8198 CALL_ProgramUniform4i(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8202 static void GLAPIENTRY
8203 save_ProgramUniform1iv(GLuint program
, GLint location
, GLsizei count
,
8206 GET_CURRENT_CONTEXT(ctx
);
8208 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8209 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1IV
, 3 + POINTER_DWORDS
);
8214 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLint
)));
8216 if (ctx
->ExecuteFlag
) {
8217 CALL_ProgramUniform1iv(ctx
->Exec
, (program
, location
, count
, v
));
8221 static void GLAPIENTRY
8222 save_ProgramUniform2iv(GLuint program
, GLint location
, GLsizei count
,
8225 GET_CURRENT_CONTEXT(ctx
);
8227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8228 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2IV
, 3 + POINTER_DWORDS
);
8233 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLint
)));
8235 if (ctx
->ExecuteFlag
) {
8236 CALL_ProgramUniform2iv(ctx
->Exec
, (program
, location
, count
, v
));
8240 static void GLAPIENTRY
8241 save_ProgramUniform3iv(GLuint program
, GLint location
, GLsizei count
,
8244 GET_CURRENT_CONTEXT(ctx
);
8246 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8247 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3IV
, 3 + POINTER_DWORDS
);
8252 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLint
)));
8254 if (ctx
->ExecuteFlag
) {
8255 CALL_ProgramUniform3iv(ctx
->Exec
, (program
, location
, count
, v
));
8259 static void GLAPIENTRY
8260 save_ProgramUniform4iv(GLuint program
, GLint location
, GLsizei count
,
8263 GET_CURRENT_CONTEXT(ctx
);
8265 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8266 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4IV
, 3 + POINTER_DWORDS
);
8271 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLint
)));
8273 if (ctx
->ExecuteFlag
) {
8274 CALL_ProgramUniform4iv(ctx
->Exec
, (program
, location
, count
, v
));
8278 static void GLAPIENTRY
8279 save_ProgramUniform1ui(GLuint program
, GLint location
, GLuint x
)
8281 GET_CURRENT_CONTEXT(ctx
);
8283 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8284 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UI
, 3);
8290 if (ctx
->ExecuteFlag
) {
8291 CALL_ProgramUniform1ui(ctx
->Exec
, (program
, location
, x
));
8295 static void GLAPIENTRY
8296 save_ProgramUniform2ui(GLuint program
, GLint location
, GLuint x
, GLuint y
)
8298 GET_CURRENT_CONTEXT(ctx
);
8300 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8301 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UI
, 4);
8308 if (ctx
->ExecuteFlag
) {
8309 CALL_ProgramUniform2ui(ctx
->Exec
, (program
, location
, x
, y
));
8313 static void GLAPIENTRY
8314 save_ProgramUniform3ui(GLuint program
, GLint location
,
8315 GLuint x
, GLuint y
, GLuint z
)
8317 GET_CURRENT_CONTEXT(ctx
);
8319 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8320 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UI
, 5);
8328 if (ctx
->ExecuteFlag
) {
8329 CALL_ProgramUniform3ui(ctx
->Exec
, (program
, location
, x
, y
, z
));
8333 static void GLAPIENTRY
8334 save_ProgramUniform4ui(GLuint program
, GLint location
,
8335 GLuint x
, GLuint y
, GLuint z
, GLuint w
)
8337 GET_CURRENT_CONTEXT(ctx
);
8339 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8340 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UI
, 6);
8349 if (ctx
->ExecuteFlag
) {
8350 CALL_ProgramUniform4ui(ctx
->Exec
, (program
, location
, x
, y
, z
, w
));
8354 static void GLAPIENTRY
8355 save_ProgramUniform1uiv(GLuint program
, GLint location
, GLsizei count
,
8358 GET_CURRENT_CONTEXT(ctx
);
8360 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8361 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_1UIV
, 3 + POINTER_DWORDS
);
8366 save_pointer(&n
[4], memdup(v
, count
* 1 * sizeof(GLuint
)));
8368 if (ctx
->ExecuteFlag
) {
8369 CALL_ProgramUniform1uiv(ctx
->Exec
, (program
, location
, count
, v
));
8373 static void GLAPIENTRY
8374 save_ProgramUniform2uiv(GLuint program
, GLint location
, GLsizei count
,
8377 GET_CURRENT_CONTEXT(ctx
);
8379 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8380 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_2UIV
, 3 + POINTER_DWORDS
);
8385 save_pointer(&n
[4], memdup(v
, count
* 2 * sizeof(GLuint
)));
8387 if (ctx
->ExecuteFlag
) {
8388 CALL_ProgramUniform2uiv(ctx
->Exec
, (program
, location
, count
, v
));
8392 static void GLAPIENTRY
8393 save_ProgramUniform3uiv(GLuint program
, GLint location
, GLsizei count
,
8396 GET_CURRENT_CONTEXT(ctx
);
8398 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8399 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_3UIV
, 3 + POINTER_DWORDS
);
8404 save_pointer(&n
[4], memdup(v
, count
* 3 * sizeof(GLuint
)));
8406 if (ctx
->ExecuteFlag
) {
8407 CALL_ProgramUniform3uiv(ctx
->Exec
, (program
, location
, count
, v
));
8411 static void GLAPIENTRY
8412 save_ProgramUniform4uiv(GLuint program
, GLint location
, GLsizei count
,
8415 GET_CURRENT_CONTEXT(ctx
);
8417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8418 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_4UIV
, 3 + POINTER_DWORDS
);
8423 save_pointer(&n
[4], memdup(v
, count
* 4 * sizeof(GLuint
)));
8425 if (ctx
->ExecuteFlag
) {
8426 CALL_ProgramUniform4uiv(ctx
->Exec
, (program
, location
, count
, v
));
8430 static void GLAPIENTRY
8431 save_ProgramUniformMatrix2fv(GLuint program
, GLint location
, GLsizei count
,
8432 GLboolean transpose
, const GLfloat
*v
)
8434 GET_CURRENT_CONTEXT(ctx
);
8436 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8437 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22F
,
8438 4 + POINTER_DWORDS
);
8444 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLfloat
)));
8446 if (ctx
->ExecuteFlag
) {
8447 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
8448 (program
, location
, count
, transpose
, v
));
8452 static void GLAPIENTRY
8453 save_ProgramUniformMatrix2x3fv(GLuint program
, GLint location
, GLsizei count
,
8454 GLboolean transpose
, const GLfloat
*v
)
8456 GET_CURRENT_CONTEXT(ctx
);
8458 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8459 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23F
,
8460 4 + POINTER_DWORDS
);
8466 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLfloat
)));
8468 if (ctx
->ExecuteFlag
) {
8469 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
8470 (program
, location
, count
, transpose
, v
));
8474 static void GLAPIENTRY
8475 save_ProgramUniformMatrix2x4fv(GLuint program
, GLint location
, GLsizei count
,
8476 GLboolean transpose
, const GLfloat
*v
)
8478 GET_CURRENT_CONTEXT(ctx
);
8480 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8481 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24F
,
8482 4 + POINTER_DWORDS
);
8488 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLfloat
)));
8490 if (ctx
->ExecuteFlag
) {
8491 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
8492 (program
, location
, count
, transpose
, v
));
8496 static void GLAPIENTRY
8497 save_ProgramUniformMatrix3x2fv(GLuint program
, GLint location
, GLsizei count
,
8498 GLboolean transpose
, const GLfloat
*v
)
8500 GET_CURRENT_CONTEXT(ctx
);
8502 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8503 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32F
,
8504 4 + POINTER_DWORDS
);
8510 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLfloat
)));
8512 if (ctx
->ExecuteFlag
) {
8513 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
8514 (program
, location
, count
, transpose
, v
));
8518 static void GLAPIENTRY
8519 save_ProgramUniformMatrix3fv(GLuint program
, GLint location
, GLsizei count
,
8520 GLboolean transpose
, const GLfloat
*v
)
8522 GET_CURRENT_CONTEXT(ctx
);
8524 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8525 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33F
,
8526 4 + POINTER_DWORDS
);
8532 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLfloat
)));
8534 if (ctx
->ExecuteFlag
) {
8535 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
8536 (program
, location
, count
, transpose
, v
));
8540 static void GLAPIENTRY
8541 save_ProgramUniformMatrix3x4fv(GLuint program
, GLint location
, GLsizei count
,
8542 GLboolean transpose
, const GLfloat
*v
)
8544 GET_CURRENT_CONTEXT(ctx
);
8546 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8547 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34F
,
8548 4 + POINTER_DWORDS
);
8554 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLfloat
)));
8556 if (ctx
->ExecuteFlag
) {
8557 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
8558 (program
, location
, count
, transpose
, v
));
8562 static void GLAPIENTRY
8563 save_ProgramUniformMatrix4x2fv(GLuint program
, GLint location
, GLsizei count
,
8564 GLboolean transpose
, const GLfloat
*v
)
8566 GET_CURRENT_CONTEXT(ctx
);
8568 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8569 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42F
,
8570 4 + POINTER_DWORDS
);
8576 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLfloat
)));
8578 if (ctx
->ExecuteFlag
) {
8579 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
8580 (program
, location
, count
, transpose
, v
));
8584 static void GLAPIENTRY
8585 save_ProgramUniformMatrix4x3fv(GLuint program
, GLint location
, GLsizei count
,
8586 GLboolean transpose
, const GLfloat
*v
)
8588 GET_CURRENT_CONTEXT(ctx
);
8590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8591 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43F
,
8592 4 + POINTER_DWORDS
);
8598 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLfloat
)));
8600 if (ctx
->ExecuteFlag
) {
8601 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
8602 (program
, location
, count
, transpose
, v
));
8606 static void GLAPIENTRY
8607 save_ProgramUniformMatrix4fv(GLuint program
, GLint location
, GLsizei count
,
8608 GLboolean transpose
, const GLfloat
*v
)
8610 GET_CURRENT_CONTEXT(ctx
);
8612 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8613 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44F
,
8614 4 + POINTER_DWORDS
);
8620 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLfloat
)));
8622 if (ctx
->ExecuteFlag
) {
8623 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
8624 (program
, location
, count
, transpose
, v
));
8628 static void GLAPIENTRY
8629 save_ProgramUniformMatrix2dv(GLuint program
, GLint location
, GLsizei count
,
8630 GLboolean transpose
, const GLdouble
*v
)
8632 GET_CURRENT_CONTEXT(ctx
);
8634 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8635 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX22D
,
8636 4 + POINTER_DWORDS
);
8642 save_pointer(&n
[5], memdup(v
, count
* 2 * 2 * sizeof(GLdouble
)));
8644 if (ctx
->ExecuteFlag
) {
8645 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
8646 (program
, location
, count
, transpose
, v
));
8650 static void GLAPIENTRY
8651 save_ProgramUniformMatrix2x3dv(GLuint program
, GLint location
, GLsizei count
,
8652 GLboolean transpose
, const GLdouble
*v
)
8654 GET_CURRENT_CONTEXT(ctx
);
8656 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8657 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX23D
,
8658 4 + POINTER_DWORDS
);
8664 save_pointer(&n
[5], memdup(v
, count
* 2 * 3 * sizeof(GLdouble
)));
8666 if (ctx
->ExecuteFlag
) {
8667 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
8668 (program
, location
, count
, transpose
, v
));
8672 static void GLAPIENTRY
8673 save_ProgramUniformMatrix2x4dv(GLuint program
, GLint location
, GLsizei count
,
8674 GLboolean transpose
, const GLdouble
*v
)
8676 GET_CURRENT_CONTEXT(ctx
);
8678 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8679 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX24D
,
8680 4 + POINTER_DWORDS
);
8686 save_pointer(&n
[5], memdup(v
, count
* 2 * 4 * sizeof(GLdouble
)));
8688 if (ctx
->ExecuteFlag
) {
8689 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
8690 (program
, location
, count
, transpose
, v
));
8694 static void GLAPIENTRY
8695 save_ProgramUniformMatrix3x2dv(GLuint program
, GLint location
, GLsizei count
,
8696 GLboolean transpose
, const GLdouble
*v
)
8698 GET_CURRENT_CONTEXT(ctx
);
8700 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8701 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX32D
,
8702 4 + POINTER_DWORDS
);
8708 save_pointer(&n
[5], memdup(v
, count
* 3 * 2 * sizeof(GLdouble
)));
8710 if (ctx
->ExecuteFlag
) {
8711 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
8712 (program
, location
, count
, transpose
, v
));
8716 static void GLAPIENTRY
8717 save_ProgramUniformMatrix3dv(GLuint program
, GLint location
, GLsizei count
,
8718 GLboolean transpose
, const GLdouble
*v
)
8720 GET_CURRENT_CONTEXT(ctx
);
8722 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8723 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX33D
,
8724 4 + POINTER_DWORDS
);
8730 save_pointer(&n
[5], memdup(v
, count
* 3 * 3 * sizeof(GLdouble
)));
8732 if (ctx
->ExecuteFlag
) {
8733 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
8734 (program
, location
, count
, transpose
, v
));
8738 static void GLAPIENTRY
8739 save_ProgramUniformMatrix3x4dv(GLuint program
, GLint location
, GLsizei count
,
8740 GLboolean transpose
, const GLdouble
*v
)
8742 GET_CURRENT_CONTEXT(ctx
);
8744 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8745 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX34D
,
8746 4 + POINTER_DWORDS
);
8752 save_pointer(&n
[5], memdup(v
, count
* 3 * 4 * sizeof(GLdouble
)));
8754 if (ctx
->ExecuteFlag
) {
8755 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
8756 (program
, location
, count
, transpose
, v
));
8760 static void GLAPIENTRY
8761 save_ProgramUniformMatrix4x2dv(GLuint program
, GLint location
, GLsizei count
,
8762 GLboolean transpose
, const GLdouble
*v
)
8764 GET_CURRENT_CONTEXT(ctx
);
8766 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8767 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX42D
,
8768 4 + POINTER_DWORDS
);
8774 save_pointer(&n
[5], memdup(v
, count
* 4 * 2 * sizeof(GLdouble
)));
8776 if (ctx
->ExecuteFlag
) {
8777 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
8778 (program
, location
, count
, transpose
, v
));
8782 static void GLAPIENTRY
8783 save_ProgramUniformMatrix4x3dv(GLuint program
, GLint location
, GLsizei count
,
8784 GLboolean transpose
, const GLdouble
*v
)
8786 GET_CURRENT_CONTEXT(ctx
);
8788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8789 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX43D
,
8790 4 + POINTER_DWORDS
);
8796 save_pointer(&n
[5], memdup(v
, count
* 4 * 3 * sizeof(GLdouble
)));
8798 if (ctx
->ExecuteFlag
) {
8799 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
8800 (program
, location
, count
, transpose
, v
));
8804 static void GLAPIENTRY
8805 save_ProgramUniformMatrix4dv(GLuint program
, GLint location
, GLsizei count
,
8806 GLboolean transpose
, const GLdouble
*v
)
8808 GET_CURRENT_CONTEXT(ctx
);
8810 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8811 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_UNIFORM_MATRIX44D
,
8812 4 + POINTER_DWORDS
);
8818 save_pointer(&n
[5], memdup(v
, count
* 4 * 4 * sizeof(GLdouble
)));
8820 if (ctx
->ExecuteFlag
) {
8821 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
8822 (program
, location
, count
, transpose
, v
));
8826 static void GLAPIENTRY
8827 save_ClipControl(GLenum origin
, GLenum depth
)
8829 GET_CURRENT_CONTEXT(ctx
);
8831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8832 n
= alloc_instruction(ctx
, OPCODE_CLIP_CONTROL
, 2);
8837 if (ctx
->ExecuteFlag
) {
8838 CALL_ClipControl(ctx
->Exec
, (origin
, depth
));
8842 static void GLAPIENTRY
8843 save_ClampColorARB(GLenum target
, GLenum clamp
)
8845 GET_CURRENT_CONTEXT(ctx
);
8847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8848 n
= alloc_instruction(ctx
, OPCODE_CLAMP_COLOR
, 2);
8853 if (ctx
->ExecuteFlag
) {
8854 CALL_ClampColor(ctx
->Exec
, (target
, clamp
));
8858 /** GL_EXT_texture_integer */
8859 static void GLAPIENTRY
8860 save_ClearColorIi(GLint red
, GLint green
, GLint blue
, GLint alpha
)
8862 GET_CURRENT_CONTEXT(ctx
);
8864 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8865 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_I
, 4);
8872 if (ctx
->ExecuteFlag
) {
8873 CALL_ClearColorIiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8877 /** GL_EXT_texture_integer */
8878 static void GLAPIENTRY
8879 save_ClearColorIui(GLuint red
, GLuint green
, GLuint blue
, GLuint alpha
)
8881 GET_CURRENT_CONTEXT(ctx
);
8883 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8884 n
= alloc_instruction(ctx
, OPCODE_CLEARCOLOR_UI
, 4);
8891 if (ctx
->ExecuteFlag
) {
8892 CALL_ClearColorIuiEXT(ctx
->Exec
, (red
, green
, blue
, alpha
));
8896 /** GL_EXT_texture_integer */
8897 static void GLAPIENTRY
8898 save_TexParameterIiv(GLenum target
, GLenum pname
, const GLint
*params
)
8900 GET_CURRENT_CONTEXT(ctx
);
8902 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8903 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_I
, 6);
8912 if (ctx
->ExecuteFlag
) {
8913 CALL_TexParameterIiv(ctx
->Exec
, (target
, pname
, params
));
8917 /** GL_EXT_texture_integer */
8918 static void GLAPIENTRY
8919 save_TexParameterIuiv(GLenum target
, GLenum pname
, const GLuint
*params
)
8921 GET_CURRENT_CONTEXT(ctx
);
8923 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8924 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER_UI
, 6);
8928 n
[3].ui
= params
[0];
8929 n
[4].ui
= params
[1];
8930 n
[5].ui
= params
[2];
8931 n
[6].ui
= params
[3];
8933 if (ctx
->ExecuteFlag
) {
8934 CALL_TexParameterIuiv(ctx
->Exec
, (target
, pname
, params
));
8938 /* GL_ARB_instanced_arrays */
8939 static void GLAPIENTRY
8940 save_VertexAttribDivisor(GLuint index
, GLuint divisor
)
8942 GET_CURRENT_CONTEXT(ctx
);
8944 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8945 n
= alloc_instruction(ctx
, OPCODE_VERTEX_ATTRIB_DIVISOR
, 2);
8950 if (ctx
->ExecuteFlag
) {
8951 CALL_VertexAttribDivisor(ctx
->Exec
, (index
, divisor
));
8956 /* GL_NV_texture_barrier */
8957 static void GLAPIENTRY
8958 save_TextureBarrierNV(void)
8960 GET_CURRENT_CONTEXT(ctx
);
8961 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8962 alloc_instruction(ctx
, OPCODE_TEXTURE_BARRIER_NV
, 0);
8963 if (ctx
->ExecuteFlag
) {
8964 CALL_TextureBarrierNV(ctx
->Exec
, ());
8969 /* GL_ARB_sampler_objects */
8970 static void GLAPIENTRY
8971 save_BindSampler(GLuint unit
, GLuint sampler
)
8974 GET_CURRENT_CONTEXT(ctx
);
8975 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8976 n
= alloc_instruction(ctx
, OPCODE_BIND_SAMPLER
, 2);
8981 if (ctx
->ExecuteFlag
) {
8982 CALL_BindSampler(ctx
->Exec
, (unit
, sampler
));
8986 static void GLAPIENTRY
8987 save_SamplerParameteriv(GLuint sampler
, GLenum pname
, const GLint
*params
)
8990 GET_CURRENT_CONTEXT(ctx
);
8991 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
8992 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIV
, 6);
8997 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9003 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9006 if (ctx
->ExecuteFlag
) {
9007 CALL_SamplerParameteriv(ctx
->Exec
, (sampler
, pname
, params
));
9011 static void GLAPIENTRY
9012 save_SamplerParameteri(GLuint sampler
, GLenum pname
, GLint param
)
9016 parray
[1] = parray
[2] = parray
[3] = 0;
9017 save_SamplerParameteriv(sampler
, pname
, parray
);
9020 static void GLAPIENTRY
9021 save_SamplerParameterfv(GLuint sampler
, GLenum pname
, const GLfloat
*params
)
9024 GET_CURRENT_CONTEXT(ctx
);
9025 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9026 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERFV
, 6);
9031 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9037 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
9040 if (ctx
->ExecuteFlag
) {
9041 CALL_SamplerParameterfv(ctx
->Exec
, (sampler
, pname
, params
));
9045 static void GLAPIENTRY
9046 save_SamplerParameterf(GLuint sampler
, GLenum pname
, GLfloat param
)
9050 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9051 save_SamplerParameterfv(sampler
, pname
, parray
);
9054 static void GLAPIENTRY
9055 save_SamplerParameterIiv(GLuint sampler
, GLenum pname
, const GLint
*params
)
9058 GET_CURRENT_CONTEXT(ctx
);
9059 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9060 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERIIV
, 6);
9065 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9071 n
[4].i
= n
[5].i
= n
[6].i
= 0;
9074 if (ctx
->ExecuteFlag
) {
9075 CALL_SamplerParameterIiv(ctx
->Exec
, (sampler
, pname
, params
));
9079 static void GLAPIENTRY
9080 save_SamplerParameterIuiv(GLuint sampler
, GLenum pname
, const GLuint
*params
)
9083 GET_CURRENT_CONTEXT(ctx
);
9084 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9085 n
= alloc_instruction(ctx
, OPCODE_SAMPLER_PARAMETERUIV
, 6);
9089 n
[3].ui
= params
[0];
9090 if (pname
== GL_TEXTURE_BORDER_COLOR
) {
9091 n
[4].ui
= params
[1];
9092 n
[5].ui
= params
[2];
9093 n
[6].ui
= params
[3];
9096 n
[4].ui
= n
[5].ui
= n
[6].ui
= 0;
9099 if (ctx
->ExecuteFlag
) {
9100 CALL_SamplerParameterIuiv(ctx
->Exec
, (sampler
, pname
, params
));
9104 static void GLAPIENTRY
9105 save_WaitSync(GLsync sync
, GLbitfield flags
, GLuint64 timeout
)
9108 GET_CURRENT_CONTEXT(ctx
);
9109 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9110 n
= alloc_instruction(ctx
, OPCODE_WAIT_SYNC
, 4);
9112 union uint64_pair p
;
9115 n
[2].ui
= p
.uint32
[0];
9116 n
[3].ui
= p
.uint32
[1];
9117 save_pointer(&n
[4], sync
);
9119 if (ctx
->ExecuteFlag
) {
9120 CALL_WaitSync(ctx
->Exec
, (sync
, flags
, timeout
));
9125 /** GL_NV_conditional_render */
9126 static void GLAPIENTRY
9127 save_BeginConditionalRender(GLuint queryId
, GLenum mode
)
9129 GET_CURRENT_CONTEXT(ctx
);
9131 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9132 n
= alloc_instruction(ctx
, OPCODE_BEGIN_CONDITIONAL_RENDER
, 2);
9137 if (ctx
->ExecuteFlag
) {
9138 CALL_BeginConditionalRender(ctx
->Exec
, (queryId
, mode
));
9142 static void GLAPIENTRY
9143 save_EndConditionalRender(void)
9145 GET_CURRENT_CONTEXT(ctx
);
9146 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9147 alloc_instruction(ctx
, OPCODE_END_CONDITIONAL_RENDER
, 0);
9148 if (ctx
->ExecuteFlag
) {
9149 CALL_EndConditionalRender(ctx
->Exec
, ());
9153 static void GLAPIENTRY
9154 save_UniformBlockBinding(GLuint prog
, GLuint index
, GLuint binding
)
9156 GET_CURRENT_CONTEXT(ctx
);
9158 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9159 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_BLOCK_BINDING
, 3);
9165 if (ctx
->ExecuteFlag
) {
9166 CALL_UniformBlockBinding(ctx
->Exec
, (prog
, index
, binding
));
9170 static void GLAPIENTRY
9171 save_UniformSubroutinesuiv(GLenum shadertype
, GLsizei count
,
9172 const GLuint
*indices
)
9174 GET_CURRENT_CONTEXT(ctx
);
9176 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9177 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_SUBROUTINES
, 2 + POINTER_DWORDS
);
9179 GLint
*indices_copy
= NULL
;
9182 indices_copy
= memdup(indices
, sizeof(GLuint
) * 4 * count
);
9183 n
[1].e
= shadertype
;
9185 save_pointer(&n
[3], indices_copy
);
9187 if (ctx
->ExecuteFlag
) {
9188 CALL_UniformSubroutinesuiv(ctx
->Exec
, (shadertype
, count
, indices
));
9192 /** GL_EXT_window_rectangles */
9193 static void GLAPIENTRY
9194 save_WindowRectanglesEXT(GLenum mode
, GLsizei count
, const GLint
*box
)
9196 GET_CURRENT_CONTEXT(ctx
);
9198 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9199 n
= alloc_instruction(ctx
, OPCODE_WINDOW_RECTANGLES
, 2 + POINTER_DWORDS
);
9201 GLint
*box_copy
= NULL
;
9204 box_copy
= memdup(box
, sizeof(GLint
) * 4 * count
);
9207 save_pointer(&n
[3], box_copy
);
9209 if (ctx
->ExecuteFlag
) {
9210 CALL_WindowRectanglesEXT(ctx
->Exec
, (mode
, count
, box
));
9215 /** GL_NV_conservative_raster */
9216 static void GLAPIENTRY
9217 save_SubpixelPrecisionBiasNV(GLuint xbits
, GLuint ybits
)
9219 GET_CURRENT_CONTEXT(ctx
);
9221 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9222 n
= alloc_instruction(ctx
, OPCODE_SUBPIXEL_PRECISION_BIAS
, 2);
9227 if (ctx
->ExecuteFlag
) {
9228 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (xbits
, ybits
));
9232 /** GL_NV_conservative_raster_dilate */
9233 static void GLAPIENTRY
9234 save_ConservativeRasterParameterfNV(GLenum pname
, GLfloat param
)
9236 GET_CURRENT_CONTEXT(ctx
);
9238 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9239 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
, 2);
9244 if (ctx
->ExecuteFlag
) {
9245 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (pname
, param
));
9249 /** GL_NV_conservative_raster_pre_snap_triangles */
9250 static void GLAPIENTRY
9251 save_ConservativeRasterParameteriNV(GLenum pname
, GLint param
)
9253 GET_CURRENT_CONTEXT(ctx
);
9255 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9256 n
= alloc_instruction(ctx
, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
, 2);
9261 if (ctx
->ExecuteFlag
) {
9262 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (pname
, param
));
9266 /** GL_EXT_direct_state_access */
9268 static void GLAPIENTRY
9269 save_MatrixLoadfEXT(GLenum matrixMode
, const GLfloat
*m
)
9271 GET_CURRENT_CONTEXT(ctx
);
9273 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9274 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD
, 17);
9276 n
[1].e
= matrixMode
;
9277 for (unsigned i
= 0; i
< 16; i
++) {
9281 if (ctx
->ExecuteFlag
) {
9282 CALL_MatrixLoadfEXT(ctx
->Exec
, (matrixMode
, m
));
9286 static void GLAPIENTRY
9287 save_MatrixLoaddEXT(GLenum matrixMode
, const GLdouble
*m
)
9290 for (unsigned i
= 0; i
< 16; i
++) {
9291 f
[i
] = (GLfloat
) m
[i
];
9293 save_MatrixLoadfEXT(matrixMode
, f
);
9296 static void GLAPIENTRY
9297 save_MatrixMultfEXT(GLenum matrixMode
, const GLfloat
* m
)
9299 GET_CURRENT_CONTEXT(ctx
);
9301 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9302 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MULT
, 17);
9304 n
[1].e
= matrixMode
;
9305 for (unsigned i
= 0; i
< 16; i
++) {
9309 if (ctx
->ExecuteFlag
) {
9310 CALL_MatrixMultfEXT(ctx
->Exec
, (matrixMode
, m
));
9314 static void GLAPIENTRY
9315 save_MatrixMultdEXT(GLenum matrixMode
, const GLdouble
* m
)
9318 for (unsigned i
= 0; i
< 16; i
++) {
9319 f
[i
] = (GLfloat
) m
[i
];
9321 save_MatrixMultfEXT(matrixMode
, f
);
9324 static void GLAPIENTRY
9325 save_MatrixRotatefEXT(GLenum matrixMode
, GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
9327 GET_CURRENT_CONTEXT(ctx
);
9329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9330 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ROTATE
, 5);
9332 n
[1].e
= matrixMode
;
9338 if (ctx
->ExecuteFlag
) {
9339 CALL_MatrixRotatefEXT(ctx
->Exec
, (matrixMode
, angle
, x
, y
, z
));
9343 static void GLAPIENTRY
9344 save_MatrixRotatedEXT(GLenum matrixMode
, GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
9346 save_MatrixRotatefEXT(matrixMode
, (GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9349 static void GLAPIENTRY
9350 save_MatrixScalefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9352 GET_CURRENT_CONTEXT(ctx
);
9354 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9355 n
= alloc_instruction(ctx
, OPCODE_MATRIX_SCALE
, 4);
9357 n
[1].e
= matrixMode
;
9362 if (ctx
->ExecuteFlag
) {
9363 CALL_MatrixScalefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9367 static void GLAPIENTRY
9368 save_MatrixScaledEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9370 save_MatrixScalefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9373 static void GLAPIENTRY
9374 save_MatrixTranslatefEXT(GLenum matrixMode
, GLfloat x
, GLfloat y
, GLfloat z
)
9376 GET_CURRENT_CONTEXT(ctx
);
9378 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9379 n
= alloc_instruction(ctx
, OPCODE_MATRIX_TRANSLATE
, 4);
9381 n
[1].e
= matrixMode
;
9386 if (ctx
->ExecuteFlag
) {
9387 CALL_MatrixTranslatefEXT(ctx
->Exec
, (matrixMode
, x
, y
, z
));
9391 static void GLAPIENTRY
9392 save_MatrixTranslatedEXT(GLenum matrixMode
, GLdouble x
, GLdouble y
, GLdouble z
)
9394 save_MatrixTranslatefEXT(matrixMode
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
9397 static void GLAPIENTRY
9398 save_MatrixLoadIdentityEXT(GLenum matrixMode
)
9400 GET_CURRENT_CONTEXT(ctx
);
9402 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9403 n
= alloc_instruction(ctx
, OPCODE_MATRIX_LOAD_IDENTITY
, 1);
9405 n
[1].e
= matrixMode
;
9407 if (ctx
->ExecuteFlag
) {
9408 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (matrixMode
));
9412 static void GLAPIENTRY
9413 save_MatrixOrthoEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9414 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9416 GET_CURRENT_CONTEXT(ctx
);
9418 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9419 n
= alloc_instruction(ctx
, OPCODE_MATRIX_ORTHO
, 7);
9421 n
[1].e
= matrixMode
;
9422 n
[2].f
= (GLfloat
) left
;
9423 n
[3].f
= (GLfloat
) right
;
9424 n
[4].f
= (GLfloat
) bottom
;
9425 n
[5].f
= (GLfloat
) top
;
9426 n
[6].f
= (GLfloat
) nearval
;
9427 n
[7].f
= (GLfloat
) farval
;
9429 if (ctx
->ExecuteFlag
) {
9430 CALL_MatrixOrthoEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9435 static void GLAPIENTRY
9436 save_MatrixFrustumEXT(GLenum matrixMode
, GLdouble left
, GLdouble right
,
9437 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
9439 GET_CURRENT_CONTEXT(ctx
);
9441 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9442 n
= alloc_instruction(ctx
, OPCODE_MATRIX_FRUSTUM
, 7);
9444 n
[1].e
= matrixMode
;
9445 n
[2].f
= (GLfloat
) left
;
9446 n
[3].f
= (GLfloat
) right
;
9447 n
[4].f
= (GLfloat
) bottom
;
9448 n
[5].f
= (GLfloat
) top
;
9449 n
[6].f
= (GLfloat
) nearval
;
9450 n
[7].f
= (GLfloat
) farval
;
9452 if (ctx
->ExecuteFlag
) {
9453 CALL_MatrixFrustumEXT(ctx
->Exec
, (matrixMode
, left
, right
, bottom
, top
, nearval
, farval
));
9457 static void GLAPIENTRY
9458 save_MatrixPushEXT(GLenum matrixMode
)
9460 GET_CURRENT_CONTEXT(ctx
);
9462 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9463 n
= alloc_instruction(ctx
, OPCODE_MATRIX_PUSH
, 1);
9465 n
[1].e
= matrixMode
;
9467 if (ctx
->ExecuteFlag
) {
9468 CALL_MatrixPushEXT(ctx
->Exec
, (matrixMode
));
9472 static void GLAPIENTRY
9473 save_MatrixPopEXT(GLenum matrixMode
)
9475 GET_CURRENT_CONTEXT(ctx
);
9477 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9478 n
= alloc_instruction(ctx
, OPCODE_MATRIX_POP
, 1);
9480 n
[1].e
= matrixMode
;
9482 if (ctx
->ExecuteFlag
) {
9483 CALL_MatrixPopEXT(ctx
->Exec
, (matrixMode
));
9487 static void GLAPIENTRY
9488 save_MatrixLoadTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9491 _math_transposef(tm
, m
);
9492 save_MatrixLoadfEXT(matrixMode
, tm
);
9495 static void GLAPIENTRY
9496 save_MatrixLoadTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9499 _math_transposefd(tm
, m
);
9500 save_MatrixLoadfEXT(matrixMode
, tm
);
9503 static void GLAPIENTRY
9504 save_MatrixMultTransposefEXT(GLenum matrixMode
, const GLfloat m
[16])
9507 _math_transposef(tm
, m
);
9508 save_MatrixMultfEXT(matrixMode
, tm
);
9511 static void GLAPIENTRY
9512 save_MatrixMultTransposedEXT(GLenum matrixMode
, const GLdouble m
[16])
9515 _math_transposefd(tm
, m
);
9516 save_MatrixMultfEXT(matrixMode
, tm
);
9519 static void GLAPIENTRY
9520 save_TextureParameterfvEXT(GLuint texture
, GLenum target
, GLenum pname
,
9521 const GLfloat
*params
)
9523 GET_CURRENT_CONTEXT(ctx
);
9525 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9526 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_F
, 7);
9536 if (ctx
->ExecuteFlag
) {
9537 CALL_TextureParameterfvEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9542 static void GLAPIENTRY
9543 save_TextureParameterfEXT(GLuint texture
, GLenum target
, GLenum pname
, GLfloat param
)
9547 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9548 save_TextureParameterfvEXT(texture
, target
, pname
, parray
);
9551 static void GLAPIENTRY
9552 save_TextureParameterivEXT(GLuint texture
, GLenum target
, GLenum pname
, const GLint
*params
)
9554 GET_CURRENT_CONTEXT(ctx
);
9556 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9557 n
= alloc_instruction(ctx
, OPCODE_TEXTUREPARAMETER_I
, 7);
9567 if (ctx
->ExecuteFlag
) {
9568 CALL_TextureParameterivEXT(ctx
->Exec
, (texture
, target
, pname
, params
));
9572 static void GLAPIENTRY
9573 save_TextureParameteriEXT(GLuint texture
, GLenum target
, GLenum pname
, GLint param
)
9577 fparam
[1] = fparam
[2] = fparam
[3] = 0;
9578 save_TextureParameterivEXT(texture
, target
, pname
, fparam
);
9581 static void GLAPIENTRY
9582 save_TextureImage1DEXT(GLuint texture
, GLenum target
,
9583 GLint level
, GLint components
,
9584 GLsizei width
, GLint border
,
9585 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9587 GET_CURRENT_CONTEXT(ctx
);
9588 if (target
== GL_PROXY_TEXTURE_1D
) {
9589 /* don't compile, execute immediately */
9590 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9591 border
, format
, type
, pixels
));
9595 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9596 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE1D
, 8 + POINTER_DWORDS
);
9601 n
[4].i
= components
;
9602 n
[5].i
= (GLint
) width
;
9607 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9608 pixels
, &ctx
->Unpack
));
9610 if (ctx
->ExecuteFlag
) {
9611 CALL_TextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9612 border
, format
, type
, pixels
));
9618 static void GLAPIENTRY
9619 save_TextureImage2DEXT(GLuint texture
, GLenum target
,
9620 GLint level
, GLint components
,
9621 GLsizei width
, GLsizei height
, GLint border
,
9622 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9624 GET_CURRENT_CONTEXT(ctx
);
9625 if (target
== GL_PROXY_TEXTURE_2D
) {
9626 /* don't compile, execute immediately */
9627 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9628 height
, border
, format
, type
, pixels
));
9632 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9633 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE2D
, 9 + POINTER_DWORDS
);
9638 n
[4].i
= components
;
9639 n
[5].i
= (GLint
) width
;
9640 n
[6].i
= (GLint
) height
;
9644 save_pointer(&n
[10],
9645 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9646 pixels
, &ctx
->Unpack
));
9648 if (ctx
->ExecuteFlag
) {
9649 CALL_TextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
, components
, width
,
9650 height
, border
, format
, type
, pixels
));
9656 static void GLAPIENTRY
9657 save_TextureImage3DEXT(GLuint texture
, GLenum target
,
9658 GLint level
, GLint internalFormat
,
9659 GLsizei width
, GLsizei height
, GLsizei depth
,
9661 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9663 GET_CURRENT_CONTEXT(ctx
);
9664 if (target
== GL_PROXY_TEXTURE_3D
) {
9665 /* don't compile, execute immediately */
9666 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
, width
,
9667 height
, depth
, border
, format
, type
,
9672 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9673 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_IMAGE3D
, 10 + POINTER_DWORDS
);
9678 n
[4].i
= (GLint
) internalFormat
;
9679 n
[5].i
= (GLint
) width
;
9680 n
[6].i
= (GLint
) height
;
9681 n
[7].i
= (GLint
) depth
;
9685 save_pointer(&n
[11],
9686 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9687 pixels
, &ctx
->Unpack
));
9689 if (ctx
->ExecuteFlag
) {
9690 CALL_TextureImage3DEXT(ctx
->Exec
, (texture
, target
, level
, internalFormat
,
9691 width
, height
, depth
, border
, format
,
9698 static void GLAPIENTRY
9699 save_TextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
9700 GLsizei width
, GLenum format
, GLenum type
,
9701 const GLvoid
* pixels
)
9703 GET_CURRENT_CONTEXT(ctx
);
9706 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9708 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
9714 n
[5].i
= (GLint
) width
;
9718 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
9719 pixels
, &ctx
->Unpack
));
9721 if (ctx
->ExecuteFlag
) {
9722 CALL_TextureSubImage1DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, width
,
9723 format
, type
, pixels
));
9728 static void GLAPIENTRY
9729 save_TextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9730 GLint xoffset
, GLint yoffset
,
9731 GLsizei width
, GLsizei height
,
9732 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9734 GET_CURRENT_CONTEXT(ctx
);
9737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9739 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
9746 n
[6].i
= (GLint
) width
;
9747 n
[7].i
= (GLint
) height
;
9750 save_pointer(&n
[10],
9751 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
9752 pixels
, &ctx
->Unpack
));
9754 if (ctx
->ExecuteFlag
) {
9755 CALL_TextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
, xoffset
, yoffset
,
9756 width
, height
, format
, type
, pixels
));
9761 static void GLAPIENTRY
9762 save_TextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9763 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9764 GLsizei width
, GLsizei height
, GLsizei depth
,
9765 GLenum format
, GLenum type
, const GLvoid
* pixels
)
9767 GET_CURRENT_CONTEXT(ctx
);
9770 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9772 n
= alloc_instruction(ctx
, OPCODE_TEXTURE_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
9780 n
[7].i
= (GLint
) width
;
9781 n
[8].i
= (GLint
) height
;
9782 n
[9].i
= (GLint
) depth
;
9785 save_pointer(&n
[12],
9786 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
9787 pixels
, &ctx
->Unpack
));
9789 if (ctx
->ExecuteFlag
) {
9790 CALL_TextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9791 xoffset
, yoffset
, zoffset
,
9792 width
, height
, depth
, format
, type
,
9797 static void GLAPIENTRY
9798 save_CopyTextureImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9799 GLenum internalformat
, GLint x
, GLint y
,
9800 GLsizei width
, GLint border
)
9802 GET_CURRENT_CONTEXT(ctx
);
9804 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9805 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE1D
, 8);
9810 n
[4].e
= internalformat
;
9816 if (ctx
->ExecuteFlag
) {
9817 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (texture
, target
, level
,
9818 internalformat
, x
, y
,
9823 static void GLAPIENTRY
9824 save_CopyTextureImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9825 GLenum internalformat
,
9826 GLint x
, GLint y
, GLsizei width
,
9827 GLsizei height
, GLint border
)
9829 GET_CURRENT_CONTEXT(ctx
);
9831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9832 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_IMAGE2D
, 9);
9837 n
[4].e
= internalformat
;
9844 if (ctx
->ExecuteFlag
) {
9845 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9846 internalformat
, x
, y
,
9847 width
, height
, border
));
9851 static void GLAPIENTRY
9852 save_CopyTextureSubImage1DEXT(GLuint texture
, GLenum target
, GLint level
,
9853 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
9855 GET_CURRENT_CONTEXT(ctx
);
9857 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9858 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE1D
, 7);
9868 if (ctx
->ExecuteFlag
) {
9869 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
,
9870 (texture
, target
, level
, xoffset
, x
, y
, width
));
9874 static void GLAPIENTRY
9875 save_CopyTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
,
9876 GLint xoffset
, GLint yoffset
,
9877 GLint x
, GLint y
, GLsizei width
, GLint height
)
9879 GET_CURRENT_CONTEXT(ctx
);
9881 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9882 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE2D
, 9);
9894 if (ctx
->ExecuteFlag
) {
9895 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (texture
, target
, level
,
9897 x
, y
, width
, height
));
9902 static void GLAPIENTRY
9903 save_CopyTextureSubImage3DEXT(GLuint texture
, GLenum target
, GLint level
,
9904 GLint xoffset
, GLint yoffset
, GLint zoffset
,
9905 GLint x
, GLint y
, GLsizei width
, GLint height
)
9907 GET_CURRENT_CONTEXT(ctx
);
9909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9910 n
= alloc_instruction(ctx
, OPCODE_COPY_TEXTURE_SUB_IMAGE3D
, 10);
9923 if (ctx
->ExecuteFlag
) {
9924 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (texture
, target
, level
,
9925 xoffset
, yoffset
, zoffset
,
9926 x
, y
, width
, height
));
9931 static void GLAPIENTRY
9932 save_BindMultiTextureEXT(GLenum texunit
, GLenum target
, GLuint texture
)
9934 GET_CURRENT_CONTEXT(ctx
);
9936 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9937 n
= alloc_instruction(ctx
, OPCODE_BIND_MULTITEXTURE
, 3);
9943 if (ctx
->ExecuteFlag
) {
9944 CALL_BindMultiTextureEXT(ctx
->Exec
, (texunit
, target
, texture
));
9949 static void GLAPIENTRY
9950 save_MultiTexParameterfvEXT(GLenum texunit
, GLenum target
, GLenum pname
,
9951 const GLfloat
*params
)
9953 GET_CURRENT_CONTEXT(ctx
);
9955 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9956 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_F
, 7);
9966 if (ctx
->ExecuteFlag
) {
9967 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
9972 static void GLAPIENTRY
9973 save_MultiTexParameterfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
9977 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
9978 save_MultiTexParameterfvEXT(texunit
, target
, pname
, parray
);
9981 static void GLAPIENTRY
9982 save_MultiTexParameterivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
*params
)
9984 GET_CURRENT_CONTEXT(ctx
);
9986 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
9987 n
= alloc_instruction(ctx
, OPCODE_MULTITEXPARAMETER_I
, 7);
9997 if (ctx
->ExecuteFlag
) {
9998 CALL_MultiTexParameterivEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10002 static void GLAPIENTRY
10003 save_MultiTexParameteriEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10007 fparam
[1] = fparam
[2] = fparam
[3] = 0;
10008 save_MultiTexParameterivEXT(texunit
, target
, pname
, fparam
);
10012 static void GLAPIENTRY
10013 save_MultiTexImage1DEXT(GLenum texunit
, GLenum target
,
10014 GLint level
, GLint components
,
10015 GLsizei width
, GLint border
,
10016 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10018 GET_CURRENT_CONTEXT(ctx
);
10019 if (target
== GL_PROXY_TEXTURE_1D
) {
10020 /* don't compile, execute immediately */
10021 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10022 border
, format
, type
, pixels
));
10026 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10027 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE1D
, 8 + POINTER_DWORDS
);
10032 n
[4].i
= components
;
10033 n
[5].i
= (GLint
) width
;
10037 save_pointer(&n
[9],
10038 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10039 pixels
, &ctx
->Unpack
));
10041 if (ctx
->ExecuteFlag
) {
10042 CALL_MultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10043 border
, format
, type
, pixels
));
10049 static void GLAPIENTRY
10050 save_MultiTexImage2DEXT(GLenum texunit
, GLenum target
,
10051 GLint level
, GLint components
,
10052 GLsizei width
, GLsizei height
, GLint border
,
10053 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10055 GET_CURRENT_CONTEXT(ctx
);
10056 if (target
== GL_PROXY_TEXTURE_2D
) {
10057 /* don't compile, execute immediately */
10058 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10059 height
, border
, format
, type
, pixels
));
10063 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10064 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE2D
, 9 + POINTER_DWORDS
);
10069 n
[4].i
= components
;
10070 n
[5].i
= (GLint
) width
;
10071 n
[6].i
= (GLint
) height
;
10075 save_pointer(&n
[10],
10076 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10077 pixels
, &ctx
->Unpack
));
10079 if (ctx
->ExecuteFlag
) {
10080 CALL_MultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, components
, width
,
10081 height
, border
, format
, type
, pixels
));
10087 static void GLAPIENTRY
10088 save_MultiTexImage3DEXT(GLenum texunit
, GLenum target
,
10089 GLint level
, GLint internalFormat
,
10090 GLsizei width
, GLsizei height
, GLsizei depth
,
10092 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10094 GET_CURRENT_CONTEXT(ctx
);
10095 if (target
== GL_PROXY_TEXTURE_3D
) {
10096 /* don't compile, execute immediately */
10097 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
, width
,
10098 height
, depth
, border
, format
, type
,
10103 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10104 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_IMAGE3D
, 10 + POINTER_DWORDS
);
10109 n
[4].i
= (GLint
) internalFormat
;
10110 n
[5].i
= (GLint
) width
;
10111 n
[6].i
= (GLint
) height
;
10112 n
[7].i
= (GLint
) depth
;
10116 save_pointer(&n
[11],
10117 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10118 pixels
, &ctx
->Unpack
));
10120 if (ctx
->ExecuteFlag
) {
10121 CALL_MultiTexImage3DEXT(ctx
->Exec
, (texunit
, target
, level
, internalFormat
,
10122 width
, height
, depth
, border
, format
,
10129 static void GLAPIENTRY
10130 save_MultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
, GLint xoffset
,
10131 GLsizei width
, GLenum format
, GLenum type
,
10132 const GLvoid
* pixels
)
10134 GET_CURRENT_CONTEXT(ctx
);
10137 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10139 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE1D
, 7 + POINTER_DWORDS
);
10145 n
[5].i
= (GLint
) width
;
10148 save_pointer(&n
[8],
10149 unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
10150 pixels
, &ctx
->Unpack
));
10152 if (ctx
->ExecuteFlag
) {
10153 CALL_MultiTexSubImage1DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
, width
,
10154 format
, type
, pixels
));
10159 static void GLAPIENTRY
10160 save_MultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10161 GLint xoffset
, GLint yoffset
,
10162 GLsizei width
, GLsizei height
,
10163 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10165 GET_CURRENT_CONTEXT(ctx
);
10168 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10170 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE2D
, 9 + POINTER_DWORDS
);
10177 n
[6].i
= (GLint
) width
;
10178 n
[7].i
= (GLint
) height
;
10181 save_pointer(&n
[10],
10182 unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
10183 pixels
, &ctx
->Unpack
));
10185 if (ctx
->ExecuteFlag
) {
10186 CALL_MultiTexSubImage2DEXT(ctx
->Exec
, (texunit
, target
, level
, xoffset
, yoffset
,
10187 width
, height
, format
, type
, pixels
));
10192 static void GLAPIENTRY
10193 save_MultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
10194 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10195 GLsizei width
, GLsizei height
, GLsizei depth
,
10196 GLenum format
, GLenum type
, const GLvoid
* pixels
)
10198 GET_CURRENT_CONTEXT(ctx
);
10201 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10203 n
= alloc_instruction(ctx
, OPCODE_MULTITEX_SUB_IMAGE3D
, 11 + POINTER_DWORDS
);
10211 n
[7].i
= (GLint
) width
;
10212 n
[8].i
= (GLint
) height
;
10213 n
[9].i
= (GLint
) depth
;
10216 save_pointer(&n
[12],
10217 unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
10218 pixels
, &ctx
->Unpack
));
10220 if (ctx
->ExecuteFlag
) {
10221 CALL_MultiTexSubImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
10222 xoffset
, yoffset
, zoffset
,
10223 width
, height
, depth
, format
, type
,
10229 static void GLAPIENTRY
10230 save_CopyMultiTexImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
10231 GLenum internalformat
, GLint x
, GLint y
,
10232 GLsizei width
, GLint border
)
10234 GET_CURRENT_CONTEXT(ctx
);
10236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10237 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_IMAGE1D
, 8);
10242 n
[4].e
= internalformat
;
10248 if (ctx
->ExecuteFlag
) {
10249 CALL_CopyMultiTexImage1DEXT(ctx
->Exec
, (texunit
, target
, level
,
10250 internalformat
, x
, y
,
10256 static void GLAPIENTRY
10257 save_CopyMultiTexImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10258 GLenum internalformat
,
10259 GLint x
, GLint y
, GLsizei width
,
10260 GLsizei height
, GLint border
)
10262 GET_CURRENT_CONTEXT(ctx
);
10264 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10265 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_IMAGE2D
, 9);
10270 n
[4].e
= internalformat
;
10277 if (ctx
->ExecuteFlag
) {
10278 CALL_CopyMultiTexImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
10279 internalformat
, x
, y
,
10280 width
, height
, border
));
10285 static void GLAPIENTRY
10286 save_CopyMultiTexSubImage1DEXT(GLenum texunit
, GLenum target
, GLint level
,
10287 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
10289 GET_CURRENT_CONTEXT(ctx
);
10291 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10292 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE1D
, 7);
10302 if (ctx
->ExecuteFlag
) {
10303 CALL_CopyMultiTexSubImage1DEXT(ctx
->Exec
,
10304 (texunit
, target
, level
, xoffset
, x
, y
, width
));
10309 static void GLAPIENTRY
10310 save_CopyMultiTexSubImage2DEXT(GLenum texunit
, GLenum target
, GLint level
,
10311 GLint xoffset
, GLint yoffset
,
10312 GLint x
, GLint y
, GLsizei width
, GLint height
)
10314 GET_CURRENT_CONTEXT(ctx
);
10316 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10317 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE2D
, 9);
10329 if (ctx
->ExecuteFlag
) {
10330 CALL_CopyMultiTexSubImage2DEXT(ctx
->Exec
, (texunit
, target
, level
,
10332 x
, y
, width
, height
));
10337 static void GLAPIENTRY
10338 save_CopyMultiTexSubImage3DEXT(GLenum texunit
, GLenum target
, GLint level
,
10339 GLint xoffset
, GLint yoffset
, GLint zoffset
,
10340 GLint x
, GLint y
, GLsizei width
, GLint height
)
10342 GET_CURRENT_CONTEXT(ctx
);
10344 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10345 n
= alloc_instruction(ctx
, OPCODE_COPY_MULTITEX_SUB_IMAGE3D
, 10);
10358 if (ctx
->ExecuteFlag
) {
10359 CALL_CopyMultiTexSubImage3DEXT(ctx
->Exec
, (texunit
, target
, level
,
10360 xoffset
, yoffset
, zoffset
,
10361 x
, y
, width
, height
));
10366 static void GLAPIENTRY
10367 save_MultiTexEnvfvEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLfloat
*params
)
10369 GET_CURRENT_CONTEXT(ctx
);
10371 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10372 n
= alloc_instruction(ctx
, OPCODE_MULTITEXENV
, 7);
10377 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10378 n
[4].f
= params
[0];
10379 n
[5].f
= params
[1];
10380 n
[6].f
= params
[2];
10381 n
[7].f
= params
[3];
10384 n
[4].f
= params
[0];
10385 n
[5].f
= n
[6].f
= n
[7].f
= 0.0F
;
10388 if (ctx
->ExecuteFlag
) {
10389 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (texunit
, target
, pname
, params
));
10394 static void GLAPIENTRY
10395 save_MultiTexEnvfEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLfloat param
)
10398 parray
[0] = (GLfloat
) param
;
10399 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
10400 save_MultiTexEnvfvEXT(texunit
, target
, pname
, parray
);
10404 static void GLAPIENTRY
10405 save_MultiTexEnviEXT(GLenum texunit
, GLenum target
, GLenum pname
, GLint param
)
10408 p
[0] = (GLfloat
) param
;
10409 p
[1] = p
[2] = p
[3] = 0.0F
;
10410 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10414 static void GLAPIENTRY
10415 save_MultiTexEnvivEXT(GLenum texunit
, GLenum target
, GLenum pname
, const GLint
* param
)
10418 if (pname
== GL_TEXTURE_ENV_COLOR
) {
10419 p
[0] = INT_TO_FLOAT(param
[0]);
10420 p
[1] = INT_TO_FLOAT(param
[1]);
10421 p
[2] = INT_TO_FLOAT(param
[2]);
10422 p
[3] = INT_TO_FLOAT(param
[3]);
10425 p
[0] = (GLfloat
) param
[0];
10426 p
[1] = p
[2] = p
[3] = 0.0F
;
10428 save_MultiTexEnvfvEXT(texunit
, target
, pname
, p
);
10432 static void GLAPIENTRY
10433 save_CompressedTextureSubImage2DEXT(GLuint texture
, GLenum target
, GLint level
, GLint xoffset
,
10434 GLint yoffset
, GLsizei width
, GLsizei height
,
10435 GLenum format
, GLsizei imageSize
,
10436 const GLvoid
* data
)
10439 GET_CURRENT_CONTEXT(ctx
);
10440 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
10442 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
,
10443 9 + POINTER_DWORDS
);
10450 n
[6].i
= (GLint
) width
;
10451 n
[7].i
= (GLint
) height
;
10453 n
[9].i
= imageSize
;
10454 save_pointer(&n
[10],
10455 copy_data(data
, imageSize
, "glCompressedTextureSubImage2DEXT"));
10457 if (ctx
->ExecuteFlag
) {
10458 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
10459 (texture
, target
, level
, xoffset
, yoffset
,
10460 width
, height
, format
, imageSize
, data
));
10466 * Save an error-generating command into display list.
10468 * KW: Will appear in the list before the vertex buffer containing the
10469 * command that provoked the error. I don't see this as a problem.
10472 save_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
10475 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 1 + POINTER_DWORDS
);
10478 save_pointer(&n
[2], (void *) s
);
10479 /* note: the data/string here doesn't have to be freed in
10480 * _mesa_delete_list() since the string is never dynamically
10488 * Compile an error into current display list.
10491 _mesa_compile_error(struct gl_context
*ctx
, GLenum error
, const char *s
)
10493 if (ctx
->CompileFlag
)
10494 save_error(ctx
, error
, s
);
10495 if (ctx
->ExecuteFlag
)
10496 _mesa_error(ctx
, error
, "%s", s
);
10501 * Test if ID names a display list.
10504 islist(struct gl_context
*ctx
, GLuint list
)
10506 if (list
> 0 && _mesa_lookup_list(ctx
, list
)) {
10516 /**********************************************************************/
10517 /* Display list execution */
10518 /**********************************************************************/
10522 * Execute a display list. Note that the ListBase offset must have already
10523 * been added before calling this function. I.e. the list argument is
10524 * the absolute list number, not relative to ListBase.
10525 * \param list - display list number
10528 execute_list(struct gl_context
*ctx
, GLuint list
)
10530 struct gl_display_list
*dlist
;
10534 if (list
== 0 || !islist(ctx
, list
))
10537 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
10538 /* raise an error? */
10542 dlist
= _mesa_lookup_list(ctx
, list
);
10546 ctx
->ListState
.CallDepth
++;
10548 vbo_save_BeginCallList(ctx
, dlist
);
10554 const OpCode opcode
= n
[0].opcode
;
10556 if (is_ext_opcode(opcode
)) {
10557 n
+= ext_opcode_execute(ctx
, n
);
10562 _mesa_error(ctx
, n
[1].e
, "%s", (const char *) get_pointer(&n
[2]));
10565 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10567 case OPCODE_ALPHA_FUNC
:
10568 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10570 case OPCODE_BIND_TEXTURE
:
10571 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
10573 case OPCODE_BITMAP
:
10575 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10576 ctx
->Unpack
= ctx
->DefaultPacking
;
10577 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
10578 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
10579 get_pointer(&n
[7])));
10580 ctx
->Unpack
= save
; /* restore */
10583 case OPCODE_BLEND_COLOR
:
10584 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10586 case OPCODE_BLEND_EQUATION
:
10587 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
10589 case OPCODE_BLEND_EQUATION_SEPARATE
:
10590 CALL_BlendEquationSeparate(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10592 case OPCODE_BLEND_FUNC_SEPARATE
:
10593 CALL_BlendFuncSeparate(ctx
->Exec
,
10594 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
10597 case OPCODE_BLEND_FUNC_I
:
10598 /* GL_ARB_draw_buffers_blend */
10599 CALL_BlendFunciARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
));
10601 case OPCODE_BLEND_FUNC_SEPARATE_I
:
10602 /* GL_ARB_draw_buffers_blend */
10603 CALL_BlendFuncSeparateiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
,
10606 case OPCODE_BLEND_EQUATION_I
:
10607 /* GL_ARB_draw_buffers_blend */
10608 CALL_BlendEquationiARB(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10610 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
10611 /* GL_ARB_draw_buffers_blend */
10612 CALL_BlendEquationSeparateiARB(ctx
->Exec
,
10613 (n
[1].ui
, n
[2].e
, n
[3].e
));
10616 case OPCODE_CALL_LIST
:
10617 /* Generated by glCallList(), don't add ListBase */
10618 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
10619 execute_list(ctx
, n
[1].ui
);
10622 case OPCODE_CALL_LISTS
:
10623 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
10624 CALL_CallLists(ctx
->Exec
, (n
[1].i
, n
[2].e
, get_pointer(&n
[3])));
10628 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
10630 case OPCODE_CLEAR_BUFFER_IV
:
10637 CALL_ClearBufferiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10640 case OPCODE_CLEAR_BUFFER_UIV
:
10643 value
[0] = n
[3].ui
;
10644 value
[1] = n
[4].ui
;
10645 value
[2] = n
[5].ui
;
10646 value
[3] = n
[6].ui
;
10647 CALL_ClearBufferuiv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10650 case OPCODE_CLEAR_BUFFER_FV
:
10657 CALL_ClearBufferfv(ctx
->Exec
, (n
[1].e
, n
[2].i
, value
));
10660 case OPCODE_CLEAR_BUFFER_FI
:
10661 CALL_ClearBufferfi(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].f
, n
[4].i
));
10663 case OPCODE_CLEAR_COLOR
:
10664 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10666 case OPCODE_CLEAR_ACCUM
:
10667 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10669 case OPCODE_CLEAR_DEPTH
:
10670 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
10672 case OPCODE_CLEAR_INDEX
:
10673 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
10675 case OPCODE_CLEAR_STENCIL
:
10676 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
10678 case OPCODE_CLIP_PLANE
:
10685 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
10688 case OPCODE_COLOR_MASK
:
10689 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
10691 case OPCODE_COLOR_MASK_INDEXED
:
10692 CALL_ColorMaski(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
10695 case OPCODE_COLOR_MATERIAL
:
10696 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10698 case OPCODE_COPY_PIXELS
:
10699 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
10700 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
10703 case OPCODE_COPY_TEX_IMAGE1D
:
10704 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
10705 n
[5].i
, n
[6].i
, n
[7].i
));
10707 case OPCODE_COPY_TEX_IMAGE2D
:
10708 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
10709 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
10711 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
10712 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10713 n
[4].i
, n
[5].i
, n
[6].i
));
10715 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
10716 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10717 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10720 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
10721 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
10722 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
10725 case OPCODE_CULL_FACE
:
10726 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
10728 case OPCODE_DEPTH_FUNC
:
10729 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
10731 case OPCODE_DEPTH_MASK
:
10732 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
10734 case OPCODE_DEPTH_RANGE
:
10735 CALL_DepthRange(ctx
->Exec
,
10736 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
10738 case OPCODE_DISABLE
:
10739 CALL_Disable(ctx
->Exec
, (n
[1].e
));
10741 case OPCODE_DISABLE_INDEXED
:
10742 CALL_Disablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10744 case OPCODE_DRAW_BUFFER
:
10745 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
10747 case OPCODE_DRAW_PIXELS
:
10749 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10750 ctx
->Unpack
= ctx
->DefaultPacking
;
10751 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
10752 get_pointer(&n
[5])));
10753 ctx
->Unpack
= save
; /* restore */
10756 case OPCODE_ENABLE
:
10757 CALL_Enable(ctx
->Exec
, (n
[1].e
));
10759 case OPCODE_ENABLE_INDEXED
:
10760 CALL_Enablei(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
10762 case OPCODE_EVALMESH1
:
10763 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
10765 case OPCODE_EVALMESH2
:
10766 CALL_EvalMesh2(ctx
->Exec
,
10767 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
10776 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
10779 case OPCODE_FRONT_FACE
:
10780 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
10782 case OPCODE_FRUSTUM
:
10783 CALL_Frustum(ctx
->Exec
,
10784 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10787 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10789 case OPCODE_INDEX_MASK
:
10790 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
10792 case OPCODE_INIT_NAMES
:
10793 CALL_InitNames(ctx
->Exec
, ());
10802 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
10805 case OPCODE_LIGHT_MODEL
:
10812 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
10815 case OPCODE_LINE_STIPPLE
:
10816 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
10818 case OPCODE_LINE_WIDTH
:
10819 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
10821 case OPCODE_LIST_BASE
:
10822 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
10824 case OPCODE_LOAD_IDENTITY
:
10825 CALL_LoadIdentity(ctx
->Exec
, ());
10827 case OPCODE_LOAD_MATRIX
:
10828 STATIC_ASSERT(sizeof(Node
) == sizeof(GLfloat
));
10829 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
10831 case OPCODE_LOAD_NAME
:
10832 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
10834 case OPCODE_LOGIC_OP
:
10835 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
10839 GLenum target
= n
[1].e
;
10840 GLint ustride
= _mesa_evaluator_components(target
);
10841 GLint uorder
= n
[5].i
;
10842 GLfloat u1
= n
[2].f
;
10843 GLfloat u2
= n
[3].f
;
10844 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
10845 (GLfloat
*) get_pointer(&n
[6])));
10850 GLenum target
= n
[1].e
;
10851 GLfloat u1
= n
[2].f
;
10852 GLfloat u2
= n
[3].f
;
10853 GLfloat v1
= n
[4].f
;
10854 GLfloat v2
= n
[5].f
;
10855 GLint ustride
= n
[6].i
;
10856 GLint vstride
= n
[7].i
;
10857 GLint uorder
= n
[8].i
;
10858 GLint vorder
= n
[9].i
;
10859 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
10860 v1
, v2
, vstride
, vorder
,
10861 (GLfloat
*) get_pointer(&n
[10])));
10864 case OPCODE_MAPGRID1
:
10865 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
10867 case OPCODE_MAPGRID2
:
10868 CALL_MapGrid2f(ctx
->Exec
,
10869 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
10871 case OPCODE_MATRIX_MODE
:
10872 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
10874 case OPCODE_MULT_MATRIX
:
10875 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
10878 CALL_Ortho(ctx
->Exec
,
10879 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
10881 case OPCODE_PASSTHROUGH
:
10882 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
10884 case OPCODE_PATCH_PARAMETER_I
:
10885 CALL_PatchParameteri(ctx
->Exec
, (n
[1].e
, n
[2].i
));
10887 case OPCODE_PATCH_PARAMETER_FV_INNER
:
10890 params
[0] = n
[2].f
;
10891 params
[1] = n
[3].f
;
10892 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10895 case OPCODE_PATCH_PARAMETER_FV_OUTER
:
10898 params
[0] = n
[2].f
;
10899 params
[1] = n
[3].f
;
10900 params
[2] = n
[4].f
;
10901 params
[3] = n
[5].f
;
10902 CALL_PatchParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10905 case OPCODE_PIXEL_MAP
:
10906 CALL_PixelMapfv(ctx
->Exec
,
10907 (n
[1].e
, n
[2].i
, get_pointer(&n
[3])));
10909 case OPCODE_PIXEL_TRANSFER
:
10910 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
10912 case OPCODE_PIXEL_ZOOM
:
10913 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10915 case OPCODE_POINT_SIZE
:
10916 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
10918 case OPCODE_POINT_PARAMETERS
:
10921 params
[0] = n
[2].f
;
10922 params
[1] = n
[3].f
;
10923 params
[2] = n
[4].f
;
10924 CALL_PointParameterfv(ctx
->Exec
, (n
[1].e
, params
));
10927 case OPCODE_POLYGON_MODE
:
10928 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
10930 case OPCODE_POLYGON_STIPPLE
:
10932 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
10933 ctx
->Unpack
= ctx
->DefaultPacking
;
10934 CALL_PolygonStipple(ctx
->Exec
, (get_pointer(&n
[1])));
10935 ctx
->Unpack
= save
; /* restore */
10938 case OPCODE_POLYGON_OFFSET
:
10939 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
10941 case OPCODE_POLYGON_OFFSET_CLAMP
:
10942 CALL_PolygonOffsetClampEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10944 case OPCODE_POP_ATTRIB
:
10945 CALL_PopAttrib(ctx
->Exec
, ());
10947 case OPCODE_POP_MATRIX
:
10948 CALL_PopMatrix(ctx
->Exec
, ());
10950 case OPCODE_POP_NAME
:
10951 CALL_PopName(ctx
->Exec
, ());
10953 case OPCODE_PRIORITIZE_TEXTURE
:
10954 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
10956 case OPCODE_PUSH_ATTRIB
:
10957 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
10959 case OPCODE_PUSH_MATRIX
:
10960 CALL_PushMatrix(ctx
->Exec
, ());
10962 case OPCODE_PUSH_NAME
:
10963 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
10965 case OPCODE_RASTER_POS
:
10966 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10968 case OPCODE_READ_BUFFER
:
10969 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
10971 case OPCODE_ROTATE
:
10972 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
10975 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
10977 case OPCODE_SCISSOR
:
10978 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
10980 case OPCODE_SHADE_MODEL
:
10981 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
10983 case OPCODE_PROVOKING_VERTEX
:
10984 CALL_ProvokingVertex(ctx
->Exec
, (n
[1].e
));
10986 case OPCODE_STENCIL_FUNC
:
10987 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
10989 case OPCODE_STENCIL_MASK
:
10990 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
10992 case OPCODE_STENCIL_OP
:
10993 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
10995 case OPCODE_STENCIL_FUNC_SEPARATE
:
10996 CALL_StencilFuncSeparate(ctx
->Exec
,
10997 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
10999 case OPCODE_STENCIL_MASK_SEPARATE
:
11000 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11002 case OPCODE_STENCIL_OP_SEPARATE
:
11003 CALL_StencilOpSeparate(ctx
->Exec
,
11004 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
11006 case OPCODE_TEXENV
:
11009 params
[0] = n
[3].f
;
11010 params
[1] = n
[4].f
;
11011 params
[2] = n
[5].f
;
11012 params
[3] = n
[6].f
;
11013 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11016 case OPCODE_TEXGEN
:
11019 params
[0] = n
[3].f
;
11020 params
[1] = n
[4].f
;
11021 params
[2] = n
[5].f
;
11022 params
[3] = n
[6].f
;
11023 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11026 case OPCODE_TEXPARAMETER
:
11029 params
[0] = n
[3].f
;
11030 params
[1] = n
[4].f
;
11031 params
[2] = n
[5].f
;
11032 params
[3] = n
[6].f
;
11033 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11036 case OPCODE_TEX_IMAGE1D
:
11038 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11039 ctx
->Unpack
= ctx
->DefaultPacking
;
11040 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
11041 n
[2].i
, /* level */
11042 n
[3].i
, /* components */
11043 n
[4].i
, /* width */
11044 n
[5].e
, /* border */
11045 n
[6].e
, /* format */
11047 get_pointer(&n
[8])));
11048 ctx
->Unpack
= save
; /* restore */
11051 case OPCODE_TEX_IMAGE2D
:
11053 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11054 ctx
->Unpack
= ctx
->DefaultPacking
;
11055 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
11056 n
[2].i
, /* level */
11057 n
[3].i
, /* components */
11058 n
[4].i
, /* width */
11059 n
[5].i
, /* height */
11060 n
[6].e
, /* border */
11061 n
[7].e
, /* format */
11063 get_pointer(&n
[9])));
11064 ctx
->Unpack
= save
; /* restore */
11067 case OPCODE_TEX_IMAGE3D
:
11069 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11070 ctx
->Unpack
= ctx
->DefaultPacking
;
11071 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
11072 n
[2].i
, /* level */
11073 n
[3].i
, /* components */
11074 n
[4].i
, /* width */
11075 n
[5].i
, /* height */
11076 n
[6].i
, /* depth */
11077 n
[7].e
, /* border */
11078 n
[8].e
, /* format */
11080 get_pointer(&n
[10])));
11081 ctx
->Unpack
= save
; /* restore */
11084 case OPCODE_TEX_SUB_IMAGE1D
:
11086 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11087 ctx
->Unpack
= ctx
->DefaultPacking
;
11088 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11090 n
[6].e
, get_pointer(&n
[7])));
11091 ctx
->Unpack
= save
; /* restore */
11094 case OPCODE_TEX_SUB_IMAGE2D
:
11096 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11097 ctx
->Unpack
= ctx
->DefaultPacking
;
11098 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11100 n
[6].i
, n
[7].e
, n
[8].e
,
11101 get_pointer(&n
[9])));
11102 ctx
->Unpack
= save
; /* restore */
11105 case OPCODE_TEX_SUB_IMAGE3D
:
11107 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
11108 ctx
->Unpack
= ctx
->DefaultPacking
;
11109 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
11110 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
11111 n
[8].i
, n
[9].e
, n
[10].e
,
11112 get_pointer(&n
[11])));
11113 ctx
->Unpack
= save
; /* restore */
11116 case OPCODE_TRANSLATE
:
11117 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11119 case OPCODE_VIEWPORT
:
11120 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
11121 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
11123 case OPCODE_WINDOW_POS
:
11124 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11126 case OPCODE_VIEWPORT_ARRAY_V
:
11127 CALL_ViewportArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11128 get_pointer(&n
[3])));
11130 case OPCODE_VIEWPORT_INDEXED_F
:
11131 CALL_ViewportIndexedf(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
, n
[4].f
,
11134 case OPCODE_VIEWPORT_INDEXED_FV
: {
11140 CALL_ViewportIndexedfv(ctx
->Exec
, (n
[1].ui
, v
));
11143 case OPCODE_SCISSOR_ARRAY_V
:
11144 CALL_ScissorArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11145 get_pointer(&n
[3])));
11147 case OPCODE_SCISSOR_INDEXED
:
11148 CALL_ScissorIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].si
,
11151 case OPCODE_SCISSOR_INDEXED_V
: {
11157 CALL_ScissorIndexedv(ctx
->Exec
, (n
[1].ui
, v
));
11160 case OPCODE_DEPTH_ARRAY_V
:
11161 CALL_DepthRangeArrayv(ctx
->Exec
, (n
[1].ui
, n
[2].si
,
11162 get_pointer(&n
[3])));
11164 case OPCODE_DEPTH_INDEXED
:
11165 CALL_DepthRangeIndexed(ctx
->Exec
, (n
[1].ui
, n
[2].f
, n
[3].f
));
11167 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
11168 CALL_ActiveTexture(ctx
->Exec
, (n
[1].e
));
11170 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
11171 CALL_CompressedTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11172 n
[4].i
, n
[5].i
, n
[6].i
,
11173 get_pointer(&n
[7])));
11175 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
11176 CALL_CompressedTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11177 n
[4].i
, n
[5].i
, n
[6].i
,
11178 n
[7].i
, get_pointer(&n
[8])));
11180 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
11181 CALL_CompressedTexImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
11182 n
[4].i
, n
[5].i
, n
[6].i
,
11184 get_pointer(&n
[9])));
11186 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
11187 CALL_CompressedTexSubImage1D(ctx
->Exec
,
11188 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11190 get_pointer(&n
[7])));
11192 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
11193 CALL_CompressedTexSubImage2D(ctx
->Exec
,
11194 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11195 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
11196 get_pointer(&n
[9])));
11198 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
11199 CALL_CompressedTexSubImage3D(ctx
->Exec
,
11200 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
11201 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
11203 get_pointer(&n
[11])));
11205 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
11206 CALL_SampleCoverage(ctx
->Exec
, (n
[1].f
, n
[2].b
));
11208 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
11209 CALL_WindowPos3f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
11211 case OPCODE_BIND_PROGRAM_ARB
: /* GL_ARB_vertex_program */
11212 CALL_BindProgramARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11214 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
11215 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
11216 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
11219 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
11220 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
11222 case OPCODE_DEPTH_BOUNDS_EXT
:
11223 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11225 case OPCODE_PROGRAM_STRING_ARB
:
11226 CALL_ProgramStringARB(ctx
->Exec
,
11227 (n
[1].e
, n
[2].e
, n
[3].i
,
11228 get_pointer(&n
[4])));
11230 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
11231 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
11235 case OPCODE_BEGIN_QUERY_ARB
:
11236 CALL_BeginQuery(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11238 case OPCODE_END_QUERY_ARB
:
11239 CALL_EndQuery(ctx
->Exec
, (n
[1].e
));
11241 case OPCODE_QUERY_COUNTER
:
11242 CALL_QueryCounter(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
11244 case OPCODE_BEGIN_QUERY_INDEXED
:
11245 CALL_BeginQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].ui
));
11247 case OPCODE_END_QUERY_INDEXED
:
11248 CALL_EndQueryIndexed(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11250 case OPCODE_DRAW_BUFFERS_ARB
:
11252 GLenum buffers
[MAX_DRAW_BUFFERS
];
11253 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
11254 for (i
= 0; i
< count
; i
++)
11255 buffers
[i
] = n
[2 + i
].e
;
11256 CALL_DrawBuffers(ctx
->Exec
, (n
[1].i
, buffers
));
11259 case OPCODE_BLIT_FRAMEBUFFER
:
11260 CALL_BlitFramebuffer(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
11261 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
11264 case OPCODE_PRIMITIVE_RESTART_NV
:
11265 CALL_PrimitiveRestartNV(ctx
->Exec
, ());
11268 case OPCODE_USE_PROGRAM
:
11269 CALL_UseProgram(ctx
->Exec
, (n
[1].ui
));
11271 case OPCODE_UNIFORM_1F
:
11272 CALL_Uniform1f(ctx
->Exec
, (n
[1].i
, n
[2].f
));
11274 case OPCODE_UNIFORM_2F
:
11275 CALL_Uniform2f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
11277 case OPCODE_UNIFORM_3F
:
11278 CALL_Uniform3f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
11280 case OPCODE_UNIFORM_4F
:
11281 CALL_Uniform4f(ctx
->Exec
,
11282 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
11284 case OPCODE_UNIFORM_1FV
:
11285 CALL_Uniform1fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11287 case OPCODE_UNIFORM_2FV
:
11288 CALL_Uniform2fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11290 case OPCODE_UNIFORM_3FV
:
11291 CALL_Uniform3fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11293 case OPCODE_UNIFORM_4FV
:
11294 CALL_Uniform4fv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11296 case OPCODE_UNIFORM_1D
: {
11297 union float64_pair x
;
11299 x
.uint32
[0] = n
[2].ui
;
11300 x
.uint32
[1] = n
[3].ui
;
11302 CALL_Uniform1d(ctx
->Exec
, (n
[1].i
, x
.d
));
11305 case OPCODE_UNIFORM_2D
: {
11306 union float64_pair x
;
11307 union float64_pair y
;
11309 x
.uint32
[0] = n
[2].ui
;
11310 x
.uint32
[1] = n
[3].ui
;
11311 y
.uint32
[0] = n
[4].ui
;
11312 y
.uint32
[1] = n
[5].ui
;
11314 CALL_Uniform2d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
));
11317 case OPCODE_UNIFORM_3D
: {
11318 union float64_pair x
;
11319 union float64_pair y
;
11320 union float64_pair z
;
11322 x
.uint32
[0] = n
[2].ui
;
11323 x
.uint32
[1] = n
[3].ui
;
11324 y
.uint32
[0] = n
[4].ui
;
11325 y
.uint32
[1] = n
[5].ui
;
11326 z
.uint32
[0] = n
[6].ui
;
11327 z
.uint32
[1] = n
[7].ui
;
11329 CALL_Uniform3d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
));
11332 case OPCODE_UNIFORM_4D
: {
11333 union float64_pair x
;
11334 union float64_pair y
;
11335 union float64_pair z
;
11336 union float64_pair w
;
11338 x
.uint32
[0] = n
[2].ui
;
11339 x
.uint32
[1] = n
[3].ui
;
11340 y
.uint32
[0] = n
[4].ui
;
11341 y
.uint32
[1] = n
[5].ui
;
11342 z
.uint32
[0] = n
[6].ui
;
11343 z
.uint32
[1] = n
[7].ui
;
11344 w
.uint32
[0] = n
[8].ui
;
11345 w
.uint32
[1] = n
[9].ui
;
11347 CALL_Uniform4d(ctx
->Exec
, (n
[1].i
, x
.d
, y
.d
, z
.d
, w
.d
));
11350 case OPCODE_UNIFORM_1DV
:
11351 CALL_Uniform1dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11353 case OPCODE_UNIFORM_2DV
:
11354 CALL_Uniform2dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11356 case OPCODE_UNIFORM_3DV
:
11357 CALL_Uniform3dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11359 case OPCODE_UNIFORM_4DV
:
11360 CALL_Uniform4dv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11362 case OPCODE_UNIFORM_1I
:
11363 CALL_Uniform1i(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11365 case OPCODE_UNIFORM_2I
:
11366 CALL_Uniform2i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
11368 case OPCODE_UNIFORM_3I
:
11369 CALL_Uniform3i(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11371 case OPCODE_UNIFORM_4I
:
11372 CALL_Uniform4i(ctx
->Exec
,
11373 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11375 case OPCODE_UNIFORM_1IV
:
11376 CALL_Uniform1iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11378 case OPCODE_UNIFORM_2IV
:
11379 CALL_Uniform2iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11381 case OPCODE_UNIFORM_3IV
:
11382 CALL_Uniform3iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11384 case OPCODE_UNIFORM_4IV
:
11385 CALL_Uniform4iv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11387 case OPCODE_UNIFORM_1UI
:
11388 CALL_Uniform1ui(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11390 case OPCODE_UNIFORM_2UI
:
11391 CALL_Uniform2ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
11393 case OPCODE_UNIFORM_3UI
:
11394 CALL_Uniform3ui(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11396 case OPCODE_UNIFORM_4UI
:
11397 CALL_Uniform4ui(ctx
->Exec
,
11398 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
11400 case OPCODE_UNIFORM_1UIV
:
11401 CALL_Uniform1uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11403 case OPCODE_UNIFORM_2UIV
:
11404 CALL_Uniform2uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11406 case OPCODE_UNIFORM_3UIV
:
11407 CALL_Uniform3uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11409 case OPCODE_UNIFORM_4UIV
:
11410 CALL_Uniform4uiv(ctx
->Exec
, (n
[1].i
, n
[2].i
, get_pointer(&n
[3])));
11412 case OPCODE_UNIFORM_MATRIX22
:
11413 CALL_UniformMatrix2fv(ctx
->Exec
,
11414 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11416 case OPCODE_UNIFORM_MATRIX33
:
11417 CALL_UniformMatrix3fv(ctx
->Exec
,
11418 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11420 case OPCODE_UNIFORM_MATRIX44
:
11421 CALL_UniformMatrix4fv(ctx
->Exec
,
11422 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11424 case OPCODE_UNIFORM_MATRIX23
:
11425 CALL_UniformMatrix2x3fv(ctx
->Exec
,
11426 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11428 case OPCODE_UNIFORM_MATRIX32
:
11429 CALL_UniformMatrix3x2fv(ctx
->Exec
,
11430 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11432 case OPCODE_UNIFORM_MATRIX24
:
11433 CALL_UniformMatrix2x4fv(ctx
->Exec
,
11434 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11436 case OPCODE_UNIFORM_MATRIX42
:
11437 CALL_UniformMatrix4x2fv(ctx
->Exec
,
11438 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11440 case OPCODE_UNIFORM_MATRIX34
:
11441 CALL_UniformMatrix3x4fv(ctx
->Exec
,
11442 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11444 case OPCODE_UNIFORM_MATRIX43
:
11445 CALL_UniformMatrix4x3fv(ctx
->Exec
,
11446 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11448 case OPCODE_UNIFORM_MATRIX22D
:
11449 CALL_UniformMatrix2dv(ctx
->Exec
,
11450 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11452 case OPCODE_UNIFORM_MATRIX33D
:
11453 CALL_UniformMatrix3dv(ctx
->Exec
,
11454 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11456 case OPCODE_UNIFORM_MATRIX44D
:
11457 CALL_UniformMatrix4dv(ctx
->Exec
,
11458 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11460 case OPCODE_UNIFORM_MATRIX23D
:
11461 CALL_UniformMatrix2x3dv(ctx
->Exec
,
11462 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11464 case OPCODE_UNIFORM_MATRIX32D
:
11465 CALL_UniformMatrix3x2dv(ctx
->Exec
,
11466 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11468 case OPCODE_UNIFORM_MATRIX24D
:
11469 CALL_UniformMatrix2x4dv(ctx
->Exec
,
11470 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11472 case OPCODE_UNIFORM_MATRIX42D
:
11473 CALL_UniformMatrix4x2dv(ctx
->Exec
,
11474 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11476 case OPCODE_UNIFORM_MATRIX34D
:
11477 CALL_UniformMatrix3x4dv(ctx
->Exec
,
11478 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11480 case OPCODE_UNIFORM_MATRIX43D
:
11481 CALL_UniformMatrix4x3dv(ctx
->Exec
,
11482 (n
[1].i
, n
[2].i
, n
[3].b
, get_pointer(&n
[4])));
11485 case OPCODE_USE_PROGRAM_STAGES
:
11486 CALL_UseProgramStages(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11488 case OPCODE_PROGRAM_UNIFORM_1F
:
11489 CALL_ProgramUniform1f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
));
11491 case OPCODE_PROGRAM_UNIFORM_2F
:
11492 CALL_ProgramUniform2f(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].f
, n
[4].f
));
11494 case OPCODE_PROGRAM_UNIFORM_3F
:
11495 CALL_ProgramUniform3f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11496 n
[3].f
, n
[4].f
, n
[5].f
));
11498 case OPCODE_PROGRAM_UNIFORM_4F
:
11499 CALL_ProgramUniform4f(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11500 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
11502 case OPCODE_PROGRAM_UNIFORM_1FV
:
11503 CALL_ProgramUniform1fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11504 get_pointer(&n
[4])));
11506 case OPCODE_PROGRAM_UNIFORM_2FV
:
11507 CALL_ProgramUniform2fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11508 get_pointer(&n
[4])));
11510 case OPCODE_PROGRAM_UNIFORM_3FV
:
11511 CALL_ProgramUniform3fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11512 get_pointer(&n
[4])));
11514 case OPCODE_PROGRAM_UNIFORM_4FV
:
11515 CALL_ProgramUniform4fv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11516 get_pointer(&n
[4])));
11518 case OPCODE_PROGRAM_UNIFORM_1D
: {
11519 union float64_pair x
;
11521 x
.uint32
[0] = n
[3].ui
;
11522 x
.uint32
[1] = n
[4].ui
;
11524 CALL_ProgramUniform1d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
));
11527 case OPCODE_PROGRAM_UNIFORM_2D
: {
11528 union float64_pair x
;
11529 union float64_pair y
;
11531 x
.uint32
[0] = n
[3].ui
;
11532 x
.uint32
[1] = n
[4].ui
;
11533 y
.uint32
[0] = n
[5].ui
;
11534 y
.uint32
[1] = n
[6].ui
;
11536 CALL_ProgramUniform2d(ctx
->Exec
, (n
[1].ui
, n
[2].i
, x
.d
, y
.d
));
11539 case OPCODE_PROGRAM_UNIFORM_3D
: {
11540 union float64_pair x
;
11541 union float64_pair y
;
11542 union float64_pair z
;
11544 x
.uint32
[0] = n
[3].ui
;
11545 x
.uint32
[1] = n
[4].ui
;
11546 y
.uint32
[0] = n
[5].ui
;
11547 y
.uint32
[1] = n
[6].ui
;
11548 z
.uint32
[0] = n
[7].ui
;
11549 z
.uint32
[1] = n
[8].ui
;
11551 CALL_ProgramUniform3d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11555 case OPCODE_PROGRAM_UNIFORM_4D
: {
11556 union float64_pair x
;
11557 union float64_pair y
;
11558 union float64_pair z
;
11559 union float64_pair w
;
11561 x
.uint32
[0] = n
[3].ui
;
11562 x
.uint32
[1] = n
[4].ui
;
11563 y
.uint32
[0] = n
[5].ui
;
11564 y
.uint32
[1] = n
[6].ui
;
11565 z
.uint32
[0] = n
[7].ui
;
11566 z
.uint32
[1] = n
[8].ui
;
11567 w
.uint32
[0] = n
[9].ui
;
11568 w
.uint32
[1] = n
[10].ui
;
11570 CALL_ProgramUniform4d(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11571 x
.d
, y
.d
, z
.d
, w
.d
));
11574 case OPCODE_PROGRAM_UNIFORM_1DV
:
11575 CALL_ProgramUniform1dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11576 get_pointer(&n
[4])));
11578 case OPCODE_PROGRAM_UNIFORM_2DV
:
11579 CALL_ProgramUniform2dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11580 get_pointer(&n
[4])));
11582 case OPCODE_PROGRAM_UNIFORM_3DV
:
11583 CALL_ProgramUniform3dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11584 get_pointer(&n
[4])));
11586 case OPCODE_PROGRAM_UNIFORM_4DV
:
11587 CALL_ProgramUniform4dv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11588 get_pointer(&n
[4])));
11590 case OPCODE_PROGRAM_UNIFORM_1I
:
11591 CALL_ProgramUniform1i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
));
11593 case OPCODE_PROGRAM_UNIFORM_2I
:
11594 CALL_ProgramUniform2i(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].i
));
11596 case OPCODE_PROGRAM_UNIFORM_3I
:
11597 CALL_ProgramUniform3i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11598 n
[3].i
, n
[4].i
, n
[5].i
));
11600 case OPCODE_PROGRAM_UNIFORM_4I
:
11601 CALL_ProgramUniform4i(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11602 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
));
11604 case OPCODE_PROGRAM_UNIFORM_1IV
:
11605 CALL_ProgramUniform1iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11606 get_pointer(&n
[4])));
11608 case OPCODE_PROGRAM_UNIFORM_2IV
:
11609 CALL_ProgramUniform2iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11610 get_pointer(&n
[4])));
11612 case OPCODE_PROGRAM_UNIFORM_3IV
:
11613 CALL_ProgramUniform3iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11614 get_pointer(&n
[4])));
11616 case OPCODE_PROGRAM_UNIFORM_4IV
:
11617 CALL_ProgramUniform4iv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11618 get_pointer(&n
[4])));
11620 case OPCODE_PROGRAM_UNIFORM_1UI
:
11621 CALL_ProgramUniform1ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].ui
));
11623 case OPCODE_PROGRAM_UNIFORM_2UI
:
11624 CALL_ProgramUniform2ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11625 n
[3].ui
, n
[4].ui
));
11627 case OPCODE_PROGRAM_UNIFORM_3UI
:
11628 CALL_ProgramUniform3ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11629 n
[3].ui
, n
[4].ui
, n
[5].ui
));
11631 case OPCODE_PROGRAM_UNIFORM_4UI
:
11632 CALL_ProgramUniform4ui(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
11634 n
[4].ui
, n
[5].ui
, n
[6].ui
));
11636 case OPCODE_PROGRAM_UNIFORM_1UIV
:
11637 CALL_ProgramUniform1uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11638 get_pointer(&n
[4])));
11640 case OPCODE_PROGRAM_UNIFORM_2UIV
:
11641 CALL_ProgramUniform2uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11642 get_pointer(&n
[4])));
11644 case OPCODE_PROGRAM_UNIFORM_3UIV
:
11645 CALL_ProgramUniform3uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11646 get_pointer(&n
[4])));
11648 case OPCODE_PROGRAM_UNIFORM_4UIV
:
11649 CALL_ProgramUniform4uiv(ctx
->Exec
, (n
[1].ui
, n
[2].i
, n
[3].i
,
11650 get_pointer(&n
[4])));
11652 case OPCODE_PROGRAM_UNIFORM_MATRIX22F
:
11653 CALL_ProgramUniformMatrix2fv(ctx
->Exec
,
11654 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11655 get_pointer(&n
[5])));
11657 case OPCODE_PROGRAM_UNIFORM_MATRIX23F
:
11658 CALL_ProgramUniformMatrix2x3fv(ctx
->Exec
,
11659 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11660 get_pointer(&n
[5])));
11662 case OPCODE_PROGRAM_UNIFORM_MATRIX24F
:
11663 CALL_ProgramUniformMatrix2x4fv(ctx
->Exec
,
11664 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11665 get_pointer(&n
[5])));
11667 case OPCODE_PROGRAM_UNIFORM_MATRIX32F
:
11668 CALL_ProgramUniformMatrix3x2fv(ctx
->Exec
,
11669 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11670 get_pointer(&n
[5])));
11672 case OPCODE_PROGRAM_UNIFORM_MATRIX33F
:
11673 CALL_ProgramUniformMatrix3fv(ctx
->Exec
,
11674 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11675 get_pointer(&n
[5])));
11677 case OPCODE_PROGRAM_UNIFORM_MATRIX34F
:
11678 CALL_ProgramUniformMatrix3x4fv(ctx
->Exec
,
11679 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11680 get_pointer(&n
[5])));
11682 case OPCODE_PROGRAM_UNIFORM_MATRIX42F
:
11683 CALL_ProgramUniformMatrix4x2fv(ctx
->Exec
,
11684 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11685 get_pointer(&n
[5])));
11687 case OPCODE_PROGRAM_UNIFORM_MATRIX43F
:
11688 CALL_ProgramUniformMatrix4x3fv(ctx
->Exec
,
11689 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11690 get_pointer(&n
[5])));
11692 case OPCODE_PROGRAM_UNIFORM_MATRIX44F
:
11693 CALL_ProgramUniformMatrix4fv(ctx
->Exec
,
11694 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11695 get_pointer(&n
[5])));
11697 case OPCODE_PROGRAM_UNIFORM_MATRIX22D
:
11698 CALL_ProgramUniformMatrix2dv(ctx
->Exec
,
11699 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11700 get_pointer(&n
[5])));
11702 case OPCODE_PROGRAM_UNIFORM_MATRIX23D
:
11703 CALL_ProgramUniformMatrix2x3dv(ctx
->Exec
,
11704 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11705 get_pointer(&n
[5])));
11707 case OPCODE_PROGRAM_UNIFORM_MATRIX24D
:
11708 CALL_ProgramUniformMatrix2x4dv(ctx
->Exec
,
11709 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11710 get_pointer(&n
[5])));
11712 case OPCODE_PROGRAM_UNIFORM_MATRIX32D
:
11713 CALL_ProgramUniformMatrix3x2dv(ctx
->Exec
,
11714 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11715 get_pointer(&n
[5])));
11717 case OPCODE_PROGRAM_UNIFORM_MATRIX33D
:
11718 CALL_ProgramUniformMatrix3dv(ctx
->Exec
,
11719 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11720 get_pointer(&n
[5])));
11722 case OPCODE_PROGRAM_UNIFORM_MATRIX34D
:
11723 CALL_ProgramUniformMatrix3x4dv(ctx
->Exec
,
11724 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11725 get_pointer(&n
[5])));
11727 case OPCODE_PROGRAM_UNIFORM_MATRIX42D
:
11728 CALL_ProgramUniformMatrix4x2dv(ctx
->Exec
,
11729 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11730 get_pointer(&n
[5])));
11732 case OPCODE_PROGRAM_UNIFORM_MATRIX43D
:
11733 CALL_ProgramUniformMatrix4x3dv(ctx
->Exec
,
11734 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11735 get_pointer(&n
[5])));
11737 case OPCODE_PROGRAM_UNIFORM_MATRIX44D
:
11738 CALL_ProgramUniformMatrix4dv(ctx
->Exec
,
11739 (n
[1].ui
, n
[2].i
, n
[3].i
, n
[4].b
,
11740 get_pointer(&n
[5])));
11743 case OPCODE_CLIP_CONTROL
:
11744 CALL_ClipControl(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11747 case OPCODE_CLAMP_COLOR
:
11748 CALL_ClampColor(ctx
->Exec
, (n
[1].e
, n
[2].e
));
11751 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
11752 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
11754 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
11755 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (n
[1].ui
, &n
[2].f
));
11757 case OPCODE_ATTR_1F_NV
:
11758 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11760 case OPCODE_ATTR_2F_NV
:
11761 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11763 case OPCODE_ATTR_3F_NV
:
11764 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11766 case OPCODE_ATTR_4F_NV
:
11767 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11769 case OPCODE_ATTR_1F_ARB
:
11770 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11772 case OPCODE_ATTR_2F_ARB
:
11773 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11775 case OPCODE_ATTR_3F_ARB
:
11776 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11778 case OPCODE_ATTR_4F_ARB
:
11779 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11781 case OPCODE_ATTR_1D
: {
11782 GLdouble
*d
= (GLdouble
*) &n
[2];
11783 CALL_VertexAttribL1d(ctx
->Exec
, (n
[1].ui
, *d
));
11786 case OPCODE_ATTR_2D
: {
11787 GLdouble
*d
= (GLdouble
*) &n
[2];
11788 CALL_VertexAttribL2dv(ctx
->Exec
, (n
[1].ui
, d
));
11791 case OPCODE_ATTR_3D
: {
11792 GLdouble
*d
= (GLdouble
*) &n
[2];
11793 CALL_VertexAttribL3dv(ctx
->Exec
, (n
[1].ui
, d
));
11796 case OPCODE_ATTR_4D
: {
11797 GLdouble
*d
= (GLdouble
*) &n
[2];
11798 CALL_VertexAttribL4dv(ctx
->Exec
, (n
[1].ui
, d
));
11801 case OPCODE_MATERIAL
:
11802 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
11805 CALL_Begin(ctx
->Exec
, (n
[1].e
));
11808 CALL_End(ctx
->Exec
, ());
11811 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
11813 case OPCODE_EVAL_C1
:
11814 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
11816 case OPCODE_EVAL_C2
:
11817 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
11819 case OPCODE_EVAL_P1
:
11820 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
11822 case OPCODE_EVAL_P2
:
11823 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
11826 /* GL_EXT_texture_integer */
11827 case OPCODE_CLEARCOLOR_I
:
11828 CALL_ClearColorIiEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
11830 case OPCODE_CLEARCOLOR_UI
:
11831 CALL_ClearColorIuiEXT(ctx
->Exec
,
11832 (n
[1].ui
, n
[2].ui
, n
[3].ui
, n
[4].ui
));
11834 case OPCODE_TEXPARAMETER_I
:
11837 params
[0] = n
[3].i
;
11838 params
[1] = n
[4].i
;
11839 params
[2] = n
[5].i
;
11840 params
[3] = n
[6].i
;
11841 CALL_TexParameterIiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11844 case OPCODE_TEXPARAMETER_UI
:
11847 params
[0] = n
[3].ui
;
11848 params
[1] = n
[4].ui
;
11849 params
[2] = n
[5].ui
;
11850 params
[3] = n
[6].ui
;
11851 CALL_TexParameterIuiv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
11855 case OPCODE_VERTEX_ATTRIB_DIVISOR
:
11856 /* GL_ARB_instanced_arrays */
11857 CALL_VertexAttribDivisor(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11860 case OPCODE_TEXTURE_BARRIER_NV
:
11861 CALL_TextureBarrierNV(ctx
->Exec
, ());
11864 /* GL_EXT/ARB_transform_feedback */
11865 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
11866 CALL_BeginTransformFeedback(ctx
->Exec
, (n
[1].e
));
11868 case OPCODE_END_TRANSFORM_FEEDBACK
:
11869 CALL_EndTransformFeedback(ctx
->Exec
, ());
11871 case OPCODE_BIND_TRANSFORM_FEEDBACK
:
11872 CALL_BindTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11874 case OPCODE_PAUSE_TRANSFORM_FEEDBACK
:
11875 CALL_PauseTransformFeedback(ctx
->Exec
, ());
11877 case OPCODE_RESUME_TRANSFORM_FEEDBACK
:
11878 CALL_ResumeTransformFeedback(ctx
->Exec
, ());
11880 case OPCODE_DRAW_TRANSFORM_FEEDBACK
:
11881 CALL_DrawTransformFeedback(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
11883 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM
:
11884 CALL_DrawTransformFeedbackStream(ctx
->Exec
,
11885 (n
[1].e
, n
[2].ui
, n
[3].ui
));
11887 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED
:
11888 CALL_DrawTransformFeedbackInstanced(ctx
->Exec
,
11889 (n
[1].e
, n
[2].ui
, n
[3].si
));
11891 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED
:
11892 CALL_DrawTransformFeedbackStreamInstanced(ctx
->Exec
,
11893 (n
[1].e
, n
[2].ui
, n
[3].ui
, n
[4].si
));
11897 case OPCODE_BIND_SAMPLER
:
11898 CALL_BindSampler(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11900 case OPCODE_SAMPLER_PARAMETERIV
:
11903 params
[0] = n
[3].i
;
11904 params
[1] = n
[4].i
;
11905 params
[2] = n
[5].i
;
11906 params
[3] = n
[6].i
;
11907 CALL_SamplerParameteriv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11910 case OPCODE_SAMPLER_PARAMETERFV
:
11913 params
[0] = n
[3].f
;
11914 params
[1] = n
[4].f
;
11915 params
[2] = n
[5].f
;
11916 params
[3] = n
[6].f
;
11917 CALL_SamplerParameterfv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11920 case OPCODE_SAMPLER_PARAMETERIIV
:
11923 params
[0] = n
[3].i
;
11924 params
[1] = n
[4].i
;
11925 params
[2] = n
[5].i
;
11926 params
[3] = n
[6].i
;
11927 CALL_SamplerParameterIiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11930 case OPCODE_SAMPLER_PARAMETERUIV
:
11933 params
[0] = n
[3].ui
;
11934 params
[1] = n
[4].ui
;
11935 params
[2] = n
[5].ui
;
11936 params
[3] = n
[6].ui
;
11937 CALL_SamplerParameterIuiv(ctx
->Exec
, (n
[1].ui
, n
[2].e
, params
));
11941 /* ARB_compute_shader */
11942 case OPCODE_DISPATCH_COMPUTE
:
11943 CALL_DispatchCompute(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11947 case OPCODE_WAIT_SYNC
:
11949 union uint64_pair p
;
11950 p
.uint32
[0] = n
[2].ui
;
11951 p
.uint32
[1] = n
[3].ui
;
11952 CALL_WaitSync(ctx
->Exec
,
11953 (get_pointer(&n
[4]), n
[1].bf
, p
.uint64
));
11957 /* GL_NV_conditional_render */
11958 case OPCODE_BEGIN_CONDITIONAL_RENDER
:
11959 CALL_BeginConditionalRender(ctx
->Exec
, (n
[1].i
, n
[2].e
));
11961 case OPCODE_END_CONDITIONAL_RENDER
:
11962 CALL_EndConditionalRender(ctx
->Exec
, ());
11965 case OPCODE_UNIFORM_BLOCK_BINDING
:
11966 CALL_UniformBlockBinding(ctx
->Exec
, (n
[1].ui
, n
[2].ui
, n
[3].ui
));
11969 case OPCODE_UNIFORM_SUBROUTINES
:
11970 CALL_UniformSubroutinesuiv(ctx
->Exec
, (n
[1].e
, n
[2].si
,
11971 get_pointer(&n
[3])));
11974 /* GL_EXT_window_rectangles */
11975 case OPCODE_WINDOW_RECTANGLES
:
11976 CALL_WindowRectanglesEXT(
11977 ctx
->Exec
, (n
[1].e
, n
[2].si
, get_pointer(&n
[3])));
11980 /* GL_NV_conservative_raster */
11981 case OPCODE_SUBPIXEL_PRECISION_BIAS
:
11982 CALL_SubpixelPrecisionBiasNV(ctx
->Exec
, (n
[1].ui
, n
[2].ui
));
11985 /* GL_NV_conservative_raster_dilate */
11986 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F
:
11987 CALL_ConservativeRasterParameterfNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
11990 /* GL_NV_conservative_raster_pre_snap_triangles */
11991 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I
:
11992 CALL_ConservativeRasterParameteriNV(ctx
->Exec
, (n
[1].e
, n
[2].i
));
11995 /* GL_EXT_direct_state_access */
11996 case OPCODE_MATRIX_LOAD
:
11997 CALL_MatrixLoadfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
11999 case OPCODE_MATRIX_MULT
:
12000 CALL_MatrixMultfEXT(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
12002 case OPCODE_MATRIX_ROTATE
:
12003 CALL_MatrixRotatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
12005 case OPCODE_MATRIX_SCALE
:
12006 CALL_MatrixScalefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
12008 case OPCODE_MATRIX_TRANSLATE
:
12009 CALL_MatrixTranslatefEXT(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
, n
[4].f
));
12011 case OPCODE_MATRIX_LOAD_IDENTITY
:
12012 CALL_MatrixLoadIdentityEXT(ctx
->Exec
, (n
[1].e
));
12014 case OPCODE_MATRIX_ORTHO
:
12015 CALL_MatrixOrthoEXT(ctx
->Exec
, (n
[1].e
,
12016 n
[2].f
, n
[3].f
, n
[4].f
,
12017 n
[5].f
, n
[6].f
, n
[7].f
));
12019 case OPCODE_MATRIX_FRUSTUM
:
12020 CALL_MatrixFrustumEXT(ctx
->Exec
, (n
[1].e
,
12021 n
[2].f
, n
[3].f
, n
[4].f
,
12022 n
[5].f
, n
[6].f
, n
[7].f
));
12024 case OPCODE_MATRIX_PUSH
:
12025 CALL_MatrixPushEXT(ctx
->Exec
, (n
[1].e
));
12027 case OPCODE_MATRIX_POP
:
12028 CALL_MatrixPopEXT(ctx
->Exec
, (n
[1].e
));
12030 case OPCODE_TEXTUREPARAMETER_F
:
12033 params
[0] = n
[4].f
;
12034 params
[1] = n
[5].f
;
12035 params
[2] = n
[6].f
;
12036 params
[3] = n
[7].f
;
12037 CALL_TextureParameterfvEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
12040 case OPCODE_TEXTUREPARAMETER_I
:
12043 params
[0] = n
[4].i
;
12044 params
[1] = n
[5].i
;
12045 params
[2] = n
[6].i
;
12046 params
[3] = n
[7].i
;
12047 CALL_TextureParameterivEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].e
, params
));
12050 case OPCODE_TEXTURE_IMAGE1D
:
12052 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12053 ctx
->Unpack
= ctx
->DefaultPacking
;
12054 CALL_TextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
12055 n
[2].e
, /* target */
12056 n
[3].i
, /* level */
12057 n
[4].i
, /* components */
12058 n
[5].i
, /* width */
12059 n
[6].e
, /* border */
12060 n
[7].e
, /* format */
12062 get_pointer(&n
[9])));
12063 ctx
->Unpack
= save
; /* restore */
12066 case OPCODE_TEXTURE_IMAGE2D
:
12068 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12069 ctx
->Unpack
= ctx
->DefaultPacking
;
12070 CALL_TextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
12071 n
[2].e
, /* target */
12072 n
[3].i
, /* level */
12073 n
[4].i
, /* components */
12074 n
[5].i
, /* width */
12075 n
[6].i
, /* height */
12076 n
[7].e
, /* border */
12077 n
[8].e
, /* format */
12079 get_pointer(&n
[10])));
12080 ctx
->Unpack
= save
; /* restore */
12083 case OPCODE_TEXTURE_IMAGE3D
:
12085 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12086 ctx
->Unpack
= ctx
->DefaultPacking
;
12087 CALL_TextureImage3DEXT(ctx
->Exec
, (n
[1].ui
, /* texture */
12088 n
[2].e
, /* target */
12089 n
[3].i
, /* level */
12090 n
[4].i
, /* components */
12091 n
[5].i
, /* width */
12092 n
[6].i
, /* height */
12093 n
[7].i
, /* depth */
12094 n
[8].e
, /* border */
12095 n
[9].e
, /* format */
12096 n
[10].e
, /* type */
12097 get_pointer(&n
[11])));
12098 ctx
->Unpack
= save
; /* restore */
12101 case OPCODE_TEXTURE_SUB_IMAGE1D
:
12103 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12104 ctx
->Unpack
= ctx
->DefaultPacking
;
12105 CALL_TextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12106 n
[4].i
, n
[5].i
, n
[6].e
,
12107 n
[7].e
, get_pointer(&n
[8])));
12108 ctx
->Unpack
= save
; /* restore */
12111 case OPCODE_TEXTURE_SUB_IMAGE2D
:
12113 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12114 ctx
->Unpack
= ctx
->DefaultPacking
;
12115 CALL_TextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12116 n
[4].i
, n
[5].i
, n
[6].e
,
12117 n
[7].i
, n
[8].e
, n
[9].e
,
12118 get_pointer(&n
[10])));
12119 ctx
->Unpack
= save
;
12122 case OPCODE_TEXTURE_SUB_IMAGE3D
:
12124 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12125 ctx
->Unpack
= ctx
->DefaultPacking
;
12126 CALL_TextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12127 n
[4].i
, n
[5].i
, n
[6].i
,
12128 n
[7].i
, n
[8].i
, n
[9].i
,
12130 get_pointer(&n
[12])));
12131 ctx
->Unpack
= save
; /* restore */
12134 case OPCODE_COPY_TEXTURE_IMAGE1D
:
12135 CALL_CopyTextureImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12136 n
[4].e
, n
[5].i
, n
[6].i
,
12139 case OPCODE_COPY_TEXTURE_IMAGE2D
:
12140 CALL_CopyTextureImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12141 n
[4].e
, n
[5].i
, n
[6].i
,
12142 n
[7].i
, n
[8].i
, n
[9].i
));
12144 case OPCODE_COPY_TEXTURE_SUB_IMAGE1D
:
12145 CALL_CopyTextureSubImage1DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12146 n
[4].i
, n
[5].i
, n
[6].i
,
12149 case OPCODE_COPY_TEXTURE_SUB_IMAGE2D
:
12150 CALL_CopyTextureSubImage2DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12151 n
[4].i
, n
[5].i
, n
[6].i
,
12152 n
[7].i
, n
[8].i
, n
[9].i
));
12154 case OPCODE_COPY_TEXTURE_SUB_IMAGE3D
:
12155 CALL_CopyTextureSubImage3DEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
, n
[3].i
,
12156 n
[4].i
, n
[5].i
, n
[6].i
,
12157 n
[7].i
, n
[8].i
, n
[9].i
,
12160 case OPCODE_BIND_MULTITEXTURE
:
12161 CALL_BindMultiTextureEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].ui
));
12163 case OPCODE_MULTITEXPARAMETER_F
:
12166 params
[0] = n
[4].f
;
12167 params
[1] = n
[5].f
;
12168 params
[2] = n
[6].f
;
12169 params
[3] = n
[7].f
;
12170 CALL_MultiTexParameterfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12173 case OPCODE_MULTITEXPARAMETER_I
:
12176 params
[0] = n
[4].i
;
12177 params
[1] = n
[5].i
;
12178 params
[2] = n
[6].i
;
12179 params
[3] = n
[7].i
;
12180 CALL_MultiTexParameterivEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12183 case OPCODE_MULTITEX_IMAGE1D
:
12185 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12186 ctx
->Unpack
= ctx
->DefaultPacking
;
12187 CALL_MultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
12188 n
[2].e
, /* target */
12189 n
[3].i
, /* level */
12190 n
[4].i
, /* components */
12191 n
[5].i
, /* width */
12192 n
[6].e
, /* border */
12193 n
[7].e
, /* format */
12195 get_pointer(&n
[9])));
12196 ctx
->Unpack
= save
; /* restore */
12199 case OPCODE_MULTITEX_IMAGE2D
:
12201 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12202 ctx
->Unpack
= ctx
->DefaultPacking
;
12203 CALL_MultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
12204 n
[2].e
, /* target */
12205 n
[3].i
, /* level */
12206 n
[4].i
, /* components */
12207 n
[5].i
, /* width */
12208 n
[6].i
, /* height */
12209 n
[7].e
, /* border */
12210 n
[8].e
, /* format */
12212 get_pointer(&n
[10])));
12213 ctx
->Unpack
= save
; /* restore */
12216 case OPCODE_MULTITEX_IMAGE3D
:
12218 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12219 ctx
->Unpack
= ctx
->DefaultPacking
;
12220 CALL_MultiTexImage3DEXT(ctx
->Exec
, (n
[1].e
, /* texture */
12221 n
[2].e
, /* target */
12222 n
[3].i
, /* level */
12223 n
[4].i
, /* components */
12224 n
[5].i
, /* width */
12225 n
[6].i
, /* height */
12226 n
[7].i
, /* depth */
12227 n
[8].e
, /* border */
12228 n
[9].e
, /* format */
12229 n
[10].e
, /* type */
12230 get_pointer(&n
[11])));
12231 ctx
->Unpack
= save
; /* restore */
12234 case OPCODE_MULTITEX_SUB_IMAGE1D
:
12236 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12237 ctx
->Unpack
= ctx
->DefaultPacking
;
12238 CALL_MultiTexSubImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12239 n
[4].i
, n
[5].i
, n
[6].e
,
12240 n
[7].e
, get_pointer(&n
[8])));
12241 ctx
->Unpack
= save
; /* restore */
12244 case OPCODE_MULTITEX_SUB_IMAGE2D
:
12246 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12247 ctx
->Unpack
= ctx
->DefaultPacking
;
12248 CALL_MultiTexSubImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12249 n
[4].i
, n
[5].i
, n
[6].e
,
12250 n
[7].i
, n
[8].e
, n
[9].e
,
12251 get_pointer(&n
[10])));
12252 ctx
->Unpack
= save
; /* restore */
12255 case OPCODE_MULTITEX_SUB_IMAGE3D
:
12257 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
12258 ctx
->Unpack
= ctx
->DefaultPacking
;
12259 CALL_MultiTexSubImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12260 n
[4].i
, n
[5].i
, n
[6].i
,
12261 n
[7].i
, n
[8].i
, n
[9].i
,
12263 get_pointer(&n
[12])));
12264 ctx
->Unpack
= save
; /* restore */
12267 case OPCODE_COPY_MULTITEX_IMAGE1D
:
12268 CALL_CopyMultiTexImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12269 n
[4].e
, n
[5].i
, n
[6].i
,
12272 case OPCODE_COPY_MULTITEX_IMAGE2D
:
12273 CALL_CopyMultiTexImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12274 n
[4].e
, n
[5].i
, n
[6].i
,
12275 n
[7].i
, n
[8].i
, n
[9].i
));
12277 case OPCODE_COPY_MULTITEX_SUB_IMAGE1D
:
12278 CALL_CopyMultiTexSubImage1DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12279 n
[4].i
, n
[5].i
, n
[6].i
,
12282 case OPCODE_COPY_MULTITEX_SUB_IMAGE2D
:
12283 CALL_CopyMultiTexSubImage2DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12284 n
[4].i
, n
[5].i
, n
[6].i
,
12285 n
[7].i
, n
[8].i
, n
[9].i
));
12287 case OPCODE_COPY_MULTITEX_SUB_IMAGE3D
:
12288 CALL_CopyMultiTexSubImage3DEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
,
12289 n
[4].i
, n
[5].i
, n
[6].i
,
12290 n
[7].i
, n
[8].i
, n
[9].i
,
12293 case OPCODE_MULTITEXENV
:
12296 params
[0] = n
[4].f
;
12297 params
[1] = n
[5].f
;
12298 params
[2] = n
[6].f
;
12299 params
[3] = n
[7].f
;
12300 CALL_MultiTexEnvfvEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, params
));
12303 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D
:
12304 CALL_CompressedTextureSubImage2DEXT(ctx
->Exec
,
12305 (n
[1].ui
, n
[2].e
, n
[3].i
, n
[4].i
,
12306 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].e
,
12307 n
[9].i
, get_pointer(&n
[10])));
12310 case OPCODE_CONTINUE
:
12311 n
= (Node
*) get_pointer(&n
[1]);
12316 case OPCODE_END_OF_LIST
:
12322 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
12324 _mesa_problem(ctx
, "%s", msg
);
12329 /* increment n to point to next compiled command */
12330 if (opcode
!= OPCODE_CONTINUE
) {
12331 assert(InstSize
[opcode
] > 0);
12332 n
+= InstSize
[opcode
];
12337 vbo_save_EndCallList(ctx
);
12339 ctx
->ListState
.CallDepth
--;
12344 /**********************************************************************/
12346 /**********************************************************************/
12349 * Test if a display list number is valid.
12351 GLboolean GLAPIENTRY
12352 _mesa_IsList(GLuint list
)
12354 GET_CURRENT_CONTEXT(ctx
);
12355 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12356 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
12357 return islist(ctx
, list
);
12362 * Delete a sequence of consecutive display lists.
12365 _mesa_DeleteLists(GLuint list
, GLsizei range
)
12367 GET_CURRENT_CONTEXT(ctx
);
12369 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12370 ASSERT_OUTSIDE_BEGIN_END(ctx
);
12373 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
12378 /* We may be deleting a set of bitmap lists. See if there's a
12379 * bitmap atlas to free.
12381 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, list
);
12383 _mesa_delete_bitmap_atlas(ctx
, atlas
);
12384 _mesa_HashRemove(ctx
->Shared
->BitmapAtlas
, list
);
12388 for (i
= list
; i
< list
+ range
; i
++) {
12389 destroy_list(ctx
, i
);
12395 * Return a display list number, n, such that lists n through n+range-1
12399 _mesa_GenLists(GLsizei range
)
12401 GET_CURRENT_CONTEXT(ctx
);
12403 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12404 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
12407 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
12415 * Make this an atomic operation
12417 _mesa_HashLockMutex(ctx
->Shared
->DisplayList
);
12419 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
12421 /* reserve the list IDs by with empty/dummy lists */
12423 for (i
= 0; i
< range
; i
++) {
12424 _mesa_HashInsertLocked(ctx
->Shared
->DisplayList
, base
+ i
,
12425 make_list(base
+ i
, 1));
12429 if (USE_BITMAP_ATLAS
&&
12431 ctx
->Driver
.DrawAtlasBitmaps
) {
12432 /* "range > 16" is a rough heuristic to guess when glGenLists might be
12433 * used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
12434 * Create the empty atlas now.
12436 struct gl_bitmap_atlas
*atlas
= lookup_bitmap_atlas(ctx
, base
);
12438 atlas
= alloc_bitmap_atlas(ctx
, base
);
12441 /* Atlas _should_ be new/empty now, but clobbering is OK */
12442 assert(atlas
->numBitmaps
== 0);
12443 atlas
->numBitmaps
= range
;
12447 _mesa_HashUnlockMutex(ctx
->Shared
->DisplayList
);
12454 * Begin a new display list.
12457 _mesa_NewList(GLuint name
, GLenum mode
)
12459 GET_CURRENT_CONTEXT(ctx
);
12461 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
12462 ASSERT_OUTSIDE_BEGIN_END(ctx
);
12464 if (MESA_VERBOSE
& VERBOSE_API
)
12465 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
12466 _mesa_enum_to_string(mode
));
12469 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
12473 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
12474 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
12478 if (ctx
->ListState
.CurrentList
) {
12479 /* already compiling a display list */
12480 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
12484 ctx
->CompileFlag
= GL_TRUE
;
12485 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
12487 /* Reset accumulated list state */
12488 invalidate_saved_current_state( ctx
);
12490 /* Allocate new display list */
12491 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
12492 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
12493 ctx
->ListState
.CurrentPos
= 0;
12495 vbo_save_NewList(ctx
, name
, mode
);
12497 ctx
->CurrentServerDispatch
= ctx
->Save
;
12498 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12499 if (ctx
->MarshalExec
== NULL
) {
12500 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12506 * End definition of current display list.
12509 _mesa_EndList(void)
12511 GET_CURRENT_CONTEXT(ctx
);
12512 SAVE_FLUSH_VERTICES(ctx
);
12513 FLUSH_VERTICES(ctx
, 0);
12515 if (MESA_VERBOSE
& VERBOSE_API
)
12516 _mesa_debug(ctx
, "glEndList\n");
12518 if (ctx
->ExecuteFlag
&& _mesa_inside_dlist_begin_end(ctx
)) {
12519 _mesa_error(ctx
, GL_INVALID_OPERATION
,
12520 "glEndList() called inside glBegin/End");
12523 /* Check that a list is under construction */
12524 if (!ctx
->ListState
.CurrentList
) {
12525 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
12529 /* Call before emitting END_OF_LIST, in case the driver wants to
12530 * emit opcodes itself.
12532 vbo_save_EndList(ctx
);
12534 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
12538 /* Destroy old list, if any */
12539 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
12541 /* Install the new list */
12542 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
12543 ctx
->ListState
.CurrentList
->Name
,
12544 ctx
->ListState
.CurrentList
);
12547 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
12548 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
12550 ctx
->ListState
.CurrentList
= NULL
;
12551 ctx
->ListState
.CurrentBlock
= NULL
;
12552 ctx
->ListState
.CurrentPos
= 0;
12553 ctx
->ExecuteFlag
= GL_TRUE
;
12554 ctx
->CompileFlag
= GL_FALSE
;
12556 ctx
->CurrentServerDispatch
= ctx
->Exec
;
12557 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12558 if (ctx
->MarshalExec
== NULL
) {
12559 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12565 _mesa_CallList(GLuint list
)
12567 GLboolean save_compile_flag
;
12568 GET_CURRENT_CONTEXT(ctx
);
12569 FLUSH_CURRENT(ctx
, 0);
12571 if (MESA_VERBOSE
& VERBOSE_API
)
12572 _mesa_debug(ctx
, "glCallList %d\n", list
);
12575 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
12580 mesa_print_display_list( list
);
12582 /* VERY IMPORTANT: Save the CompileFlag status, turn it off,
12583 * execute the display list, and restore the CompileFlag.
12585 save_compile_flag
= ctx
->CompileFlag
;
12586 if (save_compile_flag
) {
12587 ctx
->CompileFlag
= GL_FALSE
;
12590 execute_list(ctx
, list
);
12591 ctx
->CompileFlag
= save_compile_flag
;
12593 /* also restore API function pointers to point to "save" versions */
12594 if (save_compile_flag
) {
12595 ctx
->CurrentServerDispatch
= ctx
->Save
;
12596 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12597 if (ctx
->MarshalExec
== NULL
) {
12598 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12605 * Try to execute a glCallLists() command where the display lists contain
12606 * glBitmap commands with a texture atlas.
12607 * \return true for success, false otherwise
12610 render_bitmap_atlas(struct gl_context
*ctx
, GLsizei n
, GLenum type
,
12613 struct gl_bitmap_atlas
*atlas
;
12616 if (!USE_BITMAP_ATLAS
||
12617 !ctx
->Current
.RasterPosValid
||
12618 ctx
->List
.ListBase
== 0 ||
12619 type
!= GL_UNSIGNED_BYTE
||
12620 !ctx
->Driver
.DrawAtlasBitmaps
) {
12625 atlas
= lookup_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
12628 /* Even if glGenLists wasn't called, we can still try to create
12631 atlas
= alloc_bitmap_atlas(ctx
, ctx
->List
.ListBase
);
12634 if (atlas
&& !atlas
->complete
&& !atlas
->incomplete
) {
12635 /* Try to build the bitmap atlas now.
12636 * If the atlas was created in glGenLists, we'll have recorded the
12637 * number of lists (bitmaps). Otherwise, take a guess at 256.
12639 if (atlas
->numBitmaps
== 0)
12640 atlas
->numBitmaps
= 256;
12641 build_bitmap_atlas(ctx
, atlas
, ctx
->List
.ListBase
);
12644 if (!atlas
|| !atlas
->complete
) {
12648 /* check that all display list IDs are in the atlas */
12649 for (i
= 0; i
< n
; i
++) {
12650 const GLubyte
*ids
= (const GLubyte
*) lists
;
12652 if (ids
[i
] >= atlas
->numBitmaps
) {
12657 ctx
->Driver
.DrawAtlasBitmaps(ctx
, atlas
, n
, (const GLubyte
*) lists
);
12664 * Execute glCallLists: call multiple display lists.
12667 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
12669 GET_CURRENT_CONTEXT(ctx
);
12671 GLboolean save_compile_flag
;
12673 if (MESA_VERBOSE
& VERBOSE_API
)
12674 _mesa_debug(ctx
, "glCallLists %d\n", n
);
12678 case GL_UNSIGNED_BYTE
:
12680 case GL_UNSIGNED_SHORT
:
12682 case GL_UNSIGNED_INT
:
12690 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
12695 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallLists(n < 0)");
12697 } else if (n
== 0 || lists
== NULL
) {
12698 /* nothing to do */
12702 if (render_bitmap_atlas(ctx
, n
, type
, lists
)) {
12706 /* Save the CompileFlag status, turn it off, execute display list,
12707 * and restore the CompileFlag.
12709 save_compile_flag
= ctx
->CompileFlag
;
12710 ctx
->CompileFlag
= GL_FALSE
;
12712 for (i
= 0; i
< n
; i
++) {
12713 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
12714 execute_list(ctx
, list
);
12717 ctx
->CompileFlag
= save_compile_flag
;
12719 /* also restore API function pointers to point to "save" versions */
12720 if (save_compile_flag
) {
12721 ctx
->CurrentServerDispatch
= ctx
->Save
;
12722 _glapi_set_dispatch(ctx
->CurrentServerDispatch
);
12723 if (ctx
->MarshalExec
== NULL
) {
12724 ctx
->CurrentClientDispatch
= ctx
->CurrentServerDispatch
;
12731 * Set the offset added to list numbers in glCallLists.
12734 _mesa_ListBase(GLuint base
)
12736 GET_CURRENT_CONTEXT(ctx
);
12737 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
12738 ASSERT_OUTSIDE_BEGIN_END(ctx
);
12739 ctx
->List
.ListBase
= base
;
12743 * Setup the given dispatch table to point to Mesa's display list
12744 * building functions.
12746 * This does not include any of the tnl functions - they are
12747 * initialized from _mesa_init_api_defaults and from the active vtxfmt
12751 _mesa_initialize_save_table(const struct gl_context
*ctx
)
12753 struct _glapi_table
*table
= ctx
->Save
;
12754 int numEntries
= MAX2(_gloffset_COUNT
, _glapi_get_dispatch_table_size());
12756 /* Initially populate the dispatch table with the contents of the
12757 * normal-execution dispatch table. This lets us skip populating functions
12758 * that should be called directly instead of compiled into display lists.
12760 memcpy(table
, ctx
->Exec
, numEntries
* sizeof(_glapi_proc
));
12762 _mesa_loopback_init_api_table(ctx
, table
);
12764 /* VBO functions */
12765 vbo_initialize_save_dispatch(ctx
, table
);
12768 SET_Accum(table
, save_Accum
);
12769 SET_AlphaFunc(table
, save_AlphaFunc
);
12770 SET_Bitmap(table
, save_Bitmap
);
12771 SET_BlendFunc(table
, save_BlendFunc
);
12772 SET_CallList(table
, save_CallList
);
12773 SET_CallLists(table
, save_CallLists
);
12774 SET_Clear(table
, save_Clear
);
12775 SET_ClearAccum(table
, save_ClearAccum
);
12776 SET_ClearColor(table
, save_ClearColor
);
12777 SET_ClearDepth(table
, save_ClearDepth
);
12778 SET_ClearIndex(table
, save_ClearIndex
);
12779 SET_ClearStencil(table
, save_ClearStencil
);
12780 SET_ClipPlane(table
, save_ClipPlane
);
12781 SET_ColorMask(table
, save_ColorMask
);
12782 SET_ColorMaski(table
, save_ColorMaskIndexed
);
12783 SET_ColorMaterial(table
, save_ColorMaterial
);
12784 SET_CopyPixels(table
, save_CopyPixels
);
12785 SET_CullFace(table
, save_CullFace
);
12786 SET_DepthFunc(table
, save_DepthFunc
);
12787 SET_DepthMask(table
, save_DepthMask
);
12788 SET_DepthRange(table
, save_DepthRange
);
12789 SET_Disable(table
, save_Disable
);
12790 SET_Disablei(table
, save_DisableIndexed
);
12791 SET_DrawBuffer(table
, save_DrawBuffer
);
12792 SET_DrawPixels(table
, save_DrawPixels
);
12793 SET_Enable(table
, save_Enable
);
12794 SET_Enablei(table
, save_EnableIndexed
);
12795 SET_EvalMesh1(table
, save_EvalMesh1
);
12796 SET_EvalMesh2(table
, save_EvalMesh2
);
12797 SET_Fogf(table
, save_Fogf
);
12798 SET_Fogfv(table
, save_Fogfv
);
12799 SET_Fogi(table
, save_Fogi
);
12800 SET_Fogiv(table
, save_Fogiv
);
12801 SET_FrontFace(table
, save_FrontFace
);
12802 SET_Frustum(table
, save_Frustum
);
12803 SET_Hint(table
, save_Hint
);
12804 SET_IndexMask(table
, save_IndexMask
);
12805 SET_InitNames(table
, save_InitNames
);
12806 SET_LightModelf(table
, save_LightModelf
);
12807 SET_LightModelfv(table
, save_LightModelfv
);
12808 SET_LightModeli(table
, save_LightModeli
);
12809 SET_LightModeliv(table
, save_LightModeliv
);
12810 SET_Lightf(table
, save_Lightf
);
12811 SET_Lightfv(table
, save_Lightfv
);
12812 SET_Lighti(table
, save_Lighti
);
12813 SET_Lightiv(table
, save_Lightiv
);
12814 SET_LineStipple(table
, save_LineStipple
);
12815 SET_LineWidth(table
, save_LineWidth
);
12816 SET_ListBase(table
, save_ListBase
);
12817 SET_LoadIdentity(table
, save_LoadIdentity
);
12818 SET_LoadMatrixd(table
, save_LoadMatrixd
);
12819 SET_LoadMatrixf(table
, save_LoadMatrixf
);
12820 SET_LoadName(table
, save_LoadName
);
12821 SET_LogicOp(table
, save_LogicOp
);
12822 SET_Map1d(table
, save_Map1d
);
12823 SET_Map1f(table
, save_Map1f
);
12824 SET_Map2d(table
, save_Map2d
);
12825 SET_Map2f(table
, save_Map2f
);
12826 SET_MapGrid1d(table
, save_MapGrid1d
);
12827 SET_MapGrid1f(table
, save_MapGrid1f
);
12828 SET_MapGrid2d(table
, save_MapGrid2d
);
12829 SET_MapGrid2f(table
, save_MapGrid2f
);
12830 SET_MatrixMode(table
, save_MatrixMode
);
12831 SET_MultMatrixd(table
, save_MultMatrixd
);
12832 SET_MultMatrixf(table
, save_MultMatrixf
);
12833 SET_NewList(table
, save_NewList
);
12834 SET_Ortho(table
, save_Ortho
);
12835 SET_PassThrough(table
, save_PassThrough
);
12836 SET_PixelMapfv(table
, save_PixelMapfv
);
12837 SET_PixelMapuiv(table
, save_PixelMapuiv
);
12838 SET_PixelMapusv(table
, save_PixelMapusv
);
12839 SET_PixelTransferf(table
, save_PixelTransferf
);
12840 SET_PixelTransferi(table
, save_PixelTransferi
);
12841 SET_PixelZoom(table
, save_PixelZoom
);
12842 SET_PointSize(table
, save_PointSize
);
12843 SET_PolygonMode(table
, save_PolygonMode
);
12844 SET_PolygonOffset(table
, save_PolygonOffset
);
12845 SET_PolygonStipple(table
, save_PolygonStipple
);
12846 SET_PopAttrib(table
, save_PopAttrib
);
12847 SET_PopMatrix(table
, save_PopMatrix
);
12848 SET_PopName(table
, save_PopName
);
12849 SET_PushAttrib(table
, save_PushAttrib
);
12850 SET_PushMatrix(table
, save_PushMatrix
);
12851 SET_PushName(table
, save_PushName
);
12852 SET_RasterPos2d(table
, save_RasterPos2d
);
12853 SET_RasterPos2dv(table
, save_RasterPos2dv
);
12854 SET_RasterPos2f(table
, save_RasterPos2f
);
12855 SET_RasterPos2fv(table
, save_RasterPos2fv
);
12856 SET_RasterPos2i(table
, save_RasterPos2i
);
12857 SET_RasterPos2iv(table
, save_RasterPos2iv
);
12858 SET_RasterPos2s(table
, save_RasterPos2s
);
12859 SET_RasterPos2sv(table
, save_RasterPos2sv
);
12860 SET_RasterPos3d(table
, save_RasterPos3d
);
12861 SET_RasterPos3dv(table
, save_RasterPos3dv
);
12862 SET_RasterPos3f(table
, save_RasterPos3f
);
12863 SET_RasterPos3fv(table
, save_RasterPos3fv
);
12864 SET_RasterPos3i(table
, save_RasterPos3i
);
12865 SET_RasterPos3iv(table
, save_RasterPos3iv
);
12866 SET_RasterPos3s(table
, save_RasterPos3s
);
12867 SET_RasterPos3sv(table
, save_RasterPos3sv
);
12868 SET_RasterPos4d(table
, save_RasterPos4d
);
12869 SET_RasterPos4dv(table
, save_RasterPos4dv
);
12870 SET_RasterPos4f(table
, save_RasterPos4f
);
12871 SET_RasterPos4fv(table
, save_RasterPos4fv
);
12872 SET_RasterPos4i(table
, save_RasterPos4i
);
12873 SET_RasterPos4iv(table
, save_RasterPos4iv
);
12874 SET_RasterPos4s(table
, save_RasterPos4s
);
12875 SET_RasterPos4sv(table
, save_RasterPos4sv
);
12876 SET_ReadBuffer(table
, save_ReadBuffer
);
12877 SET_Rectf(table
, save_Rectf
);
12878 SET_Rotated(table
, save_Rotated
);
12879 SET_Rotatef(table
, save_Rotatef
);
12880 SET_Scaled(table
, save_Scaled
);
12881 SET_Scalef(table
, save_Scalef
);
12882 SET_Scissor(table
, save_Scissor
);
12883 SET_ShadeModel(table
, save_ShadeModel
);
12884 SET_StencilFunc(table
, save_StencilFunc
);
12885 SET_StencilMask(table
, save_StencilMask
);
12886 SET_StencilOp(table
, save_StencilOp
);
12887 SET_TexEnvf(table
, save_TexEnvf
);
12888 SET_TexEnvfv(table
, save_TexEnvfv
);
12889 SET_TexEnvi(table
, save_TexEnvi
);
12890 SET_TexEnviv(table
, save_TexEnviv
);
12891 SET_TexGend(table
, save_TexGend
);
12892 SET_TexGendv(table
, save_TexGendv
);
12893 SET_TexGenf(table
, save_TexGenf
);
12894 SET_TexGenfv(table
, save_TexGenfv
);
12895 SET_TexGeni(table
, save_TexGeni
);
12896 SET_TexGeniv(table
, save_TexGeniv
);
12897 SET_TexImage1D(table
, save_TexImage1D
);
12898 SET_TexImage2D(table
, save_TexImage2D
);
12899 SET_TexParameterf(table
, save_TexParameterf
);
12900 SET_TexParameterfv(table
, save_TexParameterfv
);
12901 SET_TexParameteri(table
, save_TexParameteri
);
12902 SET_TexParameteriv(table
, save_TexParameteriv
);
12903 SET_Translated(table
, save_Translated
);
12904 SET_Translatef(table
, save_Translatef
);
12905 SET_Viewport(table
, save_Viewport
);
12908 SET_BindTexture(table
, save_BindTexture
);
12909 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
12910 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
12911 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
12912 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
12913 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
12914 SET_TexSubImage1D(table
, save_TexSubImage1D
);
12915 SET_TexSubImage2D(table
, save_TexSubImage2D
);
12918 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
12919 SET_TexImage3D(table
, save_TexImage3D
);
12920 SET_TexSubImage3D(table
, save_TexSubImage3D
);
12923 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
12924 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
12925 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
12927 /* ATI_separate_stencil */
12928 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
12930 /* GL_ARB_imaging */
12931 /* Not all are supported */
12932 SET_BlendColor(table
, save_BlendColor
);
12933 SET_BlendEquation(table
, save_BlendEquation
);
12935 /* 2. GL_EXT_blend_color */
12937 SET_BlendColorEXT(table
, save_BlendColorEXT
);
12940 /* 6. GL_EXT_texture3d */
12942 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
12943 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
12944 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
12947 /* 37. GL_EXT_blend_minmax */
12949 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
12952 /* 54. GL_EXT_point_parameters */
12953 SET_PointParameterf(table
, save_PointParameterfEXT
);
12954 SET_PointParameterfv(table
, save_PointParameterfvEXT
);
12956 /* 91. GL_ARB_tessellation_shader */
12957 SET_PatchParameteri(table
, save_PatchParameteri
);
12958 SET_PatchParameterfv(table
, save_PatchParameterfv
);
12960 /* 100. ARB_viewport_array */
12961 SET_ViewportArrayv(table
, save_ViewportArrayv
);
12962 SET_ViewportIndexedf(table
, save_ViewportIndexedf
);
12963 SET_ViewportIndexedfv(table
, save_ViewportIndexedfv
);
12964 SET_ScissorArrayv(table
, save_ScissorArrayv
);
12965 SET_ScissorIndexed(table
, save_ScissorIndexed
);
12966 SET_ScissorIndexedv(table
, save_ScissorIndexedv
);
12967 SET_DepthRangeArrayv(table
, save_DepthRangeArrayv
);
12968 SET_DepthRangeIndexed(table
, save_DepthRangeIndexed
);
12970 /* 122. ARB_compute_shader */
12971 SET_DispatchCompute(table
, save_DispatchCompute
);
12972 SET_DispatchComputeIndirect(table
, save_DispatchComputeIndirect
);
12974 /* 173. GL_EXT_blend_func_separate */
12975 SET_BlendFuncSeparate(table
, save_BlendFuncSeparateEXT
);
12977 /* 197. GL_MESA_window_pos */
12978 SET_WindowPos2d(table
, save_WindowPos2dMESA
);
12979 SET_WindowPos2dv(table
, save_WindowPos2dvMESA
);
12980 SET_WindowPos2f(table
, save_WindowPos2fMESA
);
12981 SET_WindowPos2fv(table
, save_WindowPos2fvMESA
);
12982 SET_WindowPos2i(table
, save_WindowPos2iMESA
);
12983 SET_WindowPos2iv(table
, save_WindowPos2ivMESA
);
12984 SET_WindowPos2s(table
, save_WindowPos2sMESA
);
12985 SET_WindowPos2sv(table
, save_WindowPos2svMESA
);
12986 SET_WindowPos3d(table
, save_WindowPos3dMESA
);
12987 SET_WindowPos3dv(table
, save_WindowPos3dvMESA
);
12988 SET_WindowPos3f(table
, save_WindowPos3fMESA
);
12989 SET_WindowPos3fv(table
, save_WindowPos3fvMESA
);
12990 SET_WindowPos3i(table
, save_WindowPos3iMESA
);
12991 SET_WindowPos3iv(table
, save_WindowPos3ivMESA
);
12992 SET_WindowPos3s(table
, save_WindowPos3sMESA
);
12993 SET_WindowPos3sv(table
, save_WindowPos3svMESA
);
12994 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
12995 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
12996 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
12997 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
12998 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
12999 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
13000 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
13001 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
13003 /* 245. GL_ATI_fragment_shader */
13004 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
13005 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
13007 /* 262. GL_NV_point_sprite */
13008 SET_PointParameteri(table
, save_PointParameteriNV
);
13009 SET_PointParameteriv(table
, save_PointParameterivNV
);
13011 /* 268. GL_EXT_stencil_two_side */
13012 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
13014 /* ???. GL_EXT_depth_bounds_test */
13015 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
13017 /* ARB 1. GL_ARB_multitexture */
13018 SET_ActiveTexture(table
, save_ActiveTextureARB
);
13020 /* ARB 3. GL_ARB_transpose_matrix */
13021 SET_LoadTransposeMatrixd(table
, save_LoadTransposeMatrixdARB
);
13022 SET_LoadTransposeMatrixf(table
, save_LoadTransposeMatrixfARB
);
13023 SET_MultTransposeMatrixd(table
, save_MultTransposeMatrixdARB
);
13024 SET_MultTransposeMatrixf(table
, save_MultTransposeMatrixfARB
);
13026 /* ARB 5. GL_ARB_multisample */
13027 SET_SampleCoverage(table
, save_SampleCoverageARB
);
13029 /* ARB 12. GL_ARB_texture_compression */
13030 SET_CompressedTexImage3D(table
, save_CompressedTexImage3DARB
);
13031 SET_CompressedTexImage2D(table
, save_CompressedTexImage2DARB
);
13032 SET_CompressedTexImage1D(table
, save_CompressedTexImage1DARB
);
13033 SET_CompressedTexSubImage3D(table
, save_CompressedTexSubImage3DARB
);
13034 SET_CompressedTexSubImage2D(table
, save_CompressedTexSubImage2DARB
);
13035 SET_CompressedTexSubImage1D(table
, save_CompressedTexSubImage1DARB
);
13037 /* ARB 14. GL_ARB_point_parameters */
13038 /* aliased with EXT_point_parameters functions */
13040 /* ARB 25. GL_ARB_window_pos */
13041 /* aliased with MESA_window_pos functions */
13043 /* ARB 26. GL_ARB_vertex_program */
13044 /* ARB 27. GL_ARB_fragment_program */
13045 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
13046 SET_ProgramStringARB(table
, save_ProgramStringARB
);
13047 SET_BindProgramARB(table
, save_BindProgramARB
);
13048 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
13049 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
13050 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
13051 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
13052 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
13053 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
13054 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
13055 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
13057 SET_BeginQuery(table
, save_BeginQueryARB
);
13058 SET_EndQuery(table
, save_EndQueryARB
);
13059 SET_QueryCounter(table
, save_QueryCounter
);
13061 SET_DrawBuffers(table
, save_DrawBuffersARB
);
13063 SET_BlitFramebuffer(table
, save_BlitFramebufferEXT
);
13065 SET_UseProgram(table
, save_UseProgram
);
13066 SET_Uniform1f(table
, save_Uniform1fARB
);
13067 SET_Uniform2f(table
, save_Uniform2fARB
);
13068 SET_Uniform3f(table
, save_Uniform3fARB
);
13069 SET_Uniform4f(table
, save_Uniform4fARB
);
13070 SET_Uniform1fv(table
, save_Uniform1fvARB
);
13071 SET_Uniform2fv(table
, save_Uniform2fvARB
);
13072 SET_Uniform3fv(table
, save_Uniform3fvARB
);
13073 SET_Uniform4fv(table
, save_Uniform4fvARB
);
13074 SET_Uniform1i(table
, save_Uniform1iARB
);
13075 SET_Uniform2i(table
, save_Uniform2iARB
);
13076 SET_Uniform3i(table
, save_Uniform3iARB
);
13077 SET_Uniform4i(table
, save_Uniform4iARB
);
13078 SET_Uniform1iv(table
, save_Uniform1ivARB
);
13079 SET_Uniform2iv(table
, save_Uniform2ivARB
);
13080 SET_Uniform3iv(table
, save_Uniform3ivARB
);
13081 SET_Uniform4iv(table
, save_Uniform4ivARB
);
13082 SET_UniformMatrix2fv(table
, save_UniformMatrix2fvARB
);
13083 SET_UniformMatrix3fv(table
, save_UniformMatrix3fvARB
);
13084 SET_UniformMatrix4fv(table
, save_UniformMatrix4fvARB
);
13085 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
13086 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
13087 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
13088 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
13089 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
13090 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
13092 /* 299. GL_EXT_blend_equation_separate */
13093 SET_BlendEquationSeparate(table
, save_BlendEquationSeparateEXT
);
13095 /* GL_EXT_gpu_program_parameters */
13096 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
13097 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
13099 /* 364. GL_EXT_provoking_vertex */
13100 SET_ProvokingVertex(table
, save_ProvokingVertexEXT
);
13102 /* GL_EXT_texture_integer */
13103 SET_ClearColorIiEXT(table
, save_ClearColorIi
);
13104 SET_ClearColorIuiEXT(table
, save_ClearColorIui
);
13105 SET_TexParameterIiv(table
, save_TexParameterIiv
);
13106 SET_TexParameterIuiv(table
, save_TexParameterIuiv
);
13108 /* GL_ARB_clip_control */
13109 SET_ClipControl(table
, save_ClipControl
);
13111 /* GL_ARB_color_buffer_float */
13112 SET_ClampColor(table
, save_ClampColorARB
);
13115 SET_ClearBufferiv(table
, save_ClearBufferiv
);
13116 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
13117 SET_ClearBufferfv(table
, save_ClearBufferfv
);
13118 SET_ClearBufferfi(table
, save_ClearBufferfi
);
13119 SET_Uniform1ui(table
, save_Uniform1ui
);
13120 SET_Uniform2ui(table
, save_Uniform2ui
);
13121 SET_Uniform3ui(table
, save_Uniform3ui
);
13122 SET_Uniform4ui(table
, save_Uniform4ui
);
13123 SET_Uniform1uiv(table
, save_Uniform1uiv
);
13124 SET_Uniform2uiv(table
, save_Uniform2uiv
);
13125 SET_Uniform3uiv(table
, save_Uniform3uiv
);
13126 SET_Uniform4uiv(table
, save_Uniform4uiv
);
13128 /* GL_ARB_gpu_shader_fp64 */
13129 SET_Uniform1d(table
, save_Uniform1d
);
13130 SET_Uniform2d(table
, save_Uniform2d
);
13131 SET_Uniform3d(table
, save_Uniform3d
);
13132 SET_Uniform4d(table
, save_Uniform4d
);
13133 SET_Uniform1dv(table
, save_Uniform1dv
);
13134 SET_Uniform2dv(table
, save_Uniform2dv
);
13135 SET_Uniform3dv(table
, save_Uniform3dv
);
13136 SET_Uniform4dv(table
, save_Uniform4dv
);
13137 SET_UniformMatrix2dv(table
, save_UniformMatrix2dv
);
13138 SET_UniformMatrix3dv(table
, save_UniformMatrix3dv
);
13139 SET_UniformMatrix4dv(table
, save_UniformMatrix4dv
);
13140 SET_UniformMatrix2x3dv(table
, save_UniformMatrix2x3dv
);
13141 SET_UniformMatrix3x2dv(table
, save_UniformMatrix3x2dv
);
13142 SET_UniformMatrix2x4dv(table
, save_UniformMatrix2x4dv
);
13143 SET_UniformMatrix4x2dv(table
, save_UniformMatrix4x2dv
);
13144 SET_UniformMatrix3x4dv(table
, save_UniformMatrix3x4dv
);
13145 SET_UniformMatrix4x3dv(table
, save_UniformMatrix4x3dv
);
13148 SET_BeginTransformFeedback(table
, save_BeginTransformFeedback
);
13149 SET_EndTransformFeedback(table
, save_EndTransformFeedback
);
13150 SET_BindTransformFeedback(table
, save_BindTransformFeedback
);
13151 SET_PauseTransformFeedback(table
, save_PauseTransformFeedback
);
13152 SET_ResumeTransformFeedback(table
, save_ResumeTransformFeedback
);
13153 SET_DrawTransformFeedback(table
, save_DrawTransformFeedback
);
13154 SET_DrawTransformFeedbackStream(table
, save_DrawTransformFeedbackStream
);
13155 SET_DrawTransformFeedbackInstanced(table
,
13156 save_DrawTransformFeedbackInstanced
);
13157 SET_DrawTransformFeedbackStreamInstanced(table
,
13158 save_DrawTransformFeedbackStreamInstanced
);
13159 SET_BeginQueryIndexed(table
, save_BeginQueryIndexed
);
13160 SET_EndQueryIndexed(table
, save_EndQueryIndexed
);
13162 /* GL_ARB_instanced_arrays */
13163 SET_VertexAttribDivisor(table
, save_VertexAttribDivisor
);
13165 /* GL_NV_texture_barrier */
13166 SET_TextureBarrierNV(table
, save_TextureBarrierNV
);
13168 SET_BindSampler(table
, save_BindSampler
);
13169 SET_SamplerParameteri(table
, save_SamplerParameteri
);
13170 SET_SamplerParameterf(table
, save_SamplerParameterf
);
13171 SET_SamplerParameteriv(table
, save_SamplerParameteriv
);
13172 SET_SamplerParameterfv(table
, save_SamplerParameterfv
);
13173 SET_SamplerParameterIiv(table
, save_SamplerParameterIiv
);
13174 SET_SamplerParameterIuiv(table
, save_SamplerParameterIuiv
);
13176 /* GL_ARB_draw_buffer_blend */
13177 SET_BlendFunciARB(table
, save_BlendFunci
);
13178 SET_BlendFuncSeparateiARB(table
, save_BlendFuncSeparatei
);
13179 SET_BlendEquationiARB(table
, save_BlendEquationi
);
13180 SET_BlendEquationSeparateiARB(table
, save_BlendEquationSeparatei
);
13182 /* GL_NV_conditional_render */
13183 SET_BeginConditionalRender(table
, save_BeginConditionalRender
);
13184 SET_EndConditionalRender(table
, save_EndConditionalRender
);
13187 SET_WaitSync(table
, save_WaitSync
);
13189 /* GL_ARB_uniform_buffer_object */
13190 SET_UniformBlockBinding(table
, save_UniformBlockBinding
);
13192 /* GL_ARB_shader_subroutines */
13193 SET_UniformSubroutinesuiv(table
, save_UniformSubroutinesuiv
);
13195 /* GL_ARB_draw_instanced */
13196 SET_DrawArraysInstancedARB(table
, save_DrawArraysInstancedARB
);
13197 SET_DrawElementsInstancedARB(table
, save_DrawElementsInstancedARB
);
13199 /* GL_ARB_draw_elements_base_vertex */
13200 SET_DrawElementsInstancedBaseVertex(table
, save_DrawElementsInstancedBaseVertexARB
);
13202 /* GL_ARB_base_instance */
13203 SET_DrawArraysInstancedBaseInstance(table
, save_DrawArraysInstancedBaseInstance
);
13204 SET_DrawElementsInstancedBaseInstance(table
, save_DrawElementsInstancedBaseInstance
);
13205 SET_DrawElementsInstancedBaseVertexBaseInstance(table
, save_DrawElementsInstancedBaseVertexBaseInstance
);
13207 /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
13208 SET_DrawArraysIndirect(table
, save_DrawArraysIndirect
);
13209 SET_DrawElementsIndirect(table
, save_DrawElementsIndirect
);
13210 SET_MultiDrawArraysIndirect(table
, save_MultiDrawArraysIndirect
);
13211 SET_MultiDrawElementsIndirect(table
, save_MultiDrawElementsIndirect
);
13213 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
13214 SET_UseProgramStages(table
, save_UseProgramStages
);
13215 SET_ProgramUniform1f(table
, save_ProgramUniform1f
);
13216 SET_ProgramUniform2f(table
, save_ProgramUniform2f
);
13217 SET_ProgramUniform3f(table
, save_ProgramUniform3f
);
13218 SET_ProgramUniform4f(table
, save_ProgramUniform4f
);
13219 SET_ProgramUniform1fv(table
, save_ProgramUniform1fv
);
13220 SET_ProgramUniform2fv(table
, save_ProgramUniform2fv
);
13221 SET_ProgramUniform3fv(table
, save_ProgramUniform3fv
);
13222 SET_ProgramUniform4fv(table
, save_ProgramUniform4fv
);
13223 SET_ProgramUniform1d(table
, save_ProgramUniform1d
);
13224 SET_ProgramUniform2d(table
, save_ProgramUniform2d
);
13225 SET_ProgramUniform3d(table
, save_ProgramUniform3d
);
13226 SET_ProgramUniform4d(table
, save_ProgramUniform4d
);
13227 SET_ProgramUniform1dv(table
, save_ProgramUniform1dv
);
13228 SET_ProgramUniform2dv(table
, save_ProgramUniform2dv
);
13229 SET_ProgramUniform3dv(table
, save_ProgramUniform3dv
);
13230 SET_ProgramUniform4dv(table
, save_ProgramUniform4dv
);
13231 SET_ProgramUniform1i(table
, save_ProgramUniform1i
);
13232 SET_ProgramUniform2i(table
, save_ProgramUniform2i
);
13233 SET_ProgramUniform3i(table
, save_ProgramUniform3i
);
13234 SET_ProgramUniform4i(table
, save_ProgramUniform4i
);
13235 SET_ProgramUniform1iv(table
, save_ProgramUniform1iv
);
13236 SET_ProgramUniform2iv(table
, save_ProgramUniform2iv
);
13237 SET_ProgramUniform3iv(table
, save_ProgramUniform3iv
);
13238 SET_ProgramUniform4iv(table
, save_ProgramUniform4iv
);
13239 SET_ProgramUniform1ui(table
, save_ProgramUniform1ui
);
13240 SET_ProgramUniform2ui(table
, save_ProgramUniform2ui
);
13241 SET_ProgramUniform3ui(table
, save_ProgramUniform3ui
);
13242 SET_ProgramUniform4ui(table
, save_ProgramUniform4ui
);
13243 SET_ProgramUniform1uiv(table
, save_ProgramUniform1uiv
);
13244 SET_ProgramUniform2uiv(table
, save_ProgramUniform2uiv
);
13245 SET_ProgramUniform3uiv(table
, save_ProgramUniform3uiv
);
13246 SET_ProgramUniform4uiv(table
, save_ProgramUniform4uiv
);
13247 SET_ProgramUniformMatrix2fv(table
, save_ProgramUniformMatrix2fv
);
13248 SET_ProgramUniformMatrix3fv(table
, save_ProgramUniformMatrix3fv
);
13249 SET_ProgramUniformMatrix4fv(table
, save_ProgramUniformMatrix4fv
);
13250 SET_ProgramUniformMatrix2x3fv(table
, save_ProgramUniformMatrix2x3fv
);
13251 SET_ProgramUniformMatrix3x2fv(table
, save_ProgramUniformMatrix3x2fv
);
13252 SET_ProgramUniformMatrix2x4fv(table
, save_ProgramUniformMatrix2x4fv
);
13253 SET_ProgramUniformMatrix4x2fv(table
, save_ProgramUniformMatrix4x2fv
);
13254 SET_ProgramUniformMatrix3x4fv(table
, save_ProgramUniformMatrix3x4fv
);
13255 SET_ProgramUniformMatrix4x3fv(table
, save_ProgramUniformMatrix4x3fv
);
13256 SET_ProgramUniformMatrix2dv(table
, save_ProgramUniformMatrix2dv
);
13257 SET_ProgramUniformMatrix3dv(table
, save_ProgramUniformMatrix3dv
);
13258 SET_ProgramUniformMatrix4dv(table
, save_ProgramUniformMatrix4dv
);
13259 SET_ProgramUniformMatrix2x3dv(table
, save_ProgramUniformMatrix2x3dv
);
13260 SET_ProgramUniformMatrix3x2dv(table
, save_ProgramUniformMatrix3x2dv
);
13261 SET_ProgramUniformMatrix2x4dv(table
, save_ProgramUniformMatrix2x4dv
);
13262 SET_ProgramUniformMatrix4x2dv(table
, save_ProgramUniformMatrix4x2dv
);
13263 SET_ProgramUniformMatrix3x4dv(table
, save_ProgramUniformMatrix3x4dv
);
13264 SET_ProgramUniformMatrix4x3dv(table
, save_ProgramUniformMatrix4x3dv
);
13266 /* GL_{ARB,EXT}_polygon_offset_clamp */
13267 SET_PolygonOffsetClampEXT(table
, save_PolygonOffsetClampEXT
);
13269 /* GL_EXT_window_rectangles */
13270 SET_WindowRectanglesEXT(table
, save_WindowRectanglesEXT
);
13272 /* GL_NV_conservative_raster */
13273 SET_SubpixelPrecisionBiasNV(table
, save_SubpixelPrecisionBiasNV
);
13275 /* GL_NV_conservative_raster_dilate */
13276 SET_ConservativeRasterParameterfNV(table
, save_ConservativeRasterParameterfNV
);
13278 /* GL_NV_conservative_raster_pre_snap_triangles */
13279 SET_ConservativeRasterParameteriNV(table
, save_ConservativeRasterParameteriNV
);
13281 /* GL_EXT_direct_state_access */
13282 SET_MatrixLoadfEXT(table
, save_MatrixLoadfEXT
);
13283 SET_MatrixLoaddEXT(table
, save_MatrixLoaddEXT
);
13284 SET_MatrixMultfEXT(table
, save_MatrixMultfEXT
);
13285 SET_MatrixMultdEXT(table
, save_MatrixMultdEXT
);
13286 SET_MatrixRotatefEXT(table
, save_MatrixRotatefEXT
);
13287 SET_MatrixRotatedEXT(table
, save_MatrixRotatedEXT
);
13288 SET_MatrixScalefEXT(table
, save_MatrixScalefEXT
);
13289 SET_MatrixScaledEXT(table
, save_MatrixScaledEXT
);
13290 SET_MatrixTranslatefEXT(table
, save_MatrixTranslatefEXT
);
13291 SET_MatrixTranslatedEXT(table
, save_MatrixTranslatedEXT
);
13292 SET_MatrixLoadIdentityEXT(table
, save_MatrixLoadIdentityEXT
);
13293 SET_MatrixOrthoEXT(table
, save_MatrixOrthoEXT
);
13294 SET_MatrixFrustumEXT(table
, save_MatrixFrustumEXT
);
13295 SET_MatrixPushEXT(table
, save_MatrixPushEXT
);
13296 SET_MatrixPopEXT(table
, save_MatrixPopEXT
);
13297 SET_MatrixLoadTransposefEXT(table
, save_MatrixLoadTransposefEXT
);
13298 SET_MatrixLoadTransposedEXT(table
, save_MatrixLoadTransposedEXT
);
13299 SET_MatrixMultTransposefEXT(table
, save_MatrixMultTransposefEXT
);
13300 SET_MatrixMultTransposedEXT(table
, save_MatrixMultTransposedEXT
);
13301 SET_TextureParameteriEXT(table
, save_TextureParameteriEXT
);
13302 SET_TextureParameterivEXT(table
, save_TextureParameterivEXT
);
13303 SET_TextureParameterfEXT(table
, save_TextureParameterfEXT
);
13304 SET_TextureParameterfvEXT(table
, save_TextureParameterfvEXT
);
13305 SET_TextureImage1DEXT(table
, save_TextureImage1DEXT
);
13306 SET_TextureImage2DEXT(table
, save_TextureImage2DEXT
);
13307 SET_TextureImage3DEXT(table
, save_TextureImage3DEXT
);
13308 SET_TextureSubImage1DEXT(table
, save_TextureSubImage1DEXT
);
13309 SET_TextureSubImage2DEXT(table
, save_TextureSubImage2DEXT
);
13310 SET_TextureSubImage3DEXT(table
, save_TextureSubImage3DEXT
);
13311 SET_CopyTextureImage1DEXT(table
, save_CopyTextureImage1DEXT
);
13312 SET_CopyTextureImage2DEXT(table
, save_CopyTextureImage2DEXT
);
13313 SET_CopyTextureSubImage1DEXT(table
, save_CopyTextureSubImage1DEXT
);
13314 SET_CopyTextureSubImage2DEXT(table
, save_CopyTextureSubImage2DEXT
);
13315 SET_CopyTextureSubImage3DEXT(table
, save_CopyTextureSubImage3DEXT
);
13316 SET_BindMultiTextureEXT(table
, save_BindMultiTextureEXT
);
13317 SET_MultiTexParameteriEXT(table
, save_MultiTexParameteriEXT
);
13318 SET_MultiTexParameterivEXT(table
, save_MultiTexParameterivEXT
);
13319 SET_MultiTexParameterfEXT(table
, save_MultiTexParameterfEXT
);
13320 SET_MultiTexParameterfvEXT(table
, save_MultiTexParameterfvEXT
);
13321 SET_MultiTexImage1DEXT(table
, save_MultiTexImage1DEXT
);
13322 SET_MultiTexImage2DEXT(table
, save_MultiTexImage2DEXT
);
13323 SET_MultiTexImage3DEXT(table
, save_MultiTexImage3DEXT
);
13324 SET_MultiTexSubImage1DEXT(table
, save_MultiTexSubImage1DEXT
);
13325 SET_MultiTexSubImage2DEXT(table
, save_MultiTexSubImage2DEXT
);
13326 SET_MultiTexSubImage3DEXT(table
, save_MultiTexSubImage3DEXT
);
13327 SET_CopyMultiTexImage1DEXT(table
, save_CopyMultiTexImage1DEXT
);
13328 SET_CopyMultiTexImage2DEXT(table
, save_CopyMultiTexImage2DEXT
);
13329 SET_CopyMultiTexSubImage1DEXT(table
, save_CopyMultiTexSubImage1DEXT
);
13330 SET_CopyMultiTexSubImage2DEXT(table
, save_CopyMultiTexSubImage2DEXT
);
13331 SET_CopyMultiTexSubImage3DEXT(table
, save_CopyMultiTexSubImage3DEXT
);
13332 SET_MultiTexEnvfEXT(table
, save_MultiTexEnvfEXT
);
13333 SET_MultiTexEnvfvEXT(table
, save_MultiTexEnvfvEXT
);
13334 SET_MultiTexEnviEXT(table
, save_MultiTexEnviEXT
);
13335 SET_MultiTexEnvivEXT(table
, save_MultiTexEnvivEXT
);
13336 SET_CompressedTextureSubImage2DEXT(table
, save_CompressedTextureSubImage2DEXT
);
13341 static const char *
13342 enum_string(GLenum k
)
13344 return _mesa_enum_to_string(k
);
13349 * Print the commands in a display list. For debugging only.
13350 * TODO: many commands aren't handled yet.
13351 * \param fname filename to write display list to. If null, use stdout.
13353 static void GLAPIENTRY
13354 print_list(struct gl_context
*ctx
, GLuint list
, const char *fname
)
13356 struct gl_display_list
*dlist
;
13362 f
= fopen(fname
, "w");
13367 if (!islist(ctx
, list
)) {
13368 fprintf(f
, "%u is not a display list ID\n", list
);
13372 dlist
= _mesa_lookup_list(ctx
, list
);
13379 fprintf(f
, "START-LIST %u, address %p\n", list
, (void *) n
);
13381 done
= n
? GL_FALSE
: GL_TRUE
;
13383 const OpCode opcode
= n
[0].opcode
;
13385 if (is_ext_opcode(opcode
)) {
13386 n
+= ext_opcode_print(ctx
, n
, f
);
13391 fprintf(f
, "Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
13393 case OPCODE_ACTIVE_TEXTURE
:
13394 fprintf(f
, "ActiveTexture(%s)\n", enum_string(n
[1].e
));
13396 case OPCODE_BITMAP
:
13397 fprintf(f
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
13398 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
13399 get_pointer(&n
[7]));
13401 case OPCODE_BLEND_COLOR
:
13402 fprintf(f
, "BlendColor %f, %f, %f, %f\n",
13403 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
13405 case OPCODE_BLEND_EQUATION
:
13406 fprintf(f
, "BlendEquation %s\n",
13407 enum_string(n
[1].e
));
13409 case OPCODE_BLEND_EQUATION_SEPARATE
:
13410 fprintf(f
, "BlendEquationSeparate %s, %s\n",
13411 enum_string(n
[1].e
),
13412 enum_string(n
[2].e
));
13414 case OPCODE_BLEND_FUNC_SEPARATE
:
13415 fprintf(f
, "BlendFuncSeparate %s, %s, %s, %s\n",
13416 enum_string(n
[1].e
),
13417 enum_string(n
[2].e
),
13418 enum_string(n
[3].e
),
13419 enum_string(n
[4].e
));
13421 case OPCODE_BLEND_EQUATION_I
:
13422 fprintf(f
, "BlendEquationi %u, %s\n",
13423 n
[1].ui
, enum_string(n
[2].e
));
13425 case OPCODE_BLEND_EQUATION_SEPARATE_I
:
13426 fprintf(f
, "BlendEquationSeparatei %u, %s, %s\n",
13427 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
13429 case OPCODE_BLEND_FUNC_I
:
13430 fprintf(f
, "BlendFunci %u, %s, %s\n",
13431 n
[1].ui
, enum_string(n
[2].e
), enum_string(n
[3].e
));
13433 case OPCODE_BLEND_FUNC_SEPARATE_I
:
13434 fprintf(f
, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
13436 enum_string(n
[2].e
),
13437 enum_string(n
[3].e
),
13438 enum_string(n
[4].e
),
13439 enum_string(n
[5].e
));
13441 case OPCODE_CALL_LIST
:
13442 fprintf(f
, "CallList %d\n", (int) n
[1].ui
);
13444 case OPCODE_CALL_LISTS
:
13445 fprintf(f
, "CallLists %d, %s\n", n
[1].i
, enum_string(n
[1].e
));
13447 case OPCODE_DISABLE
:
13448 fprintf(f
, "Disable %s\n", enum_string(n
[1].e
));
13450 case OPCODE_ENABLE
:
13451 fprintf(f
, "Enable %s\n", enum_string(n
[1].e
));
13453 case OPCODE_FRUSTUM
:
13454 fprintf(f
, "Frustum %g %g %g %g %g %g\n",
13455 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
13457 case OPCODE_LINE_STIPPLE
:
13458 fprintf(f
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
13460 case OPCODE_LINE_WIDTH
:
13461 fprintf(f
, "LineWidth %f\n", n
[1].f
);
13463 case OPCODE_LOAD_IDENTITY
:
13464 fprintf(f
, "LoadIdentity\n");
13466 case OPCODE_LOAD_MATRIX
:
13467 fprintf(f
, "LoadMatrix\n");
13468 fprintf(f
, " %8f %8f %8f %8f\n",
13469 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
13470 fprintf(f
, " %8f %8f %8f %8f\n",
13471 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
13472 fprintf(f
, " %8f %8f %8f %8f\n",
13473 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
13474 fprintf(f
, " %8f %8f %8f %8f\n",
13475 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
13477 case OPCODE_MULT_MATRIX
:
13478 fprintf(f
, "MultMatrix (or Rotate)\n");
13479 fprintf(f
, " %8f %8f %8f %8f\n",
13480 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
13481 fprintf(f
, " %8f %8f %8f %8f\n",
13482 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
13483 fprintf(f
, " %8f %8f %8f %8f\n",
13484 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
13485 fprintf(f
, " %8f %8f %8f %8f\n",
13486 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
13489 fprintf(f
, "Ortho %g %g %g %g %g %g\n",
13490 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
13492 case OPCODE_POINT_SIZE
:
13493 fprintf(f
, "PointSize %f\n", n
[1].f
);
13495 case OPCODE_POP_ATTRIB
:
13496 fprintf(f
, "PopAttrib\n");
13498 case OPCODE_POP_MATRIX
:
13499 fprintf(f
, "PopMatrix\n");
13501 case OPCODE_POP_NAME
:
13502 fprintf(f
, "PopName\n");
13504 case OPCODE_PUSH_ATTRIB
:
13505 fprintf(f
, "PushAttrib %x\n", n
[1].bf
);
13507 case OPCODE_PUSH_MATRIX
:
13508 fprintf(f
, "PushMatrix\n");
13510 case OPCODE_PUSH_NAME
:
13511 fprintf(f
, "PushName %d\n", (int) n
[1].ui
);
13513 case OPCODE_RASTER_POS
:
13514 fprintf(f
, "RasterPos %g %g %g %g\n",
13515 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
13517 case OPCODE_ROTATE
:
13518 fprintf(f
, "Rotate %g %g %g %g\n",
13519 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
13522 fprintf(f
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
13524 case OPCODE_TRANSLATE
:
13525 fprintf(f
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
13527 case OPCODE_BIND_TEXTURE
:
13528 fprintf(f
, "BindTexture %s %d\n",
13529 _mesa_enum_to_string(n
[1].ui
), n
[2].ui
);
13531 case OPCODE_SHADE_MODEL
:
13532 fprintf(f
, "ShadeModel %s\n", _mesa_enum_to_string(n
[1].ui
));
13535 fprintf(f
, "Map1 %s %.3f %.3f %d %d\n",
13536 _mesa_enum_to_string(n
[1].ui
),
13537 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
13540 fprintf(f
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
13541 _mesa_enum_to_string(n
[1].ui
),
13542 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
13543 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
13545 case OPCODE_MAPGRID1
:
13546 fprintf(f
, "MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
13548 case OPCODE_MAPGRID2
:
13549 fprintf(f
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
13550 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
13552 case OPCODE_EVALMESH1
:
13553 fprintf(f
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
13555 case OPCODE_EVALMESH2
:
13556 fprintf(f
, "EvalMesh2 %d %d %d %d\n",
13557 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
13560 case OPCODE_ATTR_1F_NV
:
13561 fprintf(f
, "ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
13563 case OPCODE_ATTR_2F_NV
:
13564 fprintf(f
, "ATTR_2F_NV attr %d: %f %f\n",
13565 n
[1].i
, n
[2].f
, n
[3].f
);
13567 case OPCODE_ATTR_3F_NV
:
13568 fprintf(f
, "ATTR_3F_NV attr %d: %f %f %f\n",
13569 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
13571 case OPCODE_ATTR_4F_NV
:
13572 fprintf(f
, "ATTR_4F_NV attr %d: %f %f %f %f\n",
13573 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
13575 case OPCODE_ATTR_1F_ARB
:
13576 fprintf(f
, "ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
13578 case OPCODE_ATTR_2F_ARB
:
13579 fprintf(f
, "ATTR_2F_ARB attr %d: %f %f\n",
13580 n
[1].i
, n
[2].f
, n
[3].f
);
13582 case OPCODE_ATTR_3F_ARB
:
13583 fprintf(f
, "ATTR_3F_ARB attr %d: %f %f %f\n",
13584 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
13586 case OPCODE_ATTR_4F_ARB
:
13587 fprintf(f
, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
13588 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
13591 case OPCODE_MATERIAL
:
13592 fprintf(f
, "MATERIAL %x %x: %f %f %f %f\n",
13593 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
13596 fprintf(f
, "BEGIN %x\n", n
[1].i
);
13599 fprintf(f
, "END\n");
13602 fprintf(f
, "RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
13605 case OPCODE_EVAL_C1
:
13606 fprintf(f
, "EVAL_C1 %f\n", n
[1].f
);
13608 case OPCODE_EVAL_C2
:
13609 fprintf(f
, "EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
13611 case OPCODE_EVAL_P1
:
13612 fprintf(f
, "EVAL_P1 %d\n", n
[1].i
);
13614 case OPCODE_EVAL_P2
:
13615 fprintf(f
, "EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
13618 case OPCODE_PROVOKING_VERTEX
:
13619 fprintf(f
, "ProvokingVertex %s\n",
13620 _mesa_enum_to_string(n
[1].ui
));
13624 * meta opcodes/commands
13627 fprintf(f
, "Error: %s %s\n", enum_string(n
[1].e
),
13628 (const char *) get_pointer(&n
[2]));
13630 case OPCODE_CONTINUE
:
13631 fprintf(f
, "DISPLAY-LIST-CONTINUE\n");
13632 n
= (Node
*) get_pointer(&n
[1]);
13635 fprintf(f
, "NOP\n");
13637 case OPCODE_END_OF_LIST
:
13638 fprintf(f
, "END-LIST %u\n", list
);
13642 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
13644 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
13645 opcode
, (void *) n
);
13649 fprintf(f
, "command %d, %u operands\n", opcode
,
13653 /* increment n to point to next compiled command */
13654 if (opcode
!= OPCODE_CONTINUE
) {
13655 assert(InstSize
[opcode
] > 0);
13656 n
+= InstSize
[opcode
];
13670 * Clients may call this function to help debug display list problems.
13671 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
13672 * changed, or break in the future without notice.
13675 mesa_print_display_list(GLuint list
)
13677 GET_CURRENT_CONTEXT(ctx
);
13678 print_list(ctx
, list
, NULL
);
13682 /**********************************************************************/
13683 /***** Initialization *****/
13684 /**********************************************************************/
13687 save_vtxfmt_init(GLvertexformat
* vfmt
)
13689 vfmt
->ArrayElement
= _ae_ArrayElement
;
13691 vfmt
->Begin
= save_Begin
;
13693 vfmt
->CallList
= save_CallList
;
13694 vfmt
->CallLists
= save_CallLists
;
13696 vfmt
->Color3f
= save_Color3f
;
13697 vfmt
->Color3fv
= save_Color3fv
;
13698 vfmt
->Color4f
= save_Color4f
;
13699 vfmt
->Color4fv
= save_Color4fv
;
13700 vfmt
->EdgeFlag
= save_EdgeFlag
;
13701 vfmt
->End
= save_End
;
13703 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
13704 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
13705 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
13706 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
13707 vfmt
->EvalPoint1
= save_EvalPoint1
;
13708 vfmt
->EvalPoint2
= save_EvalPoint2
;
13710 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
13711 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
13712 vfmt
->Indexf
= save_Indexf
;
13713 vfmt
->Indexfv
= save_Indexfv
;
13714 vfmt
->Materialfv
= save_Materialfv
;
13715 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
13716 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
13717 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
13718 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
13719 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
13720 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
13721 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
13722 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
13723 vfmt
->Normal3f
= save_Normal3f
;
13724 vfmt
->Normal3fv
= save_Normal3fv
;
13725 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
13726 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
13727 vfmt
->TexCoord1f
= save_TexCoord1f
;
13728 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
13729 vfmt
->TexCoord2f
= save_TexCoord2f
;
13730 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
13731 vfmt
->TexCoord3f
= save_TexCoord3f
;
13732 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
13733 vfmt
->TexCoord4f
= save_TexCoord4f
;
13734 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
13735 vfmt
->Vertex2f
= save_Vertex2f
;
13736 vfmt
->Vertex2fv
= save_Vertex2fv
;
13737 vfmt
->Vertex3f
= save_Vertex3f
;
13738 vfmt
->Vertex3fv
= save_Vertex3fv
;
13739 vfmt
->Vertex4f
= save_Vertex4f
;
13740 vfmt
->Vertex4fv
= save_Vertex4fv
;
13741 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
13742 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
13743 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
13744 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
13745 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
13746 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
13747 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
13748 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
13749 vfmt
->VertexAttribL1d
= save_VertexAttribL1d
;
13750 vfmt
->VertexAttribL1dv
= save_VertexAttribL1dv
;
13751 vfmt
->VertexAttribL2d
= save_VertexAttribL2d
;
13752 vfmt
->VertexAttribL2dv
= save_VertexAttribL2dv
;
13753 vfmt
->VertexAttribL3d
= save_VertexAttribL3d
;
13754 vfmt
->VertexAttribL3dv
= save_VertexAttribL3dv
;
13755 vfmt
->VertexAttribL4d
= save_VertexAttribL4d
;
13756 vfmt
->VertexAttribL4dv
= save_VertexAttribL4dv
;
13758 vfmt
->PrimitiveRestartNV
= save_PrimitiveRestartNV
;
13763 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
13764 const GLvertexformat
*vfmt
)
13766 SET_CallList(disp
, vfmt
->CallList
);
13767 SET_CallLists(disp
, vfmt
->CallLists
);
13772 * Initialize display list state for given context.
13775 _mesa_init_display_list(struct gl_context
*ctx
)
13777 static GLboolean tableInitialized
= GL_FALSE
;
13779 /* zero-out the instruction size table, just once */
13780 if (!tableInitialized
) {
13781 memset(InstSize
, 0, sizeof(InstSize
));
13782 tableInitialized
= GL_TRUE
;
13785 /* extension info */
13786 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
13789 ctx
->ListState
.CallDepth
= 0;
13790 ctx
->ExecuteFlag
= GL_TRUE
;
13791 ctx
->CompileFlag
= GL_FALSE
;
13792 ctx
->ListState
.CurrentBlock
= NULL
;
13793 ctx
->ListState
.CurrentPos
= 0;
13795 /* Display List group */
13796 ctx
->List
.ListBase
= 0;
13798 save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
13800 InstSize
[OPCODE_NOP
] = 1;
13805 _mesa_free_display_list_data(struct gl_context
*ctx
)
13807 free(ctx
->ListExt
);
13808 ctx
->ListExt
= NULL
;