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_EXT_framebuffer_blit */
333 OPCODE_BLIT_FRAMEBUFFER
,
335 /* Vertex attributes -- fallback for when optimized display
336 * list build isn't active.
355 /* The following three are meta instructions */
356 OPCODE_ERROR
, /* raise compiled-in error */
367 * Display list instructions are stored as sequences of "nodes". Nodes
368 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
369 * are linked together with a pointer.
371 * Each instruction in the display list is stored as a sequence of
372 * contiguous nodes in memory.
373 * Each node is the union of a variety of data types.
388 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
392 typedef union gl_dlist_node Node
;
396 * How many nodes to allocate at a time.
398 * \note Reduced now that we hold vertices etc. elsewhere.
400 #define BLOCK_SIZE 256
405 * Number of nodes of storage needed for each instruction.
406 * Sizes for dynamically allocated opcodes are stored in the context struct.
408 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
410 void mesa_print_display_list(GLuint list
);
413 /**********************************************************************/
414 /***** Private *****/
415 /**********************************************************************/
419 * Make an empty display list. This is used by glGenLists() to
420 * reserve display list IDs.
422 static struct gl_display_list
*
423 make_list(GLuint name
, GLuint count
)
425 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
427 dlist
->Head
= (Node
*) _mesa_malloc(sizeof(Node
) * count
);
428 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
434 * Lookup function to just encapsulate casting.
436 static INLINE
struct gl_display_list
*
437 lookup_list(GLcontext
*ctx
, GLuint list
)
439 return (struct gl_display_list
*)
440 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
446 * Delete the named display list, but don't remove from hash table.
447 * \param dlist - display list pointer
450 _mesa_delete_list(GLcontext
*ctx
, struct gl_display_list
*dlist
)
455 n
= block
= dlist
->Head
;
457 done
= block
? GL_FALSE
: GL_TRUE
;
460 /* check for extension opcodes first */
462 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
463 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
464 ctx
->ListExt
.Opcode
[i
].Destroy(ctx
, &n
[1]);
465 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
468 switch (n
[0].opcode
) {
469 /* for some commands, we need to free malloc'd memory */
471 _mesa_free(n
[6].data
);
472 n
+= InstSize
[n
[0].opcode
];
475 _mesa_free(n
[10].data
);
476 n
+= InstSize
[n
[0].opcode
];
478 case OPCODE_DRAW_PIXELS
:
479 _mesa_free(n
[5].data
);
480 n
+= InstSize
[n
[0].opcode
];
483 _mesa_free(n
[7].data
);
484 n
+= InstSize
[n
[0].opcode
];
486 case OPCODE_COLOR_TABLE
:
487 _mesa_free(n
[6].data
);
488 n
+= InstSize
[n
[0].opcode
];
490 case OPCODE_COLOR_SUB_TABLE
:
491 _mesa_free(n
[6].data
);
492 n
+= InstSize
[n
[0].opcode
];
494 case OPCODE_CONVOLUTION_FILTER_1D
:
495 _mesa_free(n
[6].data
);
496 n
+= InstSize
[n
[0].opcode
];
498 case OPCODE_CONVOLUTION_FILTER_2D
:
499 _mesa_free(n
[7].data
);
500 n
+= InstSize
[n
[0].opcode
];
502 case OPCODE_POLYGON_STIPPLE
:
503 _mesa_free(n
[1].data
);
504 n
+= InstSize
[n
[0].opcode
];
506 case OPCODE_TEX_IMAGE1D
:
507 _mesa_free(n
[8].data
);
508 n
+= InstSize
[n
[0].opcode
];
510 case OPCODE_TEX_IMAGE2D
:
511 _mesa_free(n
[9].data
);
512 n
+= InstSize
[n
[0].opcode
];
514 case OPCODE_TEX_IMAGE3D
:
515 _mesa_free(n
[10].data
);
516 n
+= InstSize
[n
[0].opcode
];
518 case OPCODE_TEX_SUB_IMAGE1D
:
519 _mesa_free(n
[7].data
);
520 n
+= InstSize
[n
[0].opcode
];
522 case OPCODE_TEX_SUB_IMAGE2D
:
523 _mesa_free(n
[9].data
);
524 n
+= InstSize
[n
[0].opcode
];
526 case OPCODE_TEX_SUB_IMAGE3D
:
527 _mesa_free(n
[11].data
);
528 n
+= InstSize
[n
[0].opcode
];
530 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
531 _mesa_free(n
[7].data
);
532 n
+= InstSize
[n
[0].opcode
];
534 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
535 _mesa_free(n
[8].data
);
536 n
+= InstSize
[n
[0].opcode
];
538 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
539 _mesa_free(n
[9].data
);
540 n
+= InstSize
[n
[0].opcode
];
542 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
543 _mesa_free(n
[7].data
);
544 n
+= InstSize
[n
[0].opcode
];
546 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
547 _mesa_free(n
[9].data
);
548 n
+= InstSize
[n
[0].opcode
];
550 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
551 _mesa_free(n
[11].data
);
552 n
+= InstSize
[n
[0].opcode
];
554 #if FEATURE_NV_vertex_program
555 case OPCODE_LOAD_PROGRAM_NV
:
556 _mesa_free(n
[4].data
); /* program string */
557 n
+= InstSize
[n
[0].opcode
];
559 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
560 _mesa_free(n
[2].data
); /* array of program ids */
561 n
+= InstSize
[n
[0].opcode
];
564 #if FEATURE_NV_fragment_program
565 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
566 _mesa_free(n
[3].data
); /* parameter name */
567 n
+= InstSize
[n
[0].opcode
];
570 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
571 case OPCODE_PROGRAM_STRING_ARB
:
572 _mesa_free(n
[4].data
); /* program string */
573 n
+= InstSize
[n
[0].opcode
];
576 case OPCODE_CONTINUE
:
577 n
= (Node
*) n
[1].next
;
581 case OPCODE_END_OF_LIST
:
586 /* Most frequent case */
587 n
+= InstSize
[n
[0].opcode
];
598 * Destroy a display list and remove from hash table.
599 * \param list - display list number
602 destroy_list(GLcontext
*ctx
, GLuint list
)
604 struct gl_display_list
*dlist
;
609 dlist
= lookup_list(ctx
, list
);
613 _mesa_delete_list(ctx
, dlist
);
614 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
619 * Translate the nth element of list from <type> to GLint.
622 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
634 bptr
= (GLbyte
*) list
;
635 return (GLint
) bptr
[n
];
636 case GL_UNSIGNED_BYTE
:
637 ubptr
= (GLubyte
*) list
;
638 return (GLint
) ubptr
[n
];
640 sptr
= (GLshort
*) list
;
641 return (GLint
) sptr
[n
];
642 case GL_UNSIGNED_SHORT
:
643 usptr
= (GLushort
*) list
;
644 return (GLint
) usptr
[n
];
646 iptr
= (GLint
*) list
;
648 case GL_UNSIGNED_INT
:
649 uiptr
= (GLuint
*) list
;
650 return (GLint
) uiptr
[n
];
652 fptr
= (GLfloat
*) list
;
653 return (GLint
) FLOORF(fptr
[n
]);
655 ubptr
= ((GLubyte
*) list
) + 2 * n
;
656 return (GLint
) ubptr
[0] * 256
659 ubptr
= ((GLubyte
*) list
) + 3 * n
;
660 return (GLint
) ubptr
[0] * 65536
661 + (GLint
) ubptr
[1] * 256
664 ubptr
= ((GLubyte
*) list
) + 4 * n
;
665 return (GLint
) ubptr
[0] * 16777216
666 + (GLint
) ubptr
[1] * 65536
667 + (GLint
) ubptr
[2] * 256
677 /**********************************************************************/
679 /**********************************************************************/
682 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
683 * If we run out of memory, GL_OUT_OF_MEMORY will be recorded.
686 unpack_image(GLcontext
*ctx
, GLuint dimensions
,
687 GLsizei width
, GLsizei height
, GLsizei depth
,
688 GLenum format
, GLenum type
, const GLvoid
* pixels
,
689 const struct gl_pixelstore_attrib
*unpack
)
691 if (unpack
->BufferObj
->Name
== 0) {
693 GLvoid
*image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
694 format
, type
, pixels
, unpack
);
695 if (pixels
&& !image
) {
696 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
700 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
, depth
,
701 format
, type
, pixels
)) {
702 const GLubyte
*map
, *src
;
706 ctx
->Driver
.MapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
707 GL_READ_ONLY_ARB
, unpack
->BufferObj
);
709 /* unable to map src buffer! */
710 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
714 src
= ADD_POINTERS(map
, pixels
);
715 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
716 format
, type
, src
, unpack
);
718 ctx
->Driver
.UnmapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
722 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
732 * Allocate space for a display list instruction.
733 * \param opcode the instruction opcode (OPCODE_* value)
734 * \param bytes instruction size in bytes, not counting opcode.
735 * \return pointer to the usable data area (not including the internal
739 _mesa_alloc_instruction(GLcontext
*ctx
, GLuint opcode
, GLuint bytes
)
741 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
744 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
745 if (InstSize
[opcode
] == 0) {
746 /* save instruction size now */
747 InstSize
[opcode
] = numNodes
;
750 /* make sure instruction size agrees */
751 ASSERT(numNodes
== InstSize
[opcode
]);
755 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
756 /* This block is full. Allocate a new block and chain to it */
758 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
759 n
[0].opcode
= OPCODE_CONTINUE
;
760 newblock
= (Node
*) _mesa_malloc(sizeof(Node
) * BLOCK_SIZE
);
762 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
765 n
[1].next
= (Node
*) newblock
;
766 ctx
->ListState
.CurrentBlock
= newblock
;
767 ctx
->ListState
.CurrentPos
= 0;
770 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
771 ctx
->ListState
.CurrentPos
+= numNodes
;
773 n
[0].opcode
= (OpCode
) opcode
;
775 return (void *) (n
+ 1); /* return ptr to node following opcode */
780 * This function allows modules and drivers to get their own opcodes
781 * for extending display list functionality.
782 * \param ctx the rendering context
783 * \param size number of bytes for storing the new display list command
784 * \param execute function to execute the new display list command
785 * \param destroy function to destroy the new display list command
786 * \param print function to print the new display list command
787 * \return the new opcode number or -1 if error
790 _mesa_alloc_opcode(GLcontext
*ctx
,
792 void (*execute
) (GLcontext
*, void *),
793 void (*destroy
) (GLcontext
*, void *),
794 void (*print
) (GLcontext
*, void *))
796 if (ctx
->ListExt
.NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
797 const GLuint i
= ctx
->ListExt
.NumOpcodes
++;
798 ctx
->ListExt
.Opcode
[i
].Size
=
799 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
800 ctx
->ListExt
.Opcode
[i
].Execute
= execute
;
801 ctx
->ListExt
.Opcode
[i
].Destroy
= destroy
;
802 ctx
->ListExt
.Opcode
[i
].Print
= print
;
803 return i
+ OPCODE_EXT_0
;
811 * Allocate display list instruction. Returns Node ptr to where the opcode
813 * - nParams is the number of function parameters
814 * - return value a pointer to sizeof(Node) before the actual
817 #define ALLOC_INSTRUCTION(CTX, OPCODE, NPARAMS) \
818 ((Node *)_mesa_alloc_instruction(CTX, OPCODE, (NPARAMS)*sizeof(Node)) - 1)
823 * Display List compilation functions
825 static void GLAPIENTRY
826 save_Accum(GLenum op
, GLfloat value
)
828 GET_CURRENT_CONTEXT(ctx
);
830 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
831 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACCUM
, 2);
836 if (ctx
->ExecuteFlag
) {
837 CALL_Accum(ctx
->Exec
, (op
, value
));
842 static void GLAPIENTRY
843 save_AlphaFunc(GLenum func
, GLclampf ref
)
845 GET_CURRENT_CONTEXT(ctx
);
847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
848 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ALPHA_FUNC
, 2);
851 n
[2].f
= (GLfloat
) ref
;
853 if (ctx
->ExecuteFlag
) {
854 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
859 static void GLAPIENTRY
860 save_BindTexture(GLenum target
, GLuint texture
)
862 GET_CURRENT_CONTEXT(ctx
);
864 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
865 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_TEXTURE
, 2);
870 if (ctx
->ExecuteFlag
) {
871 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
876 static void GLAPIENTRY
877 save_Bitmap(GLsizei width
, GLsizei height
,
878 GLfloat xorig
, GLfloat yorig
,
879 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
881 GET_CURRENT_CONTEXT(ctx
);
883 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
884 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BITMAP
, 7);
886 n
[1].i
= (GLint
) width
;
887 n
[2].i
= (GLint
) height
;
892 n
[7].data
= _mesa_unpack_bitmap(width
, height
, pixels
, &ctx
->Unpack
);
894 if (ctx
->ExecuteFlag
) {
895 CALL_Bitmap(ctx
->Exec
, (width
, height
,
896 xorig
, yorig
, xmove
, ymove
, pixels
));
901 static void GLAPIENTRY
902 save_BlendEquation(GLenum mode
)
904 GET_CURRENT_CONTEXT(ctx
);
906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
907 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_EQUATION
, 1);
911 if (ctx
->ExecuteFlag
) {
912 CALL_BlendEquation(ctx
->Exec
, (mode
));
917 static void GLAPIENTRY
918 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
920 GET_CURRENT_CONTEXT(ctx
);
922 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
923 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
928 if (ctx
->ExecuteFlag
) {
929 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
934 static void GLAPIENTRY
935 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
936 GLenum sfactorA
, GLenum dfactorA
)
938 GET_CURRENT_CONTEXT(ctx
);
940 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
941 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
948 if (ctx
->ExecuteFlag
) {
949 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
950 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
955 static void GLAPIENTRY
956 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
958 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
962 static void GLAPIENTRY
963 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
965 GET_CURRENT_CONTEXT(ctx
);
967 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
968 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_COLOR
, 4);
975 if (ctx
->ExecuteFlag
) {
976 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
980 static void invalidate_saved_current_state( GLcontext
*ctx
)
984 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
985 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
987 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
988 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
990 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
992 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
996 _mesa_save_CallList(GLuint list
)
998 GET_CURRENT_CONTEXT(ctx
);
1000 SAVE_FLUSH_VERTICES(ctx
);
1002 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CALL_LIST
, 1);
1007 /* After this, we don't know what state we're in. Invalidate all
1008 * cached information previously gathered:
1010 invalidate_saved_current_state( ctx
);
1012 if (ctx
->ExecuteFlag
) {
1013 _mesa_CallList(list
);
1019 _mesa_save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1021 GET_CURRENT_CONTEXT(ctx
);
1023 GLboolean typeErrorFlag
;
1025 SAVE_FLUSH_VERTICES(ctx
);
1029 case GL_UNSIGNED_BYTE
:
1031 case GL_UNSIGNED_SHORT
:
1033 case GL_UNSIGNED_INT
:
1038 typeErrorFlag
= GL_FALSE
;
1041 typeErrorFlag
= GL_TRUE
;
1044 for (i
= 0; i
< num
; i
++) {
1045 GLint list
= translate_id(i
, type
, lists
);
1046 Node
*n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1049 n
[2].b
= typeErrorFlag
;
1053 /* After this, we don't know what state we're in. Invalidate all
1054 * cached information previously gathered:
1056 invalidate_saved_current_state( ctx
);
1058 if (ctx
->ExecuteFlag
) {
1059 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1064 static void GLAPIENTRY
1065 save_Clear(GLbitfield mask
)
1067 GET_CURRENT_CONTEXT(ctx
);
1069 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1070 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR
, 1);
1074 if (ctx
->ExecuteFlag
) {
1075 CALL_Clear(ctx
->Exec
, (mask
));
1080 static void GLAPIENTRY
1081 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1083 GET_CURRENT_CONTEXT(ctx
);
1085 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1086 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1093 if (ctx
->ExecuteFlag
) {
1094 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1099 static void GLAPIENTRY
1100 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1102 GET_CURRENT_CONTEXT(ctx
);
1104 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1105 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_COLOR
, 4);
1112 if (ctx
->ExecuteFlag
) {
1113 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1118 static void GLAPIENTRY
1119 save_ClearDepth(GLclampd depth
)
1121 GET_CURRENT_CONTEXT(ctx
);
1123 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1124 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1126 n
[1].f
= (GLfloat
) depth
;
1128 if (ctx
->ExecuteFlag
) {
1129 CALL_ClearDepth(ctx
->Exec
, (depth
));
1134 static void GLAPIENTRY
1135 save_ClearIndex(GLfloat c
)
1137 GET_CURRENT_CONTEXT(ctx
);
1139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1140 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_INDEX
, 1);
1144 if (ctx
->ExecuteFlag
) {
1145 CALL_ClearIndex(ctx
->Exec
, (c
));
1150 static void GLAPIENTRY
1151 save_ClearStencil(GLint s
)
1153 GET_CURRENT_CONTEXT(ctx
);
1155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1156 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1160 if (ctx
->ExecuteFlag
) {
1161 CALL_ClearStencil(ctx
->Exec
, (s
));
1166 static void GLAPIENTRY
1167 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1169 GET_CURRENT_CONTEXT(ctx
);
1171 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1172 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLIP_PLANE
, 5);
1175 n
[2].f
= (GLfloat
) equ
[0];
1176 n
[3].f
= (GLfloat
) equ
[1];
1177 n
[4].f
= (GLfloat
) equ
[2];
1178 n
[5].f
= (GLfloat
) equ
[3];
1180 if (ctx
->ExecuteFlag
) {
1181 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1187 static void GLAPIENTRY
1188 save_ColorMask(GLboolean red
, GLboolean green
,
1189 GLboolean blue
, GLboolean alpha
)
1191 GET_CURRENT_CONTEXT(ctx
);
1193 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1194 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_MASK
, 4);
1201 if (ctx
->ExecuteFlag
) {
1202 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1207 static void GLAPIENTRY
1208 save_ColorMaterial(GLenum face
, GLenum mode
)
1210 GET_CURRENT_CONTEXT(ctx
);
1212 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1214 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1219 if (ctx
->ExecuteFlag
) {
1220 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1225 static void GLAPIENTRY
1226 save_ColorTable(GLenum target
, GLenum internalFormat
,
1227 GLsizei width
, GLenum format
, GLenum type
,
1228 const GLvoid
* table
)
1230 GET_CURRENT_CONTEXT(ctx
);
1231 if (_mesa_is_proxy_texture(target
)) {
1232 /* execute immediately */
1233 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1234 format
, type
, table
));
1238 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1239 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE
, 6);
1242 n
[2].e
= internalFormat
;
1246 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, table
,
1249 if (ctx
->ExecuteFlag
) {
1250 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1251 format
, type
, table
));
1258 static void GLAPIENTRY
1259 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1260 const GLfloat
*params
)
1262 GET_CURRENT_CONTEXT(ctx
);
1265 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1267 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1272 if (pname
== GL_COLOR_TABLE_SGI
||
1273 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1274 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1275 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1282 if (ctx
->ExecuteFlag
) {
1283 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1288 static void GLAPIENTRY
1289 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1291 GET_CURRENT_CONTEXT(ctx
);
1294 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1296 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1301 if (pname
== GL_COLOR_TABLE_SGI
||
1302 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1303 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1304 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1311 if (ctx
->ExecuteFlag
) {
1312 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1318 static void GLAPIENTRY
1319 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1320 GLenum format
, GLenum type
, const GLvoid
* table
)
1322 GET_CURRENT_CONTEXT(ctx
);
1324 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1325 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1332 n
[6].data
= unpack_image(ctx
, 1, count
, 1, 1, format
, type
, table
,
1335 if (ctx
->ExecuteFlag
) {
1336 CALL_ColorSubTable(ctx
->Exec
,
1337 (target
, start
, count
, format
, type
, table
));
1342 static void GLAPIENTRY
1343 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1344 GLint x
, GLint y
, GLsizei width
)
1346 GET_CURRENT_CONTEXT(ctx
);
1349 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1350 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1358 if (ctx
->ExecuteFlag
) {
1359 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1364 static void GLAPIENTRY
1365 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1366 GLint x
, GLint y
, GLsizei width
)
1368 GET_CURRENT_CONTEXT(ctx
);
1371 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1372 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1375 n
[2].e
= internalformat
;
1380 if (ctx
->ExecuteFlag
) {
1381 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1386 static void GLAPIENTRY
1387 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1388 GLenum format
, GLenum type
, const GLvoid
* filter
)
1390 GET_CURRENT_CONTEXT(ctx
);
1393 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1395 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1398 n
[2].e
= internalFormat
;
1402 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, filter
,
1405 if (ctx
->ExecuteFlag
) {
1406 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1407 format
, type
, filter
));
1412 static void GLAPIENTRY
1413 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1414 GLsizei width
, GLsizei height
, GLenum format
,
1415 GLenum type
, const GLvoid
* filter
)
1417 GET_CURRENT_CONTEXT(ctx
);
1420 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1422 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1425 n
[2].e
= internalFormat
;
1430 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
, filter
,
1433 if (ctx
->ExecuteFlag
) {
1434 CALL_ConvolutionFilter2D(ctx
->Exec
,
1435 (target
, internalFormat
, width
, height
, format
,
1441 static void GLAPIENTRY
1442 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1444 GET_CURRENT_CONTEXT(ctx
);
1446 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1447 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1453 if (ctx
->ExecuteFlag
) {
1454 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1459 static void GLAPIENTRY
1460 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1462 GET_CURRENT_CONTEXT(ctx
);
1464 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1465 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1470 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1471 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1472 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1478 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1481 if (ctx
->ExecuteFlag
) {
1482 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1487 static void GLAPIENTRY
1488 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1490 GET_CURRENT_CONTEXT(ctx
);
1492 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1493 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
1499 if (ctx
->ExecuteFlag
) {
1500 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
1505 static void GLAPIENTRY
1506 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
1507 const GLfloat
*params
)
1509 GET_CURRENT_CONTEXT(ctx
);
1511 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1512 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
1517 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1518 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1519 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1525 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1528 if (ctx
->ExecuteFlag
) {
1529 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
1534 static void GLAPIENTRY
1535 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1537 GET_CURRENT_CONTEXT(ctx
);
1539 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1540 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_PIXELS
, 5);
1544 n
[3].i
= (GLint
) width
;
1545 n
[4].i
= (GLint
) height
;
1548 if (ctx
->ExecuteFlag
) {
1549 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1555 static void GLAPIENTRY
1556 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1557 GLint x
, GLint y
, GLsizei width
, GLint border
)
1559 GET_CURRENT_CONTEXT(ctx
);
1561 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1562 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1566 n
[3].e
= internalformat
;
1572 if (ctx
->ExecuteFlag
) {
1573 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1574 x
, y
, width
, border
));
1579 static void GLAPIENTRY
1580 save_CopyTexImage2D(GLenum target
, GLint level
,
1581 GLenum internalformat
,
1582 GLint x
, GLint y
, GLsizei width
,
1583 GLsizei height
, GLint border
)
1585 GET_CURRENT_CONTEXT(ctx
);
1587 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1588 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1592 n
[3].e
= internalformat
;
1599 if (ctx
->ExecuteFlag
) {
1600 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1601 x
, y
, width
, height
, border
));
1607 static void GLAPIENTRY
1608 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1609 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1611 GET_CURRENT_CONTEXT(ctx
);
1613 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1614 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1623 if (ctx
->ExecuteFlag
) {
1624 CALL_CopyTexSubImage1D(ctx
->Exec
,
1625 (target
, level
, xoffset
, x
, y
, width
));
1630 static void GLAPIENTRY
1631 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1632 GLint xoffset
, GLint yoffset
,
1633 GLint x
, GLint y
, GLsizei width
, GLint height
)
1635 GET_CURRENT_CONTEXT(ctx
);
1637 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1638 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1649 if (ctx
->ExecuteFlag
) {
1650 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1651 x
, y
, width
, height
));
1656 static void GLAPIENTRY
1657 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1658 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1659 GLint x
, GLint y
, GLsizei width
, GLint height
)
1661 GET_CURRENT_CONTEXT(ctx
);
1663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1664 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1676 if (ctx
->ExecuteFlag
) {
1677 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1678 xoffset
, yoffset
, zoffset
,
1679 x
, y
, width
, height
));
1684 static void GLAPIENTRY
1685 save_CullFace(GLenum mode
)
1687 GET_CURRENT_CONTEXT(ctx
);
1689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1690 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CULL_FACE
, 1);
1694 if (ctx
->ExecuteFlag
) {
1695 CALL_CullFace(ctx
->Exec
, (mode
));
1700 static void GLAPIENTRY
1701 save_DepthFunc(GLenum func
)
1703 GET_CURRENT_CONTEXT(ctx
);
1705 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1706 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_FUNC
, 1);
1710 if (ctx
->ExecuteFlag
) {
1711 CALL_DepthFunc(ctx
->Exec
, (func
));
1716 static void GLAPIENTRY
1717 save_DepthMask(GLboolean mask
)
1719 GET_CURRENT_CONTEXT(ctx
);
1721 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1722 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_MASK
, 1);
1726 if (ctx
->ExecuteFlag
) {
1727 CALL_DepthMask(ctx
->Exec
, (mask
));
1732 static void GLAPIENTRY
1733 save_DepthRange(GLclampd nearval
, GLclampd farval
)
1735 GET_CURRENT_CONTEXT(ctx
);
1737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1738 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_RANGE
, 2);
1740 n
[1].f
= (GLfloat
) nearval
;
1741 n
[2].f
= (GLfloat
) farval
;
1743 if (ctx
->ExecuteFlag
) {
1744 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
1749 static void GLAPIENTRY
1750 save_Disable(GLenum cap
)
1752 GET_CURRENT_CONTEXT(ctx
);
1754 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1755 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DISABLE
, 1);
1759 if (ctx
->ExecuteFlag
) {
1760 CALL_Disable(ctx
->Exec
, (cap
));
1765 static void GLAPIENTRY
1766 save_DrawBuffer(GLenum mode
)
1768 GET_CURRENT_CONTEXT(ctx
);
1770 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1771 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFER
, 1);
1775 if (ctx
->ExecuteFlag
) {
1776 CALL_DrawBuffer(ctx
->Exec
, (mode
));
1781 static void GLAPIENTRY
1782 save_DrawPixels(GLsizei width
, GLsizei height
,
1783 GLenum format
, GLenum type
, const GLvoid
* pixels
)
1785 GET_CURRENT_CONTEXT(ctx
);
1788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1790 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_PIXELS
, 5);
1796 n
[5].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
1797 pixels
, &ctx
->Unpack
);
1799 if (ctx
->ExecuteFlag
) {
1800 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
1806 static void GLAPIENTRY
1807 save_Enable(GLenum cap
)
1809 GET_CURRENT_CONTEXT(ctx
);
1811 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1812 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ENABLE
, 1);
1816 if (ctx
->ExecuteFlag
) {
1817 CALL_Enable(ctx
->Exec
, (cap
));
1823 static void GLAPIENTRY
1824 _mesa_save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
1826 GET_CURRENT_CONTEXT(ctx
);
1828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1829 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVALMESH1
, 3);
1835 if (ctx
->ExecuteFlag
) {
1836 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
1841 static void GLAPIENTRY
1842 _mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1844 GET_CURRENT_CONTEXT(ctx
);
1846 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1847 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVALMESH2
, 5);
1855 if (ctx
->ExecuteFlag
) {
1856 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
1863 static void GLAPIENTRY
1864 save_Fogfv(GLenum pname
, const GLfloat
*params
)
1866 GET_CURRENT_CONTEXT(ctx
);
1868 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1869 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FOG
, 5);
1877 if (ctx
->ExecuteFlag
) {
1878 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
1883 static void GLAPIENTRY
1884 save_Fogf(GLenum pname
, GLfloat param
)
1888 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
1889 save_Fogfv(pname
, parray
);
1893 static void GLAPIENTRY
1894 save_Fogiv(GLenum pname
, const GLint
*params
)
1899 case GL_FOG_DENSITY
:
1903 p
[0] = (GLfloat
) *params
;
1906 p
[0] = INT_TO_FLOAT(params
[0]);
1907 p
[1] = INT_TO_FLOAT(params
[1]);
1908 p
[2] = INT_TO_FLOAT(params
[2]);
1909 p
[3] = INT_TO_FLOAT(params
[3]);
1912 /* Error will be caught later in gl_Fogfv */
1913 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
1915 save_Fogfv(pname
, p
);
1919 static void GLAPIENTRY
1920 save_Fogi(GLenum pname
, GLint param
)
1924 parray
[1] = parray
[2] = parray
[3] = 0;
1925 save_Fogiv(pname
, parray
);
1929 static void GLAPIENTRY
1930 save_FrontFace(GLenum mode
)
1932 GET_CURRENT_CONTEXT(ctx
);
1934 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1935 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FRONT_FACE
, 1);
1939 if (ctx
->ExecuteFlag
) {
1940 CALL_FrontFace(ctx
->Exec
, (mode
));
1945 static void GLAPIENTRY
1946 save_Frustum(GLdouble left
, GLdouble right
,
1947 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
1949 GET_CURRENT_CONTEXT(ctx
);
1951 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1952 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FRUSTUM
, 6);
1954 n
[1].f
= (GLfloat
) left
;
1955 n
[2].f
= (GLfloat
) right
;
1956 n
[3].f
= (GLfloat
) bottom
;
1957 n
[4].f
= (GLfloat
) top
;
1958 n
[5].f
= (GLfloat
) nearval
;
1959 n
[6].f
= (GLfloat
) farval
;
1961 if (ctx
->ExecuteFlag
) {
1962 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
1967 static void GLAPIENTRY
1968 save_Hint(GLenum target
, GLenum mode
)
1970 GET_CURRENT_CONTEXT(ctx
);
1972 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1973 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_HINT
, 2);
1978 if (ctx
->ExecuteFlag
) {
1979 CALL_Hint(ctx
->Exec
, (target
, mode
));
1984 static void GLAPIENTRY
1985 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
1988 GET_CURRENT_CONTEXT(ctx
);
1991 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1992 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_HISTOGRAM
, 4);
1996 n
[3].e
= internalFormat
;
1999 if (ctx
->ExecuteFlag
) {
2000 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
2005 static void GLAPIENTRY
2006 save_IndexMask(GLuint mask
)
2008 GET_CURRENT_CONTEXT(ctx
);
2010 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2011 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_INDEX_MASK
, 1);
2015 if (ctx
->ExecuteFlag
) {
2016 CALL_IndexMask(ctx
->Exec
, (mask
));
2021 static void GLAPIENTRY
2022 save_InitNames(void)
2024 GET_CURRENT_CONTEXT(ctx
);
2025 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2026 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_INIT_NAMES
, 0);
2027 if (ctx
->ExecuteFlag
) {
2028 CALL_InitNames(ctx
->Exec
, ());
2033 static void GLAPIENTRY
2034 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2036 GET_CURRENT_CONTEXT(ctx
);
2038 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2039 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIGHT
, 6);
2057 case GL_SPOT_DIRECTION
:
2060 case GL_SPOT_EXPONENT
:
2063 case GL_SPOT_CUTOFF
:
2066 case GL_CONSTANT_ATTENUATION
:
2069 case GL_LINEAR_ATTENUATION
:
2072 case GL_QUADRATIC_ATTENUATION
:
2078 for (i
= 0; i
< nParams
; i
++) {
2079 n
[3 + i
].f
= params
[i
];
2082 if (ctx
->ExecuteFlag
) {
2083 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2088 static void GLAPIENTRY
2089 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2093 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2094 save_Lightfv(light
, pname
, parray
);
2098 static void GLAPIENTRY
2099 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2106 fparam
[0] = INT_TO_FLOAT(params
[0]);
2107 fparam
[1] = INT_TO_FLOAT(params
[1]);
2108 fparam
[2] = INT_TO_FLOAT(params
[2]);
2109 fparam
[3] = INT_TO_FLOAT(params
[3]);
2112 fparam
[0] = (GLfloat
) params
[0];
2113 fparam
[1] = (GLfloat
) params
[1];
2114 fparam
[2] = (GLfloat
) params
[2];
2115 fparam
[3] = (GLfloat
) params
[3];
2117 case GL_SPOT_DIRECTION
:
2118 fparam
[0] = (GLfloat
) params
[0];
2119 fparam
[1] = (GLfloat
) params
[1];
2120 fparam
[2] = (GLfloat
) params
[2];
2122 case GL_SPOT_EXPONENT
:
2123 case GL_SPOT_CUTOFF
:
2124 case GL_CONSTANT_ATTENUATION
:
2125 case GL_LINEAR_ATTENUATION
:
2126 case GL_QUADRATIC_ATTENUATION
:
2127 fparam
[0] = (GLfloat
) params
[0];
2130 /* error will be caught later in gl_Lightfv */
2133 save_Lightfv(light
, pname
, fparam
);
2137 static void GLAPIENTRY
2138 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2142 parray
[1] = parray
[2] = parray
[3] = 0;
2143 save_Lightiv(light
, pname
, parray
);
2147 static void GLAPIENTRY
2148 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2150 GET_CURRENT_CONTEXT(ctx
);
2152 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2153 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIGHT_MODEL
, 5);
2161 if (ctx
->ExecuteFlag
) {
2162 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2167 static void GLAPIENTRY
2168 save_LightModelf(GLenum pname
, GLfloat param
)
2172 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2173 save_LightModelfv(pname
, parray
);
2177 static void GLAPIENTRY
2178 save_LightModeliv(GLenum pname
, const GLint
*params
)
2182 case GL_LIGHT_MODEL_AMBIENT
:
2183 fparam
[0] = INT_TO_FLOAT(params
[0]);
2184 fparam
[1] = INT_TO_FLOAT(params
[1]);
2185 fparam
[2] = INT_TO_FLOAT(params
[2]);
2186 fparam
[3] = INT_TO_FLOAT(params
[3]);
2188 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2189 case GL_LIGHT_MODEL_TWO_SIDE
:
2190 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2191 fparam
[0] = (GLfloat
) params
[0];
2194 /* Error will be caught later in gl_LightModelfv */
2195 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2197 save_LightModelfv(pname
, fparam
);
2201 static void GLAPIENTRY
2202 save_LightModeli(GLenum pname
, GLint param
)
2206 parray
[1] = parray
[2] = parray
[3] = 0;
2207 save_LightModeliv(pname
, parray
);
2211 static void GLAPIENTRY
2212 save_LineStipple(GLint factor
, GLushort pattern
)
2214 GET_CURRENT_CONTEXT(ctx
);
2216 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2217 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LINE_STIPPLE
, 2);
2222 if (ctx
->ExecuteFlag
) {
2223 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2228 static void GLAPIENTRY
2229 save_LineWidth(GLfloat width
)
2231 GET_CURRENT_CONTEXT(ctx
);
2233 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2234 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LINE_WIDTH
, 1);
2238 if (ctx
->ExecuteFlag
) {
2239 CALL_LineWidth(ctx
->Exec
, (width
));
2244 static void GLAPIENTRY
2245 save_ListBase(GLuint base
)
2247 GET_CURRENT_CONTEXT(ctx
);
2249 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2250 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIST_BASE
, 1);
2254 if (ctx
->ExecuteFlag
) {
2255 CALL_ListBase(ctx
->Exec
, (base
));
2260 static void GLAPIENTRY
2261 save_LoadIdentity(void)
2263 GET_CURRENT_CONTEXT(ctx
);
2264 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2265 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2266 if (ctx
->ExecuteFlag
) {
2267 CALL_LoadIdentity(ctx
->Exec
, ());
2272 static void GLAPIENTRY
2273 save_LoadMatrixf(const GLfloat
* m
)
2275 GET_CURRENT_CONTEXT(ctx
);
2277 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2278 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_MATRIX
, 16);
2281 for (i
= 0; i
< 16; i
++) {
2285 if (ctx
->ExecuteFlag
) {
2286 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2291 static void GLAPIENTRY
2292 save_LoadMatrixd(const GLdouble
* m
)
2296 for (i
= 0; i
< 16; i
++) {
2297 f
[i
] = (GLfloat
) m
[i
];
2299 save_LoadMatrixf(f
);
2303 static void GLAPIENTRY
2304 save_LoadName(GLuint name
)
2306 GET_CURRENT_CONTEXT(ctx
);
2308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2309 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_NAME
, 1);
2313 if (ctx
->ExecuteFlag
) {
2314 CALL_LoadName(ctx
->Exec
, (name
));
2319 static void GLAPIENTRY
2320 save_LogicOp(GLenum opcode
)
2322 GET_CURRENT_CONTEXT(ctx
);
2324 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2325 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOGIC_OP
, 1);
2329 if (ctx
->ExecuteFlag
) {
2330 CALL_LogicOp(ctx
->Exec
, (opcode
));
2335 static void GLAPIENTRY
2336 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2337 GLint order
, const GLdouble
* points
)
2339 GET_CURRENT_CONTEXT(ctx
);
2341 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2342 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP1
, 6);
2344 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2346 n
[2].f
= (GLfloat
) u1
;
2347 n
[3].f
= (GLfloat
) u2
;
2348 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2350 n
[6].data
= (void *) pnts
;
2352 if (ctx
->ExecuteFlag
) {
2353 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2357 static void GLAPIENTRY
2358 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2359 GLint order
, const GLfloat
* points
)
2361 GET_CURRENT_CONTEXT(ctx
);
2363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2364 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP1
, 6);
2366 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2370 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2372 n
[6].data
= (void *) pnts
;
2374 if (ctx
->ExecuteFlag
) {
2375 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2380 static void GLAPIENTRY
2381 save_Map2d(GLenum target
,
2382 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2383 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2384 const GLdouble
* points
)
2386 GET_CURRENT_CONTEXT(ctx
);
2388 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2389 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP2
, 10);
2391 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2392 vstride
, vorder
, points
);
2394 n
[2].f
= (GLfloat
) u1
;
2395 n
[3].f
= (GLfloat
) u2
;
2396 n
[4].f
= (GLfloat
) v1
;
2397 n
[5].f
= (GLfloat
) v2
;
2398 /* XXX verify these strides are correct */
2399 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2400 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2403 n
[10].data
= (void *) pnts
;
2405 if (ctx
->ExecuteFlag
) {
2406 CALL_Map2d(ctx
->Exec
, (target
,
2407 u1
, u2
, ustride
, uorder
,
2408 v1
, v2
, vstride
, vorder
, points
));
2413 static void GLAPIENTRY
2414 save_Map2f(GLenum target
,
2415 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2416 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2417 const GLfloat
* points
)
2419 GET_CURRENT_CONTEXT(ctx
);
2421 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2422 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP2
, 10);
2424 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2425 vstride
, vorder
, points
);
2431 /* XXX verify these strides are correct */
2432 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2433 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2436 n
[10].data
= (void *) pnts
;
2438 if (ctx
->ExecuteFlag
) {
2439 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2440 v1
, v2
, vstride
, vorder
, points
));
2445 static void GLAPIENTRY
2446 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2448 GET_CURRENT_CONTEXT(ctx
);
2450 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2451 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAPGRID1
, 3);
2457 if (ctx
->ExecuteFlag
) {
2458 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2463 static void GLAPIENTRY
2464 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2466 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2470 static void GLAPIENTRY
2471 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2472 GLint vn
, GLfloat v1
, GLfloat v2
)
2474 GET_CURRENT_CONTEXT(ctx
);
2476 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2477 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAPGRID2
, 6);
2486 if (ctx
->ExecuteFlag
) {
2487 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2493 static void GLAPIENTRY
2494 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2495 GLint vn
, GLdouble v1
, GLdouble v2
)
2497 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2498 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2502 static void GLAPIENTRY
2503 save_MatrixMode(GLenum mode
)
2505 GET_CURRENT_CONTEXT(ctx
);
2507 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2508 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATRIX_MODE
, 1);
2512 if (ctx
->ExecuteFlag
) {
2513 CALL_MatrixMode(ctx
->Exec
, (mode
));
2518 static void GLAPIENTRY
2519 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2521 GET_CURRENT_CONTEXT(ctx
);
2524 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2525 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MIN_MAX
, 3);
2528 n
[2].e
= internalFormat
;
2531 if (ctx
->ExecuteFlag
) {
2532 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
2537 static void GLAPIENTRY
2538 save_MultMatrixf(const GLfloat
* m
)
2540 GET_CURRENT_CONTEXT(ctx
);
2542 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2543 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MULT_MATRIX
, 16);
2546 for (i
= 0; i
< 16; i
++) {
2550 if (ctx
->ExecuteFlag
) {
2551 CALL_MultMatrixf(ctx
->Exec
, (m
));
2556 static void GLAPIENTRY
2557 save_MultMatrixd(const GLdouble
* m
)
2561 for (i
= 0; i
< 16; i
++) {
2562 f
[i
] = (GLfloat
) m
[i
];
2564 save_MultMatrixf(f
);
2568 static void GLAPIENTRY
2569 save_NewList(GLuint name
, GLenum mode
)
2571 GET_CURRENT_CONTEXT(ctx
);
2572 /* It's an error to call this function while building a display list */
2573 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2580 static void GLAPIENTRY
2581 save_Ortho(GLdouble left
, GLdouble right
,
2582 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2584 GET_CURRENT_CONTEXT(ctx
);
2586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2587 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ORTHO
, 6);
2589 n
[1].f
= (GLfloat
) left
;
2590 n
[2].f
= (GLfloat
) right
;
2591 n
[3].f
= (GLfloat
) bottom
;
2592 n
[4].f
= (GLfloat
) top
;
2593 n
[5].f
= (GLfloat
) nearval
;
2594 n
[6].f
= (GLfloat
) farval
;
2596 if (ctx
->ExecuteFlag
) {
2597 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2602 static void GLAPIENTRY
2603 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2605 GET_CURRENT_CONTEXT(ctx
);
2607 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2608 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_MAP
, 3);
2612 n
[3].data
= (void *) _mesa_malloc(mapsize
* sizeof(GLfloat
));
2613 MEMCPY(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
2615 if (ctx
->ExecuteFlag
) {
2616 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2621 static void GLAPIENTRY
2622 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2624 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2626 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2627 for (i
= 0; i
< mapsize
; i
++) {
2628 fvalues
[i
] = (GLfloat
) values
[i
];
2632 for (i
= 0; i
< mapsize
; i
++) {
2633 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2636 save_PixelMapfv(map
, mapsize
, fvalues
);
2640 static void GLAPIENTRY
2641 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2643 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2645 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2646 for (i
= 0; i
< mapsize
; i
++) {
2647 fvalues
[i
] = (GLfloat
) values
[i
];
2651 for (i
= 0; i
< mapsize
; i
++) {
2652 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
2655 save_PixelMapfv(map
, mapsize
, fvalues
);
2659 static void GLAPIENTRY
2660 save_PixelTransferf(GLenum pname
, GLfloat param
)
2662 GET_CURRENT_CONTEXT(ctx
);
2664 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2665 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2670 if (ctx
->ExecuteFlag
) {
2671 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
2676 static void GLAPIENTRY
2677 save_PixelTransferi(GLenum pname
, GLint param
)
2679 save_PixelTransferf(pname
, (GLfloat
) param
);
2683 static void GLAPIENTRY
2684 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
2686 GET_CURRENT_CONTEXT(ctx
);
2688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2689 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_ZOOM
, 2);
2694 if (ctx
->ExecuteFlag
) {
2695 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
2700 static void GLAPIENTRY
2701 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
2703 GET_CURRENT_CONTEXT(ctx
);
2705 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2706 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POINT_PARAMETERS
, 4);
2713 if (ctx
->ExecuteFlag
) {
2714 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
2719 static void GLAPIENTRY
2720 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
2724 parray
[1] = parray
[2] = 0.0F
;
2725 save_PointParameterfvEXT(pname
, parray
);
2728 static void GLAPIENTRY
2729 save_PointParameteriNV(GLenum pname
, GLint param
)
2732 parray
[0] = (GLfloat
) param
;
2733 parray
[1] = parray
[2] = 0.0F
;
2734 save_PointParameterfvEXT(pname
, parray
);
2737 static void GLAPIENTRY
2738 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
2741 parray
[0] = (GLfloat
) param
[0];
2742 parray
[1] = parray
[2] = 0.0F
;
2743 save_PointParameterfvEXT(pname
, parray
);
2747 static void GLAPIENTRY
2748 save_PointSize(GLfloat size
)
2750 GET_CURRENT_CONTEXT(ctx
);
2752 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2753 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POINT_SIZE
, 1);
2757 if (ctx
->ExecuteFlag
) {
2758 CALL_PointSize(ctx
->Exec
, (size
));
2763 static void GLAPIENTRY
2764 save_PolygonMode(GLenum face
, GLenum mode
)
2766 GET_CURRENT_CONTEXT(ctx
);
2768 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2769 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_MODE
, 2);
2774 if (ctx
->ExecuteFlag
) {
2775 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
2780 static void GLAPIENTRY
2781 save_PolygonStipple(const GLubyte
* pattern
)
2783 GET_CURRENT_CONTEXT(ctx
);
2786 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2788 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
2790 n
[1].data
= unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
2791 pattern
, &ctx
->Unpack
);
2793 if (ctx
->ExecuteFlag
) {
2794 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
2799 static void GLAPIENTRY
2800 save_PolygonOffset(GLfloat factor
, GLfloat units
)
2802 GET_CURRENT_CONTEXT(ctx
);
2804 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2805 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_OFFSET
, 2);
2810 if (ctx
->ExecuteFlag
) {
2811 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
2816 static void GLAPIENTRY
2817 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
2819 GET_CURRENT_CONTEXT(ctx
);
2820 /* XXX mult by DepthMaxF here??? */
2821 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
2825 static void GLAPIENTRY
2826 save_PopAttrib(void)
2828 GET_CURRENT_CONTEXT(ctx
);
2829 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2830 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_ATTRIB
, 0);
2831 if (ctx
->ExecuteFlag
) {
2832 CALL_PopAttrib(ctx
->Exec
, ());
2837 static void GLAPIENTRY
2838 save_PopMatrix(void)
2840 GET_CURRENT_CONTEXT(ctx
);
2841 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2842 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_MATRIX
, 0);
2843 if (ctx
->ExecuteFlag
) {
2844 CALL_PopMatrix(ctx
->Exec
, ());
2849 static void GLAPIENTRY
2852 GET_CURRENT_CONTEXT(ctx
);
2853 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2854 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_NAME
, 0);
2855 if (ctx
->ExecuteFlag
) {
2856 CALL_PopName(ctx
->Exec
, ());
2861 static void GLAPIENTRY
2862 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
2863 const GLclampf
* priorities
)
2865 GET_CURRENT_CONTEXT(ctx
);
2867 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2869 for (i
= 0; i
< num
; i
++) {
2871 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
2873 n
[1].ui
= textures
[i
];
2874 n
[2].f
= priorities
[i
];
2877 if (ctx
->ExecuteFlag
) {
2878 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
2883 static void GLAPIENTRY
2884 save_PushAttrib(GLbitfield mask
)
2886 GET_CURRENT_CONTEXT(ctx
);
2888 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2889 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_ATTRIB
, 1);
2893 if (ctx
->ExecuteFlag
) {
2894 CALL_PushAttrib(ctx
->Exec
, (mask
));
2899 static void GLAPIENTRY
2900 save_PushMatrix(void)
2902 GET_CURRENT_CONTEXT(ctx
);
2903 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2904 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_MATRIX
, 0);
2905 if (ctx
->ExecuteFlag
) {
2906 CALL_PushMatrix(ctx
->Exec
, ());
2911 static void GLAPIENTRY
2912 save_PushName(GLuint name
)
2914 GET_CURRENT_CONTEXT(ctx
);
2916 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2917 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_NAME
, 1);
2921 if (ctx
->ExecuteFlag
) {
2922 CALL_PushName(ctx
->Exec
, (name
));
2927 static void GLAPIENTRY
2928 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2930 GET_CURRENT_CONTEXT(ctx
);
2932 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2933 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RASTER_POS
, 4);
2940 if (ctx
->ExecuteFlag
) {
2941 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
2945 static void GLAPIENTRY
2946 save_RasterPos2d(GLdouble x
, GLdouble y
)
2948 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2951 static void GLAPIENTRY
2952 save_RasterPos2f(GLfloat x
, GLfloat y
)
2954 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2957 static void GLAPIENTRY
2958 save_RasterPos2i(GLint x
, GLint y
)
2960 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2963 static void GLAPIENTRY
2964 save_RasterPos2s(GLshort x
, GLshort y
)
2966 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2969 static void GLAPIENTRY
2970 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2972 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2975 static void GLAPIENTRY
2976 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2978 save_RasterPos4f(x
, y
, z
, 1.0F
);
2981 static void GLAPIENTRY
2982 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2984 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2987 static void GLAPIENTRY
2988 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2990 save_RasterPos4f(x
, y
, z
, 1.0F
);
2993 static void GLAPIENTRY
2994 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2996 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2999 static void GLAPIENTRY
3000 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3002 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3005 static void GLAPIENTRY
3006 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3008 save_RasterPos4f(x
, y
, z
, w
);
3011 static void GLAPIENTRY
3012 save_RasterPos2dv(const GLdouble
* v
)
3014 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3017 static void GLAPIENTRY
3018 save_RasterPos2fv(const GLfloat
* v
)
3020 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3023 static void GLAPIENTRY
3024 save_RasterPos2iv(const GLint
* v
)
3026 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3029 static void GLAPIENTRY
3030 save_RasterPos2sv(const GLshort
* v
)
3032 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3035 static void GLAPIENTRY
3036 save_RasterPos3dv(const GLdouble
* v
)
3038 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3041 static void GLAPIENTRY
3042 save_RasterPos3fv(const GLfloat
* v
)
3044 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3047 static void GLAPIENTRY
3048 save_RasterPos3iv(const GLint
* v
)
3050 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3053 static void GLAPIENTRY
3054 save_RasterPos3sv(const GLshort
* v
)
3056 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3059 static void GLAPIENTRY
3060 save_RasterPos4dv(const GLdouble
* v
)
3062 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3063 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3066 static void GLAPIENTRY
3067 save_RasterPos4fv(const GLfloat
* v
)
3069 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3072 static void GLAPIENTRY
3073 save_RasterPos4iv(const GLint
* v
)
3075 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3076 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3079 static void GLAPIENTRY
3080 save_RasterPos4sv(const GLshort
* v
)
3082 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3086 static void GLAPIENTRY
3087 save_PassThrough(GLfloat token
)
3089 GET_CURRENT_CONTEXT(ctx
);
3091 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3092 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PASSTHROUGH
, 1);
3096 if (ctx
->ExecuteFlag
) {
3097 CALL_PassThrough(ctx
->Exec
, (token
));
3102 static void GLAPIENTRY
3103 save_ReadBuffer(GLenum mode
)
3105 GET_CURRENT_CONTEXT(ctx
);
3107 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3108 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_READ_BUFFER
, 1);
3112 if (ctx
->ExecuteFlag
) {
3113 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3118 static void GLAPIENTRY
3119 save_ResetHistogram(GLenum target
)
3121 GET_CURRENT_CONTEXT(ctx
);
3123 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3124 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3128 if (ctx
->ExecuteFlag
) {
3129 CALL_ResetHistogram(ctx
->Exec
, (target
));
3134 static void GLAPIENTRY
3135 save_ResetMinmax(GLenum target
)
3137 GET_CURRENT_CONTEXT(ctx
);
3139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3140 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3144 if (ctx
->ExecuteFlag
) {
3145 CALL_ResetMinmax(ctx
->Exec
, (target
));
3150 static void GLAPIENTRY
3151 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3153 GET_CURRENT_CONTEXT(ctx
);
3155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3156 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ROTATE
, 4);
3163 if (ctx
->ExecuteFlag
) {
3164 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3169 static void GLAPIENTRY
3170 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3172 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3176 static void GLAPIENTRY
3177 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3179 GET_CURRENT_CONTEXT(ctx
);
3181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3182 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCALE
, 3);
3188 if (ctx
->ExecuteFlag
) {
3189 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3194 static void GLAPIENTRY
3195 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3197 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3201 static void GLAPIENTRY
3202 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3204 GET_CURRENT_CONTEXT(ctx
);
3206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3207 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCISSOR
, 4);
3214 if (ctx
->ExecuteFlag
) {
3215 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3220 static void GLAPIENTRY
3221 save_ShadeModel(GLenum mode
)
3223 GET_CURRENT_CONTEXT(ctx
);
3225 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3227 if (ctx
->ExecuteFlag
) {
3228 CALL_ShadeModel(ctx
->Exec
, (mode
));
3231 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3234 SAVE_FLUSH_VERTICES(ctx
);
3236 /* Only save the value if we know the statechange will take effect:
3238 if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
)
3239 ctx
->ListState
.Current
.ShadeModel
= mode
;
3241 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SHADE_MODEL
, 1);
3248 static void GLAPIENTRY
3249 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3251 GET_CURRENT_CONTEXT(ctx
);
3253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3254 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC
, 3);
3260 if (ctx
->ExecuteFlag
) {
3261 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3266 static void GLAPIENTRY
3267 save_StencilMask(GLuint mask
)
3269 GET_CURRENT_CONTEXT(ctx
);
3271 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3272 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK
, 1);
3276 if (ctx
->ExecuteFlag
) {
3277 CALL_StencilMask(ctx
->Exec
, (mask
));
3282 static void GLAPIENTRY
3283 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3285 GET_CURRENT_CONTEXT(ctx
);
3287 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3288 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP
, 3);
3294 if (ctx
->ExecuteFlag
) {
3295 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3300 static void GLAPIENTRY
3301 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3303 GET_CURRENT_CONTEXT(ctx
);
3305 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3306 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3313 if (ctx
->ExecuteFlag
) {
3314 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3319 static void GLAPIENTRY
3320 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3323 GET_CURRENT_CONTEXT(ctx
);
3325 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3327 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3335 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3342 if (ctx
->ExecuteFlag
) {
3343 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3344 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3349 static void GLAPIENTRY
3350 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3352 GET_CURRENT_CONTEXT(ctx
);
3354 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3355 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3360 if (ctx
->ExecuteFlag
) {
3361 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3366 static void GLAPIENTRY
3367 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3369 GET_CURRENT_CONTEXT(ctx
);
3371 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3372 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3379 if (ctx
->ExecuteFlag
) {
3380 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3385 static void GLAPIENTRY
3386 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3388 GET_CURRENT_CONTEXT(ctx
);
3390 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3391 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXENV
, 6);
3395 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3403 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3406 if (ctx
->ExecuteFlag
) {
3407 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3412 static void GLAPIENTRY
3413 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3416 parray
[0] = (GLfloat
) param
;
3417 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3418 save_TexEnvfv(target
, pname
, parray
);
3422 static void GLAPIENTRY
3423 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3426 p
[0] = (GLfloat
) param
;
3427 p
[1] = p
[2] = p
[3] = 0.0;
3428 save_TexEnvfv(target
, pname
, p
);
3432 static void GLAPIENTRY
3433 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3436 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3437 p
[0] = INT_TO_FLOAT(param
[0]);
3438 p
[1] = INT_TO_FLOAT(param
[1]);
3439 p
[2] = INT_TO_FLOAT(param
[2]);
3440 p
[3] = INT_TO_FLOAT(param
[3]);
3443 p
[0] = (GLfloat
) param
[0];
3444 p
[1] = p
[2] = p
[3] = 0.0F
;
3446 save_TexEnvfv(target
, pname
, p
);
3450 static void GLAPIENTRY
3451 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3453 GET_CURRENT_CONTEXT(ctx
);
3455 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3456 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXGEN
, 6);
3465 if (ctx
->ExecuteFlag
) {
3466 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3471 static void GLAPIENTRY
3472 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3475 p
[0] = (GLfloat
) params
[0];
3476 p
[1] = (GLfloat
) params
[1];
3477 p
[2] = (GLfloat
) params
[2];
3478 p
[3] = (GLfloat
) params
[3];
3479 save_TexGenfv(coord
, pname
, p
);
3483 static void GLAPIENTRY
3484 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3487 parray
[0] = (GLfloat
) param
;
3488 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3489 save_TexGenfv(coord
, pname
, parray
);
3493 static void GLAPIENTRY
3494 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3497 p
[0] = (GLfloat
) params
[0];
3498 p
[1] = (GLfloat
) params
[1];
3499 p
[2] = (GLfloat
) params
[2];
3500 p
[3] = (GLfloat
) params
[3];
3501 save_TexGenfv(coord
, pname
, p
);
3505 static void GLAPIENTRY
3506 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3510 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3511 save_TexGenfv(coord
, pname
, parray
);
3515 static void GLAPIENTRY
3516 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3520 parray
[1] = parray
[2] = parray
[3] = 0;
3521 save_TexGeniv(coord
, pname
, parray
);
3525 static void GLAPIENTRY
3526 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3528 GET_CURRENT_CONTEXT(ctx
);
3530 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3531 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXPARAMETER
, 6);
3540 if (ctx
->ExecuteFlag
) {
3541 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3546 static void GLAPIENTRY
3547 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3551 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3552 save_TexParameterfv(target
, pname
, parray
);
3556 static void GLAPIENTRY
3557 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3560 fparam
[0] = (GLfloat
) param
;
3561 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3562 save_TexParameterfv(target
, pname
, fparam
);
3566 static void GLAPIENTRY
3567 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3570 fparam
[0] = (GLfloat
) params
[0];
3571 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3572 save_TexParameterfv(target
, pname
, fparam
);
3576 static void GLAPIENTRY
3577 save_TexImage1D(GLenum target
,
3578 GLint level
, GLint components
,
3579 GLsizei width
, GLint border
,
3580 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3582 GET_CURRENT_CONTEXT(ctx
);
3583 if (target
== GL_PROXY_TEXTURE_1D
) {
3584 /* don't compile, execute immediately */
3585 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3586 border
, format
, type
, pixels
));
3590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3591 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE1D
, 8);
3595 n
[3].i
= components
;
3596 n
[4].i
= (GLint
) width
;
3600 n
[8].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3601 pixels
, &ctx
->Unpack
);
3603 if (ctx
->ExecuteFlag
) {
3604 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3605 border
, format
, type
, pixels
));
3611 static void GLAPIENTRY
3612 save_TexImage2D(GLenum target
,
3613 GLint level
, GLint components
,
3614 GLsizei width
, GLsizei height
, GLint border
,
3615 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3617 GET_CURRENT_CONTEXT(ctx
);
3618 if (target
== GL_PROXY_TEXTURE_2D
) {
3619 /* don't compile, execute immediately */
3620 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3621 height
, border
, format
, type
, pixels
));
3625 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3626 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE2D
, 9);
3630 n
[3].i
= components
;
3631 n
[4].i
= (GLint
) width
;
3632 n
[5].i
= (GLint
) height
;
3636 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
3637 pixels
, &ctx
->Unpack
);
3639 if (ctx
->ExecuteFlag
) {
3640 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3641 height
, border
, format
, type
, pixels
));
3647 static void GLAPIENTRY
3648 save_TexImage3D(GLenum target
,
3649 GLint level
, GLint internalFormat
,
3650 GLsizei width
, GLsizei height
, GLsizei depth
,
3652 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3654 GET_CURRENT_CONTEXT(ctx
);
3655 if (target
== GL_PROXY_TEXTURE_3D
) {
3656 /* don't compile, execute immediately */
3657 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3658 height
, depth
, border
, format
, type
,
3663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3664 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE3D
, 10);
3668 n
[3].i
= (GLint
) internalFormat
;
3669 n
[4].i
= (GLint
) width
;
3670 n
[5].i
= (GLint
) height
;
3671 n
[6].i
= (GLint
) depth
;
3675 n
[10].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
3676 pixels
, &ctx
->Unpack
);
3678 if (ctx
->ExecuteFlag
) {
3679 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3680 height
, depth
, border
, format
, type
,
3687 static void GLAPIENTRY
3688 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
3689 GLsizei width
, GLenum format
, GLenum type
,
3690 const GLvoid
* pixels
)
3692 GET_CURRENT_CONTEXT(ctx
);
3695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3697 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
3702 n
[4].i
= (GLint
) width
;
3705 n
[7].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3706 pixels
, &ctx
->Unpack
);
3708 if (ctx
->ExecuteFlag
) {
3709 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
3710 format
, type
, pixels
));
3715 static void GLAPIENTRY
3716 save_TexSubImage2D(GLenum target
, GLint level
,
3717 GLint xoffset
, GLint yoffset
,
3718 GLsizei width
, GLsizei height
,
3719 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3721 GET_CURRENT_CONTEXT(ctx
);
3724 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3726 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
3732 n
[5].i
= (GLint
) width
;
3733 n
[6].i
= (GLint
) height
;
3736 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
3737 pixels
, &ctx
->Unpack
);
3739 if (ctx
->ExecuteFlag
) {
3740 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
3741 width
, height
, format
, type
, pixels
));
3746 static void GLAPIENTRY
3747 save_TexSubImage3D(GLenum target
, GLint level
,
3748 GLint xoffset
, GLint yoffset
, GLint zoffset
,
3749 GLsizei width
, GLsizei height
, GLsizei depth
,
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_IMAGE3D
, 11);
3764 n
[6].i
= (GLint
) width
;
3765 n
[7].i
= (GLint
) height
;
3766 n
[8].i
= (GLint
) depth
;
3769 n
[11].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
3770 pixels
, &ctx
->Unpack
);
3772 if (ctx
->ExecuteFlag
) {
3773 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
3774 xoffset
, yoffset
, zoffset
,
3775 width
, height
, depth
, format
, type
,
3781 static void GLAPIENTRY
3782 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
3784 GET_CURRENT_CONTEXT(ctx
);
3786 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3787 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRANSLATE
, 3);
3793 if (ctx
->ExecuteFlag
) {
3794 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
3799 static void GLAPIENTRY
3800 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
3802 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3807 static void GLAPIENTRY
3808 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3810 GET_CURRENT_CONTEXT(ctx
);
3812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3813 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_VIEWPORT
, 4);
3817 n
[3].i
= (GLint
) width
;
3818 n
[4].i
= (GLint
) height
;
3820 if (ctx
->ExecuteFlag
) {
3821 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
3826 static void GLAPIENTRY
3827 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3829 GET_CURRENT_CONTEXT(ctx
);
3831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3832 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_WINDOW_POS
, 4);
3839 if (ctx
->ExecuteFlag
) {
3840 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
3844 static void GLAPIENTRY
3845 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3847 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3850 static void GLAPIENTRY
3851 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3853 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3856 static void GLAPIENTRY
3857 save_WindowPos2iMESA(GLint x
, GLint y
)
3859 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3862 static void GLAPIENTRY
3863 save_WindowPos2sMESA(GLshort x
, GLshort y
)
3865 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3868 static void GLAPIENTRY
3869 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3871 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3874 static void GLAPIENTRY
3875 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3877 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3880 static void GLAPIENTRY
3881 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3883 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3886 static void GLAPIENTRY
3887 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3889 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3892 static void GLAPIENTRY
3893 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3895 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3898 static void GLAPIENTRY
3899 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3901 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3904 static void GLAPIENTRY
3905 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3907 save_WindowPos4fMESA(x
, y
, z
, w
);
3910 static void GLAPIENTRY
3911 save_WindowPos2dvMESA(const GLdouble
* v
)
3913 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3916 static void GLAPIENTRY
3917 save_WindowPos2fvMESA(const GLfloat
* v
)
3919 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3922 static void GLAPIENTRY
3923 save_WindowPos2ivMESA(const GLint
* v
)
3925 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3928 static void GLAPIENTRY
3929 save_WindowPos2svMESA(const GLshort
* v
)
3931 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3934 static void GLAPIENTRY
3935 save_WindowPos3dvMESA(const GLdouble
* v
)
3937 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3940 static void GLAPIENTRY
3941 save_WindowPos3fvMESA(const GLfloat
* v
)
3943 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3946 static void GLAPIENTRY
3947 save_WindowPos3ivMESA(const GLint
* v
)
3949 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3952 static void GLAPIENTRY
3953 save_WindowPos3svMESA(const GLshort
* v
)
3955 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3958 static void GLAPIENTRY
3959 save_WindowPos4dvMESA(const GLdouble
* v
)
3961 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3962 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3965 static void GLAPIENTRY
3966 save_WindowPos4fvMESA(const GLfloat
* v
)
3968 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3971 static void GLAPIENTRY
3972 save_WindowPos4ivMESA(const GLint
* v
)
3974 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3975 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3978 static void GLAPIENTRY
3979 save_WindowPos4svMESA(const GLshort
* v
)
3981 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3986 /* GL_ARB_multitexture */
3987 static void GLAPIENTRY
3988 save_ActiveTextureARB(GLenum target
)
3990 GET_CURRENT_CONTEXT(ctx
);
3992 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3993 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
3997 if (ctx
->ExecuteFlag
) {
3998 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
4003 /* GL_ARB_transpose_matrix */
4005 static void GLAPIENTRY
4006 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4009 _math_transposefd(tm
, m
);
4010 save_LoadMatrixf(tm
);
4014 static void GLAPIENTRY
4015 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4018 _math_transposef(tm
, m
);
4019 save_LoadMatrixf(tm
);
4023 static void GLAPIENTRY
4024 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4027 _math_transposefd(tm
, m
);
4028 save_MultMatrixf(tm
);
4032 static void GLAPIENTRY
4033 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4036 _math_transposef(tm
, m
);
4037 save_MultMatrixf(tm
);
4041 /* GL_ARB_texture_compression */
4042 static void GLAPIENTRY
4043 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4044 GLenum internalFormat
, GLsizei width
,
4045 GLint border
, GLsizei imageSize
,
4046 const GLvoid
* data
)
4048 GET_CURRENT_CONTEXT(ctx
);
4049 if (target
== GL_PROXY_TEXTURE_1D
) {
4050 /* don't compile, execute immediately */
4051 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4052 width
, border
, imageSize
,
4058 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4059 /* make copy of image */
4060 image
= _mesa_malloc(imageSize
);
4062 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
4065 MEMCPY(image
, data
, imageSize
);
4066 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4070 n
[3].e
= internalFormat
;
4071 n
[4].i
= (GLint
) width
;
4079 if (ctx
->ExecuteFlag
) {
4080 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4081 (target
, level
, internalFormat
, width
,
4082 border
, imageSize
, data
));
4088 static void GLAPIENTRY
4089 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4090 GLenum internalFormat
, GLsizei width
,
4091 GLsizei height
, GLint border
, GLsizei imageSize
,
4092 const GLvoid
* data
)
4094 GET_CURRENT_CONTEXT(ctx
);
4095 if (target
== GL_PROXY_TEXTURE_2D
) {
4096 /* don't compile, execute immediately */
4097 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4098 width
, height
, border
,
4104 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4105 /* make copy of image */
4106 image
= _mesa_malloc(imageSize
);
4108 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4111 MEMCPY(image
, data
, imageSize
);
4112 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4116 n
[3].e
= internalFormat
;
4117 n
[4].i
= (GLint
) width
;
4118 n
[5].i
= (GLint
) height
;
4126 if (ctx
->ExecuteFlag
) {
4127 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4128 (target
, level
, internalFormat
, width
,
4129 height
, border
, imageSize
, data
));
4135 static void GLAPIENTRY
4136 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4137 GLenum internalFormat
, GLsizei width
,
4138 GLsizei height
, GLsizei depth
, GLint border
,
4139 GLsizei imageSize
, const GLvoid
* data
)
4141 GET_CURRENT_CONTEXT(ctx
);
4142 if (target
== GL_PROXY_TEXTURE_3D
) {
4143 /* don't compile, execute immediately */
4144 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4145 width
, height
, depth
, border
,
4151 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4152 /* make copy of image */
4153 image
= _mesa_malloc(imageSize
);
4155 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4158 MEMCPY(image
, data
, imageSize
);
4159 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4163 n
[3].e
= internalFormat
;
4164 n
[4].i
= (GLint
) width
;
4165 n
[5].i
= (GLint
) height
;
4166 n
[6].i
= (GLint
) depth
;
4174 if (ctx
->ExecuteFlag
) {
4175 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4176 (target
, level
, internalFormat
, width
,
4177 height
, depth
, border
, imageSize
,
4184 static void GLAPIENTRY
4185 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4186 GLsizei width
, GLenum format
,
4187 GLsizei imageSize
, const GLvoid
* data
)
4192 GET_CURRENT_CONTEXT(ctx
);
4193 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4195 /* make copy of image */
4196 image
= _mesa_malloc(imageSize
);
4198 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4201 MEMCPY(image
, data
, imageSize
);
4202 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4207 n
[4].i
= (GLint
) width
;
4215 if (ctx
->ExecuteFlag
) {
4216 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4217 width
, format
, imageSize
,
4223 static void GLAPIENTRY
4224 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4225 GLint yoffset
, GLsizei width
, GLsizei height
,
4226 GLenum format
, GLsizei imageSize
,
4227 const GLvoid
* data
)
4232 GET_CURRENT_CONTEXT(ctx
);
4233 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4235 /* make copy of image */
4236 image
= _mesa_malloc(imageSize
);
4238 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4241 MEMCPY(image
, data
, imageSize
);
4242 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4248 n
[5].i
= (GLint
) width
;
4249 n
[6].i
= (GLint
) height
;
4257 if (ctx
->ExecuteFlag
) {
4258 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4259 (target
, level
, xoffset
, yoffset
, width
,
4260 height
, format
, imageSize
, data
));
4265 static void GLAPIENTRY
4266 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4267 GLint yoffset
, GLint zoffset
, GLsizei width
,
4268 GLsizei height
, GLsizei depth
, GLenum format
,
4269 GLsizei imageSize
, const GLvoid
* data
)
4274 GET_CURRENT_CONTEXT(ctx
);
4275 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4277 /* make copy of image */
4278 image
= _mesa_malloc(imageSize
);
4280 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4283 MEMCPY(image
, data
, imageSize
);
4284 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4291 n
[6].i
= (GLint
) width
;
4292 n
[7].i
= (GLint
) height
;
4293 n
[8].i
= (GLint
) depth
;
4295 n
[10].i
= imageSize
;
4301 if (ctx
->ExecuteFlag
) {
4302 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4303 (target
, level
, xoffset
, yoffset
,
4304 zoffset
, width
, height
, depth
, format
,
4310 /* GL_ARB_multisample */
4311 static void GLAPIENTRY
4312 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4314 GET_CURRENT_CONTEXT(ctx
);
4316 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4317 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4322 if (ctx
->ExecuteFlag
) {
4323 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4329 * GL_NV_vertex_program
4331 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4332 static void GLAPIENTRY
4333 save_BindProgramNV(GLenum target
, GLuint id
)
4335 GET_CURRENT_CONTEXT(ctx
);
4337 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4338 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4343 if (ctx
->ExecuteFlag
) {
4344 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4348 static void GLAPIENTRY
4349 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4350 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4352 GET_CURRENT_CONTEXT(ctx
);
4354 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4355 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4364 if (ctx
->ExecuteFlag
) {
4365 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4370 static void GLAPIENTRY
4371 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4372 const GLfloat
*params
)
4374 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4375 params
[2], params
[3]);
4379 static void GLAPIENTRY
4380 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4381 const GLfloat
* params
)
4383 GET_CURRENT_CONTEXT(ctx
);
4385 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4389 const GLfloat
* p
= params
;
4391 for (i
= 0 ; i
< count
; i
++) {
4392 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4405 if (ctx
->ExecuteFlag
) {
4406 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4411 static void GLAPIENTRY
4412 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4413 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4415 save_ProgramEnvParameter4fARB(target
, index
,
4417 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4421 static void GLAPIENTRY
4422 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4423 const GLdouble
*params
)
4425 save_ProgramEnvParameter4fARB(target
, index
,
4426 (GLfloat
) params
[0],
4427 (GLfloat
) params
[1],
4428 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4431 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
4433 #if FEATURE_NV_vertex_program
4434 static void GLAPIENTRY
4435 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4437 GET_CURRENT_CONTEXT(ctx
);
4439 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4440 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4449 if (ctx
->ExecuteFlag
) {
4450 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4455 static void GLAPIENTRY
4456 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4457 GLuint num
, const GLdouble
*params
)
4460 for (i
= 0; i
< num
; i
++) {
4461 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4466 static void GLAPIENTRY
4467 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4468 GLuint num
, const GLfloat
*params
)
4471 for (i
= 0; i
< num
; i
++) {
4472 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4477 static void GLAPIENTRY
4478 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4479 const GLubyte
* program
)
4481 GET_CURRENT_CONTEXT(ctx
);
4484 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4486 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4488 GLubyte
*programCopy
= (GLubyte
*) _mesa_malloc(len
);
4490 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4493 _mesa_memcpy(programCopy
, program
, len
);
4497 n
[4].data
= programCopy
;
4499 if (ctx
->ExecuteFlag
) {
4500 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4505 static void GLAPIENTRY
4506 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4508 GET_CURRENT_CONTEXT(ctx
);
4511 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4513 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4515 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4517 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4520 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4524 if (ctx
->ExecuteFlag
) {
4525 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4530 static void GLAPIENTRY
4531 save_TrackMatrixNV(GLenum target
, GLuint address
,
4532 GLenum matrix
, GLenum transform
)
4534 GET_CURRENT_CONTEXT(ctx
);
4536 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4537 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4544 if (ctx
->ExecuteFlag
) {
4545 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4548 #endif /* FEATURE_NV_vertex_program */
4552 * GL_NV_fragment_program
4554 #if FEATURE_NV_fragment_program
4555 static void GLAPIENTRY
4556 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4557 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4559 GET_CURRENT_CONTEXT(ctx
);
4561 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4562 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4571 if (ctx
->ExecuteFlag
) {
4572 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4577 static void GLAPIENTRY
4578 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4579 const GLfloat
*params
)
4581 GET_CURRENT_CONTEXT(ctx
);
4583 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4584 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4593 if (ctx
->ExecuteFlag
) {
4594 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4599 static void GLAPIENTRY
4600 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4601 const GLfloat
*params
)
4603 GET_CURRENT_CONTEXT(ctx
);
4605 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4609 const GLfloat
* p
= params
;
4611 for (i
= 0 ; i
< count
; i
++) {
4612 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4625 if (ctx
->ExecuteFlag
) {
4626 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4631 static void GLAPIENTRY
4632 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4633 GLdouble x
, GLdouble y
,
4634 GLdouble z
, GLdouble w
)
4636 GET_CURRENT_CONTEXT(ctx
);
4638 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4639 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4643 n
[3].f
= (GLfloat
) x
;
4644 n
[4].f
= (GLfloat
) y
;
4645 n
[5].f
= (GLfloat
) z
;
4646 n
[6].f
= (GLfloat
) w
;
4648 if (ctx
->ExecuteFlag
) {
4649 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4654 static void GLAPIENTRY
4655 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4656 const GLdouble
*params
)
4658 GET_CURRENT_CONTEXT(ctx
);
4660 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4661 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4665 n
[3].f
= (GLfloat
) params
[0];
4666 n
[4].f
= (GLfloat
) params
[1];
4667 n
[5].f
= (GLfloat
) params
[2];
4668 n
[6].f
= (GLfloat
) params
[3];
4670 if (ctx
->ExecuteFlag
) {
4671 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4675 static void GLAPIENTRY
4676 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4677 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4679 GET_CURRENT_CONTEXT(ctx
);
4682 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4684 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
4686 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4688 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4691 _mesa_memcpy(nameCopy
, name
, len
);
4694 n
[3].data
= nameCopy
;
4700 if (ctx
->ExecuteFlag
) {
4701 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
4706 static void GLAPIENTRY
4707 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4710 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4714 static void GLAPIENTRY
4715 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4716 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4718 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4719 (GLfloat
) z
, (GLfloat
) w
);
4723 static void GLAPIENTRY
4724 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4727 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4728 (GLfloat
) v
[1], (GLfloat
) v
[2],
4732 #endif /* FEATURE_NV_fragment_program */
4736 /* GL_EXT_stencil_two_side */
4737 static void GLAPIENTRY
4738 save_ActiveStencilFaceEXT(GLenum face
)
4740 GET_CURRENT_CONTEXT(ctx
);
4742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4743 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
4747 if (ctx
->ExecuteFlag
) {
4748 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
4753 /* GL_EXT_depth_bounds_test */
4754 static void GLAPIENTRY
4755 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
4757 GET_CURRENT_CONTEXT(ctx
);
4759 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4760 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
4762 n
[1].f
= (GLfloat
) zmin
;
4763 n
[2].f
= (GLfloat
) zmax
;
4765 if (ctx
->ExecuteFlag
) {
4766 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
4772 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4774 static void GLAPIENTRY
4775 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4776 const GLvoid
* string
)
4778 GET_CURRENT_CONTEXT(ctx
);
4781 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4783 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
4785 GLubyte
*programCopy
= (GLubyte
*) _mesa_malloc(len
);
4787 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4790 _mesa_memcpy(programCopy
, string
, len
);
4794 n
[4].data
= programCopy
;
4796 if (ctx
->ExecuteFlag
) {
4797 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
4801 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4804 #if FEATURE_ARB_occlusion_query
4806 static void GLAPIENTRY
4807 save_BeginQueryARB(GLenum target
, GLuint id
)
4809 GET_CURRENT_CONTEXT(ctx
);
4811 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4812 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
4817 if (ctx
->ExecuteFlag
) {
4818 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
4823 static void GLAPIENTRY
4824 save_EndQueryARB(GLenum target
)
4826 GET_CURRENT_CONTEXT(ctx
);
4828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4829 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_END_QUERY_ARB
, 1);
4833 if (ctx
->ExecuteFlag
) {
4834 CALL_EndQueryARB(ctx
->Exec
, (target
));
4838 #endif /* FEATURE_ARB_occlusion_query */
4841 static void GLAPIENTRY
4842 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
4844 GET_CURRENT_CONTEXT(ctx
);
4846 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4847 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
4851 if (count
> MAX_DRAW_BUFFERS
)
4852 count
= MAX_DRAW_BUFFERS
;
4853 for (i
= 0; i
< count
; i
++) {
4854 n
[2 + i
].e
= buffers
[i
];
4857 if (ctx
->ExecuteFlag
) {
4858 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
4862 static void GLAPIENTRY
4863 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
4865 GET_CURRENT_CONTEXT(ctx
);
4868 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
4876 if (ctx
->ExecuteFlag
) {
4877 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
4881 static void GLAPIENTRY
4882 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
4885 p
[0] = INT_TO_FLOAT(param
[0]);
4886 p
[1] = INT_TO_FLOAT(param
[1]);
4887 p
[2] = INT_TO_FLOAT(param
[2]);
4888 p
[3] = INT_TO_FLOAT(param
[3]);
4889 save_TexBumpParameterfvATI(pname
, p
);
4892 #if FEATURE_ATI_fragment_shader
4893 static void GLAPIENTRY
4894 save_BindFragmentShaderATI(GLuint id
)
4896 GET_CURRENT_CONTEXT(ctx
);
4899 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
4903 if (ctx
->ExecuteFlag
) {
4904 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
4908 static void GLAPIENTRY
4909 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
4911 GET_CURRENT_CONTEXT(ctx
);
4914 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
4922 if (ctx
->ExecuteFlag
) {
4923 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
4929 save_Attr1fNV(GLenum attr
, GLfloat x
)
4931 GET_CURRENT_CONTEXT(ctx
);
4933 SAVE_FLUSH_VERTICES(ctx
);
4934 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_NV
, 2);
4940 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4941 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4942 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4944 if (ctx
->ExecuteFlag
) {
4945 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
4950 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
4952 GET_CURRENT_CONTEXT(ctx
);
4954 SAVE_FLUSH_VERTICES(ctx
);
4955 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_NV
, 3);
4962 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4963 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4964 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4966 if (ctx
->ExecuteFlag
) {
4967 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
4972 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4974 GET_CURRENT_CONTEXT(ctx
);
4976 SAVE_FLUSH_VERTICES(ctx
);
4977 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_NV
, 4);
4985 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4986 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4987 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4989 if (ctx
->ExecuteFlag
) {
4990 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
4995 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4997 GET_CURRENT_CONTEXT(ctx
);
4999 SAVE_FLUSH_VERTICES(ctx
);
5000 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_NV
, 5);
5009 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
5010 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5011 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5013 if (ctx
->ExecuteFlag
) {
5014 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5020 save_Attr1fARB(GLenum attr
, GLfloat x
)
5022 GET_CURRENT_CONTEXT(ctx
);
5024 SAVE_FLUSH_VERTICES(ctx
);
5025 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5031 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5032 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5033 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5035 if (ctx
->ExecuteFlag
) {
5036 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5041 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5043 GET_CURRENT_CONTEXT(ctx
);
5045 SAVE_FLUSH_VERTICES(ctx
);
5046 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5053 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5054 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5055 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5057 if (ctx
->ExecuteFlag
) {
5058 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5063 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5065 GET_CURRENT_CONTEXT(ctx
);
5067 SAVE_FLUSH_VERTICES(ctx
);
5068 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5076 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5077 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5078 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5080 if (ctx
->ExecuteFlag
) {
5081 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5086 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5088 GET_CURRENT_CONTEXT(ctx
);
5090 SAVE_FLUSH_VERTICES(ctx
);
5091 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5100 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5101 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5102 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5104 if (ctx
->ExecuteFlag
) {
5105 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5110 static void GLAPIENTRY
5111 save_EvalCoord1f(GLfloat x
)
5113 GET_CURRENT_CONTEXT(ctx
);
5115 SAVE_FLUSH_VERTICES(ctx
);
5116 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C1
, 1);
5120 if (ctx
->ExecuteFlag
) {
5121 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5125 static void GLAPIENTRY
5126 save_EvalCoord1fv(const GLfloat
* v
)
5128 save_EvalCoord1f(v
[0]);
5131 static void GLAPIENTRY
5132 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5134 GET_CURRENT_CONTEXT(ctx
);
5136 SAVE_FLUSH_VERTICES(ctx
);
5137 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C2
, 2);
5142 if (ctx
->ExecuteFlag
) {
5143 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5147 static void GLAPIENTRY
5148 save_EvalCoord2fv(const GLfloat
* v
)
5150 save_EvalCoord2f(v
[0], v
[1]);
5154 static void GLAPIENTRY
5155 save_EvalPoint1(GLint x
)
5157 GET_CURRENT_CONTEXT(ctx
);
5159 SAVE_FLUSH_VERTICES(ctx
);
5160 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P1
, 1);
5164 if (ctx
->ExecuteFlag
) {
5165 CALL_EvalPoint1(ctx
->Exec
, (x
));
5169 static void GLAPIENTRY
5170 save_EvalPoint2(GLint x
, GLint y
)
5172 GET_CURRENT_CONTEXT(ctx
);
5174 SAVE_FLUSH_VERTICES(ctx
);
5175 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P2
, 2);
5180 if (ctx
->ExecuteFlag
) {
5181 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5185 static void GLAPIENTRY
5186 save_Indexf(GLfloat x
)
5188 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5191 static void GLAPIENTRY
5192 save_Indexfv(const GLfloat
* v
)
5194 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5197 static void GLAPIENTRY
5198 save_EdgeFlag(GLboolean x
)
5200 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? (GLfloat
)1.0 : (GLfloat
)0.0);
5203 static INLINE GLboolean
compare4fv( const GLfloat
*a
,
5207 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5211 static void GLAPIENTRY
5212 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5214 GET_CURRENT_CONTEXT(ctx
);
5222 case GL_FRONT_AND_BACK
:
5225 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5234 case GL_AMBIENT_AND_DIFFUSE
:
5240 case GL_COLOR_INDEXES
:
5244 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5248 if (ctx
->ExecuteFlag
) {
5249 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5252 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5254 /* Try to eliminate redundant statechanges. Because it is legal to
5255 * call glMaterial even inside begin/end calls, don't need to worry
5256 * about ctx->Driver.CurrentSavePrimitive here.
5258 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5259 if (bitmask
& (1 << i
)) {
5260 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5261 compare4fv(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5262 bitmask
&= ~(1 << i
);
5265 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5266 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5271 /* If this call has effect, return early:
5276 SAVE_FLUSH_VERTICES(ctx
);
5278 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATERIAL
, 6);
5282 for (i
= 0; i
< args
; i
++)
5283 n
[3 + i
].f
= param
[i
];
5287 static void GLAPIENTRY
5288 save_Begin(GLenum mode
)
5290 GET_CURRENT_CONTEXT(ctx
);
5292 GLboolean error
= GL_FALSE
;
5294 if ( /*mode < GL_POINTS || */ mode
> GL_POLYGON
) {
5295 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5298 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5299 /* Typically the first begin. This may raise an error on
5300 * playback, depending on whether CallList is issued from inside
5301 * a begin/end or not.
5303 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5305 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5306 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5309 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5314 /* Give the driver an opportunity to hook in an optimized
5315 * display list compiler.
5317 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5320 SAVE_FLUSH_VERTICES(ctx
);
5321 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN
, 1);
5327 if (ctx
->ExecuteFlag
) {
5328 CALL_Begin(ctx
->Exec
, (mode
));
5332 static void GLAPIENTRY
5335 GET_CURRENT_CONTEXT(ctx
);
5336 SAVE_FLUSH_VERTICES(ctx
);
5337 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END
, 0);
5338 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5339 if (ctx
->ExecuteFlag
) {
5340 CALL_End(ctx
->Exec
, ());
5344 static void GLAPIENTRY
5345 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5347 GET_CURRENT_CONTEXT(ctx
);
5349 SAVE_FLUSH_VERTICES(ctx
);
5350 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RECTF
, 4);
5357 if (ctx
->ExecuteFlag
) {
5358 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5363 static void GLAPIENTRY
5364 save_Vertex2f(GLfloat x
, GLfloat y
)
5366 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5369 static void GLAPIENTRY
5370 save_Vertex2fv(const GLfloat
* v
)
5372 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5375 static void GLAPIENTRY
5376 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5378 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5381 static void GLAPIENTRY
5382 save_Vertex3fv(const GLfloat
* v
)
5384 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5387 static void GLAPIENTRY
5388 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5390 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5393 static void GLAPIENTRY
5394 save_Vertex4fv(const GLfloat
* v
)
5396 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5399 static void GLAPIENTRY
5400 save_TexCoord1f(GLfloat x
)
5402 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5405 static void GLAPIENTRY
5406 save_TexCoord1fv(const GLfloat
* v
)
5408 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5411 static void GLAPIENTRY
5412 save_TexCoord2f(GLfloat x
, GLfloat y
)
5414 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5417 static void GLAPIENTRY
5418 save_TexCoord2fv(const GLfloat
* v
)
5420 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5423 static void GLAPIENTRY
5424 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5426 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5429 static void GLAPIENTRY
5430 save_TexCoord3fv(const GLfloat
* v
)
5432 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5435 static void GLAPIENTRY
5436 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5438 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5441 static void GLAPIENTRY
5442 save_TexCoord4fv(const GLfloat
* v
)
5444 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5447 static void GLAPIENTRY
5448 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5450 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5453 static void GLAPIENTRY
5454 save_Normal3fv(const GLfloat
* v
)
5456 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5459 static void GLAPIENTRY
5460 save_FogCoordfEXT(GLfloat x
)
5462 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5465 static void GLAPIENTRY
5466 save_FogCoordfvEXT(const GLfloat
* v
)
5468 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5471 static void GLAPIENTRY
5472 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5474 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5477 static void GLAPIENTRY
5478 save_Color3fv(const GLfloat
* v
)
5480 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5483 static void GLAPIENTRY
5484 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5486 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5489 static void GLAPIENTRY
5490 save_Color4fv(const GLfloat
* v
)
5492 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5495 static void GLAPIENTRY
5496 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5498 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5501 static void GLAPIENTRY
5502 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5504 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5508 /* Just call the respective ATTR for texcoord
5510 static void GLAPIENTRY
5511 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5513 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5514 save_Attr1fNV(attr
, x
);
5517 static void GLAPIENTRY
5518 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5520 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5521 save_Attr1fNV(attr
, v
[0]);
5524 static void GLAPIENTRY
5525 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5527 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5528 save_Attr2fNV(attr
, x
, y
);
5531 static void GLAPIENTRY
5532 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5534 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5535 save_Attr2fNV(attr
, v
[0], v
[1]);
5538 static void GLAPIENTRY
5539 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5541 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5542 save_Attr3fNV(attr
, x
, y
, z
);
5545 static void GLAPIENTRY
5546 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5548 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5549 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5552 static void GLAPIENTRY
5553 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5554 GLfloat z
, GLfloat w
)
5556 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5557 save_Attr4fNV(attr
, x
, y
, z
, w
);
5560 static void GLAPIENTRY
5561 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5563 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5564 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5569 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5575 GET_CURRENT_CONTEXT(ctx
);
5576 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5580 /* First level for NV_vertex_program:
5582 * Check for errors at compile time?.
5584 static void GLAPIENTRY
5585 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
5587 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5588 save_Attr1fNV(index
, x
);
5593 static void GLAPIENTRY
5594 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
5596 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5597 save_Attr1fNV(index
, v
[0]);
5602 static void GLAPIENTRY
5603 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
5605 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5606 save_Attr2fNV(index
, x
, y
);
5611 static void GLAPIENTRY
5612 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
5614 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5615 save_Attr2fNV(index
, v
[0], v
[1]);
5620 static void GLAPIENTRY
5621 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5623 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5624 save_Attr3fNV(index
, x
, y
, z
);
5629 static void GLAPIENTRY
5630 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
5632 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5633 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
5638 static void GLAPIENTRY
5639 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
5640 GLfloat z
, GLfloat w
)
5642 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5643 save_Attr4fNV(index
, x
, y
, z
, w
);
5648 static void GLAPIENTRY
5649 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
5651 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5652 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
5660 static void GLAPIENTRY
5661 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5663 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5664 save_Attr1fARB(index
, x
);
5669 static void GLAPIENTRY
5670 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5672 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5673 save_Attr1fARB(index
, v
[0]);
5678 static void GLAPIENTRY
5679 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5681 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5682 save_Attr2fARB(index
, x
, y
);
5687 static void GLAPIENTRY
5688 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5690 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5691 save_Attr2fARB(index
, v
[0], v
[1]);
5696 static void GLAPIENTRY
5697 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5699 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5700 save_Attr3fARB(index
, x
, y
, z
);
5705 static void GLAPIENTRY
5706 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
5708 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5709 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
5714 static void GLAPIENTRY
5715 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
5718 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5719 save_Attr4fARB(index
, x
, y
, z
, w
);
5724 static void GLAPIENTRY
5725 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
5727 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5728 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
5734 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
5736 static void GLAPIENTRY
5737 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
5739 GET_CURRENT_CONTEXT(ctx
);
5740 FLUSH_VERTICES(ctx
, 0);
5741 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
5744 static GLint GLAPIENTRY
5745 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
5747 GET_CURRENT_CONTEXT(ctx
);
5748 FLUSH_VERTICES(ctx
, 0);
5749 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
5751 /* XXX more shader functions needed here */
5755 #if FEATURE_EXT_framebuffer_blit
5756 static void GLAPIENTRY
5757 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
5758 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
5759 GLbitfield mask
, GLenum filter
)
5761 GET_CURRENT_CONTEXT(ctx
);
5763 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5764 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
5777 if (ctx
->ExecuteFlag
) {
5778 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
5779 dstX0
, dstY0
, dstX1
, dstY1
,
5787 * Save an error-generating command into display list.
5789 * KW: Will appear in the list before the vertex buffer containing the
5790 * command that provoked the error. I don't see this as a problem.
5793 save_error(GLcontext
*ctx
, GLenum error
, const char *s
)
5796 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ERROR
, 2);
5799 n
[2].data
= (void *) s
;
5805 * Compile an error into current display list.
5808 _mesa_compile_error(GLcontext
*ctx
, GLenum error
, const char *s
)
5810 if (ctx
->CompileFlag
)
5811 save_error(ctx
, error
, s
);
5812 if (ctx
->ExecuteFlag
)
5813 _mesa_error(ctx
, error
, s
);
5818 * Test if ID names a display list.
5821 islist(GLcontext
*ctx
, GLuint list
)
5823 if (list
> 0 && lookup_list(ctx
, list
)) {
5833 /**********************************************************************/
5834 /* Display list execution */
5835 /**********************************************************************/
5839 * Execute a display list. Note that the ListBase offset must have already
5840 * been added before calling this function. I.e. the list argument is
5841 * the absolute list number, not relative to ListBase.
5842 * \param list - display list number
5845 execute_list(GLcontext
*ctx
, GLuint list
)
5847 struct gl_display_list
*dlist
;
5851 if (list
== 0 || !islist(ctx
, list
))
5854 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
5855 /* raise an error? */
5859 dlist
= lookup_list(ctx
, list
);
5863 ctx
->ListState
.CallDepth
++;
5865 if (ctx
->Driver
.BeginCallList
)
5866 ctx
->Driver
.BeginCallList(ctx
, dlist
);
5872 OpCode opcode
= n
[0].opcode
;
5873 int i
= (int) n
[0].opcode
- (int) OPCODE_EXT_0
;
5875 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
5876 /* this is a driver-extended opcode */
5877 ctx
->ListExt
.Opcode
[i
].Execute(ctx
, &n
[1]);
5878 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
5883 _mesa_error(ctx
, n
[1].e
, (const char *) n
[2].data
);
5886 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
5888 case OPCODE_ALPHA_FUNC
:
5889 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
5891 case OPCODE_BIND_TEXTURE
:
5892 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
5896 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5897 ctx
->Unpack
= ctx
->DefaultPacking
;
5898 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5899 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
5900 (const GLubyte
*) n
[7].data
));
5901 ctx
->Unpack
= save
; /* restore */
5904 case OPCODE_BLEND_COLOR
:
5905 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5907 case OPCODE_BLEND_EQUATION
:
5908 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
5910 case OPCODE_BLEND_EQUATION_SEPARATE
:
5911 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5913 case OPCODE_BLEND_FUNC_SEPARATE
:
5914 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
5915 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
5917 case OPCODE_CALL_LIST
:
5918 /* Generated by glCallList(), don't add ListBase */
5919 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5920 execute_list(ctx
, n
[1].ui
);
5923 case OPCODE_CALL_LIST_OFFSET
:
5924 /* Generated by glCallLists() so we must add ListBase */
5926 /* user specified a bad data type at compile time */
5927 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5929 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5930 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
5931 execute_list(ctx
, list
);
5935 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
5937 case OPCODE_CLEAR_COLOR
:
5938 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5940 case OPCODE_CLEAR_ACCUM
:
5941 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5943 case OPCODE_CLEAR_DEPTH
:
5944 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
5946 case OPCODE_CLEAR_INDEX
:
5947 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
5949 case OPCODE_CLEAR_STENCIL
:
5950 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
5952 case OPCODE_CLIP_PLANE
:
5959 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
5962 case OPCODE_COLOR_MASK
:
5963 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
5965 case OPCODE_COLOR_MATERIAL
:
5966 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5968 case OPCODE_COLOR_TABLE
:
5970 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5971 ctx
->Unpack
= ctx
->DefaultPacking
;
5972 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5973 n
[5].e
, n
[6].data
));
5974 ctx
->Unpack
= save
; /* restore */
5977 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
5984 CALL_ColorTableParameterfv(ctx
->Exec
,
5985 (n
[1].e
, n
[2].e
, params
));
5988 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
5995 CALL_ColorTableParameteriv(ctx
->Exec
,
5996 (n
[1].e
, n
[2].e
, params
));
5999 case OPCODE_COLOR_SUB_TABLE
:
6001 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6002 ctx
->Unpack
= ctx
->DefaultPacking
;
6003 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6004 n
[4].e
, n
[5].e
, n
[6].data
));
6005 ctx
->Unpack
= save
; /* restore */
6008 case OPCODE_CONVOLUTION_FILTER_1D
:
6010 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6011 ctx
->Unpack
= ctx
->DefaultPacking
;
6012 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6015 ctx
->Unpack
= save
; /* restore */
6018 case OPCODE_CONVOLUTION_FILTER_2D
:
6020 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6021 ctx
->Unpack
= ctx
->DefaultPacking
;
6022 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6023 n
[4].i
, n
[5].e
, n
[6].e
,
6025 ctx
->Unpack
= save
; /* restore */
6028 case OPCODE_CONVOLUTION_PARAMETER_I
:
6029 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
6031 case OPCODE_CONVOLUTION_PARAMETER_IV
:
6038 CALL_ConvolutionParameteriv(ctx
->Exec
,
6039 (n
[1].e
, n
[2].e
, params
));
6042 case OPCODE_CONVOLUTION_PARAMETER_F
:
6043 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
6045 case OPCODE_CONVOLUTION_PARAMETER_FV
:
6052 CALL_ConvolutionParameterfv(ctx
->Exec
,
6053 (n
[1].e
, n
[2].e
, params
));
6056 case OPCODE_COPY_COLOR_SUB_TABLE
:
6057 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6058 n
[3].i
, n
[4].i
, n
[5].i
));
6060 case OPCODE_COPY_COLOR_TABLE
:
6061 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6062 n
[3].i
, n
[4].i
, n
[5].i
));
6064 case OPCODE_COPY_PIXELS
:
6065 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6066 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
6069 case OPCODE_COPY_TEX_IMAGE1D
:
6070 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6071 n
[5].i
, n
[6].i
, n
[7].i
));
6073 case OPCODE_COPY_TEX_IMAGE2D
:
6074 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6075 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
6077 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
6078 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6079 n
[4].i
, n
[5].i
, n
[6].i
));
6081 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
6082 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6083 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6086 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
6087 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6088 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6091 case OPCODE_CULL_FACE
:
6092 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
6094 case OPCODE_DEPTH_FUNC
:
6095 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
6097 case OPCODE_DEPTH_MASK
:
6098 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
6100 case OPCODE_DEPTH_RANGE
:
6101 CALL_DepthRange(ctx
->Exec
,
6102 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
6104 case OPCODE_DISABLE
:
6105 CALL_Disable(ctx
->Exec
, (n
[1].e
));
6107 case OPCODE_DRAW_BUFFER
:
6108 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
6110 case OPCODE_DRAW_PIXELS
:
6112 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6113 ctx
->Unpack
= ctx
->DefaultPacking
;
6114 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
6116 ctx
->Unpack
= save
; /* restore */
6120 CALL_Enable(ctx
->Exec
, (n
[1].e
));
6122 case OPCODE_EVALMESH1
:
6123 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
6125 case OPCODE_EVALMESH2
:
6126 CALL_EvalMesh2(ctx
->Exec
,
6127 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
6136 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
6139 case OPCODE_FRONT_FACE
:
6140 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
6142 case OPCODE_FRUSTUM
:
6143 CALL_Frustum(ctx
->Exec
,
6144 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6147 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6149 case OPCODE_HISTOGRAM
:
6150 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
6152 case OPCODE_INDEX_MASK
:
6153 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
6155 case OPCODE_INIT_NAMES
:
6156 CALL_InitNames(ctx
->Exec
, ());
6165 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
6168 case OPCODE_LIGHT_MODEL
:
6175 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
6178 case OPCODE_LINE_STIPPLE
:
6179 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
6181 case OPCODE_LINE_WIDTH
:
6182 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
6184 case OPCODE_LIST_BASE
:
6185 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
6187 case OPCODE_LOAD_IDENTITY
:
6188 CALL_LoadIdentity(ctx
->Exec
, ());
6190 case OPCODE_LOAD_MATRIX
:
6191 if (sizeof(Node
) == sizeof(GLfloat
)) {
6192 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
6197 for (i
= 0; i
< 16; i
++) {
6200 CALL_LoadMatrixf(ctx
->Exec
, (m
));
6203 case OPCODE_LOAD_NAME
:
6204 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
6206 case OPCODE_LOGIC_OP
:
6207 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
6211 GLenum target
= n
[1].e
;
6212 GLint ustride
= _mesa_evaluator_components(target
);
6213 GLint uorder
= n
[5].i
;
6214 GLfloat u1
= n
[2].f
;
6215 GLfloat u2
= n
[3].f
;
6216 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6217 (GLfloat
*) n
[6].data
));
6222 GLenum target
= n
[1].e
;
6223 GLfloat u1
= n
[2].f
;
6224 GLfloat u2
= n
[3].f
;
6225 GLfloat v1
= n
[4].f
;
6226 GLfloat v2
= n
[5].f
;
6227 GLint ustride
= n
[6].i
;
6228 GLint vstride
= n
[7].i
;
6229 GLint uorder
= n
[8].i
;
6230 GLint vorder
= n
[9].i
;
6231 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6232 v1
, v2
, vstride
, vorder
,
6233 (GLfloat
*) n
[10].data
));
6236 case OPCODE_MAPGRID1
:
6237 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
6239 case OPCODE_MAPGRID2
:
6240 CALL_MapGrid2f(ctx
->Exec
,
6241 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
6243 case OPCODE_MATRIX_MODE
:
6244 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
6246 case OPCODE_MIN_MAX
:
6247 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
6249 case OPCODE_MULT_MATRIX
:
6250 if (sizeof(Node
) == sizeof(GLfloat
)) {
6251 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
6256 for (i
= 0; i
< 16; i
++) {
6259 CALL_MultMatrixf(ctx
->Exec
, (m
));
6263 CALL_Ortho(ctx
->Exec
,
6264 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6266 case OPCODE_PASSTHROUGH
:
6267 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
6269 case OPCODE_PIXEL_MAP
:
6270 CALL_PixelMapfv(ctx
->Exec
,
6271 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
6273 case OPCODE_PIXEL_TRANSFER
:
6274 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6276 case OPCODE_PIXEL_ZOOM
:
6277 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6279 case OPCODE_POINT_SIZE
:
6280 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
6282 case OPCODE_POINT_PARAMETERS
:
6288 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
6291 case OPCODE_POLYGON_MODE
:
6292 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6294 case OPCODE_POLYGON_STIPPLE
:
6296 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6297 ctx
->Unpack
= ctx
->DefaultPacking
;
6298 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
6299 ctx
->Unpack
= save
; /* restore */
6302 case OPCODE_POLYGON_OFFSET
:
6303 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6305 case OPCODE_POP_ATTRIB
:
6306 CALL_PopAttrib(ctx
->Exec
, ());
6308 case OPCODE_POP_MATRIX
:
6309 CALL_PopMatrix(ctx
->Exec
, ());
6311 case OPCODE_POP_NAME
:
6312 CALL_PopName(ctx
->Exec
, ());
6314 case OPCODE_PRIORITIZE_TEXTURE
:
6315 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
6317 case OPCODE_PUSH_ATTRIB
:
6318 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
6320 case OPCODE_PUSH_MATRIX
:
6321 CALL_PushMatrix(ctx
->Exec
, ());
6323 case OPCODE_PUSH_NAME
:
6324 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
6326 case OPCODE_RASTER_POS
:
6327 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6329 case OPCODE_READ_BUFFER
:
6330 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
6332 case OPCODE_RESET_HISTOGRAM
:
6333 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
6335 case OPCODE_RESET_MIN_MAX
:
6336 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
6339 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6342 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6344 case OPCODE_SCISSOR
:
6345 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
6347 case OPCODE_SHADE_MODEL
:
6348 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
6350 case OPCODE_STENCIL_FUNC
:
6351 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
6353 case OPCODE_STENCIL_MASK
:
6354 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
6356 case OPCODE_STENCIL_OP
:
6357 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
6359 case OPCODE_STENCIL_FUNC_SEPARATE
:
6360 CALL_StencilFuncSeparate(ctx
->Exec
,
6361 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
6363 case OPCODE_STENCIL_MASK_SEPARATE
:
6364 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6366 case OPCODE_STENCIL_OP_SEPARATE
:
6367 CALL_StencilOpSeparate(ctx
->Exec
,
6368 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6377 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6387 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6390 case OPCODE_TEXPARAMETER
:
6397 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6400 case OPCODE_TEX_IMAGE1D
:
6402 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6403 ctx
->Unpack
= ctx
->DefaultPacking
;
6404 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
6406 n
[3].i
, /* components */
6408 n
[5].e
, /* border */
6409 n
[6].e
, /* format */
6412 ctx
->Unpack
= save
; /* restore */
6415 case OPCODE_TEX_IMAGE2D
:
6417 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6418 ctx
->Unpack
= ctx
->DefaultPacking
;
6419 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
6421 n
[3].i
, /* components */
6423 n
[5].i
, /* height */
6424 n
[6].e
, /* border */
6425 n
[7].e
, /* format */
6428 ctx
->Unpack
= save
; /* restore */
6431 case OPCODE_TEX_IMAGE3D
:
6433 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6434 ctx
->Unpack
= ctx
->DefaultPacking
;
6435 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
6437 n
[3].i
, /* components */
6439 n
[5].i
, /* height */
6441 n
[7].e
, /* border */
6442 n
[8].e
, /* format */
6445 ctx
->Unpack
= save
; /* restore */
6448 case OPCODE_TEX_SUB_IMAGE1D
:
6450 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6451 ctx
->Unpack
= ctx
->DefaultPacking
;
6452 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6454 n
[6].e
, n
[7].data
));
6455 ctx
->Unpack
= save
; /* restore */
6458 case OPCODE_TEX_SUB_IMAGE2D
:
6460 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6461 ctx
->Unpack
= ctx
->DefaultPacking
;
6462 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6464 n
[6].i
, n
[7].e
, n
[8].e
,
6466 ctx
->Unpack
= save
; /* restore */
6469 case OPCODE_TEX_SUB_IMAGE3D
:
6471 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6472 ctx
->Unpack
= ctx
->DefaultPacking
;
6473 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6474 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6475 n
[8].i
, n
[9].e
, n
[10].e
,
6477 ctx
->Unpack
= save
; /* restore */
6480 case OPCODE_TRANSLATE
:
6481 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6483 case OPCODE_VIEWPORT
:
6484 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6485 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
6487 case OPCODE_WINDOW_POS
:
6488 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6490 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
6491 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
6493 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
6494 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6495 n
[4].i
, n
[5].i
, n
[6].i
,
6498 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
6499 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6500 n
[4].i
, n
[5].i
, n
[6].i
,
6501 n
[7].i
, n
[8].data
));
6503 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
6504 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6505 n
[4].i
, n
[5].i
, n
[6].i
,
6509 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
6510 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
6511 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6512 n
[5].e
, n
[6].i
, n
[7].data
));
6514 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
6515 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
6516 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6517 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
6520 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
6521 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
6522 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6523 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6524 n
[9].e
, n
[10].i
, n
[11].data
));
6526 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
6527 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
6529 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
6530 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6532 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6533 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
6534 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6537 #if FEATURE_NV_vertex_program
6538 case OPCODE_EXECUTE_PROGRAM_NV
:
6545 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
6548 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
6549 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
6550 (GLuint
*) n
[2].data
));
6552 case OPCODE_LOAD_PROGRAM_NV
:
6553 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
6554 (const GLubyte
*) n
[4].data
));
6556 case OPCODE_TRACK_MATRIX_NV
:
6557 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
6561 #if FEATURE_NV_fragment_program
6562 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
6563 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
6564 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
6567 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
6568 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
6569 (const GLubyte
*) n
[3].
6570 data
, n
[4].f
, n
[5].f
,
6575 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
6576 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
6578 case OPCODE_DEPTH_BOUNDS_EXT
:
6579 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6581 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6582 case OPCODE_PROGRAM_STRING_ARB
:
6583 CALL_ProgramStringARB(ctx
->Exec
,
6584 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
6587 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
6588 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
6589 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6594 #if FEATURE_ARB_occlusion_query
6595 case OPCODE_BEGIN_QUERY_ARB
:
6596 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6598 case OPCODE_END_QUERY_ARB
:
6599 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
6602 case OPCODE_DRAW_BUFFERS_ARB
:
6604 GLenum buffers
[MAX_DRAW_BUFFERS
];
6605 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
6606 for (i
= 0; i
< count
; i
++)
6607 buffers
[i
] = n
[2 + i
].e
;
6608 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
6611 #if FEATURE_EXT_framebuffer_blit
6612 case OPCODE_BLIT_FRAMEBUFFER
:
6613 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
6614 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6618 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
6621 GLuint i
, pname
= n
[1].ui
;
6623 for (i
= 0; i
< 4; i
++)
6624 values
[i
] = n
[1 + i
].f
;
6625 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
6628 #if FEATURE_ATI_fragment_shader
6629 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
6630 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
6632 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
6635 GLuint i
, dst
= n
[1].ui
;
6637 for (i
= 0; i
< 4; i
++)
6638 values
[i
] = n
[1 + i
].f
;
6639 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
6643 case OPCODE_ATTR_1F_NV
:
6644 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6646 case OPCODE_ATTR_2F_NV
:
6647 /* Really shouldn't have to do this - the Node structure
6648 * is convenient, but it would be better to store the data
6649 * packed appropriately so that it can be sent directly
6650 * on. With x86_64 becoming common, this will start to
6653 if (sizeof(Node
) == sizeof(GLfloat
))
6654 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6656 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6658 case OPCODE_ATTR_3F_NV
:
6659 if (sizeof(Node
) == sizeof(GLfloat
))
6660 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6662 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6665 case OPCODE_ATTR_4F_NV
:
6666 if (sizeof(Node
) == sizeof(GLfloat
))
6667 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6669 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6672 case OPCODE_ATTR_1F_ARB
:
6673 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6675 case OPCODE_ATTR_2F_ARB
:
6676 /* Really shouldn't have to do this - the Node structure
6677 * is convenient, but it would be better to store the data
6678 * packed appropriately so that it can be sent directly
6679 * on. With x86_64 becoming common, this will start to
6682 if (sizeof(Node
) == sizeof(GLfloat
))
6683 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6685 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6687 case OPCODE_ATTR_3F_ARB
:
6688 if (sizeof(Node
) == sizeof(GLfloat
))
6689 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6691 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6694 case OPCODE_ATTR_4F_ARB
:
6695 if (sizeof(Node
) == sizeof(GLfloat
))
6696 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6698 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6701 case OPCODE_MATERIAL
:
6702 if (sizeof(Node
) == sizeof(GLfloat
))
6703 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
6710 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
6714 CALL_Begin(ctx
->Exec
, (n
[1].e
));
6717 CALL_End(ctx
->Exec
, ());
6720 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6722 case OPCODE_EVAL_C1
:
6723 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
6725 case OPCODE_EVAL_C2
:
6726 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6728 case OPCODE_EVAL_P1
:
6729 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
6731 case OPCODE_EVAL_P2
:
6732 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
6735 case OPCODE_CONTINUE
:
6736 n
= (Node
*) n
[1].next
;
6738 case OPCODE_END_OF_LIST
:
6744 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d",
6746 _mesa_problem(ctx
, msg
);
6751 /* increment n to point to next compiled command */
6752 if (opcode
!= OPCODE_CONTINUE
) {
6753 n
+= InstSize
[opcode
];
6758 if (ctx
->Driver
.EndCallList
)
6759 ctx
->Driver
.EndCallList(ctx
);
6761 ctx
->ListState
.CallDepth
--;
6766 /**********************************************************************/
6768 /**********************************************************************/
6771 * Test if a display list number is valid.
6773 GLboolean GLAPIENTRY
6774 _mesa_IsList(GLuint list
)
6776 GET_CURRENT_CONTEXT(ctx
);
6777 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6778 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6779 return islist(ctx
, list
);
6784 * Delete a sequence of consecutive display lists.
6787 _mesa_DeleteLists(GLuint list
, GLsizei range
)
6789 GET_CURRENT_CONTEXT(ctx
);
6791 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6792 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6795 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
6798 for (i
= list
; i
< list
+ range
; i
++) {
6799 destroy_list(ctx
, i
);
6805 * Return a display list number, n, such that lists n through n+range-1
6809 _mesa_GenLists(GLsizei range
)
6811 GET_CURRENT_CONTEXT(ctx
);
6813 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6814 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6817 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
6825 * Make this an atomic operation
6827 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6829 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6831 /* reserve the list IDs by with empty/dummy lists */
6833 for (i
= 0; i
< range
; i
++) {
6834 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
6835 make_list(base
+ i
, 1));
6839 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6846 * Begin a new display list.
6849 _mesa_NewList(GLuint name
, GLenum mode
)
6851 GET_CURRENT_CONTEXT(ctx
);
6853 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6854 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6856 if (MESA_VERBOSE
& VERBOSE_API
)
6857 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
6858 _mesa_lookup_enum_by_nr(mode
));
6861 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
6865 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
6866 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
6870 if (ctx
->ListState
.CurrentList
) {
6871 /* already compiling a display list */
6872 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
6876 ctx
->CompileFlag
= GL_TRUE
;
6877 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6879 /* Reset acumulated list state:
6881 invalidate_saved_current_state( ctx
);
6883 /* Allocate new display list */
6884 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
6885 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
6886 ctx
->ListState
.CurrentPos
= 0;
6888 ctx
->Driver
.NewList(ctx
, name
, mode
);
6890 ctx
->CurrentDispatch
= ctx
->Save
;
6891 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6896 * End definition of current display list.
6901 GET_CURRENT_CONTEXT(ctx
);
6902 SAVE_FLUSH_VERTICES(ctx
);
6903 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6905 if (MESA_VERBOSE
& VERBOSE_API
)
6906 _mesa_debug(ctx
, "glEndList\n");
6908 /* Check that a list is under construction */
6909 if (!ctx
->ListState
.CurrentList
) {
6910 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
6914 /* Call before emitting END_OF_LIST, in case the driver wants to
6915 * emit opcodes itself.
6917 ctx
->Driver
.EndList(ctx
);
6919 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END_OF_LIST
, 0);
6921 /* Destroy old list, if any */
6922 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
6924 /* Install the new list */
6925 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
6926 ctx
->ListState
.CurrentList
->Name
,
6927 ctx
->ListState
.CurrentList
);
6930 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6931 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
6933 ctx
->ListState
.CurrentList
= NULL
;
6934 ctx
->ExecuteFlag
= GL_TRUE
;
6935 ctx
->CompileFlag
= GL_FALSE
;
6937 ctx
->CurrentDispatch
= ctx
->Exec
;
6938 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6943 _mesa_CallList(GLuint list
)
6945 GLboolean save_compile_flag
;
6946 GET_CURRENT_CONTEXT(ctx
);
6947 FLUSH_CURRENT(ctx
, 0);
6948 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6949 /* execute the display list, and restore the CompileFlag. */
6951 if (MESA_VERBOSE
& VERBOSE_API
)
6952 _mesa_debug(ctx
, "glCallList %d\n", list
);
6955 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6959 /* mesa_print_display_list( list ); */
6961 save_compile_flag
= ctx
->CompileFlag
;
6962 if (save_compile_flag
) {
6963 ctx
->CompileFlag
= GL_FALSE
;
6966 execute_list(ctx
, list
);
6967 ctx
->CompileFlag
= save_compile_flag
;
6969 /* also restore API function pointers to point to "save" versions */
6970 if (save_compile_flag
) {
6971 ctx
->CurrentDispatch
= ctx
->Save
;
6972 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6978 * Execute glCallLists: call multiple display lists.
6981 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
6983 GET_CURRENT_CONTEXT(ctx
);
6985 GLboolean save_compile_flag
;
6987 if (MESA_VERBOSE
& VERBOSE_API
)
6988 _mesa_debug(ctx
, "glCallLists %d\n", n
);
6992 case GL_UNSIGNED_BYTE
:
6994 case GL_UNSIGNED_SHORT
:
6996 case GL_UNSIGNED_INT
:
7004 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7008 /* Save the CompileFlag status, turn it off, execute display list,
7009 * and restore the CompileFlag.
7011 save_compile_flag
= ctx
->CompileFlag
;
7012 ctx
->CompileFlag
= GL_FALSE
;
7014 for (i
= 0; i
< n
; i
++) {
7015 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
7016 execute_list(ctx
, list
);
7019 ctx
->CompileFlag
= save_compile_flag
;
7021 /* also restore API function pointers to point to "save" versions */
7022 if (save_compile_flag
) {
7023 ctx
->CurrentDispatch
= ctx
->Save
;
7024 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7030 * Set the offset added to list numbers in glCallLists.
7033 _mesa_ListBase(GLuint base
)
7035 GET_CURRENT_CONTEXT(ctx
);
7036 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7037 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7038 ctx
->List
.ListBase
= base
;
7042 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
7044 static void GLAPIENTRY
7047 GET_CURRENT_CONTEXT(ctx
);
7048 FLUSH_VERTICES(ctx
, 0);
7049 CALL_Finish(ctx
->Exec
, ());
7052 static void GLAPIENTRY
7055 GET_CURRENT_CONTEXT(ctx
);
7056 FLUSH_VERTICES(ctx
, 0);
7057 CALL_Flush(ctx
->Exec
, ());
7060 static void GLAPIENTRY
7061 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
7063 GET_CURRENT_CONTEXT(ctx
);
7064 FLUSH_VERTICES(ctx
, 0);
7065 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
7068 static void GLAPIENTRY
7069 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
7071 GET_CURRENT_CONTEXT(ctx
);
7072 FLUSH_VERTICES(ctx
, 0);
7073 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
7076 static void GLAPIENTRY
7077 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
7079 GET_CURRENT_CONTEXT(ctx
);
7080 FLUSH_VERTICES(ctx
, 0);
7081 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
7084 static GLenum GLAPIENTRY
7087 GET_CURRENT_CONTEXT(ctx
);
7088 FLUSH_VERTICES(ctx
, 0);
7089 return CALL_GetError(ctx
->Exec
, ());
7092 static void GLAPIENTRY
7093 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
7095 GET_CURRENT_CONTEXT(ctx
);
7096 FLUSH_VERTICES(ctx
, 0);
7097 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
7100 static void GLAPIENTRY
7101 exec_GetIntegerv(GLenum pname
, GLint
*params
)
7103 GET_CURRENT_CONTEXT(ctx
);
7104 FLUSH_VERTICES(ctx
, 0);
7105 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
7108 static void GLAPIENTRY
7109 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
7111 GET_CURRENT_CONTEXT(ctx
);
7112 FLUSH_VERTICES(ctx
, 0);
7113 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
7116 static void GLAPIENTRY
7117 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
7119 GET_CURRENT_CONTEXT(ctx
);
7120 FLUSH_VERTICES(ctx
, 0);
7121 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
7124 static void GLAPIENTRY
7125 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
7127 GET_CURRENT_CONTEXT(ctx
);
7128 FLUSH_VERTICES(ctx
, 0);
7129 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
7132 static void GLAPIENTRY
7133 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
7135 GET_CURRENT_CONTEXT(ctx
);
7136 FLUSH_VERTICES(ctx
, 0);
7137 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
7140 static void GLAPIENTRY
7141 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
7143 GET_CURRENT_CONTEXT(ctx
);
7144 FLUSH_VERTICES(ctx
, 0);
7145 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
7148 static void GLAPIENTRY
7149 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
7151 GET_CURRENT_CONTEXT(ctx
);
7152 FLUSH_VERTICES(ctx
, 0);
7153 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
7156 static void GLAPIENTRY
7157 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
7159 GET_CURRENT_CONTEXT(ctx
);
7160 FLUSH_VERTICES(ctx
, 0);
7161 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
7164 static void GLAPIENTRY
7165 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
7167 GET_CURRENT_CONTEXT(ctx
);
7168 FLUSH_VERTICES(ctx
, 0);
7169 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
7172 static void GLAPIENTRY
7173 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
7175 GET_CURRENT_CONTEXT(ctx
);
7176 FLUSH_VERTICES(ctx
, 0);
7177 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
7180 static void GLAPIENTRY
7181 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
7183 GET_CURRENT_CONTEXT(ctx
);
7184 FLUSH_VERTICES(ctx
, 0);
7185 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
7188 static void GLAPIENTRY
7189 exec_GetPolygonStipple(GLubyte
* dest
)
7191 GET_CURRENT_CONTEXT(ctx
);
7192 FLUSH_VERTICES(ctx
, 0);
7193 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
7196 static const GLubyte
*GLAPIENTRY
7197 exec_GetString(GLenum name
)
7199 GET_CURRENT_CONTEXT(ctx
);
7200 FLUSH_VERTICES(ctx
, 0);
7201 return CALL_GetString(ctx
->Exec
, (name
));
7204 static void GLAPIENTRY
7205 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7207 GET_CURRENT_CONTEXT(ctx
);
7208 FLUSH_VERTICES(ctx
, 0);
7209 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
7212 static void GLAPIENTRY
7213 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
7215 GET_CURRENT_CONTEXT(ctx
);
7216 FLUSH_VERTICES(ctx
, 0);
7217 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
7220 static void GLAPIENTRY
7221 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
7223 GET_CURRENT_CONTEXT(ctx
);
7224 FLUSH_VERTICES(ctx
, 0);
7225 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
7228 static void GLAPIENTRY
7229 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
7231 GET_CURRENT_CONTEXT(ctx
);
7232 FLUSH_VERTICES(ctx
, 0);
7233 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
7236 static void GLAPIENTRY
7237 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
7239 GET_CURRENT_CONTEXT(ctx
);
7240 FLUSH_VERTICES(ctx
, 0);
7241 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
7244 static void GLAPIENTRY
7245 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
7246 GLenum type
, GLvoid
* pixels
)
7248 GET_CURRENT_CONTEXT(ctx
);
7249 FLUSH_VERTICES(ctx
, 0);
7250 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
7253 static void GLAPIENTRY
7254 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
7255 GLenum pname
, GLfloat
*params
)
7257 GET_CURRENT_CONTEXT(ctx
);
7258 FLUSH_VERTICES(ctx
, 0);
7259 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
7262 static void GLAPIENTRY
7263 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
7264 GLenum pname
, GLint
*params
)
7266 GET_CURRENT_CONTEXT(ctx
);
7267 FLUSH_VERTICES(ctx
, 0);
7268 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
7271 static void GLAPIENTRY
7272 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7274 GET_CURRENT_CONTEXT(ctx
);
7275 FLUSH_VERTICES(ctx
, 0);
7276 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
7279 static void GLAPIENTRY
7280 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7282 GET_CURRENT_CONTEXT(ctx
);
7283 FLUSH_VERTICES(ctx
, 0);
7284 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
7287 static GLboolean GLAPIENTRY
7288 exec_IsEnabled(GLenum cap
)
7290 GET_CURRENT_CONTEXT(ctx
);
7291 FLUSH_VERTICES(ctx
, 0);
7292 return CALL_IsEnabled(ctx
->Exec
, (cap
));
7295 static void GLAPIENTRY
7296 exec_PixelStoref(GLenum pname
, GLfloat param
)
7298 GET_CURRENT_CONTEXT(ctx
);
7299 FLUSH_VERTICES(ctx
, 0);
7300 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
7303 static void GLAPIENTRY
7304 exec_PixelStorei(GLenum pname
, GLint param
)
7306 GET_CURRENT_CONTEXT(ctx
);
7307 FLUSH_VERTICES(ctx
, 0);
7308 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
7311 static void GLAPIENTRY
7312 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
7313 GLenum format
, GLenum type
, GLvoid
* pixels
)
7315 GET_CURRENT_CONTEXT(ctx
);
7316 FLUSH_VERTICES(ctx
, 0);
7317 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
7320 static GLint GLAPIENTRY
7321 exec_RenderMode(GLenum mode
)
7323 GET_CURRENT_CONTEXT(ctx
);
7324 FLUSH_VERTICES(ctx
, 0);
7325 return CALL_RenderMode(ctx
->Exec
, (mode
));
7328 static void GLAPIENTRY
7329 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
7331 GET_CURRENT_CONTEXT(ctx
);
7332 FLUSH_VERTICES(ctx
, 0);
7333 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
7336 static void GLAPIENTRY
7337 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
7339 GET_CURRENT_CONTEXT(ctx
);
7340 FLUSH_VERTICES(ctx
, 0);
7341 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
7344 static GLboolean GLAPIENTRY
7345 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
7346 GLboolean
* residences
)
7348 GET_CURRENT_CONTEXT(ctx
);
7349 FLUSH_VERTICES(ctx
, 0);
7350 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
7353 static void GLAPIENTRY
7354 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7356 GET_CURRENT_CONTEXT(ctx
);
7357 FLUSH_VERTICES(ctx
, 0);
7358 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7361 static void GLAPIENTRY
7362 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
7364 GET_CURRENT_CONTEXT(ctx
);
7365 FLUSH_VERTICES(ctx
, 0);
7366 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
7369 static void GLAPIENTRY
7370 exec_DisableClientState(GLenum cap
)
7372 GET_CURRENT_CONTEXT(ctx
);
7373 FLUSH_VERTICES(ctx
, 0);
7374 CALL_DisableClientState(ctx
->Exec
, (cap
));
7377 static void GLAPIENTRY
7378 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
7380 GET_CURRENT_CONTEXT(ctx
);
7381 FLUSH_VERTICES(ctx
, 0);
7382 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
7385 static void GLAPIENTRY
7386 exec_EnableClientState(GLenum cap
)
7388 GET_CURRENT_CONTEXT(ctx
);
7389 FLUSH_VERTICES(ctx
, 0);
7390 CALL_EnableClientState(ctx
->Exec
, (cap
));
7393 static void GLAPIENTRY
7394 exec_GenTextures(GLsizei n
, GLuint
* texName
)
7396 GET_CURRENT_CONTEXT(ctx
);
7397 FLUSH_VERTICES(ctx
, 0);
7398 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
7401 static void GLAPIENTRY
7402 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
7404 GET_CURRENT_CONTEXT(ctx
);
7405 FLUSH_VERTICES(ctx
, 0);
7406 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
7409 static void GLAPIENTRY
7410 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7412 GET_CURRENT_CONTEXT(ctx
);
7413 FLUSH_VERTICES(ctx
, 0);
7414 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
7417 static void GLAPIENTRY
7418 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
7420 GET_CURRENT_CONTEXT(ctx
);
7421 FLUSH_VERTICES(ctx
, 0);
7422 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
7425 static GLboolean GLAPIENTRY
7426 exec_IsTexture(GLuint texture
)
7428 GET_CURRENT_CONTEXT(ctx
);
7429 FLUSH_VERTICES(ctx
, 0);
7430 return CALL_IsTexture(ctx
->Exec
, (texture
));
7433 static void GLAPIENTRY
7434 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7436 GET_CURRENT_CONTEXT(ctx
);
7437 FLUSH_VERTICES(ctx
, 0);
7438 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
7441 static void GLAPIENTRY
7442 exec_PopClientAttrib(void)
7444 GET_CURRENT_CONTEXT(ctx
);
7445 FLUSH_VERTICES(ctx
, 0);
7446 CALL_PopClientAttrib(ctx
->Exec
, ());
7449 static void GLAPIENTRY
7450 exec_PushClientAttrib(GLbitfield mask
)
7452 GET_CURRENT_CONTEXT(ctx
);
7453 FLUSH_VERTICES(ctx
, 0);
7454 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
7457 static void GLAPIENTRY
7458 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
7461 GET_CURRENT_CONTEXT(ctx
);
7462 FLUSH_VERTICES(ctx
, 0);
7463 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7466 static void GLAPIENTRY
7467 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
7469 GET_CURRENT_CONTEXT(ctx
);
7470 FLUSH_VERTICES(ctx
, 0);
7471 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
7474 static void GLAPIENTRY
7475 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
7478 GET_CURRENT_CONTEXT(ctx
);
7479 FLUSH_VERTICES(ctx
, 0);
7480 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7483 static void GLAPIENTRY
7484 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
7485 GLint x
, GLint y
, GLsizei width
)
7487 GET_CURRENT_CONTEXT(ctx
);
7488 FLUSH_VERTICES(ctx
, 0);
7489 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
7490 (target
, internalFormat
, x
, y
, width
));
7493 static void GLAPIENTRY
7494 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
7495 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
7497 GET_CURRENT_CONTEXT(ctx
);
7498 FLUSH_VERTICES(ctx
, 0);
7499 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
7500 (target
, internalFormat
, x
, y
, width
,
7504 static void GLAPIENTRY
7505 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
7507 GET_CURRENT_CONTEXT(ctx
);
7508 FLUSH_VERTICES(ctx
, 0);
7509 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
7512 static void GLAPIENTRY
7513 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7515 GET_CURRENT_CONTEXT(ctx
);
7516 FLUSH_VERTICES(ctx
, 0);
7517 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
7520 static void GLAPIENTRY
7521 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7523 GET_CURRENT_CONTEXT(ctx
);
7524 FLUSH_VERTICES(ctx
, 0);
7525 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
7528 static void GLAPIENTRY
7529 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
7532 GET_CURRENT_CONTEXT(ctx
);
7533 FLUSH_VERTICES(ctx
, 0);
7534 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
7537 static void GLAPIENTRY
7538 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7540 GET_CURRENT_CONTEXT(ctx
);
7541 FLUSH_VERTICES(ctx
, 0);
7542 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
7545 static void GLAPIENTRY
7546 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7548 GET_CURRENT_CONTEXT(ctx
);
7549 FLUSH_VERTICES(ctx
, 0);
7550 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
7553 static void GLAPIENTRY
7554 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
7555 GLenum type
, GLvoid
*values
)
7557 GET_CURRENT_CONTEXT(ctx
);
7558 FLUSH_VERTICES(ctx
, 0);
7559 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7562 static void GLAPIENTRY
7563 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7565 GET_CURRENT_CONTEXT(ctx
);
7566 FLUSH_VERTICES(ctx
, 0);
7567 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
7570 static void GLAPIENTRY
7571 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7573 GET_CURRENT_CONTEXT(ctx
);
7574 FLUSH_VERTICES(ctx
, 0);
7575 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
7578 static void GLAPIENTRY
7579 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
7580 GLenum type
, GLvoid
*values
)
7582 GET_CURRENT_CONTEXT(ctx
);
7583 FLUSH_VERTICES(ctx
, 0);
7584 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7587 static void GLAPIENTRY
7588 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7590 GET_CURRENT_CONTEXT(ctx
);
7591 FLUSH_VERTICES(ctx
, 0);
7592 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
7595 static void GLAPIENTRY
7596 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7598 GET_CURRENT_CONTEXT(ctx
);
7599 FLUSH_VERTICES(ctx
, 0);
7600 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
7603 static void GLAPIENTRY
7604 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
7605 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
7607 GET_CURRENT_CONTEXT(ctx
);
7608 FLUSH_VERTICES(ctx
, 0);
7609 CALL_GetSeparableFilter(ctx
->Exec
,
7610 (target
, format
, type
, row
, column
, span
));
7613 static void GLAPIENTRY
7614 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
7615 GLsizei width
, GLsizei height
, GLenum format
,
7616 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
7618 GET_CURRENT_CONTEXT(ctx
);
7619 FLUSH_VERTICES(ctx
, 0);
7620 CALL_SeparableFilter2D(ctx
->Exec
,
7621 (target
, internalFormat
, width
, height
, format
,
7622 type
, row
, column
));
7625 static void GLAPIENTRY
7626 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7627 GLsizei count
, const GLvoid
*ptr
)
7629 GET_CURRENT_CONTEXT(ctx
);
7630 FLUSH_VERTICES(ctx
, 0);
7631 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7634 static void GLAPIENTRY
7635 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
7637 GET_CURRENT_CONTEXT(ctx
);
7638 FLUSH_VERTICES(ctx
, 0);
7639 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
7642 static void GLAPIENTRY
7643 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7646 GET_CURRENT_CONTEXT(ctx
);
7647 FLUSH_VERTICES(ctx
, 0);
7648 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
7651 static void GLAPIENTRY
7652 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7655 GET_CURRENT_CONTEXT(ctx
);
7656 FLUSH_VERTICES(ctx
, 0);
7657 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
7660 static void GLAPIENTRY
7661 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7662 GLsizei count
, const GLvoid
*ptr
)
7664 GET_CURRENT_CONTEXT(ctx
);
7665 FLUSH_VERTICES(ctx
, 0);
7666 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7669 static void GLAPIENTRY
7670 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7671 GLsizei count
, const GLvoid
*ptr
)
7673 GET_CURRENT_CONTEXT(ctx
);
7674 FLUSH_VERTICES(ctx
, 0);
7675 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7678 static void GLAPIENTRY
7679 exec_LockArraysEXT(GLint first
, GLsizei count
)
7681 GET_CURRENT_CONTEXT(ctx
);
7682 FLUSH_VERTICES(ctx
, 0);
7683 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
7686 static void GLAPIENTRY
7687 exec_UnlockArraysEXT(void)
7689 GET_CURRENT_CONTEXT(ctx
);
7690 FLUSH_VERTICES(ctx
, 0);
7691 CALL_UnlockArraysEXT(ctx
->Exec
, ());
7694 static void GLAPIENTRY
7695 exec_ClientActiveTextureARB(GLenum target
)
7697 GET_CURRENT_CONTEXT(ctx
);
7698 FLUSH_VERTICES(ctx
, 0);
7699 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
7702 static void GLAPIENTRY
7703 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
7704 GLsizei stride
, const GLvoid
*ptr
)
7706 GET_CURRENT_CONTEXT(ctx
);
7707 FLUSH_VERTICES(ctx
, 0);
7708 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
7711 static void GLAPIENTRY
7712 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7714 GET_CURRENT_CONTEXT(ctx
);
7715 FLUSH_VERTICES(ctx
, 0);
7716 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
7719 /* GL_EXT_multi_draw_arrays */
7720 static void GLAPIENTRY
7721 exec_MultiDrawArraysEXT(GLenum mode
, GLint
* first
,
7722 GLsizei
* count
, GLsizei primcount
)
7724 GET_CURRENT_CONTEXT(ctx
);
7725 FLUSH_VERTICES(ctx
, 0);
7726 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
7729 /* GL_EXT_multi_draw_arrays */
7730 static void GLAPIENTRY
7731 exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
* count
,
7732 GLenum type
, const GLvoid
** indices
,
7735 GET_CURRENT_CONTEXT(ctx
);
7736 FLUSH_VERTICES(ctx
, 0);
7737 CALL_MultiDrawElementsEXT(ctx
->Exec
,
7738 (mode
, count
, type
, indices
, primcount
));
7741 /* GL_IBM_multimode_draw_arrays */
7742 static void GLAPIENTRY
7743 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
7744 const GLsizei
* count
, GLsizei primcount
,
7747 GET_CURRENT_CONTEXT(ctx
);
7748 FLUSH_VERTICES(ctx
, 0);
7749 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
7750 (mode
, first
, count
, primcount
, modestride
));
7753 /* GL_IBM_multimode_draw_arrays */
7754 static void GLAPIENTRY
7755 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
7756 const GLsizei
* count
,
7758 const GLvoid
* const *indices
,
7759 GLsizei primcount
, GLint modestride
)
7761 GET_CURRENT_CONTEXT(ctx
);
7762 FLUSH_VERTICES(ctx
, 0);
7763 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
7764 (mode
, count
, type
, indices
, primcount
,
7771 * Setup the given dispatch table to point to Mesa's display list
7772 * building functions.
7774 * This does not include any of the tnl functions - they are
7775 * initialized from _mesa_init_api_defaults and from the active vtxfmt
7779 _mesa_init_dlist_table(struct _glapi_table
*table
)
7781 _mesa_loopback_init_api_table(table
);
7784 SET_Accum(table
, save_Accum
);
7785 SET_AlphaFunc(table
, save_AlphaFunc
);
7786 SET_Bitmap(table
, save_Bitmap
);
7787 SET_BlendFunc(table
, save_BlendFunc
);
7788 SET_CallList(table
, _mesa_save_CallList
);
7789 SET_CallLists(table
, _mesa_save_CallLists
);
7790 SET_Clear(table
, save_Clear
);
7791 SET_ClearAccum(table
, save_ClearAccum
);
7792 SET_ClearColor(table
, save_ClearColor
);
7793 SET_ClearDepth(table
, save_ClearDepth
);
7794 SET_ClearIndex(table
, save_ClearIndex
);
7795 SET_ClearStencil(table
, save_ClearStencil
);
7796 SET_ClipPlane(table
, save_ClipPlane
);
7797 SET_ColorMask(table
, save_ColorMask
);
7798 SET_ColorMaterial(table
, save_ColorMaterial
);
7799 SET_CopyPixels(table
, save_CopyPixels
);
7800 SET_CullFace(table
, save_CullFace
);
7801 SET_DeleteLists(table
, _mesa_DeleteLists
);
7802 SET_DepthFunc(table
, save_DepthFunc
);
7803 SET_DepthMask(table
, save_DepthMask
);
7804 SET_DepthRange(table
, save_DepthRange
);
7805 SET_Disable(table
, save_Disable
);
7806 SET_DrawBuffer(table
, save_DrawBuffer
);
7807 SET_DrawPixels(table
, save_DrawPixels
);
7808 SET_Enable(table
, save_Enable
);
7809 SET_EndList(table
, _mesa_EndList
);
7810 SET_EvalMesh1(table
, _mesa_save_EvalMesh1
);
7811 SET_EvalMesh2(table
, _mesa_save_EvalMesh2
);
7812 SET_Finish(table
, exec_Finish
);
7813 SET_Flush(table
, exec_Flush
);
7814 SET_Fogf(table
, save_Fogf
);
7815 SET_Fogfv(table
, save_Fogfv
);
7816 SET_Fogi(table
, save_Fogi
);
7817 SET_Fogiv(table
, save_Fogiv
);
7818 SET_FrontFace(table
, save_FrontFace
);
7819 SET_Frustum(table
, save_Frustum
);
7820 SET_GenLists(table
, _mesa_GenLists
);
7821 SET_GetBooleanv(table
, exec_GetBooleanv
);
7822 SET_GetClipPlane(table
, exec_GetClipPlane
);
7823 SET_GetDoublev(table
, exec_GetDoublev
);
7824 SET_GetError(table
, exec_GetError
);
7825 SET_GetFloatv(table
, exec_GetFloatv
);
7826 SET_GetIntegerv(table
, exec_GetIntegerv
);
7827 SET_GetLightfv(table
, exec_GetLightfv
);
7828 SET_GetLightiv(table
, exec_GetLightiv
);
7829 SET_GetMapdv(table
, exec_GetMapdv
);
7830 SET_GetMapfv(table
, exec_GetMapfv
);
7831 SET_GetMapiv(table
, exec_GetMapiv
);
7832 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
7833 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
7834 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
7835 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
7836 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
7837 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
7838 SET_GetString(table
, exec_GetString
);
7839 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
7840 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
7841 SET_GetTexGendv(table
, exec_GetTexGendv
);
7842 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
7843 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
7844 SET_GetTexImage(table
, exec_GetTexImage
);
7845 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
7846 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
7847 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
7848 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
7849 SET_Hint(table
, save_Hint
);
7850 SET_IndexMask(table
, save_IndexMask
);
7851 SET_InitNames(table
, save_InitNames
);
7852 SET_IsEnabled(table
, exec_IsEnabled
);
7853 SET_IsList(table
, _mesa_IsList
);
7854 SET_LightModelf(table
, save_LightModelf
);
7855 SET_LightModelfv(table
, save_LightModelfv
);
7856 SET_LightModeli(table
, save_LightModeli
);
7857 SET_LightModeliv(table
, save_LightModeliv
);
7858 SET_Lightf(table
, save_Lightf
);
7859 SET_Lightfv(table
, save_Lightfv
);
7860 SET_Lighti(table
, save_Lighti
);
7861 SET_Lightiv(table
, save_Lightiv
);
7862 SET_LineStipple(table
, save_LineStipple
);
7863 SET_LineWidth(table
, save_LineWidth
);
7864 SET_ListBase(table
, save_ListBase
);
7865 SET_LoadIdentity(table
, save_LoadIdentity
);
7866 SET_LoadMatrixd(table
, save_LoadMatrixd
);
7867 SET_LoadMatrixf(table
, save_LoadMatrixf
);
7868 SET_LoadName(table
, save_LoadName
);
7869 SET_LogicOp(table
, save_LogicOp
);
7870 SET_Map1d(table
, save_Map1d
);
7871 SET_Map1f(table
, save_Map1f
);
7872 SET_Map2d(table
, save_Map2d
);
7873 SET_Map2f(table
, save_Map2f
);
7874 SET_MapGrid1d(table
, save_MapGrid1d
);
7875 SET_MapGrid1f(table
, save_MapGrid1f
);
7876 SET_MapGrid2d(table
, save_MapGrid2d
);
7877 SET_MapGrid2f(table
, save_MapGrid2f
);
7878 SET_MatrixMode(table
, save_MatrixMode
);
7879 SET_MultMatrixd(table
, save_MultMatrixd
);
7880 SET_MultMatrixf(table
, save_MultMatrixf
);
7881 SET_NewList(table
, save_NewList
);
7882 SET_Ortho(table
, save_Ortho
);
7883 SET_PassThrough(table
, save_PassThrough
);
7884 SET_PixelMapfv(table
, save_PixelMapfv
);
7885 SET_PixelMapuiv(table
, save_PixelMapuiv
);
7886 SET_PixelMapusv(table
, save_PixelMapusv
);
7887 SET_PixelStoref(table
, exec_PixelStoref
);
7888 SET_PixelStorei(table
, exec_PixelStorei
);
7889 SET_PixelTransferf(table
, save_PixelTransferf
);
7890 SET_PixelTransferi(table
, save_PixelTransferi
);
7891 SET_PixelZoom(table
, save_PixelZoom
);
7892 SET_PointSize(table
, save_PointSize
);
7893 SET_PolygonMode(table
, save_PolygonMode
);
7894 SET_PolygonOffset(table
, save_PolygonOffset
);
7895 SET_PolygonStipple(table
, save_PolygonStipple
);
7896 SET_PopAttrib(table
, save_PopAttrib
);
7897 SET_PopMatrix(table
, save_PopMatrix
);
7898 SET_PopName(table
, save_PopName
);
7899 SET_PushAttrib(table
, save_PushAttrib
);
7900 SET_PushMatrix(table
, save_PushMatrix
);
7901 SET_PushName(table
, save_PushName
);
7902 SET_RasterPos2d(table
, save_RasterPos2d
);
7903 SET_RasterPos2dv(table
, save_RasterPos2dv
);
7904 SET_RasterPos2f(table
, save_RasterPos2f
);
7905 SET_RasterPos2fv(table
, save_RasterPos2fv
);
7906 SET_RasterPos2i(table
, save_RasterPos2i
);
7907 SET_RasterPos2iv(table
, save_RasterPos2iv
);
7908 SET_RasterPos2s(table
, save_RasterPos2s
);
7909 SET_RasterPos2sv(table
, save_RasterPos2sv
);
7910 SET_RasterPos3d(table
, save_RasterPos3d
);
7911 SET_RasterPos3dv(table
, save_RasterPos3dv
);
7912 SET_RasterPos3f(table
, save_RasterPos3f
);
7913 SET_RasterPos3fv(table
, save_RasterPos3fv
);
7914 SET_RasterPos3i(table
, save_RasterPos3i
);
7915 SET_RasterPos3iv(table
, save_RasterPos3iv
);
7916 SET_RasterPos3s(table
, save_RasterPos3s
);
7917 SET_RasterPos3sv(table
, save_RasterPos3sv
);
7918 SET_RasterPos4d(table
, save_RasterPos4d
);
7919 SET_RasterPos4dv(table
, save_RasterPos4dv
);
7920 SET_RasterPos4f(table
, save_RasterPos4f
);
7921 SET_RasterPos4fv(table
, save_RasterPos4fv
);
7922 SET_RasterPos4i(table
, save_RasterPos4i
);
7923 SET_RasterPos4iv(table
, save_RasterPos4iv
);
7924 SET_RasterPos4s(table
, save_RasterPos4s
);
7925 SET_RasterPos4sv(table
, save_RasterPos4sv
);
7926 SET_ReadBuffer(table
, save_ReadBuffer
);
7927 SET_ReadPixels(table
, exec_ReadPixels
);
7928 SET_RenderMode(table
, exec_RenderMode
);
7929 SET_Rotated(table
, save_Rotated
);
7930 SET_Rotatef(table
, save_Rotatef
);
7931 SET_Scaled(table
, save_Scaled
);
7932 SET_Scalef(table
, save_Scalef
);
7933 SET_Scissor(table
, save_Scissor
);
7934 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
7935 SET_SelectBuffer(table
, exec_SelectBuffer
);
7936 SET_ShadeModel(table
, save_ShadeModel
);
7937 SET_StencilFunc(table
, save_StencilFunc
);
7938 SET_StencilMask(table
, save_StencilMask
);
7939 SET_StencilOp(table
, save_StencilOp
);
7940 SET_TexEnvf(table
, save_TexEnvf
);
7941 SET_TexEnvfv(table
, save_TexEnvfv
);
7942 SET_TexEnvi(table
, save_TexEnvi
);
7943 SET_TexEnviv(table
, save_TexEnviv
);
7944 SET_TexGend(table
, save_TexGend
);
7945 SET_TexGendv(table
, save_TexGendv
);
7946 SET_TexGenf(table
, save_TexGenf
);
7947 SET_TexGenfv(table
, save_TexGenfv
);
7948 SET_TexGeni(table
, save_TexGeni
);
7949 SET_TexGeniv(table
, save_TexGeniv
);
7950 SET_TexImage1D(table
, save_TexImage1D
);
7951 SET_TexImage2D(table
, save_TexImage2D
);
7952 SET_TexParameterf(table
, save_TexParameterf
);
7953 SET_TexParameterfv(table
, save_TexParameterfv
);
7954 SET_TexParameteri(table
, save_TexParameteri
);
7955 SET_TexParameteriv(table
, save_TexParameteriv
);
7956 SET_Translated(table
, save_Translated
);
7957 SET_Translatef(table
, save_Translatef
);
7958 SET_Viewport(table
, save_Viewport
);
7961 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
7962 SET_BindTexture(table
, save_BindTexture
);
7963 SET_ColorPointer(table
, exec_ColorPointer
);
7964 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
7965 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
7966 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
7967 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
7968 SET_DeleteTextures(table
, exec_DeleteTextures
);
7969 SET_DisableClientState(table
, exec_DisableClientState
);
7970 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
7971 SET_EnableClientState(table
, exec_EnableClientState
);
7972 SET_GenTextures(table
, exec_GenTextures
);
7973 SET_GetPointerv(table
, exec_GetPointerv
);
7974 SET_IndexPointer(table
, exec_IndexPointer
);
7975 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
7976 SET_IsTexture(table
, exec_IsTexture
);
7977 SET_NormalPointer(table
, exec_NormalPointer
);
7978 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
7979 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
7980 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
7981 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
7982 SET_TexSubImage1D(table
, save_TexSubImage1D
);
7983 SET_TexSubImage2D(table
, save_TexSubImage2D
);
7984 SET_VertexPointer(table
, exec_VertexPointer
);
7987 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
7988 SET_TexImage3D(table
, save_TexImage3D
);
7989 SET_TexSubImage3D(table
, save_TexSubImage3D
);
7992 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
7993 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
7994 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
7996 /* ATI_separate_stencil */
7997 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
7999 /* GL_ARB_imaging */
8000 /* Not all are supported */
8001 SET_BlendColor(table
, save_BlendColor
);
8002 SET_BlendEquation(table
, save_BlendEquation
);
8003 SET_ColorSubTable(table
, save_ColorSubTable
);
8004 SET_ColorTable(table
, save_ColorTable
);
8005 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
8006 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
8007 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
8008 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
8009 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
8010 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
8011 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
8012 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
8013 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
8014 SET_CopyColorTable(table
, save_CopyColorTable
);
8015 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
8016 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
8017 SET_GetColorTable(table
, exec_GetColorTable
);
8018 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
8019 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
8020 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
8021 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
8022 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
8023 SET_GetHistogram(table
, exec_GetHistogram
);
8024 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
8025 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
8026 SET_GetMinmax(table
, exec_GetMinmax
);
8027 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
8028 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
8029 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
8030 SET_Histogram(table
, save_Histogram
);
8031 SET_Minmax(table
, save_Minmax
);
8032 SET_ResetHistogram(table
, save_ResetHistogram
);
8033 SET_ResetMinmax(table
, save_ResetMinmax
);
8034 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
8036 /* 2. GL_EXT_blend_color */
8038 SET_BlendColorEXT(table
, save_BlendColorEXT
);
8041 /* 3. GL_EXT_polygon_offset */
8042 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
8044 /* 6. GL_EXT_texture3d */
8046 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
8047 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
8048 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
8051 /* 14. GL_SGI_color_table */
8053 SET_ColorTableSGI(table
, save_ColorTable
);
8054 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
8055 SET_GetColorTableSGI(table
, exec_GetColorTable
);
8056 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
8057 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
8060 /* 30. GL_EXT_vertex_array */
8061 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
8062 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
8063 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
8064 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
8065 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
8066 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
8068 /* 37. GL_EXT_blend_minmax */
8070 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
8073 /* 54. GL_EXT_point_parameters */
8074 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
8075 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
8077 /* 97. GL_EXT_compiled_vertex_array */
8078 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
8079 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
8081 /* 145. GL_EXT_secondary_color */
8082 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
8084 /* 148. GL_EXT_multi_draw_arrays */
8085 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
8086 SET_MultiDrawElementsEXT(table
, exec_MultiDrawElementsEXT
);
8088 /* 149. GL_EXT_fog_coord */
8089 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
8091 /* 173. GL_EXT_blend_func_separate */
8092 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
8094 /* 196. GL_MESA_resize_buffers */
8095 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
8097 /* 197. GL_MESA_window_pos */
8098 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
8099 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
8100 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
8101 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
8102 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
8103 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
8104 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
8105 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
8106 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
8107 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
8108 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
8109 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
8110 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
8111 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
8112 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
8113 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
8114 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
8115 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
8116 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
8117 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
8118 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
8119 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
8120 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
8121 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
8123 /* 200. GL_IBM_multimode_draw_arrays */
8124 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
8125 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
8127 #if FEATURE_NV_vertex_program
8128 /* 233. GL_NV_vertex_program */
8129 /* The following commands DO NOT go into display lists:
8130 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
8131 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
8133 SET_BindProgramNV(table
, save_BindProgramNV
);
8134 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8135 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
8136 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8137 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
8138 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
8139 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
8140 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
8141 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
8142 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
8143 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
8144 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8145 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8146 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8147 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8148 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
8149 SET_LoadProgramNV(table
, save_LoadProgramNV
);
8150 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
8151 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
8152 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
8153 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
8154 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
8155 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
8156 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
8157 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
8160 /* 244. GL_ATI_envmap_bumpmap */
8161 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
8162 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
8164 /* 245. GL_ATI_fragment_shader */
8165 #if FEATURE_ATI_fragment_shader
8166 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
8167 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
8170 /* 282. GL_NV_fragment_program */
8171 #if FEATURE_NV_fragment_program
8172 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
8173 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
8174 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
8175 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
8176 SET_GetProgramNamedParameterfvNV(table
,
8177 _mesa_GetProgramNamedParameterfvNV
);
8178 SET_GetProgramNamedParameterdvNV(table
,
8179 _mesa_GetProgramNamedParameterdvNV
);
8180 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8181 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8182 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8183 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8184 SET_GetProgramLocalParameterdvARB(table
,
8185 _mesa_GetProgramLocalParameterdvARB
);
8186 SET_GetProgramLocalParameterfvARB(table
,
8187 _mesa_GetProgramLocalParameterfvARB
);
8190 /* 262. GL_NV_point_sprite */
8191 SET_PointParameteriNV(table
, save_PointParameteriNV
);
8192 SET_PointParameterivNV(table
, save_PointParameterivNV
);
8194 /* 268. GL_EXT_stencil_two_side */
8195 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
8197 /* 273. GL_APPLE_vertex_array_object */
8198 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
8199 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
8200 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
8201 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
8203 /* ???. GL_EXT_depth_bounds_test */
8204 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
8206 /* ARB 1. GL_ARB_multitexture */
8207 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
8208 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
8210 /* ARB 3. GL_ARB_transpose_matrix */
8211 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
8212 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
8213 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
8214 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
8216 /* ARB 5. GL_ARB_multisample */
8217 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
8219 /* ARB 12. GL_ARB_texture_compression */
8220 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
8221 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
8222 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
8223 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
8224 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
8225 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
8226 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
8228 /* ARB 14. GL_ARB_point_parameters */
8229 /* aliased with EXT_point_parameters functions */
8231 /* ARB 25. GL_ARB_window_pos */
8232 /* aliased with MESA_window_pos functions */
8234 /* ARB 26. GL_ARB_vertex_program */
8235 /* ARB 27. GL_ARB_fragment_program */
8236 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8237 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
8238 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
8239 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
8240 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
8241 SET_ProgramStringARB(table
, save_ProgramStringARB
);
8242 SET_BindProgramNV(table
, save_BindProgramNV
);
8243 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8244 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8245 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
8246 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8247 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8248 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8249 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8250 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
8251 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
8252 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
8253 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
8254 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8255 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8256 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8257 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8258 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
8259 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
8260 SET_GetProgramLocalParameterdvARB(table
,
8261 _mesa_GetProgramLocalParameterdvARB
);
8262 SET_GetProgramLocalParameterfvARB(table
,
8263 _mesa_GetProgramLocalParameterfvARB
);
8264 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
8265 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
8268 /* ARB 28. GL_ARB_vertex_buffer_object */
8269 #if FEATURE_ARB_vertex_buffer_object
8270 /* None of the extension's functions get compiled */
8271 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
8272 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
8273 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
8274 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
8275 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
8276 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
8277 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
8278 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
8279 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
8280 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
8281 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
8284 #if FEATURE_ARB_occlusion_query
8285 SET_BeginQueryARB(table
, save_BeginQueryARB
);
8286 SET_EndQueryARB(table
, save_EndQueryARB
);
8287 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
8288 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
8289 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
8290 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
8291 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
8292 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
8294 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
8296 #if FEATURE_EXT_framebuffer_blit
8297 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
8300 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
8301 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
8302 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
8303 /* XXX additional functions need to be implemented here! */
8305 /* 299. GL_EXT_blend_equation_separate */
8306 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
8308 /* GL_EXT_gpu_program_parmaeters */
8309 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8310 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
8311 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
8318 enum_string(GLenum k
)
8320 return _mesa_lookup_enum_by_nr(k
);
8325 * Print the commands in a display list. For debugging only.
8326 * TODO: many commands aren't handled yet.
8328 static void GLAPIENTRY
8329 print_list(GLcontext
*ctx
, GLuint list
)
8331 struct gl_display_list
*dlist
;
8335 if (!islist(ctx
, list
)) {
8336 _mesa_printf("%u is not a display list ID\n", list
);
8340 dlist
= lookup_list(ctx
, list
);
8346 _mesa_printf("START-LIST %u, address %p\n", list
, (void *) n
);
8348 done
= n
? GL_FALSE
: GL_TRUE
;
8350 OpCode opcode
= n
[0].opcode
;
8351 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
8353 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
8354 /* this is a driver-extended opcode */
8355 ctx
->ListExt
.Opcode
[i
].Print(ctx
, &n
[1]);
8356 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
8361 _mesa_printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
8364 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
8365 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
8367 case OPCODE_CALL_LIST
:
8368 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
8370 case OPCODE_CALL_LIST_OFFSET
:
8371 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
8372 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
8374 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
8375 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
8376 enum_string(n
[1].e
), enum_string(n
[2].e
),
8377 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8379 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
8380 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
8381 enum_string(n
[1].e
), enum_string(n
[2].e
),
8382 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
8384 case OPCODE_DISABLE
:
8385 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
8388 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
8390 case OPCODE_FRUSTUM
:
8391 _mesa_printf("Frustum %g %g %g %g %g %g\n",
8392 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8394 case OPCODE_LINE_STIPPLE
:
8395 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
8397 case OPCODE_LOAD_IDENTITY
:
8398 _mesa_printf("LoadIdentity\n");
8400 case OPCODE_LOAD_MATRIX
:
8401 _mesa_printf("LoadMatrix\n");
8402 _mesa_printf(" %8f %8f %8f %8f\n",
8403 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8404 _mesa_printf(" %8f %8f %8f %8f\n",
8405 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8406 _mesa_printf(" %8f %8f %8f %8f\n",
8407 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8408 _mesa_printf(" %8f %8f %8f %8f\n",
8409 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8411 case OPCODE_MULT_MATRIX
:
8412 _mesa_printf("MultMatrix (or Rotate)\n");
8413 _mesa_printf(" %8f %8f %8f %8f\n",
8414 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8415 _mesa_printf(" %8f %8f %8f %8f\n",
8416 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8417 _mesa_printf(" %8f %8f %8f %8f\n",
8418 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8419 _mesa_printf(" %8f %8f %8f %8f\n",
8420 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8423 _mesa_printf("Ortho %g %g %g %g %g %g\n",
8424 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8426 case OPCODE_POP_ATTRIB
:
8427 _mesa_printf("PopAttrib\n");
8429 case OPCODE_POP_MATRIX
:
8430 _mesa_printf("PopMatrix\n");
8432 case OPCODE_POP_NAME
:
8433 _mesa_printf("PopName\n");
8435 case OPCODE_PUSH_ATTRIB
:
8436 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
8438 case OPCODE_PUSH_MATRIX
:
8439 _mesa_printf("PushMatrix\n");
8441 case OPCODE_PUSH_NAME
:
8442 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
8444 case OPCODE_RASTER_POS
:
8445 _mesa_printf("RasterPos %g %g %g %g\n",
8446 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8449 _mesa_printf("Rotate %g %g %g %g\n",
8450 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8453 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8455 case OPCODE_TRANSLATE
:
8456 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8458 case OPCODE_BIND_TEXTURE
:
8459 _mesa_printf("BindTexture %s %d\n",
8460 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
8462 case OPCODE_SHADE_MODEL
:
8463 _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
8466 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
8467 _mesa_lookup_enum_by_nr(n
[1].ui
),
8468 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
8471 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
8472 _mesa_lookup_enum_by_nr(n
[1].ui
),
8473 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
8474 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
8476 case OPCODE_MAPGRID1
:
8477 _mesa_printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
8479 case OPCODE_MAPGRID2
:
8480 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
8481 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
8483 case OPCODE_EVALMESH1
:
8484 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
8486 case OPCODE_EVALMESH2
:
8487 _mesa_printf("EvalMesh2 %d %d %d %d\n",
8488 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
8491 case OPCODE_ATTR_1F_NV
:
8492 _mesa_printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
8494 case OPCODE_ATTR_2F_NV
:
8495 _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
8496 n
[1].i
, n
[2].f
, n
[3].f
);
8498 case OPCODE_ATTR_3F_NV
:
8499 _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
8500 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8502 case OPCODE_ATTR_4F_NV
:
8503 _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
8504 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8506 case OPCODE_ATTR_1F_ARB
:
8507 _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
8509 case OPCODE_ATTR_2F_ARB
:
8510 _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
8511 n
[1].i
, n
[2].f
, n
[3].f
);
8513 case OPCODE_ATTR_3F_ARB
:
8514 _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
8515 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8517 case OPCODE_ATTR_4F_ARB
:
8518 _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
8519 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8522 case OPCODE_MATERIAL
:
8523 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
8524 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8527 _mesa_printf("BEGIN %x\n", n
[1].i
);
8530 _mesa_printf("END\n");
8533 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
8536 case OPCODE_EVAL_C1
:
8537 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
8539 case OPCODE_EVAL_C2
:
8540 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
8542 case OPCODE_EVAL_P1
:
8543 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
8545 case OPCODE_EVAL_P2
:
8546 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
8550 * meta opcodes/commands
8553 _mesa_printf("Error: %s %s\n",
8554 enum_string(n
[1].e
), (const char *) n
[2].data
);
8556 case OPCODE_CONTINUE
:
8557 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
8558 n
= (Node
*) n
[1].next
;
8560 case OPCODE_END_OF_LIST
:
8561 _mesa_printf("END-LIST %u\n", list
);
8565 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
8567 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
8568 opcode
, (void *) n
);
8572 _mesa_printf("command %d, %u operands\n", opcode
,
8576 /* increment n to point to next compiled command */
8577 if (opcode
!= OPCODE_CONTINUE
) {
8578 n
+= InstSize
[opcode
];
8587 * Clients may call this function to help debug display list problems.
8588 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
8589 * changed, or break in the future without notice.
8592 mesa_print_display_list(GLuint list
)
8594 GET_CURRENT_CONTEXT(ctx
);
8595 print_list(ctx
, list
);
8599 /**********************************************************************/
8600 /***** Initialization *****/
8601 /**********************************************************************/
8604 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
8606 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
8607 vfmt
->Begin
= save_Begin
;
8608 vfmt
->CallList
= _mesa_save_CallList
;
8609 vfmt
->CallLists
= _mesa_save_CallLists
;
8610 vfmt
->Color3f
= save_Color3f
;
8611 vfmt
->Color3fv
= save_Color3fv
;
8612 vfmt
->Color4f
= save_Color4f
;
8613 vfmt
->Color4fv
= save_Color4fv
;
8614 vfmt
->EdgeFlag
= save_EdgeFlag
;
8615 vfmt
->End
= save_End
;
8616 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
8617 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
8618 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
8619 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
8620 vfmt
->EvalPoint1
= save_EvalPoint1
;
8621 vfmt
->EvalPoint2
= save_EvalPoint2
;
8622 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
8623 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
8624 vfmt
->Indexf
= save_Indexf
;
8625 vfmt
->Indexfv
= save_Indexfv
;
8626 vfmt
->Materialfv
= save_Materialfv
;
8627 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
8628 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
8629 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
8630 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
8631 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
8632 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
8633 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
8634 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
8635 vfmt
->Normal3f
= save_Normal3f
;
8636 vfmt
->Normal3fv
= save_Normal3fv
;
8637 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
8638 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
8639 vfmt
->TexCoord1f
= save_TexCoord1f
;
8640 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
8641 vfmt
->TexCoord2f
= save_TexCoord2f
;
8642 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
8643 vfmt
->TexCoord3f
= save_TexCoord3f
;
8644 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
8645 vfmt
->TexCoord4f
= save_TexCoord4f
;
8646 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
8647 vfmt
->Vertex2f
= save_Vertex2f
;
8648 vfmt
->Vertex2fv
= save_Vertex2fv
;
8649 vfmt
->Vertex3f
= save_Vertex3f
;
8650 vfmt
->Vertex3fv
= save_Vertex3fv
;
8651 vfmt
->Vertex4f
= save_Vertex4f
;
8652 vfmt
->Vertex4fv
= save_Vertex4fv
;
8653 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
8654 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
8655 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
8656 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
8657 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
8658 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
8659 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
8660 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
8661 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
8662 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
8663 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
8664 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
8665 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
8666 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
8667 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
8668 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
8670 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
8671 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
8672 vfmt
->Rectf
= save_Rectf
;
8674 /* The driver is required to implement these as
8675 * 1) They can probably do a better job.
8676 * 2) A lot of new mechanisms would have to be added to this module
8677 * to support it. That code would probably never get used,
8681 vfmt
->DrawArrays
= 0;
8682 vfmt
->DrawElements
= 0;
8683 vfmt
->DrawRangeElements
= 0;
8689 * Initialize display list state for given context.
8692 _mesa_init_display_list(GLcontext
*ctx
)
8694 static GLboolean tableInitialized
= GL_FALSE
;
8696 /* zero-out the instruction size table, just once */
8697 if (!tableInitialized
) {
8698 _mesa_bzero(InstSize
, sizeof(InstSize
));
8699 tableInitialized
= GL_TRUE
;
8703 ctx
->ListState
.CallDepth
= 0;
8704 ctx
->ExecuteFlag
= GL_TRUE
;
8705 ctx
->CompileFlag
= GL_FALSE
;
8706 ctx
->ListState
.CurrentBlock
= NULL
;
8707 ctx
->ListState
.CurrentPos
= 0;
8709 /* Display List group */
8710 ctx
->List
.ListBase
= 0;
8712 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);