2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2006 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 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
37 #include "arbprogram.h"
43 #if FEATURE_ARB_vertex_buffer_object
44 #include "bufferobj.h"
57 #include "extensions.h"
62 #include "histogram.h"
79 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
80 #include "nvprogram.h"
83 #if FEATURE_ATI_fragment_shader
84 #include "atifragshader.h"
87 #include "math/m_matrix.h"
88 #include "math/m_xform.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_PROGRAM_PARAMETER4F_NV
,
307 OPCODE_TRACK_MATRIX_NV
,
308 /* GL_NV_fragment_program */
309 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
310 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
311 /* GL_EXT_stencil_two_side */
312 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
313 /* GL_EXT_depth_bounds_test */
314 OPCODE_DEPTH_BOUNDS_EXT
,
315 /* GL_ARB_vertex/fragment_program */
316 OPCODE_PROGRAM_STRING_ARB
,
317 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
318 /* GL_ARB_occlusion_query */
319 OPCODE_BEGIN_QUERY_ARB
,
320 OPCODE_END_QUERY_ARB
,
321 /* GL_ARB_draw_buffers */
322 OPCODE_DRAW_BUFFERS_ARB
,
323 /* GL_ATI_fragment_shader */
324 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
325 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
327 OPCODE_STENCIL_FUNC_SEPARATE
,
328 OPCODE_STENCIL_OP_SEPARATE
,
329 OPCODE_STENCIL_MASK_SEPARATE
,
331 /* GL_EXT_framebuffer_blit */
332 OPCODE_BLIT_FRAMEBUFFER
,
334 /* Vertex attributes -- fallback for when optimized display
335 * list build isn't active.
356 /* The following three are meta instructions */
357 OPCODE_ERROR
, /* raise compiled-in error */
368 * Display list instructions are stored as sequences of "nodes". Nodes
369 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
370 * are linked together with a pointer.
372 * Each instruction in the display list is stored as a sequence of
373 * contiguous nodes in memory.
374 * Each node is the union of a variety of data types.
389 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
394 * How many nodes to allocate at a time.
396 * \note Reduced now that we hold vertices etc. elsewhere.
398 #define BLOCK_SIZE 256
403 * Number of nodes of storage needed for each instruction.
404 * Sizes for dynamically allocated opcodes are stored in the context struct.
406 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
408 void mesa_print_display_list(GLuint list
);
411 /**********************************************************************/
412 /***** Private *****/
413 /**********************************************************************/
417 * Make an empty display list. This is used by glGenLists() to
418 * reserve display list IDs.
420 static struct mesa_display_list
*
421 make_list(GLuint list
, GLuint count
)
423 struct mesa_display_list
*dlist
= CALLOC_STRUCT(mesa_display_list
);
425 dlist
->node
= (Node
*) _mesa_malloc(sizeof(Node
) * count
);
426 dlist
->node
[0].opcode
= OPCODE_END_OF_LIST
;
432 * Lookup function to just encapsulate casting.
434 static INLINE
struct mesa_display_list
*
435 lookup_list(GLcontext
*ctx
, GLuint list
)
437 return (struct mesa_display_list
*)
438 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
444 * Delete the named display list, but don't remove from hash table.
445 * \param dlist - display list pointer
448 _mesa_delete_list(GLcontext
*ctx
, struct mesa_display_list
*dlist
)
453 n
= block
= dlist
->node
;
455 done
= block
? GL_FALSE
: GL_TRUE
;
458 /* check for extension opcodes first */
460 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
461 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
462 ctx
->ListExt
.Opcode
[i
].Destroy(ctx
, &n
[1]);
463 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
466 switch (n
[0].opcode
) {
467 /* for some commands, we need to free malloc'd memory */
469 _mesa_free(n
[6].data
);
470 n
+= InstSize
[n
[0].opcode
];
473 _mesa_free(n
[10].data
);
474 n
+= InstSize
[n
[0].opcode
];
476 case OPCODE_DRAW_PIXELS
:
477 _mesa_free(n
[5].data
);
478 n
+= InstSize
[n
[0].opcode
];
481 _mesa_free(n
[7].data
);
482 n
+= InstSize
[n
[0].opcode
];
484 case OPCODE_COLOR_TABLE
:
485 _mesa_free(n
[6].data
);
486 n
+= InstSize
[n
[0].opcode
];
488 case OPCODE_COLOR_SUB_TABLE
:
489 _mesa_free(n
[6].data
);
490 n
+= InstSize
[n
[0].opcode
];
492 case OPCODE_CONVOLUTION_FILTER_1D
:
493 _mesa_free(n
[6].data
);
494 n
+= InstSize
[n
[0].opcode
];
496 case OPCODE_CONVOLUTION_FILTER_2D
:
497 _mesa_free(n
[7].data
);
498 n
+= InstSize
[n
[0].opcode
];
500 case OPCODE_POLYGON_STIPPLE
:
501 _mesa_free(n
[1].data
);
502 n
+= InstSize
[n
[0].opcode
];
504 case OPCODE_TEX_IMAGE1D
:
505 _mesa_free(n
[8].data
);
506 n
+= InstSize
[n
[0].opcode
];
508 case OPCODE_TEX_IMAGE2D
:
509 _mesa_free(n
[9].data
);
510 n
+= InstSize
[n
[0].opcode
];
512 case OPCODE_TEX_IMAGE3D
:
513 _mesa_free(n
[10].data
);
514 n
+= InstSize
[n
[0].opcode
];
516 case OPCODE_TEX_SUB_IMAGE1D
:
517 _mesa_free(n
[7].data
);
518 n
+= InstSize
[n
[0].opcode
];
520 case OPCODE_TEX_SUB_IMAGE2D
:
521 _mesa_free(n
[9].data
);
522 n
+= InstSize
[n
[0].opcode
];
524 case OPCODE_TEX_SUB_IMAGE3D
:
525 _mesa_free(n
[11].data
);
526 n
+= InstSize
[n
[0].opcode
];
528 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
529 _mesa_free(n
[7].data
);
530 n
+= InstSize
[n
[0].opcode
];
532 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
533 _mesa_free(n
[8].data
);
534 n
+= InstSize
[n
[0].opcode
];
536 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
537 _mesa_free(n
[9].data
);
538 n
+= InstSize
[n
[0].opcode
];
540 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
541 _mesa_free(n
[7].data
);
542 n
+= InstSize
[n
[0].opcode
];
544 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
545 _mesa_free(n
[9].data
);
546 n
+= InstSize
[n
[0].opcode
];
548 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
549 _mesa_free(n
[11].data
);
550 n
+= InstSize
[n
[0].opcode
];
552 #if FEATURE_NV_vertex_program
553 case OPCODE_LOAD_PROGRAM_NV
:
554 _mesa_free(n
[4].data
); /* program string */
555 n
+= InstSize
[n
[0].opcode
];
557 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
558 _mesa_free(n
[2].data
); /* array of program ids */
559 n
+= InstSize
[n
[0].opcode
];
562 #if FEATURE_NV_fragment_program
563 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
564 _mesa_free(n
[3].data
); /* parameter name */
565 n
+= InstSize
[n
[0].opcode
];
568 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
569 case OPCODE_PROGRAM_STRING_ARB
:
570 _mesa_free(n
[4].data
); /* program string */
571 n
+= InstSize
[n
[0].opcode
];
574 case OPCODE_CONTINUE
:
575 n
= (Node
*) n
[1].next
;
579 case OPCODE_END_OF_LIST
:
584 /* Most frequent case */
585 n
+= InstSize
[n
[0].opcode
];
596 * Destroy a display list and remove from hash table.
597 * \param list - display list number
600 destroy_list(GLcontext
*ctx
, GLuint list
)
602 struct mesa_display_list
*dlist
;
607 dlist
= lookup_list(ctx
, list
);
611 _mesa_delete_list(ctx
, dlist
);
612 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
617 * Translate the nth element of list from type to GLuint.
620 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
632 bptr
= (GLbyte
*) list
;
633 return (GLuint
) *(bptr
+ n
);
634 case GL_UNSIGNED_BYTE
:
635 ubptr
= (GLubyte
*) list
;
636 return (GLuint
) *(ubptr
+ n
);
638 sptr
= (GLshort
*) list
;
639 return (GLuint
) *(sptr
+ n
);
640 case GL_UNSIGNED_SHORT
:
641 usptr
= (GLushort
*) list
;
642 return (GLuint
) *(usptr
+ n
);
644 iptr
= (GLint
*) list
;
645 return (GLuint
) *(iptr
+ n
);
646 case GL_UNSIGNED_INT
:
647 uiptr
= (GLuint
*) list
;
648 return (GLuint
) *(uiptr
+ n
);
650 fptr
= (GLfloat
*) list
;
651 return (GLuint
) *(fptr
+ n
);
653 ubptr
= ((GLubyte
*) list
) + 2 * n
;
654 return (GLuint
) *ubptr
* 256 + (GLuint
) * (ubptr
+ 1);
656 ubptr
= ((GLubyte
*) list
) + 3 * n
;
657 return (GLuint
) * ubptr
* 65536
658 + (GLuint
) *(ubptr
+ 1) * 256 + (GLuint
) * (ubptr
+ 2);
660 ubptr
= ((GLubyte
*) list
) + 4 * n
;
661 return (GLuint
) *ubptr
* 16777216
662 + (GLuint
) *(ubptr
+ 1) * 65536
663 + (GLuint
) *(ubptr
+ 2) * 256 + (GLuint
) * (ubptr
+ 3);
672 /**********************************************************************/
674 /**********************************************************************/
677 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
678 * \todo This won't suffice when the PBO is really in VRAM/GPU memory.
681 unpack_image(GLuint dimensions
, GLsizei width
, GLsizei height
, GLsizei depth
,
682 GLenum format
, GLenum type
, const GLvoid
* pixels
,
683 const struct gl_pixelstore_attrib
*unpack
)
685 if (unpack
->BufferObj
->Name
== 0) {
687 return _mesa_unpack_image(dimensions
, width
, height
, depth
, format
,
688 type
, pixels
, unpack
);
691 if (_mesa_validate_pbo_access
692 (dimensions
, unpack
, width
, height
, depth
, format
, type
, pixels
)) {
693 const GLubyte
*src
= ADD_POINTERS(unpack
->BufferObj
->Data
, pixels
);
694 return _mesa_unpack_image(dimensions
, width
, height
, depth
, format
,
703 * Allocate space for a display list instruction.
704 * \param opcode the instruction opcode (OPCODE_* value)
705 * \param size instruction size in bytes, not counting opcode.
706 * \return pointer to the usable data area (not including the internal
710 _mesa_alloc_instruction(GLcontext
*ctx
, GLuint opcode
, GLuint bytes
)
712 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
715 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
716 if (InstSize
[opcode
] == 0) {
717 /* save instruction size now */
718 InstSize
[opcode
] = numNodes
;
721 /* make sure instruction size agrees */
722 ASSERT(numNodes
== InstSize
[opcode
]);
726 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
727 /* This block is full. Allocate a new block and chain to it */
729 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
730 n
[0].opcode
= OPCODE_CONTINUE
;
731 newblock
= (Node
*) _mesa_malloc(sizeof(Node
) * BLOCK_SIZE
);
733 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
736 n
[1].next
= (Node
*) newblock
;
737 ctx
->ListState
.CurrentBlock
= newblock
;
738 ctx
->ListState
.CurrentPos
= 0;
741 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
742 ctx
->ListState
.CurrentPos
+= numNodes
;
744 n
[0].opcode
= (OpCode
) opcode
;
746 return (void *) (n
+ 1); /* return ptr to node following opcode */
751 * This function allows modules and drivers to get their own opcodes
752 * for extending display list functionality.
753 * \param ctx the rendering context
754 * \param size number of bytes for storing the new display list command
755 * \param execute function to execute the new display list command
756 * \param destroy function to destroy the new display list command
757 * \param print function to print the new display list command
758 * \return the new opcode number or -1 if error
761 _mesa_alloc_opcode(GLcontext
*ctx
,
763 void (*execute
) (GLcontext
*, void *),
764 void (*destroy
) (GLcontext
*, void *),
765 void (*print
) (GLcontext
*, void *))
767 if (ctx
->ListExt
.NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
768 const GLuint i
= ctx
->ListExt
.NumOpcodes
++;
769 ctx
->ListExt
.Opcode
[i
].Size
=
770 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
771 ctx
->ListExt
.Opcode
[i
].Execute
= execute
;
772 ctx
->ListExt
.Opcode
[i
].Destroy
= destroy
;
773 ctx
->ListExt
.Opcode
[i
].Print
= print
;
774 return i
+ OPCODE_EXT_0
;
782 * Allocate display list instruction. Returns Node ptr to where the opcode
784 * - nParams is the number of function parameters
785 * - return value a pointer to sizeof(Node) before the actual
788 #define ALLOC_INSTRUCTION(CTX, OPCODE, NPARAMS) \
789 ((Node *)_mesa_alloc_instruction(CTX, OPCODE, (NPARAMS)*sizeof(Node)) - 1)
794 * Display List compilation functions
796 static void GLAPIENTRY
797 save_Accum(GLenum op
, GLfloat value
)
799 GET_CURRENT_CONTEXT(ctx
);
801 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
802 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACCUM
, 2);
807 if (ctx
->ExecuteFlag
) {
808 CALL_Accum(ctx
->Exec
, (op
, value
));
813 static void GLAPIENTRY
814 save_AlphaFunc(GLenum func
, GLclampf ref
)
816 GET_CURRENT_CONTEXT(ctx
);
818 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
819 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ALPHA_FUNC
, 2);
822 n
[2].f
= (GLfloat
) ref
;
824 if (ctx
->ExecuteFlag
) {
825 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
830 static void GLAPIENTRY
831 save_BindTexture(GLenum target
, GLuint texture
)
833 GET_CURRENT_CONTEXT(ctx
);
835 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
836 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_TEXTURE
, 2);
841 if (ctx
->ExecuteFlag
) {
842 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
847 static void GLAPIENTRY
848 save_Bitmap(GLsizei width
, GLsizei height
,
849 GLfloat xorig
, GLfloat yorig
,
850 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
852 GET_CURRENT_CONTEXT(ctx
);
853 GLvoid
*image
= _mesa_unpack_bitmap(width
, height
, pixels
, &ctx
->Unpack
);
855 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
856 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BITMAP
, 7);
858 n
[1].i
= (GLint
) width
;
859 n
[2].i
= (GLint
) height
;
869 if (ctx
->ExecuteFlag
) {
870 CALL_Bitmap(ctx
->Exec
, (width
, height
,
871 xorig
, yorig
, xmove
, ymove
, pixels
));
876 static void GLAPIENTRY
877 save_BlendEquation(GLenum mode
)
879 GET_CURRENT_CONTEXT(ctx
);
881 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
882 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_EQUATION
, 1);
886 if (ctx
->ExecuteFlag
) {
887 CALL_BlendEquation(ctx
->Exec
, (mode
));
892 static void GLAPIENTRY
893 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
895 GET_CURRENT_CONTEXT(ctx
);
897 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
898 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
903 if (ctx
->ExecuteFlag
) {
904 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
909 static void GLAPIENTRY
910 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
911 GLenum sfactorA
, GLenum dfactorA
)
913 GET_CURRENT_CONTEXT(ctx
);
915 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
916 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
923 if (ctx
->ExecuteFlag
) {
924 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
925 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
930 static void GLAPIENTRY
931 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
933 GET_CURRENT_CONTEXT(ctx
);
935 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
936 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_COLOR
, 4);
943 if (ctx
->ExecuteFlag
) {
944 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
950 _mesa_save_CallList(GLuint list
)
952 GET_CURRENT_CONTEXT(ctx
);
954 SAVE_FLUSH_VERTICES(ctx
);
956 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CALL_LIST
, 1);
961 /* After this, we don't know what begin/end state we're in:
963 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
965 if (ctx
->ExecuteFlag
) {
966 CALL_CallList(ctx
->Exec
, (list
));
972 _mesa_save_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
974 GET_CURRENT_CONTEXT(ctx
);
976 GLboolean typeErrorFlag
;
978 SAVE_FLUSH_VERTICES(ctx
);
982 case GL_UNSIGNED_BYTE
:
984 case GL_UNSIGNED_SHORT
:
986 case GL_UNSIGNED_INT
:
991 typeErrorFlag
= GL_FALSE
;
994 typeErrorFlag
= GL_TRUE
;
997 for (i
= 0; i
< n
; i
++) {
998 GLuint list
= translate_id(i
, type
, lists
);
999 Node
*n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1002 n
[2].b
= typeErrorFlag
;
1006 /* After this, we don't know what begin/end state we're in:
1008 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1010 if (ctx
->ExecuteFlag
) {
1011 CALL_CallLists(ctx
->Exec
, (n
, type
, lists
));
1016 static void GLAPIENTRY
1017 save_Clear(GLbitfield mask
)
1019 GET_CURRENT_CONTEXT(ctx
);
1021 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1022 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR
, 1);
1026 if (ctx
->ExecuteFlag
) {
1027 CALL_Clear(ctx
->Exec
, (mask
));
1032 static void GLAPIENTRY
1033 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1035 GET_CURRENT_CONTEXT(ctx
);
1037 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1038 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1045 if (ctx
->ExecuteFlag
) {
1046 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1051 static void GLAPIENTRY
1052 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1054 GET_CURRENT_CONTEXT(ctx
);
1056 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1057 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_COLOR
, 4);
1064 if (ctx
->ExecuteFlag
) {
1065 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1070 static void GLAPIENTRY
1071 save_ClearDepth(GLclampd depth
)
1073 GET_CURRENT_CONTEXT(ctx
);
1075 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1076 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1078 n
[1].f
= (GLfloat
) depth
;
1080 if (ctx
->ExecuteFlag
) {
1081 CALL_ClearDepth(ctx
->Exec
, (depth
));
1086 static void GLAPIENTRY
1087 save_ClearIndex(GLfloat c
)
1089 GET_CURRENT_CONTEXT(ctx
);
1091 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1092 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_INDEX
, 1);
1096 if (ctx
->ExecuteFlag
) {
1097 CALL_ClearIndex(ctx
->Exec
, (c
));
1102 static void GLAPIENTRY
1103 save_ClearStencil(GLint s
)
1105 GET_CURRENT_CONTEXT(ctx
);
1107 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1108 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1112 if (ctx
->ExecuteFlag
) {
1113 CALL_ClearStencil(ctx
->Exec
, (s
));
1118 static void GLAPIENTRY
1119 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1121 GET_CURRENT_CONTEXT(ctx
);
1123 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1124 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLIP_PLANE
, 5);
1127 n
[2].f
= (GLfloat
) equ
[0];
1128 n
[3].f
= (GLfloat
) equ
[1];
1129 n
[4].f
= (GLfloat
) equ
[2];
1130 n
[5].f
= (GLfloat
) equ
[3];
1132 if (ctx
->ExecuteFlag
) {
1133 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1139 static void GLAPIENTRY
1140 save_ColorMask(GLboolean red
, GLboolean green
,
1141 GLboolean blue
, GLboolean alpha
)
1143 GET_CURRENT_CONTEXT(ctx
);
1145 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1146 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_MASK
, 4);
1153 if (ctx
->ExecuteFlag
) {
1154 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1159 static void GLAPIENTRY
1160 save_ColorMaterial(GLenum face
, GLenum mode
)
1162 GET_CURRENT_CONTEXT(ctx
);
1164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1166 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1171 if (ctx
->ExecuteFlag
) {
1172 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1177 static void GLAPIENTRY
1178 save_ColorTable(GLenum target
, GLenum internalFormat
,
1179 GLsizei width
, GLenum format
, GLenum type
,
1180 const GLvoid
* table
)
1182 GET_CURRENT_CONTEXT(ctx
);
1183 if (_mesa_is_proxy_texture(target
)) {
1184 /* execute immediately */
1185 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1186 format
, type
, table
));
1189 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
, table
,
1192 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1193 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE
, 6);
1196 n
[2].e
= internalFormat
;
1205 if (ctx
->ExecuteFlag
) {
1206 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1207 format
, type
, table
));
1214 static void GLAPIENTRY
1215 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1216 const GLfloat
*params
)
1218 GET_CURRENT_CONTEXT(ctx
);
1221 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1223 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1228 if (pname
== GL_COLOR_TABLE_SGI
||
1229 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1230 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1231 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1238 if (ctx
->ExecuteFlag
) {
1239 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1244 static void GLAPIENTRY
1245 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1247 GET_CURRENT_CONTEXT(ctx
);
1250 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1252 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1257 if (pname
== GL_COLOR_TABLE_SGI
||
1258 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1259 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1260 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1267 if (ctx
->ExecuteFlag
) {
1268 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1274 static void GLAPIENTRY
1275 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1276 GLenum format
, GLenum type
, const GLvoid
* table
)
1278 GET_CURRENT_CONTEXT(ctx
);
1279 GLvoid
*image
= unpack_image(1, count
, 1, 1, format
, type
, table
,
1282 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1283 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1295 if (ctx
->ExecuteFlag
) {
1296 CALL_ColorSubTable(ctx
->Exec
,
1297 (target
, start
, count
, format
, type
, table
));
1302 static void GLAPIENTRY
1303 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1304 GLint x
, GLint y
, GLsizei width
)
1306 GET_CURRENT_CONTEXT(ctx
);
1309 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1310 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1318 if (ctx
->ExecuteFlag
) {
1319 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1324 static void GLAPIENTRY
1325 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1326 GLint x
, GLint y
, GLsizei width
)
1328 GET_CURRENT_CONTEXT(ctx
);
1331 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1332 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1335 n
[2].e
= internalformat
;
1340 if (ctx
->ExecuteFlag
) {
1341 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1346 static void GLAPIENTRY
1347 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1348 GLenum format
, GLenum type
, const GLvoid
* filter
)
1350 GET_CURRENT_CONTEXT(ctx
);
1351 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
, filter
,
1354 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1355 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1358 n
[2].e
= internalFormat
;
1367 if (ctx
->ExecuteFlag
) {
1368 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1369 format
, type
, filter
));
1374 static void GLAPIENTRY
1375 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1376 GLsizei width
, GLsizei height
, GLenum format
,
1377 GLenum type
, const GLvoid
* filter
)
1379 GET_CURRENT_CONTEXT(ctx
);
1380 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
, filter
,
1383 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1384 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1387 n
[2].e
= internalFormat
;
1397 if (ctx
->ExecuteFlag
) {
1398 CALL_ConvolutionFilter2D(ctx
->Exec
,
1399 (target
, internalFormat
, width
, height
, format
,
1405 static void GLAPIENTRY
1406 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1408 GET_CURRENT_CONTEXT(ctx
);
1410 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1411 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1417 if (ctx
->ExecuteFlag
) {
1418 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1423 static void GLAPIENTRY
1424 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1426 GET_CURRENT_CONTEXT(ctx
);
1428 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1429 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1434 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1435 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1436 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1442 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1445 if (ctx
->ExecuteFlag
) {
1446 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1451 static void GLAPIENTRY
1452 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1454 GET_CURRENT_CONTEXT(ctx
);
1456 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1457 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
1463 if (ctx
->ExecuteFlag
) {
1464 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
1469 static void GLAPIENTRY
1470 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
1471 const GLfloat
*params
)
1473 GET_CURRENT_CONTEXT(ctx
);
1475 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1476 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
1481 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1482 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1483 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1489 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1492 if (ctx
->ExecuteFlag
) {
1493 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
1498 static void GLAPIENTRY
1499 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1501 GET_CURRENT_CONTEXT(ctx
);
1503 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1504 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_PIXELS
, 5);
1508 n
[3].i
= (GLint
) width
;
1509 n
[4].i
= (GLint
) height
;
1512 if (ctx
->ExecuteFlag
) {
1513 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1519 static void GLAPIENTRY
1520 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1521 GLint x
, GLint y
, GLsizei width
, GLint border
)
1523 GET_CURRENT_CONTEXT(ctx
);
1525 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1526 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1530 n
[3].e
= internalformat
;
1536 if (ctx
->ExecuteFlag
) {
1537 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1538 x
, y
, width
, border
));
1543 static void GLAPIENTRY
1544 save_CopyTexImage2D(GLenum target
, GLint level
,
1545 GLenum internalformat
,
1546 GLint x
, GLint y
, GLsizei width
,
1547 GLsizei height
, GLint border
)
1549 GET_CURRENT_CONTEXT(ctx
);
1551 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1552 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1556 n
[3].e
= internalformat
;
1563 if (ctx
->ExecuteFlag
) {
1564 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1565 x
, y
, width
, height
, border
));
1571 static void GLAPIENTRY
1572 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1573 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1575 GET_CURRENT_CONTEXT(ctx
);
1577 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1578 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1587 if (ctx
->ExecuteFlag
) {
1588 CALL_CopyTexSubImage1D(ctx
->Exec
,
1589 (target
, level
, xoffset
, x
, y
, width
));
1594 static void GLAPIENTRY
1595 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1596 GLint xoffset
, GLint yoffset
,
1597 GLint x
, GLint y
, GLsizei width
, GLint height
)
1599 GET_CURRENT_CONTEXT(ctx
);
1601 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1602 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1613 if (ctx
->ExecuteFlag
) {
1614 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1615 x
, y
, width
, height
));
1620 static void GLAPIENTRY
1621 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1622 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1623 GLint x
, GLint y
, GLsizei width
, GLint height
)
1625 GET_CURRENT_CONTEXT(ctx
);
1627 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1628 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1640 if (ctx
->ExecuteFlag
) {
1641 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1642 xoffset
, yoffset
, zoffset
,
1643 x
, y
, width
, height
));
1648 static void GLAPIENTRY
1649 save_CullFace(GLenum mode
)
1651 GET_CURRENT_CONTEXT(ctx
);
1653 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1654 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CULL_FACE
, 1);
1658 if (ctx
->ExecuteFlag
) {
1659 CALL_CullFace(ctx
->Exec
, (mode
));
1664 static void GLAPIENTRY
1665 save_DepthFunc(GLenum func
)
1667 GET_CURRENT_CONTEXT(ctx
);
1669 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1670 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_FUNC
, 1);
1674 if (ctx
->ExecuteFlag
) {
1675 CALL_DepthFunc(ctx
->Exec
, (func
));
1680 static void GLAPIENTRY
1681 save_DepthMask(GLboolean mask
)
1683 GET_CURRENT_CONTEXT(ctx
);
1685 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1686 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_MASK
, 1);
1690 if (ctx
->ExecuteFlag
) {
1691 CALL_DepthMask(ctx
->Exec
, (mask
));
1696 static void GLAPIENTRY
1697 save_DepthRange(GLclampd nearval
, GLclampd farval
)
1699 GET_CURRENT_CONTEXT(ctx
);
1701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1702 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_RANGE
, 2);
1704 n
[1].f
= (GLfloat
) nearval
;
1705 n
[2].f
= (GLfloat
) farval
;
1707 if (ctx
->ExecuteFlag
) {
1708 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
1713 static void GLAPIENTRY
1714 save_Disable(GLenum cap
)
1716 GET_CURRENT_CONTEXT(ctx
);
1718 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1719 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DISABLE
, 1);
1723 if (ctx
->ExecuteFlag
) {
1724 CALL_Disable(ctx
->Exec
, (cap
));
1729 static void GLAPIENTRY
1730 save_DrawBuffer(GLenum mode
)
1732 GET_CURRENT_CONTEXT(ctx
);
1734 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1735 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFER
, 1);
1739 if (ctx
->ExecuteFlag
) {
1740 CALL_DrawBuffer(ctx
->Exec
, (mode
));
1745 static void GLAPIENTRY
1746 save_DrawPixels(GLsizei width
, GLsizei height
,
1747 GLenum format
, GLenum type
, const GLvoid
* pixels
)
1749 GET_CURRENT_CONTEXT(ctx
);
1750 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
1751 pixels
, &ctx
->Unpack
);
1753 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1754 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_PIXELS
, 5);
1765 if (ctx
->ExecuteFlag
) {
1766 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
1772 static void GLAPIENTRY
1773 save_Enable(GLenum cap
)
1775 GET_CURRENT_CONTEXT(ctx
);
1777 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1778 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ENABLE
, 1);
1782 if (ctx
->ExecuteFlag
) {
1783 CALL_Enable(ctx
->Exec
, (cap
));
1789 static void GLAPIENTRY
1790 _mesa_save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
1792 GET_CURRENT_CONTEXT(ctx
);
1794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1795 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVALMESH1
, 3);
1801 if (ctx
->ExecuteFlag
) {
1802 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
1807 static void GLAPIENTRY
1808 _mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1810 GET_CURRENT_CONTEXT(ctx
);
1812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1813 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVALMESH2
, 5);
1821 if (ctx
->ExecuteFlag
) {
1822 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
1829 static void GLAPIENTRY
1830 save_Fogfv(GLenum pname
, const GLfloat
*params
)
1832 GET_CURRENT_CONTEXT(ctx
);
1834 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1835 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FOG
, 5);
1843 if (ctx
->ExecuteFlag
) {
1844 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
1849 static void GLAPIENTRY
1850 save_Fogf(GLenum pname
, GLfloat param
)
1852 save_Fogfv(pname
, ¶m
);
1856 static void GLAPIENTRY
1857 save_Fogiv(GLenum pname
, const GLint
*params
)
1862 case GL_FOG_DENSITY
:
1866 p
[0] = (GLfloat
) *params
;
1869 p
[0] = INT_TO_FLOAT(params
[0]);
1870 p
[1] = INT_TO_FLOAT(params
[1]);
1871 p
[2] = INT_TO_FLOAT(params
[2]);
1872 p
[3] = INT_TO_FLOAT(params
[3]);
1875 /* Error will be caught later in gl_Fogfv */
1878 save_Fogfv(pname
, p
);
1882 static void GLAPIENTRY
1883 save_Fogi(GLenum pname
, GLint param
)
1885 save_Fogiv(pname
, ¶m
);
1889 static void GLAPIENTRY
1890 save_FrontFace(GLenum mode
)
1892 GET_CURRENT_CONTEXT(ctx
);
1894 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1895 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FRONT_FACE
, 1);
1899 if (ctx
->ExecuteFlag
) {
1900 CALL_FrontFace(ctx
->Exec
, (mode
));
1905 static void GLAPIENTRY
1906 save_Frustum(GLdouble left
, GLdouble right
,
1907 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
1909 GET_CURRENT_CONTEXT(ctx
);
1911 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1912 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FRUSTUM
, 6);
1914 n
[1].f
= (GLfloat
) left
;
1915 n
[2].f
= (GLfloat
) right
;
1916 n
[3].f
= (GLfloat
) bottom
;
1917 n
[4].f
= (GLfloat
) top
;
1918 n
[5].f
= (GLfloat
) nearval
;
1919 n
[6].f
= (GLfloat
) farval
;
1921 if (ctx
->ExecuteFlag
) {
1922 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
1927 static void GLAPIENTRY
1928 save_Hint(GLenum target
, GLenum mode
)
1930 GET_CURRENT_CONTEXT(ctx
);
1932 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1933 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_HINT
, 2);
1938 if (ctx
->ExecuteFlag
) {
1939 CALL_Hint(ctx
->Exec
, (target
, mode
));
1944 static void GLAPIENTRY
1945 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
1948 GET_CURRENT_CONTEXT(ctx
);
1951 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1952 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_HISTOGRAM
, 4);
1956 n
[3].e
= internalFormat
;
1959 if (ctx
->ExecuteFlag
) {
1960 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
1965 static void GLAPIENTRY
1966 save_IndexMask(GLuint mask
)
1968 GET_CURRENT_CONTEXT(ctx
);
1970 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1971 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_INDEX_MASK
, 1);
1975 if (ctx
->ExecuteFlag
) {
1976 CALL_IndexMask(ctx
->Exec
, (mask
));
1981 static void GLAPIENTRY
1982 save_InitNames(void)
1984 GET_CURRENT_CONTEXT(ctx
);
1985 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1986 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_INIT_NAMES
, 0);
1987 if (ctx
->ExecuteFlag
) {
1988 CALL_InitNames(ctx
->Exec
, ());
1993 static void GLAPIENTRY
1994 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
1996 GET_CURRENT_CONTEXT(ctx
);
1998 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1999 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIGHT
, 6);
2017 case GL_SPOT_DIRECTION
:
2020 case GL_SPOT_EXPONENT
:
2023 case GL_SPOT_CUTOFF
:
2026 case GL_CONSTANT_ATTENUATION
:
2029 case GL_LINEAR_ATTENUATION
:
2032 case GL_QUADRATIC_ATTENUATION
:
2038 for (i
= 0; i
< nParams
; i
++) {
2039 n
[3 + i
].f
= params
[i
];
2042 if (ctx
->ExecuteFlag
) {
2043 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2048 static void GLAPIENTRY
2049 save_Lightf(GLenum light
, GLenum pname
, GLfloat params
)
2051 save_Lightfv(light
, pname
, ¶ms
);
2055 static void GLAPIENTRY
2056 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2063 fparam
[0] = INT_TO_FLOAT(params
[0]);
2064 fparam
[1] = INT_TO_FLOAT(params
[1]);
2065 fparam
[2] = INT_TO_FLOAT(params
[2]);
2066 fparam
[3] = INT_TO_FLOAT(params
[3]);
2069 fparam
[0] = (GLfloat
) params
[0];
2070 fparam
[1] = (GLfloat
) params
[1];
2071 fparam
[2] = (GLfloat
) params
[2];
2072 fparam
[3] = (GLfloat
) params
[3];
2074 case GL_SPOT_DIRECTION
:
2075 fparam
[0] = (GLfloat
) params
[0];
2076 fparam
[1] = (GLfloat
) params
[1];
2077 fparam
[2] = (GLfloat
) params
[2];
2079 case GL_SPOT_EXPONENT
:
2080 case GL_SPOT_CUTOFF
:
2081 case GL_CONSTANT_ATTENUATION
:
2082 case GL_LINEAR_ATTENUATION
:
2083 case GL_QUADRATIC_ATTENUATION
:
2084 fparam
[0] = (GLfloat
) params
[0];
2087 /* error will be caught later in gl_Lightfv */
2090 save_Lightfv(light
, pname
, fparam
);
2094 static void GLAPIENTRY
2095 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2097 save_Lightiv(light
, pname
, ¶m
);
2101 static void GLAPIENTRY
2102 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2104 GET_CURRENT_CONTEXT(ctx
);
2106 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2107 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIGHT_MODEL
, 5);
2115 if (ctx
->ExecuteFlag
) {
2116 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2121 static void GLAPIENTRY
2122 save_LightModelf(GLenum pname
, GLfloat param
)
2124 save_LightModelfv(pname
, ¶m
);
2128 static void GLAPIENTRY
2129 save_LightModeliv(GLenum pname
, const GLint
*params
)
2133 case GL_LIGHT_MODEL_AMBIENT
:
2134 fparam
[0] = INT_TO_FLOAT(params
[0]);
2135 fparam
[1] = INT_TO_FLOAT(params
[1]);
2136 fparam
[2] = INT_TO_FLOAT(params
[2]);
2137 fparam
[3] = INT_TO_FLOAT(params
[3]);
2139 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2140 case GL_LIGHT_MODEL_TWO_SIDE
:
2141 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2142 fparam
[0] = (GLfloat
) params
[0];
2145 /* Error will be caught later in gl_LightModelfv */
2148 save_LightModelfv(pname
, fparam
);
2152 static void GLAPIENTRY
2153 save_LightModeli(GLenum pname
, GLint param
)
2155 save_LightModeliv(pname
, ¶m
);
2159 static void GLAPIENTRY
2160 save_LineStipple(GLint factor
, GLushort pattern
)
2162 GET_CURRENT_CONTEXT(ctx
);
2164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2165 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LINE_STIPPLE
, 2);
2170 if (ctx
->ExecuteFlag
) {
2171 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2176 static void GLAPIENTRY
2177 save_LineWidth(GLfloat width
)
2179 GET_CURRENT_CONTEXT(ctx
);
2181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2182 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LINE_WIDTH
, 1);
2186 if (ctx
->ExecuteFlag
) {
2187 CALL_LineWidth(ctx
->Exec
, (width
));
2192 static void GLAPIENTRY
2193 save_ListBase(GLuint base
)
2195 GET_CURRENT_CONTEXT(ctx
);
2197 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2198 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIST_BASE
, 1);
2202 if (ctx
->ExecuteFlag
) {
2203 CALL_ListBase(ctx
->Exec
, (base
));
2208 static void GLAPIENTRY
2209 save_LoadIdentity(void)
2211 GET_CURRENT_CONTEXT(ctx
);
2212 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2213 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2214 if (ctx
->ExecuteFlag
) {
2215 CALL_LoadIdentity(ctx
->Exec
, ());
2220 static void GLAPIENTRY
2221 save_LoadMatrixf(const GLfloat
* m
)
2223 GET_CURRENT_CONTEXT(ctx
);
2225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2226 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_MATRIX
, 16);
2229 for (i
= 0; i
< 16; i
++) {
2233 if (ctx
->ExecuteFlag
) {
2234 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2239 static void GLAPIENTRY
2240 save_LoadMatrixd(const GLdouble
* m
)
2244 for (i
= 0; i
< 16; i
++) {
2245 f
[i
] = (GLfloat
) m
[i
];
2247 save_LoadMatrixf(f
);
2251 static void GLAPIENTRY
2252 save_LoadName(GLuint name
)
2254 GET_CURRENT_CONTEXT(ctx
);
2256 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2257 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_NAME
, 1);
2261 if (ctx
->ExecuteFlag
) {
2262 CALL_LoadName(ctx
->Exec
, (name
));
2267 static void GLAPIENTRY
2268 save_LogicOp(GLenum opcode
)
2270 GET_CURRENT_CONTEXT(ctx
);
2272 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2273 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOGIC_OP
, 1);
2277 if (ctx
->ExecuteFlag
) {
2278 CALL_LogicOp(ctx
->Exec
, (opcode
));
2283 static void GLAPIENTRY
2284 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2285 GLint order
, const GLdouble
* points
)
2287 GET_CURRENT_CONTEXT(ctx
);
2289 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2290 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP1
, 6);
2292 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2294 n
[2].f
= (GLfloat
) u1
;
2295 n
[3].f
= (GLfloat
) u2
;
2296 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2298 n
[6].data
= (void *) pnts
;
2300 if (ctx
->ExecuteFlag
) {
2301 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2305 static void GLAPIENTRY
2306 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2307 GLint order
, const GLfloat
* points
)
2309 GET_CURRENT_CONTEXT(ctx
);
2311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2312 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP1
, 6);
2314 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2318 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2320 n
[6].data
= (void *) pnts
;
2322 if (ctx
->ExecuteFlag
) {
2323 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2328 static void GLAPIENTRY
2329 save_Map2d(GLenum target
,
2330 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2331 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2332 const GLdouble
* points
)
2334 GET_CURRENT_CONTEXT(ctx
);
2336 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2337 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP2
, 10);
2339 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2340 vstride
, vorder
, points
);
2342 n
[2].f
= (GLfloat
) u1
;
2343 n
[3].f
= (GLfloat
) u2
;
2344 n
[4].f
= (GLfloat
) v1
;
2345 n
[5].f
= (GLfloat
) v2
;
2346 /* XXX verify these strides are correct */
2347 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2348 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2351 n
[10].data
= (void *) pnts
;
2353 if (ctx
->ExecuteFlag
) {
2354 CALL_Map2d(ctx
->Exec
, (target
,
2355 u1
, u2
, ustride
, uorder
,
2356 v1
, v2
, vstride
, vorder
, points
));
2361 static void GLAPIENTRY
2362 save_Map2f(GLenum target
,
2363 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2364 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2365 const GLfloat
* points
)
2367 GET_CURRENT_CONTEXT(ctx
);
2369 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2370 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP2
, 10);
2372 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2373 vstride
, vorder
, points
);
2379 /* XXX verify these strides are correct */
2380 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2381 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2384 n
[10].data
= (void *) pnts
;
2386 if (ctx
->ExecuteFlag
) {
2387 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2388 v1
, v2
, vstride
, vorder
, points
));
2393 static void GLAPIENTRY
2394 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2396 GET_CURRENT_CONTEXT(ctx
);
2398 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2399 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAPGRID1
, 3);
2405 if (ctx
->ExecuteFlag
) {
2406 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2411 static void GLAPIENTRY
2412 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2414 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2418 static void GLAPIENTRY
2419 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2420 GLint vn
, GLfloat v1
, GLfloat v2
)
2422 GET_CURRENT_CONTEXT(ctx
);
2424 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2425 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAPGRID2
, 6);
2434 if (ctx
->ExecuteFlag
) {
2435 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2441 static void GLAPIENTRY
2442 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2443 GLint vn
, GLdouble v1
, GLdouble v2
)
2445 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2446 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2450 static void GLAPIENTRY
2451 save_MatrixMode(GLenum mode
)
2453 GET_CURRENT_CONTEXT(ctx
);
2455 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2456 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATRIX_MODE
, 1);
2460 if (ctx
->ExecuteFlag
) {
2461 CALL_MatrixMode(ctx
->Exec
, (mode
));
2466 static void GLAPIENTRY
2467 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2469 GET_CURRENT_CONTEXT(ctx
);
2472 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2473 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MIN_MAX
, 3);
2476 n
[2].e
= internalFormat
;
2479 if (ctx
->ExecuteFlag
) {
2480 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
2485 static void GLAPIENTRY
2486 save_MultMatrixf(const GLfloat
* m
)
2488 GET_CURRENT_CONTEXT(ctx
);
2490 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2491 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MULT_MATRIX
, 16);
2494 for (i
= 0; i
< 16; i
++) {
2498 if (ctx
->ExecuteFlag
) {
2499 CALL_MultMatrixf(ctx
->Exec
, (m
));
2504 static void GLAPIENTRY
2505 save_MultMatrixd(const GLdouble
* m
)
2509 for (i
= 0; i
< 16; i
++) {
2510 f
[i
] = (GLfloat
) m
[i
];
2512 save_MultMatrixf(f
);
2516 static void GLAPIENTRY
2517 save_NewList(GLuint list
, GLenum mode
)
2519 GET_CURRENT_CONTEXT(ctx
);
2520 /* It's an error to call this function while building a display list */
2521 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2528 static void GLAPIENTRY
2529 save_Ortho(GLdouble left
, GLdouble right
,
2530 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2532 GET_CURRENT_CONTEXT(ctx
);
2534 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2535 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ORTHO
, 6);
2537 n
[1].f
= (GLfloat
) left
;
2538 n
[2].f
= (GLfloat
) right
;
2539 n
[3].f
= (GLfloat
) bottom
;
2540 n
[4].f
= (GLfloat
) top
;
2541 n
[5].f
= (GLfloat
) nearval
;
2542 n
[6].f
= (GLfloat
) farval
;
2544 if (ctx
->ExecuteFlag
) {
2545 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2550 static void GLAPIENTRY
2551 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2553 GET_CURRENT_CONTEXT(ctx
);
2555 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2556 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_MAP
, 3);
2560 n
[3].data
= (void *) _mesa_malloc(mapsize
* sizeof(GLfloat
));
2561 MEMCPY(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
2563 if (ctx
->ExecuteFlag
) {
2564 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2569 static void GLAPIENTRY
2570 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2572 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2574 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2575 for (i
= 0; i
< mapsize
; i
++) {
2576 fvalues
[i
] = (GLfloat
) values
[i
];
2580 for (i
= 0; i
< mapsize
; i
++) {
2581 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2584 save_PixelMapfv(map
, mapsize
, fvalues
);
2588 static void GLAPIENTRY
2589 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2591 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2593 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2594 for (i
= 0; i
< mapsize
; i
++) {
2595 fvalues
[i
] = (GLfloat
) values
[i
];
2599 for (i
= 0; i
< mapsize
; i
++) {
2600 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
2603 save_PixelMapfv(map
, mapsize
, fvalues
);
2607 static void GLAPIENTRY
2608 save_PixelTransferf(GLenum pname
, GLfloat param
)
2610 GET_CURRENT_CONTEXT(ctx
);
2612 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2613 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2618 if (ctx
->ExecuteFlag
) {
2619 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
2624 static void GLAPIENTRY
2625 save_PixelTransferi(GLenum pname
, GLint param
)
2627 save_PixelTransferf(pname
, (GLfloat
) param
);
2631 static void GLAPIENTRY
2632 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
2634 GET_CURRENT_CONTEXT(ctx
);
2636 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2637 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_ZOOM
, 2);
2642 if (ctx
->ExecuteFlag
) {
2643 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
2648 static void GLAPIENTRY
2649 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
2651 GET_CURRENT_CONTEXT(ctx
);
2653 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2654 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POINT_PARAMETERS
, 4);
2661 if (ctx
->ExecuteFlag
) {
2662 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
2667 static void GLAPIENTRY
2668 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
2670 save_PointParameterfvEXT(pname
, ¶m
);
2673 static void GLAPIENTRY
2674 save_PointParameteriNV(GLenum pname
, GLint param
)
2676 GLfloat p
= (GLfloat
) param
;
2677 save_PointParameterfvEXT(pname
, &p
);
2680 static void GLAPIENTRY
2681 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
2683 GLfloat p
= (GLfloat
) param
[0];
2684 save_PointParameterfvEXT(pname
, &p
);
2688 static void GLAPIENTRY
2689 save_PointSize(GLfloat size
)
2691 GET_CURRENT_CONTEXT(ctx
);
2693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2694 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POINT_SIZE
, 1);
2698 if (ctx
->ExecuteFlag
) {
2699 CALL_PointSize(ctx
->Exec
, (size
));
2704 static void GLAPIENTRY
2705 save_PolygonMode(GLenum face
, GLenum mode
)
2707 GET_CURRENT_CONTEXT(ctx
);
2709 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2710 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_MODE
, 2);
2715 if (ctx
->ExecuteFlag
) {
2716 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
2722 * Polygon stipple must have been upacked already!
2724 static void GLAPIENTRY
2725 save_PolygonStipple(const GLubyte
* pattern
)
2727 GET_CURRENT_CONTEXT(ctx
);
2729 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2730 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
2733 n
[1].data
= _mesa_malloc(32 * 4);
2734 data
= n
[1].data
; /* This needed for Acorn compiler */
2735 MEMCPY(data
, pattern
, 32 * 4);
2737 if (ctx
->ExecuteFlag
) {
2738 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
2743 static void GLAPIENTRY
2744 save_PolygonOffset(GLfloat factor
, GLfloat units
)
2746 GET_CURRENT_CONTEXT(ctx
);
2748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2749 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_OFFSET
, 2);
2754 if (ctx
->ExecuteFlag
) {
2755 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
2760 static void GLAPIENTRY
2761 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
2763 GET_CURRENT_CONTEXT(ctx
);
2764 /* XXX mult by DepthMaxF here??? */
2765 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
2769 static void GLAPIENTRY
2770 save_PopAttrib(void)
2772 GET_CURRENT_CONTEXT(ctx
);
2773 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2774 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_ATTRIB
, 0);
2775 if (ctx
->ExecuteFlag
) {
2776 CALL_PopAttrib(ctx
->Exec
, ());
2781 static void GLAPIENTRY
2782 save_PopMatrix(void)
2784 GET_CURRENT_CONTEXT(ctx
);
2785 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2786 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_MATRIX
, 0);
2787 if (ctx
->ExecuteFlag
) {
2788 CALL_PopMatrix(ctx
->Exec
, ());
2793 static void GLAPIENTRY
2796 GET_CURRENT_CONTEXT(ctx
);
2797 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2798 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_NAME
, 0);
2799 if (ctx
->ExecuteFlag
) {
2800 CALL_PopName(ctx
->Exec
, ());
2805 static void GLAPIENTRY
2806 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
2807 const GLclampf
* priorities
)
2809 GET_CURRENT_CONTEXT(ctx
);
2811 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2813 for (i
= 0; i
< num
; i
++) {
2815 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
2817 n
[1].ui
= textures
[i
];
2818 n
[2].f
= priorities
[i
];
2821 if (ctx
->ExecuteFlag
) {
2822 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
2827 static void GLAPIENTRY
2828 save_PushAttrib(GLbitfield mask
)
2830 GET_CURRENT_CONTEXT(ctx
);
2832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2833 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_ATTRIB
, 1);
2837 if (ctx
->ExecuteFlag
) {
2838 CALL_PushAttrib(ctx
->Exec
, (mask
));
2843 static void GLAPIENTRY
2844 save_PushMatrix(void)
2846 GET_CURRENT_CONTEXT(ctx
);
2847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2848 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_MATRIX
, 0);
2849 if (ctx
->ExecuteFlag
) {
2850 CALL_PushMatrix(ctx
->Exec
, ());
2855 static void GLAPIENTRY
2856 save_PushName(GLuint name
)
2858 GET_CURRENT_CONTEXT(ctx
);
2860 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2861 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_NAME
, 1);
2865 if (ctx
->ExecuteFlag
) {
2866 CALL_PushName(ctx
->Exec
, (name
));
2871 static void GLAPIENTRY
2872 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2874 GET_CURRENT_CONTEXT(ctx
);
2876 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2877 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RASTER_POS
, 4);
2884 if (ctx
->ExecuteFlag
) {
2885 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
2889 static void GLAPIENTRY
2890 save_RasterPos2d(GLdouble x
, GLdouble y
)
2892 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2895 static void GLAPIENTRY
2896 save_RasterPos2f(GLfloat x
, GLfloat y
)
2898 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2901 static void GLAPIENTRY
2902 save_RasterPos2i(GLint x
, GLint y
)
2904 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2907 static void GLAPIENTRY
2908 save_RasterPos2s(GLshort x
, GLshort y
)
2910 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2913 static void GLAPIENTRY
2914 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2916 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2919 static void GLAPIENTRY
2920 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2922 save_RasterPos4f(x
, y
, z
, 1.0F
);
2925 static void GLAPIENTRY
2926 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2928 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2931 static void GLAPIENTRY
2932 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2934 save_RasterPos4f(x
, y
, z
, 1.0F
);
2937 static void GLAPIENTRY
2938 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2940 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2943 static void GLAPIENTRY
2944 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
2946 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2949 static void GLAPIENTRY
2950 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
2952 save_RasterPos4f(x
, y
, z
, w
);
2955 static void GLAPIENTRY
2956 save_RasterPos2dv(const GLdouble
* v
)
2958 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2961 static void GLAPIENTRY
2962 save_RasterPos2fv(const GLfloat
* v
)
2964 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2967 static void GLAPIENTRY
2968 save_RasterPos2iv(const GLint
* v
)
2970 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2973 static void GLAPIENTRY
2974 save_RasterPos2sv(const GLshort
* v
)
2976 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2979 static void GLAPIENTRY
2980 save_RasterPos3dv(const GLdouble
* v
)
2982 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2985 static void GLAPIENTRY
2986 save_RasterPos3fv(const GLfloat
* v
)
2988 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
2991 static void GLAPIENTRY
2992 save_RasterPos3iv(const GLint
* v
)
2994 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2997 static void GLAPIENTRY
2998 save_RasterPos3sv(const GLshort
* v
)
3000 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3003 static void GLAPIENTRY
3004 save_RasterPos4dv(const GLdouble
* v
)
3006 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3007 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3010 static void GLAPIENTRY
3011 save_RasterPos4fv(const GLfloat
* v
)
3013 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3016 static void GLAPIENTRY
3017 save_RasterPos4iv(const GLint
* v
)
3019 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3020 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3023 static void GLAPIENTRY
3024 save_RasterPos4sv(const GLshort
* v
)
3026 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3030 static void GLAPIENTRY
3031 save_PassThrough(GLfloat token
)
3033 GET_CURRENT_CONTEXT(ctx
);
3035 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3036 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PASSTHROUGH
, 1);
3040 if (ctx
->ExecuteFlag
) {
3041 CALL_PassThrough(ctx
->Exec
, (token
));
3046 static void GLAPIENTRY
3047 save_ReadBuffer(GLenum mode
)
3049 GET_CURRENT_CONTEXT(ctx
);
3051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3052 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_READ_BUFFER
, 1);
3056 if (ctx
->ExecuteFlag
) {
3057 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3062 static void GLAPIENTRY
3063 save_ResetHistogram(GLenum target
)
3065 GET_CURRENT_CONTEXT(ctx
);
3067 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3068 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3072 if (ctx
->ExecuteFlag
) {
3073 CALL_ResetHistogram(ctx
->Exec
, (target
));
3078 static void GLAPIENTRY
3079 save_ResetMinmax(GLenum target
)
3081 GET_CURRENT_CONTEXT(ctx
);
3083 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3084 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3088 if (ctx
->ExecuteFlag
) {
3089 CALL_ResetMinmax(ctx
->Exec
, (target
));
3094 static void GLAPIENTRY
3095 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3097 GET_CURRENT_CONTEXT(ctx
);
3099 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3100 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ROTATE
, 4);
3107 if (ctx
->ExecuteFlag
) {
3108 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3113 static void GLAPIENTRY
3114 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3116 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3120 static void GLAPIENTRY
3121 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3123 GET_CURRENT_CONTEXT(ctx
);
3125 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3126 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCALE
, 3);
3132 if (ctx
->ExecuteFlag
) {
3133 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3138 static void GLAPIENTRY
3139 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3141 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3145 static void GLAPIENTRY
3146 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3148 GET_CURRENT_CONTEXT(ctx
);
3150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3151 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCISSOR
, 4);
3158 if (ctx
->ExecuteFlag
) {
3159 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3164 static void GLAPIENTRY
3165 save_ShadeModel(GLenum mode
)
3167 GET_CURRENT_CONTEXT(ctx
);
3169 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3170 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SHADE_MODEL
, 1);
3174 if (ctx
->ExecuteFlag
) {
3175 CALL_ShadeModel(ctx
->Exec
, (mode
));
3180 static void GLAPIENTRY
3181 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3183 GET_CURRENT_CONTEXT(ctx
);
3185 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3186 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC
, 3);
3192 if (ctx
->ExecuteFlag
) {
3193 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3198 static void GLAPIENTRY
3199 save_StencilMask(GLuint mask
)
3201 GET_CURRENT_CONTEXT(ctx
);
3203 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3204 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK
, 1);
3208 if (ctx
->ExecuteFlag
) {
3209 CALL_StencilMask(ctx
->Exec
, (mask
));
3214 static void GLAPIENTRY
3215 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3217 GET_CURRENT_CONTEXT(ctx
);
3219 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3220 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP
, 3);
3226 if (ctx
->ExecuteFlag
) {
3227 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3232 static void GLAPIENTRY
3233 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3235 GET_CURRENT_CONTEXT(ctx
);
3237 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3238 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3245 if (ctx
->ExecuteFlag
) {
3246 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3251 static void GLAPIENTRY
3252 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3254 GET_CURRENT_CONTEXT(ctx
);
3256 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3257 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3262 if (ctx
->ExecuteFlag
) {
3263 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3268 static void GLAPIENTRY
3269 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3271 GET_CURRENT_CONTEXT(ctx
);
3273 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3274 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3281 if (ctx
->ExecuteFlag
) {
3282 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3287 static void GLAPIENTRY
3288 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3290 GET_CURRENT_CONTEXT(ctx
);
3292 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3293 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXENV
, 6);
3297 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3305 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3308 if (ctx
->ExecuteFlag
) {
3309 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3314 static void GLAPIENTRY
3315 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3317 save_TexEnvfv(target
, pname
, ¶m
);
3321 static void GLAPIENTRY
3322 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3325 p
[0] = (GLfloat
) param
;
3326 p
[1] = p
[2] = p
[3] = 0.0;
3327 save_TexEnvfv(target
, pname
, p
);
3331 static void GLAPIENTRY
3332 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3335 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3336 p
[0] = INT_TO_FLOAT(param
[0]);
3337 p
[1] = INT_TO_FLOAT(param
[1]);
3338 p
[2] = INT_TO_FLOAT(param
[2]);
3339 p
[3] = INT_TO_FLOAT(param
[3]);
3342 p
[0] = (GLfloat
) param
[0];
3343 p
[1] = p
[2] = p
[3] = 0.0F
;
3345 save_TexEnvfv(target
, pname
, p
);
3349 static void GLAPIENTRY
3350 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3352 GET_CURRENT_CONTEXT(ctx
);
3354 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3355 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXGEN
, 6);
3364 if (ctx
->ExecuteFlag
) {
3365 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3370 static void GLAPIENTRY
3371 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3374 p
[0] = (GLfloat
) params
[0];
3375 p
[1] = (GLfloat
) params
[1];
3376 p
[2] = (GLfloat
) params
[2];
3377 p
[3] = (GLfloat
) params
[3];
3378 save_TexGenfv(coord
, pname
, p
);
3382 static void GLAPIENTRY
3383 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3385 GLfloat p
= (GLfloat
) param
;
3386 save_TexGenfv(coord
, pname
, &p
);
3390 static void GLAPIENTRY
3391 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3394 p
[0] = (GLfloat
) params
[0];
3395 p
[1] = (GLfloat
) params
[1];
3396 p
[2] = (GLfloat
) params
[2];
3397 p
[3] = (GLfloat
) params
[3];
3398 save_TexGenfv(coord
, pname
, p
);
3402 static void GLAPIENTRY
3403 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3405 save_TexGenfv(coord
, pname
, ¶m
);
3409 static void GLAPIENTRY
3410 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3412 save_TexGeniv(coord
, pname
, ¶m
);
3416 static void GLAPIENTRY
3417 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3419 GET_CURRENT_CONTEXT(ctx
);
3421 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3422 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXPARAMETER
, 6);
3431 if (ctx
->ExecuteFlag
) {
3432 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3437 static void GLAPIENTRY
3438 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3440 save_TexParameterfv(target
, pname
, ¶m
);
3444 static void GLAPIENTRY
3445 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3448 fparam
[0] = (GLfloat
) param
;
3449 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3450 save_TexParameterfv(target
, pname
, fparam
);
3454 static void GLAPIENTRY
3455 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3458 fparam
[0] = (GLfloat
) params
[0];
3459 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3460 save_TexParameterfv(target
, pname
, fparam
);
3464 static void GLAPIENTRY
3465 save_TexImage1D(GLenum target
,
3466 GLint level
, GLint components
,
3467 GLsizei width
, GLint border
,
3468 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3470 GET_CURRENT_CONTEXT(ctx
);
3471 if (target
== GL_PROXY_TEXTURE_1D
) {
3472 /* don't compile, execute immediately */
3473 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3474 border
, format
, type
, pixels
));
3477 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
,
3478 pixels
, &ctx
->Unpack
);
3480 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3481 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE1D
, 8);
3485 n
[3].i
= components
;
3486 n
[4].i
= (GLint
) width
;
3495 if (ctx
->ExecuteFlag
) {
3496 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3497 border
, format
, type
, pixels
));
3503 static void GLAPIENTRY
3504 save_TexImage2D(GLenum target
,
3505 GLint level
, GLint components
,
3506 GLsizei width
, GLsizei height
, GLint border
,
3507 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3509 GET_CURRENT_CONTEXT(ctx
);
3510 if (target
== GL_PROXY_TEXTURE_2D
) {
3511 /* don't compile, execute immediately */
3512 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3513 height
, border
, format
, type
, pixels
));
3516 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
3517 pixels
, &ctx
->Unpack
);
3519 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3520 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE2D
, 9);
3524 n
[3].i
= components
;
3525 n
[4].i
= (GLint
) width
;
3526 n
[5].i
= (GLint
) height
;
3535 if (ctx
->ExecuteFlag
) {
3536 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3537 height
, border
, format
, type
, pixels
));
3543 static void GLAPIENTRY
3544 save_TexImage3D(GLenum target
,
3545 GLint level
, GLint internalFormat
,
3546 GLsizei width
, GLsizei height
, GLsizei depth
,
3548 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3550 GET_CURRENT_CONTEXT(ctx
);
3551 if (target
== GL_PROXY_TEXTURE_3D
) {
3552 /* don't compile, execute immediately */
3553 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3554 height
, depth
, border
, format
, type
,
3559 GLvoid
*image
= unpack_image(3, width
, height
, depth
, format
, type
,
3560 pixels
, &ctx
->Unpack
);
3561 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3562 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE3D
, 10);
3566 n
[3].i
= (GLint
) internalFormat
;
3567 n
[4].i
= (GLint
) width
;
3568 n
[5].i
= (GLint
) height
;
3569 n
[6].i
= (GLint
) depth
;
3578 if (ctx
->ExecuteFlag
) {
3579 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3580 height
, depth
, border
, format
, type
,
3587 static void GLAPIENTRY
3588 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
3589 GLsizei width
, GLenum format
, GLenum type
,
3590 const GLvoid
* pixels
)
3592 GET_CURRENT_CONTEXT(ctx
);
3594 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
,
3595 pixels
, &ctx
->Unpack
);
3596 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3597 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
3602 n
[4].i
= (GLint
) width
;
3610 if (ctx
->ExecuteFlag
) {
3611 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
3612 format
, type
, pixels
));
3617 static void GLAPIENTRY
3618 save_TexSubImage2D(GLenum target
, GLint level
,
3619 GLint xoffset
, GLint yoffset
,
3620 GLsizei width
, GLsizei height
,
3621 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3623 GET_CURRENT_CONTEXT(ctx
);
3625 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
3626 pixels
, &ctx
->Unpack
);
3627 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3628 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
3634 n
[5].i
= (GLint
) width
;
3635 n
[6].i
= (GLint
) height
;
3643 if (ctx
->ExecuteFlag
) {
3644 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
3645 width
, height
, format
, type
, pixels
));
3650 static void GLAPIENTRY
3651 save_TexSubImage3D(GLenum target
, GLint level
,
3652 GLint xoffset
, GLint yoffset
, GLint zoffset
,
3653 GLsizei width
, GLsizei height
, GLsizei depth
,
3654 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3656 GET_CURRENT_CONTEXT(ctx
);
3658 GLvoid
*image
= unpack_image(3, width
, height
, depth
, format
, type
,
3659 pixels
, &ctx
->Unpack
);
3660 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3661 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
3668 n
[6].i
= (GLint
) width
;
3669 n
[7].i
= (GLint
) height
;
3670 n
[8].i
= (GLint
) depth
;
3678 if (ctx
->ExecuteFlag
) {
3679 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
3680 xoffset
, yoffset
, zoffset
,
3681 width
, height
, depth
, format
, type
,
3687 static void GLAPIENTRY
3688 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
3690 GET_CURRENT_CONTEXT(ctx
);
3692 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3693 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRANSLATE
, 3);
3699 if (ctx
->ExecuteFlag
) {
3700 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
3705 static void GLAPIENTRY
3706 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
3708 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3713 static void GLAPIENTRY
3714 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3716 GET_CURRENT_CONTEXT(ctx
);
3718 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3719 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_VIEWPORT
, 4);
3723 n
[3].i
= (GLint
) width
;
3724 n
[4].i
= (GLint
) height
;
3726 if (ctx
->ExecuteFlag
) {
3727 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
3732 static void GLAPIENTRY
3733 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3735 GET_CURRENT_CONTEXT(ctx
);
3737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3738 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_WINDOW_POS
, 4);
3745 if (ctx
->ExecuteFlag
) {
3746 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
3750 static void GLAPIENTRY
3751 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3753 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3756 static void GLAPIENTRY
3757 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3759 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3762 static void GLAPIENTRY
3763 save_WindowPos2iMESA(GLint x
, GLint y
)
3765 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3768 static void GLAPIENTRY
3769 save_WindowPos2sMESA(GLshort x
, GLshort y
)
3771 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3774 static void GLAPIENTRY
3775 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3777 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3780 static void GLAPIENTRY
3781 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3783 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3786 static void GLAPIENTRY
3787 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3789 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3792 static void GLAPIENTRY
3793 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3795 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3798 static void GLAPIENTRY
3799 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3801 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3804 static void GLAPIENTRY
3805 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3807 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3810 static void GLAPIENTRY
3811 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3813 save_WindowPos4fMESA(x
, y
, z
, w
);
3816 static void GLAPIENTRY
3817 save_WindowPos2dvMESA(const GLdouble
* v
)
3819 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3822 static void GLAPIENTRY
3823 save_WindowPos2fvMESA(const GLfloat
* v
)
3825 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3828 static void GLAPIENTRY
3829 save_WindowPos2ivMESA(const GLint
* v
)
3831 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3834 static void GLAPIENTRY
3835 save_WindowPos2svMESA(const GLshort
* v
)
3837 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3840 static void GLAPIENTRY
3841 save_WindowPos3dvMESA(const GLdouble
* v
)
3843 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3846 static void GLAPIENTRY
3847 save_WindowPos3fvMESA(const GLfloat
* v
)
3849 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3852 static void GLAPIENTRY
3853 save_WindowPos3ivMESA(const GLint
* v
)
3855 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3858 static void GLAPIENTRY
3859 save_WindowPos3svMESA(const GLshort
* v
)
3861 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3864 static void GLAPIENTRY
3865 save_WindowPos4dvMESA(const GLdouble
* v
)
3867 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3868 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3871 static void GLAPIENTRY
3872 save_WindowPos4fvMESA(const GLfloat
* v
)
3874 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3877 static void GLAPIENTRY
3878 save_WindowPos4ivMESA(const GLint
* v
)
3880 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3881 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3884 static void GLAPIENTRY
3885 save_WindowPos4svMESA(const GLshort
* v
)
3887 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3892 /* GL_ARB_multitexture */
3893 static void GLAPIENTRY
3894 save_ActiveTextureARB(GLenum target
)
3896 GET_CURRENT_CONTEXT(ctx
);
3898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3899 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
3903 if (ctx
->ExecuteFlag
) {
3904 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
3909 /* GL_ARB_transpose_matrix */
3911 static void GLAPIENTRY
3912 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
3915 _math_transposefd(tm
, m
);
3916 save_LoadMatrixf(tm
);
3920 static void GLAPIENTRY
3921 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
3924 _math_transposef(tm
, m
);
3925 save_LoadMatrixf(tm
);
3929 static void GLAPIENTRY
3930 save_MultTransposeMatrixdARB(const GLdouble m
[16])
3933 _math_transposefd(tm
, m
);
3934 save_MultMatrixf(tm
);
3938 static void GLAPIENTRY
3939 save_MultTransposeMatrixfARB(const GLfloat m
[16])
3942 _math_transposef(tm
, m
);
3943 save_MultMatrixf(tm
);
3947 /* GL_ARB_texture_compression */
3948 static void GLAPIENTRY
3949 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3950 GLenum internalFormat
, GLsizei width
,
3951 GLint border
, GLsizei imageSize
,
3952 const GLvoid
* data
)
3954 GET_CURRENT_CONTEXT(ctx
);
3955 if (target
== GL_PROXY_TEXTURE_1D
) {
3956 /* don't compile, execute immediately */
3957 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
3958 width
, border
, imageSize
,
3964 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3965 /* make copy of image */
3966 image
= _mesa_malloc(imageSize
);
3968 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
3971 MEMCPY(image
, data
, imageSize
);
3972 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
3976 n
[3].e
= internalFormat
;
3977 n
[4].i
= (GLint
) width
;
3985 if (ctx
->ExecuteFlag
) {
3986 CALL_CompressedTexImage1DARB(ctx
->Exec
,
3987 (target
, level
, internalFormat
, width
,
3988 border
, imageSize
, data
));
3994 static void GLAPIENTRY
3995 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
3996 GLenum internalFormat
, GLsizei width
,
3997 GLsizei height
, GLint border
, GLsizei imageSize
,
3998 const GLvoid
* data
)
4000 GET_CURRENT_CONTEXT(ctx
);
4001 if (target
== GL_PROXY_TEXTURE_2D
) {
4002 /* don't compile, execute immediately */
4003 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4004 width
, height
, border
,
4010 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4011 /* make copy of image */
4012 image
= _mesa_malloc(imageSize
);
4014 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4017 MEMCPY(image
, data
, imageSize
);
4018 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4022 n
[3].e
= internalFormat
;
4023 n
[4].i
= (GLint
) width
;
4024 n
[5].i
= (GLint
) height
;
4032 if (ctx
->ExecuteFlag
) {
4033 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4034 (target
, level
, internalFormat
, width
,
4035 height
, border
, imageSize
, data
));
4041 static void GLAPIENTRY
4042 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4043 GLenum internalFormat
, GLsizei width
,
4044 GLsizei height
, GLsizei depth
, GLint border
,
4045 GLsizei imageSize
, const GLvoid
* data
)
4047 GET_CURRENT_CONTEXT(ctx
);
4048 if (target
== GL_PROXY_TEXTURE_3D
) {
4049 /* don't compile, execute immediately */
4050 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4051 width
, height
, depth
, border
,
4057 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4058 /* make copy of image */
4059 image
= _mesa_malloc(imageSize
);
4061 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4064 MEMCPY(image
, data
, imageSize
);
4065 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4069 n
[3].e
= internalFormat
;
4070 n
[4].i
= (GLint
) width
;
4071 n
[5].i
= (GLint
) height
;
4072 n
[6].i
= (GLint
) depth
;
4080 if (ctx
->ExecuteFlag
) {
4081 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4082 (target
, level
, internalFormat
, width
,
4083 height
, depth
, border
, imageSize
,
4090 static void GLAPIENTRY
4091 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4092 GLsizei width
, GLenum format
,
4093 GLsizei imageSize
, const GLvoid
* data
)
4098 GET_CURRENT_CONTEXT(ctx
);
4099 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4101 /* make copy of image */
4102 image
= _mesa_malloc(imageSize
);
4104 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4107 MEMCPY(image
, data
, imageSize
);
4108 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4113 n
[4].i
= (GLint
) width
;
4121 if (ctx
->ExecuteFlag
) {
4122 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4123 width
, format
, imageSize
,
4129 static void GLAPIENTRY
4130 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4131 GLint yoffset
, GLsizei width
, GLsizei height
,
4132 GLenum format
, GLsizei imageSize
,
4133 const GLvoid
* data
)
4138 GET_CURRENT_CONTEXT(ctx
);
4139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4141 /* make copy of image */
4142 image
= _mesa_malloc(imageSize
);
4144 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4147 MEMCPY(image
, data
, imageSize
);
4148 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4154 n
[5].i
= (GLint
) width
;
4155 n
[6].i
= (GLint
) height
;
4163 if (ctx
->ExecuteFlag
) {
4164 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4165 (target
, level
, xoffset
, yoffset
, width
,
4166 height
, format
, imageSize
, data
));
4171 static void GLAPIENTRY
4172 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4173 GLint yoffset
, GLint zoffset
, GLsizei width
,
4174 GLsizei height
, GLsizei depth
, GLenum format
,
4175 GLsizei imageSize
, const GLvoid
* data
)
4180 GET_CURRENT_CONTEXT(ctx
);
4181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4183 /* make copy of image */
4184 image
= _mesa_malloc(imageSize
);
4186 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4189 MEMCPY(image
, data
, imageSize
);
4190 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4197 n
[6].i
= (GLint
) width
;
4198 n
[7].i
= (GLint
) height
;
4199 n
[8].i
= (GLint
) depth
;
4201 n
[10].i
= imageSize
;
4207 if (ctx
->ExecuteFlag
) {
4208 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4209 (target
, level
, xoffset
, yoffset
,
4210 zoffset
, width
, height
, depth
, format
,
4216 /* GL_ARB_multisample */
4217 static void GLAPIENTRY
4218 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4220 GET_CURRENT_CONTEXT(ctx
);
4222 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4223 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4228 if (ctx
->ExecuteFlag
) {
4229 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4235 * GL_NV_vertex_program
4237 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4238 static void GLAPIENTRY
4239 save_BindProgramNV(GLenum target
, GLuint id
)
4241 GET_CURRENT_CONTEXT(ctx
);
4243 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4244 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4249 if (ctx
->ExecuteFlag
) {
4250 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4253 #endif /* FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4255 #if FEATURE_NV_vertex_program
4256 static void GLAPIENTRY
4257 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4259 GET_CURRENT_CONTEXT(ctx
);
4261 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4262 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4271 if (ctx
->ExecuteFlag
) {
4272 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4277 static void GLAPIENTRY
4278 save_ProgramParameter4fNV(GLenum target
, GLuint index
,
4279 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4281 GET_CURRENT_CONTEXT(ctx
);
4283 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4284 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_PARAMETER4F_NV
, 6);
4293 if (ctx
->ExecuteFlag
) {
4294 CALL_ProgramParameter4fNV(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4299 static void GLAPIENTRY
4300 save_ProgramParameter4fvNV(GLenum target
, GLuint index
,
4301 const GLfloat
*params
)
4303 save_ProgramParameter4fNV(target
, index
, params
[0], params
[1],
4304 params
[2], params
[3]);
4308 static void GLAPIENTRY
4309 save_ProgramParameter4dNV(GLenum target
, GLuint index
,
4310 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4312 save_ProgramParameter4fNV(target
, index
, (GLfloat
) x
, (GLfloat
) y
,
4313 (GLfloat
) z
, (GLfloat
) w
);
4317 static void GLAPIENTRY
4318 save_ProgramParameter4dvNV(GLenum target
, GLuint index
,
4319 const GLdouble
*params
)
4321 save_ProgramParameter4fNV(target
, index
, (GLfloat
) params
[0],
4322 (GLfloat
) params
[1], (GLfloat
) params
[2],
4323 (GLfloat
) params
[3]);
4327 static void GLAPIENTRY
4328 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4329 GLuint num
, const GLdouble
*params
)
4332 for (i
= 0; i
< num
; i
++) {
4333 save_ProgramParameter4dvNV(target
, index
+ i
, params
+ 4 * i
);
4338 static void GLAPIENTRY
4339 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4340 GLuint num
, const GLfloat
*params
)
4343 for (i
= 0; i
< num
; i
++) {
4344 save_ProgramParameter4fvNV(target
, index
+ i
, params
+ 4 * i
);
4349 static void GLAPIENTRY
4350 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4351 const GLubyte
* program
)
4353 GET_CURRENT_CONTEXT(ctx
);
4355 GLubyte
*programCopy
;
4357 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4359 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4362 _mesa_memcpy(programCopy
, program
, len
);
4364 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4365 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4370 n
[4].data
= programCopy
;
4372 if (ctx
->ExecuteFlag
) {
4373 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4378 static void GLAPIENTRY
4379 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4381 GET_CURRENT_CONTEXT(ctx
);
4383 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4385 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4388 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4389 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4390 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4395 if (ctx
->ExecuteFlag
) {
4396 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4401 static void GLAPIENTRY
4402 save_TrackMatrixNV(GLenum target
, GLuint address
,
4403 GLenum matrix
, GLenum transform
)
4405 GET_CURRENT_CONTEXT(ctx
);
4407 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4408 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4415 if (ctx
->ExecuteFlag
) {
4416 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4419 #endif /* FEATURE_NV_vertex_program */
4423 * GL_NV_fragment_program
4425 #if FEATURE_NV_fragment_program
4426 static void GLAPIENTRY
4427 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4428 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4430 GET_CURRENT_CONTEXT(ctx
);
4432 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4433 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4442 if (ctx
->ExecuteFlag
) {
4443 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4448 static void GLAPIENTRY
4449 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4450 const GLfloat
*params
)
4452 GET_CURRENT_CONTEXT(ctx
);
4454 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4455 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4464 if (ctx
->ExecuteFlag
) {
4465 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4470 static void GLAPIENTRY
4471 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4472 GLdouble x
, GLdouble y
,
4473 GLdouble z
, GLdouble w
)
4475 GET_CURRENT_CONTEXT(ctx
);
4477 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4478 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4482 n
[3].f
= (GLfloat
) x
;
4483 n
[4].f
= (GLfloat
) y
;
4484 n
[5].f
= (GLfloat
) z
;
4485 n
[6].f
= (GLfloat
) w
;
4487 if (ctx
->ExecuteFlag
) {
4488 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4493 static void GLAPIENTRY
4494 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4495 const GLdouble
*params
)
4497 GET_CURRENT_CONTEXT(ctx
);
4499 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4500 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4504 n
[3].f
= (GLfloat
) params
[0];
4505 n
[4].f
= (GLfloat
) params
[1];
4506 n
[5].f
= (GLfloat
) params
[2];
4507 n
[6].f
= (GLfloat
) params
[3];
4509 if (ctx
->ExecuteFlag
) {
4510 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4514 static void GLAPIENTRY
4515 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4516 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4518 GET_CURRENT_CONTEXT(ctx
);
4520 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4522 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4525 _mesa_memcpy(nameCopy
, name
, len
);
4527 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4528 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
4532 n
[3].data
= nameCopy
;
4538 if (ctx
->ExecuteFlag
) {
4539 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
4544 static void GLAPIENTRY
4545 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4548 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4552 static void GLAPIENTRY
4553 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4554 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4556 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4557 (GLfloat
) z
, (GLfloat
) w
);
4561 static void GLAPIENTRY
4562 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4565 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4566 (GLfloat
) v
[1], (GLfloat
) v
[2],
4570 #endif /* FEATURE_NV_fragment_program */
4574 /* GL_EXT_stencil_two_side */
4575 static void GLAPIENTRY
4576 save_ActiveStencilFaceEXT(GLenum face
)
4578 GET_CURRENT_CONTEXT(ctx
);
4580 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4581 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
4585 if (ctx
->ExecuteFlag
) {
4586 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
4591 /* GL_EXT_depth_bounds_test */
4592 static void GLAPIENTRY
4593 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
4595 GET_CURRENT_CONTEXT(ctx
);
4597 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4598 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
4600 n
[1].f
= (GLfloat
) zmin
;
4601 n
[2].f
= (GLfloat
) zmax
;
4603 if (ctx
->ExecuteFlag
) {
4604 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
4610 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4612 static void GLAPIENTRY
4613 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4614 const GLvoid
* string
)
4616 GET_CURRENT_CONTEXT(ctx
);
4618 GLubyte
*programCopy
;
4620 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4622 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4625 _mesa_memcpy(programCopy
, string
, len
);
4627 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4628 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
4633 n
[4].data
= programCopy
;
4635 if (ctx
->ExecuteFlag
) {
4636 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
4641 static void GLAPIENTRY
4642 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4643 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4645 GET_CURRENT_CONTEXT(ctx
);
4647 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4648 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4657 if (ctx
->ExecuteFlag
) {
4658 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4663 static void GLAPIENTRY
4664 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4665 const GLfloat
*params
)
4667 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4668 params
[2], params
[3]);
4672 static void GLAPIENTRY
4673 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4674 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4676 save_ProgramEnvParameter4fARB(target
, index
,
4678 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4682 static void GLAPIENTRY
4683 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4684 const GLdouble
*params
)
4686 save_ProgramEnvParameter4fARB(target
, index
,
4687 (GLfloat
) params
[0],
4688 (GLfloat
) params
[1],
4689 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4692 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4695 #ifdef FEATURE_ARB_occlusion_query
4697 static void GLAPIENTRY
4698 save_BeginQueryARB(GLenum target
, GLuint id
)
4700 GET_CURRENT_CONTEXT(ctx
);
4702 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4703 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
4708 if (ctx
->ExecuteFlag
) {
4709 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
4714 static void GLAPIENTRY
4715 save_EndQueryARB(GLenum target
)
4717 GET_CURRENT_CONTEXT(ctx
);
4719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4720 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_END_QUERY_ARB
, 1);
4724 if (ctx
->ExecuteFlag
) {
4725 CALL_EndQueryARB(ctx
->Exec
, (target
));
4729 #endif /* FEATURE_ARB_occlusion_query */
4732 static void GLAPIENTRY
4733 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
4735 GET_CURRENT_CONTEXT(ctx
);
4737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4738 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
4742 if (count
> MAX_DRAW_BUFFERS
)
4743 count
= MAX_DRAW_BUFFERS
;
4744 for (i
= 0; i
< count
; i
++) {
4745 n
[2 + i
].e
= buffers
[i
];
4748 if (ctx
->ExecuteFlag
) {
4749 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
4753 #if FEATURE_ATI_fragment_shader
4754 static void GLAPIENTRY
4755 save_BindFragmentShaderATI(GLuint id
)
4757 GET_CURRENT_CONTEXT(ctx
);
4760 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
4764 if (ctx
->ExecuteFlag
) {
4765 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
4769 static void GLAPIENTRY
4770 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
4772 GET_CURRENT_CONTEXT(ctx
);
4775 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
4783 if (ctx
->ExecuteFlag
) {
4784 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
4790 save_Attr1fNV(GLenum attr
, GLfloat x
)
4792 GET_CURRENT_CONTEXT(ctx
);
4794 SAVE_FLUSH_VERTICES(ctx
);
4795 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_NV
, 2);
4801 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4802 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4803 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4805 if (ctx
->ExecuteFlag
) {
4806 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
4811 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
4813 GET_CURRENT_CONTEXT(ctx
);
4815 SAVE_FLUSH_VERTICES(ctx
);
4816 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_NV
, 3);
4823 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4824 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4825 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4827 if (ctx
->ExecuteFlag
) {
4828 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
4833 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4835 GET_CURRENT_CONTEXT(ctx
);
4837 SAVE_FLUSH_VERTICES(ctx
);
4838 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_NV
, 4);
4846 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4847 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4848 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4850 if (ctx
->ExecuteFlag
) {
4851 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
4856 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4858 GET_CURRENT_CONTEXT(ctx
);
4860 SAVE_FLUSH_VERTICES(ctx
);
4861 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_NV
, 5);
4870 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4871 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4872 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4874 if (ctx
->ExecuteFlag
) {
4875 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
4881 save_Attr1fARB(GLenum attr
, GLfloat x
)
4883 GET_CURRENT_CONTEXT(ctx
);
4885 SAVE_FLUSH_VERTICES(ctx
);
4886 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_ARB
, 2);
4892 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
4893 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4894 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4896 if (ctx
->ExecuteFlag
) {
4897 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
4902 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
4904 GET_CURRENT_CONTEXT(ctx
);
4906 SAVE_FLUSH_VERTICES(ctx
);
4907 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_ARB
, 3);
4914 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
4915 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4916 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4918 if (ctx
->ExecuteFlag
) {
4919 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
4924 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4926 GET_CURRENT_CONTEXT(ctx
);
4928 SAVE_FLUSH_VERTICES(ctx
);
4929 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_ARB
, 4);
4937 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
4938 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4939 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4941 if (ctx
->ExecuteFlag
) {
4942 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
4947 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4949 GET_CURRENT_CONTEXT(ctx
);
4951 SAVE_FLUSH_VERTICES(ctx
);
4952 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_ARB
, 5);
4961 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
4962 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4963 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4965 if (ctx
->ExecuteFlag
) {
4966 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
4971 static void GLAPIENTRY
4972 save_EvalCoord1f(GLfloat x
)
4974 GET_CURRENT_CONTEXT(ctx
);
4976 SAVE_FLUSH_VERTICES(ctx
);
4977 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C1
, 1);
4981 if (ctx
->ExecuteFlag
) {
4982 CALL_EvalCoord1f(ctx
->Exec
, (x
));
4986 static void GLAPIENTRY
4987 save_EvalCoord1fv(const GLfloat
* v
)
4989 save_EvalCoord1f(v
[0]);
4992 static void GLAPIENTRY
4993 save_EvalCoord2f(GLfloat x
, GLfloat y
)
4995 GET_CURRENT_CONTEXT(ctx
);
4997 SAVE_FLUSH_VERTICES(ctx
);
4998 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C2
, 2);
5003 if (ctx
->ExecuteFlag
) {
5004 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5008 static void GLAPIENTRY
5009 save_EvalCoord2fv(const GLfloat
* v
)
5011 save_EvalCoord2f(v
[0], v
[1]);
5015 static void GLAPIENTRY
5016 save_EvalPoint1(GLint x
)
5018 GET_CURRENT_CONTEXT(ctx
);
5020 SAVE_FLUSH_VERTICES(ctx
);
5021 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P1
, 1);
5025 if (ctx
->ExecuteFlag
) {
5026 CALL_EvalPoint1(ctx
->Exec
, (x
));
5030 static void GLAPIENTRY
5031 save_EvalPoint2(GLint x
, GLint y
)
5033 GET_CURRENT_CONTEXT(ctx
);
5035 SAVE_FLUSH_VERTICES(ctx
);
5036 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P2
, 2);
5041 if (ctx
->ExecuteFlag
) {
5042 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5046 static void GLAPIENTRY
5047 save_Indexf(GLfloat x
)
5049 GET_CURRENT_CONTEXT(ctx
);
5051 SAVE_FLUSH_VERTICES(ctx
);
5052 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_INDEX
, 1);
5057 ctx
->ListState
.ActiveIndex
= 1;
5058 ctx
->ListState
.CurrentIndex
= x
;
5060 if (ctx
->ExecuteFlag
) {
5061 CALL_Indexf(ctx
->Exec
, (x
));
5065 static void GLAPIENTRY
5066 save_Indexfv(const GLfloat
* v
)
5071 static void GLAPIENTRY
5072 save_EdgeFlag(GLboolean x
)
5074 GET_CURRENT_CONTEXT(ctx
);
5076 SAVE_FLUSH_VERTICES(ctx
);
5077 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EDGEFLAG
, 1);
5082 ctx
->ListState
.ActiveEdgeFlag
= 1;
5083 ctx
->ListState
.CurrentEdgeFlag
= x
;
5085 if (ctx
->ExecuteFlag
) {
5086 CALL_EdgeFlag(ctx
->Exec
, (x
));
5090 static void GLAPIENTRY
5091 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5093 GET_CURRENT_CONTEXT(ctx
);
5097 SAVE_FLUSH_VERTICES(ctx
);
5102 case GL_FRONT_AND_BACK
:
5105 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5114 case GL_AMBIENT_AND_DIFFUSE
:
5120 case GL_COLOR_INDEXES
:
5124 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5128 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATERIAL
, 6);
5132 for (i
= 0; i
< args
; i
++)
5133 n
[3 + i
].f
= param
[i
];
5137 GLuint bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5138 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
5139 if (bitmask
& (1 << i
)) {
5140 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5141 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5145 if (ctx
->ExecuteFlag
) {
5146 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5150 static void GLAPIENTRY
5151 save_Begin(GLenum mode
)
5153 GET_CURRENT_CONTEXT(ctx
);
5155 GLboolean error
= GL_FALSE
;
5157 if ( /*mode < GL_POINTS || */ mode
> GL_POLYGON
) {
5158 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5161 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5162 /* Typically the first begin. This may raise an error on
5163 * playback, depending on whether CallList is issued from inside
5164 * a begin/end or not.
5166 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5168 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5169 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5172 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5177 /* Give the driver an opportunity to hook in an optimized
5178 * display list compiler.
5180 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5183 SAVE_FLUSH_VERTICES(ctx
);
5184 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN
, 1);
5190 if (ctx
->ExecuteFlag
) {
5191 CALL_Begin(ctx
->Exec
, (mode
));
5195 static void GLAPIENTRY
5198 GET_CURRENT_CONTEXT(ctx
);
5199 SAVE_FLUSH_VERTICES(ctx
);
5200 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END
, 0);
5201 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5202 if (ctx
->ExecuteFlag
) {
5203 CALL_End(ctx
->Exec
, ());
5207 static void GLAPIENTRY
5208 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5210 GET_CURRENT_CONTEXT(ctx
);
5212 SAVE_FLUSH_VERTICES(ctx
);
5213 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RECTF
, 4);
5220 if (ctx
->ExecuteFlag
) {
5221 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5226 static void GLAPIENTRY
5227 save_Vertex2f(GLfloat x
, GLfloat y
)
5229 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5232 static void GLAPIENTRY
5233 save_Vertex2fv(const GLfloat
* v
)
5235 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5238 static void GLAPIENTRY
5239 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5241 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5244 static void GLAPIENTRY
5245 save_Vertex3fv(const GLfloat
* v
)
5247 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5250 static void GLAPIENTRY
5251 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5253 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5256 static void GLAPIENTRY
5257 save_Vertex4fv(const GLfloat
* v
)
5259 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5262 static void GLAPIENTRY
5263 save_TexCoord1f(GLfloat x
)
5265 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5268 static void GLAPIENTRY
5269 save_TexCoord1fv(const GLfloat
* v
)
5271 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5274 static void GLAPIENTRY
5275 save_TexCoord2f(GLfloat x
, GLfloat y
)
5277 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5280 static void GLAPIENTRY
5281 save_TexCoord2fv(const GLfloat
* v
)
5283 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5286 static void GLAPIENTRY
5287 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5289 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5292 static void GLAPIENTRY
5293 save_TexCoord3fv(const GLfloat
* v
)
5295 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5298 static void GLAPIENTRY
5299 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5301 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5304 static void GLAPIENTRY
5305 save_TexCoord4fv(const GLfloat
* v
)
5307 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5310 static void GLAPIENTRY
5311 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5313 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5316 static void GLAPIENTRY
5317 save_Normal3fv(const GLfloat
* v
)
5319 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5322 static void GLAPIENTRY
5323 save_FogCoordfEXT(GLfloat x
)
5325 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5328 static void GLAPIENTRY
5329 save_FogCoordfvEXT(const GLfloat
* v
)
5331 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5334 static void GLAPIENTRY
5335 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5337 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5340 static void GLAPIENTRY
5341 save_Color3fv(const GLfloat
* v
)
5343 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5346 static void GLAPIENTRY
5347 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5349 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5352 static void GLAPIENTRY
5353 save_Color4fv(const GLfloat
* v
)
5355 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5358 static void GLAPIENTRY
5359 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5361 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5364 static void GLAPIENTRY
5365 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5367 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5371 /* Just call the respective ATTR for texcoord
5373 static void GLAPIENTRY
5374 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5376 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5377 save_Attr1fNV(attr
, x
);
5380 static void GLAPIENTRY
5381 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5383 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5384 save_Attr1fNV(attr
, v
[0]);
5387 static void GLAPIENTRY
5388 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5390 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5391 save_Attr2fNV(attr
, x
, y
);
5394 static void GLAPIENTRY
5395 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5397 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5398 save_Attr2fNV(attr
, v
[0], v
[1]);
5401 static void GLAPIENTRY
5402 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5404 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5405 save_Attr3fNV(attr
, x
, y
, z
);
5408 static void GLAPIENTRY
5409 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5411 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5412 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5415 static void GLAPIENTRY
5416 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5417 GLfloat z
, GLfloat w
)
5419 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5420 save_Attr4fNV(attr
, x
, y
, z
, w
);
5423 static void GLAPIENTRY
5424 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5426 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5427 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5432 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5438 GET_CURRENT_CONTEXT(ctx
);
5439 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5443 /* First level for NV_vertex_program:
5445 * Check for errors at compile time?.
5447 static void GLAPIENTRY
5448 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
5450 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5451 save_Attr1fNV(index
, x
);
5456 static void GLAPIENTRY
5457 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
5459 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5460 save_Attr1fNV(index
, v
[0]);
5465 static void GLAPIENTRY
5466 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
5468 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5469 save_Attr2fNV(index
, x
, y
);
5474 static void GLAPIENTRY
5475 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
5477 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5478 save_Attr2fNV(index
, v
[0], v
[1]);
5483 static void GLAPIENTRY
5484 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5486 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5487 save_Attr3fNV(index
, x
, y
, z
);
5492 static void GLAPIENTRY
5493 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
5495 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5496 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
5501 static void GLAPIENTRY
5502 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
5503 GLfloat z
, GLfloat w
)
5505 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5506 save_Attr4fNV(index
, x
, y
, z
, w
);
5511 static void GLAPIENTRY
5512 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
5514 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5515 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
5523 static void GLAPIENTRY
5524 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5526 if (index
< MAX_VERTEX_ATTRIBS
)
5527 save_Attr1fARB(index
, x
);
5532 static void GLAPIENTRY
5533 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5535 if (index
< MAX_VERTEX_ATTRIBS
)
5536 save_Attr1fARB(index
, v
[0]);
5541 static void GLAPIENTRY
5542 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5544 if (index
< MAX_VERTEX_ATTRIBS
)
5545 save_Attr2fARB(index
, x
, y
);
5550 static void GLAPIENTRY
5551 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5553 if (index
< MAX_VERTEX_ATTRIBS
)
5554 save_Attr2fARB(index
, v
[0], v
[1]);
5559 static void GLAPIENTRY
5560 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5562 if (index
< MAX_VERTEX_ATTRIBS
)
5563 save_Attr3fARB(index
, x
, y
, z
);
5568 static void GLAPIENTRY
5569 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
5571 if (index
< MAX_VERTEX_ATTRIBS
)
5572 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
5577 static void GLAPIENTRY
5578 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
5581 if (index
< MAX_VERTEX_ATTRIBS
)
5582 save_Attr4fARB(index
, x
, y
, z
, w
);
5587 static void GLAPIENTRY
5588 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
5590 if (index
< MAX_VERTEX_ATTRIBS
)
5591 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
5597 #if FEATURE_EXT_framebuffer_blit
5598 static void GLAPIENTRY
5599 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
5600 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
5601 GLbitfield mask
, GLenum filter
)
5603 GET_CURRENT_CONTEXT(ctx
);
5605 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5606 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
5619 if (ctx
->ExecuteFlag
) {
5620 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
5621 dstX0
, dstY0
, dstX1
, dstY1
,
5629 * Save an error-generating command into display list.
5631 * KW: Will appear in the list before the vertex buffer containing the
5632 * command that provoked the error. I don't see this as a problem.
5635 save_error(GLcontext
*ctx
, GLenum error
, const char *s
)
5638 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ERROR
, 2);
5641 n
[2].data
= (void *) s
;
5647 * Compile an error into current display list.
5650 _mesa_compile_error(GLcontext
*ctx
, GLenum error
, const char *s
)
5652 if (ctx
->CompileFlag
)
5653 save_error(ctx
, error
, s
);
5654 if (ctx
->ExecuteFlag
)
5655 _mesa_error(ctx
, error
, s
);
5660 * Test if ID names a display list.
5663 islist(GLcontext
*ctx
, GLuint list
)
5665 if (list
> 0 && lookup_list(ctx
, list
)) {
5675 /**********************************************************************/
5676 /* Display list execution */
5677 /**********************************************************************/
5681 * Execute a display list. Note that the ListBase offset must have already
5682 * been added before calling this function. I.e. the list argument is
5683 * the absolute list number, not relative to ListBase.
5684 * \param list - display list number
5687 execute_list(GLcontext
*ctx
, GLuint list
)
5689 struct mesa_display_list
*dlist
;
5693 if (list
== 0 || !islist(ctx
, list
))
5696 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
5697 /* raise an error? */
5701 dlist
= lookup_list(ctx
, list
);
5705 ctx
->ListState
.CallStack
[ctx
->ListState
.CallDepth
++] = dlist
;
5707 if (ctx
->Driver
.BeginCallList
)
5708 ctx
->Driver
.BeginCallList(ctx
, dlist
);
5714 OpCode opcode
= n
[0].opcode
;
5715 int i
= (int) n
[0].opcode
- (int) OPCODE_EXT_0
;
5717 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
5718 /* this is a driver-extended opcode */
5719 ctx
->ListExt
.Opcode
[i
].Execute(ctx
, &n
[1]);
5720 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
5725 _mesa_error(ctx
, n
[1].e
, (const char *) n
[2].data
);
5728 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
5730 case OPCODE_ALPHA_FUNC
:
5731 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
5733 case OPCODE_BIND_TEXTURE
:
5734 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
5738 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5739 ctx
->Unpack
= ctx
->DefaultPacking
;
5740 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5741 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
5742 (const GLubyte
*) n
[7].data
));
5743 ctx
->Unpack
= save
; /* restore */
5746 case OPCODE_BLEND_COLOR
:
5747 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5749 case OPCODE_BLEND_EQUATION
:
5750 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
5752 case OPCODE_BLEND_EQUATION_SEPARATE
:
5753 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5755 case OPCODE_BLEND_FUNC_SEPARATE
:
5756 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
5757 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
5759 case OPCODE_CALL_LIST
:
5760 /* Generated by glCallList(), don't add ListBase */
5761 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5762 execute_list(ctx
, n
[1].ui
);
5765 case OPCODE_CALL_LIST_OFFSET
:
5766 /* Generated by glCallLists() so we must add ListBase */
5768 /* user specified a bad data type at compile time */
5769 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5771 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5772 execute_list(ctx
, ctx
->List
.ListBase
+ n
[1].ui
);
5776 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
5778 case OPCODE_CLEAR_COLOR
:
5779 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5781 case OPCODE_CLEAR_ACCUM
:
5782 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5784 case OPCODE_CLEAR_DEPTH
:
5785 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
5787 case OPCODE_CLEAR_INDEX
:
5788 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
5790 case OPCODE_CLEAR_STENCIL
:
5791 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
5793 case OPCODE_CLIP_PLANE
:
5800 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
5803 case OPCODE_COLOR_MASK
:
5804 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
5806 case OPCODE_COLOR_MATERIAL
:
5807 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5809 case OPCODE_COLOR_TABLE
:
5811 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5812 ctx
->Unpack
= ctx
->DefaultPacking
;
5813 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5814 n
[5].e
, n
[6].data
));
5815 ctx
->Unpack
= save
; /* restore */
5818 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
5825 CALL_ColorTableParameterfv(ctx
->Exec
,
5826 (n
[1].e
, n
[2].e
, params
));
5829 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
5836 CALL_ColorTableParameteriv(ctx
->Exec
,
5837 (n
[1].e
, n
[2].e
, params
));
5840 case OPCODE_COLOR_SUB_TABLE
:
5842 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5843 ctx
->Unpack
= ctx
->DefaultPacking
;
5844 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5845 n
[4].e
, n
[5].e
, n
[6].data
));
5846 ctx
->Unpack
= save
; /* restore */
5849 case OPCODE_CONVOLUTION_FILTER_1D
:
5851 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5852 ctx
->Unpack
= ctx
->DefaultPacking
;
5853 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5856 ctx
->Unpack
= save
; /* restore */
5859 case OPCODE_CONVOLUTION_FILTER_2D
:
5861 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5862 ctx
->Unpack
= ctx
->DefaultPacking
;
5863 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5864 n
[4].i
, n
[5].e
, n
[6].e
,
5866 ctx
->Unpack
= save
; /* restore */
5869 case OPCODE_CONVOLUTION_PARAMETER_I
:
5870 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
5872 case OPCODE_CONVOLUTION_PARAMETER_IV
:
5879 CALL_ConvolutionParameteriv(ctx
->Exec
,
5880 (n
[1].e
, n
[2].e
, params
));
5883 case OPCODE_CONVOLUTION_PARAMETER_F
:
5884 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
5886 case OPCODE_CONVOLUTION_PARAMETER_FV
:
5893 CALL_ConvolutionParameterfv(ctx
->Exec
,
5894 (n
[1].e
, n
[2].e
, params
));
5897 case OPCODE_COPY_COLOR_SUB_TABLE
:
5898 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
5899 n
[3].i
, n
[4].i
, n
[5].i
));
5901 case OPCODE_COPY_COLOR_TABLE
:
5902 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
5903 n
[3].i
, n
[4].i
, n
[5].i
));
5905 case OPCODE_COPY_PIXELS
:
5906 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
5907 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
5910 case OPCODE_COPY_TEX_IMAGE1D
:
5911 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5912 n
[5].i
, n
[6].i
, n
[7].i
));
5914 case OPCODE_COPY_TEX_IMAGE2D
:
5915 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5916 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
5918 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
5919 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5920 n
[4].i
, n
[5].i
, n
[6].i
));
5922 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
5923 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5924 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5927 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
5928 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5929 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5932 case OPCODE_CULL_FACE
:
5933 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
5935 case OPCODE_DEPTH_FUNC
:
5936 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
5938 case OPCODE_DEPTH_MASK
:
5939 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
5941 case OPCODE_DEPTH_RANGE
:
5942 CALL_DepthRange(ctx
->Exec
,
5943 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
5945 case OPCODE_DISABLE
:
5946 CALL_Disable(ctx
->Exec
, (n
[1].e
));
5948 case OPCODE_DRAW_BUFFER
:
5949 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
5951 case OPCODE_DRAW_PIXELS
:
5953 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5954 ctx
->Unpack
= ctx
->DefaultPacking
;
5955 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
5957 ctx
->Unpack
= save
; /* restore */
5961 CALL_Enable(ctx
->Exec
, (n
[1].e
));
5963 case OPCODE_EVALMESH1
:
5964 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
5966 case OPCODE_EVALMESH2
:
5967 CALL_EvalMesh2(ctx
->Exec
,
5968 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
5977 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
5980 case OPCODE_FRONT_FACE
:
5981 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
5983 case OPCODE_FRUSTUM
:
5984 CALL_Frustum(ctx
->Exec
,
5985 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
5988 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5990 case OPCODE_HISTOGRAM
:
5991 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
5993 case OPCODE_INDEX_MASK
:
5994 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
5996 case OPCODE_INIT_NAMES
:
5997 CALL_InitNames(ctx
->Exec
, ());
6006 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
6009 case OPCODE_LIGHT_MODEL
:
6016 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
6019 case OPCODE_LINE_STIPPLE
:
6020 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
6022 case OPCODE_LINE_WIDTH
:
6023 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
6025 case OPCODE_LIST_BASE
:
6026 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
6028 case OPCODE_LOAD_IDENTITY
:
6029 CALL_LoadIdentity(ctx
->Exec
, ());
6031 case OPCODE_LOAD_MATRIX
:
6032 if (sizeof(Node
) == sizeof(GLfloat
)) {
6033 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
6038 for (i
= 0; i
< 16; i
++) {
6041 CALL_LoadMatrixf(ctx
->Exec
, (m
));
6044 case OPCODE_LOAD_NAME
:
6045 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
6047 case OPCODE_LOGIC_OP
:
6048 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
6052 GLenum target
= n
[1].e
;
6053 GLint ustride
= _mesa_evaluator_components(target
);
6054 GLint uorder
= n
[5].i
;
6055 GLfloat u1
= n
[2].f
;
6056 GLfloat u2
= n
[3].f
;
6057 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6058 (GLfloat
*) n
[6].data
));
6063 GLenum target
= n
[1].e
;
6064 GLfloat u1
= n
[2].f
;
6065 GLfloat u2
= n
[3].f
;
6066 GLfloat v1
= n
[4].f
;
6067 GLfloat v2
= n
[5].f
;
6068 GLint ustride
= n
[6].i
;
6069 GLint vstride
= n
[7].i
;
6070 GLint uorder
= n
[8].i
;
6071 GLint vorder
= n
[9].i
;
6072 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6073 v1
, v2
, vstride
, vorder
,
6074 (GLfloat
*) n
[10].data
));
6077 case OPCODE_MAPGRID1
:
6078 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
6080 case OPCODE_MAPGRID2
:
6081 CALL_MapGrid2f(ctx
->Exec
,
6082 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
6084 case OPCODE_MATRIX_MODE
:
6085 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
6087 case OPCODE_MIN_MAX
:
6088 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
6090 case OPCODE_MULT_MATRIX
:
6091 if (sizeof(Node
) == sizeof(GLfloat
)) {
6092 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
6097 for (i
= 0; i
< 16; i
++) {
6100 CALL_MultMatrixf(ctx
->Exec
, (m
));
6104 CALL_Ortho(ctx
->Exec
,
6105 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6107 case OPCODE_PASSTHROUGH
:
6108 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
6110 case OPCODE_PIXEL_MAP
:
6111 CALL_PixelMapfv(ctx
->Exec
,
6112 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
6114 case OPCODE_PIXEL_TRANSFER
:
6115 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6117 case OPCODE_PIXEL_ZOOM
:
6118 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6120 case OPCODE_POINT_SIZE
:
6121 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
6123 case OPCODE_POINT_PARAMETERS
:
6129 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
6132 case OPCODE_POLYGON_MODE
:
6133 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6135 case OPCODE_POLYGON_STIPPLE
:
6136 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
6138 case OPCODE_POLYGON_OFFSET
:
6139 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6141 case OPCODE_POP_ATTRIB
:
6142 CALL_PopAttrib(ctx
->Exec
, ());
6144 case OPCODE_POP_MATRIX
:
6145 CALL_PopMatrix(ctx
->Exec
, ());
6147 case OPCODE_POP_NAME
:
6148 CALL_PopName(ctx
->Exec
, ());
6150 case OPCODE_PRIORITIZE_TEXTURE
:
6151 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
6153 case OPCODE_PUSH_ATTRIB
:
6154 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
6156 case OPCODE_PUSH_MATRIX
:
6157 CALL_PushMatrix(ctx
->Exec
, ());
6159 case OPCODE_PUSH_NAME
:
6160 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
6162 case OPCODE_RASTER_POS
:
6163 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6165 case OPCODE_READ_BUFFER
:
6166 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
6168 case OPCODE_RESET_HISTOGRAM
:
6169 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
6171 case OPCODE_RESET_MIN_MAX
:
6172 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
6175 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6178 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6180 case OPCODE_SCISSOR
:
6181 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
6183 case OPCODE_SHADE_MODEL
:
6184 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
6186 case OPCODE_STENCIL_FUNC
:
6187 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
6189 case OPCODE_STENCIL_MASK
:
6190 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
6192 case OPCODE_STENCIL_OP
:
6193 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
6195 case OPCODE_STENCIL_FUNC_SEPARATE
:
6196 CALL_StencilFuncSeparate(ctx
->Exec
,
6197 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
6199 case OPCODE_STENCIL_MASK_SEPARATE
:
6200 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6202 case OPCODE_STENCIL_OP_SEPARATE
:
6203 CALL_StencilOpSeparate(ctx
->Exec
,
6204 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6213 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6223 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6226 case OPCODE_TEXPARAMETER
:
6233 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6236 case OPCODE_TEX_IMAGE1D
:
6238 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6239 ctx
->Unpack
= ctx
->DefaultPacking
;
6240 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
6242 n
[3].i
, /* components */
6244 n
[5].e
, /* border */
6245 n
[6].e
, /* format */
6248 ctx
->Unpack
= save
; /* restore */
6251 case OPCODE_TEX_IMAGE2D
:
6253 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6254 ctx
->Unpack
= ctx
->DefaultPacking
;
6255 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
6257 n
[3].i
, /* components */
6259 n
[5].i
, /* height */
6260 n
[6].e
, /* border */
6261 n
[7].e
, /* format */
6264 ctx
->Unpack
= save
; /* restore */
6267 case OPCODE_TEX_IMAGE3D
:
6269 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6270 ctx
->Unpack
= ctx
->DefaultPacking
;
6271 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
6273 n
[3].i
, /* components */
6275 n
[5].i
, /* height */
6277 n
[7].e
, /* border */
6278 n
[8].e
, /* format */
6281 ctx
->Unpack
= save
; /* restore */
6284 case OPCODE_TEX_SUB_IMAGE1D
:
6286 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6287 ctx
->Unpack
= ctx
->DefaultPacking
;
6288 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6290 n
[6].e
, n
[7].data
));
6291 ctx
->Unpack
= save
; /* restore */
6294 case OPCODE_TEX_SUB_IMAGE2D
:
6296 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6297 ctx
->Unpack
= ctx
->DefaultPacking
;
6298 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6300 n
[6].i
, n
[7].e
, n
[8].e
,
6302 ctx
->Unpack
= save
; /* restore */
6305 case OPCODE_TEX_SUB_IMAGE3D
:
6307 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6308 ctx
->Unpack
= ctx
->DefaultPacking
;
6309 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6310 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6311 n
[8].i
, n
[9].e
, n
[10].e
,
6313 ctx
->Unpack
= save
; /* restore */
6316 case OPCODE_TRANSLATE
:
6317 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6319 case OPCODE_VIEWPORT
:
6320 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6321 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
6323 case OPCODE_WINDOW_POS
:
6324 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6326 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
6327 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
6329 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
6330 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6331 n
[4].i
, n
[5].i
, n
[6].i
,
6334 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
6335 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6336 n
[4].i
, n
[5].i
, n
[6].i
,
6337 n
[7].i
, n
[8].data
));
6339 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
6340 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6341 n
[4].i
, n
[5].i
, n
[6].i
,
6345 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
6346 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
6347 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6348 n
[5].e
, n
[6].i
, n
[7].data
));
6350 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
6351 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
6352 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6353 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
6356 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
6357 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
6358 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6359 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6360 n
[9].e
, n
[10].i
, n
[11].data
));
6362 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
6363 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
6365 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
6366 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6368 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6369 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
6370 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6373 #if FEATURE_NV_vertex_program
6374 case OPCODE_EXECUTE_PROGRAM_NV
:
6381 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
6384 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
6385 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
6386 (GLuint
*) n
[2].data
));
6388 case OPCODE_LOAD_PROGRAM_NV
:
6389 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
6390 (const GLubyte
*) n
[4].data
));
6392 case OPCODE_PROGRAM_PARAMETER4F_NV
:
6393 CALL_ProgramParameter4fNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6394 n
[4].f
, n
[5].f
, n
[6].f
));
6396 case OPCODE_TRACK_MATRIX_NV
:
6397 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
6401 #if FEATURE_NV_fragment_program
6402 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
6403 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
6404 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
6407 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
6408 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
6409 (const GLubyte
*) n
[3].
6410 data
, n
[4].f
, n
[5].f
,
6415 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
6416 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
6418 case OPCODE_DEPTH_BOUNDS_EXT
:
6419 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6421 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6422 case OPCODE_PROGRAM_STRING_ARB
:
6423 CALL_ProgramStringARB(ctx
->Exec
,
6424 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
6426 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
6427 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6432 #if FEATURE_ARB_occlusion_query
6433 case OPCODE_BEGIN_QUERY_ARB
:
6434 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6436 case OPCODE_END_QUERY_ARB
:
6437 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
6440 case OPCODE_DRAW_BUFFERS_ARB
:
6442 GLenum buffers
[MAX_DRAW_BUFFERS
];
6443 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
6444 for (i
= 0; i
< count
; i
++)
6445 buffers
[i
] = n
[2 + i
].e
;
6446 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
6449 #if FEATURE_EXT_framebuffer_blit
6450 case OPCODE_BLIT_FRAMEBUFFER
:
6451 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
6452 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6456 #if FEATURE_ATI_fragment_shader
6457 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
6458 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
6460 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
6463 GLuint i
, dst
= n
[1].ui
;
6465 for (i
= 0; i
< 4; i
++)
6466 values
[i
] = n
[1 + i
].f
;
6467 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
6471 case OPCODE_ATTR_1F_NV
:
6472 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6474 case OPCODE_ATTR_2F_NV
:
6475 /* Really shouldn't have to do this - the Node structure
6476 * is convenient, but it would be better to store the data
6477 * packed appropriately so that it can be sent directly
6478 * on. With x86_64 becoming common, this will start to
6481 if (sizeof(Node
) == sizeof(GLfloat
))
6482 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6484 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6486 case OPCODE_ATTR_3F_NV
:
6487 if (sizeof(Node
) == sizeof(GLfloat
))
6488 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6490 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6493 case OPCODE_ATTR_4F_NV
:
6494 if (sizeof(Node
) == sizeof(GLfloat
))
6495 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6497 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6500 case OPCODE_ATTR_1F_ARB
:
6501 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6503 case OPCODE_ATTR_2F_ARB
:
6504 /* Really shouldn't have to do this - the Node structure
6505 * is convenient, but it would be better to store the data
6506 * packed appropriately so that it can be sent directly
6507 * on. With x86_64 becoming common, this will start to
6510 if (sizeof(Node
) == sizeof(GLfloat
))
6511 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6513 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6515 case OPCODE_ATTR_3F_ARB
:
6516 if (sizeof(Node
) == sizeof(GLfloat
))
6517 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6519 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6522 case OPCODE_ATTR_4F_ARB
:
6523 if (sizeof(Node
) == sizeof(GLfloat
))
6524 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6526 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6529 case OPCODE_MATERIAL
:
6530 if (sizeof(Node
) == sizeof(GLfloat
))
6531 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
6538 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
6542 CALL_Indexf(ctx
->Exec
, (n
[1].f
));
6544 case OPCODE_EDGEFLAG
:
6545 CALL_EdgeFlag(ctx
->Exec
, (n
[1].b
));
6548 CALL_Begin(ctx
->Exec
, (n
[1].e
));
6551 CALL_End(ctx
->Exec
, ());
6554 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6556 case OPCODE_EVAL_C1
:
6557 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
6559 case OPCODE_EVAL_C2
:
6560 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6562 case OPCODE_EVAL_P1
:
6563 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
6565 case OPCODE_EVAL_P2
:
6566 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
6572 case OPCODE_CONTINUE
:
6573 n
= (Node
*) n
[1].next
;
6575 case OPCODE_END_OF_LIST
:
6581 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d",
6583 _mesa_problem(ctx
, msg
);
6588 /* increment n to point to next compiled command */
6589 if (opcode
!= OPCODE_CONTINUE
) {
6590 n
+= InstSize
[opcode
];
6595 if (ctx
->Driver
.EndCallList
)
6596 ctx
->Driver
.EndCallList(ctx
);
6598 ctx
->ListState
.CallStack
[ctx
->ListState
.CallDepth
--] = NULL
;
6603 /**********************************************************************/
6605 /**********************************************************************/
6608 * Test if a display list number is valid.
6610 GLboolean GLAPIENTRY
6611 _mesa_IsList(GLuint list
)
6613 GET_CURRENT_CONTEXT(ctx
);
6614 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6615 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6616 return islist(ctx
, list
);
6621 * Delete a sequence of consecutive display lists.
6624 _mesa_DeleteLists(GLuint list
, GLsizei range
)
6626 GET_CURRENT_CONTEXT(ctx
);
6628 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6629 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6632 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
6635 for (i
= list
; i
< list
+ range
; i
++) {
6636 destroy_list(ctx
, i
);
6642 * Return a display list number, n, such that lists n through n+range-1
6646 _mesa_GenLists(GLsizei range
)
6648 GET_CURRENT_CONTEXT(ctx
);
6650 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6651 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6654 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
6662 * Make this an atomic operation
6664 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6666 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6668 /* reserve the list IDs by with empty/dummy lists */
6670 for (i
= 0; i
< range
; i
++) {
6671 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
6672 make_list(base
+ i
, 1));
6676 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6683 * Begin a new display list.
6686 _mesa_NewList(GLuint list
, GLenum mode
)
6688 GET_CURRENT_CONTEXT(ctx
);
6691 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6692 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6694 if (MESA_VERBOSE
& VERBOSE_API
)
6695 _mesa_debug(ctx
, "glNewList %u %s\n", list
,
6696 _mesa_lookup_enum_by_nr(mode
));
6699 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
6703 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
6704 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
6708 if (ctx
->ListState
.CurrentListPtr
) {
6709 /* already compiling a display list */
6710 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
6714 ctx
->CompileFlag
= GL_TRUE
;
6715 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6717 /* Allocate new display list */
6718 ctx
->ListState
.CurrentListNum
= list
;
6719 ctx
->ListState
.CurrentList
= make_list(list
, BLOCK_SIZE
);
6720 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->node
;
6721 ctx
->ListState
.CurrentListPtr
= ctx
->ListState
.CurrentBlock
;
6722 ctx
->ListState
.CurrentPos
= 0;
6724 /* Reset acumulated list state:
6726 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
6727 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
6729 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
6730 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
6732 ctx
->ListState
.ActiveIndex
= 0;
6733 ctx
->ListState
.ActiveEdgeFlag
= 0;
6735 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
6736 ctx
->Driver
.NewList(ctx
, list
, mode
);
6738 ctx
->CurrentDispatch
= ctx
->Save
;
6739 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6744 * End definition of current display list.
6749 GET_CURRENT_CONTEXT(ctx
);
6750 SAVE_FLUSH_VERTICES(ctx
);
6751 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6753 if (MESA_VERBOSE
& VERBOSE_API
)
6754 _mesa_debug(ctx
, "glEndList\n");
6756 /* Check that a list is under construction */
6757 if (!ctx
->ListState
.CurrentListPtr
) {
6758 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
6762 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END_OF_LIST
, 0);
6764 /* Destroy old list, if any */
6765 destroy_list(ctx
, ctx
->ListState
.CurrentListNum
);
6766 /* Install the list */
6767 _mesa_HashInsert(ctx
->Shared
->DisplayList
, ctx
->ListState
.CurrentListNum
,
6768 ctx
->ListState
.CurrentList
);
6771 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6772 mesa_print_display_list(ctx
->ListState
.CurrentListNum
);
6774 ctx
->Driver
.EndList(ctx
);
6776 ctx
->ListState
.CurrentList
= NULL
;
6777 ctx
->ListState
.CurrentListNum
= 0;
6778 ctx
->ListState
.CurrentListPtr
= NULL
;
6779 ctx
->ExecuteFlag
= GL_TRUE
;
6780 ctx
->CompileFlag
= GL_FALSE
;
6782 ctx
->CurrentDispatch
= ctx
->Exec
;
6783 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6788 _mesa_CallList(GLuint list
)
6790 GLboolean save_compile_flag
;
6791 GET_CURRENT_CONTEXT(ctx
);
6792 FLUSH_CURRENT(ctx
, 0);
6793 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6794 /* execute the display list, and restore the CompileFlag. */
6796 if (MESA_VERBOSE
& VERBOSE_API
)
6797 _mesa_debug(ctx
, "glCallList %d\n", list
);
6800 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6804 /* mesa_print_display_list( list ); */
6806 save_compile_flag
= ctx
->CompileFlag
;
6807 if (save_compile_flag
) {
6808 ctx
->CompileFlag
= GL_FALSE
;
6811 execute_list(ctx
, list
);
6812 ctx
->CompileFlag
= save_compile_flag
;
6814 /* also restore API function pointers to point to "save" versions */
6815 if (save_compile_flag
) {
6816 ctx
->CurrentDispatch
= ctx
->Save
;
6817 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6823 * Execute glCallLists: call multiple display lists.
6826 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
6828 GET_CURRENT_CONTEXT(ctx
);
6831 GLboolean save_compile_flag
;
6833 if (MESA_VERBOSE
& VERBOSE_API
)
6834 _mesa_debug(ctx
, "glCallLists %d\n", n
);
6838 case GL_UNSIGNED_BYTE
:
6840 case GL_UNSIGNED_SHORT
:
6842 case GL_UNSIGNED_INT
:
6850 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6854 /* Save the CompileFlag status, turn it off, execute display list,
6855 * and restore the CompileFlag.
6857 save_compile_flag
= ctx
->CompileFlag
;
6858 ctx
->CompileFlag
= GL_FALSE
;
6860 for (i
= 0; i
< n
; i
++) {
6861 list
= translate_id(i
, type
, lists
);
6862 execute_list(ctx
, ctx
->List
.ListBase
+ list
);
6865 ctx
->CompileFlag
= save_compile_flag
;
6867 /* also restore API function pointers to point to "save" versions */
6868 if (save_compile_flag
) {
6869 ctx
->CurrentDispatch
= ctx
->Save
;
6870 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6876 * Set the offset added to list numbers in glCallLists.
6879 _mesa_ListBase(GLuint base
)
6881 GET_CURRENT_CONTEXT(ctx
);
6882 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6883 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6884 ctx
->List
.ListBase
= base
;
6888 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
6890 static void GLAPIENTRY
6893 GET_CURRENT_CONTEXT(ctx
);
6894 FLUSH_VERTICES(ctx
, 0);
6895 CALL_Finish(ctx
->Exec
, ());
6898 static void GLAPIENTRY
6901 GET_CURRENT_CONTEXT(ctx
);
6902 FLUSH_VERTICES(ctx
, 0);
6903 CALL_Flush(ctx
->Exec
, ());
6906 static void GLAPIENTRY
6907 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
6909 GET_CURRENT_CONTEXT(ctx
);
6910 FLUSH_VERTICES(ctx
, 0);
6911 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
6914 static void GLAPIENTRY
6915 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
6917 GET_CURRENT_CONTEXT(ctx
);
6918 FLUSH_VERTICES(ctx
, 0);
6919 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
6922 static void GLAPIENTRY
6923 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
6925 GET_CURRENT_CONTEXT(ctx
);
6926 FLUSH_VERTICES(ctx
, 0);
6927 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
6930 static GLenum GLAPIENTRY
6933 GET_CURRENT_CONTEXT(ctx
);
6934 FLUSH_VERTICES(ctx
, 0);
6935 return CALL_GetError(ctx
->Exec
, ());
6938 static void GLAPIENTRY
6939 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
6941 GET_CURRENT_CONTEXT(ctx
);
6942 FLUSH_VERTICES(ctx
, 0);
6943 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
6946 static void GLAPIENTRY
6947 exec_GetIntegerv(GLenum pname
, GLint
*params
)
6949 GET_CURRENT_CONTEXT(ctx
);
6950 FLUSH_VERTICES(ctx
, 0);
6951 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
6954 static void GLAPIENTRY
6955 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
6957 GET_CURRENT_CONTEXT(ctx
);
6958 FLUSH_VERTICES(ctx
, 0);
6959 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
6962 static void GLAPIENTRY
6963 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
6965 GET_CURRENT_CONTEXT(ctx
);
6966 FLUSH_VERTICES(ctx
, 0);
6967 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
6970 static void GLAPIENTRY
6971 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
6973 GET_CURRENT_CONTEXT(ctx
);
6974 FLUSH_VERTICES(ctx
, 0);
6975 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
6978 static void GLAPIENTRY
6979 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
6981 GET_CURRENT_CONTEXT(ctx
);
6982 FLUSH_VERTICES(ctx
, 0);
6983 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
6986 static void GLAPIENTRY
6987 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
6989 GET_CURRENT_CONTEXT(ctx
);
6990 FLUSH_VERTICES(ctx
, 0);
6991 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
6994 static void GLAPIENTRY
6995 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
6997 GET_CURRENT_CONTEXT(ctx
);
6998 FLUSH_VERTICES(ctx
, 0);
6999 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
7002 static void GLAPIENTRY
7003 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
7005 GET_CURRENT_CONTEXT(ctx
);
7006 FLUSH_VERTICES(ctx
, 0);
7007 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
7010 static void GLAPIENTRY
7011 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
7013 GET_CURRENT_CONTEXT(ctx
);
7014 FLUSH_VERTICES(ctx
, 0);
7015 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
7018 static void GLAPIENTRY
7019 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
7021 GET_CURRENT_CONTEXT(ctx
);
7022 FLUSH_VERTICES(ctx
, 0);
7023 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
7026 static void GLAPIENTRY
7027 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
7029 GET_CURRENT_CONTEXT(ctx
);
7030 FLUSH_VERTICES(ctx
, 0);
7031 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
7034 static void GLAPIENTRY
7035 exec_GetPolygonStipple(GLubyte
* dest
)
7037 GET_CURRENT_CONTEXT(ctx
);
7038 FLUSH_VERTICES(ctx
, 0);
7039 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
7042 static const GLubyte
*GLAPIENTRY
7043 exec_GetString(GLenum name
)
7045 GET_CURRENT_CONTEXT(ctx
);
7046 FLUSH_VERTICES(ctx
, 0);
7047 return CALL_GetString(ctx
->Exec
, (name
));
7050 static void GLAPIENTRY
7051 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7053 GET_CURRENT_CONTEXT(ctx
);
7054 FLUSH_VERTICES(ctx
, 0);
7055 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
7058 static void GLAPIENTRY
7059 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
7061 GET_CURRENT_CONTEXT(ctx
);
7062 FLUSH_VERTICES(ctx
, 0);
7063 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
7066 static void GLAPIENTRY
7067 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
7069 GET_CURRENT_CONTEXT(ctx
);
7070 FLUSH_VERTICES(ctx
, 0);
7071 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
7074 static void GLAPIENTRY
7075 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
7077 GET_CURRENT_CONTEXT(ctx
);
7078 FLUSH_VERTICES(ctx
, 0);
7079 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
7082 static void GLAPIENTRY
7083 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
7085 GET_CURRENT_CONTEXT(ctx
);
7086 FLUSH_VERTICES(ctx
, 0);
7087 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
7090 static void GLAPIENTRY
7091 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
7092 GLenum type
, GLvoid
* pixels
)
7094 GET_CURRENT_CONTEXT(ctx
);
7095 FLUSH_VERTICES(ctx
, 0);
7096 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
7099 static void GLAPIENTRY
7100 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
7101 GLenum pname
, GLfloat
*params
)
7103 GET_CURRENT_CONTEXT(ctx
);
7104 FLUSH_VERTICES(ctx
, 0);
7105 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
7108 static void GLAPIENTRY
7109 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
7110 GLenum pname
, GLint
*params
)
7112 GET_CURRENT_CONTEXT(ctx
);
7113 FLUSH_VERTICES(ctx
, 0);
7114 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
7117 static void GLAPIENTRY
7118 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7120 GET_CURRENT_CONTEXT(ctx
);
7121 FLUSH_VERTICES(ctx
, 0);
7122 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
7125 static void GLAPIENTRY
7126 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7128 GET_CURRENT_CONTEXT(ctx
);
7129 FLUSH_VERTICES(ctx
, 0);
7130 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
7133 static GLboolean GLAPIENTRY
7134 exec_IsEnabled(GLenum cap
)
7136 GET_CURRENT_CONTEXT(ctx
);
7137 FLUSH_VERTICES(ctx
, 0);
7138 return CALL_IsEnabled(ctx
->Exec
, (cap
));
7141 static void GLAPIENTRY
7142 exec_PixelStoref(GLenum pname
, GLfloat param
)
7144 GET_CURRENT_CONTEXT(ctx
);
7145 FLUSH_VERTICES(ctx
, 0);
7146 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
7149 static void GLAPIENTRY
7150 exec_PixelStorei(GLenum pname
, GLint param
)
7152 GET_CURRENT_CONTEXT(ctx
);
7153 FLUSH_VERTICES(ctx
, 0);
7154 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
7157 static void GLAPIENTRY
7158 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
7159 GLenum format
, GLenum type
, GLvoid
* pixels
)
7161 GET_CURRENT_CONTEXT(ctx
);
7162 FLUSH_VERTICES(ctx
, 0);
7163 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
7166 static GLint GLAPIENTRY
7167 exec_RenderMode(GLenum mode
)
7169 GET_CURRENT_CONTEXT(ctx
);
7170 FLUSH_VERTICES(ctx
, 0);
7171 return CALL_RenderMode(ctx
->Exec
, (mode
));
7174 static void GLAPIENTRY
7175 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
7177 GET_CURRENT_CONTEXT(ctx
);
7178 FLUSH_VERTICES(ctx
, 0);
7179 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
7182 static void GLAPIENTRY
7183 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
7185 GET_CURRENT_CONTEXT(ctx
);
7186 FLUSH_VERTICES(ctx
, 0);
7187 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
7190 static GLboolean GLAPIENTRY
7191 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
7192 GLboolean
* residences
)
7194 GET_CURRENT_CONTEXT(ctx
);
7195 FLUSH_VERTICES(ctx
, 0);
7196 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
7199 static void GLAPIENTRY
7200 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7202 GET_CURRENT_CONTEXT(ctx
);
7203 FLUSH_VERTICES(ctx
, 0);
7204 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7207 static void GLAPIENTRY
7208 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
7210 GET_CURRENT_CONTEXT(ctx
);
7211 FLUSH_VERTICES(ctx
, 0);
7212 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
7215 static void GLAPIENTRY
7216 exec_DisableClientState(GLenum cap
)
7218 GET_CURRENT_CONTEXT(ctx
);
7219 FLUSH_VERTICES(ctx
, 0);
7220 CALL_DisableClientState(ctx
->Exec
, (cap
));
7223 static void GLAPIENTRY
7224 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
7226 GET_CURRENT_CONTEXT(ctx
);
7227 FLUSH_VERTICES(ctx
, 0);
7228 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
7231 static void GLAPIENTRY
7232 exec_EnableClientState(GLenum cap
)
7234 GET_CURRENT_CONTEXT(ctx
);
7235 FLUSH_VERTICES(ctx
, 0);
7236 CALL_EnableClientState(ctx
->Exec
, (cap
));
7239 static void GLAPIENTRY
7240 exec_GenTextures(GLsizei n
, GLuint
* texName
)
7242 GET_CURRENT_CONTEXT(ctx
);
7243 FLUSH_VERTICES(ctx
, 0);
7244 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
7247 static void GLAPIENTRY
7248 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
7250 GET_CURRENT_CONTEXT(ctx
);
7251 FLUSH_VERTICES(ctx
, 0);
7252 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
7255 static void GLAPIENTRY
7256 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7258 GET_CURRENT_CONTEXT(ctx
);
7259 FLUSH_VERTICES(ctx
, 0);
7260 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
7263 static void GLAPIENTRY
7264 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
7266 GET_CURRENT_CONTEXT(ctx
);
7267 FLUSH_VERTICES(ctx
, 0);
7268 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
7271 static GLboolean GLAPIENTRY
7272 exec_IsTexture(GLuint texture
)
7274 GET_CURRENT_CONTEXT(ctx
);
7275 FLUSH_VERTICES(ctx
, 0);
7276 return CALL_IsTexture(ctx
->Exec
, (texture
));
7279 static void GLAPIENTRY
7280 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7282 GET_CURRENT_CONTEXT(ctx
);
7283 FLUSH_VERTICES(ctx
, 0);
7284 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
7287 static void GLAPIENTRY
7288 exec_PopClientAttrib(void)
7290 GET_CURRENT_CONTEXT(ctx
);
7291 FLUSH_VERTICES(ctx
, 0);
7292 CALL_PopClientAttrib(ctx
->Exec
, ());
7295 static void GLAPIENTRY
7296 exec_PushClientAttrib(GLbitfield mask
)
7298 GET_CURRENT_CONTEXT(ctx
);
7299 FLUSH_VERTICES(ctx
, 0);
7300 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
7303 static void GLAPIENTRY
7304 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
7307 GET_CURRENT_CONTEXT(ctx
);
7308 FLUSH_VERTICES(ctx
, 0);
7309 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7312 static void GLAPIENTRY
7313 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
7315 GET_CURRENT_CONTEXT(ctx
);
7316 FLUSH_VERTICES(ctx
, 0);
7317 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
7320 static void GLAPIENTRY
7321 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
7324 GET_CURRENT_CONTEXT(ctx
);
7325 FLUSH_VERTICES(ctx
, 0);
7326 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7329 static void GLAPIENTRY
7330 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
7331 GLint x
, GLint y
, GLsizei width
)
7333 GET_CURRENT_CONTEXT(ctx
);
7334 FLUSH_VERTICES(ctx
, 0);
7335 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
7336 (target
, internalFormat
, x
, y
, width
));
7339 static void GLAPIENTRY
7340 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
7341 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
7343 GET_CURRENT_CONTEXT(ctx
);
7344 FLUSH_VERTICES(ctx
, 0);
7345 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
7346 (target
, internalFormat
, x
, y
, width
,
7350 static void GLAPIENTRY
7351 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
7353 GET_CURRENT_CONTEXT(ctx
);
7354 FLUSH_VERTICES(ctx
, 0);
7355 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
7358 static void GLAPIENTRY
7359 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7361 GET_CURRENT_CONTEXT(ctx
);
7362 FLUSH_VERTICES(ctx
, 0);
7363 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
7366 static void GLAPIENTRY
7367 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7369 GET_CURRENT_CONTEXT(ctx
);
7370 FLUSH_VERTICES(ctx
, 0);
7371 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
7374 static void GLAPIENTRY
7375 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
7378 GET_CURRENT_CONTEXT(ctx
);
7379 FLUSH_VERTICES(ctx
, 0);
7380 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
7383 static void GLAPIENTRY
7384 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7386 GET_CURRENT_CONTEXT(ctx
);
7387 FLUSH_VERTICES(ctx
, 0);
7388 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
7391 static void GLAPIENTRY
7392 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7394 GET_CURRENT_CONTEXT(ctx
);
7395 FLUSH_VERTICES(ctx
, 0);
7396 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
7399 static void GLAPIENTRY
7400 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
7401 GLenum type
, GLvoid
*values
)
7403 GET_CURRENT_CONTEXT(ctx
);
7404 FLUSH_VERTICES(ctx
, 0);
7405 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7408 static void GLAPIENTRY
7409 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7411 GET_CURRENT_CONTEXT(ctx
);
7412 FLUSH_VERTICES(ctx
, 0);
7413 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
7416 static void GLAPIENTRY
7417 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7419 GET_CURRENT_CONTEXT(ctx
);
7420 FLUSH_VERTICES(ctx
, 0);
7421 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
7424 static void GLAPIENTRY
7425 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
7426 GLenum type
, GLvoid
*values
)
7428 GET_CURRENT_CONTEXT(ctx
);
7429 FLUSH_VERTICES(ctx
, 0);
7430 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7433 static void GLAPIENTRY
7434 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7436 GET_CURRENT_CONTEXT(ctx
);
7437 FLUSH_VERTICES(ctx
, 0);
7438 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
7441 static void GLAPIENTRY
7442 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7444 GET_CURRENT_CONTEXT(ctx
);
7445 FLUSH_VERTICES(ctx
, 0);
7446 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
7449 static void GLAPIENTRY
7450 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
7451 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
7453 GET_CURRENT_CONTEXT(ctx
);
7454 FLUSH_VERTICES(ctx
, 0);
7455 CALL_GetSeparableFilter(ctx
->Exec
,
7456 (target
, format
, type
, row
, column
, span
));
7459 static void GLAPIENTRY
7460 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
7461 GLsizei width
, GLsizei height
, GLenum format
,
7462 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
7464 GET_CURRENT_CONTEXT(ctx
);
7465 FLUSH_VERTICES(ctx
, 0);
7466 CALL_SeparableFilter2D(ctx
->Exec
,
7467 (target
, internalFormat
, width
, height
, format
,
7468 type
, row
, column
));
7471 static void GLAPIENTRY
7472 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7473 GLsizei count
, const GLvoid
*ptr
)
7475 GET_CURRENT_CONTEXT(ctx
);
7476 FLUSH_VERTICES(ctx
, 0);
7477 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7480 static void GLAPIENTRY
7481 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
7483 GET_CURRENT_CONTEXT(ctx
);
7484 FLUSH_VERTICES(ctx
, 0);
7485 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
7488 static void GLAPIENTRY
7489 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7492 GET_CURRENT_CONTEXT(ctx
);
7493 FLUSH_VERTICES(ctx
, 0);
7494 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
7497 static void GLAPIENTRY
7498 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7501 GET_CURRENT_CONTEXT(ctx
);
7502 FLUSH_VERTICES(ctx
, 0);
7503 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
7506 static void GLAPIENTRY
7507 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7508 GLsizei count
, const GLvoid
*ptr
)
7510 GET_CURRENT_CONTEXT(ctx
);
7511 FLUSH_VERTICES(ctx
, 0);
7512 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7515 static void GLAPIENTRY
7516 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7517 GLsizei count
, const GLvoid
*ptr
)
7519 GET_CURRENT_CONTEXT(ctx
);
7520 FLUSH_VERTICES(ctx
, 0);
7521 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7524 static void GLAPIENTRY
7525 exec_LockArraysEXT(GLint first
, GLsizei count
)
7527 GET_CURRENT_CONTEXT(ctx
);
7528 FLUSH_VERTICES(ctx
, 0);
7529 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
7532 static void GLAPIENTRY
7533 exec_UnlockArraysEXT(void)
7535 GET_CURRENT_CONTEXT(ctx
);
7536 FLUSH_VERTICES(ctx
, 0);
7537 CALL_UnlockArraysEXT(ctx
->Exec
, ());
7540 static void GLAPIENTRY
7541 exec_ClientActiveTextureARB(GLenum target
)
7543 GET_CURRENT_CONTEXT(ctx
);
7544 FLUSH_VERTICES(ctx
, 0);
7545 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
7548 static void GLAPIENTRY
7549 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
7550 GLsizei stride
, const GLvoid
*ptr
)
7552 GET_CURRENT_CONTEXT(ctx
);
7553 FLUSH_VERTICES(ctx
, 0);
7554 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
7557 static void GLAPIENTRY
7558 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7560 GET_CURRENT_CONTEXT(ctx
);
7561 FLUSH_VERTICES(ctx
, 0);
7562 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
7565 /* GL_EXT_multi_draw_arrays */
7566 static void GLAPIENTRY
7567 exec_MultiDrawArraysEXT(GLenum mode
, GLint
* first
,
7568 GLsizei
* count
, GLsizei primcount
)
7570 GET_CURRENT_CONTEXT(ctx
);
7571 FLUSH_VERTICES(ctx
, 0);
7572 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
7575 /* GL_EXT_multi_draw_arrays */
7576 static void GLAPIENTRY
7577 exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
* count
,
7578 GLenum type
, const GLvoid
** indices
,
7581 GET_CURRENT_CONTEXT(ctx
);
7582 FLUSH_VERTICES(ctx
, 0);
7583 CALL_MultiDrawElementsEXT(ctx
->Exec
,
7584 (mode
, count
, type
, indices
, primcount
));
7587 /* GL_IBM_multimode_draw_arrays */
7588 static void GLAPIENTRY
7589 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
7590 const GLsizei
* count
, GLsizei primcount
,
7593 GET_CURRENT_CONTEXT(ctx
);
7594 FLUSH_VERTICES(ctx
, 0);
7595 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
7596 (mode
, first
, count
, primcount
, modestride
));
7599 /* GL_IBM_multimode_draw_arrays */
7600 static void GLAPIENTRY
7601 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
7602 const GLsizei
* count
,
7604 const GLvoid
* const *indices
,
7605 GLsizei primcount
, GLint modestride
)
7607 GET_CURRENT_CONTEXT(ctx
);
7608 FLUSH_VERTICES(ctx
, 0);
7609 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
7610 (mode
, count
, type
, indices
, primcount
,
7617 * Setup the given dispatch table to point to Mesa's display list
7618 * building functions.
7620 * This does not include any of the tnl functions - they are
7621 * initialized from _mesa_init_api_defaults and from the active vtxfmt
7625 _mesa_init_dlist_table(struct _glapi_table
*table
)
7627 _mesa_loopback_init_api_table(table
);
7630 SET_Accum(table
, save_Accum
);
7631 SET_AlphaFunc(table
, save_AlphaFunc
);
7632 SET_Bitmap(table
, save_Bitmap
);
7633 SET_BlendFunc(table
, _mesa_BlendFunc
); /* loops-back to BlendFuncSeparate */
7634 SET_CallList(table
, _mesa_save_CallList
);
7635 SET_CallLists(table
, _mesa_save_CallLists
);
7636 SET_Clear(table
, save_Clear
);
7637 SET_ClearAccum(table
, save_ClearAccum
);
7638 SET_ClearColor(table
, save_ClearColor
);
7639 SET_ClearDepth(table
, save_ClearDepth
);
7640 SET_ClearIndex(table
, save_ClearIndex
);
7641 SET_ClearStencil(table
, save_ClearStencil
);
7642 SET_ClipPlane(table
, save_ClipPlane
);
7643 SET_ColorMask(table
, save_ColorMask
);
7644 SET_ColorMaterial(table
, save_ColorMaterial
);
7645 SET_CopyPixels(table
, save_CopyPixels
);
7646 SET_CullFace(table
, save_CullFace
);
7647 SET_DeleteLists(table
, _mesa_DeleteLists
);
7648 SET_DepthFunc(table
, save_DepthFunc
);
7649 SET_DepthMask(table
, save_DepthMask
);
7650 SET_DepthRange(table
, save_DepthRange
);
7651 SET_Disable(table
, save_Disable
);
7652 SET_DrawBuffer(table
, save_DrawBuffer
);
7653 SET_DrawPixels(table
, save_DrawPixels
);
7654 SET_Enable(table
, save_Enable
);
7655 SET_EndList(table
, _mesa_EndList
);
7656 SET_EvalMesh1(table
, _mesa_save_EvalMesh1
);
7657 SET_EvalMesh2(table
, _mesa_save_EvalMesh2
);
7658 SET_Finish(table
, exec_Finish
);
7659 SET_Flush(table
, exec_Flush
);
7660 SET_Fogf(table
, save_Fogf
);
7661 SET_Fogfv(table
, save_Fogfv
);
7662 SET_Fogi(table
, save_Fogi
);
7663 SET_Fogiv(table
, save_Fogiv
);
7664 SET_FrontFace(table
, save_FrontFace
);
7665 SET_Frustum(table
, save_Frustum
);
7666 SET_GenLists(table
, _mesa_GenLists
);
7667 SET_GetBooleanv(table
, exec_GetBooleanv
);
7668 SET_GetClipPlane(table
, exec_GetClipPlane
);
7669 SET_GetDoublev(table
, exec_GetDoublev
);
7670 SET_GetError(table
, exec_GetError
);
7671 SET_GetFloatv(table
, exec_GetFloatv
);
7672 SET_GetIntegerv(table
, exec_GetIntegerv
);
7673 SET_GetLightfv(table
, exec_GetLightfv
);
7674 SET_GetLightiv(table
, exec_GetLightiv
);
7675 SET_GetMapdv(table
, exec_GetMapdv
);
7676 SET_GetMapfv(table
, exec_GetMapfv
);
7677 SET_GetMapiv(table
, exec_GetMapiv
);
7678 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
7679 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
7680 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
7681 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
7682 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
7683 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
7684 SET_GetString(table
, exec_GetString
);
7685 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
7686 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
7687 SET_GetTexGendv(table
, exec_GetTexGendv
);
7688 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
7689 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
7690 SET_GetTexImage(table
, exec_GetTexImage
);
7691 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
7692 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
7693 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
7694 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
7695 SET_Hint(table
, save_Hint
);
7696 SET_IndexMask(table
, save_IndexMask
);
7697 SET_InitNames(table
, save_InitNames
);
7698 SET_IsEnabled(table
, exec_IsEnabled
);
7699 SET_IsList(table
, _mesa_IsList
);
7700 SET_LightModelf(table
, save_LightModelf
);
7701 SET_LightModelfv(table
, save_LightModelfv
);
7702 SET_LightModeli(table
, save_LightModeli
);
7703 SET_LightModeliv(table
, save_LightModeliv
);
7704 SET_Lightf(table
, save_Lightf
);
7705 SET_Lightfv(table
, save_Lightfv
);
7706 SET_Lighti(table
, save_Lighti
);
7707 SET_Lightiv(table
, save_Lightiv
);
7708 SET_LineStipple(table
, save_LineStipple
);
7709 SET_LineWidth(table
, save_LineWidth
);
7710 SET_ListBase(table
, save_ListBase
);
7711 SET_LoadIdentity(table
, save_LoadIdentity
);
7712 SET_LoadMatrixd(table
, save_LoadMatrixd
);
7713 SET_LoadMatrixf(table
, save_LoadMatrixf
);
7714 SET_LoadName(table
, save_LoadName
);
7715 SET_LogicOp(table
, save_LogicOp
);
7716 SET_Map1d(table
, save_Map1d
);
7717 SET_Map1f(table
, save_Map1f
);
7718 SET_Map2d(table
, save_Map2d
);
7719 SET_Map2f(table
, save_Map2f
);
7720 SET_MapGrid1d(table
, save_MapGrid1d
);
7721 SET_MapGrid1f(table
, save_MapGrid1f
);
7722 SET_MapGrid2d(table
, save_MapGrid2d
);
7723 SET_MapGrid2f(table
, save_MapGrid2f
);
7724 SET_MatrixMode(table
, save_MatrixMode
);
7725 SET_MultMatrixd(table
, save_MultMatrixd
);
7726 SET_MultMatrixf(table
, save_MultMatrixf
);
7727 SET_NewList(table
, save_NewList
);
7728 SET_Ortho(table
, save_Ortho
);
7729 SET_PassThrough(table
, save_PassThrough
);
7730 SET_PixelMapfv(table
, save_PixelMapfv
);
7731 SET_PixelMapuiv(table
, save_PixelMapuiv
);
7732 SET_PixelMapusv(table
, save_PixelMapusv
);
7733 SET_PixelStoref(table
, exec_PixelStoref
);
7734 SET_PixelStorei(table
, exec_PixelStorei
);
7735 SET_PixelTransferf(table
, save_PixelTransferf
);
7736 SET_PixelTransferi(table
, save_PixelTransferi
);
7737 SET_PixelZoom(table
, save_PixelZoom
);
7738 SET_PointSize(table
, save_PointSize
);
7739 SET_PolygonMode(table
, save_PolygonMode
);
7740 SET_PolygonOffset(table
, save_PolygonOffset
);
7741 SET_PolygonStipple(table
, save_PolygonStipple
);
7742 SET_PopAttrib(table
, save_PopAttrib
);
7743 SET_PopMatrix(table
, save_PopMatrix
);
7744 SET_PopName(table
, save_PopName
);
7745 SET_PushAttrib(table
, save_PushAttrib
);
7746 SET_PushMatrix(table
, save_PushMatrix
);
7747 SET_PushName(table
, save_PushName
);
7748 SET_RasterPos2d(table
, save_RasterPos2d
);
7749 SET_RasterPos2dv(table
, save_RasterPos2dv
);
7750 SET_RasterPos2f(table
, save_RasterPos2f
);
7751 SET_RasterPos2fv(table
, save_RasterPos2fv
);
7752 SET_RasterPos2i(table
, save_RasterPos2i
);
7753 SET_RasterPos2iv(table
, save_RasterPos2iv
);
7754 SET_RasterPos2s(table
, save_RasterPos2s
);
7755 SET_RasterPos2sv(table
, save_RasterPos2sv
);
7756 SET_RasterPos3d(table
, save_RasterPos3d
);
7757 SET_RasterPos3dv(table
, save_RasterPos3dv
);
7758 SET_RasterPos3f(table
, save_RasterPos3f
);
7759 SET_RasterPos3fv(table
, save_RasterPos3fv
);
7760 SET_RasterPos3i(table
, save_RasterPos3i
);
7761 SET_RasterPos3iv(table
, save_RasterPos3iv
);
7762 SET_RasterPos3s(table
, save_RasterPos3s
);
7763 SET_RasterPos3sv(table
, save_RasterPos3sv
);
7764 SET_RasterPos4d(table
, save_RasterPos4d
);
7765 SET_RasterPos4dv(table
, save_RasterPos4dv
);
7766 SET_RasterPos4f(table
, save_RasterPos4f
);
7767 SET_RasterPos4fv(table
, save_RasterPos4fv
);
7768 SET_RasterPos4i(table
, save_RasterPos4i
);
7769 SET_RasterPos4iv(table
, save_RasterPos4iv
);
7770 SET_RasterPos4s(table
, save_RasterPos4s
);
7771 SET_RasterPos4sv(table
, save_RasterPos4sv
);
7772 SET_ReadBuffer(table
, save_ReadBuffer
);
7773 SET_ReadPixels(table
, exec_ReadPixels
);
7774 SET_RenderMode(table
, exec_RenderMode
);
7775 SET_Rotated(table
, save_Rotated
);
7776 SET_Rotatef(table
, save_Rotatef
);
7777 SET_Scaled(table
, save_Scaled
);
7778 SET_Scalef(table
, save_Scalef
);
7779 SET_Scissor(table
, save_Scissor
);
7780 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
7781 SET_SelectBuffer(table
, exec_SelectBuffer
);
7782 SET_ShadeModel(table
, save_ShadeModel
);
7783 SET_StencilFunc(table
, save_StencilFunc
);
7784 SET_StencilMask(table
, save_StencilMask
);
7785 SET_StencilOp(table
, save_StencilOp
);
7786 SET_TexEnvf(table
, save_TexEnvf
);
7787 SET_TexEnvfv(table
, save_TexEnvfv
);
7788 SET_TexEnvi(table
, save_TexEnvi
);
7789 SET_TexEnviv(table
, save_TexEnviv
);
7790 SET_TexGend(table
, save_TexGend
);
7791 SET_TexGendv(table
, save_TexGendv
);
7792 SET_TexGenf(table
, save_TexGenf
);
7793 SET_TexGenfv(table
, save_TexGenfv
);
7794 SET_TexGeni(table
, save_TexGeni
);
7795 SET_TexGeniv(table
, save_TexGeniv
);
7796 SET_TexImage1D(table
, save_TexImage1D
);
7797 SET_TexImage2D(table
, save_TexImage2D
);
7798 SET_TexParameterf(table
, save_TexParameterf
);
7799 SET_TexParameterfv(table
, save_TexParameterfv
);
7800 SET_TexParameteri(table
, save_TexParameteri
);
7801 SET_TexParameteriv(table
, save_TexParameteriv
);
7802 SET_Translated(table
, save_Translated
);
7803 SET_Translatef(table
, save_Translatef
);
7804 SET_Viewport(table
, save_Viewport
);
7807 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
7808 SET_AreTexturesResidentEXT(table
, exec_AreTexturesResident
);
7809 SET_BindTexture(table
, save_BindTexture
);
7810 SET_ColorPointer(table
, exec_ColorPointer
);
7811 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
7812 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
7813 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
7814 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
7815 SET_DeleteTextures(table
, exec_DeleteTextures
);
7816 SET_DisableClientState(table
, exec_DisableClientState
);
7817 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
7818 SET_EnableClientState(table
, exec_EnableClientState
);
7819 SET_GenTextures(table
, exec_GenTextures
);
7820 SET_GenTexturesEXT(table
, exec_GenTextures
);
7821 SET_GetPointerv(table
, exec_GetPointerv
);
7822 SET_IndexPointer(table
, exec_IndexPointer
);
7823 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
7824 SET_IsTexture(table
, exec_IsTexture
);
7825 SET_IsTextureEXT(table
, exec_IsTexture
);
7826 SET_NormalPointer(table
, exec_NormalPointer
);
7827 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
7828 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
7829 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
7830 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
7831 SET_TexSubImage1D(table
, save_TexSubImage1D
);
7832 SET_TexSubImage2D(table
, save_TexSubImage2D
);
7833 SET_VertexPointer(table
, exec_VertexPointer
);
7836 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
7837 SET_TexImage3D(table
, save_TexImage3D
);
7838 SET_TexSubImage3D(table
, save_TexSubImage3D
);
7841 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
7842 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
7843 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
7845 /* GL_ARB_imaging */
7846 /* Not all are supported */
7847 SET_BlendColor(table
, save_BlendColor
);
7848 SET_BlendEquation(table
, save_BlendEquation
);
7849 SET_ColorSubTable(table
, save_ColorSubTable
);
7850 SET_ColorTable(table
, save_ColorTable
);
7851 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
7852 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
7853 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
7854 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
7855 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
7856 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
7857 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
7858 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
7859 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
7860 SET_CopyColorTable(table
, save_CopyColorTable
);
7861 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
7862 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
7863 SET_GetColorTable(table
, exec_GetColorTable
);
7864 SET_GetColorTableEXT(table
, exec_GetColorTable
);
7865 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
7866 SET_GetColorTableParameterfvEXT(table
, exec_GetColorTableParameterfv
);
7867 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
7868 SET_GetColorTableParameterivEXT(table
, exec_GetColorTableParameteriv
);
7869 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
7870 SET_GetConvolutionFilterEXT(table
, exec_GetConvolutionFilter
);
7871 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
7872 SET_GetConvolutionParameterfvEXT(table
, exec_GetConvolutionParameterfv
);
7873 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
7874 SET_GetConvolutionParameterivEXT(table
, exec_GetConvolutionParameteriv
);
7875 SET_GetHistogram(table
, exec_GetHistogram
);
7876 SET_GetHistogramEXT(table
, exec_GetHistogram
);
7877 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
7878 SET_GetHistogramParameterfvEXT(table
, exec_GetHistogramParameterfv
);
7879 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
7880 SET_GetHistogramParameterivEXT(table
, exec_GetHistogramParameteriv
);
7881 SET_GetMinmax(table
, exec_GetMinmax
);
7882 SET_GetMinmaxEXT(table
, exec_GetMinmax
);
7883 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
7884 SET_GetMinmaxParameterfvEXT(table
, exec_GetMinmaxParameterfv
);
7885 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
7886 SET_GetMinmaxParameterivEXT(table
, exec_GetMinmaxParameteriv
);
7887 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
7888 SET_GetSeparableFilterEXT(table
, exec_GetSeparableFilter
);
7889 SET_Histogram(table
, save_Histogram
);
7890 SET_Minmax(table
, save_Minmax
);
7891 SET_ResetHistogram(table
, save_ResetHistogram
);
7892 SET_ResetMinmax(table
, save_ResetMinmax
);
7893 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
7895 /* 2. GL_EXT_blend_color */
7897 SET_BlendColorEXT(table
, save_BlendColorEXT
);
7900 /* 3. GL_EXT_polygon_offset */
7901 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
7903 /* 6. GL_EXT_texture3d */
7905 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
7906 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
7907 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
7910 /* 30. GL_EXT_vertex_array */
7911 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
7912 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
7913 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
7914 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
7915 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
7916 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
7918 /* 37. GL_EXT_blend_minmax */
7920 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
7923 /* 54. GL_EXT_point_parameters */
7924 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
7925 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
7927 /* 78. GL_EXT_paletted_texture */
7929 SET_ColorTableEXT(table
, save_ColorTable
);
7930 SET_ColorSubTableEXT(table
, save_ColorSubTable
);
7932 SET_GetColorTableEXT(table
, exec_GetColorTable
);
7933 SET_GetColorTableParameterfvEXT(table
, exec_GetColorTableParameterfv
);
7934 SET_GetColorTableParameterivEXT(table
, exec_GetColorTableParameteriv
);
7936 /* 97. GL_EXT_compiled_vertex_array */
7937 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
7938 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
7940 /* 145. GL_EXT_secondary_color */
7941 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
7943 /* 148. GL_EXT_multi_draw_arrays */
7944 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
7945 SET_MultiDrawElementsEXT(table
, exec_MultiDrawElementsEXT
);
7947 /* 149. GL_EXT_fog_coord */
7948 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
7950 /* 173. GL_EXT_blend_func_separate */
7951 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
7953 /* 196. GL_MESA_resize_buffers */
7954 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
7956 /* 197. GL_MESA_window_pos */
7957 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
7958 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
7959 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
7960 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
7961 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
7962 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
7963 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
7964 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
7965 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
7966 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
7967 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
7968 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
7969 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
7970 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
7971 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
7972 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
7973 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
7974 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
7975 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
7976 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
7977 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
7978 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
7979 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
7980 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
7982 /* 200. GL_IBM_multimode_draw_arrays */
7983 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
7984 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
7986 #if FEATURE_NV_vertex_program
7987 /* 233. GL_NV_vertex_program */
7988 /* The following commands DO NOT go into display lists:
7989 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
7990 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
7992 SET_BindProgramNV(table
, save_BindProgramNV
);
7993 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
7994 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
7995 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
7996 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
7997 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
7998 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
7999 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
8000 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
8001 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
8002 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
8003 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8004 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8005 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8006 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8007 SET_IsProgramNV(table
, _mesa_IsProgram
);
8008 SET_LoadProgramNV(table
, save_LoadProgramNV
);
8009 SET_ProgramParameter4dNV(table
, save_ProgramParameter4dNV
);
8010 SET_ProgramParameter4dvNV(table
, save_ProgramParameter4dvNV
);
8011 SET_ProgramParameter4fNV(table
, save_ProgramParameter4fNV
);
8012 SET_ProgramParameter4fvNV(table
, save_ProgramParameter4fvNV
);
8013 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
8014 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
8015 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
8016 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
8019 /* 245. GL_ATI_fragment_shader */
8020 #if FEATURE_ATI_fragment_shader
8021 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
8022 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
8025 /* 282. GL_NV_fragment_program */
8026 #if FEATURE_NV_fragment_program
8027 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
8028 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
8029 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
8030 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
8031 SET_GetProgramNamedParameterfvNV(table
,
8032 _mesa_GetProgramNamedParameterfvNV
);
8033 SET_GetProgramNamedParameterdvNV(table
,
8034 _mesa_GetProgramNamedParameterdvNV
);
8035 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8036 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8037 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8038 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8039 SET_GetProgramLocalParameterdvARB(table
,
8040 _mesa_GetProgramLocalParameterdvARB
);
8041 SET_GetProgramLocalParameterfvARB(table
,
8042 _mesa_GetProgramLocalParameterfvARB
);
8045 /* 262. GL_NV_point_sprite */
8046 SET_PointParameteriNV(table
, save_PointParameteriNV
);
8047 SET_PointParameterivNV(table
, save_PointParameterivNV
);
8049 /* 268. GL_EXT_stencil_two_side */
8050 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
8052 /* 273. GL_APPLE_vertex_array_object */
8053 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
8054 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
8055 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
8056 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
8058 /* ???. GL_EXT_depth_bounds_test */
8059 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
8061 /* ARB 1. GL_ARB_multitexture */
8062 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
8063 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
8065 /* ARB 3. GL_ARB_transpose_matrix */
8066 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
8067 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
8068 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
8069 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
8071 /* ARB 5. GL_ARB_multisample */
8072 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
8074 /* ARB 12. GL_ARB_texture_compression */
8075 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
8076 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
8077 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
8078 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
8079 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
8080 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
8081 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
8083 /* ARB 14. GL_ARB_point_parameters */
8084 /* aliased with EXT_point_parameters functions */
8086 /* ARB 25. GL_ARB_window_pos */
8087 /* aliased with MESA_window_pos functions */
8089 /* ARB 26. GL_ARB_vertex_program */
8090 /* ARB 27. GL_ARB_fragment_program */
8091 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8092 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
8093 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
8094 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
8095 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
8096 SET_ProgramStringARB(table
, save_ProgramStringARB
);
8097 SET_BindProgramNV(table
, save_BindProgramNV
);
8098 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8099 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8100 SET_IsProgramNV(table
, _mesa_IsProgram
);
8101 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8102 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8103 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8104 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8105 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
8106 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
8107 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
8108 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
8109 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8110 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8111 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8112 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8113 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
8114 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
8115 SET_GetProgramLocalParameterdvARB(table
,
8116 _mesa_GetProgramLocalParameterdvARB
);
8117 SET_GetProgramLocalParameterfvARB(table
,
8118 _mesa_GetProgramLocalParameterfvARB
);
8119 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
8120 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
8123 /* ARB 28. GL_ARB_vertex_buffer_object */
8124 #if FEATURE_ARB_vertex_buffer_object
8125 /* None of the extension's functions get compiled */
8126 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
8127 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
8128 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
8129 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
8130 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
8131 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
8132 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
8133 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
8134 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
8135 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
8136 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
8139 #if FEATURE_ARB_occlusion_query
8140 SET_BeginQueryARB(table
, save_BeginQueryARB
);
8141 SET_EndQueryARB(table
, save_EndQueryARB
);
8142 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
8143 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
8144 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
8145 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
8146 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
8147 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
8149 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
8151 #if FEATURE_EXT_framebuffer_blit
8152 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
8155 /* 299. GL_EXT_blend_equation_separate */
8156 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
8162 enum_string(GLenum k
)
8164 return _mesa_lookup_enum_by_nr(k
);
8169 * Print the commands in a display list. For debugging only.
8170 * TODO: many commands aren't handled yet.
8172 static void GLAPIENTRY
8173 print_list(GLcontext
*ctx
, GLuint list
)
8175 struct mesa_display_list
*dlist
;
8179 if (!islist(ctx
, list
)) {
8180 _mesa_printf("%u is not a display list ID\n", list
);
8184 dlist
= lookup_list(ctx
, list
);
8190 _mesa_printf("START-LIST %u, address %p\n", list
, (void *) n
);
8192 done
= n
? GL_FALSE
: GL_TRUE
;
8194 OpCode opcode
= n
[0].opcode
;
8195 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
8197 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
8198 /* this is a driver-extended opcode */
8199 ctx
->ListExt
.Opcode
[i
].Print(ctx
, &n
[1]);
8200 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
8205 _mesa_printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
8208 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
8209 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
8211 case OPCODE_CALL_LIST
:
8212 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
8214 case OPCODE_CALL_LIST_OFFSET
:
8215 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
8216 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
8218 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
8219 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
8220 enum_string(n
[1].e
), enum_string(n
[2].e
),
8221 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8223 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
8224 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
8225 enum_string(n
[1].e
), enum_string(n
[2].e
),
8226 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
8228 case OPCODE_DISABLE
:
8229 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
8232 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
8234 case OPCODE_FRUSTUM
:
8235 _mesa_printf("Frustum %g %g %g %g %g %g\n",
8236 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8238 case OPCODE_LINE_STIPPLE
:
8239 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
8241 case OPCODE_LOAD_IDENTITY
:
8242 _mesa_printf("LoadIdentity\n");
8244 case OPCODE_LOAD_MATRIX
:
8245 _mesa_printf("LoadMatrix\n");
8246 _mesa_printf(" %8f %8f %8f %8f\n",
8247 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8248 _mesa_printf(" %8f %8f %8f %8f\n",
8249 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8250 _mesa_printf(" %8f %8f %8f %8f\n",
8251 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8252 _mesa_printf(" %8f %8f %8f %8f\n",
8253 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8255 case OPCODE_MULT_MATRIX
:
8256 _mesa_printf("MultMatrix (or Rotate)\n");
8257 _mesa_printf(" %8f %8f %8f %8f\n",
8258 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8259 _mesa_printf(" %8f %8f %8f %8f\n",
8260 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8261 _mesa_printf(" %8f %8f %8f %8f\n",
8262 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8263 _mesa_printf(" %8f %8f %8f %8f\n",
8264 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8267 _mesa_printf("Ortho %g %g %g %g %g %g\n",
8268 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8270 case OPCODE_POP_ATTRIB
:
8271 _mesa_printf("PopAttrib\n");
8273 case OPCODE_POP_MATRIX
:
8274 _mesa_printf("PopMatrix\n");
8276 case OPCODE_POP_NAME
:
8277 _mesa_printf("PopName\n");
8279 case OPCODE_PUSH_ATTRIB
:
8280 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
8282 case OPCODE_PUSH_MATRIX
:
8283 _mesa_printf("PushMatrix\n");
8285 case OPCODE_PUSH_NAME
:
8286 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
8288 case OPCODE_RASTER_POS
:
8289 _mesa_printf("RasterPos %g %g %g %g\n",
8290 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8293 _mesa_printf("Rotate %g %g %g %g\n",
8294 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8297 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8299 case OPCODE_TRANSLATE
:
8300 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8302 case OPCODE_BIND_TEXTURE
:
8303 _mesa_printf("BindTexture %s %d\n",
8304 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
8306 case OPCODE_SHADE_MODEL
:
8307 _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
8310 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
8311 _mesa_lookup_enum_by_nr(n
[1].ui
),
8312 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
8315 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
8316 _mesa_lookup_enum_by_nr(n
[1].ui
),
8317 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
8318 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
8320 case OPCODE_MAPGRID1
:
8321 _mesa_printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
8323 case OPCODE_MAPGRID2
:
8324 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
8325 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
8327 case OPCODE_EVALMESH1
:
8328 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
8330 case OPCODE_EVALMESH2
:
8331 _mesa_printf("EvalMesh2 %d %d %d %d\n",
8332 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
8335 case OPCODE_ATTR_1F_NV
:
8336 _mesa_printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
8338 case OPCODE_ATTR_2F_NV
:
8339 _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
8340 n
[1].i
, n
[2].f
, n
[3].f
);
8342 case OPCODE_ATTR_3F_NV
:
8343 _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
8344 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8346 case OPCODE_ATTR_4F_NV
:
8347 _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
8348 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8350 case OPCODE_ATTR_1F_ARB
:
8351 _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
8353 case OPCODE_ATTR_2F_ARB
:
8354 _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
8355 n
[1].i
, n
[2].f
, n
[3].f
);
8357 case OPCODE_ATTR_3F_ARB
:
8358 _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
8359 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8361 case OPCODE_ATTR_4F_ARB
:
8362 _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
8363 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8366 case OPCODE_MATERIAL
:
8367 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
8368 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8371 _mesa_printf("INDEX: %f\n", n
[1].f
);
8373 case OPCODE_EDGEFLAG
:
8374 _mesa_printf("EDGEFLAG: %d\n", n
[1].i
);
8377 _mesa_printf("BEGIN %x\n", n
[1].i
);
8380 _mesa_printf("END\n");
8383 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
8386 case OPCODE_EVAL_C1
:
8387 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
8389 case OPCODE_EVAL_C2
:
8390 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
8392 case OPCODE_EVAL_P1
:
8393 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
8395 case OPCODE_EVAL_P2
:
8396 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
8402 * meta opcodes/commands
8405 _mesa_printf("Error: %s %s\n",
8406 enum_string(n
[1].e
), (const char *) n
[2].data
);
8408 case OPCODE_CONTINUE
:
8409 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
8410 n
= (Node
*) n
[1].next
;
8412 case OPCODE_END_OF_LIST
:
8413 _mesa_printf("END-LIST %u\n", list
);
8417 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
8419 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
8420 opcode
, (void *) n
);
8424 _mesa_printf("command %d, %u operands\n", opcode
,
8428 /* increment n to point to next compiled command */
8429 if (opcode
!= OPCODE_CONTINUE
) {
8430 n
+= InstSize
[opcode
];
8439 * Clients may call this function to help debug display list problems.
8440 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
8441 * changed, or break in the future without notice.
8444 mesa_print_display_list(GLuint list
)
8446 GET_CURRENT_CONTEXT(ctx
);
8447 print_list(ctx
, list
);
8451 /**********************************************************************/
8452 /***** Initialization *****/
8453 /**********************************************************************/
8456 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
8458 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
8459 vfmt
->Begin
= save_Begin
;
8460 vfmt
->CallList
= _mesa_save_CallList
;
8461 vfmt
->CallLists
= _mesa_save_CallLists
;
8462 vfmt
->Color3f
= save_Color3f
;
8463 vfmt
->Color3fv
= save_Color3fv
;
8464 vfmt
->Color4f
= save_Color4f
;
8465 vfmt
->Color4fv
= save_Color4fv
;
8466 vfmt
->EdgeFlag
= save_EdgeFlag
;
8467 vfmt
->End
= save_End
;
8468 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
8469 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
8470 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
8471 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
8472 vfmt
->EvalPoint1
= save_EvalPoint1
;
8473 vfmt
->EvalPoint2
= save_EvalPoint2
;
8474 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
8475 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
8476 vfmt
->Indexf
= save_Indexf
;
8477 vfmt
->Indexfv
= save_Indexfv
;
8478 vfmt
->Materialfv
= save_Materialfv
;
8479 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
8480 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
8481 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
8482 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
8483 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
8484 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
8485 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
8486 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
8487 vfmt
->Normal3f
= save_Normal3f
;
8488 vfmt
->Normal3fv
= save_Normal3fv
;
8489 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
8490 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
8491 vfmt
->TexCoord1f
= save_TexCoord1f
;
8492 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
8493 vfmt
->TexCoord2f
= save_TexCoord2f
;
8494 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
8495 vfmt
->TexCoord3f
= save_TexCoord3f
;
8496 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
8497 vfmt
->TexCoord4f
= save_TexCoord4f
;
8498 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
8499 vfmt
->Vertex2f
= save_Vertex2f
;
8500 vfmt
->Vertex2fv
= save_Vertex2fv
;
8501 vfmt
->Vertex3f
= save_Vertex3f
;
8502 vfmt
->Vertex3fv
= save_Vertex3fv
;
8503 vfmt
->Vertex4f
= save_Vertex4f
;
8504 vfmt
->Vertex4fv
= save_Vertex4fv
;
8505 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
8506 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
8507 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
8508 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
8509 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
8510 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
8511 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
8512 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
8513 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
8514 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
8515 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
8516 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
8517 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
8518 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
8519 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
8520 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
8522 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
8523 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
8524 vfmt
->Rectf
= save_Rectf
;
8526 /* The driver is required to implement these as
8527 * 1) They can probably do a better job.
8528 * 2) A lot of new mechanisms would have to be added to this module
8529 * to support it. That code would probably never get used,
8533 vfmt
->DrawArrays
= 0;
8534 vfmt
->DrawElements
= 0;
8535 vfmt
->DrawRangeElements
= 0;
8541 * Initialize display list state for given context.
8544 _mesa_init_display_list(GLcontext
*ctx
)
8546 static GLboolean tableInitialized
= GL_FALSE
;
8548 /* zero-out the instruction size table, just once */
8549 if (!tableInitialized
) {
8550 _mesa_bzero(InstSize
, sizeof(InstSize
));
8551 tableInitialized
= GL_TRUE
;
8555 ctx
->ListState
.CallDepth
= 0;
8556 ctx
->ExecuteFlag
= GL_TRUE
;
8557 ctx
->CompileFlag
= GL_FALSE
;
8558 ctx
->ListState
.CurrentListPtr
= NULL
;
8559 ctx
->ListState
.CurrentBlock
= NULL
;
8560 ctx
->ListState
.CurrentListNum
= 0;
8561 ctx
->ListState
.CurrentPos
= 0;
8563 /* Display List group */
8564 ctx
->List
.ListBase
= 0;
8566 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);