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 /* GL_EXT_provoking_vertex */
356 OPCODE_PROVOKING_VERTEX
,
358 /* The following three are meta instructions */
359 OPCODE_ERROR
, /* raise compiled-in error */
370 * Display list instructions are stored as sequences of "nodes". Nodes
371 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
372 * are linked together with a pointer.
374 * Each instruction in the display list is stored as a sequence of
375 * contiguous nodes in memory.
376 * Each node is the union of a variety of data types.
391 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
395 typedef union gl_dlist_node Node
;
399 * How many nodes to allocate at a time.
401 * \note Reduced now that we hold vertices etc. elsewhere.
403 #define BLOCK_SIZE 256
408 * Number of nodes of storage needed for each instruction.
409 * Sizes for dynamically allocated opcodes are stored in the context struct.
411 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
413 void mesa_print_display_list(GLuint list
);
416 /**********************************************************************/
417 /***** Private *****/
418 /**********************************************************************/
422 * Make an empty display list. This is used by glGenLists() to
423 * reserve display list IDs.
425 static struct gl_display_list
*
426 make_list(GLuint name
, GLuint count
)
428 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
430 dlist
->Head
= (Node
*) _mesa_malloc(sizeof(Node
) * count
);
431 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
437 * Lookup function to just encapsulate casting.
439 static INLINE
struct gl_display_list
*
440 lookup_list(GLcontext
*ctx
, GLuint list
)
442 return (struct gl_display_list
*)
443 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
449 * Delete the named display list, but don't remove from hash table.
450 * \param dlist - display list pointer
453 _mesa_delete_list(GLcontext
*ctx
, struct gl_display_list
*dlist
)
458 n
= block
= dlist
->Head
;
460 done
= block
? GL_FALSE
: GL_TRUE
;
463 /* check for extension opcodes first */
465 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
466 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
467 ctx
->ListExt
.Opcode
[i
].Destroy(ctx
, &n
[1]);
468 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
471 switch (n
[0].opcode
) {
472 /* for some commands, we need to free malloc'd memory */
474 _mesa_free(n
[6].data
);
475 n
+= InstSize
[n
[0].opcode
];
478 _mesa_free(n
[10].data
);
479 n
+= InstSize
[n
[0].opcode
];
481 case OPCODE_DRAW_PIXELS
:
482 _mesa_free(n
[5].data
);
483 n
+= InstSize
[n
[0].opcode
];
486 _mesa_free(n
[7].data
);
487 n
+= InstSize
[n
[0].opcode
];
489 case OPCODE_COLOR_TABLE
:
490 _mesa_free(n
[6].data
);
491 n
+= InstSize
[n
[0].opcode
];
493 case OPCODE_COLOR_SUB_TABLE
:
494 _mesa_free(n
[6].data
);
495 n
+= InstSize
[n
[0].opcode
];
497 case OPCODE_CONVOLUTION_FILTER_1D
:
498 _mesa_free(n
[6].data
);
499 n
+= InstSize
[n
[0].opcode
];
501 case OPCODE_CONVOLUTION_FILTER_2D
:
502 _mesa_free(n
[7].data
);
503 n
+= InstSize
[n
[0].opcode
];
505 case OPCODE_POLYGON_STIPPLE
:
506 _mesa_free(n
[1].data
);
507 n
+= InstSize
[n
[0].opcode
];
509 case OPCODE_TEX_IMAGE1D
:
510 _mesa_free(n
[8].data
);
511 n
+= InstSize
[n
[0].opcode
];
513 case OPCODE_TEX_IMAGE2D
:
514 _mesa_free(n
[9].data
);
515 n
+= InstSize
[n
[0].opcode
];
517 case OPCODE_TEX_IMAGE3D
:
518 _mesa_free(n
[10].data
);
519 n
+= InstSize
[n
[0].opcode
];
521 case OPCODE_TEX_SUB_IMAGE1D
:
522 _mesa_free(n
[7].data
);
523 n
+= InstSize
[n
[0].opcode
];
525 case OPCODE_TEX_SUB_IMAGE2D
:
526 _mesa_free(n
[9].data
);
527 n
+= InstSize
[n
[0].opcode
];
529 case OPCODE_TEX_SUB_IMAGE3D
:
530 _mesa_free(n
[11].data
);
531 n
+= InstSize
[n
[0].opcode
];
533 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
534 _mesa_free(n
[7].data
);
535 n
+= InstSize
[n
[0].opcode
];
537 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
538 _mesa_free(n
[8].data
);
539 n
+= InstSize
[n
[0].opcode
];
541 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
542 _mesa_free(n
[9].data
);
543 n
+= InstSize
[n
[0].opcode
];
545 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
546 _mesa_free(n
[7].data
);
547 n
+= InstSize
[n
[0].opcode
];
549 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
550 _mesa_free(n
[9].data
);
551 n
+= InstSize
[n
[0].opcode
];
553 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
554 _mesa_free(n
[11].data
);
555 n
+= InstSize
[n
[0].opcode
];
557 #if FEATURE_NV_vertex_program
558 case OPCODE_LOAD_PROGRAM_NV
:
559 _mesa_free(n
[4].data
); /* program string */
560 n
+= InstSize
[n
[0].opcode
];
562 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
563 _mesa_free(n
[2].data
); /* array of program ids */
564 n
+= InstSize
[n
[0].opcode
];
567 #if FEATURE_NV_fragment_program
568 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
569 _mesa_free(n
[3].data
); /* parameter name */
570 n
+= InstSize
[n
[0].opcode
];
573 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
574 case OPCODE_PROGRAM_STRING_ARB
:
575 _mesa_free(n
[4].data
); /* program string */
576 n
+= InstSize
[n
[0].opcode
];
579 case OPCODE_CONTINUE
:
580 n
= (Node
*) n
[1].next
;
584 case OPCODE_END_OF_LIST
:
589 /* Most frequent case */
590 n
+= InstSize
[n
[0].opcode
];
601 * Destroy a display list and remove from hash table.
602 * \param list - display list number
605 destroy_list(GLcontext
*ctx
, GLuint list
)
607 struct gl_display_list
*dlist
;
612 dlist
= lookup_list(ctx
, list
);
616 _mesa_delete_list(ctx
, dlist
);
617 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
622 * Translate the nth element of list from <type> to GLint.
625 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
637 bptr
= (GLbyte
*) list
;
638 return (GLint
) bptr
[n
];
639 case GL_UNSIGNED_BYTE
:
640 ubptr
= (GLubyte
*) list
;
641 return (GLint
) ubptr
[n
];
643 sptr
= (GLshort
*) list
;
644 return (GLint
) sptr
[n
];
645 case GL_UNSIGNED_SHORT
:
646 usptr
= (GLushort
*) list
;
647 return (GLint
) usptr
[n
];
649 iptr
= (GLint
*) list
;
651 case GL_UNSIGNED_INT
:
652 uiptr
= (GLuint
*) list
;
653 return (GLint
) uiptr
[n
];
655 fptr
= (GLfloat
*) list
;
656 return (GLint
) FLOORF(fptr
[n
]);
658 ubptr
= ((GLubyte
*) list
) + 2 * n
;
659 return (GLint
) ubptr
[0] * 256
662 ubptr
= ((GLubyte
*) list
) + 3 * n
;
663 return (GLint
) ubptr
[0] * 65536
664 + (GLint
) ubptr
[1] * 256
667 ubptr
= ((GLubyte
*) list
) + 4 * n
;
668 return (GLint
) ubptr
[0] * 16777216
669 + (GLint
) ubptr
[1] * 65536
670 + (GLint
) ubptr
[2] * 256
680 /**********************************************************************/
682 /**********************************************************************/
685 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
686 * If we run out of memory, GL_OUT_OF_MEMORY will be recorded.
689 unpack_image(GLcontext
*ctx
, GLuint dimensions
,
690 GLsizei width
, GLsizei height
, GLsizei depth
,
691 GLenum format
, GLenum type
, const GLvoid
* pixels
,
692 const struct gl_pixelstore_attrib
*unpack
)
694 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
696 GLvoid
*image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
697 format
, type
, pixels
, unpack
);
698 if (pixels
&& !image
) {
699 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
703 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
, depth
,
704 format
, type
, pixels
)) {
705 const GLubyte
*map
, *src
;
709 ctx
->Driver
.MapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
710 GL_READ_ONLY_ARB
, unpack
->BufferObj
);
712 /* unable to map src buffer! */
713 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
717 src
= ADD_POINTERS(map
, pixels
);
718 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
719 format
, type
, src
, unpack
);
721 ctx
->Driver
.UnmapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
725 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
735 * Allocate space for a display list instruction.
736 * \param opcode the instruction opcode (OPCODE_* value)
737 * \param bytes instruction size in bytes, not counting opcode.
738 * \return pointer to the usable data area (not including the internal
742 _mesa_alloc_instruction(GLcontext
*ctx
, GLuint opcode
, GLuint bytes
)
744 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
747 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
748 if (InstSize
[opcode
] == 0) {
749 /* save instruction size now */
750 InstSize
[opcode
] = numNodes
;
753 /* make sure instruction size agrees */
754 ASSERT(numNodes
== InstSize
[opcode
]);
758 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
759 /* This block is full. Allocate a new block and chain to it */
761 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
762 n
[0].opcode
= OPCODE_CONTINUE
;
763 newblock
= (Node
*) _mesa_malloc(sizeof(Node
) * BLOCK_SIZE
);
765 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
768 n
[1].next
= (Node
*) newblock
;
769 ctx
->ListState
.CurrentBlock
= newblock
;
770 ctx
->ListState
.CurrentPos
= 0;
773 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
774 ctx
->ListState
.CurrentPos
+= numNodes
;
776 n
[0].opcode
= (OpCode
) opcode
;
778 return (void *) (n
+ 1); /* return ptr to node following opcode */
783 * This function allows modules and drivers to get their own opcodes
784 * for extending display list functionality.
785 * \param ctx the rendering context
786 * \param size number of bytes for storing the new display list command
787 * \param execute function to execute the new display list command
788 * \param destroy function to destroy the new display list command
789 * \param print function to print the new display list command
790 * \return the new opcode number or -1 if error
793 _mesa_alloc_opcode(GLcontext
*ctx
,
795 void (*execute
) (GLcontext
*, void *),
796 void (*destroy
) (GLcontext
*, void *),
797 void (*print
) (GLcontext
*, void *))
799 if (ctx
->ListExt
.NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
800 const GLuint i
= ctx
->ListExt
.NumOpcodes
++;
801 ctx
->ListExt
.Opcode
[i
].Size
=
802 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
803 ctx
->ListExt
.Opcode
[i
].Execute
= execute
;
804 ctx
->ListExt
.Opcode
[i
].Destroy
= destroy
;
805 ctx
->ListExt
.Opcode
[i
].Print
= print
;
806 return i
+ OPCODE_EXT_0
;
814 * Allocate display list instruction. Returns Node ptr to where the opcode
816 * - nParams is the number of function parameters
817 * - return value a pointer to sizeof(Node) before the actual
820 #define ALLOC_INSTRUCTION(CTX, OPCODE, NPARAMS) \
821 ((Node *)_mesa_alloc_instruction(CTX, OPCODE, (NPARAMS)*sizeof(Node)) - 1)
826 * Display List compilation functions
828 static void GLAPIENTRY
829 save_Accum(GLenum op
, GLfloat value
)
831 GET_CURRENT_CONTEXT(ctx
);
833 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
834 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACCUM
, 2);
839 if (ctx
->ExecuteFlag
) {
840 CALL_Accum(ctx
->Exec
, (op
, value
));
845 static void GLAPIENTRY
846 save_AlphaFunc(GLenum func
, GLclampf ref
)
848 GET_CURRENT_CONTEXT(ctx
);
850 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
851 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ALPHA_FUNC
, 2);
854 n
[2].f
= (GLfloat
) ref
;
856 if (ctx
->ExecuteFlag
) {
857 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
862 static void GLAPIENTRY
863 save_BindTexture(GLenum target
, GLuint texture
)
865 GET_CURRENT_CONTEXT(ctx
);
867 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
868 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_TEXTURE
, 2);
873 if (ctx
->ExecuteFlag
) {
874 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
879 static void GLAPIENTRY
880 save_Bitmap(GLsizei width
, GLsizei height
,
881 GLfloat xorig
, GLfloat yorig
,
882 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
884 GET_CURRENT_CONTEXT(ctx
);
886 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
887 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BITMAP
, 7);
889 n
[1].i
= (GLint
) width
;
890 n
[2].i
= (GLint
) height
;
895 n
[7].data
= _mesa_unpack_bitmap(width
, height
, pixels
, &ctx
->Unpack
);
897 if (ctx
->ExecuteFlag
) {
898 CALL_Bitmap(ctx
->Exec
, (width
, height
,
899 xorig
, yorig
, xmove
, ymove
, pixels
));
904 static void GLAPIENTRY
905 save_BlendEquation(GLenum mode
)
907 GET_CURRENT_CONTEXT(ctx
);
909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
910 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_EQUATION
, 1);
914 if (ctx
->ExecuteFlag
) {
915 CALL_BlendEquation(ctx
->Exec
, (mode
));
920 static void GLAPIENTRY
921 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
923 GET_CURRENT_CONTEXT(ctx
);
925 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
926 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
931 if (ctx
->ExecuteFlag
) {
932 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
937 static void GLAPIENTRY
938 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
939 GLenum sfactorA
, GLenum dfactorA
)
941 GET_CURRENT_CONTEXT(ctx
);
943 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
944 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
951 if (ctx
->ExecuteFlag
) {
952 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
953 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
958 static void GLAPIENTRY
959 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
961 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
965 static void GLAPIENTRY
966 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
968 GET_CURRENT_CONTEXT(ctx
);
970 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
971 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_COLOR
, 4);
978 if (ctx
->ExecuteFlag
) {
979 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
983 static void invalidate_saved_current_state( GLcontext
*ctx
)
987 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
988 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
990 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
991 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
993 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
995 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
999 _mesa_save_CallList(GLuint list
)
1001 GET_CURRENT_CONTEXT(ctx
);
1003 SAVE_FLUSH_VERTICES(ctx
);
1005 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CALL_LIST
, 1);
1010 /* After this, we don't know what state we're in. Invalidate all
1011 * cached information previously gathered:
1013 invalidate_saved_current_state( ctx
);
1015 if (ctx
->ExecuteFlag
) {
1016 _mesa_CallList(list
);
1022 _mesa_save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1024 GET_CURRENT_CONTEXT(ctx
);
1026 GLboolean typeErrorFlag
;
1028 SAVE_FLUSH_VERTICES(ctx
);
1032 case GL_UNSIGNED_BYTE
:
1034 case GL_UNSIGNED_SHORT
:
1036 case GL_UNSIGNED_INT
:
1041 typeErrorFlag
= GL_FALSE
;
1044 typeErrorFlag
= GL_TRUE
;
1047 for (i
= 0; i
< num
; i
++) {
1048 GLint list
= translate_id(i
, type
, lists
);
1049 Node
*n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1052 n
[2].b
= typeErrorFlag
;
1056 /* After this, we don't know what state we're in. Invalidate all
1057 * cached information previously gathered:
1059 invalidate_saved_current_state( ctx
);
1061 if (ctx
->ExecuteFlag
) {
1062 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1067 static void GLAPIENTRY
1068 save_Clear(GLbitfield mask
)
1070 GET_CURRENT_CONTEXT(ctx
);
1072 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1073 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR
, 1);
1077 if (ctx
->ExecuteFlag
) {
1078 CALL_Clear(ctx
->Exec
, (mask
));
1083 static void GLAPIENTRY
1084 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1086 GET_CURRENT_CONTEXT(ctx
);
1088 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1089 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1096 if (ctx
->ExecuteFlag
) {
1097 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1102 static void GLAPIENTRY
1103 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1105 GET_CURRENT_CONTEXT(ctx
);
1107 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1108 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_COLOR
, 4);
1115 if (ctx
->ExecuteFlag
) {
1116 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1121 static void GLAPIENTRY
1122 save_ClearDepth(GLclampd depth
)
1124 GET_CURRENT_CONTEXT(ctx
);
1126 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1127 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1129 n
[1].f
= (GLfloat
) depth
;
1131 if (ctx
->ExecuteFlag
) {
1132 CALL_ClearDepth(ctx
->Exec
, (depth
));
1137 static void GLAPIENTRY
1138 save_ClearIndex(GLfloat c
)
1140 GET_CURRENT_CONTEXT(ctx
);
1142 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1143 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_INDEX
, 1);
1147 if (ctx
->ExecuteFlag
) {
1148 CALL_ClearIndex(ctx
->Exec
, (c
));
1153 static void GLAPIENTRY
1154 save_ClearStencil(GLint s
)
1156 GET_CURRENT_CONTEXT(ctx
);
1158 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1159 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1163 if (ctx
->ExecuteFlag
) {
1164 CALL_ClearStencil(ctx
->Exec
, (s
));
1169 static void GLAPIENTRY
1170 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1172 GET_CURRENT_CONTEXT(ctx
);
1174 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1175 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLIP_PLANE
, 5);
1178 n
[2].f
= (GLfloat
) equ
[0];
1179 n
[3].f
= (GLfloat
) equ
[1];
1180 n
[4].f
= (GLfloat
) equ
[2];
1181 n
[5].f
= (GLfloat
) equ
[3];
1183 if (ctx
->ExecuteFlag
) {
1184 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1190 static void GLAPIENTRY
1191 save_ColorMask(GLboolean red
, GLboolean green
,
1192 GLboolean blue
, GLboolean alpha
)
1194 GET_CURRENT_CONTEXT(ctx
);
1196 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1197 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_MASK
, 4);
1204 if (ctx
->ExecuteFlag
) {
1205 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1210 static void GLAPIENTRY
1211 save_ColorMaterial(GLenum face
, GLenum mode
)
1213 GET_CURRENT_CONTEXT(ctx
);
1215 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1217 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1222 if (ctx
->ExecuteFlag
) {
1223 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1228 static void GLAPIENTRY
1229 save_ColorTable(GLenum target
, GLenum internalFormat
,
1230 GLsizei width
, GLenum format
, GLenum type
,
1231 const GLvoid
* table
)
1233 GET_CURRENT_CONTEXT(ctx
);
1234 if (_mesa_is_proxy_texture(target
)) {
1235 /* execute immediately */
1236 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1237 format
, type
, table
));
1241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1242 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE
, 6);
1245 n
[2].e
= internalFormat
;
1249 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, table
,
1252 if (ctx
->ExecuteFlag
) {
1253 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1254 format
, type
, table
));
1261 static void GLAPIENTRY
1262 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1263 const GLfloat
*params
)
1265 GET_CURRENT_CONTEXT(ctx
);
1268 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1270 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1275 if (pname
== GL_COLOR_TABLE_SGI
||
1276 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1277 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1278 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1285 if (ctx
->ExecuteFlag
) {
1286 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1291 static void GLAPIENTRY
1292 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1294 GET_CURRENT_CONTEXT(ctx
);
1297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1299 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1304 if (pname
== GL_COLOR_TABLE_SGI
||
1305 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1306 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1307 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1314 if (ctx
->ExecuteFlag
) {
1315 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1321 static void GLAPIENTRY
1322 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1323 GLenum format
, GLenum type
, const GLvoid
* table
)
1325 GET_CURRENT_CONTEXT(ctx
);
1327 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1328 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1335 n
[6].data
= unpack_image(ctx
, 1, count
, 1, 1, format
, type
, table
,
1338 if (ctx
->ExecuteFlag
) {
1339 CALL_ColorSubTable(ctx
->Exec
,
1340 (target
, start
, count
, format
, type
, table
));
1345 static void GLAPIENTRY
1346 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1347 GLint x
, GLint y
, GLsizei width
)
1349 GET_CURRENT_CONTEXT(ctx
);
1352 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1353 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1361 if (ctx
->ExecuteFlag
) {
1362 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1367 static void GLAPIENTRY
1368 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1369 GLint x
, GLint y
, GLsizei width
)
1371 GET_CURRENT_CONTEXT(ctx
);
1374 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1375 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1378 n
[2].e
= internalformat
;
1383 if (ctx
->ExecuteFlag
) {
1384 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1389 static void GLAPIENTRY
1390 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1391 GLenum format
, GLenum type
, const GLvoid
* filter
)
1393 GET_CURRENT_CONTEXT(ctx
);
1396 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1398 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1401 n
[2].e
= internalFormat
;
1405 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, filter
,
1408 if (ctx
->ExecuteFlag
) {
1409 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1410 format
, type
, filter
));
1415 static void GLAPIENTRY
1416 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1417 GLsizei width
, GLsizei height
, GLenum format
,
1418 GLenum type
, const GLvoid
* filter
)
1420 GET_CURRENT_CONTEXT(ctx
);
1423 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1425 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1428 n
[2].e
= internalFormat
;
1433 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
, filter
,
1436 if (ctx
->ExecuteFlag
) {
1437 CALL_ConvolutionFilter2D(ctx
->Exec
,
1438 (target
, internalFormat
, width
, height
, format
,
1444 static void GLAPIENTRY
1445 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1447 GET_CURRENT_CONTEXT(ctx
);
1449 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1450 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1456 if (ctx
->ExecuteFlag
) {
1457 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1462 static void GLAPIENTRY
1463 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1465 GET_CURRENT_CONTEXT(ctx
);
1467 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1468 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1473 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1474 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1475 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1481 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1484 if (ctx
->ExecuteFlag
) {
1485 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1490 static void GLAPIENTRY
1491 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1493 GET_CURRENT_CONTEXT(ctx
);
1495 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1496 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
1502 if (ctx
->ExecuteFlag
) {
1503 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
1508 static void GLAPIENTRY
1509 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
1510 const GLfloat
*params
)
1512 GET_CURRENT_CONTEXT(ctx
);
1514 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1515 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
1520 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1521 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1522 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1528 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1531 if (ctx
->ExecuteFlag
) {
1532 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
1537 static void GLAPIENTRY
1538 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1540 GET_CURRENT_CONTEXT(ctx
);
1542 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1543 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_PIXELS
, 5);
1547 n
[3].i
= (GLint
) width
;
1548 n
[4].i
= (GLint
) height
;
1551 if (ctx
->ExecuteFlag
) {
1552 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1558 static void GLAPIENTRY
1559 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1560 GLint x
, GLint y
, GLsizei width
, GLint border
)
1562 GET_CURRENT_CONTEXT(ctx
);
1564 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1565 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1569 n
[3].e
= internalformat
;
1575 if (ctx
->ExecuteFlag
) {
1576 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1577 x
, y
, width
, border
));
1582 static void GLAPIENTRY
1583 save_CopyTexImage2D(GLenum target
, GLint level
,
1584 GLenum internalformat
,
1585 GLint x
, GLint y
, GLsizei width
,
1586 GLsizei height
, GLint border
)
1588 GET_CURRENT_CONTEXT(ctx
);
1590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1591 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1595 n
[3].e
= internalformat
;
1602 if (ctx
->ExecuteFlag
) {
1603 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1604 x
, y
, width
, height
, border
));
1610 static void GLAPIENTRY
1611 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1612 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1614 GET_CURRENT_CONTEXT(ctx
);
1616 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1617 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1626 if (ctx
->ExecuteFlag
) {
1627 CALL_CopyTexSubImage1D(ctx
->Exec
,
1628 (target
, level
, xoffset
, x
, y
, width
));
1633 static void GLAPIENTRY
1634 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1635 GLint xoffset
, GLint yoffset
,
1636 GLint x
, GLint y
, GLsizei width
, GLint height
)
1638 GET_CURRENT_CONTEXT(ctx
);
1640 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1641 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1652 if (ctx
->ExecuteFlag
) {
1653 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1654 x
, y
, width
, height
));
1659 static void GLAPIENTRY
1660 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1661 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1662 GLint x
, GLint y
, GLsizei width
, GLint height
)
1664 GET_CURRENT_CONTEXT(ctx
);
1666 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1667 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1679 if (ctx
->ExecuteFlag
) {
1680 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1681 xoffset
, yoffset
, zoffset
,
1682 x
, y
, width
, height
));
1687 static void GLAPIENTRY
1688 save_CullFace(GLenum mode
)
1690 GET_CURRENT_CONTEXT(ctx
);
1692 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1693 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CULL_FACE
, 1);
1697 if (ctx
->ExecuteFlag
) {
1698 CALL_CullFace(ctx
->Exec
, (mode
));
1703 static void GLAPIENTRY
1704 save_DepthFunc(GLenum func
)
1706 GET_CURRENT_CONTEXT(ctx
);
1708 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1709 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_FUNC
, 1);
1713 if (ctx
->ExecuteFlag
) {
1714 CALL_DepthFunc(ctx
->Exec
, (func
));
1719 static void GLAPIENTRY
1720 save_DepthMask(GLboolean mask
)
1722 GET_CURRENT_CONTEXT(ctx
);
1724 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1725 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_MASK
, 1);
1729 if (ctx
->ExecuteFlag
) {
1730 CALL_DepthMask(ctx
->Exec
, (mask
));
1735 static void GLAPIENTRY
1736 save_DepthRange(GLclampd nearval
, GLclampd farval
)
1738 GET_CURRENT_CONTEXT(ctx
);
1740 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1741 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_RANGE
, 2);
1743 n
[1].f
= (GLfloat
) nearval
;
1744 n
[2].f
= (GLfloat
) farval
;
1746 if (ctx
->ExecuteFlag
) {
1747 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
1752 static void GLAPIENTRY
1753 save_Disable(GLenum cap
)
1755 GET_CURRENT_CONTEXT(ctx
);
1757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1758 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DISABLE
, 1);
1762 if (ctx
->ExecuteFlag
) {
1763 CALL_Disable(ctx
->Exec
, (cap
));
1768 static void GLAPIENTRY
1769 save_DrawBuffer(GLenum mode
)
1771 GET_CURRENT_CONTEXT(ctx
);
1773 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1774 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFER
, 1);
1778 if (ctx
->ExecuteFlag
) {
1779 CALL_DrawBuffer(ctx
->Exec
, (mode
));
1784 static void GLAPIENTRY
1785 save_DrawPixels(GLsizei width
, GLsizei height
,
1786 GLenum format
, GLenum type
, const GLvoid
* pixels
)
1788 GET_CURRENT_CONTEXT(ctx
);
1791 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1793 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_PIXELS
, 5);
1799 n
[5].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
1800 pixels
, &ctx
->Unpack
);
1802 if (ctx
->ExecuteFlag
) {
1803 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
1809 static void GLAPIENTRY
1810 save_Enable(GLenum cap
)
1812 GET_CURRENT_CONTEXT(ctx
);
1814 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1815 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ENABLE
, 1);
1819 if (ctx
->ExecuteFlag
) {
1820 CALL_Enable(ctx
->Exec
, (cap
));
1826 static void GLAPIENTRY
1827 _mesa_save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
1829 GET_CURRENT_CONTEXT(ctx
);
1831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1832 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVALMESH1
, 3);
1838 if (ctx
->ExecuteFlag
) {
1839 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
1844 static void GLAPIENTRY
1845 _mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1847 GET_CURRENT_CONTEXT(ctx
);
1849 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1850 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVALMESH2
, 5);
1858 if (ctx
->ExecuteFlag
) {
1859 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
1866 static void GLAPIENTRY
1867 save_Fogfv(GLenum pname
, const GLfloat
*params
)
1869 GET_CURRENT_CONTEXT(ctx
);
1871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1872 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FOG
, 5);
1880 if (ctx
->ExecuteFlag
) {
1881 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
1886 static void GLAPIENTRY
1887 save_Fogf(GLenum pname
, GLfloat param
)
1891 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
1892 save_Fogfv(pname
, parray
);
1896 static void GLAPIENTRY
1897 save_Fogiv(GLenum pname
, const GLint
*params
)
1902 case GL_FOG_DENSITY
:
1906 p
[0] = (GLfloat
) *params
;
1909 p
[0] = INT_TO_FLOAT(params
[0]);
1910 p
[1] = INT_TO_FLOAT(params
[1]);
1911 p
[2] = INT_TO_FLOAT(params
[2]);
1912 p
[3] = INT_TO_FLOAT(params
[3]);
1915 /* Error will be caught later in gl_Fogfv */
1916 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
1918 save_Fogfv(pname
, p
);
1922 static void GLAPIENTRY
1923 save_Fogi(GLenum pname
, GLint param
)
1927 parray
[1] = parray
[2] = parray
[3] = 0;
1928 save_Fogiv(pname
, parray
);
1932 static void GLAPIENTRY
1933 save_FrontFace(GLenum mode
)
1935 GET_CURRENT_CONTEXT(ctx
);
1937 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1938 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FRONT_FACE
, 1);
1942 if (ctx
->ExecuteFlag
) {
1943 CALL_FrontFace(ctx
->Exec
, (mode
));
1948 static void GLAPIENTRY
1949 save_Frustum(GLdouble left
, GLdouble right
,
1950 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
1952 GET_CURRENT_CONTEXT(ctx
);
1954 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1955 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FRUSTUM
, 6);
1957 n
[1].f
= (GLfloat
) left
;
1958 n
[2].f
= (GLfloat
) right
;
1959 n
[3].f
= (GLfloat
) bottom
;
1960 n
[4].f
= (GLfloat
) top
;
1961 n
[5].f
= (GLfloat
) nearval
;
1962 n
[6].f
= (GLfloat
) farval
;
1964 if (ctx
->ExecuteFlag
) {
1965 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
1970 static void GLAPIENTRY
1971 save_Hint(GLenum target
, GLenum mode
)
1973 GET_CURRENT_CONTEXT(ctx
);
1975 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1976 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_HINT
, 2);
1981 if (ctx
->ExecuteFlag
) {
1982 CALL_Hint(ctx
->Exec
, (target
, mode
));
1987 static void GLAPIENTRY
1988 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
1991 GET_CURRENT_CONTEXT(ctx
);
1994 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1995 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_HISTOGRAM
, 4);
1999 n
[3].e
= internalFormat
;
2002 if (ctx
->ExecuteFlag
) {
2003 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
2008 static void GLAPIENTRY
2009 save_IndexMask(GLuint mask
)
2011 GET_CURRENT_CONTEXT(ctx
);
2013 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2014 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_INDEX_MASK
, 1);
2018 if (ctx
->ExecuteFlag
) {
2019 CALL_IndexMask(ctx
->Exec
, (mask
));
2024 static void GLAPIENTRY
2025 save_InitNames(void)
2027 GET_CURRENT_CONTEXT(ctx
);
2028 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2029 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_INIT_NAMES
, 0);
2030 if (ctx
->ExecuteFlag
) {
2031 CALL_InitNames(ctx
->Exec
, ());
2036 static void GLAPIENTRY
2037 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2039 GET_CURRENT_CONTEXT(ctx
);
2041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2042 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIGHT
, 6);
2060 case GL_SPOT_DIRECTION
:
2063 case GL_SPOT_EXPONENT
:
2066 case GL_SPOT_CUTOFF
:
2069 case GL_CONSTANT_ATTENUATION
:
2072 case GL_LINEAR_ATTENUATION
:
2075 case GL_QUADRATIC_ATTENUATION
:
2081 for (i
= 0; i
< nParams
; i
++) {
2082 n
[3 + i
].f
= params
[i
];
2085 if (ctx
->ExecuteFlag
) {
2086 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2091 static void GLAPIENTRY
2092 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2096 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2097 save_Lightfv(light
, pname
, parray
);
2101 static void GLAPIENTRY
2102 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2109 fparam
[0] = INT_TO_FLOAT(params
[0]);
2110 fparam
[1] = INT_TO_FLOAT(params
[1]);
2111 fparam
[2] = INT_TO_FLOAT(params
[2]);
2112 fparam
[3] = INT_TO_FLOAT(params
[3]);
2115 fparam
[0] = (GLfloat
) params
[0];
2116 fparam
[1] = (GLfloat
) params
[1];
2117 fparam
[2] = (GLfloat
) params
[2];
2118 fparam
[3] = (GLfloat
) params
[3];
2120 case GL_SPOT_DIRECTION
:
2121 fparam
[0] = (GLfloat
) params
[0];
2122 fparam
[1] = (GLfloat
) params
[1];
2123 fparam
[2] = (GLfloat
) params
[2];
2125 case GL_SPOT_EXPONENT
:
2126 case GL_SPOT_CUTOFF
:
2127 case GL_CONSTANT_ATTENUATION
:
2128 case GL_LINEAR_ATTENUATION
:
2129 case GL_QUADRATIC_ATTENUATION
:
2130 fparam
[0] = (GLfloat
) params
[0];
2133 /* error will be caught later in gl_Lightfv */
2136 save_Lightfv(light
, pname
, fparam
);
2140 static void GLAPIENTRY
2141 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2145 parray
[1] = parray
[2] = parray
[3] = 0;
2146 save_Lightiv(light
, pname
, parray
);
2150 static void GLAPIENTRY
2151 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2153 GET_CURRENT_CONTEXT(ctx
);
2155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2156 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIGHT_MODEL
, 5);
2164 if (ctx
->ExecuteFlag
) {
2165 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2170 static void GLAPIENTRY
2171 save_LightModelf(GLenum pname
, GLfloat param
)
2175 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2176 save_LightModelfv(pname
, parray
);
2180 static void GLAPIENTRY
2181 save_LightModeliv(GLenum pname
, const GLint
*params
)
2185 case GL_LIGHT_MODEL_AMBIENT
:
2186 fparam
[0] = INT_TO_FLOAT(params
[0]);
2187 fparam
[1] = INT_TO_FLOAT(params
[1]);
2188 fparam
[2] = INT_TO_FLOAT(params
[2]);
2189 fparam
[3] = INT_TO_FLOAT(params
[3]);
2191 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2192 case GL_LIGHT_MODEL_TWO_SIDE
:
2193 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2194 fparam
[0] = (GLfloat
) params
[0];
2197 /* Error will be caught later in gl_LightModelfv */
2198 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2200 save_LightModelfv(pname
, fparam
);
2204 static void GLAPIENTRY
2205 save_LightModeli(GLenum pname
, GLint param
)
2209 parray
[1] = parray
[2] = parray
[3] = 0;
2210 save_LightModeliv(pname
, parray
);
2214 static void GLAPIENTRY
2215 save_LineStipple(GLint factor
, GLushort pattern
)
2217 GET_CURRENT_CONTEXT(ctx
);
2219 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2220 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LINE_STIPPLE
, 2);
2225 if (ctx
->ExecuteFlag
) {
2226 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2231 static void GLAPIENTRY
2232 save_LineWidth(GLfloat width
)
2234 GET_CURRENT_CONTEXT(ctx
);
2236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2237 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LINE_WIDTH
, 1);
2241 if (ctx
->ExecuteFlag
) {
2242 CALL_LineWidth(ctx
->Exec
, (width
));
2247 static void GLAPIENTRY
2248 save_ListBase(GLuint base
)
2250 GET_CURRENT_CONTEXT(ctx
);
2252 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2253 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIST_BASE
, 1);
2257 if (ctx
->ExecuteFlag
) {
2258 CALL_ListBase(ctx
->Exec
, (base
));
2263 static void GLAPIENTRY
2264 save_LoadIdentity(void)
2266 GET_CURRENT_CONTEXT(ctx
);
2267 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2268 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2269 if (ctx
->ExecuteFlag
) {
2270 CALL_LoadIdentity(ctx
->Exec
, ());
2275 static void GLAPIENTRY
2276 save_LoadMatrixf(const GLfloat
* m
)
2278 GET_CURRENT_CONTEXT(ctx
);
2280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2281 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_MATRIX
, 16);
2284 for (i
= 0; i
< 16; i
++) {
2288 if (ctx
->ExecuteFlag
) {
2289 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2294 static void GLAPIENTRY
2295 save_LoadMatrixd(const GLdouble
* m
)
2299 for (i
= 0; i
< 16; i
++) {
2300 f
[i
] = (GLfloat
) m
[i
];
2302 save_LoadMatrixf(f
);
2306 static void GLAPIENTRY
2307 save_LoadName(GLuint name
)
2309 GET_CURRENT_CONTEXT(ctx
);
2311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2312 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_NAME
, 1);
2316 if (ctx
->ExecuteFlag
) {
2317 CALL_LoadName(ctx
->Exec
, (name
));
2322 static void GLAPIENTRY
2323 save_LogicOp(GLenum opcode
)
2325 GET_CURRENT_CONTEXT(ctx
);
2327 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2328 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOGIC_OP
, 1);
2332 if (ctx
->ExecuteFlag
) {
2333 CALL_LogicOp(ctx
->Exec
, (opcode
));
2338 static void GLAPIENTRY
2339 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2340 GLint order
, const GLdouble
* points
)
2342 GET_CURRENT_CONTEXT(ctx
);
2344 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2345 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP1
, 6);
2347 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2349 n
[2].f
= (GLfloat
) u1
;
2350 n
[3].f
= (GLfloat
) u2
;
2351 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2353 n
[6].data
= (void *) pnts
;
2355 if (ctx
->ExecuteFlag
) {
2356 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2360 static void GLAPIENTRY
2361 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2362 GLint order
, const GLfloat
* points
)
2364 GET_CURRENT_CONTEXT(ctx
);
2366 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2367 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP1
, 6);
2369 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2373 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2375 n
[6].data
= (void *) pnts
;
2377 if (ctx
->ExecuteFlag
) {
2378 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2383 static void GLAPIENTRY
2384 save_Map2d(GLenum target
,
2385 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2386 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2387 const GLdouble
* points
)
2389 GET_CURRENT_CONTEXT(ctx
);
2391 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2392 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP2
, 10);
2394 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2395 vstride
, vorder
, points
);
2397 n
[2].f
= (GLfloat
) u1
;
2398 n
[3].f
= (GLfloat
) u2
;
2399 n
[4].f
= (GLfloat
) v1
;
2400 n
[5].f
= (GLfloat
) v2
;
2401 /* XXX verify these strides are correct */
2402 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2403 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2406 n
[10].data
= (void *) pnts
;
2408 if (ctx
->ExecuteFlag
) {
2409 CALL_Map2d(ctx
->Exec
, (target
,
2410 u1
, u2
, ustride
, uorder
,
2411 v1
, v2
, vstride
, vorder
, points
));
2416 static void GLAPIENTRY
2417 save_Map2f(GLenum target
,
2418 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2419 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2420 const GLfloat
* points
)
2422 GET_CURRENT_CONTEXT(ctx
);
2424 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2425 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP2
, 10);
2427 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2428 vstride
, vorder
, points
);
2434 /* XXX verify these strides are correct */
2435 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2436 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2439 n
[10].data
= (void *) pnts
;
2441 if (ctx
->ExecuteFlag
) {
2442 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2443 v1
, v2
, vstride
, vorder
, points
));
2448 static void GLAPIENTRY
2449 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2451 GET_CURRENT_CONTEXT(ctx
);
2453 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2454 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAPGRID1
, 3);
2460 if (ctx
->ExecuteFlag
) {
2461 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2466 static void GLAPIENTRY
2467 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2469 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2473 static void GLAPIENTRY
2474 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2475 GLint vn
, GLfloat v1
, GLfloat v2
)
2477 GET_CURRENT_CONTEXT(ctx
);
2479 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2480 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAPGRID2
, 6);
2489 if (ctx
->ExecuteFlag
) {
2490 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2496 static void GLAPIENTRY
2497 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2498 GLint vn
, GLdouble v1
, GLdouble v2
)
2500 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2501 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2505 static void GLAPIENTRY
2506 save_MatrixMode(GLenum mode
)
2508 GET_CURRENT_CONTEXT(ctx
);
2510 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2511 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATRIX_MODE
, 1);
2515 if (ctx
->ExecuteFlag
) {
2516 CALL_MatrixMode(ctx
->Exec
, (mode
));
2521 static void GLAPIENTRY
2522 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2524 GET_CURRENT_CONTEXT(ctx
);
2527 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2528 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MIN_MAX
, 3);
2531 n
[2].e
= internalFormat
;
2534 if (ctx
->ExecuteFlag
) {
2535 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
2540 static void GLAPIENTRY
2541 save_MultMatrixf(const GLfloat
* m
)
2543 GET_CURRENT_CONTEXT(ctx
);
2545 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2546 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MULT_MATRIX
, 16);
2549 for (i
= 0; i
< 16; i
++) {
2553 if (ctx
->ExecuteFlag
) {
2554 CALL_MultMatrixf(ctx
->Exec
, (m
));
2559 static void GLAPIENTRY
2560 save_MultMatrixd(const GLdouble
* m
)
2564 for (i
= 0; i
< 16; i
++) {
2565 f
[i
] = (GLfloat
) m
[i
];
2567 save_MultMatrixf(f
);
2571 static void GLAPIENTRY
2572 save_NewList(GLuint name
, GLenum mode
)
2574 GET_CURRENT_CONTEXT(ctx
);
2575 /* It's an error to call this function while building a display list */
2576 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2583 static void GLAPIENTRY
2584 save_Ortho(GLdouble left
, GLdouble right
,
2585 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2587 GET_CURRENT_CONTEXT(ctx
);
2589 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2590 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ORTHO
, 6);
2592 n
[1].f
= (GLfloat
) left
;
2593 n
[2].f
= (GLfloat
) right
;
2594 n
[3].f
= (GLfloat
) bottom
;
2595 n
[4].f
= (GLfloat
) top
;
2596 n
[5].f
= (GLfloat
) nearval
;
2597 n
[6].f
= (GLfloat
) farval
;
2599 if (ctx
->ExecuteFlag
) {
2600 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2605 static void GLAPIENTRY
2606 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2608 GET_CURRENT_CONTEXT(ctx
);
2610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2611 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_MAP
, 3);
2615 n
[3].data
= (void *) _mesa_malloc(mapsize
* sizeof(GLfloat
));
2616 MEMCPY(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
2618 if (ctx
->ExecuteFlag
) {
2619 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2624 static void GLAPIENTRY
2625 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2627 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2629 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2630 for (i
= 0; i
< mapsize
; i
++) {
2631 fvalues
[i
] = (GLfloat
) values
[i
];
2635 for (i
= 0; i
< mapsize
; i
++) {
2636 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2639 save_PixelMapfv(map
, mapsize
, fvalues
);
2643 static void GLAPIENTRY
2644 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2646 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2648 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2649 for (i
= 0; i
< mapsize
; i
++) {
2650 fvalues
[i
] = (GLfloat
) values
[i
];
2654 for (i
= 0; i
< mapsize
; i
++) {
2655 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
2658 save_PixelMapfv(map
, mapsize
, fvalues
);
2662 static void GLAPIENTRY
2663 save_PixelTransferf(GLenum pname
, GLfloat param
)
2665 GET_CURRENT_CONTEXT(ctx
);
2667 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2668 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2673 if (ctx
->ExecuteFlag
) {
2674 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
2679 static void GLAPIENTRY
2680 save_PixelTransferi(GLenum pname
, GLint param
)
2682 save_PixelTransferf(pname
, (GLfloat
) param
);
2686 static void GLAPIENTRY
2687 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
2689 GET_CURRENT_CONTEXT(ctx
);
2691 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2692 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_ZOOM
, 2);
2697 if (ctx
->ExecuteFlag
) {
2698 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
2703 static void GLAPIENTRY
2704 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
2706 GET_CURRENT_CONTEXT(ctx
);
2708 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2709 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POINT_PARAMETERS
, 4);
2716 if (ctx
->ExecuteFlag
) {
2717 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
2722 static void GLAPIENTRY
2723 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
2727 parray
[1] = parray
[2] = 0.0F
;
2728 save_PointParameterfvEXT(pname
, parray
);
2731 static void GLAPIENTRY
2732 save_PointParameteriNV(GLenum pname
, GLint param
)
2735 parray
[0] = (GLfloat
) param
;
2736 parray
[1] = parray
[2] = 0.0F
;
2737 save_PointParameterfvEXT(pname
, parray
);
2740 static void GLAPIENTRY
2741 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
2744 parray
[0] = (GLfloat
) param
[0];
2745 parray
[1] = parray
[2] = 0.0F
;
2746 save_PointParameterfvEXT(pname
, parray
);
2750 static void GLAPIENTRY
2751 save_PointSize(GLfloat size
)
2753 GET_CURRENT_CONTEXT(ctx
);
2755 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2756 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POINT_SIZE
, 1);
2760 if (ctx
->ExecuteFlag
) {
2761 CALL_PointSize(ctx
->Exec
, (size
));
2766 static void GLAPIENTRY
2767 save_PolygonMode(GLenum face
, GLenum mode
)
2769 GET_CURRENT_CONTEXT(ctx
);
2771 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2772 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_MODE
, 2);
2777 if (ctx
->ExecuteFlag
) {
2778 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
2783 static void GLAPIENTRY
2784 save_PolygonStipple(const GLubyte
* pattern
)
2786 GET_CURRENT_CONTEXT(ctx
);
2789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2791 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
2793 n
[1].data
= unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
2794 pattern
, &ctx
->Unpack
);
2796 if (ctx
->ExecuteFlag
) {
2797 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
2802 static void GLAPIENTRY
2803 save_PolygonOffset(GLfloat factor
, GLfloat units
)
2805 GET_CURRENT_CONTEXT(ctx
);
2807 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2808 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_OFFSET
, 2);
2813 if (ctx
->ExecuteFlag
) {
2814 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
2819 static void GLAPIENTRY
2820 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
2822 GET_CURRENT_CONTEXT(ctx
);
2823 /* XXX mult by DepthMaxF here??? */
2824 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
2828 static void GLAPIENTRY
2829 save_PopAttrib(void)
2831 GET_CURRENT_CONTEXT(ctx
);
2832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2833 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_ATTRIB
, 0);
2834 if (ctx
->ExecuteFlag
) {
2835 CALL_PopAttrib(ctx
->Exec
, ());
2840 static void GLAPIENTRY
2841 save_PopMatrix(void)
2843 GET_CURRENT_CONTEXT(ctx
);
2844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2845 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_MATRIX
, 0);
2846 if (ctx
->ExecuteFlag
) {
2847 CALL_PopMatrix(ctx
->Exec
, ());
2852 static void GLAPIENTRY
2855 GET_CURRENT_CONTEXT(ctx
);
2856 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2857 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_NAME
, 0);
2858 if (ctx
->ExecuteFlag
) {
2859 CALL_PopName(ctx
->Exec
, ());
2864 static void GLAPIENTRY
2865 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
2866 const GLclampf
* priorities
)
2868 GET_CURRENT_CONTEXT(ctx
);
2870 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2872 for (i
= 0; i
< num
; i
++) {
2874 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
2876 n
[1].ui
= textures
[i
];
2877 n
[2].f
= priorities
[i
];
2880 if (ctx
->ExecuteFlag
) {
2881 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
2886 static void GLAPIENTRY
2887 save_PushAttrib(GLbitfield mask
)
2889 GET_CURRENT_CONTEXT(ctx
);
2891 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2892 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_ATTRIB
, 1);
2896 if (ctx
->ExecuteFlag
) {
2897 CALL_PushAttrib(ctx
->Exec
, (mask
));
2902 static void GLAPIENTRY
2903 save_PushMatrix(void)
2905 GET_CURRENT_CONTEXT(ctx
);
2906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2907 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_MATRIX
, 0);
2908 if (ctx
->ExecuteFlag
) {
2909 CALL_PushMatrix(ctx
->Exec
, ());
2914 static void GLAPIENTRY
2915 save_PushName(GLuint name
)
2917 GET_CURRENT_CONTEXT(ctx
);
2919 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2920 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_NAME
, 1);
2924 if (ctx
->ExecuteFlag
) {
2925 CALL_PushName(ctx
->Exec
, (name
));
2930 static void GLAPIENTRY
2931 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2933 GET_CURRENT_CONTEXT(ctx
);
2935 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2936 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RASTER_POS
, 4);
2943 if (ctx
->ExecuteFlag
) {
2944 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
2948 static void GLAPIENTRY
2949 save_RasterPos2d(GLdouble x
, GLdouble y
)
2951 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2954 static void GLAPIENTRY
2955 save_RasterPos2f(GLfloat x
, GLfloat y
)
2957 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2960 static void GLAPIENTRY
2961 save_RasterPos2i(GLint x
, GLint y
)
2963 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2966 static void GLAPIENTRY
2967 save_RasterPos2s(GLshort x
, GLshort y
)
2969 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2972 static void GLAPIENTRY
2973 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2975 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2978 static void GLAPIENTRY
2979 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2981 save_RasterPos4f(x
, y
, z
, 1.0F
);
2984 static void GLAPIENTRY
2985 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2987 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2990 static void GLAPIENTRY
2991 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2993 save_RasterPos4f(x
, y
, z
, 1.0F
);
2996 static void GLAPIENTRY
2997 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2999 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3002 static void GLAPIENTRY
3003 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3005 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3008 static void GLAPIENTRY
3009 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3011 save_RasterPos4f(x
, y
, z
, w
);
3014 static void GLAPIENTRY
3015 save_RasterPos2dv(const GLdouble
* v
)
3017 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3020 static void GLAPIENTRY
3021 save_RasterPos2fv(const GLfloat
* v
)
3023 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3026 static void GLAPIENTRY
3027 save_RasterPos2iv(const GLint
* v
)
3029 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3032 static void GLAPIENTRY
3033 save_RasterPos2sv(const GLshort
* v
)
3035 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3038 static void GLAPIENTRY
3039 save_RasterPos3dv(const GLdouble
* v
)
3041 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3044 static void GLAPIENTRY
3045 save_RasterPos3fv(const GLfloat
* v
)
3047 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3050 static void GLAPIENTRY
3051 save_RasterPos3iv(const GLint
* v
)
3053 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3056 static void GLAPIENTRY
3057 save_RasterPos3sv(const GLshort
* v
)
3059 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3062 static void GLAPIENTRY
3063 save_RasterPos4dv(const GLdouble
* v
)
3065 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3066 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3069 static void GLAPIENTRY
3070 save_RasterPos4fv(const GLfloat
* v
)
3072 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3075 static void GLAPIENTRY
3076 save_RasterPos4iv(const GLint
* v
)
3078 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3079 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3082 static void GLAPIENTRY
3083 save_RasterPos4sv(const GLshort
* v
)
3085 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3089 static void GLAPIENTRY
3090 save_PassThrough(GLfloat token
)
3092 GET_CURRENT_CONTEXT(ctx
);
3094 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3095 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PASSTHROUGH
, 1);
3099 if (ctx
->ExecuteFlag
) {
3100 CALL_PassThrough(ctx
->Exec
, (token
));
3105 static void GLAPIENTRY
3106 save_ReadBuffer(GLenum mode
)
3108 GET_CURRENT_CONTEXT(ctx
);
3110 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3111 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_READ_BUFFER
, 1);
3115 if (ctx
->ExecuteFlag
) {
3116 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3121 static void GLAPIENTRY
3122 save_ResetHistogram(GLenum target
)
3124 GET_CURRENT_CONTEXT(ctx
);
3126 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3127 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3131 if (ctx
->ExecuteFlag
) {
3132 CALL_ResetHistogram(ctx
->Exec
, (target
));
3137 static void GLAPIENTRY
3138 save_ResetMinmax(GLenum target
)
3140 GET_CURRENT_CONTEXT(ctx
);
3142 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3143 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3147 if (ctx
->ExecuteFlag
) {
3148 CALL_ResetMinmax(ctx
->Exec
, (target
));
3153 static void GLAPIENTRY
3154 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3156 GET_CURRENT_CONTEXT(ctx
);
3158 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3159 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ROTATE
, 4);
3166 if (ctx
->ExecuteFlag
) {
3167 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3172 static void GLAPIENTRY
3173 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3175 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3179 static void GLAPIENTRY
3180 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3182 GET_CURRENT_CONTEXT(ctx
);
3184 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3185 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCALE
, 3);
3191 if (ctx
->ExecuteFlag
) {
3192 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3197 static void GLAPIENTRY
3198 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3200 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3204 static void GLAPIENTRY
3205 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3207 GET_CURRENT_CONTEXT(ctx
);
3209 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3210 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCISSOR
, 4);
3217 if (ctx
->ExecuteFlag
) {
3218 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3223 static void GLAPIENTRY
3224 save_ShadeModel(GLenum mode
)
3226 GET_CURRENT_CONTEXT(ctx
);
3228 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3230 if (ctx
->ExecuteFlag
) {
3231 CALL_ShadeModel(ctx
->Exec
, (mode
));
3234 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3237 SAVE_FLUSH_VERTICES(ctx
);
3239 /* Only save the value if we know the statechange will take effect:
3241 if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
)
3242 ctx
->ListState
.Current
.ShadeModel
= mode
;
3244 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SHADE_MODEL
, 1);
3251 static void GLAPIENTRY
3252 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3254 GET_CURRENT_CONTEXT(ctx
);
3256 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3257 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC
, 3);
3263 if (ctx
->ExecuteFlag
) {
3264 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3269 static void GLAPIENTRY
3270 save_StencilMask(GLuint mask
)
3272 GET_CURRENT_CONTEXT(ctx
);
3274 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3275 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK
, 1);
3279 if (ctx
->ExecuteFlag
) {
3280 CALL_StencilMask(ctx
->Exec
, (mask
));
3285 static void GLAPIENTRY
3286 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3288 GET_CURRENT_CONTEXT(ctx
);
3290 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3291 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP
, 3);
3297 if (ctx
->ExecuteFlag
) {
3298 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3303 static void GLAPIENTRY
3304 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3306 GET_CURRENT_CONTEXT(ctx
);
3308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3309 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3316 if (ctx
->ExecuteFlag
) {
3317 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3322 static void GLAPIENTRY
3323 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3326 GET_CURRENT_CONTEXT(ctx
);
3328 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3330 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3338 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3345 if (ctx
->ExecuteFlag
) {
3346 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3347 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3352 static void GLAPIENTRY
3353 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3355 GET_CURRENT_CONTEXT(ctx
);
3357 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3358 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3363 if (ctx
->ExecuteFlag
) {
3364 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3369 static void GLAPIENTRY
3370 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3372 GET_CURRENT_CONTEXT(ctx
);
3374 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3375 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3382 if (ctx
->ExecuteFlag
) {
3383 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3388 static void GLAPIENTRY
3389 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3391 GET_CURRENT_CONTEXT(ctx
);
3393 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3394 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXENV
, 6);
3398 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3406 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3409 if (ctx
->ExecuteFlag
) {
3410 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3415 static void GLAPIENTRY
3416 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3419 parray
[0] = (GLfloat
) param
;
3420 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3421 save_TexEnvfv(target
, pname
, parray
);
3425 static void GLAPIENTRY
3426 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3429 p
[0] = (GLfloat
) param
;
3430 p
[1] = p
[2] = p
[3] = 0.0;
3431 save_TexEnvfv(target
, pname
, p
);
3435 static void GLAPIENTRY
3436 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3439 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3440 p
[0] = INT_TO_FLOAT(param
[0]);
3441 p
[1] = INT_TO_FLOAT(param
[1]);
3442 p
[2] = INT_TO_FLOAT(param
[2]);
3443 p
[3] = INT_TO_FLOAT(param
[3]);
3446 p
[0] = (GLfloat
) param
[0];
3447 p
[1] = p
[2] = p
[3] = 0.0F
;
3449 save_TexEnvfv(target
, pname
, p
);
3453 static void GLAPIENTRY
3454 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3456 GET_CURRENT_CONTEXT(ctx
);
3458 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3459 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXGEN
, 6);
3468 if (ctx
->ExecuteFlag
) {
3469 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3474 static void GLAPIENTRY
3475 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3478 p
[0] = (GLfloat
) params
[0];
3479 p
[1] = (GLfloat
) params
[1];
3480 p
[2] = (GLfloat
) params
[2];
3481 p
[3] = (GLfloat
) params
[3];
3482 save_TexGenfv(coord
, pname
, p
);
3486 static void GLAPIENTRY
3487 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3490 parray
[0] = (GLfloat
) param
;
3491 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3492 save_TexGenfv(coord
, pname
, parray
);
3496 static void GLAPIENTRY
3497 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3500 p
[0] = (GLfloat
) params
[0];
3501 p
[1] = (GLfloat
) params
[1];
3502 p
[2] = (GLfloat
) params
[2];
3503 p
[3] = (GLfloat
) params
[3];
3504 save_TexGenfv(coord
, pname
, p
);
3508 static void GLAPIENTRY
3509 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3513 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3514 save_TexGenfv(coord
, pname
, parray
);
3518 static void GLAPIENTRY
3519 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3523 parray
[1] = parray
[2] = parray
[3] = 0;
3524 save_TexGeniv(coord
, pname
, parray
);
3528 static void GLAPIENTRY
3529 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3531 GET_CURRENT_CONTEXT(ctx
);
3533 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3534 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXPARAMETER
, 6);
3543 if (ctx
->ExecuteFlag
) {
3544 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3549 static void GLAPIENTRY
3550 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3554 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3555 save_TexParameterfv(target
, pname
, parray
);
3559 static void GLAPIENTRY
3560 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3563 fparam
[0] = (GLfloat
) param
;
3564 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3565 save_TexParameterfv(target
, pname
, fparam
);
3569 static void GLAPIENTRY
3570 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3573 fparam
[0] = (GLfloat
) params
[0];
3574 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3575 save_TexParameterfv(target
, pname
, fparam
);
3579 static void GLAPIENTRY
3580 save_TexImage1D(GLenum target
,
3581 GLint level
, GLint components
,
3582 GLsizei width
, GLint border
,
3583 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3585 GET_CURRENT_CONTEXT(ctx
);
3586 if (target
== GL_PROXY_TEXTURE_1D
) {
3587 /* don't compile, execute immediately */
3588 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3589 border
, format
, type
, pixels
));
3593 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3594 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE1D
, 8);
3598 n
[3].i
= components
;
3599 n
[4].i
= (GLint
) width
;
3603 n
[8].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3604 pixels
, &ctx
->Unpack
);
3606 if (ctx
->ExecuteFlag
) {
3607 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3608 border
, format
, type
, pixels
));
3614 static void GLAPIENTRY
3615 save_TexImage2D(GLenum target
,
3616 GLint level
, GLint components
,
3617 GLsizei width
, GLsizei height
, GLint border
,
3618 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3620 GET_CURRENT_CONTEXT(ctx
);
3621 if (target
== GL_PROXY_TEXTURE_2D
) {
3622 /* don't compile, execute immediately */
3623 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3624 height
, border
, format
, type
, pixels
));
3628 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3629 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE2D
, 9);
3633 n
[3].i
= components
;
3634 n
[4].i
= (GLint
) width
;
3635 n
[5].i
= (GLint
) height
;
3639 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
3640 pixels
, &ctx
->Unpack
);
3642 if (ctx
->ExecuteFlag
) {
3643 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3644 height
, border
, format
, type
, pixels
));
3650 static void GLAPIENTRY
3651 save_TexImage3D(GLenum target
,
3652 GLint level
, GLint internalFormat
,
3653 GLsizei width
, GLsizei height
, GLsizei depth
,
3655 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3657 GET_CURRENT_CONTEXT(ctx
);
3658 if (target
== GL_PROXY_TEXTURE_3D
) {
3659 /* don't compile, execute immediately */
3660 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3661 height
, depth
, border
, format
, type
,
3666 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3667 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE3D
, 10);
3671 n
[3].i
= (GLint
) internalFormat
;
3672 n
[4].i
= (GLint
) width
;
3673 n
[5].i
= (GLint
) height
;
3674 n
[6].i
= (GLint
) depth
;
3678 n
[10].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
3679 pixels
, &ctx
->Unpack
);
3681 if (ctx
->ExecuteFlag
) {
3682 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3683 height
, depth
, border
, format
, type
,
3690 static void GLAPIENTRY
3691 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
3692 GLsizei width
, GLenum format
, GLenum type
,
3693 const GLvoid
* pixels
)
3695 GET_CURRENT_CONTEXT(ctx
);
3698 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3700 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
3705 n
[4].i
= (GLint
) width
;
3708 n
[7].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3709 pixels
, &ctx
->Unpack
);
3711 if (ctx
->ExecuteFlag
) {
3712 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
3713 format
, type
, pixels
));
3718 static void GLAPIENTRY
3719 save_TexSubImage2D(GLenum target
, GLint level
,
3720 GLint xoffset
, GLint yoffset
,
3721 GLsizei width
, GLsizei height
,
3722 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3724 GET_CURRENT_CONTEXT(ctx
);
3727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3729 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
3735 n
[5].i
= (GLint
) width
;
3736 n
[6].i
= (GLint
) height
;
3739 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
3740 pixels
, &ctx
->Unpack
);
3742 if (ctx
->ExecuteFlag
) {
3743 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
3744 width
, height
, format
, type
, pixels
));
3749 static void GLAPIENTRY
3750 save_TexSubImage3D(GLenum target
, GLint level
,
3751 GLint xoffset
, GLint yoffset
, GLint zoffset
,
3752 GLsizei width
, GLsizei height
, GLsizei depth
,
3753 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3755 GET_CURRENT_CONTEXT(ctx
);
3758 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3760 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
3767 n
[6].i
= (GLint
) width
;
3768 n
[7].i
= (GLint
) height
;
3769 n
[8].i
= (GLint
) depth
;
3772 n
[11].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
3773 pixels
, &ctx
->Unpack
);
3775 if (ctx
->ExecuteFlag
) {
3776 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
3777 xoffset
, yoffset
, zoffset
,
3778 width
, height
, depth
, format
, type
,
3784 static void GLAPIENTRY
3785 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
3787 GET_CURRENT_CONTEXT(ctx
);
3789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3790 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRANSLATE
, 3);
3796 if (ctx
->ExecuteFlag
) {
3797 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
3802 static void GLAPIENTRY
3803 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
3805 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3810 static void GLAPIENTRY
3811 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3813 GET_CURRENT_CONTEXT(ctx
);
3815 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3816 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_VIEWPORT
, 4);
3820 n
[3].i
= (GLint
) width
;
3821 n
[4].i
= (GLint
) height
;
3823 if (ctx
->ExecuteFlag
) {
3824 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
3829 static void GLAPIENTRY
3830 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3832 GET_CURRENT_CONTEXT(ctx
);
3834 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3835 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_WINDOW_POS
, 4);
3842 if (ctx
->ExecuteFlag
) {
3843 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
3847 static void GLAPIENTRY
3848 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3850 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3853 static void GLAPIENTRY
3854 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3856 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3859 static void GLAPIENTRY
3860 save_WindowPos2iMESA(GLint x
, GLint y
)
3862 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3865 static void GLAPIENTRY
3866 save_WindowPos2sMESA(GLshort x
, GLshort y
)
3868 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3871 static void GLAPIENTRY
3872 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3874 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3877 static void GLAPIENTRY
3878 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3880 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3883 static void GLAPIENTRY
3884 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3886 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3889 static void GLAPIENTRY
3890 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3892 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3895 static void GLAPIENTRY
3896 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3898 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3901 static void GLAPIENTRY
3902 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3904 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3907 static void GLAPIENTRY
3908 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3910 save_WindowPos4fMESA(x
, y
, z
, w
);
3913 static void GLAPIENTRY
3914 save_WindowPos2dvMESA(const GLdouble
* v
)
3916 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3919 static void GLAPIENTRY
3920 save_WindowPos2fvMESA(const GLfloat
* v
)
3922 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3925 static void GLAPIENTRY
3926 save_WindowPos2ivMESA(const GLint
* v
)
3928 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3931 static void GLAPIENTRY
3932 save_WindowPos2svMESA(const GLshort
* v
)
3934 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3937 static void GLAPIENTRY
3938 save_WindowPos3dvMESA(const GLdouble
* v
)
3940 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3943 static void GLAPIENTRY
3944 save_WindowPos3fvMESA(const GLfloat
* v
)
3946 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3949 static void GLAPIENTRY
3950 save_WindowPos3ivMESA(const GLint
* v
)
3952 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3955 static void GLAPIENTRY
3956 save_WindowPos3svMESA(const GLshort
* v
)
3958 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3961 static void GLAPIENTRY
3962 save_WindowPos4dvMESA(const GLdouble
* v
)
3964 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3965 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3968 static void GLAPIENTRY
3969 save_WindowPos4fvMESA(const GLfloat
* v
)
3971 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3974 static void GLAPIENTRY
3975 save_WindowPos4ivMESA(const GLint
* v
)
3977 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3978 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3981 static void GLAPIENTRY
3982 save_WindowPos4svMESA(const GLshort
* v
)
3984 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3989 /* GL_ARB_multitexture */
3990 static void GLAPIENTRY
3991 save_ActiveTextureARB(GLenum target
)
3993 GET_CURRENT_CONTEXT(ctx
);
3995 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3996 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4000 if (ctx
->ExecuteFlag
) {
4001 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
4006 /* GL_ARB_transpose_matrix */
4008 static void GLAPIENTRY
4009 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4012 _math_transposefd(tm
, m
);
4013 save_LoadMatrixf(tm
);
4017 static void GLAPIENTRY
4018 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4021 _math_transposef(tm
, m
);
4022 save_LoadMatrixf(tm
);
4026 static void GLAPIENTRY
4027 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4030 _math_transposefd(tm
, m
);
4031 save_MultMatrixf(tm
);
4035 static void GLAPIENTRY
4036 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4039 _math_transposef(tm
, m
);
4040 save_MultMatrixf(tm
);
4044 /* GL_ARB_texture_compression */
4045 static void GLAPIENTRY
4046 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4047 GLenum internalFormat
, GLsizei width
,
4048 GLint border
, GLsizei imageSize
,
4049 const GLvoid
* data
)
4051 GET_CURRENT_CONTEXT(ctx
);
4052 if (target
== GL_PROXY_TEXTURE_1D
) {
4053 /* don't compile, execute immediately */
4054 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4055 width
, border
, imageSize
,
4061 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4062 /* make copy of image */
4063 image
= _mesa_malloc(imageSize
);
4065 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
4068 MEMCPY(image
, data
, imageSize
);
4069 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4073 n
[3].e
= internalFormat
;
4074 n
[4].i
= (GLint
) width
;
4082 if (ctx
->ExecuteFlag
) {
4083 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4084 (target
, level
, internalFormat
, width
,
4085 border
, imageSize
, data
));
4091 static void GLAPIENTRY
4092 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4093 GLenum internalFormat
, GLsizei width
,
4094 GLsizei height
, GLint border
, GLsizei imageSize
,
4095 const GLvoid
* data
)
4097 GET_CURRENT_CONTEXT(ctx
);
4098 if (target
== GL_PROXY_TEXTURE_2D
) {
4099 /* don't compile, execute immediately */
4100 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4101 width
, height
, border
,
4107 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4108 /* make copy of image */
4109 image
= _mesa_malloc(imageSize
);
4111 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4114 MEMCPY(image
, data
, imageSize
);
4115 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4119 n
[3].e
= internalFormat
;
4120 n
[4].i
= (GLint
) width
;
4121 n
[5].i
= (GLint
) height
;
4129 if (ctx
->ExecuteFlag
) {
4130 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4131 (target
, level
, internalFormat
, width
,
4132 height
, border
, imageSize
, data
));
4138 static void GLAPIENTRY
4139 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4140 GLenum internalFormat
, GLsizei width
,
4141 GLsizei height
, GLsizei depth
, GLint border
,
4142 GLsizei imageSize
, const GLvoid
* data
)
4144 GET_CURRENT_CONTEXT(ctx
);
4145 if (target
== GL_PROXY_TEXTURE_3D
) {
4146 /* don't compile, execute immediately */
4147 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4148 width
, height
, depth
, border
,
4154 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4155 /* make copy of image */
4156 image
= _mesa_malloc(imageSize
);
4158 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4161 MEMCPY(image
, data
, imageSize
);
4162 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4166 n
[3].e
= internalFormat
;
4167 n
[4].i
= (GLint
) width
;
4168 n
[5].i
= (GLint
) height
;
4169 n
[6].i
= (GLint
) depth
;
4177 if (ctx
->ExecuteFlag
) {
4178 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4179 (target
, level
, internalFormat
, width
,
4180 height
, depth
, border
, imageSize
,
4187 static void GLAPIENTRY
4188 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4189 GLsizei width
, GLenum format
,
4190 GLsizei imageSize
, const GLvoid
* data
)
4195 GET_CURRENT_CONTEXT(ctx
);
4196 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4198 /* make copy of image */
4199 image
= _mesa_malloc(imageSize
);
4201 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4204 MEMCPY(image
, data
, imageSize
);
4205 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4210 n
[4].i
= (GLint
) width
;
4218 if (ctx
->ExecuteFlag
) {
4219 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4220 width
, format
, imageSize
,
4226 static void GLAPIENTRY
4227 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4228 GLint yoffset
, GLsizei width
, GLsizei height
,
4229 GLenum format
, GLsizei imageSize
,
4230 const GLvoid
* data
)
4235 GET_CURRENT_CONTEXT(ctx
);
4236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4238 /* make copy of image */
4239 image
= _mesa_malloc(imageSize
);
4241 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4244 MEMCPY(image
, data
, imageSize
);
4245 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4251 n
[5].i
= (GLint
) width
;
4252 n
[6].i
= (GLint
) height
;
4260 if (ctx
->ExecuteFlag
) {
4261 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4262 (target
, level
, xoffset
, yoffset
, width
,
4263 height
, format
, imageSize
, data
));
4268 static void GLAPIENTRY
4269 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4270 GLint yoffset
, GLint zoffset
, GLsizei width
,
4271 GLsizei height
, GLsizei depth
, GLenum format
,
4272 GLsizei imageSize
, const GLvoid
* data
)
4277 GET_CURRENT_CONTEXT(ctx
);
4278 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4280 /* make copy of image */
4281 image
= _mesa_malloc(imageSize
);
4283 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4286 MEMCPY(image
, data
, imageSize
);
4287 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4294 n
[6].i
= (GLint
) width
;
4295 n
[7].i
= (GLint
) height
;
4296 n
[8].i
= (GLint
) depth
;
4298 n
[10].i
= imageSize
;
4304 if (ctx
->ExecuteFlag
) {
4305 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4306 (target
, level
, xoffset
, yoffset
,
4307 zoffset
, width
, height
, depth
, format
,
4313 /* GL_ARB_multisample */
4314 static void GLAPIENTRY
4315 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4317 GET_CURRENT_CONTEXT(ctx
);
4319 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4320 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4325 if (ctx
->ExecuteFlag
) {
4326 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4332 * GL_NV_vertex_program
4334 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4335 static void GLAPIENTRY
4336 save_BindProgramNV(GLenum target
, GLuint id
)
4338 GET_CURRENT_CONTEXT(ctx
);
4340 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4341 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4346 if (ctx
->ExecuteFlag
) {
4347 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4351 static void GLAPIENTRY
4352 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4353 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4355 GET_CURRENT_CONTEXT(ctx
);
4357 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4358 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4367 if (ctx
->ExecuteFlag
) {
4368 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4373 static void GLAPIENTRY
4374 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4375 const GLfloat
*params
)
4377 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4378 params
[2], params
[3]);
4382 static void GLAPIENTRY
4383 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4384 const GLfloat
* params
)
4386 GET_CURRENT_CONTEXT(ctx
);
4388 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4392 const GLfloat
* p
= params
;
4394 for (i
= 0 ; i
< count
; i
++) {
4395 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4408 if (ctx
->ExecuteFlag
) {
4409 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4414 static void GLAPIENTRY
4415 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4416 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4418 save_ProgramEnvParameter4fARB(target
, index
,
4420 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4424 static void GLAPIENTRY
4425 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4426 const GLdouble
*params
)
4428 save_ProgramEnvParameter4fARB(target
, index
,
4429 (GLfloat
) params
[0],
4430 (GLfloat
) params
[1],
4431 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4434 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
4436 #if FEATURE_NV_vertex_program
4437 static void GLAPIENTRY
4438 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4440 GET_CURRENT_CONTEXT(ctx
);
4442 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4443 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4452 if (ctx
->ExecuteFlag
) {
4453 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4458 static void GLAPIENTRY
4459 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4460 GLuint num
, const GLdouble
*params
)
4463 for (i
= 0; i
< num
; i
++) {
4464 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4469 static void GLAPIENTRY
4470 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4471 GLuint num
, const GLfloat
*params
)
4474 for (i
= 0; i
< num
; i
++) {
4475 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4480 static void GLAPIENTRY
4481 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4482 const GLubyte
* program
)
4484 GET_CURRENT_CONTEXT(ctx
);
4487 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4489 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4491 GLubyte
*programCopy
= (GLubyte
*) _mesa_malloc(len
);
4493 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4496 _mesa_memcpy(programCopy
, program
, len
);
4500 n
[4].data
= programCopy
;
4502 if (ctx
->ExecuteFlag
) {
4503 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4508 static void GLAPIENTRY
4509 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4511 GET_CURRENT_CONTEXT(ctx
);
4514 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4516 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4518 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4520 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4523 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4527 if (ctx
->ExecuteFlag
) {
4528 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4533 static void GLAPIENTRY
4534 save_TrackMatrixNV(GLenum target
, GLuint address
,
4535 GLenum matrix
, GLenum transform
)
4537 GET_CURRENT_CONTEXT(ctx
);
4539 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4540 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4547 if (ctx
->ExecuteFlag
) {
4548 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4551 #endif /* FEATURE_NV_vertex_program */
4555 * GL_NV_fragment_program
4557 #if FEATURE_NV_fragment_program
4558 static void GLAPIENTRY
4559 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4560 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4562 GET_CURRENT_CONTEXT(ctx
);
4564 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4565 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4574 if (ctx
->ExecuteFlag
) {
4575 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4580 static void GLAPIENTRY
4581 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4582 const GLfloat
*params
)
4584 GET_CURRENT_CONTEXT(ctx
);
4586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4587 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4596 if (ctx
->ExecuteFlag
) {
4597 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4602 static void GLAPIENTRY
4603 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4604 const GLfloat
*params
)
4606 GET_CURRENT_CONTEXT(ctx
);
4608 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4612 const GLfloat
* p
= params
;
4614 for (i
= 0 ; i
< count
; i
++) {
4615 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4628 if (ctx
->ExecuteFlag
) {
4629 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4634 static void GLAPIENTRY
4635 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4636 GLdouble x
, GLdouble y
,
4637 GLdouble z
, GLdouble w
)
4639 GET_CURRENT_CONTEXT(ctx
);
4641 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4642 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4646 n
[3].f
= (GLfloat
) x
;
4647 n
[4].f
= (GLfloat
) y
;
4648 n
[5].f
= (GLfloat
) z
;
4649 n
[6].f
= (GLfloat
) w
;
4651 if (ctx
->ExecuteFlag
) {
4652 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4657 static void GLAPIENTRY
4658 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4659 const GLdouble
*params
)
4661 GET_CURRENT_CONTEXT(ctx
);
4663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4664 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4668 n
[3].f
= (GLfloat
) params
[0];
4669 n
[4].f
= (GLfloat
) params
[1];
4670 n
[5].f
= (GLfloat
) params
[2];
4671 n
[6].f
= (GLfloat
) params
[3];
4673 if (ctx
->ExecuteFlag
) {
4674 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4678 static void GLAPIENTRY
4679 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4680 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4682 GET_CURRENT_CONTEXT(ctx
);
4685 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4687 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
4689 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4691 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4694 _mesa_memcpy(nameCopy
, name
, len
);
4697 n
[3].data
= nameCopy
;
4703 if (ctx
->ExecuteFlag
) {
4704 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
4709 static void GLAPIENTRY
4710 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4713 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4717 static void GLAPIENTRY
4718 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4719 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4721 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4722 (GLfloat
) z
, (GLfloat
) w
);
4726 static void GLAPIENTRY
4727 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4730 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4731 (GLfloat
) v
[1], (GLfloat
) v
[2],
4735 #endif /* FEATURE_NV_fragment_program */
4739 /* GL_EXT_stencil_two_side */
4740 static void GLAPIENTRY
4741 save_ActiveStencilFaceEXT(GLenum face
)
4743 GET_CURRENT_CONTEXT(ctx
);
4745 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4746 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
4750 if (ctx
->ExecuteFlag
) {
4751 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
4756 /* GL_EXT_depth_bounds_test */
4757 static void GLAPIENTRY
4758 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
4760 GET_CURRENT_CONTEXT(ctx
);
4762 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4763 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
4765 n
[1].f
= (GLfloat
) zmin
;
4766 n
[2].f
= (GLfloat
) zmax
;
4768 if (ctx
->ExecuteFlag
) {
4769 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
4775 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4777 static void GLAPIENTRY
4778 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4779 const GLvoid
* string
)
4781 GET_CURRENT_CONTEXT(ctx
);
4784 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4786 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
4788 GLubyte
*programCopy
= (GLubyte
*) _mesa_malloc(len
);
4790 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4793 _mesa_memcpy(programCopy
, string
, len
);
4797 n
[4].data
= programCopy
;
4799 if (ctx
->ExecuteFlag
) {
4800 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
4804 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4807 #if FEATURE_ARB_occlusion_query
4809 static void GLAPIENTRY
4810 save_BeginQueryARB(GLenum target
, GLuint id
)
4812 GET_CURRENT_CONTEXT(ctx
);
4814 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4815 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
4820 if (ctx
->ExecuteFlag
) {
4821 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
4826 static void GLAPIENTRY
4827 save_EndQueryARB(GLenum target
)
4829 GET_CURRENT_CONTEXT(ctx
);
4831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4832 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_END_QUERY_ARB
, 1);
4836 if (ctx
->ExecuteFlag
) {
4837 CALL_EndQueryARB(ctx
->Exec
, (target
));
4841 #endif /* FEATURE_ARB_occlusion_query */
4844 static void GLAPIENTRY
4845 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
4847 GET_CURRENT_CONTEXT(ctx
);
4849 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4850 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
4854 if (count
> MAX_DRAW_BUFFERS
)
4855 count
= MAX_DRAW_BUFFERS
;
4856 for (i
= 0; i
< count
; i
++) {
4857 n
[2 + i
].e
= buffers
[i
];
4860 if (ctx
->ExecuteFlag
) {
4861 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
4865 static void GLAPIENTRY
4866 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
4868 GET_CURRENT_CONTEXT(ctx
);
4871 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
4879 if (ctx
->ExecuteFlag
) {
4880 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
4884 static void GLAPIENTRY
4885 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
4888 p
[0] = INT_TO_FLOAT(param
[0]);
4889 p
[1] = INT_TO_FLOAT(param
[1]);
4890 p
[2] = INT_TO_FLOAT(param
[2]);
4891 p
[3] = INT_TO_FLOAT(param
[3]);
4892 save_TexBumpParameterfvATI(pname
, p
);
4895 #if FEATURE_ATI_fragment_shader
4896 static void GLAPIENTRY
4897 save_BindFragmentShaderATI(GLuint id
)
4899 GET_CURRENT_CONTEXT(ctx
);
4902 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
4906 if (ctx
->ExecuteFlag
) {
4907 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
4911 static void GLAPIENTRY
4912 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
4914 GET_CURRENT_CONTEXT(ctx
);
4917 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
4925 if (ctx
->ExecuteFlag
) {
4926 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
4932 save_Attr1fNV(GLenum attr
, GLfloat x
)
4934 GET_CURRENT_CONTEXT(ctx
);
4936 SAVE_FLUSH_VERTICES(ctx
);
4937 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_NV
, 2);
4943 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
4944 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4945 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4947 if (ctx
->ExecuteFlag
) {
4948 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
4953 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
4955 GET_CURRENT_CONTEXT(ctx
);
4957 SAVE_FLUSH_VERTICES(ctx
);
4958 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_NV
, 3);
4965 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
4966 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4967 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4969 if (ctx
->ExecuteFlag
) {
4970 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
4975 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4977 GET_CURRENT_CONTEXT(ctx
);
4979 SAVE_FLUSH_VERTICES(ctx
);
4980 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_NV
, 4);
4988 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
4989 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4990 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4992 if (ctx
->ExecuteFlag
) {
4993 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
4998 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5000 GET_CURRENT_CONTEXT(ctx
);
5002 SAVE_FLUSH_VERTICES(ctx
);
5003 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_NV
, 5);
5012 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5013 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5014 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5016 if (ctx
->ExecuteFlag
) {
5017 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5023 save_Attr1fARB(GLenum attr
, GLfloat x
)
5025 GET_CURRENT_CONTEXT(ctx
);
5027 SAVE_FLUSH_VERTICES(ctx
);
5028 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5034 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5035 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5036 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5038 if (ctx
->ExecuteFlag
) {
5039 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5044 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5046 GET_CURRENT_CONTEXT(ctx
);
5048 SAVE_FLUSH_VERTICES(ctx
);
5049 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5056 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5057 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5058 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5060 if (ctx
->ExecuteFlag
) {
5061 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5066 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5068 GET_CURRENT_CONTEXT(ctx
);
5070 SAVE_FLUSH_VERTICES(ctx
);
5071 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5079 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5080 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5081 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5083 if (ctx
->ExecuteFlag
) {
5084 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5089 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5091 GET_CURRENT_CONTEXT(ctx
);
5093 SAVE_FLUSH_VERTICES(ctx
);
5094 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5103 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5104 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5105 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5107 if (ctx
->ExecuteFlag
) {
5108 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5113 static void GLAPIENTRY
5114 save_EvalCoord1f(GLfloat x
)
5116 GET_CURRENT_CONTEXT(ctx
);
5118 SAVE_FLUSH_VERTICES(ctx
);
5119 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C1
, 1);
5123 if (ctx
->ExecuteFlag
) {
5124 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5128 static void GLAPIENTRY
5129 save_EvalCoord1fv(const GLfloat
* v
)
5131 save_EvalCoord1f(v
[0]);
5134 static void GLAPIENTRY
5135 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5137 GET_CURRENT_CONTEXT(ctx
);
5139 SAVE_FLUSH_VERTICES(ctx
);
5140 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C2
, 2);
5145 if (ctx
->ExecuteFlag
) {
5146 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5150 static void GLAPIENTRY
5151 save_EvalCoord2fv(const GLfloat
* v
)
5153 save_EvalCoord2f(v
[0], v
[1]);
5157 static void GLAPIENTRY
5158 save_EvalPoint1(GLint x
)
5160 GET_CURRENT_CONTEXT(ctx
);
5162 SAVE_FLUSH_VERTICES(ctx
);
5163 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P1
, 1);
5167 if (ctx
->ExecuteFlag
) {
5168 CALL_EvalPoint1(ctx
->Exec
, (x
));
5172 static void GLAPIENTRY
5173 save_EvalPoint2(GLint x
, GLint y
)
5175 GET_CURRENT_CONTEXT(ctx
);
5177 SAVE_FLUSH_VERTICES(ctx
);
5178 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P2
, 2);
5183 if (ctx
->ExecuteFlag
) {
5184 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5188 static void GLAPIENTRY
5189 save_Indexf(GLfloat x
)
5191 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5194 static void GLAPIENTRY
5195 save_Indexfv(const GLfloat
* v
)
5197 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5200 static void GLAPIENTRY
5201 save_EdgeFlag(GLboolean x
)
5203 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? (GLfloat
)1.0 : (GLfloat
)0.0);
5206 static INLINE GLboolean
compare4fv( const GLfloat
*a
,
5210 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5214 static void GLAPIENTRY
5215 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5217 GET_CURRENT_CONTEXT(ctx
);
5225 case GL_FRONT_AND_BACK
:
5228 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5237 case GL_AMBIENT_AND_DIFFUSE
:
5243 case GL_COLOR_INDEXES
:
5247 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5251 if (ctx
->ExecuteFlag
) {
5252 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5255 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5257 /* Try to eliminate redundant statechanges. Because it is legal to
5258 * call glMaterial even inside begin/end calls, don't need to worry
5259 * about ctx->Driver.CurrentSavePrimitive here.
5261 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5262 if (bitmask
& (1 << i
)) {
5263 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5264 compare4fv(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5265 bitmask
&= ~(1 << i
);
5268 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5269 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5274 /* If this call has effect, return early:
5279 SAVE_FLUSH_VERTICES(ctx
);
5281 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATERIAL
, 6);
5285 for (i
= 0; i
< args
; i
++)
5286 n
[3 + i
].f
= param
[i
];
5290 static void GLAPIENTRY
5291 save_Begin(GLenum mode
)
5293 GET_CURRENT_CONTEXT(ctx
);
5295 GLboolean error
= GL_FALSE
;
5297 if ( /*mode < GL_POINTS || */ mode
> GL_POLYGON
) {
5298 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5301 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5302 /* Typically the first begin. This may raise an error on
5303 * playback, depending on whether CallList is issued from inside
5304 * a begin/end or not.
5306 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5308 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5309 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5312 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5317 /* Give the driver an opportunity to hook in an optimized
5318 * display list compiler.
5320 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5323 SAVE_FLUSH_VERTICES(ctx
);
5324 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN
, 1);
5330 if (ctx
->ExecuteFlag
) {
5331 CALL_Begin(ctx
->Exec
, (mode
));
5335 static void GLAPIENTRY
5338 GET_CURRENT_CONTEXT(ctx
);
5339 SAVE_FLUSH_VERTICES(ctx
);
5340 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END
, 0);
5341 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5342 if (ctx
->ExecuteFlag
) {
5343 CALL_End(ctx
->Exec
, ());
5347 static void GLAPIENTRY
5348 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5350 GET_CURRENT_CONTEXT(ctx
);
5352 SAVE_FLUSH_VERTICES(ctx
);
5353 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RECTF
, 4);
5360 if (ctx
->ExecuteFlag
) {
5361 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5366 static void GLAPIENTRY
5367 save_Vertex2f(GLfloat x
, GLfloat y
)
5369 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5372 static void GLAPIENTRY
5373 save_Vertex2fv(const GLfloat
* v
)
5375 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5378 static void GLAPIENTRY
5379 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5381 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5384 static void GLAPIENTRY
5385 save_Vertex3fv(const GLfloat
* v
)
5387 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5390 static void GLAPIENTRY
5391 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5393 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5396 static void GLAPIENTRY
5397 save_Vertex4fv(const GLfloat
* v
)
5399 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5402 static void GLAPIENTRY
5403 save_TexCoord1f(GLfloat x
)
5405 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5408 static void GLAPIENTRY
5409 save_TexCoord1fv(const GLfloat
* v
)
5411 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5414 static void GLAPIENTRY
5415 save_TexCoord2f(GLfloat x
, GLfloat y
)
5417 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5420 static void GLAPIENTRY
5421 save_TexCoord2fv(const GLfloat
* v
)
5423 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5426 static void GLAPIENTRY
5427 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5429 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5432 static void GLAPIENTRY
5433 save_TexCoord3fv(const GLfloat
* v
)
5435 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5438 static void GLAPIENTRY
5439 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5441 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5444 static void GLAPIENTRY
5445 save_TexCoord4fv(const GLfloat
* v
)
5447 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5450 static void GLAPIENTRY
5451 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5453 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5456 static void GLAPIENTRY
5457 save_Normal3fv(const GLfloat
* v
)
5459 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5462 static void GLAPIENTRY
5463 save_FogCoordfEXT(GLfloat x
)
5465 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5468 static void GLAPIENTRY
5469 save_FogCoordfvEXT(const GLfloat
* v
)
5471 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5474 static void GLAPIENTRY
5475 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5477 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5480 static void GLAPIENTRY
5481 save_Color3fv(const GLfloat
* v
)
5483 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5486 static void GLAPIENTRY
5487 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5489 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5492 static void GLAPIENTRY
5493 save_Color4fv(const GLfloat
* v
)
5495 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5498 static void GLAPIENTRY
5499 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5501 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5504 static void GLAPIENTRY
5505 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5507 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5511 /* Just call the respective ATTR for texcoord
5513 static void GLAPIENTRY
5514 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5516 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5517 save_Attr1fNV(attr
, x
);
5520 static void GLAPIENTRY
5521 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5523 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5524 save_Attr1fNV(attr
, v
[0]);
5527 static void GLAPIENTRY
5528 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5530 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5531 save_Attr2fNV(attr
, x
, y
);
5534 static void GLAPIENTRY
5535 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5537 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5538 save_Attr2fNV(attr
, v
[0], v
[1]);
5541 static void GLAPIENTRY
5542 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5544 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5545 save_Attr3fNV(attr
, x
, y
, z
);
5548 static void GLAPIENTRY
5549 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5551 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5552 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5555 static void GLAPIENTRY
5556 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5557 GLfloat z
, GLfloat w
)
5559 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5560 save_Attr4fNV(attr
, x
, y
, z
, w
);
5563 static void GLAPIENTRY
5564 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5566 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5567 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5572 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5578 GET_CURRENT_CONTEXT(ctx
);
5579 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5583 /* First level for NV_vertex_program:
5585 * Check for errors at compile time?.
5587 static void GLAPIENTRY
5588 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
5590 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5591 save_Attr1fNV(index
, x
);
5596 static void GLAPIENTRY
5597 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
5599 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5600 save_Attr1fNV(index
, v
[0]);
5605 static void GLAPIENTRY
5606 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
5608 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5609 save_Attr2fNV(index
, x
, y
);
5614 static void GLAPIENTRY
5615 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
5617 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5618 save_Attr2fNV(index
, v
[0], v
[1]);
5623 static void GLAPIENTRY
5624 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5626 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5627 save_Attr3fNV(index
, x
, y
, z
);
5632 static void GLAPIENTRY
5633 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
5635 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5636 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
5641 static void GLAPIENTRY
5642 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
5643 GLfloat z
, GLfloat w
)
5645 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5646 save_Attr4fNV(index
, x
, y
, z
, w
);
5651 static void GLAPIENTRY
5652 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
5654 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5655 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
5663 static void GLAPIENTRY
5664 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5666 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5667 save_Attr1fARB(index
, x
);
5672 static void GLAPIENTRY
5673 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5675 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5676 save_Attr1fARB(index
, v
[0]);
5681 static void GLAPIENTRY
5682 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5684 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5685 save_Attr2fARB(index
, x
, y
);
5690 static void GLAPIENTRY
5691 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5693 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5694 save_Attr2fARB(index
, v
[0], v
[1]);
5699 static void GLAPIENTRY
5700 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5702 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5703 save_Attr3fARB(index
, x
, y
, z
);
5708 static void GLAPIENTRY
5709 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
5711 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5712 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
5717 static void GLAPIENTRY
5718 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
5721 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5722 save_Attr4fARB(index
, x
, y
, z
, w
);
5727 static void GLAPIENTRY
5728 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
5730 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5731 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
5737 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
5739 static void GLAPIENTRY
5740 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
5742 GET_CURRENT_CONTEXT(ctx
);
5743 FLUSH_VERTICES(ctx
, 0);
5744 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
5747 static GLint GLAPIENTRY
5748 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
5750 GET_CURRENT_CONTEXT(ctx
);
5751 FLUSH_VERTICES(ctx
, 0);
5752 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
5754 /* XXX more shader functions needed here */
5758 #if FEATURE_EXT_framebuffer_blit
5759 static void GLAPIENTRY
5760 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
5761 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
5762 GLbitfield mask
, GLenum filter
)
5764 GET_CURRENT_CONTEXT(ctx
);
5766 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5767 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
5780 if (ctx
->ExecuteFlag
) {
5781 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
5782 dstX0
, dstY0
, dstX1
, dstY1
,
5789 /** GL_EXT_provoking_vertex */
5790 static void GLAPIENTRY
5791 save_ProvokingVertexEXT(GLenum mode
)
5793 GET_CURRENT_CONTEXT(ctx
);
5795 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5796 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
5800 if (ctx
->ExecuteFlag
) {
5801 /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
5802 _mesa_ProvokingVertexEXT(mode
);
5809 * Save an error-generating command into display list.
5811 * KW: Will appear in the list before the vertex buffer containing the
5812 * command that provoked the error. I don't see this as a problem.
5815 save_error(GLcontext
*ctx
, GLenum error
, const char *s
)
5818 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ERROR
, 2);
5821 n
[2].data
= (void *) s
;
5827 * Compile an error into current display list.
5830 _mesa_compile_error(GLcontext
*ctx
, GLenum error
, const char *s
)
5832 if (ctx
->CompileFlag
)
5833 save_error(ctx
, error
, s
);
5834 if (ctx
->ExecuteFlag
)
5835 _mesa_error(ctx
, error
, s
);
5840 * Test if ID names a display list.
5843 islist(GLcontext
*ctx
, GLuint list
)
5845 if (list
> 0 && lookup_list(ctx
, list
)) {
5855 /**********************************************************************/
5856 /* Display list execution */
5857 /**********************************************************************/
5861 * Execute a display list. Note that the ListBase offset must have already
5862 * been added before calling this function. I.e. the list argument is
5863 * the absolute list number, not relative to ListBase.
5864 * \param list - display list number
5867 execute_list(GLcontext
*ctx
, GLuint list
)
5869 struct gl_display_list
*dlist
;
5873 if (list
== 0 || !islist(ctx
, list
))
5876 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
5877 /* raise an error? */
5881 dlist
= lookup_list(ctx
, list
);
5885 ctx
->ListState
.CallDepth
++;
5887 if (ctx
->Driver
.BeginCallList
)
5888 ctx
->Driver
.BeginCallList(ctx
, dlist
);
5894 OpCode opcode
= n
[0].opcode
;
5895 int i
= (int) n
[0].opcode
- (int) OPCODE_EXT_0
;
5897 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
5898 /* this is a driver-extended opcode */
5899 ctx
->ListExt
.Opcode
[i
].Execute(ctx
, &n
[1]);
5900 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
5905 _mesa_error(ctx
, n
[1].e
, (const char *) n
[2].data
);
5908 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
5910 case OPCODE_ALPHA_FUNC
:
5911 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
5913 case OPCODE_BIND_TEXTURE
:
5914 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
5918 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5919 ctx
->Unpack
= ctx
->DefaultPacking
;
5920 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5921 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
5922 (const GLubyte
*) n
[7].data
));
5923 ctx
->Unpack
= save
; /* restore */
5926 case OPCODE_BLEND_COLOR
:
5927 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5929 case OPCODE_BLEND_EQUATION
:
5930 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
5932 case OPCODE_BLEND_EQUATION_SEPARATE
:
5933 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5935 case OPCODE_BLEND_FUNC_SEPARATE
:
5936 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
5937 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
5939 case OPCODE_CALL_LIST
:
5940 /* Generated by glCallList(), don't add ListBase */
5941 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5942 execute_list(ctx
, n
[1].ui
);
5945 case OPCODE_CALL_LIST_OFFSET
:
5946 /* Generated by glCallLists() so we must add ListBase */
5948 /* user specified a bad data type at compile time */
5949 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5951 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5952 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
5953 execute_list(ctx
, list
);
5957 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
5959 case OPCODE_CLEAR_COLOR
:
5960 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5962 case OPCODE_CLEAR_ACCUM
:
5963 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5965 case OPCODE_CLEAR_DEPTH
:
5966 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
5968 case OPCODE_CLEAR_INDEX
:
5969 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
5971 case OPCODE_CLEAR_STENCIL
:
5972 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
5974 case OPCODE_CLIP_PLANE
:
5981 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
5984 case OPCODE_COLOR_MASK
:
5985 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
5987 case OPCODE_COLOR_MATERIAL
:
5988 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5990 case OPCODE_COLOR_TABLE
:
5992 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5993 ctx
->Unpack
= ctx
->DefaultPacking
;
5994 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5995 n
[5].e
, n
[6].data
));
5996 ctx
->Unpack
= save
; /* restore */
5999 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
6006 CALL_ColorTableParameterfv(ctx
->Exec
,
6007 (n
[1].e
, n
[2].e
, params
));
6010 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
6017 CALL_ColorTableParameteriv(ctx
->Exec
,
6018 (n
[1].e
, n
[2].e
, params
));
6021 case OPCODE_COLOR_SUB_TABLE
:
6023 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6024 ctx
->Unpack
= ctx
->DefaultPacking
;
6025 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6026 n
[4].e
, n
[5].e
, n
[6].data
));
6027 ctx
->Unpack
= save
; /* restore */
6030 case OPCODE_CONVOLUTION_FILTER_1D
:
6032 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6033 ctx
->Unpack
= ctx
->DefaultPacking
;
6034 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6037 ctx
->Unpack
= save
; /* restore */
6040 case OPCODE_CONVOLUTION_FILTER_2D
:
6042 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6043 ctx
->Unpack
= ctx
->DefaultPacking
;
6044 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6045 n
[4].i
, n
[5].e
, n
[6].e
,
6047 ctx
->Unpack
= save
; /* restore */
6050 case OPCODE_CONVOLUTION_PARAMETER_I
:
6051 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
6053 case OPCODE_CONVOLUTION_PARAMETER_IV
:
6060 CALL_ConvolutionParameteriv(ctx
->Exec
,
6061 (n
[1].e
, n
[2].e
, params
));
6064 case OPCODE_CONVOLUTION_PARAMETER_F
:
6065 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
6067 case OPCODE_CONVOLUTION_PARAMETER_FV
:
6074 CALL_ConvolutionParameterfv(ctx
->Exec
,
6075 (n
[1].e
, n
[2].e
, params
));
6078 case OPCODE_COPY_COLOR_SUB_TABLE
:
6079 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6080 n
[3].i
, n
[4].i
, n
[5].i
));
6082 case OPCODE_COPY_COLOR_TABLE
:
6083 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6084 n
[3].i
, n
[4].i
, n
[5].i
));
6086 case OPCODE_COPY_PIXELS
:
6087 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6088 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
6091 case OPCODE_COPY_TEX_IMAGE1D
:
6092 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6093 n
[5].i
, n
[6].i
, n
[7].i
));
6095 case OPCODE_COPY_TEX_IMAGE2D
:
6096 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6097 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
6099 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
6100 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6101 n
[4].i
, n
[5].i
, n
[6].i
));
6103 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
6104 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6105 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6108 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
6109 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6110 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6113 case OPCODE_CULL_FACE
:
6114 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
6116 case OPCODE_DEPTH_FUNC
:
6117 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
6119 case OPCODE_DEPTH_MASK
:
6120 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
6122 case OPCODE_DEPTH_RANGE
:
6123 CALL_DepthRange(ctx
->Exec
,
6124 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
6126 case OPCODE_DISABLE
:
6127 CALL_Disable(ctx
->Exec
, (n
[1].e
));
6129 case OPCODE_DRAW_BUFFER
:
6130 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
6132 case OPCODE_DRAW_PIXELS
:
6134 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6135 ctx
->Unpack
= ctx
->DefaultPacking
;
6136 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
6138 ctx
->Unpack
= save
; /* restore */
6142 CALL_Enable(ctx
->Exec
, (n
[1].e
));
6144 case OPCODE_EVALMESH1
:
6145 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
6147 case OPCODE_EVALMESH2
:
6148 CALL_EvalMesh2(ctx
->Exec
,
6149 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
6158 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
6161 case OPCODE_FRONT_FACE
:
6162 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
6164 case OPCODE_FRUSTUM
:
6165 CALL_Frustum(ctx
->Exec
,
6166 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6169 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6171 case OPCODE_HISTOGRAM
:
6172 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
6174 case OPCODE_INDEX_MASK
:
6175 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
6177 case OPCODE_INIT_NAMES
:
6178 CALL_InitNames(ctx
->Exec
, ());
6187 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
6190 case OPCODE_LIGHT_MODEL
:
6197 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
6200 case OPCODE_LINE_STIPPLE
:
6201 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
6203 case OPCODE_LINE_WIDTH
:
6204 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
6206 case OPCODE_LIST_BASE
:
6207 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
6209 case OPCODE_LOAD_IDENTITY
:
6210 CALL_LoadIdentity(ctx
->Exec
, ());
6212 case OPCODE_LOAD_MATRIX
:
6213 if (sizeof(Node
) == sizeof(GLfloat
)) {
6214 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
6219 for (i
= 0; i
< 16; i
++) {
6222 CALL_LoadMatrixf(ctx
->Exec
, (m
));
6225 case OPCODE_LOAD_NAME
:
6226 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
6228 case OPCODE_LOGIC_OP
:
6229 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
6233 GLenum target
= n
[1].e
;
6234 GLint ustride
= _mesa_evaluator_components(target
);
6235 GLint uorder
= n
[5].i
;
6236 GLfloat u1
= n
[2].f
;
6237 GLfloat u2
= n
[3].f
;
6238 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6239 (GLfloat
*) n
[6].data
));
6244 GLenum target
= n
[1].e
;
6245 GLfloat u1
= n
[2].f
;
6246 GLfloat u2
= n
[3].f
;
6247 GLfloat v1
= n
[4].f
;
6248 GLfloat v2
= n
[5].f
;
6249 GLint ustride
= n
[6].i
;
6250 GLint vstride
= n
[7].i
;
6251 GLint uorder
= n
[8].i
;
6252 GLint vorder
= n
[9].i
;
6253 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6254 v1
, v2
, vstride
, vorder
,
6255 (GLfloat
*) n
[10].data
));
6258 case OPCODE_MAPGRID1
:
6259 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
6261 case OPCODE_MAPGRID2
:
6262 CALL_MapGrid2f(ctx
->Exec
,
6263 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
6265 case OPCODE_MATRIX_MODE
:
6266 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
6268 case OPCODE_MIN_MAX
:
6269 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
6271 case OPCODE_MULT_MATRIX
:
6272 if (sizeof(Node
) == sizeof(GLfloat
)) {
6273 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
6278 for (i
= 0; i
< 16; i
++) {
6281 CALL_MultMatrixf(ctx
->Exec
, (m
));
6285 CALL_Ortho(ctx
->Exec
,
6286 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6288 case OPCODE_PASSTHROUGH
:
6289 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
6291 case OPCODE_PIXEL_MAP
:
6292 CALL_PixelMapfv(ctx
->Exec
,
6293 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
6295 case OPCODE_PIXEL_TRANSFER
:
6296 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6298 case OPCODE_PIXEL_ZOOM
:
6299 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6301 case OPCODE_POINT_SIZE
:
6302 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
6304 case OPCODE_POINT_PARAMETERS
:
6310 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
6313 case OPCODE_POLYGON_MODE
:
6314 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6316 case OPCODE_POLYGON_STIPPLE
:
6318 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6319 ctx
->Unpack
= ctx
->DefaultPacking
;
6320 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
6321 ctx
->Unpack
= save
; /* restore */
6324 case OPCODE_POLYGON_OFFSET
:
6325 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6327 case OPCODE_POP_ATTRIB
:
6328 CALL_PopAttrib(ctx
->Exec
, ());
6330 case OPCODE_POP_MATRIX
:
6331 CALL_PopMatrix(ctx
->Exec
, ());
6333 case OPCODE_POP_NAME
:
6334 CALL_PopName(ctx
->Exec
, ());
6336 case OPCODE_PRIORITIZE_TEXTURE
:
6337 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
6339 case OPCODE_PUSH_ATTRIB
:
6340 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
6342 case OPCODE_PUSH_MATRIX
:
6343 CALL_PushMatrix(ctx
->Exec
, ());
6345 case OPCODE_PUSH_NAME
:
6346 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
6348 case OPCODE_RASTER_POS
:
6349 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6351 case OPCODE_READ_BUFFER
:
6352 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
6354 case OPCODE_RESET_HISTOGRAM
:
6355 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
6357 case OPCODE_RESET_MIN_MAX
:
6358 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
6361 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6364 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6366 case OPCODE_SCISSOR
:
6367 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
6369 case OPCODE_SHADE_MODEL
:
6370 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
6372 case OPCODE_PROVOKING_VERTEX
:
6373 CALL_ProvokingVertexEXT(ctx
->Exec
, (n
[1].e
));
6375 case OPCODE_STENCIL_FUNC
:
6376 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
6378 case OPCODE_STENCIL_MASK
:
6379 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
6381 case OPCODE_STENCIL_OP
:
6382 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
6384 case OPCODE_STENCIL_FUNC_SEPARATE
:
6385 CALL_StencilFuncSeparate(ctx
->Exec
,
6386 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
6388 case OPCODE_STENCIL_MASK_SEPARATE
:
6389 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6391 case OPCODE_STENCIL_OP_SEPARATE
:
6392 CALL_StencilOpSeparate(ctx
->Exec
,
6393 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6402 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6412 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6415 case OPCODE_TEXPARAMETER
:
6422 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6425 case OPCODE_TEX_IMAGE1D
:
6427 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6428 ctx
->Unpack
= ctx
->DefaultPacking
;
6429 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
6431 n
[3].i
, /* components */
6433 n
[5].e
, /* border */
6434 n
[6].e
, /* format */
6437 ctx
->Unpack
= save
; /* restore */
6440 case OPCODE_TEX_IMAGE2D
:
6442 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6443 ctx
->Unpack
= ctx
->DefaultPacking
;
6444 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
6446 n
[3].i
, /* components */
6448 n
[5].i
, /* height */
6449 n
[6].e
, /* border */
6450 n
[7].e
, /* format */
6453 ctx
->Unpack
= save
; /* restore */
6456 case OPCODE_TEX_IMAGE3D
:
6458 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6459 ctx
->Unpack
= ctx
->DefaultPacking
;
6460 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
6462 n
[3].i
, /* components */
6464 n
[5].i
, /* height */
6466 n
[7].e
, /* border */
6467 n
[8].e
, /* format */
6470 ctx
->Unpack
= save
; /* restore */
6473 case OPCODE_TEX_SUB_IMAGE1D
:
6475 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6476 ctx
->Unpack
= ctx
->DefaultPacking
;
6477 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6479 n
[6].e
, n
[7].data
));
6480 ctx
->Unpack
= save
; /* restore */
6483 case OPCODE_TEX_SUB_IMAGE2D
:
6485 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6486 ctx
->Unpack
= ctx
->DefaultPacking
;
6487 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6489 n
[6].i
, n
[7].e
, n
[8].e
,
6491 ctx
->Unpack
= save
; /* restore */
6494 case OPCODE_TEX_SUB_IMAGE3D
:
6496 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6497 ctx
->Unpack
= ctx
->DefaultPacking
;
6498 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6499 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6500 n
[8].i
, n
[9].e
, n
[10].e
,
6502 ctx
->Unpack
= save
; /* restore */
6505 case OPCODE_TRANSLATE
:
6506 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6508 case OPCODE_VIEWPORT
:
6509 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6510 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
6512 case OPCODE_WINDOW_POS
:
6513 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6515 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
6516 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
6518 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
6519 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6520 n
[4].i
, n
[5].i
, n
[6].i
,
6523 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
6524 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6525 n
[4].i
, n
[5].i
, n
[6].i
,
6526 n
[7].i
, n
[8].data
));
6528 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
6529 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6530 n
[4].i
, n
[5].i
, n
[6].i
,
6534 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
6535 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
6536 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6537 n
[5].e
, n
[6].i
, n
[7].data
));
6539 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
6540 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
6541 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6542 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
6545 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
6546 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
6547 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6548 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6549 n
[9].e
, n
[10].i
, n
[11].data
));
6551 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
6552 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
6554 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
6555 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6557 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6558 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
6559 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6562 #if FEATURE_NV_vertex_program
6563 case OPCODE_EXECUTE_PROGRAM_NV
:
6570 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
6573 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
6574 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
6575 (GLuint
*) n
[2].data
));
6577 case OPCODE_LOAD_PROGRAM_NV
:
6578 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
6579 (const GLubyte
*) n
[4].data
));
6581 case OPCODE_TRACK_MATRIX_NV
:
6582 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
6586 #if FEATURE_NV_fragment_program
6587 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
6588 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
6589 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
6592 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
6593 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
6594 (const GLubyte
*) n
[3].
6595 data
, n
[4].f
, n
[5].f
,
6600 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
6601 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
6603 case OPCODE_DEPTH_BOUNDS_EXT
:
6604 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6606 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6607 case OPCODE_PROGRAM_STRING_ARB
:
6608 CALL_ProgramStringARB(ctx
->Exec
,
6609 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
6612 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
6613 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
6614 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6619 #if FEATURE_ARB_occlusion_query
6620 case OPCODE_BEGIN_QUERY_ARB
:
6621 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6623 case OPCODE_END_QUERY_ARB
:
6624 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
6627 case OPCODE_DRAW_BUFFERS_ARB
:
6629 GLenum buffers
[MAX_DRAW_BUFFERS
];
6630 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
6631 for (i
= 0; i
< count
; i
++)
6632 buffers
[i
] = n
[2 + i
].e
;
6633 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
6636 #if FEATURE_EXT_framebuffer_blit
6637 case OPCODE_BLIT_FRAMEBUFFER
:
6638 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
6639 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6643 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
6646 GLuint i
, pname
= n
[1].ui
;
6648 for (i
= 0; i
< 4; i
++)
6649 values
[i
] = n
[1 + i
].f
;
6650 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
6653 #if FEATURE_ATI_fragment_shader
6654 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
6655 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
6657 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
6660 GLuint i
, dst
= n
[1].ui
;
6662 for (i
= 0; i
< 4; i
++)
6663 values
[i
] = n
[1 + i
].f
;
6664 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
6668 case OPCODE_ATTR_1F_NV
:
6669 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6671 case OPCODE_ATTR_2F_NV
:
6672 /* Really shouldn't have to do this - the Node structure
6673 * is convenient, but it would be better to store the data
6674 * packed appropriately so that it can be sent directly
6675 * on. With x86_64 becoming common, this will start to
6678 if (sizeof(Node
) == sizeof(GLfloat
))
6679 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6681 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6683 case OPCODE_ATTR_3F_NV
:
6684 if (sizeof(Node
) == sizeof(GLfloat
))
6685 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6687 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6690 case OPCODE_ATTR_4F_NV
:
6691 if (sizeof(Node
) == sizeof(GLfloat
))
6692 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6694 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6697 case OPCODE_ATTR_1F_ARB
:
6698 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6700 case OPCODE_ATTR_2F_ARB
:
6701 /* Really shouldn't have to do this - the Node structure
6702 * is convenient, but it would be better to store the data
6703 * packed appropriately so that it can be sent directly
6704 * on. With x86_64 becoming common, this will start to
6707 if (sizeof(Node
) == sizeof(GLfloat
))
6708 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6710 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6712 case OPCODE_ATTR_3F_ARB
:
6713 if (sizeof(Node
) == sizeof(GLfloat
))
6714 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6716 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6719 case OPCODE_ATTR_4F_ARB
:
6720 if (sizeof(Node
) == sizeof(GLfloat
))
6721 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6723 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6726 case OPCODE_MATERIAL
:
6727 if (sizeof(Node
) == sizeof(GLfloat
))
6728 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
6735 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
6739 CALL_Begin(ctx
->Exec
, (n
[1].e
));
6742 CALL_End(ctx
->Exec
, ());
6745 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6747 case OPCODE_EVAL_C1
:
6748 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
6750 case OPCODE_EVAL_C2
:
6751 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6753 case OPCODE_EVAL_P1
:
6754 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
6756 case OPCODE_EVAL_P2
:
6757 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
6760 case OPCODE_CONTINUE
:
6761 n
= (Node
*) n
[1].next
;
6763 case OPCODE_END_OF_LIST
:
6769 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d",
6771 _mesa_problem(ctx
, msg
);
6776 /* increment n to point to next compiled command */
6777 if (opcode
!= OPCODE_CONTINUE
) {
6778 n
+= InstSize
[opcode
];
6783 if (ctx
->Driver
.EndCallList
)
6784 ctx
->Driver
.EndCallList(ctx
);
6786 ctx
->ListState
.CallDepth
--;
6791 /**********************************************************************/
6793 /**********************************************************************/
6796 * Test if a display list number is valid.
6798 GLboolean GLAPIENTRY
6799 _mesa_IsList(GLuint list
)
6801 GET_CURRENT_CONTEXT(ctx
);
6802 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6803 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6804 return islist(ctx
, list
);
6809 * Delete a sequence of consecutive display lists.
6812 _mesa_DeleteLists(GLuint list
, GLsizei range
)
6814 GET_CURRENT_CONTEXT(ctx
);
6816 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6817 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6820 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
6823 for (i
= list
; i
< list
+ range
; i
++) {
6824 destroy_list(ctx
, i
);
6830 * Return a display list number, n, such that lists n through n+range-1
6834 _mesa_GenLists(GLsizei range
)
6836 GET_CURRENT_CONTEXT(ctx
);
6838 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6839 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6842 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
6850 * Make this an atomic operation
6852 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6854 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6856 /* reserve the list IDs by with empty/dummy lists */
6858 for (i
= 0; i
< range
; i
++) {
6859 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
6860 make_list(base
+ i
, 1));
6864 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6871 * Begin a new display list.
6874 _mesa_NewList(GLuint name
, GLenum mode
)
6876 GET_CURRENT_CONTEXT(ctx
);
6878 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6879 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6881 if (MESA_VERBOSE
& VERBOSE_API
)
6882 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
6883 _mesa_lookup_enum_by_nr(mode
));
6886 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
6890 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
6891 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
6895 if (ctx
->ListState
.CurrentList
) {
6896 /* already compiling a display list */
6897 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
6901 ctx
->CompileFlag
= GL_TRUE
;
6902 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6904 /* Reset acumulated list state:
6906 invalidate_saved_current_state( ctx
);
6908 /* Allocate new display list */
6909 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
6910 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
6911 ctx
->ListState
.CurrentPos
= 0;
6913 ctx
->Driver
.NewList(ctx
, name
, mode
);
6915 ctx
->CurrentDispatch
= ctx
->Save
;
6916 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6921 * End definition of current display list.
6926 GET_CURRENT_CONTEXT(ctx
);
6927 SAVE_FLUSH_VERTICES(ctx
);
6928 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6930 if (MESA_VERBOSE
& VERBOSE_API
)
6931 _mesa_debug(ctx
, "glEndList\n");
6933 /* Check that a list is under construction */
6934 if (!ctx
->ListState
.CurrentList
) {
6935 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
6939 /* Call before emitting END_OF_LIST, in case the driver wants to
6940 * emit opcodes itself.
6942 ctx
->Driver
.EndList(ctx
);
6944 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END_OF_LIST
, 0);
6946 /* Destroy old list, if any */
6947 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
6949 /* Install the new list */
6950 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
6951 ctx
->ListState
.CurrentList
->Name
,
6952 ctx
->ListState
.CurrentList
);
6955 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6956 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
6958 ctx
->ListState
.CurrentList
= NULL
;
6959 ctx
->ExecuteFlag
= GL_TRUE
;
6960 ctx
->CompileFlag
= GL_FALSE
;
6962 ctx
->CurrentDispatch
= ctx
->Exec
;
6963 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6968 _mesa_CallList(GLuint list
)
6970 GLboolean save_compile_flag
;
6971 GET_CURRENT_CONTEXT(ctx
);
6972 FLUSH_CURRENT(ctx
, 0);
6973 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6974 /* execute the display list, and restore the CompileFlag. */
6976 if (MESA_VERBOSE
& VERBOSE_API
)
6977 _mesa_debug(ctx
, "glCallList %d\n", list
);
6980 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6984 /* mesa_print_display_list( list ); */
6986 save_compile_flag
= ctx
->CompileFlag
;
6987 if (save_compile_flag
) {
6988 ctx
->CompileFlag
= GL_FALSE
;
6991 execute_list(ctx
, list
);
6992 ctx
->CompileFlag
= save_compile_flag
;
6994 /* also restore API function pointers to point to "save" versions */
6995 if (save_compile_flag
) {
6996 ctx
->CurrentDispatch
= ctx
->Save
;
6997 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7003 * Execute glCallLists: call multiple display lists.
7006 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
7008 GET_CURRENT_CONTEXT(ctx
);
7010 GLboolean save_compile_flag
;
7012 if (MESA_VERBOSE
& VERBOSE_API
)
7013 _mesa_debug(ctx
, "glCallLists %d\n", n
);
7017 case GL_UNSIGNED_BYTE
:
7019 case GL_UNSIGNED_SHORT
:
7021 case GL_UNSIGNED_INT
:
7029 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7033 /* Save the CompileFlag status, turn it off, execute display list,
7034 * and restore the CompileFlag.
7036 save_compile_flag
= ctx
->CompileFlag
;
7037 ctx
->CompileFlag
= GL_FALSE
;
7039 for (i
= 0; i
< n
; i
++) {
7040 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
7041 execute_list(ctx
, list
);
7044 ctx
->CompileFlag
= save_compile_flag
;
7046 /* also restore API function pointers to point to "save" versions */
7047 if (save_compile_flag
) {
7048 ctx
->CurrentDispatch
= ctx
->Save
;
7049 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7055 * Set the offset added to list numbers in glCallLists.
7058 _mesa_ListBase(GLuint base
)
7060 GET_CURRENT_CONTEXT(ctx
);
7061 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7062 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7063 ctx
->List
.ListBase
= base
;
7067 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
7069 static void GLAPIENTRY
7072 GET_CURRENT_CONTEXT(ctx
);
7073 FLUSH_VERTICES(ctx
, 0);
7074 CALL_Finish(ctx
->Exec
, ());
7077 static void GLAPIENTRY
7080 GET_CURRENT_CONTEXT(ctx
);
7081 FLUSH_VERTICES(ctx
, 0);
7082 CALL_Flush(ctx
->Exec
, ());
7085 static void GLAPIENTRY
7086 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
7088 GET_CURRENT_CONTEXT(ctx
);
7089 FLUSH_VERTICES(ctx
, 0);
7090 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
7093 static void GLAPIENTRY
7094 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
7096 GET_CURRENT_CONTEXT(ctx
);
7097 FLUSH_VERTICES(ctx
, 0);
7098 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
7101 static void GLAPIENTRY
7102 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
7104 GET_CURRENT_CONTEXT(ctx
);
7105 FLUSH_VERTICES(ctx
, 0);
7106 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
7109 static GLenum GLAPIENTRY
7112 GET_CURRENT_CONTEXT(ctx
);
7113 FLUSH_VERTICES(ctx
, 0);
7114 return CALL_GetError(ctx
->Exec
, ());
7117 static void GLAPIENTRY
7118 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
7120 GET_CURRENT_CONTEXT(ctx
);
7121 FLUSH_VERTICES(ctx
, 0);
7122 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
7125 static void GLAPIENTRY
7126 exec_GetIntegerv(GLenum pname
, GLint
*params
)
7128 GET_CURRENT_CONTEXT(ctx
);
7129 FLUSH_VERTICES(ctx
, 0);
7130 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
7133 static void GLAPIENTRY
7134 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
7136 GET_CURRENT_CONTEXT(ctx
);
7137 FLUSH_VERTICES(ctx
, 0);
7138 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
7141 static void GLAPIENTRY
7142 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
7144 GET_CURRENT_CONTEXT(ctx
);
7145 FLUSH_VERTICES(ctx
, 0);
7146 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
7149 static void GLAPIENTRY
7150 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
7152 GET_CURRENT_CONTEXT(ctx
);
7153 FLUSH_VERTICES(ctx
, 0);
7154 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
7157 static void GLAPIENTRY
7158 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
7160 GET_CURRENT_CONTEXT(ctx
);
7161 FLUSH_VERTICES(ctx
, 0);
7162 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
7165 static void GLAPIENTRY
7166 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
7168 GET_CURRENT_CONTEXT(ctx
);
7169 FLUSH_VERTICES(ctx
, 0);
7170 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
7173 static void GLAPIENTRY
7174 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
7176 GET_CURRENT_CONTEXT(ctx
);
7177 FLUSH_VERTICES(ctx
, 0);
7178 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
7181 static void GLAPIENTRY
7182 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
7184 GET_CURRENT_CONTEXT(ctx
);
7185 FLUSH_VERTICES(ctx
, 0);
7186 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
7189 static void GLAPIENTRY
7190 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
7192 GET_CURRENT_CONTEXT(ctx
);
7193 FLUSH_VERTICES(ctx
, 0);
7194 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
7197 static void GLAPIENTRY
7198 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
7200 GET_CURRENT_CONTEXT(ctx
);
7201 FLUSH_VERTICES(ctx
, 0);
7202 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
7205 static void GLAPIENTRY
7206 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
7208 GET_CURRENT_CONTEXT(ctx
);
7209 FLUSH_VERTICES(ctx
, 0);
7210 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
7213 static void GLAPIENTRY
7214 exec_GetPolygonStipple(GLubyte
* dest
)
7216 GET_CURRENT_CONTEXT(ctx
);
7217 FLUSH_VERTICES(ctx
, 0);
7218 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
7221 static const GLubyte
*GLAPIENTRY
7222 exec_GetString(GLenum name
)
7224 GET_CURRENT_CONTEXT(ctx
);
7225 FLUSH_VERTICES(ctx
, 0);
7226 return CALL_GetString(ctx
->Exec
, (name
));
7229 static void GLAPIENTRY
7230 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7232 GET_CURRENT_CONTEXT(ctx
);
7233 FLUSH_VERTICES(ctx
, 0);
7234 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
7237 static void GLAPIENTRY
7238 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
7240 GET_CURRENT_CONTEXT(ctx
);
7241 FLUSH_VERTICES(ctx
, 0);
7242 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
7245 static void GLAPIENTRY
7246 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
7248 GET_CURRENT_CONTEXT(ctx
);
7249 FLUSH_VERTICES(ctx
, 0);
7250 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
7253 static void GLAPIENTRY
7254 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
7256 GET_CURRENT_CONTEXT(ctx
);
7257 FLUSH_VERTICES(ctx
, 0);
7258 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
7261 static void GLAPIENTRY
7262 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
7264 GET_CURRENT_CONTEXT(ctx
);
7265 FLUSH_VERTICES(ctx
, 0);
7266 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
7269 static void GLAPIENTRY
7270 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
7271 GLenum type
, GLvoid
* pixels
)
7273 GET_CURRENT_CONTEXT(ctx
);
7274 FLUSH_VERTICES(ctx
, 0);
7275 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
7278 static void GLAPIENTRY
7279 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
7280 GLenum pname
, GLfloat
*params
)
7282 GET_CURRENT_CONTEXT(ctx
);
7283 FLUSH_VERTICES(ctx
, 0);
7284 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
7287 static void GLAPIENTRY
7288 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
7289 GLenum pname
, GLint
*params
)
7291 GET_CURRENT_CONTEXT(ctx
);
7292 FLUSH_VERTICES(ctx
, 0);
7293 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
7296 static void GLAPIENTRY
7297 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7299 GET_CURRENT_CONTEXT(ctx
);
7300 FLUSH_VERTICES(ctx
, 0);
7301 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
7304 static void GLAPIENTRY
7305 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7307 GET_CURRENT_CONTEXT(ctx
);
7308 FLUSH_VERTICES(ctx
, 0);
7309 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
7312 static GLboolean GLAPIENTRY
7313 exec_IsEnabled(GLenum cap
)
7315 GET_CURRENT_CONTEXT(ctx
);
7316 FLUSH_VERTICES(ctx
, 0);
7317 return CALL_IsEnabled(ctx
->Exec
, (cap
));
7320 static void GLAPIENTRY
7321 exec_PixelStoref(GLenum pname
, GLfloat param
)
7323 GET_CURRENT_CONTEXT(ctx
);
7324 FLUSH_VERTICES(ctx
, 0);
7325 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
7328 static void GLAPIENTRY
7329 exec_PixelStorei(GLenum pname
, GLint param
)
7331 GET_CURRENT_CONTEXT(ctx
);
7332 FLUSH_VERTICES(ctx
, 0);
7333 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
7336 static void GLAPIENTRY
7337 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
7338 GLenum format
, GLenum type
, GLvoid
* pixels
)
7340 GET_CURRENT_CONTEXT(ctx
);
7341 FLUSH_VERTICES(ctx
, 0);
7342 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
7345 static GLint GLAPIENTRY
7346 exec_RenderMode(GLenum mode
)
7348 GET_CURRENT_CONTEXT(ctx
);
7349 FLUSH_VERTICES(ctx
, 0);
7350 return CALL_RenderMode(ctx
->Exec
, (mode
));
7353 static void GLAPIENTRY
7354 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
7356 GET_CURRENT_CONTEXT(ctx
);
7357 FLUSH_VERTICES(ctx
, 0);
7358 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
7361 static void GLAPIENTRY
7362 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
7364 GET_CURRENT_CONTEXT(ctx
);
7365 FLUSH_VERTICES(ctx
, 0);
7366 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
7369 static GLboolean GLAPIENTRY
7370 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
7371 GLboolean
* residences
)
7373 GET_CURRENT_CONTEXT(ctx
);
7374 FLUSH_VERTICES(ctx
, 0);
7375 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
7378 static void GLAPIENTRY
7379 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7381 GET_CURRENT_CONTEXT(ctx
);
7382 FLUSH_VERTICES(ctx
, 0);
7383 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7386 static void GLAPIENTRY
7387 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
7389 GET_CURRENT_CONTEXT(ctx
);
7390 FLUSH_VERTICES(ctx
, 0);
7391 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
7394 static void GLAPIENTRY
7395 exec_DisableClientState(GLenum cap
)
7397 GET_CURRENT_CONTEXT(ctx
);
7398 FLUSH_VERTICES(ctx
, 0);
7399 CALL_DisableClientState(ctx
->Exec
, (cap
));
7402 static void GLAPIENTRY
7403 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
7405 GET_CURRENT_CONTEXT(ctx
);
7406 FLUSH_VERTICES(ctx
, 0);
7407 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
7410 static void GLAPIENTRY
7411 exec_EnableClientState(GLenum cap
)
7413 GET_CURRENT_CONTEXT(ctx
);
7414 FLUSH_VERTICES(ctx
, 0);
7415 CALL_EnableClientState(ctx
->Exec
, (cap
));
7418 static void GLAPIENTRY
7419 exec_GenTextures(GLsizei n
, GLuint
* texName
)
7421 GET_CURRENT_CONTEXT(ctx
);
7422 FLUSH_VERTICES(ctx
, 0);
7423 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
7426 static void GLAPIENTRY
7427 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
7429 GET_CURRENT_CONTEXT(ctx
);
7430 FLUSH_VERTICES(ctx
, 0);
7431 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
7434 static void GLAPIENTRY
7435 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7437 GET_CURRENT_CONTEXT(ctx
);
7438 FLUSH_VERTICES(ctx
, 0);
7439 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
7442 static void GLAPIENTRY
7443 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
7445 GET_CURRENT_CONTEXT(ctx
);
7446 FLUSH_VERTICES(ctx
, 0);
7447 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
7450 static GLboolean GLAPIENTRY
7451 exec_IsTexture(GLuint texture
)
7453 GET_CURRENT_CONTEXT(ctx
);
7454 FLUSH_VERTICES(ctx
, 0);
7455 return CALL_IsTexture(ctx
->Exec
, (texture
));
7458 static void GLAPIENTRY
7459 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7461 GET_CURRENT_CONTEXT(ctx
);
7462 FLUSH_VERTICES(ctx
, 0);
7463 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
7466 static void GLAPIENTRY
7467 exec_PopClientAttrib(void)
7469 GET_CURRENT_CONTEXT(ctx
);
7470 FLUSH_VERTICES(ctx
, 0);
7471 CALL_PopClientAttrib(ctx
->Exec
, ());
7474 static void GLAPIENTRY
7475 exec_PushClientAttrib(GLbitfield mask
)
7477 GET_CURRENT_CONTEXT(ctx
);
7478 FLUSH_VERTICES(ctx
, 0);
7479 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
7482 static void GLAPIENTRY
7483 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
7486 GET_CURRENT_CONTEXT(ctx
);
7487 FLUSH_VERTICES(ctx
, 0);
7488 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7491 static void GLAPIENTRY
7492 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
7494 GET_CURRENT_CONTEXT(ctx
);
7495 FLUSH_VERTICES(ctx
, 0);
7496 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
7499 static void GLAPIENTRY
7500 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
7503 GET_CURRENT_CONTEXT(ctx
);
7504 FLUSH_VERTICES(ctx
, 0);
7505 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7508 static void GLAPIENTRY
7509 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
7510 GLint x
, GLint y
, GLsizei width
)
7512 GET_CURRENT_CONTEXT(ctx
);
7513 FLUSH_VERTICES(ctx
, 0);
7514 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
7515 (target
, internalFormat
, x
, y
, width
));
7518 static void GLAPIENTRY
7519 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
7520 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
7522 GET_CURRENT_CONTEXT(ctx
);
7523 FLUSH_VERTICES(ctx
, 0);
7524 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
7525 (target
, internalFormat
, x
, y
, width
,
7529 static void GLAPIENTRY
7530 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
7532 GET_CURRENT_CONTEXT(ctx
);
7533 FLUSH_VERTICES(ctx
, 0);
7534 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
7537 static void GLAPIENTRY
7538 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7540 GET_CURRENT_CONTEXT(ctx
);
7541 FLUSH_VERTICES(ctx
, 0);
7542 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
7545 static void GLAPIENTRY
7546 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7548 GET_CURRENT_CONTEXT(ctx
);
7549 FLUSH_VERTICES(ctx
, 0);
7550 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
7553 static void GLAPIENTRY
7554 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
7557 GET_CURRENT_CONTEXT(ctx
);
7558 FLUSH_VERTICES(ctx
, 0);
7559 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
7562 static void GLAPIENTRY
7563 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7565 GET_CURRENT_CONTEXT(ctx
);
7566 FLUSH_VERTICES(ctx
, 0);
7567 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
7570 static void GLAPIENTRY
7571 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7573 GET_CURRENT_CONTEXT(ctx
);
7574 FLUSH_VERTICES(ctx
, 0);
7575 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
7578 static void GLAPIENTRY
7579 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
7580 GLenum type
, GLvoid
*values
)
7582 GET_CURRENT_CONTEXT(ctx
);
7583 FLUSH_VERTICES(ctx
, 0);
7584 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7587 static void GLAPIENTRY
7588 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7590 GET_CURRENT_CONTEXT(ctx
);
7591 FLUSH_VERTICES(ctx
, 0);
7592 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
7595 static void GLAPIENTRY
7596 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7598 GET_CURRENT_CONTEXT(ctx
);
7599 FLUSH_VERTICES(ctx
, 0);
7600 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
7603 static void GLAPIENTRY
7604 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
7605 GLenum type
, GLvoid
*values
)
7607 GET_CURRENT_CONTEXT(ctx
);
7608 FLUSH_VERTICES(ctx
, 0);
7609 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7612 static void GLAPIENTRY
7613 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7615 GET_CURRENT_CONTEXT(ctx
);
7616 FLUSH_VERTICES(ctx
, 0);
7617 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
7620 static void GLAPIENTRY
7621 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7623 GET_CURRENT_CONTEXT(ctx
);
7624 FLUSH_VERTICES(ctx
, 0);
7625 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
7628 static void GLAPIENTRY
7629 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
7630 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
7632 GET_CURRENT_CONTEXT(ctx
);
7633 FLUSH_VERTICES(ctx
, 0);
7634 CALL_GetSeparableFilter(ctx
->Exec
,
7635 (target
, format
, type
, row
, column
, span
));
7638 static void GLAPIENTRY
7639 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
7640 GLsizei width
, GLsizei height
, GLenum format
,
7641 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
7643 GET_CURRENT_CONTEXT(ctx
);
7644 FLUSH_VERTICES(ctx
, 0);
7645 CALL_SeparableFilter2D(ctx
->Exec
,
7646 (target
, internalFormat
, width
, height
, format
,
7647 type
, row
, column
));
7650 static void GLAPIENTRY
7651 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7652 GLsizei count
, const GLvoid
*ptr
)
7654 GET_CURRENT_CONTEXT(ctx
);
7655 FLUSH_VERTICES(ctx
, 0);
7656 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7659 static void GLAPIENTRY
7660 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
7662 GET_CURRENT_CONTEXT(ctx
);
7663 FLUSH_VERTICES(ctx
, 0);
7664 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
7667 static void GLAPIENTRY
7668 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7671 GET_CURRENT_CONTEXT(ctx
);
7672 FLUSH_VERTICES(ctx
, 0);
7673 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
7676 static void GLAPIENTRY
7677 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7680 GET_CURRENT_CONTEXT(ctx
);
7681 FLUSH_VERTICES(ctx
, 0);
7682 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
7685 static void GLAPIENTRY
7686 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7687 GLsizei count
, const GLvoid
*ptr
)
7689 GET_CURRENT_CONTEXT(ctx
);
7690 FLUSH_VERTICES(ctx
, 0);
7691 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7694 static void GLAPIENTRY
7695 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7696 GLsizei count
, const GLvoid
*ptr
)
7698 GET_CURRENT_CONTEXT(ctx
);
7699 FLUSH_VERTICES(ctx
, 0);
7700 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7703 static void GLAPIENTRY
7704 exec_LockArraysEXT(GLint first
, GLsizei count
)
7706 GET_CURRENT_CONTEXT(ctx
);
7707 FLUSH_VERTICES(ctx
, 0);
7708 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
7711 static void GLAPIENTRY
7712 exec_UnlockArraysEXT(void)
7714 GET_CURRENT_CONTEXT(ctx
);
7715 FLUSH_VERTICES(ctx
, 0);
7716 CALL_UnlockArraysEXT(ctx
->Exec
, ());
7719 static void GLAPIENTRY
7720 exec_ClientActiveTextureARB(GLenum target
)
7722 GET_CURRENT_CONTEXT(ctx
);
7723 FLUSH_VERTICES(ctx
, 0);
7724 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
7727 static void GLAPIENTRY
7728 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
7729 GLsizei stride
, const GLvoid
*ptr
)
7731 GET_CURRENT_CONTEXT(ctx
);
7732 FLUSH_VERTICES(ctx
, 0);
7733 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
7736 static void GLAPIENTRY
7737 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7739 GET_CURRENT_CONTEXT(ctx
);
7740 FLUSH_VERTICES(ctx
, 0);
7741 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
7744 /* GL_EXT_multi_draw_arrays */
7745 static void GLAPIENTRY
7746 exec_MultiDrawArraysEXT(GLenum mode
, GLint
* first
,
7747 GLsizei
* count
, GLsizei primcount
)
7749 GET_CURRENT_CONTEXT(ctx
);
7750 FLUSH_VERTICES(ctx
, 0);
7751 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
7754 /* GL_IBM_multimode_draw_arrays */
7755 static void GLAPIENTRY
7756 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
7757 const GLsizei
* count
, GLsizei primcount
,
7760 GET_CURRENT_CONTEXT(ctx
);
7761 FLUSH_VERTICES(ctx
, 0);
7762 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
7763 (mode
, first
, count
, primcount
, modestride
));
7766 /* GL_IBM_multimode_draw_arrays */
7767 static void GLAPIENTRY
7768 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
7769 const GLsizei
* count
,
7771 const GLvoid
* const *indices
,
7772 GLsizei primcount
, GLint modestride
)
7774 GET_CURRENT_CONTEXT(ctx
);
7775 FLUSH_VERTICES(ctx
, 0);
7776 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
7777 (mode
, count
, type
, indices
, primcount
,
7784 * Setup the given dispatch table to point to Mesa's display list
7785 * building functions.
7787 * This does not include any of the tnl functions - they are
7788 * initialized from _mesa_init_api_defaults and from the active vtxfmt
7792 _mesa_init_dlist_table(struct _glapi_table
*table
)
7794 _mesa_loopback_init_api_table(table
);
7797 SET_Accum(table
, save_Accum
);
7798 SET_AlphaFunc(table
, save_AlphaFunc
);
7799 SET_Bitmap(table
, save_Bitmap
);
7800 SET_BlendFunc(table
, save_BlendFunc
);
7801 SET_CallList(table
, _mesa_save_CallList
);
7802 SET_CallLists(table
, _mesa_save_CallLists
);
7803 SET_Clear(table
, save_Clear
);
7804 SET_ClearAccum(table
, save_ClearAccum
);
7805 SET_ClearColor(table
, save_ClearColor
);
7806 SET_ClearDepth(table
, save_ClearDepth
);
7807 SET_ClearIndex(table
, save_ClearIndex
);
7808 SET_ClearStencil(table
, save_ClearStencil
);
7809 SET_ClipPlane(table
, save_ClipPlane
);
7810 SET_ColorMask(table
, save_ColorMask
);
7811 SET_ColorMaterial(table
, save_ColorMaterial
);
7812 SET_CopyPixels(table
, save_CopyPixels
);
7813 SET_CullFace(table
, save_CullFace
);
7814 SET_DeleteLists(table
, _mesa_DeleteLists
);
7815 SET_DepthFunc(table
, save_DepthFunc
);
7816 SET_DepthMask(table
, save_DepthMask
);
7817 SET_DepthRange(table
, save_DepthRange
);
7818 SET_Disable(table
, save_Disable
);
7819 SET_DrawBuffer(table
, save_DrawBuffer
);
7820 SET_DrawPixels(table
, save_DrawPixels
);
7821 SET_Enable(table
, save_Enable
);
7822 SET_EndList(table
, _mesa_EndList
);
7823 SET_EvalMesh1(table
, _mesa_save_EvalMesh1
);
7824 SET_EvalMesh2(table
, _mesa_save_EvalMesh2
);
7825 SET_Finish(table
, exec_Finish
);
7826 SET_Flush(table
, exec_Flush
);
7827 SET_Fogf(table
, save_Fogf
);
7828 SET_Fogfv(table
, save_Fogfv
);
7829 SET_Fogi(table
, save_Fogi
);
7830 SET_Fogiv(table
, save_Fogiv
);
7831 SET_FrontFace(table
, save_FrontFace
);
7832 SET_Frustum(table
, save_Frustum
);
7833 SET_GenLists(table
, _mesa_GenLists
);
7834 SET_GetBooleanv(table
, exec_GetBooleanv
);
7835 SET_GetClipPlane(table
, exec_GetClipPlane
);
7836 SET_GetDoublev(table
, exec_GetDoublev
);
7837 SET_GetError(table
, exec_GetError
);
7838 SET_GetFloatv(table
, exec_GetFloatv
);
7839 SET_GetIntegerv(table
, exec_GetIntegerv
);
7840 SET_GetLightfv(table
, exec_GetLightfv
);
7841 SET_GetLightiv(table
, exec_GetLightiv
);
7842 SET_GetMapdv(table
, exec_GetMapdv
);
7843 SET_GetMapfv(table
, exec_GetMapfv
);
7844 SET_GetMapiv(table
, exec_GetMapiv
);
7845 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
7846 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
7847 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
7848 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
7849 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
7850 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
7851 SET_GetString(table
, exec_GetString
);
7852 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
7853 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
7854 SET_GetTexGendv(table
, exec_GetTexGendv
);
7855 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
7856 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
7857 SET_GetTexImage(table
, exec_GetTexImage
);
7858 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
7859 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
7860 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
7861 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
7862 SET_Hint(table
, save_Hint
);
7863 SET_IndexMask(table
, save_IndexMask
);
7864 SET_InitNames(table
, save_InitNames
);
7865 SET_IsEnabled(table
, exec_IsEnabled
);
7866 SET_IsList(table
, _mesa_IsList
);
7867 SET_LightModelf(table
, save_LightModelf
);
7868 SET_LightModelfv(table
, save_LightModelfv
);
7869 SET_LightModeli(table
, save_LightModeli
);
7870 SET_LightModeliv(table
, save_LightModeliv
);
7871 SET_Lightf(table
, save_Lightf
);
7872 SET_Lightfv(table
, save_Lightfv
);
7873 SET_Lighti(table
, save_Lighti
);
7874 SET_Lightiv(table
, save_Lightiv
);
7875 SET_LineStipple(table
, save_LineStipple
);
7876 SET_LineWidth(table
, save_LineWidth
);
7877 SET_ListBase(table
, save_ListBase
);
7878 SET_LoadIdentity(table
, save_LoadIdentity
);
7879 SET_LoadMatrixd(table
, save_LoadMatrixd
);
7880 SET_LoadMatrixf(table
, save_LoadMatrixf
);
7881 SET_LoadName(table
, save_LoadName
);
7882 SET_LogicOp(table
, save_LogicOp
);
7883 SET_Map1d(table
, save_Map1d
);
7884 SET_Map1f(table
, save_Map1f
);
7885 SET_Map2d(table
, save_Map2d
);
7886 SET_Map2f(table
, save_Map2f
);
7887 SET_MapGrid1d(table
, save_MapGrid1d
);
7888 SET_MapGrid1f(table
, save_MapGrid1f
);
7889 SET_MapGrid2d(table
, save_MapGrid2d
);
7890 SET_MapGrid2f(table
, save_MapGrid2f
);
7891 SET_MatrixMode(table
, save_MatrixMode
);
7892 SET_MultMatrixd(table
, save_MultMatrixd
);
7893 SET_MultMatrixf(table
, save_MultMatrixf
);
7894 SET_NewList(table
, save_NewList
);
7895 SET_Ortho(table
, save_Ortho
);
7896 SET_PassThrough(table
, save_PassThrough
);
7897 SET_PixelMapfv(table
, save_PixelMapfv
);
7898 SET_PixelMapuiv(table
, save_PixelMapuiv
);
7899 SET_PixelMapusv(table
, save_PixelMapusv
);
7900 SET_PixelStoref(table
, exec_PixelStoref
);
7901 SET_PixelStorei(table
, exec_PixelStorei
);
7902 SET_PixelTransferf(table
, save_PixelTransferf
);
7903 SET_PixelTransferi(table
, save_PixelTransferi
);
7904 SET_PixelZoom(table
, save_PixelZoom
);
7905 SET_PointSize(table
, save_PointSize
);
7906 SET_PolygonMode(table
, save_PolygonMode
);
7907 SET_PolygonOffset(table
, save_PolygonOffset
);
7908 SET_PolygonStipple(table
, save_PolygonStipple
);
7909 SET_PopAttrib(table
, save_PopAttrib
);
7910 SET_PopMatrix(table
, save_PopMatrix
);
7911 SET_PopName(table
, save_PopName
);
7912 SET_PushAttrib(table
, save_PushAttrib
);
7913 SET_PushMatrix(table
, save_PushMatrix
);
7914 SET_PushName(table
, save_PushName
);
7915 SET_RasterPos2d(table
, save_RasterPos2d
);
7916 SET_RasterPos2dv(table
, save_RasterPos2dv
);
7917 SET_RasterPos2f(table
, save_RasterPos2f
);
7918 SET_RasterPos2fv(table
, save_RasterPos2fv
);
7919 SET_RasterPos2i(table
, save_RasterPos2i
);
7920 SET_RasterPos2iv(table
, save_RasterPos2iv
);
7921 SET_RasterPos2s(table
, save_RasterPos2s
);
7922 SET_RasterPos2sv(table
, save_RasterPos2sv
);
7923 SET_RasterPos3d(table
, save_RasterPos3d
);
7924 SET_RasterPos3dv(table
, save_RasterPos3dv
);
7925 SET_RasterPos3f(table
, save_RasterPos3f
);
7926 SET_RasterPos3fv(table
, save_RasterPos3fv
);
7927 SET_RasterPos3i(table
, save_RasterPos3i
);
7928 SET_RasterPos3iv(table
, save_RasterPos3iv
);
7929 SET_RasterPos3s(table
, save_RasterPos3s
);
7930 SET_RasterPos3sv(table
, save_RasterPos3sv
);
7931 SET_RasterPos4d(table
, save_RasterPos4d
);
7932 SET_RasterPos4dv(table
, save_RasterPos4dv
);
7933 SET_RasterPos4f(table
, save_RasterPos4f
);
7934 SET_RasterPos4fv(table
, save_RasterPos4fv
);
7935 SET_RasterPos4i(table
, save_RasterPos4i
);
7936 SET_RasterPos4iv(table
, save_RasterPos4iv
);
7937 SET_RasterPos4s(table
, save_RasterPos4s
);
7938 SET_RasterPos4sv(table
, save_RasterPos4sv
);
7939 SET_ReadBuffer(table
, save_ReadBuffer
);
7940 SET_ReadPixels(table
, exec_ReadPixels
);
7941 SET_RenderMode(table
, exec_RenderMode
);
7942 SET_Rotated(table
, save_Rotated
);
7943 SET_Rotatef(table
, save_Rotatef
);
7944 SET_Scaled(table
, save_Scaled
);
7945 SET_Scalef(table
, save_Scalef
);
7946 SET_Scissor(table
, save_Scissor
);
7947 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
7948 SET_SelectBuffer(table
, exec_SelectBuffer
);
7949 SET_ShadeModel(table
, save_ShadeModel
);
7950 SET_StencilFunc(table
, save_StencilFunc
);
7951 SET_StencilMask(table
, save_StencilMask
);
7952 SET_StencilOp(table
, save_StencilOp
);
7953 SET_TexEnvf(table
, save_TexEnvf
);
7954 SET_TexEnvfv(table
, save_TexEnvfv
);
7955 SET_TexEnvi(table
, save_TexEnvi
);
7956 SET_TexEnviv(table
, save_TexEnviv
);
7957 SET_TexGend(table
, save_TexGend
);
7958 SET_TexGendv(table
, save_TexGendv
);
7959 SET_TexGenf(table
, save_TexGenf
);
7960 SET_TexGenfv(table
, save_TexGenfv
);
7961 SET_TexGeni(table
, save_TexGeni
);
7962 SET_TexGeniv(table
, save_TexGeniv
);
7963 SET_TexImage1D(table
, save_TexImage1D
);
7964 SET_TexImage2D(table
, save_TexImage2D
);
7965 SET_TexParameterf(table
, save_TexParameterf
);
7966 SET_TexParameterfv(table
, save_TexParameterfv
);
7967 SET_TexParameteri(table
, save_TexParameteri
);
7968 SET_TexParameteriv(table
, save_TexParameteriv
);
7969 SET_Translated(table
, save_Translated
);
7970 SET_Translatef(table
, save_Translatef
);
7971 SET_Viewport(table
, save_Viewport
);
7974 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
7975 SET_BindTexture(table
, save_BindTexture
);
7976 SET_ColorPointer(table
, exec_ColorPointer
);
7977 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
7978 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
7979 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
7980 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
7981 SET_DeleteTextures(table
, exec_DeleteTextures
);
7982 SET_DisableClientState(table
, exec_DisableClientState
);
7983 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
7984 SET_EnableClientState(table
, exec_EnableClientState
);
7985 SET_GenTextures(table
, exec_GenTextures
);
7986 SET_GetPointerv(table
, exec_GetPointerv
);
7987 SET_IndexPointer(table
, exec_IndexPointer
);
7988 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
7989 SET_IsTexture(table
, exec_IsTexture
);
7990 SET_NormalPointer(table
, exec_NormalPointer
);
7991 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
7992 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
7993 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
7994 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
7995 SET_TexSubImage1D(table
, save_TexSubImage1D
);
7996 SET_TexSubImage2D(table
, save_TexSubImage2D
);
7997 SET_VertexPointer(table
, exec_VertexPointer
);
8000 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
8001 SET_TexImage3D(table
, save_TexImage3D
);
8002 SET_TexSubImage3D(table
, save_TexSubImage3D
);
8005 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
8006 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
8007 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
8009 /* ATI_separate_stencil */
8010 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
8012 /* GL_ARB_imaging */
8013 /* Not all are supported */
8014 SET_BlendColor(table
, save_BlendColor
);
8015 SET_BlendEquation(table
, save_BlendEquation
);
8016 SET_ColorSubTable(table
, save_ColorSubTable
);
8017 SET_ColorTable(table
, save_ColorTable
);
8018 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
8019 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
8020 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
8021 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
8022 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
8023 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
8024 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
8025 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
8026 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
8027 SET_CopyColorTable(table
, save_CopyColorTable
);
8028 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
8029 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
8030 SET_GetColorTable(table
, exec_GetColorTable
);
8031 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
8032 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
8033 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
8034 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
8035 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
8036 SET_GetHistogram(table
, exec_GetHistogram
);
8037 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
8038 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
8039 SET_GetMinmax(table
, exec_GetMinmax
);
8040 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
8041 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
8042 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
8043 SET_Histogram(table
, save_Histogram
);
8044 SET_Minmax(table
, save_Minmax
);
8045 SET_ResetHistogram(table
, save_ResetHistogram
);
8046 SET_ResetMinmax(table
, save_ResetMinmax
);
8047 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
8049 /* 2. GL_EXT_blend_color */
8051 SET_BlendColorEXT(table
, save_BlendColorEXT
);
8054 /* 3. GL_EXT_polygon_offset */
8055 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
8057 /* 6. GL_EXT_texture3d */
8059 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
8060 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
8061 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
8064 /* 14. GL_SGI_color_table */
8066 SET_ColorTableSGI(table
, save_ColorTable
);
8067 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
8068 SET_GetColorTableSGI(table
, exec_GetColorTable
);
8069 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
8070 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
8073 /* 30. GL_EXT_vertex_array */
8074 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
8075 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
8076 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
8077 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
8078 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
8079 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
8081 /* 37. GL_EXT_blend_minmax */
8083 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
8086 /* 54. GL_EXT_point_parameters */
8087 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
8088 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
8090 /* 97. GL_EXT_compiled_vertex_array */
8091 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
8092 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
8094 /* 145. GL_EXT_secondary_color */
8095 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
8097 /* 148. GL_EXT_multi_draw_arrays */
8098 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
8100 /* 149. GL_EXT_fog_coord */
8101 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
8103 /* 173. GL_EXT_blend_func_separate */
8104 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
8106 /* 196. GL_MESA_resize_buffers */
8107 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
8109 /* 197. GL_MESA_window_pos */
8110 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
8111 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
8112 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
8113 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
8114 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
8115 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
8116 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
8117 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
8118 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
8119 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
8120 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
8121 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
8122 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
8123 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
8124 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
8125 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
8126 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
8127 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
8128 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
8129 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
8130 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
8131 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
8132 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
8133 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
8135 /* 200. GL_IBM_multimode_draw_arrays */
8136 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
8137 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
8139 #if FEATURE_NV_vertex_program
8140 /* 233. GL_NV_vertex_program */
8141 /* The following commands DO NOT go into display lists:
8142 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
8143 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
8145 SET_BindProgramNV(table
, save_BindProgramNV
);
8146 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8147 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
8148 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8149 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
8150 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
8151 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
8152 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
8153 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
8154 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
8155 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
8156 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8157 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8158 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8159 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8160 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
8161 SET_LoadProgramNV(table
, save_LoadProgramNV
);
8162 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
8163 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
8164 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
8165 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
8166 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
8167 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
8168 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
8169 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
8172 /* 244. GL_ATI_envmap_bumpmap */
8173 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
8174 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
8176 /* 245. GL_ATI_fragment_shader */
8177 #if FEATURE_ATI_fragment_shader
8178 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
8179 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
8182 /* 282. GL_NV_fragment_program */
8183 #if FEATURE_NV_fragment_program
8184 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
8185 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
8186 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
8187 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
8188 SET_GetProgramNamedParameterfvNV(table
,
8189 _mesa_GetProgramNamedParameterfvNV
);
8190 SET_GetProgramNamedParameterdvNV(table
,
8191 _mesa_GetProgramNamedParameterdvNV
);
8192 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8193 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8194 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8195 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8196 SET_GetProgramLocalParameterdvARB(table
,
8197 _mesa_GetProgramLocalParameterdvARB
);
8198 SET_GetProgramLocalParameterfvARB(table
,
8199 _mesa_GetProgramLocalParameterfvARB
);
8202 /* 262. GL_NV_point_sprite */
8203 SET_PointParameteriNV(table
, save_PointParameteriNV
);
8204 SET_PointParameterivNV(table
, save_PointParameterivNV
);
8206 /* 268. GL_EXT_stencil_two_side */
8207 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
8209 /* 273. GL_APPLE_vertex_array_object */
8210 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
8211 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
8212 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
8213 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
8215 /* ???. GL_EXT_depth_bounds_test */
8216 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
8218 /* ARB 1. GL_ARB_multitexture */
8219 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
8220 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
8222 /* ARB 3. GL_ARB_transpose_matrix */
8223 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
8224 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
8225 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
8226 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
8228 /* ARB 5. GL_ARB_multisample */
8229 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
8231 /* ARB 12. GL_ARB_texture_compression */
8232 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
8233 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
8234 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
8235 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
8236 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
8237 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
8238 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
8240 /* ARB 14. GL_ARB_point_parameters */
8241 /* aliased with EXT_point_parameters functions */
8243 /* ARB 25. GL_ARB_window_pos */
8244 /* aliased with MESA_window_pos functions */
8246 /* ARB 26. GL_ARB_vertex_program */
8247 /* ARB 27. GL_ARB_fragment_program */
8248 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8249 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
8250 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
8251 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
8252 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
8253 SET_ProgramStringARB(table
, save_ProgramStringARB
);
8254 SET_BindProgramNV(table
, save_BindProgramNV
);
8255 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8256 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8257 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
8258 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8259 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8260 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8261 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8262 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
8263 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
8264 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
8265 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
8266 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8267 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8268 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8269 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8270 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
8271 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
8272 SET_GetProgramLocalParameterdvARB(table
,
8273 _mesa_GetProgramLocalParameterdvARB
);
8274 SET_GetProgramLocalParameterfvARB(table
,
8275 _mesa_GetProgramLocalParameterfvARB
);
8276 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
8277 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
8280 /* ARB 28. GL_ARB_vertex_buffer_object */
8281 #if FEATURE_ARB_vertex_buffer_object
8282 /* None of the extension's functions get compiled */
8283 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
8284 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
8285 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
8286 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
8287 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
8288 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
8289 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
8290 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
8291 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
8292 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
8293 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
8296 #if FEATURE_ARB_occlusion_query
8297 SET_BeginQueryARB(table
, save_BeginQueryARB
);
8298 SET_EndQueryARB(table
, save_EndQueryARB
);
8299 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
8300 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
8301 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
8302 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
8303 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
8304 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
8306 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
8308 #if FEATURE_EXT_framebuffer_blit
8309 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
8312 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
8313 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
8314 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
8315 /* XXX additional functions need to be implemented here! */
8317 /* 299. GL_EXT_blend_equation_separate */
8318 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
8320 /* GL_EXT_gpu_program_parmaeters */
8321 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8322 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
8323 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
8326 /* ARB 50. GL_ARB_map_buffer_range */
8327 #if FEATURE_ARB_map_buffer_range
8328 SET_MapBufferRange(table
, _mesa_MapBufferRange
); /* no dlist save */
8329 SET_FlushMappedBufferRange(table
, _mesa_FlushMappedBufferRange
); /* no dl */
8332 /* ARB 59. GL_ARB_copy_buffer */
8333 SET_CopyBufferSubData(table
, _mesa_CopyBufferSubData
); /* no dlist save */
8335 /* 364. GL_EXT_provoking_vertex */
8336 SET_ProvokingVertexEXT(table
, save_ProvokingVertexEXT
);
8342 enum_string(GLenum k
)
8344 return _mesa_lookup_enum_by_nr(k
);
8349 * Print the commands in a display list. For debugging only.
8350 * TODO: many commands aren't handled yet.
8352 static void GLAPIENTRY
8353 print_list(GLcontext
*ctx
, GLuint list
)
8355 struct gl_display_list
*dlist
;
8359 if (!islist(ctx
, list
)) {
8360 _mesa_printf("%u is not a display list ID\n", list
);
8364 dlist
= lookup_list(ctx
, list
);
8370 _mesa_printf("START-LIST %u, address %p\n", list
, (void *) n
);
8372 done
= n
? GL_FALSE
: GL_TRUE
;
8374 OpCode opcode
= n
[0].opcode
;
8375 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
8377 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
8378 /* this is a driver-extended opcode */
8379 ctx
->ListExt
.Opcode
[i
].Print(ctx
, &n
[1]);
8380 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
8385 _mesa_printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
8388 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
8389 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
8391 case OPCODE_CALL_LIST
:
8392 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
8394 case OPCODE_CALL_LIST_OFFSET
:
8395 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
8396 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
8398 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
8399 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
8400 enum_string(n
[1].e
), enum_string(n
[2].e
),
8401 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8403 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
8404 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
8405 enum_string(n
[1].e
), enum_string(n
[2].e
),
8406 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
8408 case OPCODE_DISABLE
:
8409 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
8412 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
8414 case OPCODE_FRUSTUM
:
8415 _mesa_printf("Frustum %g %g %g %g %g %g\n",
8416 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8418 case OPCODE_LINE_STIPPLE
:
8419 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
8421 case OPCODE_LOAD_IDENTITY
:
8422 _mesa_printf("LoadIdentity\n");
8424 case OPCODE_LOAD_MATRIX
:
8425 _mesa_printf("LoadMatrix\n");
8426 _mesa_printf(" %8f %8f %8f %8f\n",
8427 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8428 _mesa_printf(" %8f %8f %8f %8f\n",
8429 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8430 _mesa_printf(" %8f %8f %8f %8f\n",
8431 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8432 _mesa_printf(" %8f %8f %8f %8f\n",
8433 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8435 case OPCODE_MULT_MATRIX
:
8436 _mesa_printf("MultMatrix (or Rotate)\n");
8437 _mesa_printf(" %8f %8f %8f %8f\n",
8438 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8439 _mesa_printf(" %8f %8f %8f %8f\n",
8440 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8441 _mesa_printf(" %8f %8f %8f %8f\n",
8442 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8443 _mesa_printf(" %8f %8f %8f %8f\n",
8444 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8447 _mesa_printf("Ortho %g %g %g %g %g %g\n",
8448 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8450 case OPCODE_POP_ATTRIB
:
8451 _mesa_printf("PopAttrib\n");
8453 case OPCODE_POP_MATRIX
:
8454 _mesa_printf("PopMatrix\n");
8456 case OPCODE_POP_NAME
:
8457 _mesa_printf("PopName\n");
8459 case OPCODE_PUSH_ATTRIB
:
8460 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
8462 case OPCODE_PUSH_MATRIX
:
8463 _mesa_printf("PushMatrix\n");
8465 case OPCODE_PUSH_NAME
:
8466 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
8468 case OPCODE_RASTER_POS
:
8469 _mesa_printf("RasterPos %g %g %g %g\n",
8470 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8473 _mesa_printf("Rotate %g %g %g %g\n",
8474 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8477 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8479 case OPCODE_TRANSLATE
:
8480 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8482 case OPCODE_BIND_TEXTURE
:
8483 _mesa_printf("BindTexture %s %d\n",
8484 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
8486 case OPCODE_SHADE_MODEL
:
8487 _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
8490 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
8491 _mesa_lookup_enum_by_nr(n
[1].ui
),
8492 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
8495 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
8496 _mesa_lookup_enum_by_nr(n
[1].ui
),
8497 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
8498 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
8500 case OPCODE_MAPGRID1
:
8501 _mesa_printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
8503 case OPCODE_MAPGRID2
:
8504 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
8505 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
8507 case OPCODE_EVALMESH1
:
8508 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
8510 case OPCODE_EVALMESH2
:
8511 _mesa_printf("EvalMesh2 %d %d %d %d\n",
8512 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
8515 case OPCODE_ATTR_1F_NV
:
8516 _mesa_printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
8518 case OPCODE_ATTR_2F_NV
:
8519 _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
8520 n
[1].i
, n
[2].f
, n
[3].f
);
8522 case OPCODE_ATTR_3F_NV
:
8523 _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
8524 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8526 case OPCODE_ATTR_4F_NV
:
8527 _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
8528 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8530 case OPCODE_ATTR_1F_ARB
:
8531 _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
8533 case OPCODE_ATTR_2F_ARB
:
8534 _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
8535 n
[1].i
, n
[2].f
, n
[3].f
);
8537 case OPCODE_ATTR_3F_ARB
:
8538 _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
8539 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8541 case OPCODE_ATTR_4F_ARB
:
8542 _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
8543 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8546 case OPCODE_MATERIAL
:
8547 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
8548 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8551 _mesa_printf("BEGIN %x\n", n
[1].i
);
8554 _mesa_printf("END\n");
8557 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
8560 case OPCODE_EVAL_C1
:
8561 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
8563 case OPCODE_EVAL_C2
:
8564 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
8566 case OPCODE_EVAL_P1
:
8567 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
8569 case OPCODE_EVAL_P2
:
8570 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
8573 case OPCODE_PROVOKING_VERTEX
:
8574 _mesa_printf("ProvokingVertex %s\n",
8575 _mesa_lookup_enum_by_nr(n
[1].ui
));
8579 * meta opcodes/commands
8582 _mesa_printf("Error: %s %s\n",
8583 enum_string(n
[1].e
), (const char *) n
[2].data
);
8585 case OPCODE_CONTINUE
:
8586 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
8587 n
= (Node
*) n
[1].next
;
8589 case OPCODE_END_OF_LIST
:
8590 _mesa_printf("END-LIST %u\n", list
);
8594 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
8596 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
8597 opcode
, (void *) n
);
8601 _mesa_printf("command %d, %u operands\n", opcode
,
8605 /* increment n to point to next compiled command */
8606 if (opcode
!= OPCODE_CONTINUE
) {
8607 n
+= InstSize
[opcode
];
8616 * Clients may call this function to help debug display list problems.
8617 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
8618 * changed, or break in the future without notice.
8621 mesa_print_display_list(GLuint list
)
8623 GET_CURRENT_CONTEXT(ctx
);
8624 print_list(ctx
, list
);
8628 /**********************************************************************/
8629 /***** Initialization *****/
8630 /**********************************************************************/
8633 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
8635 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
8636 vfmt
->Begin
= save_Begin
;
8637 vfmt
->CallList
= _mesa_save_CallList
;
8638 vfmt
->CallLists
= _mesa_save_CallLists
;
8639 vfmt
->Color3f
= save_Color3f
;
8640 vfmt
->Color3fv
= save_Color3fv
;
8641 vfmt
->Color4f
= save_Color4f
;
8642 vfmt
->Color4fv
= save_Color4fv
;
8643 vfmt
->EdgeFlag
= save_EdgeFlag
;
8644 vfmt
->End
= save_End
;
8645 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
8646 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
8647 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
8648 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
8649 vfmt
->EvalPoint1
= save_EvalPoint1
;
8650 vfmt
->EvalPoint2
= save_EvalPoint2
;
8651 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
8652 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
8653 vfmt
->Indexf
= save_Indexf
;
8654 vfmt
->Indexfv
= save_Indexfv
;
8655 vfmt
->Materialfv
= save_Materialfv
;
8656 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
8657 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
8658 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
8659 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
8660 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
8661 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
8662 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
8663 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
8664 vfmt
->Normal3f
= save_Normal3f
;
8665 vfmt
->Normal3fv
= save_Normal3fv
;
8666 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
8667 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
8668 vfmt
->TexCoord1f
= save_TexCoord1f
;
8669 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
8670 vfmt
->TexCoord2f
= save_TexCoord2f
;
8671 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
8672 vfmt
->TexCoord3f
= save_TexCoord3f
;
8673 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
8674 vfmt
->TexCoord4f
= save_TexCoord4f
;
8675 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
8676 vfmt
->Vertex2f
= save_Vertex2f
;
8677 vfmt
->Vertex2fv
= save_Vertex2fv
;
8678 vfmt
->Vertex3f
= save_Vertex3f
;
8679 vfmt
->Vertex3fv
= save_Vertex3fv
;
8680 vfmt
->Vertex4f
= save_Vertex4f
;
8681 vfmt
->Vertex4fv
= save_Vertex4fv
;
8682 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
8683 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
8684 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
8685 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
8686 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
8687 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
8688 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
8689 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
8690 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
8691 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
8692 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
8693 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
8694 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
8695 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
8696 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
8697 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
8699 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
8700 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
8701 vfmt
->Rectf
= save_Rectf
;
8703 /* The driver is required to implement these as
8704 * 1) They can probably do a better job.
8705 * 2) A lot of new mechanisms would have to be added to this module
8706 * to support it. That code would probably never get used,
8710 vfmt
->DrawArrays
= 0;
8711 vfmt
->DrawElements
= 0;
8712 vfmt
->DrawRangeElements
= 0;
8713 vfmt
->MultiDrawElemementsEXT
= 0;
8714 vfmt
->DrawElementsBaseVertex
= 0;
8715 vfmt
->DrawRangeElementsBaseVertex
= 0;
8716 vfmt
->MultiDrawElemementsBaseVertex
= 0;
8722 * Initialize display list state for given context.
8725 _mesa_init_display_list(GLcontext
*ctx
)
8727 static GLboolean tableInitialized
= GL_FALSE
;
8729 /* zero-out the instruction size table, just once */
8730 if (!tableInitialized
) {
8731 _mesa_bzero(InstSize
, sizeof(InstSize
));
8732 tableInitialized
= GL_TRUE
;
8736 ctx
->ListState
.CallDepth
= 0;
8737 ctx
->ExecuteFlag
= GL_TRUE
;
8738 ctx
->CompileFlag
= GL_FALSE
;
8739 ctx
->ListState
.CurrentBlock
= NULL
;
8740 ctx
->ListState
.CurrentPos
= 0;
8742 /* Display List group */
8743 ctx
->List
.ListBase
= 0;
8745 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);