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"
52 #include "extensions.h"
54 #include "framebuffer.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"
89 #include "glapi/dispatch.h"
95 * \param ctx GL context.
97 * Checks if dd_function_table::SaveNeedFlush is marked to flush
98 * stored (save) vertices, and calls
99 * dd_function_table::SaveFlushVertices if so.
101 #define SAVE_FLUSH_VERTICES(ctx) \
103 if (ctx->Driver.SaveNeedFlush) \
104 ctx->Driver.SaveFlushVertices(ctx); \
109 * Macro to assert that the API call was made outside the
110 * glBegin()/glEnd() pair, with return value.
112 * \param ctx GL context.
113 * \param retval value to return value in case the assertion fails.
115 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
117 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
118 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
119 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
125 * Macro to assert that the API call was made outside the
126 * glBegin()/glEnd() pair.
128 * \param ctx GL context.
130 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
132 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
133 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
134 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
140 * Macro to assert that the API call was made outside the
141 * glBegin()/glEnd() pair and flush the vertices.
143 * \param ctx GL context.
145 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
147 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
148 SAVE_FLUSH_VERTICES(ctx); \
152 * Macro to assert that the API call was made outside the
153 * glBegin()/glEnd() pair and flush the vertices, with return value.
155 * \param ctx GL context.
156 * \param retval value to return value in case the assertion fails.
158 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
160 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
161 SAVE_FLUSH_VERTICES(ctx); \
167 * Display list opcodes.
169 * The fact that these identifiers are assigned consecutive
170 * integer values starting at 0 is very important, see InstSize array usage)
174 OPCODE_INVALID
= -1, /* Force signed enum */
180 OPCODE_BLEND_EQUATION
,
181 OPCODE_BLEND_EQUATION_SEPARATE
,
182 OPCODE_BLEND_FUNC_SEPARATE
,
184 OPCODE_CALL_LIST_OFFSET
,
190 OPCODE_CLEAR_STENCIL
,
193 OPCODE_COLOR_MATERIAL
,
195 OPCODE_COLOR_TABLE_PARAMETER_FV
,
196 OPCODE_COLOR_TABLE_PARAMETER_IV
,
197 OPCODE_COLOR_SUB_TABLE
,
198 OPCODE_CONVOLUTION_FILTER_1D
,
199 OPCODE_CONVOLUTION_FILTER_2D
,
200 OPCODE_CONVOLUTION_PARAMETER_I
,
201 OPCODE_CONVOLUTION_PARAMETER_IV
,
202 OPCODE_CONVOLUTION_PARAMETER_F
,
203 OPCODE_CONVOLUTION_PARAMETER_FV
,
204 OPCODE_COPY_COLOR_SUB_TABLE
,
205 OPCODE_COPY_COLOR_TABLE
,
207 OPCODE_COPY_TEX_IMAGE1D
,
208 OPCODE_COPY_TEX_IMAGE2D
,
209 OPCODE_COPY_TEX_SUB_IMAGE1D
,
210 OPCODE_COPY_TEX_SUB_IMAGE2D
,
211 OPCODE_COPY_TEX_SUB_IMAGE3D
,
234 OPCODE_LOAD_IDENTITY
,
248 OPCODE_PIXEL_TRANSFER
,
251 OPCODE_POINT_PARAMETERS
,
253 OPCODE_POLYGON_STIPPLE
,
254 OPCODE_POLYGON_OFFSET
,
258 OPCODE_PRIORITIZE_TEXTURE
,
264 OPCODE_RESET_HISTOGRAM
,
265 OPCODE_RESET_MIN_MAX
,
269 OPCODE_SELECT_TEXTURE_SGIS
,
270 OPCODE_SELECT_TEXTURE_COORD_SET
,
281 OPCODE_TEX_SUB_IMAGE1D
,
282 OPCODE_TEX_SUB_IMAGE2D
,
283 OPCODE_TEX_SUB_IMAGE3D
,
287 /* GL_ARB_multitexture */
288 OPCODE_ACTIVE_TEXTURE
,
289 /* GL_ARB_texture_compression */
290 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
291 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
292 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
293 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
294 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
295 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
296 /* GL_ARB_multisample */
297 OPCODE_SAMPLE_COVERAGE
,
298 /* GL_ARB_window_pos */
299 OPCODE_WINDOW_POS_ARB
,
300 /* GL_NV_vertex_program */
301 OPCODE_BIND_PROGRAM_NV
,
302 OPCODE_EXECUTE_PROGRAM_NV
,
303 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
304 OPCODE_LOAD_PROGRAM_NV
,
305 OPCODE_TRACK_MATRIX_NV
,
306 /* GL_NV_fragment_program */
307 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
308 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
309 /* GL_EXT_stencil_two_side */
310 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
311 /* GL_EXT_depth_bounds_test */
312 OPCODE_DEPTH_BOUNDS_EXT
,
313 /* GL_ARB_vertex/fragment_program */
314 OPCODE_PROGRAM_STRING_ARB
,
315 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
316 /* GL_ARB_occlusion_query */
317 OPCODE_BEGIN_QUERY_ARB
,
318 OPCODE_END_QUERY_ARB
,
319 /* GL_ARB_draw_buffers */
320 OPCODE_DRAW_BUFFERS_ARB
,
321 /* GL_ATI_fragment_shader */
322 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
323 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
325 OPCODE_STENCIL_FUNC_SEPARATE
,
326 OPCODE_STENCIL_OP_SEPARATE
,
327 OPCODE_STENCIL_MASK_SEPARATE
,
329 /* GL_EXT_framebuffer_blit */
330 OPCODE_BLIT_FRAMEBUFFER
,
332 /* Vertex attributes -- fallback for when optimized display
333 * list build isn't active.
352 /* The following three are meta instructions */
353 OPCODE_ERROR
, /* raise compiled-in error */
364 * Display list instructions are stored as sequences of "nodes". Nodes
365 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
366 * are linked together with a pointer.
368 * Each instruction in the display list is stored as a sequence of
369 * contiguous nodes in memory.
370 * Each node is the union of a variety of data types.
385 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
389 typedef union gl_dlist_node Node
;
393 * How many nodes to allocate at a time.
395 * \note Reduced now that we hold vertices etc. elsewhere.
397 #define BLOCK_SIZE 256
402 * Number of nodes of storage needed for each instruction.
403 * Sizes for dynamically allocated opcodes are stored in the context struct.
405 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
407 void mesa_print_display_list(GLuint list
);
410 /**********************************************************************/
411 /***** Private *****/
412 /**********************************************************************/
416 * Make an empty display list. This is used by glGenLists() to
417 * reserve display list IDs.
419 static struct gl_display_list
*
420 make_list(GLuint name
, GLuint count
)
422 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
424 dlist
->Head
= (Node
*) _mesa_malloc(sizeof(Node
) * count
);
425 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
431 * Lookup function to just encapsulate casting.
433 static INLINE
struct gl_display_list
*
434 lookup_list(GLcontext
*ctx
, GLuint list
)
436 return (struct gl_display_list
*)
437 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
443 * Delete the named display list, but don't remove from hash table.
444 * \param dlist - display list pointer
447 _mesa_delete_list(GLcontext
*ctx
, struct gl_display_list
*dlist
)
452 n
= block
= dlist
->Head
;
454 done
= block
? GL_FALSE
: GL_TRUE
;
457 /* check for extension opcodes first */
459 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
460 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
461 ctx
->ListExt
.Opcode
[i
].Destroy(ctx
, &n
[1]);
462 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
465 switch (n
[0].opcode
) {
466 /* for some commands, we need to free malloc'd memory */
468 _mesa_free(n
[6].data
);
469 n
+= InstSize
[n
[0].opcode
];
472 _mesa_free(n
[10].data
);
473 n
+= InstSize
[n
[0].opcode
];
475 case OPCODE_DRAW_PIXELS
:
476 _mesa_free(n
[5].data
);
477 n
+= InstSize
[n
[0].opcode
];
480 _mesa_free(n
[7].data
);
481 n
+= InstSize
[n
[0].opcode
];
483 case OPCODE_COLOR_TABLE
:
484 _mesa_free(n
[6].data
);
485 n
+= InstSize
[n
[0].opcode
];
487 case OPCODE_COLOR_SUB_TABLE
:
488 _mesa_free(n
[6].data
);
489 n
+= InstSize
[n
[0].opcode
];
491 case OPCODE_CONVOLUTION_FILTER_1D
:
492 _mesa_free(n
[6].data
);
493 n
+= InstSize
[n
[0].opcode
];
495 case OPCODE_CONVOLUTION_FILTER_2D
:
496 _mesa_free(n
[7].data
);
497 n
+= InstSize
[n
[0].opcode
];
499 case OPCODE_POLYGON_STIPPLE
:
500 _mesa_free(n
[1].data
);
501 n
+= InstSize
[n
[0].opcode
];
503 case OPCODE_TEX_IMAGE1D
:
504 _mesa_free(n
[8].data
);
505 n
+= InstSize
[n
[0].opcode
];
507 case OPCODE_TEX_IMAGE2D
:
508 _mesa_free(n
[9].data
);
509 n
+= InstSize
[n
[0].opcode
];
511 case OPCODE_TEX_IMAGE3D
:
512 _mesa_free(n
[10].data
);
513 n
+= InstSize
[n
[0].opcode
];
515 case OPCODE_TEX_SUB_IMAGE1D
:
516 _mesa_free(n
[7].data
);
517 n
+= InstSize
[n
[0].opcode
];
519 case OPCODE_TEX_SUB_IMAGE2D
:
520 _mesa_free(n
[9].data
);
521 n
+= InstSize
[n
[0].opcode
];
523 case OPCODE_TEX_SUB_IMAGE3D
:
524 _mesa_free(n
[11].data
);
525 n
+= InstSize
[n
[0].opcode
];
527 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
528 _mesa_free(n
[7].data
);
529 n
+= InstSize
[n
[0].opcode
];
531 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
532 _mesa_free(n
[8].data
);
533 n
+= InstSize
[n
[0].opcode
];
535 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
536 _mesa_free(n
[9].data
);
537 n
+= InstSize
[n
[0].opcode
];
539 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
540 _mesa_free(n
[7].data
);
541 n
+= InstSize
[n
[0].opcode
];
543 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
544 _mesa_free(n
[9].data
);
545 n
+= InstSize
[n
[0].opcode
];
547 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
548 _mesa_free(n
[11].data
);
549 n
+= InstSize
[n
[0].opcode
];
551 #if FEATURE_NV_vertex_program
552 case OPCODE_LOAD_PROGRAM_NV
:
553 _mesa_free(n
[4].data
); /* program string */
554 n
+= InstSize
[n
[0].opcode
];
556 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
557 _mesa_free(n
[2].data
); /* array of program ids */
558 n
+= InstSize
[n
[0].opcode
];
561 #if FEATURE_NV_fragment_program
562 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
563 _mesa_free(n
[3].data
); /* parameter name */
564 n
+= InstSize
[n
[0].opcode
];
567 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
568 case OPCODE_PROGRAM_STRING_ARB
:
569 _mesa_free(n
[4].data
); /* program string */
570 n
+= InstSize
[n
[0].opcode
];
573 case OPCODE_CONTINUE
:
574 n
= (Node
*) n
[1].next
;
578 case OPCODE_END_OF_LIST
:
583 /* Most frequent case */
584 n
+= InstSize
[n
[0].opcode
];
595 * Destroy a display list and remove from hash table.
596 * \param list - display list number
599 destroy_list(GLcontext
*ctx
, GLuint list
)
601 struct gl_display_list
*dlist
;
606 dlist
= lookup_list(ctx
, list
);
610 _mesa_delete_list(ctx
, dlist
);
611 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
616 * Translate the nth element of list from <type> to GLint.
619 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
631 bptr
= (GLbyte
*) list
;
632 return (GLint
) bptr
[n
];
633 case GL_UNSIGNED_BYTE
:
634 ubptr
= (GLubyte
*) list
;
635 return (GLint
) ubptr
[n
];
637 sptr
= (GLshort
*) list
;
638 return (GLint
) sptr
[n
];
639 case GL_UNSIGNED_SHORT
:
640 usptr
= (GLushort
*) list
;
641 return (GLint
) usptr
[n
];
643 iptr
= (GLint
*) list
;
645 case GL_UNSIGNED_INT
:
646 uiptr
= (GLuint
*) list
;
647 return (GLint
) uiptr
[n
];
649 fptr
= (GLfloat
*) list
;
650 return (GLint
) FLOORF(fptr
[n
]);
652 ubptr
= ((GLubyte
*) list
) + 2 * n
;
653 return (GLint
) ubptr
[0] * 256
656 ubptr
= ((GLubyte
*) list
) + 3 * n
;
657 return (GLint
) ubptr
[0] * 65536
658 + (GLint
) ubptr
[1] * 256
661 ubptr
= ((GLubyte
*) list
) + 4 * n
;
662 return (GLint
) ubptr
[0] * 16777216
663 + (GLint
) ubptr
[1] * 65536
664 + (GLint
) ubptr
[2] * 256
674 /**********************************************************************/
676 /**********************************************************************/
679 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
680 * \todo This won't suffice when the PBO is really in VRAM/GPU memory.
683 unpack_image(GLuint dimensions
, GLsizei width
, GLsizei height
, GLsizei depth
,
684 GLenum format
, GLenum type
, const GLvoid
* pixels
,
685 const struct gl_pixelstore_attrib
*unpack
)
687 if (unpack
->BufferObj
->Name
== 0) {
689 return _mesa_unpack_image(dimensions
, width
, height
, depth
, format
,
690 type
, pixels
, unpack
);
693 if (_mesa_validate_pbo_access
694 (dimensions
, unpack
, width
, height
, depth
, format
, type
, pixels
)) {
695 const GLubyte
*src
= ADD_POINTERS(unpack
->BufferObj
->Data
, pixels
);
696 return _mesa_unpack_image(dimensions
, width
, height
, depth
, format
,
705 * Allocate space for a display list instruction.
706 * \param opcode the instruction opcode (OPCODE_* value)
707 * \param size instruction size in bytes, not counting opcode.
708 * \return pointer to the usable data area (not including the internal
712 _mesa_alloc_instruction(GLcontext
*ctx
, GLuint opcode
, GLuint bytes
)
714 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
717 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
718 if (InstSize
[opcode
] == 0) {
719 /* save instruction size now */
720 InstSize
[opcode
] = numNodes
;
723 /* make sure instruction size agrees */
724 ASSERT(numNodes
== InstSize
[opcode
]);
728 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
729 /* This block is full. Allocate a new block and chain to it */
731 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
732 n
[0].opcode
= OPCODE_CONTINUE
;
733 newblock
= (Node
*) _mesa_malloc(sizeof(Node
) * BLOCK_SIZE
);
735 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
738 n
[1].next
= (Node
*) newblock
;
739 ctx
->ListState
.CurrentBlock
= newblock
;
740 ctx
->ListState
.CurrentPos
= 0;
743 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
744 ctx
->ListState
.CurrentPos
+= numNodes
;
746 n
[0].opcode
= (OpCode
) opcode
;
748 return (void *) (n
+ 1); /* return ptr to node following opcode */
753 * This function allows modules and drivers to get their own opcodes
754 * for extending display list functionality.
755 * \param ctx the rendering context
756 * \param size number of bytes for storing the new display list command
757 * \param execute function to execute the new display list command
758 * \param destroy function to destroy the new display list command
759 * \param print function to print the new display list command
760 * \return the new opcode number or -1 if error
763 _mesa_alloc_opcode(GLcontext
*ctx
,
765 void (*execute
) (GLcontext
*, void *),
766 void (*destroy
) (GLcontext
*, void *),
767 void (*print
) (GLcontext
*, void *))
769 if (ctx
->ListExt
.NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
770 const GLuint i
= ctx
->ListExt
.NumOpcodes
++;
771 ctx
->ListExt
.Opcode
[i
].Size
=
772 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
773 ctx
->ListExt
.Opcode
[i
].Execute
= execute
;
774 ctx
->ListExt
.Opcode
[i
].Destroy
= destroy
;
775 ctx
->ListExt
.Opcode
[i
].Print
= print
;
776 return i
+ OPCODE_EXT_0
;
784 * Allocate display list instruction. Returns Node ptr to where the opcode
786 * - nParams is the number of function parameters
787 * - return value a pointer to sizeof(Node) before the actual
790 #define ALLOC_INSTRUCTION(CTX, OPCODE, NPARAMS) \
791 ((Node *)_mesa_alloc_instruction(CTX, OPCODE, (NPARAMS)*sizeof(Node)) - 1)
796 * Display List compilation functions
798 static void GLAPIENTRY
799 save_Accum(GLenum op
, GLfloat value
)
801 GET_CURRENT_CONTEXT(ctx
);
803 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
804 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACCUM
, 2);
809 if (ctx
->ExecuteFlag
) {
810 CALL_Accum(ctx
->Exec
, (op
, value
));
815 static void GLAPIENTRY
816 save_AlphaFunc(GLenum func
, GLclampf ref
)
818 GET_CURRENT_CONTEXT(ctx
);
820 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
821 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ALPHA_FUNC
, 2);
824 n
[2].f
= (GLfloat
) ref
;
826 if (ctx
->ExecuteFlag
) {
827 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
832 static void GLAPIENTRY
833 save_BindTexture(GLenum target
, GLuint texture
)
835 GET_CURRENT_CONTEXT(ctx
);
837 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
838 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_TEXTURE
, 2);
843 if (ctx
->ExecuteFlag
) {
844 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
849 static void GLAPIENTRY
850 save_Bitmap(GLsizei width
, GLsizei height
,
851 GLfloat xorig
, GLfloat yorig
,
852 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
854 GET_CURRENT_CONTEXT(ctx
);
855 GLvoid
*image
= _mesa_unpack_bitmap(width
, height
, pixels
, &ctx
->Unpack
);
857 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
858 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BITMAP
, 7);
860 n
[1].i
= (GLint
) width
;
861 n
[2].i
= (GLint
) height
;
871 if (ctx
->ExecuteFlag
) {
872 CALL_Bitmap(ctx
->Exec
, (width
, height
,
873 xorig
, yorig
, xmove
, ymove
, pixels
));
878 static void GLAPIENTRY
879 save_BlendEquation(GLenum mode
)
881 GET_CURRENT_CONTEXT(ctx
);
883 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
884 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_EQUATION
, 1);
888 if (ctx
->ExecuteFlag
) {
889 CALL_BlendEquation(ctx
->Exec
, (mode
));
894 static void GLAPIENTRY
895 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
897 GET_CURRENT_CONTEXT(ctx
);
899 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
900 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
905 if (ctx
->ExecuteFlag
) {
906 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
911 static void GLAPIENTRY
912 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
913 GLenum sfactorA
, GLenum dfactorA
)
915 GET_CURRENT_CONTEXT(ctx
);
917 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
918 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
925 if (ctx
->ExecuteFlag
) {
926 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
927 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
932 static void GLAPIENTRY
933 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
935 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
939 static void GLAPIENTRY
940 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
942 GET_CURRENT_CONTEXT(ctx
);
944 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
945 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_COLOR
, 4);
952 if (ctx
->ExecuteFlag
) {
953 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
959 _mesa_save_CallList(GLuint list
)
961 GET_CURRENT_CONTEXT(ctx
);
963 SAVE_FLUSH_VERTICES(ctx
);
965 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CALL_LIST
, 1);
970 /* After this, we don't know what begin/end state we're in:
972 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
974 if (ctx
->ExecuteFlag
) {
975 CALL_CallList(ctx
->Exec
, (list
));
981 _mesa_save_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
983 GET_CURRENT_CONTEXT(ctx
);
985 GLboolean typeErrorFlag
;
987 SAVE_FLUSH_VERTICES(ctx
);
991 case GL_UNSIGNED_BYTE
:
993 case GL_UNSIGNED_SHORT
:
995 case GL_UNSIGNED_INT
:
1000 typeErrorFlag
= GL_FALSE
;
1003 typeErrorFlag
= GL_TRUE
;
1006 for (i
= 0; i
< n
; i
++) {
1007 GLint list
= translate_id(i
, type
, lists
);
1008 Node
*n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1011 n
[2].b
= typeErrorFlag
;
1015 /* After this, we don't know what begin/end state we're in:
1017 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1019 if (ctx
->ExecuteFlag
) {
1020 CALL_CallLists(ctx
->Exec
, (n
, type
, lists
));
1025 static void GLAPIENTRY
1026 save_Clear(GLbitfield mask
)
1028 GET_CURRENT_CONTEXT(ctx
);
1030 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1031 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR
, 1);
1035 if (ctx
->ExecuteFlag
) {
1036 CALL_Clear(ctx
->Exec
, (mask
));
1041 static void GLAPIENTRY
1042 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1044 GET_CURRENT_CONTEXT(ctx
);
1046 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1047 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1054 if (ctx
->ExecuteFlag
) {
1055 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1060 static void GLAPIENTRY
1061 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1063 GET_CURRENT_CONTEXT(ctx
);
1065 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1066 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_COLOR
, 4);
1073 if (ctx
->ExecuteFlag
) {
1074 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1079 static void GLAPIENTRY
1080 save_ClearDepth(GLclampd depth
)
1082 GET_CURRENT_CONTEXT(ctx
);
1084 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1085 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1087 n
[1].f
= (GLfloat
) depth
;
1089 if (ctx
->ExecuteFlag
) {
1090 CALL_ClearDepth(ctx
->Exec
, (depth
));
1095 static void GLAPIENTRY
1096 save_ClearIndex(GLfloat c
)
1098 GET_CURRENT_CONTEXT(ctx
);
1100 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1101 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_INDEX
, 1);
1105 if (ctx
->ExecuteFlag
) {
1106 CALL_ClearIndex(ctx
->Exec
, (c
));
1111 static void GLAPIENTRY
1112 save_ClearStencil(GLint s
)
1114 GET_CURRENT_CONTEXT(ctx
);
1116 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1117 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1121 if (ctx
->ExecuteFlag
) {
1122 CALL_ClearStencil(ctx
->Exec
, (s
));
1127 static void GLAPIENTRY
1128 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1130 GET_CURRENT_CONTEXT(ctx
);
1132 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1133 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLIP_PLANE
, 5);
1136 n
[2].f
= (GLfloat
) equ
[0];
1137 n
[3].f
= (GLfloat
) equ
[1];
1138 n
[4].f
= (GLfloat
) equ
[2];
1139 n
[5].f
= (GLfloat
) equ
[3];
1141 if (ctx
->ExecuteFlag
) {
1142 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1148 static void GLAPIENTRY
1149 save_ColorMask(GLboolean red
, GLboolean green
,
1150 GLboolean blue
, GLboolean alpha
)
1152 GET_CURRENT_CONTEXT(ctx
);
1154 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1155 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_MASK
, 4);
1162 if (ctx
->ExecuteFlag
) {
1163 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1168 static void GLAPIENTRY
1169 save_ColorMaterial(GLenum face
, GLenum mode
)
1171 GET_CURRENT_CONTEXT(ctx
);
1173 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1175 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1180 if (ctx
->ExecuteFlag
) {
1181 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1186 static void GLAPIENTRY
1187 save_ColorTable(GLenum target
, GLenum internalFormat
,
1188 GLsizei width
, GLenum format
, GLenum type
,
1189 const GLvoid
* table
)
1191 GET_CURRENT_CONTEXT(ctx
);
1192 if (_mesa_is_proxy_texture(target
)) {
1193 /* execute immediately */
1194 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1195 format
, type
, table
));
1198 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
, table
,
1201 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1202 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE
, 6);
1205 n
[2].e
= internalFormat
;
1214 if (ctx
->ExecuteFlag
) {
1215 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1216 format
, type
, table
));
1223 static void GLAPIENTRY
1224 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1225 const GLfloat
*params
)
1227 GET_CURRENT_CONTEXT(ctx
);
1230 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1232 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1237 if (pname
== GL_COLOR_TABLE_SGI
||
1238 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1239 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1240 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1247 if (ctx
->ExecuteFlag
) {
1248 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1253 static void GLAPIENTRY
1254 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1256 GET_CURRENT_CONTEXT(ctx
);
1259 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1261 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1266 if (pname
== GL_COLOR_TABLE_SGI
||
1267 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1268 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1269 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1276 if (ctx
->ExecuteFlag
) {
1277 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1283 static void GLAPIENTRY
1284 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1285 GLenum format
, GLenum type
, const GLvoid
* table
)
1287 GET_CURRENT_CONTEXT(ctx
);
1288 GLvoid
*image
= unpack_image(1, count
, 1, 1, format
, type
, table
,
1291 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1292 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1304 if (ctx
->ExecuteFlag
) {
1305 CALL_ColorSubTable(ctx
->Exec
,
1306 (target
, start
, count
, format
, type
, table
));
1311 static void GLAPIENTRY
1312 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1313 GLint x
, GLint y
, GLsizei width
)
1315 GET_CURRENT_CONTEXT(ctx
);
1318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1319 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1327 if (ctx
->ExecuteFlag
) {
1328 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1333 static void GLAPIENTRY
1334 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1335 GLint x
, GLint y
, GLsizei width
)
1337 GET_CURRENT_CONTEXT(ctx
);
1340 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1341 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1344 n
[2].e
= internalformat
;
1349 if (ctx
->ExecuteFlag
) {
1350 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1355 static void GLAPIENTRY
1356 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1357 GLenum format
, GLenum type
, const GLvoid
* filter
)
1359 GET_CURRENT_CONTEXT(ctx
);
1360 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
, filter
,
1363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1364 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1367 n
[2].e
= internalFormat
;
1376 if (ctx
->ExecuteFlag
) {
1377 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1378 format
, type
, filter
));
1383 static void GLAPIENTRY
1384 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1385 GLsizei width
, GLsizei height
, GLenum format
,
1386 GLenum type
, const GLvoid
* filter
)
1388 GET_CURRENT_CONTEXT(ctx
);
1389 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
, filter
,
1392 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1393 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1396 n
[2].e
= internalFormat
;
1406 if (ctx
->ExecuteFlag
) {
1407 CALL_ConvolutionFilter2D(ctx
->Exec
,
1408 (target
, internalFormat
, width
, height
, format
,
1414 static void GLAPIENTRY
1415 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1417 GET_CURRENT_CONTEXT(ctx
);
1419 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1420 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1426 if (ctx
->ExecuteFlag
) {
1427 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1432 static void GLAPIENTRY
1433 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1435 GET_CURRENT_CONTEXT(ctx
);
1437 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1438 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1443 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1444 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1445 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1451 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1454 if (ctx
->ExecuteFlag
) {
1455 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1460 static void GLAPIENTRY
1461 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1463 GET_CURRENT_CONTEXT(ctx
);
1465 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1466 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
1472 if (ctx
->ExecuteFlag
) {
1473 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
1478 static void GLAPIENTRY
1479 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
1480 const GLfloat
*params
)
1482 GET_CURRENT_CONTEXT(ctx
);
1484 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1485 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
1490 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1491 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1492 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1498 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1501 if (ctx
->ExecuteFlag
) {
1502 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
1507 static void GLAPIENTRY
1508 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1510 GET_CURRENT_CONTEXT(ctx
);
1512 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1513 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_PIXELS
, 5);
1517 n
[3].i
= (GLint
) width
;
1518 n
[4].i
= (GLint
) height
;
1521 if (ctx
->ExecuteFlag
) {
1522 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1528 static void GLAPIENTRY
1529 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1530 GLint x
, GLint y
, GLsizei width
, GLint border
)
1532 GET_CURRENT_CONTEXT(ctx
);
1534 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1535 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1539 n
[3].e
= internalformat
;
1545 if (ctx
->ExecuteFlag
) {
1546 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1547 x
, y
, width
, border
));
1552 static void GLAPIENTRY
1553 save_CopyTexImage2D(GLenum target
, GLint level
,
1554 GLenum internalformat
,
1555 GLint x
, GLint y
, GLsizei width
,
1556 GLsizei height
, GLint border
)
1558 GET_CURRENT_CONTEXT(ctx
);
1560 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1561 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1565 n
[3].e
= internalformat
;
1572 if (ctx
->ExecuteFlag
) {
1573 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1574 x
, y
, width
, height
, border
));
1580 static void GLAPIENTRY
1581 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1582 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1584 GET_CURRENT_CONTEXT(ctx
);
1586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1587 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1596 if (ctx
->ExecuteFlag
) {
1597 CALL_CopyTexSubImage1D(ctx
->Exec
,
1598 (target
, level
, xoffset
, x
, y
, width
));
1603 static void GLAPIENTRY
1604 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1605 GLint xoffset
, GLint yoffset
,
1606 GLint x
, GLint y
, GLsizei width
, GLint height
)
1608 GET_CURRENT_CONTEXT(ctx
);
1610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1611 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1622 if (ctx
->ExecuteFlag
) {
1623 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1624 x
, y
, width
, height
));
1629 static void GLAPIENTRY
1630 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1631 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1632 GLint x
, GLint y
, GLsizei width
, GLint height
)
1634 GET_CURRENT_CONTEXT(ctx
);
1636 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1637 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1649 if (ctx
->ExecuteFlag
) {
1650 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1651 xoffset
, yoffset
, zoffset
,
1652 x
, y
, width
, height
));
1657 static void GLAPIENTRY
1658 save_CullFace(GLenum mode
)
1660 GET_CURRENT_CONTEXT(ctx
);
1662 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1663 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CULL_FACE
, 1);
1667 if (ctx
->ExecuteFlag
) {
1668 CALL_CullFace(ctx
->Exec
, (mode
));
1673 static void GLAPIENTRY
1674 save_DepthFunc(GLenum func
)
1676 GET_CURRENT_CONTEXT(ctx
);
1678 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1679 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_FUNC
, 1);
1683 if (ctx
->ExecuteFlag
) {
1684 CALL_DepthFunc(ctx
->Exec
, (func
));
1689 static void GLAPIENTRY
1690 save_DepthMask(GLboolean mask
)
1692 GET_CURRENT_CONTEXT(ctx
);
1694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1695 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_MASK
, 1);
1699 if (ctx
->ExecuteFlag
) {
1700 CALL_DepthMask(ctx
->Exec
, (mask
));
1705 static void GLAPIENTRY
1706 save_DepthRange(GLclampd nearval
, GLclampd farval
)
1708 GET_CURRENT_CONTEXT(ctx
);
1710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1711 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_RANGE
, 2);
1713 n
[1].f
= (GLfloat
) nearval
;
1714 n
[2].f
= (GLfloat
) farval
;
1716 if (ctx
->ExecuteFlag
) {
1717 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
1722 static void GLAPIENTRY
1723 save_Disable(GLenum cap
)
1725 GET_CURRENT_CONTEXT(ctx
);
1727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1728 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DISABLE
, 1);
1732 if (ctx
->ExecuteFlag
) {
1733 CALL_Disable(ctx
->Exec
, (cap
));
1738 static void GLAPIENTRY
1739 save_DrawBuffer(GLenum mode
)
1741 GET_CURRENT_CONTEXT(ctx
);
1743 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1744 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFER
, 1);
1748 if (ctx
->ExecuteFlag
) {
1749 CALL_DrawBuffer(ctx
->Exec
, (mode
));
1754 static void GLAPIENTRY
1755 save_DrawPixels(GLsizei width
, GLsizei height
,
1756 GLenum format
, GLenum type
, const GLvoid
* pixels
)
1758 GET_CURRENT_CONTEXT(ctx
);
1759 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
1760 pixels
, &ctx
->Unpack
);
1762 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1763 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_PIXELS
, 5);
1774 if (ctx
->ExecuteFlag
) {
1775 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
1781 static void GLAPIENTRY
1782 save_Enable(GLenum cap
)
1784 GET_CURRENT_CONTEXT(ctx
);
1786 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1787 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ENABLE
, 1);
1791 if (ctx
->ExecuteFlag
) {
1792 CALL_Enable(ctx
->Exec
, (cap
));
1798 static void GLAPIENTRY
1799 _mesa_save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
1801 GET_CURRENT_CONTEXT(ctx
);
1803 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1804 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVALMESH1
, 3);
1810 if (ctx
->ExecuteFlag
) {
1811 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
1816 static void GLAPIENTRY
1817 _mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1819 GET_CURRENT_CONTEXT(ctx
);
1821 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1822 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVALMESH2
, 5);
1830 if (ctx
->ExecuteFlag
) {
1831 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
1838 static void GLAPIENTRY
1839 save_Fogfv(GLenum pname
, const GLfloat
*params
)
1841 GET_CURRENT_CONTEXT(ctx
);
1843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1844 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FOG
, 5);
1852 if (ctx
->ExecuteFlag
) {
1853 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
1858 static void GLAPIENTRY
1859 save_Fogf(GLenum pname
, GLfloat param
)
1861 save_Fogfv(pname
, ¶m
);
1865 static void GLAPIENTRY
1866 save_Fogiv(GLenum pname
, const GLint
*params
)
1871 case GL_FOG_DENSITY
:
1875 p
[0] = (GLfloat
) *params
;
1878 p
[0] = INT_TO_FLOAT(params
[0]);
1879 p
[1] = INT_TO_FLOAT(params
[1]);
1880 p
[2] = INT_TO_FLOAT(params
[2]);
1881 p
[3] = INT_TO_FLOAT(params
[3]);
1884 /* Error will be caught later in gl_Fogfv */
1887 save_Fogfv(pname
, p
);
1891 static void GLAPIENTRY
1892 save_Fogi(GLenum pname
, GLint param
)
1894 save_Fogiv(pname
, ¶m
);
1898 static void GLAPIENTRY
1899 save_FrontFace(GLenum mode
)
1901 GET_CURRENT_CONTEXT(ctx
);
1903 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1904 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FRONT_FACE
, 1);
1908 if (ctx
->ExecuteFlag
) {
1909 CALL_FrontFace(ctx
->Exec
, (mode
));
1914 static void GLAPIENTRY
1915 save_Frustum(GLdouble left
, GLdouble right
,
1916 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
1918 GET_CURRENT_CONTEXT(ctx
);
1920 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1921 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FRUSTUM
, 6);
1923 n
[1].f
= (GLfloat
) left
;
1924 n
[2].f
= (GLfloat
) right
;
1925 n
[3].f
= (GLfloat
) bottom
;
1926 n
[4].f
= (GLfloat
) top
;
1927 n
[5].f
= (GLfloat
) nearval
;
1928 n
[6].f
= (GLfloat
) farval
;
1930 if (ctx
->ExecuteFlag
) {
1931 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
1936 static void GLAPIENTRY
1937 save_Hint(GLenum target
, GLenum mode
)
1939 GET_CURRENT_CONTEXT(ctx
);
1941 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1942 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_HINT
, 2);
1947 if (ctx
->ExecuteFlag
) {
1948 CALL_Hint(ctx
->Exec
, (target
, mode
));
1953 static void GLAPIENTRY
1954 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
1957 GET_CURRENT_CONTEXT(ctx
);
1960 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1961 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_HISTOGRAM
, 4);
1965 n
[3].e
= internalFormat
;
1968 if (ctx
->ExecuteFlag
) {
1969 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
1974 static void GLAPIENTRY
1975 save_IndexMask(GLuint mask
)
1977 GET_CURRENT_CONTEXT(ctx
);
1979 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1980 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_INDEX_MASK
, 1);
1984 if (ctx
->ExecuteFlag
) {
1985 CALL_IndexMask(ctx
->Exec
, (mask
));
1990 static void GLAPIENTRY
1991 save_InitNames(void)
1993 GET_CURRENT_CONTEXT(ctx
);
1994 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1995 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_INIT_NAMES
, 0);
1996 if (ctx
->ExecuteFlag
) {
1997 CALL_InitNames(ctx
->Exec
, ());
2002 static void GLAPIENTRY
2003 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2005 GET_CURRENT_CONTEXT(ctx
);
2007 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2008 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIGHT
, 6);
2026 case GL_SPOT_DIRECTION
:
2029 case GL_SPOT_EXPONENT
:
2032 case GL_SPOT_CUTOFF
:
2035 case GL_CONSTANT_ATTENUATION
:
2038 case GL_LINEAR_ATTENUATION
:
2041 case GL_QUADRATIC_ATTENUATION
:
2047 for (i
= 0; i
< nParams
; i
++) {
2048 n
[3 + i
].f
= params
[i
];
2051 if (ctx
->ExecuteFlag
) {
2052 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2057 static void GLAPIENTRY
2058 save_Lightf(GLenum light
, GLenum pname
, GLfloat params
)
2060 save_Lightfv(light
, pname
, ¶ms
);
2064 static void GLAPIENTRY
2065 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2072 fparam
[0] = INT_TO_FLOAT(params
[0]);
2073 fparam
[1] = INT_TO_FLOAT(params
[1]);
2074 fparam
[2] = INT_TO_FLOAT(params
[2]);
2075 fparam
[3] = INT_TO_FLOAT(params
[3]);
2078 fparam
[0] = (GLfloat
) params
[0];
2079 fparam
[1] = (GLfloat
) params
[1];
2080 fparam
[2] = (GLfloat
) params
[2];
2081 fparam
[3] = (GLfloat
) params
[3];
2083 case GL_SPOT_DIRECTION
:
2084 fparam
[0] = (GLfloat
) params
[0];
2085 fparam
[1] = (GLfloat
) params
[1];
2086 fparam
[2] = (GLfloat
) params
[2];
2088 case GL_SPOT_EXPONENT
:
2089 case GL_SPOT_CUTOFF
:
2090 case GL_CONSTANT_ATTENUATION
:
2091 case GL_LINEAR_ATTENUATION
:
2092 case GL_QUADRATIC_ATTENUATION
:
2093 fparam
[0] = (GLfloat
) params
[0];
2096 /* error will be caught later in gl_Lightfv */
2099 save_Lightfv(light
, pname
, fparam
);
2103 static void GLAPIENTRY
2104 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2106 save_Lightiv(light
, pname
, ¶m
);
2110 static void GLAPIENTRY
2111 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2113 GET_CURRENT_CONTEXT(ctx
);
2115 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2116 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIGHT_MODEL
, 5);
2124 if (ctx
->ExecuteFlag
) {
2125 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2130 static void GLAPIENTRY
2131 save_LightModelf(GLenum pname
, GLfloat param
)
2133 save_LightModelfv(pname
, ¶m
);
2137 static void GLAPIENTRY
2138 save_LightModeliv(GLenum pname
, const GLint
*params
)
2142 case GL_LIGHT_MODEL_AMBIENT
:
2143 fparam
[0] = INT_TO_FLOAT(params
[0]);
2144 fparam
[1] = INT_TO_FLOAT(params
[1]);
2145 fparam
[2] = INT_TO_FLOAT(params
[2]);
2146 fparam
[3] = INT_TO_FLOAT(params
[3]);
2148 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2149 case GL_LIGHT_MODEL_TWO_SIDE
:
2150 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2151 fparam
[0] = (GLfloat
) params
[0];
2154 /* Error will be caught later in gl_LightModelfv */
2157 save_LightModelfv(pname
, fparam
);
2161 static void GLAPIENTRY
2162 save_LightModeli(GLenum pname
, GLint param
)
2164 save_LightModeliv(pname
, ¶m
);
2168 static void GLAPIENTRY
2169 save_LineStipple(GLint factor
, GLushort pattern
)
2171 GET_CURRENT_CONTEXT(ctx
);
2173 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2174 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LINE_STIPPLE
, 2);
2179 if (ctx
->ExecuteFlag
) {
2180 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2185 static void GLAPIENTRY
2186 save_LineWidth(GLfloat width
)
2188 GET_CURRENT_CONTEXT(ctx
);
2190 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2191 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LINE_WIDTH
, 1);
2195 if (ctx
->ExecuteFlag
) {
2196 CALL_LineWidth(ctx
->Exec
, (width
));
2201 static void GLAPIENTRY
2202 save_ListBase(GLuint base
)
2204 GET_CURRENT_CONTEXT(ctx
);
2206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2207 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIST_BASE
, 1);
2211 if (ctx
->ExecuteFlag
) {
2212 CALL_ListBase(ctx
->Exec
, (base
));
2217 static void GLAPIENTRY
2218 save_LoadIdentity(void)
2220 GET_CURRENT_CONTEXT(ctx
);
2221 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2222 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2223 if (ctx
->ExecuteFlag
) {
2224 CALL_LoadIdentity(ctx
->Exec
, ());
2229 static void GLAPIENTRY
2230 save_LoadMatrixf(const GLfloat
* m
)
2232 GET_CURRENT_CONTEXT(ctx
);
2234 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2235 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_MATRIX
, 16);
2238 for (i
= 0; i
< 16; i
++) {
2242 if (ctx
->ExecuteFlag
) {
2243 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2248 static void GLAPIENTRY
2249 save_LoadMatrixd(const GLdouble
* m
)
2253 for (i
= 0; i
< 16; i
++) {
2254 f
[i
] = (GLfloat
) m
[i
];
2256 save_LoadMatrixf(f
);
2260 static void GLAPIENTRY
2261 save_LoadName(GLuint name
)
2263 GET_CURRENT_CONTEXT(ctx
);
2265 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2266 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_NAME
, 1);
2270 if (ctx
->ExecuteFlag
) {
2271 CALL_LoadName(ctx
->Exec
, (name
));
2276 static void GLAPIENTRY
2277 save_LogicOp(GLenum opcode
)
2279 GET_CURRENT_CONTEXT(ctx
);
2281 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2282 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOGIC_OP
, 1);
2286 if (ctx
->ExecuteFlag
) {
2287 CALL_LogicOp(ctx
->Exec
, (opcode
));
2292 static void GLAPIENTRY
2293 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2294 GLint order
, const GLdouble
* points
)
2296 GET_CURRENT_CONTEXT(ctx
);
2298 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2299 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP1
, 6);
2301 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2303 n
[2].f
= (GLfloat
) u1
;
2304 n
[3].f
= (GLfloat
) u2
;
2305 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2307 n
[6].data
= (void *) pnts
;
2309 if (ctx
->ExecuteFlag
) {
2310 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2314 static void GLAPIENTRY
2315 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2316 GLint order
, const GLfloat
* points
)
2318 GET_CURRENT_CONTEXT(ctx
);
2320 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2321 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP1
, 6);
2323 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2327 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2329 n
[6].data
= (void *) pnts
;
2331 if (ctx
->ExecuteFlag
) {
2332 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2337 static void GLAPIENTRY
2338 save_Map2d(GLenum target
,
2339 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2340 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2341 const GLdouble
* points
)
2343 GET_CURRENT_CONTEXT(ctx
);
2345 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2346 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP2
, 10);
2348 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2349 vstride
, vorder
, points
);
2351 n
[2].f
= (GLfloat
) u1
;
2352 n
[3].f
= (GLfloat
) u2
;
2353 n
[4].f
= (GLfloat
) v1
;
2354 n
[5].f
= (GLfloat
) v2
;
2355 /* XXX verify these strides are correct */
2356 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2357 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2360 n
[10].data
= (void *) pnts
;
2362 if (ctx
->ExecuteFlag
) {
2363 CALL_Map2d(ctx
->Exec
, (target
,
2364 u1
, u2
, ustride
, uorder
,
2365 v1
, v2
, vstride
, vorder
, points
));
2370 static void GLAPIENTRY
2371 save_Map2f(GLenum target
,
2372 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2373 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2374 const GLfloat
* points
)
2376 GET_CURRENT_CONTEXT(ctx
);
2378 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2379 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP2
, 10);
2381 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2382 vstride
, vorder
, points
);
2388 /* XXX verify these strides are correct */
2389 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2390 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2393 n
[10].data
= (void *) pnts
;
2395 if (ctx
->ExecuteFlag
) {
2396 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2397 v1
, v2
, vstride
, vorder
, points
));
2402 static void GLAPIENTRY
2403 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2405 GET_CURRENT_CONTEXT(ctx
);
2407 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2408 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAPGRID1
, 3);
2414 if (ctx
->ExecuteFlag
) {
2415 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2420 static void GLAPIENTRY
2421 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2423 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2427 static void GLAPIENTRY
2428 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2429 GLint vn
, GLfloat v1
, GLfloat v2
)
2431 GET_CURRENT_CONTEXT(ctx
);
2433 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2434 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAPGRID2
, 6);
2443 if (ctx
->ExecuteFlag
) {
2444 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2450 static void GLAPIENTRY
2451 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2452 GLint vn
, GLdouble v1
, GLdouble v2
)
2454 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2455 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2459 static void GLAPIENTRY
2460 save_MatrixMode(GLenum mode
)
2462 GET_CURRENT_CONTEXT(ctx
);
2464 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2465 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATRIX_MODE
, 1);
2469 if (ctx
->ExecuteFlag
) {
2470 CALL_MatrixMode(ctx
->Exec
, (mode
));
2475 static void GLAPIENTRY
2476 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2478 GET_CURRENT_CONTEXT(ctx
);
2481 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2482 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MIN_MAX
, 3);
2485 n
[2].e
= internalFormat
;
2488 if (ctx
->ExecuteFlag
) {
2489 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
2494 static void GLAPIENTRY
2495 save_MultMatrixf(const GLfloat
* m
)
2497 GET_CURRENT_CONTEXT(ctx
);
2499 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2500 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MULT_MATRIX
, 16);
2503 for (i
= 0; i
< 16; i
++) {
2507 if (ctx
->ExecuteFlag
) {
2508 CALL_MultMatrixf(ctx
->Exec
, (m
));
2513 static void GLAPIENTRY
2514 save_MultMatrixd(const GLdouble
* m
)
2518 for (i
= 0; i
< 16; i
++) {
2519 f
[i
] = (GLfloat
) m
[i
];
2521 save_MultMatrixf(f
);
2525 static void GLAPIENTRY
2526 save_NewList(GLuint name
, GLenum mode
)
2528 GET_CURRENT_CONTEXT(ctx
);
2529 /* It's an error to call this function while building a display list */
2530 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2537 static void GLAPIENTRY
2538 save_Ortho(GLdouble left
, GLdouble right
,
2539 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2541 GET_CURRENT_CONTEXT(ctx
);
2543 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2544 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ORTHO
, 6);
2546 n
[1].f
= (GLfloat
) left
;
2547 n
[2].f
= (GLfloat
) right
;
2548 n
[3].f
= (GLfloat
) bottom
;
2549 n
[4].f
= (GLfloat
) top
;
2550 n
[5].f
= (GLfloat
) nearval
;
2551 n
[6].f
= (GLfloat
) farval
;
2553 if (ctx
->ExecuteFlag
) {
2554 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2559 static void GLAPIENTRY
2560 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2562 GET_CURRENT_CONTEXT(ctx
);
2564 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2565 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_MAP
, 3);
2569 n
[3].data
= (void *) _mesa_malloc(mapsize
* sizeof(GLfloat
));
2570 MEMCPY(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
2572 if (ctx
->ExecuteFlag
) {
2573 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2578 static void GLAPIENTRY
2579 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2581 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2583 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2584 for (i
= 0; i
< mapsize
; i
++) {
2585 fvalues
[i
] = (GLfloat
) values
[i
];
2589 for (i
= 0; i
< mapsize
; i
++) {
2590 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2593 save_PixelMapfv(map
, mapsize
, fvalues
);
2597 static void GLAPIENTRY
2598 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2600 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2602 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2603 for (i
= 0; i
< mapsize
; i
++) {
2604 fvalues
[i
] = (GLfloat
) values
[i
];
2608 for (i
= 0; i
< mapsize
; i
++) {
2609 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
2612 save_PixelMapfv(map
, mapsize
, fvalues
);
2616 static void GLAPIENTRY
2617 save_PixelTransferf(GLenum pname
, GLfloat param
)
2619 GET_CURRENT_CONTEXT(ctx
);
2621 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2622 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2627 if (ctx
->ExecuteFlag
) {
2628 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
2633 static void GLAPIENTRY
2634 save_PixelTransferi(GLenum pname
, GLint param
)
2636 save_PixelTransferf(pname
, (GLfloat
) param
);
2640 static void GLAPIENTRY
2641 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
2643 GET_CURRENT_CONTEXT(ctx
);
2645 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2646 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_ZOOM
, 2);
2651 if (ctx
->ExecuteFlag
) {
2652 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
2657 static void GLAPIENTRY
2658 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
2660 GET_CURRENT_CONTEXT(ctx
);
2662 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2663 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POINT_PARAMETERS
, 4);
2670 if (ctx
->ExecuteFlag
) {
2671 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
2676 static void GLAPIENTRY
2677 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
2679 save_PointParameterfvEXT(pname
, ¶m
);
2682 static void GLAPIENTRY
2683 save_PointParameteriNV(GLenum pname
, GLint param
)
2685 GLfloat p
= (GLfloat
) param
;
2686 save_PointParameterfvEXT(pname
, &p
);
2689 static void GLAPIENTRY
2690 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
2692 GLfloat p
= (GLfloat
) param
[0];
2693 save_PointParameterfvEXT(pname
, &p
);
2697 static void GLAPIENTRY
2698 save_PointSize(GLfloat size
)
2700 GET_CURRENT_CONTEXT(ctx
);
2702 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2703 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POINT_SIZE
, 1);
2707 if (ctx
->ExecuteFlag
) {
2708 CALL_PointSize(ctx
->Exec
, (size
));
2713 static void GLAPIENTRY
2714 save_PolygonMode(GLenum face
, GLenum mode
)
2716 GET_CURRENT_CONTEXT(ctx
);
2718 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2719 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_MODE
, 2);
2724 if (ctx
->ExecuteFlag
) {
2725 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
2730 static void GLAPIENTRY
2731 save_PolygonStipple(const GLubyte
* pattern
)
2733 GET_CURRENT_CONTEXT(ctx
);
2734 GLvoid
*image
= unpack_image(2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
2735 pattern
, &ctx
->Unpack
);
2737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2738 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
2745 if (ctx
->ExecuteFlag
) {
2746 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
2751 static void GLAPIENTRY
2752 save_PolygonOffset(GLfloat factor
, GLfloat units
)
2754 GET_CURRENT_CONTEXT(ctx
);
2756 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2757 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_OFFSET
, 2);
2762 if (ctx
->ExecuteFlag
) {
2763 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
2768 static void GLAPIENTRY
2769 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
2771 GET_CURRENT_CONTEXT(ctx
);
2772 /* XXX mult by DepthMaxF here??? */
2773 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
2777 static void GLAPIENTRY
2778 save_PopAttrib(void)
2780 GET_CURRENT_CONTEXT(ctx
);
2781 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2782 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_ATTRIB
, 0);
2783 if (ctx
->ExecuteFlag
) {
2784 CALL_PopAttrib(ctx
->Exec
, ());
2789 static void GLAPIENTRY
2790 save_PopMatrix(void)
2792 GET_CURRENT_CONTEXT(ctx
);
2793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2794 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_MATRIX
, 0);
2795 if (ctx
->ExecuteFlag
) {
2796 CALL_PopMatrix(ctx
->Exec
, ());
2801 static void GLAPIENTRY
2804 GET_CURRENT_CONTEXT(ctx
);
2805 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2806 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_NAME
, 0);
2807 if (ctx
->ExecuteFlag
) {
2808 CALL_PopName(ctx
->Exec
, ());
2813 static void GLAPIENTRY
2814 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
2815 const GLclampf
* priorities
)
2817 GET_CURRENT_CONTEXT(ctx
);
2819 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2821 for (i
= 0; i
< num
; i
++) {
2823 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
2825 n
[1].ui
= textures
[i
];
2826 n
[2].f
= priorities
[i
];
2829 if (ctx
->ExecuteFlag
) {
2830 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
2835 static void GLAPIENTRY
2836 save_PushAttrib(GLbitfield mask
)
2838 GET_CURRENT_CONTEXT(ctx
);
2840 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2841 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_ATTRIB
, 1);
2845 if (ctx
->ExecuteFlag
) {
2846 CALL_PushAttrib(ctx
->Exec
, (mask
));
2851 static void GLAPIENTRY
2852 save_PushMatrix(void)
2854 GET_CURRENT_CONTEXT(ctx
);
2855 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2856 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_MATRIX
, 0);
2857 if (ctx
->ExecuteFlag
) {
2858 CALL_PushMatrix(ctx
->Exec
, ());
2863 static void GLAPIENTRY
2864 save_PushName(GLuint name
)
2866 GET_CURRENT_CONTEXT(ctx
);
2868 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2869 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_NAME
, 1);
2873 if (ctx
->ExecuteFlag
) {
2874 CALL_PushName(ctx
->Exec
, (name
));
2879 static void GLAPIENTRY
2880 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2882 GET_CURRENT_CONTEXT(ctx
);
2884 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2885 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RASTER_POS
, 4);
2892 if (ctx
->ExecuteFlag
) {
2893 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
2897 static void GLAPIENTRY
2898 save_RasterPos2d(GLdouble x
, GLdouble y
)
2900 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2903 static void GLAPIENTRY
2904 save_RasterPos2f(GLfloat x
, GLfloat y
)
2906 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2909 static void GLAPIENTRY
2910 save_RasterPos2i(GLint x
, GLint y
)
2912 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2915 static void GLAPIENTRY
2916 save_RasterPos2s(GLshort x
, GLshort y
)
2918 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2921 static void GLAPIENTRY
2922 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2924 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2927 static void GLAPIENTRY
2928 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2930 save_RasterPos4f(x
, y
, z
, 1.0F
);
2933 static void GLAPIENTRY
2934 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2936 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2939 static void GLAPIENTRY
2940 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2942 save_RasterPos4f(x
, y
, z
, 1.0F
);
2945 static void GLAPIENTRY
2946 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2948 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2951 static void GLAPIENTRY
2952 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
2954 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2957 static void GLAPIENTRY
2958 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
2960 save_RasterPos4f(x
, y
, z
, w
);
2963 static void GLAPIENTRY
2964 save_RasterPos2dv(const GLdouble
* v
)
2966 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2969 static void GLAPIENTRY
2970 save_RasterPos2fv(const GLfloat
* v
)
2972 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2975 static void GLAPIENTRY
2976 save_RasterPos2iv(const GLint
* v
)
2978 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2981 static void GLAPIENTRY
2982 save_RasterPos2sv(const GLshort
* v
)
2984 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2987 static void GLAPIENTRY
2988 save_RasterPos3dv(const GLdouble
* v
)
2990 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2993 static void GLAPIENTRY
2994 save_RasterPos3fv(const GLfloat
* v
)
2996 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
2999 static void GLAPIENTRY
3000 save_RasterPos3iv(const GLint
* v
)
3002 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3005 static void GLAPIENTRY
3006 save_RasterPos3sv(const GLshort
* v
)
3008 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3011 static void GLAPIENTRY
3012 save_RasterPos4dv(const GLdouble
* v
)
3014 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3015 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3018 static void GLAPIENTRY
3019 save_RasterPos4fv(const GLfloat
* v
)
3021 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3024 static void GLAPIENTRY
3025 save_RasterPos4iv(const GLint
* v
)
3027 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3028 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3031 static void GLAPIENTRY
3032 save_RasterPos4sv(const GLshort
* v
)
3034 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3038 static void GLAPIENTRY
3039 save_PassThrough(GLfloat token
)
3041 GET_CURRENT_CONTEXT(ctx
);
3043 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3044 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PASSTHROUGH
, 1);
3048 if (ctx
->ExecuteFlag
) {
3049 CALL_PassThrough(ctx
->Exec
, (token
));
3054 static void GLAPIENTRY
3055 save_ReadBuffer(GLenum mode
)
3057 GET_CURRENT_CONTEXT(ctx
);
3059 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3060 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_READ_BUFFER
, 1);
3064 if (ctx
->ExecuteFlag
) {
3065 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3070 static void GLAPIENTRY
3071 save_ResetHistogram(GLenum target
)
3073 GET_CURRENT_CONTEXT(ctx
);
3075 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3076 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3080 if (ctx
->ExecuteFlag
) {
3081 CALL_ResetHistogram(ctx
->Exec
, (target
));
3086 static void GLAPIENTRY
3087 save_ResetMinmax(GLenum target
)
3089 GET_CURRENT_CONTEXT(ctx
);
3091 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3092 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3096 if (ctx
->ExecuteFlag
) {
3097 CALL_ResetMinmax(ctx
->Exec
, (target
));
3102 static void GLAPIENTRY
3103 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3105 GET_CURRENT_CONTEXT(ctx
);
3107 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3108 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ROTATE
, 4);
3115 if (ctx
->ExecuteFlag
) {
3116 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3121 static void GLAPIENTRY
3122 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3124 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3128 static void GLAPIENTRY
3129 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3131 GET_CURRENT_CONTEXT(ctx
);
3133 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3134 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCALE
, 3);
3140 if (ctx
->ExecuteFlag
) {
3141 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3146 static void GLAPIENTRY
3147 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3149 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3153 static void GLAPIENTRY
3154 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3156 GET_CURRENT_CONTEXT(ctx
);
3158 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3159 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCISSOR
, 4);
3166 if (ctx
->ExecuteFlag
) {
3167 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3172 static void GLAPIENTRY
3173 save_ShadeModel(GLenum mode
)
3175 GET_CURRENT_CONTEXT(ctx
);
3177 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3178 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SHADE_MODEL
, 1);
3182 if (ctx
->ExecuteFlag
) {
3183 CALL_ShadeModel(ctx
->Exec
, (mode
));
3188 static void GLAPIENTRY
3189 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3191 GET_CURRENT_CONTEXT(ctx
);
3193 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3194 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC
, 3);
3200 if (ctx
->ExecuteFlag
) {
3201 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3206 static void GLAPIENTRY
3207 save_StencilMask(GLuint mask
)
3209 GET_CURRENT_CONTEXT(ctx
);
3211 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3212 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK
, 1);
3216 if (ctx
->ExecuteFlag
) {
3217 CALL_StencilMask(ctx
->Exec
, (mask
));
3222 static void GLAPIENTRY
3223 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3225 GET_CURRENT_CONTEXT(ctx
);
3227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3228 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP
, 3);
3234 if (ctx
->ExecuteFlag
) {
3235 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3240 static void GLAPIENTRY
3241 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3243 GET_CURRENT_CONTEXT(ctx
);
3245 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3246 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3253 if (ctx
->ExecuteFlag
) {
3254 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3259 static void GLAPIENTRY
3260 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3263 GET_CURRENT_CONTEXT(ctx
);
3265 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3267 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3275 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3282 if (ctx
->ExecuteFlag
) {
3283 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3284 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3289 static void GLAPIENTRY
3290 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3292 GET_CURRENT_CONTEXT(ctx
);
3294 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3295 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3300 if (ctx
->ExecuteFlag
) {
3301 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3306 static void GLAPIENTRY
3307 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3309 GET_CURRENT_CONTEXT(ctx
);
3311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3312 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3319 if (ctx
->ExecuteFlag
) {
3320 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3325 static void GLAPIENTRY
3326 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3328 GET_CURRENT_CONTEXT(ctx
);
3330 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3331 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXENV
, 6);
3335 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3343 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3346 if (ctx
->ExecuteFlag
) {
3347 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3352 static void GLAPIENTRY
3353 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3355 save_TexEnvfv(target
, pname
, ¶m
);
3359 static void GLAPIENTRY
3360 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3363 p
[0] = (GLfloat
) param
;
3364 p
[1] = p
[2] = p
[3] = 0.0;
3365 save_TexEnvfv(target
, pname
, p
);
3369 static void GLAPIENTRY
3370 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3373 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3374 p
[0] = INT_TO_FLOAT(param
[0]);
3375 p
[1] = INT_TO_FLOAT(param
[1]);
3376 p
[2] = INT_TO_FLOAT(param
[2]);
3377 p
[3] = INT_TO_FLOAT(param
[3]);
3380 p
[0] = (GLfloat
) param
[0];
3381 p
[1] = p
[2] = p
[3] = 0.0F
;
3383 save_TexEnvfv(target
, pname
, p
);
3387 static void GLAPIENTRY
3388 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3390 GET_CURRENT_CONTEXT(ctx
);
3392 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3393 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXGEN
, 6);
3402 if (ctx
->ExecuteFlag
) {
3403 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3408 static void GLAPIENTRY
3409 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3412 p
[0] = (GLfloat
) params
[0];
3413 p
[1] = (GLfloat
) params
[1];
3414 p
[2] = (GLfloat
) params
[2];
3415 p
[3] = (GLfloat
) params
[3];
3416 save_TexGenfv(coord
, pname
, p
);
3420 static void GLAPIENTRY
3421 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3423 GLfloat p
= (GLfloat
) param
;
3424 save_TexGenfv(coord
, pname
, &p
);
3428 static void GLAPIENTRY
3429 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3432 p
[0] = (GLfloat
) params
[0];
3433 p
[1] = (GLfloat
) params
[1];
3434 p
[2] = (GLfloat
) params
[2];
3435 p
[3] = (GLfloat
) params
[3];
3436 save_TexGenfv(coord
, pname
, p
);
3440 static void GLAPIENTRY
3441 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3443 save_TexGenfv(coord
, pname
, ¶m
);
3447 static void GLAPIENTRY
3448 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3450 save_TexGeniv(coord
, pname
, ¶m
);
3454 static void GLAPIENTRY
3455 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3457 GET_CURRENT_CONTEXT(ctx
);
3459 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3460 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXPARAMETER
, 6);
3469 if (ctx
->ExecuteFlag
) {
3470 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3475 static void GLAPIENTRY
3476 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3478 save_TexParameterfv(target
, pname
, ¶m
);
3482 static void GLAPIENTRY
3483 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3486 fparam
[0] = (GLfloat
) param
;
3487 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3488 save_TexParameterfv(target
, pname
, fparam
);
3492 static void GLAPIENTRY
3493 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3496 fparam
[0] = (GLfloat
) params
[0];
3497 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3498 save_TexParameterfv(target
, pname
, fparam
);
3502 static void GLAPIENTRY
3503 save_TexImage1D(GLenum target
,
3504 GLint level
, GLint components
,
3505 GLsizei width
, GLint border
,
3506 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3508 GET_CURRENT_CONTEXT(ctx
);
3509 if (target
== GL_PROXY_TEXTURE_1D
) {
3510 /* don't compile, execute immediately */
3511 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3512 border
, format
, type
, pixels
));
3515 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
,
3516 pixels
, &ctx
->Unpack
);
3518 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3519 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE1D
, 8);
3523 n
[3].i
= components
;
3524 n
[4].i
= (GLint
) width
;
3533 if (ctx
->ExecuteFlag
) {
3534 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3535 border
, format
, type
, pixels
));
3541 static void GLAPIENTRY
3542 save_TexImage2D(GLenum target
,
3543 GLint level
, GLint components
,
3544 GLsizei width
, GLsizei height
, GLint border
,
3545 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3547 GET_CURRENT_CONTEXT(ctx
);
3548 if (target
== GL_PROXY_TEXTURE_2D
) {
3549 /* don't compile, execute immediately */
3550 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3551 height
, border
, format
, type
, pixels
));
3554 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
3555 pixels
, &ctx
->Unpack
);
3557 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3558 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE2D
, 9);
3562 n
[3].i
= components
;
3563 n
[4].i
= (GLint
) width
;
3564 n
[5].i
= (GLint
) height
;
3573 if (ctx
->ExecuteFlag
) {
3574 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3575 height
, border
, format
, type
, pixels
));
3581 static void GLAPIENTRY
3582 save_TexImage3D(GLenum target
,
3583 GLint level
, GLint internalFormat
,
3584 GLsizei width
, GLsizei height
, GLsizei depth
,
3586 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3588 GET_CURRENT_CONTEXT(ctx
);
3589 if (target
== GL_PROXY_TEXTURE_3D
) {
3590 /* don't compile, execute immediately */
3591 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3592 height
, depth
, border
, format
, type
,
3597 GLvoid
*image
= unpack_image(3, width
, height
, depth
, format
, type
,
3598 pixels
, &ctx
->Unpack
);
3599 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3600 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE3D
, 10);
3604 n
[3].i
= (GLint
) internalFormat
;
3605 n
[4].i
= (GLint
) width
;
3606 n
[5].i
= (GLint
) height
;
3607 n
[6].i
= (GLint
) depth
;
3616 if (ctx
->ExecuteFlag
) {
3617 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3618 height
, depth
, border
, format
, type
,
3625 static void GLAPIENTRY
3626 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
3627 GLsizei width
, GLenum format
, GLenum type
,
3628 const GLvoid
* pixels
)
3630 GET_CURRENT_CONTEXT(ctx
);
3632 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
,
3633 pixels
, &ctx
->Unpack
);
3634 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3635 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
3640 n
[4].i
= (GLint
) width
;
3648 if (ctx
->ExecuteFlag
) {
3649 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
3650 format
, type
, pixels
));
3655 static void GLAPIENTRY
3656 save_TexSubImage2D(GLenum target
, GLint level
,
3657 GLint xoffset
, GLint yoffset
,
3658 GLsizei width
, GLsizei height
,
3659 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3661 GET_CURRENT_CONTEXT(ctx
);
3663 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
3664 pixels
, &ctx
->Unpack
);
3665 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3666 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
3672 n
[5].i
= (GLint
) width
;
3673 n
[6].i
= (GLint
) height
;
3681 if (ctx
->ExecuteFlag
) {
3682 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
3683 width
, height
, format
, type
, pixels
));
3688 static void GLAPIENTRY
3689 save_TexSubImage3D(GLenum target
, GLint level
,
3690 GLint xoffset
, GLint yoffset
, GLint zoffset
,
3691 GLsizei width
, GLsizei height
, GLsizei depth
,
3692 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3694 GET_CURRENT_CONTEXT(ctx
);
3696 GLvoid
*image
= unpack_image(3, width
, height
, depth
, format
, type
,
3697 pixels
, &ctx
->Unpack
);
3698 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3699 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
3706 n
[6].i
= (GLint
) width
;
3707 n
[7].i
= (GLint
) height
;
3708 n
[8].i
= (GLint
) depth
;
3716 if (ctx
->ExecuteFlag
) {
3717 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
3718 xoffset
, yoffset
, zoffset
,
3719 width
, height
, depth
, format
, type
,
3725 static void GLAPIENTRY
3726 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
3728 GET_CURRENT_CONTEXT(ctx
);
3730 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3731 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRANSLATE
, 3);
3737 if (ctx
->ExecuteFlag
) {
3738 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
3743 static void GLAPIENTRY
3744 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
3746 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3751 static void GLAPIENTRY
3752 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3754 GET_CURRENT_CONTEXT(ctx
);
3756 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3757 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_VIEWPORT
, 4);
3761 n
[3].i
= (GLint
) width
;
3762 n
[4].i
= (GLint
) height
;
3764 if (ctx
->ExecuteFlag
) {
3765 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
3770 static void GLAPIENTRY
3771 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3773 GET_CURRENT_CONTEXT(ctx
);
3775 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3776 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_WINDOW_POS
, 4);
3783 if (ctx
->ExecuteFlag
) {
3784 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
3788 static void GLAPIENTRY
3789 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3791 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3794 static void GLAPIENTRY
3795 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3797 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3800 static void GLAPIENTRY
3801 save_WindowPos2iMESA(GLint x
, GLint y
)
3803 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3806 static void GLAPIENTRY
3807 save_WindowPos2sMESA(GLshort x
, GLshort y
)
3809 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3812 static void GLAPIENTRY
3813 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3815 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3818 static void GLAPIENTRY
3819 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3821 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3824 static void GLAPIENTRY
3825 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3827 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3830 static void GLAPIENTRY
3831 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3833 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3836 static void GLAPIENTRY
3837 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3839 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3842 static void GLAPIENTRY
3843 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3845 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3848 static void GLAPIENTRY
3849 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3851 save_WindowPos4fMESA(x
, y
, z
, w
);
3854 static void GLAPIENTRY
3855 save_WindowPos2dvMESA(const GLdouble
* v
)
3857 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3860 static void GLAPIENTRY
3861 save_WindowPos2fvMESA(const GLfloat
* v
)
3863 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3866 static void GLAPIENTRY
3867 save_WindowPos2ivMESA(const GLint
* v
)
3869 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3872 static void GLAPIENTRY
3873 save_WindowPos2svMESA(const GLshort
* v
)
3875 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3878 static void GLAPIENTRY
3879 save_WindowPos3dvMESA(const GLdouble
* v
)
3881 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3884 static void GLAPIENTRY
3885 save_WindowPos3fvMESA(const GLfloat
* v
)
3887 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3890 static void GLAPIENTRY
3891 save_WindowPos3ivMESA(const GLint
* v
)
3893 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3896 static void GLAPIENTRY
3897 save_WindowPos3svMESA(const GLshort
* v
)
3899 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3902 static void GLAPIENTRY
3903 save_WindowPos4dvMESA(const GLdouble
* v
)
3905 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3906 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3909 static void GLAPIENTRY
3910 save_WindowPos4fvMESA(const GLfloat
* v
)
3912 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3915 static void GLAPIENTRY
3916 save_WindowPos4ivMESA(const GLint
* v
)
3918 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3919 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3922 static void GLAPIENTRY
3923 save_WindowPos4svMESA(const GLshort
* v
)
3925 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3930 /* GL_ARB_multitexture */
3931 static void GLAPIENTRY
3932 save_ActiveTextureARB(GLenum target
)
3934 GET_CURRENT_CONTEXT(ctx
);
3936 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3937 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
3941 if (ctx
->ExecuteFlag
) {
3942 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
3947 /* GL_ARB_transpose_matrix */
3949 static void GLAPIENTRY
3950 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
3953 _math_transposefd(tm
, m
);
3954 save_LoadMatrixf(tm
);
3958 static void GLAPIENTRY
3959 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
3962 _math_transposef(tm
, m
);
3963 save_LoadMatrixf(tm
);
3967 static void GLAPIENTRY
3968 save_MultTransposeMatrixdARB(const GLdouble m
[16])
3971 _math_transposefd(tm
, m
);
3972 save_MultMatrixf(tm
);
3976 static void GLAPIENTRY
3977 save_MultTransposeMatrixfARB(const GLfloat m
[16])
3980 _math_transposef(tm
, m
);
3981 save_MultMatrixf(tm
);
3985 /* GL_ARB_texture_compression */
3986 static void GLAPIENTRY
3987 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3988 GLenum internalFormat
, GLsizei width
,
3989 GLint border
, GLsizei imageSize
,
3990 const GLvoid
* data
)
3992 GET_CURRENT_CONTEXT(ctx
);
3993 if (target
== GL_PROXY_TEXTURE_1D
) {
3994 /* don't compile, execute immediately */
3995 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
3996 width
, border
, imageSize
,
4002 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4003 /* make copy of image */
4004 image
= _mesa_malloc(imageSize
);
4006 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
4009 MEMCPY(image
, data
, imageSize
);
4010 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4014 n
[3].e
= internalFormat
;
4015 n
[4].i
= (GLint
) width
;
4023 if (ctx
->ExecuteFlag
) {
4024 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4025 (target
, level
, internalFormat
, width
,
4026 border
, imageSize
, data
));
4032 static void GLAPIENTRY
4033 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4034 GLenum internalFormat
, GLsizei width
,
4035 GLsizei height
, GLint border
, GLsizei imageSize
,
4036 const GLvoid
* data
)
4038 GET_CURRENT_CONTEXT(ctx
);
4039 if (target
== GL_PROXY_TEXTURE_2D
) {
4040 /* don't compile, execute immediately */
4041 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4042 width
, height
, border
,
4048 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4049 /* make copy of image */
4050 image
= _mesa_malloc(imageSize
);
4052 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4055 MEMCPY(image
, data
, imageSize
);
4056 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4060 n
[3].e
= internalFormat
;
4061 n
[4].i
= (GLint
) width
;
4062 n
[5].i
= (GLint
) height
;
4070 if (ctx
->ExecuteFlag
) {
4071 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4072 (target
, level
, internalFormat
, width
,
4073 height
, border
, imageSize
, data
));
4079 static void GLAPIENTRY
4080 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4081 GLenum internalFormat
, GLsizei width
,
4082 GLsizei height
, GLsizei depth
, GLint border
,
4083 GLsizei imageSize
, const GLvoid
* data
)
4085 GET_CURRENT_CONTEXT(ctx
);
4086 if (target
== GL_PROXY_TEXTURE_3D
) {
4087 /* don't compile, execute immediately */
4088 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4089 width
, height
, depth
, border
,
4095 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4096 /* make copy of image */
4097 image
= _mesa_malloc(imageSize
);
4099 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4102 MEMCPY(image
, data
, imageSize
);
4103 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4107 n
[3].e
= internalFormat
;
4108 n
[4].i
= (GLint
) width
;
4109 n
[5].i
= (GLint
) height
;
4110 n
[6].i
= (GLint
) depth
;
4118 if (ctx
->ExecuteFlag
) {
4119 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4120 (target
, level
, internalFormat
, width
,
4121 height
, depth
, border
, imageSize
,
4128 static void GLAPIENTRY
4129 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4130 GLsizei width
, GLenum format
,
4131 GLsizei imageSize
, const GLvoid
* data
)
4136 GET_CURRENT_CONTEXT(ctx
);
4137 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4139 /* make copy of image */
4140 image
= _mesa_malloc(imageSize
);
4142 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4145 MEMCPY(image
, data
, imageSize
);
4146 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4151 n
[4].i
= (GLint
) width
;
4159 if (ctx
->ExecuteFlag
) {
4160 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4161 width
, format
, imageSize
,
4167 static void GLAPIENTRY
4168 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4169 GLint yoffset
, GLsizei width
, GLsizei height
,
4170 GLenum format
, GLsizei imageSize
,
4171 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
, "glCompressedTexSubImage2DARB");
4185 MEMCPY(image
, data
, imageSize
);
4186 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4192 n
[5].i
= (GLint
) width
;
4193 n
[6].i
= (GLint
) height
;
4201 if (ctx
->ExecuteFlag
) {
4202 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4203 (target
, level
, xoffset
, yoffset
, width
,
4204 height
, format
, imageSize
, data
));
4209 static void GLAPIENTRY
4210 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4211 GLint yoffset
, GLint zoffset
, GLsizei width
,
4212 GLsizei height
, GLsizei depth
, GLenum format
,
4213 GLsizei imageSize
, const GLvoid
* data
)
4218 GET_CURRENT_CONTEXT(ctx
);
4219 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4221 /* make copy of image */
4222 image
= _mesa_malloc(imageSize
);
4224 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4227 MEMCPY(image
, data
, imageSize
);
4228 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4235 n
[6].i
= (GLint
) width
;
4236 n
[7].i
= (GLint
) height
;
4237 n
[8].i
= (GLint
) depth
;
4239 n
[10].i
= imageSize
;
4245 if (ctx
->ExecuteFlag
) {
4246 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4247 (target
, level
, xoffset
, yoffset
,
4248 zoffset
, width
, height
, depth
, format
,
4254 /* GL_ARB_multisample */
4255 static void GLAPIENTRY
4256 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4258 GET_CURRENT_CONTEXT(ctx
);
4260 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4261 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4266 if (ctx
->ExecuteFlag
) {
4267 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4273 * GL_NV_vertex_program
4275 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4276 static void GLAPIENTRY
4277 save_BindProgramNV(GLenum target
, GLuint id
)
4279 GET_CURRENT_CONTEXT(ctx
);
4281 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4282 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4287 if (ctx
->ExecuteFlag
) {
4288 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4292 static void GLAPIENTRY
4293 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4294 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4296 GET_CURRENT_CONTEXT(ctx
);
4298 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4299 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4308 if (ctx
->ExecuteFlag
) {
4309 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4314 static void GLAPIENTRY
4315 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4316 const GLfloat
*params
)
4318 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4319 params
[2], params
[3]);
4323 static void GLAPIENTRY
4324 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4325 const GLfloat
* params
)
4327 GET_CURRENT_CONTEXT(ctx
);
4329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4333 const GLfloat
* p
= params
;
4335 for (i
= 0 ; i
< count
; i
++) {
4336 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4349 if (ctx
->ExecuteFlag
) {
4350 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4355 static void GLAPIENTRY
4356 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4357 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4359 save_ProgramEnvParameter4fARB(target
, index
,
4361 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4365 static void GLAPIENTRY
4366 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4367 const GLdouble
*params
)
4369 save_ProgramEnvParameter4fARB(target
, index
,
4370 (GLfloat
) params
[0],
4371 (GLfloat
) params
[1],
4372 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4375 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
4377 #if FEATURE_NV_vertex_program
4378 static void GLAPIENTRY
4379 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4381 GET_CURRENT_CONTEXT(ctx
);
4383 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4384 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4393 if (ctx
->ExecuteFlag
) {
4394 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4399 static void GLAPIENTRY
4400 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4401 GLuint num
, const GLdouble
*params
)
4404 for (i
= 0; i
< num
; i
++) {
4405 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4410 static void GLAPIENTRY
4411 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4412 GLuint num
, const GLfloat
*params
)
4415 for (i
= 0; i
< num
; i
++) {
4416 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4421 static void GLAPIENTRY
4422 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4423 const GLubyte
* program
)
4425 GET_CURRENT_CONTEXT(ctx
);
4427 GLubyte
*programCopy
;
4429 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4431 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4434 _mesa_memcpy(programCopy
, program
, len
);
4436 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4437 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4442 n
[4].data
= programCopy
;
4444 if (ctx
->ExecuteFlag
) {
4445 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4450 static void GLAPIENTRY
4451 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4453 GET_CURRENT_CONTEXT(ctx
);
4455 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4457 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4460 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4461 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4462 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4467 if (ctx
->ExecuteFlag
) {
4468 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4473 static void GLAPIENTRY
4474 save_TrackMatrixNV(GLenum target
, GLuint address
,
4475 GLenum matrix
, GLenum transform
)
4477 GET_CURRENT_CONTEXT(ctx
);
4479 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4480 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4487 if (ctx
->ExecuteFlag
) {
4488 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4491 #endif /* FEATURE_NV_vertex_program */
4495 * GL_NV_fragment_program
4497 #if FEATURE_NV_fragment_program
4498 static void GLAPIENTRY
4499 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4500 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4502 GET_CURRENT_CONTEXT(ctx
);
4504 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4505 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4514 if (ctx
->ExecuteFlag
) {
4515 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4520 static void GLAPIENTRY
4521 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4522 const GLfloat
*params
)
4524 GET_CURRENT_CONTEXT(ctx
);
4526 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4527 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4536 if (ctx
->ExecuteFlag
) {
4537 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4542 static void GLAPIENTRY
4543 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4544 const GLfloat
*params
)
4546 GET_CURRENT_CONTEXT(ctx
);
4548 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4552 const GLfloat
* p
= params
;
4554 for (i
= 0 ; i
< count
; i
++) {
4555 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4568 if (ctx
->ExecuteFlag
) {
4569 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4574 static void GLAPIENTRY
4575 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4576 GLdouble x
, GLdouble y
,
4577 GLdouble z
, GLdouble w
)
4579 GET_CURRENT_CONTEXT(ctx
);
4581 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4582 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4586 n
[3].f
= (GLfloat
) x
;
4587 n
[4].f
= (GLfloat
) y
;
4588 n
[5].f
= (GLfloat
) z
;
4589 n
[6].f
= (GLfloat
) w
;
4591 if (ctx
->ExecuteFlag
) {
4592 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4597 static void GLAPIENTRY
4598 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4599 const GLdouble
*params
)
4601 GET_CURRENT_CONTEXT(ctx
);
4603 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4604 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4608 n
[3].f
= (GLfloat
) params
[0];
4609 n
[4].f
= (GLfloat
) params
[1];
4610 n
[5].f
= (GLfloat
) params
[2];
4611 n
[6].f
= (GLfloat
) params
[3];
4613 if (ctx
->ExecuteFlag
) {
4614 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4618 static void GLAPIENTRY
4619 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4620 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4622 GET_CURRENT_CONTEXT(ctx
);
4624 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4626 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4629 _mesa_memcpy(nameCopy
, name
, len
);
4631 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4632 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
4636 n
[3].data
= nameCopy
;
4642 if (ctx
->ExecuteFlag
) {
4643 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
4648 static void GLAPIENTRY
4649 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4652 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4656 static void GLAPIENTRY
4657 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4658 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4660 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4661 (GLfloat
) z
, (GLfloat
) w
);
4665 static void GLAPIENTRY
4666 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4669 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4670 (GLfloat
) v
[1], (GLfloat
) v
[2],
4674 #endif /* FEATURE_NV_fragment_program */
4678 /* GL_EXT_stencil_two_side */
4679 static void GLAPIENTRY
4680 save_ActiveStencilFaceEXT(GLenum face
)
4682 GET_CURRENT_CONTEXT(ctx
);
4684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4685 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
4689 if (ctx
->ExecuteFlag
) {
4690 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
4695 /* GL_EXT_depth_bounds_test */
4696 static void GLAPIENTRY
4697 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
4699 GET_CURRENT_CONTEXT(ctx
);
4701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4702 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
4704 n
[1].f
= (GLfloat
) zmin
;
4705 n
[2].f
= (GLfloat
) zmax
;
4707 if (ctx
->ExecuteFlag
) {
4708 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
4714 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4716 static void GLAPIENTRY
4717 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4718 const GLvoid
* string
)
4720 GET_CURRENT_CONTEXT(ctx
);
4722 GLubyte
*programCopy
;
4724 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4726 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4729 _mesa_memcpy(programCopy
, string
, len
);
4731 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4732 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
4737 n
[4].data
= programCopy
;
4739 if (ctx
->ExecuteFlag
) {
4740 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
4744 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4747 #if FEATURE_ARB_occlusion_query
4749 static void GLAPIENTRY
4750 save_BeginQueryARB(GLenum target
, GLuint id
)
4752 GET_CURRENT_CONTEXT(ctx
);
4754 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4755 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
4760 if (ctx
->ExecuteFlag
) {
4761 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
4766 static void GLAPIENTRY
4767 save_EndQueryARB(GLenum target
)
4769 GET_CURRENT_CONTEXT(ctx
);
4771 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4772 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_END_QUERY_ARB
, 1);
4776 if (ctx
->ExecuteFlag
) {
4777 CALL_EndQueryARB(ctx
->Exec
, (target
));
4781 #endif /* FEATURE_ARB_occlusion_query */
4784 static void GLAPIENTRY
4785 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
4787 GET_CURRENT_CONTEXT(ctx
);
4789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4790 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
4794 if (count
> MAX_DRAW_BUFFERS
)
4795 count
= MAX_DRAW_BUFFERS
;
4796 for (i
= 0; i
< count
; i
++) {
4797 n
[2 + i
].e
= buffers
[i
];
4800 if (ctx
->ExecuteFlag
) {
4801 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
4805 #if FEATURE_ATI_fragment_shader
4806 static void GLAPIENTRY
4807 save_BindFragmentShaderATI(GLuint id
)
4809 GET_CURRENT_CONTEXT(ctx
);
4812 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
4816 if (ctx
->ExecuteFlag
) {
4817 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
4821 static void GLAPIENTRY
4822 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
4824 GET_CURRENT_CONTEXT(ctx
);
4827 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
4835 if (ctx
->ExecuteFlag
) {
4836 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
4842 save_Attr1fNV(GLenum attr
, GLfloat x
)
4844 GET_CURRENT_CONTEXT(ctx
);
4846 SAVE_FLUSH_VERTICES(ctx
);
4847 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_NV
, 2);
4853 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4854 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4855 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4857 if (ctx
->ExecuteFlag
) {
4858 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
4863 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
4865 GET_CURRENT_CONTEXT(ctx
);
4867 SAVE_FLUSH_VERTICES(ctx
);
4868 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_NV
, 3);
4875 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4876 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4877 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4879 if (ctx
->ExecuteFlag
) {
4880 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
4885 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4887 GET_CURRENT_CONTEXT(ctx
);
4889 SAVE_FLUSH_VERTICES(ctx
);
4890 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_NV
, 4);
4898 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4899 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4900 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4902 if (ctx
->ExecuteFlag
) {
4903 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
4908 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4910 GET_CURRENT_CONTEXT(ctx
);
4912 SAVE_FLUSH_VERTICES(ctx
);
4913 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_NV
, 5);
4922 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4923 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4924 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4926 if (ctx
->ExecuteFlag
) {
4927 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
4933 save_Attr1fARB(GLenum attr
, GLfloat x
)
4935 GET_CURRENT_CONTEXT(ctx
);
4937 SAVE_FLUSH_VERTICES(ctx
);
4938 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_ARB
, 2);
4944 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
4945 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4946 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4948 if (ctx
->ExecuteFlag
) {
4949 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
4954 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
4956 GET_CURRENT_CONTEXT(ctx
);
4958 SAVE_FLUSH_VERTICES(ctx
);
4959 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_ARB
, 3);
4966 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
4967 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4968 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4970 if (ctx
->ExecuteFlag
) {
4971 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
4976 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4978 GET_CURRENT_CONTEXT(ctx
);
4980 SAVE_FLUSH_VERTICES(ctx
);
4981 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_ARB
, 4);
4989 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
4990 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4991 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4993 if (ctx
->ExecuteFlag
) {
4994 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
4999 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5001 GET_CURRENT_CONTEXT(ctx
);
5003 SAVE_FLUSH_VERTICES(ctx
);
5004 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5013 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
5014 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5015 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5017 if (ctx
->ExecuteFlag
) {
5018 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5023 static void GLAPIENTRY
5024 save_EvalCoord1f(GLfloat x
)
5026 GET_CURRENT_CONTEXT(ctx
);
5028 SAVE_FLUSH_VERTICES(ctx
);
5029 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C1
, 1);
5033 if (ctx
->ExecuteFlag
) {
5034 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5038 static void GLAPIENTRY
5039 save_EvalCoord1fv(const GLfloat
* v
)
5041 save_EvalCoord1f(v
[0]);
5044 static void GLAPIENTRY
5045 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5047 GET_CURRENT_CONTEXT(ctx
);
5049 SAVE_FLUSH_VERTICES(ctx
);
5050 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C2
, 2);
5055 if (ctx
->ExecuteFlag
) {
5056 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5060 static void GLAPIENTRY
5061 save_EvalCoord2fv(const GLfloat
* v
)
5063 save_EvalCoord2f(v
[0], v
[1]);
5067 static void GLAPIENTRY
5068 save_EvalPoint1(GLint x
)
5070 GET_CURRENT_CONTEXT(ctx
);
5072 SAVE_FLUSH_VERTICES(ctx
);
5073 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P1
, 1);
5077 if (ctx
->ExecuteFlag
) {
5078 CALL_EvalPoint1(ctx
->Exec
, (x
));
5082 static void GLAPIENTRY
5083 save_EvalPoint2(GLint x
, GLint y
)
5085 GET_CURRENT_CONTEXT(ctx
);
5087 SAVE_FLUSH_VERTICES(ctx
);
5088 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P2
, 2);
5093 if (ctx
->ExecuteFlag
) {
5094 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5098 static void GLAPIENTRY
5099 save_Indexf(GLfloat x
)
5101 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5104 static void GLAPIENTRY
5105 save_Indexfv(const GLfloat
* v
)
5107 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5110 static void GLAPIENTRY
5111 save_EdgeFlag(GLboolean x
)
5113 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? (GLfloat
)1.0 : (GLfloat
)0.0);
5116 static void GLAPIENTRY
5117 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5119 GET_CURRENT_CONTEXT(ctx
);
5123 SAVE_FLUSH_VERTICES(ctx
);
5128 case GL_FRONT_AND_BACK
:
5131 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5140 case GL_AMBIENT_AND_DIFFUSE
:
5146 case GL_COLOR_INDEXES
:
5150 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5154 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATERIAL
, 6);
5158 for (i
= 0; i
< args
; i
++)
5159 n
[3 + i
].f
= param
[i
];
5163 GLuint bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5164 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
5165 if (bitmask
& (1 << i
)) {
5166 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5167 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5171 if (ctx
->ExecuteFlag
) {
5172 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5176 static void GLAPIENTRY
5177 save_Begin(GLenum mode
)
5179 GET_CURRENT_CONTEXT(ctx
);
5181 GLboolean error
= GL_FALSE
;
5183 if ( /*mode < GL_POINTS || */ mode
> GL_POLYGON
) {
5184 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5187 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5188 /* Typically the first begin. This may raise an error on
5189 * playback, depending on whether CallList is issued from inside
5190 * a begin/end or not.
5192 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5194 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5195 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5198 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5203 /* Give the driver an opportunity to hook in an optimized
5204 * display list compiler.
5206 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5209 SAVE_FLUSH_VERTICES(ctx
);
5210 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN
, 1);
5216 if (ctx
->ExecuteFlag
) {
5217 CALL_Begin(ctx
->Exec
, (mode
));
5221 static void GLAPIENTRY
5224 GET_CURRENT_CONTEXT(ctx
);
5225 SAVE_FLUSH_VERTICES(ctx
);
5226 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END
, 0);
5227 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5228 if (ctx
->ExecuteFlag
) {
5229 CALL_End(ctx
->Exec
, ());
5233 static void GLAPIENTRY
5234 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5236 GET_CURRENT_CONTEXT(ctx
);
5238 SAVE_FLUSH_VERTICES(ctx
);
5239 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RECTF
, 4);
5246 if (ctx
->ExecuteFlag
) {
5247 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5252 static void GLAPIENTRY
5253 save_Vertex2f(GLfloat x
, GLfloat y
)
5255 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5258 static void GLAPIENTRY
5259 save_Vertex2fv(const GLfloat
* v
)
5261 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5264 static void GLAPIENTRY
5265 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5267 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5270 static void GLAPIENTRY
5271 save_Vertex3fv(const GLfloat
* v
)
5273 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5276 static void GLAPIENTRY
5277 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5279 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5282 static void GLAPIENTRY
5283 save_Vertex4fv(const GLfloat
* v
)
5285 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5288 static void GLAPIENTRY
5289 save_TexCoord1f(GLfloat x
)
5291 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5294 static void GLAPIENTRY
5295 save_TexCoord1fv(const GLfloat
* v
)
5297 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5300 static void GLAPIENTRY
5301 save_TexCoord2f(GLfloat x
, GLfloat y
)
5303 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5306 static void GLAPIENTRY
5307 save_TexCoord2fv(const GLfloat
* v
)
5309 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5312 static void GLAPIENTRY
5313 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5315 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5318 static void GLAPIENTRY
5319 save_TexCoord3fv(const GLfloat
* v
)
5321 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5324 static void GLAPIENTRY
5325 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5327 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5330 static void GLAPIENTRY
5331 save_TexCoord4fv(const GLfloat
* v
)
5333 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5336 static void GLAPIENTRY
5337 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5339 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5342 static void GLAPIENTRY
5343 save_Normal3fv(const GLfloat
* v
)
5345 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5348 static void GLAPIENTRY
5349 save_FogCoordfEXT(GLfloat x
)
5351 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5354 static void GLAPIENTRY
5355 save_FogCoordfvEXT(const GLfloat
* v
)
5357 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5360 static void GLAPIENTRY
5361 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5363 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5366 static void GLAPIENTRY
5367 save_Color3fv(const GLfloat
* v
)
5369 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5372 static void GLAPIENTRY
5373 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5375 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5378 static void GLAPIENTRY
5379 save_Color4fv(const GLfloat
* v
)
5381 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5384 static void GLAPIENTRY
5385 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5387 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5390 static void GLAPIENTRY
5391 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5393 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5397 /* Just call the respective ATTR for texcoord
5399 static void GLAPIENTRY
5400 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5402 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5403 save_Attr1fNV(attr
, x
);
5406 static void GLAPIENTRY
5407 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5409 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5410 save_Attr1fNV(attr
, v
[0]);
5413 static void GLAPIENTRY
5414 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5416 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5417 save_Attr2fNV(attr
, x
, y
);
5420 static void GLAPIENTRY
5421 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5423 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5424 save_Attr2fNV(attr
, v
[0], v
[1]);
5427 static void GLAPIENTRY
5428 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5430 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5431 save_Attr3fNV(attr
, x
, y
, z
);
5434 static void GLAPIENTRY
5435 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5437 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5438 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5441 static void GLAPIENTRY
5442 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5443 GLfloat z
, GLfloat w
)
5445 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5446 save_Attr4fNV(attr
, x
, y
, z
, w
);
5449 static void GLAPIENTRY
5450 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5452 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5453 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5458 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5464 GET_CURRENT_CONTEXT(ctx
);
5465 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5469 /* First level for NV_vertex_program:
5471 * Check for errors at compile time?.
5473 static void GLAPIENTRY
5474 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
5476 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5477 save_Attr1fNV(index
, x
);
5482 static void GLAPIENTRY
5483 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
5485 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5486 save_Attr1fNV(index
, v
[0]);
5491 static void GLAPIENTRY
5492 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
5494 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5495 save_Attr2fNV(index
, x
, y
);
5500 static void GLAPIENTRY
5501 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
5503 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5504 save_Attr2fNV(index
, v
[0], v
[1]);
5509 static void GLAPIENTRY
5510 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5512 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5513 save_Attr3fNV(index
, x
, y
, z
);
5518 static void GLAPIENTRY
5519 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
5521 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5522 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
5527 static void GLAPIENTRY
5528 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
5529 GLfloat z
, GLfloat w
)
5531 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5532 save_Attr4fNV(index
, x
, y
, z
, w
);
5537 static void GLAPIENTRY
5538 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
5540 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5541 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
5549 static void GLAPIENTRY
5550 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5552 if (index
< MAX_VERTEX_ATTRIBS
)
5553 save_Attr1fARB(index
, x
);
5558 static void GLAPIENTRY
5559 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5561 if (index
< MAX_VERTEX_ATTRIBS
)
5562 save_Attr1fARB(index
, v
[0]);
5567 static void GLAPIENTRY
5568 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5570 if (index
< MAX_VERTEX_ATTRIBS
)
5571 save_Attr2fARB(index
, x
, y
);
5576 static void GLAPIENTRY
5577 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5579 if (index
< MAX_VERTEX_ATTRIBS
)
5580 save_Attr2fARB(index
, v
[0], v
[1]);
5585 static void GLAPIENTRY
5586 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5588 if (index
< MAX_VERTEX_ATTRIBS
)
5589 save_Attr3fARB(index
, x
, y
, z
);
5594 static void GLAPIENTRY
5595 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
5597 if (index
< MAX_VERTEX_ATTRIBS
)
5598 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
5603 static void GLAPIENTRY
5604 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
5607 if (index
< MAX_VERTEX_ATTRIBS
)
5608 save_Attr4fARB(index
, x
, y
, z
, w
);
5613 static void GLAPIENTRY
5614 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
5616 if (index
< MAX_VERTEX_ATTRIBS
)
5617 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
5623 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
5625 static void GLAPIENTRY
5626 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
5628 GET_CURRENT_CONTEXT(ctx
);
5629 FLUSH_VERTICES(ctx
, 0);
5630 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
5633 static GLint GLAPIENTRY
5634 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
5636 GET_CURRENT_CONTEXT(ctx
);
5637 FLUSH_VERTICES(ctx
, 0);
5638 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
5640 /* XXX more shader functions needed here */
5644 #if FEATURE_EXT_framebuffer_blit
5645 static void GLAPIENTRY
5646 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
5647 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
5648 GLbitfield mask
, GLenum filter
)
5650 GET_CURRENT_CONTEXT(ctx
);
5652 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5653 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
5666 if (ctx
->ExecuteFlag
) {
5667 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
5668 dstX0
, dstY0
, dstX1
, dstY1
,
5676 * Save an error-generating command into display list.
5678 * KW: Will appear in the list before the vertex buffer containing the
5679 * command that provoked the error. I don't see this as a problem.
5682 save_error(GLcontext
*ctx
, GLenum error
, const char *s
)
5685 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ERROR
, 2);
5688 n
[2].data
= (void *) s
;
5694 * Compile an error into current display list.
5697 _mesa_compile_error(GLcontext
*ctx
, GLenum error
, const char *s
)
5699 if (ctx
->CompileFlag
)
5700 save_error(ctx
, error
, s
);
5701 if (ctx
->ExecuteFlag
)
5702 _mesa_error(ctx
, error
, s
);
5707 * Test if ID names a display list.
5710 islist(GLcontext
*ctx
, GLuint list
)
5712 if (list
> 0 && lookup_list(ctx
, list
)) {
5722 /**********************************************************************/
5723 /* Display list execution */
5724 /**********************************************************************/
5728 * Execute a display list. Note that the ListBase offset must have already
5729 * been added before calling this function. I.e. the list argument is
5730 * the absolute list number, not relative to ListBase.
5731 * \param list - display list number
5734 execute_list(GLcontext
*ctx
, GLuint list
)
5736 struct gl_display_list
*dlist
;
5740 if (list
== 0 || !islist(ctx
, list
))
5743 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
5744 /* raise an error? */
5748 dlist
= lookup_list(ctx
, list
);
5752 ctx
->ListState
.CallDepth
++;
5754 if (ctx
->Driver
.BeginCallList
)
5755 ctx
->Driver
.BeginCallList(ctx
, dlist
);
5761 OpCode opcode
= n
[0].opcode
;
5762 int i
= (int) n
[0].opcode
- (int) OPCODE_EXT_0
;
5764 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
5765 /* this is a driver-extended opcode */
5766 ctx
->ListExt
.Opcode
[i
].Execute(ctx
, &n
[1]);
5767 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
5772 _mesa_error(ctx
, n
[1].e
, (const char *) n
[2].data
);
5775 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
5777 case OPCODE_ALPHA_FUNC
:
5778 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
5780 case OPCODE_BIND_TEXTURE
:
5781 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
5785 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5786 ctx
->Unpack
= ctx
->DefaultPacking
;
5787 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5788 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
5789 (const GLubyte
*) n
[7].data
));
5790 ctx
->Unpack
= save
; /* restore */
5793 case OPCODE_BLEND_COLOR
:
5794 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5796 case OPCODE_BLEND_EQUATION
:
5797 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
5799 case OPCODE_BLEND_EQUATION_SEPARATE
:
5800 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5802 case OPCODE_BLEND_FUNC_SEPARATE
:
5803 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
5804 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
5806 case OPCODE_CALL_LIST
:
5807 /* Generated by glCallList(), don't add ListBase */
5808 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5809 execute_list(ctx
, n
[1].ui
);
5812 case OPCODE_CALL_LIST_OFFSET
:
5813 /* Generated by glCallLists() so we must add ListBase */
5815 /* user specified a bad data type at compile time */
5816 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5818 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5819 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
5820 execute_list(ctx
, list
);
5824 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
5826 case OPCODE_CLEAR_COLOR
:
5827 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5829 case OPCODE_CLEAR_ACCUM
:
5830 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5832 case OPCODE_CLEAR_DEPTH
:
5833 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
5835 case OPCODE_CLEAR_INDEX
:
5836 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
5838 case OPCODE_CLEAR_STENCIL
:
5839 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
5841 case OPCODE_CLIP_PLANE
:
5848 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
5851 case OPCODE_COLOR_MASK
:
5852 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
5854 case OPCODE_COLOR_MATERIAL
:
5855 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5857 case OPCODE_COLOR_TABLE
:
5859 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5860 ctx
->Unpack
= ctx
->DefaultPacking
;
5861 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5862 n
[5].e
, n
[6].data
));
5863 ctx
->Unpack
= save
; /* restore */
5866 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
5873 CALL_ColorTableParameterfv(ctx
->Exec
,
5874 (n
[1].e
, n
[2].e
, params
));
5877 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
5884 CALL_ColorTableParameteriv(ctx
->Exec
,
5885 (n
[1].e
, n
[2].e
, params
));
5888 case OPCODE_COLOR_SUB_TABLE
:
5890 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5891 ctx
->Unpack
= ctx
->DefaultPacking
;
5892 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5893 n
[4].e
, n
[5].e
, n
[6].data
));
5894 ctx
->Unpack
= save
; /* restore */
5897 case OPCODE_CONVOLUTION_FILTER_1D
:
5899 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5900 ctx
->Unpack
= ctx
->DefaultPacking
;
5901 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5904 ctx
->Unpack
= save
; /* restore */
5907 case OPCODE_CONVOLUTION_FILTER_2D
:
5909 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5910 ctx
->Unpack
= ctx
->DefaultPacking
;
5911 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5912 n
[4].i
, n
[5].e
, n
[6].e
,
5914 ctx
->Unpack
= save
; /* restore */
5917 case OPCODE_CONVOLUTION_PARAMETER_I
:
5918 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
5920 case OPCODE_CONVOLUTION_PARAMETER_IV
:
5927 CALL_ConvolutionParameteriv(ctx
->Exec
,
5928 (n
[1].e
, n
[2].e
, params
));
5931 case OPCODE_CONVOLUTION_PARAMETER_F
:
5932 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
5934 case OPCODE_CONVOLUTION_PARAMETER_FV
:
5941 CALL_ConvolutionParameterfv(ctx
->Exec
,
5942 (n
[1].e
, n
[2].e
, params
));
5945 case OPCODE_COPY_COLOR_SUB_TABLE
:
5946 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
5947 n
[3].i
, n
[4].i
, n
[5].i
));
5949 case OPCODE_COPY_COLOR_TABLE
:
5950 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
5951 n
[3].i
, n
[4].i
, n
[5].i
));
5953 case OPCODE_COPY_PIXELS
:
5954 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
5955 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
5958 case OPCODE_COPY_TEX_IMAGE1D
:
5959 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5960 n
[5].i
, n
[6].i
, n
[7].i
));
5962 case OPCODE_COPY_TEX_IMAGE2D
:
5963 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5964 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
5966 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
5967 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5968 n
[4].i
, n
[5].i
, n
[6].i
));
5970 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
5971 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5972 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5975 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
5976 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5977 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5980 case OPCODE_CULL_FACE
:
5981 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
5983 case OPCODE_DEPTH_FUNC
:
5984 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
5986 case OPCODE_DEPTH_MASK
:
5987 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
5989 case OPCODE_DEPTH_RANGE
:
5990 CALL_DepthRange(ctx
->Exec
,
5991 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
5993 case OPCODE_DISABLE
:
5994 CALL_Disable(ctx
->Exec
, (n
[1].e
));
5996 case OPCODE_DRAW_BUFFER
:
5997 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
5999 case OPCODE_DRAW_PIXELS
:
6001 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6002 ctx
->Unpack
= ctx
->DefaultPacking
;
6003 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
6005 ctx
->Unpack
= save
; /* restore */
6009 CALL_Enable(ctx
->Exec
, (n
[1].e
));
6011 case OPCODE_EVALMESH1
:
6012 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
6014 case OPCODE_EVALMESH2
:
6015 CALL_EvalMesh2(ctx
->Exec
,
6016 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
6025 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
6028 case OPCODE_FRONT_FACE
:
6029 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
6031 case OPCODE_FRUSTUM
:
6032 CALL_Frustum(ctx
->Exec
,
6033 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6036 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6038 case OPCODE_HISTOGRAM
:
6039 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
6041 case OPCODE_INDEX_MASK
:
6042 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
6044 case OPCODE_INIT_NAMES
:
6045 CALL_InitNames(ctx
->Exec
, ());
6054 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
6057 case OPCODE_LIGHT_MODEL
:
6064 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
6067 case OPCODE_LINE_STIPPLE
:
6068 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
6070 case OPCODE_LINE_WIDTH
:
6071 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
6073 case OPCODE_LIST_BASE
:
6074 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
6076 case OPCODE_LOAD_IDENTITY
:
6077 CALL_LoadIdentity(ctx
->Exec
, ());
6079 case OPCODE_LOAD_MATRIX
:
6080 if (sizeof(Node
) == sizeof(GLfloat
)) {
6081 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
6086 for (i
= 0; i
< 16; i
++) {
6089 CALL_LoadMatrixf(ctx
->Exec
, (m
));
6092 case OPCODE_LOAD_NAME
:
6093 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
6095 case OPCODE_LOGIC_OP
:
6096 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
6100 GLenum target
= n
[1].e
;
6101 GLint ustride
= _mesa_evaluator_components(target
);
6102 GLint uorder
= n
[5].i
;
6103 GLfloat u1
= n
[2].f
;
6104 GLfloat u2
= n
[3].f
;
6105 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6106 (GLfloat
*) n
[6].data
));
6111 GLenum target
= n
[1].e
;
6112 GLfloat u1
= n
[2].f
;
6113 GLfloat u2
= n
[3].f
;
6114 GLfloat v1
= n
[4].f
;
6115 GLfloat v2
= n
[5].f
;
6116 GLint ustride
= n
[6].i
;
6117 GLint vstride
= n
[7].i
;
6118 GLint uorder
= n
[8].i
;
6119 GLint vorder
= n
[9].i
;
6120 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6121 v1
, v2
, vstride
, vorder
,
6122 (GLfloat
*) n
[10].data
));
6125 case OPCODE_MAPGRID1
:
6126 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
6128 case OPCODE_MAPGRID2
:
6129 CALL_MapGrid2f(ctx
->Exec
,
6130 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
6132 case OPCODE_MATRIX_MODE
:
6133 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
6135 case OPCODE_MIN_MAX
:
6136 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
6138 case OPCODE_MULT_MATRIX
:
6139 if (sizeof(Node
) == sizeof(GLfloat
)) {
6140 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
6145 for (i
= 0; i
< 16; i
++) {
6148 CALL_MultMatrixf(ctx
->Exec
, (m
));
6152 CALL_Ortho(ctx
->Exec
,
6153 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6155 case OPCODE_PASSTHROUGH
:
6156 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
6158 case OPCODE_PIXEL_MAP
:
6159 CALL_PixelMapfv(ctx
->Exec
,
6160 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
6162 case OPCODE_PIXEL_TRANSFER
:
6163 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6165 case OPCODE_PIXEL_ZOOM
:
6166 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6168 case OPCODE_POINT_SIZE
:
6169 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
6171 case OPCODE_POINT_PARAMETERS
:
6177 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
6180 case OPCODE_POLYGON_MODE
:
6181 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6183 case OPCODE_POLYGON_STIPPLE
:
6185 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6186 ctx
->Unpack
= ctx
->DefaultPacking
;
6187 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
6188 ctx
->Unpack
= save
; /* restore */
6191 case OPCODE_POLYGON_OFFSET
:
6192 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6194 case OPCODE_POP_ATTRIB
:
6195 CALL_PopAttrib(ctx
->Exec
, ());
6197 case OPCODE_POP_MATRIX
:
6198 CALL_PopMatrix(ctx
->Exec
, ());
6200 case OPCODE_POP_NAME
:
6201 CALL_PopName(ctx
->Exec
, ());
6203 case OPCODE_PRIORITIZE_TEXTURE
:
6204 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
6206 case OPCODE_PUSH_ATTRIB
:
6207 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
6209 case OPCODE_PUSH_MATRIX
:
6210 CALL_PushMatrix(ctx
->Exec
, ());
6212 case OPCODE_PUSH_NAME
:
6213 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
6215 case OPCODE_RASTER_POS
:
6216 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6218 case OPCODE_READ_BUFFER
:
6219 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
6221 case OPCODE_RESET_HISTOGRAM
:
6222 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
6224 case OPCODE_RESET_MIN_MAX
:
6225 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
6228 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6231 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6233 case OPCODE_SCISSOR
:
6234 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
6236 case OPCODE_SHADE_MODEL
:
6237 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
6239 case OPCODE_STENCIL_FUNC
:
6240 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
6242 case OPCODE_STENCIL_MASK
:
6243 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
6245 case OPCODE_STENCIL_OP
:
6246 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
6248 case OPCODE_STENCIL_FUNC_SEPARATE
:
6249 CALL_StencilFuncSeparate(ctx
->Exec
,
6250 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
6252 case OPCODE_STENCIL_MASK_SEPARATE
:
6253 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6255 case OPCODE_STENCIL_OP_SEPARATE
:
6256 CALL_StencilOpSeparate(ctx
->Exec
,
6257 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6266 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6276 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6279 case OPCODE_TEXPARAMETER
:
6286 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6289 case OPCODE_TEX_IMAGE1D
:
6291 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6292 ctx
->Unpack
= ctx
->DefaultPacking
;
6293 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
6295 n
[3].i
, /* components */
6297 n
[5].e
, /* border */
6298 n
[6].e
, /* format */
6301 ctx
->Unpack
= save
; /* restore */
6304 case OPCODE_TEX_IMAGE2D
:
6306 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6307 ctx
->Unpack
= ctx
->DefaultPacking
;
6308 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
6310 n
[3].i
, /* components */
6312 n
[5].i
, /* height */
6313 n
[6].e
, /* border */
6314 n
[7].e
, /* format */
6317 ctx
->Unpack
= save
; /* restore */
6320 case OPCODE_TEX_IMAGE3D
:
6322 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6323 ctx
->Unpack
= ctx
->DefaultPacking
;
6324 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
6326 n
[3].i
, /* components */
6328 n
[5].i
, /* height */
6330 n
[7].e
, /* border */
6331 n
[8].e
, /* format */
6334 ctx
->Unpack
= save
; /* restore */
6337 case OPCODE_TEX_SUB_IMAGE1D
:
6339 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6340 ctx
->Unpack
= ctx
->DefaultPacking
;
6341 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6343 n
[6].e
, n
[7].data
));
6344 ctx
->Unpack
= save
; /* restore */
6347 case OPCODE_TEX_SUB_IMAGE2D
:
6349 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6350 ctx
->Unpack
= ctx
->DefaultPacking
;
6351 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6353 n
[6].i
, n
[7].e
, n
[8].e
,
6355 ctx
->Unpack
= save
; /* restore */
6358 case OPCODE_TEX_SUB_IMAGE3D
:
6360 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6361 ctx
->Unpack
= ctx
->DefaultPacking
;
6362 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6363 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6364 n
[8].i
, n
[9].e
, n
[10].e
,
6366 ctx
->Unpack
= save
; /* restore */
6369 case OPCODE_TRANSLATE
:
6370 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6372 case OPCODE_VIEWPORT
:
6373 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6374 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
6376 case OPCODE_WINDOW_POS
:
6377 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6379 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
6380 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
6382 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
6383 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6384 n
[4].i
, n
[5].i
, n
[6].i
,
6387 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
6388 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6389 n
[4].i
, n
[5].i
, n
[6].i
,
6390 n
[7].i
, n
[8].data
));
6392 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
6393 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6394 n
[4].i
, n
[5].i
, n
[6].i
,
6398 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
6399 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
6400 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6401 n
[5].e
, n
[6].i
, n
[7].data
));
6403 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
6404 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
6405 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6406 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
6409 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
6410 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
6411 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6412 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6413 n
[9].e
, n
[10].i
, n
[11].data
));
6415 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
6416 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
6418 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
6419 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6421 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6422 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
6423 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6426 #if FEATURE_NV_vertex_program
6427 case OPCODE_EXECUTE_PROGRAM_NV
:
6434 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
6437 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
6438 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
6439 (GLuint
*) n
[2].data
));
6441 case OPCODE_LOAD_PROGRAM_NV
:
6442 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
6443 (const GLubyte
*) n
[4].data
));
6445 case OPCODE_TRACK_MATRIX_NV
:
6446 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
6450 #if FEATURE_NV_fragment_program
6451 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
6452 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
6453 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
6456 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
6457 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
6458 (const GLubyte
*) n
[3].
6459 data
, n
[4].f
, n
[5].f
,
6464 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
6465 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
6467 case OPCODE_DEPTH_BOUNDS_EXT
:
6468 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6470 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6471 case OPCODE_PROGRAM_STRING_ARB
:
6472 CALL_ProgramStringARB(ctx
->Exec
,
6473 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
6476 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
6477 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
6478 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6483 #if FEATURE_ARB_occlusion_query
6484 case OPCODE_BEGIN_QUERY_ARB
:
6485 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6487 case OPCODE_END_QUERY_ARB
:
6488 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
6491 case OPCODE_DRAW_BUFFERS_ARB
:
6493 GLenum buffers
[MAX_DRAW_BUFFERS
];
6494 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
6495 for (i
= 0; i
< count
; i
++)
6496 buffers
[i
] = n
[2 + i
].e
;
6497 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
6500 #if FEATURE_EXT_framebuffer_blit
6501 case OPCODE_BLIT_FRAMEBUFFER
:
6502 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
6503 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6507 #if FEATURE_ATI_fragment_shader
6508 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
6509 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
6511 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
6514 GLuint i
, dst
= n
[1].ui
;
6516 for (i
= 0; i
< 4; i
++)
6517 values
[i
] = n
[1 + i
].f
;
6518 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
6522 case OPCODE_ATTR_1F_NV
:
6523 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6525 case OPCODE_ATTR_2F_NV
:
6526 /* Really shouldn't have to do this - the Node structure
6527 * is convenient, but it would be better to store the data
6528 * packed appropriately so that it can be sent directly
6529 * on. With x86_64 becoming common, this will start to
6532 if (sizeof(Node
) == sizeof(GLfloat
))
6533 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6535 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6537 case OPCODE_ATTR_3F_NV
:
6538 if (sizeof(Node
) == sizeof(GLfloat
))
6539 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6541 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6544 case OPCODE_ATTR_4F_NV
:
6545 if (sizeof(Node
) == sizeof(GLfloat
))
6546 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6548 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6551 case OPCODE_ATTR_1F_ARB
:
6552 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6554 case OPCODE_ATTR_2F_ARB
:
6555 /* Really shouldn't have to do this - the Node structure
6556 * is convenient, but it would be better to store the data
6557 * packed appropriately so that it can be sent directly
6558 * on. With x86_64 becoming common, this will start to
6561 if (sizeof(Node
) == sizeof(GLfloat
))
6562 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6564 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6566 case OPCODE_ATTR_3F_ARB
:
6567 if (sizeof(Node
) == sizeof(GLfloat
))
6568 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6570 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6573 case OPCODE_ATTR_4F_ARB
:
6574 if (sizeof(Node
) == sizeof(GLfloat
))
6575 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6577 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6580 case OPCODE_MATERIAL
:
6581 if (sizeof(Node
) == sizeof(GLfloat
))
6582 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
6589 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
6593 CALL_Begin(ctx
->Exec
, (n
[1].e
));
6596 CALL_End(ctx
->Exec
, ());
6599 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6601 case OPCODE_EVAL_C1
:
6602 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
6604 case OPCODE_EVAL_C2
:
6605 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6607 case OPCODE_EVAL_P1
:
6608 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
6610 case OPCODE_EVAL_P2
:
6611 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
6614 case OPCODE_CONTINUE
:
6615 n
= (Node
*) n
[1].next
;
6617 case OPCODE_END_OF_LIST
:
6623 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d",
6625 _mesa_problem(ctx
, msg
);
6630 /* increment n to point to next compiled command */
6631 if (opcode
!= OPCODE_CONTINUE
) {
6632 n
+= InstSize
[opcode
];
6637 if (ctx
->Driver
.EndCallList
)
6638 ctx
->Driver
.EndCallList(ctx
);
6640 ctx
->ListState
.CallDepth
--;
6645 /**********************************************************************/
6647 /**********************************************************************/
6650 * Test if a display list number is valid.
6652 GLboolean GLAPIENTRY
6653 _mesa_IsList(GLuint list
)
6655 GET_CURRENT_CONTEXT(ctx
);
6656 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6657 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6658 return islist(ctx
, list
);
6663 * Delete a sequence of consecutive display lists.
6666 _mesa_DeleteLists(GLuint list
, GLsizei range
)
6668 GET_CURRENT_CONTEXT(ctx
);
6670 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6671 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6674 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
6677 for (i
= list
; i
< list
+ range
; i
++) {
6678 destroy_list(ctx
, i
);
6684 * Return a display list number, n, such that lists n through n+range-1
6688 _mesa_GenLists(GLsizei range
)
6690 GET_CURRENT_CONTEXT(ctx
);
6692 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6693 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6696 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
6704 * Make this an atomic operation
6706 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6708 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6710 /* reserve the list IDs by with empty/dummy lists */
6712 for (i
= 0; i
< range
; i
++) {
6713 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
6714 make_list(base
+ i
, 1));
6718 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6725 * Begin a new display list.
6728 _mesa_NewList(GLuint name
, GLenum mode
)
6730 GET_CURRENT_CONTEXT(ctx
);
6733 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6734 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6736 if (MESA_VERBOSE
& VERBOSE_API
)
6737 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
6738 _mesa_lookup_enum_by_nr(mode
));
6741 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
6745 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
6746 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
6750 if (ctx
->ListState
.CurrentList
) {
6751 /* already compiling a display list */
6752 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
6756 ctx
->CompileFlag
= GL_TRUE
;
6757 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6759 /* Allocate new display list */
6760 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
6761 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
6762 ctx
->ListState
.CurrentPos
= 0;
6764 /* Reset acumulated list state:
6766 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
6767 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
6769 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
6770 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
6772 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
6773 ctx
->Driver
.NewList(ctx
, name
, mode
);
6775 ctx
->CurrentDispatch
= ctx
->Save
;
6776 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6781 * End definition of current display list.
6786 GET_CURRENT_CONTEXT(ctx
);
6787 SAVE_FLUSH_VERTICES(ctx
);
6788 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6790 if (MESA_VERBOSE
& VERBOSE_API
)
6791 _mesa_debug(ctx
, "glEndList\n");
6793 /* Check that a list is under construction */
6794 if (!ctx
->ListState
.CurrentList
) {
6795 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
6799 /* Call before emitting END_OF_LIST, in case the driver wants to
6800 * emit opcodes itself.
6802 ctx
->Driver
.EndList(ctx
);
6804 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END_OF_LIST
, 0);
6806 /* Destroy old list, if any */
6807 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
6809 /* Install the new list */
6810 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
6811 ctx
->ListState
.CurrentList
->Name
,
6812 ctx
->ListState
.CurrentList
);
6815 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6816 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
6818 ctx
->ListState
.CurrentList
= NULL
;
6819 ctx
->ExecuteFlag
= GL_TRUE
;
6820 ctx
->CompileFlag
= GL_FALSE
;
6822 ctx
->CurrentDispatch
= ctx
->Exec
;
6823 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6828 _mesa_CallList(GLuint list
)
6830 GLboolean save_compile_flag
;
6831 GET_CURRENT_CONTEXT(ctx
);
6832 FLUSH_CURRENT(ctx
, 0);
6833 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6834 /* execute the display list, and restore the CompileFlag. */
6836 if (MESA_VERBOSE
& VERBOSE_API
)
6837 _mesa_debug(ctx
, "glCallList %d\n", list
);
6840 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6844 /* mesa_print_display_list( list ); */
6846 save_compile_flag
= ctx
->CompileFlag
;
6847 if (save_compile_flag
) {
6848 ctx
->CompileFlag
= GL_FALSE
;
6851 execute_list(ctx
, list
);
6852 ctx
->CompileFlag
= save_compile_flag
;
6854 /* also restore API function pointers to point to "save" versions */
6855 if (save_compile_flag
) {
6856 ctx
->CurrentDispatch
= ctx
->Save
;
6857 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6863 * Execute glCallLists: call multiple display lists.
6866 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
6868 GET_CURRENT_CONTEXT(ctx
);
6870 GLboolean save_compile_flag
;
6872 if (MESA_VERBOSE
& VERBOSE_API
)
6873 _mesa_debug(ctx
, "glCallLists %d\n", n
);
6877 case GL_UNSIGNED_BYTE
:
6879 case GL_UNSIGNED_SHORT
:
6881 case GL_UNSIGNED_INT
:
6889 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6893 /* Save the CompileFlag status, turn it off, execute display list,
6894 * and restore the CompileFlag.
6896 save_compile_flag
= ctx
->CompileFlag
;
6897 ctx
->CompileFlag
= GL_FALSE
;
6899 for (i
= 0; i
< n
; i
++) {
6900 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
6901 execute_list(ctx
, list
);
6904 ctx
->CompileFlag
= save_compile_flag
;
6906 /* also restore API function pointers to point to "save" versions */
6907 if (save_compile_flag
) {
6908 ctx
->CurrentDispatch
= ctx
->Save
;
6909 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6915 * Set the offset added to list numbers in glCallLists.
6918 _mesa_ListBase(GLuint base
)
6920 GET_CURRENT_CONTEXT(ctx
);
6921 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6922 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6923 ctx
->List
.ListBase
= base
;
6927 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
6929 static void GLAPIENTRY
6932 GET_CURRENT_CONTEXT(ctx
);
6933 FLUSH_VERTICES(ctx
, 0);
6934 CALL_Finish(ctx
->Exec
, ());
6937 static void GLAPIENTRY
6940 GET_CURRENT_CONTEXT(ctx
);
6941 FLUSH_VERTICES(ctx
, 0);
6942 CALL_Flush(ctx
->Exec
, ());
6945 static void GLAPIENTRY
6946 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
6948 GET_CURRENT_CONTEXT(ctx
);
6949 FLUSH_VERTICES(ctx
, 0);
6950 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
6953 static void GLAPIENTRY
6954 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
6956 GET_CURRENT_CONTEXT(ctx
);
6957 FLUSH_VERTICES(ctx
, 0);
6958 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
6961 static void GLAPIENTRY
6962 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
6964 GET_CURRENT_CONTEXT(ctx
);
6965 FLUSH_VERTICES(ctx
, 0);
6966 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
6969 static GLenum GLAPIENTRY
6972 GET_CURRENT_CONTEXT(ctx
);
6973 FLUSH_VERTICES(ctx
, 0);
6974 return CALL_GetError(ctx
->Exec
, ());
6977 static void GLAPIENTRY
6978 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
6980 GET_CURRENT_CONTEXT(ctx
);
6981 FLUSH_VERTICES(ctx
, 0);
6982 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
6985 static void GLAPIENTRY
6986 exec_GetIntegerv(GLenum pname
, GLint
*params
)
6988 GET_CURRENT_CONTEXT(ctx
);
6989 FLUSH_VERTICES(ctx
, 0);
6990 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
6993 static void GLAPIENTRY
6994 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
6996 GET_CURRENT_CONTEXT(ctx
);
6997 FLUSH_VERTICES(ctx
, 0);
6998 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
7001 static void GLAPIENTRY
7002 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
7004 GET_CURRENT_CONTEXT(ctx
);
7005 FLUSH_VERTICES(ctx
, 0);
7006 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
7009 static void GLAPIENTRY
7010 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
7012 GET_CURRENT_CONTEXT(ctx
);
7013 FLUSH_VERTICES(ctx
, 0);
7014 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
7017 static void GLAPIENTRY
7018 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
7020 GET_CURRENT_CONTEXT(ctx
);
7021 FLUSH_VERTICES(ctx
, 0);
7022 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
7025 static void GLAPIENTRY
7026 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
7028 GET_CURRENT_CONTEXT(ctx
);
7029 FLUSH_VERTICES(ctx
, 0);
7030 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
7033 static void GLAPIENTRY
7034 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
7036 GET_CURRENT_CONTEXT(ctx
);
7037 FLUSH_VERTICES(ctx
, 0);
7038 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
7041 static void GLAPIENTRY
7042 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
7044 GET_CURRENT_CONTEXT(ctx
);
7045 FLUSH_VERTICES(ctx
, 0);
7046 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
7049 static void GLAPIENTRY
7050 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
7052 GET_CURRENT_CONTEXT(ctx
);
7053 FLUSH_VERTICES(ctx
, 0);
7054 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
7057 static void GLAPIENTRY
7058 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
7060 GET_CURRENT_CONTEXT(ctx
);
7061 FLUSH_VERTICES(ctx
, 0);
7062 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
7065 static void GLAPIENTRY
7066 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
7068 GET_CURRENT_CONTEXT(ctx
);
7069 FLUSH_VERTICES(ctx
, 0);
7070 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
7073 static void GLAPIENTRY
7074 exec_GetPolygonStipple(GLubyte
* dest
)
7076 GET_CURRENT_CONTEXT(ctx
);
7077 FLUSH_VERTICES(ctx
, 0);
7078 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
7081 static const GLubyte
*GLAPIENTRY
7082 exec_GetString(GLenum name
)
7084 GET_CURRENT_CONTEXT(ctx
);
7085 FLUSH_VERTICES(ctx
, 0);
7086 return CALL_GetString(ctx
->Exec
, (name
));
7089 static void GLAPIENTRY
7090 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7092 GET_CURRENT_CONTEXT(ctx
);
7093 FLUSH_VERTICES(ctx
, 0);
7094 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
7097 static void GLAPIENTRY
7098 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
7100 GET_CURRENT_CONTEXT(ctx
);
7101 FLUSH_VERTICES(ctx
, 0);
7102 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
7105 static void GLAPIENTRY
7106 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
7108 GET_CURRENT_CONTEXT(ctx
);
7109 FLUSH_VERTICES(ctx
, 0);
7110 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
7113 static void GLAPIENTRY
7114 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
7116 GET_CURRENT_CONTEXT(ctx
);
7117 FLUSH_VERTICES(ctx
, 0);
7118 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
7121 static void GLAPIENTRY
7122 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
7124 GET_CURRENT_CONTEXT(ctx
);
7125 FLUSH_VERTICES(ctx
, 0);
7126 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
7129 static void GLAPIENTRY
7130 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
7131 GLenum type
, GLvoid
* pixels
)
7133 GET_CURRENT_CONTEXT(ctx
);
7134 FLUSH_VERTICES(ctx
, 0);
7135 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
7138 static void GLAPIENTRY
7139 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
7140 GLenum pname
, GLfloat
*params
)
7142 GET_CURRENT_CONTEXT(ctx
);
7143 FLUSH_VERTICES(ctx
, 0);
7144 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
7147 static void GLAPIENTRY
7148 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
7149 GLenum pname
, GLint
*params
)
7151 GET_CURRENT_CONTEXT(ctx
);
7152 FLUSH_VERTICES(ctx
, 0);
7153 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
7156 static void GLAPIENTRY
7157 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7159 GET_CURRENT_CONTEXT(ctx
);
7160 FLUSH_VERTICES(ctx
, 0);
7161 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
7164 static void GLAPIENTRY
7165 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7167 GET_CURRENT_CONTEXT(ctx
);
7168 FLUSH_VERTICES(ctx
, 0);
7169 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
7172 static GLboolean GLAPIENTRY
7173 exec_IsEnabled(GLenum cap
)
7175 GET_CURRENT_CONTEXT(ctx
);
7176 FLUSH_VERTICES(ctx
, 0);
7177 return CALL_IsEnabled(ctx
->Exec
, (cap
));
7180 static void GLAPIENTRY
7181 exec_PixelStoref(GLenum pname
, GLfloat param
)
7183 GET_CURRENT_CONTEXT(ctx
);
7184 FLUSH_VERTICES(ctx
, 0);
7185 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
7188 static void GLAPIENTRY
7189 exec_PixelStorei(GLenum pname
, GLint param
)
7191 GET_CURRENT_CONTEXT(ctx
);
7192 FLUSH_VERTICES(ctx
, 0);
7193 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
7196 static void GLAPIENTRY
7197 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
7198 GLenum format
, GLenum type
, GLvoid
* pixels
)
7200 GET_CURRENT_CONTEXT(ctx
);
7201 FLUSH_VERTICES(ctx
, 0);
7202 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
7205 static GLint GLAPIENTRY
7206 exec_RenderMode(GLenum mode
)
7208 GET_CURRENT_CONTEXT(ctx
);
7209 FLUSH_VERTICES(ctx
, 0);
7210 return CALL_RenderMode(ctx
->Exec
, (mode
));
7213 static void GLAPIENTRY
7214 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
7216 GET_CURRENT_CONTEXT(ctx
);
7217 FLUSH_VERTICES(ctx
, 0);
7218 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
7221 static void GLAPIENTRY
7222 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
7224 GET_CURRENT_CONTEXT(ctx
);
7225 FLUSH_VERTICES(ctx
, 0);
7226 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
7229 static GLboolean GLAPIENTRY
7230 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
7231 GLboolean
* residences
)
7233 GET_CURRENT_CONTEXT(ctx
);
7234 FLUSH_VERTICES(ctx
, 0);
7235 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
7238 static void GLAPIENTRY
7239 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7241 GET_CURRENT_CONTEXT(ctx
);
7242 FLUSH_VERTICES(ctx
, 0);
7243 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7246 static void GLAPIENTRY
7247 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
7249 GET_CURRENT_CONTEXT(ctx
);
7250 FLUSH_VERTICES(ctx
, 0);
7251 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
7254 static void GLAPIENTRY
7255 exec_DisableClientState(GLenum cap
)
7257 GET_CURRENT_CONTEXT(ctx
);
7258 FLUSH_VERTICES(ctx
, 0);
7259 CALL_DisableClientState(ctx
->Exec
, (cap
));
7262 static void GLAPIENTRY
7263 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
7265 GET_CURRENT_CONTEXT(ctx
);
7266 FLUSH_VERTICES(ctx
, 0);
7267 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
7270 static void GLAPIENTRY
7271 exec_EnableClientState(GLenum cap
)
7273 GET_CURRENT_CONTEXT(ctx
);
7274 FLUSH_VERTICES(ctx
, 0);
7275 CALL_EnableClientState(ctx
->Exec
, (cap
));
7278 static void GLAPIENTRY
7279 exec_GenTextures(GLsizei n
, GLuint
* texName
)
7281 GET_CURRENT_CONTEXT(ctx
);
7282 FLUSH_VERTICES(ctx
, 0);
7283 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
7286 static void GLAPIENTRY
7287 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
7289 GET_CURRENT_CONTEXT(ctx
);
7290 FLUSH_VERTICES(ctx
, 0);
7291 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
7294 static void GLAPIENTRY
7295 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7297 GET_CURRENT_CONTEXT(ctx
);
7298 FLUSH_VERTICES(ctx
, 0);
7299 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
7302 static void GLAPIENTRY
7303 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
7305 GET_CURRENT_CONTEXT(ctx
);
7306 FLUSH_VERTICES(ctx
, 0);
7307 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
7310 static GLboolean GLAPIENTRY
7311 exec_IsTexture(GLuint texture
)
7313 GET_CURRENT_CONTEXT(ctx
);
7314 FLUSH_VERTICES(ctx
, 0);
7315 return CALL_IsTexture(ctx
->Exec
, (texture
));
7318 static void GLAPIENTRY
7319 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7321 GET_CURRENT_CONTEXT(ctx
);
7322 FLUSH_VERTICES(ctx
, 0);
7323 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
7326 static void GLAPIENTRY
7327 exec_PopClientAttrib(void)
7329 GET_CURRENT_CONTEXT(ctx
);
7330 FLUSH_VERTICES(ctx
, 0);
7331 CALL_PopClientAttrib(ctx
->Exec
, ());
7334 static void GLAPIENTRY
7335 exec_PushClientAttrib(GLbitfield mask
)
7337 GET_CURRENT_CONTEXT(ctx
);
7338 FLUSH_VERTICES(ctx
, 0);
7339 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
7342 static void GLAPIENTRY
7343 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
7346 GET_CURRENT_CONTEXT(ctx
);
7347 FLUSH_VERTICES(ctx
, 0);
7348 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7351 static void GLAPIENTRY
7352 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
7354 GET_CURRENT_CONTEXT(ctx
);
7355 FLUSH_VERTICES(ctx
, 0);
7356 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
7359 static void GLAPIENTRY
7360 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
7363 GET_CURRENT_CONTEXT(ctx
);
7364 FLUSH_VERTICES(ctx
, 0);
7365 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7368 static void GLAPIENTRY
7369 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
7370 GLint x
, GLint y
, GLsizei width
)
7372 GET_CURRENT_CONTEXT(ctx
);
7373 FLUSH_VERTICES(ctx
, 0);
7374 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
7375 (target
, internalFormat
, x
, y
, width
));
7378 static void GLAPIENTRY
7379 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
7380 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
7382 GET_CURRENT_CONTEXT(ctx
);
7383 FLUSH_VERTICES(ctx
, 0);
7384 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
7385 (target
, internalFormat
, x
, y
, width
,
7389 static void GLAPIENTRY
7390 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
7392 GET_CURRENT_CONTEXT(ctx
);
7393 FLUSH_VERTICES(ctx
, 0);
7394 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
7397 static void GLAPIENTRY
7398 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7400 GET_CURRENT_CONTEXT(ctx
);
7401 FLUSH_VERTICES(ctx
, 0);
7402 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
7405 static void GLAPIENTRY
7406 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7408 GET_CURRENT_CONTEXT(ctx
);
7409 FLUSH_VERTICES(ctx
, 0);
7410 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
7413 static void GLAPIENTRY
7414 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
7417 GET_CURRENT_CONTEXT(ctx
);
7418 FLUSH_VERTICES(ctx
, 0);
7419 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
7422 static void GLAPIENTRY
7423 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7425 GET_CURRENT_CONTEXT(ctx
);
7426 FLUSH_VERTICES(ctx
, 0);
7427 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
7430 static void GLAPIENTRY
7431 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7433 GET_CURRENT_CONTEXT(ctx
);
7434 FLUSH_VERTICES(ctx
, 0);
7435 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
7438 static void GLAPIENTRY
7439 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
7440 GLenum type
, GLvoid
*values
)
7442 GET_CURRENT_CONTEXT(ctx
);
7443 FLUSH_VERTICES(ctx
, 0);
7444 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7447 static void GLAPIENTRY
7448 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7450 GET_CURRENT_CONTEXT(ctx
);
7451 FLUSH_VERTICES(ctx
, 0);
7452 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
7455 static void GLAPIENTRY
7456 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7458 GET_CURRENT_CONTEXT(ctx
);
7459 FLUSH_VERTICES(ctx
, 0);
7460 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
7463 static void GLAPIENTRY
7464 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
7465 GLenum type
, GLvoid
*values
)
7467 GET_CURRENT_CONTEXT(ctx
);
7468 FLUSH_VERTICES(ctx
, 0);
7469 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7472 static void GLAPIENTRY
7473 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7475 GET_CURRENT_CONTEXT(ctx
);
7476 FLUSH_VERTICES(ctx
, 0);
7477 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
7480 static void GLAPIENTRY
7481 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7483 GET_CURRENT_CONTEXT(ctx
);
7484 FLUSH_VERTICES(ctx
, 0);
7485 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
7488 static void GLAPIENTRY
7489 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
7490 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
7492 GET_CURRENT_CONTEXT(ctx
);
7493 FLUSH_VERTICES(ctx
, 0);
7494 CALL_GetSeparableFilter(ctx
->Exec
,
7495 (target
, format
, type
, row
, column
, span
));
7498 static void GLAPIENTRY
7499 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
7500 GLsizei width
, GLsizei height
, GLenum format
,
7501 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
7503 GET_CURRENT_CONTEXT(ctx
);
7504 FLUSH_VERTICES(ctx
, 0);
7505 CALL_SeparableFilter2D(ctx
->Exec
,
7506 (target
, internalFormat
, width
, height
, format
,
7507 type
, row
, column
));
7510 static void GLAPIENTRY
7511 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7512 GLsizei count
, const GLvoid
*ptr
)
7514 GET_CURRENT_CONTEXT(ctx
);
7515 FLUSH_VERTICES(ctx
, 0);
7516 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7519 static void GLAPIENTRY
7520 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
7522 GET_CURRENT_CONTEXT(ctx
);
7523 FLUSH_VERTICES(ctx
, 0);
7524 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
7527 static void GLAPIENTRY
7528 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7531 GET_CURRENT_CONTEXT(ctx
);
7532 FLUSH_VERTICES(ctx
, 0);
7533 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
7536 static void GLAPIENTRY
7537 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7540 GET_CURRENT_CONTEXT(ctx
);
7541 FLUSH_VERTICES(ctx
, 0);
7542 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
7545 static void GLAPIENTRY
7546 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7547 GLsizei count
, const GLvoid
*ptr
)
7549 GET_CURRENT_CONTEXT(ctx
);
7550 FLUSH_VERTICES(ctx
, 0);
7551 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7554 static void GLAPIENTRY
7555 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7556 GLsizei count
, const GLvoid
*ptr
)
7558 GET_CURRENT_CONTEXT(ctx
);
7559 FLUSH_VERTICES(ctx
, 0);
7560 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7563 static void GLAPIENTRY
7564 exec_LockArraysEXT(GLint first
, GLsizei count
)
7566 GET_CURRENT_CONTEXT(ctx
);
7567 FLUSH_VERTICES(ctx
, 0);
7568 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
7571 static void GLAPIENTRY
7572 exec_UnlockArraysEXT(void)
7574 GET_CURRENT_CONTEXT(ctx
);
7575 FLUSH_VERTICES(ctx
, 0);
7576 CALL_UnlockArraysEXT(ctx
->Exec
, ());
7579 static void GLAPIENTRY
7580 exec_ClientActiveTextureARB(GLenum target
)
7582 GET_CURRENT_CONTEXT(ctx
);
7583 FLUSH_VERTICES(ctx
, 0);
7584 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
7587 static void GLAPIENTRY
7588 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
7589 GLsizei stride
, const GLvoid
*ptr
)
7591 GET_CURRENT_CONTEXT(ctx
);
7592 FLUSH_VERTICES(ctx
, 0);
7593 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
7596 static void GLAPIENTRY
7597 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7599 GET_CURRENT_CONTEXT(ctx
);
7600 FLUSH_VERTICES(ctx
, 0);
7601 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
7604 /* GL_EXT_multi_draw_arrays */
7605 static void GLAPIENTRY
7606 exec_MultiDrawArraysEXT(GLenum mode
, GLint
* first
,
7607 GLsizei
* count
, GLsizei primcount
)
7609 GET_CURRENT_CONTEXT(ctx
);
7610 FLUSH_VERTICES(ctx
, 0);
7611 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
7614 /* GL_EXT_multi_draw_arrays */
7615 static void GLAPIENTRY
7616 exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
* count
,
7617 GLenum type
, const GLvoid
** indices
,
7620 GET_CURRENT_CONTEXT(ctx
);
7621 FLUSH_VERTICES(ctx
, 0);
7622 CALL_MultiDrawElementsEXT(ctx
->Exec
,
7623 (mode
, count
, type
, indices
, primcount
));
7626 /* GL_IBM_multimode_draw_arrays */
7627 static void GLAPIENTRY
7628 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
7629 const GLsizei
* count
, GLsizei primcount
,
7632 GET_CURRENT_CONTEXT(ctx
);
7633 FLUSH_VERTICES(ctx
, 0);
7634 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
7635 (mode
, first
, count
, primcount
, modestride
));
7638 /* GL_IBM_multimode_draw_arrays */
7639 static void GLAPIENTRY
7640 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
7641 const GLsizei
* count
,
7643 const GLvoid
* const *indices
,
7644 GLsizei primcount
, GLint modestride
)
7646 GET_CURRENT_CONTEXT(ctx
);
7647 FLUSH_VERTICES(ctx
, 0);
7648 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
7649 (mode
, count
, type
, indices
, primcount
,
7656 * Setup the given dispatch table to point to Mesa's display list
7657 * building functions.
7659 * This does not include any of the tnl functions - they are
7660 * initialized from _mesa_init_api_defaults and from the active vtxfmt
7664 _mesa_init_dlist_table(struct _glapi_table
*table
)
7666 _mesa_loopback_init_api_table(table
);
7669 SET_Accum(table
, save_Accum
);
7670 SET_AlphaFunc(table
, save_AlphaFunc
);
7671 SET_Bitmap(table
, save_Bitmap
);
7672 SET_BlendFunc(table
, save_BlendFunc
);
7673 SET_CallList(table
, _mesa_save_CallList
);
7674 SET_CallLists(table
, _mesa_save_CallLists
);
7675 SET_Clear(table
, save_Clear
);
7676 SET_ClearAccum(table
, save_ClearAccum
);
7677 SET_ClearColor(table
, save_ClearColor
);
7678 SET_ClearDepth(table
, save_ClearDepth
);
7679 SET_ClearIndex(table
, save_ClearIndex
);
7680 SET_ClearStencil(table
, save_ClearStencil
);
7681 SET_ClipPlane(table
, save_ClipPlane
);
7682 SET_ColorMask(table
, save_ColorMask
);
7683 SET_ColorMaterial(table
, save_ColorMaterial
);
7684 SET_CopyPixels(table
, save_CopyPixels
);
7685 SET_CullFace(table
, save_CullFace
);
7686 SET_DeleteLists(table
, _mesa_DeleteLists
);
7687 SET_DepthFunc(table
, save_DepthFunc
);
7688 SET_DepthMask(table
, save_DepthMask
);
7689 SET_DepthRange(table
, save_DepthRange
);
7690 SET_Disable(table
, save_Disable
);
7691 SET_DrawBuffer(table
, save_DrawBuffer
);
7692 SET_DrawPixels(table
, save_DrawPixels
);
7693 SET_Enable(table
, save_Enable
);
7694 SET_EndList(table
, _mesa_EndList
);
7695 SET_EvalMesh1(table
, _mesa_save_EvalMesh1
);
7696 SET_EvalMesh2(table
, _mesa_save_EvalMesh2
);
7697 SET_Finish(table
, exec_Finish
);
7698 SET_Flush(table
, exec_Flush
);
7699 SET_Fogf(table
, save_Fogf
);
7700 SET_Fogfv(table
, save_Fogfv
);
7701 SET_Fogi(table
, save_Fogi
);
7702 SET_Fogiv(table
, save_Fogiv
);
7703 SET_FrontFace(table
, save_FrontFace
);
7704 SET_Frustum(table
, save_Frustum
);
7705 SET_GenLists(table
, _mesa_GenLists
);
7706 SET_GetBooleanv(table
, exec_GetBooleanv
);
7707 SET_GetClipPlane(table
, exec_GetClipPlane
);
7708 SET_GetDoublev(table
, exec_GetDoublev
);
7709 SET_GetError(table
, exec_GetError
);
7710 SET_GetFloatv(table
, exec_GetFloatv
);
7711 SET_GetIntegerv(table
, exec_GetIntegerv
);
7712 SET_GetLightfv(table
, exec_GetLightfv
);
7713 SET_GetLightiv(table
, exec_GetLightiv
);
7714 SET_GetMapdv(table
, exec_GetMapdv
);
7715 SET_GetMapfv(table
, exec_GetMapfv
);
7716 SET_GetMapiv(table
, exec_GetMapiv
);
7717 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
7718 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
7719 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
7720 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
7721 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
7722 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
7723 SET_GetString(table
, exec_GetString
);
7724 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
7725 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
7726 SET_GetTexGendv(table
, exec_GetTexGendv
);
7727 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
7728 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
7729 SET_GetTexImage(table
, exec_GetTexImage
);
7730 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
7731 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
7732 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
7733 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
7734 SET_Hint(table
, save_Hint
);
7735 SET_IndexMask(table
, save_IndexMask
);
7736 SET_InitNames(table
, save_InitNames
);
7737 SET_IsEnabled(table
, exec_IsEnabled
);
7738 SET_IsList(table
, _mesa_IsList
);
7739 SET_LightModelf(table
, save_LightModelf
);
7740 SET_LightModelfv(table
, save_LightModelfv
);
7741 SET_LightModeli(table
, save_LightModeli
);
7742 SET_LightModeliv(table
, save_LightModeliv
);
7743 SET_Lightf(table
, save_Lightf
);
7744 SET_Lightfv(table
, save_Lightfv
);
7745 SET_Lighti(table
, save_Lighti
);
7746 SET_Lightiv(table
, save_Lightiv
);
7747 SET_LineStipple(table
, save_LineStipple
);
7748 SET_LineWidth(table
, save_LineWidth
);
7749 SET_ListBase(table
, save_ListBase
);
7750 SET_LoadIdentity(table
, save_LoadIdentity
);
7751 SET_LoadMatrixd(table
, save_LoadMatrixd
);
7752 SET_LoadMatrixf(table
, save_LoadMatrixf
);
7753 SET_LoadName(table
, save_LoadName
);
7754 SET_LogicOp(table
, save_LogicOp
);
7755 SET_Map1d(table
, save_Map1d
);
7756 SET_Map1f(table
, save_Map1f
);
7757 SET_Map2d(table
, save_Map2d
);
7758 SET_Map2f(table
, save_Map2f
);
7759 SET_MapGrid1d(table
, save_MapGrid1d
);
7760 SET_MapGrid1f(table
, save_MapGrid1f
);
7761 SET_MapGrid2d(table
, save_MapGrid2d
);
7762 SET_MapGrid2f(table
, save_MapGrid2f
);
7763 SET_MatrixMode(table
, save_MatrixMode
);
7764 SET_MultMatrixd(table
, save_MultMatrixd
);
7765 SET_MultMatrixf(table
, save_MultMatrixf
);
7766 SET_NewList(table
, save_NewList
);
7767 SET_Ortho(table
, save_Ortho
);
7768 SET_PassThrough(table
, save_PassThrough
);
7769 SET_PixelMapfv(table
, save_PixelMapfv
);
7770 SET_PixelMapuiv(table
, save_PixelMapuiv
);
7771 SET_PixelMapusv(table
, save_PixelMapusv
);
7772 SET_PixelStoref(table
, exec_PixelStoref
);
7773 SET_PixelStorei(table
, exec_PixelStorei
);
7774 SET_PixelTransferf(table
, save_PixelTransferf
);
7775 SET_PixelTransferi(table
, save_PixelTransferi
);
7776 SET_PixelZoom(table
, save_PixelZoom
);
7777 SET_PointSize(table
, save_PointSize
);
7778 SET_PolygonMode(table
, save_PolygonMode
);
7779 SET_PolygonOffset(table
, save_PolygonOffset
);
7780 SET_PolygonStipple(table
, save_PolygonStipple
);
7781 SET_PopAttrib(table
, save_PopAttrib
);
7782 SET_PopMatrix(table
, save_PopMatrix
);
7783 SET_PopName(table
, save_PopName
);
7784 SET_PushAttrib(table
, save_PushAttrib
);
7785 SET_PushMatrix(table
, save_PushMatrix
);
7786 SET_PushName(table
, save_PushName
);
7787 SET_RasterPos2d(table
, save_RasterPos2d
);
7788 SET_RasterPos2dv(table
, save_RasterPos2dv
);
7789 SET_RasterPos2f(table
, save_RasterPos2f
);
7790 SET_RasterPos2fv(table
, save_RasterPos2fv
);
7791 SET_RasterPos2i(table
, save_RasterPos2i
);
7792 SET_RasterPos2iv(table
, save_RasterPos2iv
);
7793 SET_RasterPos2s(table
, save_RasterPos2s
);
7794 SET_RasterPos2sv(table
, save_RasterPos2sv
);
7795 SET_RasterPos3d(table
, save_RasterPos3d
);
7796 SET_RasterPos3dv(table
, save_RasterPos3dv
);
7797 SET_RasterPos3f(table
, save_RasterPos3f
);
7798 SET_RasterPos3fv(table
, save_RasterPos3fv
);
7799 SET_RasterPos3i(table
, save_RasterPos3i
);
7800 SET_RasterPos3iv(table
, save_RasterPos3iv
);
7801 SET_RasterPos3s(table
, save_RasterPos3s
);
7802 SET_RasterPos3sv(table
, save_RasterPos3sv
);
7803 SET_RasterPos4d(table
, save_RasterPos4d
);
7804 SET_RasterPos4dv(table
, save_RasterPos4dv
);
7805 SET_RasterPos4f(table
, save_RasterPos4f
);
7806 SET_RasterPos4fv(table
, save_RasterPos4fv
);
7807 SET_RasterPos4i(table
, save_RasterPos4i
);
7808 SET_RasterPos4iv(table
, save_RasterPos4iv
);
7809 SET_RasterPos4s(table
, save_RasterPos4s
);
7810 SET_RasterPos4sv(table
, save_RasterPos4sv
);
7811 SET_ReadBuffer(table
, save_ReadBuffer
);
7812 SET_ReadPixels(table
, exec_ReadPixels
);
7813 SET_RenderMode(table
, exec_RenderMode
);
7814 SET_Rotated(table
, save_Rotated
);
7815 SET_Rotatef(table
, save_Rotatef
);
7816 SET_Scaled(table
, save_Scaled
);
7817 SET_Scalef(table
, save_Scalef
);
7818 SET_Scissor(table
, save_Scissor
);
7819 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
7820 SET_SelectBuffer(table
, exec_SelectBuffer
);
7821 SET_ShadeModel(table
, save_ShadeModel
);
7822 SET_StencilFunc(table
, save_StencilFunc
);
7823 SET_StencilMask(table
, save_StencilMask
);
7824 SET_StencilOp(table
, save_StencilOp
);
7825 SET_TexEnvf(table
, save_TexEnvf
);
7826 SET_TexEnvfv(table
, save_TexEnvfv
);
7827 SET_TexEnvi(table
, save_TexEnvi
);
7828 SET_TexEnviv(table
, save_TexEnviv
);
7829 SET_TexGend(table
, save_TexGend
);
7830 SET_TexGendv(table
, save_TexGendv
);
7831 SET_TexGenf(table
, save_TexGenf
);
7832 SET_TexGenfv(table
, save_TexGenfv
);
7833 SET_TexGeni(table
, save_TexGeni
);
7834 SET_TexGeniv(table
, save_TexGeniv
);
7835 SET_TexImage1D(table
, save_TexImage1D
);
7836 SET_TexImage2D(table
, save_TexImage2D
);
7837 SET_TexParameterf(table
, save_TexParameterf
);
7838 SET_TexParameterfv(table
, save_TexParameterfv
);
7839 SET_TexParameteri(table
, save_TexParameteri
);
7840 SET_TexParameteriv(table
, save_TexParameteriv
);
7841 SET_Translated(table
, save_Translated
);
7842 SET_Translatef(table
, save_Translatef
);
7843 SET_Viewport(table
, save_Viewport
);
7846 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
7847 SET_BindTexture(table
, save_BindTexture
);
7848 SET_ColorPointer(table
, exec_ColorPointer
);
7849 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
7850 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
7851 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
7852 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
7853 SET_DeleteTextures(table
, exec_DeleteTextures
);
7854 SET_DisableClientState(table
, exec_DisableClientState
);
7855 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
7856 SET_EnableClientState(table
, exec_EnableClientState
);
7857 SET_GenTextures(table
, exec_GenTextures
);
7858 SET_GetPointerv(table
, exec_GetPointerv
);
7859 SET_IndexPointer(table
, exec_IndexPointer
);
7860 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
7861 SET_IsTexture(table
, exec_IsTexture
);
7862 SET_NormalPointer(table
, exec_NormalPointer
);
7863 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
7864 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
7865 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
7866 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
7867 SET_TexSubImage1D(table
, save_TexSubImage1D
);
7868 SET_TexSubImage2D(table
, save_TexSubImage2D
);
7869 SET_VertexPointer(table
, exec_VertexPointer
);
7872 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
7873 SET_TexImage3D(table
, save_TexImage3D
);
7874 SET_TexSubImage3D(table
, save_TexSubImage3D
);
7877 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
7878 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
7879 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
7881 /* ATI_separate_stencil */
7882 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
7884 /* GL_ARB_imaging */
7885 /* Not all are supported */
7886 SET_BlendColor(table
, save_BlendColor
);
7887 SET_BlendEquation(table
, save_BlendEquation
);
7888 SET_ColorSubTable(table
, save_ColorSubTable
);
7889 SET_ColorTable(table
, save_ColorTable
);
7890 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
7891 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
7892 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
7893 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
7894 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
7895 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
7896 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
7897 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
7898 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
7899 SET_CopyColorTable(table
, save_CopyColorTable
);
7900 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
7901 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
7902 SET_GetColorTable(table
, exec_GetColorTable
);
7903 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
7904 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
7905 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
7906 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
7907 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
7908 SET_GetHistogram(table
, exec_GetHistogram
);
7909 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
7910 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
7911 SET_GetMinmax(table
, exec_GetMinmax
);
7912 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
7913 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
7914 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
7915 SET_Histogram(table
, save_Histogram
);
7916 SET_Minmax(table
, save_Minmax
);
7917 SET_ResetHistogram(table
, save_ResetHistogram
);
7918 SET_ResetMinmax(table
, save_ResetMinmax
);
7919 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
7921 /* 2. GL_EXT_blend_color */
7923 SET_BlendColorEXT(table
, save_BlendColorEXT
);
7926 /* 3. GL_EXT_polygon_offset */
7927 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
7929 /* 6. GL_EXT_texture3d */
7931 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
7932 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
7933 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
7936 /* 14. GL_SGI_color_table */
7938 SET_ColorTableSGI(table
, save_ColorTable
);
7939 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
7940 SET_GetColorTableSGI(table
, exec_GetColorTable
);
7941 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
7942 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
7945 /* 30. GL_EXT_vertex_array */
7946 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
7947 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
7948 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
7949 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
7950 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
7951 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
7953 /* 37. GL_EXT_blend_minmax */
7955 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
7958 /* 54. GL_EXT_point_parameters */
7959 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
7960 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
7962 /* 97. GL_EXT_compiled_vertex_array */
7963 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
7964 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
7966 /* 145. GL_EXT_secondary_color */
7967 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
7969 /* 148. GL_EXT_multi_draw_arrays */
7970 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
7971 SET_MultiDrawElementsEXT(table
, exec_MultiDrawElementsEXT
);
7973 /* 149. GL_EXT_fog_coord */
7974 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
7976 /* 173. GL_EXT_blend_func_separate */
7977 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
7979 /* 196. GL_MESA_resize_buffers */
7980 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
7982 /* 197. GL_MESA_window_pos */
7983 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
7984 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
7985 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
7986 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
7987 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
7988 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
7989 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
7990 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
7991 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
7992 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
7993 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
7994 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
7995 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
7996 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
7997 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
7998 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
7999 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
8000 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
8001 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
8002 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
8003 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
8004 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
8005 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
8006 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
8008 /* 200. GL_IBM_multimode_draw_arrays */
8009 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
8010 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
8012 #if FEATURE_NV_vertex_program
8013 /* 233. GL_NV_vertex_program */
8014 /* The following commands DO NOT go into display lists:
8015 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
8016 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
8018 SET_BindProgramNV(table
, save_BindProgramNV
);
8019 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8020 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
8021 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8022 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
8023 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
8024 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
8025 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
8026 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
8027 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
8028 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
8029 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8030 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8031 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8032 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8033 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
8034 SET_LoadProgramNV(table
, save_LoadProgramNV
);
8035 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
8036 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
8037 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
8038 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
8039 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
8040 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
8041 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
8042 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
8045 /* 245. GL_ATI_fragment_shader */
8046 #if FEATURE_ATI_fragment_shader
8047 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
8048 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
8051 /* 282. GL_NV_fragment_program */
8052 #if FEATURE_NV_fragment_program
8053 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
8054 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
8055 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
8056 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
8057 SET_GetProgramNamedParameterfvNV(table
,
8058 _mesa_GetProgramNamedParameterfvNV
);
8059 SET_GetProgramNamedParameterdvNV(table
,
8060 _mesa_GetProgramNamedParameterdvNV
);
8061 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8062 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8063 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8064 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8065 SET_GetProgramLocalParameterdvARB(table
,
8066 _mesa_GetProgramLocalParameterdvARB
);
8067 SET_GetProgramLocalParameterfvARB(table
,
8068 _mesa_GetProgramLocalParameterfvARB
);
8071 /* 262. GL_NV_point_sprite */
8072 SET_PointParameteriNV(table
, save_PointParameteriNV
);
8073 SET_PointParameterivNV(table
, save_PointParameterivNV
);
8075 /* 268. GL_EXT_stencil_two_side */
8076 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
8078 /* 273. GL_APPLE_vertex_array_object */
8079 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
8080 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
8081 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
8082 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
8084 /* ???. GL_EXT_depth_bounds_test */
8085 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
8087 /* ARB 1. GL_ARB_multitexture */
8088 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
8089 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
8091 /* ARB 3. GL_ARB_transpose_matrix */
8092 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
8093 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
8094 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
8095 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
8097 /* ARB 5. GL_ARB_multisample */
8098 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
8100 /* ARB 12. GL_ARB_texture_compression */
8101 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
8102 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
8103 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
8104 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
8105 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
8106 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
8107 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
8109 /* ARB 14. GL_ARB_point_parameters */
8110 /* aliased with EXT_point_parameters functions */
8112 /* ARB 25. GL_ARB_window_pos */
8113 /* aliased with MESA_window_pos functions */
8115 /* ARB 26. GL_ARB_vertex_program */
8116 /* ARB 27. GL_ARB_fragment_program */
8117 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8118 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
8119 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
8120 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
8121 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
8122 SET_ProgramStringARB(table
, save_ProgramStringARB
);
8123 SET_BindProgramNV(table
, save_BindProgramNV
);
8124 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8125 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8126 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
8127 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8128 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8129 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8130 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8131 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
8132 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
8133 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
8134 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
8135 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8136 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8137 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8138 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8139 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
8140 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
8141 SET_GetProgramLocalParameterdvARB(table
,
8142 _mesa_GetProgramLocalParameterdvARB
);
8143 SET_GetProgramLocalParameterfvARB(table
,
8144 _mesa_GetProgramLocalParameterfvARB
);
8145 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
8146 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
8149 /* ARB 28. GL_ARB_vertex_buffer_object */
8150 #if FEATURE_ARB_vertex_buffer_object
8151 /* None of the extension's functions get compiled */
8152 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
8153 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
8154 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
8155 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
8156 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
8157 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
8158 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
8159 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
8160 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
8161 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
8162 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
8165 #if FEATURE_ARB_occlusion_query
8166 SET_BeginQueryARB(table
, save_BeginQueryARB
);
8167 SET_EndQueryARB(table
, save_EndQueryARB
);
8168 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
8169 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
8170 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
8171 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
8172 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
8173 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
8175 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
8177 #if FEATURE_EXT_framebuffer_blit
8178 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
8181 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
8182 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
8183 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
8184 /* XXX additional functions need to be implemented here! */
8186 /* 299. GL_EXT_blend_equation_separate */
8187 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
8189 /* GL_EXT_gpu_program_parmaeters */
8190 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8191 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
8192 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
8199 enum_string(GLenum k
)
8201 return _mesa_lookup_enum_by_nr(k
);
8206 * Print the commands in a display list. For debugging only.
8207 * TODO: many commands aren't handled yet.
8209 static void GLAPIENTRY
8210 print_list(GLcontext
*ctx
, GLuint list
)
8212 struct gl_display_list
*dlist
;
8216 if (!islist(ctx
, list
)) {
8217 _mesa_printf("%u is not a display list ID\n", list
);
8221 dlist
= lookup_list(ctx
, list
);
8227 _mesa_printf("START-LIST %u, address %p\n", list
, (void *) n
);
8229 done
= n
? GL_FALSE
: GL_TRUE
;
8231 OpCode opcode
= n
[0].opcode
;
8232 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
8234 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
8235 /* this is a driver-extended opcode */
8236 ctx
->ListExt
.Opcode
[i
].Print(ctx
, &n
[1]);
8237 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
8242 _mesa_printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
8245 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
8246 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
8248 case OPCODE_CALL_LIST
:
8249 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
8251 case OPCODE_CALL_LIST_OFFSET
:
8252 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
8253 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
8255 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
8256 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
8257 enum_string(n
[1].e
), enum_string(n
[2].e
),
8258 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8260 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
8261 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
8262 enum_string(n
[1].e
), enum_string(n
[2].e
),
8263 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
8265 case OPCODE_DISABLE
:
8266 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
8269 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
8271 case OPCODE_FRUSTUM
:
8272 _mesa_printf("Frustum %g %g %g %g %g %g\n",
8273 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8275 case OPCODE_LINE_STIPPLE
:
8276 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
8278 case OPCODE_LOAD_IDENTITY
:
8279 _mesa_printf("LoadIdentity\n");
8281 case OPCODE_LOAD_MATRIX
:
8282 _mesa_printf("LoadMatrix\n");
8283 _mesa_printf(" %8f %8f %8f %8f\n",
8284 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8285 _mesa_printf(" %8f %8f %8f %8f\n",
8286 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8287 _mesa_printf(" %8f %8f %8f %8f\n",
8288 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8289 _mesa_printf(" %8f %8f %8f %8f\n",
8290 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8292 case OPCODE_MULT_MATRIX
:
8293 _mesa_printf("MultMatrix (or Rotate)\n");
8294 _mesa_printf(" %8f %8f %8f %8f\n",
8295 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8296 _mesa_printf(" %8f %8f %8f %8f\n",
8297 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8298 _mesa_printf(" %8f %8f %8f %8f\n",
8299 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8300 _mesa_printf(" %8f %8f %8f %8f\n",
8301 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8304 _mesa_printf("Ortho %g %g %g %g %g %g\n",
8305 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8307 case OPCODE_POP_ATTRIB
:
8308 _mesa_printf("PopAttrib\n");
8310 case OPCODE_POP_MATRIX
:
8311 _mesa_printf("PopMatrix\n");
8313 case OPCODE_POP_NAME
:
8314 _mesa_printf("PopName\n");
8316 case OPCODE_PUSH_ATTRIB
:
8317 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
8319 case OPCODE_PUSH_MATRIX
:
8320 _mesa_printf("PushMatrix\n");
8322 case OPCODE_PUSH_NAME
:
8323 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
8325 case OPCODE_RASTER_POS
:
8326 _mesa_printf("RasterPos %g %g %g %g\n",
8327 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8330 _mesa_printf("Rotate %g %g %g %g\n",
8331 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8334 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8336 case OPCODE_TRANSLATE
:
8337 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8339 case OPCODE_BIND_TEXTURE
:
8340 _mesa_printf("BindTexture %s %d\n",
8341 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
8343 case OPCODE_SHADE_MODEL
:
8344 _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
8347 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
8348 _mesa_lookup_enum_by_nr(n
[1].ui
),
8349 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
8352 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
8353 _mesa_lookup_enum_by_nr(n
[1].ui
),
8354 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
8355 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
8357 case OPCODE_MAPGRID1
:
8358 _mesa_printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
8360 case OPCODE_MAPGRID2
:
8361 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
8362 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
8364 case OPCODE_EVALMESH1
:
8365 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
8367 case OPCODE_EVALMESH2
:
8368 _mesa_printf("EvalMesh2 %d %d %d %d\n",
8369 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
8372 case OPCODE_ATTR_1F_NV
:
8373 _mesa_printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
8375 case OPCODE_ATTR_2F_NV
:
8376 _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
8377 n
[1].i
, n
[2].f
, n
[3].f
);
8379 case OPCODE_ATTR_3F_NV
:
8380 _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
8381 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8383 case OPCODE_ATTR_4F_NV
:
8384 _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
8385 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8387 case OPCODE_ATTR_1F_ARB
:
8388 _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
8390 case OPCODE_ATTR_2F_ARB
:
8391 _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
8392 n
[1].i
, n
[2].f
, n
[3].f
);
8394 case OPCODE_ATTR_3F_ARB
:
8395 _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
8396 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8398 case OPCODE_ATTR_4F_ARB
:
8399 _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
8400 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8403 case OPCODE_MATERIAL
:
8404 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
8405 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8408 _mesa_printf("BEGIN %x\n", n
[1].i
);
8411 _mesa_printf("END\n");
8414 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
8417 case OPCODE_EVAL_C1
:
8418 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
8420 case OPCODE_EVAL_C2
:
8421 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
8423 case OPCODE_EVAL_P1
:
8424 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
8426 case OPCODE_EVAL_P2
:
8427 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
8431 * meta opcodes/commands
8434 _mesa_printf("Error: %s %s\n",
8435 enum_string(n
[1].e
), (const char *) n
[2].data
);
8437 case OPCODE_CONTINUE
:
8438 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
8439 n
= (Node
*) n
[1].next
;
8441 case OPCODE_END_OF_LIST
:
8442 _mesa_printf("END-LIST %u\n", list
);
8446 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
8448 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
8449 opcode
, (void *) n
);
8453 _mesa_printf("command %d, %u operands\n", opcode
,
8457 /* increment n to point to next compiled command */
8458 if (opcode
!= OPCODE_CONTINUE
) {
8459 n
+= InstSize
[opcode
];
8468 * Clients may call this function to help debug display list problems.
8469 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
8470 * changed, or break in the future without notice.
8473 mesa_print_display_list(GLuint list
)
8475 GET_CURRENT_CONTEXT(ctx
);
8476 print_list(ctx
, list
);
8480 /**********************************************************************/
8481 /***** Initialization *****/
8482 /**********************************************************************/
8485 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
8487 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
8488 vfmt
->Begin
= save_Begin
;
8489 vfmt
->CallList
= _mesa_save_CallList
;
8490 vfmt
->CallLists
= _mesa_save_CallLists
;
8491 vfmt
->Color3f
= save_Color3f
;
8492 vfmt
->Color3fv
= save_Color3fv
;
8493 vfmt
->Color4f
= save_Color4f
;
8494 vfmt
->Color4fv
= save_Color4fv
;
8495 vfmt
->EdgeFlag
= save_EdgeFlag
;
8496 vfmt
->End
= save_End
;
8497 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
8498 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
8499 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
8500 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
8501 vfmt
->EvalPoint1
= save_EvalPoint1
;
8502 vfmt
->EvalPoint2
= save_EvalPoint2
;
8503 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
8504 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
8505 vfmt
->Indexf
= save_Indexf
;
8506 vfmt
->Indexfv
= save_Indexfv
;
8507 vfmt
->Materialfv
= save_Materialfv
;
8508 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
8509 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
8510 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
8511 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
8512 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
8513 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
8514 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
8515 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
8516 vfmt
->Normal3f
= save_Normal3f
;
8517 vfmt
->Normal3fv
= save_Normal3fv
;
8518 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
8519 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
8520 vfmt
->TexCoord1f
= save_TexCoord1f
;
8521 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
8522 vfmt
->TexCoord2f
= save_TexCoord2f
;
8523 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
8524 vfmt
->TexCoord3f
= save_TexCoord3f
;
8525 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
8526 vfmt
->TexCoord4f
= save_TexCoord4f
;
8527 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
8528 vfmt
->Vertex2f
= save_Vertex2f
;
8529 vfmt
->Vertex2fv
= save_Vertex2fv
;
8530 vfmt
->Vertex3f
= save_Vertex3f
;
8531 vfmt
->Vertex3fv
= save_Vertex3fv
;
8532 vfmt
->Vertex4f
= save_Vertex4f
;
8533 vfmt
->Vertex4fv
= save_Vertex4fv
;
8534 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
8535 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
8536 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
8537 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
8538 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
8539 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
8540 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
8541 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
8542 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
8543 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
8544 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
8545 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
8546 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
8547 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
8548 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
8549 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
8551 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
8552 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
8553 vfmt
->Rectf
= save_Rectf
;
8555 /* The driver is required to implement these as
8556 * 1) They can probably do a better job.
8557 * 2) A lot of new mechanisms would have to be added to this module
8558 * to support it. That code would probably never get used,
8562 vfmt
->DrawArrays
= 0;
8563 vfmt
->DrawElements
= 0;
8564 vfmt
->DrawRangeElements
= 0;
8570 * Initialize display list state for given context.
8573 _mesa_init_display_list(GLcontext
*ctx
)
8575 static GLboolean tableInitialized
= GL_FALSE
;
8577 /* zero-out the instruction size table, just once */
8578 if (!tableInitialized
) {
8579 _mesa_bzero(InstSize
, sizeof(InstSize
));
8580 tableInitialized
= GL_TRUE
;
8584 ctx
->ListState
.CallDepth
= 0;
8585 ctx
->ExecuteFlag
= GL_TRUE
;
8586 ctx
->CompileFlag
= GL_FALSE
;
8587 ctx
->ListState
.CurrentBlock
= NULL
;
8588 ctx
->ListState
.CurrentPos
= 0;
8590 /* Display List group */
8591 ctx
->List
.ListBase
= 0;
8593 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);