2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2007 Brian Paul 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 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 * Display lists management functions.
33 #include "api_arrayelt.h"
34 #include "api_loopback.h"
36 #include "mfeatures.h"
40 #if FEATURE_ARB_vertex_buffer_object
41 #include "bufferobj.h"
53 #include "extensions.h"
55 #include "framebuffer.h"
57 #include "glapi/glapi.h"
59 #include "histogram.h"
76 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
77 #include "shader/arbprogram.h"
78 #include "shader/program.h"
80 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
81 #include "shader/nvprogram.h"
82 #include "shader/program.h"
84 #if FEATURE_ATI_fragment_shader
85 #include "shader/atifragshader.h"
88 #include "math/m_matrix.h"
90 #include "glapi/dispatch.h"
96 * \param ctx GL context.
98 * Checks if dd_function_table::SaveNeedFlush is marked to flush
99 * stored (save) vertices, and calls
100 * dd_function_table::SaveFlushVertices if so.
102 #define SAVE_FLUSH_VERTICES(ctx) \
104 if (ctx->Driver.SaveNeedFlush) \
105 ctx->Driver.SaveFlushVertices(ctx); \
110 * Macro to assert that the API call was made outside the
111 * glBegin()/glEnd() pair, with return value.
113 * \param ctx GL context.
114 * \param retval value to return value in case the assertion fails.
116 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
118 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
119 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
120 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
126 * Macro to assert that the API call was made outside the
127 * glBegin()/glEnd() pair.
129 * \param ctx GL context.
131 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
133 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
134 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
135 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
141 * Macro to assert that the API call was made outside the
142 * glBegin()/glEnd() pair and flush the vertices.
144 * \param ctx GL context.
146 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
148 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
149 SAVE_FLUSH_VERTICES(ctx); \
153 * Macro to assert that the API call was made outside the
154 * glBegin()/glEnd() pair and flush the vertices, with return value.
156 * \param ctx GL context.
157 * \param retval value to return value in case the assertion fails.
159 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
161 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
162 SAVE_FLUSH_VERTICES(ctx); \
168 * Display list opcodes.
170 * The fact that these identifiers are assigned consecutive
171 * integer values starting at 0 is very important, see InstSize array usage)
175 OPCODE_INVALID
= -1, /* Force signed enum */
181 OPCODE_BLEND_EQUATION
,
182 OPCODE_BLEND_EQUATION_SEPARATE
,
183 OPCODE_BLEND_FUNC_SEPARATE
,
185 OPCODE_CALL_LIST_OFFSET
,
191 OPCODE_CLEAR_STENCIL
,
194 OPCODE_COLOR_MATERIAL
,
196 OPCODE_COLOR_TABLE_PARAMETER_FV
,
197 OPCODE_COLOR_TABLE_PARAMETER_IV
,
198 OPCODE_COLOR_SUB_TABLE
,
199 OPCODE_CONVOLUTION_FILTER_1D
,
200 OPCODE_CONVOLUTION_FILTER_2D
,
201 OPCODE_CONVOLUTION_PARAMETER_I
,
202 OPCODE_CONVOLUTION_PARAMETER_IV
,
203 OPCODE_CONVOLUTION_PARAMETER_F
,
204 OPCODE_CONVOLUTION_PARAMETER_FV
,
205 OPCODE_COPY_COLOR_SUB_TABLE
,
206 OPCODE_COPY_COLOR_TABLE
,
208 OPCODE_COPY_TEX_IMAGE1D
,
209 OPCODE_COPY_TEX_IMAGE2D
,
210 OPCODE_COPY_TEX_SUB_IMAGE1D
,
211 OPCODE_COPY_TEX_SUB_IMAGE2D
,
212 OPCODE_COPY_TEX_SUB_IMAGE3D
,
235 OPCODE_LOAD_IDENTITY
,
249 OPCODE_PIXEL_TRANSFER
,
252 OPCODE_POINT_PARAMETERS
,
254 OPCODE_POLYGON_STIPPLE
,
255 OPCODE_POLYGON_OFFSET
,
259 OPCODE_PRIORITIZE_TEXTURE
,
265 OPCODE_RESET_HISTOGRAM
,
266 OPCODE_RESET_MIN_MAX
,
270 OPCODE_SELECT_TEXTURE_SGIS
,
271 OPCODE_SELECT_TEXTURE_COORD_SET
,
282 OPCODE_TEX_SUB_IMAGE1D
,
283 OPCODE_TEX_SUB_IMAGE2D
,
284 OPCODE_TEX_SUB_IMAGE3D
,
288 /* GL_ARB_multitexture */
289 OPCODE_ACTIVE_TEXTURE
,
290 /* GL_ARB_texture_compression */
291 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
292 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
293 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
294 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
295 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
296 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
297 /* GL_ARB_multisample */
298 OPCODE_SAMPLE_COVERAGE
,
299 /* GL_ARB_window_pos */
300 OPCODE_WINDOW_POS_ARB
,
301 /* GL_NV_vertex_program */
302 OPCODE_BIND_PROGRAM_NV
,
303 OPCODE_EXECUTE_PROGRAM_NV
,
304 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
305 OPCODE_LOAD_PROGRAM_NV
,
306 OPCODE_TRACK_MATRIX_NV
,
307 /* GL_NV_fragment_program */
308 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
309 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
310 /* GL_EXT_stencil_two_side */
311 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
312 /* GL_EXT_depth_bounds_test */
313 OPCODE_DEPTH_BOUNDS_EXT
,
314 /* GL_ARB_vertex/fragment_program */
315 OPCODE_PROGRAM_STRING_ARB
,
316 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
317 /* GL_ARB_occlusion_query */
318 OPCODE_BEGIN_QUERY_ARB
,
319 OPCODE_END_QUERY_ARB
,
320 /* GL_ARB_draw_buffers */
321 OPCODE_DRAW_BUFFERS_ARB
,
322 /* GL_ATI_fragment_shader */
323 OPCODE_TEX_BUMP_PARAMETER_ATI
,
324 /* GL_ATI_fragment_shader */
325 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
326 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
328 OPCODE_STENCIL_FUNC_SEPARATE
,
329 OPCODE_STENCIL_OP_SEPARATE
,
330 OPCODE_STENCIL_MASK_SEPARATE
,
332 /* GL_ARB_shader_objects */
351 /* GL_EXT_framebuffer_blit */
352 OPCODE_BLIT_FRAMEBUFFER
,
354 /* Vertex attributes -- fallback for when optimized display
355 * list build isn't active.
374 /* The following three are meta instructions */
375 OPCODE_ERROR
, /* raise compiled-in error */
386 * Display list instructions are stored as sequences of "nodes". Nodes
387 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
388 * are linked together with a pointer.
390 * Each instruction in the display list is stored as a sequence of
391 * contiguous nodes in memory.
392 * Each node is the union of a variety of data types.
407 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
411 typedef union gl_dlist_node Node
;
415 * How many nodes to allocate at a time.
417 * \note Reduced now that we hold vertices etc. elsewhere.
419 #define BLOCK_SIZE 256
424 * Number of nodes of storage needed for each instruction.
425 * Sizes for dynamically allocated opcodes are stored in the context struct.
427 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
429 void mesa_print_display_list(GLuint list
);
432 /**********************************************************************/
433 /***** Private *****/
434 /**********************************************************************/
438 * Make an empty display list. This is used by glGenLists() to
439 * reserve display list IDs.
441 static struct gl_display_list
*
442 make_list(GLuint name
, GLuint count
)
444 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
446 dlist
->Head
= (Node
*) _mesa_malloc(sizeof(Node
) * count
);
447 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
453 * Lookup function to just encapsulate casting.
455 static INLINE
struct gl_display_list
*
456 lookup_list(GLcontext
*ctx
, GLuint list
)
458 return (struct gl_display_list
*)
459 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
465 * Delete the named display list, but don't remove from hash table.
466 * \param dlist - display list pointer
469 _mesa_delete_list(GLcontext
*ctx
, struct gl_display_list
*dlist
)
474 n
= block
= dlist
->Head
;
476 done
= block
? GL_FALSE
: GL_TRUE
;
479 /* check for extension opcodes first */
481 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
482 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
483 ctx
->ListExt
.Opcode
[i
].Destroy(ctx
, &n
[1]);
484 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
487 switch (n
[0].opcode
) {
488 /* for some commands, we need to free malloc'd memory */
490 _mesa_free(n
[6].data
);
491 n
+= InstSize
[n
[0].opcode
];
494 _mesa_free(n
[10].data
);
495 n
+= InstSize
[n
[0].opcode
];
497 case OPCODE_DRAW_PIXELS
:
498 _mesa_free(n
[5].data
);
499 n
+= InstSize
[n
[0].opcode
];
502 _mesa_free(n
[7].data
);
503 n
+= InstSize
[n
[0].opcode
];
505 case OPCODE_COLOR_TABLE
:
506 _mesa_free(n
[6].data
);
507 n
+= InstSize
[n
[0].opcode
];
509 case OPCODE_COLOR_SUB_TABLE
:
510 _mesa_free(n
[6].data
);
511 n
+= InstSize
[n
[0].opcode
];
513 case OPCODE_CONVOLUTION_FILTER_1D
:
514 _mesa_free(n
[6].data
);
515 n
+= InstSize
[n
[0].opcode
];
517 case OPCODE_CONVOLUTION_FILTER_2D
:
518 _mesa_free(n
[7].data
);
519 n
+= InstSize
[n
[0].opcode
];
521 case OPCODE_POLYGON_STIPPLE
:
522 _mesa_free(n
[1].data
);
523 n
+= InstSize
[n
[0].opcode
];
525 case OPCODE_TEX_IMAGE1D
:
526 _mesa_free(n
[8].data
);
527 n
+= InstSize
[n
[0].opcode
];
529 case OPCODE_TEX_IMAGE2D
:
530 _mesa_free(n
[9].data
);
531 n
+= InstSize
[n
[0].opcode
];
533 case OPCODE_TEX_IMAGE3D
:
534 _mesa_free(n
[10].data
);
535 n
+= InstSize
[n
[0].opcode
];
537 case OPCODE_TEX_SUB_IMAGE1D
:
538 _mesa_free(n
[7].data
);
539 n
+= InstSize
[n
[0].opcode
];
541 case OPCODE_TEX_SUB_IMAGE2D
:
542 _mesa_free(n
[9].data
);
543 n
+= InstSize
[n
[0].opcode
];
545 case OPCODE_TEX_SUB_IMAGE3D
:
546 _mesa_free(n
[11].data
);
547 n
+= InstSize
[n
[0].opcode
];
549 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
550 _mesa_free(n
[7].data
);
551 n
+= InstSize
[n
[0].opcode
];
553 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
554 _mesa_free(n
[8].data
);
555 n
+= InstSize
[n
[0].opcode
];
557 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
558 _mesa_free(n
[9].data
);
559 n
+= InstSize
[n
[0].opcode
];
561 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
562 _mesa_free(n
[7].data
);
563 n
+= InstSize
[n
[0].opcode
];
565 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
566 _mesa_free(n
[9].data
);
567 n
+= InstSize
[n
[0].opcode
];
569 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
570 _mesa_free(n
[11].data
);
571 n
+= InstSize
[n
[0].opcode
];
573 #if FEATURE_NV_vertex_program
574 case OPCODE_LOAD_PROGRAM_NV
:
575 _mesa_free(n
[4].data
); /* program string */
576 n
+= InstSize
[n
[0].opcode
];
578 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
579 _mesa_free(n
[2].data
); /* array of program ids */
580 n
+= InstSize
[n
[0].opcode
];
583 #if FEATURE_NV_fragment_program
584 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
585 _mesa_free(n
[3].data
); /* parameter name */
586 n
+= InstSize
[n
[0].opcode
];
589 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
590 case OPCODE_PROGRAM_STRING_ARB
:
591 _mesa_free(n
[4].data
); /* program string */
592 n
+= InstSize
[n
[0].opcode
];
595 case OPCODE_UNIFORM_1FV
:
596 case OPCODE_UNIFORM_2FV
:
597 case OPCODE_UNIFORM_3FV
:
598 case OPCODE_UNIFORM_4FV
:
599 case OPCODE_UNIFORM_1IV
:
600 case OPCODE_UNIFORM_2IV
:
601 case OPCODE_UNIFORM_3IV
:
602 case OPCODE_UNIFORM_4IV
:
603 _mesa_free(n
[3].data
);
604 n
+= InstSize
[n
[0].opcode
];
607 case OPCODE_CONTINUE
:
608 n
= (Node
*) n
[1].next
;
612 case OPCODE_END_OF_LIST
:
617 /* Most frequent case */
618 n
+= InstSize
[n
[0].opcode
];
629 * Destroy a display list and remove from hash table.
630 * \param list - display list number
633 destroy_list(GLcontext
*ctx
, GLuint list
)
635 struct gl_display_list
*dlist
;
640 dlist
= lookup_list(ctx
, list
);
644 _mesa_delete_list(ctx
, dlist
);
645 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
650 * Translate the nth element of list from <type> to GLint.
653 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
665 bptr
= (GLbyte
*) list
;
666 return (GLint
) bptr
[n
];
667 case GL_UNSIGNED_BYTE
:
668 ubptr
= (GLubyte
*) list
;
669 return (GLint
) ubptr
[n
];
671 sptr
= (GLshort
*) list
;
672 return (GLint
) sptr
[n
];
673 case GL_UNSIGNED_SHORT
:
674 usptr
= (GLushort
*) list
;
675 return (GLint
) usptr
[n
];
677 iptr
= (GLint
*) list
;
679 case GL_UNSIGNED_INT
:
680 uiptr
= (GLuint
*) list
;
681 return (GLint
) uiptr
[n
];
683 fptr
= (GLfloat
*) list
;
684 return (GLint
) FLOORF(fptr
[n
]);
686 ubptr
= ((GLubyte
*) list
) + 2 * n
;
687 return (GLint
) ubptr
[0] * 256
690 ubptr
= ((GLubyte
*) list
) + 3 * n
;
691 return (GLint
) ubptr
[0] * 65536
692 + (GLint
) ubptr
[1] * 256
695 ubptr
= ((GLubyte
*) list
) + 4 * n
;
696 return (GLint
) ubptr
[0] * 16777216
697 + (GLint
) ubptr
[1] * 65536
698 + (GLint
) ubptr
[2] * 256
708 /**********************************************************************/
710 /**********************************************************************/
713 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
714 * If we run out of memory, GL_OUT_OF_MEMORY will be recorded.
717 unpack_image(GLcontext
*ctx
, GLuint dimensions
,
718 GLsizei width
, GLsizei height
, GLsizei depth
,
719 GLenum format
, GLenum type
, const GLvoid
* pixels
,
720 const struct gl_pixelstore_attrib
*unpack
)
722 if (unpack
->BufferObj
->Name
== 0) {
724 GLvoid
*image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
725 format
, type
, pixels
, unpack
);
726 if (pixels
&& !image
) {
727 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
731 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
, depth
,
732 format
, type
, pixels
)) {
733 const GLubyte
*map
, *src
;
737 ctx
->Driver
.MapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
738 GL_READ_ONLY_ARB
, unpack
->BufferObj
);
740 /* unable to map src buffer! */
741 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
745 src
= ADD_POINTERS(map
, pixels
);
746 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
747 format
, type
, src
, unpack
);
749 ctx
->Driver
.UnmapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
753 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
763 * Allocate space for a display list instruction.
764 * \param opcode the instruction opcode (OPCODE_* value)
765 * \param bytes instruction size in bytes, not counting opcode.
766 * \return pointer to the usable data area (not including the internal
770 _mesa_alloc_instruction(GLcontext
*ctx
, GLuint opcode
, GLuint bytes
)
772 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
775 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
776 if (InstSize
[opcode
] == 0) {
777 /* save instruction size now */
778 InstSize
[opcode
] = numNodes
;
781 /* make sure instruction size agrees */
782 ASSERT(numNodes
== InstSize
[opcode
]);
786 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
787 /* This block is full. Allocate a new block and chain to it */
789 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
790 n
[0].opcode
= OPCODE_CONTINUE
;
791 newblock
= (Node
*) _mesa_malloc(sizeof(Node
) * BLOCK_SIZE
);
793 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
796 n
[1].next
= (Node
*) newblock
;
797 ctx
->ListState
.CurrentBlock
= newblock
;
798 ctx
->ListState
.CurrentPos
= 0;
801 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
802 ctx
->ListState
.CurrentPos
+= numNodes
;
804 n
[0].opcode
= (OpCode
) opcode
;
806 return (void *) (n
+ 1); /* return ptr to node following opcode */
811 * This function allows modules and drivers to get their own opcodes
812 * for extending display list functionality.
813 * \param ctx the rendering context
814 * \param size number of bytes for storing the new display list command
815 * \param execute function to execute the new display list command
816 * \param destroy function to destroy the new display list command
817 * \param print function to print the new display list command
818 * \return the new opcode number or -1 if error
821 _mesa_alloc_opcode(GLcontext
*ctx
,
823 void (*execute
) (GLcontext
*, void *),
824 void (*destroy
) (GLcontext
*, void *),
825 void (*print
) (GLcontext
*, void *))
827 if (ctx
->ListExt
.NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
828 const GLuint i
= ctx
->ListExt
.NumOpcodes
++;
829 ctx
->ListExt
.Opcode
[i
].Size
=
830 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
831 ctx
->ListExt
.Opcode
[i
].Execute
= execute
;
832 ctx
->ListExt
.Opcode
[i
].Destroy
= destroy
;
833 ctx
->ListExt
.Opcode
[i
].Print
= print
;
834 return i
+ OPCODE_EXT_0
;
842 * Allocate display list instruction. Returns Node ptr to where the opcode
844 * - nParams is the number of function parameters
845 * - return value a pointer to sizeof(Node) before the actual
848 #define ALLOC_INSTRUCTION(CTX, OPCODE, NPARAMS) \
849 ((Node *)_mesa_alloc_instruction(CTX, OPCODE, (NPARAMS)*sizeof(Node)) - 1)
854 * Display List compilation functions
856 static void GLAPIENTRY
857 save_Accum(GLenum op
, GLfloat value
)
859 GET_CURRENT_CONTEXT(ctx
);
861 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
862 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACCUM
, 2);
867 if (ctx
->ExecuteFlag
) {
868 CALL_Accum(ctx
->Exec
, (op
, value
));
873 static void GLAPIENTRY
874 save_AlphaFunc(GLenum func
, GLclampf ref
)
876 GET_CURRENT_CONTEXT(ctx
);
878 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
879 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ALPHA_FUNC
, 2);
882 n
[2].f
= (GLfloat
) ref
;
884 if (ctx
->ExecuteFlag
) {
885 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
890 static void GLAPIENTRY
891 save_BindTexture(GLenum target
, GLuint texture
)
893 GET_CURRENT_CONTEXT(ctx
);
895 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
896 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_TEXTURE
, 2);
901 if (ctx
->ExecuteFlag
) {
902 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
907 static void GLAPIENTRY
908 save_Bitmap(GLsizei width
, GLsizei height
,
909 GLfloat xorig
, GLfloat yorig
,
910 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
912 GET_CURRENT_CONTEXT(ctx
);
914 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
915 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BITMAP
, 7);
917 n
[1].i
= (GLint
) width
;
918 n
[2].i
= (GLint
) height
;
923 n
[7].data
= _mesa_unpack_bitmap(width
, height
, pixels
, &ctx
->Unpack
);
925 if (ctx
->ExecuteFlag
) {
926 CALL_Bitmap(ctx
->Exec
, (width
, height
,
927 xorig
, yorig
, xmove
, ymove
, pixels
));
932 static void GLAPIENTRY
933 save_BlendEquation(GLenum mode
)
935 GET_CURRENT_CONTEXT(ctx
);
937 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
938 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_EQUATION
, 1);
942 if (ctx
->ExecuteFlag
) {
943 CALL_BlendEquation(ctx
->Exec
, (mode
));
948 static void GLAPIENTRY
949 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
951 GET_CURRENT_CONTEXT(ctx
);
953 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
954 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
959 if (ctx
->ExecuteFlag
) {
960 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
965 static void GLAPIENTRY
966 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
967 GLenum sfactorA
, GLenum dfactorA
)
969 GET_CURRENT_CONTEXT(ctx
);
971 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
972 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
979 if (ctx
->ExecuteFlag
) {
980 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
981 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
986 static void GLAPIENTRY
987 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
989 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
993 static void GLAPIENTRY
994 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
996 GET_CURRENT_CONTEXT(ctx
);
998 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
999 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_COLOR
, 4);
1006 if (ctx
->ExecuteFlag
) {
1007 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1011 static void invalidate_saved_current_state( GLcontext
*ctx
)
1015 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1016 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1018 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1019 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1021 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1023 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1027 _mesa_save_CallList(GLuint list
)
1029 GET_CURRENT_CONTEXT(ctx
);
1031 SAVE_FLUSH_VERTICES(ctx
);
1033 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CALL_LIST
, 1);
1038 /* After this, we don't know what state we're in. Invalidate all
1039 * cached information previously gathered:
1041 invalidate_saved_current_state( ctx
);
1043 if (ctx
->ExecuteFlag
) {
1044 _mesa_CallList(list
);
1050 _mesa_save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1052 GET_CURRENT_CONTEXT(ctx
);
1054 GLboolean typeErrorFlag
;
1056 SAVE_FLUSH_VERTICES(ctx
);
1060 case GL_UNSIGNED_BYTE
:
1062 case GL_UNSIGNED_SHORT
:
1064 case GL_UNSIGNED_INT
:
1069 typeErrorFlag
= GL_FALSE
;
1072 typeErrorFlag
= GL_TRUE
;
1075 for (i
= 0; i
< num
; i
++) {
1076 GLint list
= translate_id(i
, type
, lists
);
1077 Node
*n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1080 n
[2].b
= typeErrorFlag
;
1084 /* After this, we don't know what state we're in. Invalidate all
1085 * cached information previously gathered:
1087 invalidate_saved_current_state( ctx
);
1089 if (ctx
->ExecuteFlag
) {
1090 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1095 static void GLAPIENTRY
1096 save_Clear(GLbitfield mask
)
1098 GET_CURRENT_CONTEXT(ctx
);
1100 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1101 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR
, 1);
1105 if (ctx
->ExecuteFlag
) {
1106 CALL_Clear(ctx
->Exec
, (mask
));
1111 static void GLAPIENTRY
1112 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1114 GET_CURRENT_CONTEXT(ctx
);
1116 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1117 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1124 if (ctx
->ExecuteFlag
) {
1125 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1130 static void GLAPIENTRY
1131 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1133 GET_CURRENT_CONTEXT(ctx
);
1135 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1136 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_COLOR
, 4);
1143 if (ctx
->ExecuteFlag
) {
1144 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1149 static void GLAPIENTRY
1150 save_ClearDepth(GLclampd depth
)
1152 GET_CURRENT_CONTEXT(ctx
);
1154 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1155 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1157 n
[1].f
= (GLfloat
) depth
;
1159 if (ctx
->ExecuteFlag
) {
1160 CALL_ClearDepth(ctx
->Exec
, (depth
));
1165 static void GLAPIENTRY
1166 save_ClearIndex(GLfloat c
)
1168 GET_CURRENT_CONTEXT(ctx
);
1170 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1171 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_INDEX
, 1);
1175 if (ctx
->ExecuteFlag
) {
1176 CALL_ClearIndex(ctx
->Exec
, (c
));
1181 static void GLAPIENTRY
1182 save_ClearStencil(GLint s
)
1184 GET_CURRENT_CONTEXT(ctx
);
1186 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1187 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1191 if (ctx
->ExecuteFlag
) {
1192 CALL_ClearStencil(ctx
->Exec
, (s
));
1197 static void GLAPIENTRY
1198 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1200 GET_CURRENT_CONTEXT(ctx
);
1202 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1203 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLIP_PLANE
, 5);
1206 n
[2].f
= (GLfloat
) equ
[0];
1207 n
[3].f
= (GLfloat
) equ
[1];
1208 n
[4].f
= (GLfloat
) equ
[2];
1209 n
[5].f
= (GLfloat
) equ
[3];
1211 if (ctx
->ExecuteFlag
) {
1212 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1218 static void GLAPIENTRY
1219 save_ColorMask(GLboolean red
, GLboolean green
,
1220 GLboolean blue
, GLboolean alpha
)
1222 GET_CURRENT_CONTEXT(ctx
);
1224 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1225 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_MASK
, 4);
1232 if (ctx
->ExecuteFlag
) {
1233 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1238 static void GLAPIENTRY
1239 save_ColorMaterial(GLenum face
, GLenum mode
)
1241 GET_CURRENT_CONTEXT(ctx
);
1243 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1245 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1250 if (ctx
->ExecuteFlag
) {
1251 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1256 static void GLAPIENTRY
1257 save_ColorTable(GLenum target
, GLenum internalFormat
,
1258 GLsizei width
, GLenum format
, GLenum type
,
1259 const GLvoid
* table
)
1261 GET_CURRENT_CONTEXT(ctx
);
1262 if (_mesa_is_proxy_texture(target
)) {
1263 /* execute immediately */
1264 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1265 format
, type
, table
));
1269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1270 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE
, 6);
1273 n
[2].e
= internalFormat
;
1277 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, table
,
1280 if (ctx
->ExecuteFlag
) {
1281 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1282 format
, type
, table
));
1289 static void GLAPIENTRY
1290 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1291 const GLfloat
*params
)
1293 GET_CURRENT_CONTEXT(ctx
);
1296 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1298 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1303 if (pname
== GL_COLOR_TABLE_SGI
||
1304 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1305 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1306 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1313 if (ctx
->ExecuteFlag
) {
1314 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1319 static void GLAPIENTRY
1320 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1322 GET_CURRENT_CONTEXT(ctx
);
1325 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1327 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1332 if (pname
== GL_COLOR_TABLE_SGI
||
1333 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1334 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1335 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1342 if (ctx
->ExecuteFlag
) {
1343 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1349 static void GLAPIENTRY
1350 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1351 GLenum format
, GLenum type
, const GLvoid
* table
)
1353 GET_CURRENT_CONTEXT(ctx
);
1355 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1356 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1363 n
[6].data
= unpack_image(ctx
, 1, count
, 1, 1, format
, type
, table
,
1366 if (ctx
->ExecuteFlag
) {
1367 CALL_ColorSubTable(ctx
->Exec
,
1368 (target
, start
, count
, format
, type
, table
));
1373 static void GLAPIENTRY
1374 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1375 GLint x
, GLint y
, GLsizei width
)
1377 GET_CURRENT_CONTEXT(ctx
);
1380 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1381 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1389 if (ctx
->ExecuteFlag
) {
1390 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1395 static void GLAPIENTRY
1396 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1397 GLint x
, GLint y
, GLsizei width
)
1399 GET_CURRENT_CONTEXT(ctx
);
1402 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1403 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1406 n
[2].e
= internalformat
;
1411 if (ctx
->ExecuteFlag
) {
1412 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1417 static void GLAPIENTRY
1418 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1419 GLenum format
, GLenum type
, const GLvoid
* filter
)
1421 GET_CURRENT_CONTEXT(ctx
);
1424 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1426 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1429 n
[2].e
= internalFormat
;
1433 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, filter
,
1436 if (ctx
->ExecuteFlag
) {
1437 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1438 format
, type
, filter
));
1443 static void GLAPIENTRY
1444 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1445 GLsizei width
, GLsizei height
, GLenum format
,
1446 GLenum type
, const GLvoid
* filter
)
1448 GET_CURRENT_CONTEXT(ctx
);
1451 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1453 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1456 n
[2].e
= internalFormat
;
1461 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
, filter
,
1464 if (ctx
->ExecuteFlag
) {
1465 CALL_ConvolutionFilter2D(ctx
->Exec
,
1466 (target
, internalFormat
, width
, height
, format
,
1472 static void GLAPIENTRY
1473 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1475 GET_CURRENT_CONTEXT(ctx
);
1477 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1478 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1484 if (ctx
->ExecuteFlag
) {
1485 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1490 static void GLAPIENTRY
1491 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1493 GET_CURRENT_CONTEXT(ctx
);
1495 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1496 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1501 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1502 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1503 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1509 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1512 if (ctx
->ExecuteFlag
) {
1513 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1518 static void GLAPIENTRY
1519 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1521 GET_CURRENT_CONTEXT(ctx
);
1523 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1524 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
1530 if (ctx
->ExecuteFlag
) {
1531 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
1536 static void GLAPIENTRY
1537 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
1538 const GLfloat
*params
)
1540 GET_CURRENT_CONTEXT(ctx
);
1542 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1543 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
1548 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1549 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1550 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1556 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1559 if (ctx
->ExecuteFlag
) {
1560 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
1565 static void GLAPIENTRY
1566 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1568 GET_CURRENT_CONTEXT(ctx
);
1570 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1571 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_PIXELS
, 5);
1575 n
[3].i
= (GLint
) width
;
1576 n
[4].i
= (GLint
) height
;
1579 if (ctx
->ExecuteFlag
) {
1580 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1586 static void GLAPIENTRY
1587 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1588 GLint x
, GLint y
, GLsizei width
, GLint border
)
1590 GET_CURRENT_CONTEXT(ctx
);
1592 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1593 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1597 n
[3].e
= internalformat
;
1603 if (ctx
->ExecuteFlag
) {
1604 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1605 x
, y
, width
, border
));
1610 static void GLAPIENTRY
1611 save_CopyTexImage2D(GLenum target
, GLint level
,
1612 GLenum internalformat
,
1613 GLint x
, GLint y
, GLsizei width
,
1614 GLsizei height
, GLint border
)
1616 GET_CURRENT_CONTEXT(ctx
);
1618 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1619 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1623 n
[3].e
= internalformat
;
1630 if (ctx
->ExecuteFlag
) {
1631 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1632 x
, y
, width
, height
, border
));
1638 static void GLAPIENTRY
1639 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1640 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1642 GET_CURRENT_CONTEXT(ctx
);
1644 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1645 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1654 if (ctx
->ExecuteFlag
) {
1655 CALL_CopyTexSubImage1D(ctx
->Exec
,
1656 (target
, level
, xoffset
, x
, y
, width
));
1661 static void GLAPIENTRY
1662 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1663 GLint xoffset
, GLint yoffset
,
1664 GLint x
, GLint y
, GLsizei width
, GLint height
)
1666 GET_CURRENT_CONTEXT(ctx
);
1668 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1669 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1680 if (ctx
->ExecuteFlag
) {
1681 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1682 x
, y
, width
, height
));
1687 static void GLAPIENTRY
1688 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1689 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1690 GLint x
, GLint y
, GLsizei width
, GLint height
)
1692 GET_CURRENT_CONTEXT(ctx
);
1694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1695 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1707 if (ctx
->ExecuteFlag
) {
1708 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1709 xoffset
, yoffset
, zoffset
,
1710 x
, y
, width
, height
));
1715 static void GLAPIENTRY
1716 save_CullFace(GLenum mode
)
1718 GET_CURRENT_CONTEXT(ctx
);
1720 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1721 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CULL_FACE
, 1);
1725 if (ctx
->ExecuteFlag
) {
1726 CALL_CullFace(ctx
->Exec
, (mode
));
1731 static void GLAPIENTRY
1732 save_DepthFunc(GLenum func
)
1734 GET_CURRENT_CONTEXT(ctx
);
1736 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1737 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_FUNC
, 1);
1741 if (ctx
->ExecuteFlag
) {
1742 CALL_DepthFunc(ctx
->Exec
, (func
));
1747 static void GLAPIENTRY
1748 save_DepthMask(GLboolean mask
)
1750 GET_CURRENT_CONTEXT(ctx
);
1752 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1753 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_MASK
, 1);
1757 if (ctx
->ExecuteFlag
) {
1758 CALL_DepthMask(ctx
->Exec
, (mask
));
1763 static void GLAPIENTRY
1764 save_DepthRange(GLclampd nearval
, GLclampd farval
)
1766 GET_CURRENT_CONTEXT(ctx
);
1768 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1769 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_RANGE
, 2);
1771 n
[1].f
= (GLfloat
) nearval
;
1772 n
[2].f
= (GLfloat
) farval
;
1774 if (ctx
->ExecuteFlag
) {
1775 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
1780 static void GLAPIENTRY
1781 save_Disable(GLenum cap
)
1783 GET_CURRENT_CONTEXT(ctx
);
1785 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1786 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DISABLE
, 1);
1790 if (ctx
->ExecuteFlag
) {
1791 CALL_Disable(ctx
->Exec
, (cap
));
1796 static void GLAPIENTRY
1797 save_DrawBuffer(GLenum mode
)
1799 GET_CURRENT_CONTEXT(ctx
);
1801 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1802 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFER
, 1);
1806 if (ctx
->ExecuteFlag
) {
1807 CALL_DrawBuffer(ctx
->Exec
, (mode
));
1812 static void GLAPIENTRY
1813 save_DrawPixels(GLsizei width
, GLsizei height
,
1814 GLenum format
, GLenum type
, const GLvoid
* pixels
)
1816 GET_CURRENT_CONTEXT(ctx
);
1819 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1821 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_PIXELS
, 5);
1827 n
[5].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
1828 pixels
, &ctx
->Unpack
);
1830 if (ctx
->ExecuteFlag
) {
1831 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
1837 static void GLAPIENTRY
1838 save_Enable(GLenum cap
)
1840 GET_CURRENT_CONTEXT(ctx
);
1842 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1843 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ENABLE
, 1);
1847 if (ctx
->ExecuteFlag
) {
1848 CALL_Enable(ctx
->Exec
, (cap
));
1854 static void GLAPIENTRY
1855 _mesa_save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
1857 GET_CURRENT_CONTEXT(ctx
);
1859 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1860 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVALMESH1
, 3);
1866 if (ctx
->ExecuteFlag
) {
1867 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
1872 static void GLAPIENTRY
1873 _mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1875 GET_CURRENT_CONTEXT(ctx
);
1877 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1878 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVALMESH2
, 5);
1886 if (ctx
->ExecuteFlag
) {
1887 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
1894 static void GLAPIENTRY
1895 save_Fogfv(GLenum pname
, const GLfloat
*params
)
1897 GET_CURRENT_CONTEXT(ctx
);
1899 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1900 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FOG
, 5);
1908 if (ctx
->ExecuteFlag
) {
1909 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
1914 static void GLAPIENTRY
1915 save_Fogf(GLenum pname
, GLfloat param
)
1919 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
1920 save_Fogfv(pname
, parray
);
1924 static void GLAPIENTRY
1925 save_Fogiv(GLenum pname
, const GLint
*params
)
1930 case GL_FOG_DENSITY
:
1934 p
[0] = (GLfloat
) *params
;
1937 p
[0] = INT_TO_FLOAT(params
[0]);
1938 p
[1] = INT_TO_FLOAT(params
[1]);
1939 p
[2] = INT_TO_FLOAT(params
[2]);
1940 p
[3] = INT_TO_FLOAT(params
[3]);
1943 /* Error will be caught later in gl_Fogfv */
1944 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
1946 save_Fogfv(pname
, p
);
1950 static void GLAPIENTRY
1951 save_Fogi(GLenum pname
, GLint param
)
1955 parray
[1] = parray
[2] = parray
[3] = 0;
1956 save_Fogiv(pname
, parray
);
1960 static void GLAPIENTRY
1961 save_FrontFace(GLenum mode
)
1963 GET_CURRENT_CONTEXT(ctx
);
1965 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1966 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FRONT_FACE
, 1);
1970 if (ctx
->ExecuteFlag
) {
1971 CALL_FrontFace(ctx
->Exec
, (mode
));
1976 static void GLAPIENTRY
1977 save_Frustum(GLdouble left
, GLdouble right
,
1978 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
1980 GET_CURRENT_CONTEXT(ctx
);
1982 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1983 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FRUSTUM
, 6);
1985 n
[1].f
= (GLfloat
) left
;
1986 n
[2].f
= (GLfloat
) right
;
1987 n
[3].f
= (GLfloat
) bottom
;
1988 n
[4].f
= (GLfloat
) top
;
1989 n
[5].f
= (GLfloat
) nearval
;
1990 n
[6].f
= (GLfloat
) farval
;
1992 if (ctx
->ExecuteFlag
) {
1993 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
1998 static void GLAPIENTRY
1999 save_Hint(GLenum target
, GLenum mode
)
2001 GET_CURRENT_CONTEXT(ctx
);
2003 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2004 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_HINT
, 2);
2009 if (ctx
->ExecuteFlag
) {
2010 CALL_Hint(ctx
->Exec
, (target
, mode
));
2015 static void GLAPIENTRY
2016 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
2019 GET_CURRENT_CONTEXT(ctx
);
2022 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2023 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_HISTOGRAM
, 4);
2027 n
[3].e
= internalFormat
;
2030 if (ctx
->ExecuteFlag
) {
2031 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
2036 static void GLAPIENTRY
2037 save_IndexMask(GLuint mask
)
2039 GET_CURRENT_CONTEXT(ctx
);
2041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2042 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_INDEX_MASK
, 1);
2046 if (ctx
->ExecuteFlag
) {
2047 CALL_IndexMask(ctx
->Exec
, (mask
));
2052 static void GLAPIENTRY
2053 save_InitNames(void)
2055 GET_CURRENT_CONTEXT(ctx
);
2056 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2057 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_INIT_NAMES
, 0);
2058 if (ctx
->ExecuteFlag
) {
2059 CALL_InitNames(ctx
->Exec
, ());
2064 static void GLAPIENTRY
2065 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2067 GET_CURRENT_CONTEXT(ctx
);
2069 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2070 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIGHT
, 6);
2088 case GL_SPOT_DIRECTION
:
2091 case GL_SPOT_EXPONENT
:
2094 case GL_SPOT_CUTOFF
:
2097 case GL_CONSTANT_ATTENUATION
:
2100 case GL_LINEAR_ATTENUATION
:
2103 case GL_QUADRATIC_ATTENUATION
:
2109 for (i
= 0; i
< nParams
; i
++) {
2110 n
[3 + i
].f
= params
[i
];
2113 if (ctx
->ExecuteFlag
) {
2114 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2119 static void GLAPIENTRY
2120 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2124 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2125 save_Lightfv(light
, pname
, parray
);
2129 static void GLAPIENTRY
2130 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2137 fparam
[0] = INT_TO_FLOAT(params
[0]);
2138 fparam
[1] = INT_TO_FLOAT(params
[1]);
2139 fparam
[2] = INT_TO_FLOAT(params
[2]);
2140 fparam
[3] = INT_TO_FLOAT(params
[3]);
2143 fparam
[0] = (GLfloat
) params
[0];
2144 fparam
[1] = (GLfloat
) params
[1];
2145 fparam
[2] = (GLfloat
) params
[2];
2146 fparam
[3] = (GLfloat
) params
[3];
2148 case GL_SPOT_DIRECTION
:
2149 fparam
[0] = (GLfloat
) params
[0];
2150 fparam
[1] = (GLfloat
) params
[1];
2151 fparam
[2] = (GLfloat
) params
[2];
2153 case GL_SPOT_EXPONENT
:
2154 case GL_SPOT_CUTOFF
:
2155 case GL_CONSTANT_ATTENUATION
:
2156 case GL_LINEAR_ATTENUATION
:
2157 case GL_QUADRATIC_ATTENUATION
:
2158 fparam
[0] = (GLfloat
) params
[0];
2161 /* error will be caught later in gl_Lightfv */
2164 save_Lightfv(light
, pname
, fparam
);
2168 static void GLAPIENTRY
2169 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2173 parray
[1] = parray
[2] = parray
[3] = 0;
2174 save_Lightiv(light
, pname
, parray
);
2178 static void GLAPIENTRY
2179 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2181 GET_CURRENT_CONTEXT(ctx
);
2183 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2184 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIGHT_MODEL
, 5);
2192 if (ctx
->ExecuteFlag
) {
2193 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2198 static void GLAPIENTRY
2199 save_LightModelf(GLenum pname
, GLfloat param
)
2203 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2204 save_LightModelfv(pname
, parray
);
2208 static void GLAPIENTRY
2209 save_LightModeliv(GLenum pname
, const GLint
*params
)
2213 case GL_LIGHT_MODEL_AMBIENT
:
2214 fparam
[0] = INT_TO_FLOAT(params
[0]);
2215 fparam
[1] = INT_TO_FLOAT(params
[1]);
2216 fparam
[2] = INT_TO_FLOAT(params
[2]);
2217 fparam
[3] = INT_TO_FLOAT(params
[3]);
2219 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2220 case GL_LIGHT_MODEL_TWO_SIDE
:
2221 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2222 fparam
[0] = (GLfloat
) params
[0];
2225 /* Error will be caught later in gl_LightModelfv */
2226 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2228 save_LightModelfv(pname
, fparam
);
2232 static void GLAPIENTRY
2233 save_LightModeli(GLenum pname
, GLint param
)
2237 parray
[1] = parray
[2] = parray
[3] = 0;
2238 save_LightModeliv(pname
, parray
);
2242 static void GLAPIENTRY
2243 save_LineStipple(GLint factor
, GLushort pattern
)
2245 GET_CURRENT_CONTEXT(ctx
);
2247 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2248 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LINE_STIPPLE
, 2);
2253 if (ctx
->ExecuteFlag
) {
2254 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2259 static void GLAPIENTRY
2260 save_LineWidth(GLfloat width
)
2262 GET_CURRENT_CONTEXT(ctx
);
2264 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2265 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LINE_WIDTH
, 1);
2269 if (ctx
->ExecuteFlag
) {
2270 CALL_LineWidth(ctx
->Exec
, (width
));
2275 static void GLAPIENTRY
2276 save_ListBase(GLuint base
)
2278 GET_CURRENT_CONTEXT(ctx
);
2280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2281 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIST_BASE
, 1);
2285 if (ctx
->ExecuteFlag
) {
2286 CALL_ListBase(ctx
->Exec
, (base
));
2291 static void GLAPIENTRY
2292 save_LoadIdentity(void)
2294 GET_CURRENT_CONTEXT(ctx
);
2295 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2296 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2297 if (ctx
->ExecuteFlag
) {
2298 CALL_LoadIdentity(ctx
->Exec
, ());
2303 static void GLAPIENTRY
2304 save_LoadMatrixf(const GLfloat
* m
)
2306 GET_CURRENT_CONTEXT(ctx
);
2308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2309 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_MATRIX
, 16);
2312 for (i
= 0; i
< 16; i
++) {
2316 if (ctx
->ExecuteFlag
) {
2317 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2322 static void GLAPIENTRY
2323 save_LoadMatrixd(const GLdouble
* m
)
2327 for (i
= 0; i
< 16; i
++) {
2328 f
[i
] = (GLfloat
) m
[i
];
2330 save_LoadMatrixf(f
);
2334 static void GLAPIENTRY
2335 save_LoadName(GLuint name
)
2337 GET_CURRENT_CONTEXT(ctx
);
2339 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2340 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_NAME
, 1);
2344 if (ctx
->ExecuteFlag
) {
2345 CALL_LoadName(ctx
->Exec
, (name
));
2350 static void GLAPIENTRY
2351 save_LogicOp(GLenum opcode
)
2353 GET_CURRENT_CONTEXT(ctx
);
2355 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2356 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOGIC_OP
, 1);
2360 if (ctx
->ExecuteFlag
) {
2361 CALL_LogicOp(ctx
->Exec
, (opcode
));
2366 static void GLAPIENTRY
2367 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2368 GLint order
, const GLdouble
* points
)
2370 GET_CURRENT_CONTEXT(ctx
);
2372 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2373 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP1
, 6);
2375 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2377 n
[2].f
= (GLfloat
) u1
;
2378 n
[3].f
= (GLfloat
) u2
;
2379 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2381 n
[6].data
= (void *) pnts
;
2383 if (ctx
->ExecuteFlag
) {
2384 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2388 static void GLAPIENTRY
2389 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2390 GLint order
, const GLfloat
* points
)
2392 GET_CURRENT_CONTEXT(ctx
);
2394 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2395 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP1
, 6);
2397 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2401 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2403 n
[6].data
= (void *) pnts
;
2405 if (ctx
->ExecuteFlag
) {
2406 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2411 static void GLAPIENTRY
2412 save_Map2d(GLenum target
,
2413 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2414 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2415 const GLdouble
* points
)
2417 GET_CURRENT_CONTEXT(ctx
);
2419 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2420 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP2
, 10);
2422 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2423 vstride
, vorder
, points
);
2425 n
[2].f
= (GLfloat
) u1
;
2426 n
[3].f
= (GLfloat
) u2
;
2427 n
[4].f
= (GLfloat
) v1
;
2428 n
[5].f
= (GLfloat
) v2
;
2429 /* XXX verify these strides are correct */
2430 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2431 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2434 n
[10].data
= (void *) pnts
;
2436 if (ctx
->ExecuteFlag
) {
2437 CALL_Map2d(ctx
->Exec
, (target
,
2438 u1
, u2
, ustride
, uorder
,
2439 v1
, v2
, vstride
, vorder
, points
));
2444 static void GLAPIENTRY
2445 save_Map2f(GLenum target
,
2446 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2447 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2448 const GLfloat
* points
)
2450 GET_CURRENT_CONTEXT(ctx
);
2452 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2453 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP2
, 10);
2455 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2456 vstride
, vorder
, points
);
2462 /* XXX verify these strides are correct */
2463 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2464 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2467 n
[10].data
= (void *) pnts
;
2469 if (ctx
->ExecuteFlag
) {
2470 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2471 v1
, v2
, vstride
, vorder
, points
));
2476 static void GLAPIENTRY
2477 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2479 GET_CURRENT_CONTEXT(ctx
);
2481 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2482 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAPGRID1
, 3);
2488 if (ctx
->ExecuteFlag
) {
2489 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2494 static void GLAPIENTRY
2495 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2497 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2501 static void GLAPIENTRY
2502 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2503 GLint vn
, GLfloat v1
, GLfloat v2
)
2505 GET_CURRENT_CONTEXT(ctx
);
2507 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2508 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAPGRID2
, 6);
2517 if (ctx
->ExecuteFlag
) {
2518 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2524 static void GLAPIENTRY
2525 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2526 GLint vn
, GLdouble v1
, GLdouble v2
)
2528 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2529 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2533 static void GLAPIENTRY
2534 save_MatrixMode(GLenum mode
)
2536 GET_CURRENT_CONTEXT(ctx
);
2538 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2539 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATRIX_MODE
, 1);
2543 if (ctx
->ExecuteFlag
) {
2544 CALL_MatrixMode(ctx
->Exec
, (mode
));
2549 static void GLAPIENTRY
2550 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2552 GET_CURRENT_CONTEXT(ctx
);
2555 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2556 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MIN_MAX
, 3);
2559 n
[2].e
= internalFormat
;
2562 if (ctx
->ExecuteFlag
) {
2563 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
2568 static void GLAPIENTRY
2569 save_MultMatrixf(const GLfloat
* m
)
2571 GET_CURRENT_CONTEXT(ctx
);
2573 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2574 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MULT_MATRIX
, 16);
2577 for (i
= 0; i
< 16; i
++) {
2581 if (ctx
->ExecuteFlag
) {
2582 CALL_MultMatrixf(ctx
->Exec
, (m
));
2587 static void GLAPIENTRY
2588 save_MultMatrixd(const GLdouble
* m
)
2592 for (i
= 0; i
< 16; i
++) {
2593 f
[i
] = (GLfloat
) m
[i
];
2595 save_MultMatrixf(f
);
2599 static void GLAPIENTRY
2600 save_NewList(GLuint name
, GLenum mode
)
2602 GET_CURRENT_CONTEXT(ctx
);
2603 /* It's an error to call this function while building a display list */
2604 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2611 static void GLAPIENTRY
2612 save_Ortho(GLdouble left
, GLdouble right
,
2613 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2615 GET_CURRENT_CONTEXT(ctx
);
2617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2618 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ORTHO
, 6);
2620 n
[1].f
= (GLfloat
) left
;
2621 n
[2].f
= (GLfloat
) right
;
2622 n
[3].f
= (GLfloat
) bottom
;
2623 n
[4].f
= (GLfloat
) top
;
2624 n
[5].f
= (GLfloat
) nearval
;
2625 n
[6].f
= (GLfloat
) farval
;
2627 if (ctx
->ExecuteFlag
) {
2628 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2633 static void GLAPIENTRY
2634 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2636 GET_CURRENT_CONTEXT(ctx
);
2638 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2639 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_MAP
, 3);
2643 n
[3].data
= (void *) _mesa_malloc(mapsize
* sizeof(GLfloat
));
2644 MEMCPY(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
2646 if (ctx
->ExecuteFlag
) {
2647 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2652 static void GLAPIENTRY
2653 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2655 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2657 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2658 for (i
= 0; i
< mapsize
; i
++) {
2659 fvalues
[i
] = (GLfloat
) values
[i
];
2663 for (i
= 0; i
< mapsize
; i
++) {
2664 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2667 save_PixelMapfv(map
, mapsize
, fvalues
);
2671 static void GLAPIENTRY
2672 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2674 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2676 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2677 for (i
= 0; i
< mapsize
; i
++) {
2678 fvalues
[i
] = (GLfloat
) values
[i
];
2682 for (i
= 0; i
< mapsize
; i
++) {
2683 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
2686 save_PixelMapfv(map
, mapsize
, fvalues
);
2690 static void GLAPIENTRY
2691 save_PixelTransferf(GLenum pname
, GLfloat param
)
2693 GET_CURRENT_CONTEXT(ctx
);
2695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2696 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2701 if (ctx
->ExecuteFlag
) {
2702 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
2707 static void GLAPIENTRY
2708 save_PixelTransferi(GLenum pname
, GLint param
)
2710 save_PixelTransferf(pname
, (GLfloat
) param
);
2714 static void GLAPIENTRY
2715 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
2717 GET_CURRENT_CONTEXT(ctx
);
2719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2720 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_ZOOM
, 2);
2725 if (ctx
->ExecuteFlag
) {
2726 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
2731 static void GLAPIENTRY
2732 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
2734 GET_CURRENT_CONTEXT(ctx
);
2736 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2737 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POINT_PARAMETERS
, 4);
2744 if (ctx
->ExecuteFlag
) {
2745 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
2750 static void GLAPIENTRY
2751 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
2755 parray
[1] = parray
[2] = 0.0F
;
2756 save_PointParameterfvEXT(pname
, parray
);
2759 static void GLAPIENTRY
2760 save_PointParameteriNV(GLenum pname
, GLint param
)
2763 parray
[0] = (GLfloat
) param
;
2764 parray
[1] = parray
[2] = 0.0F
;
2765 save_PointParameterfvEXT(pname
, parray
);
2768 static void GLAPIENTRY
2769 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
2772 parray
[0] = (GLfloat
) param
[0];
2773 parray
[1] = parray
[2] = 0.0F
;
2774 save_PointParameterfvEXT(pname
, parray
);
2778 static void GLAPIENTRY
2779 save_PointSize(GLfloat size
)
2781 GET_CURRENT_CONTEXT(ctx
);
2783 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2784 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POINT_SIZE
, 1);
2788 if (ctx
->ExecuteFlag
) {
2789 CALL_PointSize(ctx
->Exec
, (size
));
2794 static void GLAPIENTRY
2795 save_PolygonMode(GLenum face
, GLenum mode
)
2797 GET_CURRENT_CONTEXT(ctx
);
2799 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2800 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_MODE
, 2);
2805 if (ctx
->ExecuteFlag
) {
2806 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
2811 static void GLAPIENTRY
2812 save_PolygonStipple(const GLubyte
* pattern
)
2814 GET_CURRENT_CONTEXT(ctx
);
2817 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2819 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
2821 n
[1].data
= unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
2822 pattern
, &ctx
->Unpack
);
2824 if (ctx
->ExecuteFlag
) {
2825 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
2830 static void GLAPIENTRY
2831 save_PolygonOffset(GLfloat factor
, GLfloat units
)
2833 GET_CURRENT_CONTEXT(ctx
);
2835 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2836 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_OFFSET
, 2);
2841 if (ctx
->ExecuteFlag
) {
2842 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
2847 static void GLAPIENTRY
2848 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
2850 GET_CURRENT_CONTEXT(ctx
);
2851 /* XXX mult by DepthMaxF here??? */
2852 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
2856 static void GLAPIENTRY
2857 save_PopAttrib(void)
2859 GET_CURRENT_CONTEXT(ctx
);
2860 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2861 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_ATTRIB
, 0);
2862 if (ctx
->ExecuteFlag
) {
2863 CALL_PopAttrib(ctx
->Exec
, ());
2868 static void GLAPIENTRY
2869 save_PopMatrix(void)
2871 GET_CURRENT_CONTEXT(ctx
);
2872 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2873 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_MATRIX
, 0);
2874 if (ctx
->ExecuteFlag
) {
2875 CALL_PopMatrix(ctx
->Exec
, ());
2880 static void GLAPIENTRY
2883 GET_CURRENT_CONTEXT(ctx
);
2884 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2885 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_NAME
, 0);
2886 if (ctx
->ExecuteFlag
) {
2887 CALL_PopName(ctx
->Exec
, ());
2892 static void GLAPIENTRY
2893 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
2894 const GLclampf
* priorities
)
2896 GET_CURRENT_CONTEXT(ctx
);
2898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2900 for (i
= 0; i
< num
; i
++) {
2902 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
2904 n
[1].ui
= textures
[i
];
2905 n
[2].f
= priorities
[i
];
2908 if (ctx
->ExecuteFlag
) {
2909 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
2914 static void GLAPIENTRY
2915 save_PushAttrib(GLbitfield mask
)
2917 GET_CURRENT_CONTEXT(ctx
);
2919 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2920 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_ATTRIB
, 1);
2924 if (ctx
->ExecuteFlag
) {
2925 CALL_PushAttrib(ctx
->Exec
, (mask
));
2930 static void GLAPIENTRY
2931 save_PushMatrix(void)
2933 GET_CURRENT_CONTEXT(ctx
);
2934 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2935 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_MATRIX
, 0);
2936 if (ctx
->ExecuteFlag
) {
2937 CALL_PushMatrix(ctx
->Exec
, ());
2942 static void GLAPIENTRY
2943 save_PushName(GLuint name
)
2945 GET_CURRENT_CONTEXT(ctx
);
2947 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2948 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_NAME
, 1);
2952 if (ctx
->ExecuteFlag
) {
2953 CALL_PushName(ctx
->Exec
, (name
));
2958 static void GLAPIENTRY
2959 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2961 GET_CURRENT_CONTEXT(ctx
);
2963 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2964 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RASTER_POS
, 4);
2971 if (ctx
->ExecuteFlag
) {
2972 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
2976 static void GLAPIENTRY
2977 save_RasterPos2d(GLdouble x
, GLdouble y
)
2979 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2982 static void GLAPIENTRY
2983 save_RasterPos2f(GLfloat x
, GLfloat y
)
2985 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2988 static void GLAPIENTRY
2989 save_RasterPos2i(GLint x
, GLint y
)
2991 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2994 static void GLAPIENTRY
2995 save_RasterPos2s(GLshort x
, GLshort y
)
2997 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3000 static void GLAPIENTRY
3001 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3003 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3006 static void GLAPIENTRY
3007 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3009 save_RasterPos4f(x
, y
, z
, 1.0F
);
3012 static void GLAPIENTRY
3013 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3015 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3018 static void GLAPIENTRY
3019 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3021 save_RasterPos4f(x
, y
, z
, 1.0F
);
3024 static void GLAPIENTRY
3025 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3027 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3030 static void GLAPIENTRY
3031 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3033 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3036 static void GLAPIENTRY
3037 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3039 save_RasterPos4f(x
, y
, z
, w
);
3042 static void GLAPIENTRY
3043 save_RasterPos2dv(const GLdouble
* v
)
3045 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3048 static void GLAPIENTRY
3049 save_RasterPos2fv(const GLfloat
* v
)
3051 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3054 static void GLAPIENTRY
3055 save_RasterPos2iv(const GLint
* v
)
3057 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3060 static void GLAPIENTRY
3061 save_RasterPos2sv(const GLshort
* v
)
3063 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3066 static void GLAPIENTRY
3067 save_RasterPos3dv(const GLdouble
* v
)
3069 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3072 static void GLAPIENTRY
3073 save_RasterPos3fv(const GLfloat
* v
)
3075 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3078 static void GLAPIENTRY
3079 save_RasterPos3iv(const GLint
* v
)
3081 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3084 static void GLAPIENTRY
3085 save_RasterPos3sv(const GLshort
* v
)
3087 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3090 static void GLAPIENTRY
3091 save_RasterPos4dv(const GLdouble
* v
)
3093 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3094 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3097 static void GLAPIENTRY
3098 save_RasterPos4fv(const GLfloat
* v
)
3100 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3103 static void GLAPIENTRY
3104 save_RasterPos4iv(const GLint
* v
)
3106 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3107 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3110 static void GLAPIENTRY
3111 save_RasterPos4sv(const GLshort
* v
)
3113 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3117 static void GLAPIENTRY
3118 save_PassThrough(GLfloat token
)
3120 GET_CURRENT_CONTEXT(ctx
);
3122 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3123 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PASSTHROUGH
, 1);
3127 if (ctx
->ExecuteFlag
) {
3128 CALL_PassThrough(ctx
->Exec
, (token
));
3133 static void GLAPIENTRY
3134 save_ReadBuffer(GLenum mode
)
3136 GET_CURRENT_CONTEXT(ctx
);
3138 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3139 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_READ_BUFFER
, 1);
3143 if (ctx
->ExecuteFlag
) {
3144 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3149 static void GLAPIENTRY
3150 save_ResetHistogram(GLenum target
)
3152 GET_CURRENT_CONTEXT(ctx
);
3154 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3155 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3159 if (ctx
->ExecuteFlag
) {
3160 CALL_ResetHistogram(ctx
->Exec
, (target
));
3165 static void GLAPIENTRY
3166 save_ResetMinmax(GLenum target
)
3168 GET_CURRENT_CONTEXT(ctx
);
3170 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3171 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3175 if (ctx
->ExecuteFlag
) {
3176 CALL_ResetMinmax(ctx
->Exec
, (target
));
3181 static void GLAPIENTRY
3182 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3184 GET_CURRENT_CONTEXT(ctx
);
3186 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3187 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ROTATE
, 4);
3194 if (ctx
->ExecuteFlag
) {
3195 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3200 static void GLAPIENTRY
3201 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3203 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3207 static void GLAPIENTRY
3208 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3210 GET_CURRENT_CONTEXT(ctx
);
3212 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3213 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCALE
, 3);
3219 if (ctx
->ExecuteFlag
) {
3220 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3225 static void GLAPIENTRY
3226 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3228 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3232 static void GLAPIENTRY
3233 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3235 GET_CURRENT_CONTEXT(ctx
);
3237 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3238 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCISSOR
, 4);
3245 if (ctx
->ExecuteFlag
) {
3246 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3251 static void GLAPIENTRY
3252 save_ShadeModel(GLenum mode
)
3254 GET_CURRENT_CONTEXT(ctx
);
3256 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3258 if (ctx
->ExecuteFlag
) {
3259 CALL_ShadeModel(ctx
->Exec
, (mode
));
3262 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3265 SAVE_FLUSH_VERTICES(ctx
);
3267 /* Only save the value if we know the statechange will take effect:
3269 if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
)
3270 ctx
->ListState
.Current
.ShadeModel
= mode
;
3272 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SHADE_MODEL
, 1);
3279 static void GLAPIENTRY
3280 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3282 GET_CURRENT_CONTEXT(ctx
);
3284 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3285 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC
, 3);
3291 if (ctx
->ExecuteFlag
) {
3292 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3297 static void GLAPIENTRY
3298 save_StencilMask(GLuint mask
)
3300 GET_CURRENT_CONTEXT(ctx
);
3302 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3303 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK
, 1);
3307 if (ctx
->ExecuteFlag
) {
3308 CALL_StencilMask(ctx
->Exec
, (mask
));
3313 static void GLAPIENTRY
3314 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3316 GET_CURRENT_CONTEXT(ctx
);
3318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3319 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP
, 3);
3325 if (ctx
->ExecuteFlag
) {
3326 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3331 static void GLAPIENTRY
3332 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3334 GET_CURRENT_CONTEXT(ctx
);
3336 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3337 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3344 if (ctx
->ExecuteFlag
) {
3345 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3350 static void GLAPIENTRY
3351 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3354 GET_CURRENT_CONTEXT(ctx
);
3356 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3358 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3366 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3373 if (ctx
->ExecuteFlag
) {
3374 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3375 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3380 static void GLAPIENTRY
3381 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3383 GET_CURRENT_CONTEXT(ctx
);
3385 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3386 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3391 if (ctx
->ExecuteFlag
) {
3392 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3397 static void GLAPIENTRY
3398 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3400 GET_CURRENT_CONTEXT(ctx
);
3402 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3403 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3410 if (ctx
->ExecuteFlag
) {
3411 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3416 static void GLAPIENTRY
3417 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3419 GET_CURRENT_CONTEXT(ctx
);
3421 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3422 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXENV
, 6);
3426 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3434 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3437 if (ctx
->ExecuteFlag
) {
3438 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3443 static void GLAPIENTRY
3444 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3447 parray
[0] = (GLfloat
) param
;
3448 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3449 save_TexEnvfv(target
, pname
, parray
);
3453 static void GLAPIENTRY
3454 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3457 p
[0] = (GLfloat
) param
;
3458 p
[1] = p
[2] = p
[3] = 0.0;
3459 save_TexEnvfv(target
, pname
, p
);
3463 static void GLAPIENTRY
3464 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3467 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3468 p
[0] = INT_TO_FLOAT(param
[0]);
3469 p
[1] = INT_TO_FLOAT(param
[1]);
3470 p
[2] = INT_TO_FLOAT(param
[2]);
3471 p
[3] = INT_TO_FLOAT(param
[3]);
3474 p
[0] = (GLfloat
) param
[0];
3475 p
[1] = p
[2] = p
[3] = 0.0F
;
3477 save_TexEnvfv(target
, pname
, p
);
3481 static void GLAPIENTRY
3482 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3484 GET_CURRENT_CONTEXT(ctx
);
3486 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3487 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXGEN
, 6);
3496 if (ctx
->ExecuteFlag
) {
3497 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3502 static void GLAPIENTRY
3503 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3506 p
[0] = (GLfloat
) params
[0];
3507 p
[1] = (GLfloat
) params
[1];
3508 p
[2] = (GLfloat
) params
[2];
3509 p
[3] = (GLfloat
) params
[3];
3510 save_TexGenfv(coord
, pname
, p
);
3514 static void GLAPIENTRY
3515 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3518 parray
[0] = (GLfloat
) param
;
3519 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3520 save_TexGenfv(coord
, pname
, parray
);
3524 static void GLAPIENTRY
3525 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3528 p
[0] = (GLfloat
) params
[0];
3529 p
[1] = (GLfloat
) params
[1];
3530 p
[2] = (GLfloat
) params
[2];
3531 p
[3] = (GLfloat
) params
[3];
3532 save_TexGenfv(coord
, pname
, p
);
3536 static void GLAPIENTRY
3537 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3541 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3542 save_TexGenfv(coord
, pname
, parray
);
3546 static void GLAPIENTRY
3547 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3551 parray
[1] = parray
[2] = parray
[3] = 0;
3552 save_TexGeniv(coord
, pname
, parray
);
3556 static void GLAPIENTRY
3557 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3559 GET_CURRENT_CONTEXT(ctx
);
3561 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3562 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXPARAMETER
, 6);
3571 if (ctx
->ExecuteFlag
) {
3572 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3577 static void GLAPIENTRY
3578 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3582 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3583 save_TexParameterfv(target
, pname
, parray
);
3587 static void GLAPIENTRY
3588 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3591 fparam
[0] = (GLfloat
) param
;
3592 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3593 save_TexParameterfv(target
, pname
, fparam
);
3597 static void GLAPIENTRY
3598 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3601 fparam
[0] = (GLfloat
) params
[0];
3602 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3603 save_TexParameterfv(target
, pname
, fparam
);
3607 static void GLAPIENTRY
3608 save_TexImage1D(GLenum target
,
3609 GLint level
, GLint components
,
3610 GLsizei width
, GLint border
,
3611 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3613 GET_CURRENT_CONTEXT(ctx
);
3614 if (target
== GL_PROXY_TEXTURE_1D
) {
3615 /* don't compile, execute immediately */
3616 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3617 border
, format
, type
, pixels
));
3621 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3622 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE1D
, 8);
3626 n
[3].i
= components
;
3627 n
[4].i
= (GLint
) width
;
3631 n
[8].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3632 pixels
, &ctx
->Unpack
);
3634 if (ctx
->ExecuteFlag
) {
3635 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3636 border
, format
, type
, pixels
));
3642 static void GLAPIENTRY
3643 save_TexImage2D(GLenum target
,
3644 GLint level
, GLint components
,
3645 GLsizei width
, GLsizei height
, GLint border
,
3646 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3648 GET_CURRENT_CONTEXT(ctx
);
3649 if (target
== GL_PROXY_TEXTURE_2D
) {
3650 /* don't compile, execute immediately */
3651 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3652 height
, border
, format
, type
, pixels
));
3656 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3657 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE2D
, 9);
3661 n
[3].i
= components
;
3662 n
[4].i
= (GLint
) width
;
3663 n
[5].i
= (GLint
) height
;
3667 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
3668 pixels
, &ctx
->Unpack
);
3670 if (ctx
->ExecuteFlag
) {
3671 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3672 height
, border
, format
, type
, pixels
));
3678 static void GLAPIENTRY
3679 save_TexImage3D(GLenum target
,
3680 GLint level
, GLint internalFormat
,
3681 GLsizei width
, GLsizei height
, GLsizei depth
,
3683 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3685 GET_CURRENT_CONTEXT(ctx
);
3686 if (target
== GL_PROXY_TEXTURE_3D
) {
3687 /* don't compile, execute immediately */
3688 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3689 height
, depth
, border
, format
, type
,
3694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3695 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE3D
, 10);
3699 n
[3].i
= (GLint
) internalFormat
;
3700 n
[4].i
= (GLint
) width
;
3701 n
[5].i
= (GLint
) height
;
3702 n
[6].i
= (GLint
) depth
;
3706 n
[10].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
3707 pixels
, &ctx
->Unpack
);
3709 if (ctx
->ExecuteFlag
) {
3710 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3711 height
, depth
, border
, format
, type
,
3718 static void GLAPIENTRY
3719 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
3720 GLsizei width
, GLenum format
, GLenum type
,
3721 const GLvoid
* pixels
)
3723 GET_CURRENT_CONTEXT(ctx
);
3726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3728 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
3733 n
[4].i
= (GLint
) width
;
3736 n
[7].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3737 pixels
, &ctx
->Unpack
);
3739 if (ctx
->ExecuteFlag
) {
3740 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
3741 format
, type
, pixels
));
3746 static void GLAPIENTRY
3747 save_TexSubImage2D(GLenum target
, GLint level
,
3748 GLint xoffset
, GLint yoffset
,
3749 GLsizei width
, GLsizei height
,
3750 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3752 GET_CURRENT_CONTEXT(ctx
);
3755 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3757 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
3763 n
[5].i
= (GLint
) width
;
3764 n
[6].i
= (GLint
) height
;
3767 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
3768 pixels
, &ctx
->Unpack
);
3770 if (ctx
->ExecuteFlag
) {
3771 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
3772 width
, height
, format
, type
, pixels
));
3777 static void GLAPIENTRY
3778 save_TexSubImage3D(GLenum target
, GLint level
,
3779 GLint xoffset
, GLint yoffset
, GLint zoffset
,
3780 GLsizei width
, GLsizei height
, GLsizei depth
,
3781 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3783 GET_CURRENT_CONTEXT(ctx
);
3786 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3788 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
3795 n
[6].i
= (GLint
) width
;
3796 n
[7].i
= (GLint
) height
;
3797 n
[8].i
= (GLint
) depth
;
3800 n
[11].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
3801 pixels
, &ctx
->Unpack
);
3803 if (ctx
->ExecuteFlag
) {
3804 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
3805 xoffset
, yoffset
, zoffset
,
3806 width
, height
, depth
, format
, type
,
3812 static void GLAPIENTRY
3813 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
3815 GET_CURRENT_CONTEXT(ctx
);
3817 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3818 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRANSLATE
, 3);
3824 if (ctx
->ExecuteFlag
) {
3825 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
3830 static void GLAPIENTRY
3831 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
3833 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3838 static void GLAPIENTRY
3839 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3841 GET_CURRENT_CONTEXT(ctx
);
3843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3844 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_VIEWPORT
, 4);
3848 n
[3].i
= (GLint
) width
;
3849 n
[4].i
= (GLint
) height
;
3851 if (ctx
->ExecuteFlag
) {
3852 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
3857 static void GLAPIENTRY
3858 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3860 GET_CURRENT_CONTEXT(ctx
);
3862 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3863 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_WINDOW_POS
, 4);
3870 if (ctx
->ExecuteFlag
) {
3871 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
3875 static void GLAPIENTRY
3876 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3878 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3881 static void GLAPIENTRY
3882 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3884 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3887 static void GLAPIENTRY
3888 save_WindowPos2iMESA(GLint x
, GLint y
)
3890 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3893 static void GLAPIENTRY
3894 save_WindowPos2sMESA(GLshort x
, GLshort y
)
3896 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3899 static void GLAPIENTRY
3900 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3902 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3905 static void GLAPIENTRY
3906 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3908 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3911 static void GLAPIENTRY
3912 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3914 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3917 static void GLAPIENTRY
3918 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3920 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3923 static void GLAPIENTRY
3924 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3926 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3929 static void GLAPIENTRY
3930 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3932 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3935 static void GLAPIENTRY
3936 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3938 save_WindowPos4fMESA(x
, y
, z
, w
);
3941 static void GLAPIENTRY
3942 save_WindowPos2dvMESA(const GLdouble
* v
)
3944 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3947 static void GLAPIENTRY
3948 save_WindowPos2fvMESA(const GLfloat
* v
)
3950 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3953 static void GLAPIENTRY
3954 save_WindowPos2ivMESA(const GLint
* v
)
3956 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3959 static void GLAPIENTRY
3960 save_WindowPos2svMESA(const GLshort
* v
)
3962 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3965 static void GLAPIENTRY
3966 save_WindowPos3dvMESA(const GLdouble
* v
)
3968 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3971 static void GLAPIENTRY
3972 save_WindowPos3fvMESA(const GLfloat
* v
)
3974 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3977 static void GLAPIENTRY
3978 save_WindowPos3ivMESA(const GLint
* v
)
3980 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3983 static void GLAPIENTRY
3984 save_WindowPos3svMESA(const GLshort
* v
)
3986 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3989 static void GLAPIENTRY
3990 save_WindowPos4dvMESA(const GLdouble
* v
)
3992 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3993 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3996 static void GLAPIENTRY
3997 save_WindowPos4fvMESA(const GLfloat
* v
)
3999 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4002 static void GLAPIENTRY
4003 save_WindowPos4ivMESA(const GLint
* v
)
4005 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4006 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4009 static void GLAPIENTRY
4010 save_WindowPos4svMESA(const GLshort
* v
)
4012 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4017 /* GL_ARB_multitexture */
4018 static void GLAPIENTRY
4019 save_ActiveTextureARB(GLenum target
)
4021 GET_CURRENT_CONTEXT(ctx
);
4023 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4024 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4028 if (ctx
->ExecuteFlag
) {
4029 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
4034 /* GL_ARB_transpose_matrix */
4036 static void GLAPIENTRY
4037 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4040 _math_transposefd(tm
, m
);
4041 save_LoadMatrixf(tm
);
4045 static void GLAPIENTRY
4046 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4049 _math_transposef(tm
, m
);
4050 save_LoadMatrixf(tm
);
4054 static void GLAPIENTRY
4055 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4058 _math_transposefd(tm
, m
);
4059 save_MultMatrixf(tm
);
4063 static void GLAPIENTRY
4064 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4067 _math_transposef(tm
, m
);
4068 save_MultMatrixf(tm
);
4072 /* GL_ARB_texture_compression */
4073 static void GLAPIENTRY
4074 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4075 GLenum internalFormat
, GLsizei width
,
4076 GLint border
, GLsizei imageSize
,
4077 const GLvoid
* data
)
4079 GET_CURRENT_CONTEXT(ctx
);
4080 if (target
== GL_PROXY_TEXTURE_1D
) {
4081 /* don't compile, execute immediately */
4082 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4083 width
, border
, imageSize
,
4089 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4090 /* make copy of image */
4091 image
= _mesa_malloc(imageSize
);
4093 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
4096 MEMCPY(image
, data
, imageSize
);
4097 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4101 n
[3].e
= internalFormat
;
4102 n
[4].i
= (GLint
) width
;
4110 if (ctx
->ExecuteFlag
) {
4111 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4112 (target
, level
, internalFormat
, width
,
4113 border
, imageSize
, data
));
4119 static void GLAPIENTRY
4120 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4121 GLenum internalFormat
, GLsizei width
,
4122 GLsizei height
, GLint border
, GLsizei imageSize
,
4123 const GLvoid
* data
)
4125 GET_CURRENT_CONTEXT(ctx
);
4126 if (target
== GL_PROXY_TEXTURE_2D
) {
4127 /* don't compile, execute immediately */
4128 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4129 width
, height
, border
,
4135 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4136 /* make copy of image */
4137 image
= _mesa_malloc(imageSize
);
4139 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4142 MEMCPY(image
, data
, imageSize
);
4143 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4147 n
[3].e
= internalFormat
;
4148 n
[4].i
= (GLint
) width
;
4149 n
[5].i
= (GLint
) height
;
4157 if (ctx
->ExecuteFlag
) {
4158 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4159 (target
, level
, internalFormat
, width
,
4160 height
, border
, imageSize
, data
));
4166 static void GLAPIENTRY
4167 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4168 GLenum internalFormat
, GLsizei width
,
4169 GLsizei height
, GLsizei depth
, GLint border
,
4170 GLsizei imageSize
, const GLvoid
* data
)
4172 GET_CURRENT_CONTEXT(ctx
);
4173 if (target
== GL_PROXY_TEXTURE_3D
) {
4174 /* don't compile, execute immediately */
4175 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4176 width
, height
, depth
, border
,
4182 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4183 /* make copy of image */
4184 image
= _mesa_malloc(imageSize
);
4186 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4189 MEMCPY(image
, data
, imageSize
);
4190 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4194 n
[3].e
= internalFormat
;
4195 n
[4].i
= (GLint
) width
;
4196 n
[5].i
= (GLint
) height
;
4197 n
[6].i
= (GLint
) depth
;
4205 if (ctx
->ExecuteFlag
) {
4206 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4207 (target
, level
, internalFormat
, width
,
4208 height
, depth
, border
, imageSize
,
4215 static void GLAPIENTRY
4216 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4217 GLsizei width
, GLenum format
,
4218 GLsizei imageSize
, const GLvoid
* data
)
4223 GET_CURRENT_CONTEXT(ctx
);
4224 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4226 /* make copy of image */
4227 image
= _mesa_malloc(imageSize
);
4229 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4232 MEMCPY(image
, data
, imageSize
);
4233 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4238 n
[4].i
= (GLint
) width
;
4246 if (ctx
->ExecuteFlag
) {
4247 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4248 width
, format
, imageSize
,
4254 static void GLAPIENTRY
4255 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4256 GLint yoffset
, GLsizei width
, GLsizei height
,
4257 GLenum format
, GLsizei imageSize
,
4258 const GLvoid
* data
)
4263 GET_CURRENT_CONTEXT(ctx
);
4264 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4266 /* make copy of image */
4267 image
= _mesa_malloc(imageSize
);
4269 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4272 MEMCPY(image
, data
, imageSize
);
4273 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4279 n
[5].i
= (GLint
) width
;
4280 n
[6].i
= (GLint
) height
;
4288 if (ctx
->ExecuteFlag
) {
4289 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4290 (target
, level
, xoffset
, yoffset
, width
,
4291 height
, format
, imageSize
, data
));
4296 static void GLAPIENTRY
4297 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4298 GLint yoffset
, GLint zoffset
, GLsizei width
,
4299 GLsizei height
, GLsizei depth
, GLenum format
,
4300 GLsizei imageSize
, const GLvoid
* data
)
4305 GET_CURRENT_CONTEXT(ctx
);
4306 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4308 /* make copy of image */
4309 image
= _mesa_malloc(imageSize
);
4311 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4314 MEMCPY(image
, data
, imageSize
);
4315 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4322 n
[6].i
= (GLint
) width
;
4323 n
[7].i
= (GLint
) height
;
4324 n
[8].i
= (GLint
) depth
;
4326 n
[10].i
= imageSize
;
4332 if (ctx
->ExecuteFlag
) {
4333 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4334 (target
, level
, xoffset
, yoffset
,
4335 zoffset
, width
, height
, depth
, format
,
4341 /* GL_ARB_multisample */
4342 static void GLAPIENTRY
4343 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4345 GET_CURRENT_CONTEXT(ctx
);
4347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4348 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4353 if (ctx
->ExecuteFlag
) {
4354 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4360 * GL_NV_vertex_program
4362 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4363 static void GLAPIENTRY
4364 save_BindProgramNV(GLenum target
, GLuint id
)
4366 GET_CURRENT_CONTEXT(ctx
);
4368 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4369 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4374 if (ctx
->ExecuteFlag
) {
4375 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4379 static void GLAPIENTRY
4380 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4381 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4383 GET_CURRENT_CONTEXT(ctx
);
4385 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4386 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4395 if (ctx
->ExecuteFlag
) {
4396 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4401 static void GLAPIENTRY
4402 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4403 const GLfloat
*params
)
4405 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4406 params
[2], params
[3]);
4410 static void GLAPIENTRY
4411 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4412 const GLfloat
* params
)
4414 GET_CURRENT_CONTEXT(ctx
);
4416 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4420 const GLfloat
* p
= params
;
4422 for (i
= 0 ; i
< count
; i
++) {
4423 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4436 if (ctx
->ExecuteFlag
) {
4437 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4442 static void GLAPIENTRY
4443 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4444 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4446 save_ProgramEnvParameter4fARB(target
, index
,
4448 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4452 static void GLAPIENTRY
4453 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4454 const GLdouble
*params
)
4456 save_ProgramEnvParameter4fARB(target
, index
,
4457 (GLfloat
) params
[0],
4458 (GLfloat
) params
[1],
4459 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4462 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
4464 #if FEATURE_NV_vertex_program
4465 static void GLAPIENTRY
4466 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4468 GET_CURRENT_CONTEXT(ctx
);
4470 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4471 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4480 if (ctx
->ExecuteFlag
) {
4481 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4486 static void GLAPIENTRY
4487 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4488 GLuint num
, const GLdouble
*params
)
4491 for (i
= 0; i
< num
; i
++) {
4492 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4497 static void GLAPIENTRY
4498 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4499 GLuint num
, const GLfloat
*params
)
4502 for (i
= 0; i
< num
; i
++) {
4503 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4508 static void GLAPIENTRY
4509 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4510 const GLubyte
* program
)
4512 GET_CURRENT_CONTEXT(ctx
);
4515 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4517 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4519 GLubyte
*programCopy
= (GLubyte
*) _mesa_malloc(len
);
4521 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4524 _mesa_memcpy(programCopy
, program
, len
);
4528 n
[4].data
= programCopy
;
4530 if (ctx
->ExecuteFlag
) {
4531 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4536 static void GLAPIENTRY
4537 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4539 GET_CURRENT_CONTEXT(ctx
);
4542 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4544 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4546 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4548 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4551 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4555 if (ctx
->ExecuteFlag
) {
4556 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4561 static void GLAPIENTRY
4562 save_TrackMatrixNV(GLenum target
, GLuint address
,
4563 GLenum matrix
, GLenum transform
)
4565 GET_CURRENT_CONTEXT(ctx
);
4567 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4568 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4575 if (ctx
->ExecuteFlag
) {
4576 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4579 #endif /* FEATURE_NV_vertex_program */
4583 * GL_NV_fragment_program
4585 #if FEATURE_NV_fragment_program
4586 static void GLAPIENTRY
4587 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4588 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4590 GET_CURRENT_CONTEXT(ctx
);
4592 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4593 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4602 if (ctx
->ExecuteFlag
) {
4603 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4608 static void GLAPIENTRY
4609 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4610 const GLfloat
*params
)
4612 GET_CURRENT_CONTEXT(ctx
);
4614 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4615 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4624 if (ctx
->ExecuteFlag
) {
4625 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4630 static void GLAPIENTRY
4631 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4632 const GLfloat
*params
)
4634 GET_CURRENT_CONTEXT(ctx
);
4636 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4640 const GLfloat
* p
= params
;
4642 for (i
= 0 ; i
< count
; i
++) {
4643 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4656 if (ctx
->ExecuteFlag
) {
4657 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4662 static void GLAPIENTRY
4663 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4664 GLdouble x
, GLdouble y
,
4665 GLdouble z
, GLdouble w
)
4667 GET_CURRENT_CONTEXT(ctx
);
4669 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4670 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4674 n
[3].f
= (GLfloat
) x
;
4675 n
[4].f
= (GLfloat
) y
;
4676 n
[5].f
= (GLfloat
) z
;
4677 n
[6].f
= (GLfloat
) w
;
4679 if (ctx
->ExecuteFlag
) {
4680 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4685 static void GLAPIENTRY
4686 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4687 const GLdouble
*params
)
4689 GET_CURRENT_CONTEXT(ctx
);
4691 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4692 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4696 n
[3].f
= (GLfloat
) params
[0];
4697 n
[4].f
= (GLfloat
) params
[1];
4698 n
[5].f
= (GLfloat
) params
[2];
4699 n
[6].f
= (GLfloat
) params
[3];
4701 if (ctx
->ExecuteFlag
) {
4702 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4706 static void GLAPIENTRY
4707 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4708 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4710 GET_CURRENT_CONTEXT(ctx
);
4713 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4715 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
4717 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4719 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4722 _mesa_memcpy(nameCopy
, name
, len
);
4725 n
[3].data
= nameCopy
;
4731 if (ctx
->ExecuteFlag
) {
4732 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
4737 static void GLAPIENTRY
4738 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4741 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4745 static void GLAPIENTRY
4746 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4747 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4749 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4750 (GLfloat
) z
, (GLfloat
) w
);
4754 static void GLAPIENTRY
4755 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4758 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4759 (GLfloat
) v
[1], (GLfloat
) v
[2],
4763 #endif /* FEATURE_NV_fragment_program */
4767 /* GL_EXT_stencil_two_side */
4768 static void GLAPIENTRY
4769 save_ActiveStencilFaceEXT(GLenum face
)
4771 GET_CURRENT_CONTEXT(ctx
);
4773 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4774 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
4778 if (ctx
->ExecuteFlag
) {
4779 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
4784 /* GL_EXT_depth_bounds_test */
4785 static void GLAPIENTRY
4786 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
4788 GET_CURRENT_CONTEXT(ctx
);
4790 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4791 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
4793 n
[1].f
= (GLfloat
) zmin
;
4794 n
[2].f
= (GLfloat
) zmax
;
4796 if (ctx
->ExecuteFlag
) {
4797 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
4803 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4805 static void GLAPIENTRY
4806 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4807 const GLvoid
* string
)
4809 GET_CURRENT_CONTEXT(ctx
);
4812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4814 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
4816 GLubyte
*programCopy
= (GLubyte
*) _mesa_malloc(len
);
4818 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4821 _mesa_memcpy(programCopy
, string
, len
);
4825 n
[4].data
= programCopy
;
4827 if (ctx
->ExecuteFlag
) {
4828 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
4832 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4835 #if FEATURE_ARB_occlusion_query
4837 static void GLAPIENTRY
4838 save_BeginQueryARB(GLenum target
, GLuint id
)
4840 GET_CURRENT_CONTEXT(ctx
);
4842 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4843 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
4848 if (ctx
->ExecuteFlag
) {
4849 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
4854 static void GLAPIENTRY
4855 save_EndQueryARB(GLenum target
)
4857 GET_CURRENT_CONTEXT(ctx
);
4859 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4860 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_END_QUERY_ARB
, 1);
4864 if (ctx
->ExecuteFlag
) {
4865 CALL_EndQueryARB(ctx
->Exec
, (target
));
4869 #endif /* FEATURE_ARB_occlusion_query */
4872 static void GLAPIENTRY
4873 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
4875 GET_CURRENT_CONTEXT(ctx
);
4877 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4878 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
4882 if (count
> MAX_DRAW_BUFFERS
)
4883 count
= MAX_DRAW_BUFFERS
;
4884 for (i
= 0; i
< count
; i
++) {
4885 n
[2 + i
].e
= buffers
[i
];
4888 if (ctx
->ExecuteFlag
) {
4889 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
4893 static void GLAPIENTRY
4894 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
4896 GET_CURRENT_CONTEXT(ctx
);
4899 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
4907 if (ctx
->ExecuteFlag
) {
4908 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
4912 static void GLAPIENTRY
4913 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
4916 p
[0] = INT_TO_FLOAT(param
[0]);
4917 p
[1] = INT_TO_FLOAT(param
[1]);
4918 p
[2] = INT_TO_FLOAT(param
[2]);
4919 p
[3] = INT_TO_FLOAT(param
[3]);
4920 save_TexBumpParameterfvATI(pname
, p
);
4923 #if FEATURE_ATI_fragment_shader
4924 static void GLAPIENTRY
4925 save_BindFragmentShaderATI(GLuint id
)
4927 GET_CURRENT_CONTEXT(ctx
);
4930 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
4934 if (ctx
->ExecuteFlag
) {
4935 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
4939 static void GLAPIENTRY
4940 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
4942 GET_CURRENT_CONTEXT(ctx
);
4945 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
4953 if (ctx
->ExecuteFlag
) {
4954 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
4960 save_Attr1fNV(GLenum attr
, GLfloat x
)
4962 GET_CURRENT_CONTEXT(ctx
);
4964 SAVE_FLUSH_VERTICES(ctx
);
4965 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_NV
, 2);
4971 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4972 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4973 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4975 if (ctx
->ExecuteFlag
) {
4976 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
4981 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
4983 GET_CURRENT_CONTEXT(ctx
);
4985 SAVE_FLUSH_VERTICES(ctx
);
4986 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_NV
, 3);
4993 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4994 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4995 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4997 if (ctx
->ExecuteFlag
) {
4998 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5003 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5005 GET_CURRENT_CONTEXT(ctx
);
5007 SAVE_FLUSH_VERTICES(ctx
);
5008 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_NV
, 4);
5016 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
5017 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5018 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5020 if (ctx
->ExecuteFlag
) {
5021 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5026 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5028 GET_CURRENT_CONTEXT(ctx
);
5030 SAVE_FLUSH_VERTICES(ctx
);
5031 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_NV
, 5);
5040 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
5041 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5042 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5044 if (ctx
->ExecuteFlag
) {
5045 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5051 save_Attr1fARB(GLenum attr
, GLfloat x
)
5053 GET_CURRENT_CONTEXT(ctx
);
5055 SAVE_FLUSH_VERTICES(ctx
);
5056 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5062 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5063 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5064 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5066 if (ctx
->ExecuteFlag
) {
5067 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5072 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5074 GET_CURRENT_CONTEXT(ctx
);
5076 SAVE_FLUSH_VERTICES(ctx
);
5077 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5084 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5085 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5086 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5088 if (ctx
->ExecuteFlag
) {
5089 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5094 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5096 GET_CURRENT_CONTEXT(ctx
);
5098 SAVE_FLUSH_VERTICES(ctx
);
5099 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5107 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5108 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5109 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5111 if (ctx
->ExecuteFlag
) {
5112 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5117 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5119 GET_CURRENT_CONTEXT(ctx
);
5121 SAVE_FLUSH_VERTICES(ctx
);
5122 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5131 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5132 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5133 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5135 if (ctx
->ExecuteFlag
) {
5136 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5141 static void GLAPIENTRY
5142 save_EvalCoord1f(GLfloat x
)
5144 GET_CURRENT_CONTEXT(ctx
);
5146 SAVE_FLUSH_VERTICES(ctx
);
5147 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C1
, 1);
5151 if (ctx
->ExecuteFlag
) {
5152 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5156 static void GLAPIENTRY
5157 save_EvalCoord1fv(const GLfloat
* v
)
5159 save_EvalCoord1f(v
[0]);
5162 static void GLAPIENTRY
5163 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5165 GET_CURRENT_CONTEXT(ctx
);
5167 SAVE_FLUSH_VERTICES(ctx
);
5168 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C2
, 2);
5173 if (ctx
->ExecuteFlag
) {
5174 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5178 static void GLAPIENTRY
5179 save_EvalCoord2fv(const GLfloat
* v
)
5181 save_EvalCoord2f(v
[0], v
[1]);
5185 static void GLAPIENTRY
5186 save_EvalPoint1(GLint x
)
5188 GET_CURRENT_CONTEXT(ctx
);
5190 SAVE_FLUSH_VERTICES(ctx
);
5191 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P1
, 1);
5195 if (ctx
->ExecuteFlag
) {
5196 CALL_EvalPoint1(ctx
->Exec
, (x
));
5200 static void GLAPIENTRY
5201 save_EvalPoint2(GLint x
, GLint y
)
5203 GET_CURRENT_CONTEXT(ctx
);
5205 SAVE_FLUSH_VERTICES(ctx
);
5206 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P2
, 2);
5211 if (ctx
->ExecuteFlag
) {
5212 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5216 static void GLAPIENTRY
5217 save_Indexf(GLfloat x
)
5219 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5222 static void GLAPIENTRY
5223 save_Indexfv(const GLfloat
* v
)
5225 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5228 static void GLAPIENTRY
5229 save_EdgeFlag(GLboolean x
)
5231 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? (GLfloat
)1.0 : (GLfloat
)0.0);
5234 static INLINE GLboolean
compare4fv( const GLfloat
*a
,
5238 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5242 static void GLAPIENTRY
5243 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5245 GET_CURRENT_CONTEXT(ctx
);
5253 case GL_FRONT_AND_BACK
:
5256 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5265 case GL_AMBIENT_AND_DIFFUSE
:
5271 case GL_COLOR_INDEXES
:
5275 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5279 if (ctx
->ExecuteFlag
) {
5280 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5283 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5285 /* Try to eliminate redundant statechanges. Because it is legal to
5286 * call glMaterial even inside begin/end calls, don't need to worry
5287 * about ctx->Driver.CurrentSavePrimitive here.
5289 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5290 if (bitmask
& (1 << i
)) {
5291 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5292 compare4fv(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5293 bitmask
&= ~(1 << i
);
5296 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5297 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5302 /* If this call has effect, return early:
5307 SAVE_FLUSH_VERTICES(ctx
);
5309 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATERIAL
, 6);
5313 for (i
= 0; i
< args
; i
++)
5314 n
[3 + i
].f
= param
[i
];
5318 static void GLAPIENTRY
5319 save_Begin(GLenum mode
)
5321 GET_CURRENT_CONTEXT(ctx
);
5323 GLboolean error
= GL_FALSE
;
5325 if ( /*mode < GL_POINTS || */ mode
> GL_POLYGON
) {
5326 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5329 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5330 /* Typically the first begin. This may raise an error on
5331 * playback, depending on whether CallList is issued from inside
5332 * a begin/end or not.
5334 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5336 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5337 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5340 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5345 /* Give the driver an opportunity to hook in an optimized
5346 * display list compiler.
5348 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5351 SAVE_FLUSH_VERTICES(ctx
);
5352 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN
, 1);
5358 if (ctx
->ExecuteFlag
) {
5359 CALL_Begin(ctx
->Exec
, (mode
));
5363 static void GLAPIENTRY
5366 GET_CURRENT_CONTEXT(ctx
);
5367 SAVE_FLUSH_VERTICES(ctx
);
5368 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END
, 0);
5369 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5370 if (ctx
->ExecuteFlag
) {
5371 CALL_End(ctx
->Exec
, ());
5375 static void GLAPIENTRY
5376 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5378 GET_CURRENT_CONTEXT(ctx
);
5380 SAVE_FLUSH_VERTICES(ctx
);
5381 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RECTF
, 4);
5388 if (ctx
->ExecuteFlag
) {
5389 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5394 static void GLAPIENTRY
5395 save_Vertex2f(GLfloat x
, GLfloat y
)
5397 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5400 static void GLAPIENTRY
5401 save_Vertex2fv(const GLfloat
* v
)
5403 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5406 static void GLAPIENTRY
5407 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5409 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5412 static void GLAPIENTRY
5413 save_Vertex3fv(const GLfloat
* v
)
5415 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5418 static void GLAPIENTRY
5419 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5421 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5424 static void GLAPIENTRY
5425 save_Vertex4fv(const GLfloat
* v
)
5427 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5430 static void GLAPIENTRY
5431 save_TexCoord1f(GLfloat x
)
5433 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5436 static void GLAPIENTRY
5437 save_TexCoord1fv(const GLfloat
* v
)
5439 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5442 static void GLAPIENTRY
5443 save_TexCoord2f(GLfloat x
, GLfloat y
)
5445 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5448 static void GLAPIENTRY
5449 save_TexCoord2fv(const GLfloat
* v
)
5451 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5454 static void GLAPIENTRY
5455 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5457 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5460 static void GLAPIENTRY
5461 save_TexCoord3fv(const GLfloat
* v
)
5463 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5466 static void GLAPIENTRY
5467 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5469 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5472 static void GLAPIENTRY
5473 save_TexCoord4fv(const GLfloat
* v
)
5475 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5478 static void GLAPIENTRY
5479 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5481 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5484 static void GLAPIENTRY
5485 save_Normal3fv(const GLfloat
* v
)
5487 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5490 static void GLAPIENTRY
5491 save_FogCoordfEXT(GLfloat x
)
5493 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5496 static void GLAPIENTRY
5497 save_FogCoordfvEXT(const GLfloat
* v
)
5499 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5502 static void GLAPIENTRY
5503 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5505 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5508 static void GLAPIENTRY
5509 save_Color3fv(const GLfloat
* v
)
5511 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5514 static void GLAPIENTRY
5515 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5517 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5520 static void GLAPIENTRY
5521 save_Color4fv(const GLfloat
* v
)
5523 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5526 static void GLAPIENTRY
5527 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5529 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5532 static void GLAPIENTRY
5533 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5535 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5539 /* Just call the respective ATTR for texcoord
5541 static void GLAPIENTRY
5542 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5544 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5545 save_Attr1fNV(attr
, x
);
5548 static void GLAPIENTRY
5549 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5551 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5552 save_Attr1fNV(attr
, v
[0]);
5555 static void GLAPIENTRY
5556 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5558 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5559 save_Attr2fNV(attr
, x
, y
);
5562 static void GLAPIENTRY
5563 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5565 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5566 save_Attr2fNV(attr
, v
[0], v
[1]);
5569 static void GLAPIENTRY
5570 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5572 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5573 save_Attr3fNV(attr
, x
, y
, z
);
5576 static void GLAPIENTRY
5577 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5579 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5580 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5583 static void GLAPIENTRY
5584 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5585 GLfloat z
, GLfloat w
)
5587 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5588 save_Attr4fNV(attr
, x
, y
, z
, w
);
5591 static void GLAPIENTRY
5592 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5594 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5595 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5600 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5606 GET_CURRENT_CONTEXT(ctx
);
5607 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5611 /* First level for NV_vertex_program:
5613 * Check for errors at compile time?.
5615 static void GLAPIENTRY
5616 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
5618 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5619 save_Attr1fNV(index
, x
);
5624 static void GLAPIENTRY
5625 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
5627 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5628 save_Attr1fNV(index
, v
[0]);
5633 static void GLAPIENTRY
5634 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
5636 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5637 save_Attr2fNV(index
, x
, y
);
5642 static void GLAPIENTRY
5643 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
5645 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5646 save_Attr2fNV(index
, v
[0], v
[1]);
5651 static void GLAPIENTRY
5652 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5654 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5655 save_Attr3fNV(index
, x
, y
, z
);
5660 static void GLAPIENTRY
5661 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
5663 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5664 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
5669 static void GLAPIENTRY
5670 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
5671 GLfloat z
, GLfloat w
)
5673 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5674 save_Attr4fNV(index
, x
, y
, z
, w
);
5679 static void GLAPIENTRY
5680 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
5682 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5683 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
5691 static void GLAPIENTRY
5692 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5694 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5695 save_Attr1fARB(index
, x
);
5700 static void GLAPIENTRY
5701 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5703 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5704 save_Attr1fARB(index
, v
[0]);
5709 static void GLAPIENTRY
5710 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5712 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5713 save_Attr2fARB(index
, x
, y
);
5718 static void GLAPIENTRY
5719 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5721 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5722 save_Attr2fARB(index
, v
[0], v
[1]);
5727 static void GLAPIENTRY
5728 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5730 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5731 save_Attr3fARB(index
, x
, y
, z
);
5736 static void GLAPIENTRY
5737 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
5739 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5740 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
5745 static void GLAPIENTRY
5746 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
5749 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5750 save_Attr4fARB(index
, x
, y
, z
, w
);
5755 static void GLAPIENTRY
5756 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
5758 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5759 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
5765 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
5767 static void GLAPIENTRY
5768 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
5770 GET_CURRENT_CONTEXT(ctx
);
5771 FLUSH_VERTICES(ctx
, 0);
5772 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
5775 static GLint GLAPIENTRY
5776 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
5778 GET_CURRENT_CONTEXT(ctx
);
5779 FLUSH_VERTICES(ctx
, 0);
5780 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
5782 /* XXX more shader functions needed here */
5786 #if FEATURE_EXT_framebuffer_blit
5787 static void GLAPIENTRY
5788 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
5789 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
5790 GLbitfield mask
, GLenum filter
)
5792 GET_CURRENT_CONTEXT(ctx
);
5794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5795 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
5808 if (ctx
->ExecuteFlag
) {
5809 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
5810 dstX0
, dstY0
, dstX1
, dstY1
,
5817 /* aka UseProgram() */
5818 static void GLAPIENTRY
5819 save_UseProgramObjectARB(GLhandleARB program
)
5821 GET_CURRENT_CONTEXT(ctx
);
5823 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5824 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_USE_PROGRAM
, 1);
5828 if (ctx
->ExecuteFlag
) {
5829 CALL_UseProgramObjectARB(ctx
->Exec
, (program
));
5834 static void GLAPIENTRY
5835 save_Uniform1fARB(GLint location
, GLfloat x
)
5837 GET_CURRENT_CONTEXT(ctx
);
5839 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5840 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_UNIFORM_1F
, 2);
5845 if (ctx
->ExecuteFlag
) {
5846 CALL_Uniform1fARB(ctx
->Exec
, (location
, x
));
5851 static void GLAPIENTRY
5852 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
5854 GET_CURRENT_CONTEXT(ctx
);
5856 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5857 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_UNIFORM_2F
, 3);
5863 if (ctx
->ExecuteFlag
) {
5864 CALL_Uniform2fARB(ctx
->Exec
, (location
, x
, y
));
5869 static void GLAPIENTRY
5870 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
5872 GET_CURRENT_CONTEXT(ctx
);
5874 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5875 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_UNIFORM_3F
, 4);
5882 if (ctx
->ExecuteFlag
) {
5883 CALL_Uniform3fARB(ctx
->Exec
, (location
, x
, y
, z
));
5888 static void GLAPIENTRY
5889 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5891 GET_CURRENT_CONTEXT(ctx
);
5893 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5894 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_UNIFORM_4F
, 5);
5902 if (ctx
->ExecuteFlag
) {
5903 CALL_Uniform4fARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
5908 /** Return copy of memory */
5910 memdup(const void *src
, GLsizei bytes
)
5912 void *b
= bytes
>= 0 ? _mesa_malloc(bytes
) : NULL
;
5914 _mesa_memcpy(b
, src
, bytes
);
5919 static void GLAPIENTRY
5920 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
5922 GET_CURRENT_CONTEXT(ctx
);
5924 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5925 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_UNIFORM_1FV
, 3);
5929 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLfloat
));
5931 if (ctx
->ExecuteFlag
) {
5932 CALL_Uniform1fvARB(ctx
->Exec
, (location
, count
, v
));
5936 static void GLAPIENTRY
5937 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
5939 GET_CURRENT_CONTEXT(ctx
);
5941 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5942 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_UNIFORM_2FV
, 3);
5946 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLfloat
));
5948 if (ctx
->ExecuteFlag
) {
5949 CALL_Uniform2fvARB(ctx
->Exec
, (location
, count
, v
));
5953 static void GLAPIENTRY
5954 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
5956 GET_CURRENT_CONTEXT(ctx
);
5958 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5959 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_UNIFORM_3FV
, 3);
5963 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLfloat
));
5965 if (ctx
->ExecuteFlag
) {
5966 CALL_Uniform3fvARB(ctx
->Exec
, (location
, count
, v
));
5970 static void GLAPIENTRY
5971 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
5973 GET_CURRENT_CONTEXT(ctx
);
5975 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5976 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_UNIFORM_4FV
, 3);
5980 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
5982 if (ctx
->ExecuteFlag
) {
5983 CALL_Uniform4fvARB(ctx
->Exec
, (location
, count
, v
));
5988 static void GLAPIENTRY
5989 save_Uniform1iARB(GLint location
, GLint x
)
5991 GET_CURRENT_CONTEXT(ctx
);
5993 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5994 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_UNIFORM_1I
, 2);
5999 if (ctx
->ExecuteFlag
) {
6000 CALL_Uniform1iARB(ctx
->Exec
, (location
, x
));
6004 static void GLAPIENTRY
6005 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6007 GET_CURRENT_CONTEXT(ctx
);
6009 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6010 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_UNIFORM_2I
, 3);
6016 if (ctx
->ExecuteFlag
) {
6017 CALL_Uniform2iARB(ctx
->Exec
, (location
, x
, y
));
6021 static void GLAPIENTRY
6022 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6024 GET_CURRENT_CONTEXT(ctx
);
6026 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6027 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_UNIFORM_3I
, 4);
6034 if (ctx
->ExecuteFlag
) {
6035 CALL_Uniform3iARB(ctx
->Exec
, (location
, x
, y
, z
));
6039 static void GLAPIENTRY
6040 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6042 GET_CURRENT_CONTEXT(ctx
);
6044 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6045 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_UNIFORM_4I
, 5);
6053 if (ctx
->ExecuteFlag
) {
6054 CALL_Uniform4iARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6060 static void GLAPIENTRY
6061 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6063 GET_CURRENT_CONTEXT(ctx
);
6065 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6066 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_UNIFORM_1IV
, 3);
6070 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLint
));
6072 if (ctx
->ExecuteFlag
) {
6073 CALL_Uniform1ivARB(ctx
->Exec
, (location
, count
, v
));
6077 static void GLAPIENTRY
6078 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6080 GET_CURRENT_CONTEXT(ctx
);
6082 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6083 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_UNIFORM_2IV
, 3);
6087 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLint
));
6089 if (ctx
->ExecuteFlag
) {
6090 CALL_Uniform2ivARB(ctx
->Exec
, (location
, count
, v
));
6094 static void GLAPIENTRY
6095 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6097 GET_CURRENT_CONTEXT(ctx
);
6099 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6100 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_UNIFORM_3IV
, 3);
6104 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLint
));
6106 if (ctx
->ExecuteFlag
) {
6107 CALL_Uniform3ivARB(ctx
->Exec
, (location
, count
, v
));
6111 static void GLAPIENTRY
6112 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6114 GET_CURRENT_CONTEXT(ctx
);
6116 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6117 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_UNIFORM_4IV
, 3);
6121 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6123 if (ctx
->ExecuteFlag
) {
6124 CALL_Uniform4ivARB(ctx
->Exec
, (location
, count
, v
));
6131 * Save an error-generating command into display list.
6133 * KW: Will appear in the list before the vertex buffer containing the
6134 * command that provoked the error. I don't see this as a problem.
6137 save_error(GLcontext
*ctx
, GLenum error
, const char *s
)
6140 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ERROR
, 2);
6143 n
[2].data
= (void *) s
;
6149 * Compile an error into current display list.
6152 _mesa_compile_error(GLcontext
*ctx
, GLenum error
, const char *s
)
6154 if (ctx
->CompileFlag
)
6155 save_error(ctx
, error
, s
);
6156 if (ctx
->ExecuteFlag
)
6157 _mesa_error(ctx
, error
, s
);
6162 * Test if ID names a display list.
6165 islist(GLcontext
*ctx
, GLuint list
)
6167 if (list
> 0 && lookup_list(ctx
, list
)) {
6177 /**********************************************************************/
6178 /* Display list execution */
6179 /**********************************************************************/
6183 * Execute a display list. Note that the ListBase offset must have already
6184 * been added before calling this function. I.e. the list argument is
6185 * the absolute list number, not relative to ListBase.
6186 * \param list - display list number
6189 execute_list(GLcontext
*ctx
, GLuint list
)
6191 struct gl_display_list
*dlist
;
6195 if (list
== 0 || !islist(ctx
, list
))
6198 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
6199 /* raise an error? */
6203 dlist
= lookup_list(ctx
, list
);
6207 ctx
->ListState
.CallDepth
++;
6209 if (ctx
->Driver
.BeginCallList
)
6210 ctx
->Driver
.BeginCallList(ctx
, dlist
);
6216 OpCode opcode
= n
[0].opcode
;
6217 int i
= (int) n
[0].opcode
- (int) OPCODE_EXT_0
;
6219 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
6220 /* this is a driver-extended opcode */
6221 ctx
->ListExt
.Opcode
[i
].Execute(ctx
, &n
[1]);
6222 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
6227 _mesa_error(ctx
, n
[1].e
, (const char *) n
[2].data
);
6230 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6232 case OPCODE_ALPHA_FUNC
:
6233 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6235 case OPCODE_BIND_TEXTURE
:
6236 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6240 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6241 ctx
->Unpack
= ctx
->DefaultPacking
;
6242 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
6243 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
6244 (const GLubyte
*) n
[7].data
));
6245 ctx
->Unpack
= save
; /* restore */
6248 case OPCODE_BLEND_COLOR
:
6249 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6251 case OPCODE_BLEND_EQUATION
:
6252 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
6254 case OPCODE_BLEND_EQUATION_SEPARATE
:
6255 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6257 case OPCODE_BLEND_FUNC_SEPARATE
:
6258 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
6259 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6261 case OPCODE_CALL_LIST
:
6262 /* Generated by glCallList(), don't add ListBase */
6263 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
6264 execute_list(ctx
, n
[1].ui
);
6267 case OPCODE_CALL_LIST_OFFSET
:
6268 /* Generated by glCallLists() so we must add ListBase */
6270 /* user specified a bad data type at compile time */
6271 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6273 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
6274 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
6275 execute_list(ctx
, list
);
6279 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
6281 case OPCODE_CLEAR_COLOR
:
6282 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6284 case OPCODE_CLEAR_ACCUM
:
6285 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6287 case OPCODE_CLEAR_DEPTH
:
6288 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
6290 case OPCODE_CLEAR_INDEX
:
6291 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
6293 case OPCODE_CLEAR_STENCIL
:
6294 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
6296 case OPCODE_CLIP_PLANE
:
6303 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
6306 case OPCODE_COLOR_MASK
:
6307 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
6309 case OPCODE_COLOR_MATERIAL
:
6310 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6312 case OPCODE_COLOR_TABLE
:
6314 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6315 ctx
->Unpack
= ctx
->DefaultPacking
;
6316 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
6317 n
[5].e
, n
[6].data
));
6318 ctx
->Unpack
= save
; /* restore */
6321 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
6328 CALL_ColorTableParameterfv(ctx
->Exec
,
6329 (n
[1].e
, n
[2].e
, params
));
6332 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
6339 CALL_ColorTableParameteriv(ctx
->Exec
,
6340 (n
[1].e
, n
[2].e
, params
));
6343 case OPCODE_COLOR_SUB_TABLE
:
6345 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6346 ctx
->Unpack
= ctx
->DefaultPacking
;
6347 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6348 n
[4].e
, n
[5].e
, n
[6].data
));
6349 ctx
->Unpack
= save
; /* restore */
6352 case OPCODE_CONVOLUTION_FILTER_1D
:
6354 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6355 ctx
->Unpack
= ctx
->DefaultPacking
;
6356 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6359 ctx
->Unpack
= save
; /* restore */
6362 case OPCODE_CONVOLUTION_FILTER_2D
:
6364 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6365 ctx
->Unpack
= ctx
->DefaultPacking
;
6366 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6367 n
[4].i
, n
[5].e
, n
[6].e
,
6369 ctx
->Unpack
= save
; /* restore */
6372 case OPCODE_CONVOLUTION_PARAMETER_I
:
6373 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
6375 case OPCODE_CONVOLUTION_PARAMETER_IV
:
6382 CALL_ConvolutionParameteriv(ctx
->Exec
,
6383 (n
[1].e
, n
[2].e
, params
));
6386 case OPCODE_CONVOLUTION_PARAMETER_F
:
6387 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
6389 case OPCODE_CONVOLUTION_PARAMETER_FV
:
6396 CALL_ConvolutionParameterfv(ctx
->Exec
,
6397 (n
[1].e
, n
[2].e
, params
));
6400 case OPCODE_COPY_COLOR_SUB_TABLE
:
6401 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6402 n
[3].i
, n
[4].i
, n
[5].i
));
6404 case OPCODE_COPY_COLOR_TABLE
:
6405 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6406 n
[3].i
, n
[4].i
, n
[5].i
));
6408 case OPCODE_COPY_PIXELS
:
6409 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6410 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
6413 case OPCODE_COPY_TEX_IMAGE1D
:
6414 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6415 n
[5].i
, n
[6].i
, n
[7].i
));
6417 case OPCODE_COPY_TEX_IMAGE2D
:
6418 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6419 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
6421 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
6422 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6423 n
[4].i
, n
[5].i
, n
[6].i
));
6425 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
6426 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6427 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6430 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
6431 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6432 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6435 case OPCODE_CULL_FACE
:
6436 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
6438 case OPCODE_DEPTH_FUNC
:
6439 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
6441 case OPCODE_DEPTH_MASK
:
6442 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
6444 case OPCODE_DEPTH_RANGE
:
6445 CALL_DepthRange(ctx
->Exec
,
6446 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
6448 case OPCODE_DISABLE
:
6449 CALL_Disable(ctx
->Exec
, (n
[1].e
));
6451 case OPCODE_DRAW_BUFFER
:
6452 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
6454 case OPCODE_DRAW_PIXELS
:
6456 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6457 ctx
->Unpack
= ctx
->DefaultPacking
;
6458 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
6460 ctx
->Unpack
= save
; /* restore */
6464 CALL_Enable(ctx
->Exec
, (n
[1].e
));
6466 case OPCODE_EVALMESH1
:
6467 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
6469 case OPCODE_EVALMESH2
:
6470 CALL_EvalMesh2(ctx
->Exec
,
6471 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
6480 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
6483 case OPCODE_FRONT_FACE
:
6484 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
6486 case OPCODE_FRUSTUM
:
6487 CALL_Frustum(ctx
->Exec
,
6488 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6491 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6493 case OPCODE_HISTOGRAM
:
6494 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
6496 case OPCODE_INDEX_MASK
:
6497 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
6499 case OPCODE_INIT_NAMES
:
6500 CALL_InitNames(ctx
->Exec
, ());
6509 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
6512 case OPCODE_LIGHT_MODEL
:
6519 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
6522 case OPCODE_LINE_STIPPLE
:
6523 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
6525 case OPCODE_LINE_WIDTH
:
6526 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
6528 case OPCODE_LIST_BASE
:
6529 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
6531 case OPCODE_LOAD_IDENTITY
:
6532 CALL_LoadIdentity(ctx
->Exec
, ());
6534 case OPCODE_LOAD_MATRIX
:
6535 if (sizeof(Node
) == sizeof(GLfloat
)) {
6536 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
6541 for (i
= 0; i
< 16; i
++) {
6544 CALL_LoadMatrixf(ctx
->Exec
, (m
));
6547 case OPCODE_LOAD_NAME
:
6548 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
6550 case OPCODE_LOGIC_OP
:
6551 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
6555 GLenum target
= n
[1].e
;
6556 GLint ustride
= _mesa_evaluator_components(target
);
6557 GLint uorder
= n
[5].i
;
6558 GLfloat u1
= n
[2].f
;
6559 GLfloat u2
= n
[3].f
;
6560 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6561 (GLfloat
*) n
[6].data
));
6566 GLenum target
= n
[1].e
;
6567 GLfloat u1
= n
[2].f
;
6568 GLfloat u2
= n
[3].f
;
6569 GLfloat v1
= n
[4].f
;
6570 GLfloat v2
= n
[5].f
;
6571 GLint ustride
= n
[6].i
;
6572 GLint vstride
= n
[7].i
;
6573 GLint uorder
= n
[8].i
;
6574 GLint vorder
= n
[9].i
;
6575 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6576 v1
, v2
, vstride
, vorder
,
6577 (GLfloat
*) n
[10].data
));
6580 case OPCODE_MAPGRID1
:
6581 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
6583 case OPCODE_MAPGRID2
:
6584 CALL_MapGrid2f(ctx
->Exec
,
6585 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
6587 case OPCODE_MATRIX_MODE
:
6588 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
6590 case OPCODE_MIN_MAX
:
6591 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
6593 case OPCODE_MULT_MATRIX
:
6594 if (sizeof(Node
) == sizeof(GLfloat
)) {
6595 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
6600 for (i
= 0; i
< 16; i
++) {
6603 CALL_MultMatrixf(ctx
->Exec
, (m
));
6607 CALL_Ortho(ctx
->Exec
,
6608 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6610 case OPCODE_PASSTHROUGH
:
6611 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
6613 case OPCODE_PIXEL_MAP
:
6614 CALL_PixelMapfv(ctx
->Exec
,
6615 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
6617 case OPCODE_PIXEL_TRANSFER
:
6618 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6620 case OPCODE_PIXEL_ZOOM
:
6621 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6623 case OPCODE_POINT_SIZE
:
6624 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
6626 case OPCODE_POINT_PARAMETERS
:
6632 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
6635 case OPCODE_POLYGON_MODE
:
6636 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6638 case OPCODE_POLYGON_STIPPLE
:
6640 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6641 ctx
->Unpack
= ctx
->DefaultPacking
;
6642 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
6643 ctx
->Unpack
= save
; /* restore */
6646 case OPCODE_POLYGON_OFFSET
:
6647 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6649 case OPCODE_POP_ATTRIB
:
6650 CALL_PopAttrib(ctx
->Exec
, ());
6652 case OPCODE_POP_MATRIX
:
6653 CALL_PopMatrix(ctx
->Exec
, ());
6655 case OPCODE_POP_NAME
:
6656 CALL_PopName(ctx
->Exec
, ());
6658 case OPCODE_PRIORITIZE_TEXTURE
:
6659 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
6661 case OPCODE_PUSH_ATTRIB
:
6662 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
6664 case OPCODE_PUSH_MATRIX
:
6665 CALL_PushMatrix(ctx
->Exec
, ());
6667 case OPCODE_PUSH_NAME
:
6668 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
6670 case OPCODE_RASTER_POS
:
6671 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6673 case OPCODE_READ_BUFFER
:
6674 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
6676 case OPCODE_RESET_HISTOGRAM
:
6677 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
6679 case OPCODE_RESET_MIN_MAX
:
6680 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
6683 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6686 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6688 case OPCODE_SCISSOR
:
6689 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
6691 case OPCODE_SHADE_MODEL
:
6692 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
6694 case OPCODE_STENCIL_FUNC
:
6695 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
6697 case OPCODE_STENCIL_MASK
:
6698 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
6700 case OPCODE_STENCIL_OP
:
6701 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
6703 case OPCODE_STENCIL_FUNC_SEPARATE
:
6704 CALL_StencilFuncSeparate(ctx
->Exec
,
6705 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
6707 case OPCODE_STENCIL_MASK_SEPARATE
:
6708 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6710 case OPCODE_STENCIL_OP_SEPARATE
:
6711 CALL_StencilOpSeparate(ctx
->Exec
,
6712 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6721 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6731 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6734 case OPCODE_TEXPARAMETER
:
6741 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6744 case OPCODE_TEX_IMAGE1D
:
6746 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6747 ctx
->Unpack
= ctx
->DefaultPacking
;
6748 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
6750 n
[3].i
, /* components */
6752 n
[5].e
, /* border */
6753 n
[6].e
, /* format */
6756 ctx
->Unpack
= save
; /* restore */
6759 case OPCODE_TEX_IMAGE2D
:
6761 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6762 ctx
->Unpack
= ctx
->DefaultPacking
;
6763 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
6765 n
[3].i
, /* components */
6767 n
[5].i
, /* height */
6768 n
[6].e
, /* border */
6769 n
[7].e
, /* format */
6772 ctx
->Unpack
= save
; /* restore */
6775 case OPCODE_TEX_IMAGE3D
:
6777 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6778 ctx
->Unpack
= ctx
->DefaultPacking
;
6779 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
6781 n
[3].i
, /* components */
6783 n
[5].i
, /* height */
6785 n
[7].e
, /* border */
6786 n
[8].e
, /* format */
6789 ctx
->Unpack
= save
; /* restore */
6792 case OPCODE_TEX_SUB_IMAGE1D
:
6794 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6795 ctx
->Unpack
= ctx
->DefaultPacking
;
6796 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6798 n
[6].e
, n
[7].data
));
6799 ctx
->Unpack
= save
; /* restore */
6802 case OPCODE_TEX_SUB_IMAGE2D
:
6804 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6805 ctx
->Unpack
= ctx
->DefaultPacking
;
6806 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6808 n
[6].i
, n
[7].e
, n
[8].e
,
6810 ctx
->Unpack
= save
; /* restore */
6813 case OPCODE_TEX_SUB_IMAGE3D
:
6815 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6816 ctx
->Unpack
= ctx
->DefaultPacking
;
6817 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6818 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6819 n
[8].i
, n
[9].e
, n
[10].e
,
6821 ctx
->Unpack
= save
; /* restore */
6824 case OPCODE_TRANSLATE
:
6825 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6827 case OPCODE_VIEWPORT
:
6828 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6829 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
6831 case OPCODE_WINDOW_POS
:
6832 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6834 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
6835 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
6837 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
6838 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6839 n
[4].i
, n
[5].i
, n
[6].i
,
6842 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
6843 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6844 n
[4].i
, n
[5].i
, n
[6].i
,
6845 n
[7].i
, n
[8].data
));
6847 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
6848 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6849 n
[4].i
, n
[5].i
, n
[6].i
,
6853 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
6854 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
6855 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6856 n
[5].e
, n
[6].i
, n
[7].data
));
6858 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
6859 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
6860 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6861 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
6864 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
6865 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
6866 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6867 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6868 n
[9].e
, n
[10].i
, n
[11].data
));
6870 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
6871 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
6873 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
6874 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6876 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6877 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
6878 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6881 #if FEATURE_NV_vertex_program
6882 case OPCODE_EXECUTE_PROGRAM_NV
:
6889 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
6892 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
6893 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
6894 (GLuint
*) n
[2].data
));
6896 case OPCODE_LOAD_PROGRAM_NV
:
6897 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
6898 (const GLubyte
*) n
[4].data
));
6900 case OPCODE_TRACK_MATRIX_NV
:
6901 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
6905 #if FEATURE_NV_fragment_program
6906 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
6907 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
6908 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
6911 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
6912 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
6913 (const GLubyte
*) n
[3].
6914 data
, n
[4].f
, n
[5].f
,
6919 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
6920 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
6922 case OPCODE_DEPTH_BOUNDS_EXT
:
6923 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6925 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6926 case OPCODE_PROGRAM_STRING_ARB
:
6927 CALL_ProgramStringARB(ctx
->Exec
,
6928 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
6931 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
6932 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
6933 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6938 #if FEATURE_ARB_occlusion_query
6939 case OPCODE_BEGIN_QUERY_ARB
:
6940 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6942 case OPCODE_END_QUERY_ARB
:
6943 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
6946 case OPCODE_DRAW_BUFFERS_ARB
:
6948 GLenum buffers
[MAX_DRAW_BUFFERS
];
6949 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
6950 for (i
= 0; i
< count
; i
++)
6951 buffers
[i
] = n
[2 + i
].e
;
6952 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
6955 #if FEATURE_EXT_framebuffer_blit
6956 case OPCODE_BLIT_FRAMEBUFFER
:
6957 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
6958 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6963 case OPCODE_USE_PROGRAM
:
6964 CALL_UseProgramObjectARB(ctx
->Exec
, (n
[1].ui
));
6966 case OPCODE_UNIFORM_1F
:
6967 CALL_Uniform1fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
));
6969 case OPCODE_UNIFORM_2F
:
6970 CALL_Uniform2fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
6972 case OPCODE_UNIFORM_3F
:
6973 CALL_Uniform3fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
6975 case OPCODE_UNIFORM_4F
:
6976 CALL_Uniform4fARB(ctx
->Exec
,
6977 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
6979 case OPCODE_UNIFORM_1FV
:
6980 CALL_Uniform1fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
6982 case OPCODE_UNIFORM_2FV
:
6983 CALL_Uniform2fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
6985 case OPCODE_UNIFORM_3FV
:
6986 CALL_Uniform3fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
6988 case OPCODE_UNIFORM_4FV
:
6989 CALL_Uniform4fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
6991 case OPCODE_UNIFORM_1I
:
6992 CALL_Uniform1iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
));
6994 case OPCODE_UNIFORM_2I
:
6995 CALL_Uniform2iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
6997 case OPCODE_UNIFORM_3I
:
6998 CALL_Uniform3iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
7000 case OPCODE_UNIFORM_4I
:
7001 CALL_Uniform4iARB(ctx
->Exec
,
7002 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7004 case OPCODE_UNIFORM_1IV
:
7005 CALL_Uniform1ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7007 case OPCODE_UNIFORM_2IV
:
7008 CALL_Uniform2ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7010 case OPCODE_UNIFORM_3IV
:
7011 CALL_Uniform3ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7013 case OPCODE_UNIFORM_4IV
:
7014 CALL_Uniform4ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7017 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
7020 GLuint i
, pname
= n
[1].ui
;
7022 for (i
= 0; i
< 4; i
++)
7023 values
[i
] = n
[1 + i
].f
;
7024 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
7027 #if FEATURE_ATI_fragment_shader
7028 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
7029 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
7031 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
7034 GLuint i
, dst
= n
[1].ui
;
7036 for (i
= 0; i
< 4; i
++)
7037 values
[i
] = n
[1 + i
].f
;
7038 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
7042 case OPCODE_ATTR_1F_NV
:
7043 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7045 case OPCODE_ATTR_2F_NV
:
7046 /* Really shouldn't have to do this - the Node structure
7047 * is convenient, but it would be better to store the data
7048 * packed appropriately so that it can be sent directly
7049 * on. With x86_64 becoming common, this will start to
7052 if (sizeof(Node
) == sizeof(GLfloat
))
7053 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7055 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
7057 case OPCODE_ATTR_3F_NV
:
7058 if (sizeof(Node
) == sizeof(GLfloat
))
7059 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7061 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7064 case OPCODE_ATTR_4F_NV
:
7065 if (sizeof(Node
) == sizeof(GLfloat
))
7066 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7068 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7071 case OPCODE_ATTR_1F_ARB
:
7072 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7074 case OPCODE_ATTR_2F_ARB
:
7075 /* Really shouldn't have to do this - the Node structure
7076 * is convenient, but it would be better to store the data
7077 * packed appropriately so that it can be sent directly
7078 * on. With x86_64 becoming common, this will start to
7081 if (sizeof(Node
) == sizeof(GLfloat
))
7082 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7084 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
7086 case OPCODE_ATTR_3F_ARB
:
7087 if (sizeof(Node
) == sizeof(GLfloat
))
7088 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7090 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7093 case OPCODE_ATTR_4F_ARB
:
7094 if (sizeof(Node
) == sizeof(GLfloat
))
7095 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7097 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7100 case OPCODE_MATERIAL
:
7101 if (sizeof(Node
) == sizeof(GLfloat
))
7102 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
7109 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
7113 CALL_Begin(ctx
->Exec
, (n
[1].e
));
7116 CALL_End(ctx
->Exec
, ());
7119 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7121 case OPCODE_EVAL_C1
:
7122 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
7124 case OPCODE_EVAL_C2
:
7125 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7127 case OPCODE_EVAL_P1
:
7128 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
7130 case OPCODE_EVAL_P2
:
7131 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
7134 case OPCODE_CONTINUE
:
7135 n
= (Node
*) n
[1].next
;
7137 case OPCODE_END_OF_LIST
:
7143 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d",
7145 _mesa_problem(ctx
, msg
);
7150 /* increment n to point to next compiled command */
7151 if (opcode
!= OPCODE_CONTINUE
) {
7152 n
+= InstSize
[opcode
];
7157 if (ctx
->Driver
.EndCallList
)
7158 ctx
->Driver
.EndCallList(ctx
);
7160 ctx
->ListState
.CallDepth
--;
7165 /**********************************************************************/
7167 /**********************************************************************/
7170 * Test if a display list number is valid.
7172 GLboolean GLAPIENTRY
7173 _mesa_IsList(GLuint list
)
7175 GET_CURRENT_CONTEXT(ctx
);
7176 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7177 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
7178 return islist(ctx
, list
);
7183 * Delete a sequence of consecutive display lists.
7186 _mesa_DeleteLists(GLuint list
, GLsizei range
)
7188 GET_CURRENT_CONTEXT(ctx
);
7190 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7191 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7194 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
7197 for (i
= list
; i
< list
+ range
; i
++) {
7198 destroy_list(ctx
, i
);
7204 * Return a display list number, n, such that lists n through n+range-1
7208 _mesa_GenLists(GLsizei range
)
7210 GET_CURRENT_CONTEXT(ctx
);
7212 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7213 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
7216 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
7224 * Make this an atomic operation
7226 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
7228 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
7230 /* reserve the list IDs by with empty/dummy lists */
7232 for (i
= 0; i
< range
; i
++) {
7233 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
7234 make_list(base
+ i
, 1));
7238 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
7245 * Begin a new display list.
7248 _mesa_NewList(GLuint name
, GLenum mode
)
7250 GET_CURRENT_CONTEXT(ctx
);
7252 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
7253 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7255 if (MESA_VERBOSE
& VERBOSE_API
)
7256 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
7257 _mesa_lookup_enum_by_nr(mode
));
7260 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
7264 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
7265 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
7269 if (ctx
->ListState
.CurrentList
) {
7270 /* already compiling a display list */
7271 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
7275 ctx
->CompileFlag
= GL_TRUE
;
7276 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
7278 /* Reset acumulated list state:
7280 invalidate_saved_current_state( ctx
);
7282 /* Allocate new display list */
7283 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
7284 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
7285 ctx
->ListState
.CurrentPos
= 0;
7287 ctx
->Driver
.NewList(ctx
, name
, mode
);
7289 ctx
->CurrentDispatch
= ctx
->Save
;
7290 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7295 * End definition of current display list.
7300 GET_CURRENT_CONTEXT(ctx
);
7301 SAVE_FLUSH_VERTICES(ctx
);
7302 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
7304 if (MESA_VERBOSE
& VERBOSE_API
)
7305 _mesa_debug(ctx
, "glEndList\n");
7307 /* Check that a list is under construction */
7308 if (!ctx
->ListState
.CurrentList
) {
7309 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
7313 /* Call before emitting END_OF_LIST, in case the driver wants to
7314 * emit opcodes itself.
7316 ctx
->Driver
.EndList(ctx
);
7318 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END_OF_LIST
, 0);
7320 /* Destroy old list, if any */
7321 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
7323 /* Install the new list */
7324 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
7325 ctx
->ListState
.CurrentList
->Name
,
7326 ctx
->ListState
.CurrentList
);
7329 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
7330 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
7332 ctx
->ListState
.CurrentList
= NULL
;
7333 ctx
->ExecuteFlag
= GL_TRUE
;
7334 ctx
->CompileFlag
= GL_FALSE
;
7336 ctx
->CurrentDispatch
= ctx
->Exec
;
7337 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7342 _mesa_CallList(GLuint list
)
7344 GLboolean save_compile_flag
;
7345 GET_CURRENT_CONTEXT(ctx
);
7346 FLUSH_CURRENT(ctx
, 0);
7347 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
7348 /* execute the display list, and restore the CompileFlag. */
7350 if (MESA_VERBOSE
& VERBOSE_API
)
7351 _mesa_debug(ctx
, "glCallList %d\n", list
);
7354 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
7358 /* mesa_print_display_list( list ); */
7360 save_compile_flag
= ctx
->CompileFlag
;
7361 if (save_compile_flag
) {
7362 ctx
->CompileFlag
= GL_FALSE
;
7365 execute_list(ctx
, list
);
7366 ctx
->CompileFlag
= save_compile_flag
;
7368 /* also restore API function pointers to point to "save" versions */
7369 if (save_compile_flag
) {
7370 ctx
->CurrentDispatch
= ctx
->Save
;
7371 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7377 * Execute glCallLists: call multiple display lists.
7380 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
7382 GET_CURRENT_CONTEXT(ctx
);
7384 GLboolean save_compile_flag
;
7386 if (MESA_VERBOSE
& VERBOSE_API
)
7387 _mesa_debug(ctx
, "glCallLists %d\n", n
);
7391 case GL_UNSIGNED_BYTE
:
7393 case GL_UNSIGNED_SHORT
:
7395 case GL_UNSIGNED_INT
:
7403 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7407 /* Save the CompileFlag status, turn it off, execute display list,
7408 * and restore the CompileFlag.
7410 save_compile_flag
= ctx
->CompileFlag
;
7411 ctx
->CompileFlag
= GL_FALSE
;
7413 for (i
= 0; i
< n
; i
++) {
7414 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
7415 execute_list(ctx
, list
);
7418 ctx
->CompileFlag
= save_compile_flag
;
7420 /* also restore API function pointers to point to "save" versions */
7421 if (save_compile_flag
) {
7422 ctx
->CurrentDispatch
= ctx
->Save
;
7423 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7429 * Set the offset added to list numbers in glCallLists.
7432 _mesa_ListBase(GLuint base
)
7434 GET_CURRENT_CONTEXT(ctx
);
7435 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7436 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7437 ctx
->List
.ListBase
= base
;
7441 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
7443 static void GLAPIENTRY
7446 GET_CURRENT_CONTEXT(ctx
);
7447 FLUSH_VERTICES(ctx
, 0);
7448 CALL_Finish(ctx
->Exec
, ());
7451 static void GLAPIENTRY
7454 GET_CURRENT_CONTEXT(ctx
);
7455 FLUSH_VERTICES(ctx
, 0);
7456 CALL_Flush(ctx
->Exec
, ());
7459 static void GLAPIENTRY
7460 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
7462 GET_CURRENT_CONTEXT(ctx
);
7463 FLUSH_VERTICES(ctx
, 0);
7464 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
7467 static void GLAPIENTRY
7468 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
7470 GET_CURRENT_CONTEXT(ctx
);
7471 FLUSH_VERTICES(ctx
, 0);
7472 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
7475 static void GLAPIENTRY
7476 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
7478 GET_CURRENT_CONTEXT(ctx
);
7479 FLUSH_VERTICES(ctx
, 0);
7480 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
7483 static GLenum GLAPIENTRY
7486 GET_CURRENT_CONTEXT(ctx
);
7487 FLUSH_VERTICES(ctx
, 0);
7488 return CALL_GetError(ctx
->Exec
, ());
7491 static void GLAPIENTRY
7492 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
7494 GET_CURRENT_CONTEXT(ctx
);
7495 FLUSH_VERTICES(ctx
, 0);
7496 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
7499 static void GLAPIENTRY
7500 exec_GetIntegerv(GLenum pname
, GLint
*params
)
7502 GET_CURRENT_CONTEXT(ctx
);
7503 FLUSH_VERTICES(ctx
, 0);
7504 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
7507 static void GLAPIENTRY
7508 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
7510 GET_CURRENT_CONTEXT(ctx
);
7511 FLUSH_VERTICES(ctx
, 0);
7512 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
7515 static void GLAPIENTRY
7516 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
7518 GET_CURRENT_CONTEXT(ctx
);
7519 FLUSH_VERTICES(ctx
, 0);
7520 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
7523 static void GLAPIENTRY
7524 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
7526 GET_CURRENT_CONTEXT(ctx
);
7527 FLUSH_VERTICES(ctx
, 0);
7528 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
7531 static void GLAPIENTRY
7532 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
7534 GET_CURRENT_CONTEXT(ctx
);
7535 FLUSH_VERTICES(ctx
, 0);
7536 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
7539 static void GLAPIENTRY
7540 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
7542 GET_CURRENT_CONTEXT(ctx
);
7543 FLUSH_VERTICES(ctx
, 0);
7544 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
7547 static void GLAPIENTRY
7548 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
7550 GET_CURRENT_CONTEXT(ctx
);
7551 FLUSH_VERTICES(ctx
, 0);
7552 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
7555 static void GLAPIENTRY
7556 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
7558 GET_CURRENT_CONTEXT(ctx
);
7559 FLUSH_VERTICES(ctx
, 0);
7560 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
7563 static void GLAPIENTRY
7564 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
7566 GET_CURRENT_CONTEXT(ctx
);
7567 FLUSH_VERTICES(ctx
, 0);
7568 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
7571 static void GLAPIENTRY
7572 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
7574 GET_CURRENT_CONTEXT(ctx
);
7575 FLUSH_VERTICES(ctx
, 0);
7576 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
7579 static void GLAPIENTRY
7580 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
7582 GET_CURRENT_CONTEXT(ctx
);
7583 FLUSH_VERTICES(ctx
, 0);
7584 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
7587 static void GLAPIENTRY
7588 exec_GetPolygonStipple(GLubyte
* dest
)
7590 GET_CURRENT_CONTEXT(ctx
);
7591 FLUSH_VERTICES(ctx
, 0);
7592 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
7595 static const GLubyte
*GLAPIENTRY
7596 exec_GetString(GLenum name
)
7598 GET_CURRENT_CONTEXT(ctx
);
7599 FLUSH_VERTICES(ctx
, 0);
7600 return CALL_GetString(ctx
->Exec
, (name
));
7603 static void GLAPIENTRY
7604 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7606 GET_CURRENT_CONTEXT(ctx
);
7607 FLUSH_VERTICES(ctx
, 0);
7608 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
7611 static void GLAPIENTRY
7612 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
7614 GET_CURRENT_CONTEXT(ctx
);
7615 FLUSH_VERTICES(ctx
, 0);
7616 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
7619 static void GLAPIENTRY
7620 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
7622 GET_CURRENT_CONTEXT(ctx
);
7623 FLUSH_VERTICES(ctx
, 0);
7624 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
7627 static void GLAPIENTRY
7628 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
7630 GET_CURRENT_CONTEXT(ctx
);
7631 FLUSH_VERTICES(ctx
, 0);
7632 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
7635 static void GLAPIENTRY
7636 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
7638 GET_CURRENT_CONTEXT(ctx
);
7639 FLUSH_VERTICES(ctx
, 0);
7640 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
7643 static void GLAPIENTRY
7644 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
7645 GLenum type
, GLvoid
* pixels
)
7647 GET_CURRENT_CONTEXT(ctx
);
7648 FLUSH_VERTICES(ctx
, 0);
7649 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
7652 static void GLAPIENTRY
7653 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
7654 GLenum pname
, GLfloat
*params
)
7656 GET_CURRENT_CONTEXT(ctx
);
7657 FLUSH_VERTICES(ctx
, 0);
7658 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
7661 static void GLAPIENTRY
7662 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
7663 GLenum pname
, GLint
*params
)
7665 GET_CURRENT_CONTEXT(ctx
);
7666 FLUSH_VERTICES(ctx
, 0);
7667 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
7670 static void GLAPIENTRY
7671 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7673 GET_CURRENT_CONTEXT(ctx
);
7674 FLUSH_VERTICES(ctx
, 0);
7675 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
7678 static void GLAPIENTRY
7679 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7681 GET_CURRENT_CONTEXT(ctx
);
7682 FLUSH_VERTICES(ctx
, 0);
7683 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
7686 static GLboolean GLAPIENTRY
7687 exec_IsEnabled(GLenum cap
)
7689 GET_CURRENT_CONTEXT(ctx
);
7690 FLUSH_VERTICES(ctx
, 0);
7691 return CALL_IsEnabled(ctx
->Exec
, (cap
));
7694 static void GLAPIENTRY
7695 exec_PixelStoref(GLenum pname
, GLfloat param
)
7697 GET_CURRENT_CONTEXT(ctx
);
7698 FLUSH_VERTICES(ctx
, 0);
7699 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
7702 static void GLAPIENTRY
7703 exec_PixelStorei(GLenum pname
, GLint param
)
7705 GET_CURRENT_CONTEXT(ctx
);
7706 FLUSH_VERTICES(ctx
, 0);
7707 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
7710 static void GLAPIENTRY
7711 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
7712 GLenum format
, GLenum type
, GLvoid
* pixels
)
7714 GET_CURRENT_CONTEXT(ctx
);
7715 FLUSH_VERTICES(ctx
, 0);
7716 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
7719 static GLint GLAPIENTRY
7720 exec_RenderMode(GLenum mode
)
7722 GET_CURRENT_CONTEXT(ctx
);
7723 FLUSH_VERTICES(ctx
, 0);
7724 return CALL_RenderMode(ctx
->Exec
, (mode
));
7727 static void GLAPIENTRY
7728 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
7730 GET_CURRENT_CONTEXT(ctx
);
7731 FLUSH_VERTICES(ctx
, 0);
7732 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
7735 static void GLAPIENTRY
7736 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
7738 GET_CURRENT_CONTEXT(ctx
);
7739 FLUSH_VERTICES(ctx
, 0);
7740 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
7743 static GLboolean GLAPIENTRY
7744 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
7745 GLboolean
* residences
)
7747 GET_CURRENT_CONTEXT(ctx
);
7748 FLUSH_VERTICES(ctx
, 0);
7749 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
7752 static void GLAPIENTRY
7753 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7755 GET_CURRENT_CONTEXT(ctx
);
7756 FLUSH_VERTICES(ctx
, 0);
7757 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7760 static void GLAPIENTRY
7761 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
7763 GET_CURRENT_CONTEXT(ctx
);
7764 FLUSH_VERTICES(ctx
, 0);
7765 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
7768 static void GLAPIENTRY
7769 exec_DisableClientState(GLenum cap
)
7771 GET_CURRENT_CONTEXT(ctx
);
7772 FLUSH_VERTICES(ctx
, 0);
7773 CALL_DisableClientState(ctx
->Exec
, (cap
));
7776 static void GLAPIENTRY
7777 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
7779 GET_CURRENT_CONTEXT(ctx
);
7780 FLUSH_VERTICES(ctx
, 0);
7781 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
7784 static void GLAPIENTRY
7785 exec_EnableClientState(GLenum cap
)
7787 GET_CURRENT_CONTEXT(ctx
);
7788 FLUSH_VERTICES(ctx
, 0);
7789 CALL_EnableClientState(ctx
->Exec
, (cap
));
7792 static void GLAPIENTRY
7793 exec_GenTextures(GLsizei n
, GLuint
* texName
)
7795 GET_CURRENT_CONTEXT(ctx
);
7796 FLUSH_VERTICES(ctx
, 0);
7797 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
7800 static void GLAPIENTRY
7801 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
7803 GET_CURRENT_CONTEXT(ctx
);
7804 FLUSH_VERTICES(ctx
, 0);
7805 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
7808 static void GLAPIENTRY
7809 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7811 GET_CURRENT_CONTEXT(ctx
);
7812 FLUSH_VERTICES(ctx
, 0);
7813 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
7816 static void GLAPIENTRY
7817 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
7819 GET_CURRENT_CONTEXT(ctx
);
7820 FLUSH_VERTICES(ctx
, 0);
7821 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
7824 static GLboolean GLAPIENTRY
7825 exec_IsTexture(GLuint texture
)
7827 GET_CURRENT_CONTEXT(ctx
);
7828 FLUSH_VERTICES(ctx
, 0);
7829 return CALL_IsTexture(ctx
->Exec
, (texture
));
7832 static void GLAPIENTRY
7833 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7835 GET_CURRENT_CONTEXT(ctx
);
7836 FLUSH_VERTICES(ctx
, 0);
7837 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
7840 static void GLAPIENTRY
7841 exec_PopClientAttrib(void)
7843 GET_CURRENT_CONTEXT(ctx
);
7844 FLUSH_VERTICES(ctx
, 0);
7845 CALL_PopClientAttrib(ctx
->Exec
, ());
7848 static void GLAPIENTRY
7849 exec_PushClientAttrib(GLbitfield mask
)
7851 GET_CURRENT_CONTEXT(ctx
);
7852 FLUSH_VERTICES(ctx
, 0);
7853 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
7856 static void GLAPIENTRY
7857 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
7860 GET_CURRENT_CONTEXT(ctx
);
7861 FLUSH_VERTICES(ctx
, 0);
7862 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7865 static void GLAPIENTRY
7866 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
7868 GET_CURRENT_CONTEXT(ctx
);
7869 FLUSH_VERTICES(ctx
, 0);
7870 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
7873 static void GLAPIENTRY
7874 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
7877 GET_CURRENT_CONTEXT(ctx
);
7878 FLUSH_VERTICES(ctx
, 0);
7879 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7882 static void GLAPIENTRY
7883 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
7884 GLint x
, GLint y
, GLsizei width
)
7886 GET_CURRENT_CONTEXT(ctx
);
7887 FLUSH_VERTICES(ctx
, 0);
7888 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
7889 (target
, internalFormat
, x
, y
, width
));
7892 static void GLAPIENTRY
7893 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
7894 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
7896 GET_CURRENT_CONTEXT(ctx
);
7897 FLUSH_VERTICES(ctx
, 0);
7898 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
7899 (target
, internalFormat
, x
, y
, width
,
7903 static void GLAPIENTRY
7904 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
7906 GET_CURRENT_CONTEXT(ctx
);
7907 FLUSH_VERTICES(ctx
, 0);
7908 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
7911 static void GLAPIENTRY
7912 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7914 GET_CURRENT_CONTEXT(ctx
);
7915 FLUSH_VERTICES(ctx
, 0);
7916 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
7919 static void GLAPIENTRY
7920 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7922 GET_CURRENT_CONTEXT(ctx
);
7923 FLUSH_VERTICES(ctx
, 0);
7924 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
7927 static void GLAPIENTRY
7928 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
7931 GET_CURRENT_CONTEXT(ctx
);
7932 FLUSH_VERTICES(ctx
, 0);
7933 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
7936 static void GLAPIENTRY
7937 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7939 GET_CURRENT_CONTEXT(ctx
);
7940 FLUSH_VERTICES(ctx
, 0);
7941 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
7944 static void GLAPIENTRY
7945 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7947 GET_CURRENT_CONTEXT(ctx
);
7948 FLUSH_VERTICES(ctx
, 0);
7949 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
7952 static void GLAPIENTRY
7953 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
7954 GLenum type
, GLvoid
*values
)
7956 GET_CURRENT_CONTEXT(ctx
);
7957 FLUSH_VERTICES(ctx
, 0);
7958 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7961 static void GLAPIENTRY
7962 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7964 GET_CURRENT_CONTEXT(ctx
);
7965 FLUSH_VERTICES(ctx
, 0);
7966 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
7969 static void GLAPIENTRY
7970 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7972 GET_CURRENT_CONTEXT(ctx
);
7973 FLUSH_VERTICES(ctx
, 0);
7974 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
7977 static void GLAPIENTRY
7978 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
7979 GLenum type
, GLvoid
*values
)
7981 GET_CURRENT_CONTEXT(ctx
);
7982 FLUSH_VERTICES(ctx
, 0);
7983 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7986 static void GLAPIENTRY
7987 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7989 GET_CURRENT_CONTEXT(ctx
);
7990 FLUSH_VERTICES(ctx
, 0);
7991 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
7994 static void GLAPIENTRY
7995 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7997 GET_CURRENT_CONTEXT(ctx
);
7998 FLUSH_VERTICES(ctx
, 0);
7999 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
8002 static void GLAPIENTRY
8003 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
8004 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
8006 GET_CURRENT_CONTEXT(ctx
);
8007 FLUSH_VERTICES(ctx
, 0);
8008 CALL_GetSeparableFilter(ctx
->Exec
,
8009 (target
, format
, type
, row
, column
, span
));
8012 static void GLAPIENTRY
8013 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
8014 GLsizei width
, GLsizei height
, GLenum format
,
8015 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
8017 GET_CURRENT_CONTEXT(ctx
);
8018 FLUSH_VERTICES(ctx
, 0);
8019 CALL_SeparableFilter2D(ctx
->Exec
,
8020 (target
, internalFormat
, width
, height
, format
,
8021 type
, row
, column
));
8024 static void GLAPIENTRY
8025 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8026 GLsizei count
, const GLvoid
*ptr
)
8028 GET_CURRENT_CONTEXT(ctx
);
8029 FLUSH_VERTICES(ctx
, 0);
8030 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8033 static void GLAPIENTRY
8034 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
8036 GET_CURRENT_CONTEXT(ctx
);
8037 FLUSH_VERTICES(ctx
, 0);
8038 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
8041 static void GLAPIENTRY
8042 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
8045 GET_CURRENT_CONTEXT(ctx
);
8046 FLUSH_VERTICES(ctx
, 0);
8047 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
8050 static void GLAPIENTRY
8051 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
8054 GET_CURRENT_CONTEXT(ctx
);
8055 FLUSH_VERTICES(ctx
, 0);
8056 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
8059 static void GLAPIENTRY
8060 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8061 GLsizei count
, const GLvoid
*ptr
)
8063 GET_CURRENT_CONTEXT(ctx
);
8064 FLUSH_VERTICES(ctx
, 0);
8065 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8068 static void GLAPIENTRY
8069 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8070 GLsizei count
, const GLvoid
*ptr
)
8072 GET_CURRENT_CONTEXT(ctx
);
8073 FLUSH_VERTICES(ctx
, 0);
8074 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8077 static void GLAPIENTRY
8078 exec_LockArraysEXT(GLint first
, GLsizei count
)
8080 GET_CURRENT_CONTEXT(ctx
);
8081 FLUSH_VERTICES(ctx
, 0);
8082 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
8085 static void GLAPIENTRY
8086 exec_UnlockArraysEXT(void)
8088 GET_CURRENT_CONTEXT(ctx
);
8089 FLUSH_VERTICES(ctx
, 0);
8090 CALL_UnlockArraysEXT(ctx
->Exec
, ());
8093 static void GLAPIENTRY
8094 exec_ClientActiveTextureARB(GLenum target
)
8096 GET_CURRENT_CONTEXT(ctx
);
8097 FLUSH_VERTICES(ctx
, 0);
8098 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
8101 static void GLAPIENTRY
8102 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
8103 GLsizei stride
, const GLvoid
*ptr
)
8105 GET_CURRENT_CONTEXT(ctx
);
8106 FLUSH_VERTICES(ctx
, 0);
8107 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
8110 static void GLAPIENTRY
8111 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8113 GET_CURRENT_CONTEXT(ctx
);
8114 FLUSH_VERTICES(ctx
, 0);
8115 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
8118 /* GL_EXT_multi_draw_arrays */
8119 static void GLAPIENTRY
8120 exec_MultiDrawArraysEXT(GLenum mode
, GLint
* first
,
8121 GLsizei
* count
, GLsizei primcount
)
8123 GET_CURRENT_CONTEXT(ctx
);
8124 FLUSH_VERTICES(ctx
, 0);
8125 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
8128 /* GL_EXT_multi_draw_arrays */
8129 static void GLAPIENTRY
8130 exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
* count
,
8131 GLenum type
, const GLvoid
** indices
,
8134 GET_CURRENT_CONTEXT(ctx
);
8135 FLUSH_VERTICES(ctx
, 0);
8136 CALL_MultiDrawElementsEXT(ctx
->Exec
,
8137 (mode
, count
, type
, indices
, primcount
));
8140 /* GL_IBM_multimode_draw_arrays */
8141 static void GLAPIENTRY
8142 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
8143 const GLsizei
* count
, GLsizei primcount
,
8146 GET_CURRENT_CONTEXT(ctx
);
8147 FLUSH_VERTICES(ctx
, 0);
8148 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
8149 (mode
, first
, count
, primcount
, modestride
));
8152 /* GL_IBM_multimode_draw_arrays */
8153 static void GLAPIENTRY
8154 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
8155 const GLsizei
* count
,
8157 const GLvoid
* const *indices
,
8158 GLsizei primcount
, GLint modestride
)
8160 GET_CURRENT_CONTEXT(ctx
);
8161 FLUSH_VERTICES(ctx
, 0);
8162 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
8163 (mode
, count
, type
, indices
, primcount
,
8170 * Setup the given dispatch table to point to Mesa's display list
8171 * building functions.
8173 * This does not include any of the tnl functions - they are
8174 * initialized from _mesa_init_api_defaults and from the active vtxfmt
8178 _mesa_init_dlist_table(struct _glapi_table
*table
)
8180 _mesa_loopback_init_api_table(table
);
8183 SET_Accum(table
, save_Accum
);
8184 SET_AlphaFunc(table
, save_AlphaFunc
);
8185 SET_Bitmap(table
, save_Bitmap
);
8186 SET_BlendFunc(table
, save_BlendFunc
);
8187 SET_CallList(table
, _mesa_save_CallList
);
8188 SET_CallLists(table
, _mesa_save_CallLists
);
8189 SET_Clear(table
, save_Clear
);
8190 SET_ClearAccum(table
, save_ClearAccum
);
8191 SET_ClearColor(table
, save_ClearColor
);
8192 SET_ClearDepth(table
, save_ClearDepth
);
8193 SET_ClearIndex(table
, save_ClearIndex
);
8194 SET_ClearStencil(table
, save_ClearStencil
);
8195 SET_ClipPlane(table
, save_ClipPlane
);
8196 SET_ColorMask(table
, save_ColorMask
);
8197 SET_ColorMaterial(table
, save_ColorMaterial
);
8198 SET_CopyPixels(table
, save_CopyPixels
);
8199 SET_CullFace(table
, save_CullFace
);
8200 SET_DeleteLists(table
, _mesa_DeleteLists
);
8201 SET_DepthFunc(table
, save_DepthFunc
);
8202 SET_DepthMask(table
, save_DepthMask
);
8203 SET_DepthRange(table
, save_DepthRange
);
8204 SET_Disable(table
, save_Disable
);
8205 SET_DrawBuffer(table
, save_DrawBuffer
);
8206 SET_DrawPixels(table
, save_DrawPixels
);
8207 SET_Enable(table
, save_Enable
);
8208 SET_EndList(table
, _mesa_EndList
);
8209 SET_EvalMesh1(table
, _mesa_save_EvalMesh1
);
8210 SET_EvalMesh2(table
, _mesa_save_EvalMesh2
);
8211 SET_Finish(table
, exec_Finish
);
8212 SET_Flush(table
, exec_Flush
);
8213 SET_Fogf(table
, save_Fogf
);
8214 SET_Fogfv(table
, save_Fogfv
);
8215 SET_Fogi(table
, save_Fogi
);
8216 SET_Fogiv(table
, save_Fogiv
);
8217 SET_FrontFace(table
, save_FrontFace
);
8218 SET_Frustum(table
, save_Frustum
);
8219 SET_GenLists(table
, _mesa_GenLists
);
8220 SET_GetBooleanv(table
, exec_GetBooleanv
);
8221 SET_GetClipPlane(table
, exec_GetClipPlane
);
8222 SET_GetDoublev(table
, exec_GetDoublev
);
8223 SET_GetError(table
, exec_GetError
);
8224 SET_GetFloatv(table
, exec_GetFloatv
);
8225 SET_GetIntegerv(table
, exec_GetIntegerv
);
8226 SET_GetLightfv(table
, exec_GetLightfv
);
8227 SET_GetLightiv(table
, exec_GetLightiv
);
8228 SET_GetMapdv(table
, exec_GetMapdv
);
8229 SET_GetMapfv(table
, exec_GetMapfv
);
8230 SET_GetMapiv(table
, exec_GetMapiv
);
8231 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
8232 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
8233 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
8234 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
8235 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
8236 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
8237 SET_GetString(table
, exec_GetString
);
8238 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
8239 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
8240 SET_GetTexGendv(table
, exec_GetTexGendv
);
8241 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
8242 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
8243 SET_GetTexImage(table
, exec_GetTexImage
);
8244 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
8245 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
8246 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
8247 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
8248 SET_Hint(table
, save_Hint
);
8249 SET_IndexMask(table
, save_IndexMask
);
8250 SET_InitNames(table
, save_InitNames
);
8251 SET_IsEnabled(table
, exec_IsEnabled
);
8252 SET_IsList(table
, _mesa_IsList
);
8253 SET_LightModelf(table
, save_LightModelf
);
8254 SET_LightModelfv(table
, save_LightModelfv
);
8255 SET_LightModeli(table
, save_LightModeli
);
8256 SET_LightModeliv(table
, save_LightModeliv
);
8257 SET_Lightf(table
, save_Lightf
);
8258 SET_Lightfv(table
, save_Lightfv
);
8259 SET_Lighti(table
, save_Lighti
);
8260 SET_Lightiv(table
, save_Lightiv
);
8261 SET_LineStipple(table
, save_LineStipple
);
8262 SET_LineWidth(table
, save_LineWidth
);
8263 SET_ListBase(table
, save_ListBase
);
8264 SET_LoadIdentity(table
, save_LoadIdentity
);
8265 SET_LoadMatrixd(table
, save_LoadMatrixd
);
8266 SET_LoadMatrixf(table
, save_LoadMatrixf
);
8267 SET_LoadName(table
, save_LoadName
);
8268 SET_LogicOp(table
, save_LogicOp
);
8269 SET_Map1d(table
, save_Map1d
);
8270 SET_Map1f(table
, save_Map1f
);
8271 SET_Map2d(table
, save_Map2d
);
8272 SET_Map2f(table
, save_Map2f
);
8273 SET_MapGrid1d(table
, save_MapGrid1d
);
8274 SET_MapGrid1f(table
, save_MapGrid1f
);
8275 SET_MapGrid2d(table
, save_MapGrid2d
);
8276 SET_MapGrid2f(table
, save_MapGrid2f
);
8277 SET_MatrixMode(table
, save_MatrixMode
);
8278 SET_MultMatrixd(table
, save_MultMatrixd
);
8279 SET_MultMatrixf(table
, save_MultMatrixf
);
8280 SET_NewList(table
, save_NewList
);
8281 SET_Ortho(table
, save_Ortho
);
8282 SET_PassThrough(table
, save_PassThrough
);
8283 SET_PixelMapfv(table
, save_PixelMapfv
);
8284 SET_PixelMapuiv(table
, save_PixelMapuiv
);
8285 SET_PixelMapusv(table
, save_PixelMapusv
);
8286 SET_PixelStoref(table
, exec_PixelStoref
);
8287 SET_PixelStorei(table
, exec_PixelStorei
);
8288 SET_PixelTransferf(table
, save_PixelTransferf
);
8289 SET_PixelTransferi(table
, save_PixelTransferi
);
8290 SET_PixelZoom(table
, save_PixelZoom
);
8291 SET_PointSize(table
, save_PointSize
);
8292 SET_PolygonMode(table
, save_PolygonMode
);
8293 SET_PolygonOffset(table
, save_PolygonOffset
);
8294 SET_PolygonStipple(table
, save_PolygonStipple
);
8295 SET_PopAttrib(table
, save_PopAttrib
);
8296 SET_PopMatrix(table
, save_PopMatrix
);
8297 SET_PopName(table
, save_PopName
);
8298 SET_PushAttrib(table
, save_PushAttrib
);
8299 SET_PushMatrix(table
, save_PushMatrix
);
8300 SET_PushName(table
, save_PushName
);
8301 SET_RasterPos2d(table
, save_RasterPos2d
);
8302 SET_RasterPos2dv(table
, save_RasterPos2dv
);
8303 SET_RasterPos2f(table
, save_RasterPos2f
);
8304 SET_RasterPos2fv(table
, save_RasterPos2fv
);
8305 SET_RasterPos2i(table
, save_RasterPos2i
);
8306 SET_RasterPos2iv(table
, save_RasterPos2iv
);
8307 SET_RasterPos2s(table
, save_RasterPos2s
);
8308 SET_RasterPos2sv(table
, save_RasterPos2sv
);
8309 SET_RasterPos3d(table
, save_RasterPos3d
);
8310 SET_RasterPos3dv(table
, save_RasterPos3dv
);
8311 SET_RasterPos3f(table
, save_RasterPos3f
);
8312 SET_RasterPos3fv(table
, save_RasterPos3fv
);
8313 SET_RasterPos3i(table
, save_RasterPos3i
);
8314 SET_RasterPos3iv(table
, save_RasterPos3iv
);
8315 SET_RasterPos3s(table
, save_RasterPos3s
);
8316 SET_RasterPos3sv(table
, save_RasterPos3sv
);
8317 SET_RasterPos4d(table
, save_RasterPos4d
);
8318 SET_RasterPos4dv(table
, save_RasterPos4dv
);
8319 SET_RasterPos4f(table
, save_RasterPos4f
);
8320 SET_RasterPos4fv(table
, save_RasterPos4fv
);
8321 SET_RasterPos4i(table
, save_RasterPos4i
);
8322 SET_RasterPos4iv(table
, save_RasterPos4iv
);
8323 SET_RasterPos4s(table
, save_RasterPos4s
);
8324 SET_RasterPos4sv(table
, save_RasterPos4sv
);
8325 SET_ReadBuffer(table
, save_ReadBuffer
);
8326 SET_ReadPixels(table
, exec_ReadPixels
);
8327 SET_RenderMode(table
, exec_RenderMode
);
8328 SET_Rotated(table
, save_Rotated
);
8329 SET_Rotatef(table
, save_Rotatef
);
8330 SET_Scaled(table
, save_Scaled
);
8331 SET_Scalef(table
, save_Scalef
);
8332 SET_Scissor(table
, save_Scissor
);
8333 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
8334 SET_SelectBuffer(table
, exec_SelectBuffer
);
8335 SET_ShadeModel(table
, save_ShadeModel
);
8336 SET_StencilFunc(table
, save_StencilFunc
);
8337 SET_StencilMask(table
, save_StencilMask
);
8338 SET_StencilOp(table
, save_StencilOp
);
8339 SET_TexEnvf(table
, save_TexEnvf
);
8340 SET_TexEnvfv(table
, save_TexEnvfv
);
8341 SET_TexEnvi(table
, save_TexEnvi
);
8342 SET_TexEnviv(table
, save_TexEnviv
);
8343 SET_TexGend(table
, save_TexGend
);
8344 SET_TexGendv(table
, save_TexGendv
);
8345 SET_TexGenf(table
, save_TexGenf
);
8346 SET_TexGenfv(table
, save_TexGenfv
);
8347 SET_TexGeni(table
, save_TexGeni
);
8348 SET_TexGeniv(table
, save_TexGeniv
);
8349 SET_TexImage1D(table
, save_TexImage1D
);
8350 SET_TexImage2D(table
, save_TexImage2D
);
8351 SET_TexParameterf(table
, save_TexParameterf
);
8352 SET_TexParameterfv(table
, save_TexParameterfv
);
8353 SET_TexParameteri(table
, save_TexParameteri
);
8354 SET_TexParameteriv(table
, save_TexParameteriv
);
8355 SET_Translated(table
, save_Translated
);
8356 SET_Translatef(table
, save_Translatef
);
8357 SET_Viewport(table
, save_Viewport
);
8360 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
8361 SET_BindTexture(table
, save_BindTexture
);
8362 SET_ColorPointer(table
, exec_ColorPointer
);
8363 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
8364 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
8365 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
8366 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
8367 SET_DeleteTextures(table
, exec_DeleteTextures
);
8368 SET_DisableClientState(table
, exec_DisableClientState
);
8369 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
8370 SET_EnableClientState(table
, exec_EnableClientState
);
8371 SET_GenTextures(table
, exec_GenTextures
);
8372 SET_GetPointerv(table
, exec_GetPointerv
);
8373 SET_IndexPointer(table
, exec_IndexPointer
);
8374 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
8375 SET_IsTexture(table
, exec_IsTexture
);
8376 SET_NormalPointer(table
, exec_NormalPointer
);
8377 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
8378 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
8379 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
8380 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
8381 SET_TexSubImage1D(table
, save_TexSubImage1D
);
8382 SET_TexSubImage2D(table
, save_TexSubImage2D
);
8383 SET_VertexPointer(table
, exec_VertexPointer
);
8386 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
8387 SET_TexImage3D(table
, save_TexImage3D
);
8388 SET_TexSubImage3D(table
, save_TexSubImage3D
);
8391 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
8392 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
8393 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
8395 /* ATI_separate_stencil */
8396 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
8398 /* GL_ARB_imaging */
8399 /* Not all are supported */
8400 SET_BlendColor(table
, save_BlendColor
);
8401 SET_BlendEquation(table
, save_BlendEquation
);
8402 SET_ColorSubTable(table
, save_ColorSubTable
);
8403 SET_ColorTable(table
, save_ColorTable
);
8404 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
8405 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
8406 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
8407 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
8408 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
8409 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
8410 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
8411 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
8412 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
8413 SET_CopyColorTable(table
, save_CopyColorTable
);
8414 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
8415 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
8416 SET_GetColorTable(table
, exec_GetColorTable
);
8417 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
8418 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
8419 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
8420 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
8421 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
8422 SET_GetHistogram(table
, exec_GetHistogram
);
8423 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
8424 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
8425 SET_GetMinmax(table
, exec_GetMinmax
);
8426 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
8427 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
8428 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
8429 SET_Histogram(table
, save_Histogram
);
8430 SET_Minmax(table
, save_Minmax
);
8431 SET_ResetHistogram(table
, save_ResetHistogram
);
8432 SET_ResetMinmax(table
, save_ResetMinmax
);
8433 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
8435 /* 2. GL_EXT_blend_color */
8437 SET_BlendColorEXT(table
, save_BlendColorEXT
);
8440 /* 3. GL_EXT_polygon_offset */
8441 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
8443 /* 6. GL_EXT_texture3d */
8445 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
8446 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
8447 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
8450 /* 14. GL_SGI_color_table */
8452 SET_ColorTableSGI(table
, save_ColorTable
);
8453 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
8454 SET_GetColorTableSGI(table
, exec_GetColorTable
);
8455 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
8456 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
8459 /* 30. GL_EXT_vertex_array */
8460 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
8461 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
8462 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
8463 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
8464 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
8465 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
8467 /* 37. GL_EXT_blend_minmax */
8469 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
8472 /* 54. GL_EXT_point_parameters */
8473 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
8474 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
8476 /* 97. GL_EXT_compiled_vertex_array */
8477 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
8478 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
8480 /* 145. GL_EXT_secondary_color */
8481 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
8483 /* 148. GL_EXT_multi_draw_arrays */
8484 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
8485 SET_MultiDrawElementsEXT(table
, exec_MultiDrawElementsEXT
);
8487 /* 149. GL_EXT_fog_coord */
8488 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
8490 /* 173. GL_EXT_blend_func_separate */
8491 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
8493 /* 196. GL_MESA_resize_buffers */
8494 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
8496 /* 197. GL_MESA_window_pos */
8497 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
8498 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
8499 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
8500 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
8501 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
8502 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
8503 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
8504 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
8505 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
8506 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
8507 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
8508 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
8509 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
8510 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
8511 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
8512 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
8513 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
8514 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
8515 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
8516 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
8517 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
8518 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
8519 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
8520 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
8522 /* 200. GL_IBM_multimode_draw_arrays */
8523 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
8524 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
8526 #if FEATURE_NV_vertex_program
8527 /* 233. GL_NV_vertex_program */
8528 /* The following commands DO NOT go into display lists:
8529 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
8530 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
8532 SET_BindProgramNV(table
, save_BindProgramNV
);
8533 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8534 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
8535 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8536 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
8537 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
8538 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
8539 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
8540 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
8541 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
8542 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
8543 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8544 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8545 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8546 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8547 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
8548 SET_LoadProgramNV(table
, save_LoadProgramNV
);
8549 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
8550 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
8551 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
8552 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
8553 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
8554 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
8555 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
8556 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
8559 /* 244. GL_ATI_envmap_bumpmap */
8560 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
8561 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
8563 /* 245. GL_ATI_fragment_shader */
8564 #if FEATURE_ATI_fragment_shader
8565 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
8566 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
8569 /* 282. GL_NV_fragment_program */
8570 #if FEATURE_NV_fragment_program
8571 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
8572 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
8573 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
8574 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
8575 SET_GetProgramNamedParameterfvNV(table
,
8576 _mesa_GetProgramNamedParameterfvNV
);
8577 SET_GetProgramNamedParameterdvNV(table
,
8578 _mesa_GetProgramNamedParameterdvNV
);
8579 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8580 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8581 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8582 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8583 SET_GetProgramLocalParameterdvARB(table
,
8584 _mesa_GetProgramLocalParameterdvARB
);
8585 SET_GetProgramLocalParameterfvARB(table
,
8586 _mesa_GetProgramLocalParameterfvARB
);
8589 /* 262. GL_NV_point_sprite */
8590 SET_PointParameteriNV(table
, save_PointParameteriNV
);
8591 SET_PointParameterivNV(table
, save_PointParameterivNV
);
8593 /* 268. GL_EXT_stencil_two_side */
8594 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
8596 /* 273. GL_APPLE_vertex_array_object */
8597 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
8598 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
8599 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
8600 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
8602 /* ???. GL_EXT_depth_bounds_test */
8603 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
8605 /* ARB 1. GL_ARB_multitexture */
8606 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
8607 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
8609 /* ARB 3. GL_ARB_transpose_matrix */
8610 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
8611 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
8612 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
8613 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
8615 /* ARB 5. GL_ARB_multisample */
8616 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
8618 /* ARB 12. GL_ARB_texture_compression */
8619 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
8620 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
8621 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
8622 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
8623 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
8624 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
8625 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
8627 /* ARB 14. GL_ARB_point_parameters */
8628 /* aliased with EXT_point_parameters functions */
8630 /* ARB 25. GL_ARB_window_pos */
8631 /* aliased with MESA_window_pos functions */
8633 /* ARB 26. GL_ARB_vertex_program */
8634 /* ARB 27. GL_ARB_fragment_program */
8635 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8636 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
8637 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
8638 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
8639 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
8640 SET_ProgramStringARB(table
, save_ProgramStringARB
);
8641 SET_BindProgramNV(table
, save_BindProgramNV
);
8642 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8643 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8644 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
8645 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8646 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8647 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8648 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8649 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
8650 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
8651 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
8652 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
8653 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8654 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8655 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8656 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8657 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
8658 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
8659 SET_GetProgramLocalParameterdvARB(table
,
8660 _mesa_GetProgramLocalParameterdvARB
);
8661 SET_GetProgramLocalParameterfvARB(table
,
8662 _mesa_GetProgramLocalParameterfvARB
);
8663 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
8664 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
8667 /* ARB 28. GL_ARB_vertex_buffer_object */
8668 #if FEATURE_ARB_vertex_buffer_object
8669 /* None of the extension's functions get compiled */
8670 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
8671 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
8672 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
8673 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
8674 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
8675 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
8676 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
8677 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
8678 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
8679 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
8680 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
8683 #if FEATURE_ARB_occlusion_query
8684 SET_BeginQueryARB(table
, save_BeginQueryARB
);
8685 SET_EndQueryARB(table
, save_EndQueryARB
);
8686 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
8687 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
8688 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
8689 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
8690 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
8691 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
8693 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
8695 #if FEATURE_EXT_framebuffer_blit
8696 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
8699 /* GL_ARB_shader_objects */
8700 SET_UseProgramObjectARB(table
, save_UseProgramObjectARB
);
8701 SET_Uniform1fARB(table
, save_Uniform1fARB
);
8702 SET_Uniform2fARB(table
, save_Uniform2fARB
);
8703 SET_Uniform3fARB(table
, save_Uniform3fARB
);
8704 SET_Uniform4fARB(table
, save_Uniform4fARB
);
8705 SET_Uniform1fvARB(table
, save_Uniform1fvARB
);
8706 SET_Uniform2fvARB(table
, save_Uniform2fvARB
);
8707 SET_Uniform3fvARB(table
, save_Uniform3fvARB
);
8708 SET_Uniform4fvARB(table
, save_Uniform4fvARB
);
8709 SET_Uniform1iARB(table
, save_Uniform1iARB
);
8710 SET_Uniform2iARB(table
, save_Uniform2iARB
);
8711 SET_Uniform3iARB(table
, save_Uniform3iARB
);
8712 SET_Uniform4iARB(table
, save_Uniform4iARB
);
8713 SET_Uniform1ivARB(table
, save_Uniform1ivARB
);
8714 SET_Uniform2ivARB(table
, save_Uniform2ivARB
);
8715 SET_Uniform3ivARB(table
, save_Uniform3ivARB
);
8716 SET_Uniform4ivARB(table
, save_Uniform4ivARB
);
8718 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
8719 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
8720 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
8721 /* XXX additional functions need to be implemented here! */
8723 /* 299. GL_EXT_blend_equation_separate */
8724 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
8726 /* GL_EXT_gpu_program_parmaeters */
8727 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8728 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
8729 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
8736 enum_string(GLenum k
)
8738 return _mesa_lookup_enum_by_nr(k
);
8743 * Print the commands in a display list. For debugging only.
8744 * TODO: many commands aren't handled yet.
8746 static void GLAPIENTRY
8747 print_list(GLcontext
*ctx
, GLuint list
)
8749 struct gl_display_list
*dlist
;
8753 if (!islist(ctx
, list
)) {
8754 _mesa_printf("%u is not a display list ID\n", list
);
8758 dlist
= lookup_list(ctx
, list
);
8764 _mesa_printf("START-LIST %u, address %p\n", list
, (void *) n
);
8766 done
= n
? GL_FALSE
: GL_TRUE
;
8768 OpCode opcode
= n
[0].opcode
;
8769 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
8771 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
8772 /* this is a driver-extended opcode */
8773 ctx
->ListExt
.Opcode
[i
].Print(ctx
, &n
[1]);
8774 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
8779 _mesa_printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
8782 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
8783 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
8785 case OPCODE_CALL_LIST
:
8786 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
8788 case OPCODE_CALL_LIST_OFFSET
:
8789 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
8790 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
8792 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
8793 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
8794 enum_string(n
[1].e
), enum_string(n
[2].e
),
8795 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8797 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
8798 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
8799 enum_string(n
[1].e
), enum_string(n
[2].e
),
8800 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
8802 case OPCODE_DISABLE
:
8803 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
8806 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
8808 case OPCODE_FRUSTUM
:
8809 _mesa_printf("Frustum %g %g %g %g %g %g\n",
8810 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8812 case OPCODE_LINE_STIPPLE
:
8813 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
8815 case OPCODE_LOAD_IDENTITY
:
8816 _mesa_printf("LoadIdentity\n");
8818 case OPCODE_LOAD_MATRIX
:
8819 _mesa_printf("LoadMatrix\n");
8820 _mesa_printf(" %8f %8f %8f %8f\n",
8821 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8822 _mesa_printf(" %8f %8f %8f %8f\n",
8823 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8824 _mesa_printf(" %8f %8f %8f %8f\n",
8825 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8826 _mesa_printf(" %8f %8f %8f %8f\n",
8827 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8829 case OPCODE_MULT_MATRIX
:
8830 _mesa_printf("MultMatrix (or Rotate)\n");
8831 _mesa_printf(" %8f %8f %8f %8f\n",
8832 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8833 _mesa_printf(" %8f %8f %8f %8f\n",
8834 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8835 _mesa_printf(" %8f %8f %8f %8f\n",
8836 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8837 _mesa_printf(" %8f %8f %8f %8f\n",
8838 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8841 _mesa_printf("Ortho %g %g %g %g %g %g\n",
8842 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8844 case OPCODE_POP_ATTRIB
:
8845 _mesa_printf("PopAttrib\n");
8847 case OPCODE_POP_MATRIX
:
8848 _mesa_printf("PopMatrix\n");
8850 case OPCODE_POP_NAME
:
8851 _mesa_printf("PopName\n");
8853 case OPCODE_PUSH_ATTRIB
:
8854 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
8856 case OPCODE_PUSH_MATRIX
:
8857 _mesa_printf("PushMatrix\n");
8859 case OPCODE_PUSH_NAME
:
8860 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
8862 case OPCODE_RASTER_POS
:
8863 _mesa_printf("RasterPos %g %g %g %g\n",
8864 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8867 _mesa_printf("Rotate %g %g %g %g\n",
8868 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8871 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8873 case OPCODE_TRANSLATE
:
8874 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8876 case OPCODE_BIND_TEXTURE
:
8877 _mesa_printf("BindTexture %s %d\n",
8878 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
8880 case OPCODE_SHADE_MODEL
:
8881 _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
8884 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
8885 _mesa_lookup_enum_by_nr(n
[1].ui
),
8886 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
8889 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
8890 _mesa_lookup_enum_by_nr(n
[1].ui
),
8891 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
8892 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
8894 case OPCODE_MAPGRID1
:
8895 _mesa_printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
8897 case OPCODE_MAPGRID2
:
8898 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
8899 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
8901 case OPCODE_EVALMESH1
:
8902 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
8904 case OPCODE_EVALMESH2
:
8905 _mesa_printf("EvalMesh2 %d %d %d %d\n",
8906 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
8909 case OPCODE_ATTR_1F_NV
:
8910 _mesa_printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
8912 case OPCODE_ATTR_2F_NV
:
8913 _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
8914 n
[1].i
, n
[2].f
, n
[3].f
);
8916 case OPCODE_ATTR_3F_NV
:
8917 _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
8918 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8920 case OPCODE_ATTR_4F_NV
:
8921 _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
8922 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8924 case OPCODE_ATTR_1F_ARB
:
8925 _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
8927 case OPCODE_ATTR_2F_ARB
:
8928 _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
8929 n
[1].i
, n
[2].f
, n
[3].f
);
8931 case OPCODE_ATTR_3F_ARB
:
8932 _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
8933 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8935 case OPCODE_ATTR_4F_ARB
:
8936 _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
8937 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8940 case OPCODE_MATERIAL
:
8941 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
8942 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8945 _mesa_printf("BEGIN %x\n", n
[1].i
);
8948 _mesa_printf("END\n");
8951 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
8954 case OPCODE_EVAL_C1
:
8955 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
8957 case OPCODE_EVAL_C2
:
8958 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
8960 case OPCODE_EVAL_P1
:
8961 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
8963 case OPCODE_EVAL_P2
:
8964 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
8968 * meta opcodes/commands
8971 _mesa_printf("Error: %s %s\n",
8972 enum_string(n
[1].e
), (const char *) n
[2].data
);
8974 case OPCODE_CONTINUE
:
8975 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
8976 n
= (Node
*) n
[1].next
;
8978 case OPCODE_END_OF_LIST
:
8979 _mesa_printf("END-LIST %u\n", list
);
8983 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
8985 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
8986 opcode
, (void *) n
);
8990 _mesa_printf("command %d, %u operands\n", opcode
,
8994 /* increment n to point to next compiled command */
8995 if (opcode
!= OPCODE_CONTINUE
) {
8996 n
+= InstSize
[opcode
];
9005 * Clients may call this function to help debug display list problems.
9006 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
9007 * changed, or break in the future without notice.
9010 mesa_print_display_list(GLuint list
)
9012 GET_CURRENT_CONTEXT(ctx
);
9013 print_list(ctx
, list
);
9017 /**********************************************************************/
9018 /***** Initialization *****/
9019 /**********************************************************************/
9022 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
9024 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
9025 vfmt
->Begin
= save_Begin
;
9026 vfmt
->CallList
= _mesa_save_CallList
;
9027 vfmt
->CallLists
= _mesa_save_CallLists
;
9028 vfmt
->Color3f
= save_Color3f
;
9029 vfmt
->Color3fv
= save_Color3fv
;
9030 vfmt
->Color4f
= save_Color4f
;
9031 vfmt
->Color4fv
= save_Color4fv
;
9032 vfmt
->EdgeFlag
= save_EdgeFlag
;
9033 vfmt
->End
= save_End
;
9034 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
9035 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
9036 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
9037 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
9038 vfmt
->EvalPoint1
= save_EvalPoint1
;
9039 vfmt
->EvalPoint2
= save_EvalPoint2
;
9040 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
9041 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
9042 vfmt
->Indexf
= save_Indexf
;
9043 vfmt
->Indexfv
= save_Indexfv
;
9044 vfmt
->Materialfv
= save_Materialfv
;
9045 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
9046 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
9047 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
9048 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
9049 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
9050 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
9051 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
9052 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
9053 vfmt
->Normal3f
= save_Normal3f
;
9054 vfmt
->Normal3fv
= save_Normal3fv
;
9055 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
9056 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
9057 vfmt
->TexCoord1f
= save_TexCoord1f
;
9058 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
9059 vfmt
->TexCoord2f
= save_TexCoord2f
;
9060 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
9061 vfmt
->TexCoord3f
= save_TexCoord3f
;
9062 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
9063 vfmt
->TexCoord4f
= save_TexCoord4f
;
9064 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
9065 vfmt
->Vertex2f
= save_Vertex2f
;
9066 vfmt
->Vertex2fv
= save_Vertex2fv
;
9067 vfmt
->Vertex3f
= save_Vertex3f
;
9068 vfmt
->Vertex3fv
= save_Vertex3fv
;
9069 vfmt
->Vertex4f
= save_Vertex4f
;
9070 vfmt
->Vertex4fv
= save_Vertex4fv
;
9071 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
9072 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
9073 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
9074 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
9075 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
9076 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
9077 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
9078 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
9079 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
9080 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
9081 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
9082 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
9083 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
9084 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
9085 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
9086 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
9088 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
9089 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
9090 vfmt
->Rectf
= save_Rectf
;
9092 /* The driver is required to implement these as
9093 * 1) They can probably do a better job.
9094 * 2) A lot of new mechanisms would have to be added to this module
9095 * to support it. That code would probably never get used,
9099 vfmt
->DrawArrays
= 0;
9100 vfmt
->DrawElements
= 0;
9101 vfmt
->DrawRangeElements
= 0;
9107 * Initialize display list state for given context.
9110 _mesa_init_display_list(GLcontext
*ctx
)
9112 static GLboolean tableInitialized
= GL_FALSE
;
9114 /* zero-out the instruction size table, just once */
9115 if (!tableInitialized
) {
9116 _mesa_bzero(InstSize
, sizeof(InstSize
));
9117 tableInitialized
= GL_TRUE
;
9121 ctx
->ListState
.CallDepth
= 0;
9122 ctx
->ExecuteFlag
= GL_TRUE
;
9123 ctx
->CompileFlag
= GL_FALSE
;
9124 ctx
->ListState
.CurrentBlock
= NULL
;
9125 ctx
->ListState
.CurrentPos
= 0;
9127 /* Display List group */
9128 ctx
->List
.ListBase
= 0;
9130 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);