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 "draw_validate.h"
38 #include "atifragshader.h"
40 #include "bufferobj.h"
47 #include "framebuffer.h"
48 #include "glapi/glapi.h"
49 #include "glformats.h"
57 #include "samplerobj.h"
58 #include "shaderapi.h"
61 #include "texstorage.h"
64 #include "arbprogram.h"
65 #include "transformfeedback.h"
66 #include "glthread_marshal.h"
68 #include "math/m_matrix.h"
70 #include "main/dispatch.h"
73 #include "vbo/vbo_util.h"
74 #include "vbo/vbo_save.h"
75 #include "util/format_r11g11b10f.h"
77 #include "util/u_memory.h"
79 #define USE_BITMAP_ATLAS 1
84 * \param ctx GL context.
86 * Checks if dd_function_table::SaveNeedFlush is marked to flush
87 * stored (save) vertices, and calls vbo_save_SaveFlushVertices if so.
89 #define SAVE_FLUSH_VERTICES(ctx) \
91 if (ctx->Driver.SaveNeedFlush) \
92 vbo_save_SaveFlushVertices(ctx); \
97 * Macro to assert that the API call was made outside the
98 * glBegin()/glEnd() pair, with return value.
100 * \param ctx GL context.
101 * \param retval value to return value in case the assertion fails.
103 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
105 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
106 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
112 * Macro to assert that the API call was made outside the
113 * glBegin()/glEnd() pair.
115 * \param ctx GL context.
117 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
119 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
120 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
126 * Macro to assert that the API call was made outside the
127 * glBegin()/glEnd() pair and flush the vertices.
129 * \param ctx GL context.
131 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
133 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
134 SAVE_FLUSH_VERTICES(ctx); \
138 * Macro to assert that the API call was made outside the
139 * glBegin()/glEnd() pair and flush the vertices, with return value.
141 * \param ctx GL context.
142 * \param retval value to return value in case the assertion fails.
144 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) \
146 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
147 SAVE_FLUSH_VERTICES(ctx); \
152 * Display list opcodes.
156 OPCODE_INVALID = -1, /* Force signed enum */
162 OPCODE_BLEND_EQUATION,
163 OPCODE_BLEND_EQUATION_SEPARATE,
164 OPCODE_BLEND_FUNC_SEPARATE,
166 OPCODE_BLEND_EQUATION_I,
167 OPCODE_BLEND_EQUATION_SEPARATE_I,
169 OPCODE_BLEND_FUNC_SEPARATE_I,
178 OPCODE_CLEAR_STENCIL,
179 OPCODE_CLEAR_BUFFER_IV,
180 OPCODE_CLEAR_BUFFER_UIV,
181 OPCODE_CLEAR_BUFFER_FV,
182 OPCODE_CLEAR_BUFFER_FI,
185 OPCODE_COLOR_MASK_INDEXED,
186 OPCODE_COLOR_MATERIAL,
188 OPCODE_COPY_TEX_IMAGE1D,
189 OPCODE_COPY_TEX_IMAGE2D,
190 OPCODE_COPY_TEX_SUB_IMAGE1D,
191 OPCODE_COPY_TEX_SUB_IMAGE2D,
192 OPCODE_COPY_TEX_SUB_IMAGE3D,
198 OPCODE_DISABLE_INDEXED,
202 OPCODE_ENABLE_INDEXED,
216 OPCODE_LOAD_IDENTITY,
229 OPCODE_PIXEL_TRANSFER,
232 OPCODE_POINT_PARAMETERS,
234 OPCODE_POLYGON_STIPPLE,
235 OPCODE_POLYGON_OFFSET,
239 OPCODE_PRIORITIZE_TEXTURE,
248 OPCODE_SELECT_TEXTURE_SGIS,
249 OPCODE_SELECT_TEXTURE_COORD_SET,
260 OPCODE_TEX_SUB_IMAGE1D,
261 OPCODE_TEX_SUB_IMAGE2D,
262 OPCODE_TEX_SUB_IMAGE3D,
266 /* ARB_viewport_array */
267 OPCODE_VIEWPORT_ARRAY_V,
268 OPCODE_VIEWPORT_INDEXED_F,
269 OPCODE_VIEWPORT_INDEXED_FV,
270 OPCODE_SCISSOR_ARRAY_V,
271 OPCODE_SCISSOR_INDEXED,
272 OPCODE_SCISSOR_INDEXED_V,
273 OPCODE_DEPTH_ARRAY_V,
274 OPCODE_DEPTH_INDEXED,
275 /* GL_ARB_multitexture */
276 OPCODE_ACTIVE_TEXTURE,
277 /* GL_ARB_texture_compression */
278 OPCODE_COMPRESSED_TEX_IMAGE_1D,
279 OPCODE_COMPRESSED_TEX_IMAGE_2D,
280 OPCODE_COMPRESSED_TEX_IMAGE_3D,
281 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D,
282 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D,
283 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D,
284 /* GL_ARB_multisample */
285 OPCODE_SAMPLE_COVERAGE,
286 /* GL_ARB_window_pos */
287 OPCODE_WINDOW_POS_ARB,
288 /* GL_ARB_vertex_program */
289 OPCODE_BIND_PROGRAM_ARB,
290 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB,
291 /* GL_EXT_stencil_two_side */
292 OPCODE_ACTIVE_STENCIL_FACE_EXT,
293 /* GL_EXT_depth_bounds_test */
294 OPCODE_DEPTH_BOUNDS_EXT,
295 /* GL_ARB_vertex/fragment_program */
296 OPCODE_PROGRAM_STRING_ARB,
297 OPCODE_PROGRAM_ENV_PARAMETER_ARB,
298 /* GL_ARB_occlusion_query */
299 OPCODE_BEGIN_QUERY_ARB,
300 OPCODE_END_QUERY_ARB,
301 /* GL_ARB_draw_buffers */
302 OPCODE_DRAW_BUFFERS_ARB,
303 /* GL_ATI_fragment_shader */
304 OPCODE_BIND_FRAGMENT_SHADER_ATI,
305 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI,
307 OPCODE_STENCIL_FUNC_SEPARATE,
308 OPCODE_STENCIL_OP_SEPARATE,
309 OPCODE_STENCIL_MASK_SEPARATE,
310 /* GL_NV_primitive_restart */
311 OPCODE_PRIMITIVE_RESTART_NV,
312 /* GL_ARB_shader_objects */
330 OPCODE_UNIFORM_MATRIX22,
331 OPCODE_UNIFORM_MATRIX33,
332 OPCODE_UNIFORM_MATRIX44,
333 OPCODE_UNIFORM_MATRIX23,
334 OPCODE_UNIFORM_MATRIX32,
335 OPCODE_UNIFORM_MATRIX24,
336 OPCODE_UNIFORM_MATRIX42,
337 OPCODE_UNIFORM_MATRIX34,
338 OPCODE_UNIFORM_MATRIX43,
350 /* GL_ARB_gpu_shader_fp64 */
359 OPCODE_UNIFORM_MATRIX22D,
360 OPCODE_UNIFORM_MATRIX33D,
361 OPCODE_UNIFORM_MATRIX44D,
362 OPCODE_UNIFORM_MATRIX23D,
363 OPCODE_UNIFORM_MATRIX32D,
364 OPCODE_UNIFORM_MATRIX24D,
365 OPCODE_UNIFORM_MATRIX42D,
366 OPCODE_UNIFORM_MATRIX34D,
367 OPCODE_UNIFORM_MATRIX43D,
369 /* GL_ARB_gpu_shader_int64 */
374 OPCODE_UNIFORM_1I64V,
375 OPCODE_UNIFORM_2I64V,
376 OPCODE_UNIFORM_3I64V,
377 OPCODE_UNIFORM_4I64V,
378 OPCODE_UNIFORM_1UI64,
379 OPCODE_UNIFORM_2UI64,
380 OPCODE_UNIFORM_3UI64,
381 OPCODE_UNIFORM_4UI64,
382 OPCODE_UNIFORM_1UI64V,
383 OPCODE_UNIFORM_2UI64V,
384 OPCODE_UNIFORM_3UI64V,
385 OPCODE_UNIFORM_4UI64V,
386 OPCODE_PROGRAM_UNIFORM_1I64,
387 OPCODE_PROGRAM_UNIFORM_2I64,
388 OPCODE_PROGRAM_UNIFORM_3I64,
389 OPCODE_PROGRAM_UNIFORM_4I64,
390 OPCODE_PROGRAM_UNIFORM_1I64V,
391 OPCODE_PROGRAM_UNIFORM_2I64V,
392 OPCODE_PROGRAM_UNIFORM_3I64V,
393 OPCODE_PROGRAM_UNIFORM_4I64V,
394 OPCODE_PROGRAM_UNIFORM_1UI64,
395 OPCODE_PROGRAM_UNIFORM_2UI64,
396 OPCODE_PROGRAM_UNIFORM_3UI64,
397 OPCODE_PROGRAM_UNIFORM_4UI64,
398 OPCODE_PROGRAM_UNIFORM_1UI64V,
399 OPCODE_PROGRAM_UNIFORM_2UI64V,
400 OPCODE_PROGRAM_UNIFORM_3UI64V,
401 OPCODE_PROGRAM_UNIFORM_4UI64V,
403 /* OpenGL 4.0 / GL_ARB_tessellation_shader */
404 OPCODE_PATCH_PARAMETER_I,
405 OPCODE_PATCH_PARAMETER_FV_INNER,
406 OPCODE_PATCH_PARAMETER_FV_OUTER,
408 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
409 OPCODE_USE_PROGRAM_STAGES,
410 OPCODE_PROGRAM_UNIFORM_1F,
411 OPCODE_PROGRAM_UNIFORM_2F,
412 OPCODE_PROGRAM_UNIFORM_3F,
413 OPCODE_PROGRAM_UNIFORM_4F,
414 OPCODE_PROGRAM_UNIFORM_1FV,
415 OPCODE_PROGRAM_UNIFORM_2FV,
416 OPCODE_PROGRAM_UNIFORM_3FV,
417 OPCODE_PROGRAM_UNIFORM_4FV,
418 OPCODE_PROGRAM_UNIFORM_1D,
419 OPCODE_PROGRAM_UNIFORM_2D,
420 OPCODE_PROGRAM_UNIFORM_3D,
421 OPCODE_PROGRAM_UNIFORM_4D,
422 OPCODE_PROGRAM_UNIFORM_1DV,
423 OPCODE_PROGRAM_UNIFORM_2DV,
424 OPCODE_PROGRAM_UNIFORM_3DV,
425 OPCODE_PROGRAM_UNIFORM_4DV,
426 OPCODE_PROGRAM_UNIFORM_1I,
427 OPCODE_PROGRAM_UNIFORM_2I,
428 OPCODE_PROGRAM_UNIFORM_3I,
429 OPCODE_PROGRAM_UNIFORM_4I,
430 OPCODE_PROGRAM_UNIFORM_1IV,
431 OPCODE_PROGRAM_UNIFORM_2IV,
432 OPCODE_PROGRAM_UNIFORM_3IV,
433 OPCODE_PROGRAM_UNIFORM_4IV,
434 OPCODE_PROGRAM_UNIFORM_1UI,
435 OPCODE_PROGRAM_UNIFORM_2UI,
436 OPCODE_PROGRAM_UNIFORM_3UI,
437 OPCODE_PROGRAM_UNIFORM_4UI,
438 OPCODE_PROGRAM_UNIFORM_1UIV,
439 OPCODE_PROGRAM_UNIFORM_2UIV,
440 OPCODE_PROGRAM_UNIFORM_3UIV,
441 OPCODE_PROGRAM_UNIFORM_4UIV,
442 OPCODE_PROGRAM_UNIFORM_MATRIX22F,
443 OPCODE_PROGRAM_UNIFORM_MATRIX33F,
444 OPCODE_PROGRAM_UNIFORM_MATRIX44F,
445 OPCODE_PROGRAM_UNIFORM_MATRIX23F,
446 OPCODE_PROGRAM_UNIFORM_MATRIX32F,
447 OPCODE_PROGRAM_UNIFORM_MATRIX24F,
448 OPCODE_PROGRAM_UNIFORM_MATRIX42F,
449 OPCODE_PROGRAM_UNIFORM_MATRIX34F,
450 OPCODE_PROGRAM_UNIFORM_MATRIX43F,
451 OPCODE_PROGRAM_UNIFORM_MATRIX22D,
452 OPCODE_PROGRAM_UNIFORM_MATRIX33D,
453 OPCODE_PROGRAM_UNIFORM_MATRIX44D,
454 OPCODE_PROGRAM_UNIFORM_MATRIX23D,
455 OPCODE_PROGRAM_UNIFORM_MATRIX32D,
456 OPCODE_PROGRAM_UNIFORM_MATRIX24D,
457 OPCODE_PROGRAM_UNIFORM_MATRIX42D,
458 OPCODE_PROGRAM_UNIFORM_MATRIX34D,
459 OPCODE_PROGRAM_UNIFORM_MATRIX43D,
461 /* GL_ARB_clip_control */
464 /* GL_ARB_color_buffer_float */
467 /* GL_EXT_framebuffer_blit */
468 OPCODE_BLIT_FRAMEBUFFER,
470 /* Vertex attributes -- fallback for when optimized display
471 * list build isn't active.
498 /* GL_EXT_provoking_vertex */
499 OPCODE_PROVOKING_VERTEX,
501 /* GL_EXT_transform_feedback */
502 OPCODE_BEGIN_TRANSFORM_FEEDBACK,
503 OPCODE_END_TRANSFORM_FEEDBACK,
504 OPCODE_BIND_TRANSFORM_FEEDBACK,
505 OPCODE_PAUSE_TRANSFORM_FEEDBACK,
506 OPCODE_RESUME_TRANSFORM_FEEDBACK,
507 OPCODE_DRAW_TRANSFORM_FEEDBACK,
509 /* GL_EXT_texture_integer */
511 OPCODE_CLEARCOLOR_UI,
512 OPCODE_TEXPARAMETER_I,
513 OPCODE_TEXPARAMETER_UI,
515 /* GL_ARB_instanced_arrays */
516 OPCODE_VERTEX_ATTRIB_DIVISOR,
518 /* GL_NV_texture_barrier */
519 OPCODE_TEXTURE_BARRIER_NV,
521 /* GL_ARB_sampler_object */
523 OPCODE_SAMPLER_PARAMETERIV,
524 OPCODE_SAMPLER_PARAMETERFV,
525 OPCODE_SAMPLER_PARAMETERIIV,
526 OPCODE_SAMPLER_PARAMETERUIV,
528 /* ARB_compute_shader */
529 OPCODE_DISPATCH_COMPUTE,
534 /* GL_NV_conditional_render */
535 OPCODE_BEGIN_CONDITIONAL_RENDER,
536 OPCODE_END_CONDITIONAL_RENDER,
538 /* ARB_timer_query */
539 OPCODE_QUERY_COUNTER,
541 /* ARB_transform_feedback3 */
542 OPCODE_BEGIN_QUERY_INDEXED,
543 OPCODE_END_QUERY_INDEXED,
544 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM,
546 /* ARB_transform_feedback_instanced */
547 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED,
548 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED,
550 /* ARB_uniform_buffer_object */
551 OPCODE_UNIFORM_BLOCK_BINDING,
553 /* ARB_shader_subroutines */
554 OPCODE_UNIFORM_SUBROUTINES,
556 /* EXT_polygon_offset_clamp */
557 OPCODE_POLYGON_OFFSET_CLAMP,
559 /* EXT_window_rectangles */
560 OPCODE_WINDOW_RECTANGLES,
562 /* NV_conservative_raster */
563 OPCODE_SUBPIXEL_PRECISION_BIAS,
565 /* NV_conservative_raster_dilate */
566 OPCODE_CONSERVATIVE_RASTER_PARAMETER_F,
568 /* NV_conservative_raster_pre_snap_triangles */
569 OPCODE_CONSERVATIVE_RASTER_PARAMETER_I,
571 /* EXT_direct_state_access */
574 OPCODE_MATRIX_ROTATE,
576 OPCODE_MATRIX_TRANSLATE,
577 OPCODE_MATRIX_LOAD_IDENTITY,
579 OPCODE_MATRIX_FRUSTUM,
582 OPCODE_TEXTUREPARAMETER_F,
583 OPCODE_TEXTUREPARAMETER_I,
584 OPCODE_TEXTUREPARAMETER_II,
585 OPCODE_TEXTUREPARAMETER_IUI,
586 OPCODE_TEXTURE_IMAGE1D,
587 OPCODE_TEXTURE_IMAGE2D,
588 OPCODE_TEXTURE_IMAGE3D,
589 OPCODE_TEXTURE_SUB_IMAGE1D,
590 OPCODE_TEXTURE_SUB_IMAGE2D,
591 OPCODE_TEXTURE_SUB_IMAGE3D,
592 OPCODE_COPY_TEXTURE_IMAGE1D,
593 OPCODE_COPY_TEXTURE_IMAGE2D,
594 OPCODE_COPY_TEXTURE_SUB_IMAGE1D,
595 OPCODE_COPY_TEXTURE_SUB_IMAGE2D,
596 OPCODE_COPY_TEXTURE_SUB_IMAGE3D,
597 OPCODE_BIND_MULTITEXTURE,
598 OPCODE_MULTITEXPARAMETER_F,
599 OPCODE_MULTITEXPARAMETER_I,
600 OPCODE_MULTITEXPARAMETER_II,
601 OPCODE_MULTITEXPARAMETER_IUI,
602 OPCODE_MULTITEX_IMAGE1D,
603 OPCODE_MULTITEX_IMAGE2D,
604 OPCODE_MULTITEX_IMAGE3D,
605 OPCODE_MULTITEX_SUB_IMAGE1D,
606 OPCODE_MULTITEX_SUB_IMAGE2D,
607 OPCODE_MULTITEX_SUB_IMAGE3D,
608 OPCODE_COPY_MULTITEX_IMAGE1D,
609 OPCODE_COPY_MULTITEX_IMAGE2D,
610 OPCODE_COPY_MULTITEX_SUB_IMAGE1D,
611 OPCODE_COPY_MULTITEX_SUB_IMAGE2D,
612 OPCODE_COPY_MULTITEX_SUB_IMAGE3D,
614 OPCODE_COMPRESSED_TEXTURE_IMAGE_1D,
615 OPCODE_COMPRESSED_TEXTURE_IMAGE_2D,
616 OPCODE_COMPRESSED_TEXTURE_IMAGE_3D,
617 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D,
618 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D,
619 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D,
620 OPCODE_COMPRESSED_MULTITEX_IMAGE_1D,
621 OPCODE_COMPRESSED_MULTITEX_IMAGE_2D,
622 OPCODE_COMPRESSED_MULTITEX_IMAGE_3D,
623 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D,
624 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D,
625 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D,
626 OPCODE_NAMED_PROGRAM_STRING,
627 OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER,
631 /* The following three are meta instructions */
632 OPCODE_ERROR, /* raise compiled-in error */
634 OPCODE_NOP, /* No-op (used for 8-byte alignment */
643 * Display list instructions are stored as sequences of "nodes". Nodes
644 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
645 * are linked together with a pointer.
647 * Each instruction in the display list is stored as a sequence of
648 * contiguous nodes in memory.
649 * Each node is the union of a variety of data types.
651 * Note, all of these members should be 4 bytes in size or less for the
652 * sake of compact display lists. We store 8-byte pointers in a pair of
653 * these nodes using the save/get_pointer() functions below.
658 #if !DETECT_OS_WINDOWS
661 /* sizeof(Node) is 8 with MSVC/mingw, so use an explicit 16 bits type. */
679 typedef union gl_dlist_node Node;
682 /** How many 4-byte dwords to store a pointer */
683 #define POINTER_DWORDS (sizeof(void *) / 4)
685 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
686 * space for display lists. The following types and functions are
687 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
692 GLuint dwords[POINTER_DWORDS];
697 * Save a 4 or 8-byte pointer at dest (and dest+1).
700 save_pointer(Node *dest, void *src)
705 STATIC_ASSERT(POINTER_DWORDS == 1 || POINTER_DWORDS == 2);
706 STATIC_ASSERT(sizeof(Node) == 4);
710 for (i = 0; i < POINTER_DWORDS; i++)
711 dest[i].ui = p.dwords[i];
716 * Retrieve a 4 or 8-byte pointer from node (node+1).
719 get_pointer(const Node *node)
724 for (i = 0; i < POINTER_DWORDS; i++)
725 p.dwords[i] = node[i].ui;
732 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
754 #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \
756 union float64_pair tmp; \
758 n[idx].ui = tmp.uint32[0]; \
759 n[idx+1].ui = tmp.uint32[1]; \
762 #define ASSIGN_UINT64_TO_NODES(n, idx, value) \
764 union uint64_pair tmp; \
765 tmp.uint64 = value; \
766 n[idx].ui = tmp.uint32[0]; \
767 n[idx+1].ui = tmp.uint32[1]; \
770 #define ASSIGN_INT64_TO_NODES(n, idx, value) \
772 union int64_pair tmp; \
774 n[idx].i = tmp.int32[0]; \
775 n[idx+1].i = tmp.int32[1]; \
779 * How many nodes to allocate at a time. Note that bulk vertex data
780 * from glBegin/glVertex/glEnd primitives will typically wind up in
781 * a VBO, and not directly in the display list itself.
783 #define BLOCK_SIZE 256
786 void mesa_print_display_list(GLuint list);
790 * Called by display list code when a display list is being deleted.
793 vbo_destroy_vertex_list(struct gl_context *ctx, struct vbo_save_vertex_list *node)
795 for (gl_vertex_processing_mode vpm = VP_MODE_FF; vpm < VP_MODE_MAX; ++vpm)
796 _mesa_reference_vao(ctx, &node->VAO[vpm], NULL);
798 if (--node->prim_store->refcount == 0) {
799 free(node->prim_store->prims);
800 free(node->prim_store);
803 if (node->merged.mode) {
804 free(node->merged.mode);
805 free(node->merged.start_counts);
808 _mesa_reference_buffer_object(ctx, &node->merged.ib.obj, NULL);
809 free(node->current_data);
810 node->current_data = NULL;
814 vbo_print_vertex_list(struct gl_context *ctx, struct vbo_save_vertex_list *node, FILE *f)
817 struct gl_buffer_object *buffer = node->VAO[0]->BufferBinding[0].BufferObj;
818 const GLuint vertex_size = _vbo_save_get_stride(node)/sizeof(GLfloat);
821 fprintf(f, "VBO-VERTEX-LIST, %u vertices, %d primitives, %d vertsize, "
823 node->vertex_count, node->prim_count, vertex_size,
826 for (i = 0; i < node->prim_count; i++) {
827 struct _mesa_prim *prim = &node->prims[i];
828 fprintf(f, " prim %d: %s %d..%d %s %s\n",
830 _mesa_lookup_prim_by_nr(prim->mode),
832 prim->start + prim->count,
833 (prim->begin) ? "BEGIN" : "(wrap)",
834 (prim->end) ? "END" : "(wrap)");
840 * Does the given display list only contain a single glBitmap call?
843 is_bitmap_list(const struct gl_display_list *dlist)
845 const Node *n = dlist->Head;
846 if (n[0].opcode == OPCODE_BITMAP) {
848 if (n[0].opcode == OPCODE_END_OF_LIST)
856 * Is the given display list an empty list?
859 is_empty_list(const struct gl_display_list *dlist)
861 const Node *n = dlist->Head;
862 return n[0].opcode == OPCODE_END_OF_LIST;
867 * Delete/free a gl_bitmap_atlas. Called during context tear-down.
870 _mesa_delete_bitmap_atlas(struct gl_context *ctx, struct gl_bitmap_atlas *atlas)
873 ctx->Driver.DeleteTexture(ctx, atlas->texObj);
881 * Lookup a gl_bitmap_atlas by listBase ID.
883 static struct gl_bitmap_atlas *
884 lookup_bitmap_atlas(struct gl_context *ctx, GLuint listBase)
886 struct gl_bitmap_atlas *atlas;
888 assert(listBase > 0);
889 atlas = _mesa_HashLookup(ctx->Shared->BitmapAtlas, listBase);
895 * Create new bitmap atlas and insert into hash table.
897 static struct gl_bitmap_atlas *
898 alloc_bitmap_atlas(struct gl_context *ctx, GLuint listBase, bool isGenName)
900 struct gl_bitmap_atlas *atlas;
902 assert(listBase > 0);
903 assert(_mesa_HashLookup(ctx->Shared->BitmapAtlas, listBase) == NULL);
905 atlas = calloc(1, sizeof(*atlas));
907 _mesa_HashInsert(ctx->Shared->BitmapAtlas, listBase, atlas, isGenName);
908 atlas->Id = listBase;
916 * Try to build a bitmap atlas. This involves examining a sequence of
917 * display lists which contain glBitmap commands and putting the bitmap
918 * images into a texture map (the atlas).
919 * If we succeed, gl_bitmap_atlas::complete will be set to true.
920 * If we fail, gl_bitmap_atlas::incomplete will be set to true.
923 build_bitmap_atlas(struct gl_context *ctx, struct gl_bitmap_atlas *atlas,
926 unsigned i, row_height = 0, xpos = 0, ypos = 0;
931 assert(!atlas->complete);
932 assert(atlas->numBitmaps > 0);
934 /* We use a rectangle texture (non-normalized coords) for the atlas */
935 assert(ctx->Extensions.NV_texture_rectangle);
936 assert(ctx->Const.MaxTextureRectSize >= 1024);
938 atlas->texWidth = 1024;
939 atlas->texHeight = 0; /* determined below */
941 atlas->glyphs = malloc(atlas->numBitmaps * sizeof(atlas->glyphs[0]));
942 if (!atlas->glyphs) {
944 atlas->incomplete = true;
948 /* Loop over the display lists. They should all contain a single glBitmap
949 * call. If not, bail out. Also, compute the position and sizes of each
950 * bitmap in the atlas to determine the texture atlas size.
952 for (i = 0; i < atlas->numBitmaps; i++) {
953 const struct gl_display_list *list = _mesa_lookup_list(ctx, listBase + i, true);
955 struct gl_bitmap_glyph *g = &atlas->glyphs[i];
956 unsigned bitmap_width, bitmap_height;
957 float bitmap_xmove, bitmap_ymove, bitmap_xorig, bitmap_yorig;
959 if (!list || is_empty_list(list)) {
961 atlas->numBitmaps = i;
965 if (!is_bitmap_list(list)) {
966 /* This list does not contain exactly one glBitmap command. Give up. */
967 atlas->incomplete = true;
971 /* get bitmap info from the display list command */
973 assert(n[0].opcode == OPCODE_BITMAP);
974 bitmap_width = n[1].i;
975 bitmap_height = n[2].i;
976 bitmap_xorig = n[3].f;
977 bitmap_yorig = n[4].f;
978 bitmap_xmove = n[5].f;
979 bitmap_ymove = n[6].f;
981 if (xpos + bitmap_width > atlas->texWidth) {
982 /* advance to the next row of the texture */
988 /* save the bitmap's position in the atlas */
992 g->h = bitmap_height;
993 g->xorig = bitmap_xorig;
994 g->yorig = bitmap_yorig;
995 g->xmove = bitmap_xmove;
996 g->ymove = bitmap_ymove;
998 xpos += bitmap_width;
1000 /* keep track of tallest bitmap in the row */
1001 row_height = MAX2(row_height, bitmap_height);
1004 /* Now we know the texture height */
1005 atlas->texHeight = ypos + row_height;
1007 if (atlas->texHeight == 0) {
1008 /* no glyphs found, give up */
1011 else if (atlas->texHeight > ctx->Const.MaxTextureRectSize) {
1012 /* too large, give up */
1016 /* Create atlas texture (texture ID is irrelevant) */
1017 atlas->texObj = ctx->Driver.NewTextureObject(ctx, 999, GL_TEXTURE_RECTANGLE);
1018 if (!atlas->texObj) {
1022 atlas->texObj->Sampler.Attrib.MinFilter = GL_NEAREST;
1023 atlas->texObj->Sampler.Attrib.MagFilter = GL_NEAREST;
1024 atlas->texObj->Sampler.Attrib.state.min_img_filter = PIPE_TEX_FILTER_NEAREST;
1025 atlas->texObj->Sampler.Attrib.state.min_mip_filter = PIPE_TEX_MIPFILTER_NONE;
1026 atlas->texObj->Sampler.Attrib.state.mag_img_filter = PIPE_TEX_FILTER_NEAREST;
1027 atlas->texObj->Attrib.MaxLevel = 0;
1028 atlas->texObj->Immutable = GL_TRUE;
1030 atlas->texImage = _mesa_get_tex_image(ctx, atlas->texObj,
1031 GL_TEXTURE_RECTANGLE, 0);
1032 if (!atlas->texImage) {
1036 if (ctx->Const.BitmapUsesRed)
1037 _mesa_init_teximage_fields(ctx, atlas->texImage,
1038 atlas->texWidth, atlas->texHeight, 1, 0,
1039 GL_RED, MESA_FORMAT_R_UNORM8);
1041 _mesa_init_teximage_fields(ctx, atlas->texImage,
1042 atlas->texWidth, atlas->texHeight, 1, 0,
1043 GL_ALPHA, MESA_FORMAT_A_UNORM8);
1045 /* alloc image storage */
1046 if (!ctx->Driver.AllocTextureImageBuffer(ctx, atlas->texImage)) {
1050 /* map teximage, load with bitmap glyphs */
1051 ctx->Driver.MapTextureImage(ctx, atlas->texImage, 0,
1052 0, 0, atlas->texWidth, atlas->texHeight,
1053 GL_MAP_WRITE_BIT, &map, &map_stride);
1058 /* Background/clear pixels are 0xff, foreground/set pixels are 0x0 */
1059 memset(map, 0xff, map_stride * atlas->texHeight);
1061 for (i = 0; i < atlas->numBitmaps; i++) {
1062 const struct gl_display_list *list = _mesa_lookup_list(ctx, listBase + i, true);
1063 const Node *n = list->Head;
1065 assert(n[0].opcode == OPCODE_BITMAP ||
1066 n[0].opcode == OPCODE_END_OF_LIST);
1068 if (n[0].opcode == OPCODE_BITMAP) {
1069 unsigned bitmap_width = n[1].i;
1070 unsigned bitmap_height = n[2].i;
1071 unsigned xpos = atlas->glyphs[i].x;
1072 unsigned ypos = atlas->glyphs[i].y;
1073 const void *bitmap_image = get_pointer(&n[7]);
1075 assert(atlas->glyphs[i].w == bitmap_width);
1076 assert(atlas->glyphs[i].h == bitmap_height);
1078 /* put the bitmap image into the texture image */
1079 _mesa_expand_bitmap(bitmap_width, bitmap_height,
1080 &ctx->DefaultPacking, bitmap_image,
1081 map + map_stride * ypos + xpos, /* dest addr */
1086 ctx->Driver.UnmapTextureImage(ctx, atlas->texImage, 0);
1088 atlas->complete = true;
1093 _mesa_error(ctx, GL_OUT_OF_MEMORY, "Display list bitmap atlas");
1095 if (atlas->texObj) {
1096 ctx->Driver.DeleteTexture(ctx, atlas->texObj);
1098 free(atlas->glyphs);
1099 atlas->glyphs = NULL;
1100 atlas->incomplete = true;
1105 * Allocate a gl_display_list object with an initial block of storage.
1106 * \param count how many display list nodes/tokens to allocate
1108 static struct gl_display_list *
1109 make_list(GLuint name, GLuint count)
1111 struct gl_display_list *dlist = CALLOC_STRUCT(gl_display_list);
1113 dlist->Head = malloc(sizeof(Node) * count);
1114 dlist->Head[0].opcode = OPCODE_END_OF_LIST;
1120 * Lookup function to just encapsulate casting.
1122 struct gl_display_list *
1123 _mesa_lookup_list(struct gl_context *ctx, GLuint list, bool locked)
1125 return (struct gl_display_list *)
1126 _mesa_HashLookupMaybeLocked(ctx->Shared->DisplayList, list, locked);
1131 * Delete the named display list, but don't remove from hash table.
1132 * \param dlist - display list pointer
1135 _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
1145 n = block = dlist->Head;
1148 const OpCode opcode = n[0].opcode;
1151 /* for some commands, we need to free malloc'd memory */
1153 free(get_pointer(&n[6]));
1156 free(get_pointer(&n[10]));
1158 case OPCODE_CALL_LISTS:
1159 free(get_pointer(&n[3]));
1161 case OPCODE_DRAW_PIXELS:
1162 free(get_pointer(&n[5]));
1165 free(get_pointer(&n[7]));
1167 case OPCODE_POLYGON_STIPPLE:
1168 free(get_pointer(&n[1]));
1170 case OPCODE_TEX_IMAGE1D:
1171 free(get_pointer(&n[8]));
1173 case OPCODE_TEX_IMAGE2D:
1174 free(get_pointer(&n[9]));
1176 case OPCODE_TEX_IMAGE3D:
1177 free(get_pointer(&n[10]));
1179 case OPCODE_TEX_SUB_IMAGE1D:
1180 free(get_pointer(&n[7]));
1182 case OPCODE_TEX_SUB_IMAGE2D:
1183 free(get_pointer(&n[9]));
1185 case OPCODE_TEX_SUB_IMAGE3D:
1186 free(get_pointer(&n[11]));
1188 case OPCODE_COMPRESSED_TEX_IMAGE_1D:
1189 free(get_pointer(&n[7]));
1191 case OPCODE_COMPRESSED_TEX_IMAGE_2D:
1192 free(get_pointer(&n[8]));
1194 case OPCODE_COMPRESSED_TEX_IMAGE_3D:
1195 free(get_pointer(&n[9]));
1197 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D:
1198 free(get_pointer(&n[7]));
1200 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D:
1201 free(get_pointer(&n[9]));
1203 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D:
1204 free(get_pointer(&n[11]));
1206 case OPCODE_PROGRAM_STRING_ARB:
1207 free(get_pointer(&n[4])); /* program string */
1209 case OPCODE_UNIFORM_1FV:
1210 case OPCODE_UNIFORM_2FV:
1211 case OPCODE_UNIFORM_3FV:
1212 case OPCODE_UNIFORM_4FV:
1213 case OPCODE_UNIFORM_1DV:
1214 case OPCODE_UNIFORM_2DV:
1215 case OPCODE_UNIFORM_3DV:
1216 case OPCODE_UNIFORM_4DV:
1217 case OPCODE_UNIFORM_1IV:
1218 case OPCODE_UNIFORM_2IV:
1219 case OPCODE_UNIFORM_3IV:
1220 case OPCODE_UNIFORM_4IV:
1221 case OPCODE_UNIFORM_1UIV:
1222 case OPCODE_UNIFORM_2UIV:
1223 case OPCODE_UNIFORM_3UIV:
1224 case OPCODE_UNIFORM_4UIV:
1225 case OPCODE_UNIFORM_1I64V:
1226 case OPCODE_UNIFORM_2I64V:
1227 case OPCODE_UNIFORM_3I64V:
1228 case OPCODE_UNIFORM_4I64V:
1229 case OPCODE_UNIFORM_1UI64V:
1230 case OPCODE_UNIFORM_2UI64V:
1231 case OPCODE_UNIFORM_3UI64V:
1232 case OPCODE_UNIFORM_4UI64V:
1233 free(get_pointer(&n[3]));
1235 case OPCODE_UNIFORM_MATRIX22:
1236 case OPCODE_UNIFORM_MATRIX33:
1237 case OPCODE_UNIFORM_MATRIX44:
1238 case OPCODE_UNIFORM_MATRIX24:
1239 case OPCODE_UNIFORM_MATRIX42:
1240 case OPCODE_UNIFORM_MATRIX23:
1241 case OPCODE_UNIFORM_MATRIX32:
1242 case OPCODE_UNIFORM_MATRIX34:
1243 case OPCODE_UNIFORM_MATRIX43:
1244 case OPCODE_UNIFORM_MATRIX22D:
1245 case OPCODE_UNIFORM_MATRIX33D:
1246 case OPCODE_UNIFORM_MATRIX44D:
1247 case OPCODE_UNIFORM_MATRIX24D:
1248 case OPCODE_UNIFORM_MATRIX42D:
1249 case OPCODE_UNIFORM_MATRIX23D:
1250 case OPCODE_UNIFORM_MATRIX32D:
1251 case OPCODE_UNIFORM_MATRIX34D:
1252 case OPCODE_UNIFORM_MATRIX43D:
1253 free(get_pointer(&n[4]));
1255 case OPCODE_PROGRAM_UNIFORM_1FV:
1256 case OPCODE_PROGRAM_UNIFORM_2FV:
1257 case OPCODE_PROGRAM_UNIFORM_3FV:
1258 case OPCODE_PROGRAM_UNIFORM_4FV:
1259 case OPCODE_PROGRAM_UNIFORM_1DV:
1260 case OPCODE_PROGRAM_UNIFORM_2DV:
1261 case OPCODE_PROGRAM_UNIFORM_3DV:
1262 case OPCODE_PROGRAM_UNIFORM_4DV:
1263 case OPCODE_PROGRAM_UNIFORM_1IV:
1264 case OPCODE_PROGRAM_UNIFORM_2IV:
1265 case OPCODE_PROGRAM_UNIFORM_3IV:
1266 case OPCODE_PROGRAM_UNIFORM_4IV:
1267 case OPCODE_PROGRAM_UNIFORM_1UIV:
1268 case OPCODE_PROGRAM_UNIFORM_2UIV:
1269 case OPCODE_PROGRAM_UNIFORM_3UIV:
1270 case OPCODE_PROGRAM_UNIFORM_4UIV:
1271 case OPCODE_PROGRAM_UNIFORM_1I64V:
1272 case OPCODE_PROGRAM_UNIFORM_2I64V:
1273 case OPCODE_PROGRAM_UNIFORM_3I64V:
1274 case OPCODE_PROGRAM_UNIFORM_4I64V:
1275 case OPCODE_PROGRAM_UNIFORM_1UI64V:
1276 case OPCODE_PROGRAM_UNIFORM_2UI64V:
1277 case OPCODE_PROGRAM_UNIFORM_3UI64V:
1278 case OPCODE_PROGRAM_UNIFORM_4UI64V:
1279 free(get_pointer(&n[4]));
1281 case OPCODE_PROGRAM_UNIFORM_MATRIX22F:
1282 case OPCODE_PROGRAM_UNIFORM_MATRIX33F:
1283 case OPCODE_PROGRAM_UNIFORM_MATRIX44F:
1284 case OPCODE_PROGRAM_UNIFORM_MATRIX24F:
1285 case OPCODE_PROGRAM_UNIFORM_MATRIX42F:
1286 case OPCODE_PROGRAM_UNIFORM_MATRIX23F:
1287 case OPCODE_PROGRAM_UNIFORM_MATRIX32F:
1288 case OPCODE_PROGRAM_UNIFORM_MATRIX34F:
1289 case OPCODE_PROGRAM_UNIFORM_MATRIX43F:
1290 case OPCODE_PROGRAM_UNIFORM_MATRIX22D:
1291 case OPCODE_PROGRAM_UNIFORM_MATRIX33D:
1292 case OPCODE_PROGRAM_UNIFORM_MATRIX44D:
1293 case OPCODE_PROGRAM_UNIFORM_MATRIX24D:
1294 case OPCODE_PROGRAM_UNIFORM_MATRIX42D:
1295 case OPCODE_PROGRAM_UNIFORM_MATRIX23D:
1296 case OPCODE_PROGRAM_UNIFORM_MATRIX32D:
1297 case OPCODE_PROGRAM_UNIFORM_MATRIX34D:
1298 case OPCODE_PROGRAM_UNIFORM_MATRIX43D:
1299 free(get_pointer(&n[5]));
1301 case OPCODE_PIXEL_MAP:
1302 free(get_pointer(&n[3]));
1304 case OPCODE_VIEWPORT_ARRAY_V:
1305 case OPCODE_SCISSOR_ARRAY_V:
1306 case OPCODE_DEPTH_ARRAY_V:
1307 case OPCODE_UNIFORM_SUBROUTINES:
1308 case OPCODE_WINDOW_RECTANGLES:
1309 free(get_pointer(&n[3]));
1311 case OPCODE_TEXTURE_IMAGE1D:
1312 case OPCODE_MULTITEX_IMAGE1D:
1313 free(get_pointer(&n[9]));
1315 case OPCODE_TEXTURE_IMAGE2D:
1316 case OPCODE_MULTITEX_IMAGE2D:
1317 free(get_pointer(&n[10]));
1319 case OPCODE_TEXTURE_IMAGE3D:
1320 case OPCODE_MULTITEX_IMAGE3D:
1321 free(get_pointer(&n[11]));
1323 case OPCODE_TEXTURE_SUB_IMAGE1D:
1324 case OPCODE_MULTITEX_SUB_IMAGE1D:
1325 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D:
1326 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D:
1327 free(get_pointer(&n[8]));
1329 case OPCODE_TEXTURE_SUB_IMAGE2D:
1330 case OPCODE_MULTITEX_SUB_IMAGE2D:
1331 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D:
1332 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D:
1333 free(get_pointer(&n[10]));
1335 case OPCODE_TEXTURE_SUB_IMAGE3D:
1336 case OPCODE_MULTITEX_SUB_IMAGE3D:
1337 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D:
1338 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D:
1339 free(get_pointer(&n[12]));
1341 case OPCODE_COMPRESSED_TEXTURE_IMAGE_1D:
1342 case OPCODE_COMPRESSED_MULTITEX_IMAGE_1D:
1343 free(get_pointer(&n[8]));
1345 case OPCODE_COMPRESSED_TEXTURE_IMAGE_2D:
1346 case OPCODE_COMPRESSED_MULTITEX_IMAGE_2D:
1347 free(get_pointer(&n[9]));
1349 case OPCODE_COMPRESSED_TEXTURE_IMAGE_3D:
1350 case OPCODE_COMPRESSED_MULTITEX_IMAGE_3D:
1351 free(get_pointer(&n[10]));
1353 case OPCODE_NAMED_PROGRAM_STRING:
1354 free(get_pointer(&n[5]));
1356 case OPCODE_VERTEX_LIST:
1357 vbo_destroy_vertex_list(ctx, (struct vbo_save_vertex_list *) &n[1]);
1359 case OPCODE_CONTINUE:
1360 n = (Node *) get_pointer(&n[1]);
1364 case OPCODE_END_OF_LIST:
1370 /* just increment 'n' pointer, below */
1374 assert(n[0].InstSize > 0);
1381 * Called by _mesa_HashWalk() to check if a display list which is being
1382 * deleted belongs to a bitmap texture atlas.
1385 check_atlas_for_deleted_list(void *data, void *userData)
1387 struct gl_bitmap_atlas *atlas = (struct gl_bitmap_atlas *) data;
1388 GLuint list_id = *((GLuint *) userData); /* the list being deleted */
1389 const GLuint atlas_id = atlas->Id;
1391 /* See if the list_id falls in the range contained in this texture atlas */
1392 if (atlas->complete &&
1393 list_id >= atlas_id &&
1394 list_id < atlas_id + atlas->numBitmaps) {
1395 /* Mark the atlas as incomplete so it doesn't get used. But don't
1396 * delete it yet since we don't want to try to recreate it in the next
1399 atlas->complete = false;
1400 atlas->incomplete = true;
1406 * Destroy a display list and remove from hash table.
1407 * \param list - display list number
1410 destroy_list(struct gl_context *ctx, GLuint list)
1412 struct gl_display_list *dlist;
1417 dlist = _mesa_lookup_list(ctx, list, false);
1421 if (is_bitmap_list(dlist)) {
1422 /* If we're destroying a simple glBitmap display list, there's a
1423 * chance that we're destroying a bitmap image that's in a texture
1424 * atlas. Examine all atlases to see if that's the case. There's
1425 * usually few (if any) atlases so this isn't expensive.
1427 _mesa_HashWalk(ctx->Shared->BitmapAtlas,
1428 check_atlas_for_deleted_list, &list);
1431 _mesa_HashLockMutex(ctx->Shared->DisplayList);
1432 _mesa_delete_list(ctx, dlist);
1433 _mesa_HashRemoveLocked(ctx->Shared->DisplayList, list);
1434 _mesa_HashUnlockMutex(ctx->Shared->DisplayList);
1439 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1440 * If width < 0 or height < 0 or format or type are invalid we'll just
1441 * return NULL. We will not generate an error since OpenGL command
1442 * arguments aren't error-checked until the command is actually executed
1443 * (not when they're compiled).
1444 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1447 unpack_image(struct gl_context *ctx, GLuint dimensions,
1448 GLsizei width, GLsizei height, GLsizei depth,
1449 GLenum format, GLenum type, const GLvoid * pixels,
1450 const struct gl_pixelstore_attrib *unpack)
1452 if (width <= 0 || height <= 0) {
1456 if (_mesa_bytes_per_pixel(format, type) < 0) {
1457 /* bad format and/or type */
1461 if (!unpack->BufferObj) {
1465 image = _mesa_unpack_image(dimensions, width, height, depth,
1466 format, type, pixels, unpack);
1467 if (pixels && !image) {
1468 _mesa_error(ctx, GL_OUT_OF_MEMORY, "display list construction");
1472 else if (_mesa_validate_pbo_access(dimensions, unpack, width, height,
1473 depth, format, type, INT_MAX, pixels)) {
1474 const GLubyte *map, *src;
1478 ctx->Driver.MapBufferRange(ctx, 0, unpack->BufferObj->Size,
1479 GL_MAP_READ_BIT, unpack->BufferObj,
1482 /* unable to map src buffer! */
1483 _mesa_error(ctx, GL_INVALID_OPERATION, "unable to map PBO");
1487 src = ADD_POINTERS(map, pixels);
1488 image = _mesa_unpack_image(dimensions, width, height, depth,
1489 format, type, src, unpack);
1491 ctx->Driver.UnmapBuffer(ctx, unpack->BufferObj, MAP_INTERNAL);
1494 _mesa_error(ctx, GL_OUT_OF_MEMORY, "display list construction");
1500 _mesa_error(ctx, GL_INVALID_OPERATION, "invalid PBO access");
1505 /** Return copy of memory */
1507 memdup(const void *src, GLsizei bytes)
1509 void *b = bytes >= 0 ? malloc(bytes) : NULL;
1511 memcpy(b, src, bytes);
1517 * Allocate space for a display list instruction (opcode + payload space).
1518 * \param opcode the instruction opcode (OPCODE_* value)
1519 * \param bytes instruction payload size (not counting opcode)
1520 * \param align8 does the payload need to be 8-byte aligned?
1521 * This is only relevant in 64-bit environments.
1522 * \return pointer to allocated memory (the payload will be at pointer+1)
1525 dlist_alloc(struct gl_context *ctx, OpCode opcode, GLuint bytes, bool align8)
1527 const GLuint numNodes = 1 + (bytes + sizeof(Node) - 1) / sizeof(Node);
1528 const GLuint contNodes = 1 + POINTER_DWORDS; /* size of continue info */
1532 assert(bytes <= BLOCK_SIZE * sizeof(Node));
1534 if (sizeof(void *) > sizeof(Node) && align8
1535 && ctx->ListState.CurrentPos % 2 == 0) {
1536 /* The opcode would get placed at node[0] and the payload would start
1537 * at node[1]. But the payload needs to be at an even offset (8-byte
1546 if (ctx->ListState.CurrentPos + nopNode + numNodes + contNodes
1548 /* This block is full. Allocate a new block and chain to it */
1550 n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
1551 n[0].opcode = OPCODE_CONTINUE;
1552 newblock = malloc(sizeof(Node) * BLOCK_SIZE);
1554 _mesa_error(ctx, GL_OUT_OF_MEMORY, "Building display list");
1558 /* a fresh block should be 8-byte aligned on 64-bit systems */
1559 assert(((GLintptr) newblock) % sizeof(void *) == 0);
1561 save_pointer(&n[1], newblock);
1562 ctx->ListState.CurrentBlock = newblock;
1563 ctx->ListState.CurrentPos = 0;
1565 /* Display list nodes are always 4 bytes. If we need 8-byte alignment
1566 * we have to insert a NOP so that the payload of the real opcode lands
1567 * on an even location:
1568 * node[0] = OPCODE_NOP
1569 * node[1] = OPCODE_x;
1570 * node[2] = start of payload
1572 nopNode = sizeof(void *) > sizeof(Node) && align8;
1575 n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
1577 assert(ctx->ListState.CurrentPos % 2 == 0); /* even value */
1578 n[0].opcode = OPCODE_NOP;
1581 /* The "real" opcode will now be at an odd location and the payload
1582 * will be at an even location.
1585 ctx->ListState.CurrentPos += nopNode + numNodes;
1587 n[0].opcode = opcode;
1588 n[0].InstSize = numNodes;
1596 * Allocate space for a display list instruction. Used by callers outside
1597 * this file for things like VBO vertex data.
1599 * \param opcode the instruction opcode (OPCODE_* value)
1600 * \param bytes instruction size in bytes, not counting opcode.
1601 * \return pointer to the usable data area (not including the internal
1605 _mesa_dlist_alloc(struct gl_context *ctx, GLuint opcode, GLuint bytes)
1607 Node *n = dlist_alloc(ctx, (OpCode) opcode, bytes, false);
1609 return n + 1; /* return pointer to payload area, after opcode */
1616 * Same as _mesa_dlist_alloc(), but return a pointer which is 8-byte
1617 * aligned in 64-bit environments, 4-byte aligned otherwise.
1620 _mesa_dlist_alloc_aligned(struct gl_context *ctx, GLuint opcode, GLuint bytes)
1622 Node *n = dlist_alloc(ctx, (OpCode) opcode, bytes, true);
1624 return n + 1; /* return pointer to payload area, after opcode */
1631 _mesa_dlist_alloc_vertex_list(struct gl_context *ctx)
1633 return _mesa_dlist_alloc_aligned(ctx, OPCODE_VERTEX_LIST,
1634 sizeof(struct vbo_save_vertex_list));
1639 * Allocate space for a display list instruction. The space is basically
1640 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1641 * function parameter, node[2] is the second parameter, etc.
1643 * \param opcode one of OPCODE_x
1644 * \param nparams number of function parameters
1645 * \return pointer to start of instruction space
1647 static inline Node *
1648 alloc_instruction(struct gl_context *ctx, OpCode opcode, GLuint nparams)
1650 return dlist_alloc(ctx, opcode, nparams * sizeof(Node), false);
1655 * Called by EndList to try to reduce memory used for the list.
1658 trim_list(struct gl_context *ctx)
1660 /* If the list we're ending only has one allocated block of nodes/tokens
1661 * and its size isn't a full block size, realloc the block to use less
1662 * memory. This is important for apps that create many small display
1663 * lists and apps that use glXUseXFont (many lists each containing one
1665 * Note: we currently only trim display lists that allocated one block
1666 * of tokens. That hits the short list case which is what we're mainly
1667 * concerned with. Trimming longer lists would involve traversing the
1668 * linked list of blocks.
1670 struct gl_dlist_state *list = &ctx->ListState;
1672 if ((list->CurrentList->Head == list->CurrentBlock) &&
1673 (list->CurrentPos < BLOCK_SIZE)) {
1674 /* There's only one block and it's not full, so realloc */
1675 GLuint newSize = list->CurrentPos * sizeof(Node);
1676 list->CurrentList->Head =
1677 list->CurrentBlock = realloc(list->CurrentBlock, newSize);
1678 if (!list->CurrentBlock) {
1679 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glEndList");
1687 * Display List compilation functions
1689 static void GLAPIENTRY
1690 save_Accum(GLenum op, GLfloat value)
1692 GET_CURRENT_CONTEXT(ctx);
1694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1695 n = alloc_instruction(ctx, OPCODE_ACCUM, 2);
1700 if (ctx->ExecuteFlag) {
1701 CALL_Accum(ctx->Exec, (op, value));
1706 static void GLAPIENTRY
1707 save_AlphaFunc(GLenum func, GLclampf ref)
1709 GET_CURRENT_CONTEXT(ctx);
1711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1712 n = alloc_instruction(ctx, OPCODE_ALPHA_FUNC, 2);
1715 n[2].f = (GLfloat) ref;
1717 if (ctx->ExecuteFlag) {
1718 CALL_AlphaFunc(ctx->Exec, (func, ref));
1723 static void GLAPIENTRY
1724 save_BindTexture(GLenum target, GLuint texture)
1726 GET_CURRENT_CONTEXT(ctx);
1728 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1729 n = alloc_instruction(ctx, OPCODE_BIND_TEXTURE, 2);
1734 if (ctx->ExecuteFlag) {
1735 CALL_BindTexture(ctx->Exec, (target, texture));
1740 static void GLAPIENTRY
1741 save_Bitmap(GLsizei width, GLsizei height,
1742 GLfloat xorig, GLfloat yorig,
1743 GLfloat xmove, GLfloat ymove, const GLubyte * pixels)
1745 GET_CURRENT_CONTEXT(ctx);
1747 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1748 n = alloc_instruction(ctx, OPCODE_BITMAP, 6 + POINTER_DWORDS);
1750 n[1].i = (GLint) width;
1751 n[2].i = (GLint) height;
1757 unpack_image(ctx, 2, width, height, 1, GL_COLOR_INDEX,
1758 GL_BITMAP, pixels, &ctx->Unpack));
1760 if (ctx->ExecuteFlag) {
1761 CALL_Bitmap(ctx->Exec, (width, height,
1762 xorig, yorig, xmove, ymove, pixels));
1767 static void GLAPIENTRY
1768 save_BlendEquation(GLenum mode)
1770 GET_CURRENT_CONTEXT(ctx);
1772 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1773 n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION, 1);
1777 if (ctx->ExecuteFlag) {
1778 CALL_BlendEquation(ctx->Exec, (mode));
1783 static void GLAPIENTRY
1784 save_BlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA)
1786 GET_CURRENT_CONTEXT(ctx);
1788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1789 n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_SEPARATE, 2);
1794 if (ctx->ExecuteFlag) {
1795 CALL_BlendEquationSeparate(ctx->Exec, (modeRGB, modeA));
1800 static void GLAPIENTRY
1801 save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB,
1802 GLenum sfactorA, GLenum dfactorA)
1804 GET_CURRENT_CONTEXT(ctx);
1806 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1807 n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE, 4);
1809 n[1].e = sfactorRGB;
1810 n[2].e = dfactorRGB;
1814 if (ctx->ExecuteFlag) {
1815 CALL_BlendFuncSeparate(ctx->Exec,
1816 (sfactorRGB, dfactorRGB, sfactorA, dfactorA));
1821 static void GLAPIENTRY
1822 save_BlendFunc(GLenum srcfactor, GLenum dstfactor)
1824 save_BlendFuncSeparateEXT(srcfactor, dstfactor, srcfactor, dstfactor);
1828 static void GLAPIENTRY
1829 save_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
1831 GET_CURRENT_CONTEXT(ctx);
1833 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1834 n = alloc_instruction(ctx, OPCODE_BLEND_COLOR, 4);
1841 if (ctx->ExecuteFlag) {
1842 CALL_BlendColor(ctx->Exec, (red, green, blue, alpha));
1846 /* GL_ARB_draw_buffers_blend */
1847 static void GLAPIENTRY
1848 save_BlendFuncSeparatei(GLuint buf, GLenum sfactorRGB, GLenum dfactorRGB,
1849 GLenum sfactorA, GLenum dfactorA)
1851 GET_CURRENT_CONTEXT(ctx);
1853 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1854 n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE_I, 5);
1857 n[2].e = sfactorRGB;
1858 n[3].e = dfactorRGB;
1862 if (ctx->ExecuteFlag) {
1863 CALL_BlendFuncSeparateiARB(ctx->Exec, (buf, sfactorRGB, dfactorRGB,
1864 sfactorA, dfactorA));
1868 /* GL_ARB_draw_buffers_blend */
1869 static void GLAPIENTRY
1870 save_BlendFunci(GLuint buf, GLenum sfactor, GLenum dfactor)
1872 GET_CURRENT_CONTEXT(ctx);
1874 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1875 n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_I, 3);
1881 if (ctx->ExecuteFlag) {
1882 CALL_BlendFunciARB(ctx->Exec, (buf, sfactor, dfactor));
1886 /* GL_ARB_draw_buffers_blend */
1887 static void GLAPIENTRY
1888 save_BlendEquationi(GLuint buf, GLenum mode)
1890 GET_CURRENT_CONTEXT(ctx);
1892 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1893 n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_I, 2);
1898 if (ctx->ExecuteFlag) {
1899 CALL_BlendEquationiARB(ctx->Exec, (buf, mode));
1903 /* GL_ARB_draw_buffers_blend */
1904 static void GLAPIENTRY
1905 save_BlendEquationSeparatei(GLuint buf, GLenum modeRGB, GLenum modeA)
1907 GET_CURRENT_CONTEXT(ctx);
1909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1910 n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_SEPARATE_I, 3);
1916 if (ctx->ExecuteFlag) {
1917 CALL_BlendEquationSeparateiARB(ctx->Exec, (buf, modeRGB, modeA));
1922 /* GL_ARB_draw_instanced. */
1923 static void GLAPIENTRY
1924 save_DrawArraysInstancedARB(UNUSED GLenum mode,
1926 UNUSED GLsizei count,
1927 UNUSED GLsizei primcount)
1929 GET_CURRENT_CONTEXT(ctx);
1930 _mesa_error(ctx, GL_INVALID_OPERATION,
1931 "glDrawArraysInstanced() during display list compile");
1934 static void GLAPIENTRY
1935 save_DrawElementsInstancedARB(UNUSED GLenum mode,
1936 UNUSED GLsizei count,
1938 UNUSED const GLvoid *indices,
1939 UNUSED GLsizei primcount)
1941 GET_CURRENT_CONTEXT(ctx);
1942 _mesa_error(ctx, GL_INVALID_OPERATION,
1943 "glDrawElementsInstanced() during display list compile");
1946 static void GLAPIENTRY
1947 save_DrawElementsInstancedBaseVertexARB(UNUSED GLenum mode,
1948 UNUSED GLsizei count,
1950 UNUSED const GLvoid *indices,
1951 UNUSED GLsizei primcount,
1952 UNUSED GLint basevertex)
1954 GET_CURRENT_CONTEXT(ctx);
1955 _mesa_error(ctx, GL_INVALID_OPERATION,
1956 "glDrawElementsInstancedBaseVertex() during display list compile");
1959 /* GL_ARB_base_instance. */
1960 static void GLAPIENTRY
1961 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode,
1963 UNUSED GLsizei count,
1964 UNUSED GLsizei primcount,
1965 UNUSED GLuint baseinstance)
1967 GET_CURRENT_CONTEXT(ctx);
1968 _mesa_error(ctx, GL_INVALID_OPERATION,
1969 "glDrawArraysInstancedBaseInstance() during display list compile");
1972 static void APIENTRY
1973 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode,
1974 UNUSED GLsizei count,
1976 UNUSED const void *indices,
1977 UNUSED GLsizei primcount,
1978 UNUSED GLuint baseinstance)
1980 GET_CURRENT_CONTEXT(ctx);
1981 _mesa_error(ctx, GL_INVALID_OPERATION,
1982 "glDrawElementsInstancedBaseInstance() during display list compile");
1985 static void APIENTRY
1986 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode,
1987 UNUSED GLsizei count,
1989 UNUSED const void *indices,
1990 UNUSED GLsizei primcount,
1991 UNUSED GLint basevertex,
1992 UNUSED GLuint baseinstance)
1994 GET_CURRENT_CONTEXT(ctx);
1995 _mesa_error(ctx, GL_INVALID_OPERATION,
1996 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1999 static void APIENTRY
2000 save_DrawArraysIndirect(UNUSED GLenum mode,
2001 UNUSED const void *indirect)
2003 GET_CURRENT_CONTEXT(ctx);
2004 _mesa_error(ctx, GL_INVALID_OPERATION,
2005 "glDrawArraysIndirect() during display list compile");
2008 static void APIENTRY
2009 save_DrawElementsIndirect(UNUSED GLenum mode,
2011 UNUSED const void *indirect)
2013 GET_CURRENT_CONTEXT(ctx);
2014 _mesa_error(ctx, GL_INVALID_OPERATION,
2015 "glDrawElementsIndirect() during display list compile");
2018 static void APIENTRY
2019 save_MultiDrawArraysIndirect(UNUSED GLenum mode,
2020 UNUSED const void *indirect,
2021 UNUSED GLsizei primcount,
2022 UNUSED GLsizei stride)
2024 GET_CURRENT_CONTEXT(ctx);
2025 _mesa_error(ctx, GL_INVALID_OPERATION,
2026 "glMultiDrawArraysIndirect() during display list compile");
2029 static void APIENTRY
2030 save_MultiDrawElementsIndirect(UNUSED GLenum mode,
2032 UNUSED const void *indirect,
2033 UNUSED GLsizei primcount,
2034 UNUSED GLsizei stride)
2036 GET_CURRENT_CONTEXT(ctx);
2037 _mesa_error(ctx, GL_INVALID_OPERATION,
2038 "glMultiDrawElementsIndirect() during display list compile");
2042 * While building a display list we cache some OpenGL state.
2043 * Under some circumstances we need to invalidate that state (immediately
2044 * when we start compiling a list, or after glCallList(s)).
2047 invalidate_saved_current_state(struct gl_context *ctx)
2051 for (i = 0; i < VERT_ATTRIB_MAX; i++)
2052 ctx->ListState.ActiveAttribSize[i] = 0;
2054 for (i = 0; i < MAT_ATTRIB_MAX; i++)
2055 ctx->ListState.ActiveMaterialSize[i] = 0;
2057 memset(&ctx->ListState.Current, 0, sizeof ctx->ListState.Current);
2059 ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
2063 static void GLAPIENTRY
2064 save_CallList(GLuint list)
2066 GET_CURRENT_CONTEXT(ctx);
2068 SAVE_FLUSH_VERTICES(ctx);
2070 n = alloc_instruction(ctx, OPCODE_CALL_LIST, 1);
2075 /* After this, we don't know what state we're in. Invalidate all
2076 * cached information previously gathered:
2078 invalidate_saved_current_state( ctx );
2080 if (ctx->ExecuteFlag) {
2081 _mesa_CallList(list);
2086 static void GLAPIENTRY
2087 save_CallLists(GLsizei num, GLenum type, const GLvoid * lists)
2089 GET_CURRENT_CONTEXT(ctx);
2094 SAVE_FLUSH_VERTICES(ctx);
2098 case GL_UNSIGNED_BYTE:
2102 case GL_UNSIGNED_SHORT:
2110 case GL_UNSIGNED_INT:
2119 if (num > 0 && type_size > 0) {
2120 /* create a copy of the array of list IDs to save in the display list */
2121 lists_copy = memdup(lists, num * type_size);
2126 n = alloc_instruction(ctx, OPCODE_CALL_LISTS, 2 + POINTER_DWORDS);
2130 save_pointer(&n[3], lists_copy);
2133 /* After this, we don't know what state we're in. Invalidate all
2134 * cached information previously gathered:
2136 invalidate_saved_current_state( ctx );
2138 if (ctx->ExecuteFlag) {
2139 CALL_CallLists(ctx->Exec, (num, type, lists));
2144 static void GLAPIENTRY
2145 save_Clear(GLbitfield mask)
2147 GET_CURRENT_CONTEXT(ctx);
2149 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2150 n = alloc_instruction(ctx, OPCODE_CLEAR, 1);
2154 if (ctx->ExecuteFlag) {
2155 CALL_Clear(ctx->Exec, (mask));
2160 static void GLAPIENTRY
2161 save_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value)
2163 GET_CURRENT_CONTEXT(ctx);
2165 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2166 n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_IV, 6);
2169 n[2].i = drawbuffer;
2171 if (buffer == GL_COLOR) {
2182 if (ctx->ExecuteFlag) {
2183 CALL_ClearBufferiv(ctx->Exec, (buffer, drawbuffer, value));
2188 static void GLAPIENTRY
2189 save_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value)
2191 GET_CURRENT_CONTEXT(ctx);
2193 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2194 n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_UIV, 6);
2197 n[2].i = drawbuffer;
2199 if (buffer == GL_COLOR) {
2210 if (ctx->ExecuteFlag) {
2211 CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));
2216 static void GLAPIENTRY
2217 save_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value)
2219 GET_CURRENT_CONTEXT(ctx);
2221 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2222 n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_FV, 6);
2225 n[2].i = drawbuffer;
2227 if (buffer == GL_COLOR) {
2238 if (ctx->ExecuteFlag) {
2239 CALL_ClearBufferfv(ctx->Exec, (buffer, drawbuffer, value));
2244 static void GLAPIENTRY
2245 save_ClearBufferfi(GLenum buffer, GLint drawbuffer,
2246 GLfloat depth, GLint stencil)
2248 GET_CURRENT_CONTEXT(ctx);
2250 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2251 n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_FI, 4);
2254 n[2].i = drawbuffer;
2258 if (ctx->ExecuteFlag) {
2259 CALL_ClearBufferfi(ctx->Exec, (buffer, drawbuffer, depth, stencil));
2264 static void GLAPIENTRY
2265 save_ClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
2267 GET_CURRENT_CONTEXT(ctx);
2269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2270 n = alloc_instruction(ctx, OPCODE_CLEAR_ACCUM, 4);
2277 if (ctx->ExecuteFlag) {
2278 CALL_ClearAccum(ctx->Exec, (red, green, blue, alpha));
2283 static void GLAPIENTRY
2284 save_ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
2286 GET_CURRENT_CONTEXT(ctx);
2288 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2289 n = alloc_instruction(ctx, OPCODE_CLEAR_COLOR, 4);
2296 if (ctx->ExecuteFlag) {
2297 CALL_ClearColor(ctx->Exec, (red, green, blue, alpha));
2302 static void GLAPIENTRY
2303 save_ClearDepth(GLclampd depth)
2305 GET_CURRENT_CONTEXT(ctx);
2307 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2308 n = alloc_instruction(ctx, OPCODE_CLEAR_DEPTH, 1);
2310 n[1].f = (GLfloat) depth;
2312 if (ctx->ExecuteFlag) {
2313 CALL_ClearDepth(ctx->Exec, (depth));
2318 static void GLAPIENTRY
2319 save_ClearIndex(GLfloat c)
2321 GET_CURRENT_CONTEXT(ctx);
2323 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2324 n = alloc_instruction(ctx, OPCODE_CLEAR_INDEX, 1);
2328 if (ctx->ExecuteFlag) {
2329 CALL_ClearIndex(ctx->Exec, (c));
2334 static void GLAPIENTRY
2335 save_ClearStencil(GLint s)
2337 GET_CURRENT_CONTEXT(ctx);
2339 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2340 n = alloc_instruction(ctx, OPCODE_CLEAR_STENCIL, 1);
2344 if (ctx->ExecuteFlag) {
2345 CALL_ClearStencil(ctx->Exec, (s));
2350 static void GLAPIENTRY
2351 save_ClipPlane(GLenum plane, const GLdouble * equ)
2353 GET_CURRENT_CONTEXT(ctx);
2355 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2356 n = alloc_instruction(ctx, OPCODE_CLIP_PLANE, 5);
2359 n[2].f = (GLfloat) equ[0];
2360 n[3].f = (GLfloat) equ[1];
2361 n[4].f = (GLfloat) equ[2];
2362 n[5].f = (GLfloat) equ[3];
2364 if (ctx->ExecuteFlag) {
2365 CALL_ClipPlane(ctx->Exec, (plane, equ));
2371 static void GLAPIENTRY
2372 save_ColorMask(GLboolean red, GLboolean green,
2373 GLboolean blue, GLboolean alpha)
2375 GET_CURRENT_CONTEXT(ctx);
2377 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2378 n = alloc_instruction(ctx, OPCODE_COLOR_MASK, 4);
2385 if (ctx->ExecuteFlag) {
2386 CALL_ColorMask(ctx->Exec, (red, green, blue, alpha));
2391 static void GLAPIENTRY
2392 save_ColorMaskIndexed(GLuint buf, GLboolean red, GLboolean green,
2393 GLboolean blue, GLboolean alpha)
2395 GET_CURRENT_CONTEXT(ctx);
2397 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2398 n = alloc_instruction(ctx, OPCODE_COLOR_MASK_INDEXED, 5);
2406 if (ctx->ExecuteFlag) {
2407 /*CALL_ColorMaski(ctx->Exec, (buf, red, green, blue, alpha));*/
2412 static void GLAPIENTRY
2413 save_ColorMaterial(GLenum face, GLenum mode)
2415 GET_CURRENT_CONTEXT(ctx);
2417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2419 n = alloc_instruction(ctx, OPCODE_COLOR_MATERIAL, 2);
2424 if (ctx->ExecuteFlag) {
2425 CALL_ColorMaterial(ctx->Exec, (face, mode));
2430 static void GLAPIENTRY
2431 save_CopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
2433 GET_CURRENT_CONTEXT(ctx);
2435 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2436 n = alloc_instruction(ctx, OPCODE_COPY_PIXELS, 5);
2440 n[3].i = (GLint) width;
2441 n[4].i = (GLint) height;
2444 if (ctx->ExecuteFlag) {
2445 CALL_CopyPixels(ctx->Exec, (x, y, width, height, type));
2451 static void GLAPIENTRY
2452 save_CopyTexImage1D(GLenum target, GLint level, GLenum internalformat,
2453 GLint x, GLint y, GLsizei width, GLint border)
2455 GET_CURRENT_CONTEXT(ctx);
2457 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2458 n = alloc_instruction(ctx, OPCODE_COPY_TEX_IMAGE1D, 7);
2462 n[3].e = internalformat;
2468 if (ctx->ExecuteFlag) {
2469 CALL_CopyTexImage1D(ctx->Exec, (target, level, internalformat,
2470 x, y, width, border));
2475 static void GLAPIENTRY
2476 save_CopyTexImage2D(GLenum target, GLint level,
2477 GLenum internalformat,
2478 GLint x, GLint y, GLsizei width,
2479 GLsizei height, GLint border)
2481 GET_CURRENT_CONTEXT(ctx);
2483 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2484 n = alloc_instruction(ctx, OPCODE_COPY_TEX_IMAGE2D, 8);
2488 n[3].e = internalformat;
2495 if (ctx->ExecuteFlag) {
2496 CALL_CopyTexImage2D(ctx->Exec, (target, level, internalformat,
2497 x, y, width, height, border));
2503 static void GLAPIENTRY
2504 save_CopyTexSubImage1D(GLenum target, GLint level,
2505 GLint xoffset, GLint x, GLint y, GLsizei width)
2507 GET_CURRENT_CONTEXT(ctx);
2509 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2510 n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6);
2519 if (ctx->ExecuteFlag) {
2520 CALL_CopyTexSubImage1D(ctx->Exec,
2521 (target, level, xoffset, x, y, width));
2526 static void GLAPIENTRY
2527 save_CopyTexSubImage2D(GLenum target, GLint level,
2528 GLint xoffset, GLint yoffset,
2529 GLint x, GLint y, GLsizei width, GLint height)
2531 GET_CURRENT_CONTEXT(ctx);
2533 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2534 n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8);
2545 if (ctx->ExecuteFlag) {
2546 CALL_CopyTexSubImage2D(ctx->Exec, (target, level, xoffset, yoffset,
2547 x, y, width, height));
2552 static void GLAPIENTRY
2553 save_CopyTexSubImage3D(GLenum target, GLint level,
2554 GLint xoffset, GLint yoffset, GLint zoffset,
2555 GLint x, GLint y, GLsizei width, GLint height)
2557 GET_CURRENT_CONTEXT(ctx);
2559 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2560 n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9);
2572 if (ctx->ExecuteFlag) {
2573 CALL_CopyTexSubImage3D(ctx->Exec, (target, level,
2574 xoffset, yoffset, zoffset,
2575 x, y, width, height));
2580 static void GLAPIENTRY
2581 save_CullFace(GLenum mode)
2583 GET_CURRENT_CONTEXT(ctx);
2585 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2586 n = alloc_instruction(ctx, OPCODE_CULL_FACE, 1);
2590 if (ctx->ExecuteFlag) {
2591 CALL_CullFace(ctx->Exec, (mode));
2596 static void GLAPIENTRY
2597 save_DepthFunc(GLenum func)
2599 GET_CURRENT_CONTEXT(ctx);
2601 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2602 n = alloc_instruction(ctx, OPCODE_DEPTH_FUNC, 1);
2606 if (ctx->ExecuteFlag) {
2607 CALL_DepthFunc(ctx->Exec, (func));
2612 static void GLAPIENTRY
2613 save_DepthMask(GLboolean mask)
2615 GET_CURRENT_CONTEXT(ctx);
2617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2618 n = alloc_instruction(ctx, OPCODE_DEPTH_MASK, 1);
2622 if (ctx->ExecuteFlag) {
2623 CALL_DepthMask(ctx->Exec, (mask));
2628 static void GLAPIENTRY
2629 save_DepthRange(GLclampd nearval, GLclampd farval)
2631 GET_CURRENT_CONTEXT(ctx);
2633 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2634 n = alloc_instruction(ctx, OPCODE_DEPTH_RANGE, 2);
2636 n[1].f = (GLfloat) nearval;
2637 n[2].f = (GLfloat) farval;
2639 if (ctx->ExecuteFlag) {
2640 CALL_DepthRange(ctx->Exec, (nearval, farval));
2645 static void GLAPIENTRY
2646 save_Disable(GLenum cap)
2648 GET_CURRENT_CONTEXT(ctx);
2650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2651 n = alloc_instruction(ctx, OPCODE_DISABLE, 1);
2655 if (ctx->ExecuteFlag) {
2656 CALL_Disable(ctx->Exec, (cap));
2661 static void GLAPIENTRY
2662 save_DisableIndexed(GLuint index, GLenum cap)
2664 GET_CURRENT_CONTEXT(ctx);
2666 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2667 n = alloc_instruction(ctx, OPCODE_DISABLE_INDEXED, 2);
2672 if (ctx->ExecuteFlag) {
2673 CALL_Disablei(ctx->Exec, (index, cap));
2678 static void GLAPIENTRY
2679 save_DrawBuffer(GLenum mode)
2681 GET_CURRENT_CONTEXT(ctx);
2683 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2684 n = alloc_instruction(ctx, OPCODE_DRAW_BUFFER, 1);
2688 if (ctx->ExecuteFlag) {
2689 CALL_DrawBuffer(ctx->Exec, (mode));
2694 static void GLAPIENTRY
2695 save_DrawPixels(GLsizei width, GLsizei height,
2696 GLenum format, GLenum type, const GLvoid * pixels)
2698 GET_CURRENT_CONTEXT(ctx);
2701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2703 n = alloc_instruction(ctx, OPCODE_DRAW_PIXELS, 4 + POINTER_DWORDS);
2710 unpack_image(ctx, 2, width, height, 1, format, type,
2711 pixels, &ctx->Unpack));
2713 if (ctx->ExecuteFlag) {
2714 CALL_DrawPixels(ctx->Exec, (width, height, format, type, pixels));
2720 static void GLAPIENTRY
2721 save_Enable(GLenum cap)
2723 GET_CURRENT_CONTEXT(ctx);
2725 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2726 n = alloc_instruction(ctx, OPCODE_ENABLE, 1);
2730 if (ctx->ExecuteFlag) {
2731 CALL_Enable(ctx->Exec, (cap));
2737 static void GLAPIENTRY
2738 save_EnableIndexed(GLuint index, GLenum cap)
2740 GET_CURRENT_CONTEXT(ctx);
2742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2743 n = alloc_instruction(ctx, OPCODE_ENABLE_INDEXED, 2);
2748 if (ctx->ExecuteFlag) {
2749 CALL_Enablei(ctx->Exec, (index, cap));
2755 static void GLAPIENTRY
2756 save_EvalMesh1(GLenum mode, GLint i1, GLint i2)
2758 GET_CURRENT_CONTEXT(ctx);
2760 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2761 n = alloc_instruction(ctx, OPCODE_EVALMESH1, 3);
2767 if (ctx->ExecuteFlag) {
2768 CALL_EvalMesh1(ctx->Exec, (mode, i1, i2));
2773 static void GLAPIENTRY
2774 save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
2776 GET_CURRENT_CONTEXT(ctx);
2778 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2779 n = alloc_instruction(ctx, OPCODE_EVALMESH2, 5);
2787 if (ctx->ExecuteFlag) {
2788 CALL_EvalMesh2(ctx->Exec, (mode, i1, i2, j1, j2));
2795 static void GLAPIENTRY
2796 save_Fogfv(GLenum pname, const GLfloat *params)
2798 GET_CURRENT_CONTEXT(ctx);
2800 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2801 n = alloc_instruction(ctx, OPCODE_FOG, 5);
2809 if (ctx->ExecuteFlag) {
2810 CALL_Fogfv(ctx->Exec, (pname, params));
2815 static void GLAPIENTRY
2816 save_Fogf(GLenum pname, GLfloat param)
2820 parray[1] = parray[2] = parray[3] = 0.0F;
2821 save_Fogfv(pname, parray);
2825 static void GLAPIENTRY
2826 save_Fogiv(GLenum pname, const GLint *params)
2831 case GL_FOG_DENSITY:
2835 case GL_FOG_COORDINATE_SOURCE:
2836 p[0] = (GLfloat) *params;
2842 p[0] = INT_TO_FLOAT(params[0]);
2843 p[1] = INT_TO_FLOAT(params[1]);
2844 p[2] = INT_TO_FLOAT(params[2]);
2845 p[3] = INT_TO_FLOAT(params[3]);
2848 /* Error will be caught later in gl_Fogfv */
2849 ASSIGN_4V(p, 0.0F, 0.0F, 0.0F, 0.0F);
2851 save_Fogfv(pname, p);
2855 static void GLAPIENTRY
2856 save_Fogi(GLenum pname, GLint param)
2860 parray[1] = parray[2] = parray[3] = 0;
2861 save_Fogiv(pname, parray);
2865 static void GLAPIENTRY
2866 save_FrontFace(GLenum mode)
2868 GET_CURRENT_CONTEXT(ctx);
2870 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2871 n = alloc_instruction(ctx, OPCODE_FRONT_FACE, 1);
2875 if (ctx->ExecuteFlag) {
2876 CALL_FrontFace(ctx->Exec, (mode));
2881 static void GLAPIENTRY
2882 save_Frustum(GLdouble left, GLdouble right,
2883 GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
2885 GET_CURRENT_CONTEXT(ctx);
2887 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2888 n = alloc_instruction(ctx, OPCODE_FRUSTUM, 6);
2890 n[1].f = (GLfloat) left;
2891 n[2].f = (GLfloat) right;
2892 n[3].f = (GLfloat) bottom;
2893 n[4].f = (GLfloat) top;
2894 n[5].f = (GLfloat) nearval;
2895 n[6].f = (GLfloat) farval;
2897 if (ctx->ExecuteFlag) {
2898 CALL_Frustum(ctx->Exec, (left, right, bottom, top, nearval, farval));
2903 static void GLAPIENTRY
2904 save_Hint(GLenum target, GLenum mode)
2906 GET_CURRENT_CONTEXT(ctx);
2908 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2909 n = alloc_instruction(ctx, OPCODE_HINT, 2);
2914 if (ctx->ExecuteFlag) {
2915 CALL_Hint(ctx->Exec, (target, mode));
2920 static void GLAPIENTRY
2921 save_IndexMask(GLuint mask)
2923 GET_CURRENT_CONTEXT(ctx);
2925 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2926 n = alloc_instruction(ctx, OPCODE_INDEX_MASK, 1);
2930 if (ctx->ExecuteFlag) {
2931 CALL_IndexMask(ctx->Exec, (mask));
2936 static void GLAPIENTRY
2937 save_InitNames(void)
2939 GET_CURRENT_CONTEXT(ctx);
2940 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2941 (void) alloc_instruction(ctx, OPCODE_INIT_NAMES, 0);
2942 if (ctx->ExecuteFlag) {
2943 CALL_InitNames(ctx->Exec, ());
2948 static void GLAPIENTRY
2949 save_Lightfv(GLenum light, GLenum pname, const GLfloat *params)
2951 GET_CURRENT_CONTEXT(ctx);
2953 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2954 n = alloc_instruction(ctx, OPCODE_LIGHT, 6);
2972 case GL_SPOT_DIRECTION:
2975 case GL_SPOT_EXPONENT:
2978 case GL_SPOT_CUTOFF:
2981 case GL_CONSTANT_ATTENUATION:
2984 case GL_LINEAR_ATTENUATION:
2987 case GL_QUADRATIC_ATTENUATION:
2993 for (i = 0; i < nParams; i++) {
2994 n[3 + i].f = params[i];
2997 if (ctx->ExecuteFlag) {
2998 CALL_Lightfv(ctx->Exec, (light, pname, params));
3003 static void GLAPIENTRY
3004 save_Lightf(GLenum light, GLenum pname, GLfloat param)
3008 parray[1] = parray[2] = parray[3] = 0.0F;
3009 save_Lightfv(light, pname, parray);
3013 static void GLAPIENTRY
3014 save_Lightiv(GLenum light, GLenum pname, const GLint *params)
3021 fparam[0] = INT_TO_FLOAT(params[0]);
3022 fparam[1] = INT_TO_FLOAT(params[1]);
3023 fparam[2] = INT_TO_FLOAT(params[2]);
3024 fparam[3] = INT_TO_FLOAT(params[3]);
3027 fparam[0] = (GLfloat) params[0];
3028 fparam[1] = (GLfloat) params[1];
3029 fparam[2] = (GLfloat) params[2];
3030 fparam[3] = (GLfloat) params[3];
3032 case GL_SPOT_DIRECTION:
3033 fparam[0] = (GLfloat) params[0];
3034 fparam[1] = (GLfloat) params[1];
3035 fparam[2] = (GLfloat) params[2];
3037 case GL_SPOT_EXPONENT:
3038 case GL_SPOT_CUTOFF:
3039 case GL_CONSTANT_ATTENUATION:
3040 case GL_LINEAR_ATTENUATION:
3041 case GL_QUADRATIC_ATTENUATION:
3042 fparam[0] = (GLfloat) params[0];
3045 /* error will be caught later in gl_Lightfv */
3048 save_Lightfv(light, pname, fparam);
3052 static void GLAPIENTRY
3053 save_Lighti(GLenum light, GLenum pname, GLint param)
3057 parray[1] = parray[2] = parray[3] = 0;
3058 save_Lightiv(light, pname, parray);
3062 static void GLAPIENTRY
3063 save_LightModelfv(GLenum pname, const GLfloat *params)
3065 GET_CURRENT_CONTEXT(ctx);
3067 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3068 n = alloc_instruction(ctx, OPCODE_LIGHT_MODEL, 5);
3076 if (ctx->ExecuteFlag) {
3077 CALL_LightModelfv(ctx->Exec, (pname, params));
3082 static void GLAPIENTRY
3083 save_LightModelf(GLenum pname, GLfloat param)
3087 parray[1] = parray[2] = parray[3] = 0.0F;
3088 save_LightModelfv(pname, parray);
3092 static void GLAPIENTRY
3093 save_LightModeliv(GLenum pname, const GLint *params)
3097 case GL_LIGHT_MODEL_AMBIENT:
3098 fparam[0] = INT_TO_FLOAT(params[0]);
3099 fparam[1] = INT_TO_FLOAT(params[1]);
3100 fparam[2] = INT_TO_FLOAT(params[2]);
3101 fparam[3] = INT_TO_FLOAT(params[3]);
3103 case GL_LIGHT_MODEL_LOCAL_VIEWER:
3104 case GL_LIGHT_MODEL_TWO_SIDE:
3105 case GL_LIGHT_MODEL_COLOR_CONTROL:
3106 fparam[0] = (GLfloat) params[0];
3112 /* Error will be caught later in gl_LightModelfv */
3113 ASSIGN_4V(fparam, 0.0F, 0.0F, 0.0F, 0.0F);
3115 save_LightModelfv(pname, fparam);
3119 static void GLAPIENTRY
3120 save_LightModeli(GLenum pname, GLint param)
3124 parray[1] = parray[2] = parray[3] = 0;
3125 save_LightModeliv(pname, parray);
3129 static void GLAPIENTRY
3130 save_LineStipple(GLint factor, GLushort pattern)
3132 GET_CURRENT_CONTEXT(ctx);
3134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3135 n = alloc_instruction(ctx, OPCODE_LINE_STIPPLE, 2);
3140 if (ctx->ExecuteFlag) {
3141 CALL_LineStipple(ctx->Exec, (factor, pattern));
3146 static void GLAPIENTRY
3147 save_LineWidth(GLfloat width)
3149 GET_CURRENT_CONTEXT(ctx);
3151 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3152 n = alloc_instruction(ctx, OPCODE_LINE_WIDTH, 1);
3156 if (ctx->ExecuteFlag) {
3157 CALL_LineWidth(ctx->Exec, (width));
3162 static void GLAPIENTRY
3163 save_ListBase(GLuint base)
3165 GET_CURRENT_CONTEXT(ctx);
3167 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3168 n = alloc_instruction(ctx, OPCODE_LIST_BASE, 1);
3172 if (ctx->ExecuteFlag) {
3173 CALL_ListBase(ctx->Exec, (base));
3178 static void GLAPIENTRY
3179 save_LoadIdentity(void)
3181 GET_CURRENT_CONTEXT(ctx);
3182 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3183 (void) alloc_instruction(ctx, OPCODE_LOAD_IDENTITY, 0);
3184 if (ctx->ExecuteFlag) {
3185 CALL_LoadIdentity(ctx->Exec, ());
3190 static void GLAPIENTRY
3191 save_LoadMatrixf(const GLfloat * m)
3193 GET_CURRENT_CONTEXT(ctx);
3195 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3196 n = alloc_instruction(ctx, OPCODE_LOAD_MATRIX, 16);
3199 for (i = 0; i < 16; i++) {
3203 if (ctx->ExecuteFlag) {
3204 CALL_LoadMatrixf(ctx->Exec, (m));
3209 static void GLAPIENTRY
3210 save_LoadMatrixd(const GLdouble * m)
3214 for (i = 0; i < 16; i++) {
3215 f[i] = (GLfloat) m[i];
3217 save_LoadMatrixf(f);
3221 static void GLAPIENTRY
3222 save_LoadName(GLuint name)
3224 GET_CURRENT_CONTEXT(ctx);
3226 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3227 n = alloc_instruction(ctx, OPCODE_LOAD_NAME, 1);
3231 if (ctx->ExecuteFlag) {
3232 CALL_LoadName(ctx->Exec, (name));
3237 static void GLAPIENTRY
3238 save_LogicOp(GLenum opcode)
3240 GET_CURRENT_CONTEXT(ctx);
3242 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3243 n = alloc_instruction(ctx, OPCODE_LOGIC_OP, 1);
3247 if (ctx->ExecuteFlag) {
3248 CALL_LogicOp(ctx->Exec, (opcode));
3253 static void GLAPIENTRY
3254 save_Map1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride,
3255 GLint order, const GLdouble * points)
3257 GET_CURRENT_CONTEXT(ctx);
3259 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3260 n = alloc_instruction(ctx, OPCODE_MAP1, 5 + POINTER_DWORDS);
3262 GLfloat *pnts = _mesa_copy_map_points1d(target, stride, order, points);
3264 n[2].f = (GLfloat) u1;
3265 n[3].f = (GLfloat) u2;
3266 n[4].i = _mesa_evaluator_components(target); /* stride */
3268 save_pointer(&n[6], pnts);
3270 if (ctx->ExecuteFlag) {
3271 CALL_Map1d(ctx->Exec, (target, u1, u2, stride, order, points));
3275 static void GLAPIENTRY
3276 save_Map1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride,
3277 GLint order, const GLfloat * points)
3279 GET_CURRENT_CONTEXT(ctx);
3281 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3282 n = alloc_instruction(ctx, OPCODE_MAP1, 5 + POINTER_DWORDS);
3284 GLfloat *pnts = _mesa_copy_map_points1f(target, stride, order, points);
3288 n[4].i = _mesa_evaluator_components(target); /* stride */
3290 save_pointer(&n[6], pnts);
3292 if (ctx->ExecuteFlag) {
3293 CALL_Map1f(ctx->Exec, (target, u1, u2, stride, order, points));
3298 static void GLAPIENTRY
3299 save_Map2d(GLenum target,
3300 GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
3301 GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
3302 const GLdouble * points)
3304 GET_CURRENT_CONTEXT(ctx);
3306 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3307 n = alloc_instruction(ctx, OPCODE_MAP2, 9 + POINTER_DWORDS);
3309 GLfloat *pnts = _mesa_copy_map_points2d(target, ustride, uorder,
3310 vstride, vorder, points);
3312 n[2].f = (GLfloat) u1;
3313 n[3].f = (GLfloat) u2;
3314 n[4].f = (GLfloat) v1;
3315 n[5].f = (GLfloat) v2;
3316 /* XXX verify these strides are correct */
3317 n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride */
3318 n[7].i = _mesa_evaluator_components(target); /*vstride */
3321 save_pointer(&n[10], pnts);
3323 if (ctx->ExecuteFlag) {
3324 CALL_Map2d(ctx->Exec, (target,
3325 u1, u2, ustride, uorder,
3326 v1, v2, vstride, vorder, points));
3331 static void GLAPIENTRY
3332 save_Map2f(GLenum target,
3333 GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
3334 GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
3335 const GLfloat * points)
3337 GET_CURRENT_CONTEXT(ctx);
3339 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3340 n = alloc_instruction(ctx, OPCODE_MAP2, 9 + POINTER_DWORDS);
3342 GLfloat *pnts = _mesa_copy_map_points2f(target, ustride, uorder,
3343 vstride, vorder, points);
3349 /* XXX verify these strides are correct */
3350 n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride */
3351 n[7].i = _mesa_evaluator_components(target); /*vstride */
3354 save_pointer(&n[10], pnts);
3356 if (ctx->ExecuteFlag) {
3357 CALL_Map2f(ctx->Exec, (target, u1, u2, ustride, uorder,
3358 v1, v2, vstride, vorder, points));
3363 static void GLAPIENTRY
3364 save_MapGrid1f(GLint un, GLfloat u1, GLfloat u2)
3366 GET_CURRENT_CONTEXT(ctx);
3368 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3369 n = alloc_instruction(ctx, OPCODE_MAPGRID1, 3);
3375 if (ctx->ExecuteFlag) {
3376 CALL_MapGrid1f(ctx->Exec, (un, u1, u2));
3381 static void GLAPIENTRY
3382 save_MapGrid1d(GLint un, GLdouble u1, GLdouble u2)
3384 save_MapGrid1f(un, (GLfloat) u1, (GLfloat) u2);
3388 static void GLAPIENTRY
3389 save_MapGrid2f(GLint un, GLfloat u1, GLfloat u2,
3390 GLint vn, GLfloat v1, GLfloat v2)
3392 GET_CURRENT_CONTEXT(ctx);
3394 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3395 n = alloc_instruction(ctx, OPCODE_MAPGRID2, 6);
3404 if (ctx->ExecuteFlag) {
3405 CALL_MapGrid2f(ctx->Exec, (un, u1, u2, vn, v1, v2));
3411 static void GLAPIENTRY
3412 save_MapGrid2d(GLint un, GLdouble u1, GLdouble u2,
3413 GLint vn, GLdouble v1, GLdouble v2)
3415 save_MapGrid2f(un, (GLfloat) u1, (GLfloat) u2,
3416 vn, (GLfloat) v1, (GLfloat) v2);
3420 static void GLAPIENTRY
3421 save_MatrixMode(GLenum mode)
3423 GET_CURRENT_CONTEXT(ctx);
3425 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3426 n = alloc_instruction(ctx, OPCODE_MATRIX_MODE, 1);
3430 if (ctx->ExecuteFlag) {
3431 CALL_MatrixMode(ctx->Exec, (mode));
3436 static void GLAPIENTRY
3437 save_MultMatrixf(const GLfloat * m)
3439 GET_CURRENT_CONTEXT(ctx);
3441 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3442 n = alloc_instruction(ctx, OPCODE_MULT_MATRIX, 16);
3445 for (i = 0; i < 16; i++) {
3449 if (ctx->ExecuteFlag) {
3450 CALL_MultMatrixf(ctx->Exec, (m));
3455 static void GLAPIENTRY
3456 save_MultMatrixd(const GLdouble * m)
3460 for (i = 0; i < 16; i++) {
3461 f[i] = (GLfloat) m[i];
3463 save_MultMatrixf(f);
3467 static void GLAPIENTRY
3468 save_NewList(GLuint name, GLenum mode)
3470 GET_CURRENT_CONTEXT(ctx);
3471 /* It's an error to call this function while building a display list */
3472 _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList");
3479 static void GLAPIENTRY
3480 save_Ortho(GLdouble left, GLdouble right,
3481 GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
3483 GET_CURRENT_CONTEXT(ctx);
3485 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3486 n = alloc_instruction(ctx, OPCODE_ORTHO, 6);
3488 n[1].f = (GLfloat) left;
3489 n[2].f = (GLfloat) right;
3490 n[3].f = (GLfloat) bottom;
3491 n[4].f = (GLfloat) top;
3492 n[5].f = (GLfloat) nearval;
3493 n[6].f = (GLfloat) farval;
3495 if (ctx->ExecuteFlag) {
3496 CALL_Ortho(ctx->Exec, (left, right, bottom, top, nearval, farval));
3501 static void GLAPIENTRY
3502 save_PatchParameteri(GLenum pname, const GLint value)
3504 GET_CURRENT_CONTEXT(ctx);
3506 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3507 n = alloc_instruction(ctx, OPCODE_PATCH_PARAMETER_I, 2);
3512 if (ctx->ExecuteFlag) {
3513 CALL_PatchParameteri(ctx->Exec, (pname, value));
3518 static void GLAPIENTRY
3519 save_PatchParameterfv(GLenum pname, const GLfloat *params)
3521 GET_CURRENT_CONTEXT(ctx);
3523 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3525 if (pname == GL_PATCH_DEFAULT_OUTER_LEVEL) {
3526 n = alloc_instruction(ctx, OPCODE_PATCH_PARAMETER_FV_OUTER, 5);
3528 assert(pname == GL_PATCH_DEFAULT_INNER_LEVEL);
3529 n = alloc_instruction(ctx, OPCODE_PATCH_PARAMETER_FV_INNER, 3);
3533 if (pname == GL_PATCH_DEFAULT_OUTER_LEVEL) {
3543 if (ctx->ExecuteFlag) {
3544 CALL_PatchParameterfv(ctx->Exec, (pname, params));
3549 static void GLAPIENTRY
3550 save_PixelMapfv(GLenum map, GLint mapsize, const GLfloat *values)
3552 GET_CURRENT_CONTEXT(ctx);
3554 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3555 n = alloc_instruction(ctx, OPCODE_PIXEL_MAP, 2 + POINTER_DWORDS);
3559 save_pointer(&n[3], memdup(values, mapsize * sizeof(GLfloat)));
3561 if (ctx->ExecuteFlag) {
3562 CALL_PixelMapfv(ctx->Exec, (map, mapsize, values));
3567 static void GLAPIENTRY
3568 save_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values)
3570 GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
3572 if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) {
3573 for (i = 0; i < mapsize; i++) {
3574 fvalues[i] = (GLfloat) values[i];
3578 for (i = 0; i < mapsize; i++) {
3579 fvalues[i] = UINT_TO_FLOAT(values[i]);
3582 save_PixelMapfv(map, mapsize, fvalues);
3586 static void GLAPIENTRY
3587 save_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values)
3589 GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
3591 if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) {
3592 for (i = 0; i < mapsize; i++) {
3593 fvalues[i] = (GLfloat) values[i];
3597 for (i = 0; i < mapsize; i++) {
3598 fvalues[i] = USHORT_TO_FLOAT(values[i]);
3601 save_PixelMapfv(map, mapsize, fvalues);
3605 static void GLAPIENTRY
3606 save_PixelTransferf(GLenum pname, GLfloat param)
3608 GET_CURRENT_CONTEXT(ctx);
3610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3611 n = alloc_instruction(ctx, OPCODE_PIXEL_TRANSFER, 2);
3616 if (ctx->ExecuteFlag) {
3617 CALL_PixelTransferf(ctx->Exec, (pname, param));
3622 static void GLAPIENTRY
3623 save_PixelTransferi(GLenum pname, GLint param)
3625 save_PixelTransferf(pname, (GLfloat) param);
3629 static void GLAPIENTRY
3630 save_PixelZoom(GLfloat xfactor, GLfloat yfactor)
3632 GET_CURRENT_CONTEXT(ctx);
3634 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3635 n = alloc_instruction(ctx, OPCODE_PIXEL_ZOOM, 2);
3640 if (ctx->ExecuteFlag) {
3641 CALL_PixelZoom(ctx->Exec, (xfactor, yfactor));
3646 static void GLAPIENTRY
3647 save_PointParameterfvEXT(GLenum pname, const GLfloat *params)
3649 GET_CURRENT_CONTEXT(ctx);
3651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3652 n = alloc_instruction(ctx, OPCODE_POINT_PARAMETERS, 4);
3659 if (ctx->ExecuteFlag) {
3660 CALL_PointParameterfv(ctx->Exec, (pname, params));
3665 static void GLAPIENTRY
3666 save_PointParameterfEXT(GLenum pname, GLfloat param)
3670 parray[1] = parray[2] = 0.0F;
3671 save_PointParameterfvEXT(pname, parray);
3674 static void GLAPIENTRY
3675 save_PointParameteri(GLenum pname, GLint param)
3678 parray[0] = (GLfloat) param;
3679 parray[1] = parray[2] = 0.0F;
3680 save_PointParameterfvEXT(pname, parray);
3683 static void GLAPIENTRY
3684 save_PointParameteriv(GLenum pname, const GLint * param)
3687 parray[0] = (GLfloat) param[0];
3688 parray[1] = parray[2] = 0.0F;
3689 save_PointParameterfvEXT(pname, parray);
3693 static void GLAPIENTRY
3694 save_PointSize(GLfloat size)
3696 GET_CURRENT_CONTEXT(ctx);
3698 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3699 n = alloc_instruction(ctx, OPCODE_POINT_SIZE, 1);
3703 if (ctx->ExecuteFlag) {
3704 CALL_PointSize(ctx->Exec, (size));
3709 static void GLAPIENTRY
3710 save_PolygonMode(GLenum face, GLenum mode)
3712 GET_CURRENT_CONTEXT(ctx);
3714 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3715 n = alloc_instruction(ctx, OPCODE_POLYGON_MODE, 2);
3720 if (ctx->ExecuteFlag) {
3721 CALL_PolygonMode(ctx->Exec, (face, mode));
3726 static void GLAPIENTRY
3727 save_PolygonStipple(const GLubyte * pattern)
3729 GET_CURRENT_CONTEXT(ctx);
3732 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3734 n = alloc_instruction(ctx, OPCODE_POLYGON_STIPPLE, POINTER_DWORDS);
3737 unpack_image(ctx, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP,
3738 pattern, &ctx->Unpack));
3740 if (ctx->ExecuteFlag) {
3741 CALL_PolygonStipple(ctx->Exec, ((GLubyte *) pattern));
3746 static void GLAPIENTRY
3747 save_PolygonOffset(GLfloat factor, GLfloat units)
3749 GET_CURRENT_CONTEXT(ctx);
3751 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3752 n = alloc_instruction(ctx, OPCODE_POLYGON_OFFSET, 2);
3757 if (ctx->ExecuteFlag) {
3758 CALL_PolygonOffset(ctx->Exec, (factor, units));
3763 static void GLAPIENTRY
3764 save_PolygonOffsetClampEXT(GLfloat factor, GLfloat units, GLfloat clamp)
3766 GET_CURRENT_CONTEXT(ctx);
3768 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3769 n = alloc_instruction(ctx, OPCODE_POLYGON_OFFSET_CLAMP, 3);
3775 if (ctx->ExecuteFlag) {
3776 CALL_PolygonOffsetClampEXT(ctx->Exec, (factor, units, clamp));
3780 static void GLAPIENTRY
3781 save_PopAttrib(void)
3783 GET_CURRENT_CONTEXT(ctx);
3784 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3785 (void) alloc_instruction(ctx, OPCODE_POP_ATTRIB, 0);
3786 if (ctx->ExecuteFlag) {
3787 CALL_PopAttrib(ctx->Exec, ());
3792 static void GLAPIENTRY
3793 save_PopMatrix(void)
3795 GET_CURRENT_CONTEXT(ctx);
3796 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3797 (void) alloc_instruction(ctx, OPCODE_POP_MATRIX, 0);
3798 if (ctx->ExecuteFlag) {
3799 CALL_PopMatrix(ctx->Exec, ());
3804 static void GLAPIENTRY
3807 GET_CURRENT_CONTEXT(ctx);
3808 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3809 (void) alloc_instruction(ctx, OPCODE_POP_NAME, 0);
3810 if (ctx->ExecuteFlag) {
3811 CALL_PopName(ctx->Exec, ());
3816 static void GLAPIENTRY
3817 save_PrioritizeTextures(GLsizei num, const GLuint * textures,
3818 const GLclampf * priorities)
3820 GET_CURRENT_CONTEXT(ctx);
3822 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3824 for (i = 0; i < num; i++) {
3826 n = alloc_instruction(ctx, OPCODE_PRIORITIZE_TEXTURE, 2);
3828 n[1].ui = textures[i];
3829 n[2].f = priorities[i];
3832 if (ctx->ExecuteFlag) {
3833 CALL_PrioritizeTextures(ctx->Exec, (num, textures, priorities));
3838 static void GLAPIENTRY
3839 save_PushAttrib(GLbitfield mask)
3841 GET_CURRENT_CONTEXT(ctx);
3843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3844 n = alloc_instruction(ctx, OPCODE_PUSH_ATTRIB, 1);
3848 if (ctx->ExecuteFlag) {
3849 CALL_PushAttrib(ctx->Exec, (mask));
3854 static void GLAPIENTRY
3855 save_PushMatrix(void)
3857 GET_CURRENT_CONTEXT(ctx);
3858 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3859 (void) alloc_instruction(ctx, OPCODE_PUSH_MATRIX, 0);
3860 if (ctx->ExecuteFlag) {
3861 CALL_PushMatrix(ctx->Exec, ());
3866 static void GLAPIENTRY
3867 save_PushName(GLuint name)
3869 GET_CURRENT_CONTEXT(ctx);
3871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3872 n = alloc_instruction(ctx, OPCODE_PUSH_NAME, 1);
3876 if (ctx->ExecuteFlag) {
3877 CALL_PushName(ctx->Exec, (name));
3882 static void GLAPIENTRY
3883 save_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
3885 GET_CURRENT_CONTEXT(ctx);
3887 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3888 n = alloc_instruction(ctx, OPCODE_RASTER_POS, 4);
3895 if (ctx->ExecuteFlag) {
3896 CALL_RasterPos4f(ctx->Exec, (x, y, z, w));
3900 static void GLAPIENTRY
3901 save_RasterPos2d(GLdouble x, GLdouble y)
3903 save_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
3906 static void GLAPIENTRY
3907 save_RasterPos2f(GLfloat x, GLfloat y)
3909 save_RasterPos4f(x, y, 0.0F, 1.0F);
3912 static void GLAPIENTRY
3913 save_RasterPos2i(GLint x, GLint y)
3915 save_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
3918 static void GLAPIENTRY
3919 save_RasterPos2s(GLshort x, GLshort y)
3921 save_RasterPos4f(x, y, 0.0F, 1.0F);
3924 static void GLAPIENTRY
3925 save_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
3927 save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
3930 static void GLAPIENTRY
3931 save_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
3933 save_RasterPos4f(x, y, z, 1.0F);
3936 static void GLAPIENTRY
3937 save_RasterPos3i(GLint x, GLint y, GLint z)
3939 save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
3942 static void GLAPIENTRY
3943 save_RasterPos3s(GLshort x, GLshort y, GLshort z)
3945 save_RasterPos4f(x, y, z, 1.0F);
3948 static void GLAPIENTRY
3949 save_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
3951 save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
3954 static void GLAPIENTRY
3955 save_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
3957 save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
3960 static void GLAPIENTRY
3961 save_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
3963 save_RasterPos4f(x, y, z, w);
3966 static void GLAPIENTRY
3967 save_RasterPos2dv(const GLdouble * v)
3969 save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
3972 static void GLAPIENTRY
3973 save_RasterPos2fv(const GLfloat * v)
3975 save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
3978 static void GLAPIENTRY
3979 save_RasterPos2iv(const GLint * v)
3981 save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
3984 static void GLAPIENTRY
3985 save_RasterPos2sv(const GLshort * v)
3987 save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
3990 static void GLAPIENTRY
3991 save_RasterPos3dv(const GLdouble * v)
3993 save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
3996 static void GLAPIENTRY
3997 save_RasterPos3fv(const GLfloat * v)
3999 save_RasterPos4f(v[0], v[1], v[2], 1.0F);
4002 static void GLAPIENTRY
4003 save_RasterPos3iv(const GLint * v)
4005 save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
4008 static void GLAPIENTRY
4009 save_RasterPos3sv(const GLshort * v)
4011 save_RasterPos4f(v[0], v[1], v[2], 1.0F);
4014 static void GLAPIENTRY
4015 save_RasterPos4dv(const GLdouble * v)
4017 save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
4018 (GLfloat) v[2], (GLfloat) v[3]);
4021 static void GLAPIENTRY
4022 save_RasterPos4fv(const GLfloat * v)
4024 save_RasterPos4f(v[0], v[1], v[2], v[3]);
4027 static void GLAPIENTRY
4028 save_RasterPos4iv(const GLint * v)
4030 save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
4031 (GLfloat) v[2], (GLfloat) v[3]);
4034 static void GLAPIENTRY
4035 save_RasterPos4sv(const GLshort * v)
4037 save_RasterPos4f(v[0], v[1], v[2], v[3]);
4041 static void GLAPIENTRY
4042 save_PassThrough(GLfloat token)
4044 GET_CURRENT_CONTEXT(ctx);
4046 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4047 n = alloc_instruction(ctx, OPCODE_PASSTHROUGH, 1);
4051 if (ctx->ExecuteFlag) {
4052 CALL_PassThrough(ctx->Exec, (token));
4057 static void GLAPIENTRY
4058 save_ReadBuffer(GLenum mode)
4060 GET_CURRENT_CONTEXT(ctx);
4062 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4063 n = alloc_instruction(ctx, OPCODE_READ_BUFFER, 1);
4067 if (ctx->ExecuteFlag) {
4068 CALL_ReadBuffer(ctx->Exec, (mode));
4073 static void GLAPIENTRY
4074 save_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
4076 GET_CURRENT_CONTEXT(ctx);
4078 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4079 n = alloc_instruction(ctx, OPCODE_ROTATE, 4);
4086 if (ctx->ExecuteFlag) {
4087 CALL_Rotatef(ctx->Exec, (angle, x, y, z));
4092 static void GLAPIENTRY
4093 save_Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
4095 save_Rotatef((GLfloat) angle, (GLfloat) x, (GLfloat) y, (GLfloat) z);
4099 static void GLAPIENTRY
4100 save_Scalef(GLfloat x, GLfloat y, GLfloat z)
4102 GET_CURRENT_CONTEXT(ctx);
4104 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4105 n = alloc_instruction(ctx, OPCODE_SCALE, 3);
4111 if (ctx->ExecuteFlag) {
4112 CALL_Scalef(ctx->Exec, (x, y, z));
4117 static void GLAPIENTRY
4118 save_Scaled(GLdouble x, GLdouble y, GLdouble z)
4120 save_Scalef((GLfloat) x, (GLfloat) y, (GLfloat) z);
4124 static void GLAPIENTRY
4125 save_Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
4127 GET_CURRENT_CONTEXT(ctx);
4129 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4130 n = alloc_instruction(ctx, OPCODE_SCISSOR, 4);
4137 if (ctx->ExecuteFlag) {
4138 CALL_Scissor(ctx->Exec, (x, y, width, height));
4143 static void GLAPIENTRY
4144 save_ShadeModel(GLenum mode)
4146 GET_CURRENT_CONTEXT(ctx);
4148 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx);
4150 if (ctx->ExecuteFlag) {
4151 CALL_ShadeModel(ctx->Exec, (mode));
4154 /* Don't compile this call if it's a no-op.
4155 * By avoiding this state change we have a better chance of
4156 * coalescing subsequent drawing commands into one batch.
4158 if (ctx->ListState.Current.ShadeModel == mode)
4161 SAVE_FLUSH_VERTICES(ctx);
4163 ctx->ListState.Current.ShadeModel = mode;
4165 n = alloc_instruction(ctx, OPCODE_SHADE_MODEL, 1);
4172 static void GLAPIENTRY
4173 save_StencilFunc(GLenum func, GLint ref, GLuint mask)
4175 GET_CURRENT_CONTEXT(ctx);
4177 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4178 n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC, 3);
4184 if (ctx->ExecuteFlag) {
4185 CALL_StencilFunc(ctx->Exec, (func, ref, mask));
4190 static void GLAPIENTRY
4191 save_StencilMask(GLuint mask)
4193 GET_CURRENT_CONTEXT(ctx);
4195 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4196 n = alloc_instruction(ctx, OPCODE_STENCIL_MASK, 1);
4200 if (ctx->ExecuteFlag) {
4201 CALL_StencilMask(ctx->Exec, (mask));
4206 static void GLAPIENTRY
4207 save_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
4209 GET_CURRENT_CONTEXT(ctx);
4211 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4212 n = alloc_instruction(ctx, OPCODE_STENCIL_OP, 3);
4218 if (ctx->ExecuteFlag) {
4219 CALL_StencilOp(ctx->Exec, (fail, zfail, zpass));
4224 static void GLAPIENTRY
4225 save_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
4227 GET_CURRENT_CONTEXT(ctx);
4229 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4230 n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
4237 if (ctx->ExecuteFlag) {
4238 CALL_StencilFuncSeparate(ctx->Exec, (face, func, ref, mask));
4243 static void GLAPIENTRY
4244 save_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref,
4247 GET_CURRENT_CONTEXT(ctx);
4249 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4251 n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
4259 n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
4266 if (ctx->ExecuteFlag) {
4267 CALL_StencilFuncSeparate(ctx->Exec, (GL_FRONT, frontfunc, ref, mask));
4268 CALL_StencilFuncSeparate(ctx->Exec, (GL_BACK, backfunc, ref, mask));
4273 static void GLAPIENTRY
4274 save_StencilMaskSeparate(GLenum face, GLuint mask)
4276 GET_CURRENT_CONTEXT(ctx);
4278 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4279 n = alloc_instruction(ctx, OPCODE_STENCIL_MASK_SEPARATE, 2);
4284 if (ctx->ExecuteFlag) {
4285 CALL_StencilMaskSeparate(ctx->Exec, (face, mask));
4290 static void GLAPIENTRY
4291 save_StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
4293 GET_CURRENT_CONTEXT(ctx);
4295 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4296 n = alloc_instruction(ctx, OPCODE_STENCIL_OP_SEPARATE, 4);
4303 if (ctx->ExecuteFlag) {
4304 CALL_StencilOpSeparate(ctx->Exec, (face, fail, zfail, zpass));
4309 static void GLAPIENTRY
4310 save_TexEnvfv(GLenum target, GLenum pname, const GLfloat *params)
4312 GET_CURRENT_CONTEXT(ctx);
4314 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4315 n = alloc_instruction(ctx, OPCODE_TEXENV, 6);
4319 if (pname == GL_TEXTURE_ENV_COLOR) {
4327 n[4].f = n[5].f = n[6].f = 0.0F;
4330 if (ctx->ExecuteFlag) {
4331 CALL_TexEnvfv(ctx->Exec, (target, pname, params));
4336 static void GLAPIENTRY
4337 save_TexEnvf(GLenum target, GLenum pname, GLfloat param)
4340 parray[0] = (GLfloat) param;
4341 parray[1] = parray[2] = parray[3] = 0.0F;
4342 save_TexEnvfv(target, pname, parray);
4346 static void GLAPIENTRY
4347 save_TexEnvi(GLenum target, GLenum pname, GLint param)
4350 p[0] = (GLfloat) param;
4351 p[1] = p[2] = p[3] = 0.0F;
4352 save_TexEnvfv(target, pname, p);
4356 static void GLAPIENTRY
4357 save_TexEnviv(GLenum target, GLenum pname, const GLint * param)
4360 if (pname == GL_TEXTURE_ENV_COLOR) {
4361 p[0] = INT_TO_FLOAT(param[0]);
4362 p[1] = INT_TO_FLOAT(param[1]);
4363 p[2] = INT_TO_FLOAT(param[2]);
4364 p[3] = INT_TO_FLOAT(param[3]);
4367 p[0] = (GLfloat) param[0];
4368 p[1] = p[2] = p[3] = 0.0F;
4370 save_TexEnvfv(target, pname, p);
4374 static void GLAPIENTRY
4375 save_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params)
4377 GET_CURRENT_CONTEXT(ctx);
4379 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4380 n = alloc_instruction(ctx, OPCODE_TEXGEN, 6);
4389 if (ctx->ExecuteFlag) {
4390 CALL_TexGenfv(ctx->Exec, (coord, pname, params));
4395 static void GLAPIENTRY
4396 save_TexGeniv(GLenum coord, GLenum pname, const GLint *params)
4399 p[0] = (GLfloat) params[0];
4400 p[1] = (GLfloat) params[1];
4401 p[2] = (GLfloat) params[2];
4402 p[3] = (GLfloat) params[3];
4403 save_TexGenfv(coord, pname, p);
4407 static void GLAPIENTRY
4408 save_TexGend(GLenum coord, GLenum pname, GLdouble param)
4411 parray[0] = (GLfloat) param;
4412 parray[1] = parray[2] = parray[3] = 0.0F;
4413 save_TexGenfv(coord, pname, parray);
4417 static void GLAPIENTRY
4418 save_TexGendv(GLenum coord, GLenum pname, const GLdouble *params)
4421 p[0] = (GLfloat) params[0];
4422 p[1] = (GLfloat) params[1];
4423 p[2] = (GLfloat) params[2];
4424 p[3] = (GLfloat) params[3];
4425 save_TexGenfv(coord, pname, p);
4429 static void GLAPIENTRY
4430 save_TexGenf(GLenum coord, GLenum pname, GLfloat param)
4434 parray[1] = parray[2] = parray[3] = 0.0F;
4435 save_TexGenfv(coord, pname, parray);
4439 static void GLAPIENTRY
4440 save_TexGeni(GLenum coord, GLenum pname, GLint param)
4444 parray[1] = parray[2] = parray[3] = 0;
4445 save_TexGeniv(coord, pname, parray);
4449 static void GLAPIENTRY
4450 save_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
4452 GET_CURRENT_CONTEXT(ctx);
4454 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4455 n = alloc_instruction(ctx, OPCODE_TEXPARAMETER, 6);
4464 if (ctx->ExecuteFlag) {
4465 CALL_TexParameterfv(ctx->Exec, (target, pname, params));
4470 static void GLAPIENTRY
4471 save_TexParameterf(GLenum target, GLenum pname, GLfloat param)
4475 parray[1] = parray[2] = parray[3] = 0.0F;
4476 save_TexParameterfv(target, pname, parray);
4480 static void GLAPIENTRY
4481 save_TexParameteri(GLenum target, GLenum pname, GLint param)
4484 fparam[0] = (GLfloat) param;
4485 fparam[1] = fparam[2] = fparam[3] = 0.0F;
4486 save_TexParameterfv(target, pname, fparam);
4490 static void GLAPIENTRY
4491 save_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
4494 fparam[0] = (GLfloat) params[0];
4495 fparam[1] = fparam[2] = fparam[3] = 0.0F;
4496 save_TexParameterfv(target, pname, fparam);
4500 static void GLAPIENTRY
4501 save_TexImage1D(GLenum target,
4502 GLint level, GLint components,
4503 GLsizei width, GLint border,
4504 GLenum format, GLenum type, const GLvoid * pixels)
4506 GET_CURRENT_CONTEXT(ctx);
4507 if (target == GL_PROXY_TEXTURE_1D) {
4508 /* don't compile, execute immediately */
4509 CALL_TexImage1D(ctx->Exec, (target, level, components, width,
4510 border, format, type, pixels));
4514 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4515 n = alloc_instruction(ctx, OPCODE_TEX_IMAGE1D, 7 + POINTER_DWORDS);
4519 n[3].i = components;
4520 n[4].i = (GLint) width;
4525 unpack_image(ctx, 1, width, 1, 1, format, type,
4526 pixels, &ctx->Unpack));
4528 if (ctx->ExecuteFlag) {
4529 CALL_TexImage1D(ctx->Exec, (target, level, components, width,
4530 border, format, type, pixels));
4536 static void GLAPIENTRY
4537 save_TexImage2D(GLenum target,
4538 GLint level, GLint components,
4539 GLsizei width, GLsizei height, GLint border,
4540 GLenum format, GLenum type, const GLvoid * pixels)
4542 GET_CURRENT_CONTEXT(ctx);
4543 if (target == GL_PROXY_TEXTURE_2D) {
4544 /* don't compile, execute immediately */
4545 CALL_TexImage2D(ctx->Exec, (target, level, components, width,
4546 height, border, format, type, pixels));
4550 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4551 n = alloc_instruction(ctx, OPCODE_TEX_IMAGE2D, 8 + POINTER_DWORDS);
4555 n[3].i = components;
4556 n[4].i = (GLint) width;
4557 n[5].i = (GLint) height;
4562 unpack_image(ctx, 2, width, height, 1, format, type,
4563 pixels, &ctx->Unpack));
4565 if (ctx->ExecuteFlag) {
4566 CALL_TexImage2D(ctx->Exec, (target, level, components, width,
4567 height, border, format, type, pixels));
4573 static void GLAPIENTRY
4574 save_TexImage3D(GLenum target,
4575 GLint level, GLint internalFormat,
4576 GLsizei width, GLsizei height, GLsizei depth,
4578 GLenum format, GLenum type, const GLvoid * pixels)
4580 GET_CURRENT_CONTEXT(ctx);
4581 if (target == GL_PROXY_TEXTURE_3D) {
4582 /* don't compile, execute immediately */
4583 CALL_TexImage3D(ctx->Exec, (target, level, internalFormat, width,
4584 height, depth, border, format, type,
4589 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4590 n = alloc_instruction(ctx, OPCODE_TEX_IMAGE3D, 9 + POINTER_DWORDS);
4594 n[3].i = (GLint) internalFormat;
4595 n[4].i = (GLint) width;
4596 n[5].i = (GLint) height;
4597 n[6].i = (GLint) depth;
4601 save_pointer(&n[10],
4602 unpack_image(ctx, 3, width, height, depth, format, type,
4603 pixels, &ctx->Unpack));
4605 if (ctx->ExecuteFlag) {
4606 CALL_TexImage3D(ctx->Exec, (target, level, internalFormat, width,
4607 height, depth, border, format, type,
4614 static void GLAPIENTRY
4615 save_TexSubImage1D(GLenum target, GLint level, GLint xoffset,
4616 GLsizei width, GLenum format, GLenum type,
4617 const GLvoid * pixels)
4619 GET_CURRENT_CONTEXT(ctx);
4622 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4624 n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE1D, 6 + POINTER_DWORDS);
4629 n[4].i = (GLint) width;
4633 unpack_image(ctx, 1, width, 1, 1, format, type,
4634 pixels, &ctx->Unpack));
4636 if (ctx->ExecuteFlag) {
4637 CALL_TexSubImage1D(ctx->Exec, (target, level, xoffset, width,
4638 format, type, pixels));
4643 static void GLAPIENTRY
4644 save_TexSubImage2D(GLenum target, GLint level,
4645 GLint xoffset, GLint yoffset,
4646 GLsizei width, GLsizei height,
4647 GLenum format, GLenum type, const GLvoid * pixels)
4649 GET_CURRENT_CONTEXT(ctx);
4652 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4654 n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE2D, 8 + POINTER_DWORDS);
4660 n[5].i = (GLint) width;
4661 n[6].i = (GLint) height;
4665 unpack_image(ctx, 2, width, height, 1, format, type,
4666 pixels, &ctx->Unpack));
4668 if (ctx->ExecuteFlag) {
4669 CALL_TexSubImage2D(ctx->Exec, (target, level, xoffset, yoffset,
4670 width, height, format, type, pixels));
4675 static void GLAPIENTRY
4676 save_TexSubImage3D(GLenum target, GLint level,
4677 GLint xoffset, GLint yoffset, GLint zoffset,
4678 GLsizei width, GLsizei height, GLsizei depth,
4679 GLenum format, GLenum type, const GLvoid * pixels)
4681 GET_CURRENT_CONTEXT(ctx);
4684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4686 n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE3D, 10 + POINTER_DWORDS);
4693 n[6].i = (GLint) width;
4694 n[7].i = (GLint) height;
4695 n[8].i = (GLint) depth;
4698 save_pointer(&n[11],
4699 unpack_image(ctx, 3, width, height, depth, format, type,
4700 pixels, &ctx->Unpack));
4702 if (ctx->ExecuteFlag) {
4703 CALL_TexSubImage3D(ctx->Exec, (target, level,
4704 xoffset, yoffset, zoffset,
4705 width, height, depth, format, type,
4711 static void GLAPIENTRY
4712 save_Translatef(GLfloat x, GLfloat y, GLfloat z)
4714 GET_CURRENT_CONTEXT(ctx);
4716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4717 n = alloc_instruction(ctx, OPCODE_TRANSLATE, 3);
4723 if (ctx->ExecuteFlag) {
4724 CALL_Translatef(ctx->Exec, (x, y, z));
4729 static void GLAPIENTRY
4730 save_Translated(GLdouble x, GLdouble y, GLdouble z)
4732 save_Translatef((GLfloat) x, (GLfloat) y, (GLfloat) z);
4737 static void GLAPIENTRY
4738 save_Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
4740 GET_CURRENT_CONTEXT(ctx);
4742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4743 n = alloc_instruction(ctx, OPCODE_VIEWPORT, 4);
4747 n[3].i = (GLint) width;
4748 n[4].i = (GLint) height;
4750 if (ctx->ExecuteFlag) {
4751 CALL_Viewport(ctx->Exec, (x, y, width, height));
4755 static void GLAPIENTRY
4756 save_ViewportIndexedf(GLuint index, GLfloat x, GLfloat y, GLfloat width,
4759 GET_CURRENT_CONTEXT(ctx);
4761 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4762 n = alloc_instruction(ctx, OPCODE_VIEWPORT_INDEXED_F, 5);
4770 if (ctx->ExecuteFlag) {
4771 CALL_ViewportIndexedf(ctx->Exec, (index, x, y, width, height));
4775 static void GLAPIENTRY
4776 save_ViewportIndexedfv(GLuint index, const GLfloat *v)
4778 GET_CURRENT_CONTEXT(ctx);
4780 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4781 n = alloc_instruction(ctx, OPCODE_VIEWPORT_INDEXED_FV, 5);
4789 if (ctx->ExecuteFlag) {
4790 CALL_ViewportIndexedfv(ctx->Exec, (index, v));
4794 static void GLAPIENTRY
4795 save_ViewportArrayv(GLuint first, GLsizei count, const GLfloat *v)
4797 GET_CURRENT_CONTEXT(ctx);
4799 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4800 n = alloc_instruction(ctx, OPCODE_VIEWPORT_ARRAY_V, 2 + POINTER_DWORDS);
4804 save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLfloat)));
4806 if (ctx->ExecuteFlag) {
4807 CALL_ViewportArrayv(ctx->Exec, (first, count, v));
4811 static void GLAPIENTRY
4812 save_ScissorIndexed(GLuint index, GLint left, GLint bottom, GLsizei width,
4815 GET_CURRENT_CONTEXT(ctx);
4817 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4818 n = alloc_instruction(ctx, OPCODE_SCISSOR_INDEXED, 5);
4826 if (ctx->ExecuteFlag) {
4827 CALL_ScissorIndexed(ctx->Exec, (index, left, bottom, width, height));
4831 static void GLAPIENTRY
4832 save_ScissorIndexedv(GLuint index, const GLint *v)
4834 GET_CURRENT_CONTEXT(ctx);
4836 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4837 n = alloc_instruction(ctx, OPCODE_SCISSOR_INDEXED_V, 5);
4845 if (ctx->ExecuteFlag) {
4846 CALL_ScissorIndexedv(ctx->Exec, (index, v));
4850 static void GLAPIENTRY
4851 save_ScissorArrayv(GLuint first, GLsizei count, const GLint *v)
4853 GET_CURRENT_CONTEXT(ctx);
4855 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4856 n = alloc_instruction(ctx, OPCODE_SCISSOR_ARRAY_V, 2 + POINTER_DWORDS);
4860 save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLint)));
4862 if (ctx->ExecuteFlag) {
4863 CALL_ScissorArrayv(ctx->Exec, (first, count, v));
4867 static void GLAPIENTRY
4868 save_DepthRangeIndexed(GLuint index, GLclampd n, GLclampd f)
4870 GET_CURRENT_CONTEXT(ctx);
4872 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4873 node = alloc_instruction(ctx, OPCODE_DEPTH_INDEXED, 3);
4876 /* Mesa stores these as floats internally so we deliberately convert
4877 * them to a float here.
4882 if (ctx->ExecuteFlag) {
4883 CALL_DepthRangeIndexed(ctx->Exec, (index, n, f));
4887 static void GLAPIENTRY
4888 save_DepthRangeArrayv(GLuint first, GLsizei count, const GLclampd *v)
4890 GET_CURRENT_CONTEXT(ctx);
4892 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4893 n = alloc_instruction(ctx, OPCODE_DEPTH_ARRAY_V, 2 + POINTER_DWORDS);
4897 save_pointer(&n[3], memdup(v, count * 2 * sizeof(GLclampd)));
4899 if (ctx->ExecuteFlag) {
4900 CALL_DepthRangeArrayv(ctx->Exec, (first, count, v));
4904 static void GLAPIENTRY
4905 save_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
4907 GET_CURRENT_CONTEXT(ctx);
4909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4910 n = alloc_instruction(ctx, OPCODE_WINDOW_POS, 4);
4917 if (ctx->ExecuteFlag) {
4918 CALL_WindowPos4fMESA(ctx->Exec, (x, y, z, w));
4922 static void GLAPIENTRY
4923 save_WindowPos2dMESA(GLdouble x, GLdouble y)
4925 save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
4928 static void GLAPIENTRY
4929 save_WindowPos2fMESA(GLfloat x, GLfloat y)
4931 save_WindowPos4fMESA(x, y, 0.0F, 1.0F);
4934 static void GLAPIENTRY
4935 save_WindowPos2iMESA(GLint x, GLint y)
4937 save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
4940 static void GLAPIENTRY
4941 save_WindowPos2sMESA(GLshort x, GLshort y)
4943 save_WindowPos4fMESA(x, y, 0.0F, 1.0F);
4946 static void GLAPIENTRY
4947 save_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z)
4949 save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
4952 static void GLAPIENTRY
4953 save_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z)
4955 save_WindowPos4fMESA(x, y, z, 1.0F);
4958 static void GLAPIENTRY
4959 save_WindowPos3iMESA(GLint x, GLint y, GLint z)
4961 save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
4964 static void GLAPIENTRY
4965 save_WindowPos3sMESA(GLshort x, GLshort y, GLshort z)
4967 save_WindowPos4fMESA(x, y, z, 1.0F);
4970 static void GLAPIENTRY
4971 save_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
4973 save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
4976 static void GLAPIENTRY
4977 save_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w)
4979 save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
4982 static void GLAPIENTRY
4983 save_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w)
4985 save_WindowPos4fMESA(x, y, z, w);
4988 static void GLAPIENTRY
4989 save_WindowPos2dvMESA(const GLdouble * v)
4991 save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
4994 static void GLAPIENTRY
4995 save_WindowPos2fvMESA(const GLfloat * v)
4997 save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
5000 static void GLAPIENTRY
5001 save_WindowPos2ivMESA(const GLint * v)
5003 save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
5006 static void GLAPIENTRY
5007 save_WindowPos2svMESA(const GLshort * v)
5009 save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
5012 static void GLAPIENTRY
5013 save_WindowPos3dvMESA(const GLdouble * v)
5015 save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
5018 static void GLAPIENTRY
5019 save_WindowPos3fvMESA(const GLfloat * v)
5021 save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
5024 static void GLAPIENTRY
5025 save_WindowPos3ivMESA(const GLint * v)
5027 save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
5030 static void GLAPIENTRY
5031 save_WindowPos3svMESA(const GLshort * v)
5033 save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
5036 static void GLAPIENTRY
5037 save_WindowPos4dvMESA(const GLdouble * v)
5039 save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
5040 (GLfloat) v[2], (GLfloat) v[3]);
5043 static void GLAPIENTRY
5044 save_WindowPos4fvMESA(const GLfloat * v)
5046 save_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
5049 static void GLAPIENTRY
5050 save_WindowPos4ivMESA(const GLint * v)
5052 save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
5053 (GLfloat) v[2], (GLfloat) v[3]);
5056 static void GLAPIENTRY
5057 save_WindowPos4svMESA(const GLshort * v)
5059 save_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
5064 /* GL_ARB_multitexture */
5065 static void GLAPIENTRY
5066 save_ActiveTextureARB(GLenum target)
5068 GET_CURRENT_CONTEXT(ctx);
5070 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5071 n = alloc_instruction(ctx, OPCODE_ACTIVE_TEXTURE, 1);
5075 if (ctx->ExecuteFlag) {
5076 CALL_ActiveTexture(ctx->Exec, (target));
5081 /* GL_ARB_transpose_matrix */
5083 static void GLAPIENTRY
5084 save_LoadTransposeMatrixdARB(const GLdouble m[16])
5087 _math_transposefd(tm, m);
5088 save_LoadMatrixf(tm);
5092 static void GLAPIENTRY
5093 save_LoadTransposeMatrixfARB(const GLfloat m[16])
5096 _math_transposef(tm, m);
5097 save_LoadMatrixf(tm);
5101 static void GLAPIENTRY
5102 save_MultTransposeMatrixdARB(const GLdouble m[16])
5105 _math_transposefd(tm, m);
5106 save_MultMatrixf(tm);
5110 static void GLAPIENTRY
5111 save_MultTransposeMatrixfARB(const GLfloat m[16])
5114 _math_transposef(tm, m);
5115 save_MultMatrixf(tm);
5118 static GLvoid *copy_data(const GLvoid *data, GLsizei size, const char *func)
5120 GET_CURRENT_CONTEXT(ctx);
5126 image = malloc(size);
5128 _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
5131 memcpy(image, data, size);
5137 /* GL_ARB_texture_compression */
5138 static void GLAPIENTRY
5139 save_CompressedTexImage1DARB(GLenum target, GLint level,
5140 GLenum internalFormat, GLsizei width,
5141 GLint border, GLsizei imageSize,
5142 const GLvoid * data)
5144 GET_CURRENT_CONTEXT(ctx);
5145 if (target == GL_PROXY_TEXTURE_1D) {
5146 /* don't compile, execute immediately */
5147 CALL_CompressedTexImage1D(ctx->Exec, (target, level, internalFormat,
5148 width, border, imageSize,
5153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5155 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D,
5156 6 + POINTER_DWORDS);
5160 n[3].e = internalFormat;
5161 n[4].i = (GLint) width;
5165 copy_data(data, imageSize, "glCompressedTexImage1DARB"));
5167 if (ctx->ExecuteFlag) {
5168 CALL_CompressedTexImage1D(ctx->Exec,
5169 (target, level, internalFormat, width,
5170 border, imageSize, data));
5176 static void GLAPIENTRY
5177 save_CompressedTexImage2DARB(GLenum target, GLint level,
5178 GLenum internalFormat, GLsizei width,
5179 GLsizei height, GLint border, GLsizei imageSize,
5180 const GLvoid * data)
5182 GET_CURRENT_CONTEXT(ctx);
5183 if (target == GL_PROXY_TEXTURE_2D) {
5184 /* don't compile, execute immediately */
5185 CALL_CompressedTexImage2D(ctx->Exec, (target, level, internalFormat,
5186 width, height, border,
5191 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5193 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D,
5194 7 + POINTER_DWORDS);
5198 n[3].e = internalFormat;
5199 n[4].i = (GLint) width;
5200 n[5].i = (GLint) height;
5204 copy_data(data, imageSize, "glCompressedTexImage2DARB"));
5206 if (ctx->ExecuteFlag) {
5207 CALL_CompressedTexImage2D(ctx->Exec,
5208 (target, level, internalFormat, width,
5209 height, border, imageSize, data));
5215 static void GLAPIENTRY
5216 save_CompressedTexImage3DARB(GLenum target, GLint level,
5217 GLenum internalFormat, GLsizei width,
5218 GLsizei height, GLsizei depth, GLint border,
5219 GLsizei imageSize, const GLvoid * data)
5221 GET_CURRENT_CONTEXT(ctx);
5222 if (target == GL_PROXY_TEXTURE_3D) {
5223 /* don't compile, execute immediately */
5224 CALL_CompressedTexImage3D(ctx->Exec, (target, level, internalFormat,
5225 width, height, depth, border,
5230 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5232 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D,
5233 8 + POINTER_DWORDS);
5237 n[3].e = internalFormat;
5238 n[4].i = (GLint) width;
5239 n[5].i = (GLint) height;
5240 n[6].i = (GLint) depth;
5244 copy_data(data, imageSize, "glCompressedTexImage3DARB"));
5246 if (ctx->ExecuteFlag) {
5247 CALL_CompressedTexImage3D(ctx->Exec,
5248 (target, level, internalFormat, width,
5249 height, depth, border, imageSize,
5256 static void GLAPIENTRY
5257 save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset,
5258 GLsizei width, GLenum format,
5259 GLsizei imageSize, const GLvoid * data)
5262 GET_CURRENT_CONTEXT(ctx);
5263 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5265 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D,
5266 6 + POINTER_DWORDS);
5271 n[4].i = (GLint) width;
5275 copy_data(data, imageSize, "glCompressedTexSubImage1DARB"));
5277 if (ctx->ExecuteFlag) {
5278 CALL_CompressedTexSubImage1D(ctx->Exec, (target, level, xoffset,
5279 width, format, imageSize,
5285 static void GLAPIENTRY
5286 save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset,
5287 GLint yoffset, GLsizei width, GLsizei height,
5288 GLenum format, GLsizei imageSize,
5289 const GLvoid * data)
5292 GET_CURRENT_CONTEXT(ctx);
5293 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5295 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D,
5296 8 + POINTER_DWORDS);
5302 n[5].i = (GLint) width;
5303 n[6].i = (GLint) height;
5307 copy_data(data, imageSize, "glCompressedTexSubImage2DARB"));
5309 if (ctx->ExecuteFlag) {
5310 CALL_CompressedTexSubImage2D(ctx->Exec,
5311 (target, level, xoffset, yoffset, width,
5312 height, format, imageSize, data));
5317 static void GLAPIENTRY
5318 save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset,
5319 GLint yoffset, GLint zoffset, GLsizei width,
5320 GLsizei height, GLsizei depth, GLenum format,
5321 GLsizei imageSize, const GLvoid * data)
5324 GET_CURRENT_CONTEXT(ctx);
5325 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5327 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D,
5328 10 + POINTER_DWORDS);
5335 n[6].i = (GLint) width;
5336 n[7].i = (GLint) height;
5337 n[8].i = (GLint) depth;
5339 n[10].i = imageSize;
5340 save_pointer(&n[11],
5341 copy_data(data, imageSize, "glCompressedTexSubImage3DARB"));
5343 if (ctx->ExecuteFlag) {
5344 CALL_CompressedTexSubImage3D(ctx->Exec,
5345 (target, level, xoffset, yoffset,
5346 zoffset, width, height, depth, format,
5352 /* GL_ARB_multisample */
5353 static void GLAPIENTRY
5354 save_SampleCoverageARB(GLclampf value, GLboolean invert)
5356 GET_CURRENT_CONTEXT(ctx);
5358 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5359 n = alloc_instruction(ctx, OPCODE_SAMPLE_COVERAGE, 2);
5364 if (ctx->ExecuteFlag) {
5365 CALL_SampleCoverage(ctx->Exec, (value, invert));
5371 * GL_ARB_vertex_program
5373 static void GLAPIENTRY
5374 save_BindProgramARB(GLenum target, GLuint id)
5376 GET_CURRENT_CONTEXT(ctx);
5378 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5379 n = alloc_instruction(ctx, OPCODE_BIND_PROGRAM_ARB, 2);
5384 if (ctx->ExecuteFlag) {
5385 CALL_BindProgramARB(ctx->Exec, (target, id));
5389 static void GLAPIENTRY
5390 save_ProgramEnvParameter4fARB(GLenum target, GLuint index,
5391 GLfloat x, GLfloat y, GLfloat z, GLfloat w)
5393 GET_CURRENT_CONTEXT(ctx);
5395 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5396 n = alloc_instruction(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
5405 if (ctx->ExecuteFlag) {
5406 CALL_ProgramEnvParameter4fARB(ctx->Exec, (target, index, x, y, z, w));
5411 static void GLAPIENTRY
5412 save_ProgramEnvParameter4fvARB(GLenum target, GLuint index,
5413 const GLfloat *params)
5415 save_ProgramEnvParameter4fARB(target, index, params[0], params[1],
5416 params[2], params[3]);
5420 static void GLAPIENTRY
5421 save_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
5422 const GLfloat * params)
5424 GET_CURRENT_CONTEXT(ctx);
5426 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5430 const GLfloat * p = params;
5432 for (i = 0 ; i < count ; i++) {
5433 n = alloc_instruction(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
5446 if (ctx->ExecuteFlag) {
5447 CALL_ProgramEnvParameters4fvEXT(ctx->Exec, (target, index, count, params));
5452 static void GLAPIENTRY
5453 save_ProgramEnvParameter4dARB(GLenum target, GLuint index,
5454 GLdouble x, GLdouble y, GLdouble z, GLdouble w)
5456 save_ProgramEnvParameter4fARB(target, index,
5458 (GLfloat) y, (GLfloat) z, (GLfloat) w);
5462 static void GLAPIENTRY
5463 save_ProgramEnvParameter4dvARB(GLenum target, GLuint index,
5464 const GLdouble *params)
5466 save_ProgramEnvParameter4fARB(target, index,
5467 (GLfloat) params[0],
5468 (GLfloat) params[1],
5469 (GLfloat) params[2], (GLfloat) params[3]);
5473 static void GLAPIENTRY
5474 save_ProgramLocalParameter4fARB(GLenum target, GLuint index,
5475 GLfloat x, GLfloat y, GLfloat z, GLfloat w)
5477 GET_CURRENT_CONTEXT(ctx);
5479 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5480 n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
5489 if (ctx->ExecuteFlag) {
5490 CALL_ProgramLocalParameter4fARB(ctx->Exec, (target, index, x, y, z, w));
5495 static void GLAPIENTRY
5496 save_ProgramLocalParameter4fvARB(GLenum target, GLuint index,
5497 const GLfloat *params)
5499 GET_CURRENT_CONTEXT(ctx);
5501 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5502 n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
5511 if (ctx->ExecuteFlag) {
5512 CALL_ProgramLocalParameter4fvARB(ctx->Exec, (target, index, params));
5517 static void GLAPIENTRY
5518 save_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
5519 const GLfloat *params)
5521 GET_CURRENT_CONTEXT(ctx);
5523 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5527 const GLfloat * p = params;
5529 for (i = 0 ; i < count ; i++) {
5530 n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
5543 if (ctx->ExecuteFlag) {
5544 CALL_ProgramLocalParameters4fvEXT(ctx->Exec, (target, index, count, params));
5549 static void GLAPIENTRY
5550 save_ProgramLocalParameter4dARB(GLenum target, GLuint index,
5551 GLdouble x, GLdouble y,
5552 GLdouble z, GLdouble w)
5554 GET_CURRENT_CONTEXT(ctx);
5556 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5557 n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
5561 n[3].f = (GLfloat) x;
5562 n[4].f = (GLfloat) y;
5563 n[5].f = (GLfloat) z;
5564 n[6].f = (GLfloat) w;
5566 if (ctx->ExecuteFlag) {
5567 CALL_ProgramLocalParameter4dARB(ctx->Exec, (target, index, x, y, z, w));
5572 static void GLAPIENTRY
5573 save_ProgramLocalParameter4dvARB(GLenum target, GLuint index,
5574 const GLdouble *params)
5576 GET_CURRENT_CONTEXT(ctx);
5578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5579 n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
5583 n[3].f = (GLfloat) params[0];
5584 n[4].f = (GLfloat) params[1];
5585 n[5].f = (GLfloat) params[2];
5586 n[6].f = (GLfloat) params[3];
5588 if (ctx->ExecuteFlag) {
5589 CALL_ProgramLocalParameter4dvARB(ctx->Exec, (target, index, params));
5594 /* GL_EXT_stencil_two_side */
5595 static void GLAPIENTRY
5596 save_ActiveStencilFaceEXT(GLenum face)
5598 GET_CURRENT_CONTEXT(ctx);
5600 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5601 n = alloc_instruction(ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 1);
5605 if (ctx->ExecuteFlag) {
5606 CALL_ActiveStencilFaceEXT(ctx->Exec, (face));
5611 /* GL_EXT_depth_bounds_test */
5612 static void GLAPIENTRY
5613 save_DepthBoundsEXT(GLclampd zmin, GLclampd zmax)
5615 GET_CURRENT_CONTEXT(ctx);
5617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5618 n = alloc_instruction(ctx, OPCODE_DEPTH_BOUNDS_EXT, 2);
5620 n[1].f = (GLfloat) zmin;
5621 n[2].f = (GLfloat) zmax;
5623 if (ctx->ExecuteFlag) {
5624 CALL_DepthBoundsEXT(ctx->Exec, (zmin, zmax));
5630 static void GLAPIENTRY
5631 save_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
5632 const GLvoid * string)
5634 GET_CURRENT_CONTEXT(ctx);
5637 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5639 n = alloc_instruction(ctx, OPCODE_PROGRAM_STRING_ARB, 3 + POINTER_DWORDS);
5641 GLubyte *programCopy = malloc(len);
5643 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB");
5646 memcpy(programCopy, string, len);
5650 save_pointer(&n[4], programCopy);
5652 if (ctx->ExecuteFlag) {
5653 CALL_ProgramStringARB(ctx->Exec, (target, format, len, string));
5658 static void GLAPIENTRY
5659 save_BeginQueryARB(GLenum target, GLuint id)
5661 GET_CURRENT_CONTEXT(ctx);
5663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5664 n = alloc_instruction(ctx, OPCODE_BEGIN_QUERY_ARB, 2);
5669 if (ctx->ExecuteFlag) {
5670 CALL_BeginQuery(ctx->Exec, (target, id));
5674 static void GLAPIENTRY
5675 save_EndQueryARB(GLenum target)
5677 GET_CURRENT_CONTEXT(ctx);
5679 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5680 n = alloc_instruction(ctx, OPCODE_END_QUERY_ARB, 1);
5684 if (ctx->ExecuteFlag) {
5685 CALL_EndQuery(ctx->Exec, (target));
5689 static void GLAPIENTRY
5690 save_QueryCounter(GLuint id, GLenum target)
5692 GET_CURRENT_CONTEXT(ctx);
5694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5695 n = alloc_instruction(ctx, OPCODE_QUERY_COUNTER, 2);
5700 if (ctx->ExecuteFlag) {
5701 CALL_QueryCounter(ctx->Exec, (id, target));
5705 static void GLAPIENTRY
5706 save_BeginQueryIndexed(GLenum target, GLuint index, GLuint id)
5708 GET_CURRENT_CONTEXT(ctx);
5710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5711 n = alloc_instruction(ctx, OPCODE_BEGIN_QUERY_INDEXED, 3);
5717 if (ctx->ExecuteFlag) {
5718 CALL_BeginQueryIndexed(ctx->Exec, (target, index, id));
5722 static void GLAPIENTRY
5723 save_EndQueryIndexed(GLenum target, GLuint index)
5725 GET_CURRENT_CONTEXT(ctx);
5727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5728 n = alloc_instruction(ctx, OPCODE_END_QUERY_INDEXED, 2);
5733 if (ctx->ExecuteFlag) {
5734 CALL_EndQueryIndexed(ctx->Exec, (target, index));
5739 static void GLAPIENTRY
5740 save_DrawBuffersARB(GLsizei count, const GLenum * buffers)
5742 GET_CURRENT_CONTEXT(ctx);
5744 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5745 n = alloc_instruction(ctx, OPCODE_DRAW_BUFFERS_ARB, 1 + MAX_DRAW_BUFFERS);
5749 if (count > MAX_DRAW_BUFFERS)
5750 count = MAX_DRAW_BUFFERS;
5751 for (i = 0; i < count; i++) {
5752 n[2 + i].e = buffers[i];
5755 if (ctx->ExecuteFlag) {
5756 CALL_DrawBuffers(ctx->Exec, (count, buffers));
5760 static void GLAPIENTRY
5761 save_BindFragmentShaderATI(GLuint id)
5763 GET_CURRENT_CONTEXT(ctx);
5766 n = alloc_instruction(ctx, OPCODE_BIND_FRAGMENT_SHADER_ATI, 1);
5770 if (ctx->ExecuteFlag) {
5771 CALL_BindFragmentShaderATI(ctx->Exec, (id));
5775 static void GLAPIENTRY
5776 save_SetFragmentShaderConstantATI(GLuint dst, const GLfloat *value)
5778 GET_CURRENT_CONTEXT(ctx);
5781 n = alloc_instruction(ctx, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, 5);
5789 if (ctx->ExecuteFlag) {
5790 CALL_SetFragmentShaderConstantATI(ctx->Exec, (dst, value));
5794 static void GLAPIENTRY
5795 save_EvalCoord1f(GLfloat x)
5797 GET_CURRENT_CONTEXT(ctx);
5799 SAVE_FLUSH_VERTICES(ctx);
5800 n = alloc_instruction(ctx, OPCODE_EVAL_C1, 1);
5804 if (ctx->ExecuteFlag) {
5805 CALL_EvalCoord1f(ctx->Exec, (x));
5809 static void GLAPIENTRY
5810 save_EvalCoord1fv(const GLfloat * v)
5812 save_EvalCoord1f(v[0]);
5815 static void GLAPIENTRY
5816 save_EvalCoord2f(GLfloat x, GLfloat y)
5818 GET_CURRENT_CONTEXT(ctx);
5820 SAVE_FLUSH_VERTICES(ctx);
5821 n = alloc_instruction(ctx, OPCODE_EVAL_C2, 2);
5826 if (ctx->ExecuteFlag) {
5827 CALL_EvalCoord2f(ctx->Exec, (x, y));
5831 static void GLAPIENTRY
5832 save_EvalCoord2fv(const GLfloat * v)
5834 save_EvalCoord2f(v[0], v[1]);
5838 static void GLAPIENTRY
5839 save_EvalPoint1(GLint x)
5841 GET_CURRENT_CONTEXT(ctx);
5843 SAVE_FLUSH_VERTICES(ctx);
5844 n = alloc_instruction(ctx, OPCODE_EVAL_P1, 1);
5848 if (ctx->ExecuteFlag) {
5849 CALL_EvalPoint1(ctx->Exec, (x));
5853 static void GLAPIENTRY
5854 save_EvalPoint2(GLint x, GLint y)
5856 GET_CURRENT_CONTEXT(ctx);
5858 SAVE_FLUSH_VERTICES(ctx);
5859 n = alloc_instruction(ctx, OPCODE_EVAL_P2, 2);
5864 if (ctx->ExecuteFlag) {
5865 CALL_EvalPoint2(ctx->Exec, (x, y));
5871 * Compare 'count' elements of vectors 'a' and 'b'.
5872 * \return GL_TRUE if equal, GL_FALSE if different.
5874 static inline GLboolean
5875 compare_vec(const GLfloat *a, const GLfloat *b, GLuint count)
5877 return memcmp( a, b, count * sizeof(GLfloat) ) == 0;
5882 * This glMaterial function is used for glMaterial calls that are outside
5883 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
5885 static void GLAPIENTRY
5886 save_Materialfv(GLenum face, GLenum pname, const GLfloat * param)
5888 GET_CURRENT_CONTEXT(ctx);
5896 case GL_FRONT_AND_BACK:
5899 _mesa_compile_error(ctx, GL_INVALID_ENUM, "glMaterial(face)");
5908 case GL_AMBIENT_AND_DIFFUSE:
5914 case GL_COLOR_INDEXES:
5918 _mesa_compile_error(ctx, GL_INVALID_ENUM, "glMaterial(pname)");
5922 if (ctx->ExecuteFlag) {
5923 CALL_Materialfv(ctx->Exec, (face, pname, param));
5926 bitmask = _mesa_material_bitmask(ctx, face, pname, ~0, NULL);
5928 /* Try to eliminate redundant statechanges. Because it is legal to
5929 * call glMaterial even inside begin/end calls, don't need to worry
5930 * about ctx->Driver.CurrentSavePrimitive here.
5932 for (i = 0; i < MAT_ATTRIB_MAX; i++) {
5933 if (bitmask & (1 << i)) {
5934 if (ctx->ListState.ActiveMaterialSize[i] == args &&
5935 compare_vec(ctx->ListState.CurrentMaterial[i], param, args)) {
5936 /* no change in material value */
5937 bitmask &= ~(1 << i);
5940 ctx->ListState.ActiveMaterialSize[i] = args;
5941 COPY_SZ_4V(ctx->ListState.CurrentMaterial[i], args, param);
5946 /* If this call has no effect, return early */
5950 SAVE_FLUSH_VERTICES(ctx);
5952 n = alloc_instruction(ctx, OPCODE_MATERIAL, 6);
5956 for (i = 0; i < args; i++)
5957 n[3 + i].f = param[i];
5961 static void GLAPIENTRY
5962 save_Begin(GLenum mode)
5964 GET_CURRENT_CONTEXT(ctx);
5966 if (!_mesa_is_valid_prim_mode(ctx, mode)) {
5967 /* compile this error into the display list */
5968 _mesa_compile_error(ctx, GL_INVALID_ENUM, "glBegin(mode)");
5970 else if (_mesa_inside_dlist_begin_end(ctx)) {
5971 /* compile this error into the display list */
5972 _mesa_compile_error(ctx, GL_INVALID_OPERATION, "recursive glBegin");
5975 ctx->Driver.CurrentSavePrimitive = mode;
5977 vbo_save_NotifyBegin(ctx, mode, false);
5981 static void GLAPIENTRY
5984 GET_CURRENT_CONTEXT(ctx);
5985 SAVE_FLUSH_VERTICES(ctx);
5986 (void) alloc_instruction(ctx, OPCODE_END, 0);
5987 ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
5988 if (ctx->ExecuteFlag) {
5989 CALL_End(ctx->Exec, ());
5993 static void GLAPIENTRY
5994 save_PrimitiveRestartNV(void)
5996 /* Note: this is used when outside a glBegin/End pair in a display list */
5997 GET_CURRENT_CONTEXT(ctx);
5998 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5999 (void) alloc_instruction(ctx, OPCODE_PRIMITIVE_RESTART_NV, 0);
6000 if (ctx->ExecuteFlag) {
6001 CALL_PrimitiveRestartNV(ctx->Exec, ());
6006 static void GLAPIENTRY
6007 save_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
6008 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
6009 GLbitfield mask, GLenum filter)
6011 GET_CURRENT_CONTEXT(ctx);
6013 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6014 n = alloc_instruction(ctx, OPCODE_BLIT_FRAMEBUFFER, 10);
6027 if (ctx->ExecuteFlag) {
6028 CALL_BlitFramebuffer(ctx->Exec, (srcX0, srcY0, srcX1, srcY1,
6029 dstX0, dstY0, dstX1, dstY1,
6035 /** GL_EXT_provoking_vertex */
6036 static void GLAPIENTRY
6037 save_ProvokingVertexEXT(GLenum mode)
6039 GET_CURRENT_CONTEXT(ctx);
6041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6042 n = alloc_instruction(ctx, OPCODE_PROVOKING_VERTEX, 1);
6046 if (ctx->ExecuteFlag) {
6047 /*CALL_ProvokingVertex(ctx->Exec, (mode));*/
6048 _mesa_ProvokingVertex(mode);
6053 /** GL_EXT_transform_feedback */
6054 static void GLAPIENTRY
6055 save_BeginTransformFeedback(GLenum mode)
6057 GET_CURRENT_CONTEXT(ctx);
6059 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6060 n = alloc_instruction(ctx, OPCODE_BEGIN_TRANSFORM_FEEDBACK, 1);
6064 if (ctx->ExecuteFlag) {
6065 CALL_BeginTransformFeedback(ctx->Exec, (mode));
6070 /** GL_EXT_transform_feedback */
6071 static void GLAPIENTRY
6072 save_EndTransformFeedback(void)
6074 GET_CURRENT_CONTEXT(ctx);
6075 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6076 (void) alloc_instruction(ctx, OPCODE_END_TRANSFORM_FEEDBACK, 0);
6077 if (ctx->ExecuteFlag) {
6078 CALL_EndTransformFeedback(ctx->Exec, ());
6082 static void GLAPIENTRY
6083 save_BindTransformFeedback(GLenum target, GLuint name)
6085 GET_CURRENT_CONTEXT(ctx);
6087 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6088 n = alloc_instruction(ctx, OPCODE_BIND_TRANSFORM_FEEDBACK, 2);
6093 if (ctx->ExecuteFlag) {
6094 CALL_BindTransformFeedback(ctx->Exec, (target, name));
6098 static void GLAPIENTRY
6099 save_PauseTransformFeedback(void)
6101 GET_CURRENT_CONTEXT(ctx);
6102 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6103 (void) alloc_instruction(ctx, OPCODE_PAUSE_TRANSFORM_FEEDBACK, 0);
6104 if (ctx->ExecuteFlag) {
6105 CALL_PauseTransformFeedback(ctx->Exec, ());
6109 static void GLAPIENTRY
6110 save_ResumeTransformFeedback(void)
6112 GET_CURRENT_CONTEXT(ctx);
6113 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6114 (void) alloc_instruction(ctx, OPCODE_RESUME_TRANSFORM_FEEDBACK, 0);
6115 if (ctx->ExecuteFlag) {
6116 CALL_ResumeTransformFeedback(ctx->Exec, ());
6120 static void GLAPIENTRY
6121 save_DrawTransformFeedback(GLenum mode, GLuint name)
6123 GET_CURRENT_CONTEXT(ctx);
6125 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6126 n = alloc_instruction(ctx, OPCODE_DRAW_TRANSFORM_FEEDBACK, 2);
6131 if (ctx->ExecuteFlag) {
6132 CALL_DrawTransformFeedback(ctx->Exec, (mode, name));
6136 static void GLAPIENTRY
6137 save_DrawTransformFeedbackStream(GLenum mode, GLuint name, GLuint stream)
6139 GET_CURRENT_CONTEXT(ctx);
6141 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6142 n = alloc_instruction(ctx, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM, 3);
6148 if (ctx->ExecuteFlag) {
6149 CALL_DrawTransformFeedbackStream(ctx->Exec, (mode, name, stream));
6153 static void GLAPIENTRY
6154 save_DrawTransformFeedbackInstanced(GLenum mode, GLuint name,
6157 GET_CURRENT_CONTEXT(ctx);
6159 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6160 n = alloc_instruction(ctx, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED, 3);
6164 n[3].si = primcount;
6166 if (ctx->ExecuteFlag) {
6167 CALL_DrawTransformFeedbackInstanced(ctx->Exec, (mode, name, primcount));
6171 static void GLAPIENTRY
6172 save_DrawTransformFeedbackStreamInstanced(GLenum mode, GLuint name,
6173 GLuint stream, GLsizei primcount)
6175 GET_CURRENT_CONTEXT(ctx);
6177 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6178 n = alloc_instruction(ctx, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED, 4);
6183 n[4].si = primcount;
6185 if (ctx->ExecuteFlag) {
6186 CALL_DrawTransformFeedbackStreamInstanced(ctx->Exec, (mode, name, stream,
6191 static void GLAPIENTRY
6192 save_DispatchCompute(GLuint num_groups_x, GLuint num_groups_y,
6193 GLuint num_groups_z)
6195 GET_CURRENT_CONTEXT(ctx);
6197 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6198 n = alloc_instruction(ctx, OPCODE_DISPATCH_COMPUTE, 3);
6200 n[1].ui = num_groups_x;
6201 n[2].ui = num_groups_y;
6202 n[3].ui = num_groups_z;
6204 if (ctx->ExecuteFlag) {
6205 CALL_DispatchCompute(ctx->Exec, (num_groups_x, num_groups_y,
6210 static void GLAPIENTRY
6211 save_DispatchComputeIndirect(GLintptr indirect)
6213 GET_CURRENT_CONTEXT(ctx);
6214 _mesa_error(ctx, GL_INVALID_OPERATION,
6215 "glDispatchComputeIndirect() during display list compile");
6218 static void ALWAYS_INLINE
6219 save_Attr32bit(struct gl_context *ctx, unsigned attr, unsigned size,
6220 GLenum type, uint32_t x, uint32_t y, uint32_t z, uint32_t w)
6223 SAVE_FLUSH_VERTICES(ctx);
6225 unsigned index = attr;
6227 /* We don't care about GL_INT vs GL_UNSIGNED_INT. The idea is to get W=1
6228 * right for 3 or lower number of components, so only distinguish between
6231 if (type == GL_FLOAT) {
6232 if (attr >= VERT_ATTRIB_GENERIC0) {
6233 base_op = OPCODE_ATTR_1F_ARB;
6234 attr -= VERT_ATTRIB_GENERIC0;
6236 base_op = OPCODE_ATTR_1F_NV;
6239 base_op = OPCODE_ATTR_1I;
6240 attr -= VERT_ATTRIB_GENERIC0;
6243 n = alloc_instruction(ctx, base_op + size - 1, 1 + size);
6247 if (size >= 2) n[3].ui = y;
6248 if (size >= 3) n[4].ui = z;
6249 if (size >= 4) n[5].ui = w;
6252 ctx->ListState.ActiveAttribSize[index] = size;
6253 ASSIGN_4V(ctx->ListState.CurrentAttrib[index], x, y, z, w);
6255 if (ctx->ExecuteFlag) {
6256 if (type == GL_FLOAT) {
6257 if (base_op == OPCODE_ATTR_1F_NV) {
6259 CALL_VertexAttrib4fNV(ctx->Exec, (attr, uif(x), uif(y), uif(z), uif(w)));
6261 CALL_VertexAttrib3fNV(ctx->Exec, (attr, uif(x), uif(y), uif(z)));
6263 CALL_VertexAttrib2fNV(ctx->Exec, (attr, uif(x), uif(y)));
6265 CALL_VertexAttrib1fNV(ctx->Exec, (attr, uif(x)));
6268 CALL_VertexAttrib4fARB(ctx->Exec, (attr, uif(x), uif(y), uif(z), uif(w)));
6270 CALL_VertexAttrib3fARB(ctx->Exec, (attr, uif(x), uif(y), uif(z)));
6272 CALL_VertexAttrib2fARB(ctx->Exec, (attr, uif(x), uif(y)));
6274 CALL_VertexAttrib1fARB(ctx->Exec, (attr, uif(x)));
6278 CALL_VertexAttribI4iEXT(ctx->Exec, (attr, x, y, z, w));
6280 CALL_VertexAttribI3iEXT(ctx->Exec, (attr, x, y, z));
6282 CALL_VertexAttribI2iEXT(ctx->Exec, (attr, x, y));
6284 CALL_VertexAttribI1iEXT(ctx->Exec, (attr, x));
6289 static void ALWAYS_INLINE
6290 save_Attr64bit(struct gl_context *ctx, unsigned attr, unsigned size,
6291 GLenum type, uint64_t x, uint64_t y, uint64_t z, uint64_t w)
6294 SAVE_FLUSH_VERTICES(ctx);
6296 unsigned index = attr;
6298 if (type == GL_DOUBLE) {
6299 base_op = OPCODE_ATTR_1D;
6301 base_op = OPCODE_ATTR_1UI64;
6305 attr -= VERT_ATTRIB_GENERIC0;
6306 n = alloc_instruction(ctx, base_op + size - 1, 1 + size * 2);
6309 ASSIGN_UINT64_TO_NODES(n, 2, x);
6310 if (size >= 2) ASSIGN_UINT64_TO_NODES(n, 4, y);
6311 if (size >= 3) ASSIGN_UINT64_TO_NODES(n, 6, z);
6312 if (size >= 4) ASSIGN_UINT64_TO_NODES(n, 8, w);
6315 ctx->ListState.ActiveAttribSize[index] = size;
6316 memcpy(ctx->ListState.CurrentAttrib[index], &n[2], size * sizeof(uint64_t));
6318 if (ctx->ExecuteFlag) {
6319 uint64_t v[] = {x, y, z, w};
6320 if (type == GL_DOUBLE) {
6322 CALL_VertexAttribL4dv(ctx->Exec, (attr, (GLdouble*)v));
6324 CALL_VertexAttribL3dv(ctx->Exec, (attr, (GLdouble*)v));
6326 CALL_VertexAttribL2dv(ctx->Exec, (attr, (GLdouble*)v));
6328 CALL_VertexAttribL1d(ctx->Exec, (attr, UINT64_AS_DOUBLE(x)));
6330 CALL_VertexAttribL1ui64ARB(ctx->Exec, (attr, x));
6336 * If index=0, does glVertexAttrib*() alias glVertex() to emit a vertex?
6337 * It depends on a few things, including whether we're inside or outside
6341 is_vertex_position(const struct gl_context *ctx, GLuint index)
6343 return (index == 0 &&
6344 _mesa_attr_zero_aliases_vertex(ctx) &&
6345 _mesa_inside_dlist_begin_end(ctx));
6349 * This macro is used to implement all the glVertex, glColor, glTexCoord,
6350 * glVertexAttrib, etc functions.
6351 * \param A VBO_ATTRIB_x attribute index
6352 * \param N attribute size (1..4)
6353 * \param T type (GL_FLOAT, GL_DOUBLE, GL_INT, GL_UNSIGNED_INT)
6354 * \param C cast type (uint32_t or uint64_t)
6355 * \param V0, V1, v2, V3 attribute value
6357 #define ATTR_UNION(A, N, T, C, V0, V1, V2, V3) \
6359 if (sizeof(C) == 4) { \
6360 save_Attr32bit(ctx, A, N, T, V0, V1, V2, V3); \
6362 save_Attr64bit(ctx, A, N, T, V0, V1, V2, V3); \
6367 #define ERROR(err) _mesa_error(ctx, err, __func__)
6368 #define TAG(x) save_##x
6370 #define VBO_ATTRIB_POS VERT_ATTRIB_POS
6371 #define VBO_ATTRIB_NORMAL VERT_ATTRIB_NORMAL
6372 #define VBO_ATTRIB_COLOR0 VERT_ATTRIB_COLOR0
6373 #define VBO_ATTRIB_COLOR1 VERT_ATTRIB_COLOR1
6374 #define VBO_ATTRIB_FOG VERT_ATTRIB_FOG
6375 #define VBO_ATTRIB_COLOR_INDEX VERT_ATTRIB_COLOR_INDEX
6376 #define VBO_ATTRIB_EDGEFLAG VERT_ATTRIB_EDGEFLAG
6377 #define VBO_ATTRIB_TEX0 VERT_ATTRIB_TEX0
6378 #define VBO_ATTRIB_GENERIC0 VERT_ATTRIB_GENERIC0
6379 #define VBO_ATTRIB_MAX VERT_ATTRIB_MAX
6381 #include "vbo/vbo_attrib_tmp.h"
6383 static void GLAPIENTRY
6384 save_UseProgram(GLuint program)
6386 GET_CURRENT_CONTEXT(ctx);
6388 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6389 n = alloc_instruction(ctx, OPCODE_USE_PROGRAM, 1);
6393 if (ctx->ExecuteFlag) {
6394 CALL_UseProgram(ctx->Exec, (program));
6399 static void GLAPIENTRY
6400 save_Uniform1fARB(GLint location, GLfloat x)
6402 GET_CURRENT_CONTEXT(ctx);
6404 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6405 n = alloc_instruction(ctx, OPCODE_UNIFORM_1F, 2);
6410 if (ctx->ExecuteFlag) {
6411 CALL_Uniform1f(ctx->Exec, (location, x));
6416 static void GLAPIENTRY
6417 save_Uniform2fARB(GLint location, GLfloat x, GLfloat y)
6419 GET_CURRENT_CONTEXT(ctx);
6421 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6422 n = alloc_instruction(ctx, OPCODE_UNIFORM_2F, 3);
6428 if (ctx->ExecuteFlag) {
6429 CALL_Uniform2f(ctx->Exec, (location, x, y));
6434 static void GLAPIENTRY
6435 save_Uniform3fARB(GLint location, GLfloat x, GLfloat y, GLfloat z)
6437 GET_CURRENT_CONTEXT(ctx);
6439 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6440 n = alloc_instruction(ctx, OPCODE_UNIFORM_3F, 4);
6447 if (ctx->ExecuteFlag) {
6448 CALL_Uniform3f(ctx->Exec, (location, x, y, z));
6453 static void GLAPIENTRY
6454 save_Uniform4fARB(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
6456 GET_CURRENT_CONTEXT(ctx);
6458 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6459 n = alloc_instruction(ctx, OPCODE_UNIFORM_4F, 5);
6467 if (ctx->ExecuteFlag) {
6468 CALL_Uniform4f(ctx->Exec, (location, x, y, z, w));
6473 static void GLAPIENTRY
6474 save_Uniform1fvARB(GLint location, GLsizei count, const GLfloat *v)
6476 GET_CURRENT_CONTEXT(ctx);
6478 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6479 n = alloc_instruction(ctx, OPCODE_UNIFORM_1FV, 2 + POINTER_DWORDS);
6483 save_pointer(&n[3], memdup(v, count * 1 * sizeof(GLfloat)));
6485 if (ctx->ExecuteFlag) {
6486 CALL_Uniform1fv(ctx->Exec, (location, count, v));
6490 static void GLAPIENTRY
6491 save_Uniform2fvARB(GLint location, GLsizei count, const GLfloat *v)
6493 GET_CURRENT_CONTEXT(ctx);
6495 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6496 n = alloc_instruction(ctx, OPCODE_UNIFORM_2FV, 2 + POINTER_DWORDS);
6500 save_pointer(&n[3], memdup(v, count * 2 * sizeof(GLfloat)));
6502 if (ctx->ExecuteFlag) {
6503 CALL_Uniform2fv(ctx->Exec, (location, count, v));
6507 static void GLAPIENTRY
6508 save_Uniform3fvARB(GLint location, GLsizei count, const GLfloat *v)
6510 GET_CURRENT_CONTEXT(ctx);
6512 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6513 n = alloc_instruction(ctx, OPCODE_UNIFORM_3FV, 2 + POINTER_DWORDS);
6517 save_pointer(&n[3], memdup(v, count * 3 * sizeof(GLfloat)));
6519 if (ctx->ExecuteFlag) {
6520 CALL_Uniform3fv(ctx->Exec, (location, count, v));
6524 static void GLAPIENTRY
6525 save_Uniform4fvARB(GLint location, GLsizei count, const GLfloat *v)
6527 GET_CURRENT_CONTEXT(ctx);
6529 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6530 n = alloc_instruction(ctx, OPCODE_UNIFORM_4FV, 2 + POINTER_DWORDS);
6534 save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLfloat)));
6536 if (ctx->ExecuteFlag) {
6537 CALL_Uniform4fv(ctx->Exec, (location, count, v));
6542 static void GLAPIENTRY
6543 save_Uniform1d(GLint location, GLdouble x)
6545 GET_CURRENT_CONTEXT(ctx);
6547 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6548 n = alloc_instruction(ctx, OPCODE_UNIFORM_1D, 3);
6551 ASSIGN_DOUBLE_TO_NODES(n, 2, x);
6553 if (ctx->ExecuteFlag) {
6554 CALL_Uniform1d(ctx->Exec, (location, x));
6559 static void GLAPIENTRY
6560 save_Uniform2d(GLint location, GLdouble x, GLdouble y)
6562 GET_CURRENT_CONTEXT(ctx);
6564 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6565 n = alloc_instruction(ctx, OPCODE_UNIFORM_2D, 5);
6568 ASSIGN_DOUBLE_TO_NODES(n, 2, x);
6569 ASSIGN_DOUBLE_TO_NODES(n, 4, y);
6571 if (ctx->ExecuteFlag) {
6572 CALL_Uniform2d(ctx->Exec, (location, x, y));
6577 static void GLAPIENTRY
6578 save_Uniform3d(GLint location, GLdouble x, GLdouble y, GLdouble z)
6580 GET_CURRENT_CONTEXT(ctx);
6582 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6583 n = alloc_instruction(ctx, OPCODE_UNIFORM_3D, 7);
6586 ASSIGN_DOUBLE_TO_NODES(n, 2, x);
6587 ASSIGN_DOUBLE_TO_NODES(n, 4, y);
6588 ASSIGN_DOUBLE_TO_NODES(n, 6, z);
6590 if (ctx->ExecuteFlag) {
6591 CALL_Uniform3d(ctx->Exec, (location, x, y, z));
6596 static void GLAPIENTRY
6597 save_Uniform4d(GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
6599 GET_CURRENT_CONTEXT(ctx);
6601 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6602 n = alloc_instruction(ctx, OPCODE_UNIFORM_4D, 9);
6605 ASSIGN_DOUBLE_TO_NODES(n, 2, x);
6606 ASSIGN_DOUBLE_TO_NODES(n, 4, y);
6607 ASSIGN_DOUBLE_TO_NODES(n, 6, z);
6608 ASSIGN_DOUBLE_TO_NODES(n, 8, w);
6610 if (ctx->ExecuteFlag) {
6611 CALL_Uniform4d(ctx->Exec, (location, x, y, z, w));
6616 static void GLAPIENTRY
6617 save_Uniform1dv(GLint location, GLsizei count, const GLdouble *v)
6619 GET_CURRENT_CONTEXT(ctx);
6621 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6622 n = alloc_instruction(ctx, OPCODE_UNIFORM_1DV, 2 + POINTER_DWORDS);
6626 save_pointer(&n[3], memdup(v, count * 1 * sizeof(GLdouble)));
6628 if (ctx->ExecuteFlag) {
6629 CALL_Uniform1dv(ctx->Exec, (location, count, v));
6634 static void GLAPIENTRY
6635 save_Uniform2dv(GLint location, GLsizei count, const GLdouble *v)
6637 GET_CURRENT_CONTEXT(ctx);
6639 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6640 n = alloc_instruction(ctx, OPCODE_UNIFORM_2DV, 2 + POINTER_DWORDS);
6644 save_pointer(&n[3], memdup(v, count * 2 * sizeof(GLdouble)));
6646 if (ctx->ExecuteFlag) {
6647 CALL_Uniform2dv(ctx->Exec, (location, count, v));
6652 static void GLAPIENTRY
6653 save_Uniform3dv(GLint location, GLsizei count, const GLdouble *v)
6655 GET_CURRENT_CONTEXT(ctx);
6657 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6658 n = alloc_instruction(ctx, OPCODE_UNIFORM_3DV, 2 + POINTER_DWORDS);
6662 save_pointer(&n[3], memdup(v, count * 3 * sizeof(GLdouble)));
6664 if (ctx->ExecuteFlag) {
6665 CALL_Uniform3dv(ctx->Exec, (location, count, v));
6670 static void GLAPIENTRY
6671 save_Uniform4dv(GLint location, GLsizei count, const GLdouble *v)
6673 GET_CURRENT_CONTEXT(ctx);
6675 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6676 n = alloc_instruction(ctx, OPCODE_UNIFORM_4DV, 2 + POINTER_DWORDS);
6680 save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLdouble)));
6682 if (ctx->ExecuteFlag) {
6683 CALL_Uniform4dv(ctx->Exec, (location, count, v));
6688 static void GLAPIENTRY
6689 save_Uniform1iARB(GLint location, GLint x)
6691 GET_CURRENT_CONTEXT(ctx);
6693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6694 n = alloc_instruction(ctx, OPCODE_UNIFORM_1I, 2);
6699 if (ctx->ExecuteFlag) {
6700 CALL_Uniform1i(ctx->Exec, (location, x));
6704 static void GLAPIENTRY
6705 save_Uniform2iARB(GLint location, GLint x, GLint y)
6707 GET_CURRENT_CONTEXT(ctx);
6709 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6710 n = alloc_instruction(ctx, OPCODE_UNIFORM_2I, 3);
6716 if (ctx->ExecuteFlag) {
6717 CALL_Uniform2i(ctx->Exec, (location, x, y));
6721 static void GLAPIENTRY
6722 save_Uniform3iARB(GLint location, GLint x, GLint y, GLint z)
6724 GET_CURRENT_CONTEXT(ctx);
6726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6727 n = alloc_instruction(ctx, OPCODE_UNIFORM_3I, 4);
6734 if (ctx->ExecuteFlag) {
6735 CALL_Uniform3i(ctx->Exec, (location, x, y, z));
6739 static void GLAPIENTRY
6740 save_Uniform4iARB(GLint location, GLint x, GLint y, GLint z, GLint w)
6742 GET_CURRENT_CONTEXT(ctx);
6744 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6745 n = alloc_instruction(ctx, OPCODE_UNIFORM_4I, 5);
6753 if (ctx->ExecuteFlag) {
6754 CALL_Uniform4i(ctx->Exec, (location, x, y, z, w));
6760 static void GLAPIENTRY
6761 save_Uniform1ivARB(GLint location, GLsizei count, const GLint *v)
6763 GET_CURRENT_CONTEXT(ctx);
6765 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6766 n = alloc_instruction(ctx, OPCODE_UNIFORM_1IV, 2 + POINTER_DWORDS);
6770 save_pointer(&n[3], memdup(v, count * 1 * sizeof(GLint)));
6772 if (ctx->ExecuteFlag) {
6773 CALL_Uniform1iv(ctx->Exec, (location, count, v));
6777 static void GLAPIENTRY
6778 save_Uniform2ivARB(GLint location, GLsizei count, const GLint *v)
6780 GET_CURRENT_CONTEXT(ctx);
6782 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6783 n = alloc_instruction(ctx, OPCODE_UNIFORM_2IV, 2 + POINTER_DWORDS);
6787 save_pointer(&n[3], memdup(v, count * 2 * sizeof(GLint)));
6789 if (ctx->ExecuteFlag) {
6790 CALL_Uniform2iv(ctx->Exec, (location, count, v));
6794 static void GLAPIENTRY
6795 save_Uniform3ivARB(GLint location, GLsizei count, const GLint *v)
6797 GET_CURRENT_CONTEXT(ctx);
6799 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6800 n = alloc_instruction(ctx, OPCODE_UNIFORM_3IV, 2 + POINTER_DWORDS);
6804 save_pointer(&n[3], memdup(v, count * 3 * sizeof(GLint)));
6806 if (ctx->ExecuteFlag) {
6807 CALL_Uniform3iv(ctx->Exec, (location, count, v));
6811 static void GLAPIENTRY
6812 save_Uniform4ivARB(GLint location, GLsizei count, const GLint *v)
6814 GET_CURRENT_CONTEXT(ctx);
6816 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6817 n = alloc_instruction(ctx, OPCODE_UNIFORM_4IV, 2 + POINTER_DWORDS);
6821 save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLfloat)));
6823 if (ctx->ExecuteFlag) {
6824 CALL_Uniform4iv(ctx->Exec, (location, count, v));
6830 static void GLAPIENTRY
6831 save_Uniform1ui(GLint location, GLuint x)
6833 GET_CURRENT_CONTEXT(ctx);
6835 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6836 n = alloc_instruction(ctx, OPCODE_UNIFORM_1UI, 2);
6841 if (ctx->ExecuteFlag) {
6842 CALL_Uniform1ui(ctx->Exec, (location, x));
6846 static void GLAPIENTRY
6847 save_Uniform2ui(GLint location, GLuint x, GLuint y)
6849 GET_CURRENT_CONTEXT(ctx);
6851 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6852 n = alloc_instruction(ctx, OPCODE_UNIFORM_2UI, 3);
6858 if (ctx->ExecuteFlag) {
6859 CALL_Uniform2ui(ctx->Exec, (location, x, y));
6863 static void GLAPIENTRY
6864 save_Uniform3ui(GLint location, GLuint x, GLuint y, GLuint z)
6866 GET_CURRENT_CONTEXT(ctx);
6868 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6869 n = alloc_instruction(ctx, OPCODE_UNIFORM_3UI, 4);
6876 if (ctx->ExecuteFlag) {
6877 CALL_Uniform3ui(ctx->Exec, (location, x, y, z));
6881 static void GLAPIENTRY
6882 save_Uniform4ui(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)
6884 GET_CURRENT_CONTEXT(ctx);
6886 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6887 n = alloc_instruction(ctx, OPCODE_UNIFORM_4UI, 5);
6895 if (ctx->ExecuteFlag) {
6896 CALL_Uniform4ui(ctx->Exec, (location, x, y, z, w));
6902 static void GLAPIENTRY
6903 save_Uniform1uiv(GLint location, GLsizei count, const GLuint *v)
6905 GET_CURRENT_CONTEXT(ctx);
6907 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6908 n = alloc_instruction(ctx, OPCODE_UNIFORM_1UIV, 2 + POINTER_DWORDS);
6912 save_pointer(&n[3], memdup(v, count * 1 * sizeof(*v)));
6914 if (ctx->ExecuteFlag) {
6915 CALL_Uniform1uiv(ctx->Exec, (location, count, v));
6919 static void GLAPIENTRY
6920 save_Uniform2uiv(GLint location, GLsizei count, const GLuint *v)
6922 GET_CURRENT_CONTEXT(ctx);
6924 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6925 n = alloc_instruction(ctx, OPCODE_UNIFORM_2UIV, 2 + POINTER_DWORDS);
6929 save_pointer(&n[3], memdup(v, count * 2 * sizeof(*v)));
6931 if (ctx->ExecuteFlag) {
6932 CALL_Uniform2uiv(ctx->Exec, (location, count, v));
6936 static void GLAPIENTRY
6937 save_Uniform3uiv(GLint location, GLsizei count, const GLuint *v)
6939 GET_CURRENT_CONTEXT(ctx);
6941 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6942 n = alloc_instruction(ctx, OPCODE_UNIFORM_3UIV, 2 + POINTER_DWORDS);
6946 save_pointer(&n[3], memdup(v, count * 3 * sizeof(*v)));
6948 if (ctx->ExecuteFlag) {
6949 CALL_Uniform3uiv(ctx->Exec, (location, count, v));
6953 static void GLAPIENTRY
6954 save_Uniform4uiv(GLint location, GLsizei count, const GLuint *v)
6956 GET_CURRENT_CONTEXT(ctx);
6958 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6959 n = alloc_instruction(ctx, OPCODE_UNIFORM_4UIV, 2 + POINTER_DWORDS);
6963 save_pointer(&n[3], memdup(v, count * 4 * sizeof(*v)));
6965 if (ctx->ExecuteFlag) {
6966 CALL_Uniform4uiv(ctx->Exec, (location, count, v));
6972 static void GLAPIENTRY
6973 save_UniformMatrix2fvARB(GLint location, GLsizei count, GLboolean transpose,
6976 GET_CURRENT_CONTEXT(ctx);
6978 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6979 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX22, 3 + POINTER_DWORDS);
6984 save_pointer(&n[4], memdup(m, count * 2 * 2 * sizeof(GLfloat)));
6986 if (ctx->ExecuteFlag) {
6987 CALL_UniformMatrix2fv(ctx->Exec, (location, count, transpose, m));
6991 static void GLAPIENTRY
6992 save_UniformMatrix3fvARB(GLint location, GLsizei count, GLboolean transpose,
6995 GET_CURRENT_CONTEXT(ctx);
6997 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6998 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX33, 3 + POINTER_DWORDS);
7003 save_pointer(&n[4], memdup(m, count * 3 * 3 * sizeof(GLfloat)));
7005 if (ctx->ExecuteFlag) {
7006 CALL_UniformMatrix3fv(ctx->Exec, (location, count, transpose, m));
7010 static void GLAPIENTRY
7011 save_UniformMatrix4fvARB(GLint location, GLsizei count, GLboolean transpose,
7014 GET_CURRENT_CONTEXT(ctx);
7016 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7017 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX44, 3 + POINTER_DWORDS);
7022 save_pointer(&n[4], memdup(m, count * 4 * 4 * sizeof(GLfloat)));
7024 if (ctx->ExecuteFlag) {
7025 CALL_UniformMatrix4fv(ctx->Exec, (location, count, transpose, m));
7030 static void GLAPIENTRY
7031 save_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
7034 GET_CURRENT_CONTEXT(ctx);
7036 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7037 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX23, 3 + POINTER_DWORDS);
7042 save_pointer(&n[4], memdup(m, count * 2 * 3 * sizeof(GLfloat)));
7044 if (ctx->ExecuteFlag) {
7045 CALL_UniformMatrix2x3fv(ctx->Exec, (location, count, transpose, m));
7049 static void GLAPIENTRY
7050 save_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose,
7053 GET_CURRENT_CONTEXT(ctx);
7055 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7056 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX32, 3 + POINTER_DWORDS);
7061 save_pointer(&n[4], memdup(m, count * 3 * 2 * sizeof(GLfloat)));
7063 if (ctx->ExecuteFlag) {
7064 CALL_UniformMatrix3x2fv(ctx->Exec, (location, count, transpose, m));
7069 static void GLAPIENTRY
7070 save_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose,
7073 GET_CURRENT_CONTEXT(ctx);
7075 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7076 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX24, 3 + POINTER_DWORDS);
7081 save_pointer(&n[4], memdup(m, count * 2 * 4 * sizeof(GLfloat)));
7083 if (ctx->ExecuteFlag) {
7084 CALL_UniformMatrix2x4fv(ctx->Exec, (location, count, transpose, m));
7088 static void GLAPIENTRY
7089 save_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose,
7092 GET_CURRENT_CONTEXT(ctx);
7094 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7095 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX42, 3 + POINTER_DWORDS);
7100 save_pointer(&n[4], memdup(m, count * 4 * 2 * sizeof(GLfloat)));
7102 if (ctx->ExecuteFlag) {
7103 CALL_UniformMatrix4x2fv(ctx->Exec, (location, count, transpose, m));
7108 static void GLAPIENTRY
7109 save_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
7112 GET_CURRENT_CONTEXT(ctx);
7114 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7115 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX34, 3 + POINTER_DWORDS);
7120 save_pointer(&n[4], memdup(m, count * 3 * 4 * sizeof(GLfloat)));
7122 if (ctx->ExecuteFlag) {
7123 CALL_UniformMatrix3x4fv(ctx->Exec, (location, count, transpose, m));
7127 static void GLAPIENTRY
7128 save_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
7131 GET_CURRENT_CONTEXT(ctx);
7133 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7134 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX43, 3 + POINTER_DWORDS);
7139 save_pointer(&n[4], memdup(m, count * 4 * 3 * sizeof(GLfloat)));
7141 if (ctx->ExecuteFlag) {
7142 CALL_UniformMatrix4x3fv(ctx->Exec, (location, count, transpose, m));
7147 static void GLAPIENTRY
7148 save_UniformMatrix2dv(GLint location, GLsizei count, GLboolean transpose,
7151 GET_CURRENT_CONTEXT(ctx);
7153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7154 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX22D, 3 + POINTER_DWORDS);
7159 save_pointer(&n[4], memdup(m, count * 2 * 2 * sizeof(GLdouble)));
7161 if (ctx->ExecuteFlag) {
7162 CALL_UniformMatrix2dv(ctx->Exec, (location, count, transpose, m));
7166 static void GLAPIENTRY
7167 save_UniformMatrix3dv(GLint location, GLsizei count, GLboolean transpose,
7170 GET_CURRENT_CONTEXT(ctx);
7172 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7173 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX33D, 3 + POINTER_DWORDS);
7178 save_pointer(&n[4], memdup(m, count * 3 * 3 * sizeof(GLdouble)));
7180 if (ctx->ExecuteFlag) {
7181 CALL_UniformMatrix3dv(ctx->Exec, (location, count, transpose, m));
7185 static void GLAPIENTRY
7186 save_UniformMatrix4dv(GLint location, GLsizei count, GLboolean transpose,
7189 GET_CURRENT_CONTEXT(ctx);
7191 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7192 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX44D, 3 + POINTER_DWORDS);
7197 save_pointer(&n[4], memdup(m, count * 4 * 4 * sizeof(GLdouble)));
7199 if (ctx->ExecuteFlag) {
7200 CALL_UniformMatrix4dv(ctx->Exec, (location, count, transpose, m));
7205 static void GLAPIENTRY
7206 save_UniformMatrix2x3dv(GLint location, GLsizei count, GLboolean transpose,
7209 GET_CURRENT_CONTEXT(ctx);
7211 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7212 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX23D, 3 + POINTER_DWORDS);
7217 save_pointer(&n[4], memdup(m, count * 2 * 3 * sizeof(GLdouble)));
7219 if (ctx->ExecuteFlag) {
7220 CALL_UniformMatrix2x3dv(ctx->Exec, (location, count, transpose, m));
7225 static void GLAPIENTRY
7226 save_UniformMatrix3x2dv(GLint location, GLsizei count, GLboolean transpose,
7229 GET_CURRENT_CONTEXT(ctx);
7231 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7232 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX32D, 3 + POINTER_DWORDS);
7237 save_pointer(&n[4], memdup(m, count * 3 * 2 * sizeof(GLdouble)));
7239 if (ctx->ExecuteFlag) {
7240 CALL_UniformMatrix3x2dv(ctx->Exec, (location, count, transpose, m));
7245 static void GLAPIENTRY
7246 save_UniformMatrix2x4dv(GLint location, GLsizei count, GLboolean transpose,
7249 GET_CURRENT_CONTEXT(ctx);
7251 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7252 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX24D, 3 + POINTER_DWORDS);
7257 save_pointer(&n[4], memdup(m, count * 2 * 4 * sizeof(GLdouble)));
7259 if (ctx->ExecuteFlag) {
7260 CALL_UniformMatrix2x4dv(ctx->Exec, (location, count, transpose, m));
7264 static void GLAPIENTRY
7265 save_UniformMatrix4x2dv(GLint location, GLsizei count, GLboolean transpose,
7268 GET_CURRENT_CONTEXT(ctx);
7270 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7271 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX42D, 3 + POINTER_DWORDS);
7276 save_pointer(&n[4], memdup(m, count * 4 * 2 * sizeof(GLdouble)));
7278 if (ctx->ExecuteFlag) {
7279 CALL_UniformMatrix4x2dv(ctx->Exec, (location, count, transpose, m));
7284 static void GLAPIENTRY
7285 save_UniformMatrix3x4dv(GLint location, GLsizei count, GLboolean transpose,
7288 GET_CURRENT_CONTEXT(ctx);
7290 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7291 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX34D, 3 + POINTER_DWORDS);
7296 save_pointer(&n[4], memdup(m, count * 3 * 4 * sizeof(GLdouble)));
7298 if (ctx->ExecuteFlag) {
7299 CALL_UniformMatrix3x4dv(ctx->Exec, (location, count, transpose, m));
7304 static void GLAPIENTRY
7305 save_UniformMatrix4x3dv(GLint location, GLsizei count, GLboolean transpose,
7308 GET_CURRENT_CONTEXT(ctx);
7310 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7311 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX43D, 3 + POINTER_DWORDS);
7316 save_pointer(&n[4], memdup(m, count * 4 * 3 * sizeof(GLdouble)));
7318 if (ctx->ExecuteFlag) {
7319 CALL_UniformMatrix4x3dv(ctx->Exec, (location, count, transpose, m));
7323 static void GLAPIENTRY
7324 save_Uniform1i64ARB(GLint location, GLint64 x)
7326 GET_CURRENT_CONTEXT(ctx);
7328 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7329 n = alloc_instruction(ctx, OPCODE_UNIFORM_1I64, 3);
7332 ASSIGN_INT64_TO_NODES(n, 2, x);
7334 if (ctx->ExecuteFlag) {
7335 CALL_Uniform1i64ARB(ctx->Exec, (location, x));
7339 static void GLAPIENTRY
7340 save_Uniform2i64ARB(GLint location, GLint64 x, GLint64 y)
7342 GET_CURRENT_CONTEXT(ctx);
7344 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7345 n = alloc_instruction(ctx, OPCODE_UNIFORM_2I64, 5);
7348 ASSIGN_INT64_TO_NODES(n, 2, x);
7349 ASSIGN_INT64_TO_NODES(n, 4, y);
7351 if (ctx->ExecuteFlag) {
7352 CALL_Uniform2i64ARB(ctx->Exec, (location, x, y));
7356 static void GLAPIENTRY
7357 save_Uniform3i64ARB(GLint location, GLint64 x, GLint64 y, GLint64 z)
7359 GET_CURRENT_CONTEXT(ctx);
7361 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7362 n = alloc_instruction(ctx, OPCODE_UNIFORM_3I64, 7);
7365 ASSIGN_INT64_TO_NODES(n, 2, x);
7366 ASSIGN_INT64_TO_NODES(n, 4, y);
7367 ASSIGN_INT64_TO_NODES(n, 6, z);
7369 if (ctx->ExecuteFlag) {
7370 CALL_Uniform3i64ARB(ctx->Exec, (location, x, y, z));
7374 static void GLAPIENTRY
7375 save_Uniform4i64ARB(GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w)
7377 GET_CURRENT_CONTEXT(ctx);
7379 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7380 n = alloc_instruction(ctx, OPCODE_UNIFORM_4I64, 9);
7383 ASSIGN_INT64_TO_NODES(n, 2, x);
7384 ASSIGN_INT64_TO_NODES(n, 4, y);
7385 ASSIGN_INT64_TO_NODES(n, 6, z);
7386 ASSIGN_INT64_TO_NODES(n, 8, w);
7388 if (ctx->ExecuteFlag) {
7389 CALL_Uniform4i64ARB(ctx->Exec, (location, x, y, z, w));
7393 static void GLAPIENTRY
7394 save_Uniform1i64vARB(GLint location, GLsizei count, const GLint64 *v)
7396 GET_CURRENT_CONTEXT(ctx);
7398 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7399 n = alloc_instruction(ctx, OPCODE_UNIFORM_1I64V, 2 + POINTER_DWORDS);
7403 save_pointer(&n[3], memdup(v, count * 1 * sizeof(GLint64)));
7405 if (ctx->ExecuteFlag) {
7406 CALL_Uniform1i64vARB(ctx->Exec, (location, count, v));
7410 static void GLAPIENTRY
7411 save_Uniform2i64vARB(GLint location, GLsizei count, const GLint64 *v)
7413 GET_CURRENT_CONTEXT(ctx);
7415 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7416 n = alloc_instruction(ctx, OPCODE_UNIFORM_2I64V, 2 + POINTER_DWORDS);
7420 save_pointer(&n[3], memdup(v, count * 2 * sizeof(GLint64)));
7422 if (ctx->ExecuteFlag) {
7423 CALL_Uniform2i64vARB(ctx->Exec, (location, count, v));
7427 static void GLAPIENTRY
7428 save_Uniform3i64vARB(GLint location, GLsizei count, const GLint64 *v)
7430 GET_CURRENT_CONTEXT(ctx);
7432 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7433 n = alloc_instruction(ctx, OPCODE_UNIFORM_3I64V, 2 + POINTER_DWORDS);
7437 save_pointer(&n[3], memdup(v, count * 3 * sizeof(GLint64)));
7439 if (ctx->ExecuteFlag) {
7440 CALL_Uniform3i64vARB(ctx->Exec, (location, count, v));
7444 static void GLAPIENTRY
7445 save_Uniform4i64vARB(GLint location, GLsizei count, const GLint64 *v)
7447 GET_CURRENT_CONTEXT(ctx);
7449 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7450 n = alloc_instruction(ctx, OPCODE_UNIFORM_4I64V, 2 + POINTER_DWORDS);
7454 save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLint64)));
7456 if (ctx->ExecuteFlag) {
7457 CALL_Uniform4i64vARB(ctx->Exec, (location, count, v));
7461 static void GLAPIENTRY
7462 save_Uniform1ui64ARB(GLint location, GLuint64 x)
7464 GET_CURRENT_CONTEXT(ctx);
7466 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7467 n = alloc_instruction(ctx, OPCODE_UNIFORM_1UI64, 3);
7470 ASSIGN_UINT64_TO_NODES(n, 2, x);
7472 if (ctx->ExecuteFlag) {
7473 CALL_Uniform1ui64ARB(ctx->Exec, (location, x));
7477 static void GLAPIENTRY
7478 save_Uniform2ui64ARB(GLint location, GLuint64 x, GLuint64 y)
7480 GET_CURRENT_CONTEXT(ctx);
7482 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7483 n = alloc_instruction(ctx, OPCODE_UNIFORM_2UI64, 5);
7486 ASSIGN_UINT64_TO_NODES(n, 2, x);
7487 ASSIGN_UINT64_TO_NODES(n, 4, y);
7489 if (ctx->ExecuteFlag) {
7490 CALL_Uniform2ui64ARB(ctx->Exec, (location, x, y));
7494 static void GLAPIENTRY
7495 save_Uniform3ui64ARB(GLint location, GLuint64 x, GLuint64 y, GLuint64 z)
7497 GET_CURRENT_CONTEXT(ctx);
7499 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7500 n = alloc_instruction(ctx, OPCODE_UNIFORM_3UI64, 7);
7503 ASSIGN_UINT64_TO_NODES(n, 2, x);
7504 ASSIGN_UINT64_TO_NODES(n, 4, y);
7505 ASSIGN_UINT64_TO_NODES(n, 6, z);
7507 if (ctx->ExecuteFlag) {
7508 CALL_Uniform3ui64ARB(ctx->Exec, (location, x, y, z));
7512 static void GLAPIENTRY
7513 save_Uniform4ui64ARB(GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w)
7515 GET_CURRENT_CONTEXT(ctx);
7517 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7518 n = alloc_instruction(ctx, OPCODE_UNIFORM_4UI64, 9);
7521 ASSIGN_UINT64_TO_NODES(n, 2, x);
7522 ASSIGN_UINT64_TO_NODES(n, 4, y);
7523 ASSIGN_UINT64_TO_NODES(n, 6, z);
7524 ASSIGN_UINT64_TO_NODES(n, 8, w);
7526 if (ctx->ExecuteFlag) {
7527 CALL_Uniform4ui64ARB(ctx->Exec, (location, x, y, z, w));
7531 static void GLAPIENTRY
7532 save_Uniform1ui64vARB(GLint location, GLsizei count, const GLuint64 *v)
7534 GET_CURRENT_CONTEXT(ctx);
7536 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7537 n = alloc_instruction(ctx, OPCODE_UNIFORM_1UI64V, 2 + POINTER_DWORDS);
7541 save_pointer(&n[3], memdup(v, count * 1 * sizeof(GLuint64)));
7543 if (ctx->ExecuteFlag) {
7544 CALL_Uniform1ui64vARB(ctx->Exec, (location, count, v));
7548 static void GLAPIENTRY
7549 save_Uniform2ui64vARB(GLint location, GLsizei count, const GLuint64 *v)
7551 GET_CURRENT_CONTEXT(ctx);
7553 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7554 n = alloc_instruction(ctx, OPCODE_UNIFORM_2UI64V, 2 + POINTER_DWORDS);
7558 save_pointer(&n[3], memdup(v, count * 2 * sizeof(GLuint64)));
7560 if (ctx->ExecuteFlag) {
7561 CALL_Uniform2ui64vARB(ctx->Exec, (location, count, v));
7565 static void GLAPIENTRY
7566 save_Uniform3ui64vARB(GLint location, GLsizei count, const GLuint64 *v)
7568 GET_CURRENT_CONTEXT(ctx);
7570 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7571 n = alloc_instruction(ctx, OPCODE_UNIFORM_3UI64V, 2 + POINTER_DWORDS);
7575 save_pointer(&n[3], memdup(v, count * 3 * sizeof(GLuint64)));
7577 if (ctx->ExecuteFlag) {
7578 CALL_Uniform3ui64vARB(ctx->Exec, (location, count, v));
7582 static void GLAPIENTRY
7583 save_Uniform4ui64vARB(GLint location, GLsizei count, const GLuint64 *v)
7585 GET_CURRENT_CONTEXT(ctx);
7587 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7588 n = alloc_instruction(ctx, OPCODE_UNIFORM_4UI64V, 2 + POINTER_DWORDS);
7592 save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLuint64)));
7594 if (ctx->ExecuteFlag) {
7595 CALL_Uniform4ui64vARB(ctx->Exec, (location, count, v));
7599 static void GLAPIENTRY
7600 save_ProgramUniform1i64ARB(GLuint program, GLint location, GLint64 x)
7602 GET_CURRENT_CONTEXT(ctx);
7604 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7605 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1I64, 4);
7609 ASSIGN_INT64_TO_NODES(n, 3, x);
7611 if (ctx->ExecuteFlag) {
7612 CALL_ProgramUniform1i64ARB(ctx->Exec, (program, location, x));
7616 static void GLAPIENTRY
7617 save_ProgramUniform2i64ARB(GLuint program, GLint location, GLint64 x,
7620 GET_CURRENT_CONTEXT(ctx);
7622 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7623 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2I64, 6);
7627 ASSIGN_INT64_TO_NODES(n, 3, x);
7628 ASSIGN_INT64_TO_NODES(n, 5, y);
7630 if (ctx->ExecuteFlag) {
7631 CALL_ProgramUniform2i64ARB(ctx->Exec, (program, location, x, y));
7635 static void GLAPIENTRY
7636 save_ProgramUniform3i64ARB(GLuint program, GLint location, GLint64 x,
7637 GLint64 y, GLint64 z)
7639 GET_CURRENT_CONTEXT(ctx);
7641 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7642 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3I64, 8);
7646 ASSIGN_INT64_TO_NODES(n, 3, x);
7647 ASSIGN_INT64_TO_NODES(n, 5, y);
7648 ASSIGN_INT64_TO_NODES(n, 7, z);
7650 if (ctx->ExecuteFlag) {
7651 CALL_ProgramUniform3i64ARB(ctx->Exec, (program, location, x, y, z));
7655 static void GLAPIENTRY
7656 save_ProgramUniform4i64ARB(GLuint program, GLint location, GLint64 x,
7657 GLint64 y, GLint64 z, GLint64 w)
7659 GET_CURRENT_CONTEXT(ctx);
7661 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7662 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4I64, 10);
7666 ASSIGN_INT64_TO_NODES(n, 3, x);
7667 ASSIGN_INT64_TO_NODES(n, 5, y);
7668 ASSIGN_INT64_TO_NODES(n, 7, z);
7669 ASSIGN_INT64_TO_NODES(n, 9, w);
7671 if (ctx->ExecuteFlag) {
7672 CALL_ProgramUniform4i64ARB(ctx->Exec, (program, location, x, y, z, w));
7676 static void GLAPIENTRY
7677 save_ProgramUniform1i64vARB(GLuint program, GLint location, GLsizei count,
7680 GET_CURRENT_CONTEXT(ctx);
7682 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7683 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1I64V, 3 + POINTER_DWORDS);
7688 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLint64)));
7690 if (ctx->ExecuteFlag) {
7691 CALL_ProgramUniform1i64vARB(ctx->Exec, (program, location, count, v));
7695 static void GLAPIENTRY
7696 save_ProgramUniform2i64vARB(GLuint program, GLint location, GLsizei count,
7699 GET_CURRENT_CONTEXT(ctx);
7701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7702 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2I64V, 3 + POINTER_DWORDS);
7707 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLint64)));
7709 if (ctx->ExecuteFlag) {
7710 CALL_ProgramUniform2i64vARB(ctx->Exec, (program, location, count, v));
7714 static void GLAPIENTRY
7715 save_ProgramUniform3i64vARB(GLuint program, GLint location, GLsizei count,
7718 GET_CURRENT_CONTEXT(ctx);
7720 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7721 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3I64V, 3 + POINTER_DWORDS);
7726 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLint64)));
7728 if (ctx->ExecuteFlag) {
7729 CALL_ProgramUniform3i64vARB(ctx->Exec, (program, location, count, v));
7733 static void GLAPIENTRY
7734 save_ProgramUniform4i64vARB(GLuint program, GLint location, GLsizei count,
7737 GET_CURRENT_CONTEXT(ctx);
7739 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7740 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4I64V, 3 + POINTER_DWORDS);
7745 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLint64)));
7747 if (ctx->ExecuteFlag) {
7748 CALL_ProgramUniform4i64vARB(ctx->Exec, (program, location, count, v));
7752 static void GLAPIENTRY
7753 save_ProgramUniform1ui64ARB(GLuint program, GLint location, GLuint64 x)
7755 GET_CURRENT_CONTEXT(ctx);
7757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7758 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1UI64, 4);
7762 ASSIGN_UINT64_TO_NODES(n, 3, x);
7764 if (ctx->ExecuteFlag) {
7765 CALL_ProgramUniform1ui64ARB(ctx->Exec, (program, location, x));
7769 static void GLAPIENTRY
7770 save_ProgramUniform2ui64ARB(GLuint program, GLint location, GLuint64 x,
7773 GET_CURRENT_CONTEXT(ctx);
7775 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7776 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2UI64, 6);
7780 ASSIGN_UINT64_TO_NODES(n, 3, x);
7781 ASSIGN_UINT64_TO_NODES(n, 5, y);
7783 if (ctx->ExecuteFlag) {
7784 CALL_ProgramUniform2ui64ARB(ctx->Exec, (program, location, x, y));
7788 static void GLAPIENTRY
7789 save_ProgramUniform3ui64ARB(GLuint program, GLint location, GLuint64 x,
7790 GLuint64 y, GLuint64 z)
7792 GET_CURRENT_CONTEXT(ctx);
7794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7795 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3UI64, 8);
7799 ASSIGN_UINT64_TO_NODES(n, 3, x);
7800 ASSIGN_UINT64_TO_NODES(n, 5, y);
7801 ASSIGN_UINT64_TO_NODES(n, 7, z);
7803 if (ctx->ExecuteFlag) {
7804 CALL_ProgramUniform3ui64ARB(ctx->Exec, (program, location, x, y, z));
7808 static void GLAPIENTRY
7809 save_ProgramUniform4ui64ARB(GLuint program, GLint location, GLuint64 x,
7810 GLuint64 y, GLuint64 z, GLuint64 w)
7812 GET_CURRENT_CONTEXT(ctx);
7814 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7815 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4UI64, 10);
7819 ASSIGN_UINT64_TO_NODES(n, 3, x);
7820 ASSIGN_UINT64_TO_NODES(n, 5, y);
7821 ASSIGN_UINT64_TO_NODES(n, 7, z);
7822 ASSIGN_UINT64_TO_NODES(n, 9, w);
7824 if (ctx->ExecuteFlag) {
7825 CALL_ProgramUniform4i64ARB(ctx->Exec, (program, location, x, y, z, w));
7829 static void GLAPIENTRY
7830 save_ProgramUniform1ui64vARB(GLuint program, GLint location, GLsizei count,
7833 GET_CURRENT_CONTEXT(ctx);
7835 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7836 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1UI64V,
7837 3 + POINTER_DWORDS);
7842 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLuint64)));
7844 if (ctx->ExecuteFlag) {
7845 CALL_ProgramUniform1ui64vARB(ctx->Exec, (program, location, count, v));
7849 static void GLAPIENTRY
7850 save_ProgramUniform2ui64vARB(GLuint program, GLint location, GLsizei count,
7853 GET_CURRENT_CONTEXT(ctx);
7855 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7856 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2UI64V,
7857 3 + POINTER_DWORDS);
7862 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLuint64)));
7864 if (ctx->ExecuteFlag) {
7865 CALL_ProgramUniform2ui64vARB(ctx->Exec, (program, location, count, v));
7869 static void GLAPIENTRY
7870 save_ProgramUniform3ui64vARB(GLuint program, GLint location, GLsizei count,
7873 GET_CURRENT_CONTEXT(ctx);
7875 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7876 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3UI64V,
7877 3 + POINTER_DWORDS);
7882 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLuint64)));
7884 if (ctx->ExecuteFlag) {
7885 CALL_ProgramUniform3ui64vARB(ctx->Exec, (program, location, count, v));
7889 static void GLAPIENTRY
7890 save_ProgramUniform4ui64vARB(GLuint program, GLint location, GLsizei count,
7893 GET_CURRENT_CONTEXT(ctx);
7895 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7896 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4UI64V,
7897 3 + POINTER_DWORDS);
7902 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLuint64)));
7904 if (ctx->ExecuteFlag) {
7905 CALL_ProgramUniform4ui64vARB(ctx->Exec, (program, location, count, v));
7910 static void GLAPIENTRY
7911 save_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
7913 GET_CURRENT_CONTEXT(ctx);
7915 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7916 n = alloc_instruction(ctx, OPCODE_USE_PROGRAM_STAGES, 3);
7922 if (ctx->ExecuteFlag) {
7923 CALL_UseProgramStages(ctx->Exec, (pipeline, stages, program));
7927 static void GLAPIENTRY
7928 save_ProgramUniform1f(GLuint program, GLint location, GLfloat x)
7930 GET_CURRENT_CONTEXT(ctx);
7932 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7933 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1F, 3);
7939 if (ctx->ExecuteFlag) {
7940 CALL_ProgramUniform1f(ctx->Exec, (program, location, x));
7944 static void GLAPIENTRY
7945 save_ProgramUniform2f(GLuint program, GLint location, GLfloat x, GLfloat y)
7947 GET_CURRENT_CONTEXT(ctx);
7949 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7950 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2F, 4);
7957 if (ctx->ExecuteFlag) {
7958 CALL_ProgramUniform2f(ctx->Exec, (program, location, x, y));
7962 static void GLAPIENTRY
7963 save_ProgramUniform3f(GLuint program, GLint location,
7964 GLfloat x, GLfloat y, GLfloat z)
7966 GET_CURRENT_CONTEXT(ctx);
7968 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7969 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3F, 5);
7977 if (ctx->ExecuteFlag) {
7978 CALL_ProgramUniform3f(ctx->Exec, (program, location, x, y, z));
7982 static void GLAPIENTRY
7983 save_ProgramUniform4f(GLuint program, GLint location,
7984 GLfloat x, GLfloat y, GLfloat z, GLfloat w)
7986 GET_CURRENT_CONTEXT(ctx);
7988 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7989 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4F, 6);
7998 if (ctx->ExecuteFlag) {
7999 CALL_ProgramUniform4f(ctx->Exec, (program, location, x, y, z, w));
8003 static void GLAPIENTRY
8004 save_ProgramUniform1fv(GLuint program, GLint location, GLsizei count,
8007 GET_CURRENT_CONTEXT(ctx);
8009 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8010 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1FV, 3 + POINTER_DWORDS);
8015 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLfloat)));
8017 if (ctx->ExecuteFlag) {
8018 CALL_ProgramUniform1fv(ctx->Exec, (program, location, count, v));
8022 static void GLAPIENTRY
8023 save_ProgramUniform2fv(GLuint program, GLint location, GLsizei count,
8026 GET_CURRENT_CONTEXT(ctx);
8028 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8029 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2FV, 3 + POINTER_DWORDS);
8034 save_pointer(&n[4], memdup(v, count * 2 * sizeof(GLfloat)));
8036 if (ctx->ExecuteFlag) {
8037 CALL_ProgramUniform2fv(ctx->Exec, (program, location, count, v));
8041 static void GLAPIENTRY
8042 save_ProgramUniform3fv(GLuint program, GLint location, GLsizei count,
8045 GET_CURRENT_CONTEXT(ctx);
8047 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8048 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3FV, 3 + POINTER_DWORDS);
8053 save_pointer(&n[4], memdup(v, count * 3 * sizeof(GLfloat)));
8055 if (ctx->ExecuteFlag) {
8056 CALL_ProgramUniform3fv(ctx->Exec, (program, location, count, v));
8060 static void GLAPIENTRY
8061 save_ProgramUniform4fv(GLuint program, GLint location, GLsizei count,
8064 GET_CURRENT_CONTEXT(ctx);
8066 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8067 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4FV, 3 + POINTER_DWORDS);
8072 save_pointer(&n[4], memdup(v, count * 4 * sizeof(GLfloat)));
8074 if (ctx->ExecuteFlag) {
8075 CALL_ProgramUniform4fv(ctx->Exec, (program, location, count, v));
8079 static void GLAPIENTRY
8080 save_ProgramUniform1d(GLuint program, GLint location, GLdouble x)
8082 GET_CURRENT_CONTEXT(ctx);
8084 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8085 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1D, 4);
8089 ASSIGN_DOUBLE_TO_NODES(n, 3, x);
8091 if (ctx->ExecuteFlag) {
8092 CALL_ProgramUniform1d(ctx->Exec, (program, location, x));
8096 static void GLAPIENTRY
8097 save_ProgramUniform2d(GLuint program, GLint location, GLdouble x, GLdouble y)
8099 GET_CURRENT_CONTEXT(ctx);
8101 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8102 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2D, 6);
8106 ASSIGN_DOUBLE_TO_NODES(n, 3, x);
8107 ASSIGN_DOUBLE_TO_NODES(n, 5, y);
8109 if (ctx->ExecuteFlag) {
8110 CALL_ProgramUniform2d(ctx->Exec, (program, location, x, y));
8114 static void GLAPIENTRY
8115 save_ProgramUniform3d(GLuint program, GLint location,
8116 GLdouble x, GLdouble y, GLdouble z)
8118 GET_CURRENT_CONTEXT(ctx);
8120 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8121 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3D, 8);
8125 ASSIGN_DOUBLE_TO_NODES(n, 3, x);
8126 ASSIGN_DOUBLE_TO_NODES(n, 5, y);
8127 ASSIGN_DOUBLE_TO_NODES(n, 7, z);
8129 if (ctx->ExecuteFlag) {
8130 CALL_ProgramUniform3d(ctx->Exec, (program, location, x, y, z));
8134 static void GLAPIENTRY
8135 save_ProgramUniform4d(GLuint program, GLint location,
8136 GLdouble x, GLdouble y, GLdouble z, GLdouble w)
8138 GET_CURRENT_CONTEXT(ctx);
8140 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8141 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4D, 10);
8145 ASSIGN_DOUBLE_TO_NODES(n, 3, x);
8146 ASSIGN_DOUBLE_TO_NODES(n, 5, y);
8147 ASSIGN_DOUBLE_TO_NODES(n, 7, z);
8148 ASSIGN_DOUBLE_TO_NODES(n, 9, w);
8150 if (ctx->ExecuteFlag) {
8151 CALL_ProgramUniform4d(ctx->Exec, (program, location, x, y, z, w));
8155 static void GLAPIENTRY
8156 save_ProgramUniform1dv(GLuint program, GLint location, GLsizei count,
8159 GET_CURRENT_CONTEXT(ctx);
8161 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8162 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1DV, 3 + POINTER_DWORDS);
8167 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLdouble)));
8169 if (ctx->ExecuteFlag) {
8170 CALL_ProgramUniform1dv(ctx->Exec, (program, location, count, v));
8174 static void GLAPIENTRY
8175 save_ProgramUniform2dv(GLuint program, GLint location, GLsizei count,
8178 GET_CURRENT_CONTEXT(ctx);
8180 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8181 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2DV, 3 + POINTER_DWORDS);
8186 save_pointer(&n[4], memdup(v, count * 2 * sizeof(GLdouble)));
8188 if (ctx->ExecuteFlag) {
8189 CALL_ProgramUniform2dv(ctx->Exec, (program, location, count, v));
8193 static void GLAPIENTRY
8194 save_ProgramUniform3dv(GLuint program, GLint location, GLsizei count,
8197 GET_CURRENT_CONTEXT(ctx);
8199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8200 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3DV, 3 + POINTER_DWORDS);
8205 save_pointer(&n[4], memdup(v, count * 3 * sizeof(GLdouble)));
8207 if (ctx->ExecuteFlag) {
8208 CALL_ProgramUniform3dv(ctx->Exec, (program, location, count, v));
8212 static void GLAPIENTRY
8213 save_ProgramUniform4dv(GLuint program, GLint location, GLsizei count,
8216 GET_CURRENT_CONTEXT(ctx);
8218 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8219 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4DV, 3 + POINTER_DWORDS);
8224 save_pointer(&n[4], memdup(v, count * 4 * sizeof(GLdouble)));
8226 if (ctx->ExecuteFlag) {
8227 CALL_ProgramUniform4dv(ctx->Exec, (program, location, count, v));
8231 static void GLAPIENTRY
8232 save_ProgramUniform1i(GLuint program, GLint location, GLint x)
8234 GET_CURRENT_CONTEXT(ctx);
8236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8237 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1I, 3);
8243 if (ctx->ExecuteFlag) {
8244 CALL_ProgramUniform1i(ctx->Exec, (program, location, x));
8248 static void GLAPIENTRY
8249 save_ProgramUniform2i(GLuint program, GLint location, GLint x, GLint y)
8251 GET_CURRENT_CONTEXT(ctx);
8253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8254 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2I, 4);
8261 if (ctx->ExecuteFlag) {
8262 CALL_ProgramUniform2i(ctx->Exec, (program, location, x, y));
8266 static void GLAPIENTRY
8267 save_ProgramUniform3i(GLuint program, GLint location,
8268 GLint x, GLint y, GLint z)
8270 GET_CURRENT_CONTEXT(ctx);
8272 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8273 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3I, 5);
8281 if (ctx->ExecuteFlag) {
8282 CALL_ProgramUniform3i(ctx->Exec, (program, location, x, y, z));
8286 static void GLAPIENTRY
8287 save_ProgramUniform4i(GLuint program, GLint location,
8288 GLint x, GLint y, GLint z, GLint w)
8290 GET_CURRENT_CONTEXT(ctx);
8292 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8293 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4I, 6);
8302 if (ctx->ExecuteFlag) {
8303 CALL_ProgramUniform4i(ctx->Exec, (program, location, x, y, z, w));
8307 static void GLAPIENTRY
8308 save_ProgramUniform1iv(GLuint program, GLint location, GLsizei count,
8311 GET_CURRENT_CONTEXT(ctx);
8313 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8314 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1IV, 3 + POINTER_DWORDS);
8319 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLint)));
8321 if (ctx->ExecuteFlag) {
8322 CALL_ProgramUniform1iv(ctx->Exec, (program, location, count, v));
8326 static void GLAPIENTRY
8327 save_ProgramUniform2iv(GLuint program, GLint location, GLsizei count,
8330 GET_CURRENT_CONTEXT(ctx);
8332 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8333 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2IV, 3 + POINTER_DWORDS);
8338 save_pointer(&n[4], memdup(v, count * 2 * sizeof(GLint)));
8340 if (ctx->ExecuteFlag) {
8341 CALL_ProgramUniform2iv(ctx->Exec, (program, location, count, v));
8345 static void GLAPIENTRY
8346 save_ProgramUniform3iv(GLuint program, GLint location, GLsizei count,
8349 GET_CURRENT_CONTEXT(ctx);
8351 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8352 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3IV, 3 + POINTER_DWORDS);
8357 save_pointer(&n[4], memdup(v, count * 3 * sizeof(GLint)));
8359 if (ctx->ExecuteFlag) {
8360 CALL_ProgramUniform3iv(ctx->Exec, (program, location, count, v));
8364 static void GLAPIENTRY
8365 save_ProgramUniform4iv(GLuint program, GLint location, GLsizei count,
8368 GET_CURRENT_CONTEXT(ctx);
8370 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8371 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4IV, 3 + POINTER_DWORDS);
8376 save_pointer(&n[4], memdup(v, count * 4 * sizeof(GLint)));
8378 if (ctx->ExecuteFlag) {
8379 CALL_ProgramUniform4iv(ctx->Exec, (program, location, count, v));
8383 static void GLAPIENTRY
8384 save_ProgramUniform1ui(GLuint program, GLint location, GLuint x)
8386 GET_CURRENT_CONTEXT(ctx);
8388 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8389 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1UI, 3);
8395 if (ctx->ExecuteFlag) {
8396 CALL_ProgramUniform1ui(ctx->Exec, (program, location, x));
8400 static void GLAPIENTRY
8401 save_ProgramUniform2ui(GLuint program, GLint location, GLuint x, GLuint y)
8403 GET_CURRENT_CONTEXT(ctx);
8405 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8406 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2UI, 4);
8413 if (ctx->ExecuteFlag) {
8414 CALL_ProgramUniform2ui(ctx->Exec, (program, location, x, y));
8418 static void GLAPIENTRY
8419 save_ProgramUniform3ui(GLuint program, GLint location,
8420 GLuint x, GLuint y, GLuint z)
8422 GET_CURRENT_CONTEXT(ctx);
8424 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8425 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3UI, 5);
8433 if (ctx->ExecuteFlag) {
8434 CALL_ProgramUniform3ui(ctx->Exec, (program, location, x, y, z));
8438 static void GLAPIENTRY
8439 save_ProgramUniform4ui(GLuint program, GLint location,
8440 GLuint x, GLuint y, GLuint z, GLuint w)
8442 GET_CURRENT_CONTEXT(ctx);
8444 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8445 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4UI, 6);
8454 if (ctx->ExecuteFlag) {
8455 CALL_ProgramUniform4ui(ctx->Exec, (program, location, x, y, z, w));
8459 static void GLAPIENTRY
8460 save_ProgramUniform1uiv(GLuint program, GLint location, GLsizei count,
8463 GET_CURRENT_CONTEXT(ctx);
8465 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8466 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1UIV, 3 + POINTER_DWORDS);
8471 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLuint)));
8473 if (ctx->ExecuteFlag) {
8474 CALL_ProgramUniform1uiv(ctx->Exec, (program, location, count, v));
8478 static void GLAPIENTRY
8479 save_ProgramUniform2uiv(GLuint program, GLint location, GLsizei count,
8482 GET_CURRENT_CONTEXT(ctx);
8484 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8485 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2UIV, 3 + POINTER_DWORDS);
8490 save_pointer(&n[4], memdup(v, count * 2 * sizeof(GLuint)));
8492 if (ctx->ExecuteFlag) {
8493 CALL_ProgramUniform2uiv(ctx->Exec, (program, location, count, v));
8497 static void GLAPIENTRY
8498 save_ProgramUniform3uiv(GLuint program, GLint location, GLsizei count,
8501 GET_CURRENT_CONTEXT(ctx);
8503 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8504 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3UIV, 3 + POINTER_DWORDS);
8509 save_pointer(&n[4], memdup(v, count * 3 * sizeof(GLuint)));
8511 if (ctx->ExecuteFlag) {
8512 CALL_ProgramUniform3uiv(ctx->Exec, (program, location, count, v));
8516 static void GLAPIENTRY
8517 save_ProgramUniform4uiv(GLuint program, GLint location, GLsizei count,
8520 GET_CURRENT_CONTEXT(ctx);
8522 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8523 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4UIV, 3 + POINTER_DWORDS);
8528 save_pointer(&n[4], memdup(v, count * 4 * sizeof(GLuint)));
8530 if (ctx->ExecuteFlag) {
8531 CALL_ProgramUniform4uiv(ctx->Exec, (program, location, count, v));
8535 static void GLAPIENTRY
8536 save_ProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count,
8537 GLboolean transpose, const GLfloat *v)
8539 GET_CURRENT_CONTEXT(ctx);
8541 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8542 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX22F,
8543 4 + POINTER_DWORDS);
8549 save_pointer(&n[5], memdup(v, count * 2 * 2 * sizeof(GLfloat)));
8551 if (ctx->ExecuteFlag) {
8552 CALL_ProgramUniformMatrix2fv(ctx->Exec,
8553 (program, location, count, transpose, v));
8557 static void GLAPIENTRY
8558 save_ProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count,
8559 GLboolean transpose, const GLfloat *v)
8561 GET_CURRENT_CONTEXT(ctx);
8563 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8564 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX23F,
8565 4 + POINTER_DWORDS);
8571 save_pointer(&n[5], memdup(v, count * 2 * 3 * sizeof(GLfloat)));
8573 if (ctx->ExecuteFlag) {
8574 CALL_ProgramUniformMatrix2x3fv(ctx->Exec,
8575 (program, location, count, transpose, v));
8579 static void GLAPIENTRY
8580 save_ProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count,
8581 GLboolean transpose, const GLfloat *v)
8583 GET_CURRENT_CONTEXT(ctx);
8585 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8586 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX24F,
8587 4 + POINTER_DWORDS);
8593 save_pointer(&n[5], memdup(v, count * 2 * 4 * sizeof(GLfloat)));
8595 if (ctx->ExecuteFlag) {
8596 CALL_ProgramUniformMatrix2x4fv(ctx->Exec,
8597 (program, location, count, transpose, v));
8601 static void GLAPIENTRY
8602 save_ProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count,
8603 GLboolean transpose, const GLfloat *v)
8605 GET_CURRENT_CONTEXT(ctx);
8607 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8608 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX32F,
8609 4 + POINTER_DWORDS);
8615 save_pointer(&n[5], memdup(v, count * 3 * 2 * sizeof(GLfloat)));
8617 if (ctx->ExecuteFlag) {
8618 CALL_ProgramUniformMatrix3x2fv(ctx->Exec,
8619 (program, location, count, transpose, v));
8623 static void GLAPIENTRY
8624 save_ProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count,
8625 GLboolean transpose, const GLfloat *v)
8627 GET_CURRENT_CONTEXT(ctx);
8629 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8630 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX33F,
8631 4 + POINTER_DWORDS);
8637 save_pointer(&n[5], memdup(v, count * 3 * 3 * sizeof(GLfloat)));
8639 if (ctx->ExecuteFlag) {
8640 CALL_ProgramUniformMatrix3fv(ctx->Exec,
8641 (program, location, count, transpose, v));
8645 static void GLAPIENTRY
8646 save_ProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count,
8647 GLboolean transpose, const GLfloat *v)
8649 GET_CURRENT_CONTEXT(ctx);
8651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8652 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX34F,
8653 4 + POINTER_DWORDS);
8659 save_pointer(&n[5], memdup(v, count * 3 * 4 * sizeof(GLfloat)));
8661 if (ctx->ExecuteFlag) {
8662 CALL_ProgramUniformMatrix3x4fv(ctx->Exec,
8663 (program, location, count, transpose, v));
8667 static void GLAPIENTRY
8668 save_ProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count,
8669 GLboolean transpose, const GLfloat *v)
8671 GET_CURRENT_CONTEXT(ctx);
8673 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8674 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX42F,
8675 4 + POINTER_DWORDS);
8681 save_pointer(&n[5], memdup(v, count * 4 * 2 * sizeof(GLfloat)));
8683 if (ctx->ExecuteFlag) {
8684 CALL_ProgramUniformMatrix4x2fv(ctx->Exec,
8685 (program, location, count, transpose, v));
8689 static void GLAPIENTRY
8690 save_ProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count,
8691 GLboolean transpose, const GLfloat *v)
8693 GET_CURRENT_CONTEXT(ctx);
8695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8696 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX43F,
8697 4 + POINTER_DWORDS);
8703 save_pointer(&n[5], memdup(v, count * 4 * 3 * sizeof(GLfloat)));
8705 if (ctx->ExecuteFlag) {
8706 CALL_ProgramUniformMatrix4x3fv(ctx->Exec,
8707 (program, location, count, transpose, v));
8711 static void GLAPIENTRY
8712 save_ProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count,
8713 GLboolean transpose, const GLfloat *v)
8715 GET_CURRENT_CONTEXT(ctx);
8717 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8718 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX44F,
8719 4 + POINTER_DWORDS);
8725 save_pointer(&n[5], memdup(v, count * 4 * 4 * sizeof(GLfloat)));
8727 if (ctx->ExecuteFlag) {
8728 CALL_ProgramUniformMatrix4fv(ctx->Exec,
8729 (program, location, count, transpose, v));
8733 static void GLAPIENTRY
8734 save_ProgramUniformMatrix2dv(GLuint program, GLint location, GLsizei count,
8735 GLboolean transpose, const GLdouble *v)
8737 GET_CURRENT_CONTEXT(ctx);
8739 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8740 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX22D,
8741 4 + POINTER_DWORDS);
8747 save_pointer(&n[5], memdup(v, count * 2 * 2 * sizeof(GLdouble)));
8749 if (ctx->ExecuteFlag) {
8750 CALL_ProgramUniformMatrix2dv(ctx->Exec,
8751 (program, location, count, transpose, v));
8755 static void GLAPIENTRY
8756 save_ProgramUniformMatrix2x3dv(GLuint program, GLint location, GLsizei count,
8757 GLboolean transpose, const GLdouble *v)
8759 GET_CURRENT_CONTEXT(ctx);
8761 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8762 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX23D,
8763 4 + POINTER_DWORDS);
8769 save_pointer(&n[5], memdup(v, count * 2 * 3 * sizeof(GLdouble)));
8771 if (ctx->ExecuteFlag) {
8772 CALL_ProgramUniformMatrix2x3dv(ctx->Exec,
8773 (program, location, count, transpose, v));
8777 static void GLAPIENTRY
8778 save_ProgramUniformMatrix2x4dv(GLuint program, GLint location, GLsizei count,
8779 GLboolean transpose, const GLdouble *v)
8781 GET_CURRENT_CONTEXT(ctx);
8783 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8784 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX24D,
8785 4 + POINTER_DWORDS);
8791 save_pointer(&n[5], memdup(v, count * 2 * 4 * sizeof(GLdouble)));
8793 if (ctx->ExecuteFlag) {
8794 CALL_ProgramUniformMatrix2x4dv(ctx->Exec,
8795 (program, location, count, transpose, v));
8799 static void GLAPIENTRY
8800 save_ProgramUniformMatrix3x2dv(GLuint program, GLint location, GLsizei count,
8801 GLboolean transpose, const GLdouble *v)
8803 GET_CURRENT_CONTEXT(ctx);
8805 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8806 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX32D,
8807 4 + POINTER_DWORDS);
8813 save_pointer(&n[5], memdup(v, count * 3 * 2 * sizeof(GLdouble)));
8815 if (ctx->ExecuteFlag) {
8816 CALL_ProgramUniformMatrix3x2dv(ctx->Exec,
8817 (program, location, count, transpose, v));
8821 static void GLAPIENTRY
8822 save_ProgramUniformMatrix3dv(GLuint program, GLint location, GLsizei count,
8823 GLboolean transpose, const GLdouble *v)
8825 GET_CURRENT_CONTEXT(ctx);
8827 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8828 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX33D,
8829 4 + POINTER_DWORDS);
8835 save_pointer(&n[5], memdup(v, count * 3 * 3 * sizeof(GLdouble)));
8837 if (ctx->ExecuteFlag) {
8838 CALL_ProgramUniformMatrix3dv(ctx->Exec,
8839 (program, location, count, transpose, v));
8843 static void GLAPIENTRY
8844 save_ProgramUniformMatrix3x4dv(GLuint program, GLint location, GLsizei count,
8845 GLboolean transpose, const GLdouble *v)
8847 GET_CURRENT_CONTEXT(ctx);
8849 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8850 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX34D,
8851 4 + POINTER_DWORDS);
8857 save_pointer(&n[5], memdup(v, count * 3 * 4 * sizeof(GLdouble)));
8859 if (ctx->ExecuteFlag) {
8860 CALL_ProgramUniformMatrix3x4dv(ctx->Exec,
8861 (program, location, count, transpose, v));
8865 static void GLAPIENTRY
8866 save_ProgramUniformMatrix4x2dv(GLuint program, GLint location, GLsizei count,
8867 GLboolean transpose, const GLdouble *v)
8869 GET_CURRENT_CONTEXT(ctx);
8871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8872 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX42D,
8873 4 + POINTER_DWORDS);
8879 save_pointer(&n[5], memdup(v, count * 4 * 2 * sizeof(GLdouble)));
8881 if (ctx->ExecuteFlag) {
8882 CALL_ProgramUniformMatrix4x2dv(ctx->Exec,
8883 (program, location, count, transpose, v));
8887 static void GLAPIENTRY
8888 save_ProgramUniformMatrix4x3dv(GLuint program, GLint location, GLsizei count,
8889 GLboolean transpose, const GLdouble *v)
8891 GET_CURRENT_CONTEXT(ctx);
8893 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8894 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX43D,
8895 4 + POINTER_DWORDS);
8901 save_pointer(&n[5], memdup(v, count * 4 * 3 * sizeof(GLdouble)));
8903 if (ctx->ExecuteFlag) {
8904 CALL_ProgramUniformMatrix4x3dv(ctx->Exec,
8905 (program, location, count, transpose, v));
8909 static void GLAPIENTRY
8910 save_ProgramUniformMatrix4dv(GLuint program, GLint location, GLsizei count,
8911 GLboolean transpose, const GLdouble *v)
8913 GET_CURRENT_CONTEXT(ctx);
8915 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8916 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX44D,
8917 4 + POINTER_DWORDS);
8923 save_pointer(&n[5], memdup(v, count * 4 * 4 * sizeof(GLdouble)));
8925 if (ctx->ExecuteFlag) {
8926 CALL_ProgramUniformMatrix4dv(ctx->Exec,
8927 (program, location, count, transpose, v));
8931 static void GLAPIENTRY
8932 save_ClipControl(GLenum origin, GLenum depth)
8934 GET_CURRENT_CONTEXT(ctx);
8936 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8937 n = alloc_instruction(ctx, OPCODE_CLIP_CONTROL, 2);
8942 if (ctx->ExecuteFlag) {
8943 CALL_ClipControl(ctx->Exec, (origin, depth));
8947 static void GLAPIENTRY
8948 save_ClampColorARB(GLenum target, GLenum clamp)
8950 GET_CURRENT_CONTEXT(ctx);
8952 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8953 n = alloc_instruction(ctx, OPCODE_CLAMP_COLOR, 2);
8958 if (ctx->ExecuteFlag) {
8959 CALL_ClampColor(ctx->Exec, (target, clamp));
8963 /** GL_EXT_texture_integer */
8964 static void GLAPIENTRY
8965 save_ClearColorIi(GLint red, GLint green, GLint blue, GLint alpha)
8967 GET_CURRENT_CONTEXT(ctx);
8969 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8970 n = alloc_instruction(ctx, OPCODE_CLEARCOLOR_I, 4);
8977 if (ctx->ExecuteFlag) {
8978 CALL_ClearColorIiEXT(ctx->Exec, (red, green, blue, alpha));
8982 /** GL_EXT_texture_integer */
8983 static void GLAPIENTRY
8984 save_ClearColorIui(GLuint red, GLuint green, GLuint blue, GLuint alpha)
8986 GET_CURRENT_CONTEXT(ctx);
8988 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8989 n = alloc_instruction(ctx, OPCODE_CLEARCOLOR_UI, 4);
8996 if (ctx->ExecuteFlag) {
8997 CALL_ClearColorIuiEXT(ctx->Exec, (red, green, blue, alpha));
9001 /** GL_EXT_texture_integer */
9002 static void GLAPIENTRY
9003 save_TexParameterIiv(GLenum target, GLenum pname, const GLint *params)
9005 GET_CURRENT_CONTEXT(ctx);
9007 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9008 n = alloc_instruction(ctx, OPCODE_TEXPARAMETER_I, 6);
9017 if (ctx->ExecuteFlag) {
9018 CALL_TexParameterIiv(ctx->Exec, (target, pname, params));
9022 /** GL_EXT_texture_integer */
9023 static void GLAPIENTRY
9024 save_TexParameterIuiv(GLenum target, GLenum pname, const GLuint *params)
9026 GET_CURRENT_CONTEXT(ctx);
9028 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9029 n = alloc_instruction(ctx, OPCODE_TEXPARAMETER_UI, 6);
9033 n[3].ui = params[0];
9034 n[4].ui = params[1];
9035 n[5].ui = params[2];
9036 n[6].ui = params[3];
9038 if (ctx->ExecuteFlag) {
9039 CALL_TexParameterIuiv(ctx->Exec, (target, pname, params));
9043 /* GL_ARB_instanced_arrays */
9044 static void GLAPIENTRY
9045 save_VertexAttribDivisor(GLuint index, GLuint divisor)
9047 GET_CURRENT_CONTEXT(ctx);
9049 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9050 n = alloc_instruction(ctx, OPCODE_VERTEX_ATTRIB_DIVISOR, 2);
9055 if (ctx->ExecuteFlag) {
9056 CALL_VertexAttribDivisor(ctx->Exec, (index, divisor));
9061 /* GL_NV_texture_barrier */
9062 static void GLAPIENTRY
9063 save_TextureBarrierNV(void)
9065 GET_CURRENT_CONTEXT(ctx);
9066 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9067 alloc_instruction(ctx, OPCODE_TEXTURE_BARRIER_NV, 0);
9068 if (ctx->ExecuteFlag) {
9069 CALL_TextureBarrierNV(ctx->Exec, ());
9074 /* GL_ARB_sampler_objects */
9075 static void GLAPIENTRY
9076 save_BindSampler(GLuint unit, GLuint sampler)
9079 GET_CURRENT_CONTEXT(ctx);
9080 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9081 n = alloc_instruction(ctx, OPCODE_BIND_SAMPLER, 2);
9086 if (ctx->ExecuteFlag) {
9087 CALL_BindSampler(ctx->Exec, (unit, sampler));
9091 static void GLAPIENTRY
9092 save_SamplerParameteriv(GLuint sampler, GLenum pname, const GLint *params)
9095 GET_CURRENT_CONTEXT(ctx);
9096 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9097 n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERIV, 6);
9102 if (pname == GL_TEXTURE_BORDER_COLOR) {
9108 n[4].i = n[5].i = n[6].i = 0;
9111 if (ctx->ExecuteFlag) {
9112 CALL_SamplerParameteriv(ctx->Exec, (sampler, pname, params));
9116 static void GLAPIENTRY
9117 save_SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
9121 parray[1] = parray[2] = parray[3] = 0;
9122 save_SamplerParameteriv(sampler, pname, parray);
9125 static void GLAPIENTRY
9126 save_SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *params)
9129 GET_CURRENT_CONTEXT(ctx);
9130 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9131 n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERFV, 6);
9136 if (pname == GL_TEXTURE_BORDER_COLOR) {
9142 n[4].f = n[5].f = n[6].f = 0.0F;
9145 if (ctx->ExecuteFlag) {
9146 CALL_SamplerParameterfv(ctx->Exec, (sampler, pname, params));
9150 static void GLAPIENTRY
9151 save_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
9155 parray[1] = parray[2] = parray[3] = 0.0F;
9156 save_SamplerParameterfv(sampler, pname, parray);
9159 static void GLAPIENTRY
9160 save_SamplerParameterIiv(GLuint sampler, GLenum pname, const GLint *params)
9163 GET_CURRENT_CONTEXT(ctx);
9164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9165 n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERIIV, 6);
9170 if (pname == GL_TEXTURE_BORDER_COLOR) {
9176 n[4].i = n[5].i = n[6].i = 0;
9179 if (ctx->ExecuteFlag) {
9180 CALL_SamplerParameterIiv(ctx->Exec, (sampler, pname, params));
9184 static void GLAPIENTRY
9185 save_SamplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint *params)
9188 GET_CURRENT_CONTEXT(ctx);
9189 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9190 n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERUIV, 6);
9194 n[3].ui = params[0];
9195 if (pname == GL_TEXTURE_BORDER_COLOR) {
9196 n[4].ui = params[1];
9197 n[5].ui = params[2];
9198 n[6].ui = params[3];
9201 n[4].ui = n[5].ui = n[6].ui = 0;
9204 if (ctx->ExecuteFlag) {
9205 CALL_SamplerParameterIuiv(ctx->Exec, (sampler, pname, params));
9209 static void GLAPIENTRY
9210 save_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
9213 GET_CURRENT_CONTEXT(ctx);
9214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9215 n = alloc_instruction(ctx, OPCODE_WAIT_SYNC, 4);
9217 union uint64_pair p;
9220 n[2].ui = p.uint32[0];
9221 n[3].ui = p.uint32[1];
9222 save_pointer(&n[4], sync);
9224 if (ctx->ExecuteFlag) {
9225 CALL_WaitSync(ctx->Exec, (sync, flags, timeout));
9230 /** GL_NV_conditional_render */
9231 static void GLAPIENTRY
9232 save_BeginConditionalRender(GLuint queryId, GLenum mode)
9234 GET_CURRENT_CONTEXT(ctx);
9236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9237 n = alloc_instruction(ctx, OPCODE_BEGIN_CONDITIONAL_RENDER, 2);
9242 if (ctx->ExecuteFlag) {
9243 CALL_BeginConditionalRender(ctx->Exec, (queryId, mode));
9247 static void GLAPIENTRY
9248 save_EndConditionalRender(void)
9250 GET_CURRENT_CONTEXT(ctx);
9251 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9252 alloc_instruction(ctx, OPCODE_END_CONDITIONAL_RENDER, 0);
9253 if (ctx->ExecuteFlag) {
9254 CALL_EndConditionalRender(ctx->Exec, ());
9258 static void GLAPIENTRY
9259 save_UniformBlockBinding(GLuint prog, GLuint index, GLuint binding)
9261 GET_CURRENT_CONTEXT(ctx);
9263 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9264 n = alloc_instruction(ctx, OPCODE_UNIFORM_BLOCK_BINDING, 3);
9270 if (ctx->ExecuteFlag) {
9271 CALL_UniformBlockBinding(ctx->Exec, (prog, index, binding));
9275 static void GLAPIENTRY
9276 save_UniformSubroutinesuiv(GLenum shadertype, GLsizei count,
9277 const GLuint *indices)
9279 GET_CURRENT_CONTEXT(ctx);
9281 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9282 n = alloc_instruction(ctx, OPCODE_UNIFORM_SUBROUTINES, 2 + POINTER_DWORDS);
9284 GLint *indices_copy = NULL;
9287 indices_copy = memdup(indices, sizeof(GLuint) * 4 * count);
9288 n[1].e = shadertype;
9290 save_pointer(&n[3], indices_copy);
9292 if (ctx->ExecuteFlag) {
9293 CALL_UniformSubroutinesuiv(ctx->Exec, (shadertype, count, indices));
9297 /** GL_EXT_window_rectangles */
9298 static void GLAPIENTRY
9299 save_WindowRectanglesEXT(GLenum mode, GLsizei count, const GLint *box)
9301 GET_CURRENT_CONTEXT(ctx);
9303 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9304 n = alloc_instruction(ctx, OPCODE_WINDOW_RECTANGLES, 2 + POINTER_DWORDS);
9306 GLint *box_copy = NULL;
9309 box_copy = memdup(box, sizeof(GLint) * 4 * count);
9312 save_pointer(&n[3], box_copy);
9314 if (ctx->ExecuteFlag) {
9315 CALL_WindowRectanglesEXT(ctx->Exec, (mode, count, box));
9320 /** GL_NV_conservative_raster */
9321 static void GLAPIENTRY
9322 save_SubpixelPrecisionBiasNV(GLuint xbits, GLuint ybits)
9324 GET_CURRENT_CONTEXT(ctx);
9326 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9327 n = alloc_instruction(ctx, OPCODE_SUBPIXEL_PRECISION_BIAS, 2);
9332 if (ctx->ExecuteFlag) {
9333 CALL_SubpixelPrecisionBiasNV(ctx->Exec, (xbits, ybits));
9337 /** GL_NV_conservative_raster_dilate */
9338 static void GLAPIENTRY
9339 save_ConservativeRasterParameterfNV(GLenum pname, GLfloat param)
9341 GET_CURRENT_CONTEXT(ctx);
9343 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9344 n = alloc_instruction(ctx, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F, 2);
9349 if (ctx->ExecuteFlag) {
9350 CALL_ConservativeRasterParameterfNV(ctx->Exec, (pname, param));
9354 /** GL_NV_conservative_raster_pre_snap_triangles */
9355 static void GLAPIENTRY
9356 save_ConservativeRasterParameteriNV(GLenum pname, GLint param)
9358 GET_CURRENT_CONTEXT(ctx);
9360 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9361 n = alloc_instruction(ctx, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I, 2);
9366 if (ctx->ExecuteFlag) {
9367 CALL_ConservativeRasterParameteriNV(ctx->Exec, (pname, param));
9371 /** GL_EXT_direct_state_access */
9373 static void GLAPIENTRY
9374 save_MatrixLoadfEXT(GLenum matrixMode, const GLfloat *m)
9376 GET_CURRENT_CONTEXT(ctx);
9378 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9379 n = alloc_instruction(ctx, OPCODE_MATRIX_LOAD, 17);
9381 n[1].e = matrixMode;
9382 for (unsigned i = 0; i < 16; i++) {
9386 if (ctx->ExecuteFlag) {
9387 CALL_MatrixLoadfEXT(ctx->Exec, (matrixMode, m));
9391 static void GLAPIENTRY
9392 save_MatrixLoaddEXT(GLenum matrixMode, const GLdouble *m)
9395 for (unsigned i = 0; i < 16; i++) {
9396 f[i] = (GLfloat) m[i];
9398 save_MatrixLoadfEXT(matrixMode, f);
9401 static void GLAPIENTRY
9402 save_MatrixMultfEXT(GLenum matrixMode, const GLfloat * m)
9404 GET_CURRENT_CONTEXT(ctx);
9406 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9407 n = alloc_instruction(ctx, OPCODE_MATRIX_MULT, 17);
9409 n[1].e = matrixMode;
9410 for (unsigned i = 0; i < 16; i++) {
9414 if (ctx->ExecuteFlag) {
9415 CALL_MatrixMultfEXT(ctx->Exec, (matrixMode, m));
9419 static void GLAPIENTRY
9420 save_MatrixMultdEXT(GLenum matrixMode, const GLdouble * m)
9423 for (unsigned i = 0; i < 16; i++) {
9424 f[i] = (GLfloat) m[i];
9426 save_MatrixMultfEXT(matrixMode, f);
9429 static void GLAPIENTRY
9430 save_MatrixRotatefEXT(GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
9432 GET_CURRENT_CONTEXT(ctx);
9434 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9435 n = alloc_instruction(ctx, OPCODE_MATRIX_ROTATE, 5);
9437 n[1].e = matrixMode;
9443 if (ctx->ExecuteFlag) {
9444 CALL_MatrixRotatefEXT(ctx->Exec, (matrixMode, angle, x, y, z));
9448 static void GLAPIENTRY
9449 save_MatrixRotatedEXT(GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
9451 save_MatrixRotatefEXT(matrixMode, (GLfloat) angle, (GLfloat) x, (GLfloat) y, (GLfloat) z);
9454 static void GLAPIENTRY
9455 save_MatrixScalefEXT(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z)
9457 GET_CURRENT_CONTEXT(ctx);
9459 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9460 n = alloc_instruction(ctx, OPCODE_MATRIX_SCALE, 4);
9462 n[1].e = matrixMode;
9467 if (ctx->ExecuteFlag) {
9468 CALL_MatrixScalefEXT(ctx->Exec, (matrixMode, x, y, z));
9472 static void GLAPIENTRY
9473 save_MatrixScaledEXT(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z)
9475 save_MatrixScalefEXT(matrixMode, (GLfloat) x, (GLfloat) y, (GLfloat) z);
9478 static void GLAPIENTRY
9479 save_MatrixTranslatefEXT(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z)
9481 GET_CURRENT_CONTEXT(ctx);
9483 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9484 n = alloc_instruction(ctx, OPCODE_MATRIX_TRANSLATE, 4);
9486 n[1].e = matrixMode;
9491 if (ctx->ExecuteFlag) {
9492 CALL_MatrixTranslatefEXT(ctx->Exec, (matrixMode, x, y, z));
9496 static void GLAPIENTRY
9497 save_MatrixTranslatedEXT(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z)
9499 save_MatrixTranslatefEXT(matrixMode, (GLfloat) x, (GLfloat) y, (GLfloat) z);
9502 static void GLAPIENTRY
9503 save_MatrixLoadIdentityEXT(GLenum matrixMode)
9505 GET_CURRENT_CONTEXT(ctx);
9507 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9508 n = alloc_instruction(ctx, OPCODE_MATRIX_LOAD_IDENTITY, 1);
9510 n[1].e = matrixMode;
9512 if (ctx->ExecuteFlag) {
9513 CALL_MatrixLoadIdentityEXT(ctx->Exec, (matrixMode));
9517 static void GLAPIENTRY
9518 save_MatrixOrthoEXT(GLenum matrixMode, GLdouble left, GLdouble right,
9519 GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
9521 GET_CURRENT_CONTEXT(ctx);
9523 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9524 n = alloc_instruction(ctx, OPCODE_MATRIX_ORTHO, 7);
9526 n[1].e = matrixMode;
9527 n[2].f = (GLfloat) left;
9528 n[3].f = (GLfloat) right;
9529 n[4].f = (GLfloat) bottom;
9530 n[5].f = (GLfloat) top;
9531 n[6].f = (GLfloat) nearval;
9532 n[7].f = (GLfloat) farval;
9534 if (ctx->ExecuteFlag) {
9535 CALL_MatrixOrthoEXT(ctx->Exec, (matrixMode, left, right, bottom, top, nearval, farval));
9540 static void GLAPIENTRY
9541 save_MatrixFrustumEXT(GLenum matrixMode, GLdouble left, GLdouble right,
9542 GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
9544 GET_CURRENT_CONTEXT(ctx);
9546 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9547 n = alloc_instruction(ctx, OPCODE_MATRIX_FRUSTUM, 7);
9549 n[1].e = matrixMode;
9550 n[2].f = (GLfloat) left;
9551 n[3].f = (GLfloat) right;
9552 n[4].f = (GLfloat) bottom;
9553 n[5].f = (GLfloat) top;
9554 n[6].f = (GLfloat) nearval;
9555 n[7].f = (GLfloat) farval;
9557 if (ctx->ExecuteFlag) {
9558 CALL_MatrixFrustumEXT(ctx->Exec, (matrixMode, left, right, bottom, top, nearval, farval));
9562 static void GLAPIENTRY
9563 save_MatrixPushEXT(GLenum matrixMode)
9565 GET_CURRENT_CONTEXT(ctx);
9567 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9568 n = alloc_instruction(ctx, OPCODE_MATRIX_PUSH, 1);
9570 n[1].e = matrixMode;
9572 if (ctx->ExecuteFlag) {
9573 CALL_MatrixPushEXT(ctx->Exec, (matrixMode));
9577 static void GLAPIENTRY
9578 save_MatrixPopEXT(GLenum matrixMode)
9580 GET_CURRENT_CONTEXT(ctx);
9582 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9583 n = alloc_instruction(ctx, OPCODE_MATRIX_POP, 1);
9585 n[1].e = matrixMode;
9587 if (ctx->ExecuteFlag) {
9588 CALL_MatrixPopEXT(ctx->Exec, (matrixMode));
9592 static void GLAPIENTRY
9593 save_MatrixLoadTransposefEXT(GLenum matrixMode, const GLfloat m[16])
9596 _math_transposef(tm, m);
9597 save_MatrixLoadfEXT(matrixMode, tm);
9600 static void GLAPIENTRY
9601 save_MatrixLoadTransposedEXT(GLenum matrixMode, const GLdouble m[16])
9604 _math_transposefd(tm, m);
9605 save_MatrixLoadfEXT(matrixMode, tm);
9608 static void GLAPIENTRY
9609 save_MatrixMultTransposefEXT(GLenum matrixMode, const GLfloat m[16])
9612 _math_transposef(tm, m);
9613 save_MatrixMultfEXT(matrixMode, tm);
9616 static void GLAPIENTRY
9617 save_MatrixMultTransposedEXT(GLenum matrixMode, const GLdouble m[16])
9620 _math_transposefd(tm, m);
9621 save_MatrixMultfEXT(matrixMode, tm);
9624 static void GLAPIENTRY
9625 save_TextureParameterfvEXT(GLuint texture, GLenum target, GLenum pname,
9626 const GLfloat *params)
9628 GET_CURRENT_CONTEXT(ctx);
9630 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9631 n = alloc_instruction(ctx, OPCODE_TEXTUREPARAMETER_F, 7);
9641 if (ctx->ExecuteFlag) {
9642 CALL_TextureParameterfvEXT(ctx->Exec, (texture, target, pname, params));
9647 static void GLAPIENTRY
9648 save_TextureParameterfEXT(GLuint texture, GLenum target, GLenum pname, GLfloat param)
9652 parray[1] = parray[2] = parray[3] = 0.0F;
9653 save_TextureParameterfvEXT(texture, target, pname, parray);
9656 static void GLAPIENTRY
9657 save_TextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, const GLint *params)
9659 GET_CURRENT_CONTEXT(ctx);
9661 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9662 n = alloc_instruction(ctx, OPCODE_TEXTUREPARAMETER_I, 7);
9672 if (ctx->ExecuteFlag) {
9673 CALL_TextureParameterivEXT(ctx->Exec, (texture, target, pname, params));
9677 static void GLAPIENTRY
9678 save_TextureParameteriEXT(GLuint texture, GLenum target, GLenum pname, GLint param)
9682 fparam[1] = fparam[2] = fparam[3] = 0;
9683 save_TextureParameterivEXT(texture, target, pname, fparam);
9686 static void GLAPIENTRY
9687 save_TextureParameterIivEXT(GLuint texture, GLenum target, GLenum pname, const GLint* params)
9689 GET_CURRENT_CONTEXT(ctx);
9691 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9692 n = alloc_instruction(ctx, OPCODE_TEXTUREPARAMETER_II, 7);
9702 if (ctx->ExecuteFlag) {
9703 CALL_TextureParameterIivEXT(ctx->Exec, (texture, target, pname, params));
9707 static void GLAPIENTRY
9708 save_TextureParameterIuivEXT(GLuint texture, GLenum target, GLenum pname, const GLuint* params)
9710 GET_CURRENT_CONTEXT(ctx);
9712 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9713 n = alloc_instruction(ctx, OPCODE_TEXTUREPARAMETER_IUI, 7);
9718 n[4].ui = params[0];
9719 n[5].ui = params[1];
9720 n[6].ui = params[2];
9721 n[7].ui = params[3];
9723 if (ctx->ExecuteFlag) {
9724 CALL_TextureParameterIuivEXT(ctx->Exec, (texture, target, pname, params));
9729 static void GLAPIENTRY
9730 save_TextureImage1DEXT(GLuint texture, GLenum target,
9731 GLint level, GLint components,
9732 GLsizei width, GLint border,
9733 GLenum format, GLenum type, const GLvoid * pixels)
9735 GET_CURRENT_CONTEXT(ctx);
9736 if (target == GL_PROXY_TEXTURE_1D) {
9737 /* don't compile, execute immediately */
9738 CALL_TextureImage1DEXT(ctx->Exec, (texture, target, level, components, width,
9739 border, format, type, pixels));
9743 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9744 n = alloc_instruction(ctx, OPCODE_TEXTURE_IMAGE1D, 8 + POINTER_DWORDS);
9749 n[4].i = components;
9750 n[5].i = (GLint) width;
9755 unpack_image(ctx, 1, width, 1, 1, format, type,
9756 pixels, &ctx->Unpack));
9758 if (ctx->ExecuteFlag) {
9759 CALL_TextureImage1DEXT(ctx->Exec, (texture, target, level, components, width,
9760 border, format, type, pixels));
9766 static void GLAPIENTRY
9767 save_TextureImage2DEXT(GLuint texture, GLenum target,
9768 GLint level, GLint components,
9769 GLsizei width, GLsizei height, GLint border,
9770 GLenum format, GLenum type, const GLvoid * pixels)
9772 GET_CURRENT_CONTEXT(ctx);
9773 if (target == GL_PROXY_TEXTURE_2D) {
9774 /* don't compile, execute immediately */
9775 CALL_TextureImage2DEXT(ctx->Exec, (texture, target, level, components, width,
9776 height, border, format, type, pixels));
9780 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9781 n = alloc_instruction(ctx, OPCODE_TEXTURE_IMAGE2D, 9 + POINTER_DWORDS);
9786 n[4].i = components;
9787 n[5].i = (GLint) width;
9788 n[6].i = (GLint) height;
9792 save_pointer(&n[10],
9793 unpack_image(ctx, 2, width, height, 1, format, type,
9794 pixels, &ctx->Unpack));
9796 if (ctx->ExecuteFlag) {
9797 CALL_TextureImage2DEXT(ctx->Exec, (texture, target, level, components, width,
9798 height, border, format, type, pixels));
9804 static void GLAPIENTRY
9805 save_TextureImage3DEXT(GLuint texture, GLenum target,
9806 GLint level, GLint internalFormat,
9807 GLsizei width, GLsizei height, GLsizei depth,
9809 GLenum format, GLenum type, const GLvoid * pixels)
9811 GET_CURRENT_CONTEXT(ctx);
9812 if (target == GL_PROXY_TEXTURE_3D) {
9813 /* don't compile, execute immediately */
9814 CALL_TextureImage3DEXT(ctx->Exec, (texture, target, level, internalFormat, width,
9815 height, depth, border, format, type,
9820 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9821 n = alloc_instruction(ctx, OPCODE_TEXTURE_IMAGE3D, 10 + POINTER_DWORDS);
9826 n[4].i = (GLint) internalFormat;
9827 n[5].i = (GLint) width;
9828 n[6].i = (GLint) height;
9829 n[7].i = (GLint) depth;
9833 save_pointer(&n[11],
9834 unpack_image(ctx, 3, width, height, depth, format, type,
9835 pixels, &ctx->Unpack));
9837 if (ctx->ExecuteFlag) {
9838 CALL_TextureImage3DEXT(ctx->Exec, (texture, target, level, internalFormat,
9839 width, height, depth, border, format,
9846 static void GLAPIENTRY
9847 save_TextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset,
9848 GLsizei width, GLenum format, GLenum type,
9849 const GLvoid * pixels)
9851 GET_CURRENT_CONTEXT(ctx);
9854 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9856 n = alloc_instruction(ctx, OPCODE_TEXTURE_SUB_IMAGE1D, 7 + POINTER_DWORDS);
9862 n[5].i = (GLint) width;
9866 unpack_image(ctx, 1, width, 1, 1, format, type,
9867 pixels, &ctx->Unpack));
9869 if (ctx->ExecuteFlag) {
9870 CALL_TextureSubImage1DEXT(ctx->Exec, (texture, target, level, xoffset, width,
9871 format, type, pixels));
9876 static void GLAPIENTRY
9877 save_TextureSubImage2DEXT(GLuint texture, GLenum target, GLint level,
9878 GLint xoffset, GLint yoffset,
9879 GLsizei width, GLsizei height,
9880 GLenum format, GLenum type, const GLvoid * pixels)
9882 GET_CURRENT_CONTEXT(ctx);
9885 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9887 n = alloc_instruction(ctx, OPCODE_TEXTURE_SUB_IMAGE2D, 9 + POINTER_DWORDS);
9894 n[6].i = (GLint) width;
9895 n[7].i = (GLint) height;
9898 save_pointer(&n[10],
9899 unpack_image(ctx, 2, width, height, 1, format, type,
9900 pixels, &ctx->Unpack));
9902 if (ctx->ExecuteFlag) {
9903 CALL_TextureSubImage2DEXT(ctx->Exec, (texture, target, level, xoffset, yoffset,
9904 width, height, format, type, pixels));
9909 static void GLAPIENTRY
9910 save_TextureSubImage3DEXT(GLuint texture, GLenum target, GLint level,
9911 GLint xoffset, GLint yoffset, GLint zoffset,
9912 GLsizei width, GLsizei height, GLsizei depth,
9913 GLenum format, GLenum type, const GLvoid * pixels)
9915 GET_CURRENT_CONTEXT(ctx);
9918 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9920 n = alloc_instruction(ctx, OPCODE_TEXTURE_SUB_IMAGE3D, 11 + POINTER_DWORDS);
9928 n[7].i = (GLint) width;
9929 n[8].i = (GLint) height;
9930 n[9].i = (GLint) depth;
9933 save_pointer(&n[12],
9934 unpack_image(ctx, 3, width, height, depth, format, type,
9935 pixels, &ctx->Unpack));
9937 if (ctx->ExecuteFlag) {
9938 CALL_TextureSubImage3DEXT(ctx->Exec, (texture, target, level,
9939 xoffset, yoffset, zoffset,
9940 width, height, depth, format, type,
9945 static void GLAPIENTRY
9946 save_CopyTextureImage1DEXT(GLuint texture, GLenum target, GLint level,
9947 GLenum internalformat, GLint x, GLint y,
9948 GLsizei width, GLint border)
9950 GET_CURRENT_CONTEXT(ctx);
9952 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9953 n = alloc_instruction(ctx, OPCODE_COPY_TEXTURE_IMAGE1D, 8);
9958 n[4].e = internalformat;
9964 if (ctx->ExecuteFlag) {
9965 CALL_CopyTextureImage1DEXT(ctx->Exec, (texture, target, level,
9966 internalformat, x, y,
9971 static void GLAPIENTRY
9972 save_CopyTextureImage2DEXT(GLuint texture, GLenum target, GLint level,
9973 GLenum internalformat,
9974 GLint x, GLint y, GLsizei width,
9975 GLsizei height, GLint border)
9977 GET_CURRENT_CONTEXT(ctx);
9979 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9980 n = alloc_instruction(ctx, OPCODE_COPY_TEXTURE_IMAGE2D, 9);
9985 n[4].e = internalformat;
9992 if (ctx->ExecuteFlag) {
9993 CALL_CopyTextureImage2DEXT(ctx->Exec, (texture, target, level,
9994 internalformat, x, y,
9995 width, height, border));
9999 static void GLAPIENTRY
10000 save_CopyTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level,
10001 GLint xoffset, GLint x, GLint y, GLsizei width)
10003 GET_CURRENT_CONTEXT(ctx);
10005 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10006 n = alloc_instruction(ctx, OPCODE_COPY_TEXTURE_SUB_IMAGE1D, 7);
10016 if (ctx->ExecuteFlag) {
10017 CALL_CopyTextureSubImage1DEXT(ctx->Exec,
10018 (texture, target, level, xoffset, x, y, width));
10022 static void GLAPIENTRY
10023 save_CopyTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level,
10024 GLint xoffset, GLint yoffset,
10025 GLint x, GLint y, GLsizei width, GLint height)
10027 GET_CURRENT_CONTEXT(ctx);
10029 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10030 n = alloc_instruction(ctx, OPCODE_COPY_TEXTURE_SUB_IMAGE2D, 9);
10042 if (ctx->ExecuteFlag) {
10043 CALL_CopyTextureSubImage2DEXT(ctx->Exec, (texture, target, level,
10045 x, y, width, height));
10050 static void GLAPIENTRY
10051 save_CopyTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level,
10052 GLint xoffset, GLint yoffset, GLint zoffset,
10053 GLint x, GLint y, GLsizei width, GLint height)
10055 GET_CURRENT_CONTEXT(ctx);
10057 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10058 n = alloc_instruction(ctx, OPCODE_COPY_TEXTURE_SUB_IMAGE3D, 10);
10071 if (ctx->ExecuteFlag) {
10072 CALL_CopyTextureSubImage3DEXT(ctx->Exec, (texture, target, level,
10073 xoffset, yoffset, zoffset,
10074 x, y, width, height));
10079 static void GLAPIENTRY
10080 save_BindMultiTextureEXT(GLenum texunit, GLenum target, GLuint texture)
10082 GET_CURRENT_CONTEXT(ctx);
10084 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10085 n = alloc_instruction(ctx, OPCODE_BIND_MULTITEXTURE, 3);
10091 if (ctx->ExecuteFlag) {
10092 CALL_BindMultiTextureEXT(ctx->Exec, (texunit, target, texture));
10097 static void GLAPIENTRY
10098 save_MultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname,
10099 const GLfloat *params)
10101 GET_CURRENT_CONTEXT(ctx);
10103 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10104 n = alloc_instruction(ctx, OPCODE_MULTITEXPARAMETER_F, 7);
10109 n[4].f = params[0];
10110 n[5].f = params[1];
10111 n[6].f = params[2];
10112 n[7].f = params[3];
10114 if (ctx->ExecuteFlag) {
10115 CALL_MultiTexParameterfvEXT(ctx->Exec, (texunit, target, pname, params));
10120 static void GLAPIENTRY
10121 save_MultiTexParameterfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param)
10125 parray[1] = parray[2] = parray[3] = 0.0F;
10126 save_MultiTexParameterfvEXT(texunit, target, pname, parray);
10129 static void GLAPIENTRY
10130 save_MultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *params)
10132 GET_CURRENT_CONTEXT(ctx);
10134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10135 n = alloc_instruction(ctx, OPCODE_MULTITEXPARAMETER_I, 7);
10140 n[4].i = params[0];
10141 n[5].i = params[1];
10142 n[6].i = params[2];
10143 n[7].i = params[3];
10145 if (ctx->ExecuteFlag) {
10146 CALL_MultiTexParameterivEXT(ctx->Exec, (texunit, target, pname, params));
10150 static void GLAPIENTRY
10151 save_MultiTexParameterIivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *params)
10153 GET_CURRENT_CONTEXT(ctx);
10155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10156 n = alloc_instruction(ctx, OPCODE_MULTITEXPARAMETER_II, 7);
10161 n[4].i = params[0];
10162 n[5].i = params[1];
10163 n[6].i = params[2];
10164 n[7].i = params[3];
10166 if (ctx->ExecuteFlag) {
10167 CALL_MultiTexParameterIivEXT(ctx->Exec, (texunit, target, pname, params));
10171 static void GLAPIENTRY
10172 save_MultiTexParameterIuivEXT(GLenum texunit, GLenum target, GLenum pname, const GLuint *params)
10174 GET_CURRENT_CONTEXT(ctx);
10176 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10177 n = alloc_instruction(ctx, OPCODE_MULTITEXPARAMETER_IUI, 7);
10182 n[4].ui = params[0];
10183 n[5].ui = params[1];
10184 n[6].ui = params[2];
10185 n[7].ui = params[3];
10187 if (ctx->ExecuteFlag) {
10188 CALL_MultiTexParameterIuivEXT(ctx->Exec, (texunit, target, pname, params));
10192 static void GLAPIENTRY
10193 save_MultiTexParameteriEXT(GLenum texunit, GLenum target, GLenum pname, GLint param)
10197 fparam[1] = fparam[2] = fparam[3] = 0;
10198 save_MultiTexParameterivEXT(texunit, target, pname, fparam);
10202 static void GLAPIENTRY
10203 save_MultiTexImage1DEXT(GLenum texunit, GLenum target,
10204 GLint level, GLint components,
10205 GLsizei width, GLint border,
10206 GLenum format, GLenum type, const GLvoid * pixels)
10208 GET_CURRENT_CONTEXT(ctx);
10209 if (target == GL_PROXY_TEXTURE_1D) {
10210 /* don't compile, execute immediately */
10211 CALL_MultiTexImage1DEXT(ctx->Exec, (texunit, target, level, components, width,
10212 border, format, type, pixels));
10216 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10217 n = alloc_instruction(ctx, OPCODE_MULTITEX_IMAGE1D, 8 + POINTER_DWORDS);
10222 n[4].i = components;
10223 n[5].i = (GLint) width;
10227 save_pointer(&n[9],
10228 unpack_image(ctx, 1, width, 1, 1, format, type,
10229 pixels, &ctx->Unpack));
10231 if (ctx->ExecuteFlag) {
10232 CALL_MultiTexImage1DEXT(ctx->Exec, (texunit, target, level, components, width,
10233 border, format, type, pixels));
10239 static void GLAPIENTRY
10240 save_MultiTexImage2DEXT(GLenum texunit, GLenum target,
10241 GLint level, GLint components,
10242 GLsizei width, GLsizei height, GLint border,
10243 GLenum format, GLenum type, const GLvoid * pixels)
10245 GET_CURRENT_CONTEXT(ctx);
10246 if (target == GL_PROXY_TEXTURE_2D) {
10247 /* don't compile, execute immediately */
10248 CALL_MultiTexImage2DEXT(ctx->Exec, (texunit, target, level, components, width,
10249 height, border, format, type, pixels));
10253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10254 n = alloc_instruction(ctx, OPCODE_MULTITEX_IMAGE2D, 9 + POINTER_DWORDS);
10259 n[4].i = components;
10260 n[5].i = (GLint) width;
10261 n[6].i = (GLint) height;
10265 save_pointer(&n[10],
10266 unpack_image(ctx, 2, width, height, 1, format, type,
10267 pixels, &ctx->Unpack));
10269 if (ctx->ExecuteFlag) {
10270 CALL_MultiTexImage2DEXT(ctx->Exec, (texunit, target, level, components, width,
10271 height, border, format, type, pixels));
10277 static void GLAPIENTRY
10278 save_MultiTexImage3DEXT(GLenum texunit, GLenum target,
10279 GLint level, GLint internalFormat,
10280 GLsizei width, GLsizei height, GLsizei depth,
10282 GLenum format, GLenum type, const GLvoid * pixels)
10284 GET_CURRENT_CONTEXT(ctx);
10285 if (target == GL_PROXY_TEXTURE_3D) {
10286 /* don't compile, execute immediately */
10287 CALL_MultiTexImage3DEXT(ctx->Exec, (texunit, target, level, internalFormat, width,
10288 height, depth, border, format, type,
10293 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10294 n = alloc_instruction(ctx, OPCODE_MULTITEX_IMAGE3D, 10 + POINTER_DWORDS);
10299 n[4].i = (GLint) internalFormat;
10300 n[5].i = (GLint) width;
10301 n[6].i = (GLint) height;
10302 n[7].i = (GLint) depth;
10306 save_pointer(&n[11],
10307 unpack_image(ctx, 3, width, height, depth, format, type,
10308 pixels, &ctx->Unpack));
10310 if (ctx->ExecuteFlag) {
10311 CALL_MultiTexImage3DEXT(ctx->Exec, (texunit, target, level, internalFormat,
10312 width, height, depth, border, format,
10319 static void GLAPIENTRY
10320 save_MultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset,
10321 GLsizei width, GLenum format, GLenum type,
10322 const GLvoid * pixels)
10324 GET_CURRENT_CONTEXT(ctx);
10327 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10329 n = alloc_instruction(ctx, OPCODE_MULTITEX_SUB_IMAGE1D, 7 + POINTER_DWORDS);
10335 n[5].i = (GLint) width;
10338 save_pointer(&n[8],
10339 unpack_image(ctx, 1, width, 1, 1, format, type,
10340 pixels, &ctx->Unpack));
10342 if (ctx->ExecuteFlag) {
10343 CALL_MultiTexSubImage1DEXT(ctx->Exec, (texunit, target, level, xoffset, width,
10344 format, type, pixels));
10349 static void GLAPIENTRY
10350 save_MultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level,
10351 GLint xoffset, GLint yoffset,
10352 GLsizei width, GLsizei height,
10353 GLenum format, GLenum type, const GLvoid * pixels)
10355 GET_CURRENT_CONTEXT(ctx);
10358 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10360 n = alloc_instruction(ctx, OPCODE_MULTITEX_SUB_IMAGE2D, 9 + POINTER_DWORDS);
10367 n[6].i = (GLint) width;
10368 n[7].i = (GLint) height;
10371 save_pointer(&n[10],
10372 unpack_image(ctx, 2, width, height, 1, format, type,
10373 pixels, &ctx->Unpack));
10375 if (ctx->ExecuteFlag) {
10376 CALL_MultiTexSubImage2DEXT(ctx->Exec, (texunit, target, level, xoffset, yoffset,
10377 width, height, format, type, pixels));
10382 static void GLAPIENTRY
10383 save_MultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level,
10384 GLint xoffset, GLint yoffset, GLint zoffset,
10385 GLsizei width, GLsizei height, GLsizei depth,
10386 GLenum format, GLenum type, const GLvoid * pixels)
10388 GET_CURRENT_CONTEXT(ctx);
10391 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10393 n = alloc_instruction(ctx, OPCODE_MULTITEX_SUB_IMAGE3D, 11 + POINTER_DWORDS);
10401 n[7].i = (GLint) width;
10402 n[8].i = (GLint) height;
10403 n[9].i = (GLint) depth;
10406 save_pointer(&n[12],
10407 unpack_image(ctx, 3, width, height, depth, format, type,
10408 pixels, &ctx->Unpack));
10410 if (ctx->ExecuteFlag) {
10411 CALL_MultiTexSubImage3DEXT(ctx->Exec, (texunit, target, level,
10412 xoffset, yoffset, zoffset,
10413 width, height, depth, format, type,
10419 static void GLAPIENTRY
10420 save_CopyMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level,
10421 GLenum internalformat, GLint x, GLint y,
10422 GLsizei width, GLint border)
10424 GET_CURRENT_CONTEXT(ctx);
10426 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10427 n = alloc_instruction(ctx, OPCODE_COPY_MULTITEX_IMAGE1D, 8);
10432 n[4].e = internalformat;
10438 if (ctx->ExecuteFlag) {
10439 CALL_CopyMultiTexImage1DEXT(ctx->Exec, (texunit, target, level,
10440 internalformat, x, y,
10446 static void GLAPIENTRY
10447 save_CopyMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level,
10448 GLenum internalformat,
10449 GLint x, GLint y, GLsizei width,
10450 GLsizei height, GLint border)
10452 GET_CURRENT_CONTEXT(ctx);
10454 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10455 n = alloc_instruction(ctx, OPCODE_COPY_MULTITEX_IMAGE2D, 9);
10460 n[4].e = internalformat;
10467 if (ctx->ExecuteFlag) {
10468 CALL_CopyMultiTexImage2DEXT(ctx->Exec, (texunit, target, level,
10469 internalformat, x, y,
10470 width, height, border));
10475 static void GLAPIENTRY
10476 save_CopyMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level,
10477 GLint xoffset, GLint x, GLint y, GLsizei width)
10479 GET_CURRENT_CONTEXT(ctx);
10481 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10482 n = alloc_instruction(ctx, OPCODE_COPY_MULTITEX_SUB_IMAGE1D, 7);
10492 if (ctx->ExecuteFlag) {
10493 CALL_CopyMultiTexSubImage1DEXT(ctx->Exec,
10494 (texunit, target, level, xoffset, x, y, width));
10499 static void GLAPIENTRY
10500 save_CopyMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level,
10501 GLint xoffset, GLint yoffset,
10502 GLint x, GLint y, GLsizei width, GLint height)
10504 GET_CURRENT_CONTEXT(ctx);
10506 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10507 n = alloc_instruction(ctx, OPCODE_COPY_MULTITEX_SUB_IMAGE2D, 9);
10519 if (ctx->ExecuteFlag) {
10520 CALL_CopyMultiTexSubImage2DEXT(ctx->Exec, (texunit, target, level,
10522 x, y, width, height));
10527 static void GLAPIENTRY
10528 save_CopyMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level,
10529 GLint xoffset, GLint yoffset, GLint zoffset,
10530 GLint x, GLint y, GLsizei width, GLint height)
10532 GET_CURRENT_CONTEXT(ctx);
10534 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10535 n = alloc_instruction(ctx, OPCODE_COPY_MULTITEX_SUB_IMAGE3D, 10);
10548 if (ctx->ExecuteFlag) {
10549 CALL_CopyMultiTexSubImage3DEXT(ctx->Exec, (texunit, target, level,
10550 xoffset, yoffset, zoffset,
10551 x, y, width, height));
10556 static void GLAPIENTRY
10557 save_MultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat *params)
10559 GET_CURRENT_CONTEXT(ctx);
10561 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10562 n = alloc_instruction(ctx, OPCODE_MULTITEXENV, 7);
10567 if (pname == GL_TEXTURE_ENV_COLOR) {
10568 n[4].f = params[0];
10569 n[5].f = params[1];
10570 n[6].f = params[2];
10571 n[7].f = params[3];
10574 n[4].f = params[0];
10575 n[5].f = n[6].f = n[7].f = 0.0F;
10578 if (ctx->ExecuteFlag) {
10579 CALL_MultiTexEnvfvEXT(ctx->Exec, (texunit, target, pname, params));
10584 static void GLAPIENTRY
10585 save_MultiTexEnvfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param)
10588 parray[0] = (GLfloat) param;
10589 parray[1] = parray[2] = parray[3] = 0.0F;
10590 save_MultiTexEnvfvEXT(texunit, target, pname, parray);
10594 static void GLAPIENTRY
10595 save_MultiTexEnviEXT(GLenum texunit, GLenum target, GLenum pname, GLint param)
10598 p[0] = (GLfloat) param;
10599 p[1] = p[2] = p[3] = 0.0F;
10600 save_MultiTexEnvfvEXT(texunit, target, pname, p);
10604 static void GLAPIENTRY
10605 save_MultiTexEnvivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint * param)
10608 if (pname == GL_TEXTURE_ENV_COLOR) {
10609 p[0] = INT_TO_FLOAT(param[0]);
10610 p[1] = INT_TO_FLOAT(param[1]);
10611 p[2] = INT_TO_FLOAT(param[2]);
10612 p[3] = INT_TO_FLOAT(param[3]);
10615 p[0] = (GLfloat) param[0];
10616 p[1] = p[2] = p[3] = 0.0F;
10618 save_MultiTexEnvfvEXT(texunit, target, pname, p);
10622 static void GLAPIENTRY
10623 save_CompressedTextureImage1DEXT(GLuint texture, GLenum target, GLint level,
10624 GLenum internalFormat, GLsizei width,
10625 GLint border, GLsizei imageSize,
10626 const GLvoid * data)
10628 GET_CURRENT_CONTEXT(ctx);
10629 if (target == GL_PROXY_TEXTURE_1D) {
10630 /* don't compile, execute immediately */
10631 CALL_CompressedTextureImage1DEXT(ctx->Exec, (texture, target, level,
10632 internalFormat, width,
10638 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10640 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEXTURE_IMAGE_1D,
10641 7 + POINTER_DWORDS);
10646 n[4].e = internalFormat;
10647 n[5].i = (GLint) width;
10649 n[7].i = imageSize;
10650 save_pointer(&n[8],
10651 copy_data(data, imageSize, "glCompressedTextureImage1DEXT"));
10653 if (ctx->ExecuteFlag) {
10654 CALL_CompressedTextureImage1DEXT(ctx->Exec,
10655 (texture, target, level, internalFormat,
10656 width, border, imageSize, data));
10662 static void GLAPIENTRY
10663 save_CompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level,
10664 GLenum internalFormat, GLsizei width,
10665 GLsizei height, GLint border, GLsizei imageSize,
10666 const GLvoid * data)
10668 GET_CURRENT_CONTEXT(ctx);
10669 if (target == GL_PROXY_TEXTURE_2D) {
10670 /* don't compile, execute immediately */
10671 CALL_CompressedTextureImage2DEXT(ctx->Exec, (texture, target, level,
10672 internalFormat, width, height,
10673 border, imageSize, data));
10677 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10679 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEXTURE_IMAGE_2D,
10680 8 + POINTER_DWORDS);
10685 n[4].e = internalFormat;
10686 n[5].i = (GLint) width;
10687 n[6].i = (GLint) height;
10689 n[8].i = imageSize;
10690 save_pointer(&n[9],
10691 copy_data(data, imageSize, "glCompressedTextureImage2DEXT"));
10693 if (ctx->ExecuteFlag) {
10694 CALL_CompressedTextureImage2DEXT(ctx->Exec,
10695 (texture, target, level, internalFormat,
10696 width, height, border, imageSize, data));
10702 static void GLAPIENTRY
10703 save_CompressedTextureImage3DEXT(GLuint texture, GLenum target, GLint level,
10704 GLenum internalFormat, GLsizei width,
10705 GLsizei height, GLsizei depth, GLint border,
10706 GLsizei imageSize, const GLvoid * data)
10708 GET_CURRENT_CONTEXT(ctx);
10709 if (target == GL_PROXY_TEXTURE_3D) {
10710 /* don't compile, execute immediately */
10711 CALL_CompressedTextureImage3DEXT(ctx->Exec, (texture, target, level,
10712 internalFormat, width,
10713 height, depth, border,
10718 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10720 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEXTURE_IMAGE_3D,
10721 9 + POINTER_DWORDS);
10726 n[4].e = internalFormat;
10727 n[5].i = (GLint) width;
10728 n[6].i = (GLint) height;
10729 n[7].i = (GLint) depth;
10731 n[9].i = imageSize;
10732 save_pointer(&n[10],
10733 copy_data(data, imageSize, "glCompressedTextureImage3DEXT"));
10735 if (ctx->ExecuteFlag) {
10736 CALL_CompressedTextureImage3DEXT(ctx->Exec,
10737 (texture, target, level, internalFormat,
10738 width, height, depth, border, imageSize,
10745 static void GLAPIENTRY
10746 save_CompressedTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset,
10747 GLsizei width, GLenum format,
10748 GLsizei imageSize, const GLvoid * data)
10751 GET_CURRENT_CONTEXT(ctx);
10752 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10754 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D,
10755 7 + POINTER_DWORDS);
10761 n[5].i = (GLint) width;
10763 n[7].i = imageSize;
10764 save_pointer(&n[8],
10765 copy_data(data, imageSize, "glCompressedTextureSubImage1DEXT"));
10767 if (ctx->ExecuteFlag) {
10768 CALL_CompressedTextureSubImage1DEXT(ctx->Exec, (texture, target, level, xoffset,
10769 width, format, imageSize, data));
10774 static void GLAPIENTRY
10775 save_CompressedTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset,
10776 GLint yoffset, GLsizei width, GLsizei height,
10777 GLenum format, GLsizei imageSize,
10778 const GLvoid * data)
10781 GET_CURRENT_CONTEXT(ctx);
10782 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10784 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D,
10785 9 + POINTER_DWORDS);
10792 n[6].i = (GLint) width;
10793 n[7].i = (GLint) height;
10795 n[9].i = imageSize;
10796 save_pointer(&n[10],
10797 copy_data(data, imageSize, "glCompressedTextureSubImage2DEXT"));
10799 if (ctx->ExecuteFlag) {
10800 CALL_CompressedTextureSubImage2DEXT(ctx->Exec,
10801 (texture, target, level, xoffset, yoffset,
10802 width, height, format, imageSize, data));
10807 static void GLAPIENTRY
10808 save_CompressedTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset,
10809 GLint yoffset, GLint zoffset, GLsizei width,
10810 GLsizei height, GLsizei depth, GLenum format,
10811 GLsizei imageSize, const GLvoid * data)
10814 GET_CURRENT_CONTEXT(ctx);
10815 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10817 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D,
10818 11 + POINTER_DWORDS);
10826 n[7].i = (GLint) width;
10827 n[8].i = (GLint) height;
10828 n[9].i = (GLint) depth;
10830 n[11].i = imageSize;
10831 save_pointer(&n[12],
10832 copy_data(data, imageSize, "glCompressedTextureSubImage3DEXT"));
10834 if (ctx->ExecuteFlag) {
10835 CALL_CompressedTextureSubImage3DEXT(ctx->Exec,
10836 (texture, target, level, xoffset, yoffset,
10837 zoffset, width, height, depth, format,
10843 static void GLAPIENTRY
10844 save_CompressedMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level,
10845 GLenum internalFormat, GLsizei width,
10846 GLint border, GLsizei imageSize,
10847 const GLvoid * data)
10849 GET_CURRENT_CONTEXT(ctx);
10850 if (target == GL_PROXY_TEXTURE_1D) {
10851 /* don't compile, execute immediately */
10852 CALL_CompressedMultiTexImage1DEXT(ctx->Exec, (texunit, target, level,
10853 internalFormat, width,
10859 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10861 n = alloc_instruction(ctx, OPCODE_COMPRESSED_MULTITEX_IMAGE_1D,
10862 7 + POINTER_DWORDS);
10867 n[4].e = internalFormat;
10868 n[5].i = (GLint) width;
10870 n[7].i = imageSize;
10871 save_pointer(&n[8],
10872 copy_data(data, imageSize, "glCompressedMultiTexImage1DEXT"));
10874 if (ctx->ExecuteFlag) {
10875 CALL_CompressedMultiTexImage1DEXT(ctx->Exec,
10876 (texunit, target, level, internalFormat,
10877 width, border, imageSize, data));
10883 static void GLAPIENTRY
10884 save_CompressedMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level,
10885 GLenum internalFormat, GLsizei width,
10886 GLsizei height, GLint border, GLsizei imageSize,
10887 const GLvoid * data)
10889 GET_CURRENT_CONTEXT(ctx);
10890 if (target == GL_PROXY_TEXTURE_2D) {
10891 /* don't compile, execute immediately */
10892 CALL_CompressedMultiTexImage2DEXT(ctx->Exec, (texunit, target, level,
10893 internalFormat, width, height,
10894 border, imageSize, data));
10898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10900 n = alloc_instruction(ctx, OPCODE_COMPRESSED_MULTITEX_IMAGE_2D,
10901 8 + POINTER_DWORDS);
10906 n[4].e = internalFormat;
10907 n[5].i = (GLint) width;
10908 n[6].i = (GLint) height;
10910 n[8].i = imageSize;
10911 save_pointer(&n[9],
10912 copy_data(data, imageSize, "glCompressedMultiTexImage2DEXT"));
10914 if (ctx->ExecuteFlag) {
10915 CALL_CompressedMultiTexImage2DEXT(ctx->Exec,
10916 (texunit, target, level, internalFormat,
10917 width, height, border, imageSize, data));
10923 static void GLAPIENTRY
10924 save_CompressedMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level,
10925 GLenum internalFormat, GLsizei width,
10926 GLsizei height, GLsizei depth, GLint border,
10927 GLsizei imageSize, const GLvoid * data)
10929 GET_CURRENT_CONTEXT(ctx);
10930 if (target == GL_PROXY_TEXTURE_3D) {
10931 /* don't compile, execute immediately */
10932 CALL_CompressedMultiTexImage3DEXT(ctx->Exec, (texunit, target, level,
10933 internalFormat, width,
10934 height, depth, border,
10939 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10941 n = alloc_instruction(ctx, OPCODE_COMPRESSED_MULTITEX_IMAGE_3D,
10942 9 + POINTER_DWORDS);
10947 n[4].e = internalFormat;
10948 n[5].i = (GLint) width;
10949 n[6].i = (GLint) height;
10950 n[7].i = (GLint) depth;
10952 n[9].i = imageSize;
10953 save_pointer(&n[10],
10954 copy_data(data, imageSize, "glCompressedMultiTexImage3DEXT"));
10956 if (ctx->ExecuteFlag) {
10957 CALL_CompressedMultiTexImage3DEXT(ctx->Exec,
10958 (texunit, target, level, internalFormat,
10959 width, height, depth, border, imageSize,
10966 static void GLAPIENTRY
10967 save_CompressedMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset,
10968 GLsizei width, GLenum format,
10969 GLsizei imageSize, const GLvoid * data)
10972 GET_CURRENT_CONTEXT(ctx);
10973 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10975 n = alloc_instruction(ctx, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D,
10976 7 + POINTER_DWORDS);
10982 n[5].i = (GLint) width;
10984 n[7].i = imageSize;
10985 save_pointer(&n[8],
10986 copy_data(data, imageSize, "glCompressedMultiTexSubImage1DEXT"));
10988 if (ctx->ExecuteFlag) {
10989 CALL_CompressedMultiTexSubImage1DEXT(ctx->Exec, (texunit, target, level, xoffset,
10990 width, format, imageSize, data));
10995 static void GLAPIENTRY
10996 save_CompressedMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset,
10997 GLint yoffset, GLsizei width, GLsizei height,
10998 GLenum format, GLsizei imageSize,
10999 const GLvoid * data)
11002 GET_CURRENT_CONTEXT(ctx);
11003 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
11005 n = alloc_instruction(ctx, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D,
11006 9 + POINTER_DWORDS);
11013 n[6].i = (GLint) width;
11014 n[7].i = (GLint) height;
11016 n[9].i = imageSize;
11017 save_pointer(&n[10],
11018 copy_data(data, imageSize, "glCompressedMultiTexSubImage2DEXT"));
11020 if (ctx->ExecuteFlag) {
11021 CALL_CompressedMultiTexSubImage2DEXT(ctx->Exec,
11022 (texunit, target, level, xoffset, yoffset,
11023 width, height, format, imageSize, data));
11028 static void GLAPIENTRY
11029 save_CompressedMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset,
11030 GLint yoffset, GLint zoffset, GLsizei width,
11031 GLsizei height, GLsizei depth, GLenum format,
11032 GLsizei imageSize, const GLvoid * data)
11035 GET_CURRENT_CONTEXT(ctx);
11036 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
11038 n = alloc_instruction(ctx, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D,
11039 11 + POINTER_DWORDS);
11047 n[7].i = (GLint) width;
11048 n[8].i = (GLint) height;
11049 n[9].i = (GLint) depth;
11051 n[11].i = imageSize;
11052 save_pointer(&n[12],
11053 copy_data(data, imageSize, "glCompressedMultiTexSubImage3DEXT"));
11055 if (ctx->ExecuteFlag) {
11056 CALL_CompressedMultiTexSubImage3DEXT(ctx->Exec,
11057 (texunit, target, level, xoffset, yoffset,
11058 zoffset, width, height, depth, format,
11064 static void GLAPIENTRY
11065 save_NamedProgramStringEXT(GLuint program, GLenum target, GLenum format, GLsizei len,
11066 const GLvoid * string)
11068 GET_CURRENT_CONTEXT(ctx);
11071 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
11073 n = alloc_instruction(ctx, OPCODE_NAMED_PROGRAM_STRING, 4 + POINTER_DWORDS);
11075 GLubyte *programCopy = malloc(len);
11076 if (!programCopy) {
11077 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glNamedProgramStringEXT");
11080 memcpy(programCopy, string, len);
11085 save_pointer(&n[5], programCopy);
11087 if (ctx->ExecuteFlag) {
11088 CALL_NamedProgramStringEXT(ctx->Exec, (program, target, format, len, string));
11093 static void GLAPIENTRY
11094 save_NamedProgramLocalParameter4fEXT(GLuint program, GLenum target, GLuint index,
11095 GLfloat x, GLfloat y, GLfloat z, GLfloat w)
11097 GET_CURRENT_CONTEXT(ctx);
11099 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
11100 n = alloc_instruction(ctx, OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER, 7);
11110 if (ctx->ExecuteFlag) {
11111 CALL_NamedProgramLocalParameter4fEXT(ctx->Exec, (program, target, index, x, y, z, w));
11116 static void GLAPIENTRY
11117 save_NamedProgramLocalParameter4fvEXT(GLuint program, GLenum target, GLuint index,
11118 const GLfloat *params)
11120 save_NamedProgramLocalParameter4fEXT(program, target, index, params[0],
11121 params[1], params[2], params[3]);
11125 static void GLAPIENTRY
11126 save_NamedProgramLocalParameter4dEXT(GLuint program, GLenum target, GLuint index,
11127 GLdouble x, GLdouble y,
11128 GLdouble z, GLdouble w)
11130 save_NamedProgramLocalParameter4fEXT(program, target, index, (GLfloat) x,
11131 (GLfloat) y, (GLfloat) z, (GLfloat) w);
11135 static void GLAPIENTRY
11136 save_NamedProgramLocalParameter4dvEXT(GLuint program, GLenum target, GLuint index,
11137 const GLdouble *params)
11139 save_NamedProgramLocalParameter4fEXT(program, target, index, (GLfloat) params[0],
11140 (GLfloat) params[1], (GLfloat) params[2],
11141 (GLfloat) params[3]);
11146 * Save an error-generating command into display list.
11148 * KW: Will appear in the list before the vertex buffer containing the
11149 * command that provoked the error. I don't see this as a problem.
11152 save_error(struct gl_context *ctx, GLenum error, const char *s)
11155 n = alloc_instruction(ctx, OPCODE_ERROR, 1 + POINTER_DWORDS);
11158 save_pointer(&n[2], (void *) s);
11159 /* note: the data/string here doesn't have to be freed in
11160 * _mesa_delete_list() since the string is never dynamically
11168 * Compile an error into current display list.
11171 _mesa_compile_error(struct gl_context *ctx, GLenum error, const char *s)
11173 if (ctx->CompileFlag)
11174 save_error(ctx, error, s);
11175 if (ctx->ExecuteFlag)
11176 _mesa_error(ctx, error, "%s", s);
11181 * Test if ID names a display list.
11184 _mesa_get_list(struct gl_context *ctx, GLuint list,
11185 struct gl_display_list **dlist,
11188 struct gl_display_list * dl =
11189 list > 0 ? _mesa_lookup_list(ctx, list, locked) : NULL;
11199 /**********************************************************************/
11200 /* Display list execution */
11201 /**********************************************************************/
11205 * Execute a display list. Note that the ListBase offset must have already
11206 * been added before calling this function. I.e. the list argument is
11207 * the absolute list number, not relative to ListBase.
11208 * Must be called with ctx->Shared->DisplayList locked.
11209 * \param list - display list number
11212 execute_list(struct gl_context *ctx, GLuint list)
11214 struct gl_display_list *dlist;
11217 if (list == 0 || !_mesa_get_list(ctx, list, &dlist, true))
11220 if (ctx->ListState.CallDepth == MAX_LIST_NESTING) {
11221 /* raise an error? */
11225 ctx->ListState.CallDepth++;
11227 vbo_save_BeginCallList(ctx, dlist);
11232 const OpCode opcode = n[0].opcode;
11236 _mesa_error(ctx, n[1].e, "%s", (const char *) get_pointer(&n[2]));
11239 CALL_Accum(ctx->Exec, (n[1].e, n[2].f));
11241 case OPCODE_ALPHA_FUNC:
11242 CALL_AlphaFunc(ctx->Exec, (n[1].e, n[2].f));
11244 case OPCODE_BIND_TEXTURE:
11245 CALL_BindTexture(ctx->Exec, (n[1].e, n[2].ui));
11247 case OPCODE_BITMAP:
11249 const struct gl_pixelstore_attrib save = ctx->Unpack;
11250 ctx->Unpack = ctx->DefaultPacking;
11251 CALL_Bitmap(ctx->Exec, ((GLsizei) n[1].i, (GLsizei) n[2].i,
11252 n[3].f, n[4].f, n[5].f, n[6].f,
11253 get_pointer(&n[7])));
11254 ctx->Unpack = save; /* restore */
11257 case OPCODE_BLEND_COLOR:
11258 CALL_BlendColor(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
11260 case OPCODE_BLEND_EQUATION:
11261 CALL_BlendEquation(ctx->Exec, (n[1].e));
11263 case OPCODE_BLEND_EQUATION_SEPARATE:
11264 CALL_BlendEquationSeparate(ctx->Exec, (n[1].e, n[2].e));
11266 case OPCODE_BLEND_FUNC_SEPARATE:
11267 CALL_BlendFuncSeparate(ctx->Exec,
11268 (n[1].e, n[2].e, n[3].e, n[4].e));
11271 case OPCODE_BLEND_FUNC_I:
11272 /* GL_ARB_draw_buffers_blend */
11273 CALL_BlendFunciARB(ctx->Exec, (n[1].ui, n[2].e, n[3].e));
11275 case OPCODE_BLEND_FUNC_SEPARATE_I:
11276 /* GL_ARB_draw_buffers_blend */
11277 CALL_BlendFuncSeparateiARB(ctx->Exec, (n[1].ui, n[2].e, n[3].e,
11280 case OPCODE_BLEND_EQUATION_I:
11281 /* GL_ARB_draw_buffers_blend */
11282 CALL_BlendEquationiARB(ctx->Exec, (n[1].ui, n[2].e));
11284 case OPCODE_BLEND_EQUATION_SEPARATE_I:
11285 /* GL_ARB_draw_buffers_blend */
11286 CALL_BlendEquationSeparateiARB(ctx->Exec,
11287 (n[1].ui, n[2].e, n[3].e));
11290 case OPCODE_CALL_LIST:
11291 /* Generated by glCallList(), don't add ListBase */
11292 if (ctx->ListState.CallDepth < MAX_LIST_NESTING) {
11293 execute_list(ctx, n[1].ui);
11296 case OPCODE_CALL_LISTS:
11297 if (ctx->ListState.CallDepth < MAX_LIST_NESTING) {
11298 _mesa_HashUnlockMutex(ctx->Shared->DisplayList);
11299 CALL_CallLists(ctx->Exec, (n[1].i, n[2].e, get_pointer(&n[3])));
11300 _mesa_HashLockMutex(ctx->Shared->DisplayList);
11304 CALL_Clear(ctx->Exec, (n[1].bf));
11306 case OPCODE_CLEAR_BUFFER_IV:
11313 CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));
11316 case OPCODE_CLEAR_BUFFER_UIV:
11319 value[0] = n[3].ui;
11320 value[1] = n[4].ui;
11321 value[2] = n[5].ui;
11322 value[3] = n[6].ui;
11323 CALL_ClearBufferuiv(ctx->Exec, (n[1].e, n[2].i, value));
11326 case OPCODE_CLEAR_BUFFER_FV:
11333 CALL_ClearBufferfv(ctx->Exec, (n[1].e, n[2].i, value));
11336 case OPCODE_CLEAR_BUFFER_FI:
11337 CALL_ClearBufferfi(ctx->Exec, (n[1].e, n[2].i, n[3].f, n[4].i));
11339 case OPCODE_CLEAR_COLOR:
11340 CALL_ClearColor(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
11342 case OPCODE_CLEAR_ACCUM:
11343 CALL_ClearAccum(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
11345 case OPCODE_CLEAR_DEPTH:
11346 CALL_ClearDepth(ctx->Exec, ((GLclampd) n[1].f));
11348 case OPCODE_CLEAR_INDEX:
11349 CALL_ClearIndex(ctx->Exec, ((GLfloat) n[1].ui));
11351 case OPCODE_CLEAR_STENCIL:
11352 CALL_ClearStencil(ctx->Exec, (n[1].i));
11354 case OPCODE_CLIP_PLANE:
11361 CALL_ClipPlane(ctx->Exec, (n[1].e, eq));
11364 case OPCODE_COLOR_MASK:
11365 CALL_ColorMask(ctx->Exec, (n[1].b, n[2].b, n[3].b, n[4].b));
11367 case OPCODE_COLOR_MASK_INDEXED:
11368 CALL_ColorMaski(ctx->Exec, (n[1].ui, n[2].b, n[3].b,
11371 case OPCODE_COLOR_MATERIAL:
11372 CALL_ColorMaterial(ctx->Exec, (n[1].e, n[2].e));
11374 case OPCODE_COPY_PIXELS:
11375 CALL_CopyPixels(ctx->Exec, (n[1].i, n[2].i,
11376 (GLsizei) n[3].i, (GLsizei) n[4].i,
11379 case OPCODE_COPY_TEX_IMAGE1D:
11380 CALL_CopyTexImage1D(ctx->Exec, (n[1].e, n[2].i, n[3].e, n[4].i,
11381 n[5].i, n[6].i, n[7].i));
11383 case OPCODE_COPY_TEX_IMAGE2D:
11384 CALL_CopyTexImage2D(ctx->Exec, (n[1].e, n[2].i, n[3].e, n[4].i,
11385 n[5].i, n[6].i, n[7].i, n[8].i));
11387 case OPCODE_COPY_TEX_SUB_IMAGE1D:
11388 CALL_CopyTexSubImage1D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
11389 n[4].i, n[5].i, n[6].i));
11391 case OPCODE_COPY_TEX_SUB_IMAGE2D:
11392 CALL_CopyTexSubImage2D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
11393 n[4].i, n[5].i, n[6].i, n[7].i,
11396 case OPCODE_COPY_TEX_SUB_IMAGE3D:
11397 CALL_CopyTexSubImage3D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
11398 n[4].i, n[5].i, n[6].i, n[7].i,
11401 case OPCODE_CULL_FACE:
11402 CALL_CullFace(ctx->Exec, (n[1].e));
11404 case OPCODE_DEPTH_FUNC:
11405 CALL_DepthFunc(ctx->Exec, (n[1].e));
11407 case OPCODE_DEPTH_MASK:
11408 CALL_DepthMask(ctx->Exec, (n[1].b));
11410 case OPCODE_DEPTH_RANGE:
11411 CALL_DepthRange(ctx->Exec,
11412 ((GLclampd) n[1].f, (GLclampd) n[2].f));
11414 case OPCODE_DISABLE:
11415 CALL_Disable(ctx->Exec, (n[1].e));
11417 case OPCODE_DISABLE_INDEXED:
11418 CALL_Disablei(ctx->Exec, (n[1].ui, n[2].e));
11420 case OPCODE_DRAW_BUFFER:
11421 CALL_DrawBuffer(ctx->Exec, (n[1].e));
11423 case OPCODE_DRAW_PIXELS:
11425 const struct gl_pixelstore_attrib save = ctx->Unpack;
11426 ctx->Unpack = ctx->DefaultPacking;
11427 CALL_DrawPixels(ctx->Exec, (n[1].i, n[2].i, n[3].e, n[4].e,
11428 get_pointer(&n[5])));
11429 ctx->Unpack = save; /* restore */
11432 case OPCODE_ENABLE:
11433 CALL_Enable(ctx->Exec, (n[1].e));
11435 case OPCODE_ENABLE_INDEXED:
11436 CALL_Enablei(ctx->Exec, (n[1].ui, n[2].e));
11438 case OPCODE_EVALMESH1:
11439 CALL_EvalMesh1(ctx->Exec, (n[1].e, n[2].i, n[3].i));
11441 case OPCODE_EVALMESH2:
11442 CALL_EvalMesh2(ctx->Exec,
11443 (n[1].e, n[2].i, n[3].i, n[4].i, n[5].i));
11452 CALL_Fogfv(ctx->Exec, (n[1].e, p));
11455 case OPCODE_FRONT_FACE:
11456 CALL_FrontFace(ctx->Exec, (n[1].e));
11458 case OPCODE_FRUSTUM:
11459 CALL_Frustum(ctx->Exec,
11460 (n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f));
11463 CALL_Hint(ctx->Exec, (n[1].e, n[2].e));
11465 case OPCODE_INDEX_MASK:
11466 CALL_IndexMask(ctx->Exec, (n[1].ui));
11468 case OPCODE_INIT_NAMES:
11469 CALL_InitNames(ctx->Exec, ());
11478 CALL_Lightfv(ctx->Exec, (n[1].e, n[2].e, p));
11481 case OPCODE_LIGHT_MODEL:
11488 CALL_LightModelfv(ctx->Exec, (n[1].e, p));
11491 case OPCODE_LINE_STIPPLE:
11492 CALL_LineStipple(ctx->Exec, (n[1].i, n[2].us));
11494 case OPCODE_LINE_WIDTH:
11495 CALL_LineWidth(ctx->Exec, (n[1].f));
11497 case OPCODE_LIST_BASE:
11498 CALL_ListBase(ctx->Exec, (n[1].ui));
11500 case OPCODE_LOAD_IDENTITY:
11501 CALL_LoadIdentity(ctx->Exec, ());
11503 case OPCODE_LOAD_MATRIX:
11504 STATIC_ASSERT(sizeof(Node) == sizeof(GLfloat));
11505 CALL_LoadMatrixf(ctx->Exec, (&n[1].f));
11507 case OPCODE_LOAD_NAME:
11508 CALL_LoadName(ctx->Exec, (n[1].ui));
11510 case OPCODE_LOGIC_OP:
11511 CALL_LogicOp(ctx->Exec, (n[1].e));
11515 GLenum target = n[1].e;
11516 GLint ustride = _mesa_evaluator_components(target);
11517 GLint uorder = n[5].i;
11518 GLfloat u1 = n[2].f;
11519 GLfloat u2 = n[3].f;
11520 CALL_Map1f(ctx->Exec, (target, u1, u2, ustride, uorder,
11521 (GLfloat *) get_pointer(&n[6])));
11526 GLenum target = n[1].e;
11527 GLfloat u1 = n[2].f;
11528 GLfloat u2 = n[3].f;
11529 GLfloat v1 = n[4].f;
11530 GLfloat v2 = n[5].f;
11531 GLint ustride = n[6].i;
11532 GLint vstride = n[7].i;
11533 GLint uorder = n[8].i;
11534 GLint vorder = n[9].i;
11535 CALL_Map2f(ctx->Exec, (target, u1, u2, ustride, uorder,
11536 v1, v2, vstride, vorder,
11537 (GLfloat *) get_pointer(&n[10])));
11540 case OPCODE_MAPGRID1:
11541 CALL_MapGrid1f(ctx->Exec, (n[1].i, n[2].f, n[3].f));
11543 case OPCODE_MAPGRID2:
11544 CALL_MapGrid2f(ctx->Exec,
11545 (n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f));
11547 case OPCODE_MATRIX_MODE:
11548 CALL_MatrixMode(ctx->Exec, (n[1].e));
11550 case OPCODE_MULT_MATRIX:
11551 CALL_MultMatrixf(ctx->Exec, (&n[1].f));
11554 CALL_Ortho(ctx->Exec,
11555 (n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f));
11557 case OPCODE_PASSTHROUGH:
11558 CALL_PassThrough(ctx->Exec, (n[1].f));
11560 case OPCODE_PATCH_PARAMETER_I:
11561 CALL_PatchParameteri(ctx->Exec, (n[1].e, n[2].i));
11563 case OPCODE_PATCH_PARAMETER_FV_INNER:
11566 params[0] = n[2].f;
11567 params[1] = n[3].f;
11568 CALL_PatchParameterfv(ctx->Exec, (n[1].e, params));
11571 case OPCODE_PATCH_PARAMETER_FV_OUTER:
11574 params[0] = n[2].f;
11575 params[1] = n[3].f;
11576 params[2] = n[4].f;
11577 params[3] = n[5].f;
11578 CALL_PatchParameterfv(ctx->Exec, (n[1].e, params));
11581 case OPCODE_PIXEL_MAP:
11582 CALL_PixelMapfv(ctx->Exec,
11583 (n[1].e, n[2].i, get_pointer(&n[3])));
11585 case OPCODE_PIXEL_TRANSFER:
11586 CALL_PixelTransferf(ctx->Exec, (n[1].e, n[2].f));
11588 case OPCODE_PIXEL_ZOOM:
11589 CALL_PixelZoom(ctx->Exec, (n[1].f, n[2].f));
11591 case OPCODE_POINT_SIZE:
11592 CALL_PointSize(ctx->Exec, (n[1].f));
11594 case OPCODE_POINT_PARAMETERS:
11597 params[0] = n[2].f;
11598 params[1] = n[3].f;
11599 params[2] = n[4].f;
11600 CALL_PointParameterfv(ctx->Exec, (n[1].e, params));
11603 case OPCODE_POLYGON_MODE:
11604 CALL_PolygonMode(ctx->Exec, (n[1].e, n[2].e));
11606 case OPCODE_POLYGON_STIPPLE:
11608 const struct gl_pixelstore_attrib save = ctx->Unpack;
11609 ctx->Unpack = ctx->DefaultPacking;
11610 CALL_PolygonStipple(ctx->Exec, (get_pointer(&n[1])));
11611 ctx->Unpack = save; /* restore */
11614 case OPCODE_POLYGON_OFFSET:
11615 CALL_PolygonOffset(ctx->Exec, (n[1].f, n[2].f));
11617 case OPCODE_POLYGON_OFFSET_CLAMP:
11618 CALL_PolygonOffsetClampEXT(ctx->Exec, (n[1].f, n[2].f, n[3].f));
11620 case OPCODE_POP_ATTRIB:
11621 CALL_PopAttrib(ctx->Exec, ());
11623 case OPCODE_POP_MATRIX:
11624 CALL_PopMatrix(ctx->Exec, ());
11626 case OPCODE_POP_NAME:
11627 CALL_PopName(ctx->Exec, ());
11629 case OPCODE_PRIORITIZE_TEXTURE:
11630 CALL_PrioritizeTextures(ctx->Exec, (1, &n[1].ui, &n[2].f));
11632 case OPCODE_PUSH_ATTRIB:
11633 CALL_PushAttrib(ctx->Exec, (n[1].bf));
11635 case OPCODE_PUSH_MATRIX:
11636 CALL_PushMatrix(ctx->Exec, ());
11638 case OPCODE_PUSH_NAME:
11639 CALL_PushName(ctx->Exec, (n[1].ui));
11641 case OPCODE_RASTER_POS:
11642 CALL_RasterPos4f(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
11644 case OPCODE_READ_BUFFER:
11645 CALL_ReadBuffer(ctx->Exec, (n[1].e));
11647 case OPCODE_ROTATE:
11648 CALL_Rotatef(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
11651 CALL_Scalef(ctx->Exec, (n[1].f, n[2].f, n[3].f));
11653 case OPCODE_SCISSOR:
11654 CALL_Scissor(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));
11656 case OPCODE_SHADE_MODEL:
11657 CALL_ShadeModel(ctx->Exec, (n[1].e));
11659 case OPCODE_PROVOKING_VERTEX:
11660 CALL_ProvokingVertex(ctx->Exec, (n[1].e));
11662 case OPCODE_STENCIL_FUNC:
11663 CALL_StencilFunc(ctx->Exec, (n[1].e, n[2].i, n[3].ui));
11665 case OPCODE_STENCIL_MASK:
11666 CALL_StencilMask(ctx->Exec, (n[1].ui));
11668 case OPCODE_STENCIL_OP:
11669 CALL_StencilOp(ctx->Exec, (n[1].e, n[2].e, n[3].e));
11671 case OPCODE_STENCIL_FUNC_SEPARATE:
11672 CALL_StencilFuncSeparate(ctx->Exec,
11673 (n[1].e, n[2].e, n[3].i, n[4].ui));
11675 case OPCODE_STENCIL_MASK_SEPARATE:
11676 CALL_StencilMaskSeparate(ctx->Exec, (n[1].e, n[2].ui));
11678 case OPCODE_STENCIL_OP_SEPARATE:
11679 CALL_StencilOpSeparate(ctx->Exec,
11680 (n[1].e, n[2].e, n[3].e, n[4].e));
11682 case OPCODE_TEXENV:
11685 params[0] = n[3].f;
11686 params[1] = n[4].f;
11687 params[2] = n[5].f;
11688 params[3] = n[6].f;
11689 CALL_TexEnvfv(ctx->Exec, (n[1].e, n[2].e, params));
11692 case OPCODE_TEXGEN:
11695 params[0] = n[3].f;
11696 params[1] = n[4].f;
11697 params[2] = n[5].f;
11698 params[3] = n[6].f;
11699 CALL_TexGenfv(ctx->Exec, (n[1].e, n[2].e, params));
11702 case OPCODE_TEXPARAMETER:
11705 params[0] = n[3].f;
11706 params[1] = n[4].f;
11707 params[2] = n[5].f;
11708 params[3] = n[6].f;
11709 CALL_TexParameterfv(ctx->Exec, (n[1].e, n[2].e, params));
11712 case OPCODE_TEX_IMAGE1D:
11714 const struct gl_pixelstore_attrib save = ctx->Unpack;
11715 ctx->Unpack = ctx->DefaultPacking;
11716 CALL_TexImage1D(ctx->Exec, (n[1].e, /* target */
11717 n[2].i, /* level */
11718 n[3].i, /* components */
11719 n[4].i, /* width */
11720 n[5].e, /* border */
11721 n[6].e, /* format */
11723 get_pointer(&n[8])));
11724 ctx->Unpack = save; /* restore */
11727 case OPCODE_TEX_IMAGE2D:
11729 const struct gl_pixelstore_attrib save = ctx->Unpack;
11730 ctx->Unpack = ctx->DefaultPacking;
11731 CALL_TexImage2D(ctx->Exec, (n[1].e, /* target */
11732 n[2].i, /* level */
11733 n[3].i, /* components */
11734 n[4].i, /* width */
11735 n[5].i, /* height */
11736 n[6].e, /* border */
11737 n[7].e, /* format */
11739 get_pointer(&n[9])));
11740 ctx->Unpack = save; /* restore */
11743 case OPCODE_TEX_IMAGE3D:
11745 const struct gl_pixelstore_attrib save = ctx->Unpack;
11746 ctx->Unpack = ctx->DefaultPacking;
11747 CALL_TexImage3D(ctx->Exec, (n[1].e, /* target */
11748 n[2].i, /* level */
11749 n[3].i, /* components */
11750 n[4].i, /* width */
11751 n[5].i, /* height */
11752 n[6].i, /* depth */
11753 n[7].e, /* border */
11754 n[8].e, /* format */
11756 get_pointer(&n[10])));
11757 ctx->Unpack = save; /* restore */
11760 case OPCODE_TEX_SUB_IMAGE1D:
11762 const struct gl_pixelstore_attrib save = ctx->Unpack;
11763 ctx->Unpack = ctx->DefaultPacking;
11764 CALL_TexSubImage1D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
11766 n[6].e, get_pointer(&n[7])));
11767 ctx->Unpack = save; /* restore */
11770 case OPCODE_TEX_SUB_IMAGE2D:
11772 const struct gl_pixelstore_attrib save = ctx->Unpack;
11773 ctx->Unpack = ctx->DefaultPacking;
11774 CALL_TexSubImage2D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
11776 n[6].i, n[7].e, n[8].e,
11777 get_pointer(&n[9])));
11778 ctx->Unpack = save; /* restore */
11781 case OPCODE_TEX_SUB_IMAGE3D:
11783 const struct gl_pixelstore_attrib save = ctx->Unpack;
11784 ctx->Unpack = ctx->DefaultPacking;
11785 CALL_TexSubImage3D(ctx->Exec, (n[1].e, n[2].i, n[3].i,
11786 n[4].i, n[5].i, n[6].i, n[7].i,
11787 n[8].i, n[9].e, n[10].e,
11788 get_pointer(&n[11])));
11789 ctx->Unpack = save; /* restore */
11792 case OPCODE_TRANSLATE:
11793 CALL_Translatef(ctx->Exec, (n[1].f, n[2].f, n[3].f));
11795 case OPCODE_VIEWPORT:
11796 CALL_Viewport(ctx->Exec, (n[1].i, n[2].i,
11797 (GLsizei) n[3].i, (GLsizei) n[4].i));
11799 case OPCODE_WINDOW_POS:
11800 CALL_WindowPos4fMESA(ctx->Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
11802 case OPCODE_VIEWPORT_ARRAY_V:
11803 CALL_ViewportArrayv(ctx->Exec, (n[1].ui, n[2].si,
11804 get_pointer(&n[3])));
11806 case OPCODE_VIEWPORT_INDEXED_F:
11807 CALL_ViewportIndexedf(ctx->Exec, (n[1].ui, n[2].f, n[3].f, n[4].f,
11810 case OPCODE_VIEWPORT_INDEXED_FV: {
11816 CALL_ViewportIndexedfv(ctx->Exec, (n[1].ui, v));
11819 case OPCODE_SCISSOR_ARRAY_V:
11820 CALL_ScissorArrayv(ctx->Exec, (n[1].ui, n[2].si,
11821 get_pointer(&n[3])));
11823 case OPCODE_SCISSOR_INDEXED:
11824 CALL_ScissorIndexed(ctx->Exec, (n[1].ui, n[2].i, n[3].i, n[4].si,
11827 case OPCODE_SCISSOR_INDEXED_V: {
11833 CALL_ScissorIndexedv(ctx->Exec, (n[1].ui, v));
11836 case OPCODE_DEPTH_ARRAY_V:
11837 CALL_DepthRangeArrayv(ctx->Exec, (n[1].ui, n[2].si,
11838 get_pointer(&n[3])));
11840 case OPCODE_DEPTH_INDEXED:
11841 CALL_DepthRangeIndexed(ctx->Exec, (n[1].ui, n[2].f, n[3].f));
11843 case OPCODE_ACTIVE_TEXTURE: /* GL_ARB_multitexture */
11844 CALL_ActiveTexture(ctx->Exec, (n[1].e));
11846 case OPCODE_COMPRESSED_TEX_IMAGE_1D: /* GL_ARB_texture_compression */
11847 CALL_CompressedTexImage1D(ctx->Exec, (n[1].e, n[2].i, n[3].e,
11848 n[4].i, n[5].i, n[6].i,
11849 get_pointer(&n[7])));
11851 case OPCODE_COMPRESSED_TEX_IMAGE_2D: /* GL_ARB_texture_compression */
11852 CALL_CompressedTexImage2D(ctx->Exec, (n[1].e, n[2].i, n[3].e,
11853 n[4].i, n[5].i, n[6].i,
11854 n[7].i, get_pointer(&n[8])));
11856 case OPCODE_COMPRESSED_TEX_IMAGE_3D: /* GL_ARB_texture_compression */
11857 CALL_CompressedTexImage3D(ctx->Exec, (n[1].e, n[2].i, n[3].e,
11858 n[4].i, n[5].i, n[6].i,
11860 get_pointer(&n[9])));
11862 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D: /* GL_ARB_texture_compress */
11863 CALL_CompressedTexSubImage1D(ctx->Exec,
11864 (n[1].e, n[2].i, n[3].i, n[4].i,
11866 get_pointer(&n[7])));
11868 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D: /* GL_ARB_texture_compress */
11869 CALL_CompressedTexSubImage2D(ctx->Exec,
11870 (n[1].e, n[2].i, n[3].i, n[4].i,
11871 n[5].i, n[6].i, n[7].e, n[8].i,
11872 get_pointer(&n[9])));
11874 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D: /* GL_ARB_texture_compress */
11875 CALL_CompressedTexSubImage3D(ctx->Exec,
11876 (n[1].e, n[2].i, n[3].i, n[4].i,
11877 n[5].i, n[6].i, n[7].i, n[8].i,
11879 get_pointer(&n[11])));
11881 case OPCODE_SAMPLE_COVERAGE: /* GL_ARB_multisample */
11882 CALL_SampleCoverage(ctx->Exec, (n[1].f, n[2].b));
11884 case OPCODE_WINDOW_POS_ARB: /* GL_ARB_window_pos */
11885 CALL_WindowPos3f(ctx->Exec, (n[1].f, n[2].f, n[3].f));
11887 case OPCODE_BIND_PROGRAM_ARB: /* GL_ARB_vertex_program */
11888 CALL_BindProgramARB(ctx->Exec, (n[1].e, n[2].ui));
11890 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB:
11891 CALL_ProgramLocalParameter4fARB(ctx->Exec,
11892 (n[1].e, n[2].ui, n[3].f, n[4].f,
11895 case OPCODE_ACTIVE_STENCIL_FACE_EXT:
11896 CALL_ActiveStencilFaceEXT(ctx->Exec, (n[1].e));
11898 case OPCODE_DEPTH_BOUNDS_EXT:
11899 CALL_DepthBoundsEXT(ctx->Exec, (n[1].f, n[2].f));
11901 case OPCODE_PROGRAM_STRING_ARB:
11902 CALL_ProgramStringARB(ctx->Exec,
11903 (n[1].e, n[2].e, n[3].i,
11904 get_pointer(&n[4])));
11906 case OPCODE_PROGRAM_ENV_PARAMETER_ARB:
11907 CALL_ProgramEnvParameter4fARB(ctx->Exec, (n[1].e, n[2].ui, n[3].f,
11911 case OPCODE_BEGIN_QUERY_ARB:
11912 CALL_BeginQuery(ctx->Exec, (n[1].e, n[2].ui));
11914 case OPCODE_END_QUERY_ARB:
11915 CALL_EndQuery(ctx->Exec, (n[1].e));
11917 case OPCODE_QUERY_COUNTER:
11918 CALL_QueryCounter(ctx->Exec, (n[1].ui, n[2].e));
11920 case OPCODE_BEGIN_QUERY_INDEXED:
11921 CALL_BeginQueryIndexed(ctx->Exec, (n[1].e, n[2].ui, n[3].ui));
11923 case OPCODE_END_QUERY_INDEXED:
11924 CALL_EndQueryIndexed(ctx->Exec, (n[1].e, n[2].ui));
11926 case OPCODE_DRAW_BUFFERS_ARB:
11928 GLenum buffers[MAX_DRAW_BUFFERS];
11929 GLint i, count = MIN2(n[1].i, MAX_DRAW_BUFFERS);
11930 for (i = 0; i < count; i++)
11931 buffers[i] = n[2 + i].e;
11932 CALL_DrawBuffers(ctx->Exec, (n[1].i, buffers));
11935 case OPCODE_BLIT_FRAMEBUFFER:
11936 CALL_BlitFramebuffer(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i,
11937 n[5].i, n[6].i, n[7].i, n[8].i,
11940 case OPCODE_PRIMITIVE_RESTART_NV:
11941 CALL_PrimitiveRestartNV(ctx->Exec, ());
11944 case OPCODE_USE_PROGRAM:
11945 CALL_UseProgram(ctx->Exec, (n[1].ui));
11947 case OPCODE_UNIFORM_1F:
11948 CALL_Uniform1f(ctx->Exec, (n[1].i, n[2].f));
11950 case OPCODE_UNIFORM_2F:
11951 CALL_Uniform2f(ctx->Exec, (n[1].i, n[2].f, n[3].f));
11953 case OPCODE_UNIFORM_3F:
11954 CALL_Uniform3f(ctx->Exec, (n[1].i, n[2].f, n[3].f, n[4].f));
11956 case OPCODE_UNIFORM_4F:
11957 CALL_Uniform4f(ctx->Exec,
11958 (n[1].i, n[2].f, n[3].f, n[4].f, n[5].f));
11960 case OPCODE_UNIFORM_1FV:
11961 CALL_Uniform1fv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11963 case OPCODE_UNIFORM_2FV:
11964 CALL_Uniform2fv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11966 case OPCODE_UNIFORM_3FV:
11967 CALL_Uniform3fv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11969 case OPCODE_UNIFORM_4FV:
11970 CALL_Uniform4fv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11972 case OPCODE_UNIFORM_1D: {
11973 union float64_pair x;
11975 x.uint32[0] = n[2].ui;
11976 x.uint32[1] = n[3].ui;
11978 CALL_Uniform1d(ctx->Exec, (n[1].i, x.d));
11981 case OPCODE_UNIFORM_2D: {
11982 union float64_pair x;
11983 union float64_pair y;
11985 x.uint32[0] = n[2].ui;
11986 x.uint32[1] = n[3].ui;
11987 y.uint32[0] = n[4].ui;
11988 y.uint32[1] = n[5].ui;
11990 CALL_Uniform2d(ctx->Exec, (n[1].i, x.d, y.d));
11993 case OPCODE_UNIFORM_3D: {
11994 union float64_pair x;
11995 union float64_pair y;
11996 union float64_pair z;
11998 x.uint32[0] = n[2].ui;
11999 x.uint32[1] = n[3].ui;
12000 y.uint32[0] = n[4].ui;
12001 y.uint32[1] = n[5].ui;
12002 z.uint32[0] = n[6].ui;
12003 z.uint32[1] = n[7].ui;
12005 CALL_Uniform3d(ctx->Exec, (n[1].i, x.d, y.d, z.d));
12008 case OPCODE_UNIFORM_4D: {
12009 union float64_pair x;
12010 union float64_pair y;
12011 union float64_pair z;
12012 union float64_pair w;
12014 x.uint32[0] = n[2].ui;
12015 x.uint32[1] = n[3].ui;
12016 y.uint32[0] = n[4].ui;
12017 y.uint32[1] = n[5].ui;
12018 z.uint32[0] = n[6].ui;
12019 z.uint32[1] = n[7].ui;
12020 w.uint32[0] = n[8].ui;
12021 w.uint32[1] = n[9].ui;
12023 CALL_Uniform4d(ctx->Exec, (n[1].i, x.d, y.d, z.d, w.d));
12026 case OPCODE_UNIFORM_1DV:
12027 CALL_Uniform1dv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
12029 case OPCODE_UNIFORM_2DV:
12030 CALL_Uniform2dv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
12032 case OPCODE_UNIFORM_3DV:
12033 CALL_Uniform3dv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
12035 case OPCODE_UNIFORM_4DV:
12036 CALL_Uniform4dv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
12038 case OPCODE_UNIFORM_1I:
12039 CALL_Uniform1i(ctx->Exec, (n[1].i, n[2].i));
12041 case OPCODE_UNIFORM_2I:
12042 CALL_Uniform2i(ctx->Exec, (n[1].i, n[2].i, n[3].i));
12044 case OPCODE_UNIFORM_3I:
12045 CALL_Uniform3i(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));
12047 case OPCODE_UNIFORM_4I:
12048 CALL_Uniform4i(ctx->Exec,
12049 (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
12051 case OPCODE_UNIFORM_1IV:
12052 CALL_Uniform1iv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
12054 case OPCODE_UNIFORM_2IV:
12055 CALL_Uniform2iv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
12057 case OPCODE_UNIFORM_3IV:
12058 CALL_Uniform3iv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
12060 case OPCODE_UNIFORM_4IV:
12061 CALL_Uniform4iv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
12063 case OPCODE_UNIFORM_1UI:
12064 CALL_Uniform1ui(ctx->Exec, (n[1].i, n[2].i));
12066 case OPCODE_UNIFORM_2UI:
12067 CALL_Uniform2ui(ctx->Exec, (n[1].i, n[2].i, n[3].i));
12069 case OPCODE_UNIFORM_3UI:
12070 CALL_Uniform3ui(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));
12072 case OPCODE_UNIFORM_4UI:
12073 CALL_Uniform4ui(ctx->Exec,
12074 (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
12076 case OPCODE_UNIFORM_1UIV:
12077 CALL_Uniform1uiv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
12079 case OPCODE_UNIFORM_2UIV:
12080 CALL_Uniform2uiv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
12082 case OPCODE_UNIFORM_3UIV:
12083 CALL_Uniform3uiv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
12085 case OPCODE_UNIFORM_4UIV:
12086 CALL_Uniform4uiv(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
12088 case OPCODE_UNIFORM_MATRIX22:
12089 CALL_UniformMatrix2fv(ctx->Exec,
12090 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12092 case OPCODE_UNIFORM_MATRIX33:
12093 CALL_UniformMatrix3fv(ctx->Exec,
12094 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12096 case OPCODE_UNIFORM_MATRIX44:
12097 CALL_UniformMatrix4fv(ctx->Exec,
12098 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12100 case OPCODE_UNIFORM_MATRIX23:
12101 CALL_UniformMatrix2x3fv(ctx->Exec,
12102 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12104 case OPCODE_UNIFORM_MATRIX32:
12105 CALL_UniformMatrix3x2fv(ctx->Exec,
12106 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12108 case OPCODE_UNIFORM_MATRIX24:
12109 CALL_UniformMatrix2x4fv(ctx->Exec,
12110 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12112 case OPCODE_UNIFORM_MATRIX42:
12113 CALL_UniformMatrix4x2fv(ctx->Exec,
12114 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12116 case OPCODE_UNIFORM_MATRIX34:
12117 CALL_UniformMatrix3x4fv(ctx->Exec,
12118 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12120 case OPCODE_UNIFORM_MATRIX43:
12121 CALL_UniformMatrix4x3fv(ctx->Exec,
12122 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12124 case OPCODE_UNIFORM_MATRIX22D:
12125 CALL_UniformMatrix2dv(ctx->Exec,
12126 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12128 case OPCODE_UNIFORM_MATRIX33D:
12129 CALL_UniformMatrix3dv(ctx->Exec,
12130 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12132 case OPCODE_UNIFORM_MATRIX44D:
12133 CALL_UniformMatrix4dv(ctx->Exec,
12134 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12136 case OPCODE_UNIFORM_MATRIX23D:
12137 CALL_UniformMatrix2x3dv(ctx->Exec,
12138 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12140 case OPCODE_UNIFORM_MATRIX32D:
12141 CALL_UniformMatrix3x2dv(ctx->Exec,
12142 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12144 case OPCODE_UNIFORM_MATRIX24D:
12145 CALL_UniformMatrix2x4dv(ctx->Exec,
12146 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12148 case OPCODE_UNIFORM_MATRIX42D:
12149 CALL_UniformMatrix4x2dv(ctx->Exec,
12150 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12152 case OPCODE_UNIFORM_MATRIX34D:
12153 CALL_UniformMatrix3x4dv(ctx->Exec,
12154 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12156 case OPCODE_UNIFORM_MATRIX43D:
12157 CALL_UniformMatrix4x3dv(ctx->Exec,
12158 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
12161 case OPCODE_UNIFORM_1I64: {
12162 union int64_pair x;
12164 x.int32[0] = n[2].i;
12165 x.int32[1] = n[3].i;
12167 CALL_Uniform1i64ARB(ctx->Exec, (n[1].i, x.int64));
12170 case OPCODE_UNIFORM_2I64: {
12171 union int64_pair x;
12172 union int64_pair y;
12174 x.int32[0] = n[2].i;
12175 x.int32[1] = n[3].i;
12176 y.int32[0] = n[4].i;
12177 y.int32[1] = n[5].i;
12179 CALL_Uniform2i64ARB(ctx->Exec, (n[1].i, x.int64, y.int64));
12182 case OPCODE_UNIFORM_3I64: {
12183 union int64_pair x;
12184 union int64_pair y;
12185 union int64_pair z;
12187 x.int32[0] = n[2].i;
12188 x.int32[1] = n[3].i;
12189 y.int32[0] = n[4].i;
12190 y.int32[1] = n[5].i;
12191 z.int32[0] = n[6].i;
12192 z.int32[1] = n[7].i;
12195 CALL_Uniform3i64ARB(ctx->Exec, (n[1].i, x.int64, y.int64, z.int64));
12198 case OPCODE_UNIFORM_4I64: {
12199 union int64_pair x;
12200 union int64_pair y;
12201 union int64_pair z;
12202 union int64_pair w;
12204 x.int32[0] = n[2].i;
12205 x.int32[1] = n[3].i;
12206 y.int32[0] = n[4].i;
12207 y.int32[1] = n[5].i;
12208 z.int32[0] = n[6].i;
12209 z.int32[1] = n[7].i;
12210 w.int32[0] = n[8].i;
12211 w.int32[1] = n[9].i;
12213 CALL_Uniform4i64ARB(ctx->Exec, (n[1].i, x.int64, y.int64, z.int64, w.int64));
12216 case OPCODE_UNIFORM_1I64V:
12217 CALL_Uniform1i64vARB(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
12219 case OPCODE_UNIFORM_2I64V:
12220 CALL_Uniform2i64vARB(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
12222 case OPCODE_UNIFORM_3I64V:
12223 CALL_Uniform3i64vARB(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
12225 case OPCODE_UNIFORM_4I64V:
12226 CALL_Uniform4i64vARB(ctx->Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
12228 case OPCODE_UNIFORM_1UI64: {
12229 union uint64_pair x;
12231 x.uint32[0] = n[2].ui;
12232 x.uint32[1] = n[3].ui;
12234 CALL_Uniform1ui64ARB(ctx->Exec, (n[1].i, x.uint64));
12237 case OPCODE_UNIFORM_2UI64: {
12238 union uint64_pair x;
12239 union uint64_pair y;
12241 x.uint32[0] = n[2].ui;
12242 x.uint32[1] = n[3].ui;
12243 y.uint32[0] = n[4].ui;
12244 y.uint32[1] = n[5].ui;
12246 CALL_Uniform2ui64ARB(ctx->Exec, (n[1].i, x.uint64, y.uint64));
12249 case OPCODE_UNIFORM_3UI64: {
12250 union uint64_pair x;
12251 union uint64_pair y;
12252 union uint64_pair z;
12254 x.uint32[0] = n[2].ui;
12255 x.uint32[1] = n[3].ui;
12256 y.uint32[0] = n[4].ui;
12257 y.uint32[1] = n[5].ui;
12258 z.uint32[0] = n[6].ui;
12259 z.uint32[1] = n[7].ui;
12262 CALL_Uniform3ui64ARB(ctx->Exec, (n[1].i, x.uint64, y.uint64,
12266 case OPCODE_UNIFORM_4UI64: {
12267 union uint64_pair x;
12268 union uint64_pair y;
12269 union uint64_pair z;
12270 union uint64_pair w;
12272 x.uint32[0] = n[2].ui;
12273 x.uint32[1] = n[3].ui;
12274 y.uint32[0] = n[4].ui;
12275 y.uint32[1] = n[5].ui;
12276 z.uint32[0] = n[6].ui;
12277 z.uint32[1] = n[7].ui;
12278 w.uint32[0] = n[8].ui;
12279 w.uint32[1] = n[9].ui;
12281 CALL_Uniform4ui64ARB(ctx->Exec, (n[1].i, x.uint64, y.uint64,
12282 z.uint64, w.uint64));
12285 case OPCODE_UNIFORM_1UI64V:
12286 CALL_Uniform1ui64vARB(ctx->Exec, (n[1].i, n[2].i,
12287 get_pointer(&n[3])));
12289 case OPCODE_UNIFORM_2UI64V:
12290 CALL_Uniform2ui64vARB(ctx->Exec, (n[1].i, n[2].i,
12291 get_pointer(&n[3])));
12293 case OPCODE_UNIFORM_3UI64V:
12294 CALL_Uniform3ui64vARB(ctx->Exec, (n[1].i, n[2].i,
12295 get_pointer(&n[3])));
12297 case OPCODE_UNIFORM_4UI64V:
12298 CALL_Uniform4ui64vARB(ctx->Exec, (n[1].i, n[2].i,
12299 get_pointer(&n[3])));
12302 case OPCODE_PROGRAM_UNIFORM_1I64: {
12303 union int64_pair x;
12305 x.int32[0] = n[3].i;
12306 x.int32[1] = n[4].i;
12308 CALL_ProgramUniform1i64ARB(ctx->Exec, (n[1].ui, n[2].i, x.int64));
12311 case OPCODE_PROGRAM_UNIFORM_2I64: {
12312 union int64_pair x;
12313 union int64_pair y;
12315 x.int32[0] = n[3].i;
12316 x.int32[1] = n[4].i;
12317 y.int32[0] = n[5].i;
12318 y.int32[1] = n[6].i;
12320 CALL_ProgramUniform2i64ARB(ctx->Exec, (n[1].ui, n[2].i, x.int64,
12324 case OPCODE_PROGRAM_UNIFORM_3I64: {
12325 union int64_pair x;
12326 union int64_pair y;
12327 union int64_pair z;
12329 x.int32[0] = n[3].i;
12330 x.int32[1] = n[4].i;
12331 y.int32[0] = n[5].i;
12332 y.int32[1] = n[6].i;
12333 z.int32[0] = n[7].i;
12334 z.int32[1] = n[8].i;
12336 CALL_ProgramUniform3i64ARB(ctx->Exec, (n[1].ui, n[2].i, x.int64,
12337 y.int64, z.int64));
12340 case OPCODE_PROGRAM_UNIFORM_4I64: {
12341 union int64_pair x;
12342 union int64_pair y;
12343 union int64_pair z;
12344 union int64_pair w;
12346 x.int32[0] = n[3].i;
12347 x.int32[1] = n[4].i;
12348 y.int32[0] = n[5].i;
12349 y.int32[1] = n[6].i;
12350 z.int32[0] = n[7].i;
12351 z.int32[1] = n[8].i;
12352 w.int32[0] = n[9].i;
12353 w.int32[1] = n[10].i;
12355 CALL_ProgramUniform4i64ARB(ctx->Exec, (n[1].ui, n[2].i, x.int64,
12356 y.int64, z.int64, w.int64));
12359 case OPCODE_PROGRAM_UNIFORM_1I64V:
12360 CALL_ProgramUniform1i64vARB(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12361 get_pointer(&n[4])));
12363 case OPCODE_PROGRAM_UNIFORM_2I64V:
12364 CALL_ProgramUniform2i64vARB(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12365 get_pointer(&n[4])));
12367 case OPCODE_PROGRAM_UNIFORM_3I64V:
12368 CALL_ProgramUniform3i64vARB(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12369 get_pointer(&n[4])));
12371 case OPCODE_PROGRAM_UNIFORM_4I64V:
12372 CALL_ProgramUniform4i64vARB(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12373 get_pointer(&n[4])));
12375 case OPCODE_PROGRAM_UNIFORM_1UI64: {
12376 union uint64_pair x;
12378 x.uint32[0] = n[3].ui;
12379 x.uint32[1] = n[4].ui;
12381 CALL_ProgramUniform1i64ARB(ctx->Exec, (n[1].ui, n[2].i, x.uint64));
12384 case OPCODE_PROGRAM_UNIFORM_2UI64: {
12385 union uint64_pair x;
12386 union uint64_pair y;
12388 x.uint32[0] = n[3].ui;
12389 x.uint32[1] = n[4].ui;
12390 y.uint32[0] = n[5].ui;
12391 y.uint32[1] = n[6].ui;
12393 CALL_ProgramUniform2ui64ARB(ctx->Exec, (n[1].ui, n[2].i, x.uint64,
12397 case OPCODE_PROGRAM_UNIFORM_3UI64: {
12398 union uint64_pair x;
12399 union uint64_pair y;
12400 union uint64_pair z;
12402 x.uint32[0] = n[3].ui;
12403 x.uint32[1] = n[4].ui;
12404 y.uint32[0] = n[5].ui;
12405 y.uint32[1] = n[6].ui;
12406 z.uint32[0] = n[7].ui;
12407 z.uint32[1] = n[8].ui;
12409 CALL_ProgramUniform3ui64ARB(ctx->Exec, (n[1].ui, n[2].i, x.uint64,
12410 y.uint64, z.uint64));
12413 case OPCODE_PROGRAM_UNIFORM_4UI64: {
12414 union uint64_pair x;
12415 union uint64_pair y;
12416 union uint64_pair z;
12417 union uint64_pair w;
12419 x.uint32[0] = n[3].ui;
12420 x.uint32[1] = n[4].ui;
12421 y.uint32[0] = n[5].ui;
12422 y.uint32[1] = n[6].ui;
12423 z.uint32[0] = n[7].ui;
12424 z.uint32[1] = n[8].ui;
12425 w.uint32[0] = n[9].ui;
12426 w.uint32[1] = n[10].ui;
12428 CALL_ProgramUniform4ui64ARB(ctx->Exec, (n[1].ui, n[2].i, x.uint64,
12429 y.uint64, z.uint64, w.uint64));
12432 case OPCODE_PROGRAM_UNIFORM_1UI64V:
12433 CALL_ProgramUniform1ui64vARB(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12434 get_pointer(&n[4])));
12436 case OPCODE_PROGRAM_UNIFORM_2UI64V:
12437 CALL_ProgramUniform2ui64vARB(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12438 get_pointer(&n[4])));
12440 case OPCODE_PROGRAM_UNIFORM_3UI64V:
12441 CALL_ProgramUniform3ui64vARB(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12442 get_pointer(&n[4])));
12444 case OPCODE_PROGRAM_UNIFORM_4UI64V:
12445 CALL_ProgramUniform4ui64vARB(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12446 get_pointer(&n[4])));
12449 case OPCODE_USE_PROGRAM_STAGES:
12450 CALL_UseProgramStages(ctx->Exec, (n[1].ui, n[2].ui, n[3].ui));
12452 case OPCODE_PROGRAM_UNIFORM_1F:
12453 CALL_ProgramUniform1f(ctx->Exec, (n[1].ui, n[2].i, n[3].f));
12455 case OPCODE_PROGRAM_UNIFORM_2F:
12456 CALL_ProgramUniform2f(ctx->Exec, (n[1].ui, n[2].i, n[3].f, n[4].f));
12458 case OPCODE_PROGRAM_UNIFORM_3F:
12459 CALL_ProgramUniform3f(ctx->Exec, (n[1].ui, n[2].i,
12460 n[3].f, n[4].f, n[5].f));
12462 case OPCODE_PROGRAM_UNIFORM_4F:
12463 CALL_ProgramUniform4f(ctx->Exec, (n[1].ui, n[2].i,
12464 n[3].f, n[4].f, n[5].f, n[6].f));
12466 case OPCODE_PROGRAM_UNIFORM_1FV:
12467 CALL_ProgramUniform1fv(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12468 get_pointer(&n[4])));
12470 case OPCODE_PROGRAM_UNIFORM_2FV:
12471 CALL_ProgramUniform2fv(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12472 get_pointer(&n[4])));
12474 case OPCODE_PROGRAM_UNIFORM_3FV:
12475 CALL_ProgramUniform3fv(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12476 get_pointer(&n[4])));
12478 case OPCODE_PROGRAM_UNIFORM_4FV:
12479 CALL_ProgramUniform4fv(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12480 get_pointer(&n[4])));
12482 case OPCODE_PROGRAM_UNIFORM_1D: {
12483 union float64_pair x;
12485 x.uint32[0] = n[3].ui;
12486 x.uint32[1] = n[4].ui;
12488 CALL_ProgramUniform1d(ctx->Exec, (n[1].ui, n[2].i, x.d));
12491 case OPCODE_PROGRAM_UNIFORM_2D: {
12492 union float64_pair x;
12493 union float64_pair y;
12495 x.uint32[0] = n[3].ui;
12496 x.uint32[1] = n[4].ui;
12497 y.uint32[0] = n[5].ui;
12498 y.uint32[1] = n[6].ui;
12500 CALL_ProgramUniform2d(ctx->Exec, (n[1].ui, n[2].i, x.d, y.d));
12503 case OPCODE_PROGRAM_UNIFORM_3D: {
12504 union float64_pair x;
12505 union float64_pair y;
12506 union float64_pair z;
12508 x.uint32[0] = n[3].ui;
12509 x.uint32[1] = n[4].ui;
12510 y.uint32[0] = n[5].ui;
12511 y.uint32[1] = n[6].ui;
12512 z.uint32[0] = n[7].ui;
12513 z.uint32[1] = n[8].ui;
12515 CALL_ProgramUniform3d(ctx->Exec, (n[1].ui, n[2].i,
12519 case OPCODE_PROGRAM_UNIFORM_4D: {
12520 union float64_pair x;
12521 union float64_pair y;
12522 union float64_pair z;
12523 union float64_pair w;
12525 x.uint32[0] = n[3].ui;
12526 x.uint32[1] = n[4].ui;
12527 y.uint32[0] = n[5].ui;
12528 y.uint32[1] = n[6].ui;
12529 z.uint32[0] = n[7].ui;
12530 z.uint32[1] = n[8].ui;
12531 w.uint32[0] = n[9].ui;
12532 w.uint32[1] = n[10].ui;
12534 CALL_ProgramUniform4d(ctx->Exec, (n[1].ui, n[2].i,
12535 x.d, y.d, z.d, w.d));
12538 case OPCODE_PROGRAM_UNIFORM_1DV:
12539 CALL_ProgramUniform1dv(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12540 get_pointer(&n[4])));
12542 case OPCODE_PROGRAM_UNIFORM_2DV:
12543 CALL_ProgramUniform2dv(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12544 get_pointer(&n[4])));
12546 case OPCODE_PROGRAM_UNIFORM_3DV:
12547 CALL_ProgramUniform3dv(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12548 get_pointer(&n[4])));
12550 case OPCODE_PROGRAM_UNIFORM_4DV:
12551 CALL_ProgramUniform4dv(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12552 get_pointer(&n[4])));
12554 case OPCODE_PROGRAM_UNIFORM_1I:
12555 CALL_ProgramUniform1i(ctx->Exec, (n[1].ui, n[2].i, n[3].i));
12557 case OPCODE_PROGRAM_UNIFORM_2I:
12558 CALL_ProgramUniform2i(ctx->Exec, (n[1].ui, n[2].i, n[3].i, n[4].i));
12560 case OPCODE_PROGRAM_UNIFORM_3I:
12561 CALL_ProgramUniform3i(ctx->Exec, (n[1].ui, n[2].i,
12562 n[3].i, n[4].i, n[5].i));
12564 case OPCODE_PROGRAM_UNIFORM_4I:
12565 CALL_ProgramUniform4i(ctx->Exec, (n[1].ui, n[2].i,
12566 n[3].i, n[4].i, n[5].i, n[6].i));
12568 case OPCODE_PROGRAM_UNIFORM_1IV:
12569 CALL_ProgramUniform1iv(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12570 get_pointer(&n[4])));
12572 case OPCODE_PROGRAM_UNIFORM_2IV:
12573 CALL_ProgramUniform2iv(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12574 get_pointer(&n[4])));
12576 case OPCODE_PROGRAM_UNIFORM_3IV:
12577 CALL_ProgramUniform3iv(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12578 get_pointer(&n[4])));
12580 case OPCODE_PROGRAM_UNIFORM_4IV:
12581 CALL_ProgramUniform4iv(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12582 get_pointer(&n[4])));
12584 case OPCODE_PROGRAM_UNIFORM_1UI:
12585 CALL_ProgramUniform1ui(ctx->Exec, (n[1].ui, n[2].i, n[3].ui));
12587 case OPCODE_PROGRAM_UNIFORM_2UI:
12588 CALL_ProgramUniform2ui(ctx->Exec, (n[1].ui, n[2].i,
12589 n[3].ui, n[4].ui));
12591 case OPCODE_PROGRAM_UNIFORM_3UI:
12592 CALL_ProgramUniform3ui(ctx->Exec, (n[1].ui, n[2].i,
12593 n[3].ui, n[4].ui, n[5].ui));
12595 case OPCODE_PROGRAM_UNIFORM_4UI:
12596 CALL_ProgramUniform4ui(ctx->Exec, (n[1].ui, n[2].i,
12598 n[4].ui, n[5].ui, n[6].ui));
12600 case OPCODE_PROGRAM_UNIFORM_1UIV:
12601 CALL_ProgramUniform1uiv(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12602 get_pointer(&n[4])));
12604 case OPCODE_PROGRAM_UNIFORM_2UIV:
12605 CALL_ProgramUniform2uiv(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12606 get_pointer(&n[4])));
12608 case OPCODE_PROGRAM_UNIFORM_3UIV:
12609 CALL_ProgramUniform3uiv(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12610 get_pointer(&n[4])));
12612 case OPCODE_PROGRAM_UNIFORM_4UIV:
12613 CALL_ProgramUniform4uiv(ctx->Exec, (n[1].ui, n[2].i, n[3].i,
12614 get_pointer(&n[4])));
12616 case OPCODE_PROGRAM_UNIFORM_MATRIX22F:
12617 CALL_ProgramUniformMatrix2fv(ctx->Exec,
12618 (n[1].ui, n[2].i, n[3].i, n[4].b,
12619 get_pointer(&n[5])));
12621 case OPCODE_PROGRAM_UNIFORM_MATRIX23F:
12622 CALL_ProgramUniformMatrix2x3fv(ctx->Exec,
12623 (n[1].ui, n[2].i, n[3].i, n[4].b,
12624 get_pointer(&n[5])));
12626 case OPCODE_PROGRAM_UNIFORM_MATRIX24F:
12627 CALL_ProgramUniformMatrix2x4fv(ctx->Exec,
12628 (n[1].ui, n[2].i, n[3].i, n[4].b,
12629 get_pointer(&n[5])));
12631 case OPCODE_PROGRAM_UNIFORM_MATRIX32F:
12632 CALL_ProgramUniformMatrix3x2fv(ctx->Exec,
12633 (n[1].ui, n[2].i, n[3].i, n[4].b,
12634 get_pointer(&n[5])));
12636 case OPCODE_PROGRAM_UNIFORM_MATRIX33F:
12637 CALL_ProgramUniformMatrix3fv(ctx->Exec,
12638 (n[1].ui, n[2].i, n[3].i, n[4].b,
12639 get_pointer(&n[5])));
12641 case OPCODE_PROGRAM_UNIFORM_MATRIX34F:
12642 CALL_ProgramUniformMatrix3x4fv(ctx->Exec,
12643 (n[1].ui, n[2].i, n[3].i, n[4].b,
12644 get_pointer(&n[5])));
12646 case OPCODE_PROGRAM_UNIFORM_MATRIX42F:
12647 CALL_ProgramUniformMatrix4x2fv(ctx->Exec,
12648 (n[1].ui, n[2].i, n[3].i, n[4].b,
12649 get_pointer(&n[5])));
12651 case OPCODE_PROGRAM_UNIFORM_MATRIX43F:
12652 CALL_ProgramUniformMatrix4x3fv(ctx->Exec,
12653 (n[1].ui, n[2].i, n[3].i, n[4].b,
12654 get_pointer(&n[5])));
12656 case OPCODE_PROGRAM_UNIFORM_MATRIX44F:
12657 CALL_ProgramUniformMatrix4fv(ctx->Exec,
12658 (n[1].ui, n[2].i, n[3].i, n[4].b,
12659 get_pointer(&n[5])));
12661 case OPCODE_PROGRAM_UNIFORM_MATRIX22D:
12662 CALL_ProgramUniformMatrix2dv(ctx->Exec,
12663 (n[1].ui, n[2].i, n[3].i, n[4].b,
12664 get_pointer(&n[5])));
12666 case OPCODE_PROGRAM_UNIFORM_MATRIX23D:
12667 CALL_ProgramUniformMatrix2x3dv(ctx->Exec,
12668 (n[1].ui, n[2].i, n[3].i, n[4].b,
12669 get_pointer(&n[5])));
12671 case OPCODE_PROGRAM_UNIFORM_MATRIX24D:
12672 CALL_ProgramUniformMatrix2x4dv(ctx->Exec,
12673 (n[1].ui, n[2].i, n[3].i, n[4].b,
12674 get_pointer(&n[5])));
12676 case OPCODE_PROGRAM_UNIFORM_MATRIX32D:
12677 CALL_ProgramUniformMatrix3x2dv(ctx->Exec,
12678 (n[1].ui, n[2].i, n[3].i, n[4].b,
12679 get_pointer(&n[5])));
12681 case OPCODE_PROGRAM_UNIFORM_MATRIX33D:
12682 CALL_ProgramUniformMatrix3dv(ctx->Exec,
12683 (n[1].ui, n[2].i, n[3].i, n[4].b,
12684 get_pointer(&n[5])));
12686 case OPCODE_PROGRAM_UNIFORM_MATRIX34D:
12687 CALL_ProgramUniformMatrix3x4dv(ctx->Exec,
12688 (n[1].ui, n[2].i, n[3].i, n[4].b,
12689 get_pointer(&n[5])));
12691 case OPCODE_PROGRAM_UNIFORM_MATRIX42D:
12692 CALL_ProgramUniformMatrix4x2dv(ctx->Exec,
12693 (n[1].ui, n[2].i, n[3].i, n[4].b,
12694 get_pointer(&n[5])));
12696 case OPCODE_PROGRAM_UNIFORM_MATRIX43D:
12697 CALL_ProgramUniformMatrix4x3dv(ctx->Exec,
12698 (n[1].ui, n[2].i, n[3].i, n[4].b,
12699 get_pointer(&n[5])));
12701 case OPCODE_PROGRAM_UNIFORM_MATRIX44D:
12702 CALL_ProgramUniformMatrix4dv(ctx->Exec,
12703 (n[1].ui, n[2].i, n[3].i, n[4].b,
12704 get_pointer(&n[5])));
12707 case OPCODE_CLIP_CONTROL:
12708 CALL_ClipControl(ctx->Exec, (n[1].e, n[2].e));
12711 case OPCODE_CLAMP_COLOR:
12712 CALL_ClampColor(ctx->Exec, (n[1].e, n[2].e));
12715 case OPCODE_BIND_FRAGMENT_SHADER_ATI:
12716 CALL_BindFragmentShaderATI(ctx->Exec, (n[1].i));
12718 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI:
12719 CALL_SetFragmentShaderConstantATI(ctx->Exec, (n[1].ui, &n[2].f));
12721 case OPCODE_ATTR_1F_NV:
12722 CALL_VertexAttrib1fNV(ctx->Exec, (n[1].e, n[2].f));
12724 case OPCODE_ATTR_2F_NV:
12725 CALL_VertexAttrib2fvNV(ctx->Exec, (n[1].e, &n[2].f));
12727 case OPCODE_ATTR_3F_NV:
12728 CALL_VertexAttrib3fvNV(ctx->Exec, (n[1].e, &n[2].f));
12730 case OPCODE_ATTR_4F_NV:
12731 CALL_VertexAttrib4fvNV(ctx->Exec, (n[1].e, &n[2].f));
12733 case OPCODE_ATTR_1F_ARB:
12734 CALL_VertexAttrib1fARB(ctx->Exec, (n[1].e, n[2].f));
12736 case OPCODE_ATTR_2F_ARB:
12737 CALL_VertexAttrib2fvARB(ctx->Exec, (n[1].e, &n[2].f));
12739 case OPCODE_ATTR_3F_ARB:
12740 CALL_VertexAttrib3fvARB(ctx->Exec, (n[1].e, &n[2].f));
12742 case OPCODE_ATTR_4F_ARB:
12743 CALL_VertexAttrib4fvARB(ctx->Exec, (n[1].e, &n[2].f));
12745 case OPCODE_ATTR_1I:
12746 CALL_VertexAttribI1iEXT(ctx->Exec, (n[1].e, n[2].i));
12748 case OPCODE_ATTR_2I:
12749 CALL_VertexAttribI2ivEXT(ctx->Exec, (n[1].e, &n[2].i));
12751 case OPCODE_ATTR_3I:
12752 CALL_VertexAttribI3ivEXT(ctx->Exec, (n[1].e, &n[2].i));
12754 case OPCODE_ATTR_4I:
12755 CALL_VertexAttribI4ivEXT(ctx->Exec, (n[1].e, &n[2].i));
12757 case OPCODE_ATTR_1D: {
12758 GLdouble *d = (GLdouble *) &n[2];
12759 CALL_VertexAttribL1d(ctx->Exec, (n[1].ui, *d));
12762 case OPCODE_ATTR_2D: {
12763 GLdouble *d = (GLdouble *) &n[2];
12764 CALL_VertexAttribL2dv(ctx->Exec, (n[1].ui, d));
12767 case OPCODE_ATTR_3D: {
12768 GLdouble *d = (GLdouble *) &n[2];
12769 CALL_VertexAttribL3dv(ctx->Exec, (n[1].ui, d));
12772 case OPCODE_ATTR_4D: {
12773 GLdouble *d = (GLdouble *) &n[2];
12774 CALL_VertexAttribL4dv(ctx->Exec, (n[1].ui, d));
12777 case OPCODE_ATTR_1UI64: {
12778 uint64_t *ui64 = (uint64_t *) &n[2];
12779 CALL_VertexAttribL1ui64ARB(ctx->Exec, (n[1].ui, *ui64));
12782 case OPCODE_MATERIAL:
12783 CALL_Materialfv(ctx->Exec, (n[1].e, n[2].e, &n[3].f));
12786 CALL_Begin(ctx->Exec, (n[1].e));
12789 CALL_End(ctx->Exec, ());
12791 case OPCODE_EVAL_C1:
12792 CALL_EvalCoord1f(ctx->Exec, (n[1].f));
12794 case OPCODE_EVAL_C2:
12795 CALL_EvalCoord2f(ctx->Exec, (n[1].f, n[2].f));
12797 case OPCODE_EVAL_P1:
12798 CALL_EvalPoint1(ctx->Exec, (n[1].i));
12800 case OPCODE_EVAL_P2:
12801 CALL_EvalPoint2(ctx->Exec, (n[1].i, n[2].i));
12804 /* GL_EXT_texture_integer */
12805 case OPCODE_CLEARCOLOR_I:
12806 CALL_ClearColorIiEXT(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));
12808 case OPCODE_CLEARCOLOR_UI:
12809 CALL_ClearColorIuiEXT(ctx->Exec,
12810 (n[1].ui, n[2].ui, n[3].ui, n[4].ui));
12812 case OPCODE_TEXPARAMETER_I:
12815 params[0] = n[3].i;
12816 params[1] = n[4].i;
12817 params[2] = n[5].i;
12818 params[3] = n[6].i;
12819 CALL_TexParameterIiv(ctx->Exec, (n[1].e, n[2].e, params));
12822 case OPCODE_TEXPARAMETER_UI:
12825 params[0] = n[3].ui;
12826 params[1] = n[4].ui;
12827 params[2] = n[5].ui;
12828 params[3] = n[6].ui;
12829 CALL_TexParameterIuiv(ctx->Exec, (n[1].e, n[2].e, params));
12833 case OPCODE_VERTEX_ATTRIB_DIVISOR:
12834 /* GL_ARB_instanced_arrays */
12835 CALL_VertexAttribDivisor(ctx->Exec, (n[1].ui, n[2].ui));
12838 case OPCODE_TEXTURE_BARRIER_NV:
12839 CALL_TextureBarrierNV(ctx->Exec, ());
12842 /* GL_EXT/ARB_transform_feedback */
12843 case OPCODE_BEGIN_TRANSFORM_FEEDBACK:
12844 CALL_BeginTransformFeedback(ctx->Exec, (n[1].e));
12846 case OPCODE_END_TRANSFORM_FEEDBACK:
12847 CALL_EndTransformFeedback(ctx->Exec, ());
12849 case OPCODE_BIND_TRANSFORM_FEEDBACK:
12850 CALL_BindTransformFeedback(ctx->Exec, (n[1].e, n[2].ui));
12852 case OPCODE_PAUSE_TRANSFORM_FEEDBACK:
12853 CALL_PauseTransformFeedback(ctx->Exec, ());
12855 case OPCODE_RESUME_TRANSFORM_FEEDBACK:
12856 CALL_ResumeTransformFeedback(ctx->Exec, ());
12858 case OPCODE_DRAW_TRANSFORM_FEEDBACK:
12859 CALL_DrawTransformFeedback(ctx->Exec, (n[1].e, n[2].ui));
12861 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM:
12862 CALL_DrawTransformFeedbackStream(ctx->Exec,
12863 (n[1].e, n[2].ui, n[3].ui));
12865 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED:
12866 CALL_DrawTransformFeedbackInstanced(ctx->Exec,
12867 (n[1].e, n[2].ui, n[3].si));
12869 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED:
12870 CALL_DrawTransformFeedbackStreamInstanced(ctx->Exec,
12871 (n[1].e, n[2].ui, n[3].ui, n[4].si));
12875 case OPCODE_BIND_SAMPLER:
12876 CALL_BindSampler(ctx->Exec, (n[1].ui, n[2].ui));
12878 case OPCODE_SAMPLER_PARAMETERIV:
12881 params[0] = n[3].i;
12882 params[1] = n[4].i;
12883 params[2] = n[5].i;
12884 params[3] = n[6].i;
12885 CALL_SamplerParameteriv(ctx->Exec, (n[1].ui, n[2].e, params));
12888 case OPCODE_SAMPLER_PARAMETERFV:
12891 params[0] = n[3].f;
12892 params[1] = n[4].f;
12893 params[2] = n[5].f;
12894 params[3] = n[6].f;
12895 CALL_SamplerParameterfv(ctx->Exec, (n[1].ui, n[2].e, params));
12898 case OPCODE_SAMPLER_PARAMETERIIV:
12901 params[0] = n[3].i;
12902 params[1] = n[4].i;
12903 params[2] = n[5].i;
12904 params[3] = n[6].i;
12905 CALL_SamplerParameterIiv(ctx->Exec, (n[1].ui, n[2].e, params));
12908 case OPCODE_SAMPLER_PARAMETERUIV:
12911 params[0] = n[3].ui;
12912 params[1] = n[4].ui;
12913 params[2] = n[5].ui;
12914 params[3] = n[6].ui;
12915 CALL_SamplerParameterIuiv(ctx->Exec, (n[1].ui, n[2].e, params));
12919 /* ARB_compute_shader */
12920 case OPCODE_DISPATCH_COMPUTE:
12921 CALL_DispatchCompute(ctx->Exec, (n[1].ui, n[2].ui, n[3].ui));
12925 case OPCODE_WAIT_SYNC:
12927 union uint64_pair p;
12928 p.uint32[0] = n[2].ui;
12929 p.uint32[1] = n[3].ui;
12930 CALL_WaitSync(ctx->Exec,
12931 (get_pointer(&n[4]), n[1].bf, p.uint64));
12935 /* GL_NV_conditional_render */
12936 case OPCODE_BEGIN_CONDITIONAL_RENDER:
12937 CALL_BeginConditionalRender(ctx->Exec, (n[1].i, n[2].e));
12939 case OPCODE_END_CONDITIONAL_RENDER:
12940 CALL_EndConditionalRender(ctx->Exec, ());
12943 case OPCODE_UNIFORM_BLOCK_BINDING:
12944 CALL_UniformBlockBinding(ctx->Exec, (n[1].ui, n[2].ui, n[3].ui));
12947 case OPCODE_UNIFORM_SUBROUTINES:
12948 CALL_UniformSubroutinesuiv(ctx->Exec, (n[1].e, n[2].si,
12949 get_pointer(&n[3])));
12952 /* GL_EXT_window_rectangles */
12953 case OPCODE_WINDOW_RECTANGLES:
12954 CALL_WindowRectanglesEXT(
12955 ctx->Exec, (n[1].e, n[2].si, get_pointer(&n[3])));
12958 /* GL_NV_conservative_raster */
12959 case OPCODE_SUBPIXEL_PRECISION_BIAS:
12960 CALL_SubpixelPrecisionBiasNV(ctx->Exec, (n[1].ui, n[2].ui));
12963 /* GL_NV_conservative_raster_dilate */
12964 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F:
12965 CALL_ConservativeRasterParameterfNV(ctx->Exec, (n[1].e, n[2].f));
12968 /* GL_NV_conservative_raster_pre_snap_triangles */
12969 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I:
12970 CALL_ConservativeRasterParameteriNV(ctx->Exec, (n[1].e, n[2].i));
12973 /* GL_EXT_direct_state_access */
12974 case OPCODE_MATRIX_LOAD:
12975 CALL_MatrixLoadfEXT(ctx->Exec, (n[1].e, &n[2].f));
12977 case OPCODE_MATRIX_MULT:
12978 CALL_MatrixMultfEXT(ctx->Exec, (n[1].e, &n[2].f));
12980 case OPCODE_MATRIX_ROTATE:
12981 CALL_MatrixRotatefEXT(ctx->Exec, (n[1].e, n[2].f, n[3].f, n[4].f, n[5].f));
12983 case OPCODE_MATRIX_SCALE:
12984 CALL_MatrixScalefEXT(ctx->Exec, (n[1].e, n[2].f, n[3].f, n[4].f));
12986 case OPCODE_MATRIX_TRANSLATE:
12987 CALL_MatrixTranslatefEXT(ctx->Exec, (n[1].e, n[2].f, n[3].f, n[4].f));
12989 case OPCODE_MATRIX_LOAD_IDENTITY:
12990 CALL_MatrixLoadIdentityEXT(ctx->Exec, (n[1].e));
12992 case OPCODE_MATRIX_ORTHO:
12993 CALL_MatrixOrthoEXT(ctx->Exec, (n[1].e,
12994 n[2].f, n[3].f, n[4].f,
12995 n[5].f, n[6].f, n[7].f));
12997 case OPCODE_MATRIX_FRUSTUM:
12998 CALL_MatrixFrustumEXT(ctx->Exec, (n[1].e,
12999 n[2].f, n[3].f, n[4].f,
13000 n[5].f, n[6].f, n[7].f));
13002 case OPCODE_MATRIX_PUSH:
13003 CALL_MatrixPushEXT(ctx->Exec, (n[1].e));
13005 case OPCODE_MATRIX_POP:
13006 CALL_MatrixPopEXT(ctx->Exec, (n[1].e));
13008 case OPCODE_TEXTUREPARAMETER_F:
13011 params[0] = n[4].f;
13012 params[1] = n[5].f;
13013 params[2] = n[6].f;
13014 params[3] = n[7].f;
13015 CALL_TextureParameterfvEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].e, params));
13018 case OPCODE_TEXTUREPARAMETER_I:
13021 params[0] = n[4].i;
13022 params[1] = n[5].i;
13023 params[2] = n[6].i;
13024 params[3] = n[7].i;
13025 CALL_TextureParameterivEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].e, params));
13028 case OPCODE_TEXTUREPARAMETER_II:
13031 params[0] = n[4].i;
13032 params[1] = n[5].i;
13033 params[2] = n[6].i;
13034 params[3] = n[7].i;
13035 CALL_TextureParameterIivEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].e, params));
13038 case OPCODE_TEXTUREPARAMETER_IUI:
13041 params[0] = n[4].ui;
13042 params[1] = n[5].ui;
13043 params[2] = n[6].ui;
13044 params[3] = n[7].ui;
13045 CALL_TextureParameterIuivEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].e, params));
13048 case OPCODE_TEXTURE_IMAGE1D:
13050 const struct gl_pixelstore_attrib save = ctx->Unpack;
13051 ctx->Unpack = ctx->DefaultPacking;
13052 CALL_TextureImage1DEXT(ctx->Exec, (n[1].ui, /* texture */
13053 n[2].e, /* target */
13054 n[3].i, /* level */
13055 n[4].i, /* components */
13056 n[5].i, /* width */
13057 n[6].e, /* border */
13058 n[7].e, /* format */
13060 get_pointer(&n[9])));
13061 ctx->Unpack = save; /* restore */
13064 case OPCODE_TEXTURE_IMAGE2D:
13066 const struct gl_pixelstore_attrib save = ctx->Unpack;
13067 ctx->Unpack = ctx->DefaultPacking;
13068 CALL_TextureImage2DEXT(ctx->Exec, (n[1].ui, /* texture */
13069 n[2].e, /* target */
13070 n[3].i, /* level */
13071 n[4].i, /* components */
13072 n[5].i, /* width */
13073 n[6].i, /* height */
13074 n[7].e, /* border */
13075 n[8].e, /* format */
13077 get_pointer(&n[10])));
13078 ctx->Unpack = save; /* restore */
13081 case OPCODE_TEXTURE_IMAGE3D:
13083 const struct gl_pixelstore_attrib save = ctx->Unpack;
13084 ctx->Unpack = ctx->DefaultPacking;
13085 CALL_TextureImage3DEXT(ctx->Exec, (n[1].ui, /* texture */
13086 n[2].e, /* target */
13087 n[3].i, /* level */
13088 n[4].i, /* components */
13089 n[5].i, /* width */
13090 n[6].i, /* height */
13091 n[7].i, /* depth */
13092 n[8].e, /* border */
13093 n[9].e, /* format */
13094 n[10].e, /* type */
13095 get_pointer(&n[11])));
13096 ctx->Unpack = save; /* restore */
13099 case OPCODE_TEXTURE_SUB_IMAGE1D:
13101 const struct gl_pixelstore_attrib save = ctx->Unpack;
13102 ctx->Unpack = ctx->DefaultPacking;
13103 CALL_TextureSubImage1DEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].i,
13104 n[4].i, n[5].i, n[6].e,
13105 n[7].e, get_pointer(&n[8])));
13106 ctx->Unpack = save; /* restore */
13109 case OPCODE_TEXTURE_SUB_IMAGE2D:
13111 const struct gl_pixelstore_attrib save = ctx->Unpack;
13112 ctx->Unpack = ctx->DefaultPacking;
13113 CALL_TextureSubImage2DEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].i,
13114 n[4].i, n[5].i, n[6].e,
13115 n[7].i, n[8].e, n[9].e,
13116 get_pointer(&n[10])));
13117 ctx->Unpack = save;
13120 case OPCODE_TEXTURE_SUB_IMAGE3D:
13122 const struct gl_pixelstore_attrib save = ctx->Unpack;
13123 ctx->Unpack = ctx->DefaultPacking;
13124 CALL_TextureSubImage3DEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].i,
13125 n[4].i, n[5].i, n[6].i,
13126 n[7].i, n[8].i, n[9].i,
13128 get_pointer(&n[12])));
13129 ctx->Unpack = save; /* restore */
13132 case OPCODE_COPY_TEXTURE_IMAGE1D:
13133 CALL_CopyTextureImage1DEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].i,
13134 n[4].e, n[5].i, n[6].i,
13137 case OPCODE_COPY_TEXTURE_IMAGE2D:
13138 CALL_CopyTextureImage2DEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].i,
13139 n[4].e, n[5].i, n[6].i,
13140 n[7].i, n[8].i, n[9].i));
13142 case OPCODE_COPY_TEXTURE_SUB_IMAGE1D:
13143 CALL_CopyTextureSubImage1DEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].i,
13144 n[4].i, n[5].i, n[6].i,
13147 case OPCODE_COPY_TEXTURE_SUB_IMAGE2D:
13148 CALL_CopyTextureSubImage2DEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].i,
13149 n[4].i, n[5].i, n[6].i,
13150 n[7].i, n[8].i, n[9].i));
13152 case OPCODE_COPY_TEXTURE_SUB_IMAGE3D:
13153 CALL_CopyTextureSubImage3DEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].i,
13154 n[4].i, n[5].i, n[6].i,
13155 n[7].i, n[8].i, n[9].i,
13158 case OPCODE_BIND_MULTITEXTURE:
13159 CALL_BindMultiTextureEXT(ctx->Exec, (n[1].e, n[2].e, n[3].ui));
13161 case OPCODE_MULTITEXPARAMETER_F:
13164 params[0] = n[4].f;
13165 params[1] = n[5].f;
13166 params[2] = n[6].f;
13167 params[3] = n[7].f;
13168 CALL_MultiTexParameterfvEXT(ctx->Exec, (n[1].e, n[2].e, n[3].e, params));
13171 case OPCODE_MULTITEXPARAMETER_I:
13174 params[0] = n[4].i;
13175 params[1] = n[5].i;
13176 params[2] = n[6].i;
13177 params[3] = n[7].i;
13178 CALL_MultiTexParameterivEXT(ctx->Exec, (n[1].e, n[2].e, n[3].e, params));
13181 case OPCODE_MULTITEXPARAMETER_II:
13184 params[0] = n[4].i;
13185 params[1] = n[5].i;
13186 params[2] = n[6].i;
13187 params[3] = n[7].i;
13188 CALL_MultiTexParameterIivEXT(ctx->Exec, (n[1].e, n[2].e, n[3].e, params));
13191 case OPCODE_MULTITEXPARAMETER_IUI:
13194 params[0] = n[4].ui;
13195 params[1] = n[5].ui;
13196 params[2] = n[6].ui;
13197 params[3] = n[7].ui;
13198 CALL_MultiTexParameterIuivEXT(ctx->Exec, (n[1].e, n[2].e, n[3].e, params));
13201 case OPCODE_MULTITEX_IMAGE1D:
13203 const struct gl_pixelstore_attrib save = ctx->Unpack;
13204 ctx->Unpack = ctx->DefaultPacking;
13205 CALL_MultiTexImage1DEXT(ctx->Exec, (n[1].e, /* texture */
13206 n[2].e, /* target */
13207 n[3].i, /* level */
13208 n[4].i, /* components */
13209 n[5].i, /* width */
13210 n[6].e, /* border */
13211 n[7].e, /* format */
13213 get_pointer(&n[9])));
13214 ctx->Unpack = save; /* restore */
13217 case OPCODE_MULTITEX_IMAGE2D:
13219 const struct gl_pixelstore_attrib save = ctx->Unpack;
13220 ctx->Unpack = ctx->DefaultPacking;
13221 CALL_MultiTexImage2DEXT(ctx->Exec, (n[1].e, /* texture */
13222 n[2].e, /* target */
13223 n[3].i, /* level */
13224 n[4].i, /* components */
13225 n[5].i, /* width */
13226 n[6].i, /* height */
13227 n[7].e, /* border */
13228 n[8].e, /* format */
13230 get_pointer(&n[10])));
13231 ctx->Unpack = save; /* restore */
13234 case OPCODE_MULTITEX_IMAGE3D:
13236 const struct gl_pixelstore_attrib save = ctx->Unpack;
13237 ctx->Unpack = ctx->DefaultPacking;
13238 CALL_MultiTexImage3DEXT(ctx->Exec, (n[1].e, /* texture */
13239 n[2].e, /* target */
13240 n[3].i, /* level */
13241 n[4].i, /* components */
13242 n[5].i, /* width */
13243 n[6].i, /* height */
13244 n[7].i, /* depth */
13245 n[8].e, /* border */
13246 n[9].e, /* format */
13247 n[10].e, /* type */
13248 get_pointer(&n[11])));
13249 ctx->Unpack = save; /* restore */
13252 case OPCODE_MULTITEX_SUB_IMAGE1D:
13254 const struct gl_pixelstore_attrib save = ctx->Unpack;
13255 ctx->Unpack = ctx->DefaultPacking;
13256 CALL_MultiTexSubImage1DEXT(ctx->Exec, (n[1].e, n[2].e, n[3].i,
13257 n[4].i, n[5].i, n[6].e,
13258 n[7].e, get_pointer(&n[8])));
13259 ctx->Unpack = save; /* restore */
13262 case OPCODE_MULTITEX_SUB_IMAGE2D:
13264 const struct gl_pixelstore_attrib save = ctx->Unpack;
13265 ctx->Unpack = ctx->DefaultPacking;
13266 CALL_MultiTexSubImage2DEXT(ctx->Exec, (n[1].e, n[2].e, n[3].i,
13267 n[4].i, n[5].i, n[6].e,
13268 n[7].i, n[8].e, n[9].e,
13269 get_pointer(&n[10])));
13270 ctx->Unpack = save; /* restore */
13273 case OPCODE_MULTITEX_SUB_IMAGE3D:
13275 const struct gl_pixelstore_attrib save = ctx->Unpack;
13276 ctx->Unpack = ctx->DefaultPacking;
13277 CALL_MultiTexSubImage3DEXT(ctx->Exec, (n[1].e, n[2].e, n[3].i,
13278 n[4].i, n[5].i, n[6].i,
13279 n[7].i, n[8].i, n[9].i,
13281 get_pointer(&n[12])));
13282 ctx->Unpack = save; /* restore */
13285 case OPCODE_COPY_MULTITEX_IMAGE1D:
13286 CALL_CopyMultiTexImage1DEXT(ctx->Exec, (n[1].e, n[2].e, n[3].i,
13287 n[4].e, n[5].i, n[6].i,
13290 case OPCODE_COPY_MULTITEX_IMAGE2D:
13291 CALL_CopyMultiTexImage2DEXT(ctx->Exec, (n[1].e, n[2].e, n[3].i,
13292 n[4].e, n[5].i, n[6].i,
13293 n[7].i, n[8].i, n[9].i));
13295 case OPCODE_COPY_MULTITEX_SUB_IMAGE1D:
13296 CALL_CopyMultiTexSubImage1DEXT(ctx->Exec, (n[1].e, n[2].e, n[3].i,
13297 n[4].i, n[5].i, n[6].i,
13300 case OPCODE_COPY_MULTITEX_SUB_IMAGE2D:
13301 CALL_CopyMultiTexSubImage2DEXT(ctx->Exec, (n[1].e, n[2].e, n[3].i,
13302 n[4].i, n[5].i, n[6].i,
13303 n[7].i, n[8].i, n[9].i));
13305 case OPCODE_COPY_MULTITEX_SUB_IMAGE3D:
13306 CALL_CopyMultiTexSubImage3DEXT(ctx->Exec, (n[1].e, n[2].e, n[3].i,
13307 n[4].i, n[5].i, n[6].i,
13308 n[7].i, n[8].i, n[9].i,
13311 case OPCODE_MULTITEXENV:
13314 params[0] = n[4].f;
13315 params[1] = n[5].f;
13316 params[2] = n[6].f;
13317 params[3] = n[7].f;
13318 CALL_MultiTexEnvfvEXT(ctx->Exec, (n[1].e, n[2].e, n[3].e, params));
13321 case OPCODE_COMPRESSED_TEXTURE_IMAGE_1D:
13322 CALL_CompressedTextureImage1DEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].i,
13323 n[4].e, n[5].i, n[6].i,
13324 n[7].i, get_pointer(&n[8])));
13326 case OPCODE_COMPRESSED_TEXTURE_IMAGE_2D:
13327 CALL_CompressedTextureImage2DEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].i,
13328 n[4].e, n[5].i, n[6].i,
13330 get_pointer(&n[9])));
13332 case OPCODE_COMPRESSED_TEXTURE_IMAGE_3D:
13333 CALL_CompressedTextureImage3DEXT(ctx->Exec, (n[1].ui, n[2].e, n[3].i,
13334 n[4].e, n[5].i, n[6].i,
13335 n[7].i, n[8].i, n[9].i,
13336 get_pointer(&n[10])));
13338 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D:
13339 CALL_CompressedTextureSubImage1DEXT(ctx->Exec,
13340 (n[1].ui, n[2].e, n[3].i, n[4].i,
13341 n[5].i, n[6].e, n[7].i,
13342 get_pointer(&n[8])));
13344 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D:
13345 CALL_CompressedTextureSubImage2DEXT(ctx->Exec,
13346 (n[1].ui, n[2].e, n[3].i, n[4].i,
13347 n[5].i, n[6].i, n[7].i, n[8].e,
13348 n[9].i, get_pointer(&n[10])));
13350 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D:
13351 CALL_CompressedTextureSubImage3DEXT(ctx->Exec,
13352 (n[1].ui, n[2].e, n[3].i, n[4].i,
13353 n[5].i, n[6].i, n[7].i, n[8].i,
13354 n[9].i, n[10].e, n[11].i,
13355 get_pointer(&n[12])));
13357 case OPCODE_COMPRESSED_MULTITEX_IMAGE_1D:
13358 CALL_CompressedMultiTexImage1DEXT(ctx->Exec, (n[1].e, n[2].e, n[3].i,
13359 n[4].e, n[5].i, n[6].i,
13360 n[7].i, get_pointer(&n[8])));
13362 case OPCODE_COMPRESSED_MULTITEX_IMAGE_2D:
13363 CALL_CompressedMultiTexImage2DEXT(ctx->Exec, (n[1].e, n[2].e, n[3].i,
13364 n[4].e, n[5].i, n[6].i,
13366 get_pointer(&n[9])));
13368 case OPCODE_COMPRESSED_MULTITEX_IMAGE_3D:
13369 CALL_CompressedMultiTexImage3DEXT(ctx->Exec, (n[1].e, n[2].e, n[3].i,
13370 n[4].e, n[5].i, n[6].i,
13371 n[7].i, n[8].i, n[9].i,
13372 get_pointer(&n[10])));
13374 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D:
13375 CALL_CompressedMultiTexSubImage1DEXT(ctx->Exec,
13376 (n[1].e, n[2].e, n[3].i, n[4].i,
13377 n[5].i, n[6].e, n[7].i,
13378 get_pointer(&n[8])));
13380 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D:
13381 CALL_CompressedMultiTexSubImage2DEXT(ctx->Exec,
13382 (n[1].e, n[2].e, n[3].i, n[4].i,
13383 n[5].i, n[6].i, n[7].i, n[8].e,
13384 n[9].i, get_pointer(&n[10])));
13386 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D:
13387 CALL_CompressedMultiTexSubImage3DEXT(ctx->Exec,
13388 (n[1].e, n[2].e, n[3].i, n[4].i,
13389 n[5].i, n[6].i, n[7].i, n[8].i,
13390 n[9].i, n[10].e, n[11].i,
13391 get_pointer(&n[12])));
13393 case OPCODE_NAMED_PROGRAM_STRING:
13394 CALL_NamedProgramStringEXT(ctx->Exec,
13395 (n[1].ui, n[2].e, n[3].e, n[4].i,
13396 get_pointer(&n[5])));
13398 case OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER:
13399 CALL_NamedProgramLocalParameter4fEXT(ctx->Exec,
13400 (n[1].ui, n[2].e, n[3].ui, n[4].f,
13401 n[5].f, n[6].f, n[7].f));
13404 case OPCODE_VERTEX_LIST:
13405 vbo_save_playback_vertex_list(ctx, &n[1]);
13408 case OPCODE_CONTINUE:
13409 n = (Node *) get_pointer(&n[1]);
13417 snprintf(msg, sizeof(msg), "Error in execute_list: opcode=%d",
13419 _mesa_problem(ctx, "%s", msg);
13422 case OPCODE_END_OF_LIST:
13423 vbo_save_EndCallList(ctx);
13424 ctx->ListState.CallDepth--;
13428 /* increment n to point to next compiled command */
13429 assert(n[0].InstSize > 0);
13430 n += n[0].InstSize;
13436 /**********************************************************************/
13438 /**********************************************************************/
13441 * Test if a display list number is valid.
13443 GLboolean GLAPIENTRY
13444 _mesa_IsList(GLuint list)
13446 GET_CURRENT_CONTEXT(ctx);
13447 FLUSH_VERTICES(ctx, 0, 0); /* must be called before assert */
13448 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
13449 return _mesa_get_list(ctx, list, NULL, false);
13454 * Delete a sequence of consecutive display lists.
13457 _mesa_DeleteLists(GLuint list, GLsizei range)
13459 GET_CURRENT_CONTEXT(ctx);
13461 FLUSH_VERTICES(ctx, 0, 0); /* must be called before assert */
13462 ASSERT_OUTSIDE_BEGIN_END(ctx);
13465 _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteLists");
13470 /* We may be deleting a set of bitmap lists. See if there's a
13471 * bitmap atlas to free.
13473 struct gl_bitmap_atlas *atlas = lookup_bitmap_atlas(ctx, list);
13475 _mesa_delete_bitmap_atlas(ctx, atlas);
13476 _mesa_HashRemove(ctx->Shared->BitmapAtlas, list);
13480 for (i = list; i < list + range; i++) {
13481 destroy_list(ctx, i);
13487 * Return a display list number, n, such that lists n through n+range-1
13491 _mesa_GenLists(GLsizei range)
13493 GET_CURRENT_CONTEXT(ctx);
13495 FLUSH_VERTICES(ctx, 0, 0); /* must be called before assert */
13496 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
13499 _mesa_error(ctx, GL_INVALID_VALUE, "glGenLists");
13507 * Make this an atomic operation
13509 _mesa_HashLockMutex(ctx->Shared->DisplayList);
13511 base = _mesa_HashFindFreeKeyBlock(ctx->Shared->DisplayList, range);
13513 /* reserve the list IDs by with empty/dummy lists */
13515 for (i = 0; i < range; i++) {
13516 _mesa_HashInsertLocked(ctx->Shared->DisplayList, base + i,
13517 make_list(base + i, 1), true);
13521 if (USE_BITMAP_ATLAS &&
13523 ctx->Driver.DrawAtlasBitmaps) {
13524 /* "range > 16" is a rough heuristic to guess when glGenLists might be
13525 * used to allocate display lists for glXUseXFont or wglUseFontBitmaps.
13526 * Create the empty atlas now.
13528 struct gl_bitmap_atlas *atlas = lookup_bitmap_atlas(ctx, base);
13530 atlas = alloc_bitmap_atlas(ctx, base, true);
13533 /* Atlas _should_ be new/empty now, but clobbering is OK */
13534 assert(atlas->numBitmaps == 0);
13535 atlas->numBitmaps = range;
13539 _mesa_HashUnlockMutex(ctx->Shared->DisplayList);
13546 * Begin a new display list.
13549 _mesa_NewList(GLuint name, GLenum mode)
13551 GET_CURRENT_CONTEXT(ctx);
13553 FLUSH_CURRENT(ctx, 0); /* must be called before assert */
13554 ASSERT_OUTSIDE_BEGIN_END(ctx);
13556 if (MESA_VERBOSE & VERBOSE_API)
13557 _mesa_debug(ctx, "glNewList %u %s\n", name,
13558 _mesa_enum_to_string(mode));
13561 _mesa_error(ctx, GL_INVALID_VALUE, "glNewList");
13565 if (mode != GL_COMPILE && mode != GL_COMPILE_AND_EXECUTE) {
13566 _mesa_error(ctx, GL_INVALID_ENUM, "glNewList");
13570 if (ctx->ListState.CurrentList) {
13571 /* already compiling a display list */
13572 _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList");
13576 ctx->CompileFlag = GL_TRUE;
13577 ctx->ExecuteFlag = (mode == GL_COMPILE_AND_EXECUTE);
13579 /* Reset accumulated list state */
13580 invalidate_saved_current_state( ctx );
13582 /* Allocate new display list */
13583 ctx->ListState.CurrentList = make_list(name, BLOCK_SIZE);
13584 ctx->ListState.CurrentBlock = ctx->ListState.CurrentList->Head;
13585 ctx->ListState.CurrentPos = 0;
13587 vbo_save_NewList(ctx, name, mode);
13589 ctx->CurrentServerDispatch = ctx->Save;
13590 _glapi_set_dispatch(ctx->CurrentServerDispatch);
13591 if (ctx->MarshalExec == NULL) {
13592 ctx->CurrentClientDispatch = ctx->CurrentServerDispatch;
13598 * End definition of current display list.
13601 _mesa_EndList(void)
13603 GET_CURRENT_CONTEXT(ctx);
13604 SAVE_FLUSH_VERTICES(ctx);
13605 FLUSH_VERTICES(ctx, 0, 0);
13607 if (MESA_VERBOSE & VERBOSE_API)
13608 _mesa_debug(ctx, "glEndList\n");
13610 if (ctx->ExecuteFlag && _mesa_inside_dlist_begin_end(ctx)) {
13611 _mesa_error(ctx, GL_INVALID_OPERATION,
13612 "glEndList() called inside glBegin/End");
13615 /* Check that a list is under construction */
13616 if (!ctx->ListState.CurrentList) {
13617 _mesa_error(ctx, GL_INVALID_OPERATION, "glEndList");
13621 /* Call before emitting END_OF_LIST, in case the driver wants to
13622 * emit opcodes itself.
13624 vbo_save_EndList(ctx);
13626 (void) alloc_instruction(ctx, OPCODE_END_OF_LIST, 0);
13630 /* Destroy old list, if any */
13631 destroy_list(ctx, ctx->ListState.CurrentList->Name);
13633 /* Install the new list */
13634 _mesa_HashInsert(ctx->Shared->DisplayList,
13635 ctx->ListState.CurrentList->Name,
13636 ctx->ListState.CurrentList, true);
13639 if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
13640 mesa_print_display_list(ctx->ListState.CurrentList->Name);
13642 ctx->ListState.CurrentList = NULL;
13643 ctx->ListState.CurrentBlock = NULL;
13644 ctx->ListState.CurrentPos = 0;
13645 ctx->ExecuteFlag = GL_TRUE;
13646 ctx->CompileFlag = GL_FALSE;
13648 ctx->CurrentServerDispatch = ctx->Exec;
13649 _glapi_set_dispatch(ctx->CurrentServerDispatch);
13650 if (ctx->MarshalExec == NULL) {
13651 ctx->CurrentClientDispatch = ctx->CurrentServerDispatch;
13657 _mesa_CallList(GLuint list)
13659 GLboolean save_compile_flag;
13660 GET_CURRENT_CONTEXT(ctx);
13661 FLUSH_CURRENT(ctx, 0);
13663 if (MESA_VERBOSE & VERBOSE_API)
13664 _mesa_debug(ctx, "glCallList %d\n", list);
13667 _mesa_error(ctx, GL_INVALID_VALUE, "glCallList(list==0)");
13672 mesa_print_display_list( list );
13674 /* Save the CompileFlag status, turn it off, execute the display list,
13675 * and restore the CompileFlag. This is needed for GL_COMPILE_AND_EXECUTE
13676 * because the call is already recorded and we just need to execute it.
13678 save_compile_flag = ctx->CompileFlag;
13679 if (save_compile_flag) {
13680 ctx->CompileFlag = GL_FALSE;
13683 _mesa_HashLockMutex(ctx->Shared->DisplayList);
13684 execute_list(ctx, list);
13685 _mesa_HashUnlockMutex(ctx->Shared->DisplayList);
13686 ctx->CompileFlag = save_compile_flag;
13688 /* also restore API function pointers to point to "save" versions */
13689 if (save_compile_flag) {
13690 ctx->CurrentServerDispatch = ctx->Save;
13691 _glapi_set_dispatch(ctx->CurrentServerDispatch);
13692 if (ctx->MarshalExec == NULL) {
13693 ctx->CurrentClientDispatch = ctx->CurrentServerDispatch;
13700 * Try to execute a glCallLists() command where the display lists contain
13701 * glBitmap commands with a texture atlas.
13702 * \return true for success, false otherwise
13705 render_bitmap_atlas(struct gl_context *ctx, GLsizei n, GLenum type,
13708 struct gl_bitmap_atlas *atlas;
13711 if (!USE_BITMAP_ATLAS ||
13712 !ctx->Current.RasterPosValid ||
13713 ctx->List.ListBase == 0 ||
13714 type != GL_UNSIGNED_BYTE ||
13715 !ctx->Driver.DrawAtlasBitmaps) {
13720 atlas = lookup_bitmap_atlas(ctx, ctx->List.ListBase);
13723 /* Even if glGenLists wasn't called, we can still try to create
13726 atlas = alloc_bitmap_atlas(ctx, ctx->List.ListBase, false);
13729 if (atlas && !atlas->complete && !atlas->incomplete) {
13730 /* Try to build the bitmap atlas now.
13731 * If the atlas was created in glGenLists, we'll have recorded the
13732 * number of lists (bitmaps). Otherwise, take a guess at 256.
13734 if (atlas->numBitmaps == 0)
13735 atlas->numBitmaps = 256;
13736 build_bitmap_atlas(ctx, atlas, ctx->List.ListBase);
13739 if (!atlas || !atlas->complete) {
13743 /* check that all display list IDs are in the atlas */
13744 for (i = 0; i < n; i++) {
13745 const GLubyte *ids = (const GLubyte *) lists;
13747 if (ids[i] >= atlas->numBitmaps) {
13752 ctx->Driver.DrawAtlasBitmaps(ctx, atlas, n, (const GLubyte *) lists);
13759 * Execute glCallLists: call multiple display lists.
13762 _mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists)
13764 GET_CURRENT_CONTEXT(ctx);
13765 GLboolean save_compile_flag;
13767 if (MESA_VERBOSE & VERBOSE_API)
13768 _mesa_debug(ctx, "glCallLists %d\n", n);
13770 if (type < GL_BYTE || type > GL_4_BYTES) {
13771 _mesa_error(ctx, GL_INVALID_ENUM, "glCallLists(type)");
13776 _mesa_error(ctx, GL_INVALID_VALUE, "glCallLists(n < 0)");
13778 } else if (n == 0 || lists == NULL) {
13779 /* nothing to do */
13783 if (render_bitmap_atlas(ctx, n, type, lists)) {
13787 /* Save the CompileFlag status, turn it off, execute the display lists,
13788 * and restore the CompileFlag. This is needed for GL_COMPILE_AND_EXECUTE
13789 * because the call is already recorded and we just need to execute it.
13791 save_compile_flag = ctx->CompileFlag;
13792 ctx->CompileFlag = GL_FALSE;
13802 GLuint base = ctx->List.ListBase;
13804 _mesa_HashLockMutex(ctx->Shared->DisplayList);
13806 /* A loop inside a switch is faster than a switch inside a loop. */
13809 bptr = (GLbyte *) lists;
13810 for (unsigned i = 0; i < n; i++)
13811 execute_list(ctx, base + (int)bptr[i]);
13813 case GL_UNSIGNED_BYTE:
13814 ubptr = (GLubyte *) lists;
13815 for (unsigned i = 0; i < n; i++)
13816 execute_list(ctx, base + (int)ubptr[i]);
13819 sptr = (GLshort *) lists;
13820 for (unsigned i = 0; i < n; i++)
13821 execute_list(ctx, base + (int)sptr[i]);
13823 case GL_UNSIGNED_SHORT:
13824 usptr = (GLushort *) lists;
13825 for (unsigned i = 0; i < n; i++)
13826 execute_list(ctx, base + (int)usptr[i]);
13829 iptr = (GLint *) lists;
13830 for (unsigned i = 0; i < n; i++)
13831 execute_list(ctx, base + (int)iptr[i]);
13833 case GL_UNSIGNED_INT:
13834 uiptr = (GLuint *) lists;
13835 for (unsigned i = 0; i < n; i++)
13836 execute_list(ctx, base + (int)uiptr[i]);
13839 fptr = (GLfloat *) lists;
13840 for (unsigned i = 0; i < n; i++)
13841 execute_list(ctx, base + (int)fptr[i]);
13844 ubptr = (GLubyte *) lists;
13845 for (unsigned i = 0; i < n; i++) {
13846 execute_list(ctx, base +
13847 (int)ubptr[2 * i] * 256 +
13848 (int)ubptr[2 * i + 1]);
13852 ubptr = (GLubyte *) lists;
13853 for (unsigned i = 0; i < n; i++) {
13854 execute_list(ctx, base +
13855 (int)ubptr[3 * i] * 65536 +
13856 (int)ubptr[3 * i + 1] * 256 +
13857 (int)ubptr[3 * i + 2]);
13861 ubptr = (GLubyte *) lists;
13862 for (unsigned i = 0; i < n; i++) {
13863 execute_list(ctx, base +
13864 (int)ubptr[4 * i] * 16777216 +
13865 (int)ubptr[4 * i + 1] * 65536 +
13866 (int)ubptr[4 * i + 2] * 256 +
13867 (int)ubptr[4 * i + 3]);
13872 _mesa_HashUnlockMutex(ctx->Shared->DisplayList);
13873 ctx->CompileFlag = save_compile_flag;
13875 /* also restore API function pointers to point to "save" versions */
13876 if (save_compile_flag) {
13877 ctx->CurrentServerDispatch = ctx->Save;
13878 _glapi_set_dispatch(ctx->CurrentServerDispatch);
13879 if (ctx->MarshalExec == NULL) {
13880 ctx->CurrentClientDispatch = ctx->CurrentServerDispatch;
13887 * Set the offset added to list numbers in glCallLists.
13890 _mesa_ListBase(GLuint base)
13892 GET_CURRENT_CONTEXT(ctx);
13893 FLUSH_VERTICES(ctx, 0, GL_LIST_BIT); /* must be called before assert */
13894 ASSERT_OUTSIDE_BEGIN_END(ctx);
13895 ctx->List.ListBase = base;
13899 * Setup the given dispatch table to point to Mesa's display list
13900 * building functions.
13902 * This does not include any of the tnl functions - they are
13903 * initialized from _mesa_init_api_defaults and from the active vtxfmt
13907 _mesa_initialize_save_table(const struct gl_context *ctx)
13909 struct _glapi_table *table = ctx->Save;
13910 int numEntries = MAX2(_gloffset_COUNT, _glapi_get_dispatch_table_size());
13912 /* Initially populate the dispatch table with the contents of the
13913 * normal-execution dispatch table. This lets us skip populating functions
13914 * that should be called directly instead of compiled into display lists.
13916 memcpy(table, ctx->Exec, numEntries * sizeof(_glapi_proc));
13918 /* VBO functions */
13919 vbo_initialize_save_dispatch(ctx, table);
13922 SET_Accum(table, save_Accum);
13923 SET_AlphaFunc(table, save_AlphaFunc);
13924 SET_Bitmap(table, save_Bitmap);
13925 SET_BlendFunc(table, save_BlendFunc);
13926 SET_CallList(table, save_CallList);
13927 SET_CallLists(table, save_CallLists);
13928 SET_Clear(table, save_Clear);
13929 SET_ClearAccum(table, save_ClearAccum);
13930 SET_ClearColor(table, save_ClearColor);
13931 SET_ClearDepth(table, save_ClearDepth);
13932 SET_ClearIndex(table, save_ClearIndex);
13933 SET_ClearStencil(table, save_ClearStencil);
13934 SET_ClipPlane(table, save_ClipPlane);
13935 SET_ColorMask(table, save_ColorMask);
13936 SET_ColorMaski(table, save_ColorMaskIndexed);
13937 SET_ColorMaterial(table, save_ColorMaterial);
13938 SET_CopyPixels(table, save_CopyPixels);
13939 SET_CullFace(table, save_CullFace);
13940 SET_DepthFunc(table, save_DepthFunc);
13941 SET_DepthMask(table, save_DepthMask);
13942 SET_DepthRange(table, save_DepthRange);
13943 SET_Disable(table, save_Disable);
13944 SET_Disablei(table, save_DisableIndexed);
13945 SET_DrawBuffer(table, save_DrawBuffer);
13946 SET_DrawPixels(table, save_DrawPixels);
13947 SET_Enable(table, save_Enable);
13948 SET_Enablei(table, save_EnableIndexed);
13949 SET_EvalMesh1(table, save_EvalMesh1);
13950 SET_EvalMesh2(table, save_EvalMesh2);
13951 SET_Fogf(table, save_Fogf);
13952 SET_Fogfv(table, save_Fogfv);
13953 SET_Fogi(table, save_Fogi);
13954 SET_Fogiv(table, save_Fogiv);
13955 SET_FrontFace(table, save_FrontFace);
13956 SET_Frustum(table, save_Frustum);
13957 SET_Hint(table, save_Hint);
13958 SET_IndexMask(table, save_IndexMask);
13959 SET_InitNames(table, save_InitNames);
13960 SET_LightModelf(table, save_LightModelf);
13961 SET_LightModelfv(table, save_LightModelfv);
13962 SET_LightModeli(table, save_LightModeli);
13963 SET_LightModeliv(table, save_LightModeliv);
13964 SET_Lightf(table, save_Lightf);
13965 SET_Lightfv(table, save_Lightfv);
13966 SET_Lighti(table, save_Lighti);
13967 SET_Lightiv(table, save_Lightiv);
13968 SET_LineStipple(table, save_LineStipple);
13969 SET_LineWidth(table, save_LineWidth);
13970 SET_ListBase(table, save_ListBase);
13971 SET_LoadIdentity(table, save_LoadIdentity);
13972 SET_LoadMatrixd(table, save_LoadMatrixd);
13973 SET_LoadMatrixf(table, save_LoadMatrixf);
13974 SET_LoadName(table, save_LoadName);
13975 SET_LogicOp(table, save_LogicOp);
13976 SET_Map1d(table, save_Map1d);
13977 SET_Map1f(table, save_Map1f);
13978 SET_Map2d(table, save_Map2d);
13979 SET_Map2f(table, save_Map2f);
13980 SET_MapGrid1d(table, save_MapGrid1d);
13981 SET_MapGrid1f(table, save_MapGrid1f);
13982 SET_MapGrid2d(table, save_MapGrid2d);
13983 SET_MapGrid2f(table, save_MapGrid2f);
13984 SET_MatrixMode(table, save_MatrixMode);
13985 SET_MultMatrixd(table, save_MultMatrixd);
13986 SET_MultMatrixf(table, save_MultMatrixf);
13987 SET_NewList(table, save_NewList);
13988 SET_Ortho(table, save_Ortho);
13989 SET_PassThrough(table, save_PassThrough);
13990 SET_PixelMapfv(table, save_PixelMapfv);
13991 SET_PixelMapuiv(table, save_PixelMapuiv);
13992 SET_PixelMapusv(table, save_PixelMapusv);
13993 SET_PixelTransferf(table, save_PixelTransferf);
13994 SET_PixelTransferi(table, save_PixelTransferi);
13995 SET_PixelZoom(table, save_PixelZoom);
13996 SET_PointSize(table, save_PointSize);
13997 SET_PolygonMode(table, save_PolygonMode);
13998 SET_PolygonOffset(table, save_PolygonOffset);
13999 SET_PolygonStipple(table, save_PolygonStipple);
14000 SET_PopAttrib(table, save_PopAttrib);
14001 SET_PopMatrix(table, save_PopMatrix);
14002 SET_PopName(table, save_PopName);
14003 SET_PushAttrib(table, save_PushAttrib);
14004 SET_PushMatrix(table, save_PushMatrix);
14005 SET_PushName(table, save_PushName);
14006 SET_RasterPos2d(table, save_RasterPos2d);
14007 SET_RasterPos2dv(table, save_RasterPos2dv);
14008 SET_RasterPos2f(table, save_RasterPos2f);
14009 SET_RasterPos2fv(table, save_RasterPos2fv);
14010 SET_RasterPos2i(table, save_RasterPos2i);
14011 SET_RasterPos2iv(table, save_RasterPos2iv);
14012 SET_RasterPos2s(table, save_RasterPos2s);
14013 SET_RasterPos2sv(table, save_RasterPos2sv);
14014 SET_RasterPos3d(table, save_RasterPos3d);
14015 SET_RasterPos3dv(table, save_RasterPos3dv);
14016 SET_RasterPos3f(table, save_RasterPos3f);
14017 SET_RasterPos3fv(table, save_RasterPos3fv);
14018 SET_RasterPos3i(table, save_RasterPos3i);
14019 SET_RasterPos3iv(table, save_RasterPos3iv);
14020 SET_RasterPos3s(table, save_RasterPos3s);
14021 SET_RasterPos3sv(table, save_RasterPos3sv);
14022 SET_RasterPos4d(table, save_RasterPos4d);
14023 SET_RasterPos4dv(table, save_RasterPos4dv);
14024 SET_RasterPos4f(table, save_RasterPos4f);
14025 SET_RasterPos4fv(table, save_RasterPos4fv);
14026 SET_RasterPos4i(table, save_RasterPos4i);
14027 SET_RasterPos4iv(table, save_RasterPos4iv);
14028 SET_RasterPos4s(table, save_RasterPos4s);
14029 SET_RasterPos4sv(table, save_RasterPos4sv);
14030 SET_ReadBuffer(table, save_ReadBuffer);
14031 SET_Rotated(table, save_Rotated);
14032 SET_Rotatef(table, save_Rotatef);
14033 SET_Scaled(table, save_Scaled);
14034 SET_Scalef(table, save_Scalef);
14035 SET_Scissor(table, save_Scissor);
14036 SET_ShadeModel(table, save_ShadeModel);
14037 SET_StencilFunc(table, save_StencilFunc);
14038 SET_StencilMask(table, save_StencilMask);
14039 SET_StencilOp(table, save_StencilOp);
14040 SET_TexEnvf(table, save_TexEnvf);
14041 SET_TexEnvfv(table, save_TexEnvfv);
14042 SET_TexEnvi(table, save_TexEnvi);
14043 SET_TexEnviv(table, save_TexEnviv);
14044 SET_TexGend(table, save_TexGend);
14045 SET_TexGendv(table, save_TexGendv);
14046 SET_TexGenf(table, save_TexGenf);
14047 SET_TexGenfv(table, save_TexGenfv);
14048 SET_TexGeni(table, save_TexGeni);
14049 SET_TexGeniv(table, save_TexGeniv);
14050 SET_TexImage1D(table, save_TexImage1D);
14051 SET_TexImage2D(table, save_TexImage2D);
14052 SET_TexParameterf(table, save_TexParameterf);
14053 SET_TexParameterfv(table, save_TexParameterfv);
14054 SET_TexParameteri(table, save_TexParameteri);
14055 SET_TexParameteriv(table, save_TexParameteriv);
14056 SET_Translated(table, save_Translated);
14057 SET_Translatef(table, save_Translatef);
14058 SET_Viewport(table, save_Viewport);
14061 SET_BindTexture(table, save_BindTexture);
14062 SET_CopyTexImage1D(table, save_CopyTexImage1D);
14063 SET_CopyTexImage2D(table, save_CopyTexImage2D);
14064 SET_CopyTexSubImage1D(table, save_CopyTexSubImage1D);
14065 SET_CopyTexSubImage2D(table, save_CopyTexSubImage2D);
14066 SET_PrioritizeTextures(table, save_PrioritizeTextures);
14067 SET_TexSubImage1D(table, save_TexSubImage1D);
14068 SET_TexSubImage2D(table, save_TexSubImage2D);
14071 SET_CopyTexSubImage3D(table, save_CopyTexSubImage3D);
14072 SET_TexImage3D(table, save_TexImage3D);
14073 SET_TexSubImage3D(table, save_TexSubImage3D);
14076 SET_StencilFuncSeparate(table, save_StencilFuncSeparate);
14077 SET_StencilMaskSeparate(table, save_StencilMaskSeparate);
14078 SET_StencilOpSeparate(table, save_StencilOpSeparate);
14080 /* ATI_separate_stencil */
14081 SET_StencilFuncSeparateATI(table, save_StencilFuncSeparateATI);
14083 /* GL_ARB_imaging */
14084 /* Not all are supported */
14085 SET_BlendColor(table, save_BlendColor);
14086 SET_BlendEquation(table, save_BlendEquation);
14088 /* 2. GL_EXT_blend_color */
14090 SET_BlendColorEXT(table, save_BlendColorEXT);
14093 /* 6. GL_EXT_texture3d */
14095 SET_CopyTexSubImage3DEXT(table, save_CopyTexSubImage3D);
14096 SET_TexImage3DEXT(table, save_TexImage3DEXT);
14097 SET_TexSubImage3DEXT(table, save_TexSubImage3D);
14100 /* 37. GL_EXT_blend_minmax */
14102 SET_BlendEquationEXT(table, save_BlendEquationEXT);
14105 /* 54. GL_EXT_point_parameters */
14106 SET_PointParameterf(table, save_PointParameterfEXT);
14107 SET_PointParameterfv(table, save_PointParameterfvEXT);
14109 /* 91. GL_ARB_tessellation_shader */
14110 SET_PatchParameteri(table, save_PatchParameteri);
14111 SET_PatchParameterfv(table, save_PatchParameterfv);
14113 /* 100. ARB_viewport_array */
14114 SET_ViewportArrayv(table, save_ViewportArrayv);
14115 SET_ViewportIndexedf(table, save_ViewportIndexedf);
14116 SET_ViewportIndexedfv(table, save_ViewportIndexedfv);
14117 SET_ScissorArrayv(table, save_ScissorArrayv);
14118 SET_ScissorIndexed(table, save_ScissorIndexed);
14119 SET_ScissorIndexedv(table, save_ScissorIndexedv);
14120 SET_DepthRangeArrayv(table, save_DepthRangeArrayv);
14121 SET_DepthRangeIndexed(table, save_DepthRangeIndexed);
14123 /* 122. ARB_compute_shader */
14124 SET_DispatchCompute(table, save_DispatchCompute);
14125 SET_DispatchComputeIndirect(table, save_DispatchComputeIndirect);
14127 /* 173. GL_EXT_blend_func_separate */
14128 SET_BlendFuncSeparate(table, save_BlendFuncSeparateEXT);
14130 /* 197. GL_MESA_window_pos */
14131 SET_WindowPos2d(table, save_WindowPos2dMESA);
14132 SET_WindowPos2dv(table, save_WindowPos2dvMESA);
14133 SET_WindowPos2f(table, save_WindowPos2fMESA);
14134 SET_WindowPos2fv(table, save_WindowPos2fvMESA);
14135 SET_WindowPos2i(table, save_WindowPos2iMESA);
14136 SET_WindowPos2iv(table, save_WindowPos2ivMESA);
14137 SET_WindowPos2s(table, save_WindowPos2sMESA);
14138 SET_WindowPos2sv(table, save_WindowPos2svMESA);
14139 SET_WindowPos3d(table, save_WindowPos3dMESA);
14140 SET_WindowPos3dv(table, save_WindowPos3dvMESA);
14141 SET_WindowPos3f(table, save_WindowPos3fMESA);
14142 SET_WindowPos3fv(table, save_WindowPos3fvMESA);
14143 SET_WindowPos3i(table, save_WindowPos3iMESA);
14144 SET_WindowPos3iv(table, save_WindowPos3ivMESA);
14145 SET_WindowPos3s(table, save_WindowPos3sMESA);
14146 SET_WindowPos3sv(table, save_WindowPos3svMESA);
14147 SET_WindowPos4dMESA(table, save_WindowPos4dMESA);
14148 SET_WindowPos4dvMESA(table, save_WindowPos4dvMESA);
14149 SET_WindowPos4fMESA(table, save_WindowPos4fMESA);
14150 SET_WindowPos4fvMESA(table, save_WindowPos4fvMESA);
14151 SET_WindowPos4iMESA(table, save_WindowPos4iMESA);
14152 SET_WindowPos4ivMESA(table, save_WindowPos4ivMESA);
14153 SET_WindowPos4sMESA(table, save_WindowPos4sMESA);
14154 SET_WindowPos4svMESA(table, save_WindowPos4svMESA);
14156 /* 245. GL_ATI_fragment_shader */
14157 SET_BindFragmentShaderATI(table, save_BindFragmentShaderATI);
14158 SET_SetFragmentShaderConstantATI(table, save_SetFragmentShaderConstantATI);
14160 /* 262. GL_ARB_point_sprite */
14161 SET_PointParameteri(table, save_PointParameteri);
14162 SET_PointParameteriv(table, save_PointParameteriv);
14164 /* 268. GL_EXT_stencil_two_side */
14165 SET_ActiveStencilFaceEXT(table, save_ActiveStencilFaceEXT);
14167 /* ???. GL_EXT_depth_bounds_test */
14168 SET_DepthBoundsEXT(table, save_DepthBoundsEXT);
14170 /* ARB 1. GL_ARB_multitexture */
14171 SET_ActiveTexture(table, save_ActiveTextureARB);
14173 /* ARB 3. GL_ARB_transpose_matrix */
14174 SET_LoadTransposeMatrixd(table, save_LoadTransposeMatrixdARB);
14175 SET_LoadTransposeMatrixf(table, save_LoadTransposeMatrixfARB);
14176 SET_MultTransposeMatrixd(table, save_MultTransposeMatrixdARB);
14177 SET_MultTransposeMatrixf(table, save_MultTransposeMatrixfARB);
14179 /* ARB 5. GL_ARB_multisample */
14180 SET_SampleCoverage(table, save_SampleCoverageARB);
14182 /* ARB 12. GL_ARB_texture_compression */
14183 SET_CompressedTexImage3D(table, save_CompressedTexImage3DARB);
14184 SET_CompressedTexImage2D(table, save_CompressedTexImage2DARB);
14185 SET_CompressedTexImage1D(table, save_CompressedTexImage1DARB);
14186 SET_CompressedTexSubImage3D(table, save_CompressedTexSubImage3DARB);
14187 SET_CompressedTexSubImage2D(table, save_CompressedTexSubImage2DARB);
14188 SET_CompressedTexSubImage1D(table, save_CompressedTexSubImage1DARB);
14190 /* ARB 14. GL_ARB_point_parameters */
14191 /* aliased with EXT_point_parameters functions */
14193 /* ARB 25. GL_ARB_window_pos */
14194 /* aliased with MESA_window_pos functions */
14196 /* ARB 26. GL_ARB_vertex_program */
14197 /* ARB 27. GL_ARB_fragment_program */
14198 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
14199 SET_ProgramStringARB(table, save_ProgramStringARB);
14200 SET_BindProgramARB(table, save_BindProgramARB);
14201 SET_ProgramEnvParameter4dARB(table, save_ProgramEnvParameter4dARB);
14202 SET_ProgramEnvParameter4dvARB(table, save_ProgramEnvParameter4dvARB);
14203 SET_ProgramEnvParameter4fARB(table, save_ProgramEnvParameter4fARB);
14204 SET_ProgramEnvParameter4fvARB(table, save_ProgramEnvParameter4fvARB);
14205 SET_ProgramLocalParameter4dARB(table, save_ProgramLocalParameter4dARB);
14206 SET_ProgramLocalParameter4dvARB(table, save_ProgramLocalParameter4dvARB);
14207 SET_ProgramLocalParameter4fARB(table, save_ProgramLocalParameter4fARB);
14208 SET_ProgramLocalParameter4fvARB(table, save_ProgramLocalParameter4fvARB);
14210 SET_BeginQuery(table, save_BeginQueryARB);
14211 SET_EndQuery(table, save_EndQueryARB);
14212 SET_QueryCounter(table, save_QueryCounter);
14214 SET_DrawBuffers(table, save_DrawBuffersARB);
14216 SET_BlitFramebuffer(table, save_BlitFramebufferEXT);
14218 SET_UseProgram(table, save_UseProgram);
14219 SET_Uniform1f(table, save_Uniform1fARB);
14220 SET_Uniform2f(table, save_Uniform2fARB);
14221 SET_Uniform3f(table, save_Uniform3fARB);
14222 SET_Uniform4f(table, save_Uniform4fARB);
14223 SET_Uniform1fv(table, save_Uniform1fvARB);
14224 SET_Uniform2fv(table, save_Uniform2fvARB);
14225 SET_Uniform3fv(table, save_Uniform3fvARB);
14226 SET_Uniform4fv(table, save_Uniform4fvARB);
14227 SET_Uniform1i(table, save_Uniform1iARB);
14228 SET_Uniform2i(table, save_Uniform2iARB);
14229 SET_Uniform3i(table, save_Uniform3iARB);
14230 SET_Uniform4i(table, save_Uniform4iARB);
14231 SET_Uniform1iv(table, save_Uniform1ivARB);
14232 SET_Uniform2iv(table, save_Uniform2ivARB);
14233 SET_Uniform3iv(table, save_Uniform3ivARB);
14234 SET_Uniform4iv(table, save_Uniform4ivARB);
14235 SET_UniformMatrix2fv(table, save_UniformMatrix2fvARB);
14236 SET_UniformMatrix3fv(table, save_UniformMatrix3fvARB);
14237 SET_UniformMatrix4fv(table, save_UniformMatrix4fvARB);
14238 SET_UniformMatrix2x3fv(table, save_UniformMatrix2x3fv);
14239 SET_UniformMatrix3x2fv(table, save_UniformMatrix3x2fv);
14240 SET_UniformMatrix2x4fv(table, save_UniformMatrix2x4fv);
14241 SET_UniformMatrix4x2fv(table, save_UniformMatrix4x2fv);
14242 SET_UniformMatrix3x4fv(table, save_UniformMatrix3x4fv);
14243 SET_UniformMatrix4x3fv(table, save_UniformMatrix4x3fv);
14245 /* 299. GL_EXT_blend_equation_separate */
14246 SET_BlendEquationSeparate(table, save_BlendEquationSeparateEXT);
14248 /* GL_EXT_gpu_program_parameters */
14249 SET_ProgramEnvParameters4fvEXT(table, save_ProgramEnvParameters4fvEXT);
14250 SET_ProgramLocalParameters4fvEXT(table, save_ProgramLocalParameters4fvEXT);
14252 /* 364. GL_EXT_provoking_vertex */
14253 SET_ProvokingVertex(table, save_ProvokingVertexEXT);
14255 /* GL_EXT_texture_integer */
14256 SET_ClearColorIiEXT(table, save_ClearColorIi);
14257 SET_ClearColorIuiEXT(table, save_ClearColorIui);
14258 SET_TexParameterIiv(table, save_TexParameterIiv);
14259 SET_TexParameterIuiv(table, save_TexParameterIuiv);
14261 /* GL_ARB_clip_control */
14262 SET_ClipControl(table, save_ClipControl);
14264 /* GL_ARB_color_buffer_float */
14265 SET_ClampColor(table, save_ClampColorARB);
14268 SET_ClearBufferiv(table, save_ClearBufferiv);
14269 SET_ClearBufferuiv(table, save_ClearBufferuiv);
14270 SET_ClearBufferfv(table, save_ClearBufferfv);
14271 SET_ClearBufferfi(table, save_ClearBufferfi);
14272 SET_Uniform1ui(table, save_Uniform1ui);
14273 SET_Uniform2ui(table, save_Uniform2ui);
14274 SET_Uniform3ui(table, save_Uniform3ui);
14275 SET_Uniform4ui(table, save_Uniform4ui);
14276 SET_Uniform1uiv(table, save_Uniform1uiv);
14277 SET_Uniform2uiv(table, save_Uniform2uiv);
14278 SET_Uniform3uiv(table, save_Uniform3uiv);
14279 SET_Uniform4uiv(table, save_Uniform4uiv);
14281 /* GL_ARB_gpu_shader_fp64 */
14282 SET_Uniform1d(table, save_Uniform1d);
14283 SET_Uniform2d(table, save_Uniform2d);
14284 SET_Uniform3d(table, save_Uniform3d);
14285 SET_Uniform4d(table, save_Uniform4d);
14286 SET_Uniform1dv(table, save_Uniform1dv);
14287 SET_Uniform2dv(table, save_Uniform2dv);
14288 SET_Uniform3dv(table, save_Uniform3dv);
14289 SET_Uniform4dv(table, save_Uniform4dv);
14290 SET_UniformMatrix2dv(table, save_UniformMatrix2dv);
14291 SET_UniformMatrix3dv(table, save_UniformMatrix3dv);
14292 SET_UniformMatrix4dv(table, save_UniformMatrix4dv);
14293 SET_UniformMatrix2x3dv(table, save_UniformMatrix2x3dv);
14294 SET_UniformMatrix3x2dv(table, save_UniformMatrix3x2dv);
14295 SET_UniformMatrix2x4dv(table, save_UniformMatrix2x4dv);
14296 SET_UniformMatrix4x2dv(table, save_UniformMatrix4x2dv);
14297 SET_UniformMatrix3x4dv(table, save_UniformMatrix3x4dv);
14298 SET_UniformMatrix4x3dv(table, save_UniformMatrix4x3dv);
14300 /* GL_ARB_gpu_shader_int64 */
14301 SET_Uniform1i64ARB(table, save_Uniform1i64ARB);
14302 SET_Uniform2i64ARB(table, save_Uniform2i64ARB);
14303 SET_Uniform3i64ARB(table, save_Uniform3i64ARB);
14304 SET_Uniform4i64ARB(table, save_Uniform4i64ARB);
14305 SET_Uniform1i64vARB(table, save_Uniform1i64vARB);
14306 SET_Uniform2i64vARB(table, save_Uniform2i64vARB);
14307 SET_Uniform3i64vARB(table, save_Uniform3i64vARB);
14308 SET_Uniform4i64vARB(table, save_Uniform4i64vARB);
14309 SET_Uniform1ui64ARB(table, save_Uniform1ui64ARB);
14310 SET_Uniform2ui64ARB(table, save_Uniform2ui64ARB);
14311 SET_Uniform3ui64ARB(table, save_Uniform3ui64ARB);
14312 SET_Uniform4ui64ARB(table, save_Uniform4ui64ARB);
14313 SET_Uniform1ui64vARB(table, save_Uniform1ui64vARB);
14314 SET_Uniform2ui64vARB(table, save_Uniform2ui64vARB);
14315 SET_Uniform3ui64vARB(table, save_Uniform3ui64vARB);
14316 SET_Uniform4ui64vARB(table, save_Uniform4ui64vARB);
14318 SET_ProgramUniform1i64ARB(table, save_ProgramUniform1i64ARB);
14319 SET_ProgramUniform2i64ARB(table, save_ProgramUniform2i64ARB);
14320 SET_ProgramUniform3i64ARB(table, save_ProgramUniform3i64ARB);
14321 SET_ProgramUniform4i64ARB(table, save_ProgramUniform4i64ARB);
14322 SET_ProgramUniform1i64vARB(table, save_ProgramUniform1i64vARB);
14323 SET_ProgramUniform2i64vARB(table, save_ProgramUniform2i64vARB);
14324 SET_ProgramUniform3i64vARB(table, save_ProgramUniform3i64vARB);
14325 SET_ProgramUniform4i64vARB(table, save_ProgramUniform4i64vARB);
14326 SET_ProgramUniform1ui64ARB(table, save_ProgramUniform1ui64ARB);
14327 SET_ProgramUniform2ui64ARB(table, save_ProgramUniform2ui64ARB);
14328 SET_ProgramUniform3ui64ARB(table, save_ProgramUniform3ui64ARB);
14329 SET_ProgramUniform4ui64ARB(table, save_ProgramUniform4ui64ARB);
14330 SET_ProgramUniform1ui64vARB(table, save_ProgramUniform1ui64vARB);
14331 SET_ProgramUniform2ui64vARB(table, save_ProgramUniform2ui64vARB);
14332 SET_ProgramUniform3ui64vARB(table, save_ProgramUniform3ui64vARB);
14333 SET_ProgramUniform4ui64vARB(table, save_ProgramUniform4ui64vARB);
14336 SET_BeginTransformFeedback(table, save_BeginTransformFeedback);
14337 SET_EndTransformFeedback(table, save_EndTransformFeedback);
14338 SET_BindTransformFeedback(table, save_BindTransformFeedback);
14339 SET_PauseTransformFeedback(table, save_PauseTransformFeedback);
14340 SET_ResumeTransformFeedback(table, save_ResumeTransformFeedback);
14341 SET_DrawTransformFeedback(table, save_DrawTransformFeedback);
14342 SET_DrawTransformFeedbackStream(table, save_DrawTransformFeedbackStream);
14343 SET_DrawTransformFeedbackInstanced(table,
14344 save_DrawTransformFeedbackInstanced);
14345 SET_DrawTransformFeedbackStreamInstanced(table,
14346 save_DrawTransformFeedbackStreamInstanced);
14347 SET_BeginQueryIndexed(table, save_BeginQueryIndexed);
14348 SET_EndQueryIndexed(table, save_EndQueryIndexed);
14350 /* GL_ARB_instanced_arrays */
14351 SET_VertexAttribDivisor(table, save_VertexAttribDivisor);
14353 /* GL_NV_texture_barrier */
14354 SET_TextureBarrierNV(table, save_TextureBarrierNV);
14356 SET_BindSampler(table, save_BindSampler);
14357 SET_SamplerParameteri(table, save_SamplerParameteri);
14358 SET_SamplerParameterf(table, save_SamplerParameterf);
14359 SET_SamplerParameteriv(table, save_SamplerParameteriv);
14360 SET_SamplerParameterfv(table, save_SamplerParameterfv);
14361 SET_SamplerParameterIiv(table, save_SamplerParameterIiv);
14362 SET_SamplerParameterIuiv(table, save_SamplerParameterIuiv);
14364 /* GL_ARB_draw_buffer_blend */
14365 SET_BlendFunciARB(table, save_BlendFunci);
14366 SET_BlendFuncSeparateiARB(table, save_BlendFuncSeparatei);
14367 SET_BlendEquationiARB(table, save_BlendEquationi);
14368 SET_BlendEquationSeparateiARB(table, save_BlendEquationSeparatei);
14370 /* GL_NV_conditional_render */
14371 SET_BeginConditionalRender(table, save_BeginConditionalRender);
14372 SET_EndConditionalRender(table, save_EndConditionalRender);
14375 SET_WaitSync(table, save_WaitSync);
14377 /* GL_ARB_uniform_buffer_object */
14378 SET_UniformBlockBinding(table, save_UniformBlockBinding);
14380 /* GL_ARB_shader_subroutines */
14381 SET_UniformSubroutinesuiv(table, save_UniformSubroutinesuiv);
14383 /* GL_ARB_draw_instanced */
14384 SET_DrawArraysInstancedARB(table, save_DrawArraysInstancedARB);
14385 SET_DrawElementsInstancedARB(table, save_DrawElementsInstancedARB);
14387 /* GL_ARB_draw_elements_base_vertex */
14388 SET_DrawElementsInstancedBaseVertex(table, save_DrawElementsInstancedBaseVertexARB);
14390 /* GL_ARB_base_instance */
14391 SET_DrawArraysInstancedBaseInstance(table, save_DrawArraysInstancedBaseInstance);
14392 SET_DrawElementsInstancedBaseInstance(table, save_DrawElementsInstancedBaseInstance);
14393 SET_DrawElementsInstancedBaseVertexBaseInstance(table, save_DrawElementsInstancedBaseVertexBaseInstance);
14395 /* GL_ARB_draw_indirect / GL_ARB_multi_draw_indirect */
14396 SET_DrawArraysIndirect(table, save_DrawArraysIndirect);
14397 SET_DrawElementsIndirect(table, save_DrawElementsIndirect);
14398 SET_MultiDrawArraysIndirect(table, save_MultiDrawArraysIndirect);
14399 SET_MultiDrawElementsIndirect(table, save_MultiDrawElementsIndirect);
14401 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
14402 SET_UseProgramStages(table, save_UseProgramStages);
14403 SET_ProgramUniform1f(table, save_ProgramUniform1f);
14404 SET_ProgramUniform2f(table, save_ProgramUniform2f);
14405 SET_ProgramUniform3f(table, save_ProgramUniform3f);
14406 SET_ProgramUniform4f(table, save_ProgramUniform4f);
14407 SET_ProgramUniform1fv(table, save_ProgramUniform1fv);
14408 SET_ProgramUniform2fv(table, save_ProgramUniform2fv);
14409 SET_ProgramUniform3fv(table, save_ProgramUniform3fv);
14410 SET_ProgramUniform4fv(table, save_ProgramUniform4fv);
14411 SET_ProgramUniform1d(table, save_ProgramUniform1d);
14412 SET_ProgramUniform2d(table, save_ProgramUniform2d);
14413 SET_ProgramUniform3d(table, save_ProgramUniform3d);
14414 SET_ProgramUniform4d(table, save_ProgramUniform4d);
14415 SET_ProgramUniform1dv(table, save_ProgramUniform1dv);
14416 SET_ProgramUniform2dv(table, save_ProgramUniform2dv);
14417 SET_ProgramUniform3dv(table, save_ProgramUniform3dv);
14418 SET_ProgramUniform4dv(table, save_ProgramUniform4dv);
14419 SET_ProgramUniform1i(table, save_ProgramUniform1i);
14420 SET_ProgramUniform2i(table, save_ProgramUniform2i);
14421 SET_ProgramUniform3i(table, save_ProgramUniform3i);
14422 SET_ProgramUniform4i(table, save_ProgramUniform4i);
14423 SET_ProgramUniform1iv(table, save_ProgramUniform1iv);
14424 SET_ProgramUniform2iv(table, save_ProgramUniform2iv);
14425 SET_ProgramUniform3iv(table, save_ProgramUniform3iv);
14426 SET_ProgramUniform4iv(table, save_ProgramUniform4iv);
14427 SET_ProgramUniform1ui(table, save_ProgramUniform1ui);
14428 SET_ProgramUniform2ui(table, save_ProgramUniform2ui);
14429 SET_ProgramUniform3ui(table, save_ProgramUniform3ui);
14430 SET_ProgramUniform4ui(table, save_ProgramUniform4ui);
14431 SET_ProgramUniform1uiv(table, save_ProgramUniform1uiv);
14432 SET_ProgramUniform2uiv(table, save_ProgramUniform2uiv);
14433 SET_ProgramUniform3uiv(table, save_ProgramUniform3uiv);
14434 SET_ProgramUniform4uiv(table, save_ProgramUniform4uiv);
14435 SET_ProgramUniformMatrix2fv(table, save_ProgramUniformMatrix2fv);
14436 SET_ProgramUniformMatrix3fv(table, save_ProgramUniformMatrix3fv);
14437 SET_ProgramUniformMatrix4fv(table, save_ProgramUniformMatrix4fv);
14438 SET_ProgramUniformMatrix2x3fv(table, save_ProgramUniformMatrix2x3fv);
14439 SET_ProgramUniformMatrix3x2fv(table, save_ProgramUniformMatrix3x2fv);
14440 SET_ProgramUniformMatrix2x4fv(table, save_ProgramUniformMatrix2x4fv);
14441 SET_ProgramUniformMatrix4x2fv(table, save_ProgramUniformMatrix4x2fv);
14442 SET_ProgramUniformMatrix3x4fv(table, save_ProgramUniformMatrix3x4fv);
14443 SET_ProgramUniformMatrix4x3fv(table, save_ProgramUniformMatrix4x3fv);
14444 SET_ProgramUniformMatrix2dv(table, save_ProgramUniformMatrix2dv);
14445 SET_ProgramUniformMatrix3dv(table, save_ProgramUniformMatrix3dv);
14446 SET_ProgramUniformMatrix4dv(table, save_ProgramUniformMatrix4dv);
14447 SET_ProgramUniformMatrix2x3dv(table, save_ProgramUniformMatrix2x3dv);
14448 SET_ProgramUniformMatrix3x2dv(table, save_ProgramUniformMatrix3x2dv);
14449 SET_ProgramUniformMatrix2x4dv(table, save_ProgramUniformMatrix2x4dv);
14450 SET_ProgramUniformMatrix4x2dv(table, save_ProgramUniformMatrix4x2dv);
14451 SET_ProgramUniformMatrix3x4dv(table, save_ProgramUniformMatrix3x4dv);
14452 SET_ProgramUniformMatrix4x3dv(table, save_ProgramUniformMatrix4x3dv);
14454 /* GL_{ARB,EXT}_polygon_offset_clamp */
14455 SET_PolygonOffsetClampEXT(table, save_PolygonOffsetClampEXT);
14457 /* GL_EXT_window_rectangles */
14458 SET_WindowRectanglesEXT(table, save_WindowRectanglesEXT);
14460 /* GL_NV_conservative_raster */
14461 SET_SubpixelPrecisionBiasNV(table, save_SubpixelPrecisionBiasNV);
14463 /* GL_NV_conservative_raster_dilate */
14464 SET_ConservativeRasterParameterfNV(table, save_ConservativeRasterParameterfNV);
14466 /* GL_NV_conservative_raster_pre_snap_triangles */
14467 SET_ConservativeRasterParameteriNV(table, save_ConservativeRasterParameteriNV);
14469 /* GL_EXT_direct_state_access */
14470 SET_MatrixLoadfEXT(table, save_MatrixLoadfEXT);
14471 SET_MatrixLoaddEXT(table, save_MatrixLoaddEXT);
14472 SET_MatrixMultfEXT(table, save_MatrixMultfEXT);
14473 SET_MatrixMultdEXT(table, save_MatrixMultdEXT);
14474 SET_MatrixRotatefEXT(table, save_MatrixRotatefEXT);
14475 SET_MatrixRotatedEXT(table, save_MatrixRotatedEXT);
14476 SET_MatrixScalefEXT(table, save_MatrixScalefEXT);
14477 SET_MatrixScaledEXT(table, save_MatrixScaledEXT);
14478 SET_MatrixTranslatefEXT(table, save_MatrixTranslatefEXT);
14479 SET_MatrixTranslatedEXT(table, save_MatrixTranslatedEXT);
14480 SET_MatrixLoadIdentityEXT(table, save_MatrixLoadIdentityEXT);
14481 SET_MatrixOrthoEXT(table, save_MatrixOrthoEXT);
14482 SET_MatrixFrustumEXT(table, save_MatrixFrustumEXT);
14483 SET_MatrixPushEXT(table, save_MatrixPushEXT);
14484 SET_MatrixPopEXT(table, save_MatrixPopEXT);
14485 SET_MatrixLoadTransposefEXT(table, save_MatrixLoadTransposefEXT);
14486 SET_MatrixLoadTransposedEXT(table, save_MatrixLoadTransposedEXT);
14487 SET_MatrixMultTransposefEXT(table, save_MatrixMultTransposefEXT);
14488 SET_MatrixMultTransposedEXT(table, save_MatrixMultTransposedEXT);
14489 SET_TextureParameteriEXT(table, save_TextureParameteriEXT);
14490 SET_TextureParameterivEXT(table, save_TextureParameterivEXT);
14491 SET_TextureParameterfEXT(table, save_TextureParameterfEXT);
14492 SET_TextureParameterfvEXT(table, save_TextureParameterfvEXT);
14493 SET_TextureParameterIivEXT(table, save_TextureParameterIivEXT);
14494 SET_TextureParameterIuivEXT(table, save_TextureParameterIuivEXT);
14495 SET_TextureImage1DEXT(table, save_TextureImage1DEXT);
14496 SET_TextureImage2DEXT(table, save_TextureImage2DEXT);
14497 SET_TextureImage3DEXT(table, save_TextureImage3DEXT);
14498 SET_TextureSubImage1DEXT(table, save_TextureSubImage1DEXT);
14499 SET_TextureSubImage2DEXT(table, save_TextureSubImage2DEXT);
14500 SET_TextureSubImage3DEXT(table, save_TextureSubImage3DEXT);
14501 SET_CopyTextureImage1DEXT(table, save_CopyTextureImage1DEXT);
14502 SET_CopyTextureImage2DEXT(table, save_CopyTextureImage2DEXT);
14503 SET_CopyTextureSubImage1DEXT(table, save_CopyTextureSubImage1DEXT);
14504 SET_CopyTextureSubImage2DEXT(table, save_CopyTextureSubImage2DEXT);
14505 SET_CopyTextureSubImage3DEXT(table, save_CopyTextureSubImage3DEXT);
14506 SET_BindMultiTextureEXT(table, save_BindMultiTextureEXT);
14507 SET_MultiTexParameteriEXT(table, save_MultiTexParameteriEXT);
14508 SET_MultiTexParameterivEXT(table, save_MultiTexParameterivEXT);
14509 SET_MultiTexParameterIivEXT(table, save_MultiTexParameterIivEXT);
14510 SET_MultiTexParameterIuivEXT(table, save_MultiTexParameterIuivEXT);
14511 SET_MultiTexParameterfEXT(table, save_MultiTexParameterfEXT);
14512 SET_MultiTexParameterfvEXT(table, save_MultiTexParameterfvEXT);
14513 SET_MultiTexImage1DEXT(table, save_MultiTexImage1DEXT);
14514 SET_MultiTexImage2DEXT(table, save_MultiTexImage2DEXT);
14515 SET_MultiTexImage3DEXT(table, save_MultiTexImage3DEXT);
14516 SET_MultiTexSubImage1DEXT(table, save_MultiTexSubImage1DEXT);
14517 SET_MultiTexSubImage2DEXT(table, save_MultiTexSubImage2DEXT);
14518 SET_MultiTexSubImage3DEXT(table, save_MultiTexSubImage3DEXT);
14519 SET_CopyMultiTexImage1DEXT(table, save_CopyMultiTexImage1DEXT);
14520 SET_CopyMultiTexImage2DEXT(table, save_CopyMultiTexImage2DEXT);
14521 SET_CopyMultiTexSubImage1DEXT(table, save_CopyMultiTexSubImage1DEXT);
14522 SET_CopyMultiTexSubImage2DEXT(table, save_CopyMultiTexSubImage2DEXT);
14523 SET_CopyMultiTexSubImage3DEXT(table, save_CopyMultiTexSubImage3DEXT);
14524 SET_MultiTexEnvfEXT(table, save_MultiTexEnvfEXT);
14525 SET_MultiTexEnvfvEXT(table, save_MultiTexEnvfvEXT);
14526 SET_MultiTexEnviEXT(table, save_MultiTexEnviEXT);
14527 SET_MultiTexEnvivEXT(table, save_MultiTexEnvivEXT);
14528 SET_CompressedTextureImage1DEXT(table, save_CompressedTextureImage1DEXT);
14529 SET_CompressedTextureImage2DEXT(table, save_CompressedTextureImage2DEXT);
14530 SET_CompressedTextureImage3DEXT(table, save_CompressedTextureImage3DEXT);
14531 SET_CompressedTextureSubImage1DEXT(table, save_CompressedTextureSubImage1DEXT);
14532 SET_CompressedTextureSubImage2DEXT(table, save_CompressedTextureSubImage2DEXT);
14533 SET_CompressedTextureSubImage3DEXT(table, save_CompressedTextureSubImage3DEXT);
14534 SET_CompressedMultiTexImage1DEXT(table, save_CompressedMultiTexImage1DEXT);
14535 SET_CompressedMultiTexImage2DEXT(table, save_CompressedMultiTexImage2DEXT);
14536 SET_CompressedMultiTexImage3DEXT(table, save_CompressedMultiTexImage3DEXT);
14537 SET_CompressedMultiTexSubImage1DEXT(table, save_CompressedMultiTexSubImage1DEXT);
14538 SET_CompressedMultiTexSubImage2DEXT(table, save_CompressedMultiTexSubImage2DEXT);
14539 SET_CompressedMultiTexSubImage3DEXT(table, save_CompressedMultiTexSubImage3DEXT);
14540 SET_NamedProgramStringEXT(table, save_NamedProgramStringEXT);
14541 SET_NamedProgramLocalParameter4dEXT(table, save_NamedProgramLocalParameter4dEXT);
14542 SET_NamedProgramLocalParameter4dvEXT(table, save_NamedProgramLocalParameter4dvEXT);
14543 SET_NamedProgramLocalParameter4fEXT(table, save_NamedProgramLocalParameter4fEXT);
14544 SET_NamedProgramLocalParameter4fvEXT(table, save_NamedProgramLocalParameter4fvEXT);
14549 static const char *
14550 enum_string(GLenum k)
14552 return _mesa_enum_to_string(k);
14557 * Print the commands in a display list. For debugging only.
14558 * TODO: many commands aren't handled yet.
14559 * \param fname filename to write display list to. If null, use stdout.
14561 static void GLAPIENTRY
14562 print_list(struct gl_context *ctx, GLuint list, const char *fname)
14564 struct gl_display_list *dlist;
14569 f = fopen(fname, "w");
14574 if (!_mesa_get_list(ctx, list, &dlist, true)) {
14575 fprintf(f, "%u is not a display list ID\n", list);
14584 fprintf(f, "START-LIST %u, address %p\n", list, (void *) n);
14587 const OpCode opcode = n[0].opcode;
14591 fprintf(f, "Accum %s %g\n", enum_string(n[1].e), n[2].f);
14593 case OPCODE_ACTIVE_TEXTURE:
14594 fprintf(f, "ActiveTexture(%s)\n", enum_string(n[1].e));
14596 case OPCODE_BITMAP:
14597 fprintf(f, "Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i,
14598 n[3].f, n[4].f, n[5].f, n[6].f,
14599 get_pointer(&n[7]));
14601 case OPCODE_BLEND_COLOR:
14602 fprintf(f, "BlendColor %f, %f, %f, %f\n",
14603 n[1].f, n[2].f, n[3].f, n[4].f);
14605 case OPCODE_BLEND_EQUATION:
14606 fprintf(f, "BlendEquation %s\n",
14607 enum_string(n[1].e));
14609 case OPCODE_BLEND_EQUATION_SEPARATE:
14610 fprintf(f, "BlendEquationSeparate %s, %s\n",
14611 enum_string(n[1].e),
14612 enum_string(n[2].e));
14614 case OPCODE_BLEND_FUNC_SEPARATE:
14615 fprintf(f, "BlendFuncSeparate %s, %s, %s, %s\n",
14616 enum_string(n[1].e),
14617 enum_string(n[2].e),
14618 enum_string(n[3].e),
14619 enum_string(n[4].e));
14621 case OPCODE_BLEND_EQUATION_I:
14622 fprintf(f, "BlendEquationi %u, %s\n",
14623 n[1].ui, enum_string(n[2].e));
14625 case OPCODE_BLEND_EQUATION_SEPARATE_I:
14626 fprintf(f, "BlendEquationSeparatei %u, %s, %s\n",
14627 n[1].ui, enum_string(n[2].e), enum_string(n[3].e));
14629 case OPCODE_BLEND_FUNC_I:
14630 fprintf(f, "BlendFunci %u, %s, %s\n",
14631 n[1].ui, enum_string(n[2].e), enum_string(n[3].e));
14633 case OPCODE_BLEND_FUNC_SEPARATE_I:
14634 fprintf(f, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
14636 enum_string(n[2].e),
14637 enum_string(n[3].e),
14638 enum_string(n[4].e),
14639 enum_string(n[5].e));
14641 case OPCODE_CALL_LIST:
14642 fprintf(f, "CallList %d\n", (int) n[1].ui);
14644 case OPCODE_CALL_LISTS:
14645 fprintf(f, "CallLists %d, %s\n", n[1].i, enum_string(n[1].e));
14647 case OPCODE_DISABLE:
14648 fprintf(f, "Disable %s\n", enum_string(n[1].e));
14650 case OPCODE_ENABLE:
14651 fprintf(f, "Enable %s\n", enum_string(n[1].e));
14653 case OPCODE_FRUSTUM:
14654 fprintf(f, "Frustum %g %g %g %g %g %g\n",
14655 n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f);
14657 case OPCODE_LINE_STIPPLE:
14658 fprintf(f, "LineStipple %d %x\n", n[1].i, (int) n[2].us);
14660 case OPCODE_LINE_WIDTH:
14661 fprintf(f, "LineWidth %f\n", n[1].f);
14663 case OPCODE_LOAD_IDENTITY:
14664 fprintf(f, "LoadIdentity\n");
14666 case OPCODE_LOAD_MATRIX:
14667 fprintf(f, "LoadMatrix\n");
14668 fprintf(f, " %8f %8f %8f %8f\n",
14669 n[1].f, n[5].f, n[9].f, n[13].f);
14670 fprintf(f, " %8f %8f %8f %8f\n",
14671 n[2].f, n[6].f, n[10].f, n[14].f);
14672 fprintf(f, " %8f %8f %8f %8f\n",
14673 n[3].f, n[7].f, n[11].f, n[15].f);
14674 fprintf(f, " %8f %8f %8f %8f\n",
14675 n[4].f, n[8].f, n[12].f, n[16].f);
14677 case OPCODE_MULT_MATRIX:
14678 fprintf(f, "MultMatrix (or Rotate)\n");
14679 fprintf(f, " %8f %8f %8f %8f\n",
14680 n[1].f, n[5].f, n[9].f, n[13].f);
14681 fprintf(f, " %8f %8f %8f %8f\n",
14682 n[2].f, n[6].f, n[10].f, n[14].f);
14683 fprintf(f, " %8f %8f %8f %8f\n",
14684 n[3].f, n[7].f, n[11].f, n[15].f);
14685 fprintf(f, " %8f %8f %8f %8f\n",
14686 n[4].f, n[8].f, n[12].f, n[16].f);
14689 fprintf(f, "Ortho %g %g %g %g %g %g\n",
14690 n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f);
14692 case OPCODE_POINT_SIZE:
14693 fprintf(f, "PointSize %f\n", n[1].f);
14695 case OPCODE_POP_ATTRIB:
14696 fprintf(f, "PopAttrib\n");
14698 case OPCODE_POP_MATRIX:
14699 fprintf(f, "PopMatrix\n");
14701 case OPCODE_POP_NAME:
14702 fprintf(f, "PopName\n");
14704 case OPCODE_PUSH_ATTRIB:
14705 fprintf(f, "PushAttrib %x\n", n[1].bf);
14707 case OPCODE_PUSH_MATRIX:
14708 fprintf(f, "PushMatrix\n");
14710 case OPCODE_PUSH_NAME:
14711 fprintf(f, "PushName %d\n", (int) n[1].ui);
14713 case OPCODE_RASTER_POS:
14714 fprintf(f, "RasterPos %g %g %g %g\n",
14715 n[1].f, n[2].f, n[3].f, n[4].f);
14717 case OPCODE_ROTATE:
14718 fprintf(f, "Rotate %g %g %g %g\n",
14719 n[1].f, n[2].f, n[3].f, n[4].f);
14722 fprintf(f, "Scale %g %g %g\n", n[1].f, n[2].f, n[3].f);
14724 case OPCODE_TRANSLATE:
14725 fprintf(f, "Translate %g %g %g\n", n[1].f, n[2].f, n[3].f);
14727 case OPCODE_BIND_TEXTURE:
14728 fprintf(f, "BindTexture %s %d\n",
14729 _mesa_enum_to_string(n[1].ui), n[2].ui);
14731 case OPCODE_SHADE_MODEL:
14732 fprintf(f, "ShadeModel %s\n", _mesa_enum_to_string(n[1].ui));
14735 fprintf(f, "Map1 %s %.3f %.3f %d %d\n",
14736 _mesa_enum_to_string(n[1].ui),
14737 n[2].f, n[3].f, n[4].i, n[5].i);
14740 fprintf(f, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
14741 _mesa_enum_to_string(n[1].ui),
14742 n[2].f, n[3].f, n[4].f, n[5].f,
14743 n[6].i, n[7].i, n[8].i, n[9].i);
14745 case OPCODE_MAPGRID1:
14746 fprintf(f, "MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f);
14748 case OPCODE_MAPGRID2:
14749 fprintf(f, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
14750 n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f);
14752 case OPCODE_EVALMESH1:
14753 fprintf(f, "EvalMesh1 %d %d\n", n[1].i, n[2].i);
14755 case OPCODE_EVALMESH2:
14756 fprintf(f, "EvalMesh2 %d %d %d %d\n",
14757 n[1].i, n[2].i, n[3].i, n[4].i);
14760 case OPCODE_ATTR_1F_NV:
14761 fprintf(f, "ATTR_1F_NV attr %d: %f\n", n[1].i, n[2].f);
14763 case OPCODE_ATTR_2F_NV:
14764 fprintf(f, "ATTR_2F_NV attr %d: %f %f\n",
14765 n[1].i, n[2].f, n[3].f);
14767 case OPCODE_ATTR_3F_NV:
14768 fprintf(f, "ATTR_3F_NV attr %d: %f %f %f\n",
14769 n[1].i, n[2].f, n[3].f, n[4].f);
14771 case OPCODE_ATTR_4F_NV:
14772 fprintf(f, "ATTR_4F_NV attr %d: %f %f %f %f\n",
14773 n[1].i, n[2].f, n[3].f, n[4].f, n[5].f);
14775 case OPCODE_ATTR_1F_ARB:
14776 fprintf(f, "ATTR_1F_ARB attr %d: %f\n", n[1].i, n[2].f);
14778 case OPCODE_ATTR_2F_ARB:
14779 fprintf(f, "ATTR_2F_ARB attr %d: %f %f\n",
14780 n[1].i, n[2].f, n[3].f);
14782 case OPCODE_ATTR_3F_ARB:
14783 fprintf(f, "ATTR_3F_ARB attr %d: %f %f %f\n",
14784 n[1].i, n[2].f, n[3].f, n[4].f);
14786 case OPCODE_ATTR_4F_ARB:
14787 fprintf(f, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
14788 n[1].i, n[2].f, n[3].f, n[4].f, n[5].f);
14791 case OPCODE_MATERIAL:
14792 fprintf(f, "MATERIAL %x %x: %f %f %f %f\n",
14793 n[1].i, n[2].i, n[3].f, n[4].f, n[5].f, n[6].f);
14796 fprintf(f, "BEGIN %x\n", n[1].i);
14799 fprintf(f, "END\n");
14801 case OPCODE_EVAL_C1:
14802 fprintf(f, "EVAL_C1 %f\n", n[1].f);
14804 case OPCODE_EVAL_C2:
14805 fprintf(f, "EVAL_C2 %f %f\n", n[1].f, n[2].f);
14807 case OPCODE_EVAL_P1:
14808 fprintf(f, "EVAL_P1 %d\n", n[1].i);
14810 case OPCODE_EVAL_P2:
14811 fprintf(f, "EVAL_P2 %d %d\n", n[1].i, n[2].i);
14814 case OPCODE_PROVOKING_VERTEX:
14815 fprintf(f, "ProvokingVertex %s\n",
14816 _mesa_enum_to_string(n[1].ui));
14820 * meta opcodes/commands
14823 fprintf(f, "Error: %s %s\n", enum_string(n[1].e),
14824 (const char *) get_pointer(&n[2]));
14826 case OPCODE_CONTINUE:
14827 fprintf(f, "DISPLAY-LIST-CONTINUE\n");
14828 n = (Node *) get_pointer(&n[1]);
14831 fprintf(f, "NOP\n");
14833 case OPCODE_VERTEX_LIST:
14834 vbo_print_vertex_list(ctx, (struct vbo_save_vertex_list *) &n[1], f);
14837 if (opcode < 0 || opcode > OPCODE_END_OF_LIST) {
14839 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
14840 opcode, (void *) n);
14842 fprintf(f, "command %d, %u operands\n", opcode,
14847 case OPCODE_END_OF_LIST:
14848 fprintf(f, "END-LIST %u\n", list);
14855 /* increment n to point to next compiled command */
14856 assert(n[0].InstSize > 0);
14857 n += n[0].InstSize;
14863 _mesa_glthread_execute_list(struct gl_context *ctx, GLuint list)
14865 struct gl_display_list *dlist;
14868 ctx->GLThread.ListCallDepth == MAX_LIST_NESTING ||
14869 !_mesa_get_list(ctx, list, &dlist, true))
14872 ctx->GLThread.ListCallDepth++;
14874 Node *n = dlist->Head;
14877 const OpCode opcode = n[0].opcode;
14880 case OPCODE_CALL_LIST:
14881 /* Generated by glCallList(), don't add ListBase */
14882 if (ctx->GLThread.ListCallDepth < MAX_LIST_NESTING)
14883 _mesa_glthread_execute_list(ctx, n[1].ui);
14885 case OPCODE_CALL_LISTS:
14886 if (ctx->GLThread.ListCallDepth < MAX_LIST_NESTING)
14887 _mesa_glthread_CallLists(ctx, n[1].i, n[2].e, get_pointer(&n[3]));
14889 case OPCODE_DISABLE:
14890 _mesa_glthread_Disable(ctx, n[1].e);
14892 case OPCODE_ENABLE:
14893 _mesa_glthread_Enable(ctx, n[1].e);
14895 case OPCODE_LIST_BASE:
14896 _mesa_glthread_ListBase(ctx, n[1].ui);
14898 case OPCODE_MATRIX_MODE:
14899 _mesa_glthread_MatrixMode(ctx, n[1].e);
14901 case OPCODE_POP_ATTRIB:
14902 _mesa_glthread_PopAttrib(ctx);
14904 case OPCODE_POP_MATRIX:
14905 _mesa_glthread_PopMatrix(ctx);
14907 case OPCODE_PUSH_ATTRIB:
14908 _mesa_glthread_PushAttrib(ctx, n[1].bf);
14910 case OPCODE_PUSH_MATRIX:
14911 _mesa_glthread_PushMatrix(ctx);
14913 case OPCODE_ACTIVE_TEXTURE: /* GL_ARB_multitexture */
14914 _mesa_glthread_ActiveTexture(ctx, n[1].e);
14916 case OPCODE_MATRIX_PUSH:
14917 _mesa_glthread_MatrixPushEXT(ctx, n[1].e);
14919 case OPCODE_MATRIX_POP:
14920 _mesa_glthread_MatrixPopEXT(ctx, n[1].e);
14922 case OPCODE_CONTINUE:
14923 n = (Node *)get_pointer(&n[1]);
14925 case OPCODE_END_OF_LIST:
14926 ctx->GLThread.ListCallDepth--;
14933 /* increment n to point to next compiled command */
14934 assert(n[0].InstSize > 0);
14935 n += n[0].InstSize;
14941 * Clients may call this function to help debug display list problems.
14942 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
14943 * changed, or break in the future without notice.
14946 mesa_print_display_list(GLuint list)
14948 GET_CURRENT_CONTEXT(ctx);
14949 print_list(ctx, list, NULL);
14953 /**********************************************************************/
14954 /***** Initialization *****/
14955 /**********************************************************************/
14958 _mesa_install_dlist_vtxfmt(struct _glapi_table *disp,
14959 const GLvertexformat *vfmt)
14961 SET_CallList(disp, vfmt->CallList);
14962 SET_CallLists(disp, vfmt->CallLists);
14967 * Initialize display list state for given context.
14970 _mesa_init_display_list(struct gl_context *ctx)
14972 GLvertexformat *vfmt = &ctx->ListState.ListVtxfmt;
14975 ctx->ListState.CallDepth = 0;
14976 ctx->ExecuteFlag = GL_TRUE;
14977 ctx->CompileFlag = GL_FALSE;
14978 ctx->ListState.CurrentBlock = NULL;
14979 ctx->ListState.CurrentPos = 0;
14981 /* Display List group */
14982 ctx->List.ListBase = 0;
14984 #define NAME_AE(x) _ae_##x
14985 #define NAME_CALLLIST(x) save_##x
14986 #define NAME(x) save_##x
14987 #define NAME_ES(x) save_##x##ARB
14989 #include "vbo/vbo_init_tmp.h"