2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 * Display lists management functions.
33 #include "api_arrayelt.h"
34 #include "api_loopback.h"
36 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
37 #include "arbprogram.h"
43 #if FEATURE_ARB_vertex_buffer_object
44 #include "bufferobj.h"
57 #include "extensions.h"
62 #include "histogram.h"
79 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
80 #include "nvprogram.h"
83 #if FEATURE_ATI_fragment_shader
84 #include "atifragshader.h"
87 #include "math/m_matrix.h"
88 #include "math/m_xform.h"
96 * \param ctx GL context.
98 * Checks if dd_function_table::SaveNeedFlush is marked to flush
99 * stored (save) vertices, and calls
100 * dd_function_table::SaveFlushVertices if so.
102 #define SAVE_FLUSH_VERTICES(ctx) \
104 if (ctx->Driver.SaveNeedFlush) \
105 ctx->Driver.SaveFlushVertices(ctx); \
110 * Macro to assert that the API call was made outside the
111 * glBegin()/glEnd() pair, with return value.
113 * \param ctx GL context.
114 * \param retval value to return value in case the assertion fails.
116 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
118 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
119 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
120 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
126 * Macro to assert that the API call was made outside the
127 * glBegin()/glEnd() pair.
129 * \param ctx GL context.
131 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
133 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
134 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
135 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
141 * Macro to assert that the API call was made outside the
142 * glBegin()/glEnd() pair and flush the vertices.
144 * \param ctx GL context.
146 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
148 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
149 SAVE_FLUSH_VERTICES(ctx); \
153 * Macro to assert that the API call was made outside the
154 * glBegin()/glEnd() pair and flush the vertices, with return value.
156 * \param ctx GL context.
157 * \param retval value to return value in case the assertion fails.
159 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
161 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
162 SAVE_FLUSH_VERTICES(ctx); \
168 * Display list opcodes.
170 * The fact that these identifiers are assigned consecutive
171 * integer values starting at 0 is very important, see InstSize array usage)
175 OPCODE_INVALID
= -1, /* Force signed enum */
181 OPCODE_BLEND_EQUATION
,
182 OPCODE_BLEND_EQUATION_SEPARATE
,
183 OPCODE_BLEND_FUNC_SEPARATE
,
185 OPCODE_CALL_LIST_OFFSET
,
191 OPCODE_CLEAR_STENCIL
,
194 OPCODE_COLOR_MATERIAL
,
196 OPCODE_COLOR_TABLE_PARAMETER_FV
,
197 OPCODE_COLOR_TABLE_PARAMETER_IV
,
198 OPCODE_COLOR_SUB_TABLE
,
199 OPCODE_CONVOLUTION_FILTER_1D
,
200 OPCODE_CONVOLUTION_FILTER_2D
,
201 OPCODE_CONVOLUTION_PARAMETER_I
,
202 OPCODE_CONVOLUTION_PARAMETER_IV
,
203 OPCODE_CONVOLUTION_PARAMETER_F
,
204 OPCODE_CONVOLUTION_PARAMETER_FV
,
205 OPCODE_COPY_COLOR_SUB_TABLE
,
206 OPCODE_COPY_COLOR_TABLE
,
208 OPCODE_COPY_TEX_IMAGE1D
,
209 OPCODE_COPY_TEX_IMAGE2D
,
210 OPCODE_COPY_TEX_SUB_IMAGE1D
,
211 OPCODE_COPY_TEX_SUB_IMAGE2D
,
212 OPCODE_COPY_TEX_SUB_IMAGE3D
,
235 OPCODE_LOAD_IDENTITY
,
249 OPCODE_PIXEL_TRANSFER
,
252 OPCODE_POINT_PARAMETERS
,
254 OPCODE_POLYGON_STIPPLE
,
255 OPCODE_POLYGON_OFFSET
,
259 OPCODE_PRIORITIZE_TEXTURE
,
265 OPCODE_RESET_HISTOGRAM
,
266 OPCODE_RESET_MIN_MAX
,
270 OPCODE_SELECT_TEXTURE_SGIS
,
271 OPCODE_SELECT_TEXTURE_COORD_SET
,
282 OPCODE_TEX_SUB_IMAGE1D
,
283 OPCODE_TEX_SUB_IMAGE2D
,
284 OPCODE_TEX_SUB_IMAGE3D
,
288 /* GL_ARB_multitexture */
289 OPCODE_ACTIVE_TEXTURE
,
290 /* GL_ARB_texture_compression */
291 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
292 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
293 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
294 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
295 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
296 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
297 /* GL_ARB_multisample */
298 OPCODE_SAMPLE_COVERAGE
,
299 /* GL_ARB_window_pos */
300 OPCODE_WINDOW_POS_ARB
,
301 /* GL_NV_vertex_program */
302 OPCODE_BIND_PROGRAM_NV
,
303 OPCODE_EXECUTE_PROGRAM_NV
,
304 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
305 OPCODE_LOAD_PROGRAM_NV
,
306 OPCODE_PROGRAM_PARAMETER4F_NV
,
307 OPCODE_TRACK_MATRIX_NV
,
308 /* GL_NV_fragment_program */
309 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
310 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
311 /* GL_EXT_stencil_two_side */
312 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
313 /* GL_EXT_depth_bounds_test */
314 OPCODE_DEPTH_BOUNDS_EXT
,
315 /* GL_ARB_vertex/fragment_program */
316 OPCODE_PROGRAM_STRING_ARB
,
317 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
318 /* GL_ARB_occlusion_query */
319 OPCODE_BEGIN_QUERY_ARB
,
320 OPCODE_END_QUERY_ARB
,
321 /* GL_ARB_draw_buffers */
322 OPCODE_DRAW_BUFFERS_ARB
,
323 /* GL_ATI_fragment_shader */
324 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
325 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
327 OPCODE_STENCIL_FUNC_SEPARATE
,
328 OPCODE_STENCIL_OP_SEPARATE
,
329 OPCODE_STENCIL_MASK_SEPARATE
,
331 /* GL_EXT_framebuffer_blit */
332 OPCODE_BLIT_FRAMEBUFFER
,
334 /* Vertex attributes -- fallback for when optimized display
335 * list build isn't active.
354 /* The following three are meta instructions */
355 OPCODE_ERROR
, /* raise compiled-in error */
366 * Display list instructions are stored as sequences of "nodes". Nodes
367 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
368 * are linked together with a pointer.
370 * Each instruction in the display list is stored as a sequence of
371 * contiguous nodes in memory.
372 * Each node is the union of a variety of data types.
387 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
392 * How many nodes to allocate at a time.
394 * \note Reduced now that we hold vertices etc. elsewhere.
396 #define BLOCK_SIZE 256
401 * Number of nodes of storage needed for each instruction.
402 * Sizes for dynamically allocated opcodes are stored in the context struct.
404 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
406 void mesa_print_display_list(GLuint list
);
409 /**********************************************************************/
410 /***** Private *****/
411 /**********************************************************************/
415 * Make an empty display list. This is used by glGenLists() to
416 * reserve display list IDs.
418 static struct mesa_display_list
*
419 make_list(GLuint list
, GLuint count
)
421 struct mesa_display_list
*dlist
= CALLOC_STRUCT(mesa_display_list
);
423 dlist
->node
= (Node
*) _mesa_malloc(sizeof(Node
) * count
);
424 dlist
->node
[0].opcode
= OPCODE_END_OF_LIST
;
430 * Lookup function to just encapsulate casting.
432 static INLINE
struct mesa_display_list
*
433 lookup_list(GLcontext
*ctx
, GLuint list
)
435 return (struct mesa_display_list
*)
436 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
442 * Delete the named display list, but don't remove from hash table.
443 * \param dlist - display list pointer
446 _mesa_delete_list(GLcontext
*ctx
, struct mesa_display_list
*dlist
)
451 n
= block
= dlist
->node
;
453 done
= block
? GL_FALSE
: GL_TRUE
;
456 /* check for extension opcodes first */
458 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
459 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
460 ctx
->ListExt
.Opcode
[i
].Destroy(ctx
, &n
[1]);
461 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
464 switch (n
[0].opcode
) {
465 /* for some commands, we need to free malloc'd memory */
467 _mesa_free(n
[6].data
);
468 n
+= InstSize
[n
[0].opcode
];
471 _mesa_free(n
[10].data
);
472 n
+= InstSize
[n
[0].opcode
];
474 case OPCODE_DRAW_PIXELS
:
475 _mesa_free(n
[5].data
);
476 n
+= InstSize
[n
[0].opcode
];
479 _mesa_free(n
[7].data
);
480 n
+= InstSize
[n
[0].opcode
];
482 case OPCODE_COLOR_TABLE
:
483 _mesa_free(n
[6].data
);
484 n
+= InstSize
[n
[0].opcode
];
486 case OPCODE_COLOR_SUB_TABLE
:
487 _mesa_free(n
[6].data
);
488 n
+= InstSize
[n
[0].opcode
];
490 case OPCODE_CONVOLUTION_FILTER_1D
:
491 _mesa_free(n
[6].data
);
492 n
+= InstSize
[n
[0].opcode
];
494 case OPCODE_CONVOLUTION_FILTER_2D
:
495 _mesa_free(n
[7].data
);
496 n
+= InstSize
[n
[0].opcode
];
498 case OPCODE_POLYGON_STIPPLE
:
499 _mesa_free(n
[1].data
);
500 n
+= InstSize
[n
[0].opcode
];
502 case OPCODE_TEX_IMAGE1D
:
503 _mesa_free(n
[8].data
);
504 n
+= InstSize
[n
[0].opcode
];
506 case OPCODE_TEX_IMAGE2D
:
507 _mesa_free(n
[9].data
);
508 n
+= InstSize
[n
[0].opcode
];
510 case OPCODE_TEX_IMAGE3D
:
511 _mesa_free(n
[10].data
);
512 n
+= InstSize
[n
[0].opcode
];
514 case OPCODE_TEX_SUB_IMAGE1D
:
515 _mesa_free(n
[7].data
);
516 n
+= InstSize
[n
[0].opcode
];
518 case OPCODE_TEX_SUB_IMAGE2D
:
519 _mesa_free(n
[9].data
);
520 n
+= InstSize
[n
[0].opcode
];
522 case OPCODE_TEX_SUB_IMAGE3D
:
523 _mesa_free(n
[11].data
);
524 n
+= InstSize
[n
[0].opcode
];
526 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
527 _mesa_free(n
[7].data
);
528 n
+= InstSize
[n
[0].opcode
];
530 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
531 _mesa_free(n
[8].data
);
532 n
+= InstSize
[n
[0].opcode
];
534 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
535 _mesa_free(n
[9].data
);
536 n
+= InstSize
[n
[0].opcode
];
538 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
539 _mesa_free(n
[7].data
);
540 n
+= InstSize
[n
[0].opcode
];
542 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
543 _mesa_free(n
[9].data
);
544 n
+= InstSize
[n
[0].opcode
];
546 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
547 _mesa_free(n
[11].data
);
548 n
+= InstSize
[n
[0].opcode
];
550 #if FEATURE_NV_vertex_program
551 case OPCODE_LOAD_PROGRAM_NV
:
552 _mesa_free(n
[4].data
); /* program string */
553 n
+= InstSize
[n
[0].opcode
];
555 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
556 _mesa_free(n
[2].data
); /* array of program ids */
557 n
+= InstSize
[n
[0].opcode
];
560 #if FEATURE_NV_fragment_program
561 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
562 _mesa_free(n
[3].data
); /* parameter name */
563 n
+= InstSize
[n
[0].opcode
];
566 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
567 case OPCODE_PROGRAM_STRING_ARB
:
568 _mesa_free(n
[4].data
); /* program string */
569 n
+= InstSize
[n
[0].opcode
];
572 case OPCODE_CONTINUE
:
573 n
= (Node
*) n
[1].next
;
577 case OPCODE_END_OF_LIST
:
582 /* Most frequent case */
583 n
+= InstSize
[n
[0].opcode
];
594 * Destroy a display list and remove from hash table.
595 * \param list - display list number
598 destroy_list(GLcontext
*ctx
, GLuint list
)
600 struct mesa_display_list
*dlist
;
605 dlist
= lookup_list(ctx
, list
);
609 _mesa_delete_list(ctx
, dlist
);
610 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
615 * Translate the nth element of list from type to GLuint.
618 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
630 bptr
= (GLbyte
*) list
;
631 return (GLuint
) *(bptr
+ n
);
632 case GL_UNSIGNED_BYTE
:
633 ubptr
= (GLubyte
*) list
;
634 return (GLuint
) *(ubptr
+ n
);
636 sptr
= (GLshort
*) list
;
637 return (GLuint
) *(sptr
+ n
);
638 case GL_UNSIGNED_SHORT
:
639 usptr
= (GLushort
*) list
;
640 return (GLuint
) *(usptr
+ n
);
642 iptr
= (GLint
*) list
;
643 return (GLuint
) *(iptr
+ n
);
644 case GL_UNSIGNED_INT
:
645 uiptr
= (GLuint
*) list
;
646 return (GLuint
) *(uiptr
+ n
);
648 fptr
= (GLfloat
*) list
;
649 return (GLuint
) *(fptr
+ n
);
651 ubptr
= ((GLubyte
*) list
) + 2 * n
;
652 return (GLuint
) *ubptr
* 256 + (GLuint
) * (ubptr
+ 1);
654 ubptr
= ((GLubyte
*) list
) + 3 * n
;
655 return (GLuint
) * ubptr
* 65536
656 + (GLuint
) *(ubptr
+ 1) * 256 + (GLuint
) * (ubptr
+ 2);
658 ubptr
= ((GLubyte
*) list
) + 4 * n
;
659 return (GLuint
) *ubptr
* 16777216
660 + (GLuint
) *(ubptr
+ 1) * 65536
661 + (GLuint
) *(ubptr
+ 2) * 256 + (GLuint
) * (ubptr
+ 3);
670 /**********************************************************************/
672 /**********************************************************************/
675 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
676 * \todo This won't suffice when the PBO is really in VRAM/GPU memory.
679 unpack_image(GLuint dimensions
, GLsizei width
, GLsizei height
, GLsizei depth
,
680 GLenum format
, GLenum type
, const GLvoid
* pixels
,
681 const struct gl_pixelstore_attrib
*unpack
)
683 if (unpack
->BufferObj
->Name
== 0) {
685 return _mesa_unpack_image(dimensions
, width
, height
, depth
, format
,
686 type
, pixels
, unpack
);
689 if (_mesa_validate_pbo_access
690 (dimensions
, unpack
, width
, height
, depth
, format
, type
, pixels
)) {
691 const GLubyte
*src
= ADD_POINTERS(unpack
->BufferObj
->Data
, pixels
);
692 return _mesa_unpack_image(dimensions
, width
, height
, depth
, format
,
701 * Allocate space for a display list instruction.
702 * \param opcode the instruction opcode (OPCODE_* value)
703 * \param size instruction size in bytes, not counting opcode.
704 * \return pointer to the usable data area (not including the internal
708 _mesa_alloc_instruction(GLcontext
*ctx
, GLuint opcode
, GLuint bytes
)
710 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
713 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
714 if (InstSize
[opcode
] == 0) {
715 /* save instruction size now */
716 InstSize
[opcode
] = numNodes
;
719 /* make sure instruction size agrees */
720 ASSERT(numNodes
== InstSize
[opcode
]);
724 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
725 /* This block is full. Allocate a new block and chain to it */
727 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
728 n
[0].opcode
= OPCODE_CONTINUE
;
729 newblock
= (Node
*) _mesa_malloc(sizeof(Node
) * BLOCK_SIZE
);
731 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
734 n
[1].next
= (Node
*) newblock
;
735 ctx
->ListState
.CurrentBlock
= newblock
;
736 ctx
->ListState
.CurrentPos
= 0;
739 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
740 ctx
->ListState
.CurrentPos
+= numNodes
;
742 n
[0].opcode
= (OpCode
) opcode
;
744 return (void *) (n
+ 1); /* return ptr to node following opcode */
749 * This function allows modules and drivers to get their own opcodes
750 * for extending display list functionality.
751 * \param ctx the rendering context
752 * \param size number of bytes for storing the new display list command
753 * \param execute function to execute the new display list command
754 * \param destroy function to destroy the new display list command
755 * \param print function to print the new display list command
756 * \return the new opcode number or -1 if error
759 _mesa_alloc_opcode(GLcontext
*ctx
,
761 void (*execute
) (GLcontext
*, void *),
762 void (*destroy
) (GLcontext
*, void *),
763 void (*print
) (GLcontext
*, void *))
765 if (ctx
->ListExt
.NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
766 const GLuint i
= ctx
->ListExt
.NumOpcodes
++;
767 ctx
->ListExt
.Opcode
[i
].Size
=
768 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
769 ctx
->ListExt
.Opcode
[i
].Execute
= execute
;
770 ctx
->ListExt
.Opcode
[i
].Destroy
= destroy
;
771 ctx
->ListExt
.Opcode
[i
].Print
= print
;
772 return i
+ OPCODE_EXT_0
;
780 * Allocate display list instruction. Returns Node ptr to where the opcode
782 * - nParams is the number of function parameters
783 * - return value a pointer to sizeof(Node) before the actual
786 #define ALLOC_INSTRUCTION(CTX, OPCODE, NPARAMS) \
787 ((Node *)_mesa_alloc_instruction(CTX, OPCODE, (NPARAMS)*sizeof(Node)) - 1)
792 * Display List compilation functions
794 static void GLAPIENTRY
795 save_Accum(GLenum op
, GLfloat value
)
797 GET_CURRENT_CONTEXT(ctx
);
799 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
800 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACCUM
, 2);
805 if (ctx
->ExecuteFlag
) {
806 CALL_Accum(ctx
->Exec
, (op
, value
));
811 static void GLAPIENTRY
812 save_AlphaFunc(GLenum func
, GLclampf ref
)
814 GET_CURRENT_CONTEXT(ctx
);
816 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
817 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ALPHA_FUNC
, 2);
820 n
[2].f
= (GLfloat
) ref
;
822 if (ctx
->ExecuteFlag
) {
823 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
828 static void GLAPIENTRY
829 save_BindTexture(GLenum target
, GLuint texture
)
831 GET_CURRENT_CONTEXT(ctx
);
833 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
834 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_TEXTURE
, 2);
839 if (ctx
->ExecuteFlag
) {
840 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
845 static void GLAPIENTRY
846 save_Bitmap(GLsizei width
, GLsizei height
,
847 GLfloat xorig
, GLfloat yorig
,
848 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
850 GET_CURRENT_CONTEXT(ctx
);
851 GLvoid
*image
= _mesa_unpack_bitmap(width
, height
, pixels
, &ctx
->Unpack
);
853 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
854 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BITMAP
, 7);
856 n
[1].i
= (GLint
) width
;
857 n
[2].i
= (GLint
) height
;
867 if (ctx
->ExecuteFlag
) {
868 CALL_Bitmap(ctx
->Exec
, (width
, height
,
869 xorig
, yorig
, xmove
, ymove
, pixels
));
874 static void GLAPIENTRY
875 save_BlendEquation(GLenum mode
)
877 GET_CURRENT_CONTEXT(ctx
);
879 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
880 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_EQUATION
, 1);
884 if (ctx
->ExecuteFlag
) {
885 CALL_BlendEquation(ctx
->Exec
, (mode
));
890 static void GLAPIENTRY
891 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
893 GET_CURRENT_CONTEXT(ctx
);
895 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
896 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
901 if (ctx
->ExecuteFlag
) {
902 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
907 static void GLAPIENTRY
908 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
909 GLenum sfactorA
, GLenum dfactorA
)
911 GET_CURRENT_CONTEXT(ctx
);
913 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
914 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
921 if (ctx
->ExecuteFlag
) {
922 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
923 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
928 static void GLAPIENTRY
929 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
931 GET_CURRENT_CONTEXT(ctx
);
933 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
934 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_COLOR
, 4);
941 if (ctx
->ExecuteFlag
) {
942 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
948 _mesa_save_CallList(GLuint list
)
950 GET_CURRENT_CONTEXT(ctx
);
952 SAVE_FLUSH_VERTICES(ctx
);
954 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CALL_LIST
, 1);
959 /* After this, we don't know what begin/end state we're in:
961 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
963 if (ctx
->ExecuteFlag
) {
964 CALL_CallList(ctx
->Exec
, (list
));
970 _mesa_save_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
972 GET_CURRENT_CONTEXT(ctx
);
974 GLboolean typeErrorFlag
;
976 SAVE_FLUSH_VERTICES(ctx
);
980 case GL_UNSIGNED_BYTE
:
982 case GL_UNSIGNED_SHORT
:
984 case GL_UNSIGNED_INT
:
989 typeErrorFlag
= GL_FALSE
;
992 typeErrorFlag
= GL_TRUE
;
995 for (i
= 0; i
< n
; i
++) {
996 GLuint list
= translate_id(i
, type
, lists
);
997 Node
*n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1000 n
[2].b
= typeErrorFlag
;
1004 /* After this, we don't know what begin/end state we're in:
1006 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1008 if (ctx
->ExecuteFlag
) {
1009 CALL_CallLists(ctx
->Exec
, (n
, type
, lists
));
1014 static void GLAPIENTRY
1015 save_Clear(GLbitfield mask
)
1017 GET_CURRENT_CONTEXT(ctx
);
1019 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1020 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR
, 1);
1024 if (ctx
->ExecuteFlag
) {
1025 CALL_Clear(ctx
->Exec
, (mask
));
1030 static void GLAPIENTRY
1031 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1033 GET_CURRENT_CONTEXT(ctx
);
1035 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1036 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1043 if (ctx
->ExecuteFlag
) {
1044 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1049 static void GLAPIENTRY
1050 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1052 GET_CURRENT_CONTEXT(ctx
);
1054 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1055 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_COLOR
, 4);
1062 if (ctx
->ExecuteFlag
) {
1063 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1068 static void GLAPIENTRY
1069 save_ClearDepth(GLclampd depth
)
1071 GET_CURRENT_CONTEXT(ctx
);
1073 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1074 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1076 n
[1].f
= (GLfloat
) depth
;
1078 if (ctx
->ExecuteFlag
) {
1079 CALL_ClearDepth(ctx
->Exec
, (depth
));
1084 static void GLAPIENTRY
1085 save_ClearIndex(GLfloat c
)
1087 GET_CURRENT_CONTEXT(ctx
);
1089 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1090 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_INDEX
, 1);
1094 if (ctx
->ExecuteFlag
) {
1095 CALL_ClearIndex(ctx
->Exec
, (c
));
1100 static void GLAPIENTRY
1101 save_ClearStencil(GLint s
)
1103 GET_CURRENT_CONTEXT(ctx
);
1105 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1106 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1110 if (ctx
->ExecuteFlag
) {
1111 CALL_ClearStencil(ctx
->Exec
, (s
));
1116 static void GLAPIENTRY
1117 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1119 GET_CURRENT_CONTEXT(ctx
);
1121 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1122 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLIP_PLANE
, 5);
1125 n
[2].f
= (GLfloat
) equ
[0];
1126 n
[3].f
= (GLfloat
) equ
[1];
1127 n
[4].f
= (GLfloat
) equ
[2];
1128 n
[5].f
= (GLfloat
) equ
[3];
1130 if (ctx
->ExecuteFlag
) {
1131 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1137 static void GLAPIENTRY
1138 save_ColorMask(GLboolean red
, GLboolean green
,
1139 GLboolean blue
, GLboolean alpha
)
1141 GET_CURRENT_CONTEXT(ctx
);
1143 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1144 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_MASK
, 4);
1151 if (ctx
->ExecuteFlag
) {
1152 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1157 static void GLAPIENTRY
1158 save_ColorMaterial(GLenum face
, GLenum mode
)
1160 GET_CURRENT_CONTEXT(ctx
);
1162 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1164 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1169 if (ctx
->ExecuteFlag
) {
1170 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1175 static void GLAPIENTRY
1176 save_ColorTable(GLenum target
, GLenum internalFormat
,
1177 GLsizei width
, GLenum format
, GLenum type
,
1178 const GLvoid
* table
)
1180 GET_CURRENT_CONTEXT(ctx
);
1181 if (_mesa_is_proxy_texture(target
)) {
1182 /* execute immediately */
1183 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1184 format
, type
, table
));
1187 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
, table
,
1190 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1191 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE
, 6);
1194 n
[2].e
= internalFormat
;
1203 if (ctx
->ExecuteFlag
) {
1204 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1205 format
, type
, table
));
1212 static void GLAPIENTRY
1213 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1214 const GLfloat
*params
)
1216 GET_CURRENT_CONTEXT(ctx
);
1219 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1221 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1226 if (pname
== GL_COLOR_TABLE_SGI
||
1227 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1228 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1229 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1236 if (ctx
->ExecuteFlag
) {
1237 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1242 static void GLAPIENTRY
1243 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1245 GET_CURRENT_CONTEXT(ctx
);
1248 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1250 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1255 if (pname
== GL_COLOR_TABLE_SGI
||
1256 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1257 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1258 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1265 if (ctx
->ExecuteFlag
) {
1266 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1272 static void GLAPIENTRY
1273 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1274 GLenum format
, GLenum type
, const GLvoid
* table
)
1276 GET_CURRENT_CONTEXT(ctx
);
1277 GLvoid
*image
= unpack_image(1, count
, 1, 1, format
, type
, table
,
1280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1281 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1293 if (ctx
->ExecuteFlag
) {
1294 CALL_ColorSubTable(ctx
->Exec
,
1295 (target
, start
, count
, format
, type
, table
));
1300 static void GLAPIENTRY
1301 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1302 GLint x
, GLint y
, GLsizei width
)
1304 GET_CURRENT_CONTEXT(ctx
);
1307 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1308 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1316 if (ctx
->ExecuteFlag
) {
1317 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1322 static void GLAPIENTRY
1323 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1324 GLint x
, GLint y
, GLsizei width
)
1326 GET_CURRENT_CONTEXT(ctx
);
1329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1330 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1333 n
[2].e
= internalformat
;
1338 if (ctx
->ExecuteFlag
) {
1339 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1344 static void GLAPIENTRY
1345 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1346 GLenum format
, GLenum type
, const GLvoid
* filter
)
1348 GET_CURRENT_CONTEXT(ctx
);
1349 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
, filter
,
1352 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1353 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1356 n
[2].e
= internalFormat
;
1365 if (ctx
->ExecuteFlag
) {
1366 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1367 format
, type
, filter
));
1372 static void GLAPIENTRY
1373 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1374 GLsizei width
, GLsizei height
, GLenum format
,
1375 GLenum type
, const GLvoid
* filter
)
1377 GET_CURRENT_CONTEXT(ctx
);
1378 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
, filter
,
1381 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1382 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1385 n
[2].e
= internalFormat
;
1395 if (ctx
->ExecuteFlag
) {
1396 CALL_ConvolutionFilter2D(ctx
->Exec
,
1397 (target
, internalFormat
, width
, height
, format
,
1403 static void GLAPIENTRY
1404 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1406 GET_CURRENT_CONTEXT(ctx
);
1408 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1409 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1415 if (ctx
->ExecuteFlag
) {
1416 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1421 static void GLAPIENTRY
1422 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1424 GET_CURRENT_CONTEXT(ctx
);
1426 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1427 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1432 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1433 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1434 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1440 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1443 if (ctx
->ExecuteFlag
) {
1444 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1449 static void GLAPIENTRY
1450 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1452 GET_CURRENT_CONTEXT(ctx
);
1454 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1455 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
1461 if (ctx
->ExecuteFlag
) {
1462 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
1467 static void GLAPIENTRY
1468 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
1469 const GLfloat
*params
)
1471 GET_CURRENT_CONTEXT(ctx
);
1473 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1474 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
1479 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1480 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1481 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1487 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1490 if (ctx
->ExecuteFlag
) {
1491 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
1496 static void GLAPIENTRY
1497 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1499 GET_CURRENT_CONTEXT(ctx
);
1501 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1502 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_PIXELS
, 5);
1506 n
[3].i
= (GLint
) width
;
1507 n
[4].i
= (GLint
) height
;
1510 if (ctx
->ExecuteFlag
) {
1511 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1517 static void GLAPIENTRY
1518 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1519 GLint x
, GLint y
, GLsizei width
, GLint border
)
1521 GET_CURRENT_CONTEXT(ctx
);
1523 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1524 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1528 n
[3].e
= internalformat
;
1534 if (ctx
->ExecuteFlag
) {
1535 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1536 x
, y
, width
, border
));
1541 static void GLAPIENTRY
1542 save_CopyTexImage2D(GLenum target
, GLint level
,
1543 GLenum internalformat
,
1544 GLint x
, GLint y
, GLsizei width
,
1545 GLsizei height
, GLint border
)
1547 GET_CURRENT_CONTEXT(ctx
);
1549 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1550 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1554 n
[3].e
= internalformat
;
1561 if (ctx
->ExecuteFlag
) {
1562 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1563 x
, y
, width
, height
, border
));
1569 static void GLAPIENTRY
1570 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1571 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1573 GET_CURRENT_CONTEXT(ctx
);
1575 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1576 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1585 if (ctx
->ExecuteFlag
) {
1586 CALL_CopyTexSubImage1D(ctx
->Exec
,
1587 (target
, level
, xoffset
, x
, y
, width
));
1592 static void GLAPIENTRY
1593 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1594 GLint xoffset
, GLint yoffset
,
1595 GLint x
, GLint y
, GLsizei width
, GLint height
)
1597 GET_CURRENT_CONTEXT(ctx
);
1599 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1600 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1611 if (ctx
->ExecuteFlag
) {
1612 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1613 x
, y
, width
, height
));
1618 static void GLAPIENTRY
1619 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1620 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1621 GLint x
, GLint y
, GLsizei width
, GLint height
)
1623 GET_CURRENT_CONTEXT(ctx
);
1625 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1626 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1638 if (ctx
->ExecuteFlag
) {
1639 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1640 xoffset
, yoffset
, zoffset
,
1641 x
, y
, width
, height
));
1646 static void GLAPIENTRY
1647 save_CullFace(GLenum mode
)
1649 GET_CURRENT_CONTEXT(ctx
);
1651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1652 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CULL_FACE
, 1);
1656 if (ctx
->ExecuteFlag
) {
1657 CALL_CullFace(ctx
->Exec
, (mode
));
1662 static void GLAPIENTRY
1663 save_DepthFunc(GLenum func
)
1665 GET_CURRENT_CONTEXT(ctx
);
1667 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1668 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_FUNC
, 1);
1672 if (ctx
->ExecuteFlag
) {
1673 CALL_DepthFunc(ctx
->Exec
, (func
));
1678 static void GLAPIENTRY
1679 save_DepthMask(GLboolean mask
)
1681 GET_CURRENT_CONTEXT(ctx
);
1683 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1684 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_MASK
, 1);
1688 if (ctx
->ExecuteFlag
) {
1689 CALL_DepthMask(ctx
->Exec
, (mask
));
1694 static void GLAPIENTRY
1695 save_DepthRange(GLclampd nearval
, GLclampd farval
)
1697 GET_CURRENT_CONTEXT(ctx
);
1699 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1700 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_RANGE
, 2);
1702 n
[1].f
= (GLfloat
) nearval
;
1703 n
[2].f
= (GLfloat
) farval
;
1705 if (ctx
->ExecuteFlag
) {
1706 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
1711 static void GLAPIENTRY
1712 save_Disable(GLenum cap
)
1714 GET_CURRENT_CONTEXT(ctx
);
1716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1717 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DISABLE
, 1);
1721 if (ctx
->ExecuteFlag
) {
1722 CALL_Disable(ctx
->Exec
, (cap
));
1727 static void GLAPIENTRY
1728 save_DrawBuffer(GLenum mode
)
1730 GET_CURRENT_CONTEXT(ctx
);
1732 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1733 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFER
, 1);
1737 if (ctx
->ExecuteFlag
) {
1738 CALL_DrawBuffer(ctx
->Exec
, (mode
));
1743 static void GLAPIENTRY
1744 save_DrawPixels(GLsizei width
, GLsizei height
,
1745 GLenum format
, GLenum type
, const GLvoid
* pixels
)
1747 GET_CURRENT_CONTEXT(ctx
);
1748 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
1749 pixels
, &ctx
->Unpack
);
1751 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1752 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_PIXELS
, 5);
1763 if (ctx
->ExecuteFlag
) {
1764 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
1770 static void GLAPIENTRY
1771 save_Enable(GLenum cap
)
1773 GET_CURRENT_CONTEXT(ctx
);
1775 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1776 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ENABLE
, 1);
1780 if (ctx
->ExecuteFlag
) {
1781 CALL_Enable(ctx
->Exec
, (cap
));
1787 static void GLAPIENTRY
1788 _mesa_save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
1790 GET_CURRENT_CONTEXT(ctx
);
1792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1793 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVALMESH1
, 3);
1799 if (ctx
->ExecuteFlag
) {
1800 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
1805 static void GLAPIENTRY
1806 _mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1808 GET_CURRENT_CONTEXT(ctx
);
1810 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1811 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVALMESH2
, 5);
1819 if (ctx
->ExecuteFlag
) {
1820 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
1827 static void GLAPIENTRY
1828 save_Fogfv(GLenum pname
, const GLfloat
*params
)
1830 GET_CURRENT_CONTEXT(ctx
);
1832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1833 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FOG
, 5);
1841 if (ctx
->ExecuteFlag
) {
1842 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
1847 static void GLAPIENTRY
1848 save_Fogf(GLenum pname
, GLfloat param
)
1850 save_Fogfv(pname
, ¶m
);
1854 static void GLAPIENTRY
1855 save_Fogiv(GLenum pname
, const GLint
*params
)
1860 case GL_FOG_DENSITY
:
1864 p
[0] = (GLfloat
) *params
;
1867 p
[0] = INT_TO_FLOAT(params
[0]);
1868 p
[1] = INT_TO_FLOAT(params
[1]);
1869 p
[2] = INT_TO_FLOAT(params
[2]);
1870 p
[3] = INT_TO_FLOAT(params
[3]);
1873 /* Error will be caught later in gl_Fogfv */
1876 save_Fogfv(pname
, p
);
1880 static void GLAPIENTRY
1881 save_Fogi(GLenum pname
, GLint param
)
1883 save_Fogiv(pname
, ¶m
);
1887 static void GLAPIENTRY
1888 save_FrontFace(GLenum mode
)
1890 GET_CURRENT_CONTEXT(ctx
);
1892 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1893 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FRONT_FACE
, 1);
1897 if (ctx
->ExecuteFlag
) {
1898 CALL_FrontFace(ctx
->Exec
, (mode
));
1903 static void GLAPIENTRY
1904 save_Frustum(GLdouble left
, GLdouble right
,
1905 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
1907 GET_CURRENT_CONTEXT(ctx
);
1909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1910 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FRUSTUM
, 6);
1912 n
[1].f
= (GLfloat
) left
;
1913 n
[2].f
= (GLfloat
) right
;
1914 n
[3].f
= (GLfloat
) bottom
;
1915 n
[4].f
= (GLfloat
) top
;
1916 n
[5].f
= (GLfloat
) nearval
;
1917 n
[6].f
= (GLfloat
) farval
;
1919 if (ctx
->ExecuteFlag
) {
1920 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
1925 static void GLAPIENTRY
1926 save_Hint(GLenum target
, GLenum mode
)
1928 GET_CURRENT_CONTEXT(ctx
);
1930 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1931 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_HINT
, 2);
1936 if (ctx
->ExecuteFlag
) {
1937 CALL_Hint(ctx
->Exec
, (target
, mode
));
1942 static void GLAPIENTRY
1943 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
1946 GET_CURRENT_CONTEXT(ctx
);
1949 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1950 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_HISTOGRAM
, 4);
1954 n
[3].e
= internalFormat
;
1957 if (ctx
->ExecuteFlag
) {
1958 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
1963 static void GLAPIENTRY
1964 save_IndexMask(GLuint mask
)
1966 GET_CURRENT_CONTEXT(ctx
);
1968 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1969 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_INDEX_MASK
, 1);
1973 if (ctx
->ExecuteFlag
) {
1974 CALL_IndexMask(ctx
->Exec
, (mask
));
1979 static void GLAPIENTRY
1980 save_InitNames(void)
1982 GET_CURRENT_CONTEXT(ctx
);
1983 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1984 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_INIT_NAMES
, 0);
1985 if (ctx
->ExecuteFlag
) {
1986 CALL_InitNames(ctx
->Exec
, ());
1991 static void GLAPIENTRY
1992 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
1994 GET_CURRENT_CONTEXT(ctx
);
1996 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1997 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIGHT
, 6);
2015 case GL_SPOT_DIRECTION
:
2018 case GL_SPOT_EXPONENT
:
2021 case GL_SPOT_CUTOFF
:
2024 case GL_CONSTANT_ATTENUATION
:
2027 case GL_LINEAR_ATTENUATION
:
2030 case GL_QUADRATIC_ATTENUATION
:
2036 for (i
= 0; i
< nParams
; i
++) {
2037 n
[3 + i
].f
= params
[i
];
2040 if (ctx
->ExecuteFlag
) {
2041 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2046 static void GLAPIENTRY
2047 save_Lightf(GLenum light
, GLenum pname
, GLfloat params
)
2049 save_Lightfv(light
, pname
, ¶ms
);
2053 static void GLAPIENTRY
2054 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2061 fparam
[0] = INT_TO_FLOAT(params
[0]);
2062 fparam
[1] = INT_TO_FLOAT(params
[1]);
2063 fparam
[2] = INT_TO_FLOAT(params
[2]);
2064 fparam
[3] = INT_TO_FLOAT(params
[3]);
2067 fparam
[0] = (GLfloat
) params
[0];
2068 fparam
[1] = (GLfloat
) params
[1];
2069 fparam
[2] = (GLfloat
) params
[2];
2070 fparam
[3] = (GLfloat
) params
[3];
2072 case GL_SPOT_DIRECTION
:
2073 fparam
[0] = (GLfloat
) params
[0];
2074 fparam
[1] = (GLfloat
) params
[1];
2075 fparam
[2] = (GLfloat
) params
[2];
2077 case GL_SPOT_EXPONENT
:
2078 case GL_SPOT_CUTOFF
:
2079 case GL_CONSTANT_ATTENUATION
:
2080 case GL_LINEAR_ATTENUATION
:
2081 case GL_QUADRATIC_ATTENUATION
:
2082 fparam
[0] = (GLfloat
) params
[0];
2085 /* error will be caught later in gl_Lightfv */
2088 save_Lightfv(light
, pname
, fparam
);
2092 static void GLAPIENTRY
2093 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2095 save_Lightiv(light
, pname
, ¶m
);
2099 static void GLAPIENTRY
2100 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2102 GET_CURRENT_CONTEXT(ctx
);
2104 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2105 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIGHT_MODEL
, 5);
2113 if (ctx
->ExecuteFlag
) {
2114 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2119 static void GLAPIENTRY
2120 save_LightModelf(GLenum pname
, GLfloat param
)
2122 save_LightModelfv(pname
, ¶m
);
2126 static void GLAPIENTRY
2127 save_LightModeliv(GLenum pname
, const GLint
*params
)
2131 case GL_LIGHT_MODEL_AMBIENT
:
2132 fparam
[0] = INT_TO_FLOAT(params
[0]);
2133 fparam
[1] = INT_TO_FLOAT(params
[1]);
2134 fparam
[2] = INT_TO_FLOAT(params
[2]);
2135 fparam
[3] = INT_TO_FLOAT(params
[3]);
2137 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2138 case GL_LIGHT_MODEL_TWO_SIDE
:
2139 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2140 fparam
[0] = (GLfloat
) params
[0];
2143 /* Error will be caught later in gl_LightModelfv */
2146 save_LightModelfv(pname
, fparam
);
2150 static void GLAPIENTRY
2151 save_LightModeli(GLenum pname
, GLint param
)
2153 save_LightModeliv(pname
, ¶m
);
2157 static void GLAPIENTRY
2158 save_LineStipple(GLint factor
, GLushort pattern
)
2160 GET_CURRENT_CONTEXT(ctx
);
2162 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2163 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LINE_STIPPLE
, 2);
2168 if (ctx
->ExecuteFlag
) {
2169 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2174 static void GLAPIENTRY
2175 save_LineWidth(GLfloat width
)
2177 GET_CURRENT_CONTEXT(ctx
);
2179 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2180 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LINE_WIDTH
, 1);
2184 if (ctx
->ExecuteFlag
) {
2185 CALL_LineWidth(ctx
->Exec
, (width
));
2190 static void GLAPIENTRY
2191 save_ListBase(GLuint base
)
2193 GET_CURRENT_CONTEXT(ctx
);
2195 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2196 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIST_BASE
, 1);
2200 if (ctx
->ExecuteFlag
) {
2201 CALL_ListBase(ctx
->Exec
, (base
));
2206 static void GLAPIENTRY
2207 save_LoadIdentity(void)
2209 GET_CURRENT_CONTEXT(ctx
);
2210 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2211 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2212 if (ctx
->ExecuteFlag
) {
2213 CALL_LoadIdentity(ctx
->Exec
, ());
2218 static void GLAPIENTRY
2219 save_LoadMatrixf(const GLfloat
* m
)
2221 GET_CURRENT_CONTEXT(ctx
);
2223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2224 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_MATRIX
, 16);
2227 for (i
= 0; i
< 16; i
++) {
2231 if (ctx
->ExecuteFlag
) {
2232 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2237 static void GLAPIENTRY
2238 save_LoadMatrixd(const GLdouble
* m
)
2242 for (i
= 0; i
< 16; i
++) {
2243 f
[i
] = (GLfloat
) m
[i
];
2245 save_LoadMatrixf(f
);
2249 static void GLAPIENTRY
2250 save_LoadName(GLuint name
)
2252 GET_CURRENT_CONTEXT(ctx
);
2254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2255 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_NAME
, 1);
2259 if (ctx
->ExecuteFlag
) {
2260 CALL_LoadName(ctx
->Exec
, (name
));
2265 static void GLAPIENTRY
2266 save_LogicOp(GLenum opcode
)
2268 GET_CURRENT_CONTEXT(ctx
);
2270 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2271 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOGIC_OP
, 1);
2275 if (ctx
->ExecuteFlag
) {
2276 CALL_LogicOp(ctx
->Exec
, (opcode
));
2281 static void GLAPIENTRY
2282 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2283 GLint order
, const GLdouble
* points
)
2285 GET_CURRENT_CONTEXT(ctx
);
2287 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2288 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP1
, 6);
2290 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2292 n
[2].f
= (GLfloat
) u1
;
2293 n
[3].f
= (GLfloat
) u2
;
2294 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2296 n
[6].data
= (void *) pnts
;
2298 if (ctx
->ExecuteFlag
) {
2299 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2303 static void GLAPIENTRY
2304 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2305 GLint order
, const GLfloat
* points
)
2307 GET_CURRENT_CONTEXT(ctx
);
2309 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2310 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP1
, 6);
2312 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2316 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2318 n
[6].data
= (void *) pnts
;
2320 if (ctx
->ExecuteFlag
) {
2321 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2326 static void GLAPIENTRY
2327 save_Map2d(GLenum target
,
2328 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2329 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2330 const GLdouble
* points
)
2332 GET_CURRENT_CONTEXT(ctx
);
2334 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2335 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP2
, 10);
2337 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2338 vstride
, vorder
, points
);
2340 n
[2].f
= (GLfloat
) u1
;
2341 n
[3].f
= (GLfloat
) u2
;
2342 n
[4].f
= (GLfloat
) v1
;
2343 n
[5].f
= (GLfloat
) v2
;
2344 /* XXX verify these strides are correct */
2345 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2346 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2349 n
[10].data
= (void *) pnts
;
2351 if (ctx
->ExecuteFlag
) {
2352 CALL_Map2d(ctx
->Exec
, (target
,
2353 u1
, u2
, ustride
, uorder
,
2354 v1
, v2
, vstride
, vorder
, points
));
2359 static void GLAPIENTRY
2360 save_Map2f(GLenum target
,
2361 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2362 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2363 const GLfloat
* points
)
2365 GET_CURRENT_CONTEXT(ctx
);
2367 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2368 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP2
, 10);
2370 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2371 vstride
, vorder
, points
);
2377 /* XXX verify these strides are correct */
2378 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2379 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2382 n
[10].data
= (void *) pnts
;
2384 if (ctx
->ExecuteFlag
) {
2385 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2386 v1
, v2
, vstride
, vorder
, points
));
2391 static void GLAPIENTRY
2392 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2394 GET_CURRENT_CONTEXT(ctx
);
2396 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2397 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAPGRID1
, 3);
2403 if (ctx
->ExecuteFlag
) {
2404 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2409 static void GLAPIENTRY
2410 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2412 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2416 static void GLAPIENTRY
2417 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2418 GLint vn
, GLfloat v1
, GLfloat v2
)
2420 GET_CURRENT_CONTEXT(ctx
);
2422 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2423 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAPGRID2
, 6);
2432 if (ctx
->ExecuteFlag
) {
2433 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2439 static void GLAPIENTRY
2440 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2441 GLint vn
, GLdouble v1
, GLdouble v2
)
2443 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2444 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2448 static void GLAPIENTRY
2449 save_MatrixMode(GLenum mode
)
2451 GET_CURRENT_CONTEXT(ctx
);
2453 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2454 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATRIX_MODE
, 1);
2458 if (ctx
->ExecuteFlag
) {
2459 CALL_MatrixMode(ctx
->Exec
, (mode
));
2464 static void GLAPIENTRY
2465 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2467 GET_CURRENT_CONTEXT(ctx
);
2470 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2471 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MIN_MAX
, 3);
2474 n
[2].e
= internalFormat
;
2477 if (ctx
->ExecuteFlag
) {
2478 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
2483 static void GLAPIENTRY
2484 save_MultMatrixf(const GLfloat
* m
)
2486 GET_CURRENT_CONTEXT(ctx
);
2488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2489 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MULT_MATRIX
, 16);
2492 for (i
= 0; i
< 16; i
++) {
2496 if (ctx
->ExecuteFlag
) {
2497 CALL_MultMatrixf(ctx
->Exec
, (m
));
2502 static void GLAPIENTRY
2503 save_MultMatrixd(const GLdouble
* m
)
2507 for (i
= 0; i
< 16; i
++) {
2508 f
[i
] = (GLfloat
) m
[i
];
2510 save_MultMatrixf(f
);
2514 static void GLAPIENTRY
2515 save_NewList(GLuint list
, GLenum mode
)
2517 GET_CURRENT_CONTEXT(ctx
);
2518 /* It's an error to call this function while building a display list */
2519 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2526 static void GLAPIENTRY
2527 save_Ortho(GLdouble left
, GLdouble right
,
2528 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2530 GET_CURRENT_CONTEXT(ctx
);
2532 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2533 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ORTHO
, 6);
2535 n
[1].f
= (GLfloat
) left
;
2536 n
[2].f
= (GLfloat
) right
;
2537 n
[3].f
= (GLfloat
) bottom
;
2538 n
[4].f
= (GLfloat
) top
;
2539 n
[5].f
= (GLfloat
) nearval
;
2540 n
[6].f
= (GLfloat
) farval
;
2542 if (ctx
->ExecuteFlag
) {
2543 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2548 static void GLAPIENTRY
2549 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2551 GET_CURRENT_CONTEXT(ctx
);
2553 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2554 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_MAP
, 3);
2558 n
[3].data
= (void *) _mesa_malloc(mapsize
* sizeof(GLfloat
));
2559 MEMCPY(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
2561 if (ctx
->ExecuteFlag
) {
2562 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2567 static void GLAPIENTRY
2568 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2570 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2572 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2573 for (i
= 0; i
< mapsize
; i
++) {
2574 fvalues
[i
] = (GLfloat
) values
[i
];
2578 for (i
= 0; i
< mapsize
; i
++) {
2579 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2582 save_PixelMapfv(map
, mapsize
, fvalues
);
2586 static void GLAPIENTRY
2587 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2589 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2591 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2592 for (i
= 0; i
< mapsize
; i
++) {
2593 fvalues
[i
] = (GLfloat
) values
[i
];
2597 for (i
= 0; i
< mapsize
; i
++) {
2598 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
2601 save_PixelMapfv(map
, mapsize
, fvalues
);
2605 static void GLAPIENTRY
2606 save_PixelTransferf(GLenum pname
, GLfloat param
)
2608 GET_CURRENT_CONTEXT(ctx
);
2610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2611 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2616 if (ctx
->ExecuteFlag
) {
2617 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
2622 static void GLAPIENTRY
2623 save_PixelTransferi(GLenum pname
, GLint param
)
2625 save_PixelTransferf(pname
, (GLfloat
) param
);
2629 static void GLAPIENTRY
2630 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
2632 GET_CURRENT_CONTEXT(ctx
);
2634 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2635 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_ZOOM
, 2);
2640 if (ctx
->ExecuteFlag
) {
2641 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
2646 static void GLAPIENTRY
2647 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
2649 GET_CURRENT_CONTEXT(ctx
);
2651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2652 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POINT_PARAMETERS
, 4);
2659 if (ctx
->ExecuteFlag
) {
2660 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
2665 static void GLAPIENTRY
2666 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
2668 save_PointParameterfvEXT(pname
, ¶m
);
2671 static void GLAPIENTRY
2672 save_PointParameteriNV(GLenum pname
, GLint param
)
2674 GLfloat p
= (GLfloat
) param
;
2675 save_PointParameterfvEXT(pname
, &p
);
2678 static void GLAPIENTRY
2679 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
2681 GLfloat p
= (GLfloat
) param
[0];
2682 save_PointParameterfvEXT(pname
, &p
);
2686 static void GLAPIENTRY
2687 save_PointSize(GLfloat size
)
2689 GET_CURRENT_CONTEXT(ctx
);
2691 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2692 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POINT_SIZE
, 1);
2696 if (ctx
->ExecuteFlag
) {
2697 CALL_PointSize(ctx
->Exec
, (size
));
2702 static void GLAPIENTRY
2703 save_PolygonMode(GLenum face
, GLenum mode
)
2705 GET_CURRENT_CONTEXT(ctx
);
2707 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2708 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_MODE
, 2);
2713 if (ctx
->ExecuteFlag
) {
2714 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
2720 * Polygon stipple must have been upacked already!
2722 static void GLAPIENTRY
2723 save_PolygonStipple(const GLubyte
* pattern
)
2725 GET_CURRENT_CONTEXT(ctx
);
2727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2728 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
2731 n
[1].data
= _mesa_malloc(32 * 4);
2732 data
= n
[1].data
; /* This needed for Acorn compiler */
2733 MEMCPY(data
, pattern
, 32 * 4);
2735 if (ctx
->ExecuteFlag
) {
2736 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
2741 static void GLAPIENTRY
2742 save_PolygonOffset(GLfloat factor
, GLfloat units
)
2744 GET_CURRENT_CONTEXT(ctx
);
2746 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2747 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_OFFSET
, 2);
2752 if (ctx
->ExecuteFlag
) {
2753 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
2758 static void GLAPIENTRY
2759 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
2761 GET_CURRENT_CONTEXT(ctx
);
2762 /* XXX mult by DepthMaxF here??? */
2763 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
2767 static void GLAPIENTRY
2768 save_PopAttrib(void)
2770 GET_CURRENT_CONTEXT(ctx
);
2771 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2772 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_ATTRIB
, 0);
2773 if (ctx
->ExecuteFlag
) {
2774 CALL_PopAttrib(ctx
->Exec
, ());
2779 static void GLAPIENTRY
2780 save_PopMatrix(void)
2782 GET_CURRENT_CONTEXT(ctx
);
2783 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2784 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_MATRIX
, 0);
2785 if (ctx
->ExecuteFlag
) {
2786 CALL_PopMatrix(ctx
->Exec
, ());
2791 static void GLAPIENTRY
2794 GET_CURRENT_CONTEXT(ctx
);
2795 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2796 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_NAME
, 0);
2797 if (ctx
->ExecuteFlag
) {
2798 CALL_PopName(ctx
->Exec
, ());
2803 static void GLAPIENTRY
2804 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
2805 const GLclampf
* priorities
)
2807 GET_CURRENT_CONTEXT(ctx
);
2809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2811 for (i
= 0; i
< num
; i
++) {
2813 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
2815 n
[1].ui
= textures
[i
];
2816 n
[2].f
= priorities
[i
];
2819 if (ctx
->ExecuteFlag
) {
2820 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
2825 static void GLAPIENTRY
2826 save_PushAttrib(GLbitfield mask
)
2828 GET_CURRENT_CONTEXT(ctx
);
2830 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2831 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_ATTRIB
, 1);
2835 if (ctx
->ExecuteFlag
) {
2836 CALL_PushAttrib(ctx
->Exec
, (mask
));
2841 static void GLAPIENTRY
2842 save_PushMatrix(void)
2844 GET_CURRENT_CONTEXT(ctx
);
2845 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2846 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_MATRIX
, 0);
2847 if (ctx
->ExecuteFlag
) {
2848 CALL_PushMatrix(ctx
->Exec
, ());
2853 static void GLAPIENTRY
2854 save_PushName(GLuint name
)
2856 GET_CURRENT_CONTEXT(ctx
);
2858 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2859 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_NAME
, 1);
2863 if (ctx
->ExecuteFlag
) {
2864 CALL_PushName(ctx
->Exec
, (name
));
2869 static void GLAPIENTRY
2870 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2872 GET_CURRENT_CONTEXT(ctx
);
2874 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2875 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RASTER_POS
, 4);
2882 if (ctx
->ExecuteFlag
) {
2883 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
2887 static void GLAPIENTRY
2888 save_RasterPos2d(GLdouble x
, GLdouble y
)
2890 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2893 static void GLAPIENTRY
2894 save_RasterPos2f(GLfloat x
, GLfloat y
)
2896 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2899 static void GLAPIENTRY
2900 save_RasterPos2i(GLint x
, GLint y
)
2902 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2905 static void GLAPIENTRY
2906 save_RasterPos2s(GLshort x
, GLshort y
)
2908 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2911 static void GLAPIENTRY
2912 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2914 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2917 static void GLAPIENTRY
2918 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2920 save_RasterPos4f(x
, y
, z
, 1.0F
);
2923 static void GLAPIENTRY
2924 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2926 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2929 static void GLAPIENTRY
2930 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2932 save_RasterPos4f(x
, y
, z
, 1.0F
);
2935 static void GLAPIENTRY
2936 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2938 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2941 static void GLAPIENTRY
2942 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
2944 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2947 static void GLAPIENTRY
2948 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
2950 save_RasterPos4f(x
, y
, z
, w
);
2953 static void GLAPIENTRY
2954 save_RasterPos2dv(const GLdouble
* v
)
2956 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2959 static void GLAPIENTRY
2960 save_RasterPos2fv(const GLfloat
* v
)
2962 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2965 static void GLAPIENTRY
2966 save_RasterPos2iv(const GLint
* v
)
2968 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2971 static void GLAPIENTRY
2972 save_RasterPos2sv(const GLshort
* v
)
2974 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2977 static void GLAPIENTRY
2978 save_RasterPos3dv(const GLdouble
* v
)
2980 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2983 static void GLAPIENTRY
2984 save_RasterPos3fv(const GLfloat
* v
)
2986 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
2989 static void GLAPIENTRY
2990 save_RasterPos3iv(const GLint
* v
)
2992 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2995 static void GLAPIENTRY
2996 save_RasterPos3sv(const GLshort
* v
)
2998 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3001 static void GLAPIENTRY
3002 save_RasterPos4dv(const GLdouble
* v
)
3004 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3005 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3008 static void GLAPIENTRY
3009 save_RasterPos4fv(const GLfloat
* v
)
3011 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3014 static void GLAPIENTRY
3015 save_RasterPos4iv(const GLint
* v
)
3017 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3018 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3021 static void GLAPIENTRY
3022 save_RasterPos4sv(const GLshort
* v
)
3024 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3028 static void GLAPIENTRY
3029 save_PassThrough(GLfloat token
)
3031 GET_CURRENT_CONTEXT(ctx
);
3033 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3034 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PASSTHROUGH
, 1);
3038 if (ctx
->ExecuteFlag
) {
3039 CALL_PassThrough(ctx
->Exec
, (token
));
3044 static void GLAPIENTRY
3045 save_ReadBuffer(GLenum mode
)
3047 GET_CURRENT_CONTEXT(ctx
);
3049 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3050 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_READ_BUFFER
, 1);
3054 if (ctx
->ExecuteFlag
) {
3055 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3060 static void GLAPIENTRY
3061 save_ResetHistogram(GLenum target
)
3063 GET_CURRENT_CONTEXT(ctx
);
3065 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3066 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3070 if (ctx
->ExecuteFlag
) {
3071 CALL_ResetHistogram(ctx
->Exec
, (target
));
3076 static void GLAPIENTRY
3077 save_ResetMinmax(GLenum target
)
3079 GET_CURRENT_CONTEXT(ctx
);
3081 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3082 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3086 if (ctx
->ExecuteFlag
) {
3087 CALL_ResetMinmax(ctx
->Exec
, (target
));
3092 static void GLAPIENTRY
3093 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3095 GET_CURRENT_CONTEXT(ctx
);
3097 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3098 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ROTATE
, 4);
3105 if (ctx
->ExecuteFlag
) {
3106 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3111 static void GLAPIENTRY
3112 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3114 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3118 static void GLAPIENTRY
3119 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3121 GET_CURRENT_CONTEXT(ctx
);
3123 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3124 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCALE
, 3);
3130 if (ctx
->ExecuteFlag
) {
3131 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3136 static void GLAPIENTRY
3137 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3139 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3143 static void GLAPIENTRY
3144 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3146 GET_CURRENT_CONTEXT(ctx
);
3148 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3149 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCISSOR
, 4);
3156 if (ctx
->ExecuteFlag
) {
3157 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3162 static void GLAPIENTRY
3163 save_ShadeModel(GLenum mode
)
3165 GET_CURRENT_CONTEXT(ctx
);
3167 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3168 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SHADE_MODEL
, 1);
3172 if (ctx
->ExecuteFlag
) {
3173 CALL_ShadeModel(ctx
->Exec
, (mode
));
3178 static void GLAPIENTRY
3179 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3181 GET_CURRENT_CONTEXT(ctx
);
3183 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3184 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC
, 3);
3190 if (ctx
->ExecuteFlag
) {
3191 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3196 static void GLAPIENTRY
3197 save_StencilMask(GLuint mask
)
3199 GET_CURRENT_CONTEXT(ctx
);
3201 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3202 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK
, 1);
3206 if (ctx
->ExecuteFlag
) {
3207 CALL_StencilMask(ctx
->Exec
, (mask
));
3212 static void GLAPIENTRY
3213 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3215 GET_CURRENT_CONTEXT(ctx
);
3217 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3218 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP
, 3);
3224 if (ctx
->ExecuteFlag
) {
3225 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3230 static void GLAPIENTRY
3231 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3233 GET_CURRENT_CONTEXT(ctx
);
3235 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3236 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3243 if (ctx
->ExecuteFlag
) {
3244 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3249 static void GLAPIENTRY
3250 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3252 GET_CURRENT_CONTEXT(ctx
);
3254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3255 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3260 if (ctx
->ExecuteFlag
) {
3261 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3266 static void GLAPIENTRY
3267 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3269 GET_CURRENT_CONTEXT(ctx
);
3271 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3272 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3279 if (ctx
->ExecuteFlag
) {
3280 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3285 static void GLAPIENTRY
3286 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3288 GET_CURRENT_CONTEXT(ctx
);
3290 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3291 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXENV
, 6);
3295 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3303 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3306 if (ctx
->ExecuteFlag
) {
3307 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3312 static void GLAPIENTRY
3313 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3315 save_TexEnvfv(target
, pname
, ¶m
);
3319 static void GLAPIENTRY
3320 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3323 p
[0] = (GLfloat
) param
;
3324 p
[1] = p
[2] = p
[3] = 0.0;
3325 save_TexEnvfv(target
, pname
, p
);
3329 static void GLAPIENTRY
3330 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3333 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3334 p
[0] = INT_TO_FLOAT(param
[0]);
3335 p
[1] = INT_TO_FLOAT(param
[1]);
3336 p
[2] = INT_TO_FLOAT(param
[2]);
3337 p
[3] = INT_TO_FLOAT(param
[3]);
3340 p
[0] = (GLfloat
) param
[0];
3341 p
[1] = p
[2] = p
[3] = 0.0F
;
3343 save_TexEnvfv(target
, pname
, p
);
3347 static void GLAPIENTRY
3348 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3350 GET_CURRENT_CONTEXT(ctx
);
3352 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3353 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXGEN
, 6);
3362 if (ctx
->ExecuteFlag
) {
3363 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3368 static void GLAPIENTRY
3369 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3372 p
[0] = (GLfloat
) params
[0];
3373 p
[1] = (GLfloat
) params
[1];
3374 p
[2] = (GLfloat
) params
[2];
3375 p
[3] = (GLfloat
) params
[3];
3376 save_TexGenfv(coord
, pname
, p
);
3380 static void GLAPIENTRY
3381 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3383 GLfloat p
= (GLfloat
) param
;
3384 save_TexGenfv(coord
, pname
, &p
);
3388 static void GLAPIENTRY
3389 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3392 p
[0] = (GLfloat
) params
[0];
3393 p
[1] = (GLfloat
) params
[1];
3394 p
[2] = (GLfloat
) params
[2];
3395 p
[3] = (GLfloat
) params
[3];
3396 save_TexGenfv(coord
, pname
, p
);
3400 static void GLAPIENTRY
3401 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3403 save_TexGenfv(coord
, pname
, ¶m
);
3407 static void GLAPIENTRY
3408 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3410 save_TexGeniv(coord
, pname
, ¶m
);
3414 static void GLAPIENTRY
3415 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3417 GET_CURRENT_CONTEXT(ctx
);
3419 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3420 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXPARAMETER
, 6);
3429 if (ctx
->ExecuteFlag
) {
3430 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3435 static void GLAPIENTRY
3436 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3438 save_TexParameterfv(target
, pname
, ¶m
);
3442 static void GLAPIENTRY
3443 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3446 fparam
[0] = (GLfloat
) param
;
3447 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3448 save_TexParameterfv(target
, pname
, fparam
);
3452 static void GLAPIENTRY
3453 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3456 fparam
[0] = (GLfloat
) params
[0];
3457 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3458 save_TexParameterfv(target
, pname
, fparam
);
3462 static void GLAPIENTRY
3463 save_TexImage1D(GLenum target
,
3464 GLint level
, GLint components
,
3465 GLsizei width
, GLint border
,
3466 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3468 GET_CURRENT_CONTEXT(ctx
);
3469 if (target
== GL_PROXY_TEXTURE_1D
) {
3470 /* don't compile, execute immediately */
3471 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3472 border
, format
, type
, pixels
));
3475 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
,
3476 pixels
, &ctx
->Unpack
);
3478 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3479 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE1D
, 8);
3483 n
[3].i
= components
;
3484 n
[4].i
= (GLint
) width
;
3493 if (ctx
->ExecuteFlag
) {
3494 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3495 border
, format
, type
, pixels
));
3501 static void GLAPIENTRY
3502 save_TexImage2D(GLenum target
,
3503 GLint level
, GLint components
,
3504 GLsizei width
, GLsizei height
, GLint border
,
3505 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3507 GET_CURRENT_CONTEXT(ctx
);
3508 if (target
== GL_PROXY_TEXTURE_2D
) {
3509 /* don't compile, execute immediately */
3510 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3511 height
, border
, format
, type
, pixels
));
3514 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
3515 pixels
, &ctx
->Unpack
);
3517 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3518 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE2D
, 9);
3522 n
[3].i
= components
;
3523 n
[4].i
= (GLint
) width
;
3524 n
[5].i
= (GLint
) height
;
3533 if (ctx
->ExecuteFlag
) {
3534 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3535 height
, border
, format
, type
, pixels
));
3541 static void GLAPIENTRY
3542 save_TexImage3D(GLenum target
,
3543 GLint level
, GLint internalFormat
,
3544 GLsizei width
, GLsizei height
, GLsizei depth
,
3546 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3548 GET_CURRENT_CONTEXT(ctx
);
3549 if (target
== GL_PROXY_TEXTURE_3D
) {
3550 /* don't compile, execute immediately */
3551 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3552 height
, depth
, border
, format
, type
,
3557 GLvoid
*image
= unpack_image(3, width
, height
, depth
, format
, type
,
3558 pixels
, &ctx
->Unpack
);
3559 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3560 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE3D
, 10);
3564 n
[3].i
= (GLint
) internalFormat
;
3565 n
[4].i
= (GLint
) width
;
3566 n
[5].i
= (GLint
) height
;
3567 n
[6].i
= (GLint
) depth
;
3576 if (ctx
->ExecuteFlag
) {
3577 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3578 height
, depth
, border
, format
, type
,
3585 static void GLAPIENTRY
3586 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
3587 GLsizei width
, GLenum format
, GLenum type
,
3588 const GLvoid
* pixels
)
3590 GET_CURRENT_CONTEXT(ctx
);
3592 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
,
3593 pixels
, &ctx
->Unpack
);
3594 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3595 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
3600 n
[4].i
= (GLint
) width
;
3608 if (ctx
->ExecuteFlag
) {
3609 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
3610 format
, type
, pixels
));
3615 static void GLAPIENTRY
3616 save_TexSubImage2D(GLenum target
, GLint level
,
3617 GLint xoffset
, GLint yoffset
,
3618 GLsizei width
, GLsizei height
,
3619 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3621 GET_CURRENT_CONTEXT(ctx
);
3623 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
3624 pixels
, &ctx
->Unpack
);
3625 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3626 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
3632 n
[5].i
= (GLint
) width
;
3633 n
[6].i
= (GLint
) height
;
3641 if (ctx
->ExecuteFlag
) {
3642 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
3643 width
, height
, format
, type
, pixels
));
3648 static void GLAPIENTRY
3649 save_TexSubImage3D(GLenum target
, GLint level
,
3650 GLint xoffset
, GLint yoffset
, GLint zoffset
,
3651 GLsizei width
, GLsizei height
, GLsizei depth
,
3652 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3654 GET_CURRENT_CONTEXT(ctx
);
3656 GLvoid
*image
= unpack_image(3, width
, height
, depth
, format
, type
,
3657 pixels
, &ctx
->Unpack
);
3658 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3659 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
3666 n
[6].i
= (GLint
) width
;
3667 n
[7].i
= (GLint
) height
;
3668 n
[8].i
= (GLint
) depth
;
3676 if (ctx
->ExecuteFlag
) {
3677 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
3678 xoffset
, yoffset
, zoffset
,
3679 width
, height
, depth
, format
, type
,
3685 static void GLAPIENTRY
3686 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
3688 GET_CURRENT_CONTEXT(ctx
);
3690 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3691 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRANSLATE
, 3);
3697 if (ctx
->ExecuteFlag
) {
3698 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
3703 static void GLAPIENTRY
3704 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
3706 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3711 static void GLAPIENTRY
3712 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3714 GET_CURRENT_CONTEXT(ctx
);
3716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3717 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_VIEWPORT
, 4);
3721 n
[3].i
= (GLint
) width
;
3722 n
[4].i
= (GLint
) height
;
3724 if (ctx
->ExecuteFlag
) {
3725 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
3730 static void GLAPIENTRY
3731 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3733 GET_CURRENT_CONTEXT(ctx
);
3735 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3736 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_WINDOW_POS
, 4);
3743 if (ctx
->ExecuteFlag
) {
3744 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
3748 static void GLAPIENTRY
3749 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3751 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3754 static void GLAPIENTRY
3755 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3757 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3760 static void GLAPIENTRY
3761 save_WindowPos2iMESA(GLint x
, GLint y
)
3763 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3766 static void GLAPIENTRY
3767 save_WindowPos2sMESA(GLshort x
, GLshort y
)
3769 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3772 static void GLAPIENTRY
3773 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3775 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3778 static void GLAPIENTRY
3779 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3781 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3784 static void GLAPIENTRY
3785 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3787 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3790 static void GLAPIENTRY
3791 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3793 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3796 static void GLAPIENTRY
3797 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3799 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3802 static void GLAPIENTRY
3803 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3805 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3808 static void GLAPIENTRY
3809 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3811 save_WindowPos4fMESA(x
, y
, z
, w
);
3814 static void GLAPIENTRY
3815 save_WindowPos2dvMESA(const GLdouble
* v
)
3817 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3820 static void GLAPIENTRY
3821 save_WindowPos2fvMESA(const GLfloat
* v
)
3823 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3826 static void GLAPIENTRY
3827 save_WindowPos2ivMESA(const GLint
* v
)
3829 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3832 static void GLAPIENTRY
3833 save_WindowPos2svMESA(const GLshort
* v
)
3835 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3838 static void GLAPIENTRY
3839 save_WindowPos3dvMESA(const GLdouble
* v
)
3841 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3844 static void GLAPIENTRY
3845 save_WindowPos3fvMESA(const GLfloat
* v
)
3847 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3850 static void GLAPIENTRY
3851 save_WindowPos3ivMESA(const GLint
* v
)
3853 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3856 static void GLAPIENTRY
3857 save_WindowPos3svMESA(const GLshort
* v
)
3859 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3862 static void GLAPIENTRY
3863 save_WindowPos4dvMESA(const GLdouble
* v
)
3865 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3866 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3869 static void GLAPIENTRY
3870 save_WindowPos4fvMESA(const GLfloat
* v
)
3872 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3875 static void GLAPIENTRY
3876 save_WindowPos4ivMESA(const GLint
* v
)
3878 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3879 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3882 static void GLAPIENTRY
3883 save_WindowPos4svMESA(const GLshort
* v
)
3885 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3890 /* GL_ARB_multitexture */
3891 static void GLAPIENTRY
3892 save_ActiveTextureARB(GLenum target
)
3894 GET_CURRENT_CONTEXT(ctx
);
3896 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3897 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
3901 if (ctx
->ExecuteFlag
) {
3902 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
3907 /* GL_ARB_transpose_matrix */
3909 static void GLAPIENTRY
3910 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
3913 _math_transposefd(tm
, m
);
3914 save_LoadMatrixf(tm
);
3918 static void GLAPIENTRY
3919 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
3922 _math_transposef(tm
, m
);
3923 save_LoadMatrixf(tm
);
3927 static void GLAPIENTRY
3928 save_MultTransposeMatrixdARB(const GLdouble m
[16])
3931 _math_transposefd(tm
, m
);
3932 save_MultMatrixf(tm
);
3936 static void GLAPIENTRY
3937 save_MultTransposeMatrixfARB(const GLfloat m
[16])
3940 _math_transposef(tm
, m
);
3941 save_MultMatrixf(tm
);
3945 /* GL_ARB_texture_compression */
3946 static void GLAPIENTRY
3947 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3948 GLenum internalFormat
, GLsizei width
,
3949 GLint border
, GLsizei imageSize
,
3950 const GLvoid
* data
)
3952 GET_CURRENT_CONTEXT(ctx
);
3953 if (target
== GL_PROXY_TEXTURE_1D
) {
3954 /* don't compile, execute immediately */
3955 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
3956 width
, border
, imageSize
,
3962 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3963 /* make copy of image */
3964 image
= _mesa_malloc(imageSize
);
3966 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
3969 MEMCPY(image
, data
, imageSize
);
3970 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
3974 n
[3].e
= internalFormat
;
3975 n
[4].i
= (GLint
) width
;
3983 if (ctx
->ExecuteFlag
) {
3984 CALL_CompressedTexImage1DARB(ctx
->Exec
,
3985 (target
, level
, internalFormat
, width
,
3986 border
, imageSize
, data
));
3992 static void GLAPIENTRY
3993 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
3994 GLenum internalFormat
, GLsizei width
,
3995 GLsizei height
, GLint border
, GLsizei imageSize
,
3996 const GLvoid
* data
)
3998 GET_CURRENT_CONTEXT(ctx
);
3999 if (target
== GL_PROXY_TEXTURE_2D
) {
4000 /* don't compile, execute immediately */
4001 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4002 width
, height
, border
,
4008 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4009 /* make copy of image */
4010 image
= _mesa_malloc(imageSize
);
4012 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4015 MEMCPY(image
, data
, imageSize
);
4016 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4020 n
[3].e
= internalFormat
;
4021 n
[4].i
= (GLint
) width
;
4022 n
[5].i
= (GLint
) height
;
4030 if (ctx
->ExecuteFlag
) {
4031 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4032 (target
, level
, internalFormat
, width
,
4033 height
, border
, imageSize
, data
));
4039 static void GLAPIENTRY
4040 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4041 GLenum internalFormat
, GLsizei width
,
4042 GLsizei height
, GLsizei depth
, GLint border
,
4043 GLsizei imageSize
, const GLvoid
* data
)
4045 GET_CURRENT_CONTEXT(ctx
);
4046 if (target
== GL_PROXY_TEXTURE_3D
) {
4047 /* don't compile, execute immediately */
4048 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4049 width
, height
, depth
, border
,
4055 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4056 /* make copy of image */
4057 image
= _mesa_malloc(imageSize
);
4059 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4062 MEMCPY(image
, data
, imageSize
);
4063 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4067 n
[3].e
= internalFormat
;
4068 n
[4].i
= (GLint
) width
;
4069 n
[5].i
= (GLint
) height
;
4070 n
[6].i
= (GLint
) depth
;
4078 if (ctx
->ExecuteFlag
) {
4079 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4080 (target
, level
, internalFormat
, width
,
4081 height
, depth
, border
, imageSize
,
4088 static void GLAPIENTRY
4089 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4090 GLsizei width
, GLenum format
,
4091 GLsizei imageSize
, const GLvoid
* data
)
4096 GET_CURRENT_CONTEXT(ctx
);
4097 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4099 /* make copy of image */
4100 image
= _mesa_malloc(imageSize
);
4102 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4105 MEMCPY(image
, data
, imageSize
);
4106 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4111 n
[4].i
= (GLint
) width
;
4119 if (ctx
->ExecuteFlag
) {
4120 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4121 width
, format
, imageSize
,
4127 static void GLAPIENTRY
4128 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4129 GLint yoffset
, GLsizei width
, GLsizei height
,
4130 GLenum format
, GLsizei imageSize
,
4131 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
, "glCompressedTexSubImage2DARB");
4145 MEMCPY(image
, data
, imageSize
);
4146 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4152 n
[5].i
= (GLint
) width
;
4153 n
[6].i
= (GLint
) height
;
4161 if (ctx
->ExecuteFlag
) {
4162 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4163 (target
, level
, xoffset
, yoffset
, width
,
4164 height
, format
, imageSize
, data
));
4169 static void GLAPIENTRY
4170 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4171 GLint yoffset
, GLint zoffset
, GLsizei width
,
4172 GLsizei height
, GLsizei depth
, GLenum format
,
4173 GLsizei imageSize
, const GLvoid
* data
)
4178 GET_CURRENT_CONTEXT(ctx
);
4179 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4181 /* make copy of image */
4182 image
= _mesa_malloc(imageSize
);
4184 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4187 MEMCPY(image
, data
, imageSize
);
4188 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4195 n
[6].i
= (GLint
) width
;
4196 n
[7].i
= (GLint
) height
;
4197 n
[8].i
= (GLint
) depth
;
4199 n
[10].i
= imageSize
;
4205 if (ctx
->ExecuteFlag
) {
4206 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4207 (target
, level
, xoffset
, yoffset
,
4208 zoffset
, width
, height
, depth
, format
,
4214 /* GL_ARB_multisample */
4215 static void GLAPIENTRY
4216 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4218 GET_CURRENT_CONTEXT(ctx
);
4220 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4221 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4226 if (ctx
->ExecuteFlag
) {
4227 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4233 * GL_NV_vertex_program
4235 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4236 static void GLAPIENTRY
4237 save_BindProgramNV(GLenum target
, GLuint id
)
4239 GET_CURRENT_CONTEXT(ctx
);
4241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4242 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4247 if (ctx
->ExecuteFlag
) {
4248 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4251 #endif /* FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4253 #if FEATURE_NV_vertex_program
4254 static void GLAPIENTRY
4255 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4257 GET_CURRENT_CONTEXT(ctx
);
4259 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4260 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4269 if (ctx
->ExecuteFlag
) {
4270 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4275 static void GLAPIENTRY
4276 save_ProgramParameter4fNV(GLenum target
, GLuint index
,
4277 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4279 GET_CURRENT_CONTEXT(ctx
);
4281 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4282 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_PARAMETER4F_NV
, 6);
4291 if (ctx
->ExecuteFlag
) {
4292 CALL_ProgramParameter4fNV(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4297 static void GLAPIENTRY
4298 save_ProgramParameter4fvNV(GLenum target
, GLuint index
,
4299 const GLfloat
*params
)
4301 save_ProgramParameter4fNV(target
, index
, params
[0], params
[1],
4302 params
[2], params
[3]);
4306 static void GLAPIENTRY
4307 save_ProgramParameter4dNV(GLenum target
, GLuint index
,
4308 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4310 save_ProgramParameter4fNV(target
, index
, (GLfloat
) x
, (GLfloat
) y
,
4311 (GLfloat
) z
, (GLfloat
) w
);
4315 static void GLAPIENTRY
4316 save_ProgramParameter4dvNV(GLenum target
, GLuint index
,
4317 const GLdouble
*params
)
4319 save_ProgramParameter4fNV(target
, index
, (GLfloat
) params
[0],
4320 (GLfloat
) params
[1], (GLfloat
) params
[2],
4321 (GLfloat
) params
[3]);
4325 static void GLAPIENTRY
4326 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4327 GLuint num
, const GLdouble
*params
)
4330 for (i
= 0; i
< num
; i
++) {
4331 save_ProgramParameter4dvNV(target
, index
+ i
, params
+ 4 * i
);
4336 static void GLAPIENTRY
4337 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4338 GLuint num
, const GLfloat
*params
)
4341 for (i
= 0; i
< num
; i
++) {
4342 save_ProgramParameter4fvNV(target
, index
+ i
, params
+ 4 * i
);
4347 static void GLAPIENTRY
4348 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4349 const GLubyte
* program
)
4351 GET_CURRENT_CONTEXT(ctx
);
4353 GLubyte
*programCopy
;
4355 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4357 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4360 _mesa_memcpy(programCopy
, program
, len
);
4362 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4363 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4368 n
[4].data
= programCopy
;
4370 if (ctx
->ExecuteFlag
) {
4371 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4376 static void GLAPIENTRY
4377 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4379 GET_CURRENT_CONTEXT(ctx
);
4381 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4383 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4386 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4387 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4388 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4393 if (ctx
->ExecuteFlag
) {
4394 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4399 static void GLAPIENTRY
4400 save_TrackMatrixNV(GLenum target
, GLuint address
,
4401 GLenum matrix
, GLenum transform
)
4403 GET_CURRENT_CONTEXT(ctx
);
4405 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4406 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4413 if (ctx
->ExecuteFlag
) {
4414 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4417 #endif /* FEATURE_NV_vertex_program */
4421 * GL_NV_fragment_program
4423 #if FEATURE_NV_fragment_program
4424 static void GLAPIENTRY
4425 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4426 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4428 GET_CURRENT_CONTEXT(ctx
);
4430 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4431 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4440 if (ctx
->ExecuteFlag
) {
4441 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4446 static void GLAPIENTRY
4447 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4448 const GLfloat
*params
)
4450 GET_CURRENT_CONTEXT(ctx
);
4452 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4453 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4462 if (ctx
->ExecuteFlag
) {
4463 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4468 static void GLAPIENTRY
4469 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4470 const GLfloat
*params
)
4472 GET_CURRENT_CONTEXT(ctx
);
4474 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4478 const GLfloat
* p
= params
;
4480 for (i
= 0 ; i
< count
; i
++) {
4481 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4494 if (ctx
->ExecuteFlag
) {
4495 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4500 static void GLAPIENTRY
4501 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4502 GLdouble x
, GLdouble y
,
4503 GLdouble z
, GLdouble w
)
4505 GET_CURRENT_CONTEXT(ctx
);
4507 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4508 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4512 n
[3].f
= (GLfloat
) x
;
4513 n
[4].f
= (GLfloat
) y
;
4514 n
[5].f
= (GLfloat
) z
;
4515 n
[6].f
= (GLfloat
) w
;
4517 if (ctx
->ExecuteFlag
) {
4518 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4523 static void GLAPIENTRY
4524 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4525 const GLdouble
*params
)
4527 GET_CURRENT_CONTEXT(ctx
);
4529 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4530 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4534 n
[3].f
= (GLfloat
) params
[0];
4535 n
[4].f
= (GLfloat
) params
[1];
4536 n
[5].f
= (GLfloat
) params
[2];
4537 n
[6].f
= (GLfloat
) params
[3];
4539 if (ctx
->ExecuteFlag
) {
4540 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4544 static void GLAPIENTRY
4545 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4546 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4548 GET_CURRENT_CONTEXT(ctx
);
4550 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4552 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4555 _mesa_memcpy(nameCopy
, name
, len
);
4557 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4558 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
4562 n
[3].data
= nameCopy
;
4568 if (ctx
->ExecuteFlag
) {
4569 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
4574 static void GLAPIENTRY
4575 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4578 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4582 static void GLAPIENTRY
4583 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4584 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4586 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4587 (GLfloat
) z
, (GLfloat
) w
);
4591 static void GLAPIENTRY
4592 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4595 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4596 (GLfloat
) v
[1], (GLfloat
) v
[2],
4600 #endif /* FEATURE_NV_fragment_program */
4604 /* GL_EXT_stencil_two_side */
4605 static void GLAPIENTRY
4606 save_ActiveStencilFaceEXT(GLenum face
)
4608 GET_CURRENT_CONTEXT(ctx
);
4610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4611 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
4615 if (ctx
->ExecuteFlag
) {
4616 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
4621 /* GL_EXT_depth_bounds_test */
4622 static void GLAPIENTRY
4623 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
4625 GET_CURRENT_CONTEXT(ctx
);
4627 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4628 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
4630 n
[1].f
= (GLfloat
) zmin
;
4631 n
[2].f
= (GLfloat
) zmax
;
4633 if (ctx
->ExecuteFlag
) {
4634 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
4640 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4642 static void GLAPIENTRY
4643 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4644 const GLvoid
* string
)
4646 GET_CURRENT_CONTEXT(ctx
);
4648 GLubyte
*programCopy
;
4650 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4652 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4655 _mesa_memcpy(programCopy
, string
, len
);
4657 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4658 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
4663 n
[4].data
= programCopy
;
4665 if (ctx
->ExecuteFlag
) {
4666 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
4671 static void GLAPIENTRY
4672 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4673 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4675 GET_CURRENT_CONTEXT(ctx
);
4677 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4678 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4687 if (ctx
->ExecuteFlag
) {
4688 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4693 static void GLAPIENTRY
4694 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4695 const GLfloat
*params
)
4697 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4698 params
[2], params
[3]);
4702 static void GLAPIENTRY
4703 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4704 const GLfloat
* params
)
4706 GET_CURRENT_CONTEXT(ctx
);
4708 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4712 const GLfloat
* p
= params
;
4714 for (i
= 0 ; i
< count
; i
++) {
4715 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4728 if (ctx
->ExecuteFlag
) {
4729 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4734 static void GLAPIENTRY
4735 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4736 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4738 save_ProgramEnvParameter4fARB(target
, index
,
4740 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4744 static void GLAPIENTRY
4745 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4746 const GLdouble
*params
)
4748 save_ProgramEnvParameter4fARB(target
, index
,
4749 (GLfloat
) params
[0],
4750 (GLfloat
) params
[1],
4751 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4754 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4757 #if FEATURE_ARB_occlusion_query
4759 static void GLAPIENTRY
4760 save_BeginQueryARB(GLenum target
, GLuint id
)
4762 GET_CURRENT_CONTEXT(ctx
);
4764 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4765 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
4770 if (ctx
->ExecuteFlag
) {
4771 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
4776 static void GLAPIENTRY
4777 save_EndQueryARB(GLenum target
)
4779 GET_CURRENT_CONTEXT(ctx
);
4781 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4782 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_END_QUERY_ARB
, 1);
4786 if (ctx
->ExecuteFlag
) {
4787 CALL_EndQueryARB(ctx
->Exec
, (target
));
4791 #endif /* FEATURE_ARB_occlusion_query */
4794 static void GLAPIENTRY
4795 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
4797 GET_CURRENT_CONTEXT(ctx
);
4799 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4800 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
4804 if (count
> MAX_DRAW_BUFFERS
)
4805 count
= MAX_DRAW_BUFFERS
;
4806 for (i
= 0; i
< count
; i
++) {
4807 n
[2 + i
].e
= buffers
[i
];
4810 if (ctx
->ExecuteFlag
) {
4811 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
4815 #if FEATURE_ATI_fragment_shader
4816 static void GLAPIENTRY
4817 save_BindFragmentShaderATI(GLuint id
)
4819 GET_CURRENT_CONTEXT(ctx
);
4822 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
4826 if (ctx
->ExecuteFlag
) {
4827 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
4831 static void GLAPIENTRY
4832 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
4834 GET_CURRENT_CONTEXT(ctx
);
4837 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
4845 if (ctx
->ExecuteFlag
) {
4846 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
4852 save_Attr1fNV(GLenum attr
, GLfloat x
)
4854 GET_CURRENT_CONTEXT(ctx
);
4856 SAVE_FLUSH_VERTICES(ctx
);
4857 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_NV
, 2);
4863 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4864 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4865 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4867 if (ctx
->ExecuteFlag
) {
4868 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
4873 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
4875 GET_CURRENT_CONTEXT(ctx
);
4877 SAVE_FLUSH_VERTICES(ctx
);
4878 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_NV
, 3);
4885 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4886 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4887 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4889 if (ctx
->ExecuteFlag
) {
4890 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
4895 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4897 GET_CURRENT_CONTEXT(ctx
);
4899 SAVE_FLUSH_VERTICES(ctx
);
4900 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_NV
, 4);
4908 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4909 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4910 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4912 if (ctx
->ExecuteFlag
) {
4913 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
4918 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4920 GET_CURRENT_CONTEXT(ctx
);
4922 SAVE_FLUSH_VERTICES(ctx
);
4923 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_NV
, 5);
4932 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4933 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4934 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4936 if (ctx
->ExecuteFlag
) {
4937 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
4943 save_Attr1fARB(GLenum attr
, GLfloat x
)
4945 GET_CURRENT_CONTEXT(ctx
);
4947 SAVE_FLUSH_VERTICES(ctx
);
4948 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_ARB
, 2);
4954 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
4955 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4956 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4958 if (ctx
->ExecuteFlag
) {
4959 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
4964 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
4966 GET_CURRENT_CONTEXT(ctx
);
4968 SAVE_FLUSH_VERTICES(ctx
);
4969 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_ARB
, 3);
4976 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
4977 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4978 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4980 if (ctx
->ExecuteFlag
) {
4981 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
4986 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4988 GET_CURRENT_CONTEXT(ctx
);
4990 SAVE_FLUSH_VERTICES(ctx
);
4991 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_ARB
, 4);
4999 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
5000 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5001 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5003 if (ctx
->ExecuteFlag
) {
5004 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5009 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5011 GET_CURRENT_CONTEXT(ctx
);
5013 SAVE_FLUSH_VERTICES(ctx
);
5014 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5023 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
5024 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5025 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5027 if (ctx
->ExecuteFlag
) {
5028 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5033 static void GLAPIENTRY
5034 save_EvalCoord1f(GLfloat x
)
5036 GET_CURRENT_CONTEXT(ctx
);
5038 SAVE_FLUSH_VERTICES(ctx
);
5039 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C1
, 1);
5043 if (ctx
->ExecuteFlag
) {
5044 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5048 static void GLAPIENTRY
5049 save_EvalCoord1fv(const GLfloat
* v
)
5051 save_EvalCoord1f(v
[0]);
5054 static void GLAPIENTRY
5055 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5057 GET_CURRENT_CONTEXT(ctx
);
5059 SAVE_FLUSH_VERTICES(ctx
);
5060 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C2
, 2);
5065 if (ctx
->ExecuteFlag
) {
5066 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5070 static void GLAPIENTRY
5071 save_EvalCoord2fv(const GLfloat
* v
)
5073 save_EvalCoord2f(v
[0], v
[1]);
5077 static void GLAPIENTRY
5078 save_EvalPoint1(GLint x
)
5080 GET_CURRENT_CONTEXT(ctx
);
5082 SAVE_FLUSH_VERTICES(ctx
);
5083 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P1
, 1);
5087 if (ctx
->ExecuteFlag
) {
5088 CALL_EvalPoint1(ctx
->Exec
, (x
));
5092 static void GLAPIENTRY
5093 save_EvalPoint2(GLint x
, GLint y
)
5095 GET_CURRENT_CONTEXT(ctx
);
5097 SAVE_FLUSH_VERTICES(ctx
);
5098 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P2
, 2);
5103 if (ctx
->ExecuteFlag
) {
5104 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5108 static void GLAPIENTRY
5109 save_Indexf(GLfloat x
)
5111 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5114 static void GLAPIENTRY
5115 save_Indexfv(const GLfloat
* v
)
5117 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5120 static void GLAPIENTRY
5121 save_EdgeFlag(GLboolean x
)
5123 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0 : 0.0);
5126 static void GLAPIENTRY
5127 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5129 GET_CURRENT_CONTEXT(ctx
);
5133 SAVE_FLUSH_VERTICES(ctx
);
5138 case GL_FRONT_AND_BACK
:
5141 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5150 case GL_AMBIENT_AND_DIFFUSE
:
5156 case GL_COLOR_INDEXES
:
5160 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5164 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATERIAL
, 6);
5168 for (i
= 0; i
< args
; i
++)
5169 n
[3 + i
].f
= param
[i
];
5173 GLuint bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5174 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
5175 if (bitmask
& (1 << i
)) {
5176 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5177 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5181 if (ctx
->ExecuteFlag
) {
5182 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5186 static void GLAPIENTRY
5187 save_Begin(GLenum mode
)
5189 GET_CURRENT_CONTEXT(ctx
);
5191 GLboolean error
= GL_FALSE
;
5193 if ( /*mode < GL_POINTS || */ mode
> GL_POLYGON
) {
5194 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5197 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5198 /* Typically the first begin. This may raise an error on
5199 * playback, depending on whether CallList is issued from inside
5200 * a begin/end or not.
5202 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5204 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5205 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5208 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5213 /* Give the driver an opportunity to hook in an optimized
5214 * display list compiler.
5216 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5219 SAVE_FLUSH_VERTICES(ctx
);
5220 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN
, 1);
5226 if (ctx
->ExecuteFlag
) {
5227 CALL_Begin(ctx
->Exec
, (mode
));
5231 static void GLAPIENTRY
5234 GET_CURRENT_CONTEXT(ctx
);
5235 SAVE_FLUSH_VERTICES(ctx
);
5236 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END
, 0);
5237 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5238 if (ctx
->ExecuteFlag
) {
5239 CALL_End(ctx
->Exec
, ());
5243 static void GLAPIENTRY
5244 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5246 GET_CURRENT_CONTEXT(ctx
);
5248 SAVE_FLUSH_VERTICES(ctx
);
5249 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RECTF
, 4);
5256 if (ctx
->ExecuteFlag
) {
5257 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5262 static void GLAPIENTRY
5263 save_Vertex2f(GLfloat x
, GLfloat y
)
5265 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5268 static void GLAPIENTRY
5269 save_Vertex2fv(const GLfloat
* v
)
5271 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5274 static void GLAPIENTRY
5275 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5277 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5280 static void GLAPIENTRY
5281 save_Vertex3fv(const GLfloat
* v
)
5283 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5286 static void GLAPIENTRY
5287 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5289 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5292 static void GLAPIENTRY
5293 save_Vertex4fv(const GLfloat
* v
)
5295 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5298 static void GLAPIENTRY
5299 save_TexCoord1f(GLfloat x
)
5301 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5304 static void GLAPIENTRY
5305 save_TexCoord1fv(const GLfloat
* v
)
5307 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5310 static void GLAPIENTRY
5311 save_TexCoord2f(GLfloat x
, GLfloat y
)
5313 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5316 static void GLAPIENTRY
5317 save_TexCoord2fv(const GLfloat
* v
)
5319 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5322 static void GLAPIENTRY
5323 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5325 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5328 static void GLAPIENTRY
5329 save_TexCoord3fv(const GLfloat
* v
)
5331 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5334 static void GLAPIENTRY
5335 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5337 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5340 static void GLAPIENTRY
5341 save_TexCoord4fv(const GLfloat
* v
)
5343 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5346 static void GLAPIENTRY
5347 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5349 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5352 static void GLAPIENTRY
5353 save_Normal3fv(const GLfloat
* v
)
5355 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5358 static void GLAPIENTRY
5359 save_FogCoordfEXT(GLfloat x
)
5361 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5364 static void GLAPIENTRY
5365 save_FogCoordfvEXT(const GLfloat
* v
)
5367 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5370 static void GLAPIENTRY
5371 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5373 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5376 static void GLAPIENTRY
5377 save_Color3fv(const GLfloat
* v
)
5379 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5382 static void GLAPIENTRY
5383 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5385 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5388 static void GLAPIENTRY
5389 save_Color4fv(const GLfloat
* v
)
5391 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5394 static void GLAPIENTRY
5395 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5397 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5400 static void GLAPIENTRY
5401 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5403 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5407 /* Just call the respective ATTR for texcoord
5409 static void GLAPIENTRY
5410 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5412 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5413 save_Attr1fNV(attr
, x
);
5416 static void GLAPIENTRY
5417 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5419 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5420 save_Attr1fNV(attr
, v
[0]);
5423 static void GLAPIENTRY
5424 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5426 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5427 save_Attr2fNV(attr
, x
, y
);
5430 static void GLAPIENTRY
5431 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5433 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5434 save_Attr2fNV(attr
, v
[0], v
[1]);
5437 static void GLAPIENTRY
5438 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5440 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5441 save_Attr3fNV(attr
, x
, y
, z
);
5444 static void GLAPIENTRY
5445 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5447 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5448 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5451 static void GLAPIENTRY
5452 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5453 GLfloat z
, GLfloat w
)
5455 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5456 save_Attr4fNV(attr
, x
, y
, z
, w
);
5459 static void GLAPIENTRY
5460 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5462 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5463 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5468 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5474 GET_CURRENT_CONTEXT(ctx
);
5475 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5479 /* First level for NV_vertex_program:
5481 * Check for errors at compile time?.
5483 static void GLAPIENTRY
5484 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
5486 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5487 save_Attr1fNV(index
, x
);
5492 static void GLAPIENTRY
5493 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
5495 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5496 save_Attr1fNV(index
, v
[0]);
5501 static void GLAPIENTRY
5502 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
5504 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5505 save_Attr2fNV(index
, x
, y
);
5510 static void GLAPIENTRY
5511 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
5513 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5514 save_Attr2fNV(index
, v
[0], v
[1]);
5519 static void GLAPIENTRY
5520 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5522 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5523 save_Attr3fNV(index
, x
, y
, z
);
5528 static void GLAPIENTRY
5529 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
5531 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5532 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
5537 static void GLAPIENTRY
5538 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
5539 GLfloat z
, GLfloat w
)
5541 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5542 save_Attr4fNV(index
, x
, y
, z
, w
);
5547 static void GLAPIENTRY
5548 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
5550 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5551 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
5559 static void GLAPIENTRY
5560 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5562 if (index
< MAX_VERTEX_ATTRIBS
)
5563 save_Attr1fARB(index
, x
);
5568 static void GLAPIENTRY
5569 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5571 if (index
< MAX_VERTEX_ATTRIBS
)
5572 save_Attr1fARB(index
, v
[0]);
5577 static void GLAPIENTRY
5578 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5580 if (index
< MAX_VERTEX_ATTRIBS
)
5581 save_Attr2fARB(index
, x
, y
);
5586 static void GLAPIENTRY
5587 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5589 if (index
< MAX_VERTEX_ATTRIBS
)
5590 save_Attr2fARB(index
, v
[0], v
[1]);
5595 static void GLAPIENTRY
5596 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5598 if (index
< MAX_VERTEX_ATTRIBS
)
5599 save_Attr3fARB(index
, x
, y
, z
);
5604 static void GLAPIENTRY
5605 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
5607 if (index
< MAX_VERTEX_ATTRIBS
)
5608 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
5613 static void GLAPIENTRY
5614 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
5617 if (index
< MAX_VERTEX_ATTRIBS
)
5618 save_Attr4fARB(index
, x
, y
, z
, w
);
5623 static void GLAPIENTRY
5624 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
5626 if (index
< MAX_VERTEX_ATTRIBS
)
5627 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
5633 #if FEATURE_EXT_framebuffer_blit
5634 static void GLAPIENTRY
5635 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
5636 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
5637 GLbitfield mask
, GLenum filter
)
5639 GET_CURRENT_CONTEXT(ctx
);
5641 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5642 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
5655 if (ctx
->ExecuteFlag
) {
5656 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
5657 dstX0
, dstY0
, dstX1
, dstY1
,
5665 * Save an error-generating command into display list.
5667 * KW: Will appear in the list before the vertex buffer containing the
5668 * command that provoked the error. I don't see this as a problem.
5671 save_error(GLcontext
*ctx
, GLenum error
, const char *s
)
5674 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ERROR
, 2);
5677 n
[2].data
= (void *) s
;
5683 * Compile an error into current display list.
5686 _mesa_compile_error(GLcontext
*ctx
, GLenum error
, const char *s
)
5688 if (ctx
->CompileFlag
)
5689 save_error(ctx
, error
, s
);
5690 if (ctx
->ExecuteFlag
)
5691 _mesa_error(ctx
, error
, s
);
5696 * Test if ID names a display list.
5699 islist(GLcontext
*ctx
, GLuint list
)
5701 if (list
> 0 && lookup_list(ctx
, list
)) {
5711 /**********************************************************************/
5712 /* Display list execution */
5713 /**********************************************************************/
5717 * Execute a display list. Note that the ListBase offset must have already
5718 * been added before calling this function. I.e. the list argument is
5719 * the absolute list number, not relative to ListBase.
5720 * \param list - display list number
5723 execute_list(GLcontext
*ctx
, GLuint list
)
5725 struct mesa_display_list
*dlist
;
5729 if (list
== 0 || !islist(ctx
, list
))
5732 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
5733 /* raise an error? */
5737 dlist
= lookup_list(ctx
, list
);
5741 ctx
->ListState
.CallStack
[ctx
->ListState
.CallDepth
++] = dlist
;
5743 if (ctx
->Driver
.BeginCallList
)
5744 ctx
->Driver
.BeginCallList(ctx
, dlist
);
5750 OpCode opcode
= n
[0].opcode
;
5751 int i
= (int) n
[0].opcode
- (int) OPCODE_EXT_0
;
5753 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
5754 /* this is a driver-extended opcode */
5755 ctx
->ListExt
.Opcode
[i
].Execute(ctx
, &n
[1]);
5756 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
5761 _mesa_error(ctx
, n
[1].e
, (const char *) n
[2].data
);
5764 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
5766 case OPCODE_ALPHA_FUNC
:
5767 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
5769 case OPCODE_BIND_TEXTURE
:
5770 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
5774 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5775 ctx
->Unpack
= ctx
->DefaultPacking
;
5776 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5777 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
5778 (const GLubyte
*) n
[7].data
));
5779 ctx
->Unpack
= save
; /* restore */
5782 case OPCODE_BLEND_COLOR
:
5783 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5785 case OPCODE_BLEND_EQUATION
:
5786 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
5788 case OPCODE_BLEND_EQUATION_SEPARATE
:
5789 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5791 case OPCODE_BLEND_FUNC_SEPARATE
:
5792 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
5793 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
5795 case OPCODE_CALL_LIST
:
5796 /* Generated by glCallList(), don't add ListBase */
5797 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5798 execute_list(ctx
, n
[1].ui
);
5801 case OPCODE_CALL_LIST_OFFSET
:
5802 /* Generated by glCallLists() so we must add ListBase */
5804 /* user specified a bad data type at compile time */
5805 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5807 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5808 execute_list(ctx
, ctx
->List
.ListBase
+ n
[1].ui
);
5812 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
5814 case OPCODE_CLEAR_COLOR
:
5815 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5817 case OPCODE_CLEAR_ACCUM
:
5818 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5820 case OPCODE_CLEAR_DEPTH
:
5821 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
5823 case OPCODE_CLEAR_INDEX
:
5824 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
5826 case OPCODE_CLEAR_STENCIL
:
5827 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
5829 case OPCODE_CLIP_PLANE
:
5836 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
5839 case OPCODE_COLOR_MASK
:
5840 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
5842 case OPCODE_COLOR_MATERIAL
:
5843 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5845 case OPCODE_COLOR_TABLE
:
5847 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5848 ctx
->Unpack
= ctx
->DefaultPacking
;
5849 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5850 n
[5].e
, n
[6].data
));
5851 ctx
->Unpack
= save
; /* restore */
5854 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
5861 CALL_ColorTableParameterfv(ctx
->Exec
,
5862 (n
[1].e
, n
[2].e
, params
));
5865 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
5872 CALL_ColorTableParameteriv(ctx
->Exec
,
5873 (n
[1].e
, n
[2].e
, params
));
5876 case OPCODE_COLOR_SUB_TABLE
:
5878 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5879 ctx
->Unpack
= ctx
->DefaultPacking
;
5880 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5881 n
[4].e
, n
[5].e
, n
[6].data
));
5882 ctx
->Unpack
= save
; /* restore */
5885 case OPCODE_CONVOLUTION_FILTER_1D
:
5887 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5888 ctx
->Unpack
= ctx
->DefaultPacking
;
5889 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5892 ctx
->Unpack
= save
; /* restore */
5895 case OPCODE_CONVOLUTION_FILTER_2D
:
5897 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5898 ctx
->Unpack
= ctx
->DefaultPacking
;
5899 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5900 n
[4].i
, n
[5].e
, n
[6].e
,
5902 ctx
->Unpack
= save
; /* restore */
5905 case OPCODE_CONVOLUTION_PARAMETER_I
:
5906 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
5908 case OPCODE_CONVOLUTION_PARAMETER_IV
:
5915 CALL_ConvolutionParameteriv(ctx
->Exec
,
5916 (n
[1].e
, n
[2].e
, params
));
5919 case OPCODE_CONVOLUTION_PARAMETER_F
:
5920 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
5922 case OPCODE_CONVOLUTION_PARAMETER_FV
:
5929 CALL_ConvolutionParameterfv(ctx
->Exec
,
5930 (n
[1].e
, n
[2].e
, params
));
5933 case OPCODE_COPY_COLOR_SUB_TABLE
:
5934 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
5935 n
[3].i
, n
[4].i
, n
[5].i
));
5937 case OPCODE_COPY_COLOR_TABLE
:
5938 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
5939 n
[3].i
, n
[4].i
, n
[5].i
));
5941 case OPCODE_COPY_PIXELS
:
5942 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
5943 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
5946 case OPCODE_COPY_TEX_IMAGE1D
:
5947 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5948 n
[5].i
, n
[6].i
, n
[7].i
));
5950 case OPCODE_COPY_TEX_IMAGE2D
:
5951 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5952 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
5954 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
5955 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5956 n
[4].i
, n
[5].i
, n
[6].i
));
5958 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
5959 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5960 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5963 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
5964 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5965 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5968 case OPCODE_CULL_FACE
:
5969 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
5971 case OPCODE_DEPTH_FUNC
:
5972 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
5974 case OPCODE_DEPTH_MASK
:
5975 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
5977 case OPCODE_DEPTH_RANGE
:
5978 CALL_DepthRange(ctx
->Exec
,
5979 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
5981 case OPCODE_DISABLE
:
5982 CALL_Disable(ctx
->Exec
, (n
[1].e
));
5984 case OPCODE_DRAW_BUFFER
:
5985 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
5987 case OPCODE_DRAW_PIXELS
:
5989 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5990 ctx
->Unpack
= ctx
->DefaultPacking
;
5991 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
5993 ctx
->Unpack
= save
; /* restore */
5997 CALL_Enable(ctx
->Exec
, (n
[1].e
));
5999 case OPCODE_EVALMESH1
:
6000 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
6002 case OPCODE_EVALMESH2
:
6003 CALL_EvalMesh2(ctx
->Exec
,
6004 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
6013 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
6016 case OPCODE_FRONT_FACE
:
6017 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
6019 case OPCODE_FRUSTUM
:
6020 CALL_Frustum(ctx
->Exec
,
6021 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6024 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6026 case OPCODE_HISTOGRAM
:
6027 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
6029 case OPCODE_INDEX_MASK
:
6030 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
6032 case OPCODE_INIT_NAMES
:
6033 CALL_InitNames(ctx
->Exec
, ());
6042 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
6045 case OPCODE_LIGHT_MODEL
:
6052 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
6055 case OPCODE_LINE_STIPPLE
:
6056 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
6058 case OPCODE_LINE_WIDTH
:
6059 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
6061 case OPCODE_LIST_BASE
:
6062 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
6064 case OPCODE_LOAD_IDENTITY
:
6065 CALL_LoadIdentity(ctx
->Exec
, ());
6067 case OPCODE_LOAD_MATRIX
:
6068 if (sizeof(Node
) == sizeof(GLfloat
)) {
6069 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
6074 for (i
= 0; i
< 16; i
++) {
6077 CALL_LoadMatrixf(ctx
->Exec
, (m
));
6080 case OPCODE_LOAD_NAME
:
6081 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
6083 case OPCODE_LOGIC_OP
:
6084 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
6088 GLenum target
= n
[1].e
;
6089 GLint ustride
= _mesa_evaluator_components(target
);
6090 GLint uorder
= n
[5].i
;
6091 GLfloat u1
= n
[2].f
;
6092 GLfloat u2
= n
[3].f
;
6093 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6094 (GLfloat
*) n
[6].data
));
6099 GLenum target
= n
[1].e
;
6100 GLfloat u1
= n
[2].f
;
6101 GLfloat u2
= n
[3].f
;
6102 GLfloat v1
= n
[4].f
;
6103 GLfloat v2
= n
[5].f
;
6104 GLint ustride
= n
[6].i
;
6105 GLint vstride
= n
[7].i
;
6106 GLint uorder
= n
[8].i
;
6107 GLint vorder
= n
[9].i
;
6108 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6109 v1
, v2
, vstride
, vorder
,
6110 (GLfloat
*) n
[10].data
));
6113 case OPCODE_MAPGRID1
:
6114 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
6116 case OPCODE_MAPGRID2
:
6117 CALL_MapGrid2f(ctx
->Exec
,
6118 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
6120 case OPCODE_MATRIX_MODE
:
6121 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
6123 case OPCODE_MIN_MAX
:
6124 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
6126 case OPCODE_MULT_MATRIX
:
6127 if (sizeof(Node
) == sizeof(GLfloat
)) {
6128 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
6133 for (i
= 0; i
< 16; i
++) {
6136 CALL_MultMatrixf(ctx
->Exec
, (m
));
6140 CALL_Ortho(ctx
->Exec
,
6141 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6143 case OPCODE_PASSTHROUGH
:
6144 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
6146 case OPCODE_PIXEL_MAP
:
6147 CALL_PixelMapfv(ctx
->Exec
,
6148 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
6150 case OPCODE_PIXEL_TRANSFER
:
6151 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6153 case OPCODE_PIXEL_ZOOM
:
6154 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6156 case OPCODE_POINT_SIZE
:
6157 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
6159 case OPCODE_POINT_PARAMETERS
:
6165 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
6168 case OPCODE_POLYGON_MODE
:
6169 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6171 case OPCODE_POLYGON_STIPPLE
:
6172 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
6174 case OPCODE_POLYGON_OFFSET
:
6175 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6177 case OPCODE_POP_ATTRIB
:
6178 CALL_PopAttrib(ctx
->Exec
, ());
6180 case OPCODE_POP_MATRIX
:
6181 CALL_PopMatrix(ctx
->Exec
, ());
6183 case OPCODE_POP_NAME
:
6184 CALL_PopName(ctx
->Exec
, ());
6186 case OPCODE_PRIORITIZE_TEXTURE
:
6187 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
6189 case OPCODE_PUSH_ATTRIB
:
6190 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
6192 case OPCODE_PUSH_MATRIX
:
6193 CALL_PushMatrix(ctx
->Exec
, ());
6195 case OPCODE_PUSH_NAME
:
6196 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
6198 case OPCODE_RASTER_POS
:
6199 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6201 case OPCODE_READ_BUFFER
:
6202 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
6204 case OPCODE_RESET_HISTOGRAM
:
6205 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
6207 case OPCODE_RESET_MIN_MAX
:
6208 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
6211 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6214 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6216 case OPCODE_SCISSOR
:
6217 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
6219 case OPCODE_SHADE_MODEL
:
6220 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
6222 case OPCODE_STENCIL_FUNC
:
6223 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
6225 case OPCODE_STENCIL_MASK
:
6226 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
6228 case OPCODE_STENCIL_OP
:
6229 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
6231 case OPCODE_STENCIL_FUNC_SEPARATE
:
6232 CALL_StencilFuncSeparate(ctx
->Exec
,
6233 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
6235 case OPCODE_STENCIL_MASK_SEPARATE
:
6236 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6238 case OPCODE_STENCIL_OP_SEPARATE
:
6239 CALL_StencilOpSeparate(ctx
->Exec
,
6240 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6249 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6259 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6262 case OPCODE_TEXPARAMETER
:
6269 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6272 case OPCODE_TEX_IMAGE1D
:
6274 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6275 ctx
->Unpack
= ctx
->DefaultPacking
;
6276 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
6278 n
[3].i
, /* components */
6280 n
[5].e
, /* border */
6281 n
[6].e
, /* format */
6284 ctx
->Unpack
= save
; /* restore */
6287 case OPCODE_TEX_IMAGE2D
:
6289 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6290 ctx
->Unpack
= ctx
->DefaultPacking
;
6291 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
6293 n
[3].i
, /* components */
6295 n
[5].i
, /* height */
6296 n
[6].e
, /* border */
6297 n
[7].e
, /* format */
6300 ctx
->Unpack
= save
; /* restore */
6303 case OPCODE_TEX_IMAGE3D
:
6305 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6306 ctx
->Unpack
= ctx
->DefaultPacking
;
6307 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
6309 n
[3].i
, /* components */
6311 n
[5].i
, /* height */
6313 n
[7].e
, /* border */
6314 n
[8].e
, /* format */
6317 ctx
->Unpack
= save
; /* restore */
6320 case OPCODE_TEX_SUB_IMAGE1D
:
6322 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6323 ctx
->Unpack
= ctx
->DefaultPacking
;
6324 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6326 n
[6].e
, n
[7].data
));
6327 ctx
->Unpack
= save
; /* restore */
6330 case OPCODE_TEX_SUB_IMAGE2D
:
6332 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6333 ctx
->Unpack
= ctx
->DefaultPacking
;
6334 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6336 n
[6].i
, n
[7].e
, n
[8].e
,
6338 ctx
->Unpack
= save
; /* restore */
6341 case OPCODE_TEX_SUB_IMAGE3D
:
6343 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6344 ctx
->Unpack
= ctx
->DefaultPacking
;
6345 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6346 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6347 n
[8].i
, n
[9].e
, n
[10].e
,
6349 ctx
->Unpack
= save
; /* restore */
6352 case OPCODE_TRANSLATE
:
6353 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6355 case OPCODE_VIEWPORT
:
6356 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6357 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
6359 case OPCODE_WINDOW_POS
:
6360 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6362 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
6363 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
6365 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
6366 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6367 n
[4].i
, n
[5].i
, n
[6].i
,
6370 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
6371 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6372 n
[4].i
, n
[5].i
, n
[6].i
,
6373 n
[7].i
, n
[8].data
));
6375 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
6376 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6377 n
[4].i
, n
[5].i
, n
[6].i
,
6381 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
6382 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
6383 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6384 n
[5].e
, n
[6].i
, n
[7].data
));
6386 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
6387 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
6388 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6389 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
6392 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
6393 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
6394 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6395 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6396 n
[9].e
, n
[10].i
, n
[11].data
));
6398 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
6399 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
6401 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
6402 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6404 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6405 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
6406 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6409 #if FEATURE_NV_vertex_program
6410 case OPCODE_EXECUTE_PROGRAM_NV
:
6417 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
6420 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
6421 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
6422 (GLuint
*) n
[2].data
));
6424 case OPCODE_LOAD_PROGRAM_NV
:
6425 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
6426 (const GLubyte
*) n
[4].data
));
6428 case OPCODE_PROGRAM_PARAMETER4F_NV
:
6429 CALL_ProgramParameter4fNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6430 n
[4].f
, n
[5].f
, n
[6].f
));
6432 case OPCODE_TRACK_MATRIX_NV
:
6433 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
6437 #if FEATURE_NV_fragment_program
6438 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
6439 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
6440 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
6443 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
6444 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
6445 (const GLubyte
*) n
[3].
6446 data
, n
[4].f
, n
[5].f
,
6451 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
6452 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
6454 case OPCODE_DEPTH_BOUNDS_EXT
:
6455 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6457 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6458 case OPCODE_PROGRAM_STRING_ARB
:
6459 CALL_ProgramStringARB(ctx
->Exec
,
6460 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
6462 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
6463 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6468 #if FEATURE_ARB_occlusion_query
6469 case OPCODE_BEGIN_QUERY_ARB
:
6470 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6472 case OPCODE_END_QUERY_ARB
:
6473 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
6476 case OPCODE_DRAW_BUFFERS_ARB
:
6478 GLenum buffers
[MAX_DRAW_BUFFERS
];
6479 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
6480 for (i
= 0; i
< count
; i
++)
6481 buffers
[i
] = n
[2 + i
].e
;
6482 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
6485 #if FEATURE_EXT_framebuffer_blit
6486 case OPCODE_BLIT_FRAMEBUFFER
:
6487 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
6488 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6492 #if FEATURE_ATI_fragment_shader
6493 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
6494 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
6496 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
6499 GLuint i
, dst
= n
[1].ui
;
6501 for (i
= 0; i
< 4; i
++)
6502 values
[i
] = n
[1 + i
].f
;
6503 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
6507 case OPCODE_ATTR_1F_NV
:
6508 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6510 case OPCODE_ATTR_2F_NV
:
6511 /* Really shouldn't have to do this - the Node structure
6512 * is convenient, but it would be better to store the data
6513 * packed appropriately so that it can be sent directly
6514 * on. With x86_64 becoming common, this will start to
6517 if (sizeof(Node
) == sizeof(GLfloat
))
6518 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6520 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6522 case OPCODE_ATTR_3F_NV
:
6523 if (sizeof(Node
) == sizeof(GLfloat
))
6524 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6526 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6529 case OPCODE_ATTR_4F_NV
:
6530 if (sizeof(Node
) == sizeof(GLfloat
))
6531 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6533 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6536 case OPCODE_ATTR_1F_ARB
:
6537 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6539 case OPCODE_ATTR_2F_ARB
:
6540 /* Really shouldn't have to do this - the Node structure
6541 * is convenient, but it would be better to store the data
6542 * packed appropriately so that it can be sent directly
6543 * on. With x86_64 becoming common, this will start to
6546 if (sizeof(Node
) == sizeof(GLfloat
))
6547 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6549 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6551 case OPCODE_ATTR_3F_ARB
:
6552 if (sizeof(Node
) == sizeof(GLfloat
))
6553 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6555 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6558 case OPCODE_ATTR_4F_ARB
:
6559 if (sizeof(Node
) == sizeof(GLfloat
))
6560 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6562 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6565 case OPCODE_MATERIAL
:
6566 if (sizeof(Node
) == sizeof(GLfloat
))
6567 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
6574 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
6578 CALL_Begin(ctx
->Exec
, (n
[1].e
));
6581 CALL_End(ctx
->Exec
, ());
6584 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6586 case OPCODE_EVAL_C1
:
6587 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
6589 case OPCODE_EVAL_C2
:
6590 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6592 case OPCODE_EVAL_P1
:
6593 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
6595 case OPCODE_EVAL_P2
:
6596 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
6599 case OPCODE_CONTINUE
:
6600 n
= (Node
*) n
[1].next
;
6602 case OPCODE_END_OF_LIST
:
6608 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d",
6610 _mesa_problem(ctx
, msg
);
6615 /* increment n to point to next compiled command */
6616 if (opcode
!= OPCODE_CONTINUE
) {
6617 n
+= InstSize
[opcode
];
6622 if (ctx
->Driver
.EndCallList
)
6623 ctx
->Driver
.EndCallList(ctx
);
6625 ctx
->ListState
.CallStack
[ctx
->ListState
.CallDepth
--] = NULL
;
6630 /**********************************************************************/
6632 /**********************************************************************/
6635 * Test if a display list number is valid.
6637 GLboolean GLAPIENTRY
6638 _mesa_IsList(GLuint list
)
6640 GET_CURRENT_CONTEXT(ctx
);
6641 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6642 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6643 return islist(ctx
, list
);
6648 * Delete a sequence of consecutive display lists.
6651 _mesa_DeleteLists(GLuint list
, GLsizei range
)
6653 GET_CURRENT_CONTEXT(ctx
);
6655 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6656 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6659 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
6662 for (i
= list
; i
< list
+ range
; i
++) {
6663 destroy_list(ctx
, i
);
6669 * Return a display list number, n, such that lists n through n+range-1
6673 _mesa_GenLists(GLsizei range
)
6675 GET_CURRENT_CONTEXT(ctx
);
6677 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6678 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6681 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
6689 * Make this an atomic operation
6691 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6693 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6695 /* reserve the list IDs by with empty/dummy lists */
6697 for (i
= 0; i
< range
; i
++) {
6698 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
6699 make_list(base
+ i
, 1));
6703 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6710 * Begin a new display list.
6713 _mesa_NewList(GLuint list
, GLenum mode
)
6715 GET_CURRENT_CONTEXT(ctx
);
6718 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6719 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6721 if (MESA_VERBOSE
& VERBOSE_API
)
6722 _mesa_debug(ctx
, "glNewList %u %s\n", list
,
6723 _mesa_lookup_enum_by_nr(mode
));
6726 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
6730 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
6731 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
6735 if (ctx
->ListState
.CurrentListPtr
) {
6736 /* already compiling a display list */
6737 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
6741 ctx
->CompileFlag
= GL_TRUE
;
6742 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6744 /* Allocate new display list */
6745 ctx
->ListState
.CurrentListNum
= list
;
6746 ctx
->ListState
.CurrentList
= make_list(list
, BLOCK_SIZE
);
6747 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->node
;
6748 ctx
->ListState
.CurrentListPtr
= ctx
->ListState
.CurrentBlock
;
6749 ctx
->ListState
.CurrentPos
= 0;
6751 /* Reset acumulated list state:
6753 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
6754 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
6756 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
6757 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
6759 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
6760 ctx
->Driver
.NewList(ctx
, list
, mode
);
6762 ctx
->CurrentDispatch
= ctx
->Save
;
6763 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6768 * End definition of current display list.
6773 GET_CURRENT_CONTEXT(ctx
);
6774 SAVE_FLUSH_VERTICES(ctx
);
6775 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6777 if (MESA_VERBOSE
& VERBOSE_API
)
6778 _mesa_debug(ctx
, "glEndList\n");
6780 /* Check that a list is under construction */
6781 if (!ctx
->ListState
.CurrentListPtr
) {
6782 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
6786 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END_OF_LIST
, 0);
6788 /* Destroy old list, if any */
6789 destroy_list(ctx
, ctx
->ListState
.CurrentListNum
);
6790 /* Install the list */
6791 _mesa_HashInsert(ctx
->Shared
->DisplayList
, ctx
->ListState
.CurrentListNum
,
6792 ctx
->ListState
.CurrentList
);
6795 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6796 mesa_print_display_list(ctx
->ListState
.CurrentListNum
);
6798 ctx
->Driver
.EndList(ctx
);
6800 ctx
->ListState
.CurrentList
= NULL
;
6801 ctx
->ListState
.CurrentListNum
= 0;
6802 ctx
->ListState
.CurrentListPtr
= NULL
;
6803 ctx
->ExecuteFlag
= GL_TRUE
;
6804 ctx
->CompileFlag
= GL_FALSE
;
6806 ctx
->CurrentDispatch
= ctx
->Exec
;
6807 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6812 _mesa_CallList(GLuint list
)
6814 GLboolean save_compile_flag
;
6815 GET_CURRENT_CONTEXT(ctx
);
6816 FLUSH_CURRENT(ctx
, 0);
6817 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6818 /* execute the display list, and restore the CompileFlag. */
6820 if (MESA_VERBOSE
& VERBOSE_API
)
6821 _mesa_debug(ctx
, "glCallList %d\n", list
);
6824 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6828 /* mesa_print_display_list( list ); */
6830 save_compile_flag
= ctx
->CompileFlag
;
6831 if (save_compile_flag
) {
6832 ctx
->CompileFlag
= GL_FALSE
;
6835 execute_list(ctx
, list
);
6836 ctx
->CompileFlag
= save_compile_flag
;
6838 /* also restore API function pointers to point to "save" versions */
6839 if (save_compile_flag
) {
6840 ctx
->CurrentDispatch
= ctx
->Save
;
6841 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6847 * Execute glCallLists: call multiple display lists.
6850 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
6852 GET_CURRENT_CONTEXT(ctx
);
6855 GLboolean save_compile_flag
;
6857 if (MESA_VERBOSE
& VERBOSE_API
)
6858 _mesa_debug(ctx
, "glCallLists %d\n", n
);
6862 case GL_UNSIGNED_BYTE
:
6864 case GL_UNSIGNED_SHORT
:
6866 case GL_UNSIGNED_INT
:
6874 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6878 /* Save the CompileFlag status, turn it off, execute display list,
6879 * and restore the CompileFlag.
6881 save_compile_flag
= ctx
->CompileFlag
;
6882 ctx
->CompileFlag
= GL_FALSE
;
6884 for (i
= 0; i
< n
; i
++) {
6885 list
= translate_id(i
, type
, lists
);
6886 execute_list(ctx
, ctx
->List
.ListBase
+ list
);
6889 ctx
->CompileFlag
= save_compile_flag
;
6891 /* also restore API function pointers to point to "save" versions */
6892 if (save_compile_flag
) {
6893 ctx
->CurrentDispatch
= ctx
->Save
;
6894 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6900 * Set the offset added to list numbers in glCallLists.
6903 _mesa_ListBase(GLuint base
)
6905 GET_CURRENT_CONTEXT(ctx
);
6906 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6907 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6908 ctx
->List
.ListBase
= base
;
6912 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
6914 static void GLAPIENTRY
6917 GET_CURRENT_CONTEXT(ctx
);
6918 FLUSH_VERTICES(ctx
, 0);
6919 CALL_Finish(ctx
->Exec
, ());
6922 static void GLAPIENTRY
6925 GET_CURRENT_CONTEXT(ctx
);
6926 FLUSH_VERTICES(ctx
, 0);
6927 CALL_Flush(ctx
->Exec
, ());
6930 static void GLAPIENTRY
6931 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
6933 GET_CURRENT_CONTEXT(ctx
);
6934 FLUSH_VERTICES(ctx
, 0);
6935 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
6938 static void GLAPIENTRY
6939 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
6941 GET_CURRENT_CONTEXT(ctx
);
6942 FLUSH_VERTICES(ctx
, 0);
6943 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
6946 static void GLAPIENTRY
6947 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
6949 GET_CURRENT_CONTEXT(ctx
);
6950 FLUSH_VERTICES(ctx
, 0);
6951 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
6954 static GLenum GLAPIENTRY
6957 GET_CURRENT_CONTEXT(ctx
);
6958 FLUSH_VERTICES(ctx
, 0);
6959 return CALL_GetError(ctx
->Exec
, ());
6962 static void GLAPIENTRY
6963 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
6965 GET_CURRENT_CONTEXT(ctx
);
6966 FLUSH_VERTICES(ctx
, 0);
6967 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
6970 static void GLAPIENTRY
6971 exec_GetIntegerv(GLenum pname
, GLint
*params
)
6973 GET_CURRENT_CONTEXT(ctx
);
6974 FLUSH_VERTICES(ctx
, 0);
6975 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
6978 static void GLAPIENTRY
6979 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
6981 GET_CURRENT_CONTEXT(ctx
);
6982 FLUSH_VERTICES(ctx
, 0);
6983 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
6986 static void GLAPIENTRY
6987 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
6989 GET_CURRENT_CONTEXT(ctx
);
6990 FLUSH_VERTICES(ctx
, 0);
6991 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
6994 static void GLAPIENTRY
6995 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
6997 GET_CURRENT_CONTEXT(ctx
);
6998 FLUSH_VERTICES(ctx
, 0);
6999 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
7002 static void GLAPIENTRY
7003 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
7005 GET_CURRENT_CONTEXT(ctx
);
7006 FLUSH_VERTICES(ctx
, 0);
7007 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
7010 static void GLAPIENTRY
7011 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
7013 GET_CURRENT_CONTEXT(ctx
);
7014 FLUSH_VERTICES(ctx
, 0);
7015 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
7018 static void GLAPIENTRY
7019 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
7021 GET_CURRENT_CONTEXT(ctx
);
7022 FLUSH_VERTICES(ctx
, 0);
7023 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
7026 static void GLAPIENTRY
7027 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
7029 GET_CURRENT_CONTEXT(ctx
);
7030 FLUSH_VERTICES(ctx
, 0);
7031 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
7034 static void GLAPIENTRY
7035 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
7037 GET_CURRENT_CONTEXT(ctx
);
7038 FLUSH_VERTICES(ctx
, 0);
7039 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
7042 static void GLAPIENTRY
7043 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
7045 GET_CURRENT_CONTEXT(ctx
);
7046 FLUSH_VERTICES(ctx
, 0);
7047 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
7050 static void GLAPIENTRY
7051 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
7053 GET_CURRENT_CONTEXT(ctx
);
7054 FLUSH_VERTICES(ctx
, 0);
7055 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
7058 static void GLAPIENTRY
7059 exec_GetPolygonStipple(GLubyte
* dest
)
7061 GET_CURRENT_CONTEXT(ctx
);
7062 FLUSH_VERTICES(ctx
, 0);
7063 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
7066 static const GLubyte
*GLAPIENTRY
7067 exec_GetString(GLenum name
)
7069 GET_CURRENT_CONTEXT(ctx
);
7070 FLUSH_VERTICES(ctx
, 0);
7071 return CALL_GetString(ctx
->Exec
, (name
));
7074 static void GLAPIENTRY
7075 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7077 GET_CURRENT_CONTEXT(ctx
);
7078 FLUSH_VERTICES(ctx
, 0);
7079 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
7082 static void GLAPIENTRY
7083 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
7085 GET_CURRENT_CONTEXT(ctx
);
7086 FLUSH_VERTICES(ctx
, 0);
7087 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
7090 static void GLAPIENTRY
7091 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
7093 GET_CURRENT_CONTEXT(ctx
);
7094 FLUSH_VERTICES(ctx
, 0);
7095 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
7098 static void GLAPIENTRY
7099 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
7101 GET_CURRENT_CONTEXT(ctx
);
7102 FLUSH_VERTICES(ctx
, 0);
7103 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
7106 static void GLAPIENTRY
7107 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
7109 GET_CURRENT_CONTEXT(ctx
);
7110 FLUSH_VERTICES(ctx
, 0);
7111 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
7114 static void GLAPIENTRY
7115 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
7116 GLenum type
, GLvoid
* pixels
)
7118 GET_CURRENT_CONTEXT(ctx
);
7119 FLUSH_VERTICES(ctx
, 0);
7120 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
7123 static void GLAPIENTRY
7124 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
7125 GLenum pname
, GLfloat
*params
)
7127 GET_CURRENT_CONTEXT(ctx
);
7128 FLUSH_VERTICES(ctx
, 0);
7129 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
7132 static void GLAPIENTRY
7133 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
7134 GLenum pname
, GLint
*params
)
7136 GET_CURRENT_CONTEXT(ctx
);
7137 FLUSH_VERTICES(ctx
, 0);
7138 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
7141 static void GLAPIENTRY
7142 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7144 GET_CURRENT_CONTEXT(ctx
);
7145 FLUSH_VERTICES(ctx
, 0);
7146 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
7149 static void GLAPIENTRY
7150 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7152 GET_CURRENT_CONTEXT(ctx
);
7153 FLUSH_VERTICES(ctx
, 0);
7154 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
7157 static GLboolean GLAPIENTRY
7158 exec_IsEnabled(GLenum cap
)
7160 GET_CURRENT_CONTEXT(ctx
);
7161 FLUSH_VERTICES(ctx
, 0);
7162 return CALL_IsEnabled(ctx
->Exec
, (cap
));
7165 static void GLAPIENTRY
7166 exec_PixelStoref(GLenum pname
, GLfloat param
)
7168 GET_CURRENT_CONTEXT(ctx
);
7169 FLUSH_VERTICES(ctx
, 0);
7170 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
7173 static void GLAPIENTRY
7174 exec_PixelStorei(GLenum pname
, GLint param
)
7176 GET_CURRENT_CONTEXT(ctx
);
7177 FLUSH_VERTICES(ctx
, 0);
7178 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
7181 static void GLAPIENTRY
7182 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
7183 GLenum format
, GLenum type
, GLvoid
* pixels
)
7185 GET_CURRENT_CONTEXT(ctx
);
7186 FLUSH_VERTICES(ctx
, 0);
7187 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
7190 static GLint GLAPIENTRY
7191 exec_RenderMode(GLenum mode
)
7193 GET_CURRENT_CONTEXT(ctx
);
7194 FLUSH_VERTICES(ctx
, 0);
7195 return CALL_RenderMode(ctx
->Exec
, (mode
));
7198 static void GLAPIENTRY
7199 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
7201 GET_CURRENT_CONTEXT(ctx
);
7202 FLUSH_VERTICES(ctx
, 0);
7203 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
7206 static void GLAPIENTRY
7207 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
7209 GET_CURRENT_CONTEXT(ctx
);
7210 FLUSH_VERTICES(ctx
, 0);
7211 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
7214 static GLboolean GLAPIENTRY
7215 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
7216 GLboolean
* residences
)
7218 GET_CURRENT_CONTEXT(ctx
);
7219 FLUSH_VERTICES(ctx
, 0);
7220 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
7223 static void GLAPIENTRY
7224 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7226 GET_CURRENT_CONTEXT(ctx
);
7227 FLUSH_VERTICES(ctx
, 0);
7228 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7231 static void GLAPIENTRY
7232 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
7234 GET_CURRENT_CONTEXT(ctx
);
7235 FLUSH_VERTICES(ctx
, 0);
7236 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
7239 static void GLAPIENTRY
7240 exec_DisableClientState(GLenum cap
)
7242 GET_CURRENT_CONTEXT(ctx
);
7243 FLUSH_VERTICES(ctx
, 0);
7244 CALL_DisableClientState(ctx
->Exec
, (cap
));
7247 static void GLAPIENTRY
7248 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
7250 GET_CURRENT_CONTEXT(ctx
);
7251 FLUSH_VERTICES(ctx
, 0);
7252 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
7255 static void GLAPIENTRY
7256 exec_EnableClientState(GLenum cap
)
7258 GET_CURRENT_CONTEXT(ctx
);
7259 FLUSH_VERTICES(ctx
, 0);
7260 CALL_EnableClientState(ctx
->Exec
, (cap
));
7263 static void GLAPIENTRY
7264 exec_GenTextures(GLsizei n
, GLuint
* texName
)
7266 GET_CURRENT_CONTEXT(ctx
);
7267 FLUSH_VERTICES(ctx
, 0);
7268 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
7271 static void GLAPIENTRY
7272 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
7274 GET_CURRENT_CONTEXT(ctx
);
7275 FLUSH_VERTICES(ctx
, 0);
7276 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
7279 static void GLAPIENTRY
7280 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7282 GET_CURRENT_CONTEXT(ctx
);
7283 FLUSH_VERTICES(ctx
, 0);
7284 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
7287 static void GLAPIENTRY
7288 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
7290 GET_CURRENT_CONTEXT(ctx
);
7291 FLUSH_VERTICES(ctx
, 0);
7292 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
7295 static GLboolean GLAPIENTRY
7296 exec_IsTexture(GLuint texture
)
7298 GET_CURRENT_CONTEXT(ctx
);
7299 FLUSH_VERTICES(ctx
, 0);
7300 return CALL_IsTexture(ctx
->Exec
, (texture
));
7303 static void GLAPIENTRY
7304 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7306 GET_CURRENT_CONTEXT(ctx
);
7307 FLUSH_VERTICES(ctx
, 0);
7308 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
7311 static void GLAPIENTRY
7312 exec_PopClientAttrib(void)
7314 GET_CURRENT_CONTEXT(ctx
);
7315 FLUSH_VERTICES(ctx
, 0);
7316 CALL_PopClientAttrib(ctx
->Exec
, ());
7319 static void GLAPIENTRY
7320 exec_PushClientAttrib(GLbitfield mask
)
7322 GET_CURRENT_CONTEXT(ctx
);
7323 FLUSH_VERTICES(ctx
, 0);
7324 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
7327 static void GLAPIENTRY
7328 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
7331 GET_CURRENT_CONTEXT(ctx
);
7332 FLUSH_VERTICES(ctx
, 0);
7333 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7336 static void GLAPIENTRY
7337 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
7339 GET_CURRENT_CONTEXT(ctx
);
7340 FLUSH_VERTICES(ctx
, 0);
7341 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
7344 static void GLAPIENTRY
7345 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
7348 GET_CURRENT_CONTEXT(ctx
);
7349 FLUSH_VERTICES(ctx
, 0);
7350 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7353 static void GLAPIENTRY
7354 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
7355 GLint x
, GLint y
, GLsizei width
)
7357 GET_CURRENT_CONTEXT(ctx
);
7358 FLUSH_VERTICES(ctx
, 0);
7359 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
7360 (target
, internalFormat
, x
, y
, width
));
7363 static void GLAPIENTRY
7364 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
7365 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
7367 GET_CURRENT_CONTEXT(ctx
);
7368 FLUSH_VERTICES(ctx
, 0);
7369 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
7370 (target
, internalFormat
, x
, y
, width
,
7374 static void GLAPIENTRY
7375 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
7377 GET_CURRENT_CONTEXT(ctx
);
7378 FLUSH_VERTICES(ctx
, 0);
7379 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
7382 static void GLAPIENTRY
7383 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7385 GET_CURRENT_CONTEXT(ctx
);
7386 FLUSH_VERTICES(ctx
, 0);
7387 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
7390 static void GLAPIENTRY
7391 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7393 GET_CURRENT_CONTEXT(ctx
);
7394 FLUSH_VERTICES(ctx
, 0);
7395 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
7398 static void GLAPIENTRY
7399 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
7402 GET_CURRENT_CONTEXT(ctx
);
7403 FLUSH_VERTICES(ctx
, 0);
7404 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
7407 static void GLAPIENTRY
7408 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7410 GET_CURRENT_CONTEXT(ctx
);
7411 FLUSH_VERTICES(ctx
, 0);
7412 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
7415 static void GLAPIENTRY
7416 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7418 GET_CURRENT_CONTEXT(ctx
);
7419 FLUSH_VERTICES(ctx
, 0);
7420 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
7423 static void GLAPIENTRY
7424 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
7425 GLenum type
, GLvoid
*values
)
7427 GET_CURRENT_CONTEXT(ctx
);
7428 FLUSH_VERTICES(ctx
, 0);
7429 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7432 static void GLAPIENTRY
7433 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7435 GET_CURRENT_CONTEXT(ctx
);
7436 FLUSH_VERTICES(ctx
, 0);
7437 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
7440 static void GLAPIENTRY
7441 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7443 GET_CURRENT_CONTEXT(ctx
);
7444 FLUSH_VERTICES(ctx
, 0);
7445 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
7448 static void GLAPIENTRY
7449 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
7450 GLenum type
, GLvoid
*values
)
7452 GET_CURRENT_CONTEXT(ctx
);
7453 FLUSH_VERTICES(ctx
, 0);
7454 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7457 static void GLAPIENTRY
7458 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7460 GET_CURRENT_CONTEXT(ctx
);
7461 FLUSH_VERTICES(ctx
, 0);
7462 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
7465 static void GLAPIENTRY
7466 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7468 GET_CURRENT_CONTEXT(ctx
);
7469 FLUSH_VERTICES(ctx
, 0);
7470 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
7473 static void GLAPIENTRY
7474 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
7475 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
7477 GET_CURRENT_CONTEXT(ctx
);
7478 FLUSH_VERTICES(ctx
, 0);
7479 CALL_GetSeparableFilter(ctx
->Exec
,
7480 (target
, format
, type
, row
, column
, span
));
7483 static void GLAPIENTRY
7484 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
7485 GLsizei width
, GLsizei height
, GLenum format
,
7486 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
7488 GET_CURRENT_CONTEXT(ctx
);
7489 FLUSH_VERTICES(ctx
, 0);
7490 CALL_SeparableFilter2D(ctx
->Exec
,
7491 (target
, internalFormat
, width
, height
, format
,
7492 type
, row
, column
));
7495 static void GLAPIENTRY
7496 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7497 GLsizei count
, const GLvoid
*ptr
)
7499 GET_CURRENT_CONTEXT(ctx
);
7500 FLUSH_VERTICES(ctx
, 0);
7501 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7504 static void GLAPIENTRY
7505 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
7507 GET_CURRENT_CONTEXT(ctx
);
7508 FLUSH_VERTICES(ctx
, 0);
7509 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
7512 static void GLAPIENTRY
7513 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7516 GET_CURRENT_CONTEXT(ctx
);
7517 FLUSH_VERTICES(ctx
, 0);
7518 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
7521 static void GLAPIENTRY
7522 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7525 GET_CURRENT_CONTEXT(ctx
);
7526 FLUSH_VERTICES(ctx
, 0);
7527 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
7530 static void GLAPIENTRY
7531 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7532 GLsizei count
, const GLvoid
*ptr
)
7534 GET_CURRENT_CONTEXT(ctx
);
7535 FLUSH_VERTICES(ctx
, 0);
7536 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7539 static void GLAPIENTRY
7540 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7541 GLsizei count
, const GLvoid
*ptr
)
7543 GET_CURRENT_CONTEXT(ctx
);
7544 FLUSH_VERTICES(ctx
, 0);
7545 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7548 static void GLAPIENTRY
7549 exec_LockArraysEXT(GLint first
, GLsizei count
)
7551 GET_CURRENT_CONTEXT(ctx
);
7552 FLUSH_VERTICES(ctx
, 0);
7553 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
7556 static void GLAPIENTRY
7557 exec_UnlockArraysEXT(void)
7559 GET_CURRENT_CONTEXT(ctx
);
7560 FLUSH_VERTICES(ctx
, 0);
7561 CALL_UnlockArraysEXT(ctx
->Exec
, ());
7564 static void GLAPIENTRY
7565 exec_ClientActiveTextureARB(GLenum target
)
7567 GET_CURRENT_CONTEXT(ctx
);
7568 FLUSH_VERTICES(ctx
, 0);
7569 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
7572 static void GLAPIENTRY
7573 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
7574 GLsizei stride
, const GLvoid
*ptr
)
7576 GET_CURRENT_CONTEXT(ctx
);
7577 FLUSH_VERTICES(ctx
, 0);
7578 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
7581 static void GLAPIENTRY
7582 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7584 GET_CURRENT_CONTEXT(ctx
);
7585 FLUSH_VERTICES(ctx
, 0);
7586 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
7589 /* GL_EXT_multi_draw_arrays */
7590 static void GLAPIENTRY
7591 exec_MultiDrawArraysEXT(GLenum mode
, GLint
* first
,
7592 GLsizei
* count
, GLsizei primcount
)
7594 GET_CURRENT_CONTEXT(ctx
);
7595 FLUSH_VERTICES(ctx
, 0);
7596 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
7599 /* GL_EXT_multi_draw_arrays */
7600 static void GLAPIENTRY
7601 exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
* count
,
7602 GLenum type
, const GLvoid
** indices
,
7605 GET_CURRENT_CONTEXT(ctx
);
7606 FLUSH_VERTICES(ctx
, 0);
7607 CALL_MultiDrawElementsEXT(ctx
->Exec
,
7608 (mode
, count
, type
, indices
, primcount
));
7611 /* GL_IBM_multimode_draw_arrays */
7612 static void GLAPIENTRY
7613 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
7614 const GLsizei
* count
, GLsizei primcount
,
7617 GET_CURRENT_CONTEXT(ctx
);
7618 FLUSH_VERTICES(ctx
, 0);
7619 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
7620 (mode
, first
, count
, primcount
, modestride
));
7623 /* GL_IBM_multimode_draw_arrays */
7624 static void GLAPIENTRY
7625 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
7626 const GLsizei
* count
,
7628 const GLvoid
* const *indices
,
7629 GLsizei primcount
, GLint modestride
)
7631 GET_CURRENT_CONTEXT(ctx
);
7632 FLUSH_VERTICES(ctx
, 0);
7633 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
7634 (mode
, count
, type
, indices
, primcount
,
7641 * Setup the given dispatch table to point to Mesa's display list
7642 * building functions.
7644 * This does not include any of the tnl functions - they are
7645 * initialized from _mesa_init_api_defaults and from the active vtxfmt
7649 _mesa_init_dlist_table(struct _glapi_table
*table
)
7651 _mesa_loopback_init_api_table(table
);
7654 SET_Accum(table
, save_Accum
);
7655 SET_AlphaFunc(table
, save_AlphaFunc
);
7656 SET_Bitmap(table
, save_Bitmap
);
7657 SET_BlendFunc(table
, _mesa_BlendFunc
); /* loops-back to BlendFuncSeparate */
7658 SET_CallList(table
, _mesa_save_CallList
);
7659 SET_CallLists(table
, _mesa_save_CallLists
);
7660 SET_Clear(table
, save_Clear
);
7661 SET_ClearAccum(table
, save_ClearAccum
);
7662 SET_ClearColor(table
, save_ClearColor
);
7663 SET_ClearDepth(table
, save_ClearDepth
);
7664 SET_ClearIndex(table
, save_ClearIndex
);
7665 SET_ClearStencil(table
, save_ClearStencil
);
7666 SET_ClipPlane(table
, save_ClipPlane
);
7667 SET_ColorMask(table
, save_ColorMask
);
7668 SET_ColorMaterial(table
, save_ColorMaterial
);
7669 SET_CopyPixels(table
, save_CopyPixels
);
7670 SET_CullFace(table
, save_CullFace
);
7671 SET_DeleteLists(table
, _mesa_DeleteLists
);
7672 SET_DepthFunc(table
, save_DepthFunc
);
7673 SET_DepthMask(table
, save_DepthMask
);
7674 SET_DepthRange(table
, save_DepthRange
);
7675 SET_Disable(table
, save_Disable
);
7676 SET_DrawBuffer(table
, save_DrawBuffer
);
7677 SET_DrawPixels(table
, save_DrawPixels
);
7678 SET_Enable(table
, save_Enable
);
7679 SET_EndList(table
, _mesa_EndList
);
7680 SET_EvalMesh1(table
, _mesa_save_EvalMesh1
);
7681 SET_EvalMesh2(table
, _mesa_save_EvalMesh2
);
7682 SET_Finish(table
, exec_Finish
);
7683 SET_Flush(table
, exec_Flush
);
7684 SET_Fogf(table
, save_Fogf
);
7685 SET_Fogfv(table
, save_Fogfv
);
7686 SET_Fogi(table
, save_Fogi
);
7687 SET_Fogiv(table
, save_Fogiv
);
7688 SET_FrontFace(table
, save_FrontFace
);
7689 SET_Frustum(table
, save_Frustum
);
7690 SET_GenLists(table
, _mesa_GenLists
);
7691 SET_GetBooleanv(table
, exec_GetBooleanv
);
7692 SET_GetClipPlane(table
, exec_GetClipPlane
);
7693 SET_GetDoublev(table
, exec_GetDoublev
);
7694 SET_GetError(table
, exec_GetError
);
7695 SET_GetFloatv(table
, exec_GetFloatv
);
7696 SET_GetIntegerv(table
, exec_GetIntegerv
);
7697 SET_GetLightfv(table
, exec_GetLightfv
);
7698 SET_GetLightiv(table
, exec_GetLightiv
);
7699 SET_GetMapdv(table
, exec_GetMapdv
);
7700 SET_GetMapfv(table
, exec_GetMapfv
);
7701 SET_GetMapiv(table
, exec_GetMapiv
);
7702 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
7703 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
7704 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
7705 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
7706 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
7707 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
7708 SET_GetString(table
, exec_GetString
);
7709 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
7710 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
7711 SET_GetTexGendv(table
, exec_GetTexGendv
);
7712 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
7713 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
7714 SET_GetTexImage(table
, exec_GetTexImage
);
7715 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
7716 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
7717 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
7718 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
7719 SET_Hint(table
, save_Hint
);
7720 SET_IndexMask(table
, save_IndexMask
);
7721 SET_InitNames(table
, save_InitNames
);
7722 SET_IsEnabled(table
, exec_IsEnabled
);
7723 SET_IsList(table
, _mesa_IsList
);
7724 SET_LightModelf(table
, save_LightModelf
);
7725 SET_LightModelfv(table
, save_LightModelfv
);
7726 SET_LightModeli(table
, save_LightModeli
);
7727 SET_LightModeliv(table
, save_LightModeliv
);
7728 SET_Lightf(table
, save_Lightf
);
7729 SET_Lightfv(table
, save_Lightfv
);
7730 SET_Lighti(table
, save_Lighti
);
7731 SET_Lightiv(table
, save_Lightiv
);
7732 SET_LineStipple(table
, save_LineStipple
);
7733 SET_LineWidth(table
, save_LineWidth
);
7734 SET_ListBase(table
, save_ListBase
);
7735 SET_LoadIdentity(table
, save_LoadIdentity
);
7736 SET_LoadMatrixd(table
, save_LoadMatrixd
);
7737 SET_LoadMatrixf(table
, save_LoadMatrixf
);
7738 SET_LoadName(table
, save_LoadName
);
7739 SET_LogicOp(table
, save_LogicOp
);
7740 SET_Map1d(table
, save_Map1d
);
7741 SET_Map1f(table
, save_Map1f
);
7742 SET_Map2d(table
, save_Map2d
);
7743 SET_Map2f(table
, save_Map2f
);
7744 SET_MapGrid1d(table
, save_MapGrid1d
);
7745 SET_MapGrid1f(table
, save_MapGrid1f
);
7746 SET_MapGrid2d(table
, save_MapGrid2d
);
7747 SET_MapGrid2f(table
, save_MapGrid2f
);
7748 SET_MatrixMode(table
, save_MatrixMode
);
7749 SET_MultMatrixd(table
, save_MultMatrixd
);
7750 SET_MultMatrixf(table
, save_MultMatrixf
);
7751 SET_NewList(table
, save_NewList
);
7752 SET_Ortho(table
, save_Ortho
);
7753 SET_PassThrough(table
, save_PassThrough
);
7754 SET_PixelMapfv(table
, save_PixelMapfv
);
7755 SET_PixelMapuiv(table
, save_PixelMapuiv
);
7756 SET_PixelMapusv(table
, save_PixelMapusv
);
7757 SET_PixelStoref(table
, exec_PixelStoref
);
7758 SET_PixelStorei(table
, exec_PixelStorei
);
7759 SET_PixelTransferf(table
, save_PixelTransferf
);
7760 SET_PixelTransferi(table
, save_PixelTransferi
);
7761 SET_PixelZoom(table
, save_PixelZoom
);
7762 SET_PointSize(table
, save_PointSize
);
7763 SET_PolygonMode(table
, save_PolygonMode
);
7764 SET_PolygonOffset(table
, save_PolygonOffset
);
7765 SET_PolygonStipple(table
, save_PolygonStipple
);
7766 SET_PopAttrib(table
, save_PopAttrib
);
7767 SET_PopMatrix(table
, save_PopMatrix
);
7768 SET_PopName(table
, save_PopName
);
7769 SET_PushAttrib(table
, save_PushAttrib
);
7770 SET_PushMatrix(table
, save_PushMatrix
);
7771 SET_PushName(table
, save_PushName
);
7772 SET_RasterPos2d(table
, save_RasterPos2d
);
7773 SET_RasterPos2dv(table
, save_RasterPos2dv
);
7774 SET_RasterPos2f(table
, save_RasterPos2f
);
7775 SET_RasterPos2fv(table
, save_RasterPos2fv
);
7776 SET_RasterPos2i(table
, save_RasterPos2i
);
7777 SET_RasterPos2iv(table
, save_RasterPos2iv
);
7778 SET_RasterPos2s(table
, save_RasterPos2s
);
7779 SET_RasterPos2sv(table
, save_RasterPos2sv
);
7780 SET_RasterPos3d(table
, save_RasterPos3d
);
7781 SET_RasterPos3dv(table
, save_RasterPos3dv
);
7782 SET_RasterPos3f(table
, save_RasterPos3f
);
7783 SET_RasterPos3fv(table
, save_RasterPos3fv
);
7784 SET_RasterPos3i(table
, save_RasterPos3i
);
7785 SET_RasterPos3iv(table
, save_RasterPos3iv
);
7786 SET_RasterPos3s(table
, save_RasterPos3s
);
7787 SET_RasterPos3sv(table
, save_RasterPos3sv
);
7788 SET_RasterPos4d(table
, save_RasterPos4d
);
7789 SET_RasterPos4dv(table
, save_RasterPos4dv
);
7790 SET_RasterPos4f(table
, save_RasterPos4f
);
7791 SET_RasterPos4fv(table
, save_RasterPos4fv
);
7792 SET_RasterPos4i(table
, save_RasterPos4i
);
7793 SET_RasterPos4iv(table
, save_RasterPos4iv
);
7794 SET_RasterPos4s(table
, save_RasterPos4s
);
7795 SET_RasterPos4sv(table
, save_RasterPos4sv
);
7796 SET_ReadBuffer(table
, save_ReadBuffer
);
7797 SET_ReadPixels(table
, exec_ReadPixels
);
7798 SET_RenderMode(table
, exec_RenderMode
);
7799 SET_Rotated(table
, save_Rotated
);
7800 SET_Rotatef(table
, save_Rotatef
);
7801 SET_Scaled(table
, save_Scaled
);
7802 SET_Scalef(table
, save_Scalef
);
7803 SET_Scissor(table
, save_Scissor
);
7804 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
7805 SET_SelectBuffer(table
, exec_SelectBuffer
);
7806 SET_ShadeModel(table
, save_ShadeModel
);
7807 SET_StencilFunc(table
, save_StencilFunc
);
7808 SET_StencilMask(table
, save_StencilMask
);
7809 SET_StencilOp(table
, save_StencilOp
);
7810 SET_TexEnvf(table
, save_TexEnvf
);
7811 SET_TexEnvfv(table
, save_TexEnvfv
);
7812 SET_TexEnvi(table
, save_TexEnvi
);
7813 SET_TexEnviv(table
, save_TexEnviv
);
7814 SET_TexGend(table
, save_TexGend
);
7815 SET_TexGendv(table
, save_TexGendv
);
7816 SET_TexGenf(table
, save_TexGenf
);
7817 SET_TexGenfv(table
, save_TexGenfv
);
7818 SET_TexGeni(table
, save_TexGeni
);
7819 SET_TexGeniv(table
, save_TexGeniv
);
7820 SET_TexImage1D(table
, save_TexImage1D
);
7821 SET_TexImage2D(table
, save_TexImage2D
);
7822 SET_TexParameterf(table
, save_TexParameterf
);
7823 SET_TexParameterfv(table
, save_TexParameterfv
);
7824 SET_TexParameteri(table
, save_TexParameteri
);
7825 SET_TexParameteriv(table
, save_TexParameteriv
);
7826 SET_Translated(table
, save_Translated
);
7827 SET_Translatef(table
, save_Translatef
);
7828 SET_Viewport(table
, save_Viewport
);
7831 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
7832 SET_BindTexture(table
, save_BindTexture
);
7833 SET_ColorPointer(table
, exec_ColorPointer
);
7834 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
7835 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
7836 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
7837 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
7838 SET_DeleteTextures(table
, exec_DeleteTextures
);
7839 SET_DisableClientState(table
, exec_DisableClientState
);
7840 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
7841 SET_EnableClientState(table
, exec_EnableClientState
);
7842 SET_GenTextures(table
, exec_GenTextures
);
7843 SET_GetPointerv(table
, exec_GetPointerv
);
7844 SET_IndexPointer(table
, exec_IndexPointer
);
7845 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
7846 SET_IsTexture(table
, exec_IsTexture
);
7847 SET_NormalPointer(table
, exec_NormalPointer
);
7848 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
7849 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
7850 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
7851 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
7852 SET_TexSubImage1D(table
, save_TexSubImage1D
);
7853 SET_TexSubImage2D(table
, save_TexSubImage2D
);
7854 SET_VertexPointer(table
, exec_VertexPointer
);
7857 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
7858 SET_TexImage3D(table
, save_TexImage3D
);
7859 SET_TexSubImage3D(table
, save_TexSubImage3D
);
7862 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
7863 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
7864 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
7866 /* GL_ARB_imaging */
7867 /* Not all are supported */
7868 SET_BlendColor(table
, save_BlendColor
);
7869 SET_BlendEquation(table
, save_BlendEquation
);
7870 SET_ColorSubTable(table
, save_ColorSubTable
);
7871 SET_ColorTable(table
, save_ColorTable
);
7872 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
7873 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
7874 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
7875 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
7876 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
7877 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
7878 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
7879 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
7880 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
7881 SET_CopyColorTable(table
, save_CopyColorTable
);
7882 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
7883 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
7884 SET_GetColorTable(table
, exec_GetColorTable
);
7885 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
7886 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
7887 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
7888 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
7889 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
7890 SET_GetHistogram(table
, exec_GetHistogram
);
7891 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
7892 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
7893 SET_GetMinmax(table
, exec_GetMinmax
);
7894 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
7895 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
7896 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
7897 SET_Histogram(table
, save_Histogram
);
7898 SET_Minmax(table
, save_Minmax
);
7899 SET_ResetHistogram(table
, save_ResetHistogram
);
7900 SET_ResetMinmax(table
, save_ResetMinmax
);
7901 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
7903 /* 2. GL_EXT_blend_color */
7905 SET_BlendColorEXT(table
, save_BlendColorEXT
);
7908 /* 3. GL_EXT_polygon_offset */
7909 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
7911 /* 6. GL_EXT_texture3d */
7913 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
7914 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
7915 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
7918 /* 14. GL_SGI_color_table */
7920 SET_ColorTableSGI(table
, save_ColorTable
);
7921 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
7922 SET_GetColorTableSGI(table
, exec_GetColorTable
);
7923 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
7924 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
7927 /* 30. GL_EXT_vertex_array */
7928 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
7929 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
7930 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
7931 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
7932 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
7933 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
7935 /* 37. GL_EXT_blend_minmax */
7937 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
7940 /* 54. GL_EXT_point_parameters */
7941 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
7942 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
7944 /* 97. GL_EXT_compiled_vertex_array */
7945 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
7946 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
7948 /* 145. GL_EXT_secondary_color */
7949 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
7951 /* 148. GL_EXT_multi_draw_arrays */
7952 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
7953 SET_MultiDrawElementsEXT(table
, exec_MultiDrawElementsEXT
);
7955 /* 149. GL_EXT_fog_coord */
7956 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
7958 /* 173. GL_EXT_blend_func_separate */
7959 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
7961 /* 196. GL_MESA_resize_buffers */
7962 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
7964 /* 197. GL_MESA_window_pos */
7965 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
7966 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
7967 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
7968 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
7969 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
7970 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
7971 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
7972 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
7973 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
7974 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
7975 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
7976 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
7977 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
7978 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
7979 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
7980 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
7981 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
7982 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
7983 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
7984 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
7985 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
7986 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
7987 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
7988 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
7990 /* 200. GL_IBM_multimode_draw_arrays */
7991 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
7992 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
7994 #if FEATURE_NV_vertex_program
7995 /* 233. GL_NV_vertex_program */
7996 /* The following commands DO NOT go into display lists:
7997 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
7998 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
8000 SET_BindProgramNV(table
, save_BindProgramNV
);
8001 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8002 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
8003 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8004 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
8005 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
8006 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
8007 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
8008 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
8009 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
8010 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
8011 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8012 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8013 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8014 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8015 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
8016 SET_LoadProgramNV(table
, save_LoadProgramNV
);
8017 SET_ProgramParameter4dNV(table
, save_ProgramParameter4dNV
);
8018 SET_ProgramParameter4dvNV(table
, save_ProgramParameter4dvNV
);
8019 SET_ProgramParameter4fNV(table
, save_ProgramParameter4fNV
);
8020 SET_ProgramParameter4fvNV(table
, save_ProgramParameter4fvNV
);
8021 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
8022 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
8023 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
8024 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
8027 /* 245. GL_ATI_fragment_shader */
8028 #if FEATURE_ATI_fragment_shader
8029 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
8030 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
8033 /* 282. GL_NV_fragment_program */
8034 #if FEATURE_NV_fragment_program
8035 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
8036 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
8037 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
8038 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
8039 SET_GetProgramNamedParameterfvNV(table
,
8040 _mesa_GetProgramNamedParameterfvNV
);
8041 SET_GetProgramNamedParameterdvNV(table
,
8042 _mesa_GetProgramNamedParameterdvNV
);
8043 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8044 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8045 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8046 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8047 SET_GetProgramLocalParameterdvARB(table
,
8048 _mesa_GetProgramLocalParameterdvARB
);
8049 SET_GetProgramLocalParameterfvARB(table
,
8050 _mesa_GetProgramLocalParameterfvARB
);
8053 /* 262. GL_NV_point_sprite */
8054 SET_PointParameteriNV(table
, save_PointParameteriNV
);
8055 SET_PointParameterivNV(table
, save_PointParameterivNV
);
8057 /* 268. GL_EXT_stencil_two_side */
8058 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
8060 /* 273. GL_APPLE_vertex_array_object */
8061 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
8062 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
8063 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
8064 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
8066 /* ???. GL_EXT_depth_bounds_test */
8067 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
8069 /* ARB 1. GL_ARB_multitexture */
8070 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
8071 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
8073 /* ARB 3. GL_ARB_transpose_matrix */
8074 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
8075 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
8076 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
8077 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
8079 /* ARB 5. GL_ARB_multisample */
8080 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
8082 /* ARB 12. GL_ARB_texture_compression */
8083 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
8084 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
8085 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
8086 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
8087 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
8088 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
8089 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
8091 /* ARB 14. GL_ARB_point_parameters */
8092 /* aliased with EXT_point_parameters functions */
8094 /* ARB 25. GL_ARB_window_pos */
8095 /* aliased with MESA_window_pos functions */
8097 /* ARB 26. GL_ARB_vertex_program */
8098 /* ARB 27. GL_ARB_fragment_program */
8099 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8100 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
8101 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
8102 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
8103 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
8104 SET_ProgramStringARB(table
, save_ProgramStringARB
);
8105 SET_BindProgramNV(table
, save_BindProgramNV
);
8106 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8107 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8108 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
8109 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8110 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8111 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8112 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8113 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
8114 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
8115 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
8116 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
8117 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8118 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8119 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8120 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8121 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
8122 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
8123 SET_GetProgramLocalParameterdvARB(table
,
8124 _mesa_GetProgramLocalParameterdvARB
);
8125 SET_GetProgramLocalParameterfvARB(table
,
8126 _mesa_GetProgramLocalParameterfvARB
);
8127 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
8128 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
8131 /* ARB 28. GL_ARB_vertex_buffer_object */
8132 #if FEATURE_ARB_vertex_buffer_object
8133 /* None of the extension's functions get compiled */
8134 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
8135 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
8136 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
8137 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
8138 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
8139 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
8140 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
8141 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
8142 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
8143 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
8144 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
8147 #if FEATURE_ARB_occlusion_query
8148 SET_BeginQueryARB(table
, save_BeginQueryARB
);
8149 SET_EndQueryARB(table
, save_EndQueryARB
);
8150 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
8151 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
8152 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
8153 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
8154 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
8155 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
8157 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
8159 #if FEATURE_EXT_framebuffer_blit
8160 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
8163 /* 299. GL_EXT_blend_equation_separate */
8164 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
8166 /* GL_EXT_gpu_program_parmaeters */
8167 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8168 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
8169 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
8176 enum_string(GLenum k
)
8178 return _mesa_lookup_enum_by_nr(k
);
8183 * Print the commands in a display list. For debugging only.
8184 * TODO: many commands aren't handled yet.
8186 static void GLAPIENTRY
8187 print_list(GLcontext
*ctx
, GLuint list
)
8189 struct mesa_display_list
*dlist
;
8193 if (!islist(ctx
, list
)) {
8194 _mesa_printf("%u is not a display list ID\n", list
);
8198 dlist
= lookup_list(ctx
, list
);
8204 _mesa_printf("START-LIST %u, address %p\n", list
, (void *) n
);
8206 done
= n
? GL_FALSE
: GL_TRUE
;
8208 OpCode opcode
= n
[0].opcode
;
8209 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
8211 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
8212 /* this is a driver-extended opcode */
8213 ctx
->ListExt
.Opcode
[i
].Print(ctx
, &n
[1]);
8214 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
8219 _mesa_printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
8222 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
8223 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
8225 case OPCODE_CALL_LIST
:
8226 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
8228 case OPCODE_CALL_LIST_OFFSET
:
8229 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
8230 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
8232 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
8233 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
8234 enum_string(n
[1].e
), enum_string(n
[2].e
),
8235 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8237 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
8238 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
8239 enum_string(n
[1].e
), enum_string(n
[2].e
),
8240 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
8242 case OPCODE_DISABLE
:
8243 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
8246 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
8248 case OPCODE_FRUSTUM
:
8249 _mesa_printf("Frustum %g %g %g %g %g %g\n",
8250 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8252 case OPCODE_LINE_STIPPLE
:
8253 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
8255 case OPCODE_LOAD_IDENTITY
:
8256 _mesa_printf("LoadIdentity\n");
8258 case OPCODE_LOAD_MATRIX
:
8259 _mesa_printf("LoadMatrix\n");
8260 _mesa_printf(" %8f %8f %8f %8f\n",
8261 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8262 _mesa_printf(" %8f %8f %8f %8f\n",
8263 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8264 _mesa_printf(" %8f %8f %8f %8f\n",
8265 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8266 _mesa_printf(" %8f %8f %8f %8f\n",
8267 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8269 case OPCODE_MULT_MATRIX
:
8270 _mesa_printf("MultMatrix (or Rotate)\n");
8271 _mesa_printf(" %8f %8f %8f %8f\n",
8272 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8273 _mesa_printf(" %8f %8f %8f %8f\n",
8274 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8275 _mesa_printf(" %8f %8f %8f %8f\n",
8276 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8277 _mesa_printf(" %8f %8f %8f %8f\n",
8278 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8281 _mesa_printf("Ortho %g %g %g %g %g %g\n",
8282 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8284 case OPCODE_POP_ATTRIB
:
8285 _mesa_printf("PopAttrib\n");
8287 case OPCODE_POP_MATRIX
:
8288 _mesa_printf("PopMatrix\n");
8290 case OPCODE_POP_NAME
:
8291 _mesa_printf("PopName\n");
8293 case OPCODE_PUSH_ATTRIB
:
8294 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
8296 case OPCODE_PUSH_MATRIX
:
8297 _mesa_printf("PushMatrix\n");
8299 case OPCODE_PUSH_NAME
:
8300 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
8302 case OPCODE_RASTER_POS
:
8303 _mesa_printf("RasterPos %g %g %g %g\n",
8304 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8307 _mesa_printf("Rotate %g %g %g %g\n",
8308 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8311 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8313 case OPCODE_TRANSLATE
:
8314 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8316 case OPCODE_BIND_TEXTURE
:
8317 _mesa_printf("BindTexture %s %d\n",
8318 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
8320 case OPCODE_SHADE_MODEL
:
8321 _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
8324 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
8325 _mesa_lookup_enum_by_nr(n
[1].ui
),
8326 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
8329 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
8330 _mesa_lookup_enum_by_nr(n
[1].ui
),
8331 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
8332 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
8334 case OPCODE_MAPGRID1
:
8335 _mesa_printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
8337 case OPCODE_MAPGRID2
:
8338 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
8339 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
8341 case OPCODE_EVALMESH1
:
8342 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
8344 case OPCODE_EVALMESH2
:
8345 _mesa_printf("EvalMesh2 %d %d %d %d\n",
8346 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
8349 case OPCODE_ATTR_1F_NV
:
8350 _mesa_printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
8352 case OPCODE_ATTR_2F_NV
:
8353 _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
8354 n
[1].i
, n
[2].f
, n
[3].f
);
8356 case OPCODE_ATTR_3F_NV
:
8357 _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
8358 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8360 case OPCODE_ATTR_4F_NV
:
8361 _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
8362 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8364 case OPCODE_ATTR_1F_ARB
:
8365 _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
8367 case OPCODE_ATTR_2F_ARB
:
8368 _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
8369 n
[1].i
, n
[2].f
, n
[3].f
);
8371 case OPCODE_ATTR_3F_ARB
:
8372 _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
8373 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8375 case OPCODE_ATTR_4F_ARB
:
8376 _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
8377 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8380 case OPCODE_MATERIAL
:
8381 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
8382 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8385 _mesa_printf("BEGIN %x\n", n
[1].i
);
8388 _mesa_printf("END\n");
8391 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
8394 case OPCODE_EVAL_C1
:
8395 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
8397 case OPCODE_EVAL_C2
:
8398 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
8400 case OPCODE_EVAL_P1
:
8401 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
8403 case OPCODE_EVAL_P2
:
8404 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
8408 * meta opcodes/commands
8411 _mesa_printf("Error: %s %s\n",
8412 enum_string(n
[1].e
), (const char *) n
[2].data
);
8414 case OPCODE_CONTINUE
:
8415 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
8416 n
= (Node
*) n
[1].next
;
8418 case OPCODE_END_OF_LIST
:
8419 _mesa_printf("END-LIST %u\n", list
);
8423 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
8425 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
8426 opcode
, (void *) n
);
8430 _mesa_printf("command %d, %u operands\n", opcode
,
8434 /* increment n to point to next compiled command */
8435 if (opcode
!= OPCODE_CONTINUE
) {
8436 n
+= InstSize
[opcode
];
8445 * Clients may call this function to help debug display list problems.
8446 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
8447 * changed, or break in the future without notice.
8450 mesa_print_display_list(GLuint list
)
8452 GET_CURRENT_CONTEXT(ctx
);
8453 print_list(ctx
, list
);
8457 /**********************************************************************/
8458 /***** Initialization *****/
8459 /**********************************************************************/
8462 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
8464 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
8465 vfmt
->Begin
= save_Begin
;
8466 vfmt
->CallList
= _mesa_save_CallList
;
8467 vfmt
->CallLists
= _mesa_save_CallLists
;
8468 vfmt
->Color3f
= save_Color3f
;
8469 vfmt
->Color3fv
= save_Color3fv
;
8470 vfmt
->Color4f
= save_Color4f
;
8471 vfmt
->Color4fv
= save_Color4fv
;
8472 vfmt
->EdgeFlag
= save_EdgeFlag
;
8473 vfmt
->End
= save_End
;
8474 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
8475 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
8476 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
8477 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
8478 vfmt
->EvalPoint1
= save_EvalPoint1
;
8479 vfmt
->EvalPoint2
= save_EvalPoint2
;
8480 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
8481 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
8482 vfmt
->Indexf
= save_Indexf
;
8483 vfmt
->Indexfv
= save_Indexfv
;
8484 vfmt
->Materialfv
= save_Materialfv
;
8485 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
8486 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
8487 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
8488 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
8489 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
8490 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
8491 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
8492 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
8493 vfmt
->Normal3f
= save_Normal3f
;
8494 vfmt
->Normal3fv
= save_Normal3fv
;
8495 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
8496 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
8497 vfmt
->TexCoord1f
= save_TexCoord1f
;
8498 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
8499 vfmt
->TexCoord2f
= save_TexCoord2f
;
8500 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
8501 vfmt
->TexCoord3f
= save_TexCoord3f
;
8502 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
8503 vfmt
->TexCoord4f
= save_TexCoord4f
;
8504 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
8505 vfmt
->Vertex2f
= save_Vertex2f
;
8506 vfmt
->Vertex2fv
= save_Vertex2fv
;
8507 vfmt
->Vertex3f
= save_Vertex3f
;
8508 vfmt
->Vertex3fv
= save_Vertex3fv
;
8509 vfmt
->Vertex4f
= save_Vertex4f
;
8510 vfmt
->Vertex4fv
= save_Vertex4fv
;
8511 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
8512 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
8513 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
8514 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
8515 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
8516 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
8517 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
8518 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
8519 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
8520 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
8521 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
8522 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
8523 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
8524 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
8525 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
8526 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
8528 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
8529 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
8530 vfmt
->Rectf
= save_Rectf
;
8532 /* The driver is required to implement these as
8533 * 1) They can probably do a better job.
8534 * 2) A lot of new mechanisms would have to be added to this module
8535 * to support it. That code would probably never get used,
8539 vfmt
->DrawArrays
= 0;
8540 vfmt
->DrawElements
= 0;
8541 vfmt
->DrawRangeElements
= 0;
8547 * Initialize display list state for given context.
8550 _mesa_init_display_list(GLcontext
*ctx
)
8552 static GLboolean tableInitialized
= GL_FALSE
;
8554 /* zero-out the instruction size table, just once */
8555 if (!tableInitialized
) {
8556 _mesa_bzero(InstSize
, sizeof(InstSize
));
8557 tableInitialized
= GL_TRUE
;
8561 ctx
->ListState
.CallDepth
= 0;
8562 ctx
->ExecuteFlag
= GL_TRUE
;
8563 ctx
->CompileFlag
= GL_FALSE
;
8564 ctx
->ListState
.CurrentListPtr
= NULL
;
8565 ctx
->ListState
.CurrentBlock
= NULL
;
8566 ctx
->ListState
.CurrentListNum
= 0;
8567 ctx
->ListState
.CurrentPos
= 0;
8569 /* Display List group */
8570 ctx
->List
.ListBase
= 0;
8572 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);