2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 * Display lists management functions.
33 #include "api_arrayelt.h"
34 #include "api_loopback.h"
39 #if FEATURE_ARB_vertex_buffer_object
40 #include "bufferobj.h"
53 #include "extensions.h"
56 #include "glapi/glapi.h"
58 #include "histogram.h"
75 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
76 #include "shader/arbprogram.h"
77 #include "shader/program.h"
79 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
80 #include "shader/nvprogram.h"
81 #include "shader/program.h"
83 #if FEATURE_ATI_fragment_shader
84 #include "shader/atifragshader.h"
87 #include "math/m_matrix.h"
88 #include "math/m_xform.h"
90 #include "glapi/dispatch.h"
96 * \param ctx GL context.
98 * Checks if dd_function_table::SaveNeedFlush is marked to flush
99 * stored (save) vertices, and calls
100 * dd_function_table::SaveFlushVertices if so.
102 #define SAVE_FLUSH_VERTICES(ctx) \
104 if (ctx->Driver.SaveNeedFlush) \
105 ctx->Driver.SaveFlushVertices(ctx); \
110 * Macro to assert that the API call was made outside the
111 * glBegin()/glEnd() pair, with return value.
113 * \param ctx GL context.
114 * \param retval value to return value in case the assertion fails.
116 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
118 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
119 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
120 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
126 * Macro to assert that the API call was made outside the
127 * glBegin()/glEnd() pair.
129 * \param ctx GL context.
131 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
133 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
134 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
135 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
141 * Macro to assert that the API call was made outside the
142 * glBegin()/glEnd() pair and flush the vertices.
144 * \param ctx GL context.
146 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
148 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
149 SAVE_FLUSH_VERTICES(ctx); \
153 * Macro to assert that the API call was made outside the
154 * glBegin()/glEnd() pair and flush the vertices, with return value.
156 * \param ctx GL context.
157 * \param retval value to return value in case the assertion fails.
159 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
161 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
162 SAVE_FLUSH_VERTICES(ctx); \
168 * Display list opcodes.
170 * The fact that these identifiers are assigned consecutive
171 * integer values starting at 0 is very important, see InstSize array usage)
175 OPCODE_INVALID
= -1, /* Force signed enum */
181 OPCODE_BLEND_EQUATION
,
182 OPCODE_BLEND_EQUATION_SEPARATE
,
183 OPCODE_BLEND_FUNC_SEPARATE
,
185 OPCODE_CALL_LIST_OFFSET
,
191 OPCODE_CLEAR_STENCIL
,
194 OPCODE_COLOR_MATERIAL
,
196 OPCODE_COLOR_TABLE_PARAMETER_FV
,
197 OPCODE_COLOR_TABLE_PARAMETER_IV
,
198 OPCODE_COLOR_SUB_TABLE
,
199 OPCODE_CONVOLUTION_FILTER_1D
,
200 OPCODE_CONVOLUTION_FILTER_2D
,
201 OPCODE_CONVOLUTION_PARAMETER_I
,
202 OPCODE_CONVOLUTION_PARAMETER_IV
,
203 OPCODE_CONVOLUTION_PARAMETER_F
,
204 OPCODE_CONVOLUTION_PARAMETER_FV
,
205 OPCODE_COPY_COLOR_SUB_TABLE
,
206 OPCODE_COPY_COLOR_TABLE
,
208 OPCODE_COPY_TEX_IMAGE1D
,
209 OPCODE_COPY_TEX_IMAGE2D
,
210 OPCODE_COPY_TEX_SUB_IMAGE1D
,
211 OPCODE_COPY_TEX_SUB_IMAGE2D
,
212 OPCODE_COPY_TEX_SUB_IMAGE3D
,
235 OPCODE_LOAD_IDENTITY
,
249 OPCODE_PIXEL_TRANSFER
,
252 OPCODE_POINT_PARAMETERS
,
254 OPCODE_POLYGON_STIPPLE
,
255 OPCODE_POLYGON_OFFSET
,
259 OPCODE_PRIORITIZE_TEXTURE
,
265 OPCODE_RESET_HISTOGRAM
,
266 OPCODE_RESET_MIN_MAX
,
270 OPCODE_SELECT_TEXTURE_SGIS
,
271 OPCODE_SELECT_TEXTURE_COORD_SET
,
282 OPCODE_TEX_SUB_IMAGE1D
,
283 OPCODE_TEX_SUB_IMAGE2D
,
284 OPCODE_TEX_SUB_IMAGE3D
,
288 /* GL_ARB_multitexture */
289 OPCODE_ACTIVE_TEXTURE
,
290 /* GL_ARB_texture_compression */
291 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
292 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
293 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
294 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
295 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
296 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
297 /* GL_ARB_multisample */
298 OPCODE_SAMPLE_COVERAGE
,
299 /* GL_ARB_window_pos */
300 OPCODE_WINDOW_POS_ARB
,
301 /* GL_NV_vertex_program */
302 OPCODE_BIND_PROGRAM_NV
,
303 OPCODE_EXECUTE_PROGRAM_NV
,
304 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
305 OPCODE_LOAD_PROGRAM_NV
,
306 OPCODE_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
));
2719 static void GLAPIENTRY
2720 save_PolygonStipple(const GLubyte
* pattern
)
2722 GET_CURRENT_CONTEXT(ctx
);
2723 GLvoid
*image
= unpack_image(2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
2724 pattern
, &ctx
->Unpack
);
2726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2727 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
2734 if (ctx
->ExecuteFlag
) {
2735 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
2740 static void GLAPIENTRY
2741 save_PolygonOffset(GLfloat factor
, GLfloat units
)
2743 GET_CURRENT_CONTEXT(ctx
);
2745 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2746 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_OFFSET
, 2);
2751 if (ctx
->ExecuteFlag
) {
2752 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
2757 static void GLAPIENTRY
2758 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
2760 GET_CURRENT_CONTEXT(ctx
);
2761 /* XXX mult by DepthMaxF here??? */
2762 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
2766 static void GLAPIENTRY
2767 save_PopAttrib(void)
2769 GET_CURRENT_CONTEXT(ctx
);
2770 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2771 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_ATTRIB
, 0);
2772 if (ctx
->ExecuteFlag
) {
2773 CALL_PopAttrib(ctx
->Exec
, ());
2778 static void GLAPIENTRY
2779 save_PopMatrix(void)
2781 GET_CURRENT_CONTEXT(ctx
);
2782 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2783 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_MATRIX
, 0);
2784 if (ctx
->ExecuteFlag
) {
2785 CALL_PopMatrix(ctx
->Exec
, ());
2790 static void GLAPIENTRY
2793 GET_CURRENT_CONTEXT(ctx
);
2794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2795 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_NAME
, 0);
2796 if (ctx
->ExecuteFlag
) {
2797 CALL_PopName(ctx
->Exec
, ());
2802 static void GLAPIENTRY
2803 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
2804 const GLclampf
* priorities
)
2806 GET_CURRENT_CONTEXT(ctx
);
2808 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2810 for (i
= 0; i
< num
; i
++) {
2812 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
2814 n
[1].ui
= textures
[i
];
2815 n
[2].f
= priorities
[i
];
2818 if (ctx
->ExecuteFlag
) {
2819 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
2824 static void GLAPIENTRY
2825 save_PushAttrib(GLbitfield mask
)
2827 GET_CURRENT_CONTEXT(ctx
);
2829 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2830 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_ATTRIB
, 1);
2834 if (ctx
->ExecuteFlag
) {
2835 CALL_PushAttrib(ctx
->Exec
, (mask
));
2840 static void GLAPIENTRY
2841 save_PushMatrix(void)
2843 GET_CURRENT_CONTEXT(ctx
);
2844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2845 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_MATRIX
, 0);
2846 if (ctx
->ExecuteFlag
) {
2847 CALL_PushMatrix(ctx
->Exec
, ());
2852 static void GLAPIENTRY
2853 save_PushName(GLuint name
)
2855 GET_CURRENT_CONTEXT(ctx
);
2857 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2858 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_NAME
, 1);
2862 if (ctx
->ExecuteFlag
) {
2863 CALL_PushName(ctx
->Exec
, (name
));
2868 static void GLAPIENTRY
2869 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2871 GET_CURRENT_CONTEXT(ctx
);
2873 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2874 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RASTER_POS
, 4);
2881 if (ctx
->ExecuteFlag
) {
2882 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
2886 static void GLAPIENTRY
2887 save_RasterPos2d(GLdouble x
, GLdouble y
)
2889 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2892 static void GLAPIENTRY
2893 save_RasterPos2f(GLfloat x
, GLfloat y
)
2895 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2898 static void GLAPIENTRY
2899 save_RasterPos2i(GLint x
, GLint y
)
2901 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2904 static void GLAPIENTRY
2905 save_RasterPos2s(GLshort x
, GLshort y
)
2907 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2910 static void GLAPIENTRY
2911 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2913 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2916 static void GLAPIENTRY
2917 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2919 save_RasterPos4f(x
, y
, z
, 1.0F
);
2922 static void GLAPIENTRY
2923 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2925 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2928 static void GLAPIENTRY
2929 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2931 save_RasterPos4f(x
, y
, z
, 1.0F
);
2934 static void GLAPIENTRY
2935 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2937 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2940 static void GLAPIENTRY
2941 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
2943 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2946 static void GLAPIENTRY
2947 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
2949 save_RasterPos4f(x
, y
, z
, w
);
2952 static void GLAPIENTRY
2953 save_RasterPos2dv(const GLdouble
* v
)
2955 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2958 static void GLAPIENTRY
2959 save_RasterPos2fv(const GLfloat
* v
)
2961 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2964 static void GLAPIENTRY
2965 save_RasterPos2iv(const GLint
* v
)
2967 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2970 static void GLAPIENTRY
2971 save_RasterPos2sv(const GLshort
* v
)
2973 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2976 static void GLAPIENTRY
2977 save_RasterPos3dv(const GLdouble
* v
)
2979 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2982 static void GLAPIENTRY
2983 save_RasterPos3fv(const GLfloat
* v
)
2985 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
2988 static void GLAPIENTRY
2989 save_RasterPos3iv(const GLint
* v
)
2991 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2994 static void GLAPIENTRY
2995 save_RasterPos3sv(const GLshort
* v
)
2997 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3000 static void GLAPIENTRY
3001 save_RasterPos4dv(const GLdouble
* v
)
3003 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3004 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3007 static void GLAPIENTRY
3008 save_RasterPos4fv(const GLfloat
* v
)
3010 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3013 static void GLAPIENTRY
3014 save_RasterPos4iv(const GLint
* v
)
3016 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3017 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3020 static void GLAPIENTRY
3021 save_RasterPos4sv(const GLshort
* v
)
3023 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3027 static void GLAPIENTRY
3028 save_PassThrough(GLfloat token
)
3030 GET_CURRENT_CONTEXT(ctx
);
3032 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3033 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PASSTHROUGH
, 1);
3037 if (ctx
->ExecuteFlag
) {
3038 CALL_PassThrough(ctx
->Exec
, (token
));
3043 static void GLAPIENTRY
3044 save_ReadBuffer(GLenum mode
)
3046 GET_CURRENT_CONTEXT(ctx
);
3048 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3049 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_READ_BUFFER
, 1);
3053 if (ctx
->ExecuteFlag
) {
3054 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3059 static void GLAPIENTRY
3060 save_ResetHistogram(GLenum target
)
3062 GET_CURRENT_CONTEXT(ctx
);
3064 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3065 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3069 if (ctx
->ExecuteFlag
) {
3070 CALL_ResetHistogram(ctx
->Exec
, (target
));
3075 static void GLAPIENTRY
3076 save_ResetMinmax(GLenum target
)
3078 GET_CURRENT_CONTEXT(ctx
);
3080 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3081 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3085 if (ctx
->ExecuteFlag
) {
3086 CALL_ResetMinmax(ctx
->Exec
, (target
));
3091 static void GLAPIENTRY
3092 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3094 GET_CURRENT_CONTEXT(ctx
);
3096 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3097 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ROTATE
, 4);
3104 if (ctx
->ExecuteFlag
) {
3105 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3110 static void GLAPIENTRY
3111 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3113 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3117 static void GLAPIENTRY
3118 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3120 GET_CURRENT_CONTEXT(ctx
);
3122 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3123 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCALE
, 3);
3129 if (ctx
->ExecuteFlag
) {
3130 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3135 static void GLAPIENTRY
3136 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3138 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3142 static void GLAPIENTRY
3143 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3145 GET_CURRENT_CONTEXT(ctx
);
3147 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3148 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCISSOR
, 4);
3155 if (ctx
->ExecuteFlag
) {
3156 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3161 static void GLAPIENTRY
3162 save_ShadeModel(GLenum mode
)
3164 GET_CURRENT_CONTEXT(ctx
);
3166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3167 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SHADE_MODEL
, 1);
3171 if (ctx
->ExecuteFlag
) {
3172 CALL_ShadeModel(ctx
->Exec
, (mode
));
3177 static void GLAPIENTRY
3178 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3180 GET_CURRENT_CONTEXT(ctx
);
3182 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3183 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC
, 3);
3189 if (ctx
->ExecuteFlag
) {
3190 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3195 static void GLAPIENTRY
3196 save_StencilMask(GLuint mask
)
3198 GET_CURRENT_CONTEXT(ctx
);
3200 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3201 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK
, 1);
3205 if (ctx
->ExecuteFlag
) {
3206 CALL_StencilMask(ctx
->Exec
, (mask
));
3211 static void GLAPIENTRY
3212 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3214 GET_CURRENT_CONTEXT(ctx
);
3216 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3217 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP
, 3);
3223 if (ctx
->ExecuteFlag
) {
3224 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3229 static void GLAPIENTRY
3230 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3232 GET_CURRENT_CONTEXT(ctx
);
3234 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3235 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3242 if (ctx
->ExecuteFlag
) {
3243 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3248 static void GLAPIENTRY
3249 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3251 GET_CURRENT_CONTEXT(ctx
);
3253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3254 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3259 if (ctx
->ExecuteFlag
) {
3260 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3265 static void GLAPIENTRY
3266 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3268 GET_CURRENT_CONTEXT(ctx
);
3270 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3271 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3278 if (ctx
->ExecuteFlag
) {
3279 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3284 static void GLAPIENTRY
3285 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3287 GET_CURRENT_CONTEXT(ctx
);
3289 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3290 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXENV
, 6);
3294 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3302 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3305 if (ctx
->ExecuteFlag
) {
3306 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3311 static void GLAPIENTRY
3312 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3314 save_TexEnvfv(target
, pname
, ¶m
);
3318 static void GLAPIENTRY
3319 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3322 p
[0] = (GLfloat
) param
;
3323 p
[1] = p
[2] = p
[3] = 0.0;
3324 save_TexEnvfv(target
, pname
, p
);
3328 static void GLAPIENTRY
3329 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3332 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3333 p
[0] = INT_TO_FLOAT(param
[0]);
3334 p
[1] = INT_TO_FLOAT(param
[1]);
3335 p
[2] = INT_TO_FLOAT(param
[2]);
3336 p
[3] = INT_TO_FLOAT(param
[3]);
3339 p
[0] = (GLfloat
) param
[0];
3340 p
[1] = p
[2] = p
[3] = 0.0F
;
3342 save_TexEnvfv(target
, pname
, p
);
3346 static void GLAPIENTRY
3347 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3349 GET_CURRENT_CONTEXT(ctx
);
3351 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3352 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXGEN
, 6);
3361 if (ctx
->ExecuteFlag
) {
3362 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3367 static void GLAPIENTRY
3368 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3371 p
[0] = (GLfloat
) params
[0];
3372 p
[1] = (GLfloat
) params
[1];
3373 p
[2] = (GLfloat
) params
[2];
3374 p
[3] = (GLfloat
) params
[3];
3375 save_TexGenfv(coord
, pname
, p
);
3379 static void GLAPIENTRY
3380 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3382 GLfloat p
= (GLfloat
) param
;
3383 save_TexGenfv(coord
, pname
, &p
);
3387 static void GLAPIENTRY
3388 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3391 p
[0] = (GLfloat
) params
[0];
3392 p
[1] = (GLfloat
) params
[1];
3393 p
[2] = (GLfloat
) params
[2];
3394 p
[3] = (GLfloat
) params
[3];
3395 save_TexGenfv(coord
, pname
, p
);
3399 static void GLAPIENTRY
3400 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3402 save_TexGenfv(coord
, pname
, ¶m
);
3406 static void GLAPIENTRY
3407 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3409 save_TexGeniv(coord
, pname
, ¶m
);
3413 static void GLAPIENTRY
3414 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3416 GET_CURRENT_CONTEXT(ctx
);
3418 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3419 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXPARAMETER
, 6);
3428 if (ctx
->ExecuteFlag
) {
3429 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3434 static void GLAPIENTRY
3435 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3437 save_TexParameterfv(target
, pname
, ¶m
);
3441 static void GLAPIENTRY
3442 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3445 fparam
[0] = (GLfloat
) param
;
3446 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3447 save_TexParameterfv(target
, pname
, fparam
);
3451 static void GLAPIENTRY
3452 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3455 fparam
[0] = (GLfloat
) params
[0];
3456 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3457 save_TexParameterfv(target
, pname
, fparam
);
3461 static void GLAPIENTRY
3462 save_TexImage1D(GLenum target
,
3463 GLint level
, GLint components
,
3464 GLsizei width
, GLint border
,
3465 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3467 GET_CURRENT_CONTEXT(ctx
);
3468 if (target
== GL_PROXY_TEXTURE_1D
) {
3469 /* don't compile, execute immediately */
3470 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3471 border
, format
, type
, pixels
));
3474 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
,
3475 pixels
, &ctx
->Unpack
);
3477 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3478 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE1D
, 8);
3482 n
[3].i
= components
;
3483 n
[4].i
= (GLint
) width
;
3492 if (ctx
->ExecuteFlag
) {
3493 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3494 border
, format
, type
, pixels
));
3500 static void GLAPIENTRY
3501 save_TexImage2D(GLenum target
,
3502 GLint level
, GLint components
,
3503 GLsizei width
, GLsizei height
, GLint border
,
3504 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3506 GET_CURRENT_CONTEXT(ctx
);
3507 if (target
== GL_PROXY_TEXTURE_2D
) {
3508 /* don't compile, execute immediately */
3509 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3510 height
, border
, format
, type
, pixels
));
3513 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
3514 pixels
, &ctx
->Unpack
);
3516 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3517 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE2D
, 9);
3521 n
[3].i
= components
;
3522 n
[4].i
= (GLint
) width
;
3523 n
[5].i
= (GLint
) height
;
3532 if (ctx
->ExecuteFlag
) {
3533 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3534 height
, border
, format
, type
, pixels
));
3540 static void GLAPIENTRY
3541 save_TexImage3D(GLenum target
,
3542 GLint level
, GLint internalFormat
,
3543 GLsizei width
, GLsizei height
, GLsizei depth
,
3545 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3547 GET_CURRENT_CONTEXT(ctx
);
3548 if (target
== GL_PROXY_TEXTURE_3D
) {
3549 /* don't compile, execute immediately */
3550 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3551 height
, depth
, border
, format
, type
,
3556 GLvoid
*image
= unpack_image(3, width
, height
, depth
, format
, type
,
3557 pixels
, &ctx
->Unpack
);
3558 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3559 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE3D
, 10);
3563 n
[3].i
= (GLint
) internalFormat
;
3564 n
[4].i
= (GLint
) width
;
3565 n
[5].i
= (GLint
) height
;
3566 n
[6].i
= (GLint
) depth
;
3575 if (ctx
->ExecuteFlag
) {
3576 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3577 height
, depth
, border
, format
, type
,
3584 static void GLAPIENTRY
3585 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
3586 GLsizei width
, GLenum format
, GLenum type
,
3587 const GLvoid
* pixels
)
3589 GET_CURRENT_CONTEXT(ctx
);
3591 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
,
3592 pixels
, &ctx
->Unpack
);
3593 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3594 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
3599 n
[4].i
= (GLint
) width
;
3607 if (ctx
->ExecuteFlag
) {
3608 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
3609 format
, type
, pixels
));
3614 static void GLAPIENTRY
3615 save_TexSubImage2D(GLenum target
, GLint level
,
3616 GLint xoffset
, GLint yoffset
,
3617 GLsizei width
, GLsizei height
,
3618 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3620 GET_CURRENT_CONTEXT(ctx
);
3622 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
3623 pixels
, &ctx
->Unpack
);
3624 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3625 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
3631 n
[5].i
= (GLint
) width
;
3632 n
[6].i
= (GLint
) height
;
3640 if (ctx
->ExecuteFlag
) {
3641 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
3642 width
, height
, format
, type
, pixels
));
3647 static void GLAPIENTRY
3648 save_TexSubImage3D(GLenum target
, GLint level
,
3649 GLint xoffset
, GLint yoffset
, GLint zoffset
,
3650 GLsizei width
, GLsizei height
, GLsizei depth
,
3651 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3653 GET_CURRENT_CONTEXT(ctx
);
3655 GLvoid
*image
= unpack_image(3, width
, height
, depth
, format
, type
,
3656 pixels
, &ctx
->Unpack
);
3657 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3658 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
3665 n
[6].i
= (GLint
) width
;
3666 n
[7].i
= (GLint
) height
;
3667 n
[8].i
= (GLint
) depth
;
3675 if (ctx
->ExecuteFlag
) {
3676 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
3677 xoffset
, yoffset
, zoffset
,
3678 width
, height
, depth
, format
, type
,
3684 static void GLAPIENTRY
3685 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
3687 GET_CURRENT_CONTEXT(ctx
);
3689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3690 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRANSLATE
, 3);
3696 if (ctx
->ExecuteFlag
) {
3697 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
3702 static void GLAPIENTRY
3703 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
3705 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3710 static void GLAPIENTRY
3711 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3713 GET_CURRENT_CONTEXT(ctx
);
3715 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3716 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_VIEWPORT
, 4);
3720 n
[3].i
= (GLint
) width
;
3721 n
[4].i
= (GLint
) height
;
3723 if (ctx
->ExecuteFlag
) {
3724 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
3729 static void GLAPIENTRY
3730 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3732 GET_CURRENT_CONTEXT(ctx
);
3734 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3735 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_WINDOW_POS
, 4);
3742 if (ctx
->ExecuteFlag
) {
3743 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
3747 static void GLAPIENTRY
3748 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3750 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3753 static void GLAPIENTRY
3754 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3756 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3759 static void GLAPIENTRY
3760 save_WindowPos2iMESA(GLint x
, GLint y
)
3762 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3765 static void GLAPIENTRY
3766 save_WindowPos2sMESA(GLshort x
, GLshort y
)
3768 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3771 static void GLAPIENTRY
3772 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3774 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3777 static void GLAPIENTRY
3778 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3780 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3783 static void GLAPIENTRY
3784 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3786 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3789 static void GLAPIENTRY
3790 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3792 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3795 static void GLAPIENTRY
3796 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3798 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3801 static void GLAPIENTRY
3802 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3804 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3807 static void GLAPIENTRY
3808 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3810 save_WindowPos4fMESA(x
, y
, z
, w
);
3813 static void GLAPIENTRY
3814 save_WindowPos2dvMESA(const GLdouble
* v
)
3816 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3819 static void GLAPIENTRY
3820 save_WindowPos2fvMESA(const GLfloat
* v
)
3822 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3825 static void GLAPIENTRY
3826 save_WindowPos2ivMESA(const GLint
* v
)
3828 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3831 static void GLAPIENTRY
3832 save_WindowPos2svMESA(const GLshort
* v
)
3834 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3837 static void GLAPIENTRY
3838 save_WindowPos3dvMESA(const GLdouble
* v
)
3840 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3843 static void GLAPIENTRY
3844 save_WindowPos3fvMESA(const GLfloat
* v
)
3846 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3849 static void GLAPIENTRY
3850 save_WindowPos3ivMESA(const GLint
* v
)
3852 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3855 static void GLAPIENTRY
3856 save_WindowPos3svMESA(const GLshort
* v
)
3858 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3861 static void GLAPIENTRY
3862 save_WindowPos4dvMESA(const GLdouble
* v
)
3864 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3865 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3868 static void GLAPIENTRY
3869 save_WindowPos4fvMESA(const GLfloat
* v
)
3871 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3874 static void GLAPIENTRY
3875 save_WindowPos4ivMESA(const GLint
* v
)
3877 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3878 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3881 static void GLAPIENTRY
3882 save_WindowPos4svMESA(const GLshort
* v
)
3884 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3889 /* GL_ARB_multitexture */
3890 static void GLAPIENTRY
3891 save_ActiveTextureARB(GLenum target
)
3893 GET_CURRENT_CONTEXT(ctx
);
3895 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3896 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
3900 if (ctx
->ExecuteFlag
) {
3901 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
3906 /* GL_ARB_transpose_matrix */
3908 static void GLAPIENTRY
3909 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
3912 _math_transposefd(tm
, m
);
3913 save_LoadMatrixf(tm
);
3917 static void GLAPIENTRY
3918 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
3921 _math_transposef(tm
, m
);
3922 save_LoadMatrixf(tm
);
3926 static void GLAPIENTRY
3927 save_MultTransposeMatrixdARB(const GLdouble m
[16])
3930 _math_transposefd(tm
, m
);
3931 save_MultMatrixf(tm
);
3935 static void GLAPIENTRY
3936 save_MultTransposeMatrixfARB(const GLfloat m
[16])
3939 _math_transposef(tm
, m
);
3940 save_MultMatrixf(tm
);
3944 /* GL_ARB_texture_compression */
3945 static void GLAPIENTRY
3946 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3947 GLenum internalFormat
, GLsizei width
,
3948 GLint border
, GLsizei imageSize
,
3949 const GLvoid
* data
)
3951 GET_CURRENT_CONTEXT(ctx
);
3952 if (target
== GL_PROXY_TEXTURE_1D
) {
3953 /* don't compile, execute immediately */
3954 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
3955 width
, border
, imageSize
,
3961 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3962 /* make copy of image */
3963 image
= _mesa_malloc(imageSize
);
3965 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
3968 MEMCPY(image
, data
, imageSize
);
3969 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
3973 n
[3].e
= internalFormat
;
3974 n
[4].i
= (GLint
) width
;
3982 if (ctx
->ExecuteFlag
) {
3983 CALL_CompressedTexImage1DARB(ctx
->Exec
,
3984 (target
, level
, internalFormat
, width
,
3985 border
, imageSize
, data
));
3991 static void GLAPIENTRY
3992 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
3993 GLenum internalFormat
, GLsizei width
,
3994 GLsizei height
, GLint border
, GLsizei imageSize
,
3995 const GLvoid
* data
)
3997 GET_CURRENT_CONTEXT(ctx
);
3998 if (target
== GL_PROXY_TEXTURE_2D
) {
3999 /* don't compile, execute immediately */
4000 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4001 width
, height
, border
,
4007 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4008 /* make copy of image */
4009 image
= _mesa_malloc(imageSize
);
4011 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4014 MEMCPY(image
, data
, imageSize
);
4015 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4019 n
[3].e
= internalFormat
;
4020 n
[4].i
= (GLint
) width
;
4021 n
[5].i
= (GLint
) height
;
4029 if (ctx
->ExecuteFlag
) {
4030 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4031 (target
, level
, internalFormat
, width
,
4032 height
, border
, imageSize
, data
));
4038 static void GLAPIENTRY
4039 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4040 GLenum internalFormat
, GLsizei width
,
4041 GLsizei height
, GLsizei depth
, GLint border
,
4042 GLsizei imageSize
, const GLvoid
* data
)
4044 GET_CURRENT_CONTEXT(ctx
);
4045 if (target
== GL_PROXY_TEXTURE_3D
) {
4046 /* don't compile, execute immediately */
4047 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4048 width
, height
, depth
, border
,
4054 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4055 /* make copy of image */
4056 image
= _mesa_malloc(imageSize
);
4058 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4061 MEMCPY(image
, data
, imageSize
);
4062 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4066 n
[3].e
= internalFormat
;
4067 n
[4].i
= (GLint
) width
;
4068 n
[5].i
= (GLint
) height
;
4069 n
[6].i
= (GLint
) depth
;
4077 if (ctx
->ExecuteFlag
) {
4078 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4079 (target
, level
, internalFormat
, width
,
4080 height
, depth
, border
, imageSize
,
4087 static void GLAPIENTRY
4088 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4089 GLsizei width
, GLenum format
,
4090 GLsizei imageSize
, const GLvoid
* data
)
4095 GET_CURRENT_CONTEXT(ctx
);
4096 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4098 /* make copy of image */
4099 image
= _mesa_malloc(imageSize
);
4101 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4104 MEMCPY(image
, data
, imageSize
);
4105 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4110 n
[4].i
= (GLint
) width
;
4118 if (ctx
->ExecuteFlag
) {
4119 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4120 width
, format
, imageSize
,
4126 static void GLAPIENTRY
4127 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4128 GLint yoffset
, GLsizei width
, GLsizei height
,
4129 GLenum format
, GLsizei imageSize
,
4130 const GLvoid
* data
)
4135 GET_CURRENT_CONTEXT(ctx
);
4136 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4138 /* make copy of image */
4139 image
= _mesa_malloc(imageSize
);
4141 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4144 MEMCPY(image
, data
, imageSize
);
4145 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4151 n
[5].i
= (GLint
) width
;
4152 n
[6].i
= (GLint
) height
;
4160 if (ctx
->ExecuteFlag
) {
4161 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4162 (target
, level
, xoffset
, yoffset
, width
,
4163 height
, format
, imageSize
, data
));
4168 static void GLAPIENTRY
4169 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4170 GLint yoffset
, GLint zoffset
, GLsizei width
,
4171 GLsizei height
, GLsizei depth
, GLenum format
,
4172 GLsizei imageSize
, const GLvoid
* data
)
4177 GET_CURRENT_CONTEXT(ctx
);
4178 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4180 /* make copy of image */
4181 image
= _mesa_malloc(imageSize
);
4183 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4186 MEMCPY(image
, data
, imageSize
);
4187 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4194 n
[6].i
= (GLint
) width
;
4195 n
[7].i
= (GLint
) height
;
4196 n
[8].i
= (GLint
) depth
;
4198 n
[10].i
= imageSize
;
4204 if (ctx
->ExecuteFlag
) {
4205 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4206 (target
, level
, xoffset
, yoffset
,
4207 zoffset
, width
, height
, depth
, format
,
4213 /* GL_ARB_multisample */
4214 static void GLAPIENTRY
4215 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4217 GET_CURRENT_CONTEXT(ctx
);
4219 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4220 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4225 if (ctx
->ExecuteFlag
) {
4226 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4232 * GL_NV_vertex_program
4234 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4235 static void GLAPIENTRY
4236 save_BindProgramNV(GLenum target
, GLuint id
)
4238 GET_CURRENT_CONTEXT(ctx
);
4240 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4241 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4246 if (ctx
->ExecuteFlag
) {
4247 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4250 #endif /* FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4252 #if FEATURE_NV_vertex_program
4253 static void GLAPIENTRY
4254 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4256 GET_CURRENT_CONTEXT(ctx
);
4258 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4259 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4268 if (ctx
->ExecuteFlag
) {
4269 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4274 static void GLAPIENTRY
4275 save_ProgramParameter4fNV(GLenum target
, GLuint index
,
4276 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4278 GET_CURRENT_CONTEXT(ctx
);
4280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4281 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_PARAMETER4F_NV
, 6);
4290 if (ctx
->ExecuteFlag
) {
4291 CALL_ProgramParameter4fNV(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4296 static void GLAPIENTRY
4297 save_ProgramParameter4fvNV(GLenum target
, GLuint index
,
4298 const GLfloat
*params
)
4300 save_ProgramParameter4fNV(target
, index
, params
[0], params
[1],
4301 params
[2], params
[3]);
4305 static void GLAPIENTRY
4306 save_ProgramParameter4dNV(GLenum target
, GLuint index
,
4307 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4309 save_ProgramParameter4fNV(target
, index
, (GLfloat
) x
, (GLfloat
) y
,
4310 (GLfloat
) z
, (GLfloat
) w
);
4314 static void GLAPIENTRY
4315 save_ProgramParameter4dvNV(GLenum target
, GLuint index
,
4316 const GLdouble
*params
)
4318 save_ProgramParameter4fNV(target
, index
, (GLfloat
) params
[0],
4319 (GLfloat
) params
[1], (GLfloat
) params
[2],
4320 (GLfloat
) params
[3]);
4324 static void GLAPIENTRY
4325 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4326 GLuint num
, const GLdouble
*params
)
4329 for (i
= 0; i
< num
; i
++) {
4330 save_ProgramParameter4dvNV(target
, index
+ i
, params
+ 4 * i
);
4335 static void GLAPIENTRY
4336 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4337 GLuint num
, const GLfloat
*params
)
4340 for (i
= 0; i
< num
; i
++) {
4341 save_ProgramParameter4fvNV(target
, index
+ i
, params
+ 4 * i
);
4346 static void GLAPIENTRY
4347 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4348 const GLubyte
* program
)
4350 GET_CURRENT_CONTEXT(ctx
);
4352 GLubyte
*programCopy
;
4354 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4356 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4359 _mesa_memcpy(programCopy
, program
, len
);
4361 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4362 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4367 n
[4].data
= programCopy
;
4369 if (ctx
->ExecuteFlag
) {
4370 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4375 static void GLAPIENTRY
4376 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4378 GET_CURRENT_CONTEXT(ctx
);
4380 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4382 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4385 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4386 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4387 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4392 if (ctx
->ExecuteFlag
) {
4393 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4398 static void GLAPIENTRY
4399 save_TrackMatrixNV(GLenum target
, GLuint address
,
4400 GLenum matrix
, GLenum transform
)
4402 GET_CURRENT_CONTEXT(ctx
);
4404 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4405 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4412 if (ctx
->ExecuteFlag
) {
4413 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4416 #endif /* FEATURE_NV_vertex_program */
4420 * GL_NV_fragment_program
4422 #if FEATURE_NV_fragment_program
4423 static void GLAPIENTRY
4424 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4425 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4427 GET_CURRENT_CONTEXT(ctx
);
4429 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4430 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4439 if (ctx
->ExecuteFlag
) {
4440 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4445 static void GLAPIENTRY
4446 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4447 const GLfloat
*params
)
4449 GET_CURRENT_CONTEXT(ctx
);
4451 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4452 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4461 if (ctx
->ExecuteFlag
) {
4462 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4467 static void GLAPIENTRY
4468 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4469 const GLfloat
*params
)
4471 GET_CURRENT_CONTEXT(ctx
);
4473 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4477 const GLfloat
* p
= params
;
4479 for (i
= 0 ; i
< count
; i
++) {
4480 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4493 if (ctx
->ExecuteFlag
) {
4494 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4499 static void GLAPIENTRY
4500 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4501 GLdouble x
, GLdouble y
,
4502 GLdouble z
, GLdouble w
)
4504 GET_CURRENT_CONTEXT(ctx
);
4506 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4507 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4511 n
[3].f
= (GLfloat
) x
;
4512 n
[4].f
= (GLfloat
) y
;
4513 n
[5].f
= (GLfloat
) z
;
4514 n
[6].f
= (GLfloat
) w
;
4516 if (ctx
->ExecuteFlag
) {
4517 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4522 static void GLAPIENTRY
4523 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4524 const GLdouble
*params
)
4526 GET_CURRENT_CONTEXT(ctx
);
4528 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4529 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4533 n
[3].f
= (GLfloat
) params
[0];
4534 n
[4].f
= (GLfloat
) params
[1];
4535 n
[5].f
= (GLfloat
) params
[2];
4536 n
[6].f
= (GLfloat
) params
[3];
4538 if (ctx
->ExecuteFlag
) {
4539 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4543 static void GLAPIENTRY
4544 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4545 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4547 GET_CURRENT_CONTEXT(ctx
);
4549 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4551 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4554 _mesa_memcpy(nameCopy
, name
, len
);
4556 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4557 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
4561 n
[3].data
= nameCopy
;
4567 if (ctx
->ExecuteFlag
) {
4568 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
4573 static void GLAPIENTRY
4574 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4577 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4581 static void GLAPIENTRY
4582 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4583 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4585 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4586 (GLfloat
) z
, (GLfloat
) w
);
4590 static void GLAPIENTRY
4591 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4594 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4595 (GLfloat
) v
[1], (GLfloat
) v
[2],
4599 #endif /* FEATURE_NV_fragment_program */
4603 /* GL_EXT_stencil_two_side */
4604 static void GLAPIENTRY
4605 save_ActiveStencilFaceEXT(GLenum face
)
4607 GET_CURRENT_CONTEXT(ctx
);
4609 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4610 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
4614 if (ctx
->ExecuteFlag
) {
4615 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
4620 /* GL_EXT_depth_bounds_test */
4621 static void GLAPIENTRY
4622 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
4624 GET_CURRENT_CONTEXT(ctx
);
4626 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4627 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
4629 n
[1].f
= (GLfloat
) zmin
;
4630 n
[2].f
= (GLfloat
) zmax
;
4632 if (ctx
->ExecuteFlag
) {
4633 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
4639 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4641 static void GLAPIENTRY
4642 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4643 const GLvoid
* string
)
4645 GET_CURRENT_CONTEXT(ctx
);
4647 GLubyte
*programCopy
;
4649 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4651 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4654 _mesa_memcpy(programCopy
, string
, len
);
4656 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4657 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
4662 n
[4].data
= programCopy
;
4664 if (ctx
->ExecuteFlag
) {
4665 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
4670 static void GLAPIENTRY
4671 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4672 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4674 GET_CURRENT_CONTEXT(ctx
);
4676 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4677 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4686 if (ctx
->ExecuteFlag
) {
4687 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4692 static void GLAPIENTRY
4693 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4694 const GLfloat
*params
)
4696 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4697 params
[2], params
[3]);
4701 static void GLAPIENTRY
4702 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4703 const GLfloat
* params
)
4705 GET_CURRENT_CONTEXT(ctx
);
4707 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4711 const GLfloat
* p
= params
;
4713 for (i
= 0 ; i
< count
; i
++) {
4714 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4727 if (ctx
->ExecuteFlag
) {
4728 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4733 static void GLAPIENTRY
4734 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4735 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4737 save_ProgramEnvParameter4fARB(target
, index
,
4739 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4743 static void GLAPIENTRY
4744 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4745 const GLdouble
*params
)
4747 save_ProgramEnvParameter4fARB(target
, index
,
4748 (GLfloat
) params
[0],
4749 (GLfloat
) params
[1],
4750 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4753 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4756 #if FEATURE_ARB_occlusion_query
4758 static void GLAPIENTRY
4759 save_BeginQueryARB(GLenum target
, GLuint id
)
4761 GET_CURRENT_CONTEXT(ctx
);
4763 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4764 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
4769 if (ctx
->ExecuteFlag
) {
4770 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
4775 static void GLAPIENTRY
4776 save_EndQueryARB(GLenum target
)
4778 GET_CURRENT_CONTEXT(ctx
);
4780 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4781 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_END_QUERY_ARB
, 1);
4785 if (ctx
->ExecuteFlag
) {
4786 CALL_EndQueryARB(ctx
->Exec
, (target
));
4790 #endif /* FEATURE_ARB_occlusion_query */
4793 static void GLAPIENTRY
4794 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
4796 GET_CURRENT_CONTEXT(ctx
);
4798 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4799 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
4803 if (count
> MAX_DRAW_BUFFERS
)
4804 count
= MAX_DRAW_BUFFERS
;
4805 for (i
= 0; i
< count
; i
++) {
4806 n
[2 + i
].e
= buffers
[i
];
4809 if (ctx
->ExecuteFlag
) {
4810 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
4814 #if FEATURE_ATI_fragment_shader
4815 static void GLAPIENTRY
4816 save_BindFragmentShaderATI(GLuint id
)
4818 GET_CURRENT_CONTEXT(ctx
);
4821 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
4825 if (ctx
->ExecuteFlag
) {
4826 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
4830 static void GLAPIENTRY
4831 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
4833 GET_CURRENT_CONTEXT(ctx
);
4836 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
4844 if (ctx
->ExecuteFlag
) {
4845 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
4851 save_Attr1fNV(GLenum attr
, GLfloat x
)
4853 GET_CURRENT_CONTEXT(ctx
);
4855 SAVE_FLUSH_VERTICES(ctx
);
4856 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_NV
, 2);
4862 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4863 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4864 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4866 if (ctx
->ExecuteFlag
) {
4867 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
4872 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
4874 GET_CURRENT_CONTEXT(ctx
);
4876 SAVE_FLUSH_VERTICES(ctx
);
4877 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_NV
, 3);
4884 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4885 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4886 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4888 if (ctx
->ExecuteFlag
) {
4889 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
4894 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4896 GET_CURRENT_CONTEXT(ctx
);
4898 SAVE_FLUSH_VERTICES(ctx
);
4899 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_NV
, 4);
4907 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4908 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4909 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4911 if (ctx
->ExecuteFlag
) {
4912 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
4917 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4919 GET_CURRENT_CONTEXT(ctx
);
4921 SAVE_FLUSH_VERTICES(ctx
);
4922 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_NV
, 5);
4931 ASSERT(attr
< MAX_VERTEX_PROGRAM_ATTRIBS
);
4932 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4933 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4935 if (ctx
->ExecuteFlag
) {
4936 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
4942 save_Attr1fARB(GLenum attr
, GLfloat x
)
4944 GET_CURRENT_CONTEXT(ctx
);
4946 SAVE_FLUSH_VERTICES(ctx
);
4947 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_ARB
, 2);
4953 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
4954 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4955 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4957 if (ctx
->ExecuteFlag
) {
4958 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
4963 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
4965 GET_CURRENT_CONTEXT(ctx
);
4967 SAVE_FLUSH_VERTICES(ctx
);
4968 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_ARB
, 3);
4975 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
4976 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4977 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4979 if (ctx
->ExecuteFlag
) {
4980 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
4985 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4987 GET_CURRENT_CONTEXT(ctx
);
4989 SAVE_FLUSH_VERTICES(ctx
);
4990 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_ARB
, 4);
4998 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
4999 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5000 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5002 if (ctx
->ExecuteFlag
) {
5003 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5008 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5010 GET_CURRENT_CONTEXT(ctx
);
5012 SAVE_FLUSH_VERTICES(ctx
);
5013 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5022 ASSERT(attr
< MAX_VERTEX_ATTRIBS
);
5023 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5024 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5026 if (ctx
->ExecuteFlag
) {
5027 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5032 static void GLAPIENTRY
5033 save_EvalCoord1f(GLfloat x
)
5035 GET_CURRENT_CONTEXT(ctx
);
5037 SAVE_FLUSH_VERTICES(ctx
);
5038 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C1
, 1);
5042 if (ctx
->ExecuteFlag
) {
5043 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5047 static void GLAPIENTRY
5048 save_EvalCoord1fv(const GLfloat
* v
)
5050 save_EvalCoord1f(v
[0]);
5053 static void GLAPIENTRY
5054 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5056 GET_CURRENT_CONTEXT(ctx
);
5058 SAVE_FLUSH_VERTICES(ctx
);
5059 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C2
, 2);
5064 if (ctx
->ExecuteFlag
) {
5065 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5069 static void GLAPIENTRY
5070 save_EvalCoord2fv(const GLfloat
* v
)
5072 save_EvalCoord2f(v
[0], v
[1]);
5076 static void GLAPIENTRY
5077 save_EvalPoint1(GLint x
)
5079 GET_CURRENT_CONTEXT(ctx
);
5081 SAVE_FLUSH_VERTICES(ctx
);
5082 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P1
, 1);
5086 if (ctx
->ExecuteFlag
) {
5087 CALL_EvalPoint1(ctx
->Exec
, (x
));
5091 static void GLAPIENTRY
5092 save_EvalPoint2(GLint x
, GLint y
)
5094 GET_CURRENT_CONTEXT(ctx
);
5096 SAVE_FLUSH_VERTICES(ctx
);
5097 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P2
, 2);
5102 if (ctx
->ExecuteFlag
) {
5103 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5107 static void GLAPIENTRY
5108 save_Indexf(GLfloat x
)
5110 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5113 static void GLAPIENTRY
5114 save_Indexfv(const GLfloat
* v
)
5116 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5119 static void GLAPIENTRY
5120 save_EdgeFlag(GLboolean x
)
5122 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? 1.0 : 0.0);
5125 static void GLAPIENTRY
5126 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5128 GET_CURRENT_CONTEXT(ctx
);
5132 SAVE_FLUSH_VERTICES(ctx
);
5137 case GL_FRONT_AND_BACK
:
5140 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5149 case GL_AMBIENT_AND_DIFFUSE
:
5155 case GL_COLOR_INDEXES
:
5159 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5163 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATERIAL
, 6);
5167 for (i
= 0; i
< args
; i
++)
5168 n
[3 + i
].f
= param
[i
];
5172 GLuint bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5173 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
5174 if (bitmask
& (1 << i
)) {
5175 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5176 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5180 if (ctx
->ExecuteFlag
) {
5181 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5185 static void GLAPIENTRY
5186 save_Begin(GLenum mode
)
5188 GET_CURRENT_CONTEXT(ctx
);
5190 GLboolean error
= GL_FALSE
;
5192 if ( /*mode < GL_POINTS || */ mode
> GL_POLYGON
) {
5193 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5196 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5197 /* Typically the first begin. This may raise an error on
5198 * playback, depending on whether CallList is issued from inside
5199 * a begin/end or not.
5201 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5203 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5204 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5207 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5212 /* Give the driver an opportunity to hook in an optimized
5213 * display list compiler.
5215 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5218 SAVE_FLUSH_VERTICES(ctx
);
5219 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN
, 1);
5225 if (ctx
->ExecuteFlag
) {
5226 CALL_Begin(ctx
->Exec
, (mode
));
5230 static void GLAPIENTRY
5233 GET_CURRENT_CONTEXT(ctx
);
5234 SAVE_FLUSH_VERTICES(ctx
);
5235 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END
, 0);
5236 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5237 if (ctx
->ExecuteFlag
) {
5238 CALL_End(ctx
->Exec
, ());
5242 static void GLAPIENTRY
5243 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5245 GET_CURRENT_CONTEXT(ctx
);
5247 SAVE_FLUSH_VERTICES(ctx
);
5248 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RECTF
, 4);
5255 if (ctx
->ExecuteFlag
) {
5256 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5261 static void GLAPIENTRY
5262 save_Vertex2f(GLfloat x
, GLfloat y
)
5264 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5267 static void GLAPIENTRY
5268 save_Vertex2fv(const GLfloat
* v
)
5270 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5273 static void GLAPIENTRY
5274 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5276 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5279 static void GLAPIENTRY
5280 save_Vertex3fv(const GLfloat
* v
)
5282 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5285 static void GLAPIENTRY
5286 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5288 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5291 static void GLAPIENTRY
5292 save_Vertex4fv(const GLfloat
* v
)
5294 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5297 static void GLAPIENTRY
5298 save_TexCoord1f(GLfloat x
)
5300 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5303 static void GLAPIENTRY
5304 save_TexCoord1fv(const GLfloat
* v
)
5306 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5309 static void GLAPIENTRY
5310 save_TexCoord2f(GLfloat x
, GLfloat y
)
5312 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5315 static void GLAPIENTRY
5316 save_TexCoord2fv(const GLfloat
* v
)
5318 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5321 static void GLAPIENTRY
5322 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5324 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5327 static void GLAPIENTRY
5328 save_TexCoord3fv(const GLfloat
* v
)
5330 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5333 static void GLAPIENTRY
5334 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5336 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5339 static void GLAPIENTRY
5340 save_TexCoord4fv(const GLfloat
* v
)
5342 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5345 static void GLAPIENTRY
5346 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5348 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5351 static void GLAPIENTRY
5352 save_Normal3fv(const GLfloat
* v
)
5354 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5357 static void GLAPIENTRY
5358 save_FogCoordfEXT(GLfloat x
)
5360 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5363 static void GLAPIENTRY
5364 save_FogCoordfvEXT(const GLfloat
* v
)
5366 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5369 static void GLAPIENTRY
5370 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5372 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5375 static void GLAPIENTRY
5376 save_Color3fv(const GLfloat
* v
)
5378 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5381 static void GLAPIENTRY
5382 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5384 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5387 static void GLAPIENTRY
5388 save_Color4fv(const GLfloat
* v
)
5390 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5393 static void GLAPIENTRY
5394 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5396 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5399 static void GLAPIENTRY
5400 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5402 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5406 /* Just call the respective ATTR for texcoord
5408 static void GLAPIENTRY
5409 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5411 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5412 save_Attr1fNV(attr
, x
);
5415 static void GLAPIENTRY
5416 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5418 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5419 save_Attr1fNV(attr
, v
[0]);
5422 static void GLAPIENTRY
5423 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5425 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5426 save_Attr2fNV(attr
, x
, y
);
5429 static void GLAPIENTRY
5430 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5432 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5433 save_Attr2fNV(attr
, v
[0], v
[1]);
5436 static void GLAPIENTRY
5437 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5439 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5440 save_Attr3fNV(attr
, x
, y
, z
);
5443 static void GLAPIENTRY
5444 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5446 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5447 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5450 static void GLAPIENTRY
5451 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5452 GLfloat z
, GLfloat w
)
5454 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5455 save_Attr4fNV(attr
, x
, y
, z
, w
);
5458 static void GLAPIENTRY
5459 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5461 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5462 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5467 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5473 GET_CURRENT_CONTEXT(ctx
);
5474 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5478 /* First level for NV_vertex_program:
5480 * Check for errors at compile time?.
5482 static void GLAPIENTRY
5483 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
5485 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5486 save_Attr1fNV(index
, x
);
5491 static void GLAPIENTRY
5492 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
5494 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5495 save_Attr1fNV(index
, v
[0]);
5500 static void GLAPIENTRY
5501 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
5503 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5504 save_Attr2fNV(index
, x
, y
);
5509 static void GLAPIENTRY
5510 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
5512 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5513 save_Attr2fNV(index
, v
[0], v
[1]);
5518 static void GLAPIENTRY
5519 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5521 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5522 save_Attr3fNV(index
, x
, y
, z
);
5527 static void GLAPIENTRY
5528 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
5530 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5531 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
5536 static void GLAPIENTRY
5537 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
5538 GLfloat z
, GLfloat w
)
5540 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5541 save_Attr4fNV(index
, x
, y
, z
, w
);
5546 static void GLAPIENTRY
5547 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
5549 if (index
< MAX_VERTEX_PROGRAM_ATTRIBS
)
5550 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
5558 static void GLAPIENTRY
5559 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5561 if (index
< MAX_VERTEX_ATTRIBS
)
5562 save_Attr1fARB(index
, x
);
5567 static void GLAPIENTRY
5568 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5570 if (index
< MAX_VERTEX_ATTRIBS
)
5571 save_Attr1fARB(index
, v
[0]);
5576 static void GLAPIENTRY
5577 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5579 if (index
< MAX_VERTEX_ATTRIBS
)
5580 save_Attr2fARB(index
, x
, y
);
5585 static void GLAPIENTRY
5586 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5588 if (index
< MAX_VERTEX_ATTRIBS
)
5589 save_Attr2fARB(index
, v
[0], v
[1]);
5594 static void GLAPIENTRY
5595 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5597 if (index
< MAX_VERTEX_ATTRIBS
)
5598 save_Attr3fARB(index
, x
, y
, z
);
5603 static void GLAPIENTRY
5604 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
5606 if (index
< MAX_VERTEX_ATTRIBS
)
5607 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
5612 static void GLAPIENTRY
5613 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
5616 if (index
< MAX_VERTEX_ATTRIBS
)
5617 save_Attr4fARB(index
, x
, y
, z
, w
);
5622 static void GLAPIENTRY
5623 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
5625 if (index
< MAX_VERTEX_ATTRIBS
)
5626 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
5632 #if FEATURE_EXT_framebuffer_blit
5633 static void GLAPIENTRY
5634 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
5635 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
5636 GLbitfield mask
, GLenum filter
)
5638 GET_CURRENT_CONTEXT(ctx
);
5640 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5641 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
5654 if (ctx
->ExecuteFlag
) {
5655 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
5656 dstX0
, dstY0
, dstX1
, dstY1
,
5664 * Save an error-generating command into display list.
5666 * KW: Will appear in the list before the vertex buffer containing the
5667 * command that provoked the error. I don't see this as a problem.
5670 save_error(GLcontext
*ctx
, GLenum error
, const char *s
)
5673 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ERROR
, 2);
5676 n
[2].data
= (void *) s
;
5682 * Compile an error into current display list.
5685 _mesa_compile_error(GLcontext
*ctx
, GLenum error
, const char *s
)
5687 if (ctx
->CompileFlag
)
5688 save_error(ctx
, error
, s
);
5689 if (ctx
->ExecuteFlag
)
5690 _mesa_error(ctx
, error
, s
);
5695 * Test if ID names a display list.
5698 islist(GLcontext
*ctx
, GLuint list
)
5700 if (list
> 0 && lookup_list(ctx
, list
)) {
5710 /**********************************************************************/
5711 /* Display list execution */
5712 /**********************************************************************/
5716 * Execute a display list. Note that the ListBase offset must have already
5717 * been added before calling this function. I.e. the list argument is
5718 * the absolute list number, not relative to ListBase.
5719 * \param list - display list number
5722 execute_list(GLcontext
*ctx
, GLuint list
)
5724 struct mesa_display_list
*dlist
;
5728 if (list
== 0 || !islist(ctx
, list
))
5731 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
5732 /* raise an error? */
5736 dlist
= lookup_list(ctx
, list
);
5740 ctx
->ListState
.CallDepth
++;
5742 if (ctx
->Driver
.BeginCallList
)
5743 ctx
->Driver
.BeginCallList(ctx
, dlist
);
5749 OpCode opcode
= n
[0].opcode
;
5750 int i
= (int) n
[0].opcode
- (int) OPCODE_EXT_0
;
5752 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
5753 /* this is a driver-extended opcode */
5754 ctx
->ListExt
.Opcode
[i
].Execute(ctx
, &n
[1]);
5755 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
5760 _mesa_error(ctx
, n
[1].e
, (const char *) n
[2].data
);
5763 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
5765 case OPCODE_ALPHA_FUNC
:
5766 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
5768 case OPCODE_BIND_TEXTURE
:
5769 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
5773 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5774 ctx
->Unpack
= ctx
->DefaultPacking
;
5775 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5776 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
5777 (const GLubyte
*) n
[7].data
));
5778 ctx
->Unpack
= save
; /* restore */
5781 case OPCODE_BLEND_COLOR
:
5782 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5784 case OPCODE_BLEND_EQUATION
:
5785 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
5787 case OPCODE_BLEND_EQUATION_SEPARATE
:
5788 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5790 case OPCODE_BLEND_FUNC_SEPARATE
:
5791 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
5792 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
5794 case OPCODE_CALL_LIST
:
5795 /* Generated by glCallList(), don't add ListBase */
5796 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5797 execute_list(ctx
, n
[1].ui
);
5800 case OPCODE_CALL_LIST_OFFSET
:
5801 /* Generated by glCallLists() so we must add ListBase */
5803 /* user specified a bad data type at compile time */
5804 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5806 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5807 execute_list(ctx
, ctx
->List
.ListBase
+ n
[1].ui
);
5811 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
5813 case OPCODE_CLEAR_COLOR
:
5814 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5816 case OPCODE_CLEAR_ACCUM
:
5817 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5819 case OPCODE_CLEAR_DEPTH
:
5820 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
5822 case OPCODE_CLEAR_INDEX
:
5823 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
5825 case OPCODE_CLEAR_STENCIL
:
5826 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
5828 case OPCODE_CLIP_PLANE
:
5835 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
5838 case OPCODE_COLOR_MASK
:
5839 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
5841 case OPCODE_COLOR_MATERIAL
:
5842 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5844 case OPCODE_COLOR_TABLE
:
5846 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5847 ctx
->Unpack
= ctx
->DefaultPacking
;
5848 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5849 n
[5].e
, n
[6].data
));
5850 ctx
->Unpack
= save
; /* restore */
5853 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
5860 CALL_ColorTableParameterfv(ctx
->Exec
,
5861 (n
[1].e
, n
[2].e
, params
));
5864 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
5871 CALL_ColorTableParameteriv(ctx
->Exec
,
5872 (n
[1].e
, n
[2].e
, params
));
5875 case OPCODE_COLOR_SUB_TABLE
:
5877 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5878 ctx
->Unpack
= ctx
->DefaultPacking
;
5879 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5880 n
[4].e
, n
[5].e
, n
[6].data
));
5881 ctx
->Unpack
= save
; /* restore */
5884 case OPCODE_CONVOLUTION_FILTER_1D
:
5886 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5887 ctx
->Unpack
= ctx
->DefaultPacking
;
5888 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5891 ctx
->Unpack
= save
; /* restore */
5894 case OPCODE_CONVOLUTION_FILTER_2D
:
5896 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5897 ctx
->Unpack
= ctx
->DefaultPacking
;
5898 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5899 n
[4].i
, n
[5].e
, n
[6].e
,
5901 ctx
->Unpack
= save
; /* restore */
5904 case OPCODE_CONVOLUTION_PARAMETER_I
:
5905 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
5907 case OPCODE_CONVOLUTION_PARAMETER_IV
:
5914 CALL_ConvolutionParameteriv(ctx
->Exec
,
5915 (n
[1].e
, n
[2].e
, params
));
5918 case OPCODE_CONVOLUTION_PARAMETER_F
:
5919 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
5921 case OPCODE_CONVOLUTION_PARAMETER_FV
:
5928 CALL_ConvolutionParameterfv(ctx
->Exec
,
5929 (n
[1].e
, n
[2].e
, params
));
5932 case OPCODE_COPY_COLOR_SUB_TABLE
:
5933 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
5934 n
[3].i
, n
[4].i
, n
[5].i
));
5936 case OPCODE_COPY_COLOR_TABLE
:
5937 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
5938 n
[3].i
, n
[4].i
, n
[5].i
));
5940 case OPCODE_COPY_PIXELS
:
5941 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
5942 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
5945 case OPCODE_COPY_TEX_IMAGE1D
:
5946 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5947 n
[5].i
, n
[6].i
, n
[7].i
));
5949 case OPCODE_COPY_TEX_IMAGE2D
:
5950 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5951 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
5953 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
5954 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5955 n
[4].i
, n
[5].i
, n
[6].i
));
5957 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
5958 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5959 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5962 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
5963 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5964 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5967 case OPCODE_CULL_FACE
:
5968 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
5970 case OPCODE_DEPTH_FUNC
:
5971 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
5973 case OPCODE_DEPTH_MASK
:
5974 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
5976 case OPCODE_DEPTH_RANGE
:
5977 CALL_DepthRange(ctx
->Exec
,
5978 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
5980 case OPCODE_DISABLE
:
5981 CALL_Disable(ctx
->Exec
, (n
[1].e
));
5983 case OPCODE_DRAW_BUFFER
:
5984 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
5986 case OPCODE_DRAW_PIXELS
:
5988 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5989 ctx
->Unpack
= ctx
->DefaultPacking
;
5990 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
5992 ctx
->Unpack
= save
; /* restore */
5996 CALL_Enable(ctx
->Exec
, (n
[1].e
));
5998 case OPCODE_EVALMESH1
:
5999 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
6001 case OPCODE_EVALMESH2
:
6002 CALL_EvalMesh2(ctx
->Exec
,
6003 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
6012 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
6015 case OPCODE_FRONT_FACE
:
6016 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
6018 case OPCODE_FRUSTUM
:
6019 CALL_Frustum(ctx
->Exec
,
6020 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6023 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6025 case OPCODE_HISTOGRAM
:
6026 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
6028 case OPCODE_INDEX_MASK
:
6029 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
6031 case OPCODE_INIT_NAMES
:
6032 CALL_InitNames(ctx
->Exec
, ());
6041 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
6044 case OPCODE_LIGHT_MODEL
:
6051 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
6054 case OPCODE_LINE_STIPPLE
:
6055 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
6057 case OPCODE_LINE_WIDTH
:
6058 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
6060 case OPCODE_LIST_BASE
:
6061 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
6063 case OPCODE_LOAD_IDENTITY
:
6064 CALL_LoadIdentity(ctx
->Exec
, ());
6066 case OPCODE_LOAD_MATRIX
:
6067 if (sizeof(Node
) == sizeof(GLfloat
)) {
6068 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
6073 for (i
= 0; i
< 16; i
++) {
6076 CALL_LoadMatrixf(ctx
->Exec
, (m
));
6079 case OPCODE_LOAD_NAME
:
6080 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
6082 case OPCODE_LOGIC_OP
:
6083 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
6087 GLenum target
= n
[1].e
;
6088 GLint ustride
= _mesa_evaluator_components(target
);
6089 GLint uorder
= n
[5].i
;
6090 GLfloat u1
= n
[2].f
;
6091 GLfloat u2
= n
[3].f
;
6092 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6093 (GLfloat
*) n
[6].data
));
6098 GLenum target
= n
[1].e
;
6099 GLfloat u1
= n
[2].f
;
6100 GLfloat u2
= n
[3].f
;
6101 GLfloat v1
= n
[4].f
;
6102 GLfloat v2
= n
[5].f
;
6103 GLint ustride
= n
[6].i
;
6104 GLint vstride
= n
[7].i
;
6105 GLint uorder
= n
[8].i
;
6106 GLint vorder
= n
[9].i
;
6107 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6108 v1
, v2
, vstride
, vorder
,
6109 (GLfloat
*) n
[10].data
));
6112 case OPCODE_MAPGRID1
:
6113 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
6115 case OPCODE_MAPGRID2
:
6116 CALL_MapGrid2f(ctx
->Exec
,
6117 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
6119 case OPCODE_MATRIX_MODE
:
6120 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
6122 case OPCODE_MIN_MAX
:
6123 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
6125 case OPCODE_MULT_MATRIX
:
6126 if (sizeof(Node
) == sizeof(GLfloat
)) {
6127 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
6132 for (i
= 0; i
< 16; i
++) {
6135 CALL_MultMatrixf(ctx
->Exec
, (m
));
6139 CALL_Ortho(ctx
->Exec
,
6140 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6142 case OPCODE_PASSTHROUGH
:
6143 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
6145 case OPCODE_PIXEL_MAP
:
6146 CALL_PixelMapfv(ctx
->Exec
,
6147 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
6149 case OPCODE_PIXEL_TRANSFER
:
6150 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6152 case OPCODE_PIXEL_ZOOM
:
6153 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6155 case OPCODE_POINT_SIZE
:
6156 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
6158 case OPCODE_POINT_PARAMETERS
:
6164 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
6167 case OPCODE_POLYGON_MODE
:
6168 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6170 case OPCODE_POLYGON_STIPPLE
:
6172 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6173 ctx
->Unpack
= ctx
->DefaultPacking
;
6174 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
6175 ctx
->Unpack
= save
; /* restore */
6178 case OPCODE_POLYGON_OFFSET
:
6179 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6181 case OPCODE_POP_ATTRIB
:
6182 CALL_PopAttrib(ctx
->Exec
, ());
6184 case OPCODE_POP_MATRIX
:
6185 CALL_PopMatrix(ctx
->Exec
, ());
6187 case OPCODE_POP_NAME
:
6188 CALL_PopName(ctx
->Exec
, ());
6190 case OPCODE_PRIORITIZE_TEXTURE
:
6191 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
6193 case OPCODE_PUSH_ATTRIB
:
6194 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
6196 case OPCODE_PUSH_MATRIX
:
6197 CALL_PushMatrix(ctx
->Exec
, ());
6199 case OPCODE_PUSH_NAME
:
6200 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
6202 case OPCODE_RASTER_POS
:
6203 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6205 case OPCODE_READ_BUFFER
:
6206 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
6208 case OPCODE_RESET_HISTOGRAM
:
6209 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
6211 case OPCODE_RESET_MIN_MAX
:
6212 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
6215 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6218 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6220 case OPCODE_SCISSOR
:
6221 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
6223 case OPCODE_SHADE_MODEL
:
6224 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
6226 case OPCODE_STENCIL_FUNC
:
6227 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
6229 case OPCODE_STENCIL_MASK
:
6230 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
6232 case OPCODE_STENCIL_OP
:
6233 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
6235 case OPCODE_STENCIL_FUNC_SEPARATE
:
6236 CALL_StencilFuncSeparate(ctx
->Exec
,
6237 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
6239 case OPCODE_STENCIL_MASK_SEPARATE
:
6240 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6242 case OPCODE_STENCIL_OP_SEPARATE
:
6243 CALL_StencilOpSeparate(ctx
->Exec
,
6244 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6253 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6263 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6266 case OPCODE_TEXPARAMETER
:
6273 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6276 case OPCODE_TEX_IMAGE1D
:
6278 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6279 ctx
->Unpack
= ctx
->DefaultPacking
;
6280 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
6282 n
[3].i
, /* components */
6284 n
[5].e
, /* border */
6285 n
[6].e
, /* format */
6288 ctx
->Unpack
= save
; /* restore */
6291 case OPCODE_TEX_IMAGE2D
:
6293 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6294 ctx
->Unpack
= ctx
->DefaultPacking
;
6295 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
6297 n
[3].i
, /* components */
6299 n
[5].i
, /* height */
6300 n
[6].e
, /* border */
6301 n
[7].e
, /* format */
6304 ctx
->Unpack
= save
; /* restore */
6307 case OPCODE_TEX_IMAGE3D
:
6309 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6310 ctx
->Unpack
= ctx
->DefaultPacking
;
6311 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
6313 n
[3].i
, /* components */
6315 n
[5].i
, /* height */
6317 n
[7].e
, /* border */
6318 n
[8].e
, /* format */
6321 ctx
->Unpack
= save
; /* restore */
6324 case OPCODE_TEX_SUB_IMAGE1D
:
6326 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6327 ctx
->Unpack
= ctx
->DefaultPacking
;
6328 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6330 n
[6].e
, n
[7].data
));
6331 ctx
->Unpack
= save
; /* restore */
6334 case OPCODE_TEX_SUB_IMAGE2D
:
6336 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6337 ctx
->Unpack
= ctx
->DefaultPacking
;
6338 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6340 n
[6].i
, n
[7].e
, n
[8].e
,
6342 ctx
->Unpack
= save
; /* restore */
6345 case OPCODE_TEX_SUB_IMAGE3D
:
6347 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6348 ctx
->Unpack
= ctx
->DefaultPacking
;
6349 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6350 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6351 n
[8].i
, n
[9].e
, n
[10].e
,
6353 ctx
->Unpack
= save
; /* restore */
6356 case OPCODE_TRANSLATE
:
6357 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6359 case OPCODE_VIEWPORT
:
6360 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6361 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
6363 case OPCODE_WINDOW_POS
:
6364 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6366 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
6367 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
6369 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
6370 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6371 n
[4].i
, n
[5].i
, n
[6].i
,
6374 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
6375 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6376 n
[4].i
, n
[5].i
, n
[6].i
,
6377 n
[7].i
, n
[8].data
));
6379 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
6380 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6381 n
[4].i
, n
[5].i
, n
[6].i
,
6385 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
6386 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
6387 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6388 n
[5].e
, n
[6].i
, n
[7].data
));
6390 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
6391 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
6392 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6393 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
6396 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
6397 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
6398 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6399 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6400 n
[9].e
, n
[10].i
, n
[11].data
));
6402 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
6403 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
6405 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
6406 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6408 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6409 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
6410 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6413 #if FEATURE_NV_vertex_program
6414 case OPCODE_EXECUTE_PROGRAM_NV
:
6421 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
6424 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
6425 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
6426 (GLuint
*) n
[2].data
));
6428 case OPCODE_LOAD_PROGRAM_NV
:
6429 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
6430 (const GLubyte
*) n
[4].data
));
6432 case OPCODE_PROGRAM_PARAMETER4F_NV
:
6433 CALL_ProgramParameter4fNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6434 n
[4].f
, n
[5].f
, n
[6].f
));
6436 case OPCODE_TRACK_MATRIX_NV
:
6437 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
6441 #if FEATURE_NV_fragment_program
6442 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
6443 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
6444 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
6447 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
6448 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
6449 (const GLubyte
*) n
[3].
6450 data
, n
[4].f
, n
[5].f
,
6455 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
6456 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
6458 case OPCODE_DEPTH_BOUNDS_EXT
:
6459 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6461 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6462 case OPCODE_PROGRAM_STRING_ARB
:
6463 CALL_ProgramStringARB(ctx
->Exec
,
6464 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
6466 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
6467 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6472 #if FEATURE_ARB_occlusion_query
6473 case OPCODE_BEGIN_QUERY_ARB
:
6474 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6476 case OPCODE_END_QUERY_ARB
:
6477 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
6480 case OPCODE_DRAW_BUFFERS_ARB
:
6482 GLenum buffers
[MAX_DRAW_BUFFERS
];
6483 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
6484 for (i
= 0; i
< count
; i
++)
6485 buffers
[i
] = n
[2 + i
].e
;
6486 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
6489 #if FEATURE_EXT_framebuffer_blit
6490 case OPCODE_BLIT_FRAMEBUFFER
:
6491 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
6492 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6496 #if FEATURE_ATI_fragment_shader
6497 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
6498 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
6500 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
6503 GLuint i
, dst
= n
[1].ui
;
6505 for (i
= 0; i
< 4; i
++)
6506 values
[i
] = n
[1 + i
].f
;
6507 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
6511 case OPCODE_ATTR_1F_NV
:
6512 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6514 case OPCODE_ATTR_2F_NV
:
6515 /* Really shouldn't have to do this - the Node structure
6516 * is convenient, but it would be better to store the data
6517 * packed appropriately so that it can be sent directly
6518 * on. With x86_64 becoming common, this will start to
6521 if (sizeof(Node
) == sizeof(GLfloat
))
6522 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6524 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6526 case OPCODE_ATTR_3F_NV
:
6527 if (sizeof(Node
) == sizeof(GLfloat
))
6528 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6530 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6533 case OPCODE_ATTR_4F_NV
:
6534 if (sizeof(Node
) == sizeof(GLfloat
))
6535 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6537 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6540 case OPCODE_ATTR_1F_ARB
:
6541 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6543 case OPCODE_ATTR_2F_ARB
:
6544 /* Really shouldn't have to do this - the Node structure
6545 * is convenient, but it would be better to store the data
6546 * packed appropriately so that it can be sent directly
6547 * on. With x86_64 becoming common, this will start to
6550 if (sizeof(Node
) == sizeof(GLfloat
))
6551 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6553 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6555 case OPCODE_ATTR_3F_ARB
:
6556 if (sizeof(Node
) == sizeof(GLfloat
))
6557 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6559 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6562 case OPCODE_ATTR_4F_ARB
:
6563 if (sizeof(Node
) == sizeof(GLfloat
))
6564 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6566 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6569 case OPCODE_MATERIAL
:
6570 if (sizeof(Node
) == sizeof(GLfloat
))
6571 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
6578 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
6582 CALL_Begin(ctx
->Exec
, (n
[1].e
));
6585 CALL_End(ctx
->Exec
, ());
6588 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6590 case OPCODE_EVAL_C1
:
6591 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
6593 case OPCODE_EVAL_C2
:
6594 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6596 case OPCODE_EVAL_P1
:
6597 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
6599 case OPCODE_EVAL_P2
:
6600 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
6603 case OPCODE_CONTINUE
:
6604 n
= (Node
*) n
[1].next
;
6606 case OPCODE_END_OF_LIST
:
6612 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d",
6614 _mesa_problem(ctx
, msg
);
6619 /* increment n to point to next compiled command */
6620 if (opcode
!= OPCODE_CONTINUE
) {
6621 n
+= InstSize
[opcode
];
6626 if (ctx
->Driver
.EndCallList
)
6627 ctx
->Driver
.EndCallList(ctx
);
6629 ctx
->ListState
.CallDepth
--;
6634 /**********************************************************************/
6636 /**********************************************************************/
6639 * Test if a display list number is valid.
6641 GLboolean GLAPIENTRY
6642 _mesa_IsList(GLuint list
)
6644 GET_CURRENT_CONTEXT(ctx
);
6645 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6646 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6647 return islist(ctx
, list
);
6652 * Delete a sequence of consecutive display lists.
6655 _mesa_DeleteLists(GLuint list
, GLsizei range
)
6657 GET_CURRENT_CONTEXT(ctx
);
6659 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6660 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6663 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
6666 for (i
= list
; i
< list
+ range
; i
++) {
6667 destroy_list(ctx
, i
);
6673 * Return a display list number, n, such that lists n through n+range-1
6677 _mesa_GenLists(GLsizei range
)
6679 GET_CURRENT_CONTEXT(ctx
);
6681 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6682 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6685 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
6693 * Make this an atomic operation
6695 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6697 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6699 /* reserve the list IDs by with empty/dummy lists */
6701 for (i
= 0; i
< range
; i
++) {
6702 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
6703 make_list(base
+ i
, 1));
6707 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6714 * Begin a new display list.
6717 _mesa_NewList(GLuint list
, GLenum mode
)
6719 GET_CURRENT_CONTEXT(ctx
);
6722 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6723 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6725 if (MESA_VERBOSE
& VERBOSE_API
)
6726 _mesa_debug(ctx
, "glNewList %u %s\n", list
,
6727 _mesa_lookup_enum_by_nr(mode
));
6730 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
6734 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
6735 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
6739 if (ctx
->ListState
.CurrentListPtr
) {
6740 /* already compiling a display list */
6741 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
6745 ctx
->CompileFlag
= GL_TRUE
;
6746 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6748 /* Allocate new display list */
6749 ctx
->ListState
.CurrentListNum
= list
;
6750 ctx
->ListState
.CurrentList
= make_list(list
, BLOCK_SIZE
);
6751 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->node
;
6752 ctx
->ListState
.CurrentListPtr
= ctx
->ListState
.CurrentBlock
;
6753 ctx
->ListState
.CurrentPos
= 0;
6755 /* Reset acumulated list state:
6757 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
6758 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
6760 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
6761 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
6763 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
6764 ctx
->Driver
.NewList(ctx
, list
, mode
);
6766 ctx
->CurrentDispatch
= ctx
->Save
;
6767 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6772 * End definition of current display list.
6777 GET_CURRENT_CONTEXT(ctx
);
6778 SAVE_FLUSH_VERTICES(ctx
);
6779 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6781 if (MESA_VERBOSE
& VERBOSE_API
)
6782 _mesa_debug(ctx
, "glEndList\n");
6784 /* Check that a list is under construction */
6785 if (!ctx
->ListState
.CurrentListPtr
) {
6786 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
6790 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END_OF_LIST
, 0);
6792 /* Destroy old list, if any */
6793 destroy_list(ctx
, ctx
->ListState
.CurrentListNum
);
6794 /* Install the list */
6795 _mesa_HashInsert(ctx
->Shared
->DisplayList
, ctx
->ListState
.CurrentListNum
,
6796 ctx
->ListState
.CurrentList
);
6799 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6800 mesa_print_display_list(ctx
->ListState
.CurrentListNum
);
6802 ctx
->Driver
.EndList(ctx
);
6804 ctx
->ListState
.CurrentList
= NULL
;
6805 ctx
->ListState
.CurrentListNum
= 0;
6806 ctx
->ListState
.CurrentListPtr
= NULL
;
6807 ctx
->ExecuteFlag
= GL_TRUE
;
6808 ctx
->CompileFlag
= GL_FALSE
;
6810 ctx
->CurrentDispatch
= ctx
->Exec
;
6811 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6816 _mesa_CallList(GLuint list
)
6818 GLboolean save_compile_flag
;
6819 GET_CURRENT_CONTEXT(ctx
);
6820 FLUSH_CURRENT(ctx
, 0);
6821 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6822 /* execute the display list, and restore the CompileFlag. */
6824 if (MESA_VERBOSE
& VERBOSE_API
)
6825 _mesa_debug(ctx
, "glCallList %d\n", list
);
6828 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6832 /* mesa_print_display_list( list ); */
6834 save_compile_flag
= ctx
->CompileFlag
;
6835 if (save_compile_flag
) {
6836 ctx
->CompileFlag
= GL_FALSE
;
6839 execute_list(ctx
, list
);
6840 ctx
->CompileFlag
= save_compile_flag
;
6842 /* also restore API function pointers to point to "save" versions */
6843 if (save_compile_flag
) {
6844 ctx
->CurrentDispatch
= ctx
->Save
;
6845 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6851 * Execute glCallLists: call multiple display lists.
6854 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
6856 GET_CURRENT_CONTEXT(ctx
);
6859 GLboolean save_compile_flag
;
6861 if (MESA_VERBOSE
& VERBOSE_API
)
6862 _mesa_debug(ctx
, "glCallLists %d\n", n
);
6866 case GL_UNSIGNED_BYTE
:
6868 case GL_UNSIGNED_SHORT
:
6870 case GL_UNSIGNED_INT
:
6878 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6882 /* Save the CompileFlag status, turn it off, execute display list,
6883 * and restore the CompileFlag.
6885 save_compile_flag
= ctx
->CompileFlag
;
6886 ctx
->CompileFlag
= GL_FALSE
;
6888 for (i
= 0; i
< n
; i
++) {
6889 list
= translate_id(i
, type
, lists
);
6890 execute_list(ctx
, ctx
->List
.ListBase
+ list
);
6893 ctx
->CompileFlag
= save_compile_flag
;
6895 /* also restore API function pointers to point to "save" versions */
6896 if (save_compile_flag
) {
6897 ctx
->CurrentDispatch
= ctx
->Save
;
6898 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6904 * Set the offset added to list numbers in glCallLists.
6907 _mesa_ListBase(GLuint base
)
6909 GET_CURRENT_CONTEXT(ctx
);
6910 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6911 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6912 ctx
->List
.ListBase
= base
;
6916 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
6918 static void GLAPIENTRY
6921 GET_CURRENT_CONTEXT(ctx
);
6922 FLUSH_VERTICES(ctx
, 0);
6923 CALL_Finish(ctx
->Exec
, ());
6926 static void GLAPIENTRY
6929 GET_CURRENT_CONTEXT(ctx
);
6930 FLUSH_VERTICES(ctx
, 0);
6931 CALL_Flush(ctx
->Exec
, ());
6934 static void GLAPIENTRY
6935 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
6937 GET_CURRENT_CONTEXT(ctx
);
6938 FLUSH_VERTICES(ctx
, 0);
6939 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
6942 static void GLAPIENTRY
6943 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
6945 GET_CURRENT_CONTEXT(ctx
);
6946 FLUSH_VERTICES(ctx
, 0);
6947 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
6950 static void GLAPIENTRY
6951 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
6953 GET_CURRENT_CONTEXT(ctx
);
6954 FLUSH_VERTICES(ctx
, 0);
6955 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
6958 static GLenum GLAPIENTRY
6961 GET_CURRENT_CONTEXT(ctx
);
6962 FLUSH_VERTICES(ctx
, 0);
6963 return CALL_GetError(ctx
->Exec
, ());
6966 static void GLAPIENTRY
6967 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
6969 GET_CURRENT_CONTEXT(ctx
);
6970 FLUSH_VERTICES(ctx
, 0);
6971 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
6974 static void GLAPIENTRY
6975 exec_GetIntegerv(GLenum pname
, GLint
*params
)
6977 GET_CURRENT_CONTEXT(ctx
);
6978 FLUSH_VERTICES(ctx
, 0);
6979 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
6982 static void GLAPIENTRY
6983 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
6985 GET_CURRENT_CONTEXT(ctx
);
6986 FLUSH_VERTICES(ctx
, 0);
6987 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
6990 static void GLAPIENTRY
6991 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
6993 GET_CURRENT_CONTEXT(ctx
);
6994 FLUSH_VERTICES(ctx
, 0);
6995 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
6998 static void GLAPIENTRY
6999 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
7001 GET_CURRENT_CONTEXT(ctx
);
7002 FLUSH_VERTICES(ctx
, 0);
7003 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
7006 static void GLAPIENTRY
7007 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
7009 GET_CURRENT_CONTEXT(ctx
);
7010 FLUSH_VERTICES(ctx
, 0);
7011 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
7014 static void GLAPIENTRY
7015 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
7017 GET_CURRENT_CONTEXT(ctx
);
7018 FLUSH_VERTICES(ctx
, 0);
7019 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
7022 static void GLAPIENTRY
7023 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
7025 GET_CURRENT_CONTEXT(ctx
);
7026 FLUSH_VERTICES(ctx
, 0);
7027 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
7030 static void GLAPIENTRY
7031 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
7033 GET_CURRENT_CONTEXT(ctx
);
7034 FLUSH_VERTICES(ctx
, 0);
7035 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
7038 static void GLAPIENTRY
7039 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
7041 GET_CURRENT_CONTEXT(ctx
);
7042 FLUSH_VERTICES(ctx
, 0);
7043 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
7046 static void GLAPIENTRY
7047 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
7049 GET_CURRENT_CONTEXT(ctx
);
7050 FLUSH_VERTICES(ctx
, 0);
7051 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
7054 static void GLAPIENTRY
7055 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
7057 GET_CURRENT_CONTEXT(ctx
);
7058 FLUSH_VERTICES(ctx
, 0);
7059 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
7062 static void GLAPIENTRY
7063 exec_GetPolygonStipple(GLubyte
* dest
)
7065 GET_CURRENT_CONTEXT(ctx
);
7066 FLUSH_VERTICES(ctx
, 0);
7067 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
7070 static const GLubyte
*GLAPIENTRY
7071 exec_GetString(GLenum name
)
7073 GET_CURRENT_CONTEXT(ctx
);
7074 FLUSH_VERTICES(ctx
, 0);
7075 return CALL_GetString(ctx
->Exec
, (name
));
7078 static void GLAPIENTRY
7079 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7081 GET_CURRENT_CONTEXT(ctx
);
7082 FLUSH_VERTICES(ctx
, 0);
7083 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
7086 static void GLAPIENTRY
7087 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
7089 GET_CURRENT_CONTEXT(ctx
);
7090 FLUSH_VERTICES(ctx
, 0);
7091 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
7094 static void GLAPIENTRY
7095 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
7097 GET_CURRENT_CONTEXT(ctx
);
7098 FLUSH_VERTICES(ctx
, 0);
7099 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
7102 static void GLAPIENTRY
7103 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
7105 GET_CURRENT_CONTEXT(ctx
);
7106 FLUSH_VERTICES(ctx
, 0);
7107 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
7110 static void GLAPIENTRY
7111 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
7113 GET_CURRENT_CONTEXT(ctx
);
7114 FLUSH_VERTICES(ctx
, 0);
7115 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
7118 static void GLAPIENTRY
7119 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
7120 GLenum type
, GLvoid
* pixels
)
7122 GET_CURRENT_CONTEXT(ctx
);
7123 FLUSH_VERTICES(ctx
, 0);
7124 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
7127 static void GLAPIENTRY
7128 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
7129 GLenum pname
, GLfloat
*params
)
7131 GET_CURRENT_CONTEXT(ctx
);
7132 FLUSH_VERTICES(ctx
, 0);
7133 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
7136 static void GLAPIENTRY
7137 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
7138 GLenum pname
, GLint
*params
)
7140 GET_CURRENT_CONTEXT(ctx
);
7141 FLUSH_VERTICES(ctx
, 0);
7142 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
7145 static void GLAPIENTRY
7146 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7148 GET_CURRENT_CONTEXT(ctx
);
7149 FLUSH_VERTICES(ctx
, 0);
7150 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
7153 static void GLAPIENTRY
7154 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7156 GET_CURRENT_CONTEXT(ctx
);
7157 FLUSH_VERTICES(ctx
, 0);
7158 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
7161 static GLboolean GLAPIENTRY
7162 exec_IsEnabled(GLenum cap
)
7164 GET_CURRENT_CONTEXT(ctx
);
7165 FLUSH_VERTICES(ctx
, 0);
7166 return CALL_IsEnabled(ctx
->Exec
, (cap
));
7169 static void GLAPIENTRY
7170 exec_PixelStoref(GLenum pname
, GLfloat param
)
7172 GET_CURRENT_CONTEXT(ctx
);
7173 FLUSH_VERTICES(ctx
, 0);
7174 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
7177 static void GLAPIENTRY
7178 exec_PixelStorei(GLenum pname
, GLint param
)
7180 GET_CURRENT_CONTEXT(ctx
);
7181 FLUSH_VERTICES(ctx
, 0);
7182 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
7185 static void GLAPIENTRY
7186 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
7187 GLenum format
, GLenum type
, GLvoid
* pixels
)
7189 GET_CURRENT_CONTEXT(ctx
);
7190 FLUSH_VERTICES(ctx
, 0);
7191 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
7194 static GLint GLAPIENTRY
7195 exec_RenderMode(GLenum mode
)
7197 GET_CURRENT_CONTEXT(ctx
);
7198 FLUSH_VERTICES(ctx
, 0);
7199 return CALL_RenderMode(ctx
->Exec
, (mode
));
7202 static void GLAPIENTRY
7203 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
7205 GET_CURRENT_CONTEXT(ctx
);
7206 FLUSH_VERTICES(ctx
, 0);
7207 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
7210 static void GLAPIENTRY
7211 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
7213 GET_CURRENT_CONTEXT(ctx
);
7214 FLUSH_VERTICES(ctx
, 0);
7215 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
7218 static GLboolean GLAPIENTRY
7219 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
7220 GLboolean
* residences
)
7222 GET_CURRENT_CONTEXT(ctx
);
7223 FLUSH_VERTICES(ctx
, 0);
7224 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
7227 static void GLAPIENTRY
7228 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7230 GET_CURRENT_CONTEXT(ctx
);
7231 FLUSH_VERTICES(ctx
, 0);
7232 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7235 static void GLAPIENTRY
7236 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
7238 GET_CURRENT_CONTEXT(ctx
);
7239 FLUSH_VERTICES(ctx
, 0);
7240 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
7243 static void GLAPIENTRY
7244 exec_DisableClientState(GLenum cap
)
7246 GET_CURRENT_CONTEXT(ctx
);
7247 FLUSH_VERTICES(ctx
, 0);
7248 CALL_DisableClientState(ctx
->Exec
, (cap
));
7251 static void GLAPIENTRY
7252 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
7254 GET_CURRENT_CONTEXT(ctx
);
7255 FLUSH_VERTICES(ctx
, 0);
7256 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
7259 static void GLAPIENTRY
7260 exec_EnableClientState(GLenum cap
)
7262 GET_CURRENT_CONTEXT(ctx
);
7263 FLUSH_VERTICES(ctx
, 0);
7264 CALL_EnableClientState(ctx
->Exec
, (cap
));
7267 static void GLAPIENTRY
7268 exec_GenTextures(GLsizei n
, GLuint
* texName
)
7270 GET_CURRENT_CONTEXT(ctx
);
7271 FLUSH_VERTICES(ctx
, 0);
7272 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
7275 static void GLAPIENTRY
7276 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
7278 GET_CURRENT_CONTEXT(ctx
);
7279 FLUSH_VERTICES(ctx
, 0);
7280 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
7283 static void GLAPIENTRY
7284 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7286 GET_CURRENT_CONTEXT(ctx
);
7287 FLUSH_VERTICES(ctx
, 0);
7288 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
7291 static void GLAPIENTRY
7292 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
7294 GET_CURRENT_CONTEXT(ctx
);
7295 FLUSH_VERTICES(ctx
, 0);
7296 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
7299 static GLboolean GLAPIENTRY
7300 exec_IsTexture(GLuint texture
)
7302 GET_CURRENT_CONTEXT(ctx
);
7303 FLUSH_VERTICES(ctx
, 0);
7304 return CALL_IsTexture(ctx
->Exec
, (texture
));
7307 static void GLAPIENTRY
7308 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7310 GET_CURRENT_CONTEXT(ctx
);
7311 FLUSH_VERTICES(ctx
, 0);
7312 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
7315 static void GLAPIENTRY
7316 exec_PopClientAttrib(void)
7318 GET_CURRENT_CONTEXT(ctx
);
7319 FLUSH_VERTICES(ctx
, 0);
7320 CALL_PopClientAttrib(ctx
->Exec
, ());
7323 static void GLAPIENTRY
7324 exec_PushClientAttrib(GLbitfield mask
)
7326 GET_CURRENT_CONTEXT(ctx
);
7327 FLUSH_VERTICES(ctx
, 0);
7328 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
7331 static void GLAPIENTRY
7332 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
7335 GET_CURRENT_CONTEXT(ctx
);
7336 FLUSH_VERTICES(ctx
, 0);
7337 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7340 static void GLAPIENTRY
7341 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
7343 GET_CURRENT_CONTEXT(ctx
);
7344 FLUSH_VERTICES(ctx
, 0);
7345 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
7348 static void GLAPIENTRY
7349 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
7352 GET_CURRENT_CONTEXT(ctx
);
7353 FLUSH_VERTICES(ctx
, 0);
7354 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7357 static void GLAPIENTRY
7358 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
7359 GLint x
, GLint y
, GLsizei width
)
7361 GET_CURRENT_CONTEXT(ctx
);
7362 FLUSH_VERTICES(ctx
, 0);
7363 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
7364 (target
, internalFormat
, x
, y
, width
));
7367 static void GLAPIENTRY
7368 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
7369 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
7371 GET_CURRENT_CONTEXT(ctx
);
7372 FLUSH_VERTICES(ctx
, 0);
7373 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
7374 (target
, internalFormat
, x
, y
, width
,
7378 static void GLAPIENTRY
7379 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
7381 GET_CURRENT_CONTEXT(ctx
);
7382 FLUSH_VERTICES(ctx
, 0);
7383 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
7386 static void GLAPIENTRY
7387 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7389 GET_CURRENT_CONTEXT(ctx
);
7390 FLUSH_VERTICES(ctx
, 0);
7391 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
7394 static void GLAPIENTRY
7395 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7397 GET_CURRENT_CONTEXT(ctx
);
7398 FLUSH_VERTICES(ctx
, 0);
7399 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
7402 static void GLAPIENTRY
7403 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
7406 GET_CURRENT_CONTEXT(ctx
);
7407 FLUSH_VERTICES(ctx
, 0);
7408 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
7411 static void GLAPIENTRY
7412 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7414 GET_CURRENT_CONTEXT(ctx
);
7415 FLUSH_VERTICES(ctx
, 0);
7416 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
7419 static void GLAPIENTRY
7420 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7422 GET_CURRENT_CONTEXT(ctx
);
7423 FLUSH_VERTICES(ctx
, 0);
7424 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
7427 static void GLAPIENTRY
7428 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
7429 GLenum type
, GLvoid
*values
)
7431 GET_CURRENT_CONTEXT(ctx
);
7432 FLUSH_VERTICES(ctx
, 0);
7433 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7436 static void GLAPIENTRY
7437 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7439 GET_CURRENT_CONTEXT(ctx
);
7440 FLUSH_VERTICES(ctx
, 0);
7441 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
7444 static void GLAPIENTRY
7445 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7447 GET_CURRENT_CONTEXT(ctx
);
7448 FLUSH_VERTICES(ctx
, 0);
7449 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
7452 static void GLAPIENTRY
7453 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
7454 GLenum type
, GLvoid
*values
)
7456 GET_CURRENT_CONTEXT(ctx
);
7457 FLUSH_VERTICES(ctx
, 0);
7458 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7461 static void GLAPIENTRY
7462 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7464 GET_CURRENT_CONTEXT(ctx
);
7465 FLUSH_VERTICES(ctx
, 0);
7466 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
7469 static void GLAPIENTRY
7470 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7472 GET_CURRENT_CONTEXT(ctx
);
7473 FLUSH_VERTICES(ctx
, 0);
7474 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
7477 static void GLAPIENTRY
7478 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
7479 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
7481 GET_CURRENT_CONTEXT(ctx
);
7482 FLUSH_VERTICES(ctx
, 0);
7483 CALL_GetSeparableFilter(ctx
->Exec
,
7484 (target
, format
, type
, row
, column
, span
));
7487 static void GLAPIENTRY
7488 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
7489 GLsizei width
, GLsizei height
, GLenum format
,
7490 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
7492 GET_CURRENT_CONTEXT(ctx
);
7493 FLUSH_VERTICES(ctx
, 0);
7494 CALL_SeparableFilter2D(ctx
->Exec
,
7495 (target
, internalFormat
, width
, height
, format
,
7496 type
, row
, column
));
7499 static void GLAPIENTRY
7500 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7501 GLsizei count
, const GLvoid
*ptr
)
7503 GET_CURRENT_CONTEXT(ctx
);
7504 FLUSH_VERTICES(ctx
, 0);
7505 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7508 static void GLAPIENTRY
7509 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
7511 GET_CURRENT_CONTEXT(ctx
);
7512 FLUSH_VERTICES(ctx
, 0);
7513 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
7516 static void GLAPIENTRY
7517 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7520 GET_CURRENT_CONTEXT(ctx
);
7521 FLUSH_VERTICES(ctx
, 0);
7522 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
7525 static void GLAPIENTRY
7526 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7529 GET_CURRENT_CONTEXT(ctx
);
7530 FLUSH_VERTICES(ctx
, 0);
7531 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
7534 static void GLAPIENTRY
7535 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7536 GLsizei count
, const GLvoid
*ptr
)
7538 GET_CURRENT_CONTEXT(ctx
);
7539 FLUSH_VERTICES(ctx
, 0);
7540 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7543 static void GLAPIENTRY
7544 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7545 GLsizei count
, const GLvoid
*ptr
)
7547 GET_CURRENT_CONTEXT(ctx
);
7548 FLUSH_VERTICES(ctx
, 0);
7549 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7552 static void GLAPIENTRY
7553 exec_LockArraysEXT(GLint first
, GLsizei count
)
7555 GET_CURRENT_CONTEXT(ctx
);
7556 FLUSH_VERTICES(ctx
, 0);
7557 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
7560 static void GLAPIENTRY
7561 exec_UnlockArraysEXT(void)
7563 GET_CURRENT_CONTEXT(ctx
);
7564 FLUSH_VERTICES(ctx
, 0);
7565 CALL_UnlockArraysEXT(ctx
->Exec
, ());
7568 static void GLAPIENTRY
7569 exec_ClientActiveTextureARB(GLenum target
)
7571 GET_CURRENT_CONTEXT(ctx
);
7572 FLUSH_VERTICES(ctx
, 0);
7573 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
7576 static void GLAPIENTRY
7577 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
7578 GLsizei stride
, const GLvoid
*ptr
)
7580 GET_CURRENT_CONTEXT(ctx
);
7581 FLUSH_VERTICES(ctx
, 0);
7582 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
7585 static void GLAPIENTRY
7586 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7588 GET_CURRENT_CONTEXT(ctx
);
7589 FLUSH_VERTICES(ctx
, 0);
7590 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
7593 /* GL_EXT_multi_draw_arrays */
7594 static void GLAPIENTRY
7595 exec_MultiDrawArraysEXT(GLenum mode
, GLint
* first
,
7596 GLsizei
* count
, GLsizei primcount
)
7598 GET_CURRENT_CONTEXT(ctx
);
7599 FLUSH_VERTICES(ctx
, 0);
7600 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
7603 /* GL_EXT_multi_draw_arrays */
7604 static void GLAPIENTRY
7605 exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
* count
,
7606 GLenum type
, const GLvoid
** indices
,
7609 GET_CURRENT_CONTEXT(ctx
);
7610 FLUSH_VERTICES(ctx
, 0);
7611 CALL_MultiDrawElementsEXT(ctx
->Exec
,
7612 (mode
, count
, type
, indices
, primcount
));
7615 /* GL_IBM_multimode_draw_arrays */
7616 static void GLAPIENTRY
7617 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
7618 const GLsizei
* count
, GLsizei primcount
,
7621 GET_CURRENT_CONTEXT(ctx
);
7622 FLUSH_VERTICES(ctx
, 0);
7623 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
7624 (mode
, first
, count
, primcount
, modestride
));
7627 /* GL_IBM_multimode_draw_arrays */
7628 static void GLAPIENTRY
7629 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
7630 const GLsizei
* count
,
7632 const GLvoid
* const *indices
,
7633 GLsizei primcount
, GLint modestride
)
7635 GET_CURRENT_CONTEXT(ctx
);
7636 FLUSH_VERTICES(ctx
, 0);
7637 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
7638 (mode
, count
, type
, indices
, primcount
,
7645 * Setup the given dispatch table to point to Mesa's display list
7646 * building functions.
7648 * This does not include any of the tnl functions - they are
7649 * initialized from _mesa_init_api_defaults and from the active vtxfmt
7653 _mesa_init_dlist_table(struct _glapi_table
*table
)
7655 _mesa_loopback_init_api_table(table
);
7658 SET_Accum(table
, save_Accum
);
7659 SET_AlphaFunc(table
, save_AlphaFunc
);
7660 SET_Bitmap(table
, save_Bitmap
);
7661 SET_BlendFunc(table
, _mesa_BlendFunc
); /* loops-back to BlendFuncSeparate */
7662 SET_CallList(table
, _mesa_save_CallList
);
7663 SET_CallLists(table
, _mesa_save_CallLists
);
7664 SET_Clear(table
, save_Clear
);
7665 SET_ClearAccum(table
, save_ClearAccum
);
7666 SET_ClearColor(table
, save_ClearColor
);
7667 SET_ClearDepth(table
, save_ClearDepth
);
7668 SET_ClearIndex(table
, save_ClearIndex
);
7669 SET_ClearStencil(table
, save_ClearStencil
);
7670 SET_ClipPlane(table
, save_ClipPlane
);
7671 SET_ColorMask(table
, save_ColorMask
);
7672 SET_ColorMaterial(table
, save_ColorMaterial
);
7673 SET_CopyPixels(table
, save_CopyPixels
);
7674 SET_CullFace(table
, save_CullFace
);
7675 SET_DeleteLists(table
, _mesa_DeleteLists
);
7676 SET_DepthFunc(table
, save_DepthFunc
);
7677 SET_DepthMask(table
, save_DepthMask
);
7678 SET_DepthRange(table
, save_DepthRange
);
7679 SET_Disable(table
, save_Disable
);
7680 SET_DrawBuffer(table
, save_DrawBuffer
);
7681 SET_DrawPixels(table
, save_DrawPixels
);
7682 SET_Enable(table
, save_Enable
);
7683 SET_EndList(table
, _mesa_EndList
);
7684 SET_EvalMesh1(table
, _mesa_save_EvalMesh1
);
7685 SET_EvalMesh2(table
, _mesa_save_EvalMesh2
);
7686 SET_Finish(table
, exec_Finish
);
7687 SET_Flush(table
, exec_Flush
);
7688 SET_Fogf(table
, save_Fogf
);
7689 SET_Fogfv(table
, save_Fogfv
);
7690 SET_Fogi(table
, save_Fogi
);
7691 SET_Fogiv(table
, save_Fogiv
);
7692 SET_FrontFace(table
, save_FrontFace
);
7693 SET_Frustum(table
, save_Frustum
);
7694 SET_GenLists(table
, _mesa_GenLists
);
7695 SET_GetBooleanv(table
, exec_GetBooleanv
);
7696 SET_GetClipPlane(table
, exec_GetClipPlane
);
7697 SET_GetDoublev(table
, exec_GetDoublev
);
7698 SET_GetError(table
, exec_GetError
);
7699 SET_GetFloatv(table
, exec_GetFloatv
);
7700 SET_GetIntegerv(table
, exec_GetIntegerv
);
7701 SET_GetLightfv(table
, exec_GetLightfv
);
7702 SET_GetLightiv(table
, exec_GetLightiv
);
7703 SET_GetMapdv(table
, exec_GetMapdv
);
7704 SET_GetMapfv(table
, exec_GetMapfv
);
7705 SET_GetMapiv(table
, exec_GetMapiv
);
7706 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
7707 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
7708 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
7709 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
7710 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
7711 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
7712 SET_GetString(table
, exec_GetString
);
7713 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
7714 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
7715 SET_GetTexGendv(table
, exec_GetTexGendv
);
7716 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
7717 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
7718 SET_GetTexImage(table
, exec_GetTexImage
);
7719 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
7720 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
7721 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
7722 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
7723 SET_Hint(table
, save_Hint
);
7724 SET_IndexMask(table
, save_IndexMask
);
7725 SET_InitNames(table
, save_InitNames
);
7726 SET_IsEnabled(table
, exec_IsEnabled
);
7727 SET_IsList(table
, _mesa_IsList
);
7728 SET_LightModelf(table
, save_LightModelf
);
7729 SET_LightModelfv(table
, save_LightModelfv
);
7730 SET_LightModeli(table
, save_LightModeli
);
7731 SET_LightModeliv(table
, save_LightModeliv
);
7732 SET_Lightf(table
, save_Lightf
);
7733 SET_Lightfv(table
, save_Lightfv
);
7734 SET_Lighti(table
, save_Lighti
);
7735 SET_Lightiv(table
, save_Lightiv
);
7736 SET_LineStipple(table
, save_LineStipple
);
7737 SET_LineWidth(table
, save_LineWidth
);
7738 SET_ListBase(table
, save_ListBase
);
7739 SET_LoadIdentity(table
, save_LoadIdentity
);
7740 SET_LoadMatrixd(table
, save_LoadMatrixd
);
7741 SET_LoadMatrixf(table
, save_LoadMatrixf
);
7742 SET_LoadName(table
, save_LoadName
);
7743 SET_LogicOp(table
, save_LogicOp
);
7744 SET_Map1d(table
, save_Map1d
);
7745 SET_Map1f(table
, save_Map1f
);
7746 SET_Map2d(table
, save_Map2d
);
7747 SET_Map2f(table
, save_Map2f
);
7748 SET_MapGrid1d(table
, save_MapGrid1d
);
7749 SET_MapGrid1f(table
, save_MapGrid1f
);
7750 SET_MapGrid2d(table
, save_MapGrid2d
);
7751 SET_MapGrid2f(table
, save_MapGrid2f
);
7752 SET_MatrixMode(table
, save_MatrixMode
);
7753 SET_MultMatrixd(table
, save_MultMatrixd
);
7754 SET_MultMatrixf(table
, save_MultMatrixf
);
7755 SET_NewList(table
, save_NewList
);
7756 SET_Ortho(table
, save_Ortho
);
7757 SET_PassThrough(table
, save_PassThrough
);
7758 SET_PixelMapfv(table
, save_PixelMapfv
);
7759 SET_PixelMapuiv(table
, save_PixelMapuiv
);
7760 SET_PixelMapusv(table
, save_PixelMapusv
);
7761 SET_PixelStoref(table
, exec_PixelStoref
);
7762 SET_PixelStorei(table
, exec_PixelStorei
);
7763 SET_PixelTransferf(table
, save_PixelTransferf
);
7764 SET_PixelTransferi(table
, save_PixelTransferi
);
7765 SET_PixelZoom(table
, save_PixelZoom
);
7766 SET_PointSize(table
, save_PointSize
);
7767 SET_PolygonMode(table
, save_PolygonMode
);
7768 SET_PolygonOffset(table
, save_PolygonOffset
);
7769 SET_PolygonStipple(table
, save_PolygonStipple
);
7770 SET_PopAttrib(table
, save_PopAttrib
);
7771 SET_PopMatrix(table
, save_PopMatrix
);
7772 SET_PopName(table
, save_PopName
);
7773 SET_PushAttrib(table
, save_PushAttrib
);
7774 SET_PushMatrix(table
, save_PushMatrix
);
7775 SET_PushName(table
, save_PushName
);
7776 SET_RasterPos2d(table
, save_RasterPos2d
);
7777 SET_RasterPos2dv(table
, save_RasterPos2dv
);
7778 SET_RasterPos2f(table
, save_RasterPos2f
);
7779 SET_RasterPos2fv(table
, save_RasterPos2fv
);
7780 SET_RasterPos2i(table
, save_RasterPos2i
);
7781 SET_RasterPos2iv(table
, save_RasterPos2iv
);
7782 SET_RasterPos2s(table
, save_RasterPos2s
);
7783 SET_RasterPos2sv(table
, save_RasterPos2sv
);
7784 SET_RasterPos3d(table
, save_RasterPos3d
);
7785 SET_RasterPos3dv(table
, save_RasterPos3dv
);
7786 SET_RasterPos3f(table
, save_RasterPos3f
);
7787 SET_RasterPos3fv(table
, save_RasterPos3fv
);
7788 SET_RasterPos3i(table
, save_RasterPos3i
);
7789 SET_RasterPos3iv(table
, save_RasterPos3iv
);
7790 SET_RasterPos3s(table
, save_RasterPos3s
);
7791 SET_RasterPos3sv(table
, save_RasterPos3sv
);
7792 SET_RasterPos4d(table
, save_RasterPos4d
);
7793 SET_RasterPos4dv(table
, save_RasterPos4dv
);
7794 SET_RasterPos4f(table
, save_RasterPos4f
);
7795 SET_RasterPos4fv(table
, save_RasterPos4fv
);
7796 SET_RasterPos4i(table
, save_RasterPos4i
);
7797 SET_RasterPos4iv(table
, save_RasterPos4iv
);
7798 SET_RasterPos4s(table
, save_RasterPos4s
);
7799 SET_RasterPos4sv(table
, save_RasterPos4sv
);
7800 SET_ReadBuffer(table
, save_ReadBuffer
);
7801 SET_ReadPixels(table
, exec_ReadPixels
);
7802 SET_RenderMode(table
, exec_RenderMode
);
7803 SET_Rotated(table
, save_Rotated
);
7804 SET_Rotatef(table
, save_Rotatef
);
7805 SET_Scaled(table
, save_Scaled
);
7806 SET_Scalef(table
, save_Scalef
);
7807 SET_Scissor(table
, save_Scissor
);
7808 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
7809 SET_SelectBuffer(table
, exec_SelectBuffer
);
7810 SET_ShadeModel(table
, save_ShadeModel
);
7811 SET_StencilFunc(table
, save_StencilFunc
);
7812 SET_StencilMask(table
, save_StencilMask
);
7813 SET_StencilOp(table
, save_StencilOp
);
7814 SET_TexEnvf(table
, save_TexEnvf
);
7815 SET_TexEnvfv(table
, save_TexEnvfv
);
7816 SET_TexEnvi(table
, save_TexEnvi
);
7817 SET_TexEnviv(table
, save_TexEnviv
);
7818 SET_TexGend(table
, save_TexGend
);
7819 SET_TexGendv(table
, save_TexGendv
);
7820 SET_TexGenf(table
, save_TexGenf
);
7821 SET_TexGenfv(table
, save_TexGenfv
);
7822 SET_TexGeni(table
, save_TexGeni
);
7823 SET_TexGeniv(table
, save_TexGeniv
);
7824 SET_TexImage1D(table
, save_TexImage1D
);
7825 SET_TexImage2D(table
, save_TexImage2D
);
7826 SET_TexParameterf(table
, save_TexParameterf
);
7827 SET_TexParameterfv(table
, save_TexParameterfv
);
7828 SET_TexParameteri(table
, save_TexParameteri
);
7829 SET_TexParameteriv(table
, save_TexParameteriv
);
7830 SET_Translated(table
, save_Translated
);
7831 SET_Translatef(table
, save_Translatef
);
7832 SET_Viewport(table
, save_Viewport
);
7835 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
7836 SET_BindTexture(table
, save_BindTexture
);
7837 SET_ColorPointer(table
, exec_ColorPointer
);
7838 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
7839 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
7840 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
7841 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
7842 SET_DeleteTextures(table
, exec_DeleteTextures
);
7843 SET_DisableClientState(table
, exec_DisableClientState
);
7844 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
7845 SET_EnableClientState(table
, exec_EnableClientState
);
7846 SET_GenTextures(table
, exec_GenTextures
);
7847 SET_GetPointerv(table
, exec_GetPointerv
);
7848 SET_IndexPointer(table
, exec_IndexPointer
);
7849 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
7850 SET_IsTexture(table
, exec_IsTexture
);
7851 SET_NormalPointer(table
, exec_NormalPointer
);
7852 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
7853 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
7854 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
7855 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
7856 SET_TexSubImage1D(table
, save_TexSubImage1D
);
7857 SET_TexSubImage2D(table
, save_TexSubImage2D
);
7858 SET_VertexPointer(table
, exec_VertexPointer
);
7861 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
7862 SET_TexImage3D(table
, save_TexImage3D
);
7863 SET_TexSubImage3D(table
, save_TexSubImage3D
);
7866 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
7867 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
7868 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
7870 /* GL_ARB_imaging */
7871 /* Not all are supported */
7872 SET_BlendColor(table
, save_BlendColor
);
7873 SET_BlendEquation(table
, save_BlendEquation
);
7874 SET_ColorSubTable(table
, save_ColorSubTable
);
7875 SET_ColorTable(table
, save_ColorTable
);
7876 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
7877 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
7878 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
7879 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
7880 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
7881 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
7882 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
7883 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
7884 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
7885 SET_CopyColorTable(table
, save_CopyColorTable
);
7886 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
7887 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
7888 SET_GetColorTable(table
, exec_GetColorTable
);
7889 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
7890 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
7891 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
7892 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
7893 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
7894 SET_GetHistogram(table
, exec_GetHistogram
);
7895 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
7896 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
7897 SET_GetMinmax(table
, exec_GetMinmax
);
7898 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
7899 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
7900 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
7901 SET_Histogram(table
, save_Histogram
);
7902 SET_Minmax(table
, save_Minmax
);
7903 SET_ResetHistogram(table
, save_ResetHistogram
);
7904 SET_ResetMinmax(table
, save_ResetMinmax
);
7905 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
7907 /* 2. GL_EXT_blend_color */
7909 SET_BlendColorEXT(table
, save_BlendColorEXT
);
7912 /* 3. GL_EXT_polygon_offset */
7913 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
7915 /* 6. GL_EXT_texture3d */
7917 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
7918 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
7919 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
7922 /* 14. GL_SGI_color_table */
7924 SET_ColorTableSGI(table
, save_ColorTable
);
7925 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
7926 SET_GetColorTableSGI(table
, exec_GetColorTable
);
7927 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
7928 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
7931 /* 30. GL_EXT_vertex_array */
7932 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
7933 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
7934 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
7935 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
7936 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
7937 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
7939 /* 37. GL_EXT_blend_minmax */
7941 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
7944 /* 54. GL_EXT_point_parameters */
7945 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
7946 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
7948 /* 97. GL_EXT_compiled_vertex_array */
7949 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
7950 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
7952 /* 145. GL_EXT_secondary_color */
7953 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
7955 /* 148. GL_EXT_multi_draw_arrays */
7956 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
7957 SET_MultiDrawElementsEXT(table
, exec_MultiDrawElementsEXT
);
7959 /* 149. GL_EXT_fog_coord */
7960 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
7962 /* 173. GL_EXT_blend_func_separate */
7963 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
7965 /* 196. GL_MESA_resize_buffers */
7966 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
7968 /* 197. GL_MESA_window_pos */
7969 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
7970 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
7971 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
7972 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
7973 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
7974 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
7975 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
7976 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
7977 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
7978 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
7979 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
7980 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
7981 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
7982 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
7983 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
7984 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
7985 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
7986 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
7987 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
7988 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
7989 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
7990 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
7991 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
7992 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
7994 /* 200. GL_IBM_multimode_draw_arrays */
7995 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
7996 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
7998 #if FEATURE_NV_vertex_program
7999 /* 233. GL_NV_vertex_program */
8000 /* The following commands DO NOT go into display lists:
8001 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
8002 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
8004 SET_BindProgramNV(table
, save_BindProgramNV
);
8005 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8006 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
8007 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8008 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
8009 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
8010 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
8011 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
8012 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
8013 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
8014 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
8015 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8016 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8017 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8018 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8019 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
8020 SET_LoadProgramNV(table
, save_LoadProgramNV
);
8021 SET_ProgramParameter4dNV(table
, save_ProgramParameter4dNV
);
8022 SET_ProgramParameter4dvNV(table
, save_ProgramParameter4dvNV
);
8023 SET_ProgramParameter4fNV(table
, save_ProgramParameter4fNV
);
8024 SET_ProgramParameter4fvNV(table
, save_ProgramParameter4fvNV
);
8025 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
8026 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
8027 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
8028 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
8031 /* 245. GL_ATI_fragment_shader */
8032 #if FEATURE_ATI_fragment_shader
8033 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
8034 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
8037 /* 282. GL_NV_fragment_program */
8038 #if FEATURE_NV_fragment_program
8039 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
8040 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
8041 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
8042 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
8043 SET_GetProgramNamedParameterfvNV(table
,
8044 _mesa_GetProgramNamedParameterfvNV
);
8045 SET_GetProgramNamedParameterdvNV(table
,
8046 _mesa_GetProgramNamedParameterdvNV
);
8047 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8048 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8049 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8050 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8051 SET_GetProgramLocalParameterdvARB(table
,
8052 _mesa_GetProgramLocalParameterdvARB
);
8053 SET_GetProgramLocalParameterfvARB(table
,
8054 _mesa_GetProgramLocalParameterfvARB
);
8057 /* 262. GL_NV_point_sprite */
8058 SET_PointParameteriNV(table
, save_PointParameteriNV
);
8059 SET_PointParameterivNV(table
, save_PointParameterivNV
);
8061 /* 268. GL_EXT_stencil_two_side */
8062 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
8064 /* 273. GL_APPLE_vertex_array_object */
8065 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
8066 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
8067 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
8068 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
8070 /* ???. GL_EXT_depth_bounds_test */
8071 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
8073 /* ARB 1. GL_ARB_multitexture */
8074 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
8075 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
8077 /* ARB 3. GL_ARB_transpose_matrix */
8078 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
8079 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
8080 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
8081 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
8083 /* ARB 5. GL_ARB_multisample */
8084 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
8086 /* ARB 12. GL_ARB_texture_compression */
8087 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
8088 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
8089 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
8090 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
8091 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
8092 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
8093 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
8095 /* ARB 14. GL_ARB_point_parameters */
8096 /* aliased with EXT_point_parameters functions */
8098 /* ARB 25. GL_ARB_window_pos */
8099 /* aliased with MESA_window_pos functions */
8101 /* ARB 26. GL_ARB_vertex_program */
8102 /* ARB 27. GL_ARB_fragment_program */
8103 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8104 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
8105 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
8106 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
8107 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
8108 SET_ProgramStringARB(table
, save_ProgramStringARB
);
8109 SET_BindProgramNV(table
, save_BindProgramNV
);
8110 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8111 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8112 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
8113 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8114 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8115 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8116 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8117 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
8118 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
8119 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
8120 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
8121 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8122 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8123 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8124 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8125 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
8126 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
8127 SET_GetProgramLocalParameterdvARB(table
,
8128 _mesa_GetProgramLocalParameterdvARB
);
8129 SET_GetProgramLocalParameterfvARB(table
,
8130 _mesa_GetProgramLocalParameterfvARB
);
8131 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
8132 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
8135 /* ARB 28. GL_ARB_vertex_buffer_object */
8136 #if FEATURE_ARB_vertex_buffer_object
8137 /* None of the extension's functions get compiled */
8138 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
8139 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
8140 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
8141 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
8142 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
8143 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
8144 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
8145 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
8146 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
8147 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
8148 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
8151 #if FEATURE_ARB_occlusion_query
8152 SET_BeginQueryARB(table
, save_BeginQueryARB
);
8153 SET_EndQueryARB(table
, save_EndQueryARB
);
8154 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
8155 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
8156 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
8157 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
8158 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
8159 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
8161 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
8163 #if FEATURE_EXT_framebuffer_blit
8164 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
8167 /* 299. GL_EXT_blend_equation_separate */
8168 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
8170 /* GL_EXT_gpu_program_parmaeters */
8171 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8172 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
8173 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
8180 enum_string(GLenum k
)
8182 return _mesa_lookup_enum_by_nr(k
);
8187 * Print the commands in a display list. For debugging only.
8188 * TODO: many commands aren't handled yet.
8190 static void GLAPIENTRY
8191 print_list(GLcontext
*ctx
, GLuint list
)
8193 struct mesa_display_list
*dlist
;
8197 if (!islist(ctx
, list
)) {
8198 _mesa_printf("%u is not a display list ID\n", list
);
8202 dlist
= lookup_list(ctx
, list
);
8208 _mesa_printf("START-LIST %u, address %p\n", list
, (void *) n
);
8210 done
= n
? GL_FALSE
: GL_TRUE
;
8212 OpCode opcode
= n
[0].opcode
;
8213 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
8215 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
8216 /* this is a driver-extended opcode */
8217 ctx
->ListExt
.Opcode
[i
].Print(ctx
, &n
[1]);
8218 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
8223 _mesa_printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
8226 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
8227 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
8229 case OPCODE_CALL_LIST
:
8230 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
8232 case OPCODE_CALL_LIST_OFFSET
:
8233 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
8234 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
8236 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
8237 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
8238 enum_string(n
[1].e
), enum_string(n
[2].e
),
8239 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8241 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
8242 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
8243 enum_string(n
[1].e
), enum_string(n
[2].e
),
8244 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
8246 case OPCODE_DISABLE
:
8247 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
8250 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
8252 case OPCODE_FRUSTUM
:
8253 _mesa_printf("Frustum %g %g %g %g %g %g\n",
8254 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8256 case OPCODE_LINE_STIPPLE
:
8257 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
8259 case OPCODE_LOAD_IDENTITY
:
8260 _mesa_printf("LoadIdentity\n");
8262 case OPCODE_LOAD_MATRIX
:
8263 _mesa_printf("LoadMatrix\n");
8264 _mesa_printf(" %8f %8f %8f %8f\n",
8265 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8266 _mesa_printf(" %8f %8f %8f %8f\n",
8267 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8268 _mesa_printf(" %8f %8f %8f %8f\n",
8269 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8270 _mesa_printf(" %8f %8f %8f %8f\n",
8271 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8273 case OPCODE_MULT_MATRIX
:
8274 _mesa_printf("MultMatrix (or Rotate)\n");
8275 _mesa_printf(" %8f %8f %8f %8f\n",
8276 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8277 _mesa_printf(" %8f %8f %8f %8f\n",
8278 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8279 _mesa_printf(" %8f %8f %8f %8f\n",
8280 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8281 _mesa_printf(" %8f %8f %8f %8f\n",
8282 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8285 _mesa_printf("Ortho %g %g %g %g %g %g\n",
8286 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8288 case OPCODE_POP_ATTRIB
:
8289 _mesa_printf("PopAttrib\n");
8291 case OPCODE_POP_MATRIX
:
8292 _mesa_printf("PopMatrix\n");
8294 case OPCODE_POP_NAME
:
8295 _mesa_printf("PopName\n");
8297 case OPCODE_PUSH_ATTRIB
:
8298 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
8300 case OPCODE_PUSH_MATRIX
:
8301 _mesa_printf("PushMatrix\n");
8303 case OPCODE_PUSH_NAME
:
8304 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
8306 case OPCODE_RASTER_POS
:
8307 _mesa_printf("RasterPos %g %g %g %g\n",
8308 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8311 _mesa_printf("Rotate %g %g %g %g\n",
8312 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8315 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8317 case OPCODE_TRANSLATE
:
8318 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8320 case OPCODE_BIND_TEXTURE
:
8321 _mesa_printf("BindTexture %s %d\n",
8322 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
8324 case OPCODE_SHADE_MODEL
:
8325 _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
8328 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
8329 _mesa_lookup_enum_by_nr(n
[1].ui
),
8330 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
8333 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
8334 _mesa_lookup_enum_by_nr(n
[1].ui
),
8335 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
8336 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
8338 case OPCODE_MAPGRID1
:
8339 _mesa_printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
8341 case OPCODE_MAPGRID2
:
8342 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
8343 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
8345 case OPCODE_EVALMESH1
:
8346 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
8348 case OPCODE_EVALMESH2
:
8349 _mesa_printf("EvalMesh2 %d %d %d %d\n",
8350 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
8353 case OPCODE_ATTR_1F_NV
:
8354 _mesa_printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
8356 case OPCODE_ATTR_2F_NV
:
8357 _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
8358 n
[1].i
, n
[2].f
, n
[3].f
);
8360 case OPCODE_ATTR_3F_NV
:
8361 _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
8362 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8364 case OPCODE_ATTR_4F_NV
:
8365 _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
8366 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8368 case OPCODE_ATTR_1F_ARB
:
8369 _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
8371 case OPCODE_ATTR_2F_ARB
:
8372 _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
8373 n
[1].i
, n
[2].f
, n
[3].f
);
8375 case OPCODE_ATTR_3F_ARB
:
8376 _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
8377 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8379 case OPCODE_ATTR_4F_ARB
:
8380 _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
8381 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8384 case OPCODE_MATERIAL
:
8385 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
8386 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8389 _mesa_printf("BEGIN %x\n", n
[1].i
);
8392 _mesa_printf("END\n");
8395 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
8398 case OPCODE_EVAL_C1
:
8399 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
8401 case OPCODE_EVAL_C2
:
8402 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
8404 case OPCODE_EVAL_P1
:
8405 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
8407 case OPCODE_EVAL_P2
:
8408 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
8412 * meta opcodes/commands
8415 _mesa_printf("Error: %s %s\n",
8416 enum_string(n
[1].e
), (const char *) n
[2].data
);
8418 case OPCODE_CONTINUE
:
8419 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
8420 n
= (Node
*) n
[1].next
;
8422 case OPCODE_END_OF_LIST
:
8423 _mesa_printf("END-LIST %u\n", list
);
8427 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
8429 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
8430 opcode
, (void *) n
);
8434 _mesa_printf("command %d, %u operands\n", opcode
,
8438 /* increment n to point to next compiled command */
8439 if (opcode
!= OPCODE_CONTINUE
) {
8440 n
+= InstSize
[opcode
];
8449 * Clients may call this function to help debug display list problems.
8450 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
8451 * changed, or break in the future without notice.
8454 mesa_print_display_list(GLuint list
)
8456 GET_CURRENT_CONTEXT(ctx
);
8457 print_list(ctx
, list
);
8461 /**********************************************************************/
8462 /***** Initialization *****/
8463 /**********************************************************************/
8466 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
8468 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
8469 vfmt
->Begin
= save_Begin
;
8470 vfmt
->CallList
= _mesa_save_CallList
;
8471 vfmt
->CallLists
= _mesa_save_CallLists
;
8472 vfmt
->Color3f
= save_Color3f
;
8473 vfmt
->Color3fv
= save_Color3fv
;
8474 vfmt
->Color4f
= save_Color4f
;
8475 vfmt
->Color4fv
= save_Color4fv
;
8476 vfmt
->EdgeFlag
= save_EdgeFlag
;
8477 vfmt
->End
= save_End
;
8478 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
8479 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
8480 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
8481 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
8482 vfmt
->EvalPoint1
= save_EvalPoint1
;
8483 vfmt
->EvalPoint2
= save_EvalPoint2
;
8484 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
8485 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
8486 vfmt
->Indexf
= save_Indexf
;
8487 vfmt
->Indexfv
= save_Indexfv
;
8488 vfmt
->Materialfv
= save_Materialfv
;
8489 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
8490 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
8491 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
8492 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
8493 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
8494 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
8495 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
8496 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
8497 vfmt
->Normal3f
= save_Normal3f
;
8498 vfmt
->Normal3fv
= save_Normal3fv
;
8499 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
8500 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
8501 vfmt
->TexCoord1f
= save_TexCoord1f
;
8502 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
8503 vfmt
->TexCoord2f
= save_TexCoord2f
;
8504 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
8505 vfmt
->TexCoord3f
= save_TexCoord3f
;
8506 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
8507 vfmt
->TexCoord4f
= save_TexCoord4f
;
8508 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
8509 vfmt
->Vertex2f
= save_Vertex2f
;
8510 vfmt
->Vertex2fv
= save_Vertex2fv
;
8511 vfmt
->Vertex3f
= save_Vertex3f
;
8512 vfmt
->Vertex3fv
= save_Vertex3fv
;
8513 vfmt
->Vertex4f
= save_Vertex4f
;
8514 vfmt
->Vertex4fv
= save_Vertex4fv
;
8515 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
8516 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
8517 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
8518 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
8519 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
8520 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
8521 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
8522 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
8523 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
8524 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
8525 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
8526 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
8527 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
8528 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
8529 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
8530 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
8532 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
8533 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
8534 vfmt
->Rectf
= save_Rectf
;
8536 /* The driver is required to implement these as
8537 * 1) They can probably do a better job.
8538 * 2) A lot of new mechanisms would have to be added to this module
8539 * to support it. That code would probably never get used,
8543 vfmt
->DrawArrays
= 0;
8544 vfmt
->DrawElements
= 0;
8545 vfmt
->DrawRangeElements
= 0;
8551 * Initialize display list state for given context.
8554 _mesa_init_display_list(GLcontext
*ctx
)
8556 static GLboolean tableInitialized
= GL_FALSE
;
8558 /* zero-out the instruction size table, just once */
8559 if (!tableInitialized
) {
8560 _mesa_bzero(InstSize
, sizeof(InstSize
));
8561 tableInitialized
= GL_TRUE
;
8565 ctx
->ListState
.CallDepth
= 0;
8566 ctx
->ExecuteFlag
= GL_TRUE
;
8567 ctx
->CompileFlag
= GL_FALSE
;
8568 ctx
->ListState
.CurrentListPtr
= NULL
;
8569 ctx
->ListState
.CurrentBlock
= NULL
;
8570 ctx
->ListState
.CurrentListNum
= 0;
8571 ctx
->ListState
.CurrentPos
= 0;
8573 /* Display List group */
8574 ctx
->List
.ListBase
= 0;
8576 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);