2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 * Display lists management functions.
33 #include "api_arrayelt.h"
34 #include "api_loopback.h"
39 #if FEATURE_ARB_vertex_buffer_object
40 #include "bufferobj.h"
53 #include "extensions.h"
56 #include "glapi/glapi.h"
58 #include "histogram.h"
75 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
76 #include "shader/arbprogram.h"
77 #include "shader/program.h"
79 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
80 #include "shader/nvprogram.h"
81 #include "shader/program.h"
83 #if FEATURE_ATI_fragment_shader
84 #include "shader/atifragshader.h"
87 #include "math/m_matrix.h"
88 #include "math/m_xform.h"
90 #include "glapi/dispatch.h"
96 * \param ctx GL context.
98 * Checks if dd_function_table::SaveNeedFlush is marked to flush
99 * stored (save) vertices, and calls
100 * dd_function_table::SaveFlushVertices if so.
102 #define SAVE_FLUSH_VERTICES(ctx) \
104 if (ctx->Driver.SaveNeedFlush) \
105 ctx->Driver.SaveFlushVertices(ctx); \
110 * Macro to assert that the API call was made outside the
111 * glBegin()/glEnd() pair, with return value.
113 * \param ctx GL context.
114 * \param retval value to return value in case the assertion fails.
116 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
118 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
119 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
120 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
126 * Macro to assert that the API call was made outside the
127 * glBegin()/glEnd() pair.
129 * \param ctx GL context.
131 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
133 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
134 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
135 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
141 * Macro to assert that the API call was made outside the
142 * glBegin()/glEnd() pair and flush the vertices.
144 * \param ctx GL context.
146 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
148 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
149 SAVE_FLUSH_VERTICES(ctx); \
153 * Macro to assert that the API call was made outside the
154 * glBegin()/glEnd() pair and flush the vertices, with return value.
156 * \param ctx GL context.
157 * \param retval value to return value in case the assertion fails.
159 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
161 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
162 SAVE_FLUSH_VERTICES(ctx); \
168 * Display list opcodes.
170 * The fact that these identifiers are assigned consecutive
171 * integer values starting at 0 is very important, see InstSize array usage)
175 OPCODE_INVALID
= -1, /* Force signed enum */
181 OPCODE_BLEND_EQUATION
,
182 OPCODE_BLEND_EQUATION_SEPARATE
,
183 OPCODE_BLEND_FUNC_SEPARATE
,
185 OPCODE_CALL_LIST_OFFSET
,
191 OPCODE_CLEAR_STENCIL
,
194 OPCODE_COLOR_MATERIAL
,
196 OPCODE_COLOR_TABLE_PARAMETER_FV
,
197 OPCODE_COLOR_TABLE_PARAMETER_IV
,
198 OPCODE_COLOR_SUB_TABLE
,
199 OPCODE_CONVOLUTION_FILTER_1D
,
200 OPCODE_CONVOLUTION_FILTER_2D
,
201 OPCODE_CONVOLUTION_PARAMETER_I
,
202 OPCODE_CONVOLUTION_PARAMETER_IV
,
203 OPCODE_CONVOLUTION_PARAMETER_F
,
204 OPCODE_CONVOLUTION_PARAMETER_FV
,
205 OPCODE_COPY_COLOR_SUB_TABLE
,
206 OPCODE_COPY_COLOR_TABLE
,
208 OPCODE_COPY_TEX_IMAGE1D
,
209 OPCODE_COPY_TEX_IMAGE2D
,
210 OPCODE_COPY_TEX_SUB_IMAGE1D
,
211 OPCODE_COPY_TEX_SUB_IMAGE2D
,
212 OPCODE_COPY_TEX_SUB_IMAGE3D
,
235 OPCODE_LOAD_IDENTITY
,
249 OPCODE_PIXEL_TRANSFER
,
252 OPCODE_POINT_PARAMETERS
,
254 OPCODE_POLYGON_STIPPLE
,
255 OPCODE_POLYGON_OFFSET
,
259 OPCODE_PRIORITIZE_TEXTURE
,
265 OPCODE_RESET_HISTOGRAM
,
266 OPCODE_RESET_MIN_MAX
,
270 OPCODE_SELECT_TEXTURE_SGIS
,
271 OPCODE_SELECT_TEXTURE_COORD_SET
,
282 OPCODE_TEX_SUB_IMAGE1D
,
283 OPCODE_TEX_SUB_IMAGE2D
,
284 OPCODE_TEX_SUB_IMAGE3D
,
288 /* GL_ARB_multitexture */
289 OPCODE_ACTIVE_TEXTURE
,
290 /* GL_ARB_texture_compression */
291 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
292 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
293 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
294 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
295 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
296 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
297 /* GL_ARB_multisample */
298 OPCODE_SAMPLE_COVERAGE
,
299 /* GL_ARB_window_pos */
300 OPCODE_WINDOW_POS_ARB
,
301 /* GL_NV_vertex_program */
302 OPCODE_BIND_PROGRAM_NV
,
303 OPCODE_EXECUTE_PROGRAM_NV
,
304 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
305 OPCODE_LOAD_PROGRAM_NV
,
306 OPCODE_TRACK_MATRIX_NV
,
307 /* GL_NV_fragment_program */
308 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
309 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
310 /* GL_EXT_stencil_two_side */
311 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
312 /* GL_EXT_depth_bounds_test */
313 OPCODE_DEPTH_BOUNDS_EXT
,
314 /* GL_ARB_vertex/fragment_program */
315 OPCODE_PROGRAM_STRING_ARB
,
316 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
317 /* GL_ARB_occlusion_query */
318 OPCODE_BEGIN_QUERY_ARB
,
319 OPCODE_END_QUERY_ARB
,
320 /* GL_ARB_draw_buffers */
321 OPCODE_DRAW_BUFFERS_ARB
,
322 /* GL_ATI_fragment_shader */
323 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
324 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
326 OPCODE_STENCIL_FUNC_SEPARATE
,
327 OPCODE_STENCIL_OP_SEPARATE
,
328 OPCODE_STENCIL_MASK_SEPARATE
,
330 /* GL_EXT_framebuffer_blit */
331 OPCODE_BLIT_FRAMEBUFFER
,
333 /* Vertex attributes -- fallback for when optimized display
334 * list build isn't active.
353 /* The following three are meta instructions */
354 OPCODE_ERROR
, /* raise compiled-in error */
365 * Display list instructions are stored as sequences of "nodes". Nodes
366 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
367 * are linked together with a pointer.
369 * Each instruction in the display list is stored as a sequence of
370 * contiguous nodes in memory.
371 * Each node is the union of a variety of data types.
386 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
391 * How many nodes to allocate at a time.
393 * \note Reduced now that we hold vertices etc. elsewhere.
395 #define BLOCK_SIZE 256
400 * Number of nodes of storage needed for each instruction.
401 * Sizes for dynamically allocated opcodes are stored in the context struct.
403 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
405 void mesa_print_display_list(GLuint list
);
408 /**********************************************************************/
409 /***** Private *****/
410 /**********************************************************************/
414 * Make an empty display list. This is used by glGenLists() to
415 * reserve display list IDs.
417 static struct mesa_display_list
*
418 make_list(GLuint list
, GLuint count
)
420 struct mesa_display_list
*dlist
= CALLOC_STRUCT(mesa_display_list
);
422 dlist
->node
= (Node
*) _mesa_malloc(sizeof(Node
) * count
);
423 dlist
->node
[0].opcode
= OPCODE_END_OF_LIST
;
429 * Lookup function to just encapsulate casting.
431 static INLINE
struct mesa_display_list
*
432 lookup_list(GLcontext
*ctx
, GLuint list
)
434 return (struct mesa_display_list
*)
435 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
441 * Delete the named display list, but don't remove from hash table.
442 * \param dlist - display list pointer
445 _mesa_delete_list(GLcontext
*ctx
, struct mesa_display_list
*dlist
)
450 n
= block
= dlist
->node
;
452 done
= block
? GL_FALSE
: GL_TRUE
;
455 /* check for extension opcodes first */
457 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
458 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
459 ctx
->ListExt
.Opcode
[i
].Destroy(ctx
, &n
[1]);
460 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
463 switch (n
[0].opcode
) {
464 /* for some commands, we need to free malloc'd memory */
466 _mesa_free(n
[6].data
);
467 n
+= InstSize
[n
[0].opcode
];
470 _mesa_free(n
[10].data
);
471 n
+= InstSize
[n
[0].opcode
];
473 case OPCODE_DRAW_PIXELS
:
474 _mesa_free(n
[5].data
);
475 n
+= InstSize
[n
[0].opcode
];
478 _mesa_free(n
[7].data
);
479 n
+= InstSize
[n
[0].opcode
];
481 case OPCODE_COLOR_TABLE
:
482 _mesa_free(n
[6].data
);
483 n
+= InstSize
[n
[0].opcode
];
485 case OPCODE_COLOR_SUB_TABLE
:
486 _mesa_free(n
[6].data
);
487 n
+= InstSize
[n
[0].opcode
];
489 case OPCODE_CONVOLUTION_FILTER_1D
:
490 _mesa_free(n
[6].data
);
491 n
+= InstSize
[n
[0].opcode
];
493 case OPCODE_CONVOLUTION_FILTER_2D
:
494 _mesa_free(n
[7].data
);
495 n
+= InstSize
[n
[0].opcode
];
497 case OPCODE_POLYGON_STIPPLE
:
498 _mesa_free(n
[1].data
);
499 n
+= InstSize
[n
[0].opcode
];
501 case OPCODE_TEX_IMAGE1D
:
502 _mesa_free(n
[8].data
);
503 n
+= InstSize
[n
[0].opcode
];
505 case OPCODE_TEX_IMAGE2D
:
506 _mesa_free(n
[9].data
);
507 n
+= InstSize
[n
[0].opcode
];
509 case OPCODE_TEX_IMAGE3D
:
510 _mesa_free(n
[10].data
);
511 n
+= InstSize
[n
[0].opcode
];
513 case OPCODE_TEX_SUB_IMAGE1D
:
514 _mesa_free(n
[7].data
);
515 n
+= InstSize
[n
[0].opcode
];
517 case OPCODE_TEX_SUB_IMAGE2D
:
518 _mesa_free(n
[9].data
);
519 n
+= InstSize
[n
[0].opcode
];
521 case OPCODE_TEX_SUB_IMAGE3D
:
522 _mesa_free(n
[11].data
);
523 n
+= InstSize
[n
[0].opcode
];
525 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
526 _mesa_free(n
[7].data
);
527 n
+= InstSize
[n
[0].opcode
];
529 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
530 _mesa_free(n
[8].data
);
531 n
+= InstSize
[n
[0].opcode
];
533 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
534 _mesa_free(n
[9].data
);
535 n
+= InstSize
[n
[0].opcode
];
537 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
538 _mesa_free(n
[7].data
);
539 n
+= InstSize
[n
[0].opcode
];
541 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
542 _mesa_free(n
[9].data
);
543 n
+= InstSize
[n
[0].opcode
];
545 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
546 _mesa_free(n
[11].data
);
547 n
+= InstSize
[n
[0].opcode
];
549 #if FEATURE_NV_vertex_program
550 case OPCODE_LOAD_PROGRAM_NV
:
551 _mesa_free(n
[4].data
); /* program string */
552 n
+= InstSize
[n
[0].opcode
];
554 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
555 _mesa_free(n
[2].data
); /* array of program ids */
556 n
+= InstSize
[n
[0].opcode
];
559 #if FEATURE_NV_fragment_program
560 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
561 _mesa_free(n
[3].data
); /* parameter name */
562 n
+= InstSize
[n
[0].opcode
];
565 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
566 case OPCODE_PROGRAM_STRING_ARB
:
567 _mesa_free(n
[4].data
); /* program string */
568 n
+= InstSize
[n
[0].opcode
];
571 case OPCODE_CONTINUE
:
572 n
= (Node
*) n
[1].next
;
576 case OPCODE_END_OF_LIST
:
581 /* Most frequent case */
582 n
+= InstSize
[n
[0].opcode
];
593 * Destroy a display list and remove from hash table.
594 * \param list - display list number
597 destroy_list(GLcontext
*ctx
, GLuint list
)
599 struct mesa_display_list
*dlist
;
604 dlist
= lookup_list(ctx
, list
);
608 _mesa_delete_list(ctx
, dlist
);
609 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
614 * Translate the nth element of list from type to GLuint.
617 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
629 bptr
= (GLbyte
*) list
;
630 return (GLuint
) *(bptr
+ n
);
631 case GL_UNSIGNED_BYTE
:
632 ubptr
= (GLubyte
*) list
;
633 return (GLuint
) *(ubptr
+ n
);
635 sptr
= (GLshort
*) list
;
636 return (GLuint
) *(sptr
+ n
);
637 case GL_UNSIGNED_SHORT
:
638 usptr
= (GLushort
*) list
;
639 return (GLuint
) *(usptr
+ n
);
641 iptr
= (GLint
*) list
;
642 return (GLuint
) *(iptr
+ n
);
643 case GL_UNSIGNED_INT
:
644 uiptr
= (GLuint
*) list
;
645 return (GLuint
) *(uiptr
+ n
);
647 fptr
= (GLfloat
*) list
;
648 return (GLuint
) *(fptr
+ n
);
650 ubptr
= ((GLubyte
*) list
) + 2 * n
;
651 return (GLuint
) *ubptr
* 256 + (GLuint
) * (ubptr
+ 1);
653 ubptr
= ((GLubyte
*) list
) + 3 * n
;
654 return (GLuint
) * ubptr
* 65536
655 + (GLuint
) *(ubptr
+ 1) * 256 + (GLuint
) * (ubptr
+ 2);
657 ubptr
= ((GLubyte
*) list
) + 4 * n
;
658 return (GLuint
) *ubptr
* 16777216
659 + (GLuint
) *(ubptr
+ 1) * 65536
660 + (GLuint
) *(ubptr
+ 2) * 256 + (GLuint
) * (ubptr
+ 3);
669 /**********************************************************************/
671 /**********************************************************************/
674 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
675 * \todo This won't suffice when the PBO is really in VRAM/GPU memory.
678 unpack_image(GLuint dimensions
, GLsizei width
, GLsizei height
, GLsizei depth
,
679 GLenum format
, GLenum type
, const GLvoid
* pixels
,
680 const struct gl_pixelstore_attrib
*unpack
)
682 if (unpack
->BufferObj
->Name
== 0) {
684 return _mesa_unpack_image(dimensions
, width
, height
, depth
, format
,
685 type
, pixels
, unpack
);
688 if (_mesa_validate_pbo_access
689 (dimensions
, unpack
, width
, height
, depth
, format
, type
, pixels
)) {
690 const GLubyte
*src
= ADD_POINTERS(unpack
->BufferObj
->Data
, pixels
);
691 return _mesa_unpack_image(dimensions
, width
, height
, depth
, format
,
700 * Allocate space for a display list instruction.
701 * \param opcode the instruction opcode (OPCODE_* value)
702 * \param size instruction size in bytes, not counting opcode.
703 * \return pointer to the usable data area (not including the internal
707 _mesa_alloc_instruction(GLcontext
*ctx
, GLuint opcode
, GLuint bytes
)
709 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
712 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
713 if (InstSize
[opcode
] == 0) {
714 /* save instruction size now */
715 InstSize
[opcode
] = numNodes
;
718 /* make sure instruction size agrees */
719 ASSERT(numNodes
== InstSize
[opcode
]);
723 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
724 /* This block is full. Allocate a new block and chain to it */
726 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
727 n
[0].opcode
= OPCODE_CONTINUE
;
728 newblock
= (Node
*) _mesa_malloc(sizeof(Node
) * BLOCK_SIZE
);
730 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
733 n
[1].next
= (Node
*) newblock
;
734 ctx
->ListState
.CurrentBlock
= newblock
;
735 ctx
->ListState
.CurrentPos
= 0;
738 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
739 ctx
->ListState
.CurrentPos
+= numNodes
;
741 n
[0].opcode
= (OpCode
) opcode
;
743 return (void *) (n
+ 1); /* return ptr to node following opcode */
748 * This function allows modules and drivers to get their own opcodes
749 * for extending display list functionality.
750 * \param ctx the rendering context
751 * \param size number of bytes for storing the new display list command
752 * \param execute function to execute the new display list command
753 * \param destroy function to destroy the new display list command
754 * \param print function to print the new display list command
755 * \return the new opcode number or -1 if error
758 _mesa_alloc_opcode(GLcontext
*ctx
,
760 void (*execute
) (GLcontext
*, void *),
761 void (*destroy
) (GLcontext
*, void *),
762 void (*print
) (GLcontext
*, void *))
764 if (ctx
->ListExt
.NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
765 const GLuint i
= ctx
->ListExt
.NumOpcodes
++;
766 ctx
->ListExt
.Opcode
[i
].Size
=
767 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
768 ctx
->ListExt
.Opcode
[i
].Execute
= execute
;
769 ctx
->ListExt
.Opcode
[i
].Destroy
= destroy
;
770 ctx
->ListExt
.Opcode
[i
].Print
= print
;
771 return i
+ OPCODE_EXT_0
;
779 * Allocate display list instruction. Returns Node ptr to where the opcode
781 * - nParams is the number of function parameters
782 * - return value a pointer to sizeof(Node) before the actual
785 #define ALLOC_INSTRUCTION(CTX, OPCODE, NPARAMS) \
786 ((Node *)_mesa_alloc_instruction(CTX, OPCODE, (NPARAMS)*sizeof(Node)) - 1)
791 * Display List compilation functions
793 static void GLAPIENTRY
794 save_Accum(GLenum op
, GLfloat value
)
796 GET_CURRENT_CONTEXT(ctx
);
798 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
799 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACCUM
, 2);
804 if (ctx
->ExecuteFlag
) {
805 CALL_Accum(ctx
->Exec
, (op
, value
));
810 static void GLAPIENTRY
811 save_AlphaFunc(GLenum func
, GLclampf ref
)
813 GET_CURRENT_CONTEXT(ctx
);
815 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
816 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ALPHA_FUNC
, 2);
819 n
[2].f
= (GLfloat
) ref
;
821 if (ctx
->ExecuteFlag
) {
822 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
827 static void GLAPIENTRY
828 save_BindTexture(GLenum target
, GLuint texture
)
830 GET_CURRENT_CONTEXT(ctx
);
832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
833 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_TEXTURE
, 2);
838 if (ctx
->ExecuteFlag
) {
839 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
844 static void GLAPIENTRY
845 save_Bitmap(GLsizei width
, GLsizei height
,
846 GLfloat xorig
, GLfloat yorig
,
847 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
849 GET_CURRENT_CONTEXT(ctx
);
850 GLvoid
*image
= _mesa_unpack_bitmap(width
, height
, pixels
, &ctx
->Unpack
);
852 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
853 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BITMAP
, 7);
855 n
[1].i
= (GLint
) width
;
856 n
[2].i
= (GLint
) height
;
866 if (ctx
->ExecuteFlag
) {
867 CALL_Bitmap(ctx
->Exec
, (width
, height
,
868 xorig
, yorig
, xmove
, ymove
, pixels
));
873 static void GLAPIENTRY
874 save_BlendEquation(GLenum mode
)
876 GET_CURRENT_CONTEXT(ctx
);
878 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
879 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_EQUATION
, 1);
883 if (ctx
->ExecuteFlag
) {
884 CALL_BlendEquation(ctx
->Exec
, (mode
));
889 static void GLAPIENTRY
890 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
892 GET_CURRENT_CONTEXT(ctx
);
894 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
895 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
900 if (ctx
->ExecuteFlag
) {
901 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
906 static void GLAPIENTRY
907 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
908 GLenum sfactorA
, GLenum dfactorA
)
910 GET_CURRENT_CONTEXT(ctx
);
912 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
913 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
920 if (ctx
->ExecuteFlag
) {
921 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
922 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
927 static void GLAPIENTRY
928 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
930 GET_CURRENT_CONTEXT(ctx
);
932 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
933 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_COLOR
, 4);
940 if (ctx
->ExecuteFlag
) {
941 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
947 _mesa_save_CallList(GLuint list
)
949 GET_CURRENT_CONTEXT(ctx
);
951 SAVE_FLUSH_VERTICES(ctx
);
953 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CALL_LIST
, 1);
958 /* After this, we don't know what begin/end state we're in:
960 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
962 if (ctx
->ExecuteFlag
) {
963 CALL_CallList(ctx
->Exec
, (list
));
969 _mesa_save_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
971 GET_CURRENT_CONTEXT(ctx
);
973 GLboolean typeErrorFlag
;
975 SAVE_FLUSH_VERTICES(ctx
);
979 case GL_UNSIGNED_BYTE
:
981 case GL_UNSIGNED_SHORT
:
983 case GL_UNSIGNED_INT
:
988 typeErrorFlag
= GL_FALSE
;
991 typeErrorFlag
= GL_TRUE
;
994 for (i
= 0; i
< n
; i
++) {
995 GLuint list
= translate_id(i
, type
, lists
);
996 Node
*n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
999 n
[2].b
= typeErrorFlag
;
1003 /* After this, we don't know what begin/end state we're in:
1005 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1007 if (ctx
->ExecuteFlag
) {
1008 CALL_CallLists(ctx
->Exec
, (n
, type
, lists
));
1013 static void GLAPIENTRY
1014 save_Clear(GLbitfield mask
)
1016 GET_CURRENT_CONTEXT(ctx
);
1018 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1019 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR
, 1);
1023 if (ctx
->ExecuteFlag
) {
1024 CALL_Clear(ctx
->Exec
, (mask
));
1029 static void GLAPIENTRY
1030 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1032 GET_CURRENT_CONTEXT(ctx
);
1034 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1035 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1042 if (ctx
->ExecuteFlag
) {
1043 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1048 static void GLAPIENTRY
1049 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1051 GET_CURRENT_CONTEXT(ctx
);
1053 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1054 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_COLOR
, 4);
1061 if (ctx
->ExecuteFlag
) {
1062 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1067 static void GLAPIENTRY
1068 save_ClearDepth(GLclampd depth
)
1070 GET_CURRENT_CONTEXT(ctx
);
1072 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1073 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1075 n
[1].f
= (GLfloat
) depth
;
1077 if (ctx
->ExecuteFlag
) {
1078 CALL_ClearDepth(ctx
->Exec
, (depth
));
1083 static void GLAPIENTRY
1084 save_ClearIndex(GLfloat c
)
1086 GET_CURRENT_CONTEXT(ctx
);
1088 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1089 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_INDEX
, 1);
1093 if (ctx
->ExecuteFlag
) {
1094 CALL_ClearIndex(ctx
->Exec
, (c
));
1099 static void GLAPIENTRY
1100 save_ClearStencil(GLint s
)
1102 GET_CURRENT_CONTEXT(ctx
);
1104 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1105 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1109 if (ctx
->ExecuteFlag
) {
1110 CALL_ClearStencil(ctx
->Exec
, (s
));
1115 static void GLAPIENTRY
1116 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1118 GET_CURRENT_CONTEXT(ctx
);
1120 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1121 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLIP_PLANE
, 5);
1124 n
[2].f
= (GLfloat
) equ
[0];
1125 n
[3].f
= (GLfloat
) equ
[1];
1126 n
[4].f
= (GLfloat
) equ
[2];
1127 n
[5].f
= (GLfloat
) equ
[3];
1129 if (ctx
->ExecuteFlag
) {
1130 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1136 static void GLAPIENTRY
1137 save_ColorMask(GLboolean red
, GLboolean green
,
1138 GLboolean blue
, GLboolean alpha
)
1140 GET_CURRENT_CONTEXT(ctx
);
1142 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1143 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_MASK
, 4);
1150 if (ctx
->ExecuteFlag
) {
1151 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1156 static void GLAPIENTRY
1157 save_ColorMaterial(GLenum face
, GLenum mode
)
1159 GET_CURRENT_CONTEXT(ctx
);
1161 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1163 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1168 if (ctx
->ExecuteFlag
) {
1169 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1174 static void GLAPIENTRY
1175 save_ColorTable(GLenum target
, GLenum internalFormat
,
1176 GLsizei width
, GLenum format
, GLenum type
,
1177 const GLvoid
* table
)
1179 GET_CURRENT_CONTEXT(ctx
);
1180 if (_mesa_is_proxy_texture(target
)) {
1181 /* execute immediately */
1182 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1183 format
, type
, table
));
1186 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
, table
,
1189 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1190 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE
, 6);
1193 n
[2].e
= internalFormat
;
1202 if (ctx
->ExecuteFlag
) {
1203 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1204 format
, type
, table
));
1211 static void GLAPIENTRY
1212 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1213 const GLfloat
*params
)
1215 GET_CURRENT_CONTEXT(ctx
);
1218 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1220 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1225 if (pname
== GL_COLOR_TABLE_SGI
||
1226 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1227 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1228 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1235 if (ctx
->ExecuteFlag
) {
1236 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1241 static void GLAPIENTRY
1242 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1244 GET_CURRENT_CONTEXT(ctx
);
1247 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1249 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1254 if (pname
== GL_COLOR_TABLE_SGI
||
1255 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1256 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1257 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1264 if (ctx
->ExecuteFlag
) {
1265 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1271 static void GLAPIENTRY
1272 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1273 GLenum format
, GLenum type
, const GLvoid
* table
)
1275 GET_CURRENT_CONTEXT(ctx
);
1276 GLvoid
*image
= unpack_image(1, count
, 1, 1, format
, type
, table
,
1279 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1280 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1292 if (ctx
->ExecuteFlag
) {
1293 CALL_ColorSubTable(ctx
->Exec
,
1294 (target
, start
, count
, format
, type
, table
));
1299 static void GLAPIENTRY
1300 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1301 GLint x
, GLint y
, GLsizei width
)
1303 GET_CURRENT_CONTEXT(ctx
);
1306 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1307 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1315 if (ctx
->ExecuteFlag
) {
1316 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1321 static void GLAPIENTRY
1322 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1323 GLint x
, GLint y
, GLsizei width
)
1325 GET_CURRENT_CONTEXT(ctx
);
1328 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1329 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1332 n
[2].e
= internalformat
;
1337 if (ctx
->ExecuteFlag
) {
1338 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1343 static void GLAPIENTRY
1344 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1345 GLenum format
, GLenum type
, const GLvoid
* filter
)
1347 GET_CURRENT_CONTEXT(ctx
);
1348 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
, filter
,
1351 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1352 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1355 n
[2].e
= internalFormat
;
1364 if (ctx
->ExecuteFlag
) {
1365 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1366 format
, type
, filter
));
1371 static void GLAPIENTRY
1372 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1373 GLsizei width
, GLsizei height
, GLenum format
,
1374 GLenum type
, const GLvoid
* filter
)
1376 GET_CURRENT_CONTEXT(ctx
);
1377 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
, filter
,
1380 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1381 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1384 n
[2].e
= internalFormat
;
1394 if (ctx
->ExecuteFlag
) {
1395 CALL_ConvolutionFilter2D(ctx
->Exec
,
1396 (target
, internalFormat
, width
, height
, format
,
1402 static void GLAPIENTRY
1403 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1405 GET_CURRENT_CONTEXT(ctx
);
1407 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1408 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1414 if (ctx
->ExecuteFlag
) {
1415 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1420 static void GLAPIENTRY
1421 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1423 GET_CURRENT_CONTEXT(ctx
);
1425 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1426 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1431 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1432 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1433 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1439 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1442 if (ctx
->ExecuteFlag
) {
1443 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1448 static void GLAPIENTRY
1449 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1451 GET_CURRENT_CONTEXT(ctx
);
1453 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1454 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
1460 if (ctx
->ExecuteFlag
) {
1461 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
1466 static void GLAPIENTRY
1467 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
1468 const GLfloat
*params
)
1470 GET_CURRENT_CONTEXT(ctx
);
1472 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1473 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
1478 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1479 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1480 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1486 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1489 if (ctx
->ExecuteFlag
) {
1490 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
1495 static void GLAPIENTRY
1496 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1498 GET_CURRENT_CONTEXT(ctx
);
1500 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1501 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_PIXELS
, 5);
1505 n
[3].i
= (GLint
) width
;
1506 n
[4].i
= (GLint
) height
;
1509 if (ctx
->ExecuteFlag
) {
1510 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1516 static void GLAPIENTRY
1517 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1518 GLint x
, GLint y
, GLsizei width
, GLint border
)
1520 GET_CURRENT_CONTEXT(ctx
);
1522 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1523 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1527 n
[3].e
= internalformat
;
1533 if (ctx
->ExecuteFlag
) {
1534 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1535 x
, y
, width
, border
));
1540 static void GLAPIENTRY
1541 save_CopyTexImage2D(GLenum target
, GLint level
,
1542 GLenum internalformat
,
1543 GLint x
, GLint y
, GLsizei width
,
1544 GLsizei height
, GLint border
)
1546 GET_CURRENT_CONTEXT(ctx
);
1548 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1549 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1553 n
[3].e
= internalformat
;
1560 if (ctx
->ExecuteFlag
) {
1561 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1562 x
, y
, width
, height
, border
));
1568 static void GLAPIENTRY
1569 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1570 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1572 GET_CURRENT_CONTEXT(ctx
);
1574 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1575 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1584 if (ctx
->ExecuteFlag
) {
1585 CALL_CopyTexSubImage1D(ctx
->Exec
,
1586 (target
, level
, xoffset
, x
, y
, width
));
1591 static void GLAPIENTRY
1592 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1593 GLint xoffset
, GLint yoffset
,
1594 GLint x
, GLint y
, GLsizei width
, GLint height
)
1596 GET_CURRENT_CONTEXT(ctx
);
1598 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1599 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1610 if (ctx
->ExecuteFlag
) {
1611 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1612 x
, y
, width
, height
));
1617 static void GLAPIENTRY
1618 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1619 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1620 GLint x
, GLint y
, GLsizei width
, GLint height
)
1622 GET_CURRENT_CONTEXT(ctx
);
1624 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1625 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1637 if (ctx
->ExecuteFlag
) {
1638 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1639 xoffset
, yoffset
, zoffset
,
1640 x
, y
, width
, height
));
1645 static void GLAPIENTRY
1646 save_CullFace(GLenum mode
)
1648 GET_CURRENT_CONTEXT(ctx
);
1650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1651 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CULL_FACE
, 1);
1655 if (ctx
->ExecuteFlag
) {
1656 CALL_CullFace(ctx
->Exec
, (mode
));
1661 static void GLAPIENTRY
1662 save_DepthFunc(GLenum func
)
1664 GET_CURRENT_CONTEXT(ctx
);
1666 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1667 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_FUNC
, 1);
1671 if (ctx
->ExecuteFlag
) {
1672 CALL_DepthFunc(ctx
->Exec
, (func
));
1677 static void GLAPIENTRY
1678 save_DepthMask(GLboolean mask
)
1680 GET_CURRENT_CONTEXT(ctx
);
1682 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1683 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_MASK
, 1);
1687 if (ctx
->ExecuteFlag
) {
1688 CALL_DepthMask(ctx
->Exec
, (mask
));
1693 static void GLAPIENTRY
1694 save_DepthRange(GLclampd nearval
, GLclampd farval
)
1696 GET_CURRENT_CONTEXT(ctx
);
1698 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1699 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_RANGE
, 2);
1701 n
[1].f
= (GLfloat
) nearval
;
1702 n
[2].f
= (GLfloat
) farval
;
1704 if (ctx
->ExecuteFlag
) {
1705 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
1710 static void GLAPIENTRY
1711 save_Disable(GLenum cap
)
1713 GET_CURRENT_CONTEXT(ctx
);
1715 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1716 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DISABLE
, 1);
1720 if (ctx
->ExecuteFlag
) {
1721 CALL_Disable(ctx
->Exec
, (cap
));
1726 static void GLAPIENTRY
1727 save_DrawBuffer(GLenum mode
)
1729 GET_CURRENT_CONTEXT(ctx
);
1731 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1732 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFER
, 1);
1736 if (ctx
->ExecuteFlag
) {
1737 CALL_DrawBuffer(ctx
->Exec
, (mode
));
1742 static void GLAPIENTRY
1743 save_DrawPixels(GLsizei width
, GLsizei height
,
1744 GLenum format
, GLenum type
, const GLvoid
* pixels
)
1746 GET_CURRENT_CONTEXT(ctx
);
1747 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
1748 pixels
, &ctx
->Unpack
);
1750 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1751 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_PIXELS
, 5);
1762 if (ctx
->ExecuteFlag
) {
1763 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
1769 static void GLAPIENTRY
1770 save_Enable(GLenum cap
)
1772 GET_CURRENT_CONTEXT(ctx
);
1774 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1775 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ENABLE
, 1);
1779 if (ctx
->ExecuteFlag
) {
1780 CALL_Enable(ctx
->Exec
, (cap
));
1786 static void GLAPIENTRY
1787 _mesa_save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
1789 GET_CURRENT_CONTEXT(ctx
);
1791 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1792 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVALMESH1
, 3);
1798 if (ctx
->ExecuteFlag
) {
1799 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
1804 static void GLAPIENTRY
1805 _mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1807 GET_CURRENT_CONTEXT(ctx
);
1809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1810 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVALMESH2
, 5);
1818 if (ctx
->ExecuteFlag
) {
1819 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
1826 static void GLAPIENTRY
1827 save_Fogfv(GLenum pname
, const GLfloat
*params
)
1829 GET_CURRENT_CONTEXT(ctx
);
1831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1832 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FOG
, 5);
1840 if (ctx
->ExecuteFlag
) {
1841 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
1846 static void GLAPIENTRY
1847 save_Fogf(GLenum pname
, GLfloat param
)
1849 save_Fogfv(pname
, ¶m
);
1853 static void GLAPIENTRY
1854 save_Fogiv(GLenum pname
, const GLint
*params
)
1859 case GL_FOG_DENSITY
:
1863 p
[0] = (GLfloat
) *params
;
1866 p
[0] = INT_TO_FLOAT(params
[0]);
1867 p
[1] = INT_TO_FLOAT(params
[1]);
1868 p
[2] = INT_TO_FLOAT(params
[2]);
1869 p
[3] = INT_TO_FLOAT(params
[3]);
1872 /* Error will be caught later in gl_Fogfv */
1875 save_Fogfv(pname
, p
);
1879 static void GLAPIENTRY
1880 save_Fogi(GLenum pname
, GLint param
)
1882 save_Fogiv(pname
, ¶m
);
1886 static void GLAPIENTRY
1887 save_FrontFace(GLenum mode
)
1889 GET_CURRENT_CONTEXT(ctx
);
1891 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1892 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FRONT_FACE
, 1);
1896 if (ctx
->ExecuteFlag
) {
1897 CALL_FrontFace(ctx
->Exec
, (mode
));
1902 static void GLAPIENTRY
1903 save_Frustum(GLdouble left
, GLdouble right
,
1904 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
1906 GET_CURRENT_CONTEXT(ctx
);
1908 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1909 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FRUSTUM
, 6);
1911 n
[1].f
= (GLfloat
) left
;
1912 n
[2].f
= (GLfloat
) right
;
1913 n
[3].f
= (GLfloat
) bottom
;
1914 n
[4].f
= (GLfloat
) top
;
1915 n
[5].f
= (GLfloat
) nearval
;
1916 n
[6].f
= (GLfloat
) farval
;
1918 if (ctx
->ExecuteFlag
) {
1919 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
1924 static void GLAPIENTRY
1925 save_Hint(GLenum target
, GLenum mode
)
1927 GET_CURRENT_CONTEXT(ctx
);
1929 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1930 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_HINT
, 2);
1935 if (ctx
->ExecuteFlag
) {
1936 CALL_Hint(ctx
->Exec
, (target
, mode
));
1941 static void GLAPIENTRY
1942 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
1945 GET_CURRENT_CONTEXT(ctx
);
1948 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1949 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_HISTOGRAM
, 4);
1953 n
[3].e
= internalFormat
;
1956 if (ctx
->ExecuteFlag
) {
1957 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
1962 static void GLAPIENTRY
1963 save_IndexMask(GLuint mask
)
1965 GET_CURRENT_CONTEXT(ctx
);
1967 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1968 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_INDEX_MASK
, 1);
1972 if (ctx
->ExecuteFlag
) {
1973 CALL_IndexMask(ctx
->Exec
, (mask
));
1978 static void GLAPIENTRY
1979 save_InitNames(void)
1981 GET_CURRENT_CONTEXT(ctx
);
1982 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1983 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_INIT_NAMES
, 0);
1984 if (ctx
->ExecuteFlag
) {
1985 CALL_InitNames(ctx
->Exec
, ());
1990 static void GLAPIENTRY
1991 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
1993 GET_CURRENT_CONTEXT(ctx
);
1995 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1996 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIGHT
, 6);
2014 case GL_SPOT_DIRECTION
:
2017 case GL_SPOT_EXPONENT
:
2020 case GL_SPOT_CUTOFF
:
2023 case GL_CONSTANT_ATTENUATION
:
2026 case GL_LINEAR_ATTENUATION
:
2029 case GL_QUADRATIC_ATTENUATION
:
2035 for (i
= 0; i
< nParams
; i
++) {
2036 n
[3 + i
].f
= params
[i
];
2039 if (ctx
->ExecuteFlag
) {
2040 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2045 static void GLAPIENTRY
2046 save_Lightf(GLenum light
, GLenum pname
, GLfloat params
)
2048 save_Lightfv(light
, pname
, ¶ms
);
2052 static void GLAPIENTRY
2053 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2060 fparam
[0] = INT_TO_FLOAT(params
[0]);
2061 fparam
[1] = INT_TO_FLOAT(params
[1]);
2062 fparam
[2] = INT_TO_FLOAT(params
[2]);
2063 fparam
[3] = INT_TO_FLOAT(params
[3]);
2066 fparam
[0] = (GLfloat
) params
[0];
2067 fparam
[1] = (GLfloat
) params
[1];
2068 fparam
[2] = (GLfloat
) params
[2];
2069 fparam
[3] = (GLfloat
) params
[3];
2071 case GL_SPOT_DIRECTION
:
2072 fparam
[0] = (GLfloat
) params
[0];
2073 fparam
[1] = (GLfloat
) params
[1];
2074 fparam
[2] = (GLfloat
) params
[2];
2076 case GL_SPOT_EXPONENT
:
2077 case GL_SPOT_CUTOFF
:
2078 case GL_CONSTANT_ATTENUATION
:
2079 case GL_LINEAR_ATTENUATION
:
2080 case GL_QUADRATIC_ATTENUATION
:
2081 fparam
[0] = (GLfloat
) params
[0];
2084 /* error will be caught later in gl_Lightfv */
2087 save_Lightfv(light
, pname
, fparam
);
2091 static void GLAPIENTRY
2092 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2094 save_Lightiv(light
, pname
, ¶m
);
2098 static void GLAPIENTRY
2099 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2101 GET_CURRENT_CONTEXT(ctx
);
2103 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2104 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIGHT_MODEL
, 5);
2112 if (ctx
->ExecuteFlag
) {
2113 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2118 static void GLAPIENTRY
2119 save_LightModelf(GLenum pname
, GLfloat param
)
2121 save_LightModelfv(pname
, ¶m
);
2125 static void GLAPIENTRY
2126 save_LightModeliv(GLenum pname
, const GLint
*params
)
2130 case GL_LIGHT_MODEL_AMBIENT
:
2131 fparam
[0] = INT_TO_FLOAT(params
[0]);
2132 fparam
[1] = INT_TO_FLOAT(params
[1]);
2133 fparam
[2] = INT_TO_FLOAT(params
[2]);
2134 fparam
[3] = INT_TO_FLOAT(params
[3]);
2136 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2137 case GL_LIGHT_MODEL_TWO_SIDE
:
2138 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2139 fparam
[0] = (GLfloat
) params
[0];
2142 /* Error will be caught later in gl_LightModelfv */
2145 save_LightModelfv(pname
, fparam
);
2149 static void GLAPIENTRY
2150 save_LightModeli(GLenum pname
, GLint param
)
2152 save_LightModeliv(pname
, ¶m
);
2156 static void GLAPIENTRY
2157 save_LineStipple(GLint factor
, GLushort pattern
)
2159 GET_CURRENT_CONTEXT(ctx
);
2161 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2162 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LINE_STIPPLE
, 2);
2167 if (ctx
->ExecuteFlag
) {
2168 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2173 static void GLAPIENTRY
2174 save_LineWidth(GLfloat width
)
2176 GET_CURRENT_CONTEXT(ctx
);
2178 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2179 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LINE_WIDTH
, 1);
2183 if (ctx
->ExecuteFlag
) {
2184 CALL_LineWidth(ctx
->Exec
, (width
));
2189 static void GLAPIENTRY
2190 save_ListBase(GLuint base
)
2192 GET_CURRENT_CONTEXT(ctx
);
2194 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2195 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIST_BASE
, 1);
2199 if (ctx
->ExecuteFlag
) {
2200 CALL_ListBase(ctx
->Exec
, (base
));
2205 static void GLAPIENTRY
2206 save_LoadIdentity(void)
2208 GET_CURRENT_CONTEXT(ctx
);
2209 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2210 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2211 if (ctx
->ExecuteFlag
) {
2212 CALL_LoadIdentity(ctx
->Exec
, ());
2217 static void GLAPIENTRY
2218 save_LoadMatrixf(const GLfloat
* m
)
2220 GET_CURRENT_CONTEXT(ctx
);
2222 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2223 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_MATRIX
, 16);
2226 for (i
= 0; i
< 16; i
++) {
2230 if (ctx
->ExecuteFlag
) {
2231 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2236 static void GLAPIENTRY
2237 save_LoadMatrixd(const GLdouble
* m
)
2241 for (i
= 0; i
< 16; i
++) {
2242 f
[i
] = (GLfloat
) m
[i
];
2244 save_LoadMatrixf(f
);
2248 static void GLAPIENTRY
2249 save_LoadName(GLuint name
)
2251 GET_CURRENT_CONTEXT(ctx
);
2253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2254 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_NAME
, 1);
2258 if (ctx
->ExecuteFlag
) {
2259 CALL_LoadName(ctx
->Exec
, (name
));
2264 static void GLAPIENTRY
2265 save_LogicOp(GLenum opcode
)
2267 GET_CURRENT_CONTEXT(ctx
);
2269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2270 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOGIC_OP
, 1);
2274 if (ctx
->ExecuteFlag
) {
2275 CALL_LogicOp(ctx
->Exec
, (opcode
));
2280 static void GLAPIENTRY
2281 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2282 GLint order
, const GLdouble
* points
)
2284 GET_CURRENT_CONTEXT(ctx
);
2286 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2287 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP1
, 6);
2289 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2291 n
[2].f
= (GLfloat
) u1
;
2292 n
[3].f
= (GLfloat
) u2
;
2293 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2295 n
[6].data
= (void *) pnts
;
2297 if (ctx
->ExecuteFlag
) {
2298 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2302 static void GLAPIENTRY
2303 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2304 GLint order
, const GLfloat
* points
)
2306 GET_CURRENT_CONTEXT(ctx
);
2308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2309 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP1
, 6);
2311 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2315 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2317 n
[6].data
= (void *) pnts
;
2319 if (ctx
->ExecuteFlag
) {
2320 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2325 static void GLAPIENTRY
2326 save_Map2d(GLenum target
,
2327 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2328 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2329 const GLdouble
* points
)
2331 GET_CURRENT_CONTEXT(ctx
);
2333 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2334 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP2
, 10);
2336 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2337 vstride
, vorder
, points
);
2339 n
[2].f
= (GLfloat
) u1
;
2340 n
[3].f
= (GLfloat
) u2
;
2341 n
[4].f
= (GLfloat
) v1
;
2342 n
[5].f
= (GLfloat
) v2
;
2343 /* XXX verify these strides are correct */
2344 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2345 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2348 n
[10].data
= (void *) pnts
;
2350 if (ctx
->ExecuteFlag
) {
2351 CALL_Map2d(ctx
->Exec
, (target
,
2352 u1
, u2
, ustride
, uorder
,
2353 v1
, v2
, vstride
, vorder
, points
));
2358 static void GLAPIENTRY
2359 save_Map2f(GLenum target
,
2360 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2361 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2362 const GLfloat
* points
)
2364 GET_CURRENT_CONTEXT(ctx
);
2366 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2367 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP2
, 10);
2369 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2370 vstride
, vorder
, points
);
2376 /* XXX verify these strides are correct */
2377 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2378 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2381 n
[10].data
= (void *) pnts
;
2383 if (ctx
->ExecuteFlag
) {
2384 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2385 v1
, v2
, vstride
, vorder
, points
));
2390 static void GLAPIENTRY
2391 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2393 GET_CURRENT_CONTEXT(ctx
);
2395 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2396 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAPGRID1
, 3);
2402 if (ctx
->ExecuteFlag
) {
2403 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2408 static void GLAPIENTRY
2409 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2411 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2415 static void GLAPIENTRY
2416 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2417 GLint vn
, GLfloat v1
, GLfloat v2
)
2419 GET_CURRENT_CONTEXT(ctx
);
2421 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2422 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAPGRID2
, 6);
2431 if (ctx
->ExecuteFlag
) {
2432 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2438 static void GLAPIENTRY
2439 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2440 GLint vn
, GLdouble v1
, GLdouble v2
)
2442 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2443 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2447 static void GLAPIENTRY
2448 save_MatrixMode(GLenum mode
)
2450 GET_CURRENT_CONTEXT(ctx
);
2452 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2453 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATRIX_MODE
, 1);
2457 if (ctx
->ExecuteFlag
) {
2458 CALL_MatrixMode(ctx
->Exec
, (mode
));
2463 static void GLAPIENTRY
2464 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2466 GET_CURRENT_CONTEXT(ctx
);
2469 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2470 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MIN_MAX
, 3);
2473 n
[2].e
= internalFormat
;
2476 if (ctx
->ExecuteFlag
) {
2477 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
2482 static void GLAPIENTRY
2483 save_MultMatrixf(const GLfloat
* m
)
2485 GET_CURRENT_CONTEXT(ctx
);
2487 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2488 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MULT_MATRIX
, 16);
2491 for (i
= 0; i
< 16; i
++) {
2495 if (ctx
->ExecuteFlag
) {
2496 CALL_MultMatrixf(ctx
->Exec
, (m
));
2501 static void GLAPIENTRY
2502 save_MultMatrixd(const GLdouble
* m
)
2506 for (i
= 0; i
< 16; i
++) {
2507 f
[i
] = (GLfloat
) m
[i
];
2509 save_MultMatrixf(f
);
2513 static void GLAPIENTRY
2514 save_NewList(GLuint list
, GLenum mode
)
2516 GET_CURRENT_CONTEXT(ctx
);
2517 /* It's an error to call this function while building a display list */
2518 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2525 static void GLAPIENTRY
2526 save_Ortho(GLdouble left
, GLdouble right
,
2527 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2529 GET_CURRENT_CONTEXT(ctx
);
2531 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2532 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ORTHO
, 6);
2534 n
[1].f
= (GLfloat
) left
;
2535 n
[2].f
= (GLfloat
) right
;
2536 n
[3].f
= (GLfloat
) bottom
;
2537 n
[4].f
= (GLfloat
) top
;
2538 n
[5].f
= (GLfloat
) nearval
;
2539 n
[6].f
= (GLfloat
) farval
;
2541 if (ctx
->ExecuteFlag
) {
2542 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2547 static void GLAPIENTRY
2548 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2550 GET_CURRENT_CONTEXT(ctx
);
2552 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2553 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_MAP
, 3);
2557 n
[3].data
= (void *) _mesa_malloc(mapsize
* sizeof(GLfloat
));
2558 MEMCPY(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
2560 if (ctx
->ExecuteFlag
) {
2561 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2566 static void GLAPIENTRY
2567 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2569 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2571 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2572 for (i
= 0; i
< mapsize
; i
++) {
2573 fvalues
[i
] = (GLfloat
) values
[i
];
2577 for (i
= 0; i
< mapsize
; i
++) {
2578 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2581 save_PixelMapfv(map
, mapsize
, fvalues
);
2585 static void GLAPIENTRY
2586 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2588 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2590 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2591 for (i
= 0; i
< mapsize
; i
++) {
2592 fvalues
[i
] = (GLfloat
) values
[i
];
2596 for (i
= 0; i
< mapsize
; i
++) {
2597 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
2600 save_PixelMapfv(map
, mapsize
, fvalues
);
2604 static void GLAPIENTRY
2605 save_PixelTransferf(GLenum pname
, GLfloat param
)
2607 GET_CURRENT_CONTEXT(ctx
);
2609 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2610 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2615 if (ctx
->ExecuteFlag
) {
2616 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
2621 static void GLAPIENTRY
2622 save_PixelTransferi(GLenum pname
, GLint param
)
2624 save_PixelTransferf(pname
, (GLfloat
) param
);
2628 static void GLAPIENTRY
2629 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
2631 GET_CURRENT_CONTEXT(ctx
);
2633 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2634 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_ZOOM
, 2);
2639 if (ctx
->ExecuteFlag
) {
2640 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
2645 static void GLAPIENTRY
2646 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
2648 GET_CURRENT_CONTEXT(ctx
);
2650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2651 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POINT_PARAMETERS
, 4);
2658 if (ctx
->ExecuteFlag
) {
2659 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
2664 static void GLAPIENTRY
2665 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
2667 save_PointParameterfvEXT(pname
, ¶m
);
2670 static void GLAPIENTRY
2671 save_PointParameteriNV(GLenum pname
, GLint param
)
2673 GLfloat p
= (GLfloat
) param
;
2674 save_PointParameterfvEXT(pname
, &p
);
2677 static void GLAPIENTRY
2678 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
2680 GLfloat p
= (GLfloat
) param
[0];
2681 save_PointParameterfvEXT(pname
, &p
);
2685 static void GLAPIENTRY
2686 save_PointSize(GLfloat size
)
2688 GET_CURRENT_CONTEXT(ctx
);
2690 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2691 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POINT_SIZE
, 1);
2695 if (ctx
->ExecuteFlag
) {
2696 CALL_PointSize(ctx
->Exec
, (size
));
2701 static void GLAPIENTRY
2702 save_PolygonMode(GLenum face
, GLenum mode
)
2704 GET_CURRENT_CONTEXT(ctx
);
2706 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2707 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_MODE
, 2);
2712 if (ctx
->ExecuteFlag
) {
2713 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
2718 static void GLAPIENTRY
2719 save_PolygonStipple(const GLubyte
* pattern
)
2721 GET_CURRENT_CONTEXT(ctx
);
2722 GLvoid
*image
= unpack_image(2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
2723 pattern
, &ctx
->Unpack
);
2725 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2726 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
2733 if (ctx
->ExecuteFlag
) {
2734 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
2739 static void GLAPIENTRY
2740 save_PolygonOffset(GLfloat factor
, GLfloat units
)
2742 GET_CURRENT_CONTEXT(ctx
);
2744 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2745 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_OFFSET
, 2);
2750 if (ctx
->ExecuteFlag
) {
2751 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
2756 static void GLAPIENTRY
2757 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
2759 GET_CURRENT_CONTEXT(ctx
);
2760 /* XXX mult by DepthMaxF here??? */
2761 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
2765 static void GLAPIENTRY
2766 save_PopAttrib(void)
2768 GET_CURRENT_CONTEXT(ctx
);
2769 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2770 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_ATTRIB
, 0);
2771 if (ctx
->ExecuteFlag
) {
2772 CALL_PopAttrib(ctx
->Exec
, ());
2777 static void GLAPIENTRY
2778 save_PopMatrix(void)
2780 GET_CURRENT_CONTEXT(ctx
);
2781 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2782 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_MATRIX
, 0);
2783 if (ctx
->ExecuteFlag
) {
2784 CALL_PopMatrix(ctx
->Exec
, ());
2789 static void GLAPIENTRY
2792 GET_CURRENT_CONTEXT(ctx
);
2793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2794 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_NAME
, 0);
2795 if (ctx
->ExecuteFlag
) {
2796 CALL_PopName(ctx
->Exec
, ());
2801 static void GLAPIENTRY
2802 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
2803 const GLclampf
* priorities
)
2805 GET_CURRENT_CONTEXT(ctx
);
2807 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2809 for (i
= 0; i
< num
; i
++) {
2811 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
2813 n
[1].ui
= textures
[i
];
2814 n
[2].f
= priorities
[i
];
2817 if (ctx
->ExecuteFlag
) {
2818 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
2823 static void GLAPIENTRY
2824 save_PushAttrib(GLbitfield mask
)
2826 GET_CURRENT_CONTEXT(ctx
);
2828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2829 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_ATTRIB
, 1);
2833 if (ctx
->ExecuteFlag
) {
2834 CALL_PushAttrib(ctx
->Exec
, (mask
));
2839 static void GLAPIENTRY
2840 save_PushMatrix(void)
2842 GET_CURRENT_CONTEXT(ctx
);
2843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2844 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_MATRIX
, 0);
2845 if (ctx
->ExecuteFlag
) {
2846 CALL_PushMatrix(ctx
->Exec
, ());
2851 static void GLAPIENTRY
2852 save_PushName(GLuint name
)
2854 GET_CURRENT_CONTEXT(ctx
);
2856 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2857 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_NAME
, 1);
2861 if (ctx
->ExecuteFlag
) {
2862 CALL_PushName(ctx
->Exec
, (name
));
2867 static void GLAPIENTRY
2868 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2870 GET_CURRENT_CONTEXT(ctx
);
2872 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2873 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RASTER_POS
, 4);
2880 if (ctx
->ExecuteFlag
) {
2881 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
2885 static void GLAPIENTRY
2886 save_RasterPos2d(GLdouble x
, GLdouble y
)
2888 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2891 static void GLAPIENTRY
2892 save_RasterPos2f(GLfloat x
, GLfloat y
)
2894 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2897 static void GLAPIENTRY
2898 save_RasterPos2i(GLint x
, GLint y
)
2900 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2903 static void GLAPIENTRY
2904 save_RasterPos2s(GLshort x
, GLshort y
)
2906 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2909 static void GLAPIENTRY
2910 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2912 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2915 static void GLAPIENTRY
2916 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2918 save_RasterPos4f(x
, y
, z
, 1.0F
);
2921 static void GLAPIENTRY
2922 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2924 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2927 static void GLAPIENTRY
2928 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2930 save_RasterPos4f(x
, y
, z
, 1.0F
);
2933 static void GLAPIENTRY
2934 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2936 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2939 static void GLAPIENTRY
2940 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
2942 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2945 static void GLAPIENTRY
2946 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
2948 save_RasterPos4f(x
, y
, z
, w
);
2951 static void GLAPIENTRY
2952 save_RasterPos2dv(const GLdouble
* v
)
2954 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2957 static void GLAPIENTRY
2958 save_RasterPos2fv(const GLfloat
* v
)
2960 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2963 static void GLAPIENTRY
2964 save_RasterPos2iv(const GLint
* v
)
2966 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2969 static void GLAPIENTRY
2970 save_RasterPos2sv(const GLshort
* v
)
2972 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2975 static void GLAPIENTRY
2976 save_RasterPos3dv(const GLdouble
* v
)
2978 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2981 static void GLAPIENTRY
2982 save_RasterPos3fv(const GLfloat
* v
)
2984 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
2987 static void GLAPIENTRY
2988 save_RasterPos3iv(const GLint
* v
)
2990 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2993 static void GLAPIENTRY
2994 save_RasterPos3sv(const GLshort
* v
)
2996 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
2999 static void GLAPIENTRY
3000 save_RasterPos4dv(const GLdouble
* v
)
3002 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3003 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3006 static void GLAPIENTRY
3007 save_RasterPos4fv(const GLfloat
* v
)
3009 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3012 static void GLAPIENTRY
3013 save_RasterPos4iv(const GLint
* v
)
3015 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3016 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3019 static void GLAPIENTRY
3020 save_RasterPos4sv(const GLshort
* v
)
3022 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3026 static void GLAPIENTRY
3027 save_PassThrough(GLfloat token
)
3029 GET_CURRENT_CONTEXT(ctx
);
3031 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3032 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PASSTHROUGH
, 1);
3036 if (ctx
->ExecuteFlag
) {
3037 CALL_PassThrough(ctx
->Exec
, (token
));
3042 static void GLAPIENTRY
3043 save_ReadBuffer(GLenum mode
)
3045 GET_CURRENT_CONTEXT(ctx
);
3047 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3048 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_READ_BUFFER
, 1);
3052 if (ctx
->ExecuteFlag
) {
3053 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3058 static void GLAPIENTRY
3059 save_ResetHistogram(GLenum target
)
3061 GET_CURRENT_CONTEXT(ctx
);
3063 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3064 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3068 if (ctx
->ExecuteFlag
) {
3069 CALL_ResetHistogram(ctx
->Exec
, (target
));
3074 static void GLAPIENTRY
3075 save_ResetMinmax(GLenum target
)
3077 GET_CURRENT_CONTEXT(ctx
);
3079 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3080 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3084 if (ctx
->ExecuteFlag
) {
3085 CALL_ResetMinmax(ctx
->Exec
, (target
));
3090 static void GLAPIENTRY
3091 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3093 GET_CURRENT_CONTEXT(ctx
);
3095 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3096 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ROTATE
, 4);
3103 if (ctx
->ExecuteFlag
) {
3104 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3109 static void GLAPIENTRY
3110 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3112 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3116 static void GLAPIENTRY
3117 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3119 GET_CURRENT_CONTEXT(ctx
);
3121 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3122 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCALE
, 3);
3128 if (ctx
->ExecuteFlag
) {
3129 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3134 static void GLAPIENTRY
3135 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3137 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3141 static void GLAPIENTRY
3142 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3144 GET_CURRENT_CONTEXT(ctx
);
3146 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3147 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCISSOR
, 4);
3154 if (ctx
->ExecuteFlag
) {
3155 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3160 static void GLAPIENTRY
3161 save_ShadeModel(GLenum mode
)
3163 GET_CURRENT_CONTEXT(ctx
);
3165 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3166 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SHADE_MODEL
, 1);
3170 if (ctx
->ExecuteFlag
) {
3171 CALL_ShadeModel(ctx
->Exec
, (mode
));
3176 static void GLAPIENTRY
3177 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3179 GET_CURRENT_CONTEXT(ctx
);
3181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3182 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC
, 3);
3188 if (ctx
->ExecuteFlag
) {
3189 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3194 static void GLAPIENTRY
3195 save_StencilMask(GLuint mask
)
3197 GET_CURRENT_CONTEXT(ctx
);
3199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3200 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK
, 1);
3204 if (ctx
->ExecuteFlag
) {
3205 CALL_StencilMask(ctx
->Exec
, (mask
));
3210 static void GLAPIENTRY
3211 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3213 GET_CURRENT_CONTEXT(ctx
);
3215 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3216 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP
, 3);
3222 if (ctx
->ExecuteFlag
) {
3223 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3228 static void GLAPIENTRY
3229 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3231 GET_CURRENT_CONTEXT(ctx
);
3233 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3234 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3241 if (ctx
->ExecuteFlag
) {
3242 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3247 static void GLAPIENTRY
3248 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3250 GET_CURRENT_CONTEXT(ctx
);
3252 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3253 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3258 if (ctx
->ExecuteFlag
) {
3259 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3264 static void GLAPIENTRY
3265 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3267 GET_CURRENT_CONTEXT(ctx
);
3269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3270 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3277 if (ctx
->ExecuteFlag
) {
3278 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3283 static void GLAPIENTRY
3284 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3286 GET_CURRENT_CONTEXT(ctx
);
3288 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3289 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXENV
, 6);
3293 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3301 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3304 if (ctx
->ExecuteFlag
) {
3305 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3310 static void GLAPIENTRY
3311 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3313 save_TexEnvfv(target
, pname
, ¶m
);
3317 static void GLAPIENTRY
3318 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3321 p
[0] = (GLfloat
) param
;
3322 p
[1] = p
[2] = p
[3] = 0.0;
3323 save_TexEnvfv(target
, pname
, p
);
3327 static void GLAPIENTRY
3328 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3331 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3332 p
[0] = INT_TO_FLOAT(param
[0]);
3333 p
[1] = INT_TO_FLOAT(param
[1]);
3334 p
[2] = INT_TO_FLOAT(param
[2]);
3335 p
[3] = INT_TO_FLOAT(param
[3]);
3338 p
[0] = (GLfloat
) param
[0];
3339 p
[1] = p
[2] = p
[3] = 0.0F
;
3341 save_TexEnvfv(target
, pname
, p
);
3345 static void GLAPIENTRY
3346 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3348 GET_CURRENT_CONTEXT(ctx
);
3350 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3351 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXGEN
, 6);
3360 if (ctx
->ExecuteFlag
) {
3361 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3366 static void GLAPIENTRY
3367 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3370 p
[0] = (GLfloat
) params
[0];
3371 p
[1] = (GLfloat
) params
[1];
3372 p
[2] = (GLfloat
) params
[2];
3373 p
[3] = (GLfloat
) params
[3];
3374 save_TexGenfv(coord
, pname
, p
);
3378 static void GLAPIENTRY
3379 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3381 GLfloat p
= (GLfloat
) param
;
3382 save_TexGenfv(coord
, pname
, &p
);
3386 static void GLAPIENTRY
3387 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3390 p
[0] = (GLfloat
) params
[0];
3391 p
[1] = (GLfloat
) params
[1];
3392 p
[2] = (GLfloat
) params
[2];
3393 p
[3] = (GLfloat
) params
[3];
3394 save_TexGenfv(coord
, pname
, p
);
3398 static void GLAPIENTRY
3399 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3401 save_TexGenfv(coord
, pname
, ¶m
);
3405 static void GLAPIENTRY
3406 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3408 save_TexGeniv(coord
, pname
, ¶m
);
3412 static void GLAPIENTRY
3413 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3415 GET_CURRENT_CONTEXT(ctx
);
3417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3418 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXPARAMETER
, 6);
3427 if (ctx
->ExecuteFlag
) {
3428 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3433 static void GLAPIENTRY
3434 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3436 save_TexParameterfv(target
, pname
, ¶m
);
3440 static void GLAPIENTRY
3441 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3444 fparam
[0] = (GLfloat
) param
;
3445 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3446 save_TexParameterfv(target
, pname
, fparam
);
3450 static void GLAPIENTRY
3451 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3454 fparam
[0] = (GLfloat
) params
[0];
3455 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3456 save_TexParameterfv(target
, pname
, fparam
);
3460 static void GLAPIENTRY
3461 save_TexImage1D(GLenum target
,
3462 GLint level
, GLint components
,
3463 GLsizei width
, GLint border
,
3464 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3466 GET_CURRENT_CONTEXT(ctx
);
3467 if (target
== GL_PROXY_TEXTURE_1D
) {
3468 /* don't compile, execute immediately */
3469 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3470 border
, format
, type
, pixels
));
3473 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
,
3474 pixels
, &ctx
->Unpack
);
3476 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3477 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE1D
, 8);
3481 n
[3].i
= components
;
3482 n
[4].i
= (GLint
) width
;
3491 if (ctx
->ExecuteFlag
) {
3492 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3493 border
, format
, type
, pixels
));
3499 static void GLAPIENTRY
3500 save_TexImage2D(GLenum target
,
3501 GLint level
, GLint components
,
3502 GLsizei width
, GLsizei height
, GLint border
,
3503 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3505 GET_CURRENT_CONTEXT(ctx
);
3506 if (target
== GL_PROXY_TEXTURE_2D
) {
3507 /* don't compile, execute immediately */
3508 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3509 height
, border
, format
, type
, pixels
));
3512 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
3513 pixels
, &ctx
->Unpack
);
3515 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3516 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE2D
, 9);
3520 n
[3].i
= components
;
3521 n
[4].i
= (GLint
) width
;
3522 n
[5].i
= (GLint
) height
;
3531 if (ctx
->ExecuteFlag
) {
3532 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3533 height
, border
, format
, type
, pixels
));
3539 static void GLAPIENTRY
3540 save_TexImage3D(GLenum target
,
3541 GLint level
, GLint internalFormat
,
3542 GLsizei width
, GLsizei height
, GLsizei depth
,
3544 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3546 GET_CURRENT_CONTEXT(ctx
);
3547 if (target
== GL_PROXY_TEXTURE_3D
) {
3548 /* don't compile, execute immediately */
3549 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3550 height
, depth
, border
, format
, type
,
3555 GLvoid
*image
= unpack_image(3, width
, height
, depth
, format
, type
,
3556 pixels
, &ctx
->Unpack
);
3557 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3558 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE3D
, 10);
3562 n
[3].i
= (GLint
) internalFormat
;
3563 n
[4].i
= (GLint
) width
;
3564 n
[5].i
= (GLint
) height
;
3565 n
[6].i
= (GLint
) depth
;
3574 if (ctx
->ExecuteFlag
) {
3575 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3576 height
, depth
, border
, format
, type
,
3583 static void GLAPIENTRY
3584 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
3585 GLsizei width
, GLenum format
, GLenum type
,
3586 const GLvoid
* pixels
)
3588 GET_CURRENT_CONTEXT(ctx
);
3590 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
,
3591 pixels
, &ctx
->Unpack
);
3592 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3593 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
3598 n
[4].i
= (GLint
) width
;
3606 if (ctx
->ExecuteFlag
) {
3607 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
3608 format
, type
, pixels
));
3613 static void GLAPIENTRY
3614 save_TexSubImage2D(GLenum target
, GLint level
,
3615 GLint xoffset
, GLint yoffset
,
3616 GLsizei width
, GLsizei height
,
3617 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3619 GET_CURRENT_CONTEXT(ctx
);
3621 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
3622 pixels
, &ctx
->Unpack
);
3623 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3624 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
3630 n
[5].i
= (GLint
) width
;
3631 n
[6].i
= (GLint
) height
;
3639 if (ctx
->ExecuteFlag
) {
3640 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
3641 width
, height
, format
, type
, pixels
));
3646 static void GLAPIENTRY
3647 save_TexSubImage3D(GLenum target
, GLint level
,
3648 GLint xoffset
, GLint yoffset
, GLint zoffset
,
3649 GLsizei width
, GLsizei height
, GLsizei depth
,
3650 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3652 GET_CURRENT_CONTEXT(ctx
);
3654 GLvoid
*image
= unpack_image(3, width
, height
, depth
, format
, type
,
3655 pixels
, &ctx
->Unpack
);
3656 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3657 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
3664 n
[6].i
= (GLint
) width
;
3665 n
[7].i
= (GLint
) height
;
3666 n
[8].i
= (GLint
) depth
;
3674 if (ctx
->ExecuteFlag
) {
3675 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
3676 xoffset
, yoffset
, zoffset
,
3677 width
, height
, depth
, format
, type
,
3683 static void GLAPIENTRY
3684 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
3686 GET_CURRENT_CONTEXT(ctx
);
3688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3689 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRANSLATE
, 3);
3695 if (ctx
->ExecuteFlag
) {
3696 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
3701 static void GLAPIENTRY
3702 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
3704 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3709 static void GLAPIENTRY
3710 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3712 GET_CURRENT_CONTEXT(ctx
);
3714 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3715 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_VIEWPORT
, 4);
3719 n
[3].i
= (GLint
) width
;
3720 n
[4].i
= (GLint
) height
;
3722 if (ctx
->ExecuteFlag
) {
3723 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
3728 static void GLAPIENTRY
3729 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3731 GET_CURRENT_CONTEXT(ctx
);
3733 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3734 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_WINDOW_POS
, 4);
3741 if (ctx
->ExecuteFlag
) {
3742 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
3746 static void GLAPIENTRY
3747 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3749 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3752 static void GLAPIENTRY
3753 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3755 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3758 static void GLAPIENTRY
3759 save_WindowPos2iMESA(GLint x
, GLint y
)
3761 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3764 static void GLAPIENTRY
3765 save_WindowPos2sMESA(GLshort x
, GLshort y
)
3767 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3770 static void GLAPIENTRY
3771 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3773 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3776 static void GLAPIENTRY
3777 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3779 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3782 static void GLAPIENTRY
3783 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3785 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3788 static void GLAPIENTRY
3789 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3791 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3794 static void GLAPIENTRY
3795 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3797 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3800 static void GLAPIENTRY
3801 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3803 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3806 static void GLAPIENTRY
3807 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3809 save_WindowPos4fMESA(x
, y
, z
, w
);
3812 static void GLAPIENTRY
3813 save_WindowPos2dvMESA(const GLdouble
* v
)
3815 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3818 static void GLAPIENTRY
3819 save_WindowPos2fvMESA(const GLfloat
* v
)
3821 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3824 static void GLAPIENTRY
3825 save_WindowPos2ivMESA(const GLint
* v
)
3827 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3830 static void GLAPIENTRY
3831 save_WindowPos2svMESA(const GLshort
* v
)
3833 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3836 static void GLAPIENTRY
3837 save_WindowPos3dvMESA(const GLdouble
* v
)
3839 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3842 static void GLAPIENTRY
3843 save_WindowPos3fvMESA(const GLfloat
* v
)
3845 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3848 static void GLAPIENTRY
3849 save_WindowPos3ivMESA(const GLint
* v
)
3851 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3854 static void GLAPIENTRY
3855 save_WindowPos3svMESA(const GLshort
* v
)
3857 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3860 static void GLAPIENTRY
3861 save_WindowPos4dvMESA(const GLdouble
* v
)
3863 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3864 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3867 static void GLAPIENTRY
3868 save_WindowPos4fvMESA(const GLfloat
* v
)
3870 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3873 static void GLAPIENTRY
3874 save_WindowPos4ivMESA(const GLint
* v
)
3876 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3877 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3880 static void GLAPIENTRY
3881 save_WindowPos4svMESA(const GLshort
* v
)
3883 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3888 /* GL_ARB_multitexture */
3889 static void GLAPIENTRY
3890 save_ActiveTextureARB(GLenum target
)
3892 GET_CURRENT_CONTEXT(ctx
);
3894 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3895 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
3899 if (ctx
->ExecuteFlag
) {
3900 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
3905 /* GL_ARB_transpose_matrix */
3907 static void GLAPIENTRY
3908 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
3911 _math_transposefd(tm
, m
);
3912 save_LoadMatrixf(tm
);
3916 static void GLAPIENTRY
3917 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
3920 _math_transposef(tm
, m
);
3921 save_LoadMatrixf(tm
);
3925 static void GLAPIENTRY
3926 save_MultTransposeMatrixdARB(const GLdouble m
[16])
3929 _math_transposefd(tm
, m
);
3930 save_MultMatrixf(tm
);
3934 static void GLAPIENTRY
3935 save_MultTransposeMatrixfARB(const GLfloat m
[16])
3938 _math_transposef(tm
, m
);
3939 save_MultMatrixf(tm
);
3943 /* GL_ARB_texture_compression */
3944 static void GLAPIENTRY
3945 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3946 GLenum internalFormat
, GLsizei width
,
3947 GLint border
, GLsizei imageSize
,
3948 const GLvoid
* data
)
3950 GET_CURRENT_CONTEXT(ctx
);
3951 if (target
== GL_PROXY_TEXTURE_1D
) {
3952 /* don't compile, execute immediately */
3953 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
3954 width
, border
, imageSize
,
3960 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3961 /* make copy of image */
3962 image
= _mesa_malloc(imageSize
);
3964 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
3967 MEMCPY(image
, data
, imageSize
);
3968 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
3972 n
[3].e
= internalFormat
;
3973 n
[4].i
= (GLint
) width
;
3981 if (ctx
->ExecuteFlag
) {
3982 CALL_CompressedTexImage1DARB(ctx
->Exec
,
3983 (target
, level
, internalFormat
, width
,
3984 border
, imageSize
, data
));
3990 static void GLAPIENTRY
3991 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
3992 GLenum internalFormat
, GLsizei width
,
3993 GLsizei height
, GLint border
, GLsizei imageSize
,
3994 const GLvoid
* data
)
3996 GET_CURRENT_CONTEXT(ctx
);
3997 if (target
== GL_PROXY_TEXTURE_2D
) {
3998 /* don't compile, execute immediately */
3999 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4000 width
, height
, border
,
4006 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4007 /* make copy of image */
4008 image
= _mesa_malloc(imageSize
);
4010 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4013 MEMCPY(image
, data
, imageSize
);
4014 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4018 n
[3].e
= internalFormat
;
4019 n
[4].i
= (GLint
) width
;
4020 n
[5].i
= (GLint
) height
;
4028 if (ctx
->ExecuteFlag
) {
4029 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4030 (target
, level
, internalFormat
, width
,
4031 height
, border
, imageSize
, data
));
4037 static void GLAPIENTRY
4038 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4039 GLenum internalFormat
, GLsizei width
,
4040 GLsizei height
, GLsizei depth
, GLint border
,
4041 GLsizei imageSize
, const GLvoid
* data
)
4043 GET_CURRENT_CONTEXT(ctx
);
4044 if (target
== GL_PROXY_TEXTURE_3D
) {
4045 /* don't compile, execute immediately */
4046 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4047 width
, height
, depth
, border
,
4053 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4054 /* make copy of image */
4055 image
= _mesa_malloc(imageSize
);
4057 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4060 MEMCPY(image
, data
, imageSize
);
4061 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4065 n
[3].e
= internalFormat
;
4066 n
[4].i
= (GLint
) width
;
4067 n
[5].i
= (GLint
) height
;
4068 n
[6].i
= (GLint
) depth
;
4076 if (ctx
->ExecuteFlag
) {
4077 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4078 (target
, level
, internalFormat
, width
,
4079 height
, depth
, border
, imageSize
,
4086 static void GLAPIENTRY
4087 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4088 GLsizei width
, GLenum format
,
4089 GLsizei imageSize
, const GLvoid
* data
)
4094 GET_CURRENT_CONTEXT(ctx
);
4095 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4097 /* make copy of image */
4098 image
= _mesa_malloc(imageSize
);
4100 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4103 MEMCPY(image
, data
, imageSize
);
4104 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4109 n
[4].i
= (GLint
) width
;
4117 if (ctx
->ExecuteFlag
) {
4118 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4119 width
, format
, imageSize
,
4125 static void GLAPIENTRY
4126 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4127 GLint yoffset
, GLsizei width
, GLsizei height
,
4128 GLenum format
, GLsizei imageSize
,
4129 const GLvoid
* data
)
4134 GET_CURRENT_CONTEXT(ctx
);
4135 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4137 /* make copy of image */
4138 image
= _mesa_malloc(imageSize
);
4140 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4143 MEMCPY(image
, data
, imageSize
);
4144 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4150 n
[5].i
= (GLint
) width
;
4151 n
[6].i
= (GLint
) height
;
4159 if (ctx
->ExecuteFlag
) {
4160 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4161 (target
, level
, xoffset
, yoffset
, width
,
4162 height
, format
, imageSize
, data
));
4167 static void GLAPIENTRY
4168 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4169 GLint yoffset
, GLint zoffset
, GLsizei width
,
4170 GLsizei height
, GLsizei depth
, GLenum format
,
4171 GLsizei imageSize
, const GLvoid
* data
)
4176 GET_CURRENT_CONTEXT(ctx
);
4177 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4179 /* make copy of image */
4180 image
= _mesa_malloc(imageSize
);
4182 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4185 MEMCPY(image
, data
, imageSize
);
4186 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4193 n
[6].i
= (GLint
) width
;
4194 n
[7].i
= (GLint
) height
;
4195 n
[8].i
= (GLint
) depth
;
4197 n
[10].i
= imageSize
;
4203 if (ctx
->ExecuteFlag
) {
4204 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4205 (target
, level
, xoffset
, yoffset
,
4206 zoffset
, width
, height
, depth
, format
,
4212 /* GL_ARB_multisample */
4213 static void GLAPIENTRY
4214 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4216 GET_CURRENT_CONTEXT(ctx
);
4218 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4219 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4224 if (ctx
->ExecuteFlag
) {
4225 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4231 * GL_NV_vertex_program
4233 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4234 static void GLAPIENTRY
4235 save_BindProgramNV(GLenum target
, GLuint id
)
4237 GET_CURRENT_CONTEXT(ctx
);
4239 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4240 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4245 if (ctx
->ExecuteFlag
) {
4246 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4250 static void GLAPIENTRY
4251 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4252 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4254 GET_CURRENT_CONTEXT(ctx
);
4256 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4257 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4266 if (ctx
->ExecuteFlag
) {
4267 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4272 static void GLAPIENTRY
4273 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4274 const GLfloat
*params
)
4276 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4277 params
[2], params
[3]);
4281 static void GLAPIENTRY
4282 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4283 const GLfloat
* params
)
4285 GET_CURRENT_CONTEXT(ctx
);
4287 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4291 const GLfloat
* p
= params
;
4293 for (i
= 0 ; i
< count
; i
++) {
4294 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4307 if (ctx
->ExecuteFlag
) {
4308 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4313 static void GLAPIENTRY
4314 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4315 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4317 save_ProgramEnvParameter4fARB(target
, index
,
4319 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4323 static void GLAPIENTRY
4324 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4325 const GLdouble
*params
)
4327 save_ProgramEnvParameter4fARB(target
, index
,
4328 (GLfloat
) params
[0],
4329 (GLfloat
) params
[1],
4330 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4333 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
4335 #if FEATURE_NV_vertex_program
4336 static void GLAPIENTRY
4337 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4339 GET_CURRENT_CONTEXT(ctx
);
4341 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4342 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4351 if (ctx
->ExecuteFlag
) {
4352 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4357 static void GLAPIENTRY
4358 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4359 GLuint num
, const GLdouble
*params
)
4362 for (i
= 0; i
< num
; i
++) {
4363 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4368 static void GLAPIENTRY
4369 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4370 GLuint num
, const GLfloat
*params
)
4373 for (i
= 0; i
< num
; i
++) {
4374 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4379 static void GLAPIENTRY
4380 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4381 const GLubyte
* program
)
4383 GET_CURRENT_CONTEXT(ctx
);
4385 GLubyte
*programCopy
;
4387 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4389 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4392 _mesa_memcpy(programCopy
, program
, len
);
4394 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4395 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4400 n
[4].data
= programCopy
;
4402 if (ctx
->ExecuteFlag
) {
4403 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4408 static void GLAPIENTRY
4409 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4411 GET_CURRENT_CONTEXT(ctx
);
4413 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4415 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4418 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4419 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4420 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4425 if (ctx
->ExecuteFlag
) {
4426 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4431 static void GLAPIENTRY
4432 save_TrackMatrixNV(GLenum target
, GLuint address
,
4433 GLenum matrix
, GLenum transform
)
4435 GET_CURRENT_CONTEXT(ctx
);
4437 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4438 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4445 if (ctx
->ExecuteFlag
) {
4446 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4449 #endif /* FEATURE_NV_vertex_program */
4453 * GL_NV_fragment_program
4455 #if FEATURE_NV_fragment_program
4456 static void GLAPIENTRY
4457 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4458 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4460 GET_CURRENT_CONTEXT(ctx
);
4462 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4463 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4472 if (ctx
->ExecuteFlag
) {
4473 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4478 static void GLAPIENTRY
4479 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4480 const GLfloat
*params
)
4482 GET_CURRENT_CONTEXT(ctx
);
4484 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4485 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4494 if (ctx
->ExecuteFlag
) {
4495 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4500 static void GLAPIENTRY
4501 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4502 const GLfloat
*params
)
4504 GET_CURRENT_CONTEXT(ctx
);
4506 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4510 const GLfloat
* p
= params
;
4512 for (i
= 0 ; i
< count
; i
++) {
4513 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4526 if (ctx
->ExecuteFlag
) {
4527 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4532 static void GLAPIENTRY
4533 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4534 GLdouble x
, GLdouble y
,
4535 GLdouble z
, GLdouble w
)
4537 GET_CURRENT_CONTEXT(ctx
);
4539 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4540 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4544 n
[3].f
= (GLfloat
) x
;
4545 n
[4].f
= (GLfloat
) y
;
4546 n
[5].f
= (GLfloat
) z
;
4547 n
[6].f
= (GLfloat
) w
;
4549 if (ctx
->ExecuteFlag
) {
4550 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4555 static void GLAPIENTRY
4556 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4557 const GLdouble
*params
)
4559 GET_CURRENT_CONTEXT(ctx
);
4561 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4562 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4566 n
[3].f
= (GLfloat
) params
[0];
4567 n
[4].f
= (GLfloat
) params
[1];
4568 n
[5].f
= (GLfloat
) params
[2];
4569 n
[6].f
= (GLfloat
) params
[3];
4571 if (ctx
->ExecuteFlag
) {
4572 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4576 static void GLAPIENTRY
4577 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4578 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4580 GET_CURRENT_CONTEXT(ctx
);
4582 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4584 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4587 _mesa_memcpy(nameCopy
, name
, len
);
4589 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4590 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
4594 n
[3].data
= nameCopy
;
4600 if (ctx
->ExecuteFlag
) {
4601 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
4606 static void GLAPIENTRY
4607 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4610 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4614 static void GLAPIENTRY
4615 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4616 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4618 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4619 (GLfloat
) z
, (GLfloat
) w
);
4623 static void GLAPIENTRY
4624 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4627 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4628 (GLfloat
) v
[1], (GLfloat
) v
[2],
4632 #endif /* FEATURE_NV_fragment_program */
4636 /* GL_EXT_stencil_two_side */
4637 static void GLAPIENTRY
4638 save_ActiveStencilFaceEXT(GLenum face
)
4640 GET_CURRENT_CONTEXT(ctx
);
4642 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4643 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
4647 if (ctx
->ExecuteFlag
) {
4648 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
4653 /* GL_EXT_depth_bounds_test */
4654 static void GLAPIENTRY
4655 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
4657 GET_CURRENT_CONTEXT(ctx
);
4659 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4660 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
4662 n
[1].f
= (GLfloat
) zmin
;
4663 n
[2].f
= (GLfloat
) zmax
;
4665 if (ctx
->ExecuteFlag
) {
4666 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
4672 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4674 static void GLAPIENTRY
4675 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4676 const GLvoid
* string
)
4678 GET_CURRENT_CONTEXT(ctx
);
4680 GLubyte
*programCopy
;
4682 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4684 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4687 _mesa_memcpy(programCopy
, string
, len
);
4689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4690 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
4695 n
[4].data
= programCopy
;
4697 if (ctx
->ExecuteFlag
) {
4698 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
4702 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4705 #if FEATURE_ARB_occlusion_query
4707 static void GLAPIENTRY
4708 save_BeginQueryARB(GLenum target
, GLuint id
)
4710 GET_CURRENT_CONTEXT(ctx
);
4712 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4713 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
4718 if (ctx
->ExecuteFlag
) {
4719 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
4724 static void GLAPIENTRY
4725 save_EndQueryARB(GLenum target
)
4727 GET_CURRENT_CONTEXT(ctx
);
4729 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4730 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_END_QUERY_ARB
, 1);
4734 if (ctx
->ExecuteFlag
) {
4735 CALL_EndQueryARB(ctx
->Exec
, (target
));
4739 #endif /* FEATURE_ARB_occlusion_query */
4742 static void GLAPIENTRY
4743 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
4745 GET_CURRENT_CONTEXT(ctx
);
4747 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4748 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
4752 if (count
> MAX_DRAW_BUFFERS
)
4753 count
= MAX_DRAW_BUFFERS
;
4754 for (i
= 0; i
< count
; i
++) {
4755 n
[2 + i
].e
= buffers
[i
];
4758 if (ctx
->ExecuteFlag
) {
4759 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
4763 #if FEATURE_ATI_fragment_shader
4764 static void GLAPIENTRY
4765 save_BindFragmentShaderATI(GLuint id
)
4767 GET_CURRENT_CONTEXT(ctx
);
4770 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
4774 if (ctx
->ExecuteFlag
) {
4775 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
4779 static void GLAPIENTRY
4780 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
4782 GET_CURRENT_CONTEXT(ctx
);
4785 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
4793 if (ctx
->ExecuteFlag
) {
4794 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
4800 save_Attr1fNV(GLenum attr
, GLfloat x
)
4802 GET_CURRENT_CONTEXT(ctx
);
4804 SAVE_FLUSH_VERTICES(ctx
);
4805 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_NV
, 2);
4811 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4812 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4813 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4815 if (ctx
->ExecuteFlag
) {
4816 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
4821 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
4823 GET_CURRENT_CONTEXT(ctx
);
4825 SAVE_FLUSH_VERTICES(ctx
);
4826 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_NV
, 3);
4833 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4834 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4835 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4837 if (ctx
->ExecuteFlag
) {
4838 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
4843 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4845 GET_CURRENT_CONTEXT(ctx
);
4847 SAVE_FLUSH_VERTICES(ctx
);
4848 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_NV
, 4);
4856 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4857 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4858 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4860 if (ctx
->ExecuteFlag
) {
4861 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
4866 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4868 GET_CURRENT_CONTEXT(ctx
);
4870 SAVE_FLUSH_VERTICES(ctx
);
4871 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_NV
, 5);
4880 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4881 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4882 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4884 if (ctx
->ExecuteFlag
) {
4885 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
4891 save_Attr1fARB(GLenum attr
, GLfloat x
)
4893 GET_CURRENT_CONTEXT(ctx
);
4895 SAVE_FLUSH_VERTICES(ctx
);
4896 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_ARB
, 2);
4902 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
4903 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4904 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4906 if (ctx
->ExecuteFlag
) {
4907 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
4912 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
4914 GET_CURRENT_CONTEXT(ctx
);
4916 SAVE_FLUSH_VERTICES(ctx
);
4917 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_ARB
, 3);
4924 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
4925 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4926 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4928 if (ctx
->ExecuteFlag
) {
4929 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
4934 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4936 GET_CURRENT_CONTEXT(ctx
);
4938 SAVE_FLUSH_VERTICES(ctx
);
4939 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_ARB
, 4);
4947 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
4948 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4949 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4951 if (ctx
->ExecuteFlag
) {
4952 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
4957 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4959 GET_CURRENT_CONTEXT(ctx
);
4961 SAVE_FLUSH_VERTICES(ctx
);
4962 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_ARB
, 5);
4971 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
4972 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4973 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4975 if (ctx
->ExecuteFlag
) {
4976 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
4981 static void GLAPIENTRY
4982 save_EvalCoord1f(GLfloat x
)
4984 GET_CURRENT_CONTEXT(ctx
);
4986 SAVE_FLUSH_VERTICES(ctx
);
4987 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C1
, 1);
4991 if (ctx
->ExecuteFlag
) {
4992 CALL_EvalCoord1f(ctx
->Exec
, (x
));
4996 static void GLAPIENTRY
4997 save_EvalCoord1fv(const GLfloat
* v
)
4999 save_EvalCoord1f(v
[0]);
5002 static void GLAPIENTRY
5003 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5005 GET_CURRENT_CONTEXT(ctx
);
5007 SAVE_FLUSH_VERTICES(ctx
);
5008 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C2
, 2);
5013 if (ctx
->ExecuteFlag
) {
5014 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5018 static void GLAPIENTRY
5019 save_EvalCoord2fv(const GLfloat
* v
)
5021 save_EvalCoord2f(v
[0], v
[1]);
5025 static void GLAPIENTRY
5026 save_EvalPoint1(GLint x
)
5028 GET_CURRENT_CONTEXT(ctx
);
5030 SAVE_FLUSH_VERTICES(ctx
);
5031 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P1
, 1);
5035 if (ctx
->ExecuteFlag
) {
5036 CALL_EvalPoint1(ctx
->Exec
, (x
));
5040 static void GLAPIENTRY
5041 save_EvalPoint2(GLint x
, GLint y
)
5043 GET_CURRENT_CONTEXT(ctx
);
5045 SAVE_FLUSH_VERTICES(ctx
);
5046 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P2
, 2);
5051 if (ctx
->ExecuteFlag
) {
5052 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5056 static void GLAPIENTRY
5057 save_Indexf(GLfloat x
)
5059 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5062 static void GLAPIENTRY
5063 save_Indexfv(const GLfloat
* v
)
5065 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5068 static void GLAPIENTRY
5069 save_EdgeFlag(GLboolean x
)
5071 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0 : 0.0);
5074 static void GLAPIENTRY
5075 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5077 GET_CURRENT_CONTEXT(ctx
);
5081 SAVE_FLUSH_VERTICES(ctx
);
5086 case GL_FRONT_AND_BACK
:
5089 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5098 case GL_AMBIENT_AND_DIFFUSE
:
5104 case GL_COLOR_INDEXES
:
5108 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5112 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATERIAL
, 6);
5116 for (i
= 0; i
< args
; i
++)
5117 n
[3 + i
].f
= param
[i
];
5121 GLuint bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5122 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
5123 if (bitmask
& (1 << i
)) {
5124 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5125 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5129 if (ctx
->ExecuteFlag
) {
5130 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5134 static void GLAPIENTRY
5135 save_Begin(GLenum mode
)
5137 GET_CURRENT_CONTEXT(ctx
);
5139 GLboolean error
= GL_FALSE
;
5141 if ( /*mode < GL_POINTS || */ mode
> GL_POLYGON
) {
5142 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5145 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5146 /* Typically the first begin. This may raise an error on
5147 * playback, depending on whether CallList is issued from inside
5148 * a begin/end or not.
5150 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5152 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5153 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5156 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5161 /* Give the driver an opportunity to hook in an optimized
5162 * display list compiler.
5164 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5167 SAVE_FLUSH_VERTICES(ctx
);
5168 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN
, 1);
5174 if (ctx
->ExecuteFlag
) {
5175 CALL_Begin(ctx
->Exec
, (mode
));
5179 static void GLAPIENTRY
5182 GET_CURRENT_CONTEXT(ctx
);
5183 SAVE_FLUSH_VERTICES(ctx
);
5184 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END
, 0);
5185 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5186 if (ctx
->ExecuteFlag
) {
5187 CALL_End(ctx
->Exec
, ());
5191 static void GLAPIENTRY
5192 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5194 GET_CURRENT_CONTEXT(ctx
);
5196 SAVE_FLUSH_VERTICES(ctx
);
5197 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RECTF
, 4);
5204 if (ctx
->ExecuteFlag
) {
5205 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5210 static void GLAPIENTRY
5211 save_Vertex2f(GLfloat x
, GLfloat y
)
5213 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5216 static void GLAPIENTRY
5217 save_Vertex2fv(const GLfloat
* v
)
5219 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5222 static void GLAPIENTRY
5223 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5225 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5228 static void GLAPIENTRY
5229 save_Vertex3fv(const GLfloat
* v
)
5231 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5234 static void GLAPIENTRY
5235 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5237 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5240 static void GLAPIENTRY
5241 save_Vertex4fv(const GLfloat
* v
)
5243 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5246 static void GLAPIENTRY
5247 save_TexCoord1f(GLfloat x
)
5249 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5252 static void GLAPIENTRY
5253 save_TexCoord1fv(const GLfloat
* v
)
5255 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5258 static void GLAPIENTRY
5259 save_TexCoord2f(GLfloat x
, GLfloat y
)
5261 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5264 static void GLAPIENTRY
5265 save_TexCoord2fv(const GLfloat
* v
)
5267 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5270 static void GLAPIENTRY
5271 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5273 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5276 static void GLAPIENTRY
5277 save_TexCoord3fv(const GLfloat
* v
)
5279 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5282 static void GLAPIENTRY
5283 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5285 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5288 static void GLAPIENTRY
5289 save_TexCoord4fv(const GLfloat
* v
)
5291 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5294 static void GLAPIENTRY
5295 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5297 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5300 static void GLAPIENTRY
5301 save_Normal3fv(const GLfloat
* v
)
5303 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5306 static void GLAPIENTRY
5307 save_FogCoordfEXT(GLfloat x
)
5309 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5312 static void GLAPIENTRY
5313 save_FogCoordfvEXT(const GLfloat
* v
)
5315 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5318 static void GLAPIENTRY
5319 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5321 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5324 static void GLAPIENTRY
5325 save_Color3fv(const GLfloat
* v
)
5327 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5330 static void GLAPIENTRY
5331 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5333 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5336 static void GLAPIENTRY
5337 save_Color4fv(const GLfloat
* v
)
5339 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5342 static void GLAPIENTRY
5343 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5345 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5348 static void GLAPIENTRY
5349 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5351 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5355 /* Just call the respective ATTR for texcoord
5357 static void GLAPIENTRY
5358 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5360 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5361 save_Attr1fNV(attr
, x
);
5364 static void GLAPIENTRY
5365 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5367 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5368 save_Attr1fNV(attr
, v
[0]);
5371 static void GLAPIENTRY
5372 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5374 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5375 save_Attr2fNV(attr
, x
, y
);
5378 static void GLAPIENTRY
5379 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5381 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5382 save_Attr2fNV(attr
, v
[0], v
[1]);
5385 static void GLAPIENTRY
5386 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5388 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5389 save_Attr3fNV(attr
, x
, y
, z
);
5392 static void GLAPIENTRY
5393 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5395 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5396 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5399 static void GLAPIENTRY
5400 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5401 GLfloat z
, GLfloat w
)
5403 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5404 save_Attr4fNV(attr
, x
, y
, z
, w
);
5407 static void GLAPIENTRY
5408 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5410 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5411 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5416 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5422 GET_CURRENT_CONTEXT(ctx
);
5423 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5427 /* First level for NV_vertex_program:
5429 * Check for errors at compile time?.
5431 static void GLAPIENTRY
5432 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
5434 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5435 save_Attr1fNV(index
, x
);
5440 static void GLAPIENTRY
5441 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
5443 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5444 save_Attr1fNV(index
, v
[0]);
5449 static void GLAPIENTRY
5450 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
5452 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5453 save_Attr2fNV(index
, x
, y
);
5458 static void GLAPIENTRY
5459 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
5461 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5462 save_Attr2fNV(index
, v
[0], v
[1]);
5467 static void GLAPIENTRY
5468 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5470 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5471 save_Attr3fNV(index
, x
, y
, z
);
5476 static void GLAPIENTRY
5477 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
5479 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5480 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
5485 static void GLAPIENTRY
5486 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
5487 GLfloat z
, GLfloat w
)
5489 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5490 save_Attr4fNV(index
, x
, y
, z
, w
);
5495 static void GLAPIENTRY
5496 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
5498 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5499 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
5507 static void GLAPIENTRY
5508 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5510 if (index
< MAX_VERTEX_ATTRIBS
)
5511 save_Attr1fARB(index
, x
);
5516 static void GLAPIENTRY
5517 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5519 if (index
< MAX_VERTEX_ATTRIBS
)
5520 save_Attr1fARB(index
, v
[0]);
5525 static void GLAPIENTRY
5526 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5528 if (index
< MAX_VERTEX_ATTRIBS
)
5529 save_Attr2fARB(index
, x
, y
);
5534 static void GLAPIENTRY
5535 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5537 if (index
< MAX_VERTEX_ATTRIBS
)
5538 save_Attr2fARB(index
, v
[0], v
[1]);
5543 static void GLAPIENTRY
5544 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5546 if (index
< MAX_VERTEX_ATTRIBS
)
5547 save_Attr3fARB(index
, x
, y
, z
);
5552 static void GLAPIENTRY
5553 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
5555 if (index
< MAX_VERTEX_ATTRIBS
)
5556 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
5561 static void GLAPIENTRY
5562 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
5565 if (index
< MAX_VERTEX_ATTRIBS
)
5566 save_Attr4fARB(index
, x
, y
, z
, w
);
5571 static void GLAPIENTRY
5572 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
5574 if (index
< MAX_VERTEX_ATTRIBS
)
5575 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
5581 #if FEATURE_EXT_framebuffer_blit
5582 static void GLAPIENTRY
5583 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
5584 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
5585 GLbitfield mask
, GLenum filter
)
5587 GET_CURRENT_CONTEXT(ctx
);
5589 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5590 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
5603 if (ctx
->ExecuteFlag
) {
5604 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
5605 dstX0
, dstY0
, dstX1
, dstY1
,
5613 * Save an error-generating command into display list.
5615 * KW: Will appear in the list before the vertex buffer containing the
5616 * command that provoked the error. I don't see this as a problem.
5619 save_error(GLcontext
*ctx
, GLenum error
, const char *s
)
5622 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ERROR
, 2);
5625 n
[2].data
= (void *) s
;
5631 * Compile an error into current display list.
5634 _mesa_compile_error(GLcontext
*ctx
, GLenum error
, const char *s
)
5636 if (ctx
->CompileFlag
)
5637 save_error(ctx
, error
, s
);
5638 if (ctx
->ExecuteFlag
)
5639 _mesa_error(ctx
, error
, s
);
5644 * Test if ID names a display list.
5647 islist(GLcontext
*ctx
, GLuint list
)
5649 if (list
> 0 && lookup_list(ctx
, list
)) {
5659 /**********************************************************************/
5660 /* Display list execution */
5661 /**********************************************************************/
5665 * Execute a display list. Note that the ListBase offset must have already
5666 * been added before calling this function. I.e. the list argument is
5667 * the absolute list number, not relative to ListBase.
5668 * \param list - display list number
5671 execute_list(GLcontext
*ctx
, GLuint list
)
5673 struct mesa_display_list
*dlist
;
5677 if (list
== 0 || !islist(ctx
, list
))
5680 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
5681 /* raise an error? */
5685 dlist
= lookup_list(ctx
, list
);
5689 ctx
->ListState
.CallDepth
++;
5691 if (ctx
->Driver
.BeginCallList
)
5692 ctx
->Driver
.BeginCallList(ctx
, dlist
);
5698 OpCode opcode
= n
[0].opcode
;
5699 int i
= (int) n
[0].opcode
- (int) OPCODE_EXT_0
;
5701 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
5702 /* this is a driver-extended opcode */
5703 ctx
->ListExt
.Opcode
[i
].Execute(ctx
, &n
[1]);
5704 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
5709 _mesa_error(ctx
, n
[1].e
, (const char *) n
[2].data
);
5712 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
5714 case OPCODE_ALPHA_FUNC
:
5715 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
5717 case OPCODE_BIND_TEXTURE
:
5718 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
5722 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5723 ctx
->Unpack
= ctx
->DefaultPacking
;
5724 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5725 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
5726 (const GLubyte
*) n
[7].data
));
5727 ctx
->Unpack
= save
; /* restore */
5730 case OPCODE_BLEND_COLOR
:
5731 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5733 case OPCODE_BLEND_EQUATION
:
5734 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
5736 case OPCODE_BLEND_EQUATION_SEPARATE
:
5737 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5739 case OPCODE_BLEND_FUNC_SEPARATE
:
5740 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
5741 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
5743 case OPCODE_CALL_LIST
:
5744 /* Generated by glCallList(), don't add ListBase */
5745 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5746 execute_list(ctx
, n
[1].ui
);
5749 case OPCODE_CALL_LIST_OFFSET
:
5750 /* Generated by glCallLists() so we must add ListBase */
5752 /* user specified a bad data type at compile time */
5753 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5755 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5756 execute_list(ctx
, ctx
->List
.ListBase
+ n
[1].ui
);
5760 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
5762 case OPCODE_CLEAR_COLOR
:
5763 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5765 case OPCODE_CLEAR_ACCUM
:
5766 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5768 case OPCODE_CLEAR_DEPTH
:
5769 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
5771 case OPCODE_CLEAR_INDEX
:
5772 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
5774 case OPCODE_CLEAR_STENCIL
:
5775 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
5777 case OPCODE_CLIP_PLANE
:
5784 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
5787 case OPCODE_COLOR_MASK
:
5788 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
5790 case OPCODE_COLOR_MATERIAL
:
5791 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5793 case OPCODE_COLOR_TABLE
:
5795 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5796 ctx
->Unpack
= ctx
->DefaultPacking
;
5797 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5798 n
[5].e
, n
[6].data
));
5799 ctx
->Unpack
= save
; /* restore */
5802 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
5809 CALL_ColorTableParameterfv(ctx
->Exec
,
5810 (n
[1].e
, n
[2].e
, params
));
5813 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
5820 CALL_ColorTableParameteriv(ctx
->Exec
,
5821 (n
[1].e
, n
[2].e
, params
));
5824 case OPCODE_COLOR_SUB_TABLE
:
5826 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5827 ctx
->Unpack
= ctx
->DefaultPacking
;
5828 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5829 n
[4].e
, n
[5].e
, n
[6].data
));
5830 ctx
->Unpack
= save
; /* restore */
5833 case OPCODE_CONVOLUTION_FILTER_1D
:
5835 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5836 ctx
->Unpack
= ctx
->DefaultPacking
;
5837 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5840 ctx
->Unpack
= save
; /* restore */
5843 case OPCODE_CONVOLUTION_FILTER_2D
:
5845 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5846 ctx
->Unpack
= ctx
->DefaultPacking
;
5847 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5848 n
[4].i
, n
[5].e
, n
[6].e
,
5850 ctx
->Unpack
= save
; /* restore */
5853 case OPCODE_CONVOLUTION_PARAMETER_I
:
5854 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
5856 case OPCODE_CONVOLUTION_PARAMETER_IV
:
5863 CALL_ConvolutionParameteriv(ctx
->Exec
,
5864 (n
[1].e
, n
[2].e
, params
));
5867 case OPCODE_CONVOLUTION_PARAMETER_F
:
5868 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
5870 case OPCODE_CONVOLUTION_PARAMETER_FV
:
5877 CALL_ConvolutionParameterfv(ctx
->Exec
,
5878 (n
[1].e
, n
[2].e
, params
));
5881 case OPCODE_COPY_COLOR_SUB_TABLE
:
5882 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
5883 n
[3].i
, n
[4].i
, n
[5].i
));
5885 case OPCODE_COPY_COLOR_TABLE
:
5886 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
5887 n
[3].i
, n
[4].i
, n
[5].i
));
5889 case OPCODE_COPY_PIXELS
:
5890 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
5891 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
5894 case OPCODE_COPY_TEX_IMAGE1D
:
5895 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5896 n
[5].i
, n
[6].i
, n
[7].i
));
5898 case OPCODE_COPY_TEX_IMAGE2D
:
5899 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5900 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
5902 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
5903 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5904 n
[4].i
, n
[5].i
, n
[6].i
));
5906 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
5907 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5908 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5911 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
5912 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5913 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5916 case OPCODE_CULL_FACE
:
5917 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
5919 case OPCODE_DEPTH_FUNC
:
5920 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
5922 case OPCODE_DEPTH_MASK
:
5923 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
5925 case OPCODE_DEPTH_RANGE
:
5926 CALL_DepthRange(ctx
->Exec
,
5927 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
5929 case OPCODE_DISABLE
:
5930 CALL_Disable(ctx
->Exec
, (n
[1].e
));
5932 case OPCODE_DRAW_BUFFER
:
5933 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
5935 case OPCODE_DRAW_PIXELS
:
5937 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5938 ctx
->Unpack
= ctx
->DefaultPacking
;
5939 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
5941 ctx
->Unpack
= save
; /* restore */
5945 CALL_Enable(ctx
->Exec
, (n
[1].e
));
5947 case OPCODE_EVALMESH1
:
5948 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
5950 case OPCODE_EVALMESH2
:
5951 CALL_EvalMesh2(ctx
->Exec
,
5952 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
5961 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
5964 case OPCODE_FRONT_FACE
:
5965 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
5967 case OPCODE_FRUSTUM
:
5968 CALL_Frustum(ctx
->Exec
,
5969 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
5972 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5974 case OPCODE_HISTOGRAM
:
5975 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
5977 case OPCODE_INDEX_MASK
:
5978 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
5980 case OPCODE_INIT_NAMES
:
5981 CALL_InitNames(ctx
->Exec
, ());
5990 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
5993 case OPCODE_LIGHT_MODEL
:
6000 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
6003 case OPCODE_LINE_STIPPLE
:
6004 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
6006 case OPCODE_LINE_WIDTH
:
6007 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
6009 case OPCODE_LIST_BASE
:
6010 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
6012 case OPCODE_LOAD_IDENTITY
:
6013 CALL_LoadIdentity(ctx
->Exec
, ());
6015 case OPCODE_LOAD_MATRIX
:
6016 if (sizeof(Node
) == sizeof(GLfloat
)) {
6017 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
6022 for (i
= 0; i
< 16; i
++) {
6025 CALL_LoadMatrixf(ctx
->Exec
, (m
));
6028 case OPCODE_LOAD_NAME
:
6029 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
6031 case OPCODE_LOGIC_OP
:
6032 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
6036 GLenum target
= n
[1].e
;
6037 GLint ustride
= _mesa_evaluator_components(target
);
6038 GLint uorder
= n
[5].i
;
6039 GLfloat u1
= n
[2].f
;
6040 GLfloat u2
= n
[3].f
;
6041 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6042 (GLfloat
*) n
[6].data
));
6047 GLenum target
= n
[1].e
;
6048 GLfloat u1
= n
[2].f
;
6049 GLfloat u2
= n
[3].f
;
6050 GLfloat v1
= n
[4].f
;
6051 GLfloat v2
= n
[5].f
;
6052 GLint ustride
= n
[6].i
;
6053 GLint vstride
= n
[7].i
;
6054 GLint uorder
= n
[8].i
;
6055 GLint vorder
= n
[9].i
;
6056 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6057 v1
, v2
, vstride
, vorder
,
6058 (GLfloat
*) n
[10].data
));
6061 case OPCODE_MAPGRID1
:
6062 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
6064 case OPCODE_MAPGRID2
:
6065 CALL_MapGrid2f(ctx
->Exec
,
6066 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
6068 case OPCODE_MATRIX_MODE
:
6069 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
6071 case OPCODE_MIN_MAX
:
6072 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
6074 case OPCODE_MULT_MATRIX
:
6075 if (sizeof(Node
) == sizeof(GLfloat
)) {
6076 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
6081 for (i
= 0; i
< 16; i
++) {
6084 CALL_MultMatrixf(ctx
->Exec
, (m
));
6088 CALL_Ortho(ctx
->Exec
,
6089 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6091 case OPCODE_PASSTHROUGH
:
6092 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
6094 case OPCODE_PIXEL_MAP
:
6095 CALL_PixelMapfv(ctx
->Exec
,
6096 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
6098 case OPCODE_PIXEL_TRANSFER
:
6099 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6101 case OPCODE_PIXEL_ZOOM
:
6102 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6104 case OPCODE_POINT_SIZE
:
6105 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
6107 case OPCODE_POINT_PARAMETERS
:
6113 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
6116 case OPCODE_POLYGON_MODE
:
6117 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6119 case OPCODE_POLYGON_STIPPLE
:
6121 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6122 ctx
->Unpack
= ctx
->DefaultPacking
;
6123 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
6124 ctx
->Unpack
= save
; /* restore */
6127 case OPCODE_POLYGON_OFFSET
:
6128 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6130 case OPCODE_POP_ATTRIB
:
6131 CALL_PopAttrib(ctx
->Exec
, ());
6133 case OPCODE_POP_MATRIX
:
6134 CALL_PopMatrix(ctx
->Exec
, ());
6136 case OPCODE_POP_NAME
:
6137 CALL_PopName(ctx
->Exec
, ());
6139 case OPCODE_PRIORITIZE_TEXTURE
:
6140 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
6142 case OPCODE_PUSH_ATTRIB
:
6143 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
6145 case OPCODE_PUSH_MATRIX
:
6146 CALL_PushMatrix(ctx
->Exec
, ());
6148 case OPCODE_PUSH_NAME
:
6149 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
6151 case OPCODE_RASTER_POS
:
6152 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6154 case OPCODE_READ_BUFFER
:
6155 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
6157 case OPCODE_RESET_HISTOGRAM
:
6158 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
6160 case OPCODE_RESET_MIN_MAX
:
6161 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
6164 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6167 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6169 case OPCODE_SCISSOR
:
6170 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
6172 case OPCODE_SHADE_MODEL
:
6173 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
6175 case OPCODE_STENCIL_FUNC
:
6176 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
6178 case OPCODE_STENCIL_MASK
:
6179 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
6181 case OPCODE_STENCIL_OP
:
6182 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
6184 case OPCODE_STENCIL_FUNC_SEPARATE
:
6185 CALL_StencilFuncSeparate(ctx
->Exec
,
6186 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
6188 case OPCODE_STENCIL_MASK_SEPARATE
:
6189 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6191 case OPCODE_STENCIL_OP_SEPARATE
:
6192 CALL_StencilOpSeparate(ctx
->Exec
,
6193 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6202 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6212 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6215 case OPCODE_TEXPARAMETER
:
6222 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6225 case OPCODE_TEX_IMAGE1D
:
6227 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6228 ctx
->Unpack
= ctx
->DefaultPacking
;
6229 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
6231 n
[3].i
, /* components */
6233 n
[5].e
, /* border */
6234 n
[6].e
, /* format */
6237 ctx
->Unpack
= save
; /* restore */
6240 case OPCODE_TEX_IMAGE2D
:
6242 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6243 ctx
->Unpack
= ctx
->DefaultPacking
;
6244 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
6246 n
[3].i
, /* components */
6248 n
[5].i
, /* height */
6249 n
[6].e
, /* border */
6250 n
[7].e
, /* format */
6253 ctx
->Unpack
= save
; /* restore */
6256 case OPCODE_TEX_IMAGE3D
:
6258 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6259 ctx
->Unpack
= ctx
->DefaultPacking
;
6260 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
6262 n
[3].i
, /* components */
6264 n
[5].i
, /* height */
6266 n
[7].e
, /* border */
6267 n
[8].e
, /* format */
6270 ctx
->Unpack
= save
; /* restore */
6273 case OPCODE_TEX_SUB_IMAGE1D
:
6275 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6276 ctx
->Unpack
= ctx
->DefaultPacking
;
6277 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6279 n
[6].e
, n
[7].data
));
6280 ctx
->Unpack
= save
; /* restore */
6283 case OPCODE_TEX_SUB_IMAGE2D
:
6285 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6286 ctx
->Unpack
= ctx
->DefaultPacking
;
6287 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6289 n
[6].i
, n
[7].e
, n
[8].e
,
6291 ctx
->Unpack
= save
; /* restore */
6294 case OPCODE_TEX_SUB_IMAGE3D
:
6296 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6297 ctx
->Unpack
= ctx
->DefaultPacking
;
6298 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6299 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6300 n
[8].i
, n
[9].e
, n
[10].e
,
6302 ctx
->Unpack
= save
; /* restore */
6305 case OPCODE_TRANSLATE
:
6306 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6308 case OPCODE_VIEWPORT
:
6309 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6310 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
6312 case OPCODE_WINDOW_POS
:
6313 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6315 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
6316 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
6318 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
6319 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6320 n
[4].i
, n
[5].i
, n
[6].i
,
6323 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
6324 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6325 n
[4].i
, n
[5].i
, n
[6].i
,
6326 n
[7].i
, n
[8].data
));
6328 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
6329 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6330 n
[4].i
, n
[5].i
, n
[6].i
,
6334 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
6335 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
6336 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6337 n
[5].e
, n
[6].i
, n
[7].data
));
6339 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
6340 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
6341 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6342 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
6345 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
6346 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
6347 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6348 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6349 n
[9].e
, n
[10].i
, n
[11].data
));
6351 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
6352 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
6354 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
6355 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6357 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6358 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
6359 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6362 #if FEATURE_NV_vertex_program
6363 case OPCODE_EXECUTE_PROGRAM_NV
:
6370 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
6373 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
6374 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
6375 (GLuint
*) n
[2].data
));
6377 case OPCODE_LOAD_PROGRAM_NV
:
6378 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
6379 (const GLubyte
*) n
[4].data
));
6381 case OPCODE_TRACK_MATRIX_NV
:
6382 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
6386 #if FEATURE_NV_fragment_program
6387 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
6388 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
6389 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
6392 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
6393 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
6394 (const GLubyte
*) n
[3].
6395 data
, n
[4].f
, n
[5].f
,
6400 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
6401 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
6403 case OPCODE_DEPTH_BOUNDS_EXT
:
6404 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6406 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6407 case OPCODE_PROGRAM_STRING_ARB
:
6408 CALL_ProgramStringARB(ctx
->Exec
,
6409 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
6412 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
6413 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
6414 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6419 #if FEATURE_ARB_occlusion_query
6420 case OPCODE_BEGIN_QUERY_ARB
:
6421 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6423 case OPCODE_END_QUERY_ARB
:
6424 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
6427 case OPCODE_DRAW_BUFFERS_ARB
:
6429 GLenum buffers
[MAX_DRAW_BUFFERS
];
6430 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
6431 for (i
= 0; i
< count
; i
++)
6432 buffers
[i
] = n
[2 + i
].e
;
6433 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
6436 #if FEATURE_EXT_framebuffer_blit
6437 case OPCODE_BLIT_FRAMEBUFFER
:
6438 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
6439 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6443 #if FEATURE_ATI_fragment_shader
6444 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
6445 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
6447 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
6450 GLuint i
, dst
= n
[1].ui
;
6452 for (i
= 0; i
< 4; i
++)
6453 values
[i
] = n
[1 + i
].f
;
6454 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
6458 case OPCODE_ATTR_1F_NV
:
6459 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6461 case OPCODE_ATTR_2F_NV
:
6462 /* Really shouldn't have to do this - the Node structure
6463 * is convenient, but it would be better to store the data
6464 * packed appropriately so that it can be sent directly
6465 * on. With x86_64 becoming common, this will start to
6468 if (sizeof(Node
) == sizeof(GLfloat
))
6469 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6471 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6473 case OPCODE_ATTR_3F_NV
:
6474 if (sizeof(Node
) == sizeof(GLfloat
))
6475 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6477 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6480 case OPCODE_ATTR_4F_NV
:
6481 if (sizeof(Node
) == sizeof(GLfloat
))
6482 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6484 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6487 case OPCODE_ATTR_1F_ARB
:
6488 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6490 case OPCODE_ATTR_2F_ARB
:
6491 /* Really shouldn't have to do this - the Node structure
6492 * is convenient, but it would be better to store the data
6493 * packed appropriately so that it can be sent directly
6494 * on. With x86_64 becoming common, this will start to
6497 if (sizeof(Node
) == sizeof(GLfloat
))
6498 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6500 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6502 case OPCODE_ATTR_3F_ARB
:
6503 if (sizeof(Node
) == sizeof(GLfloat
))
6504 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6506 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6509 case OPCODE_ATTR_4F_ARB
:
6510 if (sizeof(Node
) == sizeof(GLfloat
))
6511 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6513 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6516 case OPCODE_MATERIAL
:
6517 if (sizeof(Node
) == sizeof(GLfloat
))
6518 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
6525 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
6529 CALL_Begin(ctx
->Exec
, (n
[1].e
));
6532 CALL_End(ctx
->Exec
, ());
6535 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6537 case OPCODE_EVAL_C1
:
6538 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
6540 case OPCODE_EVAL_C2
:
6541 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6543 case OPCODE_EVAL_P1
:
6544 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
6546 case OPCODE_EVAL_P2
:
6547 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
6550 case OPCODE_CONTINUE
:
6551 n
= (Node
*) n
[1].next
;
6553 case OPCODE_END_OF_LIST
:
6559 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d",
6561 _mesa_problem(ctx
, msg
);
6566 /* increment n to point to next compiled command */
6567 if (opcode
!= OPCODE_CONTINUE
) {
6568 n
+= InstSize
[opcode
];
6573 if (ctx
->Driver
.EndCallList
)
6574 ctx
->Driver
.EndCallList(ctx
);
6576 ctx
->ListState
.CallDepth
--;
6581 /**********************************************************************/
6583 /**********************************************************************/
6586 * Test if a display list number is valid.
6588 GLboolean GLAPIENTRY
6589 _mesa_IsList(GLuint list
)
6591 GET_CURRENT_CONTEXT(ctx
);
6592 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6593 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6594 return islist(ctx
, list
);
6599 * Delete a sequence of consecutive display lists.
6602 _mesa_DeleteLists(GLuint list
, GLsizei range
)
6604 GET_CURRENT_CONTEXT(ctx
);
6606 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6607 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6610 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
6613 for (i
= list
; i
< list
+ range
; i
++) {
6614 destroy_list(ctx
, i
);
6620 * Return a display list number, n, such that lists n through n+range-1
6624 _mesa_GenLists(GLsizei range
)
6626 GET_CURRENT_CONTEXT(ctx
);
6628 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6629 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6632 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
6640 * Make this an atomic operation
6642 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6644 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6646 /* reserve the list IDs by with empty/dummy lists */
6648 for (i
= 0; i
< range
; i
++) {
6649 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
6650 make_list(base
+ i
, 1));
6654 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6661 * Begin a new display list.
6664 _mesa_NewList(GLuint list
, GLenum mode
)
6666 GET_CURRENT_CONTEXT(ctx
);
6669 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6670 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6672 if (MESA_VERBOSE
& VERBOSE_API
)
6673 _mesa_debug(ctx
, "glNewList %u %s\n", list
,
6674 _mesa_lookup_enum_by_nr(mode
));
6677 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
6681 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
6682 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
6686 if (ctx
->ListState
.CurrentListPtr
) {
6687 /* already compiling a display list */
6688 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
6692 ctx
->CompileFlag
= GL_TRUE
;
6693 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6695 /* Allocate new display list */
6696 ctx
->ListState
.CurrentListNum
= list
;
6697 ctx
->ListState
.CurrentList
= make_list(list
, BLOCK_SIZE
);
6698 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->node
;
6699 ctx
->ListState
.CurrentListPtr
= ctx
->ListState
.CurrentBlock
;
6700 ctx
->ListState
.CurrentPos
= 0;
6702 /* Reset acumulated list state:
6704 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
6705 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
6707 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
6708 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
6710 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
6711 ctx
->Driver
.NewList(ctx
, list
, mode
);
6713 ctx
->CurrentDispatch
= ctx
->Save
;
6714 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6719 * End definition of current display list.
6724 GET_CURRENT_CONTEXT(ctx
);
6725 SAVE_FLUSH_VERTICES(ctx
);
6726 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6728 if (MESA_VERBOSE
& VERBOSE_API
)
6729 _mesa_debug(ctx
, "glEndList\n");
6731 /* Check that a list is under construction */
6732 if (!ctx
->ListState
.CurrentListPtr
) {
6733 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
6737 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END_OF_LIST
, 0);
6739 /* Destroy old list, if any */
6740 destroy_list(ctx
, ctx
->ListState
.CurrentListNum
);
6741 /* Install the list */
6742 _mesa_HashInsert(ctx
->Shared
->DisplayList
, ctx
->ListState
.CurrentListNum
,
6743 ctx
->ListState
.CurrentList
);
6746 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6747 mesa_print_display_list(ctx
->ListState
.CurrentListNum
);
6749 ctx
->Driver
.EndList(ctx
);
6751 ctx
->ListState
.CurrentList
= NULL
;
6752 ctx
->ListState
.CurrentListNum
= 0;
6753 ctx
->ListState
.CurrentListPtr
= NULL
;
6754 ctx
->ExecuteFlag
= GL_TRUE
;
6755 ctx
->CompileFlag
= GL_FALSE
;
6757 ctx
->CurrentDispatch
= ctx
->Exec
;
6758 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6763 _mesa_CallList(GLuint list
)
6765 GLboolean save_compile_flag
;
6766 GET_CURRENT_CONTEXT(ctx
);
6767 FLUSH_CURRENT(ctx
, 0);
6768 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6769 /* execute the display list, and restore the CompileFlag. */
6771 if (MESA_VERBOSE
& VERBOSE_API
)
6772 _mesa_debug(ctx
, "glCallList %d\n", list
);
6775 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6779 /* mesa_print_display_list( list ); */
6781 save_compile_flag
= ctx
->CompileFlag
;
6782 if (save_compile_flag
) {
6783 ctx
->CompileFlag
= GL_FALSE
;
6786 execute_list(ctx
, list
);
6787 ctx
->CompileFlag
= save_compile_flag
;
6789 /* also restore API function pointers to point to "save" versions */
6790 if (save_compile_flag
) {
6791 ctx
->CurrentDispatch
= ctx
->Save
;
6792 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6798 * Execute glCallLists: call multiple display lists.
6801 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
6803 GET_CURRENT_CONTEXT(ctx
);
6806 GLboolean save_compile_flag
;
6808 if (MESA_VERBOSE
& VERBOSE_API
)
6809 _mesa_debug(ctx
, "glCallLists %d\n", n
);
6813 case GL_UNSIGNED_BYTE
:
6815 case GL_UNSIGNED_SHORT
:
6817 case GL_UNSIGNED_INT
:
6825 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6829 /* Save the CompileFlag status, turn it off, execute display list,
6830 * and restore the CompileFlag.
6832 save_compile_flag
= ctx
->CompileFlag
;
6833 ctx
->CompileFlag
= GL_FALSE
;
6835 for (i
= 0; i
< n
; i
++) {
6836 list
= translate_id(i
, type
, lists
);
6837 execute_list(ctx
, ctx
->List
.ListBase
+ list
);
6840 ctx
->CompileFlag
= save_compile_flag
;
6842 /* also restore API function pointers to point to "save" versions */
6843 if (save_compile_flag
) {
6844 ctx
->CurrentDispatch
= ctx
->Save
;
6845 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6851 * Set the offset added to list numbers in glCallLists.
6854 _mesa_ListBase(GLuint base
)
6856 GET_CURRENT_CONTEXT(ctx
);
6857 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6858 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6859 ctx
->List
.ListBase
= base
;
6863 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
6865 static void GLAPIENTRY
6868 GET_CURRENT_CONTEXT(ctx
);
6869 FLUSH_VERTICES(ctx
, 0);
6870 CALL_Finish(ctx
->Exec
, ());
6873 static void GLAPIENTRY
6876 GET_CURRENT_CONTEXT(ctx
);
6877 FLUSH_VERTICES(ctx
, 0);
6878 CALL_Flush(ctx
->Exec
, ());
6881 static void GLAPIENTRY
6882 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
6884 GET_CURRENT_CONTEXT(ctx
);
6885 FLUSH_VERTICES(ctx
, 0);
6886 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
6889 static void GLAPIENTRY
6890 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
6892 GET_CURRENT_CONTEXT(ctx
);
6893 FLUSH_VERTICES(ctx
, 0);
6894 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
6897 static void GLAPIENTRY
6898 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
6900 GET_CURRENT_CONTEXT(ctx
);
6901 FLUSH_VERTICES(ctx
, 0);
6902 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
6905 static GLenum GLAPIENTRY
6908 GET_CURRENT_CONTEXT(ctx
);
6909 FLUSH_VERTICES(ctx
, 0);
6910 return CALL_GetError(ctx
->Exec
, ());
6913 static void GLAPIENTRY
6914 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
6916 GET_CURRENT_CONTEXT(ctx
);
6917 FLUSH_VERTICES(ctx
, 0);
6918 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
6921 static void GLAPIENTRY
6922 exec_GetIntegerv(GLenum pname
, GLint
*params
)
6924 GET_CURRENT_CONTEXT(ctx
);
6925 FLUSH_VERTICES(ctx
, 0);
6926 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
6929 static void GLAPIENTRY
6930 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
6932 GET_CURRENT_CONTEXT(ctx
);
6933 FLUSH_VERTICES(ctx
, 0);
6934 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
6937 static void GLAPIENTRY
6938 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
6940 GET_CURRENT_CONTEXT(ctx
);
6941 FLUSH_VERTICES(ctx
, 0);
6942 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
6945 static void GLAPIENTRY
6946 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
6948 GET_CURRENT_CONTEXT(ctx
);
6949 FLUSH_VERTICES(ctx
, 0);
6950 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
6953 static void GLAPIENTRY
6954 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
6956 GET_CURRENT_CONTEXT(ctx
);
6957 FLUSH_VERTICES(ctx
, 0);
6958 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
6961 static void GLAPIENTRY
6962 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
6964 GET_CURRENT_CONTEXT(ctx
);
6965 FLUSH_VERTICES(ctx
, 0);
6966 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
6969 static void GLAPIENTRY
6970 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
6972 GET_CURRENT_CONTEXT(ctx
);
6973 FLUSH_VERTICES(ctx
, 0);
6974 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
6977 static void GLAPIENTRY
6978 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
6980 GET_CURRENT_CONTEXT(ctx
);
6981 FLUSH_VERTICES(ctx
, 0);
6982 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
6985 static void GLAPIENTRY
6986 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
6988 GET_CURRENT_CONTEXT(ctx
);
6989 FLUSH_VERTICES(ctx
, 0);
6990 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
6993 static void GLAPIENTRY
6994 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
6996 GET_CURRENT_CONTEXT(ctx
);
6997 FLUSH_VERTICES(ctx
, 0);
6998 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
7001 static void GLAPIENTRY
7002 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
7004 GET_CURRENT_CONTEXT(ctx
);
7005 FLUSH_VERTICES(ctx
, 0);
7006 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
7009 static void GLAPIENTRY
7010 exec_GetPolygonStipple(GLubyte
* dest
)
7012 GET_CURRENT_CONTEXT(ctx
);
7013 FLUSH_VERTICES(ctx
, 0);
7014 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
7017 static const GLubyte
*GLAPIENTRY
7018 exec_GetString(GLenum name
)
7020 GET_CURRENT_CONTEXT(ctx
);
7021 FLUSH_VERTICES(ctx
, 0);
7022 return CALL_GetString(ctx
->Exec
, (name
));
7025 static void GLAPIENTRY
7026 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7028 GET_CURRENT_CONTEXT(ctx
);
7029 FLUSH_VERTICES(ctx
, 0);
7030 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
7033 static void GLAPIENTRY
7034 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
7036 GET_CURRENT_CONTEXT(ctx
);
7037 FLUSH_VERTICES(ctx
, 0);
7038 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
7041 static void GLAPIENTRY
7042 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
7044 GET_CURRENT_CONTEXT(ctx
);
7045 FLUSH_VERTICES(ctx
, 0);
7046 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
7049 static void GLAPIENTRY
7050 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
7052 GET_CURRENT_CONTEXT(ctx
);
7053 FLUSH_VERTICES(ctx
, 0);
7054 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
7057 static void GLAPIENTRY
7058 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
7060 GET_CURRENT_CONTEXT(ctx
);
7061 FLUSH_VERTICES(ctx
, 0);
7062 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
7065 static void GLAPIENTRY
7066 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
7067 GLenum type
, GLvoid
* pixels
)
7069 GET_CURRENT_CONTEXT(ctx
);
7070 FLUSH_VERTICES(ctx
, 0);
7071 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
7074 static void GLAPIENTRY
7075 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
7076 GLenum pname
, GLfloat
*params
)
7078 GET_CURRENT_CONTEXT(ctx
);
7079 FLUSH_VERTICES(ctx
, 0);
7080 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
7083 static void GLAPIENTRY
7084 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
7085 GLenum pname
, GLint
*params
)
7087 GET_CURRENT_CONTEXT(ctx
);
7088 FLUSH_VERTICES(ctx
, 0);
7089 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
7092 static void GLAPIENTRY
7093 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7095 GET_CURRENT_CONTEXT(ctx
);
7096 FLUSH_VERTICES(ctx
, 0);
7097 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
7100 static void GLAPIENTRY
7101 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7103 GET_CURRENT_CONTEXT(ctx
);
7104 FLUSH_VERTICES(ctx
, 0);
7105 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
7108 static GLboolean GLAPIENTRY
7109 exec_IsEnabled(GLenum cap
)
7111 GET_CURRENT_CONTEXT(ctx
);
7112 FLUSH_VERTICES(ctx
, 0);
7113 return CALL_IsEnabled(ctx
->Exec
, (cap
));
7116 static void GLAPIENTRY
7117 exec_PixelStoref(GLenum pname
, GLfloat param
)
7119 GET_CURRENT_CONTEXT(ctx
);
7120 FLUSH_VERTICES(ctx
, 0);
7121 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
7124 static void GLAPIENTRY
7125 exec_PixelStorei(GLenum pname
, GLint param
)
7127 GET_CURRENT_CONTEXT(ctx
);
7128 FLUSH_VERTICES(ctx
, 0);
7129 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
7132 static void GLAPIENTRY
7133 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
7134 GLenum format
, GLenum type
, GLvoid
* pixels
)
7136 GET_CURRENT_CONTEXT(ctx
);
7137 FLUSH_VERTICES(ctx
, 0);
7138 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
7141 static GLint GLAPIENTRY
7142 exec_RenderMode(GLenum mode
)
7144 GET_CURRENT_CONTEXT(ctx
);
7145 FLUSH_VERTICES(ctx
, 0);
7146 return CALL_RenderMode(ctx
->Exec
, (mode
));
7149 static void GLAPIENTRY
7150 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
7152 GET_CURRENT_CONTEXT(ctx
);
7153 FLUSH_VERTICES(ctx
, 0);
7154 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
7157 static void GLAPIENTRY
7158 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
7160 GET_CURRENT_CONTEXT(ctx
);
7161 FLUSH_VERTICES(ctx
, 0);
7162 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
7165 static GLboolean GLAPIENTRY
7166 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
7167 GLboolean
* residences
)
7169 GET_CURRENT_CONTEXT(ctx
);
7170 FLUSH_VERTICES(ctx
, 0);
7171 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
7174 static void GLAPIENTRY
7175 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7177 GET_CURRENT_CONTEXT(ctx
);
7178 FLUSH_VERTICES(ctx
, 0);
7179 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7182 static void GLAPIENTRY
7183 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
7185 GET_CURRENT_CONTEXT(ctx
);
7186 FLUSH_VERTICES(ctx
, 0);
7187 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
7190 static void GLAPIENTRY
7191 exec_DisableClientState(GLenum cap
)
7193 GET_CURRENT_CONTEXT(ctx
);
7194 FLUSH_VERTICES(ctx
, 0);
7195 CALL_DisableClientState(ctx
->Exec
, (cap
));
7198 static void GLAPIENTRY
7199 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
7201 GET_CURRENT_CONTEXT(ctx
);
7202 FLUSH_VERTICES(ctx
, 0);
7203 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
7206 static void GLAPIENTRY
7207 exec_EnableClientState(GLenum cap
)
7209 GET_CURRENT_CONTEXT(ctx
);
7210 FLUSH_VERTICES(ctx
, 0);
7211 CALL_EnableClientState(ctx
->Exec
, (cap
));
7214 static void GLAPIENTRY
7215 exec_GenTextures(GLsizei n
, GLuint
* texName
)
7217 GET_CURRENT_CONTEXT(ctx
);
7218 FLUSH_VERTICES(ctx
, 0);
7219 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
7222 static void GLAPIENTRY
7223 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
7225 GET_CURRENT_CONTEXT(ctx
);
7226 FLUSH_VERTICES(ctx
, 0);
7227 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
7230 static void GLAPIENTRY
7231 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7233 GET_CURRENT_CONTEXT(ctx
);
7234 FLUSH_VERTICES(ctx
, 0);
7235 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
7238 static void GLAPIENTRY
7239 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
7241 GET_CURRENT_CONTEXT(ctx
);
7242 FLUSH_VERTICES(ctx
, 0);
7243 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
7246 static GLboolean GLAPIENTRY
7247 exec_IsTexture(GLuint texture
)
7249 GET_CURRENT_CONTEXT(ctx
);
7250 FLUSH_VERTICES(ctx
, 0);
7251 return CALL_IsTexture(ctx
->Exec
, (texture
));
7254 static void GLAPIENTRY
7255 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7257 GET_CURRENT_CONTEXT(ctx
);
7258 FLUSH_VERTICES(ctx
, 0);
7259 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
7262 static void GLAPIENTRY
7263 exec_PopClientAttrib(void)
7265 GET_CURRENT_CONTEXT(ctx
);
7266 FLUSH_VERTICES(ctx
, 0);
7267 CALL_PopClientAttrib(ctx
->Exec
, ());
7270 static void GLAPIENTRY
7271 exec_PushClientAttrib(GLbitfield mask
)
7273 GET_CURRENT_CONTEXT(ctx
);
7274 FLUSH_VERTICES(ctx
, 0);
7275 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
7278 static void GLAPIENTRY
7279 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
7282 GET_CURRENT_CONTEXT(ctx
);
7283 FLUSH_VERTICES(ctx
, 0);
7284 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7287 static void GLAPIENTRY
7288 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
7290 GET_CURRENT_CONTEXT(ctx
);
7291 FLUSH_VERTICES(ctx
, 0);
7292 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
7295 static void GLAPIENTRY
7296 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
7299 GET_CURRENT_CONTEXT(ctx
);
7300 FLUSH_VERTICES(ctx
, 0);
7301 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7304 static void GLAPIENTRY
7305 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
7306 GLint x
, GLint y
, GLsizei width
)
7308 GET_CURRENT_CONTEXT(ctx
);
7309 FLUSH_VERTICES(ctx
, 0);
7310 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
7311 (target
, internalFormat
, x
, y
, width
));
7314 static void GLAPIENTRY
7315 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
7316 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
7318 GET_CURRENT_CONTEXT(ctx
);
7319 FLUSH_VERTICES(ctx
, 0);
7320 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
7321 (target
, internalFormat
, x
, y
, width
,
7325 static void GLAPIENTRY
7326 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
7328 GET_CURRENT_CONTEXT(ctx
);
7329 FLUSH_VERTICES(ctx
, 0);
7330 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
7333 static void GLAPIENTRY
7334 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7336 GET_CURRENT_CONTEXT(ctx
);
7337 FLUSH_VERTICES(ctx
, 0);
7338 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
7341 static void GLAPIENTRY
7342 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7344 GET_CURRENT_CONTEXT(ctx
);
7345 FLUSH_VERTICES(ctx
, 0);
7346 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
7349 static void GLAPIENTRY
7350 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
7353 GET_CURRENT_CONTEXT(ctx
);
7354 FLUSH_VERTICES(ctx
, 0);
7355 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
7358 static void GLAPIENTRY
7359 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7361 GET_CURRENT_CONTEXT(ctx
);
7362 FLUSH_VERTICES(ctx
, 0);
7363 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
7366 static void GLAPIENTRY
7367 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7369 GET_CURRENT_CONTEXT(ctx
);
7370 FLUSH_VERTICES(ctx
, 0);
7371 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
7374 static void GLAPIENTRY
7375 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
7376 GLenum type
, GLvoid
*values
)
7378 GET_CURRENT_CONTEXT(ctx
);
7379 FLUSH_VERTICES(ctx
, 0);
7380 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7383 static void GLAPIENTRY
7384 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7386 GET_CURRENT_CONTEXT(ctx
);
7387 FLUSH_VERTICES(ctx
, 0);
7388 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
7391 static void GLAPIENTRY
7392 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7394 GET_CURRENT_CONTEXT(ctx
);
7395 FLUSH_VERTICES(ctx
, 0);
7396 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
7399 static void GLAPIENTRY
7400 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
7401 GLenum type
, GLvoid
*values
)
7403 GET_CURRENT_CONTEXT(ctx
);
7404 FLUSH_VERTICES(ctx
, 0);
7405 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7408 static void GLAPIENTRY
7409 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7411 GET_CURRENT_CONTEXT(ctx
);
7412 FLUSH_VERTICES(ctx
, 0);
7413 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
7416 static void GLAPIENTRY
7417 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7419 GET_CURRENT_CONTEXT(ctx
);
7420 FLUSH_VERTICES(ctx
, 0);
7421 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
7424 static void GLAPIENTRY
7425 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
7426 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
7428 GET_CURRENT_CONTEXT(ctx
);
7429 FLUSH_VERTICES(ctx
, 0);
7430 CALL_GetSeparableFilter(ctx
->Exec
,
7431 (target
, format
, type
, row
, column
, span
));
7434 static void GLAPIENTRY
7435 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
7436 GLsizei width
, GLsizei height
, GLenum format
,
7437 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
7439 GET_CURRENT_CONTEXT(ctx
);
7440 FLUSH_VERTICES(ctx
, 0);
7441 CALL_SeparableFilter2D(ctx
->Exec
,
7442 (target
, internalFormat
, width
, height
, format
,
7443 type
, row
, column
));
7446 static void GLAPIENTRY
7447 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7448 GLsizei count
, const GLvoid
*ptr
)
7450 GET_CURRENT_CONTEXT(ctx
);
7451 FLUSH_VERTICES(ctx
, 0);
7452 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7455 static void GLAPIENTRY
7456 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
7458 GET_CURRENT_CONTEXT(ctx
);
7459 FLUSH_VERTICES(ctx
, 0);
7460 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
7463 static void GLAPIENTRY
7464 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7467 GET_CURRENT_CONTEXT(ctx
);
7468 FLUSH_VERTICES(ctx
, 0);
7469 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
7472 static void GLAPIENTRY
7473 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7476 GET_CURRENT_CONTEXT(ctx
);
7477 FLUSH_VERTICES(ctx
, 0);
7478 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
7481 static void GLAPIENTRY
7482 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7483 GLsizei count
, const GLvoid
*ptr
)
7485 GET_CURRENT_CONTEXT(ctx
);
7486 FLUSH_VERTICES(ctx
, 0);
7487 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7490 static void GLAPIENTRY
7491 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7492 GLsizei count
, const GLvoid
*ptr
)
7494 GET_CURRENT_CONTEXT(ctx
);
7495 FLUSH_VERTICES(ctx
, 0);
7496 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7499 static void GLAPIENTRY
7500 exec_LockArraysEXT(GLint first
, GLsizei count
)
7502 GET_CURRENT_CONTEXT(ctx
);
7503 FLUSH_VERTICES(ctx
, 0);
7504 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
7507 static void GLAPIENTRY
7508 exec_UnlockArraysEXT(void)
7510 GET_CURRENT_CONTEXT(ctx
);
7511 FLUSH_VERTICES(ctx
, 0);
7512 CALL_UnlockArraysEXT(ctx
->Exec
, ());
7515 static void GLAPIENTRY
7516 exec_ClientActiveTextureARB(GLenum target
)
7518 GET_CURRENT_CONTEXT(ctx
);
7519 FLUSH_VERTICES(ctx
, 0);
7520 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
7523 static void GLAPIENTRY
7524 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
7525 GLsizei stride
, const GLvoid
*ptr
)
7527 GET_CURRENT_CONTEXT(ctx
);
7528 FLUSH_VERTICES(ctx
, 0);
7529 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
7532 static void GLAPIENTRY
7533 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7535 GET_CURRENT_CONTEXT(ctx
);
7536 FLUSH_VERTICES(ctx
, 0);
7537 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
7540 /* GL_EXT_multi_draw_arrays */
7541 static void GLAPIENTRY
7542 exec_MultiDrawArraysEXT(GLenum mode
, GLint
* first
,
7543 GLsizei
* count
, GLsizei primcount
)
7545 GET_CURRENT_CONTEXT(ctx
);
7546 FLUSH_VERTICES(ctx
, 0);
7547 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
7550 /* GL_EXT_multi_draw_arrays */
7551 static void GLAPIENTRY
7552 exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
* count
,
7553 GLenum type
, const GLvoid
** indices
,
7556 GET_CURRENT_CONTEXT(ctx
);
7557 FLUSH_VERTICES(ctx
, 0);
7558 CALL_MultiDrawElementsEXT(ctx
->Exec
,
7559 (mode
, count
, type
, indices
, primcount
));
7562 /* GL_IBM_multimode_draw_arrays */
7563 static void GLAPIENTRY
7564 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
7565 const GLsizei
* count
, GLsizei primcount
,
7568 GET_CURRENT_CONTEXT(ctx
);
7569 FLUSH_VERTICES(ctx
, 0);
7570 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
7571 (mode
, first
, count
, primcount
, modestride
));
7574 /* GL_IBM_multimode_draw_arrays */
7575 static void GLAPIENTRY
7576 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
7577 const GLsizei
* count
,
7579 const GLvoid
* const *indices
,
7580 GLsizei primcount
, GLint modestride
)
7582 GET_CURRENT_CONTEXT(ctx
);
7583 FLUSH_VERTICES(ctx
, 0);
7584 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
7585 (mode
, count
, type
, indices
, primcount
,
7592 * Setup the given dispatch table to point to Mesa's display list
7593 * building functions.
7595 * This does not include any of the tnl functions - they are
7596 * initialized from _mesa_init_api_defaults and from the active vtxfmt
7600 _mesa_init_dlist_table(struct _glapi_table
*table
)
7602 _mesa_loopback_init_api_table(table
);
7605 SET_Accum(table
, save_Accum
);
7606 SET_AlphaFunc(table
, save_AlphaFunc
);
7607 SET_Bitmap(table
, save_Bitmap
);
7608 SET_BlendFunc(table
, _mesa_BlendFunc
); /* loops-back to BlendFuncSeparate */
7609 SET_CallList(table
, _mesa_save_CallList
);
7610 SET_CallLists(table
, _mesa_save_CallLists
);
7611 SET_Clear(table
, save_Clear
);
7612 SET_ClearAccum(table
, save_ClearAccum
);
7613 SET_ClearColor(table
, save_ClearColor
);
7614 SET_ClearDepth(table
, save_ClearDepth
);
7615 SET_ClearIndex(table
, save_ClearIndex
);
7616 SET_ClearStencil(table
, save_ClearStencil
);
7617 SET_ClipPlane(table
, save_ClipPlane
);
7618 SET_ColorMask(table
, save_ColorMask
);
7619 SET_ColorMaterial(table
, save_ColorMaterial
);
7620 SET_CopyPixels(table
, save_CopyPixels
);
7621 SET_CullFace(table
, save_CullFace
);
7622 SET_DeleteLists(table
, _mesa_DeleteLists
);
7623 SET_DepthFunc(table
, save_DepthFunc
);
7624 SET_DepthMask(table
, save_DepthMask
);
7625 SET_DepthRange(table
, save_DepthRange
);
7626 SET_Disable(table
, save_Disable
);
7627 SET_DrawBuffer(table
, save_DrawBuffer
);
7628 SET_DrawPixels(table
, save_DrawPixels
);
7629 SET_Enable(table
, save_Enable
);
7630 SET_EndList(table
, _mesa_EndList
);
7631 SET_EvalMesh1(table
, _mesa_save_EvalMesh1
);
7632 SET_EvalMesh2(table
, _mesa_save_EvalMesh2
);
7633 SET_Finish(table
, exec_Finish
);
7634 SET_Flush(table
, exec_Flush
);
7635 SET_Fogf(table
, save_Fogf
);
7636 SET_Fogfv(table
, save_Fogfv
);
7637 SET_Fogi(table
, save_Fogi
);
7638 SET_Fogiv(table
, save_Fogiv
);
7639 SET_FrontFace(table
, save_FrontFace
);
7640 SET_Frustum(table
, save_Frustum
);
7641 SET_GenLists(table
, _mesa_GenLists
);
7642 SET_GetBooleanv(table
, exec_GetBooleanv
);
7643 SET_GetClipPlane(table
, exec_GetClipPlane
);
7644 SET_GetDoublev(table
, exec_GetDoublev
);
7645 SET_GetError(table
, exec_GetError
);
7646 SET_GetFloatv(table
, exec_GetFloatv
);
7647 SET_GetIntegerv(table
, exec_GetIntegerv
);
7648 SET_GetLightfv(table
, exec_GetLightfv
);
7649 SET_GetLightiv(table
, exec_GetLightiv
);
7650 SET_GetMapdv(table
, exec_GetMapdv
);
7651 SET_GetMapfv(table
, exec_GetMapfv
);
7652 SET_GetMapiv(table
, exec_GetMapiv
);
7653 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
7654 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
7655 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
7656 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
7657 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
7658 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
7659 SET_GetString(table
, exec_GetString
);
7660 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
7661 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
7662 SET_GetTexGendv(table
, exec_GetTexGendv
);
7663 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
7664 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
7665 SET_GetTexImage(table
, exec_GetTexImage
);
7666 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
7667 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
7668 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
7669 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
7670 SET_Hint(table
, save_Hint
);
7671 SET_IndexMask(table
, save_IndexMask
);
7672 SET_InitNames(table
, save_InitNames
);
7673 SET_IsEnabled(table
, exec_IsEnabled
);
7674 SET_IsList(table
, _mesa_IsList
);
7675 SET_LightModelf(table
, save_LightModelf
);
7676 SET_LightModelfv(table
, save_LightModelfv
);
7677 SET_LightModeli(table
, save_LightModeli
);
7678 SET_LightModeliv(table
, save_LightModeliv
);
7679 SET_Lightf(table
, save_Lightf
);
7680 SET_Lightfv(table
, save_Lightfv
);
7681 SET_Lighti(table
, save_Lighti
);
7682 SET_Lightiv(table
, save_Lightiv
);
7683 SET_LineStipple(table
, save_LineStipple
);
7684 SET_LineWidth(table
, save_LineWidth
);
7685 SET_ListBase(table
, save_ListBase
);
7686 SET_LoadIdentity(table
, save_LoadIdentity
);
7687 SET_LoadMatrixd(table
, save_LoadMatrixd
);
7688 SET_LoadMatrixf(table
, save_LoadMatrixf
);
7689 SET_LoadName(table
, save_LoadName
);
7690 SET_LogicOp(table
, save_LogicOp
);
7691 SET_Map1d(table
, save_Map1d
);
7692 SET_Map1f(table
, save_Map1f
);
7693 SET_Map2d(table
, save_Map2d
);
7694 SET_Map2f(table
, save_Map2f
);
7695 SET_MapGrid1d(table
, save_MapGrid1d
);
7696 SET_MapGrid1f(table
, save_MapGrid1f
);
7697 SET_MapGrid2d(table
, save_MapGrid2d
);
7698 SET_MapGrid2f(table
, save_MapGrid2f
);
7699 SET_MatrixMode(table
, save_MatrixMode
);
7700 SET_MultMatrixd(table
, save_MultMatrixd
);
7701 SET_MultMatrixf(table
, save_MultMatrixf
);
7702 SET_NewList(table
, save_NewList
);
7703 SET_Ortho(table
, save_Ortho
);
7704 SET_PassThrough(table
, save_PassThrough
);
7705 SET_PixelMapfv(table
, save_PixelMapfv
);
7706 SET_PixelMapuiv(table
, save_PixelMapuiv
);
7707 SET_PixelMapusv(table
, save_PixelMapusv
);
7708 SET_PixelStoref(table
, exec_PixelStoref
);
7709 SET_PixelStorei(table
, exec_PixelStorei
);
7710 SET_PixelTransferf(table
, save_PixelTransferf
);
7711 SET_PixelTransferi(table
, save_PixelTransferi
);
7712 SET_PixelZoom(table
, save_PixelZoom
);
7713 SET_PointSize(table
, save_PointSize
);
7714 SET_PolygonMode(table
, save_PolygonMode
);
7715 SET_PolygonOffset(table
, save_PolygonOffset
);
7716 SET_PolygonStipple(table
, save_PolygonStipple
);
7717 SET_PopAttrib(table
, save_PopAttrib
);
7718 SET_PopMatrix(table
, save_PopMatrix
);
7719 SET_PopName(table
, save_PopName
);
7720 SET_PushAttrib(table
, save_PushAttrib
);
7721 SET_PushMatrix(table
, save_PushMatrix
);
7722 SET_PushName(table
, save_PushName
);
7723 SET_RasterPos2d(table
, save_RasterPos2d
);
7724 SET_RasterPos2dv(table
, save_RasterPos2dv
);
7725 SET_RasterPos2f(table
, save_RasterPos2f
);
7726 SET_RasterPos2fv(table
, save_RasterPos2fv
);
7727 SET_RasterPos2i(table
, save_RasterPos2i
);
7728 SET_RasterPos2iv(table
, save_RasterPos2iv
);
7729 SET_RasterPos2s(table
, save_RasterPos2s
);
7730 SET_RasterPos2sv(table
, save_RasterPos2sv
);
7731 SET_RasterPos3d(table
, save_RasterPos3d
);
7732 SET_RasterPos3dv(table
, save_RasterPos3dv
);
7733 SET_RasterPos3f(table
, save_RasterPos3f
);
7734 SET_RasterPos3fv(table
, save_RasterPos3fv
);
7735 SET_RasterPos3i(table
, save_RasterPos3i
);
7736 SET_RasterPos3iv(table
, save_RasterPos3iv
);
7737 SET_RasterPos3s(table
, save_RasterPos3s
);
7738 SET_RasterPos3sv(table
, save_RasterPos3sv
);
7739 SET_RasterPos4d(table
, save_RasterPos4d
);
7740 SET_RasterPos4dv(table
, save_RasterPos4dv
);
7741 SET_RasterPos4f(table
, save_RasterPos4f
);
7742 SET_RasterPos4fv(table
, save_RasterPos4fv
);
7743 SET_RasterPos4i(table
, save_RasterPos4i
);
7744 SET_RasterPos4iv(table
, save_RasterPos4iv
);
7745 SET_RasterPos4s(table
, save_RasterPos4s
);
7746 SET_RasterPos4sv(table
, save_RasterPos4sv
);
7747 SET_ReadBuffer(table
, save_ReadBuffer
);
7748 SET_ReadPixels(table
, exec_ReadPixels
);
7749 SET_RenderMode(table
, exec_RenderMode
);
7750 SET_Rotated(table
, save_Rotated
);
7751 SET_Rotatef(table
, save_Rotatef
);
7752 SET_Scaled(table
, save_Scaled
);
7753 SET_Scalef(table
, save_Scalef
);
7754 SET_Scissor(table
, save_Scissor
);
7755 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
7756 SET_SelectBuffer(table
, exec_SelectBuffer
);
7757 SET_ShadeModel(table
, save_ShadeModel
);
7758 SET_StencilFunc(table
, save_StencilFunc
);
7759 SET_StencilMask(table
, save_StencilMask
);
7760 SET_StencilOp(table
, save_StencilOp
);
7761 SET_TexEnvf(table
, save_TexEnvf
);
7762 SET_TexEnvfv(table
, save_TexEnvfv
);
7763 SET_TexEnvi(table
, save_TexEnvi
);
7764 SET_TexEnviv(table
, save_TexEnviv
);
7765 SET_TexGend(table
, save_TexGend
);
7766 SET_TexGendv(table
, save_TexGendv
);
7767 SET_TexGenf(table
, save_TexGenf
);
7768 SET_TexGenfv(table
, save_TexGenfv
);
7769 SET_TexGeni(table
, save_TexGeni
);
7770 SET_TexGeniv(table
, save_TexGeniv
);
7771 SET_TexImage1D(table
, save_TexImage1D
);
7772 SET_TexImage2D(table
, save_TexImage2D
);
7773 SET_TexParameterf(table
, save_TexParameterf
);
7774 SET_TexParameterfv(table
, save_TexParameterfv
);
7775 SET_TexParameteri(table
, save_TexParameteri
);
7776 SET_TexParameteriv(table
, save_TexParameteriv
);
7777 SET_Translated(table
, save_Translated
);
7778 SET_Translatef(table
, save_Translatef
);
7779 SET_Viewport(table
, save_Viewport
);
7782 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
7783 SET_BindTexture(table
, save_BindTexture
);
7784 SET_ColorPointer(table
, exec_ColorPointer
);
7785 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
7786 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
7787 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
7788 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
7789 SET_DeleteTextures(table
, exec_DeleteTextures
);
7790 SET_DisableClientState(table
, exec_DisableClientState
);
7791 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
7792 SET_EnableClientState(table
, exec_EnableClientState
);
7793 SET_GenTextures(table
, exec_GenTextures
);
7794 SET_GetPointerv(table
, exec_GetPointerv
);
7795 SET_IndexPointer(table
, exec_IndexPointer
);
7796 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
7797 SET_IsTexture(table
, exec_IsTexture
);
7798 SET_NormalPointer(table
, exec_NormalPointer
);
7799 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
7800 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
7801 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
7802 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
7803 SET_TexSubImage1D(table
, save_TexSubImage1D
);
7804 SET_TexSubImage2D(table
, save_TexSubImage2D
);
7805 SET_VertexPointer(table
, exec_VertexPointer
);
7808 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
7809 SET_TexImage3D(table
, save_TexImage3D
);
7810 SET_TexSubImage3D(table
, save_TexSubImage3D
);
7813 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
7814 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
7815 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
7817 /* GL_ARB_imaging */
7818 /* Not all are supported */
7819 SET_BlendColor(table
, save_BlendColor
);
7820 SET_BlendEquation(table
, save_BlendEquation
);
7821 SET_ColorSubTable(table
, save_ColorSubTable
);
7822 SET_ColorTable(table
, save_ColorTable
);
7823 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
7824 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
7825 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
7826 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
7827 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
7828 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
7829 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
7830 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
7831 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
7832 SET_CopyColorTable(table
, save_CopyColorTable
);
7833 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
7834 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
7835 SET_GetColorTable(table
, exec_GetColorTable
);
7836 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
7837 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
7838 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
7839 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
7840 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
7841 SET_GetHistogram(table
, exec_GetHistogram
);
7842 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
7843 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
7844 SET_GetMinmax(table
, exec_GetMinmax
);
7845 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
7846 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
7847 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
7848 SET_Histogram(table
, save_Histogram
);
7849 SET_Minmax(table
, save_Minmax
);
7850 SET_ResetHistogram(table
, save_ResetHistogram
);
7851 SET_ResetMinmax(table
, save_ResetMinmax
);
7852 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
7854 /* 2. GL_EXT_blend_color */
7856 SET_BlendColorEXT(table
, save_BlendColorEXT
);
7859 /* 3. GL_EXT_polygon_offset */
7860 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
7862 /* 6. GL_EXT_texture3d */
7864 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
7865 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
7866 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
7869 /* 14. GL_SGI_color_table */
7871 SET_ColorTableSGI(table
, save_ColorTable
);
7872 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
7873 SET_GetColorTableSGI(table
, exec_GetColorTable
);
7874 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
7875 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
7878 /* 30. GL_EXT_vertex_array */
7879 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
7880 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
7881 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
7882 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
7883 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
7884 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
7886 /* 37. GL_EXT_blend_minmax */
7888 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
7891 /* 54. GL_EXT_point_parameters */
7892 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
7893 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
7895 /* 97. GL_EXT_compiled_vertex_array */
7896 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
7897 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
7899 /* 145. GL_EXT_secondary_color */
7900 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
7902 /* 148. GL_EXT_multi_draw_arrays */
7903 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
7904 SET_MultiDrawElementsEXT(table
, exec_MultiDrawElementsEXT
);
7906 /* 149. GL_EXT_fog_coord */
7907 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
7909 /* 173. GL_EXT_blend_func_separate */
7910 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
7912 /* 196. GL_MESA_resize_buffers */
7913 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
7915 /* 197. GL_MESA_window_pos */
7916 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
7917 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
7918 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
7919 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
7920 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
7921 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
7922 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
7923 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
7924 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
7925 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
7926 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
7927 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
7928 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
7929 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
7930 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
7931 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
7932 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
7933 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
7934 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
7935 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
7936 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
7937 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
7938 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
7939 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
7941 /* 200. GL_IBM_multimode_draw_arrays */
7942 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
7943 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
7945 #if FEATURE_NV_vertex_program
7946 /* 233. GL_NV_vertex_program */
7947 /* The following commands DO NOT go into display lists:
7948 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
7949 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
7951 SET_BindProgramNV(table
, save_BindProgramNV
);
7952 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
7953 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
7954 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
7955 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
7956 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
7957 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
7958 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
7959 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
7960 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
7961 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
7962 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
7963 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
7964 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
7965 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
7966 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
7967 SET_LoadProgramNV(table
, save_LoadProgramNV
);
7968 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
7969 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
7970 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
7971 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
7972 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
7973 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
7974 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
7975 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
7978 /* 245. GL_ATI_fragment_shader */
7979 #if FEATURE_ATI_fragment_shader
7980 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
7981 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
7984 /* 282. GL_NV_fragment_program */
7985 #if FEATURE_NV_fragment_program
7986 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
7987 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
7988 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
7989 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
7990 SET_GetProgramNamedParameterfvNV(table
,
7991 _mesa_GetProgramNamedParameterfvNV
);
7992 SET_GetProgramNamedParameterdvNV(table
,
7993 _mesa_GetProgramNamedParameterdvNV
);
7994 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
7995 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
7996 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
7997 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
7998 SET_GetProgramLocalParameterdvARB(table
,
7999 _mesa_GetProgramLocalParameterdvARB
);
8000 SET_GetProgramLocalParameterfvARB(table
,
8001 _mesa_GetProgramLocalParameterfvARB
);
8004 /* 262. GL_NV_point_sprite */
8005 SET_PointParameteriNV(table
, save_PointParameteriNV
);
8006 SET_PointParameterivNV(table
, save_PointParameterivNV
);
8008 /* 268. GL_EXT_stencil_two_side */
8009 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
8011 /* 273. GL_APPLE_vertex_array_object */
8012 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
8013 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
8014 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
8015 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
8017 /* ???. GL_EXT_depth_bounds_test */
8018 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
8020 /* ARB 1. GL_ARB_multitexture */
8021 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
8022 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
8024 /* ARB 3. GL_ARB_transpose_matrix */
8025 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
8026 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
8027 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
8028 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
8030 /* ARB 5. GL_ARB_multisample */
8031 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
8033 /* ARB 12. GL_ARB_texture_compression */
8034 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
8035 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
8036 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
8037 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
8038 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
8039 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
8040 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
8042 /* ARB 14. GL_ARB_point_parameters */
8043 /* aliased with EXT_point_parameters functions */
8045 /* ARB 25. GL_ARB_window_pos */
8046 /* aliased with MESA_window_pos functions */
8048 /* ARB 26. GL_ARB_vertex_program */
8049 /* ARB 27. GL_ARB_fragment_program */
8050 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8051 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
8052 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
8053 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
8054 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
8055 SET_ProgramStringARB(table
, save_ProgramStringARB
);
8056 SET_BindProgramNV(table
, save_BindProgramNV
);
8057 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8058 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8059 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
8060 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8061 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8062 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8063 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8064 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
8065 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
8066 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
8067 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
8068 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8069 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8070 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8071 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8072 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
8073 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
8074 SET_GetProgramLocalParameterdvARB(table
,
8075 _mesa_GetProgramLocalParameterdvARB
);
8076 SET_GetProgramLocalParameterfvARB(table
,
8077 _mesa_GetProgramLocalParameterfvARB
);
8078 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
8079 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
8082 /* ARB 28. GL_ARB_vertex_buffer_object */
8083 #if FEATURE_ARB_vertex_buffer_object
8084 /* None of the extension's functions get compiled */
8085 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
8086 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
8087 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
8088 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
8089 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
8090 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
8091 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
8092 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
8093 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
8094 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
8095 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
8098 #if FEATURE_ARB_occlusion_query
8099 SET_BeginQueryARB(table
, save_BeginQueryARB
);
8100 SET_EndQueryARB(table
, save_EndQueryARB
);
8101 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
8102 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
8103 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
8104 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
8105 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
8106 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
8108 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
8110 #if FEATURE_EXT_framebuffer_blit
8111 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
8114 /* 299. GL_EXT_blend_equation_separate */
8115 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
8117 /* GL_EXT_gpu_program_parmaeters */
8118 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8119 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
8120 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
8127 enum_string(GLenum k
)
8129 return _mesa_lookup_enum_by_nr(k
);
8134 * Print the commands in a display list. For debugging only.
8135 * TODO: many commands aren't handled yet.
8137 static void GLAPIENTRY
8138 print_list(GLcontext
*ctx
, GLuint list
)
8140 struct mesa_display_list
*dlist
;
8144 if (!islist(ctx
, list
)) {
8145 _mesa_printf("%u is not a display list ID\n", list
);
8149 dlist
= lookup_list(ctx
, list
);
8155 _mesa_printf("START-LIST %u, address %p\n", list
, (void *) n
);
8157 done
= n
? GL_FALSE
: GL_TRUE
;
8159 OpCode opcode
= n
[0].opcode
;
8160 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
8162 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
8163 /* this is a driver-extended opcode */
8164 ctx
->ListExt
.Opcode
[i
].Print(ctx
, &n
[1]);
8165 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
8170 _mesa_printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
8173 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
8174 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
8176 case OPCODE_CALL_LIST
:
8177 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
8179 case OPCODE_CALL_LIST_OFFSET
:
8180 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
8181 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
8183 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
8184 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
8185 enum_string(n
[1].e
), enum_string(n
[2].e
),
8186 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8188 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
8189 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
8190 enum_string(n
[1].e
), enum_string(n
[2].e
),
8191 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
8193 case OPCODE_DISABLE
:
8194 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
8197 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
8199 case OPCODE_FRUSTUM
:
8200 _mesa_printf("Frustum %g %g %g %g %g %g\n",
8201 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8203 case OPCODE_LINE_STIPPLE
:
8204 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
8206 case OPCODE_LOAD_IDENTITY
:
8207 _mesa_printf("LoadIdentity\n");
8209 case OPCODE_LOAD_MATRIX
:
8210 _mesa_printf("LoadMatrix\n");
8211 _mesa_printf(" %8f %8f %8f %8f\n",
8212 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8213 _mesa_printf(" %8f %8f %8f %8f\n",
8214 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8215 _mesa_printf(" %8f %8f %8f %8f\n",
8216 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8217 _mesa_printf(" %8f %8f %8f %8f\n",
8218 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8220 case OPCODE_MULT_MATRIX
:
8221 _mesa_printf("MultMatrix (or Rotate)\n");
8222 _mesa_printf(" %8f %8f %8f %8f\n",
8223 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8224 _mesa_printf(" %8f %8f %8f %8f\n",
8225 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8226 _mesa_printf(" %8f %8f %8f %8f\n",
8227 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8228 _mesa_printf(" %8f %8f %8f %8f\n",
8229 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8232 _mesa_printf("Ortho %g %g %g %g %g %g\n",
8233 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8235 case OPCODE_POP_ATTRIB
:
8236 _mesa_printf("PopAttrib\n");
8238 case OPCODE_POP_MATRIX
:
8239 _mesa_printf("PopMatrix\n");
8241 case OPCODE_POP_NAME
:
8242 _mesa_printf("PopName\n");
8244 case OPCODE_PUSH_ATTRIB
:
8245 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
8247 case OPCODE_PUSH_MATRIX
:
8248 _mesa_printf("PushMatrix\n");
8250 case OPCODE_PUSH_NAME
:
8251 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
8253 case OPCODE_RASTER_POS
:
8254 _mesa_printf("RasterPos %g %g %g %g\n",
8255 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8258 _mesa_printf("Rotate %g %g %g %g\n",
8259 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8262 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8264 case OPCODE_TRANSLATE
:
8265 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8267 case OPCODE_BIND_TEXTURE
:
8268 _mesa_printf("BindTexture %s %d\n",
8269 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
8271 case OPCODE_SHADE_MODEL
:
8272 _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
8275 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
8276 _mesa_lookup_enum_by_nr(n
[1].ui
),
8277 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
8280 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
8281 _mesa_lookup_enum_by_nr(n
[1].ui
),
8282 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
8283 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
8285 case OPCODE_MAPGRID1
:
8286 _mesa_printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
8288 case OPCODE_MAPGRID2
:
8289 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
8290 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
8292 case OPCODE_EVALMESH1
:
8293 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
8295 case OPCODE_EVALMESH2
:
8296 _mesa_printf("EvalMesh2 %d %d %d %d\n",
8297 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
8300 case OPCODE_ATTR_1F_NV
:
8301 _mesa_printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
8303 case OPCODE_ATTR_2F_NV
:
8304 _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
8305 n
[1].i
, n
[2].f
, n
[3].f
);
8307 case OPCODE_ATTR_3F_NV
:
8308 _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
8309 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8311 case OPCODE_ATTR_4F_NV
:
8312 _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
8313 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8315 case OPCODE_ATTR_1F_ARB
:
8316 _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
8318 case OPCODE_ATTR_2F_ARB
:
8319 _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
8320 n
[1].i
, n
[2].f
, n
[3].f
);
8322 case OPCODE_ATTR_3F_ARB
:
8323 _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
8324 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8326 case OPCODE_ATTR_4F_ARB
:
8327 _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
8328 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8331 case OPCODE_MATERIAL
:
8332 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
8333 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8336 _mesa_printf("BEGIN %x\n", n
[1].i
);
8339 _mesa_printf("END\n");
8342 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
8345 case OPCODE_EVAL_C1
:
8346 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
8348 case OPCODE_EVAL_C2
:
8349 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
8351 case OPCODE_EVAL_P1
:
8352 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
8354 case OPCODE_EVAL_P2
:
8355 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
8359 * meta opcodes/commands
8362 _mesa_printf("Error: %s %s\n",
8363 enum_string(n
[1].e
), (const char *) n
[2].data
);
8365 case OPCODE_CONTINUE
:
8366 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
8367 n
= (Node
*) n
[1].next
;
8369 case OPCODE_END_OF_LIST
:
8370 _mesa_printf("END-LIST %u\n", list
);
8374 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
8376 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
8377 opcode
, (void *) n
);
8381 _mesa_printf("command %d, %u operands\n", opcode
,
8385 /* increment n to point to next compiled command */
8386 if (opcode
!= OPCODE_CONTINUE
) {
8387 n
+= InstSize
[opcode
];
8396 * Clients may call this function to help debug display list problems.
8397 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
8398 * changed, or break in the future without notice.
8401 mesa_print_display_list(GLuint list
)
8403 GET_CURRENT_CONTEXT(ctx
);
8404 print_list(ctx
, list
);
8408 /**********************************************************************/
8409 /***** Initialization *****/
8410 /**********************************************************************/
8413 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
8415 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
8416 vfmt
->Begin
= save_Begin
;
8417 vfmt
->CallList
= _mesa_save_CallList
;
8418 vfmt
->CallLists
= _mesa_save_CallLists
;
8419 vfmt
->Color3f
= save_Color3f
;
8420 vfmt
->Color3fv
= save_Color3fv
;
8421 vfmt
->Color4f
= save_Color4f
;
8422 vfmt
->Color4fv
= save_Color4fv
;
8423 vfmt
->EdgeFlag
= save_EdgeFlag
;
8424 vfmt
->End
= save_End
;
8425 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
8426 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
8427 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
8428 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
8429 vfmt
->EvalPoint1
= save_EvalPoint1
;
8430 vfmt
->EvalPoint2
= save_EvalPoint2
;
8431 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
8432 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
8433 vfmt
->Indexf
= save_Indexf
;
8434 vfmt
->Indexfv
= save_Indexfv
;
8435 vfmt
->Materialfv
= save_Materialfv
;
8436 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
8437 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
8438 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
8439 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
8440 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
8441 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
8442 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
8443 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
8444 vfmt
->Normal3f
= save_Normal3f
;
8445 vfmt
->Normal3fv
= save_Normal3fv
;
8446 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
8447 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
8448 vfmt
->TexCoord1f
= save_TexCoord1f
;
8449 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
8450 vfmt
->TexCoord2f
= save_TexCoord2f
;
8451 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
8452 vfmt
->TexCoord3f
= save_TexCoord3f
;
8453 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
8454 vfmt
->TexCoord4f
= save_TexCoord4f
;
8455 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
8456 vfmt
->Vertex2f
= save_Vertex2f
;
8457 vfmt
->Vertex2fv
= save_Vertex2fv
;
8458 vfmt
->Vertex3f
= save_Vertex3f
;
8459 vfmt
->Vertex3fv
= save_Vertex3fv
;
8460 vfmt
->Vertex4f
= save_Vertex4f
;
8461 vfmt
->Vertex4fv
= save_Vertex4fv
;
8462 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
8463 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
8464 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
8465 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
8466 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
8467 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
8468 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
8469 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
8470 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
8471 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
8472 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
8473 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
8474 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
8475 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
8476 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
8477 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
8479 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
8480 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
8481 vfmt
->Rectf
= save_Rectf
;
8483 /* The driver is required to implement these as
8484 * 1) They can probably do a better job.
8485 * 2) A lot of new mechanisms would have to be added to this module
8486 * to support it. That code would probably never get used,
8490 vfmt
->DrawArrays
= 0;
8491 vfmt
->DrawElements
= 0;
8492 vfmt
->DrawRangeElements
= 0;
8498 * Initialize display list state for given context.
8501 _mesa_init_display_list(GLcontext
*ctx
)
8503 static GLboolean tableInitialized
= GL_FALSE
;
8505 /* zero-out the instruction size table, just once */
8506 if (!tableInitialized
) {
8507 _mesa_bzero(InstSize
, sizeof(InstSize
));
8508 tableInitialized
= GL_TRUE
;
8512 ctx
->ListState
.CallDepth
= 0;
8513 ctx
->ExecuteFlag
= GL_TRUE
;
8514 ctx
->CompileFlag
= GL_FALSE
;
8515 ctx
->ListState
.CurrentListPtr
= NULL
;
8516 ctx
->ListState
.CurrentBlock
= NULL
;
8517 ctx
->ListState
.CurrentListNum
= 0;
8518 ctx
->ListState
.CurrentPos
= 0;
8520 /* Display List group */
8521 ctx
->List
.ListBase
= 0;
8523 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);