196c5ddc4Srjs/* DO NOT EDIT - This file generated automatically by gl_marshal.py script */
296c5ddc4Srjs
396c5ddc4Srjs/*
496c5ddc4Srjs * Copyright (C) 2012 Intel Corporation
596c5ddc4Srjs * All Rights Reserved.
696c5ddc4Srjs *
796c5ddc4Srjs * Permission is hereby granted, free of charge, to any person obtaining a
896c5ddc4Srjs * copy of this software and associated documentation files (the "Software"),
996c5ddc4Srjs * to deal in the Software without restriction, including without limitation
1096c5ddc4Srjs * the rights to use, copy, modify, merge, publish, distribute, sub license,
1196c5ddc4Srjs * and/or sell copies of the Software, and to permit persons to whom the
1296c5ddc4Srjs * Software is furnished to do so, subject to the following conditions:
1396c5ddc4Srjs *
1496c5ddc4Srjs * The above copyright notice and this permission notice (including the next
1596c5ddc4Srjs * paragraph) shall be included in all copies or substantial portions of the
1696c5ddc4Srjs * Software.
1796c5ddc4Srjs *
1896c5ddc4Srjs * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1996c5ddc4Srjs * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2096c5ddc4Srjs * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
2196c5ddc4Srjs * INTEL CORPORATION,
2296c5ddc4Srjs * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
2396c5ddc4Srjs * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
2496c5ddc4Srjs * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2596c5ddc4Srjs * SOFTWARE.
2696c5ddc4Srjs */
2796c5ddc4Srjs
2896c5ddc4Srjs
2996c5ddc4Srjs#include "api_exec.h"
3096c5ddc4Srjs#include "glthread_marshal.h"
3196c5ddc4Srjs#include "bufferobj.h"
3296c5ddc4Srjs#include "dispatch.h"
3396c5ddc4Srjs
3496c5ddc4Srjs#define COMPAT (ctx->API != API_OPENGL_CORE)
3596c5ddc4Srjs
3696c5ddc4SrjsUNUSED static inline int safe_mul(int a, int b)
3796c5ddc4Srjs{
3896c5ddc4Srjs    if (a < 0 || b < 0) return -1;
3996c5ddc4Srjs    if (a == 0 || b == 0) return 0;
4096c5ddc4Srjs    if (a > INT_MAX / b) return -1;
4196c5ddc4Srjs    return a * b;
4296c5ddc4Srjs}
4396c5ddc4Srjs
4496c5ddc4Srjs/* VertexAttrib1fARB: marshalled asynchronously */
4596c5ddc4Srjsstruct marshal_cmd_VertexAttrib1fARB
4696c5ddc4Srjs{
4796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
4896c5ddc4Srjs   GLuint index;
4996c5ddc4Srjs   GLfloat x;
5096c5ddc4Srjs};
5196c5ddc4Srjsuint32_t
5296c5ddc4Srjs_mesa_unmarshal_VertexAttrib1fARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1fARB *cmd, const uint64_t *last)
5396c5ddc4Srjs{
5496c5ddc4Srjs   GLuint index = cmd->index;
5596c5ddc4Srjs   GLfloat x = cmd->x;
5696c5ddc4Srjs   CALL_VertexAttrib1fARB(ctx->CurrentServerDispatch, (index, x));
5796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib1fARB), 8) / 8);
5896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
5996c5ddc4Srjs   return cmd_size;
6096c5ddc4Srjs}
6196c5ddc4Srjsvoid GLAPIENTRY
6296c5ddc4Srjs_mesa_marshal_VertexAttrib1fARB(GLuint index, GLfloat x)
6396c5ddc4Srjs{
6496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
6596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib1fARB);
6696c5ddc4Srjs   struct marshal_cmd_VertexAttrib1fARB *cmd;
6796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1fARB, cmd_size);
6896c5ddc4Srjs   cmd->index = index;
6996c5ddc4Srjs   cmd->x = x;
7096c5ddc4Srjs}
7196c5ddc4Srjs
7296c5ddc4Srjs
7396c5ddc4Srjs/* VertexAttrib1fvARB: marshalled asynchronously */
7496c5ddc4Srjsstruct marshal_cmd_VertexAttrib1fvARB
7596c5ddc4Srjs{
7696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
7796c5ddc4Srjs   GLuint index;
7896c5ddc4Srjs   GLfloat v[1];
7996c5ddc4Srjs};
8096c5ddc4Srjsuint32_t
8196c5ddc4Srjs_mesa_unmarshal_VertexAttrib1fvARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1fvARB *cmd, const uint64_t *last)
8296c5ddc4Srjs{
8396c5ddc4Srjs   GLuint index = cmd->index;
8496c5ddc4Srjs   const GLfloat * v = cmd->v;
8596c5ddc4Srjs   CALL_VertexAttrib1fvARB(ctx->CurrentServerDispatch, (index, v));
8696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib1fvARB), 8) / 8);
8796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
8896c5ddc4Srjs   return cmd_size;
8996c5ddc4Srjs}
9096c5ddc4Srjsvoid GLAPIENTRY
9196c5ddc4Srjs_mesa_marshal_VertexAttrib1fvARB(GLuint index, const GLfloat * v)
9296c5ddc4Srjs{
9396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
9496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib1fvARB);
9596c5ddc4Srjs   struct marshal_cmd_VertexAttrib1fvARB *cmd;
9696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1fvARB, cmd_size);
9796c5ddc4Srjs   cmd->index = index;
9896c5ddc4Srjs   memcpy(cmd->v, v, 1 * sizeof(GLfloat));
9996c5ddc4Srjs}
10096c5ddc4Srjs
10196c5ddc4Srjs
10296c5ddc4Srjs/* VertexAttrib1s: marshalled asynchronously */
10396c5ddc4Srjsstruct marshal_cmd_VertexAttrib1s
10496c5ddc4Srjs{
10596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
10696c5ddc4Srjs   GLshort x;
10796c5ddc4Srjs   GLuint index;
10896c5ddc4Srjs};
10996c5ddc4Srjsuint32_t
11096c5ddc4Srjs_mesa_unmarshal_VertexAttrib1s(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1s *cmd, const uint64_t *last)
11196c5ddc4Srjs{
11296c5ddc4Srjs   GLuint index = cmd->index;
11396c5ddc4Srjs   GLshort x = cmd->x;
11496c5ddc4Srjs   CALL_VertexAttrib1s(ctx->CurrentServerDispatch, (index, x));
11596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib1s), 8) / 8);
11696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
11796c5ddc4Srjs   return cmd_size;
11896c5ddc4Srjs}
11996c5ddc4Srjsvoid GLAPIENTRY
12096c5ddc4Srjs_mesa_marshal_VertexAttrib1s(GLuint index, GLshort x)
12196c5ddc4Srjs{
12296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
12396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib1s);
12496c5ddc4Srjs   struct marshal_cmd_VertexAttrib1s *cmd;
12596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1s, cmd_size);
12696c5ddc4Srjs   cmd->index = index;
12796c5ddc4Srjs   cmd->x = x;
12896c5ddc4Srjs}
12996c5ddc4Srjs
13096c5ddc4Srjs
13196c5ddc4Srjs/* VertexAttrib1sv: marshalled asynchronously */
13296c5ddc4Srjsstruct marshal_cmd_VertexAttrib1sv
13396c5ddc4Srjs{
13496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
13596c5ddc4Srjs   GLuint index;
13696c5ddc4Srjs   GLshort v[1];
13796c5ddc4Srjs};
13896c5ddc4Srjsuint32_t
13996c5ddc4Srjs_mesa_unmarshal_VertexAttrib1sv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1sv *cmd, const uint64_t *last)
14096c5ddc4Srjs{
14196c5ddc4Srjs   GLuint index = cmd->index;
14296c5ddc4Srjs   const GLshort * v = cmd->v;
14396c5ddc4Srjs   CALL_VertexAttrib1sv(ctx->CurrentServerDispatch, (index, v));
14496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib1sv), 8) / 8);
14596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
14696c5ddc4Srjs   return cmd_size;
14796c5ddc4Srjs}
14896c5ddc4Srjsvoid GLAPIENTRY
14996c5ddc4Srjs_mesa_marshal_VertexAttrib1sv(GLuint index, const GLshort * v)
15096c5ddc4Srjs{
15196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
15296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib1sv);
15396c5ddc4Srjs   struct marshal_cmd_VertexAttrib1sv *cmd;
15496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1sv, cmd_size);
15596c5ddc4Srjs   cmd->index = index;
15696c5ddc4Srjs   memcpy(cmd->v, v, 1 * sizeof(GLshort));
15796c5ddc4Srjs}
15896c5ddc4Srjs
15996c5ddc4Srjs
16096c5ddc4Srjs/* VertexAttrib2d: marshalled asynchronously */
16196c5ddc4Srjsstruct marshal_cmd_VertexAttrib2d
16296c5ddc4Srjs{
16396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
16496c5ddc4Srjs   GLuint index;
16596c5ddc4Srjs   GLdouble x;
16696c5ddc4Srjs   GLdouble y;
16796c5ddc4Srjs};
16896c5ddc4Srjsuint32_t
16996c5ddc4Srjs_mesa_unmarshal_VertexAttrib2d(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2d *cmd, const uint64_t *last)
17096c5ddc4Srjs{
17196c5ddc4Srjs   GLuint index = cmd->index;
17296c5ddc4Srjs   GLdouble x = cmd->x;
17396c5ddc4Srjs   GLdouble y = cmd->y;
17496c5ddc4Srjs   CALL_VertexAttrib2d(ctx->CurrentServerDispatch, (index, x, y));
17596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib2d), 8) / 8);
17696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
17796c5ddc4Srjs   return cmd_size;
17896c5ddc4Srjs}
17996c5ddc4Srjsvoid GLAPIENTRY
18096c5ddc4Srjs_mesa_marshal_VertexAttrib2d(GLuint index, GLdouble x, GLdouble y)
18196c5ddc4Srjs{
18296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
18396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib2d);
18496c5ddc4Srjs   struct marshal_cmd_VertexAttrib2d *cmd;
18596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2d, cmd_size);
18696c5ddc4Srjs   cmd->index = index;
18796c5ddc4Srjs   cmd->x = x;
18896c5ddc4Srjs   cmd->y = y;
18996c5ddc4Srjs}
19096c5ddc4Srjs
19196c5ddc4Srjs
19296c5ddc4Srjs/* VertexAttrib2dv: marshalled asynchronously */
19396c5ddc4Srjsstruct marshal_cmd_VertexAttrib2dv
19496c5ddc4Srjs{
19596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
19696c5ddc4Srjs   GLuint index;
19796c5ddc4Srjs   GLdouble v[2];
19896c5ddc4Srjs};
19996c5ddc4Srjsuint32_t
20096c5ddc4Srjs_mesa_unmarshal_VertexAttrib2dv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2dv *cmd, const uint64_t *last)
20196c5ddc4Srjs{
20296c5ddc4Srjs   GLuint index = cmd->index;
20396c5ddc4Srjs   const GLdouble * v = cmd->v;
20496c5ddc4Srjs   CALL_VertexAttrib2dv(ctx->CurrentServerDispatch, (index, v));
20596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib2dv), 8) / 8);
20696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
20796c5ddc4Srjs   return cmd_size;
20896c5ddc4Srjs}
20996c5ddc4Srjsvoid GLAPIENTRY
21096c5ddc4Srjs_mesa_marshal_VertexAttrib2dv(GLuint index, const GLdouble * v)
21196c5ddc4Srjs{
21296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
21396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib2dv);
21496c5ddc4Srjs   struct marshal_cmd_VertexAttrib2dv *cmd;
21596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2dv, cmd_size);
21696c5ddc4Srjs   cmd->index = index;
21796c5ddc4Srjs   memcpy(cmd->v, v, 2 * sizeof(GLdouble));
21896c5ddc4Srjs}
21996c5ddc4Srjs
22096c5ddc4Srjs
22196c5ddc4Srjs/* VertexAttrib2fARB: marshalled asynchronously */
22296c5ddc4Srjsstruct marshal_cmd_VertexAttrib2fARB
22396c5ddc4Srjs{
22496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
22596c5ddc4Srjs   GLuint index;
22696c5ddc4Srjs   GLfloat x;
22796c5ddc4Srjs   GLfloat y;
22896c5ddc4Srjs};
22996c5ddc4Srjsuint32_t
23096c5ddc4Srjs_mesa_unmarshal_VertexAttrib2fARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2fARB *cmd, const uint64_t *last)
23196c5ddc4Srjs{
23296c5ddc4Srjs   GLuint index = cmd->index;
23396c5ddc4Srjs   GLfloat x = cmd->x;
23496c5ddc4Srjs   GLfloat y = cmd->y;
23596c5ddc4Srjs   CALL_VertexAttrib2fARB(ctx->CurrentServerDispatch, (index, x, y));
23696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib2fARB), 8) / 8);
23796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
23896c5ddc4Srjs   return cmd_size;
23996c5ddc4Srjs}
24096c5ddc4Srjsvoid GLAPIENTRY
24196c5ddc4Srjs_mesa_marshal_VertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y)
24296c5ddc4Srjs{
24396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
24496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib2fARB);
24596c5ddc4Srjs   struct marshal_cmd_VertexAttrib2fARB *cmd;
24696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2fARB, cmd_size);
24796c5ddc4Srjs   cmd->index = index;
24896c5ddc4Srjs   cmd->x = x;
24996c5ddc4Srjs   cmd->y = y;
25096c5ddc4Srjs}
25196c5ddc4Srjs
25296c5ddc4Srjs
25396c5ddc4Srjs/* VertexAttrib2fvARB: marshalled asynchronously */
25496c5ddc4Srjsstruct marshal_cmd_VertexAttrib2fvARB
25596c5ddc4Srjs{
25696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
25796c5ddc4Srjs   GLuint index;
25896c5ddc4Srjs   GLfloat v[2];
25996c5ddc4Srjs};
26096c5ddc4Srjsuint32_t
26196c5ddc4Srjs_mesa_unmarshal_VertexAttrib2fvARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2fvARB *cmd, const uint64_t *last)
26296c5ddc4Srjs{
26396c5ddc4Srjs   GLuint index = cmd->index;
26496c5ddc4Srjs   const GLfloat * v = cmd->v;
26596c5ddc4Srjs   CALL_VertexAttrib2fvARB(ctx->CurrentServerDispatch, (index, v));
26696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib2fvARB), 8) / 8);
26796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
26896c5ddc4Srjs   return cmd_size;
26996c5ddc4Srjs}
27096c5ddc4Srjsvoid GLAPIENTRY
27196c5ddc4Srjs_mesa_marshal_VertexAttrib2fvARB(GLuint index, const GLfloat * v)
27296c5ddc4Srjs{
27396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
27496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib2fvARB);
27596c5ddc4Srjs   struct marshal_cmd_VertexAttrib2fvARB *cmd;
27696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2fvARB, cmd_size);
27796c5ddc4Srjs   cmd->index = index;
27896c5ddc4Srjs   memcpy(cmd->v, v, 2 * sizeof(GLfloat));
27996c5ddc4Srjs}
28096c5ddc4Srjs
28196c5ddc4Srjs
28296c5ddc4Srjs/* VertexAttrib2s: marshalled asynchronously */
28396c5ddc4Srjsstruct marshal_cmd_VertexAttrib2s
28496c5ddc4Srjs{
28596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
28696c5ddc4Srjs   GLshort x;
28796c5ddc4Srjs   GLshort y;
28896c5ddc4Srjs   GLuint index;
28996c5ddc4Srjs};
29096c5ddc4Srjsuint32_t
29196c5ddc4Srjs_mesa_unmarshal_VertexAttrib2s(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2s *cmd, const uint64_t *last)
29296c5ddc4Srjs{
29396c5ddc4Srjs   GLuint index = cmd->index;
29496c5ddc4Srjs   GLshort x = cmd->x;
29596c5ddc4Srjs   GLshort y = cmd->y;
29696c5ddc4Srjs   CALL_VertexAttrib2s(ctx->CurrentServerDispatch, (index, x, y));
29796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib2s), 8) / 8);
29896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
29996c5ddc4Srjs   return cmd_size;
30096c5ddc4Srjs}
30196c5ddc4Srjsvoid GLAPIENTRY
30296c5ddc4Srjs_mesa_marshal_VertexAttrib2s(GLuint index, GLshort x, GLshort y)
30396c5ddc4Srjs{
30496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
30596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib2s);
30696c5ddc4Srjs   struct marshal_cmd_VertexAttrib2s *cmd;
30796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2s, cmd_size);
30896c5ddc4Srjs   cmd->index = index;
30996c5ddc4Srjs   cmd->x = x;
31096c5ddc4Srjs   cmd->y = y;
31196c5ddc4Srjs}
31296c5ddc4Srjs
31396c5ddc4Srjs
31496c5ddc4Srjs/* VertexAttrib2sv: marshalled asynchronously */
31596c5ddc4Srjsstruct marshal_cmd_VertexAttrib2sv
31696c5ddc4Srjs{
31796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
31896c5ddc4Srjs   GLuint index;
31996c5ddc4Srjs   GLshort v[2];
32096c5ddc4Srjs};
32196c5ddc4Srjsuint32_t
32296c5ddc4Srjs_mesa_unmarshal_VertexAttrib2sv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2sv *cmd, const uint64_t *last)
32396c5ddc4Srjs{
32496c5ddc4Srjs   GLuint index = cmd->index;
32596c5ddc4Srjs   const GLshort * v = cmd->v;
32696c5ddc4Srjs   CALL_VertexAttrib2sv(ctx->CurrentServerDispatch, (index, v));
32796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib2sv), 8) / 8);
32896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
32996c5ddc4Srjs   return cmd_size;
33096c5ddc4Srjs}
33196c5ddc4Srjsvoid GLAPIENTRY
33296c5ddc4Srjs_mesa_marshal_VertexAttrib2sv(GLuint index, const GLshort * v)
33396c5ddc4Srjs{
33496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
33596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib2sv);
33696c5ddc4Srjs   struct marshal_cmd_VertexAttrib2sv *cmd;
33796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2sv, cmd_size);
33896c5ddc4Srjs   cmd->index = index;
33996c5ddc4Srjs   memcpy(cmd->v, v, 2 * sizeof(GLshort));
34096c5ddc4Srjs}
34196c5ddc4Srjs
34296c5ddc4Srjs
34396c5ddc4Srjs/* VertexAttrib3d: marshalled asynchronously */
34496c5ddc4Srjsstruct marshal_cmd_VertexAttrib3d
34596c5ddc4Srjs{
34696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
34796c5ddc4Srjs   GLuint index;
34896c5ddc4Srjs   GLdouble x;
34996c5ddc4Srjs   GLdouble y;
35096c5ddc4Srjs   GLdouble z;
35196c5ddc4Srjs};
35296c5ddc4Srjsuint32_t
35396c5ddc4Srjs_mesa_unmarshal_VertexAttrib3d(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3d *cmd, const uint64_t *last)
35496c5ddc4Srjs{
35596c5ddc4Srjs   GLuint index = cmd->index;
35696c5ddc4Srjs   GLdouble x = cmd->x;
35796c5ddc4Srjs   GLdouble y = cmd->y;
35896c5ddc4Srjs   GLdouble z = cmd->z;
35996c5ddc4Srjs   CALL_VertexAttrib3d(ctx->CurrentServerDispatch, (index, x, y, z));
36096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib3d), 8) / 8);
36196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
36296c5ddc4Srjs   return cmd_size;
36396c5ddc4Srjs}
36496c5ddc4Srjsvoid GLAPIENTRY
36596c5ddc4Srjs_mesa_marshal_VertexAttrib3d(GLuint index, GLdouble x, GLdouble y, GLdouble z)
36696c5ddc4Srjs{
36796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
36896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib3d);
36996c5ddc4Srjs   struct marshal_cmd_VertexAttrib3d *cmd;
37096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3d, cmd_size);
37196c5ddc4Srjs   cmd->index = index;
37296c5ddc4Srjs   cmd->x = x;
37396c5ddc4Srjs   cmd->y = y;
37496c5ddc4Srjs   cmd->z = z;
37596c5ddc4Srjs}
37696c5ddc4Srjs
37796c5ddc4Srjs
37896c5ddc4Srjs/* VertexAttrib3dv: marshalled asynchronously */
37996c5ddc4Srjsstruct marshal_cmd_VertexAttrib3dv
38096c5ddc4Srjs{
38196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
38296c5ddc4Srjs   GLuint index;
38396c5ddc4Srjs   GLdouble v[3];
38496c5ddc4Srjs};
38596c5ddc4Srjsuint32_t
38696c5ddc4Srjs_mesa_unmarshal_VertexAttrib3dv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3dv *cmd, const uint64_t *last)
38796c5ddc4Srjs{
38896c5ddc4Srjs   GLuint index = cmd->index;
38996c5ddc4Srjs   const GLdouble * v = cmd->v;
39096c5ddc4Srjs   CALL_VertexAttrib3dv(ctx->CurrentServerDispatch, (index, v));
39196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib3dv), 8) / 8);
39296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
39396c5ddc4Srjs   return cmd_size;
39496c5ddc4Srjs}
39596c5ddc4Srjsvoid GLAPIENTRY
39696c5ddc4Srjs_mesa_marshal_VertexAttrib3dv(GLuint index, const GLdouble * v)
39796c5ddc4Srjs{
39896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
39996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib3dv);
40096c5ddc4Srjs   struct marshal_cmd_VertexAttrib3dv *cmd;
40196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3dv, cmd_size);
40296c5ddc4Srjs   cmd->index = index;
40396c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLdouble));
40496c5ddc4Srjs}
40596c5ddc4Srjs
40696c5ddc4Srjs
40796c5ddc4Srjs/* VertexAttrib3fARB: marshalled asynchronously */
40896c5ddc4Srjsstruct marshal_cmd_VertexAttrib3fARB
40996c5ddc4Srjs{
41096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
41196c5ddc4Srjs   GLuint index;
41296c5ddc4Srjs   GLfloat x;
41396c5ddc4Srjs   GLfloat y;
41496c5ddc4Srjs   GLfloat z;
41596c5ddc4Srjs};
41696c5ddc4Srjsuint32_t
41796c5ddc4Srjs_mesa_unmarshal_VertexAttrib3fARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3fARB *cmd, const uint64_t *last)
41896c5ddc4Srjs{
41996c5ddc4Srjs   GLuint index = cmd->index;
42096c5ddc4Srjs   GLfloat x = cmd->x;
42196c5ddc4Srjs   GLfloat y = cmd->y;
42296c5ddc4Srjs   GLfloat z = cmd->z;
42396c5ddc4Srjs   CALL_VertexAttrib3fARB(ctx->CurrentServerDispatch, (index, x, y, z));
42496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib3fARB), 8) / 8);
42596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
42696c5ddc4Srjs   return cmd_size;
42796c5ddc4Srjs}
42896c5ddc4Srjsvoid GLAPIENTRY
42996c5ddc4Srjs_mesa_marshal_VertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z)
43096c5ddc4Srjs{
43196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
43296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib3fARB);
43396c5ddc4Srjs   struct marshal_cmd_VertexAttrib3fARB *cmd;
43496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3fARB, cmd_size);
43596c5ddc4Srjs   cmd->index = index;
43696c5ddc4Srjs   cmd->x = x;
43796c5ddc4Srjs   cmd->y = y;
43896c5ddc4Srjs   cmd->z = z;
43996c5ddc4Srjs}
44096c5ddc4Srjs
44196c5ddc4Srjs
44296c5ddc4Srjs/* VertexAttrib3fvARB: marshalled asynchronously */
44396c5ddc4Srjsstruct marshal_cmd_VertexAttrib3fvARB
44496c5ddc4Srjs{
44596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
44696c5ddc4Srjs   GLuint index;
44796c5ddc4Srjs   GLfloat v[3];
44896c5ddc4Srjs};
44996c5ddc4Srjsuint32_t
45096c5ddc4Srjs_mesa_unmarshal_VertexAttrib3fvARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3fvARB *cmd, const uint64_t *last)
45196c5ddc4Srjs{
45296c5ddc4Srjs   GLuint index = cmd->index;
45396c5ddc4Srjs   const GLfloat * v = cmd->v;
45496c5ddc4Srjs   CALL_VertexAttrib3fvARB(ctx->CurrentServerDispatch, (index, v));
45596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib3fvARB), 8) / 8);
45696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
45796c5ddc4Srjs   return cmd_size;
45896c5ddc4Srjs}
45996c5ddc4Srjsvoid GLAPIENTRY
46096c5ddc4Srjs_mesa_marshal_VertexAttrib3fvARB(GLuint index, const GLfloat * v)
46196c5ddc4Srjs{
46296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
46396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib3fvARB);
46496c5ddc4Srjs   struct marshal_cmd_VertexAttrib3fvARB *cmd;
46596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3fvARB, cmd_size);
46696c5ddc4Srjs   cmd->index = index;
46796c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLfloat));
46896c5ddc4Srjs}
46996c5ddc4Srjs
47096c5ddc4Srjs
47196c5ddc4Srjs/* VertexAttrib3s: marshalled asynchronously */
47296c5ddc4Srjsstruct marshal_cmd_VertexAttrib3s
47396c5ddc4Srjs{
47496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
47596c5ddc4Srjs   GLshort x;
47696c5ddc4Srjs   GLshort y;
47796c5ddc4Srjs   GLshort z;
47896c5ddc4Srjs   GLuint index;
47996c5ddc4Srjs};
48096c5ddc4Srjsuint32_t
48196c5ddc4Srjs_mesa_unmarshal_VertexAttrib3s(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3s *cmd, const uint64_t *last)
48296c5ddc4Srjs{
48396c5ddc4Srjs   GLuint index = cmd->index;
48496c5ddc4Srjs   GLshort x = cmd->x;
48596c5ddc4Srjs   GLshort y = cmd->y;
48696c5ddc4Srjs   GLshort z = cmd->z;
48796c5ddc4Srjs   CALL_VertexAttrib3s(ctx->CurrentServerDispatch, (index, x, y, z));
48896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib3s), 8) / 8);
48996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
49096c5ddc4Srjs   return cmd_size;
49196c5ddc4Srjs}
49296c5ddc4Srjsvoid GLAPIENTRY
49396c5ddc4Srjs_mesa_marshal_VertexAttrib3s(GLuint index, GLshort x, GLshort y, GLshort z)
49496c5ddc4Srjs{
49596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
49696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib3s);
49796c5ddc4Srjs   struct marshal_cmd_VertexAttrib3s *cmd;
49896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3s, cmd_size);
49996c5ddc4Srjs   cmd->index = index;
50096c5ddc4Srjs   cmd->x = x;
50196c5ddc4Srjs   cmd->y = y;
50296c5ddc4Srjs   cmd->z = z;
50396c5ddc4Srjs}
50496c5ddc4Srjs
50596c5ddc4Srjs
50696c5ddc4Srjs/* VertexAttrib3sv: marshalled asynchronously */
50796c5ddc4Srjsstruct marshal_cmd_VertexAttrib3sv
50896c5ddc4Srjs{
50996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
51096c5ddc4Srjs   GLuint index;
51196c5ddc4Srjs   GLshort v[3];
51296c5ddc4Srjs};
51396c5ddc4Srjsuint32_t
51496c5ddc4Srjs_mesa_unmarshal_VertexAttrib3sv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3sv *cmd, const uint64_t *last)
51596c5ddc4Srjs{
51696c5ddc4Srjs   GLuint index = cmd->index;
51796c5ddc4Srjs   const GLshort * v = cmd->v;
51896c5ddc4Srjs   CALL_VertexAttrib3sv(ctx->CurrentServerDispatch, (index, v));
51996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib3sv), 8) / 8);
52096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
52196c5ddc4Srjs   return cmd_size;
52296c5ddc4Srjs}
52396c5ddc4Srjsvoid GLAPIENTRY
52496c5ddc4Srjs_mesa_marshal_VertexAttrib3sv(GLuint index, const GLshort * v)
52596c5ddc4Srjs{
52696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
52796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib3sv);
52896c5ddc4Srjs   struct marshal_cmd_VertexAttrib3sv *cmd;
52996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3sv, cmd_size);
53096c5ddc4Srjs   cmd->index = index;
53196c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLshort));
53296c5ddc4Srjs}
53396c5ddc4Srjs
53496c5ddc4Srjs
53596c5ddc4Srjs/* VertexAttrib4Nbv: marshalled asynchronously */
53696c5ddc4Srjsstruct marshal_cmd_VertexAttrib4Nbv
53796c5ddc4Srjs{
53896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
53996c5ddc4Srjs   GLuint index;
54096c5ddc4Srjs   GLbyte v[4];
54196c5ddc4Srjs};
54296c5ddc4Srjsuint32_t
54396c5ddc4Srjs_mesa_unmarshal_VertexAttrib4Nbv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nbv *cmd, const uint64_t *last)
54496c5ddc4Srjs{
54596c5ddc4Srjs   GLuint index = cmd->index;
54696c5ddc4Srjs   const GLbyte * v = cmd->v;
54796c5ddc4Srjs   CALL_VertexAttrib4Nbv(ctx->CurrentServerDispatch, (index, v));
54896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4Nbv), 8) / 8);
54996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
55096c5ddc4Srjs   return cmd_size;
55196c5ddc4Srjs}
55296c5ddc4Srjsvoid GLAPIENTRY
55396c5ddc4Srjs_mesa_marshal_VertexAttrib4Nbv(GLuint index, const GLbyte * v)
55496c5ddc4Srjs{
55596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
55696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nbv);
55796c5ddc4Srjs   struct marshal_cmd_VertexAttrib4Nbv *cmd;
55896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nbv, cmd_size);
55996c5ddc4Srjs   cmd->index = index;
56096c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLbyte));
56196c5ddc4Srjs}
56296c5ddc4Srjs
56396c5ddc4Srjs
56496c5ddc4Srjs/* VertexAttrib4Niv: marshalled asynchronously */
56596c5ddc4Srjsstruct marshal_cmd_VertexAttrib4Niv
56696c5ddc4Srjs{
56796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
56896c5ddc4Srjs   GLuint index;
56996c5ddc4Srjs   GLint v[4];
57096c5ddc4Srjs};
57196c5ddc4Srjsuint32_t
57296c5ddc4Srjs_mesa_unmarshal_VertexAttrib4Niv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Niv *cmd, const uint64_t *last)
57396c5ddc4Srjs{
57496c5ddc4Srjs   GLuint index = cmd->index;
57596c5ddc4Srjs   const GLint * v = cmd->v;
57696c5ddc4Srjs   CALL_VertexAttrib4Niv(ctx->CurrentServerDispatch, (index, v));
57796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4Niv), 8) / 8);
57896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
57996c5ddc4Srjs   return cmd_size;
58096c5ddc4Srjs}
58196c5ddc4Srjsvoid GLAPIENTRY
58296c5ddc4Srjs_mesa_marshal_VertexAttrib4Niv(GLuint index, const GLint * v)
58396c5ddc4Srjs{
58496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
58596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Niv);
58696c5ddc4Srjs   struct marshal_cmd_VertexAttrib4Niv *cmd;
58796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Niv, cmd_size);
58896c5ddc4Srjs   cmd->index = index;
58996c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLint));
59096c5ddc4Srjs}
59196c5ddc4Srjs
59296c5ddc4Srjs
59396c5ddc4Srjs/* VertexAttrib4Nsv: marshalled asynchronously */
59496c5ddc4Srjsstruct marshal_cmd_VertexAttrib4Nsv
59596c5ddc4Srjs{
59696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
59796c5ddc4Srjs   GLuint index;
59896c5ddc4Srjs   GLshort v[4];
59996c5ddc4Srjs};
60096c5ddc4Srjsuint32_t
60196c5ddc4Srjs_mesa_unmarshal_VertexAttrib4Nsv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nsv *cmd, const uint64_t *last)
60296c5ddc4Srjs{
60396c5ddc4Srjs   GLuint index = cmd->index;
60496c5ddc4Srjs   const GLshort * v = cmd->v;
60596c5ddc4Srjs   CALL_VertexAttrib4Nsv(ctx->CurrentServerDispatch, (index, v));
60696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4Nsv), 8) / 8);
60796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
60896c5ddc4Srjs   return cmd_size;
60996c5ddc4Srjs}
61096c5ddc4Srjsvoid GLAPIENTRY
61196c5ddc4Srjs_mesa_marshal_VertexAttrib4Nsv(GLuint index, const GLshort * v)
61296c5ddc4Srjs{
61396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
61496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nsv);
61596c5ddc4Srjs   struct marshal_cmd_VertexAttrib4Nsv *cmd;
61696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nsv, cmd_size);
61796c5ddc4Srjs   cmd->index = index;
61896c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLshort));
61996c5ddc4Srjs}
62096c5ddc4Srjs
62196c5ddc4Srjs
62296c5ddc4Srjs/* VertexAttrib4Nub: marshalled asynchronously */
62396c5ddc4Srjsstruct marshal_cmd_VertexAttrib4Nub
62496c5ddc4Srjs{
62596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
62696c5ddc4Srjs   GLubyte x;
62796c5ddc4Srjs   GLubyte y;
62896c5ddc4Srjs   GLubyte z;
62996c5ddc4Srjs   GLubyte w;
63096c5ddc4Srjs   GLuint index;
63196c5ddc4Srjs};
63296c5ddc4Srjsuint32_t
63396c5ddc4Srjs_mesa_unmarshal_VertexAttrib4Nub(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nub *cmd, const uint64_t *last)
63496c5ddc4Srjs{
63596c5ddc4Srjs   GLuint index = cmd->index;
63696c5ddc4Srjs   GLubyte x = cmd->x;
63796c5ddc4Srjs   GLubyte y = cmd->y;
63896c5ddc4Srjs   GLubyte z = cmd->z;
63996c5ddc4Srjs   GLubyte w = cmd->w;
64096c5ddc4Srjs   CALL_VertexAttrib4Nub(ctx->CurrentServerDispatch, (index, x, y, z, w));
64196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4Nub), 8) / 8);
64296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
64396c5ddc4Srjs   return cmd_size;
64496c5ddc4Srjs}
64596c5ddc4Srjsvoid GLAPIENTRY
64696c5ddc4Srjs_mesa_marshal_VertexAttrib4Nub(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
64796c5ddc4Srjs{
64896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
64996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nub);
65096c5ddc4Srjs   struct marshal_cmd_VertexAttrib4Nub *cmd;
65196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nub, cmd_size);
65296c5ddc4Srjs   cmd->index = index;
65396c5ddc4Srjs   cmd->x = x;
65496c5ddc4Srjs   cmd->y = y;
65596c5ddc4Srjs   cmd->z = z;
65696c5ddc4Srjs   cmd->w = w;
65796c5ddc4Srjs}
65896c5ddc4Srjs
65996c5ddc4Srjs
66096c5ddc4Srjs/* VertexAttrib4Nubv: marshalled asynchronously */
66196c5ddc4Srjsstruct marshal_cmd_VertexAttrib4Nubv
66296c5ddc4Srjs{
66396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
66496c5ddc4Srjs   GLuint index;
66596c5ddc4Srjs   GLubyte v[4];
66696c5ddc4Srjs};
66796c5ddc4Srjsuint32_t
66896c5ddc4Srjs_mesa_unmarshal_VertexAttrib4Nubv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nubv *cmd, const uint64_t *last)
66996c5ddc4Srjs{
67096c5ddc4Srjs   GLuint index = cmd->index;
67196c5ddc4Srjs   const GLubyte * v = cmd->v;
67296c5ddc4Srjs   CALL_VertexAttrib4Nubv(ctx->CurrentServerDispatch, (index, v));
67396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4Nubv), 8) / 8);
67496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
67596c5ddc4Srjs   return cmd_size;
67696c5ddc4Srjs}
67796c5ddc4Srjsvoid GLAPIENTRY
67896c5ddc4Srjs_mesa_marshal_VertexAttrib4Nubv(GLuint index, const GLubyte * v)
67996c5ddc4Srjs{
68096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
68196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nubv);
68296c5ddc4Srjs   struct marshal_cmd_VertexAttrib4Nubv *cmd;
68396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nubv, cmd_size);
68496c5ddc4Srjs   cmd->index = index;
68596c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLubyte));
68696c5ddc4Srjs}
68796c5ddc4Srjs
68896c5ddc4Srjs
68996c5ddc4Srjs/* VertexAttrib4Nuiv: marshalled asynchronously */
69096c5ddc4Srjsstruct marshal_cmd_VertexAttrib4Nuiv
69196c5ddc4Srjs{
69296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
69396c5ddc4Srjs   GLuint index;
69496c5ddc4Srjs   GLuint v[4];
69596c5ddc4Srjs};
69696c5ddc4Srjsuint32_t
69796c5ddc4Srjs_mesa_unmarshal_VertexAttrib4Nuiv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nuiv *cmd, const uint64_t *last)
69896c5ddc4Srjs{
69996c5ddc4Srjs   GLuint index = cmd->index;
70096c5ddc4Srjs   const GLuint * v = cmd->v;
70196c5ddc4Srjs   CALL_VertexAttrib4Nuiv(ctx->CurrentServerDispatch, (index, v));
70296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4Nuiv), 8) / 8);
70396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
70496c5ddc4Srjs   return cmd_size;
70596c5ddc4Srjs}
70696c5ddc4Srjsvoid GLAPIENTRY
70796c5ddc4Srjs_mesa_marshal_VertexAttrib4Nuiv(GLuint index, const GLuint * v)
70896c5ddc4Srjs{
70996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
71096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nuiv);
71196c5ddc4Srjs   struct marshal_cmd_VertexAttrib4Nuiv *cmd;
71296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nuiv, cmd_size);
71396c5ddc4Srjs   cmd->index = index;
71496c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLuint));
71596c5ddc4Srjs}
71696c5ddc4Srjs
71796c5ddc4Srjs
71896c5ddc4Srjs/* VertexAttrib4Nusv: marshalled asynchronously */
71996c5ddc4Srjsstruct marshal_cmd_VertexAttrib4Nusv
72096c5ddc4Srjs{
72196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
72296c5ddc4Srjs   GLuint index;
72396c5ddc4Srjs   GLushort v[4];
72496c5ddc4Srjs};
72596c5ddc4Srjsuint32_t
72696c5ddc4Srjs_mesa_unmarshal_VertexAttrib4Nusv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nusv *cmd, const uint64_t *last)
72796c5ddc4Srjs{
72896c5ddc4Srjs   GLuint index = cmd->index;
72996c5ddc4Srjs   const GLushort * v = cmd->v;
73096c5ddc4Srjs   CALL_VertexAttrib4Nusv(ctx->CurrentServerDispatch, (index, v));
73196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4Nusv), 8) / 8);
73296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
73396c5ddc4Srjs   return cmd_size;
73496c5ddc4Srjs}
73596c5ddc4Srjsvoid GLAPIENTRY
73696c5ddc4Srjs_mesa_marshal_VertexAttrib4Nusv(GLuint index, const GLushort * v)
73796c5ddc4Srjs{
73896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
73996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nusv);
74096c5ddc4Srjs   struct marshal_cmd_VertexAttrib4Nusv *cmd;
74196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nusv, cmd_size);
74296c5ddc4Srjs   cmd->index = index;
74396c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLushort));
74496c5ddc4Srjs}
74596c5ddc4Srjs
74696c5ddc4Srjs
74796c5ddc4Srjs/* VertexAttrib4bv: marshalled asynchronously */
74896c5ddc4Srjsstruct marshal_cmd_VertexAttrib4bv
74996c5ddc4Srjs{
75096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
75196c5ddc4Srjs   GLuint index;
75296c5ddc4Srjs   GLbyte v[4];
75396c5ddc4Srjs};
75496c5ddc4Srjsuint32_t
75596c5ddc4Srjs_mesa_unmarshal_VertexAttrib4bv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4bv *cmd, const uint64_t *last)
75696c5ddc4Srjs{
75796c5ddc4Srjs   GLuint index = cmd->index;
75896c5ddc4Srjs   const GLbyte * v = cmd->v;
75996c5ddc4Srjs   CALL_VertexAttrib4bv(ctx->CurrentServerDispatch, (index, v));
76096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4bv), 8) / 8);
76196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
76296c5ddc4Srjs   return cmd_size;
76396c5ddc4Srjs}
76496c5ddc4Srjsvoid GLAPIENTRY
76596c5ddc4Srjs_mesa_marshal_VertexAttrib4bv(GLuint index, const GLbyte * v)
76696c5ddc4Srjs{
76796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
76896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4bv);
76996c5ddc4Srjs   struct marshal_cmd_VertexAttrib4bv *cmd;
77096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4bv, cmd_size);
77196c5ddc4Srjs   cmd->index = index;
77296c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLbyte));
77396c5ddc4Srjs}
77496c5ddc4Srjs
77596c5ddc4Srjs
77696c5ddc4Srjs/* VertexAttrib4d: marshalled asynchronously */
77796c5ddc4Srjsstruct marshal_cmd_VertexAttrib4d
77896c5ddc4Srjs{
77996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
78096c5ddc4Srjs   GLuint index;
78196c5ddc4Srjs   GLdouble x;
78296c5ddc4Srjs   GLdouble y;
78396c5ddc4Srjs   GLdouble z;
78496c5ddc4Srjs   GLdouble w;
78596c5ddc4Srjs};
78696c5ddc4Srjsuint32_t
78796c5ddc4Srjs_mesa_unmarshal_VertexAttrib4d(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4d *cmd, const uint64_t *last)
78896c5ddc4Srjs{
78996c5ddc4Srjs   GLuint index = cmd->index;
79096c5ddc4Srjs   GLdouble x = cmd->x;
79196c5ddc4Srjs   GLdouble y = cmd->y;
79296c5ddc4Srjs   GLdouble z = cmd->z;
79396c5ddc4Srjs   GLdouble w = cmd->w;
79496c5ddc4Srjs   CALL_VertexAttrib4d(ctx->CurrentServerDispatch, (index, x, y, z, w));
79596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4d), 8) / 8);
79696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
79796c5ddc4Srjs   return cmd_size;
79896c5ddc4Srjs}
79996c5ddc4Srjsvoid GLAPIENTRY
80096c5ddc4Srjs_mesa_marshal_VertexAttrib4d(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
80196c5ddc4Srjs{
80296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
80396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4d);
80496c5ddc4Srjs   struct marshal_cmd_VertexAttrib4d *cmd;
80596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4d, cmd_size);
80696c5ddc4Srjs   cmd->index = index;
80796c5ddc4Srjs   cmd->x = x;
80896c5ddc4Srjs   cmd->y = y;
80996c5ddc4Srjs   cmd->z = z;
81096c5ddc4Srjs   cmd->w = w;
81196c5ddc4Srjs}
81296c5ddc4Srjs
81396c5ddc4Srjs
81496c5ddc4Srjs/* VertexAttrib4dv: marshalled asynchronously */
81596c5ddc4Srjsstruct marshal_cmd_VertexAttrib4dv
81696c5ddc4Srjs{
81796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
81896c5ddc4Srjs   GLuint index;
81996c5ddc4Srjs   GLdouble v[4];
82096c5ddc4Srjs};
82196c5ddc4Srjsuint32_t
82296c5ddc4Srjs_mesa_unmarshal_VertexAttrib4dv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4dv *cmd, const uint64_t *last)
82396c5ddc4Srjs{
82496c5ddc4Srjs   GLuint index = cmd->index;
82596c5ddc4Srjs   const GLdouble * v = cmd->v;
82696c5ddc4Srjs   CALL_VertexAttrib4dv(ctx->CurrentServerDispatch, (index, v));
82796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4dv), 8) / 8);
82896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
82996c5ddc4Srjs   return cmd_size;
83096c5ddc4Srjs}
83196c5ddc4Srjsvoid GLAPIENTRY
83296c5ddc4Srjs_mesa_marshal_VertexAttrib4dv(GLuint index, const GLdouble * v)
83396c5ddc4Srjs{
83496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
83596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4dv);
83696c5ddc4Srjs   struct marshal_cmd_VertexAttrib4dv *cmd;
83796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4dv, cmd_size);
83896c5ddc4Srjs   cmd->index = index;
83996c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLdouble));
84096c5ddc4Srjs}
84196c5ddc4Srjs
84296c5ddc4Srjs
84396c5ddc4Srjs/* VertexAttrib4fARB: marshalled asynchronously */
84496c5ddc4Srjsstruct marshal_cmd_VertexAttrib4fARB
84596c5ddc4Srjs{
84696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
84796c5ddc4Srjs   GLuint index;
84896c5ddc4Srjs   GLfloat x;
84996c5ddc4Srjs   GLfloat y;
85096c5ddc4Srjs   GLfloat z;
85196c5ddc4Srjs   GLfloat w;
85296c5ddc4Srjs};
85396c5ddc4Srjsuint32_t
85496c5ddc4Srjs_mesa_unmarshal_VertexAttrib4fARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4fARB *cmd, const uint64_t *last)
85596c5ddc4Srjs{
85696c5ddc4Srjs   GLuint index = cmd->index;
85796c5ddc4Srjs   GLfloat x = cmd->x;
85896c5ddc4Srjs   GLfloat y = cmd->y;
85996c5ddc4Srjs   GLfloat z = cmd->z;
86096c5ddc4Srjs   GLfloat w = cmd->w;
86196c5ddc4Srjs   CALL_VertexAttrib4fARB(ctx->CurrentServerDispatch, (index, x, y, z, w));
86296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4fARB), 8) / 8);
86396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
86496c5ddc4Srjs   return cmd_size;
86596c5ddc4Srjs}
86696c5ddc4Srjsvoid GLAPIENTRY
86796c5ddc4Srjs_mesa_marshal_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
86896c5ddc4Srjs{
86996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
87096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4fARB);
87196c5ddc4Srjs   struct marshal_cmd_VertexAttrib4fARB *cmd;
87296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4fARB, cmd_size);
87396c5ddc4Srjs   cmd->index = index;
87496c5ddc4Srjs   cmd->x = x;
87596c5ddc4Srjs   cmd->y = y;
87696c5ddc4Srjs   cmd->z = z;
87796c5ddc4Srjs   cmd->w = w;
87896c5ddc4Srjs}
87996c5ddc4Srjs
88096c5ddc4Srjs
88196c5ddc4Srjs/* VertexAttrib4fvARB: marshalled asynchronously */
88296c5ddc4Srjsstruct marshal_cmd_VertexAttrib4fvARB
88396c5ddc4Srjs{
88496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
88596c5ddc4Srjs   GLuint index;
88696c5ddc4Srjs   GLfloat v[4];
88796c5ddc4Srjs};
88896c5ddc4Srjsuint32_t
88996c5ddc4Srjs_mesa_unmarshal_VertexAttrib4fvARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4fvARB *cmd, const uint64_t *last)
89096c5ddc4Srjs{
89196c5ddc4Srjs   GLuint index = cmd->index;
89296c5ddc4Srjs   const GLfloat * v = cmd->v;
89396c5ddc4Srjs   CALL_VertexAttrib4fvARB(ctx->CurrentServerDispatch, (index, v));
89496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4fvARB), 8) / 8);
89596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
89696c5ddc4Srjs   return cmd_size;
89796c5ddc4Srjs}
89896c5ddc4Srjsvoid GLAPIENTRY
89996c5ddc4Srjs_mesa_marshal_VertexAttrib4fvARB(GLuint index, const GLfloat * v)
90096c5ddc4Srjs{
90196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
90296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4fvARB);
90396c5ddc4Srjs   struct marshal_cmd_VertexAttrib4fvARB *cmd;
90496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4fvARB, cmd_size);
90596c5ddc4Srjs   cmd->index = index;
90696c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLfloat));
90796c5ddc4Srjs}
90896c5ddc4Srjs
90996c5ddc4Srjs
91096c5ddc4Srjs/* VertexAttrib4iv: marshalled asynchronously */
91196c5ddc4Srjsstruct marshal_cmd_VertexAttrib4iv
91296c5ddc4Srjs{
91396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
91496c5ddc4Srjs   GLuint index;
91596c5ddc4Srjs   GLint v[4];
91696c5ddc4Srjs};
91796c5ddc4Srjsuint32_t
91896c5ddc4Srjs_mesa_unmarshal_VertexAttrib4iv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4iv *cmd, const uint64_t *last)
91996c5ddc4Srjs{
92096c5ddc4Srjs   GLuint index = cmd->index;
92196c5ddc4Srjs   const GLint * v = cmd->v;
92296c5ddc4Srjs   CALL_VertexAttrib4iv(ctx->CurrentServerDispatch, (index, v));
92396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4iv), 8) / 8);
92496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
92596c5ddc4Srjs   return cmd_size;
92696c5ddc4Srjs}
92796c5ddc4Srjsvoid GLAPIENTRY
92896c5ddc4Srjs_mesa_marshal_VertexAttrib4iv(GLuint index, const GLint * v)
92996c5ddc4Srjs{
93096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
93196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4iv);
93296c5ddc4Srjs   struct marshal_cmd_VertexAttrib4iv *cmd;
93396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4iv, cmd_size);
93496c5ddc4Srjs   cmd->index = index;
93596c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLint));
93696c5ddc4Srjs}
93796c5ddc4Srjs
93896c5ddc4Srjs
93996c5ddc4Srjs/* VertexAttrib4s: marshalled asynchronously */
94096c5ddc4Srjsstruct marshal_cmd_VertexAttrib4s
94196c5ddc4Srjs{
94296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
94396c5ddc4Srjs   GLshort x;
94496c5ddc4Srjs   GLshort y;
94596c5ddc4Srjs   GLshort z;
94696c5ddc4Srjs   GLshort w;
94796c5ddc4Srjs   GLuint index;
94896c5ddc4Srjs};
94996c5ddc4Srjsuint32_t
95096c5ddc4Srjs_mesa_unmarshal_VertexAttrib4s(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4s *cmd, const uint64_t *last)
95196c5ddc4Srjs{
95296c5ddc4Srjs   GLuint index = cmd->index;
95396c5ddc4Srjs   GLshort x = cmd->x;
95496c5ddc4Srjs   GLshort y = cmd->y;
95596c5ddc4Srjs   GLshort z = cmd->z;
95696c5ddc4Srjs   GLshort w = cmd->w;
95796c5ddc4Srjs   CALL_VertexAttrib4s(ctx->CurrentServerDispatch, (index, x, y, z, w));
95896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4s), 8) / 8);
95996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
96096c5ddc4Srjs   return cmd_size;
96196c5ddc4Srjs}
96296c5ddc4Srjsvoid GLAPIENTRY
96396c5ddc4Srjs_mesa_marshal_VertexAttrib4s(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
96496c5ddc4Srjs{
96596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
96696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4s);
96796c5ddc4Srjs   struct marshal_cmd_VertexAttrib4s *cmd;
96896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4s, cmd_size);
96996c5ddc4Srjs   cmd->index = index;
97096c5ddc4Srjs   cmd->x = x;
97196c5ddc4Srjs   cmd->y = y;
97296c5ddc4Srjs   cmd->z = z;
97396c5ddc4Srjs   cmd->w = w;
97496c5ddc4Srjs}
97596c5ddc4Srjs
97696c5ddc4Srjs
97796c5ddc4Srjs/* VertexAttrib4sv: marshalled asynchronously */
97896c5ddc4Srjsstruct marshal_cmd_VertexAttrib4sv
97996c5ddc4Srjs{
98096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
98196c5ddc4Srjs   GLuint index;
98296c5ddc4Srjs   GLshort v[4];
98396c5ddc4Srjs};
98496c5ddc4Srjsuint32_t
98596c5ddc4Srjs_mesa_unmarshal_VertexAttrib4sv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4sv *cmd, const uint64_t *last)
98696c5ddc4Srjs{
98796c5ddc4Srjs   GLuint index = cmd->index;
98896c5ddc4Srjs   const GLshort * v = cmd->v;
98996c5ddc4Srjs   CALL_VertexAttrib4sv(ctx->CurrentServerDispatch, (index, v));
99096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4sv), 8) / 8);
99196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
99296c5ddc4Srjs   return cmd_size;
99396c5ddc4Srjs}
99496c5ddc4Srjsvoid GLAPIENTRY
99596c5ddc4Srjs_mesa_marshal_VertexAttrib4sv(GLuint index, const GLshort * v)
99696c5ddc4Srjs{
99796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
99896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4sv);
99996c5ddc4Srjs   struct marshal_cmd_VertexAttrib4sv *cmd;
100096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4sv, cmd_size);
100196c5ddc4Srjs   cmd->index = index;
100296c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLshort));
100396c5ddc4Srjs}
100496c5ddc4Srjs
100596c5ddc4Srjs
100696c5ddc4Srjs/* VertexAttrib4ubv: marshalled asynchronously */
100796c5ddc4Srjsstruct marshal_cmd_VertexAttrib4ubv
100896c5ddc4Srjs{
100996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
101096c5ddc4Srjs   GLuint index;
101196c5ddc4Srjs   GLubyte v[4];
101296c5ddc4Srjs};
101396c5ddc4Srjsuint32_t
101496c5ddc4Srjs_mesa_unmarshal_VertexAttrib4ubv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4ubv *cmd, const uint64_t *last)
101596c5ddc4Srjs{
101696c5ddc4Srjs   GLuint index = cmd->index;
101796c5ddc4Srjs   const GLubyte * v = cmd->v;
101896c5ddc4Srjs   CALL_VertexAttrib4ubv(ctx->CurrentServerDispatch, (index, v));
101996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4ubv), 8) / 8);
102096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
102196c5ddc4Srjs   return cmd_size;
102296c5ddc4Srjs}
102396c5ddc4Srjsvoid GLAPIENTRY
102496c5ddc4Srjs_mesa_marshal_VertexAttrib4ubv(GLuint index, const GLubyte * v)
102596c5ddc4Srjs{
102696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
102796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4ubv);
102896c5ddc4Srjs   struct marshal_cmd_VertexAttrib4ubv *cmd;
102996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4ubv, cmd_size);
103096c5ddc4Srjs   cmd->index = index;
103196c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLubyte));
103296c5ddc4Srjs}
103396c5ddc4Srjs
103496c5ddc4Srjs
103596c5ddc4Srjs/* VertexAttrib4uiv: marshalled asynchronously */
103696c5ddc4Srjsstruct marshal_cmd_VertexAttrib4uiv
103796c5ddc4Srjs{
103896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
103996c5ddc4Srjs   GLuint index;
104096c5ddc4Srjs   GLuint v[4];
104196c5ddc4Srjs};
104296c5ddc4Srjsuint32_t
104396c5ddc4Srjs_mesa_unmarshal_VertexAttrib4uiv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4uiv *cmd, const uint64_t *last)
104496c5ddc4Srjs{
104596c5ddc4Srjs   GLuint index = cmd->index;
104696c5ddc4Srjs   const GLuint * v = cmd->v;
104796c5ddc4Srjs   CALL_VertexAttrib4uiv(ctx->CurrentServerDispatch, (index, v));
104896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4uiv), 8) / 8);
104996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
105096c5ddc4Srjs   return cmd_size;
105196c5ddc4Srjs}
105296c5ddc4Srjsvoid GLAPIENTRY
105396c5ddc4Srjs_mesa_marshal_VertexAttrib4uiv(GLuint index, const GLuint * v)
105496c5ddc4Srjs{
105596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
105696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4uiv);
105796c5ddc4Srjs   struct marshal_cmd_VertexAttrib4uiv *cmd;
105896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4uiv, cmd_size);
105996c5ddc4Srjs   cmd->index = index;
106096c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLuint));
106196c5ddc4Srjs}
106296c5ddc4Srjs
106396c5ddc4Srjs
106496c5ddc4Srjs/* VertexAttrib4usv: marshalled asynchronously */
106596c5ddc4Srjsstruct marshal_cmd_VertexAttrib4usv
106696c5ddc4Srjs{
106796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
106896c5ddc4Srjs   GLuint index;
106996c5ddc4Srjs   GLushort v[4];
107096c5ddc4Srjs};
107196c5ddc4Srjsuint32_t
107296c5ddc4Srjs_mesa_unmarshal_VertexAttrib4usv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4usv *cmd, const uint64_t *last)
107396c5ddc4Srjs{
107496c5ddc4Srjs   GLuint index = cmd->index;
107596c5ddc4Srjs   const GLushort * v = cmd->v;
107696c5ddc4Srjs   CALL_VertexAttrib4usv(ctx->CurrentServerDispatch, (index, v));
107796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4usv), 8) / 8);
107896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
107996c5ddc4Srjs   return cmd_size;
108096c5ddc4Srjs}
108196c5ddc4Srjsvoid GLAPIENTRY
108296c5ddc4Srjs_mesa_marshal_VertexAttrib4usv(GLuint index, const GLushort * v)
108396c5ddc4Srjs{
108496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
108596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4usv);
108696c5ddc4Srjs   struct marshal_cmd_VertexAttrib4usv *cmd;
108796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4usv, cmd_size);
108896c5ddc4Srjs   cmd->index = index;
108996c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLushort));
109096c5ddc4Srjs}
109196c5ddc4Srjs
109296c5ddc4Srjs
109396c5ddc4Srjs/* VertexAttribPointer: marshalled asynchronously */
109496c5ddc4Srjsstruct marshal_cmd_VertexAttribPointer
109596c5ddc4Srjs{
109696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
109796c5ddc4Srjs   GLboolean normalized;
109896c5ddc4Srjs   GLuint index;
109996c5ddc4Srjs   GLint size;
110096c5ddc4Srjs   GLenum type;
110196c5ddc4Srjs   GLsizei stride;
110296c5ddc4Srjs   const GLvoid * pointer;
110396c5ddc4Srjs};
110496c5ddc4Srjsuint32_t
110596c5ddc4Srjs_mesa_unmarshal_VertexAttribPointer(struct gl_context *ctx, const struct marshal_cmd_VertexAttribPointer *cmd, const uint64_t *last)
110696c5ddc4Srjs{
110796c5ddc4Srjs   GLuint index = cmd->index;
110896c5ddc4Srjs   GLint size = cmd->size;
110996c5ddc4Srjs   GLenum type = cmd->type;
111096c5ddc4Srjs   GLboolean normalized = cmd->normalized;
111196c5ddc4Srjs   GLsizei stride = cmd->stride;
111296c5ddc4Srjs   const GLvoid * pointer = cmd->pointer;
111396c5ddc4Srjs   CALL_VertexAttribPointer(ctx->CurrentServerDispatch, (index, size, type, normalized, stride, pointer));
111496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribPointer), 8) / 8);
111596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
111696c5ddc4Srjs   return cmd_size;
111796c5ddc4Srjs}
111896c5ddc4Srjsvoid GLAPIENTRY
111996c5ddc4Srjs_mesa_marshal_VertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer)
112096c5ddc4Srjs{
112196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
112296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribPointer);
112396c5ddc4Srjs   struct marshal_cmd_VertexAttribPointer *cmd;
112496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribPointer, cmd_size);
112596c5ddc4Srjs   cmd->index = index;
112696c5ddc4Srjs   cmd->size = size;
112796c5ddc4Srjs   cmd->type = type;
112896c5ddc4Srjs   cmd->normalized = normalized;
112996c5ddc4Srjs   cmd->stride = stride;
113096c5ddc4Srjs   cmd->pointer = pointer;
113196c5ddc4Srjs   if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_GENERIC(index), size, type, stride, pointer);
113296c5ddc4Srjs}
113396c5ddc4Srjs
113496c5ddc4Srjs
113596c5ddc4Srjs/* UniformMatrix2x3fv: marshalled asynchronously */
113696c5ddc4Srjsstruct marshal_cmd_UniformMatrix2x3fv
113796c5ddc4Srjs{
113896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
113996c5ddc4Srjs   GLboolean transpose;
114096c5ddc4Srjs   GLint location;
114196c5ddc4Srjs   GLsizei count;
114296c5ddc4Srjs   /* Next safe_mul(count, 6 * sizeof(GLfloat)) bytes are GLfloat value[count][6] */
114396c5ddc4Srjs};
114496c5ddc4Srjsuint32_t
114596c5ddc4Srjs_mesa_unmarshal_UniformMatrix2x3fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2x3fv *cmd, const uint64_t *last)
114696c5ddc4Srjs{
114796c5ddc4Srjs   GLint location = cmd->location;
114896c5ddc4Srjs   GLsizei count = cmd->count;
114996c5ddc4Srjs   GLboolean transpose = cmd->transpose;
115096c5ddc4Srjs   GLfloat * value;
115196c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
115296c5ddc4Srjs   value = (GLfloat *) variable_data;
115396c5ddc4Srjs   CALL_UniformMatrix2x3fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
115496c5ddc4Srjs   return cmd->cmd_base.cmd_size;
115596c5ddc4Srjs}
115696c5ddc4Srjsvoid GLAPIENTRY
115796c5ddc4Srjs_mesa_marshal_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
115896c5ddc4Srjs{
115996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
116096c5ddc4Srjs   int value_size = safe_mul(count, 6 * sizeof(GLfloat));
116196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix2x3fv) + value_size;
116296c5ddc4Srjs   struct marshal_cmd_UniformMatrix2x3fv *cmd;
116396c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
116496c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix2x3fv");
116596c5ddc4Srjs      CALL_UniformMatrix2x3fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
116696c5ddc4Srjs      return;
116796c5ddc4Srjs   }
116896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2x3fv, cmd_size);
116996c5ddc4Srjs   cmd->location = location;
117096c5ddc4Srjs   cmd->count = count;
117196c5ddc4Srjs   cmd->transpose = transpose;
117296c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
117396c5ddc4Srjs   memcpy(variable_data, value, value_size);
117496c5ddc4Srjs}
117596c5ddc4Srjs
117696c5ddc4Srjs
117796c5ddc4Srjs/* UniformMatrix3x2fv: marshalled asynchronously */
117896c5ddc4Srjsstruct marshal_cmd_UniformMatrix3x2fv
117996c5ddc4Srjs{
118096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
118196c5ddc4Srjs   GLboolean transpose;
118296c5ddc4Srjs   GLint location;
118396c5ddc4Srjs   GLsizei count;
118496c5ddc4Srjs   /* Next safe_mul(count, 6 * sizeof(GLfloat)) bytes are GLfloat value[count][6] */
118596c5ddc4Srjs};
118696c5ddc4Srjsuint32_t
118796c5ddc4Srjs_mesa_unmarshal_UniformMatrix3x2fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3x2fv *cmd, const uint64_t *last)
118896c5ddc4Srjs{
118996c5ddc4Srjs   GLint location = cmd->location;
119096c5ddc4Srjs   GLsizei count = cmd->count;
119196c5ddc4Srjs   GLboolean transpose = cmd->transpose;
119296c5ddc4Srjs   GLfloat * value;
119396c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
119496c5ddc4Srjs   value = (GLfloat *) variable_data;
119596c5ddc4Srjs   CALL_UniformMatrix3x2fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
119696c5ddc4Srjs   return cmd->cmd_base.cmd_size;
119796c5ddc4Srjs}
119896c5ddc4Srjsvoid GLAPIENTRY
119996c5ddc4Srjs_mesa_marshal_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
120096c5ddc4Srjs{
120196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
120296c5ddc4Srjs   int value_size = safe_mul(count, 6 * sizeof(GLfloat));
120396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix3x2fv) + value_size;
120496c5ddc4Srjs   struct marshal_cmd_UniformMatrix3x2fv *cmd;
120596c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
120696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix3x2fv");
120796c5ddc4Srjs      CALL_UniformMatrix3x2fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
120896c5ddc4Srjs      return;
120996c5ddc4Srjs   }
121096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3x2fv, cmd_size);
121196c5ddc4Srjs   cmd->location = location;
121296c5ddc4Srjs   cmd->count = count;
121396c5ddc4Srjs   cmd->transpose = transpose;
121496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
121596c5ddc4Srjs   memcpy(variable_data, value, value_size);
121696c5ddc4Srjs}
121796c5ddc4Srjs
121896c5ddc4Srjs
121996c5ddc4Srjs/* UniformMatrix2x4fv: marshalled asynchronously */
122096c5ddc4Srjsstruct marshal_cmd_UniformMatrix2x4fv
122196c5ddc4Srjs{
122296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
122396c5ddc4Srjs   GLboolean transpose;
122496c5ddc4Srjs   GLint location;
122596c5ddc4Srjs   GLsizei count;
122696c5ddc4Srjs   /* Next safe_mul(count, 8 * sizeof(GLfloat)) bytes are GLfloat value[count][8] */
122796c5ddc4Srjs};
122896c5ddc4Srjsuint32_t
122996c5ddc4Srjs_mesa_unmarshal_UniformMatrix2x4fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2x4fv *cmd, const uint64_t *last)
123096c5ddc4Srjs{
123196c5ddc4Srjs   GLint location = cmd->location;
123296c5ddc4Srjs   GLsizei count = cmd->count;
123396c5ddc4Srjs   GLboolean transpose = cmd->transpose;
123496c5ddc4Srjs   GLfloat * value;
123596c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
123696c5ddc4Srjs   value = (GLfloat *) variable_data;
123796c5ddc4Srjs   CALL_UniformMatrix2x4fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
123896c5ddc4Srjs   return cmd->cmd_base.cmd_size;
123996c5ddc4Srjs}
124096c5ddc4Srjsvoid GLAPIENTRY
124196c5ddc4Srjs_mesa_marshal_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
124296c5ddc4Srjs{
124396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
124496c5ddc4Srjs   int value_size = safe_mul(count, 8 * sizeof(GLfloat));
124596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix2x4fv) + value_size;
124696c5ddc4Srjs   struct marshal_cmd_UniformMatrix2x4fv *cmd;
124796c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
124896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix2x4fv");
124996c5ddc4Srjs      CALL_UniformMatrix2x4fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
125096c5ddc4Srjs      return;
125196c5ddc4Srjs   }
125296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2x4fv, cmd_size);
125396c5ddc4Srjs   cmd->location = location;
125496c5ddc4Srjs   cmd->count = count;
125596c5ddc4Srjs   cmd->transpose = transpose;
125696c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
125796c5ddc4Srjs   memcpy(variable_data, value, value_size);
125896c5ddc4Srjs}
125996c5ddc4Srjs
126096c5ddc4Srjs
126196c5ddc4Srjs/* UniformMatrix4x2fv: marshalled asynchronously */
126296c5ddc4Srjsstruct marshal_cmd_UniformMatrix4x2fv
126396c5ddc4Srjs{
126496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
126596c5ddc4Srjs   GLboolean transpose;
126696c5ddc4Srjs   GLint location;
126796c5ddc4Srjs   GLsizei count;
126896c5ddc4Srjs   /* Next safe_mul(count, 8 * sizeof(GLfloat)) bytes are GLfloat value[count][8] */
126996c5ddc4Srjs};
127096c5ddc4Srjsuint32_t
127196c5ddc4Srjs_mesa_unmarshal_UniformMatrix4x2fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4x2fv *cmd, const uint64_t *last)
127296c5ddc4Srjs{
127396c5ddc4Srjs   GLint location = cmd->location;
127496c5ddc4Srjs   GLsizei count = cmd->count;
127596c5ddc4Srjs   GLboolean transpose = cmd->transpose;
127696c5ddc4Srjs   GLfloat * value;
127796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
127896c5ddc4Srjs   value = (GLfloat *) variable_data;
127996c5ddc4Srjs   CALL_UniformMatrix4x2fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
128096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
128196c5ddc4Srjs}
128296c5ddc4Srjsvoid GLAPIENTRY
128396c5ddc4Srjs_mesa_marshal_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
128496c5ddc4Srjs{
128596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
128696c5ddc4Srjs   int value_size = safe_mul(count, 8 * sizeof(GLfloat));
128796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix4x2fv) + value_size;
128896c5ddc4Srjs   struct marshal_cmd_UniformMatrix4x2fv *cmd;
128996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
129096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix4x2fv");
129196c5ddc4Srjs      CALL_UniformMatrix4x2fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
129296c5ddc4Srjs      return;
129396c5ddc4Srjs   }
129496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4x2fv, cmd_size);
129596c5ddc4Srjs   cmd->location = location;
129696c5ddc4Srjs   cmd->count = count;
129796c5ddc4Srjs   cmd->transpose = transpose;
129896c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
129996c5ddc4Srjs   memcpy(variable_data, value, value_size);
130096c5ddc4Srjs}
130196c5ddc4Srjs
130296c5ddc4Srjs
130396c5ddc4Srjs/* UniformMatrix3x4fv: marshalled asynchronously */
130496c5ddc4Srjsstruct marshal_cmd_UniformMatrix3x4fv
130596c5ddc4Srjs{
130696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
130796c5ddc4Srjs   GLboolean transpose;
130896c5ddc4Srjs   GLint location;
130996c5ddc4Srjs   GLsizei count;
131096c5ddc4Srjs   /* Next safe_mul(count, 12 * sizeof(GLfloat)) bytes are GLfloat value[count][12] */
131196c5ddc4Srjs};
131296c5ddc4Srjsuint32_t
131396c5ddc4Srjs_mesa_unmarshal_UniformMatrix3x4fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3x4fv *cmd, const uint64_t *last)
131496c5ddc4Srjs{
131596c5ddc4Srjs   GLint location = cmd->location;
131696c5ddc4Srjs   GLsizei count = cmd->count;
131796c5ddc4Srjs   GLboolean transpose = cmd->transpose;
131896c5ddc4Srjs   GLfloat * value;
131996c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
132096c5ddc4Srjs   value = (GLfloat *) variable_data;
132196c5ddc4Srjs   CALL_UniformMatrix3x4fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
132296c5ddc4Srjs   return cmd->cmd_base.cmd_size;
132396c5ddc4Srjs}
132496c5ddc4Srjsvoid GLAPIENTRY
132596c5ddc4Srjs_mesa_marshal_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
132696c5ddc4Srjs{
132796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
132896c5ddc4Srjs   int value_size = safe_mul(count, 12 * sizeof(GLfloat));
132996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix3x4fv) + value_size;
133096c5ddc4Srjs   struct marshal_cmd_UniformMatrix3x4fv *cmd;
133196c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
133296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix3x4fv");
133396c5ddc4Srjs      CALL_UniformMatrix3x4fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
133496c5ddc4Srjs      return;
133596c5ddc4Srjs   }
133696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3x4fv, cmd_size);
133796c5ddc4Srjs   cmd->location = location;
133896c5ddc4Srjs   cmd->count = count;
133996c5ddc4Srjs   cmd->transpose = transpose;
134096c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
134196c5ddc4Srjs   memcpy(variable_data, value, value_size);
134296c5ddc4Srjs}
134396c5ddc4Srjs
134496c5ddc4Srjs
134596c5ddc4Srjs/* UniformMatrix4x3fv: marshalled asynchronously */
134696c5ddc4Srjsstruct marshal_cmd_UniformMatrix4x3fv
134796c5ddc4Srjs{
134896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
134996c5ddc4Srjs   GLboolean transpose;
135096c5ddc4Srjs   GLint location;
135196c5ddc4Srjs   GLsizei count;
135296c5ddc4Srjs   /* Next safe_mul(count, 12 * sizeof(GLfloat)) bytes are GLfloat value[count][12] */
135396c5ddc4Srjs};
135496c5ddc4Srjsuint32_t
135596c5ddc4Srjs_mesa_unmarshal_UniformMatrix4x3fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4x3fv *cmd, const uint64_t *last)
135696c5ddc4Srjs{
135796c5ddc4Srjs   GLint location = cmd->location;
135896c5ddc4Srjs   GLsizei count = cmd->count;
135996c5ddc4Srjs   GLboolean transpose = cmd->transpose;
136096c5ddc4Srjs   GLfloat * value;
136196c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
136296c5ddc4Srjs   value = (GLfloat *) variable_data;
136396c5ddc4Srjs   CALL_UniformMatrix4x3fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
136496c5ddc4Srjs   return cmd->cmd_base.cmd_size;
136596c5ddc4Srjs}
136696c5ddc4Srjsvoid GLAPIENTRY
136796c5ddc4Srjs_mesa_marshal_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
136896c5ddc4Srjs{
136996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
137096c5ddc4Srjs   int value_size = safe_mul(count, 12 * sizeof(GLfloat));
137196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix4x3fv) + value_size;
137296c5ddc4Srjs   struct marshal_cmd_UniformMatrix4x3fv *cmd;
137396c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
137496c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix4x3fv");
137596c5ddc4Srjs      CALL_UniformMatrix4x3fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
137696c5ddc4Srjs      return;
137796c5ddc4Srjs   }
137896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4x3fv, cmd_size);
137996c5ddc4Srjs   cmd->location = location;
138096c5ddc4Srjs   cmd->count = count;
138196c5ddc4Srjs   cmd->transpose = transpose;
138296c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
138396c5ddc4Srjs   memcpy(variable_data, value, value_size);
138496c5ddc4Srjs}
138596c5ddc4Srjs
138696c5ddc4Srjs
138796c5ddc4Srjs/* ProgramStringARB: marshalled asynchronously */
138896c5ddc4Srjsstruct marshal_cmd_ProgramStringARB
138996c5ddc4Srjs{
139096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
139196c5ddc4Srjs   GLenum target;
139296c5ddc4Srjs   GLenum format;
139396c5ddc4Srjs   GLsizei len;
139496c5ddc4Srjs   /* Next len bytes are GLvoid string[len] */
139596c5ddc4Srjs};
139696c5ddc4Srjsuint32_t
139796c5ddc4Srjs_mesa_unmarshal_ProgramStringARB(struct gl_context *ctx, const struct marshal_cmd_ProgramStringARB *cmd, const uint64_t *last)
139896c5ddc4Srjs{
139996c5ddc4Srjs   GLenum target = cmd->target;
140096c5ddc4Srjs   GLenum format = cmd->format;
140196c5ddc4Srjs   GLsizei len = cmd->len;
140296c5ddc4Srjs   GLvoid * string;
140396c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
140496c5ddc4Srjs   string = (GLvoid *) variable_data;
140596c5ddc4Srjs   CALL_ProgramStringARB(ctx->CurrentServerDispatch, (target, format, len, string));
140696c5ddc4Srjs   return cmd->cmd_base.cmd_size;
140796c5ddc4Srjs}
140896c5ddc4Srjsvoid GLAPIENTRY
140996c5ddc4Srjs_mesa_marshal_ProgramStringARB(GLenum target, GLenum format, GLsizei len, const GLvoid * string)
141096c5ddc4Srjs{
141196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
141296c5ddc4Srjs   int string_size = len;
141396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramStringARB) + string_size;
141496c5ddc4Srjs   struct marshal_cmd_ProgramStringARB *cmd;
141596c5ddc4Srjs   if (unlikely(string_size < 0 || (string_size > 0 && !string) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
141696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramStringARB");
141796c5ddc4Srjs      CALL_ProgramStringARB(ctx->CurrentServerDispatch, (target, format, len, string));
141896c5ddc4Srjs      return;
141996c5ddc4Srjs   }
142096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramStringARB, cmd_size);
142196c5ddc4Srjs   cmd->target = target;
142296c5ddc4Srjs   cmd->format = format;
142396c5ddc4Srjs   cmd->len = len;
142496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
142596c5ddc4Srjs   memcpy(variable_data, string, string_size);
142696c5ddc4Srjs}
142796c5ddc4Srjs
142896c5ddc4Srjs
142996c5ddc4Srjs/* BindProgramARB: marshalled asynchronously */
143096c5ddc4Srjsstruct marshal_cmd_BindProgramARB
143196c5ddc4Srjs{
143296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
143396c5ddc4Srjs   GLenum target;
143496c5ddc4Srjs   GLuint program;
143596c5ddc4Srjs};
143696c5ddc4Srjsuint32_t
143796c5ddc4Srjs_mesa_unmarshal_BindProgramARB(struct gl_context *ctx, const struct marshal_cmd_BindProgramARB *cmd, const uint64_t *last)
143896c5ddc4Srjs{
143996c5ddc4Srjs   GLenum target = cmd->target;
144096c5ddc4Srjs   GLuint program = cmd->program;
144196c5ddc4Srjs   CALL_BindProgramARB(ctx->CurrentServerDispatch, (target, program));
144296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindProgramARB), 8) / 8);
144396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
144496c5ddc4Srjs   return cmd_size;
144596c5ddc4Srjs}
144696c5ddc4Srjsvoid GLAPIENTRY
144796c5ddc4Srjs_mesa_marshal_BindProgramARB(GLenum target, GLuint program)
144896c5ddc4Srjs{
144996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
145096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindProgramARB);
145196c5ddc4Srjs   struct marshal_cmd_BindProgramARB *cmd;
145296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindProgramARB, cmd_size);
145396c5ddc4Srjs   cmd->target = target;
145496c5ddc4Srjs   cmd->program = program;
145596c5ddc4Srjs}
145696c5ddc4Srjs
145796c5ddc4Srjs
145896c5ddc4Srjs/* DeleteProgramsARB: marshalled asynchronously */
145996c5ddc4Srjsstruct marshal_cmd_DeleteProgramsARB
146096c5ddc4Srjs{
146196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
146296c5ddc4Srjs   GLsizei n;
146396c5ddc4Srjs   /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint programs[n] */
146496c5ddc4Srjs};
146596c5ddc4Srjsuint32_t
146696c5ddc4Srjs_mesa_unmarshal_DeleteProgramsARB(struct gl_context *ctx, const struct marshal_cmd_DeleteProgramsARB *cmd, const uint64_t *last)
146796c5ddc4Srjs{
146896c5ddc4Srjs   GLsizei n = cmd->n;
146996c5ddc4Srjs   GLuint * programs;
147096c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
147196c5ddc4Srjs   programs = (GLuint *) variable_data;
147296c5ddc4Srjs   CALL_DeleteProgramsARB(ctx->CurrentServerDispatch, (n, programs));
147396c5ddc4Srjs   return cmd->cmd_base.cmd_size;
147496c5ddc4Srjs}
147596c5ddc4Srjsvoid GLAPIENTRY
147696c5ddc4Srjs_mesa_marshal_DeleteProgramsARB(GLsizei n, const GLuint * programs)
147796c5ddc4Srjs{
147896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
147996c5ddc4Srjs   int programs_size = safe_mul(n, 1 * sizeof(GLuint));
148096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DeleteProgramsARB) + programs_size;
148196c5ddc4Srjs   struct marshal_cmd_DeleteProgramsARB *cmd;
148296c5ddc4Srjs   if (unlikely(programs_size < 0 || (programs_size > 0 && !programs) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
148396c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "DeleteProgramsARB");
148496c5ddc4Srjs      CALL_DeleteProgramsARB(ctx->CurrentServerDispatch, (n, programs));
148596c5ddc4Srjs      return;
148696c5ddc4Srjs   }
148796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteProgramsARB, cmd_size);
148896c5ddc4Srjs   cmd->n = n;
148996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
149096c5ddc4Srjs   memcpy(variable_data, programs, programs_size);
149196c5ddc4Srjs}
149296c5ddc4Srjs
149396c5ddc4Srjs
149496c5ddc4Srjs/* GenProgramsARB: marshalled synchronously */
149596c5ddc4Srjsvoid GLAPIENTRY
149696c5ddc4Srjs_mesa_marshal_GenProgramsARB(GLsizei n, GLuint * programs)
149796c5ddc4Srjs{
149896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
149996c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GenProgramsARB");
150096c5ddc4Srjs   CALL_GenProgramsARB(ctx->CurrentServerDispatch, (n, programs));
150196c5ddc4Srjs}
150296c5ddc4Srjs
150396c5ddc4Srjs
150496c5ddc4Srjs/* IsProgramARB: marshalled synchronously */
150596c5ddc4SrjsGLboolean GLAPIENTRY
150696c5ddc4Srjs_mesa_marshal_IsProgramARB(GLuint program)
150796c5ddc4Srjs{
150896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
150996c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsProgramARB");
151096c5ddc4Srjs   return CALL_IsProgramARB(ctx->CurrentServerDispatch, (program));
151196c5ddc4Srjs}
151296c5ddc4Srjs
151396c5ddc4Srjs
151496c5ddc4Srjs/* ProgramEnvParameter4dARB: marshalled asynchronously */
151596c5ddc4Srjsstruct marshal_cmd_ProgramEnvParameter4dARB
151696c5ddc4Srjs{
151796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
151896c5ddc4Srjs   GLenum target;
151996c5ddc4Srjs   GLuint index;
152096c5ddc4Srjs   GLdouble x;
152196c5ddc4Srjs   GLdouble y;
152296c5ddc4Srjs   GLdouble z;
152396c5ddc4Srjs   GLdouble w;
152496c5ddc4Srjs};
152596c5ddc4Srjsuint32_t
152696c5ddc4Srjs_mesa_unmarshal_ProgramEnvParameter4dARB(struct gl_context *ctx, const struct marshal_cmd_ProgramEnvParameter4dARB *cmd, const uint64_t *last)
152796c5ddc4Srjs{
152896c5ddc4Srjs   GLenum target = cmd->target;
152996c5ddc4Srjs   GLuint index = cmd->index;
153096c5ddc4Srjs   GLdouble x = cmd->x;
153196c5ddc4Srjs   GLdouble y = cmd->y;
153296c5ddc4Srjs   GLdouble z = cmd->z;
153396c5ddc4Srjs   GLdouble w = cmd->w;
153496c5ddc4Srjs   CALL_ProgramEnvParameter4dARB(ctx->CurrentServerDispatch, (target, index, x, y, z, w));
153596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramEnvParameter4dARB), 8) / 8);
153696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
153796c5ddc4Srjs   return cmd_size;
153896c5ddc4Srjs}
153996c5ddc4Srjsvoid GLAPIENTRY
154096c5ddc4Srjs_mesa_marshal_ProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
154196c5ddc4Srjs{
154296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
154396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramEnvParameter4dARB);
154496c5ddc4Srjs   struct marshal_cmd_ProgramEnvParameter4dARB *cmd;
154596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramEnvParameter4dARB, cmd_size);
154696c5ddc4Srjs   cmd->target = target;
154796c5ddc4Srjs   cmd->index = index;
154896c5ddc4Srjs   cmd->x = x;
154996c5ddc4Srjs   cmd->y = y;
155096c5ddc4Srjs   cmd->z = z;
155196c5ddc4Srjs   cmd->w = w;
155296c5ddc4Srjs}
155396c5ddc4Srjs
155496c5ddc4Srjs
155596c5ddc4Srjs/* ProgramEnvParameter4dvARB: marshalled asynchronously */
155696c5ddc4Srjsstruct marshal_cmd_ProgramEnvParameter4dvARB
155796c5ddc4Srjs{
155896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
155996c5ddc4Srjs   GLenum target;
156096c5ddc4Srjs   GLuint index;
156196c5ddc4Srjs   GLdouble params[4];
156296c5ddc4Srjs};
156396c5ddc4Srjsuint32_t
156496c5ddc4Srjs_mesa_unmarshal_ProgramEnvParameter4dvARB(struct gl_context *ctx, const struct marshal_cmd_ProgramEnvParameter4dvARB *cmd, const uint64_t *last)
156596c5ddc4Srjs{
156696c5ddc4Srjs   GLenum target = cmd->target;
156796c5ddc4Srjs   GLuint index = cmd->index;
156896c5ddc4Srjs   const GLdouble * params = cmd->params;
156996c5ddc4Srjs   CALL_ProgramEnvParameter4dvARB(ctx->CurrentServerDispatch, (target, index, params));
157096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramEnvParameter4dvARB), 8) / 8);
157196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
157296c5ddc4Srjs   return cmd_size;
157396c5ddc4Srjs}
157496c5ddc4Srjsvoid GLAPIENTRY
157596c5ddc4Srjs_mesa_marshal_ProgramEnvParameter4dvARB(GLenum target, GLuint index, const GLdouble * params)
157696c5ddc4Srjs{
157796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
157896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramEnvParameter4dvARB);
157996c5ddc4Srjs   struct marshal_cmd_ProgramEnvParameter4dvARB *cmd;
158096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramEnvParameter4dvARB, cmd_size);
158196c5ddc4Srjs   cmd->target = target;
158296c5ddc4Srjs   cmd->index = index;
158396c5ddc4Srjs   memcpy(cmd->params, params, 4 * sizeof(GLdouble));
158496c5ddc4Srjs}
158596c5ddc4Srjs
158696c5ddc4Srjs
158796c5ddc4Srjs/* ProgramEnvParameter4fARB: marshalled asynchronously */
158896c5ddc4Srjsstruct marshal_cmd_ProgramEnvParameter4fARB
158996c5ddc4Srjs{
159096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
159196c5ddc4Srjs   GLenum target;
159296c5ddc4Srjs   GLuint index;
159396c5ddc4Srjs   GLfloat x;
159496c5ddc4Srjs   GLfloat y;
159596c5ddc4Srjs   GLfloat z;
159696c5ddc4Srjs   GLfloat w;
159796c5ddc4Srjs};
159896c5ddc4Srjsuint32_t
159996c5ddc4Srjs_mesa_unmarshal_ProgramEnvParameter4fARB(struct gl_context *ctx, const struct marshal_cmd_ProgramEnvParameter4fARB *cmd, const uint64_t *last)
160096c5ddc4Srjs{
160196c5ddc4Srjs   GLenum target = cmd->target;
160296c5ddc4Srjs   GLuint index = cmd->index;
160396c5ddc4Srjs   GLfloat x = cmd->x;
160496c5ddc4Srjs   GLfloat y = cmd->y;
160596c5ddc4Srjs   GLfloat z = cmd->z;
160696c5ddc4Srjs   GLfloat w = cmd->w;
160796c5ddc4Srjs   CALL_ProgramEnvParameter4fARB(ctx->CurrentServerDispatch, (target, index, x, y, z, w));
160896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramEnvParameter4fARB), 8) / 8);
160996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
161096c5ddc4Srjs   return cmd_size;
161196c5ddc4Srjs}
161296c5ddc4Srjsvoid GLAPIENTRY
161396c5ddc4Srjs_mesa_marshal_ProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
161496c5ddc4Srjs{
161596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
161696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramEnvParameter4fARB);
161796c5ddc4Srjs   struct marshal_cmd_ProgramEnvParameter4fARB *cmd;
161896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramEnvParameter4fARB, cmd_size);
161996c5ddc4Srjs   cmd->target = target;
162096c5ddc4Srjs   cmd->index = index;
162196c5ddc4Srjs   cmd->x = x;
162296c5ddc4Srjs   cmd->y = y;
162396c5ddc4Srjs   cmd->z = z;
162496c5ddc4Srjs   cmd->w = w;
162596c5ddc4Srjs}
162696c5ddc4Srjs
162796c5ddc4Srjs
162896c5ddc4Srjs/* ProgramEnvParameter4fvARB: marshalled asynchronously */
162996c5ddc4Srjsstruct marshal_cmd_ProgramEnvParameter4fvARB
163096c5ddc4Srjs{
163196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
163296c5ddc4Srjs   GLenum target;
163396c5ddc4Srjs   GLuint index;
163496c5ddc4Srjs   GLfloat params[4];
163596c5ddc4Srjs};
163696c5ddc4Srjsuint32_t
163796c5ddc4Srjs_mesa_unmarshal_ProgramEnvParameter4fvARB(struct gl_context *ctx, const struct marshal_cmd_ProgramEnvParameter4fvARB *cmd, const uint64_t *last)
163896c5ddc4Srjs{
163996c5ddc4Srjs   GLenum target = cmd->target;
164096c5ddc4Srjs   GLuint index = cmd->index;
164196c5ddc4Srjs   const GLfloat * params = cmd->params;
164296c5ddc4Srjs   CALL_ProgramEnvParameter4fvARB(ctx->CurrentServerDispatch, (target, index, params));
164396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramEnvParameter4fvARB), 8) / 8);
164496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
164596c5ddc4Srjs   return cmd_size;
164696c5ddc4Srjs}
164796c5ddc4Srjsvoid GLAPIENTRY
164896c5ddc4Srjs_mesa_marshal_ProgramEnvParameter4fvARB(GLenum target, GLuint index, const GLfloat * params)
164996c5ddc4Srjs{
165096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
165196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramEnvParameter4fvARB);
165296c5ddc4Srjs   struct marshal_cmd_ProgramEnvParameter4fvARB *cmd;
165396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramEnvParameter4fvARB, cmd_size);
165496c5ddc4Srjs   cmd->target = target;
165596c5ddc4Srjs   cmd->index = index;
165696c5ddc4Srjs   memcpy(cmd->params, params, 4 * sizeof(GLfloat));
165796c5ddc4Srjs}
165896c5ddc4Srjs
165996c5ddc4Srjs
166096c5ddc4Srjs/* ProgramLocalParameter4dARB: marshalled asynchronously */
166196c5ddc4Srjsstruct marshal_cmd_ProgramLocalParameter4dARB
166296c5ddc4Srjs{
166396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
166496c5ddc4Srjs   GLenum target;
166596c5ddc4Srjs   GLuint index;
166696c5ddc4Srjs   GLdouble x;
166796c5ddc4Srjs   GLdouble y;
166896c5ddc4Srjs   GLdouble z;
166996c5ddc4Srjs   GLdouble w;
167096c5ddc4Srjs};
167196c5ddc4Srjsuint32_t
167296c5ddc4Srjs_mesa_unmarshal_ProgramLocalParameter4dARB(struct gl_context *ctx, const struct marshal_cmd_ProgramLocalParameter4dARB *cmd, const uint64_t *last)
167396c5ddc4Srjs{
167496c5ddc4Srjs   GLenum target = cmd->target;
167596c5ddc4Srjs   GLuint index = cmd->index;
167696c5ddc4Srjs   GLdouble x = cmd->x;
167796c5ddc4Srjs   GLdouble y = cmd->y;
167896c5ddc4Srjs   GLdouble z = cmd->z;
167996c5ddc4Srjs   GLdouble w = cmd->w;
168096c5ddc4Srjs   CALL_ProgramLocalParameter4dARB(ctx->CurrentServerDispatch, (target, index, x, y, z, w));
168196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramLocalParameter4dARB), 8) / 8);
168296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
168396c5ddc4Srjs   return cmd_size;
168496c5ddc4Srjs}
168596c5ddc4Srjsvoid GLAPIENTRY
168696c5ddc4Srjs_mesa_marshal_ProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
168796c5ddc4Srjs{
168896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
168996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramLocalParameter4dARB);
169096c5ddc4Srjs   struct marshal_cmd_ProgramLocalParameter4dARB *cmd;
169196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramLocalParameter4dARB, cmd_size);
169296c5ddc4Srjs   cmd->target = target;
169396c5ddc4Srjs   cmd->index = index;
169496c5ddc4Srjs   cmd->x = x;
169596c5ddc4Srjs   cmd->y = y;
169696c5ddc4Srjs   cmd->z = z;
169796c5ddc4Srjs   cmd->w = w;
169896c5ddc4Srjs}
169996c5ddc4Srjs
170096c5ddc4Srjs
170196c5ddc4Srjs/* ProgramLocalParameter4dvARB: marshalled asynchronously */
170296c5ddc4Srjsstruct marshal_cmd_ProgramLocalParameter4dvARB
170396c5ddc4Srjs{
170496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
170596c5ddc4Srjs   GLenum target;
170696c5ddc4Srjs   GLuint index;
170796c5ddc4Srjs   GLdouble params[4];
170896c5ddc4Srjs};
170996c5ddc4Srjsuint32_t
171096c5ddc4Srjs_mesa_unmarshal_ProgramLocalParameter4dvARB(struct gl_context *ctx, const struct marshal_cmd_ProgramLocalParameter4dvARB *cmd, const uint64_t *last)
171196c5ddc4Srjs{
171296c5ddc4Srjs   GLenum target = cmd->target;
171396c5ddc4Srjs   GLuint index = cmd->index;
171496c5ddc4Srjs   const GLdouble * params = cmd->params;
171596c5ddc4Srjs   CALL_ProgramLocalParameter4dvARB(ctx->CurrentServerDispatch, (target, index, params));
171696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramLocalParameter4dvARB), 8) / 8);
171796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
171896c5ddc4Srjs   return cmd_size;
171996c5ddc4Srjs}
172096c5ddc4Srjsvoid GLAPIENTRY
172196c5ddc4Srjs_mesa_marshal_ProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble * params)
172296c5ddc4Srjs{
172396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
172496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramLocalParameter4dvARB);
172596c5ddc4Srjs   struct marshal_cmd_ProgramLocalParameter4dvARB *cmd;
172696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramLocalParameter4dvARB, cmd_size);
172796c5ddc4Srjs   cmd->target = target;
172896c5ddc4Srjs   cmd->index = index;
172996c5ddc4Srjs   memcpy(cmd->params, params, 4 * sizeof(GLdouble));
173096c5ddc4Srjs}
173196c5ddc4Srjs
173296c5ddc4Srjs
173396c5ddc4Srjs/* ProgramLocalParameter4fARB: marshalled asynchronously */
173496c5ddc4Srjsstruct marshal_cmd_ProgramLocalParameter4fARB
173596c5ddc4Srjs{
173696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
173796c5ddc4Srjs   GLenum target;
173896c5ddc4Srjs   GLuint index;
173996c5ddc4Srjs   GLfloat x;
174096c5ddc4Srjs   GLfloat y;
174196c5ddc4Srjs   GLfloat z;
174296c5ddc4Srjs   GLfloat w;
174396c5ddc4Srjs};
174496c5ddc4Srjsuint32_t
174596c5ddc4Srjs_mesa_unmarshal_ProgramLocalParameter4fARB(struct gl_context *ctx, const struct marshal_cmd_ProgramLocalParameter4fARB *cmd, const uint64_t *last)
174696c5ddc4Srjs{
174796c5ddc4Srjs   GLenum target = cmd->target;
174896c5ddc4Srjs   GLuint index = cmd->index;
174996c5ddc4Srjs   GLfloat x = cmd->x;
175096c5ddc4Srjs   GLfloat y = cmd->y;
175196c5ddc4Srjs   GLfloat z = cmd->z;
175296c5ddc4Srjs   GLfloat w = cmd->w;
175396c5ddc4Srjs   CALL_ProgramLocalParameter4fARB(ctx->CurrentServerDispatch, (target, index, x, y, z, w));
175496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramLocalParameter4fARB), 8) / 8);
175596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
175696c5ddc4Srjs   return cmd_size;
175796c5ddc4Srjs}
175896c5ddc4Srjsvoid GLAPIENTRY
175996c5ddc4Srjs_mesa_marshal_ProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
176096c5ddc4Srjs{
176196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
176296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramLocalParameter4fARB);
176396c5ddc4Srjs   struct marshal_cmd_ProgramLocalParameter4fARB *cmd;
176496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramLocalParameter4fARB, cmd_size);
176596c5ddc4Srjs   cmd->target = target;
176696c5ddc4Srjs   cmd->index = index;
176796c5ddc4Srjs   cmd->x = x;
176896c5ddc4Srjs   cmd->y = y;
176996c5ddc4Srjs   cmd->z = z;
177096c5ddc4Srjs   cmd->w = w;
177196c5ddc4Srjs}
177296c5ddc4Srjs
177396c5ddc4Srjs
177496c5ddc4Srjs/* ProgramLocalParameter4fvARB: marshalled asynchronously */
177596c5ddc4Srjsstruct marshal_cmd_ProgramLocalParameter4fvARB
177696c5ddc4Srjs{
177796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
177896c5ddc4Srjs   GLenum target;
177996c5ddc4Srjs   GLuint index;
178096c5ddc4Srjs   GLfloat params[4];
178196c5ddc4Srjs};
178296c5ddc4Srjsuint32_t
178396c5ddc4Srjs_mesa_unmarshal_ProgramLocalParameter4fvARB(struct gl_context *ctx, const struct marshal_cmd_ProgramLocalParameter4fvARB *cmd, const uint64_t *last)
178496c5ddc4Srjs{
178596c5ddc4Srjs   GLenum target = cmd->target;
178696c5ddc4Srjs   GLuint index = cmd->index;
178796c5ddc4Srjs   const GLfloat * params = cmd->params;
178896c5ddc4Srjs   CALL_ProgramLocalParameter4fvARB(ctx->CurrentServerDispatch, (target, index, params));
178996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramLocalParameter4fvARB), 8) / 8);
179096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
179196c5ddc4Srjs   return cmd_size;
179296c5ddc4Srjs}
179396c5ddc4Srjsvoid GLAPIENTRY
179496c5ddc4Srjs_mesa_marshal_ProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat * params)
179596c5ddc4Srjs{
179696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
179796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramLocalParameter4fvARB);
179896c5ddc4Srjs   struct marshal_cmd_ProgramLocalParameter4fvARB *cmd;
179996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramLocalParameter4fvARB, cmd_size);
180096c5ddc4Srjs   cmd->target = target;
180196c5ddc4Srjs   cmd->index = index;
180296c5ddc4Srjs   memcpy(cmd->params, params, 4 * sizeof(GLfloat));
180396c5ddc4Srjs}
180496c5ddc4Srjs
180596c5ddc4Srjs
180696c5ddc4Srjs/* GetProgramEnvParameterdvARB: marshalled synchronously */
180796c5ddc4Srjsvoid GLAPIENTRY
180896c5ddc4Srjs_mesa_marshal_GetProgramEnvParameterdvARB(GLenum target, GLuint index, GLdouble * params)
180996c5ddc4Srjs{
181096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
181196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramEnvParameterdvARB");
181296c5ddc4Srjs   CALL_GetProgramEnvParameterdvARB(ctx->CurrentServerDispatch, (target, index, params));
181396c5ddc4Srjs}
181496c5ddc4Srjs
181596c5ddc4Srjs
181696c5ddc4Srjs/* GetProgramEnvParameterfvARB: marshalled synchronously */
181796c5ddc4Srjsvoid GLAPIENTRY
181896c5ddc4Srjs_mesa_marshal_GetProgramEnvParameterfvARB(GLenum target, GLuint index, GLfloat * params)
181996c5ddc4Srjs{
182096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
182196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramEnvParameterfvARB");
182296c5ddc4Srjs   CALL_GetProgramEnvParameterfvARB(ctx->CurrentServerDispatch, (target, index, params));
182396c5ddc4Srjs}
182496c5ddc4Srjs
182596c5ddc4Srjs
182696c5ddc4Srjs/* GetProgramLocalParameterdvARB: marshalled synchronously */
182796c5ddc4Srjsvoid GLAPIENTRY
182896c5ddc4Srjs_mesa_marshal_GetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble * params)
182996c5ddc4Srjs{
183096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
183196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramLocalParameterdvARB");
183296c5ddc4Srjs   CALL_GetProgramLocalParameterdvARB(ctx->CurrentServerDispatch, (target, index, params));
183396c5ddc4Srjs}
183496c5ddc4Srjs
183596c5ddc4Srjs
183696c5ddc4Srjs/* GetProgramLocalParameterfvARB: marshalled synchronously */
183796c5ddc4Srjsvoid GLAPIENTRY
183896c5ddc4Srjs_mesa_marshal_GetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat * params)
183996c5ddc4Srjs{
184096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
184196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramLocalParameterfvARB");
184296c5ddc4Srjs   CALL_GetProgramLocalParameterfvARB(ctx->CurrentServerDispatch, (target, index, params));
184396c5ddc4Srjs}
184496c5ddc4Srjs
184596c5ddc4Srjs
184696c5ddc4Srjs/* GetProgramivARB: marshalled synchronously */
184796c5ddc4Srjsvoid GLAPIENTRY
184896c5ddc4Srjs_mesa_marshal_GetProgramivARB(GLenum target, GLenum pname, GLint * params)
184996c5ddc4Srjs{
185096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
185196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramivARB");
185296c5ddc4Srjs   CALL_GetProgramivARB(ctx->CurrentServerDispatch, (target, pname, params));
185396c5ddc4Srjs}
185496c5ddc4Srjs
185596c5ddc4Srjs
185696c5ddc4Srjs/* GetProgramStringARB: marshalled synchronously */
185796c5ddc4Srjsvoid GLAPIENTRY
185896c5ddc4Srjs_mesa_marshal_GetProgramStringARB(GLenum target, GLenum pname, GLvoid * string)
185996c5ddc4Srjs{
186096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
186196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramStringARB");
186296c5ddc4Srjs   CALL_GetProgramStringARB(ctx->CurrentServerDispatch, (target, pname, string));
186396c5ddc4Srjs}
186496c5ddc4Srjs
186596c5ddc4Srjs
186696c5ddc4Srjs/* DeleteObjectARB: marshalled asynchronously */
186796c5ddc4Srjsstruct marshal_cmd_DeleteObjectARB
186896c5ddc4Srjs{
186996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
187096c5ddc4Srjs   GLhandleARB obj;
187196c5ddc4Srjs};
187296c5ddc4Srjsuint32_t
187396c5ddc4Srjs_mesa_unmarshal_DeleteObjectARB(struct gl_context *ctx, const struct marshal_cmd_DeleteObjectARB *cmd, const uint64_t *last)
187496c5ddc4Srjs{
187596c5ddc4Srjs   GLhandleARB obj = cmd->obj;
187696c5ddc4Srjs   CALL_DeleteObjectARB(ctx->CurrentServerDispatch, (obj));
187796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DeleteObjectARB), 8) / 8);
187896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
187996c5ddc4Srjs   return cmd_size;
188096c5ddc4Srjs}
188196c5ddc4Srjsvoid GLAPIENTRY
188296c5ddc4Srjs_mesa_marshal_DeleteObjectARB(GLhandleARB obj)
188396c5ddc4Srjs{
188496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
188596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DeleteObjectARB);
188696c5ddc4Srjs   struct marshal_cmd_DeleteObjectARB *cmd;
188796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteObjectARB, cmd_size);
188896c5ddc4Srjs   cmd->obj = obj;
188996c5ddc4Srjs   _mesa_glthread_ProgramChanged(ctx);
189096c5ddc4Srjs}
189196c5ddc4Srjs
189296c5ddc4Srjs
189396c5ddc4Srjs/* GetHandleARB: marshalled synchronously */
189496c5ddc4SrjsGLhandleARB GLAPIENTRY
189596c5ddc4Srjs_mesa_marshal_GetHandleARB(GLenum pname)
189696c5ddc4Srjs{
189796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
189896c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetHandleARB");
189996c5ddc4Srjs   return CALL_GetHandleARB(ctx->CurrentServerDispatch, (pname));
190096c5ddc4Srjs}
190196c5ddc4Srjs
190296c5ddc4Srjs
190396c5ddc4Srjs/* DetachObjectARB: marshalled asynchronously */
190496c5ddc4Srjsstruct marshal_cmd_DetachObjectARB
190596c5ddc4Srjs{
190696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
190796c5ddc4Srjs   GLhandleARB containerObj;
190896c5ddc4Srjs   GLhandleARB attachedObj;
190996c5ddc4Srjs};
191096c5ddc4Srjsuint32_t
191196c5ddc4Srjs_mesa_unmarshal_DetachObjectARB(struct gl_context *ctx, const struct marshal_cmd_DetachObjectARB *cmd, const uint64_t *last)
191296c5ddc4Srjs{
191396c5ddc4Srjs   GLhandleARB containerObj = cmd->containerObj;
191496c5ddc4Srjs   GLhandleARB attachedObj = cmd->attachedObj;
191596c5ddc4Srjs   CALL_DetachObjectARB(ctx->CurrentServerDispatch, (containerObj, attachedObj));
191696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DetachObjectARB), 8) / 8);
191796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
191896c5ddc4Srjs   return cmd_size;
191996c5ddc4Srjs}
192096c5ddc4Srjsvoid GLAPIENTRY
192196c5ddc4Srjs_mesa_marshal_DetachObjectARB(GLhandleARB containerObj, GLhandleARB attachedObj)
192296c5ddc4Srjs{
192396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
192496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DetachObjectARB);
192596c5ddc4Srjs   struct marshal_cmd_DetachObjectARB *cmd;
192696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DetachObjectARB, cmd_size);
192796c5ddc4Srjs   cmd->containerObj = containerObj;
192896c5ddc4Srjs   cmd->attachedObj = attachedObj;
192996c5ddc4Srjs}
193096c5ddc4Srjs
193196c5ddc4Srjs
193296c5ddc4Srjs/* CreateShaderObjectARB: marshalled synchronously */
193396c5ddc4SrjsGLhandleARB GLAPIENTRY
193496c5ddc4Srjs_mesa_marshal_CreateShaderObjectARB(GLenum shaderType)
193596c5ddc4Srjs{
193696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
193796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CreateShaderObjectARB");
193896c5ddc4Srjs   return CALL_CreateShaderObjectARB(ctx->CurrentServerDispatch, (shaderType));
193996c5ddc4Srjs}
194096c5ddc4Srjs
194196c5ddc4Srjs
194296c5ddc4Srjs/* CreateProgramObjectARB: marshalled synchronously */
194396c5ddc4SrjsGLhandleARB GLAPIENTRY
194496c5ddc4Srjs_mesa_marshal_CreateProgramObjectARB(void)
194596c5ddc4Srjs{
194696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
194796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CreateProgramObjectARB");
194896c5ddc4Srjs   return CALL_CreateProgramObjectARB(ctx->CurrentServerDispatch, ());
194996c5ddc4Srjs}
195096c5ddc4Srjs
195196c5ddc4Srjs
195296c5ddc4Srjs/* AttachObjectARB: marshalled asynchronously */
195396c5ddc4Srjsstruct marshal_cmd_AttachObjectARB
195496c5ddc4Srjs{
195596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
195696c5ddc4Srjs   GLhandleARB containerObj;
195796c5ddc4Srjs   GLhandleARB obj;
195896c5ddc4Srjs};
195996c5ddc4Srjsuint32_t
196096c5ddc4Srjs_mesa_unmarshal_AttachObjectARB(struct gl_context *ctx, const struct marshal_cmd_AttachObjectARB *cmd, const uint64_t *last)
196196c5ddc4Srjs{
196296c5ddc4Srjs   GLhandleARB containerObj = cmd->containerObj;
196396c5ddc4Srjs   GLhandleARB obj = cmd->obj;
196496c5ddc4Srjs   CALL_AttachObjectARB(ctx->CurrentServerDispatch, (containerObj, obj));
196596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_AttachObjectARB), 8) / 8);
196696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
196796c5ddc4Srjs   return cmd_size;
196896c5ddc4Srjs}
196996c5ddc4Srjsvoid GLAPIENTRY
197096c5ddc4Srjs_mesa_marshal_AttachObjectARB(GLhandleARB containerObj, GLhandleARB obj)
197196c5ddc4Srjs{
197296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
197396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_AttachObjectARB);
197496c5ddc4Srjs   struct marshal_cmd_AttachObjectARB *cmd;
197596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_AttachObjectARB, cmd_size);
197696c5ddc4Srjs   cmd->containerObj = containerObj;
197796c5ddc4Srjs   cmd->obj = obj;
197896c5ddc4Srjs}
197996c5ddc4Srjs
198096c5ddc4Srjs
198196c5ddc4Srjs/* GetObjectParameterfvARB: marshalled synchronously */
198296c5ddc4Srjsvoid GLAPIENTRY
198396c5ddc4Srjs_mesa_marshal_GetObjectParameterfvARB(GLhandleARB obj, GLenum pname, GLfloat * params)
198496c5ddc4Srjs{
198596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
198696c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetObjectParameterfvARB");
198796c5ddc4Srjs   CALL_GetObjectParameterfvARB(ctx->CurrentServerDispatch, (obj, pname, params));
198896c5ddc4Srjs}
198996c5ddc4Srjs
199096c5ddc4Srjs
199196c5ddc4Srjs/* GetObjectParameterivARB: marshalled synchronously */
199296c5ddc4Srjsvoid GLAPIENTRY
199396c5ddc4Srjs_mesa_marshal_GetObjectParameterivARB(GLhandleARB obj, GLenum pname, GLint * params)
199496c5ddc4Srjs{
199596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
199696c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetObjectParameterivARB");
199796c5ddc4Srjs   CALL_GetObjectParameterivARB(ctx->CurrentServerDispatch, (obj, pname, params));
199896c5ddc4Srjs}
199996c5ddc4Srjs
200096c5ddc4Srjs
200196c5ddc4Srjs/* GetInfoLogARB: marshalled synchronously */
200296c5ddc4Srjsvoid GLAPIENTRY
200396c5ddc4Srjs_mesa_marshal_GetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog)
200496c5ddc4Srjs{
200596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
200696c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetInfoLogARB");
200796c5ddc4Srjs   CALL_GetInfoLogARB(ctx->CurrentServerDispatch, (obj, maxLength, length, infoLog));
200896c5ddc4Srjs}
200996c5ddc4Srjs
201096c5ddc4Srjs
201196c5ddc4Srjs/* GetAttachedObjectsARB: marshalled synchronously */
201296c5ddc4Srjsvoid GLAPIENTRY
201396c5ddc4Srjs_mesa_marshal_GetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog)
201496c5ddc4Srjs{
201596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
201696c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetAttachedObjectsARB");
201796c5ddc4Srjs   CALL_GetAttachedObjectsARB(ctx->CurrentServerDispatch, (containerObj, maxLength, length, infoLog));
201896c5ddc4Srjs}
201996c5ddc4Srjs
202096c5ddc4Srjs
202196c5ddc4Srjs/* ClampColor: marshalled asynchronously */
202296c5ddc4Srjsstruct marshal_cmd_ClampColor
202396c5ddc4Srjs{
202496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
202596c5ddc4Srjs   GLenum target;
202696c5ddc4Srjs   GLenum clamp;
202796c5ddc4Srjs};
202896c5ddc4Srjsuint32_t
202996c5ddc4Srjs_mesa_unmarshal_ClampColor(struct gl_context *ctx, const struct marshal_cmd_ClampColor *cmd, const uint64_t *last)
203096c5ddc4Srjs{
203196c5ddc4Srjs   GLenum target = cmd->target;
203296c5ddc4Srjs   GLenum clamp = cmd->clamp;
203396c5ddc4Srjs   CALL_ClampColor(ctx->CurrentServerDispatch, (target, clamp));
203496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ClampColor), 8) / 8);
203596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
203696c5ddc4Srjs   return cmd_size;
203796c5ddc4Srjs}
203896c5ddc4Srjsvoid GLAPIENTRY
203996c5ddc4Srjs_mesa_marshal_ClampColor(GLenum target, GLenum clamp)
204096c5ddc4Srjs{
204196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
204296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ClampColor);
204396c5ddc4Srjs   struct marshal_cmd_ClampColor *cmd;
204496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClampColor, cmd_size);
204596c5ddc4Srjs   cmd->target = target;
204696c5ddc4Srjs   cmd->clamp = clamp;
204796c5ddc4Srjs}
204896c5ddc4Srjs
204996c5ddc4Srjs
205096c5ddc4Srjs/* IsRenderbuffer: marshalled synchronously */
205196c5ddc4SrjsGLboolean GLAPIENTRY
205296c5ddc4Srjs_mesa_marshal_IsRenderbuffer(GLuint renderbuffer)
205396c5ddc4Srjs{
205496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
205596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsRenderbuffer");
205696c5ddc4Srjs   return CALL_IsRenderbuffer(ctx->CurrentServerDispatch, (renderbuffer));
205796c5ddc4Srjs}
205896c5ddc4Srjs
205996c5ddc4Srjs
206096c5ddc4Srjs/* BindRenderbuffer: marshalled asynchronously */
206196c5ddc4Srjsstruct marshal_cmd_BindRenderbuffer
206296c5ddc4Srjs{
206396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
206496c5ddc4Srjs   GLenum target;
206596c5ddc4Srjs   GLuint renderbuffer;
206696c5ddc4Srjs};
206796c5ddc4Srjsuint32_t
206896c5ddc4Srjs_mesa_unmarshal_BindRenderbuffer(struct gl_context *ctx, const struct marshal_cmd_BindRenderbuffer *cmd, const uint64_t *last)
206996c5ddc4Srjs{
207096c5ddc4Srjs   GLenum target = cmd->target;
207196c5ddc4Srjs   GLuint renderbuffer = cmd->renderbuffer;
207296c5ddc4Srjs   CALL_BindRenderbuffer(ctx->CurrentServerDispatch, (target, renderbuffer));
207396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindRenderbuffer), 8) / 8);
207496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
207596c5ddc4Srjs   return cmd_size;
207696c5ddc4Srjs}
207796c5ddc4Srjsvoid GLAPIENTRY
207896c5ddc4Srjs_mesa_marshal_BindRenderbuffer(GLenum target, GLuint renderbuffer)
207996c5ddc4Srjs{
208096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
208196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindRenderbuffer);
208296c5ddc4Srjs   struct marshal_cmd_BindRenderbuffer *cmd;
208396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindRenderbuffer, cmd_size);
208496c5ddc4Srjs   cmd->target = target;
208596c5ddc4Srjs   cmd->renderbuffer = renderbuffer;
208696c5ddc4Srjs}
208796c5ddc4Srjs
208896c5ddc4Srjs
208996c5ddc4Srjs/* DeleteRenderbuffers: marshalled asynchronously */
209096c5ddc4Srjsstruct marshal_cmd_DeleteRenderbuffers
209196c5ddc4Srjs{
209296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
209396c5ddc4Srjs   GLsizei n;
209496c5ddc4Srjs   /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint renderbuffers[n] */
209596c5ddc4Srjs};
209696c5ddc4Srjsuint32_t
209796c5ddc4Srjs_mesa_unmarshal_DeleteRenderbuffers(struct gl_context *ctx, const struct marshal_cmd_DeleteRenderbuffers *cmd, const uint64_t *last)
209896c5ddc4Srjs{
209996c5ddc4Srjs   GLsizei n = cmd->n;
210096c5ddc4Srjs   GLuint * renderbuffers;
210196c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
210296c5ddc4Srjs   renderbuffers = (GLuint *) variable_data;
210396c5ddc4Srjs   CALL_DeleteRenderbuffers(ctx->CurrentServerDispatch, (n, renderbuffers));
210496c5ddc4Srjs   return cmd->cmd_base.cmd_size;
210596c5ddc4Srjs}
210696c5ddc4Srjsvoid GLAPIENTRY
210796c5ddc4Srjs_mesa_marshal_DeleteRenderbuffers(GLsizei n, const GLuint * renderbuffers)
210896c5ddc4Srjs{
210996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
211096c5ddc4Srjs   int renderbuffers_size = safe_mul(n, 1 * sizeof(GLuint));
211196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DeleteRenderbuffers) + renderbuffers_size;
211296c5ddc4Srjs   struct marshal_cmd_DeleteRenderbuffers *cmd;
211396c5ddc4Srjs   if (unlikely(renderbuffers_size < 0 || (renderbuffers_size > 0 && !renderbuffers) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
211496c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "DeleteRenderbuffers");
211596c5ddc4Srjs      CALL_DeleteRenderbuffers(ctx->CurrentServerDispatch, (n, renderbuffers));
211696c5ddc4Srjs      return;
211796c5ddc4Srjs   }
211896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteRenderbuffers, cmd_size);
211996c5ddc4Srjs   cmd->n = n;
212096c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
212196c5ddc4Srjs   memcpy(variable_data, renderbuffers, renderbuffers_size);
212296c5ddc4Srjs}
212396c5ddc4Srjs
212496c5ddc4Srjs
212596c5ddc4Srjs/* GenRenderbuffers: marshalled synchronously */
212696c5ddc4Srjsvoid GLAPIENTRY
212796c5ddc4Srjs_mesa_marshal_GenRenderbuffers(GLsizei n, GLuint * renderbuffers)
212896c5ddc4Srjs{
212996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
213096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GenRenderbuffers");
213196c5ddc4Srjs   CALL_GenRenderbuffers(ctx->CurrentServerDispatch, (n, renderbuffers));
213296c5ddc4Srjs}
213396c5ddc4Srjs
213496c5ddc4Srjs
213596c5ddc4Srjs/* RenderbufferStorage: marshalled asynchronously */
213696c5ddc4Srjsstruct marshal_cmd_RenderbufferStorage
213796c5ddc4Srjs{
213896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
213996c5ddc4Srjs   GLenum target;
214096c5ddc4Srjs   GLenum internalformat;
214196c5ddc4Srjs   GLsizei width;
214296c5ddc4Srjs   GLsizei height;
214396c5ddc4Srjs};
214496c5ddc4Srjsuint32_t
214596c5ddc4Srjs_mesa_unmarshal_RenderbufferStorage(struct gl_context *ctx, const struct marshal_cmd_RenderbufferStorage *cmd, const uint64_t *last)
214696c5ddc4Srjs{
214796c5ddc4Srjs   GLenum target = cmd->target;
214896c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
214996c5ddc4Srjs   GLsizei width = cmd->width;
215096c5ddc4Srjs   GLsizei height = cmd->height;
215196c5ddc4Srjs   CALL_RenderbufferStorage(ctx->CurrentServerDispatch, (target, internalformat, width, height));
215296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_RenderbufferStorage), 8) / 8);
215396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
215496c5ddc4Srjs   return cmd_size;
215596c5ddc4Srjs}
215696c5ddc4Srjsvoid GLAPIENTRY
215796c5ddc4Srjs_mesa_marshal_RenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
215896c5ddc4Srjs{
215996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
216096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_RenderbufferStorage);
216196c5ddc4Srjs   struct marshal_cmd_RenderbufferStorage *cmd;
216296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RenderbufferStorage, cmd_size);
216396c5ddc4Srjs   cmd->target = target;
216496c5ddc4Srjs   cmd->internalformat = internalformat;
216596c5ddc4Srjs   cmd->width = width;
216696c5ddc4Srjs   cmd->height = height;
216796c5ddc4Srjs}
216896c5ddc4Srjs
216996c5ddc4Srjs
217096c5ddc4Srjs/* RenderbufferStorageMultisample: marshalled asynchronously */
217196c5ddc4Srjsstruct marshal_cmd_RenderbufferStorageMultisample
217296c5ddc4Srjs{
217396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
217496c5ddc4Srjs   GLenum target;
217596c5ddc4Srjs   GLsizei samples;
217696c5ddc4Srjs   GLenum internalformat;
217796c5ddc4Srjs   GLsizei width;
217896c5ddc4Srjs   GLsizei height;
217996c5ddc4Srjs};
218096c5ddc4Srjsuint32_t
218196c5ddc4Srjs_mesa_unmarshal_RenderbufferStorageMultisample(struct gl_context *ctx, const struct marshal_cmd_RenderbufferStorageMultisample *cmd, const uint64_t *last)
218296c5ddc4Srjs{
218396c5ddc4Srjs   GLenum target = cmd->target;
218496c5ddc4Srjs   GLsizei samples = cmd->samples;
218596c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
218696c5ddc4Srjs   GLsizei width = cmd->width;
218796c5ddc4Srjs   GLsizei height = cmd->height;
218896c5ddc4Srjs   CALL_RenderbufferStorageMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height));
218996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_RenderbufferStorageMultisample), 8) / 8);
219096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
219196c5ddc4Srjs   return cmd_size;
219296c5ddc4Srjs}
219396c5ddc4Srjsvoid GLAPIENTRY
219496c5ddc4Srjs_mesa_marshal_RenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
219596c5ddc4Srjs{
219696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
219796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_RenderbufferStorageMultisample);
219896c5ddc4Srjs   struct marshal_cmd_RenderbufferStorageMultisample *cmd;
219996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RenderbufferStorageMultisample, cmd_size);
220096c5ddc4Srjs   cmd->target = target;
220196c5ddc4Srjs   cmd->samples = samples;
220296c5ddc4Srjs   cmd->internalformat = internalformat;
220396c5ddc4Srjs   cmd->width = width;
220496c5ddc4Srjs   cmd->height = height;
220596c5ddc4Srjs}
220696c5ddc4Srjs
220796c5ddc4Srjs
220896c5ddc4Srjs/* GetRenderbufferParameteriv: marshalled synchronously */
220996c5ddc4Srjsvoid GLAPIENTRY
221096c5ddc4Srjs_mesa_marshal_GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params)
221196c5ddc4Srjs{
221296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
221396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetRenderbufferParameteriv");
221496c5ddc4Srjs   CALL_GetRenderbufferParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
221596c5ddc4Srjs}
221696c5ddc4Srjs
221796c5ddc4Srjs
221896c5ddc4Srjs/* IsFramebuffer: marshalled synchronously */
221996c5ddc4SrjsGLboolean GLAPIENTRY
222096c5ddc4Srjs_mesa_marshal_IsFramebuffer(GLuint framebuffer)
222196c5ddc4Srjs{
222296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
222396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsFramebuffer");
222496c5ddc4Srjs   return CALL_IsFramebuffer(ctx->CurrentServerDispatch, (framebuffer));
222596c5ddc4Srjs}
222696c5ddc4Srjs
222796c5ddc4Srjs
222896c5ddc4Srjs/* BindFramebuffer: marshalled asynchronously */
222996c5ddc4Srjsstruct marshal_cmd_BindFramebuffer
223096c5ddc4Srjs{
223196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
223296c5ddc4Srjs   GLenum target;
223396c5ddc4Srjs   GLuint framebuffer;
223496c5ddc4Srjs};
223596c5ddc4Srjsuint32_t
223696c5ddc4Srjs_mesa_unmarshal_BindFramebuffer(struct gl_context *ctx, const struct marshal_cmd_BindFramebuffer *cmd, const uint64_t *last)
223796c5ddc4Srjs{
223896c5ddc4Srjs   GLenum target = cmd->target;
223996c5ddc4Srjs   GLuint framebuffer = cmd->framebuffer;
224096c5ddc4Srjs   CALL_BindFramebuffer(ctx->CurrentServerDispatch, (target, framebuffer));
224196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindFramebuffer), 8) / 8);
224296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
224396c5ddc4Srjs   return cmd_size;
224496c5ddc4Srjs}
224596c5ddc4Srjsvoid GLAPIENTRY
224696c5ddc4Srjs_mesa_marshal_BindFramebuffer(GLenum target, GLuint framebuffer)
224796c5ddc4Srjs{
224896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
224996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindFramebuffer);
225096c5ddc4Srjs   struct marshal_cmd_BindFramebuffer *cmd;
225196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindFramebuffer, cmd_size);
225296c5ddc4Srjs   cmd->target = target;
225396c5ddc4Srjs   cmd->framebuffer = framebuffer;
225496c5ddc4Srjs}
225596c5ddc4Srjs
225696c5ddc4Srjs
225796c5ddc4Srjs/* DeleteFramebuffers: marshalled asynchronously */
225896c5ddc4Srjsstruct marshal_cmd_DeleteFramebuffers
225996c5ddc4Srjs{
226096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
226196c5ddc4Srjs   GLsizei n;
226296c5ddc4Srjs   /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint framebuffers[n] */
226396c5ddc4Srjs};
226496c5ddc4Srjsuint32_t
226596c5ddc4Srjs_mesa_unmarshal_DeleteFramebuffers(struct gl_context *ctx, const struct marshal_cmd_DeleteFramebuffers *cmd, const uint64_t *last)
226696c5ddc4Srjs{
226796c5ddc4Srjs   GLsizei n = cmd->n;
226896c5ddc4Srjs   GLuint * framebuffers;
226996c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
227096c5ddc4Srjs   framebuffers = (GLuint *) variable_data;
227196c5ddc4Srjs   CALL_DeleteFramebuffers(ctx->CurrentServerDispatch, (n, framebuffers));
227296c5ddc4Srjs   return cmd->cmd_base.cmd_size;
227396c5ddc4Srjs}
227496c5ddc4Srjsvoid GLAPIENTRY
227596c5ddc4Srjs_mesa_marshal_DeleteFramebuffers(GLsizei n, const GLuint * framebuffers)
227696c5ddc4Srjs{
227796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
227896c5ddc4Srjs   int framebuffers_size = safe_mul(n, 1 * sizeof(GLuint));
227996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DeleteFramebuffers) + framebuffers_size;
228096c5ddc4Srjs   struct marshal_cmd_DeleteFramebuffers *cmd;
228196c5ddc4Srjs   if (unlikely(framebuffers_size < 0 || (framebuffers_size > 0 && !framebuffers) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
228296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "DeleteFramebuffers");
228396c5ddc4Srjs      CALL_DeleteFramebuffers(ctx->CurrentServerDispatch, (n, framebuffers));
228496c5ddc4Srjs      return;
228596c5ddc4Srjs   }
228696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteFramebuffers, cmd_size);
228796c5ddc4Srjs   cmd->n = n;
228896c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
228996c5ddc4Srjs   memcpy(variable_data, framebuffers, framebuffers_size);
229096c5ddc4Srjs}
229196c5ddc4Srjs
229296c5ddc4Srjs
229396c5ddc4Srjs/* GenFramebuffers: marshalled synchronously */
229496c5ddc4Srjsvoid GLAPIENTRY
229596c5ddc4Srjs_mesa_marshal_GenFramebuffers(GLsizei n, GLuint * framebuffers)
229696c5ddc4Srjs{
229796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
229896c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GenFramebuffers");
229996c5ddc4Srjs   CALL_GenFramebuffers(ctx->CurrentServerDispatch, (n, framebuffers));
230096c5ddc4Srjs}
230196c5ddc4Srjs
230296c5ddc4Srjs
230396c5ddc4Srjs/* CheckFramebufferStatus: marshalled synchronously */
230496c5ddc4SrjsGLenum GLAPIENTRY
230596c5ddc4Srjs_mesa_marshal_CheckFramebufferStatus(GLenum target)
230696c5ddc4Srjs{
230796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
230896c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CheckFramebufferStatus");
230996c5ddc4Srjs   return CALL_CheckFramebufferStatus(ctx->CurrentServerDispatch, (target));
231096c5ddc4Srjs}
231196c5ddc4Srjs
231296c5ddc4Srjs
231396c5ddc4Srjs/* FramebufferTexture1D: marshalled asynchronously */
231496c5ddc4Srjsstruct marshal_cmd_FramebufferTexture1D
231596c5ddc4Srjs{
231696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
231796c5ddc4Srjs   GLenum target;
231896c5ddc4Srjs   GLenum attachment;
231996c5ddc4Srjs   GLenum textarget;
232096c5ddc4Srjs   GLuint texture;
232196c5ddc4Srjs   GLint level;
232296c5ddc4Srjs};
232396c5ddc4Srjsuint32_t
232496c5ddc4Srjs_mesa_unmarshal_FramebufferTexture1D(struct gl_context *ctx, const struct marshal_cmd_FramebufferTexture1D *cmd, const uint64_t *last)
232596c5ddc4Srjs{
232696c5ddc4Srjs   GLenum target = cmd->target;
232796c5ddc4Srjs   GLenum attachment = cmd->attachment;
232896c5ddc4Srjs   GLenum textarget = cmd->textarget;
232996c5ddc4Srjs   GLuint texture = cmd->texture;
233096c5ddc4Srjs   GLint level = cmd->level;
233196c5ddc4Srjs   CALL_FramebufferTexture1D(ctx->CurrentServerDispatch, (target, attachment, textarget, texture, level));
233296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FramebufferTexture1D), 8) / 8);
233396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
233496c5ddc4Srjs   return cmd_size;
233596c5ddc4Srjs}
233696c5ddc4Srjsvoid GLAPIENTRY
233796c5ddc4Srjs_mesa_marshal_FramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
233896c5ddc4Srjs{
233996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
234096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_FramebufferTexture1D);
234196c5ddc4Srjs   struct marshal_cmd_FramebufferTexture1D *cmd;
234296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferTexture1D, cmd_size);
234396c5ddc4Srjs   cmd->target = target;
234496c5ddc4Srjs   cmd->attachment = attachment;
234596c5ddc4Srjs   cmd->textarget = textarget;
234696c5ddc4Srjs   cmd->texture = texture;
234796c5ddc4Srjs   cmd->level = level;
234896c5ddc4Srjs}
234996c5ddc4Srjs
235096c5ddc4Srjs
235196c5ddc4Srjs/* FramebufferTexture2D: marshalled asynchronously */
235296c5ddc4Srjsstruct marshal_cmd_FramebufferTexture2D
235396c5ddc4Srjs{
235496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
235596c5ddc4Srjs   GLenum target;
235696c5ddc4Srjs   GLenum attachment;
235796c5ddc4Srjs   GLenum textarget;
235896c5ddc4Srjs   GLuint texture;
235996c5ddc4Srjs   GLint level;
236096c5ddc4Srjs};
236196c5ddc4Srjsuint32_t
236296c5ddc4Srjs_mesa_unmarshal_FramebufferTexture2D(struct gl_context *ctx, const struct marshal_cmd_FramebufferTexture2D *cmd, const uint64_t *last)
236396c5ddc4Srjs{
236496c5ddc4Srjs   GLenum target = cmd->target;
236596c5ddc4Srjs   GLenum attachment = cmd->attachment;
236696c5ddc4Srjs   GLenum textarget = cmd->textarget;
236796c5ddc4Srjs   GLuint texture = cmd->texture;
236896c5ddc4Srjs   GLint level = cmd->level;
236996c5ddc4Srjs   CALL_FramebufferTexture2D(ctx->CurrentServerDispatch, (target, attachment, textarget, texture, level));
237096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FramebufferTexture2D), 8) / 8);
237196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
237296c5ddc4Srjs   return cmd_size;
237396c5ddc4Srjs}
237496c5ddc4Srjsvoid GLAPIENTRY
237596c5ddc4Srjs_mesa_marshal_FramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
237696c5ddc4Srjs{
237796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
237896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_FramebufferTexture2D);
237996c5ddc4Srjs   struct marshal_cmd_FramebufferTexture2D *cmd;
238096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferTexture2D, cmd_size);
238196c5ddc4Srjs   cmd->target = target;
238296c5ddc4Srjs   cmd->attachment = attachment;
238396c5ddc4Srjs   cmd->textarget = textarget;
238496c5ddc4Srjs   cmd->texture = texture;
238596c5ddc4Srjs   cmd->level = level;
238696c5ddc4Srjs}
238796c5ddc4Srjs
238896c5ddc4Srjs
238996c5ddc4Srjs/* FramebufferTexture3D: marshalled asynchronously */
239096c5ddc4Srjsstruct marshal_cmd_FramebufferTexture3D
239196c5ddc4Srjs{
239296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
239396c5ddc4Srjs   GLenum target;
239496c5ddc4Srjs   GLenum attachment;
239596c5ddc4Srjs   GLenum textarget;
239696c5ddc4Srjs   GLuint texture;
239796c5ddc4Srjs   GLint level;
239896c5ddc4Srjs   GLint layer;
239996c5ddc4Srjs};
240096c5ddc4Srjsuint32_t
240196c5ddc4Srjs_mesa_unmarshal_FramebufferTexture3D(struct gl_context *ctx, const struct marshal_cmd_FramebufferTexture3D *cmd, const uint64_t *last)
240296c5ddc4Srjs{
240396c5ddc4Srjs   GLenum target = cmd->target;
240496c5ddc4Srjs   GLenum attachment = cmd->attachment;
240596c5ddc4Srjs   GLenum textarget = cmd->textarget;
240696c5ddc4Srjs   GLuint texture = cmd->texture;
240796c5ddc4Srjs   GLint level = cmd->level;
240896c5ddc4Srjs   GLint layer = cmd->layer;
240996c5ddc4Srjs   CALL_FramebufferTexture3D(ctx->CurrentServerDispatch, (target, attachment, textarget, texture, level, layer));
241096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FramebufferTexture3D), 8) / 8);
241196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
241296c5ddc4Srjs   return cmd_size;
241396c5ddc4Srjs}
241496c5ddc4Srjsvoid GLAPIENTRY
241596c5ddc4Srjs_mesa_marshal_FramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer)
241696c5ddc4Srjs{
241796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
241896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_FramebufferTexture3D);
241996c5ddc4Srjs   struct marshal_cmd_FramebufferTexture3D *cmd;
242096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferTexture3D, cmd_size);
242196c5ddc4Srjs   cmd->target = target;
242296c5ddc4Srjs   cmd->attachment = attachment;
242396c5ddc4Srjs   cmd->textarget = textarget;
242496c5ddc4Srjs   cmd->texture = texture;
242596c5ddc4Srjs   cmd->level = level;
242696c5ddc4Srjs   cmd->layer = layer;
242796c5ddc4Srjs}
242896c5ddc4Srjs
242996c5ddc4Srjs
243096c5ddc4Srjs/* FramebufferTextureLayer: marshalled asynchronously */
243196c5ddc4Srjsstruct marshal_cmd_FramebufferTextureLayer
243296c5ddc4Srjs{
243396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
243496c5ddc4Srjs   GLenum target;
243596c5ddc4Srjs   GLenum attachment;
243696c5ddc4Srjs   GLuint texture;
243796c5ddc4Srjs   GLint level;
243896c5ddc4Srjs   GLint layer;
243996c5ddc4Srjs};
244096c5ddc4Srjsuint32_t
244196c5ddc4Srjs_mesa_unmarshal_FramebufferTextureLayer(struct gl_context *ctx, const struct marshal_cmd_FramebufferTextureLayer *cmd, const uint64_t *last)
244296c5ddc4Srjs{
244396c5ddc4Srjs   GLenum target = cmd->target;
244496c5ddc4Srjs   GLenum attachment = cmd->attachment;
244596c5ddc4Srjs   GLuint texture = cmd->texture;
244696c5ddc4Srjs   GLint level = cmd->level;
244796c5ddc4Srjs   GLint layer = cmd->layer;
244896c5ddc4Srjs   CALL_FramebufferTextureLayer(ctx->CurrentServerDispatch, (target, attachment, texture, level, layer));
244996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FramebufferTextureLayer), 8) / 8);
245096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
245196c5ddc4Srjs   return cmd_size;
245296c5ddc4Srjs}
245396c5ddc4Srjsvoid GLAPIENTRY
245496c5ddc4Srjs_mesa_marshal_FramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
245596c5ddc4Srjs{
245696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
245796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_FramebufferTextureLayer);
245896c5ddc4Srjs   struct marshal_cmd_FramebufferTextureLayer *cmd;
245996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferTextureLayer, cmd_size);
246096c5ddc4Srjs   cmd->target = target;
246196c5ddc4Srjs   cmd->attachment = attachment;
246296c5ddc4Srjs   cmd->texture = texture;
246396c5ddc4Srjs   cmd->level = level;
246496c5ddc4Srjs   cmd->layer = layer;
246596c5ddc4Srjs}
246696c5ddc4Srjs
246796c5ddc4Srjs
246896c5ddc4Srjs/* FramebufferRenderbuffer: marshalled asynchronously */
246996c5ddc4Srjsstruct marshal_cmd_FramebufferRenderbuffer
247096c5ddc4Srjs{
247196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
247296c5ddc4Srjs   GLenum target;
247396c5ddc4Srjs   GLenum attachment;
247496c5ddc4Srjs   GLenum renderbuffertarget;
247596c5ddc4Srjs   GLuint renderbuffer;
247696c5ddc4Srjs};
247796c5ddc4Srjsuint32_t
247896c5ddc4Srjs_mesa_unmarshal_FramebufferRenderbuffer(struct gl_context *ctx, const struct marshal_cmd_FramebufferRenderbuffer *cmd, const uint64_t *last)
247996c5ddc4Srjs{
248096c5ddc4Srjs   GLenum target = cmd->target;
248196c5ddc4Srjs   GLenum attachment = cmd->attachment;
248296c5ddc4Srjs   GLenum renderbuffertarget = cmd->renderbuffertarget;
248396c5ddc4Srjs   GLuint renderbuffer = cmd->renderbuffer;
248496c5ddc4Srjs   CALL_FramebufferRenderbuffer(ctx->CurrentServerDispatch, (target, attachment, renderbuffertarget, renderbuffer));
248596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FramebufferRenderbuffer), 8) / 8);
248696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
248796c5ddc4Srjs   return cmd_size;
248896c5ddc4Srjs}
248996c5ddc4Srjsvoid GLAPIENTRY
249096c5ddc4Srjs_mesa_marshal_FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
249196c5ddc4Srjs{
249296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
249396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_FramebufferRenderbuffer);
249496c5ddc4Srjs   struct marshal_cmd_FramebufferRenderbuffer *cmd;
249596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferRenderbuffer, cmd_size);
249696c5ddc4Srjs   cmd->target = target;
249796c5ddc4Srjs   cmd->attachment = attachment;
249896c5ddc4Srjs   cmd->renderbuffertarget = renderbuffertarget;
249996c5ddc4Srjs   cmd->renderbuffer = renderbuffer;
250096c5ddc4Srjs}
250196c5ddc4Srjs
250296c5ddc4Srjs
250396c5ddc4Srjs/* GetFramebufferAttachmentParameteriv: marshalled synchronously */
250496c5ddc4Srjsvoid GLAPIENTRY
250596c5ddc4Srjs_mesa_marshal_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params)
250696c5ddc4Srjs{
250796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
250896c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetFramebufferAttachmentParameteriv");
250996c5ddc4Srjs   CALL_GetFramebufferAttachmentParameteriv(ctx->CurrentServerDispatch, (target, attachment, pname, params));
251096c5ddc4Srjs}
251196c5ddc4Srjs
251296c5ddc4Srjs
251396c5ddc4Srjs/* BlitFramebuffer: marshalled asynchronously */
251496c5ddc4Srjsstruct marshal_cmd_BlitFramebuffer
251596c5ddc4Srjs{
251696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
251796c5ddc4Srjs   GLint srcX0;
251896c5ddc4Srjs   GLint srcY0;
251996c5ddc4Srjs   GLint srcX1;
252096c5ddc4Srjs   GLint srcY1;
252196c5ddc4Srjs   GLint dstX0;
252296c5ddc4Srjs   GLint dstY0;
252396c5ddc4Srjs   GLint dstX1;
252496c5ddc4Srjs   GLint dstY1;
252596c5ddc4Srjs   GLbitfield mask;
252696c5ddc4Srjs   GLenum filter;
252796c5ddc4Srjs};
252896c5ddc4Srjsuint32_t
252996c5ddc4Srjs_mesa_unmarshal_BlitFramebuffer(struct gl_context *ctx, const struct marshal_cmd_BlitFramebuffer *cmd, const uint64_t *last)
253096c5ddc4Srjs{
253196c5ddc4Srjs   GLint srcX0 = cmd->srcX0;
253296c5ddc4Srjs   GLint srcY0 = cmd->srcY0;
253396c5ddc4Srjs   GLint srcX1 = cmd->srcX1;
253496c5ddc4Srjs   GLint srcY1 = cmd->srcY1;
253596c5ddc4Srjs   GLint dstX0 = cmd->dstX0;
253696c5ddc4Srjs   GLint dstY0 = cmd->dstY0;
253796c5ddc4Srjs   GLint dstX1 = cmd->dstX1;
253896c5ddc4Srjs   GLint dstY1 = cmd->dstY1;
253996c5ddc4Srjs   GLbitfield mask = cmd->mask;
254096c5ddc4Srjs   GLenum filter = cmd->filter;
254196c5ddc4Srjs   CALL_BlitFramebuffer(ctx->CurrentServerDispatch, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
254296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BlitFramebuffer), 8) / 8);
254396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
254496c5ddc4Srjs   return cmd_size;
254596c5ddc4Srjs}
254696c5ddc4Srjsvoid GLAPIENTRY
254796c5ddc4Srjs_mesa_marshal_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
254896c5ddc4Srjs{
254996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
255096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BlitFramebuffer);
255196c5ddc4Srjs   struct marshal_cmd_BlitFramebuffer *cmd;
255296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlitFramebuffer, cmd_size);
255396c5ddc4Srjs   cmd->srcX0 = srcX0;
255496c5ddc4Srjs   cmd->srcY0 = srcY0;
255596c5ddc4Srjs   cmd->srcX1 = srcX1;
255696c5ddc4Srjs   cmd->srcY1 = srcY1;
255796c5ddc4Srjs   cmd->dstX0 = dstX0;
255896c5ddc4Srjs   cmd->dstY0 = dstY0;
255996c5ddc4Srjs   cmd->dstX1 = dstX1;
256096c5ddc4Srjs   cmd->dstY1 = dstY1;
256196c5ddc4Srjs   cmd->mask = mask;
256296c5ddc4Srjs   cmd->filter = filter;
256396c5ddc4Srjs}
256496c5ddc4Srjs
256596c5ddc4Srjs
256696c5ddc4Srjs/* GenerateMipmap: marshalled asynchronously */
256796c5ddc4Srjsstruct marshal_cmd_GenerateMipmap
256896c5ddc4Srjs{
256996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
257096c5ddc4Srjs   GLenum target;
257196c5ddc4Srjs};
257296c5ddc4Srjsuint32_t
257396c5ddc4Srjs_mesa_unmarshal_GenerateMipmap(struct gl_context *ctx, const struct marshal_cmd_GenerateMipmap *cmd, const uint64_t *last)
257496c5ddc4Srjs{
257596c5ddc4Srjs   GLenum target = cmd->target;
257696c5ddc4Srjs   CALL_GenerateMipmap(ctx->CurrentServerDispatch, (target));
257796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GenerateMipmap), 8) / 8);
257896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
257996c5ddc4Srjs   return cmd_size;
258096c5ddc4Srjs}
258196c5ddc4Srjsvoid GLAPIENTRY
258296c5ddc4Srjs_mesa_marshal_GenerateMipmap(GLenum target)
258396c5ddc4Srjs{
258496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
258596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GenerateMipmap);
258696c5ddc4Srjs   struct marshal_cmd_GenerateMipmap *cmd;
258796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GenerateMipmap, cmd_size);
258896c5ddc4Srjs   cmd->target = target;
258996c5ddc4Srjs}
259096c5ddc4Srjs
259196c5ddc4Srjs
259296c5ddc4Srjs/* VertexAttribDivisor: marshalled asynchronously */
259396c5ddc4Srjsstruct marshal_cmd_VertexAttribDivisor
259496c5ddc4Srjs{
259596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
259696c5ddc4Srjs   GLuint index;
259796c5ddc4Srjs   GLuint divisor;
259896c5ddc4Srjs};
259996c5ddc4Srjsuint32_t
260096c5ddc4Srjs_mesa_unmarshal_VertexAttribDivisor(struct gl_context *ctx, const struct marshal_cmd_VertexAttribDivisor *cmd, const uint64_t *last)
260196c5ddc4Srjs{
260296c5ddc4Srjs   GLuint index = cmd->index;
260396c5ddc4Srjs   GLuint divisor = cmd->divisor;
260496c5ddc4Srjs   CALL_VertexAttribDivisor(ctx->CurrentServerDispatch, (index, divisor));
260596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribDivisor), 8) / 8);
260696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
260796c5ddc4Srjs   return cmd_size;
260896c5ddc4Srjs}
260996c5ddc4Srjsvoid GLAPIENTRY
261096c5ddc4Srjs_mesa_marshal_VertexAttribDivisor(GLuint index, GLuint divisor)
261196c5ddc4Srjs{
261296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
261396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribDivisor);
261496c5ddc4Srjs   struct marshal_cmd_VertexAttribDivisor *cmd;
261596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribDivisor, cmd_size);
261696c5ddc4Srjs   cmd->index = index;
261796c5ddc4Srjs   cmd->divisor = divisor;
261896c5ddc4Srjs   if (COMPAT) _mesa_glthread_AttribDivisor(ctx, NULL, VERT_ATTRIB_GENERIC(index), divisor);
261996c5ddc4Srjs}
262096c5ddc4Srjs
262196c5ddc4Srjs
262296c5ddc4Srjs/* VertexArrayVertexAttribDivisorEXT: marshalled asynchronously */
262396c5ddc4Srjsstruct marshal_cmd_VertexArrayVertexAttribDivisorEXT
262496c5ddc4Srjs{
262596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
262696c5ddc4Srjs   GLuint vaobj;
262796c5ddc4Srjs   GLuint index;
262896c5ddc4Srjs   GLuint divisor;
262996c5ddc4Srjs};
263096c5ddc4Srjsuint32_t
263196c5ddc4Srjs_mesa_unmarshal_VertexArrayVertexAttribDivisorEXT(struct gl_context *ctx, const struct marshal_cmd_VertexArrayVertexAttribDivisorEXT *cmd, const uint64_t *last)
263296c5ddc4Srjs{
263396c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
263496c5ddc4Srjs   GLuint index = cmd->index;
263596c5ddc4Srjs   GLuint divisor = cmd->divisor;
263696c5ddc4Srjs   CALL_VertexArrayVertexAttribDivisorEXT(ctx->CurrentServerDispatch, (vaobj, index, divisor));
263796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexArrayVertexAttribDivisorEXT), 8) / 8);
263896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
263996c5ddc4Srjs   return cmd_size;
264096c5ddc4Srjs}
264196c5ddc4Srjsvoid GLAPIENTRY
264296c5ddc4Srjs_mesa_marshal_VertexArrayVertexAttribDivisorEXT(GLuint vaobj, GLuint index, GLuint divisor)
264396c5ddc4Srjs{
264496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
264596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexArrayVertexAttribDivisorEXT);
264696c5ddc4Srjs   struct marshal_cmd_VertexArrayVertexAttribDivisorEXT *cmd;
264796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayVertexAttribDivisorEXT, cmd_size);
264896c5ddc4Srjs   cmd->vaobj = vaobj;
264996c5ddc4Srjs   cmd->index = index;
265096c5ddc4Srjs   cmd->divisor = divisor;
265196c5ddc4Srjs   if (COMPAT) _mesa_glthread_AttribDivisor(ctx, &vaobj, VERT_ATTRIB_GENERIC(index), divisor);
265296c5ddc4Srjs}
265396c5ddc4Srjs
265496c5ddc4Srjs
265596c5ddc4Srjs/* MapBufferRange: marshalled synchronously */
265696c5ddc4SrjsGLvoid * GLAPIENTRY
265796c5ddc4Srjs_mesa_marshal_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
265896c5ddc4Srjs{
265996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
266096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "MapBufferRange");
266196c5ddc4Srjs   return CALL_MapBufferRange(ctx->CurrentServerDispatch, (target, offset, length, access));
266296c5ddc4Srjs}
266396c5ddc4Srjs
266496c5ddc4Srjs
266596c5ddc4Srjs/* FlushMappedBufferRange: marshalled asynchronously */
266696c5ddc4Srjsstruct marshal_cmd_FlushMappedBufferRange
266796c5ddc4Srjs{
266896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
266996c5ddc4Srjs   GLenum target;
267096c5ddc4Srjs   GLintptr offset;
267196c5ddc4Srjs   GLsizeiptr length;
267296c5ddc4Srjs};
267396c5ddc4Srjsuint32_t
267496c5ddc4Srjs_mesa_unmarshal_FlushMappedBufferRange(struct gl_context *ctx, const struct marshal_cmd_FlushMappedBufferRange *cmd, const uint64_t *last)
267596c5ddc4Srjs{
267696c5ddc4Srjs   GLenum target = cmd->target;
267796c5ddc4Srjs   GLintptr offset = cmd->offset;
267896c5ddc4Srjs   GLsizeiptr length = cmd->length;
267996c5ddc4Srjs   CALL_FlushMappedBufferRange(ctx->CurrentServerDispatch, (target, offset, length));
268096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FlushMappedBufferRange), 8) / 8);
268196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
268296c5ddc4Srjs   return cmd_size;
268396c5ddc4Srjs}
268496c5ddc4Srjsvoid GLAPIENTRY
268596c5ddc4Srjs_mesa_marshal_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
268696c5ddc4Srjs{
268796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
268896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_FlushMappedBufferRange);
268996c5ddc4Srjs   struct marshal_cmd_FlushMappedBufferRange *cmd;
269096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FlushMappedBufferRange, cmd_size);
269196c5ddc4Srjs   cmd->target = target;
269296c5ddc4Srjs   cmd->offset = offset;
269396c5ddc4Srjs   cmd->length = length;
269496c5ddc4Srjs}
269596c5ddc4Srjs
269696c5ddc4Srjs
269796c5ddc4Srjs/* TexBuffer: marshalled asynchronously */
269896c5ddc4Srjsstruct marshal_cmd_TexBuffer
269996c5ddc4Srjs{
270096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
270196c5ddc4Srjs   GLenum target;
270296c5ddc4Srjs   GLenum internalFormat;
270396c5ddc4Srjs   GLuint buffer;
270496c5ddc4Srjs};
270596c5ddc4Srjsuint32_t
270696c5ddc4Srjs_mesa_unmarshal_TexBuffer(struct gl_context *ctx, const struct marshal_cmd_TexBuffer *cmd, const uint64_t *last)
270796c5ddc4Srjs{
270896c5ddc4Srjs   GLenum target = cmd->target;
270996c5ddc4Srjs   GLenum internalFormat = cmd->internalFormat;
271096c5ddc4Srjs   GLuint buffer = cmd->buffer;
271196c5ddc4Srjs   CALL_TexBuffer(ctx->CurrentServerDispatch, (target, internalFormat, buffer));
271296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexBuffer), 8) / 8);
271396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
271496c5ddc4Srjs   return cmd_size;
271596c5ddc4Srjs}
271696c5ddc4Srjsvoid GLAPIENTRY
271796c5ddc4Srjs_mesa_marshal_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer)
271896c5ddc4Srjs{
271996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
272096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexBuffer);
272196c5ddc4Srjs   struct marshal_cmd_TexBuffer *cmd;
272296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexBuffer, cmd_size);
272396c5ddc4Srjs   cmd->target = target;
272496c5ddc4Srjs   cmd->internalFormat = internalFormat;
272596c5ddc4Srjs   cmd->buffer = buffer;
272696c5ddc4Srjs}
272796c5ddc4Srjs
272896c5ddc4Srjs
272996c5ddc4Srjs/* BindVertexArray: marshalled asynchronously */
273096c5ddc4Srjsstruct marshal_cmd_BindVertexArray
273196c5ddc4Srjs{
273296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
273396c5ddc4Srjs   GLuint array;
273496c5ddc4Srjs};
273596c5ddc4Srjsuint32_t
273696c5ddc4Srjs_mesa_unmarshal_BindVertexArray(struct gl_context *ctx, const struct marshal_cmd_BindVertexArray *cmd, const uint64_t *last)
273796c5ddc4Srjs{
273896c5ddc4Srjs   GLuint array = cmd->array;
273996c5ddc4Srjs   CALL_BindVertexArray(ctx->CurrentServerDispatch, (array));
274096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindVertexArray), 8) / 8);
274196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
274296c5ddc4Srjs   return cmd_size;
274396c5ddc4Srjs}
274496c5ddc4Srjsvoid GLAPIENTRY
274596c5ddc4Srjs_mesa_marshal_BindVertexArray(GLuint array)
274696c5ddc4Srjs{
274796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
274896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindVertexArray);
274996c5ddc4Srjs   struct marshal_cmd_BindVertexArray *cmd;
275096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindVertexArray, cmd_size);
275196c5ddc4Srjs   cmd->array = array;
275296c5ddc4Srjs   if (COMPAT) _mesa_glthread_BindVertexArray(ctx, array);
275396c5ddc4Srjs}
275496c5ddc4Srjs
275596c5ddc4Srjs
275696c5ddc4Srjs/* DeleteVertexArrays: marshalled asynchronously */
275796c5ddc4Srjsstruct marshal_cmd_DeleteVertexArrays
275896c5ddc4Srjs{
275996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
276096c5ddc4Srjs   GLsizei n;
276196c5ddc4Srjs   /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint arrays[n] */
276296c5ddc4Srjs};
276396c5ddc4Srjsuint32_t
276496c5ddc4Srjs_mesa_unmarshal_DeleteVertexArrays(struct gl_context *ctx, const struct marshal_cmd_DeleteVertexArrays *cmd, const uint64_t *last)
276596c5ddc4Srjs{
276696c5ddc4Srjs   GLsizei n = cmd->n;
276796c5ddc4Srjs   GLuint * arrays;
276896c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
276996c5ddc4Srjs   arrays = (GLuint *) variable_data;
277096c5ddc4Srjs   CALL_DeleteVertexArrays(ctx->CurrentServerDispatch, (n, arrays));
277196c5ddc4Srjs   return cmd->cmd_base.cmd_size;
277296c5ddc4Srjs}
277396c5ddc4Srjsvoid GLAPIENTRY
277496c5ddc4Srjs_mesa_marshal_DeleteVertexArrays(GLsizei n, const GLuint * arrays)
277596c5ddc4Srjs{
277696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
277796c5ddc4Srjs   int arrays_size = safe_mul(n, 1 * sizeof(GLuint));
277896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DeleteVertexArrays) + arrays_size;
277996c5ddc4Srjs   struct marshal_cmd_DeleteVertexArrays *cmd;
278096c5ddc4Srjs   if (unlikely(arrays_size < 0 || (arrays_size > 0 && !arrays) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
278196c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "DeleteVertexArrays");
278296c5ddc4Srjs      CALL_DeleteVertexArrays(ctx->CurrentServerDispatch, (n, arrays));
278396c5ddc4Srjs      if (COMPAT) _mesa_glthread_DeleteVertexArrays(ctx, n, arrays);
278496c5ddc4Srjs      return;
278596c5ddc4Srjs   }
278696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteVertexArrays, cmd_size);
278796c5ddc4Srjs   cmd->n = n;
278896c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
278996c5ddc4Srjs   memcpy(variable_data, arrays, arrays_size);
279096c5ddc4Srjs   if (COMPAT) _mesa_glthread_DeleteVertexArrays(ctx, n, arrays);
279196c5ddc4Srjs}
279296c5ddc4Srjs
279396c5ddc4Srjs
279496c5ddc4Srjs/* GenVertexArrays: marshalled synchronously */
279596c5ddc4Srjsvoid GLAPIENTRY
279696c5ddc4Srjs_mesa_marshal_GenVertexArrays(GLsizei n, GLuint * arrays)
279796c5ddc4Srjs{
279896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
279996c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GenVertexArrays");
280096c5ddc4Srjs   CALL_GenVertexArrays(ctx->CurrentServerDispatch, (n, arrays));
280196c5ddc4Srjs   if (COMPAT) _mesa_glthread_GenVertexArrays(ctx, n, arrays);
280296c5ddc4Srjs}
280396c5ddc4Srjs
280496c5ddc4Srjs
280596c5ddc4Srjs/* IsVertexArray: marshalled synchronously */
280696c5ddc4SrjsGLboolean GLAPIENTRY
280796c5ddc4Srjs_mesa_marshal_IsVertexArray(GLuint array)
280896c5ddc4Srjs{
280996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
281096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsVertexArray");
281196c5ddc4Srjs   return CALL_IsVertexArray(ctx->CurrentServerDispatch, (array));
281296c5ddc4Srjs}
281396c5ddc4Srjs
281496c5ddc4Srjs
281596c5ddc4Srjs/* GetUniformIndices: marshalled synchronously */
281696c5ddc4Srjsvoid GLAPIENTRY
281796c5ddc4Srjs_mesa_marshal_GetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar * const * uniformNames, GLuint * uniformIndices)
281896c5ddc4Srjs{
281996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
282096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetUniformIndices");
282196c5ddc4Srjs   CALL_GetUniformIndices(ctx->CurrentServerDispatch, (program, uniformCount, uniformNames, uniformIndices));
282296c5ddc4Srjs}
282396c5ddc4Srjs
282496c5ddc4Srjs
282596c5ddc4Srjs/* GetActiveUniformsiv: marshalled synchronously */
282696c5ddc4Srjsvoid GLAPIENTRY
282796c5ddc4Srjs_mesa_marshal_GetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params)
282896c5ddc4Srjs{
282996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
283096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetActiveUniformsiv");
283196c5ddc4Srjs   CALL_GetActiveUniformsiv(ctx->CurrentServerDispatch, (program, uniformCount, uniformIndices, pname, params));
283296c5ddc4Srjs}
283396c5ddc4Srjs
283496c5ddc4Srjs
283596c5ddc4Srjs/* GetActiveUniformName: marshalled synchronously */
283696c5ddc4Srjsvoid GLAPIENTRY
283796c5ddc4Srjs_mesa_marshal_GetActiveUniformName(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformName)
283896c5ddc4Srjs{
283996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
284096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetActiveUniformName");
284196c5ddc4Srjs   CALL_GetActiveUniformName(ctx->CurrentServerDispatch, (program, uniformIndex, bufSize, length, uniformName));
284296c5ddc4Srjs}
284396c5ddc4Srjs
284496c5ddc4Srjs
284596c5ddc4Srjs/* GetUniformBlockIndex: marshalled synchronously */
284696c5ddc4SrjsGLuint GLAPIENTRY
284796c5ddc4Srjs_mesa_marshal_GetUniformBlockIndex(GLuint program, const GLchar * uniformBlockName)
284896c5ddc4Srjs{
284996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
285096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetUniformBlockIndex");
285196c5ddc4Srjs   return CALL_GetUniformBlockIndex(ctx->CurrentServerDispatch, (program, uniformBlockName));
285296c5ddc4Srjs}
285396c5ddc4Srjs
285496c5ddc4Srjs
285596c5ddc4Srjs/* GetActiveUniformBlockiv: marshalled synchronously */
285696c5ddc4Srjsvoid GLAPIENTRY
285796c5ddc4Srjs_mesa_marshal_GetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params)
285896c5ddc4Srjs{
285996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
286096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetActiveUniformBlockiv");
286196c5ddc4Srjs   CALL_GetActiveUniformBlockiv(ctx->CurrentServerDispatch, (program, uniformBlockIndex, pname, params));
286296c5ddc4Srjs}
286396c5ddc4Srjs
286496c5ddc4Srjs
286596c5ddc4Srjs/* GetActiveUniformBlockName: marshalled synchronously */
286696c5ddc4Srjsvoid GLAPIENTRY
286796c5ddc4Srjs_mesa_marshal_GetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName)
286896c5ddc4Srjs{
286996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
287096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetActiveUniformBlockName");
287196c5ddc4Srjs   CALL_GetActiveUniformBlockName(ctx->CurrentServerDispatch, (program, uniformBlockIndex, bufSize, length, uniformBlockName));
287296c5ddc4Srjs}
287396c5ddc4Srjs
287496c5ddc4Srjs
287596c5ddc4Srjs/* UniformBlockBinding: marshalled asynchronously */
287696c5ddc4Srjsstruct marshal_cmd_UniformBlockBinding
287796c5ddc4Srjs{
287896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
287996c5ddc4Srjs   GLuint program;
288096c5ddc4Srjs   GLuint uniformBlockIndex;
288196c5ddc4Srjs   GLuint uniformBlockBinding;
288296c5ddc4Srjs};
288396c5ddc4Srjsuint32_t
288496c5ddc4Srjs_mesa_unmarshal_UniformBlockBinding(struct gl_context *ctx, const struct marshal_cmd_UniformBlockBinding *cmd, const uint64_t *last)
288596c5ddc4Srjs{
288696c5ddc4Srjs   GLuint program = cmd->program;
288796c5ddc4Srjs   GLuint uniformBlockIndex = cmd->uniformBlockIndex;
288896c5ddc4Srjs   GLuint uniformBlockBinding = cmd->uniformBlockBinding;
288996c5ddc4Srjs   CALL_UniformBlockBinding(ctx->CurrentServerDispatch, (program, uniformBlockIndex, uniformBlockBinding));
289096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_UniformBlockBinding), 8) / 8);
289196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
289296c5ddc4Srjs   return cmd_size;
289396c5ddc4Srjs}
289496c5ddc4Srjsvoid GLAPIENTRY
289596c5ddc4Srjs_mesa_marshal_UniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
289696c5ddc4Srjs{
289796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
289896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformBlockBinding);
289996c5ddc4Srjs   struct marshal_cmd_UniformBlockBinding *cmd;
290096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformBlockBinding, cmd_size);
290196c5ddc4Srjs   cmd->program = program;
290296c5ddc4Srjs   cmd->uniformBlockIndex = uniformBlockIndex;
290396c5ddc4Srjs   cmd->uniformBlockBinding = uniformBlockBinding;
290496c5ddc4Srjs}
290596c5ddc4Srjs
290696c5ddc4Srjs
290796c5ddc4Srjs/* CopyBufferSubData: marshalled asynchronously */
290896c5ddc4Srjsstruct marshal_cmd_CopyBufferSubData
290996c5ddc4Srjs{
291096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
291196c5ddc4Srjs   GLenum readTarget;
291296c5ddc4Srjs   GLenum writeTarget;
291396c5ddc4Srjs   GLintptr readOffset;
291496c5ddc4Srjs   GLintptr writeOffset;
291596c5ddc4Srjs   GLsizeiptr size;
291696c5ddc4Srjs};
291796c5ddc4Srjsuint32_t
291896c5ddc4Srjs_mesa_unmarshal_CopyBufferSubData(struct gl_context *ctx, const struct marshal_cmd_CopyBufferSubData *cmd, const uint64_t *last)
291996c5ddc4Srjs{
292096c5ddc4Srjs   GLenum readTarget = cmd->readTarget;
292196c5ddc4Srjs   GLenum writeTarget = cmd->writeTarget;
292296c5ddc4Srjs   GLintptr readOffset = cmd->readOffset;
292396c5ddc4Srjs   GLintptr writeOffset = cmd->writeOffset;
292496c5ddc4Srjs   GLsizeiptr size = cmd->size;
292596c5ddc4Srjs   CALL_CopyBufferSubData(ctx->CurrentServerDispatch, (readTarget, writeTarget, readOffset, writeOffset, size));
292696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CopyBufferSubData), 8) / 8);
292796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
292896c5ddc4Srjs   return cmd_size;
292996c5ddc4Srjs}
293096c5ddc4Srjsvoid GLAPIENTRY
293196c5ddc4Srjs_mesa_marshal_CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
293296c5ddc4Srjs{
293396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
293496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CopyBufferSubData);
293596c5ddc4Srjs   struct marshal_cmd_CopyBufferSubData *cmd;
293696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyBufferSubData, cmd_size);
293796c5ddc4Srjs   cmd->readTarget = readTarget;
293896c5ddc4Srjs   cmd->writeTarget = writeTarget;
293996c5ddc4Srjs   cmd->readOffset = readOffset;
294096c5ddc4Srjs   cmd->writeOffset = writeOffset;
294196c5ddc4Srjs   cmd->size = size;
294296c5ddc4Srjs}
294396c5ddc4Srjs
294496c5ddc4Srjs
294596c5ddc4Srjs/* FenceSync: marshalled synchronously */
294696c5ddc4SrjsGLsync GLAPIENTRY
294796c5ddc4Srjs_mesa_marshal_FenceSync(GLenum condition, GLbitfield flags)
294896c5ddc4Srjs{
294996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
295096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "FenceSync");
295196c5ddc4Srjs   return CALL_FenceSync(ctx->CurrentServerDispatch, (condition, flags));
295296c5ddc4Srjs}
295396c5ddc4Srjs
295496c5ddc4Srjs
295596c5ddc4Srjs/* IsSync: marshalled synchronously */
295696c5ddc4SrjsGLboolean GLAPIENTRY
295796c5ddc4Srjs_mesa_marshal_IsSync(GLsync sync)
295896c5ddc4Srjs{
295996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
296096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsSync");
296196c5ddc4Srjs   return CALL_IsSync(ctx->CurrentServerDispatch, (sync));
296296c5ddc4Srjs}
296396c5ddc4Srjs
296496c5ddc4Srjs
296596c5ddc4Srjs/* DeleteSync: marshalled asynchronously */
296696c5ddc4Srjsstruct marshal_cmd_DeleteSync
296796c5ddc4Srjs{
296896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
296996c5ddc4Srjs   GLsync sync;
297096c5ddc4Srjs};
297196c5ddc4Srjsuint32_t
297296c5ddc4Srjs_mesa_unmarshal_DeleteSync(struct gl_context *ctx, const struct marshal_cmd_DeleteSync *cmd, const uint64_t *last)
297396c5ddc4Srjs{
297496c5ddc4Srjs   GLsync sync = cmd->sync;
297596c5ddc4Srjs   CALL_DeleteSync(ctx->CurrentServerDispatch, (sync));
297696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DeleteSync), 8) / 8);
297796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
297896c5ddc4Srjs   return cmd_size;
297996c5ddc4Srjs}
298096c5ddc4Srjsvoid GLAPIENTRY
298196c5ddc4Srjs_mesa_marshal_DeleteSync(GLsync sync)
298296c5ddc4Srjs{
298396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
298496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DeleteSync);
298596c5ddc4Srjs   struct marshal_cmd_DeleteSync *cmd;
298696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteSync, cmd_size);
298796c5ddc4Srjs   cmd->sync = sync;
298896c5ddc4Srjs}
298996c5ddc4Srjs
299096c5ddc4Srjs
299196c5ddc4Srjs/* ClientWaitSync: marshalled synchronously */
299296c5ddc4SrjsGLenum GLAPIENTRY
299396c5ddc4Srjs_mesa_marshal_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
299496c5ddc4Srjs{
299596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
299696c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ClientWaitSync");
299796c5ddc4Srjs   return CALL_ClientWaitSync(ctx->CurrentServerDispatch, (sync, flags, timeout));
299896c5ddc4Srjs}
299996c5ddc4Srjs
300096c5ddc4Srjs
300196c5ddc4Srjs/* WaitSync: marshalled asynchronously */
300296c5ddc4Srjsstruct marshal_cmd_WaitSync
300396c5ddc4Srjs{
300496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
300596c5ddc4Srjs   GLbitfield flags;
300696c5ddc4Srjs   GLsync sync;
300796c5ddc4Srjs   GLuint64 timeout;
300896c5ddc4Srjs};
300996c5ddc4Srjsuint32_t
301096c5ddc4Srjs_mesa_unmarshal_WaitSync(struct gl_context *ctx, const struct marshal_cmd_WaitSync *cmd, const uint64_t *last)
301196c5ddc4Srjs{
301296c5ddc4Srjs   GLsync sync = cmd->sync;
301396c5ddc4Srjs   GLbitfield flags = cmd->flags;
301496c5ddc4Srjs   GLuint64 timeout = cmd->timeout;
301596c5ddc4Srjs   CALL_WaitSync(ctx->CurrentServerDispatch, (sync, flags, timeout));
301696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WaitSync), 8) / 8);
301796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
301896c5ddc4Srjs   return cmd_size;
301996c5ddc4Srjs}
302096c5ddc4Srjsvoid GLAPIENTRY
302196c5ddc4Srjs_mesa_marshal_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
302296c5ddc4Srjs{
302396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
302496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WaitSync);
302596c5ddc4Srjs   struct marshal_cmd_WaitSync *cmd;
302696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WaitSync, cmd_size);
302796c5ddc4Srjs   cmd->sync = sync;
302896c5ddc4Srjs   cmd->flags = flags;
302996c5ddc4Srjs   cmd->timeout = timeout;
303096c5ddc4Srjs}
303196c5ddc4Srjs
303296c5ddc4Srjs
303396c5ddc4Srjs/* GetInteger64v: marshalled synchronously */
303496c5ddc4Srjsvoid GLAPIENTRY
303596c5ddc4Srjs_mesa_marshal_GetInteger64v(GLenum pname, GLint64 * params)
303696c5ddc4Srjs{
303796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
303896c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetInteger64v");
303996c5ddc4Srjs   CALL_GetInteger64v(ctx->CurrentServerDispatch, (pname, params));
304096c5ddc4Srjs}
304196c5ddc4Srjs
304296c5ddc4Srjs
304396c5ddc4Srjs/* GetSynciv: marshalled synchronously */
304496c5ddc4Srjsvoid GLAPIENTRY
304596c5ddc4Srjs_mesa_marshal_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values)
304696c5ddc4Srjs{
304796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
304896c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetSynciv");
304996c5ddc4Srjs   CALL_GetSynciv(ctx->CurrentServerDispatch, (sync, pname, bufSize, length, values));
305096c5ddc4Srjs}
305196c5ddc4Srjs
305296c5ddc4Srjs
305396c5ddc4Srjs/* TexImage2DMultisample: marshalled asynchronously */
305496c5ddc4Srjsstruct marshal_cmd_TexImage2DMultisample
305596c5ddc4Srjs{
305696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
305796c5ddc4Srjs   GLboolean fixedsamplelocations;
305896c5ddc4Srjs   GLenum target;
305996c5ddc4Srjs   GLsizei samples;
306096c5ddc4Srjs   GLenum internalformat;
306196c5ddc4Srjs   GLsizei width;
306296c5ddc4Srjs   GLsizei height;
306396c5ddc4Srjs};
306496c5ddc4Srjsuint32_t
306596c5ddc4Srjs_mesa_unmarshal_TexImage2DMultisample(struct gl_context *ctx, const struct marshal_cmd_TexImage2DMultisample *cmd, const uint64_t *last)
306696c5ddc4Srjs{
306796c5ddc4Srjs   GLenum target = cmd->target;
306896c5ddc4Srjs   GLsizei samples = cmd->samples;
306996c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
307096c5ddc4Srjs   GLsizei width = cmd->width;
307196c5ddc4Srjs   GLsizei height = cmd->height;
307296c5ddc4Srjs   GLboolean fixedsamplelocations = cmd->fixedsamplelocations;
307396c5ddc4Srjs   CALL_TexImage2DMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height, fixedsamplelocations));
307496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexImage2DMultisample), 8) / 8);
307596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
307696c5ddc4Srjs   return cmd_size;
307796c5ddc4Srjs}
307896c5ddc4Srjsvoid GLAPIENTRY
307996c5ddc4Srjs_mesa_marshal_TexImage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
308096c5ddc4Srjs{
308196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
308296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexImage2DMultisample);
308396c5ddc4Srjs   struct marshal_cmd_TexImage2DMultisample *cmd;
308496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexImage2DMultisample, cmd_size);
308596c5ddc4Srjs   cmd->target = target;
308696c5ddc4Srjs   cmd->samples = samples;
308796c5ddc4Srjs   cmd->internalformat = internalformat;
308896c5ddc4Srjs   cmd->width = width;
308996c5ddc4Srjs   cmd->height = height;
309096c5ddc4Srjs   cmd->fixedsamplelocations = fixedsamplelocations;
309196c5ddc4Srjs}
309296c5ddc4Srjs
309396c5ddc4Srjs
309496c5ddc4Srjs/* TexImage3DMultisample: marshalled asynchronously */
309596c5ddc4Srjsstruct marshal_cmd_TexImage3DMultisample
309696c5ddc4Srjs{
309796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
309896c5ddc4Srjs   GLboolean fixedsamplelocations;
309996c5ddc4Srjs   GLenum target;
310096c5ddc4Srjs   GLsizei samples;
310196c5ddc4Srjs   GLenum internalformat;
310296c5ddc4Srjs   GLsizei width;
310396c5ddc4Srjs   GLsizei height;
310496c5ddc4Srjs   GLsizei depth;
310596c5ddc4Srjs};
310696c5ddc4Srjsuint32_t
310796c5ddc4Srjs_mesa_unmarshal_TexImage3DMultisample(struct gl_context *ctx, const struct marshal_cmd_TexImage3DMultisample *cmd, const uint64_t *last)
310896c5ddc4Srjs{
310996c5ddc4Srjs   GLenum target = cmd->target;
311096c5ddc4Srjs   GLsizei samples = cmd->samples;
311196c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
311296c5ddc4Srjs   GLsizei width = cmd->width;
311396c5ddc4Srjs   GLsizei height = cmd->height;
311496c5ddc4Srjs   GLsizei depth = cmd->depth;
311596c5ddc4Srjs   GLboolean fixedsamplelocations = cmd->fixedsamplelocations;
311696c5ddc4Srjs   CALL_TexImage3DMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height, depth, fixedsamplelocations));
311796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexImage3DMultisample), 8) / 8);
311896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
311996c5ddc4Srjs   return cmd_size;
312096c5ddc4Srjs}
312196c5ddc4Srjsvoid GLAPIENTRY
312296c5ddc4Srjs_mesa_marshal_TexImage3DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)
312396c5ddc4Srjs{
312496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
312596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexImage3DMultisample);
312696c5ddc4Srjs   struct marshal_cmd_TexImage3DMultisample *cmd;
312796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexImage3DMultisample, cmd_size);
312896c5ddc4Srjs   cmd->target = target;
312996c5ddc4Srjs   cmd->samples = samples;
313096c5ddc4Srjs   cmd->internalformat = internalformat;
313196c5ddc4Srjs   cmd->width = width;
313296c5ddc4Srjs   cmd->height = height;
313396c5ddc4Srjs   cmd->depth = depth;
313496c5ddc4Srjs   cmd->fixedsamplelocations = fixedsamplelocations;
313596c5ddc4Srjs}
313696c5ddc4Srjs
313796c5ddc4Srjs
313896c5ddc4Srjs/* GetMultisamplefv: marshalled synchronously */
313996c5ddc4Srjsvoid GLAPIENTRY
314096c5ddc4Srjs_mesa_marshal_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val)
314196c5ddc4Srjs{
314296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
314396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetMultisamplefv");
314496c5ddc4Srjs   CALL_GetMultisamplefv(ctx->CurrentServerDispatch, (pname, index, val));
314596c5ddc4Srjs}
314696c5ddc4Srjs
314796c5ddc4Srjs
314896c5ddc4Srjs/* SampleMaski: marshalled asynchronously */
314996c5ddc4Srjsstruct marshal_cmd_SampleMaski
315096c5ddc4Srjs{
315196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
315296c5ddc4Srjs   GLuint index;
315396c5ddc4Srjs   GLbitfield mask;
315496c5ddc4Srjs};
315596c5ddc4Srjsuint32_t
315696c5ddc4Srjs_mesa_unmarshal_SampleMaski(struct gl_context *ctx, const struct marshal_cmd_SampleMaski *cmd, const uint64_t *last)
315796c5ddc4Srjs{
315896c5ddc4Srjs   GLuint index = cmd->index;
315996c5ddc4Srjs   GLbitfield mask = cmd->mask;
316096c5ddc4Srjs   CALL_SampleMaski(ctx->CurrentServerDispatch, (index, mask));
316196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SampleMaski), 8) / 8);
316296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
316396c5ddc4Srjs   return cmd_size;
316496c5ddc4Srjs}
316596c5ddc4Srjsvoid GLAPIENTRY
316696c5ddc4Srjs_mesa_marshal_SampleMaski(GLuint index, GLbitfield mask)
316796c5ddc4Srjs{
316896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
316996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SampleMaski);
317096c5ddc4Srjs   struct marshal_cmd_SampleMaski *cmd;
317196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SampleMaski, cmd_size);
317296c5ddc4Srjs   cmd->index = index;
317396c5ddc4Srjs   cmd->mask = mask;
317496c5ddc4Srjs}
317596c5ddc4Srjs
317696c5ddc4Srjs
317796c5ddc4Srjs/* BlendEquationiARB: marshalled asynchronously */
317896c5ddc4Srjsstruct marshal_cmd_BlendEquationiARB
317996c5ddc4Srjs{
318096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
318196c5ddc4Srjs   GLuint buf;
318296c5ddc4Srjs   GLenum mode;
318396c5ddc4Srjs};
318496c5ddc4Srjsuint32_t
318596c5ddc4Srjs_mesa_unmarshal_BlendEquationiARB(struct gl_context *ctx, const struct marshal_cmd_BlendEquationiARB *cmd, const uint64_t *last)
318696c5ddc4Srjs{
318796c5ddc4Srjs   GLuint buf = cmd->buf;
318896c5ddc4Srjs   GLenum mode = cmd->mode;
318996c5ddc4Srjs   CALL_BlendEquationiARB(ctx->CurrentServerDispatch, (buf, mode));
319096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BlendEquationiARB), 8) / 8);
319196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
319296c5ddc4Srjs   return cmd_size;
319396c5ddc4Srjs}
319496c5ddc4Srjsvoid GLAPIENTRY
319596c5ddc4Srjs_mesa_marshal_BlendEquationiARB(GLuint buf, GLenum mode)
319696c5ddc4Srjs{
319796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
319896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BlendEquationiARB);
319996c5ddc4Srjs   struct marshal_cmd_BlendEquationiARB *cmd;
320096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendEquationiARB, cmd_size);
320196c5ddc4Srjs   cmd->buf = buf;
320296c5ddc4Srjs   cmd->mode = mode;
320396c5ddc4Srjs}
320496c5ddc4Srjs
320596c5ddc4Srjs
320696c5ddc4Srjs/* BlendEquationSeparateiARB: marshalled asynchronously */
320796c5ddc4Srjsstruct marshal_cmd_BlendEquationSeparateiARB
320896c5ddc4Srjs{
320996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
321096c5ddc4Srjs   GLuint buf;
321196c5ddc4Srjs   GLenum modeRGB;
321296c5ddc4Srjs   GLenum modeA;
321396c5ddc4Srjs};
321496c5ddc4Srjsuint32_t
321596c5ddc4Srjs_mesa_unmarshal_BlendEquationSeparateiARB(struct gl_context *ctx, const struct marshal_cmd_BlendEquationSeparateiARB *cmd, const uint64_t *last)
321696c5ddc4Srjs{
321796c5ddc4Srjs   GLuint buf = cmd->buf;
321896c5ddc4Srjs   GLenum modeRGB = cmd->modeRGB;
321996c5ddc4Srjs   GLenum modeA = cmd->modeA;
322096c5ddc4Srjs   CALL_BlendEquationSeparateiARB(ctx->CurrentServerDispatch, (buf, modeRGB, modeA));
322196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BlendEquationSeparateiARB), 8) / 8);
322296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
322396c5ddc4Srjs   return cmd_size;
322496c5ddc4Srjs}
322596c5ddc4Srjsvoid GLAPIENTRY
322696c5ddc4Srjs_mesa_marshal_BlendEquationSeparateiARB(GLuint buf, GLenum modeRGB, GLenum modeA)
322796c5ddc4Srjs{
322896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
322996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BlendEquationSeparateiARB);
323096c5ddc4Srjs   struct marshal_cmd_BlendEquationSeparateiARB *cmd;
323196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendEquationSeparateiARB, cmd_size);
323296c5ddc4Srjs   cmd->buf = buf;
323396c5ddc4Srjs   cmd->modeRGB = modeRGB;
323496c5ddc4Srjs   cmd->modeA = modeA;
323596c5ddc4Srjs}
323696c5ddc4Srjs
323796c5ddc4Srjs
323896c5ddc4Srjs/* BlendFunciARB: marshalled asynchronously */
323996c5ddc4Srjsstruct marshal_cmd_BlendFunciARB
324096c5ddc4Srjs{
324196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
324296c5ddc4Srjs   GLuint buf;
324396c5ddc4Srjs   GLenum src;
324496c5ddc4Srjs   GLenum dst;
324596c5ddc4Srjs};
324696c5ddc4Srjsuint32_t
324796c5ddc4Srjs_mesa_unmarshal_BlendFunciARB(struct gl_context *ctx, const struct marshal_cmd_BlendFunciARB *cmd, const uint64_t *last)
324896c5ddc4Srjs{
324996c5ddc4Srjs   GLuint buf = cmd->buf;
325096c5ddc4Srjs   GLenum src = cmd->src;
325196c5ddc4Srjs   GLenum dst = cmd->dst;
325296c5ddc4Srjs   CALL_BlendFunciARB(ctx->CurrentServerDispatch, (buf, src, dst));
325396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BlendFunciARB), 8) / 8);
325496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
325596c5ddc4Srjs   return cmd_size;
325696c5ddc4Srjs}
325796c5ddc4Srjsvoid GLAPIENTRY
325896c5ddc4Srjs_mesa_marshal_BlendFunciARB(GLuint buf, GLenum src, GLenum dst)
325996c5ddc4Srjs{
326096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
326196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BlendFunciARB);
326296c5ddc4Srjs   struct marshal_cmd_BlendFunciARB *cmd;
326396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendFunciARB, cmd_size);
326496c5ddc4Srjs   cmd->buf = buf;
326596c5ddc4Srjs   cmd->src = src;
326696c5ddc4Srjs   cmd->dst = dst;
326796c5ddc4Srjs}
326896c5ddc4Srjs
326996c5ddc4Srjs
327096c5ddc4Srjs/* BlendFuncSeparateiARB: marshalled asynchronously */
327196c5ddc4Srjsstruct marshal_cmd_BlendFuncSeparateiARB
327296c5ddc4Srjs{
327396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
327496c5ddc4Srjs   GLuint buf;
327596c5ddc4Srjs   GLenum srcRGB;
327696c5ddc4Srjs   GLenum dstRGB;
327796c5ddc4Srjs   GLenum srcA;
327896c5ddc4Srjs   GLenum dstA;
327996c5ddc4Srjs};
328096c5ddc4Srjsuint32_t
328196c5ddc4Srjs_mesa_unmarshal_BlendFuncSeparateiARB(struct gl_context *ctx, const struct marshal_cmd_BlendFuncSeparateiARB *cmd, const uint64_t *last)
328296c5ddc4Srjs{
328396c5ddc4Srjs   GLuint buf = cmd->buf;
328496c5ddc4Srjs   GLenum srcRGB = cmd->srcRGB;
328596c5ddc4Srjs   GLenum dstRGB = cmd->dstRGB;
328696c5ddc4Srjs   GLenum srcA = cmd->srcA;
328796c5ddc4Srjs   GLenum dstA = cmd->dstA;
328896c5ddc4Srjs   CALL_BlendFuncSeparateiARB(ctx->CurrentServerDispatch, (buf, srcRGB, dstRGB, srcA, dstA));
328996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BlendFuncSeparateiARB), 8) / 8);
329096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
329196c5ddc4Srjs   return cmd_size;
329296c5ddc4Srjs}
329396c5ddc4Srjsvoid GLAPIENTRY
329496c5ddc4Srjs_mesa_marshal_BlendFuncSeparateiARB(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA)
329596c5ddc4Srjs{
329696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
329796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BlendFuncSeparateiARB);
329896c5ddc4Srjs   struct marshal_cmd_BlendFuncSeparateiARB *cmd;
329996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendFuncSeparateiARB, cmd_size);
330096c5ddc4Srjs   cmd->buf = buf;
330196c5ddc4Srjs   cmd->srcRGB = srcRGB;
330296c5ddc4Srjs   cmd->dstRGB = dstRGB;
330396c5ddc4Srjs   cmd->srcA = srcA;
330496c5ddc4Srjs   cmd->dstA = dstA;
330596c5ddc4Srjs}
330696c5ddc4Srjs
330796c5ddc4Srjs
330896c5ddc4Srjs/* MinSampleShading: marshalled asynchronously */
330996c5ddc4Srjsstruct marshal_cmd_MinSampleShading
331096c5ddc4Srjs{
331196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
331296c5ddc4Srjs   GLfloat value;
331396c5ddc4Srjs};
331496c5ddc4Srjsuint32_t
331596c5ddc4Srjs_mesa_unmarshal_MinSampleShading(struct gl_context *ctx, const struct marshal_cmd_MinSampleShading *cmd, const uint64_t *last)
331696c5ddc4Srjs{
331796c5ddc4Srjs   GLfloat value = cmd->value;
331896c5ddc4Srjs   CALL_MinSampleShading(ctx->CurrentServerDispatch, (value));
331996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MinSampleShading), 8) / 8);
332096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
332196c5ddc4Srjs   return cmd_size;
332296c5ddc4Srjs}
332396c5ddc4Srjsvoid GLAPIENTRY
332496c5ddc4Srjs_mesa_marshal_MinSampleShading(GLfloat value)
332596c5ddc4Srjs{
332696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
332796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MinSampleShading);
332896c5ddc4Srjs   struct marshal_cmd_MinSampleShading *cmd;
332996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MinSampleShading, cmd_size);
333096c5ddc4Srjs   cmd->value = value;
333196c5ddc4Srjs}
333296c5ddc4Srjs
333396c5ddc4Srjs
333496c5ddc4Srjs/* NamedStringARB: marshalled asynchronously */
333596c5ddc4Srjsstruct marshal_cmd_NamedStringARB
333696c5ddc4Srjs{
333796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
333896c5ddc4Srjs   GLenum type;
333996c5ddc4Srjs   GLint namelen;
334096c5ddc4Srjs   GLint stringlen;
334196c5ddc4Srjs   /* Next namelen bytes are GLchar name[namelen] */
334296c5ddc4Srjs   /* Next stringlen bytes are GLchar string[stringlen] */
334396c5ddc4Srjs};
334496c5ddc4Srjsuint32_t
334596c5ddc4Srjs_mesa_unmarshal_NamedStringARB(struct gl_context *ctx, const struct marshal_cmd_NamedStringARB *cmd, const uint64_t *last)
334696c5ddc4Srjs{
334796c5ddc4Srjs   GLenum type = cmd->type;
334896c5ddc4Srjs   GLint namelen = cmd->namelen;
334996c5ddc4Srjs   GLint stringlen = cmd->stringlen;
335096c5ddc4Srjs   GLchar * name;
335196c5ddc4Srjs   GLchar * string;
335296c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
335396c5ddc4Srjs   name = (GLchar *) variable_data;
335496c5ddc4Srjs   variable_data += namelen;
335596c5ddc4Srjs   string = (GLchar *) variable_data;
335696c5ddc4Srjs   CALL_NamedStringARB(ctx->CurrentServerDispatch, (type, namelen, name, stringlen, string));
335796c5ddc4Srjs   return cmd->cmd_base.cmd_size;
335896c5ddc4Srjs}
335996c5ddc4Srjsvoid GLAPIENTRY
336096c5ddc4Srjs_mesa_marshal_NamedStringARB(GLenum type, GLint namelen, const GLchar * name, GLint stringlen, const GLchar * string)
336196c5ddc4Srjs{
336296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
336396c5ddc4Srjs   int name_size = namelen;
336496c5ddc4Srjs   int string_size = stringlen;
336596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_NamedStringARB) + name_size + string_size;
336696c5ddc4Srjs   struct marshal_cmd_NamedStringARB *cmd;
336796c5ddc4Srjs   if (unlikely(name_size < 0 || (name_size > 0 && !name) || string_size < 0 || (string_size > 0 && !string) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
336896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "NamedStringARB");
336996c5ddc4Srjs      CALL_NamedStringARB(ctx->CurrentServerDispatch, (type, namelen, name, stringlen, string));
337096c5ddc4Srjs      return;
337196c5ddc4Srjs   }
337296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedStringARB, cmd_size);
337396c5ddc4Srjs   cmd->type = type;
337496c5ddc4Srjs   cmd->namelen = namelen;
337596c5ddc4Srjs   cmd->stringlen = stringlen;
337696c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
337796c5ddc4Srjs   memcpy(variable_data, name, name_size);
337896c5ddc4Srjs   variable_data += name_size;
337996c5ddc4Srjs   memcpy(variable_data, string, string_size);
338096c5ddc4Srjs}
338196c5ddc4Srjs
338296c5ddc4Srjs
338396c5ddc4Srjs/* DeleteNamedStringARB: marshalled asynchronously */
338496c5ddc4Srjsstruct marshal_cmd_DeleteNamedStringARB
338596c5ddc4Srjs{
338696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
338796c5ddc4Srjs   GLint namelen;
338896c5ddc4Srjs   /* Next namelen bytes are GLchar name[namelen] */
338996c5ddc4Srjs};
339096c5ddc4Srjsuint32_t
339196c5ddc4Srjs_mesa_unmarshal_DeleteNamedStringARB(struct gl_context *ctx, const struct marshal_cmd_DeleteNamedStringARB *cmd, const uint64_t *last)
339296c5ddc4Srjs{
339396c5ddc4Srjs   GLint namelen = cmd->namelen;
339496c5ddc4Srjs   GLchar * name;
339596c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
339696c5ddc4Srjs   name = (GLchar *) variable_data;
339796c5ddc4Srjs   CALL_DeleteNamedStringARB(ctx->CurrentServerDispatch, (namelen, name));
339896c5ddc4Srjs   return cmd->cmd_base.cmd_size;
339996c5ddc4Srjs}
340096c5ddc4Srjsvoid GLAPIENTRY
340196c5ddc4Srjs_mesa_marshal_DeleteNamedStringARB(GLint namelen, const GLchar * name)
340296c5ddc4Srjs{
340396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
340496c5ddc4Srjs   int name_size = namelen;
340596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DeleteNamedStringARB) + name_size;
340696c5ddc4Srjs   struct marshal_cmd_DeleteNamedStringARB *cmd;
340796c5ddc4Srjs   if (unlikely(name_size < 0 || (name_size > 0 && !name) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
340896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "DeleteNamedStringARB");
340996c5ddc4Srjs      CALL_DeleteNamedStringARB(ctx->CurrentServerDispatch, (namelen, name));
341096c5ddc4Srjs      return;
341196c5ddc4Srjs   }
341296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteNamedStringARB, cmd_size);
341396c5ddc4Srjs   cmd->namelen = namelen;
341496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
341596c5ddc4Srjs   memcpy(variable_data, name, name_size);
341696c5ddc4Srjs}
341796c5ddc4Srjs
341896c5ddc4Srjs
341996c5ddc4Srjs/* CompileShaderIncludeARB: marshalled synchronously */
342096c5ddc4Srjsvoid GLAPIENTRY
342196c5ddc4Srjs_mesa_marshal_CompileShaderIncludeARB(GLuint shader, GLsizei count, const GLchar * const * path, const GLint * length)
342296c5ddc4Srjs{
342396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
342496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CompileShaderIncludeARB");
342596c5ddc4Srjs   CALL_CompileShaderIncludeARB(ctx->CurrentServerDispatch, (shader, count, path, length));
342696c5ddc4Srjs}
342796c5ddc4Srjs
342896c5ddc4Srjs
342996c5ddc4Srjs/* IsNamedStringARB: marshalled synchronously */
343096c5ddc4SrjsGLboolean GLAPIENTRY
343196c5ddc4Srjs_mesa_marshal_IsNamedStringARB(GLint namelen, const GLchar * name)
343296c5ddc4Srjs{
343396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
343496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsNamedStringARB");
343596c5ddc4Srjs   return CALL_IsNamedStringARB(ctx->CurrentServerDispatch, (namelen, name));
343696c5ddc4Srjs}
343796c5ddc4Srjs
343896c5ddc4Srjs
343996c5ddc4Srjs/* GetNamedStringARB: marshalled synchronously */
344096c5ddc4Srjsvoid GLAPIENTRY
344196c5ddc4Srjs_mesa_marshal_GetNamedStringARB(GLint namelen, const GLchar * name, GLsizei bufSize, GLint * stringlen, GLchar * string)
344296c5ddc4Srjs{
344396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
344496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetNamedStringARB");
344596c5ddc4Srjs   CALL_GetNamedStringARB(ctx->CurrentServerDispatch, (namelen, name, bufSize, stringlen, string));
344696c5ddc4Srjs}
344796c5ddc4Srjs
344896c5ddc4Srjs
344996c5ddc4Srjs/* GetNamedStringivARB: marshalled synchronously */
345096c5ddc4Srjsvoid GLAPIENTRY
345196c5ddc4Srjs_mesa_marshal_GetNamedStringivARB(GLint namelen, const GLchar * name, GLenum pname, GLint * params)
345296c5ddc4Srjs{
345396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
345496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetNamedStringivARB");
345596c5ddc4Srjs   CALL_GetNamedStringivARB(ctx->CurrentServerDispatch, (namelen, name, pname, params));
345696c5ddc4Srjs}
345796c5ddc4Srjs
345896c5ddc4Srjs
345996c5ddc4Srjs/* BindFragDataLocationIndexed: marshalled asynchronously */
346096c5ddc4Srjsstruct marshal_cmd_BindFragDataLocationIndexed
346196c5ddc4Srjs{
346296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
346396c5ddc4Srjs   GLuint program;
346496c5ddc4Srjs   GLuint colorNumber;
346596c5ddc4Srjs   GLuint index;
346696c5ddc4Srjs   /* Next (strlen(name) + 1) bytes are GLchar name[(strlen(name) + 1)] */
346796c5ddc4Srjs};
346896c5ddc4Srjsuint32_t
346996c5ddc4Srjs_mesa_unmarshal_BindFragDataLocationIndexed(struct gl_context *ctx, const struct marshal_cmd_BindFragDataLocationIndexed *cmd, const uint64_t *last)
347096c5ddc4Srjs{
347196c5ddc4Srjs   GLuint program = cmd->program;
347296c5ddc4Srjs   GLuint colorNumber = cmd->colorNumber;
347396c5ddc4Srjs   GLuint index = cmd->index;
347496c5ddc4Srjs   GLchar * name;
347596c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
347696c5ddc4Srjs   name = (GLchar *) variable_data;
347796c5ddc4Srjs   CALL_BindFragDataLocationIndexed(ctx->CurrentServerDispatch, (program, colorNumber, index, name));
347896c5ddc4Srjs   return cmd->cmd_base.cmd_size;
347996c5ddc4Srjs}
348096c5ddc4Srjsvoid GLAPIENTRY
348196c5ddc4Srjs_mesa_marshal_BindFragDataLocationIndexed(GLuint program, GLuint colorNumber, GLuint index, const GLchar * name)
348296c5ddc4Srjs{
348396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
348496c5ddc4Srjs   int name_size = (strlen(name) + 1);
348596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindFragDataLocationIndexed) + name_size;
348696c5ddc4Srjs   struct marshal_cmd_BindFragDataLocationIndexed *cmd;
348796c5ddc4Srjs   if (unlikely(name_size < 0 || (name_size > 0 && !name) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
348896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "BindFragDataLocationIndexed");
348996c5ddc4Srjs      CALL_BindFragDataLocationIndexed(ctx->CurrentServerDispatch, (program, colorNumber, index, name));
349096c5ddc4Srjs      return;
349196c5ddc4Srjs   }
349296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindFragDataLocationIndexed, cmd_size);
349396c5ddc4Srjs   cmd->program = program;
349496c5ddc4Srjs   cmd->colorNumber = colorNumber;
349596c5ddc4Srjs   cmd->index = index;
349696c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
349796c5ddc4Srjs   memcpy(variable_data, name, name_size);
349896c5ddc4Srjs}
349996c5ddc4Srjs
350096c5ddc4Srjs
350196c5ddc4Srjs/* GetFragDataIndex: marshalled synchronously */
350296c5ddc4SrjsGLint GLAPIENTRY
350396c5ddc4Srjs_mesa_marshal_GetFragDataIndex(GLuint program, const GLchar * name)
350496c5ddc4Srjs{
350596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
350696c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetFragDataIndex");
350796c5ddc4Srjs   return CALL_GetFragDataIndex(ctx->CurrentServerDispatch, (program, name));
350896c5ddc4Srjs}
350996c5ddc4Srjs
351096c5ddc4Srjs
351196c5ddc4Srjs/* GenSamplers: marshalled synchronously */
351296c5ddc4Srjsvoid GLAPIENTRY
351396c5ddc4Srjs_mesa_marshal_GenSamplers(GLsizei count, GLuint * samplers)
351496c5ddc4Srjs{
351596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
351696c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GenSamplers");
351796c5ddc4Srjs   CALL_GenSamplers(ctx->CurrentServerDispatch, (count, samplers));
351896c5ddc4Srjs}
351996c5ddc4Srjs
352096c5ddc4Srjs
352196c5ddc4Srjs/* DeleteSamplers: marshalled asynchronously */
352296c5ddc4Srjsstruct marshal_cmd_DeleteSamplers
352396c5ddc4Srjs{
352496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
352596c5ddc4Srjs   GLsizei count;
352696c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLuint)) bytes are GLuint samplers[count] */
352796c5ddc4Srjs};
352896c5ddc4Srjsuint32_t
352996c5ddc4Srjs_mesa_unmarshal_DeleteSamplers(struct gl_context *ctx, const struct marshal_cmd_DeleteSamplers *cmd, const uint64_t *last)
353096c5ddc4Srjs{
353196c5ddc4Srjs   GLsizei count = cmd->count;
353296c5ddc4Srjs   GLuint * samplers;
353396c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
353496c5ddc4Srjs   samplers = (GLuint *) variable_data;
353596c5ddc4Srjs   CALL_DeleteSamplers(ctx->CurrentServerDispatch, (count, samplers));
353696c5ddc4Srjs   return cmd->cmd_base.cmd_size;
353796c5ddc4Srjs}
353896c5ddc4Srjsvoid GLAPIENTRY
353996c5ddc4Srjs_mesa_marshal_DeleteSamplers(GLsizei count, const GLuint * samplers)
354096c5ddc4Srjs{
354196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
354296c5ddc4Srjs   int samplers_size = safe_mul(count, 1 * sizeof(GLuint));
354396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DeleteSamplers) + samplers_size;
354496c5ddc4Srjs   struct marshal_cmd_DeleteSamplers *cmd;
354596c5ddc4Srjs   if (unlikely(samplers_size < 0 || (samplers_size > 0 && !samplers) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
354696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "DeleteSamplers");
354796c5ddc4Srjs      CALL_DeleteSamplers(ctx->CurrentServerDispatch, (count, samplers));
354896c5ddc4Srjs      return;
354996c5ddc4Srjs   }
355096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteSamplers, cmd_size);
355196c5ddc4Srjs   cmd->count = count;
355296c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
355396c5ddc4Srjs   memcpy(variable_data, samplers, samplers_size);
355496c5ddc4Srjs}
355596c5ddc4Srjs
355696c5ddc4Srjs
355796c5ddc4Srjs/* IsSampler: marshalled synchronously */
355896c5ddc4SrjsGLboolean GLAPIENTRY
355996c5ddc4Srjs_mesa_marshal_IsSampler(GLuint sampler)
356096c5ddc4Srjs{
356196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
356296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsSampler");
356396c5ddc4Srjs   return CALL_IsSampler(ctx->CurrentServerDispatch, (sampler));
356496c5ddc4Srjs}
356596c5ddc4Srjs
356696c5ddc4Srjs
356796c5ddc4Srjs/* BindSampler: marshalled asynchronously */
356896c5ddc4Srjsstruct marshal_cmd_BindSampler
356996c5ddc4Srjs{
357096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
357196c5ddc4Srjs   GLuint unit;
357296c5ddc4Srjs   GLuint sampler;
357396c5ddc4Srjs};
357496c5ddc4Srjsuint32_t
357596c5ddc4Srjs_mesa_unmarshal_BindSampler(struct gl_context *ctx, const struct marshal_cmd_BindSampler *cmd, const uint64_t *last)
357696c5ddc4Srjs{
357796c5ddc4Srjs   GLuint unit = cmd->unit;
357896c5ddc4Srjs   GLuint sampler = cmd->sampler;
357996c5ddc4Srjs   CALL_BindSampler(ctx->CurrentServerDispatch, (unit, sampler));
358096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindSampler), 8) / 8);
358196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
358296c5ddc4Srjs   return cmd_size;
358396c5ddc4Srjs}
358496c5ddc4Srjsvoid GLAPIENTRY
358596c5ddc4Srjs_mesa_marshal_BindSampler(GLuint unit, GLuint sampler)
358696c5ddc4Srjs{
358796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
358896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindSampler);
358996c5ddc4Srjs   struct marshal_cmd_BindSampler *cmd;
359096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindSampler, cmd_size);
359196c5ddc4Srjs   cmd->unit = unit;
359296c5ddc4Srjs   cmd->sampler = sampler;
359396c5ddc4Srjs}
359496c5ddc4Srjs
359596c5ddc4Srjs
359696c5ddc4Srjs/* SamplerParameteri: marshalled asynchronously */
359796c5ddc4Srjsstruct marshal_cmd_SamplerParameteri
359896c5ddc4Srjs{
359996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
360096c5ddc4Srjs   GLuint sampler;
360196c5ddc4Srjs   GLenum pname;
360296c5ddc4Srjs   GLint param;
360396c5ddc4Srjs};
360496c5ddc4Srjsuint32_t
360596c5ddc4Srjs_mesa_unmarshal_SamplerParameteri(struct gl_context *ctx, const struct marshal_cmd_SamplerParameteri *cmd, const uint64_t *last)
360696c5ddc4Srjs{
360796c5ddc4Srjs   GLuint sampler = cmd->sampler;
360896c5ddc4Srjs   GLenum pname = cmd->pname;
360996c5ddc4Srjs   GLint param = cmd->param;
361096c5ddc4Srjs   CALL_SamplerParameteri(ctx->CurrentServerDispatch, (sampler, pname, param));
361196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SamplerParameteri), 8) / 8);
361296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
361396c5ddc4Srjs   return cmd_size;
361496c5ddc4Srjs}
361596c5ddc4Srjsvoid GLAPIENTRY
361696c5ddc4Srjs_mesa_marshal_SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
361796c5ddc4Srjs{
361896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
361996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SamplerParameteri);
362096c5ddc4Srjs   struct marshal_cmd_SamplerParameteri *cmd;
362196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SamplerParameteri, cmd_size);
362296c5ddc4Srjs   cmd->sampler = sampler;
362396c5ddc4Srjs   cmd->pname = pname;
362496c5ddc4Srjs   cmd->param = param;
362596c5ddc4Srjs}
362696c5ddc4Srjs
362796c5ddc4Srjs
362896c5ddc4Srjs/* SamplerParameterf: marshalled asynchronously */
362996c5ddc4Srjsstruct marshal_cmd_SamplerParameterf
363096c5ddc4Srjs{
363196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
363296c5ddc4Srjs   GLuint sampler;
363396c5ddc4Srjs   GLenum pname;
363496c5ddc4Srjs   GLfloat param;
363596c5ddc4Srjs};
363696c5ddc4Srjsuint32_t
363796c5ddc4Srjs_mesa_unmarshal_SamplerParameterf(struct gl_context *ctx, const struct marshal_cmd_SamplerParameterf *cmd, const uint64_t *last)
363896c5ddc4Srjs{
363996c5ddc4Srjs   GLuint sampler = cmd->sampler;
364096c5ddc4Srjs   GLenum pname = cmd->pname;
364196c5ddc4Srjs   GLfloat param = cmd->param;
364296c5ddc4Srjs   CALL_SamplerParameterf(ctx->CurrentServerDispatch, (sampler, pname, param));
364396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SamplerParameterf), 8) / 8);
364496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
364596c5ddc4Srjs   return cmd_size;
364696c5ddc4Srjs}
364796c5ddc4Srjsvoid GLAPIENTRY
364896c5ddc4Srjs_mesa_marshal_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
364996c5ddc4Srjs{
365096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
365196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SamplerParameterf);
365296c5ddc4Srjs   struct marshal_cmd_SamplerParameterf *cmd;
365396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SamplerParameterf, cmd_size);
365496c5ddc4Srjs   cmd->sampler = sampler;
365596c5ddc4Srjs   cmd->pname = pname;
365696c5ddc4Srjs   cmd->param = param;
365796c5ddc4Srjs}
365896c5ddc4Srjs
365996c5ddc4Srjs
366096c5ddc4Srjs/* SamplerParameteriv: marshalled asynchronously */
366196c5ddc4Srjsstruct marshal_cmd_SamplerParameteriv
366296c5ddc4Srjs{
366396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
366496c5ddc4Srjs   GLuint sampler;
366596c5ddc4Srjs   GLenum pname;
366696c5ddc4Srjs   /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint)) bytes are GLint params[_mesa_tex_param_enum_to_count(pname)] */
366796c5ddc4Srjs};
366896c5ddc4Srjsuint32_t
366996c5ddc4Srjs_mesa_unmarshal_SamplerParameteriv(struct gl_context *ctx, const struct marshal_cmd_SamplerParameteriv *cmd, const uint64_t *last)
367096c5ddc4Srjs{
367196c5ddc4Srjs   GLuint sampler = cmd->sampler;
367296c5ddc4Srjs   GLenum pname = cmd->pname;
367396c5ddc4Srjs   GLint * params;
367496c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
367596c5ddc4Srjs   params = (GLint *) variable_data;
367696c5ddc4Srjs   CALL_SamplerParameteriv(ctx->CurrentServerDispatch, (sampler, pname, params));
367796c5ddc4Srjs   return cmd->cmd_base.cmd_size;
367896c5ddc4Srjs}
367996c5ddc4Srjsvoid GLAPIENTRY
368096c5ddc4Srjs_mesa_marshal_SamplerParameteriv(GLuint sampler, GLenum pname, const GLint * params)
368196c5ddc4Srjs{
368296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
368396c5ddc4Srjs   int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint));
368496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SamplerParameteriv) + params_size;
368596c5ddc4Srjs   struct marshal_cmd_SamplerParameteriv *cmd;
368696c5ddc4Srjs   if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
368796c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "SamplerParameteriv");
368896c5ddc4Srjs      CALL_SamplerParameteriv(ctx->CurrentServerDispatch, (sampler, pname, params));
368996c5ddc4Srjs      return;
369096c5ddc4Srjs   }
369196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SamplerParameteriv, cmd_size);
369296c5ddc4Srjs   cmd->sampler = sampler;
369396c5ddc4Srjs   cmd->pname = pname;
369496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
369596c5ddc4Srjs   memcpy(variable_data, params, params_size);
369696c5ddc4Srjs}
369796c5ddc4Srjs
369896c5ddc4Srjs
369996c5ddc4Srjs/* SamplerParameterfv: marshalled asynchronously */
370096c5ddc4Srjsstruct marshal_cmd_SamplerParameterfv
370196c5ddc4Srjs{
370296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
370396c5ddc4Srjs   GLuint sampler;
370496c5ddc4Srjs   GLenum pname;
370596c5ddc4Srjs   /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLfloat)) bytes are GLfloat params[_mesa_tex_param_enum_to_count(pname)] */
370696c5ddc4Srjs};
370796c5ddc4Srjsuint32_t
370896c5ddc4Srjs_mesa_unmarshal_SamplerParameterfv(struct gl_context *ctx, const struct marshal_cmd_SamplerParameterfv *cmd, const uint64_t *last)
370996c5ddc4Srjs{
371096c5ddc4Srjs   GLuint sampler = cmd->sampler;
371196c5ddc4Srjs   GLenum pname = cmd->pname;
371296c5ddc4Srjs   GLfloat * params;
371396c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
371496c5ddc4Srjs   params = (GLfloat *) variable_data;
371596c5ddc4Srjs   CALL_SamplerParameterfv(ctx->CurrentServerDispatch, (sampler, pname, params));
371696c5ddc4Srjs   return cmd->cmd_base.cmd_size;
371796c5ddc4Srjs}
371896c5ddc4Srjsvoid GLAPIENTRY
371996c5ddc4Srjs_mesa_marshal_SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat * params)
372096c5ddc4Srjs{
372196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
372296c5ddc4Srjs   int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLfloat));
372396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SamplerParameterfv) + params_size;
372496c5ddc4Srjs   struct marshal_cmd_SamplerParameterfv *cmd;
372596c5ddc4Srjs   if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
372696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "SamplerParameterfv");
372796c5ddc4Srjs      CALL_SamplerParameterfv(ctx->CurrentServerDispatch, (sampler, pname, params));
372896c5ddc4Srjs      return;
372996c5ddc4Srjs   }
373096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SamplerParameterfv, cmd_size);
373196c5ddc4Srjs   cmd->sampler = sampler;
373296c5ddc4Srjs   cmd->pname = pname;
373396c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
373496c5ddc4Srjs   memcpy(variable_data, params, params_size);
373596c5ddc4Srjs}
373696c5ddc4Srjs
373796c5ddc4Srjs
373896c5ddc4Srjs/* SamplerParameterIiv: marshalled asynchronously */
373996c5ddc4Srjsstruct marshal_cmd_SamplerParameterIiv
374096c5ddc4Srjs{
374196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
374296c5ddc4Srjs   GLuint sampler;
374396c5ddc4Srjs   GLenum pname;
374496c5ddc4Srjs   /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint)) bytes are GLint params[_mesa_tex_param_enum_to_count(pname)] */
374596c5ddc4Srjs};
374696c5ddc4Srjsuint32_t
374796c5ddc4Srjs_mesa_unmarshal_SamplerParameterIiv(struct gl_context *ctx, const struct marshal_cmd_SamplerParameterIiv *cmd, const uint64_t *last)
374896c5ddc4Srjs{
374996c5ddc4Srjs   GLuint sampler = cmd->sampler;
375096c5ddc4Srjs   GLenum pname = cmd->pname;
375196c5ddc4Srjs   GLint * params;
375296c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
375396c5ddc4Srjs   params = (GLint *) variable_data;
375496c5ddc4Srjs   CALL_SamplerParameterIiv(ctx->CurrentServerDispatch, (sampler, pname, params));
375596c5ddc4Srjs   return cmd->cmd_base.cmd_size;
375696c5ddc4Srjs}
375796c5ddc4Srjsvoid GLAPIENTRY
375896c5ddc4Srjs_mesa_marshal_SamplerParameterIiv(GLuint sampler, GLenum pname, const GLint * params)
375996c5ddc4Srjs{
376096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
376196c5ddc4Srjs   int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint));
376296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SamplerParameterIiv) + params_size;
376396c5ddc4Srjs   struct marshal_cmd_SamplerParameterIiv *cmd;
376496c5ddc4Srjs   if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
376596c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "SamplerParameterIiv");
376696c5ddc4Srjs      CALL_SamplerParameterIiv(ctx->CurrentServerDispatch, (sampler, pname, params));
376796c5ddc4Srjs      return;
376896c5ddc4Srjs   }
376996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SamplerParameterIiv, cmd_size);
377096c5ddc4Srjs   cmd->sampler = sampler;
377196c5ddc4Srjs   cmd->pname = pname;
377296c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
377396c5ddc4Srjs   memcpy(variable_data, params, params_size);
377496c5ddc4Srjs}
377596c5ddc4Srjs
377696c5ddc4Srjs
377796c5ddc4Srjs/* SamplerParameterIuiv: marshalled asynchronously */
377896c5ddc4Srjsstruct marshal_cmd_SamplerParameterIuiv
377996c5ddc4Srjs{
378096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
378196c5ddc4Srjs   GLuint sampler;
378296c5ddc4Srjs   GLenum pname;
378396c5ddc4Srjs   /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLuint)) bytes are GLuint params[_mesa_tex_param_enum_to_count(pname)] */
378496c5ddc4Srjs};
378596c5ddc4Srjsuint32_t
378696c5ddc4Srjs_mesa_unmarshal_SamplerParameterIuiv(struct gl_context *ctx, const struct marshal_cmd_SamplerParameterIuiv *cmd, const uint64_t *last)
378796c5ddc4Srjs{
378896c5ddc4Srjs   GLuint sampler = cmd->sampler;
378996c5ddc4Srjs   GLenum pname = cmd->pname;
379096c5ddc4Srjs   GLuint * params;
379196c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
379296c5ddc4Srjs   params = (GLuint *) variable_data;
379396c5ddc4Srjs   CALL_SamplerParameterIuiv(ctx->CurrentServerDispatch, (sampler, pname, params));
379496c5ddc4Srjs   return cmd->cmd_base.cmd_size;
379596c5ddc4Srjs}
379696c5ddc4Srjsvoid GLAPIENTRY
379796c5ddc4Srjs_mesa_marshal_SamplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint * params)
379896c5ddc4Srjs{
379996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
380096c5ddc4Srjs   int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLuint));
380196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SamplerParameterIuiv) + params_size;
380296c5ddc4Srjs   struct marshal_cmd_SamplerParameterIuiv *cmd;
380396c5ddc4Srjs   if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
380496c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "SamplerParameterIuiv");
380596c5ddc4Srjs      CALL_SamplerParameterIuiv(ctx->CurrentServerDispatch, (sampler, pname, params));
380696c5ddc4Srjs      return;
380796c5ddc4Srjs   }
380896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SamplerParameterIuiv, cmd_size);
380996c5ddc4Srjs   cmd->sampler = sampler;
381096c5ddc4Srjs   cmd->pname = pname;
381196c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
381296c5ddc4Srjs   memcpy(variable_data, params, params_size);
381396c5ddc4Srjs}
381496c5ddc4Srjs
381596c5ddc4Srjs
381696c5ddc4Srjs/* GetSamplerParameteriv: marshalled synchronously */
381796c5ddc4Srjsvoid GLAPIENTRY
381896c5ddc4Srjs_mesa_marshal_GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint * params)
381996c5ddc4Srjs{
382096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
382196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetSamplerParameteriv");
382296c5ddc4Srjs   CALL_GetSamplerParameteriv(ctx->CurrentServerDispatch, (sampler, pname, params));
382396c5ddc4Srjs}
382496c5ddc4Srjs
382596c5ddc4Srjs
382696c5ddc4Srjs/* GetSamplerParameterfv: marshalled synchronously */
382796c5ddc4Srjsvoid GLAPIENTRY
382896c5ddc4Srjs_mesa_marshal_GetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat * params)
382996c5ddc4Srjs{
383096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
383196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetSamplerParameterfv");
383296c5ddc4Srjs   CALL_GetSamplerParameterfv(ctx->CurrentServerDispatch, (sampler, pname, params));
383396c5ddc4Srjs}
383496c5ddc4Srjs
383596c5ddc4Srjs
383696c5ddc4Srjs/* GetSamplerParameterIiv: marshalled synchronously */
383796c5ddc4Srjsvoid GLAPIENTRY
383896c5ddc4Srjs_mesa_marshal_GetSamplerParameterIiv(GLuint sampler, GLenum pname, GLint * params)
383996c5ddc4Srjs{
384096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
384196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetSamplerParameterIiv");
384296c5ddc4Srjs   CALL_GetSamplerParameterIiv(ctx->CurrentServerDispatch, (sampler, pname, params));
384396c5ddc4Srjs}
384496c5ddc4Srjs
384596c5ddc4Srjs
384696c5ddc4Srjs/* GetSamplerParameterIuiv: marshalled synchronously */
384796c5ddc4Srjsvoid GLAPIENTRY
384896c5ddc4Srjs_mesa_marshal_GetSamplerParameterIuiv(GLuint sampler, GLenum pname, GLuint * params)
384996c5ddc4Srjs{
385096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
385196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetSamplerParameterIuiv");
385296c5ddc4Srjs   CALL_GetSamplerParameterIuiv(ctx->CurrentServerDispatch, (sampler, pname, params));
385396c5ddc4Srjs}
385496c5ddc4Srjs
385596c5ddc4Srjs
385696c5ddc4Srjs/* GetQueryObjecti64v: marshalled synchronously */
385796c5ddc4Srjsvoid GLAPIENTRY
385896c5ddc4Srjs_mesa_marshal_GetQueryObjecti64v(GLuint id, GLenum pname, GLint64 * params)
385996c5ddc4Srjs{
386096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
386196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetQueryObjecti64v");
386296c5ddc4Srjs   CALL_GetQueryObjecti64v(ctx->CurrentServerDispatch, (id, pname, params));
386396c5ddc4Srjs}
386496c5ddc4Srjs
386596c5ddc4Srjs
386696c5ddc4Srjs/* GetQueryObjectui64v: marshalled synchronously */
386796c5ddc4Srjsvoid GLAPIENTRY
386896c5ddc4Srjs_mesa_marshal_GetQueryObjectui64v(GLuint id, GLenum pname, GLuint64 * params)
386996c5ddc4Srjs{
387096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
387196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetQueryObjectui64v");
387296c5ddc4Srjs   CALL_GetQueryObjectui64v(ctx->CurrentServerDispatch, (id, pname, params));
387396c5ddc4Srjs}
387496c5ddc4Srjs
387596c5ddc4Srjs
387696c5ddc4Srjs/* QueryCounter: marshalled asynchronously */
387796c5ddc4Srjsstruct marshal_cmd_QueryCounter
387896c5ddc4Srjs{
387996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
388096c5ddc4Srjs   GLuint id;
388196c5ddc4Srjs   GLenum target;
388296c5ddc4Srjs};
388396c5ddc4Srjsuint32_t
388496c5ddc4Srjs_mesa_unmarshal_QueryCounter(struct gl_context *ctx, const struct marshal_cmd_QueryCounter *cmd, const uint64_t *last)
388596c5ddc4Srjs{
388696c5ddc4Srjs   GLuint id = cmd->id;
388796c5ddc4Srjs   GLenum target = cmd->target;
388896c5ddc4Srjs   CALL_QueryCounter(ctx->CurrentServerDispatch, (id, target));
388996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_QueryCounter), 8) / 8);
389096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
389196c5ddc4Srjs   return cmd_size;
389296c5ddc4Srjs}
389396c5ddc4Srjsvoid GLAPIENTRY
389496c5ddc4Srjs_mesa_marshal_QueryCounter(GLuint id, GLenum target)
389596c5ddc4Srjs{
389696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
389796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_QueryCounter);
389896c5ddc4Srjs   struct marshal_cmd_QueryCounter *cmd;
389996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_QueryCounter, cmd_size);
390096c5ddc4Srjs   cmd->id = id;
390196c5ddc4Srjs   cmd->target = target;
390296c5ddc4Srjs}
390396c5ddc4Srjs
390496c5ddc4Srjs
390596c5ddc4Srjs/* VertexP2ui: marshalled asynchronously */
390696c5ddc4Srjsstruct marshal_cmd_VertexP2ui
390796c5ddc4Srjs{
390896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
390996c5ddc4Srjs   GLenum type;
391096c5ddc4Srjs   GLuint value;
391196c5ddc4Srjs};
391296c5ddc4Srjsuint32_t
391396c5ddc4Srjs_mesa_unmarshal_VertexP2ui(struct gl_context *ctx, const struct marshal_cmd_VertexP2ui *cmd, const uint64_t *last)
391496c5ddc4Srjs{
391596c5ddc4Srjs   GLenum type = cmd->type;
391696c5ddc4Srjs   GLuint value = cmd->value;
391796c5ddc4Srjs   CALL_VertexP2ui(ctx->CurrentServerDispatch, (type, value));
391896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexP2ui), 8) / 8);
391996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
392096c5ddc4Srjs   return cmd_size;
392196c5ddc4Srjs}
392296c5ddc4Srjsvoid GLAPIENTRY
392396c5ddc4Srjs_mesa_marshal_VertexP2ui(GLenum type, GLuint value)
392496c5ddc4Srjs{
392596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
392696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexP2ui);
392796c5ddc4Srjs   struct marshal_cmd_VertexP2ui *cmd;
392896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexP2ui, cmd_size);
392996c5ddc4Srjs   cmd->type = type;
393096c5ddc4Srjs   cmd->value = value;
393196c5ddc4Srjs}
393296c5ddc4Srjs
393396c5ddc4Srjs
393496c5ddc4Srjs/* VertexP3ui: marshalled asynchronously */
393596c5ddc4Srjsstruct marshal_cmd_VertexP3ui
393696c5ddc4Srjs{
393796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
393896c5ddc4Srjs   GLenum type;
393996c5ddc4Srjs   GLuint value;
394096c5ddc4Srjs};
394196c5ddc4Srjsuint32_t
394296c5ddc4Srjs_mesa_unmarshal_VertexP3ui(struct gl_context *ctx, const struct marshal_cmd_VertexP3ui *cmd, const uint64_t *last)
394396c5ddc4Srjs{
394496c5ddc4Srjs   GLenum type = cmd->type;
394596c5ddc4Srjs   GLuint value = cmd->value;
394696c5ddc4Srjs   CALL_VertexP3ui(ctx->CurrentServerDispatch, (type, value));
394796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexP3ui), 8) / 8);
394896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
394996c5ddc4Srjs   return cmd_size;
395096c5ddc4Srjs}
395196c5ddc4Srjsvoid GLAPIENTRY
395296c5ddc4Srjs_mesa_marshal_VertexP3ui(GLenum type, GLuint value)
395396c5ddc4Srjs{
395496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
395596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexP3ui);
395696c5ddc4Srjs   struct marshal_cmd_VertexP3ui *cmd;
395796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexP3ui, cmd_size);
395896c5ddc4Srjs   cmd->type = type;
395996c5ddc4Srjs   cmd->value = value;
396096c5ddc4Srjs}
396196c5ddc4Srjs
396296c5ddc4Srjs
396396c5ddc4Srjs/* VertexP4ui: marshalled asynchronously */
396496c5ddc4Srjsstruct marshal_cmd_VertexP4ui
396596c5ddc4Srjs{
396696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
396796c5ddc4Srjs   GLenum type;
396896c5ddc4Srjs   GLuint value;
396996c5ddc4Srjs};
397096c5ddc4Srjsuint32_t
397196c5ddc4Srjs_mesa_unmarshal_VertexP4ui(struct gl_context *ctx, const struct marshal_cmd_VertexP4ui *cmd, const uint64_t *last)
397296c5ddc4Srjs{
397396c5ddc4Srjs   GLenum type = cmd->type;
397496c5ddc4Srjs   GLuint value = cmd->value;
397596c5ddc4Srjs   CALL_VertexP4ui(ctx->CurrentServerDispatch, (type, value));
397696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexP4ui), 8) / 8);
397796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
397896c5ddc4Srjs   return cmd_size;
397996c5ddc4Srjs}
398096c5ddc4Srjsvoid GLAPIENTRY
398196c5ddc4Srjs_mesa_marshal_VertexP4ui(GLenum type, GLuint value)
398296c5ddc4Srjs{
398396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
398496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexP4ui);
398596c5ddc4Srjs   struct marshal_cmd_VertexP4ui *cmd;
398696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexP4ui, cmd_size);
398796c5ddc4Srjs   cmd->type = type;
398896c5ddc4Srjs   cmd->value = value;
398996c5ddc4Srjs}
399096c5ddc4Srjs
399196c5ddc4Srjs
399296c5ddc4Srjs/* VertexP2uiv: marshalled asynchronously */
399396c5ddc4Srjsstruct marshal_cmd_VertexP2uiv
399496c5ddc4Srjs{
399596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
399696c5ddc4Srjs   GLenum type;
399796c5ddc4Srjs   GLuint value[1];
399896c5ddc4Srjs};
399996c5ddc4Srjsuint32_t
400096c5ddc4Srjs_mesa_unmarshal_VertexP2uiv(struct gl_context *ctx, const struct marshal_cmd_VertexP2uiv *cmd, const uint64_t *last)
400196c5ddc4Srjs{
400296c5ddc4Srjs   GLenum type = cmd->type;
400396c5ddc4Srjs   const GLuint * value = cmd->value;
400496c5ddc4Srjs   CALL_VertexP2uiv(ctx->CurrentServerDispatch, (type, value));
400596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexP2uiv), 8) / 8);
400696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
400796c5ddc4Srjs   return cmd_size;
400896c5ddc4Srjs}
400996c5ddc4Srjsvoid GLAPIENTRY
401096c5ddc4Srjs_mesa_marshal_VertexP2uiv(GLenum type, const GLuint * value)
401196c5ddc4Srjs{
401296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
401396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexP2uiv);
401496c5ddc4Srjs   struct marshal_cmd_VertexP2uiv *cmd;
401596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexP2uiv, cmd_size);
401696c5ddc4Srjs   cmd->type = type;
401796c5ddc4Srjs   memcpy(cmd->value, value, 1 * sizeof(GLuint));
401896c5ddc4Srjs}
401996c5ddc4Srjs
402096c5ddc4Srjs
402196c5ddc4Srjs/* VertexP3uiv: marshalled asynchronously */
402296c5ddc4Srjsstruct marshal_cmd_VertexP3uiv
402396c5ddc4Srjs{
402496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
402596c5ddc4Srjs   GLenum type;
402696c5ddc4Srjs   GLuint value[1];
402796c5ddc4Srjs};
402896c5ddc4Srjsuint32_t
402996c5ddc4Srjs_mesa_unmarshal_VertexP3uiv(struct gl_context *ctx, const struct marshal_cmd_VertexP3uiv *cmd, const uint64_t *last)
403096c5ddc4Srjs{
403196c5ddc4Srjs   GLenum type = cmd->type;
403296c5ddc4Srjs   const GLuint * value = cmd->value;
403396c5ddc4Srjs   CALL_VertexP3uiv(ctx->CurrentServerDispatch, (type, value));
403496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexP3uiv), 8) / 8);
403596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
403696c5ddc4Srjs   return cmd_size;
403796c5ddc4Srjs}
403896c5ddc4Srjsvoid GLAPIENTRY
403996c5ddc4Srjs_mesa_marshal_VertexP3uiv(GLenum type, const GLuint * value)
404096c5ddc4Srjs{
404196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
404296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexP3uiv);
404396c5ddc4Srjs   struct marshal_cmd_VertexP3uiv *cmd;
404496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexP3uiv, cmd_size);
404596c5ddc4Srjs   cmd->type = type;
404696c5ddc4Srjs   memcpy(cmd->value, value, 1 * sizeof(GLuint));
404796c5ddc4Srjs}
404896c5ddc4Srjs
404996c5ddc4Srjs
405096c5ddc4Srjs/* VertexP4uiv: marshalled asynchronously */
405196c5ddc4Srjsstruct marshal_cmd_VertexP4uiv
405296c5ddc4Srjs{
405396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
405496c5ddc4Srjs   GLenum type;
405596c5ddc4Srjs   GLuint value[1];
405696c5ddc4Srjs};
405796c5ddc4Srjsuint32_t
405896c5ddc4Srjs_mesa_unmarshal_VertexP4uiv(struct gl_context *ctx, const struct marshal_cmd_VertexP4uiv *cmd, const uint64_t *last)
405996c5ddc4Srjs{
406096c5ddc4Srjs   GLenum type = cmd->type;
406196c5ddc4Srjs   const GLuint * value = cmd->value;
406296c5ddc4Srjs   CALL_VertexP4uiv(ctx->CurrentServerDispatch, (type, value));
406396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexP4uiv), 8) / 8);
406496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
406596c5ddc4Srjs   return cmd_size;
406696c5ddc4Srjs}
406796c5ddc4Srjsvoid GLAPIENTRY
406896c5ddc4Srjs_mesa_marshal_VertexP4uiv(GLenum type, const GLuint * value)
406996c5ddc4Srjs{
407096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
407196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexP4uiv);
407296c5ddc4Srjs   struct marshal_cmd_VertexP4uiv *cmd;
407396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexP4uiv, cmd_size);
407496c5ddc4Srjs   cmd->type = type;
407596c5ddc4Srjs   memcpy(cmd->value, value, 1 * sizeof(GLuint));
407696c5ddc4Srjs}
407796c5ddc4Srjs
407896c5ddc4Srjs
407996c5ddc4Srjs/* TexCoordP1ui: marshalled asynchronously */
408096c5ddc4Srjsstruct marshal_cmd_TexCoordP1ui
408196c5ddc4Srjs{
408296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
408396c5ddc4Srjs   GLenum type;
408496c5ddc4Srjs   GLuint coords;
408596c5ddc4Srjs};
408696c5ddc4Srjsuint32_t
408796c5ddc4Srjs_mesa_unmarshal_TexCoordP1ui(struct gl_context *ctx, const struct marshal_cmd_TexCoordP1ui *cmd, const uint64_t *last)
408896c5ddc4Srjs{
408996c5ddc4Srjs   GLenum type = cmd->type;
409096c5ddc4Srjs   GLuint coords = cmd->coords;
409196c5ddc4Srjs   CALL_TexCoordP1ui(ctx->CurrentServerDispatch, (type, coords));
409296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordP1ui), 8) / 8);
409396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
409496c5ddc4Srjs   return cmd_size;
409596c5ddc4Srjs}
409696c5ddc4Srjsvoid GLAPIENTRY
409796c5ddc4Srjs_mesa_marshal_TexCoordP1ui(GLenum type, GLuint coords)
409896c5ddc4Srjs{
409996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
410096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexCoordP1ui);
410196c5ddc4Srjs   struct marshal_cmd_TexCoordP1ui *cmd;
410296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP1ui, cmd_size);
410396c5ddc4Srjs   cmd->type = type;
410496c5ddc4Srjs   cmd->coords = coords;
410596c5ddc4Srjs}
410696c5ddc4Srjs
410796c5ddc4Srjs
410896c5ddc4Srjs/* TexCoordP2ui: marshalled asynchronously */
410996c5ddc4Srjsstruct marshal_cmd_TexCoordP2ui
411096c5ddc4Srjs{
411196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
411296c5ddc4Srjs   GLenum type;
411396c5ddc4Srjs   GLuint coords;
411496c5ddc4Srjs};
411596c5ddc4Srjsuint32_t
411696c5ddc4Srjs_mesa_unmarshal_TexCoordP2ui(struct gl_context *ctx, const struct marshal_cmd_TexCoordP2ui *cmd, const uint64_t *last)
411796c5ddc4Srjs{
411896c5ddc4Srjs   GLenum type = cmd->type;
411996c5ddc4Srjs   GLuint coords = cmd->coords;
412096c5ddc4Srjs   CALL_TexCoordP2ui(ctx->CurrentServerDispatch, (type, coords));
412196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordP2ui), 8) / 8);
412296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
412396c5ddc4Srjs   return cmd_size;
412496c5ddc4Srjs}
412596c5ddc4Srjsvoid GLAPIENTRY
412696c5ddc4Srjs_mesa_marshal_TexCoordP2ui(GLenum type, GLuint coords)
412796c5ddc4Srjs{
412896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
412996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexCoordP2ui);
413096c5ddc4Srjs   struct marshal_cmd_TexCoordP2ui *cmd;
413196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP2ui, cmd_size);
413296c5ddc4Srjs   cmd->type = type;
413396c5ddc4Srjs   cmd->coords = coords;
413496c5ddc4Srjs}
413596c5ddc4Srjs
413696c5ddc4Srjs
413796c5ddc4Srjs/* TexCoordP3ui: marshalled asynchronously */
413896c5ddc4Srjsstruct marshal_cmd_TexCoordP3ui
413996c5ddc4Srjs{
414096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
414196c5ddc4Srjs   GLenum type;
414296c5ddc4Srjs   GLuint coords;
414396c5ddc4Srjs};
414496c5ddc4Srjsuint32_t
414596c5ddc4Srjs_mesa_unmarshal_TexCoordP3ui(struct gl_context *ctx, const struct marshal_cmd_TexCoordP3ui *cmd, const uint64_t *last)
414696c5ddc4Srjs{
414796c5ddc4Srjs   GLenum type = cmd->type;
414896c5ddc4Srjs   GLuint coords = cmd->coords;
414996c5ddc4Srjs   CALL_TexCoordP3ui(ctx->CurrentServerDispatch, (type, coords));
415096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordP3ui), 8) / 8);
415196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
415296c5ddc4Srjs   return cmd_size;
415396c5ddc4Srjs}
415496c5ddc4Srjsvoid GLAPIENTRY
415596c5ddc4Srjs_mesa_marshal_TexCoordP3ui(GLenum type, GLuint coords)
415696c5ddc4Srjs{
415796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
415896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexCoordP3ui);
415996c5ddc4Srjs   struct marshal_cmd_TexCoordP3ui *cmd;
416096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP3ui, cmd_size);
416196c5ddc4Srjs   cmd->type = type;
416296c5ddc4Srjs   cmd->coords = coords;
416396c5ddc4Srjs}
416496c5ddc4Srjs
416596c5ddc4Srjs
416696c5ddc4Srjs/* TexCoordP4ui: marshalled asynchronously */
416796c5ddc4Srjsstruct marshal_cmd_TexCoordP4ui
416896c5ddc4Srjs{
416996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
417096c5ddc4Srjs   GLenum type;
417196c5ddc4Srjs   GLuint coords;
417296c5ddc4Srjs};
417396c5ddc4Srjsuint32_t
417496c5ddc4Srjs_mesa_unmarshal_TexCoordP4ui(struct gl_context *ctx, const struct marshal_cmd_TexCoordP4ui *cmd, const uint64_t *last)
417596c5ddc4Srjs{
417696c5ddc4Srjs   GLenum type = cmd->type;
417796c5ddc4Srjs   GLuint coords = cmd->coords;
417896c5ddc4Srjs   CALL_TexCoordP4ui(ctx->CurrentServerDispatch, (type, coords));
417996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordP4ui), 8) / 8);
418096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
418196c5ddc4Srjs   return cmd_size;
418296c5ddc4Srjs}
418396c5ddc4Srjsvoid GLAPIENTRY
418496c5ddc4Srjs_mesa_marshal_TexCoordP4ui(GLenum type, GLuint coords)
418596c5ddc4Srjs{
418696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
418796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexCoordP4ui);
418896c5ddc4Srjs   struct marshal_cmd_TexCoordP4ui *cmd;
418996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP4ui, cmd_size);
419096c5ddc4Srjs   cmd->type = type;
419196c5ddc4Srjs   cmd->coords = coords;
419296c5ddc4Srjs}
419396c5ddc4Srjs
419496c5ddc4Srjs
419596c5ddc4Srjs/* TexCoordP1uiv: marshalled asynchronously */
419696c5ddc4Srjsstruct marshal_cmd_TexCoordP1uiv
419796c5ddc4Srjs{
419896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
419996c5ddc4Srjs   GLenum type;
420096c5ddc4Srjs   GLuint coords[1];
420196c5ddc4Srjs};
420296c5ddc4Srjsuint32_t
420396c5ddc4Srjs_mesa_unmarshal_TexCoordP1uiv(struct gl_context *ctx, const struct marshal_cmd_TexCoordP1uiv *cmd, const uint64_t *last)
420496c5ddc4Srjs{
420596c5ddc4Srjs   GLenum type = cmd->type;
420696c5ddc4Srjs   const GLuint * coords = cmd->coords;
420796c5ddc4Srjs   CALL_TexCoordP1uiv(ctx->CurrentServerDispatch, (type, coords));
420896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordP1uiv), 8) / 8);
420996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
421096c5ddc4Srjs   return cmd_size;
421196c5ddc4Srjs}
421296c5ddc4Srjsvoid GLAPIENTRY
421396c5ddc4Srjs_mesa_marshal_TexCoordP1uiv(GLenum type, const GLuint * coords)
421496c5ddc4Srjs{
421596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
421696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexCoordP1uiv);
421796c5ddc4Srjs   struct marshal_cmd_TexCoordP1uiv *cmd;
421896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP1uiv, cmd_size);
421996c5ddc4Srjs   cmd->type = type;
422096c5ddc4Srjs   memcpy(cmd->coords, coords, 1 * sizeof(GLuint));
422196c5ddc4Srjs}
422296c5ddc4Srjs
422396c5ddc4Srjs
422496c5ddc4Srjs/* TexCoordP2uiv: marshalled asynchronously */
422596c5ddc4Srjsstruct marshal_cmd_TexCoordP2uiv
422696c5ddc4Srjs{
422796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
422896c5ddc4Srjs   GLenum type;
422996c5ddc4Srjs   GLuint coords[1];
423096c5ddc4Srjs};
423196c5ddc4Srjsuint32_t
423296c5ddc4Srjs_mesa_unmarshal_TexCoordP2uiv(struct gl_context *ctx, const struct marshal_cmd_TexCoordP2uiv *cmd, const uint64_t *last)
423396c5ddc4Srjs{
423496c5ddc4Srjs   GLenum type = cmd->type;
423596c5ddc4Srjs   const GLuint * coords = cmd->coords;
423696c5ddc4Srjs   CALL_TexCoordP2uiv(ctx->CurrentServerDispatch, (type, coords));
423796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordP2uiv), 8) / 8);
423896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
423996c5ddc4Srjs   return cmd_size;
424096c5ddc4Srjs}
424196c5ddc4Srjsvoid GLAPIENTRY
424296c5ddc4Srjs_mesa_marshal_TexCoordP2uiv(GLenum type, const GLuint * coords)
424396c5ddc4Srjs{
424496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
424596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexCoordP2uiv);
424696c5ddc4Srjs   struct marshal_cmd_TexCoordP2uiv *cmd;
424796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP2uiv, cmd_size);
424896c5ddc4Srjs   cmd->type = type;
424996c5ddc4Srjs   memcpy(cmd->coords, coords, 1 * sizeof(GLuint));
425096c5ddc4Srjs}
425196c5ddc4Srjs
425296c5ddc4Srjs
425396c5ddc4Srjs/* TexCoordP3uiv: marshalled asynchronously */
425496c5ddc4Srjsstruct marshal_cmd_TexCoordP3uiv
425596c5ddc4Srjs{
425696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
425796c5ddc4Srjs   GLenum type;
425896c5ddc4Srjs   GLuint coords[1];
425996c5ddc4Srjs};
426096c5ddc4Srjsuint32_t
426196c5ddc4Srjs_mesa_unmarshal_TexCoordP3uiv(struct gl_context *ctx, const struct marshal_cmd_TexCoordP3uiv *cmd, const uint64_t *last)
426296c5ddc4Srjs{
426396c5ddc4Srjs   GLenum type = cmd->type;
426496c5ddc4Srjs   const GLuint * coords = cmd->coords;
426596c5ddc4Srjs   CALL_TexCoordP3uiv(ctx->CurrentServerDispatch, (type, coords));
426696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordP3uiv), 8) / 8);
426796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
426896c5ddc4Srjs   return cmd_size;
426996c5ddc4Srjs}
427096c5ddc4Srjsvoid GLAPIENTRY
427196c5ddc4Srjs_mesa_marshal_TexCoordP3uiv(GLenum type, const GLuint * coords)
427296c5ddc4Srjs{
427396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
427496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexCoordP3uiv);
427596c5ddc4Srjs   struct marshal_cmd_TexCoordP3uiv *cmd;
427696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP3uiv, cmd_size);
427796c5ddc4Srjs   cmd->type = type;
427896c5ddc4Srjs   memcpy(cmd->coords, coords, 1 * sizeof(GLuint));
427996c5ddc4Srjs}
428096c5ddc4Srjs
428196c5ddc4Srjs
428296c5ddc4Srjs/* TexCoordP4uiv: marshalled asynchronously */
428396c5ddc4Srjsstruct marshal_cmd_TexCoordP4uiv
428496c5ddc4Srjs{
428596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
428696c5ddc4Srjs   GLenum type;
428796c5ddc4Srjs   GLuint coords[1];
428896c5ddc4Srjs};
428996c5ddc4Srjsuint32_t
429096c5ddc4Srjs_mesa_unmarshal_TexCoordP4uiv(struct gl_context *ctx, const struct marshal_cmd_TexCoordP4uiv *cmd, const uint64_t *last)
429196c5ddc4Srjs{
429296c5ddc4Srjs   GLenum type = cmd->type;
429396c5ddc4Srjs   const GLuint * coords = cmd->coords;
429496c5ddc4Srjs   CALL_TexCoordP4uiv(ctx->CurrentServerDispatch, (type, coords));
429596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordP4uiv), 8) / 8);
429696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
429796c5ddc4Srjs   return cmd_size;
429896c5ddc4Srjs}
429996c5ddc4Srjsvoid GLAPIENTRY
430096c5ddc4Srjs_mesa_marshal_TexCoordP4uiv(GLenum type, const GLuint * coords)
430196c5ddc4Srjs{
430296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
430396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexCoordP4uiv);
430496c5ddc4Srjs   struct marshal_cmd_TexCoordP4uiv *cmd;
430596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP4uiv, cmd_size);
430696c5ddc4Srjs   cmd->type = type;
430796c5ddc4Srjs   memcpy(cmd->coords, coords, 1 * sizeof(GLuint));
430896c5ddc4Srjs}
430996c5ddc4Srjs
431096c5ddc4Srjs
431196c5ddc4Srjs/* MultiTexCoordP1ui: marshalled asynchronously */
431296c5ddc4Srjsstruct marshal_cmd_MultiTexCoordP1ui
431396c5ddc4Srjs{
431496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
431596c5ddc4Srjs   GLenum texture;
431696c5ddc4Srjs   GLenum type;
431796c5ddc4Srjs   GLuint coords;
431896c5ddc4Srjs};
431996c5ddc4Srjsuint32_t
432096c5ddc4Srjs_mesa_unmarshal_MultiTexCoordP1ui(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP1ui *cmd, const uint64_t *last)
432196c5ddc4Srjs{
432296c5ddc4Srjs   GLenum texture = cmd->texture;
432396c5ddc4Srjs   GLenum type = cmd->type;
432496c5ddc4Srjs   GLuint coords = cmd->coords;
432596c5ddc4Srjs   CALL_MultiTexCoordP1ui(ctx->CurrentServerDispatch, (texture, type, coords));
432696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoordP1ui), 8) / 8);
432796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
432896c5ddc4Srjs   return cmd_size;
432996c5ddc4Srjs}
433096c5ddc4Srjsvoid GLAPIENTRY
433196c5ddc4Srjs_mesa_marshal_MultiTexCoordP1ui(GLenum texture, GLenum type, GLuint coords)
433296c5ddc4Srjs{
433396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
433496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP1ui);
433596c5ddc4Srjs   struct marshal_cmd_MultiTexCoordP1ui *cmd;
433696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP1ui, cmd_size);
433796c5ddc4Srjs   cmd->texture = texture;
433896c5ddc4Srjs   cmd->type = type;
433996c5ddc4Srjs   cmd->coords = coords;
434096c5ddc4Srjs}
434196c5ddc4Srjs
434296c5ddc4Srjs
434396c5ddc4Srjs/* MultiTexCoordP2ui: marshalled asynchronously */
434496c5ddc4Srjsstruct marshal_cmd_MultiTexCoordP2ui
434596c5ddc4Srjs{
434696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
434796c5ddc4Srjs   GLenum texture;
434896c5ddc4Srjs   GLenum type;
434996c5ddc4Srjs   GLuint coords;
435096c5ddc4Srjs};
435196c5ddc4Srjsuint32_t
435296c5ddc4Srjs_mesa_unmarshal_MultiTexCoordP2ui(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP2ui *cmd, const uint64_t *last)
435396c5ddc4Srjs{
435496c5ddc4Srjs   GLenum texture = cmd->texture;
435596c5ddc4Srjs   GLenum type = cmd->type;
435696c5ddc4Srjs   GLuint coords = cmd->coords;
435796c5ddc4Srjs   CALL_MultiTexCoordP2ui(ctx->CurrentServerDispatch, (texture, type, coords));
435896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoordP2ui), 8) / 8);
435996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
436096c5ddc4Srjs   return cmd_size;
436196c5ddc4Srjs}
436296c5ddc4Srjsvoid GLAPIENTRY
436396c5ddc4Srjs_mesa_marshal_MultiTexCoordP2ui(GLenum texture, GLenum type, GLuint coords)
436496c5ddc4Srjs{
436596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
436696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP2ui);
436796c5ddc4Srjs   struct marshal_cmd_MultiTexCoordP2ui *cmd;
436896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP2ui, cmd_size);
436996c5ddc4Srjs   cmd->texture = texture;
437096c5ddc4Srjs   cmd->type = type;
437196c5ddc4Srjs   cmd->coords = coords;
437296c5ddc4Srjs}
437396c5ddc4Srjs
437496c5ddc4Srjs
437596c5ddc4Srjs/* MultiTexCoordP3ui: marshalled asynchronously */
437696c5ddc4Srjsstruct marshal_cmd_MultiTexCoordP3ui
437796c5ddc4Srjs{
437896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
437996c5ddc4Srjs   GLenum texture;
438096c5ddc4Srjs   GLenum type;
438196c5ddc4Srjs   GLuint coords;
438296c5ddc4Srjs};
438396c5ddc4Srjsuint32_t
438496c5ddc4Srjs_mesa_unmarshal_MultiTexCoordP3ui(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP3ui *cmd, const uint64_t *last)
438596c5ddc4Srjs{
438696c5ddc4Srjs   GLenum texture = cmd->texture;
438796c5ddc4Srjs   GLenum type = cmd->type;
438896c5ddc4Srjs   GLuint coords = cmd->coords;
438996c5ddc4Srjs   CALL_MultiTexCoordP3ui(ctx->CurrentServerDispatch, (texture, type, coords));
439096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoordP3ui), 8) / 8);
439196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
439296c5ddc4Srjs   return cmd_size;
439396c5ddc4Srjs}
439496c5ddc4Srjsvoid GLAPIENTRY
439596c5ddc4Srjs_mesa_marshal_MultiTexCoordP3ui(GLenum texture, GLenum type, GLuint coords)
439696c5ddc4Srjs{
439796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
439896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP3ui);
439996c5ddc4Srjs   struct marshal_cmd_MultiTexCoordP3ui *cmd;
440096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP3ui, cmd_size);
440196c5ddc4Srjs   cmd->texture = texture;
440296c5ddc4Srjs   cmd->type = type;
440396c5ddc4Srjs   cmd->coords = coords;
440496c5ddc4Srjs}
440596c5ddc4Srjs
440696c5ddc4Srjs
440796c5ddc4Srjs/* MultiTexCoordP4ui: marshalled asynchronously */
440896c5ddc4Srjsstruct marshal_cmd_MultiTexCoordP4ui
440996c5ddc4Srjs{
441096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
441196c5ddc4Srjs   GLenum texture;
441296c5ddc4Srjs   GLenum type;
441396c5ddc4Srjs   GLuint coords;
441496c5ddc4Srjs};
441596c5ddc4Srjsuint32_t
441696c5ddc4Srjs_mesa_unmarshal_MultiTexCoordP4ui(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP4ui *cmd, const uint64_t *last)
441796c5ddc4Srjs{
441896c5ddc4Srjs   GLenum texture = cmd->texture;
441996c5ddc4Srjs   GLenum type = cmd->type;
442096c5ddc4Srjs   GLuint coords = cmd->coords;
442196c5ddc4Srjs   CALL_MultiTexCoordP4ui(ctx->CurrentServerDispatch, (texture, type, coords));
442296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoordP4ui), 8) / 8);
442396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
442496c5ddc4Srjs   return cmd_size;
442596c5ddc4Srjs}
442696c5ddc4Srjsvoid GLAPIENTRY
442796c5ddc4Srjs_mesa_marshal_MultiTexCoordP4ui(GLenum texture, GLenum type, GLuint coords)
442896c5ddc4Srjs{
442996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
443096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP4ui);
443196c5ddc4Srjs   struct marshal_cmd_MultiTexCoordP4ui *cmd;
443296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP4ui, cmd_size);
443396c5ddc4Srjs   cmd->texture = texture;
443496c5ddc4Srjs   cmd->type = type;
443596c5ddc4Srjs   cmd->coords = coords;
443696c5ddc4Srjs}
443796c5ddc4Srjs
443896c5ddc4Srjs
443996c5ddc4Srjs/* MultiTexCoordP1uiv: marshalled asynchronously */
444096c5ddc4Srjsstruct marshal_cmd_MultiTexCoordP1uiv
444196c5ddc4Srjs{
444296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
444396c5ddc4Srjs   GLenum texture;
444496c5ddc4Srjs   GLenum type;
444596c5ddc4Srjs   GLuint coords[1];
444696c5ddc4Srjs};
444796c5ddc4Srjsuint32_t
444896c5ddc4Srjs_mesa_unmarshal_MultiTexCoordP1uiv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP1uiv *cmd, const uint64_t *last)
444996c5ddc4Srjs{
445096c5ddc4Srjs   GLenum texture = cmd->texture;
445196c5ddc4Srjs   GLenum type = cmd->type;
445296c5ddc4Srjs   const GLuint * coords = cmd->coords;
445396c5ddc4Srjs   CALL_MultiTexCoordP1uiv(ctx->CurrentServerDispatch, (texture, type, coords));
445496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoordP1uiv), 8) / 8);
445596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
445696c5ddc4Srjs   return cmd_size;
445796c5ddc4Srjs}
445896c5ddc4Srjsvoid GLAPIENTRY
445996c5ddc4Srjs_mesa_marshal_MultiTexCoordP1uiv(GLenum texture, GLenum type, const GLuint * coords)
446096c5ddc4Srjs{
446196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
446296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP1uiv);
446396c5ddc4Srjs   struct marshal_cmd_MultiTexCoordP1uiv *cmd;
446496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP1uiv, cmd_size);
446596c5ddc4Srjs   cmd->texture = texture;
446696c5ddc4Srjs   cmd->type = type;
446796c5ddc4Srjs   memcpy(cmd->coords, coords, 1 * sizeof(GLuint));
446896c5ddc4Srjs}
446996c5ddc4Srjs
447096c5ddc4Srjs
447196c5ddc4Srjs/* MultiTexCoordP2uiv: marshalled asynchronously */
447296c5ddc4Srjsstruct marshal_cmd_MultiTexCoordP2uiv
447396c5ddc4Srjs{
447496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
447596c5ddc4Srjs   GLenum texture;
447696c5ddc4Srjs   GLenum type;
447796c5ddc4Srjs   GLuint coords[1];
447896c5ddc4Srjs};
447996c5ddc4Srjsuint32_t
448096c5ddc4Srjs_mesa_unmarshal_MultiTexCoordP2uiv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP2uiv *cmd, const uint64_t *last)
448196c5ddc4Srjs{
448296c5ddc4Srjs   GLenum texture = cmd->texture;
448396c5ddc4Srjs   GLenum type = cmd->type;
448496c5ddc4Srjs   const GLuint * coords = cmd->coords;
448596c5ddc4Srjs   CALL_MultiTexCoordP2uiv(ctx->CurrentServerDispatch, (texture, type, coords));
448696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoordP2uiv), 8) / 8);
448796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
448896c5ddc4Srjs   return cmd_size;
448996c5ddc4Srjs}
449096c5ddc4Srjsvoid GLAPIENTRY
449196c5ddc4Srjs_mesa_marshal_MultiTexCoordP2uiv(GLenum texture, GLenum type, const GLuint * coords)
449296c5ddc4Srjs{
449396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
449496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP2uiv);
449596c5ddc4Srjs   struct marshal_cmd_MultiTexCoordP2uiv *cmd;
449696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP2uiv, cmd_size);
449796c5ddc4Srjs   cmd->texture = texture;
449896c5ddc4Srjs   cmd->type = type;
449996c5ddc4Srjs   memcpy(cmd->coords, coords, 1 * sizeof(GLuint));
450096c5ddc4Srjs}
450196c5ddc4Srjs
450296c5ddc4Srjs
450396c5ddc4Srjs/* MultiTexCoordP3uiv: marshalled asynchronously */
450496c5ddc4Srjsstruct marshal_cmd_MultiTexCoordP3uiv
450596c5ddc4Srjs{
450696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
450796c5ddc4Srjs   GLenum texture;
450896c5ddc4Srjs   GLenum type;
450996c5ddc4Srjs   GLuint coords[1];
451096c5ddc4Srjs};
451196c5ddc4Srjsuint32_t
451296c5ddc4Srjs_mesa_unmarshal_MultiTexCoordP3uiv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP3uiv *cmd, const uint64_t *last)
451396c5ddc4Srjs{
451496c5ddc4Srjs   GLenum texture = cmd->texture;
451596c5ddc4Srjs   GLenum type = cmd->type;
451696c5ddc4Srjs   const GLuint * coords = cmd->coords;
451796c5ddc4Srjs   CALL_MultiTexCoordP3uiv(ctx->CurrentServerDispatch, (texture, type, coords));
451896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoordP3uiv), 8) / 8);
451996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
452096c5ddc4Srjs   return cmd_size;
452196c5ddc4Srjs}
452296c5ddc4Srjsvoid GLAPIENTRY
452396c5ddc4Srjs_mesa_marshal_MultiTexCoordP3uiv(GLenum texture, GLenum type, const GLuint * coords)
452496c5ddc4Srjs{
452596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
452696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP3uiv);
452796c5ddc4Srjs   struct marshal_cmd_MultiTexCoordP3uiv *cmd;
452896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP3uiv, cmd_size);
452996c5ddc4Srjs   cmd->texture = texture;
453096c5ddc4Srjs   cmd->type = type;
453196c5ddc4Srjs   memcpy(cmd->coords, coords, 1 * sizeof(GLuint));
453296c5ddc4Srjs}
453396c5ddc4Srjs
453496c5ddc4Srjs
453596c5ddc4Srjs/* MultiTexCoordP4uiv: marshalled asynchronously */
453696c5ddc4Srjsstruct marshal_cmd_MultiTexCoordP4uiv
453796c5ddc4Srjs{
453896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
453996c5ddc4Srjs   GLenum texture;
454096c5ddc4Srjs   GLenum type;
454196c5ddc4Srjs   GLuint coords[1];
454296c5ddc4Srjs};
454396c5ddc4Srjsuint32_t
454496c5ddc4Srjs_mesa_unmarshal_MultiTexCoordP4uiv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP4uiv *cmd, const uint64_t *last)
454596c5ddc4Srjs{
454696c5ddc4Srjs   GLenum texture = cmd->texture;
454796c5ddc4Srjs   GLenum type = cmd->type;
454896c5ddc4Srjs   const GLuint * coords = cmd->coords;
454996c5ddc4Srjs   CALL_MultiTexCoordP4uiv(ctx->CurrentServerDispatch, (texture, type, coords));
455096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoordP4uiv), 8) / 8);
455196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
455296c5ddc4Srjs   return cmd_size;
455396c5ddc4Srjs}
455496c5ddc4Srjsvoid GLAPIENTRY
455596c5ddc4Srjs_mesa_marshal_MultiTexCoordP4uiv(GLenum texture, GLenum type, const GLuint * coords)
455696c5ddc4Srjs{
455796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
455896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP4uiv);
455996c5ddc4Srjs   struct marshal_cmd_MultiTexCoordP4uiv *cmd;
456096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP4uiv, cmd_size);
456196c5ddc4Srjs   cmd->texture = texture;
456296c5ddc4Srjs   cmd->type = type;
456396c5ddc4Srjs   memcpy(cmd->coords, coords, 1 * sizeof(GLuint));
456496c5ddc4Srjs}
456596c5ddc4Srjs
456696c5ddc4Srjs
456796c5ddc4Srjs/* NormalP3ui: marshalled asynchronously */
456896c5ddc4Srjsstruct marshal_cmd_NormalP3ui
456996c5ddc4Srjs{
457096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
457196c5ddc4Srjs   GLenum type;
457296c5ddc4Srjs   GLuint coords;
457396c5ddc4Srjs};
457496c5ddc4Srjsuint32_t
457596c5ddc4Srjs_mesa_unmarshal_NormalP3ui(struct gl_context *ctx, const struct marshal_cmd_NormalP3ui *cmd, const uint64_t *last)
457696c5ddc4Srjs{
457796c5ddc4Srjs   GLenum type = cmd->type;
457896c5ddc4Srjs   GLuint coords = cmd->coords;
457996c5ddc4Srjs   CALL_NormalP3ui(ctx->CurrentServerDispatch, (type, coords));
458096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NormalP3ui), 8) / 8);
458196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
458296c5ddc4Srjs   return cmd_size;
458396c5ddc4Srjs}
458496c5ddc4Srjsvoid GLAPIENTRY
458596c5ddc4Srjs_mesa_marshal_NormalP3ui(GLenum type, GLuint coords)
458696c5ddc4Srjs{
458796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
458896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_NormalP3ui);
458996c5ddc4Srjs   struct marshal_cmd_NormalP3ui *cmd;
459096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NormalP3ui, cmd_size);
459196c5ddc4Srjs   cmd->type = type;
459296c5ddc4Srjs   cmd->coords = coords;
459396c5ddc4Srjs}
459496c5ddc4Srjs
459596c5ddc4Srjs
459696c5ddc4Srjs/* NormalP3uiv: marshalled asynchronously */
459796c5ddc4Srjsstruct marshal_cmd_NormalP3uiv
459896c5ddc4Srjs{
459996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
460096c5ddc4Srjs   GLenum type;
460196c5ddc4Srjs   GLuint coords[1];
460296c5ddc4Srjs};
460396c5ddc4Srjsuint32_t
460496c5ddc4Srjs_mesa_unmarshal_NormalP3uiv(struct gl_context *ctx, const struct marshal_cmd_NormalP3uiv *cmd, const uint64_t *last)
460596c5ddc4Srjs{
460696c5ddc4Srjs   GLenum type = cmd->type;
460796c5ddc4Srjs   const GLuint * coords = cmd->coords;
460896c5ddc4Srjs   CALL_NormalP3uiv(ctx->CurrentServerDispatch, (type, coords));
460996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NormalP3uiv), 8) / 8);
461096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
461196c5ddc4Srjs   return cmd_size;
461296c5ddc4Srjs}
461396c5ddc4Srjsvoid GLAPIENTRY
461496c5ddc4Srjs_mesa_marshal_NormalP3uiv(GLenum type, const GLuint * coords)
461596c5ddc4Srjs{
461696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
461796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_NormalP3uiv);
461896c5ddc4Srjs   struct marshal_cmd_NormalP3uiv *cmd;
461996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NormalP3uiv, cmd_size);
462096c5ddc4Srjs   cmd->type = type;
462196c5ddc4Srjs   memcpy(cmd->coords, coords, 1 * sizeof(GLuint));
462296c5ddc4Srjs}
462396c5ddc4Srjs
462496c5ddc4Srjs
462596c5ddc4Srjs/* ColorP3ui: marshalled asynchronously */
462696c5ddc4Srjsstruct marshal_cmd_ColorP3ui
462796c5ddc4Srjs{
462896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
462996c5ddc4Srjs   GLenum type;
463096c5ddc4Srjs   GLuint color;
463196c5ddc4Srjs};
463296c5ddc4Srjsuint32_t
463396c5ddc4Srjs_mesa_unmarshal_ColorP3ui(struct gl_context *ctx, const struct marshal_cmd_ColorP3ui *cmd, const uint64_t *last)
463496c5ddc4Srjs{
463596c5ddc4Srjs   GLenum type = cmd->type;
463696c5ddc4Srjs   GLuint color = cmd->color;
463796c5ddc4Srjs   CALL_ColorP3ui(ctx->CurrentServerDispatch, (type, color));
463896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ColorP3ui), 8) / 8);
463996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
464096c5ddc4Srjs   return cmd_size;
464196c5ddc4Srjs}
464296c5ddc4Srjsvoid GLAPIENTRY
464396c5ddc4Srjs_mesa_marshal_ColorP3ui(GLenum type, GLuint color)
464496c5ddc4Srjs{
464596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
464696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ColorP3ui);
464796c5ddc4Srjs   struct marshal_cmd_ColorP3ui *cmd;
464896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorP3ui, cmd_size);
464996c5ddc4Srjs   cmd->type = type;
465096c5ddc4Srjs   cmd->color = color;
465196c5ddc4Srjs}
465296c5ddc4Srjs
465396c5ddc4Srjs
465496c5ddc4Srjs/* ColorP4ui: marshalled asynchronously */
465596c5ddc4Srjsstruct marshal_cmd_ColorP4ui
465696c5ddc4Srjs{
465796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
465896c5ddc4Srjs   GLenum type;
465996c5ddc4Srjs   GLuint color;
466096c5ddc4Srjs};
466196c5ddc4Srjsuint32_t
466296c5ddc4Srjs_mesa_unmarshal_ColorP4ui(struct gl_context *ctx, const struct marshal_cmd_ColorP4ui *cmd, const uint64_t *last)
466396c5ddc4Srjs{
466496c5ddc4Srjs   GLenum type = cmd->type;
466596c5ddc4Srjs   GLuint color = cmd->color;
466696c5ddc4Srjs   CALL_ColorP4ui(ctx->CurrentServerDispatch, (type, color));
466796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ColorP4ui), 8) / 8);
466896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
466996c5ddc4Srjs   return cmd_size;
467096c5ddc4Srjs}
467196c5ddc4Srjsvoid GLAPIENTRY
467296c5ddc4Srjs_mesa_marshal_ColorP4ui(GLenum type, GLuint color)
467396c5ddc4Srjs{
467496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
467596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ColorP4ui);
467696c5ddc4Srjs   struct marshal_cmd_ColorP4ui *cmd;
467796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorP4ui, cmd_size);
467896c5ddc4Srjs   cmd->type = type;
467996c5ddc4Srjs   cmd->color = color;
468096c5ddc4Srjs}
468196c5ddc4Srjs
468296c5ddc4Srjs
468396c5ddc4Srjs/* ColorP3uiv: marshalled asynchronously */
468496c5ddc4Srjsstruct marshal_cmd_ColorP3uiv
468596c5ddc4Srjs{
468696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
468796c5ddc4Srjs   GLenum type;
468896c5ddc4Srjs   GLuint color[1];
468996c5ddc4Srjs};
469096c5ddc4Srjsuint32_t
469196c5ddc4Srjs_mesa_unmarshal_ColorP3uiv(struct gl_context *ctx, const struct marshal_cmd_ColorP3uiv *cmd, const uint64_t *last)
469296c5ddc4Srjs{
469396c5ddc4Srjs   GLenum type = cmd->type;
469496c5ddc4Srjs   const GLuint * color = cmd->color;
469596c5ddc4Srjs   CALL_ColorP3uiv(ctx->CurrentServerDispatch, (type, color));
469696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ColorP3uiv), 8) / 8);
469796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
469896c5ddc4Srjs   return cmd_size;
469996c5ddc4Srjs}
470096c5ddc4Srjsvoid GLAPIENTRY
470196c5ddc4Srjs_mesa_marshal_ColorP3uiv(GLenum type, const GLuint * color)
470296c5ddc4Srjs{
470396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
470496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ColorP3uiv);
470596c5ddc4Srjs   struct marshal_cmd_ColorP3uiv *cmd;
470696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorP3uiv, cmd_size);
470796c5ddc4Srjs   cmd->type = type;
470896c5ddc4Srjs   memcpy(cmd->color, color, 1 * sizeof(GLuint));
470996c5ddc4Srjs}
471096c5ddc4Srjs
471196c5ddc4Srjs
471296c5ddc4Srjs/* ColorP4uiv: marshalled asynchronously */
471396c5ddc4Srjsstruct marshal_cmd_ColorP4uiv
471496c5ddc4Srjs{
471596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
471696c5ddc4Srjs   GLenum type;
471796c5ddc4Srjs   GLuint color[1];
471896c5ddc4Srjs};
471996c5ddc4Srjsuint32_t
472096c5ddc4Srjs_mesa_unmarshal_ColorP4uiv(struct gl_context *ctx, const struct marshal_cmd_ColorP4uiv *cmd, const uint64_t *last)
472196c5ddc4Srjs{
472296c5ddc4Srjs   GLenum type = cmd->type;
472396c5ddc4Srjs   const GLuint * color = cmd->color;
472496c5ddc4Srjs   CALL_ColorP4uiv(ctx->CurrentServerDispatch, (type, color));
472596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ColorP4uiv), 8) / 8);
472696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
472796c5ddc4Srjs   return cmd_size;
472896c5ddc4Srjs}
472996c5ddc4Srjsvoid GLAPIENTRY
473096c5ddc4Srjs_mesa_marshal_ColorP4uiv(GLenum type, const GLuint * color)
473196c5ddc4Srjs{
473296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
473396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ColorP4uiv);
473496c5ddc4Srjs   struct marshal_cmd_ColorP4uiv *cmd;
473596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorP4uiv, cmd_size);
473696c5ddc4Srjs   cmd->type = type;
473796c5ddc4Srjs   memcpy(cmd->color, color, 1 * sizeof(GLuint));
473896c5ddc4Srjs}
473996c5ddc4Srjs
474096c5ddc4Srjs
474196c5ddc4Srjs/* SecondaryColorP3ui: marshalled asynchronously */
474296c5ddc4Srjsstruct marshal_cmd_SecondaryColorP3ui
474396c5ddc4Srjs{
474496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
474596c5ddc4Srjs   GLenum type;
474696c5ddc4Srjs   GLuint color;
474796c5ddc4Srjs};
474896c5ddc4Srjsuint32_t
474996c5ddc4Srjs_mesa_unmarshal_SecondaryColorP3ui(struct gl_context *ctx, const struct marshal_cmd_SecondaryColorP3ui *cmd, const uint64_t *last)
475096c5ddc4Srjs{
475196c5ddc4Srjs   GLenum type = cmd->type;
475296c5ddc4Srjs   GLuint color = cmd->color;
475396c5ddc4Srjs   CALL_SecondaryColorP3ui(ctx->CurrentServerDispatch, (type, color));
475496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColorP3ui), 8) / 8);
475596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
475696c5ddc4Srjs   return cmd_size;
475796c5ddc4Srjs}
475896c5ddc4Srjsvoid GLAPIENTRY
475996c5ddc4Srjs_mesa_marshal_SecondaryColorP3ui(GLenum type, GLuint color)
476096c5ddc4Srjs{
476196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
476296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColorP3ui);
476396c5ddc4Srjs   struct marshal_cmd_SecondaryColorP3ui *cmd;
476496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColorP3ui, cmd_size);
476596c5ddc4Srjs   cmd->type = type;
476696c5ddc4Srjs   cmd->color = color;
476796c5ddc4Srjs}
476896c5ddc4Srjs
476996c5ddc4Srjs
477096c5ddc4Srjs/* SecondaryColorP3uiv: marshalled asynchronously */
477196c5ddc4Srjsstruct marshal_cmd_SecondaryColorP3uiv
477296c5ddc4Srjs{
477396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
477496c5ddc4Srjs   GLenum type;
477596c5ddc4Srjs   GLuint color[1];
477696c5ddc4Srjs};
477796c5ddc4Srjsuint32_t
477896c5ddc4Srjs_mesa_unmarshal_SecondaryColorP3uiv(struct gl_context *ctx, const struct marshal_cmd_SecondaryColorP3uiv *cmd, const uint64_t *last)
477996c5ddc4Srjs{
478096c5ddc4Srjs   GLenum type = cmd->type;
478196c5ddc4Srjs   const GLuint * color = cmd->color;
478296c5ddc4Srjs   CALL_SecondaryColorP3uiv(ctx->CurrentServerDispatch, (type, color));
478396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColorP3uiv), 8) / 8);
478496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
478596c5ddc4Srjs   return cmd_size;
478696c5ddc4Srjs}
478796c5ddc4Srjsvoid GLAPIENTRY
478896c5ddc4Srjs_mesa_marshal_SecondaryColorP3uiv(GLenum type, const GLuint * color)
478996c5ddc4Srjs{
479096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
479196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColorP3uiv);
479296c5ddc4Srjs   struct marshal_cmd_SecondaryColorP3uiv *cmd;
479396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColorP3uiv, cmd_size);
479496c5ddc4Srjs   cmd->type = type;
479596c5ddc4Srjs   memcpy(cmd->color, color, 1 * sizeof(GLuint));
479696c5ddc4Srjs}
479796c5ddc4Srjs
479896c5ddc4Srjs
479996c5ddc4Srjs/* VertexAttribP1ui: marshalled asynchronously */
480096c5ddc4Srjsstruct marshal_cmd_VertexAttribP1ui
480196c5ddc4Srjs{
480296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
480396c5ddc4Srjs   GLboolean normalized;
480496c5ddc4Srjs   GLuint index;
480596c5ddc4Srjs   GLenum type;
480696c5ddc4Srjs   GLuint value;
480796c5ddc4Srjs};
480896c5ddc4Srjsuint32_t
480996c5ddc4Srjs_mesa_unmarshal_VertexAttribP1ui(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP1ui *cmd, const uint64_t *last)
481096c5ddc4Srjs{
481196c5ddc4Srjs   GLuint index = cmd->index;
481296c5ddc4Srjs   GLenum type = cmd->type;
481396c5ddc4Srjs   GLboolean normalized = cmd->normalized;
481496c5ddc4Srjs   GLuint value = cmd->value;
481596c5ddc4Srjs   CALL_VertexAttribP1ui(ctx->CurrentServerDispatch, (index, type, normalized, value));
481696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribP1ui), 8) / 8);
481796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
481896c5ddc4Srjs   return cmd_size;
481996c5ddc4Srjs}
482096c5ddc4Srjsvoid GLAPIENTRY
482196c5ddc4Srjs_mesa_marshal_VertexAttribP1ui(GLuint index, GLenum type, GLboolean normalized, GLuint value)
482296c5ddc4Srjs{
482396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
482496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribP1ui);
482596c5ddc4Srjs   struct marshal_cmd_VertexAttribP1ui *cmd;
482696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP1ui, cmd_size);
482796c5ddc4Srjs   cmd->index = index;
482896c5ddc4Srjs   cmd->type = type;
482996c5ddc4Srjs   cmd->normalized = normalized;
483096c5ddc4Srjs   cmd->value = value;
483196c5ddc4Srjs}
483296c5ddc4Srjs
483396c5ddc4Srjs
483496c5ddc4Srjs/* VertexAttribP2ui: marshalled asynchronously */
483596c5ddc4Srjsstruct marshal_cmd_VertexAttribP2ui
483696c5ddc4Srjs{
483796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
483896c5ddc4Srjs   GLboolean normalized;
483996c5ddc4Srjs   GLuint index;
484096c5ddc4Srjs   GLenum type;
484196c5ddc4Srjs   GLuint value;
484296c5ddc4Srjs};
484396c5ddc4Srjsuint32_t
484496c5ddc4Srjs_mesa_unmarshal_VertexAttribP2ui(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP2ui *cmd, const uint64_t *last)
484596c5ddc4Srjs{
484696c5ddc4Srjs   GLuint index = cmd->index;
484796c5ddc4Srjs   GLenum type = cmd->type;
484896c5ddc4Srjs   GLboolean normalized = cmd->normalized;
484996c5ddc4Srjs   GLuint value = cmd->value;
485096c5ddc4Srjs   CALL_VertexAttribP2ui(ctx->CurrentServerDispatch, (index, type, normalized, value));
485196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribP2ui), 8) / 8);
485296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
485396c5ddc4Srjs   return cmd_size;
485496c5ddc4Srjs}
485596c5ddc4Srjsvoid GLAPIENTRY
485696c5ddc4Srjs_mesa_marshal_VertexAttribP2ui(GLuint index, GLenum type, GLboolean normalized, GLuint value)
485796c5ddc4Srjs{
485896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
485996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribP2ui);
486096c5ddc4Srjs   struct marshal_cmd_VertexAttribP2ui *cmd;
486196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP2ui, cmd_size);
486296c5ddc4Srjs   cmd->index = index;
486396c5ddc4Srjs   cmd->type = type;
486496c5ddc4Srjs   cmd->normalized = normalized;
486596c5ddc4Srjs   cmd->value = value;
486696c5ddc4Srjs}
486796c5ddc4Srjs
486896c5ddc4Srjs
486996c5ddc4Srjs/* VertexAttribP3ui: marshalled asynchronously */
487096c5ddc4Srjsstruct marshal_cmd_VertexAttribP3ui
487196c5ddc4Srjs{
487296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
487396c5ddc4Srjs   GLboolean normalized;
487496c5ddc4Srjs   GLuint index;
487596c5ddc4Srjs   GLenum type;
487696c5ddc4Srjs   GLuint value;
487796c5ddc4Srjs};
487896c5ddc4Srjsuint32_t
487996c5ddc4Srjs_mesa_unmarshal_VertexAttribP3ui(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP3ui *cmd, const uint64_t *last)
488096c5ddc4Srjs{
488196c5ddc4Srjs   GLuint index = cmd->index;
488296c5ddc4Srjs   GLenum type = cmd->type;
488396c5ddc4Srjs   GLboolean normalized = cmd->normalized;
488496c5ddc4Srjs   GLuint value = cmd->value;
488596c5ddc4Srjs   CALL_VertexAttribP3ui(ctx->CurrentServerDispatch, (index, type, normalized, value));
488696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribP3ui), 8) / 8);
488796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
488896c5ddc4Srjs   return cmd_size;
488996c5ddc4Srjs}
489096c5ddc4Srjsvoid GLAPIENTRY
489196c5ddc4Srjs_mesa_marshal_VertexAttribP3ui(GLuint index, GLenum type, GLboolean normalized, GLuint value)
489296c5ddc4Srjs{
489396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
489496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribP3ui);
489596c5ddc4Srjs   struct marshal_cmd_VertexAttribP3ui *cmd;
489696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP3ui, cmd_size);
489796c5ddc4Srjs   cmd->index = index;
489896c5ddc4Srjs   cmd->type = type;
489996c5ddc4Srjs   cmd->normalized = normalized;
490096c5ddc4Srjs   cmd->value = value;
490196c5ddc4Srjs}
490296c5ddc4Srjs
490396c5ddc4Srjs
490496c5ddc4Srjs/* VertexAttribP4ui: marshalled asynchronously */
490596c5ddc4Srjsstruct marshal_cmd_VertexAttribP4ui
490696c5ddc4Srjs{
490796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
490896c5ddc4Srjs   GLboolean normalized;
490996c5ddc4Srjs   GLuint index;
491096c5ddc4Srjs   GLenum type;
491196c5ddc4Srjs   GLuint value;
491296c5ddc4Srjs};
491396c5ddc4Srjsuint32_t
491496c5ddc4Srjs_mesa_unmarshal_VertexAttribP4ui(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP4ui *cmd, const uint64_t *last)
491596c5ddc4Srjs{
491696c5ddc4Srjs   GLuint index = cmd->index;
491796c5ddc4Srjs   GLenum type = cmd->type;
491896c5ddc4Srjs   GLboolean normalized = cmd->normalized;
491996c5ddc4Srjs   GLuint value = cmd->value;
492096c5ddc4Srjs   CALL_VertexAttribP4ui(ctx->CurrentServerDispatch, (index, type, normalized, value));
492196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribP4ui), 8) / 8);
492296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
492396c5ddc4Srjs   return cmd_size;
492496c5ddc4Srjs}
492596c5ddc4Srjsvoid GLAPIENTRY
492696c5ddc4Srjs_mesa_marshal_VertexAttribP4ui(GLuint index, GLenum type, GLboolean normalized, GLuint value)
492796c5ddc4Srjs{
492896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
492996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribP4ui);
493096c5ddc4Srjs   struct marshal_cmd_VertexAttribP4ui *cmd;
493196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP4ui, cmd_size);
493296c5ddc4Srjs   cmd->index = index;
493396c5ddc4Srjs   cmd->type = type;
493496c5ddc4Srjs   cmd->normalized = normalized;
493596c5ddc4Srjs   cmd->value = value;
493696c5ddc4Srjs}
493796c5ddc4Srjs
493896c5ddc4Srjs
493996c5ddc4Srjs/* VertexAttribP1uiv: marshalled asynchronously */
494096c5ddc4Srjsstruct marshal_cmd_VertexAttribP1uiv
494196c5ddc4Srjs{
494296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
494396c5ddc4Srjs   GLboolean normalized;
494496c5ddc4Srjs   GLuint index;
494596c5ddc4Srjs   GLenum type;
494696c5ddc4Srjs   GLuint value[1];
494796c5ddc4Srjs};
494896c5ddc4Srjsuint32_t
494996c5ddc4Srjs_mesa_unmarshal_VertexAttribP1uiv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP1uiv *cmd, const uint64_t *last)
495096c5ddc4Srjs{
495196c5ddc4Srjs   GLuint index = cmd->index;
495296c5ddc4Srjs   GLenum type = cmd->type;
495396c5ddc4Srjs   GLboolean normalized = cmd->normalized;
495496c5ddc4Srjs   const GLuint * value = cmd->value;
495596c5ddc4Srjs   CALL_VertexAttribP1uiv(ctx->CurrentServerDispatch, (index, type, normalized, value));
495696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribP1uiv), 8) / 8);
495796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
495896c5ddc4Srjs   return cmd_size;
495996c5ddc4Srjs}
496096c5ddc4Srjsvoid GLAPIENTRY
496196c5ddc4Srjs_mesa_marshal_VertexAttribP1uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint * value)
496296c5ddc4Srjs{
496396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
496496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribP1uiv);
496596c5ddc4Srjs   struct marshal_cmd_VertexAttribP1uiv *cmd;
496696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP1uiv, cmd_size);
496796c5ddc4Srjs   cmd->index = index;
496896c5ddc4Srjs   cmd->type = type;
496996c5ddc4Srjs   cmd->normalized = normalized;
497096c5ddc4Srjs   memcpy(cmd->value, value, 1 * sizeof(GLuint));
497196c5ddc4Srjs}
497296c5ddc4Srjs
497396c5ddc4Srjs
497496c5ddc4Srjs/* VertexAttribP2uiv: marshalled asynchronously */
497596c5ddc4Srjsstruct marshal_cmd_VertexAttribP2uiv
497696c5ddc4Srjs{
497796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
497896c5ddc4Srjs   GLboolean normalized;
497996c5ddc4Srjs   GLuint index;
498096c5ddc4Srjs   GLenum type;
498196c5ddc4Srjs   GLuint value[1];
498296c5ddc4Srjs};
498396c5ddc4Srjsuint32_t
498496c5ddc4Srjs_mesa_unmarshal_VertexAttribP2uiv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP2uiv *cmd, const uint64_t *last)
498596c5ddc4Srjs{
498696c5ddc4Srjs   GLuint index = cmd->index;
498796c5ddc4Srjs   GLenum type = cmd->type;
498896c5ddc4Srjs   GLboolean normalized = cmd->normalized;
498996c5ddc4Srjs   const GLuint * value = cmd->value;
499096c5ddc4Srjs   CALL_VertexAttribP2uiv(ctx->CurrentServerDispatch, (index, type, normalized, value));
499196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribP2uiv), 8) / 8);
499296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
499396c5ddc4Srjs   return cmd_size;
499496c5ddc4Srjs}
499596c5ddc4Srjsvoid GLAPIENTRY
499696c5ddc4Srjs_mesa_marshal_VertexAttribP2uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint * value)
499796c5ddc4Srjs{
499896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
499996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribP2uiv);
500096c5ddc4Srjs   struct marshal_cmd_VertexAttribP2uiv *cmd;
500196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP2uiv, cmd_size);
500296c5ddc4Srjs   cmd->index = index;
500396c5ddc4Srjs   cmd->type = type;
500496c5ddc4Srjs   cmd->normalized = normalized;
500596c5ddc4Srjs   memcpy(cmd->value, value, 1 * sizeof(GLuint));
500696c5ddc4Srjs}
500796c5ddc4Srjs
500896c5ddc4Srjs
500996c5ddc4Srjs/* VertexAttribP3uiv: marshalled asynchronously */
501096c5ddc4Srjsstruct marshal_cmd_VertexAttribP3uiv
501196c5ddc4Srjs{
501296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
501396c5ddc4Srjs   GLboolean normalized;
501496c5ddc4Srjs   GLuint index;
501596c5ddc4Srjs   GLenum type;
501696c5ddc4Srjs   GLuint value[1];
501796c5ddc4Srjs};
501896c5ddc4Srjsuint32_t
501996c5ddc4Srjs_mesa_unmarshal_VertexAttribP3uiv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP3uiv *cmd, const uint64_t *last)
502096c5ddc4Srjs{
502196c5ddc4Srjs   GLuint index = cmd->index;
502296c5ddc4Srjs   GLenum type = cmd->type;
502396c5ddc4Srjs   GLboolean normalized = cmd->normalized;
502496c5ddc4Srjs   const GLuint * value = cmd->value;
502596c5ddc4Srjs   CALL_VertexAttribP3uiv(ctx->CurrentServerDispatch, (index, type, normalized, value));
502696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribP3uiv), 8) / 8);
502796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
502896c5ddc4Srjs   return cmd_size;
502996c5ddc4Srjs}
503096c5ddc4Srjsvoid GLAPIENTRY
503196c5ddc4Srjs_mesa_marshal_VertexAttribP3uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint * value)
503296c5ddc4Srjs{
503396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
503496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribP3uiv);
503596c5ddc4Srjs   struct marshal_cmd_VertexAttribP3uiv *cmd;
503696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP3uiv, cmd_size);
503796c5ddc4Srjs   cmd->index = index;
503896c5ddc4Srjs   cmd->type = type;
503996c5ddc4Srjs   cmd->normalized = normalized;
504096c5ddc4Srjs   memcpy(cmd->value, value, 1 * sizeof(GLuint));
504196c5ddc4Srjs}
504296c5ddc4Srjs
504396c5ddc4Srjs
504496c5ddc4Srjs/* VertexAttribP4uiv: marshalled asynchronously */
504596c5ddc4Srjsstruct marshal_cmd_VertexAttribP4uiv
504696c5ddc4Srjs{
504796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
504896c5ddc4Srjs   GLboolean normalized;
504996c5ddc4Srjs   GLuint index;
505096c5ddc4Srjs   GLenum type;
505196c5ddc4Srjs   GLuint value[1];
505296c5ddc4Srjs};
505396c5ddc4Srjsuint32_t
505496c5ddc4Srjs_mesa_unmarshal_VertexAttribP4uiv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP4uiv *cmd, const uint64_t *last)
505596c5ddc4Srjs{
505696c5ddc4Srjs   GLuint index = cmd->index;
505796c5ddc4Srjs   GLenum type = cmd->type;
505896c5ddc4Srjs   GLboolean normalized = cmd->normalized;
505996c5ddc4Srjs   const GLuint * value = cmd->value;
506096c5ddc4Srjs   CALL_VertexAttribP4uiv(ctx->CurrentServerDispatch, (index, type, normalized, value));
506196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribP4uiv), 8) / 8);
506296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
506396c5ddc4Srjs   return cmd_size;
506496c5ddc4Srjs}
506596c5ddc4Srjsvoid GLAPIENTRY
506696c5ddc4Srjs_mesa_marshal_VertexAttribP4uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint * value)
506796c5ddc4Srjs{
506896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
506996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribP4uiv);
507096c5ddc4Srjs   struct marshal_cmd_VertexAttribP4uiv *cmd;
507196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP4uiv, cmd_size);
507296c5ddc4Srjs   cmd->index = index;
507396c5ddc4Srjs   cmd->type = type;
507496c5ddc4Srjs   cmd->normalized = normalized;
507596c5ddc4Srjs   memcpy(cmd->value, value, 1 * sizeof(GLuint));
507696c5ddc4Srjs}
507796c5ddc4Srjs
507896c5ddc4Srjs
507996c5ddc4Srjs/* GetSubroutineUniformLocation: marshalled synchronously */
508096c5ddc4SrjsGLint GLAPIENTRY
508196c5ddc4Srjs_mesa_marshal_GetSubroutineUniformLocation(GLuint program, GLenum shadertype, const GLchar * name)
508296c5ddc4Srjs{
508396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
508496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetSubroutineUniformLocation");
508596c5ddc4Srjs   return CALL_GetSubroutineUniformLocation(ctx->CurrentServerDispatch, (program, shadertype, name));
508696c5ddc4Srjs}
508796c5ddc4Srjs
508896c5ddc4Srjs
508996c5ddc4Srjs/* GetSubroutineIndex: marshalled synchronously */
509096c5ddc4SrjsGLuint GLAPIENTRY
509196c5ddc4Srjs_mesa_marshal_GetSubroutineIndex(GLuint program, GLenum shadertype, const GLchar * name)
509296c5ddc4Srjs{
509396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
509496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetSubroutineIndex");
509596c5ddc4Srjs   return CALL_GetSubroutineIndex(ctx->CurrentServerDispatch, (program, shadertype, name));
509696c5ddc4Srjs}
509796c5ddc4Srjs
509896c5ddc4Srjs
509996c5ddc4Srjs/* GetActiveSubroutineUniformiv: marshalled synchronously */
510096c5ddc4Srjsvoid GLAPIENTRY
510196c5ddc4Srjs_mesa_marshal_GetActiveSubroutineUniformiv(GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint * values)
510296c5ddc4Srjs{
510396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
510496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetActiveSubroutineUniformiv");
510596c5ddc4Srjs   CALL_GetActiveSubroutineUniformiv(ctx->CurrentServerDispatch, (program, shadertype, index, pname, values));
510696c5ddc4Srjs}
510796c5ddc4Srjs
510896c5ddc4Srjs
510996c5ddc4Srjs/* GetActiveSubroutineUniformName: marshalled synchronously */
511096c5ddc4Srjsvoid GLAPIENTRY
511196c5ddc4Srjs_mesa_marshal_GetActiveSubroutineUniformName(GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei * length, GLchar * name)
511296c5ddc4Srjs{
511396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
511496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetActiveSubroutineUniformName");
511596c5ddc4Srjs   CALL_GetActiveSubroutineUniformName(ctx->CurrentServerDispatch, (program, shadertype, index, bufsize, length, name));
511696c5ddc4Srjs}
511796c5ddc4Srjs
511896c5ddc4Srjs
511996c5ddc4Srjs/* GetActiveSubroutineName: marshalled synchronously */
512096c5ddc4Srjsvoid GLAPIENTRY
512196c5ddc4Srjs_mesa_marshal_GetActiveSubroutineName(GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei * length, GLchar * name)
512296c5ddc4Srjs{
512396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
512496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetActiveSubroutineName");
512596c5ddc4Srjs   CALL_GetActiveSubroutineName(ctx->CurrentServerDispatch, (program, shadertype, index, bufsize, length, name));
512696c5ddc4Srjs}
512796c5ddc4Srjs
512896c5ddc4Srjs
512996c5ddc4Srjs/* UniformSubroutinesuiv: marshalled asynchronously */
513096c5ddc4Srjsstruct marshal_cmd_UniformSubroutinesuiv
513196c5ddc4Srjs{
513296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
513396c5ddc4Srjs   GLenum shadertype;
513496c5ddc4Srjs   GLsizei count;
513596c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLuint)) bytes are GLuint indices[count] */
513696c5ddc4Srjs};
513796c5ddc4Srjsuint32_t
513896c5ddc4Srjs_mesa_unmarshal_UniformSubroutinesuiv(struct gl_context *ctx, const struct marshal_cmd_UniformSubroutinesuiv *cmd, const uint64_t *last)
513996c5ddc4Srjs{
514096c5ddc4Srjs   GLenum shadertype = cmd->shadertype;
514196c5ddc4Srjs   GLsizei count = cmd->count;
514296c5ddc4Srjs   GLuint * indices;
514396c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
514496c5ddc4Srjs   indices = (GLuint *) variable_data;
514596c5ddc4Srjs   CALL_UniformSubroutinesuiv(ctx->CurrentServerDispatch, (shadertype, count, indices));
514696c5ddc4Srjs   return cmd->cmd_base.cmd_size;
514796c5ddc4Srjs}
514896c5ddc4Srjsvoid GLAPIENTRY
514996c5ddc4Srjs_mesa_marshal_UniformSubroutinesuiv(GLenum shadertype, GLsizei count, const GLuint * indices)
515096c5ddc4Srjs{
515196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
515296c5ddc4Srjs   int indices_size = safe_mul(count, 1 * sizeof(GLuint));
515396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformSubroutinesuiv) + indices_size;
515496c5ddc4Srjs   struct marshal_cmd_UniformSubroutinesuiv *cmd;
515596c5ddc4Srjs   if (unlikely(indices_size < 0 || (indices_size > 0 && !indices) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
515696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformSubroutinesuiv");
515796c5ddc4Srjs      CALL_UniformSubroutinesuiv(ctx->CurrentServerDispatch, (shadertype, count, indices));
515896c5ddc4Srjs      return;
515996c5ddc4Srjs   }
516096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformSubroutinesuiv, cmd_size);
516196c5ddc4Srjs   cmd->shadertype = shadertype;
516296c5ddc4Srjs   cmd->count = count;
516396c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
516496c5ddc4Srjs   memcpy(variable_data, indices, indices_size);
516596c5ddc4Srjs}
516696c5ddc4Srjs
516796c5ddc4Srjs
516896c5ddc4Srjs/* GetUniformSubroutineuiv: marshalled synchronously */
516996c5ddc4Srjsvoid GLAPIENTRY
517096c5ddc4Srjs_mesa_marshal_GetUniformSubroutineuiv(GLenum shadertype, GLint location, GLuint * params)
517196c5ddc4Srjs{
517296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
517396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetUniformSubroutineuiv");
517496c5ddc4Srjs   CALL_GetUniformSubroutineuiv(ctx->CurrentServerDispatch, (shadertype, location, params));
517596c5ddc4Srjs}
517696c5ddc4Srjs
517796c5ddc4Srjs
517896c5ddc4Srjs/* GetProgramStageiv: marshalled synchronously */
517996c5ddc4Srjsvoid GLAPIENTRY
518096c5ddc4Srjs_mesa_marshal_GetProgramStageiv(GLuint program, GLenum shadertype, GLenum pname, GLint * values)
518196c5ddc4Srjs{
518296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
518396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramStageiv");
518496c5ddc4Srjs   CALL_GetProgramStageiv(ctx->CurrentServerDispatch, (program, shadertype, pname, values));
518596c5ddc4Srjs}
518696c5ddc4Srjs
518796c5ddc4Srjs
518896c5ddc4Srjs/* PatchParameteri: marshalled asynchronously */
518996c5ddc4Srjsstruct marshal_cmd_PatchParameteri
519096c5ddc4Srjs{
519196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
519296c5ddc4Srjs   GLenum pname;
519396c5ddc4Srjs   GLint value;
519496c5ddc4Srjs};
519596c5ddc4Srjsuint32_t
519696c5ddc4Srjs_mesa_unmarshal_PatchParameteri(struct gl_context *ctx, const struct marshal_cmd_PatchParameteri *cmd, const uint64_t *last)
519796c5ddc4Srjs{
519896c5ddc4Srjs   GLenum pname = cmd->pname;
519996c5ddc4Srjs   GLint value = cmd->value;
520096c5ddc4Srjs   CALL_PatchParameteri(ctx->CurrentServerDispatch, (pname, value));
520196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PatchParameteri), 8) / 8);
520296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
520396c5ddc4Srjs   return cmd_size;
520496c5ddc4Srjs}
520596c5ddc4Srjsvoid GLAPIENTRY
520696c5ddc4Srjs_mesa_marshal_PatchParameteri(GLenum pname, GLint value)
520796c5ddc4Srjs{
520896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
520996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_PatchParameteri);
521096c5ddc4Srjs   struct marshal_cmd_PatchParameteri *cmd;
521196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PatchParameteri, cmd_size);
521296c5ddc4Srjs   cmd->pname = pname;
521396c5ddc4Srjs   cmd->value = value;
521496c5ddc4Srjs}
521596c5ddc4Srjs
521696c5ddc4Srjs
521796c5ddc4Srjs/* PatchParameterfv: marshalled asynchronously */
521896c5ddc4Srjsstruct marshal_cmd_PatchParameterfv
521996c5ddc4Srjs{
522096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
522196c5ddc4Srjs   GLenum pname;
522296c5ddc4Srjs   /* Next safe_mul(_mesa_patch_param_enum_to_count(pname), 1 * sizeof(GLfloat)) bytes are GLfloat values[_mesa_patch_param_enum_to_count(pname)] */
522396c5ddc4Srjs};
522496c5ddc4Srjsuint32_t
522596c5ddc4Srjs_mesa_unmarshal_PatchParameterfv(struct gl_context *ctx, const struct marshal_cmd_PatchParameterfv *cmd, const uint64_t *last)
522696c5ddc4Srjs{
522796c5ddc4Srjs   GLenum pname = cmd->pname;
522896c5ddc4Srjs   GLfloat * values;
522996c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
523096c5ddc4Srjs   values = (GLfloat *) variable_data;
523196c5ddc4Srjs   CALL_PatchParameterfv(ctx->CurrentServerDispatch, (pname, values));
523296c5ddc4Srjs   return cmd->cmd_base.cmd_size;
523396c5ddc4Srjs}
523496c5ddc4Srjsvoid GLAPIENTRY
523596c5ddc4Srjs_mesa_marshal_PatchParameterfv(GLenum pname, const GLfloat * values)
523696c5ddc4Srjs{
523796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
523896c5ddc4Srjs   int values_size = safe_mul(_mesa_patch_param_enum_to_count(pname), 1 * sizeof(GLfloat));
523996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_PatchParameterfv) + values_size;
524096c5ddc4Srjs   struct marshal_cmd_PatchParameterfv *cmd;
524196c5ddc4Srjs   if (unlikely(values_size < 0 || (values_size > 0 && !values) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
524296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "PatchParameterfv");
524396c5ddc4Srjs      CALL_PatchParameterfv(ctx->CurrentServerDispatch, (pname, values));
524496c5ddc4Srjs      return;
524596c5ddc4Srjs   }
524696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PatchParameterfv, cmd_size);
524796c5ddc4Srjs   cmd->pname = pname;
524896c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
524996c5ddc4Srjs   memcpy(variable_data, values, values_size);
525096c5ddc4Srjs}
525196c5ddc4Srjs
525296c5ddc4Srjs
525396c5ddc4Srjs/* DrawArraysIndirect: marshalled asynchronously */
525496c5ddc4Srjsstruct marshal_cmd_DrawArraysIndirect
525596c5ddc4Srjs{
525696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
525796c5ddc4Srjs   GLenum mode;
525896c5ddc4Srjs   const GLvoid * indirect;
525996c5ddc4Srjs};
526096c5ddc4Srjsuint32_t
526196c5ddc4Srjs_mesa_unmarshal_DrawArraysIndirect(struct gl_context *ctx, const struct marshal_cmd_DrawArraysIndirect *cmd, const uint64_t *last)
526296c5ddc4Srjs{
526396c5ddc4Srjs   GLenum mode = cmd->mode;
526496c5ddc4Srjs   const GLvoid * indirect = cmd->indirect;
526596c5ddc4Srjs   CALL_DrawArraysIndirect(ctx->CurrentServerDispatch, (mode, indirect));
526696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawArraysIndirect), 8) / 8);
526796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
526896c5ddc4Srjs   return cmd_size;
526996c5ddc4Srjs}
527096c5ddc4Srjsvoid GLAPIENTRY
527196c5ddc4Srjs_mesa_marshal_DrawArraysIndirect(GLenum mode, const GLvoid * indirect)
527296c5ddc4Srjs{
527396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
527496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DrawArraysIndirect);
527596c5ddc4Srjs   struct marshal_cmd_DrawArraysIndirect *cmd;
527696c5ddc4Srjs   if (_mesa_glthread_has_non_vbo_vertices_or_indirect(ctx)) {
527796c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "DrawArraysIndirect");
527896c5ddc4Srjs      CALL_DrawArraysIndirect(ctx->CurrentServerDispatch, (mode, indirect));
527996c5ddc4Srjs      return;
528096c5ddc4Srjs   }
528196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawArraysIndirect, cmd_size);
528296c5ddc4Srjs   cmd->mode = mode;
528396c5ddc4Srjs   cmd->indirect = indirect;
528496c5ddc4Srjs}
528596c5ddc4Srjs
528696c5ddc4Srjs
528796c5ddc4Srjs/* DrawElementsIndirect: marshalled asynchronously */
528896c5ddc4Srjsstruct marshal_cmd_DrawElementsIndirect
528996c5ddc4Srjs{
529096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
529196c5ddc4Srjs   GLenum mode;
529296c5ddc4Srjs   GLenum type;
529396c5ddc4Srjs   const GLvoid * indirect;
529496c5ddc4Srjs};
529596c5ddc4Srjsuint32_t
529696c5ddc4Srjs_mesa_unmarshal_DrawElementsIndirect(struct gl_context *ctx, const struct marshal_cmd_DrawElementsIndirect *cmd, const uint64_t *last)
529796c5ddc4Srjs{
529896c5ddc4Srjs   GLenum mode = cmd->mode;
529996c5ddc4Srjs   GLenum type = cmd->type;
530096c5ddc4Srjs   const GLvoid * indirect = cmd->indirect;
530196c5ddc4Srjs   CALL_DrawElementsIndirect(ctx->CurrentServerDispatch, (mode, type, indirect));
530296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawElementsIndirect), 8) / 8);
530396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
530496c5ddc4Srjs   return cmd_size;
530596c5ddc4Srjs}
530696c5ddc4Srjsvoid GLAPIENTRY
530796c5ddc4Srjs_mesa_marshal_DrawElementsIndirect(GLenum mode, GLenum type, const GLvoid * indirect)
530896c5ddc4Srjs{
530996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
531096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DrawElementsIndirect);
531196c5ddc4Srjs   struct marshal_cmd_DrawElementsIndirect *cmd;
531296c5ddc4Srjs   if (_mesa_glthread_has_non_vbo_vertices_or_indices_or_indirect(ctx)) {
531396c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "DrawElementsIndirect");
531496c5ddc4Srjs      CALL_DrawElementsIndirect(ctx->CurrentServerDispatch, (mode, type, indirect));
531596c5ddc4Srjs      return;
531696c5ddc4Srjs   }
531796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawElementsIndirect, cmd_size);
531896c5ddc4Srjs   cmd->mode = mode;
531996c5ddc4Srjs   cmd->type = type;
532096c5ddc4Srjs   cmd->indirect = indirect;
532196c5ddc4Srjs}
532296c5ddc4Srjs
532396c5ddc4Srjs
532496c5ddc4Srjs/* MultiDrawArraysIndirect: marshalled asynchronously */
532596c5ddc4Srjsstruct marshal_cmd_MultiDrawArraysIndirect
532696c5ddc4Srjs{
532796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
532896c5ddc4Srjs   GLenum mode;
532996c5ddc4Srjs   GLsizei primcount;
533096c5ddc4Srjs   GLsizei stride;
533196c5ddc4Srjs   const GLvoid * indirect;
533296c5ddc4Srjs};
533396c5ddc4Srjsuint32_t
533496c5ddc4Srjs_mesa_unmarshal_MultiDrawArraysIndirect(struct gl_context *ctx, const struct marshal_cmd_MultiDrawArraysIndirect *cmd, const uint64_t *last)
533596c5ddc4Srjs{
533696c5ddc4Srjs   GLenum mode = cmd->mode;
533796c5ddc4Srjs   const GLvoid * indirect = cmd->indirect;
533896c5ddc4Srjs   GLsizei primcount = cmd->primcount;
533996c5ddc4Srjs   GLsizei stride = cmd->stride;
534096c5ddc4Srjs   CALL_MultiDrawArraysIndirect(ctx->CurrentServerDispatch, (mode, indirect, primcount, stride));
534196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiDrawArraysIndirect), 8) / 8);
534296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
534396c5ddc4Srjs   return cmd_size;
534496c5ddc4Srjs}
534596c5ddc4Srjsvoid GLAPIENTRY
534696c5ddc4Srjs_mesa_marshal_MultiDrawArraysIndirect(GLenum mode, const GLvoid * indirect, GLsizei primcount, GLsizei stride)
534796c5ddc4Srjs{
534896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
534996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiDrawArraysIndirect);
535096c5ddc4Srjs   struct marshal_cmd_MultiDrawArraysIndirect *cmd;
535196c5ddc4Srjs   if (_mesa_glthread_has_non_vbo_vertices_or_indirect(ctx)) {
535296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "MultiDrawArraysIndirect");
535396c5ddc4Srjs      CALL_MultiDrawArraysIndirect(ctx->CurrentServerDispatch, (mode, indirect, primcount, stride));
535496c5ddc4Srjs      return;
535596c5ddc4Srjs   }
535696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiDrawArraysIndirect, cmd_size);
535796c5ddc4Srjs   cmd->mode = mode;
535896c5ddc4Srjs   cmd->indirect = indirect;
535996c5ddc4Srjs   cmd->primcount = primcount;
536096c5ddc4Srjs   cmd->stride = stride;
536196c5ddc4Srjs}
536296c5ddc4Srjs
536396c5ddc4Srjs
536496c5ddc4Srjs/* MultiDrawElementsIndirect: marshalled asynchronously */
536596c5ddc4Srjsstruct marshal_cmd_MultiDrawElementsIndirect
536696c5ddc4Srjs{
536796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
536896c5ddc4Srjs   GLenum mode;
536996c5ddc4Srjs   GLenum type;
537096c5ddc4Srjs   GLsizei primcount;
537196c5ddc4Srjs   GLsizei stride;
537296c5ddc4Srjs   const GLvoid * indirect;
537396c5ddc4Srjs};
537496c5ddc4Srjsuint32_t
537596c5ddc4Srjs_mesa_unmarshal_MultiDrawElementsIndirect(struct gl_context *ctx, const struct marshal_cmd_MultiDrawElementsIndirect *cmd, const uint64_t *last)
537696c5ddc4Srjs{
537796c5ddc4Srjs   GLenum mode = cmd->mode;
537896c5ddc4Srjs   GLenum type = cmd->type;
537996c5ddc4Srjs   const GLvoid * indirect = cmd->indirect;
538096c5ddc4Srjs   GLsizei primcount = cmd->primcount;
538196c5ddc4Srjs   GLsizei stride = cmd->stride;
538296c5ddc4Srjs   CALL_MultiDrawElementsIndirect(ctx->CurrentServerDispatch, (mode, type, indirect, primcount, stride));
538396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiDrawElementsIndirect), 8) / 8);
538496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
538596c5ddc4Srjs   return cmd_size;
538696c5ddc4Srjs}
538796c5ddc4Srjsvoid GLAPIENTRY
538896c5ddc4Srjs_mesa_marshal_MultiDrawElementsIndirect(GLenum mode, GLenum type, const GLvoid * indirect, GLsizei primcount, GLsizei stride)
538996c5ddc4Srjs{
539096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
539196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiDrawElementsIndirect);
539296c5ddc4Srjs   struct marshal_cmd_MultiDrawElementsIndirect *cmd;
539396c5ddc4Srjs   if (_mesa_glthread_has_non_vbo_vertices_or_indices_or_indirect(ctx)) {
539496c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "MultiDrawElementsIndirect");
539596c5ddc4Srjs      CALL_MultiDrawElementsIndirect(ctx->CurrentServerDispatch, (mode, type, indirect, primcount, stride));
539696c5ddc4Srjs      return;
539796c5ddc4Srjs   }
539896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiDrawElementsIndirect, cmd_size);
539996c5ddc4Srjs   cmd->mode = mode;
540096c5ddc4Srjs   cmd->type = type;
540196c5ddc4Srjs   cmd->indirect = indirect;
540296c5ddc4Srjs   cmd->primcount = primcount;
540396c5ddc4Srjs   cmd->stride = stride;
540496c5ddc4Srjs}
540596c5ddc4Srjs
540696c5ddc4Srjs
540796c5ddc4Srjs/* Uniform1d: marshalled asynchronously */
540896c5ddc4Srjsstruct marshal_cmd_Uniform1d
540996c5ddc4Srjs{
541096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
541196c5ddc4Srjs   GLint location;
541296c5ddc4Srjs   GLdouble x;
541396c5ddc4Srjs};
541496c5ddc4Srjsuint32_t
541596c5ddc4Srjs_mesa_unmarshal_Uniform1d(struct gl_context *ctx, const struct marshal_cmd_Uniform1d *cmd, const uint64_t *last)
541696c5ddc4Srjs{
541796c5ddc4Srjs   GLint location = cmd->location;
541896c5ddc4Srjs   GLdouble x = cmd->x;
541996c5ddc4Srjs   CALL_Uniform1d(ctx->CurrentServerDispatch, (location, x));
542096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform1d), 8) / 8);
542196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
542296c5ddc4Srjs   return cmd_size;
542396c5ddc4Srjs}
542496c5ddc4Srjsvoid GLAPIENTRY
542596c5ddc4Srjs_mesa_marshal_Uniform1d(GLint location, GLdouble x)
542696c5ddc4Srjs{
542796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
542896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform1d);
542996c5ddc4Srjs   struct marshal_cmd_Uniform1d *cmd;
543096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1d, cmd_size);
543196c5ddc4Srjs   cmd->location = location;
543296c5ddc4Srjs   cmd->x = x;
543396c5ddc4Srjs}
543496c5ddc4Srjs
543596c5ddc4Srjs
543696c5ddc4Srjs/* Uniform2d: marshalled asynchronously */
543796c5ddc4Srjsstruct marshal_cmd_Uniform2d
543896c5ddc4Srjs{
543996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
544096c5ddc4Srjs   GLint location;
544196c5ddc4Srjs   GLdouble x;
544296c5ddc4Srjs   GLdouble y;
544396c5ddc4Srjs};
544496c5ddc4Srjsuint32_t
544596c5ddc4Srjs_mesa_unmarshal_Uniform2d(struct gl_context *ctx, const struct marshal_cmd_Uniform2d *cmd, const uint64_t *last)
544696c5ddc4Srjs{
544796c5ddc4Srjs   GLint location = cmd->location;
544896c5ddc4Srjs   GLdouble x = cmd->x;
544996c5ddc4Srjs   GLdouble y = cmd->y;
545096c5ddc4Srjs   CALL_Uniform2d(ctx->CurrentServerDispatch, (location, x, y));
545196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform2d), 8) / 8);
545296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
545396c5ddc4Srjs   return cmd_size;
545496c5ddc4Srjs}
545596c5ddc4Srjsvoid GLAPIENTRY
545696c5ddc4Srjs_mesa_marshal_Uniform2d(GLint location, GLdouble x, GLdouble y)
545796c5ddc4Srjs{
545896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
545996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform2d);
546096c5ddc4Srjs   struct marshal_cmd_Uniform2d *cmd;
546196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2d, cmd_size);
546296c5ddc4Srjs   cmd->location = location;
546396c5ddc4Srjs   cmd->x = x;
546496c5ddc4Srjs   cmd->y = y;
546596c5ddc4Srjs}
546696c5ddc4Srjs
546796c5ddc4Srjs
546896c5ddc4Srjs/* Uniform3d: marshalled asynchronously */
546996c5ddc4Srjsstruct marshal_cmd_Uniform3d
547096c5ddc4Srjs{
547196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
547296c5ddc4Srjs   GLint location;
547396c5ddc4Srjs   GLdouble x;
547496c5ddc4Srjs   GLdouble y;
547596c5ddc4Srjs   GLdouble z;
547696c5ddc4Srjs};
547796c5ddc4Srjsuint32_t
547896c5ddc4Srjs_mesa_unmarshal_Uniform3d(struct gl_context *ctx, const struct marshal_cmd_Uniform3d *cmd, const uint64_t *last)
547996c5ddc4Srjs{
548096c5ddc4Srjs   GLint location = cmd->location;
548196c5ddc4Srjs   GLdouble x = cmd->x;
548296c5ddc4Srjs   GLdouble y = cmd->y;
548396c5ddc4Srjs   GLdouble z = cmd->z;
548496c5ddc4Srjs   CALL_Uniform3d(ctx->CurrentServerDispatch, (location, x, y, z));
548596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform3d), 8) / 8);
548696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
548796c5ddc4Srjs   return cmd_size;
548896c5ddc4Srjs}
548996c5ddc4Srjsvoid GLAPIENTRY
549096c5ddc4Srjs_mesa_marshal_Uniform3d(GLint location, GLdouble x, GLdouble y, GLdouble z)
549196c5ddc4Srjs{
549296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
549396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform3d);
549496c5ddc4Srjs   struct marshal_cmd_Uniform3d *cmd;
549596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3d, cmd_size);
549696c5ddc4Srjs   cmd->location = location;
549796c5ddc4Srjs   cmd->x = x;
549896c5ddc4Srjs   cmd->y = y;
549996c5ddc4Srjs   cmd->z = z;
550096c5ddc4Srjs}
550196c5ddc4Srjs
550296c5ddc4Srjs
550396c5ddc4Srjs/* Uniform4d: marshalled asynchronously */
550496c5ddc4Srjsstruct marshal_cmd_Uniform4d
550596c5ddc4Srjs{
550696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
550796c5ddc4Srjs   GLint location;
550896c5ddc4Srjs   GLdouble x;
550996c5ddc4Srjs   GLdouble y;
551096c5ddc4Srjs   GLdouble z;
551196c5ddc4Srjs   GLdouble w;
551296c5ddc4Srjs};
551396c5ddc4Srjsuint32_t
551496c5ddc4Srjs_mesa_unmarshal_Uniform4d(struct gl_context *ctx, const struct marshal_cmd_Uniform4d *cmd, const uint64_t *last)
551596c5ddc4Srjs{
551696c5ddc4Srjs   GLint location = cmd->location;
551796c5ddc4Srjs   GLdouble x = cmd->x;
551896c5ddc4Srjs   GLdouble y = cmd->y;
551996c5ddc4Srjs   GLdouble z = cmd->z;
552096c5ddc4Srjs   GLdouble w = cmd->w;
552196c5ddc4Srjs   CALL_Uniform4d(ctx->CurrentServerDispatch, (location, x, y, z, w));
552296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform4d), 8) / 8);
552396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
552496c5ddc4Srjs   return cmd_size;
552596c5ddc4Srjs}
552696c5ddc4Srjsvoid GLAPIENTRY
552796c5ddc4Srjs_mesa_marshal_Uniform4d(GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
552896c5ddc4Srjs{
552996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
553096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform4d);
553196c5ddc4Srjs   struct marshal_cmd_Uniform4d *cmd;
553296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4d, cmd_size);
553396c5ddc4Srjs   cmd->location = location;
553496c5ddc4Srjs   cmd->x = x;
553596c5ddc4Srjs   cmd->y = y;
553696c5ddc4Srjs   cmd->z = z;
553796c5ddc4Srjs   cmd->w = w;
553896c5ddc4Srjs}
553996c5ddc4Srjs
554096c5ddc4Srjs
554196c5ddc4Srjs/* Uniform1dv: marshalled asynchronously */
554296c5ddc4Srjsstruct marshal_cmd_Uniform1dv
554396c5ddc4Srjs{
554496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
554596c5ddc4Srjs   GLint location;
554696c5ddc4Srjs   GLsizei count;
554796c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLdouble)) bytes are GLdouble value[count] */
554896c5ddc4Srjs};
554996c5ddc4Srjsuint32_t
555096c5ddc4Srjs_mesa_unmarshal_Uniform1dv(struct gl_context *ctx, const struct marshal_cmd_Uniform1dv *cmd, const uint64_t *last)
555196c5ddc4Srjs{
555296c5ddc4Srjs   GLint location = cmd->location;
555396c5ddc4Srjs   GLsizei count = cmd->count;
555496c5ddc4Srjs   GLdouble * value;
555596c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
555696c5ddc4Srjs   value = (GLdouble *) variable_data;
555796c5ddc4Srjs   CALL_Uniform1dv(ctx->CurrentServerDispatch, (location, count, value));
555896c5ddc4Srjs   return cmd->cmd_base.cmd_size;
555996c5ddc4Srjs}
556096c5ddc4Srjsvoid GLAPIENTRY
556196c5ddc4Srjs_mesa_marshal_Uniform1dv(GLint location, GLsizei count, const GLdouble * value)
556296c5ddc4Srjs{
556396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
556496c5ddc4Srjs   int value_size = safe_mul(count, 1 * sizeof(GLdouble));
556596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform1dv) + value_size;
556696c5ddc4Srjs   struct marshal_cmd_Uniform1dv *cmd;
556796c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
556896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "Uniform1dv");
556996c5ddc4Srjs      CALL_Uniform1dv(ctx->CurrentServerDispatch, (location, count, value));
557096c5ddc4Srjs      return;
557196c5ddc4Srjs   }
557296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1dv, cmd_size);
557396c5ddc4Srjs   cmd->location = location;
557496c5ddc4Srjs   cmd->count = count;
557596c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
557696c5ddc4Srjs   memcpy(variable_data, value, value_size);
557796c5ddc4Srjs}
557896c5ddc4Srjs
557996c5ddc4Srjs
558096c5ddc4Srjs/* Uniform2dv: marshalled asynchronously */
558196c5ddc4Srjsstruct marshal_cmd_Uniform2dv
558296c5ddc4Srjs{
558396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
558496c5ddc4Srjs   GLint location;
558596c5ddc4Srjs   GLsizei count;
558696c5ddc4Srjs   /* Next safe_mul(count, 2 * sizeof(GLdouble)) bytes are GLdouble value[count][2] */
558796c5ddc4Srjs};
558896c5ddc4Srjsuint32_t
558996c5ddc4Srjs_mesa_unmarshal_Uniform2dv(struct gl_context *ctx, const struct marshal_cmd_Uniform2dv *cmd, const uint64_t *last)
559096c5ddc4Srjs{
559196c5ddc4Srjs   GLint location = cmd->location;
559296c5ddc4Srjs   GLsizei count = cmd->count;
559396c5ddc4Srjs   GLdouble * value;
559496c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
559596c5ddc4Srjs   value = (GLdouble *) variable_data;
559696c5ddc4Srjs   CALL_Uniform2dv(ctx->CurrentServerDispatch, (location, count, value));
559796c5ddc4Srjs   return cmd->cmd_base.cmd_size;
559896c5ddc4Srjs}
559996c5ddc4Srjsvoid GLAPIENTRY
560096c5ddc4Srjs_mesa_marshal_Uniform2dv(GLint location, GLsizei count, const GLdouble * value)
560196c5ddc4Srjs{
560296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
560396c5ddc4Srjs   int value_size = safe_mul(count, 2 * sizeof(GLdouble));
560496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform2dv) + value_size;
560596c5ddc4Srjs   struct marshal_cmd_Uniform2dv *cmd;
560696c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
560796c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "Uniform2dv");
560896c5ddc4Srjs      CALL_Uniform2dv(ctx->CurrentServerDispatch, (location, count, value));
560996c5ddc4Srjs      return;
561096c5ddc4Srjs   }
561196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2dv, cmd_size);
561296c5ddc4Srjs   cmd->location = location;
561396c5ddc4Srjs   cmd->count = count;
561496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
561596c5ddc4Srjs   memcpy(variable_data, value, value_size);
561696c5ddc4Srjs}
561796c5ddc4Srjs
561896c5ddc4Srjs
561996c5ddc4Srjs/* Uniform3dv: marshalled asynchronously */
562096c5ddc4Srjsstruct marshal_cmd_Uniform3dv
562196c5ddc4Srjs{
562296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
562396c5ddc4Srjs   GLint location;
562496c5ddc4Srjs   GLsizei count;
562596c5ddc4Srjs   /* Next safe_mul(count, 3 * sizeof(GLdouble)) bytes are GLdouble value[count][3] */
562696c5ddc4Srjs};
562796c5ddc4Srjsuint32_t
562896c5ddc4Srjs_mesa_unmarshal_Uniform3dv(struct gl_context *ctx, const struct marshal_cmd_Uniform3dv *cmd, const uint64_t *last)
562996c5ddc4Srjs{
563096c5ddc4Srjs   GLint location = cmd->location;
563196c5ddc4Srjs   GLsizei count = cmd->count;
563296c5ddc4Srjs   GLdouble * value;
563396c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
563496c5ddc4Srjs   value = (GLdouble *) variable_data;
563596c5ddc4Srjs   CALL_Uniform3dv(ctx->CurrentServerDispatch, (location, count, value));
563696c5ddc4Srjs   return cmd->cmd_base.cmd_size;
563796c5ddc4Srjs}
563896c5ddc4Srjsvoid GLAPIENTRY
563996c5ddc4Srjs_mesa_marshal_Uniform3dv(GLint location, GLsizei count, const GLdouble * value)
564096c5ddc4Srjs{
564196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
564296c5ddc4Srjs   int value_size = safe_mul(count, 3 * sizeof(GLdouble));
564396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform3dv) + value_size;
564496c5ddc4Srjs   struct marshal_cmd_Uniform3dv *cmd;
564596c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
564696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "Uniform3dv");
564796c5ddc4Srjs      CALL_Uniform3dv(ctx->CurrentServerDispatch, (location, count, value));
564896c5ddc4Srjs      return;
564996c5ddc4Srjs   }
565096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3dv, cmd_size);
565196c5ddc4Srjs   cmd->location = location;
565296c5ddc4Srjs   cmd->count = count;
565396c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
565496c5ddc4Srjs   memcpy(variable_data, value, value_size);
565596c5ddc4Srjs}
565696c5ddc4Srjs
565796c5ddc4Srjs
565896c5ddc4Srjs/* Uniform4dv: marshalled asynchronously */
565996c5ddc4Srjsstruct marshal_cmd_Uniform4dv
566096c5ddc4Srjs{
566196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
566296c5ddc4Srjs   GLint location;
566396c5ddc4Srjs   GLsizei count;
566496c5ddc4Srjs   /* Next safe_mul(count, 4 * sizeof(GLdouble)) bytes are GLdouble value[count][4] */
566596c5ddc4Srjs};
566696c5ddc4Srjsuint32_t
566796c5ddc4Srjs_mesa_unmarshal_Uniform4dv(struct gl_context *ctx, const struct marshal_cmd_Uniform4dv *cmd, const uint64_t *last)
566896c5ddc4Srjs{
566996c5ddc4Srjs   GLint location = cmd->location;
567096c5ddc4Srjs   GLsizei count = cmd->count;
567196c5ddc4Srjs   GLdouble * value;
567296c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
567396c5ddc4Srjs   value = (GLdouble *) variable_data;
567496c5ddc4Srjs   CALL_Uniform4dv(ctx->CurrentServerDispatch, (location, count, value));
567596c5ddc4Srjs   return cmd->cmd_base.cmd_size;
567696c5ddc4Srjs}
567796c5ddc4Srjsvoid GLAPIENTRY
567896c5ddc4Srjs_mesa_marshal_Uniform4dv(GLint location, GLsizei count, const GLdouble * value)
567996c5ddc4Srjs{
568096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
568196c5ddc4Srjs   int value_size = safe_mul(count, 4 * sizeof(GLdouble));
568296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform4dv) + value_size;
568396c5ddc4Srjs   struct marshal_cmd_Uniform4dv *cmd;
568496c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
568596c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "Uniform4dv");
568696c5ddc4Srjs      CALL_Uniform4dv(ctx->CurrentServerDispatch, (location, count, value));
568796c5ddc4Srjs      return;
568896c5ddc4Srjs   }
568996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4dv, cmd_size);
569096c5ddc4Srjs   cmd->location = location;
569196c5ddc4Srjs   cmd->count = count;
569296c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
569396c5ddc4Srjs   memcpy(variable_data, value, value_size);
569496c5ddc4Srjs}
569596c5ddc4Srjs
569696c5ddc4Srjs
569796c5ddc4Srjs/* UniformMatrix2dv: marshalled asynchronously */
569896c5ddc4Srjsstruct marshal_cmd_UniformMatrix2dv
569996c5ddc4Srjs{
570096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
570196c5ddc4Srjs   GLboolean transpose;
570296c5ddc4Srjs   GLint location;
570396c5ddc4Srjs   GLsizei count;
570496c5ddc4Srjs   /* Next safe_mul(count, 4 * sizeof(GLdouble)) bytes are GLdouble value[count][4] */
570596c5ddc4Srjs};
570696c5ddc4Srjsuint32_t
570796c5ddc4Srjs_mesa_unmarshal_UniformMatrix2dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2dv *cmd, const uint64_t *last)
570896c5ddc4Srjs{
570996c5ddc4Srjs   GLint location = cmd->location;
571096c5ddc4Srjs   GLsizei count = cmd->count;
571196c5ddc4Srjs   GLboolean transpose = cmd->transpose;
571296c5ddc4Srjs   GLdouble * value;
571396c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
571496c5ddc4Srjs   value = (GLdouble *) variable_data;
571596c5ddc4Srjs   CALL_UniformMatrix2dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
571696c5ddc4Srjs   return cmd->cmd_base.cmd_size;
571796c5ddc4Srjs}
571896c5ddc4Srjsvoid GLAPIENTRY
571996c5ddc4Srjs_mesa_marshal_UniformMatrix2dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
572096c5ddc4Srjs{
572196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
572296c5ddc4Srjs   int value_size = safe_mul(count, 4 * sizeof(GLdouble));
572396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix2dv) + value_size;
572496c5ddc4Srjs   struct marshal_cmd_UniformMatrix2dv *cmd;
572596c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
572696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix2dv");
572796c5ddc4Srjs      CALL_UniformMatrix2dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
572896c5ddc4Srjs      return;
572996c5ddc4Srjs   }
573096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2dv, cmd_size);
573196c5ddc4Srjs   cmd->location = location;
573296c5ddc4Srjs   cmd->count = count;
573396c5ddc4Srjs   cmd->transpose = transpose;
573496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
573596c5ddc4Srjs   memcpy(variable_data, value, value_size);
573696c5ddc4Srjs}
573796c5ddc4Srjs
573896c5ddc4Srjs
573996c5ddc4Srjs/* UniformMatrix3dv: marshalled asynchronously */
574096c5ddc4Srjsstruct marshal_cmd_UniformMatrix3dv
574196c5ddc4Srjs{
574296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
574396c5ddc4Srjs   GLboolean transpose;
574496c5ddc4Srjs   GLint location;
574596c5ddc4Srjs   GLsizei count;
574696c5ddc4Srjs   /* Next safe_mul(count, 9 * sizeof(GLdouble)) bytes are GLdouble value[count][9] */
574796c5ddc4Srjs};
574896c5ddc4Srjsuint32_t
574996c5ddc4Srjs_mesa_unmarshal_UniformMatrix3dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3dv *cmd, const uint64_t *last)
575096c5ddc4Srjs{
575196c5ddc4Srjs   GLint location = cmd->location;
575296c5ddc4Srjs   GLsizei count = cmd->count;
575396c5ddc4Srjs   GLboolean transpose = cmd->transpose;
575496c5ddc4Srjs   GLdouble * value;
575596c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
575696c5ddc4Srjs   value = (GLdouble *) variable_data;
575796c5ddc4Srjs   CALL_UniformMatrix3dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
575896c5ddc4Srjs   return cmd->cmd_base.cmd_size;
575996c5ddc4Srjs}
576096c5ddc4Srjsvoid GLAPIENTRY
576196c5ddc4Srjs_mesa_marshal_UniformMatrix3dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
576296c5ddc4Srjs{
576396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
576496c5ddc4Srjs   int value_size = safe_mul(count, 9 * sizeof(GLdouble));
576596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix3dv) + value_size;
576696c5ddc4Srjs   struct marshal_cmd_UniformMatrix3dv *cmd;
576796c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
576896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix3dv");
576996c5ddc4Srjs      CALL_UniformMatrix3dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
577096c5ddc4Srjs      return;
577196c5ddc4Srjs   }
577296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3dv, cmd_size);
577396c5ddc4Srjs   cmd->location = location;
577496c5ddc4Srjs   cmd->count = count;
577596c5ddc4Srjs   cmd->transpose = transpose;
577696c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
577796c5ddc4Srjs   memcpy(variable_data, value, value_size);
577896c5ddc4Srjs}
577996c5ddc4Srjs
578096c5ddc4Srjs
578196c5ddc4Srjs/* UniformMatrix4dv: marshalled asynchronously */
578296c5ddc4Srjsstruct marshal_cmd_UniformMatrix4dv
578396c5ddc4Srjs{
578496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
578596c5ddc4Srjs   GLboolean transpose;
578696c5ddc4Srjs   GLint location;
578796c5ddc4Srjs   GLsizei count;
578896c5ddc4Srjs   /* Next safe_mul(count, 16 * sizeof(GLdouble)) bytes are GLdouble value[count][16] */
578996c5ddc4Srjs};
579096c5ddc4Srjsuint32_t
579196c5ddc4Srjs_mesa_unmarshal_UniformMatrix4dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4dv *cmd, const uint64_t *last)
579296c5ddc4Srjs{
579396c5ddc4Srjs   GLint location = cmd->location;
579496c5ddc4Srjs   GLsizei count = cmd->count;
579596c5ddc4Srjs   GLboolean transpose = cmd->transpose;
579696c5ddc4Srjs   GLdouble * value;
579796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
579896c5ddc4Srjs   value = (GLdouble *) variable_data;
579996c5ddc4Srjs   CALL_UniformMatrix4dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
580096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
580196c5ddc4Srjs}
580296c5ddc4Srjsvoid GLAPIENTRY
580396c5ddc4Srjs_mesa_marshal_UniformMatrix4dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
580496c5ddc4Srjs{
580596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
580696c5ddc4Srjs   int value_size = safe_mul(count, 16 * sizeof(GLdouble));
580796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix4dv) + value_size;
580896c5ddc4Srjs   struct marshal_cmd_UniformMatrix4dv *cmd;
580996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
581096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix4dv");
581196c5ddc4Srjs      CALL_UniformMatrix4dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
581296c5ddc4Srjs      return;
581396c5ddc4Srjs   }
581496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4dv, cmd_size);
581596c5ddc4Srjs   cmd->location = location;
581696c5ddc4Srjs   cmd->count = count;
581796c5ddc4Srjs   cmd->transpose = transpose;
581896c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
581996c5ddc4Srjs   memcpy(variable_data, value, value_size);
582096c5ddc4Srjs}
582196c5ddc4Srjs
582296c5ddc4Srjs
582396c5ddc4Srjs/* UniformMatrix2x3dv: marshalled asynchronously */
582496c5ddc4Srjsstruct marshal_cmd_UniformMatrix2x3dv
582596c5ddc4Srjs{
582696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
582796c5ddc4Srjs   GLboolean transpose;
582896c5ddc4Srjs   GLint location;
582996c5ddc4Srjs   GLsizei count;
583096c5ddc4Srjs   /* Next safe_mul(count, 6 * sizeof(GLdouble)) bytes are GLdouble value[count][6] */
583196c5ddc4Srjs};
583296c5ddc4Srjsuint32_t
583396c5ddc4Srjs_mesa_unmarshal_UniformMatrix2x3dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2x3dv *cmd, const uint64_t *last)
583496c5ddc4Srjs{
583596c5ddc4Srjs   GLint location = cmd->location;
583696c5ddc4Srjs   GLsizei count = cmd->count;
583796c5ddc4Srjs   GLboolean transpose = cmd->transpose;
583896c5ddc4Srjs   GLdouble * value;
583996c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
584096c5ddc4Srjs   value = (GLdouble *) variable_data;
584196c5ddc4Srjs   CALL_UniformMatrix2x3dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
584296c5ddc4Srjs   return cmd->cmd_base.cmd_size;
584396c5ddc4Srjs}
584496c5ddc4Srjsvoid GLAPIENTRY
584596c5ddc4Srjs_mesa_marshal_UniformMatrix2x3dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
584696c5ddc4Srjs{
584796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
584896c5ddc4Srjs   int value_size = safe_mul(count, 6 * sizeof(GLdouble));
584996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix2x3dv) + value_size;
585096c5ddc4Srjs   struct marshal_cmd_UniformMatrix2x3dv *cmd;
585196c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
585296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix2x3dv");
585396c5ddc4Srjs      CALL_UniformMatrix2x3dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
585496c5ddc4Srjs      return;
585596c5ddc4Srjs   }
585696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2x3dv, cmd_size);
585796c5ddc4Srjs   cmd->location = location;
585896c5ddc4Srjs   cmd->count = count;
585996c5ddc4Srjs   cmd->transpose = transpose;
586096c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
586196c5ddc4Srjs   memcpy(variable_data, value, value_size);
586296c5ddc4Srjs}
586396c5ddc4Srjs
586496c5ddc4Srjs
586596c5ddc4Srjs/* UniformMatrix2x4dv: marshalled asynchronously */
586696c5ddc4Srjsstruct marshal_cmd_UniformMatrix2x4dv
586796c5ddc4Srjs{
586896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
586996c5ddc4Srjs   GLboolean transpose;
587096c5ddc4Srjs   GLint location;
587196c5ddc4Srjs   GLsizei count;
587296c5ddc4Srjs   /* Next safe_mul(count, 8 * sizeof(GLdouble)) bytes are GLdouble value[count][8] */
587396c5ddc4Srjs};
587496c5ddc4Srjsuint32_t
587596c5ddc4Srjs_mesa_unmarshal_UniformMatrix2x4dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2x4dv *cmd, const uint64_t *last)
587696c5ddc4Srjs{
587796c5ddc4Srjs   GLint location = cmd->location;
587896c5ddc4Srjs   GLsizei count = cmd->count;
587996c5ddc4Srjs   GLboolean transpose = cmd->transpose;
588096c5ddc4Srjs   GLdouble * value;
588196c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
588296c5ddc4Srjs   value = (GLdouble *) variable_data;
588396c5ddc4Srjs   CALL_UniformMatrix2x4dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
588496c5ddc4Srjs   return cmd->cmd_base.cmd_size;
588596c5ddc4Srjs}
588696c5ddc4Srjsvoid GLAPIENTRY
588796c5ddc4Srjs_mesa_marshal_UniformMatrix2x4dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
588896c5ddc4Srjs{
588996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
589096c5ddc4Srjs   int value_size = safe_mul(count, 8 * sizeof(GLdouble));
589196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix2x4dv) + value_size;
589296c5ddc4Srjs   struct marshal_cmd_UniformMatrix2x4dv *cmd;
589396c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
589496c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix2x4dv");
589596c5ddc4Srjs      CALL_UniformMatrix2x4dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
589696c5ddc4Srjs      return;
589796c5ddc4Srjs   }
589896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2x4dv, cmd_size);
589996c5ddc4Srjs   cmd->location = location;
590096c5ddc4Srjs   cmd->count = count;
590196c5ddc4Srjs   cmd->transpose = transpose;
590296c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
590396c5ddc4Srjs   memcpy(variable_data, value, value_size);
590496c5ddc4Srjs}
590596c5ddc4Srjs
590696c5ddc4Srjs
590796c5ddc4Srjs/* UniformMatrix3x2dv: marshalled asynchronously */
590896c5ddc4Srjsstruct marshal_cmd_UniformMatrix3x2dv
590996c5ddc4Srjs{
591096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
591196c5ddc4Srjs   GLboolean transpose;
591296c5ddc4Srjs   GLint location;
591396c5ddc4Srjs   GLsizei count;
591496c5ddc4Srjs   /* Next safe_mul(count, 6 * sizeof(GLdouble)) bytes are GLdouble value[count][6] */
591596c5ddc4Srjs};
591696c5ddc4Srjsuint32_t
591796c5ddc4Srjs_mesa_unmarshal_UniformMatrix3x2dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3x2dv *cmd, const uint64_t *last)
591896c5ddc4Srjs{
591996c5ddc4Srjs   GLint location = cmd->location;
592096c5ddc4Srjs   GLsizei count = cmd->count;
592196c5ddc4Srjs   GLboolean transpose = cmd->transpose;
592296c5ddc4Srjs   GLdouble * value;
592396c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
592496c5ddc4Srjs   value = (GLdouble *) variable_data;
592596c5ddc4Srjs   CALL_UniformMatrix3x2dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
592696c5ddc4Srjs   return cmd->cmd_base.cmd_size;
592796c5ddc4Srjs}
592896c5ddc4Srjsvoid GLAPIENTRY
592996c5ddc4Srjs_mesa_marshal_UniformMatrix3x2dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
593096c5ddc4Srjs{
593196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
593296c5ddc4Srjs   int value_size = safe_mul(count, 6 * sizeof(GLdouble));
593396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix3x2dv) + value_size;
593496c5ddc4Srjs   struct marshal_cmd_UniformMatrix3x2dv *cmd;
593596c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
593696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix3x2dv");
593796c5ddc4Srjs      CALL_UniformMatrix3x2dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
593896c5ddc4Srjs      return;
593996c5ddc4Srjs   }
594096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3x2dv, cmd_size);
594196c5ddc4Srjs   cmd->location = location;
594296c5ddc4Srjs   cmd->count = count;
594396c5ddc4Srjs   cmd->transpose = transpose;
594496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
594596c5ddc4Srjs   memcpy(variable_data, value, value_size);
594696c5ddc4Srjs}
594796c5ddc4Srjs
594896c5ddc4Srjs
594996c5ddc4Srjs/* UniformMatrix3x4dv: marshalled asynchronously */
595096c5ddc4Srjsstruct marshal_cmd_UniformMatrix3x4dv
595196c5ddc4Srjs{
595296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
595396c5ddc4Srjs   GLboolean transpose;
595496c5ddc4Srjs   GLint location;
595596c5ddc4Srjs   GLsizei count;
595696c5ddc4Srjs   /* Next safe_mul(count, 12 * sizeof(GLdouble)) bytes are GLdouble value[count][12] */
595796c5ddc4Srjs};
595896c5ddc4Srjsuint32_t
595996c5ddc4Srjs_mesa_unmarshal_UniformMatrix3x4dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3x4dv *cmd, const uint64_t *last)
596096c5ddc4Srjs{
596196c5ddc4Srjs   GLint location = cmd->location;
596296c5ddc4Srjs   GLsizei count = cmd->count;
596396c5ddc4Srjs   GLboolean transpose = cmd->transpose;
596496c5ddc4Srjs   GLdouble * value;
596596c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
596696c5ddc4Srjs   value = (GLdouble *) variable_data;
596796c5ddc4Srjs   CALL_UniformMatrix3x4dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
596896c5ddc4Srjs   return cmd->cmd_base.cmd_size;
596996c5ddc4Srjs}
597096c5ddc4Srjsvoid GLAPIENTRY
597196c5ddc4Srjs_mesa_marshal_UniformMatrix3x4dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
597296c5ddc4Srjs{
597396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
597496c5ddc4Srjs   int value_size = safe_mul(count, 12 * sizeof(GLdouble));
597596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix3x4dv) + value_size;
597696c5ddc4Srjs   struct marshal_cmd_UniformMatrix3x4dv *cmd;
597796c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
597896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix3x4dv");
597996c5ddc4Srjs      CALL_UniformMatrix3x4dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
598096c5ddc4Srjs      return;
598196c5ddc4Srjs   }
598296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3x4dv, cmd_size);
598396c5ddc4Srjs   cmd->location = location;
598496c5ddc4Srjs   cmd->count = count;
598596c5ddc4Srjs   cmd->transpose = transpose;
598696c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
598796c5ddc4Srjs   memcpy(variable_data, value, value_size);
598896c5ddc4Srjs}
598996c5ddc4Srjs
599096c5ddc4Srjs
599196c5ddc4Srjs/* UniformMatrix4x2dv: marshalled asynchronously */
599296c5ddc4Srjsstruct marshal_cmd_UniformMatrix4x2dv
599396c5ddc4Srjs{
599496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
599596c5ddc4Srjs   GLboolean transpose;
599696c5ddc4Srjs   GLint location;
599796c5ddc4Srjs   GLsizei count;
599896c5ddc4Srjs   /* Next safe_mul(count, 8 * sizeof(GLdouble)) bytes are GLdouble value[count][8] */
599996c5ddc4Srjs};
600096c5ddc4Srjsuint32_t
600196c5ddc4Srjs_mesa_unmarshal_UniformMatrix4x2dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4x2dv *cmd, const uint64_t *last)
600296c5ddc4Srjs{
600396c5ddc4Srjs   GLint location = cmd->location;
600496c5ddc4Srjs   GLsizei count = cmd->count;
600596c5ddc4Srjs   GLboolean transpose = cmd->transpose;
600696c5ddc4Srjs   GLdouble * value;
600796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
600896c5ddc4Srjs   value = (GLdouble *) variable_data;
600996c5ddc4Srjs   CALL_UniformMatrix4x2dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
601096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
601196c5ddc4Srjs}
601296c5ddc4Srjsvoid GLAPIENTRY
601396c5ddc4Srjs_mesa_marshal_UniformMatrix4x2dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
601496c5ddc4Srjs{
601596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
601696c5ddc4Srjs   int value_size = safe_mul(count, 8 * sizeof(GLdouble));
601796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix4x2dv) + value_size;
601896c5ddc4Srjs   struct marshal_cmd_UniformMatrix4x2dv *cmd;
601996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
602096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix4x2dv");
602196c5ddc4Srjs      CALL_UniformMatrix4x2dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
602296c5ddc4Srjs      return;
602396c5ddc4Srjs   }
602496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4x2dv, cmd_size);
602596c5ddc4Srjs   cmd->location = location;
602696c5ddc4Srjs   cmd->count = count;
602796c5ddc4Srjs   cmd->transpose = transpose;
602896c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
602996c5ddc4Srjs   memcpy(variable_data, value, value_size);
603096c5ddc4Srjs}
603196c5ddc4Srjs
603296c5ddc4Srjs
603396c5ddc4Srjs/* UniformMatrix4x3dv: marshalled asynchronously */
603496c5ddc4Srjsstruct marshal_cmd_UniformMatrix4x3dv
603596c5ddc4Srjs{
603696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
603796c5ddc4Srjs   GLboolean transpose;
603896c5ddc4Srjs   GLint location;
603996c5ddc4Srjs   GLsizei count;
604096c5ddc4Srjs   /* Next safe_mul(count, 12 * sizeof(GLdouble)) bytes are GLdouble value[count][12] */
604196c5ddc4Srjs};
604296c5ddc4Srjsuint32_t
604396c5ddc4Srjs_mesa_unmarshal_UniformMatrix4x3dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4x3dv *cmd, const uint64_t *last)
604496c5ddc4Srjs{
604596c5ddc4Srjs   GLint location = cmd->location;
604696c5ddc4Srjs   GLsizei count = cmd->count;
604796c5ddc4Srjs   GLboolean transpose = cmd->transpose;
604896c5ddc4Srjs   GLdouble * value;
604996c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
605096c5ddc4Srjs   value = (GLdouble *) variable_data;
605196c5ddc4Srjs   CALL_UniformMatrix4x3dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
605296c5ddc4Srjs   return cmd->cmd_base.cmd_size;
605396c5ddc4Srjs}
605496c5ddc4Srjsvoid GLAPIENTRY
605596c5ddc4Srjs_mesa_marshal_UniformMatrix4x3dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
605696c5ddc4Srjs{
605796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
605896c5ddc4Srjs   int value_size = safe_mul(count, 12 * sizeof(GLdouble));
605996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix4x3dv) + value_size;
606096c5ddc4Srjs   struct marshal_cmd_UniformMatrix4x3dv *cmd;
606196c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
606296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix4x3dv");
606396c5ddc4Srjs      CALL_UniformMatrix4x3dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
606496c5ddc4Srjs      return;
606596c5ddc4Srjs   }
606696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4x3dv, cmd_size);
606796c5ddc4Srjs   cmd->location = location;
606896c5ddc4Srjs   cmd->count = count;
606996c5ddc4Srjs   cmd->transpose = transpose;
607096c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
607196c5ddc4Srjs   memcpy(variable_data, value, value_size);
607296c5ddc4Srjs}
607396c5ddc4Srjs
607496c5ddc4Srjs
607596c5ddc4Srjs/* GetUniformdv: marshalled synchronously */
607696c5ddc4Srjsvoid GLAPIENTRY
607796c5ddc4Srjs_mesa_marshal_GetUniformdv(GLuint program, GLint location, GLdouble * params)
607896c5ddc4Srjs{
607996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
608096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetUniformdv");
608196c5ddc4Srjs   CALL_GetUniformdv(ctx->CurrentServerDispatch, (program, location, params));
608296c5ddc4Srjs}
608396c5ddc4Srjs
608496c5ddc4Srjs
608596c5ddc4Srjs/* ProgramUniform1d: marshalled asynchronously */
608696c5ddc4Srjsstruct marshal_cmd_ProgramUniform1d
608796c5ddc4Srjs{
608896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
608996c5ddc4Srjs   GLuint program;
609096c5ddc4Srjs   GLint location;
609196c5ddc4Srjs   GLdouble x;
609296c5ddc4Srjs};
609396c5ddc4Srjsuint32_t
609496c5ddc4Srjs_mesa_unmarshal_ProgramUniform1d(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1d *cmd, const uint64_t *last)
609596c5ddc4Srjs{
609696c5ddc4Srjs   GLuint program = cmd->program;
609796c5ddc4Srjs   GLint location = cmd->location;
609896c5ddc4Srjs   GLdouble x = cmd->x;
609996c5ddc4Srjs   CALL_ProgramUniform1d(ctx->CurrentServerDispatch, (program, location, x));
610096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform1d), 8) / 8);
610196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
610296c5ddc4Srjs   return cmd_size;
610396c5ddc4Srjs}
610496c5ddc4Srjsvoid GLAPIENTRY
610596c5ddc4Srjs_mesa_marshal_ProgramUniform1d(GLuint program, GLint location, GLdouble x)
610696c5ddc4Srjs{
610796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
610896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform1d);
610996c5ddc4Srjs   struct marshal_cmd_ProgramUniform1d *cmd;
611096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1d, cmd_size);
611196c5ddc4Srjs   cmd->program = program;
611296c5ddc4Srjs   cmd->location = location;
611396c5ddc4Srjs   cmd->x = x;
611496c5ddc4Srjs}
611596c5ddc4Srjs
611696c5ddc4Srjs
611796c5ddc4Srjs/* ProgramUniform2d: marshalled asynchronously */
611896c5ddc4Srjsstruct marshal_cmd_ProgramUniform2d
611996c5ddc4Srjs{
612096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
612196c5ddc4Srjs   GLuint program;
612296c5ddc4Srjs   GLint location;
612396c5ddc4Srjs   GLdouble x;
612496c5ddc4Srjs   GLdouble y;
612596c5ddc4Srjs};
612696c5ddc4Srjsuint32_t
612796c5ddc4Srjs_mesa_unmarshal_ProgramUniform2d(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2d *cmd, const uint64_t *last)
612896c5ddc4Srjs{
612996c5ddc4Srjs   GLuint program = cmd->program;
613096c5ddc4Srjs   GLint location = cmd->location;
613196c5ddc4Srjs   GLdouble x = cmd->x;
613296c5ddc4Srjs   GLdouble y = cmd->y;
613396c5ddc4Srjs   CALL_ProgramUniform2d(ctx->CurrentServerDispatch, (program, location, x, y));
613496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform2d), 8) / 8);
613596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
613696c5ddc4Srjs   return cmd_size;
613796c5ddc4Srjs}
613896c5ddc4Srjsvoid GLAPIENTRY
613996c5ddc4Srjs_mesa_marshal_ProgramUniform2d(GLuint program, GLint location, GLdouble x, GLdouble y)
614096c5ddc4Srjs{
614196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
614296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform2d);
614396c5ddc4Srjs   struct marshal_cmd_ProgramUniform2d *cmd;
614496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2d, cmd_size);
614596c5ddc4Srjs   cmd->program = program;
614696c5ddc4Srjs   cmd->location = location;
614796c5ddc4Srjs   cmd->x = x;
614896c5ddc4Srjs   cmd->y = y;
614996c5ddc4Srjs}
615096c5ddc4Srjs
615196c5ddc4Srjs
615296c5ddc4Srjs/* ProgramUniform3d: marshalled asynchronously */
615396c5ddc4Srjsstruct marshal_cmd_ProgramUniform3d
615496c5ddc4Srjs{
615596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
615696c5ddc4Srjs   GLuint program;
615796c5ddc4Srjs   GLint location;
615896c5ddc4Srjs   GLdouble x;
615996c5ddc4Srjs   GLdouble y;
616096c5ddc4Srjs   GLdouble z;
616196c5ddc4Srjs};
616296c5ddc4Srjsuint32_t
616396c5ddc4Srjs_mesa_unmarshal_ProgramUniform3d(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3d *cmd, const uint64_t *last)
616496c5ddc4Srjs{
616596c5ddc4Srjs   GLuint program = cmd->program;
616696c5ddc4Srjs   GLint location = cmd->location;
616796c5ddc4Srjs   GLdouble x = cmd->x;
616896c5ddc4Srjs   GLdouble y = cmd->y;
616996c5ddc4Srjs   GLdouble z = cmd->z;
617096c5ddc4Srjs   CALL_ProgramUniform3d(ctx->CurrentServerDispatch, (program, location, x, y, z));
617196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform3d), 8) / 8);
617296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
617396c5ddc4Srjs   return cmd_size;
617496c5ddc4Srjs}
617596c5ddc4Srjsvoid GLAPIENTRY
617696c5ddc4Srjs_mesa_marshal_ProgramUniform3d(GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z)
617796c5ddc4Srjs{
617896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
617996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform3d);
618096c5ddc4Srjs   struct marshal_cmd_ProgramUniform3d *cmd;
618196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3d, cmd_size);
618296c5ddc4Srjs   cmd->program = program;
618396c5ddc4Srjs   cmd->location = location;
618496c5ddc4Srjs   cmd->x = x;
618596c5ddc4Srjs   cmd->y = y;
618696c5ddc4Srjs   cmd->z = z;
618796c5ddc4Srjs}
618896c5ddc4Srjs
618996c5ddc4Srjs
619096c5ddc4Srjs/* ProgramUniform4d: marshalled asynchronously */
619196c5ddc4Srjsstruct marshal_cmd_ProgramUniform4d
619296c5ddc4Srjs{
619396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
619496c5ddc4Srjs   GLuint program;
619596c5ddc4Srjs   GLint location;
619696c5ddc4Srjs   GLdouble x;
619796c5ddc4Srjs   GLdouble y;
619896c5ddc4Srjs   GLdouble z;
619996c5ddc4Srjs   GLdouble w;
620096c5ddc4Srjs};
620196c5ddc4Srjsuint32_t
620296c5ddc4Srjs_mesa_unmarshal_ProgramUniform4d(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4d *cmd, const uint64_t *last)
620396c5ddc4Srjs{
620496c5ddc4Srjs   GLuint program = cmd->program;
620596c5ddc4Srjs   GLint location = cmd->location;
620696c5ddc4Srjs   GLdouble x = cmd->x;
620796c5ddc4Srjs   GLdouble y = cmd->y;
620896c5ddc4Srjs   GLdouble z = cmd->z;
620996c5ddc4Srjs   GLdouble w = cmd->w;
621096c5ddc4Srjs   CALL_ProgramUniform4d(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
621196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform4d), 8) / 8);
621296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
621396c5ddc4Srjs   return cmd_size;
621496c5ddc4Srjs}
621596c5ddc4Srjsvoid GLAPIENTRY
621696c5ddc4Srjs_mesa_marshal_ProgramUniform4d(GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
621796c5ddc4Srjs{
621896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
621996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform4d);
622096c5ddc4Srjs   struct marshal_cmd_ProgramUniform4d *cmd;
622196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4d, cmd_size);
622296c5ddc4Srjs   cmd->program = program;
622396c5ddc4Srjs   cmd->location = location;
622496c5ddc4Srjs   cmd->x = x;
622596c5ddc4Srjs   cmd->y = y;
622696c5ddc4Srjs   cmd->z = z;
622796c5ddc4Srjs   cmd->w = w;
622896c5ddc4Srjs}
622996c5ddc4Srjs
623096c5ddc4Srjs
623196c5ddc4Srjs/* ProgramUniform1dv: marshalled asynchronously */
623296c5ddc4Srjsstruct marshal_cmd_ProgramUniform1dv
623396c5ddc4Srjs{
623496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
623596c5ddc4Srjs   GLuint program;
623696c5ddc4Srjs   GLint location;
623796c5ddc4Srjs   GLsizei count;
623896c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLdouble)) bytes are GLdouble value[count] */
623996c5ddc4Srjs};
624096c5ddc4Srjsuint32_t
624196c5ddc4Srjs_mesa_unmarshal_ProgramUniform1dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1dv *cmd, const uint64_t *last)
624296c5ddc4Srjs{
624396c5ddc4Srjs   GLuint program = cmd->program;
624496c5ddc4Srjs   GLint location = cmd->location;
624596c5ddc4Srjs   GLsizei count = cmd->count;
624696c5ddc4Srjs   GLdouble * value;
624796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
624896c5ddc4Srjs   value = (GLdouble *) variable_data;
624996c5ddc4Srjs   CALL_ProgramUniform1dv(ctx->CurrentServerDispatch, (program, location, count, value));
625096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
625196c5ddc4Srjs}
625296c5ddc4Srjsvoid GLAPIENTRY
625396c5ddc4Srjs_mesa_marshal_ProgramUniform1dv(GLuint program, GLint location, GLsizei count, const GLdouble * value)
625496c5ddc4Srjs{
625596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
625696c5ddc4Srjs   int value_size = safe_mul(count, 1 * sizeof(GLdouble));
625796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform1dv) + value_size;
625896c5ddc4Srjs   struct marshal_cmd_ProgramUniform1dv *cmd;
625996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
626096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniform1dv");
626196c5ddc4Srjs      CALL_ProgramUniform1dv(ctx->CurrentServerDispatch, (program, location, count, value));
626296c5ddc4Srjs      return;
626396c5ddc4Srjs   }
626496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1dv, cmd_size);
626596c5ddc4Srjs   cmd->program = program;
626696c5ddc4Srjs   cmd->location = location;
626796c5ddc4Srjs   cmd->count = count;
626896c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
626996c5ddc4Srjs   memcpy(variable_data, value, value_size);
627096c5ddc4Srjs}
627196c5ddc4Srjs
627296c5ddc4Srjs
627396c5ddc4Srjs/* ProgramUniform2dv: marshalled asynchronously */
627496c5ddc4Srjsstruct marshal_cmd_ProgramUniform2dv
627596c5ddc4Srjs{
627696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
627796c5ddc4Srjs   GLuint program;
627896c5ddc4Srjs   GLint location;
627996c5ddc4Srjs   GLsizei count;
628096c5ddc4Srjs   /* Next safe_mul(count, 2 * sizeof(GLdouble)) bytes are GLdouble value[count][2] */
628196c5ddc4Srjs};
628296c5ddc4Srjsuint32_t
628396c5ddc4Srjs_mesa_unmarshal_ProgramUniform2dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2dv *cmd, const uint64_t *last)
628496c5ddc4Srjs{
628596c5ddc4Srjs   GLuint program = cmd->program;
628696c5ddc4Srjs   GLint location = cmd->location;
628796c5ddc4Srjs   GLsizei count = cmd->count;
628896c5ddc4Srjs   GLdouble * value;
628996c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
629096c5ddc4Srjs   value = (GLdouble *) variable_data;
629196c5ddc4Srjs   CALL_ProgramUniform2dv(ctx->CurrentServerDispatch, (program, location, count, value));
629296c5ddc4Srjs   return cmd->cmd_base.cmd_size;
629396c5ddc4Srjs}
629496c5ddc4Srjsvoid GLAPIENTRY
629596c5ddc4Srjs_mesa_marshal_ProgramUniform2dv(GLuint program, GLint location, GLsizei count, const GLdouble * value)
629696c5ddc4Srjs{
629796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
629896c5ddc4Srjs   int value_size = safe_mul(count, 2 * sizeof(GLdouble));
629996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform2dv) + value_size;
630096c5ddc4Srjs   struct marshal_cmd_ProgramUniform2dv *cmd;
630196c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
630296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniform2dv");
630396c5ddc4Srjs      CALL_ProgramUniform2dv(ctx->CurrentServerDispatch, (program, location, count, value));
630496c5ddc4Srjs      return;
630596c5ddc4Srjs   }
630696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2dv, cmd_size);
630796c5ddc4Srjs   cmd->program = program;
630896c5ddc4Srjs   cmd->location = location;
630996c5ddc4Srjs   cmd->count = count;
631096c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
631196c5ddc4Srjs   memcpy(variable_data, value, value_size);
631296c5ddc4Srjs}
631396c5ddc4Srjs
631496c5ddc4Srjs
631596c5ddc4Srjs/* ProgramUniform3dv: marshalled asynchronously */
631696c5ddc4Srjsstruct marshal_cmd_ProgramUniform3dv
631796c5ddc4Srjs{
631896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
631996c5ddc4Srjs   GLuint program;
632096c5ddc4Srjs   GLint location;
632196c5ddc4Srjs   GLsizei count;
632296c5ddc4Srjs   /* Next safe_mul(count, 3 * sizeof(GLdouble)) bytes are GLdouble value[count][3] */
632396c5ddc4Srjs};
632496c5ddc4Srjsuint32_t
632596c5ddc4Srjs_mesa_unmarshal_ProgramUniform3dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3dv *cmd, const uint64_t *last)
632696c5ddc4Srjs{
632796c5ddc4Srjs   GLuint program = cmd->program;
632896c5ddc4Srjs   GLint location = cmd->location;
632996c5ddc4Srjs   GLsizei count = cmd->count;
633096c5ddc4Srjs   GLdouble * value;
633196c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
633296c5ddc4Srjs   value = (GLdouble *) variable_data;
633396c5ddc4Srjs   CALL_ProgramUniform3dv(ctx->CurrentServerDispatch, (program, location, count, value));
633496c5ddc4Srjs   return cmd->cmd_base.cmd_size;
633596c5ddc4Srjs}
633696c5ddc4Srjsvoid GLAPIENTRY
633796c5ddc4Srjs_mesa_marshal_ProgramUniform3dv(GLuint program, GLint location, GLsizei count, const GLdouble * value)
633896c5ddc4Srjs{
633996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
634096c5ddc4Srjs   int value_size = safe_mul(count, 3 * sizeof(GLdouble));
634196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform3dv) + value_size;
634296c5ddc4Srjs   struct marshal_cmd_ProgramUniform3dv *cmd;
634396c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
634496c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniform3dv");
634596c5ddc4Srjs      CALL_ProgramUniform3dv(ctx->CurrentServerDispatch, (program, location, count, value));
634696c5ddc4Srjs      return;
634796c5ddc4Srjs   }
634896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3dv, cmd_size);
634996c5ddc4Srjs   cmd->program = program;
635096c5ddc4Srjs   cmd->location = location;
635196c5ddc4Srjs   cmd->count = count;
635296c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
635396c5ddc4Srjs   memcpy(variable_data, value, value_size);
635496c5ddc4Srjs}
635596c5ddc4Srjs
635696c5ddc4Srjs
635796c5ddc4Srjs/* ProgramUniform4dv: marshalled asynchronously */
635896c5ddc4Srjsstruct marshal_cmd_ProgramUniform4dv
635996c5ddc4Srjs{
636096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
636196c5ddc4Srjs   GLuint program;
636296c5ddc4Srjs   GLint location;
636396c5ddc4Srjs   GLsizei count;
636496c5ddc4Srjs   /* Next safe_mul(count, 4 * sizeof(GLdouble)) bytes are GLdouble value[count][4] */
636596c5ddc4Srjs};
636696c5ddc4Srjsuint32_t
636796c5ddc4Srjs_mesa_unmarshal_ProgramUniform4dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4dv *cmd, const uint64_t *last)
636896c5ddc4Srjs{
636996c5ddc4Srjs   GLuint program = cmd->program;
637096c5ddc4Srjs   GLint location = cmd->location;
637196c5ddc4Srjs   GLsizei count = cmd->count;
637296c5ddc4Srjs   GLdouble * value;
637396c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
637496c5ddc4Srjs   value = (GLdouble *) variable_data;
637596c5ddc4Srjs   CALL_ProgramUniform4dv(ctx->CurrentServerDispatch, (program, location, count, value));
637696c5ddc4Srjs   return cmd->cmd_base.cmd_size;
637796c5ddc4Srjs}
637896c5ddc4Srjsvoid GLAPIENTRY
637996c5ddc4Srjs_mesa_marshal_ProgramUniform4dv(GLuint program, GLint location, GLsizei count, const GLdouble * value)
638096c5ddc4Srjs{
638196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
638296c5ddc4Srjs   int value_size = safe_mul(count, 4 * sizeof(GLdouble));
638396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform4dv) + value_size;
638496c5ddc4Srjs   struct marshal_cmd_ProgramUniform4dv *cmd;
638596c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
638696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniform4dv");
638796c5ddc4Srjs      CALL_ProgramUniform4dv(ctx->CurrentServerDispatch, (program, location, count, value));
638896c5ddc4Srjs      return;
638996c5ddc4Srjs   }
639096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4dv, cmd_size);
639196c5ddc4Srjs   cmd->program = program;
639296c5ddc4Srjs   cmd->location = location;
639396c5ddc4Srjs   cmd->count = count;
639496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
639596c5ddc4Srjs   memcpy(variable_data, value, value_size);
639696c5ddc4Srjs}
639796c5ddc4Srjs
639896c5ddc4Srjs
639996c5ddc4Srjs/* ProgramUniformMatrix2dv: marshalled asynchronously */
640096c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix2dv
640196c5ddc4Srjs{
640296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
640396c5ddc4Srjs   GLboolean transpose;
640496c5ddc4Srjs   GLuint program;
640596c5ddc4Srjs   GLint location;
640696c5ddc4Srjs   GLsizei count;
640796c5ddc4Srjs   /* Next safe_mul(count, 4 * sizeof(GLdouble)) bytes are GLdouble value[count][4] */
640896c5ddc4Srjs};
640996c5ddc4Srjsuint32_t
641096c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix2dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix2dv *cmd, const uint64_t *last)
641196c5ddc4Srjs{
641296c5ddc4Srjs   GLuint program = cmd->program;
641396c5ddc4Srjs   GLint location = cmd->location;
641496c5ddc4Srjs   GLsizei count = cmd->count;
641596c5ddc4Srjs   GLboolean transpose = cmd->transpose;
641696c5ddc4Srjs   GLdouble * value;
641796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
641896c5ddc4Srjs   value = (GLdouble *) variable_data;
641996c5ddc4Srjs   CALL_ProgramUniformMatrix2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
642096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
642196c5ddc4Srjs}
642296c5ddc4Srjsvoid GLAPIENTRY
642396c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix2dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
642496c5ddc4Srjs{
642596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
642696c5ddc4Srjs   int value_size = safe_mul(count, 4 * sizeof(GLdouble));
642796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix2dv) + value_size;
642896c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix2dv *cmd;
642996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
643096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix2dv");
643196c5ddc4Srjs      CALL_ProgramUniformMatrix2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
643296c5ddc4Srjs      return;
643396c5ddc4Srjs   }
643496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix2dv, cmd_size);
643596c5ddc4Srjs   cmd->program = program;
643696c5ddc4Srjs   cmd->location = location;
643796c5ddc4Srjs   cmd->count = count;
643896c5ddc4Srjs   cmd->transpose = transpose;
643996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
644096c5ddc4Srjs   memcpy(variable_data, value, value_size);
644196c5ddc4Srjs}
644296c5ddc4Srjs
644396c5ddc4Srjs
644496c5ddc4Srjs/* ProgramUniformMatrix3dv: marshalled asynchronously */
644596c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix3dv
644696c5ddc4Srjs{
644796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
644896c5ddc4Srjs   GLboolean transpose;
644996c5ddc4Srjs   GLuint program;
645096c5ddc4Srjs   GLint location;
645196c5ddc4Srjs   GLsizei count;
645296c5ddc4Srjs   /* Next safe_mul(count, 9 * sizeof(GLdouble)) bytes are GLdouble value[count][9] */
645396c5ddc4Srjs};
645496c5ddc4Srjsuint32_t
645596c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix3dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix3dv *cmd, const uint64_t *last)
645696c5ddc4Srjs{
645796c5ddc4Srjs   GLuint program = cmd->program;
645896c5ddc4Srjs   GLint location = cmd->location;
645996c5ddc4Srjs   GLsizei count = cmd->count;
646096c5ddc4Srjs   GLboolean transpose = cmd->transpose;
646196c5ddc4Srjs   GLdouble * value;
646296c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
646396c5ddc4Srjs   value = (GLdouble *) variable_data;
646496c5ddc4Srjs   CALL_ProgramUniformMatrix3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
646596c5ddc4Srjs   return cmd->cmd_base.cmd_size;
646696c5ddc4Srjs}
646796c5ddc4Srjsvoid GLAPIENTRY
646896c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix3dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
646996c5ddc4Srjs{
647096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
647196c5ddc4Srjs   int value_size = safe_mul(count, 9 * sizeof(GLdouble));
647296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix3dv) + value_size;
647396c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix3dv *cmd;
647496c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
647596c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix3dv");
647696c5ddc4Srjs      CALL_ProgramUniformMatrix3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
647796c5ddc4Srjs      return;
647896c5ddc4Srjs   }
647996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix3dv, cmd_size);
648096c5ddc4Srjs   cmd->program = program;
648196c5ddc4Srjs   cmd->location = location;
648296c5ddc4Srjs   cmd->count = count;
648396c5ddc4Srjs   cmd->transpose = transpose;
648496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
648596c5ddc4Srjs   memcpy(variable_data, value, value_size);
648696c5ddc4Srjs}
648796c5ddc4Srjs
648896c5ddc4Srjs
648996c5ddc4Srjs/* ProgramUniformMatrix4dv: marshalled asynchronously */
649096c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix4dv
649196c5ddc4Srjs{
649296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
649396c5ddc4Srjs   GLboolean transpose;
649496c5ddc4Srjs   GLuint program;
649596c5ddc4Srjs   GLint location;
649696c5ddc4Srjs   GLsizei count;
649796c5ddc4Srjs   /* Next safe_mul(count, 16 * sizeof(GLdouble)) bytes are GLdouble value[count][16] */
649896c5ddc4Srjs};
649996c5ddc4Srjsuint32_t
650096c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix4dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix4dv *cmd, const uint64_t *last)
650196c5ddc4Srjs{
650296c5ddc4Srjs   GLuint program = cmd->program;
650396c5ddc4Srjs   GLint location = cmd->location;
650496c5ddc4Srjs   GLsizei count = cmd->count;
650596c5ddc4Srjs   GLboolean transpose = cmd->transpose;
650696c5ddc4Srjs   GLdouble * value;
650796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
650896c5ddc4Srjs   value = (GLdouble *) variable_data;
650996c5ddc4Srjs   CALL_ProgramUniformMatrix4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
651096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
651196c5ddc4Srjs}
651296c5ddc4Srjsvoid GLAPIENTRY
651396c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix4dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
651496c5ddc4Srjs{
651596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
651696c5ddc4Srjs   int value_size = safe_mul(count, 16 * sizeof(GLdouble));
651796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix4dv) + value_size;
651896c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix4dv *cmd;
651996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
652096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix4dv");
652196c5ddc4Srjs      CALL_ProgramUniformMatrix4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
652296c5ddc4Srjs      return;
652396c5ddc4Srjs   }
652496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix4dv, cmd_size);
652596c5ddc4Srjs   cmd->program = program;
652696c5ddc4Srjs   cmd->location = location;
652796c5ddc4Srjs   cmd->count = count;
652896c5ddc4Srjs   cmd->transpose = transpose;
652996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
653096c5ddc4Srjs   memcpy(variable_data, value, value_size);
653196c5ddc4Srjs}
653296c5ddc4Srjs
653396c5ddc4Srjs
653496c5ddc4Srjs/* ProgramUniformMatrix2x3dv: marshalled asynchronously */
653596c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix2x3dv
653696c5ddc4Srjs{
653796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
653896c5ddc4Srjs   GLboolean transpose;
653996c5ddc4Srjs   GLuint program;
654096c5ddc4Srjs   GLint location;
654196c5ddc4Srjs   GLsizei count;
654296c5ddc4Srjs   /* Next safe_mul(count, 6 * sizeof(GLdouble)) bytes are GLdouble value[count][6] */
654396c5ddc4Srjs};
654496c5ddc4Srjsuint32_t
654596c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix2x3dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix2x3dv *cmd, const uint64_t *last)
654696c5ddc4Srjs{
654796c5ddc4Srjs   GLuint program = cmd->program;
654896c5ddc4Srjs   GLint location = cmd->location;
654996c5ddc4Srjs   GLsizei count = cmd->count;
655096c5ddc4Srjs   GLboolean transpose = cmd->transpose;
655196c5ddc4Srjs   GLdouble * value;
655296c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
655396c5ddc4Srjs   value = (GLdouble *) variable_data;
655496c5ddc4Srjs   CALL_ProgramUniformMatrix2x3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
655596c5ddc4Srjs   return cmd->cmd_base.cmd_size;
655696c5ddc4Srjs}
655796c5ddc4Srjsvoid GLAPIENTRY
655896c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix2x3dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
655996c5ddc4Srjs{
656096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
656196c5ddc4Srjs   int value_size = safe_mul(count, 6 * sizeof(GLdouble));
656296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix2x3dv) + value_size;
656396c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix2x3dv *cmd;
656496c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
656596c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix2x3dv");
656696c5ddc4Srjs      CALL_ProgramUniformMatrix2x3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
656796c5ddc4Srjs      return;
656896c5ddc4Srjs   }
656996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix2x3dv, cmd_size);
657096c5ddc4Srjs   cmd->program = program;
657196c5ddc4Srjs   cmd->location = location;
657296c5ddc4Srjs   cmd->count = count;
657396c5ddc4Srjs   cmd->transpose = transpose;
657496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
657596c5ddc4Srjs   memcpy(variable_data, value, value_size);
657696c5ddc4Srjs}
657796c5ddc4Srjs
657896c5ddc4Srjs
657996c5ddc4Srjs/* ProgramUniformMatrix2x4dv: marshalled asynchronously */
658096c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix2x4dv
658196c5ddc4Srjs{
658296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
658396c5ddc4Srjs   GLboolean transpose;
658496c5ddc4Srjs   GLuint program;
658596c5ddc4Srjs   GLint location;
658696c5ddc4Srjs   GLsizei count;
658796c5ddc4Srjs   /* Next safe_mul(count, 8 * sizeof(GLdouble)) bytes are GLdouble value[count][8] */
658896c5ddc4Srjs};
658996c5ddc4Srjsuint32_t
659096c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix2x4dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix2x4dv *cmd, const uint64_t *last)
659196c5ddc4Srjs{
659296c5ddc4Srjs   GLuint program = cmd->program;
659396c5ddc4Srjs   GLint location = cmd->location;
659496c5ddc4Srjs   GLsizei count = cmd->count;
659596c5ddc4Srjs   GLboolean transpose = cmd->transpose;
659696c5ddc4Srjs   GLdouble * value;
659796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
659896c5ddc4Srjs   value = (GLdouble *) variable_data;
659996c5ddc4Srjs   CALL_ProgramUniformMatrix2x4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
660096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
660196c5ddc4Srjs}
660296c5ddc4Srjsvoid GLAPIENTRY
660396c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix2x4dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
660496c5ddc4Srjs{
660596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
660696c5ddc4Srjs   int value_size = safe_mul(count, 8 * sizeof(GLdouble));
660796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix2x4dv) + value_size;
660896c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix2x4dv *cmd;
660996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
661096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix2x4dv");
661196c5ddc4Srjs      CALL_ProgramUniformMatrix2x4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
661296c5ddc4Srjs      return;
661396c5ddc4Srjs   }
661496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix2x4dv, cmd_size);
661596c5ddc4Srjs   cmd->program = program;
661696c5ddc4Srjs   cmd->location = location;
661796c5ddc4Srjs   cmd->count = count;
661896c5ddc4Srjs   cmd->transpose = transpose;
661996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
662096c5ddc4Srjs   memcpy(variable_data, value, value_size);
662196c5ddc4Srjs}
662296c5ddc4Srjs
662396c5ddc4Srjs
662496c5ddc4Srjs/* ProgramUniformMatrix3x2dv: marshalled asynchronously */
662596c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix3x2dv
662696c5ddc4Srjs{
662796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
662896c5ddc4Srjs   GLboolean transpose;
662996c5ddc4Srjs   GLuint program;
663096c5ddc4Srjs   GLint location;
663196c5ddc4Srjs   GLsizei count;
663296c5ddc4Srjs   /* Next safe_mul(count, 6 * sizeof(GLdouble)) bytes are GLdouble value[count][6] */
663396c5ddc4Srjs};
663496c5ddc4Srjsuint32_t
663596c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix3x2dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix3x2dv *cmd, const uint64_t *last)
663696c5ddc4Srjs{
663796c5ddc4Srjs   GLuint program = cmd->program;
663896c5ddc4Srjs   GLint location = cmd->location;
663996c5ddc4Srjs   GLsizei count = cmd->count;
664096c5ddc4Srjs   GLboolean transpose = cmd->transpose;
664196c5ddc4Srjs   GLdouble * value;
664296c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
664396c5ddc4Srjs   value = (GLdouble *) variable_data;
664496c5ddc4Srjs   CALL_ProgramUniformMatrix3x2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
664596c5ddc4Srjs   return cmd->cmd_base.cmd_size;
664696c5ddc4Srjs}
664796c5ddc4Srjsvoid GLAPIENTRY
664896c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix3x2dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
664996c5ddc4Srjs{
665096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
665196c5ddc4Srjs   int value_size = safe_mul(count, 6 * sizeof(GLdouble));
665296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix3x2dv) + value_size;
665396c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix3x2dv *cmd;
665496c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
665596c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix3x2dv");
665696c5ddc4Srjs      CALL_ProgramUniformMatrix3x2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
665796c5ddc4Srjs      return;
665896c5ddc4Srjs   }
665996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix3x2dv, cmd_size);
666096c5ddc4Srjs   cmd->program = program;
666196c5ddc4Srjs   cmd->location = location;
666296c5ddc4Srjs   cmd->count = count;
666396c5ddc4Srjs   cmd->transpose = transpose;
666496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
666596c5ddc4Srjs   memcpy(variable_data, value, value_size);
666696c5ddc4Srjs}
666796c5ddc4Srjs
666896c5ddc4Srjs
666996c5ddc4Srjs/* ProgramUniformMatrix3x4dv: marshalled asynchronously */
667096c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix3x4dv
667196c5ddc4Srjs{
667296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
667396c5ddc4Srjs   GLboolean transpose;
667496c5ddc4Srjs   GLuint program;
667596c5ddc4Srjs   GLint location;
667696c5ddc4Srjs   GLsizei count;
667796c5ddc4Srjs   /* Next safe_mul(count, 12 * sizeof(GLdouble)) bytes are GLdouble value[count][12] */
667896c5ddc4Srjs};
667996c5ddc4Srjsuint32_t
668096c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix3x4dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix3x4dv *cmd, const uint64_t *last)
668196c5ddc4Srjs{
668296c5ddc4Srjs   GLuint program = cmd->program;
668396c5ddc4Srjs   GLint location = cmd->location;
668496c5ddc4Srjs   GLsizei count = cmd->count;
668596c5ddc4Srjs   GLboolean transpose = cmd->transpose;
668696c5ddc4Srjs   GLdouble * value;
668796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
668896c5ddc4Srjs   value = (GLdouble *) variable_data;
668996c5ddc4Srjs   CALL_ProgramUniformMatrix3x4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
669096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
669196c5ddc4Srjs}
669296c5ddc4Srjsvoid GLAPIENTRY
669396c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix3x4dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
669496c5ddc4Srjs{
669596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
669696c5ddc4Srjs   int value_size = safe_mul(count, 12 * sizeof(GLdouble));
669796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix3x4dv) + value_size;
669896c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix3x4dv *cmd;
669996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
670096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix3x4dv");
670196c5ddc4Srjs      CALL_ProgramUniformMatrix3x4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
670296c5ddc4Srjs      return;
670396c5ddc4Srjs   }
670496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix3x4dv, cmd_size);
670596c5ddc4Srjs   cmd->program = program;
670696c5ddc4Srjs   cmd->location = location;
670796c5ddc4Srjs   cmd->count = count;
670896c5ddc4Srjs   cmd->transpose = transpose;
670996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
671096c5ddc4Srjs   memcpy(variable_data, value, value_size);
671196c5ddc4Srjs}
671296c5ddc4Srjs
671396c5ddc4Srjs
671496c5ddc4Srjs/* ProgramUniformMatrix4x2dv: marshalled asynchronously */
671596c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix4x2dv
671696c5ddc4Srjs{
671796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
671896c5ddc4Srjs   GLboolean transpose;
671996c5ddc4Srjs   GLuint program;
672096c5ddc4Srjs   GLint location;
672196c5ddc4Srjs   GLsizei count;
672296c5ddc4Srjs   /* Next safe_mul(count, 8 * sizeof(GLdouble)) bytes are GLdouble value[count][8] */
672396c5ddc4Srjs};
672496c5ddc4Srjsuint32_t
672596c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix4x2dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix4x2dv *cmd, const uint64_t *last)
672696c5ddc4Srjs{
672796c5ddc4Srjs   GLuint program = cmd->program;
672896c5ddc4Srjs   GLint location = cmd->location;
672996c5ddc4Srjs   GLsizei count = cmd->count;
673096c5ddc4Srjs   GLboolean transpose = cmd->transpose;
673196c5ddc4Srjs   GLdouble * value;
673296c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
673396c5ddc4Srjs   value = (GLdouble *) variable_data;
673496c5ddc4Srjs   CALL_ProgramUniformMatrix4x2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
673596c5ddc4Srjs   return cmd->cmd_base.cmd_size;
673696c5ddc4Srjs}
673796c5ddc4Srjsvoid GLAPIENTRY
673896c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix4x2dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
673996c5ddc4Srjs{
674096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
674196c5ddc4Srjs   int value_size = safe_mul(count, 8 * sizeof(GLdouble));
674296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix4x2dv) + value_size;
674396c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix4x2dv *cmd;
674496c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
674596c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix4x2dv");
674696c5ddc4Srjs      CALL_ProgramUniformMatrix4x2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
674796c5ddc4Srjs      return;
674896c5ddc4Srjs   }
674996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix4x2dv, cmd_size);
675096c5ddc4Srjs   cmd->program = program;
675196c5ddc4Srjs   cmd->location = location;
675296c5ddc4Srjs   cmd->count = count;
675396c5ddc4Srjs   cmd->transpose = transpose;
675496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
675596c5ddc4Srjs   memcpy(variable_data, value, value_size);
675696c5ddc4Srjs}
675796c5ddc4Srjs
675896c5ddc4Srjs
675996c5ddc4Srjs/* ProgramUniformMatrix4x3dv: marshalled asynchronously */
676096c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix4x3dv
676196c5ddc4Srjs{
676296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
676396c5ddc4Srjs   GLboolean transpose;
676496c5ddc4Srjs   GLuint program;
676596c5ddc4Srjs   GLint location;
676696c5ddc4Srjs   GLsizei count;
676796c5ddc4Srjs   /* Next safe_mul(count, 12 * sizeof(GLdouble)) bytes are GLdouble value[count][12] */
676896c5ddc4Srjs};
676996c5ddc4Srjsuint32_t
677096c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix4x3dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix4x3dv *cmd, const uint64_t *last)
677196c5ddc4Srjs{
677296c5ddc4Srjs   GLuint program = cmd->program;
677396c5ddc4Srjs   GLint location = cmd->location;
677496c5ddc4Srjs   GLsizei count = cmd->count;
677596c5ddc4Srjs   GLboolean transpose = cmd->transpose;
677696c5ddc4Srjs   GLdouble * value;
677796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
677896c5ddc4Srjs   value = (GLdouble *) variable_data;
677996c5ddc4Srjs   CALL_ProgramUniformMatrix4x3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
678096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
678196c5ddc4Srjs}
678296c5ddc4Srjsvoid GLAPIENTRY
678396c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix4x3dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
678496c5ddc4Srjs{
678596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
678696c5ddc4Srjs   int value_size = safe_mul(count, 12 * sizeof(GLdouble));
678796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix4x3dv) + value_size;
678896c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix4x3dv *cmd;
678996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
679096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix4x3dv");
679196c5ddc4Srjs      CALL_ProgramUniformMatrix4x3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
679296c5ddc4Srjs      return;
679396c5ddc4Srjs   }
679496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix4x3dv, cmd_size);
679596c5ddc4Srjs   cmd->program = program;
679696c5ddc4Srjs   cmd->location = location;
679796c5ddc4Srjs   cmd->count = count;
679896c5ddc4Srjs   cmd->transpose = transpose;
679996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
680096c5ddc4Srjs   memcpy(variable_data, value, value_size);
680196c5ddc4Srjs}
680296c5ddc4Srjs
680396c5ddc4Srjs
680496c5ddc4Srjs/* DrawTransformFeedbackStream: marshalled asynchronously */
680596c5ddc4Srjsstruct marshal_cmd_DrawTransformFeedbackStream
680696c5ddc4Srjs{
680796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
680896c5ddc4Srjs   GLenum mode;
680996c5ddc4Srjs   GLuint id;
681096c5ddc4Srjs   GLuint stream;
681196c5ddc4Srjs};
681296c5ddc4Srjsuint32_t
681396c5ddc4Srjs_mesa_unmarshal_DrawTransformFeedbackStream(struct gl_context *ctx, const struct marshal_cmd_DrawTransformFeedbackStream *cmd, const uint64_t *last)
681496c5ddc4Srjs{
681596c5ddc4Srjs   GLenum mode = cmd->mode;
681696c5ddc4Srjs   GLuint id = cmd->id;
681796c5ddc4Srjs   GLuint stream = cmd->stream;
681896c5ddc4Srjs   CALL_DrawTransformFeedbackStream(ctx->CurrentServerDispatch, (mode, id, stream));
681996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawTransformFeedbackStream), 8) / 8);
682096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
682196c5ddc4Srjs   return cmd_size;
682296c5ddc4Srjs}
682396c5ddc4Srjsvoid GLAPIENTRY
682496c5ddc4Srjs_mesa_marshal_DrawTransformFeedbackStream(GLenum mode, GLuint id, GLuint stream)
682596c5ddc4Srjs{
682696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
682796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DrawTransformFeedbackStream);
682896c5ddc4Srjs   struct marshal_cmd_DrawTransformFeedbackStream *cmd;
682996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTransformFeedbackStream, cmd_size);
683096c5ddc4Srjs   cmd->mode = mode;
683196c5ddc4Srjs   cmd->id = id;
683296c5ddc4Srjs   cmd->stream = stream;
683396c5ddc4Srjs}
683496c5ddc4Srjs
683596c5ddc4Srjs
683696c5ddc4Srjs/* BeginQueryIndexed: marshalled asynchronously */
683796c5ddc4Srjsstruct marshal_cmd_BeginQueryIndexed
683896c5ddc4Srjs{
683996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
684096c5ddc4Srjs   GLenum target;
684196c5ddc4Srjs   GLuint index;
684296c5ddc4Srjs   GLuint id;
684396c5ddc4Srjs};
684496c5ddc4Srjsuint32_t
684596c5ddc4Srjs_mesa_unmarshal_BeginQueryIndexed(struct gl_context *ctx, const struct marshal_cmd_BeginQueryIndexed *cmd, const uint64_t *last)
684696c5ddc4Srjs{
684796c5ddc4Srjs   GLenum target = cmd->target;
684896c5ddc4Srjs   GLuint index = cmd->index;
684996c5ddc4Srjs   GLuint id = cmd->id;
685096c5ddc4Srjs   CALL_BeginQueryIndexed(ctx->CurrentServerDispatch, (target, index, id));
685196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BeginQueryIndexed), 8) / 8);
685296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
685396c5ddc4Srjs   return cmd_size;
685496c5ddc4Srjs}
685596c5ddc4Srjsvoid GLAPIENTRY
685696c5ddc4Srjs_mesa_marshal_BeginQueryIndexed(GLenum target, GLuint index, GLuint id)
685796c5ddc4Srjs{
685896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
685996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BeginQueryIndexed);
686096c5ddc4Srjs   struct marshal_cmd_BeginQueryIndexed *cmd;
686196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BeginQueryIndexed, cmd_size);
686296c5ddc4Srjs   cmd->target = target;
686396c5ddc4Srjs   cmd->index = index;
686496c5ddc4Srjs   cmd->id = id;
686596c5ddc4Srjs}
686696c5ddc4Srjs
686796c5ddc4Srjs
686896c5ddc4Srjs/* EndQueryIndexed: marshalled asynchronously */
686996c5ddc4Srjsstruct marshal_cmd_EndQueryIndexed
687096c5ddc4Srjs{
687196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
687296c5ddc4Srjs   GLenum target;
687396c5ddc4Srjs   GLuint index;
687496c5ddc4Srjs};
687596c5ddc4Srjsuint32_t
687696c5ddc4Srjs_mesa_unmarshal_EndQueryIndexed(struct gl_context *ctx, const struct marshal_cmd_EndQueryIndexed *cmd, const uint64_t *last)
687796c5ddc4Srjs{
687896c5ddc4Srjs   GLenum target = cmd->target;
687996c5ddc4Srjs   GLuint index = cmd->index;
688096c5ddc4Srjs   CALL_EndQueryIndexed(ctx->CurrentServerDispatch, (target, index));
688196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_EndQueryIndexed), 8) / 8);
688296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
688396c5ddc4Srjs   return cmd_size;
688496c5ddc4Srjs}
688596c5ddc4Srjsvoid GLAPIENTRY
688696c5ddc4Srjs_mesa_marshal_EndQueryIndexed(GLenum target, GLuint index)
688796c5ddc4Srjs{
688896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
688996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_EndQueryIndexed);
689096c5ddc4Srjs   struct marshal_cmd_EndQueryIndexed *cmd;
689196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EndQueryIndexed, cmd_size);
689296c5ddc4Srjs   cmd->target = target;
689396c5ddc4Srjs   cmd->index = index;
689496c5ddc4Srjs}
689596c5ddc4Srjs
689696c5ddc4Srjs
689796c5ddc4Srjs/* GetQueryIndexediv: marshalled synchronously */
689896c5ddc4Srjsvoid GLAPIENTRY
689996c5ddc4Srjs_mesa_marshal_GetQueryIndexediv(GLenum target, GLuint index, GLenum pname, GLint * params)
690096c5ddc4Srjs{
690196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
690296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetQueryIndexediv");
690396c5ddc4Srjs   CALL_GetQueryIndexediv(ctx->CurrentServerDispatch, (target, index, pname, params));
690496c5ddc4Srjs}
690596c5ddc4Srjs
690696c5ddc4Srjs
690796c5ddc4Srjs/* UseProgramStages: marshalled asynchronously */
690896c5ddc4Srjsstruct marshal_cmd_UseProgramStages
690996c5ddc4Srjs{
691096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
691196c5ddc4Srjs   GLuint pipeline;
691296c5ddc4Srjs   GLbitfield stages;
691396c5ddc4Srjs   GLuint program;
691496c5ddc4Srjs};
691596c5ddc4Srjsuint32_t
691696c5ddc4Srjs_mesa_unmarshal_UseProgramStages(struct gl_context *ctx, const struct marshal_cmd_UseProgramStages *cmd, const uint64_t *last)
691796c5ddc4Srjs{
691896c5ddc4Srjs   GLuint pipeline = cmd->pipeline;
691996c5ddc4Srjs   GLbitfield stages = cmd->stages;
692096c5ddc4Srjs   GLuint program = cmd->program;
692196c5ddc4Srjs   CALL_UseProgramStages(ctx->CurrentServerDispatch, (pipeline, stages, program));
692296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_UseProgramStages), 8) / 8);
692396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
692496c5ddc4Srjs   return cmd_size;
692596c5ddc4Srjs}
692696c5ddc4Srjsvoid GLAPIENTRY
692796c5ddc4Srjs_mesa_marshal_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
692896c5ddc4Srjs{
692996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
693096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UseProgramStages);
693196c5ddc4Srjs   struct marshal_cmd_UseProgramStages *cmd;
693296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UseProgramStages, cmd_size);
693396c5ddc4Srjs   cmd->pipeline = pipeline;
693496c5ddc4Srjs   cmd->stages = stages;
693596c5ddc4Srjs   cmd->program = program;
693696c5ddc4Srjs}
693796c5ddc4Srjs
693896c5ddc4Srjs
693996c5ddc4Srjs/* ActiveShaderProgram: marshalled asynchronously */
694096c5ddc4Srjsstruct marshal_cmd_ActiveShaderProgram
694196c5ddc4Srjs{
694296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
694396c5ddc4Srjs   GLuint pipeline;
694496c5ddc4Srjs   GLuint program;
694596c5ddc4Srjs};
694696c5ddc4Srjsuint32_t
694796c5ddc4Srjs_mesa_unmarshal_ActiveShaderProgram(struct gl_context *ctx, const struct marshal_cmd_ActiveShaderProgram *cmd, const uint64_t *last)
694896c5ddc4Srjs{
694996c5ddc4Srjs   GLuint pipeline = cmd->pipeline;
695096c5ddc4Srjs   GLuint program = cmd->program;
695196c5ddc4Srjs   CALL_ActiveShaderProgram(ctx->CurrentServerDispatch, (pipeline, program));
695296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ActiveShaderProgram), 8) / 8);
695396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
695496c5ddc4Srjs   return cmd_size;
695596c5ddc4Srjs}
695696c5ddc4Srjsvoid GLAPIENTRY
695796c5ddc4Srjs_mesa_marshal_ActiveShaderProgram(GLuint pipeline, GLuint program)
695896c5ddc4Srjs{
695996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
696096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ActiveShaderProgram);
696196c5ddc4Srjs   struct marshal_cmd_ActiveShaderProgram *cmd;
696296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ActiveShaderProgram, cmd_size);
696396c5ddc4Srjs   cmd->pipeline = pipeline;
696496c5ddc4Srjs   cmd->program = program;
696596c5ddc4Srjs}
696696c5ddc4Srjs
696796c5ddc4Srjs
696896c5ddc4Srjs/* CreateShaderProgramv: marshalled synchronously */
696996c5ddc4SrjsGLuint GLAPIENTRY
697096c5ddc4Srjs_mesa_marshal_CreateShaderProgramv(GLenum type, GLsizei count, const GLchar * const * strings)
697196c5ddc4Srjs{
697296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
697396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CreateShaderProgramv");
697496c5ddc4Srjs   return CALL_CreateShaderProgramv(ctx->CurrentServerDispatch, (type, count, strings));
697596c5ddc4Srjs}
697696c5ddc4Srjs
697796c5ddc4Srjs
697896c5ddc4Srjs/* BindProgramPipeline: marshalled asynchronously */
697996c5ddc4Srjsstruct marshal_cmd_BindProgramPipeline
698096c5ddc4Srjs{
698196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
698296c5ddc4Srjs   GLuint pipeline;
698396c5ddc4Srjs};
698496c5ddc4Srjsuint32_t
698596c5ddc4Srjs_mesa_unmarshal_BindProgramPipeline(struct gl_context *ctx, const struct marshal_cmd_BindProgramPipeline *cmd, const uint64_t *last)
698696c5ddc4Srjs{
698796c5ddc4Srjs   GLuint pipeline = cmd->pipeline;
698896c5ddc4Srjs   CALL_BindProgramPipeline(ctx->CurrentServerDispatch, (pipeline));
698996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindProgramPipeline), 8) / 8);
699096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
699196c5ddc4Srjs   return cmd_size;
699296c5ddc4Srjs}
699396c5ddc4Srjsvoid GLAPIENTRY
699496c5ddc4Srjs_mesa_marshal_BindProgramPipeline(GLuint pipeline)
699596c5ddc4Srjs{
699696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
699796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindProgramPipeline);
699896c5ddc4Srjs   struct marshal_cmd_BindProgramPipeline *cmd;
699996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindProgramPipeline, cmd_size);
700096c5ddc4Srjs   cmd->pipeline = pipeline;
700196c5ddc4Srjs}
700296c5ddc4Srjs
700396c5ddc4Srjs
700496c5ddc4Srjs/* DeleteProgramPipelines: marshalled asynchronously */
700596c5ddc4Srjsstruct marshal_cmd_DeleteProgramPipelines
700696c5ddc4Srjs{
700796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
700896c5ddc4Srjs   GLsizei n;
700996c5ddc4Srjs   /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint pipelines[n] */
701096c5ddc4Srjs};
701196c5ddc4Srjsuint32_t
701296c5ddc4Srjs_mesa_unmarshal_DeleteProgramPipelines(struct gl_context *ctx, const struct marshal_cmd_DeleteProgramPipelines *cmd, const uint64_t *last)
701396c5ddc4Srjs{
701496c5ddc4Srjs   GLsizei n = cmd->n;
701596c5ddc4Srjs   GLuint * pipelines;
701696c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
701796c5ddc4Srjs   pipelines = (GLuint *) variable_data;
701896c5ddc4Srjs   CALL_DeleteProgramPipelines(ctx->CurrentServerDispatch, (n, pipelines));
701996c5ddc4Srjs   return cmd->cmd_base.cmd_size;
702096c5ddc4Srjs}
702196c5ddc4Srjsvoid GLAPIENTRY
702296c5ddc4Srjs_mesa_marshal_DeleteProgramPipelines(GLsizei n, const GLuint * pipelines)
702396c5ddc4Srjs{
702496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
702596c5ddc4Srjs   int pipelines_size = safe_mul(n, 1 * sizeof(GLuint));
702696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DeleteProgramPipelines) + pipelines_size;
702796c5ddc4Srjs   struct marshal_cmd_DeleteProgramPipelines *cmd;
702896c5ddc4Srjs   if (unlikely(pipelines_size < 0 || (pipelines_size > 0 && !pipelines) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
702996c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "DeleteProgramPipelines");
703096c5ddc4Srjs      CALL_DeleteProgramPipelines(ctx->CurrentServerDispatch, (n, pipelines));
703196c5ddc4Srjs      return;
703296c5ddc4Srjs   }
703396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteProgramPipelines, cmd_size);
703496c5ddc4Srjs   cmd->n = n;
703596c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
703696c5ddc4Srjs   memcpy(variable_data, pipelines, pipelines_size);
703796c5ddc4Srjs}
703896c5ddc4Srjs
703996c5ddc4Srjs
704096c5ddc4Srjs/* GenProgramPipelines: marshalled synchronously */
704196c5ddc4Srjsvoid GLAPIENTRY
704296c5ddc4Srjs_mesa_marshal_GenProgramPipelines(GLsizei n, GLuint * pipelines)
704396c5ddc4Srjs{
704496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
704596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GenProgramPipelines");
704696c5ddc4Srjs   CALL_GenProgramPipelines(ctx->CurrentServerDispatch, (n, pipelines));
704796c5ddc4Srjs}
704896c5ddc4Srjs
704996c5ddc4Srjs
705096c5ddc4Srjs/* IsProgramPipeline: marshalled synchronously */
705196c5ddc4SrjsGLboolean GLAPIENTRY
705296c5ddc4Srjs_mesa_marshal_IsProgramPipeline(GLuint pipeline)
705396c5ddc4Srjs{
705496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
705596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsProgramPipeline");
705696c5ddc4Srjs   return CALL_IsProgramPipeline(ctx->CurrentServerDispatch, (pipeline));
705796c5ddc4Srjs}
705896c5ddc4Srjs
705996c5ddc4Srjs
706096c5ddc4Srjs/* GetProgramPipelineiv: marshalled synchronously */
706196c5ddc4Srjsvoid GLAPIENTRY
706296c5ddc4Srjs_mesa_marshal_GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint * params)
706396c5ddc4Srjs{
706496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
706596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramPipelineiv");
706696c5ddc4Srjs   CALL_GetProgramPipelineiv(ctx->CurrentServerDispatch, (pipeline, pname, params));
706796c5ddc4Srjs}
706896c5ddc4Srjs
706996c5ddc4Srjs
707096c5ddc4Srjs/* ProgramUniform1i: marshalled asynchronously */
707196c5ddc4Srjsstruct marshal_cmd_ProgramUniform1i
707296c5ddc4Srjs{
707396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
707496c5ddc4Srjs   GLuint program;
707596c5ddc4Srjs   GLint location;
707696c5ddc4Srjs   GLint x;
707796c5ddc4Srjs};
707896c5ddc4Srjsuint32_t
707996c5ddc4Srjs_mesa_unmarshal_ProgramUniform1i(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1i *cmd, const uint64_t *last)
708096c5ddc4Srjs{
708196c5ddc4Srjs   GLuint program = cmd->program;
708296c5ddc4Srjs   GLint location = cmd->location;
708396c5ddc4Srjs   GLint x = cmd->x;
708496c5ddc4Srjs   CALL_ProgramUniform1i(ctx->CurrentServerDispatch, (program, location, x));
708596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform1i), 8) / 8);
708696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
708796c5ddc4Srjs   return cmd_size;
708896c5ddc4Srjs}
708996c5ddc4Srjsvoid GLAPIENTRY
709096c5ddc4Srjs_mesa_marshal_ProgramUniform1i(GLuint program, GLint location, GLint x)
709196c5ddc4Srjs{
709296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
709396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform1i);
709496c5ddc4Srjs   struct marshal_cmd_ProgramUniform1i *cmd;
709596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1i, cmd_size);
709696c5ddc4Srjs   cmd->program = program;
709796c5ddc4Srjs   cmd->location = location;
709896c5ddc4Srjs   cmd->x = x;
709996c5ddc4Srjs}
710096c5ddc4Srjs
710196c5ddc4Srjs
710296c5ddc4Srjs/* ProgramUniform2i: marshalled asynchronously */
710396c5ddc4Srjsstruct marshal_cmd_ProgramUniform2i
710496c5ddc4Srjs{
710596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
710696c5ddc4Srjs   GLuint program;
710796c5ddc4Srjs   GLint location;
710896c5ddc4Srjs   GLint x;
710996c5ddc4Srjs   GLint y;
711096c5ddc4Srjs};
711196c5ddc4Srjsuint32_t
711296c5ddc4Srjs_mesa_unmarshal_ProgramUniform2i(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2i *cmd, const uint64_t *last)
711396c5ddc4Srjs{
711496c5ddc4Srjs   GLuint program = cmd->program;
711596c5ddc4Srjs   GLint location = cmd->location;
711696c5ddc4Srjs   GLint x = cmd->x;
711796c5ddc4Srjs   GLint y = cmd->y;
711896c5ddc4Srjs   CALL_ProgramUniform2i(ctx->CurrentServerDispatch, (program, location, x, y));
711996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform2i), 8) / 8);
712096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
712196c5ddc4Srjs   return cmd_size;
712296c5ddc4Srjs}
712396c5ddc4Srjsvoid GLAPIENTRY
712496c5ddc4Srjs_mesa_marshal_ProgramUniform2i(GLuint program, GLint location, GLint x, GLint y)
712596c5ddc4Srjs{
712696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
712796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform2i);
712896c5ddc4Srjs   struct marshal_cmd_ProgramUniform2i *cmd;
712996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2i, cmd_size);
713096c5ddc4Srjs   cmd->program = program;
713196c5ddc4Srjs   cmd->location = location;
713296c5ddc4Srjs   cmd->x = x;
713396c5ddc4Srjs   cmd->y = y;
713496c5ddc4Srjs}
713596c5ddc4Srjs
713696c5ddc4Srjs
7137