1/* DO NOT EDIT - This file generated automatically by gl_marshal.py script */
2
3/*
4 * Copyright (C) 2012 Intel Corporation
5 * 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, sub license,
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 (including the next
15 * paragraph) shall be included in all copies or substantial portions of the
16 * Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
21 * INTEL CORPORATION,
22 * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
24 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
25 * SOFTWARE.
26 */
27
28
29#include "api_exec.h"
30#include "glthread_marshal.h"
31#include "bufferobj.h"
32#include "dispatch.h"
33
34#define COMPAT (ctx->API != API_OPENGL_CORE)
35
36UNUSED static inline int safe_mul(int a, int b)
37{
38    if (a < 0 || b < 0) return -1;
39    if (a == 0 || b == 0) return 0;
40    if (a > INT_MAX / b) return -1;
41    return a * b;
42}
43
44/* BufferPageCommitmentARB: marshalled asynchronously */
45struct marshal_cmd_BufferPageCommitmentARB
46{
47   struct marshal_cmd_base cmd_base;
48   GLboolean commit;
49   GLenum target;
50   GLintptr offset;
51   GLsizeiptr size;
52};
53uint32_t
54_mesa_unmarshal_BufferPageCommitmentARB(struct gl_context *ctx, const struct marshal_cmd_BufferPageCommitmentARB *cmd, const uint64_t *last)
55{
56   GLenum target = cmd->target;
57   GLintptr offset = cmd->offset;
58   GLsizeiptr size = cmd->size;
59   GLboolean commit = cmd->commit;
60   CALL_BufferPageCommitmentARB(ctx->CurrentServerDispatch, (target, offset, size, commit));
61   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BufferPageCommitmentARB), 8) / 8);
62   assert (cmd_size == cmd->cmd_base.cmd_size);
63   return cmd_size;
64}
65void GLAPIENTRY
66_mesa_marshal_BufferPageCommitmentARB(GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit)
67{
68   GET_CURRENT_CONTEXT(ctx);
69   int cmd_size = sizeof(struct marshal_cmd_BufferPageCommitmentARB);
70   struct marshal_cmd_BufferPageCommitmentARB *cmd;
71   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BufferPageCommitmentARB, cmd_size);
72   cmd->target = target;
73   cmd->offset = offset;
74   cmd->size = size;
75   cmd->commit = commit;
76}
77
78
79/* NamedBufferPageCommitmentEXT: marshalled asynchronously */
80struct marshal_cmd_NamedBufferPageCommitmentEXT
81{
82   struct marshal_cmd_base cmd_base;
83   GLboolean commit;
84   GLuint buffer;
85   GLintptr offset;
86   GLsizeiptr size;
87};
88uint32_t
89_mesa_unmarshal_NamedBufferPageCommitmentEXT(struct gl_context *ctx, const struct marshal_cmd_NamedBufferPageCommitmentEXT *cmd, const uint64_t *last)
90{
91   GLuint buffer = cmd->buffer;
92   GLintptr offset = cmd->offset;
93   GLsizeiptr size = cmd->size;
94   GLboolean commit = cmd->commit;
95   CALL_NamedBufferPageCommitmentEXT(ctx->CurrentServerDispatch, (buffer, offset, size, commit));
96   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedBufferPageCommitmentEXT), 8) / 8);
97   assert (cmd_size == cmd->cmd_base.cmd_size);
98   return cmd_size;
99}
100void GLAPIENTRY
101_mesa_marshal_NamedBufferPageCommitmentEXT(GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit)
102{
103   GET_CURRENT_CONTEXT(ctx);
104   int cmd_size = sizeof(struct marshal_cmd_NamedBufferPageCommitmentEXT);
105   struct marshal_cmd_NamedBufferPageCommitmentEXT *cmd;
106   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedBufferPageCommitmentEXT, cmd_size);
107   cmd->buffer = buffer;
108   cmd->offset = offset;
109   cmd->size = size;
110   cmd->commit = commit;
111}
112
113
114/* NamedBufferPageCommitmentARB: marshalled asynchronously */
115struct marshal_cmd_NamedBufferPageCommitmentARB
116{
117   struct marshal_cmd_base cmd_base;
118   GLboolean commit;
119   GLuint buffer;
120   GLintptr offset;
121   GLsizeiptr size;
122};
123uint32_t
124_mesa_unmarshal_NamedBufferPageCommitmentARB(struct gl_context *ctx, const struct marshal_cmd_NamedBufferPageCommitmentARB *cmd, const uint64_t *last)
125{
126   GLuint buffer = cmd->buffer;
127   GLintptr offset = cmd->offset;
128   GLsizeiptr size = cmd->size;
129   GLboolean commit = cmd->commit;
130   CALL_NamedBufferPageCommitmentARB(ctx->CurrentServerDispatch, (buffer, offset, size, commit));
131   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedBufferPageCommitmentARB), 8) / 8);
132   assert (cmd_size == cmd->cmd_base.cmd_size);
133   return cmd_size;
134}
135void GLAPIENTRY
136_mesa_marshal_NamedBufferPageCommitmentARB(GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit)
137{
138   GET_CURRENT_CONTEXT(ctx);
139   int cmd_size = sizeof(struct marshal_cmd_NamedBufferPageCommitmentARB);
140   struct marshal_cmd_NamedBufferPageCommitmentARB *cmd;
141   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedBufferPageCommitmentARB, cmd_size);
142   cmd->buffer = buffer;
143   cmd->offset = offset;
144   cmd->size = size;
145   cmd->commit = commit;
146}
147
148
149/* PrimitiveBoundingBox: marshalled asynchronously */
150struct marshal_cmd_PrimitiveBoundingBox
151{
152   struct marshal_cmd_base cmd_base;
153   GLfloat minX;
154   GLfloat minY;
155   GLfloat minZ;
156   GLfloat minW;
157   GLfloat maxX;
158   GLfloat maxY;
159   GLfloat maxZ;
160   GLfloat maxW;
161};
162uint32_t
163_mesa_unmarshal_PrimitiveBoundingBox(struct gl_context *ctx, const struct marshal_cmd_PrimitiveBoundingBox *cmd, const uint64_t *last)
164{
165   GLfloat minX = cmd->minX;
166   GLfloat minY = cmd->minY;
167   GLfloat minZ = cmd->minZ;
168   GLfloat minW = cmd->minW;
169   GLfloat maxX = cmd->maxX;
170   GLfloat maxY = cmd->maxY;
171   GLfloat maxZ = cmd->maxZ;
172   GLfloat maxW = cmd->maxW;
173   CALL_PrimitiveBoundingBox(ctx->CurrentServerDispatch, (minX, minY, minZ, minW, maxX, maxY, maxZ, maxW));
174   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PrimitiveBoundingBox), 8) / 8);
175   assert (cmd_size == cmd->cmd_base.cmd_size);
176   return cmd_size;
177}
178void GLAPIENTRY
179_mesa_marshal_PrimitiveBoundingBox(GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW)
180{
181   GET_CURRENT_CONTEXT(ctx);
182   int cmd_size = sizeof(struct marshal_cmd_PrimitiveBoundingBox);
183   struct marshal_cmd_PrimitiveBoundingBox *cmd;
184   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PrimitiveBoundingBox, cmd_size);
185   cmd->minX = minX;
186   cmd->minY = minY;
187   cmd->minZ = minZ;
188   cmd->minW = minW;
189   cmd->maxX = maxX;
190   cmd->maxY = maxY;
191   cmd->maxZ = maxZ;
192   cmd->maxW = maxW;
193}
194
195
196/* BlendBarrier: marshalled asynchronously */
197struct marshal_cmd_BlendBarrier
198{
199   struct marshal_cmd_base cmd_base;
200};
201uint32_t
202_mesa_unmarshal_BlendBarrier(struct gl_context *ctx, const struct marshal_cmd_BlendBarrier *cmd, const uint64_t *last)
203{
204   CALL_BlendBarrier(ctx->CurrentServerDispatch, ());
205   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BlendBarrier), 8) / 8);
206   assert (cmd_size == cmd->cmd_base.cmd_size);
207   return cmd_size;
208}
209void GLAPIENTRY
210_mesa_marshal_BlendBarrier(void)
211{
212   GET_CURRENT_CONTEXT(ctx);
213   int cmd_size = sizeof(struct marshal_cmd_BlendBarrier);
214   struct marshal_cmd_BlendBarrier *cmd;
215   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendBarrier, cmd_size);
216   (void) cmd;
217}
218
219
220/* Uniform1i64ARB: marshalled asynchronously */
221struct marshal_cmd_Uniform1i64ARB
222{
223   struct marshal_cmd_base cmd_base;
224   GLint location;
225   GLint64 x;
226};
227uint32_t
228_mesa_unmarshal_Uniform1i64ARB(struct gl_context *ctx, const struct marshal_cmd_Uniform1i64ARB *cmd, const uint64_t *last)
229{
230   GLint location = cmd->location;
231   GLint64 x = cmd->x;
232   CALL_Uniform1i64ARB(ctx->CurrentServerDispatch, (location, x));
233   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform1i64ARB), 8) / 8);
234   assert (cmd_size == cmd->cmd_base.cmd_size);
235   return cmd_size;
236}
237void GLAPIENTRY
238_mesa_marshal_Uniform1i64ARB(GLint location, GLint64 x)
239{
240   GET_CURRENT_CONTEXT(ctx);
241   int cmd_size = sizeof(struct marshal_cmd_Uniform1i64ARB);
242   struct marshal_cmd_Uniform1i64ARB *cmd;
243   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1i64ARB, cmd_size);
244   cmd->location = location;
245   cmd->x = x;
246}
247
248
249/* Uniform2i64ARB: marshalled asynchronously */
250struct marshal_cmd_Uniform2i64ARB
251{
252   struct marshal_cmd_base cmd_base;
253   GLint location;
254   GLint64 x;
255   GLint64 y;
256};
257uint32_t
258_mesa_unmarshal_Uniform2i64ARB(struct gl_context *ctx, const struct marshal_cmd_Uniform2i64ARB *cmd, const uint64_t *last)
259{
260   GLint location = cmd->location;
261   GLint64 x = cmd->x;
262   GLint64 y = cmd->y;
263   CALL_Uniform2i64ARB(ctx->CurrentServerDispatch, (location, x, y));
264   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform2i64ARB), 8) / 8);
265   assert (cmd_size == cmd->cmd_base.cmd_size);
266   return cmd_size;
267}
268void GLAPIENTRY
269_mesa_marshal_Uniform2i64ARB(GLint location, GLint64 x, GLint64 y)
270{
271   GET_CURRENT_CONTEXT(ctx);
272   int cmd_size = sizeof(struct marshal_cmd_Uniform2i64ARB);
273   struct marshal_cmd_Uniform2i64ARB *cmd;
274   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2i64ARB, cmd_size);
275   cmd->location = location;
276   cmd->x = x;
277   cmd->y = y;
278}
279
280
281/* Uniform3i64ARB: marshalled asynchronously */
282struct marshal_cmd_Uniform3i64ARB
283{
284   struct marshal_cmd_base cmd_base;
285   GLint location;
286   GLint64 x;
287   GLint64 y;
288   GLint64 z;
289};
290uint32_t
291_mesa_unmarshal_Uniform3i64ARB(struct gl_context *ctx, const struct marshal_cmd_Uniform3i64ARB *cmd, const uint64_t *last)
292{
293   GLint location = cmd->location;
294   GLint64 x = cmd->x;
295   GLint64 y = cmd->y;
296   GLint64 z = cmd->z;
297   CALL_Uniform3i64ARB(ctx->CurrentServerDispatch, (location, x, y, z));
298   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform3i64ARB), 8) / 8);
299   assert (cmd_size == cmd->cmd_base.cmd_size);
300   return cmd_size;
301}
302void GLAPIENTRY
303_mesa_marshal_Uniform3i64ARB(GLint location, GLint64 x, GLint64 y, GLint64 z)
304{
305   GET_CURRENT_CONTEXT(ctx);
306   int cmd_size = sizeof(struct marshal_cmd_Uniform3i64ARB);
307   struct marshal_cmd_Uniform3i64ARB *cmd;
308   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3i64ARB, cmd_size);
309   cmd->location = location;
310   cmd->x = x;
311   cmd->y = y;
312   cmd->z = z;
313}
314
315
316/* Uniform4i64ARB: marshalled asynchronously */
317struct marshal_cmd_Uniform4i64ARB
318{
319   struct marshal_cmd_base cmd_base;
320   GLint location;
321   GLint64 x;
322   GLint64 y;
323   GLint64 z;
324   GLint64 w;
325};
326uint32_t
327_mesa_unmarshal_Uniform4i64ARB(struct gl_context *ctx, const struct marshal_cmd_Uniform4i64ARB *cmd, const uint64_t *last)
328{
329   GLint location = cmd->location;
330   GLint64 x = cmd->x;
331   GLint64 y = cmd->y;
332   GLint64 z = cmd->z;
333   GLint64 w = cmd->w;
334   CALL_Uniform4i64ARB(ctx->CurrentServerDispatch, (location, x, y, z, w));
335   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform4i64ARB), 8) / 8);
336   assert (cmd_size == cmd->cmd_base.cmd_size);
337   return cmd_size;
338}
339void GLAPIENTRY
340_mesa_marshal_Uniform4i64ARB(GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w)
341{
342   GET_CURRENT_CONTEXT(ctx);
343   int cmd_size = sizeof(struct marshal_cmd_Uniform4i64ARB);
344   struct marshal_cmd_Uniform4i64ARB *cmd;
345   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4i64ARB, cmd_size);
346   cmd->location = location;
347   cmd->x = x;
348   cmd->y = y;
349   cmd->z = z;
350   cmd->w = w;
351}
352
353
354/* Uniform1i64vARB: marshalled asynchronously */
355struct marshal_cmd_Uniform1i64vARB
356{
357   struct marshal_cmd_base cmd_base;
358   GLint location;
359   GLsizei count;
360   /* Next safe_mul(count, 1 * sizeof(GLint64)) bytes are GLint64 value[count] */
361};
362uint32_t
363_mesa_unmarshal_Uniform1i64vARB(struct gl_context *ctx, const struct marshal_cmd_Uniform1i64vARB *cmd, const uint64_t *last)
364{
365   GLint location = cmd->location;
366   GLsizei count = cmd->count;
367   GLint64 * value;
368   const char *variable_data = (const char *) (cmd + 1);
369   value = (GLint64 *) variable_data;
370   CALL_Uniform1i64vARB(ctx->CurrentServerDispatch, (location, count, value));
371   return cmd->cmd_base.cmd_size;
372}
373void GLAPIENTRY
374_mesa_marshal_Uniform1i64vARB(GLint location, GLsizei count, const GLint64 * value)
375{
376   GET_CURRENT_CONTEXT(ctx);
377   int value_size = safe_mul(count, 1 * sizeof(GLint64));
378   int cmd_size = sizeof(struct marshal_cmd_Uniform1i64vARB) + value_size;
379   struct marshal_cmd_Uniform1i64vARB *cmd;
380   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
381      _mesa_glthread_finish_before(ctx, "Uniform1i64vARB");
382      CALL_Uniform1i64vARB(ctx->CurrentServerDispatch, (location, count, value));
383      return;
384   }
385   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1i64vARB, cmd_size);
386   cmd->location = location;
387   cmd->count = count;
388   char *variable_data = (char *) (cmd + 1);
389   memcpy(variable_data, value, value_size);
390}
391
392
393/* Uniform2i64vARB: marshalled asynchronously */
394struct marshal_cmd_Uniform2i64vARB
395{
396   struct marshal_cmd_base cmd_base;
397   GLint location;
398   GLsizei count;
399   /* Next safe_mul(count, 2 * sizeof(GLint64)) bytes are GLint64 value[count][2] */
400};
401uint32_t
402_mesa_unmarshal_Uniform2i64vARB(struct gl_context *ctx, const struct marshal_cmd_Uniform2i64vARB *cmd, const uint64_t *last)
403{
404   GLint location = cmd->location;
405   GLsizei count = cmd->count;
406   GLint64 * value;
407   const char *variable_data = (const char *) (cmd + 1);
408   value = (GLint64 *) variable_data;
409   CALL_Uniform2i64vARB(ctx->CurrentServerDispatch, (location, count, value));
410   return cmd->cmd_base.cmd_size;
411}
412void GLAPIENTRY
413_mesa_marshal_Uniform2i64vARB(GLint location, GLsizei count, const GLint64 * value)
414{
415   GET_CURRENT_CONTEXT(ctx);
416   int value_size = safe_mul(count, 2 * sizeof(GLint64));
417   int cmd_size = sizeof(struct marshal_cmd_Uniform2i64vARB) + value_size;
418   struct marshal_cmd_Uniform2i64vARB *cmd;
419   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
420      _mesa_glthread_finish_before(ctx, "Uniform2i64vARB");
421      CALL_Uniform2i64vARB(ctx->CurrentServerDispatch, (location, count, value));
422      return;
423   }
424   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2i64vARB, cmd_size);
425   cmd->location = location;
426   cmd->count = count;
427   char *variable_data = (char *) (cmd + 1);
428   memcpy(variable_data, value, value_size);
429}
430
431
432/* Uniform3i64vARB: marshalled asynchronously */
433struct marshal_cmd_Uniform3i64vARB
434{
435   struct marshal_cmd_base cmd_base;
436   GLint location;
437   GLsizei count;
438   /* Next safe_mul(count, 3 * sizeof(GLint64)) bytes are GLint64 value[count][3] */
439};
440uint32_t
441_mesa_unmarshal_Uniform3i64vARB(struct gl_context *ctx, const struct marshal_cmd_Uniform3i64vARB *cmd, const uint64_t *last)
442{
443   GLint location = cmd->location;
444   GLsizei count = cmd->count;
445   GLint64 * value;
446   const char *variable_data = (const char *) (cmd + 1);
447   value = (GLint64 *) variable_data;
448   CALL_Uniform3i64vARB(ctx->CurrentServerDispatch, (location, count, value));
449   return cmd->cmd_base.cmd_size;
450}
451void GLAPIENTRY
452_mesa_marshal_Uniform3i64vARB(GLint location, GLsizei count, const GLint64 * value)
453{
454   GET_CURRENT_CONTEXT(ctx);
455   int value_size = safe_mul(count, 3 * sizeof(GLint64));
456   int cmd_size = sizeof(struct marshal_cmd_Uniform3i64vARB) + value_size;
457   struct marshal_cmd_Uniform3i64vARB *cmd;
458   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
459      _mesa_glthread_finish_before(ctx, "Uniform3i64vARB");
460      CALL_Uniform3i64vARB(ctx->CurrentServerDispatch, (location, count, value));
461      return;
462   }
463   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3i64vARB, cmd_size);
464   cmd->location = location;
465   cmd->count = count;
466   char *variable_data = (char *) (cmd + 1);
467   memcpy(variable_data, value, value_size);
468}
469
470
471/* Uniform4i64vARB: marshalled asynchronously */
472struct marshal_cmd_Uniform4i64vARB
473{
474   struct marshal_cmd_base cmd_base;
475   GLint location;
476   GLsizei count;
477   /* Next safe_mul(count, 4 * sizeof(GLint64)) bytes are GLint64 value[count][4] */
478};
479uint32_t
480_mesa_unmarshal_Uniform4i64vARB(struct gl_context *ctx, const struct marshal_cmd_Uniform4i64vARB *cmd, const uint64_t *last)
481{
482   GLint location = cmd->location;
483   GLsizei count = cmd->count;
484   GLint64 * value;
485   const char *variable_data = (const char *) (cmd + 1);
486   value = (GLint64 *) variable_data;
487   CALL_Uniform4i64vARB(ctx->CurrentServerDispatch, (location, count, value));
488   return cmd->cmd_base.cmd_size;
489}
490void GLAPIENTRY
491_mesa_marshal_Uniform4i64vARB(GLint location, GLsizei count, const GLint64 * value)
492{
493   GET_CURRENT_CONTEXT(ctx);
494   int value_size = safe_mul(count, 4 * sizeof(GLint64));
495   int cmd_size = sizeof(struct marshal_cmd_Uniform4i64vARB) + value_size;
496   struct marshal_cmd_Uniform4i64vARB *cmd;
497   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
498      _mesa_glthread_finish_before(ctx, "Uniform4i64vARB");
499      CALL_Uniform4i64vARB(ctx->CurrentServerDispatch, (location, count, value));
500      return;
501   }
502   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4i64vARB, cmd_size);
503   cmd->location = location;
504   cmd->count = count;
505   char *variable_data = (char *) (cmd + 1);
506   memcpy(variable_data, value, value_size);
507}
508
509
510/* Uniform1ui64ARB: marshalled asynchronously */
511struct marshal_cmd_Uniform1ui64ARB
512{
513   struct marshal_cmd_base cmd_base;
514   GLint location;
515   GLuint64 x;
516};
517uint32_t
518_mesa_unmarshal_Uniform1ui64ARB(struct gl_context *ctx, const struct marshal_cmd_Uniform1ui64ARB *cmd, const uint64_t *last)
519{
520   GLint location = cmd->location;
521   GLuint64 x = cmd->x;
522   CALL_Uniform1ui64ARB(ctx->CurrentServerDispatch, (location, x));
523   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform1ui64ARB), 8) / 8);
524   assert (cmd_size == cmd->cmd_base.cmd_size);
525   return cmd_size;
526}
527void GLAPIENTRY
528_mesa_marshal_Uniform1ui64ARB(GLint location, GLuint64 x)
529{
530   GET_CURRENT_CONTEXT(ctx);
531   int cmd_size = sizeof(struct marshal_cmd_Uniform1ui64ARB);
532   struct marshal_cmd_Uniform1ui64ARB *cmd;
533   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1ui64ARB, cmd_size);
534   cmd->location = location;
535   cmd->x = x;
536}
537
538
539/* Uniform2ui64ARB: marshalled asynchronously */
540struct marshal_cmd_Uniform2ui64ARB
541{
542   struct marshal_cmd_base cmd_base;
543   GLint location;
544   GLuint64 x;
545   GLuint64 y;
546};
547uint32_t
548_mesa_unmarshal_Uniform2ui64ARB(struct gl_context *ctx, const struct marshal_cmd_Uniform2ui64ARB *cmd, const uint64_t *last)
549{
550   GLint location = cmd->location;
551   GLuint64 x = cmd->x;
552   GLuint64 y = cmd->y;
553   CALL_Uniform2ui64ARB(ctx->CurrentServerDispatch, (location, x, y));
554   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform2ui64ARB), 8) / 8);
555   assert (cmd_size == cmd->cmd_base.cmd_size);
556   return cmd_size;
557}
558void GLAPIENTRY
559_mesa_marshal_Uniform2ui64ARB(GLint location, GLuint64 x, GLuint64 y)
560{
561   GET_CURRENT_CONTEXT(ctx);
562   int cmd_size = sizeof(struct marshal_cmd_Uniform2ui64ARB);
563   struct marshal_cmd_Uniform2ui64ARB *cmd;
564   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2ui64ARB, cmd_size);
565   cmd->location = location;
566   cmd->x = x;
567   cmd->y = y;
568}
569
570
571/* Uniform3ui64ARB: marshalled asynchronously */
572struct marshal_cmd_Uniform3ui64ARB
573{
574   struct marshal_cmd_base cmd_base;
575   GLint location;
576   GLuint64 x;
577   GLuint64 y;
578   GLuint64 z;
579};
580uint32_t
581_mesa_unmarshal_Uniform3ui64ARB(struct gl_context *ctx, const struct marshal_cmd_Uniform3ui64ARB *cmd, const uint64_t *last)
582{
583   GLint location = cmd->location;
584   GLuint64 x = cmd->x;
585   GLuint64 y = cmd->y;
586   GLuint64 z = cmd->z;
587   CALL_Uniform3ui64ARB(ctx->CurrentServerDispatch, (location, x, y, z));
588   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform3ui64ARB), 8) / 8);
589   assert (cmd_size == cmd->cmd_base.cmd_size);
590   return cmd_size;
591}
592void GLAPIENTRY
593_mesa_marshal_Uniform3ui64ARB(GLint location, GLuint64 x, GLuint64 y, GLuint64 z)
594{
595   GET_CURRENT_CONTEXT(ctx);
596   int cmd_size = sizeof(struct marshal_cmd_Uniform3ui64ARB);
597   struct marshal_cmd_Uniform3ui64ARB *cmd;
598   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3ui64ARB, cmd_size);
599   cmd->location = location;
600   cmd->x = x;
601   cmd->y = y;
602   cmd->z = z;
603}
604
605
606/* Uniform4ui64ARB: marshalled asynchronously */
607struct marshal_cmd_Uniform4ui64ARB
608{
609   struct marshal_cmd_base cmd_base;
610   GLint location;
611   GLuint64 x;
612   GLuint64 y;
613   GLuint64 z;
614   GLuint64 w;
615};
616uint32_t
617_mesa_unmarshal_Uniform4ui64ARB(struct gl_context *ctx, const struct marshal_cmd_Uniform4ui64ARB *cmd, const uint64_t *last)
618{
619   GLint location = cmd->location;
620   GLuint64 x = cmd->x;
621   GLuint64 y = cmd->y;
622   GLuint64 z = cmd->z;
623   GLuint64 w = cmd->w;
624   CALL_Uniform4ui64ARB(ctx->CurrentServerDispatch, (location, x, y, z, w));
625   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform4ui64ARB), 8) / 8);
626   assert (cmd_size == cmd->cmd_base.cmd_size);
627   return cmd_size;
628}
629void GLAPIENTRY
630_mesa_marshal_Uniform4ui64ARB(GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w)
631{
632   GET_CURRENT_CONTEXT(ctx);
633   int cmd_size = sizeof(struct marshal_cmd_Uniform4ui64ARB);
634   struct marshal_cmd_Uniform4ui64ARB *cmd;
635   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4ui64ARB, cmd_size);
636   cmd->location = location;
637   cmd->x = x;
638   cmd->y = y;
639   cmd->z = z;
640   cmd->w = w;
641}
642
643
644/* Uniform1ui64vARB: marshalled asynchronously */
645struct marshal_cmd_Uniform1ui64vARB
646{
647   struct marshal_cmd_base cmd_base;
648   GLint location;
649   GLsizei count;
650   /* Next safe_mul(count, 1 * sizeof(GLuint64)) bytes are GLuint64 value[count] */
651};
652uint32_t
653_mesa_unmarshal_Uniform1ui64vARB(struct gl_context *ctx, const struct marshal_cmd_Uniform1ui64vARB *cmd, const uint64_t *last)
654{
655   GLint location = cmd->location;
656   GLsizei count = cmd->count;
657   GLuint64 * value;
658   const char *variable_data = (const char *) (cmd + 1);
659   value = (GLuint64 *) variable_data;
660   CALL_Uniform1ui64vARB(ctx->CurrentServerDispatch, (location, count, value));
661   return cmd->cmd_base.cmd_size;
662}
663void GLAPIENTRY
664_mesa_marshal_Uniform1ui64vARB(GLint location, GLsizei count, const GLuint64 * value)
665{
666   GET_CURRENT_CONTEXT(ctx);
667   int value_size = safe_mul(count, 1 * sizeof(GLuint64));
668   int cmd_size = sizeof(struct marshal_cmd_Uniform1ui64vARB) + value_size;
669   struct marshal_cmd_Uniform1ui64vARB *cmd;
670   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
671      _mesa_glthread_finish_before(ctx, "Uniform1ui64vARB");
672      CALL_Uniform1ui64vARB(ctx->CurrentServerDispatch, (location, count, value));
673      return;
674   }
675   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1ui64vARB, cmd_size);
676   cmd->location = location;
677   cmd->count = count;
678   char *variable_data = (char *) (cmd + 1);
679   memcpy(variable_data, value, value_size);
680}
681
682
683/* Uniform2ui64vARB: marshalled asynchronously */
684struct marshal_cmd_Uniform2ui64vARB
685{
686   struct marshal_cmd_base cmd_base;
687   GLint location;
688   GLsizei count;
689   /* Next safe_mul(count, 2 * sizeof(GLuint64)) bytes are GLuint64 value[count][2] */
690};
691uint32_t
692_mesa_unmarshal_Uniform2ui64vARB(struct gl_context *ctx, const struct marshal_cmd_Uniform2ui64vARB *cmd, const uint64_t *last)
693{
694   GLint location = cmd->location;
695   GLsizei count = cmd->count;
696   GLuint64 * value;
697   const char *variable_data = (const char *) (cmd + 1);
698   value = (GLuint64 *) variable_data;
699   CALL_Uniform2ui64vARB(ctx->CurrentServerDispatch, (location, count, value));
700   return cmd->cmd_base.cmd_size;
701}
702void GLAPIENTRY
703_mesa_marshal_Uniform2ui64vARB(GLint location, GLsizei count, const GLuint64 * value)
704{
705   GET_CURRENT_CONTEXT(ctx);
706   int value_size = safe_mul(count, 2 * sizeof(GLuint64));
707   int cmd_size = sizeof(struct marshal_cmd_Uniform2ui64vARB) + value_size;
708   struct marshal_cmd_Uniform2ui64vARB *cmd;
709   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
710      _mesa_glthread_finish_before(ctx, "Uniform2ui64vARB");
711      CALL_Uniform2ui64vARB(ctx->CurrentServerDispatch, (location, count, value));
712      return;
713   }
714   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2ui64vARB, cmd_size);
715   cmd->location = location;
716   cmd->count = count;
717   char *variable_data = (char *) (cmd + 1);
718   memcpy(variable_data, value, value_size);
719}
720
721
722/* Uniform3ui64vARB: marshalled asynchronously */
723struct marshal_cmd_Uniform3ui64vARB
724{
725   struct marshal_cmd_base cmd_base;
726   GLint location;
727   GLsizei count;
728   /* Next safe_mul(count, 3 * sizeof(GLuint64)) bytes are GLuint64 value[count][3] */
729};
730uint32_t
731_mesa_unmarshal_Uniform3ui64vARB(struct gl_context *ctx, const struct marshal_cmd_Uniform3ui64vARB *cmd, const uint64_t *last)
732{
733   GLint location = cmd->location;
734   GLsizei count = cmd->count;
735   GLuint64 * value;
736   const char *variable_data = (const char *) (cmd + 1);
737   value = (GLuint64 *) variable_data;
738   CALL_Uniform3ui64vARB(ctx->CurrentServerDispatch, (location, count, value));
739   return cmd->cmd_base.cmd_size;
740}
741void GLAPIENTRY
742_mesa_marshal_Uniform3ui64vARB(GLint location, GLsizei count, const GLuint64 * value)
743{
744   GET_CURRENT_CONTEXT(ctx);
745   int value_size = safe_mul(count, 3 * sizeof(GLuint64));
746   int cmd_size = sizeof(struct marshal_cmd_Uniform3ui64vARB) + value_size;
747   struct marshal_cmd_Uniform3ui64vARB *cmd;
748   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
749      _mesa_glthread_finish_before(ctx, "Uniform3ui64vARB");
750      CALL_Uniform3ui64vARB(ctx->CurrentServerDispatch, (location, count, value));
751      return;
752   }
753   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3ui64vARB, cmd_size);
754   cmd->location = location;
755   cmd->count = count;
756   char *variable_data = (char *) (cmd + 1);
757   memcpy(variable_data, value, value_size);
758}
759
760
761/* Uniform4ui64vARB: marshalled asynchronously */
762struct marshal_cmd_Uniform4ui64vARB
763{
764   struct marshal_cmd_base cmd_base;
765   GLint location;
766   GLsizei count;
767   /* Next safe_mul(count, 4 * sizeof(GLuint64)) bytes are GLuint64 value[count][4] */
768};
769uint32_t
770_mesa_unmarshal_Uniform4ui64vARB(struct gl_context *ctx, const struct marshal_cmd_Uniform4ui64vARB *cmd, const uint64_t *last)
771{
772   GLint location = cmd->location;
773   GLsizei count = cmd->count;
774   GLuint64 * value;
775   const char *variable_data = (const char *) (cmd + 1);
776   value = (GLuint64 *) variable_data;
777   CALL_Uniform4ui64vARB(ctx->CurrentServerDispatch, (location, count, value));
778   return cmd->cmd_base.cmd_size;
779}
780void GLAPIENTRY
781_mesa_marshal_Uniform4ui64vARB(GLint location, GLsizei count, const GLuint64 * value)
782{
783   GET_CURRENT_CONTEXT(ctx);
784   int value_size = safe_mul(count, 4 * sizeof(GLuint64));
785   int cmd_size = sizeof(struct marshal_cmd_Uniform4ui64vARB) + value_size;
786   struct marshal_cmd_Uniform4ui64vARB *cmd;
787   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
788      _mesa_glthread_finish_before(ctx, "Uniform4ui64vARB");
789      CALL_Uniform4ui64vARB(ctx->CurrentServerDispatch, (location, count, value));
790      return;
791   }
792   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4ui64vARB, cmd_size);
793   cmd->location = location;
794   cmd->count = count;
795   char *variable_data = (char *) (cmd + 1);
796   memcpy(variable_data, value, value_size);
797}
798
799
800/* GetUniformi64vARB: marshalled synchronously */
801void GLAPIENTRY
802_mesa_marshal_GetUniformi64vARB(GLuint program, GLint location, GLint64 * params)
803{
804   GET_CURRENT_CONTEXT(ctx);
805   _mesa_glthread_finish_before(ctx, "GetUniformi64vARB");
806   CALL_GetUniformi64vARB(ctx->CurrentServerDispatch, (program, location, params));
807}
808
809
810/* GetUniformui64vARB: marshalled synchronously */
811void GLAPIENTRY
812_mesa_marshal_GetUniformui64vARB(GLuint program, GLint location, GLuint64 * params)
813{
814   GET_CURRENT_CONTEXT(ctx);
815   _mesa_glthread_finish_before(ctx, "GetUniformui64vARB");
816   CALL_GetUniformui64vARB(ctx->CurrentServerDispatch, (program, location, params));
817}
818
819
820/* GetnUniformi64vARB: marshalled synchronously */
821void GLAPIENTRY
822_mesa_marshal_GetnUniformi64vARB(GLuint program, GLint location, GLsizei bufSize, GLint64 * params)
823{
824   GET_CURRENT_CONTEXT(ctx);
825   _mesa_glthread_finish_before(ctx, "GetnUniformi64vARB");
826   CALL_GetnUniformi64vARB(ctx->CurrentServerDispatch, (program, location, bufSize, params));
827}
828
829
830/* GetnUniformui64vARB: marshalled synchronously */
831void GLAPIENTRY
832_mesa_marshal_GetnUniformui64vARB(GLuint program, GLint location, GLsizei bufSize, GLuint64 * params)
833{
834   GET_CURRENT_CONTEXT(ctx);
835   _mesa_glthread_finish_before(ctx, "GetnUniformui64vARB");
836   CALL_GetnUniformui64vARB(ctx->CurrentServerDispatch, (program, location, bufSize, params));
837}
838
839
840/* ProgramUniform1i64ARB: marshalled asynchronously */
841struct marshal_cmd_ProgramUniform1i64ARB
842{
843   struct marshal_cmd_base cmd_base;
844   GLuint program;
845   GLint location;
846   GLint64 x;
847};
848uint32_t
849_mesa_unmarshal_ProgramUniform1i64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1i64ARB *cmd, const uint64_t *last)
850{
851   GLuint program = cmd->program;
852   GLint location = cmd->location;
853   GLint64 x = cmd->x;
854   CALL_ProgramUniform1i64ARB(ctx->CurrentServerDispatch, (program, location, x));
855   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform1i64ARB), 8) / 8);
856   assert (cmd_size == cmd->cmd_base.cmd_size);
857   return cmd_size;
858}
859void GLAPIENTRY
860_mesa_marshal_ProgramUniform1i64ARB(GLuint program, GLint location, GLint64 x)
861{
862   GET_CURRENT_CONTEXT(ctx);
863   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform1i64ARB);
864   struct marshal_cmd_ProgramUniform1i64ARB *cmd;
865   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1i64ARB, cmd_size);
866   cmd->program = program;
867   cmd->location = location;
868   cmd->x = x;
869}
870
871
872/* ProgramUniform2i64ARB: marshalled asynchronously */
873struct marshal_cmd_ProgramUniform2i64ARB
874{
875   struct marshal_cmd_base cmd_base;
876   GLuint program;
877   GLint location;
878   GLint64 x;
879   GLint64 y;
880};
881uint32_t
882_mesa_unmarshal_ProgramUniform2i64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2i64ARB *cmd, const uint64_t *last)
883{
884   GLuint program = cmd->program;
885   GLint location = cmd->location;
886   GLint64 x = cmd->x;
887   GLint64 y = cmd->y;
888   CALL_ProgramUniform2i64ARB(ctx->CurrentServerDispatch, (program, location, x, y));
889   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform2i64ARB), 8) / 8);
890   assert (cmd_size == cmd->cmd_base.cmd_size);
891   return cmd_size;
892}
893void GLAPIENTRY
894_mesa_marshal_ProgramUniform2i64ARB(GLuint program, GLint location, GLint64 x, GLint64 y)
895{
896   GET_CURRENT_CONTEXT(ctx);
897   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform2i64ARB);
898   struct marshal_cmd_ProgramUniform2i64ARB *cmd;
899   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2i64ARB, cmd_size);
900   cmd->program = program;
901   cmd->location = location;
902   cmd->x = x;
903   cmd->y = y;
904}
905
906
907/* ProgramUniform3i64ARB: marshalled asynchronously */
908struct marshal_cmd_ProgramUniform3i64ARB
909{
910   struct marshal_cmd_base cmd_base;
911   GLuint program;
912   GLint location;
913   GLint64 x;
914   GLint64 y;
915   GLint64 z;
916};
917uint32_t
918_mesa_unmarshal_ProgramUniform3i64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3i64ARB *cmd, const uint64_t *last)
919{
920   GLuint program = cmd->program;
921   GLint location = cmd->location;
922   GLint64 x = cmd->x;
923   GLint64 y = cmd->y;
924   GLint64 z = cmd->z;
925   CALL_ProgramUniform3i64ARB(ctx->CurrentServerDispatch, (program, location, x, y, z));
926   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform3i64ARB), 8) / 8);
927   assert (cmd_size == cmd->cmd_base.cmd_size);
928   return cmd_size;
929}
930void GLAPIENTRY
931_mesa_marshal_ProgramUniform3i64ARB(GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z)
932{
933   GET_CURRENT_CONTEXT(ctx);
934   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform3i64ARB);
935   struct marshal_cmd_ProgramUniform3i64ARB *cmd;
936   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3i64ARB, cmd_size);
937   cmd->program = program;
938   cmd->location = location;
939   cmd->x = x;
940   cmd->y = y;
941   cmd->z = z;
942}
943
944
945/* ProgramUniform4i64ARB: marshalled asynchronously */
946struct marshal_cmd_ProgramUniform4i64ARB
947{
948   struct marshal_cmd_base cmd_base;
949   GLuint program;
950   GLint location;
951   GLint64 x;
952   GLint64 y;
953   GLint64 z;
954   GLint64 w;
955};
956uint32_t
957_mesa_unmarshal_ProgramUniform4i64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4i64ARB *cmd, const uint64_t *last)
958{
959   GLuint program = cmd->program;
960   GLint location = cmd->location;
961   GLint64 x = cmd->x;
962   GLint64 y = cmd->y;
963   GLint64 z = cmd->z;
964   GLint64 w = cmd->w;
965   CALL_ProgramUniform4i64ARB(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
966   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform4i64ARB), 8) / 8);
967   assert (cmd_size == cmd->cmd_base.cmd_size);
968   return cmd_size;
969}
970void GLAPIENTRY
971_mesa_marshal_ProgramUniform4i64ARB(GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w)
972{
973   GET_CURRENT_CONTEXT(ctx);
974   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform4i64ARB);
975   struct marshal_cmd_ProgramUniform4i64ARB *cmd;
976   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4i64ARB, cmd_size);
977   cmd->program = program;
978   cmd->location = location;
979   cmd->x = x;
980   cmd->y = y;
981   cmd->z = z;
982   cmd->w = w;
983}
984
985
986/* ProgramUniform1i64vARB: marshalled asynchronously */
987struct marshal_cmd_ProgramUniform1i64vARB
988{
989   struct marshal_cmd_base cmd_base;
990   GLuint program;
991   GLint location;
992   GLsizei count;
993   /* Next safe_mul(count, 1 * sizeof(GLint64)) bytes are GLint64 value[count] */
994};
995uint32_t
996_mesa_unmarshal_ProgramUniform1i64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1i64vARB *cmd, const uint64_t *last)
997{
998   GLuint program = cmd->program;
999   GLint location = cmd->location;
1000   GLsizei count = cmd->count;
1001   GLint64 * value;
1002   const char *variable_data = (const char *) (cmd + 1);
1003   value = (GLint64 *) variable_data;
1004   CALL_ProgramUniform1i64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
1005   return cmd->cmd_base.cmd_size;
1006}
1007void GLAPIENTRY
1008_mesa_marshal_ProgramUniform1i64vARB(GLuint program, GLint location, GLsizei count, const GLint64 * value)
1009{
1010   GET_CURRENT_CONTEXT(ctx);
1011   int value_size = safe_mul(count, 1 * sizeof(GLint64));
1012   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform1i64vARB) + value_size;
1013   struct marshal_cmd_ProgramUniform1i64vARB *cmd;
1014   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
1015      _mesa_glthread_finish_before(ctx, "ProgramUniform1i64vARB");
1016      CALL_ProgramUniform1i64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
1017      return;
1018   }
1019   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1i64vARB, cmd_size);
1020   cmd->program = program;
1021   cmd->location = location;
1022   cmd->count = count;
1023   char *variable_data = (char *) (cmd + 1);
1024   memcpy(variable_data, value, value_size);
1025}
1026
1027
1028/* ProgramUniform2i64vARB: marshalled asynchronously */
1029struct marshal_cmd_ProgramUniform2i64vARB
1030{
1031   struct marshal_cmd_base cmd_base;
1032   GLuint program;
1033   GLint location;
1034   GLsizei count;
1035   /* Next safe_mul(count, 2 * sizeof(GLint64)) bytes are GLint64 value[count][2] */
1036};
1037uint32_t
1038_mesa_unmarshal_ProgramUniform2i64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2i64vARB *cmd, const uint64_t *last)
1039{
1040   GLuint program = cmd->program;
1041   GLint location = cmd->location;
1042   GLsizei count = cmd->count;
1043   GLint64 * value;
1044   const char *variable_data = (const char *) (cmd + 1);
1045   value = (GLint64 *) variable_data;
1046   CALL_ProgramUniform2i64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
1047   return cmd->cmd_base.cmd_size;
1048}
1049void GLAPIENTRY
1050_mesa_marshal_ProgramUniform2i64vARB(GLuint program, GLint location, GLsizei count, const GLint64 * value)
1051{
1052   GET_CURRENT_CONTEXT(ctx);
1053   int value_size = safe_mul(count, 2 * sizeof(GLint64));
1054   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform2i64vARB) + value_size;
1055   struct marshal_cmd_ProgramUniform2i64vARB *cmd;
1056   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
1057      _mesa_glthread_finish_before(ctx, "ProgramUniform2i64vARB");
1058      CALL_ProgramUniform2i64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
1059      return;
1060   }
1061   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2i64vARB, cmd_size);
1062   cmd->program = program;
1063   cmd->location = location;
1064   cmd->count = count;
1065   char *variable_data = (char *) (cmd + 1);
1066   memcpy(variable_data, value, value_size);
1067}
1068
1069
1070/* ProgramUniform3i64vARB: marshalled asynchronously */
1071struct marshal_cmd_ProgramUniform3i64vARB
1072{
1073   struct marshal_cmd_base cmd_base;
1074   GLuint program;
1075   GLint location;
1076   GLsizei count;
1077   /* Next safe_mul(count, 3 * sizeof(GLint64)) bytes are GLint64 value[count][3] */
1078};
1079uint32_t
1080_mesa_unmarshal_ProgramUniform3i64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3i64vARB *cmd, const uint64_t *last)
1081{
1082   GLuint program = cmd->program;
1083   GLint location = cmd->location;
1084   GLsizei count = cmd->count;
1085   GLint64 * value;
1086   const char *variable_data = (const char *) (cmd + 1);
1087   value = (GLint64 *) variable_data;
1088   CALL_ProgramUniform3i64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
1089   return cmd->cmd_base.cmd_size;
1090}
1091void GLAPIENTRY
1092_mesa_marshal_ProgramUniform3i64vARB(GLuint program, GLint location, GLsizei count, const GLint64 * value)
1093{
1094   GET_CURRENT_CONTEXT(ctx);
1095   int value_size = safe_mul(count, 3 * sizeof(GLint64));
1096   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform3i64vARB) + value_size;
1097   struct marshal_cmd_ProgramUniform3i64vARB *cmd;
1098   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
1099      _mesa_glthread_finish_before(ctx, "ProgramUniform3i64vARB");
1100      CALL_ProgramUniform3i64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
1101      return;
1102   }
1103   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3i64vARB, cmd_size);
1104   cmd->program = program;
1105   cmd->location = location;
1106   cmd->count = count;
1107   char *variable_data = (char *) (cmd + 1);
1108   memcpy(variable_data, value, value_size);
1109}
1110
1111
1112/* ProgramUniform4i64vARB: marshalled asynchronously */
1113struct marshal_cmd_ProgramUniform4i64vARB
1114{
1115   struct marshal_cmd_base cmd_base;
1116   GLuint program;
1117   GLint location;
1118   GLsizei count;
1119   /* Next safe_mul(count, 4 * sizeof(GLint64)) bytes are GLint64 value[count][4] */
1120};
1121uint32_t
1122_mesa_unmarshal_ProgramUniform4i64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4i64vARB *cmd, const uint64_t *last)
1123{
1124   GLuint program = cmd->program;
1125   GLint location = cmd->location;
1126   GLsizei count = cmd->count;
1127   GLint64 * value;
1128   const char *variable_data = (const char *) (cmd + 1);
1129   value = (GLint64 *) variable_data;
1130   CALL_ProgramUniform4i64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
1131   return cmd->cmd_base.cmd_size;
1132}
1133void GLAPIENTRY
1134_mesa_marshal_ProgramUniform4i64vARB(GLuint program, GLint location, GLsizei count, const GLint64 * value)
1135{
1136   GET_CURRENT_CONTEXT(ctx);
1137   int value_size = safe_mul(count, 4 * sizeof(GLint64));
1138   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform4i64vARB) + value_size;
1139   struct marshal_cmd_ProgramUniform4i64vARB *cmd;
1140   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
1141      _mesa_glthread_finish_before(ctx, "ProgramUniform4i64vARB");
1142      CALL_ProgramUniform4i64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
1143      return;
1144   }
1145   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4i64vARB, cmd_size);
1146   cmd->program = program;
1147   cmd->location = location;
1148   cmd->count = count;
1149   char *variable_data = (char *) (cmd + 1);
1150   memcpy(variable_data, value, value_size);
1151}
1152
1153
1154/* ProgramUniform1ui64ARB: marshalled asynchronously */
1155struct marshal_cmd_ProgramUniform1ui64ARB
1156{
1157   struct marshal_cmd_base cmd_base;
1158   GLuint program;
1159   GLint location;
1160   GLuint64 x;
1161};
1162uint32_t
1163_mesa_unmarshal_ProgramUniform1ui64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1ui64ARB *cmd, const uint64_t *last)
1164{
1165   GLuint program = cmd->program;
1166   GLint location = cmd->location;
1167   GLuint64 x = cmd->x;
1168   CALL_ProgramUniform1ui64ARB(ctx->CurrentServerDispatch, (program, location, x));
1169   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform1ui64ARB), 8) / 8);
1170   assert (cmd_size == cmd->cmd_base.cmd_size);
1171   return cmd_size;
1172}
1173void GLAPIENTRY
1174_mesa_marshal_ProgramUniform1ui64ARB(GLuint program, GLint location, GLuint64 x)
1175{
1176   GET_CURRENT_CONTEXT(ctx);
1177   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform1ui64ARB);
1178   struct marshal_cmd_ProgramUniform1ui64ARB *cmd;
1179   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1ui64ARB, cmd_size);
1180   cmd->program = program;
1181   cmd->location = location;
1182   cmd->x = x;
1183}
1184
1185
1186/* ProgramUniform2ui64ARB: marshalled asynchronously */
1187struct marshal_cmd_ProgramUniform2ui64ARB
1188{
1189   struct marshal_cmd_base cmd_base;
1190   GLuint program;
1191   GLint location;
1192   GLuint64 x;
1193   GLuint64 y;
1194};
1195uint32_t
1196_mesa_unmarshal_ProgramUniform2ui64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2ui64ARB *cmd, const uint64_t *last)
1197{
1198   GLuint program = cmd->program;
1199   GLint location = cmd->location;
1200   GLuint64 x = cmd->x;
1201   GLuint64 y = cmd->y;
1202   CALL_ProgramUniform2ui64ARB(ctx->CurrentServerDispatch, (program, location, x, y));
1203   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform2ui64ARB), 8) / 8);
1204   assert (cmd_size == cmd->cmd_base.cmd_size);
1205   return cmd_size;
1206}
1207void GLAPIENTRY
1208_mesa_marshal_ProgramUniform2ui64ARB(GLuint program, GLint location, GLuint64 x, GLuint64 y)
1209{
1210   GET_CURRENT_CONTEXT(ctx);
1211   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform2ui64ARB);
1212   struct marshal_cmd_ProgramUniform2ui64ARB *cmd;
1213   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2ui64ARB, cmd_size);
1214   cmd->program = program;
1215   cmd->location = location;
1216   cmd->x = x;
1217   cmd->y = y;
1218}
1219
1220
1221/* ProgramUniform3ui64ARB: marshalled asynchronously */
1222struct marshal_cmd_ProgramUniform3ui64ARB
1223{
1224   struct marshal_cmd_base cmd_base;
1225   GLuint program;
1226   GLint location;
1227   GLuint64 x;
1228   GLuint64 y;
1229   GLuint64 z;
1230};
1231uint32_t
1232_mesa_unmarshal_ProgramUniform3ui64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3ui64ARB *cmd, const uint64_t *last)
1233{
1234   GLuint program = cmd->program;
1235   GLint location = cmd->location;
1236   GLuint64 x = cmd->x;
1237   GLuint64 y = cmd->y;
1238   GLuint64 z = cmd->z;
1239   CALL_ProgramUniform3ui64ARB(ctx->CurrentServerDispatch, (program, location, x, y, z));
1240   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform3ui64ARB), 8) / 8);
1241   assert (cmd_size == cmd->cmd_base.cmd_size);
1242   return cmd_size;
1243}
1244void GLAPIENTRY
1245_mesa_marshal_ProgramUniform3ui64ARB(GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z)
1246{
1247   GET_CURRENT_CONTEXT(ctx);
1248   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform3ui64ARB);
1249   struct marshal_cmd_ProgramUniform3ui64ARB *cmd;
1250   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3ui64ARB, cmd_size);
1251   cmd->program = program;
1252   cmd->location = location;
1253   cmd->x = x;
1254   cmd->y = y;
1255   cmd->z = z;
1256}
1257
1258
1259/* ProgramUniform4ui64ARB: marshalled asynchronously */
1260struct marshal_cmd_ProgramUniform4ui64ARB
1261{
1262   struct marshal_cmd_base cmd_base;
1263   GLuint program;
1264   GLint location;
1265   GLuint64 x;
1266   GLuint64 y;
1267   GLuint64 z;
1268   GLuint64 w;
1269};
1270uint32_t
1271_mesa_unmarshal_ProgramUniform4ui64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4ui64ARB *cmd, const uint64_t *last)
1272{
1273   GLuint program = cmd->program;
1274   GLint location = cmd->location;
1275   GLuint64 x = cmd->x;
1276   GLuint64 y = cmd->y;
1277   GLuint64 z = cmd->z;
1278   GLuint64 w = cmd->w;
1279   CALL_ProgramUniform4ui64ARB(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
1280   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform4ui64ARB), 8) / 8);
1281   assert (cmd_size == cmd->cmd_base.cmd_size);
1282   return cmd_size;
1283}
1284void GLAPIENTRY
1285_mesa_marshal_ProgramUniform4ui64ARB(GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w)
1286{
1287   GET_CURRENT_CONTEXT(ctx);
1288   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform4ui64ARB);
1289   struct marshal_cmd_ProgramUniform4ui64ARB *cmd;
1290   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4ui64ARB, cmd_size);
1291   cmd->program = program;
1292   cmd->location = location;
1293   cmd->x = x;
1294   cmd->y = y;
1295   cmd->z = z;
1296   cmd->w = w;
1297}
1298
1299
1300/* ProgramUniform1ui64vARB: marshalled asynchronously */
1301struct marshal_cmd_ProgramUniform1ui64vARB
1302{
1303   struct marshal_cmd_base cmd_base;
1304   GLuint program;
1305   GLint location;
1306   GLsizei count;
1307   /* Next safe_mul(count, 1 * sizeof(GLuint64)) bytes are GLuint64 value[count] */
1308};
1309uint32_t
1310_mesa_unmarshal_ProgramUniform1ui64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1ui64vARB *cmd, const uint64_t *last)
1311{
1312   GLuint program = cmd->program;
1313   GLint location = cmd->location;
1314   GLsizei count = cmd->count;
1315   GLuint64 * value;
1316   const char *variable_data = (const char *) (cmd + 1);
1317   value = (GLuint64 *) variable_data;
1318   CALL_ProgramUniform1ui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
1319   return cmd->cmd_base.cmd_size;
1320}
1321void GLAPIENTRY
1322_mesa_marshal_ProgramUniform1ui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 * value)
1323{
1324   GET_CURRENT_CONTEXT(ctx);
1325   int value_size = safe_mul(count, 1 * sizeof(GLuint64));
1326   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform1ui64vARB) + value_size;
1327   struct marshal_cmd_ProgramUniform1ui64vARB *cmd;
1328   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
1329      _mesa_glthread_finish_before(ctx, "ProgramUniform1ui64vARB");
1330      CALL_ProgramUniform1ui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
1331      return;
1332   }
1333   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1ui64vARB, cmd_size);
1334   cmd->program = program;
1335   cmd->location = location;
1336   cmd->count = count;
1337   char *variable_data = (char *) (cmd + 1);
1338   memcpy(variable_data, value, value_size);
1339}
1340
1341
1342/* ProgramUniform2ui64vARB: marshalled asynchronously */
1343struct marshal_cmd_ProgramUniform2ui64vARB
1344{
1345   struct marshal_cmd_base cmd_base;
1346   GLuint program;
1347   GLint location;
1348   GLsizei count;
1349   /* Next safe_mul(count, 2 * sizeof(GLuint64)) bytes are GLuint64 value[count][2] */
1350};
1351uint32_t
1352_mesa_unmarshal_ProgramUniform2ui64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2ui64vARB *cmd, const uint64_t *last)
1353{
1354   GLuint program = cmd->program;
1355   GLint location = cmd->location;
1356   GLsizei count = cmd->count;
1357   GLuint64 * value;
1358   const char *variable_data = (const char *) (cmd + 1);
1359   value = (GLuint64 *) variable_data;
1360   CALL_ProgramUniform2ui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
1361   return cmd->cmd_base.cmd_size;
1362}
1363void GLAPIENTRY
1364_mesa_marshal_ProgramUniform2ui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 * value)
1365{
1366   GET_CURRENT_CONTEXT(ctx);
1367   int value_size = safe_mul(count, 2 * sizeof(GLuint64));
1368   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform2ui64vARB) + value_size;
1369   struct marshal_cmd_ProgramUniform2ui64vARB *cmd;
1370   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
1371      _mesa_glthread_finish_before(ctx, "ProgramUniform2ui64vARB");
1372      CALL_ProgramUniform2ui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
1373      return;
1374   }
1375   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2ui64vARB, cmd_size);
1376   cmd->program = program;
1377   cmd->location = location;
1378   cmd->count = count;
1379   char *variable_data = (char *) (cmd + 1);
1380   memcpy(variable_data, value, value_size);
1381}
1382
1383
1384/* ProgramUniform3ui64vARB: marshalled asynchronously */
1385struct marshal_cmd_ProgramUniform3ui64vARB
1386{
1387   struct marshal_cmd_base cmd_base;
1388   GLuint program;
1389   GLint location;
1390   GLsizei count;
1391   /* Next safe_mul(count, 3 * sizeof(GLuint64)) bytes are GLuint64 value[count][3] */
1392};
1393uint32_t
1394_mesa_unmarshal_ProgramUniform3ui64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3ui64vARB *cmd, const uint64_t *last)
1395{
1396   GLuint program = cmd->program;
1397   GLint location = cmd->location;
1398   GLsizei count = cmd->count;
1399   GLuint64 * value;
1400   const char *variable_data = (const char *) (cmd + 1);
1401   value = (GLuint64 *) variable_data;
1402   CALL_ProgramUniform3ui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
1403   return cmd->cmd_base.cmd_size;
1404}
1405void GLAPIENTRY
1406_mesa_marshal_ProgramUniform3ui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 * value)
1407{
1408   GET_CURRENT_CONTEXT(ctx);
1409   int value_size = safe_mul(count, 3 * sizeof(GLuint64));
1410   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform3ui64vARB) + value_size;
1411   struct marshal_cmd_ProgramUniform3ui64vARB *cmd;
1412   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
1413      _mesa_glthread_finish_before(ctx, "ProgramUniform3ui64vARB");
1414      CALL_ProgramUniform3ui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
1415      return;
1416   }
1417   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3ui64vARB, cmd_size);
1418   cmd->program = program;
1419   cmd->location = location;
1420   cmd->count = count;
1421   char *variable_data = (char *) (cmd + 1);
1422   memcpy(variable_data, value, value_size);
1423}
1424
1425
1426/* ProgramUniform4ui64vARB: marshalled asynchronously */
1427struct marshal_cmd_ProgramUniform4ui64vARB
1428{
1429   struct marshal_cmd_base cmd_base;
1430   GLuint program;
1431   GLint location;
1432   GLsizei count;
1433   /* Next safe_mul(count, 4 * sizeof(GLuint64)) bytes are GLuint64 value[count][4] */
1434};
1435uint32_t
1436_mesa_unmarshal_ProgramUniform4ui64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4ui64vARB *cmd, const uint64_t *last)
1437{
1438   GLuint program = cmd->program;
1439   GLint location = cmd->location;
1440   GLsizei count = cmd->count;
1441   GLuint64 * value;
1442   const char *variable_data = (const char *) (cmd + 1);
1443   value = (GLuint64 *) variable_data;
1444   CALL_ProgramUniform4ui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
1445   return cmd->cmd_base.cmd_size;
1446}
1447void GLAPIENTRY
1448_mesa_marshal_ProgramUniform4ui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 * value)
1449{
1450   GET_CURRENT_CONTEXT(ctx);
1451   int value_size = safe_mul(count, 4 * sizeof(GLuint64));
1452   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform4ui64vARB) + value_size;
1453   struct marshal_cmd_ProgramUniform4ui64vARB *cmd;
1454   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
1455      _mesa_glthread_finish_before(ctx, "ProgramUniform4ui64vARB");
1456      CALL_ProgramUniform4ui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
1457      return;
1458   }
1459   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4ui64vARB, cmd_size);
1460   cmd->program = program;
1461   cmd->location = location;
1462   cmd->count = count;
1463   char *variable_data = (char *) (cmd + 1);
1464   memcpy(variable_data, value, value_size);
1465}
1466
1467
1468/* MaxShaderCompilerThreadsKHR: marshalled asynchronously */
1469struct marshal_cmd_MaxShaderCompilerThreadsKHR
1470{
1471   struct marshal_cmd_base cmd_base;
1472   GLuint count;
1473};
1474uint32_t
1475_mesa_unmarshal_MaxShaderCompilerThreadsKHR(struct gl_context *ctx, const struct marshal_cmd_MaxShaderCompilerThreadsKHR *cmd, const uint64_t *last)
1476{
1477   GLuint count = cmd->count;
1478   CALL_MaxShaderCompilerThreadsKHR(ctx->CurrentServerDispatch, (count));
1479   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MaxShaderCompilerThreadsKHR), 8) / 8);
1480   assert (cmd_size == cmd->cmd_base.cmd_size);
1481   return cmd_size;
1482}
1483void GLAPIENTRY
1484_mesa_marshal_MaxShaderCompilerThreadsKHR(GLuint count)
1485{
1486   GET_CURRENT_CONTEXT(ctx);
1487   int cmd_size = sizeof(struct marshal_cmd_MaxShaderCompilerThreadsKHR);
1488   struct marshal_cmd_MaxShaderCompilerThreadsKHR *cmd;
1489   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MaxShaderCompilerThreadsKHR, cmd_size);
1490   cmd->count = count;
1491}
1492
1493
1494/* SpecializeShaderARB: marshalled asynchronously */
1495struct marshal_cmd_SpecializeShaderARB
1496{
1497   struct marshal_cmd_base cmd_base;
1498   GLuint shader;
1499   GLuint numSpecializationConstants;
1500   /* Next (strlen(pEntryPoint) + 1) bytes are GLchar pEntryPoint[(strlen(pEntryPoint) + 1)] */
1501   /* Next safe_mul(numSpecializationConstants, 1 * sizeof(GLuint)) bytes are GLuint pConstantIndex[numSpecializationConstants] */
1502   /* Next safe_mul(numSpecializationConstants, 1 * sizeof(GLuint)) bytes are GLuint pConstantValue[numSpecializationConstants] */
1503};
1504uint32_t
1505_mesa_unmarshal_SpecializeShaderARB(struct gl_context *ctx, const struct marshal_cmd_SpecializeShaderARB *cmd, const uint64_t *last)
1506{
1507   GLuint shader = cmd->shader;
1508   GLuint numSpecializationConstants = cmd->numSpecializationConstants;
1509   GLchar * pEntryPoint;
1510   GLuint * pConstantIndex;
1511   GLuint * pConstantValue;
1512   const char *variable_data = (const char *) (cmd + 1);
1513   pEntryPoint = (GLchar *) variable_data;
1514   variable_data += (strlen(pEntryPoint) + 1);
1515   pConstantIndex = (GLuint *) variable_data;
1516   variable_data += numSpecializationConstants * 1 * sizeof(GLuint);
1517   pConstantValue = (GLuint *) variable_data;
1518   CALL_SpecializeShaderARB(ctx->CurrentServerDispatch, (shader, pEntryPoint, numSpecializationConstants, pConstantIndex, pConstantValue));
1519   return cmd->cmd_base.cmd_size;
1520}
1521void GLAPIENTRY
1522_mesa_marshal_SpecializeShaderARB(GLuint shader, const GLchar * pEntryPoint, GLuint numSpecializationConstants, const GLuint * pConstantIndex, const GLuint * pConstantValue)
1523{
1524   GET_CURRENT_CONTEXT(ctx);
1525   int pEntryPoint_size = (strlen(pEntryPoint) + 1);
1526   int pConstantIndex_size = safe_mul(numSpecializationConstants, 1 * sizeof(GLuint));
1527   int pConstantValue_size = safe_mul(numSpecializationConstants, 1 * sizeof(GLuint));
1528   int cmd_size = sizeof(struct marshal_cmd_SpecializeShaderARB) + pEntryPoint_size + pConstantIndex_size + pConstantValue_size;
1529   struct marshal_cmd_SpecializeShaderARB *cmd;
1530   if (unlikely(pEntryPoint_size < 0 || (pEntryPoint_size > 0 && !pEntryPoint) || pConstantIndex_size < 0 || (pConstantIndex_size > 0 && !pConstantIndex) || pConstantValue_size < 0 || (pConstantValue_size > 0 && !pConstantValue) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
1531      _mesa_glthread_finish_before(ctx, "SpecializeShaderARB");
1532      CALL_SpecializeShaderARB(ctx->CurrentServerDispatch, (shader, pEntryPoint, numSpecializationConstants, pConstantIndex, pConstantValue));
1533      return;
1534   }
1535   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SpecializeShaderARB, cmd_size);
1536   cmd->shader = shader;
1537   cmd->numSpecializationConstants = numSpecializationConstants;
1538   char *variable_data = (char *) (cmd + 1);
1539   memcpy(variable_data, pEntryPoint, pEntryPoint_size);
1540   variable_data += pEntryPoint_size;
1541   memcpy(variable_data, pConstantIndex, pConstantIndex_size);
1542   variable_data += pConstantIndex_size;
1543   memcpy(variable_data, pConstantValue, pConstantValue_size);
1544}
1545
1546
1547/* ColorPointerEXT: marshalled asynchronously */
1548struct marshal_cmd_ColorPointerEXT
1549{
1550   struct marshal_cmd_base cmd_base;
1551   GLint size;
1552   GLenum type;
1553   GLsizei stride;
1554   GLsizei count;
1555   const GLvoid * pointer;
1556};
1557uint32_t
1558_mesa_unmarshal_ColorPointerEXT(struct gl_context *ctx, const struct marshal_cmd_ColorPointerEXT *cmd, const uint64_t *last)
1559{
1560   GLint size = cmd->size;
1561   GLenum type = cmd->type;
1562   GLsizei stride = cmd->stride;
1563   GLsizei count = cmd->count;
1564   const GLvoid * pointer = cmd->pointer;
1565   CALL_ColorPointerEXT(ctx->CurrentServerDispatch, (size, type, stride, count, pointer));
1566   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ColorPointerEXT), 8) / 8);
1567   assert (cmd_size == cmd->cmd_base.cmd_size);
1568   return cmd_size;
1569}
1570void GLAPIENTRY
1571_mesa_marshal_ColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
1572{
1573   GET_CURRENT_CONTEXT(ctx);
1574   int cmd_size = sizeof(struct marshal_cmd_ColorPointerEXT);
1575   struct marshal_cmd_ColorPointerEXT *cmd;
1576   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorPointerEXT, cmd_size);
1577   cmd->size = size;
1578   cmd->type = type;
1579   cmd->stride = stride;
1580   cmd->count = count;
1581   cmd->pointer = pointer;
1582   if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR0, size, type, stride, pointer);
1583}
1584
1585
1586/* EdgeFlagPointerEXT: marshalled asynchronously */
1587struct marshal_cmd_EdgeFlagPointerEXT
1588{
1589   struct marshal_cmd_base cmd_base;
1590   GLsizei stride;
1591   GLsizei count;
1592   const GLboolean * pointer;
1593};
1594uint32_t
1595_mesa_unmarshal_EdgeFlagPointerEXT(struct gl_context *ctx, const struct marshal_cmd_EdgeFlagPointerEXT *cmd, const uint64_t *last)
1596{
1597   GLsizei stride = cmd->stride;
1598   GLsizei count = cmd->count;
1599   const GLboolean * pointer = cmd->pointer;
1600   CALL_EdgeFlagPointerEXT(ctx->CurrentServerDispatch, (stride, count, pointer));
1601   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_EdgeFlagPointerEXT), 8) / 8);
1602   assert (cmd_size == cmd->cmd_base.cmd_size);
1603   return cmd_size;
1604}
1605void GLAPIENTRY
1606_mesa_marshal_EdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean * pointer)
1607{
1608   GET_CURRENT_CONTEXT(ctx);
1609   int cmd_size = sizeof(struct marshal_cmd_EdgeFlagPointerEXT);
1610   struct marshal_cmd_EdgeFlagPointerEXT *cmd;
1611   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EdgeFlagPointerEXT, cmd_size);
1612   cmd->stride = stride;
1613   cmd->count = count;
1614   cmd->pointer = pointer;
1615   if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_EDGEFLAG, 1, GL_UNSIGNED_BYTE, stride, pointer);
1616}
1617
1618
1619/* IndexPointerEXT: marshalled asynchronously */
1620struct marshal_cmd_IndexPointerEXT
1621{
1622   struct marshal_cmd_base cmd_base;
1623   GLenum type;
1624   GLsizei stride;
1625   GLsizei count;
1626   const GLvoid * pointer;
1627};
1628uint32_t
1629_mesa_unmarshal_IndexPointerEXT(struct gl_context *ctx, const struct marshal_cmd_IndexPointerEXT *cmd, const uint64_t *last)
1630{
1631   GLenum type = cmd->type;
1632   GLsizei stride = cmd->stride;
1633   GLsizei count = cmd->count;
1634   const GLvoid * pointer = cmd->pointer;
1635   CALL_IndexPointerEXT(ctx->CurrentServerDispatch, (type, stride, count, pointer));
1636   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_IndexPointerEXT), 8) / 8);
1637   assert (cmd_size == cmd->cmd_base.cmd_size);
1638   return cmd_size;
1639}
1640void GLAPIENTRY
1641_mesa_marshal_IndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
1642{
1643   GET_CURRENT_CONTEXT(ctx);
1644   int cmd_size = sizeof(struct marshal_cmd_IndexPointerEXT);
1645   struct marshal_cmd_IndexPointerEXT *cmd;
1646   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_IndexPointerEXT, cmd_size);
1647   cmd->type = type;
1648   cmd->stride = stride;
1649   cmd->count = count;
1650   cmd->pointer = pointer;
1651   if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR_INDEX, 1, type, stride, pointer);
1652}
1653
1654
1655/* NormalPointerEXT: marshalled asynchronously */
1656struct marshal_cmd_NormalPointerEXT
1657{
1658   struct marshal_cmd_base cmd_base;
1659   GLenum type;
1660   GLsizei stride;
1661   GLsizei count;
1662   const GLvoid * pointer;
1663};
1664uint32_t
1665_mesa_unmarshal_NormalPointerEXT(struct gl_context *ctx, const struct marshal_cmd_NormalPointerEXT *cmd, const uint64_t *last)
1666{
1667   GLenum type = cmd->type;
1668   GLsizei stride = cmd->stride;
1669   GLsizei count = cmd->count;
1670   const GLvoid * pointer = cmd->pointer;
1671   CALL_NormalPointerEXT(ctx->CurrentServerDispatch, (type, stride, count, pointer));
1672   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NormalPointerEXT), 8) / 8);
1673   assert (cmd_size == cmd->cmd_base.cmd_size);
1674   return cmd_size;
1675}
1676void GLAPIENTRY
1677_mesa_marshal_NormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
1678{
1679   GET_CURRENT_CONTEXT(ctx);
1680   int cmd_size = sizeof(struct marshal_cmd_NormalPointerEXT);
1681   struct marshal_cmd_NormalPointerEXT *cmd;
1682   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NormalPointerEXT, cmd_size);
1683   cmd->type = type;
1684   cmd->stride = stride;
1685   cmd->count = count;
1686   cmd->pointer = pointer;
1687   if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_NORMAL, 3, type, stride, pointer);
1688}
1689
1690
1691/* TexCoordPointerEXT: marshalled asynchronously */
1692struct marshal_cmd_TexCoordPointerEXT
1693{
1694   struct marshal_cmd_base cmd_base;
1695   GLint size;
1696   GLenum type;
1697   GLsizei stride;
1698   GLsizei count;
1699   const GLvoid * pointer;
1700};
1701uint32_t
1702_mesa_unmarshal_TexCoordPointerEXT(struct gl_context *ctx, const struct marshal_cmd_TexCoordPointerEXT *cmd, const uint64_t *last)
1703{
1704   GLint size = cmd->size;
1705   GLenum type = cmd->type;
1706   GLsizei stride = cmd->stride;
1707   GLsizei count = cmd->count;
1708   const GLvoid * pointer = cmd->pointer;
1709   CALL_TexCoordPointerEXT(ctx->CurrentServerDispatch, (size, type, stride, count, pointer));
1710   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordPointerEXT), 8) / 8);
1711   assert (cmd_size == cmd->cmd_base.cmd_size);
1712   return cmd_size;
1713}
1714void GLAPIENTRY
1715_mesa_marshal_TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
1716{
1717   GET_CURRENT_CONTEXT(ctx);
1718   int cmd_size = sizeof(struct marshal_cmd_TexCoordPointerEXT);
1719   struct marshal_cmd_TexCoordPointerEXT *cmd;
1720   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordPointerEXT, cmd_size);
1721   cmd->size = size;
1722   cmd->type = type;
1723   cmd->stride = stride;
1724   cmd->count = count;
1725   cmd->pointer = pointer;
1726   if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_TEX(ctx->GLThread.ClientActiveTexture), size, type, stride, pointer);
1727}
1728
1729
1730/* VertexPointerEXT: marshalled asynchronously */
1731struct marshal_cmd_VertexPointerEXT
1732{
1733   struct marshal_cmd_base cmd_base;
1734   GLint size;
1735   GLenum type;
1736   GLsizei stride;
1737   GLsizei count;
1738   const GLvoid * pointer;
1739};
1740uint32_t
1741_mesa_unmarshal_VertexPointerEXT(struct gl_context *ctx, const struct marshal_cmd_VertexPointerEXT *cmd, const uint64_t *last)
1742{
1743   GLint size = cmd->size;
1744   GLenum type = cmd->type;
1745   GLsizei stride = cmd->stride;
1746   GLsizei count = cmd->count;
1747   const GLvoid * pointer = cmd->pointer;
1748   CALL_VertexPointerEXT(ctx->CurrentServerDispatch, (size, type, stride, count, pointer));
1749   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexPointerEXT), 8) / 8);
1750   assert (cmd_size == cmd->cmd_base.cmd_size);
1751   return cmd_size;
1752}
1753void GLAPIENTRY
1754_mesa_marshal_VertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
1755{
1756   GET_CURRENT_CONTEXT(ctx);
1757   int cmd_size = sizeof(struct marshal_cmd_VertexPointerEXT);
1758   struct marshal_cmd_VertexPointerEXT *cmd;
1759   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexPointerEXT, cmd_size);
1760   cmd->size = size;
1761   cmd->type = type;
1762   cmd->stride = stride;
1763   cmd->count = count;
1764   cmd->pointer = pointer;
1765   if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_POS, size, type, stride, pointer);
1766}
1767
1768
1769/* LockArraysEXT: marshalled asynchronously */
1770struct marshal_cmd_LockArraysEXT
1771{
1772   struct marshal_cmd_base cmd_base;
1773   GLint first;
1774   GLsizei count;
1775};
1776uint32_t
1777_mesa_unmarshal_LockArraysEXT(struct gl_context *ctx, const struct marshal_cmd_LockArraysEXT *cmd, const uint64_t *last)
1778{
1779   GLint first = cmd->first;
1780   GLsizei count = cmd->count;
1781   CALL_LockArraysEXT(ctx->CurrentServerDispatch, (first, count));
1782   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_LockArraysEXT), 8) / 8);
1783   assert (cmd_size == cmd->cmd_base.cmd_size);
1784   return cmd_size;
1785}
1786void GLAPIENTRY
1787_mesa_marshal_LockArraysEXT(GLint first, GLsizei count)
1788{
1789   GET_CURRENT_CONTEXT(ctx);
1790   int cmd_size = sizeof(struct marshal_cmd_LockArraysEXT);
1791   struct marshal_cmd_LockArraysEXT *cmd;
1792   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LockArraysEXT, cmd_size);
1793   cmd->first = first;
1794   cmd->count = count;
1795}
1796
1797
1798/* UnlockArraysEXT: marshalled asynchronously */
1799struct marshal_cmd_UnlockArraysEXT
1800{
1801   struct marshal_cmd_base cmd_base;
1802};
1803uint32_t
1804_mesa_unmarshal_UnlockArraysEXT(struct gl_context *ctx, const struct marshal_cmd_UnlockArraysEXT *cmd, const uint64_t *last)
1805{
1806   CALL_UnlockArraysEXT(ctx->CurrentServerDispatch, ());
1807   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_UnlockArraysEXT), 8) / 8);
1808   assert (cmd_size == cmd->cmd_base.cmd_size);
1809   return cmd_size;
1810}
1811void GLAPIENTRY
1812_mesa_marshal_UnlockArraysEXT(void)
1813{
1814   GET_CURRENT_CONTEXT(ctx);
1815   int cmd_size = sizeof(struct marshal_cmd_UnlockArraysEXT);
1816   struct marshal_cmd_UnlockArraysEXT *cmd;
1817   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UnlockArraysEXT, cmd_size);
1818   (void) cmd;
1819}
1820
1821
1822/* ViewportArrayv: marshalled asynchronously */
1823struct marshal_cmd_ViewportArrayv
1824{
1825   struct marshal_cmd_base cmd_base;
1826   GLuint first;
1827   GLsizei count;
1828   /* Next safe_mul(count, 4 * sizeof(GLfloat)) bytes are GLfloat v[count][4] */
1829};
1830uint32_t
1831_mesa_unmarshal_ViewportArrayv(struct gl_context *ctx, const struct marshal_cmd_ViewportArrayv *cmd, const uint64_t *last)
1832{
1833   GLuint first = cmd->first;
1834   GLsizei count = cmd->count;
1835   GLfloat * v;
1836   const char *variable_data = (const char *) (cmd + 1);
1837   v = (GLfloat *) variable_data;
1838   CALL_ViewportArrayv(ctx->CurrentServerDispatch, (first, count, v));
1839   return cmd->cmd_base.cmd_size;
1840}
1841void GLAPIENTRY
1842_mesa_marshal_ViewportArrayv(GLuint first, GLsizei count, const GLfloat * v)
1843{
1844   GET_CURRENT_CONTEXT(ctx);
1845   int v_size = safe_mul(count, 4 * sizeof(GLfloat));
1846   int cmd_size = sizeof(struct marshal_cmd_ViewportArrayv) + v_size;
1847   struct marshal_cmd_ViewportArrayv *cmd;
1848   if (unlikely(v_size < 0 || (v_size > 0 && !v) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
1849      _mesa_glthread_finish_before(ctx, "ViewportArrayv");
1850      CALL_ViewportArrayv(ctx->CurrentServerDispatch, (first, count, v));
1851      return;
1852   }
1853   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ViewportArrayv, cmd_size);
1854   cmd->first = first;
1855   cmd->count = count;
1856   char *variable_data = (char *) (cmd + 1);
1857   memcpy(variable_data, v, v_size);
1858}
1859
1860
1861/* ViewportIndexedf: marshalled asynchronously */
1862struct marshal_cmd_ViewportIndexedf
1863{
1864   struct marshal_cmd_base cmd_base;
1865   GLuint index;
1866   GLfloat x;
1867   GLfloat y;
1868   GLfloat w;
1869   GLfloat h;
1870};
1871uint32_t
1872_mesa_unmarshal_ViewportIndexedf(struct gl_context *ctx, const struct marshal_cmd_ViewportIndexedf *cmd, const uint64_t *last)
1873{
1874   GLuint index = cmd->index;
1875   GLfloat x = cmd->x;
1876   GLfloat y = cmd->y;
1877   GLfloat w = cmd->w;
1878   GLfloat h = cmd->h;
1879   CALL_ViewportIndexedf(ctx->CurrentServerDispatch, (index, x, y, w, h));
1880   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ViewportIndexedf), 8) / 8);
1881   assert (cmd_size == cmd->cmd_base.cmd_size);
1882   return cmd_size;
1883}
1884void GLAPIENTRY
1885_mesa_marshal_ViewportIndexedf(GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h)
1886{
1887   GET_CURRENT_CONTEXT(ctx);
1888   int cmd_size = sizeof(struct marshal_cmd_ViewportIndexedf);
1889   struct marshal_cmd_ViewportIndexedf *cmd;
1890   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ViewportIndexedf, cmd_size);
1891   cmd->index = index;
1892   cmd->x = x;
1893   cmd->y = y;
1894   cmd->w = w;
1895   cmd->h = h;
1896}
1897
1898
1899/* ViewportIndexedfv: marshalled asynchronously */
1900struct marshal_cmd_ViewportIndexedfv
1901{
1902   struct marshal_cmd_base cmd_base;
1903   GLuint index;
1904   GLfloat v[4];
1905};
1906uint32_t
1907_mesa_unmarshal_ViewportIndexedfv(struct gl_context *ctx, const struct marshal_cmd_ViewportIndexedfv *cmd, const uint64_t *last)
1908{
1909   GLuint index = cmd->index;
1910   const GLfloat * v = cmd->v;
1911   CALL_ViewportIndexedfv(ctx->CurrentServerDispatch, (index, v));
1912   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ViewportIndexedfv), 8) / 8);
1913   assert (cmd_size == cmd->cmd_base.cmd_size);
1914   return cmd_size;
1915}
1916void GLAPIENTRY
1917_mesa_marshal_ViewportIndexedfv(GLuint index, const GLfloat * v)
1918{
1919   GET_CURRENT_CONTEXT(ctx);
1920   int cmd_size = sizeof(struct marshal_cmd_ViewportIndexedfv);
1921   struct marshal_cmd_ViewportIndexedfv *cmd;
1922   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ViewportIndexedfv, cmd_size);
1923   cmd->index = index;
1924   memcpy(cmd->v, v, 4 * sizeof(GLfloat));
1925}
1926
1927
1928/* ScissorArrayv: marshalled asynchronously */
1929struct marshal_cmd_ScissorArrayv
1930{
1931   struct marshal_cmd_base cmd_base;
1932   GLuint first;
1933   GLsizei count;
1934   /* Next safe_mul(count, 4 * sizeof(int)) bytes are int v[count][4] */
1935};
1936uint32_t
1937_mesa_unmarshal_ScissorArrayv(struct gl_context *ctx, const struct marshal_cmd_ScissorArrayv *cmd, const uint64_t *last)
1938{
1939   GLuint first = cmd->first;
1940   GLsizei count = cmd->count;
1941   int * v;
1942   const char *variable_data = (const char *) (cmd + 1);
1943   v = (int *) variable_data;
1944   CALL_ScissorArrayv(ctx->CurrentServerDispatch, (first, count, v));
1945   return cmd->cmd_base.cmd_size;
1946}
1947void GLAPIENTRY
1948_mesa_marshal_ScissorArrayv(GLuint first, GLsizei count, const int * v)
1949{
1950   GET_CURRENT_CONTEXT(ctx);
1951   int v_size = safe_mul(count, 4 * sizeof(int));
1952   int cmd_size = sizeof(struct marshal_cmd_ScissorArrayv) + v_size;
1953   struct marshal_cmd_ScissorArrayv *cmd;
1954   if (unlikely(v_size < 0 || (v_size > 0 && !v) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
1955      _mesa_glthread_finish_before(ctx, "ScissorArrayv");
1956      CALL_ScissorArrayv(ctx->CurrentServerDispatch, (first, count, v));
1957      return;
1958   }
1959   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ScissorArrayv, cmd_size);
1960   cmd->first = first;
1961   cmd->count = count;
1962   char *variable_data = (char *) (cmd + 1);
1963   memcpy(variable_data, v, v_size);
1964}
1965
1966
1967/* ScissorIndexed: marshalled asynchronously */
1968struct marshal_cmd_ScissorIndexed
1969{
1970   struct marshal_cmd_base cmd_base;
1971   GLuint index;
1972   GLint left;
1973   GLint bottom;
1974   GLsizei width;
1975   GLsizei height;
1976};
1977uint32_t
1978_mesa_unmarshal_ScissorIndexed(struct gl_context *ctx, const struct marshal_cmd_ScissorIndexed *cmd, const uint64_t *last)
1979{
1980   GLuint index = cmd->index;
1981   GLint left = cmd->left;
1982   GLint bottom = cmd->bottom;
1983   GLsizei width = cmd->width;
1984   GLsizei height = cmd->height;
1985   CALL_ScissorIndexed(ctx->CurrentServerDispatch, (index, left, bottom, width, height));
1986   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ScissorIndexed), 8) / 8);
1987   assert (cmd_size == cmd->cmd_base.cmd_size);
1988   return cmd_size;
1989}
1990void GLAPIENTRY
1991_mesa_marshal_ScissorIndexed(GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height)
1992{
1993   GET_CURRENT_CONTEXT(ctx);
1994   int cmd_size = sizeof(struct marshal_cmd_ScissorIndexed);
1995   struct marshal_cmd_ScissorIndexed *cmd;
1996   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ScissorIndexed, cmd_size);
1997   cmd->index = index;
1998   cmd->left = left;
1999   cmd->bottom = bottom;
2000   cmd->width = width;
2001   cmd->height = height;
2002}
2003
2004
2005/* ScissorIndexedv: marshalled asynchronously */
2006struct marshal_cmd_ScissorIndexedv
2007{
2008   struct marshal_cmd_base cmd_base;
2009   GLuint index;
2010   GLint v[4];
2011};
2012uint32_t
2013_mesa_unmarshal_ScissorIndexedv(struct gl_context *ctx, const struct marshal_cmd_ScissorIndexedv *cmd, const uint64_t *last)
2014{
2015   GLuint index = cmd->index;
2016   const GLint * v = cmd->v;
2017   CALL_ScissorIndexedv(ctx->CurrentServerDispatch, (index, v));
2018   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ScissorIndexedv), 8) / 8);
2019   assert (cmd_size == cmd->cmd_base.cmd_size);
2020   return cmd_size;
2021}
2022void GLAPIENTRY
2023_mesa_marshal_ScissorIndexedv(GLuint index, const GLint * v)
2024{
2025   GET_CURRENT_CONTEXT(ctx);
2026   int cmd_size = sizeof(struct marshal_cmd_ScissorIndexedv);
2027   struct marshal_cmd_ScissorIndexedv *cmd;
2028   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ScissorIndexedv, cmd_size);
2029   cmd->index = index;
2030   memcpy(cmd->v, v, 4 * sizeof(GLint));
2031}
2032
2033
2034/* DepthRangeArrayv: marshalled asynchronously */
2035struct marshal_cmd_DepthRangeArrayv
2036{
2037   struct marshal_cmd_base cmd_base;
2038   GLuint first;
2039   GLsizei count;
2040   /* Next safe_mul(count, 2 * sizeof(GLclampd)) bytes are GLclampd v[count][2] */
2041};
2042uint32_t
2043_mesa_unmarshal_DepthRangeArrayv(struct gl_context *ctx, const struct marshal_cmd_DepthRangeArrayv *cmd, const uint64_t *last)
2044{
2045   GLuint first = cmd->first;
2046   GLsizei count = cmd->count;
2047   GLclampd * v;
2048   const char *variable_data = (const char *) (cmd + 1);
2049   v = (GLclampd *) variable_data;
2050   CALL_DepthRangeArrayv(ctx->CurrentServerDispatch, (first, count, v));
2051   return cmd->cmd_base.cmd_size;
2052}
2053void GLAPIENTRY
2054_mesa_marshal_DepthRangeArrayv(GLuint first, GLsizei count, const GLclampd * v)
2055{
2056   GET_CURRENT_CONTEXT(ctx);
2057   int v_size = safe_mul(count, 2 * sizeof(GLclampd));
2058   int cmd_size = sizeof(struct marshal_cmd_DepthRangeArrayv) + v_size;
2059   struct marshal_cmd_DepthRangeArrayv *cmd;
2060   if (unlikely(v_size < 0 || (v_size > 0 && !v) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
2061      _mesa_glthread_finish_before(ctx, "DepthRangeArrayv");
2062      CALL_DepthRangeArrayv(ctx->CurrentServerDispatch, (first, count, v));
2063      return;
2064   }
2065   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DepthRangeArrayv, cmd_size);
2066   cmd->first = first;
2067   cmd->count = count;
2068   char *variable_data = (char *) (cmd + 1);
2069   memcpy(variable_data, v, v_size);
2070}
2071
2072
2073/* DepthRangeIndexed: marshalled asynchronously */
2074struct marshal_cmd_DepthRangeIndexed
2075{
2076   struct marshal_cmd_base cmd_base;
2077   GLuint index;
2078   GLclampd n;
2079   GLclampd f;
2080};
2081uint32_t
2082_mesa_unmarshal_DepthRangeIndexed(struct gl_context *ctx, const struct marshal_cmd_DepthRangeIndexed *cmd, const uint64_t *last)
2083{
2084   GLuint index = cmd->index;
2085   GLclampd n = cmd->n;
2086   GLclampd f = cmd->f;
2087   CALL_DepthRangeIndexed(ctx->CurrentServerDispatch, (index, n, f));
2088   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DepthRangeIndexed), 8) / 8);
2089   assert (cmd_size == cmd->cmd_base.cmd_size);
2090   return cmd_size;
2091}
2092void GLAPIENTRY
2093_mesa_marshal_DepthRangeIndexed(GLuint index, GLclampd n, GLclampd f)
2094{
2095   GET_CURRENT_CONTEXT(ctx);
2096   int cmd_size = sizeof(struct marshal_cmd_DepthRangeIndexed);
2097   struct marshal_cmd_DepthRangeIndexed *cmd;
2098   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DepthRangeIndexed, cmd_size);
2099   cmd->index = index;
2100   cmd->n = n;
2101   cmd->f = f;
2102}
2103
2104
2105/* GetFloati_v: marshalled synchronously */
2106void GLAPIENTRY
2107_mesa_marshal_GetFloati_v(GLenum target, GLuint index, GLfloat * data)
2108{
2109   GET_CURRENT_CONTEXT(ctx);
2110   _mesa_glthread_finish_before(ctx, "GetFloati_v");
2111   CALL_GetFloati_v(ctx->CurrentServerDispatch, (target, index, data));
2112}
2113
2114
2115/* GetDoublei_v: marshalled synchronously */
2116void GLAPIENTRY
2117_mesa_marshal_GetDoublei_v(GLenum target, GLuint index, GLdouble * data)
2118{
2119   GET_CURRENT_CONTEXT(ctx);
2120   _mesa_glthread_finish_before(ctx, "GetDoublei_v");
2121   CALL_GetDoublei_v(ctx->CurrentServerDispatch, (target, index, data));
2122}
2123
2124
2125/* FramebufferSampleLocationsfvARB: marshalled asynchronously */
2126struct marshal_cmd_FramebufferSampleLocationsfvARB
2127{
2128   struct marshal_cmd_base cmd_base;
2129   GLenum target;
2130   GLuint start;
2131   GLsizei count;
2132   /* Next safe_mul((2 * count), 1 * sizeof(GLfloat)) bytes are GLfloat v[(2 * count)] */
2133};
2134uint32_t
2135_mesa_unmarshal_FramebufferSampleLocationsfvARB(struct gl_context *ctx, const struct marshal_cmd_FramebufferSampleLocationsfvARB *cmd, const uint64_t *last)
2136{
2137   GLenum target = cmd->target;
2138   GLuint start = cmd->start;
2139   GLsizei count = cmd->count;
2140   GLfloat * v;
2141   const char *variable_data = (const char *) (cmd + 1);
2142   v = (GLfloat *) variable_data;
2143   CALL_FramebufferSampleLocationsfvARB(ctx->CurrentServerDispatch, (target, start, count, v));
2144   return cmd->cmd_base.cmd_size;
2145}
2146void GLAPIENTRY
2147_mesa_marshal_FramebufferSampleLocationsfvARB(GLenum target, GLuint start, GLsizei count, const GLfloat * v)
2148{
2149   GET_CURRENT_CONTEXT(ctx);
2150   int v_size = safe_mul((2 * count), 1 * sizeof(GLfloat));
2151   int cmd_size = sizeof(struct marshal_cmd_FramebufferSampleLocationsfvARB) + v_size;
2152   struct marshal_cmd_FramebufferSampleLocationsfvARB *cmd;
2153   if (unlikely(v_size < 0 || (v_size > 0 && !v) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
2154      _mesa_glthread_finish_before(ctx, "FramebufferSampleLocationsfvARB");
2155      CALL_FramebufferSampleLocationsfvARB(ctx->CurrentServerDispatch, (target, start, count, v));
2156      return;
2157   }
2158   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferSampleLocationsfvARB, cmd_size);
2159   cmd->target = target;
2160   cmd->start = start;
2161   cmd->count = count;
2162   char *variable_data = (char *) (cmd + 1);
2163   memcpy(variable_data, v, v_size);
2164}
2165
2166
2167/* NamedFramebufferSampleLocationsfvARB: marshalled asynchronously */
2168struct marshal_cmd_NamedFramebufferSampleLocationsfvARB
2169{
2170   struct marshal_cmd_base cmd_base;
2171   GLuint framebuffer;
2172   GLuint start;
2173   GLsizei count;
2174   /* Next safe_mul((2 * count), 1 * sizeof(GLfloat)) bytes are GLfloat v[(2 * count)] */
2175};
2176uint32_t
2177_mesa_unmarshal_NamedFramebufferSampleLocationsfvARB(struct gl_context *ctx, const struct marshal_cmd_NamedFramebufferSampleLocationsfvARB *cmd, const uint64_t *last)
2178{
2179   GLuint framebuffer = cmd->framebuffer;
2180   GLuint start = cmd->start;
2181   GLsizei count = cmd->count;
2182   GLfloat * v;
2183   const char *variable_data = (const char *) (cmd + 1);
2184   v = (GLfloat *) variable_data;
2185   CALL_NamedFramebufferSampleLocationsfvARB(ctx->CurrentServerDispatch, (framebuffer, start, count, v));
2186   return cmd->cmd_base.cmd_size;
2187}
2188void GLAPIENTRY
2189_mesa_marshal_NamedFramebufferSampleLocationsfvARB(GLuint framebuffer, GLuint start, GLsizei count, const GLfloat * v)
2190{
2191   GET_CURRENT_CONTEXT(ctx);
2192   int v_size = safe_mul((2 * count), 1 * sizeof(GLfloat));
2193   int cmd_size = sizeof(struct marshal_cmd_NamedFramebufferSampleLocationsfvARB) + v_size;
2194   struct marshal_cmd_NamedFramebufferSampleLocationsfvARB *cmd;
2195   if (unlikely(v_size < 0 || (v_size > 0 && !v) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
2196      _mesa_glthread_finish_before(ctx, "NamedFramebufferSampleLocationsfvARB");
2197      CALL_NamedFramebufferSampleLocationsfvARB(ctx->CurrentServerDispatch, (framebuffer, start, count, v));
2198      return;
2199   }
2200   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedFramebufferSampleLocationsfvARB, cmd_size);
2201   cmd->framebuffer = framebuffer;
2202   cmd->start = start;
2203   cmd->count = count;
2204   char *variable_data = (char *) (cmd + 1);
2205   memcpy(variable_data, v, v_size);
2206}
2207
2208
2209/* EvaluateDepthValuesARB: marshalled asynchronously */
2210struct marshal_cmd_EvaluateDepthValuesARB
2211{
2212   struct marshal_cmd_base cmd_base;
2213};
2214uint32_t
2215_mesa_unmarshal_EvaluateDepthValuesARB(struct gl_context *ctx, const struct marshal_cmd_EvaluateDepthValuesARB *cmd, const uint64_t *last)
2216{
2217   CALL_EvaluateDepthValuesARB(ctx->CurrentServerDispatch, ());
2218   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_EvaluateDepthValuesARB), 8) / 8);
2219   assert (cmd_size == cmd->cmd_base.cmd_size);
2220   return cmd_size;
2221}
2222void GLAPIENTRY
2223_mesa_marshal_EvaluateDepthValuesARB(void)
2224{
2225   GET_CURRENT_CONTEXT(ctx);
2226   int cmd_size = sizeof(struct marshal_cmd_EvaluateDepthValuesARB);
2227   struct marshal_cmd_EvaluateDepthValuesARB *cmd;
2228   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EvaluateDepthValuesARB, cmd_size);
2229   (void) cmd;
2230}
2231
2232
2233/* WindowPos4dMESA: marshalled asynchronously */
2234struct marshal_cmd_WindowPos4dMESA
2235{
2236   struct marshal_cmd_base cmd_base;
2237   GLdouble x;
2238   GLdouble y;
2239   GLdouble z;
2240   GLdouble w;
2241};
2242uint32_t
2243_mesa_unmarshal_WindowPos4dMESA(struct gl_context *ctx, const struct marshal_cmd_WindowPos4dMESA *cmd, const uint64_t *last)
2244{
2245   GLdouble x = cmd->x;
2246   GLdouble y = cmd->y;
2247   GLdouble z = cmd->z;
2248   GLdouble w = cmd->w;
2249   CALL_WindowPos4dMESA(ctx->CurrentServerDispatch, (x, y, z, w));
2250   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos4dMESA), 8) / 8);
2251   assert (cmd_size == cmd->cmd_base.cmd_size);
2252   return cmd_size;
2253}
2254void GLAPIENTRY
2255_mesa_marshal_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
2256{
2257   GET_CURRENT_CONTEXT(ctx);
2258   int cmd_size = sizeof(struct marshal_cmd_WindowPos4dMESA);
2259   struct marshal_cmd_WindowPos4dMESA *cmd;
2260   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos4dMESA, cmd_size);
2261   cmd->x = x;
2262   cmd->y = y;
2263   cmd->z = z;
2264   cmd->w = w;
2265}
2266
2267
2268/* WindowPos4dvMESA: marshalled asynchronously */
2269struct marshal_cmd_WindowPos4dvMESA
2270{
2271   struct marshal_cmd_base cmd_base;
2272   GLdouble v[4];
2273};
2274uint32_t
2275_mesa_unmarshal_WindowPos4dvMESA(struct gl_context *ctx, const struct marshal_cmd_WindowPos4dvMESA *cmd, const uint64_t *last)
2276{
2277   const GLdouble * v = cmd->v;
2278   CALL_WindowPos4dvMESA(ctx->CurrentServerDispatch, (v));
2279   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos4dvMESA), 8) / 8);
2280   assert (cmd_size == cmd->cmd_base.cmd_size);
2281   return cmd_size;
2282}
2283void GLAPIENTRY
2284_mesa_marshal_WindowPos4dvMESA(const GLdouble * v)
2285{
2286   GET_CURRENT_CONTEXT(ctx);
2287   int cmd_size = sizeof(struct marshal_cmd_WindowPos4dvMESA);
2288   struct marshal_cmd_WindowPos4dvMESA *cmd;
2289   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos4dvMESA, cmd_size);
2290   memcpy(cmd->v, v, 4 * sizeof(GLdouble));
2291}
2292
2293
2294/* WindowPos4fMESA: marshalled asynchronously */
2295struct marshal_cmd_WindowPos4fMESA
2296{
2297   struct marshal_cmd_base cmd_base;
2298   GLfloat x;
2299   GLfloat y;
2300   GLfloat z;
2301   GLfloat w;
2302};
2303uint32_t
2304_mesa_unmarshal_WindowPos4fMESA(struct gl_context *ctx, const struct marshal_cmd_WindowPos4fMESA *cmd, const uint64_t *last)
2305{
2306   GLfloat x = cmd->x;
2307   GLfloat y = cmd->y;
2308   GLfloat z = cmd->z;
2309   GLfloat w = cmd->w;
2310   CALL_WindowPos4fMESA(ctx->CurrentServerDispatch, (x, y, z, w));
2311   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos4fMESA), 8) / 8);
2312   assert (cmd_size == cmd->cmd_base.cmd_size);
2313   return cmd_size;
2314}
2315void GLAPIENTRY
2316_mesa_marshal_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
2317{
2318   GET_CURRENT_CONTEXT(ctx);
2319   int cmd_size = sizeof(struct marshal_cmd_WindowPos4fMESA);
2320   struct marshal_cmd_WindowPos4fMESA *cmd;
2321   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos4fMESA, cmd_size);
2322   cmd->x = x;
2323   cmd->y = y;
2324   cmd->z = z;
2325   cmd->w = w;
2326}
2327
2328
2329/* WindowPos4fvMESA: marshalled asynchronously */
2330struct marshal_cmd_WindowPos4fvMESA
2331{
2332   struct marshal_cmd_base cmd_base;
2333   GLfloat v[4];
2334};
2335uint32_t
2336_mesa_unmarshal_WindowPos4fvMESA(struct gl_context *ctx, const struct marshal_cmd_WindowPos4fvMESA *cmd, const uint64_t *last)
2337{
2338   const GLfloat * v = cmd->v;
2339   CALL_WindowPos4fvMESA(ctx->CurrentServerDispatch, (v));
2340   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos4fvMESA), 8) / 8);
2341   assert (cmd_size == cmd->cmd_base.cmd_size);
2342   return cmd_size;
2343}
2344void GLAPIENTRY
2345_mesa_marshal_WindowPos4fvMESA(const GLfloat * v)
2346{
2347   GET_CURRENT_CONTEXT(ctx);
2348   int cmd_size = sizeof(struct marshal_cmd_WindowPos4fvMESA);
2349   struct marshal_cmd_WindowPos4fvMESA *cmd;
2350   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos4fvMESA, cmd_size);
2351   memcpy(cmd->v, v, 4 * sizeof(GLfloat));
2352}
2353
2354
2355/* WindowPos4iMESA: marshalled asynchronously */
2356struct marshal_cmd_WindowPos4iMESA
2357{
2358   struct marshal_cmd_base cmd_base;
2359   GLint x;
2360   GLint y;
2361   GLint z;
2362   GLint w;
2363};
2364uint32_t
2365_mesa_unmarshal_WindowPos4iMESA(struct gl_context *ctx, const struct marshal_cmd_WindowPos4iMESA *cmd, const uint64_t *last)
2366{
2367   GLint x = cmd->x;
2368   GLint y = cmd->y;
2369   GLint z = cmd->z;
2370   GLint w = cmd->w;
2371   CALL_WindowPos4iMESA(ctx->CurrentServerDispatch, (x, y, z, w));
2372   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos4iMESA), 8) / 8);
2373   assert (cmd_size == cmd->cmd_base.cmd_size);
2374   return cmd_size;
2375}
2376void GLAPIENTRY
2377_mesa_marshal_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w)
2378{
2379   GET_CURRENT_CONTEXT(ctx);
2380   int cmd_size = sizeof(struct marshal_cmd_WindowPos4iMESA);
2381   struct marshal_cmd_WindowPos4iMESA *cmd;
2382   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos4iMESA, cmd_size);
2383   cmd->x = x;
2384   cmd->y = y;
2385   cmd->z = z;
2386   cmd->w = w;
2387}
2388
2389
2390/* WindowPos4ivMESA: marshalled asynchronously */
2391struct marshal_cmd_WindowPos4ivMESA
2392{
2393   struct marshal_cmd_base cmd_base;
2394   GLint v[4];
2395};
2396uint32_t
2397_mesa_unmarshal_WindowPos4ivMESA(struct gl_context *ctx, const struct marshal_cmd_WindowPos4ivMESA *cmd, const uint64_t *last)
2398{
2399   const GLint * v = cmd->v;
2400   CALL_WindowPos4ivMESA(ctx->CurrentServerDispatch, (v));
2401   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos4ivMESA), 8) / 8);
2402   assert (cmd_size == cmd->cmd_base.cmd_size);
2403   return cmd_size;
2404}
2405void GLAPIENTRY
2406_mesa_marshal_WindowPos4ivMESA(const GLint * v)
2407{
2408   GET_CURRENT_CONTEXT(ctx);
2409   int cmd_size = sizeof(struct marshal_cmd_WindowPos4ivMESA);
2410   struct marshal_cmd_WindowPos4ivMESA *cmd;
2411   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos4ivMESA, cmd_size);
2412   memcpy(cmd->v, v, 4 * sizeof(GLint));
2413}
2414
2415
2416/* WindowPos4sMESA: marshalled asynchronously */
2417struct marshal_cmd_WindowPos4sMESA
2418{
2419   struct marshal_cmd_base cmd_base;
2420   GLshort x;
2421   GLshort y;
2422   GLshort z;
2423   GLshort w;
2424};
2425uint32_t
2426_mesa_unmarshal_WindowPos4sMESA(struct gl_context *ctx, const struct marshal_cmd_WindowPos4sMESA *cmd, const uint64_t *last)
2427{
2428   GLshort x = cmd->x;
2429   GLshort y = cmd->y;
2430   GLshort z = cmd->z;
2431   GLshort w = cmd->w;
2432   CALL_WindowPos4sMESA(ctx->CurrentServerDispatch, (x, y, z, w));
2433   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos4sMESA), 8) / 8);
2434   assert (cmd_size == cmd->cmd_base.cmd_size);
2435   return cmd_size;
2436}
2437void GLAPIENTRY
2438_mesa_marshal_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w)
2439{
2440   GET_CURRENT_CONTEXT(ctx);
2441   int cmd_size = sizeof(struct marshal_cmd_WindowPos4sMESA);
2442   struct marshal_cmd_WindowPos4sMESA *cmd;
2443   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos4sMESA, cmd_size);
2444   cmd->x = x;
2445   cmd->y = y;
2446   cmd->z = z;
2447   cmd->w = w;
2448}
2449
2450
2451/* WindowPos4svMESA: marshalled asynchronously */
2452struct marshal_cmd_WindowPos4svMESA
2453{
2454   struct marshal_cmd_base cmd_base;
2455   GLshort v[4];
2456};
2457uint32_t
2458_mesa_unmarshal_WindowPos4svMESA(struct gl_context *ctx, const struct marshal_cmd_WindowPos4svMESA *cmd, const uint64_t *last)
2459{
2460   const GLshort * v = cmd->v;
2461   CALL_WindowPos4svMESA(ctx->CurrentServerDispatch, (v));
2462   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos4svMESA), 8) / 8);
2463   assert (cmd_size == cmd->cmd_base.cmd_size);
2464   return cmd_size;
2465}
2466void GLAPIENTRY
2467_mesa_marshal_WindowPos4svMESA(const GLshort * v)
2468{
2469   GET_CURRENT_CONTEXT(ctx);
2470   int cmd_size = sizeof(struct marshal_cmd_WindowPos4svMESA);
2471   struct marshal_cmd_WindowPos4svMESA *cmd;
2472   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos4svMESA, cmd_size);
2473   memcpy(cmd->v, v, 4 * sizeof(GLshort));
2474}
2475
2476
2477/* MultiModeDrawArraysIBM: marshalled asynchronously */
2478struct marshal_cmd_MultiModeDrawArraysIBM
2479{
2480   struct marshal_cmd_base cmd_base;
2481   GLsizei primcount;
2482   GLint modestride;
2483   const GLenum * mode;
2484   const GLint * first;
2485   const GLsizei * count;
2486};
2487uint32_t
2488_mesa_unmarshal_MultiModeDrawArraysIBM(struct gl_context *ctx, const struct marshal_cmd_MultiModeDrawArraysIBM *cmd, const uint64_t *last)
2489{
2490   GLsizei primcount = cmd->primcount;
2491   GLint modestride = cmd->modestride;
2492   const GLenum * mode = cmd->mode;
2493   const GLint * first = cmd->first;
2494   const GLsizei * count = cmd->count;
2495   CALL_MultiModeDrawArraysIBM(ctx->CurrentServerDispatch, (mode, first, count, primcount, modestride));
2496   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiModeDrawArraysIBM), 8) / 8);
2497   assert (cmd_size == cmd->cmd_base.cmd_size);
2498   return cmd_size;
2499}
2500void GLAPIENTRY
2501_mesa_marshal_MultiModeDrawArraysIBM(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride)
2502{
2503   GET_CURRENT_CONTEXT(ctx);
2504   int cmd_size = sizeof(struct marshal_cmd_MultiModeDrawArraysIBM);
2505   struct marshal_cmd_MultiModeDrawArraysIBM *cmd;
2506   if (_mesa_glthread_has_non_vbo_vertices(ctx)) {
2507      _mesa_glthread_finish_before(ctx, "MultiModeDrawArraysIBM");
2508      CALL_MultiModeDrawArraysIBM(ctx->CurrentServerDispatch, (mode, first, count, primcount, modestride));
2509      return;
2510   }
2511   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiModeDrawArraysIBM, cmd_size);
2512   cmd->primcount = primcount;
2513   cmd->modestride = modestride;
2514   cmd->mode = mode;
2515   cmd->first = first;
2516   cmd->count = count;
2517}
2518
2519
2520/* MultiModeDrawElementsIBM: marshalled asynchronously */
2521struct marshal_cmd_MultiModeDrawElementsIBM
2522{
2523   struct marshal_cmd_base cmd_base;
2524   GLenum type;
2525   GLsizei primcount;
2526   GLint modestride;
2527   const GLenum * mode;
2528   const GLsizei * count;
2529   const GLvoid * const * indices;
2530};
2531uint32_t
2532_mesa_unmarshal_MultiModeDrawElementsIBM(struct gl_context *ctx, const struct marshal_cmd_MultiModeDrawElementsIBM *cmd, const uint64_t *last)
2533{
2534   GLenum type = cmd->type;
2535   GLsizei primcount = cmd->primcount;
2536   GLint modestride = cmd->modestride;
2537   const GLenum * mode = cmd->mode;
2538   const GLsizei * count = cmd->count;
2539   const GLvoid * const * indices = cmd->indices;
2540   CALL_MultiModeDrawElementsIBM(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount, modestride));
2541   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiModeDrawElementsIBM), 8) / 8);
2542   assert (cmd_size == cmd->cmd_base.cmd_size);
2543   return cmd_size;
2544}
2545void GLAPIENTRY
2546_mesa_marshal_MultiModeDrawElementsIBM(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride)
2547{
2548   GET_CURRENT_CONTEXT(ctx);
2549   int cmd_size = sizeof(struct marshal_cmd_MultiModeDrawElementsIBM);
2550   struct marshal_cmd_MultiModeDrawElementsIBM *cmd;
2551   if (_mesa_glthread_has_non_vbo_vertices_or_indices(ctx)) {
2552      _mesa_glthread_finish_before(ctx, "MultiModeDrawElementsIBM");
2553      CALL_MultiModeDrawElementsIBM(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount, modestride));
2554      return;
2555   }
2556   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiModeDrawElementsIBM, cmd_size);
2557   cmd->type = type;
2558   cmd->primcount = primcount;
2559   cmd->modestride = modestride;
2560   cmd->mode = mode;
2561   cmd->count = count;
2562   cmd->indices = indices;
2563}
2564
2565
2566