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/* GetPixelMapfv: marshalled asynchronously */
4596c5ddc4Srjsstruct marshal_cmd_GetPixelMapfv
4696c5ddc4Srjs{
4796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
4896c5ddc4Srjs   GLenum map;
4996c5ddc4Srjs   GLfloat * values;
5096c5ddc4Srjs};
5196c5ddc4Srjsuint32_t
5296c5ddc4Srjs_mesa_unmarshal_GetPixelMapfv(struct gl_context *ctx, const struct marshal_cmd_GetPixelMapfv *cmd, const uint64_t *last)
5396c5ddc4Srjs{
5496c5ddc4Srjs   GLenum map = cmd->map;
5596c5ddc4Srjs   GLfloat * values = cmd->values;
5696c5ddc4Srjs   CALL_GetPixelMapfv(ctx->CurrentServerDispatch, (map, values));
5796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetPixelMapfv), 8) / 8);
5896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
5996c5ddc4Srjs   return cmd_size;
6096c5ddc4Srjs}
6196c5ddc4Srjsvoid GLAPIENTRY
6296c5ddc4Srjs_mesa_marshal_GetPixelMapfv(GLenum map, GLfloat * values)
6396c5ddc4Srjs{
6496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
6596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetPixelMapfv);
6696c5ddc4Srjs   struct marshal_cmd_GetPixelMapfv *cmd;
6796c5ddc4Srjs   if (_mesa_glthread_has_no_pack_buffer(ctx)) {
6896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "GetPixelMapfv");
6996c5ddc4Srjs      CALL_GetPixelMapfv(ctx->CurrentServerDispatch, (map, values));
7096c5ddc4Srjs      return;
7196c5ddc4Srjs   }
7296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetPixelMapfv, cmd_size);
7396c5ddc4Srjs   cmd->map = map;
7496c5ddc4Srjs   cmd->values = values;
7596c5ddc4Srjs}
7696c5ddc4Srjs
7796c5ddc4Srjs
7896c5ddc4Srjs/* GetPixelMapuiv: marshalled asynchronously */
7996c5ddc4Srjsstruct marshal_cmd_GetPixelMapuiv
8096c5ddc4Srjs{
8196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
8296c5ddc4Srjs   GLenum map;
8396c5ddc4Srjs   GLuint * values;
8496c5ddc4Srjs};
8596c5ddc4Srjsuint32_t
8696c5ddc4Srjs_mesa_unmarshal_GetPixelMapuiv(struct gl_context *ctx, const struct marshal_cmd_GetPixelMapuiv *cmd, const uint64_t *last)
8796c5ddc4Srjs{
8896c5ddc4Srjs   GLenum map = cmd->map;
8996c5ddc4Srjs   GLuint * values = cmd->values;
9096c5ddc4Srjs   CALL_GetPixelMapuiv(ctx->CurrentServerDispatch, (map, values));
9196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetPixelMapuiv), 8) / 8);
9296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
9396c5ddc4Srjs   return cmd_size;
9496c5ddc4Srjs}
9596c5ddc4Srjsvoid GLAPIENTRY
9696c5ddc4Srjs_mesa_marshal_GetPixelMapuiv(GLenum map, GLuint * values)
9796c5ddc4Srjs{
9896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
9996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetPixelMapuiv);
10096c5ddc4Srjs   struct marshal_cmd_GetPixelMapuiv *cmd;
10196c5ddc4Srjs   if (_mesa_glthread_has_no_pack_buffer(ctx)) {
10296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "GetPixelMapuiv");
10396c5ddc4Srjs      CALL_GetPixelMapuiv(ctx->CurrentServerDispatch, (map, values));
10496c5ddc4Srjs      return;
10596c5ddc4Srjs   }
10696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetPixelMapuiv, cmd_size);
10796c5ddc4Srjs   cmd->map = map;
10896c5ddc4Srjs   cmd->values = values;
10996c5ddc4Srjs}
11096c5ddc4Srjs
11196c5ddc4Srjs
11296c5ddc4Srjs/* GetPixelMapusv: marshalled asynchronously */
11396c5ddc4Srjsstruct marshal_cmd_GetPixelMapusv
11496c5ddc4Srjs{
11596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
11696c5ddc4Srjs   GLenum map;
11796c5ddc4Srjs   GLushort * values;
11896c5ddc4Srjs};
11996c5ddc4Srjsuint32_t
12096c5ddc4Srjs_mesa_unmarshal_GetPixelMapusv(struct gl_context *ctx, const struct marshal_cmd_GetPixelMapusv *cmd, const uint64_t *last)
12196c5ddc4Srjs{
12296c5ddc4Srjs   GLenum map = cmd->map;
12396c5ddc4Srjs   GLushort * values = cmd->values;
12496c5ddc4Srjs   CALL_GetPixelMapusv(ctx->CurrentServerDispatch, (map, values));
12596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetPixelMapusv), 8) / 8);
12696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
12796c5ddc4Srjs   return cmd_size;
12896c5ddc4Srjs}
12996c5ddc4Srjsvoid GLAPIENTRY
13096c5ddc4Srjs_mesa_marshal_GetPixelMapusv(GLenum map, GLushort * values)
13196c5ddc4Srjs{
13296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
13396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetPixelMapusv);
13496c5ddc4Srjs   struct marshal_cmd_GetPixelMapusv *cmd;
13596c5ddc4Srjs   if (_mesa_glthread_has_no_pack_buffer(ctx)) {
13696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "GetPixelMapusv");
13796c5ddc4Srjs      CALL_GetPixelMapusv(ctx->CurrentServerDispatch, (map, values));
13896c5ddc4Srjs      return;
13996c5ddc4Srjs   }
14096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetPixelMapusv, cmd_size);
14196c5ddc4Srjs   cmd->map = map;
14296c5ddc4Srjs   cmd->values = values;
14396c5ddc4Srjs}
14496c5ddc4Srjs
14596c5ddc4Srjs
14696c5ddc4Srjs/* GetPolygonStipple: marshalled asynchronously */
14796c5ddc4Srjsstruct marshal_cmd_GetPolygonStipple
14896c5ddc4Srjs{
14996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
15096c5ddc4Srjs   GLubyte * mask;
15196c5ddc4Srjs};
15296c5ddc4Srjsuint32_t
15396c5ddc4Srjs_mesa_unmarshal_GetPolygonStipple(struct gl_context *ctx, const struct marshal_cmd_GetPolygonStipple *cmd, const uint64_t *last)
15496c5ddc4Srjs{
15596c5ddc4Srjs   GLubyte * mask = cmd->mask;
15696c5ddc4Srjs   CALL_GetPolygonStipple(ctx->CurrentServerDispatch, (mask));
15796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetPolygonStipple), 8) / 8);
15896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
15996c5ddc4Srjs   return cmd_size;
16096c5ddc4Srjs}
16196c5ddc4Srjsvoid GLAPIENTRY
16296c5ddc4Srjs_mesa_marshal_GetPolygonStipple(GLubyte * mask)
16396c5ddc4Srjs{
16496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
16596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetPolygonStipple);
16696c5ddc4Srjs   struct marshal_cmd_GetPolygonStipple *cmd;
16796c5ddc4Srjs   if (_mesa_glthread_has_no_pack_buffer(ctx)) {
16896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "GetPolygonStipple");
16996c5ddc4Srjs      CALL_GetPolygonStipple(ctx->CurrentServerDispatch, (mask));
17096c5ddc4Srjs      return;
17196c5ddc4Srjs   }
17296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetPolygonStipple, cmd_size);
17396c5ddc4Srjs   cmd->mask = mask;
17496c5ddc4Srjs}
17596c5ddc4Srjs
17696c5ddc4Srjs
17796c5ddc4Srjs/* GetString: marshalled synchronously */
17896c5ddc4Srjsconst GLubyte * GLAPIENTRY
17996c5ddc4Srjs_mesa_marshal_GetString(GLenum name)
18096c5ddc4Srjs{
18196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
18296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetString");
18396c5ddc4Srjs   return CALL_GetString(ctx->CurrentServerDispatch, (name));
18496c5ddc4Srjs}
18596c5ddc4Srjs
18696c5ddc4Srjs
18796c5ddc4Srjs/* GetTexEnvfv: marshalled synchronously */
18896c5ddc4Srjsvoid GLAPIENTRY
18996c5ddc4Srjs_mesa_marshal_GetTexEnvfv(GLenum target, GLenum pname, GLfloat * params)
19096c5ddc4Srjs{
19196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
19296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTexEnvfv");
19396c5ddc4Srjs   CALL_GetTexEnvfv(ctx->CurrentServerDispatch, (target, pname, params));
19496c5ddc4Srjs}
19596c5ddc4Srjs
19696c5ddc4Srjs
19796c5ddc4Srjs/* GetTexEnviv: marshalled synchronously */
19896c5ddc4Srjsvoid GLAPIENTRY
19996c5ddc4Srjs_mesa_marshal_GetTexEnviv(GLenum target, GLenum pname, GLint * params)
20096c5ddc4Srjs{
20196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
20296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTexEnviv");
20396c5ddc4Srjs   CALL_GetTexEnviv(ctx->CurrentServerDispatch, (target, pname, params));
20496c5ddc4Srjs}
20596c5ddc4Srjs
20696c5ddc4Srjs
20796c5ddc4Srjs/* GetTexGendv: marshalled synchronously */
20896c5ddc4Srjsvoid GLAPIENTRY
20996c5ddc4Srjs_mesa_marshal_GetTexGendv(GLenum coord, GLenum pname, GLdouble * params)
21096c5ddc4Srjs{
21196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
21296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTexGendv");
21396c5ddc4Srjs   CALL_GetTexGendv(ctx->CurrentServerDispatch, (coord, pname, params));
21496c5ddc4Srjs}
21596c5ddc4Srjs
21696c5ddc4Srjs
21796c5ddc4Srjs/* GetTexGenfv: marshalled synchronously */
21896c5ddc4Srjsvoid GLAPIENTRY
21996c5ddc4Srjs_mesa_marshal_GetTexGenfv(GLenum coord, GLenum pname, GLfloat * params)
22096c5ddc4Srjs{
22196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
22296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTexGenfv");
22396c5ddc4Srjs   CALL_GetTexGenfv(ctx->CurrentServerDispatch, (coord, pname, params));
22496c5ddc4Srjs}
22596c5ddc4Srjs
22696c5ddc4Srjs
22796c5ddc4Srjs/* GetTexGeniv: marshalled synchronously */
22896c5ddc4Srjsvoid GLAPIENTRY
22996c5ddc4Srjs_mesa_marshal_GetTexGeniv(GLenum coord, GLenum pname, GLint * params)
23096c5ddc4Srjs{
23196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
23296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTexGeniv");
23396c5ddc4Srjs   CALL_GetTexGeniv(ctx->CurrentServerDispatch, (coord, pname, params));
23496c5ddc4Srjs}
23596c5ddc4Srjs
23696c5ddc4Srjs
23796c5ddc4Srjs/* GetTexImage: marshalled asynchronously */
23896c5ddc4Srjsstruct marshal_cmd_GetTexImage
23996c5ddc4Srjs{
24096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
24196c5ddc4Srjs   GLenum target;
24296c5ddc4Srjs   GLint level;
24396c5ddc4Srjs   GLenum format;
24496c5ddc4Srjs   GLenum type;
24596c5ddc4Srjs   GLvoid * pixels;
24696c5ddc4Srjs};
24796c5ddc4Srjsuint32_t
24896c5ddc4Srjs_mesa_unmarshal_GetTexImage(struct gl_context *ctx, const struct marshal_cmd_GetTexImage *cmd, const uint64_t *last)
24996c5ddc4Srjs{
25096c5ddc4Srjs   GLenum target = cmd->target;
25196c5ddc4Srjs   GLint level = cmd->level;
25296c5ddc4Srjs   GLenum format = cmd->format;
25396c5ddc4Srjs   GLenum type = cmd->type;
25496c5ddc4Srjs   GLvoid * pixels = cmd->pixels;
25596c5ddc4Srjs   CALL_GetTexImage(ctx->CurrentServerDispatch, (target, level, format, type, pixels));
25696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetTexImage), 8) / 8);
25796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
25896c5ddc4Srjs   return cmd_size;
25996c5ddc4Srjs}
26096c5ddc4Srjsvoid GLAPIENTRY
26196c5ddc4Srjs_mesa_marshal_GetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels)
26296c5ddc4Srjs{
26396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
26496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetTexImage);
26596c5ddc4Srjs   struct marshal_cmd_GetTexImage *cmd;
26696c5ddc4Srjs   if (_mesa_glthread_has_no_pack_buffer(ctx)) {
26796c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "GetTexImage");
26896c5ddc4Srjs      CALL_GetTexImage(ctx->CurrentServerDispatch, (target, level, format, type, pixels));
26996c5ddc4Srjs      return;
27096c5ddc4Srjs   }
27196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetTexImage, cmd_size);
27296c5ddc4Srjs   cmd->target = target;
27396c5ddc4Srjs   cmd->level = level;
27496c5ddc4Srjs   cmd->format = format;
27596c5ddc4Srjs   cmd->type = type;
27696c5ddc4Srjs   cmd->pixels = pixels;
27796c5ddc4Srjs}
27896c5ddc4Srjs
27996c5ddc4Srjs
28096c5ddc4Srjs/* GetTexParameterfv: marshalled synchronously */
28196c5ddc4Srjsvoid GLAPIENTRY
28296c5ddc4Srjs_mesa_marshal_GetTexParameterfv(GLenum target, GLenum pname, GLfloat * params)
28396c5ddc4Srjs{
28496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
28596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTexParameterfv");
28696c5ddc4Srjs   CALL_GetTexParameterfv(ctx->CurrentServerDispatch, (target, pname, params));
28796c5ddc4Srjs}
28896c5ddc4Srjs
28996c5ddc4Srjs
29096c5ddc4Srjs/* GetTexParameteriv: marshalled synchronously */
29196c5ddc4Srjsvoid GLAPIENTRY
29296c5ddc4Srjs_mesa_marshal_GetTexParameteriv(GLenum target, GLenum pname, GLint * params)
29396c5ddc4Srjs{
29496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
29596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTexParameteriv");
29696c5ddc4Srjs   CALL_GetTexParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
29796c5ddc4Srjs}
29896c5ddc4Srjs
29996c5ddc4Srjs
30096c5ddc4Srjs/* GetTexLevelParameterfv: marshalled synchronously */
30196c5ddc4Srjsvoid GLAPIENTRY
30296c5ddc4Srjs_mesa_marshal_GetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat * params)
30396c5ddc4Srjs{
30496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
30596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTexLevelParameterfv");
30696c5ddc4Srjs   CALL_GetTexLevelParameterfv(ctx->CurrentServerDispatch, (target, level, pname, params));
30796c5ddc4Srjs}
30896c5ddc4Srjs
30996c5ddc4Srjs
31096c5ddc4Srjs/* GetTexLevelParameteriv: marshalled synchronously */
31196c5ddc4Srjsvoid GLAPIENTRY
31296c5ddc4Srjs_mesa_marshal_GetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint * params)
31396c5ddc4Srjs{
31496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
31596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTexLevelParameteriv");
31696c5ddc4Srjs   CALL_GetTexLevelParameteriv(ctx->CurrentServerDispatch, (target, level, pname, params));
31796c5ddc4Srjs}
31896c5ddc4Srjs
31996c5ddc4Srjs
32096c5ddc4Srjs/* IsEnabled: marshalled synchronously */
32196c5ddc4SrjsGLboolean GLAPIENTRY
32296c5ddc4Srjs_mesa_marshal_IsEnabled(GLenum cap)
32396c5ddc4Srjs{
32496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
32596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsEnabled");
32696c5ddc4Srjs   return CALL_IsEnabled(ctx->CurrentServerDispatch, (cap));
32796c5ddc4Srjs}
32896c5ddc4Srjs
32996c5ddc4Srjs
33096c5ddc4Srjs/* IsList: marshalled synchronously */
33196c5ddc4SrjsGLboolean GLAPIENTRY
33296c5ddc4Srjs_mesa_marshal_IsList(GLuint list)
33396c5ddc4Srjs{
33496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
33596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsList");
33696c5ddc4Srjs   return CALL_IsList(ctx->CurrentServerDispatch, (list));
33796c5ddc4Srjs}
33896c5ddc4Srjs
33996c5ddc4Srjs
34096c5ddc4Srjs/* DepthRange: marshalled asynchronously */
34196c5ddc4Srjsstruct marshal_cmd_DepthRange
34296c5ddc4Srjs{
34396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
34496c5ddc4Srjs   GLclampd zNear;
34596c5ddc4Srjs   GLclampd zFar;
34696c5ddc4Srjs};
34796c5ddc4Srjsuint32_t
34896c5ddc4Srjs_mesa_unmarshal_DepthRange(struct gl_context *ctx, const struct marshal_cmd_DepthRange *cmd, const uint64_t *last)
34996c5ddc4Srjs{
35096c5ddc4Srjs   GLclampd zNear = cmd->zNear;
35196c5ddc4Srjs   GLclampd zFar = cmd->zFar;
35296c5ddc4Srjs   CALL_DepthRange(ctx->CurrentServerDispatch, (zNear, zFar));
35396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DepthRange), 8) / 8);
35496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
35596c5ddc4Srjs   return cmd_size;
35696c5ddc4Srjs}
35796c5ddc4Srjsvoid GLAPIENTRY
35896c5ddc4Srjs_mesa_marshal_DepthRange(GLclampd zNear, GLclampd zFar)
35996c5ddc4Srjs{
36096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
36196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DepthRange);
36296c5ddc4Srjs   struct marshal_cmd_DepthRange *cmd;
36396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DepthRange, cmd_size);
36496c5ddc4Srjs   cmd->zNear = zNear;
36596c5ddc4Srjs   cmd->zFar = zFar;
36696c5ddc4Srjs}
36796c5ddc4Srjs
36896c5ddc4Srjs
36996c5ddc4Srjs/* Frustum: marshalled asynchronously */
37096c5ddc4Srjsstruct marshal_cmd_Frustum
37196c5ddc4Srjs{
37296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
37396c5ddc4Srjs   GLdouble left;
37496c5ddc4Srjs   GLdouble right;
37596c5ddc4Srjs   GLdouble bottom;
37696c5ddc4Srjs   GLdouble top;
37796c5ddc4Srjs   GLdouble zNear;
37896c5ddc4Srjs   GLdouble zFar;
37996c5ddc4Srjs};
38096c5ddc4Srjsuint32_t
38196c5ddc4Srjs_mesa_unmarshal_Frustum(struct gl_context *ctx, const struct marshal_cmd_Frustum *cmd, const uint64_t *last)
38296c5ddc4Srjs{
38396c5ddc4Srjs   GLdouble left = cmd->left;
38496c5ddc4Srjs   GLdouble right = cmd->right;
38596c5ddc4Srjs   GLdouble bottom = cmd->bottom;
38696c5ddc4Srjs   GLdouble top = cmd->top;
38796c5ddc4Srjs   GLdouble zNear = cmd->zNear;
38896c5ddc4Srjs   GLdouble zFar = cmd->zFar;
38996c5ddc4Srjs   CALL_Frustum(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar));
39096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Frustum), 8) / 8);
39196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
39296c5ddc4Srjs   return cmd_size;
39396c5ddc4Srjs}
39496c5ddc4Srjsvoid GLAPIENTRY
39596c5ddc4Srjs_mesa_marshal_Frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
39696c5ddc4Srjs{
39796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
39896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Frustum);
39996c5ddc4Srjs   struct marshal_cmd_Frustum *cmd;
40096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Frustum, cmd_size);
40196c5ddc4Srjs   cmd->left = left;
40296c5ddc4Srjs   cmd->right = right;
40396c5ddc4Srjs   cmd->bottom = bottom;
40496c5ddc4Srjs   cmd->top = top;
40596c5ddc4Srjs   cmd->zNear = zNear;
40696c5ddc4Srjs   cmd->zFar = zFar;
40796c5ddc4Srjs}
40896c5ddc4Srjs
40996c5ddc4Srjs
41096c5ddc4Srjs/* LoadIdentity: marshalled asynchronously */
41196c5ddc4Srjsstruct marshal_cmd_LoadIdentity
41296c5ddc4Srjs{
41396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
41496c5ddc4Srjs};
41596c5ddc4Srjsuint32_t
41696c5ddc4Srjs_mesa_unmarshal_LoadIdentity(struct gl_context *ctx, const struct marshal_cmd_LoadIdentity *cmd, const uint64_t *last)
41796c5ddc4Srjs{
41896c5ddc4Srjs   CALL_LoadIdentity(ctx->CurrentServerDispatch, ());
41996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_LoadIdentity), 8) / 8);
42096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
42196c5ddc4Srjs   return cmd_size;
42296c5ddc4Srjs}
42396c5ddc4Srjsvoid GLAPIENTRY
42496c5ddc4Srjs_mesa_marshal_LoadIdentity(void)
42596c5ddc4Srjs{
42696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
42796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_LoadIdentity);
42896c5ddc4Srjs   struct marshal_cmd_LoadIdentity *cmd;
42996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LoadIdentity, cmd_size);
43096c5ddc4Srjs   (void) cmd;
43196c5ddc4Srjs}
43296c5ddc4Srjs
43396c5ddc4Srjs
43496c5ddc4Srjs/* LoadMatrixf: marshalled asynchronously */
43596c5ddc4Srjsstruct marshal_cmd_LoadMatrixf
43696c5ddc4Srjs{
43796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
43896c5ddc4Srjs   GLfloat m[16];
43996c5ddc4Srjs};
44096c5ddc4Srjsuint32_t
44196c5ddc4Srjs_mesa_unmarshal_LoadMatrixf(struct gl_context *ctx, const struct marshal_cmd_LoadMatrixf *cmd, const uint64_t *last)
44296c5ddc4Srjs{
44396c5ddc4Srjs   const GLfloat * m = cmd->m;
44496c5ddc4Srjs   CALL_LoadMatrixf(ctx->CurrentServerDispatch, (m));
44596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_LoadMatrixf), 8) / 8);
44696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
44796c5ddc4Srjs   return cmd_size;
44896c5ddc4Srjs}
44996c5ddc4Srjsvoid GLAPIENTRY
45096c5ddc4Srjs_mesa_marshal_LoadMatrixf(const GLfloat * m)
45196c5ddc4Srjs{
45296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
45396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_LoadMatrixf);
45496c5ddc4Srjs   struct marshal_cmd_LoadMatrixf *cmd;
45596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LoadMatrixf, cmd_size);
45696c5ddc4Srjs   memcpy(cmd->m, m, 16 * sizeof(GLfloat));
45796c5ddc4Srjs}
45896c5ddc4Srjs
45996c5ddc4Srjs
46096c5ddc4Srjs/* LoadMatrixd: marshalled asynchronously */
46196c5ddc4Srjsstruct marshal_cmd_LoadMatrixd
46296c5ddc4Srjs{
46396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
46496c5ddc4Srjs   GLdouble m[16];
46596c5ddc4Srjs};
46696c5ddc4Srjsuint32_t
46796c5ddc4Srjs_mesa_unmarshal_LoadMatrixd(struct gl_context *ctx, const struct marshal_cmd_LoadMatrixd *cmd, const uint64_t *last)
46896c5ddc4Srjs{
46996c5ddc4Srjs   const GLdouble * m = cmd->m;
47096c5ddc4Srjs   CALL_LoadMatrixd(ctx->CurrentServerDispatch, (m));
47196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_LoadMatrixd), 8) / 8);
47296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
47396c5ddc4Srjs   return cmd_size;
47496c5ddc4Srjs}
47596c5ddc4Srjsvoid GLAPIENTRY
47696c5ddc4Srjs_mesa_marshal_LoadMatrixd(const GLdouble * m)
47796c5ddc4Srjs{
47896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
47996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_LoadMatrixd);
48096c5ddc4Srjs   struct marshal_cmd_LoadMatrixd *cmd;
48196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LoadMatrixd, cmd_size);
48296c5ddc4Srjs   memcpy(cmd->m, m, 16 * sizeof(GLdouble));
48396c5ddc4Srjs}
48496c5ddc4Srjs
48596c5ddc4Srjs
48696c5ddc4Srjs/* MatrixMode: marshalled asynchronously */
48796c5ddc4Srjsstruct marshal_cmd_MatrixMode
48896c5ddc4Srjs{
48996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
49096c5ddc4Srjs   GLenum mode;
49196c5ddc4Srjs};
49296c5ddc4Srjsuint32_t
49396c5ddc4Srjs_mesa_unmarshal_MatrixMode(struct gl_context *ctx, const struct marshal_cmd_MatrixMode *cmd, const uint64_t *last)
49496c5ddc4Srjs{
49596c5ddc4Srjs   GLenum mode = cmd->mode;
49696c5ddc4Srjs   CALL_MatrixMode(ctx->CurrentServerDispatch, (mode));
49796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MatrixMode), 8) / 8);
49896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
49996c5ddc4Srjs   return cmd_size;
50096c5ddc4Srjs}
50196c5ddc4Srjsvoid GLAPIENTRY
50296c5ddc4Srjs_mesa_marshal_MatrixMode(GLenum mode)
50396c5ddc4Srjs{
50496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
50596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MatrixMode);
50696c5ddc4Srjs   struct marshal_cmd_MatrixMode *cmd;
50796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MatrixMode, cmd_size);
50896c5ddc4Srjs   cmd->mode = mode;
50996c5ddc4Srjs   _mesa_glthread_MatrixMode(ctx, mode);
51096c5ddc4Srjs}
51196c5ddc4Srjs
51296c5ddc4Srjs
51396c5ddc4Srjs/* MultMatrixf: marshalled asynchronously */
51496c5ddc4Srjsstruct marshal_cmd_MultMatrixf
51596c5ddc4Srjs{
51696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
51796c5ddc4Srjs   GLfloat m[16];
51896c5ddc4Srjs};
51996c5ddc4Srjsuint32_t
52096c5ddc4Srjs_mesa_unmarshal_MultMatrixf(struct gl_context *ctx, const struct marshal_cmd_MultMatrixf *cmd, const uint64_t *last)
52196c5ddc4Srjs{
52296c5ddc4Srjs   const GLfloat * m = cmd->m;
52396c5ddc4Srjs   CALL_MultMatrixf(ctx->CurrentServerDispatch, (m));
52496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultMatrixf), 8) / 8);
52596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
52696c5ddc4Srjs   return cmd_size;
52796c5ddc4Srjs}
52896c5ddc4Srjsvoid GLAPIENTRY
52996c5ddc4Srjs_mesa_marshal_MultMatrixf(const GLfloat * m)
53096c5ddc4Srjs{
53196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
53296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultMatrixf);
53396c5ddc4Srjs   struct marshal_cmd_MultMatrixf *cmd;
53496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultMatrixf, cmd_size);
53596c5ddc4Srjs   memcpy(cmd->m, m, 16 * sizeof(GLfloat));
53696c5ddc4Srjs}
53796c5ddc4Srjs
53896c5ddc4Srjs
53996c5ddc4Srjs/* MultMatrixd: marshalled asynchronously */
54096c5ddc4Srjsstruct marshal_cmd_MultMatrixd
54196c5ddc4Srjs{
54296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
54396c5ddc4Srjs   GLdouble m[16];
54496c5ddc4Srjs};
54596c5ddc4Srjsuint32_t
54696c5ddc4Srjs_mesa_unmarshal_MultMatrixd(struct gl_context *ctx, const struct marshal_cmd_MultMatrixd *cmd, const uint64_t *last)
54796c5ddc4Srjs{
54896c5ddc4Srjs   const GLdouble * m = cmd->m;
54996c5ddc4Srjs   CALL_MultMatrixd(ctx->CurrentServerDispatch, (m));
55096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultMatrixd), 8) / 8);
55196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
55296c5ddc4Srjs   return cmd_size;
55396c5ddc4Srjs}
55496c5ddc4Srjsvoid GLAPIENTRY
55596c5ddc4Srjs_mesa_marshal_MultMatrixd(const GLdouble * m)
55696c5ddc4Srjs{
55796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
55896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultMatrixd);
55996c5ddc4Srjs   struct marshal_cmd_MultMatrixd *cmd;
56096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultMatrixd, cmd_size);
56196c5ddc4Srjs   memcpy(cmd->m, m, 16 * sizeof(GLdouble));
56296c5ddc4Srjs}
56396c5ddc4Srjs
56496c5ddc4Srjs
56596c5ddc4Srjs/* Ortho: marshalled asynchronously */
56696c5ddc4Srjsstruct marshal_cmd_Ortho
56796c5ddc4Srjs{
56896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
56996c5ddc4Srjs   GLdouble left;
57096c5ddc4Srjs   GLdouble right;
57196c5ddc4Srjs   GLdouble bottom;
57296c5ddc4Srjs   GLdouble top;
57396c5ddc4Srjs   GLdouble zNear;
57496c5ddc4Srjs   GLdouble zFar;
57596c5ddc4Srjs};
57696c5ddc4Srjsuint32_t
57796c5ddc4Srjs_mesa_unmarshal_Ortho(struct gl_context *ctx, const struct marshal_cmd_Ortho *cmd, const uint64_t *last)
57896c5ddc4Srjs{
57996c5ddc4Srjs   GLdouble left = cmd->left;
58096c5ddc4Srjs   GLdouble right = cmd->right;
58196c5ddc4Srjs   GLdouble bottom = cmd->bottom;
58296c5ddc4Srjs   GLdouble top = cmd->top;
58396c5ddc4Srjs   GLdouble zNear = cmd->zNear;
58496c5ddc4Srjs   GLdouble zFar = cmd->zFar;
58596c5ddc4Srjs   CALL_Ortho(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar));
58696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Ortho), 8) / 8);
58796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
58896c5ddc4Srjs   return cmd_size;
58996c5ddc4Srjs}
59096c5ddc4Srjsvoid GLAPIENTRY
59196c5ddc4Srjs_mesa_marshal_Ortho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
59296c5ddc4Srjs{
59396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
59496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Ortho);
59596c5ddc4Srjs   struct marshal_cmd_Ortho *cmd;
59696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Ortho, cmd_size);
59796c5ddc4Srjs   cmd->left = left;
59896c5ddc4Srjs   cmd->right = right;
59996c5ddc4Srjs   cmd->bottom = bottom;
60096c5ddc4Srjs   cmd->top = top;
60196c5ddc4Srjs   cmd->zNear = zNear;
60296c5ddc4Srjs   cmd->zFar = zFar;
60396c5ddc4Srjs}
60496c5ddc4Srjs
60596c5ddc4Srjs
60696c5ddc4Srjs/* PopMatrix: marshalled asynchronously */
60796c5ddc4Srjsstruct marshal_cmd_PopMatrix
60896c5ddc4Srjs{
60996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
61096c5ddc4Srjs};
61196c5ddc4Srjsuint32_t
61296c5ddc4Srjs_mesa_unmarshal_PopMatrix(struct gl_context *ctx, const struct marshal_cmd_PopMatrix *cmd, const uint64_t *last)
61396c5ddc4Srjs{
61496c5ddc4Srjs   CALL_PopMatrix(ctx->CurrentServerDispatch, ());
61596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PopMatrix), 8) / 8);
61696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
61796c5ddc4Srjs   return cmd_size;
61896c5ddc4Srjs}
61996c5ddc4Srjsvoid GLAPIENTRY
62096c5ddc4Srjs_mesa_marshal_PopMatrix(void)
62196c5ddc4Srjs{
62296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
62396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_PopMatrix);
62496c5ddc4Srjs   struct marshal_cmd_PopMatrix *cmd;
62596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PopMatrix, cmd_size);
62696c5ddc4Srjs   (void) cmd;
62796c5ddc4Srjs   _mesa_glthread_PopMatrix(ctx);
62896c5ddc4Srjs}
62996c5ddc4Srjs
63096c5ddc4Srjs
63196c5ddc4Srjs/* PushMatrix: marshalled asynchronously */
63296c5ddc4Srjsstruct marshal_cmd_PushMatrix
63396c5ddc4Srjs{
63496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
63596c5ddc4Srjs};
63696c5ddc4Srjsuint32_t
63796c5ddc4Srjs_mesa_unmarshal_PushMatrix(struct gl_context *ctx, const struct marshal_cmd_PushMatrix *cmd, const uint64_t *last)
63896c5ddc4Srjs{
63996c5ddc4Srjs   CALL_PushMatrix(ctx->CurrentServerDispatch, ());
64096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PushMatrix), 8) / 8);
64196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
64296c5ddc4Srjs   return cmd_size;
64396c5ddc4Srjs}
64496c5ddc4Srjsvoid GLAPIENTRY
64596c5ddc4Srjs_mesa_marshal_PushMatrix(void)
64696c5ddc4Srjs{
64796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
64896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_PushMatrix);
64996c5ddc4Srjs   struct marshal_cmd_PushMatrix *cmd;
65096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PushMatrix, cmd_size);
65196c5ddc4Srjs   (void) cmd;
65296c5ddc4Srjs   _mesa_glthread_PushMatrix(ctx);
65396c5ddc4Srjs}
65496c5ddc4Srjs
65596c5ddc4Srjs
65696c5ddc4Srjs/* Rotated: marshalled asynchronously */
65796c5ddc4Srjsstruct marshal_cmd_Rotated
65896c5ddc4Srjs{
65996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
66096c5ddc4Srjs   GLdouble angle;
66196c5ddc4Srjs   GLdouble x;
66296c5ddc4Srjs   GLdouble y;
66396c5ddc4Srjs   GLdouble z;
66496c5ddc4Srjs};
66596c5ddc4Srjsuint32_t
66696c5ddc4Srjs_mesa_unmarshal_Rotated(struct gl_context *ctx, const struct marshal_cmd_Rotated *cmd, const uint64_t *last)
66796c5ddc4Srjs{
66896c5ddc4Srjs   GLdouble angle = cmd->angle;
66996c5ddc4Srjs   GLdouble x = cmd->x;
67096c5ddc4Srjs   GLdouble y = cmd->y;
67196c5ddc4Srjs   GLdouble z = cmd->z;
67296c5ddc4Srjs   CALL_Rotated(ctx->CurrentServerDispatch, (angle, x, y, z));
67396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Rotated), 8) / 8);
67496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
67596c5ddc4Srjs   return cmd_size;
67696c5ddc4Srjs}
67796c5ddc4Srjsvoid GLAPIENTRY
67896c5ddc4Srjs_mesa_marshal_Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
67996c5ddc4Srjs{
68096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
68196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Rotated);
68296c5ddc4Srjs   struct marshal_cmd_Rotated *cmd;
68396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Rotated, cmd_size);
68496c5ddc4Srjs   cmd->angle = angle;
68596c5ddc4Srjs   cmd->x = x;
68696c5ddc4Srjs   cmd->y = y;
68796c5ddc4Srjs   cmd->z = z;
68896c5ddc4Srjs}
68996c5ddc4Srjs
69096c5ddc4Srjs
69196c5ddc4Srjs/* Rotatef: marshalled asynchronously */
69296c5ddc4Srjsstruct marshal_cmd_Rotatef
69396c5ddc4Srjs{
69496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
69596c5ddc4Srjs   GLfloat angle;
69696c5ddc4Srjs   GLfloat x;
69796c5ddc4Srjs   GLfloat y;
69896c5ddc4Srjs   GLfloat z;
69996c5ddc4Srjs};
70096c5ddc4Srjsuint32_t
70196c5ddc4Srjs_mesa_unmarshal_Rotatef(struct gl_context *ctx, const struct marshal_cmd_Rotatef *cmd, const uint64_t *last)
70296c5ddc4Srjs{
70396c5ddc4Srjs   GLfloat angle = cmd->angle;
70496c5ddc4Srjs   GLfloat x = cmd->x;
70596c5ddc4Srjs   GLfloat y = cmd->y;
70696c5ddc4Srjs   GLfloat z = cmd->z;
70796c5ddc4Srjs   CALL_Rotatef(ctx->CurrentServerDispatch, (angle, x, y, z));
70896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Rotatef), 8) / 8);
70996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
71096c5ddc4Srjs   return cmd_size;
71196c5ddc4Srjs}
71296c5ddc4Srjsvoid GLAPIENTRY
71396c5ddc4Srjs_mesa_marshal_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
71496c5ddc4Srjs{
71596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
71696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Rotatef);
71796c5ddc4Srjs   struct marshal_cmd_Rotatef *cmd;
71896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Rotatef, cmd_size);
71996c5ddc4Srjs   cmd->angle = angle;
72096c5ddc4Srjs   cmd->x = x;
72196c5ddc4Srjs   cmd->y = y;
72296c5ddc4Srjs   cmd->z = z;
72396c5ddc4Srjs}
72496c5ddc4Srjs
72596c5ddc4Srjs
72696c5ddc4Srjs/* Scaled: marshalled asynchronously */
72796c5ddc4Srjsstruct marshal_cmd_Scaled
72896c5ddc4Srjs{
72996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
73096c5ddc4Srjs   GLdouble x;
73196c5ddc4Srjs   GLdouble y;
73296c5ddc4Srjs   GLdouble z;
73396c5ddc4Srjs};
73496c5ddc4Srjsuint32_t
73596c5ddc4Srjs_mesa_unmarshal_Scaled(struct gl_context *ctx, const struct marshal_cmd_Scaled *cmd, const uint64_t *last)
73696c5ddc4Srjs{
73796c5ddc4Srjs   GLdouble x = cmd->x;
73896c5ddc4Srjs   GLdouble y = cmd->y;
73996c5ddc4Srjs   GLdouble z = cmd->z;
74096c5ddc4Srjs   CALL_Scaled(ctx->CurrentServerDispatch, (x, y, z));
74196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Scaled), 8) / 8);
74296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
74396c5ddc4Srjs   return cmd_size;
74496c5ddc4Srjs}
74596c5ddc4Srjsvoid GLAPIENTRY
74696c5ddc4Srjs_mesa_marshal_Scaled(GLdouble x, GLdouble y, GLdouble z)
74796c5ddc4Srjs{
74896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
74996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Scaled);
75096c5ddc4Srjs   struct marshal_cmd_Scaled *cmd;
75196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Scaled, cmd_size);
75296c5ddc4Srjs   cmd->x = x;
75396c5ddc4Srjs   cmd->y = y;
75496c5ddc4Srjs   cmd->z = z;
75596c5ddc4Srjs}
75696c5ddc4Srjs
75796c5ddc4Srjs
75896c5ddc4Srjs/* Scalef: marshalled asynchronously */
75996c5ddc4Srjsstruct marshal_cmd_Scalef
76096c5ddc4Srjs{
76196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
76296c5ddc4Srjs   GLfloat x;
76396c5ddc4Srjs   GLfloat y;
76496c5ddc4Srjs   GLfloat z;
76596c5ddc4Srjs};
76696c5ddc4Srjsuint32_t
76796c5ddc4Srjs_mesa_unmarshal_Scalef(struct gl_context *ctx, const struct marshal_cmd_Scalef *cmd, const uint64_t *last)
76896c5ddc4Srjs{
76996c5ddc4Srjs   GLfloat x = cmd->x;
77096c5ddc4Srjs   GLfloat y = cmd->y;
77196c5ddc4Srjs   GLfloat z = cmd->z;
77296c5ddc4Srjs   CALL_Scalef(ctx->CurrentServerDispatch, (x, y, z));
77396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Scalef), 8) / 8);
77496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
77596c5ddc4Srjs   return cmd_size;
77696c5ddc4Srjs}
77796c5ddc4Srjsvoid GLAPIENTRY
77896c5ddc4Srjs_mesa_marshal_Scalef(GLfloat x, GLfloat y, GLfloat z)
77996c5ddc4Srjs{
78096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
78196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Scalef);
78296c5ddc4Srjs   struct marshal_cmd_Scalef *cmd;
78396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Scalef, cmd_size);
78496c5ddc4Srjs   cmd->x = x;
78596c5ddc4Srjs   cmd->y = y;
78696c5ddc4Srjs   cmd->z = z;
78796c5ddc4Srjs}
78896c5ddc4Srjs
78996c5ddc4Srjs
79096c5ddc4Srjs/* Translated: marshalled asynchronously */
79196c5ddc4Srjsstruct marshal_cmd_Translated
79296c5ddc4Srjs{
79396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
79496c5ddc4Srjs   GLdouble x;
79596c5ddc4Srjs   GLdouble y;
79696c5ddc4Srjs   GLdouble z;
79796c5ddc4Srjs};
79896c5ddc4Srjsuint32_t
79996c5ddc4Srjs_mesa_unmarshal_Translated(struct gl_context *ctx, const struct marshal_cmd_Translated *cmd, const uint64_t *last)
80096c5ddc4Srjs{
80196c5ddc4Srjs   GLdouble x = cmd->x;
80296c5ddc4Srjs   GLdouble y = cmd->y;
80396c5ddc4Srjs   GLdouble z = cmd->z;
80496c5ddc4Srjs   CALL_Translated(ctx->CurrentServerDispatch, (x, y, z));
80596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Translated), 8) / 8);
80696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
80796c5ddc4Srjs   return cmd_size;
80896c5ddc4Srjs}
80996c5ddc4Srjsvoid GLAPIENTRY
81096c5ddc4Srjs_mesa_marshal_Translated(GLdouble x, GLdouble y, GLdouble z)
81196c5ddc4Srjs{
81296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
81396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Translated);
81496c5ddc4Srjs   struct marshal_cmd_Translated *cmd;
81596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Translated, cmd_size);
81696c5ddc4Srjs   cmd->x = x;
81796c5ddc4Srjs   cmd->y = y;
81896c5ddc4Srjs   cmd->z = z;
81996c5ddc4Srjs}
82096c5ddc4Srjs
82196c5ddc4Srjs
82296c5ddc4Srjs/* Translatef: marshalled asynchronously */
82396c5ddc4Srjsstruct marshal_cmd_Translatef
82496c5ddc4Srjs{
82596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
82696c5ddc4Srjs   GLfloat x;
82796c5ddc4Srjs   GLfloat y;
82896c5ddc4Srjs   GLfloat z;
82996c5ddc4Srjs};
83096c5ddc4Srjsuint32_t
83196c5ddc4Srjs_mesa_unmarshal_Translatef(struct gl_context *ctx, const struct marshal_cmd_Translatef *cmd, const uint64_t *last)
83296c5ddc4Srjs{
83396c5ddc4Srjs   GLfloat x = cmd->x;
83496c5ddc4Srjs   GLfloat y = cmd->y;
83596c5ddc4Srjs   GLfloat z = cmd->z;
83696c5ddc4Srjs   CALL_Translatef(ctx->CurrentServerDispatch, (x, y, z));
83796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Translatef), 8) / 8);
83896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
83996c5ddc4Srjs   return cmd_size;
84096c5ddc4Srjs}
84196c5ddc4Srjsvoid GLAPIENTRY
84296c5ddc4Srjs_mesa_marshal_Translatef(GLfloat x, GLfloat y, GLfloat z)
84396c5ddc4Srjs{
84496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
84596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Translatef);
84696c5ddc4Srjs   struct marshal_cmd_Translatef *cmd;
84796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Translatef, cmd_size);
84896c5ddc4Srjs   cmd->x = x;
84996c5ddc4Srjs   cmd->y = y;
85096c5ddc4Srjs   cmd->z = z;
85196c5ddc4Srjs}
85296c5ddc4Srjs
85396c5ddc4Srjs
85496c5ddc4Srjs/* Viewport: marshalled asynchronously */
85596c5ddc4Srjsstruct marshal_cmd_Viewport
85696c5ddc4Srjs{
85796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
85896c5ddc4Srjs   GLint x;
85996c5ddc4Srjs   GLint y;
86096c5ddc4Srjs   GLsizei width;
86196c5ddc4Srjs   GLsizei height;
86296c5ddc4Srjs};
86396c5ddc4Srjsuint32_t
86496c5ddc4Srjs_mesa_unmarshal_Viewport(struct gl_context *ctx, const struct marshal_cmd_Viewport *cmd, const uint64_t *last)
86596c5ddc4Srjs{
86696c5ddc4Srjs   GLint x = cmd->x;
86796c5ddc4Srjs   GLint y = cmd->y;
86896c5ddc4Srjs   GLsizei width = cmd->width;
86996c5ddc4Srjs   GLsizei height = cmd->height;
87096c5ddc4Srjs   CALL_Viewport(ctx->CurrentServerDispatch, (x, y, width, height));
87196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Viewport), 8) / 8);
87296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
87396c5ddc4Srjs   return cmd_size;
87496c5ddc4Srjs}
87596c5ddc4Srjsvoid GLAPIENTRY
87696c5ddc4Srjs_mesa_marshal_Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
87796c5ddc4Srjs{
87896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
87996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Viewport);
88096c5ddc4Srjs   struct marshal_cmd_Viewport *cmd;
88196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Viewport, cmd_size);
88296c5ddc4Srjs   cmd->x = x;
88396c5ddc4Srjs   cmd->y = y;
88496c5ddc4Srjs   cmd->width = width;
88596c5ddc4Srjs   cmd->height = height;
88696c5ddc4Srjs}
88796c5ddc4Srjs
88896c5ddc4Srjs
88996c5ddc4Srjs/* ArrayElement: marshalled asynchronously */
89096c5ddc4Srjsstruct marshal_cmd_ArrayElement
89196c5ddc4Srjs{
89296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
89396c5ddc4Srjs   GLint i;
89496c5ddc4Srjs};
89596c5ddc4Srjsuint32_t
89696c5ddc4Srjs_mesa_unmarshal_ArrayElement(struct gl_context *ctx, const struct marshal_cmd_ArrayElement *cmd, const uint64_t *last)
89796c5ddc4Srjs{
89896c5ddc4Srjs   GLint i = cmd->i;
89996c5ddc4Srjs   CALL_ArrayElement(ctx->CurrentServerDispatch, (i));
90096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ArrayElement), 8) / 8);
90196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
90296c5ddc4Srjs   return cmd_size;
90396c5ddc4Srjs}
90496c5ddc4Srjsvoid GLAPIENTRY
90596c5ddc4Srjs_mesa_marshal_ArrayElement(GLint i)
90696c5ddc4Srjs{
90796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
90896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ArrayElement);
90996c5ddc4Srjs   struct marshal_cmd_ArrayElement *cmd;
91096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ArrayElement, cmd_size);
91196c5ddc4Srjs   cmd->i = i;
91296c5ddc4Srjs}
91396c5ddc4Srjs
91496c5ddc4Srjs
91596c5ddc4Srjs/* ColorPointer: marshalled asynchronously */
91696c5ddc4Srjsstruct marshal_cmd_ColorPointer
91796c5ddc4Srjs{
91896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
91996c5ddc4Srjs   GLint size;
92096c5ddc4Srjs   GLenum type;
92196c5ddc4Srjs   GLsizei stride;
92296c5ddc4Srjs   const GLvoid * pointer;
92396c5ddc4Srjs};
92496c5ddc4Srjsuint32_t
92596c5ddc4Srjs_mesa_unmarshal_ColorPointer(struct gl_context *ctx, const struct marshal_cmd_ColorPointer *cmd, const uint64_t *last)
92696c5ddc4Srjs{
92796c5ddc4Srjs   GLint size = cmd->size;
92896c5ddc4Srjs   GLenum type = cmd->type;
92996c5ddc4Srjs   GLsizei stride = cmd->stride;
93096c5ddc4Srjs   const GLvoid * pointer = cmd->pointer;
93196c5ddc4Srjs   CALL_ColorPointer(ctx->CurrentServerDispatch, (size, type, stride, pointer));
93296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ColorPointer), 8) / 8);
93396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
93496c5ddc4Srjs   return cmd_size;
93596c5ddc4Srjs}
93696c5ddc4Srjsvoid GLAPIENTRY
93796c5ddc4Srjs_mesa_marshal_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
93896c5ddc4Srjs{
93996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
94096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ColorPointer);
94196c5ddc4Srjs   struct marshal_cmd_ColorPointer *cmd;
94296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorPointer, cmd_size);
94396c5ddc4Srjs   cmd->size = size;
94496c5ddc4Srjs   cmd->type = type;
94596c5ddc4Srjs   cmd->stride = stride;
94696c5ddc4Srjs   cmd->pointer = pointer;
94796c5ddc4Srjs   if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR0, size, type, stride, pointer);
94896c5ddc4Srjs}
94996c5ddc4Srjs
95096c5ddc4Srjs
95196c5ddc4Srjs/* DisableClientState: marshalled asynchronously */
95296c5ddc4Srjsstruct marshal_cmd_DisableClientState
95396c5ddc4Srjs{
95496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
95596c5ddc4Srjs   GLenum array;
95696c5ddc4Srjs};
95796c5ddc4Srjsuint32_t
95896c5ddc4Srjs_mesa_unmarshal_DisableClientState(struct gl_context *ctx, const struct marshal_cmd_DisableClientState *cmd, const uint64_t *last)
95996c5ddc4Srjs{
96096c5ddc4Srjs   GLenum array = cmd->array;
96196c5ddc4Srjs   CALL_DisableClientState(ctx->CurrentServerDispatch, (array));
96296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DisableClientState), 8) / 8);
96396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
96496c5ddc4Srjs   return cmd_size;
96596c5ddc4Srjs}
96696c5ddc4Srjsvoid GLAPIENTRY
96796c5ddc4Srjs_mesa_marshal_DisableClientState(GLenum array)
96896c5ddc4Srjs{
96996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
97096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DisableClientState);
97196c5ddc4Srjs   struct marshal_cmd_DisableClientState *cmd;
97296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DisableClientState, cmd_size);
97396c5ddc4Srjs   cmd->array = array;
97496c5ddc4Srjs   if (COMPAT) _mesa_glthread_ClientState(ctx, NULL, _mesa_array_to_attrib(ctx, array), false);
97596c5ddc4Srjs}
97696c5ddc4Srjs
97796c5ddc4Srjs
97896c5ddc4Srjs/* EdgeFlagPointer: marshalled asynchronously */
97996c5ddc4Srjsstruct marshal_cmd_EdgeFlagPointer
98096c5ddc4Srjs{
98196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
98296c5ddc4Srjs   GLsizei stride;
98396c5ddc4Srjs   const GLvoid * pointer;
98496c5ddc4Srjs};
98596c5ddc4Srjsuint32_t
98696c5ddc4Srjs_mesa_unmarshal_EdgeFlagPointer(struct gl_context *ctx, const struct marshal_cmd_EdgeFlagPointer *cmd, const uint64_t *last)
98796c5ddc4Srjs{
98896c5ddc4Srjs   GLsizei stride = cmd->stride;
98996c5ddc4Srjs   const GLvoid * pointer = cmd->pointer;
99096c5ddc4Srjs   CALL_EdgeFlagPointer(ctx->CurrentServerDispatch, (stride, pointer));
99196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_EdgeFlagPointer), 8) / 8);
99296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
99396c5ddc4Srjs   return cmd_size;
99496c5ddc4Srjs}
99596c5ddc4Srjsvoid GLAPIENTRY
99696c5ddc4Srjs_mesa_marshal_EdgeFlagPointer(GLsizei stride, const GLvoid * pointer)
99796c5ddc4Srjs{
99896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
99996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_EdgeFlagPointer);
100096c5ddc4Srjs   struct marshal_cmd_EdgeFlagPointer *cmd;
100196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EdgeFlagPointer, cmd_size);
100296c5ddc4Srjs   cmd->stride = stride;
100396c5ddc4Srjs   cmd->pointer = pointer;
100496c5ddc4Srjs   if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_EDGEFLAG, 1, GL_UNSIGNED_BYTE, stride, pointer);
100596c5ddc4Srjs}
100696c5ddc4Srjs
100796c5ddc4Srjs
100896c5ddc4Srjs/* EnableClientState: marshalled asynchronously */
100996c5ddc4Srjsstruct marshal_cmd_EnableClientState
101096c5ddc4Srjs{
101196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
101296c5ddc4Srjs   GLenum array;
101396c5ddc4Srjs};
101496c5ddc4Srjsuint32_t
101596c5ddc4Srjs_mesa_unmarshal_EnableClientState(struct gl_context *ctx, const struct marshal_cmd_EnableClientState *cmd, const uint64_t *last)
101696c5ddc4Srjs{
101796c5ddc4Srjs   GLenum array = cmd->array;
101896c5ddc4Srjs   CALL_EnableClientState(ctx->CurrentServerDispatch, (array));
101996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_EnableClientState), 8) / 8);
102096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
102196c5ddc4Srjs   return cmd_size;
102296c5ddc4Srjs}
102396c5ddc4Srjsvoid GLAPIENTRY
102496c5ddc4Srjs_mesa_marshal_EnableClientState(GLenum array)
102596c5ddc4Srjs{
102696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
102796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_EnableClientState);
102896c5ddc4Srjs   struct marshal_cmd_EnableClientState *cmd;
102996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EnableClientState, cmd_size);
103096c5ddc4Srjs   cmd->array = array;
103196c5ddc4Srjs   if (COMPAT) _mesa_glthread_ClientState(ctx, NULL, _mesa_array_to_attrib(ctx, array), true);
103296c5ddc4Srjs}
103396c5ddc4Srjs
103496c5ddc4Srjs
103596c5ddc4Srjs/* GetPointerv: marshalled synchronously */
103696c5ddc4Srjsvoid GLAPIENTRY
103796c5ddc4Srjs_mesa_marshal_GetPointerv(GLenum pname, GLvoid ** params)
103896c5ddc4Srjs{
103996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
104096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetPointerv");
104196c5ddc4Srjs   CALL_GetPointerv(ctx->CurrentServerDispatch, (pname, params));
104296c5ddc4Srjs}
104396c5ddc4Srjs
104496c5ddc4Srjs
104596c5ddc4Srjs/* IndexPointer: marshalled asynchronously */
104696c5ddc4Srjsstruct marshal_cmd_IndexPointer
104796c5ddc4Srjs{
104896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
104996c5ddc4Srjs   GLenum type;
105096c5ddc4Srjs   GLsizei stride;
105196c5ddc4Srjs   const GLvoid * pointer;
105296c5ddc4Srjs};
105396c5ddc4Srjsuint32_t
105496c5ddc4Srjs_mesa_unmarshal_IndexPointer(struct gl_context *ctx, const struct marshal_cmd_IndexPointer *cmd, const uint64_t *last)
105596c5ddc4Srjs{
105696c5ddc4Srjs   GLenum type = cmd->type;
105796c5ddc4Srjs   GLsizei stride = cmd->stride;
105896c5ddc4Srjs   const GLvoid * pointer = cmd->pointer;
105996c5ddc4Srjs   CALL_IndexPointer(ctx->CurrentServerDispatch, (type, stride, pointer));
106096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_IndexPointer), 8) / 8);
106196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
106296c5ddc4Srjs   return cmd_size;
106396c5ddc4Srjs}
106496c5ddc4Srjsvoid GLAPIENTRY
106596c5ddc4Srjs_mesa_marshal_IndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer)
106696c5ddc4Srjs{
106796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
106896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_IndexPointer);
106996c5ddc4Srjs   struct marshal_cmd_IndexPointer *cmd;
107096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_IndexPointer, cmd_size);
107196c5ddc4Srjs   cmd->type = type;
107296c5ddc4Srjs   cmd->stride = stride;
107396c5ddc4Srjs   cmd->pointer = pointer;
107496c5ddc4Srjs   if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR_INDEX, 1, type, stride, pointer);
107596c5ddc4Srjs}
107696c5ddc4Srjs
107796c5ddc4Srjs
107896c5ddc4Srjs/* InterleavedArrays: marshalled asynchronously */
107996c5ddc4Srjsstruct marshal_cmd_InterleavedArrays
108096c5ddc4Srjs{
108196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
108296c5ddc4Srjs   GLenum format;
108396c5ddc4Srjs   GLsizei stride;
108496c5ddc4Srjs   const GLvoid * pointer;
108596c5ddc4Srjs};
108696c5ddc4Srjsuint32_t
108796c5ddc4Srjs_mesa_unmarshal_InterleavedArrays(struct gl_context *ctx, const struct marshal_cmd_InterleavedArrays *cmd, const uint64_t *last)
108896c5ddc4Srjs{
108996c5ddc4Srjs   GLenum format = cmd->format;
109096c5ddc4Srjs   GLsizei stride = cmd->stride;
109196c5ddc4Srjs   const GLvoid * pointer = cmd->pointer;
109296c5ddc4Srjs   CALL_InterleavedArrays(ctx->CurrentServerDispatch, (format, stride, pointer));
109396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_InterleavedArrays), 8) / 8);
109496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
109596c5ddc4Srjs   return cmd_size;
109696c5ddc4Srjs}
109796c5ddc4Srjsvoid GLAPIENTRY
109896c5ddc4Srjs_mesa_marshal_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid * pointer)
109996c5ddc4Srjs{
110096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
110196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_InterleavedArrays);
110296c5ddc4Srjs   struct marshal_cmd_InterleavedArrays *cmd;
110396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InterleavedArrays, cmd_size);
110496c5ddc4Srjs   cmd->format = format;
110596c5ddc4Srjs   cmd->stride = stride;
110696c5ddc4Srjs   cmd->pointer = pointer;
110796c5ddc4Srjs   _mesa_glthread_InterleavedArrays(ctx, format, stride, pointer);
110896c5ddc4Srjs}
110996c5ddc4Srjs
111096c5ddc4Srjs
111196c5ddc4Srjs/* NormalPointer: marshalled asynchronously */
111296c5ddc4Srjsstruct marshal_cmd_NormalPointer
111396c5ddc4Srjs{
111496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
111596c5ddc4Srjs   GLenum type;
111696c5ddc4Srjs   GLsizei stride;
111796c5ddc4Srjs   const GLvoid * pointer;
111896c5ddc4Srjs};
111996c5ddc4Srjsuint32_t
112096c5ddc4Srjs_mesa_unmarshal_NormalPointer(struct gl_context *ctx, const struct marshal_cmd_NormalPointer *cmd, const uint64_t *last)
112196c5ddc4Srjs{
112296c5ddc4Srjs   GLenum type = cmd->type;
112396c5ddc4Srjs   GLsizei stride = cmd->stride;
112496c5ddc4Srjs   const GLvoid * pointer = cmd->pointer;
112596c5ddc4Srjs   CALL_NormalPointer(ctx->CurrentServerDispatch, (type, stride, pointer));
112696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NormalPointer), 8) / 8);
112796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
112896c5ddc4Srjs   return cmd_size;
112996c5ddc4Srjs}
113096c5ddc4Srjsvoid GLAPIENTRY
113196c5ddc4Srjs_mesa_marshal_NormalPointer(GLenum type, GLsizei stride, const GLvoid * pointer)
113296c5ddc4Srjs{
113396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
113496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_NormalPointer);
113596c5ddc4Srjs   struct marshal_cmd_NormalPointer *cmd;
113696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NormalPointer, cmd_size);
113796c5ddc4Srjs   cmd->type = type;
113896c5ddc4Srjs   cmd->stride = stride;
113996c5ddc4Srjs   cmd->pointer = pointer;
114096c5ddc4Srjs   if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_NORMAL, 3, type, stride, pointer);
114196c5ddc4Srjs}
114296c5ddc4Srjs
114396c5ddc4Srjs
114496c5ddc4Srjs/* TexCoordPointer: marshalled asynchronously */
114596c5ddc4Srjsstruct marshal_cmd_TexCoordPointer
114696c5ddc4Srjs{
114796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
114896c5ddc4Srjs   GLint size;
114996c5ddc4Srjs   GLenum type;
115096c5ddc4Srjs   GLsizei stride;
115196c5ddc4Srjs   const GLvoid * pointer;
115296c5ddc4Srjs};
115396c5ddc4Srjsuint32_t
115496c5ddc4Srjs_mesa_unmarshal_TexCoordPointer(struct gl_context *ctx, const struct marshal_cmd_TexCoordPointer *cmd, const uint64_t *last)
115596c5ddc4Srjs{
115696c5ddc4Srjs   GLint size = cmd->size;
115796c5ddc4Srjs   GLenum type = cmd->type;
115896c5ddc4Srjs   GLsizei stride = cmd->stride;
115996c5ddc4Srjs   const GLvoid * pointer = cmd->pointer;
116096c5ddc4Srjs   CALL_TexCoordPointer(ctx->CurrentServerDispatch, (size, type, stride, pointer));
116196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordPointer), 8) / 8);
116296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
116396c5ddc4Srjs   return cmd_size;
116496c5ddc4Srjs}
116596c5ddc4Srjsvoid GLAPIENTRY
116696c5ddc4Srjs_mesa_marshal_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
116796c5ddc4Srjs{
116896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
116996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexCoordPointer);
117096c5ddc4Srjs   struct marshal_cmd_TexCoordPointer *cmd;
117196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordPointer, cmd_size);
117296c5ddc4Srjs   cmd->size = size;
117396c5ddc4Srjs   cmd->type = type;
117496c5ddc4Srjs   cmd->stride = stride;
117596c5ddc4Srjs   cmd->pointer = pointer;
117696c5ddc4Srjs   if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_TEX(ctx->GLThread.ClientActiveTexture), size, type, stride, pointer);
117796c5ddc4Srjs}
117896c5ddc4Srjs
117996c5ddc4Srjs
118096c5ddc4Srjs/* VertexPointer: marshalled asynchronously */
118196c5ddc4Srjsstruct marshal_cmd_VertexPointer
118296c5ddc4Srjs{
118396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
118496c5ddc4Srjs   GLint size;
118596c5ddc4Srjs   GLenum type;
118696c5ddc4Srjs   GLsizei stride;
118796c5ddc4Srjs   const GLvoid * pointer;
118896c5ddc4Srjs};
118996c5ddc4Srjsuint32_t
119096c5ddc4Srjs_mesa_unmarshal_VertexPointer(struct gl_context *ctx, const struct marshal_cmd_VertexPointer *cmd, const uint64_t *last)
119196c5ddc4Srjs{
119296c5ddc4Srjs   GLint size = cmd->size;
119396c5ddc4Srjs   GLenum type = cmd->type;
119496c5ddc4Srjs   GLsizei stride = cmd->stride;
119596c5ddc4Srjs   const GLvoid * pointer = cmd->pointer;
119696c5ddc4Srjs   CALL_VertexPointer(ctx->CurrentServerDispatch, (size, type, stride, pointer));
119796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexPointer), 8) / 8);
119896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
119996c5ddc4Srjs   return cmd_size;
120096c5ddc4Srjs}
120196c5ddc4Srjsvoid GLAPIENTRY
120296c5ddc4Srjs_mesa_marshal_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
120396c5ddc4Srjs{
120496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
120596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexPointer);
120696c5ddc4Srjs   struct marshal_cmd_VertexPointer *cmd;
120796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexPointer, cmd_size);
120896c5ddc4Srjs   cmd->size = size;
120996c5ddc4Srjs   cmd->type = type;
121096c5ddc4Srjs   cmd->stride = stride;
121196c5ddc4Srjs   cmd->pointer = pointer;
121296c5ddc4Srjs   if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_POS, size, type, stride, pointer);
121396c5ddc4Srjs}
121496c5ddc4Srjs
121596c5ddc4Srjs
121696c5ddc4Srjs/* PolygonOffset: marshalled asynchronously */
121796c5ddc4Srjsstruct marshal_cmd_PolygonOffset
121896c5ddc4Srjs{
121996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
122096c5ddc4Srjs   GLfloat factor;
122196c5ddc4Srjs   GLfloat units;
122296c5ddc4Srjs};
122396c5ddc4Srjsuint32_t
122496c5ddc4Srjs_mesa_unmarshal_PolygonOffset(struct gl_context *ctx, const struct marshal_cmd_PolygonOffset *cmd, const uint64_t *last)
122596c5ddc4Srjs{
122696c5ddc4Srjs   GLfloat factor = cmd->factor;
122796c5ddc4Srjs   GLfloat units = cmd->units;
122896c5ddc4Srjs   CALL_PolygonOffset(ctx->CurrentServerDispatch, (factor, units));
122996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PolygonOffset), 8) / 8);
123096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
123196c5ddc4Srjs   return cmd_size;
123296c5ddc4Srjs}
123396c5ddc4Srjsvoid GLAPIENTRY
123496c5ddc4Srjs_mesa_marshal_PolygonOffset(GLfloat factor, GLfloat units)
123596c5ddc4Srjs{
123696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
123796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_PolygonOffset);
123896c5ddc4Srjs   struct marshal_cmd_PolygonOffset *cmd;
123996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PolygonOffset, cmd_size);
124096c5ddc4Srjs   cmd->factor = factor;
124196c5ddc4Srjs   cmd->units = units;
124296c5ddc4Srjs}
124396c5ddc4Srjs
124496c5ddc4Srjs
124596c5ddc4Srjs/* CopyTexImage1D: marshalled asynchronously */
124696c5ddc4Srjsstruct marshal_cmd_CopyTexImage1D
124796c5ddc4Srjs{
124896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
124996c5ddc4Srjs   GLenum target;
125096c5ddc4Srjs   GLint level;
125196c5ddc4Srjs   GLenum internalformat;
125296c5ddc4Srjs   GLint x;
125396c5ddc4Srjs   GLint y;
125496c5ddc4Srjs   GLsizei width;
125596c5ddc4Srjs   GLint border;
125696c5ddc4Srjs};
125796c5ddc4Srjsuint32_t
125896c5ddc4Srjs_mesa_unmarshal_CopyTexImage1D(struct gl_context *ctx, const struct marshal_cmd_CopyTexImage1D *cmd, const uint64_t *last)
125996c5ddc4Srjs{
126096c5ddc4Srjs   GLenum target = cmd->target;
126196c5ddc4Srjs   GLint level = cmd->level;
126296c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
126396c5ddc4Srjs   GLint x = cmd->x;
126496c5ddc4Srjs   GLint y = cmd->y;
126596c5ddc4Srjs   GLsizei width = cmd->width;
126696c5ddc4Srjs   GLint border = cmd->border;
126796c5ddc4Srjs   CALL_CopyTexImage1D(ctx->CurrentServerDispatch, (target, level, internalformat, x, y, width, border));
126896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CopyTexImage1D), 8) / 8);
126996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
127096c5ddc4Srjs   return cmd_size;
127196c5ddc4Srjs}
127296c5ddc4Srjsvoid GLAPIENTRY
127396c5ddc4Srjs_mesa_marshal_CopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
127496c5ddc4Srjs{
127596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
127696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CopyTexImage1D);
127796c5ddc4Srjs   struct marshal_cmd_CopyTexImage1D *cmd;
127896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyTexImage1D, cmd_size);
127996c5ddc4Srjs   cmd->target = target;
128096c5ddc4Srjs   cmd->level = level;
128196c5ddc4Srjs   cmd->internalformat = internalformat;
128296c5ddc4Srjs   cmd->x = x;
128396c5ddc4Srjs   cmd->y = y;
128496c5ddc4Srjs   cmd->width = width;
128596c5ddc4Srjs   cmd->border = border;
128696c5ddc4Srjs}
128796c5ddc4Srjs
128896c5ddc4Srjs
128996c5ddc4Srjs/* CopyTexImage2D: marshalled asynchronously */
129096c5ddc4Srjsstruct marshal_cmd_CopyTexImage2D
129196c5ddc4Srjs{
129296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
129396c5ddc4Srjs   GLenum target;
129496c5ddc4Srjs   GLint level;
129596c5ddc4Srjs   GLenum internalformat;
129696c5ddc4Srjs   GLint x;
129796c5ddc4Srjs   GLint y;
129896c5ddc4Srjs   GLsizei width;
129996c5ddc4Srjs   GLsizei height;
130096c5ddc4Srjs   GLint border;
130196c5ddc4Srjs};
130296c5ddc4Srjsuint32_t
130396c5ddc4Srjs_mesa_unmarshal_CopyTexImage2D(struct gl_context *ctx, const struct marshal_cmd_CopyTexImage2D *cmd, const uint64_t *last)
130496c5ddc4Srjs{
130596c5ddc4Srjs   GLenum target = cmd->target;
130696c5ddc4Srjs   GLint level = cmd->level;
130796c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
130896c5ddc4Srjs   GLint x = cmd->x;
130996c5ddc4Srjs   GLint y = cmd->y;
131096c5ddc4Srjs   GLsizei width = cmd->width;
131196c5ddc4Srjs   GLsizei height = cmd->height;
131296c5ddc4Srjs   GLint border = cmd->border;
131396c5ddc4Srjs   CALL_CopyTexImage2D(ctx->CurrentServerDispatch, (target, level, internalformat, x, y, width, height, border));
131496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CopyTexImage2D), 8) / 8);
131596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
131696c5ddc4Srjs   return cmd_size;
131796c5ddc4Srjs}
131896c5ddc4Srjsvoid GLAPIENTRY
131996c5ddc4Srjs_mesa_marshal_CopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
132096c5ddc4Srjs{
132196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
132296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CopyTexImage2D);
132396c5ddc4Srjs   struct marshal_cmd_CopyTexImage2D *cmd;
132496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyTexImage2D, cmd_size);
132596c5ddc4Srjs   cmd->target = target;
132696c5ddc4Srjs   cmd->level = level;
132796c5ddc4Srjs   cmd->internalformat = internalformat;
132896c5ddc4Srjs   cmd->x = x;
132996c5ddc4Srjs   cmd->y = y;
133096c5ddc4Srjs   cmd->width = width;
133196c5ddc4Srjs   cmd->height = height;
133296c5ddc4Srjs   cmd->border = border;
133396c5ddc4Srjs}
133496c5ddc4Srjs
133596c5ddc4Srjs
133696c5ddc4Srjs/* CopyTexSubImage1D: marshalled asynchronously */
133796c5ddc4Srjsstruct marshal_cmd_CopyTexSubImage1D
133896c5ddc4Srjs{
133996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
134096c5ddc4Srjs   GLenum target;
134196c5ddc4Srjs   GLint level;
134296c5ddc4Srjs   GLint xoffset;
134396c5ddc4Srjs   GLint x;
134496c5ddc4Srjs   GLint y;
134596c5ddc4Srjs   GLsizei width;
134696c5ddc4Srjs};
134796c5ddc4Srjsuint32_t
134896c5ddc4Srjs_mesa_unmarshal_CopyTexSubImage1D(struct gl_context *ctx, const struct marshal_cmd_CopyTexSubImage1D *cmd, const uint64_t *last)
134996c5ddc4Srjs{
135096c5ddc4Srjs   GLenum target = cmd->target;
135196c5ddc4Srjs   GLint level = cmd->level;
135296c5ddc4Srjs   GLint xoffset = cmd->xoffset;
135396c5ddc4Srjs   GLint x = cmd->x;
135496c5ddc4Srjs   GLint y = cmd->y;
135596c5ddc4Srjs   GLsizei width = cmd->width;
135696c5ddc4Srjs   CALL_CopyTexSubImage1D(ctx->CurrentServerDispatch, (target, level, xoffset, x, y, width));
135796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CopyTexSubImage1D), 8) / 8);
135896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
135996c5ddc4Srjs   return cmd_size;
136096c5ddc4Srjs}
136196c5ddc4Srjsvoid GLAPIENTRY
136296c5ddc4Srjs_mesa_marshal_CopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
136396c5ddc4Srjs{
136496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
136596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CopyTexSubImage1D);
136696c5ddc4Srjs   struct marshal_cmd_CopyTexSubImage1D *cmd;
136796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyTexSubImage1D, cmd_size);
136896c5ddc4Srjs   cmd->target = target;
136996c5ddc4Srjs   cmd->level = level;
137096c5ddc4Srjs   cmd->xoffset = xoffset;
137196c5ddc4Srjs   cmd->x = x;
137296c5ddc4Srjs   cmd->y = y;
137396c5ddc4Srjs   cmd->width = width;
137496c5ddc4Srjs}
137596c5ddc4Srjs
137696c5ddc4Srjs
137796c5ddc4Srjs/* CopyTexSubImage2D: marshalled asynchronously */
137896c5ddc4Srjsstruct marshal_cmd_CopyTexSubImage2D
137996c5ddc4Srjs{
138096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
138196c5ddc4Srjs   GLenum target;
138296c5ddc4Srjs   GLint level;
138396c5ddc4Srjs   GLint xoffset;
138496c5ddc4Srjs   GLint yoffset;
138596c5ddc4Srjs   GLint x;
138696c5ddc4Srjs   GLint y;
138796c5ddc4Srjs   GLsizei width;
138896c5ddc4Srjs   GLsizei height;
138996c5ddc4Srjs};
139096c5ddc4Srjsuint32_t
139196c5ddc4Srjs_mesa_unmarshal_CopyTexSubImage2D(struct gl_context *ctx, const struct marshal_cmd_CopyTexSubImage2D *cmd, const uint64_t *last)
139296c5ddc4Srjs{
139396c5ddc4Srjs   GLenum target = cmd->target;
139496c5ddc4Srjs   GLint level = cmd->level;
139596c5ddc4Srjs   GLint xoffset = cmd->xoffset;
139696c5ddc4Srjs   GLint yoffset = cmd->yoffset;
139796c5ddc4Srjs   GLint x = cmd->x;
139896c5ddc4Srjs   GLint y = cmd->y;
139996c5ddc4Srjs   GLsizei width = cmd->width;
140096c5ddc4Srjs   GLsizei height = cmd->height;
140196c5ddc4Srjs   CALL_CopyTexSubImage2D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, x, y, width, height));
140296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CopyTexSubImage2D), 8) / 8);
140396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
140496c5ddc4Srjs   return cmd_size;
140596c5ddc4Srjs}
140696c5ddc4Srjsvoid GLAPIENTRY
140796c5ddc4Srjs_mesa_marshal_CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
140896c5ddc4Srjs{
140996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
141096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CopyTexSubImage2D);
141196c5ddc4Srjs   struct marshal_cmd_CopyTexSubImage2D *cmd;
141296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyTexSubImage2D, cmd_size);
141396c5ddc4Srjs   cmd->target = target;
141496c5ddc4Srjs   cmd->level = level;
141596c5ddc4Srjs   cmd->xoffset = xoffset;
141696c5ddc4Srjs   cmd->yoffset = yoffset;
141796c5ddc4Srjs   cmd->x = x;
141896c5ddc4Srjs   cmd->y = y;
141996c5ddc4Srjs   cmd->width = width;
142096c5ddc4Srjs   cmd->height = height;
142196c5ddc4Srjs}
142296c5ddc4Srjs
142396c5ddc4Srjs
142496c5ddc4Srjs/* TexSubImage1D: marshalled asynchronously */
142596c5ddc4Srjsstruct marshal_cmd_TexSubImage1D
142696c5ddc4Srjs{
142796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
142896c5ddc4Srjs   GLenum target;
142996c5ddc4Srjs   GLint level;
143096c5ddc4Srjs   GLint xoffset;
143196c5ddc4Srjs   GLsizei width;
143296c5ddc4Srjs   GLenum format;
143396c5ddc4Srjs   GLenum type;
143496c5ddc4Srjs   const GLvoid * pixels;
143596c5ddc4Srjs};
143696c5ddc4Srjsuint32_t
143796c5ddc4Srjs_mesa_unmarshal_TexSubImage1D(struct gl_context *ctx, const struct marshal_cmd_TexSubImage1D *cmd, const uint64_t *last)
143896c5ddc4Srjs{
143996c5ddc4Srjs   GLenum target = cmd->target;
144096c5ddc4Srjs   GLint level = cmd->level;
144196c5ddc4Srjs   GLint xoffset = cmd->xoffset;
144296c5ddc4Srjs   GLsizei width = cmd->width;
144396c5ddc4Srjs   GLenum format = cmd->format;
144496c5ddc4Srjs   GLenum type = cmd->type;
144596c5ddc4Srjs   const GLvoid * pixels = cmd->pixels;
144696c5ddc4Srjs   CALL_TexSubImage1D(ctx->CurrentServerDispatch, (target, level, xoffset, width, format, type, pixels));
144796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexSubImage1D), 8) / 8);
144896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
144996c5ddc4Srjs   return cmd_size;
145096c5ddc4Srjs}
145196c5ddc4Srjsvoid GLAPIENTRY
145296c5ddc4Srjs_mesa_marshal_TexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels)
145396c5ddc4Srjs{
145496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
145596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexSubImage1D);
145696c5ddc4Srjs   struct marshal_cmd_TexSubImage1D *cmd;
145796c5ddc4Srjs   if (_mesa_glthread_has_no_unpack_buffer(ctx)) {
145896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "TexSubImage1D");
145996c5ddc4Srjs      CALL_TexSubImage1D(ctx->CurrentServerDispatch, (target, level, xoffset, width, format, type, pixels));
146096c5ddc4Srjs      return;
146196c5ddc4Srjs   }
146296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexSubImage1D, cmd_size);
146396c5ddc4Srjs   cmd->target = target;
146496c5ddc4Srjs   cmd->level = level;
146596c5ddc4Srjs   cmd->xoffset = xoffset;
146696c5ddc4Srjs   cmd->width = width;
146796c5ddc4Srjs   cmd->format = format;
146896c5ddc4Srjs   cmd->type = type;
146996c5ddc4Srjs   cmd->pixels = pixels;
147096c5ddc4Srjs}
147196c5ddc4Srjs
147296c5ddc4Srjs
147396c5ddc4Srjs/* TexSubImage2D: marshalled asynchronously */
147496c5ddc4Srjsstruct marshal_cmd_TexSubImage2D
147596c5ddc4Srjs{
147696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
147796c5ddc4Srjs   GLenum target;
147896c5ddc4Srjs   GLint level;
147996c5ddc4Srjs   GLint xoffset;
148096c5ddc4Srjs   GLint yoffset;
148196c5ddc4Srjs   GLsizei width;
148296c5ddc4Srjs   GLsizei height;
148396c5ddc4Srjs   GLenum format;
148496c5ddc4Srjs   GLenum type;
148596c5ddc4Srjs   const GLvoid * pixels;
148696c5ddc4Srjs};
148796c5ddc4Srjsuint32_t
148896c5ddc4Srjs_mesa_unmarshal_TexSubImage2D(struct gl_context *ctx, const struct marshal_cmd_TexSubImage2D *cmd, const uint64_t *last)
148996c5ddc4Srjs{
149096c5ddc4Srjs   GLenum target = cmd->target;
149196c5ddc4Srjs   GLint level = cmd->level;
149296c5ddc4Srjs   GLint xoffset = cmd->xoffset;
149396c5ddc4Srjs   GLint yoffset = cmd->yoffset;
149496c5ddc4Srjs   GLsizei width = cmd->width;
149596c5ddc4Srjs   GLsizei height = cmd->height;
149696c5ddc4Srjs   GLenum format = cmd->format;
149796c5ddc4Srjs   GLenum type = cmd->type;
149896c5ddc4Srjs   const GLvoid * pixels = cmd->pixels;
149996c5ddc4Srjs   CALL_TexSubImage2D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, width, height, format, type, pixels));
150096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexSubImage2D), 8) / 8);
150196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
150296c5ddc4Srjs   return cmd_size;
150396c5ddc4Srjs}
150496c5ddc4Srjsvoid GLAPIENTRY
150596c5ddc4Srjs_mesa_marshal_TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
150696c5ddc4Srjs{
150796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
150896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexSubImage2D);
150996c5ddc4Srjs   struct marshal_cmd_TexSubImage2D *cmd;
151096c5ddc4Srjs   if (_mesa_glthread_has_no_unpack_buffer(ctx)) {
151196c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "TexSubImage2D");
151296c5ddc4Srjs      CALL_TexSubImage2D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, width, height, format, type, pixels));
151396c5ddc4Srjs      return;
151496c5ddc4Srjs   }
151596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexSubImage2D, cmd_size);
151696c5ddc4Srjs   cmd->target = target;
151796c5ddc4Srjs   cmd->level = level;
151896c5ddc4Srjs   cmd->xoffset = xoffset;
151996c5ddc4Srjs   cmd->yoffset = yoffset;
152096c5ddc4Srjs   cmd->width = width;
152196c5ddc4Srjs   cmd->height = height;
152296c5ddc4Srjs   cmd->format = format;
152396c5ddc4Srjs   cmd->type = type;
152496c5ddc4Srjs   cmd->pixels = pixels;
152596c5ddc4Srjs}
152696c5ddc4Srjs
152796c5ddc4Srjs
152896c5ddc4Srjs/* AreTexturesResident: marshalled synchronously */
152996c5ddc4SrjsGLboolean GLAPIENTRY
153096c5ddc4Srjs_mesa_marshal_AreTexturesResident(GLsizei n, const GLuint * textures, GLboolean * residences)
153196c5ddc4Srjs{
153296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
153396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "AreTexturesResident");
153496c5ddc4Srjs   return CALL_AreTexturesResident(ctx->CurrentServerDispatch, (n, textures, residences));
153596c5ddc4Srjs}
153696c5ddc4Srjs
153796c5ddc4Srjs
153896c5ddc4Srjs/* BindTexture: marshalled asynchronously */
153996c5ddc4Srjsstruct marshal_cmd_BindTexture
154096c5ddc4Srjs{
154196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
154296c5ddc4Srjs   GLenum target;
154396c5ddc4Srjs   GLuint texture;
154496c5ddc4Srjs};
154596c5ddc4Srjsuint32_t
154696c5ddc4Srjs_mesa_unmarshal_BindTexture(struct gl_context *ctx, const struct marshal_cmd_BindTexture *cmd, const uint64_t *last)
154796c5ddc4Srjs{
154896c5ddc4Srjs   GLenum target = cmd->target;
154996c5ddc4Srjs   GLuint texture = cmd->texture;
155096c5ddc4Srjs   CALL_BindTexture(ctx->CurrentServerDispatch, (target, texture));
155196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindTexture), 8) / 8);
155296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
155396c5ddc4Srjs   return cmd_size;
155496c5ddc4Srjs}
155596c5ddc4Srjsvoid GLAPIENTRY
155696c5ddc4Srjs_mesa_marshal_BindTexture(GLenum target, GLuint texture)
155796c5ddc4Srjs{
155896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
155996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindTexture);
156096c5ddc4Srjs   struct marshal_cmd_BindTexture *cmd;
156196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindTexture, cmd_size);
156296c5ddc4Srjs   cmd->target = target;
156396c5ddc4Srjs   cmd->texture = texture;
156496c5ddc4Srjs}
156596c5ddc4Srjs
156696c5ddc4Srjs
156796c5ddc4Srjs/* DeleteTextures: marshalled asynchronously */
156896c5ddc4Srjsstruct marshal_cmd_DeleteTextures
156996c5ddc4Srjs{
157096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
157196c5ddc4Srjs   GLsizei n;
157296c5ddc4Srjs   /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint textures[n] */
157396c5ddc4Srjs};
157496c5ddc4Srjsuint32_t
157596c5ddc4Srjs_mesa_unmarshal_DeleteTextures(struct gl_context *ctx, const struct marshal_cmd_DeleteTextures *cmd, const uint64_t *last)
157696c5ddc4Srjs{
157796c5ddc4Srjs   GLsizei n = cmd->n;
157896c5ddc4Srjs   GLuint * textures;
157996c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
158096c5ddc4Srjs   textures = (GLuint *) variable_data;
158196c5ddc4Srjs   CALL_DeleteTextures(ctx->CurrentServerDispatch, (n, textures));
158296c5ddc4Srjs   return cmd->cmd_base.cmd_size;
158396c5ddc4Srjs}
158496c5ddc4Srjsvoid GLAPIENTRY
158596c5ddc4Srjs_mesa_marshal_DeleteTextures(GLsizei n, const GLuint * textures)
158696c5ddc4Srjs{
158796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
158896c5ddc4Srjs   int textures_size = safe_mul(n, 1 * sizeof(GLuint));
158996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DeleteTextures) + textures_size;
159096c5ddc4Srjs   struct marshal_cmd_DeleteTextures *cmd;
159196c5ddc4Srjs   if (unlikely(textures_size < 0 || (textures_size > 0 && !textures) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
159296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "DeleteTextures");
159396c5ddc4Srjs      CALL_DeleteTextures(ctx->CurrentServerDispatch, (n, textures));
159496c5ddc4Srjs      return;
159596c5ddc4Srjs   }
159696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteTextures, cmd_size);
159796c5ddc4Srjs   cmd->n = n;
159896c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
159996c5ddc4Srjs   memcpy(variable_data, textures, textures_size);
160096c5ddc4Srjs}
160196c5ddc4Srjs
160296c5ddc4Srjs
160396c5ddc4Srjs/* GenTextures: marshalled synchronously */
160496c5ddc4Srjsvoid GLAPIENTRY
160596c5ddc4Srjs_mesa_marshal_GenTextures(GLsizei n, GLuint * textures)
160696c5ddc4Srjs{
160796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
160896c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GenTextures");
160996c5ddc4Srjs   CALL_GenTextures(ctx->CurrentServerDispatch, (n, textures));
161096c5ddc4Srjs}
161196c5ddc4Srjs
161296c5ddc4Srjs
161396c5ddc4Srjs/* IsTexture: marshalled synchronously */
161496c5ddc4SrjsGLboolean GLAPIENTRY
161596c5ddc4Srjs_mesa_marshal_IsTexture(GLuint texture)
161696c5ddc4Srjs{
161796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
161896c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsTexture");
161996c5ddc4Srjs   return CALL_IsTexture(ctx->CurrentServerDispatch, (texture));
162096c5ddc4Srjs}
162196c5ddc4Srjs
162296c5ddc4Srjs
162396c5ddc4Srjs/* PrioritizeTextures: marshalled asynchronously */
162496c5ddc4Srjsstruct marshal_cmd_PrioritizeTextures
162596c5ddc4Srjs{
162696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
162796c5ddc4Srjs   GLsizei n;
162896c5ddc4Srjs   /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint textures[n] */
162996c5ddc4Srjs   /* Next safe_mul(n, 1 * sizeof(GLclampf)) bytes are GLclampf priorities[n] */
163096c5ddc4Srjs};
163196c5ddc4Srjsuint32_t
163296c5ddc4Srjs_mesa_unmarshal_PrioritizeTextures(struct gl_context *ctx, const struct marshal_cmd_PrioritizeTextures *cmd, const uint64_t *last)
163396c5ddc4Srjs{
163496c5ddc4Srjs   GLsizei n = cmd->n;
163596c5ddc4Srjs   GLuint * textures;
163696c5ddc4Srjs   GLclampf * priorities;
163796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
163896c5ddc4Srjs   textures = (GLuint *) variable_data;
163996c5ddc4Srjs   variable_data += n * 1 * sizeof(GLuint);
164096c5ddc4Srjs   priorities = (GLclampf *) variable_data;
164196c5ddc4Srjs   CALL_PrioritizeTextures(ctx->CurrentServerDispatch, (n, textures, priorities));
164296c5ddc4Srjs   return cmd->cmd_base.cmd_size;
164396c5ddc4Srjs}
164496c5ddc4Srjsvoid GLAPIENTRY
164596c5ddc4Srjs_mesa_marshal_PrioritizeTextures(GLsizei n, const GLuint * textures, const GLclampf * priorities)
164696c5ddc4Srjs{
164796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
164896c5ddc4Srjs   int textures_size = safe_mul(n, 1 * sizeof(GLuint));
164996c5ddc4Srjs   int priorities_size = safe_mul(n, 1 * sizeof(GLclampf));
165096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_PrioritizeTextures) + textures_size + priorities_size;
165196c5ddc4Srjs   struct marshal_cmd_PrioritizeTextures *cmd;
165296c5ddc4Srjs   if (unlikely(textures_size < 0 || (textures_size > 0 && !textures) || priorities_size < 0 || (priorities_size > 0 && !priorities) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
165396c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "PrioritizeTextures");
165496c5ddc4Srjs      CALL_PrioritizeTextures(ctx->CurrentServerDispatch, (n, textures, priorities));
165596c5ddc4Srjs      return;
165696c5ddc4Srjs   }
165796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PrioritizeTextures, cmd_size);
165896c5ddc4Srjs   cmd->n = n;
165996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
166096c5ddc4Srjs   memcpy(variable_data, textures, textures_size);
166196c5ddc4Srjs   variable_data += textures_size;
166296c5ddc4Srjs   memcpy(variable_data, priorities, priorities_size);
166396c5ddc4Srjs}
166496c5ddc4Srjs
166596c5ddc4Srjs
166696c5ddc4Srjs/* Indexub: marshalled asynchronously */
166796c5ddc4Srjsstruct marshal_cmd_Indexub
166896c5ddc4Srjs{
166996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
167096c5ddc4Srjs   GLubyte c;
167196c5ddc4Srjs};
167296c5ddc4Srjsuint32_t
167396c5ddc4Srjs_mesa_unmarshal_Indexub(struct gl_context *ctx, const struct marshal_cmd_Indexub *cmd, const uint64_t *last)
167496c5ddc4Srjs{
167596c5ddc4Srjs   GLubyte c = cmd->c;
167696c5ddc4Srjs   CALL_Indexub(ctx->CurrentServerDispatch, (c));
167796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Indexub), 8) / 8);
167896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
167996c5ddc4Srjs   return cmd_size;
168096c5ddc4Srjs}
168196c5ddc4Srjsvoid GLAPIENTRY
168296c5ddc4Srjs_mesa_marshal_Indexub(GLubyte c)
168396c5ddc4Srjs{
168496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
168596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Indexub);
168696c5ddc4Srjs   struct marshal_cmd_Indexub *cmd;
168796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Indexub, cmd_size);
168896c5ddc4Srjs   cmd->c = c;
168996c5ddc4Srjs}
169096c5ddc4Srjs
169196c5ddc4Srjs
169296c5ddc4Srjs/* Indexubv: marshalled asynchronously */
169396c5ddc4Srjsstruct marshal_cmd_Indexubv
169496c5ddc4Srjs{
169596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
169696c5ddc4Srjs   GLubyte c[1];
169796c5ddc4Srjs};
169896c5ddc4Srjsuint32_t
169996c5ddc4Srjs_mesa_unmarshal_Indexubv(struct gl_context *ctx, const struct marshal_cmd_Indexubv *cmd, const uint64_t *last)
170096c5ddc4Srjs{
170196c5ddc4Srjs   const GLubyte * c = cmd->c;
170296c5ddc4Srjs   CALL_Indexubv(ctx->CurrentServerDispatch, (c));
170396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Indexubv), 8) / 8);
170496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
170596c5ddc4Srjs   return cmd_size;
170696c5ddc4Srjs}
170796c5ddc4Srjsvoid GLAPIENTRY
170896c5ddc4Srjs_mesa_marshal_Indexubv(const GLubyte * c)
170996c5ddc4Srjs{
171096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
171196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Indexubv);
171296c5ddc4Srjs   struct marshal_cmd_Indexubv *cmd;
171396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Indexubv, cmd_size);
171496c5ddc4Srjs   memcpy(cmd->c, c, 1 * sizeof(GLubyte));
171596c5ddc4Srjs}
171696c5ddc4Srjs
171796c5ddc4Srjs
171896c5ddc4Srjs/* PopClientAttrib: marshalled asynchronously */
171996c5ddc4Srjsstruct marshal_cmd_PopClientAttrib
172096c5ddc4Srjs{
172196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
172296c5ddc4Srjs};
172396c5ddc4Srjsuint32_t
172496c5ddc4Srjs_mesa_unmarshal_PopClientAttrib(struct gl_context *ctx, const struct marshal_cmd_PopClientAttrib *cmd, const uint64_t *last)
172596c5ddc4Srjs{
172696c5ddc4Srjs   CALL_PopClientAttrib(ctx->CurrentServerDispatch, ());
172796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PopClientAttrib), 8) / 8);
172896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
172996c5ddc4Srjs   return cmd_size;
173096c5ddc4Srjs}
173196c5ddc4Srjsvoid GLAPIENTRY
173296c5ddc4Srjs_mesa_marshal_PopClientAttrib(void)
173396c5ddc4Srjs{
173496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
173596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_PopClientAttrib);
173696c5ddc4Srjs   struct marshal_cmd_PopClientAttrib *cmd;
173796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PopClientAttrib, cmd_size);
173896c5ddc4Srjs   (void) cmd;
173996c5ddc4Srjs   _mesa_glthread_PopClientAttrib(ctx);
174096c5ddc4Srjs}
174196c5ddc4Srjs
174296c5ddc4Srjs
174396c5ddc4Srjs/* PushClientAttrib: marshalled asynchronously */
174496c5ddc4Srjsstruct marshal_cmd_PushClientAttrib
174596c5ddc4Srjs{
174696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
174796c5ddc4Srjs   GLbitfield mask;
174896c5ddc4Srjs};
174996c5ddc4Srjsuint32_t
175096c5ddc4Srjs_mesa_unmarshal_PushClientAttrib(struct gl_context *ctx, const struct marshal_cmd_PushClientAttrib *cmd, const uint64_t *last)
175196c5ddc4Srjs{
175296c5ddc4Srjs   GLbitfield mask = cmd->mask;
175396c5ddc4Srjs   CALL_PushClientAttrib(ctx->CurrentServerDispatch, (mask));
175496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PushClientAttrib), 8) / 8);
175596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
175696c5ddc4Srjs   return cmd_size;
175796c5ddc4Srjs}
175896c5ddc4Srjsvoid GLAPIENTRY
175996c5ddc4Srjs_mesa_marshal_PushClientAttrib(GLbitfield mask)
176096c5ddc4Srjs{
176196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
176296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_PushClientAttrib);
176396c5ddc4Srjs   struct marshal_cmd_PushClientAttrib *cmd;
176496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PushClientAttrib, cmd_size);
176596c5ddc4Srjs   cmd->mask = mask;
176696c5ddc4Srjs   _mesa_glthread_PushClientAttrib(ctx, mask, false);
176796c5ddc4Srjs}
176896c5ddc4Srjs
176996c5ddc4Srjs
177096c5ddc4Srjs/* BlendColor: marshalled asynchronously */
177196c5ddc4Srjsstruct marshal_cmd_BlendColor
177296c5ddc4Srjs{
177396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
177496c5ddc4Srjs   GLclampf red;
177596c5ddc4Srjs   GLclampf green;
177696c5ddc4Srjs   GLclampf blue;
177796c5ddc4Srjs   GLclampf alpha;
177896c5ddc4Srjs};
177996c5ddc4Srjsuint32_t
178096c5ddc4Srjs_mesa_unmarshal_BlendColor(struct gl_context *ctx, const struct marshal_cmd_BlendColor *cmd, const uint64_t *last)
178196c5ddc4Srjs{
178296c5ddc4Srjs   GLclampf red = cmd->red;
178396c5ddc4Srjs   GLclampf green = cmd->green;
178496c5ddc4Srjs   GLclampf blue = cmd->blue;
178596c5ddc4Srjs   GLclampf alpha = cmd->alpha;
178696c5ddc4Srjs   CALL_BlendColor(ctx->CurrentServerDispatch, (red, green, blue, alpha));
178796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BlendColor), 8) / 8);
178896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
178996c5ddc4Srjs   return cmd_size;
179096c5ddc4Srjs}
179196c5ddc4Srjsvoid GLAPIENTRY
179296c5ddc4Srjs_mesa_marshal_BlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
179396c5ddc4Srjs{
179496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
179596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BlendColor);
179696c5ddc4Srjs   struct marshal_cmd_BlendColor *cmd;
179796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendColor, cmd_size);
179896c5ddc4Srjs   cmd->red = red;
179996c5ddc4Srjs   cmd->green = green;
180096c5ddc4Srjs   cmd->blue = blue;
180196c5ddc4Srjs   cmd->alpha = alpha;
180296c5ddc4Srjs}
180396c5ddc4Srjs
180496c5ddc4Srjs
180596c5ddc4Srjs/* BlendEquation: marshalled asynchronously */
180696c5ddc4Srjsstruct marshal_cmd_BlendEquation
180796c5ddc4Srjs{
180896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
180996c5ddc4Srjs   GLenum mode;
181096c5ddc4Srjs};
181196c5ddc4Srjsuint32_t
181296c5ddc4Srjs_mesa_unmarshal_BlendEquation(struct gl_context *ctx, const struct marshal_cmd_BlendEquation *cmd, const uint64_t *last)
181396c5ddc4Srjs{
181496c5ddc4Srjs   GLenum mode = cmd->mode;
181596c5ddc4Srjs   CALL_BlendEquation(ctx->CurrentServerDispatch, (mode));
181696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BlendEquation), 8) / 8);
181796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
181896c5ddc4Srjs   return cmd_size;
181996c5ddc4Srjs}
182096c5ddc4Srjsvoid GLAPIENTRY
182196c5ddc4Srjs_mesa_marshal_BlendEquation(GLenum mode)
182296c5ddc4Srjs{
182396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
182496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BlendEquation);
182596c5ddc4Srjs   struct marshal_cmd_BlendEquation *cmd;
182696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendEquation, cmd_size);
182796c5ddc4Srjs   cmd->mode = mode;
182896c5ddc4Srjs}
182996c5ddc4Srjs
183096c5ddc4Srjs
183196c5ddc4Srjs/* ColorTable: marshalled synchronously */
183296c5ddc4Srjsvoid GLAPIENTRY
183396c5ddc4Srjs_mesa_marshal_ColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
183496c5ddc4Srjs{
183596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
183696c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ColorTable");
183796c5ddc4Srjs   CALL_ColorTable(ctx->CurrentServerDispatch, (target, internalformat, width, format, type, table));
183896c5ddc4Srjs}
183996c5ddc4Srjs
184096c5ddc4Srjs
184196c5ddc4Srjs/* ColorTableParameterfv: marshalled synchronously */
184296c5ddc4Srjsvoid GLAPIENTRY
184396c5ddc4Srjs_mesa_marshal_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat * params)
184496c5ddc4Srjs{
184596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
184696c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ColorTableParameterfv");
184796c5ddc4Srjs   CALL_ColorTableParameterfv(ctx->CurrentServerDispatch, (target, pname, params));
184896c5ddc4Srjs}
184996c5ddc4Srjs
185096c5ddc4Srjs
185196c5ddc4Srjs/* ColorTableParameteriv: marshalled synchronously */
185296c5ddc4Srjsvoid GLAPIENTRY
185396c5ddc4Srjs_mesa_marshal_ColorTableParameteriv(GLenum target, GLenum pname, const GLint * params)
185496c5ddc4Srjs{
185596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
185696c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ColorTableParameteriv");
185796c5ddc4Srjs   CALL_ColorTableParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
185896c5ddc4Srjs}
185996c5ddc4Srjs
186096c5ddc4Srjs
186196c5ddc4Srjs/* CopyColorTable: marshalled asynchronously */
186296c5ddc4Srjsstruct marshal_cmd_CopyColorTable
186396c5ddc4Srjs{
186496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
186596c5ddc4Srjs   GLenum target;
186696c5ddc4Srjs   GLenum internalformat;
186796c5ddc4Srjs   GLint x;
186896c5ddc4Srjs   GLint y;
186996c5ddc4Srjs   GLsizei width;
187096c5ddc4Srjs};
187196c5ddc4Srjsuint32_t
187296c5ddc4Srjs_mesa_unmarshal_CopyColorTable(struct gl_context *ctx, const struct marshal_cmd_CopyColorTable *cmd, const uint64_t *last)
187396c5ddc4Srjs{
187496c5ddc4Srjs   GLenum target = cmd->target;
187596c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
187696c5ddc4Srjs   GLint x = cmd->x;
187796c5ddc4Srjs   GLint y = cmd->y;
187896c5ddc4Srjs   GLsizei width = cmd->width;
187996c5ddc4Srjs   CALL_CopyColorTable(ctx->CurrentServerDispatch, (target, internalformat, x, y, width));
188096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CopyColorTable), 8) / 8);
188196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
188296c5ddc4Srjs   return cmd_size;
188396c5ddc4Srjs}
188496c5ddc4Srjsvoid GLAPIENTRY
188596c5ddc4Srjs_mesa_marshal_CopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
188696c5ddc4Srjs{
188796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
188896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CopyColorTable);
188996c5ddc4Srjs   struct marshal_cmd_CopyColorTable *cmd;
189096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyColorTable, cmd_size);
189196c5ddc4Srjs   cmd->target = target;
189296c5ddc4Srjs   cmd->internalformat = internalformat;
189396c5ddc4Srjs   cmd->x = x;
189496c5ddc4Srjs   cmd->y = y;
189596c5ddc4Srjs   cmd->width = width;
189696c5ddc4Srjs}
189796c5ddc4Srjs
189896c5ddc4Srjs
189996c5ddc4Srjs/* GetColorTable: marshalled synchronously */
190096c5ddc4Srjsvoid GLAPIENTRY
190196c5ddc4Srjs_mesa_marshal_GetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * table)
190296c5ddc4Srjs{
190396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
190496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetColorTable");
190596c5ddc4Srjs   CALL_GetColorTable(ctx->CurrentServerDispatch, (target, format, type, table));
190696c5ddc4Srjs}
190796c5ddc4Srjs
190896c5ddc4Srjs
190996c5ddc4Srjs/* GetColorTableParameterfv: marshalled synchronously */
191096c5ddc4Srjsvoid GLAPIENTRY
191196c5ddc4Srjs_mesa_marshal_GetColorTableParameterfv(GLenum target, GLenum pname, GLfloat * params)
191296c5ddc4Srjs{
191396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
191496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetColorTableParameterfv");
191596c5ddc4Srjs   CALL_GetColorTableParameterfv(ctx->CurrentServerDispatch, (target, pname, params));
191696c5ddc4Srjs}
191796c5ddc4Srjs
191896c5ddc4Srjs
191996c5ddc4Srjs/* GetColorTableParameteriv: marshalled synchronously */
192096c5ddc4Srjsvoid GLAPIENTRY
192196c5ddc4Srjs_mesa_marshal_GetColorTableParameteriv(GLenum target, GLenum pname, GLint * params)
192296c5ddc4Srjs{
192396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
192496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetColorTableParameteriv");
192596c5ddc4Srjs   CALL_GetColorTableParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
192696c5ddc4Srjs}
192796c5ddc4Srjs
192896c5ddc4Srjs
192996c5ddc4Srjs/* ColorSubTable: marshalled synchronously */
193096c5ddc4Srjsvoid GLAPIENTRY
193196c5ddc4Srjs_mesa_marshal_ColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data)
193296c5ddc4Srjs{
193396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
193496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ColorSubTable");
193596c5ddc4Srjs   CALL_ColorSubTable(ctx->CurrentServerDispatch, (target, start, count, format, type, data));
193696c5ddc4Srjs}
193796c5ddc4Srjs
193896c5ddc4Srjs
193996c5ddc4Srjs/* CopyColorSubTable: marshalled asynchronously */
194096c5ddc4Srjsstruct marshal_cmd_CopyColorSubTable
194196c5ddc4Srjs{
194296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
194396c5ddc4Srjs   GLenum target;
194496c5ddc4Srjs   GLsizei start;
194596c5ddc4Srjs   GLint x;
194696c5ddc4Srjs   GLint y;
194796c5ddc4Srjs   GLsizei width;
194896c5ddc4Srjs};
194996c5ddc4Srjsuint32_t
195096c5ddc4Srjs_mesa_unmarshal_CopyColorSubTable(struct gl_context *ctx, const struct marshal_cmd_CopyColorSubTable *cmd, const uint64_t *last)
195196c5ddc4Srjs{
195296c5ddc4Srjs   GLenum target = cmd->target;
195396c5ddc4Srjs   GLsizei start = cmd->start;
195496c5ddc4Srjs   GLint x = cmd->x;
195596c5ddc4Srjs   GLint y = cmd->y;
195696c5ddc4Srjs   GLsizei width = cmd->width;
195796c5ddc4Srjs   CALL_CopyColorSubTable(ctx->CurrentServerDispatch, (target, start, x, y, width));
195896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CopyColorSubTable), 8) / 8);
195996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
196096c5ddc4Srjs   return cmd_size;
196196c5ddc4Srjs}
196296c5ddc4Srjsvoid GLAPIENTRY
196396c5ddc4Srjs_mesa_marshal_CopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
196496c5ddc4Srjs{
196596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
196696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CopyColorSubTable);
196796c5ddc4Srjs   struct marshal_cmd_CopyColorSubTable *cmd;
196896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyColorSubTable, cmd_size);
196996c5ddc4Srjs   cmd->target = target;
197096c5ddc4Srjs   cmd->start = start;
197196c5ddc4Srjs   cmd->x = x;
197296c5ddc4Srjs   cmd->y = y;
197396c5ddc4Srjs   cmd->width = width;
197496c5ddc4Srjs}
197596c5ddc4Srjs
197696c5ddc4Srjs
197796c5ddc4Srjs/* ConvolutionFilter1D: marshalled synchronously */
197896c5ddc4Srjsvoid GLAPIENTRY
197996c5ddc4Srjs_mesa_marshal_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image)
198096c5ddc4Srjs{
198196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
198296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ConvolutionFilter1D");
198396c5ddc4Srjs   CALL_ConvolutionFilter1D(ctx->CurrentServerDispatch, (target, internalformat, width, format, type, image));
198496c5ddc4Srjs}
198596c5ddc4Srjs
198696c5ddc4Srjs
198796c5ddc4Srjs/* ConvolutionFilter2D: marshalled synchronously */
198896c5ddc4Srjsvoid GLAPIENTRY
198996c5ddc4Srjs_mesa_marshal_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image)
199096c5ddc4Srjs{
199196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
199296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ConvolutionFilter2D");
199396c5ddc4Srjs   CALL_ConvolutionFilter2D(ctx->CurrentServerDispatch, (target, internalformat, width, height, format, type, image));
199496c5ddc4Srjs}
199596c5ddc4Srjs
199696c5ddc4Srjs
199796c5ddc4Srjs/* ConvolutionParameterf: marshalled asynchronously */
199896c5ddc4Srjsstruct marshal_cmd_ConvolutionParameterf
199996c5ddc4Srjs{
200096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
200196c5ddc4Srjs   GLenum target;
200296c5ddc4Srjs   GLenum pname;
200396c5ddc4Srjs   GLfloat params;
200496c5ddc4Srjs};
200596c5ddc4Srjsuint32_t
200696c5ddc4Srjs_mesa_unmarshal_ConvolutionParameterf(struct gl_context *ctx, const struct marshal_cmd_ConvolutionParameterf *cmd, const uint64_t *last)
200796c5ddc4Srjs{
200896c5ddc4Srjs   GLenum target = cmd->target;
200996c5ddc4Srjs   GLenum pname = cmd->pname;
201096c5ddc4Srjs   GLfloat params = cmd->params;
201196c5ddc4Srjs   CALL_ConvolutionParameterf(ctx->CurrentServerDispatch, (target, pname, params));
201296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ConvolutionParameterf), 8) / 8);
201396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
201496c5ddc4Srjs   return cmd_size;
201596c5ddc4Srjs}
201696c5ddc4Srjsvoid GLAPIENTRY
201796c5ddc4Srjs_mesa_marshal_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat params)
201896c5ddc4Srjs{
201996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
202096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ConvolutionParameterf);
202196c5ddc4Srjs   struct marshal_cmd_ConvolutionParameterf *cmd;
202296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ConvolutionParameterf, cmd_size);
202396c5ddc4Srjs   cmd->target = target;
202496c5ddc4Srjs   cmd->pname = pname;
202596c5ddc4Srjs   cmd->params = params;
202696c5ddc4Srjs}
202796c5ddc4Srjs
202896c5ddc4Srjs
202996c5ddc4Srjs/* ConvolutionParameterfv: marshalled synchronously */
203096c5ddc4Srjsvoid GLAPIENTRY
203196c5ddc4Srjs_mesa_marshal_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat * params)
203296c5ddc4Srjs{
203396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
203496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ConvolutionParameterfv");
203596c5ddc4Srjs   CALL_ConvolutionParameterfv(ctx->CurrentServerDispatch, (target, pname, params));
203696c5ddc4Srjs}
203796c5ddc4Srjs
203896c5ddc4Srjs
203996c5ddc4Srjs/* ConvolutionParameteri: marshalled asynchronously */
204096c5ddc4Srjsstruct marshal_cmd_ConvolutionParameteri
204196c5ddc4Srjs{
204296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
204396c5ddc4Srjs   GLenum target;
204496c5ddc4Srjs   GLenum pname;
204596c5ddc4Srjs   GLint params;
204696c5ddc4Srjs};
204796c5ddc4Srjsuint32_t
204896c5ddc4Srjs_mesa_unmarshal_ConvolutionParameteri(struct gl_context *ctx, const struct marshal_cmd_ConvolutionParameteri *cmd, const uint64_t *last)
204996c5ddc4Srjs{
205096c5ddc4Srjs   GLenum target = cmd->target;
205196c5ddc4Srjs   GLenum pname = cmd->pname;
205296c5ddc4Srjs   GLint params = cmd->params;
205396c5ddc4Srjs   CALL_ConvolutionParameteri(ctx->CurrentServerDispatch, (target, pname, params));
205496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ConvolutionParameteri), 8) / 8);
205596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
205696c5ddc4Srjs   return cmd_size;
205796c5ddc4Srjs}
205896c5ddc4Srjsvoid GLAPIENTRY
205996c5ddc4Srjs_mesa_marshal_ConvolutionParameteri(GLenum target, GLenum pname, GLint params)
206096c5ddc4Srjs{
206196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
206296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ConvolutionParameteri);
206396c5ddc4Srjs   struct marshal_cmd_ConvolutionParameteri *cmd;
206496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ConvolutionParameteri, cmd_size);
206596c5ddc4Srjs   cmd->target = target;
206696c5ddc4Srjs   cmd->pname = pname;
206796c5ddc4Srjs   cmd->params = params;
206896c5ddc4Srjs}
206996c5ddc4Srjs
207096c5ddc4Srjs
207196c5ddc4Srjs/* ConvolutionParameteriv: marshalled synchronously */
207296c5ddc4Srjsvoid GLAPIENTRY
207396c5ddc4Srjs_mesa_marshal_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint * params)
207496c5ddc4Srjs{
207596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
207696c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ConvolutionParameteriv");
207796c5ddc4Srjs   CALL_ConvolutionParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
207896c5ddc4Srjs}
207996c5ddc4Srjs
208096c5ddc4Srjs
208196c5ddc4Srjs/* CopyConvolutionFilter1D: marshalled asynchronously */
208296c5ddc4Srjsstruct marshal_cmd_CopyConvolutionFilter1D
208396c5ddc4Srjs{
208496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
208596c5ddc4Srjs   GLenum target;
208696c5ddc4Srjs   GLenum internalformat;
208796c5ddc4Srjs   GLint x;
208896c5ddc4Srjs   GLint y;
208996c5ddc4Srjs   GLsizei width;
209096c5ddc4Srjs};
209196c5ddc4Srjsuint32_t
209296c5ddc4Srjs_mesa_unmarshal_CopyConvolutionFilter1D(struct gl_context *ctx, const struct marshal_cmd_CopyConvolutionFilter1D *cmd, const uint64_t *last)
209396c5ddc4Srjs{
209496c5ddc4Srjs   GLenum target = cmd->target;
209596c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
209696c5ddc4Srjs   GLint x = cmd->x;
209796c5ddc4Srjs   GLint y = cmd->y;
209896c5ddc4Srjs   GLsizei width = cmd->width;
209996c5ddc4Srjs   CALL_CopyConvolutionFilter1D(ctx->CurrentServerDispatch, (target, internalformat, x, y, width));
210096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CopyConvolutionFilter1D), 8) / 8);
210196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
210296c5ddc4Srjs   return cmd_size;
210396c5ddc4Srjs}
210496c5ddc4Srjsvoid GLAPIENTRY
210596c5ddc4Srjs_mesa_marshal_CopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
210696c5ddc4Srjs{
210796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
210896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CopyConvolutionFilter1D);
210996c5ddc4Srjs   struct marshal_cmd_CopyConvolutionFilter1D *cmd;
211096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyConvolutionFilter1D, cmd_size);
211196c5ddc4Srjs   cmd->target = target;
211296c5ddc4Srjs   cmd->internalformat = internalformat;
211396c5ddc4Srjs   cmd->x = x;
211496c5ddc4Srjs   cmd->y = y;
211596c5ddc4Srjs   cmd->width = width;
211696c5ddc4Srjs}
211796c5ddc4Srjs
211896c5ddc4Srjs
211996c5ddc4Srjs/* CopyConvolutionFilter2D: marshalled asynchronously */
212096c5ddc4Srjsstruct marshal_cmd_CopyConvolutionFilter2D
212196c5ddc4Srjs{
212296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
212396c5ddc4Srjs   GLenum target;
212496c5ddc4Srjs   GLenum internalformat;
212596c5ddc4Srjs   GLint x;
212696c5ddc4Srjs   GLint y;
212796c5ddc4Srjs   GLsizei width;
212896c5ddc4Srjs   GLsizei height;
212996c5ddc4Srjs};
213096c5ddc4Srjsuint32_t
213196c5ddc4Srjs_mesa_unmarshal_CopyConvolutionFilter2D(struct gl_context *ctx, const struct marshal_cmd_CopyConvolutionFilter2D *cmd, const uint64_t *last)
213296c5ddc4Srjs{
213396c5ddc4Srjs   GLenum target = cmd->target;
213496c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
213596c5ddc4Srjs   GLint x = cmd->x;
213696c5ddc4Srjs   GLint y = cmd->y;
213796c5ddc4Srjs   GLsizei width = cmd->width;
213896c5ddc4Srjs   GLsizei height = cmd->height;
213996c5ddc4Srjs   CALL_CopyConvolutionFilter2D(ctx->CurrentServerDispatch, (target, internalformat, x, y, width, height));
214096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CopyConvolutionFilter2D), 8) / 8);
214196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
214296c5ddc4Srjs   return cmd_size;
214396c5ddc4Srjs}
214496c5ddc4Srjsvoid GLAPIENTRY
214596c5ddc4Srjs_mesa_marshal_CopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
214696c5ddc4Srjs{
214796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
214896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CopyConvolutionFilter2D);
214996c5ddc4Srjs   struct marshal_cmd_CopyConvolutionFilter2D *cmd;
215096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyConvolutionFilter2D, cmd_size);
215196c5ddc4Srjs   cmd->target = target;
215296c5ddc4Srjs   cmd->internalformat = internalformat;
215396c5ddc4Srjs   cmd->x = x;
215496c5ddc4Srjs   cmd->y = y;
215596c5ddc4Srjs   cmd->width = width;
215696c5ddc4Srjs   cmd->height = height;
215796c5ddc4Srjs}
215896c5ddc4Srjs
215996c5ddc4Srjs
216096c5ddc4Srjs/* GetConvolutionFilter: marshalled synchronously */
216196c5ddc4Srjsvoid GLAPIENTRY
216296c5ddc4Srjs_mesa_marshal_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid * image)
216396c5ddc4Srjs{
216496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
216596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetConvolutionFilter");
216696c5ddc4Srjs   CALL_GetConvolutionFilter(ctx->CurrentServerDispatch, (target, format, type, image));
216796c5ddc4Srjs}
216896c5ddc4Srjs
216996c5ddc4Srjs
217096c5ddc4Srjs/* GetConvolutionParameterfv: marshalled synchronously */
217196c5ddc4Srjsvoid GLAPIENTRY
217296c5ddc4Srjs_mesa_marshal_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat * params)
217396c5ddc4Srjs{
217496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
217596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetConvolutionParameterfv");
217696c5ddc4Srjs   CALL_GetConvolutionParameterfv(ctx->CurrentServerDispatch, (target, pname, params));
217796c5ddc4Srjs}
217896c5ddc4Srjs
217996c5ddc4Srjs
218096c5ddc4Srjs/* GetConvolutionParameteriv: marshalled synchronously */
218196c5ddc4Srjsvoid GLAPIENTRY
218296c5ddc4Srjs_mesa_marshal_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint * params)
218396c5ddc4Srjs{
218496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
218596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetConvolutionParameteriv");
218696c5ddc4Srjs   CALL_GetConvolutionParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
218796c5ddc4Srjs}
218896c5ddc4Srjs
218996c5ddc4Srjs
219096c5ddc4Srjs/* GetSeparableFilter: marshalled synchronously */
219196c5ddc4Srjsvoid GLAPIENTRY
219296c5ddc4Srjs_mesa_marshal_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span)
219396c5ddc4Srjs{
219496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
219596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetSeparableFilter");
219696c5ddc4Srjs   CALL_GetSeparableFilter(ctx->CurrentServerDispatch, (target, format, type, row, column, span));
219796c5ddc4Srjs}
219896c5ddc4Srjs
219996c5ddc4Srjs
220096c5ddc4Srjs/* SeparableFilter2D: marshalled synchronously */
220196c5ddc4Srjsvoid GLAPIENTRY
220296c5ddc4Srjs_mesa_marshal_SeparableFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column)
220396c5ddc4Srjs{
220496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
220596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "SeparableFilter2D");
220696c5ddc4Srjs   CALL_SeparableFilter2D(ctx->CurrentServerDispatch, (target, internalformat, width, height, format, type, row, column));
220796c5ddc4Srjs}
220896c5ddc4Srjs
220996c5ddc4Srjs
221096c5ddc4Srjs/* GetHistogram: marshalled synchronously */
221196c5ddc4Srjsvoid GLAPIENTRY
221296c5ddc4Srjs_mesa_marshal_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
221396c5ddc4Srjs{
221496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
221596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetHistogram");
221696c5ddc4Srjs   CALL_GetHistogram(ctx->CurrentServerDispatch, (target, reset, format, type, values));
221796c5ddc4Srjs}
221896c5ddc4Srjs
221996c5ddc4Srjs
222096c5ddc4Srjs/* GetHistogramParameterfv: marshalled synchronously */
222196c5ddc4Srjsvoid GLAPIENTRY
222296c5ddc4Srjs_mesa_marshal_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat * params)
222396c5ddc4Srjs{
222496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
222596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetHistogramParameterfv");
222696c5ddc4Srjs   CALL_GetHistogramParameterfv(ctx->CurrentServerDispatch, (target, pname, params));
222796c5ddc4Srjs}
222896c5ddc4Srjs
222996c5ddc4Srjs
223096c5ddc4Srjs/* GetHistogramParameteriv: marshalled synchronously */
223196c5ddc4Srjsvoid GLAPIENTRY
223296c5ddc4Srjs_mesa_marshal_GetHistogramParameteriv(GLenum target, GLenum pname, GLint * params)
223396c5ddc4Srjs{
223496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
223596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetHistogramParameteriv");
223696c5ddc4Srjs   CALL_GetHistogramParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
223796c5ddc4Srjs}
223896c5ddc4Srjs
223996c5ddc4Srjs
224096c5ddc4Srjs/* GetMinmax: marshalled synchronously */
224196c5ddc4Srjsvoid GLAPIENTRY
224296c5ddc4Srjs_mesa_marshal_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
224396c5ddc4Srjs{
224496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
224596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetMinmax");
224696c5ddc4Srjs   CALL_GetMinmax(ctx->CurrentServerDispatch, (target, reset, format, type, values));
224796c5ddc4Srjs}
224896c5ddc4Srjs
224996c5ddc4Srjs
225096c5ddc4Srjs/* GetMinmaxParameterfv: marshalled synchronously */
225196c5ddc4Srjsvoid GLAPIENTRY
225296c5ddc4Srjs_mesa_marshal_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat * params)
225396c5ddc4Srjs{
225496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
225596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetMinmaxParameterfv");
225696c5ddc4Srjs   CALL_GetMinmaxParameterfv(ctx->CurrentServerDispatch, (target, pname, params));
225796c5ddc4Srjs}
225896c5ddc4Srjs
225996c5ddc4Srjs
226096c5ddc4Srjs/* GetMinmaxParameteriv: marshalled synchronously */
226196c5ddc4Srjsvoid GLAPIENTRY
226296c5ddc4Srjs_mesa_marshal_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params)
226396c5ddc4Srjs{
226496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
226596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetMinmaxParameteriv");
226696c5ddc4Srjs   CALL_GetMinmaxParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
226796c5ddc4Srjs}
226896c5ddc4Srjs
226996c5ddc4Srjs
227096c5ddc4Srjs/* Histogram: marshalled asynchronously */
227196c5ddc4Srjsstruct marshal_cmd_Histogram
227296c5ddc4Srjs{
227396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
227496c5ddc4Srjs   GLboolean sink;
227596c5ddc4Srjs   GLenum target;
227696c5ddc4Srjs   GLsizei width;
227796c5ddc4Srjs   GLenum internalformat;
227896c5ddc4Srjs};
227996c5ddc4Srjsuint32_t
228096c5ddc4Srjs_mesa_unmarshal_Histogram(struct gl_context *ctx, const struct marshal_cmd_Histogram *cmd, const uint64_t *last)
228196c5ddc4Srjs{
228296c5ddc4Srjs   GLenum target = cmd->target;
228396c5ddc4Srjs   GLsizei width = cmd->width;
228496c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
228596c5ddc4Srjs   GLboolean sink = cmd->sink;
228696c5ddc4Srjs   CALL_Histogram(ctx->CurrentServerDispatch, (target, width, internalformat, sink));
228796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Histogram), 8) / 8);
228896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
228996c5ddc4Srjs   return cmd_size;
229096c5ddc4Srjs}
229196c5ddc4Srjsvoid GLAPIENTRY
229296c5ddc4Srjs_mesa_marshal_Histogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
229396c5ddc4Srjs{
229496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
229596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Histogram);
229696c5ddc4Srjs   struct marshal_cmd_Histogram *cmd;
229796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Histogram, cmd_size);
229896c5ddc4Srjs   cmd->target = target;
229996c5ddc4Srjs   cmd->width = width;
230096c5ddc4Srjs   cmd->internalformat = internalformat;
230196c5ddc4Srjs   cmd->sink = sink;
230296c5ddc4Srjs}
230396c5ddc4Srjs
230496c5ddc4Srjs
230596c5ddc4Srjs/* Minmax: marshalled asynchronously */
230696c5ddc4Srjsstruct marshal_cmd_Minmax
230796c5ddc4Srjs{
230896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
230996c5ddc4Srjs   GLboolean sink;
231096c5ddc4Srjs   GLenum target;
231196c5ddc4Srjs   GLenum internalformat;
231296c5ddc4Srjs};
231396c5ddc4Srjsuint32_t
231496c5ddc4Srjs_mesa_unmarshal_Minmax(struct gl_context *ctx, const struct marshal_cmd_Minmax *cmd, const uint64_t *last)
231596c5ddc4Srjs{
231696c5ddc4Srjs   GLenum target = cmd->target;
231796c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
231896c5ddc4Srjs   GLboolean sink = cmd->sink;
231996c5ddc4Srjs   CALL_Minmax(ctx->CurrentServerDispatch, (target, internalformat, sink));
232096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Minmax), 8) / 8);
232196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
232296c5ddc4Srjs   return cmd_size;
232396c5ddc4Srjs}
232496c5ddc4Srjsvoid GLAPIENTRY
232596c5ddc4Srjs_mesa_marshal_Minmax(GLenum target, GLenum internalformat, GLboolean sink)
232696c5ddc4Srjs{
232796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
232896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Minmax);
232996c5ddc4Srjs   struct marshal_cmd_Minmax *cmd;
233096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Minmax, cmd_size);
233196c5ddc4Srjs   cmd->target = target;
233296c5ddc4Srjs   cmd->internalformat = internalformat;
233396c5ddc4Srjs   cmd->sink = sink;
233496c5ddc4Srjs}
233596c5ddc4Srjs
233696c5ddc4Srjs
233796c5ddc4Srjs/* ResetHistogram: marshalled asynchronously */
233896c5ddc4Srjsstruct marshal_cmd_ResetHistogram
233996c5ddc4Srjs{
234096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
234196c5ddc4Srjs   GLenum target;
234296c5ddc4Srjs};
234396c5ddc4Srjsuint32_t
234496c5ddc4Srjs_mesa_unmarshal_ResetHistogram(struct gl_context *ctx, const struct marshal_cmd_ResetHistogram *cmd, const uint64_t *last)
234596c5ddc4Srjs{
234696c5ddc4Srjs   GLenum target = cmd->target;
234796c5ddc4Srjs   CALL_ResetHistogram(ctx->CurrentServerDispatch, (target));
234896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ResetHistogram), 8) / 8);
234996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
235096c5ddc4Srjs   return cmd_size;
235196c5ddc4Srjs}
235296c5ddc4Srjsvoid GLAPIENTRY
235396c5ddc4Srjs_mesa_marshal_ResetHistogram(GLenum target)
235496c5ddc4Srjs{
235596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
235696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ResetHistogram);
235796c5ddc4Srjs   struct marshal_cmd_ResetHistogram *cmd;
235896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ResetHistogram, cmd_size);
235996c5ddc4Srjs   cmd->target = target;
236096c5ddc4Srjs}
236196c5ddc4Srjs
236296c5ddc4Srjs
236396c5ddc4Srjs/* ResetMinmax: marshalled asynchronously */
236496c5ddc4Srjsstruct marshal_cmd_ResetMinmax
236596c5ddc4Srjs{
236696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
236796c5ddc4Srjs   GLenum target;
236896c5ddc4Srjs};
236996c5ddc4Srjsuint32_t
237096c5ddc4Srjs_mesa_unmarshal_ResetMinmax(struct gl_context *ctx, const struct marshal_cmd_ResetMinmax *cmd, const uint64_t *last)
237196c5ddc4Srjs{
237296c5ddc4Srjs   GLenum target = cmd->target;
237396c5ddc4Srjs   CALL_ResetMinmax(ctx->CurrentServerDispatch, (target));
237496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ResetMinmax), 8) / 8);
237596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
237696c5ddc4Srjs   return cmd_size;
237796c5ddc4Srjs}
237896c5ddc4Srjsvoid GLAPIENTRY
237996c5ddc4Srjs_mesa_marshal_ResetMinmax(GLenum target)
238096c5ddc4Srjs{
238196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
238296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ResetMinmax);
238396c5ddc4Srjs   struct marshal_cmd_ResetMinmax *cmd;
238496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ResetMinmax, cmd_size);
238596c5ddc4Srjs   cmd->target = target;
238696c5ddc4Srjs}
238796c5ddc4Srjs
238896c5ddc4Srjs
238996c5ddc4Srjs/* TexImage3D: marshalled asynchronously */
239096c5ddc4Srjsstruct marshal_cmd_TexImage3D
239196c5ddc4Srjs{
239296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
239396c5ddc4Srjs   GLenum target;
239496c5ddc4Srjs   GLint level;
239596c5ddc4Srjs   GLint internalformat;
239696c5ddc4Srjs   GLsizei width;
239796c5ddc4Srjs   GLsizei height;
239896c5ddc4Srjs   GLsizei depth;
239996c5ddc4Srjs   GLint border;
240096c5ddc4Srjs   GLenum format;
240196c5ddc4Srjs   GLenum type;
240296c5ddc4Srjs   const GLvoid * pixels;
240396c5ddc4Srjs};
240496c5ddc4Srjsuint32_t
240596c5ddc4Srjs_mesa_unmarshal_TexImage3D(struct gl_context *ctx, const struct marshal_cmd_TexImage3D *cmd, const uint64_t *last)
240696c5ddc4Srjs{
240796c5ddc4Srjs   GLenum target = cmd->target;
240896c5ddc4Srjs   GLint level = cmd->level;
240996c5ddc4Srjs   GLint internalformat = cmd->internalformat;
241096c5ddc4Srjs   GLsizei width = cmd->width;
241196c5ddc4Srjs   GLsizei height = cmd->height;
241296c5ddc4Srjs   GLsizei depth = cmd->depth;
241396c5ddc4Srjs   GLint border = cmd->border;
241496c5ddc4Srjs   GLenum format = cmd->format;
241596c5ddc4Srjs   GLenum type = cmd->type;
241696c5ddc4Srjs   const GLvoid * pixels = cmd->pixels;
241796c5ddc4Srjs   CALL_TexImage3D(ctx->CurrentServerDispatch, (target, level, internalformat, width, height, depth, border, format, type, pixels));
241896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexImage3D), 8) / 8);
241996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
242096c5ddc4Srjs   return cmd_size;
242196c5ddc4Srjs}
242296c5ddc4Srjsvoid GLAPIENTRY
242396c5ddc4Srjs_mesa_marshal_TexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
242496c5ddc4Srjs{
242596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
242696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexImage3D);
242796c5ddc4Srjs   struct marshal_cmd_TexImage3D *cmd;
242896c5ddc4Srjs   if (_mesa_glthread_has_no_unpack_buffer(ctx)) {
242996c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "TexImage3D");
243096c5ddc4Srjs      CALL_TexImage3D(ctx->CurrentServerDispatch, (target, level, internalformat, width, height, depth, border, format, type, pixels));
243196c5ddc4Srjs      return;
243296c5ddc4Srjs   }
243396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexImage3D, cmd_size);
243496c5ddc4Srjs   cmd->target = target;
243596c5ddc4Srjs   cmd->level = level;
243696c5ddc4Srjs   cmd->internalformat = internalformat;
243796c5ddc4Srjs   cmd->width = width;
243896c5ddc4Srjs   cmd->height = height;
243996c5ddc4Srjs   cmd->depth = depth;
244096c5ddc4Srjs   cmd->border = border;
244196c5ddc4Srjs   cmd->format = format;
244296c5ddc4Srjs   cmd->type = type;
244396c5ddc4Srjs   cmd->pixels = pixels;
244496c5ddc4Srjs}
244596c5ddc4Srjs
244696c5ddc4Srjs
244796c5ddc4Srjs/* TexSubImage3D: marshalled asynchronously */
244896c5ddc4Srjsstruct marshal_cmd_TexSubImage3D
244996c5ddc4Srjs{
245096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
245196c5ddc4Srjs   GLenum target;
245296c5ddc4Srjs   GLint level;
245396c5ddc4Srjs   GLint xoffset;
245496c5ddc4Srjs   GLint yoffset;
245596c5ddc4Srjs   GLint zoffset;
245696c5ddc4Srjs   GLsizei width;
245796c5ddc4Srjs   GLsizei height;
245896c5ddc4Srjs   GLsizei depth;
245996c5ddc4Srjs   GLenum format;
246096c5ddc4Srjs   GLenum type;
246196c5ddc4Srjs   const GLvoid * pixels;
246296c5ddc4Srjs};
246396c5ddc4Srjsuint32_t
246496c5ddc4Srjs_mesa_unmarshal_TexSubImage3D(struct gl_context *ctx, const struct marshal_cmd_TexSubImage3D *cmd, const uint64_t *last)
246596c5ddc4Srjs{
246696c5ddc4Srjs   GLenum target = cmd->target;
246796c5ddc4Srjs   GLint level = cmd->level;
246896c5ddc4Srjs   GLint xoffset = cmd->xoffset;
246996c5ddc4Srjs   GLint yoffset = cmd->yoffset;
247096c5ddc4Srjs   GLint zoffset = cmd->zoffset;
247196c5ddc4Srjs   GLsizei width = cmd->width;
247296c5ddc4Srjs   GLsizei height = cmd->height;
247396c5ddc4Srjs   GLsizei depth = cmd->depth;
247496c5ddc4Srjs   GLenum format = cmd->format;
247596c5ddc4Srjs   GLenum type = cmd->type;
247696c5ddc4Srjs   const GLvoid * pixels = cmd->pixels;
247796c5ddc4Srjs   CALL_TexSubImage3D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels));
247896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexSubImage3D), 8) / 8);
247996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
248096c5ddc4Srjs   return cmd_size;
248196c5ddc4Srjs}
248296c5ddc4Srjsvoid GLAPIENTRY
248396c5ddc4Srjs_mesa_marshal_TexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels)
248496c5ddc4Srjs{
248596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
248696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexSubImage3D);
248796c5ddc4Srjs   struct marshal_cmd_TexSubImage3D *cmd;
248896c5ddc4Srjs   if (_mesa_glthread_has_no_unpack_buffer(ctx)) {
248996c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "TexSubImage3D");
249096c5ddc4Srjs      CALL_TexSubImage3D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels));
249196c5ddc4Srjs      return;
249296c5ddc4Srjs   }
249396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexSubImage3D, cmd_size);
249496c5ddc4Srjs   cmd->target = target;
249596c5ddc4Srjs   cmd->level = level;
249696c5ddc4Srjs   cmd->xoffset = xoffset;
249796c5ddc4Srjs   cmd->yoffset = yoffset;
249896c5ddc4Srjs   cmd->zoffset = zoffset;
249996c5ddc4Srjs   cmd->width = width;
250096c5ddc4Srjs   cmd->height = height;
250196c5ddc4Srjs   cmd->depth = depth;
250296c5ddc4Srjs   cmd->format = format;
250396c5ddc4Srjs   cmd->type = type;
250496c5ddc4Srjs   cmd->pixels = pixels;
250596c5ddc4Srjs}
250696c5ddc4Srjs
250796c5ddc4Srjs
250896c5ddc4Srjs/* CopyTexSubImage3D: marshalled asynchronously */
250996c5ddc4Srjsstruct marshal_cmd_CopyTexSubImage3D
251096c5ddc4Srjs{
251196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
251296c5ddc4Srjs   GLenum target;
251396c5ddc4Srjs   GLint level;
251496c5ddc4Srjs   GLint xoffset;
251596c5ddc4Srjs   GLint yoffset;
251696c5ddc4Srjs   GLint zoffset;
251796c5ddc4Srjs   GLint x;
251896c5ddc4Srjs   GLint y;
251996c5ddc4Srjs   GLsizei width;
252096c5ddc4Srjs   GLsizei height;
252196c5ddc4Srjs};
252296c5ddc4Srjsuint32_t
252396c5ddc4Srjs_mesa_unmarshal_CopyTexSubImage3D(struct gl_context *ctx, const struct marshal_cmd_CopyTexSubImage3D *cmd, const uint64_t *last)
252496c5ddc4Srjs{
252596c5ddc4Srjs   GLenum target = cmd->target;
252696c5ddc4Srjs   GLint level = cmd->level;
252796c5ddc4Srjs   GLint xoffset = cmd->xoffset;
252896c5ddc4Srjs   GLint yoffset = cmd->yoffset;
252996c5ddc4Srjs   GLint zoffset = cmd->zoffset;
253096c5ddc4Srjs   GLint x = cmd->x;
253196c5ddc4Srjs   GLint y = cmd->y;
253296c5ddc4Srjs   GLsizei width = cmd->width;
253396c5ddc4Srjs   GLsizei height = cmd->height;
253496c5ddc4Srjs   CALL_CopyTexSubImage3D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, zoffset, x, y, width, height));
253596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CopyTexSubImage3D), 8) / 8);
253696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
253796c5ddc4Srjs   return cmd_size;
253896c5ddc4Srjs}
253996c5ddc4Srjsvoid GLAPIENTRY
254096c5ddc4Srjs_mesa_marshal_CopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
254196c5ddc4Srjs{
254296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
254396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CopyTexSubImage3D);
254496c5ddc4Srjs   struct marshal_cmd_CopyTexSubImage3D *cmd;
254596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyTexSubImage3D, cmd_size);
254696c5ddc4Srjs   cmd->target = target;
254796c5ddc4Srjs   cmd->level = level;
254896c5ddc4Srjs   cmd->xoffset = xoffset;
254996c5ddc4Srjs   cmd->yoffset = yoffset;
255096c5ddc4Srjs   cmd->zoffset = zoffset;
255196c5ddc4Srjs   cmd->x = x;
255296c5ddc4Srjs   cmd->y = y;
255396c5ddc4Srjs   cmd->width = width;
255496c5ddc4Srjs   cmd->height = height;
255596c5ddc4Srjs}
255696c5ddc4Srjs
255796c5ddc4Srjs
255896c5ddc4Srjs/* ActiveTexture: marshalled asynchronously */
255996c5ddc4Srjsstruct marshal_cmd_ActiveTexture
256096c5ddc4Srjs{
256196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
256296c5ddc4Srjs   GLenum texture;
256396c5ddc4Srjs};
256496c5ddc4Srjsuint32_t
256596c5ddc4Srjs_mesa_unmarshal_ActiveTexture(struct gl_context *ctx, const struct marshal_cmd_ActiveTexture *cmd, const uint64_t *last)
256696c5ddc4Srjs{
256796c5ddc4Srjs   GLenum texture = cmd->texture;
256896c5ddc4Srjs   CALL_ActiveTexture(ctx->CurrentServerDispatch, (texture));
256996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ActiveTexture), 8) / 8);
257096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
257196c5ddc4Srjs   return cmd_size;
257296c5ddc4Srjs}
257396c5ddc4Srjsvoid GLAPIENTRY
257496c5ddc4Srjs_mesa_marshal_ActiveTexture(GLenum texture)
257596c5ddc4Srjs{
257696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
257796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ActiveTexture);
257896c5ddc4Srjs   struct marshal_cmd_ActiveTexture *cmd;
257996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ActiveTexture, cmd_size);
258096c5ddc4Srjs   cmd->texture = texture;
258196c5ddc4Srjs   ctx->GLThread.ActiveTexture = texture - GL_TEXTURE0; if (ctx->GLThread.MatrixMode == GL_TEXTURE) ctx->GLThread.MatrixIndex = _mesa_get_matrix_index(ctx, texture);
258296c5ddc4Srjs}
258396c5ddc4Srjs
258496c5ddc4Srjs
258596c5ddc4Srjs/* ClientActiveTexture: marshalled asynchronously */
258696c5ddc4Srjsstruct marshal_cmd_ClientActiveTexture
258796c5ddc4Srjs{
258896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
258996c5ddc4Srjs   GLenum texture;
259096c5ddc4Srjs};
259196c5ddc4Srjsuint32_t
259296c5ddc4Srjs_mesa_unmarshal_ClientActiveTexture(struct gl_context *ctx, const struct marshal_cmd_ClientActiveTexture *cmd, const uint64_t *last)
259396c5ddc4Srjs{
259496c5ddc4Srjs   GLenum texture = cmd->texture;
259596c5ddc4Srjs   CALL_ClientActiveTexture(ctx->CurrentServerDispatch, (texture));
259696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ClientActiveTexture), 8) / 8);
259796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
259896c5ddc4Srjs   return cmd_size;
259996c5ddc4Srjs}
260096c5ddc4Srjsvoid GLAPIENTRY
260196c5ddc4Srjs_mesa_marshal_ClientActiveTexture(GLenum texture)
260296c5ddc4Srjs{
260396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
260496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ClientActiveTexture);
260596c5ddc4Srjs   struct marshal_cmd_ClientActiveTexture *cmd;
260696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClientActiveTexture, cmd_size);
260796c5ddc4Srjs   cmd->texture = texture;
260896c5ddc4Srjs   ctx->GLThread.ClientActiveTexture = texture - GL_TEXTURE0;
260996c5ddc4Srjs}
261096c5ddc4Srjs
261196c5ddc4Srjs
261296c5ddc4Srjs/* MultiTexCoord1d: marshalled asynchronously */
261396c5ddc4Srjsstruct marshal_cmd_MultiTexCoord1d
261496c5ddc4Srjs{
261596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
261696c5ddc4Srjs   GLenum target;
261796c5ddc4Srjs   GLdouble s;
261896c5ddc4Srjs};
261996c5ddc4Srjsuint32_t
262096c5ddc4Srjs_mesa_unmarshal_MultiTexCoord1d(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1d *cmd, const uint64_t *last)
262196c5ddc4Srjs{
262296c5ddc4Srjs   GLenum target = cmd->target;
262396c5ddc4Srjs   GLdouble s = cmd->s;
262496c5ddc4Srjs   CALL_MultiTexCoord1d(ctx->CurrentServerDispatch, (target, s));
262596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord1d), 8) / 8);
262696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
262796c5ddc4Srjs   return cmd_size;
262896c5ddc4Srjs}
262996c5ddc4Srjsvoid GLAPIENTRY
263096c5ddc4Srjs_mesa_marshal_MultiTexCoord1d(GLenum target, GLdouble s)
263196c5ddc4Srjs{
263296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
263396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1d);
263496c5ddc4Srjs   struct marshal_cmd_MultiTexCoord1d *cmd;
263596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1d, cmd_size);
263696c5ddc4Srjs   cmd->target = target;
263796c5ddc4Srjs   cmd->s = s;
263896c5ddc4Srjs}
263996c5ddc4Srjs
264096c5ddc4Srjs
264196c5ddc4Srjs/* MultiTexCoord1dv: marshalled asynchronously */
264296c5ddc4Srjsstruct marshal_cmd_MultiTexCoord1dv
264396c5ddc4Srjs{
264496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
264596c5ddc4Srjs   GLenum target;
264696c5ddc4Srjs   GLdouble v[1];
264796c5ddc4Srjs};
264896c5ddc4Srjsuint32_t
264996c5ddc4Srjs_mesa_unmarshal_MultiTexCoord1dv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1dv *cmd, const uint64_t *last)
265096c5ddc4Srjs{
265196c5ddc4Srjs   GLenum target = cmd->target;
265296c5ddc4Srjs   const GLdouble * v = cmd->v;
265396c5ddc4Srjs   CALL_MultiTexCoord1dv(ctx->CurrentServerDispatch, (target, v));
265496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord1dv), 8) / 8);
265596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
265696c5ddc4Srjs   return cmd_size;
265796c5ddc4Srjs}
265896c5ddc4Srjsvoid GLAPIENTRY
265996c5ddc4Srjs_mesa_marshal_MultiTexCoord1dv(GLenum target, const GLdouble * v)
266096c5ddc4Srjs{
266196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
266296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1dv);
266396c5ddc4Srjs   struct marshal_cmd_MultiTexCoord1dv *cmd;
266496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1dv, cmd_size);
266596c5ddc4Srjs   cmd->target = target;
266696c5ddc4Srjs   memcpy(cmd->v, v, 1 * sizeof(GLdouble));
266796c5ddc4Srjs}
266896c5ddc4Srjs
266996c5ddc4Srjs
267096c5ddc4Srjs/* MultiTexCoord1fARB: marshalled asynchronously */
267196c5ddc4Srjsstruct marshal_cmd_MultiTexCoord1fARB
267296c5ddc4Srjs{
267396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
267496c5ddc4Srjs   GLenum target;
267596c5ddc4Srjs   GLfloat s;
267696c5ddc4Srjs};
267796c5ddc4Srjsuint32_t
267896c5ddc4Srjs_mesa_unmarshal_MultiTexCoord1fARB(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1fARB *cmd, const uint64_t *last)
267996c5ddc4Srjs{
268096c5ddc4Srjs   GLenum target = cmd->target;
268196c5ddc4Srjs   GLfloat s = cmd->s;
268296c5ddc4Srjs   CALL_MultiTexCoord1fARB(ctx->CurrentServerDispatch, (target, s));
268396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord1fARB), 8) / 8);
268496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
268596c5ddc4Srjs   return cmd_size;
268696c5ddc4Srjs}
268796c5ddc4Srjsvoid GLAPIENTRY
268896c5ddc4Srjs_mesa_marshal_MultiTexCoord1fARB(GLenum target, GLfloat s)
268996c5ddc4Srjs{
269096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
269196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1fARB);
269296c5ddc4Srjs   struct marshal_cmd_MultiTexCoord1fARB *cmd;
269396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1fARB, cmd_size);
269496c5ddc4Srjs   cmd->target = target;
269596c5ddc4Srjs   cmd->s = s;
269696c5ddc4Srjs}
269796c5ddc4Srjs
269896c5ddc4Srjs
269996c5ddc4Srjs/* MultiTexCoord1fvARB: marshalled asynchronously */
270096c5ddc4Srjsstruct marshal_cmd_MultiTexCoord1fvARB
270196c5ddc4Srjs{
270296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
270396c5ddc4Srjs   GLenum target;
270496c5ddc4Srjs   GLfloat v[1];
270596c5ddc4Srjs};
270696c5ddc4Srjsuint32_t
270796c5ddc4Srjs_mesa_unmarshal_MultiTexCoord1fvARB(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1fvARB *cmd, const uint64_t *last)
270896c5ddc4Srjs{
270996c5ddc4Srjs   GLenum target = cmd->target;
271096c5ddc4Srjs   const GLfloat * v = cmd->v;
271196c5ddc4Srjs   CALL_MultiTexCoord1fvARB(ctx->CurrentServerDispatch, (target, v));
271296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord1fvARB), 8) / 8);
271396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
271496c5ddc4Srjs   return cmd_size;
271596c5ddc4Srjs}
271696c5ddc4Srjsvoid GLAPIENTRY
271796c5ddc4Srjs_mesa_marshal_MultiTexCoord1fvARB(GLenum target, const GLfloat * v)
271896c5ddc4Srjs{
271996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
272096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1fvARB);
272196c5ddc4Srjs   struct marshal_cmd_MultiTexCoord1fvARB *cmd;
272296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1fvARB, cmd_size);
272396c5ddc4Srjs   cmd->target = target;
272496c5ddc4Srjs   memcpy(cmd->v, v, 1 * sizeof(GLfloat));
272596c5ddc4Srjs}
272696c5ddc4Srjs
272796c5ddc4Srjs
272896c5ddc4Srjs/* MultiTexCoord1i: marshalled asynchronously */
272996c5ddc4Srjsstruct marshal_cmd_MultiTexCoord1i
273096c5ddc4Srjs{
273196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
273296c5ddc4Srjs   GLenum target;
273396c5ddc4Srjs   GLint s;
273496c5ddc4Srjs};
273596c5ddc4Srjsuint32_t
273696c5ddc4Srjs_mesa_unmarshal_MultiTexCoord1i(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1i *cmd, const uint64_t *last)
273796c5ddc4Srjs{
273896c5ddc4Srjs   GLenum target = cmd->target;
273996c5ddc4Srjs   GLint s = cmd->s;
274096c5ddc4Srjs   CALL_MultiTexCoord1i(ctx->CurrentServerDispatch, (target, s));
274196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord1i), 8) / 8);
274296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
274396c5ddc4Srjs   return cmd_size;
274496c5ddc4Srjs}
274596c5ddc4Srjsvoid GLAPIENTRY
274696c5ddc4Srjs_mesa_marshal_MultiTexCoord1i(GLenum target, GLint s)
274796c5ddc4Srjs{
274896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
274996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1i);
275096c5ddc4Srjs   struct marshal_cmd_MultiTexCoord1i *cmd;
275196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1i, cmd_size);
275296c5ddc4Srjs   cmd->target = target;
275396c5ddc4Srjs   cmd->s = s;
275496c5ddc4Srjs}
275596c5ddc4Srjs
275696c5ddc4Srjs
275796c5ddc4Srjs/* MultiTexCoord1iv: marshalled asynchronously */
275896c5ddc4Srjsstruct marshal_cmd_MultiTexCoord1iv
275996c5ddc4Srjs{
276096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
276196c5ddc4Srjs   GLenum target;
276296c5ddc4Srjs   GLint v[1];
276396c5ddc4Srjs};
276496c5ddc4Srjsuint32_t
276596c5ddc4Srjs_mesa_unmarshal_MultiTexCoord1iv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1iv *cmd, const uint64_t *last)
276696c5ddc4Srjs{
276796c5ddc4Srjs   GLenum target = cmd->target;
276896c5ddc4Srjs   const GLint * v = cmd->v;
276996c5ddc4Srjs   CALL_MultiTexCoord1iv(ctx->CurrentServerDispatch, (target, v));
277096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord1iv), 8) / 8);
277196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
277296c5ddc4Srjs   return cmd_size;
277396c5ddc4Srjs}
277496c5ddc4Srjsvoid GLAPIENTRY
277596c5ddc4Srjs_mesa_marshal_MultiTexCoord1iv(GLenum target, const GLint * v)
277696c5ddc4Srjs{
277796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
277896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1iv);
277996c5ddc4Srjs   struct marshal_cmd_MultiTexCoord1iv *cmd;
278096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1iv, cmd_size);
278196c5ddc4Srjs   cmd->target = target;
278296c5ddc4Srjs   memcpy(cmd->v, v, 1 * sizeof(GLint));
278396c5ddc4Srjs}
278496c5ddc4Srjs
278596c5ddc4Srjs
278696c5ddc4Srjs/* MultiTexCoord1s: marshalled asynchronously */
278796c5ddc4Srjsstruct marshal_cmd_MultiTexCoord1s
278896c5ddc4Srjs{
278996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
279096c5ddc4Srjs   GLshort s;
279196c5ddc4Srjs   GLenum target;
279296c5ddc4Srjs};
279396c5ddc4Srjsuint32_t
279496c5ddc4Srjs_mesa_unmarshal_MultiTexCoord1s(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1s *cmd, const uint64_t *last)
279596c5ddc4Srjs{
279696c5ddc4Srjs   GLenum target = cmd->target;
279796c5ddc4Srjs   GLshort s = cmd->s;
279896c5ddc4Srjs   CALL_MultiTexCoord1s(ctx->CurrentServerDispatch, (target, s));
279996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord1s), 8) / 8);
280096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
280196c5ddc4Srjs   return cmd_size;
280296c5ddc4Srjs}
280396c5ddc4Srjsvoid GLAPIENTRY
280496c5ddc4Srjs_mesa_marshal_MultiTexCoord1s(GLenum target, GLshort s)
280596c5ddc4Srjs{
280696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
280796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1s);
280896c5ddc4Srjs   struct marshal_cmd_MultiTexCoord1s *cmd;
280996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1s, cmd_size);
281096c5ddc4Srjs   cmd->target = target;
281196c5ddc4Srjs   cmd->s = s;
281296c5ddc4Srjs}
281396c5ddc4Srjs
281496c5ddc4Srjs
281596c5ddc4Srjs/* MultiTexCoord1sv: marshalled asynchronously */
281696c5ddc4Srjsstruct marshal_cmd_MultiTexCoord1sv
281796c5ddc4Srjs{
281896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
281996c5ddc4Srjs   GLenum target;
282096c5ddc4Srjs   GLshort v[1];
282196c5ddc4Srjs};
282296c5ddc4Srjsuint32_t
282396c5ddc4Srjs_mesa_unmarshal_MultiTexCoord1sv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1sv *cmd, const uint64_t *last)
282496c5ddc4Srjs{
282596c5ddc4Srjs   GLenum target = cmd->target;
282696c5ddc4Srjs   const GLshort * v = cmd->v;
282796c5ddc4Srjs   CALL_MultiTexCoord1sv(ctx->CurrentServerDispatch, (target, v));
282896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord1sv), 8) / 8);
282996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
283096c5ddc4Srjs   return cmd_size;
283196c5ddc4Srjs}
283296c5ddc4Srjsvoid GLAPIENTRY
283396c5ddc4Srjs_mesa_marshal_MultiTexCoord1sv(GLenum target, const GLshort * v)
283496c5ddc4Srjs{
283596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
283696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1sv);
283796c5ddc4Srjs   struct marshal_cmd_MultiTexCoord1sv *cmd;
283896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1sv, cmd_size);
283996c5ddc4Srjs   cmd->target = target;
284096c5ddc4Srjs   memcpy(cmd->v, v, 1 * sizeof(GLshort));
284196c5ddc4Srjs}
284296c5ddc4Srjs
284396c5ddc4Srjs
284496c5ddc4Srjs/* MultiTexCoord2d: marshalled asynchronously */
284596c5ddc4Srjsstruct marshal_cmd_MultiTexCoord2d
284696c5ddc4Srjs{
284796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
284896c5ddc4Srjs   GLenum target;
284996c5ddc4Srjs   GLdouble s;
285096c5ddc4Srjs   GLdouble t;
285196c5ddc4Srjs};
285296c5ddc4Srjsuint32_t
285396c5ddc4Srjs_mesa_unmarshal_MultiTexCoord2d(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2d *cmd, const uint64_t *last)
285496c5ddc4Srjs{
285596c5ddc4Srjs   GLenum target = cmd->target;
285696c5ddc4Srjs   GLdouble s = cmd->s;
285796c5ddc4Srjs   GLdouble t = cmd->t;
285896c5ddc4Srjs   CALL_MultiTexCoord2d(ctx->CurrentServerDispatch, (target, s, t));
285996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord2d), 8) / 8);
286096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
286196c5ddc4Srjs   return cmd_size;
286296c5ddc4Srjs}
286396c5ddc4Srjsvoid GLAPIENTRY
286496c5ddc4Srjs_mesa_marshal_MultiTexCoord2d(GLenum target, GLdouble s, GLdouble t)
286596c5ddc4Srjs{
286696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
286796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2d);
286896c5ddc4Srjs   struct marshal_cmd_MultiTexCoord2d *cmd;
286996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2d, cmd_size);
287096c5ddc4Srjs   cmd->target = target;
287196c5ddc4Srjs   cmd->s = s;
287296c5ddc4Srjs   cmd->t = t;
287396c5ddc4Srjs}
287496c5ddc4Srjs
287596c5ddc4Srjs
287696c5ddc4Srjs/* MultiTexCoord2dv: marshalled asynchronously */
287796c5ddc4Srjsstruct marshal_cmd_MultiTexCoord2dv
287896c5ddc4Srjs{
287996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
288096c5ddc4Srjs   GLenum target;
288196c5ddc4Srjs   GLdouble v[2];
288296c5ddc4Srjs};
288396c5ddc4Srjsuint32_t
288496c5ddc4Srjs_mesa_unmarshal_MultiTexCoord2dv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2dv *cmd, const uint64_t *last)
288596c5ddc4Srjs{
288696c5ddc4Srjs   GLenum target = cmd->target;
288796c5ddc4Srjs   const GLdouble * v = cmd->v;
288896c5ddc4Srjs   CALL_MultiTexCoord2dv(ctx->CurrentServerDispatch, (target, v));
288996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord2dv), 8) / 8);
289096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
289196c5ddc4Srjs   return cmd_size;
289296c5ddc4Srjs}
289396c5ddc4Srjsvoid GLAPIENTRY
289496c5ddc4Srjs_mesa_marshal_MultiTexCoord2dv(GLenum target, const GLdouble * v)
289596c5ddc4Srjs{
289696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
289796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2dv);
289896c5ddc4Srjs   struct marshal_cmd_MultiTexCoord2dv *cmd;
289996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2dv, cmd_size);
290096c5ddc4Srjs   cmd->target = target;
290196c5ddc4Srjs   memcpy(cmd->v, v, 2 * sizeof(GLdouble));
290296c5ddc4Srjs}
290396c5ddc4Srjs
290496c5ddc4Srjs
290596c5ddc4Srjs/* MultiTexCoord2fARB: marshalled asynchronously */
290696c5ddc4Srjsstruct marshal_cmd_MultiTexCoord2fARB
290796c5ddc4Srjs{
290896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
290996c5ddc4Srjs   GLenum target;
291096c5ddc4Srjs   GLfloat s;
291196c5ddc4Srjs   GLfloat t;
291296c5ddc4Srjs};
291396c5ddc4Srjsuint32_t
291496c5ddc4Srjs_mesa_unmarshal_MultiTexCoord2fARB(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2fARB *cmd, const uint64_t *last)
291596c5ddc4Srjs{
291696c5ddc4Srjs   GLenum target = cmd->target;
291796c5ddc4Srjs   GLfloat s = cmd->s;
291896c5ddc4Srjs   GLfloat t = cmd->t;
291996c5ddc4Srjs   CALL_MultiTexCoord2fARB(ctx->CurrentServerDispatch, (target, s, t));
292096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord2fARB), 8) / 8);
292196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
292296c5ddc4Srjs   return cmd_size;
292396c5ddc4Srjs}
292496c5ddc4Srjsvoid GLAPIENTRY
292596c5ddc4Srjs_mesa_marshal_MultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t)
292696c5ddc4Srjs{
292796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
292896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2fARB);
292996c5ddc4Srjs   struct marshal_cmd_MultiTexCoord2fARB *cmd;
293096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2fARB, cmd_size);
293196c5ddc4Srjs   cmd->target = target;
293296c5ddc4Srjs   cmd->s = s;
293396c5ddc4Srjs   cmd->t = t;
293496c5ddc4Srjs}
293596c5ddc4Srjs
293696c5ddc4Srjs
293796c5ddc4Srjs/* MultiTexCoord2fvARB: marshalled asynchronously */
293896c5ddc4Srjsstruct marshal_cmd_MultiTexCoord2fvARB
293996c5ddc4Srjs{
294096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
294196c5ddc4Srjs   GLenum target;
294296c5ddc4Srjs   GLfloat v[2];
294396c5ddc4Srjs};
294496c5ddc4Srjsuint32_t
294596c5ddc4Srjs_mesa_unmarshal_MultiTexCoord2fvARB(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2fvARB *cmd, const uint64_t *last)
294696c5ddc4Srjs{
294796c5ddc4Srjs   GLenum target = cmd->target;
294896c5ddc4Srjs   const GLfloat * v = cmd->v;
294996c5ddc4Srjs   CALL_MultiTexCoord2fvARB(ctx->CurrentServerDispatch, (target, v));
295096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord2fvARB), 8) / 8);
295196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
295296c5ddc4Srjs   return cmd_size;
295396c5ddc4Srjs}
295496c5ddc4Srjsvoid GLAPIENTRY
295596c5ddc4Srjs_mesa_marshal_MultiTexCoord2fvARB(GLenum target, const GLfloat * v)
295696c5ddc4Srjs{
295796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
295896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2fvARB);
295996c5ddc4Srjs   struct marshal_cmd_MultiTexCoord2fvARB *cmd;
296096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2fvARB, cmd_size);
296196c5ddc4Srjs   cmd->target = target;
296296c5ddc4Srjs   memcpy(cmd->v, v, 2 * sizeof(GLfloat));
296396c5ddc4Srjs}
296496c5ddc4Srjs
296596c5ddc4Srjs
296696c5ddc4Srjs/* MultiTexCoord2i: marshalled asynchronously */
296796c5ddc4Srjsstruct marshal_cmd_MultiTexCoord2i
296896c5ddc4Srjs{
296996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
297096c5ddc4Srjs   GLenum target;
297196c5ddc4Srjs   GLint s;
297296c5ddc4Srjs   GLint t;
297396c5ddc4Srjs};
297496c5ddc4Srjsuint32_t
297596c5ddc4Srjs_mesa_unmarshal_MultiTexCoord2i(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2i *cmd, const uint64_t *last)
297696c5ddc4Srjs{
297796c5ddc4Srjs   GLenum target = cmd->target;
297896c5ddc4Srjs   GLint s = cmd->s;
297996c5ddc4Srjs   GLint t = cmd->t;
298096c5ddc4Srjs   CALL_MultiTexCoord2i(ctx->CurrentServerDispatch, (target, s, t));
298196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord2i), 8) / 8);
298296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
298396c5ddc4Srjs   return cmd_size;
298496c5ddc4Srjs}
298596c5ddc4Srjsvoid GLAPIENTRY
298696c5ddc4Srjs_mesa_marshal_MultiTexCoord2i(GLenum target, GLint s, GLint t)
298796c5ddc4Srjs{
298896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
298996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2i);
299096c5ddc4Srjs   struct marshal_cmd_MultiTexCoord2i *cmd;
299196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2i, cmd_size);
299296c5ddc4Srjs   cmd->target = target;
299396c5ddc4Srjs   cmd->s = s;
299496c5ddc4Srjs   cmd->t = t;
299596c5ddc4Srjs}
299696c5ddc4Srjs
299796c5ddc4Srjs
299896c5ddc4Srjs/* MultiTexCoord2iv: marshalled asynchronously */
299996c5ddc4Srjsstruct marshal_cmd_MultiTexCoord2iv
300096c5ddc4Srjs{
300196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
300296c5ddc4Srjs   GLenum target;
300396c5ddc4Srjs   GLint v[2];
300496c5ddc4Srjs};
300596c5ddc4Srjsuint32_t
300696c5ddc4Srjs_mesa_unmarshal_MultiTexCoord2iv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2iv *cmd, const uint64_t *last)
300796c5ddc4Srjs{
300896c5ddc4Srjs   GLenum target = cmd->target;
300996c5ddc4Srjs   const GLint * v = cmd->v;
301096c5ddc4Srjs   CALL_MultiTexCoord2iv(ctx->CurrentServerDispatch, (target, v));
301196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord2iv), 8) / 8);
301296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
301396c5ddc4Srjs   return cmd_size;
301496c5ddc4Srjs}
301596c5ddc4Srjsvoid GLAPIENTRY
301696c5ddc4Srjs_mesa_marshal_MultiTexCoord2iv(GLenum target, const GLint * v)
301796c5ddc4Srjs{
301896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
301996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2iv);
302096c5ddc4Srjs   struct marshal_cmd_MultiTexCoord2iv *cmd;
302196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2iv, cmd_size);
302296c5ddc4Srjs   cmd->target = target;
302396c5ddc4Srjs   memcpy(cmd->v, v, 2 * sizeof(GLint));
302496c5ddc4Srjs}
302596c5ddc4Srjs
302696c5ddc4Srjs
302796c5ddc4Srjs/* MultiTexCoord2s: marshalled asynchronously */
302896c5ddc4Srjsstruct marshal_cmd_MultiTexCoord2s
302996c5ddc4Srjs{
303096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
303196c5ddc4Srjs   GLshort s;
303296c5ddc4Srjs   GLshort t;
303396c5ddc4Srjs   GLenum target;
303496c5ddc4Srjs};
303596c5ddc4Srjsuint32_t
303696c5ddc4Srjs_mesa_unmarshal_MultiTexCoord2s(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2s *cmd, const uint64_t *last)
303796c5ddc4Srjs{
303896c5ddc4Srjs   GLenum target = cmd->target;
303996c5ddc4Srjs   GLshort s = cmd->s;
304096c5ddc4Srjs   GLshort t = cmd->t;
304196c5ddc4Srjs   CALL_MultiTexCoord2s(ctx->CurrentServerDispatch, (target, s, t));
304296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord2s), 8) / 8);
304396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
304496c5ddc4Srjs   return cmd_size;
304596c5ddc4Srjs}
304696c5ddc4Srjsvoid GLAPIENTRY
304796c5ddc4Srjs_mesa_marshal_MultiTexCoord2s(GLenum target, GLshort s, GLshort t)
304896c5ddc4Srjs{
304996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
305096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2s);
305196c5ddc4Srjs   struct marshal_cmd_MultiTexCoord2s *cmd;
305296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2s, cmd_size);
305396c5ddc4Srjs   cmd->target = target;
305496c5ddc4Srjs   cmd->s = s;
305596c5ddc4Srjs   cmd->t = t;
305696c5ddc4Srjs}
305796c5ddc4Srjs
305896c5ddc4Srjs
305996c5ddc4Srjs/* MultiTexCoord2sv: marshalled asynchronously */
306096c5ddc4Srjsstruct marshal_cmd_MultiTexCoord2sv
306196c5ddc4Srjs{
306296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
306396c5ddc4Srjs   GLenum target;
306496c5ddc4Srjs   GLshort v[2];
306596c5ddc4Srjs};
306696c5ddc4Srjsuint32_t
306796c5ddc4Srjs_mesa_unmarshal_MultiTexCoord2sv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2sv *cmd, const uint64_t *last)
306896c5ddc4Srjs{
306996c5ddc4Srjs   GLenum target = cmd->target;
307096c5ddc4Srjs   const GLshort * v = cmd->v;
307196c5ddc4Srjs   CALL_MultiTexCoord2sv(ctx->CurrentServerDispatch, (target, v));
307296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord2sv), 8) / 8);
307396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
307496c5ddc4Srjs   return cmd_size;
307596c5ddc4Srjs}
307696c5ddc4Srjsvoid GLAPIENTRY
307796c5ddc4Srjs_mesa_marshal_MultiTexCoord2sv(GLenum target, const GLshort * v)
307896c5ddc4Srjs{
307996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
308096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2sv);
308196c5ddc4Srjs   struct marshal_cmd_MultiTexCoord2sv *cmd;
308296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2sv, cmd_size);
308396c5ddc4Srjs   cmd->target = target;
308496c5ddc4Srjs   memcpy(cmd->v, v, 2 * sizeof(GLshort));
308596c5ddc4Srjs}
308696c5ddc4Srjs
308796c5ddc4Srjs
308896c5ddc4Srjs/* MultiTexCoord3d: marshalled asynchronously */
308996c5ddc4Srjsstruct marshal_cmd_MultiTexCoord3d
309096c5ddc4Srjs{
309196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
309296c5ddc4Srjs   GLenum target;
309396c5ddc4Srjs   GLdouble s;
309496c5ddc4Srjs   GLdouble t;
309596c5ddc4Srjs   GLdouble r;
309696c5ddc4Srjs};
309796c5ddc4Srjsuint32_t
309896c5ddc4Srjs_mesa_unmarshal_MultiTexCoord3d(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3d *cmd, const uint64_t *last)
309996c5ddc4Srjs{
310096c5ddc4Srjs   GLenum target = cmd->target;
310196c5ddc4Srjs   GLdouble s = cmd->s;
310296c5ddc4Srjs   GLdouble t = cmd->t;
310396c5ddc4Srjs   GLdouble r = cmd->r;
310496c5ddc4Srjs   CALL_MultiTexCoord3d(ctx->CurrentServerDispatch, (target, s, t, r));
310596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord3d), 8) / 8);
310696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
310796c5ddc4Srjs   return cmd_size;
310896c5ddc4Srjs}
310996c5ddc4Srjsvoid GLAPIENTRY
311096c5ddc4Srjs_mesa_marshal_MultiTexCoord3d(GLenum target, GLdouble s, GLdouble t, GLdouble r)
311196c5ddc4Srjs{
311296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
311396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3d);
311496c5ddc4Srjs   struct marshal_cmd_MultiTexCoord3d *cmd;
311596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3d, cmd_size);
311696c5ddc4Srjs   cmd->target = target;
311796c5ddc4Srjs   cmd->s = s;
311896c5ddc4Srjs   cmd->t = t;
311996c5ddc4Srjs   cmd->r = r;
312096c5ddc4Srjs}
312196c5ddc4Srjs
312296c5ddc4Srjs
312396c5ddc4Srjs/* MultiTexCoord3dv: marshalled asynchronously */
312496c5ddc4Srjsstruct marshal_cmd_MultiTexCoord3dv
312596c5ddc4Srjs{
312696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
312796c5ddc4Srjs   GLenum target;
312896c5ddc4Srjs   GLdouble v[3];
312996c5ddc4Srjs};
313096c5ddc4Srjsuint32_t
313196c5ddc4Srjs_mesa_unmarshal_MultiTexCoord3dv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3dv *cmd, const uint64_t *last)
313296c5ddc4Srjs{
313396c5ddc4Srjs   GLenum target = cmd->target;
313496c5ddc4Srjs   const GLdouble * v = cmd->v;
313596c5ddc4Srjs   CALL_MultiTexCoord3dv(ctx->CurrentServerDispatch, (target, v));
313696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord3dv), 8) / 8);
313796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
313896c5ddc4Srjs   return cmd_size;
313996c5ddc4Srjs}
314096c5ddc4Srjsvoid GLAPIENTRY
314196c5ddc4Srjs_mesa_marshal_MultiTexCoord3dv(GLenum target, const GLdouble * v)
314296c5ddc4Srjs{
314396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
314496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3dv);
314596c5ddc4Srjs   struct marshal_cmd_MultiTexCoord3dv *cmd;
314696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3dv, cmd_size);
314796c5ddc4Srjs   cmd->target = target;
314896c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLdouble));
314996c5ddc4Srjs}
315096c5ddc4Srjs
315196c5ddc4Srjs
315296c5ddc4Srjs/* MultiTexCoord3fARB: marshalled asynchronously */
315396c5ddc4Srjsstruct marshal_cmd_MultiTexCoord3fARB
315496c5ddc4Srjs{
315596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
315696c5ddc4Srjs   GLenum target;
315796c5ddc4Srjs   GLfloat s;
315896c5ddc4Srjs   GLfloat t;
315996c5ddc4Srjs   GLfloat r;
316096c5ddc4Srjs};
316196c5ddc4Srjsuint32_t
316296c5ddc4Srjs_mesa_unmarshal_MultiTexCoord3fARB(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3fARB *cmd, const uint64_t *last)
316396c5ddc4Srjs{
316496c5ddc4Srjs   GLenum target = cmd->target;
316596c5ddc4Srjs   GLfloat s = cmd->s;
316696c5ddc4Srjs   GLfloat t = cmd->t;
316796c5ddc4Srjs   GLfloat r = cmd->r;
316896c5ddc4Srjs   CALL_MultiTexCoord3fARB(ctx->CurrentServerDispatch, (target, s, t, r));
316996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord3fARB), 8) / 8);
317096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
317196c5ddc4Srjs   return cmd_size;
317296c5ddc4Srjs}
317396c5ddc4Srjsvoid GLAPIENTRY
317496c5ddc4Srjs_mesa_marshal_MultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r)
317596c5ddc4Srjs{
317696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
317796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3fARB);
317896c5ddc4Srjs   struct marshal_cmd_MultiTexCoord3fARB *cmd;
317996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3fARB, cmd_size);
318096c5ddc4Srjs   cmd->target = target;
318196c5ddc4Srjs   cmd->s = s;
318296c5ddc4Srjs   cmd->t = t;
318396c5ddc4Srjs   cmd->r = r;
318496c5ddc4Srjs}
318596c5ddc4Srjs
318696c5ddc4Srjs
318796c5ddc4Srjs/* MultiTexCoord3fvARB: marshalled asynchronously */
318896c5ddc4Srjsstruct marshal_cmd_MultiTexCoord3fvARB
318996c5ddc4Srjs{
319096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
319196c5ddc4Srjs   GLenum target;
319296c5ddc4Srjs   GLfloat v[3];
319396c5ddc4Srjs};
319496c5ddc4Srjsuint32_t
319596c5ddc4Srjs_mesa_unmarshal_MultiTexCoord3fvARB(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3fvARB *cmd, const uint64_t *last)
319696c5ddc4Srjs{
319796c5ddc4Srjs   GLenum target = cmd->target;
319896c5ddc4Srjs   const GLfloat * v = cmd->v;
319996c5ddc4Srjs   CALL_MultiTexCoord3fvARB(ctx->CurrentServerDispatch, (target, v));
320096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord3fvARB), 8) / 8);
320196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
320296c5ddc4Srjs   return cmd_size;
320396c5ddc4Srjs}
320496c5ddc4Srjsvoid GLAPIENTRY
320596c5ddc4Srjs_mesa_marshal_MultiTexCoord3fvARB(GLenum target, const GLfloat * v)
320696c5ddc4Srjs{
320796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
320896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3fvARB);
320996c5ddc4Srjs   struct marshal_cmd_MultiTexCoord3fvARB *cmd;
321096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3fvARB, cmd_size);
321196c5ddc4Srjs   cmd->target = target;
321296c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLfloat));
321396c5ddc4Srjs}
321496c5ddc4Srjs
321596c5ddc4Srjs
321696c5ddc4Srjs/* MultiTexCoord3i: marshalled asynchronously */
321796c5ddc4Srjsstruct marshal_cmd_MultiTexCoord3i
321896c5ddc4Srjs{
321996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
322096c5ddc4Srjs   GLenum target;
322196c5ddc4Srjs   GLint s;
322296c5ddc4Srjs   GLint t;
322396c5ddc4Srjs   GLint r;
322496c5ddc4Srjs};
322596c5ddc4Srjsuint32_t
322696c5ddc4Srjs_mesa_unmarshal_MultiTexCoord3i(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3i *cmd, const uint64_t *last)
322796c5ddc4Srjs{
322896c5ddc4Srjs   GLenum target = cmd->target;
322996c5ddc4Srjs   GLint s = cmd->s;
323096c5ddc4Srjs   GLint t = cmd->t;
323196c5ddc4Srjs   GLint r = cmd->r;
323296c5ddc4Srjs   CALL_MultiTexCoord3i(ctx->CurrentServerDispatch, (target, s, t, r));
323396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord3i), 8) / 8);
323496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
323596c5ddc4Srjs   return cmd_size;
323696c5ddc4Srjs}
323796c5ddc4Srjsvoid GLAPIENTRY
323896c5ddc4Srjs_mesa_marshal_MultiTexCoord3i(GLenum target, GLint s, GLint t, GLint r)
323996c5ddc4Srjs{
324096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
324196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3i);
324296c5ddc4Srjs   struct marshal_cmd_MultiTexCoord3i *cmd;
324396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3i, cmd_size);
324496c5ddc4Srjs   cmd->target = target;
324596c5ddc4Srjs   cmd->s = s;
324696c5ddc4Srjs   cmd->t = t;
324796c5ddc4Srjs   cmd->r = r;
324896c5ddc4Srjs}
324996c5ddc4Srjs
325096c5ddc4Srjs
325196c5ddc4Srjs/* MultiTexCoord3iv: marshalled asynchronously */
325296c5ddc4Srjsstruct marshal_cmd_MultiTexCoord3iv
325396c5ddc4Srjs{
325496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
325596c5ddc4Srjs   GLenum target;
325696c5ddc4Srjs   GLint v[3];
325796c5ddc4Srjs};
325896c5ddc4Srjsuint32_t
325996c5ddc4Srjs_mesa_unmarshal_MultiTexCoord3iv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3iv *cmd, const uint64_t *last)
326096c5ddc4Srjs{
326196c5ddc4Srjs   GLenum target = cmd->target;
326296c5ddc4Srjs   const GLint * v = cmd->v;
326396c5ddc4Srjs   CALL_MultiTexCoord3iv(ctx->CurrentServerDispatch, (target, v));
326496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord3iv), 8) / 8);
326596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
326696c5ddc4Srjs   return cmd_size;
326796c5ddc4Srjs}
326896c5ddc4Srjsvoid GLAPIENTRY
326996c5ddc4Srjs_mesa_marshal_MultiTexCoord3iv(GLenum target, const GLint * v)
327096c5ddc4Srjs{
327196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
327296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3iv);
327396c5ddc4Srjs   struct marshal_cmd_MultiTexCoord3iv *cmd;
327496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3iv, cmd_size);
327596c5ddc4Srjs   cmd->target = target;
327696c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLint));
327796c5ddc4Srjs}
327896c5ddc4Srjs
327996c5ddc4Srjs
328096c5ddc4Srjs/* MultiTexCoord3s: marshalled asynchronously */
328196c5ddc4Srjsstruct marshal_cmd_MultiTexCoord3s
328296c5ddc4Srjs{
328396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
328496c5ddc4Srjs   GLshort s;
328596c5ddc4Srjs   GLshort t;
328696c5ddc4Srjs   GLshort r;
328796c5ddc4Srjs   GLenum target;
328896c5ddc4Srjs};
328996c5ddc4Srjsuint32_t
329096c5ddc4Srjs_mesa_unmarshal_MultiTexCoord3s(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3s *cmd, const uint64_t *last)
329196c5ddc4Srjs{
329296c5ddc4Srjs   GLenum target = cmd->target;
329396c5ddc4Srjs   GLshort s = cmd->s;
329496c5ddc4Srjs   GLshort t = cmd->t;
329596c5ddc4Srjs   GLshort r = cmd->r;
329696c5ddc4Srjs   CALL_MultiTexCoord3s(ctx->CurrentServerDispatch, (target, s, t, r));
329796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord3s), 8) / 8);
329896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
329996c5ddc4Srjs   return cmd_size;
330096c5ddc4Srjs}
330196c5ddc4Srjsvoid GLAPIENTRY
330296c5ddc4Srjs_mesa_marshal_MultiTexCoord3s(GLenum target, GLshort s, GLshort t, GLshort r)
330396c5ddc4Srjs{
330496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
330596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3s);
330696c5ddc4Srjs   struct marshal_cmd_MultiTexCoord3s *cmd;
330796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3s, cmd_size);
330896c5ddc4Srjs   cmd->target = target;
330996c5ddc4Srjs   cmd->s = s;
331096c5ddc4Srjs   cmd->t = t;
331196c5ddc4Srjs   cmd->r = r;
331296c5ddc4Srjs}
331396c5ddc4Srjs
331496c5ddc4Srjs
331596c5ddc4Srjs/* MultiTexCoord3sv: marshalled asynchronously */
331696c5ddc4Srjsstruct marshal_cmd_MultiTexCoord3sv
331796c5ddc4Srjs{
331896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
331996c5ddc4Srjs   GLenum target;
332096c5ddc4Srjs   GLshort v[3];
332196c5ddc4Srjs};
332296c5ddc4Srjsuint32_t
332396c5ddc4Srjs_mesa_unmarshal_MultiTexCoord3sv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3sv *cmd, const uint64_t *last)
332496c5ddc4Srjs{
332596c5ddc4Srjs   GLenum target = cmd->target;
332696c5ddc4Srjs   const GLshort * v = cmd->v;
332796c5ddc4Srjs   CALL_MultiTexCoord3sv(ctx->CurrentServerDispatch, (target, v));
332896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord3sv), 8) / 8);
332996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
333096c5ddc4Srjs   return cmd_size;
333196c5ddc4Srjs}
333296c5ddc4Srjsvoid GLAPIENTRY
333396c5ddc4Srjs_mesa_marshal_MultiTexCoord3sv(GLenum target, const GLshort * v)
333496c5ddc4Srjs{
333596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
333696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3sv);
333796c5ddc4Srjs   struct marshal_cmd_MultiTexCoord3sv *cmd;
333896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3sv, cmd_size);
333996c5ddc4Srjs   cmd->target = target;
334096c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLshort));
334196c5ddc4Srjs}
334296c5ddc4Srjs
334396c5ddc4Srjs
334496c5ddc4Srjs/* MultiTexCoord4d: marshalled asynchronously */
334596c5ddc4Srjsstruct marshal_cmd_MultiTexCoord4d
334696c5ddc4Srjs{
334796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
334896c5ddc4Srjs   GLenum target;
334996c5ddc4Srjs   GLdouble s;
335096c5ddc4Srjs   GLdouble t;
335196c5ddc4Srjs   GLdouble r;
335296c5ddc4Srjs   GLdouble q;
335396c5ddc4Srjs};
335496c5ddc4Srjsuint32_t
335596c5ddc4Srjs_mesa_unmarshal_MultiTexCoord4d(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4d *cmd, const uint64_t *last)
335696c5ddc4Srjs{
335796c5ddc4Srjs   GLenum target = cmd->target;
335896c5ddc4Srjs   GLdouble s = cmd->s;
335996c5ddc4Srjs   GLdouble t = cmd->t;
336096c5ddc4Srjs   GLdouble r = cmd->r;
336196c5ddc4Srjs   GLdouble q = cmd->q;
336296c5ddc4Srjs   CALL_MultiTexCoord4d(ctx->CurrentServerDispatch, (target, s, t, r, q));
336396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord4d), 8) / 8);
336496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
336596c5ddc4Srjs   return cmd_size;
336696c5ddc4Srjs}
336796c5ddc4Srjsvoid GLAPIENTRY
336896c5ddc4Srjs_mesa_marshal_MultiTexCoord4d(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
336996c5ddc4Srjs{
337096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
337196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4d);
337296c5ddc4Srjs   struct marshal_cmd_MultiTexCoord4d *cmd;
337396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4d, cmd_size);
337496c5ddc4Srjs   cmd->target = target;
337596c5ddc4Srjs   cmd->s = s;
337696c5ddc4Srjs   cmd->t = t;
337796c5ddc4Srjs   cmd->r = r;
337896c5ddc4Srjs   cmd->q = q;
337996c5ddc4Srjs}
338096c5ddc4Srjs
338196c5ddc4Srjs
338296c5ddc4Srjs/* MultiTexCoord4dv: marshalled asynchronously */
338396c5ddc4Srjsstruct marshal_cmd_MultiTexCoord4dv
338496c5ddc4Srjs{
338596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
338696c5ddc4Srjs   GLenum target;
338796c5ddc4Srjs   GLdouble v[4];
338896c5ddc4Srjs};
338996c5ddc4Srjsuint32_t
339096c5ddc4Srjs_mesa_unmarshal_MultiTexCoord4dv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4dv *cmd, const uint64_t *last)
339196c5ddc4Srjs{
339296c5ddc4Srjs   GLenum target = cmd->target;
339396c5ddc4Srjs   const GLdouble * v = cmd->v;
339496c5ddc4Srjs   CALL_MultiTexCoord4dv(ctx->CurrentServerDispatch, (target, v));
339596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord4dv), 8) / 8);
339696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
339796c5ddc4Srjs   return cmd_size;
339896c5ddc4Srjs}
339996c5ddc4Srjsvoid GLAPIENTRY
340096c5ddc4Srjs_mesa_marshal_MultiTexCoord4dv(GLenum target, const GLdouble * v)
340196c5ddc4Srjs{
340296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
340396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4dv);
340496c5ddc4Srjs   struct marshal_cmd_MultiTexCoord4dv *cmd;
340596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4dv, cmd_size);
340696c5ddc4Srjs   cmd->target = target;
340796c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLdouble));
340896c5ddc4Srjs}
340996c5ddc4Srjs
341096c5ddc4Srjs
341196c5ddc4Srjs/* MultiTexCoord4fARB: marshalled asynchronously */
341296c5ddc4Srjsstruct marshal_cmd_MultiTexCoord4fARB
341396c5ddc4Srjs{
341496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
341596c5ddc4Srjs   GLenum target;
341696c5ddc4Srjs   GLfloat s;
341796c5ddc4Srjs   GLfloat t;
341896c5ddc4Srjs   GLfloat r;
341996c5ddc4Srjs   GLfloat q;
342096c5ddc4Srjs};
342196c5ddc4Srjsuint32_t
342296c5ddc4Srjs_mesa_unmarshal_MultiTexCoord4fARB(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4fARB *cmd, const uint64_t *last)
342396c5ddc4Srjs{
342496c5ddc4Srjs   GLenum target = cmd->target;
342596c5ddc4Srjs   GLfloat s = cmd->s;
342696c5ddc4Srjs   GLfloat t = cmd->t;
342796c5ddc4Srjs   GLfloat r = cmd->r;
342896c5ddc4Srjs   GLfloat q = cmd->q;
342996c5ddc4Srjs   CALL_MultiTexCoord4fARB(ctx->CurrentServerDispatch, (target, s, t, r, q));
343096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord4fARB), 8) / 8);
343196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
343296c5ddc4Srjs   return cmd_size;
343396c5ddc4Srjs}
343496c5ddc4Srjsvoid GLAPIENTRY
343596c5ddc4Srjs_mesa_marshal_MultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
343696c5ddc4Srjs{
343796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
343896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4fARB);
343996c5ddc4Srjs   struct marshal_cmd_MultiTexCoord4fARB *cmd;
344096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4fARB, cmd_size);
344196c5ddc4Srjs   cmd->target = target;
344296c5ddc4Srjs   cmd->s = s;
344396c5ddc4Srjs   cmd->t = t;
344496c5ddc4Srjs   cmd->r = r;
344596c5ddc4Srjs   cmd->q = q;
344696c5ddc4Srjs}
344796c5ddc4Srjs
344896c5ddc4Srjs
344996c5ddc4Srjs/* MultiTexCoord4fvARB: marshalled asynchronously */
345096c5ddc4Srjsstruct marshal_cmd_MultiTexCoord4fvARB
345196c5ddc4Srjs{
345296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
345396c5ddc4Srjs   GLenum target;
345496c5ddc4Srjs   GLfloat v[4];
345596c5ddc4Srjs};
345696c5ddc4Srjsuint32_t
345796c5ddc4Srjs_mesa_unmarshal_MultiTexCoord4fvARB(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4fvARB *cmd, const uint64_t *last)
345896c5ddc4Srjs{
345996c5ddc4Srjs   GLenum target = cmd->target;
346096c5ddc4Srjs   const GLfloat * v = cmd->v;
346196c5ddc4Srjs   CALL_MultiTexCoord4fvARB(ctx->CurrentServerDispatch, (target, v));
346296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord4fvARB), 8) / 8);
346396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
346496c5ddc4Srjs   return cmd_size;
346596c5ddc4Srjs}
346696c5ddc4Srjsvoid GLAPIENTRY
346796c5ddc4Srjs_mesa_marshal_MultiTexCoord4fvARB(GLenum target, const GLfloat * v)
346896c5ddc4Srjs{
346996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
347096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4fvARB);
347196c5ddc4Srjs   struct marshal_cmd_MultiTexCoord4fvARB *cmd;
347296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4fvARB, cmd_size);
347396c5ddc4Srjs   cmd->target = target;
347496c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLfloat));
347596c5ddc4Srjs}
347696c5ddc4Srjs
347796c5ddc4Srjs
347896c5ddc4Srjs/* MultiTexCoord4i: marshalled asynchronously */
347996c5ddc4Srjsstruct marshal_cmd_MultiTexCoord4i
348096c5ddc4Srjs{
348196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
348296c5ddc4Srjs   GLenum target;
348396c5ddc4Srjs   GLint s;
348496c5ddc4Srjs   GLint t;
348596c5ddc4Srjs   GLint r;
348696c5ddc4Srjs   GLint q;
348796c5ddc4Srjs};
348896c5ddc4Srjsuint32_t
348996c5ddc4Srjs_mesa_unmarshal_MultiTexCoord4i(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4i *cmd, const uint64_t *last)
349096c5ddc4Srjs{
349196c5ddc4Srjs   GLenum target = cmd->target;
349296c5ddc4Srjs   GLint s = cmd->s;
349396c5ddc4Srjs   GLint t = cmd->t;
349496c5ddc4Srjs   GLint r = cmd->r;
349596c5ddc4Srjs   GLint q = cmd->q;
349696c5ddc4Srjs   CALL_MultiTexCoord4i(ctx->CurrentServerDispatch, (target, s, t, r, q));
349796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord4i), 8) / 8);
349896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
349996c5ddc4Srjs   return cmd_size;
350096c5ddc4Srjs}
350196c5ddc4Srjsvoid GLAPIENTRY
350296c5ddc4Srjs_mesa_marshal_MultiTexCoord4i(GLenum target, GLint s, GLint t, GLint r, GLint q)
350396c5ddc4Srjs{
350496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
350596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4i);
350696c5ddc4Srjs   struct marshal_cmd_MultiTexCoord4i *cmd;
350796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4i, cmd_size);
350896c5ddc4Srjs   cmd->target = target;
350996c5ddc4Srjs   cmd->s = s;
351096c5ddc4Srjs   cmd->t = t;
351196c5ddc4Srjs   cmd->r = r;
351296c5ddc4Srjs   cmd->q = q;
351396c5ddc4Srjs}
351496c5ddc4Srjs
351596c5ddc4Srjs
351696c5ddc4Srjs/* MultiTexCoord4iv: marshalled asynchronously */
351796c5ddc4Srjsstruct marshal_cmd_MultiTexCoord4iv
351896c5ddc4Srjs{
351996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
352096c5ddc4Srjs   GLenum target;
352196c5ddc4Srjs   GLint v[4];
352296c5ddc4Srjs};
352396c5ddc4Srjsuint32_t
352496c5ddc4Srjs_mesa_unmarshal_MultiTexCoord4iv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4iv *cmd, const uint64_t *last)
352596c5ddc4Srjs{
352696c5ddc4Srjs   GLenum target = cmd->target;
352796c5ddc4Srjs   const GLint * v = cmd->v;
352896c5ddc4Srjs   CALL_MultiTexCoord4iv(ctx->CurrentServerDispatch, (target, v));
352996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord4iv), 8) / 8);
353096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
353196c5ddc4Srjs   return cmd_size;
353296c5ddc4Srjs}
353396c5ddc4Srjsvoid GLAPIENTRY
353496c5ddc4Srjs_mesa_marshal_MultiTexCoord4iv(GLenum target, const GLint * v)
353596c5ddc4Srjs{
353696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
353796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4iv);
353896c5ddc4Srjs   struct marshal_cmd_MultiTexCoord4iv *cmd;
353996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4iv, cmd_size);
354096c5ddc4Srjs   cmd->target = target;
354196c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLint));
354296c5ddc4Srjs}
354396c5ddc4Srjs
354496c5ddc4Srjs
354596c5ddc4Srjs/* MultiTexCoord4s: marshalled asynchronously */
354696c5ddc4Srjsstruct marshal_cmd_MultiTexCoord4s
354796c5ddc4Srjs{
354896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
354996c5ddc4Srjs   GLshort s;
355096c5ddc4Srjs   GLshort t;
355196c5ddc4Srjs   GLshort r;
355296c5ddc4Srjs   GLshort q;
355396c5ddc4Srjs   GLenum target;
355496c5ddc4Srjs};
355596c5ddc4Srjsuint32_t
355696c5ddc4Srjs_mesa_unmarshal_MultiTexCoord4s(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4s *cmd, const uint64_t *last)
355796c5ddc4Srjs{
355896c5ddc4Srjs   GLenum target = cmd->target;
355996c5ddc4Srjs   GLshort s = cmd->s;
356096c5ddc4Srjs   GLshort t = cmd->t;
356196c5ddc4Srjs   GLshort r = cmd->r;
356296c5ddc4Srjs   GLshort q = cmd->q;
356396c5ddc4Srjs   CALL_MultiTexCoord4s(ctx->CurrentServerDispatch, (target, s, t, r, q));
356496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord4s), 8) / 8);
356596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
356696c5ddc4Srjs   return cmd_size;
356796c5ddc4Srjs}
356896c5ddc4Srjsvoid GLAPIENTRY
356996c5ddc4Srjs_mesa_marshal_MultiTexCoord4s(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
357096c5ddc4Srjs{
357196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
357296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4s);
357396c5ddc4Srjs   struct marshal_cmd_MultiTexCoord4s *cmd;
357496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4s, cmd_size);
357596c5ddc4Srjs   cmd->target = target;
357696c5ddc4Srjs   cmd->s = s;
357796c5ddc4Srjs   cmd->t = t;
357896c5ddc4Srjs   cmd->r = r;
357996c5ddc4Srjs   cmd->q = q;
358096c5ddc4Srjs}
358196c5ddc4Srjs
358296c5ddc4Srjs
358396c5ddc4Srjs/* MultiTexCoord4sv: marshalled asynchronously */
358496c5ddc4Srjsstruct marshal_cmd_MultiTexCoord4sv
358596c5ddc4Srjs{
358696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
358796c5ddc4Srjs   GLenum target;
358896c5ddc4Srjs   GLshort v[4];
358996c5ddc4Srjs};
359096c5ddc4Srjsuint32_t
359196c5ddc4Srjs_mesa_unmarshal_MultiTexCoord4sv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4sv *cmd, const uint64_t *last)
359296c5ddc4Srjs{
359396c5ddc4Srjs   GLenum target = cmd->target;
359496c5ddc4Srjs   const GLshort * v = cmd->v;
359596c5ddc4Srjs   CALL_MultiTexCoord4sv(ctx->CurrentServerDispatch, (target, v));
359696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord4sv), 8) / 8);
359796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
359896c5ddc4Srjs   return cmd_size;
359996c5ddc4Srjs}
360096c5ddc4Srjsvoid GLAPIENTRY
360196c5ddc4Srjs_mesa_marshal_MultiTexCoord4sv(GLenum target, const GLshort * v)
360296c5ddc4Srjs{
360396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
360496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4sv);
360596c5ddc4Srjs   struct marshal_cmd_MultiTexCoord4sv *cmd;
360696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4sv, cmd_size);
360796c5ddc4Srjs   cmd->target = target;
360896c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLshort));
360996c5ddc4Srjs}
361096c5ddc4Srjs
361196c5ddc4Srjs
361296c5ddc4Srjs/* LoadTransposeMatrixf: marshalled asynchronously */
361396c5ddc4Srjsstruct marshal_cmd_LoadTransposeMatrixf
361496c5ddc4Srjs{
361596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
361696c5ddc4Srjs   GLfloat m[16];
361796c5ddc4Srjs};
361896c5ddc4Srjsuint32_t
361996c5ddc4Srjs_mesa_unmarshal_LoadTransposeMatrixf(struct gl_context *ctx, const struct marshal_cmd_LoadTransposeMatrixf *cmd, const uint64_t *last)
362096c5ddc4Srjs{
362196c5ddc4Srjs   const GLfloat * m = cmd->m;
362296c5ddc4Srjs   CALL_LoadTransposeMatrixf(ctx->CurrentServerDispatch, (m));
362396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_LoadTransposeMatrixf), 8) / 8);
362496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
362596c5ddc4Srjs   return cmd_size;
362696c5ddc4Srjs}
362796c5ddc4Srjsvoid GLAPIENTRY
362896c5ddc4Srjs_mesa_marshal_LoadTransposeMatrixf(const GLfloat * m)
362996c5ddc4Srjs{
363096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
363196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_LoadTransposeMatrixf);
363296c5ddc4Srjs   struct marshal_cmd_LoadTransposeMatrixf *cmd;
363396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LoadTransposeMatrixf, cmd_size);
363496c5ddc4Srjs   memcpy(cmd->m, m, 16 * sizeof(GLfloat));
363596c5ddc4Srjs}
363696c5ddc4Srjs
363796c5ddc4Srjs
363896c5ddc4Srjs/* LoadTransposeMatrixd: marshalled asynchronously */
363996c5ddc4Srjsstruct marshal_cmd_LoadTransposeMatrixd
364096c5ddc4Srjs{
364196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
364296c5ddc4Srjs   GLdouble m[16];
364396c5ddc4Srjs};
364496c5ddc4Srjsuint32_t
364596c5ddc4Srjs_mesa_unmarshal_LoadTransposeMatrixd(struct gl_context *ctx, const struct marshal_cmd_LoadTransposeMatrixd *cmd, const uint64_t *last)
364696c5ddc4Srjs{
364796c5ddc4Srjs   const GLdouble * m = cmd->m;
364896c5ddc4Srjs   CALL_LoadTransposeMatrixd(ctx->CurrentServerDispatch, (m));
364996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_LoadTransposeMatrixd), 8) / 8);
365096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
365196c5ddc4Srjs   return cmd_size;
365296c5ddc4Srjs}
365396c5ddc4Srjsvoid GLAPIENTRY
365496c5ddc4Srjs_mesa_marshal_LoadTransposeMatrixd(const GLdouble * m)
365596c5ddc4Srjs{
365696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
365796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_LoadTransposeMatrixd);
365896c5ddc4Srjs   struct marshal_cmd_LoadTransposeMatrixd *cmd;
365996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LoadTransposeMatrixd, cmd_size);
366096c5ddc4Srjs   memcpy(cmd->m, m, 16 * sizeof(GLdouble));
366196c5ddc4Srjs}
366296c5ddc4Srjs
366396c5ddc4Srjs
366496c5ddc4Srjs/* MultTransposeMatrixf: marshalled asynchronously */
366596c5ddc4Srjsstruct marshal_cmd_MultTransposeMatrixf
366696c5ddc4Srjs{
366796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
366896c5ddc4Srjs   GLfloat m[16];
366996c5ddc4Srjs};
367096c5ddc4Srjsuint32_t
367196c5ddc4Srjs_mesa_unmarshal_MultTransposeMatrixf(struct gl_context *ctx, const struct marshal_cmd_MultTransposeMatrixf *cmd, const uint64_t *last)
367296c5ddc4Srjs{
367396c5ddc4Srjs   const GLfloat * m = cmd->m;
367496c5ddc4Srjs   CALL_MultTransposeMatrixf(ctx->CurrentServerDispatch, (m));
367596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultTransposeMatrixf), 8) / 8);
367696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
367796c5ddc4Srjs   return cmd_size;
367896c5ddc4Srjs}
367996c5ddc4Srjsvoid GLAPIENTRY
368096c5ddc4Srjs_mesa_marshal_MultTransposeMatrixf(const GLfloat * m)
368196c5ddc4Srjs{
368296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
368396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultTransposeMatrixf);
368496c5ddc4Srjs   struct marshal_cmd_MultTransposeMatrixf *cmd;
368596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultTransposeMatrixf, cmd_size);
368696c5ddc4Srjs   memcpy(cmd->m, m, 16 * sizeof(GLfloat));
368796c5ddc4Srjs}
368896c5ddc4Srjs
368996c5ddc4Srjs
369096c5ddc4Srjs/* MultTransposeMatrixd: marshalled asynchronously */
369196c5ddc4Srjsstruct marshal_cmd_MultTransposeMatrixd
369296c5ddc4Srjs{
369396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
369496c5ddc4Srjs   GLdouble m[16];
369596c5ddc4Srjs};
369696c5ddc4Srjsuint32_t
369796c5ddc4Srjs_mesa_unmarshal_MultTransposeMatrixd(struct gl_context *ctx, const struct marshal_cmd_MultTransposeMatrixd *cmd, const uint64_t *last)
369896c5ddc4Srjs{
369996c5ddc4Srjs   const GLdouble * m = cmd->m;
370096c5ddc4Srjs   CALL_MultTransposeMatrixd(ctx->CurrentServerDispatch, (m));
370196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultTransposeMatrixd), 8) / 8);
370296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
370396c5ddc4Srjs   return cmd_size;
370496c5ddc4Srjs}
370596c5ddc4Srjsvoid GLAPIENTRY
370696c5ddc4Srjs_mesa_marshal_MultTransposeMatrixd(const GLdouble * m)
370796c5ddc4Srjs{
370896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
370996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultTransposeMatrixd);
371096c5ddc4Srjs   struct marshal_cmd_MultTransposeMatrixd *cmd;
371196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultTransposeMatrixd, cmd_size);
371296c5ddc4Srjs   memcpy(cmd->m, m, 16 * sizeof(GLdouble));
371396c5ddc4Srjs}
371496c5ddc4Srjs
371596c5ddc4Srjs
371696c5ddc4Srjs/* SampleCoverage: marshalled asynchronously */
371796c5ddc4Srjsstruct marshal_cmd_SampleCoverage
371896c5ddc4Srjs{
371996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
372096c5ddc4Srjs   GLboolean invert;
372196c5ddc4Srjs   GLclampf value;
372296c5ddc4Srjs};
372396c5ddc4Srjsuint32_t
372496c5ddc4Srjs_mesa_unmarshal_SampleCoverage(struct gl_context *ctx, const struct marshal_cmd_SampleCoverage *cmd, const uint64_t *last)
372596c5ddc4Srjs{
372696c5ddc4Srjs   GLclampf value = cmd->value;
372796c5ddc4Srjs   GLboolean invert = cmd->invert;
372896c5ddc4Srjs   CALL_SampleCoverage(ctx->CurrentServerDispatch, (value, invert));
372996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SampleCoverage), 8) / 8);
373096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
373196c5ddc4Srjs   return cmd_size;
373296c5ddc4Srjs}
373396c5ddc4Srjsvoid GLAPIENTRY
373496c5ddc4Srjs_mesa_marshal_SampleCoverage(GLclampf value, GLboolean invert)
373596c5ddc4Srjs{
373696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
373796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SampleCoverage);
373896c5ddc4Srjs   struct marshal_cmd_SampleCoverage *cmd;
373996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SampleCoverage, cmd_size);
374096c5ddc4Srjs   cmd->value = value;
374196c5ddc4Srjs   cmd->invert = invert;
374296c5ddc4Srjs}
374396c5ddc4Srjs
374496c5ddc4Srjs
374596c5ddc4Srjs/* CompressedTexImage3D: marshalled asynchronously */
374696c5ddc4Srjsstruct marshal_cmd_CompressedTexImage3D
374796c5ddc4Srjs{
374896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
374996c5ddc4Srjs   GLenum target;
375096c5ddc4Srjs   GLint level;
375196c5ddc4Srjs   GLenum internalformat;
375296c5ddc4Srjs   GLsizei width;
375396c5ddc4Srjs   GLsizei height;
375496c5ddc4Srjs   GLsizei depth;
375596c5ddc4Srjs   GLint border;
375696c5ddc4Srjs   GLsizei imageSize;
375796c5ddc4Srjs   const GLvoid * data;
375896c5ddc4Srjs};
375996c5ddc4Srjsuint32_t
376096c5ddc4Srjs_mesa_unmarshal_CompressedTexImage3D(struct gl_context *ctx, const struct marshal_cmd_CompressedTexImage3D *cmd, const uint64_t *last)
376196c5ddc4Srjs{
376296c5ddc4Srjs   GLenum target = cmd->target;
376396c5ddc4Srjs   GLint level = cmd->level;
376496c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
376596c5ddc4Srjs   GLsizei width = cmd->width;
376696c5ddc4Srjs   GLsizei height = cmd->height;
376796c5ddc4Srjs   GLsizei depth = cmd->depth;
376896c5ddc4Srjs   GLint border = cmd->border;
376996c5ddc4Srjs   GLsizei imageSize = cmd->imageSize;
377096c5ddc4Srjs   const GLvoid * data = cmd->data;
377196c5ddc4Srjs   CALL_CompressedTexImage3D(ctx->CurrentServerDispatch, (target, level, internalformat, width, height, depth, border, imageSize, data));
377296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CompressedTexImage3D), 8) / 8);
377396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
377496c5ddc4Srjs   return cmd_size;
377596c5ddc4Srjs}
377696c5ddc4Srjsvoid GLAPIENTRY
377796c5ddc4Srjs_mesa_marshal_CompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data)
377896c5ddc4Srjs{
377996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
378096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CompressedTexImage3D);
378196c5ddc4Srjs   struct marshal_cmd_CompressedTexImage3D *cmd;
378296c5ddc4Srjs   if (_mesa_glthread_has_no_unpack_buffer(ctx)) {
378396c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "CompressedTexImage3D");
378496c5ddc4Srjs      CALL_CompressedTexImage3D(ctx->CurrentServerDispatch, (target, level, internalformat, width, height, depth, border, imageSize, data));
378596c5ddc4Srjs      return;
378696c5ddc4Srjs   }
378796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CompressedTexImage3D, cmd_size);
378896c5ddc4Srjs   cmd->target = target;
378996c5ddc4Srjs   cmd->level = level;
379096c5ddc4Srjs   cmd->internalformat = internalformat;
379196c5ddc4Srjs   cmd->width = width;
379296c5ddc4Srjs   cmd->height = height;
379396c5ddc4Srjs   cmd->depth = depth;
379496c5ddc4Srjs   cmd->border = border;
379596c5ddc4Srjs   cmd->imageSize = imageSize;
379696c5ddc4Srjs   cmd->data = data;
379796c5ddc4Srjs}
379896c5ddc4Srjs
379996c5ddc4Srjs
380096c5ddc4Srjs/* CompressedTexImage2D: marshalled asynchronously */
380196c5ddc4Srjsstruct marshal_cmd_CompressedTexImage2D
380296c5ddc4Srjs{
380396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
380496c5ddc4Srjs   GLenum target;
380596c5ddc4Srjs   GLint level;
380696c5ddc4Srjs   GLenum internalformat;
380796c5ddc4Srjs   GLsizei width;
380896c5ddc4Srjs   GLsizei height;
380996c5ddc4Srjs   GLint border;
381096c5ddc4Srjs   GLsizei imageSize;
381196c5ddc4Srjs   const GLvoid * data;
381296c5ddc4Srjs};
381396c5ddc4Srjsuint32_t
381496c5ddc4Srjs_mesa_unmarshal_CompressedTexImage2D(struct gl_context *ctx, const struct marshal_cmd_CompressedTexImage2D *cmd, const uint64_t *last)
381596c5ddc4Srjs{
381696c5ddc4Srjs   GLenum target = cmd->target;
381796c5ddc4Srjs   GLint level = cmd->level;
381896c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
381996c5ddc4Srjs   GLsizei width = cmd->width;
382096c5ddc4Srjs   GLsizei height = cmd->height;
382196c5ddc4Srjs   GLint border = cmd->border;
382296c5ddc4Srjs   GLsizei imageSize = cmd->imageSize;
382396c5ddc4Srjs   const GLvoid * data = cmd->data;
382496c5ddc4Srjs   CALL_CompressedTexImage2D(ctx->CurrentServerDispatch, (target, level, internalformat, width, height, border, imageSize, data));
382596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CompressedTexImage2D), 8) / 8);
382696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
382796c5ddc4Srjs   return cmd_size;
382896c5ddc4Srjs}
382996c5ddc4Srjsvoid GLAPIENTRY
383096c5ddc4Srjs_mesa_marshal_CompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data)
383196c5ddc4Srjs{
383296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
383396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CompressedTexImage2D);
383496c5ddc4Srjs   struct marshal_cmd_CompressedTexImage2D *cmd;
383596c5ddc4Srjs   if (_mesa_glthread_has_no_unpack_buffer(ctx)) {
383696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "CompressedTexImage2D");
383796c5ddc4Srjs      CALL_CompressedTexImage2D(ctx->CurrentServerDispatch, (target, level, internalformat, width, height, border, imageSize, data));
383896c5ddc4Srjs      return;
383996c5ddc4Srjs   }
384096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CompressedTexImage2D, cmd_size);
384196c5ddc4Srjs   cmd->target = target;
384296c5ddc4Srjs   cmd->level = level;
384396c5ddc4Srjs   cmd->internalformat = internalformat;
384496c5ddc4Srjs   cmd->width = width;
384596c5ddc4Srjs   cmd->height = height;
384696c5ddc4Srjs   cmd->border = border;
384796c5ddc4Srjs   cmd->imageSize = imageSize;
384896c5ddc4Srjs   cmd->data = data;
384996c5ddc4Srjs}
385096c5ddc4Srjs
385196c5ddc4Srjs
385296c5ddc4Srjs/* CompressedTexImage1D: marshalled asynchronously */
385396c5ddc4Srjsstruct marshal_cmd_CompressedTexImage1D
385496c5ddc4Srjs{
385596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
385696c5ddc4Srjs   GLenum target;
385796c5ddc4Srjs   GLint level;
385896c5ddc4Srjs   GLenum internalformat;
385996c5ddc4Srjs   GLsizei width;
386096c5ddc4Srjs   GLint border;
386196c5ddc4Srjs   GLsizei imageSize;
386296c5ddc4Srjs   const GLvoid * data;
386396c5ddc4Srjs};
386496c5ddc4Srjsuint32_t
386596c5ddc4Srjs_mesa_unmarshal_CompressedTexImage1D(struct gl_context *ctx, const struct marshal_cmd_CompressedTexImage1D *cmd, const uint64_t *last)
386696c5ddc4Srjs{
386796c5ddc4Srjs   GLenum target = cmd->target;
386896c5ddc4Srjs   GLint level = cmd->level;
386996c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
387096c5ddc4Srjs   GLsizei width = cmd->width;
387196c5ddc4Srjs   GLint border = cmd->border;
387296c5ddc4Srjs   GLsizei imageSize = cmd->imageSize;
387396c5ddc4Srjs   const GLvoid * data = cmd->data;
387496c5ddc4Srjs   CALL_CompressedTexImage1D(ctx->CurrentServerDispatch, (target, level, internalformat, width, border, imageSize, data));
387596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CompressedTexImage1D), 8) / 8);
387696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
387796c5ddc4Srjs   return cmd_size;
387896c5ddc4Srjs}
387996c5ddc4Srjsvoid GLAPIENTRY
388096c5ddc4Srjs_mesa_marshal_CompressedTexImage1D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data)
388196c5ddc4Srjs{
388296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
388396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CompressedTexImage1D);
388496c5ddc4Srjs   struct marshal_cmd_CompressedTexImage1D *cmd;
388596c5ddc4Srjs   if (_mesa_glthread_has_no_unpack_buffer(ctx)) {
388696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "CompressedTexImage1D");
388796c5ddc4Srjs      CALL_CompressedTexImage1D(ctx->CurrentServerDispatch, (target, level, internalformat, width, border, imageSize, data));
388896c5ddc4Srjs      return;
388996c5ddc4Srjs   }
389096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CompressedTexImage1D, cmd_size);
389196c5ddc4Srjs   cmd->target = target;
389296c5ddc4Srjs   cmd->level = level;
389396c5ddc4Srjs   cmd->internalformat = internalformat;
389496c5ddc4Srjs   cmd->width = width;
389596c5ddc4Srjs   cmd->border = border;
389696c5ddc4Srjs   cmd->imageSize = imageSize;
389796c5ddc4Srjs   cmd->data = data;
389896c5ddc4Srjs}
389996c5ddc4Srjs
390096c5ddc4Srjs
390196c5ddc4Srjs/* CompressedTexSubImage3D: marshalled asynchronously */
390296c5ddc4Srjsstruct marshal_cmd_CompressedTexSubImage3D
390396c5ddc4Srjs{
390496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
390596c5ddc4Srjs   GLenum target;
390696c5ddc4Srjs   GLint level;
390796c5ddc4Srjs   GLint xoffset;
390896c5ddc4Srjs   GLint yoffset;
390996c5ddc4Srjs   GLint zoffset;
391096c5ddc4Srjs   GLsizei width;
391196c5ddc4Srjs   GLsizei height;
391296c5ddc4Srjs   GLsizei depth;
391396c5ddc4Srjs   GLenum format;
391496c5ddc4Srjs   GLsizei imageSize;
391596c5ddc4Srjs   const GLvoid * data;
391696c5ddc4Srjs};
391796c5ddc4Srjsuint32_t
391896c5ddc4Srjs_mesa_unmarshal_CompressedTexSubImage3D(struct gl_context *ctx, const struct marshal_cmd_CompressedTexSubImage3D *cmd, const uint64_t *last)
391996c5ddc4Srjs{
392096c5ddc4Srjs   GLenum target = cmd->target;
392196c5ddc4Srjs   GLint level = cmd->level;
392296c5ddc4Srjs   GLint xoffset = cmd->xoffset;
392396c5ddc4Srjs   GLint yoffset = cmd->yoffset;
392496c5ddc4Srjs   GLint zoffset = cmd->zoffset;
392596c5ddc4Srjs   GLsizei width = cmd->width;
392696c5ddc4Srjs   GLsizei height = cmd->height;
392796c5ddc4Srjs   GLsizei depth = cmd->depth;
392896c5ddc4Srjs   GLenum format = cmd->format;
392996c5ddc4Srjs   GLsizei imageSize = cmd->imageSize;
393096c5ddc4Srjs   const GLvoid * data = cmd->data;
393196c5ddc4Srjs   CALL_CompressedTexSubImage3D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data));
393296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CompressedTexSubImage3D), 8) / 8);
393396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
393496c5ddc4Srjs   return cmd_size;
393596c5ddc4Srjs}
393696c5ddc4Srjsvoid GLAPIENTRY
393796c5ddc4Srjs_mesa_marshal_CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data)
393896c5ddc4Srjs{
393996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
394096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CompressedTexSubImage3D);
394196c5ddc4Srjs   struct marshal_cmd_CompressedTexSubImage3D *cmd;
394296c5ddc4Srjs   if (_mesa_glthread_has_no_unpack_buffer(ctx)) {
394396c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "CompressedTexSubImage3D");
394496c5ddc4Srjs      CALL_CompressedTexSubImage3D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data));
394596c5ddc4Srjs      return;
394696c5ddc4Srjs   }
394796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CompressedTexSubImage3D, cmd_size);
394896c5ddc4Srjs   cmd->target = target;
394996c5ddc4Srjs   cmd->level = level;
395096c5ddc4Srjs   cmd->xoffset = xoffset;
395196c5ddc4Srjs   cmd->yoffset = yoffset;
395296c5ddc4Srjs   cmd->zoffset = zoffset;
395396c5ddc4Srjs   cmd->width = width;
395496c5ddc4Srjs   cmd->height = height;
395596c5ddc4Srjs   cmd->depth = depth;
395696c5ddc4Srjs   cmd->format = format;
395796c5ddc4Srjs   cmd->imageSize = imageSize;
395896c5ddc4Srjs   cmd->data = data;
395996c5ddc4Srjs}
396096c5ddc4Srjs
396196c5ddc4Srjs
396296c5ddc4Srjs/* CompressedTexSubImage2D: marshalled asynchronously */
396396c5ddc4Srjsstruct marshal_cmd_CompressedTexSubImage2D
396496c5ddc4Srjs{
396596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
396696c5ddc4Srjs   GLenum target;
396796c5ddc4Srjs   GLint level;
396896c5ddc4Srjs   GLint xoffset;
396996c5ddc4Srjs   GLint yoffset;
397096c5ddc4Srjs   GLsizei width;
397196c5ddc4Srjs   GLsizei height;
397296c5ddc4Srjs   GLenum format;
397396c5ddc4Srjs   GLsizei imageSize;
397496c5ddc4Srjs   const GLvoid * data;
397596c5ddc4Srjs};
397696c5ddc4Srjsuint32_t
397796c5ddc4Srjs_mesa_unmarshal_CompressedTexSubImage2D(struct gl_context *ctx, const struct marshal_cmd_CompressedTexSubImage2D *cmd, const uint64_t *last)
397896c5ddc4Srjs{
397996c5ddc4Srjs   GLenum target = cmd->target;
398096c5ddc4Srjs   GLint level = cmd->level;
398196c5ddc4Srjs   GLint xoffset = cmd->xoffset;
398296c5ddc4Srjs   GLint yoffset = cmd->yoffset;
398396c5ddc4Srjs   GLsizei width = cmd->width;
398496c5ddc4Srjs   GLsizei height = cmd->height;
398596c5ddc4Srjs   GLenum format = cmd->format;
398696c5ddc4Srjs   GLsizei imageSize = cmd->imageSize;
398796c5ddc4Srjs   const GLvoid * data = cmd->data;
398896c5ddc4Srjs   CALL_CompressedTexSubImage2D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, width, height, format, imageSize, data));
398996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CompressedTexSubImage2D), 8) / 8);
399096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
399196c5ddc4Srjs   return cmd_size;
399296c5ddc4Srjs}
399396c5ddc4Srjsvoid GLAPIENTRY
399496c5ddc4Srjs_mesa_marshal_CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data)
399596c5ddc4Srjs{
399696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
399796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CompressedTexSubImage2D);
399896c5ddc4Srjs   struct marshal_cmd_CompressedTexSubImage2D *cmd;
399996c5ddc4Srjs   if (_mesa_glthread_has_no_unpack_buffer(ctx)) {
400096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "CompressedTexSubImage2D");
400196c5ddc4Srjs      CALL_CompressedTexSubImage2D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, width, height, format, imageSize, data));
400296c5ddc4Srjs      return;
400396c5ddc4Srjs   }
400496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CompressedTexSubImage2D, cmd_size);
400596c5ddc4Srjs   cmd->target = target;
400696c5ddc4Srjs   cmd->level = level;
400796c5ddc4Srjs   cmd->xoffset = xoffset;
400896c5ddc4Srjs   cmd->yoffset = yoffset;
400996c5ddc4Srjs   cmd->width = width;
401096c5ddc4Srjs   cmd->height = height;
401196c5ddc4Srjs   cmd->format = format;
401296c5ddc4Srjs   cmd->imageSize = imageSize;
401396c5ddc4Srjs   cmd->data = data;
401496c5ddc4Srjs}
401596c5ddc4Srjs
401696c5ddc4Srjs
401796c5ddc4Srjs/* CompressedTexSubImage1D: marshalled asynchronously */
401896c5ddc4Srjsstruct marshal_cmd_CompressedTexSubImage1D
401996c5ddc4Srjs{
402096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
402196c5ddc4Srjs   GLenum target;
402296c5ddc4Srjs   GLint level;
402396c5ddc4Srjs   GLint xoffset;
402496c5ddc4Srjs   GLsizei width;
402596c5ddc4Srjs   GLenum format;
402696c5ddc4Srjs   GLsizei imageSize;
402796c5ddc4Srjs   const GLvoid * data;
402896c5ddc4Srjs};
402996c5ddc4Srjsuint32_t
403096c5ddc4Srjs_mesa_unmarshal_CompressedTexSubImage1D(struct gl_context *ctx, const struct marshal_cmd_CompressedTexSubImage1D *cmd, const uint64_t *last)
403196c5ddc4Srjs{
403296c5ddc4Srjs   GLenum target = cmd->target;
403396c5ddc4Srjs   GLint level = cmd->level;
403496c5ddc4Srjs   GLint xoffset = cmd->xoffset;
403596c5ddc4Srjs   GLsizei width = cmd->width;
403696c5ddc4Srjs   GLenum format = cmd->format;
403796c5ddc4Srjs   GLsizei imageSize = cmd->imageSize;
403896c5ddc4Srjs   const GLvoid * data = cmd->data;
403996c5ddc4Srjs   CALL_CompressedTexSubImage1D(ctx->CurrentServerDispatch, (target, level, xoffset, width, format, imageSize, data));
404096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CompressedTexSubImage1D), 8) / 8);
404196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
404296c5ddc4Srjs   return cmd_size;
404396c5ddc4Srjs}
404496c5ddc4Srjsvoid GLAPIENTRY
404596c5ddc4Srjs_mesa_marshal_CompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data)
404696c5ddc4Srjs{
404796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
404896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CompressedTexSubImage1D);
404996c5ddc4Srjs   struct marshal_cmd_CompressedTexSubImage1D *cmd;
405096c5ddc4Srjs   if (_mesa_glthread_has_no_unpack_buffer(ctx)) {
405196c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "CompressedTexSubImage1D");
405296c5ddc4Srjs      CALL_CompressedTexSubImage1D(ctx->CurrentServerDispatch, (target, level, xoffset, width, format, imageSize, data));
405396c5ddc4Srjs      return;
405496c5ddc4Srjs   }
405596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CompressedTexSubImage1D, cmd_size);
405696c5ddc4Srjs   cmd->target = target;
405796c5ddc4Srjs   cmd->level = level;
405896c5ddc4Srjs   cmd->xoffset = xoffset;
405996c5ddc4Srjs   cmd->width = width;
406096c5ddc4Srjs   cmd->format = format;
406196c5ddc4Srjs   cmd->imageSize = imageSize;
406296c5ddc4Srjs   cmd->data = data;
406396c5ddc4Srjs}
406496c5ddc4Srjs
406596c5ddc4Srjs
406696c5ddc4Srjs/* GetCompressedTexImage: marshalled asynchronously */
406796c5ddc4Srjsstruct marshal_cmd_GetCompressedTexImage
406896c5ddc4Srjs{
406996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
407096c5ddc4Srjs   GLenum target;
407196c5ddc4Srjs   GLint level;
407296c5ddc4Srjs   GLvoid * img;
407396c5ddc4Srjs};
407496c5ddc4Srjsuint32_t
407596c5ddc4Srjs_mesa_unmarshal_GetCompressedTexImage(struct gl_context *ctx, const struct marshal_cmd_GetCompressedTexImage *cmd, const uint64_t *last)
407696c5ddc4Srjs{
407796c5ddc4Srjs   GLenum target = cmd->target;
407896c5ddc4Srjs   GLint level = cmd->level;
407996c5ddc4Srjs   GLvoid * img = cmd->img;
408096c5ddc4Srjs   CALL_GetCompressedTexImage(ctx->CurrentServerDispatch, (target, level, img));
408196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetCompressedTexImage), 8) / 8);
408296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
408396c5ddc4Srjs   return cmd_size;
408496c5ddc4Srjs}
408596c5ddc4Srjsvoid GLAPIENTRY
408696c5ddc4Srjs_mesa_marshal_GetCompressedTexImage(GLenum target, GLint level, GLvoid * img)
408796c5ddc4Srjs{
408896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
408996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetCompressedTexImage);
409096c5ddc4Srjs   struct marshal_cmd_GetCompressedTexImage *cmd;
409196c5ddc4Srjs   if (_mesa_glthread_has_no_pack_buffer(ctx)) {
409296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "GetCompressedTexImage");
409396c5ddc4Srjs      CALL_GetCompressedTexImage(ctx->CurrentServerDispatch, (target, level, img));
409496c5ddc4Srjs      return;
409596c5ddc4Srjs   }
409696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetCompressedTexImage, cmd_size);
409796c5ddc4Srjs   cmd->target = target;
409896c5ddc4Srjs   cmd->level = level;
409996c5ddc4Srjs   cmd->img = img;
410096c5ddc4Srjs}
410196c5ddc4Srjs
410296c5ddc4Srjs
410396c5ddc4Srjs/* BlendFuncSeparate: marshalled asynchronously */
410496c5ddc4Srjsstruct marshal_cmd_BlendFuncSeparate
410596c5ddc4Srjs{
410696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
410796c5ddc4Srjs   GLenum sfactorRGB;
410896c5ddc4Srjs   GLenum dfactorRGB;
410996c5ddc4Srjs   GLenum sfactorAlpha;
411096c5ddc4Srjs   GLenum dfactorAlpha;
411196c5ddc4Srjs};
411296c5ddc4Srjsuint32_t
411396c5ddc4Srjs_mesa_unmarshal_BlendFuncSeparate(struct gl_context *ctx, const struct marshal_cmd_BlendFuncSeparate *cmd, const uint64_t *last)
411496c5ddc4Srjs{
411596c5ddc4Srjs   GLenum sfactorRGB = cmd->sfactorRGB;
411696c5ddc4Srjs   GLenum dfactorRGB = cmd->dfactorRGB;
411796c5ddc4Srjs   GLenum sfactorAlpha = cmd->sfactorAlpha;
411896c5ddc4Srjs   GLenum dfactorAlpha = cmd->dfactorAlpha;
411996c5ddc4Srjs   CALL_BlendFuncSeparate(ctx->CurrentServerDispatch, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
412096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BlendFuncSeparate), 8) / 8);
412196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
412296c5ddc4Srjs   return cmd_size;
412396c5ddc4Srjs}
412496c5ddc4Srjsvoid GLAPIENTRY
412596c5ddc4Srjs_mesa_marshal_BlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
412696c5ddc4Srjs{
412796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
412896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BlendFuncSeparate);
412996c5ddc4Srjs   struct marshal_cmd_BlendFuncSeparate *cmd;
413096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendFuncSeparate, cmd_size);
413196c5ddc4Srjs   cmd->sfactorRGB = sfactorRGB;
413296c5ddc4Srjs   cmd->dfactorRGB = dfactorRGB;
413396c5ddc4Srjs   cmd->sfactorAlpha = sfactorAlpha;
413496c5ddc4Srjs   cmd->dfactorAlpha = dfactorAlpha;
413596c5ddc4Srjs}
413696c5ddc4Srjs
413796c5ddc4Srjs
413896c5ddc4Srjs/* FogCoordfEXT: marshalled asynchronously */
413996c5ddc4Srjsstruct marshal_cmd_FogCoordfEXT
414096c5ddc4Srjs{
414196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
414296c5ddc4Srjs   GLfloat coord;
414396c5ddc4Srjs};
414496c5ddc4Srjsuint32_t
414596c5ddc4Srjs_mesa_unmarshal_FogCoordfEXT(struct gl_context *ctx, const struct marshal_cmd_FogCoordfEXT *cmd, const uint64_t *last)
414696c5ddc4Srjs{
414796c5ddc4Srjs   GLfloat coord = cmd->coord;
414896c5ddc4Srjs   CALL_FogCoordfEXT(ctx->CurrentServerDispatch, (coord));
414996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FogCoordfEXT), 8) / 8);
415096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
415196c5ddc4Srjs   return cmd_size;
415296c5ddc4Srjs}
415396c5ddc4Srjsvoid GLAPIENTRY
415496c5ddc4Srjs_mesa_marshal_FogCoordfEXT(GLfloat coord)
415596c5ddc4Srjs{
415696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
415796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_FogCoordfEXT);
415896c5ddc4Srjs   struct marshal_cmd_FogCoordfEXT *cmd;
415996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FogCoordfEXT, cmd_size);
416096c5ddc4Srjs   cmd->coord = coord;
416196c5ddc4Srjs}
416296c5ddc4Srjs
416396c5ddc4Srjs
416496c5ddc4Srjs/* FogCoordfvEXT: marshalled asynchronously */
416596c5ddc4Srjsstruct marshal_cmd_FogCoordfvEXT
416696c5ddc4Srjs{
416796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
416896c5ddc4Srjs   GLfloat coord[1];
416996c5ddc4Srjs};
417096c5ddc4Srjsuint32_t
417196c5ddc4Srjs_mesa_unmarshal_FogCoordfvEXT(struct gl_context *ctx, const struct marshal_cmd_FogCoordfvEXT *cmd, const uint64_t *last)
417296c5ddc4Srjs{
417396c5ddc4Srjs   const GLfloat * coord = cmd->coord;
417496c5ddc4Srjs   CALL_FogCoordfvEXT(ctx->CurrentServerDispatch, (coord));
417596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FogCoordfvEXT), 8) / 8);
417696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
417796c5ddc4Srjs   return cmd_size;
417896c5ddc4Srjs}
417996c5ddc4Srjsvoid GLAPIENTRY
418096c5ddc4Srjs_mesa_marshal_FogCoordfvEXT(const GLfloat * coord)
418196c5ddc4Srjs{
418296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
418396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_FogCoordfvEXT);
418496c5ddc4Srjs   struct marshal_cmd_FogCoordfvEXT *cmd;
418596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FogCoordfvEXT, cmd_size);
418696c5ddc4Srjs   memcpy(cmd->coord, coord, 1 * sizeof(GLfloat));
418796c5ddc4Srjs}
418896c5ddc4Srjs
418996c5ddc4Srjs
419096c5ddc4Srjs/* FogCoordd: marshalled asynchronously */
419196c5ddc4Srjsstruct marshal_cmd_FogCoordd
419296c5ddc4Srjs{
419396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
419496c5ddc4Srjs   GLdouble coord;
419596c5ddc4Srjs};
419696c5ddc4Srjsuint32_t
419796c5ddc4Srjs_mesa_unmarshal_FogCoordd(struct gl_context *ctx, const struct marshal_cmd_FogCoordd *cmd, const uint64_t *last)
419896c5ddc4Srjs{
419996c5ddc4Srjs   GLdouble coord = cmd->coord;
420096c5ddc4Srjs   CALL_FogCoordd(ctx->CurrentServerDispatch, (coord));
420196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FogCoordd), 8) / 8);
420296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
420396c5ddc4Srjs   return cmd_size;
420496c5ddc4Srjs}
420596c5ddc4Srjsvoid GLAPIENTRY
420696c5ddc4Srjs_mesa_marshal_FogCoordd(GLdouble coord)
420796c5ddc4Srjs{
420896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
420996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_FogCoordd);
421096c5ddc4Srjs   struct marshal_cmd_FogCoordd *cmd;
421196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FogCoordd, cmd_size);
421296c5ddc4Srjs   cmd->coord = coord;
421396c5ddc4Srjs}
421496c5ddc4Srjs
421596c5ddc4Srjs
421696c5ddc4Srjs/* FogCoorddv: marshalled asynchronously */
421796c5ddc4Srjsstruct marshal_cmd_FogCoorddv
421896c5ddc4Srjs{
421996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
422096c5ddc4Srjs   GLdouble coord[1];
422196c5ddc4Srjs};
422296c5ddc4Srjsuint32_t
422396c5ddc4Srjs_mesa_unmarshal_FogCoorddv(struct gl_context *ctx, const struct marshal_cmd_FogCoorddv *cmd, const uint64_t *last)
422496c5ddc4Srjs{
422596c5ddc4Srjs   const GLdouble * coord = cmd->coord;
422696c5ddc4Srjs   CALL_FogCoorddv(ctx->CurrentServerDispatch, (coord));
422796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FogCoorddv), 8) / 8);
422896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
422996c5ddc4Srjs   return cmd_size;
423096c5ddc4Srjs}
423196c5ddc4Srjsvoid GLAPIENTRY
423296c5ddc4Srjs_mesa_marshal_FogCoorddv(const GLdouble * coord)
423396c5ddc4Srjs{
423496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
423596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_FogCoorddv);
423696c5ddc4Srjs   struct marshal_cmd_FogCoorddv *cmd;
423796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FogCoorddv, cmd_size);
423896c5ddc4Srjs   memcpy(cmd->coord, coord, 1 * sizeof(GLdouble));
423996c5ddc4Srjs}
424096c5ddc4Srjs
424196c5ddc4Srjs
424296c5ddc4Srjs/* FogCoordPointer: marshalled asynchronously */
424396c5ddc4Srjsstruct marshal_cmd_FogCoordPointer
424496c5ddc4Srjs{
424596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
424696c5ddc4Srjs   GLenum type;
424796c5ddc4Srjs   GLsizei stride;
424896c5ddc4Srjs   const GLvoid * pointer;
424996c5ddc4Srjs};
425096c5ddc4Srjsuint32_t
425196c5ddc4Srjs_mesa_unmarshal_FogCoordPointer(struct gl_context *ctx, const struct marshal_cmd_FogCoordPointer *cmd, const uint64_t *last)
425296c5ddc4Srjs{
425396c5ddc4Srjs   GLenum type = cmd->type;
425496c5ddc4Srjs   GLsizei stride = cmd->stride;
425596c5ddc4Srjs   const GLvoid * pointer = cmd->pointer;
425696c5ddc4Srjs   CALL_FogCoordPointer(ctx->CurrentServerDispatch, (type, stride, pointer));
425796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FogCoordPointer), 8) / 8);
425896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
425996c5ddc4Srjs   return cmd_size;
426096c5ddc4Srjs}
426196c5ddc4Srjsvoid GLAPIENTRY
426296c5ddc4Srjs_mesa_marshal_FogCoordPointer(GLenum type, GLsizei stride, const GLvoid * pointer)
426396c5ddc4Srjs{
426496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
426596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_FogCoordPointer);
426696c5ddc4Srjs   struct marshal_cmd_FogCoordPointer *cmd;
426796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FogCoordPointer, cmd_size);
426896c5ddc4Srjs   cmd->type = type;
426996c5ddc4Srjs   cmd->stride = stride;
427096c5ddc4Srjs   cmd->pointer = pointer;
427196c5ddc4Srjs   if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_FOG, 1, type, stride, pointer);
427296c5ddc4Srjs}
427396c5ddc4Srjs
427496c5ddc4Srjs
427596c5ddc4Srjs/* PointParameterf: marshalled asynchronously */
427696c5ddc4Srjsstruct marshal_cmd_PointParameterf
427796c5ddc4Srjs{
427896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
427996c5ddc4Srjs   GLenum pname;
428096c5ddc4Srjs   GLfloat param;
428196c5ddc4Srjs};
428296c5ddc4Srjsuint32_t
428396c5ddc4Srjs_mesa_unmarshal_PointParameterf(struct gl_context *ctx, const struct marshal_cmd_PointParameterf *cmd, const uint64_t *last)
428496c5ddc4Srjs{
428596c5ddc4Srjs   GLenum pname = cmd->pname;
428696c5ddc4Srjs   GLfloat param = cmd->param;
428796c5ddc4Srjs   CALL_PointParameterf(ctx->CurrentServerDispatch, (pname, param));
428896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PointParameterf), 8) / 8);
428996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
429096c5ddc4Srjs   return cmd_size;
429196c5ddc4Srjs}
429296c5ddc4Srjsvoid GLAPIENTRY
429396c5ddc4Srjs_mesa_marshal_PointParameterf(GLenum pname, GLfloat param)
429496c5ddc4Srjs{
429596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
429696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_PointParameterf);
429796c5ddc4Srjs   struct marshal_cmd_PointParameterf *cmd;
429896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PointParameterf, cmd_size);
429996c5ddc4Srjs   cmd->pname = pname;
430096c5ddc4Srjs   cmd->param = param;
430196c5ddc4Srjs}
430296c5ddc4Srjs
430396c5ddc4Srjs
430496c5ddc4Srjs/* PointParameterfv: marshalled asynchronously */
430596c5ddc4Srjsstruct marshal_cmd_PointParameterfv
430696c5ddc4Srjs{
430796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
430896c5ddc4Srjs   GLenum pname;
430996c5ddc4Srjs   /* Next safe_mul(_mesa_point_param_enum_to_count(pname), 1 * sizeof(GLfloat)) bytes are GLfloat params[None] */
431096c5ddc4Srjs};
431196c5ddc4Srjsuint32_t
431296c5ddc4Srjs_mesa_unmarshal_PointParameterfv(struct gl_context *ctx, const struct marshal_cmd_PointParameterfv *cmd, const uint64_t *last)
431396c5ddc4Srjs{
431496c5ddc4Srjs   GLenum pname = cmd->pname;
431596c5ddc4Srjs   GLfloat * params;
431696c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
431796c5ddc4Srjs   params = (GLfloat *) variable_data;
431896c5ddc4Srjs   CALL_PointParameterfv(ctx->CurrentServerDispatch, (pname, params));
431996c5ddc4Srjs   return cmd->cmd_base.cmd_size;
432096c5ddc4Srjs}
432196c5ddc4Srjsvoid GLAPIENTRY
432296c5ddc4Srjs_mesa_marshal_PointParameterfv(GLenum pname, const GLfloat * params)
432396c5ddc4Srjs{
432496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
432596c5ddc4Srjs   int params_size = safe_mul(_mesa_point_param_enum_to_count(pname), 1 * sizeof(GLfloat));
432696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_PointParameterfv) + params_size;
432796c5ddc4Srjs   struct marshal_cmd_PointParameterfv *cmd;
432896c5ddc4Srjs   if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
432996c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "PointParameterfv");
433096c5ddc4Srjs      CALL_PointParameterfv(ctx->CurrentServerDispatch, (pname, params));
433196c5ddc4Srjs      return;
433296c5ddc4Srjs   }
433396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PointParameterfv, cmd_size);
433496c5ddc4Srjs   cmd->pname = pname;
433596c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
433696c5ddc4Srjs   memcpy(variable_data, params, params_size);
433796c5ddc4Srjs}
433896c5ddc4Srjs
433996c5ddc4Srjs
434096c5ddc4Srjs/* PointParameteri: marshalled asynchronously */
434196c5ddc4Srjsstruct marshal_cmd_PointParameteri
434296c5ddc4Srjs{
434396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
434496c5ddc4Srjs   GLenum pname;
434596c5ddc4Srjs   GLint param;
434696c5ddc4Srjs};
434796c5ddc4Srjsuint32_t
434896c5ddc4Srjs_mesa_unmarshal_PointParameteri(struct gl_context *ctx, const struct marshal_cmd_PointParameteri *cmd, const uint64_t *last)
434996c5ddc4Srjs{
435096c5ddc4Srjs   GLenum pname = cmd->pname;
435196c5ddc4Srjs   GLint param = cmd->param;
435296c5ddc4Srjs   CALL_PointParameteri(ctx->CurrentServerDispatch, (pname, param));
435396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PointParameteri), 8) / 8);
435496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
435596c5ddc4Srjs   return cmd_size;
435696c5ddc4Srjs}
435796c5ddc4Srjsvoid GLAPIENTRY
435896c5ddc4Srjs_mesa_marshal_PointParameteri(GLenum pname, GLint param)
435996c5ddc4Srjs{
436096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
436196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_PointParameteri);
436296c5ddc4Srjs   struct marshal_cmd_PointParameteri *cmd;
436396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PointParameteri, cmd_size);
436496c5ddc4Srjs   cmd->pname = pname;
436596c5ddc4Srjs   cmd->param = param;
436696c5ddc4Srjs}
436796c5ddc4Srjs
436896c5ddc4Srjs
436996c5ddc4Srjs/* PointParameteriv: marshalled asynchronously */
437096c5ddc4Srjsstruct marshal_cmd_PointParameteriv
437196c5ddc4Srjs{
437296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
437396c5ddc4Srjs   GLenum pname;
437496c5ddc4Srjs   /* Next safe_mul(_mesa_point_param_enum_to_count(pname), 1 * sizeof(GLint)) bytes are GLint params[None] */
437596c5ddc4Srjs};
437696c5ddc4Srjsuint32_t
437796c5ddc4Srjs_mesa_unmarshal_PointParameteriv(struct gl_context *ctx, const struct marshal_cmd_PointParameteriv *cmd, const uint64_t *last)
437896c5ddc4Srjs{
437996c5ddc4Srjs   GLenum pname = cmd->pname;
438096c5ddc4Srjs   GLint * params;
438196c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
438296c5ddc4Srjs   params = (GLint *) variable_data;
438396c5ddc4Srjs   CALL_PointParameteriv(ctx->CurrentServerDispatch, (pname, params));
438496c5ddc4Srjs   return cmd->cmd_base.cmd_size;
438596c5ddc4Srjs}
438696c5ddc4Srjsvoid GLAPIENTRY
438796c5ddc4Srjs_mesa_marshal_PointParameteriv(GLenum pname, const GLint * params)
438896c5ddc4Srjs{
438996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
439096c5ddc4Srjs   int params_size = safe_mul(_mesa_point_param_enum_to_count(pname), 1 * sizeof(GLint));
439196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_PointParameteriv) + params_size;
439296c5ddc4Srjs   struct marshal_cmd_PointParameteriv *cmd;
439396c5ddc4Srjs   if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
439496c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "PointParameteriv");
439596c5ddc4Srjs      CALL_PointParameteriv(ctx->CurrentServerDispatch, (pname, params));
439696c5ddc4Srjs      return;
439796c5ddc4Srjs   }
439896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PointParameteriv, cmd_size);
439996c5ddc4Srjs   cmd->pname = pname;
440096c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
440196c5ddc4Srjs   memcpy(variable_data, params, params_size);
440296c5ddc4Srjs}
440396c5ddc4Srjs
440496c5ddc4Srjs
440596c5ddc4Srjs/* SecondaryColor3b: marshalled asynchronously */
440696c5ddc4Srjsstruct marshal_cmd_SecondaryColor3b
440796c5ddc4Srjs{
440896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
440996c5ddc4Srjs   GLbyte red;
441096c5ddc4Srjs   GLbyte green;
441196c5ddc4Srjs   GLbyte blue;
441296c5ddc4Srjs};
441396c5ddc4Srjsuint32_t
441496c5ddc4Srjs_mesa_unmarshal_SecondaryColor3b(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3b *cmd, const uint64_t *last)
441596c5ddc4Srjs{
441696c5ddc4Srjs   GLbyte red = cmd->red;
441796c5ddc4Srjs   GLbyte green = cmd->green;
441896c5ddc4Srjs   GLbyte blue = cmd->blue;
441996c5ddc4Srjs   CALL_SecondaryColor3b(ctx->CurrentServerDispatch, (red, green, blue));
442096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3b), 8) / 8);
442196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
442296c5ddc4Srjs   return cmd_size;
442396c5ddc4Srjs}
442496c5ddc4Srjsvoid GLAPIENTRY
442596c5ddc4Srjs_mesa_marshal_SecondaryColor3b(GLbyte red, GLbyte green, GLbyte blue)
442696c5ddc4Srjs{
442796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
442896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3b);
442996c5ddc4Srjs   struct marshal_cmd_SecondaryColor3b *cmd;
443096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3b, cmd_size);
443196c5ddc4Srjs   cmd->red = red;
443296c5ddc4Srjs   cmd->green = green;
443396c5ddc4Srjs   cmd->blue = blue;
443496c5ddc4Srjs}
443596c5ddc4Srjs
443696c5ddc4Srjs
443796c5ddc4Srjs/* SecondaryColor3bv: marshalled asynchronously */
443896c5ddc4Srjsstruct marshal_cmd_SecondaryColor3bv
443996c5ddc4Srjs{
444096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
444196c5ddc4Srjs   GLbyte v[3];
444296c5ddc4Srjs};
444396c5ddc4Srjsuint32_t
444496c5ddc4Srjs_mesa_unmarshal_SecondaryColor3bv(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3bv *cmd, const uint64_t *last)
444596c5ddc4Srjs{
444696c5ddc4Srjs   const GLbyte * v = cmd->v;
444796c5ddc4Srjs   CALL_SecondaryColor3bv(ctx->CurrentServerDispatch, (v));
444896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3bv), 8) / 8);
444996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
445096c5ddc4Srjs   return cmd_size;
445196c5ddc4Srjs}
445296c5ddc4Srjsvoid GLAPIENTRY
445396c5ddc4Srjs_mesa_marshal_SecondaryColor3bv(const GLbyte * v)
445496c5ddc4Srjs{
445596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
445696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3bv);
445796c5ddc4Srjs   struct marshal_cmd_SecondaryColor3bv *cmd;
445896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3bv, cmd_size);
445996c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLbyte));
446096c5ddc4Srjs}
446196c5ddc4Srjs
446296c5ddc4Srjs
446396c5ddc4Srjs/* SecondaryColor3d: marshalled asynchronously */
446496c5ddc4Srjsstruct marshal_cmd_SecondaryColor3d
446596c5ddc4Srjs{
446696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
446796c5ddc4Srjs   GLdouble red;
446896c5ddc4Srjs   GLdouble green;
446996c5ddc4Srjs   GLdouble blue;
447096c5ddc4Srjs};
447196c5ddc4Srjsuint32_t
447296c5ddc4Srjs_mesa_unmarshal_SecondaryColor3d(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3d *cmd, const uint64_t *last)
447396c5ddc4Srjs{
447496c5ddc4Srjs   GLdouble red = cmd->red;
447596c5ddc4Srjs   GLdouble green = cmd->green;
447696c5ddc4Srjs   GLdouble blue = cmd->blue;
447796c5ddc4Srjs   CALL_SecondaryColor3d(ctx->CurrentServerDispatch, (red, green, blue));
447896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3d), 8) / 8);
447996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
448096c5ddc4Srjs   return cmd_size;
448196c5ddc4Srjs}
448296c5ddc4Srjsvoid GLAPIENTRY
448396c5ddc4Srjs_mesa_marshal_SecondaryColor3d(GLdouble red, GLdouble green, GLdouble blue)
448496c5ddc4Srjs{
448596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
448696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3d);
448796c5ddc4Srjs   struct marshal_cmd_SecondaryColor3d *cmd;
448896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3d, cmd_size);
448996c5ddc4Srjs   cmd->red = red;
449096c5ddc4Srjs   cmd->green = green;
449196c5ddc4Srjs   cmd->blue = blue;
449296c5ddc4Srjs}
449396c5ddc4Srjs
449496c5ddc4Srjs
449596c5ddc4Srjs/* SecondaryColor3dv: marshalled asynchronously */
449696c5ddc4Srjsstruct marshal_cmd_SecondaryColor3dv
449796c5ddc4Srjs{
449896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
449996c5ddc4Srjs   GLdouble v[3];
450096c5ddc4Srjs};
450196c5ddc4Srjsuint32_t
450296c5ddc4Srjs_mesa_unmarshal_SecondaryColor3dv(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3dv *cmd, const uint64_t *last)
450396c5ddc4Srjs{
450496c5ddc4Srjs   const GLdouble * v = cmd->v;
450596c5ddc4Srjs   CALL_SecondaryColor3dv(ctx->CurrentServerDispatch, (v));
450696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3dv), 8) / 8);
450796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
450896c5ddc4Srjs   return cmd_size;
450996c5ddc4Srjs}
451096c5ddc4Srjsvoid GLAPIENTRY
451196c5ddc4Srjs_mesa_marshal_SecondaryColor3dv(const GLdouble * v)
451296c5ddc4Srjs{
451396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
451496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3dv);
451596c5ddc4Srjs   struct marshal_cmd_SecondaryColor3dv *cmd;
451696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3dv, cmd_size);
451796c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLdouble));
451896c5ddc4Srjs}
451996c5ddc4Srjs
452096c5ddc4Srjs
452196c5ddc4Srjs/* SecondaryColor3fEXT: marshalled asynchronously */
452296c5ddc4Srjsstruct marshal_cmd_SecondaryColor3fEXT
452396c5ddc4Srjs{
452496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
452596c5ddc4Srjs   GLfloat red;
452696c5ddc4Srjs   GLfloat green;
452796c5ddc4Srjs   GLfloat blue;
452896c5ddc4Srjs};
452996c5ddc4Srjsuint32_t
453096c5ddc4Srjs_mesa_unmarshal_SecondaryColor3fEXT(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3fEXT *cmd, const uint64_t *last)
453196c5ddc4Srjs{
453296c5ddc4Srjs   GLfloat red = cmd->red;
453396c5ddc4Srjs   GLfloat green = cmd->green;
453496c5ddc4Srjs   GLfloat blue = cmd->blue;
453596c5ddc4Srjs   CALL_SecondaryColor3fEXT(ctx->CurrentServerDispatch, (red, green, blue));
453696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3fEXT), 8) / 8);
453796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
453896c5ddc4Srjs   return cmd_size;
453996c5ddc4Srjs}
454096c5ddc4Srjsvoid GLAPIENTRY
454196c5ddc4Srjs_mesa_marshal_SecondaryColor3fEXT(GLfloat red, GLfloat green, GLfloat blue)
454296c5ddc4Srjs{
454396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
454496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3fEXT);
454596c5ddc4Srjs   struct marshal_cmd_SecondaryColor3fEXT *cmd;
454696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3fEXT, cmd_size);
454796c5ddc4Srjs   cmd->red = red;
454896c5ddc4Srjs   cmd->green = green;
454996c5ddc4Srjs   cmd->blue = blue;
455096c5ddc4Srjs}
455196c5ddc4Srjs
455296c5ddc4Srjs
455396c5ddc4Srjs/* SecondaryColor3fvEXT: marshalled asynchronously */
455496c5ddc4Srjsstruct marshal_cmd_SecondaryColor3fvEXT
455596c5ddc4Srjs{
455696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
455796c5ddc4Srjs   GLfloat v[3];
455896c5ddc4Srjs};
455996c5ddc4Srjsuint32_t
456096c5ddc4Srjs_mesa_unmarshal_SecondaryColor3fvEXT(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3fvEXT *cmd, const uint64_t *last)
456196c5ddc4Srjs{
456296c5ddc4Srjs   const GLfloat * v = cmd->v;
456396c5ddc4Srjs   CALL_SecondaryColor3fvEXT(ctx->CurrentServerDispatch, (v));
456496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3fvEXT), 8) / 8);
456596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
456696c5ddc4Srjs   return cmd_size;
456796c5ddc4Srjs}
456896c5ddc4Srjsvoid GLAPIENTRY
456996c5ddc4Srjs_mesa_marshal_SecondaryColor3fvEXT(const GLfloat * v)
457096c5ddc4Srjs{
457196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
457296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3fvEXT);
457396c5ddc4Srjs   struct marshal_cmd_SecondaryColor3fvEXT *cmd;
457496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3fvEXT, cmd_size);
457596c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLfloat));
457696c5ddc4Srjs}
457796c5ddc4Srjs
457896c5ddc4Srjs
457996c5ddc4Srjs/* SecondaryColor3i: marshalled asynchronously */
458096c5ddc4Srjsstruct marshal_cmd_SecondaryColor3i
458196c5ddc4Srjs{
458296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
458396c5ddc4Srjs   GLint red;
458496c5ddc4Srjs   GLint green;
458596c5ddc4Srjs   GLint blue;
458696c5ddc4Srjs};
458796c5ddc4Srjsuint32_t
458896c5ddc4Srjs_mesa_unmarshal_SecondaryColor3i(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3i *cmd, const uint64_t *last)
458996c5ddc4Srjs{
459096c5ddc4Srjs   GLint red = cmd->red;
459196c5ddc4Srjs   GLint green = cmd->green;
459296c5ddc4Srjs   GLint blue = cmd->blue;
459396c5ddc4Srjs   CALL_SecondaryColor3i(ctx->CurrentServerDispatch, (red, green, blue));
459496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3i), 8) / 8);
459596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
459696c5ddc4Srjs   return cmd_size;
459796c5ddc4Srjs}
459896c5ddc4Srjsvoid GLAPIENTRY
459996c5ddc4Srjs_mesa_marshal_SecondaryColor3i(GLint red, GLint green, GLint blue)
460096c5ddc4Srjs{
460196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
460296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3i);
460396c5ddc4Srjs   struct marshal_cmd_SecondaryColor3i *cmd;
460496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3i, cmd_size);
460596c5ddc4Srjs   cmd->red = red;
460696c5ddc4Srjs   cmd->green = green;
460796c5ddc4Srjs   cmd->blue = blue;
460896c5ddc4Srjs}
460996c5ddc4Srjs
461096c5ddc4Srjs
461196c5ddc4Srjs/* SecondaryColor3iv: marshalled asynchronously */
461296c5ddc4Srjsstruct marshal_cmd_SecondaryColor3iv
461396c5ddc4Srjs{
461496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
461596c5ddc4Srjs   GLint v[3];
461696c5ddc4Srjs};
461796c5ddc4Srjsuint32_t
461896c5ddc4Srjs_mesa_unmarshal_SecondaryColor3iv(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3iv *cmd, const uint64_t *last)
461996c5ddc4Srjs{
462096c5ddc4Srjs   const GLint * v = cmd->v;
462196c5ddc4Srjs   CALL_SecondaryColor3iv(ctx->CurrentServerDispatch, (v));
462296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3iv), 8) / 8);
462396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
462496c5ddc4Srjs   return cmd_size;
462596c5ddc4Srjs}
462696c5ddc4Srjsvoid GLAPIENTRY
462796c5ddc4Srjs_mesa_marshal_SecondaryColor3iv(const GLint * v)
462896c5ddc4Srjs{
462996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
463096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3iv);
463196c5ddc4Srjs   struct marshal_cmd_SecondaryColor3iv *cmd;
463296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3iv, cmd_size);
463396c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLint));
463496c5ddc4Srjs}
463596c5ddc4Srjs
463696c5ddc4Srjs
463796c5ddc4Srjs/* SecondaryColor3s: marshalled asynchronously */
463896c5ddc4Srjsstruct marshal_cmd_SecondaryColor3s
463996c5ddc4Srjs{
464096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
464196c5ddc4Srjs   GLshort red;
464296c5ddc4Srjs   GLshort green;
464396c5ddc4Srjs   GLshort blue;
464496c5ddc4Srjs};
464596c5ddc4Srjsuint32_t
464696c5ddc4Srjs_mesa_unmarshal_SecondaryColor3s(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3s *cmd, const uint64_t *last)
464796c5ddc4Srjs{
464896c5ddc4Srjs   GLshort red = cmd->red;
464996c5ddc4Srjs   GLshort green = cmd->green;
465096c5ddc4Srjs   GLshort blue = cmd->blue;
465196c5ddc4Srjs   CALL_SecondaryColor3s(ctx->CurrentServerDispatch, (red, green, blue));
465296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3s), 8) / 8);
465396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
465496c5ddc4Srjs   return cmd_size;
465596c5ddc4Srjs}
465696c5ddc4Srjsvoid GLAPIENTRY
465796c5ddc4Srjs_mesa_marshal_SecondaryColor3s(GLshort red, GLshort green, GLshort blue)
465896c5ddc4Srjs{
465996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
466096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3s);
466196c5ddc4Srjs   struct marshal_cmd_SecondaryColor3s *cmd;
466296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3s, cmd_size);
466396c5ddc4Srjs   cmd->red = red;
466496c5ddc4Srjs   cmd->green = green;
466596c5ddc4Srjs   cmd->blue = blue;
466696c5ddc4Srjs}
466796c5ddc4Srjs
466896c5ddc4Srjs
466996c5ddc4Srjs/* SecondaryColor3sv: marshalled asynchronously */
467096c5ddc4Srjsstruct marshal_cmd_SecondaryColor3sv
467196c5ddc4Srjs{
467296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
467396c5ddc4Srjs   GLshort v[3];
467496c5ddc4Srjs};
467596c5ddc4Srjsuint32_t
467696c5ddc4Srjs_mesa_unmarshal_SecondaryColor3sv(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3sv *cmd, const uint64_t *last)
467796c5ddc4Srjs{
467896c5ddc4Srjs   const GLshort * v = cmd->v;
467996c5ddc4Srjs   CALL_SecondaryColor3sv(ctx->CurrentServerDispatch, (v));
468096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3sv), 8) / 8);
468196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
468296c5ddc4Srjs   return cmd_size;
468396c5ddc4Srjs}
468496c5ddc4Srjsvoid GLAPIENTRY
468596c5ddc4Srjs_mesa_marshal_SecondaryColor3sv(const GLshort * v)
468696c5ddc4Srjs{
468796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
468896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3sv);
468996c5ddc4Srjs   struct marshal_cmd_SecondaryColor3sv *cmd;
469096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3sv, cmd_size);
469196c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLshort));
469296c5ddc4Srjs}
469396c5ddc4Srjs
469496c5ddc4Srjs
469596c5ddc4Srjs/* SecondaryColor3ub: marshalled asynchronously */
469696c5ddc4Srjsstruct marshal_cmd_SecondaryColor3ub
469796c5ddc4Srjs{
469896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
469996c5ddc4Srjs   GLubyte red;
470096c5ddc4Srjs   GLubyte green;
470196c5ddc4Srjs   GLubyte blue;
470296c5ddc4Srjs};
470396c5ddc4Srjsuint32_t
470496c5ddc4Srjs_mesa_unmarshal_SecondaryColor3ub(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3ub *cmd, const uint64_t *last)
470596c5ddc4Srjs{
470696c5ddc4Srjs   GLubyte red = cmd->red;
470796c5ddc4Srjs   GLubyte green = cmd->green;
470896c5ddc4Srjs   GLubyte blue = cmd->blue;
470996c5ddc4Srjs   CALL_SecondaryColor3ub(ctx->CurrentServerDispatch, (red, green, blue));
471096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3ub), 8) / 8);
471196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
471296c5ddc4Srjs   return cmd_size;
471396c5ddc4Srjs}
471496c5ddc4Srjsvoid GLAPIENTRY
471596c5ddc4Srjs_mesa_marshal_SecondaryColor3ub(GLubyte red, GLubyte green, GLubyte blue)
471696c5ddc4Srjs{
471796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
471896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3ub);
471996c5ddc4Srjs   struct marshal_cmd_SecondaryColor3ub *cmd;
472096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3ub, cmd_size);
472196c5ddc4Srjs   cmd->red = red;
472296c5ddc4Srjs   cmd->green = green;
472396c5ddc4Srjs   cmd->blue = blue;
472496c5ddc4Srjs}
472596c5ddc4Srjs
472696c5ddc4Srjs
472796c5ddc4Srjs/* SecondaryColor3ubv: marshalled asynchronously */
472896c5ddc4Srjsstruct marshal_cmd_SecondaryColor3ubv
472996c5ddc4Srjs{
473096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
473196c5ddc4Srjs   GLubyte v[3];
473296c5ddc4Srjs};
473396c5ddc4Srjsuint32_t
473496c5ddc4Srjs_mesa_unmarshal_SecondaryColor3ubv(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3ubv *cmd, const uint64_t *last)
473596c5ddc4Srjs{
473696c5ddc4Srjs   const GLubyte * v = cmd->v;
473796c5ddc4Srjs   CALL_SecondaryColor3ubv(ctx->CurrentServerDispatch, (v));
473896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3ubv), 8) / 8);
473996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
474096c5ddc4Srjs   return cmd_size;
474196c5ddc4Srjs}
474296c5ddc4Srjsvoid GLAPIENTRY
474396c5ddc4Srjs_mesa_marshal_SecondaryColor3ubv(const GLubyte * v)
474496c5ddc4Srjs{
474596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
474696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3ubv);
474796c5ddc4Srjs   struct marshal_cmd_SecondaryColor3ubv *cmd;
474896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3ubv, cmd_size);
474996c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLubyte));
475096c5ddc4Srjs}
475196c5ddc4Srjs
475296c5ddc4Srjs
475396c5ddc4Srjs/* SecondaryColor3ui: marshalled asynchronously */
475496c5ddc4Srjsstruct marshal_cmd_SecondaryColor3ui
475596c5ddc4Srjs{
475696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
475796c5ddc4Srjs   GLuint red;
475896c5ddc4Srjs   GLuint green;
475996c5ddc4Srjs   GLuint blue;
476096c5ddc4Srjs};
476196c5ddc4Srjsuint32_t
476296c5ddc4Srjs_mesa_unmarshal_SecondaryColor3ui(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3ui *cmd, const uint64_t *last)
476396c5ddc4Srjs{
476496c5ddc4Srjs   GLuint red = cmd->red;
476596c5ddc4Srjs   GLuint green = cmd->green;
476696c5ddc4Srjs   GLuint blue = cmd->blue;
476796c5ddc4Srjs   CALL_SecondaryColor3ui(ctx->CurrentServerDispatch, (red, green, blue));
476896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3ui), 8) / 8);
476996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
477096c5ddc4Srjs   return cmd_size;
477196c5ddc4Srjs}
477296c5ddc4Srjsvoid GLAPIENTRY
477396c5ddc4Srjs_mesa_marshal_SecondaryColor3ui(GLuint red, GLuint green, GLuint blue)
477496c5ddc4Srjs{
477596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
477696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3ui);
477796c5ddc4Srjs   struct marshal_cmd_SecondaryColor3ui *cmd;
477896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3ui, cmd_size);
477996c5ddc4Srjs   cmd->red = red;
478096c5ddc4Srjs   cmd->green = green;
478196c5ddc4Srjs   cmd->blue = blue;
478296c5ddc4Srjs}
478396c5ddc4Srjs
478496c5ddc4Srjs
478596c5ddc4Srjs/* SecondaryColor3uiv: marshalled asynchronously */
478696c5ddc4Srjsstruct marshal_cmd_SecondaryColor3uiv
478796c5ddc4Srjs{
478896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
478996c5ddc4Srjs   GLuint v[3];
479096c5ddc4Srjs};
479196c5ddc4Srjsuint32_t
479296c5ddc4Srjs_mesa_unmarshal_SecondaryColor3uiv(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3uiv *cmd, const uint64_t *last)
479396c5ddc4Srjs{
479496c5ddc4Srjs   const GLuint * v = cmd->v;
479596c5ddc4Srjs   CALL_SecondaryColor3uiv(ctx->CurrentServerDispatch, (v));
479696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3uiv), 8) / 8);
479796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
479896c5ddc4Srjs   return cmd_size;
479996c5ddc4Srjs}
480096c5ddc4Srjsvoid GLAPIENTRY
480196c5ddc4Srjs_mesa_marshal_SecondaryColor3uiv(const GLuint * v)
480296c5ddc4Srjs{
480396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
480496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3uiv);
480596c5ddc4Srjs   struct marshal_cmd_SecondaryColor3uiv *cmd;
480696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3uiv, cmd_size);
480796c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLuint));
480896c5ddc4Srjs}
480996c5ddc4Srjs
481096c5ddc4Srjs
481196c5ddc4Srjs/* SecondaryColor3us: marshalled asynchronously */
481296c5ddc4Srjsstruct marshal_cmd_SecondaryColor3us
481396c5ddc4Srjs{
481496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
481596c5ddc4Srjs   GLushort red;
481696c5ddc4Srjs   GLushort green;
481796c5ddc4Srjs   GLushort blue;
481896c5ddc4Srjs};
481996c5ddc4Srjsuint32_t
482096c5ddc4Srjs_mesa_unmarshal_SecondaryColor3us(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3us *cmd, const uint64_t *last)
482196c5ddc4Srjs{
482296c5ddc4Srjs   GLushort red = cmd->red;
482396c5ddc4Srjs   GLushort green = cmd->green;
482496c5ddc4Srjs   GLushort blue = cmd->blue;
482596c5ddc4Srjs   CALL_SecondaryColor3us(ctx->CurrentServerDispatch, (red, green, blue));
482696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3us), 8) / 8);
482796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
482896c5ddc4Srjs   return cmd_size;
482996c5ddc4Srjs}
483096c5ddc4Srjsvoid GLAPIENTRY
483196c5ddc4Srjs_mesa_marshal_SecondaryColor3us(GLushort red, GLushort green, GLushort blue)
483296c5ddc4Srjs{
483396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
483496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3us);
483596c5ddc4Srjs   struct marshal_cmd_SecondaryColor3us *cmd;
483696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3us, cmd_size);
483796c5ddc4Srjs   cmd->red = red;
483896c5ddc4Srjs   cmd->green = green;
483996c5ddc4Srjs   cmd->blue = blue;
484096c5ddc4Srjs}
484196c5ddc4Srjs
484296c5ddc4Srjs
484396c5ddc4Srjs/* SecondaryColor3usv: marshalled asynchronously */
484496c5ddc4Srjsstruct marshal_cmd_SecondaryColor3usv
484596c5ddc4Srjs{
484696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
484796c5ddc4Srjs   GLushort v[3];
484896c5ddc4Srjs};
484996c5ddc4Srjsuint32_t
485096c5ddc4Srjs_mesa_unmarshal_SecondaryColor3usv(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3usv *cmd, const uint64_t *last)
485196c5ddc4Srjs{
485296c5ddc4Srjs   const GLushort * v = cmd->v;
485396c5ddc4Srjs   CALL_SecondaryColor3usv(ctx->CurrentServerDispatch, (v));
485496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3usv), 8) / 8);
485596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
485696c5ddc4Srjs   return cmd_size;
485796c5ddc4Srjs}
485896c5ddc4Srjsvoid GLAPIENTRY
485996c5ddc4Srjs_mesa_marshal_SecondaryColor3usv(const GLushort * v)
486096c5ddc4Srjs{
486196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
486296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3usv);
486396c5ddc4Srjs   struct marshal_cmd_SecondaryColor3usv *cmd;
486496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3usv, cmd_size);
486596c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLushort));
486696c5ddc4Srjs}
486796c5ddc4Srjs
486896c5ddc4Srjs
486996c5ddc4Srjs/* SecondaryColorPointer: marshalled asynchronously */
487096c5ddc4Srjsstruct marshal_cmd_SecondaryColorPointer
487196c5ddc4Srjs{
487296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
487396c5ddc4Srjs   GLint size;
487496c5ddc4Srjs   GLenum type;
487596c5ddc4Srjs   GLsizei stride;
487696c5ddc4Srjs   const GLvoid * pointer;
487796c5ddc4Srjs};
487896c5ddc4Srjsuint32_t
487996c5ddc4Srjs_mesa_unmarshal_SecondaryColorPointer(struct gl_context *ctx, const struct marshal_cmd_SecondaryColorPointer *cmd, const uint64_t *last)
488096c5ddc4Srjs{
488196c5ddc4Srjs   GLint size = cmd->size;
488296c5ddc4Srjs   GLenum type = cmd->type;
488396c5ddc4Srjs   GLsizei stride = cmd->stride;
488496c5ddc4Srjs   const GLvoid * pointer = cmd->pointer;
488596c5ddc4Srjs   CALL_SecondaryColorPointer(ctx->CurrentServerDispatch, (size, type, stride, pointer));
488696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColorPointer), 8) / 8);
488796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
488896c5ddc4Srjs   return cmd_size;
488996c5ddc4Srjs}
489096c5ddc4Srjsvoid GLAPIENTRY
489196c5ddc4Srjs_mesa_marshal_SecondaryColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
489296c5ddc4Srjs{
489396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
489496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_SecondaryColorPointer);
489596c5ddc4Srjs   struct marshal_cmd_SecondaryColorPointer *cmd;
489696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColorPointer, cmd_size);
489796c5ddc4Srjs   cmd->size = size;
489896c5ddc4Srjs   cmd->type = type;
489996c5ddc4Srjs   cmd->stride = stride;
490096c5ddc4Srjs   cmd->pointer = pointer;
490196c5ddc4Srjs   if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_COLOR1, size, type, stride, pointer);
490296c5ddc4Srjs}
490396c5ddc4Srjs
490496c5ddc4Srjs
490596c5ddc4Srjs/* WindowPos2d: marshalled asynchronously */
490696c5ddc4Srjsstruct marshal_cmd_WindowPos2d
490796c5ddc4Srjs{
490896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
490996c5ddc4Srjs   GLdouble x;
491096c5ddc4Srjs   GLdouble y;
491196c5ddc4Srjs};
491296c5ddc4Srjsuint32_t
491396c5ddc4Srjs_mesa_unmarshal_WindowPos2d(struct gl_context *ctx, const struct marshal_cmd_WindowPos2d *cmd, const uint64_t *last)
491496c5ddc4Srjs{
491596c5ddc4Srjs   GLdouble x = cmd->x;
491696c5ddc4Srjs   GLdouble y = cmd->y;
491796c5ddc4Srjs   CALL_WindowPos2d(ctx->CurrentServerDispatch, (x, y));
491896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos2d), 8) / 8);
491996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
492096c5ddc4Srjs   return cmd_size;
492196c5ddc4Srjs}
492296c5ddc4Srjsvoid GLAPIENTRY
492396c5ddc4Srjs_mesa_marshal_WindowPos2d(GLdouble x, GLdouble y)
492496c5ddc4Srjs{
492596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
492696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WindowPos2d);
492796c5ddc4Srjs   struct marshal_cmd_WindowPos2d *cmd;
492896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos2d, cmd_size);
492996c5ddc4Srjs   cmd->x = x;
493096c5ddc4Srjs   cmd->y = y;
493196c5ddc4Srjs}
493296c5ddc4Srjs
493396c5ddc4Srjs
493496c5ddc4Srjs/* WindowPos2dv: marshalled asynchronously */
493596c5ddc4Srjsstruct marshal_cmd_WindowPos2dv
493696c5ddc4Srjs{
493796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
493896c5ddc4Srjs   GLdouble v[2];
493996c5ddc4Srjs};
494096c5ddc4Srjsuint32_t
494196c5ddc4Srjs_mesa_unmarshal_WindowPos2dv(struct gl_context *ctx, const struct marshal_cmd_WindowPos2dv *cmd, const uint64_t *last)
494296c5ddc4Srjs{
494396c5ddc4Srjs   const GLdouble * v = cmd->v;
494496c5ddc4Srjs   CALL_WindowPos2dv(ctx->CurrentServerDispatch, (v));
494596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos2dv), 8) / 8);
494696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
494796c5ddc4Srjs   return cmd_size;
494896c5ddc4Srjs}
494996c5ddc4Srjsvoid GLAPIENTRY
495096c5ddc4Srjs_mesa_marshal_WindowPos2dv(const GLdouble * v)
495196c5ddc4Srjs{
495296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
495396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WindowPos2dv);
495496c5ddc4Srjs   struct marshal_cmd_WindowPos2dv *cmd;
495596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos2dv, cmd_size);
495696c5ddc4Srjs   memcpy(cmd->v, v, 2 * sizeof(GLdouble));
495796c5ddc4Srjs}
495896c5ddc4Srjs
495996c5ddc4Srjs
496096c5ddc4Srjs/* WindowPos2f: marshalled asynchronously */
496196c5ddc4Srjsstruct marshal_cmd_WindowPos2f
496296c5ddc4Srjs{
496396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
496496c5ddc4Srjs   GLfloat x;
496596c5ddc4Srjs   GLfloat y;
496696c5ddc4Srjs};
496796c5ddc4Srjsuint32_t
496896c5ddc4Srjs_mesa_unmarshal_WindowPos2f(struct gl_context *ctx, const struct marshal_cmd_WindowPos2f *cmd, const uint64_t *last)
496996c5ddc4Srjs{
497096c5ddc4Srjs   GLfloat x = cmd->x;
497196c5ddc4Srjs   GLfloat y = cmd->y;
497296c5ddc4Srjs   CALL_WindowPos2f(ctx->CurrentServerDispatch, (x, y));
497396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos2f), 8) / 8);
497496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
497596c5ddc4Srjs   return cmd_size;
497696c5ddc4Srjs}
497796c5ddc4Srjsvoid GLAPIENTRY
497896c5ddc4Srjs_mesa_marshal_WindowPos2f(GLfloat x, GLfloat y)
497996c5ddc4Srjs{
498096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
498196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WindowPos2f);
498296c5ddc4Srjs   struct marshal_cmd_WindowPos2f *cmd;
498396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos2f, cmd_size);
498496c5ddc4Srjs   cmd->x = x;
498596c5ddc4Srjs   cmd->y = y;
498696c5ddc4Srjs}
498796c5ddc4Srjs
498896c5ddc4Srjs
498996c5ddc4Srjs/* WindowPos2fv: marshalled asynchronously */
499096c5ddc4Srjsstruct marshal_cmd_WindowPos2fv
499196c5ddc4Srjs{
499296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
499396c5ddc4Srjs   GLfloat v[2];
499496c5ddc4Srjs};
499596c5ddc4Srjsuint32_t
499696c5ddc4Srjs_mesa_unmarshal_WindowPos2fv(struct gl_context *ctx, const struct marshal_cmd_WindowPos2fv *cmd, const uint64_t *last)
499796c5ddc4Srjs{
499896c5ddc4Srjs   const GLfloat * v = cmd->v;
499996c5ddc4Srjs   CALL_WindowPos2fv(ctx->CurrentServerDispatch, (v));
500096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos2fv), 8) / 8);
500196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
500296c5ddc4Srjs   return cmd_size;
500396c5ddc4Srjs}
500496c5ddc4Srjsvoid GLAPIENTRY
500596c5ddc4Srjs_mesa_marshal_WindowPos2fv(const GLfloat * v)
500696c5ddc4Srjs{
500796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
500896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WindowPos2fv);
500996c5ddc4Srjs   struct marshal_cmd_WindowPos2fv *cmd;
501096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos2fv, cmd_size);
501196c5ddc4Srjs   memcpy(cmd->v, v, 2 * sizeof(GLfloat));
501296c5ddc4Srjs}
501396c5ddc4Srjs
501496c5ddc4Srjs
501596c5ddc4Srjs/* WindowPos2i: marshalled asynchronously */
501696c5ddc4Srjsstruct marshal_cmd_WindowPos2i
501796c5ddc4Srjs{
501896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
501996c5ddc4Srjs   GLint x;
502096c5ddc4Srjs   GLint y;
502196c5ddc4Srjs};
502296c5ddc4Srjsuint32_t
502396c5ddc4Srjs_mesa_unmarshal_WindowPos2i(struct gl_context *ctx, const struct marshal_cmd_WindowPos2i *cmd, const uint64_t *last)
502496c5ddc4Srjs{
502596c5ddc4Srjs   GLint x = cmd->x;
502696c5ddc4Srjs   GLint y = cmd->y;
502796c5ddc4Srjs   CALL_WindowPos2i(ctx->CurrentServerDispatch, (x, y));
502896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos2i), 8) / 8);
502996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
503096c5ddc4Srjs   return cmd_size;
503196c5ddc4Srjs}
503296c5ddc4Srjsvoid GLAPIENTRY
503396c5ddc4Srjs_mesa_marshal_WindowPos2i(GLint x, GLint y)
503496c5ddc4Srjs{
503596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
503696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WindowPos2i);
503796c5ddc4Srjs   struct marshal_cmd_WindowPos2i *cmd;
503896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos2i, cmd_size);
503996c5ddc4Srjs   cmd->x = x;
504096c5ddc4Srjs   cmd->y = y;
504196c5ddc4Srjs}
504296c5ddc4Srjs
504396c5ddc4Srjs
504496c5ddc4Srjs/* WindowPos2iv: marshalled asynchronously */
504596c5ddc4Srjsstruct marshal_cmd_WindowPos2iv
504696c5ddc4Srjs{
504796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
504896c5ddc4Srjs   GLint v[2];
504996c5ddc4Srjs};
505096c5ddc4Srjsuint32_t
505196c5ddc4Srjs_mesa_unmarshal_WindowPos2iv(struct gl_context *ctx, const struct marshal_cmd_WindowPos2iv *cmd, const uint64_t *last)
505296c5ddc4Srjs{
505396c5ddc4Srjs   const GLint * v = cmd->v;
505496c5ddc4Srjs   CALL_WindowPos2iv(ctx->CurrentServerDispatch, (v));
505596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos2iv), 8) / 8);
505696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
505796c5ddc4Srjs   return cmd_size;
505896c5ddc4Srjs}
505996c5ddc4Srjsvoid GLAPIENTRY
506096c5ddc4Srjs_mesa_marshal_WindowPos2iv(const GLint * v)
506196c5ddc4Srjs{
506296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
506396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WindowPos2iv);
506496c5ddc4Srjs   struct marshal_cmd_WindowPos2iv *cmd;
506596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos2iv, cmd_size);
506696c5ddc4Srjs   memcpy(cmd->v, v, 2 * sizeof(GLint));
506796c5ddc4Srjs}
506896c5ddc4Srjs
506996c5ddc4Srjs
507096c5ddc4Srjs/* WindowPos2s: marshalled asynchronously */
507196c5ddc4Srjsstruct marshal_cmd_WindowPos2s
507296c5ddc4Srjs{
507396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
507496c5ddc4Srjs   GLshort x;
507596c5ddc4Srjs   GLshort y;
507696c5ddc4Srjs};
507796c5ddc4Srjsuint32_t
507896c5ddc4Srjs_mesa_unmarshal_WindowPos2s(struct gl_context *ctx, const struct marshal_cmd_WindowPos2s *cmd, const uint64_t *last)
507996c5ddc4Srjs{
508096c5ddc4Srjs   GLshort x = cmd->x;
508196c5ddc4Srjs   GLshort y = cmd->y;
508296c5ddc4Srjs   CALL_WindowPos2s(ctx->CurrentServerDispatch, (x, y));
508396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos2s), 8) / 8);
508496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
508596c5ddc4Srjs   return cmd_size;
508696c5ddc4Srjs}
508796c5ddc4Srjsvoid GLAPIENTRY
508896c5ddc4Srjs_mesa_marshal_WindowPos2s(GLshort x, GLshort y)
508996c5ddc4Srjs{
509096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
509196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WindowPos2s);
509296c5ddc4Srjs   struct marshal_cmd_WindowPos2s *cmd;
509396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos2s, cmd_size);
509496c5ddc4Srjs   cmd->x = x;
509596c5ddc4Srjs   cmd->y = y;
509696c5ddc4Srjs}
509796c5ddc4Srjs
509896c5ddc4Srjs
509996c5ddc4Srjs/* WindowPos2sv: marshalled asynchronously */
510096c5ddc4Srjsstruct marshal_cmd_WindowPos2sv
510196c5ddc4Srjs{
510296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
510396c5ddc4Srjs   GLshort v[2];
510496c5ddc4Srjs};
510596c5ddc4Srjsuint32_t
510696c5ddc4Srjs_mesa_unmarshal_WindowPos2sv(struct gl_context *ctx, const struct marshal_cmd_WindowPos2sv *cmd, const uint64_t *last)
510796c5ddc4Srjs{
510896c5ddc4Srjs   const GLshort * v = cmd->v;
510996c5ddc4Srjs   CALL_WindowPos2sv(ctx->CurrentServerDispatch, (v));
511096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos2sv), 8) / 8);
511196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
511296c5ddc4Srjs   return cmd_size;
511396c5ddc4Srjs}
511496c5ddc4Srjsvoid GLAPIENTRY
511596c5ddc4Srjs_mesa_marshal_WindowPos2sv(const GLshort * v)
511696c5ddc4Srjs{
511796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
511896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WindowPos2sv);
511996c5ddc4Srjs   struct marshal_cmd_WindowPos2sv *cmd;
512096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos2sv, cmd_size);
512196c5ddc4Srjs   memcpy(cmd->v, v, 2 * sizeof(GLshort));
512296c5ddc4Srjs}
512396c5ddc4Srjs
512496c5ddc4Srjs
512596c5ddc4Srjs/* WindowPos3d: marshalled asynchronously */
512696c5ddc4Srjsstruct marshal_cmd_WindowPos3d
512796c5ddc4Srjs{
512896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
512996c5ddc4Srjs   GLdouble x;
513096c5ddc4Srjs   GLdouble y;
513196c5ddc4Srjs   GLdouble z;
513296c5ddc4Srjs};
513396c5ddc4Srjsuint32_t
513496c5ddc4Srjs_mesa_unmarshal_WindowPos3d(struct gl_context *ctx, const struct marshal_cmd_WindowPos3d *cmd, const uint64_t *last)
513596c5ddc4Srjs{
513696c5ddc4Srjs   GLdouble x = cmd->x;
513796c5ddc4Srjs   GLdouble y = cmd->y;
513896c5ddc4Srjs   GLdouble z = cmd->z;
513996c5ddc4Srjs   CALL_WindowPos3d(ctx->CurrentServerDispatch, (x, y, z));
514096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos3d), 8) / 8);
514196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
514296c5ddc4Srjs   return cmd_size;
514396c5ddc4Srjs}
514496c5ddc4Srjsvoid GLAPIENTRY
514596c5ddc4Srjs_mesa_marshal_WindowPos3d(GLdouble x, GLdouble y, GLdouble z)
514696c5ddc4Srjs{
514796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
514896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WindowPos3d);
514996c5ddc4Srjs   struct marshal_cmd_WindowPos3d *cmd;
515096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos3d, cmd_size);
515196c5ddc4Srjs   cmd->x = x;
515296c5ddc4Srjs   cmd->y = y;
515396c5ddc4Srjs   cmd->z = z;
515496c5ddc4Srjs}
515596c5ddc4Srjs
515696c5ddc4Srjs
515796c5ddc4Srjs/* WindowPos3dv: marshalled asynchronously */
515896c5ddc4Srjsstruct marshal_cmd_WindowPos3dv
515996c5ddc4Srjs{
516096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
516196c5ddc4Srjs   GLdouble v[3];
516296c5ddc4Srjs};
516396c5ddc4Srjsuint32_t
516496c5ddc4Srjs_mesa_unmarshal_WindowPos3dv(struct gl_context *ctx, const struct marshal_cmd_WindowPos3dv *cmd, const uint64_t *last)
516596c5ddc4Srjs{
516696c5ddc4Srjs   const GLdouble * v = cmd->v;
516796c5ddc4Srjs   CALL_WindowPos3dv(ctx->CurrentServerDispatch, (v));
516896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos3dv), 8) / 8);
516996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
517096c5ddc4Srjs   return cmd_size;
517196c5ddc4Srjs}
517296c5ddc4Srjsvoid GLAPIENTRY
517396c5ddc4Srjs_mesa_marshal_WindowPos3dv(const GLdouble * v)
517496c5ddc4Srjs{
517596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
517696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WindowPos3dv);
517796c5ddc4Srjs   struct marshal_cmd_WindowPos3dv *cmd;
517896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos3dv, cmd_size);
517996c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLdouble));
518096c5ddc4Srjs}
518196c5ddc4Srjs
518296c5ddc4Srjs
518396c5ddc4Srjs/* WindowPos3f: marshalled asynchronously */
518496c5ddc4Srjsstruct marshal_cmd_WindowPos3f
518596c5ddc4Srjs{
518696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
518796c5ddc4Srjs   GLfloat x;
518896c5ddc4Srjs   GLfloat y;
518996c5ddc4Srjs   GLfloat z;
519096c5ddc4Srjs};
519196c5ddc4Srjsuint32_t
519296c5ddc4Srjs_mesa_unmarshal_WindowPos3f(struct gl_context *ctx, const struct marshal_cmd_WindowPos3f *cmd, const uint64_t *last)
519396c5ddc4Srjs{
519496c5ddc4Srjs   GLfloat x = cmd->x;
519596c5ddc4Srjs   GLfloat y = cmd->y;
519696c5ddc4Srjs   GLfloat z = cmd->z;
519796c5ddc4Srjs   CALL_WindowPos3f(ctx->CurrentServerDispatch, (x, y, z));
519896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos3f), 8) / 8);
519996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
520096c5ddc4Srjs   return cmd_size;
520196c5ddc4Srjs}
520296c5ddc4Srjsvoid GLAPIENTRY
520396c5ddc4Srjs_mesa_marshal_WindowPos3f(GLfloat x, GLfloat y, GLfloat z)
520496c5ddc4Srjs{
520596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
520696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WindowPos3f);
520796c5ddc4Srjs   struct marshal_cmd_WindowPos3f *cmd;
520896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos3f, cmd_size);
520996c5ddc4Srjs   cmd->x = x;
521096c5ddc4Srjs   cmd->y = y;
521196c5ddc4Srjs   cmd->z = z;
521296c5ddc4Srjs}
521396c5ddc4Srjs
521496c5ddc4Srjs
521596c5ddc4Srjs/* WindowPos3fv: marshalled asynchronously */
521696c5ddc4Srjsstruct marshal_cmd_WindowPos3fv
521796c5ddc4Srjs{
521896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
521996c5ddc4Srjs   GLfloat v[3];
522096c5ddc4Srjs};
522196c5ddc4Srjsuint32_t
522296c5ddc4Srjs_mesa_unmarshal_WindowPos3fv(struct gl_context *ctx, const struct marshal_cmd_WindowPos3fv *cmd, const uint64_t *last)
522396c5ddc4Srjs{
522496c5ddc4Srjs   const GLfloat * v = cmd->v;
522596c5ddc4Srjs   CALL_WindowPos3fv(ctx->CurrentServerDispatch, (v));
522696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos3fv), 8) / 8);
522796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
522896c5ddc4Srjs   return cmd_size;
522996c5ddc4Srjs}
523096c5ddc4Srjsvoid GLAPIENTRY
523196c5ddc4Srjs_mesa_marshal_WindowPos3fv(const GLfloat * v)
523296c5ddc4Srjs{
523396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
523496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WindowPos3fv);
523596c5ddc4Srjs   struct marshal_cmd_WindowPos3fv *cmd;
523696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos3fv, cmd_size);
523796c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLfloat));
523896c5ddc4Srjs}
523996c5ddc4Srjs
524096c5ddc4Srjs
524196c5ddc4Srjs/* WindowPos3i: marshalled asynchronously */
524296c5ddc4Srjsstruct marshal_cmd_WindowPos3i
524396c5ddc4Srjs{
524496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
524596c5ddc4Srjs   GLint x;
524696c5ddc4Srjs   GLint y;
524796c5ddc4Srjs   GLint z;
524896c5ddc4Srjs};
524996c5ddc4Srjsuint32_t
525096c5ddc4Srjs_mesa_unmarshal_WindowPos3i(struct gl_context *ctx, const struct marshal_cmd_WindowPos3i *cmd, const uint64_t *last)
525196c5ddc4Srjs{
525296c5ddc4Srjs   GLint x = cmd->x;
525396c5ddc4Srjs   GLint y = cmd->y;
525496c5ddc4Srjs   GLint z = cmd->z;
525596c5ddc4Srjs   CALL_WindowPos3i(ctx->CurrentServerDispatch, (x, y, z));
525696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos3i), 8) / 8);
525796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
525896c5ddc4Srjs   return cmd_size;
525996c5ddc4Srjs}
526096c5ddc4Srjsvoid GLAPIENTRY
526196c5ddc4Srjs_mesa_marshal_WindowPos3i(GLint x, GLint y, GLint z)
526296c5ddc4Srjs{
526396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
526496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WindowPos3i);
526596c5ddc4Srjs   struct marshal_cmd_WindowPos3i *cmd;
526696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos3i, cmd_size);
526796c5ddc4Srjs   cmd->x = x;
526896c5ddc4Srjs   cmd->y = y;
526996c5ddc4Srjs   cmd->z = z;
527096c5ddc4Srjs}
527196c5ddc4Srjs
527296c5ddc4Srjs
527396c5ddc4Srjs/* WindowPos3iv: marshalled asynchronously */
527496c5ddc4Srjsstruct marshal_cmd_WindowPos3iv
527596c5ddc4Srjs{
527696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
527796c5ddc4Srjs   GLint v[3];
527896c5ddc4Srjs};
527996c5ddc4Srjsuint32_t
528096c5ddc4Srjs_mesa_unmarshal_WindowPos3iv(struct gl_context *ctx, const struct marshal_cmd_WindowPos3iv *cmd, const uint64_t *last)
528196c5ddc4Srjs{
528296c5ddc4Srjs   const GLint * v = cmd->v;
528396c5ddc4Srjs   CALL_WindowPos3iv(ctx->CurrentServerDispatch, (v));
528496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos3iv), 8) / 8);
528596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
528696c5ddc4Srjs   return cmd_size;
528796c5ddc4Srjs}
528896c5ddc4Srjsvoid GLAPIENTRY
528996c5ddc4Srjs_mesa_marshal_WindowPos3iv(const GLint * v)
529096c5ddc4Srjs{
529196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
529296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WindowPos3iv);
529396c5ddc4Srjs   struct marshal_cmd_WindowPos3iv *cmd;
529496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos3iv, cmd_size);
529596c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLint));
529696c5ddc4Srjs}
529796c5ddc4Srjs
529896c5ddc4Srjs
529996c5ddc4Srjs/* WindowPos3s: marshalled asynchronously */
530096c5ddc4Srjsstruct marshal_cmd_WindowPos3s
530196c5ddc4Srjs{
530296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
530396c5ddc4Srjs   GLshort x;
530496c5ddc4Srjs   GLshort y;
530596c5ddc4Srjs   GLshort z;
530696c5ddc4Srjs};
530796c5ddc4Srjsuint32_t
530896c5ddc4Srjs_mesa_unmarshal_WindowPos3s(struct gl_context *ctx, const struct marshal_cmd_WindowPos3s *cmd, const uint64_t *last)
530996c5ddc4Srjs{
531096c5ddc4Srjs   GLshort x = cmd->x;
531196c5ddc4Srjs   GLshort y = cmd->y;
531296c5ddc4Srjs   GLshort z = cmd->z;
531396c5ddc4Srjs   CALL_WindowPos3s(ctx->CurrentServerDispatch, (x, y, z));
531496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos3s), 8) / 8);
531596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
531696c5ddc4Srjs   return cmd_size;
531796c5ddc4Srjs}
531896c5ddc4Srjsvoid GLAPIENTRY
531996c5ddc4Srjs_mesa_marshal_WindowPos3s(GLshort x, GLshort y, GLshort z)
532096c5ddc4Srjs{
532196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
532296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WindowPos3s);
532396c5ddc4Srjs   struct marshal_cmd_WindowPos3s *cmd;
532496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos3s, cmd_size);
532596c5ddc4Srjs   cmd->x = x;
532696c5ddc4Srjs   cmd->y = y;
532796c5ddc4Srjs   cmd->z = z;
532896c5ddc4Srjs}
532996c5ddc4Srjs
533096c5ddc4Srjs
533196c5ddc4Srjs/* WindowPos3sv: marshalled asynchronously */
533296c5ddc4Srjsstruct marshal_cmd_WindowPos3sv
533396c5ddc4Srjs{
533496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
533596c5ddc4Srjs   GLshort v[3];
533696c5ddc4Srjs};
533796c5ddc4Srjsuint32_t
533896c5ddc4Srjs_mesa_unmarshal_WindowPos3sv(struct gl_context *ctx, const struct marshal_cmd_WindowPos3sv *cmd, const uint64_t *last)
533996c5ddc4Srjs{
534096c5ddc4Srjs   const GLshort * v = cmd->v;
534196c5ddc4Srjs   CALL_WindowPos3sv(ctx->CurrentServerDispatch, (v));
534296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WindowPos3sv), 8) / 8);
534396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
534496c5ddc4Srjs   return cmd_size;
534596c5ddc4Srjs}
534696c5ddc4Srjsvoid GLAPIENTRY
534796c5ddc4Srjs_mesa_marshal_WindowPos3sv(const GLshort * v)
534896c5ddc4Srjs{
534996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
535096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_WindowPos3sv);
535196c5ddc4Srjs   struct marshal_cmd_WindowPos3sv *cmd;
535296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos3sv, cmd_size);
535396c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLshort));
535496c5ddc4Srjs}
535596c5ddc4Srjs
535696c5ddc4Srjs
535796c5ddc4Srjs/* BindBuffer: marshalled asynchronously */
535896c5ddc4Srjsstruct marshal_cmd_BindBuffer
535996c5ddc4Srjs{
536096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
536196c5ddc4Srjs   GLenum target;
536296c5ddc4Srjs   GLuint buffer;
536396c5ddc4Srjs};
536496c5ddc4Srjsuint32_t
536596c5ddc4Srjs_mesa_unmarshal_BindBuffer(struct gl_context *ctx, const struct marshal_cmd_BindBuffer *cmd, const uint64_t *last)
536696c5ddc4Srjs{
536796c5ddc4Srjs   GLenum target = cmd->target;
536896c5ddc4Srjs   GLuint buffer = cmd->buffer;
536996c5ddc4Srjs   CALL_BindBuffer(ctx->CurrentServerDispatch, (target, buffer));
537096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindBuffer), 8) / 8);
537196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
537296c5ddc4Srjs   return cmd_size;
537396c5ddc4Srjs}
537496c5ddc4Srjsvoid GLAPIENTRY
537596c5ddc4Srjs_mesa_marshal_BindBuffer(GLenum target, GLuint buffer)
537696c5ddc4Srjs{
537796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
537896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindBuffer);
537996c5ddc4Srjs   struct marshal_cmd_BindBuffer *cmd;
538096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindBuffer, cmd_size);
538196c5ddc4Srjs   cmd->target = target;
538296c5ddc4Srjs   cmd->buffer = buffer;
538396c5ddc4Srjs   if (COMPAT) _mesa_glthread_BindBuffer(ctx, target, buffer);
538496c5ddc4Srjs}
538596c5ddc4Srjs
538696c5ddc4Srjs
538796c5ddc4Srjs/* DeleteBuffers: marshalled asynchronously */
538896c5ddc4Srjsstruct marshal_cmd_DeleteBuffers
538996c5ddc4Srjs{
539096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
539196c5ddc4Srjs   GLsizei n;
539296c5ddc4Srjs   /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint buffer[n] */
539396c5ddc4Srjs};
539496c5ddc4Srjsuint32_t
539596c5ddc4Srjs_mesa_unmarshal_DeleteBuffers(struct gl_context *ctx, const struct marshal_cmd_DeleteBuffers *cmd, const uint64_t *last)
539696c5ddc4Srjs{
539796c5ddc4Srjs   GLsizei n = cmd->n;
539896c5ddc4Srjs   GLuint * buffer;
539996c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
540096c5ddc4Srjs   buffer = (GLuint *) variable_data;
540196c5ddc4Srjs   CALL_DeleteBuffers(ctx->CurrentServerDispatch, (n, buffer));
540296c5ddc4Srjs   return cmd->cmd_base.cmd_size;
540396c5ddc4Srjs}
540496c5ddc4Srjsvoid GLAPIENTRY
540596c5ddc4Srjs_mesa_marshal_DeleteBuffers(GLsizei n, const GLuint * buffer)
540696c5ddc4Srjs{
540796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
540896c5ddc4Srjs   int buffer_size = safe_mul(n, 1 * sizeof(GLuint));
540996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DeleteBuffers) + buffer_size;
541096c5ddc4Srjs   struct marshal_cmd_DeleteBuffers *cmd;
541196c5ddc4Srjs   if (unlikely(buffer_size < 0 || (buffer_size > 0 && !buffer) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
541296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "DeleteBuffers");
541396c5ddc4Srjs      CALL_DeleteBuffers(ctx->CurrentServerDispatch, (n, buffer));
541496c5ddc4Srjs      if (COMPAT) _mesa_glthread_DeleteBuffers(ctx, n, buffer);
541596c5ddc4Srjs      return;
541696c5ddc4Srjs   }
541796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteBuffers, cmd_size);
541896c5ddc4Srjs   cmd->n = n;
541996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
542096c5ddc4Srjs   memcpy(variable_data, buffer, buffer_size);
542196c5ddc4Srjs   if (COMPAT) _mesa_glthread_DeleteBuffers(ctx, n, buffer);
542296c5ddc4Srjs}
542396c5ddc4Srjs
542496c5ddc4Srjs
542596c5ddc4Srjs/* GenBuffers: marshalled synchronously */
542696c5ddc4Srjsvoid GLAPIENTRY
542796c5ddc4Srjs_mesa_marshal_GenBuffers(GLsizei n, GLuint * buffer)
542896c5ddc4Srjs{
542996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
543096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GenBuffers");
543196c5ddc4Srjs   CALL_GenBuffers(ctx->CurrentServerDispatch, (n, buffer));
543296c5ddc4Srjs}
543396c5ddc4Srjs
543496c5ddc4Srjs
543596c5ddc4Srjs/* GetBufferParameteriv: marshalled synchronously */
543696c5ddc4Srjsvoid GLAPIENTRY
543796c5ddc4Srjs_mesa_marshal_GetBufferParameteriv(GLenum target, GLenum pname, GLint * params)
543896c5ddc4Srjs{
543996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
544096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetBufferParameteriv");
544196c5ddc4Srjs   CALL_GetBufferParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
544296c5ddc4Srjs}
544396c5ddc4Srjs
544496c5ddc4Srjs
544596c5ddc4Srjs/* GetBufferPointerv: marshalled synchronously */
544696c5ddc4Srjsvoid GLAPIENTRY
544796c5ddc4Srjs_mesa_marshal_GetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params)
544896c5ddc4Srjs{
544996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
545096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetBufferPointerv");
545196c5ddc4Srjs   CALL_GetBufferPointerv(ctx->CurrentServerDispatch, (target, pname, params));
545296c5ddc4Srjs}
545396c5ddc4Srjs
545496c5ddc4Srjs
545596c5ddc4Srjs/* GetBufferSubData: marshalled synchronously */
545696c5ddc4Srjsvoid GLAPIENTRY
545796c5ddc4Srjs_mesa_marshal_GetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data)
545896c5ddc4Srjs{
545996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
546096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetBufferSubData");
546196c5ddc4Srjs   CALL_GetBufferSubData(ctx->CurrentServerDispatch, (target, offset, size, data));
546296c5ddc4Srjs}
546396c5ddc4Srjs
546496c5ddc4Srjs
546596c5ddc4Srjs/* IsBuffer: marshalled synchronously */
546696c5ddc4SrjsGLboolean GLAPIENTRY
546796c5ddc4Srjs_mesa_marshal_IsBuffer(GLuint buffer)
546896c5ddc4Srjs{
546996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
547096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsBuffer");
547196c5ddc4Srjs   return CALL_IsBuffer(ctx->CurrentServerDispatch, (buffer));
547296c5ddc4Srjs}
547396c5ddc4Srjs
547496c5ddc4Srjs
547596c5ddc4Srjs/* MapBuffer: marshalled synchronously */
547696c5ddc4SrjsGLvoid * GLAPIENTRY
547796c5ddc4Srjs_mesa_marshal_MapBuffer(GLenum target, GLenum access)
547896c5ddc4Srjs{
547996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
548096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "MapBuffer");
548196c5ddc4Srjs   return CALL_MapBuffer(ctx->CurrentServerDispatch, (target, access));
548296c5ddc4Srjs}
548396c5ddc4Srjs
548496c5ddc4Srjs
548596c5ddc4Srjs/* UnmapBuffer: marshalled asynchronously */
548696c5ddc4Srjsstruct marshal_cmd_UnmapBuffer
548796c5ddc4Srjs{
548896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
548996c5ddc4Srjs   GLenum target;
549096c5ddc4Srjs};
549196c5ddc4Srjsuint32_t
549296c5ddc4Srjs_mesa_unmarshal_UnmapBuffer(struct gl_context *ctx, const struct marshal_cmd_UnmapBuffer *cmd, const uint64_t *last)
549396c5ddc4Srjs{
549496c5ddc4Srjs   GLenum target = cmd->target;
549596c5ddc4Srjs   CALL_UnmapBuffer(ctx->CurrentServerDispatch, (target));
549696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_UnmapBuffer), 8) / 8);
549796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
549896c5ddc4Srjs   return cmd_size;
549996c5ddc4Srjs}
550096c5ddc4SrjsGLboolean GLAPIENTRY
550196c5ddc4Srjs_mesa_marshal_UnmapBuffer(GLenum target)
550296c5ddc4Srjs{
550396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
550496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UnmapBuffer);
550596c5ddc4Srjs   struct marshal_cmd_UnmapBuffer *cmd;
550696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UnmapBuffer, cmd_size);
550796c5ddc4Srjs   cmd->target = target;
550896c5ddc4Srjs   return GL_TRUE;
550996c5ddc4Srjs}
551096c5ddc4Srjs
551196c5ddc4Srjs
551296c5ddc4Srjs/* GenQueries: marshalled synchronously */
551396c5ddc4Srjsvoid GLAPIENTRY
551496c5ddc4Srjs_mesa_marshal_GenQueries(GLsizei n, GLuint * ids)
551596c5ddc4Srjs{
551696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
551796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GenQueries");
551896c5ddc4Srjs   CALL_GenQueries(ctx->CurrentServerDispatch, (n, ids));
551996c5ddc4Srjs}
552096c5ddc4Srjs
552196c5ddc4Srjs
552296c5ddc4Srjs/* DeleteQueries: marshalled asynchronously */
552396c5ddc4Srjsstruct marshal_cmd_DeleteQueries
552496c5ddc4Srjs{
552596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
552696c5ddc4Srjs   GLsizei n;
552796c5ddc4Srjs   /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint ids[n] */
552896c5ddc4Srjs};
552996c5ddc4Srjsuint32_t
553096c5ddc4Srjs_mesa_unmarshal_DeleteQueries(struct gl_context *ctx, const struct marshal_cmd_DeleteQueries *cmd, const uint64_t *last)
553196c5ddc4Srjs{
553296c5ddc4Srjs   GLsizei n = cmd->n;
553396c5ddc4Srjs   GLuint * ids;
553496c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
553596c5ddc4Srjs   ids = (GLuint *) variable_data;
553696c5ddc4Srjs   CALL_DeleteQueries(ctx->CurrentServerDispatch, (n, ids));
553796c5ddc4Srjs   return cmd->cmd_base.cmd_size;
553896c5ddc4Srjs}
553996c5ddc4Srjsvoid GLAPIENTRY
554096c5ddc4Srjs_mesa_marshal_DeleteQueries(GLsizei n, const GLuint * ids)
554196c5ddc4Srjs{
554296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
554396c5ddc4Srjs   int ids_size = safe_mul(n, 1 * sizeof(GLuint));
554496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DeleteQueries) + ids_size;
554596c5ddc4Srjs   struct marshal_cmd_DeleteQueries *cmd;
554696c5ddc4Srjs   if (unlikely(ids_size < 0 || (ids_size > 0 && !ids) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
554796c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "DeleteQueries");
554896c5ddc4Srjs      CALL_DeleteQueries(ctx->CurrentServerDispatch, (n, ids));
554996c5ddc4Srjs      return;
555096c5ddc4Srjs   }
555196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteQueries, cmd_size);
555296c5ddc4Srjs   cmd->n = n;
555396c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
555496c5ddc4Srjs   memcpy(variable_data, ids, ids_size);
555596c5ddc4Srjs}
555696c5ddc4Srjs
555796c5ddc4Srjs
555896c5ddc4Srjs/* IsQuery: marshalled synchronously */
555996c5ddc4SrjsGLboolean GLAPIENTRY
556096c5ddc4Srjs_mesa_marshal_IsQuery(GLuint id)
556196c5ddc4Srjs{
556296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
556396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsQuery");
556496c5ddc4Srjs   return CALL_IsQuery(ctx->CurrentServerDispatch, (id));
556596c5ddc4Srjs}
556696c5ddc4Srjs
556796c5ddc4Srjs
556896c5ddc4Srjs/* BeginQuery: marshalled asynchronously */
556996c5ddc4Srjsstruct marshal_cmd_BeginQuery
557096c5ddc4Srjs{
557196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
557296c5ddc4Srjs   GLenum target;
557396c5ddc4Srjs   GLuint id;
557496c5ddc4Srjs};
557596c5ddc4Srjsuint32_t
557696c5ddc4Srjs_mesa_unmarshal_BeginQuery(struct gl_context *ctx, const struct marshal_cmd_BeginQuery *cmd, const uint64_t *last)
557796c5ddc4Srjs{
557896c5ddc4Srjs   GLenum target = cmd->target;
557996c5ddc4Srjs   GLuint id = cmd->id;
558096c5ddc4Srjs   CALL_BeginQuery(ctx->CurrentServerDispatch, (target, id));
558196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BeginQuery), 8) / 8);
558296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
558396c5ddc4Srjs   return cmd_size;
558496c5ddc4Srjs}
558596c5ddc4Srjsvoid GLAPIENTRY
558696c5ddc4Srjs_mesa_marshal_BeginQuery(GLenum target, GLuint id)
558796c5ddc4Srjs{
558896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
558996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BeginQuery);
559096c5ddc4Srjs   struct marshal_cmd_BeginQuery *cmd;
559196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BeginQuery, cmd_size);
559296c5ddc4Srjs   cmd->target = target;
559396c5ddc4Srjs   cmd->id = id;
559496c5ddc4Srjs}
559596c5ddc4Srjs
559696c5ddc4Srjs
559796c5ddc4Srjs/* EndQuery: marshalled asynchronously */
559896c5ddc4Srjsstruct marshal_cmd_EndQuery
559996c5ddc4Srjs{
560096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
560196c5ddc4Srjs   GLenum target;
560296c5ddc4Srjs};
560396c5ddc4Srjsuint32_t
560496c5ddc4Srjs_mesa_unmarshal_EndQuery(struct gl_context *ctx, const struct marshal_cmd_EndQuery *cmd, const uint64_t *last)
560596c5ddc4Srjs{
560696c5ddc4Srjs   GLenum target = cmd->target;
560796c5ddc4Srjs   CALL_EndQuery(ctx->CurrentServerDispatch, (target));
560896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_EndQuery), 8) / 8);
560996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
561096c5ddc4Srjs   return cmd_size;
561196c5ddc4Srjs}
561296c5ddc4Srjsvoid GLAPIENTRY
561396c5ddc4Srjs_mesa_marshal_EndQuery(GLenum target)
561496c5ddc4Srjs{
561596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
561696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_EndQuery);
561796c5ddc4Srjs   struct marshal_cmd_EndQuery *cmd;
561896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EndQuery, cmd_size);
561996c5ddc4Srjs   cmd->target = target;
562096c5ddc4Srjs}
562196c5ddc4Srjs
562296c5ddc4Srjs
562396c5ddc4Srjs/* GetQueryiv: marshalled synchronously */
562496c5ddc4Srjsvoid GLAPIENTRY
562596c5ddc4Srjs_mesa_marshal_GetQueryiv(GLenum target, GLenum pname, GLint * params)
562696c5ddc4Srjs{
562796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
562896c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetQueryiv");
562996c5ddc4Srjs   CALL_GetQueryiv(ctx->CurrentServerDispatch, (target, pname, params));
563096c5ddc4Srjs}
563196c5ddc4Srjs
563296c5ddc4Srjs
563396c5ddc4Srjs/* GetQueryObjectiv: marshalled synchronously */
563496c5ddc4Srjsvoid GLAPIENTRY
563596c5ddc4Srjs_mesa_marshal_GetQueryObjectiv(GLuint id, GLenum pname, GLint * params)
563696c5ddc4Srjs{
563796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
563896c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetQueryObjectiv");
563996c5ddc4Srjs   CALL_GetQueryObjectiv(ctx->CurrentServerDispatch, (id, pname, params));
564096c5ddc4Srjs}
564196c5ddc4Srjs
564296c5ddc4Srjs
564396c5ddc4Srjs/* GetQueryObjectuiv: marshalled synchronously */
564496c5ddc4Srjsvoid GLAPIENTRY
564596c5ddc4Srjs_mesa_marshal_GetQueryObjectuiv(GLuint id, GLenum pname, GLuint * params)
564696c5ddc4Srjs{
564796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
564896c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetQueryObjectuiv");
564996c5ddc4Srjs   CALL_GetQueryObjectuiv(ctx->CurrentServerDispatch, (id, pname, params));
565096c5ddc4Srjs}
565196c5ddc4Srjs
565296c5ddc4Srjs
565396c5ddc4Srjs/* BlendEquationSeparate: marshalled asynchronously */
565496c5ddc4Srjsstruct marshal_cmd_BlendEquationSeparate
565596c5ddc4Srjs{
565696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
565796c5ddc4Srjs   GLenum modeRGB;
565896c5ddc4Srjs   GLenum modeA;
565996c5ddc4Srjs};
566096c5ddc4Srjsuint32_t
566196c5ddc4Srjs_mesa_unmarshal_BlendEquationSeparate(struct gl_context *ctx, const struct marshal_cmd_BlendEquationSeparate *cmd, const uint64_t *last)
566296c5ddc4Srjs{
566396c5ddc4Srjs   GLenum modeRGB = cmd->modeRGB;
566496c5ddc4Srjs   GLenum modeA = cmd->modeA;
566596c5ddc4Srjs   CALL_BlendEquationSeparate(ctx->CurrentServerDispatch, (modeRGB, modeA));
566696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BlendEquationSeparate), 8) / 8);
566796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
566896c5ddc4Srjs   return cmd_size;
566996c5ddc4Srjs}
567096c5ddc4Srjsvoid GLAPIENTRY
567196c5ddc4Srjs_mesa_marshal_BlendEquationSeparate(GLenum modeRGB, GLenum modeA)
567296c5ddc4Srjs{
567396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
567496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BlendEquationSeparate);
567596c5ddc4Srjs   struct marshal_cmd_BlendEquationSeparate *cmd;
567696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendEquationSeparate, cmd_size);
567796c5ddc4Srjs   cmd->modeRGB = modeRGB;
567896c5ddc4Srjs   cmd->modeA = modeA;
567996c5ddc4Srjs}
568096c5ddc4Srjs
568196c5ddc4Srjs
568296c5ddc4Srjs/* DrawBuffers: marshalled asynchronously */
568396c5ddc4Srjsstruct marshal_cmd_DrawBuffers
568496c5ddc4Srjs{
568596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
568696c5ddc4Srjs   GLsizei n;
568796c5ddc4Srjs   /* Next safe_mul(n, 1 * sizeof(GLenum)) bytes are GLenum bufs[n] */
568896c5ddc4Srjs};
568996c5ddc4Srjsuint32_t
569096c5ddc4Srjs_mesa_unmarshal_DrawBuffers(struct gl_context *ctx, const struct marshal_cmd_DrawBuffers *cmd, const uint64_t *last)
569196c5ddc4Srjs{
569296c5ddc4Srjs   GLsizei n = cmd->n;
569396c5ddc4Srjs   GLenum * bufs;
569496c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
569596c5ddc4Srjs   bufs = (GLenum *) variable_data;
569696c5ddc4Srjs   CALL_DrawBuffers(ctx->CurrentServerDispatch, (n, bufs));
569796c5ddc4Srjs   return cmd->cmd_base.cmd_size;
569896c5ddc4Srjs}
569996c5ddc4Srjsvoid GLAPIENTRY
570096c5ddc4Srjs_mesa_marshal_DrawBuffers(GLsizei n, const GLenum * bufs)
570196c5ddc4Srjs{
570296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
570396c5ddc4Srjs   int bufs_size = safe_mul(n, 1 * sizeof(GLenum));
570496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DrawBuffers) + bufs_size;
570596c5ddc4Srjs   struct marshal_cmd_DrawBuffers *cmd;
570696c5ddc4Srjs   if (unlikely(bufs_size < 0 || (bufs_size > 0 && !bufs) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
570796c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "DrawBuffers");
570896c5ddc4Srjs      CALL_DrawBuffers(ctx->CurrentServerDispatch, (n, bufs));
570996c5ddc4Srjs      return;
571096c5ddc4Srjs   }
571196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawBuffers, cmd_size);
571296c5ddc4Srjs   cmd->n = n;
571396c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
571496c5ddc4Srjs   memcpy(variable_data, bufs, bufs_size);
571596c5ddc4Srjs}
571696c5ddc4Srjs
571796c5ddc4Srjs
571896c5ddc4Srjs/* StencilFuncSeparate: marshalled asynchronously */
571996c5ddc4Srjsstruct marshal_cmd_StencilFuncSeparate
572096c5ddc4Srjs{
572196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
572296c5ddc4Srjs   GLenum face;
572396c5ddc4Srjs   GLenum func;
572496c5ddc4Srjs   GLint ref;
572596c5ddc4Srjs   GLuint mask;
572696c5ddc4Srjs};
572796c5ddc4Srjsuint32_t
572896c5ddc4Srjs_mesa_unmarshal_StencilFuncSeparate(struct gl_context *ctx, const struct marshal_cmd_StencilFuncSeparate *cmd, const uint64_t *last)
572996c5ddc4Srjs{
573096c5ddc4Srjs   GLenum face = cmd->face;
573196c5ddc4Srjs   GLenum func = cmd->func;
573296c5ddc4Srjs   GLint ref = cmd->ref;
573396c5ddc4Srjs   GLuint mask = cmd->mask;
573496c5ddc4Srjs   CALL_StencilFuncSeparate(ctx->CurrentServerDispatch, (face, func, ref, mask));
573596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_StencilFuncSeparate), 8) / 8);
573696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
573796c5ddc4Srjs   return cmd_size;
573896c5ddc4Srjs}
573996c5ddc4Srjsvoid GLAPIENTRY
574096c5ddc4Srjs_mesa_marshal_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
574196c5ddc4Srjs{
574296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
574396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_StencilFuncSeparate);
574496c5ddc4Srjs   struct marshal_cmd_StencilFuncSeparate *cmd;
574596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_StencilFuncSeparate, cmd_size);
574696c5ddc4Srjs   cmd->face = face;
574796c5ddc4Srjs   cmd->func = func;
574896c5ddc4Srjs   cmd->ref = ref;
574996c5ddc4Srjs   cmd->mask = mask;
575096c5ddc4Srjs}
575196c5ddc4Srjs
575296c5ddc4Srjs
575396c5ddc4Srjs/* StencilOpSeparate: marshalled asynchronously */
575496c5ddc4Srjsstruct marshal_cmd_StencilOpSeparate
575596c5ddc4Srjs{
575696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
575796c5ddc4Srjs   GLenum face;
575896c5ddc4Srjs   GLenum sfail;
575996c5ddc4Srjs   GLenum zfail;
576096c5ddc4Srjs   GLenum zpass;
576196c5ddc4Srjs};
576296c5ddc4Srjsuint32_t
576396c5ddc4Srjs_mesa_unmarshal_StencilOpSeparate(struct gl_context *ctx, const struct marshal_cmd_StencilOpSeparate *cmd, const uint64_t *last)
576496c5ddc4Srjs{
576596c5ddc4Srjs   GLenum face = cmd->face;
576696c5ddc4Srjs   GLenum sfail = cmd->sfail;
576796c5ddc4Srjs   GLenum zfail = cmd->zfail;
576896c5ddc4Srjs   GLenum zpass = cmd->zpass;
576996c5ddc4Srjs   CALL_StencilOpSeparate(ctx->CurrentServerDispatch, (face, sfail, zfail, zpass));
577096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_StencilOpSeparate), 8) / 8);
577196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
577296c5ddc4Srjs   return cmd_size;
577396c5ddc4Srjs}
577496c5ddc4Srjsvoid GLAPIENTRY
577596c5ddc4Srjs_mesa_marshal_StencilOpSeparate(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass)
577696c5ddc4Srjs{
577796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
577896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_StencilOpSeparate);
577996c5ddc4Srjs   struct marshal_cmd_StencilOpSeparate *cmd;
578096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_StencilOpSeparate, cmd_size);
578196c5ddc4Srjs   cmd->face = face;
578296c5ddc4Srjs   cmd->sfail = sfail;
578396c5ddc4Srjs   cmd->zfail = zfail;
578496c5ddc4Srjs   cmd->zpass = zpass;
578596c5ddc4Srjs}
578696c5ddc4Srjs
578796c5ddc4Srjs
578896c5ddc4Srjs/* StencilMaskSeparate: marshalled asynchronously */
578996c5ddc4Srjsstruct marshal_cmd_StencilMaskSeparate
579096c5ddc4Srjs{
579196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
579296c5ddc4Srjs   GLenum face;
579396c5ddc4Srjs   GLuint mask;
579496c5ddc4Srjs};
579596c5ddc4Srjsuint32_t
579696c5ddc4Srjs_mesa_unmarshal_StencilMaskSeparate(struct gl_context *ctx, const struct marshal_cmd_StencilMaskSeparate *cmd, const uint64_t *last)
579796c5ddc4Srjs{
579896c5ddc4Srjs   GLenum face = cmd->face;
579996c5ddc4Srjs   GLuint mask = cmd->mask;
580096c5ddc4Srjs   CALL_StencilMaskSeparate(ctx->CurrentServerDispatch, (face, mask));
580196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_StencilMaskSeparate), 8) / 8);
580296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
580396c5ddc4Srjs   return cmd_size;
580496c5ddc4Srjs}
580596c5ddc4Srjsvoid GLAPIENTRY
580696c5ddc4Srjs_mesa_marshal_StencilMaskSeparate(GLenum face, GLuint mask)
580796c5ddc4Srjs{
580896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
580996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_StencilMaskSeparate);
581096c5ddc4Srjs   struct marshal_cmd_StencilMaskSeparate *cmd;
581196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_StencilMaskSeparate, cmd_size);
581296c5ddc4Srjs   cmd->face = face;
581396c5ddc4Srjs   cmd->mask = mask;
581496c5ddc4Srjs}
581596c5ddc4Srjs
581696c5ddc4Srjs
581796c5ddc4Srjs/* AttachShader: marshalled asynchronously */
581896c5ddc4Srjsstruct marshal_cmd_AttachShader
581996c5ddc4Srjs{
582096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
582196c5ddc4Srjs   GLuint program;
582296c5ddc4Srjs   GLuint shader;
582396c5ddc4Srjs};
582496c5ddc4Srjsuint32_t
582596c5ddc4Srjs_mesa_unmarshal_AttachShader(struct gl_context *ctx, const struct marshal_cmd_AttachShader *cmd, const uint64_t *last)
582696c5ddc4Srjs{
582796c5ddc4Srjs   GLuint program = cmd->program;
582896c5ddc4Srjs   GLuint shader = cmd->shader;
582996c5ddc4Srjs   CALL_AttachShader(ctx->CurrentServerDispatch, (program, shader));
583096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_AttachShader), 8) / 8);
583196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
583296c5ddc4Srjs   return cmd_size;
583396c5ddc4Srjs}
583496c5ddc4Srjsvoid GLAPIENTRY
583596c5ddc4Srjs_mesa_marshal_AttachShader(GLuint program, GLuint shader)
583696c5ddc4Srjs{
583796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
583896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_AttachShader);
583996c5ddc4Srjs   struct marshal_cmd_AttachShader *cmd;
584096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_AttachShader, cmd_size);
584196c5ddc4Srjs   cmd->program = program;
584296c5ddc4Srjs   cmd->shader = shader;
584396c5ddc4Srjs}
584496c5ddc4Srjs
584596c5ddc4Srjs
584696c5ddc4Srjs/* BindAttribLocation: marshalled asynchronously */
584796c5ddc4Srjsstruct marshal_cmd_BindAttribLocation
584896c5ddc4Srjs{
584996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
585096c5ddc4Srjs   GLuint program;
585196c5ddc4Srjs   GLuint index;
585296c5ddc4Srjs   /* Next (strlen(name) + 1) bytes are GLchar name[(strlen(name) + 1)] */
585396c5ddc4Srjs};
585496c5ddc4Srjsuint32_t
585596c5ddc4Srjs_mesa_unmarshal_BindAttribLocation(struct gl_context *ctx, const struct marshal_cmd_BindAttribLocation *cmd, const uint64_t *last)
585696c5ddc4Srjs{
585796c5ddc4Srjs   GLuint program = cmd->program;
585896c5ddc4Srjs   GLuint index = cmd->index;
585996c5ddc4Srjs   GLchar * name;
586096c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
586196c5ddc4Srjs   name = (GLchar *) variable_data;
586296c5ddc4Srjs   CALL_BindAttribLocation(ctx->CurrentServerDispatch, (program, index, name));
586396c5ddc4Srjs   return cmd->cmd_base.cmd_size;
586496c5ddc4Srjs}
586596c5ddc4Srjsvoid GLAPIENTRY
586696c5ddc4Srjs_mesa_marshal_BindAttribLocation(GLuint program, GLuint index, const GLchar * name)
586796c5ddc4Srjs{
586896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
586996c5ddc4Srjs   int name_size = (strlen(name) + 1);
587096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindAttribLocation) + name_size;
587196c5ddc4Srjs   struct marshal_cmd_BindAttribLocation *cmd;
587296c5ddc4Srjs   if (unlikely(name_size < 0 || (name_size > 0 && !name) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
587396c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "BindAttribLocation");
587496c5ddc4Srjs      CALL_BindAttribLocation(ctx->CurrentServerDispatch, (program, index, name));
587596c5ddc4Srjs      return;
587696c5ddc4Srjs   }
587796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindAttribLocation, cmd_size);
587896c5ddc4Srjs   cmd->program = program;
587996c5ddc4Srjs   cmd->index = index;
588096c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
588196c5ddc4Srjs   memcpy(variable_data, name, name_size);
588296c5ddc4Srjs}
588396c5ddc4Srjs
588496c5ddc4Srjs
588596c5ddc4Srjs/* CompileShader: marshalled asynchronously */
588696c5ddc4Srjsstruct marshal_cmd_CompileShader
588796c5ddc4Srjs{
588896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
588996c5ddc4Srjs   GLuint shader;
589096c5ddc4Srjs};
589196c5ddc4Srjsuint32_t
589296c5ddc4Srjs_mesa_unmarshal_CompileShader(struct gl_context *ctx, const struct marshal_cmd_CompileShader *cmd, const uint64_t *last)
589396c5ddc4Srjs{
589496c5ddc4Srjs   GLuint shader = cmd->shader;
589596c5ddc4Srjs   CALL_CompileShader(ctx->CurrentServerDispatch, (shader));
589696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CompileShader), 8) / 8);
589796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
589896c5ddc4Srjs   return cmd_size;
589996c5ddc4Srjs}
590096c5ddc4Srjsvoid GLAPIENTRY
590196c5ddc4Srjs_mesa_marshal_CompileShader(GLuint shader)
590296c5ddc4Srjs{
590396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
590496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CompileShader);
590596c5ddc4Srjs   struct marshal_cmd_CompileShader *cmd;
590696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CompileShader, cmd_size);
590796c5ddc4Srjs   cmd->shader = shader;
590896c5ddc4Srjs}
590996c5ddc4Srjs
591096c5ddc4Srjs
591196c5ddc4Srjs/* CreateProgram: marshalled synchronously */
591296c5ddc4SrjsGLuint GLAPIENTRY
591396c5ddc4Srjs_mesa_marshal_CreateProgram(void)
591496c5ddc4Srjs{
591596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
591696c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CreateProgram");
591796c5ddc4Srjs   return CALL_CreateProgram(ctx->CurrentServerDispatch, ());
591896c5ddc4Srjs}
591996c5ddc4Srjs
592096c5ddc4Srjs
592196c5ddc4Srjs/* CreateShader: marshalled synchronously */
592296c5ddc4SrjsGLuint GLAPIENTRY
592396c5ddc4Srjs_mesa_marshal_CreateShader(GLenum type)
592496c5ddc4Srjs{
592596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
592696c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CreateShader");
592796c5ddc4Srjs   return CALL_CreateShader(ctx->CurrentServerDispatch, (type));
592896c5ddc4Srjs}
592996c5ddc4Srjs
593096c5ddc4Srjs
593196c5ddc4Srjs/* DeleteProgram: marshalled asynchronously */
593296c5ddc4Srjsstruct marshal_cmd_DeleteProgram
593396c5ddc4Srjs{
593496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
593596c5ddc4Srjs   GLuint program;
593696c5ddc4Srjs};
593796c5ddc4Srjsuint32_t
593896c5ddc4Srjs_mesa_unmarshal_DeleteProgram(struct gl_context *ctx, const struct marshal_cmd_DeleteProgram *cmd, const uint64_t *last)
593996c5ddc4Srjs{
594096c5ddc4Srjs   GLuint program = cmd->program;
594196c5ddc4Srjs   CALL_DeleteProgram(ctx->CurrentServerDispatch, (program));
594296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DeleteProgram), 8) / 8);
594396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
594496c5ddc4Srjs   return cmd_size;
594596c5ddc4Srjs}
594696c5ddc4Srjsvoid GLAPIENTRY
594796c5ddc4Srjs_mesa_marshal_DeleteProgram(GLuint program)
594896c5ddc4Srjs{
594996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
595096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DeleteProgram);
595196c5ddc4Srjs   struct marshal_cmd_DeleteProgram *cmd;
595296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteProgram, cmd_size);
595396c5ddc4Srjs   cmd->program = program;
595496c5ddc4Srjs   _mesa_glthread_ProgramChanged(ctx);
595596c5ddc4Srjs}
595696c5ddc4Srjs
595796c5ddc4Srjs
595896c5ddc4Srjs/* DeleteShader: marshalled asynchronously */
595996c5ddc4Srjsstruct marshal_cmd_DeleteShader
596096c5ddc4Srjs{
596196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
596296c5ddc4Srjs   GLuint program;
596396c5ddc4Srjs};
596496c5ddc4Srjsuint32_t
596596c5ddc4Srjs_mesa_unmarshal_DeleteShader(struct gl_context *ctx, const struct marshal_cmd_DeleteShader *cmd, const uint64_t *last)
596696c5ddc4Srjs{
596796c5ddc4Srjs   GLuint program = cmd->program;
596896c5ddc4Srjs   CALL_DeleteShader(ctx->CurrentServerDispatch, (program));
596996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DeleteShader), 8) / 8);
597096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
597196c5ddc4Srjs   return cmd_size;
597296c5ddc4Srjs}
597396c5ddc4Srjsvoid GLAPIENTRY
597496c5ddc4Srjs_mesa_marshal_DeleteShader(GLuint program)
597596c5ddc4Srjs{
597696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
597796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DeleteShader);
597896c5ddc4Srjs   struct marshal_cmd_DeleteShader *cmd;
597996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteShader, cmd_size);
598096c5ddc4Srjs   cmd->program = program;
598196c5ddc4Srjs}
598296c5ddc4Srjs
598396c5ddc4Srjs
598496c5ddc4Srjs/* DetachShader: marshalled asynchronously */
598596c5ddc4Srjsstruct marshal_cmd_DetachShader
598696c5ddc4Srjs{
598796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
598896c5ddc4Srjs   GLuint program;
598996c5ddc4Srjs   GLuint shader;
599096c5ddc4Srjs};
599196c5ddc4Srjsuint32_t
599296c5ddc4Srjs_mesa_unmarshal_DetachShader(struct gl_context *ctx, const struct marshal_cmd_DetachShader *cmd, const uint64_t *last)
599396c5ddc4Srjs{
599496c5ddc4Srjs   GLuint program = cmd->program;
599596c5ddc4Srjs   GLuint shader = cmd->shader;
599696c5ddc4Srjs   CALL_DetachShader(ctx->CurrentServerDispatch, (program, shader));
599796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DetachShader), 8) / 8);
599896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
599996c5ddc4Srjs   return cmd_size;
600096c5ddc4Srjs}
600196c5ddc4Srjsvoid GLAPIENTRY
600296c5ddc4Srjs_mesa_marshal_DetachShader(GLuint program, GLuint shader)
600396c5ddc4Srjs{
600496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
600596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DetachShader);
600696c5ddc4Srjs   struct marshal_cmd_DetachShader *cmd;
600796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DetachShader, cmd_size);
600896c5ddc4Srjs   cmd->program = program;
600996c5ddc4Srjs   cmd->shader = shader;
601096c5ddc4Srjs}
601196c5ddc4Srjs
601296c5ddc4Srjs
601396c5ddc4Srjs/* DisableVertexAttribArray: marshalled asynchronously */
601496c5ddc4Srjsstruct marshal_cmd_DisableVertexAttribArray
601596c5ddc4Srjs{
601696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
601796c5ddc4Srjs   GLuint index;
601896c5ddc4Srjs};
601996c5ddc4Srjsuint32_t
602096c5ddc4Srjs_mesa_unmarshal_DisableVertexAttribArray(struct gl_context *ctx, const struct marshal_cmd_DisableVertexAttribArray *cmd, const uint64_t *last)
602196c5ddc4Srjs{
602296c5ddc4Srjs   GLuint index = cmd->index;
602396c5ddc4Srjs   CALL_DisableVertexAttribArray(ctx->CurrentServerDispatch, (index));
602496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DisableVertexAttribArray), 8) / 8);
602596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
602696c5ddc4Srjs   return cmd_size;
602796c5ddc4Srjs}
602896c5ddc4Srjsvoid GLAPIENTRY
602996c5ddc4Srjs_mesa_marshal_DisableVertexAttribArray(GLuint index)
603096c5ddc4Srjs{
603196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
603296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DisableVertexAttribArray);
603396c5ddc4Srjs   struct marshal_cmd_DisableVertexAttribArray *cmd;
603496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DisableVertexAttribArray, cmd_size);
603596c5ddc4Srjs   cmd->index = index;
603696c5ddc4Srjs   if (COMPAT) _mesa_glthread_ClientState(ctx, NULL, VERT_ATTRIB_GENERIC(index), false);
603796c5ddc4Srjs}
603896c5ddc4Srjs
603996c5ddc4Srjs
604096c5ddc4Srjs/* EnableVertexAttribArray: marshalled asynchronously */
604196c5ddc4Srjsstruct marshal_cmd_EnableVertexAttribArray
604296c5ddc4Srjs{
604396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
604496c5ddc4Srjs   GLuint index;
604596c5ddc4Srjs};
604696c5ddc4Srjsuint32_t
604796c5ddc4Srjs_mesa_unmarshal_EnableVertexAttribArray(struct gl_context *ctx, const struct marshal_cmd_EnableVertexAttribArray *cmd, const uint64_t *last)
604896c5ddc4Srjs{
604996c5ddc4Srjs   GLuint index = cmd->index;
605096c5ddc4Srjs   CALL_EnableVertexAttribArray(ctx->CurrentServerDispatch, (index));
605196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_EnableVertexAttribArray), 8) / 8);
605296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
605396c5ddc4Srjs   return cmd_size;
605496c5ddc4Srjs}
605596c5ddc4Srjsvoid GLAPIENTRY
605696c5ddc4Srjs_mesa_marshal_EnableVertexAttribArray(GLuint index)
605796c5ddc4Srjs{
605896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
605996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_EnableVertexAttribArray);
606096c5ddc4Srjs   struct marshal_cmd_EnableVertexAttribArray *cmd;
606196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EnableVertexAttribArray, cmd_size);
606296c5ddc4Srjs   cmd->index = index;
606396c5ddc4Srjs   if (COMPAT) _mesa_glthread_ClientState(ctx, NULL, VERT_ATTRIB_GENERIC(index), true);
606496c5ddc4Srjs}
606596c5ddc4Srjs
606696c5ddc4Srjs
606796c5ddc4Srjs/* GetActiveAttrib: marshalled synchronously */
606896c5ddc4Srjsvoid GLAPIENTRY
606996c5ddc4Srjs_mesa_marshal_GetActiveAttrib(GLuint program, GLuint index, GLsizei  bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name)
607096c5ddc4Srjs{
607196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
607296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetActiveAttrib");
607396c5ddc4Srjs   CALL_GetActiveAttrib(ctx->CurrentServerDispatch, (program, index, bufSize, length, size, type, name));
607496c5ddc4Srjs}
607596c5ddc4Srjs
607696c5ddc4Srjs
607796c5ddc4Srjs/* GetAttachedShaders: marshalled synchronously */
607896c5ddc4Srjsvoid GLAPIENTRY
607996c5ddc4Srjs_mesa_marshal_GetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj)
608096c5ddc4Srjs{
608196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
608296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetAttachedShaders");
608396c5ddc4Srjs   CALL_GetAttachedShaders(ctx->CurrentServerDispatch, (program, maxCount, count, obj));
608496c5ddc4Srjs}
608596c5ddc4Srjs
608696c5ddc4Srjs
608796c5ddc4Srjs/* GetAttribLocation: marshalled synchronously */
608896c5ddc4SrjsGLint GLAPIENTRY
608996c5ddc4Srjs_mesa_marshal_GetAttribLocation(GLuint program, const GLchar * name)
609096c5ddc4Srjs{
609196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
609296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetAttribLocation");
609396c5ddc4Srjs   return CALL_GetAttribLocation(ctx->CurrentServerDispatch, (program, name));
609496c5ddc4Srjs}
609596c5ddc4Srjs
609696c5ddc4Srjs
609796c5ddc4Srjs/* GetProgramiv: marshalled synchronously */
609896c5ddc4Srjsvoid GLAPIENTRY
609996c5ddc4Srjs_mesa_marshal_GetProgramiv(GLuint program, GLenum pname, GLint * params)
610096c5ddc4Srjs{
610196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
610296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramiv");
610396c5ddc4Srjs   CALL_GetProgramiv(ctx->CurrentServerDispatch, (program, pname, params));
610496c5ddc4Srjs}
610596c5ddc4Srjs
610696c5ddc4Srjs
610796c5ddc4Srjs/* GetProgramInfoLog: marshalled synchronously */
610896c5ddc4Srjsvoid GLAPIENTRY
610996c5ddc4Srjs_mesa_marshal_GetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog)
611096c5ddc4Srjs{
611196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
611296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramInfoLog");
611396c5ddc4Srjs   CALL_GetProgramInfoLog(ctx->CurrentServerDispatch, (program, bufSize, length, infoLog));
611496c5ddc4Srjs}
611596c5ddc4Srjs
611696c5ddc4Srjs
611796c5ddc4Srjs/* GetShaderiv: marshalled synchronously */
611896c5ddc4Srjsvoid GLAPIENTRY
611996c5ddc4Srjs_mesa_marshal_GetShaderiv(GLuint shader, GLenum pname, GLint * params)
612096c5ddc4Srjs{
612196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
612296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetShaderiv");
612396c5ddc4Srjs   CALL_GetShaderiv(ctx->CurrentServerDispatch, (shader, pname, params));
612496c5ddc4Srjs}
612596c5ddc4Srjs
612696c5ddc4Srjs
612796c5ddc4Srjs/* GetShaderInfoLog: marshalled synchronously */
612896c5ddc4Srjsvoid GLAPIENTRY
612996c5ddc4Srjs_mesa_marshal_GetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog)
613096c5ddc4Srjs{
613196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
613296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetShaderInfoLog");
613396c5ddc4Srjs   CALL_GetShaderInfoLog(ctx->CurrentServerDispatch, (shader, bufSize, length, infoLog));
613496c5ddc4Srjs}
613596c5ddc4Srjs
613696c5ddc4Srjs
613796c5ddc4Srjs/* GetShaderSource: marshalled synchronously */
613896c5ddc4Srjsvoid GLAPIENTRY
613996c5ddc4Srjs_mesa_marshal_GetShaderSource(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source)
614096c5ddc4Srjs{
614196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
614296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetShaderSource");
614396c5ddc4Srjs   CALL_GetShaderSource(ctx->CurrentServerDispatch, (shader, bufSize, length, source));
614496c5ddc4Srjs}
614596c5ddc4Srjs
614696c5ddc4Srjs
614796c5ddc4Srjs/* GetUniformfv: marshalled synchronously */
614896c5ddc4Srjsvoid GLAPIENTRY
614996c5ddc4Srjs_mesa_marshal_GetUniformfv(GLuint program, GLint location, GLfloat * params)
615096c5ddc4Srjs{
615196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
615296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetUniformfv");
615396c5ddc4Srjs   CALL_GetUniformfv(ctx->CurrentServerDispatch, (program, location, params));
615496c5ddc4Srjs}
615596c5ddc4Srjs
615696c5ddc4Srjs
615796c5ddc4Srjs/* GetUniformiv: marshalled synchronously */
615896c5ddc4Srjsvoid GLAPIENTRY
615996c5ddc4Srjs_mesa_marshal_GetUniformiv(GLuint program, GLint location, GLint * params)
616096c5ddc4Srjs{
616196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
616296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetUniformiv");
616396c5ddc4Srjs   CALL_GetUniformiv(ctx->CurrentServerDispatch, (program, location, params));
616496c5ddc4Srjs}
616596c5ddc4Srjs
616696c5ddc4Srjs
616796c5ddc4Srjs/* GetVertexAttribdv: marshalled synchronously */
616896c5ddc4Srjsvoid GLAPIENTRY
616996c5ddc4Srjs_mesa_marshal_GetVertexAttribdv(GLuint index, GLenum pname, GLdouble * params)
617096c5ddc4Srjs{
617196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
617296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetVertexAttribdv");
617396c5ddc4Srjs   CALL_GetVertexAttribdv(ctx->CurrentServerDispatch, (index, pname, params));
617496c5ddc4Srjs}
617596c5ddc4Srjs
617696c5ddc4Srjs
617796c5ddc4Srjs/* GetVertexAttribfv: marshalled synchronously */
617896c5ddc4Srjsvoid GLAPIENTRY
617996c5ddc4Srjs_mesa_marshal_GetVertexAttribfv(GLuint index, GLenum pname, GLfloat * params)
618096c5ddc4Srjs{
618196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
618296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetVertexAttribfv");
618396c5ddc4Srjs   CALL_GetVertexAttribfv(ctx->CurrentServerDispatch, (index, pname, params));
618496c5ddc4Srjs}
618596c5ddc4Srjs
618696c5ddc4Srjs
618796c5ddc4Srjs/* GetVertexAttribiv: marshalled synchronously */
618896c5ddc4Srjsvoid GLAPIENTRY
618996c5ddc4Srjs_mesa_marshal_GetVertexAttribiv(GLuint index, GLenum pname, GLint * params)
619096c5ddc4Srjs{
619196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
619296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetVertexAttribiv");
619396c5ddc4Srjs   CALL_GetVertexAttribiv(ctx->CurrentServerDispatch, (index, pname, params));
619496c5ddc4Srjs}
619596c5ddc4Srjs
619696c5ddc4Srjs
619796c5ddc4Srjs/* GetVertexAttribPointerv: marshalled synchronously */
619896c5ddc4Srjsvoid GLAPIENTRY
619996c5ddc4Srjs_mesa_marshal_GetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid ** pointer)
620096c5ddc4Srjs{
620196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
620296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetVertexAttribPointerv");
620396c5ddc4Srjs   CALL_GetVertexAttribPointerv(ctx->CurrentServerDispatch, (index, pname, pointer));
620496c5ddc4Srjs}
620596c5ddc4Srjs
620696c5ddc4Srjs
620796c5ddc4Srjs/* IsProgram: marshalled synchronously */
620896c5ddc4SrjsGLboolean GLAPIENTRY
620996c5ddc4Srjs_mesa_marshal_IsProgram(GLuint program)
621096c5ddc4Srjs{
621196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
621296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsProgram");
621396c5ddc4Srjs   return CALL_IsProgram(ctx->CurrentServerDispatch, (program));
621496c5ddc4Srjs}
621596c5ddc4Srjs
621696c5ddc4Srjs
621796c5ddc4Srjs/* IsShader: marshalled synchronously */
621896c5ddc4SrjsGLboolean GLAPIENTRY
621996c5ddc4Srjs_mesa_marshal_IsShader(GLuint shader)
622096c5ddc4Srjs{
622196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
622296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsShader");
622396c5ddc4Srjs   return CALL_IsShader(ctx->CurrentServerDispatch, (shader));
622496c5ddc4Srjs}
622596c5ddc4Srjs
622696c5ddc4Srjs
622796c5ddc4Srjs/* LinkProgram: marshalled asynchronously */
622896c5ddc4Srjsstruct marshal_cmd_LinkProgram
622996c5ddc4Srjs{
623096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
623196c5ddc4Srjs   GLuint program;
623296c5ddc4Srjs};
623396c5ddc4Srjsuint32_t
623496c5ddc4Srjs_mesa_unmarshal_LinkProgram(struct gl_context *ctx, const struct marshal_cmd_LinkProgram *cmd, const uint64_t *last)
623596c5ddc4Srjs{
623696c5ddc4Srjs   GLuint program = cmd->program;
623796c5ddc4Srjs   CALL_LinkProgram(ctx->CurrentServerDispatch, (program));
623896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_LinkProgram), 8) / 8);
623996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
624096c5ddc4Srjs   return cmd_size;
624196c5ddc4Srjs}
624296c5ddc4Srjsvoid GLAPIENTRY
624396c5ddc4Srjs_mesa_marshal_LinkProgram(GLuint program)
624496c5ddc4Srjs{
624596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
624696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_LinkProgram);
624796c5ddc4Srjs   struct marshal_cmd_LinkProgram *cmd;
624896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LinkProgram, cmd_size);
624996c5ddc4Srjs   cmd->program = program;
625096c5ddc4Srjs   _mesa_glthread_ProgramChanged(ctx);
625196c5ddc4Srjs}
625296c5ddc4Srjs
625396c5ddc4Srjs
625496c5ddc4Srjs/* UseProgram: marshalled asynchronously */
625596c5ddc4Srjsstruct marshal_cmd_UseProgram
625696c5ddc4Srjs{
625796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
625896c5ddc4Srjs   GLuint program;
625996c5ddc4Srjs};
626096c5ddc4Srjsuint32_t
626196c5ddc4Srjs_mesa_unmarshal_UseProgram(struct gl_context *ctx, const struct marshal_cmd_UseProgram *cmd, const uint64_t *last)
626296c5ddc4Srjs{
626396c5ddc4Srjs   GLuint program = cmd->program;
626496c5ddc4Srjs   CALL_UseProgram(ctx->CurrentServerDispatch, (program));
626596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_UseProgram), 8) / 8);
626696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
626796c5ddc4Srjs   return cmd_size;
626896c5ddc4Srjs}
626996c5ddc4Srjsvoid GLAPIENTRY
627096c5ddc4Srjs_mesa_marshal_UseProgram(GLuint program)
627196c5ddc4Srjs{
627296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
627396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UseProgram);
627496c5ddc4Srjs   struct marshal_cmd_UseProgram *cmd;
627596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UseProgram, cmd_size);
627696c5ddc4Srjs   cmd->program = program;
627796c5ddc4Srjs}
627896c5ddc4Srjs
627996c5ddc4Srjs
628096c5ddc4Srjs/* Uniform1f: marshalled asynchronously */
628196c5ddc4Srjsstruct marshal_cmd_Uniform1f
628296c5ddc4Srjs{
628396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
628496c5ddc4Srjs   GLint location;
628596c5ddc4Srjs   GLfloat v0;
628696c5ddc4Srjs};
628796c5ddc4Srjsuint32_t
628896c5ddc4Srjs_mesa_unmarshal_Uniform1f(struct gl_context *ctx, const struct marshal_cmd_Uniform1f *cmd, const uint64_t *last)
628996c5ddc4Srjs{
629096c5ddc4Srjs   GLint location = cmd->location;
629196c5ddc4Srjs   GLfloat v0 = cmd->v0;
629296c5ddc4Srjs   CALL_Uniform1f(ctx->CurrentServerDispatch, (location, v0));
629396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform1f), 8) / 8);
629496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
629596c5ddc4Srjs   return cmd_size;
629696c5ddc4Srjs}
629796c5ddc4Srjsvoid GLAPIENTRY
629896c5ddc4Srjs_mesa_marshal_Uniform1f(GLint location, GLfloat v0)
629996c5ddc4Srjs{
630096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
630196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform1f);
630296c5ddc4Srjs   struct marshal_cmd_Uniform1f *cmd;
630396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1f, cmd_size);
630496c5ddc4Srjs   cmd->location = location;
630596c5ddc4Srjs   cmd->v0 = v0;
630696c5ddc4Srjs}
630796c5ddc4Srjs
630896c5ddc4Srjs
630996c5ddc4Srjs/* Uniform2f: marshalled asynchronously */
631096c5ddc4Srjsstruct marshal_cmd_Uniform2f
631196c5ddc4Srjs{
631296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
631396c5ddc4Srjs   GLint location;
631496c5ddc4Srjs   GLfloat v0;
631596c5ddc4Srjs   GLfloat v1;
631696c5ddc4Srjs};
631796c5ddc4Srjsuint32_t
631896c5ddc4Srjs_mesa_unmarshal_Uniform2f(struct gl_context *ctx, const struct marshal_cmd_Uniform2f *cmd, const uint64_t *last)
631996c5ddc4Srjs{
632096c5ddc4Srjs   GLint location = cmd->location;
632196c5ddc4Srjs   GLfloat v0 = cmd->v0;
632296c5ddc4Srjs   GLfloat v1 = cmd->v1;
632396c5ddc4Srjs   CALL_Uniform2f(ctx->CurrentServerDispatch, (location, v0, v1));
632496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform2f), 8) / 8);
632596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
632696c5ddc4Srjs   return cmd_size;
632796c5ddc4Srjs}
632896c5ddc4Srjsvoid GLAPIENTRY
632996c5ddc4Srjs_mesa_marshal_Uniform2f(GLint location, GLfloat v0, GLfloat v1)
633096c5ddc4Srjs{
633196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
633296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform2f);
633396c5ddc4Srjs   struct marshal_cmd_Uniform2f *cmd;
633496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2f, cmd_size);
633596c5ddc4Srjs   cmd->location = location;
633696c5ddc4Srjs   cmd->v0 = v0;
633796c5ddc4Srjs   cmd->v1 = v1;
633896c5ddc4Srjs}
633996c5ddc4Srjs
634096c5ddc4Srjs
634196c5ddc4Srjs/* Uniform3f: marshalled asynchronously */
634296c5ddc4Srjsstruct marshal_cmd_Uniform3f
634396c5ddc4Srjs{
634496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
634596c5ddc4Srjs   GLint location;
634696c5ddc4Srjs   GLfloat v0;
634796c5ddc4Srjs   GLfloat v1;
634896c5ddc4Srjs   GLfloat v2;
634996c5ddc4Srjs};
635096c5ddc4Srjsuint32_t
635196c5ddc4Srjs_mesa_unmarshal_Uniform3f(struct gl_context *ctx, const struct marshal_cmd_Uniform3f *cmd, const uint64_t *last)
635296c5ddc4Srjs{
635396c5ddc4Srjs   GLint location = cmd->location;
635496c5ddc4Srjs   GLfloat v0 = cmd->v0;
635596c5ddc4Srjs   GLfloat v1 = cmd->v1;
635696c5ddc4Srjs   GLfloat v2 = cmd->v2;
635796c5ddc4Srjs   CALL_Uniform3f(ctx->CurrentServerDispatch, (location, v0, v1, v2));
635896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform3f), 8) / 8);
635996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
636096c5ddc4Srjs   return cmd_size;
636196c5ddc4Srjs}
636296c5ddc4Srjsvoid GLAPIENTRY
636396c5ddc4Srjs_mesa_marshal_Uniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
636496c5ddc4Srjs{
636596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
636696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform3f);
636796c5ddc4Srjs   struct marshal_cmd_Uniform3f *cmd;
636896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3f, cmd_size);
636996c5ddc4Srjs   cmd->location = location;
637096c5ddc4Srjs   cmd->v0 = v0;
637196c5ddc4Srjs   cmd->v1 = v1;
637296c5ddc4Srjs   cmd->v2 = v2;
637396c5ddc4Srjs}
637496c5ddc4Srjs
637596c5ddc4Srjs
637696c5ddc4Srjs/* Uniform4f: marshalled asynchronously */
637796c5ddc4Srjsstruct marshal_cmd_Uniform4f
637896c5ddc4Srjs{
637996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
638096c5ddc4Srjs   GLint location;
638196c5ddc4Srjs   GLfloat v0;
638296c5ddc4Srjs   GLfloat v1;
638396c5ddc4Srjs   GLfloat v2;
638496c5ddc4Srjs   GLfloat v3;
638596c5ddc4Srjs};
638696c5ddc4Srjsuint32_t
638796c5ddc4Srjs_mesa_unmarshal_Uniform4f(struct gl_context *ctx, const struct marshal_cmd_Uniform4f *cmd, const uint64_t *last)
638896c5ddc4Srjs{
638996c5ddc4Srjs   GLint location = cmd->location;
639096c5ddc4Srjs   GLfloat v0 = cmd->v0;
639196c5ddc4Srjs   GLfloat v1 = cmd->v1;
639296c5ddc4Srjs   GLfloat v2 = cmd->v2;
639396c5ddc4Srjs   GLfloat v3 = cmd->v3;
639496c5ddc4Srjs   CALL_Uniform4f(ctx->CurrentServerDispatch, (location, v0, v1, v2, v3));
639596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform4f), 8) / 8);
639696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
639796c5ddc4Srjs   return cmd_size;
639896c5ddc4Srjs}
639996c5ddc4Srjsvoid GLAPIENTRY
640096c5ddc4Srjs_mesa_marshal_Uniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
640196c5ddc4Srjs{
640296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
640396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform4f);
640496c5ddc4Srjs   struct marshal_cmd_Uniform4f *cmd;
640596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4f, cmd_size);
640696c5ddc4Srjs   cmd->location = location;
640796c5ddc4Srjs   cmd->v0 = v0;
640896c5ddc4Srjs   cmd->v1 = v1;
640996c5ddc4Srjs   cmd->v2 = v2;
641096c5ddc4Srjs   cmd->v3 = v3;
641196c5ddc4Srjs}
641296c5ddc4Srjs
641396c5ddc4Srjs
641496c5ddc4Srjs/* Uniform1i: marshalled asynchronously */
641596c5ddc4Srjsstruct marshal_cmd_Uniform1i
641696c5ddc4Srjs{
641796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
641896c5ddc4Srjs   GLint location;
641996c5ddc4Srjs   GLint v0;
642096c5ddc4Srjs};
642196c5ddc4Srjsuint32_t
642296c5ddc4Srjs_mesa_unmarshal_Uniform1i(struct gl_context *ctx, const struct marshal_cmd_Uniform1i *cmd, const uint64_t *last)
642396c5ddc4Srjs{
642496c5ddc4Srjs   GLint location = cmd->location;
642596c5ddc4Srjs   GLint v0 = cmd->v0;
642696c5ddc4Srjs   CALL_Uniform1i(ctx->CurrentServerDispatch, (location, v0));
642796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform1i), 8) / 8);
642896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
642996c5ddc4Srjs   return cmd_size;
643096c5ddc4Srjs}
643196c5ddc4Srjsvoid GLAPIENTRY
643296c5ddc4Srjs_mesa_marshal_Uniform1i(GLint location, GLint v0)
643396c5ddc4Srjs{
643496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
643596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform1i);
643696c5ddc4Srjs   struct marshal_cmd_Uniform1i *cmd;
643796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1i, cmd_size);
643896c5ddc4Srjs   cmd->location = location;
643996c5ddc4Srjs   cmd->v0 = v0;
644096c5ddc4Srjs}
644196c5ddc4Srjs
644296c5ddc4Srjs
644396c5ddc4Srjs/* Uniform2i: marshalled asynchronously */
644496c5ddc4Srjsstruct marshal_cmd_Uniform2i
644596c5ddc4Srjs{
644696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
644796c5ddc4Srjs   GLint location;
644896c5ddc4Srjs   GLint v0;
644996c5ddc4Srjs   GLint v1;
645096c5ddc4Srjs};
645196c5ddc4Srjsuint32_t
645296c5ddc4Srjs_mesa_unmarshal_Uniform2i(struct gl_context *ctx, const struct marshal_cmd_Uniform2i *cmd, const uint64_t *last)
645396c5ddc4Srjs{
645496c5ddc4Srjs   GLint location = cmd->location;
645596c5ddc4Srjs   GLint v0 = cmd->v0;
645696c5ddc4Srjs   GLint v1 = cmd->v1;
645796c5ddc4Srjs   CALL_Uniform2i(ctx->CurrentServerDispatch, (location, v0, v1));
645896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform2i), 8) / 8);
645996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
646096c5ddc4Srjs   return cmd_size;
646196c5ddc4Srjs}
646296c5ddc4Srjsvoid GLAPIENTRY
646396c5ddc4Srjs_mesa_marshal_Uniform2i(GLint location, GLint v0, GLint v1)
646496c5ddc4Srjs{
646596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
646696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform2i);
646796c5ddc4Srjs   struct marshal_cmd_Uniform2i *cmd;
646896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2i, cmd_size);
646996c5ddc4Srjs   cmd->location = location;
647096c5ddc4Srjs   cmd->v0 = v0;
647196c5ddc4Srjs   cmd->v1 = v1;
647296c5ddc4Srjs}
647396c5ddc4Srjs
647496c5ddc4Srjs
647596c5ddc4Srjs/* Uniform3i: marshalled asynchronously */
647696c5ddc4Srjsstruct marshal_cmd_Uniform3i
647796c5ddc4Srjs{
647896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
647996c5ddc4Srjs   GLint location;
648096c5ddc4Srjs   GLint v0;
648196c5ddc4Srjs   GLint v1;
648296c5ddc4Srjs   GLint v2;
648396c5ddc4Srjs};
648496c5ddc4Srjsuint32_t
648596c5ddc4Srjs_mesa_unmarshal_Uniform3i(struct gl_context *ctx, const struct marshal_cmd_Uniform3i *cmd, const uint64_t *last)
648696c5ddc4Srjs{
648796c5ddc4Srjs   GLint location = cmd->location;
648896c5ddc4Srjs   GLint v0 = cmd->v0;
648996c5ddc4Srjs   GLint v1 = cmd->v1;
649096c5ddc4Srjs   GLint v2 = cmd->v2;
649196c5ddc4Srjs   CALL_Uniform3i(ctx->CurrentServerDispatch, (location, v0, v1, v2));
649296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform3i), 8) / 8);
649396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
649496c5ddc4Srjs   return cmd_size;
649596c5ddc4Srjs}
649696c5ddc4Srjsvoid GLAPIENTRY
649796c5ddc4Srjs_mesa_marshal_Uniform3i(GLint location, GLint v0, GLint v1, GLint v2)
649896c5ddc4Srjs{
649996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
650096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform3i);
650196c5ddc4Srjs   struct marshal_cmd_Uniform3i *cmd;
650296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3i, cmd_size);
650396c5ddc4Srjs   cmd->location = location;
650496c5ddc4Srjs   cmd->v0 = v0;
650596c5ddc4Srjs   cmd->v1 = v1;
650696c5ddc4Srjs   cmd->v2 = v2;
650796c5ddc4Srjs}
650896c5ddc4Srjs
650996c5ddc4Srjs
651096c5ddc4Srjs/* Uniform4i: marshalled asynchronously */
651196c5ddc4Srjsstruct marshal_cmd_Uniform4i
651296c5ddc4Srjs{
651396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
651496c5ddc4Srjs   GLint location;
651596c5ddc4Srjs   GLint v0;
651696c5ddc4Srjs   GLint v1;
651796c5ddc4Srjs   GLint v2;
651896c5ddc4Srjs   GLint v3;
651996c5ddc4Srjs};
652096c5ddc4Srjsuint32_t
652196c5ddc4Srjs_mesa_unmarshal_Uniform4i(struct gl_context *ctx, const struct marshal_cmd_Uniform4i *cmd, const uint64_t *last)
652296c5ddc4Srjs{
652396c5ddc4Srjs   GLint location = cmd->location;
652496c5ddc4Srjs   GLint v0 = cmd->v0;
652596c5ddc4Srjs   GLint v1 = cmd->v1;
652696c5ddc4Srjs   GLint v2 = cmd->v2;
652796c5ddc4Srjs   GLint v3 = cmd->v3;
652896c5ddc4Srjs   CALL_Uniform4i(ctx->CurrentServerDispatch, (location, v0, v1, v2, v3));
652996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform4i), 8) / 8);
653096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
653196c5ddc4Srjs   return cmd_size;
653296c5ddc4Srjs}
653396c5ddc4Srjsvoid GLAPIENTRY
653496c5ddc4Srjs_mesa_marshal_Uniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
653596c5ddc4Srjs{
653696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
653796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform4i);
653896c5ddc4Srjs   struct marshal_cmd_Uniform4i *cmd;
653996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4i, cmd_size);
654096c5ddc4Srjs   cmd->location = location;
654196c5ddc4Srjs   cmd->v0 = v0;
654296c5ddc4Srjs   cmd->v1 = v1;
654396c5ddc4Srjs   cmd->v2 = v2;
654496c5ddc4Srjs   cmd->v3 = v3;
654596c5ddc4Srjs}
654696c5ddc4Srjs
654796c5ddc4Srjs
654896c5ddc4Srjs/* Uniform1fv: marshalled asynchronously */
654996c5ddc4Srjsstruct marshal_cmd_Uniform1fv
655096c5ddc4Srjs{
655196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
655296c5ddc4Srjs   GLint location;
655396c5ddc4Srjs   GLsizei count;
655496c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLfloat)) bytes are GLfloat value[count] */
655596c5ddc4Srjs};
655696c5ddc4Srjsuint32_t
655796c5ddc4Srjs_mesa_unmarshal_Uniform1fv(struct gl_context *ctx, const struct marshal_cmd_Uniform1fv *cmd, const uint64_t *last)
655896c5ddc4Srjs{
655996c5ddc4Srjs   GLint location = cmd->location;
656096c5ddc4Srjs   GLsizei count = cmd->count;
656196c5ddc4Srjs   GLfloat * value;
656296c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
656396c5ddc4Srjs   value = (GLfloat *) variable_data;
656496c5ddc4Srjs   CALL_Uniform1fv(ctx->CurrentServerDispatch, (location, count, value));
656596c5ddc4Srjs   return cmd->cmd_base.cmd_size;
656696c5ddc4Srjs}
656796c5ddc4Srjsvoid GLAPIENTRY
656896c5ddc4Srjs_mesa_marshal_Uniform1fv(GLint location, GLsizei count, const GLfloat * value)
656996c5ddc4Srjs{
657096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
657196c5ddc4Srjs   int value_size = safe_mul(count, 1 * sizeof(GLfloat));
657296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform1fv) + value_size;
657396c5ddc4Srjs   struct marshal_cmd_Uniform1fv *cmd;
657496c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
657596c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "Uniform1fv");
657696c5ddc4Srjs      CALL_Uniform1fv(ctx->CurrentServerDispatch, (location, count, value));
657796c5ddc4Srjs      return;
657896c5ddc4Srjs   }
657996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1fv, cmd_size);
658096c5ddc4Srjs   cmd->location = location;
658196c5ddc4Srjs   cmd->count = count;
658296c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
658396c5ddc4Srjs   memcpy(variable_data, value, value_size);
658496c5ddc4Srjs}
658596c5ddc4Srjs
658696c5ddc4Srjs
658796c5ddc4Srjs/* Uniform2fv: marshalled asynchronously */
658896c5ddc4Srjsstruct marshal_cmd_Uniform2fv
658996c5ddc4Srjs{
659096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
659196c5ddc4Srjs   GLint location;
659296c5ddc4Srjs   GLsizei count;
659396c5ddc4Srjs   /* Next safe_mul(count, 2 * sizeof(GLfloat)) bytes are GLfloat value[count][2] */
659496c5ddc4Srjs};
659596c5ddc4Srjsuint32_t
659696c5ddc4Srjs_mesa_unmarshal_Uniform2fv(struct gl_context *ctx, const struct marshal_cmd_Uniform2fv *cmd, const uint64_t *last)
659796c5ddc4Srjs{
659896c5ddc4Srjs   GLint location = cmd->location;
659996c5ddc4Srjs   GLsizei count = cmd->count;
660096c5ddc4Srjs   GLfloat * value;
660196c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
660296c5ddc4Srjs   value = (GLfloat *) variable_data;
660396c5ddc4Srjs   CALL_Uniform2fv(ctx->CurrentServerDispatch, (location, count, value));
660496c5ddc4Srjs   return cmd->cmd_base.cmd_size;
660596c5ddc4Srjs}
660696c5ddc4Srjsvoid GLAPIENTRY
660796c5ddc4Srjs_mesa_marshal_Uniform2fv(GLint location, GLsizei count, const GLfloat * value)
660896c5ddc4Srjs{
660996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
661096c5ddc4Srjs   int value_size = safe_mul(count, 2 * sizeof(GLfloat));
661196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform2fv) + value_size;
661296c5ddc4Srjs   struct marshal_cmd_Uniform2fv *cmd;
661396c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
661496c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "Uniform2fv");
661596c5ddc4Srjs      CALL_Uniform2fv(ctx->CurrentServerDispatch, (location, count, value));
661696c5ddc4Srjs      return;
661796c5ddc4Srjs   }
661896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2fv, cmd_size);
661996c5ddc4Srjs   cmd->location = location;
662096c5ddc4Srjs   cmd->count = count;
662196c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
662296c5ddc4Srjs   memcpy(variable_data, value, value_size);
662396c5ddc4Srjs}
662496c5ddc4Srjs
662596c5ddc4Srjs
662696c5ddc4Srjs/* Uniform3fv: marshalled asynchronously */
662796c5ddc4Srjsstruct marshal_cmd_Uniform3fv
662896c5ddc4Srjs{
662996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
663096c5ddc4Srjs   GLint location;
663196c5ddc4Srjs   GLsizei count;
663296c5ddc4Srjs   /* Next safe_mul(count, 3 * sizeof(GLfloat)) bytes are GLfloat value[count][3] */
663396c5ddc4Srjs};
663496c5ddc4Srjsuint32_t
663596c5ddc4Srjs_mesa_unmarshal_Uniform3fv(struct gl_context *ctx, const struct marshal_cmd_Uniform3fv *cmd, const uint64_t *last)
663696c5ddc4Srjs{
663796c5ddc4Srjs   GLint location = cmd->location;
663896c5ddc4Srjs   GLsizei count = cmd->count;
663996c5ddc4Srjs   GLfloat * value;
664096c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
664196c5ddc4Srjs   value = (GLfloat *) variable_data;
664296c5ddc4Srjs   CALL_Uniform3fv(ctx->CurrentServerDispatch, (location, count, value));
664396c5ddc4Srjs   return cmd->cmd_base.cmd_size;
664496c5ddc4Srjs}
664596c5ddc4Srjsvoid GLAPIENTRY
664696c5ddc4Srjs_mesa_marshal_Uniform3fv(GLint location, GLsizei count, const GLfloat * value)
664796c5ddc4Srjs{
664896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
664996c5ddc4Srjs   int value_size = safe_mul(count, 3 * sizeof(GLfloat));
665096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform3fv) + value_size;
665196c5ddc4Srjs   struct marshal_cmd_Uniform3fv *cmd;
665296c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
665396c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "Uniform3fv");
665496c5ddc4Srjs      CALL_Uniform3fv(ctx->CurrentServerDispatch, (location, count, value));
665596c5ddc4Srjs      return;
665696c5ddc4Srjs   }
665796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3fv, cmd_size);
665896c5ddc4Srjs   cmd->location = location;
665996c5ddc4Srjs   cmd->count = count;
666096c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
666196c5ddc4Srjs   memcpy(variable_data, value, value_size);
666296c5ddc4Srjs}
666396c5ddc4Srjs
666496c5ddc4Srjs
666596c5ddc4Srjs/* Uniform4fv: marshalled asynchronously */
666696c5ddc4Srjsstruct marshal_cmd_Uniform4fv
666796c5ddc4Srjs{
666896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
666996c5ddc4Srjs   GLint location;
667096c5ddc4Srjs   GLsizei count;
667196c5ddc4Srjs   /* Next safe_mul(count, 4 * sizeof(GLfloat)) bytes are GLfloat value[count][4] */
667296c5ddc4Srjs};
667396c5ddc4Srjsuint32_t
667496c5ddc4Srjs_mesa_unmarshal_Uniform4fv(struct gl_context *ctx, const struct marshal_cmd_Uniform4fv *cmd, const uint64_t *last)
667596c5ddc4Srjs{
667696c5ddc4Srjs   GLint location = cmd->location;
667796c5ddc4Srjs   GLsizei count = cmd->count;
667896c5ddc4Srjs   GLfloat * value;
667996c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
668096c5ddc4Srjs   value = (GLfloat *) variable_data;
668196c5ddc4Srjs   CALL_Uniform4fv(ctx->CurrentServerDispatch, (location, count, value));
668296c5ddc4Srjs   return cmd->cmd_base.cmd_size;
668396c5ddc4Srjs}
668496c5ddc4Srjsvoid GLAPIENTRY
668596c5ddc4Srjs_mesa_marshal_Uniform4fv(GLint location, GLsizei count, const GLfloat * value)
668696c5ddc4Srjs{
668796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
668896c5ddc4Srjs   int value_size = safe_mul(count, 4 * sizeof(GLfloat));
668996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform4fv) + value_size;
669096c5ddc4Srjs   struct marshal_cmd_Uniform4fv *cmd;
669196c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
669296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "Uniform4fv");
669396c5ddc4Srjs      CALL_Uniform4fv(ctx->CurrentServerDispatch, (location, count, value));
669496c5ddc4Srjs      return;
669596c5ddc4Srjs   }
669696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4fv, cmd_size);
669796c5ddc4Srjs   cmd->location = location;
669896c5ddc4Srjs   cmd->count = count;
669996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
670096c5ddc4Srjs   memcpy(variable_data, value, value_size);
670196c5ddc4Srjs}
670296c5ddc4Srjs
670396c5ddc4Srjs
670496c5ddc4Srjs/* Uniform1iv: marshalled asynchronously */
670596c5ddc4Srjsstruct marshal_cmd_Uniform1iv
670696c5ddc4Srjs{
670796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
670896c5ddc4Srjs   GLint location;
670996c5ddc4Srjs   GLsizei count;
671096c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLint)) bytes are GLint value[count] */
671196c5ddc4Srjs};
671296c5ddc4Srjsuint32_t
671396c5ddc4Srjs_mesa_unmarshal_Uniform1iv(struct gl_context *ctx, const struct marshal_cmd_Uniform1iv *cmd, const uint64_t *last)
671496c5ddc4Srjs{
671596c5ddc4Srjs   GLint location = cmd->location;
671696c5ddc4Srjs   GLsizei count = cmd->count;
671796c5ddc4Srjs   GLint * value;
671896c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
671996c5ddc4Srjs   value = (GLint *) variable_data;
672096c5ddc4Srjs   CALL_Uniform1iv(ctx->CurrentServerDispatch, (location, count, value));
672196c5ddc4Srjs   return cmd->cmd_base.cmd_size;
672296c5ddc4Srjs}
672396c5ddc4Srjsvoid GLAPIENTRY
672496c5ddc4Srjs_mesa_marshal_Uniform1iv(GLint location, GLsizei count, const GLint * value)
672596c5ddc4Srjs{
672696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
672796c5ddc4Srjs   int value_size = safe_mul(count, 1 * sizeof(GLint));
672896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform1iv) + value_size;
672996c5ddc4Srjs   struct marshal_cmd_Uniform1iv *cmd;
673096c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
673196c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "Uniform1iv");
673296c5ddc4Srjs      CALL_Uniform1iv(ctx->CurrentServerDispatch, (location, count, value));
673396c5ddc4Srjs      return;
673496c5ddc4Srjs   }
673596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1iv, cmd_size);
673696c5ddc4Srjs   cmd->location = location;
673796c5ddc4Srjs   cmd->count = count;
673896c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
673996c5ddc4Srjs   memcpy(variable_data, value, value_size);
674096c5ddc4Srjs}
674196c5ddc4Srjs
674296c5ddc4Srjs
674396c5ddc4Srjs/* Uniform2iv: marshalled asynchronously */
674496c5ddc4Srjsstruct marshal_cmd_Uniform2iv
674596c5ddc4Srjs{
674696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
674796c5ddc4Srjs   GLint location;
674896c5ddc4Srjs   GLsizei count;
674996c5ddc4Srjs   /* Next safe_mul(count, 2 * sizeof(GLint)) bytes are GLint value[count][2] */
675096c5ddc4Srjs};
675196c5ddc4Srjsuint32_t
675296c5ddc4Srjs_mesa_unmarshal_Uniform2iv(struct gl_context *ctx, const struct marshal_cmd_Uniform2iv *cmd, const uint64_t *last)
675396c5ddc4Srjs{
675496c5ddc4Srjs   GLint location = cmd->location;
675596c5ddc4Srjs   GLsizei count = cmd->count;
675696c5ddc4Srjs   GLint * value;
675796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
675896c5ddc4Srjs   value = (GLint *) variable_data;
675996c5ddc4Srjs   CALL_Uniform2iv(ctx->CurrentServerDispatch, (location, count, value));
676096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
676196c5ddc4Srjs}
676296c5ddc4Srjsvoid GLAPIENTRY
676396c5ddc4Srjs_mesa_marshal_Uniform2iv(GLint location, GLsizei count, const GLint * value)
676496c5ddc4Srjs{
676596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
676696c5ddc4Srjs   int value_size = safe_mul(count, 2 * sizeof(GLint));
676796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform2iv) + value_size;
676896c5ddc4Srjs   struct marshal_cmd_Uniform2iv *cmd;
676996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
677096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "Uniform2iv");
677196c5ddc4Srjs      CALL_Uniform2iv(ctx->CurrentServerDispatch, (location, count, value));
677296c5ddc4Srjs      return;
677396c5ddc4Srjs   }
677496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2iv, cmd_size);
677596c5ddc4Srjs   cmd->location = location;
677696c5ddc4Srjs   cmd->count = count;
677796c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
677896c5ddc4Srjs   memcpy(variable_data, value, value_size);
677996c5ddc4Srjs}
678096c5ddc4Srjs
678196c5ddc4Srjs
678296c5ddc4Srjs/* Uniform3iv: marshalled asynchronously */
678396c5ddc4Srjsstruct marshal_cmd_Uniform3iv
678496c5ddc4Srjs{
678596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
678696c5ddc4Srjs   GLint location;
678796c5ddc4Srjs   GLsizei count;
678896c5ddc4Srjs   /* Next safe_mul(count, 3 * sizeof(GLint)) bytes are GLint value[count][3] */
678996c5ddc4Srjs};
679096c5ddc4Srjsuint32_t
679196c5ddc4Srjs_mesa_unmarshal_Uniform3iv(struct gl_context *ctx, const struct marshal_cmd_Uniform3iv *cmd, const uint64_t *last)
679296c5ddc4Srjs{
679396c5ddc4Srjs   GLint location = cmd->location;
679496c5ddc4Srjs   GLsizei count = cmd->count;
679596c5ddc4Srjs   GLint * value;
679696c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
679796c5ddc4Srjs   value = (GLint *) variable_data;
679896c5ddc4Srjs   CALL_Uniform3iv(ctx->CurrentServerDispatch, (location, count, value));
679996c5ddc4Srjs   return cmd->cmd_base.cmd_size;
680096c5ddc4Srjs}
680196c5ddc4Srjsvoid GLAPIENTRY
680296c5ddc4Srjs_mesa_marshal_Uniform3iv(GLint location, GLsizei count, const GLint * value)
680396c5ddc4Srjs{
680496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
680596c5ddc4Srjs   int value_size = safe_mul(count, 3 * sizeof(GLint));
680696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform3iv) + value_size;
680796c5ddc4Srjs   struct marshal_cmd_Uniform3iv *cmd;
680896c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
680996c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "Uniform3iv");
681096c5ddc4Srjs      CALL_Uniform3iv(ctx->CurrentServerDispatch, (location, count, value));
681196c5ddc4Srjs      return;
681296c5ddc4Srjs   }
681396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3iv, cmd_size);
681496c5ddc4Srjs   cmd->location = location;
681596c5ddc4Srjs   cmd->count = count;
681696c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
681796c5ddc4Srjs   memcpy(variable_data, value, value_size);
681896c5ddc4Srjs}
681996c5ddc4Srjs
682096c5ddc4Srjs
682196c5ddc4Srjs/* Uniform4iv: marshalled asynchronously */
682296c5ddc4Srjsstruct marshal_cmd_Uniform4iv
682396c5ddc4Srjs{
682496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
682596c5ddc4Srjs   GLint location;
682696c5ddc4Srjs   GLsizei count;
682796c5ddc4Srjs   /* Next safe_mul(count, 4 * sizeof(GLint)) bytes are GLint value[count][4] */
682896c5ddc4Srjs};
682996c5ddc4Srjsuint32_t
683096c5ddc4Srjs_mesa_unmarshal_Uniform4iv(struct gl_context *ctx, const struct marshal_cmd_Uniform4iv *cmd, const uint64_t *last)
683196c5ddc4Srjs{
683296c5ddc4Srjs   GLint location = cmd->location;
683396c5ddc4Srjs   GLsizei count = cmd->count;
683496c5ddc4Srjs   GLint * value;
683596c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
683696c5ddc4Srjs   value = (GLint *) variable_data;
683796c5ddc4Srjs   CALL_Uniform4iv(ctx->CurrentServerDispatch, (location, count, value));
683896c5ddc4Srjs   return cmd->cmd_base.cmd_size;
683996c5ddc4Srjs}
684096c5ddc4Srjsvoid GLAPIENTRY
684196c5ddc4Srjs_mesa_marshal_Uniform4iv(GLint location, GLsizei count, const GLint * value)
684296c5ddc4Srjs{
684396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
684496c5ddc4Srjs   int value_size = safe_mul(count, 4 * sizeof(GLint));
684596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_Uniform4iv) + value_size;
684696c5ddc4Srjs   struct marshal_cmd_Uniform4iv *cmd;
684796c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
684896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "Uniform4iv");
684996c5ddc4Srjs      CALL_Uniform4iv(ctx->CurrentServerDispatch, (location, count, value));
685096c5ddc4Srjs      return;
685196c5ddc4Srjs   }
685296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4iv, cmd_size);
685396c5ddc4Srjs   cmd->location = location;
685496c5ddc4Srjs   cmd->count = count;
685596c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
685696c5ddc4Srjs   memcpy(variable_data, value, value_size);
685796c5ddc4Srjs}
685896c5ddc4Srjs
685996c5ddc4Srjs
686096c5ddc4Srjs/* UniformMatrix2fv: marshalled asynchronously */
686196c5ddc4Srjsstruct marshal_cmd_UniformMatrix2fv
686296c5ddc4Srjs{
686396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
686496c5ddc4Srjs   GLboolean transpose;
686596c5ddc4Srjs   GLint location;
686696c5ddc4Srjs   GLsizei count;
686796c5ddc4Srjs   /* Next safe_mul(count, 4 * sizeof(GLfloat)) bytes are GLfloat value[count][4] */
686896c5ddc4Srjs};
686996c5ddc4Srjsuint32_t
687096c5ddc4Srjs_mesa_unmarshal_UniformMatrix2fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2fv *cmd, const uint64_t *last)
687196c5ddc4Srjs{
687296c5ddc4Srjs   GLint location = cmd->location;
687396c5ddc4Srjs   GLsizei count = cmd->count;
687496c5ddc4Srjs   GLboolean transpose = cmd->transpose;
687596c5ddc4Srjs   GLfloat * value;
687696c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
687796c5ddc4Srjs   value = (GLfloat *) variable_data;
687896c5ddc4Srjs   CALL_UniformMatrix2fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
687996c5ddc4Srjs   return cmd->cmd_base.cmd_size;
688096c5ddc4Srjs}
688196c5ddc4Srjsvoid GLAPIENTRY
688296c5ddc4Srjs_mesa_marshal_UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
688396c5ddc4Srjs{
688496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
688596c5ddc4Srjs   int value_size = safe_mul(count, 4 * sizeof(GLfloat));
688696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix2fv) + value_size;
688796c5ddc4Srjs   struct marshal_cmd_UniformMatrix2fv *cmd;
688896c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
688996c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix2fv");
689096c5ddc4Srjs      CALL_UniformMatrix2fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
689196c5ddc4Srjs      return;
689296c5ddc4Srjs   }
689396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2fv, cmd_size);
689496c5ddc4Srjs   cmd->location = location;
689596c5ddc4Srjs   cmd->count = count;
689696c5ddc4Srjs   cmd->transpose = transpose;
689796c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
689896c5ddc4Srjs   memcpy(variable_data, value, value_size);
689996c5ddc4Srjs}
690096c5ddc4Srjs
690196c5ddc4Srjs
690296c5ddc4Srjs/* UniformMatrix3fv: marshalled asynchronously */
690396c5ddc4Srjsstruct marshal_cmd_UniformMatrix3fv
690496c5ddc4Srjs{
690596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
690696c5ddc4Srjs   GLboolean transpose;
690796c5ddc4Srjs   GLint location;
690896c5ddc4Srjs   GLsizei count;
690996c5ddc4Srjs   /* Next safe_mul(count, 9 * sizeof(GLfloat)) bytes are GLfloat value[count][9] */
691096c5ddc4Srjs};
691196c5ddc4Srjsuint32_t
691296c5ddc4Srjs_mesa_unmarshal_UniformMatrix3fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3fv *cmd, const uint64_t *last)
691396c5ddc4Srjs{
691496c5ddc4Srjs   GLint location = cmd->location;
691596c5ddc4Srjs   GLsizei count = cmd->count;
691696c5ddc4Srjs   GLboolean transpose = cmd->transpose;
691796c5ddc4Srjs   GLfloat * value;
691896c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
691996c5ddc4Srjs   value = (GLfloat *) variable_data;
692096c5ddc4Srjs   CALL_UniformMatrix3fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
692196c5ddc4Srjs   return cmd->cmd_base.cmd_size;
692296c5ddc4Srjs}
692396c5ddc4Srjsvoid GLAPIENTRY
692496c5ddc4Srjs_mesa_marshal_UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
692596c5ddc4Srjs{
692696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
692796c5ddc4Srjs   int value_size = safe_mul(count, 9 * sizeof(GLfloat));
692896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix3fv) + value_size;
692996c5ddc4Srjs   struct marshal_cmd_UniformMatrix3fv *cmd;
693096c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
693196c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix3fv");
693296c5ddc4Srjs      CALL_UniformMatrix3fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
693396c5ddc4Srjs      return;
693496c5ddc4Srjs   }
693596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3fv, cmd_size);
693696c5ddc4Srjs   cmd->location = location;
693796c5ddc4Srjs   cmd->count = count;
693896c5ddc4Srjs   cmd->transpose = transpose;
693996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
694096c5ddc4Srjs   memcpy(variable_data, value, value_size);
694196c5ddc4Srjs}
694296c5ddc4Srjs
694396c5ddc4Srjs
694496c5ddc4Srjs/* UniformMatrix4fv: marshalled asynchronously */
694596c5ddc4Srjsstruct marshal_cmd_UniformMatrix4fv
694696c5ddc4Srjs{
694796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
694896c5ddc4Srjs   GLboolean transpose;
694996c5ddc4Srjs   GLint location;
695096c5ddc4Srjs   GLsizei count;
695196c5ddc4Srjs   /* Next safe_mul(count, 16 * sizeof(GLfloat)) bytes are GLfloat value[count][16] */
695296c5ddc4Srjs};
695396c5ddc4Srjsuint32_t
695496c5ddc4Srjs_mesa_unmarshal_UniformMatrix4fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4fv *cmd, const uint64_t *last)
695596c5ddc4Srjs{
695696c5ddc4Srjs   GLint location = cmd->location;
695796c5ddc4Srjs   GLsizei count = cmd->count;
695896c5ddc4Srjs   GLboolean transpose = cmd->transpose;
695996c5ddc4Srjs   GLfloat * value;
696096c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
696196c5ddc4Srjs   value = (GLfloat *) variable_data;
696296c5ddc4Srjs   CALL_UniformMatrix4fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
696396c5ddc4Srjs   return cmd->cmd_base.cmd_size;
696496c5ddc4Srjs}
696596c5ddc4Srjsvoid GLAPIENTRY
696696c5ddc4Srjs_mesa_marshal_UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
696796c5ddc4Srjs{
696896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
696996c5ddc4Srjs   int value_size = safe_mul(count, 16 * sizeof(GLfloat));
697096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformMatrix4fv) + value_size;
697196c5ddc4Srjs   struct marshal_cmd_UniformMatrix4fv *cmd;
697296c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
697396c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformMatrix4fv");
697496c5ddc4Srjs      CALL_UniformMatrix4fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
697596c5ddc4Srjs      return;
697696c5ddc4Srjs   }
697796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4fv, cmd_size);
697896c5ddc4Srjs   cmd->location = location;
697996c5ddc4Srjs   cmd->count = count;
698096c5ddc4Srjs   cmd->transpose = transpose;
698196c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
698296c5ddc4Srjs   memcpy(variable_data, value, value_size);
698396c5ddc4Srjs}
698496c5ddc4Srjs
698596c5ddc4Srjs
698696c5ddc4Srjs/* ValidateProgram: marshalled asynchronously */
698796c5ddc4Srjsstruct marshal_cmd_ValidateProgram
698896c5ddc4Srjs{
698996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
699096c5ddc4Srjs   GLuint program;
699196c5ddc4Srjs};
699296c5ddc4Srjsuint32_t
699396c5ddc4Srjs_mesa_unmarshal_ValidateProgram(struct gl_context *ctx, const struct marshal_cmd_ValidateProgram *cmd, const uint64_t *last)
699496c5ddc4Srjs{
699596c5ddc4Srjs   GLuint program = cmd->program;
699696c5ddc4Srjs   CALL_ValidateProgram(ctx->CurrentServerDispatch, (program));
699796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ValidateProgram), 8) / 8);
699896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
699996c5ddc4Srjs   return cmd_size;
700096c5ddc4Srjs}
700196c5ddc4Srjsvoid GLAPIENTRY
700296c5ddc4Srjs_mesa_marshal_ValidateProgram(GLuint program)
700396c5ddc4Srjs{
700496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
700596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ValidateProgram);
700696c5ddc4Srjs   struct marshal_cmd_ValidateProgram *cmd;
700796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ValidateProgram, cmd_size);
700896c5ddc4Srjs   cmd->program = program;
700996c5ddc4Srjs}
701096c5ddc4Srjs
701196c5ddc4Srjs
701296c5ddc4Srjs/* VertexAttrib1d: marshalled asynchronously */
701396c5ddc4Srjsstruct marshal_cmd_VertexAttrib1d
701496c5ddc4Srjs{
701596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
701696c5ddc4Srjs   GLuint index;
701796c5ddc4Srjs   GLdouble x;
701896c5ddc4Srjs};
701996c5ddc4Srjsuint32_t
702096c5ddc4Srjs_mesa_unmarshal_VertexAttrib1d(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1d *cmd, const uint64_t *last)
702196c5ddc4Srjs{
702296c5ddc4Srjs   GLuint index = cmd->index;
702396c5ddc4Srjs   GLdouble x = cmd->x;
702496c5ddc4Srjs   CALL_VertexAttrib1d(ctx->CurrentServerDispatch, (index, x));
702596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib1d), 8) / 8);
702696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
702796c5ddc4Srjs   return cmd_size;
702896c5ddc4Srjs}
702996c5ddc4Srjsvoid GLAPIENTRY
703096c5ddc4Srjs_mesa_marshal_VertexAttrib1d(GLuint index, GLdouble x)
703196c5ddc4Srjs{
703296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
703396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib1d);
703496c5ddc4Srjs   struct marshal_cmd_VertexAttrib1d *cmd;
703596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1d, cmd_size);
703696c5ddc4Srjs   cmd->index = index;
703796c5ddc4Srjs   cmd->x = x;
703896c5ddc4Srjs}
703996c5ddc4Srjs
704096c5ddc4Srjs
704196c5ddc4Srjs/* VertexAttrib1dv: marshalled asynchronously */
704296c5ddc4Srjsstruct marshal_cmd_VertexAttrib1dv
704396c5ddc4Srjs{
704496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
704596c5ddc4Srjs   GLuint index;
704696c5ddc4Srjs   GLdouble v[1];
704796c5ddc4Srjs};
704896c5ddc4Srjsuint32_t
704996c5ddc4Srjs_mesa_unmarshal_VertexAttrib1dv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1dv *cmd, const uint64_t *last)
705096c5ddc4Srjs{
705196c5ddc4Srjs   GLuint index = cmd->index;
705296c5ddc4Srjs   const GLdouble * v = cmd->v;
705396c5ddc4Srjs   CALL_VertexAttrib1dv(ctx->CurrentServerDispatch, (index, v));
705496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib1dv), 8) / 8);
705596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
705696c5ddc4Srjs   return cmd_size;
705796c5ddc4Srjs}
705896c5ddc4Srjsvoid GLAPIENTRY
705996c5ddc4Srjs_mesa_marshal_VertexAttrib1dv(GLuint index, const GLdouble * v)
706096c5ddc4Srjs{
706196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
706296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttrib1dv);
706396c5ddc4Srjs   struct marshal_cmd_VertexAttrib1dv *cmd;
706496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1dv, cmd_size);
706596c5ddc4Srjs   cmd->index = index;
706696c5ddc4Srjs   memcpy(cmd->v, v, 1 * sizeof(GLdouble));
706796c5ddc4Srjs}
706896c5ddc4Srjs
706996c5ddc4Srjs
7070