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"
36 #include "mfeatures.h"
40 #if FEATURE_ARB_vertex_buffer_object
41 #include "bufferobj.h"
53 #include "extensions.h"
55 #include "framebuffer.h"
57 #include "glapi/glapi.h"
59 #include "histogram.h"
76 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
77 #include "shader/arbprogram.h"
78 #include "shader/program.h"
80 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
81 #include "shader/nvprogram.h"
82 #include "shader/program.h"
84 #if FEATURE_ATI_fragment_shader
85 #include "shader/atifragshader.h"
88 #include "math/m_matrix.h"
90 #include "glapi/dispatch.h"
96 * \param ctx GL context.
98 * Checks if dd_function_table::SaveNeedFlush is marked to flush
99 * stored (save) vertices, and calls
100 * dd_function_table::SaveFlushVertices if so.
102 #define SAVE_FLUSH_VERTICES(ctx) \
104 if (ctx->Driver.SaveNeedFlush) \
105 ctx->Driver.SaveFlushVertices(ctx); \
110 * Macro to assert that the API call was made outside the
111 * glBegin()/glEnd() pair, with return value.
113 * \param ctx GL context.
114 * \param retval value to return value in case the assertion fails.
116 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
118 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
119 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
120 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
126 * Macro to assert that the API call was made outside the
127 * glBegin()/glEnd() pair.
129 * \param ctx GL context.
131 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
133 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
134 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
135 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
141 * Macro to assert that the API call was made outside the
142 * glBegin()/glEnd() pair and flush the vertices.
144 * \param ctx GL context.
146 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
148 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
149 SAVE_FLUSH_VERTICES(ctx); \
153 * Macro to assert that the API call was made outside the
154 * glBegin()/glEnd() pair and flush the vertices, with return value.
156 * \param ctx GL context.
157 * \param retval value to return value in case the assertion fails.
159 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
161 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
162 SAVE_FLUSH_VERTICES(ctx); \
168 * Display list opcodes.
170 * The fact that these identifiers are assigned consecutive
171 * integer values starting at 0 is very important, see InstSize array usage)
175 OPCODE_INVALID
= -1, /* Force signed enum */
181 OPCODE_BLEND_EQUATION
,
182 OPCODE_BLEND_EQUATION_SEPARATE
,
183 OPCODE_BLEND_FUNC_SEPARATE
,
185 OPCODE_CALL_LIST_OFFSET
,
191 OPCODE_CLEAR_STENCIL
,
194 OPCODE_COLOR_MATERIAL
,
196 OPCODE_COLOR_TABLE_PARAMETER_FV
,
197 OPCODE_COLOR_TABLE_PARAMETER_IV
,
198 OPCODE_COLOR_SUB_TABLE
,
199 OPCODE_CONVOLUTION_FILTER_1D
,
200 OPCODE_CONVOLUTION_FILTER_2D
,
201 OPCODE_CONVOLUTION_PARAMETER_I
,
202 OPCODE_CONVOLUTION_PARAMETER_IV
,
203 OPCODE_CONVOLUTION_PARAMETER_F
,
204 OPCODE_CONVOLUTION_PARAMETER_FV
,
205 OPCODE_COPY_COLOR_SUB_TABLE
,
206 OPCODE_COPY_COLOR_TABLE
,
208 OPCODE_COPY_TEX_IMAGE1D
,
209 OPCODE_COPY_TEX_IMAGE2D
,
210 OPCODE_COPY_TEX_SUB_IMAGE1D
,
211 OPCODE_COPY_TEX_SUB_IMAGE2D
,
212 OPCODE_COPY_TEX_SUB_IMAGE3D
,
235 OPCODE_LOAD_IDENTITY
,
249 OPCODE_PIXEL_TRANSFER
,
252 OPCODE_POINT_PARAMETERS
,
254 OPCODE_POLYGON_STIPPLE
,
255 OPCODE_POLYGON_OFFSET
,
259 OPCODE_PRIORITIZE_TEXTURE
,
265 OPCODE_RESET_HISTOGRAM
,
266 OPCODE_RESET_MIN_MAX
,
270 OPCODE_SELECT_TEXTURE_SGIS
,
271 OPCODE_SELECT_TEXTURE_COORD_SET
,
282 OPCODE_TEX_SUB_IMAGE1D
,
283 OPCODE_TEX_SUB_IMAGE2D
,
284 OPCODE_TEX_SUB_IMAGE3D
,
288 /* GL_ARB_multitexture */
289 OPCODE_ACTIVE_TEXTURE
,
290 /* GL_ARB_texture_compression */
291 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
292 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
293 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
294 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
295 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
296 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
297 /* GL_ARB_multisample */
298 OPCODE_SAMPLE_COVERAGE
,
299 /* GL_ARB_window_pos */
300 OPCODE_WINDOW_POS_ARB
,
301 /* GL_NV_vertex_program */
302 OPCODE_BIND_PROGRAM_NV
,
303 OPCODE_EXECUTE_PROGRAM_NV
,
304 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
305 OPCODE_LOAD_PROGRAM_NV
,
306 OPCODE_TRACK_MATRIX_NV
,
307 /* GL_NV_fragment_program */
308 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
309 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
310 /* GL_EXT_stencil_two_side */
311 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
312 /* GL_EXT_depth_bounds_test */
313 OPCODE_DEPTH_BOUNDS_EXT
,
314 /* GL_ARB_vertex/fragment_program */
315 OPCODE_PROGRAM_STRING_ARB
,
316 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
317 /* GL_ARB_occlusion_query */
318 OPCODE_BEGIN_QUERY_ARB
,
319 OPCODE_END_QUERY_ARB
,
320 /* GL_ARB_draw_buffers */
321 OPCODE_DRAW_BUFFERS_ARB
,
322 /* GL_ATI_fragment_shader */
323 OPCODE_TEX_BUMP_PARAMETER_ATI
,
324 /* GL_ATI_fragment_shader */
325 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
326 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
328 OPCODE_STENCIL_FUNC_SEPARATE
,
329 OPCODE_STENCIL_OP_SEPARATE
,
330 OPCODE_STENCIL_MASK_SEPARATE
,
332 /* GL_EXT_framebuffer_blit */
333 OPCODE_BLIT_FRAMEBUFFER
,
335 /* Vertex attributes -- fallback for when optimized display
336 * list build isn't active.
355 /* GL_EXT_provoking_vertex */
356 OPCODE_PROVOKING_VERTEX
,
358 /* The following three are meta instructions */
359 OPCODE_ERROR
, /* raise compiled-in error */
370 * Display list instructions are stored as sequences of "nodes". Nodes
371 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
372 * are linked together with a pointer.
374 * Each instruction in the display list is stored as a sequence of
375 * contiguous nodes in memory.
376 * Each node is the union of a variety of data types.
391 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
395 typedef union gl_dlist_node Node
;
399 * How many nodes to allocate at a time.
401 * \note Reduced now that we hold vertices etc. elsewhere.
403 #define BLOCK_SIZE 256
408 * Number of nodes of storage needed for each instruction.
409 * Sizes for dynamically allocated opcodes are stored in the context struct.
411 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
413 void mesa_print_display_list(GLuint list
);
416 /**********************************************************************/
417 /***** Private *****/
418 /**********************************************************************/
422 * Make an empty display list. This is used by glGenLists() to
423 * reserve display list IDs.
425 static struct gl_display_list
*
426 make_list(GLuint name
, GLuint count
)
428 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
430 dlist
->Head
= (Node
*) _mesa_malloc(sizeof(Node
) * count
);
431 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
437 * Lookup function to just encapsulate casting.
439 static INLINE
struct gl_display_list
*
440 lookup_list(GLcontext
*ctx
, GLuint list
)
442 return (struct gl_display_list
*)
443 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
449 * Delete the named display list, but don't remove from hash table.
450 * \param dlist - display list pointer
453 _mesa_delete_list(GLcontext
*ctx
, struct gl_display_list
*dlist
)
458 n
= block
= dlist
->Head
;
460 done
= block
? GL_FALSE
: GL_TRUE
;
463 /* check for extension opcodes first */
465 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
466 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
467 ctx
->ListExt
.Opcode
[i
].Destroy(ctx
, &n
[1]);
468 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
471 switch (n
[0].opcode
) {
472 /* for some commands, we need to free malloc'd memory */
474 _mesa_free(n
[6].data
);
475 n
+= InstSize
[n
[0].opcode
];
478 _mesa_free(n
[10].data
);
479 n
+= InstSize
[n
[0].opcode
];
481 case OPCODE_DRAW_PIXELS
:
482 _mesa_free(n
[5].data
);
483 n
+= InstSize
[n
[0].opcode
];
486 _mesa_free(n
[7].data
);
487 n
+= InstSize
[n
[0].opcode
];
489 case OPCODE_COLOR_TABLE
:
490 _mesa_free(n
[6].data
);
491 n
+= InstSize
[n
[0].opcode
];
493 case OPCODE_COLOR_SUB_TABLE
:
494 _mesa_free(n
[6].data
);
495 n
+= InstSize
[n
[0].opcode
];
497 case OPCODE_CONVOLUTION_FILTER_1D
:
498 _mesa_free(n
[6].data
);
499 n
+= InstSize
[n
[0].opcode
];
501 case OPCODE_CONVOLUTION_FILTER_2D
:
502 _mesa_free(n
[7].data
);
503 n
+= InstSize
[n
[0].opcode
];
505 case OPCODE_POLYGON_STIPPLE
:
506 _mesa_free(n
[1].data
);
507 n
+= InstSize
[n
[0].opcode
];
509 case OPCODE_TEX_IMAGE1D
:
510 _mesa_free(n
[8].data
);
511 n
+= InstSize
[n
[0].opcode
];
513 case OPCODE_TEX_IMAGE2D
:
514 _mesa_free(n
[9].data
);
515 n
+= InstSize
[n
[0].opcode
];
517 case OPCODE_TEX_IMAGE3D
:
518 _mesa_free(n
[10].data
);
519 n
+= InstSize
[n
[0].opcode
];
521 case OPCODE_TEX_SUB_IMAGE1D
:
522 _mesa_free(n
[7].data
);
523 n
+= InstSize
[n
[0].opcode
];
525 case OPCODE_TEX_SUB_IMAGE2D
:
526 _mesa_free(n
[9].data
);
527 n
+= InstSize
[n
[0].opcode
];
529 case OPCODE_TEX_SUB_IMAGE3D
:
530 _mesa_free(n
[11].data
);
531 n
+= InstSize
[n
[0].opcode
];
533 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
534 _mesa_free(n
[7].data
);
535 n
+= InstSize
[n
[0].opcode
];
537 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
538 _mesa_free(n
[8].data
);
539 n
+= InstSize
[n
[0].opcode
];
541 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
542 _mesa_free(n
[9].data
);
543 n
+= InstSize
[n
[0].opcode
];
545 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
546 _mesa_free(n
[7].data
);
547 n
+= InstSize
[n
[0].opcode
];
549 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
550 _mesa_free(n
[9].data
);
551 n
+= InstSize
[n
[0].opcode
];
553 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
554 _mesa_free(n
[11].data
);
555 n
+= InstSize
[n
[0].opcode
];
557 #if FEATURE_NV_vertex_program
558 case OPCODE_LOAD_PROGRAM_NV
:
559 _mesa_free(n
[4].data
); /* program string */
560 n
+= InstSize
[n
[0].opcode
];
562 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
563 _mesa_free(n
[2].data
); /* array of program ids */
564 n
+= InstSize
[n
[0].opcode
];
567 #if FEATURE_NV_fragment_program
568 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
569 _mesa_free(n
[3].data
); /* parameter name */
570 n
+= InstSize
[n
[0].opcode
];
573 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
574 case OPCODE_PROGRAM_STRING_ARB
:
575 _mesa_free(n
[4].data
); /* program string */
576 n
+= InstSize
[n
[0].opcode
];
579 case OPCODE_CONTINUE
:
580 n
= (Node
*) n
[1].next
;
584 case OPCODE_END_OF_LIST
:
589 /* Most frequent case */
590 n
+= InstSize
[n
[0].opcode
];
601 * Destroy a display list and remove from hash table.
602 * \param list - display list number
605 destroy_list(GLcontext
*ctx
, GLuint list
)
607 struct gl_display_list
*dlist
;
612 dlist
= lookup_list(ctx
, list
);
616 _mesa_delete_list(ctx
, dlist
);
617 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
622 * Translate the nth element of list from <type> to GLint.
625 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
637 bptr
= (GLbyte
*) list
;
638 return (GLint
) bptr
[n
];
639 case GL_UNSIGNED_BYTE
:
640 ubptr
= (GLubyte
*) list
;
641 return (GLint
) ubptr
[n
];
643 sptr
= (GLshort
*) list
;
644 return (GLint
) sptr
[n
];
645 case GL_UNSIGNED_SHORT
:
646 usptr
= (GLushort
*) list
;
647 return (GLint
) usptr
[n
];
649 iptr
= (GLint
*) list
;
651 case GL_UNSIGNED_INT
:
652 uiptr
= (GLuint
*) list
;
653 return (GLint
) uiptr
[n
];
655 fptr
= (GLfloat
*) list
;
656 return (GLint
) FLOORF(fptr
[n
]);
658 ubptr
= ((GLubyte
*) list
) + 2 * n
;
659 return (GLint
) ubptr
[0] * 256
662 ubptr
= ((GLubyte
*) list
) + 3 * n
;
663 return (GLint
) ubptr
[0] * 65536
664 + (GLint
) ubptr
[1] * 256
667 ubptr
= ((GLubyte
*) list
) + 4 * n
;
668 return (GLint
) ubptr
[0] * 16777216
669 + (GLint
) ubptr
[1] * 65536
670 + (GLint
) ubptr
[2] * 256
680 /**********************************************************************/
682 /**********************************************************************/
685 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
686 * \todo This won't suffice when the PBO is really in VRAM/GPU memory.
689 unpack_image(GLuint dimensions
, GLsizei width
, GLsizei height
, GLsizei depth
,
690 GLenum format
, GLenum type
, const GLvoid
* pixels
,
691 const struct gl_pixelstore_attrib
*unpack
)
693 if (unpack
->BufferObj
->Name
== 0) {
695 return _mesa_unpack_image(dimensions
, width
, height
, depth
, format
,
696 type
, pixels
, unpack
);
699 if (_mesa_validate_pbo_access
700 (dimensions
, unpack
, width
, height
, depth
, format
, type
, pixels
)) {
701 const GLubyte
*src
= ADD_POINTERS(unpack
->BufferObj
->Data
, pixels
);
702 return _mesa_unpack_image(dimensions
, width
, height
, depth
, format
,
711 * Allocate space for a display list instruction.
712 * \param opcode the instruction opcode (OPCODE_* value)
713 * \param bytes instruction size in bytes, not counting opcode.
714 * \return pointer to the usable data area (not including the internal
718 _mesa_alloc_instruction(GLcontext
*ctx
, GLuint opcode
, GLuint bytes
)
720 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
723 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
724 if (InstSize
[opcode
] == 0) {
725 /* save instruction size now */
726 InstSize
[opcode
] = numNodes
;
729 /* make sure instruction size agrees */
730 ASSERT(numNodes
== InstSize
[opcode
]);
734 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
735 /* This block is full. Allocate a new block and chain to it */
737 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
738 n
[0].opcode
= OPCODE_CONTINUE
;
739 newblock
= (Node
*) _mesa_malloc(sizeof(Node
) * BLOCK_SIZE
);
741 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
744 n
[1].next
= (Node
*) newblock
;
745 ctx
->ListState
.CurrentBlock
= newblock
;
746 ctx
->ListState
.CurrentPos
= 0;
749 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
750 ctx
->ListState
.CurrentPos
+= numNodes
;
752 n
[0].opcode
= (OpCode
) opcode
;
754 return (void *) (n
+ 1); /* return ptr to node following opcode */
759 * This function allows modules and drivers to get their own opcodes
760 * for extending display list functionality.
761 * \param ctx the rendering context
762 * \param size number of bytes for storing the new display list command
763 * \param execute function to execute the new display list command
764 * \param destroy function to destroy the new display list command
765 * \param print function to print the new display list command
766 * \return the new opcode number or -1 if error
769 _mesa_alloc_opcode(GLcontext
*ctx
,
771 void (*execute
) (GLcontext
*, void *),
772 void (*destroy
) (GLcontext
*, void *),
773 void (*print
) (GLcontext
*, void *))
775 if (ctx
->ListExt
.NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
776 const GLuint i
= ctx
->ListExt
.NumOpcodes
++;
777 ctx
->ListExt
.Opcode
[i
].Size
=
778 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
779 ctx
->ListExt
.Opcode
[i
].Execute
= execute
;
780 ctx
->ListExt
.Opcode
[i
].Destroy
= destroy
;
781 ctx
->ListExt
.Opcode
[i
].Print
= print
;
782 return i
+ OPCODE_EXT_0
;
790 * Allocate display list instruction. Returns Node ptr to where the opcode
792 * - nParams is the number of function parameters
793 * - return value a pointer to sizeof(Node) before the actual
796 #define ALLOC_INSTRUCTION(CTX, OPCODE, NPARAMS) \
797 ((Node *)_mesa_alloc_instruction(CTX, OPCODE, (NPARAMS)*sizeof(Node)) - 1)
802 * Display List compilation functions
804 static void GLAPIENTRY
805 save_Accum(GLenum op
, GLfloat value
)
807 GET_CURRENT_CONTEXT(ctx
);
809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
810 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACCUM
, 2);
815 if (ctx
->ExecuteFlag
) {
816 CALL_Accum(ctx
->Exec
, (op
, value
));
821 static void GLAPIENTRY
822 save_AlphaFunc(GLenum func
, GLclampf ref
)
824 GET_CURRENT_CONTEXT(ctx
);
826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
827 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ALPHA_FUNC
, 2);
830 n
[2].f
= (GLfloat
) ref
;
832 if (ctx
->ExecuteFlag
) {
833 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
838 static void GLAPIENTRY
839 save_BindTexture(GLenum target
, GLuint texture
)
841 GET_CURRENT_CONTEXT(ctx
);
843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
844 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_TEXTURE
, 2);
849 if (ctx
->ExecuteFlag
) {
850 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
855 static void GLAPIENTRY
856 save_Bitmap(GLsizei width
, GLsizei height
,
857 GLfloat xorig
, GLfloat yorig
,
858 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
860 GET_CURRENT_CONTEXT(ctx
);
861 GLvoid
*image
= _mesa_unpack_bitmap(width
, height
, pixels
, &ctx
->Unpack
);
863 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
864 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BITMAP
, 7);
866 n
[1].i
= (GLint
) width
;
867 n
[2].i
= (GLint
) height
;
877 if (ctx
->ExecuteFlag
) {
878 CALL_Bitmap(ctx
->Exec
, (width
, height
,
879 xorig
, yorig
, xmove
, ymove
, pixels
));
884 static void GLAPIENTRY
885 save_BlendEquation(GLenum mode
)
887 GET_CURRENT_CONTEXT(ctx
);
889 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
890 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_EQUATION
, 1);
894 if (ctx
->ExecuteFlag
) {
895 CALL_BlendEquation(ctx
->Exec
, (mode
));
900 static void GLAPIENTRY
901 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
903 GET_CURRENT_CONTEXT(ctx
);
905 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
906 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
911 if (ctx
->ExecuteFlag
) {
912 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
917 static void GLAPIENTRY
918 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
919 GLenum sfactorA
, GLenum dfactorA
)
921 GET_CURRENT_CONTEXT(ctx
);
923 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
924 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
931 if (ctx
->ExecuteFlag
) {
932 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
933 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
938 static void GLAPIENTRY
939 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
941 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
945 static void GLAPIENTRY
946 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
948 GET_CURRENT_CONTEXT(ctx
);
950 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
951 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLEND_COLOR
, 4);
958 if (ctx
->ExecuteFlag
) {
959 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
965 _mesa_save_CallList(GLuint list
)
967 GET_CURRENT_CONTEXT(ctx
);
969 SAVE_FLUSH_VERTICES(ctx
);
971 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CALL_LIST
, 1);
976 /* After this, we don't know what begin/end state we're in:
978 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
980 if (ctx
->ExecuteFlag
) {
981 _mesa_CallList(list
);
987 _mesa_save_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
989 GET_CURRENT_CONTEXT(ctx
);
991 GLboolean typeErrorFlag
;
993 SAVE_FLUSH_VERTICES(ctx
);
997 case GL_UNSIGNED_BYTE
:
999 case GL_UNSIGNED_SHORT
:
1001 case GL_UNSIGNED_INT
:
1006 typeErrorFlag
= GL_FALSE
;
1009 typeErrorFlag
= GL_TRUE
;
1012 for (i
= 0; i
< n
; i
++) {
1013 GLint list
= translate_id(i
, type
, lists
);
1014 Node
*n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1017 n
[2].b
= typeErrorFlag
;
1021 /* After this, we don't know what begin/end state we're in:
1023 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1025 if (ctx
->ExecuteFlag
) {
1026 CALL_CallLists(ctx
->Exec
, (n
, type
, lists
));
1031 static void GLAPIENTRY
1032 save_Clear(GLbitfield mask
)
1034 GET_CURRENT_CONTEXT(ctx
);
1036 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1037 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR
, 1);
1041 if (ctx
->ExecuteFlag
) {
1042 CALL_Clear(ctx
->Exec
, (mask
));
1047 static void GLAPIENTRY
1048 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1050 GET_CURRENT_CONTEXT(ctx
);
1052 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1053 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1060 if (ctx
->ExecuteFlag
) {
1061 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1066 static void GLAPIENTRY
1067 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1069 GET_CURRENT_CONTEXT(ctx
);
1071 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1072 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_COLOR
, 4);
1079 if (ctx
->ExecuteFlag
) {
1080 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1085 static void GLAPIENTRY
1086 save_ClearDepth(GLclampd depth
)
1088 GET_CURRENT_CONTEXT(ctx
);
1090 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1091 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1093 n
[1].f
= (GLfloat
) depth
;
1095 if (ctx
->ExecuteFlag
) {
1096 CALL_ClearDepth(ctx
->Exec
, (depth
));
1101 static void GLAPIENTRY
1102 save_ClearIndex(GLfloat c
)
1104 GET_CURRENT_CONTEXT(ctx
);
1106 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1107 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_INDEX
, 1);
1111 if (ctx
->ExecuteFlag
) {
1112 CALL_ClearIndex(ctx
->Exec
, (c
));
1117 static void GLAPIENTRY
1118 save_ClearStencil(GLint s
)
1120 GET_CURRENT_CONTEXT(ctx
);
1122 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1123 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1127 if (ctx
->ExecuteFlag
) {
1128 CALL_ClearStencil(ctx
->Exec
, (s
));
1133 static void GLAPIENTRY
1134 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1136 GET_CURRENT_CONTEXT(ctx
);
1138 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1139 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CLIP_PLANE
, 5);
1142 n
[2].f
= (GLfloat
) equ
[0];
1143 n
[3].f
= (GLfloat
) equ
[1];
1144 n
[4].f
= (GLfloat
) equ
[2];
1145 n
[5].f
= (GLfloat
) equ
[3];
1147 if (ctx
->ExecuteFlag
) {
1148 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1154 static void GLAPIENTRY
1155 save_ColorMask(GLboolean red
, GLboolean green
,
1156 GLboolean blue
, GLboolean alpha
)
1158 GET_CURRENT_CONTEXT(ctx
);
1160 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1161 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_MASK
, 4);
1168 if (ctx
->ExecuteFlag
) {
1169 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1174 static void GLAPIENTRY
1175 save_ColorMaterial(GLenum face
, GLenum mode
)
1177 GET_CURRENT_CONTEXT(ctx
);
1179 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1181 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1186 if (ctx
->ExecuteFlag
) {
1187 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1192 static void GLAPIENTRY
1193 save_ColorTable(GLenum target
, GLenum internalFormat
,
1194 GLsizei width
, GLenum format
, GLenum type
,
1195 const GLvoid
* table
)
1197 GET_CURRENT_CONTEXT(ctx
);
1198 if (_mesa_is_proxy_texture(target
)) {
1199 /* execute immediately */
1200 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1201 format
, type
, table
));
1204 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
, table
,
1207 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1208 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE
, 6);
1211 n
[2].e
= internalFormat
;
1220 if (ctx
->ExecuteFlag
) {
1221 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1222 format
, type
, table
));
1229 static void GLAPIENTRY
1230 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1231 const GLfloat
*params
)
1233 GET_CURRENT_CONTEXT(ctx
);
1236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1238 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1243 if (pname
== GL_COLOR_TABLE_SGI
||
1244 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1245 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1246 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1253 if (ctx
->ExecuteFlag
) {
1254 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1259 static void GLAPIENTRY
1260 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1262 GET_CURRENT_CONTEXT(ctx
);
1265 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1267 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1272 if (pname
== GL_COLOR_TABLE_SGI
||
1273 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1274 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1275 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1282 if (ctx
->ExecuteFlag
) {
1283 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1289 static void GLAPIENTRY
1290 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1291 GLenum format
, GLenum type
, const GLvoid
* table
)
1293 GET_CURRENT_CONTEXT(ctx
);
1294 GLvoid
*image
= unpack_image(1, count
, 1, 1, format
, type
, table
,
1297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1298 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1310 if (ctx
->ExecuteFlag
) {
1311 CALL_ColorSubTable(ctx
->Exec
,
1312 (target
, start
, count
, format
, type
, table
));
1317 static void GLAPIENTRY
1318 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1319 GLint x
, GLint y
, GLsizei width
)
1321 GET_CURRENT_CONTEXT(ctx
);
1324 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1325 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1333 if (ctx
->ExecuteFlag
) {
1334 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1339 static void GLAPIENTRY
1340 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1341 GLint x
, GLint y
, GLsizei width
)
1343 GET_CURRENT_CONTEXT(ctx
);
1346 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1347 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1350 n
[2].e
= internalformat
;
1355 if (ctx
->ExecuteFlag
) {
1356 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1361 static void GLAPIENTRY
1362 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1363 GLenum format
, GLenum type
, const GLvoid
* filter
)
1365 GET_CURRENT_CONTEXT(ctx
);
1366 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
, filter
,
1369 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1370 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1373 n
[2].e
= internalFormat
;
1382 if (ctx
->ExecuteFlag
) {
1383 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1384 format
, type
, filter
));
1389 static void GLAPIENTRY
1390 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1391 GLsizei width
, GLsizei height
, GLenum format
,
1392 GLenum type
, const GLvoid
* filter
)
1394 GET_CURRENT_CONTEXT(ctx
);
1395 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
, filter
,
1398 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1399 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1402 n
[2].e
= internalFormat
;
1412 if (ctx
->ExecuteFlag
) {
1413 CALL_ConvolutionFilter2D(ctx
->Exec
,
1414 (target
, internalFormat
, width
, height
, format
,
1420 static void GLAPIENTRY
1421 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1423 GET_CURRENT_CONTEXT(ctx
);
1425 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1426 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1432 if (ctx
->ExecuteFlag
) {
1433 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1438 static void GLAPIENTRY
1439 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1441 GET_CURRENT_CONTEXT(ctx
);
1443 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1444 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1449 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1450 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1451 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1457 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1460 if (ctx
->ExecuteFlag
) {
1461 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1466 static void GLAPIENTRY
1467 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1469 GET_CURRENT_CONTEXT(ctx
);
1471 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1472 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
1478 if (ctx
->ExecuteFlag
) {
1479 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
1484 static void GLAPIENTRY
1485 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
1486 const GLfloat
*params
)
1488 GET_CURRENT_CONTEXT(ctx
);
1490 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1491 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
1496 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1497 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1498 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1504 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1507 if (ctx
->ExecuteFlag
) {
1508 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
1513 static void GLAPIENTRY
1514 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1516 GET_CURRENT_CONTEXT(ctx
);
1518 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1519 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_PIXELS
, 5);
1523 n
[3].i
= (GLint
) width
;
1524 n
[4].i
= (GLint
) height
;
1527 if (ctx
->ExecuteFlag
) {
1528 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1534 static void GLAPIENTRY
1535 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1536 GLint x
, GLint y
, GLsizei width
, GLint border
)
1538 GET_CURRENT_CONTEXT(ctx
);
1540 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1541 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1545 n
[3].e
= internalformat
;
1551 if (ctx
->ExecuteFlag
) {
1552 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1553 x
, y
, width
, border
));
1558 static void GLAPIENTRY
1559 save_CopyTexImage2D(GLenum target
, GLint level
,
1560 GLenum internalformat
,
1561 GLint x
, GLint y
, GLsizei width
,
1562 GLsizei height
, GLint border
)
1564 GET_CURRENT_CONTEXT(ctx
);
1566 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1567 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1571 n
[3].e
= internalformat
;
1578 if (ctx
->ExecuteFlag
) {
1579 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1580 x
, y
, width
, height
, border
));
1586 static void GLAPIENTRY
1587 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1588 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1590 GET_CURRENT_CONTEXT(ctx
);
1592 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1593 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1602 if (ctx
->ExecuteFlag
) {
1603 CALL_CopyTexSubImage1D(ctx
->Exec
,
1604 (target
, level
, xoffset
, x
, y
, width
));
1609 static void GLAPIENTRY
1610 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1611 GLint xoffset
, GLint yoffset
,
1612 GLint x
, GLint y
, GLsizei width
, GLint height
)
1614 GET_CURRENT_CONTEXT(ctx
);
1616 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1617 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1628 if (ctx
->ExecuteFlag
) {
1629 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1630 x
, y
, width
, height
));
1635 static void GLAPIENTRY
1636 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1637 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1638 GLint x
, GLint y
, GLsizei width
, GLint height
)
1640 GET_CURRENT_CONTEXT(ctx
);
1642 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1643 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1655 if (ctx
->ExecuteFlag
) {
1656 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1657 xoffset
, yoffset
, zoffset
,
1658 x
, y
, width
, height
));
1663 static void GLAPIENTRY
1664 save_CullFace(GLenum mode
)
1666 GET_CURRENT_CONTEXT(ctx
);
1668 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1669 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_CULL_FACE
, 1);
1673 if (ctx
->ExecuteFlag
) {
1674 CALL_CullFace(ctx
->Exec
, (mode
));
1679 static void GLAPIENTRY
1680 save_DepthFunc(GLenum func
)
1682 GET_CURRENT_CONTEXT(ctx
);
1684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1685 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_FUNC
, 1);
1689 if (ctx
->ExecuteFlag
) {
1690 CALL_DepthFunc(ctx
->Exec
, (func
));
1695 static void GLAPIENTRY
1696 save_DepthMask(GLboolean mask
)
1698 GET_CURRENT_CONTEXT(ctx
);
1700 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1701 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_MASK
, 1);
1705 if (ctx
->ExecuteFlag
) {
1706 CALL_DepthMask(ctx
->Exec
, (mask
));
1711 static void GLAPIENTRY
1712 save_DepthRange(GLclampd nearval
, GLclampd farval
)
1714 GET_CURRENT_CONTEXT(ctx
);
1716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1717 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_RANGE
, 2);
1719 n
[1].f
= (GLfloat
) nearval
;
1720 n
[2].f
= (GLfloat
) farval
;
1722 if (ctx
->ExecuteFlag
) {
1723 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
1728 static void GLAPIENTRY
1729 save_Disable(GLenum cap
)
1731 GET_CURRENT_CONTEXT(ctx
);
1733 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1734 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DISABLE
, 1);
1738 if (ctx
->ExecuteFlag
) {
1739 CALL_Disable(ctx
->Exec
, (cap
));
1744 static void GLAPIENTRY
1745 save_DrawBuffer(GLenum mode
)
1747 GET_CURRENT_CONTEXT(ctx
);
1749 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1750 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFER
, 1);
1754 if (ctx
->ExecuteFlag
) {
1755 CALL_DrawBuffer(ctx
->Exec
, (mode
));
1760 static void GLAPIENTRY
1761 save_DrawPixels(GLsizei width
, GLsizei height
,
1762 GLenum format
, GLenum type
, const GLvoid
* pixels
)
1764 GET_CURRENT_CONTEXT(ctx
);
1765 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
1766 pixels
, &ctx
->Unpack
);
1768 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1769 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_PIXELS
, 5);
1780 if (ctx
->ExecuteFlag
) {
1781 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
1787 static void GLAPIENTRY
1788 save_Enable(GLenum cap
)
1790 GET_CURRENT_CONTEXT(ctx
);
1792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1793 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ENABLE
, 1);
1797 if (ctx
->ExecuteFlag
) {
1798 CALL_Enable(ctx
->Exec
, (cap
));
1804 static void GLAPIENTRY
1805 _mesa_save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
1807 GET_CURRENT_CONTEXT(ctx
);
1809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1810 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVALMESH1
, 3);
1816 if (ctx
->ExecuteFlag
) {
1817 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
1822 static void GLAPIENTRY
1823 _mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1825 GET_CURRENT_CONTEXT(ctx
);
1827 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1828 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVALMESH2
, 5);
1836 if (ctx
->ExecuteFlag
) {
1837 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
1844 static void GLAPIENTRY
1845 save_Fogfv(GLenum pname
, const GLfloat
*params
)
1847 GET_CURRENT_CONTEXT(ctx
);
1849 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1850 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FOG
, 5);
1858 if (ctx
->ExecuteFlag
) {
1859 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
1864 static void GLAPIENTRY
1865 save_Fogf(GLenum pname
, GLfloat param
)
1867 save_Fogfv(pname
, ¶m
);
1871 static void GLAPIENTRY
1872 save_Fogiv(GLenum pname
, const GLint
*params
)
1877 case GL_FOG_DENSITY
:
1881 p
[0] = (GLfloat
) *params
;
1884 p
[0] = INT_TO_FLOAT(params
[0]);
1885 p
[1] = INT_TO_FLOAT(params
[1]);
1886 p
[2] = INT_TO_FLOAT(params
[2]);
1887 p
[3] = INT_TO_FLOAT(params
[3]);
1890 /* Error will be caught later in gl_Fogfv */
1893 save_Fogfv(pname
, p
);
1897 static void GLAPIENTRY
1898 save_Fogi(GLenum pname
, GLint param
)
1900 save_Fogiv(pname
, ¶m
);
1904 static void GLAPIENTRY
1905 save_FrontFace(GLenum mode
)
1907 GET_CURRENT_CONTEXT(ctx
);
1909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1910 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FRONT_FACE
, 1);
1914 if (ctx
->ExecuteFlag
) {
1915 CALL_FrontFace(ctx
->Exec
, (mode
));
1920 static void GLAPIENTRY
1921 save_Frustum(GLdouble left
, GLdouble right
,
1922 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
1924 GET_CURRENT_CONTEXT(ctx
);
1926 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1927 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_FRUSTUM
, 6);
1929 n
[1].f
= (GLfloat
) left
;
1930 n
[2].f
= (GLfloat
) right
;
1931 n
[3].f
= (GLfloat
) bottom
;
1932 n
[4].f
= (GLfloat
) top
;
1933 n
[5].f
= (GLfloat
) nearval
;
1934 n
[6].f
= (GLfloat
) farval
;
1936 if (ctx
->ExecuteFlag
) {
1937 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
1942 static void GLAPIENTRY
1943 save_Hint(GLenum target
, GLenum mode
)
1945 GET_CURRENT_CONTEXT(ctx
);
1947 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1948 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_HINT
, 2);
1953 if (ctx
->ExecuteFlag
) {
1954 CALL_Hint(ctx
->Exec
, (target
, mode
));
1959 static void GLAPIENTRY
1960 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
1963 GET_CURRENT_CONTEXT(ctx
);
1966 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1967 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_HISTOGRAM
, 4);
1971 n
[3].e
= internalFormat
;
1974 if (ctx
->ExecuteFlag
) {
1975 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
1980 static void GLAPIENTRY
1981 save_IndexMask(GLuint mask
)
1983 GET_CURRENT_CONTEXT(ctx
);
1985 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1986 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_INDEX_MASK
, 1);
1990 if (ctx
->ExecuteFlag
) {
1991 CALL_IndexMask(ctx
->Exec
, (mask
));
1996 static void GLAPIENTRY
1997 save_InitNames(void)
1999 GET_CURRENT_CONTEXT(ctx
);
2000 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2001 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_INIT_NAMES
, 0);
2002 if (ctx
->ExecuteFlag
) {
2003 CALL_InitNames(ctx
->Exec
, ());
2008 static void GLAPIENTRY
2009 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2011 GET_CURRENT_CONTEXT(ctx
);
2013 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2014 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIGHT
, 6);
2032 case GL_SPOT_DIRECTION
:
2035 case GL_SPOT_EXPONENT
:
2038 case GL_SPOT_CUTOFF
:
2041 case GL_CONSTANT_ATTENUATION
:
2044 case GL_LINEAR_ATTENUATION
:
2047 case GL_QUADRATIC_ATTENUATION
:
2053 for (i
= 0; i
< nParams
; i
++) {
2054 n
[3 + i
].f
= params
[i
];
2057 if (ctx
->ExecuteFlag
) {
2058 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2063 static void GLAPIENTRY
2064 save_Lightf(GLenum light
, GLenum pname
, GLfloat params
)
2066 save_Lightfv(light
, pname
, ¶ms
);
2070 static void GLAPIENTRY
2071 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2078 fparam
[0] = INT_TO_FLOAT(params
[0]);
2079 fparam
[1] = INT_TO_FLOAT(params
[1]);
2080 fparam
[2] = INT_TO_FLOAT(params
[2]);
2081 fparam
[3] = INT_TO_FLOAT(params
[3]);
2084 fparam
[0] = (GLfloat
) params
[0];
2085 fparam
[1] = (GLfloat
) params
[1];
2086 fparam
[2] = (GLfloat
) params
[2];
2087 fparam
[3] = (GLfloat
) params
[3];
2089 case GL_SPOT_DIRECTION
:
2090 fparam
[0] = (GLfloat
) params
[0];
2091 fparam
[1] = (GLfloat
) params
[1];
2092 fparam
[2] = (GLfloat
) params
[2];
2094 case GL_SPOT_EXPONENT
:
2095 case GL_SPOT_CUTOFF
:
2096 case GL_CONSTANT_ATTENUATION
:
2097 case GL_LINEAR_ATTENUATION
:
2098 case GL_QUADRATIC_ATTENUATION
:
2099 fparam
[0] = (GLfloat
) params
[0];
2102 /* error will be caught later in gl_Lightfv */
2105 save_Lightfv(light
, pname
, fparam
);
2109 static void GLAPIENTRY
2110 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2112 save_Lightiv(light
, pname
, ¶m
);
2116 static void GLAPIENTRY
2117 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2119 GET_CURRENT_CONTEXT(ctx
);
2121 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2122 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIGHT_MODEL
, 5);
2130 if (ctx
->ExecuteFlag
) {
2131 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2136 static void GLAPIENTRY
2137 save_LightModelf(GLenum pname
, GLfloat param
)
2139 save_LightModelfv(pname
, ¶m
);
2143 static void GLAPIENTRY
2144 save_LightModeliv(GLenum pname
, const GLint
*params
)
2148 case GL_LIGHT_MODEL_AMBIENT
:
2149 fparam
[0] = INT_TO_FLOAT(params
[0]);
2150 fparam
[1] = INT_TO_FLOAT(params
[1]);
2151 fparam
[2] = INT_TO_FLOAT(params
[2]);
2152 fparam
[3] = INT_TO_FLOAT(params
[3]);
2154 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2155 case GL_LIGHT_MODEL_TWO_SIDE
:
2156 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2157 fparam
[0] = (GLfloat
) params
[0];
2160 /* Error will be caught later in gl_LightModelfv */
2163 save_LightModelfv(pname
, fparam
);
2167 static void GLAPIENTRY
2168 save_LightModeli(GLenum pname
, GLint param
)
2170 save_LightModeliv(pname
, ¶m
);
2174 static void GLAPIENTRY
2175 save_LineStipple(GLint factor
, GLushort pattern
)
2177 GET_CURRENT_CONTEXT(ctx
);
2179 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2180 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LINE_STIPPLE
, 2);
2185 if (ctx
->ExecuteFlag
) {
2186 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2191 static void GLAPIENTRY
2192 save_LineWidth(GLfloat width
)
2194 GET_CURRENT_CONTEXT(ctx
);
2196 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2197 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LINE_WIDTH
, 1);
2201 if (ctx
->ExecuteFlag
) {
2202 CALL_LineWidth(ctx
->Exec
, (width
));
2207 static void GLAPIENTRY
2208 save_ListBase(GLuint base
)
2210 GET_CURRENT_CONTEXT(ctx
);
2212 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2213 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LIST_BASE
, 1);
2217 if (ctx
->ExecuteFlag
) {
2218 CALL_ListBase(ctx
->Exec
, (base
));
2223 static void GLAPIENTRY
2224 save_LoadIdentity(void)
2226 GET_CURRENT_CONTEXT(ctx
);
2227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2228 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2229 if (ctx
->ExecuteFlag
) {
2230 CALL_LoadIdentity(ctx
->Exec
, ());
2235 static void GLAPIENTRY
2236 save_LoadMatrixf(const GLfloat
* m
)
2238 GET_CURRENT_CONTEXT(ctx
);
2240 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2241 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_MATRIX
, 16);
2244 for (i
= 0; i
< 16; i
++) {
2248 if (ctx
->ExecuteFlag
) {
2249 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2254 static void GLAPIENTRY
2255 save_LoadMatrixd(const GLdouble
* m
)
2259 for (i
= 0; i
< 16; i
++) {
2260 f
[i
] = (GLfloat
) m
[i
];
2262 save_LoadMatrixf(f
);
2266 static void GLAPIENTRY
2267 save_LoadName(GLuint name
)
2269 GET_CURRENT_CONTEXT(ctx
);
2271 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2272 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_NAME
, 1);
2276 if (ctx
->ExecuteFlag
) {
2277 CALL_LoadName(ctx
->Exec
, (name
));
2282 static void GLAPIENTRY
2283 save_LogicOp(GLenum opcode
)
2285 GET_CURRENT_CONTEXT(ctx
);
2287 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2288 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOGIC_OP
, 1);
2292 if (ctx
->ExecuteFlag
) {
2293 CALL_LogicOp(ctx
->Exec
, (opcode
));
2298 static void GLAPIENTRY
2299 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2300 GLint order
, const GLdouble
* points
)
2302 GET_CURRENT_CONTEXT(ctx
);
2304 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2305 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP1
, 6);
2307 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2309 n
[2].f
= (GLfloat
) u1
;
2310 n
[3].f
= (GLfloat
) u2
;
2311 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2313 n
[6].data
= (void *) pnts
;
2315 if (ctx
->ExecuteFlag
) {
2316 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2320 static void GLAPIENTRY
2321 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2322 GLint order
, const GLfloat
* points
)
2324 GET_CURRENT_CONTEXT(ctx
);
2326 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2327 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP1
, 6);
2329 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2333 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2335 n
[6].data
= (void *) pnts
;
2337 if (ctx
->ExecuteFlag
) {
2338 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2343 static void GLAPIENTRY
2344 save_Map2d(GLenum target
,
2345 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2346 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2347 const GLdouble
* points
)
2349 GET_CURRENT_CONTEXT(ctx
);
2351 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2352 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP2
, 10);
2354 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2355 vstride
, vorder
, points
);
2357 n
[2].f
= (GLfloat
) u1
;
2358 n
[3].f
= (GLfloat
) u2
;
2359 n
[4].f
= (GLfloat
) v1
;
2360 n
[5].f
= (GLfloat
) v2
;
2361 /* XXX verify these strides are correct */
2362 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2363 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2366 n
[10].data
= (void *) pnts
;
2368 if (ctx
->ExecuteFlag
) {
2369 CALL_Map2d(ctx
->Exec
, (target
,
2370 u1
, u2
, ustride
, uorder
,
2371 v1
, v2
, vstride
, vorder
, points
));
2376 static void GLAPIENTRY
2377 save_Map2f(GLenum target
,
2378 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2379 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2380 const GLfloat
* points
)
2382 GET_CURRENT_CONTEXT(ctx
);
2384 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2385 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAP2
, 10);
2387 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2388 vstride
, vorder
, points
);
2394 /* XXX verify these strides are correct */
2395 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2396 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2399 n
[10].data
= (void *) pnts
;
2401 if (ctx
->ExecuteFlag
) {
2402 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2403 v1
, v2
, vstride
, vorder
, points
));
2408 static void GLAPIENTRY
2409 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2411 GET_CURRENT_CONTEXT(ctx
);
2413 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2414 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAPGRID1
, 3);
2420 if (ctx
->ExecuteFlag
) {
2421 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2426 static void GLAPIENTRY
2427 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2429 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2433 static void GLAPIENTRY
2434 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2435 GLint vn
, GLfloat v1
, GLfloat v2
)
2437 GET_CURRENT_CONTEXT(ctx
);
2439 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2440 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MAPGRID2
, 6);
2449 if (ctx
->ExecuteFlag
) {
2450 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2456 static void GLAPIENTRY
2457 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2458 GLint vn
, GLdouble v1
, GLdouble v2
)
2460 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2461 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2465 static void GLAPIENTRY
2466 save_MatrixMode(GLenum mode
)
2468 GET_CURRENT_CONTEXT(ctx
);
2470 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2471 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATRIX_MODE
, 1);
2475 if (ctx
->ExecuteFlag
) {
2476 CALL_MatrixMode(ctx
->Exec
, (mode
));
2481 static void GLAPIENTRY
2482 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2484 GET_CURRENT_CONTEXT(ctx
);
2487 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2488 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MIN_MAX
, 3);
2491 n
[2].e
= internalFormat
;
2494 if (ctx
->ExecuteFlag
) {
2495 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
2500 static void GLAPIENTRY
2501 save_MultMatrixf(const GLfloat
* m
)
2503 GET_CURRENT_CONTEXT(ctx
);
2505 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2506 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MULT_MATRIX
, 16);
2509 for (i
= 0; i
< 16; i
++) {
2513 if (ctx
->ExecuteFlag
) {
2514 CALL_MultMatrixf(ctx
->Exec
, (m
));
2519 static void GLAPIENTRY
2520 save_MultMatrixd(const GLdouble
* m
)
2524 for (i
= 0; i
< 16; i
++) {
2525 f
[i
] = (GLfloat
) m
[i
];
2527 save_MultMatrixf(f
);
2531 static void GLAPIENTRY
2532 save_NewList(GLuint name
, GLenum mode
)
2534 GET_CURRENT_CONTEXT(ctx
);
2535 /* It's an error to call this function while building a display list */
2536 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2543 static void GLAPIENTRY
2544 save_Ortho(GLdouble left
, GLdouble right
,
2545 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2547 GET_CURRENT_CONTEXT(ctx
);
2549 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2550 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ORTHO
, 6);
2552 n
[1].f
= (GLfloat
) left
;
2553 n
[2].f
= (GLfloat
) right
;
2554 n
[3].f
= (GLfloat
) bottom
;
2555 n
[4].f
= (GLfloat
) top
;
2556 n
[5].f
= (GLfloat
) nearval
;
2557 n
[6].f
= (GLfloat
) farval
;
2559 if (ctx
->ExecuteFlag
) {
2560 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2565 static void GLAPIENTRY
2566 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2568 GET_CURRENT_CONTEXT(ctx
);
2570 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2571 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_MAP
, 3);
2575 n
[3].data
= (void *) _mesa_malloc(mapsize
* sizeof(GLfloat
));
2576 MEMCPY(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
2578 if (ctx
->ExecuteFlag
) {
2579 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2584 static void GLAPIENTRY
2585 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2587 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2589 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2590 for (i
= 0; i
< mapsize
; i
++) {
2591 fvalues
[i
] = (GLfloat
) values
[i
];
2595 for (i
= 0; i
< mapsize
; i
++) {
2596 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2599 save_PixelMapfv(map
, mapsize
, fvalues
);
2603 static void GLAPIENTRY
2604 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2606 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2608 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2609 for (i
= 0; i
< mapsize
; i
++) {
2610 fvalues
[i
] = (GLfloat
) values
[i
];
2614 for (i
= 0; i
< mapsize
; i
++) {
2615 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
2618 save_PixelMapfv(map
, mapsize
, fvalues
);
2622 static void GLAPIENTRY
2623 save_PixelTransferf(GLenum pname
, GLfloat param
)
2625 GET_CURRENT_CONTEXT(ctx
);
2627 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2628 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2633 if (ctx
->ExecuteFlag
) {
2634 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
2639 static void GLAPIENTRY
2640 save_PixelTransferi(GLenum pname
, GLint param
)
2642 save_PixelTransferf(pname
, (GLfloat
) param
);
2646 static void GLAPIENTRY
2647 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
2649 GET_CURRENT_CONTEXT(ctx
);
2651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2652 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PIXEL_ZOOM
, 2);
2657 if (ctx
->ExecuteFlag
) {
2658 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
2663 static void GLAPIENTRY
2664 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
2666 GET_CURRENT_CONTEXT(ctx
);
2668 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2669 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POINT_PARAMETERS
, 4);
2676 if (ctx
->ExecuteFlag
) {
2677 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
2682 static void GLAPIENTRY
2683 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
2685 save_PointParameterfvEXT(pname
, ¶m
);
2688 static void GLAPIENTRY
2689 save_PointParameteriNV(GLenum pname
, GLint param
)
2691 GLfloat p
= (GLfloat
) param
;
2692 save_PointParameterfvEXT(pname
, &p
);
2695 static void GLAPIENTRY
2696 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
2698 GLfloat p
= (GLfloat
) param
[0];
2699 save_PointParameterfvEXT(pname
, &p
);
2703 static void GLAPIENTRY
2704 save_PointSize(GLfloat size
)
2706 GET_CURRENT_CONTEXT(ctx
);
2708 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2709 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POINT_SIZE
, 1);
2713 if (ctx
->ExecuteFlag
) {
2714 CALL_PointSize(ctx
->Exec
, (size
));
2719 static void GLAPIENTRY
2720 save_PolygonMode(GLenum face
, GLenum mode
)
2722 GET_CURRENT_CONTEXT(ctx
);
2724 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2725 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_MODE
, 2);
2730 if (ctx
->ExecuteFlag
) {
2731 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
2736 static void GLAPIENTRY
2737 save_PolygonStipple(const GLubyte
* pattern
)
2739 GET_CURRENT_CONTEXT(ctx
);
2740 GLvoid
*image
= unpack_image(2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
2741 pattern
, &ctx
->Unpack
);
2743 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2744 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
2751 if (ctx
->ExecuteFlag
) {
2752 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
2757 static void GLAPIENTRY
2758 save_PolygonOffset(GLfloat factor
, GLfloat units
)
2760 GET_CURRENT_CONTEXT(ctx
);
2762 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2763 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_POLYGON_OFFSET
, 2);
2768 if (ctx
->ExecuteFlag
) {
2769 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
2774 static void GLAPIENTRY
2775 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
2777 GET_CURRENT_CONTEXT(ctx
);
2778 /* XXX mult by DepthMaxF here??? */
2779 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
2783 static void GLAPIENTRY
2784 save_PopAttrib(void)
2786 GET_CURRENT_CONTEXT(ctx
);
2787 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2788 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_ATTRIB
, 0);
2789 if (ctx
->ExecuteFlag
) {
2790 CALL_PopAttrib(ctx
->Exec
, ());
2795 static void GLAPIENTRY
2796 save_PopMatrix(void)
2798 GET_CURRENT_CONTEXT(ctx
);
2799 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2800 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_MATRIX
, 0);
2801 if (ctx
->ExecuteFlag
) {
2802 CALL_PopMatrix(ctx
->Exec
, ());
2807 static void GLAPIENTRY
2810 GET_CURRENT_CONTEXT(ctx
);
2811 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2812 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_POP_NAME
, 0);
2813 if (ctx
->ExecuteFlag
) {
2814 CALL_PopName(ctx
->Exec
, ());
2819 static void GLAPIENTRY
2820 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
2821 const GLclampf
* priorities
)
2823 GET_CURRENT_CONTEXT(ctx
);
2825 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2827 for (i
= 0; i
< num
; i
++) {
2829 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
2831 n
[1].ui
= textures
[i
];
2832 n
[2].f
= priorities
[i
];
2835 if (ctx
->ExecuteFlag
) {
2836 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
2841 static void GLAPIENTRY
2842 save_PushAttrib(GLbitfield mask
)
2844 GET_CURRENT_CONTEXT(ctx
);
2846 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2847 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_ATTRIB
, 1);
2851 if (ctx
->ExecuteFlag
) {
2852 CALL_PushAttrib(ctx
->Exec
, (mask
));
2857 static void GLAPIENTRY
2858 save_PushMatrix(void)
2860 GET_CURRENT_CONTEXT(ctx
);
2861 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2862 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_MATRIX
, 0);
2863 if (ctx
->ExecuteFlag
) {
2864 CALL_PushMatrix(ctx
->Exec
, ());
2869 static void GLAPIENTRY
2870 save_PushName(GLuint name
)
2872 GET_CURRENT_CONTEXT(ctx
);
2874 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2875 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PUSH_NAME
, 1);
2879 if (ctx
->ExecuteFlag
) {
2880 CALL_PushName(ctx
->Exec
, (name
));
2885 static void GLAPIENTRY
2886 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2888 GET_CURRENT_CONTEXT(ctx
);
2890 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2891 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RASTER_POS
, 4);
2898 if (ctx
->ExecuteFlag
) {
2899 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
2903 static void GLAPIENTRY
2904 save_RasterPos2d(GLdouble x
, GLdouble y
)
2906 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2909 static void GLAPIENTRY
2910 save_RasterPos2f(GLfloat x
, GLfloat y
)
2912 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2915 static void GLAPIENTRY
2916 save_RasterPos2i(GLint x
, GLint y
)
2918 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2921 static void GLAPIENTRY
2922 save_RasterPos2s(GLshort x
, GLshort y
)
2924 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2927 static void GLAPIENTRY
2928 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2930 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2933 static void GLAPIENTRY
2934 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2936 save_RasterPos4f(x
, y
, z
, 1.0F
);
2939 static void GLAPIENTRY
2940 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2942 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2945 static void GLAPIENTRY
2946 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2948 save_RasterPos4f(x
, y
, z
, 1.0F
);
2951 static void GLAPIENTRY
2952 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2954 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2957 static void GLAPIENTRY
2958 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
2960 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2963 static void GLAPIENTRY
2964 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
2966 save_RasterPos4f(x
, y
, z
, w
);
2969 static void GLAPIENTRY
2970 save_RasterPos2dv(const GLdouble
* v
)
2972 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2975 static void GLAPIENTRY
2976 save_RasterPos2fv(const GLfloat
* v
)
2978 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2981 static void GLAPIENTRY
2982 save_RasterPos2iv(const GLint
* v
)
2984 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2987 static void GLAPIENTRY
2988 save_RasterPos2sv(const GLshort
* v
)
2990 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2993 static void GLAPIENTRY
2994 save_RasterPos3dv(const GLdouble
* v
)
2996 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2999 static void GLAPIENTRY
3000 save_RasterPos3fv(const GLfloat
* v
)
3002 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3005 static void GLAPIENTRY
3006 save_RasterPos3iv(const GLint
* v
)
3008 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3011 static void GLAPIENTRY
3012 save_RasterPos3sv(const GLshort
* v
)
3014 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3017 static void GLAPIENTRY
3018 save_RasterPos4dv(const GLdouble
* v
)
3020 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3021 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3024 static void GLAPIENTRY
3025 save_RasterPos4fv(const GLfloat
* v
)
3027 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3030 static void GLAPIENTRY
3031 save_RasterPos4iv(const GLint
* v
)
3033 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3034 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3037 static void GLAPIENTRY
3038 save_RasterPos4sv(const GLshort
* v
)
3040 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3044 static void GLAPIENTRY
3045 save_PassThrough(GLfloat token
)
3047 GET_CURRENT_CONTEXT(ctx
);
3049 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3050 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PASSTHROUGH
, 1);
3054 if (ctx
->ExecuteFlag
) {
3055 CALL_PassThrough(ctx
->Exec
, (token
));
3060 static void GLAPIENTRY
3061 save_ReadBuffer(GLenum mode
)
3063 GET_CURRENT_CONTEXT(ctx
);
3065 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3066 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_READ_BUFFER
, 1);
3070 if (ctx
->ExecuteFlag
) {
3071 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3076 static void GLAPIENTRY
3077 save_ResetHistogram(GLenum target
)
3079 GET_CURRENT_CONTEXT(ctx
);
3081 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3082 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3086 if (ctx
->ExecuteFlag
) {
3087 CALL_ResetHistogram(ctx
->Exec
, (target
));
3092 static void GLAPIENTRY
3093 save_ResetMinmax(GLenum target
)
3095 GET_CURRENT_CONTEXT(ctx
);
3097 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3098 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3102 if (ctx
->ExecuteFlag
) {
3103 CALL_ResetMinmax(ctx
->Exec
, (target
));
3108 static void GLAPIENTRY
3109 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3111 GET_CURRENT_CONTEXT(ctx
);
3113 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3114 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ROTATE
, 4);
3121 if (ctx
->ExecuteFlag
) {
3122 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3127 static void GLAPIENTRY
3128 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3130 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3134 static void GLAPIENTRY
3135 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3137 GET_CURRENT_CONTEXT(ctx
);
3139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3140 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCALE
, 3);
3146 if (ctx
->ExecuteFlag
) {
3147 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3152 static void GLAPIENTRY
3153 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3155 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3159 static void GLAPIENTRY
3160 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3162 GET_CURRENT_CONTEXT(ctx
);
3164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3165 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SCISSOR
, 4);
3172 if (ctx
->ExecuteFlag
) {
3173 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3178 static void GLAPIENTRY
3179 save_ShadeModel(GLenum mode
)
3181 GET_CURRENT_CONTEXT(ctx
);
3183 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3184 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SHADE_MODEL
, 1);
3188 if (ctx
->ExecuteFlag
) {
3189 CALL_ShadeModel(ctx
->Exec
, (mode
));
3194 static void GLAPIENTRY
3195 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3197 GET_CURRENT_CONTEXT(ctx
);
3199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3200 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC
, 3);
3206 if (ctx
->ExecuteFlag
) {
3207 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3212 static void GLAPIENTRY
3213 save_StencilMask(GLuint mask
)
3215 GET_CURRENT_CONTEXT(ctx
);
3217 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3218 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK
, 1);
3222 if (ctx
->ExecuteFlag
) {
3223 CALL_StencilMask(ctx
->Exec
, (mask
));
3228 static void GLAPIENTRY
3229 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3231 GET_CURRENT_CONTEXT(ctx
);
3233 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3234 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP
, 3);
3240 if (ctx
->ExecuteFlag
) {
3241 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3246 static void GLAPIENTRY
3247 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3249 GET_CURRENT_CONTEXT(ctx
);
3251 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3252 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3259 if (ctx
->ExecuteFlag
) {
3260 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3265 static void GLAPIENTRY
3266 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3269 GET_CURRENT_CONTEXT(ctx
);
3271 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3273 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3281 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3288 if (ctx
->ExecuteFlag
) {
3289 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3290 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3295 static void GLAPIENTRY
3296 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3298 GET_CURRENT_CONTEXT(ctx
);
3300 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3301 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3306 if (ctx
->ExecuteFlag
) {
3307 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3312 static void GLAPIENTRY
3313 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3315 GET_CURRENT_CONTEXT(ctx
);
3317 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3318 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3325 if (ctx
->ExecuteFlag
) {
3326 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3331 static void GLAPIENTRY
3332 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3334 GET_CURRENT_CONTEXT(ctx
);
3336 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3337 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXENV
, 6);
3341 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3349 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3352 if (ctx
->ExecuteFlag
) {
3353 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3358 static void GLAPIENTRY
3359 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3361 save_TexEnvfv(target
, pname
, ¶m
);
3365 static void GLAPIENTRY
3366 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3369 p
[0] = (GLfloat
) param
;
3370 p
[1] = p
[2] = p
[3] = 0.0;
3371 save_TexEnvfv(target
, pname
, p
);
3375 static void GLAPIENTRY
3376 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3379 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3380 p
[0] = INT_TO_FLOAT(param
[0]);
3381 p
[1] = INT_TO_FLOAT(param
[1]);
3382 p
[2] = INT_TO_FLOAT(param
[2]);
3383 p
[3] = INT_TO_FLOAT(param
[3]);
3386 p
[0] = (GLfloat
) param
[0];
3387 p
[1] = p
[2] = p
[3] = 0.0F
;
3389 save_TexEnvfv(target
, pname
, p
);
3393 static void GLAPIENTRY
3394 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3396 GET_CURRENT_CONTEXT(ctx
);
3398 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3399 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXGEN
, 6);
3408 if (ctx
->ExecuteFlag
) {
3409 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3414 static void GLAPIENTRY
3415 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3418 p
[0] = (GLfloat
) params
[0];
3419 p
[1] = (GLfloat
) params
[1];
3420 p
[2] = (GLfloat
) params
[2];
3421 p
[3] = (GLfloat
) params
[3];
3422 save_TexGenfv(coord
, pname
, p
);
3426 static void GLAPIENTRY
3427 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3429 GLfloat p
= (GLfloat
) param
;
3430 save_TexGenfv(coord
, pname
, &p
);
3434 static void GLAPIENTRY
3435 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3438 p
[0] = (GLfloat
) params
[0];
3439 p
[1] = (GLfloat
) params
[1];
3440 p
[2] = (GLfloat
) params
[2];
3441 p
[3] = (GLfloat
) params
[3];
3442 save_TexGenfv(coord
, pname
, p
);
3446 static void GLAPIENTRY
3447 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3449 save_TexGenfv(coord
, pname
, ¶m
);
3453 static void GLAPIENTRY
3454 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3456 save_TexGeniv(coord
, pname
, ¶m
);
3460 static void GLAPIENTRY
3461 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3463 GET_CURRENT_CONTEXT(ctx
);
3465 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3466 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEXPARAMETER
, 6);
3475 if (ctx
->ExecuteFlag
) {
3476 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3481 static void GLAPIENTRY
3482 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3484 save_TexParameterfv(target
, pname
, ¶m
);
3488 static void GLAPIENTRY
3489 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3492 fparam
[0] = (GLfloat
) param
;
3493 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3494 save_TexParameterfv(target
, pname
, fparam
);
3498 static void GLAPIENTRY
3499 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3502 fparam
[0] = (GLfloat
) params
[0];
3503 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3504 save_TexParameterfv(target
, pname
, fparam
);
3508 static void GLAPIENTRY
3509 save_TexImage1D(GLenum target
,
3510 GLint level
, GLint components
,
3511 GLsizei width
, GLint border
,
3512 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3514 GET_CURRENT_CONTEXT(ctx
);
3515 if (target
== GL_PROXY_TEXTURE_1D
) {
3516 /* don't compile, execute immediately */
3517 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3518 border
, format
, type
, pixels
));
3521 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
,
3522 pixels
, &ctx
->Unpack
);
3524 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3525 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE1D
, 8);
3529 n
[3].i
= components
;
3530 n
[4].i
= (GLint
) width
;
3539 if (ctx
->ExecuteFlag
) {
3540 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3541 border
, format
, type
, pixels
));
3547 static void GLAPIENTRY
3548 save_TexImage2D(GLenum target
,
3549 GLint level
, GLint components
,
3550 GLsizei width
, GLsizei height
, GLint border
,
3551 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3553 GET_CURRENT_CONTEXT(ctx
);
3554 if (target
== GL_PROXY_TEXTURE_2D
) {
3555 /* don't compile, execute immediately */
3556 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3557 height
, border
, format
, type
, pixels
));
3560 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
3561 pixels
, &ctx
->Unpack
);
3563 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3564 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE2D
, 9);
3568 n
[3].i
= components
;
3569 n
[4].i
= (GLint
) width
;
3570 n
[5].i
= (GLint
) height
;
3579 if (ctx
->ExecuteFlag
) {
3580 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3581 height
, border
, format
, type
, pixels
));
3587 static void GLAPIENTRY
3588 save_TexImage3D(GLenum target
,
3589 GLint level
, GLint internalFormat
,
3590 GLsizei width
, GLsizei height
, GLsizei depth
,
3592 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3594 GET_CURRENT_CONTEXT(ctx
);
3595 if (target
== GL_PROXY_TEXTURE_3D
) {
3596 /* don't compile, execute immediately */
3597 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3598 height
, depth
, border
, format
, type
,
3603 GLvoid
*image
= unpack_image(3, width
, height
, depth
, format
, type
,
3604 pixels
, &ctx
->Unpack
);
3605 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3606 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_IMAGE3D
, 10);
3610 n
[3].i
= (GLint
) internalFormat
;
3611 n
[4].i
= (GLint
) width
;
3612 n
[5].i
= (GLint
) height
;
3613 n
[6].i
= (GLint
) depth
;
3622 if (ctx
->ExecuteFlag
) {
3623 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3624 height
, depth
, border
, format
, type
,
3631 static void GLAPIENTRY
3632 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
3633 GLsizei width
, GLenum format
, GLenum type
,
3634 const GLvoid
* pixels
)
3636 GET_CURRENT_CONTEXT(ctx
);
3638 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
,
3639 pixels
, &ctx
->Unpack
);
3640 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3641 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
3646 n
[4].i
= (GLint
) width
;
3654 if (ctx
->ExecuteFlag
) {
3655 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
3656 format
, type
, pixels
));
3661 static void GLAPIENTRY
3662 save_TexSubImage2D(GLenum target
, GLint level
,
3663 GLint xoffset
, GLint yoffset
,
3664 GLsizei width
, GLsizei height
,
3665 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3667 GET_CURRENT_CONTEXT(ctx
);
3669 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
3670 pixels
, &ctx
->Unpack
);
3671 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3672 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
3678 n
[5].i
= (GLint
) width
;
3679 n
[6].i
= (GLint
) height
;
3687 if (ctx
->ExecuteFlag
) {
3688 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
3689 width
, height
, format
, type
, pixels
));
3694 static void GLAPIENTRY
3695 save_TexSubImage3D(GLenum target
, GLint level
,
3696 GLint xoffset
, GLint yoffset
, GLint zoffset
,
3697 GLsizei width
, GLsizei height
, GLsizei depth
,
3698 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3700 GET_CURRENT_CONTEXT(ctx
);
3702 GLvoid
*image
= unpack_image(3, width
, height
, depth
, format
, type
,
3703 pixels
, &ctx
->Unpack
);
3704 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3705 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
3712 n
[6].i
= (GLint
) width
;
3713 n
[7].i
= (GLint
) height
;
3714 n
[8].i
= (GLint
) depth
;
3722 if (ctx
->ExecuteFlag
) {
3723 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
3724 xoffset
, yoffset
, zoffset
,
3725 width
, height
, depth
, format
, type
,
3731 static void GLAPIENTRY
3732 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
3734 GET_CURRENT_CONTEXT(ctx
);
3736 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3737 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRANSLATE
, 3);
3743 if (ctx
->ExecuteFlag
) {
3744 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
3749 static void GLAPIENTRY
3750 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
3752 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3757 static void GLAPIENTRY
3758 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3760 GET_CURRENT_CONTEXT(ctx
);
3762 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3763 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_VIEWPORT
, 4);
3767 n
[3].i
= (GLint
) width
;
3768 n
[4].i
= (GLint
) height
;
3770 if (ctx
->ExecuteFlag
) {
3771 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
3776 static void GLAPIENTRY
3777 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3779 GET_CURRENT_CONTEXT(ctx
);
3781 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3782 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_WINDOW_POS
, 4);
3789 if (ctx
->ExecuteFlag
) {
3790 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
3794 static void GLAPIENTRY
3795 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3797 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3800 static void GLAPIENTRY
3801 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3803 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3806 static void GLAPIENTRY
3807 save_WindowPos2iMESA(GLint x
, GLint y
)
3809 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3812 static void GLAPIENTRY
3813 save_WindowPos2sMESA(GLshort x
, GLshort y
)
3815 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3818 static void GLAPIENTRY
3819 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3821 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3824 static void GLAPIENTRY
3825 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3827 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3830 static void GLAPIENTRY
3831 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3833 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3836 static void GLAPIENTRY
3837 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3839 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3842 static void GLAPIENTRY
3843 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3845 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3848 static void GLAPIENTRY
3849 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3851 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3854 static void GLAPIENTRY
3855 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3857 save_WindowPos4fMESA(x
, y
, z
, w
);
3860 static void GLAPIENTRY
3861 save_WindowPos2dvMESA(const GLdouble
* v
)
3863 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3866 static void GLAPIENTRY
3867 save_WindowPos2fvMESA(const GLfloat
* v
)
3869 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3872 static void GLAPIENTRY
3873 save_WindowPos2ivMESA(const GLint
* v
)
3875 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3878 static void GLAPIENTRY
3879 save_WindowPos2svMESA(const GLshort
* v
)
3881 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3884 static void GLAPIENTRY
3885 save_WindowPos3dvMESA(const GLdouble
* v
)
3887 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3890 static void GLAPIENTRY
3891 save_WindowPos3fvMESA(const GLfloat
* v
)
3893 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3896 static void GLAPIENTRY
3897 save_WindowPos3ivMESA(const GLint
* v
)
3899 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3902 static void GLAPIENTRY
3903 save_WindowPos3svMESA(const GLshort
* v
)
3905 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3908 static void GLAPIENTRY
3909 save_WindowPos4dvMESA(const GLdouble
* v
)
3911 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3912 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3915 static void GLAPIENTRY
3916 save_WindowPos4fvMESA(const GLfloat
* v
)
3918 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3921 static void GLAPIENTRY
3922 save_WindowPos4ivMESA(const GLint
* v
)
3924 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3925 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3928 static void GLAPIENTRY
3929 save_WindowPos4svMESA(const GLshort
* v
)
3931 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3936 /* GL_ARB_multitexture */
3937 static void GLAPIENTRY
3938 save_ActiveTextureARB(GLenum target
)
3940 GET_CURRENT_CONTEXT(ctx
);
3942 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3943 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
3947 if (ctx
->ExecuteFlag
) {
3948 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
3953 /* GL_ARB_transpose_matrix */
3955 static void GLAPIENTRY
3956 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
3959 _math_transposefd(tm
, m
);
3960 save_LoadMatrixf(tm
);
3964 static void GLAPIENTRY
3965 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
3968 _math_transposef(tm
, m
);
3969 save_LoadMatrixf(tm
);
3973 static void GLAPIENTRY
3974 save_MultTransposeMatrixdARB(const GLdouble m
[16])
3977 _math_transposefd(tm
, m
);
3978 save_MultMatrixf(tm
);
3982 static void GLAPIENTRY
3983 save_MultTransposeMatrixfARB(const GLfloat m
[16])
3986 _math_transposef(tm
, m
);
3987 save_MultMatrixf(tm
);
3991 /* GL_ARB_texture_compression */
3992 static void GLAPIENTRY
3993 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3994 GLenum internalFormat
, GLsizei width
,
3995 GLint border
, GLsizei imageSize
,
3996 const GLvoid
* data
)
3998 GET_CURRENT_CONTEXT(ctx
);
3999 if (target
== GL_PROXY_TEXTURE_1D
) {
4000 /* don't compile, execute immediately */
4001 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4002 width
, border
, imageSize
,
4008 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4009 /* make copy of image */
4010 image
= _mesa_malloc(imageSize
);
4012 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
4015 MEMCPY(image
, data
, imageSize
);
4016 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4020 n
[3].e
= internalFormat
;
4021 n
[4].i
= (GLint
) width
;
4029 if (ctx
->ExecuteFlag
) {
4030 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4031 (target
, level
, internalFormat
, width
,
4032 border
, imageSize
, data
));
4038 static void GLAPIENTRY
4039 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4040 GLenum internalFormat
, GLsizei width
,
4041 GLsizei height
, GLint border
, GLsizei imageSize
,
4042 const GLvoid
* data
)
4044 GET_CURRENT_CONTEXT(ctx
);
4045 if (target
== GL_PROXY_TEXTURE_2D
) {
4046 /* don't compile, execute immediately */
4047 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4048 width
, height
, 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
, "glCompressedTexImage2DARB");
4061 MEMCPY(image
, data
, imageSize
);
4062 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4066 n
[3].e
= internalFormat
;
4067 n
[4].i
= (GLint
) width
;
4068 n
[5].i
= (GLint
) height
;
4076 if (ctx
->ExecuteFlag
) {
4077 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4078 (target
, level
, internalFormat
, width
,
4079 height
, border
, imageSize
, data
));
4085 static void GLAPIENTRY
4086 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4087 GLenum internalFormat
, GLsizei width
,
4088 GLsizei height
, GLsizei depth
, GLint border
,
4089 GLsizei imageSize
, const GLvoid
* data
)
4091 GET_CURRENT_CONTEXT(ctx
);
4092 if (target
== GL_PROXY_TEXTURE_3D
) {
4093 /* don't compile, execute immediately */
4094 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4095 width
, height
, depth
, border
,
4101 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4102 /* make copy of image */
4103 image
= _mesa_malloc(imageSize
);
4105 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4108 MEMCPY(image
, data
, imageSize
);
4109 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4113 n
[3].e
= internalFormat
;
4114 n
[4].i
= (GLint
) width
;
4115 n
[5].i
= (GLint
) height
;
4116 n
[6].i
= (GLint
) depth
;
4124 if (ctx
->ExecuteFlag
) {
4125 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4126 (target
, level
, internalFormat
, width
,
4127 height
, depth
, border
, imageSize
,
4134 static void GLAPIENTRY
4135 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4136 GLsizei width
, GLenum format
,
4137 GLsizei imageSize
, const GLvoid
* data
)
4142 GET_CURRENT_CONTEXT(ctx
);
4143 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4145 /* make copy of image */
4146 image
= _mesa_malloc(imageSize
);
4148 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4151 MEMCPY(image
, data
, imageSize
);
4152 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4157 n
[4].i
= (GLint
) width
;
4165 if (ctx
->ExecuteFlag
) {
4166 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4167 width
, format
, imageSize
,
4173 static void GLAPIENTRY
4174 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4175 GLint yoffset
, GLsizei width
, GLsizei height
,
4176 GLenum format
, GLsizei imageSize
,
4177 const GLvoid
* data
)
4182 GET_CURRENT_CONTEXT(ctx
);
4183 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4185 /* make copy of image */
4186 image
= _mesa_malloc(imageSize
);
4188 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4191 MEMCPY(image
, data
, imageSize
);
4192 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4198 n
[5].i
= (GLint
) width
;
4199 n
[6].i
= (GLint
) height
;
4207 if (ctx
->ExecuteFlag
) {
4208 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4209 (target
, level
, xoffset
, yoffset
, width
,
4210 height
, format
, imageSize
, data
));
4215 static void GLAPIENTRY
4216 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4217 GLint yoffset
, GLint zoffset
, GLsizei width
,
4218 GLsizei height
, GLsizei depth
, GLenum format
,
4219 GLsizei imageSize
, const GLvoid
* data
)
4224 GET_CURRENT_CONTEXT(ctx
);
4225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4227 /* make copy of image */
4228 image
= _mesa_malloc(imageSize
);
4230 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4233 MEMCPY(image
, data
, imageSize
);
4234 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4241 n
[6].i
= (GLint
) width
;
4242 n
[7].i
= (GLint
) height
;
4243 n
[8].i
= (GLint
) depth
;
4245 n
[10].i
= imageSize
;
4251 if (ctx
->ExecuteFlag
) {
4252 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4253 (target
, level
, xoffset
, yoffset
,
4254 zoffset
, width
, height
, depth
, format
,
4260 /* GL_ARB_multisample */
4261 static void GLAPIENTRY
4262 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4264 GET_CURRENT_CONTEXT(ctx
);
4266 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4267 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4272 if (ctx
->ExecuteFlag
) {
4273 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4279 * GL_NV_vertex_program
4281 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4282 static void GLAPIENTRY
4283 save_BindProgramNV(GLenum target
, GLuint id
)
4285 GET_CURRENT_CONTEXT(ctx
);
4287 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4288 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4293 if (ctx
->ExecuteFlag
) {
4294 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4298 static void GLAPIENTRY
4299 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4300 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4302 GET_CURRENT_CONTEXT(ctx
);
4304 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4305 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4314 if (ctx
->ExecuteFlag
) {
4315 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4320 static void GLAPIENTRY
4321 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4322 const GLfloat
*params
)
4324 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4325 params
[2], params
[3]);
4329 static void GLAPIENTRY
4330 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4331 const GLfloat
* params
)
4333 GET_CURRENT_CONTEXT(ctx
);
4335 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4339 const GLfloat
* p
= params
;
4341 for (i
= 0 ; i
< count
; i
++) {
4342 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4355 if (ctx
->ExecuteFlag
) {
4356 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4361 static void GLAPIENTRY
4362 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4363 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4365 save_ProgramEnvParameter4fARB(target
, index
,
4367 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4371 static void GLAPIENTRY
4372 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4373 const GLdouble
*params
)
4375 save_ProgramEnvParameter4fARB(target
, index
,
4376 (GLfloat
) params
[0],
4377 (GLfloat
) params
[1],
4378 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4381 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
4383 #if FEATURE_NV_vertex_program
4384 static void GLAPIENTRY
4385 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4387 GET_CURRENT_CONTEXT(ctx
);
4389 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4390 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4399 if (ctx
->ExecuteFlag
) {
4400 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4405 static void GLAPIENTRY
4406 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4407 GLuint num
, const GLdouble
*params
)
4410 for (i
= 0; i
< num
; i
++) {
4411 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4416 static void GLAPIENTRY
4417 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4418 GLuint num
, const GLfloat
*params
)
4421 for (i
= 0; i
< num
; i
++) {
4422 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4427 static void GLAPIENTRY
4428 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4429 const GLubyte
* program
)
4431 GET_CURRENT_CONTEXT(ctx
);
4433 GLubyte
*programCopy
;
4435 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4437 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4440 _mesa_memcpy(programCopy
, program
, len
);
4442 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4443 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4448 n
[4].data
= programCopy
;
4450 if (ctx
->ExecuteFlag
) {
4451 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4456 static void GLAPIENTRY
4457 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4459 GET_CURRENT_CONTEXT(ctx
);
4461 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4463 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4466 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4467 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4468 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4473 if (ctx
->ExecuteFlag
) {
4474 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4479 static void GLAPIENTRY
4480 save_TrackMatrixNV(GLenum target
, GLuint address
,
4481 GLenum matrix
, GLenum transform
)
4483 GET_CURRENT_CONTEXT(ctx
);
4485 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4486 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4493 if (ctx
->ExecuteFlag
) {
4494 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4497 #endif /* FEATURE_NV_vertex_program */
4501 * GL_NV_fragment_program
4503 #if FEATURE_NV_fragment_program
4504 static void GLAPIENTRY
4505 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4506 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4508 GET_CURRENT_CONTEXT(ctx
);
4510 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4511 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4520 if (ctx
->ExecuteFlag
) {
4521 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4526 static void GLAPIENTRY
4527 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4528 const GLfloat
*params
)
4530 GET_CURRENT_CONTEXT(ctx
);
4532 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4533 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4542 if (ctx
->ExecuteFlag
) {
4543 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4548 static void GLAPIENTRY
4549 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4550 const GLfloat
*params
)
4552 GET_CURRENT_CONTEXT(ctx
);
4554 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4558 const GLfloat
* p
= params
;
4560 for (i
= 0 ; i
< count
; i
++) {
4561 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4574 if (ctx
->ExecuteFlag
) {
4575 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4580 static void GLAPIENTRY
4581 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4582 GLdouble x
, GLdouble y
,
4583 GLdouble z
, GLdouble w
)
4585 GET_CURRENT_CONTEXT(ctx
);
4587 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4588 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4592 n
[3].f
= (GLfloat
) x
;
4593 n
[4].f
= (GLfloat
) y
;
4594 n
[5].f
= (GLfloat
) z
;
4595 n
[6].f
= (GLfloat
) w
;
4597 if (ctx
->ExecuteFlag
) {
4598 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4603 static void GLAPIENTRY
4604 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4605 const GLdouble
*params
)
4607 GET_CURRENT_CONTEXT(ctx
);
4609 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4610 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4614 n
[3].f
= (GLfloat
) params
[0];
4615 n
[4].f
= (GLfloat
) params
[1];
4616 n
[5].f
= (GLfloat
) params
[2];
4617 n
[6].f
= (GLfloat
) params
[3];
4619 if (ctx
->ExecuteFlag
) {
4620 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4624 static void GLAPIENTRY
4625 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4626 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4628 GET_CURRENT_CONTEXT(ctx
);
4630 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4632 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4635 _mesa_memcpy(nameCopy
, name
, len
);
4637 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4638 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
4642 n
[3].data
= nameCopy
;
4648 if (ctx
->ExecuteFlag
) {
4649 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
4654 static void GLAPIENTRY
4655 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4658 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4662 static void GLAPIENTRY
4663 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4664 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4666 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4667 (GLfloat
) z
, (GLfloat
) w
);
4671 static void GLAPIENTRY
4672 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4675 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4676 (GLfloat
) v
[1], (GLfloat
) v
[2],
4680 #endif /* FEATURE_NV_fragment_program */
4684 /* GL_EXT_stencil_two_side */
4685 static void GLAPIENTRY
4686 save_ActiveStencilFaceEXT(GLenum face
)
4688 GET_CURRENT_CONTEXT(ctx
);
4690 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4691 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
4695 if (ctx
->ExecuteFlag
) {
4696 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
4701 /* GL_EXT_depth_bounds_test */
4702 static void GLAPIENTRY
4703 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
4705 GET_CURRENT_CONTEXT(ctx
);
4707 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4708 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
4710 n
[1].f
= (GLfloat
) zmin
;
4711 n
[2].f
= (GLfloat
) zmax
;
4713 if (ctx
->ExecuteFlag
) {
4714 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
4720 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4722 static void GLAPIENTRY
4723 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4724 const GLvoid
* string
)
4726 GET_CURRENT_CONTEXT(ctx
);
4728 GLubyte
*programCopy
;
4730 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4732 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4735 _mesa_memcpy(programCopy
, string
, len
);
4737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4738 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
4743 n
[4].data
= programCopy
;
4745 if (ctx
->ExecuteFlag
) {
4746 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
4750 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4753 #if FEATURE_ARB_occlusion_query
4755 static void GLAPIENTRY
4756 save_BeginQueryARB(GLenum target
, GLuint id
)
4758 GET_CURRENT_CONTEXT(ctx
);
4760 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4761 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
4766 if (ctx
->ExecuteFlag
) {
4767 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
4772 static void GLAPIENTRY
4773 save_EndQueryARB(GLenum target
)
4775 GET_CURRENT_CONTEXT(ctx
);
4777 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4778 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_END_QUERY_ARB
, 1);
4782 if (ctx
->ExecuteFlag
) {
4783 CALL_EndQueryARB(ctx
->Exec
, (target
));
4787 #endif /* FEATURE_ARB_occlusion_query */
4790 static void GLAPIENTRY
4791 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
4793 GET_CURRENT_CONTEXT(ctx
);
4795 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4796 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
4800 if (count
> MAX_DRAW_BUFFERS
)
4801 count
= MAX_DRAW_BUFFERS
;
4802 for (i
= 0; i
< count
; i
++) {
4803 n
[2 + i
].e
= buffers
[i
];
4806 if (ctx
->ExecuteFlag
) {
4807 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
4811 static void GLAPIENTRY
4812 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
4814 GET_CURRENT_CONTEXT(ctx
);
4817 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
4825 if (ctx
->ExecuteFlag
) {
4826 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
4830 static void GLAPIENTRY
4831 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
4834 p
[0] = INT_TO_FLOAT(param
[0]);
4835 p
[1] = INT_TO_FLOAT(param
[1]);
4836 p
[2] = INT_TO_FLOAT(param
[2]);
4837 p
[3] = INT_TO_FLOAT(param
[3]);
4838 save_TexBumpParameterfvATI(pname
, p
);
4841 #if FEATURE_ATI_fragment_shader
4842 static void GLAPIENTRY
4843 save_BindFragmentShaderATI(GLuint id
)
4845 GET_CURRENT_CONTEXT(ctx
);
4848 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
4852 if (ctx
->ExecuteFlag
) {
4853 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
4857 static void GLAPIENTRY
4858 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
4860 GET_CURRENT_CONTEXT(ctx
);
4863 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
4871 if (ctx
->ExecuteFlag
) {
4872 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
4878 save_Attr1fNV(GLenum attr
, GLfloat x
)
4880 GET_CURRENT_CONTEXT(ctx
);
4882 SAVE_FLUSH_VERTICES(ctx
);
4883 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_NV
, 2);
4889 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
4890 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4891 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4893 if (ctx
->ExecuteFlag
) {
4894 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
4899 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
4901 GET_CURRENT_CONTEXT(ctx
);
4903 SAVE_FLUSH_VERTICES(ctx
);
4904 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_NV
, 3);
4911 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
4912 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4913 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4915 if (ctx
->ExecuteFlag
) {
4916 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
4921 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4923 GET_CURRENT_CONTEXT(ctx
);
4925 SAVE_FLUSH_VERTICES(ctx
);
4926 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_NV
, 4);
4934 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
4935 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4936 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4938 if (ctx
->ExecuteFlag
) {
4939 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
4944 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4946 GET_CURRENT_CONTEXT(ctx
);
4948 SAVE_FLUSH_VERTICES(ctx
);
4949 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_NV
, 5);
4958 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
4959 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4960 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4962 if (ctx
->ExecuteFlag
) {
4963 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
4969 save_Attr1fARB(GLenum attr
, GLfloat x
)
4971 GET_CURRENT_CONTEXT(ctx
);
4973 SAVE_FLUSH_VERTICES(ctx
);
4974 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_1F_ARB
, 2);
4980 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
4981 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4982 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4984 if (ctx
->ExecuteFlag
) {
4985 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
4990 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
4992 GET_CURRENT_CONTEXT(ctx
);
4994 SAVE_FLUSH_VERTICES(ctx
);
4995 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5002 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5003 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5004 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5006 if (ctx
->ExecuteFlag
) {
5007 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5012 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5014 GET_CURRENT_CONTEXT(ctx
);
5016 SAVE_FLUSH_VERTICES(ctx
);
5017 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5025 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5026 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5027 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5029 if (ctx
->ExecuteFlag
) {
5030 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5035 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5037 GET_CURRENT_CONTEXT(ctx
);
5039 SAVE_FLUSH_VERTICES(ctx
);
5040 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5049 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5050 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5051 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5053 if (ctx
->ExecuteFlag
) {
5054 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5059 static void GLAPIENTRY
5060 save_EvalCoord1f(GLfloat x
)
5062 GET_CURRENT_CONTEXT(ctx
);
5064 SAVE_FLUSH_VERTICES(ctx
);
5065 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C1
, 1);
5069 if (ctx
->ExecuteFlag
) {
5070 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5074 static void GLAPIENTRY
5075 save_EvalCoord1fv(const GLfloat
* v
)
5077 save_EvalCoord1f(v
[0]);
5080 static void GLAPIENTRY
5081 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5083 GET_CURRENT_CONTEXT(ctx
);
5085 SAVE_FLUSH_VERTICES(ctx
);
5086 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_C2
, 2);
5091 if (ctx
->ExecuteFlag
) {
5092 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5096 static void GLAPIENTRY
5097 save_EvalCoord2fv(const GLfloat
* v
)
5099 save_EvalCoord2f(v
[0], v
[1]);
5103 static void GLAPIENTRY
5104 save_EvalPoint1(GLint x
)
5106 GET_CURRENT_CONTEXT(ctx
);
5108 SAVE_FLUSH_VERTICES(ctx
);
5109 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P1
, 1);
5113 if (ctx
->ExecuteFlag
) {
5114 CALL_EvalPoint1(ctx
->Exec
, (x
));
5118 static void GLAPIENTRY
5119 save_EvalPoint2(GLint x
, GLint y
)
5121 GET_CURRENT_CONTEXT(ctx
);
5123 SAVE_FLUSH_VERTICES(ctx
);
5124 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_EVAL_P2
, 2);
5129 if (ctx
->ExecuteFlag
) {
5130 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5134 static void GLAPIENTRY
5135 save_Indexf(GLfloat x
)
5137 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5140 static void GLAPIENTRY
5141 save_Indexfv(const GLfloat
* v
)
5143 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5146 static void GLAPIENTRY
5147 save_EdgeFlag(GLboolean x
)
5149 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? (GLfloat
)1.0 : (GLfloat
)0.0);
5152 static void GLAPIENTRY
5153 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5155 GET_CURRENT_CONTEXT(ctx
);
5159 SAVE_FLUSH_VERTICES(ctx
);
5164 case GL_FRONT_AND_BACK
:
5167 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5176 case GL_AMBIENT_AND_DIFFUSE
:
5182 case GL_COLOR_INDEXES
:
5186 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5190 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_MATERIAL
, 6);
5194 for (i
= 0; i
< args
; i
++)
5195 n
[3 + i
].f
= param
[i
];
5199 GLuint bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5200 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
5201 if (bitmask
& (1 << i
)) {
5202 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5203 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5207 if (ctx
->ExecuteFlag
) {
5208 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5212 static void GLAPIENTRY
5213 save_Begin(GLenum mode
)
5215 GET_CURRENT_CONTEXT(ctx
);
5217 GLboolean error
= GL_FALSE
;
5219 if ( /*mode < GL_POINTS || */ mode
> GL_POLYGON
) {
5220 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5223 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5224 /* Typically the first begin. This may raise an error on
5225 * playback, depending on whether CallList is issued from inside
5226 * a begin/end or not.
5228 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5230 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5231 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5234 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5239 /* Give the driver an opportunity to hook in an optimized
5240 * display list compiler.
5242 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5245 SAVE_FLUSH_VERTICES(ctx
);
5246 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BEGIN
, 1);
5252 if (ctx
->ExecuteFlag
) {
5253 CALL_Begin(ctx
->Exec
, (mode
));
5257 static void GLAPIENTRY
5260 GET_CURRENT_CONTEXT(ctx
);
5261 SAVE_FLUSH_VERTICES(ctx
);
5262 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END
, 0);
5263 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5264 if (ctx
->ExecuteFlag
) {
5265 CALL_End(ctx
->Exec
, ());
5269 static void GLAPIENTRY
5270 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5272 GET_CURRENT_CONTEXT(ctx
);
5274 SAVE_FLUSH_VERTICES(ctx
);
5275 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_RECTF
, 4);
5282 if (ctx
->ExecuteFlag
) {
5283 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5288 static void GLAPIENTRY
5289 save_Vertex2f(GLfloat x
, GLfloat y
)
5291 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5294 static void GLAPIENTRY
5295 save_Vertex2fv(const GLfloat
* v
)
5297 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5300 static void GLAPIENTRY
5301 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5303 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5306 static void GLAPIENTRY
5307 save_Vertex3fv(const GLfloat
* v
)
5309 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5312 static void GLAPIENTRY
5313 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5315 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5318 static void GLAPIENTRY
5319 save_Vertex4fv(const GLfloat
* v
)
5321 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5324 static void GLAPIENTRY
5325 save_TexCoord1f(GLfloat x
)
5327 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5330 static void GLAPIENTRY
5331 save_TexCoord1fv(const GLfloat
* v
)
5333 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5336 static void GLAPIENTRY
5337 save_TexCoord2f(GLfloat x
, GLfloat y
)
5339 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5342 static void GLAPIENTRY
5343 save_TexCoord2fv(const GLfloat
* v
)
5345 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5348 static void GLAPIENTRY
5349 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5351 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5354 static void GLAPIENTRY
5355 save_TexCoord3fv(const GLfloat
* v
)
5357 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5360 static void GLAPIENTRY
5361 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5363 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5366 static void GLAPIENTRY
5367 save_TexCoord4fv(const GLfloat
* v
)
5369 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5372 static void GLAPIENTRY
5373 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5375 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5378 static void GLAPIENTRY
5379 save_Normal3fv(const GLfloat
* v
)
5381 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5384 static void GLAPIENTRY
5385 save_FogCoordfEXT(GLfloat x
)
5387 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5390 static void GLAPIENTRY
5391 save_FogCoordfvEXT(const GLfloat
* v
)
5393 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5396 static void GLAPIENTRY
5397 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5399 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5402 static void GLAPIENTRY
5403 save_Color3fv(const GLfloat
* v
)
5405 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5408 static void GLAPIENTRY
5409 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5411 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5414 static void GLAPIENTRY
5415 save_Color4fv(const GLfloat
* v
)
5417 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5420 static void GLAPIENTRY
5421 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5423 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5426 static void GLAPIENTRY
5427 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5429 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5433 /* Just call the respective ATTR for texcoord
5435 static void GLAPIENTRY
5436 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5438 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5439 save_Attr1fNV(attr
, x
);
5442 static void GLAPIENTRY
5443 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5445 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5446 save_Attr1fNV(attr
, v
[0]);
5449 static void GLAPIENTRY
5450 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5452 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5453 save_Attr2fNV(attr
, x
, y
);
5456 static void GLAPIENTRY
5457 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5459 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5460 save_Attr2fNV(attr
, v
[0], v
[1]);
5463 static void GLAPIENTRY
5464 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5466 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5467 save_Attr3fNV(attr
, x
, y
, z
);
5470 static void GLAPIENTRY
5471 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5473 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5474 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5477 static void GLAPIENTRY
5478 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5479 GLfloat z
, GLfloat w
)
5481 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5482 save_Attr4fNV(attr
, x
, y
, z
, w
);
5485 static void GLAPIENTRY
5486 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5488 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5489 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5494 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5500 GET_CURRENT_CONTEXT(ctx
);
5501 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5505 /* First level for NV_vertex_program:
5507 * Check for errors at compile time?.
5509 static void GLAPIENTRY
5510 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
5512 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5513 save_Attr1fNV(index
, x
);
5518 static void GLAPIENTRY
5519 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
5521 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5522 save_Attr1fNV(index
, v
[0]);
5527 static void GLAPIENTRY
5528 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
5530 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5531 save_Attr2fNV(index
, x
, y
);
5536 static void GLAPIENTRY
5537 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
5539 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5540 save_Attr2fNV(index
, v
[0], v
[1]);
5545 static void GLAPIENTRY
5546 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5548 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5549 save_Attr3fNV(index
, x
, y
, z
);
5554 static void GLAPIENTRY
5555 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
5557 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5558 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
5563 static void GLAPIENTRY
5564 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
5565 GLfloat z
, GLfloat w
)
5567 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5568 save_Attr4fNV(index
, x
, y
, z
, w
);
5573 static void GLAPIENTRY
5574 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
5576 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5577 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
5585 static void GLAPIENTRY
5586 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5588 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5589 save_Attr1fARB(index
, x
);
5594 static void GLAPIENTRY
5595 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5597 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5598 save_Attr1fARB(index
, v
[0]);
5603 static void GLAPIENTRY
5604 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5606 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5607 save_Attr2fARB(index
, x
, y
);
5612 static void GLAPIENTRY
5613 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5615 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5616 save_Attr2fARB(index
, v
[0], v
[1]);
5621 static void GLAPIENTRY
5622 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5624 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5625 save_Attr3fARB(index
, x
, y
, z
);
5630 static void GLAPIENTRY
5631 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
5633 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5634 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
5639 static void GLAPIENTRY
5640 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
5643 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5644 save_Attr4fARB(index
, x
, y
, z
, w
);
5649 static void GLAPIENTRY
5650 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
5652 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5653 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
5659 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
5661 static void GLAPIENTRY
5662 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
5664 GET_CURRENT_CONTEXT(ctx
);
5665 FLUSH_VERTICES(ctx
, 0);
5666 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
5669 static GLint GLAPIENTRY
5670 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
5672 GET_CURRENT_CONTEXT(ctx
);
5673 FLUSH_VERTICES(ctx
, 0);
5674 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
5676 /* XXX more shader functions needed here */
5680 #if FEATURE_EXT_framebuffer_blit
5681 static void GLAPIENTRY
5682 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
5683 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
5684 GLbitfield mask
, GLenum filter
)
5686 GET_CURRENT_CONTEXT(ctx
);
5688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5689 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
5702 if (ctx
->ExecuteFlag
) {
5703 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
5704 dstX0
, dstY0
, dstX1
, dstY1
,
5711 /** GL_EXT_provoking_vertex */
5712 static void GLAPIENTRY
5713 save_ProvokingVertexEXT(GLenum mode
)
5715 GET_CURRENT_CONTEXT(ctx
);
5717 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5718 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
5722 if (ctx
->ExecuteFlag
) {
5723 /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
5724 _mesa_ProvokingVertexEXT(mode
);
5731 * Save an error-generating command into display list.
5733 * KW: Will appear in the list before the vertex buffer containing the
5734 * command that provoked the error. I don't see this as a problem.
5737 save_error(GLcontext
*ctx
, GLenum error
, const char *s
)
5740 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_ERROR
, 2);
5743 n
[2].data
= (void *) s
;
5749 * Compile an error into current display list.
5752 _mesa_compile_error(GLcontext
*ctx
, GLenum error
, const char *s
)
5754 if (ctx
->CompileFlag
)
5755 save_error(ctx
, error
, s
);
5756 if (ctx
->ExecuteFlag
)
5757 _mesa_error(ctx
, error
, s
);
5762 * Test if ID names a display list.
5765 islist(GLcontext
*ctx
, GLuint list
)
5767 if (list
> 0 && lookup_list(ctx
, list
)) {
5777 /**********************************************************************/
5778 /* Display list execution */
5779 /**********************************************************************/
5783 * Execute a display list. Note that the ListBase offset must have already
5784 * been added before calling this function. I.e. the list argument is
5785 * the absolute list number, not relative to ListBase.
5786 * \param list - display list number
5789 execute_list(GLcontext
*ctx
, GLuint list
)
5791 struct gl_display_list
*dlist
;
5795 if (list
== 0 || !islist(ctx
, list
))
5798 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
5799 /* raise an error? */
5803 dlist
= lookup_list(ctx
, list
);
5807 ctx
->ListState
.CallDepth
++;
5809 if (ctx
->Driver
.BeginCallList
)
5810 ctx
->Driver
.BeginCallList(ctx
, dlist
);
5816 OpCode opcode
= n
[0].opcode
;
5817 int i
= (int) n
[0].opcode
- (int) OPCODE_EXT_0
;
5819 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
5820 /* this is a driver-extended opcode */
5821 ctx
->ListExt
.Opcode
[i
].Execute(ctx
, &n
[1]);
5822 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
5827 _mesa_error(ctx
, n
[1].e
, (const char *) n
[2].data
);
5830 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
5832 case OPCODE_ALPHA_FUNC
:
5833 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
5835 case OPCODE_BIND_TEXTURE
:
5836 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
5840 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5841 ctx
->Unpack
= ctx
->DefaultPacking
;
5842 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5843 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
5844 (const GLubyte
*) n
[7].data
));
5845 ctx
->Unpack
= save
; /* restore */
5848 case OPCODE_BLEND_COLOR
:
5849 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5851 case OPCODE_BLEND_EQUATION
:
5852 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
5854 case OPCODE_BLEND_EQUATION_SEPARATE
:
5855 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5857 case OPCODE_BLEND_FUNC_SEPARATE
:
5858 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
5859 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
5861 case OPCODE_CALL_LIST
:
5862 /* Generated by glCallList(), don't add ListBase */
5863 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5864 execute_list(ctx
, n
[1].ui
);
5867 case OPCODE_CALL_LIST_OFFSET
:
5868 /* Generated by glCallLists() so we must add ListBase */
5870 /* user specified a bad data type at compile time */
5871 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5873 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5874 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
5875 execute_list(ctx
, list
);
5879 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
5881 case OPCODE_CLEAR_COLOR
:
5882 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5884 case OPCODE_CLEAR_ACCUM
:
5885 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5887 case OPCODE_CLEAR_DEPTH
:
5888 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
5890 case OPCODE_CLEAR_INDEX
:
5891 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
5893 case OPCODE_CLEAR_STENCIL
:
5894 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
5896 case OPCODE_CLIP_PLANE
:
5903 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
5906 case OPCODE_COLOR_MASK
:
5907 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
5909 case OPCODE_COLOR_MATERIAL
:
5910 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
5912 case OPCODE_COLOR_TABLE
:
5914 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5915 ctx
->Unpack
= ctx
->DefaultPacking
;
5916 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5917 n
[5].e
, n
[6].data
));
5918 ctx
->Unpack
= save
; /* restore */
5921 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
5928 CALL_ColorTableParameterfv(ctx
->Exec
,
5929 (n
[1].e
, n
[2].e
, params
));
5932 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
5939 CALL_ColorTableParameteriv(ctx
->Exec
,
5940 (n
[1].e
, n
[2].e
, params
));
5943 case OPCODE_COLOR_SUB_TABLE
:
5945 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5946 ctx
->Unpack
= ctx
->DefaultPacking
;
5947 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5948 n
[4].e
, n
[5].e
, n
[6].data
));
5949 ctx
->Unpack
= save
; /* restore */
5952 case OPCODE_CONVOLUTION_FILTER_1D
:
5954 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5955 ctx
->Unpack
= ctx
->DefaultPacking
;
5956 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5959 ctx
->Unpack
= save
; /* restore */
5962 case OPCODE_CONVOLUTION_FILTER_2D
:
5964 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5965 ctx
->Unpack
= ctx
->DefaultPacking
;
5966 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
5967 n
[4].i
, n
[5].e
, n
[6].e
,
5969 ctx
->Unpack
= save
; /* restore */
5972 case OPCODE_CONVOLUTION_PARAMETER_I
:
5973 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
5975 case OPCODE_CONVOLUTION_PARAMETER_IV
:
5982 CALL_ConvolutionParameteriv(ctx
->Exec
,
5983 (n
[1].e
, n
[2].e
, params
));
5986 case OPCODE_CONVOLUTION_PARAMETER_F
:
5987 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
5989 case OPCODE_CONVOLUTION_PARAMETER_FV
:
5996 CALL_ConvolutionParameterfv(ctx
->Exec
,
5997 (n
[1].e
, n
[2].e
, params
));
6000 case OPCODE_COPY_COLOR_SUB_TABLE
:
6001 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6002 n
[3].i
, n
[4].i
, n
[5].i
));
6004 case OPCODE_COPY_COLOR_TABLE
:
6005 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6006 n
[3].i
, n
[4].i
, n
[5].i
));
6008 case OPCODE_COPY_PIXELS
:
6009 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6010 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
6013 case OPCODE_COPY_TEX_IMAGE1D
:
6014 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6015 n
[5].i
, n
[6].i
, n
[7].i
));
6017 case OPCODE_COPY_TEX_IMAGE2D
:
6018 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6019 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
6021 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
6022 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6023 n
[4].i
, n
[5].i
, n
[6].i
));
6025 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
6026 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6027 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6030 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
6031 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6032 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6035 case OPCODE_CULL_FACE
:
6036 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
6038 case OPCODE_DEPTH_FUNC
:
6039 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
6041 case OPCODE_DEPTH_MASK
:
6042 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
6044 case OPCODE_DEPTH_RANGE
:
6045 CALL_DepthRange(ctx
->Exec
,
6046 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
6048 case OPCODE_DISABLE
:
6049 CALL_Disable(ctx
->Exec
, (n
[1].e
));
6051 case OPCODE_DRAW_BUFFER
:
6052 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
6054 case OPCODE_DRAW_PIXELS
:
6056 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6057 ctx
->Unpack
= ctx
->DefaultPacking
;
6058 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
6060 ctx
->Unpack
= save
; /* restore */
6064 CALL_Enable(ctx
->Exec
, (n
[1].e
));
6066 case OPCODE_EVALMESH1
:
6067 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
6069 case OPCODE_EVALMESH2
:
6070 CALL_EvalMesh2(ctx
->Exec
,
6071 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
6080 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
6083 case OPCODE_FRONT_FACE
:
6084 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
6086 case OPCODE_FRUSTUM
:
6087 CALL_Frustum(ctx
->Exec
,
6088 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6091 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6093 case OPCODE_HISTOGRAM
:
6094 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
6096 case OPCODE_INDEX_MASK
:
6097 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
6099 case OPCODE_INIT_NAMES
:
6100 CALL_InitNames(ctx
->Exec
, ());
6109 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
6112 case OPCODE_LIGHT_MODEL
:
6119 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
6122 case OPCODE_LINE_STIPPLE
:
6123 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
6125 case OPCODE_LINE_WIDTH
:
6126 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
6128 case OPCODE_LIST_BASE
:
6129 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
6131 case OPCODE_LOAD_IDENTITY
:
6132 CALL_LoadIdentity(ctx
->Exec
, ());
6134 case OPCODE_LOAD_MATRIX
:
6135 if (sizeof(Node
) == sizeof(GLfloat
)) {
6136 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
6141 for (i
= 0; i
< 16; i
++) {
6144 CALL_LoadMatrixf(ctx
->Exec
, (m
));
6147 case OPCODE_LOAD_NAME
:
6148 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
6150 case OPCODE_LOGIC_OP
:
6151 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
6155 GLenum target
= n
[1].e
;
6156 GLint ustride
= _mesa_evaluator_components(target
);
6157 GLint uorder
= n
[5].i
;
6158 GLfloat u1
= n
[2].f
;
6159 GLfloat u2
= n
[3].f
;
6160 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6161 (GLfloat
*) n
[6].data
));
6166 GLenum target
= n
[1].e
;
6167 GLfloat u1
= n
[2].f
;
6168 GLfloat u2
= n
[3].f
;
6169 GLfloat v1
= n
[4].f
;
6170 GLfloat v2
= n
[5].f
;
6171 GLint ustride
= n
[6].i
;
6172 GLint vstride
= n
[7].i
;
6173 GLint uorder
= n
[8].i
;
6174 GLint vorder
= n
[9].i
;
6175 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6176 v1
, v2
, vstride
, vorder
,
6177 (GLfloat
*) n
[10].data
));
6180 case OPCODE_MAPGRID1
:
6181 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
6183 case OPCODE_MAPGRID2
:
6184 CALL_MapGrid2f(ctx
->Exec
,
6185 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
6187 case OPCODE_MATRIX_MODE
:
6188 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
6190 case OPCODE_MIN_MAX
:
6191 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
6193 case OPCODE_MULT_MATRIX
:
6194 if (sizeof(Node
) == sizeof(GLfloat
)) {
6195 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
6200 for (i
= 0; i
< 16; i
++) {
6203 CALL_MultMatrixf(ctx
->Exec
, (m
));
6207 CALL_Ortho(ctx
->Exec
,
6208 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6210 case OPCODE_PASSTHROUGH
:
6211 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
6213 case OPCODE_PIXEL_MAP
:
6214 CALL_PixelMapfv(ctx
->Exec
,
6215 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
6217 case OPCODE_PIXEL_TRANSFER
:
6218 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6220 case OPCODE_PIXEL_ZOOM
:
6221 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6223 case OPCODE_POINT_SIZE
:
6224 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
6226 case OPCODE_POINT_PARAMETERS
:
6232 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
6235 case OPCODE_POLYGON_MODE
:
6236 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6238 case OPCODE_POLYGON_STIPPLE
:
6240 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6241 ctx
->Unpack
= ctx
->DefaultPacking
;
6242 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
6243 ctx
->Unpack
= save
; /* restore */
6246 case OPCODE_POLYGON_OFFSET
:
6247 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6249 case OPCODE_POP_ATTRIB
:
6250 CALL_PopAttrib(ctx
->Exec
, ());
6252 case OPCODE_POP_MATRIX
:
6253 CALL_PopMatrix(ctx
->Exec
, ());
6255 case OPCODE_POP_NAME
:
6256 CALL_PopName(ctx
->Exec
, ());
6258 case OPCODE_PRIORITIZE_TEXTURE
:
6259 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
6261 case OPCODE_PUSH_ATTRIB
:
6262 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
6264 case OPCODE_PUSH_MATRIX
:
6265 CALL_PushMatrix(ctx
->Exec
, ());
6267 case OPCODE_PUSH_NAME
:
6268 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
6270 case OPCODE_RASTER_POS
:
6271 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6273 case OPCODE_READ_BUFFER
:
6274 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
6276 case OPCODE_RESET_HISTOGRAM
:
6277 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
6279 case OPCODE_RESET_MIN_MAX
:
6280 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
6283 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6286 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6288 case OPCODE_SCISSOR
:
6289 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
6291 case OPCODE_SHADE_MODEL
:
6292 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
6294 case OPCODE_PROVOKING_VERTEX
:
6295 CALL_ProvokingVertexEXT(ctx
->Exec
, (n
[1].e
));
6297 case OPCODE_STENCIL_FUNC
:
6298 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
6300 case OPCODE_STENCIL_MASK
:
6301 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
6303 case OPCODE_STENCIL_OP
:
6304 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
6306 case OPCODE_STENCIL_FUNC_SEPARATE
:
6307 CALL_StencilFuncSeparate(ctx
->Exec
,
6308 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
6310 case OPCODE_STENCIL_MASK_SEPARATE
:
6311 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6313 case OPCODE_STENCIL_OP_SEPARATE
:
6314 CALL_StencilOpSeparate(ctx
->Exec
,
6315 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6324 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6334 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6337 case OPCODE_TEXPARAMETER
:
6344 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
6347 case OPCODE_TEX_IMAGE1D
:
6349 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6350 ctx
->Unpack
= ctx
->DefaultPacking
;
6351 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
6353 n
[3].i
, /* components */
6355 n
[5].e
, /* border */
6356 n
[6].e
, /* format */
6359 ctx
->Unpack
= save
; /* restore */
6362 case OPCODE_TEX_IMAGE2D
:
6364 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6365 ctx
->Unpack
= ctx
->DefaultPacking
;
6366 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
6368 n
[3].i
, /* components */
6370 n
[5].i
, /* height */
6371 n
[6].e
, /* border */
6372 n
[7].e
, /* format */
6375 ctx
->Unpack
= save
; /* restore */
6378 case OPCODE_TEX_IMAGE3D
:
6380 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6381 ctx
->Unpack
= ctx
->DefaultPacking
;
6382 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
6384 n
[3].i
, /* components */
6386 n
[5].i
, /* height */
6388 n
[7].e
, /* border */
6389 n
[8].e
, /* format */
6392 ctx
->Unpack
= save
; /* restore */
6395 case OPCODE_TEX_SUB_IMAGE1D
:
6397 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6398 ctx
->Unpack
= ctx
->DefaultPacking
;
6399 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6401 n
[6].e
, n
[7].data
));
6402 ctx
->Unpack
= save
; /* restore */
6405 case OPCODE_TEX_SUB_IMAGE2D
:
6407 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6408 ctx
->Unpack
= ctx
->DefaultPacking
;
6409 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6411 n
[6].i
, n
[7].e
, n
[8].e
,
6413 ctx
->Unpack
= save
; /* restore */
6416 case OPCODE_TEX_SUB_IMAGE3D
:
6418 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6419 ctx
->Unpack
= ctx
->DefaultPacking
;
6420 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6421 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6422 n
[8].i
, n
[9].e
, n
[10].e
,
6424 ctx
->Unpack
= save
; /* restore */
6427 case OPCODE_TRANSLATE
:
6428 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6430 case OPCODE_VIEWPORT
:
6431 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6432 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
6434 case OPCODE_WINDOW_POS
:
6435 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6437 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
6438 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
6440 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
6441 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6442 n
[4].i
, n
[5].i
, n
[6].i
,
6445 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
6446 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6447 n
[4].i
, n
[5].i
, n
[6].i
,
6448 n
[7].i
, n
[8].data
));
6450 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
6451 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6452 n
[4].i
, n
[5].i
, n
[6].i
,
6456 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
6457 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
6458 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6459 n
[5].e
, n
[6].i
, n
[7].data
));
6461 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
6462 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
6463 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6464 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
6467 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
6468 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
6469 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
6470 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6471 n
[9].e
, n
[10].i
, n
[11].data
));
6473 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
6474 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
6476 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
6477 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
6479 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6480 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
6481 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6484 #if FEATURE_NV_vertex_program
6485 case OPCODE_EXECUTE_PROGRAM_NV
:
6492 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
6495 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
6496 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
6497 (GLuint
*) n
[2].data
));
6499 case OPCODE_LOAD_PROGRAM_NV
:
6500 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
6501 (const GLubyte
*) n
[4].data
));
6503 case OPCODE_TRACK_MATRIX_NV
:
6504 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
6508 #if FEATURE_NV_fragment_program
6509 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
6510 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
6511 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
6514 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
6515 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
6516 (const GLubyte
*) n
[3].
6517 data
, n
[4].f
, n
[5].f
,
6522 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
6523 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
6525 case OPCODE_DEPTH_BOUNDS_EXT
:
6526 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6528 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6529 case OPCODE_PROGRAM_STRING_ARB
:
6530 CALL_ProgramStringARB(ctx
->Exec
,
6531 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
6534 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
6535 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
6536 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6541 #if FEATURE_ARB_occlusion_query
6542 case OPCODE_BEGIN_QUERY_ARB
:
6543 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6545 case OPCODE_END_QUERY_ARB
:
6546 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
6549 case OPCODE_DRAW_BUFFERS_ARB
:
6551 GLenum buffers
[MAX_DRAW_BUFFERS
];
6552 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
6553 for (i
= 0; i
< count
; i
++)
6554 buffers
[i
] = n
[2 + i
].e
;
6555 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
6558 #if FEATURE_EXT_framebuffer_blit
6559 case OPCODE_BLIT_FRAMEBUFFER
:
6560 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
6561 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6565 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
6568 GLuint i
, pname
= n
[1].ui
;
6570 for (i
= 0; i
< 4; i
++)
6571 values
[i
] = n
[1 + i
].f
;
6572 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
6575 #if FEATURE_ATI_fragment_shader
6576 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
6577 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
6579 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
6582 GLuint i
, dst
= n
[1].ui
;
6584 for (i
= 0; i
< 4; i
++)
6585 values
[i
] = n
[1 + i
].f
;
6586 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
6590 case OPCODE_ATTR_1F_NV
:
6591 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6593 case OPCODE_ATTR_2F_NV
:
6594 /* Really shouldn't have to do this - the Node structure
6595 * is convenient, but it would be better to store the data
6596 * packed appropriately so that it can be sent directly
6597 * on. With x86_64 becoming common, this will start to
6600 if (sizeof(Node
) == sizeof(GLfloat
))
6601 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6603 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6605 case OPCODE_ATTR_3F_NV
:
6606 if (sizeof(Node
) == sizeof(GLfloat
))
6607 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6609 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6612 case OPCODE_ATTR_4F_NV
:
6613 if (sizeof(Node
) == sizeof(GLfloat
))
6614 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6616 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6619 case OPCODE_ATTR_1F_ARB
:
6620 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6622 case OPCODE_ATTR_2F_ARB
:
6623 /* Really shouldn't have to do this - the Node structure
6624 * is convenient, but it would be better to store the data
6625 * packed appropriately so that it can be sent directly
6626 * on. With x86_64 becoming common, this will start to
6629 if (sizeof(Node
) == sizeof(GLfloat
))
6630 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6632 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6634 case OPCODE_ATTR_3F_ARB
:
6635 if (sizeof(Node
) == sizeof(GLfloat
))
6636 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6638 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6641 case OPCODE_ATTR_4F_ARB
:
6642 if (sizeof(Node
) == sizeof(GLfloat
))
6643 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6645 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6648 case OPCODE_MATERIAL
:
6649 if (sizeof(Node
) == sizeof(GLfloat
))
6650 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
6657 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
6661 CALL_Begin(ctx
->Exec
, (n
[1].e
));
6664 CALL_End(ctx
->Exec
, ());
6667 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6669 case OPCODE_EVAL_C1
:
6670 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
6672 case OPCODE_EVAL_C2
:
6673 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6675 case OPCODE_EVAL_P1
:
6676 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
6678 case OPCODE_EVAL_P2
:
6679 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
6682 case OPCODE_CONTINUE
:
6683 n
= (Node
*) n
[1].next
;
6685 case OPCODE_END_OF_LIST
:
6691 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d",
6693 _mesa_problem(ctx
, msg
);
6698 /* increment n to point to next compiled command */
6699 if (opcode
!= OPCODE_CONTINUE
) {
6700 n
+= InstSize
[opcode
];
6705 if (ctx
->Driver
.EndCallList
)
6706 ctx
->Driver
.EndCallList(ctx
);
6708 ctx
->ListState
.CallDepth
--;
6713 /**********************************************************************/
6715 /**********************************************************************/
6718 * Test if a display list number is valid.
6720 GLboolean GLAPIENTRY
6721 _mesa_IsList(GLuint list
)
6723 GET_CURRENT_CONTEXT(ctx
);
6724 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6725 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6726 return islist(ctx
, list
);
6731 * Delete a sequence of consecutive display lists.
6734 _mesa_DeleteLists(GLuint list
, GLsizei range
)
6736 GET_CURRENT_CONTEXT(ctx
);
6738 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6739 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6742 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
6745 for (i
= list
; i
< list
+ range
; i
++) {
6746 destroy_list(ctx
, i
);
6752 * Return a display list number, n, such that lists n through n+range-1
6756 _mesa_GenLists(GLsizei range
)
6758 GET_CURRENT_CONTEXT(ctx
);
6760 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6761 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6764 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
6772 * Make this an atomic operation
6774 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6776 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6778 /* reserve the list IDs by with empty/dummy lists */
6780 for (i
= 0; i
< range
; i
++) {
6781 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
6782 make_list(base
+ i
, 1));
6786 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6793 * Begin a new display list.
6796 _mesa_NewList(GLuint name
, GLenum mode
)
6798 GET_CURRENT_CONTEXT(ctx
);
6801 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6802 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6804 if (MESA_VERBOSE
& VERBOSE_API
)
6805 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
6806 _mesa_lookup_enum_by_nr(mode
));
6809 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
6813 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
6814 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
6818 if (ctx
->ListState
.CurrentList
) {
6819 /* already compiling a display list */
6820 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
6824 ctx
->CompileFlag
= GL_TRUE
;
6825 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6827 /* Allocate new display list */
6828 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
6829 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
6830 ctx
->ListState
.CurrentPos
= 0;
6832 /* Reset acumulated list state:
6834 for (i
= 0; i
< Elements(ctx
->ListState
.ActiveAttribSize
); i
++)
6835 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
6837 for (i
= 0; i
< Elements(ctx
->ListState
.ActiveMaterialSize
); i
++)
6838 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
6840 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
6841 ctx
->Driver
.NewList(ctx
, name
, mode
);
6843 ctx
->CurrentDispatch
= ctx
->Save
;
6844 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6849 * End definition of current display list.
6854 GET_CURRENT_CONTEXT(ctx
);
6855 SAVE_FLUSH_VERTICES(ctx
);
6856 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6858 if (MESA_VERBOSE
& VERBOSE_API
)
6859 _mesa_debug(ctx
, "glEndList\n");
6861 /* Check that a list is under construction */
6862 if (!ctx
->ListState
.CurrentList
) {
6863 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
6867 /* Call before emitting END_OF_LIST, in case the driver wants to
6868 * emit opcodes itself.
6870 ctx
->Driver
.EndList(ctx
);
6872 (void) ALLOC_INSTRUCTION(ctx
, OPCODE_END_OF_LIST
, 0);
6874 /* Destroy old list, if any */
6875 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
6877 /* Install the new list */
6878 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
6879 ctx
->ListState
.CurrentList
->Name
,
6880 ctx
->ListState
.CurrentList
);
6883 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6884 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
6886 ctx
->ListState
.CurrentList
= NULL
;
6887 ctx
->ExecuteFlag
= GL_TRUE
;
6888 ctx
->CompileFlag
= GL_FALSE
;
6890 ctx
->CurrentDispatch
= ctx
->Exec
;
6891 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6896 _mesa_CallList(GLuint list
)
6898 GLboolean save_compile_flag
;
6899 GET_CURRENT_CONTEXT(ctx
);
6900 FLUSH_CURRENT(ctx
, 0);
6901 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6902 /* execute the display list, and restore the CompileFlag. */
6904 if (MESA_VERBOSE
& VERBOSE_API
)
6905 _mesa_debug(ctx
, "glCallList %d\n", list
);
6908 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6912 /* mesa_print_display_list( list ); */
6914 save_compile_flag
= ctx
->CompileFlag
;
6915 if (save_compile_flag
) {
6916 ctx
->CompileFlag
= GL_FALSE
;
6919 execute_list(ctx
, list
);
6920 ctx
->CompileFlag
= save_compile_flag
;
6922 /* also restore API function pointers to point to "save" versions */
6923 if (save_compile_flag
) {
6924 ctx
->CurrentDispatch
= ctx
->Save
;
6925 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6931 * Execute glCallLists: call multiple display lists.
6934 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
6936 GET_CURRENT_CONTEXT(ctx
);
6938 GLboolean save_compile_flag
;
6940 if (MESA_VERBOSE
& VERBOSE_API
)
6941 _mesa_debug(ctx
, "glCallLists %d\n", n
);
6945 case GL_UNSIGNED_BYTE
:
6947 case GL_UNSIGNED_SHORT
:
6949 case GL_UNSIGNED_INT
:
6957 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6961 /* Save the CompileFlag status, turn it off, execute display list,
6962 * and restore the CompileFlag.
6964 save_compile_flag
= ctx
->CompileFlag
;
6965 ctx
->CompileFlag
= GL_FALSE
;
6967 for (i
= 0; i
< n
; i
++) {
6968 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
6969 execute_list(ctx
, list
);
6972 ctx
->CompileFlag
= save_compile_flag
;
6974 /* also restore API function pointers to point to "save" versions */
6975 if (save_compile_flag
) {
6976 ctx
->CurrentDispatch
= ctx
->Save
;
6977 _glapi_set_dispatch(ctx
->CurrentDispatch
);
6983 * Set the offset added to list numbers in glCallLists.
6986 _mesa_ListBase(GLuint base
)
6988 GET_CURRENT_CONTEXT(ctx
);
6989 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6990 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6991 ctx
->List
.ListBase
= base
;
6995 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
6997 static void GLAPIENTRY
7000 GET_CURRENT_CONTEXT(ctx
);
7001 FLUSH_VERTICES(ctx
, 0);
7002 CALL_Finish(ctx
->Exec
, ());
7005 static void GLAPIENTRY
7008 GET_CURRENT_CONTEXT(ctx
);
7009 FLUSH_VERTICES(ctx
, 0);
7010 CALL_Flush(ctx
->Exec
, ());
7013 static void GLAPIENTRY
7014 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
7016 GET_CURRENT_CONTEXT(ctx
);
7017 FLUSH_VERTICES(ctx
, 0);
7018 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
7021 static void GLAPIENTRY
7022 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
7024 GET_CURRENT_CONTEXT(ctx
);
7025 FLUSH_VERTICES(ctx
, 0);
7026 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
7029 static void GLAPIENTRY
7030 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
7032 GET_CURRENT_CONTEXT(ctx
);
7033 FLUSH_VERTICES(ctx
, 0);
7034 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
7037 static GLenum GLAPIENTRY
7040 GET_CURRENT_CONTEXT(ctx
);
7041 FLUSH_VERTICES(ctx
, 0);
7042 return CALL_GetError(ctx
->Exec
, ());
7045 static void GLAPIENTRY
7046 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
7048 GET_CURRENT_CONTEXT(ctx
);
7049 FLUSH_VERTICES(ctx
, 0);
7050 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
7053 static void GLAPIENTRY
7054 exec_GetIntegerv(GLenum pname
, GLint
*params
)
7056 GET_CURRENT_CONTEXT(ctx
);
7057 FLUSH_VERTICES(ctx
, 0);
7058 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
7061 static void GLAPIENTRY
7062 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
7064 GET_CURRENT_CONTEXT(ctx
);
7065 FLUSH_VERTICES(ctx
, 0);
7066 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
7069 static void GLAPIENTRY
7070 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
7072 GET_CURRENT_CONTEXT(ctx
);
7073 FLUSH_VERTICES(ctx
, 0);
7074 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
7077 static void GLAPIENTRY
7078 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
7080 GET_CURRENT_CONTEXT(ctx
);
7081 FLUSH_VERTICES(ctx
, 0);
7082 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
7085 static void GLAPIENTRY
7086 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
7088 GET_CURRENT_CONTEXT(ctx
);
7089 FLUSH_VERTICES(ctx
, 0);
7090 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
7093 static void GLAPIENTRY
7094 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
7096 GET_CURRENT_CONTEXT(ctx
);
7097 FLUSH_VERTICES(ctx
, 0);
7098 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
7101 static void GLAPIENTRY
7102 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
7104 GET_CURRENT_CONTEXT(ctx
);
7105 FLUSH_VERTICES(ctx
, 0);
7106 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
7109 static void GLAPIENTRY
7110 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
7112 GET_CURRENT_CONTEXT(ctx
);
7113 FLUSH_VERTICES(ctx
, 0);
7114 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
7117 static void GLAPIENTRY
7118 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
7120 GET_CURRENT_CONTEXT(ctx
);
7121 FLUSH_VERTICES(ctx
, 0);
7122 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
7125 static void GLAPIENTRY
7126 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
7128 GET_CURRENT_CONTEXT(ctx
);
7129 FLUSH_VERTICES(ctx
, 0);
7130 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
7133 static void GLAPIENTRY
7134 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
7136 GET_CURRENT_CONTEXT(ctx
);
7137 FLUSH_VERTICES(ctx
, 0);
7138 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
7141 static void GLAPIENTRY
7142 exec_GetPolygonStipple(GLubyte
* dest
)
7144 GET_CURRENT_CONTEXT(ctx
);
7145 FLUSH_VERTICES(ctx
, 0);
7146 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
7149 static const GLubyte
*GLAPIENTRY
7150 exec_GetString(GLenum name
)
7152 GET_CURRENT_CONTEXT(ctx
);
7153 FLUSH_VERTICES(ctx
, 0);
7154 return CALL_GetString(ctx
->Exec
, (name
));
7157 static void GLAPIENTRY
7158 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7160 GET_CURRENT_CONTEXT(ctx
);
7161 FLUSH_VERTICES(ctx
, 0);
7162 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
7165 static void GLAPIENTRY
7166 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
7168 GET_CURRENT_CONTEXT(ctx
);
7169 FLUSH_VERTICES(ctx
, 0);
7170 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
7173 static void GLAPIENTRY
7174 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
7176 GET_CURRENT_CONTEXT(ctx
);
7177 FLUSH_VERTICES(ctx
, 0);
7178 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
7181 static void GLAPIENTRY
7182 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
7184 GET_CURRENT_CONTEXT(ctx
);
7185 FLUSH_VERTICES(ctx
, 0);
7186 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
7189 static void GLAPIENTRY
7190 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
7192 GET_CURRENT_CONTEXT(ctx
);
7193 FLUSH_VERTICES(ctx
, 0);
7194 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
7197 static void GLAPIENTRY
7198 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
7199 GLenum type
, GLvoid
* pixels
)
7201 GET_CURRENT_CONTEXT(ctx
);
7202 FLUSH_VERTICES(ctx
, 0);
7203 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
7206 static void GLAPIENTRY
7207 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
7208 GLenum pname
, GLfloat
*params
)
7210 GET_CURRENT_CONTEXT(ctx
);
7211 FLUSH_VERTICES(ctx
, 0);
7212 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
7215 static void GLAPIENTRY
7216 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
7217 GLenum pname
, GLint
*params
)
7219 GET_CURRENT_CONTEXT(ctx
);
7220 FLUSH_VERTICES(ctx
, 0);
7221 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
7224 static void GLAPIENTRY
7225 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7227 GET_CURRENT_CONTEXT(ctx
);
7228 FLUSH_VERTICES(ctx
, 0);
7229 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
7232 static void GLAPIENTRY
7233 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7235 GET_CURRENT_CONTEXT(ctx
);
7236 FLUSH_VERTICES(ctx
, 0);
7237 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
7240 static GLboolean GLAPIENTRY
7241 exec_IsEnabled(GLenum cap
)
7243 GET_CURRENT_CONTEXT(ctx
);
7244 FLUSH_VERTICES(ctx
, 0);
7245 return CALL_IsEnabled(ctx
->Exec
, (cap
));
7248 static void GLAPIENTRY
7249 exec_PixelStoref(GLenum pname
, GLfloat param
)
7251 GET_CURRENT_CONTEXT(ctx
);
7252 FLUSH_VERTICES(ctx
, 0);
7253 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
7256 static void GLAPIENTRY
7257 exec_PixelStorei(GLenum pname
, GLint param
)
7259 GET_CURRENT_CONTEXT(ctx
);
7260 FLUSH_VERTICES(ctx
, 0);
7261 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
7264 static void GLAPIENTRY
7265 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
7266 GLenum format
, GLenum type
, GLvoid
* pixels
)
7268 GET_CURRENT_CONTEXT(ctx
);
7269 FLUSH_VERTICES(ctx
, 0);
7270 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
7273 static GLint GLAPIENTRY
7274 exec_RenderMode(GLenum mode
)
7276 GET_CURRENT_CONTEXT(ctx
);
7277 FLUSH_VERTICES(ctx
, 0);
7278 return CALL_RenderMode(ctx
->Exec
, (mode
));
7281 static void GLAPIENTRY
7282 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
7284 GET_CURRENT_CONTEXT(ctx
);
7285 FLUSH_VERTICES(ctx
, 0);
7286 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
7289 static void GLAPIENTRY
7290 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
7292 GET_CURRENT_CONTEXT(ctx
);
7293 FLUSH_VERTICES(ctx
, 0);
7294 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
7297 static GLboolean GLAPIENTRY
7298 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
7299 GLboolean
* residences
)
7301 GET_CURRENT_CONTEXT(ctx
);
7302 FLUSH_VERTICES(ctx
, 0);
7303 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
7306 static void GLAPIENTRY
7307 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7309 GET_CURRENT_CONTEXT(ctx
);
7310 FLUSH_VERTICES(ctx
, 0);
7311 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7314 static void GLAPIENTRY
7315 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
7317 GET_CURRENT_CONTEXT(ctx
);
7318 FLUSH_VERTICES(ctx
, 0);
7319 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
7322 static void GLAPIENTRY
7323 exec_DisableClientState(GLenum cap
)
7325 GET_CURRENT_CONTEXT(ctx
);
7326 FLUSH_VERTICES(ctx
, 0);
7327 CALL_DisableClientState(ctx
->Exec
, (cap
));
7330 static void GLAPIENTRY
7331 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
7333 GET_CURRENT_CONTEXT(ctx
);
7334 FLUSH_VERTICES(ctx
, 0);
7335 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
7338 static void GLAPIENTRY
7339 exec_EnableClientState(GLenum cap
)
7341 GET_CURRENT_CONTEXT(ctx
);
7342 FLUSH_VERTICES(ctx
, 0);
7343 CALL_EnableClientState(ctx
->Exec
, (cap
));
7346 static void GLAPIENTRY
7347 exec_GenTextures(GLsizei n
, GLuint
* texName
)
7349 GET_CURRENT_CONTEXT(ctx
);
7350 FLUSH_VERTICES(ctx
, 0);
7351 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
7354 static void GLAPIENTRY
7355 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
7357 GET_CURRENT_CONTEXT(ctx
);
7358 FLUSH_VERTICES(ctx
, 0);
7359 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
7362 static void GLAPIENTRY
7363 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7365 GET_CURRENT_CONTEXT(ctx
);
7366 FLUSH_VERTICES(ctx
, 0);
7367 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
7370 static void GLAPIENTRY
7371 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
7373 GET_CURRENT_CONTEXT(ctx
);
7374 FLUSH_VERTICES(ctx
, 0);
7375 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
7378 static GLboolean GLAPIENTRY
7379 exec_IsTexture(GLuint texture
)
7381 GET_CURRENT_CONTEXT(ctx
);
7382 FLUSH_VERTICES(ctx
, 0);
7383 return CALL_IsTexture(ctx
->Exec
, (texture
));
7386 static void GLAPIENTRY
7387 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7389 GET_CURRENT_CONTEXT(ctx
);
7390 FLUSH_VERTICES(ctx
, 0);
7391 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
7394 static void GLAPIENTRY
7395 exec_PopClientAttrib(void)
7397 GET_CURRENT_CONTEXT(ctx
);
7398 FLUSH_VERTICES(ctx
, 0);
7399 CALL_PopClientAttrib(ctx
->Exec
, ());
7402 static void GLAPIENTRY
7403 exec_PushClientAttrib(GLbitfield mask
)
7405 GET_CURRENT_CONTEXT(ctx
);
7406 FLUSH_VERTICES(ctx
, 0);
7407 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
7410 static void GLAPIENTRY
7411 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
7414 GET_CURRENT_CONTEXT(ctx
);
7415 FLUSH_VERTICES(ctx
, 0);
7416 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7419 static void GLAPIENTRY
7420 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
7422 GET_CURRENT_CONTEXT(ctx
);
7423 FLUSH_VERTICES(ctx
, 0);
7424 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
7427 static void GLAPIENTRY
7428 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
7431 GET_CURRENT_CONTEXT(ctx
);
7432 FLUSH_VERTICES(ctx
, 0);
7433 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
7436 static void GLAPIENTRY
7437 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
7438 GLint x
, GLint y
, GLsizei width
)
7440 GET_CURRENT_CONTEXT(ctx
);
7441 FLUSH_VERTICES(ctx
, 0);
7442 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
7443 (target
, internalFormat
, x
, y
, width
));
7446 static void GLAPIENTRY
7447 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
7448 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
7450 GET_CURRENT_CONTEXT(ctx
);
7451 FLUSH_VERTICES(ctx
, 0);
7452 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
7453 (target
, internalFormat
, x
, y
, width
,
7457 static void GLAPIENTRY
7458 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
7460 GET_CURRENT_CONTEXT(ctx
);
7461 FLUSH_VERTICES(ctx
, 0);
7462 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
7465 static void GLAPIENTRY
7466 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7468 GET_CURRENT_CONTEXT(ctx
);
7469 FLUSH_VERTICES(ctx
, 0);
7470 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
7473 static void GLAPIENTRY
7474 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7476 GET_CURRENT_CONTEXT(ctx
);
7477 FLUSH_VERTICES(ctx
, 0);
7478 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
7481 static void GLAPIENTRY
7482 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
7485 GET_CURRENT_CONTEXT(ctx
);
7486 FLUSH_VERTICES(ctx
, 0);
7487 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
7490 static void GLAPIENTRY
7491 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7493 GET_CURRENT_CONTEXT(ctx
);
7494 FLUSH_VERTICES(ctx
, 0);
7495 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
7498 static void GLAPIENTRY
7499 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7501 GET_CURRENT_CONTEXT(ctx
);
7502 FLUSH_VERTICES(ctx
, 0);
7503 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
7506 static void GLAPIENTRY
7507 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
7508 GLenum type
, GLvoid
*values
)
7510 GET_CURRENT_CONTEXT(ctx
);
7511 FLUSH_VERTICES(ctx
, 0);
7512 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7515 static void GLAPIENTRY
7516 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7518 GET_CURRENT_CONTEXT(ctx
);
7519 FLUSH_VERTICES(ctx
, 0);
7520 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
7523 static void GLAPIENTRY
7524 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7526 GET_CURRENT_CONTEXT(ctx
);
7527 FLUSH_VERTICES(ctx
, 0);
7528 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
7531 static void GLAPIENTRY
7532 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
7533 GLenum type
, GLvoid
*values
)
7535 GET_CURRENT_CONTEXT(ctx
);
7536 FLUSH_VERTICES(ctx
, 0);
7537 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
7540 static void GLAPIENTRY
7541 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
7543 GET_CURRENT_CONTEXT(ctx
);
7544 FLUSH_VERTICES(ctx
, 0);
7545 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
7548 static void GLAPIENTRY
7549 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
7551 GET_CURRENT_CONTEXT(ctx
);
7552 FLUSH_VERTICES(ctx
, 0);
7553 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
7556 static void GLAPIENTRY
7557 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
7558 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
7560 GET_CURRENT_CONTEXT(ctx
);
7561 FLUSH_VERTICES(ctx
, 0);
7562 CALL_GetSeparableFilter(ctx
->Exec
,
7563 (target
, format
, type
, row
, column
, span
));
7566 static void GLAPIENTRY
7567 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
7568 GLsizei width
, GLsizei height
, GLenum format
,
7569 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
7571 GET_CURRENT_CONTEXT(ctx
);
7572 FLUSH_VERTICES(ctx
, 0);
7573 CALL_SeparableFilter2D(ctx
->Exec
,
7574 (target
, internalFormat
, width
, height
, format
,
7575 type
, row
, column
));
7578 static void GLAPIENTRY
7579 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7580 GLsizei count
, const GLvoid
*ptr
)
7582 GET_CURRENT_CONTEXT(ctx
);
7583 FLUSH_VERTICES(ctx
, 0);
7584 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7587 static void GLAPIENTRY
7588 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
7590 GET_CURRENT_CONTEXT(ctx
);
7591 FLUSH_VERTICES(ctx
, 0);
7592 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
7595 static void GLAPIENTRY
7596 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7599 GET_CURRENT_CONTEXT(ctx
);
7600 FLUSH_VERTICES(ctx
, 0);
7601 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
7604 static void GLAPIENTRY
7605 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7608 GET_CURRENT_CONTEXT(ctx
);
7609 FLUSH_VERTICES(ctx
, 0);
7610 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
7613 static void GLAPIENTRY
7614 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7615 GLsizei count
, const GLvoid
*ptr
)
7617 GET_CURRENT_CONTEXT(ctx
);
7618 FLUSH_VERTICES(ctx
, 0);
7619 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7622 static void GLAPIENTRY
7623 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7624 GLsizei count
, const GLvoid
*ptr
)
7626 GET_CURRENT_CONTEXT(ctx
);
7627 FLUSH_VERTICES(ctx
, 0);
7628 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
7631 static void GLAPIENTRY
7632 exec_LockArraysEXT(GLint first
, GLsizei count
)
7634 GET_CURRENT_CONTEXT(ctx
);
7635 FLUSH_VERTICES(ctx
, 0);
7636 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
7639 static void GLAPIENTRY
7640 exec_UnlockArraysEXT(void)
7642 GET_CURRENT_CONTEXT(ctx
);
7643 FLUSH_VERTICES(ctx
, 0);
7644 CALL_UnlockArraysEXT(ctx
->Exec
, ());
7647 static void GLAPIENTRY
7648 exec_ClientActiveTextureARB(GLenum target
)
7650 GET_CURRENT_CONTEXT(ctx
);
7651 FLUSH_VERTICES(ctx
, 0);
7652 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
7655 static void GLAPIENTRY
7656 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
7657 GLsizei stride
, const GLvoid
*ptr
)
7659 GET_CURRENT_CONTEXT(ctx
);
7660 FLUSH_VERTICES(ctx
, 0);
7661 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
7664 static void GLAPIENTRY
7665 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7667 GET_CURRENT_CONTEXT(ctx
);
7668 FLUSH_VERTICES(ctx
, 0);
7669 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
7672 /* GL_EXT_multi_draw_arrays */
7673 static void GLAPIENTRY
7674 exec_MultiDrawArraysEXT(GLenum mode
, GLint
* first
,
7675 GLsizei
* count
, GLsizei primcount
)
7677 GET_CURRENT_CONTEXT(ctx
);
7678 FLUSH_VERTICES(ctx
, 0);
7679 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
7682 /* GL_EXT_multi_draw_arrays */
7683 static void GLAPIENTRY
7684 exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
* count
,
7685 GLenum type
, const GLvoid
** indices
,
7688 GET_CURRENT_CONTEXT(ctx
);
7689 FLUSH_VERTICES(ctx
, 0);
7690 CALL_MultiDrawElementsEXT(ctx
->Exec
,
7691 (mode
, count
, type
, indices
, primcount
));
7694 /* GL_IBM_multimode_draw_arrays */
7695 static void GLAPIENTRY
7696 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
7697 const GLsizei
* count
, GLsizei primcount
,
7700 GET_CURRENT_CONTEXT(ctx
);
7701 FLUSH_VERTICES(ctx
, 0);
7702 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
7703 (mode
, first
, count
, primcount
, modestride
));
7706 /* GL_IBM_multimode_draw_arrays */
7707 static void GLAPIENTRY
7708 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
7709 const GLsizei
* count
,
7711 const GLvoid
* const *indices
,
7712 GLsizei primcount
, GLint modestride
)
7714 GET_CURRENT_CONTEXT(ctx
);
7715 FLUSH_VERTICES(ctx
, 0);
7716 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
7717 (mode
, count
, type
, indices
, primcount
,
7724 * Setup the given dispatch table to point to Mesa's display list
7725 * building functions.
7727 * This does not include any of the tnl functions - they are
7728 * initialized from _mesa_init_api_defaults and from the active vtxfmt
7732 _mesa_init_dlist_table(struct _glapi_table
*table
)
7734 _mesa_loopback_init_api_table(table
);
7737 SET_Accum(table
, save_Accum
);
7738 SET_AlphaFunc(table
, save_AlphaFunc
);
7739 SET_Bitmap(table
, save_Bitmap
);
7740 SET_BlendFunc(table
, save_BlendFunc
);
7741 SET_CallList(table
, _mesa_save_CallList
);
7742 SET_CallLists(table
, _mesa_save_CallLists
);
7743 SET_Clear(table
, save_Clear
);
7744 SET_ClearAccum(table
, save_ClearAccum
);
7745 SET_ClearColor(table
, save_ClearColor
);
7746 SET_ClearDepth(table
, save_ClearDepth
);
7747 SET_ClearIndex(table
, save_ClearIndex
);
7748 SET_ClearStencil(table
, save_ClearStencil
);
7749 SET_ClipPlane(table
, save_ClipPlane
);
7750 SET_ColorMask(table
, save_ColorMask
);
7751 SET_ColorMaterial(table
, save_ColorMaterial
);
7752 SET_CopyPixels(table
, save_CopyPixels
);
7753 SET_CullFace(table
, save_CullFace
);
7754 SET_DeleteLists(table
, _mesa_DeleteLists
);
7755 SET_DepthFunc(table
, save_DepthFunc
);
7756 SET_DepthMask(table
, save_DepthMask
);
7757 SET_DepthRange(table
, save_DepthRange
);
7758 SET_Disable(table
, save_Disable
);
7759 SET_DrawBuffer(table
, save_DrawBuffer
);
7760 SET_DrawPixels(table
, save_DrawPixels
);
7761 SET_Enable(table
, save_Enable
);
7762 SET_EndList(table
, _mesa_EndList
);
7763 SET_EvalMesh1(table
, _mesa_save_EvalMesh1
);
7764 SET_EvalMesh2(table
, _mesa_save_EvalMesh2
);
7765 SET_Finish(table
, exec_Finish
);
7766 SET_Flush(table
, exec_Flush
);
7767 SET_Fogf(table
, save_Fogf
);
7768 SET_Fogfv(table
, save_Fogfv
);
7769 SET_Fogi(table
, save_Fogi
);
7770 SET_Fogiv(table
, save_Fogiv
);
7771 SET_FrontFace(table
, save_FrontFace
);
7772 SET_Frustum(table
, save_Frustum
);
7773 SET_GenLists(table
, _mesa_GenLists
);
7774 SET_GetBooleanv(table
, exec_GetBooleanv
);
7775 SET_GetClipPlane(table
, exec_GetClipPlane
);
7776 SET_GetDoublev(table
, exec_GetDoublev
);
7777 SET_GetError(table
, exec_GetError
);
7778 SET_GetFloatv(table
, exec_GetFloatv
);
7779 SET_GetIntegerv(table
, exec_GetIntegerv
);
7780 SET_GetLightfv(table
, exec_GetLightfv
);
7781 SET_GetLightiv(table
, exec_GetLightiv
);
7782 SET_GetMapdv(table
, exec_GetMapdv
);
7783 SET_GetMapfv(table
, exec_GetMapfv
);
7784 SET_GetMapiv(table
, exec_GetMapiv
);
7785 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
7786 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
7787 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
7788 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
7789 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
7790 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
7791 SET_GetString(table
, exec_GetString
);
7792 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
7793 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
7794 SET_GetTexGendv(table
, exec_GetTexGendv
);
7795 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
7796 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
7797 SET_GetTexImage(table
, exec_GetTexImage
);
7798 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
7799 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
7800 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
7801 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
7802 SET_Hint(table
, save_Hint
);
7803 SET_IndexMask(table
, save_IndexMask
);
7804 SET_InitNames(table
, save_InitNames
);
7805 SET_IsEnabled(table
, exec_IsEnabled
);
7806 SET_IsList(table
, _mesa_IsList
);
7807 SET_LightModelf(table
, save_LightModelf
);
7808 SET_LightModelfv(table
, save_LightModelfv
);
7809 SET_LightModeli(table
, save_LightModeli
);
7810 SET_LightModeliv(table
, save_LightModeliv
);
7811 SET_Lightf(table
, save_Lightf
);
7812 SET_Lightfv(table
, save_Lightfv
);
7813 SET_Lighti(table
, save_Lighti
);
7814 SET_Lightiv(table
, save_Lightiv
);
7815 SET_LineStipple(table
, save_LineStipple
);
7816 SET_LineWidth(table
, save_LineWidth
);
7817 SET_ListBase(table
, save_ListBase
);
7818 SET_LoadIdentity(table
, save_LoadIdentity
);
7819 SET_LoadMatrixd(table
, save_LoadMatrixd
);
7820 SET_LoadMatrixf(table
, save_LoadMatrixf
);
7821 SET_LoadName(table
, save_LoadName
);
7822 SET_LogicOp(table
, save_LogicOp
);
7823 SET_Map1d(table
, save_Map1d
);
7824 SET_Map1f(table
, save_Map1f
);
7825 SET_Map2d(table
, save_Map2d
);
7826 SET_Map2f(table
, save_Map2f
);
7827 SET_MapGrid1d(table
, save_MapGrid1d
);
7828 SET_MapGrid1f(table
, save_MapGrid1f
);
7829 SET_MapGrid2d(table
, save_MapGrid2d
);
7830 SET_MapGrid2f(table
, save_MapGrid2f
);
7831 SET_MatrixMode(table
, save_MatrixMode
);
7832 SET_MultMatrixd(table
, save_MultMatrixd
);
7833 SET_MultMatrixf(table
, save_MultMatrixf
);
7834 SET_NewList(table
, save_NewList
);
7835 SET_Ortho(table
, save_Ortho
);
7836 SET_PassThrough(table
, save_PassThrough
);
7837 SET_PixelMapfv(table
, save_PixelMapfv
);
7838 SET_PixelMapuiv(table
, save_PixelMapuiv
);
7839 SET_PixelMapusv(table
, save_PixelMapusv
);
7840 SET_PixelStoref(table
, exec_PixelStoref
);
7841 SET_PixelStorei(table
, exec_PixelStorei
);
7842 SET_PixelTransferf(table
, save_PixelTransferf
);
7843 SET_PixelTransferi(table
, save_PixelTransferi
);
7844 SET_PixelZoom(table
, save_PixelZoom
);
7845 SET_PointSize(table
, save_PointSize
);
7846 SET_PolygonMode(table
, save_PolygonMode
);
7847 SET_PolygonOffset(table
, save_PolygonOffset
);
7848 SET_PolygonStipple(table
, save_PolygonStipple
);
7849 SET_PopAttrib(table
, save_PopAttrib
);
7850 SET_PopMatrix(table
, save_PopMatrix
);
7851 SET_PopName(table
, save_PopName
);
7852 SET_PushAttrib(table
, save_PushAttrib
);
7853 SET_PushMatrix(table
, save_PushMatrix
);
7854 SET_PushName(table
, save_PushName
);
7855 SET_RasterPos2d(table
, save_RasterPos2d
);
7856 SET_RasterPos2dv(table
, save_RasterPos2dv
);
7857 SET_RasterPos2f(table
, save_RasterPos2f
);
7858 SET_RasterPos2fv(table
, save_RasterPos2fv
);
7859 SET_RasterPos2i(table
, save_RasterPos2i
);
7860 SET_RasterPos2iv(table
, save_RasterPos2iv
);
7861 SET_RasterPos2s(table
, save_RasterPos2s
);
7862 SET_RasterPos2sv(table
, save_RasterPos2sv
);
7863 SET_RasterPos3d(table
, save_RasterPos3d
);
7864 SET_RasterPos3dv(table
, save_RasterPos3dv
);
7865 SET_RasterPos3f(table
, save_RasterPos3f
);
7866 SET_RasterPos3fv(table
, save_RasterPos3fv
);
7867 SET_RasterPos3i(table
, save_RasterPos3i
);
7868 SET_RasterPos3iv(table
, save_RasterPos3iv
);
7869 SET_RasterPos3s(table
, save_RasterPos3s
);
7870 SET_RasterPos3sv(table
, save_RasterPos3sv
);
7871 SET_RasterPos4d(table
, save_RasterPos4d
);
7872 SET_RasterPos4dv(table
, save_RasterPos4dv
);
7873 SET_RasterPos4f(table
, save_RasterPos4f
);
7874 SET_RasterPos4fv(table
, save_RasterPos4fv
);
7875 SET_RasterPos4i(table
, save_RasterPos4i
);
7876 SET_RasterPos4iv(table
, save_RasterPos4iv
);
7877 SET_RasterPos4s(table
, save_RasterPos4s
);
7878 SET_RasterPos4sv(table
, save_RasterPos4sv
);
7879 SET_ReadBuffer(table
, save_ReadBuffer
);
7880 SET_ReadPixels(table
, exec_ReadPixels
);
7881 SET_RenderMode(table
, exec_RenderMode
);
7882 SET_Rotated(table
, save_Rotated
);
7883 SET_Rotatef(table
, save_Rotatef
);
7884 SET_Scaled(table
, save_Scaled
);
7885 SET_Scalef(table
, save_Scalef
);
7886 SET_Scissor(table
, save_Scissor
);
7887 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
7888 SET_SelectBuffer(table
, exec_SelectBuffer
);
7889 SET_ShadeModel(table
, save_ShadeModel
);
7890 SET_StencilFunc(table
, save_StencilFunc
);
7891 SET_StencilMask(table
, save_StencilMask
);
7892 SET_StencilOp(table
, save_StencilOp
);
7893 SET_TexEnvf(table
, save_TexEnvf
);
7894 SET_TexEnvfv(table
, save_TexEnvfv
);
7895 SET_TexEnvi(table
, save_TexEnvi
);
7896 SET_TexEnviv(table
, save_TexEnviv
);
7897 SET_TexGend(table
, save_TexGend
);
7898 SET_TexGendv(table
, save_TexGendv
);
7899 SET_TexGenf(table
, save_TexGenf
);
7900 SET_TexGenfv(table
, save_TexGenfv
);
7901 SET_TexGeni(table
, save_TexGeni
);
7902 SET_TexGeniv(table
, save_TexGeniv
);
7903 SET_TexImage1D(table
, save_TexImage1D
);
7904 SET_TexImage2D(table
, save_TexImage2D
);
7905 SET_TexParameterf(table
, save_TexParameterf
);
7906 SET_TexParameterfv(table
, save_TexParameterfv
);
7907 SET_TexParameteri(table
, save_TexParameteri
);
7908 SET_TexParameteriv(table
, save_TexParameteriv
);
7909 SET_Translated(table
, save_Translated
);
7910 SET_Translatef(table
, save_Translatef
);
7911 SET_Viewport(table
, save_Viewport
);
7914 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
7915 SET_BindTexture(table
, save_BindTexture
);
7916 SET_ColorPointer(table
, exec_ColorPointer
);
7917 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
7918 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
7919 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
7920 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
7921 SET_DeleteTextures(table
, exec_DeleteTextures
);
7922 SET_DisableClientState(table
, exec_DisableClientState
);
7923 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
7924 SET_EnableClientState(table
, exec_EnableClientState
);
7925 SET_GenTextures(table
, exec_GenTextures
);
7926 SET_GetPointerv(table
, exec_GetPointerv
);
7927 SET_IndexPointer(table
, exec_IndexPointer
);
7928 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
7929 SET_IsTexture(table
, exec_IsTexture
);
7930 SET_NormalPointer(table
, exec_NormalPointer
);
7931 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
7932 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
7933 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
7934 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
7935 SET_TexSubImage1D(table
, save_TexSubImage1D
);
7936 SET_TexSubImage2D(table
, save_TexSubImage2D
);
7937 SET_VertexPointer(table
, exec_VertexPointer
);
7940 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
7941 SET_TexImage3D(table
, save_TexImage3D
);
7942 SET_TexSubImage3D(table
, save_TexSubImage3D
);
7945 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
7946 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
7947 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
7949 /* ATI_separate_stencil */
7950 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
7952 /* GL_ARB_imaging */
7953 /* Not all are supported */
7954 SET_BlendColor(table
, save_BlendColor
);
7955 SET_BlendEquation(table
, save_BlendEquation
);
7956 SET_ColorSubTable(table
, save_ColorSubTable
);
7957 SET_ColorTable(table
, save_ColorTable
);
7958 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
7959 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
7960 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
7961 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
7962 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
7963 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
7964 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
7965 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
7966 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
7967 SET_CopyColorTable(table
, save_CopyColorTable
);
7968 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
7969 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
7970 SET_GetColorTable(table
, exec_GetColorTable
);
7971 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
7972 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
7973 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
7974 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
7975 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
7976 SET_GetHistogram(table
, exec_GetHistogram
);
7977 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
7978 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
7979 SET_GetMinmax(table
, exec_GetMinmax
);
7980 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
7981 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
7982 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
7983 SET_Histogram(table
, save_Histogram
);
7984 SET_Minmax(table
, save_Minmax
);
7985 SET_ResetHistogram(table
, save_ResetHistogram
);
7986 SET_ResetMinmax(table
, save_ResetMinmax
);
7987 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
7989 /* 2. GL_EXT_blend_color */
7991 SET_BlendColorEXT(table
, save_BlendColorEXT
);
7994 /* 3. GL_EXT_polygon_offset */
7995 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
7997 /* 6. GL_EXT_texture3d */
7999 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
8000 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
8001 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
8004 /* 14. GL_SGI_color_table */
8006 SET_ColorTableSGI(table
, save_ColorTable
);
8007 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
8008 SET_GetColorTableSGI(table
, exec_GetColorTable
);
8009 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
8010 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
8013 /* 30. GL_EXT_vertex_array */
8014 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
8015 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
8016 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
8017 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
8018 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
8019 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
8021 /* 37. GL_EXT_blend_minmax */
8023 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
8026 /* 54. GL_EXT_point_parameters */
8027 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
8028 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
8030 /* 97. GL_EXT_compiled_vertex_array */
8031 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
8032 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
8034 /* 145. GL_EXT_secondary_color */
8035 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
8037 /* 148. GL_EXT_multi_draw_arrays */
8038 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
8039 SET_MultiDrawElementsEXT(table
, exec_MultiDrawElementsEXT
);
8041 /* 149. GL_EXT_fog_coord */
8042 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
8044 /* 173. GL_EXT_blend_func_separate */
8045 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
8047 /* 196. GL_MESA_resize_buffers */
8048 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
8050 /* 197. GL_MESA_window_pos */
8051 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
8052 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
8053 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
8054 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
8055 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
8056 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
8057 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
8058 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
8059 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
8060 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
8061 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
8062 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
8063 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
8064 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
8065 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
8066 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
8067 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
8068 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
8069 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
8070 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
8071 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
8072 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
8073 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
8074 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
8076 /* 200. GL_IBM_multimode_draw_arrays */
8077 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
8078 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
8080 #if FEATURE_NV_vertex_program
8081 /* 233. GL_NV_vertex_program */
8082 /* The following commands DO NOT go into display lists:
8083 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
8084 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
8086 SET_BindProgramNV(table
, save_BindProgramNV
);
8087 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8088 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
8089 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8090 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
8091 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
8092 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
8093 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
8094 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
8095 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
8096 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
8097 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8098 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8099 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8100 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8101 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
8102 SET_LoadProgramNV(table
, save_LoadProgramNV
);
8103 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
8104 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
8105 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
8106 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
8107 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
8108 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
8109 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
8110 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
8113 /* 244. GL_ATI_envmap_bumpmap */
8114 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
8115 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
8117 /* 245. GL_ATI_fragment_shader */
8118 #if FEATURE_ATI_fragment_shader
8119 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
8120 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
8123 /* 282. GL_NV_fragment_program */
8124 #if FEATURE_NV_fragment_program
8125 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
8126 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
8127 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
8128 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
8129 SET_GetProgramNamedParameterfvNV(table
,
8130 _mesa_GetProgramNamedParameterfvNV
);
8131 SET_GetProgramNamedParameterdvNV(table
,
8132 _mesa_GetProgramNamedParameterdvNV
);
8133 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8134 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8135 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8136 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8137 SET_GetProgramLocalParameterdvARB(table
,
8138 _mesa_GetProgramLocalParameterdvARB
);
8139 SET_GetProgramLocalParameterfvARB(table
,
8140 _mesa_GetProgramLocalParameterfvARB
);
8143 /* 262. GL_NV_point_sprite */
8144 SET_PointParameteriNV(table
, save_PointParameteriNV
);
8145 SET_PointParameterivNV(table
, save_PointParameterivNV
);
8147 /* 268. GL_EXT_stencil_two_side */
8148 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
8150 /* 273. GL_APPLE_vertex_array_object */
8151 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
8152 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
8153 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
8154 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
8156 /* ???. GL_EXT_depth_bounds_test */
8157 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
8159 /* ARB 1. GL_ARB_multitexture */
8160 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
8161 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
8163 /* ARB 3. GL_ARB_transpose_matrix */
8164 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
8165 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
8166 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
8167 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
8169 /* ARB 5. GL_ARB_multisample */
8170 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
8172 /* ARB 12. GL_ARB_texture_compression */
8173 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
8174 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
8175 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
8176 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
8177 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
8178 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
8179 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
8181 /* ARB 14. GL_ARB_point_parameters */
8182 /* aliased with EXT_point_parameters functions */
8184 /* ARB 25. GL_ARB_window_pos */
8185 /* aliased with MESA_window_pos functions */
8187 /* ARB 26. GL_ARB_vertex_program */
8188 /* ARB 27. GL_ARB_fragment_program */
8189 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8190 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
8191 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
8192 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
8193 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
8194 SET_ProgramStringARB(table
, save_ProgramStringARB
);
8195 SET_BindProgramNV(table
, save_BindProgramNV
);
8196 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8197 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8198 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
8199 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8200 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8201 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8202 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8203 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
8204 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
8205 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
8206 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
8207 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
8208 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
8209 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
8210 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
8211 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
8212 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
8213 SET_GetProgramLocalParameterdvARB(table
,
8214 _mesa_GetProgramLocalParameterdvARB
);
8215 SET_GetProgramLocalParameterfvARB(table
,
8216 _mesa_GetProgramLocalParameterfvARB
);
8217 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
8218 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
8221 /* ARB 28. GL_ARB_vertex_buffer_object */
8222 #if FEATURE_ARB_vertex_buffer_object
8223 /* None of the extension's functions get compiled */
8224 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
8225 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
8226 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
8227 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
8228 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
8229 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
8230 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
8231 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
8232 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
8233 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
8234 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
8237 #if FEATURE_ARB_occlusion_query
8238 SET_BeginQueryARB(table
, save_BeginQueryARB
);
8239 SET_EndQueryARB(table
, save_EndQueryARB
);
8240 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
8241 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
8242 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
8243 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
8244 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
8245 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
8247 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
8249 #if FEATURE_EXT_framebuffer_blit
8250 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
8253 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
8254 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
8255 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
8256 /* XXX additional functions need to be implemented here! */
8258 /* 299. GL_EXT_blend_equation_separate */
8259 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
8261 /* GL_EXT_gpu_program_parmaeters */
8262 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
8263 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
8264 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
8267 /* ARB 50. GL_ARB_map_buffer_range */
8268 #if FEATURE_ARB_map_buffer_range
8269 SET_MapBufferRange(table
, _mesa_MapBufferRange
); /* no dlist save */
8270 SET_FlushMappedBufferRange(table
, _mesa_FlushMappedBufferRange
); /* no dl */
8273 /* ARB 59. GL_ARB_copy_buffer */
8274 SET_CopyBufferSubData(table
, _mesa_CopyBufferSubData
); /* no dlist save */
8276 /* 364. GL_EXT_provoking_vertex */
8277 SET_ProvokingVertexEXT(table
, save_ProvokingVertexEXT
);
8283 enum_string(GLenum k
)
8285 return _mesa_lookup_enum_by_nr(k
);
8290 * Print the commands in a display list. For debugging only.
8291 * TODO: many commands aren't handled yet.
8293 static void GLAPIENTRY
8294 print_list(GLcontext
*ctx
, GLuint list
)
8296 struct gl_display_list
*dlist
;
8300 if (!islist(ctx
, list
)) {
8301 _mesa_printf("%u is not a display list ID\n", list
);
8305 dlist
= lookup_list(ctx
, list
);
8311 _mesa_printf("START-LIST %u, address %p\n", list
, (void *) n
);
8313 done
= n
? GL_FALSE
: GL_TRUE
;
8315 OpCode opcode
= n
[0].opcode
;
8316 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
8318 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
8319 /* this is a driver-extended opcode */
8320 ctx
->ListExt
.Opcode
[i
].Print(ctx
, &n
[1]);
8321 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
8326 _mesa_printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
8329 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
8330 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
8332 case OPCODE_CALL_LIST
:
8333 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
8335 case OPCODE_CALL_LIST_OFFSET
:
8336 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
8337 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
8339 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
8340 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
8341 enum_string(n
[1].e
), enum_string(n
[2].e
),
8342 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8344 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
8345 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
8346 enum_string(n
[1].e
), enum_string(n
[2].e
),
8347 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
8349 case OPCODE_DISABLE
:
8350 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
8353 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
8355 case OPCODE_FRUSTUM
:
8356 _mesa_printf("Frustum %g %g %g %g %g %g\n",
8357 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8359 case OPCODE_LINE_STIPPLE
:
8360 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
8362 case OPCODE_LOAD_IDENTITY
:
8363 _mesa_printf("LoadIdentity\n");
8365 case OPCODE_LOAD_MATRIX
:
8366 _mesa_printf("LoadMatrix\n");
8367 _mesa_printf(" %8f %8f %8f %8f\n",
8368 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8369 _mesa_printf(" %8f %8f %8f %8f\n",
8370 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8371 _mesa_printf(" %8f %8f %8f %8f\n",
8372 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8373 _mesa_printf(" %8f %8f %8f %8f\n",
8374 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8376 case OPCODE_MULT_MATRIX
:
8377 _mesa_printf("MultMatrix (or Rotate)\n");
8378 _mesa_printf(" %8f %8f %8f %8f\n",
8379 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8380 _mesa_printf(" %8f %8f %8f %8f\n",
8381 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8382 _mesa_printf(" %8f %8f %8f %8f\n",
8383 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8384 _mesa_printf(" %8f %8f %8f %8f\n",
8385 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8388 _mesa_printf("Ortho %g %g %g %g %g %g\n",
8389 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8391 case OPCODE_POP_ATTRIB
:
8392 _mesa_printf("PopAttrib\n");
8394 case OPCODE_POP_MATRIX
:
8395 _mesa_printf("PopMatrix\n");
8397 case OPCODE_POP_NAME
:
8398 _mesa_printf("PopName\n");
8400 case OPCODE_PUSH_ATTRIB
:
8401 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
8403 case OPCODE_PUSH_MATRIX
:
8404 _mesa_printf("PushMatrix\n");
8406 case OPCODE_PUSH_NAME
:
8407 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
8409 case OPCODE_RASTER_POS
:
8410 _mesa_printf("RasterPos %g %g %g %g\n",
8411 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8414 _mesa_printf("Rotate %g %g %g %g\n",
8415 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8418 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8420 case OPCODE_TRANSLATE
:
8421 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8423 case OPCODE_BIND_TEXTURE
:
8424 _mesa_printf("BindTexture %s %d\n",
8425 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
8427 case OPCODE_SHADE_MODEL
:
8428 _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
8431 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
8432 _mesa_lookup_enum_by_nr(n
[1].ui
),
8433 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
8436 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
8437 _mesa_lookup_enum_by_nr(n
[1].ui
),
8438 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
8439 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
8441 case OPCODE_MAPGRID1
:
8442 _mesa_printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
8444 case OPCODE_MAPGRID2
:
8445 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
8446 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
8448 case OPCODE_EVALMESH1
:
8449 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
8451 case OPCODE_EVALMESH2
:
8452 _mesa_printf("EvalMesh2 %d %d %d %d\n",
8453 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
8456 case OPCODE_ATTR_1F_NV
:
8457 _mesa_printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
8459 case OPCODE_ATTR_2F_NV
:
8460 _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
8461 n
[1].i
, n
[2].f
, n
[3].f
);
8463 case OPCODE_ATTR_3F_NV
:
8464 _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
8465 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8467 case OPCODE_ATTR_4F_NV
:
8468 _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
8469 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8471 case OPCODE_ATTR_1F_ARB
:
8472 _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
8474 case OPCODE_ATTR_2F_ARB
:
8475 _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
8476 n
[1].i
, n
[2].f
, n
[3].f
);
8478 case OPCODE_ATTR_3F_ARB
:
8479 _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
8480 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8482 case OPCODE_ATTR_4F_ARB
:
8483 _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
8484 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8487 case OPCODE_MATERIAL
:
8488 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
8489 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8492 _mesa_printf("BEGIN %x\n", n
[1].i
);
8495 _mesa_printf("END\n");
8498 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
8501 case OPCODE_EVAL_C1
:
8502 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
8504 case OPCODE_EVAL_C2
:
8505 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
8507 case OPCODE_EVAL_P1
:
8508 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
8510 case OPCODE_EVAL_P2
:
8511 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
8514 case OPCODE_PROVOKING_VERTEX
:
8515 _mesa_printf("ProvokingVertex %s\n",
8516 _mesa_lookup_enum_by_nr(n
[1].ui
));
8520 * meta opcodes/commands
8523 _mesa_printf("Error: %s %s\n",
8524 enum_string(n
[1].e
), (const char *) n
[2].data
);
8526 case OPCODE_CONTINUE
:
8527 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
8528 n
= (Node
*) n
[1].next
;
8530 case OPCODE_END_OF_LIST
:
8531 _mesa_printf("END-LIST %u\n", list
);
8535 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
8537 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
8538 opcode
, (void *) n
);
8542 _mesa_printf("command %d, %u operands\n", opcode
,
8546 /* increment n to point to next compiled command */
8547 if (opcode
!= OPCODE_CONTINUE
) {
8548 n
+= InstSize
[opcode
];
8557 * Clients may call this function to help debug display list problems.
8558 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
8559 * changed, or break in the future without notice.
8562 mesa_print_display_list(GLuint list
)
8564 GET_CURRENT_CONTEXT(ctx
);
8565 print_list(ctx
, list
);
8569 /**********************************************************************/
8570 /***** Initialization *****/
8571 /**********************************************************************/
8574 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
8576 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
8577 vfmt
->Begin
= save_Begin
;
8578 vfmt
->CallList
= _mesa_save_CallList
;
8579 vfmt
->CallLists
= _mesa_save_CallLists
;
8580 vfmt
->Color3f
= save_Color3f
;
8581 vfmt
->Color3fv
= save_Color3fv
;
8582 vfmt
->Color4f
= save_Color4f
;
8583 vfmt
->Color4fv
= save_Color4fv
;
8584 vfmt
->EdgeFlag
= save_EdgeFlag
;
8585 vfmt
->End
= save_End
;
8586 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
8587 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
8588 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
8589 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
8590 vfmt
->EvalPoint1
= save_EvalPoint1
;
8591 vfmt
->EvalPoint2
= save_EvalPoint2
;
8592 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
8593 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
8594 vfmt
->Indexf
= save_Indexf
;
8595 vfmt
->Indexfv
= save_Indexfv
;
8596 vfmt
->Materialfv
= save_Materialfv
;
8597 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
8598 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
8599 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
8600 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
8601 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
8602 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
8603 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
8604 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
8605 vfmt
->Normal3f
= save_Normal3f
;
8606 vfmt
->Normal3fv
= save_Normal3fv
;
8607 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
8608 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
8609 vfmt
->TexCoord1f
= save_TexCoord1f
;
8610 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
8611 vfmt
->TexCoord2f
= save_TexCoord2f
;
8612 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
8613 vfmt
->TexCoord3f
= save_TexCoord3f
;
8614 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
8615 vfmt
->TexCoord4f
= save_TexCoord4f
;
8616 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
8617 vfmt
->Vertex2f
= save_Vertex2f
;
8618 vfmt
->Vertex2fv
= save_Vertex2fv
;
8619 vfmt
->Vertex3f
= save_Vertex3f
;
8620 vfmt
->Vertex3fv
= save_Vertex3fv
;
8621 vfmt
->Vertex4f
= save_Vertex4f
;
8622 vfmt
->Vertex4fv
= save_Vertex4fv
;
8623 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
8624 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
8625 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
8626 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
8627 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
8628 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
8629 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
8630 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
8631 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
8632 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
8633 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
8634 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
8635 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
8636 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
8637 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
8638 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
8640 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
8641 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
8642 vfmt
->Rectf
= save_Rectf
;
8644 /* The driver is required to implement these as
8645 * 1) They can probably do a better job.
8646 * 2) A lot of new mechanisms would have to be added to this module
8647 * to support it. That code would probably never get used,
8651 vfmt
->DrawArrays
= 0;
8652 vfmt
->DrawElements
= 0;
8653 vfmt
->DrawRangeElements
= 0;
8659 * Initialize display list state for given context.
8662 _mesa_init_display_list(GLcontext
*ctx
)
8664 static GLboolean tableInitialized
= GL_FALSE
;
8666 /* zero-out the instruction size table, just once */
8667 if (!tableInitialized
) {
8668 _mesa_bzero(InstSize
, sizeof(InstSize
));
8669 tableInitialized
= GL_TRUE
;
8673 ctx
->ListState
.CallDepth
= 0;
8674 ctx
->ExecuteFlag
= GL_TRUE
;
8675 ctx
->CompileFlag
= GL_FALSE
;
8676 ctx
->ListState
.CurrentBlock
= NULL
;
8677 ctx
->ListState
.CurrentPos
= 0;
8679 /* Display List group */
8680 ctx
->List
.ListBase
= 0;
8682 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);