1 /*
2 * Mesa 3-D graphics library
3 *
4 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
5 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
6 *
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:
13 *
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
16 *
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 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23 * OTHER DEALINGS IN THE SOFTWARE.
24 */
25
26
27 /**
28 * \file dlist.c
29 * Display lists management functions.
30 */
31
32 #include "api_save.h"
33 #include "api_arrayelt.h"
34 #include "draw_validate.h"
35 #include "arrayobj.h"
36 #include "enums.h"
37 #include "eval.h"
38 #include "hash.h"
39 #include "image.h"
40 #include "light.h"
41 #include "pack.h"
42 #include "pbo.h"
43 #include "teximage.h"
44 #include "texobj.h"
45 #include "varray.h"
46 #include "glthread_marshal.h"
47
48 #include "main/dispatch.h"
49
50 #include "vbo/vbo_save.h"
51 #include "util/u_inlines.h"
52 #include "util/u_memory.h"
53 #include "api_exec_decl.h"
54
55 #include "state_tracker/st_context.h"
56 #include "state_tracker/st_cb_texture.h"
57 #include "state_tracker/st_cb_bitmap.h"
58 #include "state_tracker/st_sampler_view.h"
59
60 static bool
61 _mesa_glthread_should_execute_list(struct gl_context *ctx,
62 struct gl_display_list *dlist);
63
64 /**
65 * Flush vertices.
66 *
67 * \param ctx GL context.
68 *
69 * Checks if dd_function_table::SaveNeedFlush is marked to flush
70 * stored (save) vertices, and calls vbo_save_SaveFlushVertices if so.
71 */
72 #define SAVE_FLUSH_VERTICES(ctx) \
73 do { \
74 if (ctx->Driver.SaveNeedFlush) \
75 vbo_save_SaveFlushVertices(ctx); \
76 } while (0)
77
78
79 /**
80 * Macro to assert that the API call was made outside the
81 * glBegin()/glEnd() pair, with return value.
82 *
83 * \param ctx GL context.
84 * \param retval value to return value in case the assertion fails.
85 */
86 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
87 do { \
88 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
89 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
90 return retval; \
91 } \
92 } while (0)
93
94 /**
95 * Macro to assert that the API call was made outside the
96 * glBegin()/glEnd() pair.
97 *
98 * \param ctx GL context.
99 */
100 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
101 do { \
102 if (ctx->Driver.CurrentSavePrimitive <= PRIM_MAX) { \
103 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "glBegin/End" ); \
104 return; \
105 } \
106 } while (0)
107
108 /**
109 * Macro to assert that the API call was made outside the
110 * glBegin()/glEnd() pair and flush the vertices.
111 *
112 * \param ctx GL context.
113 */
114 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
115 do { \
116 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
117 SAVE_FLUSH_VERTICES(ctx); \
118 } while (0)
119
120 /**
121 * Macro to assert that the API call was made outside the
122 * glBegin()/glEnd() pair and flush the vertices, with return value.
123 *
124 * \param ctx GL context.
125 * \param retval value to return value in case the assertion fails.
126 */
127 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval) \
128 do { \
129 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
130 SAVE_FLUSH_VERTICES(ctx); \
131 } while (0)
132
133
134 /**
135 * Display list opcodes.
136 */
137 typedef enum
138 {
139 OPCODE_INVALID = -1, /* Force signed enum */
140 OPCODE_ACCUM,
141 OPCODE_ALPHA_FUNC,
142 OPCODE_BIND_TEXTURE,
143 OPCODE_BITMAP,
144 OPCODE_BLEND_COLOR,
145 OPCODE_BLEND_EQUATION,
146 OPCODE_BLEND_EQUATION_SEPARATE,
147 OPCODE_BLEND_FUNC_SEPARATE,
148
149 OPCODE_BLEND_EQUATION_I,
150 OPCODE_BLEND_EQUATION_SEPARATE_I,
151 OPCODE_BLEND_FUNC_I,
152 OPCODE_BLEND_FUNC_SEPARATE_I,
153
154 OPCODE_CALL_LIST,
155 OPCODE_CALL_LISTS,
156 OPCODE_CLEAR,
157 OPCODE_CLEAR_ACCUM,
158 OPCODE_CLEAR_COLOR,
159 OPCODE_CLEAR_DEPTH,
160 OPCODE_CLEAR_INDEX,
161 OPCODE_CLEAR_STENCIL,
162 OPCODE_CLEAR_BUFFER_IV,
163 OPCODE_CLEAR_BUFFER_UIV,
164 OPCODE_CLEAR_BUFFER_FV,
165 OPCODE_CLEAR_BUFFER_FI,
166 OPCODE_CLIP_PLANE,
167 OPCODE_COLOR_MASK,
168 OPCODE_COLOR_MASK_INDEXED,
169 OPCODE_COLOR_MATERIAL,
170 OPCODE_COPY_PIXELS,
171 OPCODE_COPY_TEX_IMAGE1D,
172 OPCODE_COPY_TEX_IMAGE2D,
173 OPCODE_COPY_TEX_SUB_IMAGE1D,
174 OPCODE_COPY_TEX_SUB_IMAGE2D,
175 OPCODE_COPY_TEX_SUB_IMAGE3D,
176 OPCODE_CULL_FACE,
177 OPCODE_DEPTH_FUNC,
178 OPCODE_DEPTH_MASK,
179 OPCODE_DEPTH_RANGE,
180 OPCODE_DISABLE,
181 OPCODE_DISABLE_INDEXED,
182 OPCODE_DRAW_BUFFER,
183 OPCODE_DRAW_PIXELS,
184 OPCODE_ENABLE,
185 OPCODE_ENABLE_INDEXED,
186 OPCODE_EVALMESH1,
187 OPCODE_EVALMESH2,
188 OPCODE_FOG,
189 OPCODE_FRONT_FACE,
190 OPCODE_FRUSTUM,
191 OPCODE_HINT,
192 OPCODE_INDEX_MASK,
193 OPCODE_INIT_NAMES,
194 OPCODE_LIGHT,
195 OPCODE_LIGHT_MODEL,
196 OPCODE_LINE_STIPPLE,
197 OPCODE_LINE_WIDTH,
198 OPCODE_LIST_BASE,
199 OPCODE_LOAD_IDENTITY,
200 OPCODE_LOAD_MATRIX,
201 OPCODE_LOAD_NAME,
202 OPCODE_LOGIC_OP,
203 OPCODE_MAP1,
204 OPCODE_MAP2,
205 OPCODE_MAPGRID1,
206 OPCODE_MAPGRID2,
207 OPCODE_MATRIX_MODE,
208 OPCODE_MULT_MATRIX,
209 OPCODE_ORTHO,
210 OPCODE_PASSTHROUGH,
211 OPCODE_PIXEL_MAP,
212 OPCODE_PIXEL_TRANSFER,
213 OPCODE_PIXEL_ZOOM,
214 OPCODE_POINT_SIZE,
215 OPCODE_POINT_PARAMETERS,
216 OPCODE_POLYGON_MODE,
217 OPCODE_POLYGON_STIPPLE,
218 OPCODE_POLYGON_OFFSET,
219 OPCODE_POP_ATTRIB,
220 OPCODE_POP_MATRIX,
221 OPCODE_POP_NAME,
222 OPCODE_PRIORITIZE_TEXTURE,
223 OPCODE_PUSH_ATTRIB,
224 OPCODE_PUSH_MATRIX,
225 OPCODE_PUSH_NAME,
226 OPCODE_RASTER_POS,
227 OPCODE_READ_BUFFER,
228 OPCODE_ROTATE,
229 OPCODE_SCALE,
230 OPCODE_SCISSOR,
231 OPCODE_SELECT_TEXTURE_SGIS,
232 OPCODE_SELECT_TEXTURE_COORD_SET,
233 OPCODE_SHADE_MODEL,
234 OPCODE_STENCIL_FUNC,
235 OPCODE_STENCIL_MASK,
236 OPCODE_STENCIL_OP,
237 OPCODE_TEXENV,
238 OPCODE_TEXGEN,
239 OPCODE_TEXPARAMETER,
240 OPCODE_TEX_IMAGE1D,
241 OPCODE_TEX_IMAGE2D,
242 OPCODE_TEX_IMAGE3D,
243 OPCODE_TEX_SUB_IMAGE1D,
244 OPCODE_TEX_SUB_IMAGE2D,
245 OPCODE_TEX_SUB_IMAGE3D,
246 OPCODE_TRANSLATE,
247 OPCODE_VIEWPORT,
248 OPCODE_WINDOW_POS,
249 /* ARB_viewport_array */
250 OPCODE_VIEWPORT_ARRAY_V,
251 OPCODE_VIEWPORT_INDEXED_F,
252 OPCODE_VIEWPORT_INDEXED_FV,
253 OPCODE_SCISSOR_ARRAY_V,
254 OPCODE_SCISSOR_INDEXED,
255 OPCODE_SCISSOR_INDEXED_V,
256 OPCODE_DEPTH_ARRAY_V,
257 OPCODE_DEPTH_INDEXED,
258 /* GL_ARB_multitexture */
259 OPCODE_ACTIVE_TEXTURE,
260 /* GL_ARB_texture_compression */
261 OPCODE_COMPRESSED_TEX_IMAGE_1D,
262 OPCODE_COMPRESSED_TEX_IMAGE_2D,
263 OPCODE_COMPRESSED_TEX_IMAGE_3D,
264 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D,
265 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D,
266 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D,
267 /* GL_ARB_multisample */
268 OPCODE_SAMPLE_COVERAGE,
269 /* GL_ARB_window_pos */
270 OPCODE_WINDOW_POS_ARB,
271 /* GL_ARB_vertex_program */
272 OPCODE_BIND_PROGRAM_ARB,
273 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB,
274 /* GL_EXT_stencil_two_side */
275 OPCODE_ACTIVE_STENCIL_FACE_EXT,
276 /* GL_EXT_depth_bounds_test */
277 OPCODE_DEPTH_BOUNDS_EXT,
278 /* GL_ARB_vertex/fragment_program */
279 OPCODE_PROGRAM_STRING_ARB,
280 OPCODE_PROGRAM_ENV_PARAMETER_ARB,
281 /* GL_ARB_occlusion_query */
282 OPCODE_BEGIN_QUERY_ARB,
283 OPCODE_END_QUERY_ARB,
284 /* GL_ARB_draw_buffers */
285 OPCODE_DRAW_BUFFERS_ARB,
286 /* GL_ATI_fragment_shader */
287 OPCODE_BIND_FRAGMENT_SHADER_ATI,
288 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI,
289 /* OpenGL 2.0 */
290 OPCODE_STENCIL_FUNC_SEPARATE,
291 OPCODE_STENCIL_OP_SEPARATE,
292 OPCODE_STENCIL_MASK_SEPARATE,
293 /* GL_NV_primitive_restart */
294 OPCODE_PRIMITIVE_RESTART_NV,
295 /* GL_ARB_shader_objects */
296 OPCODE_USE_PROGRAM,
297 OPCODE_UNIFORM_1F,
298 OPCODE_UNIFORM_2F,
299 OPCODE_UNIFORM_3F,
300 OPCODE_UNIFORM_4F,
301 OPCODE_UNIFORM_1FV,
302 OPCODE_UNIFORM_2FV,
303 OPCODE_UNIFORM_3FV,
304 OPCODE_UNIFORM_4FV,
305 OPCODE_UNIFORM_1I,
306 OPCODE_UNIFORM_2I,
307 OPCODE_UNIFORM_3I,
308 OPCODE_UNIFORM_4I,
309 OPCODE_UNIFORM_1IV,
310 OPCODE_UNIFORM_2IV,
311 OPCODE_UNIFORM_3IV,
312 OPCODE_UNIFORM_4IV,
313 OPCODE_UNIFORM_MATRIX22,
314 OPCODE_UNIFORM_MATRIX33,
315 OPCODE_UNIFORM_MATRIX44,
316 OPCODE_UNIFORM_MATRIX23,
317 OPCODE_UNIFORM_MATRIX32,
318 OPCODE_UNIFORM_MATRIX24,
319 OPCODE_UNIFORM_MATRIX42,
320 OPCODE_UNIFORM_MATRIX34,
321 OPCODE_UNIFORM_MATRIX43,
322
323 /* OpenGL 3.0 */
324 OPCODE_UNIFORM_1UI,
325 OPCODE_UNIFORM_2UI,
326 OPCODE_UNIFORM_3UI,
327 OPCODE_UNIFORM_4UI,
328 OPCODE_UNIFORM_1UIV,
329 OPCODE_UNIFORM_2UIV,
330 OPCODE_UNIFORM_3UIV,
331 OPCODE_UNIFORM_4UIV,
332
333 /* GL_ARB_gpu_shader_fp64 */
334 OPCODE_UNIFORM_1D,
335 OPCODE_UNIFORM_2D,
336 OPCODE_UNIFORM_3D,
337 OPCODE_UNIFORM_4D,
338 OPCODE_UNIFORM_1DV,
339 OPCODE_UNIFORM_2DV,
340 OPCODE_UNIFORM_3DV,
341 OPCODE_UNIFORM_4DV,
342 OPCODE_UNIFORM_MATRIX22D,
343 OPCODE_UNIFORM_MATRIX33D,
344 OPCODE_UNIFORM_MATRIX44D,
345 OPCODE_UNIFORM_MATRIX23D,
346 OPCODE_UNIFORM_MATRIX32D,
347 OPCODE_UNIFORM_MATRIX24D,
348 OPCODE_UNIFORM_MATRIX42D,
349 OPCODE_UNIFORM_MATRIX34D,
350 OPCODE_UNIFORM_MATRIX43D,
351
352 /* GL_ARB_gpu_shader_int64 */
353 OPCODE_UNIFORM_1I64,
354 OPCODE_UNIFORM_2I64,
355 OPCODE_UNIFORM_3I64,
356 OPCODE_UNIFORM_4I64,
357 OPCODE_UNIFORM_1I64V,
358 OPCODE_UNIFORM_2I64V,
359 OPCODE_UNIFORM_3I64V,
360 OPCODE_UNIFORM_4I64V,
361 OPCODE_UNIFORM_1UI64,
362 OPCODE_UNIFORM_2UI64,
363 OPCODE_UNIFORM_3UI64,
364 OPCODE_UNIFORM_4UI64,
365 OPCODE_UNIFORM_1UI64V,
366 OPCODE_UNIFORM_2UI64V,
367 OPCODE_UNIFORM_3UI64V,
368 OPCODE_UNIFORM_4UI64V,
369 OPCODE_PROGRAM_UNIFORM_1I64,
370 OPCODE_PROGRAM_UNIFORM_2I64,
371 OPCODE_PROGRAM_UNIFORM_3I64,
372 OPCODE_PROGRAM_UNIFORM_4I64,
373 OPCODE_PROGRAM_UNIFORM_1I64V,
374 OPCODE_PROGRAM_UNIFORM_2I64V,
375 OPCODE_PROGRAM_UNIFORM_3I64V,
376 OPCODE_PROGRAM_UNIFORM_4I64V,
377 OPCODE_PROGRAM_UNIFORM_1UI64,
378 OPCODE_PROGRAM_UNIFORM_2UI64,
379 OPCODE_PROGRAM_UNIFORM_3UI64,
380 OPCODE_PROGRAM_UNIFORM_4UI64,
381 OPCODE_PROGRAM_UNIFORM_1UI64V,
382 OPCODE_PROGRAM_UNIFORM_2UI64V,
383 OPCODE_PROGRAM_UNIFORM_3UI64V,
384 OPCODE_PROGRAM_UNIFORM_4UI64V,
385
386 /* OpenGL 4.0 / GL_ARB_tessellation_shader */
387 OPCODE_PATCH_PARAMETER_I,
388 OPCODE_PATCH_PARAMETER_FV_INNER,
389 OPCODE_PATCH_PARAMETER_FV_OUTER,
390
391 /* OpenGL 4.2 / GL_ARB_separate_shader_objects */
392 OPCODE_USE_PROGRAM_STAGES,
393 OPCODE_PROGRAM_UNIFORM_1F,
394 OPCODE_PROGRAM_UNIFORM_2F,
395 OPCODE_PROGRAM_UNIFORM_3F,
396 OPCODE_PROGRAM_UNIFORM_4F,
397 OPCODE_PROGRAM_UNIFORM_1FV,
398 OPCODE_PROGRAM_UNIFORM_2FV,
399 OPCODE_PROGRAM_UNIFORM_3FV,
400 OPCODE_PROGRAM_UNIFORM_4FV,
401 OPCODE_PROGRAM_UNIFORM_1D,
402 OPCODE_PROGRAM_UNIFORM_2D,
403 OPCODE_PROGRAM_UNIFORM_3D,
404 OPCODE_PROGRAM_UNIFORM_4D,
405 OPCODE_PROGRAM_UNIFORM_1DV,
406 OPCODE_PROGRAM_UNIFORM_2DV,
407 OPCODE_PROGRAM_UNIFORM_3DV,
408 OPCODE_PROGRAM_UNIFORM_4DV,
409 OPCODE_PROGRAM_UNIFORM_1I,
410 OPCODE_PROGRAM_UNIFORM_2I,
411 OPCODE_PROGRAM_UNIFORM_3I,
412 OPCODE_PROGRAM_UNIFORM_4I,
413 OPCODE_PROGRAM_UNIFORM_1IV,
414 OPCODE_PROGRAM_UNIFORM_2IV,
415 OPCODE_PROGRAM_UNIFORM_3IV,
416 OPCODE_PROGRAM_UNIFORM_4IV,
417 OPCODE_PROGRAM_UNIFORM_1UI,
418 OPCODE_PROGRAM_UNIFORM_2UI,
419 OPCODE_PROGRAM_UNIFORM_3UI,
420 OPCODE_PROGRAM_UNIFORM_4UI,
421 OPCODE_PROGRAM_UNIFORM_1UIV,
422 OPCODE_PROGRAM_UNIFORM_2UIV,
423 OPCODE_PROGRAM_UNIFORM_3UIV,
424 OPCODE_PROGRAM_UNIFORM_4UIV,
425 OPCODE_PROGRAM_UNIFORM_MATRIX22F,
426 OPCODE_PROGRAM_UNIFORM_MATRIX33F,
427 OPCODE_PROGRAM_UNIFORM_MATRIX44F,
428 OPCODE_PROGRAM_UNIFORM_MATRIX23F,
429 OPCODE_PROGRAM_UNIFORM_MATRIX32F,
430 OPCODE_PROGRAM_UNIFORM_MATRIX24F,
431 OPCODE_PROGRAM_UNIFORM_MATRIX42F,
432 OPCODE_PROGRAM_UNIFORM_MATRIX34F,
433 OPCODE_PROGRAM_UNIFORM_MATRIX43F,
434 OPCODE_PROGRAM_UNIFORM_MATRIX22D,
435 OPCODE_PROGRAM_UNIFORM_MATRIX33D,
436 OPCODE_PROGRAM_UNIFORM_MATRIX44D,
437 OPCODE_PROGRAM_UNIFORM_MATRIX23D,
438 OPCODE_PROGRAM_UNIFORM_MATRIX32D,
439 OPCODE_PROGRAM_UNIFORM_MATRIX24D,
440 OPCODE_PROGRAM_UNIFORM_MATRIX42D,
441 OPCODE_PROGRAM_UNIFORM_MATRIX34D,
442 OPCODE_PROGRAM_UNIFORM_MATRIX43D,
443
444 /* GL_ARB_clip_control */
445 OPCODE_CLIP_CONTROL,
446
447 /* GL_ARB_color_buffer_float */
448 OPCODE_CLAMP_COLOR,
449
450 /* GL_EXT_framebuffer_blit */
451 OPCODE_BLIT_FRAMEBUFFER,
452
453 /* Vertex attributes -- fallback for when optimized display
454 * list build isn't active.
455 */
456 OPCODE_ATTR_1F_NV,
457 OPCODE_ATTR_2F_NV,
458 OPCODE_ATTR_3F_NV,
459 OPCODE_ATTR_4F_NV,
460 OPCODE_ATTR_1F_ARB,
461 OPCODE_ATTR_2F_ARB,
462 OPCODE_ATTR_3F_ARB,
463 OPCODE_ATTR_4F_ARB,
464 OPCODE_ATTR_1I,
465 OPCODE_ATTR_2I,
466 OPCODE_ATTR_3I,
467 OPCODE_ATTR_4I,
468 OPCODE_ATTR_1D,
469 OPCODE_ATTR_2D,
470 OPCODE_ATTR_3D,
471 OPCODE_ATTR_4D,
472 OPCODE_ATTR_1UI64,
473 OPCODE_MATERIAL,
474 OPCODE_BEGIN,
475 OPCODE_END,
476 OPCODE_EVAL_C1,
477 OPCODE_EVAL_C2,
478 OPCODE_EVAL_P1,
479 OPCODE_EVAL_P2,
480
481 /* GL_EXT_provoking_vertex */
482 OPCODE_PROVOKING_VERTEX,
483
484 /* GL_EXT_transform_feedback */
485 OPCODE_BEGIN_TRANSFORM_FEEDBACK,
486 OPCODE_END_TRANSFORM_FEEDBACK,
487 OPCODE_BIND_TRANSFORM_FEEDBACK,
488 OPCODE_PAUSE_TRANSFORM_FEEDBACK,
489 OPCODE_RESUME_TRANSFORM_FEEDBACK,
490 OPCODE_DRAW_TRANSFORM_FEEDBACK,
491
492 /* GL_EXT_texture_integer */
493 OPCODE_CLEARCOLOR_I,
494 OPCODE_CLEARCOLOR_UI,
495 OPCODE_TEXPARAMETER_I,
496 OPCODE_TEXPARAMETER_UI,
497
498 /* GL_EXT/ARB_instanced_arrays */
499 OPCODE_VERTEX_ATTRIB_DIVISOR,
500
501 /* GL_NV_texture_barrier */
502 OPCODE_TEXTURE_BARRIER_NV,
503
504 /* GL_ARB_sampler_object */
505 OPCODE_BIND_SAMPLER,
506 OPCODE_SAMPLER_PARAMETERIV,
507 OPCODE_SAMPLER_PARAMETERFV,
508 OPCODE_SAMPLER_PARAMETERIIV,
509 OPCODE_SAMPLER_PARAMETERUIV,
510
511 /* ARB_compute_shader */
512 OPCODE_DISPATCH_COMPUTE,
513
514 /* GL_ARB_sync */
515 OPCODE_WAIT_SYNC,
516
517 /* GL_NV_conditional_render */
518 OPCODE_BEGIN_CONDITIONAL_RENDER,
519 OPCODE_END_CONDITIONAL_RENDER,
520
521 /* ARB_timer_query */
522 OPCODE_QUERY_COUNTER,
523
524 /* ARB_transform_feedback3 */
525 OPCODE_BEGIN_QUERY_INDEXED,
526 OPCODE_END_QUERY_INDEXED,
527 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM,
528
529 /* ARB_transform_feedback_instanced */
530 OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED,
531 OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED,
532
533 /* ARB_uniform_buffer_object */
534 OPCODE_UNIFORM_BLOCK_BINDING,
535
536 /* ARB_shader_subroutines */
537 OPCODE_UNIFORM_SUBROUTINES,
538
539 /* EXT_polygon_offset_clamp */
540 OPCODE_POLYGON_OFFSET_CLAMP,
541
542 /* EXT_window_rectangles */
543 OPCODE_WINDOW_RECTANGLES,
544
545 /* NV_conservative_raster */
546 OPCODE_SUBPIXEL_PRECISION_BIAS,
547
548 /* NV_conservative_raster_dilate */
549 OPCODE_CONSERVATIVE_RASTER_PARAMETER_F,
550
551 /* NV_conservative_raster_pre_snap_triangles */
552 OPCODE_CONSERVATIVE_RASTER_PARAMETER_I,
553
554 /* EXT_direct_state_access */
555 OPCODE_MATRIX_LOAD,
556 OPCODE_MATRIX_MULT,
557 OPCODE_MATRIX_ROTATE,
558 OPCODE_MATRIX_SCALE,
559 OPCODE_MATRIX_TRANSLATE,
560 OPCODE_MATRIX_LOAD_IDENTITY,
561 OPCODE_MATRIX_ORTHO,
562 OPCODE_MATRIX_FRUSTUM,
563 OPCODE_MATRIX_PUSH,
564 OPCODE_MATRIX_POP,
565 OPCODE_TEXTUREPARAMETER_F,
566 OPCODE_TEXTUREPARAMETER_I,
567 OPCODE_TEXTUREPARAMETER_II,
568 OPCODE_TEXTUREPARAMETER_IUI,
569 OPCODE_TEXTURE_IMAGE1D,
570 OPCODE_TEXTURE_IMAGE2D,
571 OPCODE_TEXTURE_IMAGE3D,
572 OPCODE_TEXTURE_SUB_IMAGE1D,
573 OPCODE_TEXTURE_SUB_IMAGE2D,
574 OPCODE_TEXTURE_SUB_IMAGE3D,
575 OPCODE_COPY_TEXTURE_IMAGE1D,
576 OPCODE_COPY_TEXTURE_IMAGE2D,
577 OPCODE_COPY_TEXTURE_SUB_IMAGE1D,
578 OPCODE_COPY_TEXTURE_SUB_IMAGE2D,
579 OPCODE_COPY_TEXTURE_SUB_IMAGE3D,
580 OPCODE_BIND_MULTITEXTURE,
581 OPCODE_MULTITEXPARAMETER_F,
582 OPCODE_MULTITEXPARAMETER_I,
583 OPCODE_MULTITEXPARAMETER_II,
584 OPCODE_MULTITEXPARAMETER_IUI,
585 OPCODE_MULTITEX_IMAGE1D,
586 OPCODE_MULTITEX_IMAGE2D,
587 OPCODE_MULTITEX_IMAGE3D,
588 OPCODE_MULTITEX_SUB_IMAGE1D,
589 OPCODE_MULTITEX_SUB_IMAGE2D,
590 OPCODE_MULTITEX_SUB_IMAGE3D,
591 OPCODE_COPY_MULTITEX_IMAGE1D,
592 OPCODE_COPY_MULTITEX_IMAGE2D,
593 OPCODE_COPY_MULTITEX_SUB_IMAGE1D,
594 OPCODE_COPY_MULTITEX_SUB_IMAGE2D,
595 OPCODE_COPY_MULTITEX_SUB_IMAGE3D,
596 OPCODE_MULTITEXENV,
597 OPCODE_COMPRESSED_TEXTURE_IMAGE_1D,
598 OPCODE_COMPRESSED_TEXTURE_IMAGE_2D,
599 OPCODE_COMPRESSED_TEXTURE_IMAGE_3D,
600 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D,
601 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D,
602 OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D,
603 OPCODE_COMPRESSED_MULTITEX_IMAGE_1D,
604 OPCODE_COMPRESSED_MULTITEX_IMAGE_2D,
605 OPCODE_COMPRESSED_MULTITEX_IMAGE_3D,
606 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D,
607 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D,
608 OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D,
609 OPCODE_NAMED_PROGRAM_STRING,
610 OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER,
611
612 /* GL_ARB_ES3_2_compatibility */
613 OPCODE_PRIMITIVE_BOUNDING_BOX,
614
615 OPCODE_VERTEX_LIST,
616 OPCODE_VERTEX_LIST_LOOPBACK,
617 OPCODE_VERTEX_LIST_COPY_CURRENT,
618
619 /* The following three are meta instructions */
620 OPCODE_ERROR, /* raise compiled-in error */
621 OPCODE_CONTINUE,
622 OPCODE_END_OF_LIST
623 } OpCode;
624
625
626 typedef union gl_dlist_node Node;
627
628
629 /** How many 4-byte dwords to store a pointer */
630 #define POINTER_DWORDS (sizeof(void *) / 4)
631
632 /* We want to keep sizeof(union gl_dlist_node) == 4 to minimize
633 * space for display lists. The following types and functions are
634 * used to help store 4- and 8-byte pointers in 1 or 2 dlist_nodes.
635 */
636 union pointer
637 {
638 void *ptr;
639 GLuint dwords[POINTER_DWORDS];
640 };
641
642
643 /**
644 * Save a 4 or 8-byte pointer at dest (and dest+1).
645 */
646 static inline void
save_pointer(Node * dest,void * src)647 save_pointer(Node *dest, void *src)
648 {
649 union pointer p;
650 unsigned i;
651
652 STATIC_ASSERT(POINTER_DWORDS == 1 || POINTER_DWORDS == 2);
653 STATIC_ASSERT(sizeof(Node) == 4);
654
655 p.ptr = src;
656
657 for (i = 0; i < POINTER_DWORDS; i++)
658 dest[i].ui = p.dwords[i];
659 }
660
661
662 /**
663 * Retrieve a 4 or 8-byte pointer from node (node+1).
664 */
665 static inline void *
get_pointer(const Node * node)666 get_pointer(const Node *node)
667 {
668 union pointer p;
669 unsigned i;
670
671 for (i = 0; i < POINTER_DWORDS; i++)
672 p.dwords[i] = node[i].ui;
673
674 return p.ptr;
675 }
676
677
678 /**
679 * Used to store a 64-bit uint in a pair of "Nodes" for the sake of 32-bit
680 * environment.
681 */
682 union uint64_pair
683 {
684 GLuint64 uint64;
685 GLuint uint32[2];
686 };
687
688
689 union float64_pair
690 {
691 GLdouble d;
692 GLuint uint32[2];
693 };
694
695 union int64_pair
696 {
697 GLint64 int64;
698 GLint int32[2];
699 };
700
701 #define ASSIGN_DOUBLE_TO_NODES(n, idx, value) \
702 do { \
703 union float64_pair tmp; \
704 tmp.d = value; \
705 n[idx].ui = tmp.uint32[0]; \
706 n[idx+1].ui = tmp.uint32[1]; \
707 } while (0)
708
709 #define ASSIGN_UINT64_TO_NODES(n, idx, value) \
710 do { \
711 union uint64_pair tmp; \
712 tmp.uint64 = value; \
713 n[idx].ui = tmp.uint32[0]; \
714 n[idx+1].ui = tmp.uint32[1]; \
715 } while (0)
716
717 #define ASSIGN_INT64_TO_NODES(n, idx, value) \
718 do { \
719 union int64_pair tmp; \
720 tmp.int64 = value; \
721 n[idx].i = tmp.int32[0]; \
722 n[idx+1].i = tmp.int32[1]; \
723 } while (0)
724
725 /**
726 * How many nodes to allocate at a time. Note that bulk vertex data
727 * from glBegin/glVertex/glEnd primitives will typically wind up in
728 * a VBO, and not directly in the display list itself.
729 */
730 #define BLOCK_SIZE 256
731
732
733 void mesa_print_display_list(GLuint list);
734
735
736 /**
737 * Called by display list code when a display list is being deleted.
738 */
739 static void
vbo_destroy_vertex_list(struct gl_context * ctx,struct vbo_save_vertex_list * node)740 vbo_destroy_vertex_list(struct gl_context *ctx, struct vbo_save_vertex_list *node)
741 {
742 struct gl_buffer_object *bo = node->cold->VAO[0]->BufferBinding[0].BufferObj;
743
744 if (_mesa_bufferobj_mapped(bo, MAP_INTERNAL))
745 _mesa_bufferobj_unmap(ctx, bo, MAP_INTERNAL);
746
747 for (gl_vertex_processing_mode mode = VP_MODE_FF; mode < VP_MODE_MAX; ++mode) {
748 _mesa_reference_vao(ctx, &node->cold->VAO[mode], NULL);
749 if (node->private_refcount[mode]) {
750 assert(node->private_refcount[mode] > 0);
751 p_atomic_add(&node->state[mode]->reference.count,
752 -node->private_refcount[mode]);
753 }
754 pipe_vertex_state_reference(&node->state[mode], NULL);
755 }
756
757 if (node->modes) {
758 free(node->modes);
759 free(node->start_counts);
760 }
761
762 _mesa_reference_buffer_object(ctx, &node->cold->ib.obj, NULL);
763 free(node->cold->current_data);
764 node->cold->current_data = NULL;
765
766 free(node->cold->prims);
767 free(node->cold);
768 }
769
770 static void
vbo_print_vertex_list(struct gl_context * ctx,struct vbo_save_vertex_list * node,OpCode op,FILE * f)771 vbo_print_vertex_list(struct gl_context *ctx, struct vbo_save_vertex_list *node, OpCode op, FILE *f)
772 {
773 GLuint i;
774 struct gl_buffer_object *buffer = node->cold->VAO[0]->BufferBinding[0].BufferObj;
775 const GLuint vertex_size = _vbo_save_get_stride(node)/sizeof(GLfloat);
776 (void) ctx;
777
778 const char *label[] = {
779 "VBO-VERTEX-LIST", "VBO-VERTEX-LIST-LOOPBACK", "VBO-VERTEX-LIST-COPY-CURRENT"
780 };
781
782 fprintf(f, "%s, %u vertices, %d primitives, %d vertsize, "
783 "buffer %p\n",
784 label[op - OPCODE_VERTEX_LIST],
785 node->cold->vertex_count, node->cold->prim_count, vertex_size,
786 buffer);
787
788 for (i = 0; i < node->cold->prim_count; i++) {
789 struct _mesa_prim *prim = &node->cold->prims[i];
790 fprintf(f, " prim %d: %s %d..%d %s %s\n",
791 i,
792 _mesa_lookup_prim_by_nr(prim->mode),
793 prim->start,
794 prim->start + prim->count,
795 (prim->begin) ? "BEGIN" : "(wrap)",
796 (prim->end) ? "END" : "(wrap)");
797 }
798 }
799
800
801 static inline
get_list_head(struct gl_context * ctx,struct gl_display_list * dlist)802 Node *get_list_head(struct gl_context *ctx, struct gl_display_list *dlist)
803 {
804 return dlist->small_list ?
805 &ctx->Shared->small_dlist_store.ptr[dlist->start] :
806 dlist->Head;
807 }
808
809
810 /**
811 * Allocate a gl_display_list object with an initial block of storage.
812 * \param count how many display list nodes/tokens to allocate
813 */
814 static struct gl_display_list *
make_list(GLuint name,GLuint count)815 make_list(GLuint name, GLuint count)
816 {
817 struct gl_display_list *dlist = CALLOC_STRUCT(gl_display_list);
818 dlist->Name = name;
819 dlist->Head = malloc(sizeof(Node) * count);
820 dlist->Head[0].opcode = OPCODE_END_OF_LIST;
821 return dlist;
822 }
823
824
825 /**
826 * Lookup function to just encapsulate casting.
827 */
828 struct gl_display_list *
_mesa_lookup_list(struct gl_context * ctx,GLuint list,bool locked)829 _mesa_lookup_list(struct gl_context *ctx, GLuint list, bool locked)
830 {
831 return (struct gl_display_list *)
832 _mesa_HashLookupMaybeLocked(&ctx->Shared->DisplayList, list, locked);
833 }
834
835
836 /**
837 * Delete the named display list, but don't remove from hash table.
838 * \param dlist - display list pointer
839 */
840 void
_mesa_delete_list(struct gl_context * ctx,struct gl_display_list * dlist)841 _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dlist)
842 {
843 Node *n, *block;
844
845 n = block = get_list_head(ctx, dlist);
846
847 if (!n) {
848 free(dlist->Label);
849 FREE(dlist);
850 return;
851 }
852
853 while (1) {
854 const OpCode opcode = n[0].opcode;
855
856 switch (opcode) {
857 /* for some commands, we need to free malloc'd memory */
858 case OPCODE_MAP1:
859 free(get_pointer(&n[6]));
860 break;
861 case OPCODE_MAP2:
862 free(get_pointer(&n[10]));
863 break;
864 case OPCODE_CALL_LISTS:
865 free(get_pointer(&n[3]));
866 break;
867 case OPCODE_DRAW_PIXELS:
868 free(get_pointer(&n[5]));
869 break;
870 case OPCODE_BITMAP: {
871 struct pipe_resource *tex = get_pointer(&n[7]);
872 pipe_resource_reference(&tex, NULL);
873 break;
874 }
875 case OPCODE_POLYGON_STIPPLE:
876 free(get_pointer(&n[1]));
877 break;
878 case OPCODE_TEX_IMAGE1D:
879 free(get_pointer(&n[8]));
880 break;
881 case OPCODE_TEX_IMAGE2D:
882 free(get_pointer(&n[9]));
883 break;
884 case OPCODE_TEX_IMAGE3D:
885 free(get_pointer(&n[10]));
886 break;
887 case OPCODE_TEX_SUB_IMAGE1D:
888 free(get_pointer(&n[7]));
889 break;
890 case OPCODE_TEX_SUB_IMAGE2D:
891 free(get_pointer(&n[9]));
892 break;
893 case OPCODE_TEX_SUB_IMAGE3D:
894 free(get_pointer(&n[11]));
895 break;
896 case OPCODE_COMPRESSED_TEX_IMAGE_1D:
897 free(get_pointer(&n[7]));
898 break;
899 case OPCODE_COMPRESSED_TEX_IMAGE_2D:
900 free(get_pointer(&n[8]));
901 break;
902 case OPCODE_COMPRESSED_TEX_IMAGE_3D:
903 free(get_pointer(&n[9]));
904 break;
905 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D:
906 free(get_pointer(&n[7]));
907 break;
908 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D:
909 free(get_pointer(&n[9]));
910 break;
911 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D:
912 free(get_pointer(&n[11]));
913 break;
914 case OPCODE_PROGRAM_STRING_ARB:
915 free(get_pointer(&n[4])); /* program string */
916 break;
917 case OPCODE_UNIFORM_1FV:
918 case OPCODE_UNIFORM_2FV:
919 case OPCODE_UNIFORM_3FV:
920 case OPCODE_UNIFORM_4FV:
921 case OPCODE_UNIFORM_1DV:
922 case OPCODE_UNIFORM_2DV:
923 case OPCODE_UNIFORM_3DV:
924 case OPCODE_UNIFORM_4DV:
925 case OPCODE_UNIFORM_1IV:
926 case OPCODE_UNIFORM_2IV:
927 case OPCODE_UNIFORM_3IV:
928 case OPCODE_UNIFORM_4IV:
929 case OPCODE_UNIFORM_1UIV:
930 case OPCODE_UNIFORM_2UIV:
931 case OPCODE_UNIFORM_3UIV:
932 case OPCODE_UNIFORM_4UIV:
933 case OPCODE_UNIFORM_1I64V:
934 case OPCODE_UNIFORM_2I64V:
935 case OPCODE_UNIFORM_3I64V:
936 case OPCODE_UNIFORM_4I64V:
937 case OPCODE_UNIFORM_1UI64V:
938 case OPCODE_UNIFORM_2UI64V:
939 case OPCODE_UNIFORM_3UI64V:
940 case OPCODE_UNIFORM_4UI64V:
941 free(get_pointer(&n[3]));
942 break;
943 case OPCODE_UNIFORM_MATRIX22:
944 case OPCODE_UNIFORM_MATRIX33:
945 case OPCODE_UNIFORM_MATRIX44:
946 case OPCODE_UNIFORM_MATRIX24:
947 case OPCODE_UNIFORM_MATRIX42:
948 case OPCODE_UNIFORM_MATRIX23:
949 case OPCODE_UNIFORM_MATRIX32:
950 case OPCODE_UNIFORM_MATRIX34:
951 case OPCODE_UNIFORM_MATRIX43:
952 case OPCODE_UNIFORM_MATRIX22D:
953 case OPCODE_UNIFORM_MATRIX33D:
954 case OPCODE_UNIFORM_MATRIX44D:
955 case OPCODE_UNIFORM_MATRIX24D:
956 case OPCODE_UNIFORM_MATRIX42D:
957 case OPCODE_UNIFORM_MATRIX23D:
958 case OPCODE_UNIFORM_MATRIX32D:
959 case OPCODE_UNIFORM_MATRIX34D:
960 case OPCODE_UNIFORM_MATRIX43D:
961 free(get_pointer(&n[4]));
962 break;
963 case OPCODE_PROGRAM_UNIFORM_1FV:
964 case OPCODE_PROGRAM_UNIFORM_2FV:
965 case OPCODE_PROGRAM_UNIFORM_3FV:
966 case OPCODE_PROGRAM_UNIFORM_4FV:
967 case OPCODE_PROGRAM_UNIFORM_1DV:
968 case OPCODE_PROGRAM_UNIFORM_2DV:
969 case OPCODE_PROGRAM_UNIFORM_3DV:
970 case OPCODE_PROGRAM_UNIFORM_4DV:
971 case OPCODE_PROGRAM_UNIFORM_1IV:
972 case OPCODE_PROGRAM_UNIFORM_2IV:
973 case OPCODE_PROGRAM_UNIFORM_3IV:
974 case OPCODE_PROGRAM_UNIFORM_4IV:
975 case OPCODE_PROGRAM_UNIFORM_1UIV:
976 case OPCODE_PROGRAM_UNIFORM_2UIV:
977 case OPCODE_PROGRAM_UNIFORM_3UIV:
978 case OPCODE_PROGRAM_UNIFORM_4UIV:
979 case OPCODE_PROGRAM_UNIFORM_1I64V:
980 case OPCODE_PROGRAM_UNIFORM_2I64V:
981 case OPCODE_PROGRAM_UNIFORM_3I64V:
982 case OPCODE_PROGRAM_UNIFORM_4I64V:
983 case OPCODE_PROGRAM_UNIFORM_1UI64V:
984 case OPCODE_PROGRAM_UNIFORM_2UI64V:
985 case OPCODE_PROGRAM_UNIFORM_3UI64V:
986 case OPCODE_PROGRAM_UNIFORM_4UI64V:
987 free(get_pointer(&n[4]));
988 break;
989 case OPCODE_PROGRAM_UNIFORM_MATRIX22F:
990 case OPCODE_PROGRAM_UNIFORM_MATRIX33F:
991 case OPCODE_PROGRAM_UNIFORM_MATRIX44F:
992 case OPCODE_PROGRAM_UNIFORM_MATRIX24F:
993 case OPCODE_PROGRAM_UNIFORM_MATRIX42F:
994 case OPCODE_PROGRAM_UNIFORM_MATRIX23F:
995 case OPCODE_PROGRAM_UNIFORM_MATRIX32F:
996 case OPCODE_PROGRAM_UNIFORM_MATRIX34F:
997 case OPCODE_PROGRAM_UNIFORM_MATRIX43F:
998 case OPCODE_PROGRAM_UNIFORM_MATRIX22D:
999 case OPCODE_PROGRAM_UNIFORM_MATRIX33D:
1000 case OPCODE_PROGRAM_UNIFORM_MATRIX44D:
1001 case OPCODE_PROGRAM_UNIFORM_MATRIX24D:
1002 case OPCODE_PROGRAM_UNIFORM_MATRIX42D:
1003 case OPCODE_PROGRAM_UNIFORM_MATRIX23D:
1004 case OPCODE_PROGRAM_UNIFORM_MATRIX32D:
1005 case OPCODE_PROGRAM_UNIFORM_MATRIX34D:
1006 case OPCODE_PROGRAM_UNIFORM_MATRIX43D:
1007 free(get_pointer(&n[5]));
1008 break;
1009 case OPCODE_PIXEL_MAP:
1010 free(get_pointer(&n[3]));
1011 break;
1012 case OPCODE_VIEWPORT_ARRAY_V:
1013 case OPCODE_SCISSOR_ARRAY_V:
1014 case OPCODE_DEPTH_ARRAY_V:
1015 case OPCODE_UNIFORM_SUBROUTINES:
1016 case OPCODE_WINDOW_RECTANGLES:
1017 free(get_pointer(&n[3]));
1018 break;
1019 case OPCODE_TEXTURE_IMAGE1D:
1020 case OPCODE_MULTITEX_IMAGE1D:
1021 free(get_pointer(&n[9]));
1022 break;
1023 case OPCODE_TEXTURE_IMAGE2D:
1024 case OPCODE_MULTITEX_IMAGE2D:
1025 free(get_pointer(&n[10]));
1026 break;
1027 case OPCODE_TEXTURE_IMAGE3D:
1028 case OPCODE_MULTITEX_IMAGE3D:
1029 free(get_pointer(&n[11]));
1030 break;
1031 case OPCODE_TEXTURE_SUB_IMAGE1D:
1032 case OPCODE_MULTITEX_SUB_IMAGE1D:
1033 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D:
1034 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D:
1035 free(get_pointer(&n[8]));
1036 break;
1037 case OPCODE_TEXTURE_SUB_IMAGE2D:
1038 case OPCODE_MULTITEX_SUB_IMAGE2D:
1039 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D:
1040 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D:
1041 free(get_pointer(&n[10]));
1042 break;
1043 case OPCODE_TEXTURE_SUB_IMAGE3D:
1044 case OPCODE_MULTITEX_SUB_IMAGE3D:
1045 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D:
1046 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D:
1047 free(get_pointer(&n[12]));
1048 break;
1049 case OPCODE_COMPRESSED_TEXTURE_IMAGE_1D:
1050 case OPCODE_COMPRESSED_MULTITEX_IMAGE_1D:
1051 free(get_pointer(&n[8]));
1052 break;
1053 case OPCODE_COMPRESSED_TEXTURE_IMAGE_2D:
1054 case OPCODE_COMPRESSED_MULTITEX_IMAGE_2D:
1055 free(get_pointer(&n[9]));
1056 break;
1057 case OPCODE_COMPRESSED_TEXTURE_IMAGE_3D:
1058 case OPCODE_COMPRESSED_MULTITEX_IMAGE_3D:
1059 free(get_pointer(&n[10]));
1060 break;
1061 case OPCODE_NAMED_PROGRAM_STRING:
1062 free(get_pointer(&n[5]));
1063 break;
1064 case OPCODE_VERTEX_LIST:
1065 case OPCODE_VERTEX_LIST_LOOPBACK:
1066 case OPCODE_VERTEX_LIST_COPY_CURRENT:
1067 vbo_destroy_vertex_list(ctx, (struct vbo_save_vertex_list *) &n[0]);
1068 break;
1069 case OPCODE_CONTINUE:
1070 n = (Node *) get_pointer(&n[1]);
1071 assert (!dlist->small_list);
1072 free(block);
1073 block = n;
1074 continue;
1075 case OPCODE_END_OF_LIST:
1076 if (dlist->small_list) {
1077 unsigned start = dlist->start;
1078 for (int i = 0; i < dlist->count; i++) {
1079 util_idalloc_free(&ctx->Shared->small_dlist_store.free_idx,
1080 start + i);
1081 }
1082 } else {
1083 free(block);
1084 }
1085 free(dlist->Label);
1086 free(dlist);
1087 return;
1088 default:
1089 /* just increment 'n' pointer, below */
1090 ;
1091 }
1092
1093 assert(n[0].InstSize > 0);
1094 n += n[0].InstSize;
1095 }
1096 }
1097
1098
1099 /**
1100 * Destroy a display list and remove from hash table.
1101 * \param list - display list number
1102 */
1103 static void
destroy_list(struct gl_context * ctx,GLuint list)1104 destroy_list(struct gl_context *ctx, GLuint list)
1105 {
1106 struct gl_display_list *dlist;
1107
1108 if (list == 0)
1109 return;
1110
1111 dlist = _mesa_lookup_list(ctx, list, true);
1112 if (!dlist)
1113 return;
1114
1115 _mesa_delete_list(ctx, dlist);
1116 _mesa_HashRemoveLocked(&ctx->Shared->DisplayList, list);
1117 }
1118
1119
1120 /**
1121 * Wrapper for _mesa_unpack_image/bitmap() that handles pixel buffer objects.
1122 * If width < 0 or height < 0 or format or type are invalid we'll just
1123 * return NULL. We will not generate an error since OpenGL command
1124 * arguments aren't error-checked until the command is actually executed
1125 * (not when they're compiled).
1126 * But if we run out of memory, GL_OUT_OF_MEMORY will be recorded.
1127 */
1128 static GLvoid *
unpack_image(struct gl_context * ctx,GLuint dimensions,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLenum type,const GLvoid * pixels,const struct gl_pixelstore_attrib * unpack)1129 unpack_image(struct gl_context *ctx, GLuint dimensions,
1130 GLsizei width, GLsizei height, GLsizei depth,
1131 GLenum format, GLenum type, const GLvoid * pixels,
1132 const struct gl_pixelstore_attrib *unpack)
1133 {
1134 if (width <= 0 || height <= 0) {
1135 return NULL;
1136 }
1137
1138 if (_mesa_bytes_per_pixel(format, type) < 0) {
1139 /* bad format and/or type */
1140 return NULL;
1141 }
1142
1143 if (!unpack->BufferObj) {
1144 /* no PBO */
1145 GLvoid *image;
1146
1147 image = _mesa_unpack_image(dimensions, width, height, depth,
1148 format, type, pixels, unpack);
1149 if (pixels && !image) {
1150 _mesa_error(ctx, GL_OUT_OF_MEMORY, "display list construction");
1151 }
1152 return image;
1153 }
1154 else if (_mesa_validate_pbo_access(dimensions, unpack, width, height,
1155 depth, format, type, INT_MAX, pixels)) {
1156 const GLubyte *map, *src;
1157 GLvoid *image;
1158
1159 map = (GLubyte *)
1160 _mesa_bufferobj_map_range(ctx, 0, unpack->BufferObj->Size,
1161 GL_MAP_READ_BIT, unpack->BufferObj,
1162 MAP_INTERNAL);
1163 if (!map) {
1164 /* unable to map src buffer! */
1165 _mesa_error(ctx, GL_INVALID_OPERATION, "unable to map PBO");
1166 return NULL;
1167 }
1168
1169 src = ADD_POINTERS(map, pixels);
1170 image = _mesa_unpack_image(dimensions, width, height, depth,
1171 format, type, src, unpack);
1172
1173 _mesa_bufferobj_unmap(ctx, unpack->BufferObj, MAP_INTERNAL);
1174
1175 if (!image) {
1176 _mesa_error(ctx, GL_OUT_OF_MEMORY, "display list construction");
1177 }
1178 return image;
1179 }
1180
1181 /* bad access! */
1182 _mesa_error(ctx, GL_INVALID_OPERATION, "invalid PBO access");
1183 return NULL;
1184 }
1185
1186
1187 /** Return copy of memory */
1188 static void *
memdup(const void * src,GLsizei bytes)1189 memdup(const void *src, GLsizei bytes)
1190 {
1191 void *b = bytes >= 0 ? malloc(bytes) : NULL;
1192 if (b)
1193 memcpy(b, src, bytes);
1194 return b;
1195 }
1196
1197
1198 /**
1199 * Allocate space for a display list instruction (opcode + payload space).
1200 * \param opcode the instruction opcode (OPCODE_* value)
1201 * \param bytes instruction payload size (not counting opcode)
1202 * \param align8 does the payload need to be 8-byte aligned?
1203 * This is only relevant in 64-bit environments.
1204 * \return pointer to allocated memory (the payload will be at pointer+1)
1205 */
1206 static Node *
dlist_alloc(struct gl_context * ctx,OpCode opcode,GLuint bytes,bool align8)1207 dlist_alloc(struct gl_context *ctx, OpCode opcode, GLuint bytes, bool align8)
1208 {
1209 const GLuint numNodes = 1 + (bytes + sizeof(Node) - 1) / sizeof(Node);
1210 const GLuint contNodes = 1 + POINTER_DWORDS; /* size of continue info */
1211
1212 assert(bytes <= BLOCK_SIZE * sizeof(Node));
1213
1214 /* If this node needs to start on an 8-byte boundary, pad the last node. */
1215 if (sizeof(void *) == 8 && align8 &&
1216 ctx->ListState.CurrentPos % 2 == 1) {
1217 Node *last = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos -
1218 ctx->ListState.LastInstSize;
1219 last->InstSize++;
1220 ctx->ListState.CurrentPos++;
1221 }
1222
1223 if (ctx->ListState.CurrentPos + numNodes + contNodes >= BLOCK_SIZE) {
1224 /* This block is full. Allocate a new block and chain to it */
1225 Node *newblock;
1226 Node *n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
1227 n[0].opcode = OPCODE_CONTINUE;
1228 newblock = malloc(sizeof(Node) * BLOCK_SIZE);
1229 if (!newblock) {
1230 _mesa_error(ctx, GL_OUT_OF_MEMORY, "Building display list");
1231 return NULL;
1232 }
1233
1234 /* a fresh block should be 8-byte aligned on 64-bit systems */
1235 assert(((GLintptr) newblock) % sizeof(void *) == 0);
1236
1237 save_pointer(&n[1], newblock);
1238 ctx->ListState.CurrentBlock = newblock;
1239 ctx->ListState.CurrentPos = 0;
1240 }
1241
1242 Node *n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos;
1243 ctx->ListState.CurrentPos += numNodes;
1244
1245 n[0].opcode = opcode;
1246 n[0].InstSize = numNodes;
1247 ctx->ListState.LastInstSize = numNodes;
1248
1249 return n;
1250 }
1251
1252
1253 void *
_mesa_dlist_alloc_vertex_list(struct gl_context * ctx,bool copy_to_current)1254 _mesa_dlist_alloc_vertex_list(struct gl_context *ctx, bool copy_to_current)
1255 {
1256 Node *n = dlist_alloc(ctx,
1257 copy_to_current ? OPCODE_VERTEX_LIST_COPY_CURRENT :
1258 OPCODE_VERTEX_LIST,
1259 sizeof(struct vbo_save_vertex_list) - sizeof(Node),
1260 true);
1261 if (!n)
1262 return NULL;
1263
1264 /* Clear all nodes except the header */
1265 memset(n + 1, 0, sizeof(struct vbo_save_vertex_list) - sizeof(Node));
1266 return n;
1267 }
1268
1269
1270 /**
1271 * Allocate space for a display list instruction. The space is basically
1272 * an array of Nodes where node[0] holds the opcode, node[1] is the first
1273 * function parameter, node[2] is the second parameter, etc.
1274 *
1275 * \param opcode one of OPCODE_x
1276 * \param nparams number of function parameters
1277 * \return pointer to start of instruction space
1278 */
1279 static inline Node *
alloc_instruction(struct gl_context * ctx,OpCode opcode,GLuint nparams)1280 alloc_instruction(struct gl_context *ctx, OpCode opcode, GLuint nparams)
1281 {
1282 return dlist_alloc(ctx, opcode, nparams * sizeof(Node), false);
1283 }
1284
1285
1286 /*
1287 * Display List compilation functions
1288 */
1289 void GLAPIENTRY
save_Accum(GLenum op,GLfloat value)1290 save_Accum(GLenum op, GLfloat value)
1291 {
1292 GET_CURRENT_CONTEXT(ctx);
1293 Node *n;
1294 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1295 n = alloc_instruction(ctx, OPCODE_ACCUM, 2);
1296 if (n) {
1297 n[1].e = op;
1298 n[2].f = value;
1299 }
1300 if (ctx->ExecuteFlag) {
1301 CALL_Accum(ctx->Dispatch.Exec, (op, value));
1302 }
1303 }
1304
1305
1306 void GLAPIENTRY
save_AlphaFunc(GLenum func,GLclampf ref)1307 save_AlphaFunc(GLenum func, GLclampf ref)
1308 {
1309 GET_CURRENT_CONTEXT(ctx);
1310 Node *n;
1311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1312 n = alloc_instruction(ctx, OPCODE_ALPHA_FUNC, 2);
1313 if (n) {
1314 n[1].e = func;
1315 n[2].f = (GLfloat) ref;
1316 }
1317 if (ctx->ExecuteFlag) {
1318 CALL_AlphaFunc(ctx->Dispatch.Exec, (func, ref));
1319 }
1320 }
1321
1322
1323 void GLAPIENTRY
save_BindTexture(GLenum target,GLuint texture)1324 save_BindTexture(GLenum target, GLuint texture)
1325 {
1326 GET_CURRENT_CONTEXT(ctx);
1327 Node *n;
1328 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1329 n = alloc_instruction(ctx, OPCODE_BIND_TEXTURE, 2);
1330 if (n) {
1331 n[1].e = target;
1332 n[2].ui = texture;
1333 }
1334 if (ctx->ExecuteFlag) {
1335 CALL_BindTexture(ctx->Dispatch.Exec, (target, texture));
1336 }
1337 }
1338
1339
1340 void GLAPIENTRY
save_Bitmap(GLsizei width,GLsizei height,GLfloat xorig,GLfloat yorig,GLfloat xmove,GLfloat ymove,const GLubyte * pixels)1341 save_Bitmap(GLsizei width, GLsizei height,
1342 GLfloat xorig, GLfloat yorig,
1343 GLfloat xmove, GLfloat ymove, const GLubyte * pixels)
1344 {
1345 GET_CURRENT_CONTEXT(ctx);
1346 Node *n;
1347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1348 struct pipe_resource *tex = NULL;
1349
1350 if (width > 0 && height > 0) {
1351 tex = st_make_bitmap_texture(ctx, width, height, &ctx->Unpack, pixels);
1352
1353 if (!tex) {
1354 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glNewList -> glBitmap");
1355 return;
1356 }
1357 }
1358
1359 n = alloc_instruction(ctx, OPCODE_BITMAP, 6 + POINTER_DWORDS);
1360 if (!n) {
1361 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glNewList -> glBitmap (3)");
1362 pipe_resource_reference(&tex, NULL);
1363 return;
1364 }
1365
1366 n[1].i = (GLint) width;
1367 n[2].i = (GLint) height;
1368 n[3].f = xorig;
1369 n[4].f = yorig;
1370 n[5].f = xmove;
1371 n[6].f = ymove;
1372 save_pointer(&n[7], tex);
1373
1374 if (ctx->ExecuteFlag) {
1375 ASSERT_OUTSIDE_BEGIN_END(ctx);
1376 _mesa_bitmap(ctx, width, height, xorig, yorig, xmove, ymove, NULL, tex);
1377 }
1378 }
1379
1380
1381 void GLAPIENTRY
save_BlendEquation(GLenum mode)1382 save_BlendEquation(GLenum mode)
1383 {
1384 GET_CURRENT_CONTEXT(ctx);
1385 Node *n;
1386 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1387 n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION, 1);
1388 if (n) {
1389 n[1].e = mode;
1390 }
1391 if (ctx->ExecuteFlag) {
1392 CALL_BlendEquation(ctx->Dispatch.Exec, (mode));
1393 }
1394 }
1395
1396
1397 void GLAPIENTRY
save_BlendEquationSeparate(GLenum modeRGB,GLenum modeA)1398 save_BlendEquationSeparate(GLenum modeRGB, GLenum modeA)
1399 {
1400 GET_CURRENT_CONTEXT(ctx);
1401 Node *n;
1402 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1403 n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_SEPARATE, 2);
1404 if (n) {
1405 n[1].e = modeRGB;
1406 n[2].e = modeA;
1407 }
1408 if (ctx->ExecuteFlag) {
1409 CALL_BlendEquationSeparate(ctx->Dispatch.Exec, (modeRGB, modeA));
1410 }
1411 }
1412
1413
1414 void GLAPIENTRY
save_BlendFuncSeparate(GLenum sfactorRGB,GLenum dfactorRGB,GLenum sfactorA,GLenum dfactorA)1415 save_BlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB,
1416 GLenum sfactorA, GLenum dfactorA)
1417 {
1418 GET_CURRENT_CONTEXT(ctx);
1419 Node *n;
1420 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1421 n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE, 4);
1422 if (n) {
1423 n[1].e = sfactorRGB;
1424 n[2].e = dfactorRGB;
1425 n[3].e = sfactorA;
1426 n[4].e = dfactorA;
1427 }
1428 if (ctx->ExecuteFlag) {
1429 CALL_BlendFuncSeparate(ctx->Dispatch.Exec,
1430 (sfactorRGB, dfactorRGB, sfactorA, dfactorA));
1431 }
1432 }
1433
1434
1435 void GLAPIENTRY
save_BlendFunc(GLenum srcfactor,GLenum dstfactor)1436 save_BlendFunc(GLenum srcfactor, GLenum dstfactor)
1437 {
1438 save_BlendFuncSeparate(srcfactor, dstfactor, srcfactor, dstfactor);
1439 }
1440
1441
1442 void GLAPIENTRY
save_BlendColor(GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)1443 save_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
1444 {
1445 GET_CURRENT_CONTEXT(ctx);
1446 Node *n;
1447 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1448 n = alloc_instruction(ctx, OPCODE_BLEND_COLOR, 4);
1449 if (n) {
1450 n[1].f = red;
1451 n[2].f = green;
1452 n[3].f = blue;
1453 n[4].f = alpha;
1454 }
1455 if (ctx->ExecuteFlag) {
1456 CALL_BlendColor(ctx->Dispatch.Exec, (red, green, blue, alpha));
1457 }
1458 }
1459
1460 /* GL_ARB_draw_buffers_blend */
1461 void GLAPIENTRY
save_BlendFuncSeparateiARB(GLuint buf,GLenum sfactorRGB,GLenum dfactorRGB,GLenum sfactorA,GLenum dfactorA)1462 save_BlendFuncSeparateiARB(GLuint buf, GLenum sfactorRGB, GLenum dfactorRGB,
1463 GLenum sfactorA, GLenum dfactorA)
1464 {
1465 GET_CURRENT_CONTEXT(ctx);
1466 Node *n;
1467 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1468 n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE_I, 5);
1469 if (n) {
1470 n[1].ui = buf;
1471 n[2].e = sfactorRGB;
1472 n[3].e = dfactorRGB;
1473 n[4].e = sfactorA;
1474 n[5].e = dfactorA;
1475 }
1476 if (ctx->ExecuteFlag) {
1477 CALL_BlendFuncSeparateiARB(ctx->Dispatch.Exec, (buf, sfactorRGB, dfactorRGB,
1478 sfactorA, dfactorA));
1479 }
1480 }
1481
1482 /* GL_ARB_draw_buffers_blend */
1483 void GLAPIENTRY
save_BlendFunciARB(GLuint buf,GLenum sfactor,GLenum dfactor)1484 save_BlendFunciARB(GLuint buf, GLenum sfactor, GLenum dfactor)
1485 {
1486 GET_CURRENT_CONTEXT(ctx);
1487 Node *n;
1488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1489 n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_I, 3);
1490 if (n) {
1491 n[1].ui = buf;
1492 n[2].e = sfactor;
1493 n[3].e = dfactor;
1494 }
1495 if (ctx->ExecuteFlag) {
1496 CALL_BlendFunciARB(ctx->Dispatch.Exec, (buf, sfactor, dfactor));
1497 }
1498 }
1499
1500 /* GL_ARB_draw_buffers_blend */
1501 void GLAPIENTRY
save_BlendEquationiARB(GLuint buf,GLenum mode)1502 save_BlendEquationiARB(GLuint buf, GLenum mode)
1503 {
1504 GET_CURRENT_CONTEXT(ctx);
1505 Node *n;
1506 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1507 n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_I, 2);
1508 if (n) {
1509 n[1].ui = buf;
1510 n[2].e = mode;
1511 }
1512 if (ctx->ExecuteFlag) {
1513 CALL_BlendEquationiARB(ctx->Dispatch.Exec, (buf, mode));
1514 }
1515 }
1516
1517 /* GL_ARB_draw_buffers_blend */
1518 void GLAPIENTRY
save_BlendEquationSeparateiARB(GLuint buf,GLenum modeRGB,GLenum modeA)1519 save_BlendEquationSeparateiARB(GLuint buf, GLenum modeRGB, GLenum modeA)
1520 {
1521 GET_CURRENT_CONTEXT(ctx);
1522 Node *n;
1523 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1524 n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_SEPARATE_I, 3);
1525 if (n) {
1526 n[1].ui = buf;
1527 n[2].e = modeRGB;
1528 n[3].e = modeA;
1529 }
1530 if (ctx->ExecuteFlag) {
1531 CALL_BlendEquationSeparateiARB(ctx->Dispatch.Exec, (buf, modeRGB, modeA));
1532 }
1533 }
1534
1535
1536 /* GL_ARB_draw_instanced. */
1537 void GLAPIENTRY
save_DrawArraysInstanced(UNUSED GLenum mode,UNUSED GLint first,UNUSED GLsizei count,UNUSED GLsizei primcount)1538 save_DrawArraysInstanced(UNUSED GLenum mode,
1539 UNUSED GLint first,
1540 UNUSED GLsizei count,
1541 UNUSED GLsizei primcount)
1542 {
1543 GET_CURRENT_CONTEXT(ctx);
1544 _mesa_error(ctx, GL_INVALID_OPERATION,
1545 "glDrawArraysInstanced() during display list compile");
1546 }
1547
1548 void GLAPIENTRY
save_DrawElementsInstanced(UNUSED GLenum mode,UNUSED GLsizei count,UNUSED GLenum type,UNUSED const GLvoid * indices,UNUSED GLsizei primcount)1549 save_DrawElementsInstanced(UNUSED GLenum mode,
1550 UNUSED GLsizei count,
1551 UNUSED GLenum type,
1552 UNUSED const GLvoid *indices,
1553 UNUSED GLsizei primcount)
1554 {
1555 GET_CURRENT_CONTEXT(ctx);
1556 _mesa_error(ctx, GL_INVALID_OPERATION,
1557 "glDrawElementsInstanced() during display list compile");
1558 }
1559
1560 void GLAPIENTRY
save_DrawElementsInstancedBaseVertex(UNUSED GLenum mode,UNUSED GLsizei count,UNUSED GLenum type,UNUSED const GLvoid * indices,UNUSED GLsizei primcount,UNUSED GLint basevertex)1561 save_DrawElementsInstancedBaseVertex(UNUSED GLenum mode,
1562 UNUSED GLsizei count,
1563 UNUSED GLenum type,
1564 UNUSED const GLvoid *indices,
1565 UNUSED GLsizei primcount,
1566 UNUSED GLint basevertex)
1567 {
1568 GET_CURRENT_CONTEXT(ctx);
1569 _mesa_error(ctx, GL_INVALID_OPERATION,
1570 "glDrawElementsInstancedBaseVertex() during display list compile");
1571 }
1572
1573 /* GL_ARB_base_instance. */
1574 void GLAPIENTRY
save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode,UNUSED GLint first,UNUSED GLsizei count,UNUSED GLsizei primcount,UNUSED GLuint baseinstance)1575 save_DrawArraysInstancedBaseInstance(UNUSED GLenum mode,
1576 UNUSED GLint first,
1577 UNUSED GLsizei count,
1578 UNUSED GLsizei primcount,
1579 UNUSED GLuint baseinstance)
1580 {
1581 GET_CURRENT_CONTEXT(ctx);
1582 _mesa_error(ctx, GL_INVALID_OPERATION,
1583 "glDrawArraysInstancedBaseInstance() during display list compile");
1584 }
1585
1586 void GLAPIENTRY
save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode,UNUSED GLsizei count,UNUSED GLenum type,UNUSED const void * indices,UNUSED GLsizei primcount,UNUSED GLuint baseinstance)1587 save_DrawElementsInstancedBaseInstance(UNUSED GLenum mode,
1588 UNUSED GLsizei count,
1589 UNUSED GLenum type,
1590 UNUSED const void *indices,
1591 UNUSED GLsizei primcount,
1592 UNUSED GLuint baseinstance)
1593 {
1594 GET_CURRENT_CONTEXT(ctx);
1595 _mesa_error(ctx, GL_INVALID_OPERATION,
1596 "glDrawElementsInstancedBaseInstance() during display list compile");
1597 }
1598
1599 void GLAPIENTRY
save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode,UNUSED GLsizei count,UNUSED GLenum type,UNUSED const void * indices,UNUSED GLsizei primcount,UNUSED GLint basevertex,UNUSED GLuint baseinstance)1600 save_DrawElementsInstancedBaseVertexBaseInstance(UNUSED GLenum mode,
1601 UNUSED GLsizei count,
1602 UNUSED GLenum type,
1603 UNUSED const void *indices,
1604 UNUSED GLsizei primcount,
1605 UNUSED GLint basevertex,
1606 UNUSED GLuint baseinstance)
1607 {
1608 GET_CURRENT_CONTEXT(ctx);
1609 _mesa_error(ctx, GL_INVALID_OPERATION,
1610 "glDrawElementsInstancedBaseVertexBaseInstance() during display list compile");
1611 }
1612
1613 void GLAPIENTRY
save_DrawArraysIndirect(UNUSED GLenum mode,UNUSED const void * indirect)1614 save_DrawArraysIndirect(UNUSED GLenum mode,
1615 UNUSED const void *indirect)
1616 {
1617 GET_CURRENT_CONTEXT(ctx);
1618 _mesa_error(ctx, GL_INVALID_OPERATION,
1619 "glDrawArraysIndirect() during display list compile");
1620 }
1621
1622 void GLAPIENTRY
save_DrawElementsIndirect(UNUSED GLenum mode,UNUSED GLenum type,UNUSED const void * indirect)1623 save_DrawElementsIndirect(UNUSED GLenum mode,
1624 UNUSED GLenum type,
1625 UNUSED const void *indirect)
1626 {
1627 GET_CURRENT_CONTEXT(ctx);
1628 _mesa_error(ctx, GL_INVALID_OPERATION,
1629 "glDrawElementsIndirect() during display list compile");
1630 }
1631
1632 void GLAPIENTRY
save_MultiDrawArraysIndirect(UNUSED GLenum mode,UNUSED const void * indirect,UNUSED GLsizei primcount,UNUSED GLsizei stride)1633 save_MultiDrawArraysIndirect(UNUSED GLenum mode,
1634 UNUSED const void *indirect,
1635 UNUSED GLsizei primcount,
1636 UNUSED GLsizei stride)
1637 {
1638 GET_CURRENT_CONTEXT(ctx);
1639 _mesa_error(ctx, GL_INVALID_OPERATION,
1640 "glMultiDrawArraysIndirect() during display list compile");
1641 }
1642
1643 void GLAPIENTRY
save_MultiDrawElementsIndirect(UNUSED GLenum mode,UNUSED GLenum type,UNUSED const void * indirect,UNUSED GLsizei primcount,UNUSED GLsizei stride)1644 save_MultiDrawElementsIndirect(UNUSED GLenum mode,
1645 UNUSED GLenum type,
1646 UNUSED const void *indirect,
1647 UNUSED GLsizei primcount,
1648 UNUSED GLsizei stride)
1649 {
1650 GET_CURRENT_CONTEXT(ctx);
1651 _mesa_error(ctx, GL_INVALID_OPERATION,
1652 "glMultiDrawElementsIndirect() during display list compile");
1653 }
1654
1655 /**
1656 * While building a display list we cache some OpenGL state.
1657 * Under some circumstances we need to invalidate that state (immediately
1658 * when we start compiling a list, or after glCallList(s)).
1659 */
1660 static void
invalidate_saved_current_state(struct gl_context * ctx)1661 invalidate_saved_current_state(struct gl_context *ctx)
1662 {
1663 GLint i;
1664
1665 for (i = 0; i < VERT_ATTRIB_MAX; i++)
1666 ctx->ListState.ActiveAttribSize[i] = 0;
1667
1668 for (i = 0; i < MAT_ATTRIB_MAX; i++)
1669 ctx->ListState.ActiveMaterialSize[i] = 0;
1670
1671 /* Loopback usage applies recursively, so remember this state */
1672 bool use_loopback = ctx->ListState.Current.UseLoopback;
1673 memset(&ctx->ListState.Current, 0, sizeof ctx->ListState.Current);
1674 ctx->ListState.Current.UseLoopback = use_loopback;
1675
1676 ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN;
1677 }
1678
1679
1680 static void GLAPIENTRY
save_CallList(GLuint list)1681 save_CallList(GLuint list)
1682 {
1683 GET_CURRENT_CONTEXT(ctx);
1684 Node *n;
1685 SAVE_FLUSH_VERTICES(ctx);
1686
1687 n = alloc_instruction(ctx, OPCODE_CALL_LIST, 1);
1688 if (n) {
1689 n[1].ui = list;
1690 }
1691
1692 /* After this, we don't know what state we're in. Invalidate all
1693 * cached information previously gathered:
1694 */
1695 invalidate_saved_current_state( ctx );
1696
1697 if (ctx->ExecuteFlag) {
1698 _mesa_CallList(list);
1699 }
1700 }
1701
1702
1703 static void GLAPIENTRY
save_CallLists(GLsizei num,GLenum type,const GLvoid * lists)1704 save_CallLists(GLsizei num, GLenum type, const GLvoid * lists)
1705 {
1706 GET_CURRENT_CONTEXT(ctx);
1707 unsigned type_size;
1708 Node *n;
1709 void *lists_copy;
1710
1711 SAVE_FLUSH_VERTICES(ctx);
1712
1713 switch (type) {
1714 case GL_BYTE:
1715 case GL_UNSIGNED_BYTE:
1716 type_size = 1;
1717 break;
1718 case GL_SHORT:
1719 case GL_UNSIGNED_SHORT:
1720 case GL_2_BYTES:
1721 type_size = 2;
1722 break;
1723 case GL_3_BYTES:
1724 type_size = 3;
1725 break;
1726 case GL_INT:
1727 case GL_UNSIGNED_INT:
1728 case GL_FLOAT:
1729 case GL_4_BYTES:
1730 type_size = 4;
1731 break;
1732 default:
1733 type_size = 0;
1734 }
1735
1736 if (num > 0 && type_size > 0) {
1737 /* create a copy of the array of list IDs to save in the display list */
1738 lists_copy = memdup(lists, num * type_size);
1739 } else {
1740 lists_copy = NULL;
1741 }
1742
1743 n = alloc_instruction(ctx, OPCODE_CALL_LISTS, 2 + POINTER_DWORDS);
1744 if (n) {
1745 n[1].i = num;
1746 n[2].e = type;
1747 save_pointer(&n[3], lists_copy);
1748 }
1749
1750 /* After this, we don't know what state we're in. Invalidate all
1751 * cached information previously gathered:
1752 */
1753 invalidate_saved_current_state( ctx );
1754
1755 if (ctx->ExecuteFlag) {
1756 CALL_CallLists(ctx->Dispatch.Exec, (num, type, lists));
1757 }
1758 }
1759
1760
1761 void GLAPIENTRY
save_Clear(GLbitfield mask)1762 save_Clear(GLbitfield mask)
1763 {
1764 GET_CURRENT_CONTEXT(ctx);
1765 Node *n;
1766 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1767 n = alloc_instruction(ctx, OPCODE_CLEAR, 1);
1768 if (n) {
1769 n[1].bf = mask;
1770 }
1771 if (ctx->ExecuteFlag) {
1772 CALL_Clear(ctx->Dispatch.Exec, (mask));
1773 }
1774 }
1775
1776
1777 void GLAPIENTRY
save_ClearBufferiv(GLenum buffer,GLint drawbuffer,const GLint * value)1778 save_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value)
1779 {
1780 GET_CURRENT_CONTEXT(ctx);
1781 Node *n;
1782 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1783 n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_IV, 6);
1784 if (n) {
1785 n[1].e = buffer;
1786 n[2].i = drawbuffer;
1787 n[3].i = value[0];
1788 if (buffer == GL_COLOR) {
1789 n[4].i = value[1];
1790 n[5].i = value[2];
1791 n[6].i = value[3];
1792 }
1793 else {
1794 n[4].i = 0;
1795 n[5].i = 0;
1796 n[6].i = 0;
1797 }
1798 }
1799 if (ctx->ExecuteFlag) {
1800 CALL_ClearBufferiv(ctx->Dispatch.Exec, (buffer, drawbuffer, value));
1801 }
1802 }
1803
1804
1805 void GLAPIENTRY
save_ClearBufferuiv(GLenum buffer,GLint drawbuffer,const GLuint * value)1806 save_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint *value)
1807 {
1808 GET_CURRENT_CONTEXT(ctx);
1809 Node *n;
1810 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1811 n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_UIV, 6);
1812 if (n) {
1813 n[1].e = buffer;
1814 n[2].i = drawbuffer;
1815 n[3].ui = value[0];
1816 if (buffer == GL_COLOR) {
1817 n[4].ui = value[1];
1818 n[5].ui = value[2];
1819 n[6].ui = value[3];
1820 }
1821 else {
1822 n[4].ui = 0;
1823 n[5].ui = 0;
1824 n[6].ui = 0;
1825 }
1826 }
1827 if (ctx->ExecuteFlag) {
1828 CALL_ClearBufferuiv(ctx->Dispatch.Exec, (buffer, drawbuffer, value));
1829 }
1830 }
1831
1832
1833 void GLAPIENTRY
save_ClearBufferfv(GLenum buffer,GLint drawbuffer,const GLfloat * value)1834 save_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat *value)
1835 {
1836 GET_CURRENT_CONTEXT(ctx);
1837 Node *n;
1838 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1839 n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_FV, 6);
1840 if (n) {
1841 n[1].e = buffer;
1842 n[2].i = drawbuffer;
1843 n[3].f = value[0];
1844 if (buffer == GL_COLOR) {
1845 n[4].f = value[1];
1846 n[5].f = value[2];
1847 n[6].f = value[3];
1848 }
1849 else {
1850 n[4].f = 0.0F;
1851 n[5].f = 0.0F;
1852 n[6].f = 0.0F;
1853 }
1854 }
1855 if (ctx->ExecuteFlag) {
1856 CALL_ClearBufferfv(ctx->Dispatch.Exec, (buffer, drawbuffer, value));
1857 }
1858 }
1859
1860
1861 void GLAPIENTRY
save_ClearBufferfi(GLenum buffer,GLint drawbuffer,GLfloat depth,GLint stencil)1862 save_ClearBufferfi(GLenum buffer, GLint drawbuffer,
1863 GLfloat depth, GLint stencil)
1864 {
1865 GET_CURRENT_CONTEXT(ctx);
1866 Node *n;
1867 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1868 n = alloc_instruction(ctx, OPCODE_CLEAR_BUFFER_FI, 4);
1869 if (n) {
1870 n[1].e = buffer;
1871 n[2].i = drawbuffer;
1872 n[3].f = depth;
1873 n[4].i = stencil;
1874 }
1875 if (ctx->ExecuteFlag) {
1876 CALL_ClearBufferfi(ctx->Dispatch.Exec, (buffer, drawbuffer, depth, stencil));
1877 }
1878 }
1879
1880
1881 void GLAPIENTRY
save_ClearAccum(GLfloat red,GLfloat green,GLfloat blue,GLfloat alpha)1882 save_ClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
1883 {
1884 GET_CURRENT_CONTEXT(ctx);
1885 Node *n;
1886 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1887 n = alloc_instruction(ctx, OPCODE_CLEAR_ACCUM, 4);
1888 if (n) {
1889 n[1].f = red;
1890 n[2].f = green;
1891 n[3].f = blue;
1892 n[4].f = alpha;
1893 }
1894 if (ctx->ExecuteFlag) {
1895 CALL_ClearAccum(ctx->Dispatch.Exec, (red, green, blue, alpha));
1896 }
1897 }
1898
1899
1900 void GLAPIENTRY
save_ClearColor(GLclampf red,GLclampf green,GLclampf blue,GLclampf alpha)1901 save_ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
1902 {
1903 GET_CURRENT_CONTEXT(ctx);
1904 Node *n;
1905 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1906 n = alloc_instruction(ctx, OPCODE_CLEAR_COLOR, 4);
1907 if (n) {
1908 n[1].f = red;
1909 n[2].f = green;
1910 n[3].f = blue;
1911 n[4].f = alpha;
1912 }
1913 if (ctx->ExecuteFlag) {
1914 CALL_ClearColor(ctx->Dispatch.Exec, (red, green, blue, alpha));
1915 }
1916 }
1917
1918
1919 void GLAPIENTRY
save_ClearDepth(GLclampd depth)1920 save_ClearDepth(GLclampd depth)
1921 {
1922 GET_CURRENT_CONTEXT(ctx);
1923 Node *n;
1924 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1925 n = alloc_instruction(ctx, OPCODE_CLEAR_DEPTH, 1);
1926 if (n) {
1927 n[1].f = (GLfloat) depth;
1928 }
1929 if (ctx->ExecuteFlag) {
1930 CALL_ClearDepth(ctx->Dispatch.Exec, (depth));
1931 }
1932 }
1933
1934
1935 void GLAPIENTRY
save_ClearIndex(GLfloat c)1936 save_ClearIndex(GLfloat c)
1937 {
1938 GET_CURRENT_CONTEXT(ctx);
1939 Node *n;
1940 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1941 n = alloc_instruction(ctx, OPCODE_CLEAR_INDEX, 1);
1942 if (n) {
1943 n[1].f = c;
1944 }
1945 if (ctx->ExecuteFlag) {
1946 CALL_ClearIndex(ctx->Dispatch.Exec, (c));
1947 }
1948 }
1949
1950
1951 void GLAPIENTRY
save_ClearStencil(GLint s)1952 save_ClearStencil(GLint s)
1953 {
1954 GET_CURRENT_CONTEXT(ctx);
1955 Node *n;
1956 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1957 n = alloc_instruction(ctx, OPCODE_CLEAR_STENCIL, 1);
1958 if (n) {
1959 n[1].i = s;
1960 }
1961 if (ctx->ExecuteFlag) {
1962 CALL_ClearStencil(ctx->Dispatch.Exec, (s));
1963 }
1964 }
1965
1966
1967 void GLAPIENTRY
save_ClipPlane(GLenum plane,const GLdouble * equ)1968 save_ClipPlane(GLenum plane, const GLdouble * equ)
1969 {
1970 GET_CURRENT_CONTEXT(ctx);
1971 Node *n;
1972 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1973 n = alloc_instruction(ctx, OPCODE_CLIP_PLANE, 5);
1974 if (n) {
1975 n[1].e = plane;
1976 n[2].f = (GLfloat) equ[0];
1977 n[3].f = (GLfloat) equ[1];
1978 n[4].f = (GLfloat) equ[2];
1979 n[5].f = (GLfloat) equ[3];
1980 }
1981 if (ctx->ExecuteFlag) {
1982 CALL_ClipPlane(ctx->Dispatch.Exec, (plane, equ));
1983 }
1984 }
1985
1986
1987
1988 void GLAPIENTRY
save_ColorMask(GLboolean red,GLboolean green,GLboolean blue,GLboolean alpha)1989 save_ColorMask(GLboolean red, GLboolean green,
1990 GLboolean blue, GLboolean alpha)
1991 {
1992 GET_CURRENT_CONTEXT(ctx);
1993 Node *n;
1994 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
1995 n = alloc_instruction(ctx, OPCODE_COLOR_MASK, 4);
1996 if (n) {
1997 n[1].b = red;
1998 n[2].b = green;
1999 n[3].b = blue;
2000 n[4].b = alpha;
2001 }
2002 if (ctx->ExecuteFlag) {
2003 CALL_ColorMask(ctx->Dispatch.Exec, (red, green, blue, alpha));
2004 }
2005 }
2006
2007
2008 void GLAPIENTRY
save_ColorMaski(GLuint buf,GLboolean red,GLboolean green,GLboolean blue,GLboolean alpha)2009 save_ColorMaski(GLuint buf, GLboolean red, GLboolean green,
2010 GLboolean blue, GLboolean alpha)
2011 {
2012 GET_CURRENT_CONTEXT(ctx);
2013 Node *n;
2014 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2015 n = alloc_instruction(ctx, OPCODE_COLOR_MASK_INDEXED, 5);
2016 if (n) {
2017 n[1].ui = buf;
2018 n[2].b = red;
2019 n[3].b = green;
2020 n[4].b = blue;
2021 n[5].b = alpha;
2022 }
2023 if (ctx->ExecuteFlag) {
2024 /*CALL_ColorMaski(ctx->Dispatch.Exec, (buf, red, green, blue, alpha));*/
2025 }
2026 }
2027
2028
2029 void GLAPIENTRY
save_ColorMaterial(GLenum face,GLenum mode)2030 save_ColorMaterial(GLenum face, GLenum mode)
2031 {
2032 GET_CURRENT_CONTEXT(ctx);
2033 Node *n;
2034 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2035
2036 n = alloc_instruction(ctx, OPCODE_COLOR_MATERIAL, 2);
2037 if (n) {
2038 n[1].e = face;
2039 n[2].e = mode;
2040 }
2041 if (ctx->ExecuteFlag) {
2042 CALL_ColorMaterial(ctx->Dispatch.Exec, (face, mode));
2043 }
2044 }
2045
2046
2047 void GLAPIENTRY
save_CopyPixels(GLint x,GLint y,GLsizei width,GLsizei height,GLenum type)2048 save_CopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
2049 {
2050 GET_CURRENT_CONTEXT(ctx);
2051 Node *n;
2052 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2053 n = alloc_instruction(ctx, OPCODE_COPY_PIXELS, 5);
2054 if (n) {
2055 n[1].i = x;
2056 n[2].i = y;
2057 n[3].i = (GLint) width;
2058 n[4].i = (GLint) height;
2059 n[5].e = type;
2060 }
2061 if (ctx->ExecuteFlag) {
2062 CALL_CopyPixels(ctx->Dispatch.Exec, (x, y, width, height, type));
2063 }
2064 }
2065
2066
2067
2068 void GLAPIENTRY
save_CopyTexImage1D(GLenum target,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLint border)2069 save_CopyTexImage1D(GLenum target, GLint level, GLenum internalformat,
2070 GLint x, GLint y, GLsizei width, GLint border)
2071 {
2072 GET_CURRENT_CONTEXT(ctx);
2073 Node *n;
2074 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2075 n = alloc_instruction(ctx, OPCODE_COPY_TEX_IMAGE1D, 7);
2076 if (n) {
2077 n[1].e = target;
2078 n[2].i = level;
2079 n[3].e = internalformat;
2080 n[4].i = x;
2081 n[5].i = y;
2082 n[6].i = width;
2083 n[7].i = border;
2084 }
2085 if (ctx->ExecuteFlag) {
2086 CALL_CopyTexImage1D(ctx->Dispatch.Exec, (target, level, internalformat,
2087 x, y, width, border));
2088 }
2089 }
2090
2091
2092 void GLAPIENTRY
save_CopyTexImage2D(GLenum target,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLsizei height,GLint border)2093 save_CopyTexImage2D(GLenum target, GLint level,
2094 GLenum internalformat,
2095 GLint x, GLint y, GLsizei width,
2096 GLsizei height, GLint border)
2097 {
2098 GET_CURRENT_CONTEXT(ctx);
2099 Node *n;
2100 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2101 n = alloc_instruction(ctx, OPCODE_COPY_TEX_IMAGE2D, 8);
2102 if (n) {
2103 n[1].e = target;
2104 n[2].i = level;
2105 n[3].e = internalformat;
2106 n[4].i = x;
2107 n[5].i = y;
2108 n[6].i = width;
2109 n[7].i = height;
2110 n[8].i = border;
2111 }
2112 if (ctx->ExecuteFlag) {
2113 CALL_CopyTexImage2D(ctx->Dispatch.Exec, (target, level, internalformat,
2114 x, y, width, height, border));
2115 }
2116 }
2117
2118
2119
2120 void GLAPIENTRY
save_CopyTexSubImage1D(GLenum target,GLint level,GLint xoffset,GLint x,GLint y,GLsizei width)2121 save_CopyTexSubImage1D(GLenum target, GLint level,
2122 GLint xoffset, GLint x, GLint y, GLsizei width)
2123 {
2124 GET_CURRENT_CONTEXT(ctx);
2125 Node *n;
2126 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2127 n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6);
2128 if (n) {
2129 n[1].e = target;
2130 n[2].i = level;
2131 n[3].i = xoffset;
2132 n[4].i = x;
2133 n[5].i = y;
2134 n[6].i = width;
2135 }
2136 if (ctx->ExecuteFlag) {
2137 CALL_CopyTexSubImage1D(ctx->Dispatch.Exec,
2138 (target, level, xoffset, x, y, width));
2139 }
2140 }
2141
2142
2143 void GLAPIENTRY
save_CopyTexSubImage2D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint x,GLint y,GLsizei width,GLint height)2144 save_CopyTexSubImage2D(GLenum target, GLint level,
2145 GLint xoffset, GLint yoffset,
2146 GLint x, GLint y, GLsizei width, GLint height)
2147 {
2148 GET_CURRENT_CONTEXT(ctx);
2149 Node *n;
2150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2151 n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8);
2152 if (n) {
2153 n[1].e = target;
2154 n[2].i = level;
2155 n[3].i = xoffset;
2156 n[4].i = yoffset;
2157 n[5].i = x;
2158 n[6].i = y;
2159 n[7].i = width;
2160 n[8].i = height;
2161 }
2162 if (ctx->ExecuteFlag) {
2163 CALL_CopyTexSubImage2D(ctx->Dispatch.Exec, (target, level, xoffset, yoffset,
2164 x, y, width, height));
2165 }
2166 }
2167
2168
2169 void GLAPIENTRY
save_CopyTexSubImage3D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLint x,GLint y,GLsizei width,GLint height)2170 save_CopyTexSubImage3D(GLenum target, GLint level,
2171 GLint xoffset, GLint yoffset, GLint zoffset,
2172 GLint x, GLint y, GLsizei width, GLint height)
2173 {
2174 GET_CURRENT_CONTEXT(ctx);
2175 Node *n;
2176 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2177 n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9);
2178 if (n) {
2179 n[1].e = target;
2180 n[2].i = level;
2181 n[3].i = xoffset;
2182 n[4].i = yoffset;
2183 n[5].i = zoffset;
2184 n[6].i = x;
2185 n[7].i = y;
2186 n[8].i = width;
2187 n[9].i = height;
2188 }
2189 if (ctx->ExecuteFlag) {
2190 CALL_CopyTexSubImage3D(ctx->Dispatch.Exec, (target, level,
2191 xoffset, yoffset, zoffset,
2192 x, y, width, height));
2193 }
2194 }
2195
2196
2197 void GLAPIENTRY
save_CullFace(GLenum mode)2198 save_CullFace(GLenum mode)
2199 {
2200 GET_CURRENT_CONTEXT(ctx);
2201 Node *n;
2202 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2203 n = alloc_instruction(ctx, OPCODE_CULL_FACE, 1);
2204 if (n) {
2205 n[1].e = mode;
2206 }
2207 if (ctx->ExecuteFlag) {
2208 CALL_CullFace(ctx->Dispatch.Exec, (mode));
2209 }
2210 }
2211
2212
2213 void GLAPIENTRY
save_DepthFunc(GLenum func)2214 save_DepthFunc(GLenum func)
2215 {
2216 GET_CURRENT_CONTEXT(ctx);
2217 Node *n;
2218 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2219 n = alloc_instruction(ctx, OPCODE_DEPTH_FUNC, 1);
2220 if (n) {
2221 n[1].e = func;
2222 }
2223 if (ctx->ExecuteFlag) {
2224 CALL_DepthFunc(ctx->Dispatch.Exec, (func));
2225 }
2226 }
2227
2228
2229 void GLAPIENTRY
save_DepthMask(GLboolean mask)2230 save_DepthMask(GLboolean mask)
2231 {
2232 GET_CURRENT_CONTEXT(ctx);
2233 Node *n;
2234 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2235 n = alloc_instruction(ctx, OPCODE_DEPTH_MASK, 1);
2236 if (n) {
2237 n[1].b = mask;
2238 }
2239 if (ctx->ExecuteFlag) {
2240 CALL_DepthMask(ctx->Dispatch.Exec, (mask));
2241 }
2242 }
2243
2244
2245 void GLAPIENTRY
save_DepthRange(GLclampd nearval,GLclampd farval)2246 save_DepthRange(GLclampd nearval, GLclampd farval)
2247 {
2248 GET_CURRENT_CONTEXT(ctx);
2249 Node *n;
2250 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2251 n = alloc_instruction(ctx, OPCODE_DEPTH_RANGE, 2);
2252 if (n) {
2253 n[1].f = (GLfloat) nearval;
2254 n[2].f = (GLfloat) farval;
2255 }
2256 if (ctx->ExecuteFlag) {
2257 CALL_DepthRange(ctx->Dispatch.Exec, (nearval, farval));
2258 }
2259 }
2260
2261
2262 void GLAPIENTRY
save_Disable(GLenum cap)2263 save_Disable(GLenum cap)
2264 {
2265 GET_CURRENT_CONTEXT(ctx);
2266 Node *n;
2267 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2268 n = alloc_instruction(ctx, OPCODE_DISABLE, 1);
2269 if (n) {
2270 n[1].e = cap;
2271 }
2272 if (ctx->ExecuteFlag) {
2273 CALL_Disable(ctx->Dispatch.Exec, (cap));
2274 }
2275 }
2276
2277
2278 void GLAPIENTRY
save_Disablei(GLuint index,GLenum cap)2279 save_Disablei(GLuint index, GLenum cap)
2280 {
2281 GET_CURRENT_CONTEXT(ctx);
2282 Node *n;
2283 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2284 n = alloc_instruction(ctx, OPCODE_DISABLE_INDEXED, 2);
2285 if (n) {
2286 n[1].ui = index;
2287 n[2].e = cap;
2288 }
2289 if (ctx->ExecuteFlag) {
2290 CALL_Disablei(ctx->Dispatch.Exec, (index, cap));
2291 }
2292 }
2293
2294
2295 void GLAPIENTRY
save_DrawBuffer(GLenum mode)2296 save_DrawBuffer(GLenum mode)
2297 {
2298 GET_CURRENT_CONTEXT(ctx);
2299 Node *n;
2300 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2301 n = alloc_instruction(ctx, OPCODE_DRAW_BUFFER, 1);
2302 if (n) {
2303 n[1].e = mode;
2304 }
2305 if (ctx->ExecuteFlag) {
2306 CALL_DrawBuffer(ctx->Dispatch.Exec, (mode));
2307 }
2308 }
2309
2310
2311 void GLAPIENTRY
save_DrawPixels(GLsizei width,GLsizei height,GLenum format,GLenum type,const GLvoid * pixels)2312 save_DrawPixels(GLsizei width, GLsizei height,
2313 GLenum format, GLenum type, const GLvoid * pixels)
2314 {
2315 GET_CURRENT_CONTEXT(ctx);
2316 Node *n;
2317
2318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2319
2320 n = alloc_instruction(ctx, OPCODE_DRAW_PIXELS, 4 + POINTER_DWORDS);
2321 if (n) {
2322 n[1].i = width;
2323 n[2].i = height;
2324 n[3].e = format;
2325 n[4].e = type;
2326 save_pointer(&n[5],
2327 unpack_image(ctx, 2, width, height, 1, format, type,
2328 pixels, &ctx->Unpack));
2329 }
2330 if (ctx->ExecuteFlag) {
2331 CALL_DrawPixels(ctx->Dispatch.Exec, (width, height, format, type, pixels));
2332 }
2333 }
2334
2335
2336
2337 void GLAPIENTRY
save_Enable(GLenum cap)2338 save_Enable(GLenum cap)
2339 {
2340 GET_CURRENT_CONTEXT(ctx);
2341 Node *n;
2342 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2343 n = alloc_instruction(ctx, OPCODE_ENABLE, 1);
2344 if (n) {
2345 n[1].e = cap;
2346 }
2347 if (ctx->ExecuteFlag) {
2348 CALL_Enable(ctx->Dispatch.Exec, (cap));
2349 }
2350 }
2351
2352
2353
2354 void GLAPIENTRY
save_Enablei(GLuint index,GLenum cap)2355 save_Enablei(GLuint index, GLenum cap)
2356 {
2357 GET_CURRENT_CONTEXT(ctx);
2358 Node *n;
2359 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2360 n = alloc_instruction(ctx, OPCODE_ENABLE_INDEXED, 2);
2361 if (n) {
2362 n[1].ui = index;
2363 n[2].e = cap;
2364 }
2365 if (ctx->ExecuteFlag) {
2366 CALL_Enablei(ctx->Dispatch.Exec, (index, cap));
2367 }
2368 }
2369
2370
2371
2372 void GLAPIENTRY
save_EvalMesh1(GLenum mode,GLint i1,GLint i2)2373 save_EvalMesh1(GLenum mode, GLint i1, GLint i2)
2374 {
2375 GET_CURRENT_CONTEXT(ctx);
2376 Node *n;
2377 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2378 n = alloc_instruction(ctx, OPCODE_EVALMESH1, 3);
2379 if (n) {
2380 n[1].e = mode;
2381 n[2].i = i1;
2382 n[3].i = i2;
2383 }
2384 if (ctx->ExecuteFlag) {
2385 CALL_EvalMesh1(ctx->Dispatch.Exec, (mode, i1, i2));
2386 }
2387 }
2388
2389
2390 void GLAPIENTRY
save_EvalMesh2(GLenum mode,GLint i1,GLint i2,GLint j1,GLint j2)2391 save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
2392 {
2393 GET_CURRENT_CONTEXT(ctx);
2394 Node *n;
2395 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2396 n = alloc_instruction(ctx, OPCODE_EVALMESH2, 5);
2397 if (n) {
2398 n[1].e = mode;
2399 n[2].i = i1;
2400 n[3].i = i2;
2401 n[4].i = j1;
2402 n[5].i = j2;
2403 }
2404 if (ctx->ExecuteFlag) {
2405 CALL_EvalMesh2(ctx->Dispatch.Exec, (mode, i1, i2, j1, j2));
2406 }
2407 }
2408
2409
2410
2411
2412 void GLAPIENTRY
save_Fogfv(GLenum pname,const GLfloat * params)2413 save_Fogfv(GLenum pname, const GLfloat *params)
2414 {
2415 GET_CURRENT_CONTEXT(ctx);
2416 Node *n;
2417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2418 n = alloc_instruction(ctx, OPCODE_FOG, 5);
2419 if (n) {
2420 n[1].e = pname;
2421 n[2].f = params[0];
2422 n[3].f = params[1];
2423 n[4].f = params[2];
2424 n[5].f = params[3];
2425 }
2426 if (ctx->ExecuteFlag) {
2427 CALL_Fogfv(ctx->Dispatch.Exec, (pname, params));
2428 }
2429 }
2430
2431
2432 void GLAPIENTRY
save_Fogf(GLenum pname,GLfloat param)2433 save_Fogf(GLenum pname, GLfloat param)
2434 {
2435 GLfloat parray[4];
2436 parray[0] = param;
2437 parray[1] = parray[2] = parray[3] = 0.0F;
2438 save_Fogfv(pname, parray);
2439 }
2440
2441
2442 void GLAPIENTRY
save_Fogiv(GLenum pname,const GLint * params)2443 save_Fogiv(GLenum pname, const GLint *params)
2444 {
2445 GLfloat p[4];
2446 switch (pname) {
2447 case GL_FOG_MODE:
2448 case GL_FOG_DENSITY:
2449 case GL_FOG_START:
2450 case GL_FOG_END:
2451 case GL_FOG_INDEX:
2452 case GL_FOG_COORDINATE_SOURCE:
2453 p[0] = (GLfloat) *params;
2454 p[1] = 0.0f;
2455 p[2] = 0.0f;
2456 p[3] = 0.0f;
2457 break;
2458 case GL_FOG_COLOR:
2459 p[0] = INT_TO_FLOAT(params[0]);
2460 p[1] = INT_TO_FLOAT(params[1]);
2461 p[2] = INT_TO_FLOAT(params[2]);
2462 p[3] = INT_TO_FLOAT(params[3]);
2463 break;
2464 default:
2465 /* Error will be caught later in gl_Fogfv */
2466 ASSIGN_4V(p, 0.0F, 0.0F, 0.0F, 0.0F);
2467 }
2468 save_Fogfv(pname, p);
2469 }
2470
2471
2472 void GLAPIENTRY
save_Fogi(GLenum pname,GLint param)2473 save_Fogi(GLenum pname, GLint param)
2474 {
2475 GLint parray[4];
2476 parray[0] = param;
2477 parray[1] = parray[2] = parray[3] = 0;
2478 save_Fogiv(pname, parray);
2479 }
2480
2481
2482 void GLAPIENTRY
save_FrontFace(GLenum mode)2483 save_FrontFace(GLenum mode)
2484 {
2485 GET_CURRENT_CONTEXT(ctx);
2486 Node *n;
2487 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2488 n = alloc_instruction(ctx, OPCODE_FRONT_FACE, 1);
2489 if (n) {
2490 n[1].e = mode;
2491 }
2492 if (ctx->ExecuteFlag) {
2493 CALL_FrontFace(ctx->Dispatch.Exec, (mode));
2494 }
2495 }
2496
2497
2498 void GLAPIENTRY
save_Frustum(GLdouble left,GLdouble right,GLdouble bottom,GLdouble top,GLdouble nearval,GLdouble farval)2499 save_Frustum(GLdouble left, GLdouble right,
2500 GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
2501 {
2502 GET_CURRENT_CONTEXT(ctx);
2503 Node *n;
2504 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2505 n = alloc_instruction(ctx, OPCODE_FRUSTUM, 6);
2506 if (n) {
2507 n[1].f = (GLfloat) left;
2508 n[2].f = (GLfloat) right;
2509 n[3].f = (GLfloat) bottom;
2510 n[4].f = (GLfloat) top;
2511 n[5].f = (GLfloat) nearval;
2512 n[6].f = (GLfloat) farval;
2513 }
2514 if (ctx->ExecuteFlag) {
2515 CALL_Frustum(ctx->Dispatch.Exec, (left, right, bottom, top, nearval, farval));
2516 }
2517 }
2518
2519
2520 void GLAPIENTRY
save_Hint(GLenum target,GLenum mode)2521 save_Hint(GLenum target, GLenum mode)
2522 {
2523 GET_CURRENT_CONTEXT(ctx);
2524 Node *n;
2525 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2526 n = alloc_instruction(ctx, OPCODE_HINT, 2);
2527 if (n) {
2528 n[1].e = target;
2529 n[2].e = mode;
2530 }
2531 if (ctx->ExecuteFlag) {
2532 CALL_Hint(ctx->Dispatch.Exec, (target, mode));
2533 }
2534 }
2535
2536
2537 void GLAPIENTRY
save_IndexMask(GLuint mask)2538 save_IndexMask(GLuint mask)
2539 {
2540 GET_CURRENT_CONTEXT(ctx);
2541 Node *n;
2542 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2543 n = alloc_instruction(ctx, OPCODE_INDEX_MASK, 1);
2544 if (n) {
2545 n[1].ui = mask;
2546 }
2547 if (ctx->ExecuteFlag) {
2548 CALL_IndexMask(ctx->Dispatch.Exec, (mask));
2549 }
2550 }
2551
2552
2553 void GLAPIENTRY
save_InitNames(void)2554 save_InitNames(void)
2555 {
2556 GET_CURRENT_CONTEXT(ctx);
2557 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2558 (void) alloc_instruction(ctx, OPCODE_INIT_NAMES, 0);
2559 if (ctx->ExecuteFlag) {
2560 CALL_InitNames(ctx->Dispatch.Exec, ());
2561 }
2562 }
2563
2564
2565 void GLAPIENTRY
save_Lightfv(GLenum light,GLenum pname,const GLfloat * params)2566 save_Lightfv(GLenum light, GLenum pname, const GLfloat *params)
2567 {
2568 GET_CURRENT_CONTEXT(ctx);
2569 Node *n;
2570 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2571 n = alloc_instruction(ctx, OPCODE_LIGHT, 6);
2572 if (n) {
2573 GLint i, nParams;
2574 n[1].e = light;
2575 n[2].e = pname;
2576 switch (pname) {
2577 case GL_AMBIENT:
2578 nParams = 4;
2579 break;
2580 case GL_DIFFUSE:
2581 nParams = 4;
2582 break;
2583 case GL_SPECULAR:
2584 nParams = 4;
2585 break;
2586 case GL_POSITION:
2587 nParams = 4;
2588 break;
2589 case GL_SPOT_DIRECTION:
2590 nParams = 3;
2591 break;
2592 case GL_SPOT_EXPONENT:
2593 nParams = 1;
2594 break;
2595 case GL_SPOT_CUTOFF:
2596 nParams = 1;
2597 break;
2598 case GL_CONSTANT_ATTENUATION:
2599 nParams = 1;
2600 break;
2601 case GL_LINEAR_ATTENUATION:
2602 nParams = 1;
2603 break;
2604 case GL_QUADRATIC_ATTENUATION:
2605 nParams = 1;
2606 break;
2607 default:
2608 nParams = 0;
2609 }
2610 for (i = 0; i < nParams; i++) {
2611 n[3 + i].f = params[i];
2612 }
2613 }
2614 if (ctx->ExecuteFlag) {
2615 CALL_Lightfv(ctx->Dispatch.Exec, (light, pname, params));
2616 }
2617 }
2618
2619
2620 void GLAPIENTRY
save_Lightf(GLenum light,GLenum pname,GLfloat param)2621 save_Lightf(GLenum light, GLenum pname, GLfloat param)
2622 {
2623 GLfloat parray[4];
2624 parray[0] = param;
2625 parray[1] = parray[2] = parray[3] = 0.0F;
2626 save_Lightfv(light, pname, parray);
2627 }
2628
2629
2630 void GLAPIENTRY
save_Lightiv(GLenum light,GLenum pname,const GLint * params)2631 save_Lightiv(GLenum light, GLenum pname, const GLint *params)
2632 {
2633 GLfloat fparam[4];
2634 switch (pname) {
2635 case GL_AMBIENT:
2636 case GL_DIFFUSE:
2637 case GL_SPECULAR:
2638 fparam[0] = INT_TO_FLOAT(params[0]);
2639 fparam[1] = INT_TO_FLOAT(params[1]);
2640 fparam[2] = INT_TO_FLOAT(params[2]);
2641 fparam[3] = INT_TO_FLOAT(params[3]);
2642 break;
2643 case GL_POSITION:
2644 fparam[0] = (GLfloat) params[0];
2645 fparam[1] = (GLfloat) params[1];
2646 fparam[2] = (GLfloat) params[2];
2647 fparam[3] = (GLfloat) params[3];
2648 break;
2649 case GL_SPOT_DIRECTION:
2650 fparam[0] = (GLfloat) params[0];
2651 fparam[1] = (GLfloat) params[1];
2652 fparam[2] = (GLfloat) params[2];
2653 break;
2654 case GL_SPOT_EXPONENT:
2655 case GL_SPOT_CUTOFF:
2656 case GL_CONSTANT_ATTENUATION:
2657 case GL_LINEAR_ATTENUATION:
2658 case GL_QUADRATIC_ATTENUATION:
2659 fparam[0] = (GLfloat) params[0];
2660 break;
2661 default:
2662 /* error will be caught later in gl_Lightfv */
2663 ;
2664 }
2665 save_Lightfv(light, pname, fparam);
2666 }
2667
2668
2669 void GLAPIENTRY
save_Lighti(GLenum light,GLenum pname,GLint param)2670 save_Lighti(GLenum light, GLenum pname, GLint param)
2671 {
2672 GLint parray[4];
2673 parray[0] = param;
2674 parray[1] = parray[2] = parray[3] = 0;
2675 save_Lightiv(light, pname, parray);
2676 }
2677
2678
2679 void GLAPIENTRY
save_LightModelfv(GLenum pname,const GLfloat * params)2680 save_LightModelfv(GLenum pname, const GLfloat *params)
2681 {
2682 GET_CURRENT_CONTEXT(ctx);
2683 Node *n;
2684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2685 n = alloc_instruction(ctx, OPCODE_LIGHT_MODEL, 5);
2686 if (n) {
2687 n[1].e = pname;
2688 n[2].f = params[0];
2689 n[3].f = params[1];
2690 n[4].f = params[2];
2691 n[5].f = params[3];
2692 }
2693 if (ctx->ExecuteFlag) {
2694 CALL_LightModelfv(ctx->Dispatch.Exec, (pname, params));
2695 }
2696 }
2697
2698
2699 void GLAPIENTRY
save_LightModelf(GLenum pname,GLfloat param)2700 save_LightModelf(GLenum pname, GLfloat param)
2701 {
2702 GLfloat parray[4];
2703 parray[0] = param;
2704 parray[1] = parray[2] = parray[3] = 0.0F;
2705 save_LightModelfv(pname, parray);
2706 }
2707
2708
2709 void GLAPIENTRY
save_LightModeliv(GLenum pname,const GLint * params)2710 save_LightModeliv(GLenum pname, const GLint *params)
2711 {
2712 GLfloat fparam[4];
2713 switch (pname) {
2714 case GL_LIGHT_MODEL_AMBIENT:
2715 fparam[0] = INT_TO_FLOAT(params[0]);
2716 fparam[1] = INT_TO_FLOAT(params[1]);
2717 fparam[2] = INT_TO_FLOAT(params[2]);
2718 fparam[3] = INT_TO_FLOAT(params[3]);
2719 break;
2720 case GL_LIGHT_MODEL_LOCAL_VIEWER:
2721 case GL_LIGHT_MODEL_TWO_SIDE:
2722 case GL_LIGHT_MODEL_COLOR_CONTROL:
2723 fparam[0] = (GLfloat) params[0];
2724 fparam[1] = 0.0F;
2725 fparam[2] = 0.0F;
2726 fparam[3] = 0.0F;
2727 break;
2728 default:
2729 /* Error will be caught later in gl_LightModelfv */
2730 ASSIGN_4V(fparam, 0.0F, 0.0F, 0.0F, 0.0F);
2731 }
2732 save_LightModelfv(pname, fparam);
2733 }
2734
2735
2736 void GLAPIENTRY
save_LightModeli(GLenum pname,GLint param)2737 save_LightModeli(GLenum pname, GLint param)
2738 {
2739 GLint parray[4];
2740 parray[0] = param;
2741 parray[1] = parray[2] = parray[3] = 0;
2742 save_LightModeliv(pname, parray);
2743 }
2744
2745
2746 void GLAPIENTRY
save_LineStipple(GLint factor,GLushort pattern)2747 save_LineStipple(GLint factor, GLushort pattern)
2748 {
2749 GET_CURRENT_CONTEXT(ctx);
2750 Node *n;
2751 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2752 n = alloc_instruction(ctx, OPCODE_LINE_STIPPLE, 2);
2753 if (n) {
2754 n[1].i = factor;
2755 n[2].us = pattern;
2756 }
2757 if (ctx->ExecuteFlag) {
2758 CALL_LineStipple(ctx->Dispatch.Exec, (factor, pattern));
2759 }
2760 }
2761
2762
2763 void GLAPIENTRY
save_LineWidth(GLfloat width)2764 save_LineWidth(GLfloat width)
2765 {
2766 GET_CURRENT_CONTEXT(ctx);
2767 Node *n;
2768 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2769 n = alloc_instruction(ctx, OPCODE_LINE_WIDTH, 1);
2770 if (n) {
2771 n[1].f = width;
2772 }
2773 if (ctx->ExecuteFlag) {
2774 CALL_LineWidth(ctx->Dispatch.Exec, (width));
2775 }
2776 }
2777
2778
2779 void GLAPIENTRY
save_ListBase(GLuint base)2780 save_ListBase(GLuint base)
2781 {
2782 GET_CURRENT_CONTEXT(ctx);
2783 Node *n;
2784 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2785 n = alloc_instruction(ctx, OPCODE_LIST_BASE, 1);
2786 if (n) {
2787 n[1].ui = base;
2788 }
2789 if (ctx->ExecuteFlag) {
2790 CALL_ListBase(ctx->Dispatch.Exec, (base));
2791 }
2792 }
2793
2794
2795 void GLAPIENTRY
save_LoadIdentity(void)2796 save_LoadIdentity(void)
2797 {
2798 GET_CURRENT_CONTEXT(ctx);
2799 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2800 (void) alloc_instruction(ctx, OPCODE_LOAD_IDENTITY, 0);
2801 if (ctx->ExecuteFlag) {
2802 CALL_LoadIdentity(ctx->Dispatch.Exec, ());
2803 }
2804 }
2805
2806
2807 void GLAPIENTRY
save_LoadMatrixf(const GLfloat * m)2808 save_LoadMatrixf(const GLfloat * m)
2809 {
2810 GET_CURRENT_CONTEXT(ctx);
2811 Node *n;
2812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2813 n = alloc_instruction(ctx, OPCODE_LOAD_MATRIX, 16);
2814 if (n) {
2815 GLuint i;
2816 for (i = 0; i < 16; i++) {
2817 n[1 + i].f = m[i];
2818 }
2819 }
2820 if (ctx->ExecuteFlag) {
2821 CALL_LoadMatrixf(ctx->Dispatch.Exec, (m));
2822 }
2823 }
2824
2825
2826 void GLAPIENTRY
save_LoadMatrixd(const GLdouble * m)2827 save_LoadMatrixd(const GLdouble * m)
2828 {
2829 GLfloat f[16];
2830 GLint i;
2831 for (i = 0; i < 16; i++) {
2832 f[i] = (GLfloat) m[i];
2833 }
2834 save_LoadMatrixf(f);
2835 }
2836
2837
2838 void GLAPIENTRY
save_LoadName(GLuint name)2839 save_LoadName(GLuint name)
2840 {
2841 GET_CURRENT_CONTEXT(ctx);
2842 Node *n;
2843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2844 n = alloc_instruction(ctx, OPCODE_LOAD_NAME, 1);
2845 if (n) {
2846 n[1].ui = name;
2847 }
2848 if (ctx->ExecuteFlag) {
2849 CALL_LoadName(ctx->Dispatch.Exec, (name));
2850 }
2851 }
2852
2853
2854 void GLAPIENTRY
save_LogicOp(GLenum opcode)2855 save_LogicOp(GLenum opcode)
2856 {
2857 GET_CURRENT_CONTEXT(ctx);
2858 Node *n;
2859 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2860 n = alloc_instruction(ctx, OPCODE_LOGIC_OP, 1);
2861 if (n) {
2862 n[1].e = opcode;
2863 }
2864 if (ctx->ExecuteFlag) {
2865 CALL_LogicOp(ctx->Dispatch.Exec, (opcode));
2866 }
2867 }
2868
2869
2870 void GLAPIENTRY
save_Map1d(GLenum target,GLdouble u1,GLdouble u2,GLint stride,GLint order,const GLdouble * points)2871 save_Map1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride,
2872 GLint order, const GLdouble * points)
2873 {
2874 GET_CURRENT_CONTEXT(ctx);
2875 Node *n;
2876 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2877 n = alloc_instruction(ctx, OPCODE_MAP1, 5 + POINTER_DWORDS);
2878 if (n) {
2879 GLfloat *pnts = _mesa_copy_map_points1d(target, stride, order, points);
2880 n[1].e = target;
2881 n[2].f = (GLfloat) u1;
2882 n[3].f = (GLfloat) u2;
2883 n[4].i = _mesa_evaluator_components(target); /* stride */
2884 n[5].i = order;
2885 save_pointer(&n[6], pnts);
2886 }
2887 if (ctx->ExecuteFlag) {
2888 CALL_Map1d(ctx->Dispatch.Exec, (target, u1, u2, stride, order, points));
2889 }
2890 }
2891
2892 void GLAPIENTRY
save_Map1f(GLenum target,GLfloat u1,GLfloat u2,GLint stride,GLint order,const GLfloat * points)2893 save_Map1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride,
2894 GLint order, const GLfloat * points)
2895 {
2896 GET_CURRENT_CONTEXT(ctx);
2897 Node *n;
2898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2899 n = alloc_instruction(ctx, OPCODE_MAP1, 5 + POINTER_DWORDS);
2900 if (n) {
2901 GLfloat *pnts = _mesa_copy_map_points1f(target, stride, order, points);
2902 n[1].e = target;
2903 n[2].f = u1;
2904 n[3].f = u2;
2905 n[4].i = _mesa_evaluator_components(target); /* stride */
2906 n[5].i = order;
2907 save_pointer(&n[6], pnts);
2908 }
2909 if (ctx->ExecuteFlag) {
2910 CALL_Map1f(ctx->Dispatch.Exec, (target, u1, u2, stride, order, points));
2911 }
2912 }
2913
2914
2915 void GLAPIENTRY
save_Map2d(GLenum target,GLdouble u1,GLdouble u2,GLint ustride,GLint uorder,GLdouble v1,GLdouble v2,GLint vstride,GLint vorder,const GLdouble * points)2916 save_Map2d(GLenum target,
2917 GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,
2918 GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,
2919 const GLdouble * points)
2920 {
2921 GET_CURRENT_CONTEXT(ctx);
2922 Node *n;
2923 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2924 n = alloc_instruction(ctx, OPCODE_MAP2, 9 + POINTER_DWORDS);
2925 if (n) {
2926 GLfloat *pnts = _mesa_copy_map_points2d(target, ustride, uorder,
2927 vstride, vorder, points);
2928 n[1].e = target;
2929 n[2].f = (GLfloat) u1;
2930 n[3].f = (GLfloat) u2;
2931 n[4].f = (GLfloat) v1;
2932 n[5].f = (GLfloat) v2;
2933 /* XXX verify these strides are correct */
2934 n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride */
2935 n[7].i = _mesa_evaluator_components(target); /*vstride */
2936 n[8].i = uorder;
2937 n[9].i = vorder;
2938 save_pointer(&n[10], pnts);
2939 }
2940 if (ctx->ExecuteFlag) {
2941 CALL_Map2d(ctx->Dispatch.Exec, (target,
2942 u1, u2, ustride, uorder,
2943 v1, v2, vstride, vorder, points));
2944 }
2945 }
2946
2947
2948 void GLAPIENTRY
save_Map2f(GLenum target,GLfloat u1,GLfloat u2,GLint ustride,GLint uorder,GLfloat v1,GLfloat v2,GLint vstride,GLint vorder,const GLfloat * points)2949 save_Map2f(GLenum target,
2950 GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,
2951 GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,
2952 const GLfloat * points)
2953 {
2954 GET_CURRENT_CONTEXT(ctx);
2955 Node *n;
2956 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2957 n = alloc_instruction(ctx, OPCODE_MAP2, 9 + POINTER_DWORDS);
2958 if (n) {
2959 GLfloat *pnts = _mesa_copy_map_points2f(target, ustride, uorder,
2960 vstride, vorder, points);
2961 n[1].e = target;
2962 n[2].f = u1;
2963 n[3].f = u2;
2964 n[4].f = v1;
2965 n[5].f = v2;
2966 /* XXX verify these strides are correct */
2967 n[6].i = _mesa_evaluator_components(target) * vorder; /*ustride */
2968 n[7].i = _mesa_evaluator_components(target); /*vstride */
2969 n[8].i = uorder;
2970 n[9].i = vorder;
2971 save_pointer(&n[10], pnts);
2972 }
2973 if (ctx->ExecuteFlag) {
2974 CALL_Map2f(ctx->Dispatch.Exec, (target, u1, u2, ustride, uorder,
2975 v1, v2, vstride, vorder, points));
2976 }
2977 }
2978
2979
2980 void GLAPIENTRY
save_MapGrid1f(GLint un,GLfloat u1,GLfloat u2)2981 save_MapGrid1f(GLint un, GLfloat u1, GLfloat u2)
2982 {
2983 GET_CURRENT_CONTEXT(ctx);
2984 Node *n;
2985 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
2986 n = alloc_instruction(ctx, OPCODE_MAPGRID1, 3);
2987 if (n) {
2988 n[1].i = un;
2989 n[2].f = u1;
2990 n[3].f = u2;
2991 }
2992 if (ctx->ExecuteFlag) {
2993 CALL_MapGrid1f(ctx->Dispatch.Exec, (un, u1, u2));
2994 }
2995 }
2996
2997
2998 void GLAPIENTRY
save_MapGrid1d(GLint un,GLdouble u1,GLdouble u2)2999 save_MapGrid1d(GLint un, GLdouble u1, GLdouble u2)
3000 {
3001 save_MapGrid1f(un, (GLfloat) u1, (GLfloat) u2);
3002 }
3003
3004
3005 void GLAPIENTRY
save_MapGrid2f(GLint un,GLfloat u1,GLfloat u2,GLint vn,GLfloat v1,GLfloat v2)3006 save_MapGrid2f(GLint un, GLfloat u1, GLfloat u2,
3007 GLint vn, GLfloat v1, GLfloat v2)
3008 {
3009 GET_CURRENT_CONTEXT(ctx);
3010 Node *n;
3011 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3012 n = alloc_instruction(ctx, OPCODE_MAPGRID2, 6);
3013 if (n) {
3014 n[1].i = un;
3015 n[2].f = u1;
3016 n[3].f = u2;
3017 n[4].i = vn;
3018 n[5].f = v1;
3019 n[6].f = v2;
3020 }
3021 if (ctx->ExecuteFlag) {
3022 CALL_MapGrid2f(ctx->Dispatch.Exec, (un, u1, u2, vn, v1, v2));
3023 }
3024 }
3025
3026
3027
3028 void GLAPIENTRY
save_MapGrid2d(GLint un,GLdouble u1,GLdouble u2,GLint vn,GLdouble v1,GLdouble v2)3029 save_MapGrid2d(GLint un, GLdouble u1, GLdouble u2,
3030 GLint vn, GLdouble v1, GLdouble v2)
3031 {
3032 save_MapGrid2f(un, (GLfloat) u1, (GLfloat) u2,
3033 vn, (GLfloat) v1, (GLfloat) v2);
3034 }
3035
3036
3037 void GLAPIENTRY
save_MatrixMode(GLenum mode)3038 save_MatrixMode(GLenum mode)
3039 {
3040 GET_CURRENT_CONTEXT(ctx);
3041 Node *n;
3042 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3043 n = alloc_instruction(ctx, OPCODE_MATRIX_MODE, 1);
3044 if (n) {
3045 n[1].e = mode;
3046 }
3047 if (ctx->ExecuteFlag) {
3048 CALL_MatrixMode(ctx->Dispatch.Exec, (mode));
3049 }
3050 }
3051
3052
3053 void GLAPIENTRY
save_MultMatrixf(const GLfloat * m)3054 save_MultMatrixf(const GLfloat * m)
3055 {
3056 GET_CURRENT_CONTEXT(ctx);
3057 Node *n;
3058 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3059 n = alloc_instruction(ctx, OPCODE_MULT_MATRIX, 16);
3060 if (n) {
3061 GLuint i;
3062 for (i = 0; i < 16; i++) {
3063 n[1 + i].f = m[i];
3064 }
3065 }
3066 if (ctx->ExecuteFlag) {
3067 CALL_MultMatrixf(ctx->Dispatch.Exec, (m));
3068 }
3069 }
3070
3071
3072 void GLAPIENTRY
save_MultMatrixd(const GLdouble * m)3073 save_MultMatrixd(const GLdouble * m)
3074 {
3075 GLfloat f[16];
3076 GLint i;
3077 for (i = 0; i < 16; i++) {
3078 f[i] = (GLfloat) m[i];
3079 }
3080 save_MultMatrixf(f);
3081 }
3082
3083
3084 void GLAPIENTRY
save_NewList(GLuint name,GLenum mode)3085 save_NewList(GLuint name, GLenum mode)
3086 {
3087 GET_CURRENT_CONTEXT(ctx);
3088 /* It's an error to call this function while building a display list */
3089 _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList");
3090 (void) name;
3091 (void) mode;
3092 }
3093
3094
3095
3096 void GLAPIENTRY
save_Ortho(GLdouble left,GLdouble right,GLdouble bottom,GLdouble top,GLdouble nearval,GLdouble farval)3097 save_Ortho(GLdouble left, GLdouble right,
3098 GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
3099 {
3100 GET_CURRENT_CONTEXT(ctx);
3101 Node *n;
3102 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3103 n = alloc_instruction(ctx, OPCODE_ORTHO, 6);
3104 if (n) {
3105 n[1].f = (GLfloat) left;
3106 n[2].f = (GLfloat) right;
3107 n[3].f = (GLfloat) bottom;
3108 n[4].f = (GLfloat) top;
3109 n[5].f = (GLfloat) nearval;
3110 n[6].f = (GLfloat) farval;
3111 }
3112 if (ctx->ExecuteFlag) {
3113 CALL_Ortho(ctx->Dispatch.Exec, (left, right, bottom, top, nearval, farval));
3114 }
3115 }
3116
3117
3118 void GLAPIENTRY
save_PatchParameteri(GLenum pname,const GLint value)3119 save_PatchParameteri(GLenum pname, const GLint value)
3120 {
3121 GET_CURRENT_CONTEXT(ctx);
3122 Node *n;
3123 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3124 n = alloc_instruction(ctx, OPCODE_PATCH_PARAMETER_I, 2);
3125 if (n) {
3126 n[1].e = pname;
3127 n[2].i = value;
3128 }
3129 if (ctx->ExecuteFlag) {
3130 CALL_PatchParameteri(ctx->Dispatch.Exec, (pname, value));
3131 }
3132 }
3133
3134
3135 void GLAPIENTRY
save_PatchParameterfv(GLenum pname,const GLfloat * params)3136 save_PatchParameterfv(GLenum pname, const GLfloat *params)
3137 {
3138 GET_CURRENT_CONTEXT(ctx);
3139 Node *n;
3140 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3141
3142 if (pname == GL_PATCH_DEFAULT_OUTER_LEVEL) {
3143 n = alloc_instruction(ctx, OPCODE_PATCH_PARAMETER_FV_OUTER, 5);
3144 } else {
3145 assert(pname == GL_PATCH_DEFAULT_INNER_LEVEL);
3146 n = alloc_instruction(ctx, OPCODE_PATCH_PARAMETER_FV_INNER, 3);
3147 }
3148 if (n) {
3149 n[1].e = pname;
3150 if (pname == GL_PATCH_DEFAULT_OUTER_LEVEL) {
3151 n[2].f = params[0];
3152 n[3].f = params[1];
3153 n[4].f = params[2];
3154 n[5].f = params[3];
3155 } else {
3156 n[2].f = params[0];
3157 n[3].f = params[1];
3158 }
3159 }
3160 if (ctx->ExecuteFlag) {
3161 CALL_PatchParameterfv(ctx->Dispatch.Exec, (pname, params));
3162 }
3163 }
3164
3165
3166 void GLAPIENTRY
save_PixelMapfv(GLenum map,GLint mapsize,const GLfloat * values)3167 save_PixelMapfv(GLenum map, GLint mapsize, const GLfloat *values)
3168 {
3169 GET_CURRENT_CONTEXT(ctx);
3170 Node *n;
3171 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3172 n = alloc_instruction(ctx, OPCODE_PIXEL_MAP, 2 + POINTER_DWORDS);
3173 if (n) {
3174 n[1].e = map;
3175 n[2].i = mapsize;
3176 save_pointer(&n[3], memdup(values, mapsize * sizeof(GLfloat)));
3177 }
3178 if (ctx->ExecuteFlag) {
3179 CALL_PixelMapfv(ctx->Dispatch.Exec, (map, mapsize, values));
3180 }
3181 }
3182
3183
3184 void GLAPIENTRY
save_PixelMapuiv(GLenum map,GLint mapsize,const GLuint * values)3185 save_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values)
3186 {
3187 GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
3188 GLint i;
3189 if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) {
3190 for (i = 0; i < mapsize; i++) {
3191 fvalues[i] = (GLfloat) values[i];
3192 }
3193 }
3194 else {
3195 for (i = 0; i < mapsize; i++) {
3196 fvalues[i] = UINT_TO_FLOAT(values[i]);
3197 }
3198 }
3199 save_PixelMapfv(map, mapsize, fvalues);
3200 }
3201
3202
3203 void GLAPIENTRY
save_PixelMapusv(GLenum map,GLint mapsize,const GLushort * values)3204 save_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values)
3205 {
3206 GLfloat fvalues[MAX_PIXEL_MAP_TABLE];
3207 GLint i;
3208 if (map == GL_PIXEL_MAP_I_TO_I || map == GL_PIXEL_MAP_S_TO_S) {
3209 for (i = 0; i < mapsize; i++) {
3210 fvalues[i] = (GLfloat) values[i];
3211 }
3212 }
3213 else {
3214 for (i = 0; i < mapsize; i++) {
3215 fvalues[i] = USHORT_TO_FLOAT(values[i]);
3216 }
3217 }
3218 save_PixelMapfv(map, mapsize, fvalues);
3219 }
3220
3221
3222 void GLAPIENTRY
save_PixelTransferf(GLenum pname,GLfloat param)3223 save_PixelTransferf(GLenum pname, GLfloat param)
3224 {
3225 GET_CURRENT_CONTEXT(ctx);
3226 Node *n;
3227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3228 n = alloc_instruction(ctx, OPCODE_PIXEL_TRANSFER, 2);
3229 if (n) {
3230 n[1].e = pname;
3231 n[2].f = param;
3232 }
3233 if (ctx->ExecuteFlag) {
3234 CALL_PixelTransferf(ctx->Dispatch.Exec, (pname, param));
3235 }
3236 }
3237
3238
3239 void GLAPIENTRY
save_PixelTransferi(GLenum pname,GLint param)3240 save_PixelTransferi(GLenum pname, GLint param)
3241 {
3242 save_PixelTransferf(pname, (GLfloat) param);
3243 }
3244
3245
3246 void GLAPIENTRY
save_PixelZoom(GLfloat xfactor,GLfloat yfactor)3247 save_PixelZoom(GLfloat xfactor, GLfloat yfactor)
3248 {
3249 GET_CURRENT_CONTEXT(ctx);
3250 Node *n;
3251 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3252 n = alloc_instruction(ctx, OPCODE_PIXEL_ZOOM, 2);
3253 if (n) {
3254 n[1].f = xfactor;
3255 n[2].f = yfactor;
3256 }
3257 if (ctx->ExecuteFlag) {
3258 CALL_PixelZoom(ctx->Dispatch.Exec, (xfactor, yfactor));
3259 }
3260 }
3261
3262
3263 void GLAPIENTRY
save_PointParameterfv(GLenum pname,const GLfloat * params)3264 save_PointParameterfv(GLenum pname, const GLfloat *params)
3265 {
3266 GET_CURRENT_CONTEXT(ctx);
3267 Node *n;
3268 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3269 n = alloc_instruction(ctx, OPCODE_POINT_PARAMETERS, 4);
3270 if (n) {
3271 n[1].e = pname;
3272 n[2].f = params[0];
3273 n[3].f = params[1];
3274 n[4].f = params[2];
3275 }
3276 if (ctx->ExecuteFlag) {
3277 CALL_PointParameterfv(ctx->Dispatch.Exec, (pname, params));
3278 }
3279 }
3280
3281
3282 void GLAPIENTRY
save_PointParameterf(GLenum pname,GLfloat param)3283 save_PointParameterf(GLenum pname, GLfloat param)
3284 {
3285 GLfloat parray[3];
3286 parray[0] = param;
3287 parray[1] = parray[2] = 0.0F;
3288 save_PointParameterfv(pname, parray);
3289 }
3290
3291 void GLAPIENTRY
save_PointParameteri(GLenum pname,GLint param)3292 save_PointParameteri(GLenum pname, GLint param)
3293 {
3294 GLfloat parray[3];
3295 parray[0] = (GLfloat) param;
3296 parray[1] = parray[2] = 0.0F;
3297 save_PointParameterfv(pname, parray);
3298 }
3299
3300 void GLAPIENTRY
save_PointParameteriv(GLenum pname,const GLint * param)3301 save_PointParameteriv(GLenum pname, const GLint * param)
3302 {
3303 GLfloat parray[3];
3304 parray[0] = (GLfloat) param[0];
3305 parray[1] = parray[2] = 0.0F;
3306 save_PointParameterfv(pname, parray);
3307 }
3308
3309
3310 void GLAPIENTRY
save_PointSize(GLfloat size)3311 save_PointSize(GLfloat size)
3312 {
3313 GET_CURRENT_CONTEXT(ctx);
3314 Node *n;
3315 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3316 n = alloc_instruction(ctx, OPCODE_POINT_SIZE, 1);
3317 if (n) {
3318 n[1].f = size;
3319 }
3320 if (ctx->ExecuteFlag) {
3321 CALL_PointSize(ctx->Dispatch.Exec, (size));
3322 }
3323 }
3324
3325
3326 void GLAPIENTRY
save_PolygonMode(GLenum face,GLenum mode)3327 save_PolygonMode(GLenum face, GLenum mode)
3328 {
3329 GET_CURRENT_CONTEXT(ctx);
3330 Node *n;
3331 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3332 n = alloc_instruction(ctx, OPCODE_POLYGON_MODE, 2);
3333 if (n) {
3334 n[1].e = face;
3335 n[2].e = mode;
3336 }
3337 if (ctx->ExecuteFlag) {
3338 CALL_PolygonMode(ctx->Dispatch.Exec, (face, mode));
3339 }
3340 }
3341
3342
3343 void GLAPIENTRY
save_PolygonStipple(const GLubyte * pattern)3344 save_PolygonStipple(const GLubyte * pattern)
3345 {
3346 GET_CURRENT_CONTEXT(ctx);
3347 Node *n;
3348
3349 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3350
3351 n = alloc_instruction(ctx, OPCODE_POLYGON_STIPPLE, POINTER_DWORDS);
3352 if (n) {
3353 save_pointer(&n[1],
3354 unpack_image(ctx, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP,
3355 pattern, &ctx->Unpack));
3356 }
3357 if (ctx->ExecuteFlag) {
3358 CALL_PolygonStipple(ctx->Dispatch.Exec, ((GLubyte *) pattern));
3359 }
3360 }
3361
3362
3363 void GLAPIENTRY
save_PolygonOffset(GLfloat factor,GLfloat units)3364 save_PolygonOffset(GLfloat factor, GLfloat units)
3365 {
3366 GET_CURRENT_CONTEXT(ctx);
3367 Node *n;
3368 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3369 n = alloc_instruction(ctx, OPCODE_POLYGON_OFFSET, 2);
3370 if (n) {
3371 n[1].f = factor;
3372 n[2].f = units;
3373 }
3374 if (ctx->ExecuteFlag) {
3375 CALL_PolygonOffset(ctx->Dispatch.Exec, (factor, units));
3376 }
3377 }
3378
3379
3380 void GLAPIENTRY
save_PolygonOffsetClampEXT(GLfloat factor,GLfloat units,GLfloat clamp)3381 save_PolygonOffsetClampEXT(GLfloat factor, GLfloat units, GLfloat clamp)
3382 {
3383 GET_CURRENT_CONTEXT(ctx);
3384 Node *n;
3385 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3386 n = alloc_instruction(ctx, OPCODE_POLYGON_OFFSET_CLAMP, 3);
3387 if (n) {
3388 n[1].f = factor;
3389 n[2].f = units;
3390 n[3].f = clamp;
3391 }
3392 if (ctx->ExecuteFlag) {
3393 CALL_PolygonOffsetClampEXT(ctx->Dispatch.Exec, (factor, units, clamp));
3394 }
3395 }
3396
3397 void GLAPIENTRY
save_PopAttrib(void)3398 save_PopAttrib(void)
3399 {
3400 GET_CURRENT_CONTEXT(ctx);
3401 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3402 (void) alloc_instruction(ctx, OPCODE_POP_ATTRIB, 0);
3403 if (ctx->ExecuteFlag) {
3404 CALL_PopAttrib(ctx->Dispatch.Exec, ());
3405 }
3406 }
3407
3408
3409 void GLAPIENTRY
save_PopMatrix(void)3410 save_PopMatrix(void)
3411 {
3412 GET_CURRENT_CONTEXT(ctx);
3413 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3414 (void) alloc_instruction(ctx, OPCODE_POP_MATRIX, 0);
3415 if (ctx->ExecuteFlag) {
3416 CALL_PopMatrix(ctx->Dispatch.Exec, ());
3417 }
3418 }
3419
3420
3421 void GLAPIENTRY
save_PopName(void)3422 save_PopName(void)
3423 {
3424 GET_CURRENT_CONTEXT(ctx);
3425 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3426 (void) alloc_instruction(ctx, OPCODE_POP_NAME, 0);
3427 if (ctx->ExecuteFlag) {
3428 CALL_PopName(ctx->Dispatch.Exec, ());
3429 }
3430 }
3431
3432
3433 void GLAPIENTRY
save_PrioritizeTextures(GLsizei num,const GLuint * textures,const GLclampf * priorities)3434 save_PrioritizeTextures(GLsizei num, const GLuint * textures,
3435 const GLclampf * priorities)
3436 {
3437 GET_CURRENT_CONTEXT(ctx);
3438 GLint i;
3439 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3440
3441 for (i = 0; i < num; i++) {
3442 Node *n;
3443 n = alloc_instruction(ctx, OPCODE_PRIORITIZE_TEXTURE, 2);
3444 if (n) {
3445 n[1].ui = textures[i];
3446 n[2].f = priorities[i];
3447 }
3448 }
3449 if (ctx->ExecuteFlag) {
3450 CALL_PrioritizeTextures(ctx->Dispatch.Exec, (num, textures, priorities));
3451 }
3452 }
3453
3454
3455 void GLAPIENTRY
save_PushAttrib(GLbitfield mask)3456 save_PushAttrib(GLbitfield mask)
3457 {
3458 GET_CURRENT_CONTEXT(ctx);
3459 Node *n;
3460 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3461 n = alloc_instruction(ctx, OPCODE_PUSH_ATTRIB, 1);
3462 if (n) {
3463 n[1].bf = mask;
3464 }
3465 if (ctx->ExecuteFlag) {
3466 CALL_PushAttrib(ctx->Dispatch.Exec, (mask));
3467 }
3468 }
3469
3470
3471 void GLAPIENTRY
save_PushMatrix(void)3472 save_PushMatrix(void)
3473 {
3474 GET_CURRENT_CONTEXT(ctx);
3475 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3476 (void) alloc_instruction(ctx, OPCODE_PUSH_MATRIX, 0);
3477 if (ctx->ExecuteFlag) {
3478 CALL_PushMatrix(ctx->Dispatch.Exec, ());
3479 }
3480 }
3481
3482
3483 void GLAPIENTRY
save_PushName(GLuint name)3484 save_PushName(GLuint name)
3485 {
3486 GET_CURRENT_CONTEXT(ctx);
3487 Node *n;
3488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3489 n = alloc_instruction(ctx, OPCODE_PUSH_NAME, 1);
3490 if (n) {
3491 n[1].ui = name;
3492 }
3493 if (ctx->ExecuteFlag) {
3494 CALL_PushName(ctx->Dispatch.Exec, (name));
3495 }
3496 }
3497
3498
3499 void GLAPIENTRY
save_RasterPos4f(GLfloat x,GLfloat y,GLfloat z,GLfloat w)3500 save_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
3501 {
3502 GET_CURRENT_CONTEXT(ctx);
3503 Node *n;
3504 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3505 n = alloc_instruction(ctx, OPCODE_RASTER_POS, 4);
3506 if (n) {
3507 n[1].f = x;
3508 n[2].f = y;
3509 n[3].f = z;
3510 n[4].f = w;
3511 }
3512 if (ctx->ExecuteFlag) {
3513 CALL_RasterPos4f(ctx->Dispatch.Exec, (x, y, z, w));
3514 }
3515 }
3516
3517 void GLAPIENTRY
save_RasterPos2d(GLdouble x,GLdouble y)3518 save_RasterPos2d(GLdouble x, GLdouble y)
3519 {
3520 save_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
3521 }
3522
3523 void GLAPIENTRY
save_RasterPos2f(GLfloat x,GLfloat y)3524 save_RasterPos2f(GLfloat x, GLfloat y)
3525 {
3526 save_RasterPos4f(x, y, 0.0F, 1.0F);
3527 }
3528
3529 void GLAPIENTRY
save_RasterPos2i(GLint x,GLint y)3530 save_RasterPos2i(GLint x, GLint y)
3531 {
3532 save_RasterPos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
3533 }
3534
3535 void GLAPIENTRY
save_RasterPos2s(GLshort x,GLshort y)3536 save_RasterPos2s(GLshort x, GLshort y)
3537 {
3538 save_RasterPos4f(x, y, 0.0F, 1.0F);
3539 }
3540
3541 void GLAPIENTRY
save_RasterPos3d(GLdouble x,GLdouble y,GLdouble z)3542 save_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
3543 {
3544 save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
3545 }
3546
3547 void GLAPIENTRY
save_RasterPos3f(GLfloat x,GLfloat y,GLfloat z)3548 save_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
3549 {
3550 save_RasterPos4f(x, y, z, 1.0F);
3551 }
3552
3553 void GLAPIENTRY
save_RasterPos3i(GLint x,GLint y,GLint z)3554 save_RasterPos3i(GLint x, GLint y, GLint z)
3555 {
3556 save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
3557 }
3558
3559 void GLAPIENTRY
save_RasterPos3s(GLshort x,GLshort y,GLshort z)3560 save_RasterPos3s(GLshort x, GLshort y, GLshort z)
3561 {
3562 save_RasterPos4f(x, y, z, 1.0F);
3563 }
3564
3565 void GLAPIENTRY
save_RasterPos4d(GLdouble x,GLdouble y,GLdouble z,GLdouble w)3566 save_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
3567 {
3568 save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
3569 }
3570
3571 void GLAPIENTRY
save_RasterPos4i(GLint x,GLint y,GLint z,GLint w)3572 save_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
3573 {
3574 save_RasterPos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
3575 }
3576
3577 void GLAPIENTRY
save_RasterPos4s(GLshort x,GLshort y,GLshort z,GLshort w)3578 save_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
3579 {
3580 save_RasterPos4f(x, y, z, w);
3581 }
3582
3583 void GLAPIENTRY
save_RasterPos2dv(const GLdouble * v)3584 save_RasterPos2dv(const GLdouble * v)
3585 {
3586 save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
3587 }
3588
3589 void GLAPIENTRY
save_RasterPos2fv(const GLfloat * v)3590 save_RasterPos2fv(const GLfloat * v)
3591 {
3592 save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
3593 }
3594
3595 void GLAPIENTRY
save_RasterPos2iv(const GLint * v)3596 save_RasterPos2iv(const GLint * v)
3597 {
3598 save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
3599 }
3600
3601 void GLAPIENTRY
save_RasterPos2sv(const GLshort * v)3602 save_RasterPos2sv(const GLshort * v)
3603 {
3604 save_RasterPos4f(v[0], v[1], 0.0F, 1.0F);
3605 }
3606
3607 void GLAPIENTRY
save_RasterPos3dv(const GLdouble * v)3608 save_RasterPos3dv(const GLdouble * v)
3609 {
3610 save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
3611 }
3612
3613 void GLAPIENTRY
save_RasterPos3fv(const GLfloat * v)3614 save_RasterPos3fv(const GLfloat * v)
3615 {
3616 save_RasterPos4f(v[0], v[1], v[2], 1.0F);
3617 }
3618
3619 void GLAPIENTRY
save_RasterPos3iv(const GLint * v)3620 save_RasterPos3iv(const GLint * v)
3621 {
3622 save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
3623 }
3624
3625 void GLAPIENTRY
save_RasterPos3sv(const GLshort * v)3626 save_RasterPos3sv(const GLshort * v)
3627 {
3628 save_RasterPos4f(v[0], v[1], v[2], 1.0F);
3629 }
3630
3631 void GLAPIENTRY
save_RasterPos4dv(const GLdouble * v)3632 save_RasterPos4dv(const GLdouble * v)
3633 {
3634 save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
3635 (GLfloat) v[2], (GLfloat) v[3]);
3636 }
3637
3638 void GLAPIENTRY
save_RasterPos4fv(const GLfloat * v)3639 save_RasterPos4fv(const GLfloat * v)
3640 {
3641 save_RasterPos4f(v[0], v[1], v[2], v[3]);
3642 }
3643
3644 void GLAPIENTRY
save_RasterPos4iv(const GLint * v)3645 save_RasterPos4iv(const GLint * v)
3646 {
3647 save_RasterPos4f((GLfloat) v[0], (GLfloat) v[1],
3648 (GLfloat) v[2], (GLfloat) v[3]);
3649 }
3650
3651 void GLAPIENTRY
save_RasterPos4sv(const GLshort * v)3652 save_RasterPos4sv(const GLshort * v)
3653 {
3654 save_RasterPos4f(v[0], v[1], v[2], v[3]);
3655 }
3656
3657
3658 void GLAPIENTRY
save_PassThrough(GLfloat token)3659 save_PassThrough(GLfloat token)
3660 {
3661 GET_CURRENT_CONTEXT(ctx);
3662 Node *n;
3663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3664 n = alloc_instruction(ctx, OPCODE_PASSTHROUGH, 1);
3665 if (n) {
3666 n[1].f = token;
3667 }
3668 if (ctx->ExecuteFlag) {
3669 CALL_PassThrough(ctx->Dispatch.Exec, (token));
3670 }
3671 }
3672
3673
3674 void GLAPIENTRY
save_ReadBuffer(GLenum mode)3675 save_ReadBuffer(GLenum mode)
3676 {
3677 GET_CURRENT_CONTEXT(ctx);
3678 Node *n;
3679 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3680 n = alloc_instruction(ctx, OPCODE_READ_BUFFER, 1);
3681 if (n) {
3682 n[1].e = mode;
3683 }
3684 if (ctx->ExecuteFlag) {
3685 CALL_ReadBuffer(ctx->Dispatch.Exec, (mode));
3686 }
3687 }
3688
3689
3690 void GLAPIENTRY
save_Rotatef(GLfloat angle,GLfloat x,GLfloat y,GLfloat z)3691 save_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
3692 {
3693 GET_CURRENT_CONTEXT(ctx);
3694 Node *n;
3695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3696 n = alloc_instruction(ctx, OPCODE_ROTATE, 4);
3697 if (n) {
3698 n[1].f = angle;
3699 n[2].f = x;
3700 n[3].f = y;
3701 n[4].f = z;
3702 }
3703 if (ctx->ExecuteFlag) {
3704 CALL_Rotatef(ctx->Dispatch.Exec, (angle, x, y, z));
3705 }
3706 }
3707
3708
3709 void GLAPIENTRY
save_Rotated(GLdouble angle,GLdouble x,GLdouble y,GLdouble z)3710 save_Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
3711 {
3712 save_Rotatef((GLfloat) angle, (GLfloat) x, (GLfloat) y, (GLfloat) z);
3713 }
3714
3715
3716 void GLAPIENTRY
save_Scalef(GLfloat x,GLfloat y,GLfloat z)3717 save_Scalef(GLfloat x, GLfloat y, GLfloat z)
3718 {
3719 GET_CURRENT_CONTEXT(ctx);
3720 Node *n;
3721 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3722 n = alloc_instruction(ctx, OPCODE_SCALE, 3);
3723 if (n) {
3724 n[1].f = x;
3725 n[2].f = y;
3726 n[3].f = z;
3727 }
3728 if (ctx->ExecuteFlag) {
3729 CALL_Scalef(ctx->Dispatch.Exec, (x, y, z));
3730 }
3731 }
3732
3733
3734 void GLAPIENTRY
save_Scaled(GLdouble x,GLdouble y,GLdouble z)3735 save_Scaled(GLdouble x, GLdouble y, GLdouble z)
3736 {
3737 save_Scalef((GLfloat) x, (GLfloat) y, (GLfloat) z);
3738 }
3739
3740
3741 void GLAPIENTRY
save_Scissor(GLint x,GLint y,GLsizei width,GLsizei height)3742 save_Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
3743 {
3744 GET_CURRENT_CONTEXT(ctx);
3745 Node *n;
3746 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3747 n = alloc_instruction(ctx, OPCODE_SCISSOR, 4);
3748 if (n) {
3749 n[1].i = x;
3750 n[2].i = y;
3751 n[3].i = width;
3752 n[4].i = height;
3753 }
3754 if (ctx->ExecuteFlag) {
3755 CALL_Scissor(ctx->Dispatch.Exec, (x, y, width, height));
3756 }
3757 }
3758
3759
3760 void GLAPIENTRY
save_ShadeModel(GLenum mode)3761 save_ShadeModel(GLenum mode)
3762 {
3763 GET_CURRENT_CONTEXT(ctx);
3764 Node *n;
3765 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx);
3766
3767 if (ctx->ExecuteFlag) {
3768 CALL_ShadeModel(ctx->Dispatch.Exec, (mode));
3769 }
3770
3771 /* Don't compile this call if it's a no-op.
3772 * By avoiding this state change we have a better chance of
3773 * coalescing subsequent drawing commands into one batch.
3774 */
3775 if (ctx->ListState.Current.ShadeModel == mode)
3776 return;
3777
3778 SAVE_FLUSH_VERTICES(ctx);
3779
3780 ctx->ListState.Current.ShadeModel = mode;
3781
3782 n = alloc_instruction(ctx, OPCODE_SHADE_MODEL, 1);
3783 if (n) {
3784 n[1].e = mode;
3785 }
3786 }
3787
3788
3789 void GLAPIENTRY
save_StencilFunc(GLenum func,GLint ref,GLuint mask)3790 save_StencilFunc(GLenum func, GLint ref, GLuint mask)
3791 {
3792 GET_CURRENT_CONTEXT(ctx);
3793 Node *n;
3794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3795 n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC, 3);
3796 if (n) {
3797 n[1].e = func;
3798 n[2].i = ref;
3799 n[3].ui = mask;
3800 }
3801 if (ctx->ExecuteFlag) {
3802 CALL_StencilFunc(ctx->Dispatch.Exec, (func, ref, mask));
3803 }
3804 }
3805
3806
3807 void GLAPIENTRY
save_StencilMask(GLuint mask)3808 save_StencilMask(GLuint mask)
3809 {
3810 GET_CURRENT_CONTEXT(ctx);
3811 Node *n;
3812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3813 n = alloc_instruction(ctx, OPCODE_STENCIL_MASK, 1);
3814 if (n) {
3815 n[1].ui = mask;
3816 }
3817 if (ctx->ExecuteFlag) {
3818 CALL_StencilMask(ctx->Dispatch.Exec, (mask));
3819 }
3820 }
3821
3822
3823 void GLAPIENTRY
save_StencilOp(GLenum fail,GLenum zfail,GLenum zpass)3824 save_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
3825 {
3826 GET_CURRENT_CONTEXT(ctx);
3827 Node *n;
3828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3829 n = alloc_instruction(ctx, OPCODE_STENCIL_OP, 3);
3830 if (n) {
3831 n[1].e = fail;
3832 n[2].e = zfail;
3833 n[3].e = zpass;
3834 }
3835 if (ctx->ExecuteFlag) {
3836 CALL_StencilOp(ctx->Dispatch.Exec, (fail, zfail, zpass));
3837 }
3838 }
3839
3840
3841 void GLAPIENTRY
save_StencilFuncSeparate(GLenum face,GLenum func,GLint ref,GLuint mask)3842 save_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
3843 {
3844 GET_CURRENT_CONTEXT(ctx);
3845 Node *n;
3846 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3847 n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
3848 if (n) {
3849 n[1].e = face;
3850 n[2].e = func;
3851 n[3].i = ref;
3852 n[4].ui = mask;
3853 }
3854 if (ctx->ExecuteFlag) {
3855 CALL_StencilFuncSeparate(ctx->Dispatch.Exec, (face, func, ref, mask));
3856 }
3857 }
3858
3859
3860 void GLAPIENTRY
save_StencilFuncSeparateATI(GLenum frontfunc,GLenum backfunc,GLint ref,GLuint mask)3861 save_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref,
3862 GLuint mask)
3863 {
3864 GET_CURRENT_CONTEXT(ctx);
3865 Node *n;
3866 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3867 /* GL_FRONT */
3868 n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
3869 if (n) {
3870 n[1].e = GL_FRONT;
3871 n[2].e = frontfunc;
3872 n[3].i = ref;
3873 n[4].ui = mask;
3874 }
3875 /* GL_BACK */
3876 n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4);
3877 if (n) {
3878 n[1].e = GL_BACK;
3879 n[2].e = backfunc;
3880 n[3].i = ref;
3881 n[4].ui = mask;
3882 }
3883 if (ctx->ExecuteFlag) {
3884 CALL_StencilFuncSeparate(ctx->Dispatch.Exec, (GL_FRONT, frontfunc, ref, mask));
3885 CALL_StencilFuncSeparate(ctx->Dispatch.Exec, (GL_BACK, backfunc, ref, mask));
3886 }
3887 }
3888
3889
3890 void GLAPIENTRY
save_StencilMaskSeparate(GLenum face,GLuint mask)3891 save_StencilMaskSeparate(GLenum face, GLuint mask)
3892 {
3893 GET_CURRENT_CONTEXT(ctx);
3894 Node *n;
3895 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3896 n = alloc_instruction(ctx, OPCODE_STENCIL_MASK_SEPARATE, 2);
3897 if (n) {
3898 n[1].e = face;
3899 n[2].ui = mask;
3900 }
3901 if (ctx->ExecuteFlag) {
3902 CALL_StencilMaskSeparate(ctx->Dispatch.Exec, (face, mask));
3903 }
3904 }
3905
3906
3907 void GLAPIENTRY
save_StencilOpSeparate(GLenum face,GLenum fail,GLenum zfail,GLenum zpass)3908 save_StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
3909 {
3910 GET_CURRENT_CONTEXT(ctx);
3911 Node *n;
3912 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3913 n = alloc_instruction(ctx, OPCODE_STENCIL_OP_SEPARATE, 4);
3914 if (n) {
3915 n[1].e = face;
3916 n[2].e = fail;
3917 n[3].e = zfail;
3918 n[4].e = zpass;
3919 }
3920 if (ctx->ExecuteFlag) {
3921 CALL_StencilOpSeparate(ctx->Dispatch.Exec, (face, fail, zfail, zpass));
3922 }
3923 }
3924
3925
3926 void GLAPIENTRY
save_TexEnvfv(GLenum target,GLenum pname,const GLfloat * params)3927 save_TexEnvfv(GLenum target, GLenum pname, const GLfloat *params)
3928 {
3929 GET_CURRENT_CONTEXT(ctx);
3930 Node *n;
3931 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3932 n = alloc_instruction(ctx, OPCODE_TEXENV, 6);
3933 if (n) {
3934 n[1].e = target;
3935 n[2].e = pname;
3936 if (pname == GL_TEXTURE_ENV_COLOR) {
3937 n[3].f = params[0];
3938 n[4].f = params[1];
3939 n[5].f = params[2];
3940 n[6].f = params[3];
3941 }
3942 else {
3943 n[3].f = params[0];
3944 n[4].f = n[5].f = n[6].f = 0.0F;
3945 }
3946 }
3947 if (ctx->ExecuteFlag) {
3948 CALL_TexEnvfv(ctx->Dispatch.Exec, (target, pname, params));
3949 }
3950 }
3951
3952
3953 void GLAPIENTRY
save_TexEnvf(GLenum target,GLenum pname,GLfloat param)3954 save_TexEnvf(GLenum target, GLenum pname, GLfloat param)
3955 {
3956 GLfloat parray[4];
3957 parray[0] = (GLfloat) param;
3958 parray[1] = parray[2] = parray[3] = 0.0F;
3959 save_TexEnvfv(target, pname, parray);
3960 }
3961
3962
3963 void GLAPIENTRY
save_TexEnvi(GLenum target,GLenum pname,GLint param)3964 save_TexEnvi(GLenum target, GLenum pname, GLint param)
3965 {
3966 GLfloat p[4];
3967 p[0] = (GLfloat) param;
3968 p[1] = p[2] = p[3] = 0.0F;
3969 save_TexEnvfv(target, pname, p);
3970 }
3971
3972
3973 void GLAPIENTRY
save_TexEnviv(GLenum target,GLenum pname,const GLint * param)3974 save_TexEnviv(GLenum target, GLenum pname, const GLint * param)
3975 {
3976 GLfloat p[4];
3977 if (pname == GL_TEXTURE_ENV_COLOR) {
3978 p[0] = INT_TO_FLOAT(param[0]);
3979 p[1] = INT_TO_FLOAT(param[1]);
3980 p[2] = INT_TO_FLOAT(param[2]);
3981 p[3] = INT_TO_FLOAT(param[3]);
3982 }
3983 else {
3984 p[0] = (GLfloat) param[0];
3985 p[1] = p[2] = p[3] = 0.0F;
3986 }
3987 save_TexEnvfv(target, pname, p);
3988 }
3989
3990
3991 void GLAPIENTRY
save_TexGenfv(GLenum coord,GLenum pname,const GLfloat * params)3992 save_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params)
3993 {
3994 GET_CURRENT_CONTEXT(ctx);
3995 Node *n;
3996 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
3997 n = alloc_instruction(ctx, OPCODE_TEXGEN, 6);
3998 if (n) {
3999 n[1].e = coord;
4000 n[2].e = pname;
4001 n[3].f = params[0];
4002 n[4].f = params[1];
4003 n[5].f = params[2];
4004 n[6].f = params[3];
4005 }
4006 if (ctx->ExecuteFlag) {
4007 CALL_TexGenfv(ctx->Dispatch.Exec, (coord, pname, params));
4008 }
4009 }
4010
4011
4012 void GLAPIENTRY
save_TexGeniv(GLenum coord,GLenum pname,const GLint * params)4013 save_TexGeniv(GLenum coord, GLenum pname, const GLint *params)
4014 {
4015 GLfloat p[4];
4016 p[0] = (GLfloat) params[0];
4017 p[1] = (GLfloat) params[1];
4018 p[2] = (GLfloat) params[2];
4019 p[3] = (GLfloat) params[3];
4020 save_TexGenfv(coord, pname, p);
4021 }
4022
4023
4024 void GLAPIENTRY
save_TexGend(GLenum coord,GLenum pname,GLdouble param)4025 save_TexGend(GLenum coord, GLenum pname, GLdouble param)
4026 {
4027 GLfloat parray[4];
4028 parray[0] = (GLfloat) param;
4029 parray[1] = parray[2] = parray[3] = 0.0F;
4030 save_TexGenfv(coord, pname, parray);
4031 }
4032
4033
4034 void GLAPIENTRY
save_TexGendv(GLenum coord,GLenum pname,const GLdouble * params)4035 save_TexGendv(GLenum coord, GLenum pname, const GLdouble *params)
4036 {
4037 GLfloat p[4];
4038 p[0] = (GLfloat) params[0];
4039 p[1] = (GLfloat) params[1];
4040 p[2] = (GLfloat) params[2];
4041 p[3] = (GLfloat) params[3];
4042 save_TexGenfv(coord, pname, p);
4043 }
4044
4045
4046 void GLAPIENTRY
save_TexGenf(GLenum coord,GLenum pname,GLfloat param)4047 save_TexGenf(GLenum coord, GLenum pname, GLfloat param)
4048 {
4049 GLfloat parray[4];
4050 parray[0] = param;
4051 parray[1] = parray[2] = parray[3] = 0.0F;
4052 save_TexGenfv(coord, pname, parray);
4053 }
4054
4055
4056 void GLAPIENTRY
save_TexGeni(GLenum coord,GLenum pname,GLint param)4057 save_TexGeni(GLenum coord, GLenum pname, GLint param)
4058 {
4059 GLint parray[4];
4060 parray[0] = param;
4061 parray[1] = parray[2] = parray[3] = 0;
4062 save_TexGeniv(coord, pname, parray);
4063 }
4064
4065
4066 void GLAPIENTRY
save_TexParameterfv(GLenum target,GLenum pname,const GLfloat * params)4067 save_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params)
4068 {
4069 GET_CURRENT_CONTEXT(ctx);
4070 Node *n;
4071 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4072 n = alloc_instruction(ctx, OPCODE_TEXPARAMETER, 6);
4073 if (n) {
4074 n[1].e = target;
4075 n[2].e = pname;
4076 n[3].f = params[0];
4077 n[4].f = params[1];
4078 n[5].f = params[2];
4079 n[6].f = params[3];
4080 }
4081 if (ctx->ExecuteFlag) {
4082 CALL_TexParameterfv(ctx->Dispatch.Exec, (target, pname, params));
4083 }
4084 }
4085
4086
4087 void GLAPIENTRY
save_TexParameterf(GLenum target,GLenum pname,GLfloat param)4088 save_TexParameterf(GLenum target, GLenum pname, GLfloat param)
4089 {
4090 GLfloat parray[4];
4091 parray[0] = param;
4092 parray[1] = parray[2] = parray[3] = 0.0F;
4093 save_TexParameterfv(target, pname, parray);
4094 }
4095
4096
4097 void GLAPIENTRY
save_TexParameteri(GLenum target,GLenum pname,GLint param)4098 save_TexParameteri(GLenum target, GLenum pname, GLint param)
4099 {
4100 GLfloat fparam[4];
4101 fparam[0] = (GLfloat) param;
4102 fparam[1] = fparam[2] = fparam[3] = 0.0F;
4103 save_TexParameterfv(target, pname, fparam);
4104 }
4105
4106
4107 void GLAPIENTRY
save_TexParameteriv(GLenum target,GLenum pname,const GLint * params)4108 save_TexParameteriv(GLenum target, GLenum pname, const GLint *params)
4109 {
4110 GLfloat fparam[4];
4111 fparam[0] = (GLfloat) params[0];
4112 fparam[1] = fparam[2] = fparam[3] = 0.0F;
4113 save_TexParameterfv(target, pname, fparam);
4114 }
4115
4116
4117 void GLAPIENTRY
save_TexImage1D(GLenum target,GLint level,GLint components,GLsizei width,GLint border,GLenum format,GLenum type,const GLvoid * pixels)4118 save_TexImage1D(GLenum target,
4119 GLint level, GLint components,
4120 GLsizei width, GLint border,
4121 GLenum format, GLenum type, const GLvoid * pixels)
4122 {
4123 GET_CURRENT_CONTEXT(ctx);
4124 if (target == GL_PROXY_TEXTURE_1D) {
4125 /* don't compile, execute immediately */
4126 CALL_TexImage1D(ctx->Dispatch.Exec, (target, level, components, width,
4127 border, format, type, pixels));
4128 }
4129 else {
4130 Node *n;
4131 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4132 n = alloc_instruction(ctx, OPCODE_TEX_IMAGE1D, 7 + POINTER_DWORDS);
4133 if (n) {
4134 n[1].e = target;
4135 n[2].i = level;
4136 n[3].i = components;
4137 n[4].i = (GLint) width;
4138 n[5].i = border;
4139 n[6].e = format;
4140 n[7].e = type;
4141 save_pointer(&n[8],
4142 unpack_image(ctx, 1, width, 1, 1, format, type,
4143 pixels, &ctx->Unpack));
4144 }
4145 if (ctx->ExecuteFlag) {
4146 CALL_TexImage1D(ctx->Dispatch.Exec, (target, level, components, width,
4147 border, format, type, pixels));
4148 }
4149 }
4150 }
4151
4152
4153 void GLAPIENTRY
save_TexImage2D(GLenum target,GLint level,GLint components,GLsizei width,GLsizei height,GLint border,GLenum format,GLenum type,const GLvoid * pixels)4154 save_TexImage2D(GLenum target,
4155 GLint level, GLint components,
4156 GLsizei width, GLsizei height, GLint border,
4157 GLenum format, GLenum type, const GLvoid * pixels)
4158 {
4159 GET_CURRENT_CONTEXT(ctx);
4160 if (target == GL_PROXY_TEXTURE_2D) {
4161 /* don't compile, execute immediately */
4162 CALL_TexImage2D(ctx->Dispatch.Exec, (target, level, components, width,
4163 height, border, format, type, pixels));
4164 }
4165 else {
4166 Node *n;
4167 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4168 n = alloc_instruction(ctx, OPCODE_TEX_IMAGE2D, 8 + POINTER_DWORDS);
4169 if (n) {
4170 n[1].e = target;
4171 n[2].i = level;
4172 n[3].i = components;
4173 n[4].i = (GLint) width;
4174 n[5].i = (GLint) height;
4175 n[6].i = border;
4176 n[7].e = format;
4177 n[8].e = type;
4178 save_pointer(&n[9],
4179 unpack_image(ctx, 2, width, height, 1, format, type,
4180 pixels, &ctx->Unpack));
4181 }
4182 if (ctx->ExecuteFlag) {
4183 CALL_TexImage2D(ctx->Dispatch.Exec, (target, level, components, width,
4184 height, border, format, type, pixels));
4185 }
4186 }
4187 }
4188
4189
4190 void GLAPIENTRY
save_TexImage3D(GLenum target,GLint level,GLint internalFormat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLenum format,GLenum type,const GLvoid * pixels)4191 save_TexImage3D(GLenum target,
4192 GLint level, GLint internalFormat,
4193 GLsizei width, GLsizei height, GLsizei depth,
4194 GLint border,
4195 GLenum format, GLenum type, const GLvoid * pixels)
4196 {
4197 GET_CURRENT_CONTEXT(ctx);
4198 if (target == GL_PROXY_TEXTURE_3D) {
4199 /* don't compile, execute immediately */
4200 CALL_TexImage3D(ctx->Dispatch.Exec, (target, level, internalFormat, width,
4201 height, depth, border, format, type,
4202 pixels));
4203 }
4204 else {
4205 Node *n;
4206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4207 n = alloc_instruction(ctx, OPCODE_TEX_IMAGE3D, 9 + POINTER_DWORDS);
4208 if (n) {
4209 n[1].e = target;
4210 n[2].i = level;
4211 n[3].i = (GLint) internalFormat;
4212 n[4].i = (GLint) width;
4213 n[5].i = (GLint) height;
4214 n[6].i = (GLint) depth;
4215 n[7].i = border;
4216 n[8].e = format;
4217 n[9].e = type;
4218 save_pointer(&n[10],
4219 unpack_image(ctx, 3, width, height, depth, format, type,
4220 pixels, &ctx->Unpack));
4221 }
4222 if (ctx->ExecuteFlag) {
4223 CALL_TexImage3D(ctx->Dispatch.Exec, (target, level, internalFormat, width,
4224 height, depth, border, format, type,
4225 pixels));
4226 }
4227 }
4228 }
4229
4230
4231 void GLAPIENTRY
save_TexSubImage1D(GLenum target,GLint level,GLint xoffset,GLsizei width,GLenum format,GLenum type,const GLvoid * pixels)4232 save_TexSubImage1D(GLenum target, GLint level, GLint xoffset,
4233 GLsizei width, GLenum format, GLenum type,
4234 const GLvoid * pixels)
4235 {
4236 GET_CURRENT_CONTEXT(ctx);
4237 Node *n;
4238
4239 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4240
4241 n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE1D, 6 + POINTER_DWORDS);
4242 if (n) {
4243 n[1].e = target;
4244 n[2].i = level;
4245 n[3].i = xoffset;
4246 n[4].i = (GLint) width;
4247 n[5].e = format;
4248 n[6].e = type;
4249 save_pointer(&n[7],
4250 unpack_image(ctx, 1, width, 1, 1, format, type,
4251 pixels, &ctx->Unpack));
4252 }
4253 if (ctx->ExecuteFlag) {
4254 CALL_TexSubImage1D(ctx->Dispatch.Exec, (target, level, xoffset, width,
4255 format, type, pixels));
4256 }
4257 }
4258
4259
4260 void GLAPIENTRY
save_TexSubImage2D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLenum type,const GLvoid * pixels)4261 save_TexSubImage2D(GLenum target, GLint level,
4262 GLint xoffset, GLint yoffset,
4263 GLsizei width, GLsizei height,
4264 GLenum format, GLenum type, const GLvoid * pixels)
4265 {
4266 GET_CURRENT_CONTEXT(ctx);
4267 Node *n;
4268
4269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4270
4271 n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE2D, 8 + POINTER_DWORDS);
4272 if (n) {
4273 n[1].e = target;
4274 n[2].i = level;
4275 n[3].i = xoffset;
4276 n[4].i = yoffset;
4277 n[5].i = (GLint) width;
4278 n[6].i = (GLint) height;
4279 n[7].e = format;
4280 n[8].e = type;
4281 save_pointer(&n[9],
4282 unpack_image(ctx, 2, width, height, 1, format, type,
4283 pixels, &ctx->Unpack));
4284 }
4285 if (ctx->ExecuteFlag) {
4286 CALL_TexSubImage2D(ctx->Dispatch.Exec, (target, level, xoffset, yoffset,
4287 width, height, format, type, pixels));
4288 }
4289 }
4290
4291
4292 void GLAPIENTRY
save_TexSubImage3D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLenum type,const GLvoid * pixels)4293 save_TexSubImage3D(GLenum target, GLint level,
4294 GLint xoffset, GLint yoffset, GLint zoffset,
4295 GLsizei width, GLsizei height, GLsizei depth,
4296 GLenum format, GLenum type, const GLvoid * pixels)
4297 {
4298 GET_CURRENT_CONTEXT(ctx);
4299 Node *n;
4300
4301 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4302
4303 n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE3D, 10 + POINTER_DWORDS);
4304 if (n) {
4305 n[1].e = target;
4306 n[2].i = level;
4307 n[3].i = xoffset;
4308 n[4].i = yoffset;
4309 n[5].i = zoffset;
4310 n[6].i = (GLint) width;
4311 n[7].i = (GLint) height;
4312 n[8].i = (GLint) depth;
4313 n[9].e = format;
4314 n[10].e = type;
4315 save_pointer(&n[11],
4316 unpack_image(ctx, 3, width, height, depth, format, type,
4317 pixels, &ctx->Unpack));
4318 }
4319 if (ctx->ExecuteFlag) {
4320 CALL_TexSubImage3D(ctx->Dispatch.Exec, (target, level,
4321 xoffset, yoffset, zoffset,
4322 width, height, depth, format, type,
4323 pixels));
4324 }
4325 }
4326
4327
4328 void GLAPIENTRY
save_Translatef(GLfloat x,GLfloat y,GLfloat z)4329 save_Translatef(GLfloat x, GLfloat y, GLfloat z)
4330 {
4331 GET_CURRENT_CONTEXT(ctx);
4332 Node *n;
4333 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4334 n = alloc_instruction(ctx, OPCODE_TRANSLATE, 3);
4335 if (n) {
4336 n[1].f = x;
4337 n[2].f = y;
4338 n[3].f = z;
4339 }
4340 if (ctx->ExecuteFlag) {
4341 CALL_Translatef(ctx->Dispatch.Exec, (x, y, z));
4342 }
4343 }
4344
4345
4346 void GLAPIENTRY
save_Translated(GLdouble x,GLdouble y,GLdouble z)4347 save_Translated(GLdouble x, GLdouble y, GLdouble z)
4348 {
4349 save_Translatef((GLfloat) x, (GLfloat) y, (GLfloat) z);
4350 }
4351
4352
4353
4354 void GLAPIENTRY
save_Viewport(GLint x,GLint y,GLsizei width,GLsizei height)4355 save_Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
4356 {
4357 GET_CURRENT_CONTEXT(ctx);
4358 Node *n;
4359 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4360 n = alloc_instruction(ctx, OPCODE_VIEWPORT, 4);
4361 if (n) {
4362 n[1].i = x;
4363 n[2].i = y;
4364 n[3].i = (GLint) width;
4365 n[4].i = (GLint) height;
4366 }
4367 if (ctx->ExecuteFlag) {
4368 CALL_Viewport(ctx->Dispatch.Exec, (x, y, width, height));
4369 }
4370 }
4371
4372 void GLAPIENTRY
save_ViewportIndexedf(GLuint index,GLfloat x,GLfloat y,GLfloat width,GLfloat height)4373 save_ViewportIndexedf(GLuint index, GLfloat x, GLfloat y, GLfloat width,
4374 GLfloat height)
4375 {
4376 GET_CURRENT_CONTEXT(ctx);
4377 Node *n;
4378 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4379 n = alloc_instruction(ctx, OPCODE_VIEWPORT_INDEXED_F, 5);
4380 if (n) {
4381 n[1].ui = index;
4382 n[2].f = x;
4383 n[3].f = y;
4384 n[4].f = width;
4385 n[5].f = height;
4386 }
4387 if (ctx->ExecuteFlag) {
4388 CALL_ViewportIndexedf(ctx->Dispatch.Exec, (index, x, y, width, height));
4389 }
4390 }
4391
4392 void GLAPIENTRY
save_ViewportIndexedfv(GLuint index,const GLfloat * v)4393 save_ViewportIndexedfv(GLuint index, const GLfloat *v)
4394 {
4395 GET_CURRENT_CONTEXT(ctx);
4396 Node *n;
4397 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4398 n = alloc_instruction(ctx, OPCODE_VIEWPORT_INDEXED_FV, 5);
4399 if (n) {
4400 n[1].ui = index;
4401 n[2].f = v[0];
4402 n[3].f = v[1];
4403 n[4].f = v[2];
4404 n[5].f = v[3];
4405 }
4406 if (ctx->ExecuteFlag) {
4407 CALL_ViewportIndexedfv(ctx->Dispatch.Exec, (index, v));
4408 }
4409 }
4410
4411 void GLAPIENTRY
save_ViewportArrayv(GLuint first,GLsizei count,const GLfloat * v)4412 save_ViewportArrayv(GLuint first, GLsizei count, const GLfloat *v)
4413 {
4414 GET_CURRENT_CONTEXT(ctx);
4415 Node *n;
4416 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4417 n = alloc_instruction(ctx, OPCODE_VIEWPORT_ARRAY_V, 2 + POINTER_DWORDS);
4418 if (n) {
4419 n[1].ui = first;
4420 n[2].si = count;
4421 save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLfloat)));
4422 }
4423 if (ctx->ExecuteFlag) {
4424 CALL_ViewportArrayv(ctx->Dispatch.Exec, (first, count, v));
4425 }
4426 }
4427
4428 void GLAPIENTRY
save_ScissorIndexed(GLuint index,GLint left,GLint bottom,GLsizei width,GLsizei height)4429 save_ScissorIndexed(GLuint index, GLint left, GLint bottom, GLsizei width,
4430 GLsizei height)
4431 {
4432 GET_CURRENT_CONTEXT(ctx);
4433 Node *n;
4434 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4435 n = alloc_instruction(ctx, OPCODE_SCISSOR_INDEXED, 5);
4436 if (n) {
4437 n[1].ui = index;
4438 n[2].i = left;
4439 n[3].i = bottom;
4440 n[4].si = width;
4441 n[5].si = height;
4442 }
4443 if (ctx->ExecuteFlag) {
4444 CALL_ScissorIndexed(ctx->Dispatch.Exec, (index, left, bottom, width, height));
4445 }
4446 }
4447
4448 void GLAPIENTRY
save_ScissorIndexedv(GLuint index,const GLint * v)4449 save_ScissorIndexedv(GLuint index, const GLint *v)
4450 {
4451 GET_CURRENT_CONTEXT(ctx);
4452 Node *n;
4453 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4454 n = alloc_instruction(ctx, OPCODE_SCISSOR_INDEXED_V, 5);
4455 if (n) {
4456 n[1].ui = index;
4457 n[2].i = v[0];
4458 n[3].i = v[1];
4459 n[4].si = v[2];
4460 n[5].si = v[3];
4461 }
4462 if (ctx->ExecuteFlag) {
4463 CALL_ScissorIndexedv(ctx->Dispatch.Exec, (index, v));
4464 }
4465 }
4466
4467 void GLAPIENTRY
save_ScissorArrayv(GLuint first,GLsizei count,const GLint * v)4468 save_ScissorArrayv(GLuint first, GLsizei count, const GLint *v)
4469 {
4470 GET_CURRENT_CONTEXT(ctx);
4471 Node *n;
4472 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4473 n = alloc_instruction(ctx, OPCODE_SCISSOR_ARRAY_V, 2 + POINTER_DWORDS);
4474 if (n) {
4475 n[1].ui = first;
4476 n[2].si = count;
4477 save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLint)));
4478 }
4479 if (ctx->ExecuteFlag) {
4480 CALL_ScissorArrayv(ctx->Dispatch.Exec, (first, count, v));
4481 }
4482 }
4483
4484 void GLAPIENTRY
save_DepthRangeIndexed(GLuint index,GLclampd n,GLclampd f)4485 save_DepthRangeIndexed(GLuint index, GLclampd n, GLclampd f)
4486 {
4487 GET_CURRENT_CONTEXT(ctx);
4488 Node *node;
4489 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4490 node = alloc_instruction(ctx, OPCODE_DEPTH_INDEXED, 3);
4491 if (node) {
4492 node[1].ui = index;
4493 /* Mesa stores these as floats internally so we deliberately convert
4494 * them to a float here.
4495 */
4496 node[2].f = n;
4497 node[3].f = f;
4498 }
4499 if (ctx->ExecuteFlag) {
4500 CALL_DepthRangeIndexed(ctx->Dispatch.Exec, (index, n, f));
4501 }
4502 }
4503
4504 void GLAPIENTRY
save_DepthRangeArrayv(GLuint first,GLsizei count,const GLclampd * v)4505 save_DepthRangeArrayv(GLuint first, GLsizei count, const GLclampd *v)
4506 {
4507 GET_CURRENT_CONTEXT(ctx);
4508 Node *n;
4509 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4510 n = alloc_instruction(ctx, OPCODE_DEPTH_ARRAY_V, 2 + POINTER_DWORDS);
4511 if (n) {
4512 n[1].ui = first;
4513 n[2].si = count;
4514 save_pointer(&n[3], memdup(v, count * 2 * sizeof(GLclampd)));
4515 }
4516 if (ctx->ExecuteFlag) {
4517 CALL_DepthRangeArrayv(ctx->Dispatch.Exec, (first, count, v));
4518 }
4519 }
4520
4521 void GLAPIENTRY
save_WindowPos4fMESA(GLfloat x,GLfloat y,GLfloat z,GLfloat w)4522 save_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
4523 {
4524 GET_CURRENT_CONTEXT(ctx);
4525 Node *n;
4526 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4527 n = alloc_instruction(ctx, OPCODE_WINDOW_POS, 4);
4528 if (n) {
4529 n[1].f = x;
4530 n[2].f = y;
4531 n[3].f = z;
4532 n[4].f = w;
4533 }
4534 if (ctx->ExecuteFlag) {
4535 CALL_WindowPos4fMESA(ctx->Dispatch.Exec, (x, y, z, w));
4536 }
4537 }
4538
4539 void GLAPIENTRY
save_WindowPos2d(GLdouble x,GLdouble y)4540 save_WindowPos2d(GLdouble x, GLdouble y)
4541 {
4542 save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
4543 }
4544
4545 void GLAPIENTRY
save_WindowPos2f(GLfloat x,GLfloat y)4546 save_WindowPos2f(GLfloat x, GLfloat y)
4547 {
4548 save_WindowPos4fMESA(x, y, 0.0F, 1.0F);
4549 }
4550
4551 void GLAPIENTRY
save_WindowPos2i(GLint x,GLint y)4552 save_WindowPos2i(GLint x, GLint y)
4553 {
4554 save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, 0.0F, 1.0F);
4555 }
4556
4557 void GLAPIENTRY
save_WindowPos2s(GLshort x,GLshort y)4558 save_WindowPos2s(GLshort x, GLshort y)
4559 {
4560 save_WindowPos4fMESA(x, y, 0.0F, 1.0F);
4561 }
4562
4563 void GLAPIENTRY
save_WindowPos3d(GLdouble x,GLdouble y,GLdouble z)4564 save_WindowPos3d(GLdouble x, GLdouble y, GLdouble z)
4565 {
4566 save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
4567 }
4568
4569 void GLAPIENTRY
save_WindowPos3f(GLfloat x,GLfloat y,GLfloat z)4570 save_WindowPos3f(GLfloat x, GLfloat y, GLfloat z)
4571 {
4572 save_WindowPos4fMESA(x, y, z, 1.0F);
4573 }
4574
4575 void GLAPIENTRY
save_WindowPos3i(GLint x,GLint y,GLint z)4576 save_WindowPos3i(GLint x, GLint y, GLint z)
4577 {
4578 save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F);
4579 }
4580
4581 void GLAPIENTRY
save_WindowPos3s(GLshort x,GLshort y,GLshort z)4582 save_WindowPos3s(GLshort x, GLshort y, GLshort z)
4583 {
4584 save_WindowPos4fMESA(x, y, z, 1.0F);
4585 }
4586
4587 void GLAPIENTRY
save_WindowPos4dMESA(GLdouble x,GLdouble y,GLdouble z,GLdouble w)4588 save_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
4589 {
4590 save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
4591 }
4592
4593 void GLAPIENTRY
save_WindowPos4iMESA(GLint x,GLint y,GLint z,GLint w)4594 save_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w)
4595 {
4596 save_WindowPos4fMESA((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w);
4597 }
4598
4599 void GLAPIENTRY
save_WindowPos4sMESA(GLshort x,GLshort y,GLshort z,GLshort w)4600 save_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w)
4601 {
4602 save_WindowPos4fMESA(x, y, z, w);
4603 }
4604
4605 void GLAPIENTRY
save_WindowPos2dv(const GLdouble * v)4606 save_WindowPos2dv(const GLdouble * v)
4607 {
4608 save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
4609 }
4610
4611 void GLAPIENTRY
save_WindowPos2fv(const GLfloat * v)4612 save_WindowPos2fv(const GLfloat * v)
4613 {
4614 save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
4615 }
4616
4617 void GLAPIENTRY
save_WindowPos2iv(const GLint * v)4618 save_WindowPos2iv(const GLint * v)
4619 {
4620 save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F);
4621 }
4622
4623 void GLAPIENTRY
save_WindowPos2sv(const GLshort * v)4624 save_WindowPos2sv(const GLshort * v)
4625 {
4626 save_WindowPos4fMESA(v[0], v[1], 0.0F, 1.0F);
4627 }
4628
4629 void GLAPIENTRY
save_WindowPos3dv(const GLdouble * v)4630 save_WindowPos3dv(const GLdouble * v)
4631 {
4632 save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
4633 }
4634
4635 void GLAPIENTRY
save_WindowPos3fv(const GLfloat * v)4636 save_WindowPos3fv(const GLfloat * v)
4637 {
4638 save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
4639 }
4640
4641 void GLAPIENTRY
save_WindowPos3iv(const GLint * v)4642 save_WindowPos3iv(const GLint * v)
4643 {
4644 save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F);
4645 }
4646
4647 void GLAPIENTRY
save_WindowPos3sv(const GLshort * v)4648 save_WindowPos3sv(const GLshort * v)
4649 {
4650 save_WindowPos4fMESA(v[0], v[1], v[2], 1.0F);
4651 }
4652
4653 void GLAPIENTRY
save_WindowPos4dvMESA(const GLdouble * v)4654 save_WindowPos4dvMESA(const GLdouble * v)
4655 {
4656 save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
4657 (GLfloat) v[2], (GLfloat) v[3]);
4658 }
4659
4660 void GLAPIENTRY
save_WindowPos4fvMESA(const GLfloat * v)4661 save_WindowPos4fvMESA(const GLfloat * v)
4662 {
4663 save_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
4664 }
4665
4666 void GLAPIENTRY
save_WindowPos4ivMESA(const GLint * v)4667 save_WindowPos4ivMESA(const GLint * v)
4668 {
4669 save_WindowPos4fMESA((GLfloat) v[0], (GLfloat) v[1],
4670 (GLfloat) v[2], (GLfloat) v[3]);
4671 }
4672
4673 void GLAPIENTRY
save_WindowPos4svMESA(const GLshort * v)4674 save_WindowPos4svMESA(const GLshort * v)
4675 {
4676 save_WindowPos4fMESA(v[0], v[1], v[2], v[3]);
4677 }
4678
4679
4680
4681 /* GL_ARB_multitexture */
4682 void GLAPIENTRY
save_ActiveTexture(GLenum target)4683 save_ActiveTexture(GLenum target)
4684 {
4685 GET_CURRENT_CONTEXT(ctx);
4686 Node *n;
4687 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4688 n = alloc_instruction(ctx, OPCODE_ACTIVE_TEXTURE, 1);
4689 if (n) {
4690 n[1].e = target;
4691 }
4692 if (ctx->ExecuteFlag) {
4693 CALL_ActiveTexture(ctx->Dispatch.Exec, (target));
4694 }
4695 }
4696
4697
4698 /* GL_ARB_transpose_matrix */
4699
4700 void GLAPIENTRY
save_LoadTransposeMatrixd(const GLdouble * m)4701 save_LoadTransposeMatrixd(const GLdouble *m)
4702 {
4703 GLfloat tm[16];
4704 _math_transposefd(tm, m);
4705 save_LoadMatrixf(tm);
4706 }
4707
4708
4709 void GLAPIENTRY
save_LoadTransposeMatrixf(const GLfloat * m)4710 save_LoadTransposeMatrixf(const GLfloat *m)
4711 {
4712 GLfloat tm[16];
4713 _math_transposef(tm, m);
4714 save_LoadMatrixf(tm);
4715 }
4716
4717
4718 void GLAPIENTRY
save_MultTransposeMatrixd(const GLdouble * m)4719 save_MultTransposeMatrixd(const GLdouble *m)
4720 {
4721 GLfloat tm[16];
4722 _math_transposefd(tm, m);
4723 save_MultMatrixf(tm);
4724 }
4725
4726
4727 void GLAPIENTRY
save_MultTransposeMatrixf(const GLfloat * m)4728 save_MultTransposeMatrixf(const GLfloat *m)
4729 {
4730 GLfloat tm[16];
4731 _math_transposef(tm, m);
4732 save_MultMatrixf(tm);
4733 }
4734
copy_data(const GLvoid * data,GLsizei size,const char * func)4735 static GLvoid *copy_data(const GLvoid *data, GLsizei size, const char *func)
4736 {
4737 GET_CURRENT_CONTEXT(ctx);
4738 GLvoid *image;
4739
4740 if (!data)
4741 return NULL;
4742
4743 image = malloc(size);
4744 if (!image) {
4745 _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", func);
4746 return NULL;
4747 }
4748 memcpy(image, data, size);
4749
4750 return image;
4751 }
4752
4753
4754 /* GL_ARB_texture_compression */
4755 void GLAPIENTRY
save_CompressedTexImage1D(GLenum target,GLint level,GLenum internalFormat,GLsizei width,GLint border,GLsizei imageSize,const GLvoid * data)4756 save_CompressedTexImage1D(GLenum target, GLint level,
4757 GLenum internalFormat, GLsizei width,
4758 GLint border, GLsizei imageSize,
4759 const GLvoid * data)
4760 {
4761 GET_CURRENT_CONTEXT(ctx);
4762 if (target == GL_PROXY_TEXTURE_1D) {
4763 /* don't compile, execute immediately */
4764 CALL_CompressedTexImage1D(ctx->Dispatch.Exec, (target, level, internalFormat,
4765 width, border, imageSize,
4766 data));
4767 }
4768 else {
4769 Node *n;
4770 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4771
4772 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D,
4773 6 + POINTER_DWORDS);
4774 if (n) {
4775 n[1].e = target;
4776 n[2].i = level;
4777 n[3].e = internalFormat;
4778 n[4].i = (GLint) width;
4779 n[5].i = border;
4780 n[6].i = imageSize;
4781 save_pointer(&n[7],
4782 copy_data(data, imageSize, "glCompressedTexImage1DARB"));
4783 }
4784 if (ctx->ExecuteFlag) {
4785 CALL_CompressedTexImage1D(ctx->Dispatch.Exec,
4786 (target, level, internalFormat, width,
4787 border, imageSize, data));
4788 }
4789 }
4790 }
4791
4792
4793 void GLAPIENTRY
save_CompressedTexImage2D(GLenum target,GLint level,GLenum internalFormat,GLsizei width,GLsizei height,GLint border,GLsizei imageSize,const GLvoid * data)4794 save_CompressedTexImage2D(GLenum target, GLint level,
4795 GLenum internalFormat, GLsizei width,
4796 GLsizei height, GLint border, GLsizei imageSize,
4797 const GLvoid * data)
4798 {
4799 GET_CURRENT_CONTEXT(ctx);
4800 if (target == GL_PROXY_TEXTURE_2D) {
4801 /* don't compile, execute immediately */
4802 CALL_CompressedTexImage2D(ctx->Dispatch.Exec, (target, level, internalFormat,
4803 width, height, border,
4804 imageSize, data));
4805 }
4806 else {
4807 Node *n;
4808 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4809
4810 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D,
4811 7 + POINTER_DWORDS);
4812 if (n) {
4813 n[1].e = target;
4814 n[2].i = level;
4815 n[3].e = internalFormat;
4816 n[4].i = (GLint) width;
4817 n[5].i = (GLint) height;
4818 n[6].i = border;
4819 n[7].i = imageSize;
4820 save_pointer(&n[8],
4821 copy_data(data, imageSize, "glCompressedTexImage2DARB"));
4822 }
4823 if (ctx->ExecuteFlag) {
4824 CALL_CompressedTexImage2D(ctx->Dispatch.Exec,
4825 (target, level, internalFormat, width,
4826 height, border, imageSize, data));
4827 }
4828 }
4829 }
4830
4831
4832 void GLAPIENTRY
save_CompressedTexImage3D(GLenum target,GLint level,GLenum internalFormat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLsizei imageSize,const GLvoid * data)4833 save_CompressedTexImage3D(GLenum target, GLint level,
4834 GLenum internalFormat, GLsizei width,
4835 GLsizei height, GLsizei depth, GLint border,
4836 GLsizei imageSize, const GLvoid * data)
4837 {
4838 GET_CURRENT_CONTEXT(ctx);
4839 if (target == GL_PROXY_TEXTURE_3D) {
4840 /* don't compile, execute immediately */
4841 CALL_CompressedTexImage3D(ctx->Dispatch.Exec, (target, level, internalFormat,
4842 width, height, depth, border,
4843 imageSize, data));
4844 }
4845 else {
4846 Node *n;
4847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4848
4849 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D,
4850 8 + POINTER_DWORDS);
4851 if (n) {
4852 n[1].e = target;
4853 n[2].i = level;
4854 n[3].e = internalFormat;
4855 n[4].i = (GLint) width;
4856 n[5].i = (GLint) height;
4857 n[6].i = (GLint) depth;
4858 n[7].i = border;
4859 n[8].i = imageSize;
4860 save_pointer(&n[9],
4861 copy_data(data, imageSize, "glCompressedTexImage3DARB"));
4862 }
4863 if (ctx->ExecuteFlag) {
4864 CALL_CompressedTexImage3D(ctx->Dispatch.Exec,
4865 (target, level, internalFormat, width,
4866 height, depth, border, imageSize,
4867 data));
4868 }
4869 }
4870 }
4871
4872
4873 void GLAPIENTRY
save_CompressedTexSubImage1D(GLenum target,GLint level,GLint xoffset,GLsizei width,GLenum format,GLsizei imageSize,const GLvoid * data)4874 save_CompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset,
4875 GLsizei width, GLenum format,
4876 GLsizei imageSize, const GLvoid * data)
4877 {
4878 Node *n;
4879 GET_CURRENT_CONTEXT(ctx);
4880 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4881
4882 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D,
4883 6 + POINTER_DWORDS);
4884 if (n) {
4885 n[1].e = target;
4886 n[2].i = level;
4887 n[3].i = xoffset;
4888 n[4].i = (GLint) width;
4889 n[5].e = format;
4890 n[6].i = imageSize;
4891 save_pointer(&n[7],
4892 copy_data(data, imageSize, "glCompressedTexSubImage1DARB"));
4893 }
4894 if (ctx->ExecuteFlag) {
4895 CALL_CompressedTexSubImage1D(ctx->Dispatch.Exec, (target, level, xoffset,
4896 width, format, imageSize,
4897 data));
4898 }
4899 }
4900
4901
4902 void GLAPIENTRY
save_CompressedTexSubImage2D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLsizei imageSize,const GLvoid * data)4903 save_CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset,
4904 GLint yoffset, GLsizei width, GLsizei height,
4905 GLenum format, GLsizei imageSize,
4906 const GLvoid * data)
4907 {
4908 Node *n;
4909 GET_CURRENT_CONTEXT(ctx);
4910 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4911
4912 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D,
4913 8 + POINTER_DWORDS);
4914 if (n) {
4915 n[1].e = target;
4916 n[2].i = level;
4917 n[3].i = xoffset;
4918 n[4].i = yoffset;
4919 n[5].i = (GLint) width;
4920 n[6].i = (GLint) height;
4921 n[7].e = format;
4922 n[8].i = imageSize;
4923 save_pointer(&n[9],
4924 copy_data(data, imageSize, "glCompressedTexSubImage2DARB"));
4925 }
4926 if (ctx->ExecuteFlag) {
4927 CALL_CompressedTexSubImage2D(ctx->Dispatch.Exec,
4928 (target, level, xoffset, yoffset, width,
4929 height, format, imageSize, data));
4930 }
4931 }
4932
4933
4934 void GLAPIENTRY
save_CompressedTexSubImage3D(GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLsizei imageSize,const GLvoid * data)4935 save_CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset,
4936 GLint yoffset, GLint zoffset, GLsizei width,
4937 GLsizei height, GLsizei depth, GLenum format,
4938 GLsizei imageSize, const GLvoid * data)
4939 {
4940 Node *n;
4941 GET_CURRENT_CONTEXT(ctx);
4942 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4943
4944 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D,
4945 10 + POINTER_DWORDS);
4946 if (n) {
4947 n[1].e = target;
4948 n[2].i = level;
4949 n[3].i = xoffset;
4950 n[4].i = yoffset;
4951 n[5].i = zoffset;
4952 n[6].i = (GLint) width;
4953 n[7].i = (GLint) height;
4954 n[8].i = (GLint) depth;
4955 n[9].e = format;
4956 n[10].i = imageSize;
4957 save_pointer(&n[11],
4958 copy_data(data, imageSize, "glCompressedTexSubImage3DARB"));
4959 }
4960 if (ctx->ExecuteFlag) {
4961 CALL_CompressedTexSubImage3D(ctx->Dispatch.Exec,
4962 (target, level, xoffset, yoffset,
4963 zoffset, width, height, depth, format,
4964 imageSize, data));
4965 }
4966 }
4967
4968
4969 /* GL_ARB_multisample */
4970 void GLAPIENTRY
save_SampleCoverage(GLclampf value,GLboolean invert)4971 save_SampleCoverage(GLclampf value, GLboolean invert)
4972 {
4973 GET_CURRENT_CONTEXT(ctx);
4974 Node *n;
4975 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4976 n = alloc_instruction(ctx, OPCODE_SAMPLE_COVERAGE, 2);
4977 if (n) {
4978 n[1].f = value;
4979 n[2].b = invert;
4980 }
4981 if (ctx->ExecuteFlag) {
4982 CALL_SampleCoverage(ctx->Dispatch.Exec, (value, invert));
4983 }
4984 }
4985
4986
4987 /*
4988 * GL_ARB_vertex_program
4989 */
4990 void GLAPIENTRY
save_BindProgramARB(GLenum target,GLuint id)4991 save_BindProgramARB(GLenum target, GLuint id)
4992 {
4993 GET_CURRENT_CONTEXT(ctx);
4994 Node *n;
4995 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
4996 n = alloc_instruction(ctx, OPCODE_BIND_PROGRAM_ARB, 2);
4997 if (n) {
4998 n[1].e = target;
4999 n[2].ui = id;
5000 }
5001 if (ctx->ExecuteFlag) {
5002 CALL_BindProgramARB(ctx->Dispatch.Exec, (target, id));
5003 }
5004 }
5005
5006 void GLAPIENTRY
save_ProgramEnvParameter4fARB(GLenum target,GLuint index,GLfloat x,GLfloat y,GLfloat z,GLfloat w)5007 save_ProgramEnvParameter4fARB(GLenum target, GLuint index,
5008 GLfloat x, GLfloat y, GLfloat z, GLfloat w)
5009 {
5010 GET_CURRENT_CONTEXT(ctx);
5011 Node *n;
5012 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5013 n = alloc_instruction(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
5014 if (n) {
5015 n[1].e = target;
5016 n[2].ui = index;
5017 n[3].f = x;
5018 n[4].f = y;
5019 n[5].f = z;
5020 n[6].f = w;
5021 }
5022 if (ctx->ExecuteFlag) {
5023 CALL_ProgramEnvParameter4fARB(ctx->Dispatch.Exec, (target, index, x, y, z, w));
5024 }
5025 }
5026
5027
5028 void GLAPIENTRY
save_ProgramEnvParameter4fvARB(GLenum target,GLuint index,const GLfloat * params)5029 save_ProgramEnvParameter4fvARB(GLenum target, GLuint index,
5030 const GLfloat *params)
5031 {
5032 save_ProgramEnvParameter4fARB(target, index, params[0], params[1],
5033 params[2], params[3]);
5034 }
5035
5036
5037 void GLAPIENTRY
save_ProgramEnvParameters4fvEXT(GLenum target,GLuint index,GLsizei count,const GLfloat * params)5038 save_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
5039 const GLfloat * params)
5040 {
5041 GET_CURRENT_CONTEXT(ctx);
5042 Node *n;
5043 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5044
5045 if (count > 0) {
5046 GLint i;
5047 const GLfloat * p = params;
5048
5049 for (i = 0 ; i < count ; i++) {
5050 n = alloc_instruction(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6);
5051 if (n) {
5052 n[1].e = target;
5053 n[2].ui = index;
5054 n[3].f = p[0];
5055 n[4].f = p[1];
5056 n[5].f = p[2];
5057 n[6].f = p[3];
5058 p += 4;
5059 }
5060 }
5061 }
5062
5063 if (ctx->ExecuteFlag) {
5064 CALL_ProgramEnvParameters4fvEXT(ctx->Dispatch.Exec, (target, index, count, params));
5065 }
5066 }
5067
5068
5069 void GLAPIENTRY
save_ProgramEnvParameter4dARB(GLenum target,GLuint index,GLdouble x,GLdouble y,GLdouble z,GLdouble w)5070 save_ProgramEnvParameter4dARB(GLenum target, GLuint index,
5071 GLdouble x, GLdouble y, GLdouble z, GLdouble w)
5072 {
5073 save_ProgramEnvParameter4fARB(target, index,
5074 (GLfloat) x,
5075 (GLfloat) y, (GLfloat) z, (GLfloat) w);
5076 }
5077
5078
5079 void GLAPIENTRY
save_ProgramEnvParameter4dvARB(GLenum target,GLuint index,const GLdouble * params)5080 save_ProgramEnvParameter4dvARB(GLenum target, GLuint index,
5081 const GLdouble *params)
5082 {
5083 save_ProgramEnvParameter4fARB(target, index,
5084 (GLfloat) params[0],
5085 (GLfloat) params[1],
5086 (GLfloat) params[2], (GLfloat) params[3]);
5087 }
5088
5089
5090 void GLAPIENTRY
save_ProgramLocalParameter4fARB(GLenum target,GLuint index,GLfloat x,GLfloat y,GLfloat z,GLfloat w)5091 save_ProgramLocalParameter4fARB(GLenum target, GLuint index,
5092 GLfloat x, GLfloat y, GLfloat z, GLfloat w)
5093 {
5094 GET_CURRENT_CONTEXT(ctx);
5095 Node *n;
5096 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5097 n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
5098 if (n) {
5099 n[1].e = target;
5100 n[2].ui = index;
5101 n[3].f = x;
5102 n[4].f = y;
5103 n[5].f = z;
5104 n[6].f = w;
5105 }
5106 if (ctx->ExecuteFlag) {
5107 CALL_ProgramLocalParameter4fARB(ctx->Dispatch.Exec, (target, index, x, y, z, w));
5108 }
5109 }
5110
5111
5112 void GLAPIENTRY
save_ProgramLocalParameter4fvARB(GLenum target,GLuint index,const GLfloat * params)5113 save_ProgramLocalParameter4fvARB(GLenum target, GLuint index,
5114 const GLfloat *params)
5115 {
5116 GET_CURRENT_CONTEXT(ctx);
5117 Node *n;
5118 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5119 n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
5120 if (n) {
5121 n[1].e = target;
5122 n[2].ui = index;
5123 n[3].f = params[0];
5124 n[4].f = params[1];
5125 n[5].f = params[2];
5126 n[6].f = params[3];
5127 }
5128 if (ctx->ExecuteFlag) {
5129 CALL_ProgramLocalParameter4fvARB(ctx->Dispatch.Exec, (target, index, params));
5130 }
5131 }
5132
5133
5134 void GLAPIENTRY
save_ProgramLocalParameters4fvEXT(GLenum target,GLuint index,GLsizei count,const GLfloat * params)5135 save_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count,
5136 const GLfloat *params)
5137 {
5138 GET_CURRENT_CONTEXT(ctx);
5139 Node *n;
5140 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5141
5142 if (count > 0) {
5143 GLint i;
5144 const GLfloat * p = params;
5145
5146 for (i = 0 ; i < count ; i++) {
5147 n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
5148 if (n) {
5149 n[1].e = target;
5150 n[2].ui = index;
5151 n[3].f = p[0];
5152 n[4].f = p[1];
5153 n[5].f = p[2];
5154 n[6].f = p[3];
5155 p += 4;
5156 }
5157 }
5158 }
5159
5160 if (ctx->ExecuteFlag) {
5161 CALL_ProgramLocalParameters4fvEXT(ctx->Dispatch.Exec, (target, index, count, params));
5162 }
5163 }
5164
5165
5166 void GLAPIENTRY
save_ProgramLocalParameter4dARB(GLenum target,GLuint index,GLdouble x,GLdouble y,GLdouble z,GLdouble w)5167 save_ProgramLocalParameter4dARB(GLenum target, GLuint index,
5168 GLdouble x, GLdouble y,
5169 GLdouble z, GLdouble w)
5170 {
5171 GET_CURRENT_CONTEXT(ctx);
5172 Node *n;
5173 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5174 n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
5175 if (n) {
5176 n[1].e = target;
5177 n[2].ui = index;
5178 n[3].f = (GLfloat) x;
5179 n[4].f = (GLfloat) y;
5180 n[5].f = (GLfloat) z;
5181 n[6].f = (GLfloat) w;
5182 }
5183 if (ctx->ExecuteFlag) {
5184 CALL_ProgramLocalParameter4dARB(ctx->Dispatch.Exec, (target, index, x, y, z, w));
5185 }
5186 }
5187
5188
5189 void GLAPIENTRY
save_ProgramLocalParameter4dvARB(GLenum target,GLuint index,const GLdouble * params)5190 save_ProgramLocalParameter4dvARB(GLenum target, GLuint index,
5191 const GLdouble *params)
5192 {
5193 GET_CURRENT_CONTEXT(ctx);
5194 Node *n;
5195 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5196 n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6);
5197 if (n) {
5198 n[1].e = target;
5199 n[2].ui = index;
5200 n[3].f = (GLfloat) params[0];
5201 n[4].f = (GLfloat) params[1];
5202 n[5].f = (GLfloat) params[2];
5203 n[6].f = (GLfloat) params[3];
5204 }
5205 if (ctx->ExecuteFlag) {
5206 CALL_ProgramLocalParameter4dvARB(ctx->Dispatch.Exec, (target, index, params));
5207 }
5208 }
5209
5210
5211 /* GL_EXT_stencil_two_side */
5212 void GLAPIENTRY
save_ActiveStencilFaceEXT(GLenum face)5213 save_ActiveStencilFaceEXT(GLenum face)
5214 {
5215 GET_CURRENT_CONTEXT(ctx);
5216 Node *n;
5217 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5218 n = alloc_instruction(ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 1);
5219 if (n) {
5220 n[1].e = face;
5221 }
5222 if (ctx->ExecuteFlag) {
5223 CALL_ActiveStencilFaceEXT(ctx->Dispatch.Exec, (face));
5224 }
5225 }
5226
5227
5228 /* GL_EXT_depth_bounds_test */
5229 void GLAPIENTRY
save_DepthBoundsEXT(GLclampd zmin,GLclampd zmax)5230 save_DepthBoundsEXT(GLclampd zmin, GLclampd zmax)
5231 {
5232 GET_CURRENT_CONTEXT(ctx);
5233 Node *n;
5234 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5235 n = alloc_instruction(ctx, OPCODE_DEPTH_BOUNDS_EXT, 2);
5236 if (n) {
5237 n[1].f = (GLfloat) zmin;
5238 n[2].f = (GLfloat) zmax;
5239 }
5240 if (ctx->ExecuteFlag) {
5241 CALL_DepthBoundsEXT(ctx->Dispatch.Exec, (zmin, zmax));
5242 }
5243 }
5244
5245
5246
5247 void GLAPIENTRY
save_ProgramStringARB(GLenum target,GLenum format,GLsizei len,const GLvoid * string)5248 save_ProgramStringARB(GLenum target, GLenum format, GLsizei len,
5249 const GLvoid * string)
5250 {
5251 GET_CURRENT_CONTEXT(ctx);
5252 Node *n;
5253
5254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5255
5256 n = alloc_instruction(ctx, OPCODE_PROGRAM_STRING_ARB, 3 + POINTER_DWORDS);
5257 if (n) {
5258 GLubyte *programCopy = malloc(len);
5259 if (!programCopy) {
5260 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB");
5261 return;
5262 }
5263 memcpy(programCopy, string, len);
5264 n[1].e = target;
5265 n[2].e = format;
5266 n[3].i = len;
5267 save_pointer(&n[4], programCopy);
5268 }
5269 if (ctx->ExecuteFlag) {
5270 CALL_ProgramStringARB(ctx->Dispatch.Exec, (target, format, len, string));
5271 }
5272 }
5273
5274
5275 void GLAPIENTRY
save_BeginQuery(GLenum target,GLuint id)5276 save_BeginQuery(GLenum target, GLuint id)
5277 {
5278 GET_CURRENT_CONTEXT(ctx);
5279 Node *n;
5280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5281 n = alloc_instruction(ctx, OPCODE_BEGIN_QUERY_ARB, 2);
5282 if (n) {
5283 n[1].e = target;
5284 n[2].ui = id;
5285 }
5286 if (ctx->ExecuteFlag) {
5287 CALL_BeginQuery(ctx->Dispatch.Exec, (target, id));
5288 }
5289 }
5290
5291 void GLAPIENTRY
save_EndQuery(GLenum target)5292 save_EndQuery(GLenum target)
5293 {
5294 GET_CURRENT_CONTEXT(ctx);
5295 Node *n;
5296 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5297 n = alloc_instruction(ctx, OPCODE_END_QUERY_ARB, 1);
5298 if (n) {
5299 n[1].e = target;
5300 }
5301 if (ctx->ExecuteFlag) {
5302 CALL_EndQuery(ctx->Dispatch.Exec, (target));
5303 }
5304 }
5305
5306 void GLAPIENTRY
save_QueryCounter(GLuint id,GLenum target)5307 save_QueryCounter(GLuint id, GLenum target)
5308 {
5309 GET_CURRENT_CONTEXT(ctx);
5310 Node *n;
5311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5312 n = alloc_instruction(ctx, OPCODE_QUERY_COUNTER, 2);
5313 if (n) {
5314 n[1].ui = id;
5315 n[2].e = target;
5316 }
5317 if (ctx->ExecuteFlag) {
5318 CALL_QueryCounter(ctx->Dispatch.Exec, (id, target));
5319 }
5320 }
5321
5322 void GLAPIENTRY
save_BeginQueryIndexed(GLenum target,GLuint index,GLuint id)5323 save_BeginQueryIndexed(GLenum target, GLuint index, GLuint id)
5324 {
5325 GET_CURRENT_CONTEXT(ctx);
5326 Node *n;
5327 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5328 n = alloc_instruction(ctx, OPCODE_BEGIN_QUERY_INDEXED, 3);
5329 if (n) {
5330 n[1].e = target;
5331 n[2].ui = index;
5332 n[3].ui = id;
5333 }
5334 if (ctx->ExecuteFlag) {
5335 CALL_BeginQueryIndexed(ctx->Dispatch.Exec, (target, index, id));
5336 }
5337 }
5338
5339 void GLAPIENTRY
save_EndQueryIndexed(GLenum target,GLuint index)5340 save_EndQueryIndexed(GLenum target, GLuint index)
5341 {
5342 GET_CURRENT_CONTEXT(ctx);
5343 Node *n;
5344 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5345 n = alloc_instruction(ctx, OPCODE_END_QUERY_INDEXED, 2);
5346 if (n) {
5347 n[1].e = target;
5348 n[2].ui = index;
5349 }
5350 if (ctx->ExecuteFlag) {
5351 CALL_EndQueryIndexed(ctx->Dispatch.Exec, (target, index));
5352 }
5353 }
5354
5355
5356 void GLAPIENTRY
save_DrawBuffers(GLsizei count,const GLenum * buffers)5357 save_DrawBuffers(GLsizei count, const GLenum * buffers)
5358 {
5359 GET_CURRENT_CONTEXT(ctx);
5360 Node *n;
5361 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5362 n = alloc_instruction(ctx, OPCODE_DRAW_BUFFERS_ARB, 1 + MAX_DRAW_BUFFERS);
5363 if (n) {
5364 GLint i;
5365 n[1].i = count;
5366 if (count > MAX_DRAW_BUFFERS)
5367 count = MAX_DRAW_BUFFERS;
5368 for (i = 0; i < count; i++) {
5369 n[2 + i].e = buffers[i];
5370 }
5371 }
5372 if (ctx->ExecuteFlag) {
5373 CALL_DrawBuffers(ctx->Dispatch.Exec, (count, buffers));
5374 }
5375 }
5376
5377 void GLAPIENTRY
save_BindFragmentShaderATI(GLuint id)5378 save_BindFragmentShaderATI(GLuint id)
5379 {
5380 GET_CURRENT_CONTEXT(ctx);
5381 Node *n;
5382
5383 n = alloc_instruction(ctx, OPCODE_BIND_FRAGMENT_SHADER_ATI, 1);
5384 if (n) {
5385 n[1].ui = id;
5386 }
5387 if (ctx->ExecuteFlag) {
5388 CALL_BindFragmentShaderATI(ctx->Dispatch.Exec, (id));
5389 }
5390 }
5391
5392 void GLAPIENTRY
save_SetFragmentShaderConstantATI(GLuint dst,const GLfloat * value)5393 save_SetFragmentShaderConstantATI(GLuint dst, const GLfloat *value)
5394 {
5395 GET_CURRENT_CONTEXT(ctx);
5396 Node *n;
5397
5398 n = alloc_instruction(ctx, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, 5);
5399 if (n) {
5400 n[1].ui = dst;
5401 n[2].f = value[0];
5402 n[3].f = value[1];
5403 n[4].f = value[2];
5404 n[5].f = value[3];
5405 }
5406 if (ctx->ExecuteFlag) {
5407 CALL_SetFragmentShaderConstantATI(ctx->Dispatch.Exec, (dst, value));
5408 }
5409 }
5410
5411 static void GLAPIENTRY
save_EvalCoord1f(GLfloat x)5412 save_EvalCoord1f(GLfloat x)
5413 {
5414 GET_CURRENT_CONTEXT(ctx);
5415 Node *n;
5416 SAVE_FLUSH_VERTICES(ctx);
5417 n = alloc_instruction(ctx, OPCODE_EVAL_C1, 1);
5418 if (n) {
5419 n[1].f = x;
5420 }
5421 if (ctx->ExecuteFlag) {
5422 CALL_EvalCoord1f(ctx->Dispatch.Exec, (x));
5423 }
5424 }
5425
5426 static void GLAPIENTRY
save_EvalCoord1fv(const GLfloat * v)5427 save_EvalCoord1fv(const GLfloat * v)
5428 {
5429 save_EvalCoord1f(v[0]);
5430 }
5431
5432 static void GLAPIENTRY
save_EvalCoord2f(GLfloat x,GLfloat y)5433 save_EvalCoord2f(GLfloat x, GLfloat y)
5434 {
5435 GET_CURRENT_CONTEXT(ctx);
5436 Node *n;
5437 SAVE_FLUSH_VERTICES(ctx);
5438 n = alloc_instruction(ctx, OPCODE_EVAL_C2, 2);
5439 if (n) {
5440 n[1].f = x;
5441 n[2].f = y;
5442 }
5443 if (ctx->ExecuteFlag) {
5444 CALL_EvalCoord2f(ctx->Dispatch.Exec, (x, y));
5445 }
5446 }
5447
5448 static void GLAPIENTRY
save_EvalCoord2fv(const GLfloat * v)5449 save_EvalCoord2fv(const GLfloat * v)
5450 {
5451 save_EvalCoord2f(v[0], v[1]);
5452 }
5453
5454
5455 static void GLAPIENTRY
save_EvalPoint1(GLint x)5456 save_EvalPoint1(GLint x)
5457 {
5458 GET_CURRENT_CONTEXT(ctx);
5459 Node *n;
5460 SAVE_FLUSH_VERTICES(ctx);
5461 n = alloc_instruction(ctx, OPCODE_EVAL_P1, 1);
5462 if (n) {
5463 n[1].i = x;
5464 }
5465 if (ctx->ExecuteFlag) {
5466 CALL_EvalPoint1(ctx->Dispatch.Exec, (x));
5467 }
5468 }
5469
5470 static void GLAPIENTRY
save_EvalPoint2(GLint x,GLint y)5471 save_EvalPoint2(GLint x, GLint y)
5472 {
5473 GET_CURRENT_CONTEXT(ctx);
5474 Node *n;
5475 SAVE_FLUSH_VERTICES(ctx);
5476 n = alloc_instruction(ctx, OPCODE_EVAL_P2, 2);
5477 if (n) {
5478 n[1].i = x;
5479 n[2].i = y;
5480 }
5481 if (ctx->ExecuteFlag) {
5482 CALL_EvalPoint2(ctx->Dispatch.Exec, (x, y));
5483 }
5484 }
5485
5486
5487 /**
5488 * Compare 'count' elements of vectors 'a' and 'b'.
5489 * \return GL_TRUE if equal, GL_FALSE if different.
5490 */
5491 static inline GLboolean
compare_vec(const GLfloat * a,const GLfloat * b,GLuint count)5492 compare_vec(const GLfloat *a, const GLfloat *b, GLuint count)
5493 {
5494 return memcmp( a, b, count * sizeof(GLfloat) ) == 0;
5495 }
5496
5497
5498 /**
5499 * This glMaterial function is used for glMaterial calls that are outside
5500 * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
5501 */
5502 static void GLAPIENTRY
save_Materialfv(GLenum face,GLenum pname,const GLfloat * param)5503 save_Materialfv(GLenum face, GLenum pname, const GLfloat * param)
5504 {
5505 GET_CURRENT_CONTEXT(ctx);
5506 Node *n;
5507 int args, i;
5508 GLuint bitmask;
5509
5510 switch (face) {
5511 case GL_BACK:
5512 case GL_FRONT:
5513 case GL_FRONT_AND_BACK:
5514 break;
5515 default:
5516 _mesa_compile_error(ctx, GL_INVALID_ENUM, "glMaterial(face)");
5517 return;
5518 }
5519
5520 switch (pname) {
5521 case GL_EMISSION:
5522 case GL_AMBIENT:
5523 case GL_DIFFUSE:
5524 case GL_SPECULAR:
5525 case GL_AMBIENT_AND_DIFFUSE:
5526 args = 4;
5527 break;
5528 case GL_SHININESS:
5529 args = 1;
5530 break;
5531 case GL_COLOR_INDEXES:
5532 args = 3;
5533 break;
5534 default:
5535 _mesa_compile_error(ctx, GL_INVALID_ENUM, "glMaterial(pname)");
5536 return;
5537 }
5538
5539 if (ctx->ExecuteFlag) {
5540 CALL_Materialfv(ctx->Dispatch.Exec, (face, pname, param));
5541 }
5542
5543 bitmask = _mesa_material_bitmask(ctx, face, pname, ~0, NULL);
5544
5545 /* Try to eliminate redundant statechanges. Because it is legal to
5546 * call glMaterial even inside begin/end calls, don't need to worry
5547 * about ctx->Driver.CurrentSavePrimitive here.
5548 */
5549 for (i = 0; i < MAT_ATTRIB_MAX; i++) {
5550 if (bitmask & (1 << i)) {
5551 if (ctx->ListState.ActiveMaterialSize[i] == args &&
5552 compare_vec(ctx->ListState.CurrentMaterial[i], param, args)) {
5553 /* no change in material value */
5554 bitmask &= ~(1 << i);
5555 }
5556 else {
5557 ctx->ListState.ActiveMaterialSize[i] = args;
5558 COPY_SZ_4V(ctx->ListState.CurrentMaterial[i], args, param);
5559 }
5560 }
5561 }
5562
5563 /* If this call has no effect, return early */
5564 if (bitmask == 0)
5565 return;
5566
5567 SAVE_FLUSH_VERTICES(ctx);
5568
5569 n = alloc_instruction(ctx, OPCODE_MATERIAL, 6);
5570 if (n) {
5571 n[1].e = face;
5572 n[2].e = pname;
5573 for (i = 0; i < args; i++)
5574 n[3 + i].f = param[i];
5575 }
5576 }
5577
5578 static void GLAPIENTRY
save_Begin(GLenum mode)5579 save_Begin(GLenum mode)
5580 {
5581 GET_CURRENT_CONTEXT(ctx);
5582
5583 if (!_mesa_is_valid_prim_mode(ctx, mode)) {
5584 /* compile this error into the display list */
5585 _mesa_compile_error(ctx, GL_INVALID_ENUM, "glBegin(mode)");
5586 }
5587 else if (_mesa_inside_dlist_begin_end(ctx)) {
5588 /* compile this error into the display list */
5589 _mesa_compile_error(ctx, GL_INVALID_OPERATION, "recursive glBegin");
5590 }
5591 else {
5592 ctx->Driver.CurrentSavePrimitive = mode;
5593
5594 vbo_save_NotifyBegin(ctx, mode, false);
5595 }
5596 }
5597
5598 static void GLAPIENTRY
save_End(void)5599 save_End(void)
5600 {
5601 GET_CURRENT_CONTEXT(ctx);
5602 SAVE_FLUSH_VERTICES(ctx);
5603 (void) alloc_instruction(ctx, OPCODE_END, 0);
5604 ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END;
5605 if (ctx->ExecuteFlag) {
5606 CALL_End(ctx->Dispatch.Exec, ());
5607 }
5608 }
5609
5610 static void GLAPIENTRY
save_PrimitiveRestartNV(void)5611 save_PrimitiveRestartNV(void)
5612 {
5613 /* Note: this is used when outside a glBegin/End pair in a display list */
5614 GET_CURRENT_CONTEXT(ctx);
5615 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5616 (void) alloc_instruction(ctx, OPCODE_PRIMITIVE_RESTART_NV, 0);
5617 if (ctx->ExecuteFlag) {
5618 CALL_PrimitiveRestartNV(ctx->Dispatch.Exec, ());
5619 }
5620 }
5621
5622
5623 void GLAPIENTRY
save_BlitFramebuffer(GLint srcX0,GLint srcY0,GLint srcX1,GLint srcY1,GLint dstX0,GLint dstY0,GLint dstX1,GLint dstY1,GLbitfield mask,GLenum filter)5624 save_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
5625 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
5626 GLbitfield mask, GLenum filter)
5627 {
5628 GET_CURRENT_CONTEXT(ctx);
5629 Node *n;
5630 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5631 n = alloc_instruction(ctx, OPCODE_BLIT_FRAMEBUFFER, 10);
5632 if (n) {
5633 n[1].i = srcX0;
5634 n[2].i = srcY0;
5635 n[3].i = srcX1;
5636 n[4].i = srcY1;
5637 n[5].i = dstX0;
5638 n[6].i = dstY0;
5639 n[7].i = dstX1;
5640 n[8].i = dstY1;
5641 n[9].i = mask;
5642 n[10].e = filter;
5643 }
5644 if (ctx->ExecuteFlag) {
5645 CALL_BlitFramebuffer(ctx->Dispatch.Exec, (srcX0, srcY0, srcX1, srcY1,
5646 dstX0, dstY0, dstX1, dstY1,
5647 mask, filter));
5648 }
5649 }
5650
5651
5652 /** GL_EXT_provoking_vertex */
5653 void GLAPIENTRY
save_ProvokingVertex(GLenum mode)5654 save_ProvokingVertex(GLenum mode)
5655 {
5656 GET_CURRENT_CONTEXT(ctx);
5657 Node *n;
5658 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5659 n = alloc_instruction(ctx, OPCODE_PROVOKING_VERTEX, 1);
5660 if (n) {
5661 n[1].e = mode;
5662 }
5663 if (ctx->ExecuteFlag) {
5664 /*CALL_ProvokingVertex(ctx->Dispatch.Exec, (mode));*/
5665 _mesa_ProvokingVertex(mode);
5666 }
5667 }
5668
5669
5670 /** GL_EXT_transform_feedback */
5671 void GLAPIENTRY
save_BeginTransformFeedback(GLenum mode)5672 save_BeginTransformFeedback(GLenum mode)
5673 {
5674 GET_CURRENT_CONTEXT(ctx);
5675 Node *n;
5676 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5677 n = alloc_instruction(ctx, OPCODE_BEGIN_TRANSFORM_FEEDBACK, 1);
5678 if (n) {
5679 n[1].e = mode;
5680 }
5681 if (ctx->ExecuteFlag) {
5682 CALL_BeginTransformFeedback(ctx->Dispatch.Exec, (mode));
5683 }
5684 }
5685
5686
5687 /** GL_EXT_transform_feedback */
5688 void GLAPIENTRY
save_EndTransformFeedback(void)5689 save_EndTransformFeedback(void)
5690 {
5691 GET_CURRENT_CONTEXT(ctx);
5692 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5693 (void) alloc_instruction(ctx, OPCODE_END_TRANSFORM_FEEDBACK, 0);
5694 if (ctx->ExecuteFlag) {
5695 CALL_EndTransformFeedback(ctx->Dispatch.Exec, ());
5696 }
5697 }
5698
5699 void GLAPIENTRY
save_BindTransformFeedback(GLenum target,GLuint name)5700 save_BindTransformFeedback(GLenum target, GLuint name)
5701 {
5702 GET_CURRENT_CONTEXT(ctx);
5703 Node *n;
5704 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5705 n = alloc_instruction(ctx, OPCODE_BIND_TRANSFORM_FEEDBACK, 2);
5706 if (n) {
5707 n[1].e = target;
5708 n[2].ui = name;
5709 }
5710 if (ctx->ExecuteFlag) {
5711 CALL_BindTransformFeedback(ctx->Dispatch.Exec, (target, name));
5712 }
5713 }
5714
5715 void GLAPIENTRY
save_PauseTransformFeedback(void)5716 save_PauseTransformFeedback(void)
5717 {
5718 GET_CURRENT_CONTEXT(ctx);
5719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5720 (void) alloc_instruction(ctx, OPCODE_PAUSE_TRANSFORM_FEEDBACK, 0);
5721 if (ctx->ExecuteFlag) {
5722 CALL_PauseTransformFeedback(ctx->Dispatch.Exec, ());
5723 }
5724 }
5725
5726 void GLAPIENTRY
save_ResumeTransformFeedback(void)5727 save_ResumeTransformFeedback(void)
5728 {
5729 GET_CURRENT_CONTEXT(ctx);
5730 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5731 (void) alloc_instruction(ctx, OPCODE_RESUME_TRANSFORM_FEEDBACK, 0);
5732 if (ctx->ExecuteFlag) {
5733 CALL_ResumeTransformFeedback(ctx->Dispatch.Exec, ());
5734 }
5735 }
5736
5737 void GLAPIENTRY
save_DrawTransformFeedback(GLenum mode,GLuint name)5738 save_DrawTransformFeedback(GLenum mode, GLuint name)
5739 {
5740 GET_CURRENT_CONTEXT(ctx);
5741 Node *n;
5742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5743 n = alloc_instruction(ctx, OPCODE_DRAW_TRANSFORM_FEEDBACK, 2);
5744 if (n) {
5745 n[1].e = mode;
5746 n[2].ui = name;
5747 }
5748 if (ctx->ExecuteFlag) {
5749 CALL_DrawTransformFeedback(ctx->Dispatch.Exec, (mode, name));
5750 }
5751 }
5752
5753 void GLAPIENTRY
save_DrawTransformFeedbackStream(GLenum mode,GLuint name,GLuint stream)5754 save_DrawTransformFeedbackStream(GLenum mode, GLuint name, GLuint stream)
5755 {
5756 GET_CURRENT_CONTEXT(ctx);
5757 Node *n;
5758 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5759 n = alloc_instruction(ctx, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM, 3);
5760 if (n) {
5761 n[1].e = mode;
5762 n[2].ui = name;
5763 n[3].ui = stream;
5764 }
5765 if (ctx->ExecuteFlag) {
5766 CALL_DrawTransformFeedbackStream(ctx->Dispatch.Exec, (mode, name, stream));
5767 }
5768 }
5769
5770 void GLAPIENTRY
save_DrawTransformFeedbackInstanced(GLenum mode,GLuint name,GLsizei primcount)5771 save_DrawTransformFeedbackInstanced(GLenum mode, GLuint name,
5772 GLsizei primcount)
5773 {
5774 GET_CURRENT_CONTEXT(ctx);
5775 Node *n;
5776 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5777 n = alloc_instruction(ctx, OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED, 3);
5778 if (n) {
5779 n[1].e = mode;
5780 n[2].ui = name;
5781 n[3].si = primcount;
5782 }
5783 if (ctx->ExecuteFlag) {
5784 CALL_DrawTransformFeedbackInstanced(ctx->Dispatch.Exec, (mode, name, primcount));
5785 }
5786 }
5787
5788 void GLAPIENTRY
save_DrawTransformFeedbackStreamInstanced(GLenum mode,GLuint name,GLuint stream,GLsizei primcount)5789 save_DrawTransformFeedbackStreamInstanced(GLenum mode, GLuint name,
5790 GLuint stream, GLsizei primcount)
5791 {
5792 GET_CURRENT_CONTEXT(ctx);
5793 Node *n;
5794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5795 n = alloc_instruction(ctx, OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED, 4);
5796 if (n) {
5797 n[1].e = mode;
5798 n[2].ui = name;
5799 n[3].ui = stream;
5800 n[4].si = primcount;
5801 }
5802 if (ctx->ExecuteFlag) {
5803 CALL_DrawTransformFeedbackStreamInstanced(ctx->Dispatch.Exec, (mode, name, stream,
5804 primcount));
5805 }
5806 }
5807
5808 void GLAPIENTRY
save_DispatchCompute(GLuint num_groups_x,GLuint num_groups_y,GLuint num_groups_z)5809 save_DispatchCompute(GLuint num_groups_x, GLuint num_groups_y,
5810 GLuint num_groups_z)
5811 {
5812 GET_CURRENT_CONTEXT(ctx);
5813 Node *n;
5814 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
5815 n = alloc_instruction(ctx, OPCODE_DISPATCH_COMPUTE, 3);
5816 if (n) {
5817 n[1].ui = num_groups_x;
5818 n[2].ui = num_groups_y;
5819 n[3].ui = num_groups_z;
5820 }
5821 if (ctx->ExecuteFlag) {
5822 CALL_DispatchCompute(ctx->Dispatch.Exec, (num_groups_x, num_groups_y,
5823 num_groups_z));
5824 }
5825 }
5826
5827 void GLAPIENTRY
save_DispatchComputeIndirect(GLintptr indirect)5828 save_DispatchComputeIndirect(GLintptr indirect)
5829 {
5830 GET_CURRENT_CONTEXT(ctx);
5831 _mesa_error(ctx, GL_INVALID_OPERATION,
5832 "glDispatchComputeIndirect() during display list compile");
5833 }
5834
5835 static void ALWAYS_INLINE
save_Attr32bit(struct gl_context * ctx,unsigned attr,unsigned size,GLenum type,uint32_t x,uint32_t y,uint32_t z,uint32_t w)5836 save_Attr32bit(struct gl_context *ctx, unsigned attr, unsigned size,
5837 GLenum type, uint32_t x, uint32_t y, uint32_t z, uint32_t w)
5838 {
5839 Node *n;
5840 SAVE_FLUSH_VERTICES(ctx);
5841 unsigned base_op;
5842 unsigned index = attr;
5843
5844 /* We don't care about GL_INT vs GL_UNSIGNED_INT. The idea is to get W=1
5845 * right for 3 or lower number of components, so only distinguish between
5846 * FLOAT and INT.
5847 */
5848 if (type == GL_FLOAT) {
5849 if (VERT_BIT(attr) & VERT_BIT_GENERIC_ALL) {
5850 base_op = OPCODE_ATTR_1F_ARB;
5851 attr -= VERT_ATTRIB_GENERIC0;
5852 } else {
5853 base_op = OPCODE_ATTR_1F_NV;
5854 }
5855 } else {
5856 base_op = OPCODE_ATTR_1I;
5857 attr -= VERT_ATTRIB_GENERIC0;
5858 }
5859
5860 n = alloc_instruction(ctx, base_op + size - 1, 1 + size);
5861 if (n) {
5862 n[1].ui = attr;
5863 n[2].ui = x;
5864 if (size >= 2) n[3].ui = y;
5865 if (size >= 3) n[4].ui = z;
5866 if (size >= 4) n[5].ui = w;
5867 }
5868
5869 ctx->ListState.ActiveAttribSize[index] = size;
5870 ASSIGN_4V(ctx->ListState.CurrentAttrib[index], x, y, z, w);
5871
5872 if (ctx->ExecuteFlag) {
5873 if (type == GL_FLOAT) {
5874 if (base_op == OPCODE_ATTR_1F_NV) {
5875 if (size == 4)
5876 CALL_VertexAttrib4fNV(ctx->Dispatch.Exec, (attr, uif(x), uif(y), uif(z), uif(w)));
5877 else if (size == 3)
5878 CALL_VertexAttrib3fNV(ctx->Dispatch.Exec, (attr, uif(x), uif(y), uif(z)));
5879 else if (size == 2)
5880 CALL_VertexAttrib2fNV(ctx->Dispatch.Exec, (attr, uif(x), uif(y)));
5881 else
5882 CALL_VertexAttrib1fNV(ctx->Dispatch.Exec, (attr, uif(x)));
5883 } else {
5884 if (size == 4)
5885 CALL_VertexAttrib4fARB(ctx->Dispatch.Exec, (attr, uif(x), uif(y), uif(z), uif(w)));
5886 else if (size == 3)
5887 CALL_VertexAttrib3fARB(ctx->Dispatch.Exec, (attr, uif(x), uif(y), uif(z)));
5888 else if (size == 2)
5889 CALL_VertexAttrib2fARB(ctx->Dispatch.Exec, (attr, uif(x), uif(y)));
5890 else
5891 CALL_VertexAttrib1fARB(ctx->Dispatch.Exec, (attr, uif(x)));
5892 }
5893 } else {
5894 if (size == 4)
5895 CALL_VertexAttribI4iEXT(ctx->Dispatch.Exec, (attr, x, y, z, w));
5896 else if (size == 3)
5897 CALL_VertexAttribI3iEXT(ctx->Dispatch.Exec, (attr, x, y, z));
5898 else if (size == 2)
5899 CALL_VertexAttribI2iEXT(ctx->Dispatch.Exec, (attr, x, y));
5900 else
5901 CALL_VertexAttribI1iEXT(ctx->Dispatch.Exec, (attr, x));
5902 }
5903 }
5904 }
5905
5906 static void ALWAYS_INLINE
save_Attr64bit(struct gl_context * ctx,unsigned attr,unsigned size,GLenum type,uint64_t x,uint64_t y,uint64_t z,uint64_t w)5907 save_Attr64bit(struct gl_context *ctx, unsigned attr, unsigned size,
5908 GLenum type, uint64_t x, uint64_t y, uint64_t z, uint64_t w)
5909 {
5910 Node *n;
5911 SAVE_FLUSH_VERTICES(ctx);
5912 unsigned base_op;
5913 unsigned index = attr;
5914
5915 if (type == GL_DOUBLE) {
5916 base_op = OPCODE_ATTR_1D;
5917 } else {
5918 base_op = OPCODE_ATTR_1UI64;
5919 assert(size == 1);
5920 }
5921
5922 attr -= VERT_ATTRIB_GENERIC0;
5923 n = alloc_instruction(ctx, base_op + size - 1, 1 + size * 2);
5924 if (n) {
5925 n[1].ui = attr;
5926 ASSIGN_UINT64_TO_NODES(n, 2, x);
5927 if (size >= 2) ASSIGN_UINT64_TO_NODES(n, 4, y);
5928 if (size >= 3) ASSIGN_UINT64_TO_NODES(n, 6, z);
5929 if (size >= 4) ASSIGN_UINT64_TO_NODES(n, 8, w);
5930 }
5931
5932 ctx->ListState.ActiveAttribSize[index] = size;
5933 memcpy(ctx->ListState.CurrentAttrib[index], &n[2], size * sizeof(uint64_t));
5934
5935 if (ctx->ExecuteFlag) {
5936 uint64_t v[] = {x, y, z, w};
5937 if (type == GL_DOUBLE) {
5938 if (size == 4)
5939 CALL_VertexAttribL4dv(ctx->Dispatch.Exec, (attr, (GLdouble*)v));
5940 else if (size == 3)
5941 CALL_VertexAttribL3dv(ctx->Dispatch.Exec, (attr, (GLdouble*)v));
5942 else if (size == 2)
5943 CALL_VertexAttribL2dv(ctx->Dispatch.Exec, (attr, (GLdouble*)v));
5944 else
5945 CALL_VertexAttribL1d(ctx->Dispatch.Exec, (attr, UINT64_AS_DOUBLE(x)));
5946 } else {
5947 CALL_VertexAttribL1ui64ARB(ctx->Dispatch.Exec, (attr, x));
5948 }
5949 }
5950 }
5951
5952 /**
5953 * If index=0, does glVertexAttrib*() alias glVertex() to emit a vertex?
5954 * It depends on a few things, including whether we're inside or outside
5955 * of glBegin/glEnd.
5956 */
5957 static inline bool
is_vertex_position(const struct gl_context * ctx,GLuint index)5958 is_vertex_position(const struct gl_context *ctx, GLuint index)
5959 {
5960 return (index == 0 &&
5961 _mesa_attr_zero_aliases_vertex(ctx) &&
5962 _mesa_inside_dlist_begin_end(ctx));
5963 }
5964
5965 /**
5966 * This macro is used to implement all the glVertex, glColor, glTexCoord,
5967 * glVertexAttrib, etc functions.
5968 * \param A VBO_ATTRIB_x attribute index
5969 * \param N attribute size (1..4)
5970 * \param T type (GL_FLOAT, GL_DOUBLE, GL_INT, GL_UNSIGNED_INT)
5971 * \param C cast type (uint32_t or uint64_t)
5972 * \param V0, V1, v2, V3 attribute value
5973 */
5974 #define ATTR_UNION(A, N, T, C, V0, V1, V2, V3) \
5975 do { \
5976 if (sizeof(C) == 4) { \
5977 save_Attr32bit(ctx, A, N, T, V0, V1, V2, V3); \
5978 } else { \
5979 save_Attr64bit(ctx, A, N, T, V0, V1, V2, V3); \
5980 } \
5981 } while (0)
5982
5983 #undef ERROR
5984 #define ERROR(err) _mesa_error(ctx, err, __func__)
5985 #define TAG(x) save_##x
5986
5987 #define VBO_ATTRIB_POS VERT_ATTRIB_POS
5988 #define VBO_ATTRIB_NORMAL VERT_ATTRIB_NORMAL
5989 #define VBO_ATTRIB_COLOR0 VERT_ATTRIB_COLOR0
5990 #define VBO_ATTRIB_COLOR1 VERT_ATTRIB_COLOR1
5991 #define VBO_ATTRIB_FOG VERT_ATTRIB_FOG
5992 #define VBO_ATTRIB_COLOR_INDEX VERT_ATTRIB_COLOR_INDEX
5993 #define VBO_ATTRIB_EDGEFLAG VERT_ATTRIB_EDGEFLAG
5994 #define VBO_ATTRIB_TEX0 VERT_ATTRIB_TEX0
5995 #define VBO_ATTRIB_GENERIC0 VERT_ATTRIB_GENERIC0
5996 #define VBO_ATTRIB_MAX VERT_ATTRIB_MAX
5997
5998 #include "vbo/vbo_attrib_tmp.h"
5999
6000 void GLAPIENTRY
save_UseProgram(GLuint program)6001 save_UseProgram(GLuint program)
6002 {
6003 GET_CURRENT_CONTEXT(ctx);
6004 Node *n;
6005 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6006 n = alloc_instruction(ctx, OPCODE_USE_PROGRAM, 1);
6007 if (n) {
6008 n[1].ui = program;
6009 }
6010 if (ctx->ExecuteFlag) {
6011 CALL_UseProgram(ctx->Dispatch.Exec, (program));
6012 }
6013 }
6014
6015
6016 void GLAPIENTRY
save_Uniform1f(GLint location,GLfloat x)6017 save_Uniform1f(GLint location, GLfloat x)
6018 {
6019 GET_CURRENT_CONTEXT(ctx);
6020 Node *n;
6021 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6022 n = alloc_instruction(ctx, OPCODE_UNIFORM_1F, 2);
6023 if (n) {
6024 n[1].i = location;
6025 n[2].f = x;
6026 }
6027 if (ctx->ExecuteFlag) {
6028 CALL_Uniform1f(ctx->Dispatch.Exec, (location, x));
6029 }
6030 }
6031
6032
6033 void GLAPIENTRY
save_Uniform2f(GLint location,GLfloat x,GLfloat y)6034 save_Uniform2f(GLint location, GLfloat x, GLfloat y)
6035 {
6036 GET_CURRENT_CONTEXT(ctx);
6037 Node *n;
6038 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6039 n = alloc_instruction(ctx, OPCODE_UNIFORM_2F, 3);
6040 if (n) {
6041 n[1].i = location;
6042 n[2].f = x;
6043 n[3].f = y;
6044 }
6045 if (ctx->ExecuteFlag) {
6046 CALL_Uniform2f(ctx->Dispatch.Exec, (location, x, y));
6047 }
6048 }
6049
6050
6051 void GLAPIENTRY
save_Uniform3f(GLint location,GLfloat x,GLfloat y,GLfloat z)6052 save_Uniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
6053 {
6054 GET_CURRENT_CONTEXT(ctx);
6055 Node *n;
6056 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6057 n = alloc_instruction(ctx, OPCODE_UNIFORM_3F, 4);
6058 if (n) {
6059 n[1].i = location;
6060 n[2].f = x;
6061 n[3].f = y;
6062 n[4].f = z;
6063 }
6064 if (ctx->ExecuteFlag) {
6065 CALL_Uniform3f(ctx->Dispatch.Exec, (location, x, y, z));
6066 }
6067 }
6068
6069
6070 void GLAPIENTRY
save_Uniform4f(GLint location,GLfloat x,GLfloat y,GLfloat z,GLfloat w)6071 save_Uniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
6072 {
6073 GET_CURRENT_CONTEXT(ctx);
6074 Node *n;
6075 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6076 n = alloc_instruction(ctx, OPCODE_UNIFORM_4F, 5);
6077 if (n) {
6078 n[1].i = location;
6079 n[2].f = x;
6080 n[3].f = y;
6081 n[4].f = z;
6082 n[5].f = w;
6083 }
6084 if (ctx->ExecuteFlag) {
6085 CALL_Uniform4f(ctx->Dispatch.Exec, (location, x, y, z, w));
6086 }
6087 }
6088
6089
6090 void GLAPIENTRY
save_Uniform1fv(GLint location,GLsizei count,const GLfloat * v)6091 save_Uniform1fv(GLint location, GLsizei count, const GLfloat *v)
6092 {
6093 GET_CURRENT_CONTEXT(ctx);
6094 Node *n;
6095 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6096 n = alloc_instruction(ctx, OPCODE_UNIFORM_1FV, 2 + POINTER_DWORDS);
6097 if (n) {
6098 n[1].i = location;
6099 n[2].i = count;
6100 save_pointer(&n[3], memdup(v, count * 1 * sizeof(GLfloat)));
6101 }
6102 if (ctx->ExecuteFlag) {
6103 CALL_Uniform1fv(ctx->Dispatch.Exec, (location, count, v));
6104 }
6105 }
6106
6107 void GLAPIENTRY
save_Uniform2fv(GLint location,GLsizei count,const GLfloat * v)6108 save_Uniform2fv(GLint location, GLsizei count, const GLfloat *v)
6109 {
6110 GET_CURRENT_CONTEXT(ctx);
6111 Node *n;
6112 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6113 n = alloc_instruction(ctx, OPCODE_UNIFORM_2FV, 2 + POINTER_DWORDS);
6114 if (n) {
6115 n[1].i = location;
6116 n[2].i = count;
6117 save_pointer(&n[3], memdup(v, count * 2 * sizeof(GLfloat)));
6118 }
6119 if (ctx->ExecuteFlag) {
6120 CALL_Uniform2fv(ctx->Dispatch.Exec, (location, count, v));
6121 }
6122 }
6123
6124 void GLAPIENTRY
save_Uniform3fv(GLint location,GLsizei count,const GLfloat * v)6125 save_Uniform3fv(GLint location, GLsizei count, const GLfloat *v)
6126 {
6127 GET_CURRENT_CONTEXT(ctx);
6128 Node *n;
6129 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6130 n = alloc_instruction(ctx, OPCODE_UNIFORM_3FV, 2 + POINTER_DWORDS);
6131 if (n) {
6132 n[1].i = location;
6133 n[2].i = count;
6134 save_pointer(&n[3], memdup(v, count * 3 * sizeof(GLfloat)));
6135 }
6136 if (ctx->ExecuteFlag) {
6137 CALL_Uniform3fv(ctx->Dispatch.Exec, (location, count, v));
6138 }
6139 }
6140
6141 void GLAPIENTRY
save_Uniform4fv(GLint location,GLsizei count,const GLfloat * v)6142 save_Uniform4fv(GLint location, GLsizei count, const GLfloat *v)
6143 {
6144 GET_CURRENT_CONTEXT(ctx);
6145 Node *n;
6146 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6147 n = alloc_instruction(ctx, OPCODE_UNIFORM_4FV, 2 + POINTER_DWORDS);
6148 if (n) {
6149 n[1].i = location;
6150 n[2].i = count;
6151 save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLfloat)));
6152 }
6153 if (ctx->ExecuteFlag) {
6154 CALL_Uniform4fv(ctx->Dispatch.Exec, (location, count, v));
6155 }
6156 }
6157
6158
6159 void GLAPIENTRY
save_Uniform1d(GLint location,GLdouble x)6160 save_Uniform1d(GLint location, GLdouble x)
6161 {
6162 GET_CURRENT_CONTEXT(ctx);
6163 Node *n;
6164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6165 n = alloc_instruction(ctx, OPCODE_UNIFORM_1D, 3);
6166 if (n) {
6167 n[1].i = location;
6168 ASSIGN_DOUBLE_TO_NODES(n, 2, x);
6169 }
6170 if (ctx->ExecuteFlag) {
6171 CALL_Uniform1d(ctx->Dispatch.Exec, (location, x));
6172 }
6173 }
6174
6175
6176 void GLAPIENTRY
save_Uniform2d(GLint location,GLdouble x,GLdouble y)6177 save_Uniform2d(GLint location, GLdouble x, GLdouble y)
6178 {
6179 GET_CURRENT_CONTEXT(ctx);
6180 Node *n;
6181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6182 n = alloc_instruction(ctx, OPCODE_UNIFORM_2D, 5);
6183 if (n) {
6184 n[1].i = location;
6185 ASSIGN_DOUBLE_TO_NODES(n, 2, x);
6186 ASSIGN_DOUBLE_TO_NODES(n, 4, y);
6187 }
6188 if (ctx->ExecuteFlag) {
6189 CALL_Uniform2d(ctx->Dispatch.Exec, (location, x, y));
6190 }
6191 }
6192
6193
6194 void GLAPIENTRY
save_Uniform3d(GLint location,GLdouble x,GLdouble y,GLdouble z)6195 save_Uniform3d(GLint location, GLdouble x, GLdouble y, GLdouble z)
6196 {
6197 GET_CURRENT_CONTEXT(ctx);
6198 Node *n;
6199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6200 n = alloc_instruction(ctx, OPCODE_UNIFORM_3D, 7);
6201 if (n) {
6202 n[1].i = location;
6203 ASSIGN_DOUBLE_TO_NODES(n, 2, x);
6204 ASSIGN_DOUBLE_TO_NODES(n, 4, y);
6205 ASSIGN_DOUBLE_TO_NODES(n, 6, z);
6206 }
6207 if (ctx->ExecuteFlag) {
6208 CALL_Uniform3d(ctx->Dispatch.Exec, (location, x, y, z));
6209 }
6210 }
6211
6212
6213 void GLAPIENTRY
save_Uniform4d(GLint location,GLdouble x,GLdouble y,GLdouble z,GLdouble w)6214 save_Uniform4d(GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
6215 {
6216 GET_CURRENT_CONTEXT(ctx);
6217 Node *n;
6218 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6219 n = alloc_instruction(ctx, OPCODE_UNIFORM_4D, 9);
6220 if (n) {
6221 n[1].i = location;
6222 ASSIGN_DOUBLE_TO_NODES(n, 2, x);
6223 ASSIGN_DOUBLE_TO_NODES(n, 4, y);
6224 ASSIGN_DOUBLE_TO_NODES(n, 6, z);
6225 ASSIGN_DOUBLE_TO_NODES(n, 8, w);
6226 }
6227 if (ctx->ExecuteFlag) {
6228 CALL_Uniform4d(ctx->Dispatch.Exec, (location, x, y, z, w));
6229 }
6230 }
6231
6232
6233 void GLAPIENTRY
save_Uniform1dv(GLint location,GLsizei count,const GLdouble * v)6234 save_Uniform1dv(GLint location, GLsizei count, const GLdouble *v)
6235 {
6236 GET_CURRENT_CONTEXT(ctx);
6237 Node *n;
6238 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6239 n = alloc_instruction(ctx, OPCODE_UNIFORM_1DV, 2 + POINTER_DWORDS);
6240 if (n) {
6241 n[1].i = location;
6242 n[2].i = count;
6243 save_pointer(&n[3], memdup(v, count * 1 * sizeof(GLdouble)));
6244 }
6245 if (ctx->ExecuteFlag) {
6246 CALL_Uniform1dv(ctx->Dispatch.Exec, (location, count, v));
6247 }
6248 }
6249
6250
6251 void GLAPIENTRY
save_Uniform2dv(GLint location,GLsizei count,const GLdouble * v)6252 save_Uniform2dv(GLint location, GLsizei count, const GLdouble *v)
6253 {
6254 GET_CURRENT_CONTEXT(ctx);
6255 Node *n;
6256 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6257 n = alloc_instruction(ctx, OPCODE_UNIFORM_2DV, 2 + POINTER_DWORDS);
6258 if (n) {
6259 n[1].i = location;
6260 n[2].i = count;
6261 save_pointer(&n[3], memdup(v, count * 2 * sizeof(GLdouble)));
6262 }
6263 if (ctx->ExecuteFlag) {
6264 CALL_Uniform2dv(ctx->Dispatch.Exec, (location, count, v));
6265 }
6266 }
6267
6268
6269 void GLAPIENTRY
save_Uniform3dv(GLint location,GLsizei count,const GLdouble * v)6270 save_Uniform3dv(GLint location, GLsizei count, const GLdouble *v)
6271 {
6272 GET_CURRENT_CONTEXT(ctx);
6273 Node *n;
6274 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6275 n = alloc_instruction(ctx, OPCODE_UNIFORM_3DV, 2 + POINTER_DWORDS);
6276 if (n) {
6277 n[1].i = location;
6278 n[2].i = count;
6279 save_pointer(&n[3], memdup(v, count * 3 * sizeof(GLdouble)));
6280 }
6281 if (ctx->ExecuteFlag) {
6282 CALL_Uniform3dv(ctx->Dispatch.Exec, (location, count, v));
6283 }
6284 }
6285
6286
6287 void GLAPIENTRY
save_Uniform4dv(GLint location,GLsizei count,const GLdouble * v)6288 save_Uniform4dv(GLint location, GLsizei count, const GLdouble *v)
6289 {
6290 GET_CURRENT_CONTEXT(ctx);
6291 Node *n;
6292 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6293 n = alloc_instruction(ctx, OPCODE_UNIFORM_4DV, 2 + POINTER_DWORDS);
6294 if (n) {
6295 n[1].i = location;
6296 n[2].i = count;
6297 save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLdouble)));
6298 }
6299 if (ctx->ExecuteFlag) {
6300 CALL_Uniform4dv(ctx->Dispatch.Exec, (location, count, v));
6301 }
6302 }
6303
6304
6305 void GLAPIENTRY
save_Uniform1i(GLint location,GLint x)6306 save_Uniform1i(GLint location, GLint x)
6307 {
6308 GET_CURRENT_CONTEXT(ctx);
6309 Node *n;
6310 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6311 n = alloc_instruction(ctx, OPCODE_UNIFORM_1I, 2);
6312 if (n) {
6313 n[1].i = location;
6314 n[2].i = x;
6315 }
6316 if (ctx->ExecuteFlag) {
6317 CALL_Uniform1i(ctx->Dispatch.Exec, (location, x));
6318 }
6319 }
6320
6321 void GLAPIENTRY
save_Uniform2i(GLint location,GLint x,GLint y)6322 save_Uniform2i(GLint location, GLint x, GLint y)
6323 {
6324 GET_CURRENT_CONTEXT(ctx);
6325 Node *n;
6326 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6327 n = alloc_instruction(ctx, OPCODE_UNIFORM_2I, 3);
6328 if (n) {
6329 n[1].i = location;
6330 n[2].i = x;
6331 n[3].i = y;
6332 }
6333 if (ctx->ExecuteFlag) {
6334 CALL_Uniform2i(ctx->Dispatch.Exec, (location, x, y));
6335 }
6336 }
6337
6338 void GLAPIENTRY
save_Uniform3i(GLint location,GLint x,GLint y,GLint z)6339 save_Uniform3i(GLint location, GLint x, GLint y, GLint z)
6340 {
6341 GET_CURRENT_CONTEXT(ctx);
6342 Node *n;
6343 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6344 n = alloc_instruction(ctx, OPCODE_UNIFORM_3I, 4);
6345 if (n) {
6346 n[1].i = location;
6347 n[2].i = x;
6348 n[3].i = y;
6349 n[4].i = z;
6350 }
6351 if (ctx->ExecuteFlag) {
6352 CALL_Uniform3i(ctx->Dispatch.Exec, (location, x, y, z));
6353 }
6354 }
6355
6356 void GLAPIENTRY
save_Uniform4i(GLint location,GLint x,GLint y,GLint z,GLint w)6357 save_Uniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
6358 {
6359 GET_CURRENT_CONTEXT(ctx);
6360 Node *n;
6361 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6362 n = alloc_instruction(ctx, OPCODE_UNIFORM_4I, 5);
6363 if (n) {
6364 n[1].i = location;
6365 n[2].i = x;
6366 n[3].i = y;
6367 n[4].i = z;
6368 n[5].i = w;
6369 }
6370 if (ctx->ExecuteFlag) {
6371 CALL_Uniform4i(ctx->Dispatch.Exec, (location, x, y, z, w));
6372 }
6373 }
6374
6375
6376
6377 void GLAPIENTRY
save_Uniform1iv(GLint location,GLsizei count,const GLint * v)6378 save_Uniform1iv(GLint location, GLsizei count, const GLint *v)
6379 {
6380 GET_CURRENT_CONTEXT(ctx);
6381 Node *n;
6382 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6383 n = alloc_instruction(ctx, OPCODE_UNIFORM_1IV, 2 + POINTER_DWORDS);
6384 if (n) {
6385 n[1].i = location;
6386 n[2].i = count;
6387 save_pointer(&n[3], memdup(v, count * 1 * sizeof(GLint)));
6388 }
6389 if (ctx->ExecuteFlag) {
6390 CALL_Uniform1iv(ctx->Dispatch.Exec, (location, count, v));
6391 }
6392 }
6393
6394 void GLAPIENTRY
save_Uniform2iv(GLint location,GLsizei count,const GLint * v)6395 save_Uniform2iv(GLint location, GLsizei count, const GLint *v)
6396 {
6397 GET_CURRENT_CONTEXT(ctx);
6398 Node *n;
6399 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6400 n = alloc_instruction(ctx, OPCODE_UNIFORM_2IV, 2 + POINTER_DWORDS);
6401 if (n) {
6402 n[1].i = location;
6403 n[2].i = count;
6404 save_pointer(&n[3], memdup(v, count * 2 * sizeof(GLint)));
6405 }
6406 if (ctx->ExecuteFlag) {
6407 CALL_Uniform2iv(ctx->Dispatch.Exec, (location, count, v));
6408 }
6409 }
6410
6411 void GLAPIENTRY
save_Uniform3iv(GLint location,GLsizei count,const GLint * v)6412 save_Uniform3iv(GLint location, GLsizei count, const GLint *v)
6413 {
6414 GET_CURRENT_CONTEXT(ctx);
6415 Node *n;
6416 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6417 n = alloc_instruction(ctx, OPCODE_UNIFORM_3IV, 2 + POINTER_DWORDS);
6418 if (n) {
6419 n[1].i = location;
6420 n[2].i = count;
6421 save_pointer(&n[3], memdup(v, count * 3 * sizeof(GLint)));
6422 }
6423 if (ctx->ExecuteFlag) {
6424 CALL_Uniform3iv(ctx->Dispatch.Exec, (location, count, v));
6425 }
6426 }
6427
6428 void GLAPIENTRY
save_Uniform4iv(GLint location,GLsizei count,const GLint * v)6429 save_Uniform4iv(GLint location, GLsizei count, const GLint *v)
6430 {
6431 GET_CURRENT_CONTEXT(ctx);
6432 Node *n;
6433 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6434 n = alloc_instruction(ctx, OPCODE_UNIFORM_4IV, 2 + POINTER_DWORDS);
6435 if (n) {
6436 n[1].i = location;
6437 n[2].i = count;
6438 save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLfloat)));
6439 }
6440 if (ctx->ExecuteFlag) {
6441 CALL_Uniform4iv(ctx->Dispatch.Exec, (location, count, v));
6442 }
6443 }
6444
6445
6446
6447 void GLAPIENTRY
save_Uniform1ui(GLint location,GLuint x)6448 save_Uniform1ui(GLint location, GLuint x)
6449 {
6450 GET_CURRENT_CONTEXT(ctx);
6451 Node *n;
6452 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6453 n = alloc_instruction(ctx, OPCODE_UNIFORM_1UI, 2);
6454 if (n) {
6455 n[1].i = location;
6456 n[2].i = x;
6457 }
6458 if (ctx->ExecuteFlag) {
6459 CALL_Uniform1ui(ctx->Dispatch.Exec, (location, x));
6460 }
6461 }
6462
6463 void GLAPIENTRY
save_Uniform2ui(GLint location,GLuint x,GLuint y)6464 save_Uniform2ui(GLint location, GLuint x, GLuint y)
6465 {
6466 GET_CURRENT_CONTEXT(ctx);
6467 Node *n;
6468 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6469 n = alloc_instruction(ctx, OPCODE_UNIFORM_2UI, 3);
6470 if (n) {
6471 n[1].i = location;
6472 n[2].i = x;
6473 n[3].i = y;
6474 }
6475 if (ctx->ExecuteFlag) {
6476 CALL_Uniform2ui(ctx->Dispatch.Exec, (location, x, y));
6477 }
6478 }
6479
6480 void GLAPIENTRY
save_Uniform3ui(GLint location,GLuint x,GLuint y,GLuint z)6481 save_Uniform3ui(GLint location, GLuint x, GLuint y, GLuint z)
6482 {
6483 GET_CURRENT_CONTEXT(ctx);
6484 Node *n;
6485 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6486 n = alloc_instruction(ctx, OPCODE_UNIFORM_3UI, 4);
6487 if (n) {
6488 n[1].i = location;
6489 n[2].i = x;
6490 n[3].i = y;
6491 n[4].i = z;
6492 }
6493 if (ctx->ExecuteFlag) {
6494 CALL_Uniform3ui(ctx->Dispatch.Exec, (location, x, y, z));
6495 }
6496 }
6497
6498 void GLAPIENTRY
save_Uniform4ui(GLint location,GLuint x,GLuint y,GLuint z,GLuint w)6499 save_Uniform4ui(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)
6500 {
6501 GET_CURRENT_CONTEXT(ctx);
6502 Node *n;
6503 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6504 n = alloc_instruction(ctx, OPCODE_UNIFORM_4UI, 5);
6505 if (n) {
6506 n[1].i = location;
6507 n[2].i = x;
6508 n[3].i = y;
6509 n[4].i = z;
6510 n[5].i = w;
6511 }
6512 if (ctx->ExecuteFlag) {
6513 CALL_Uniform4ui(ctx->Dispatch.Exec, (location, x, y, z, w));
6514 }
6515 }
6516
6517
6518
6519 void GLAPIENTRY
save_Uniform1uiv(GLint location,GLsizei count,const GLuint * v)6520 save_Uniform1uiv(GLint location, GLsizei count, const GLuint *v)
6521 {
6522 GET_CURRENT_CONTEXT(ctx);
6523 Node *n;
6524 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6525 n = alloc_instruction(ctx, OPCODE_UNIFORM_1UIV, 2 + POINTER_DWORDS);
6526 if (n) {
6527 n[1].i = location;
6528 n[2].i = count;
6529 save_pointer(&n[3], memdup(v, count * 1 * sizeof(*v)));
6530 }
6531 if (ctx->ExecuteFlag) {
6532 CALL_Uniform1uiv(ctx->Dispatch.Exec, (location, count, v));
6533 }
6534 }
6535
6536 void GLAPIENTRY
save_Uniform2uiv(GLint location,GLsizei count,const GLuint * v)6537 save_Uniform2uiv(GLint location, GLsizei count, const GLuint *v)
6538 {
6539 GET_CURRENT_CONTEXT(ctx);
6540 Node *n;
6541 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6542 n = alloc_instruction(ctx, OPCODE_UNIFORM_2UIV, 2 + POINTER_DWORDS);
6543 if (n) {
6544 n[1].i = location;
6545 n[2].i = count;
6546 save_pointer(&n[3], memdup(v, count * 2 * sizeof(*v)));
6547 }
6548 if (ctx->ExecuteFlag) {
6549 CALL_Uniform2uiv(ctx->Dispatch.Exec, (location, count, v));
6550 }
6551 }
6552
6553 void GLAPIENTRY
save_Uniform3uiv(GLint location,GLsizei count,const GLuint * v)6554 save_Uniform3uiv(GLint location, GLsizei count, const GLuint *v)
6555 {
6556 GET_CURRENT_CONTEXT(ctx);
6557 Node *n;
6558 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6559 n = alloc_instruction(ctx, OPCODE_UNIFORM_3UIV, 2 + POINTER_DWORDS);
6560 if (n) {
6561 n[1].i = location;
6562 n[2].i = count;
6563 save_pointer(&n[3], memdup(v, count * 3 * sizeof(*v)));
6564 }
6565 if (ctx->ExecuteFlag) {
6566 CALL_Uniform3uiv(ctx->Dispatch.Exec, (location, count, v));
6567 }
6568 }
6569
6570 void GLAPIENTRY
save_Uniform4uiv(GLint location,GLsizei count,const GLuint * v)6571 save_Uniform4uiv(GLint location, GLsizei count, const GLuint *v)
6572 {
6573 GET_CURRENT_CONTEXT(ctx);
6574 Node *n;
6575 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6576 n = alloc_instruction(ctx, OPCODE_UNIFORM_4UIV, 2 + POINTER_DWORDS);
6577 if (n) {
6578 n[1].i = location;
6579 n[2].i = count;
6580 save_pointer(&n[3], memdup(v, count * 4 * sizeof(*v)));
6581 }
6582 if (ctx->ExecuteFlag) {
6583 CALL_Uniform4uiv(ctx->Dispatch.Exec, (location, count, v));
6584 }
6585 }
6586
6587
6588
6589 void GLAPIENTRY
save_UniformMatrix2fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * m)6590 save_UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose,
6591 const GLfloat *m)
6592 {
6593 GET_CURRENT_CONTEXT(ctx);
6594 Node *n;
6595 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6596 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX22, 3 + POINTER_DWORDS);
6597 if (n) {
6598 n[1].i = location;
6599 n[2].i = count;
6600 n[3].b = transpose;
6601 save_pointer(&n[4], memdup(m, count * 2 * 2 * sizeof(GLfloat)));
6602 }
6603 if (ctx->ExecuteFlag) {
6604 CALL_UniformMatrix2fv(ctx->Dispatch.Exec, (location, count, transpose, m));
6605 }
6606 }
6607
6608 void GLAPIENTRY
save_UniformMatrix3fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * m)6609 save_UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose,
6610 const GLfloat *m)
6611 {
6612 GET_CURRENT_CONTEXT(ctx);
6613 Node *n;
6614 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6615 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX33, 3 + POINTER_DWORDS);
6616 if (n) {
6617 n[1].i = location;
6618 n[2].i = count;
6619 n[3].b = transpose;
6620 save_pointer(&n[4], memdup(m, count * 3 * 3 * sizeof(GLfloat)));
6621 }
6622 if (ctx->ExecuteFlag) {
6623 CALL_UniformMatrix3fv(ctx->Dispatch.Exec, (location, count, transpose, m));
6624 }
6625 }
6626
6627 void GLAPIENTRY
save_UniformMatrix4fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * m)6628 save_UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose,
6629 const GLfloat *m)
6630 {
6631 GET_CURRENT_CONTEXT(ctx);
6632 Node *n;
6633 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6634 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX44, 3 + POINTER_DWORDS);
6635 if (n) {
6636 n[1].i = location;
6637 n[2].i = count;
6638 n[3].b = transpose;
6639 save_pointer(&n[4], memdup(m, count * 4 * 4 * sizeof(GLfloat)));
6640 }
6641 if (ctx->ExecuteFlag) {
6642 CALL_UniformMatrix4fv(ctx->Dispatch.Exec, (location, count, transpose, m));
6643 }
6644 }
6645
6646
6647 void GLAPIENTRY
save_UniformMatrix2x3fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * m)6648 save_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose,
6649 const GLfloat *m)
6650 {
6651 GET_CURRENT_CONTEXT(ctx);
6652 Node *n;
6653 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6654 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX23, 3 + POINTER_DWORDS);
6655 if (n) {
6656 n[1].i = location;
6657 n[2].i = count;
6658 n[3].b = transpose;
6659 save_pointer(&n[4], memdup(m, count * 2 * 3 * sizeof(GLfloat)));
6660 }
6661 if (ctx->ExecuteFlag) {
6662 CALL_UniformMatrix2x3fv(ctx->Dispatch.Exec, (location, count, transpose, m));
6663 }
6664 }
6665
6666 void GLAPIENTRY
save_UniformMatrix3x2fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * m)6667 save_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose,
6668 const GLfloat *m)
6669 {
6670 GET_CURRENT_CONTEXT(ctx);
6671 Node *n;
6672 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6673 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX32, 3 + POINTER_DWORDS);
6674 if (n) {
6675 n[1].i = location;
6676 n[2].i = count;
6677 n[3].b = transpose;
6678 save_pointer(&n[4], memdup(m, count * 3 * 2 * sizeof(GLfloat)));
6679 }
6680 if (ctx->ExecuteFlag) {
6681 CALL_UniformMatrix3x2fv(ctx->Dispatch.Exec, (location, count, transpose, m));
6682 }
6683 }
6684
6685
6686 void GLAPIENTRY
save_UniformMatrix2x4fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * m)6687 save_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose,
6688 const GLfloat *m)
6689 {
6690 GET_CURRENT_CONTEXT(ctx);
6691 Node *n;
6692 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6693 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX24, 3 + POINTER_DWORDS);
6694 if (n) {
6695 n[1].i = location;
6696 n[2].i = count;
6697 n[3].b = transpose;
6698 save_pointer(&n[4], memdup(m, count * 2 * 4 * sizeof(GLfloat)));
6699 }
6700 if (ctx->ExecuteFlag) {
6701 CALL_UniformMatrix2x4fv(ctx->Dispatch.Exec, (location, count, transpose, m));
6702 }
6703 }
6704
6705 void GLAPIENTRY
save_UniformMatrix4x2fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * m)6706 save_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose,
6707 const GLfloat *m)
6708 {
6709 GET_CURRENT_CONTEXT(ctx);
6710 Node *n;
6711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6712 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX42, 3 + POINTER_DWORDS);
6713 if (n) {
6714 n[1].i = location;
6715 n[2].i = count;
6716 n[3].b = transpose;
6717 save_pointer(&n[4], memdup(m, count * 4 * 2 * sizeof(GLfloat)));
6718 }
6719 if (ctx->ExecuteFlag) {
6720 CALL_UniformMatrix4x2fv(ctx->Dispatch.Exec, (location, count, transpose, m));
6721 }
6722 }
6723
6724
6725 void GLAPIENTRY
save_UniformMatrix3x4fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * m)6726 save_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose,
6727 const GLfloat *m)
6728 {
6729 GET_CURRENT_CONTEXT(ctx);
6730 Node *n;
6731 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6732 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX34, 3 + POINTER_DWORDS);
6733 if (n) {
6734 n[1].i = location;
6735 n[2].i = count;
6736 n[3].b = transpose;
6737 save_pointer(&n[4], memdup(m, count * 3 * 4 * sizeof(GLfloat)));
6738 }
6739 if (ctx->ExecuteFlag) {
6740 CALL_UniformMatrix3x4fv(ctx->Dispatch.Exec, (location, count, transpose, m));
6741 }
6742 }
6743
6744 void GLAPIENTRY
save_UniformMatrix4x3fv(GLint location,GLsizei count,GLboolean transpose,const GLfloat * m)6745 save_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose,
6746 const GLfloat *m)
6747 {
6748 GET_CURRENT_CONTEXT(ctx);
6749 Node *n;
6750 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6751 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX43, 3 + POINTER_DWORDS);
6752 if (n) {
6753 n[1].i = location;
6754 n[2].i = count;
6755 n[3].b = transpose;
6756 save_pointer(&n[4], memdup(m, count * 4 * 3 * sizeof(GLfloat)));
6757 }
6758 if (ctx->ExecuteFlag) {
6759 CALL_UniformMatrix4x3fv(ctx->Dispatch.Exec, (location, count, transpose, m));
6760 }
6761 }
6762
6763
6764 void GLAPIENTRY
save_UniformMatrix2dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * m)6765 save_UniformMatrix2dv(GLint location, GLsizei count, GLboolean transpose,
6766 const GLdouble *m)
6767 {
6768 GET_CURRENT_CONTEXT(ctx);
6769 Node *n;
6770 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6771 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX22D, 3 + POINTER_DWORDS);
6772 if (n) {
6773 n[1].i = location;
6774 n[2].i = count;
6775 n[3].b = transpose;
6776 save_pointer(&n[4], memdup(m, count * 2 * 2 * sizeof(GLdouble)));
6777 }
6778 if (ctx->ExecuteFlag) {
6779 CALL_UniformMatrix2dv(ctx->Dispatch.Exec, (location, count, transpose, m));
6780 }
6781 }
6782
6783 void GLAPIENTRY
save_UniformMatrix3dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * m)6784 save_UniformMatrix3dv(GLint location, GLsizei count, GLboolean transpose,
6785 const GLdouble *m)
6786 {
6787 GET_CURRENT_CONTEXT(ctx);
6788 Node *n;
6789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6790 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX33D, 3 + POINTER_DWORDS);
6791 if (n) {
6792 n[1].i = location;
6793 n[2].i = count;
6794 n[3].b = transpose;
6795 save_pointer(&n[4], memdup(m, count * 3 * 3 * sizeof(GLdouble)));
6796 }
6797 if (ctx->ExecuteFlag) {
6798 CALL_UniformMatrix3dv(ctx->Dispatch.Exec, (location, count, transpose, m));
6799 }
6800 }
6801
6802 void GLAPIENTRY
save_UniformMatrix4dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * m)6803 save_UniformMatrix4dv(GLint location, GLsizei count, GLboolean transpose,
6804 const GLdouble *m)
6805 {
6806 GET_CURRENT_CONTEXT(ctx);
6807 Node *n;
6808 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6809 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX44D, 3 + POINTER_DWORDS);
6810 if (n) {
6811 n[1].i = location;
6812 n[2].i = count;
6813 n[3].b = transpose;
6814 save_pointer(&n[4], memdup(m, count * 4 * 4 * sizeof(GLdouble)));
6815 }
6816 if (ctx->ExecuteFlag) {
6817 CALL_UniformMatrix4dv(ctx->Dispatch.Exec, (location, count, transpose, m));
6818 }
6819 }
6820
6821
6822 void GLAPIENTRY
save_UniformMatrix2x3dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * m)6823 save_UniformMatrix2x3dv(GLint location, GLsizei count, GLboolean transpose,
6824 const GLdouble *m)
6825 {
6826 GET_CURRENT_CONTEXT(ctx);
6827 Node *n;
6828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6829 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX23D, 3 + POINTER_DWORDS);
6830 if (n) {
6831 n[1].i = location;
6832 n[2].i = count;
6833 n[3].b = transpose;
6834 save_pointer(&n[4], memdup(m, count * 2 * 3 * sizeof(GLdouble)));
6835 }
6836 if (ctx->ExecuteFlag) {
6837 CALL_UniformMatrix2x3dv(ctx->Dispatch.Exec, (location, count, transpose, m));
6838 }
6839 }
6840
6841
6842 void GLAPIENTRY
save_UniformMatrix3x2dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * m)6843 save_UniformMatrix3x2dv(GLint location, GLsizei count, GLboolean transpose,
6844 const GLdouble *m)
6845 {
6846 GET_CURRENT_CONTEXT(ctx);
6847 Node *n;
6848 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6849 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX32D, 3 + POINTER_DWORDS);
6850 if (n) {
6851 n[1].i = location;
6852 n[2].i = count;
6853 n[3].b = transpose;
6854 save_pointer(&n[4], memdup(m, count * 3 * 2 * sizeof(GLdouble)));
6855 }
6856 if (ctx->ExecuteFlag) {
6857 CALL_UniformMatrix3x2dv(ctx->Dispatch.Exec, (location, count, transpose, m));
6858 }
6859 }
6860
6861
6862 void GLAPIENTRY
save_UniformMatrix2x4dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * m)6863 save_UniformMatrix2x4dv(GLint location, GLsizei count, GLboolean transpose,
6864 const GLdouble *m)
6865 {
6866 GET_CURRENT_CONTEXT(ctx);
6867 Node *n;
6868 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6869 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX24D, 3 + POINTER_DWORDS);
6870 if (n) {
6871 n[1].i = location;
6872 n[2].i = count;
6873 n[3].b = transpose;
6874 save_pointer(&n[4], memdup(m, count * 2 * 4 * sizeof(GLdouble)));
6875 }
6876 if (ctx->ExecuteFlag) {
6877 CALL_UniformMatrix2x4dv(ctx->Dispatch.Exec, (location, count, transpose, m));
6878 }
6879 }
6880
6881 void GLAPIENTRY
save_UniformMatrix4x2dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * m)6882 save_UniformMatrix4x2dv(GLint location, GLsizei count, GLboolean transpose,
6883 const GLdouble *m)
6884 {
6885 GET_CURRENT_CONTEXT(ctx);
6886 Node *n;
6887 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6888 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX42D, 3 + POINTER_DWORDS);
6889 if (n) {
6890 n[1].i = location;
6891 n[2].i = count;
6892 n[3].b = transpose;
6893 save_pointer(&n[4], memdup(m, count * 4 * 2 * sizeof(GLdouble)));
6894 }
6895 if (ctx->ExecuteFlag) {
6896 CALL_UniformMatrix4x2dv(ctx->Dispatch.Exec, (location, count, transpose, m));
6897 }
6898 }
6899
6900
6901 void GLAPIENTRY
save_UniformMatrix3x4dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * m)6902 save_UniformMatrix3x4dv(GLint location, GLsizei count, GLboolean transpose,
6903 const GLdouble *m)
6904 {
6905 GET_CURRENT_CONTEXT(ctx);
6906 Node *n;
6907 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6908 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX34D, 3 + POINTER_DWORDS);
6909 if (n) {
6910 n[1].i = location;
6911 n[2].i = count;
6912 n[3].b = transpose;
6913 save_pointer(&n[4], memdup(m, count * 3 * 4 * sizeof(GLdouble)));
6914 }
6915 if (ctx->ExecuteFlag) {
6916 CALL_UniformMatrix3x4dv(ctx->Dispatch.Exec, (location, count, transpose, m));
6917 }
6918 }
6919
6920
6921 void GLAPIENTRY
save_UniformMatrix4x3dv(GLint location,GLsizei count,GLboolean transpose,const GLdouble * m)6922 save_UniformMatrix4x3dv(GLint location, GLsizei count, GLboolean transpose,
6923 const GLdouble *m)
6924 {
6925 GET_CURRENT_CONTEXT(ctx);
6926 Node *n;
6927 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6928 n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX43D, 3 + POINTER_DWORDS);
6929 if (n) {
6930 n[1].i = location;
6931 n[2].i = count;
6932 n[3].b = transpose;
6933 save_pointer(&n[4], memdup(m, count * 4 * 3 * sizeof(GLdouble)));
6934 }
6935 if (ctx->ExecuteFlag) {
6936 CALL_UniformMatrix4x3dv(ctx->Dispatch.Exec, (location, count, transpose, m));
6937 }
6938 }
6939
6940 void GLAPIENTRY
save_Uniform1i64ARB(GLint location,GLint64 x)6941 save_Uniform1i64ARB(GLint location, GLint64 x)
6942 {
6943 GET_CURRENT_CONTEXT(ctx);
6944 Node *n;
6945 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6946 n = alloc_instruction(ctx, OPCODE_UNIFORM_1I64, 3);
6947 if (n) {
6948 n[1].i = location;
6949 ASSIGN_INT64_TO_NODES(n, 2, x);
6950 }
6951 if (ctx->ExecuteFlag) {
6952 CALL_Uniform1i64ARB(ctx->Dispatch.Exec, (location, x));
6953 }
6954 }
6955
6956 void GLAPIENTRY
save_Uniform2i64ARB(GLint location,GLint64 x,GLint64 y)6957 save_Uniform2i64ARB(GLint location, GLint64 x, GLint64 y)
6958 {
6959 GET_CURRENT_CONTEXT(ctx);
6960 Node *n;
6961 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6962 n = alloc_instruction(ctx, OPCODE_UNIFORM_2I64, 5);
6963 if (n) {
6964 n[1].i = location;
6965 ASSIGN_INT64_TO_NODES(n, 2, x);
6966 ASSIGN_INT64_TO_NODES(n, 4, y);
6967 }
6968 if (ctx->ExecuteFlag) {
6969 CALL_Uniform2i64ARB(ctx->Dispatch.Exec, (location, x, y));
6970 }
6971 }
6972
6973 void GLAPIENTRY
save_Uniform3i64ARB(GLint location,GLint64 x,GLint64 y,GLint64 z)6974 save_Uniform3i64ARB(GLint location, GLint64 x, GLint64 y, GLint64 z)
6975 {
6976 GET_CURRENT_CONTEXT(ctx);
6977 Node *n;
6978 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6979 n = alloc_instruction(ctx, OPCODE_UNIFORM_3I64, 7);
6980 if (n) {
6981 n[1].i = location;
6982 ASSIGN_INT64_TO_NODES(n, 2, x);
6983 ASSIGN_INT64_TO_NODES(n, 4, y);
6984 ASSIGN_INT64_TO_NODES(n, 6, z);
6985 }
6986 if (ctx->ExecuteFlag) {
6987 CALL_Uniform3i64ARB(ctx->Dispatch.Exec, (location, x, y, z));
6988 }
6989 }
6990
6991 void GLAPIENTRY
save_Uniform4i64ARB(GLint location,GLint64 x,GLint64 y,GLint64 z,GLint64 w)6992 save_Uniform4i64ARB(GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w)
6993 {
6994 GET_CURRENT_CONTEXT(ctx);
6995 Node *n;
6996 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
6997 n = alloc_instruction(ctx, OPCODE_UNIFORM_4I64, 9);
6998 if (n) {
6999 n[1].i = location;
7000 ASSIGN_INT64_TO_NODES(n, 2, x);
7001 ASSIGN_INT64_TO_NODES(n, 4, y);
7002 ASSIGN_INT64_TO_NODES(n, 6, z);
7003 ASSIGN_INT64_TO_NODES(n, 8, w);
7004 }
7005 if (ctx->ExecuteFlag) {
7006 CALL_Uniform4i64ARB(ctx->Dispatch.Exec, (location, x, y, z, w));
7007 }
7008 }
7009
7010 void GLAPIENTRY
save_Uniform1i64vARB(GLint location,GLsizei count,const GLint64 * v)7011 save_Uniform1i64vARB(GLint location, GLsizei count, const GLint64 *v)
7012 {
7013 GET_CURRENT_CONTEXT(ctx);
7014 Node *n;
7015 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7016 n = alloc_instruction(ctx, OPCODE_UNIFORM_1I64V, 2 + POINTER_DWORDS);
7017 if (n) {
7018 n[1].i = location;
7019 n[2].i = count;
7020 save_pointer(&n[3], memdup(v, count * 1 * sizeof(GLint64)));
7021 }
7022 if (ctx->ExecuteFlag) {
7023 CALL_Uniform1i64vARB(ctx->Dispatch.Exec, (location, count, v));
7024 }
7025 }
7026
7027 void GLAPIENTRY
save_Uniform2i64vARB(GLint location,GLsizei count,const GLint64 * v)7028 save_Uniform2i64vARB(GLint location, GLsizei count, const GLint64 *v)
7029 {
7030 GET_CURRENT_CONTEXT(ctx);
7031 Node *n;
7032 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7033 n = alloc_instruction(ctx, OPCODE_UNIFORM_2I64V, 2 + POINTER_DWORDS);
7034 if (n) {
7035 n[1].i = location;
7036 n[2].i = count;
7037 save_pointer(&n[3], memdup(v, count * 2 * sizeof(GLint64)));
7038 }
7039 if (ctx->ExecuteFlag) {
7040 CALL_Uniform2i64vARB(ctx->Dispatch.Exec, (location, count, v));
7041 }
7042 }
7043
7044 void GLAPIENTRY
save_Uniform3i64vARB(GLint location,GLsizei count,const GLint64 * v)7045 save_Uniform3i64vARB(GLint location, GLsizei count, const GLint64 *v)
7046 {
7047 GET_CURRENT_CONTEXT(ctx);
7048 Node *n;
7049 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7050 n = alloc_instruction(ctx, OPCODE_UNIFORM_3I64V, 2 + POINTER_DWORDS);
7051 if (n) {
7052 n[1].i = location;
7053 n[2].i = count;
7054 save_pointer(&n[3], memdup(v, count * 3 * sizeof(GLint64)));
7055 }
7056 if (ctx->ExecuteFlag) {
7057 CALL_Uniform3i64vARB(ctx->Dispatch.Exec, (location, count, v));
7058 }
7059 }
7060
7061 void GLAPIENTRY
save_Uniform4i64vARB(GLint location,GLsizei count,const GLint64 * v)7062 save_Uniform4i64vARB(GLint location, GLsizei count, const GLint64 *v)
7063 {
7064 GET_CURRENT_CONTEXT(ctx);
7065 Node *n;
7066 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7067 n = alloc_instruction(ctx, OPCODE_UNIFORM_4I64V, 2 + POINTER_DWORDS);
7068 if (n) {
7069 n[1].i = location;
7070 n[2].i = count;
7071 save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLint64)));
7072 }
7073 if (ctx->ExecuteFlag) {
7074 CALL_Uniform4i64vARB(ctx->Dispatch.Exec, (location, count, v));
7075 }
7076 }
7077
7078 void GLAPIENTRY
save_Uniform1ui64ARB(GLint location,GLuint64 x)7079 save_Uniform1ui64ARB(GLint location, GLuint64 x)
7080 {
7081 GET_CURRENT_CONTEXT(ctx);
7082 Node *n;
7083 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7084 n = alloc_instruction(ctx, OPCODE_UNIFORM_1UI64, 3);
7085 if (n) {
7086 n[1].i = location;
7087 ASSIGN_UINT64_TO_NODES(n, 2, x);
7088 }
7089 if (ctx->ExecuteFlag) {
7090 CALL_Uniform1ui64ARB(ctx->Dispatch.Exec, (location, x));
7091 }
7092 }
7093
7094 void GLAPIENTRY
save_Uniform2ui64ARB(GLint location,GLuint64 x,GLuint64 y)7095 save_Uniform2ui64ARB(GLint location, GLuint64 x, GLuint64 y)
7096 {
7097 GET_CURRENT_CONTEXT(ctx);
7098 Node *n;
7099 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7100 n = alloc_instruction(ctx, OPCODE_UNIFORM_2UI64, 5);
7101 if (n) {
7102 n[1].i = location;
7103 ASSIGN_UINT64_TO_NODES(n, 2, x);
7104 ASSIGN_UINT64_TO_NODES(n, 4, y);
7105 }
7106 if (ctx->ExecuteFlag) {
7107 CALL_Uniform2ui64ARB(ctx->Dispatch.Exec, (location, x, y));
7108 }
7109 }
7110
7111 void GLAPIENTRY
save_Uniform3ui64ARB(GLint location,GLuint64 x,GLuint64 y,GLuint64 z)7112 save_Uniform3ui64ARB(GLint location, GLuint64 x, GLuint64 y, GLuint64 z)
7113 {
7114 GET_CURRENT_CONTEXT(ctx);
7115 Node *n;
7116 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7117 n = alloc_instruction(ctx, OPCODE_UNIFORM_3UI64, 7);
7118 if (n) {
7119 n[1].i = location;
7120 ASSIGN_UINT64_TO_NODES(n, 2, x);
7121 ASSIGN_UINT64_TO_NODES(n, 4, y);
7122 ASSIGN_UINT64_TO_NODES(n, 6, z);
7123 }
7124 if (ctx->ExecuteFlag) {
7125 CALL_Uniform3ui64ARB(ctx->Dispatch.Exec, (location, x, y, z));
7126 }
7127 }
7128
7129 void GLAPIENTRY
save_Uniform4ui64ARB(GLint location,GLuint64 x,GLuint64 y,GLuint64 z,GLuint64 w)7130 save_Uniform4ui64ARB(GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w)
7131 {
7132 GET_CURRENT_CONTEXT(ctx);
7133 Node *n;
7134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7135 n = alloc_instruction(ctx, OPCODE_UNIFORM_4UI64, 9);
7136 if (n) {
7137 n[1].i = location;
7138 ASSIGN_UINT64_TO_NODES(n, 2, x);
7139 ASSIGN_UINT64_TO_NODES(n, 4, y);
7140 ASSIGN_UINT64_TO_NODES(n, 6, z);
7141 ASSIGN_UINT64_TO_NODES(n, 8, w);
7142 }
7143 if (ctx->ExecuteFlag) {
7144 CALL_Uniform4ui64ARB(ctx->Dispatch.Exec, (location, x, y, z, w));
7145 }
7146 }
7147
7148 void GLAPIENTRY
save_Uniform1ui64vARB(GLint location,GLsizei count,const GLuint64 * v)7149 save_Uniform1ui64vARB(GLint location, GLsizei count, const GLuint64 *v)
7150 {
7151 GET_CURRENT_CONTEXT(ctx);
7152 Node *n;
7153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7154 n = alloc_instruction(ctx, OPCODE_UNIFORM_1UI64V, 2 + POINTER_DWORDS);
7155 if (n) {
7156 n[1].i = location;
7157 n[2].i = count;
7158 save_pointer(&n[3], memdup(v, count * 1 * sizeof(GLuint64)));
7159 }
7160 if (ctx->ExecuteFlag) {
7161 CALL_Uniform1ui64vARB(ctx->Dispatch.Exec, (location, count, v));
7162 }
7163 }
7164
7165 void GLAPIENTRY
save_Uniform2ui64vARB(GLint location,GLsizei count,const GLuint64 * v)7166 save_Uniform2ui64vARB(GLint location, GLsizei count, const GLuint64 *v)
7167 {
7168 GET_CURRENT_CONTEXT(ctx);
7169 Node *n;
7170 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7171 n = alloc_instruction(ctx, OPCODE_UNIFORM_2UI64V, 2 + POINTER_DWORDS);
7172 if (n) {
7173 n[1].i = location;
7174 n[2].i = count;
7175 save_pointer(&n[3], memdup(v, count * 2 * sizeof(GLuint64)));
7176 }
7177 if (ctx->ExecuteFlag) {
7178 CALL_Uniform2ui64vARB(ctx->Dispatch.Exec, (location, count, v));
7179 }
7180 }
7181
7182 void GLAPIENTRY
save_Uniform3ui64vARB(GLint location,GLsizei count,const GLuint64 * v)7183 save_Uniform3ui64vARB(GLint location, GLsizei count, const GLuint64 *v)
7184 {
7185 GET_CURRENT_CONTEXT(ctx);
7186 Node *n;
7187 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7188 n = alloc_instruction(ctx, OPCODE_UNIFORM_3UI64V, 2 + POINTER_DWORDS);
7189 if (n) {
7190 n[1].i = location;
7191 n[2].i = count;
7192 save_pointer(&n[3], memdup(v, count * 3 * sizeof(GLuint64)));
7193 }
7194 if (ctx->ExecuteFlag) {
7195 CALL_Uniform3ui64vARB(ctx->Dispatch.Exec, (location, count, v));
7196 }
7197 }
7198
7199 void GLAPIENTRY
save_Uniform4ui64vARB(GLint location,GLsizei count,const GLuint64 * v)7200 save_Uniform4ui64vARB(GLint location, GLsizei count, const GLuint64 *v)
7201 {
7202 GET_CURRENT_CONTEXT(ctx);
7203 Node *n;
7204 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7205 n = alloc_instruction(ctx, OPCODE_UNIFORM_4UI64V, 2 + POINTER_DWORDS);
7206 if (n) {
7207 n[1].i = location;
7208 n[2].i = count;
7209 save_pointer(&n[3], memdup(v, count * 4 * sizeof(GLuint64)));
7210 }
7211 if (ctx->ExecuteFlag) {
7212 CALL_Uniform4ui64vARB(ctx->Dispatch.Exec, (location, count, v));
7213 }
7214 }
7215
7216 void GLAPIENTRY
save_ProgramUniform1i64ARB(GLuint program,GLint location,GLint64 x)7217 save_ProgramUniform1i64ARB(GLuint program, GLint location, GLint64 x)
7218 {
7219 GET_CURRENT_CONTEXT(ctx);
7220 Node *n;
7221 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7222 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1I64, 4);
7223 if (n) {
7224 n[1].ui = program;
7225 n[2].i = location;
7226 ASSIGN_INT64_TO_NODES(n, 3, x);
7227 }
7228 if (ctx->ExecuteFlag) {
7229 CALL_ProgramUniform1i64ARB(ctx->Dispatch.Exec, (program, location, x));
7230 }
7231 }
7232
7233 void GLAPIENTRY
save_ProgramUniform2i64ARB(GLuint program,GLint location,GLint64 x,GLint64 y)7234 save_ProgramUniform2i64ARB(GLuint program, GLint location, GLint64 x,
7235 GLint64 y)
7236 {
7237 GET_CURRENT_CONTEXT(ctx);
7238 Node *n;
7239 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7240 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2I64, 6);
7241 if (n) {
7242 n[1].ui = program;
7243 n[2].i = location;
7244 ASSIGN_INT64_TO_NODES(n, 3, x);
7245 ASSIGN_INT64_TO_NODES(n, 5, y);
7246 }
7247 if (ctx->ExecuteFlag) {
7248 CALL_ProgramUniform2i64ARB(ctx->Dispatch.Exec, (program, location, x, y));
7249 }
7250 }
7251
7252 void GLAPIENTRY
save_ProgramUniform3i64ARB(GLuint program,GLint location,GLint64 x,GLint64 y,GLint64 z)7253 save_ProgramUniform3i64ARB(GLuint program, GLint location, GLint64 x,
7254 GLint64 y, GLint64 z)
7255 {
7256 GET_CURRENT_CONTEXT(ctx);
7257 Node *n;
7258 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7259 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3I64, 8);
7260 if (n) {
7261 n[1].ui = program;
7262 n[2].i = location;
7263 ASSIGN_INT64_TO_NODES(n, 3, x);
7264 ASSIGN_INT64_TO_NODES(n, 5, y);
7265 ASSIGN_INT64_TO_NODES(n, 7, z);
7266 }
7267 if (ctx->ExecuteFlag) {
7268 CALL_ProgramUniform3i64ARB(ctx->Dispatch.Exec, (program, location, x, y, z));
7269 }
7270 }
7271
7272 void GLAPIENTRY
save_ProgramUniform4i64ARB(GLuint program,GLint location,GLint64 x,GLint64 y,GLint64 z,GLint64 w)7273 save_ProgramUniform4i64ARB(GLuint program, GLint location, GLint64 x,
7274 GLint64 y, GLint64 z, GLint64 w)
7275 {
7276 GET_CURRENT_CONTEXT(ctx);
7277 Node *n;
7278 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7279 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4I64, 10);
7280 if (n) {
7281 n[1].ui = program;
7282 n[2].i = location;
7283 ASSIGN_INT64_TO_NODES(n, 3, x);
7284 ASSIGN_INT64_TO_NODES(n, 5, y);
7285 ASSIGN_INT64_TO_NODES(n, 7, z);
7286 ASSIGN_INT64_TO_NODES(n, 9, w);
7287 }
7288 if (ctx->ExecuteFlag) {
7289 CALL_ProgramUniform4i64ARB(ctx->Dispatch.Exec, (program, location, x, y, z, w));
7290 }
7291 }
7292
7293 void GLAPIENTRY
save_ProgramUniform1i64vARB(GLuint program,GLint location,GLsizei count,const GLint64 * v)7294 save_ProgramUniform1i64vARB(GLuint program, GLint location, GLsizei count,
7295 const GLint64 *v)
7296 {
7297 GET_CURRENT_CONTEXT(ctx);
7298 Node *n;
7299 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7300 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1I64V, 3 + POINTER_DWORDS);
7301 if (n) {
7302 n[1].ui = program;
7303 n[2].i = location;
7304 n[3].i = count;
7305 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLint64)));
7306 }
7307 if (ctx->ExecuteFlag) {
7308 CALL_ProgramUniform1i64vARB(ctx->Dispatch.Exec, (program, location, count, v));
7309 }
7310 }
7311
7312 void GLAPIENTRY
save_ProgramUniform2i64vARB(GLuint program,GLint location,GLsizei count,const GLint64 * v)7313 save_ProgramUniform2i64vARB(GLuint program, GLint location, GLsizei count,
7314 const GLint64 *v)
7315 {
7316 GET_CURRENT_CONTEXT(ctx);
7317 Node *n;
7318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7319 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2I64V, 3 + POINTER_DWORDS);
7320 if (n) {
7321 n[1].ui = program;
7322 n[2].i = location;
7323 n[3].i = count;
7324 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLint64)));
7325 }
7326 if (ctx->ExecuteFlag) {
7327 CALL_ProgramUniform2i64vARB(ctx->Dispatch.Exec, (program, location, count, v));
7328 }
7329 }
7330
7331 void GLAPIENTRY
save_ProgramUniform3i64vARB(GLuint program,GLint location,GLsizei count,const GLint64 * v)7332 save_ProgramUniform3i64vARB(GLuint program, GLint location, GLsizei count,
7333 const GLint64 *v)
7334 {
7335 GET_CURRENT_CONTEXT(ctx);
7336 Node *n;
7337 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7338 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3I64V, 3 + POINTER_DWORDS);
7339 if (n) {
7340 n[1].ui = program;
7341 n[2].i = location;
7342 n[3].i = count;
7343 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLint64)));
7344 }
7345 if (ctx->ExecuteFlag) {
7346 CALL_ProgramUniform3i64vARB(ctx->Dispatch.Exec, (program, location, count, v));
7347 }
7348 }
7349
7350 void GLAPIENTRY
save_ProgramUniform4i64vARB(GLuint program,GLint location,GLsizei count,const GLint64 * v)7351 save_ProgramUniform4i64vARB(GLuint program, GLint location, GLsizei count,
7352 const GLint64 *v)
7353 {
7354 GET_CURRENT_CONTEXT(ctx);
7355 Node *n;
7356 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7357 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4I64V, 3 + POINTER_DWORDS);
7358 if (n) {
7359 n[1].ui = program;
7360 n[2].i = location;
7361 n[3].i = count;
7362 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLint64)));
7363 }
7364 if (ctx->ExecuteFlag) {
7365 CALL_ProgramUniform4i64vARB(ctx->Dispatch.Exec, (program, location, count, v));
7366 }
7367 }
7368
7369 void GLAPIENTRY
save_ProgramUniform1ui64ARB(GLuint program,GLint location,GLuint64 x)7370 save_ProgramUniform1ui64ARB(GLuint program, GLint location, GLuint64 x)
7371 {
7372 GET_CURRENT_CONTEXT(ctx);
7373 Node *n;
7374 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7375 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1UI64, 4);
7376 if (n) {
7377 n[1].ui = program;
7378 n[2].i = location;
7379 ASSIGN_UINT64_TO_NODES(n, 3, x);
7380 }
7381 if (ctx->ExecuteFlag) {
7382 CALL_ProgramUniform1ui64ARB(ctx->Dispatch.Exec, (program, location, x));
7383 }
7384 }
7385
7386 void GLAPIENTRY
save_ProgramUniform2ui64ARB(GLuint program,GLint location,GLuint64 x,GLuint64 y)7387 save_ProgramUniform2ui64ARB(GLuint program, GLint location, GLuint64 x,
7388 GLuint64 y)
7389 {
7390 GET_CURRENT_CONTEXT(ctx);
7391 Node *n;
7392 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7393 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2UI64, 6);
7394 if (n) {
7395 n[1].ui = program;
7396 n[2].i = location;
7397 ASSIGN_UINT64_TO_NODES(n, 3, x);
7398 ASSIGN_UINT64_TO_NODES(n, 5, y);
7399 }
7400 if (ctx->ExecuteFlag) {
7401 CALL_ProgramUniform2ui64ARB(ctx->Dispatch.Exec, (program, location, x, y));
7402 }
7403 }
7404
7405 void GLAPIENTRY
save_ProgramUniform3ui64ARB(GLuint program,GLint location,GLuint64 x,GLuint64 y,GLuint64 z)7406 save_ProgramUniform3ui64ARB(GLuint program, GLint location, GLuint64 x,
7407 GLuint64 y, GLuint64 z)
7408 {
7409 GET_CURRENT_CONTEXT(ctx);
7410 Node *n;
7411 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7412 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3UI64, 8);
7413 if (n) {
7414 n[1].ui = program;
7415 n[2].i = location;
7416 ASSIGN_UINT64_TO_NODES(n, 3, x);
7417 ASSIGN_UINT64_TO_NODES(n, 5, y);
7418 ASSIGN_UINT64_TO_NODES(n, 7, z);
7419 }
7420 if (ctx->ExecuteFlag) {
7421 CALL_ProgramUniform3ui64ARB(ctx->Dispatch.Exec, (program, location, x, y, z));
7422 }
7423 }
7424
7425 void GLAPIENTRY
save_ProgramUniform4ui64ARB(GLuint program,GLint location,GLuint64 x,GLuint64 y,GLuint64 z,GLuint64 w)7426 save_ProgramUniform4ui64ARB(GLuint program, GLint location, GLuint64 x,
7427 GLuint64 y, GLuint64 z, GLuint64 w)
7428 {
7429 GET_CURRENT_CONTEXT(ctx);
7430 Node *n;
7431 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7432 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4UI64, 10);
7433 if (n) {
7434 n[1].ui = program;
7435 n[2].i = location;
7436 ASSIGN_UINT64_TO_NODES(n, 3, x);
7437 ASSIGN_UINT64_TO_NODES(n, 5, y);
7438 ASSIGN_UINT64_TO_NODES(n, 7, z);
7439 ASSIGN_UINT64_TO_NODES(n, 9, w);
7440 }
7441 if (ctx->ExecuteFlag) {
7442 CALL_ProgramUniform4i64ARB(ctx->Dispatch.Exec, (program, location, x, y, z, w));
7443 }
7444 }
7445
7446 void GLAPIENTRY
save_ProgramUniform1ui64vARB(GLuint program,GLint location,GLsizei count,const GLuint64 * v)7447 save_ProgramUniform1ui64vARB(GLuint program, GLint location, GLsizei count,
7448 const GLuint64 *v)
7449 {
7450 GET_CURRENT_CONTEXT(ctx);
7451 Node *n;
7452 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7453 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1UI64V,
7454 3 + POINTER_DWORDS);
7455 if (n) {
7456 n[1].ui = program;
7457 n[2].i = location;
7458 n[3].i = count;
7459 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLuint64)));
7460 }
7461 if (ctx->ExecuteFlag) {
7462 CALL_ProgramUniform1ui64vARB(ctx->Dispatch.Exec, (program, location, count, v));
7463 }
7464 }
7465
7466 void GLAPIENTRY
save_ProgramUniform2ui64vARB(GLuint program,GLint location,GLsizei count,const GLuint64 * v)7467 save_ProgramUniform2ui64vARB(GLuint program, GLint location, GLsizei count,
7468 const GLuint64 *v)
7469 {
7470 GET_CURRENT_CONTEXT(ctx);
7471 Node *n;
7472 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7473 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2UI64V,
7474 3 + POINTER_DWORDS);
7475 if (n) {
7476 n[1].ui = program;
7477 n[2].i = location;
7478 n[3].i = count;
7479 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLuint64)));
7480 }
7481 if (ctx->ExecuteFlag) {
7482 CALL_ProgramUniform2ui64vARB(ctx->Dispatch.Exec, (program, location, count, v));
7483 }
7484 }
7485
7486 void GLAPIENTRY
save_ProgramUniform3ui64vARB(GLuint program,GLint location,GLsizei count,const GLuint64 * v)7487 save_ProgramUniform3ui64vARB(GLuint program, GLint location, GLsizei count,
7488 const GLuint64 *v)
7489 {
7490 GET_CURRENT_CONTEXT(ctx);
7491 Node *n;
7492 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7493 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3UI64V,
7494 3 + POINTER_DWORDS);
7495 if (n) {
7496 n[1].ui = program;
7497 n[2].i = location;
7498 n[3].i = count;
7499 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLuint64)));
7500 }
7501 if (ctx->ExecuteFlag) {
7502 CALL_ProgramUniform3ui64vARB(ctx->Dispatch.Exec, (program, location, count, v));
7503 }
7504 }
7505
7506 void GLAPIENTRY
save_ProgramUniform4ui64vARB(GLuint program,GLint location,GLsizei count,const GLuint64 * v)7507 save_ProgramUniform4ui64vARB(GLuint program, GLint location, GLsizei count,
7508 const GLuint64 *v)
7509 {
7510 GET_CURRENT_CONTEXT(ctx);
7511 Node *n;
7512 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7513 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4UI64V,
7514 3 + POINTER_DWORDS);
7515 if (n) {
7516 n[1].ui = program;
7517 n[2].i = location;
7518 n[3].i = count;
7519 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLuint64)));
7520 }
7521 if (ctx->ExecuteFlag) {
7522 CALL_ProgramUniform4ui64vARB(ctx->Dispatch.Exec, (program, location, count, v));
7523 }
7524 }
7525
7526
7527 void GLAPIENTRY
save_UseProgramStages(GLuint pipeline,GLbitfield stages,GLuint program)7528 save_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
7529 {
7530 GET_CURRENT_CONTEXT(ctx);
7531 Node *n;
7532 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7533 n = alloc_instruction(ctx, OPCODE_USE_PROGRAM_STAGES, 3);
7534 if (n) {
7535 n[1].ui = pipeline;
7536 n[2].ui = stages;
7537 n[3].ui = program;
7538 }
7539 if (ctx->ExecuteFlag) {
7540 CALL_UseProgramStages(ctx->Dispatch.Exec, (pipeline, stages, program));
7541 }
7542 }
7543
7544 void GLAPIENTRY
save_ProgramUniform1f(GLuint program,GLint location,GLfloat x)7545 save_ProgramUniform1f(GLuint program, GLint location, GLfloat x)
7546 {
7547 GET_CURRENT_CONTEXT(ctx);
7548 Node *n;
7549 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7550 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1F, 3);
7551 if (n) {
7552 n[1].ui = program;
7553 n[2].i = location;
7554 n[3].f = x;
7555 }
7556 if (ctx->ExecuteFlag) {
7557 CALL_ProgramUniform1f(ctx->Dispatch.Exec, (program, location, x));
7558 }
7559 }
7560
7561 void GLAPIENTRY
save_ProgramUniform2f(GLuint program,GLint location,GLfloat x,GLfloat y)7562 save_ProgramUniform2f(GLuint program, GLint location, GLfloat x, GLfloat y)
7563 {
7564 GET_CURRENT_CONTEXT(ctx);
7565 Node *n;
7566 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7567 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2F, 4);
7568 if (n) {
7569 n[1].ui = program;
7570 n[2].i = location;
7571 n[3].f = x;
7572 n[4].f = y;
7573 }
7574 if (ctx->ExecuteFlag) {
7575 CALL_ProgramUniform2f(ctx->Dispatch.Exec, (program, location, x, y));
7576 }
7577 }
7578
7579 void GLAPIENTRY
save_ProgramUniform3f(GLuint program,GLint location,GLfloat x,GLfloat y,GLfloat z)7580 save_ProgramUniform3f(GLuint program, GLint location,
7581 GLfloat x, GLfloat y, GLfloat z)
7582 {
7583 GET_CURRENT_CONTEXT(ctx);
7584 Node *n;
7585 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7586 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3F, 5);
7587 if (n) {
7588 n[1].ui = program;
7589 n[2].i = location;
7590 n[3].f = x;
7591 n[4].f = y;
7592 n[5].f = z;
7593 }
7594 if (ctx->ExecuteFlag) {
7595 CALL_ProgramUniform3f(ctx->Dispatch.Exec, (program, location, x, y, z));
7596 }
7597 }
7598
7599 void GLAPIENTRY
save_ProgramUniform4f(GLuint program,GLint location,GLfloat x,GLfloat y,GLfloat z,GLfloat w)7600 save_ProgramUniform4f(GLuint program, GLint location,
7601 GLfloat x, GLfloat y, GLfloat z, GLfloat w)
7602 {
7603 GET_CURRENT_CONTEXT(ctx);
7604 Node *n;
7605 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7606 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4F, 6);
7607 if (n) {
7608 n[1].ui = program;
7609 n[2].i = location;
7610 n[3].f = x;
7611 n[4].f = y;
7612 n[5].f = z;
7613 n[6].f = w;
7614 }
7615 if (ctx->ExecuteFlag) {
7616 CALL_ProgramUniform4f(ctx->Dispatch.Exec, (program, location, x, y, z, w));
7617 }
7618 }
7619
7620 void GLAPIENTRY
save_ProgramUniform1fv(GLuint program,GLint location,GLsizei count,const GLfloat * v)7621 save_ProgramUniform1fv(GLuint program, GLint location, GLsizei count,
7622 const GLfloat *v)
7623 {
7624 GET_CURRENT_CONTEXT(ctx);
7625 Node *n;
7626 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7627 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1FV, 3 + POINTER_DWORDS);
7628 if (n) {
7629 n[1].ui = program;
7630 n[2].i = location;
7631 n[3].i = count;
7632 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLfloat)));
7633 }
7634 if (ctx->ExecuteFlag) {
7635 CALL_ProgramUniform1fv(ctx->Dispatch.Exec, (program, location, count, v));
7636 }
7637 }
7638
7639 void GLAPIENTRY
save_ProgramUniform2fv(GLuint program,GLint location,GLsizei count,const GLfloat * v)7640 save_ProgramUniform2fv(GLuint program, GLint location, GLsizei count,
7641 const GLfloat *v)
7642 {
7643 GET_CURRENT_CONTEXT(ctx);
7644 Node *n;
7645 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7646 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2FV, 3 + POINTER_DWORDS);
7647 if (n) {
7648 n[1].ui = program;
7649 n[2].i = location;
7650 n[3].i = count;
7651 save_pointer(&n[4], memdup(v, count * 2 * sizeof(GLfloat)));
7652 }
7653 if (ctx->ExecuteFlag) {
7654 CALL_ProgramUniform2fv(ctx->Dispatch.Exec, (program, location, count, v));
7655 }
7656 }
7657
7658 void GLAPIENTRY
save_ProgramUniform3fv(GLuint program,GLint location,GLsizei count,const GLfloat * v)7659 save_ProgramUniform3fv(GLuint program, GLint location, GLsizei count,
7660 const GLfloat *v)
7661 {
7662 GET_CURRENT_CONTEXT(ctx);
7663 Node *n;
7664 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7665 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3FV, 3 + POINTER_DWORDS);
7666 if (n) {
7667 n[1].ui = program;
7668 n[2].i = location;
7669 n[3].i = count;
7670 save_pointer(&n[4], memdup(v, count * 3 * sizeof(GLfloat)));
7671 }
7672 if (ctx->ExecuteFlag) {
7673 CALL_ProgramUniform3fv(ctx->Dispatch.Exec, (program, location, count, v));
7674 }
7675 }
7676
7677 void GLAPIENTRY
save_ProgramUniform4fv(GLuint program,GLint location,GLsizei count,const GLfloat * v)7678 save_ProgramUniform4fv(GLuint program, GLint location, GLsizei count,
7679 const GLfloat *v)
7680 {
7681 GET_CURRENT_CONTEXT(ctx);
7682 Node *n;
7683 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7684 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4FV, 3 + POINTER_DWORDS);
7685 if (n) {
7686 n[1].ui = program;
7687 n[2].i = location;
7688 n[3].i = count;
7689 save_pointer(&n[4], memdup(v, count * 4 * sizeof(GLfloat)));
7690 }
7691 if (ctx->ExecuteFlag) {
7692 CALL_ProgramUniform4fv(ctx->Dispatch.Exec, (program, location, count, v));
7693 }
7694 }
7695
7696 void GLAPIENTRY
save_ProgramUniform1d(GLuint program,GLint location,GLdouble x)7697 save_ProgramUniform1d(GLuint program, GLint location, GLdouble x)
7698 {
7699 GET_CURRENT_CONTEXT(ctx);
7700 Node *n;
7701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7702 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1D, 4);
7703 if (n) {
7704 n[1].ui = program;
7705 n[2].i = location;
7706 ASSIGN_DOUBLE_TO_NODES(n, 3, x);
7707 }
7708 if (ctx->ExecuteFlag) {
7709 CALL_ProgramUniform1d(ctx->Dispatch.Exec, (program, location, x));
7710 }
7711 }
7712
7713 void GLAPIENTRY
save_ProgramUniform2d(GLuint program,GLint location,GLdouble x,GLdouble y)7714 save_ProgramUniform2d(GLuint program, GLint location, GLdouble x, GLdouble y)
7715 {
7716 GET_CURRENT_CONTEXT(ctx);
7717 Node *n;
7718 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7719 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2D, 6);
7720 if (n) {
7721 n[1].ui = program;
7722 n[2].i = location;
7723 ASSIGN_DOUBLE_TO_NODES(n, 3, x);
7724 ASSIGN_DOUBLE_TO_NODES(n, 5, y);
7725 }
7726 if (ctx->ExecuteFlag) {
7727 CALL_ProgramUniform2d(ctx->Dispatch.Exec, (program, location, x, y));
7728 }
7729 }
7730
7731 void GLAPIENTRY
save_ProgramUniform3d(GLuint program,GLint location,GLdouble x,GLdouble y,GLdouble z)7732 save_ProgramUniform3d(GLuint program, GLint location,
7733 GLdouble x, GLdouble y, GLdouble z)
7734 {
7735 GET_CURRENT_CONTEXT(ctx);
7736 Node *n;
7737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7738 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3D, 8);
7739 if (n) {
7740 n[1].ui = program;
7741 n[2].i = location;
7742 ASSIGN_DOUBLE_TO_NODES(n, 3, x);
7743 ASSIGN_DOUBLE_TO_NODES(n, 5, y);
7744 ASSIGN_DOUBLE_TO_NODES(n, 7, z);
7745 }
7746 if (ctx->ExecuteFlag) {
7747 CALL_ProgramUniform3d(ctx->Dispatch.Exec, (program, location, x, y, z));
7748 }
7749 }
7750
7751 void GLAPIENTRY
save_ProgramUniform4d(GLuint program,GLint location,GLdouble x,GLdouble y,GLdouble z,GLdouble w)7752 save_ProgramUniform4d(GLuint program, GLint location,
7753 GLdouble x, GLdouble y, GLdouble z, GLdouble w)
7754 {
7755 GET_CURRENT_CONTEXT(ctx);
7756 Node *n;
7757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7758 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4D, 10);
7759 if (n) {
7760 n[1].ui = program;
7761 n[2].i = location;
7762 ASSIGN_DOUBLE_TO_NODES(n, 3, x);
7763 ASSIGN_DOUBLE_TO_NODES(n, 5, y);
7764 ASSIGN_DOUBLE_TO_NODES(n, 7, z);
7765 ASSIGN_DOUBLE_TO_NODES(n, 9, w);
7766 }
7767 if (ctx->ExecuteFlag) {
7768 CALL_ProgramUniform4d(ctx->Dispatch.Exec, (program, location, x, y, z, w));
7769 }
7770 }
7771
7772 void GLAPIENTRY
save_ProgramUniform1dv(GLuint program,GLint location,GLsizei count,const GLdouble * v)7773 save_ProgramUniform1dv(GLuint program, GLint location, GLsizei count,
7774 const GLdouble *v)
7775 {
7776 GET_CURRENT_CONTEXT(ctx);
7777 Node *n;
7778 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7779 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1DV, 3 + POINTER_DWORDS);
7780 if (n) {
7781 n[1].ui = program;
7782 n[2].i = location;
7783 n[3].i = count;
7784 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLdouble)));
7785 }
7786 if (ctx->ExecuteFlag) {
7787 CALL_ProgramUniform1dv(ctx->Dispatch.Exec, (program, location, count, v));
7788 }
7789 }
7790
7791 void GLAPIENTRY
save_ProgramUniform2dv(GLuint program,GLint location,GLsizei count,const GLdouble * v)7792 save_ProgramUniform2dv(GLuint program, GLint location, GLsizei count,
7793 const GLdouble *v)
7794 {
7795 GET_CURRENT_CONTEXT(ctx);
7796 Node *n;
7797 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7798 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2DV, 3 + POINTER_DWORDS);
7799 if (n) {
7800 n[1].ui = program;
7801 n[2].i = location;
7802 n[3].i = count;
7803 save_pointer(&n[4], memdup(v, count * 2 * sizeof(GLdouble)));
7804 }
7805 if (ctx->ExecuteFlag) {
7806 CALL_ProgramUniform2dv(ctx->Dispatch.Exec, (program, location, count, v));
7807 }
7808 }
7809
7810 void GLAPIENTRY
save_ProgramUniform3dv(GLuint program,GLint location,GLsizei count,const GLdouble * v)7811 save_ProgramUniform3dv(GLuint program, GLint location, GLsizei count,
7812 const GLdouble *v)
7813 {
7814 GET_CURRENT_CONTEXT(ctx);
7815 Node *n;
7816 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7817 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3DV, 3 + POINTER_DWORDS);
7818 if (n) {
7819 n[1].ui = program;
7820 n[2].i = location;
7821 n[3].i = count;
7822 save_pointer(&n[4], memdup(v, count * 3 * sizeof(GLdouble)));
7823 }
7824 if (ctx->ExecuteFlag) {
7825 CALL_ProgramUniform3dv(ctx->Dispatch.Exec, (program, location, count, v));
7826 }
7827 }
7828
7829 void GLAPIENTRY
save_ProgramUniform4dv(GLuint program,GLint location,GLsizei count,const GLdouble * v)7830 save_ProgramUniform4dv(GLuint program, GLint location, GLsizei count,
7831 const GLdouble *v)
7832 {
7833 GET_CURRENT_CONTEXT(ctx);
7834 Node *n;
7835 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7836 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4DV, 3 + POINTER_DWORDS);
7837 if (n) {
7838 n[1].ui = program;
7839 n[2].i = location;
7840 n[3].i = count;
7841 save_pointer(&n[4], memdup(v, count * 4 * sizeof(GLdouble)));
7842 }
7843 if (ctx->ExecuteFlag) {
7844 CALL_ProgramUniform4dv(ctx->Dispatch.Exec, (program, location, count, v));
7845 }
7846 }
7847
7848 void GLAPIENTRY
save_ProgramUniform1i(GLuint program,GLint location,GLint x)7849 save_ProgramUniform1i(GLuint program, GLint location, GLint x)
7850 {
7851 GET_CURRENT_CONTEXT(ctx);
7852 Node *n;
7853 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7854 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1I, 3);
7855 if (n) {
7856 n[1].ui = program;
7857 n[2].i = location;
7858 n[3].i = x;
7859 }
7860 if (ctx->ExecuteFlag) {
7861 CALL_ProgramUniform1i(ctx->Dispatch.Exec, (program, location, x));
7862 }
7863 }
7864
7865 void GLAPIENTRY
save_ProgramUniform2i(GLuint program,GLint location,GLint x,GLint y)7866 save_ProgramUniform2i(GLuint program, GLint location, GLint x, GLint y)
7867 {
7868 GET_CURRENT_CONTEXT(ctx);
7869 Node *n;
7870 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7871 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2I, 4);
7872 if (n) {
7873 n[1].ui = program;
7874 n[2].i = location;
7875 n[3].i = x;
7876 n[4].i = y;
7877 }
7878 if (ctx->ExecuteFlag) {
7879 CALL_ProgramUniform2i(ctx->Dispatch.Exec, (program, location, x, y));
7880 }
7881 }
7882
7883 void GLAPIENTRY
save_ProgramUniform3i(GLuint program,GLint location,GLint x,GLint y,GLint z)7884 save_ProgramUniform3i(GLuint program, GLint location,
7885 GLint x, GLint y, GLint z)
7886 {
7887 GET_CURRENT_CONTEXT(ctx);
7888 Node *n;
7889 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7890 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3I, 5);
7891 if (n) {
7892 n[1].ui = program;
7893 n[2].i = location;
7894 n[3].i = x;
7895 n[4].i = y;
7896 n[5].i = z;
7897 }
7898 if (ctx->ExecuteFlag) {
7899 CALL_ProgramUniform3i(ctx->Dispatch.Exec, (program, location, x, y, z));
7900 }
7901 }
7902
7903 void GLAPIENTRY
save_ProgramUniform4i(GLuint program,GLint location,GLint x,GLint y,GLint z,GLint w)7904 save_ProgramUniform4i(GLuint program, GLint location,
7905 GLint x, GLint y, GLint z, GLint w)
7906 {
7907 GET_CURRENT_CONTEXT(ctx);
7908 Node *n;
7909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7910 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4I, 6);
7911 if (n) {
7912 n[1].ui = program;
7913 n[2].i = location;
7914 n[3].i = x;
7915 n[4].i = y;
7916 n[5].i = z;
7917 n[6].i = w;
7918 }
7919 if (ctx->ExecuteFlag) {
7920 CALL_ProgramUniform4i(ctx->Dispatch.Exec, (program, location, x, y, z, w));
7921 }
7922 }
7923
7924 void GLAPIENTRY
save_ProgramUniform1iv(GLuint program,GLint location,GLsizei count,const GLint * v)7925 save_ProgramUniform1iv(GLuint program, GLint location, GLsizei count,
7926 const GLint *v)
7927 {
7928 GET_CURRENT_CONTEXT(ctx);
7929 Node *n;
7930 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7931 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1IV, 3 + POINTER_DWORDS);
7932 if (n) {
7933 n[1].ui = program;
7934 n[2].i = location;
7935 n[3].i = count;
7936 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLint)));
7937 }
7938 if (ctx->ExecuteFlag) {
7939 CALL_ProgramUniform1iv(ctx->Dispatch.Exec, (program, location, count, v));
7940 }
7941 }
7942
7943 void GLAPIENTRY
save_ProgramUniform2iv(GLuint program,GLint location,GLsizei count,const GLint * v)7944 save_ProgramUniform2iv(GLuint program, GLint location, GLsizei count,
7945 const GLint *v)
7946 {
7947 GET_CURRENT_CONTEXT(ctx);
7948 Node *n;
7949 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7950 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2IV, 3 + POINTER_DWORDS);
7951 if (n) {
7952 n[1].ui = program;
7953 n[2].i = location;
7954 n[3].i = count;
7955 save_pointer(&n[4], memdup(v, count * 2 * sizeof(GLint)));
7956 }
7957 if (ctx->ExecuteFlag) {
7958 CALL_ProgramUniform2iv(ctx->Dispatch.Exec, (program, location, count, v));
7959 }
7960 }
7961
7962 void GLAPIENTRY
save_ProgramUniform3iv(GLuint program,GLint location,GLsizei count,const GLint * v)7963 save_ProgramUniform3iv(GLuint program, GLint location, GLsizei count,
7964 const GLint *v)
7965 {
7966 GET_CURRENT_CONTEXT(ctx);
7967 Node *n;
7968 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7969 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3IV, 3 + POINTER_DWORDS);
7970 if (n) {
7971 n[1].ui = program;
7972 n[2].i = location;
7973 n[3].i = count;
7974 save_pointer(&n[4], memdup(v, count * 3 * sizeof(GLint)));
7975 }
7976 if (ctx->ExecuteFlag) {
7977 CALL_ProgramUniform3iv(ctx->Dispatch.Exec, (program, location, count, v));
7978 }
7979 }
7980
7981 void GLAPIENTRY
save_ProgramUniform4iv(GLuint program,GLint location,GLsizei count,const GLint * v)7982 save_ProgramUniform4iv(GLuint program, GLint location, GLsizei count,
7983 const GLint *v)
7984 {
7985 GET_CURRENT_CONTEXT(ctx);
7986 Node *n;
7987 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
7988 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4IV, 3 + POINTER_DWORDS);
7989 if (n) {
7990 n[1].ui = program;
7991 n[2].i = location;
7992 n[3].i = count;
7993 save_pointer(&n[4], memdup(v, count * 4 * sizeof(GLint)));
7994 }
7995 if (ctx->ExecuteFlag) {
7996 CALL_ProgramUniform4iv(ctx->Dispatch.Exec, (program, location, count, v));
7997 }
7998 }
7999
8000 void GLAPIENTRY
save_ProgramUniform1ui(GLuint program,GLint location,GLuint x)8001 save_ProgramUniform1ui(GLuint program, GLint location, GLuint x)
8002 {
8003 GET_CURRENT_CONTEXT(ctx);
8004 Node *n;
8005 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8006 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1UI, 3);
8007 if (n) {
8008 n[1].ui = program;
8009 n[2].i = location;
8010 n[3].ui = x;
8011 }
8012 if (ctx->ExecuteFlag) {
8013 CALL_ProgramUniform1ui(ctx->Dispatch.Exec, (program, location, x));
8014 }
8015 }
8016
8017 void GLAPIENTRY
save_ProgramUniform2ui(GLuint program,GLint location,GLuint x,GLuint y)8018 save_ProgramUniform2ui(GLuint program, GLint location, GLuint x, GLuint y)
8019 {
8020 GET_CURRENT_CONTEXT(ctx);
8021 Node *n;
8022 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8023 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2UI, 4);
8024 if (n) {
8025 n[1].ui = program;
8026 n[2].i = location;
8027 n[3].ui = x;
8028 n[4].ui = y;
8029 }
8030 if (ctx->ExecuteFlag) {
8031 CALL_ProgramUniform2ui(ctx->Dispatch.Exec, (program, location, x, y));
8032 }
8033 }
8034
8035 void GLAPIENTRY
save_ProgramUniform3ui(GLuint program,GLint location,GLuint x,GLuint y,GLuint z)8036 save_ProgramUniform3ui(GLuint program, GLint location,
8037 GLuint x, GLuint y, GLuint z)
8038 {
8039 GET_CURRENT_CONTEXT(ctx);
8040 Node *n;
8041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8042 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3UI, 5);
8043 if (n) {
8044 n[1].ui = program;
8045 n[2].i = location;
8046 n[3].ui = x;
8047 n[4].ui = y;
8048 n[5].ui = z;
8049 }
8050 if (ctx->ExecuteFlag) {
8051 CALL_ProgramUniform3ui(ctx->Dispatch.Exec, (program, location, x, y, z));
8052 }
8053 }
8054
8055 void GLAPIENTRY
save_ProgramUniform4ui(GLuint program,GLint location,GLuint x,GLuint y,GLuint z,GLuint w)8056 save_ProgramUniform4ui(GLuint program, GLint location,
8057 GLuint x, GLuint y, GLuint z, GLuint w)
8058 {
8059 GET_CURRENT_CONTEXT(ctx);
8060 Node *n;
8061 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8062 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4UI, 6);
8063 if (n) {
8064 n[1].ui = program;
8065 n[2].i = location;
8066 n[3].ui = x;
8067 n[4].ui = y;
8068 n[5].ui = z;
8069 n[6].ui = w;
8070 }
8071 if (ctx->ExecuteFlag) {
8072 CALL_ProgramUniform4ui(ctx->Dispatch.Exec, (program, location, x, y, z, w));
8073 }
8074 }
8075
8076 void GLAPIENTRY
save_ProgramUniform1uiv(GLuint program,GLint location,GLsizei count,const GLuint * v)8077 save_ProgramUniform1uiv(GLuint program, GLint location, GLsizei count,
8078 const GLuint *v)
8079 {
8080 GET_CURRENT_CONTEXT(ctx);
8081 Node *n;
8082 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8083 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_1UIV, 3 + POINTER_DWORDS);
8084 if (n) {
8085 n[1].ui = program;
8086 n[2].i = location;
8087 n[3].i = count;
8088 save_pointer(&n[4], memdup(v, count * 1 * sizeof(GLuint)));
8089 }
8090 if (ctx->ExecuteFlag) {
8091 CALL_ProgramUniform1uiv(ctx->Dispatch.Exec, (program, location, count, v));
8092 }
8093 }
8094
8095 void GLAPIENTRY
save_ProgramUniform2uiv(GLuint program,GLint location,GLsizei count,const GLuint * v)8096 save_ProgramUniform2uiv(GLuint program, GLint location, GLsizei count,
8097 const GLuint *v)
8098 {
8099 GET_CURRENT_CONTEXT(ctx);
8100 Node *n;
8101 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8102 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_2UIV, 3 + POINTER_DWORDS);
8103 if (n) {
8104 n[1].ui = program;
8105 n[2].i = location;
8106 n[3].i = count;
8107 save_pointer(&n[4], memdup(v, count * 2 * sizeof(GLuint)));
8108 }
8109 if (ctx->ExecuteFlag) {
8110 CALL_ProgramUniform2uiv(ctx->Dispatch.Exec, (program, location, count, v));
8111 }
8112 }
8113
8114 void GLAPIENTRY
save_ProgramUniform3uiv(GLuint program,GLint location,GLsizei count,const GLuint * v)8115 save_ProgramUniform3uiv(GLuint program, GLint location, GLsizei count,
8116 const GLuint *v)
8117 {
8118 GET_CURRENT_CONTEXT(ctx);
8119 Node *n;
8120 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8121 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_3UIV, 3 + POINTER_DWORDS);
8122 if (n) {
8123 n[1].ui = program;
8124 n[2].i = location;
8125 n[3].i = count;
8126 save_pointer(&n[4], memdup(v, count * 3 * sizeof(GLuint)));
8127 }
8128 if (ctx->ExecuteFlag) {
8129 CALL_ProgramUniform3uiv(ctx->Dispatch.Exec, (program, location, count, v));
8130 }
8131 }
8132
8133 void GLAPIENTRY
save_ProgramUniform4uiv(GLuint program,GLint location,GLsizei count,const GLuint * v)8134 save_ProgramUniform4uiv(GLuint program, GLint location, GLsizei count,
8135 const GLuint *v)
8136 {
8137 GET_CURRENT_CONTEXT(ctx);
8138 Node *n;
8139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8140 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_4UIV, 3 + POINTER_DWORDS);
8141 if (n) {
8142 n[1].ui = program;
8143 n[2].i = location;
8144 n[3].i = count;
8145 save_pointer(&n[4], memdup(v, count * 4 * sizeof(GLuint)));
8146 }
8147 if (ctx->ExecuteFlag) {
8148 CALL_ProgramUniform4uiv(ctx->Dispatch.Exec, (program, location, count, v));
8149 }
8150 }
8151
8152 void GLAPIENTRY
save_ProgramUniformMatrix2fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * v)8153 save_ProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count,
8154 GLboolean transpose, const GLfloat *v)
8155 {
8156 GET_CURRENT_CONTEXT(ctx);
8157 Node *n;
8158 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8159 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX22F,
8160 4 + POINTER_DWORDS);
8161 if (n) {
8162 n[1].ui = program;
8163 n[2].i = location;
8164 n[3].i = count;
8165 n[4].b = transpose;
8166 save_pointer(&n[5], memdup(v, count * 2 * 2 * sizeof(GLfloat)));
8167 }
8168 if (ctx->ExecuteFlag) {
8169 CALL_ProgramUniformMatrix2fv(ctx->Dispatch.Exec,
8170 (program, location, count, transpose, v));
8171 }
8172 }
8173
8174 void GLAPIENTRY
save_ProgramUniformMatrix2x3fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * v)8175 save_ProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count,
8176 GLboolean transpose, const GLfloat *v)
8177 {
8178 GET_CURRENT_CONTEXT(ctx);
8179 Node *n;
8180 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8181 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX23F,
8182 4 + POINTER_DWORDS);
8183 if (n) {
8184 n[1].ui = program;
8185 n[2].i = location;
8186 n[3].i = count;
8187 n[4].b = transpose;
8188 save_pointer(&n[5], memdup(v, count * 2 * 3 * sizeof(GLfloat)));
8189 }
8190 if (ctx->ExecuteFlag) {
8191 CALL_ProgramUniformMatrix2x3fv(ctx->Dispatch.Exec,
8192 (program, location, count, transpose, v));
8193 }
8194 }
8195
8196 void GLAPIENTRY
save_ProgramUniformMatrix2x4fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * v)8197 save_ProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count,
8198 GLboolean transpose, const GLfloat *v)
8199 {
8200 GET_CURRENT_CONTEXT(ctx);
8201 Node *n;
8202 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8203 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX24F,
8204 4 + POINTER_DWORDS);
8205 if (n) {
8206 n[1].ui = program;
8207 n[2].i = location;
8208 n[3].i = count;
8209 n[4].b = transpose;
8210 save_pointer(&n[5], memdup(v, count * 2 * 4 * sizeof(GLfloat)));
8211 }
8212 if (ctx->ExecuteFlag) {
8213 CALL_ProgramUniformMatrix2x4fv(ctx->Dispatch.Exec,
8214 (program, location, count, transpose, v));
8215 }
8216 }
8217
8218 void GLAPIENTRY
save_ProgramUniformMatrix3x2fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * v)8219 save_ProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count,
8220 GLboolean transpose, const GLfloat *v)
8221 {
8222 GET_CURRENT_CONTEXT(ctx);
8223 Node *n;
8224 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8225 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX32F,
8226 4 + POINTER_DWORDS);
8227 if (n) {
8228 n[1].ui = program;
8229 n[2].i = location;
8230 n[3].i = count;
8231 n[4].b = transpose;
8232 save_pointer(&n[5], memdup(v, count * 3 * 2 * sizeof(GLfloat)));
8233 }
8234 if (ctx->ExecuteFlag) {
8235 CALL_ProgramUniformMatrix3x2fv(ctx->Dispatch.Exec,
8236 (program, location, count, transpose, v));
8237 }
8238 }
8239
8240 void GLAPIENTRY
save_ProgramUniformMatrix3fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * v)8241 save_ProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count,
8242 GLboolean transpose, const GLfloat *v)
8243 {
8244 GET_CURRENT_CONTEXT(ctx);
8245 Node *n;
8246 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8247 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX33F,
8248 4 + POINTER_DWORDS);
8249 if (n) {
8250 n[1].ui = program;
8251 n[2].i = location;
8252 n[3].i = count;
8253 n[4].b = transpose;
8254 save_pointer(&n[5], memdup(v, count * 3 * 3 * sizeof(GLfloat)));
8255 }
8256 if (ctx->ExecuteFlag) {
8257 CALL_ProgramUniformMatrix3fv(ctx->Dispatch.Exec,
8258 (program, location, count, transpose, v));
8259 }
8260 }
8261
8262 void GLAPIENTRY
save_ProgramUniformMatrix3x4fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * v)8263 save_ProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count,
8264 GLboolean transpose, const GLfloat *v)
8265 {
8266 GET_CURRENT_CONTEXT(ctx);
8267 Node *n;
8268 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8269 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX34F,
8270 4 + POINTER_DWORDS);
8271 if (n) {
8272 n[1].ui = program;
8273 n[2].i = location;
8274 n[3].i = count;
8275 n[4].b = transpose;
8276 save_pointer(&n[5], memdup(v, count * 3 * 4 * sizeof(GLfloat)));
8277 }
8278 if (ctx->ExecuteFlag) {
8279 CALL_ProgramUniformMatrix3x4fv(ctx->Dispatch.Exec,
8280 (program, location, count, transpose, v));
8281 }
8282 }
8283
8284 void GLAPIENTRY
save_ProgramUniformMatrix4x2fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * v)8285 save_ProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count,
8286 GLboolean transpose, const GLfloat *v)
8287 {
8288 GET_CURRENT_CONTEXT(ctx);
8289 Node *n;
8290 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8291 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX42F,
8292 4 + POINTER_DWORDS);
8293 if (n) {
8294 n[1].ui = program;
8295 n[2].i = location;
8296 n[3].i = count;
8297 n[4].b = transpose;
8298 save_pointer(&n[5], memdup(v, count * 4 * 2 * sizeof(GLfloat)));
8299 }
8300 if (ctx->ExecuteFlag) {
8301 CALL_ProgramUniformMatrix4x2fv(ctx->Dispatch.Exec,
8302 (program, location, count, transpose, v));
8303 }
8304 }
8305
8306 void GLAPIENTRY
save_ProgramUniformMatrix4x3fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * v)8307 save_ProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count,
8308 GLboolean transpose, const GLfloat *v)
8309 {
8310 GET_CURRENT_CONTEXT(ctx);
8311 Node *n;
8312 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8313 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX43F,
8314 4 + POINTER_DWORDS);
8315 if (n) {
8316 n[1].ui = program;
8317 n[2].i = location;
8318 n[3].i = count;
8319 n[4].b = transpose;
8320 save_pointer(&n[5], memdup(v, count * 4 * 3 * sizeof(GLfloat)));
8321 }
8322 if (ctx->ExecuteFlag) {
8323 CALL_ProgramUniformMatrix4x3fv(ctx->Dispatch.Exec,
8324 (program, location, count, transpose, v));
8325 }
8326 }
8327
8328 void GLAPIENTRY
save_ProgramUniformMatrix4fv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLfloat * v)8329 save_ProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count,
8330 GLboolean transpose, const GLfloat *v)
8331 {
8332 GET_CURRENT_CONTEXT(ctx);
8333 Node *n;
8334 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8335 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX44F,
8336 4 + POINTER_DWORDS);
8337 if (n) {
8338 n[1].ui = program;
8339 n[2].i = location;
8340 n[3].i = count;
8341 n[4].b = transpose;
8342 save_pointer(&n[5], memdup(v, count * 4 * 4 * sizeof(GLfloat)));
8343 }
8344 if (ctx->ExecuteFlag) {
8345 CALL_ProgramUniformMatrix4fv(ctx->Dispatch.Exec,
8346 (program, location, count, transpose, v));
8347 }
8348 }
8349
8350 void GLAPIENTRY
save_ProgramUniformMatrix2dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * v)8351 save_ProgramUniformMatrix2dv(GLuint program, GLint location, GLsizei count,
8352 GLboolean transpose, const GLdouble *v)
8353 {
8354 GET_CURRENT_CONTEXT(ctx);
8355 Node *n;
8356 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8357 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX22D,
8358 4 + POINTER_DWORDS);
8359 if (n) {
8360 n[1].ui = program;
8361 n[2].i = location;
8362 n[3].i = count;
8363 n[4].b = transpose;
8364 save_pointer(&n[5], memdup(v, count * 2 * 2 * sizeof(GLdouble)));
8365 }
8366 if (ctx->ExecuteFlag) {
8367 CALL_ProgramUniformMatrix2dv(ctx->Dispatch.Exec,
8368 (program, location, count, transpose, v));
8369 }
8370 }
8371
8372 void GLAPIENTRY
save_ProgramUniformMatrix2x3dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * v)8373 save_ProgramUniformMatrix2x3dv(GLuint program, GLint location, GLsizei count,
8374 GLboolean transpose, const GLdouble *v)
8375 {
8376 GET_CURRENT_CONTEXT(ctx);
8377 Node *n;
8378 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8379 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX23D,
8380 4 + POINTER_DWORDS);
8381 if (n) {
8382 n[1].ui = program;
8383 n[2].i = location;
8384 n[3].i = count;
8385 n[4].b = transpose;
8386 save_pointer(&n[5], memdup(v, count * 2 * 3 * sizeof(GLdouble)));
8387 }
8388 if (ctx->ExecuteFlag) {
8389 CALL_ProgramUniformMatrix2x3dv(ctx->Dispatch.Exec,
8390 (program, location, count, transpose, v));
8391 }
8392 }
8393
8394 void GLAPIENTRY
save_ProgramUniformMatrix2x4dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * v)8395 save_ProgramUniformMatrix2x4dv(GLuint program, GLint location, GLsizei count,
8396 GLboolean transpose, const GLdouble *v)
8397 {
8398 GET_CURRENT_CONTEXT(ctx);
8399 Node *n;
8400 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8401 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX24D,
8402 4 + POINTER_DWORDS);
8403 if (n) {
8404 n[1].ui = program;
8405 n[2].i = location;
8406 n[3].i = count;
8407 n[4].b = transpose;
8408 save_pointer(&n[5], memdup(v, count * 2 * 4 * sizeof(GLdouble)));
8409 }
8410 if (ctx->ExecuteFlag) {
8411 CALL_ProgramUniformMatrix2x4dv(ctx->Dispatch.Exec,
8412 (program, location, count, transpose, v));
8413 }
8414 }
8415
8416 void GLAPIENTRY
save_ProgramUniformMatrix3x2dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * v)8417 save_ProgramUniformMatrix3x2dv(GLuint program, GLint location, GLsizei count,
8418 GLboolean transpose, const GLdouble *v)
8419 {
8420 GET_CURRENT_CONTEXT(ctx);
8421 Node *n;
8422 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8423 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX32D,
8424 4 + POINTER_DWORDS);
8425 if (n) {
8426 n[1].ui = program;
8427 n[2].i = location;
8428 n[3].i = count;
8429 n[4].b = transpose;
8430 save_pointer(&n[5], memdup(v, count * 3 * 2 * sizeof(GLdouble)));
8431 }
8432 if (ctx->ExecuteFlag) {
8433 CALL_ProgramUniformMatrix3x2dv(ctx->Dispatch.Exec,
8434 (program, location, count, transpose, v));
8435 }
8436 }
8437
8438 void GLAPIENTRY
save_ProgramUniformMatrix3dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * v)8439 save_ProgramUniformMatrix3dv(GLuint program, GLint location, GLsizei count,
8440 GLboolean transpose, const GLdouble *v)
8441 {
8442 GET_CURRENT_CONTEXT(ctx);
8443 Node *n;
8444 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8445 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX33D,
8446 4 + POINTER_DWORDS);
8447 if (n) {
8448 n[1].ui = program;
8449 n[2].i = location;
8450 n[3].i = count;
8451 n[4].b = transpose;
8452 save_pointer(&n[5], memdup(v, count * 3 * 3 * sizeof(GLdouble)));
8453 }
8454 if (ctx->ExecuteFlag) {
8455 CALL_ProgramUniformMatrix3dv(ctx->Dispatch.Exec,
8456 (program, location, count, transpose, v));
8457 }
8458 }
8459
8460 void GLAPIENTRY
save_ProgramUniformMatrix3x4dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * v)8461 save_ProgramUniformMatrix3x4dv(GLuint program, GLint location, GLsizei count,
8462 GLboolean transpose, const GLdouble *v)
8463 {
8464 GET_CURRENT_CONTEXT(ctx);
8465 Node *n;
8466 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8467 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX34D,
8468 4 + POINTER_DWORDS);
8469 if (n) {
8470 n[1].ui = program;
8471 n[2].i = location;
8472 n[3].i = count;
8473 n[4].b = transpose;
8474 save_pointer(&n[5], memdup(v, count * 3 * 4 * sizeof(GLdouble)));
8475 }
8476 if (ctx->ExecuteFlag) {
8477 CALL_ProgramUniformMatrix3x4dv(ctx->Dispatch.Exec,
8478 (program, location, count, transpose, v));
8479 }
8480 }
8481
8482 void GLAPIENTRY
save_ProgramUniformMatrix4x2dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * v)8483 save_ProgramUniformMatrix4x2dv(GLuint program, GLint location, GLsizei count,
8484 GLboolean transpose, const GLdouble *v)
8485 {
8486 GET_CURRENT_CONTEXT(ctx);
8487 Node *n;
8488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8489 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX42D,
8490 4 + POINTER_DWORDS);
8491 if (n) {
8492 n[1].ui = program;
8493 n[2].i = location;
8494 n[3].i = count;
8495 n[4].b = transpose;
8496 save_pointer(&n[5], memdup(v, count * 4 * 2 * sizeof(GLdouble)));
8497 }
8498 if (ctx->ExecuteFlag) {
8499 CALL_ProgramUniformMatrix4x2dv(ctx->Dispatch.Exec,
8500 (program, location, count, transpose, v));
8501 }
8502 }
8503
8504 void GLAPIENTRY
save_ProgramUniformMatrix4x3dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * v)8505 save_ProgramUniformMatrix4x3dv(GLuint program, GLint location, GLsizei count,
8506 GLboolean transpose, const GLdouble *v)
8507 {
8508 GET_CURRENT_CONTEXT(ctx);
8509 Node *n;
8510 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8511 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX43D,
8512 4 + POINTER_DWORDS);
8513 if (n) {
8514 n[1].ui = program;
8515 n[2].i = location;
8516 n[3].i = count;
8517 n[4].b = transpose;
8518 save_pointer(&n[5], memdup(v, count * 4 * 3 * sizeof(GLdouble)));
8519 }
8520 if (ctx->ExecuteFlag) {
8521 CALL_ProgramUniformMatrix4x3dv(ctx->Dispatch.Exec,
8522 (program, location, count, transpose, v));
8523 }
8524 }
8525
8526 void GLAPIENTRY
save_ProgramUniformMatrix4dv(GLuint program,GLint location,GLsizei count,GLboolean transpose,const GLdouble * v)8527 save_ProgramUniformMatrix4dv(GLuint program, GLint location, GLsizei count,
8528 GLboolean transpose, const GLdouble *v)
8529 {
8530 GET_CURRENT_CONTEXT(ctx);
8531 Node *n;
8532 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8533 n = alloc_instruction(ctx, OPCODE_PROGRAM_UNIFORM_MATRIX44D,
8534 4 + POINTER_DWORDS);
8535 if (n) {
8536 n[1].ui = program;
8537 n[2].i = location;
8538 n[3].i = count;
8539 n[4].b = transpose;
8540 save_pointer(&n[5], memdup(v, count * 4 * 4 * sizeof(GLdouble)));
8541 }
8542 if (ctx->ExecuteFlag) {
8543 CALL_ProgramUniformMatrix4dv(ctx->Dispatch.Exec,
8544 (program, location, count, transpose, v));
8545 }
8546 }
8547
8548 void GLAPIENTRY
save_ClipControl(GLenum origin,GLenum depth)8549 save_ClipControl(GLenum origin, GLenum depth)
8550 {
8551 GET_CURRENT_CONTEXT(ctx);
8552 Node *n;
8553 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8554 n = alloc_instruction(ctx, OPCODE_CLIP_CONTROL, 2);
8555 if (n) {
8556 n[1].e = origin;
8557 n[2].e = depth;
8558 }
8559 if (ctx->ExecuteFlag) {
8560 CALL_ClipControl(ctx->Dispatch.Exec, (origin, depth));
8561 }
8562 }
8563
8564 void GLAPIENTRY
save_ClampColor(GLenum target,GLenum clamp)8565 save_ClampColor(GLenum target, GLenum clamp)
8566 {
8567 GET_CURRENT_CONTEXT(ctx);
8568 Node *n;
8569 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8570 n = alloc_instruction(ctx, OPCODE_CLAMP_COLOR, 2);
8571 if (n) {
8572 n[1].e = target;
8573 n[2].e = clamp;
8574 }
8575 if (ctx->ExecuteFlag) {
8576 CALL_ClampColor(ctx->Dispatch.Exec, (target, clamp));
8577 }
8578 }
8579
8580 /** GL_EXT_texture_integer */
8581 void GLAPIENTRY
save_ClearColorIiEXT(GLint red,GLint green,GLint blue,GLint alpha)8582 save_ClearColorIiEXT(GLint red, GLint green, GLint blue, GLint alpha)
8583 {
8584 GET_CURRENT_CONTEXT(ctx);
8585 Node *n;
8586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8587 n = alloc_instruction(ctx, OPCODE_CLEARCOLOR_I, 4);
8588 if (n) {
8589 n[1].i = red;
8590 n[2].i = green;
8591 n[3].i = blue;
8592 n[4].i = alpha;
8593 }
8594 if (ctx->ExecuteFlag) {
8595 CALL_ClearColorIiEXT(ctx->Dispatch.Exec, (red, green, blue, alpha));
8596 }
8597 }
8598
8599 /** GL_EXT_texture_integer */
8600 void GLAPIENTRY
save_ClearColorIuiEXT(GLuint red,GLuint green,GLuint blue,GLuint alpha)8601 save_ClearColorIuiEXT(GLuint red, GLuint green, GLuint blue, GLuint alpha)
8602 {
8603 GET_CURRENT_CONTEXT(ctx);
8604 Node *n;
8605 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8606 n = alloc_instruction(ctx, OPCODE_CLEARCOLOR_UI, 4);
8607 if (n) {
8608 n[1].ui = red;
8609 n[2].ui = green;
8610 n[3].ui = blue;
8611 n[4].ui = alpha;
8612 }
8613 if (ctx->ExecuteFlag) {
8614 CALL_ClearColorIuiEXT(ctx->Dispatch.Exec, (red, green, blue, alpha));
8615 }
8616 }
8617
8618 /** GL_EXT_texture_integer */
8619 void GLAPIENTRY
save_TexParameterIiv(GLenum target,GLenum pname,const GLint * params)8620 save_TexParameterIiv(GLenum target, GLenum pname, const GLint *params)
8621 {
8622 GET_CURRENT_CONTEXT(ctx);
8623 Node *n;
8624 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8625 n = alloc_instruction(ctx, OPCODE_TEXPARAMETER_I, 6);
8626 if (n) {
8627 n[1].e = target;
8628 n[2].e = pname;
8629 n[3].i = params[0];
8630 n[4].i = params[1];
8631 n[5].i = params[2];
8632 n[6].i = params[3];
8633 }
8634 if (ctx->ExecuteFlag) {
8635 CALL_TexParameterIiv(ctx->Dispatch.Exec, (target, pname, params));
8636 }
8637 }
8638
8639 /** GL_EXT_texture_integer */
8640 void GLAPIENTRY
save_TexParameterIuiv(GLenum target,GLenum pname,const GLuint * params)8641 save_TexParameterIuiv(GLenum target, GLenum pname, const GLuint *params)
8642 {
8643 GET_CURRENT_CONTEXT(ctx);
8644 Node *n;
8645 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8646 n = alloc_instruction(ctx, OPCODE_TEXPARAMETER_UI, 6);
8647 if (n) {
8648 n[1].e = target;
8649 n[2].e = pname;
8650 n[3].ui = params[0];
8651 n[4].ui = params[1];
8652 n[5].ui = params[2];
8653 n[6].ui = params[3];
8654 }
8655 if (ctx->ExecuteFlag) {
8656 CALL_TexParameterIuiv(ctx->Dispatch.Exec, (target, pname, params));
8657 }
8658 }
8659
8660 /* GL_EXT/ARB_instanced_arrays */
8661 void GLAPIENTRY
save_VertexAttribDivisor(GLuint index,GLuint divisor)8662 save_VertexAttribDivisor(GLuint index, GLuint divisor)
8663 {
8664 GET_CURRENT_CONTEXT(ctx);
8665 Node *n;
8666 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8667 n = alloc_instruction(ctx, OPCODE_VERTEX_ATTRIB_DIVISOR, 2);
8668 if (n) {
8669 n[1].ui = index;
8670 n[2].ui = divisor;
8671 }
8672 if (ctx->ExecuteFlag) {
8673 CALL_VertexAttribDivisor(ctx->Dispatch.Exec, (index, divisor));
8674 }
8675 }
8676
8677
8678 /* GL_NV_texture_barrier */
8679 void GLAPIENTRY
save_TextureBarrierNV(void)8680 save_TextureBarrierNV(void)
8681 {
8682 GET_CURRENT_CONTEXT(ctx);
8683 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8684 alloc_instruction(ctx, OPCODE_TEXTURE_BARRIER_NV, 0);
8685 if (ctx->ExecuteFlag) {
8686 CALL_TextureBarrierNV(ctx->Dispatch.Exec, ());
8687 }
8688 }
8689
8690
8691 /* GL_ARB_sampler_objects */
8692 void GLAPIENTRY
save_BindSampler(GLuint unit,GLuint sampler)8693 save_BindSampler(GLuint unit, GLuint sampler)
8694 {
8695 Node *n;
8696 GET_CURRENT_CONTEXT(ctx);
8697 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8698 n = alloc_instruction(ctx, OPCODE_BIND_SAMPLER, 2);
8699 if (n) {
8700 n[1].ui = unit;
8701 n[2].ui = sampler;
8702 }
8703 if (ctx->ExecuteFlag) {
8704 CALL_BindSampler(ctx->Dispatch.Exec, (unit, sampler));
8705 }
8706 }
8707
8708 void GLAPIENTRY
save_SamplerParameteriv(GLuint sampler,GLenum pname,const GLint * params)8709 save_SamplerParameteriv(GLuint sampler, GLenum pname, const GLint *params)
8710 {
8711 Node *n;
8712 GET_CURRENT_CONTEXT(ctx);
8713 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8714 n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERIV, 6);
8715 if (n) {
8716 n[1].ui = sampler;
8717 n[2].e = pname;
8718 n[3].i = params[0];
8719 if (pname == GL_TEXTURE_BORDER_COLOR) {
8720 n[4].i = params[1];
8721 n[5].i = params[2];
8722 n[6].i = params[3];
8723 }
8724 else {
8725 n[4].i = n[5].i = n[6].i = 0;
8726 }
8727 }
8728 if (ctx->ExecuteFlag) {
8729 CALL_SamplerParameteriv(ctx->Dispatch.Exec, (sampler, pname, params));
8730 }
8731 }
8732
8733 void GLAPIENTRY
save_SamplerParameteri(GLuint sampler,GLenum pname,GLint param)8734 save_SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
8735 {
8736 GLint parray[4];
8737 parray[0] = param;
8738 parray[1] = parray[2] = parray[3] = 0;
8739 save_SamplerParameteriv(sampler, pname, parray);
8740 }
8741
8742 void GLAPIENTRY
save_SamplerParameterfv(GLuint sampler,GLenum pname,const GLfloat * params)8743 save_SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *params)
8744 {
8745 Node *n;
8746 GET_CURRENT_CONTEXT(ctx);
8747 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8748 n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERFV, 6);
8749 if (n) {
8750 n[1].ui = sampler;
8751 n[2].e = pname;
8752 n[3].f = params[0];
8753 if (pname == GL_TEXTURE_BORDER_COLOR) {
8754 n[4].f = params[1];
8755 n[5].f = params[2];
8756 n[6].f = params[3];
8757 }
8758 else {
8759 n[4].f = n[5].f = n[6].f = 0.0F;
8760 }
8761 }
8762 if (ctx->ExecuteFlag) {
8763 CALL_SamplerParameterfv(ctx->Dispatch.Exec, (sampler, pname, params));
8764 }
8765 }
8766
8767 void GLAPIENTRY
save_SamplerParameterf(GLuint sampler,GLenum pname,GLfloat param)8768 save_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
8769 {
8770 GLfloat parray[4];
8771 parray[0] = param;
8772 parray[1] = parray[2] = parray[3] = 0.0F;
8773 save_SamplerParameterfv(sampler, pname, parray);
8774 }
8775
8776 void GLAPIENTRY
save_SamplerParameterIiv(GLuint sampler,GLenum pname,const GLint * params)8777 save_SamplerParameterIiv(GLuint sampler, GLenum pname, const GLint *params)
8778 {
8779 Node *n;
8780 GET_CURRENT_CONTEXT(ctx);
8781 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8782 n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERIIV, 6);
8783 if (n) {
8784 n[1].ui = sampler;
8785 n[2].e = pname;
8786 n[3].i = params[0];
8787 if (pname == GL_TEXTURE_BORDER_COLOR) {
8788 n[4].i = params[1];
8789 n[5].i = params[2];
8790 n[6].i = params[3];
8791 }
8792 else {
8793 n[4].i = n[5].i = n[6].i = 0;
8794 }
8795 }
8796 if (ctx->ExecuteFlag) {
8797 CALL_SamplerParameterIiv(ctx->Dispatch.Exec, (sampler, pname, params));
8798 }
8799 }
8800
8801 void GLAPIENTRY
save_SamplerParameterIuiv(GLuint sampler,GLenum pname,const GLuint * params)8802 save_SamplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint *params)
8803 {
8804 Node *n;
8805 GET_CURRENT_CONTEXT(ctx);
8806 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8807 n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERUIV, 6);
8808 if (n) {
8809 n[1].ui = sampler;
8810 n[2].e = pname;
8811 n[3].ui = params[0];
8812 if (pname == GL_TEXTURE_BORDER_COLOR) {
8813 n[4].ui = params[1];
8814 n[5].ui = params[2];
8815 n[6].ui = params[3];
8816 }
8817 else {
8818 n[4].ui = n[5].ui = n[6].ui = 0;
8819 }
8820 }
8821 if (ctx->ExecuteFlag) {
8822 CALL_SamplerParameterIuiv(ctx->Dispatch.Exec, (sampler, pname, params));
8823 }
8824 }
8825
8826 void GLAPIENTRY
save_WaitSync(GLsync sync,GLbitfield flags,GLuint64 timeout)8827 save_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
8828 {
8829 Node *n;
8830 GET_CURRENT_CONTEXT(ctx);
8831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8832 n = alloc_instruction(ctx, OPCODE_WAIT_SYNC, 4);
8833 if (n) {
8834 union uint64_pair p;
8835 p.uint64 = timeout;
8836 n[1].bf = flags;
8837 n[2].ui = p.uint32[0];
8838 n[3].ui = p.uint32[1];
8839 save_pointer(&n[4], sync);
8840 }
8841 if (ctx->ExecuteFlag) {
8842 CALL_WaitSync(ctx->Dispatch.Exec, (sync, flags, timeout));
8843 }
8844 }
8845
8846
8847 /** GL_NV_conditional_render */
8848 void GLAPIENTRY
save_BeginConditionalRender(GLuint queryId,GLenum mode)8849 save_BeginConditionalRender(GLuint queryId, GLenum mode)
8850 {
8851 GET_CURRENT_CONTEXT(ctx);
8852 Node *n;
8853 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8854 n = alloc_instruction(ctx, OPCODE_BEGIN_CONDITIONAL_RENDER, 2);
8855 if (n) {
8856 n[1].i = queryId;
8857 n[2].e = mode;
8858 }
8859 if (ctx->ExecuteFlag) {
8860 CALL_BeginConditionalRender(ctx->Dispatch.Exec, (queryId, mode));
8861 }
8862 }
8863
8864 void GLAPIENTRY
save_EndConditionalRender(void)8865 save_EndConditionalRender(void)
8866 {
8867 GET_CURRENT_CONTEXT(ctx);
8868 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8869 alloc_instruction(ctx, OPCODE_END_CONDITIONAL_RENDER, 0);
8870 if (ctx->ExecuteFlag) {
8871 CALL_EndConditionalRender(ctx->Dispatch.Exec, ());
8872 }
8873 }
8874
8875 void GLAPIENTRY
save_UniformBlockBinding(GLuint prog,GLuint index,GLuint binding)8876 save_UniformBlockBinding(GLuint prog, GLuint index, GLuint binding)
8877 {
8878 GET_CURRENT_CONTEXT(ctx);
8879 Node *n;
8880 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8881 n = alloc_instruction(ctx, OPCODE_UNIFORM_BLOCK_BINDING, 3);
8882 if (n) {
8883 n[1].ui = prog;
8884 n[2].ui = index;
8885 n[3].ui = binding;
8886 }
8887 if (ctx->ExecuteFlag) {
8888 CALL_UniformBlockBinding(ctx->Dispatch.Exec, (prog, index, binding));
8889 }
8890 }
8891
8892 void GLAPIENTRY
save_UniformSubroutinesuiv(GLenum shadertype,GLsizei count,const GLuint * indices)8893 save_UniformSubroutinesuiv(GLenum shadertype, GLsizei count,
8894 const GLuint *indices)
8895 {
8896 GET_CURRENT_CONTEXT(ctx);
8897 Node *n;
8898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8899 n = alloc_instruction(ctx, OPCODE_UNIFORM_SUBROUTINES, 2 + POINTER_DWORDS);
8900 if (n) {
8901 GLint *indices_copy = NULL;
8902
8903 if (count > 0)
8904 indices_copy = memdup(indices, sizeof(GLuint) * 4 * count);
8905 n[1].e = shadertype;
8906 n[2].si = count;
8907 save_pointer(&n[3], indices_copy);
8908 }
8909 if (ctx->ExecuteFlag) {
8910 CALL_UniformSubroutinesuiv(ctx->Dispatch.Exec, (shadertype, count, indices));
8911 }
8912 }
8913
8914 /** GL_EXT_window_rectangles */
8915 void GLAPIENTRY
save_WindowRectanglesEXT(GLenum mode,GLsizei count,const GLint * box)8916 save_WindowRectanglesEXT(GLenum mode, GLsizei count, const GLint *box)
8917 {
8918 GET_CURRENT_CONTEXT(ctx);
8919 Node *n;
8920 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8921 n = alloc_instruction(ctx, OPCODE_WINDOW_RECTANGLES, 2 + POINTER_DWORDS);
8922 if (n) {
8923 GLint *box_copy = NULL;
8924
8925 if (count > 0)
8926 box_copy = memdup(box, sizeof(GLint) * 4 * count);
8927 n[1].e = mode;
8928 n[2].si = count;
8929 save_pointer(&n[3], box_copy);
8930 }
8931 if (ctx->ExecuteFlag) {
8932 CALL_WindowRectanglesEXT(ctx->Dispatch.Exec, (mode, count, box));
8933 }
8934 }
8935
8936
8937 /** GL_NV_conservative_raster */
8938 void GLAPIENTRY
save_SubpixelPrecisionBiasNV(GLuint xbits,GLuint ybits)8939 save_SubpixelPrecisionBiasNV(GLuint xbits, GLuint ybits)
8940 {
8941 GET_CURRENT_CONTEXT(ctx);
8942 Node *n;
8943 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8944 n = alloc_instruction(ctx, OPCODE_SUBPIXEL_PRECISION_BIAS, 2);
8945 if (n) {
8946 n[1].ui = xbits;
8947 n[2].ui = ybits;
8948 }
8949 if (ctx->ExecuteFlag) {
8950 CALL_SubpixelPrecisionBiasNV(ctx->Dispatch.Exec, (xbits, ybits));
8951 }
8952 }
8953
8954 /** GL_NV_conservative_raster_dilate */
8955 void GLAPIENTRY
save_ConservativeRasterParameterfNV(GLenum pname,GLfloat param)8956 save_ConservativeRasterParameterfNV(GLenum pname, GLfloat param)
8957 {
8958 GET_CURRENT_CONTEXT(ctx);
8959 Node *n;
8960 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8961 n = alloc_instruction(ctx, OPCODE_CONSERVATIVE_RASTER_PARAMETER_F, 2);
8962 if (n) {
8963 n[1].e = pname;
8964 n[2].f = param;
8965 }
8966 if (ctx->ExecuteFlag) {
8967 CALL_ConservativeRasterParameterfNV(ctx->Dispatch.Exec, (pname, param));
8968 }
8969 }
8970
8971 /** GL_NV_conservative_raster_pre_snap_triangles */
8972 void GLAPIENTRY
save_ConservativeRasterParameteriNV(GLenum pname,GLint param)8973 save_ConservativeRasterParameteriNV(GLenum pname, GLint param)
8974 {
8975 GET_CURRENT_CONTEXT(ctx);
8976 Node *n;
8977 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8978 n = alloc_instruction(ctx, OPCODE_CONSERVATIVE_RASTER_PARAMETER_I, 2);
8979 if (n) {
8980 n[1].e = pname;
8981 n[2].i = param;
8982 }
8983 if (ctx->ExecuteFlag) {
8984 CALL_ConservativeRasterParameteriNV(ctx->Dispatch.Exec, (pname, param));
8985 }
8986 }
8987
8988 /** GL_EXT_direct_state_access */
8989
8990 void GLAPIENTRY
save_MatrixLoadfEXT(GLenum matrixMode,const GLfloat * m)8991 save_MatrixLoadfEXT(GLenum matrixMode, const GLfloat *m)
8992 {
8993 GET_CURRENT_CONTEXT(ctx);
8994 Node *n;
8995 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
8996 n = alloc_instruction(ctx, OPCODE_MATRIX_LOAD, 17);
8997 if (n) {
8998 n[1].e = matrixMode;
8999 for (unsigned i = 0; i < 16; i++) {
9000 n[2 + i].f = m[i];
9001 }
9002 }
9003 if (ctx->ExecuteFlag) {
9004 CALL_MatrixLoadfEXT(ctx->Dispatch.Exec, (matrixMode, m));
9005 }
9006 }
9007
9008 void GLAPIENTRY
save_MatrixLoaddEXT(GLenum matrixMode,const GLdouble * m)9009 save_MatrixLoaddEXT(GLenum matrixMode, const GLdouble *m)
9010 {
9011 GLfloat f[16];
9012 for (unsigned i = 0; i < 16; i++) {
9013 f[i] = (GLfloat) m[i];
9014 }
9015 save_MatrixLoadfEXT(matrixMode, f);
9016 }
9017
9018 void GLAPIENTRY
save_MatrixMultfEXT(GLenum matrixMode,const GLfloat * m)9019 save_MatrixMultfEXT(GLenum matrixMode, const GLfloat * m)
9020 {
9021 GET_CURRENT_CONTEXT(ctx);
9022 Node *n;
9023 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9024 n = alloc_instruction(ctx, OPCODE_MATRIX_MULT, 17);
9025 if (n) {
9026 n[1].e = matrixMode;
9027 for (unsigned i = 0; i < 16; i++) {
9028 n[2 + i].f = m[i];
9029 }
9030 }
9031 if (ctx->ExecuteFlag) {
9032 CALL_MatrixMultfEXT(ctx->Dispatch.Exec, (matrixMode, m));
9033 }
9034 }
9035
9036 void GLAPIENTRY
save_MatrixMultdEXT(GLenum matrixMode,const GLdouble * m)9037 save_MatrixMultdEXT(GLenum matrixMode, const GLdouble * m)
9038 {
9039 GLfloat f[16];
9040 for (unsigned i = 0; i < 16; i++) {
9041 f[i] = (GLfloat) m[i];
9042 }
9043 save_MatrixMultfEXT(matrixMode, f);
9044 }
9045
9046 void GLAPIENTRY
save_MatrixRotatefEXT(GLenum matrixMode,GLfloat angle,GLfloat x,GLfloat y,GLfloat z)9047 save_MatrixRotatefEXT(GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
9048 {
9049 GET_CURRENT_CONTEXT(ctx);
9050 Node *n;
9051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9052 n = alloc_instruction(ctx, OPCODE_MATRIX_ROTATE, 5);
9053 if (n) {
9054 n[1].e = matrixMode;
9055 n[2].f = angle;
9056 n[3].f = x;
9057 n[4].f = y;
9058 n[5].f = z;
9059 }
9060 if (ctx->ExecuteFlag) {
9061 CALL_MatrixRotatefEXT(ctx->Dispatch.Exec, (matrixMode, angle, x, y, z));
9062 }
9063 }
9064
9065 void GLAPIENTRY
save_MatrixRotatedEXT(GLenum matrixMode,GLdouble angle,GLdouble x,GLdouble y,GLdouble z)9066 save_MatrixRotatedEXT(GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
9067 {
9068 save_MatrixRotatefEXT(matrixMode, (GLfloat) angle, (GLfloat) x, (GLfloat) y, (GLfloat) z);
9069 }
9070
9071 void GLAPIENTRY
save_MatrixScalefEXT(GLenum matrixMode,GLfloat x,GLfloat y,GLfloat z)9072 save_MatrixScalefEXT(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z)
9073 {
9074 GET_CURRENT_CONTEXT(ctx);
9075 Node *n;
9076 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9077 n = alloc_instruction(ctx, OPCODE_MATRIX_SCALE, 4);
9078 if (n) {
9079 n[1].e = matrixMode;
9080 n[2].f = x;
9081 n[3].f = y;
9082 n[4].f = z;
9083 }
9084 if (ctx->ExecuteFlag) {
9085 CALL_MatrixScalefEXT(ctx->Dispatch.Exec, (matrixMode, x, y, z));
9086 }
9087 }
9088
9089 void GLAPIENTRY
save_MatrixScaledEXT(GLenum matrixMode,GLdouble x,GLdouble y,GLdouble z)9090 save_MatrixScaledEXT(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z)
9091 {
9092 save_MatrixScalefEXT(matrixMode, (GLfloat) x, (GLfloat) y, (GLfloat) z);
9093 }
9094
9095 void GLAPIENTRY
save_MatrixTranslatefEXT(GLenum matrixMode,GLfloat x,GLfloat y,GLfloat z)9096 save_MatrixTranslatefEXT(GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z)
9097 {
9098 GET_CURRENT_CONTEXT(ctx);
9099 Node *n;
9100 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9101 n = alloc_instruction(ctx, OPCODE_MATRIX_TRANSLATE, 4);
9102 if (n) {
9103 n[1].e = matrixMode;
9104 n[2].f = x;
9105 n[3].f = y;
9106 n[4].f = z;
9107 }
9108 if (ctx->ExecuteFlag) {
9109 CALL_MatrixTranslatefEXT(ctx->Dispatch.Exec, (matrixMode, x, y, z));
9110 }
9111 }
9112
9113 void GLAPIENTRY
save_MatrixTranslatedEXT(GLenum matrixMode,GLdouble x,GLdouble y,GLdouble z)9114 save_MatrixTranslatedEXT(GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z)
9115 {
9116 save_MatrixTranslatefEXT(matrixMode, (GLfloat) x, (GLfloat) y, (GLfloat) z);
9117 }
9118
9119 void GLAPIENTRY
save_MatrixLoadIdentityEXT(GLenum matrixMode)9120 save_MatrixLoadIdentityEXT(GLenum matrixMode)
9121 {
9122 GET_CURRENT_CONTEXT(ctx);
9123 Node *n;
9124 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9125 n = alloc_instruction(ctx, OPCODE_MATRIX_LOAD_IDENTITY, 1);
9126 if (n) {
9127 n[1].e = matrixMode;
9128 }
9129 if (ctx->ExecuteFlag) {
9130 CALL_MatrixLoadIdentityEXT(ctx->Dispatch.Exec, (matrixMode));
9131 }
9132 }
9133
9134 void GLAPIENTRY
save_MatrixOrthoEXT(GLenum matrixMode,GLdouble left,GLdouble right,GLdouble bottom,GLdouble top,GLdouble nearval,GLdouble farval)9135 save_MatrixOrthoEXT(GLenum matrixMode, GLdouble left, GLdouble right,
9136 GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
9137 {
9138 GET_CURRENT_CONTEXT(ctx);
9139 Node *n;
9140 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9141 n = alloc_instruction(ctx, OPCODE_MATRIX_ORTHO, 7);
9142 if (n) {
9143 n[1].e = matrixMode;
9144 n[2].f = (GLfloat) left;
9145 n[3].f = (GLfloat) right;
9146 n[4].f = (GLfloat) bottom;
9147 n[5].f = (GLfloat) top;
9148 n[6].f = (GLfloat) nearval;
9149 n[7].f = (GLfloat) farval;
9150 }
9151 if (ctx->ExecuteFlag) {
9152 CALL_MatrixOrthoEXT(ctx->Dispatch.Exec, (matrixMode, left, right, bottom, top, nearval, farval));
9153 }
9154 }
9155
9156
9157 void GLAPIENTRY
save_MatrixFrustumEXT(GLenum matrixMode,GLdouble left,GLdouble right,GLdouble bottom,GLdouble top,GLdouble nearval,GLdouble farval)9158 save_MatrixFrustumEXT(GLenum matrixMode, GLdouble left, GLdouble right,
9159 GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval)
9160 {
9161 GET_CURRENT_CONTEXT(ctx);
9162 Node *n;
9163 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9164 n = alloc_instruction(ctx, OPCODE_MATRIX_FRUSTUM, 7);
9165 if (n) {
9166 n[1].e = matrixMode;
9167 n[2].f = (GLfloat) left;
9168 n[3].f = (GLfloat) right;
9169 n[4].f = (GLfloat) bottom;
9170 n[5].f = (GLfloat) top;
9171 n[6].f = (GLfloat) nearval;
9172 n[7].f = (GLfloat) farval;
9173 }
9174 if (ctx->ExecuteFlag) {
9175 CALL_MatrixFrustumEXT(ctx->Dispatch.Exec, (matrixMode, left, right, bottom, top, nearval, farval));
9176 }
9177 }
9178
9179 void GLAPIENTRY
save_MatrixPushEXT(GLenum matrixMode)9180 save_MatrixPushEXT(GLenum matrixMode)
9181 {
9182 GET_CURRENT_CONTEXT(ctx);
9183 Node* n;
9184 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9185 n = alloc_instruction(ctx, OPCODE_MATRIX_PUSH, 1);
9186 if (n) {
9187 n[1].e = matrixMode;
9188 }
9189 if (ctx->ExecuteFlag) {
9190 CALL_MatrixPushEXT(ctx->Dispatch.Exec, (matrixMode));
9191 }
9192 }
9193
9194 void GLAPIENTRY
save_MatrixPopEXT(GLenum matrixMode)9195 save_MatrixPopEXT(GLenum matrixMode)
9196 {
9197 GET_CURRENT_CONTEXT(ctx);
9198 Node* n;
9199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9200 n = alloc_instruction(ctx, OPCODE_MATRIX_POP, 1);
9201 if (n) {
9202 n[1].e = matrixMode;
9203 }
9204 if (ctx->ExecuteFlag) {
9205 CALL_MatrixPopEXT(ctx->Dispatch.Exec, (matrixMode));
9206 }
9207 }
9208
9209 void GLAPIENTRY
save_MatrixLoadTransposefEXT(GLenum matrixMode,const GLfloat * m)9210 save_MatrixLoadTransposefEXT(GLenum matrixMode, const GLfloat *m)
9211 {
9212 GLfloat tm[16];
9213 _math_transposef(tm, m);
9214 save_MatrixLoadfEXT(matrixMode, tm);
9215 }
9216
9217 void GLAPIENTRY
save_MatrixLoadTransposedEXT(GLenum matrixMode,const GLdouble * m)9218 save_MatrixLoadTransposedEXT(GLenum matrixMode, const GLdouble *m)
9219 {
9220 GLfloat tm[16];
9221 _math_transposefd(tm, m);
9222 save_MatrixLoadfEXT(matrixMode, tm);
9223 }
9224
9225 void GLAPIENTRY
save_MatrixMultTransposefEXT(GLenum matrixMode,const GLfloat * m)9226 save_MatrixMultTransposefEXT(GLenum matrixMode, const GLfloat *m)
9227 {
9228 GLfloat tm[16];
9229 _math_transposef(tm, m);
9230 save_MatrixMultfEXT(matrixMode, tm);
9231 }
9232
9233 void GLAPIENTRY
save_MatrixMultTransposedEXT(GLenum matrixMode,const GLdouble * m)9234 save_MatrixMultTransposedEXT(GLenum matrixMode, const GLdouble *m)
9235 {
9236 GLfloat tm[16];
9237 _math_transposefd(tm, m);
9238 save_MatrixMultfEXT(matrixMode, tm);
9239 }
9240
9241 void GLAPIENTRY
save_TextureParameterfvEXT(GLuint texture,GLenum target,GLenum pname,const GLfloat * params)9242 save_TextureParameterfvEXT(GLuint texture, GLenum target, GLenum pname,
9243 const GLfloat *params)
9244 {
9245 GET_CURRENT_CONTEXT(ctx);
9246 Node *n;
9247 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9248 n = alloc_instruction(ctx, OPCODE_TEXTUREPARAMETER_F, 7);
9249 if (n) {
9250 n[1].ui = texture;
9251 n[2].e = target;
9252 n[3].e = pname;
9253 n[4].f = params[0];
9254 n[5].f = params[1];
9255 n[6].f = params[2];
9256 n[7].f = params[3];
9257 }
9258 if (ctx->ExecuteFlag) {
9259 CALL_TextureParameterfvEXT(ctx->Dispatch.Exec, (texture, target, pname, params));
9260 }
9261 }
9262
9263
9264 void GLAPIENTRY
save_TextureParameterfEXT(GLuint texture,GLenum target,GLenum pname,GLfloat param)9265 save_TextureParameterfEXT(GLuint texture, GLenum target, GLenum pname, GLfloat param)
9266 {
9267 GLfloat parray[4];
9268 parray[0] = param;
9269 parray[1] = parray[2] = parray[3] = 0.0F;
9270 save_TextureParameterfvEXT(texture, target, pname, parray);
9271 }
9272
9273 void GLAPIENTRY
save_TextureParameterivEXT(GLuint texture,GLenum target,GLenum pname,const GLint * params)9274 save_TextureParameterivEXT(GLuint texture, GLenum target, GLenum pname, const GLint *params)
9275 {
9276 GET_CURRENT_CONTEXT(ctx);
9277 Node *n;
9278 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9279 n = alloc_instruction(ctx, OPCODE_TEXTUREPARAMETER_I, 7);
9280 if (n) {
9281 n[1].ui = texture;
9282 n[2].e = target;
9283 n[3].e = pname;
9284 n[4].i = params[0];
9285 n[5].i = params[1];
9286 n[6].i = params[2];
9287 n[7].i = params[3];
9288 }
9289 if (ctx->ExecuteFlag) {
9290 CALL_TextureParameterivEXT(ctx->Dispatch.Exec, (texture, target, pname, params));
9291 }
9292 }
9293
9294 void GLAPIENTRY
save_TextureParameteriEXT(GLuint texture,GLenum target,GLenum pname,GLint param)9295 save_TextureParameteriEXT(GLuint texture, GLenum target, GLenum pname, GLint param)
9296 {
9297 GLint fparam[4];
9298 fparam[0] = param;
9299 fparam[1] = fparam[2] = fparam[3] = 0;
9300 save_TextureParameterivEXT(texture, target, pname, fparam);
9301 }
9302
9303 void GLAPIENTRY
save_TextureParameterIivEXT(GLuint texture,GLenum target,GLenum pname,const GLint * params)9304 save_TextureParameterIivEXT(GLuint texture, GLenum target, GLenum pname, const GLint* params)
9305 {
9306 GET_CURRENT_CONTEXT(ctx);
9307 Node *n;
9308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9309 n = alloc_instruction(ctx, OPCODE_TEXTUREPARAMETER_II, 7);
9310 if (n) {
9311 n[1].ui = texture;
9312 n[2].e = target;
9313 n[3].e = pname;
9314 n[4].i = params[0];
9315 n[5].i = params[1];
9316 n[6].i = params[2];
9317 n[7].i = params[3];
9318 }
9319 if (ctx->ExecuteFlag) {
9320 CALL_TextureParameterIivEXT(ctx->Dispatch.Exec, (texture, target, pname, params));
9321 }
9322 }
9323
9324 void GLAPIENTRY
save_TextureParameterIuivEXT(GLuint texture,GLenum target,GLenum pname,const GLuint * params)9325 save_TextureParameterIuivEXT(GLuint texture, GLenum target, GLenum pname, const GLuint* params)
9326 {
9327 GET_CURRENT_CONTEXT(ctx);
9328 Node *n;
9329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9330 n = alloc_instruction(ctx, OPCODE_TEXTUREPARAMETER_IUI, 7);
9331 if (n) {
9332 n[1].ui = texture;
9333 n[2].e = target;
9334 n[3].e = pname;
9335 n[4].ui = params[0];
9336 n[5].ui = params[1];
9337 n[6].ui = params[2];
9338 n[7].ui = params[3];
9339 }
9340 if (ctx->ExecuteFlag) {
9341 CALL_TextureParameterIuivEXT(ctx->Dispatch.Exec, (texture, target, pname, params));
9342 }
9343 }
9344
9345
9346 void GLAPIENTRY
save_TextureImage1DEXT(GLuint texture,GLenum target,GLint level,GLint components,GLsizei width,GLint border,GLenum format,GLenum type,const GLvoid * pixels)9347 save_TextureImage1DEXT(GLuint texture, GLenum target,
9348 GLint level, GLint components,
9349 GLsizei width, GLint border,
9350 GLenum format, GLenum type, const GLvoid * pixels)
9351 {
9352 GET_CURRENT_CONTEXT(ctx);
9353 if (target == GL_PROXY_TEXTURE_1D) {
9354 /* don't compile, execute immediately */
9355 CALL_TextureImage1DEXT(ctx->Dispatch.Exec, (texture, target, level, components, width,
9356 border, format, type, pixels));
9357 }
9358 else {
9359 Node *n;
9360 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9361 n = alloc_instruction(ctx, OPCODE_TEXTURE_IMAGE1D, 8 + POINTER_DWORDS);
9362 if (n) {
9363 n[1].ui = texture;
9364 n[2].e = target;
9365 n[3].i = level;
9366 n[4].i = components;
9367 n[5].i = (GLint) width;
9368 n[6].i = border;
9369 n[7].e = format;
9370 n[8].e = type;
9371 save_pointer(&n[9],
9372 unpack_image(ctx, 1, width, 1, 1, format, type,
9373 pixels, &ctx->Unpack));
9374 }
9375 if (ctx->ExecuteFlag) {
9376 CALL_TextureImage1DEXT(ctx->Dispatch.Exec, (texture, target, level, components, width,
9377 border, format, type, pixels));
9378 }
9379 }
9380 }
9381
9382
9383 void GLAPIENTRY
save_TextureImage2DEXT(GLuint texture,GLenum target,GLint level,GLint components,GLsizei width,GLsizei height,GLint border,GLenum format,GLenum type,const GLvoid * pixels)9384 save_TextureImage2DEXT(GLuint texture, GLenum target,
9385 GLint level, GLint components,
9386 GLsizei width, GLsizei height, GLint border,
9387 GLenum format, GLenum type, const GLvoid * pixels)
9388 {
9389 GET_CURRENT_CONTEXT(ctx);
9390 if (target == GL_PROXY_TEXTURE_2D) {
9391 /* don't compile, execute immediately */
9392 CALL_TextureImage2DEXT(ctx->Dispatch.Exec, (texture, target, level, components, width,
9393 height, border, format, type, pixels));
9394 }
9395 else {
9396 Node *n;
9397 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9398 n = alloc_instruction(ctx, OPCODE_TEXTURE_IMAGE2D, 9 + POINTER_DWORDS);
9399 if (n) {
9400 n[1].ui = texture;
9401 n[2].e = target;
9402 n[3].i = level;
9403 n[4].i = components;
9404 n[5].i = (GLint) width;
9405 n[6].i = (GLint) height;
9406 n[7].i = border;
9407 n[8].e = format;
9408 n[9].e = type;
9409 save_pointer(&n[10],
9410 unpack_image(ctx, 2, width, height, 1, format, type,
9411 pixels, &ctx->Unpack));
9412 }
9413 if (ctx->ExecuteFlag) {
9414 CALL_TextureImage2DEXT(ctx->Dispatch.Exec, (texture, target, level, components, width,
9415 height, border, format, type, pixels));
9416 }
9417 }
9418 }
9419
9420
9421 void GLAPIENTRY
save_TextureImage3DEXT(GLuint texture,GLenum target,GLint level,GLint internalFormat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLenum format,GLenum type,const GLvoid * pixels)9422 save_TextureImage3DEXT(GLuint texture, GLenum target,
9423 GLint level, GLint internalFormat,
9424 GLsizei width, GLsizei height, GLsizei depth,
9425 GLint border,
9426 GLenum format, GLenum type, const GLvoid * pixels)
9427 {
9428 GET_CURRENT_CONTEXT(ctx);
9429 if (target == GL_PROXY_TEXTURE_3D) {
9430 /* don't compile, execute immediately */
9431 CALL_TextureImage3DEXT(ctx->Dispatch.Exec, (texture, target, level, internalFormat, width,
9432 height, depth, border, format, type,
9433 pixels));
9434 }
9435 else {
9436 Node *n;
9437 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9438 n = alloc_instruction(ctx, OPCODE_TEXTURE_IMAGE3D, 10 + POINTER_DWORDS);
9439 if (n) {
9440 n[1].ui = texture;
9441 n[2].e = target;
9442 n[3].i = level;
9443 n[4].i = (GLint) internalFormat;
9444 n[5].i = (GLint) width;
9445 n[6].i = (GLint) height;
9446 n[7].i = (GLint) depth;
9447 n[8].i = border;
9448 n[9].e = format;
9449 n[10].e = type;
9450 save_pointer(&n[11],
9451 unpack_image(ctx, 3, width, height, depth, format, type,
9452 pixels, &ctx->Unpack));
9453 }
9454 if (ctx->ExecuteFlag) {
9455 CALL_TextureImage3DEXT(ctx->Dispatch.Exec, (texture, target, level, internalFormat,
9456 width, height, depth, border, format,
9457 type, pixels));
9458 }
9459 }
9460 }
9461
9462
9463 void GLAPIENTRY
save_TextureSubImage1DEXT(GLuint texture,GLenum target,GLint level,GLint xoffset,GLsizei width,GLenum format,GLenum type,const GLvoid * pixels)9464 save_TextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset,
9465 GLsizei width, GLenum format, GLenum type,
9466 const GLvoid * pixels)
9467 {
9468 GET_CURRENT_CONTEXT(ctx);
9469 Node *n;
9470
9471 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9472
9473 n = alloc_instruction(ctx, OPCODE_TEXTURE_SUB_IMAGE1D, 7 + POINTER_DWORDS);
9474 if (n) {
9475 n[1].ui = texture;
9476 n[2].e = target;
9477 n[3].i = level;
9478 n[4].i = xoffset;
9479 n[5].i = (GLint) width;
9480 n[6].e = format;
9481 n[7].e = type;
9482 save_pointer(&n[8],
9483 unpack_image(ctx, 1, width, 1, 1, format, type,
9484 pixels, &ctx->Unpack));
9485 }
9486 if (ctx->ExecuteFlag) {
9487 CALL_TextureSubImage1DEXT(ctx->Dispatch.Exec, (texture, target, level, xoffset, width,
9488 format, type, pixels));
9489 }
9490 }
9491
9492
9493 void GLAPIENTRY
save_TextureSubImage2DEXT(GLuint texture,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLenum type,const GLvoid * pixels)9494 save_TextureSubImage2DEXT(GLuint texture, GLenum target, GLint level,
9495 GLint xoffset, GLint yoffset,
9496 GLsizei width, GLsizei height,
9497 GLenum format, GLenum type, const GLvoid * pixels)
9498 {
9499 GET_CURRENT_CONTEXT(ctx);
9500 Node *n;
9501
9502 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9503
9504 n = alloc_instruction(ctx, OPCODE_TEXTURE_SUB_IMAGE2D, 9 + POINTER_DWORDS);
9505 if (n) {
9506 n[1].ui = texture;
9507 n[2].e = target;
9508 n[3].i = level;
9509 n[4].i = xoffset;
9510 n[5].i = yoffset;
9511 n[6].i = (GLint) width;
9512 n[7].i = (GLint) height;
9513 n[8].e = format;
9514 n[9].e = type;
9515 save_pointer(&n[10],
9516 unpack_image(ctx, 2, width, height, 1, format, type,
9517 pixels, &ctx->Unpack));
9518 }
9519 if (ctx->ExecuteFlag) {
9520 CALL_TextureSubImage2DEXT(ctx->Dispatch.Exec, (texture, target, level, xoffset, yoffset,
9521 width, height, format, type, pixels));
9522 }
9523 }
9524
9525
9526 void GLAPIENTRY
save_TextureSubImage3DEXT(GLuint texture,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLenum type,const GLvoid * pixels)9527 save_TextureSubImage3DEXT(GLuint texture, GLenum target, GLint level,
9528 GLint xoffset, GLint yoffset, GLint zoffset,
9529 GLsizei width, GLsizei height, GLsizei depth,
9530 GLenum format, GLenum type, const GLvoid * pixels)
9531 {
9532 GET_CURRENT_CONTEXT(ctx);
9533 Node *n;
9534
9535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9536
9537 n = alloc_instruction(ctx, OPCODE_TEXTURE_SUB_IMAGE3D, 11 + POINTER_DWORDS);
9538 if (n) {
9539 n[1].ui = texture;
9540 n[2].e = target;
9541 n[3].i = level;
9542 n[4].i = xoffset;
9543 n[5].i = yoffset;
9544 n[6].i = zoffset;
9545 n[7].i = (GLint) width;
9546 n[8].i = (GLint) height;
9547 n[9].i = (GLint) depth;
9548 n[10].e = format;
9549 n[11].e = type;
9550 save_pointer(&n[12],
9551 unpack_image(ctx, 3, width, height, depth, format, type,
9552 pixels, &ctx->Unpack));
9553 }
9554 if (ctx->ExecuteFlag) {
9555 CALL_TextureSubImage3DEXT(ctx->Dispatch.Exec, (texture, target, level,
9556 xoffset, yoffset, zoffset,
9557 width, height, depth, format, type,
9558 pixels));
9559 }
9560 }
9561
9562 void GLAPIENTRY
save_CopyTextureImage1DEXT(GLuint texture,GLenum target,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLint border)9563 save_CopyTextureImage1DEXT(GLuint texture, GLenum target, GLint level,
9564 GLenum internalformat, GLint x, GLint y,
9565 GLsizei width, GLint border)
9566 {
9567 GET_CURRENT_CONTEXT(ctx);
9568 Node *n;
9569 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9570 n = alloc_instruction(ctx, OPCODE_COPY_TEXTURE_IMAGE1D, 8);
9571 if (n) {
9572 n[1].ui = texture;
9573 n[2].e = target;
9574 n[3].i = level;
9575 n[4].e = internalformat;
9576 n[5].i = x;
9577 n[6].i = y;
9578 n[7].i = width;
9579 n[8].i = border;
9580 }
9581 if (ctx->ExecuteFlag) {
9582 CALL_CopyTextureImage1DEXT(ctx->Dispatch.Exec, (texture, target, level,
9583 internalformat, x, y,
9584 width, border));
9585 }
9586 }
9587
9588 void GLAPIENTRY
save_CopyTextureImage2DEXT(GLuint texture,GLenum target,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLsizei height,GLint border)9589 save_CopyTextureImage2DEXT(GLuint texture, GLenum target, GLint level,
9590 GLenum internalformat,
9591 GLint x, GLint y, GLsizei width,
9592 GLsizei height, GLint border)
9593 {
9594 GET_CURRENT_CONTEXT(ctx);
9595 Node *n;
9596 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9597 n = alloc_instruction(ctx, OPCODE_COPY_TEXTURE_IMAGE2D, 9);
9598 if (n) {
9599 n[1].ui = texture;
9600 n[2].e = target;
9601 n[3].i = level;
9602 n[4].e = internalformat;
9603 n[5].i = x;
9604 n[6].i = y;
9605 n[7].i = width;
9606 n[8].i = height;
9607 n[9].i = border;
9608 }
9609 if (ctx->ExecuteFlag) {
9610 CALL_CopyTextureImage2DEXT(ctx->Dispatch.Exec, (texture, target, level,
9611 internalformat, x, y,
9612 width, height, border));
9613 }
9614 }
9615
9616 void GLAPIENTRY
save_CopyTextureSubImage1DEXT(GLuint texture,GLenum target,GLint level,GLint xoffset,GLint x,GLint y,GLsizei width)9617 save_CopyTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level,
9618 GLint xoffset, GLint x, GLint y, GLsizei width)
9619 {
9620 GET_CURRENT_CONTEXT(ctx);
9621 Node *n;
9622 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9623 n = alloc_instruction(ctx, OPCODE_COPY_TEXTURE_SUB_IMAGE1D, 7);
9624 if (n) {
9625 n[1].ui = texture;
9626 n[2].e = target;
9627 n[3].i = level;
9628 n[4].i = xoffset;
9629 n[5].i = x;
9630 n[6].i = y;
9631 n[7].i = width;
9632 }
9633 if (ctx->ExecuteFlag) {
9634 CALL_CopyTextureSubImage1DEXT(ctx->Dispatch.Exec,
9635 (texture, target, level, xoffset, x, y, width));
9636 }
9637 }
9638
9639 void GLAPIENTRY
save_CopyTextureSubImage2DEXT(GLuint texture,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint x,GLint y,GLsizei width,GLint height)9640 save_CopyTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level,
9641 GLint xoffset, GLint yoffset,
9642 GLint x, GLint y, GLsizei width, GLint height)
9643 {
9644 GET_CURRENT_CONTEXT(ctx);
9645 Node *n;
9646 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9647 n = alloc_instruction(ctx, OPCODE_COPY_TEXTURE_SUB_IMAGE2D, 9);
9648 if (n) {
9649 n[1].ui = texture;
9650 n[2].e = target;
9651 n[3].i = level;
9652 n[4].i = xoffset;
9653 n[5].i = yoffset;
9654 n[6].i = x;
9655 n[7].i = y;
9656 n[8].i = width;
9657 n[9].i = height;
9658 }
9659 if (ctx->ExecuteFlag) {
9660 CALL_CopyTextureSubImage2DEXT(ctx->Dispatch.Exec, (texture, target, level,
9661 xoffset, yoffset,
9662 x, y, width, height));
9663 }
9664 }
9665
9666
9667 void GLAPIENTRY
save_CopyTextureSubImage3DEXT(GLuint texture,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLint x,GLint y,GLsizei width,GLint height)9668 save_CopyTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level,
9669 GLint xoffset, GLint yoffset, GLint zoffset,
9670 GLint x, GLint y, GLsizei width, GLint height)
9671 {
9672 GET_CURRENT_CONTEXT(ctx);
9673 Node *n;
9674 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9675 n = alloc_instruction(ctx, OPCODE_COPY_TEXTURE_SUB_IMAGE3D, 10);
9676 if (n) {
9677 n[1].ui = texture;
9678 n[2].e = target;
9679 n[3].i = level;
9680 n[4].i = xoffset;
9681 n[5].i = yoffset;
9682 n[6].i = zoffset;
9683 n[7].i = x;
9684 n[8].i = y;
9685 n[9].i = width;
9686 n[10].i = height;
9687 }
9688 if (ctx->ExecuteFlag) {
9689 CALL_CopyTextureSubImage3DEXT(ctx->Dispatch.Exec, (texture, target, level,
9690 xoffset, yoffset, zoffset,
9691 x, y, width, height));
9692 }
9693 }
9694
9695
9696 void GLAPIENTRY
save_BindMultiTextureEXT(GLenum texunit,GLenum target,GLuint texture)9697 save_BindMultiTextureEXT(GLenum texunit, GLenum target, GLuint texture)
9698 {
9699 GET_CURRENT_CONTEXT(ctx);
9700 Node *n;
9701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9702 n = alloc_instruction(ctx, OPCODE_BIND_MULTITEXTURE, 3);
9703 if (n) {
9704 n[1].e = texunit;
9705 n[2].e = target;
9706 n[3].ui = texture;
9707 }
9708 if (ctx->ExecuteFlag) {
9709 CALL_BindMultiTextureEXT(ctx->Dispatch.Exec, (texunit, target, texture));
9710 }
9711 }
9712
9713
9714 void GLAPIENTRY
save_MultiTexParameterfvEXT(GLenum texunit,GLenum target,GLenum pname,const GLfloat * params)9715 save_MultiTexParameterfvEXT(GLenum texunit, GLenum target, GLenum pname,
9716 const GLfloat *params)
9717 {
9718 GET_CURRENT_CONTEXT(ctx);
9719 Node *n;
9720 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9721 n = alloc_instruction(ctx, OPCODE_MULTITEXPARAMETER_F, 7);
9722 if (n) {
9723 n[1].e = texunit;
9724 n[2].e = target;
9725 n[3].e = pname;
9726 n[4].f = params[0];
9727 n[5].f = params[1];
9728 n[6].f = params[2];
9729 n[7].f = params[3];
9730 }
9731 if (ctx->ExecuteFlag) {
9732 CALL_MultiTexParameterfvEXT(ctx->Dispatch.Exec, (texunit, target, pname, params));
9733 }
9734 }
9735
9736
9737 void GLAPIENTRY
save_MultiTexParameterfEXT(GLenum texunit,GLenum target,GLenum pname,GLfloat param)9738 save_MultiTexParameterfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param)
9739 {
9740 GLfloat parray[4];
9741 parray[0] = param;
9742 parray[1] = parray[2] = parray[3] = 0.0F;
9743 save_MultiTexParameterfvEXT(texunit, target, pname, parray);
9744 }
9745
9746 void GLAPIENTRY
save_MultiTexParameterivEXT(GLenum texunit,GLenum target,GLenum pname,const GLint * params)9747 save_MultiTexParameterivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *params)
9748 {
9749 GET_CURRENT_CONTEXT(ctx);
9750 Node *n;
9751 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9752 n = alloc_instruction(ctx, OPCODE_MULTITEXPARAMETER_I, 7);
9753 if (n) {
9754 n[1].e = texunit;
9755 n[2].e = target;
9756 n[3].e = pname;
9757 n[4].i = params[0];
9758 n[5].i = params[1];
9759 n[6].i = params[2];
9760 n[7].i = params[3];
9761 }
9762 if (ctx->ExecuteFlag) {
9763 CALL_MultiTexParameterivEXT(ctx->Dispatch.Exec, (texunit, target, pname, params));
9764 }
9765 }
9766
9767 void GLAPIENTRY
save_MultiTexParameterIivEXT(GLenum texunit,GLenum target,GLenum pname,const GLint * params)9768 save_MultiTexParameterIivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint *params)
9769 {
9770 GET_CURRENT_CONTEXT(ctx);
9771 Node *n;
9772 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9773 n = alloc_instruction(ctx, OPCODE_MULTITEXPARAMETER_II, 7);
9774 if (n) {
9775 n[1].e = texunit;
9776 n[2].e = target;
9777 n[3].e = pname;
9778 n[4].i = params[0];
9779 n[5].i = params[1];
9780 n[6].i = params[2];
9781 n[7].i = params[3];
9782 }
9783 if (ctx->ExecuteFlag) {
9784 CALL_MultiTexParameterIivEXT(ctx->Dispatch.Exec, (texunit, target, pname, params));
9785 }
9786 }
9787
9788 void GLAPIENTRY
save_MultiTexParameterIuivEXT(GLenum texunit,GLenum target,GLenum pname,const GLuint * params)9789 save_MultiTexParameterIuivEXT(GLenum texunit, GLenum target, GLenum pname, const GLuint *params)
9790 {
9791 GET_CURRENT_CONTEXT(ctx);
9792 Node *n;
9793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9794 n = alloc_instruction(ctx, OPCODE_MULTITEXPARAMETER_IUI, 7);
9795 if (n) {
9796 n[1].e = texunit;
9797 n[2].e = target;
9798 n[3].e = pname;
9799 n[4].ui = params[0];
9800 n[5].ui = params[1];
9801 n[6].ui = params[2];
9802 n[7].ui = params[3];
9803 }
9804 if (ctx->ExecuteFlag) {
9805 CALL_MultiTexParameterIuivEXT(ctx->Dispatch.Exec, (texunit, target, pname, params));
9806 }
9807 }
9808
9809 void GLAPIENTRY
save_MultiTexParameteriEXT(GLenum texunit,GLenum target,GLenum pname,GLint param)9810 save_MultiTexParameteriEXT(GLenum texunit, GLenum target, GLenum pname, GLint param)
9811 {
9812 GLint fparam[4];
9813 fparam[0] = param;
9814 fparam[1] = fparam[2] = fparam[3] = 0;
9815 save_MultiTexParameterivEXT(texunit, target, pname, fparam);
9816 }
9817
9818
9819 void GLAPIENTRY
save_MultiTexImage1DEXT(GLenum texunit,GLenum target,GLint level,GLint components,GLsizei width,GLint border,GLenum format,GLenum type,const GLvoid * pixels)9820 save_MultiTexImage1DEXT(GLenum texunit, GLenum target,
9821 GLint level, GLint components,
9822 GLsizei width, GLint border,
9823 GLenum format, GLenum type, const GLvoid * pixels)
9824 {
9825 GET_CURRENT_CONTEXT(ctx);
9826 if (target == GL_PROXY_TEXTURE_1D) {
9827 /* don't compile, execute immediately */
9828 CALL_MultiTexImage1DEXT(ctx->Dispatch.Exec, (texunit, target, level, components, width,
9829 border, format, type, pixels));
9830 }
9831 else {
9832 Node *n;
9833 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9834 n = alloc_instruction(ctx, OPCODE_MULTITEX_IMAGE1D, 8 + POINTER_DWORDS);
9835 if (n) {
9836 n[1].e = texunit;
9837 n[2].e = target;
9838 n[3].i = level;
9839 n[4].i = components;
9840 n[5].i = (GLint) width;
9841 n[6].i = border;
9842 n[7].e = format;
9843 n[8].e = type;
9844 save_pointer(&n[9],
9845 unpack_image(ctx, 1, width, 1, 1, format, type,
9846 pixels, &ctx->Unpack));
9847 }
9848 if (ctx->ExecuteFlag) {
9849 CALL_MultiTexImage1DEXT(ctx->Dispatch.Exec, (texunit, target, level, components, width,
9850 border, format, type, pixels));
9851 }
9852 }
9853 }
9854
9855
9856 void GLAPIENTRY
save_MultiTexImage2DEXT(GLenum texunit,GLenum target,GLint level,GLint components,GLsizei width,GLsizei height,GLint border,GLenum format,GLenum type,const GLvoid * pixels)9857 save_MultiTexImage2DEXT(GLenum texunit, GLenum target,
9858 GLint level, GLint components,
9859 GLsizei width, GLsizei height, GLint border,
9860 GLenum format, GLenum type, const GLvoid * pixels)
9861 {
9862 GET_CURRENT_CONTEXT(ctx);
9863 if (target == GL_PROXY_TEXTURE_2D) {
9864 /* don't compile, execute immediately */
9865 CALL_MultiTexImage2DEXT(ctx->Dispatch.Exec, (texunit, target, level, components, width,
9866 height, border, format, type, pixels));
9867 }
9868 else {
9869 Node *n;
9870 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9871 n = alloc_instruction(ctx, OPCODE_MULTITEX_IMAGE2D, 9 + POINTER_DWORDS);
9872 if (n) {
9873 n[1].e = texunit;
9874 n[2].e = target;
9875 n[3].i = level;
9876 n[4].i = components;
9877 n[5].i = (GLint) width;
9878 n[6].i = (GLint) height;
9879 n[7].i = border;
9880 n[8].e = format;
9881 n[9].e = type;
9882 save_pointer(&n[10],
9883 unpack_image(ctx, 2, width, height, 1, format, type,
9884 pixels, &ctx->Unpack));
9885 }
9886 if (ctx->ExecuteFlag) {
9887 CALL_MultiTexImage2DEXT(ctx->Dispatch.Exec, (texunit, target, level, components, width,
9888 height, border, format, type, pixels));
9889 }
9890 }
9891 }
9892
9893
9894 void GLAPIENTRY
save_MultiTexImage3DEXT(GLenum texunit,GLenum target,GLint level,GLint internalFormat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLenum format,GLenum type,const GLvoid * pixels)9895 save_MultiTexImage3DEXT(GLenum texunit, GLenum target,
9896 GLint level, GLint internalFormat,
9897 GLsizei width, GLsizei height, GLsizei depth,
9898 GLint border,
9899 GLenum format, GLenum type, const GLvoid * pixels)
9900 {
9901 GET_CURRENT_CONTEXT(ctx);
9902 if (target == GL_PROXY_TEXTURE_3D) {
9903 /* don't compile, execute immediately */
9904 CALL_MultiTexImage3DEXT(ctx->Dispatch.Exec, (texunit, target, level, internalFormat, width,
9905 height, depth, border, format, type,
9906 pixels));
9907 }
9908 else {
9909 Node *n;
9910 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9911 n = alloc_instruction(ctx, OPCODE_MULTITEX_IMAGE3D, 10 + POINTER_DWORDS);
9912 if (n) {
9913 n[1].e = texunit;
9914 n[2].e = target;
9915 n[3].i = level;
9916 n[4].i = (GLint) internalFormat;
9917 n[5].i = (GLint) width;
9918 n[6].i = (GLint) height;
9919 n[7].i = (GLint) depth;
9920 n[8].i = border;
9921 n[9].e = format;
9922 n[10].e = type;
9923 save_pointer(&n[11],
9924 unpack_image(ctx, 3, width, height, depth, format, type,
9925 pixels, &ctx->Unpack));
9926 }
9927 if (ctx->ExecuteFlag) {
9928 CALL_MultiTexImage3DEXT(ctx->Dispatch.Exec, (texunit, target, level, internalFormat,
9929 width, height, depth, border, format,
9930 type, pixels));
9931 }
9932 }
9933 }
9934
9935
9936 void GLAPIENTRY
save_MultiTexSubImage1DEXT(GLenum texunit,GLenum target,GLint level,GLint xoffset,GLsizei width,GLenum format,GLenum type,const GLvoid * pixels)9937 save_MultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset,
9938 GLsizei width, GLenum format, GLenum type,
9939 const GLvoid * pixels)
9940 {
9941 GET_CURRENT_CONTEXT(ctx);
9942 Node *n;
9943
9944 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9945
9946 n = alloc_instruction(ctx, OPCODE_MULTITEX_SUB_IMAGE1D, 7 + POINTER_DWORDS);
9947 if (n) {
9948 n[1].e = texunit;
9949 n[2].e = target;
9950 n[3].i = level;
9951 n[4].i = xoffset;
9952 n[5].i = (GLint) width;
9953 n[6].e = format;
9954 n[7].e = type;
9955 save_pointer(&n[8],
9956 unpack_image(ctx, 1, width, 1, 1, format, type,
9957 pixels, &ctx->Unpack));
9958 }
9959 if (ctx->ExecuteFlag) {
9960 CALL_MultiTexSubImage1DEXT(ctx->Dispatch.Exec, (texunit, target, level, xoffset, width,
9961 format, type, pixels));
9962 }
9963 }
9964
9965
9966 void GLAPIENTRY
save_MultiTexSubImage2DEXT(GLenum texunit,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLenum type,const GLvoid * pixels)9967 save_MultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level,
9968 GLint xoffset, GLint yoffset,
9969 GLsizei width, GLsizei height,
9970 GLenum format, GLenum type, const GLvoid * pixels)
9971 {
9972 GET_CURRENT_CONTEXT(ctx);
9973 Node *n;
9974
9975 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
9976
9977 n = alloc_instruction(ctx, OPCODE_MULTITEX_SUB_IMAGE2D, 9 + POINTER_DWORDS);
9978 if (n) {
9979 n[1].e = texunit;
9980 n[2].e = target;
9981 n[3].i = level;
9982 n[4].i = xoffset;
9983 n[5].i = yoffset;
9984 n[6].i = (GLint) width;
9985 n[7].i = (GLint) height;
9986 n[8].e = format;
9987 n[9].e = type;
9988 save_pointer(&n[10],
9989 unpack_image(ctx, 2, width, height, 1, format, type,
9990 pixels, &ctx->Unpack));
9991 }
9992 if (ctx->ExecuteFlag) {
9993 CALL_MultiTexSubImage2DEXT(ctx->Dispatch.Exec, (texunit, target, level, xoffset, yoffset,
9994 width, height, format, type, pixels));
9995 }
9996 }
9997
9998
9999 void GLAPIENTRY
save_MultiTexSubImage3DEXT(GLenum texunit,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLenum type,const GLvoid * pixels)10000 save_MultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level,
10001 GLint xoffset, GLint yoffset, GLint zoffset,
10002 GLsizei width, GLsizei height, GLsizei depth,
10003 GLenum format, GLenum type, const GLvoid * pixels)
10004 {
10005 GET_CURRENT_CONTEXT(ctx);
10006 Node *n;
10007
10008 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10009
10010 n = alloc_instruction(ctx, OPCODE_MULTITEX_SUB_IMAGE3D, 11 + POINTER_DWORDS);
10011 if (n) {
10012 n[1].e = texunit;
10013 n[2].e = target;
10014 n[3].i = level;
10015 n[4].i = xoffset;
10016 n[5].i = yoffset;
10017 n[6].i = zoffset;
10018 n[7].i = (GLint) width;
10019 n[8].i = (GLint) height;
10020 n[9].i = (GLint) depth;
10021 n[10].e = format;
10022 n[11].e = type;
10023 save_pointer(&n[12],
10024 unpack_image(ctx, 3, width, height, depth, format, type,
10025 pixels, &ctx->Unpack));
10026 }
10027 if (ctx->ExecuteFlag) {
10028 CALL_MultiTexSubImage3DEXT(ctx->Dispatch.Exec, (texunit, target, level,
10029 xoffset, yoffset, zoffset,
10030 width, height, depth, format, type,
10031 pixels));
10032 }
10033 }
10034
10035
10036 void GLAPIENTRY
save_CopyMultiTexImage1DEXT(GLenum texunit,GLenum target,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLint border)10037 save_CopyMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level,
10038 GLenum internalformat, GLint x, GLint y,
10039 GLsizei width, GLint border)
10040 {
10041 GET_CURRENT_CONTEXT(ctx);
10042 Node *n;
10043 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10044 n = alloc_instruction(ctx, OPCODE_COPY_MULTITEX_IMAGE1D, 8);
10045 if (n) {
10046 n[1].e = texunit;
10047 n[2].e = target;
10048 n[3].i = level;
10049 n[4].e = internalformat;
10050 n[5].i = x;
10051 n[6].i = y;
10052 n[7].i = width;
10053 n[8].i = border;
10054 }
10055 if (ctx->ExecuteFlag) {
10056 CALL_CopyMultiTexImage1DEXT(ctx->Dispatch.Exec, (texunit, target, level,
10057 internalformat, x, y,
10058 width, border));
10059 }
10060 }
10061
10062
10063 void GLAPIENTRY
save_CopyMultiTexImage2DEXT(GLenum texunit,GLenum target,GLint level,GLenum internalformat,GLint x,GLint y,GLsizei width,GLsizei height,GLint border)10064 save_CopyMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level,
10065 GLenum internalformat,
10066 GLint x, GLint y, GLsizei width,
10067 GLsizei height, GLint border)
10068 {
10069 GET_CURRENT_CONTEXT(ctx);
10070 Node *n;
10071 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10072 n = alloc_instruction(ctx, OPCODE_COPY_MULTITEX_IMAGE2D, 9);
10073 if (n) {
10074 n[1].e = texunit;
10075 n[2].e = target;
10076 n[3].i = level;
10077 n[4].e = internalformat;
10078 n[5].i = x;
10079 n[6].i = y;
10080 n[7].i = width;
10081 n[8].i = height;
10082 n[9].i = border;
10083 }
10084 if (ctx->ExecuteFlag) {
10085 CALL_CopyMultiTexImage2DEXT(ctx->Dispatch.Exec, (texunit, target, level,
10086 internalformat, x, y,
10087 width, height, border));
10088 }
10089 }
10090
10091
10092 void GLAPIENTRY
save_CopyMultiTexSubImage1DEXT(GLenum texunit,GLenum target,GLint level,GLint xoffset,GLint x,GLint y,GLsizei width)10093 save_CopyMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level,
10094 GLint xoffset, GLint x, GLint y, GLsizei width)
10095 {
10096 GET_CURRENT_CONTEXT(ctx);
10097 Node *n;
10098 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10099 n = alloc_instruction(ctx, OPCODE_COPY_MULTITEX_SUB_IMAGE1D, 7);
10100 if (n) {
10101 n[1].e = texunit;
10102 n[2].e = target;
10103 n[3].i = level;
10104 n[4].i = xoffset;
10105 n[5].i = x;
10106 n[6].i = y;
10107 n[7].i = width;
10108 }
10109 if (ctx->ExecuteFlag) {
10110 CALL_CopyMultiTexSubImage1DEXT(ctx->Dispatch.Exec,
10111 (texunit, target, level, xoffset, x, y, width));
10112 }
10113 }
10114
10115
10116 void GLAPIENTRY
save_CopyMultiTexSubImage2DEXT(GLenum texunit,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint x,GLint y,GLsizei width,GLint height)10117 save_CopyMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level,
10118 GLint xoffset, GLint yoffset,
10119 GLint x, GLint y, GLsizei width, GLint height)
10120 {
10121 GET_CURRENT_CONTEXT(ctx);
10122 Node *n;
10123 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10124 n = alloc_instruction(ctx, OPCODE_COPY_MULTITEX_SUB_IMAGE2D, 9);
10125 if (n) {
10126 n[1].e = texunit;
10127 n[2].e = target;
10128 n[3].i = level;
10129 n[4].i = xoffset;
10130 n[5].i = yoffset;
10131 n[6].i = x;
10132 n[7].i = y;
10133 n[8].i = width;
10134 n[9].i = height;
10135 }
10136 if (ctx->ExecuteFlag) {
10137 CALL_CopyMultiTexSubImage2DEXT(ctx->Dispatch.Exec, (texunit, target, level,
10138 xoffset, yoffset,
10139 x, y, width, height));
10140 }
10141 }
10142
10143
10144 void GLAPIENTRY
save_CopyMultiTexSubImage3DEXT(GLenum texunit,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLint x,GLint y,GLsizei width,GLint height)10145 save_CopyMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level,
10146 GLint xoffset, GLint yoffset, GLint zoffset,
10147 GLint x, GLint y, GLsizei width, GLint height)
10148 {
10149 GET_CURRENT_CONTEXT(ctx);
10150 Node *n;
10151 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10152 n = alloc_instruction(ctx, OPCODE_COPY_MULTITEX_SUB_IMAGE3D, 10);
10153 if (n) {
10154 n[1].e = texunit;
10155 n[2].e = target;
10156 n[3].i = level;
10157 n[4].i = xoffset;
10158 n[5].i = yoffset;
10159 n[6].i = zoffset;
10160 n[7].i = x;
10161 n[8].i = y;
10162 n[9].i = width;
10163 n[10].i = height;
10164 }
10165 if (ctx->ExecuteFlag) {
10166 CALL_CopyMultiTexSubImage3DEXT(ctx->Dispatch.Exec, (texunit, target, level,
10167 xoffset, yoffset, zoffset,
10168 x, y, width, height));
10169 }
10170 }
10171
10172
10173 void GLAPIENTRY
save_MultiTexEnvfvEXT(GLenum texunit,GLenum target,GLenum pname,const GLfloat * params)10174 save_MultiTexEnvfvEXT(GLenum texunit, GLenum target, GLenum pname, const GLfloat *params)
10175 {
10176 GET_CURRENT_CONTEXT(ctx);
10177 Node *n;
10178 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10179 n = alloc_instruction(ctx, OPCODE_MULTITEXENV, 7);
10180 if (n) {
10181 n[1].e = texunit;
10182 n[2].e = target;
10183 n[3].e = pname;
10184 if (pname == GL_TEXTURE_ENV_COLOR) {
10185 n[4].f = params[0];
10186 n[5].f = params[1];
10187 n[6].f = params[2];
10188 n[7].f = params[3];
10189 }
10190 else {
10191 n[4].f = params[0];
10192 n[5].f = n[6].f = n[7].f = 0.0F;
10193 }
10194 }
10195 if (ctx->ExecuteFlag) {
10196 CALL_MultiTexEnvfvEXT(ctx->Dispatch.Exec, (texunit, target, pname, params));
10197 }
10198 }
10199
10200
10201 void GLAPIENTRY
save_MultiTexEnvfEXT(GLenum texunit,GLenum target,GLenum pname,GLfloat param)10202 save_MultiTexEnvfEXT(GLenum texunit, GLenum target, GLenum pname, GLfloat param)
10203 {
10204 GLfloat parray[4];
10205 parray[0] = (GLfloat) param;
10206 parray[1] = parray[2] = parray[3] = 0.0F;
10207 save_MultiTexEnvfvEXT(texunit, target, pname, parray);
10208 }
10209
10210
10211 void GLAPIENTRY
save_MultiTexEnviEXT(GLenum texunit,GLenum target,GLenum pname,GLint param)10212 save_MultiTexEnviEXT(GLenum texunit, GLenum target, GLenum pname, GLint param)
10213 {
10214 GLfloat p[4];
10215 p[0] = (GLfloat) param;
10216 p[1] = p[2] = p[3] = 0.0F;
10217 save_MultiTexEnvfvEXT(texunit, target, pname, p);
10218 }
10219
10220
10221 void GLAPIENTRY
save_MultiTexEnvivEXT(GLenum texunit,GLenum target,GLenum pname,const GLint * param)10222 save_MultiTexEnvivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint * param)
10223 {
10224 GLfloat p[4];
10225 if (pname == GL_TEXTURE_ENV_COLOR) {
10226 p[0] = INT_TO_FLOAT(param[0]);
10227 p[1] = INT_TO_FLOAT(param[1]);
10228 p[2] = INT_TO_FLOAT(param[2]);
10229 p[3] = INT_TO_FLOAT(param[3]);
10230 }
10231 else {
10232 p[0] = (GLfloat) param[0];
10233 p[1] = p[2] = p[3] = 0.0F;
10234 }
10235 save_MultiTexEnvfvEXT(texunit, target, pname, p);
10236 }
10237
10238
10239 void GLAPIENTRY
save_CompressedTextureImage1DEXT(GLuint texture,GLenum target,GLint level,GLenum internalFormat,GLsizei width,GLint border,GLsizei imageSize,const GLvoid * data)10240 save_CompressedTextureImage1DEXT(GLuint texture, GLenum target, GLint level,
10241 GLenum internalFormat, GLsizei width,
10242 GLint border, GLsizei imageSize,
10243 const GLvoid * data)
10244 {
10245 GET_CURRENT_CONTEXT(ctx);
10246 if (target == GL_PROXY_TEXTURE_1D) {
10247 /* don't compile, execute immediately */
10248 CALL_CompressedTextureImage1DEXT(ctx->Dispatch.Exec, (texture, target, level,
10249 internalFormat, width,
10250 border, imageSize,
10251 data));
10252 }
10253 else {
10254 Node *n;
10255 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10256
10257 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEXTURE_IMAGE_1D,
10258 7 + POINTER_DWORDS);
10259 if (n) {
10260 n[1].ui = texture;
10261 n[2].e = target;
10262 n[3].i = level;
10263 n[4].e = internalFormat;
10264 n[5].i = (GLint) width;
10265 n[6].i = border;
10266 n[7].i = imageSize;
10267 save_pointer(&n[8],
10268 copy_data(data, imageSize, "glCompressedTextureImage1DEXT"));
10269 }
10270 if (ctx->ExecuteFlag) {
10271 CALL_CompressedTextureImage1DEXT(ctx->Dispatch.Exec,
10272 (texture, target, level, internalFormat,
10273 width, border, imageSize, data));
10274 }
10275 }
10276 }
10277
10278
10279 void GLAPIENTRY
save_CompressedTextureImage2DEXT(GLuint texture,GLenum target,GLint level,GLenum internalFormat,GLsizei width,GLsizei height,GLint border,GLsizei imageSize,const GLvoid * data)10280 save_CompressedTextureImage2DEXT(GLuint texture, GLenum target, GLint level,
10281 GLenum internalFormat, GLsizei width,
10282 GLsizei height, GLint border, GLsizei imageSize,
10283 const GLvoid * data)
10284 {
10285 GET_CURRENT_CONTEXT(ctx);
10286 if (target == GL_PROXY_TEXTURE_2D) {
10287 /* don't compile, execute immediately */
10288 CALL_CompressedTextureImage2DEXT(ctx->Dispatch.Exec, (texture, target, level,
10289 internalFormat, width, height,
10290 border, imageSize, data));
10291 }
10292 else {
10293 Node *n;
10294 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10295
10296 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEXTURE_IMAGE_2D,
10297 8 + POINTER_DWORDS);
10298 if (n) {
10299 n[1].ui = texture;
10300 n[2].e = target;
10301 n[3].i = level;
10302 n[4].e = internalFormat;
10303 n[5].i = (GLint) width;
10304 n[6].i = (GLint) height;
10305 n[7].i = border;
10306 n[8].i = imageSize;
10307 save_pointer(&n[9],
10308 copy_data(data, imageSize, "glCompressedTextureImage2DEXT"));
10309 }
10310 if (ctx->ExecuteFlag) {
10311 CALL_CompressedTextureImage2DEXT(ctx->Dispatch.Exec,
10312 (texture, target, level, internalFormat,
10313 width, height, border, imageSize, data));
10314 }
10315 }
10316 }
10317
10318
10319 void GLAPIENTRY
save_CompressedTextureImage3DEXT(GLuint texture,GLenum target,GLint level,GLenum internalFormat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLsizei imageSize,const GLvoid * data)10320 save_CompressedTextureImage3DEXT(GLuint texture, GLenum target, GLint level,
10321 GLenum internalFormat, GLsizei width,
10322 GLsizei height, GLsizei depth, GLint border,
10323 GLsizei imageSize, const GLvoid * data)
10324 {
10325 GET_CURRENT_CONTEXT(ctx);
10326 if (target == GL_PROXY_TEXTURE_3D) {
10327 /* don't compile, execute immediately */
10328 CALL_CompressedTextureImage3DEXT(ctx->Dispatch.Exec, (texture, target, level,
10329 internalFormat, width,
10330 height, depth, border,
10331 imageSize, data));
10332 }
10333 else {
10334 Node *n;
10335 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10336
10337 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEXTURE_IMAGE_3D,
10338 9 + POINTER_DWORDS);
10339 if (n) {
10340 n[1].ui = texture;
10341 n[2].e = target;
10342 n[3].i = level;
10343 n[4].e = internalFormat;
10344 n[5].i = (GLint) width;
10345 n[6].i = (GLint) height;
10346 n[7].i = (GLint) depth;
10347 n[8].i = border;
10348 n[9].i = imageSize;
10349 save_pointer(&n[10],
10350 copy_data(data, imageSize, "glCompressedTextureImage3DEXT"));
10351 }
10352 if (ctx->ExecuteFlag) {
10353 CALL_CompressedTextureImage3DEXT(ctx->Dispatch.Exec,
10354 (texture, target, level, internalFormat,
10355 width, height, depth, border, imageSize,
10356 data));
10357 }
10358 }
10359 }
10360
10361
10362 void GLAPIENTRY
save_CompressedTextureSubImage1DEXT(GLuint texture,GLenum target,GLint level,GLint xoffset,GLsizei width,GLenum format,GLsizei imageSize,const GLvoid * data)10363 save_CompressedTextureSubImage1DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset,
10364 GLsizei width, GLenum format,
10365 GLsizei imageSize, const GLvoid * data)
10366 {
10367 Node *n;
10368 GET_CURRENT_CONTEXT(ctx);
10369 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10370
10371 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D,
10372 7 + POINTER_DWORDS);
10373 if (n) {
10374 n[1].ui = texture;
10375 n[2].e = target;
10376 n[3].i = level;
10377 n[4].i = xoffset;
10378 n[5].i = (GLint) width;
10379 n[6].e = format;
10380 n[7].i = imageSize;
10381 save_pointer(&n[8],
10382 copy_data(data, imageSize, "glCompressedTextureSubImage1DEXT"));
10383 }
10384 if (ctx->ExecuteFlag) {
10385 CALL_CompressedTextureSubImage1DEXT(ctx->Dispatch.Exec, (texture, target, level, xoffset,
10386 width, format, imageSize, data));
10387 }
10388 }
10389
10390
10391 void GLAPIENTRY
save_CompressedTextureSubImage2DEXT(GLuint texture,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLsizei imageSize,const GLvoid * data)10392 save_CompressedTextureSubImage2DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset,
10393 GLint yoffset, GLsizei width, GLsizei height,
10394 GLenum format, GLsizei imageSize,
10395 const GLvoid * data)
10396 {
10397 Node *n;
10398 GET_CURRENT_CONTEXT(ctx);
10399 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10400
10401 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D,
10402 9 + POINTER_DWORDS);
10403 if (n) {
10404 n[1].ui = texture;
10405 n[2].e = target;
10406 n[3].i = level;
10407 n[4].i = xoffset;
10408 n[5].i = yoffset;
10409 n[6].i = (GLint) width;
10410 n[7].i = (GLint) height;
10411 n[8].e = format;
10412 n[9].i = imageSize;
10413 save_pointer(&n[10],
10414 copy_data(data, imageSize, "glCompressedTextureSubImage2DEXT"));
10415 }
10416 if (ctx->ExecuteFlag) {
10417 CALL_CompressedTextureSubImage2DEXT(ctx->Dispatch.Exec,
10418 (texture, target, level, xoffset, yoffset,
10419 width, height, format, imageSize, data));
10420 }
10421 }
10422
10423
10424 void GLAPIENTRY
save_CompressedTextureSubImage3DEXT(GLuint texture,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLsizei imageSize,const GLvoid * data)10425 save_CompressedTextureSubImage3DEXT(GLuint texture, GLenum target, GLint level, GLint xoffset,
10426 GLint yoffset, GLint zoffset, GLsizei width,
10427 GLsizei height, GLsizei depth, GLenum format,
10428 GLsizei imageSize, const GLvoid * data)
10429 {
10430 Node *n;
10431 GET_CURRENT_CONTEXT(ctx);
10432 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10433
10434 n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D,
10435 11 + POINTER_DWORDS);
10436 if (n) {
10437 n[1].ui = texture;
10438 n[2].e = target;
10439 n[3].i = level;
10440 n[4].i = xoffset;
10441 n[5].i = yoffset;
10442 n[6].i = zoffset;
10443 n[7].i = (GLint) width;
10444 n[8].i = (GLint) height;
10445 n[9].i = (GLint) depth;
10446 n[10].e = format;
10447 n[11].i = imageSize;
10448 save_pointer(&n[12],
10449 copy_data(data, imageSize, "glCompressedTextureSubImage3DEXT"));
10450 }
10451 if (ctx->ExecuteFlag) {
10452 CALL_CompressedTextureSubImage3DEXT(ctx->Dispatch.Exec,
10453 (texture, target, level, xoffset, yoffset,
10454 zoffset, width, height, depth, format,
10455 imageSize, data));
10456 }
10457 }
10458
10459
10460 void GLAPIENTRY
save_CompressedMultiTexImage1DEXT(GLenum texunit,GLenum target,GLint level,GLenum internalFormat,GLsizei width,GLint border,GLsizei imageSize,const GLvoid * data)10461 save_CompressedMultiTexImage1DEXT(GLenum texunit, GLenum target, GLint level,
10462 GLenum internalFormat, GLsizei width,
10463 GLint border, GLsizei imageSize,
10464 const GLvoid * data)
10465 {
10466 GET_CURRENT_CONTEXT(ctx);
10467 if (target == GL_PROXY_TEXTURE_1D) {
10468 /* don't compile, execute immediately */
10469 CALL_CompressedMultiTexImage1DEXT(ctx->Dispatch.Exec, (texunit, target, level,
10470 internalFormat, width,
10471 border, imageSize,
10472 data));
10473 }
10474 else {
10475 Node *n;
10476 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10477
10478 n = alloc_instruction(ctx, OPCODE_COMPRESSED_MULTITEX_IMAGE_1D,
10479 7 + POINTER_DWORDS);
10480 if (n) {
10481 n[1].e = texunit;
10482 n[2].e = target;
10483 n[3].i = level;
10484 n[4].e = internalFormat;
10485 n[5].i = (GLint) width;
10486 n[6].i = border;
10487 n[7].i = imageSize;
10488 save_pointer(&n[8],
10489 copy_data(data, imageSize, "glCompressedMultiTexImage1DEXT"));
10490 }
10491 if (ctx->ExecuteFlag) {
10492 CALL_CompressedMultiTexImage1DEXT(ctx->Dispatch.Exec,
10493 (texunit, target, level, internalFormat,
10494 width, border, imageSize, data));
10495 }
10496 }
10497 }
10498
10499
10500 void GLAPIENTRY
save_CompressedMultiTexImage2DEXT(GLenum texunit,GLenum target,GLint level,GLenum internalFormat,GLsizei width,GLsizei height,GLint border,GLsizei imageSize,const GLvoid * data)10501 save_CompressedMultiTexImage2DEXT(GLenum texunit, GLenum target, GLint level,
10502 GLenum internalFormat, GLsizei width,
10503 GLsizei height, GLint border, GLsizei imageSize,
10504 const GLvoid * data)
10505 {
10506 GET_CURRENT_CONTEXT(ctx);
10507 if (target == GL_PROXY_TEXTURE_2D) {
10508 /* don't compile, execute immediately */
10509 CALL_CompressedMultiTexImage2DEXT(ctx->Dispatch.Exec, (texunit, target, level,
10510 internalFormat, width, height,
10511 border, imageSize, data));
10512 }
10513 else {
10514 Node *n;
10515 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10516
10517 n = alloc_instruction(ctx, OPCODE_COMPRESSED_MULTITEX_IMAGE_2D,
10518 8 + POINTER_DWORDS);
10519 if (n) {
10520 n[1].e = texunit;
10521 n[2].e = target;
10522 n[3].i = level;
10523 n[4].e = internalFormat;
10524 n[5].i = (GLint) width;
10525 n[6].i = (GLint) height;
10526 n[7].i = border;
10527 n[8].i = imageSize;
10528 save_pointer(&n[9],
10529 copy_data(data, imageSize, "glCompressedMultiTexImage2DEXT"));
10530 }
10531 if (ctx->ExecuteFlag) {
10532 CALL_CompressedMultiTexImage2DEXT(ctx->Dispatch.Exec,
10533 (texunit, target, level, internalFormat,
10534 width, height, border, imageSize, data));
10535 }
10536 }
10537 }
10538
10539
10540 void GLAPIENTRY
save_CompressedMultiTexImage3DEXT(GLenum texunit,GLenum target,GLint level,GLenum internalFormat,GLsizei width,GLsizei height,GLsizei depth,GLint border,GLsizei imageSize,const GLvoid * data)10541 save_CompressedMultiTexImage3DEXT(GLenum texunit, GLenum target, GLint level,
10542 GLenum internalFormat, GLsizei width,
10543 GLsizei height, GLsizei depth, GLint border,
10544 GLsizei imageSize, const GLvoid * data)
10545 {
10546 GET_CURRENT_CONTEXT(ctx);
10547 if (target == GL_PROXY_TEXTURE_3D) {
10548 /* don't compile, execute immediately */
10549 CALL_CompressedMultiTexImage3DEXT(ctx->Dispatch.Exec, (texunit, target, level,
10550 internalFormat, width,
10551 height, depth, border,
10552 imageSize, data));
10553 }
10554 else {
10555 Node *n;
10556 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10557
10558 n = alloc_instruction(ctx, OPCODE_COMPRESSED_MULTITEX_IMAGE_3D,
10559 9 + POINTER_DWORDS);
10560 if (n) {
10561 n[1].e = texunit;
10562 n[2].e = target;
10563 n[3].i = level;
10564 n[4].e = internalFormat;
10565 n[5].i = (GLint) width;
10566 n[6].i = (GLint) height;
10567 n[7].i = (GLint) depth;
10568 n[8].i = border;
10569 n[9].i = imageSize;
10570 save_pointer(&n[10],
10571 copy_data(data, imageSize, "glCompressedMultiTexImage3DEXT"));
10572 }
10573 if (ctx->ExecuteFlag) {
10574 CALL_CompressedMultiTexImage3DEXT(ctx->Dispatch.Exec,
10575 (texunit, target, level, internalFormat,
10576 width, height, depth, border, imageSize,
10577 data));
10578 }
10579 }
10580 }
10581
10582
10583 void GLAPIENTRY
save_CompressedMultiTexSubImage1DEXT(GLenum texunit,GLenum target,GLint level,GLint xoffset,GLsizei width,GLenum format,GLsizei imageSize,const GLvoid * data)10584 save_CompressedMultiTexSubImage1DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset,
10585 GLsizei width, GLenum format,
10586 GLsizei imageSize, const GLvoid * data)
10587 {
10588 Node *n;
10589 GET_CURRENT_CONTEXT(ctx);
10590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10591
10592 n = alloc_instruction(ctx, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D,
10593 7 + POINTER_DWORDS);
10594 if (n) {
10595 n[1].e = texunit;
10596 n[2].e = target;
10597 n[3].i = level;
10598 n[4].i = xoffset;
10599 n[5].i = (GLint) width;
10600 n[6].e = format;
10601 n[7].i = imageSize;
10602 save_pointer(&n[8],
10603 copy_data(data, imageSize, "glCompressedMultiTexSubImage1DEXT"));
10604 }
10605 if (ctx->ExecuteFlag) {
10606 CALL_CompressedMultiTexSubImage1DEXT(ctx->Dispatch.Exec, (texunit, target, level, xoffset,
10607 width, format, imageSize, data));
10608 }
10609 }
10610
10611
10612 void GLAPIENTRY
save_CompressedMultiTexSubImage2DEXT(GLenum texunit,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLsizei width,GLsizei height,GLenum format,GLsizei imageSize,const GLvoid * data)10613 save_CompressedMultiTexSubImage2DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset,
10614 GLint yoffset, GLsizei width, GLsizei height,
10615 GLenum format, GLsizei imageSize,
10616 const GLvoid * data)
10617 {
10618 Node *n;
10619 GET_CURRENT_CONTEXT(ctx);
10620 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10621
10622 n = alloc_instruction(ctx, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D,
10623 9 + POINTER_DWORDS);
10624 if (n) {
10625 n[1].e = texunit;
10626 n[2].e = target;
10627 n[3].i = level;
10628 n[4].i = xoffset;
10629 n[5].i = yoffset;
10630 n[6].i = (GLint) width;
10631 n[7].i = (GLint) height;
10632 n[8].e = format;
10633 n[9].i = imageSize;
10634 save_pointer(&n[10],
10635 copy_data(data, imageSize, "glCompressedMultiTexSubImage2DEXT"));
10636 }
10637 if (ctx->ExecuteFlag) {
10638 CALL_CompressedMultiTexSubImage2DEXT(ctx->Dispatch.Exec,
10639 (texunit, target, level, xoffset, yoffset,
10640 width, height, format, imageSize, data));
10641 }
10642 }
10643
10644
10645 void GLAPIENTRY
save_CompressedMultiTexSubImage3DEXT(GLenum texunit,GLenum target,GLint level,GLint xoffset,GLint yoffset,GLint zoffset,GLsizei width,GLsizei height,GLsizei depth,GLenum format,GLsizei imageSize,const GLvoid * data)10646 save_CompressedMultiTexSubImage3DEXT(GLenum texunit, GLenum target, GLint level, GLint xoffset,
10647 GLint yoffset, GLint zoffset, GLsizei width,
10648 GLsizei height, GLsizei depth, GLenum format,
10649 GLsizei imageSize, const GLvoid * data)
10650 {
10651 Node *n;
10652 GET_CURRENT_CONTEXT(ctx);
10653 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10654
10655 n = alloc_instruction(ctx, OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D,
10656 11 + POINTER_DWORDS);
10657 if (n) {
10658 n[1].e = texunit;
10659 n[2].e = target;
10660 n[3].i = level;
10661 n[4].i = xoffset;
10662 n[5].i = yoffset;
10663 n[6].i = zoffset;
10664 n[7].i = (GLint) width;
10665 n[8].i = (GLint) height;
10666 n[9].i = (GLint) depth;
10667 n[10].e = format;
10668 n[11].i = imageSize;
10669 save_pointer(&n[12],
10670 copy_data(data, imageSize, "glCompressedMultiTexSubImage3DEXT"));
10671 }
10672 if (ctx->ExecuteFlag) {
10673 CALL_CompressedMultiTexSubImage3DEXT(ctx->Dispatch.Exec,
10674 (texunit, target, level, xoffset, yoffset,
10675 zoffset, width, height, depth, format,
10676 imageSize, data));
10677 }
10678 }
10679
10680
10681 void GLAPIENTRY
save_NamedProgramStringEXT(GLuint program,GLenum target,GLenum format,GLsizei len,const GLvoid * string)10682 save_NamedProgramStringEXT(GLuint program, GLenum target, GLenum format, GLsizei len,
10683 const GLvoid * string)
10684 {
10685 GET_CURRENT_CONTEXT(ctx);
10686 Node *n;
10687
10688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10689
10690 n = alloc_instruction(ctx, OPCODE_NAMED_PROGRAM_STRING, 4 + POINTER_DWORDS);
10691 if (n) {
10692 GLubyte *programCopy = malloc(len);
10693 if (!programCopy) {
10694 _mesa_error(ctx, GL_OUT_OF_MEMORY, "glNamedProgramStringEXT");
10695 return;
10696 }
10697 memcpy(programCopy, string, len);
10698 n[1].ui = program;
10699 n[2].e = target;
10700 n[3].e = format;
10701 n[4].i = len;
10702 save_pointer(&n[5], programCopy);
10703 }
10704 if (ctx->ExecuteFlag) {
10705 CALL_NamedProgramStringEXT(ctx->Dispatch.Exec, (program, target, format, len, string));
10706 }
10707 }
10708
10709
10710 void GLAPIENTRY
save_NamedProgramLocalParameter4fEXT(GLuint program,GLenum target,GLuint index,GLfloat x,GLfloat y,GLfloat z,GLfloat w)10711 save_NamedProgramLocalParameter4fEXT(GLuint program, GLenum target, GLuint index,
10712 GLfloat x, GLfloat y, GLfloat z, GLfloat w)
10713 {
10714 GET_CURRENT_CONTEXT(ctx);
10715 Node *n;
10716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10717 n = alloc_instruction(ctx, OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER, 7);
10718 if (n) {
10719 n[1].ui = program;
10720 n[2].e = target;
10721 n[3].ui = index;
10722 n[4].f = x;
10723 n[5].f = y;
10724 n[6].f = z;
10725 n[7].f = w;
10726 }
10727 if (ctx->ExecuteFlag) {
10728 CALL_NamedProgramLocalParameter4fEXT(ctx->Dispatch.Exec, (program, target, index, x, y, z, w));
10729 }
10730 }
10731
10732
10733 void GLAPIENTRY
save_NamedProgramLocalParameter4fvEXT(GLuint program,GLenum target,GLuint index,const GLfloat * params)10734 save_NamedProgramLocalParameter4fvEXT(GLuint program, GLenum target, GLuint index,
10735 const GLfloat *params)
10736 {
10737 save_NamedProgramLocalParameter4fEXT(program, target, index, params[0],
10738 params[1], params[2], params[3]);
10739 }
10740
10741
10742 void GLAPIENTRY
save_NamedProgramLocalParameter4dEXT(GLuint program,GLenum target,GLuint index,GLdouble x,GLdouble y,GLdouble z,GLdouble w)10743 save_NamedProgramLocalParameter4dEXT(GLuint program, GLenum target, GLuint index,
10744 GLdouble x, GLdouble y,
10745 GLdouble z, GLdouble w)
10746 {
10747 save_NamedProgramLocalParameter4fEXT(program, target, index, (GLfloat) x,
10748 (GLfloat) y, (GLfloat) z, (GLfloat) w);
10749 }
10750
10751
10752 void GLAPIENTRY
save_NamedProgramLocalParameter4dvEXT(GLuint program,GLenum target,GLuint index,const GLdouble * params)10753 save_NamedProgramLocalParameter4dvEXT(GLuint program, GLenum target, GLuint index,
10754 const GLdouble *params)
10755 {
10756 save_NamedProgramLocalParameter4fEXT(program, target, index, (GLfloat) params[0],
10757 (GLfloat) params[1], (GLfloat) params[2],
10758 (GLfloat) params[3]);
10759 }
10760
10761 void GLAPIENTRY
save_PrimitiveBoundingBox(float minX,float minY,float minZ,float minW,float maxX,float maxY,float maxZ,float maxW)10762 save_PrimitiveBoundingBox(float minX, float minY, float minZ, float minW,
10763 float maxX, float maxY, float maxZ, float maxW)
10764 {
10765 GET_CURRENT_CONTEXT(ctx);
10766 Node *n;
10767 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);
10768 n = alloc_instruction(ctx, OPCODE_PRIMITIVE_BOUNDING_BOX, 8);
10769 if (n) {
10770 n[1].f = minX;
10771 n[2].f = minY;
10772 n[3].f = minZ;
10773 n[4].f = minW;
10774 n[5].f = maxX;
10775 n[6].f = maxY;
10776 n[7].f = maxZ;
10777 n[8].f = maxW;
10778 }
10779 if (ctx->ExecuteFlag) {
10780 CALL_PrimitiveBoundingBox(ctx->Dispatch.Exec, (minX, minY, minZ, minW,
10781 maxX, maxY, maxZ, maxW));
10782 }
10783 }
10784
10785 /**
10786 * Save an error-generating command into display list.
10787 *
10788 * KW: Will appear in the list before the vertex buffer containing the
10789 * command that provoked the error. I don't see this as a problem.
10790 */
10791 static void
save_error(struct gl_context * ctx,GLenum error,const char * s)10792 save_error(struct gl_context *ctx, GLenum error, const char *s)
10793 {
10794 Node *n;
10795 n = alloc_instruction(ctx, OPCODE_ERROR, 1 + POINTER_DWORDS);
10796 if (n) {
10797 n[1].e = error;
10798 save_pointer(&n[2], (void *) s);
10799 /* note: the data/string here doesn't have to be freed in
10800 * _mesa_delete_list() since the string is never dynamically
10801 * allocated.
10802 */
10803 }
10804 }
10805
10806
10807 /**
10808 * Compile an error into current display list.
10809 */
10810 void
_mesa_compile_error(struct gl_context * ctx,GLenum error,const char * s)10811 _mesa_compile_error(struct gl_context *ctx, GLenum error, const char *s)
10812 {
10813 if (ctx->CompileFlag)
10814 save_error(ctx, error, s);
10815 if (ctx->ExecuteFlag)
10816 _mesa_error(ctx, error, "%s", s);
10817 }
10818
10819
10820 /**
10821 * Test if ID names a display list.
10822 */
10823 bool
_mesa_get_list(struct gl_context * ctx,GLuint list,struct gl_display_list ** dlist,bool locked)10824 _mesa_get_list(struct gl_context *ctx, GLuint list,
10825 struct gl_display_list **dlist,
10826 bool locked)
10827 {
10828 struct gl_display_list * dl =
10829 list > 0 ? _mesa_lookup_list(ctx, list, locked) : NULL;
10830
10831 if (dlist)
10832 *dlist = dl;
10833
10834 return dl != NULL;
10835 }
10836
10837
10838
10839 /**********************************************************************/
10840 /* Display list execution */
10841 /**********************************************************************/
10842
10843
10844 /*
10845 * Execute a display list. Note that the ListBase offset must have already
10846 * been added before calling this function. I.e. the list argument is
10847 * the absolute list number, not relative to ListBase.
10848 * Must be called with ctx->Shared->DisplayList locked.
10849 * \param list - display list number
10850 */
10851 static void
execute_list(struct gl_context * ctx,GLuint list)10852 execute_list(struct gl_context *ctx, GLuint list)
10853 {
10854 struct gl_display_list *dlist;
10855 Node *n;
10856
10857 if (list == 0 || !_mesa_get_list(ctx, list, &dlist, true))
10858 return;
10859
10860 n = get_list_head(ctx, dlist);
10861
10862 while (1) {
10863 const OpCode opcode = n[0].opcode;
10864
10865 switch (opcode) {
10866 case OPCODE_ERROR:
10867 _mesa_error(ctx, n[1].e, "%s", (const char *) get_pointer(&n[2]));
10868 break;
10869 case OPCODE_ACCUM:
10870 CALL_Accum(ctx->Dispatch.Exec, (n[1].e, n[2].f));
10871 break;
10872 case OPCODE_ALPHA_FUNC:
10873 CALL_AlphaFunc(ctx->Dispatch.Exec, (n[1].e, n[2].f));
10874 break;
10875 case OPCODE_BIND_TEXTURE:
10876 CALL_BindTexture(ctx->Dispatch.Exec, (n[1].e, n[2].ui));
10877 break;
10878 case OPCODE_BITMAP:
10879 if (_mesa_inside_begin_end(ctx)) {
10880 _mesa_error(ctx, GL_INVALID_OPERATION,
10881 "glCallList -> glBitmap inside Begin/End");
10882 } else {
10883 _mesa_bitmap(ctx, n[1].i, n[2].i, n[3].f, n[4].f, n[5].f,
10884 n[6].f, NULL, get_pointer(&n[7]));
10885 }
10886 break;
10887 case OPCODE_BLEND_COLOR:
10888 CALL_BlendColor(ctx->Dispatch.Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
10889 break;
10890 case OPCODE_BLEND_EQUATION:
10891 CALL_BlendEquation(ctx->Dispatch.Exec, (n[1].e));
10892 break;
10893 case OPCODE_BLEND_EQUATION_SEPARATE:
10894 CALL_BlendEquationSeparate(ctx->Dispatch.Exec, (n[1].e, n[2].e));
10895 break;
10896 case OPCODE_BLEND_FUNC_SEPARATE:
10897 CALL_BlendFuncSeparate(ctx->Dispatch.Exec,
10898 (n[1].e, n[2].e, n[3].e, n[4].e));
10899 break;
10900
10901 case OPCODE_BLEND_FUNC_I:
10902 /* GL_ARB_draw_buffers_blend */
10903 CALL_BlendFunciARB(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].e));
10904 break;
10905 case OPCODE_BLEND_FUNC_SEPARATE_I:
10906 /* GL_ARB_draw_buffers_blend */
10907 CALL_BlendFuncSeparateiARB(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].e,
10908 n[4].e, n[5].e));
10909 break;
10910 case OPCODE_BLEND_EQUATION_I:
10911 /* GL_ARB_draw_buffers_blend */
10912 CALL_BlendEquationiARB(ctx->Dispatch.Exec, (n[1].ui, n[2].e));
10913 break;
10914 case OPCODE_BLEND_EQUATION_SEPARATE_I:
10915 /* GL_ARB_draw_buffers_blend */
10916 CALL_BlendEquationSeparateiARB(ctx->Dispatch.Exec,
10917 (n[1].ui, n[2].e, n[3].e));
10918 break;
10919
10920 case OPCODE_CALL_LIST:
10921 /* Generated by glCallList(), don't add ListBase */
10922 if (ctx->ListState.CallDepth < MAX_LIST_NESTING) {
10923 ctx->ListState.CallDepth++;
10924 execute_list(ctx, n[1].ui);
10925 ctx->ListState.CallDepth--;
10926 }
10927 break;
10928 case OPCODE_CALL_LISTS:
10929 if (ctx->ListState.CallDepth < MAX_LIST_NESTING) {
10930 ctx->ListState.CallDepth++;
10931 _mesa_HashUnlockMutex(&ctx->Shared->DisplayList);
10932 CALL_CallLists(ctx->Dispatch.Exec, (n[1].i, n[2].e, get_pointer(&n[3])));
10933 _mesa_HashLockMutex(&ctx->Shared->DisplayList);
10934 ctx->ListState.CallDepth--;
10935 }
10936 break;
10937 case OPCODE_CLEAR:
10938 CALL_Clear(ctx->Dispatch.Exec, (n[1].bf));
10939 break;
10940 case OPCODE_CLEAR_BUFFER_IV:
10941 {
10942 GLint value[4];
10943 value[0] = n[3].i;
10944 value[1] = n[4].i;
10945 value[2] = n[5].i;
10946 value[3] = n[6].i;
10947 CALL_ClearBufferiv(ctx->Dispatch.Exec, (n[1].e, n[2].i, value));
10948 }
10949 break;
10950 case OPCODE_CLEAR_BUFFER_UIV:
10951 {
10952 GLuint value[4];
10953 value[0] = n[3].ui;
10954 value[1] = n[4].ui;
10955 value[2] = n[5].ui;
10956 value[3] = n[6].ui;
10957 CALL_ClearBufferuiv(ctx->Dispatch.Exec, (n[1].e, n[2].i, value));
10958 }
10959 break;
10960 case OPCODE_CLEAR_BUFFER_FV:
10961 {
10962 GLfloat value[4];
10963 value[0] = n[3].f;
10964 value[1] = n[4].f;
10965 value[2] = n[5].f;
10966 value[3] = n[6].f;
10967 CALL_ClearBufferfv(ctx->Dispatch.Exec, (n[1].e, n[2].i, value));
10968 }
10969 break;
10970 case OPCODE_CLEAR_BUFFER_FI:
10971 CALL_ClearBufferfi(ctx->Dispatch.Exec, (n[1].e, n[2].i, n[3].f, n[4].i));
10972 break;
10973 case OPCODE_CLEAR_COLOR:
10974 CALL_ClearColor(ctx->Dispatch.Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
10975 break;
10976 case OPCODE_CLEAR_ACCUM:
10977 CALL_ClearAccum(ctx->Dispatch.Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
10978 break;
10979 case OPCODE_CLEAR_DEPTH:
10980 CALL_ClearDepth(ctx->Dispatch.Exec, ((GLclampd) n[1].f));
10981 break;
10982 case OPCODE_CLEAR_INDEX:
10983 CALL_ClearIndex(ctx->Dispatch.Exec, ((GLfloat) n[1].ui));
10984 break;
10985 case OPCODE_CLEAR_STENCIL:
10986 CALL_ClearStencil(ctx->Dispatch.Exec, (n[1].i));
10987 break;
10988 case OPCODE_CLIP_PLANE:
10989 {
10990 GLdouble eq[4];
10991 eq[0] = n[2].f;
10992 eq[1] = n[3].f;
10993 eq[2] = n[4].f;
10994 eq[3] = n[5].f;
10995 CALL_ClipPlane(ctx->Dispatch.Exec, (n[1].e, eq));
10996 }
10997 break;
10998 case OPCODE_COLOR_MASK:
10999 CALL_ColorMask(ctx->Dispatch.Exec, (n[1].b, n[2].b, n[3].b, n[4].b));
11000 break;
11001 case OPCODE_COLOR_MASK_INDEXED:
11002 CALL_ColorMaski(ctx->Dispatch.Exec, (n[1].ui, n[2].b, n[3].b,
11003 n[4].b, n[5].b));
11004 break;
11005 case OPCODE_COLOR_MATERIAL:
11006 CALL_ColorMaterial(ctx->Dispatch.Exec, (n[1].e, n[2].e));
11007 break;
11008 case OPCODE_COPY_PIXELS:
11009 CALL_CopyPixels(ctx->Dispatch.Exec, (n[1].i, n[2].i,
11010 (GLsizei) n[3].i, (GLsizei) n[4].i,
11011 n[5].e));
11012 break;
11013 case OPCODE_COPY_TEX_IMAGE1D:
11014 CALL_CopyTexImage1D(ctx->Dispatch.Exec, (n[1].e, n[2].i, n[3].e, n[4].i,
11015 n[5].i, n[6].i, n[7].i));
11016 break;
11017 case OPCODE_COPY_TEX_IMAGE2D:
11018 CALL_CopyTexImage2D(ctx->Dispatch.Exec, (n[1].e, n[2].i, n[3].e, n[4].i,
11019 n[5].i, n[6].i, n[7].i, n[8].i));
11020 break;
11021 case OPCODE_COPY_TEX_SUB_IMAGE1D:
11022 CALL_CopyTexSubImage1D(ctx->Dispatch.Exec, (n[1].e, n[2].i, n[3].i,
11023 n[4].i, n[5].i, n[6].i));
11024 break;
11025 case OPCODE_COPY_TEX_SUB_IMAGE2D:
11026 CALL_CopyTexSubImage2D(ctx->Dispatch.Exec, (n[1].e, n[2].i, n[3].i,
11027 n[4].i, n[5].i, n[6].i, n[7].i,
11028 n[8].i));
11029 break;
11030 case OPCODE_COPY_TEX_SUB_IMAGE3D:
11031 CALL_CopyTexSubImage3D(ctx->Dispatch.Exec, (n[1].e, n[2].i, n[3].i,
11032 n[4].i, n[5].i, n[6].i, n[7].i,
11033 n[8].i, n[9].i));
11034 break;
11035 case OPCODE_CULL_FACE:
11036 CALL_CullFace(ctx->Dispatch.Exec, (n[1].e));
11037 break;
11038 case OPCODE_DEPTH_FUNC:
11039 CALL_DepthFunc(ctx->Dispatch.Exec, (n[1].e));
11040 break;
11041 case OPCODE_DEPTH_MASK:
11042 CALL_DepthMask(ctx->Dispatch.Exec, (n[1].b));
11043 break;
11044 case OPCODE_DEPTH_RANGE:
11045 CALL_DepthRange(ctx->Dispatch.Exec,
11046 ((GLclampd) n[1].f, (GLclampd) n[2].f));
11047 break;
11048 case OPCODE_DISABLE:
11049 CALL_Disable(ctx->Dispatch.Exec, (n[1].e));
11050 break;
11051 case OPCODE_DISABLE_INDEXED:
11052 CALL_Disablei(ctx->Dispatch.Exec, (n[1].ui, n[2].e));
11053 break;
11054 case OPCODE_DRAW_BUFFER:
11055 CALL_DrawBuffer(ctx->Dispatch.Exec, (n[1].e));
11056 break;
11057 case OPCODE_DRAW_PIXELS:
11058 {
11059 const struct gl_pixelstore_attrib save = ctx->Unpack;
11060 ctx->Unpack = ctx->DefaultPacking;
11061 CALL_DrawPixels(ctx->Dispatch.Exec, (n[1].i, n[2].i, n[3].e, n[4].e,
11062 get_pointer(&n[5])));
11063 ctx->Unpack = save; /* restore */
11064 }
11065 break;
11066 case OPCODE_ENABLE:
11067 CALL_Enable(ctx->Dispatch.Exec, (n[1].e));
11068 break;
11069 case OPCODE_ENABLE_INDEXED:
11070 CALL_Enablei(ctx->Dispatch.Exec, (n[1].ui, n[2].e));
11071 break;
11072 case OPCODE_EVALMESH1:
11073 CALL_EvalMesh1(ctx->Dispatch.Exec, (n[1].e, n[2].i, n[3].i));
11074 break;
11075 case OPCODE_EVALMESH2:
11076 CALL_EvalMesh2(ctx->Dispatch.Exec,
11077 (n[1].e, n[2].i, n[3].i, n[4].i, n[5].i));
11078 break;
11079 case OPCODE_FOG:
11080 {
11081 GLfloat p[4];
11082 p[0] = n[2].f;
11083 p[1] = n[3].f;
11084 p[2] = n[4].f;
11085 p[3] = n[5].f;
11086 CALL_Fogfv(ctx->Dispatch.Exec, (n[1].e, p));
11087 }
11088 break;
11089 case OPCODE_FRONT_FACE:
11090 CALL_FrontFace(ctx->Dispatch.Exec, (n[1].e));
11091 break;
11092 case OPCODE_FRUSTUM:
11093 CALL_Frustum(ctx->Dispatch.Exec,
11094 (n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f));
11095 break;
11096 case OPCODE_HINT:
11097 CALL_Hint(ctx->Dispatch.Exec, (n[1].e, n[2].e));
11098 break;
11099 case OPCODE_INDEX_MASK:
11100 CALL_IndexMask(ctx->Dispatch.Exec, (n[1].ui));
11101 break;
11102 case OPCODE_INIT_NAMES:
11103 CALL_InitNames(ctx->Dispatch.Exec, ());
11104 break;
11105 case OPCODE_LIGHT:
11106 {
11107 GLfloat p[4];
11108 p[0] = n[3].f;
11109 p[1] = n[4].f;
11110 p[2] = n[5].f;
11111 p[3] = n[6].f;
11112 CALL_Lightfv(ctx->Dispatch.Exec, (n[1].e, n[2].e, p));
11113 }
11114 break;
11115 case OPCODE_LIGHT_MODEL:
11116 {
11117 GLfloat p[4];
11118 p[0] = n[2].f;
11119 p[1] = n[3].f;
11120 p[2] = n[4].f;
11121 p[3] = n[5].f;
11122 CALL_LightModelfv(ctx->Dispatch.Exec, (n[1].e, p));
11123 }
11124 break;
11125 case OPCODE_LINE_STIPPLE:
11126 CALL_LineStipple(ctx->Dispatch.Exec, (n[1].i, n[2].us));
11127 break;
11128 case OPCODE_LINE_WIDTH:
11129 CALL_LineWidth(ctx->Dispatch.Exec, (n[1].f));
11130 break;
11131 case OPCODE_LIST_BASE:
11132 CALL_ListBase(ctx->Dispatch.Exec, (n[1].ui));
11133 break;
11134 case OPCODE_LOAD_IDENTITY:
11135 CALL_LoadIdentity(ctx->Dispatch.Exec, ());
11136 break;
11137 case OPCODE_LOAD_MATRIX:
11138 STATIC_ASSERT(sizeof(Node) == sizeof(GLfloat));
11139 CALL_LoadMatrixf(ctx->Dispatch.Exec, (&n[1].f));
11140 break;
11141 case OPCODE_LOAD_NAME:
11142 CALL_LoadName(ctx->Dispatch.Exec, (n[1].ui));
11143 break;
11144 case OPCODE_LOGIC_OP:
11145 CALL_LogicOp(ctx->Dispatch.Exec, (n[1].e));
11146 break;
11147 case OPCODE_MAP1:
11148 {
11149 GLenum target = n[1].e;
11150 GLint ustride = _mesa_evaluator_components(target);
11151 GLint uorder = n[5].i;
11152 GLfloat u1 = n[2].f;
11153 GLfloat u2 = n[3].f;
11154 CALL_Map1f(ctx->Dispatch.Exec, (target, u1, u2, ustride, uorder,
11155 (GLfloat *) get_pointer(&n[6])));
11156 }
11157 break;
11158 case OPCODE_MAP2:
11159 {
11160 GLenum target = n[1].e;
11161 GLfloat u1 = n[2].f;
11162 GLfloat u2 = n[3].f;
11163 GLfloat v1 = n[4].f;
11164 GLfloat v2 = n[5].f;
11165 GLint ustride = n[6].i;
11166 GLint vstride = n[7].i;
11167 GLint uorder = n[8].i;
11168 GLint vorder = n[9].i;
11169 CALL_Map2f(ctx->Dispatch.Exec, (target, u1, u2, ustride, uorder,
11170 v1, v2, vstride, vorder,
11171 (GLfloat *) get_pointer(&n[10])));
11172 }
11173 break;
11174 case OPCODE_MAPGRID1:
11175 CALL_MapGrid1f(ctx->Dispatch.Exec, (n[1].i, n[2].f, n[3].f));
11176 break;
11177 case OPCODE_MAPGRID2:
11178 CALL_MapGrid2f(ctx->Dispatch.Exec,
11179 (n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f));
11180 break;
11181 case OPCODE_MATRIX_MODE:
11182 CALL_MatrixMode(ctx->Dispatch.Exec, (n[1].e));
11183 break;
11184 case OPCODE_MULT_MATRIX:
11185 CALL_MultMatrixf(ctx->Dispatch.Exec, (&n[1].f));
11186 break;
11187 case OPCODE_ORTHO:
11188 CALL_Ortho(ctx->Dispatch.Exec,
11189 (n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f));
11190 break;
11191 case OPCODE_PASSTHROUGH:
11192 CALL_PassThrough(ctx->Dispatch.Exec, (n[1].f));
11193 break;
11194 case OPCODE_PATCH_PARAMETER_I:
11195 CALL_PatchParameteri(ctx->Dispatch.Exec, (n[1].e, n[2].i));
11196 break;
11197 case OPCODE_PATCH_PARAMETER_FV_INNER:
11198 {
11199 GLfloat params[2];
11200 params[0] = n[2].f;
11201 params[1] = n[3].f;
11202 CALL_PatchParameterfv(ctx->Dispatch.Exec, (n[1].e, params));
11203 }
11204 break;
11205 case OPCODE_PATCH_PARAMETER_FV_OUTER:
11206 {
11207 GLfloat params[4];
11208 params[0] = n[2].f;
11209 params[1] = n[3].f;
11210 params[2] = n[4].f;
11211 params[3] = n[5].f;
11212 CALL_PatchParameterfv(ctx->Dispatch.Exec, (n[1].e, params));
11213 }
11214 break;
11215 case OPCODE_PIXEL_MAP:
11216 CALL_PixelMapfv(ctx->Dispatch.Exec,
11217 (n[1].e, n[2].i, get_pointer(&n[3])));
11218 break;
11219 case OPCODE_PIXEL_TRANSFER:
11220 CALL_PixelTransferf(ctx->Dispatch.Exec, (n[1].e, n[2].f));
11221 break;
11222 case OPCODE_PIXEL_ZOOM:
11223 CALL_PixelZoom(ctx->Dispatch.Exec, (n[1].f, n[2].f));
11224 break;
11225 case OPCODE_POINT_SIZE:
11226 CALL_PointSize(ctx->Dispatch.Exec, (n[1].f));
11227 break;
11228 case OPCODE_POINT_PARAMETERS:
11229 {
11230 GLfloat params[3];
11231 params[0] = n[2].f;
11232 params[1] = n[3].f;
11233 params[2] = n[4].f;
11234 CALL_PointParameterfv(ctx->Dispatch.Exec, (n[1].e, params));
11235 }
11236 break;
11237 case OPCODE_POLYGON_MODE:
11238 CALL_PolygonMode(ctx->Dispatch.Exec, (n[1].e, n[2].e));
11239 break;
11240 case OPCODE_POLYGON_STIPPLE:
11241 {
11242 const struct gl_pixelstore_attrib save = ctx->Unpack;
11243 ctx->Unpack = ctx->DefaultPacking;
11244 CALL_PolygonStipple(ctx->Dispatch.Exec, (get_pointer(&n[1])));
11245 ctx->Unpack = save; /* restore */
11246 }
11247 break;
11248 case OPCODE_POLYGON_OFFSET:
11249 CALL_PolygonOffset(ctx->Dispatch.Exec, (n[1].f, n[2].f));
11250 break;
11251 case OPCODE_POLYGON_OFFSET_CLAMP:
11252 CALL_PolygonOffsetClampEXT(ctx->Dispatch.Exec, (n[1].f, n[2].f, n[3].f));
11253 break;
11254 case OPCODE_POP_ATTRIB:
11255 CALL_PopAttrib(ctx->Dispatch.Exec, ());
11256 break;
11257 case OPCODE_POP_MATRIX:
11258 CALL_PopMatrix(ctx->Dispatch.Exec, ());
11259 break;
11260 case OPCODE_POP_NAME:
11261 CALL_PopName(ctx->Dispatch.Exec, ());
11262 break;
11263 case OPCODE_PRIORITIZE_TEXTURE:
11264 CALL_PrioritizeTextures(ctx->Dispatch.Exec, (1, &n[1].ui, &n[2].f));
11265 break;
11266 case OPCODE_PUSH_ATTRIB:
11267 CALL_PushAttrib(ctx->Dispatch.Exec, (n[1].bf));
11268 break;
11269 case OPCODE_PUSH_MATRIX:
11270 CALL_PushMatrix(ctx->Dispatch.Exec, ());
11271 break;
11272 case OPCODE_PUSH_NAME:
11273 CALL_PushName(ctx->Dispatch.Exec, (n[1].ui));
11274 break;
11275 case OPCODE_RASTER_POS:
11276 CALL_RasterPos4f(ctx->Dispatch.Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
11277 break;
11278 case OPCODE_READ_BUFFER:
11279 CALL_ReadBuffer(ctx->Dispatch.Exec, (n[1].e));
11280 break;
11281 case OPCODE_ROTATE:
11282 CALL_Rotatef(ctx->Dispatch.Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
11283 break;
11284 case OPCODE_SCALE:
11285 CALL_Scalef(ctx->Dispatch.Exec, (n[1].f, n[2].f, n[3].f));
11286 break;
11287 case OPCODE_SCISSOR:
11288 CALL_Scissor(ctx->Dispatch.Exec, (n[1].i, n[2].i, n[3].i, n[4].i));
11289 break;
11290 case OPCODE_SHADE_MODEL:
11291 CALL_ShadeModel(ctx->Dispatch.Exec, (n[1].e));
11292 break;
11293 case OPCODE_PROVOKING_VERTEX:
11294 CALL_ProvokingVertex(ctx->Dispatch.Exec, (n[1].e));
11295 break;
11296 case OPCODE_STENCIL_FUNC:
11297 CALL_StencilFunc(ctx->Dispatch.Exec, (n[1].e, n[2].i, n[3].ui));
11298 break;
11299 case OPCODE_STENCIL_MASK:
11300 CALL_StencilMask(ctx->Dispatch.Exec, (n[1].ui));
11301 break;
11302 case OPCODE_STENCIL_OP:
11303 CALL_StencilOp(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].e));
11304 break;
11305 case OPCODE_STENCIL_FUNC_SEPARATE:
11306 CALL_StencilFuncSeparate(ctx->Dispatch.Exec,
11307 (n[1].e, n[2].e, n[3].i, n[4].ui));
11308 break;
11309 case OPCODE_STENCIL_MASK_SEPARATE:
11310 CALL_StencilMaskSeparate(ctx->Dispatch.Exec, (n[1].e, n[2].ui));
11311 break;
11312 case OPCODE_STENCIL_OP_SEPARATE:
11313 CALL_StencilOpSeparate(ctx->Dispatch.Exec,
11314 (n[1].e, n[2].e, n[3].e, n[4].e));
11315 break;
11316 case OPCODE_TEXENV:
11317 {
11318 GLfloat params[4];
11319 params[0] = n[3].f;
11320 params[1] = n[4].f;
11321 params[2] = n[5].f;
11322 params[3] = n[6].f;
11323 CALL_TexEnvfv(ctx->Dispatch.Exec, (n[1].e, n[2].e, params));
11324 }
11325 break;
11326 case OPCODE_TEXGEN:
11327 {
11328 GLfloat params[4];
11329 params[0] = n[3].f;
11330 params[1] = n[4].f;
11331 params[2] = n[5].f;
11332 params[3] = n[6].f;
11333 CALL_TexGenfv(ctx->Dispatch.Exec, (n[1].e, n[2].e, params));
11334 }
11335 break;
11336 case OPCODE_TEXPARAMETER:
11337 {
11338 GLfloat params[4];
11339 params[0] = n[3].f;
11340 params[1] = n[4].f;
11341 params[2] = n[5].f;
11342 params[3] = n[6].f;
11343 CALL_TexParameterfv(ctx->Dispatch.Exec, (n[1].e, n[2].e, params));
11344 }
11345 break;
11346 case OPCODE_TEX_IMAGE1D:
11347 {
11348 const struct gl_pixelstore_attrib save = ctx->Unpack;
11349 ctx->Unpack = ctx->DefaultPacking;
11350 CALL_TexImage1D(ctx->Dispatch.Exec, (n[1].e, /* target */
11351 n[2].i, /* level */
11352 n[3].i, /* components */
11353 n[4].i, /* width */
11354 n[5].e, /* border */
11355 n[6].e, /* format */
11356 n[7].e, /* type */
11357 get_pointer(&n[8])));
11358 ctx->Unpack = save; /* restore */
11359 }
11360 break;
11361 case OPCODE_TEX_IMAGE2D:
11362 {
11363 const struct gl_pixelstore_attrib save = ctx->Unpack;
11364 ctx->Unpack = ctx->DefaultPacking;
11365 CALL_TexImage2D(ctx->Dispatch.Exec, (n[1].e, /* target */
11366 n[2].i, /* level */
11367 n[3].i, /* components */
11368 n[4].i, /* width */
11369 n[5].i, /* height */
11370 n[6].e, /* border */
11371 n[7].e, /* format */
11372 n[8].e, /* type */
11373 get_pointer(&n[9])));
11374 ctx->Unpack = save; /* restore */
11375 }
11376 break;
11377 case OPCODE_TEX_IMAGE3D:
11378 {
11379 const struct gl_pixelstore_attrib save = ctx->Unpack;
11380 ctx->Unpack = ctx->DefaultPacking;
11381 CALL_TexImage3D(ctx->Dispatch.Exec, (n[1].e, /* target */
11382 n[2].i, /* level */
11383 n[3].i, /* components */
11384 n[4].i, /* width */
11385 n[5].i, /* height */
11386 n[6].i, /* depth */
11387 n[7].e, /* border */
11388 n[8].e, /* format */
11389 n[9].e, /* type */
11390 get_pointer(&n[10])));
11391 ctx->Unpack = save; /* restore */
11392 }
11393 break;
11394 case OPCODE_TEX_SUB_IMAGE1D:
11395 {
11396 const struct gl_pixelstore_attrib save = ctx->Unpack;
11397 ctx->Unpack = ctx->DefaultPacking;
11398 CALL_TexSubImage1D(ctx->Dispatch.Exec, (n[1].e, n[2].i, n[3].i,
11399 n[4].i, n[5].e,
11400 n[6].e, get_pointer(&n[7])));
11401 ctx->Unpack = save; /* restore */
11402 }
11403 break;
11404 case OPCODE_TEX_SUB_IMAGE2D:
11405 {
11406 const struct gl_pixelstore_attrib save = ctx->Unpack;
11407 ctx->Unpack = ctx->DefaultPacking;
11408 CALL_TexSubImage2D(ctx->Dispatch.Exec, (n[1].e, n[2].i, n[3].i,
11409 n[4].i, n[5].e,
11410 n[6].i, n[7].e, n[8].e,
11411 get_pointer(&n[9])));
11412 ctx->Unpack = save; /* restore */
11413 }
11414 break;
11415 case OPCODE_TEX_SUB_IMAGE3D:
11416 {
11417 const struct gl_pixelstore_attrib save = ctx->Unpack;
11418 ctx->Unpack = ctx->DefaultPacking;
11419 CALL_TexSubImage3D(ctx->Dispatch.Exec, (n[1].e, n[2].i, n[3].i,
11420 n[4].i, n[5].i, n[6].i, n[7].i,
11421 n[8].i, n[9].e, n[10].e,
11422 get_pointer(&n[11])));
11423 ctx->Unpack = save; /* restore */
11424 }
11425 break;
11426 case OPCODE_TRANSLATE:
11427 CALL_Translatef(ctx->Dispatch.Exec, (n[1].f, n[2].f, n[3].f));
11428 break;
11429 case OPCODE_VIEWPORT:
11430 CALL_Viewport(ctx->Dispatch.Exec, (n[1].i, n[2].i,
11431 (GLsizei) n[3].i, (GLsizei) n[4].i));
11432 break;
11433 case OPCODE_WINDOW_POS:
11434 CALL_WindowPos4fMESA(ctx->Dispatch.Exec, (n[1].f, n[2].f, n[3].f, n[4].f));
11435 break;
11436 case OPCODE_VIEWPORT_ARRAY_V:
11437 CALL_ViewportArrayv(ctx->Dispatch.Exec, (n[1].ui, n[2].si,
11438 get_pointer(&n[3])));
11439 break;
11440 case OPCODE_VIEWPORT_INDEXED_F:
11441 CALL_ViewportIndexedf(ctx->Dispatch.Exec, (n[1].ui, n[2].f, n[3].f, n[4].f,
11442 n[5].f));
11443 break;
11444 case OPCODE_VIEWPORT_INDEXED_FV: {
11445 GLfloat v[4];
11446 v[0] = n[2].f;
11447 v[1] = n[3].f;
11448 v[2] = n[4].f;
11449 v[3] = n[5].f;
11450 CALL_ViewportIndexedfv(ctx->Dispatch.Exec, (n[1].ui, v));
11451 break;
11452 }
11453 case OPCODE_SCISSOR_ARRAY_V:
11454 CALL_ScissorArrayv(ctx->Dispatch.Exec, (n[1].ui, n[2].si,
11455 get_pointer(&n[3])));
11456 break;
11457 case OPCODE_SCISSOR_INDEXED:
11458 CALL_ScissorIndexed(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i, n[4].si,
11459 n[5].si));
11460 break;
11461 case OPCODE_SCISSOR_INDEXED_V: {
11462 GLint v[4];
11463 v[0] = n[2].i;
11464 v[1] = n[3].i;
11465 v[2] = n[4].si;
11466 v[3] = n[5].si;
11467 CALL_ScissorIndexedv(ctx->Dispatch.Exec, (n[1].ui, v));
11468 break;
11469 }
11470 case OPCODE_DEPTH_ARRAY_V:
11471 CALL_DepthRangeArrayv(ctx->Dispatch.Exec, (n[1].ui, n[2].si,
11472 get_pointer(&n[3])));
11473 break;
11474 case OPCODE_DEPTH_INDEXED:
11475 CALL_DepthRangeIndexed(ctx->Dispatch.Exec, (n[1].ui, n[2].f, n[3].f));
11476 break;
11477 case OPCODE_ACTIVE_TEXTURE: /* GL_ARB_multitexture */
11478 CALL_ActiveTexture(ctx->Dispatch.Exec, (n[1].e));
11479 break;
11480 case OPCODE_COMPRESSED_TEX_IMAGE_1D: /* GL_ARB_texture_compression */
11481 CALL_CompressedTexImage1D(ctx->Dispatch.Exec, (n[1].e, n[2].i, n[3].e,
11482 n[4].i, n[5].i, n[6].i,
11483 get_pointer(&n[7])));
11484 break;
11485 case OPCODE_COMPRESSED_TEX_IMAGE_2D: /* GL_ARB_texture_compression */
11486 CALL_CompressedTexImage2D(ctx->Dispatch.Exec, (n[1].e, n[2].i, n[3].e,
11487 n[4].i, n[5].i, n[6].i,
11488 n[7].i, get_pointer(&n[8])));
11489 break;
11490 case OPCODE_COMPRESSED_TEX_IMAGE_3D: /* GL_ARB_texture_compression */
11491 CALL_CompressedTexImage3D(ctx->Dispatch.Exec, (n[1].e, n[2].i, n[3].e,
11492 n[4].i, n[5].i, n[6].i,
11493 n[7].i, n[8].i,
11494 get_pointer(&n[9])));
11495 break;
11496 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D: /* GL_ARB_texture_compress */
11497 CALL_CompressedTexSubImage1D(ctx->Dispatch.Exec,
11498 (n[1].e, n[2].i, n[3].i, n[4].i,
11499 n[5].e, n[6].i,
11500 get_pointer(&n[7])));
11501 break;
11502 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D: /* GL_ARB_texture_compress */
11503 CALL_CompressedTexSubImage2D(ctx->Dispatch.Exec,
11504 (n[1].e, n[2].i, n[3].i, n[4].i,
11505 n[5].i, n[6].i, n[7].e, n[8].i,
11506 get_pointer(&n[9])));
11507 break;
11508 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D: /* GL_ARB_texture_compress */
11509 CALL_CompressedTexSubImage3D(ctx->Dispatch.Exec,
11510 (n[1].e, n[2].i, n[3].i, n[4].i,
11511 n[5].i, n[6].i, n[7].i, n[8].i,
11512 n[9].e, n[10].i,
11513 get_pointer(&n[11])));
11514 break;
11515 case OPCODE_SAMPLE_COVERAGE: /* GL_ARB_multisample */
11516 CALL_SampleCoverage(ctx->Dispatch.Exec, (n[1].f, n[2].b));
11517 break;
11518 case OPCODE_WINDOW_POS_ARB: /* GL_ARB_window_pos */
11519 CALL_WindowPos3f(ctx->Dispatch.Exec, (n[1].f, n[2].f, n[3].f));
11520 break;
11521 case OPCODE_BIND_PROGRAM_ARB: /* GL_ARB_vertex_program */
11522 CALL_BindProgramARB(ctx->Dispatch.Exec, (n[1].e, n[2].ui));
11523 break;
11524 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB:
11525 CALL_ProgramLocalParameter4fARB(ctx->Dispatch.Exec,
11526 (n[1].e, n[2].ui, n[3].f, n[4].f,
11527 n[5].f, n[6].f));
11528 break;
11529 case OPCODE_ACTIVE_STENCIL_FACE_EXT:
11530 CALL_ActiveStencilFaceEXT(ctx->Dispatch.Exec, (n[1].e));
11531 break;
11532 case OPCODE_DEPTH_BOUNDS_EXT:
11533 CALL_DepthBoundsEXT(ctx->Dispatch.Exec, (n[1].f, n[2].f));
11534 break;
11535 case OPCODE_PROGRAM_STRING_ARB:
11536 CALL_ProgramStringARB(ctx->Dispatch.Exec,
11537 (n[1].e, n[2].e, n[3].i,
11538 get_pointer(&n[4])));
11539 break;
11540 case OPCODE_PROGRAM_ENV_PARAMETER_ARB:
11541 CALL_ProgramEnvParameter4fARB(ctx->Dispatch.Exec, (n[1].e, n[2].ui, n[3].f,
11542 n[4].f, n[5].f,
11543 n[6].f));
11544 break;
11545 case OPCODE_BEGIN_QUERY_ARB:
11546 CALL_BeginQuery(ctx->Dispatch.Exec, (n[1].e, n[2].ui));
11547 break;
11548 case OPCODE_END_QUERY_ARB:
11549 CALL_EndQuery(ctx->Dispatch.Exec, (n[1].e));
11550 break;
11551 case OPCODE_QUERY_COUNTER:
11552 CALL_QueryCounter(ctx->Dispatch.Exec, (n[1].ui, n[2].e));
11553 break;
11554 case OPCODE_BEGIN_QUERY_INDEXED:
11555 CALL_BeginQueryIndexed(ctx->Dispatch.Exec, (n[1].e, n[2].ui, n[3].ui));
11556 break;
11557 case OPCODE_END_QUERY_INDEXED:
11558 CALL_EndQueryIndexed(ctx->Dispatch.Exec, (n[1].e, n[2].ui));
11559 break;
11560 case OPCODE_DRAW_BUFFERS_ARB:
11561 {
11562 GLenum buffers[MAX_DRAW_BUFFERS];
11563 GLint i, count = MIN2(n[1].i, MAX_DRAW_BUFFERS);
11564 for (i = 0; i < count; i++)
11565 buffers[i] = n[2 + i].e;
11566 CALL_DrawBuffers(ctx->Dispatch.Exec, (n[1].i, buffers));
11567 }
11568 break;
11569 case OPCODE_BLIT_FRAMEBUFFER:
11570 CALL_BlitFramebuffer(ctx->Dispatch.Exec, (n[1].i, n[2].i, n[3].i, n[4].i,
11571 n[5].i, n[6].i, n[7].i, n[8].i,
11572 n[9].i, n[10].e));
11573 break;
11574 case OPCODE_PRIMITIVE_RESTART_NV:
11575 CALL_PrimitiveRestartNV(ctx->Dispatch.Exec, ());
11576 break;
11577
11578 case OPCODE_USE_PROGRAM:
11579 CALL_UseProgram(ctx->Dispatch.Exec, (n[1].ui));
11580 break;
11581 case OPCODE_UNIFORM_1F:
11582 CALL_Uniform1f(ctx->Dispatch.Exec, (n[1].i, n[2].f));
11583 break;
11584 case OPCODE_UNIFORM_2F:
11585 CALL_Uniform2f(ctx->Dispatch.Exec, (n[1].i, n[2].f, n[3].f));
11586 break;
11587 case OPCODE_UNIFORM_3F:
11588 CALL_Uniform3f(ctx->Dispatch.Exec, (n[1].i, n[2].f, n[3].f, n[4].f));
11589 break;
11590 case OPCODE_UNIFORM_4F:
11591 CALL_Uniform4f(ctx->Dispatch.Exec,
11592 (n[1].i, n[2].f, n[3].f, n[4].f, n[5].f));
11593 break;
11594 case OPCODE_UNIFORM_1FV:
11595 CALL_Uniform1fv(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11596 break;
11597 case OPCODE_UNIFORM_2FV:
11598 CALL_Uniform2fv(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11599 break;
11600 case OPCODE_UNIFORM_3FV:
11601 CALL_Uniform3fv(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11602 break;
11603 case OPCODE_UNIFORM_4FV:
11604 CALL_Uniform4fv(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11605 break;
11606 case OPCODE_UNIFORM_1D: {
11607 union float64_pair x;
11608
11609 x.uint32[0] = n[2].ui;
11610 x.uint32[1] = n[3].ui;
11611
11612 CALL_Uniform1d(ctx->Dispatch.Exec, (n[1].i, x.d));
11613 break;
11614 }
11615 case OPCODE_UNIFORM_2D: {
11616 union float64_pair x;
11617 union float64_pair y;
11618
11619 x.uint32[0] = n[2].ui;
11620 x.uint32[1] = n[3].ui;
11621 y.uint32[0] = n[4].ui;
11622 y.uint32[1] = n[5].ui;
11623
11624 CALL_Uniform2d(ctx->Dispatch.Exec, (n[1].i, x.d, y.d));
11625 break;
11626 }
11627 case OPCODE_UNIFORM_3D: {
11628 union float64_pair x;
11629 union float64_pair y;
11630 union float64_pair z;
11631
11632 x.uint32[0] = n[2].ui;
11633 x.uint32[1] = n[3].ui;
11634 y.uint32[0] = n[4].ui;
11635 y.uint32[1] = n[5].ui;
11636 z.uint32[0] = n[6].ui;
11637 z.uint32[1] = n[7].ui;
11638
11639 CALL_Uniform3d(ctx->Dispatch.Exec, (n[1].i, x.d, y.d, z.d));
11640 break;
11641 }
11642 case OPCODE_UNIFORM_4D: {
11643 union float64_pair x;
11644 union float64_pair y;
11645 union float64_pair z;
11646 union float64_pair w;
11647
11648 x.uint32[0] = n[2].ui;
11649 x.uint32[1] = n[3].ui;
11650 y.uint32[0] = n[4].ui;
11651 y.uint32[1] = n[5].ui;
11652 z.uint32[0] = n[6].ui;
11653 z.uint32[1] = n[7].ui;
11654 w.uint32[0] = n[8].ui;
11655 w.uint32[1] = n[9].ui;
11656
11657 CALL_Uniform4d(ctx->Dispatch.Exec, (n[1].i, x.d, y.d, z.d, w.d));
11658 break;
11659 }
11660 case OPCODE_UNIFORM_1DV:
11661 CALL_Uniform1dv(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11662 break;
11663 case OPCODE_UNIFORM_2DV:
11664 CALL_Uniform2dv(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11665 break;
11666 case OPCODE_UNIFORM_3DV:
11667 CALL_Uniform3dv(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11668 break;
11669 case OPCODE_UNIFORM_4DV:
11670 CALL_Uniform4dv(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11671 break;
11672 case OPCODE_UNIFORM_1I:
11673 CALL_Uniform1i(ctx->Dispatch.Exec, (n[1].i, n[2].i));
11674 break;
11675 case OPCODE_UNIFORM_2I:
11676 CALL_Uniform2i(ctx->Dispatch.Exec, (n[1].i, n[2].i, n[3].i));
11677 break;
11678 case OPCODE_UNIFORM_3I:
11679 CALL_Uniform3i(ctx->Dispatch.Exec, (n[1].i, n[2].i, n[3].i, n[4].i));
11680 break;
11681 case OPCODE_UNIFORM_4I:
11682 CALL_Uniform4i(ctx->Dispatch.Exec,
11683 (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
11684 break;
11685 case OPCODE_UNIFORM_1IV:
11686 CALL_Uniform1iv(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11687 break;
11688 case OPCODE_UNIFORM_2IV:
11689 CALL_Uniform2iv(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11690 break;
11691 case OPCODE_UNIFORM_3IV:
11692 CALL_Uniform3iv(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11693 break;
11694 case OPCODE_UNIFORM_4IV:
11695 CALL_Uniform4iv(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11696 break;
11697 case OPCODE_UNIFORM_1UI:
11698 CALL_Uniform1ui(ctx->Dispatch.Exec, (n[1].i, n[2].i));
11699 break;
11700 case OPCODE_UNIFORM_2UI:
11701 CALL_Uniform2ui(ctx->Dispatch.Exec, (n[1].i, n[2].i, n[3].i));
11702 break;
11703 case OPCODE_UNIFORM_3UI:
11704 CALL_Uniform3ui(ctx->Dispatch.Exec, (n[1].i, n[2].i, n[3].i, n[4].i));
11705 break;
11706 case OPCODE_UNIFORM_4UI:
11707 CALL_Uniform4ui(ctx->Dispatch.Exec,
11708 (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
11709 break;
11710 case OPCODE_UNIFORM_1UIV:
11711 CALL_Uniform1uiv(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11712 break;
11713 case OPCODE_UNIFORM_2UIV:
11714 CALL_Uniform2uiv(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11715 break;
11716 case OPCODE_UNIFORM_3UIV:
11717 CALL_Uniform3uiv(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11718 break;
11719 case OPCODE_UNIFORM_4UIV:
11720 CALL_Uniform4uiv(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11721 break;
11722 case OPCODE_UNIFORM_MATRIX22:
11723 CALL_UniformMatrix2fv(ctx->Dispatch.Exec,
11724 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11725 break;
11726 case OPCODE_UNIFORM_MATRIX33:
11727 CALL_UniformMatrix3fv(ctx->Dispatch.Exec,
11728 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11729 break;
11730 case OPCODE_UNIFORM_MATRIX44:
11731 CALL_UniformMatrix4fv(ctx->Dispatch.Exec,
11732 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11733 break;
11734 case OPCODE_UNIFORM_MATRIX23:
11735 CALL_UniformMatrix2x3fv(ctx->Dispatch.Exec,
11736 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11737 break;
11738 case OPCODE_UNIFORM_MATRIX32:
11739 CALL_UniformMatrix3x2fv(ctx->Dispatch.Exec,
11740 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11741 break;
11742 case OPCODE_UNIFORM_MATRIX24:
11743 CALL_UniformMatrix2x4fv(ctx->Dispatch.Exec,
11744 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11745 break;
11746 case OPCODE_UNIFORM_MATRIX42:
11747 CALL_UniformMatrix4x2fv(ctx->Dispatch.Exec,
11748 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11749 break;
11750 case OPCODE_UNIFORM_MATRIX34:
11751 CALL_UniformMatrix3x4fv(ctx->Dispatch.Exec,
11752 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11753 break;
11754 case OPCODE_UNIFORM_MATRIX43:
11755 CALL_UniformMatrix4x3fv(ctx->Dispatch.Exec,
11756 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11757 break;
11758 case OPCODE_UNIFORM_MATRIX22D:
11759 CALL_UniformMatrix2dv(ctx->Dispatch.Exec,
11760 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11761 break;
11762 case OPCODE_UNIFORM_MATRIX33D:
11763 CALL_UniformMatrix3dv(ctx->Dispatch.Exec,
11764 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11765 break;
11766 case OPCODE_UNIFORM_MATRIX44D:
11767 CALL_UniformMatrix4dv(ctx->Dispatch.Exec,
11768 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11769 break;
11770 case OPCODE_UNIFORM_MATRIX23D:
11771 CALL_UniformMatrix2x3dv(ctx->Dispatch.Exec,
11772 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11773 break;
11774 case OPCODE_UNIFORM_MATRIX32D:
11775 CALL_UniformMatrix3x2dv(ctx->Dispatch.Exec,
11776 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11777 break;
11778 case OPCODE_UNIFORM_MATRIX24D:
11779 CALL_UniformMatrix2x4dv(ctx->Dispatch.Exec,
11780 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11781 break;
11782 case OPCODE_UNIFORM_MATRIX42D:
11783 CALL_UniformMatrix4x2dv(ctx->Dispatch.Exec,
11784 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11785 break;
11786 case OPCODE_UNIFORM_MATRIX34D:
11787 CALL_UniformMatrix3x4dv(ctx->Dispatch.Exec,
11788 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11789 break;
11790 case OPCODE_UNIFORM_MATRIX43D:
11791 CALL_UniformMatrix4x3dv(ctx->Dispatch.Exec,
11792 (n[1].i, n[2].i, n[3].b, get_pointer(&n[4])));
11793 break;
11794
11795 case OPCODE_UNIFORM_1I64: {
11796 union int64_pair x;
11797
11798 x.int32[0] = n[2].i;
11799 x.int32[1] = n[3].i;
11800
11801 CALL_Uniform1i64ARB(ctx->Dispatch.Exec, (n[1].i, x.int64));
11802 break;
11803 }
11804 case OPCODE_UNIFORM_2I64: {
11805 union int64_pair x;
11806 union int64_pair y;
11807
11808 x.int32[0] = n[2].i;
11809 x.int32[1] = n[3].i;
11810 y.int32[0] = n[4].i;
11811 y.int32[1] = n[5].i;
11812
11813 CALL_Uniform2i64ARB(ctx->Dispatch.Exec, (n[1].i, x.int64, y.int64));
11814 break;
11815 }
11816 case OPCODE_UNIFORM_3I64: {
11817 union int64_pair x;
11818 union int64_pair y;
11819 union int64_pair z;
11820
11821 x.int32[0] = n[2].i;
11822 x.int32[1] = n[3].i;
11823 y.int32[0] = n[4].i;
11824 y.int32[1] = n[5].i;
11825 z.int32[0] = n[6].i;
11826 z.int32[1] = n[7].i;
11827
11828
11829 CALL_Uniform3i64ARB(ctx->Dispatch.Exec, (n[1].i, x.int64, y.int64, z.int64));
11830 break;
11831 }
11832 case OPCODE_UNIFORM_4I64: {
11833 union int64_pair x;
11834 union int64_pair y;
11835 union int64_pair z;
11836 union int64_pair w;
11837
11838 x.int32[0] = n[2].i;
11839 x.int32[1] = n[3].i;
11840 y.int32[0] = n[4].i;
11841 y.int32[1] = n[5].i;
11842 z.int32[0] = n[6].i;
11843 z.int32[1] = n[7].i;
11844 w.int32[0] = n[8].i;
11845 w.int32[1] = n[9].i;
11846
11847 CALL_Uniform4i64ARB(ctx->Dispatch.Exec, (n[1].i, x.int64, y.int64, z.int64, w.int64));
11848 break;
11849 }
11850 case OPCODE_UNIFORM_1I64V:
11851 CALL_Uniform1i64vARB(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11852 break;
11853 case OPCODE_UNIFORM_2I64V:
11854 CALL_Uniform2i64vARB(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11855 break;
11856 case OPCODE_UNIFORM_3I64V:
11857 CALL_Uniform3i64vARB(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11858 break;
11859 case OPCODE_UNIFORM_4I64V:
11860 CALL_Uniform4i64vARB(ctx->Dispatch.Exec, (n[1].i, n[2].i, get_pointer(&n[3])));
11861 break;
11862 case OPCODE_UNIFORM_1UI64: {
11863 union uint64_pair x;
11864
11865 x.uint32[0] = n[2].ui;
11866 x.uint32[1] = n[3].ui;
11867
11868 CALL_Uniform1ui64ARB(ctx->Dispatch.Exec, (n[1].i, x.uint64));
11869 break;
11870 }
11871 case OPCODE_UNIFORM_2UI64: {
11872 union uint64_pair x;
11873 union uint64_pair y;
11874
11875 x.uint32[0] = n[2].ui;
11876 x.uint32[1] = n[3].ui;
11877 y.uint32[0] = n[4].ui;
11878 y.uint32[1] = n[5].ui;
11879
11880 CALL_Uniform2ui64ARB(ctx->Dispatch.Exec, (n[1].i, x.uint64, y.uint64));
11881 break;
11882 }
11883 case OPCODE_UNIFORM_3UI64: {
11884 union uint64_pair x;
11885 union uint64_pair y;
11886 union uint64_pair z;
11887
11888 x.uint32[0] = n[2].ui;
11889 x.uint32[1] = n[3].ui;
11890 y.uint32[0] = n[4].ui;
11891 y.uint32[1] = n[5].ui;
11892 z.uint32[0] = n[6].ui;
11893 z.uint32[1] = n[7].ui;
11894
11895
11896 CALL_Uniform3ui64ARB(ctx->Dispatch.Exec, (n[1].i, x.uint64, y.uint64,
11897 z.uint64));
11898 break;
11899 }
11900 case OPCODE_UNIFORM_4UI64: {
11901 union uint64_pair x;
11902 union uint64_pair y;
11903 union uint64_pair z;
11904 union uint64_pair w;
11905
11906 x.uint32[0] = n[2].ui;
11907 x.uint32[1] = n[3].ui;
11908 y.uint32[0] = n[4].ui;
11909 y.uint32[1] = n[5].ui;
11910 z.uint32[0] = n[6].ui;
11911 z.uint32[1] = n[7].ui;
11912 w.uint32[0] = n[8].ui;
11913 w.uint32[1] = n[9].ui;
11914
11915 CALL_Uniform4ui64ARB(ctx->Dispatch.Exec, (n[1].i, x.uint64, y.uint64,
11916 z.uint64, w.uint64));
11917 break;
11918 }
11919 case OPCODE_UNIFORM_1UI64V:
11920 CALL_Uniform1ui64vARB(ctx->Dispatch.Exec, (n[1].i, n[2].i,
11921 get_pointer(&n[3])));
11922 break;
11923 case OPCODE_UNIFORM_2UI64V:
11924 CALL_Uniform2ui64vARB(ctx->Dispatch.Exec, (n[1].i, n[2].i,
11925 get_pointer(&n[3])));
11926 break;
11927 case OPCODE_UNIFORM_3UI64V:
11928 CALL_Uniform3ui64vARB(ctx->Dispatch.Exec, (n[1].i, n[2].i,
11929 get_pointer(&n[3])));
11930 break;
11931 case OPCODE_UNIFORM_4UI64V:
11932 CALL_Uniform4ui64vARB(ctx->Dispatch.Exec, (n[1].i, n[2].i,
11933 get_pointer(&n[3])));
11934 break;
11935
11936 case OPCODE_PROGRAM_UNIFORM_1I64: {
11937 union int64_pair x;
11938
11939 x.int32[0] = n[3].i;
11940 x.int32[1] = n[4].i;
11941
11942 CALL_ProgramUniform1i64ARB(ctx->Dispatch.Exec, (n[1].ui, n[2].i, x.int64));
11943 break;
11944 }
11945 case OPCODE_PROGRAM_UNIFORM_2I64: {
11946 union int64_pair x;
11947 union int64_pair y;
11948
11949 x.int32[0] = n[3].i;
11950 x.int32[1] = n[4].i;
11951 y.int32[0] = n[5].i;
11952 y.int32[1] = n[6].i;
11953
11954 CALL_ProgramUniform2i64ARB(ctx->Dispatch.Exec, (n[1].ui, n[2].i, x.int64,
11955 y.int64));
11956 break;
11957 }
11958 case OPCODE_PROGRAM_UNIFORM_3I64: {
11959 union int64_pair x;
11960 union int64_pair y;
11961 union int64_pair z;
11962
11963 x.int32[0] = n[3].i;
11964 x.int32[1] = n[4].i;
11965 y.int32[0] = n[5].i;
11966 y.int32[1] = n[6].i;
11967 z.int32[0] = n[7].i;
11968 z.int32[1] = n[8].i;
11969
11970 CALL_ProgramUniform3i64ARB(ctx->Dispatch.Exec, (n[1].ui, n[2].i, x.int64,
11971 y.int64, z.int64));
11972 break;
11973 }
11974 case OPCODE_PROGRAM_UNIFORM_4I64: {
11975 union int64_pair x;
11976 union int64_pair y;
11977 union int64_pair z;
11978 union int64_pair w;
11979
11980 x.int32[0] = n[3].i;
11981 x.int32[1] = n[4].i;
11982 y.int32[0] = n[5].i;
11983 y.int32[1] = n[6].i;
11984 z.int32[0] = n[7].i;
11985 z.int32[1] = n[8].i;
11986 w.int32[0] = n[9].i;
11987 w.int32[1] = n[10].i;
11988
11989 CALL_ProgramUniform4i64ARB(ctx->Dispatch.Exec, (n[1].ui, n[2].i, x.int64,
11990 y.int64, z.int64, w.int64));
11991 break;
11992 }
11993 case OPCODE_PROGRAM_UNIFORM_1I64V:
11994 CALL_ProgramUniform1i64vARB(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
11995 get_pointer(&n[4])));
11996 break;
11997 case OPCODE_PROGRAM_UNIFORM_2I64V:
11998 CALL_ProgramUniform2i64vARB(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
11999 get_pointer(&n[4])));
12000 break;
12001 case OPCODE_PROGRAM_UNIFORM_3I64V:
12002 CALL_ProgramUniform3i64vARB(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12003 get_pointer(&n[4])));
12004 break;
12005 case OPCODE_PROGRAM_UNIFORM_4I64V:
12006 CALL_ProgramUniform4i64vARB(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12007 get_pointer(&n[4])));
12008 break;
12009 case OPCODE_PROGRAM_UNIFORM_1UI64: {
12010 union uint64_pair x;
12011
12012 x.uint32[0] = n[3].ui;
12013 x.uint32[1] = n[4].ui;
12014
12015 CALL_ProgramUniform1i64ARB(ctx->Dispatch.Exec, (n[1].ui, n[2].i, x.uint64));
12016 break;
12017 }
12018 case OPCODE_PROGRAM_UNIFORM_2UI64: {
12019 union uint64_pair x;
12020 union uint64_pair y;
12021
12022 x.uint32[0] = n[3].ui;
12023 x.uint32[1] = n[4].ui;
12024 y.uint32[0] = n[5].ui;
12025 y.uint32[1] = n[6].ui;
12026
12027 CALL_ProgramUniform2ui64ARB(ctx->Dispatch.Exec, (n[1].ui, n[2].i, x.uint64,
12028 y.uint64));
12029 break;
12030 }
12031 case OPCODE_PROGRAM_UNIFORM_3UI64: {
12032 union uint64_pair x;
12033 union uint64_pair y;
12034 union uint64_pair z;
12035
12036 x.uint32[0] = n[3].ui;
12037 x.uint32[1] = n[4].ui;
12038 y.uint32[0] = n[5].ui;
12039 y.uint32[1] = n[6].ui;
12040 z.uint32[0] = n[7].ui;
12041 z.uint32[1] = n[8].ui;
12042
12043 CALL_ProgramUniform3ui64ARB(ctx->Dispatch.Exec, (n[1].ui, n[2].i, x.uint64,
12044 y.uint64, z.uint64));
12045 break;
12046 }
12047 case OPCODE_PROGRAM_UNIFORM_4UI64: {
12048 union uint64_pair x;
12049 union uint64_pair y;
12050 union uint64_pair z;
12051 union uint64_pair w;
12052
12053 x.uint32[0] = n[3].ui;
12054 x.uint32[1] = n[4].ui;
12055 y.uint32[0] = n[5].ui;
12056 y.uint32[1] = n[6].ui;
12057 z.uint32[0] = n[7].ui;
12058 z.uint32[1] = n[8].ui;
12059 w.uint32[0] = n[9].ui;
12060 w.uint32[1] = n[10].ui;
12061
12062 CALL_ProgramUniform4ui64ARB(ctx->Dispatch.Exec, (n[1].ui, n[2].i, x.uint64,
12063 y.uint64, z.uint64, w.uint64));
12064 break;
12065 }
12066 case OPCODE_PROGRAM_UNIFORM_1UI64V:
12067 CALL_ProgramUniform1ui64vARB(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12068 get_pointer(&n[4])));
12069 break;
12070 case OPCODE_PROGRAM_UNIFORM_2UI64V:
12071 CALL_ProgramUniform2ui64vARB(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12072 get_pointer(&n[4])));
12073 break;
12074 case OPCODE_PROGRAM_UNIFORM_3UI64V:
12075 CALL_ProgramUniform3ui64vARB(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12076 get_pointer(&n[4])));
12077 break;
12078 case OPCODE_PROGRAM_UNIFORM_4UI64V:
12079 CALL_ProgramUniform4ui64vARB(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12080 get_pointer(&n[4])));
12081 break;
12082
12083 case OPCODE_USE_PROGRAM_STAGES:
12084 CALL_UseProgramStages(ctx->Dispatch.Exec, (n[1].ui, n[2].ui, n[3].ui));
12085 break;
12086 case OPCODE_PROGRAM_UNIFORM_1F:
12087 CALL_ProgramUniform1f(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].f));
12088 break;
12089 case OPCODE_PROGRAM_UNIFORM_2F:
12090 CALL_ProgramUniform2f(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].f, n[4].f));
12091 break;
12092 case OPCODE_PROGRAM_UNIFORM_3F:
12093 CALL_ProgramUniform3f(ctx->Dispatch.Exec, (n[1].ui, n[2].i,
12094 n[3].f, n[4].f, n[5].f));
12095 break;
12096 case OPCODE_PROGRAM_UNIFORM_4F:
12097 CALL_ProgramUniform4f(ctx->Dispatch.Exec, (n[1].ui, n[2].i,
12098 n[3].f, n[4].f, n[5].f, n[6].f));
12099 break;
12100 case OPCODE_PROGRAM_UNIFORM_1FV:
12101 CALL_ProgramUniform1fv(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12102 get_pointer(&n[4])));
12103 break;
12104 case OPCODE_PROGRAM_UNIFORM_2FV:
12105 CALL_ProgramUniform2fv(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12106 get_pointer(&n[4])));
12107 break;
12108 case OPCODE_PROGRAM_UNIFORM_3FV:
12109 CALL_ProgramUniform3fv(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12110 get_pointer(&n[4])));
12111 break;
12112 case OPCODE_PROGRAM_UNIFORM_4FV:
12113 CALL_ProgramUniform4fv(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12114 get_pointer(&n[4])));
12115 break;
12116 case OPCODE_PROGRAM_UNIFORM_1D: {
12117 union float64_pair x;
12118
12119 x.uint32[0] = n[3].ui;
12120 x.uint32[1] = n[4].ui;
12121
12122 CALL_ProgramUniform1d(ctx->Dispatch.Exec, (n[1].ui, n[2].i, x.d));
12123 break;
12124 }
12125 case OPCODE_PROGRAM_UNIFORM_2D: {
12126 union float64_pair x;
12127 union float64_pair y;
12128
12129 x.uint32[0] = n[3].ui;
12130 x.uint32[1] = n[4].ui;
12131 y.uint32[0] = n[5].ui;
12132 y.uint32[1] = n[6].ui;
12133
12134 CALL_ProgramUniform2d(ctx->Dispatch.Exec, (n[1].ui, n[2].i, x.d, y.d));
12135 break;
12136 }
12137 case OPCODE_PROGRAM_UNIFORM_3D: {
12138 union float64_pair x;
12139 union float64_pair y;
12140 union float64_pair z;
12141
12142 x.uint32[0] = n[3].ui;
12143 x.uint32[1] = n[4].ui;
12144 y.uint32[0] = n[5].ui;
12145 y.uint32[1] = n[6].ui;
12146 z.uint32[0] = n[7].ui;
12147 z.uint32[1] = n[8].ui;
12148
12149 CALL_ProgramUniform3d(ctx->Dispatch.Exec, (n[1].ui, n[2].i,
12150 x.d, y.d, z.d));
12151 break;
12152 }
12153 case OPCODE_PROGRAM_UNIFORM_4D: {
12154 union float64_pair x;
12155 union float64_pair y;
12156 union float64_pair z;
12157 union float64_pair w;
12158
12159 x.uint32[0] = n[3].ui;
12160 x.uint32[1] = n[4].ui;
12161 y.uint32[0] = n[5].ui;
12162 y.uint32[1] = n[6].ui;
12163 z.uint32[0] = n[7].ui;
12164 z.uint32[1] = n[8].ui;
12165 w.uint32[0] = n[9].ui;
12166 w.uint32[1] = n[10].ui;
12167
12168 CALL_ProgramUniform4d(ctx->Dispatch.Exec, (n[1].ui, n[2].i,
12169 x.d, y.d, z.d, w.d));
12170 break;
12171 }
12172 case OPCODE_PROGRAM_UNIFORM_1DV:
12173 CALL_ProgramUniform1dv(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12174 get_pointer(&n[4])));
12175 break;
12176 case OPCODE_PROGRAM_UNIFORM_2DV:
12177 CALL_ProgramUniform2dv(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12178 get_pointer(&n[4])));
12179 break;
12180 case OPCODE_PROGRAM_UNIFORM_3DV:
12181 CALL_ProgramUniform3dv(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12182 get_pointer(&n[4])));
12183 break;
12184 case OPCODE_PROGRAM_UNIFORM_4DV:
12185 CALL_ProgramUniform4dv(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12186 get_pointer(&n[4])));
12187 break;
12188 case OPCODE_PROGRAM_UNIFORM_1I:
12189 CALL_ProgramUniform1i(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i));
12190 break;
12191 case OPCODE_PROGRAM_UNIFORM_2I:
12192 CALL_ProgramUniform2i(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i, n[4].i));
12193 break;
12194 case OPCODE_PROGRAM_UNIFORM_3I:
12195 CALL_ProgramUniform3i(ctx->Dispatch.Exec, (n[1].ui, n[2].i,
12196 n[3].i, n[4].i, n[5].i));
12197 break;
12198 case OPCODE_PROGRAM_UNIFORM_4I:
12199 CALL_ProgramUniform4i(ctx->Dispatch.Exec, (n[1].ui, n[2].i,
12200 n[3].i, n[4].i, n[5].i, n[6].i));
12201 break;
12202 case OPCODE_PROGRAM_UNIFORM_1IV:
12203 CALL_ProgramUniform1iv(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12204 get_pointer(&n[4])));
12205 break;
12206 case OPCODE_PROGRAM_UNIFORM_2IV:
12207 CALL_ProgramUniform2iv(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12208 get_pointer(&n[4])));
12209 break;
12210 case OPCODE_PROGRAM_UNIFORM_3IV:
12211 CALL_ProgramUniform3iv(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12212 get_pointer(&n[4])));
12213 break;
12214 case OPCODE_PROGRAM_UNIFORM_4IV:
12215 CALL_ProgramUniform4iv(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12216 get_pointer(&n[4])));
12217 break;
12218 case OPCODE_PROGRAM_UNIFORM_1UI:
12219 CALL_ProgramUniform1ui(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].ui));
12220 break;
12221 case OPCODE_PROGRAM_UNIFORM_2UI:
12222 CALL_ProgramUniform2ui(ctx->Dispatch.Exec, (n[1].ui, n[2].i,
12223 n[3].ui, n[4].ui));
12224 break;
12225 case OPCODE_PROGRAM_UNIFORM_3UI:
12226 CALL_ProgramUniform3ui(ctx->Dispatch.Exec, (n[1].ui, n[2].i,
12227 n[3].ui, n[4].ui, n[5].ui));
12228 break;
12229 case OPCODE_PROGRAM_UNIFORM_4UI:
12230 CALL_ProgramUniform4ui(ctx->Dispatch.Exec, (n[1].ui, n[2].i,
12231 n[3].ui,
12232 n[4].ui, n[5].ui, n[6].ui));
12233 break;
12234 case OPCODE_PROGRAM_UNIFORM_1UIV:
12235 CALL_ProgramUniform1uiv(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12236 get_pointer(&n[4])));
12237 break;
12238 case OPCODE_PROGRAM_UNIFORM_2UIV:
12239 CALL_ProgramUniform2uiv(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12240 get_pointer(&n[4])));
12241 break;
12242 case OPCODE_PROGRAM_UNIFORM_3UIV:
12243 CALL_ProgramUniform3uiv(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12244 get_pointer(&n[4])));
12245 break;
12246 case OPCODE_PROGRAM_UNIFORM_4UIV:
12247 CALL_ProgramUniform4uiv(ctx->Dispatch.Exec, (n[1].ui, n[2].i, n[3].i,
12248 get_pointer(&n[4])));
12249 break;
12250 case OPCODE_PROGRAM_UNIFORM_MATRIX22F:
12251 CALL_ProgramUniformMatrix2fv(ctx->Dispatch.Exec,
12252 (n[1].ui, n[2].i, n[3].i, n[4].b,
12253 get_pointer(&n[5])));
12254 break;
12255 case OPCODE_PROGRAM_UNIFORM_MATRIX23F:
12256 CALL_ProgramUniformMatrix2x3fv(ctx->Dispatch.Exec,
12257 (n[1].ui, n[2].i, n[3].i, n[4].b,
12258 get_pointer(&n[5])));
12259 break;
12260 case OPCODE_PROGRAM_UNIFORM_MATRIX24F:
12261 CALL_ProgramUniformMatrix2x4fv(ctx->Dispatch.Exec,
12262 (n[1].ui, n[2].i, n[3].i, n[4].b,
12263 get_pointer(&n[5])));
12264 break;
12265 case OPCODE_PROGRAM_UNIFORM_MATRIX32F:
12266 CALL_ProgramUniformMatrix3x2fv(ctx->Dispatch.Exec,
12267 (n[1].ui, n[2].i, n[3].i, n[4].b,
12268 get_pointer(&n[5])));
12269 break;
12270 case OPCODE_PROGRAM_UNIFORM_MATRIX33F:
12271 CALL_ProgramUniformMatrix3fv(ctx->Dispatch.Exec,
12272 (n[1].ui, n[2].i, n[3].i, n[4].b,
12273 get_pointer(&n[5])));
12274 break;
12275 case OPCODE_PROGRAM_UNIFORM_MATRIX34F:
12276 CALL_ProgramUniformMatrix3x4fv(ctx->Dispatch.Exec,
12277 (n[1].ui, n[2].i, n[3].i, n[4].b,
12278 get_pointer(&n[5])));
12279 break;
12280 case OPCODE_PROGRAM_UNIFORM_MATRIX42F:
12281 CALL_ProgramUniformMatrix4x2fv(ctx->Dispatch.Exec,
12282 (n[1].ui, n[2].i, n[3].i, n[4].b,
12283 get_pointer(&n[5])));
12284 break;
12285 case OPCODE_PROGRAM_UNIFORM_MATRIX43F:
12286 CALL_ProgramUniformMatrix4x3fv(ctx->Dispatch.Exec,
12287 (n[1].ui, n[2].i, n[3].i, n[4].b,
12288 get_pointer(&n[5])));
12289 break;
12290 case OPCODE_PROGRAM_UNIFORM_MATRIX44F:
12291 CALL_ProgramUniformMatrix4fv(ctx->Dispatch.Exec,
12292 (n[1].ui, n[2].i, n[3].i, n[4].b,
12293 get_pointer(&n[5])));
12294 break;
12295 case OPCODE_PROGRAM_UNIFORM_MATRIX22D:
12296 CALL_ProgramUniformMatrix2dv(ctx->Dispatch.Exec,
12297 (n[1].ui, n[2].i, n[3].i, n[4].b,
12298 get_pointer(&n[5])));
12299 break;
12300 case OPCODE_PROGRAM_UNIFORM_MATRIX23D:
12301 CALL_ProgramUniformMatrix2x3dv(ctx->Dispatch.Exec,
12302 (n[1].ui, n[2].i, n[3].i, n[4].b,
12303 get_pointer(&n[5])));
12304 break;
12305 case OPCODE_PROGRAM_UNIFORM_MATRIX24D:
12306 CALL_ProgramUniformMatrix2x4dv(ctx->Dispatch.Exec,
12307 (n[1].ui, n[2].i, n[3].i, n[4].b,
12308 get_pointer(&n[5])));
12309 break;
12310 case OPCODE_PROGRAM_UNIFORM_MATRIX32D:
12311 CALL_ProgramUniformMatrix3x2dv(ctx->Dispatch.Exec,
12312 (n[1].ui, n[2].i, n[3].i, n[4].b,
12313 get_pointer(&n[5])));
12314 break;
12315 case OPCODE_PROGRAM_UNIFORM_MATRIX33D:
12316 CALL_ProgramUniformMatrix3dv(ctx->Dispatch.Exec,
12317 (n[1].ui, n[2].i, n[3].i, n[4].b,
12318 get_pointer(&n[5])));
12319 break;
12320 case OPCODE_PROGRAM_UNIFORM_MATRIX34D:
12321 CALL_ProgramUniformMatrix3x4dv(ctx->Dispatch.Exec,
12322 (n[1].ui, n[2].i, n[3].i, n[4].b,
12323 get_pointer(&n[5])));
12324 break;
12325 case OPCODE_PROGRAM_UNIFORM_MATRIX42D:
12326 CALL_ProgramUniformMatrix4x2dv(ctx->Dispatch.Exec,
12327 (n[1].ui, n[2].i, n[3].i, n[4].b,
12328 get_pointer(&n[5])));
12329 break;
12330 case OPCODE_PROGRAM_UNIFORM_MATRIX43D:
12331 CALL_ProgramUniformMatrix4x3dv(ctx->Dispatch.Exec,
12332 (n[1].ui, n[2].i, n[3].i, n[4].b,
12333 get_pointer(&n[5])));
12334 break;
12335 case OPCODE_PROGRAM_UNIFORM_MATRIX44D:
12336 CALL_ProgramUniformMatrix4dv(ctx->Dispatch.Exec,
12337 (n[1].ui, n[2].i, n[3].i, n[4].b,
12338 get_pointer(&n[5])));
12339 break;
12340
12341 case OPCODE_CLIP_CONTROL:
12342 CALL_ClipControl(ctx->Dispatch.Exec, (n[1].e, n[2].e));
12343 break;
12344
12345 case OPCODE_CLAMP_COLOR:
12346 CALL_ClampColor(ctx->Dispatch.Exec, (n[1].e, n[2].e));
12347 break;
12348
12349 case OPCODE_BIND_FRAGMENT_SHADER_ATI:
12350 CALL_BindFragmentShaderATI(ctx->Dispatch.Exec, (n[1].i));
12351 break;
12352 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI:
12353 CALL_SetFragmentShaderConstantATI(ctx->Dispatch.Exec, (n[1].ui, &n[2].f));
12354 break;
12355 case OPCODE_ATTR_1F_NV:
12356 CALL_VertexAttrib1fNV(ctx->Dispatch.Exec, (n[1].e, n[2].f));
12357 break;
12358 case OPCODE_ATTR_2F_NV:
12359 CALL_VertexAttrib2fvNV(ctx->Dispatch.Exec, (n[1].e, &n[2].f));
12360 break;
12361 case OPCODE_ATTR_3F_NV:
12362 CALL_VertexAttrib3fvNV(ctx->Dispatch.Exec, (n[1].e, &n[2].f));
12363 break;
12364 case OPCODE_ATTR_4F_NV:
12365 CALL_VertexAttrib4fvNV(ctx->Dispatch.Exec, (n[1].e, &n[2].f));
12366 break;
12367 case OPCODE_ATTR_1F_ARB:
12368 CALL_VertexAttrib1fARB(ctx->Dispatch.Exec, (n[1].e, n[2].f));
12369 break;
12370 case OPCODE_ATTR_2F_ARB:
12371 CALL_VertexAttrib2fvARB(ctx->Dispatch.Exec, (n[1].e, &n[2].f));
12372 break;
12373 case OPCODE_ATTR_3F_ARB:
12374 CALL_VertexAttrib3fvARB(ctx->Dispatch.Exec, (n[1].e, &n[2].f));
12375 break;
12376 case OPCODE_ATTR_4F_ARB:
12377 CALL_VertexAttrib4fvARB(ctx->Dispatch.Exec, (n[1].e, &n[2].f));
12378 break;
12379 case OPCODE_ATTR_1I:
12380 CALL_VertexAttribI1iEXT(ctx->Dispatch.Exec, (n[1].e, n[2].i));
12381 break;
12382 case OPCODE_ATTR_2I:
12383 CALL_VertexAttribI2ivEXT(ctx->Dispatch.Exec, (n[1].e, &n[2].i));
12384 break;
12385 case OPCODE_ATTR_3I:
12386 CALL_VertexAttribI3ivEXT(ctx->Dispatch.Exec, (n[1].e, &n[2].i));
12387 break;
12388 case OPCODE_ATTR_4I:
12389 CALL_VertexAttribI4ivEXT(ctx->Dispatch.Exec, (n[1].e, &n[2].i));
12390 break;
12391 case OPCODE_ATTR_1D: {
12392 GLdouble *d = (GLdouble *) &n[2];
12393 CALL_VertexAttribL1d(ctx->Dispatch.Exec, (n[1].ui, *d));
12394 break;
12395 }
12396 case OPCODE_ATTR_2D: {
12397 GLdouble *d = (GLdouble *) &n[2];
12398 CALL_VertexAttribL2dv(ctx->Dispatch.Exec, (n[1].ui, d));
12399 break;
12400 }
12401 case OPCODE_ATTR_3D: {
12402 GLdouble *d = (GLdouble *) &n[2];
12403 CALL_VertexAttribL3dv(ctx->Dispatch.Exec, (n[1].ui, d));
12404 break;
12405 }
12406 case OPCODE_ATTR_4D: {
12407 GLdouble *d = (GLdouble *) &n[2];
12408 CALL_VertexAttribL4dv(ctx->Dispatch.Exec, (n[1].ui, d));
12409 break;
12410 }
12411 case OPCODE_ATTR_1UI64: {
12412 uint64_t *ui64 = (uint64_t *) &n[2];
12413 CALL_VertexAttribL1ui64ARB(ctx->Dispatch.Exec, (n[1].ui, *ui64));
12414 break;
12415 }
12416 case OPCODE_MATERIAL:
12417 CALL_Materialfv(ctx->Dispatch.Exec, (n[1].e, n[2].e, &n[3].f));
12418 break;
12419 case OPCODE_BEGIN:
12420 CALL_Begin(ctx->Dispatch.Exec, (n[1].e));
12421 break;
12422 case OPCODE_END:
12423 CALL_End(ctx->Dispatch.Exec, ());
12424 break;
12425 case OPCODE_EVAL_C1:
12426 CALL_EvalCoord1f(ctx->Dispatch.Exec, (n[1].f));
12427 break;
12428 case OPCODE_EVAL_C2:
12429 CALL_EvalCoord2f(ctx->Dispatch.Exec, (n[1].f, n[2].f));
12430 break;
12431 case OPCODE_EVAL_P1:
12432 CALL_EvalPoint1(ctx->Dispatch.Exec, (n[1].i));
12433 break;
12434 case OPCODE_EVAL_P2:
12435 CALL_EvalPoint2(ctx->Dispatch.Exec, (n[1].i, n[2].i));
12436 break;
12437
12438 /* GL_EXT_texture_integer */
12439 case OPCODE_CLEARCOLOR_I:
12440 CALL_ClearColorIiEXT(ctx->Dispatch.Exec, (n[1].i, n[2].i, n[3].i, n[4].i));
12441 break;
12442 case OPCODE_CLEARCOLOR_UI:
12443 CALL_ClearColorIuiEXT(ctx->Dispatch.Exec,
12444 (n[1].ui, n[2].ui, n[3].ui, n[4].ui));
12445 break;
12446 case OPCODE_TEXPARAMETER_I:
12447 {
12448 GLint params[4];
12449 params[0] = n[3].i;
12450 params[1] = n[4].i;
12451 params[2] = n[5].i;
12452 params[3] = n[6].i;
12453 CALL_TexParameterIiv(ctx->Dispatch.Exec, (n[1].e, n[2].e, params));
12454 }
12455 break;
12456 case OPCODE_TEXPARAMETER_UI:
12457 {
12458 GLuint params[4];
12459 params[0] = n[3].ui;
12460 params[1] = n[4].ui;
12461 params[2] = n[5].ui;
12462 params[3] = n[6].ui;
12463 CALL_TexParameterIuiv(ctx->Dispatch.Exec, (n[1].e, n[2].e, params));
12464 }
12465 break;
12466
12467 case OPCODE_VERTEX_ATTRIB_DIVISOR:
12468 /* GL_EXT/ARB_instanced_arrays */
12469 CALL_VertexAttribDivisor(ctx->Dispatch.Exec, (n[1].ui, n[2].ui));
12470 break;
12471
12472 case OPCODE_TEXTURE_BARRIER_NV:
12473 CALL_TextureBarrierNV(ctx->Dispatch.Exec, ());
12474 break;
12475
12476 /* GL_EXT/ARB_transform_feedback */
12477 case OPCODE_BEGIN_TRANSFORM_FEEDBACK:
12478 CALL_BeginTransformFeedback(ctx->Dispatch.Exec, (n[1].e));
12479 break;
12480 case OPCODE_END_TRANSFORM_FEEDBACK:
12481 CALL_EndTransformFeedback(ctx->Dispatch.Exec, ());
12482 break;
12483 case OPCODE_BIND_TRANSFORM_FEEDBACK:
12484 CALL_BindTransformFeedback(ctx->Dispatch.Exec, (n[1].e, n[2].ui));
12485 break;
12486 case OPCODE_PAUSE_TRANSFORM_FEEDBACK:
12487 CALL_PauseTransformFeedback(ctx->Dispatch.Exec, ());
12488 break;
12489 case OPCODE_RESUME_TRANSFORM_FEEDBACK:
12490 CALL_ResumeTransformFeedback(ctx->Dispatch.Exec, ());
12491 break;
12492 case OPCODE_DRAW_TRANSFORM_FEEDBACK:
12493 CALL_DrawTransformFeedback(ctx->Dispatch.Exec, (n[1].e, n[2].ui));
12494 break;
12495 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM:
12496 CALL_DrawTransformFeedbackStream(ctx->Dispatch.Exec,
12497 (n[1].e, n[2].ui, n[3].ui));
12498 break;
12499 case OPCODE_DRAW_TRANSFORM_FEEDBACK_INSTANCED:
12500 CALL_DrawTransformFeedbackInstanced(ctx->Dispatch.Exec,
12501 (n[1].e, n[2].ui, n[3].si));
12502 break;
12503 case OPCODE_DRAW_TRANSFORM_FEEDBACK_STREAM_INSTANCED:
12504 CALL_DrawTransformFeedbackStreamInstanced(ctx->Dispatch.Exec,
12505 (n[1].e, n[2].ui, n[3].ui, n[4].si));
12506 break;
12507
12508
12509 case OPCODE_BIND_SAMPLER:
12510 CALL_BindSampler(ctx->Dispatch.Exec, (n[1].ui, n[2].ui));
12511 break;
12512 case OPCODE_SAMPLER_PARAMETERIV:
12513 {
12514 GLint params[4];
12515 params[0] = n[3].i;
12516 params[1] = n[4].i;
12517 params[2] = n[5].i;
12518 params[3] = n[6].i;
12519 CALL_SamplerParameteriv(ctx->Dispatch.Exec, (n[1].ui, n[2].e, params));
12520 }
12521 break;
12522 case OPCODE_SAMPLER_PARAMETERFV:
12523 {
12524 GLfloat params[4];
12525 params[0] = n[3].f;
12526 params[1] = n[4].f;
12527 params[2] = n[5].f;
12528 params[3] = n[6].f;
12529 CALL_SamplerParameterfv(ctx->Dispatch.Exec, (n[1].ui, n[2].e, params));
12530 }
12531 break;
12532 case OPCODE_SAMPLER_PARAMETERIIV:
12533 {
12534 GLint params[4];
12535 params[0] = n[3].i;
12536 params[1] = n[4].i;
12537 params[2] = n[5].i;
12538 params[3] = n[6].i;
12539 CALL_SamplerParameterIiv(ctx->Dispatch.Exec, (n[1].ui, n[2].e, params));
12540 }
12541 break;
12542 case OPCODE_SAMPLER_PARAMETERUIV:
12543 {
12544 GLuint params[4];
12545 params[0] = n[3].ui;
12546 params[1] = n[4].ui;
12547 params[2] = n[5].ui;
12548 params[3] = n[6].ui;
12549 CALL_SamplerParameterIuiv(ctx->Dispatch.Exec, (n[1].ui, n[2].e, params));
12550 }
12551 break;
12552
12553 /* ARB_compute_shader */
12554 case OPCODE_DISPATCH_COMPUTE:
12555 CALL_DispatchCompute(ctx->Dispatch.Exec, (n[1].ui, n[2].ui, n[3].ui));
12556 break;
12557
12558 /* GL_ARB_sync */
12559 case OPCODE_WAIT_SYNC:
12560 {
12561 union uint64_pair p;
12562 p.uint32[0] = n[2].ui;
12563 p.uint32[1] = n[3].ui;
12564 CALL_WaitSync(ctx->Dispatch.Exec,
12565 (get_pointer(&n[4]), n[1].bf, p.uint64));
12566 }
12567 break;
12568
12569 /* GL_NV_conditional_render */
12570 case OPCODE_BEGIN_CONDITIONAL_RENDER:
12571 CALL_BeginConditionalRender(ctx->Dispatch.Exec, (n[1].i, n[2].e));
12572 break;
12573 case OPCODE_END_CONDITIONAL_RENDER:
12574 CALL_EndConditionalRender(ctx->Dispatch.Exec, ());
12575 break;
12576
12577 case OPCODE_UNIFORM_BLOCK_BINDING:
12578 CALL_UniformBlockBinding(ctx->Dispatch.Exec, (n[1].ui, n[2].ui, n[3].ui));
12579 break;
12580
12581 case OPCODE_UNIFORM_SUBROUTINES:
12582 CALL_UniformSubroutinesuiv(ctx->Dispatch.Exec, (n[1].e, n[2].si,
12583 get_pointer(&n[3])));
12584 break;
12585
12586 /* GL_EXT_window_rectangles */
12587 case OPCODE_WINDOW_RECTANGLES:
12588 CALL_WindowRectanglesEXT(
12589 ctx->Dispatch.Exec, (n[1].e, n[2].si, get_pointer(&n[3])));
12590 break;
12591
12592 /* GL_NV_conservative_raster */
12593 case OPCODE_SUBPIXEL_PRECISION_BIAS:
12594 CALL_SubpixelPrecisionBiasNV(ctx->Dispatch.Exec, (n[1].ui, n[2].ui));
12595 break;
12596
12597 /* GL_NV_conservative_raster_dilate */
12598 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_F:
12599 CALL_ConservativeRasterParameterfNV(ctx->Dispatch.Exec, (n[1].e, n[2].f));
12600 break;
12601
12602 /* GL_NV_conservative_raster_pre_snap_triangles */
12603 case OPCODE_CONSERVATIVE_RASTER_PARAMETER_I:
12604 CALL_ConservativeRasterParameteriNV(ctx->Dispatch.Exec, (n[1].e, n[2].i));
12605 break;
12606
12607 /* GL_EXT_direct_state_access */
12608 case OPCODE_MATRIX_LOAD:
12609 CALL_MatrixLoadfEXT(ctx->Dispatch.Exec, (n[1].e, &n[2].f));
12610 break;
12611 case OPCODE_MATRIX_MULT:
12612 CALL_MatrixMultfEXT(ctx->Dispatch.Exec, (n[1].e, &n[2].f));
12613 break;
12614 case OPCODE_MATRIX_ROTATE:
12615 CALL_MatrixRotatefEXT(ctx->Dispatch.Exec, (n[1].e, n[2].f, n[3].f, n[4].f, n[5].f));
12616 break;
12617 case OPCODE_MATRIX_SCALE:
12618 CALL_MatrixScalefEXT(ctx->Dispatch.Exec, (n[1].e, n[2].f, n[3].f, n[4].f));
12619 break;
12620 case OPCODE_MATRIX_TRANSLATE:
12621 CALL_MatrixTranslatefEXT(ctx->Dispatch.Exec, (n[1].e, n[2].f, n[3].f, n[4].f));
12622 break;
12623 case OPCODE_MATRIX_LOAD_IDENTITY:
12624 CALL_MatrixLoadIdentityEXT(ctx->Dispatch.Exec, (n[1].e));
12625 break;
12626 case OPCODE_MATRIX_ORTHO:
12627 CALL_MatrixOrthoEXT(ctx->Dispatch.Exec, (n[1].e,
12628 n[2].f, n[3].f, n[4].f,
12629 n[5].f, n[6].f, n[7].f));
12630 break;
12631 case OPCODE_MATRIX_FRUSTUM:
12632 CALL_MatrixFrustumEXT(ctx->Dispatch.Exec, (n[1].e,
12633 n[2].f, n[3].f, n[4].f,
12634 n[5].f, n[6].f, n[7].f));
12635 break;
12636 case OPCODE_MATRIX_PUSH:
12637 CALL_MatrixPushEXT(ctx->Dispatch.Exec, (n[1].e));
12638 break;
12639 case OPCODE_MATRIX_POP:
12640 CALL_MatrixPopEXT(ctx->Dispatch.Exec, (n[1].e));
12641 break;
12642 case OPCODE_TEXTUREPARAMETER_F:
12643 {
12644 GLfloat params[4];
12645 params[0] = n[4].f;
12646 params[1] = n[5].f;
12647 params[2] = n[6].f;
12648 params[3] = n[7].f;
12649 CALL_TextureParameterfvEXT(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].e, params));
12650 }
12651 break;
12652 case OPCODE_TEXTUREPARAMETER_I:
12653 {
12654 GLint params[4];
12655 params[0] = n[4].i;
12656 params[1] = n[5].i;
12657 params[2] = n[6].i;
12658 params[3] = n[7].i;
12659 CALL_TextureParameterivEXT(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].e, params));
12660 }
12661 break;
12662 case OPCODE_TEXTUREPARAMETER_II:
12663 {
12664 GLint params[4];
12665 params[0] = n[4].i;
12666 params[1] = n[5].i;
12667 params[2] = n[6].i;
12668 params[3] = n[7].i;
12669 CALL_TextureParameterIivEXT(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].e, params));
12670 }
12671 break;
12672 case OPCODE_TEXTUREPARAMETER_IUI:
12673 {
12674 GLuint params[4];
12675 params[0] = n[4].ui;
12676 params[1] = n[5].ui;
12677 params[2] = n[6].ui;
12678 params[3] = n[7].ui;
12679 CALL_TextureParameterIuivEXT(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].e, params));
12680 }
12681 break;
12682 case OPCODE_TEXTURE_IMAGE1D:
12683 {
12684 const struct gl_pixelstore_attrib save = ctx->Unpack;
12685 ctx->Unpack = ctx->DefaultPacking;
12686 CALL_TextureImage1DEXT(ctx->Dispatch.Exec, (n[1].ui, /* texture */
12687 n[2].e, /* target */
12688 n[3].i, /* level */
12689 n[4].i, /* components */
12690 n[5].i, /* width */
12691 n[6].e, /* border */
12692 n[7].e, /* format */
12693 n[8].e, /* type */
12694 get_pointer(&n[9])));
12695 ctx->Unpack = save; /* restore */
12696 }
12697 break;
12698 case OPCODE_TEXTURE_IMAGE2D:
12699 {
12700 const struct gl_pixelstore_attrib save = ctx->Unpack;
12701 ctx->Unpack = ctx->DefaultPacking;
12702 CALL_TextureImage2DEXT(ctx->Dispatch.Exec, (n[1].ui, /* texture */
12703 n[2].e, /* target */
12704 n[3].i, /* level */
12705 n[4].i, /* components */
12706 n[5].i, /* width */
12707 n[6].i, /* height */
12708 n[7].e, /* border */
12709 n[8].e, /* format */
12710 n[9].e, /* type */
12711 get_pointer(&n[10])));
12712 ctx->Unpack = save; /* restore */
12713 }
12714 break;
12715 case OPCODE_TEXTURE_IMAGE3D:
12716 {
12717 const struct gl_pixelstore_attrib save = ctx->Unpack;
12718 ctx->Unpack = ctx->DefaultPacking;
12719 CALL_TextureImage3DEXT(ctx->Dispatch.Exec, (n[1].ui, /* texture */
12720 n[2].e, /* target */
12721 n[3].i, /* level */
12722 n[4].i, /* components */
12723 n[5].i, /* width */
12724 n[6].i, /* height */
12725 n[7].i, /* depth */
12726 n[8].e, /* border */
12727 n[9].e, /* format */
12728 n[10].e, /* type */
12729 get_pointer(&n[11])));
12730 ctx->Unpack = save; /* restore */
12731 }
12732 break;
12733 case OPCODE_TEXTURE_SUB_IMAGE1D:
12734 {
12735 const struct gl_pixelstore_attrib save = ctx->Unpack;
12736 ctx->Unpack = ctx->DefaultPacking;
12737 CALL_TextureSubImage1DEXT(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].i,
12738 n[4].i, n[5].i, n[6].e,
12739 n[7].e, get_pointer(&n[8])));
12740 ctx->Unpack = save; /* restore */
12741 }
12742 break;
12743 case OPCODE_TEXTURE_SUB_IMAGE2D:
12744 {
12745 const struct gl_pixelstore_attrib save = ctx->Unpack;
12746 ctx->Unpack = ctx->DefaultPacking;
12747 CALL_TextureSubImage2DEXT(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].i,
12748 n[4].i, n[5].i, n[6].e,
12749 n[7].i, n[8].e, n[9].e,
12750 get_pointer(&n[10])));
12751 ctx->Unpack = save;
12752 }
12753 break;
12754 case OPCODE_TEXTURE_SUB_IMAGE3D:
12755 {
12756 const struct gl_pixelstore_attrib save = ctx->Unpack;
12757 ctx->Unpack = ctx->DefaultPacking;
12758 CALL_TextureSubImage3DEXT(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].i,
12759 n[4].i, n[5].i, n[6].i,
12760 n[7].i, n[8].i, n[9].i,
12761 n[10].e, n[11].e,
12762 get_pointer(&n[12])));
12763 ctx->Unpack = save; /* restore */
12764 }
12765 break;
12766 case OPCODE_COPY_TEXTURE_IMAGE1D:
12767 CALL_CopyTextureImage1DEXT(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].i,
12768 n[4].e, n[5].i, n[6].i,
12769 n[7].i, n[8].i));
12770 break;
12771 case OPCODE_COPY_TEXTURE_IMAGE2D:
12772 CALL_CopyTextureImage2DEXT(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].i,
12773 n[4].e, n[5].i, n[6].i,
12774 n[7].i, n[8].i, n[9].i));
12775 break;
12776 case OPCODE_COPY_TEXTURE_SUB_IMAGE1D:
12777 CALL_CopyTextureSubImage1DEXT(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].i,
12778 n[4].i, n[5].i, n[6].i,
12779 n[7].i));
12780 break;
12781 case OPCODE_COPY_TEXTURE_SUB_IMAGE2D:
12782 CALL_CopyTextureSubImage2DEXT(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].i,
12783 n[4].i, n[5].i, n[6].i,
12784 n[7].i, n[8].i, n[9].i));
12785 break;
12786 case OPCODE_COPY_TEXTURE_SUB_IMAGE3D:
12787 CALL_CopyTextureSubImage3DEXT(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].i,
12788 n[4].i, n[5].i, n[6].i,
12789 n[7].i, n[8].i, n[9].i,
12790 n[10].i));
12791 break;
12792 case OPCODE_BIND_MULTITEXTURE:
12793 CALL_BindMultiTextureEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].ui));
12794 break;
12795 case OPCODE_MULTITEXPARAMETER_F:
12796 {
12797 GLfloat params[4];
12798 params[0] = n[4].f;
12799 params[1] = n[5].f;
12800 params[2] = n[6].f;
12801 params[3] = n[7].f;
12802 CALL_MultiTexParameterfvEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].e, params));
12803 }
12804 break;
12805 case OPCODE_MULTITEXPARAMETER_I:
12806 {
12807 GLint params[4];
12808 params[0] = n[4].i;
12809 params[1] = n[5].i;
12810 params[2] = n[6].i;
12811 params[3] = n[7].i;
12812 CALL_MultiTexParameterivEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].e, params));
12813 }
12814 break;
12815 case OPCODE_MULTITEXPARAMETER_II:
12816 {
12817 GLint params[4];
12818 params[0] = n[4].i;
12819 params[1] = n[5].i;
12820 params[2] = n[6].i;
12821 params[3] = n[7].i;
12822 CALL_MultiTexParameterIivEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].e, params));
12823 }
12824 break;
12825 case OPCODE_MULTITEXPARAMETER_IUI:
12826 {
12827 GLuint params[4];
12828 params[0] = n[4].ui;
12829 params[1] = n[5].ui;
12830 params[2] = n[6].ui;
12831 params[3] = n[7].ui;
12832 CALL_MultiTexParameterIuivEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].e, params));
12833 }
12834 break;
12835 case OPCODE_MULTITEX_IMAGE1D:
12836 {
12837 const struct gl_pixelstore_attrib save = ctx->Unpack;
12838 ctx->Unpack = ctx->DefaultPacking;
12839 CALL_MultiTexImage1DEXT(ctx->Dispatch.Exec, (n[1].e, /* texture */
12840 n[2].e, /* target */
12841 n[3].i, /* level */
12842 n[4].i, /* components */
12843 n[5].i, /* width */
12844 n[6].e, /* border */
12845 n[7].e, /* format */
12846 n[8].e, /* type */
12847 get_pointer(&n[9])));
12848 ctx->Unpack = save; /* restore */
12849 }
12850 break;
12851 case OPCODE_MULTITEX_IMAGE2D:
12852 {
12853 const struct gl_pixelstore_attrib save = ctx->Unpack;
12854 ctx->Unpack = ctx->DefaultPacking;
12855 CALL_MultiTexImage2DEXT(ctx->Dispatch.Exec, (n[1].e, /* texture */
12856 n[2].e, /* target */
12857 n[3].i, /* level */
12858 n[4].i, /* components */
12859 n[5].i, /* width */
12860 n[6].i, /* height */
12861 n[7].e, /* border */
12862 n[8].e, /* format */
12863 n[9].e, /* type */
12864 get_pointer(&n[10])));
12865 ctx->Unpack = save; /* restore */
12866 }
12867 break;
12868 case OPCODE_MULTITEX_IMAGE3D:
12869 {
12870 const struct gl_pixelstore_attrib save = ctx->Unpack;
12871 ctx->Unpack = ctx->DefaultPacking;
12872 CALL_MultiTexImage3DEXT(ctx->Dispatch.Exec, (n[1].e, /* texture */
12873 n[2].e, /* target */
12874 n[3].i, /* level */
12875 n[4].i, /* components */
12876 n[5].i, /* width */
12877 n[6].i, /* height */
12878 n[7].i, /* depth */
12879 n[8].e, /* border */
12880 n[9].e, /* format */
12881 n[10].e, /* type */
12882 get_pointer(&n[11])));
12883 ctx->Unpack = save; /* restore */
12884 }
12885 break;
12886 case OPCODE_MULTITEX_SUB_IMAGE1D:
12887 {
12888 const struct gl_pixelstore_attrib save = ctx->Unpack;
12889 ctx->Unpack = ctx->DefaultPacking;
12890 CALL_MultiTexSubImage1DEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].i,
12891 n[4].i, n[5].i, n[6].e,
12892 n[7].e, get_pointer(&n[8])));
12893 ctx->Unpack = save; /* restore */
12894 }
12895 break;
12896 case OPCODE_MULTITEX_SUB_IMAGE2D:
12897 {
12898 const struct gl_pixelstore_attrib save = ctx->Unpack;
12899 ctx->Unpack = ctx->DefaultPacking;
12900 CALL_MultiTexSubImage2DEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].i,
12901 n[4].i, n[5].i, n[6].e,
12902 n[7].i, n[8].e, n[9].e,
12903 get_pointer(&n[10])));
12904 ctx->Unpack = save; /* restore */
12905 }
12906 break;
12907 case OPCODE_MULTITEX_SUB_IMAGE3D:
12908 {
12909 const struct gl_pixelstore_attrib save = ctx->Unpack;
12910 ctx->Unpack = ctx->DefaultPacking;
12911 CALL_MultiTexSubImage3DEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].i,
12912 n[4].i, n[5].i, n[6].i,
12913 n[7].i, n[8].i, n[9].i,
12914 n[10].e, n[11].e,
12915 get_pointer(&n[12])));
12916 ctx->Unpack = save; /* restore */
12917 }
12918 break;
12919 case OPCODE_COPY_MULTITEX_IMAGE1D:
12920 CALL_CopyMultiTexImage1DEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].i,
12921 n[4].e, n[5].i, n[6].i,
12922 n[7].i, n[8].i));
12923 break;
12924 case OPCODE_COPY_MULTITEX_IMAGE2D:
12925 CALL_CopyMultiTexImage2DEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].i,
12926 n[4].e, n[5].i, n[6].i,
12927 n[7].i, n[8].i, n[9].i));
12928 break;
12929 case OPCODE_COPY_MULTITEX_SUB_IMAGE1D:
12930 CALL_CopyMultiTexSubImage1DEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].i,
12931 n[4].i, n[5].i, n[6].i,
12932 n[7].i));
12933 break;
12934 case OPCODE_COPY_MULTITEX_SUB_IMAGE2D:
12935 CALL_CopyMultiTexSubImage2DEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].i,
12936 n[4].i, n[5].i, n[6].i,
12937 n[7].i, n[8].i, n[9].i));
12938 break;
12939 case OPCODE_COPY_MULTITEX_SUB_IMAGE3D:
12940 CALL_CopyMultiTexSubImage3DEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].i,
12941 n[4].i, n[5].i, n[6].i,
12942 n[7].i, n[8].i, n[9].i,
12943 n[10].i));
12944 break;
12945 case OPCODE_MULTITEXENV:
12946 {
12947 GLfloat params[4];
12948 params[0] = n[4].f;
12949 params[1] = n[5].f;
12950 params[2] = n[6].f;
12951 params[3] = n[7].f;
12952 CALL_MultiTexEnvfvEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].e, params));
12953 }
12954 break;
12955 case OPCODE_COMPRESSED_TEXTURE_IMAGE_1D:
12956 CALL_CompressedTextureImage1DEXT(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].i,
12957 n[4].e, n[5].i, n[6].i,
12958 n[7].i, get_pointer(&n[8])));
12959 break;
12960 case OPCODE_COMPRESSED_TEXTURE_IMAGE_2D:
12961 CALL_CompressedTextureImage2DEXT(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].i,
12962 n[4].e, n[5].i, n[6].i,
12963 n[7].i, n[8].i,
12964 get_pointer(&n[9])));
12965 break;
12966 case OPCODE_COMPRESSED_TEXTURE_IMAGE_3D:
12967 CALL_CompressedTextureImage3DEXT(ctx->Dispatch.Exec, (n[1].ui, n[2].e, n[3].i,
12968 n[4].e, n[5].i, n[6].i,
12969 n[7].i, n[8].i, n[9].i,
12970 get_pointer(&n[10])));
12971 break;
12972 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_1D:
12973 CALL_CompressedTextureSubImage1DEXT(ctx->Dispatch.Exec,
12974 (n[1].ui, n[2].e, n[3].i, n[4].i,
12975 n[5].i, n[6].e, n[7].i,
12976 get_pointer(&n[8])));
12977 break;
12978 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_2D:
12979 CALL_CompressedTextureSubImage2DEXT(ctx->Dispatch.Exec,
12980 (n[1].ui, n[2].e, n[3].i, n[4].i,
12981 n[5].i, n[6].i, n[7].i, n[8].e,
12982 n[9].i, get_pointer(&n[10])));
12983 break;
12984 case OPCODE_COMPRESSED_TEXTURE_SUB_IMAGE_3D:
12985 CALL_CompressedTextureSubImage3DEXT(ctx->Dispatch.Exec,
12986 (n[1].ui, n[2].e, n[3].i, n[4].i,
12987 n[5].i, n[6].i, n[7].i, n[8].i,
12988 n[9].i, n[10].e, n[11].i,
12989 get_pointer(&n[12])));
12990 break;
12991 case OPCODE_COMPRESSED_MULTITEX_IMAGE_1D:
12992 CALL_CompressedMultiTexImage1DEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].i,
12993 n[4].e, n[5].i, n[6].i,
12994 n[7].i, get_pointer(&n[8])));
12995 break;
12996 case OPCODE_COMPRESSED_MULTITEX_IMAGE_2D:
12997 CALL_CompressedMultiTexImage2DEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].i,
12998 n[4].e, n[5].i, n[6].i,
12999 n[7].i, n[8].i,
13000 get_pointer(&n[9])));
13001 break;
13002 case OPCODE_COMPRESSED_MULTITEX_IMAGE_3D:
13003 CALL_CompressedMultiTexImage3DEXT(ctx->Dispatch.Exec, (n[1].e, n[2].e, n[3].i,
13004 n[4].e, n[5].i, n[6].i,
13005 n[7].i, n[8].i, n[9].i,
13006 get_pointer(&n[10])));
13007 break;
13008 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_1D:
13009 CALL_CompressedMultiTexSubImage1DEXT(ctx->Dispatch.Exec,
13010 (n[1].e, n[2].e, n[3].i, n[4].i,
13011 n[5].i, n[6].e, n[7].i,
13012 get_pointer(&n[8])));
13013 break;
13014 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_2D:
13015 CALL_CompressedMultiTexSubImage2DEXT(ctx->Dispatch.Exec,
13016 (n[1].e, n[2].e, n[3].i, n[4].i,
13017 n[5].i, n[6].i, n[7].i, n[8].e,
13018 n[9].i, get_pointer(&n[10])));
13019 break;
13020 case OPCODE_COMPRESSED_MULTITEX_SUB_IMAGE_3D:
13021 CALL_CompressedMultiTexSubImage3DEXT(ctx->Dispatch.Exec,
13022 (n[1].e, n[2].e, n[3].i, n[4].i,
13023 n[5].i, n[6].i, n[7].i, n[8].i,
13024 n[9].i, n[10].e, n[11].i,
13025 get_pointer(&n[12])));
13026 break;
13027 case OPCODE_NAMED_PROGRAM_STRING:
13028 CALL_NamedProgramStringEXT(ctx->Dispatch.Exec,
13029 (n[1].ui, n[2].e, n[3].e, n[4].i,
13030 get_pointer(&n[5])));
13031 break;
13032 case OPCODE_NAMED_PROGRAM_LOCAL_PARAMETER:
13033 CALL_NamedProgramLocalParameter4fEXT(ctx->Dispatch.Exec,
13034 (n[1].ui, n[2].e, n[3].ui, n[4].f,
13035 n[5].f, n[6].f, n[7].f));
13036 break;
13037
13038 case OPCODE_PRIMITIVE_BOUNDING_BOX:
13039 CALL_PrimitiveBoundingBox(ctx->Dispatch.Exec,
13040 (n[1].f, n[2].f, n[3].f, n[4].f,
13041 n[5].f, n[6].f, n[7].f, n[8].f));
13042 break;
13043 case OPCODE_VERTEX_LIST:
13044 vbo_save_playback_vertex_list(ctx, &n[0], false);
13045 break;
13046
13047 case OPCODE_VERTEX_LIST_COPY_CURRENT:
13048 vbo_save_playback_vertex_list(ctx, &n[0], true);
13049 break;
13050
13051 case OPCODE_VERTEX_LIST_LOOPBACK:
13052 vbo_save_playback_vertex_list_loopback(ctx, &n[0]);
13053 break;
13054
13055 case OPCODE_CONTINUE:
13056 n = (Node *) get_pointer(&n[1]);
13057 continue;
13058 default:
13059 {
13060 char msg[1000];
13061 snprintf(msg, sizeof(msg), "Error in execute_list: opcode=%d",
13062 (int) opcode);
13063 _mesa_problem(ctx, "%s", msg);
13064 }
13065 FALLTHROUGH;
13066 case OPCODE_END_OF_LIST:
13067 return;
13068 }
13069
13070 /* increment n to point to next compiled command */
13071 assert(n[0].InstSize > 0);
13072 n += n[0].InstSize;
13073 }
13074 }
13075
13076
13077
13078 /**********************************************************************/
13079 /* GL functions */
13080 /**********************************************************************/
13081
13082 /**
13083 * Test if a display list number is valid.
13084 */
13085 GLboolean GLAPIENTRY
_mesa_IsList(GLuint list)13086 _mesa_IsList(GLuint list)
13087 {
13088 GET_CURRENT_CONTEXT(ctx);
13089 FLUSH_VERTICES(ctx, 0, 0); /* must be called before assert */
13090 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
13091 return _mesa_get_list(ctx, list, NULL, false);
13092 }
13093
13094
13095 /**
13096 * Delete a sequence of consecutive display lists.
13097 */
13098 void GLAPIENTRY
_mesa_DeleteLists(GLuint list,GLsizei range)13099 _mesa_DeleteLists(GLuint list, GLsizei range)
13100 {
13101 GET_CURRENT_CONTEXT(ctx);
13102 GLuint i;
13103 FLUSH_VERTICES(ctx, 0, 0); /* must be called before assert */
13104 ASSERT_OUTSIDE_BEGIN_END(ctx);
13105
13106 if (range < 0) {
13107 _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteLists");
13108 return;
13109 }
13110
13111 _mesa_HashLockMutex(&ctx->Shared->DisplayList);
13112 for (i = list; i < list + range; i++) {
13113 destroy_list(ctx, i);
13114 }
13115 _mesa_HashUnlockMutex(&ctx->Shared->DisplayList);
13116 }
13117
13118
13119 /**
13120 * Return a display list number, n, such that lists n through n+range-1
13121 * are free.
13122 */
13123 GLuint GLAPIENTRY
_mesa_GenLists(GLsizei range)13124 _mesa_GenLists(GLsizei range)
13125 {
13126 GET_CURRENT_CONTEXT(ctx);
13127 GLuint base;
13128 FLUSH_VERTICES(ctx, 0, 0); /* must be called before assert */
13129 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
13130
13131 if (range < 0) {
13132 _mesa_error(ctx, GL_INVALID_VALUE, "glGenLists");
13133 return 0;
13134 }
13135 if (range == 0) {
13136 return 0;
13137 }
13138
13139 /*
13140 * Make this an atomic operation
13141 */
13142 _mesa_HashLockMutex(&ctx->Shared->DisplayList);
13143
13144 base = _mesa_HashFindFreeKeyBlock(&ctx->Shared->DisplayList, range);
13145 if (base) {
13146 /* reserve the list IDs by with empty/dummy lists */
13147 GLint i;
13148 for (i = 0; i < range; i++) {
13149 _mesa_HashInsertLocked(&ctx->Shared->DisplayList, base + i,
13150 make_list(base + i, 1));
13151 }
13152 }
13153
13154 _mesa_HashUnlockMutex(&ctx->Shared->DisplayList);
13155
13156 return base;
13157 }
13158
13159
13160 /**
13161 * Begin a new display list.
13162 */
13163 void GLAPIENTRY
_mesa_NewList(GLuint name,GLenum mode)13164 _mesa_NewList(GLuint name, GLenum mode)
13165 {
13166 GET_CURRENT_CONTEXT(ctx);
13167
13168 FLUSH_CURRENT(ctx, 0); /* must be called before assert */
13169 ASSERT_OUTSIDE_BEGIN_END(ctx);
13170
13171 if (MESA_VERBOSE & VERBOSE_API)
13172 _mesa_debug(ctx, "glNewList %u %s\n", name,
13173 _mesa_enum_to_string(mode));
13174
13175 if (name == 0) {
13176 _mesa_error(ctx, GL_INVALID_VALUE, "glNewList");
13177 return;
13178 }
13179
13180 if (mode != GL_COMPILE && mode != GL_COMPILE_AND_EXECUTE) {
13181 _mesa_error(ctx, GL_INVALID_ENUM, "glNewList");
13182 return;
13183 }
13184
13185 if (ctx->ListState.CurrentList) {
13186 /* already compiling a display list */
13187 _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList");
13188 return;
13189 }
13190
13191 ctx->CompileFlag = GL_TRUE;
13192 ctx->ExecuteFlag = (mode == GL_COMPILE_AND_EXECUTE);
13193
13194 /* Reset accumulated list state */
13195 invalidate_saved_current_state( ctx );
13196
13197 /* Allocate new display list */
13198 ctx->ListState.CurrentList = make_list(name, BLOCK_SIZE);
13199 ctx->ListState.CurrentBlock = ctx->ListState.CurrentList->Head;
13200 ctx->ListState.CurrentPos = 0;
13201 ctx->ListState.LastInstSize = 0;
13202 ctx->ListState.Current.UseLoopback = false;
13203
13204 vbo_save_NewList(ctx, name, mode);
13205
13206 ctx->Dispatch.Current = ctx->Dispatch.Save;
13207 _glapi_set_dispatch(ctx->Dispatch.Current);
13208 if (!ctx->GLThread.enabled) {
13209 ctx->GLApi = ctx->Dispatch.Current;
13210 }
13211 }
13212
13213
13214 /**
13215 * Walk all the opcode from a given list, recursively if OPCODE_CALL_LIST(S) is used,
13216 * and replace OPCODE_VERTEX_LIST[_COPY_CURRENT] occurences by OPCODE_VERTEX_LIST_LOOPBACK.
13217 */
13218 static void
replace_op_vertex_list_recursively(struct gl_context * ctx,struct gl_display_list * dlist)13219 replace_op_vertex_list_recursively(struct gl_context *ctx, struct gl_display_list *dlist)
13220 {
13221 Node *n = get_list_head(ctx, dlist);
13222 while (true) {
13223 const OpCode opcode = n[0].opcode;
13224 switch (opcode) {
13225 case OPCODE_VERTEX_LIST:
13226 case OPCODE_VERTEX_LIST_COPY_CURRENT:
13227 n[0].opcode = OPCODE_VERTEX_LIST_LOOPBACK;
13228 break;
13229 case OPCODE_CONTINUE:
13230 n = (Node *)get_pointer(&n[1]);
13231 continue;
13232 case OPCODE_CALL_LIST:
13233 replace_op_vertex_list_recursively(ctx, _mesa_lookup_list(ctx, (int)n[1].ui, true));
13234 break;
13235 case OPCODE_CALL_LISTS: {
13236 GLbyte *bptr;
13237 GLubyte *ubptr;
13238 GLshort *sptr;
13239 GLushort *usptr;
13240 GLint *iptr;
13241 GLuint *uiptr;
13242 GLfloat *fptr;
13243 switch(n[2].e) {
13244 case GL_BYTE:
13245 bptr = (GLbyte *) get_pointer(&n[3]);
13246 for (unsigned i = 0; i < n[1].i; i++)
13247 replace_op_vertex_list_recursively(ctx, _mesa_lookup_list(ctx, (int)bptr[i], true));
13248 break;
13249 case GL_UNSIGNED_BYTE:
13250 ubptr = (GLubyte *) get_pointer(&n[3]);
13251 for (unsigned i = 0; i < n[1].i; i++)
13252 replace_op_vertex_list_recursively(ctx, _mesa_lookup_list(ctx, (int)ubptr[i], true));
13253 break;
13254 case GL_SHORT:
13255 sptr = (GLshort *) get_pointer(&n[3]);
13256 for (unsigned i = 0; i < n[1].i; i++)
13257 replace_op_vertex_list_recursively(ctx, _mesa_lookup_list(ctx, (int)sptr[i], true));
13258 break;
13259 case GL_UNSIGNED_SHORT:
13260 usptr = (GLushort *) get_pointer(&n[3]);
13261 for (unsigned i = 0; i < n[1].i; i++)
13262 replace_op_vertex_list_recursively(ctx, _mesa_lookup_list(ctx, (int)usptr[i], true));
13263 break;
13264 case GL_INT:
13265 iptr = (GLint *) get_pointer(&n[3]);
13266 for (unsigned i = 0; i < n[1].i; i++)
13267 replace_op_vertex_list_recursively(ctx, _mesa_lookup_list(ctx, (int)iptr[i], true));
13268 break;
13269 case GL_UNSIGNED_INT:
13270 uiptr = (GLuint *) get_pointer(&n[3]);
13271 for (unsigned i = 0; i < n[1].i; i++)
13272 replace_op_vertex_list_recursively(ctx, _mesa_lookup_list(ctx, (int)uiptr[i], true));
13273 break;
13274 case GL_FLOAT:
13275 fptr = (GLfloat *) get_pointer(&n[3]);
13276 for (unsigned i = 0; i < n[1].i; i++)
13277 replace_op_vertex_list_recursively(ctx, _mesa_lookup_list(ctx, (int)fptr[i], true));
13278 break;
13279 case GL_2_BYTES:
13280 ubptr = (GLubyte *) get_pointer(&n[3]);
13281 for (unsigned i = 0; i < n[1].i; i++) {
13282 replace_op_vertex_list_recursively(ctx,
13283 _mesa_lookup_list(ctx, (int)ubptr[2 * i] * 256 +
13284 (int)ubptr[2 * i + 1], true));
13285 }
13286 break;
13287 case GL_3_BYTES:
13288 ubptr = (GLubyte *) get_pointer(&n[3]);
13289 for (unsigned i = 0; i < n[1].i; i++) {
13290 replace_op_vertex_list_recursively(ctx,
13291 _mesa_lookup_list(ctx, (int)ubptr[3 * i] * 65536 +
13292 (int)ubptr[3 * i + 1] * 256 +
13293 (int)ubptr[3 * i + 2], true));
13294 }
13295 break;
13296 case GL_4_BYTES:
13297 ubptr = (GLubyte *) get_pointer(&n[3]);
13298 for (unsigned i = 0; i < n[1].i; i++) {
13299 replace_op_vertex_list_recursively(ctx,
13300 _mesa_lookup_list(ctx, (int)ubptr[4 * i] * 16777216 +
13301 (int)ubptr[4 * i + 1] * 65536 +
13302 (int)ubptr[4 * i + 2] * 256 +
13303 (int)ubptr[4 * i + 3], true));
13304 }
13305 break;
13306 }
13307 break;
13308 }
13309 case OPCODE_END_OF_LIST:
13310 return;
13311 default:
13312 break;
13313 }
13314 n += n[0].InstSize;
13315 }
13316 }
13317
13318
13319 /**
13320 * End definition of current display list.
13321 */
13322 void GLAPIENTRY
_mesa_EndList(void)13323 _mesa_EndList(void)
13324 {
13325 GET_CURRENT_CONTEXT(ctx);
13326 SAVE_FLUSH_VERTICES(ctx);
13327 FLUSH_VERTICES(ctx, 0, 0);
13328
13329 if (MESA_VERBOSE & VERBOSE_API)
13330 _mesa_debug(ctx, "glEndList\n");
13331
13332 if (ctx->ExecuteFlag && _mesa_inside_dlist_begin_end(ctx)) {
13333 _mesa_error(ctx, GL_INVALID_OPERATION,
13334 "glEndList() called inside glBegin/End");
13335 }
13336
13337 /* Check that a list is under construction */
13338 if (!ctx->ListState.CurrentList) {
13339 _mesa_error(ctx, GL_INVALID_OPERATION, "glEndList");
13340 return;
13341 }
13342
13343 /* Call before emitting END_OF_LIST, in case the driver wants to
13344 * emit opcodes itself.
13345 */
13346 vbo_save_EndList(ctx);
13347
13348 (void) alloc_instruction(ctx, OPCODE_END_OF_LIST, 0);
13349
13350 _mesa_HashLockMutex(&ctx->Shared->DisplayList);
13351
13352 if (ctx->ListState.Current.UseLoopback)
13353 replace_op_vertex_list_recursively(ctx, ctx->ListState.CurrentList);
13354
13355 struct gl_dlist_state *list = &ctx->ListState;
13356 list->CurrentList->execute_glthread =
13357 _mesa_glthread_should_execute_list(ctx, list->CurrentList);
13358 ctx->Shared->DisplayListsAffectGLThread |= list->CurrentList->execute_glthread;
13359
13360 if ((list->CurrentList->Head == list->CurrentBlock) &&
13361 (list->CurrentPos < BLOCK_SIZE)) {
13362 /* This list has a low number of commands. Instead of storing them in a malloc-ed block
13363 * of memory (list->CurrentBlock), we store them in ctx->Shared->small_dlist_store.ptr.
13364 * This reduces cache misses in execute_list on successive lists since their commands
13365 * are now stored in the same array instead of being scattered in memory.
13366 */
13367 list->CurrentList->small_list = true;
13368 unsigned start;
13369
13370 if (ctx->Shared->small_dlist_store.size == 0) {
13371 util_idalloc_init(&ctx->Shared->small_dlist_store.free_idx, MAX2(1, list->CurrentPos));
13372 }
13373
13374 start = util_idalloc_alloc_range(&ctx->Shared->small_dlist_store.free_idx, list->CurrentPos);
13375
13376 if ((start + list->CurrentPos) > ctx->Shared->small_dlist_store.size) {
13377 ctx->Shared->small_dlist_store.size =
13378 ctx->Shared->small_dlist_store.free_idx.num_elements * 32;
13379 ctx->Shared->small_dlist_store.ptr = realloc(
13380 ctx->Shared->small_dlist_store.ptr,
13381 ctx->Shared->small_dlist_store.size * sizeof(Node));
13382 }
13383 list->CurrentList->start = start;
13384 list->CurrentList->count = list->CurrentPos;
13385
13386 memcpy(&ctx->Shared->small_dlist_store.ptr[start],
13387 list->CurrentBlock,
13388 list->CurrentList->count * sizeof(Node));
13389
13390 assert (ctx->Shared->small_dlist_store.ptr[start + list->CurrentList->count - 1].opcode == OPCODE_END_OF_LIST);
13391
13392 free(list->CurrentBlock);
13393 } else {
13394 /* Keep the mallocated storage */
13395 list->CurrentList->small_list = false;
13396 }
13397
13398 /* Destroy old list, if any */
13399 destroy_list(ctx, ctx->ListState.CurrentList->Name);
13400
13401 /* Install the new list */
13402 _mesa_HashInsertLocked(&ctx->Shared->DisplayList,
13403 ctx->ListState.CurrentList->Name,
13404 ctx->ListState.CurrentList);
13405
13406 if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
13407 mesa_print_display_list(ctx->ListState.CurrentList->Name);
13408
13409 _mesa_HashUnlockMutex(&ctx->Shared->DisplayList);
13410
13411 ctx->ListState.CurrentList = NULL;
13412 ctx->ListState.CurrentBlock = NULL;
13413 ctx->ListState.CurrentPos = 0;
13414 ctx->ListState.LastInstSize = 0;
13415 ctx->ExecuteFlag = GL_TRUE;
13416 ctx->CompileFlag = GL_FALSE;
13417
13418 ctx->Dispatch.Current = ctx->Dispatch.Exec;
13419 _glapi_set_dispatch(ctx->Dispatch.Current);
13420 if (!ctx->GLThread.enabled) {
13421 ctx->GLApi = ctx->Dispatch.Current;
13422 }
13423 }
13424
13425
13426 void GLAPIENTRY
_mesa_CallList(GLuint list)13427 _mesa_CallList(GLuint list)
13428 {
13429 GLboolean save_compile_flag;
13430 GET_CURRENT_CONTEXT(ctx);
13431 FLUSH_CURRENT(ctx, 0);
13432
13433 if (MESA_VERBOSE & VERBOSE_API)
13434 _mesa_debug(ctx, "glCallList %d\n", list);
13435
13436 if (list == 0) {
13437 _mesa_error(ctx, GL_INVALID_VALUE, "glCallList(list==0)");
13438 return;
13439 }
13440
13441 if (0)
13442 mesa_print_display_list( list );
13443
13444 /* Save the CompileFlag status, turn it off, execute the display list,
13445 * and restore the CompileFlag. This is needed for GL_COMPILE_AND_EXECUTE
13446 * because the call is already recorded and we just need to execute it.
13447 */
13448 save_compile_flag = ctx->CompileFlag;
13449 if (save_compile_flag) {
13450 ctx->CompileFlag = GL_FALSE;
13451 }
13452
13453 _mesa_HashLockMutex(&ctx->Shared->DisplayList);
13454 execute_list(ctx, list);
13455 _mesa_HashUnlockMutex(&ctx->Shared->DisplayList);
13456 ctx->CompileFlag = save_compile_flag;
13457
13458 /* also restore API function pointers to point to "save" versions */
13459 if (save_compile_flag) {
13460 ctx->Dispatch.Current = ctx->Dispatch.Save;
13461 if (!ctx->GLThread.enabled) {
13462 ctx->GLApi = ctx->Dispatch.Current;
13463 }
13464 }
13465 }
13466
13467
13468 /**
13469 * Execute glCallLists: call multiple display lists.
13470 */
13471 void GLAPIENTRY
_mesa_CallLists(GLsizei n,GLenum type,const GLvoid * lists)13472 _mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists)
13473 {
13474 GET_CURRENT_CONTEXT(ctx);
13475 GLboolean save_compile_flag;
13476
13477 if (MESA_VERBOSE & VERBOSE_API)
13478 _mesa_debug(ctx, "glCallLists %d\n", n);
13479
13480 if (type < GL_BYTE || type > GL_4_BYTES) {
13481 _mesa_error(ctx, GL_INVALID_ENUM, "glCallLists(type)");
13482 return;
13483 }
13484
13485 if (n < 0) {
13486 _mesa_error(ctx, GL_INVALID_VALUE, "glCallLists(n < 0)");
13487 return;
13488 } else if (n == 0 || lists == NULL) {
13489 /* nothing to do */
13490 return;
13491 }
13492
13493 /* Save the CompileFlag status, turn it off, execute the display lists,
13494 * and restore the CompileFlag. This is needed for GL_COMPILE_AND_EXECUTE
13495 * because the call is already recorded and we just need to execute it.
13496 */
13497 save_compile_flag = ctx->CompileFlag;
13498 ctx->CompileFlag = GL_FALSE;
13499
13500 GLbyte *bptr;
13501 GLubyte *ubptr;
13502 GLshort *sptr;
13503 GLushort *usptr;
13504 GLint *iptr;
13505 GLuint *uiptr;
13506 GLfloat *fptr;
13507
13508 GLuint base = ctx->List.ListBase;
13509
13510 _mesa_HashLockMutex(&ctx->Shared->DisplayList);
13511
13512 /* A loop inside a switch is faster than a switch inside a loop. */
13513 switch (type) {
13514 case GL_BYTE:
13515 bptr = (GLbyte *) lists;
13516 for (unsigned i = 0; i < n; i++)
13517 execute_list(ctx, base + (int)bptr[i]);
13518 break;
13519 case GL_UNSIGNED_BYTE:
13520 ubptr = (GLubyte *) lists;
13521 for (unsigned i = 0; i < n; i++)
13522 execute_list(ctx, base + (int)ubptr[i]);
13523 break;
13524 case GL_SHORT:
13525 sptr = (GLshort *) lists;
13526 for (unsigned i = 0; i < n; i++)
13527 execute_list(ctx, base + (int)sptr[i]);
13528 break;
13529 case GL_UNSIGNED_SHORT:
13530 usptr = (GLushort *) lists;
13531 for (unsigned i = 0; i < n; i++)
13532 execute_list(ctx, base + (int)usptr[i]);
13533 break;
13534 case GL_INT:
13535 iptr = (GLint *) lists;
13536 for (unsigned i = 0; i < n; i++)
13537 execute_list(ctx, base + (int)iptr[i]);
13538 break;
13539 case GL_UNSIGNED_INT:
13540 uiptr = (GLuint *) lists;
13541 for (unsigned i = 0; i < n; i++)
13542 execute_list(ctx, base + (int)uiptr[i]);
13543 break;
13544 case GL_FLOAT:
13545 fptr = (GLfloat *) lists;
13546 for (unsigned i = 0; i < n; i++)
13547 execute_list(ctx, base + (int)fptr[i]);
13548 break;
13549 case GL_2_BYTES:
13550 ubptr = (GLubyte *) lists;
13551 for (unsigned i = 0; i < n; i++) {
13552 execute_list(ctx, base +
13553 (int)ubptr[2 * i] * 256 +
13554 (int)ubptr[2 * i + 1]);
13555 }
13556 break;
13557 case GL_3_BYTES:
13558 ubptr = (GLubyte *) lists;
13559 for (unsigned i = 0; i < n; i++) {
13560 execute_list(ctx, base +
13561 (int)ubptr[3 * i] * 65536 +
13562 (int)ubptr[3 * i + 1] * 256 +
13563 (int)ubptr[3 * i + 2]);
13564 }
13565 break;
13566 case GL_4_BYTES:
13567 ubptr = (GLubyte *) lists;
13568 for (unsigned i = 0; i < n; i++) {
13569 execute_list(ctx, base +
13570 (int)ubptr[4 * i] * 16777216 +
13571 (int)ubptr[4 * i + 1] * 65536 +
13572 (int)ubptr[4 * i + 2] * 256 +
13573 (int)ubptr[4 * i + 3]);
13574 }
13575 break;
13576 }
13577
13578 _mesa_HashUnlockMutex(&ctx->Shared->DisplayList);
13579 ctx->CompileFlag = save_compile_flag;
13580
13581 /* also restore API function pointers to point to "save" versions */
13582 if (save_compile_flag) {
13583 ctx->Dispatch.Current = ctx->Dispatch.Save;
13584 if (!ctx->GLThread.enabled) {
13585 ctx->GLApi = ctx->Dispatch.Current;
13586 }
13587 }
13588 }
13589
13590
13591 /**
13592 * Set the offset added to list numbers in glCallLists.
13593 */
13594 void GLAPIENTRY
_mesa_ListBase(GLuint base)13595 _mesa_ListBase(GLuint base)
13596 {
13597 GET_CURRENT_CONTEXT(ctx);
13598 FLUSH_VERTICES(ctx, 0, GL_LIST_BIT); /* must be called before assert */
13599 ASSERT_OUTSIDE_BEGIN_END(ctx);
13600 ctx->List.ListBase = base;
13601 }
13602
13603 /**
13604 * Setup the given dispatch table to point to Mesa's display list
13605 * building functions.
13606 */
13607 void
_mesa_init_dispatch_save(const struct gl_context * ctx)13608 _mesa_init_dispatch_save(const struct gl_context *ctx)
13609 {
13610 struct _glapi_table *table = ctx->Dispatch.Save;
13611 int numEntries = MAX2(_gloffset_COUNT, _glapi_get_dispatch_table_size());
13612
13613 /* Initially populate the dispatch table with the contents of the
13614 * normal-execution dispatch table. This lets us skip populating functions
13615 * that should be called directly instead of compiled into display lists.
13616 */
13617 memcpy(table, ctx->Dispatch.OutsideBeginEnd,
13618 numEntries * sizeof(_glapi_proc));
13619
13620 #include "api_save_init.h"
13621 }
13622
13623
13624
13625 static const char *
enum_string(GLenum k)13626 enum_string(GLenum k)
13627 {
13628 return _mesa_enum_to_string(k);
13629 }
13630
13631
13632 /**
13633 * Print the commands in a display list. For debugging only.
13634 * TODO: many commands aren't handled yet.
13635 * \param fname filename to write display list to. If null, use stdout.
13636 */
13637 static void
print_list(struct gl_context * ctx,GLuint list,const char * fname)13638 print_list(struct gl_context *ctx, GLuint list, const char *fname)
13639 {
13640 struct gl_display_list *dlist;
13641 Node *n;
13642 FILE *f = stdout;
13643
13644 if (fname) {
13645 f = fopen(fname, "w");
13646 if (!f)
13647 return;
13648 }
13649
13650 if (!_mesa_get_list(ctx, list, &dlist, true)) {
13651 fprintf(f, "%u is not a display list ID\n", list);
13652 fflush(f);
13653 if (fname)
13654 fclose(f);
13655 return;
13656 }
13657
13658 n = get_list_head(ctx, dlist);
13659
13660 fprintf(f, "START-LIST %u, address %p\n", list, (void *) n);
13661
13662 while (1) {
13663 const OpCode opcode = n[0].opcode;
13664
13665 switch (opcode) {
13666 case OPCODE_ACCUM:
13667 fprintf(f, "Accum %s %g\n", enum_string(n[1].e), n[2].f);
13668 break;
13669 case OPCODE_ACTIVE_TEXTURE:
13670 fprintf(f, "ActiveTexture(%s)\n", enum_string(n[1].e));
13671 break;
13672 case OPCODE_BITMAP:
13673 fprintf(f, "Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i,
13674 n[3].f, n[4].f, n[5].f, n[6].f,
13675 get_pointer(&n[7]));
13676 break;
13677 case OPCODE_BLEND_COLOR:
13678 fprintf(f, "BlendColor %f, %f, %f, %f\n",
13679 n[1].f, n[2].f, n[3].f, n[4].f);
13680 break;
13681 case OPCODE_BLEND_EQUATION:
13682 fprintf(f, "BlendEquation %s\n",
13683 enum_string(n[1].e));
13684 break;
13685 case OPCODE_BLEND_EQUATION_SEPARATE:
13686 fprintf(f, "BlendEquationSeparate %s, %s\n",
13687 enum_string(n[1].e),
13688 enum_string(n[2].e));
13689 break;
13690 case OPCODE_BLEND_FUNC_SEPARATE:
13691 fprintf(f, "BlendFuncSeparate %s, %s, %s, %s\n",
13692 enum_string(n[1].e),
13693 enum_string(n[2].e),
13694 enum_string(n[3].e),
13695 enum_string(n[4].e));
13696 break;
13697 case OPCODE_BLEND_EQUATION_I:
13698 fprintf(f, "BlendEquationi %u, %s\n",
13699 n[1].ui, enum_string(n[2].e));
13700 break;
13701 case OPCODE_BLEND_EQUATION_SEPARATE_I:
13702 fprintf(f, "BlendEquationSeparatei %u, %s, %s\n",
13703 n[1].ui, enum_string(n[2].e), enum_string(n[3].e));
13704 break;
13705 case OPCODE_BLEND_FUNC_I:
13706 fprintf(f, "BlendFunci %u, %s, %s\n",
13707 n[1].ui, enum_string(n[2].e), enum_string(n[3].e));
13708 break;
13709 case OPCODE_BLEND_FUNC_SEPARATE_I:
13710 fprintf(f, "BlendFuncSeparatei %u, %s, %s, %s, %s\n",
13711 n[1].ui,
13712 enum_string(n[2].e),
13713 enum_string(n[3].e),
13714 enum_string(n[4].e),
13715 enum_string(n[5].e));
13716 break;
13717 case OPCODE_CALL_LIST:
13718 fprintf(f, "CallList %d\n", (int) n[1].ui);
13719 break;
13720 case OPCODE_CALL_LISTS:
13721 fprintf(f, "CallLists %d, %s\n", n[1].i, enum_string(n[1].e));
13722 break;
13723 case OPCODE_DISABLE:
13724 fprintf(f, "Disable %s\n", enum_string(n[1].e));
13725 break;
13726 case OPCODE_ENABLE:
13727 fprintf(f, "Enable %s\n", enum_string(n[1].e));
13728 break;
13729 case OPCODE_FRUSTUM:
13730 fprintf(f, "Frustum %g %g %g %g %g %g\n",
13731 n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f);
13732 break;
13733 case OPCODE_LINE_STIPPLE:
13734 fprintf(f, "LineStipple %d %x\n", n[1].i, (int) n[2].us);
13735 break;
13736 case OPCODE_LINE_WIDTH:
13737 fprintf(f, "LineWidth %f\n", n[1].f);
13738 break;
13739 case OPCODE_LOAD_IDENTITY:
13740 fprintf(f, "LoadIdentity\n");
13741 break;
13742 case OPCODE_LOAD_MATRIX:
13743 fprintf(f, "LoadMatrix\n");
13744 fprintf(f, " %8f %8f %8f %8f\n",
13745 n[1].f, n[5].f, n[9].f, n[13].f);
13746 fprintf(f, " %8f %8f %8f %8f\n",
13747 n[2].f, n[6].f, n[10].f, n[14].f);
13748 fprintf(f, " %8f %8f %8f %8f\n",
13749 n[3].f, n[7].f, n[11].f, n[15].f);
13750 fprintf(f, " %8f %8f %8f %8f\n",
13751 n[4].f, n[8].f, n[12].f, n[16].f);
13752 break;
13753 case OPCODE_MULT_MATRIX:
13754 fprintf(f, "MultMatrix (or Rotate)\n");
13755 fprintf(f, " %8f %8f %8f %8f\n",
13756 n[1].f, n[5].f, n[9].f, n[13].f);
13757 fprintf(f, " %8f %8f %8f %8f\n",
13758 n[2].f, n[6].f, n[10].f, n[14].f);
13759 fprintf(f, " %8f %8f %8f %8f\n",
13760 n[3].f, n[7].f, n[11].f, n[15].f);
13761 fprintf(f, " %8f %8f %8f %8f\n",
13762 n[4].f, n[8].f, n[12].f, n[16].f);
13763 break;
13764 case OPCODE_ORTHO:
13765 fprintf(f, "Ortho %g %g %g %g %g %g\n",
13766 n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f);
13767 break;
13768 case OPCODE_POINT_SIZE:
13769 fprintf(f, "PointSize %f\n", n[1].f);
13770 break;
13771 case OPCODE_POP_ATTRIB:
13772 fprintf(f, "PopAttrib\n");
13773 break;
13774 case OPCODE_POP_MATRIX:
13775 fprintf(f, "PopMatrix\n");
13776 break;
13777 case OPCODE_POP_NAME:
13778 fprintf(f, "PopName\n");
13779 break;
13780 case OPCODE_PUSH_ATTRIB:
13781 fprintf(f, "PushAttrib %x\n", n[1].bf);
13782 break;
13783 case OPCODE_PUSH_MATRIX:
13784 fprintf(f, "PushMatrix\n");
13785 break;
13786 case OPCODE_PUSH_NAME:
13787 fprintf(f, "PushName %d\n", (int) n[1].ui);
13788 break;
13789 case OPCODE_RASTER_POS:
13790 fprintf(f, "RasterPos %g %g %g %g\n",
13791 n[1].f, n[2].f, n[3].f, n[4].f);
13792 break;
13793 case OPCODE_ROTATE:
13794 fprintf(f, "Rotate %g %g %g %g\n",
13795 n[1].f, n[2].f, n[3].f, n[4].f);
13796 break;
13797 case OPCODE_SCALE:
13798 fprintf(f, "Scale %g %g %g\n", n[1].f, n[2].f, n[3].f);
13799 break;
13800 case OPCODE_TRANSLATE:
13801 fprintf(f, "Translate %g %g %g\n", n[1].f, n[2].f, n[3].f);
13802 break;
13803 case OPCODE_BIND_TEXTURE:
13804 fprintf(f, "BindTexture %s %d\n",
13805 _mesa_enum_to_string(n[1].ui), n[2].ui);
13806 break;
13807 case OPCODE_SHADE_MODEL:
13808 fprintf(f, "ShadeModel %s\n", _mesa_enum_to_string(n[1].ui));
13809 break;
13810 case OPCODE_MAP1:
13811 fprintf(f, "Map1 %s %.3f %.3f %d %d\n",
13812 _mesa_enum_to_string(n[1].ui),
13813 n[2].f, n[3].f, n[4].i, n[5].i);
13814 break;
13815 case OPCODE_MAP2:
13816 fprintf(f, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
13817 _mesa_enum_to_string(n[1].ui),
13818 n[2].f, n[3].f, n[4].f, n[5].f,
13819 n[6].i, n[7].i, n[8].i, n[9].i);
13820 break;
13821 case OPCODE_MAPGRID1:
13822 fprintf(f, "MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f);
13823 break;
13824 case OPCODE_MAPGRID2:
13825 fprintf(f, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
13826 n[1].i, n[2].f, n[3].f, n[4].i, n[5].f, n[6].f);
13827 break;
13828 case OPCODE_EVALMESH1:
13829 fprintf(f, "EvalMesh1 %d %d\n", n[1].i, n[2].i);
13830 break;
13831 case OPCODE_EVALMESH2:
13832 fprintf(f, "EvalMesh2 %d %d %d %d\n",
13833 n[1].i, n[2].i, n[3].i, n[4].i);
13834 break;
13835
13836 case OPCODE_ATTR_1F_NV:
13837 fprintf(f, "ATTR_1F_NV attr %d: %f\n", n[1].i, n[2].f);
13838 break;
13839 case OPCODE_ATTR_2F_NV:
13840 fprintf(f, "ATTR_2F_NV attr %d: %f %f\n",
13841 n[1].i, n[2].f, n[3].f);
13842 break;
13843 case OPCODE_ATTR_3F_NV:
13844 fprintf(f, "ATTR_3F_NV attr %d: %f %f %f\n",
13845 n[1].i, n[2].f, n[3].f, n[4].f);
13846 break;
13847 case OPCODE_ATTR_4F_NV:
13848 fprintf(f, "ATTR_4F_NV attr %d: %f %f %f %f\n",
13849 n[1].i, n[2].f, n[3].f, n[4].f, n[5].f);
13850 break;
13851 case OPCODE_ATTR_1F_ARB:
13852 fprintf(f, "ATTR_1F_ARB attr %d: %f\n", n[1].i, n[2].f);
13853 break;
13854 case OPCODE_ATTR_2F_ARB:
13855 fprintf(f, "ATTR_2F_ARB attr %d: %f %f\n",
13856 n[1].i, n[2].f, n[3].f);
13857 break;
13858 case OPCODE_ATTR_3F_ARB:
13859 fprintf(f, "ATTR_3F_ARB attr %d: %f %f %f\n",
13860 n[1].i, n[2].f, n[3].f, n[4].f);
13861 break;
13862 case OPCODE_ATTR_4F_ARB:
13863 fprintf(f, "ATTR_4F_ARB attr %d: %f %f %f %f\n",
13864 n[1].i, n[2].f, n[3].f, n[4].f, n[5].f);
13865 break;
13866
13867 case OPCODE_MATERIAL:
13868 fprintf(f, "MATERIAL %x %x: %f %f %f %f\n",
13869 n[1].i, n[2].i, n[3].f, n[4].f, n[5].f, n[6].f);
13870 break;
13871 case OPCODE_BEGIN:
13872 fprintf(f, "BEGIN %x\n", n[1].i);
13873 break;
13874 case OPCODE_END:
13875 fprintf(f, "END\n");
13876 break;
13877 case OPCODE_EVAL_C1:
13878 fprintf(f, "EVAL_C1 %f\n", n[1].f);
13879 break;
13880 case OPCODE_EVAL_C2:
13881 fprintf(f, "EVAL_C2 %f %f\n", n[1].f, n[2].f);
13882 break;
13883 case OPCODE_EVAL_P1:
13884 fprintf(f, "EVAL_P1 %d\n", n[1].i);
13885 break;
13886 case OPCODE_EVAL_P2:
13887 fprintf(f, "EVAL_P2 %d %d\n", n[1].i, n[2].i);
13888 break;
13889
13890 case OPCODE_PROVOKING_VERTEX:
13891 fprintf(f, "ProvokingVertex %s\n",
13892 _mesa_enum_to_string(n[1].ui));
13893 break;
13894
13895 /*
13896 * meta opcodes/commands
13897 */
13898 case OPCODE_ERROR:
13899 fprintf(f, "Error: %s %s\n", enum_string(n[1].e),
13900 (const char *) get_pointer(&n[2]));
13901 break;
13902 case OPCODE_CONTINUE:
13903 fprintf(f, "DISPLAY-LIST-CONTINUE\n");
13904 n = (Node *) get_pointer(&n[1]);
13905 continue;
13906 case OPCODE_VERTEX_LIST:
13907 case OPCODE_VERTEX_LIST_LOOPBACK:
13908 case OPCODE_VERTEX_LIST_COPY_CURRENT:
13909 vbo_print_vertex_list(ctx, (struct vbo_save_vertex_list *) &n[0], opcode, f);
13910 break;
13911 default:
13912 if (opcode < 0 || opcode > OPCODE_END_OF_LIST) {
13913 printf
13914 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
13915 opcode, (void *) n);
13916 } else {
13917 fprintf(f, "command %d, %u operands\n", opcode,
13918 n[0].InstSize);
13919 break;
13920 }
13921 FALLTHROUGH;
13922 case OPCODE_END_OF_LIST:
13923 fprintf(f, "END-LIST %u\n", list);
13924 fflush(f);
13925 if (fname)
13926 fclose(f);
13927 return;
13928 }
13929
13930 /* increment n to point to next compiled command */
13931 assert(n[0].InstSize > 0);
13932 n += n[0].InstSize;
13933 }
13934 }
13935
13936
13937 void
_mesa_glthread_execute_list(struct gl_context * ctx,GLuint list)13938 _mesa_glthread_execute_list(struct gl_context *ctx, GLuint list)
13939 {
13940 struct gl_display_list *dlist;
13941
13942 if (list == 0 ||
13943 !_mesa_get_list(ctx, list, &dlist, true) ||
13944 !dlist->execute_glthread)
13945 return;
13946
13947 Node *n = get_list_head(ctx, dlist);
13948
13949 while (1) {
13950 const OpCode opcode = n[0].opcode;
13951
13952 switch (opcode) {
13953 case OPCODE_CALL_LIST:
13954 /* Generated by glCallList(), don't add ListBase */
13955 if (ctx->GLThread.ListCallDepth < MAX_LIST_NESTING) {
13956 ctx->GLThread.ListCallDepth++;
13957 _mesa_glthread_execute_list(ctx, n[1].ui);
13958 ctx->GLThread.ListCallDepth--;
13959 }
13960 break;
13961 case OPCODE_CALL_LISTS:
13962 if (ctx->GLThread.ListCallDepth < MAX_LIST_NESTING) {
13963 ctx->GLThread.ListCallDepth++;
13964 _mesa_glthread_CallLists(ctx, n[1].i, n[2].e, get_pointer(&n[3]));
13965 ctx->GLThread.ListCallDepth--;
13966 }
13967 break;
13968 case OPCODE_DISABLE:
13969 _mesa_glthread_Disable(ctx, n[1].e);
13970 break;
13971 case OPCODE_ENABLE:
13972 _mesa_glthread_Enable(ctx, n[1].e);
13973 break;
13974 case OPCODE_LIST_BASE:
13975 _mesa_glthread_ListBase(ctx, n[1].ui);
13976 break;
13977 case OPCODE_MATRIX_MODE:
13978 _mesa_glthread_MatrixMode(ctx, n[1].e);
13979 break;
13980 case OPCODE_POP_ATTRIB:
13981 _mesa_glthread_PopAttrib(ctx);
13982 break;
13983 case OPCODE_POP_MATRIX:
13984 _mesa_glthread_PopMatrix(ctx);
13985 break;
13986 case OPCODE_PUSH_ATTRIB:
13987 _mesa_glthread_PushAttrib(ctx, n[1].bf);
13988 break;
13989 case OPCODE_PUSH_MATRIX:
13990 _mesa_glthread_PushMatrix(ctx);
13991 break;
13992 case OPCODE_ACTIVE_TEXTURE: /* GL_ARB_multitexture */
13993 _mesa_glthread_ActiveTexture(ctx, n[1].e);
13994 break;
13995 case OPCODE_MATRIX_PUSH:
13996 _mesa_glthread_MatrixPushEXT(ctx, n[1].e);
13997 break;
13998 case OPCODE_MATRIX_POP:
13999 _mesa_glthread_MatrixPopEXT(ctx, n[1].e);
14000 break;
14001 case OPCODE_CONTINUE:
14002 n = (Node *)get_pointer(&n[1]);
14003 continue;
14004 case OPCODE_END_OF_LIST:
14005 ctx->GLThread.ListCallDepth--;
14006 return;
14007 default:
14008 /* ignore */
14009 break;
14010 }
14011
14012 /* increment n to point to next compiled command */
14013 assert(n[0].InstSize > 0);
14014 n += n[0].InstSize;
14015 }
14016 }
14017
14018 static bool
_mesa_glthread_should_execute_list(struct gl_context * ctx,struct gl_display_list * dlist)14019 _mesa_glthread_should_execute_list(struct gl_context *ctx,
14020 struct gl_display_list *dlist)
14021 {
14022 Node *n = get_list_head(ctx, dlist);
14023
14024 while (1) {
14025 const OpCode opcode = n[0].opcode;
14026
14027 switch (opcode) {
14028 case OPCODE_CALL_LIST:
14029 case OPCODE_CALL_LISTS:
14030 case OPCODE_DISABLE:
14031 case OPCODE_ENABLE:
14032 case OPCODE_LIST_BASE:
14033 case OPCODE_MATRIX_MODE:
14034 case OPCODE_POP_ATTRIB:
14035 case OPCODE_POP_MATRIX:
14036 case OPCODE_PUSH_ATTRIB:
14037 case OPCODE_PUSH_MATRIX:
14038 case OPCODE_ACTIVE_TEXTURE: /* GL_ARB_multitexture */
14039 case OPCODE_MATRIX_PUSH:
14040 case OPCODE_MATRIX_POP:
14041 return true;
14042 case OPCODE_CONTINUE:
14043 n = (Node *)get_pointer(&n[1]);
14044 continue;
14045 case OPCODE_END_OF_LIST:
14046 return false;
14047 default:
14048 /* ignore */
14049 break;
14050 }
14051
14052 /* increment n to point to next compiled command */
14053 assert(n[0].InstSize > 0);
14054 n += n[0].InstSize;
14055 }
14056 return false;
14057 }
14058
14059
14060 /**
14061 * Clients may call this function to help debug display list problems.
14062 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
14063 * changed, or break in the future without notice.
14064 */
14065 void
mesa_print_display_list(GLuint list)14066 mesa_print_display_list(GLuint list)
14067 {
14068 GET_CURRENT_CONTEXT(ctx);
14069 print_list(ctx, list, NULL);
14070 }
14071
14072
14073 /**********************************************************************/
14074 /***** Initialization *****/
14075 /**********************************************************************/
14076
14077 /**
14078 * Initialize display list state for given context.
14079 */
14080 void
_mesa_init_display_list(struct gl_context * ctx)14081 _mesa_init_display_list(struct gl_context *ctx)
14082 {
14083 /* Display list */
14084 ctx->ListState.CallDepth = 1;
14085 ctx->ExecuteFlag = GL_TRUE;
14086 ctx->CompileFlag = GL_FALSE;
14087 ctx->ListState.CurrentBlock = NULL;
14088 ctx->ListState.CurrentPos = 0;
14089 ctx->ListState.LastInstSize = 0;
14090
14091 /* Display List group */
14092 ctx->List.ListBase = 0;
14093 }
14094
14095
14096 void
_mesa_init_dispatch_save_begin_end(struct gl_context * ctx)14097 _mesa_init_dispatch_save_begin_end(struct gl_context *ctx)
14098 {
14099 struct _glapi_table *tab = ctx->Dispatch.Save;
14100 assert(_mesa_is_desktop_gl_compat(ctx));
14101
14102 #define NAME_AE(x) _mesa_##x
14103 #define NAME_CALLLIST(x) save_##x
14104 #define NAME(x) save_##x
14105 #define NAME_ES(x) save_##x
14106
14107 #include "api_beginend_init.h"
14108 }
14109