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/* ProgramUniform3i: marshalled asynchronously */
4596c5ddc4Srjsstruct marshal_cmd_ProgramUniform3i
4696c5ddc4Srjs{
4796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
4896c5ddc4Srjs   GLuint program;
4996c5ddc4Srjs   GLint location;
5096c5ddc4Srjs   GLint x;
5196c5ddc4Srjs   GLint y;
5296c5ddc4Srjs   GLint z;
5396c5ddc4Srjs};
5496c5ddc4Srjsuint32_t
5596c5ddc4Srjs_mesa_unmarshal_ProgramUniform3i(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3i *cmd, const uint64_t *last)
5696c5ddc4Srjs{
5796c5ddc4Srjs   GLuint program = cmd->program;
5896c5ddc4Srjs   GLint location = cmd->location;
5996c5ddc4Srjs   GLint x = cmd->x;
6096c5ddc4Srjs   GLint y = cmd->y;
6196c5ddc4Srjs   GLint z = cmd->z;
6296c5ddc4Srjs   CALL_ProgramUniform3i(ctx->CurrentServerDispatch, (program, location, x, y, z));
6396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform3i), 8) / 8);
6496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
6596c5ddc4Srjs   return cmd_size;
6696c5ddc4Srjs}
6796c5ddc4Srjsvoid GLAPIENTRY
6896c5ddc4Srjs_mesa_marshal_ProgramUniform3i(GLuint program, GLint location, GLint x, GLint y, GLint z)
6996c5ddc4Srjs{
7096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
7196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform3i);
7296c5ddc4Srjs   struct marshal_cmd_ProgramUniform3i *cmd;
7396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3i, cmd_size);
7496c5ddc4Srjs   cmd->program = program;
7596c5ddc4Srjs   cmd->location = location;
7696c5ddc4Srjs   cmd->x = x;
7796c5ddc4Srjs   cmd->y = y;
7896c5ddc4Srjs   cmd->z = z;
7996c5ddc4Srjs}
8096c5ddc4Srjs
8196c5ddc4Srjs
8296c5ddc4Srjs/* ProgramUniform4i: marshalled asynchronously */
8396c5ddc4Srjsstruct marshal_cmd_ProgramUniform4i
8496c5ddc4Srjs{
8596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
8696c5ddc4Srjs   GLuint program;
8796c5ddc4Srjs   GLint location;
8896c5ddc4Srjs   GLint x;
8996c5ddc4Srjs   GLint y;
9096c5ddc4Srjs   GLint z;
9196c5ddc4Srjs   GLint w;
9296c5ddc4Srjs};
9396c5ddc4Srjsuint32_t
9496c5ddc4Srjs_mesa_unmarshal_ProgramUniform4i(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4i *cmd, const uint64_t *last)
9596c5ddc4Srjs{
9696c5ddc4Srjs   GLuint program = cmd->program;
9796c5ddc4Srjs   GLint location = cmd->location;
9896c5ddc4Srjs   GLint x = cmd->x;
9996c5ddc4Srjs   GLint y = cmd->y;
10096c5ddc4Srjs   GLint z = cmd->z;
10196c5ddc4Srjs   GLint w = cmd->w;
10296c5ddc4Srjs   CALL_ProgramUniform4i(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
10396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform4i), 8) / 8);
10496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
10596c5ddc4Srjs   return cmd_size;
10696c5ddc4Srjs}
10796c5ddc4Srjsvoid GLAPIENTRY
10896c5ddc4Srjs_mesa_marshal_ProgramUniform4i(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w)
10996c5ddc4Srjs{
11096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
11196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform4i);
11296c5ddc4Srjs   struct marshal_cmd_ProgramUniform4i *cmd;
11396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4i, cmd_size);
11496c5ddc4Srjs   cmd->program = program;
11596c5ddc4Srjs   cmd->location = location;
11696c5ddc4Srjs   cmd->x = x;
11796c5ddc4Srjs   cmd->y = y;
11896c5ddc4Srjs   cmd->z = z;
11996c5ddc4Srjs   cmd->w = w;
12096c5ddc4Srjs}
12196c5ddc4Srjs
12296c5ddc4Srjs
12396c5ddc4Srjs/* ProgramUniform1ui: marshalled asynchronously */
12496c5ddc4Srjsstruct marshal_cmd_ProgramUniform1ui
12596c5ddc4Srjs{
12696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
12796c5ddc4Srjs   GLuint program;
12896c5ddc4Srjs   GLint location;
12996c5ddc4Srjs   GLuint x;
13096c5ddc4Srjs};
13196c5ddc4Srjsuint32_t
13296c5ddc4Srjs_mesa_unmarshal_ProgramUniform1ui(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1ui *cmd, const uint64_t *last)
13396c5ddc4Srjs{
13496c5ddc4Srjs   GLuint program = cmd->program;
13596c5ddc4Srjs   GLint location = cmd->location;
13696c5ddc4Srjs   GLuint x = cmd->x;
13796c5ddc4Srjs   CALL_ProgramUniform1ui(ctx->CurrentServerDispatch, (program, location, x));
13896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform1ui), 8) / 8);
13996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
14096c5ddc4Srjs   return cmd_size;
14196c5ddc4Srjs}
14296c5ddc4Srjsvoid GLAPIENTRY
14396c5ddc4Srjs_mesa_marshal_ProgramUniform1ui(GLuint program, GLint location, GLuint x)
14496c5ddc4Srjs{
14596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
14696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform1ui);
14796c5ddc4Srjs   struct marshal_cmd_ProgramUniform1ui *cmd;
14896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1ui, cmd_size);
14996c5ddc4Srjs   cmd->program = program;
15096c5ddc4Srjs   cmd->location = location;
15196c5ddc4Srjs   cmd->x = x;
15296c5ddc4Srjs}
15396c5ddc4Srjs
15496c5ddc4Srjs
15596c5ddc4Srjs/* ProgramUniform2ui: marshalled asynchronously */
15696c5ddc4Srjsstruct marshal_cmd_ProgramUniform2ui
15796c5ddc4Srjs{
15896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
15996c5ddc4Srjs   GLuint program;
16096c5ddc4Srjs   GLint location;
16196c5ddc4Srjs   GLuint x;
16296c5ddc4Srjs   GLuint y;
16396c5ddc4Srjs};
16496c5ddc4Srjsuint32_t
16596c5ddc4Srjs_mesa_unmarshal_ProgramUniform2ui(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2ui *cmd, const uint64_t *last)
16696c5ddc4Srjs{
16796c5ddc4Srjs   GLuint program = cmd->program;
16896c5ddc4Srjs   GLint location = cmd->location;
16996c5ddc4Srjs   GLuint x = cmd->x;
17096c5ddc4Srjs   GLuint y = cmd->y;
17196c5ddc4Srjs   CALL_ProgramUniform2ui(ctx->CurrentServerDispatch, (program, location, x, y));
17296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform2ui), 8) / 8);
17396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
17496c5ddc4Srjs   return cmd_size;
17596c5ddc4Srjs}
17696c5ddc4Srjsvoid GLAPIENTRY
17796c5ddc4Srjs_mesa_marshal_ProgramUniform2ui(GLuint program, GLint location, GLuint x, GLuint y)
17896c5ddc4Srjs{
17996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
18096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform2ui);
18196c5ddc4Srjs   struct marshal_cmd_ProgramUniform2ui *cmd;
18296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2ui, cmd_size);
18396c5ddc4Srjs   cmd->program = program;
18496c5ddc4Srjs   cmd->location = location;
18596c5ddc4Srjs   cmd->x = x;
18696c5ddc4Srjs   cmd->y = y;
18796c5ddc4Srjs}
18896c5ddc4Srjs
18996c5ddc4Srjs
19096c5ddc4Srjs/* ProgramUniform3ui: marshalled asynchronously */
19196c5ddc4Srjsstruct marshal_cmd_ProgramUniform3ui
19296c5ddc4Srjs{
19396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
19496c5ddc4Srjs   GLuint program;
19596c5ddc4Srjs   GLint location;
19696c5ddc4Srjs   GLuint x;
19796c5ddc4Srjs   GLuint y;
19896c5ddc4Srjs   GLuint z;
19996c5ddc4Srjs};
20096c5ddc4Srjsuint32_t
20196c5ddc4Srjs_mesa_unmarshal_ProgramUniform3ui(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3ui *cmd, const uint64_t *last)
20296c5ddc4Srjs{
20396c5ddc4Srjs   GLuint program = cmd->program;
20496c5ddc4Srjs   GLint location = cmd->location;
20596c5ddc4Srjs   GLuint x = cmd->x;
20696c5ddc4Srjs   GLuint y = cmd->y;
20796c5ddc4Srjs   GLuint z = cmd->z;
20896c5ddc4Srjs   CALL_ProgramUniform3ui(ctx->CurrentServerDispatch, (program, location, x, y, z));
20996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform3ui), 8) / 8);
21096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
21196c5ddc4Srjs   return cmd_size;
21296c5ddc4Srjs}
21396c5ddc4Srjsvoid GLAPIENTRY
21496c5ddc4Srjs_mesa_marshal_ProgramUniform3ui(GLuint program, GLint location, GLuint x, GLuint y, GLuint z)
21596c5ddc4Srjs{
21696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
21796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform3ui);
21896c5ddc4Srjs   struct marshal_cmd_ProgramUniform3ui *cmd;
21996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3ui, cmd_size);
22096c5ddc4Srjs   cmd->program = program;
22196c5ddc4Srjs   cmd->location = location;
22296c5ddc4Srjs   cmd->x = x;
22396c5ddc4Srjs   cmd->y = y;
22496c5ddc4Srjs   cmd->z = z;
22596c5ddc4Srjs}
22696c5ddc4Srjs
22796c5ddc4Srjs
22896c5ddc4Srjs/* ProgramUniform4ui: marshalled asynchronously */
22996c5ddc4Srjsstruct marshal_cmd_ProgramUniform4ui
23096c5ddc4Srjs{
23196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
23296c5ddc4Srjs   GLuint program;
23396c5ddc4Srjs   GLint location;
23496c5ddc4Srjs   GLuint x;
23596c5ddc4Srjs   GLuint y;
23696c5ddc4Srjs   GLuint z;
23796c5ddc4Srjs   GLuint w;
23896c5ddc4Srjs};
23996c5ddc4Srjsuint32_t
24096c5ddc4Srjs_mesa_unmarshal_ProgramUniform4ui(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4ui *cmd, const uint64_t *last)
24196c5ddc4Srjs{
24296c5ddc4Srjs   GLuint program = cmd->program;
24396c5ddc4Srjs   GLint location = cmd->location;
24496c5ddc4Srjs   GLuint x = cmd->x;
24596c5ddc4Srjs   GLuint y = cmd->y;
24696c5ddc4Srjs   GLuint z = cmd->z;
24796c5ddc4Srjs   GLuint w = cmd->w;
24896c5ddc4Srjs   CALL_ProgramUniform4ui(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
24996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform4ui), 8) / 8);
25096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
25196c5ddc4Srjs   return cmd_size;
25296c5ddc4Srjs}
25396c5ddc4Srjsvoid GLAPIENTRY
25496c5ddc4Srjs_mesa_marshal_ProgramUniform4ui(GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w)
25596c5ddc4Srjs{
25696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
25796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform4ui);
25896c5ddc4Srjs   struct marshal_cmd_ProgramUniform4ui *cmd;
25996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4ui, cmd_size);
26096c5ddc4Srjs   cmd->program = program;
26196c5ddc4Srjs   cmd->location = location;
26296c5ddc4Srjs   cmd->x = x;
26396c5ddc4Srjs   cmd->y = y;
26496c5ddc4Srjs   cmd->z = z;
26596c5ddc4Srjs   cmd->w = w;
26696c5ddc4Srjs}
26796c5ddc4Srjs
26896c5ddc4Srjs
26996c5ddc4Srjs/* ProgramUniform1f: marshalled asynchronously */
27096c5ddc4Srjsstruct marshal_cmd_ProgramUniform1f
27196c5ddc4Srjs{
27296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
27396c5ddc4Srjs   GLuint program;
27496c5ddc4Srjs   GLint location;
27596c5ddc4Srjs   GLfloat x;
27696c5ddc4Srjs};
27796c5ddc4Srjsuint32_t
27896c5ddc4Srjs_mesa_unmarshal_ProgramUniform1f(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1f *cmd, const uint64_t *last)
27996c5ddc4Srjs{
28096c5ddc4Srjs   GLuint program = cmd->program;
28196c5ddc4Srjs   GLint location = cmd->location;
28296c5ddc4Srjs   GLfloat x = cmd->x;
28396c5ddc4Srjs   CALL_ProgramUniform1f(ctx->CurrentServerDispatch, (program, location, x));
28496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform1f), 8) / 8);
28596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
28696c5ddc4Srjs   return cmd_size;
28796c5ddc4Srjs}
28896c5ddc4Srjsvoid GLAPIENTRY
28996c5ddc4Srjs_mesa_marshal_ProgramUniform1f(GLuint program, GLint location, GLfloat x)
29096c5ddc4Srjs{
29196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
29296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform1f);
29396c5ddc4Srjs   struct marshal_cmd_ProgramUniform1f *cmd;
29496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1f, cmd_size);
29596c5ddc4Srjs   cmd->program = program;
29696c5ddc4Srjs   cmd->location = location;
29796c5ddc4Srjs   cmd->x = x;
29896c5ddc4Srjs}
29996c5ddc4Srjs
30096c5ddc4Srjs
30196c5ddc4Srjs/* ProgramUniform2f: marshalled asynchronously */
30296c5ddc4Srjsstruct marshal_cmd_ProgramUniform2f
30396c5ddc4Srjs{
30496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
30596c5ddc4Srjs   GLuint program;
30696c5ddc4Srjs   GLint location;
30796c5ddc4Srjs   GLfloat x;
30896c5ddc4Srjs   GLfloat y;
30996c5ddc4Srjs};
31096c5ddc4Srjsuint32_t
31196c5ddc4Srjs_mesa_unmarshal_ProgramUniform2f(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2f *cmd, const uint64_t *last)
31296c5ddc4Srjs{
31396c5ddc4Srjs   GLuint program = cmd->program;
31496c5ddc4Srjs   GLint location = cmd->location;
31596c5ddc4Srjs   GLfloat x = cmd->x;
31696c5ddc4Srjs   GLfloat y = cmd->y;
31796c5ddc4Srjs   CALL_ProgramUniform2f(ctx->CurrentServerDispatch, (program, location, x, y));
31896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform2f), 8) / 8);
31996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
32096c5ddc4Srjs   return cmd_size;
32196c5ddc4Srjs}
32296c5ddc4Srjsvoid GLAPIENTRY
32396c5ddc4Srjs_mesa_marshal_ProgramUniform2f(GLuint program, GLint location, GLfloat x, GLfloat y)
32496c5ddc4Srjs{
32596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
32696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform2f);
32796c5ddc4Srjs   struct marshal_cmd_ProgramUniform2f *cmd;
32896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2f, cmd_size);
32996c5ddc4Srjs   cmd->program = program;
33096c5ddc4Srjs   cmd->location = location;
33196c5ddc4Srjs   cmd->x = x;
33296c5ddc4Srjs   cmd->y = y;
33396c5ddc4Srjs}
33496c5ddc4Srjs
33596c5ddc4Srjs
33696c5ddc4Srjs/* ProgramUniform3f: marshalled asynchronously */
33796c5ddc4Srjsstruct marshal_cmd_ProgramUniform3f
33896c5ddc4Srjs{
33996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
34096c5ddc4Srjs   GLuint program;
34196c5ddc4Srjs   GLint location;
34296c5ddc4Srjs   GLfloat x;
34396c5ddc4Srjs   GLfloat y;
34496c5ddc4Srjs   GLfloat z;
34596c5ddc4Srjs};
34696c5ddc4Srjsuint32_t
34796c5ddc4Srjs_mesa_unmarshal_ProgramUniform3f(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3f *cmd, const uint64_t *last)
34896c5ddc4Srjs{
34996c5ddc4Srjs   GLuint program = cmd->program;
35096c5ddc4Srjs   GLint location = cmd->location;
35196c5ddc4Srjs   GLfloat x = cmd->x;
35296c5ddc4Srjs   GLfloat y = cmd->y;
35396c5ddc4Srjs   GLfloat z = cmd->z;
35496c5ddc4Srjs   CALL_ProgramUniform3f(ctx->CurrentServerDispatch, (program, location, x, y, z));
35596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform3f), 8) / 8);
35696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
35796c5ddc4Srjs   return cmd_size;
35896c5ddc4Srjs}
35996c5ddc4Srjsvoid GLAPIENTRY
36096c5ddc4Srjs_mesa_marshal_ProgramUniform3f(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z)
36196c5ddc4Srjs{
36296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
36396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform3f);
36496c5ddc4Srjs   struct marshal_cmd_ProgramUniform3f *cmd;
36596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3f, cmd_size);
36696c5ddc4Srjs   cmd->program = program;
36796c5ddc4Srjs   cmd->location = location;
36896c5ddc4Srjs   cmd->x = x;
36996c5ddc4Srjs   cmd->y = y;
37096c5ddc4Srjs   cmd->z = z;
37196c5ddc4Srjs}
37296c5ddc4Srjs
37396c5ddc4Srjs
37496c5ddc4Srjs/* ProgramUniform4f: marshalled asynchronously */
37596c5ddc4Srjsstruct marshal_cmd_ProgramUniform4f
37696c5ddc4Srjs{
37796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
37896c5ddc4Srjs   GLuint program;
37996c5ddc4Srjs   GLint location;
38096c5ddc4Srjs   GLfloat x;
38196c5ddc4Srjs   GLfloat y;
38296c5ddc4Srjs   GLfloat z;
38396c5ddc4Srjs   GLfloat w;
38496c5ddc4Srjs};
38596c5ddc4Srjsuint32_t
38696c5ddc4Srjs_mesa_unmarshal_ProgramUniform4f(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4f *cmd, const uint64_t *last)
38796c5ddc4Srjs{
38896c5ddc4Srjs   GLuint program = cmd->program;
38996c5ddc4Srjs   GLint location = cmd->location;
39096c5ddc4Srjs   GLfloat x = cmd->x;
39196c5ddc4Srjs   GLfloat y = cmd->y;
39296c5ddc4Srjs   GLfloat z = cmd->z;
39396c5ddc4Srjs   GLfloat w = cmd->w;
39496c5ddc4Srjs   CALL_ProgramUniform4f(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
39596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform4f), 8) / 8);
39696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
39796c5ddc4Srjs   return cmd_size;
39896c5ddc4Srjs}
39996c5ddc4Srjsvoid GLAPIENTRY
40096c5ddc4Srjs_mesa_marshal_ProgramUniform4f(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
40196c5ddc4Srjs{
40296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
40396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform4f);
40496c5ddc4Srjs   struct marshal_cmd_ProgramUniform4f *cmd;
40596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4f, cmd_size);
40696c5ddc4Srjs   cmd->program = program;
40796c5ddc4Srjs   cmd->location = location;
40896c5ddc4Srjs   cmd->x = x;
40996c5ddc4Srjs   cmd->y = y;
41096c5ddc4Srjs   cmd->z = z;
41196c5ddc4Srjs   cmd->w = w;
41296c5ddc4Srjs}
41396c5ddc4Srjs
41496c5ddc4Srjs
41596c5ddc4Srjs/* ProgramUniform1iv: marshalled asynchronously */
41696c5ddc4Srjsstruct marshal_cmd_ProgramUniform1iv
41796c5ddc4Srjs{
41896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
41996c5ddc4Srjs   GLuint program;
42096c5ddc4Srjs   GLint location;
42196c5ddc4Srjs   GLsizei count;
42296c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLint)) bytes are GLint value[count] */
42396c5ddc4Srjs};
42496c5ddc4Srjsuint32_t
42596c5ddc4Srjs_mesa_unmarshal_ProgramUniform1iv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1iv *cmd, const uint64_t *last)
42696c5ddc4Srjs{
42796c5ddc4Srjs   GLuint program = cmd->program;
42896c5ddc4Srjs   GLint location = cmd->location;
42996c5ddc4Srjs   GLsizei count = cmd->count;
43096c5ddc4Srjs   GLint * value;
43196c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
43296c5ddc4Srjs   value = (GLint *) variable_data;
43396c5ddc4Srjs   CALL_ProgramUniform1iv(ctx->CurrentServerDispatch, (program, location, count, value));
43496c5ddc4Srjs   return cmd->cmd_base.cmd_size;
43596c5ddc4Srjs}
43696c5ddc4Srjsvoid GLAPIENTRY
43796c5ddc4Srjs_mesa_marshal_ProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint * value)
43896c5ddc4Srjs{
43996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
44096c5ddc4Srjs   int value_size = safe_mul(count, 1 * sizeof(GLint));
44196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform1iv) + value_size;
44296c5ddc4Srjs   struct marshal_cmd_ProgramUniform1iv *cmd;
44396c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
44496c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniform1iv");
44596c5ddc4Srjs      CALL_ProgramUniform1iv(ctx->CurrentServerDispatch, (program, location, count, value));
44696c5ddc4Srjs      return;
44796c5ddc4Srjs   }
44896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1iv, cmd_size);
44996c5ddc4Srjs   cmd->program = program;
45096c5ddc4Srjs   cmd->location = location;
45196c5ddc4Srjs   cmd->count = count;
45296c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
45396c5ddc4Srjs   memcpy(variable_data, value, value_size);
45496c5ddc4Srjs}
45596c5ddc4Srjs
45696c5ddc4Srjs
45796c5ddc4Srjs/* ProgramUniform2iv: marshalled asynchronously */
45896c5ddc4Srjsstruct marshal_cmd_ProgramUniform2iv
45996c5ddc4Srjs{
46096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
46196c5ddc4Srjs   GLuint program;
46296c5ddc4Srjs   GLint location;
46396c5ddc4Srjs   GLsizei count;
46496c5ddc4Srjs   /* Next safe_mul(count, 2 * sizeof(GLint)) bytes are GLint value[count][2] */
46596c5ddc4Srjs};
46696c5ddc4Srjsuint32_t
46796c5ddc4Srjs_mesa_unmarshal_ProgramUniform2iv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2iv *cmd, const uint64_t *last)
46896c5ddc4Srjs{
46996c5ddc4Srjs   GLuint program = cmd->program;
47096c5ddc4Srjs   GLint location = cmd->location;
47196c5ddc4Srjs   GLsizei count = cmd->count;
47296c5ddc4Srjs   GLint * value;
47396c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
47496c5ddc4Srjs   value = (GLint *) variable_data;
47596c5ddc4Srjs   CALL_ProgramUniform2iv(ctx->CurrentServerDispatch, (program, location, count, value));
47696c5ddc4Srjs   return cmd->cmd_base.cmd_size;
47796c5ddc4Srjs}
47896c5ddc4Srjsvoid GLAPIENTRY
47996c5ddc4Srjs_mesa_marshal_ProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint * value)
48096c5ddc4Srjs{
48196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
48296c5ddc4Srjs   int value_size = safe_mul(count, 2 * sizeof(GLint));
48396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform2iv) + value_size;
48496c5ddc4Srjs   struct marshal_cmd_ProgramUniform2iv *cmd;
48596c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
48696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniform2iv");
48796c5ddc4Srjs      CALL_ProgramUniform2iv(ctx->CurrentServerDispatch, (program, location, count, value));
48896c5ddc4Srjs      return;
48996c5ddc4Srjs   }
49096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2iv, cmd_size);
49196c5ddc4Srjs   cmd->program = program;
49296c5ddc4Srjs   cmd->location = location;
49396c5ddc4Srjs   cmd->count = count;
49496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
49596c5ddc4Srjs   memcpy(variable_data, value, value_size);
49696c5ddc4Srjs}
49796c5ddc4Srjs
49896c5ddc4Srjs
49996c5ddc4Srjs/* ProgramUniform3iv: marshalled asynchronously */
50096c5ddc4Srjsstruct marshal_cmd_ProgramUniform3iv
50196c5ddc4Srjs{
50296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
50396c5ddc4Srjs   GLuint program;
50496c5ddc4Srjs   GLint location;
50596c5ddc4Srjs   GLsizei count;
50696c5ddc4Srjs   /* Next safe_mul(count, 3 * sizeof(GLint)) bytes are GLint value[count][3] */
50796c5ddc4Srjs};
50896c5ddc4Srjsuint32_t
50996c5ddc4Srjs_mesa_unmarshal_ProgramUniform3iv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3iv *cmd, const uint64_t *last)
51096c5ddc4Srjs{
51196c5ddc4Srjs   GLuint program = cmd->program;
51296c5ddc4Srjs   GLint location = cmd->location;
51396c5ddc4Srjs   GLsizei count = cmd->count;
51496c5ddc4Srjs   GLint * value;
51596c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
51696c5ddc4Srjs   value = (GLint *) variable_data;
51796c5ddc4Srjs   CALL_ProgramUniform3iv(ctx->CurrentServerDispatch, (program, location, count, value));
51896c5ddc4Srjs   return cmd->cmd_base.cmd_size;
51996c5ddc4Srjs}
52096c5ddc4Srjsvoid GLAPIENTRY
52196c5ddc4Srjs_mesa_marshal_ProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint * value)
52296c5ddc4Srjs{
52396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
52496c5ddc4Srjs   int value_size = safe_mul(count, 3 * sizeof(GLint));
52596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform3iv) + value_size;
52696c5ddc4Srjs   struct marshal_cmd_ProgramUniform3iv *cmd;
52796c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
52896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniform3iv");
52996c5ddc4Srjs      CALL_ProgramUniform3iv(ctx->CurrentServerDispatch, (program, location, count, value));
53096c5ddc4Srjs      return;
53196c5ddc4Srjs   }
53296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3iv, cmd_size);
53396c5ddc4Srjs   cmd->program = program;
53496c5ddc4Srjs   cmd->location = location;
53596c5ddc4Srjs   cmd->count = count;
53696c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
53796c5ddc4Srjs   memcpy(variable_data, value, value_size);
53896c5ddc4Srjs}
53996c5ddc4Srjs
54096c5ddc4Srjs
54196c5ddc4Srjs/* ProgramUniform4iv: marshalled asynchronously */
54296c5ddc4Srjsstruct marshal_cmd_ProgramUniform4iv
54396c5ddc4Srjs{
54496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
54596c5ddc4Srjs   GLuint program;
54696c5ddc4Srjs   GLint location;
54796c5ddc4Srjs   GLsizei count;
54896c5ddc4Srjs   /* Next safe_mul(count, 4 * sizeof(GLint)) bytes are GLint value[count][4] */
54996c5ddc4Srjs};
55096c5ddc4Srjsuint32_t
55196c5ddc4Srjs_mesa_unmarshal_ProgramUniform4iv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4iv *cmd, const uint64_t *last)
55296c5ddc4Srjs{
55396c5ddc4Srjs   GLuint program = cmd->program;
55496c5ddc4Srjs   GLint location = cmd->location;
55596c5ddc4Srjs   GLsizei count = cmd->count;
55696c5ddc4Srjs   GLint * value;
55796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
55896c5ddc4Srjs   value = (GLint *) variable_data;
55996c5ddc4Srjs   CALL_ProgramUniform4iv(ctx->CurrentServerDispatch, (program, location, count, value));
56096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
56196c5ddc4Srjs}
56296c5ddc4Srjsvoid GLAPIENTRY
56396c5ddc4Srjs_mesa_marshal_ProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint * value)
56496c5ddc4Srjs{
56596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
56696c5ddc4Srjs   int value_size = safe_mul(count, 4 * sizeof(GLint));
56796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform4iv) + value_size;
56896c5ddc4Srjs   struct marshal_cmd_ProgramUniform4iv *cmd;
56996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
57096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniform4iv");
57196c5ddc4Srjs      CALL_ProgramUniform4iv(ctx->CurrentServerDispatch, (program, location, count, value));
57296c5ddc4Srjs      return;
57396c5ddc4Srjs   }
57496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4iv, cmd_size);
57596c5ddc4Srjs   cmd->program = program;
57696c5ddc4Srjs   cmd->location = location;
57796c5ddc4Srjs   cmd->count = count;
57896c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
57996c5ddc4Srjs   memcpy(variable_data, value, value_size);
58096c5ddc4Srjs}
58196c5ddc4Srjs
58296c5ddc4Srjs
58396c5ddc4Srjs/* ProgramUniform1uiv: marshalled asynchronously */
58496c5ddc4Srjsstruct marshal_cmd_ProgramUniform1uiv
58596c5ddc4Srjs{
58696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
58796c5ddc4Srjs   GLuint program;
58896c5ddc4Srjs   GLint location;
58996c5ddc4Srjs   GLsizei count;
59096c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLuint)) bytes are GLuint value[count] */
59196c5ddc4Srjs};
59296c5ddc4Srjsuint32_t
59396c5ddc4Srjs_mesa_unmarshal_ProgramUniform1uiv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1uiv *cmd, const uint64_t *last)
59496c5ddc4Srjs{
59596c5ddc4Srjs   GLuint program = cmd->program;
59696c5ddc4Srjs   GLint location = cmd->location;
59796c5ddc4Srjs   GLsizei count = cmd->count;
59896c5ddc4Srjs   GLuint * value;
59996c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
60096c5ddc4Srjs   value = (GLuint *) variable_data;
60196c5ddc4Srjs   CALL_ProgramUniform1uiv(ctx->CurrentServerDispatch, (program, location, count, value));
60296c5ddc4Srjs   return cmd->cmd_base.cmd_size;
60396c5ddc4Srjs}
60496c5ddc4Srjsvoid GLAPIENTRY
60596c5ddc4Srjs_mesa_marshal_ProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
60696c5ddc4Srjs{
60796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
60896c5ddc4Srjs   int value_size = safe_mul(count, 1 * sizeof(GLuint));
60996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform1uiv) + value_size;
61096c5ddc4Srjs   struct marshal_cmd_ProgramUniform1uiv *cmd;
61196c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
61296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniform1uiv");
61396c5ddc4Srjs      CALL_ProgramUniform1uiv(ctx->CurrentServerDispatch, (program, location, count, value));
61496c5ddc4Srjs      return;
61596c5ddc4Srjs   }
61696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1uiv, cmd_size);
61796c5ddc4Srjs   cmd->program = program;
61896c5ddc4Srjs   cmd->location = location;
61996c5ddc4Srjs   cmd->count = count;
62096c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
62196c5ddc4Srjs   memcpy(variable_data, value, value_size);
62296c5ddc4Srjs}
62396c5ddc4Srjs
62496c5ddc4Srjs
62596c5ddc4Srjs/* ProgramUniform2uiv: marshalled asynchronously */
62696c5ddc4Srjsstruct marshal_cmd_ProgramUniform2uiv
62796c5ddc4Srjs{
62896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
62996c5ddc4Srjs   GLuint program;
63096c5ddc4Srjs   GLint location;
63196c5ddc4Srjs   GLsizei count;
63296c5ddc4Srjs   /* Next safe_mul(count, 2 * sizeof(GLuint)) bytes are GLuint value[count][2] */
63396c5ddc4Srjs};
63496c5ddc4Srjsuint32_t
63596c5ddc4Srjs_mesa_unmarshal_ProgramUniform2uiv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2uiv *cmd, const uint64_t *last)
63696c5ddc4Srjs{
63796c5ddc4Srjs   GLuint program = cmd->program;
63896c5ddc4Srjs   GLint location = cmd->location;
63996c5ddc4Srjs   GLsizei count = cmd->count;
64096c5ddc4Srjs   GLuint * value;
64196c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
64296c5ddc4Srjs   value = (GLuint *) variable_data;
64396c5ddc4Srjs   CALL_ProgramUniform2uiv(ctx->CurrentServerDispatch, (program, location, count, value));
64496c5ddc4Srjs   return cmd->cmd_base.cmd_size;
64596c5ddc4Srjs}
64696c5ddc4Srjsvoid GLAPIENTRY
64796c5ddc4Srjs_mesa_marshal_ProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
64896c5ddc4Srjs{
64996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
65096c5ddc4Srjs   int value_size = safe_mul(count, 2 * sizeof(GLuint));
65196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform2uiv) + value_size;
65296c5ddc4Srjs   struct marshal_cmd_ProgramUniform2uiv *cmd;
65396c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
65496c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniform2uiv");
65596c5ddc4Srjs      CALL_ProgramUniform2uiv(ctx->CurrentServerDispatch, (program, location, count, value));
65696c5ddc4Srjs      return;
65796c5ddc4Srjs   }
65896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2uiv, cmd_size);
65996c5ddc4Srjs   cmd->program = program;
66096c5ddc4Srjs   cmd->location = location;
66196c5ddc4Srjs   cmd->count = count;
66296c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
66396c5ddc4Srjs   memcpy(variable_data, value, value_size);
66496c5ddc4Srjs}
66596c5ddc4Srjs
66696c5ddc4Srjs
66796c5ddc4Srjs/* ProgramUniform3uiv: marshalled asynchronously */
66896c5ddc4Srjsstruct marshal_cmd_ProgramUniform3uiv
66996c5ddc4Srjs{
67096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
67196c5ddc4Srjs   GLuint program;
67296c5ddc4Srjs   GLint location;
67396c5ddc4Srjs   GLsizei count;
67496c5ddc4Srjs   /* Next safe_mul(count, 3 * sizeof(GLuint)) bytes are GLuint value[count][3] */
67596c5ddc4Srjs};
67696c5ddc4Srjsuint32_t
67796c5ddc4Srjs_mesa_unmarshal_ProgramUniform3uiv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3uiv *cmd, const uint64_t *last)
67896c5ddc4Srjs{
67996c5ddc4Srjs   GLuint program = cmd->program;
68096c5ddc4Srjs   GLint location = cmd->location;
68196c5ddc4Srjs   GLsizei count = cmd->count;
68296c5ddc4Srjs   GLuint * value;
68396c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
68496c5ddc4Srjs   value = (GLuint *) variable_data;
68596c5ddc4Srjs   CALL_ProgramUniform3uiv(ctx->CurrentServerDispatch, (program, location, count, value));
68696c5ddc4Srjs   return cmd->cmd_base.cmd_size;
68796c5ddc4Srjs}
68896c5ddc4Srjsvoid GLAPIENTRY
68996c5ddc4Srjs_mesa_marshal_ProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
69096c5ddc4Srjs{
69196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
69296c5ddc4Srjs   int value_size = safe_mul(count, 3 * sizeof(GLuint));
69396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform3uiv) + value_size;
69496c5ddc4Srjs   struct marshal_cmd_ProgramUniform3uiv *cmd;
69596c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
69696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniform3uiv");
69796c5ddc4Srjs      CALL_ProgramUniform3uiv(ctx->CurrentServerDispatch, (program, location, count, value));
69896c5ddc4Srjs      return;
69996c5ddc4Srjs   }
70096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3uiv, cmd_size);
70196c5ddc4Srjs   cmd->program = program;
70296c5ddc4Srjs   cmd->location = location;
70396c5ddc4Srjs   cmd->count = count;
70496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
70596c5ddc4Srjs   memcpy(variable_data, value, value_size);
70696c5ddc4Srjs}
70796c5ddc4Srjs
70896c5ddc4Srjs
70996c5ddc4Srjs/* ProgramUniform4uiv: marshalled asynchronously */
71096c5ddc4Srjsstruct marshal_cmd_ProgramUniform4uiv
71196c5ddc4Srjs{
71296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
71396c5ddc4Srjs   GLuint program;
71496c5ddc4Srjs   GLint location;
71596c5ddc4Srjs   GLsizei count;
71696c5ddc4Srjs   /* Next safe_mul(count, 4 * sizeof(GLuint)) bytes are GLuint value[count][4] */
71796c5ddc4Srjs};
71896c5ddc4Srjsuint32_t
71996c5ddc4Srjs_mesa_unmarshal_ProgramUniform4uiv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4uiv *cmd, const uint64_t *last)
72096c5ddc4Srjs{
72196c5ddc4Srjs   GLuint program = cmd->program;
72296c5ddc4Srjs   GLint location = cmd->location;
72396c5ddc4Srjs   GLsizei count = cmd->count;
72496c5ddc4Srjs   GLuint * value;
72596c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
72696c5ddc4Srjs   value = (GLuint *) variable_data;
72796c5ddc4Srjs   CALL_ProgramUniform4uiv(ctx->CurrentServerDispatch, (program, location, count, value));
72896c5ddc4Srjs   return cmd->cmd_base.cmd_size;
72996c5ddc4Srjs}
73096c5ddc4Srjsvoid GLAPIENTRY
73196c5ddc4Srjs_mesa_marshal_ProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
73296c5ddc4Srjs{
73396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
73496c5ddc4Srjs   int value_size = safe_mul(count, 4 * sizeof(GLuint));
73596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform4uiv) + value_size;
73696c5ddc4Srjs   struct marshal_cmd_ProgramUniform4uiv *cmd;
73796c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
73896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniform4uiv");
73996c5ddc4Srjs      CALL_ProgramUniform4uiv(ctx->CurrentServerDispatch, (program, location, count, value));
74096c5ddc4Srjs      return;
74196c5ddc4Srjs   }
74296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4uiv, cmd_size);
74396c5ddc4Srjs   cmd->program = program;
74496c5ddc4Srjs   cmd->location = location;
74596c5ddc4Srjs   cmd->count = count;
74696c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
74796c5ddc4Srjs   memcpy(variable_data, value, value_size);
74896c5ddc4Srjs}
74996c5ddc4Srjs
75096c5ddc4Srjs
75196c5ddc4Srjs/* ProgramUniform1fv: marshalled asynchronously */
75296c5ddc4Srjsstruct marshal_cmd_ProgramUniform1fv
75396c5ddc4Srjs{
75496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
75596c5ddc4Srjs   GLuint program;
75696c5ddc4Srjs   GLint location;
75796c5ddc4Srjs   GLsizei count;
75896c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLfloat)) bytes are GLfloat value[count] */
75996c5ddc4Srjs};
76096c5ddc4Srjsuint32_t
76196c5ddc4Srjs_mesa_unmarshal_ProgramUniform1fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1fv *cmd, const uint64_t *last)
76296c5ddc4Srjs{
76396c5ddc4Srjs   GLuint program = cmd->program;
76496c5ddc4Srjs   GLint location = cmd->location;
76596c5ddc4Srjs   GLsizei count = cmd->count;
76696c5ddc4Srjs   GLfloat * value;
76796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
76896c5ddc4Srjs   value = (GLfloat *) variable_data;
76996c5ddc4Srjs   CALL_ProgramUniform1fv(ctx->CurrentServerDispatch, (program, location, count, value));
77096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
77196c5ddc4Srjs}
77296c5ddc4Srjsvoid GLAPIENTRY
77396c5ddc4Srjs_mesa_marshal_ProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
77496c5ddc4Srjs{
77596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
77696c5ddc4Srjs   int value_size = safe_mul(count, 1 * sizeof(GLfloat));
77796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform1fv) + value_size;
77896c5ddc4Srjs   struct marshal_cmd_ProgramUniform1fv *cmd;
77996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
78096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniform1fv");
78196c5ddc4Srjs      CALL_ProgramUniform1fv(ctx->CurrentServerDispatch, (program, location, count, value));
78296c5ddc4Srjs      return;
78396c5ddc4Srjs   }
78496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1fv, cmd_size);
78596c5ddc4Srjs   cmd->program = program;
78696c5ddc4Srjs   cmd->location = location;
78796c5ddc4Srjs   cmd->count = count;
78896c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
78996c5ddc4Srjs   memcpy(variable_data, value, value_size);
79096c5ddc4Srjs}
79196c5ddc4Srjs
79296c5ddc4Srjs
79396c5ddc4Srjs/* ProgramUniform2fv: marshalled asynchronously */
79496c5ddc4Srjsstruct marshal_cmd_ProgramUniform2fv
79596c5ddc4Srjs{
79696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
79796c5ddc4Srjs   GLuint program;
79896c5ddc4Srjs   GLint location;
79996c5ddc4Srjs   GLsizei count;
80096c5ddc4Srjs   /* Next safe_mul(count, 2 * sizeof(GLfloat)) bytes are GLfloat value[count][2] */
80196c5ddc4Srjs};
80296c5ddc4Srjsuint32_t
80396c5ddc4Srjs_mesa_unmarshal_ProgramUniform2fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2fv *cmd, const uint64_t *last)
80496c5ddc4Srjs{
80596c5ddc4Srjs   GLuint program = cmd->program;
80696c5ddc4Srjs   GLint location = cmd->location;
80796c5ddc4Srjs   GLsizei count = cmd->count;
80896c5ddc4Srjs   GLfloat * value;
80996c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
81096c5ddc4Srjs   value = (GLfloat *) variable_data;
81196c5ddc4Srjs   CALL_ProgramUniform2fv(ctx->CurrentServerDispatch, (program, location, count, value));
81296c5ddc4Srjs   return cmd->cmd_base.cmd_size;
81396c5ddc4Srjs}
81496c5ddc4Srjsvoid GLAPIENTRY
81596c5ddc4Srjs_mesa_marshal_ProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
81696c5ddc4Srjs{
81796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
81896c5ddc4Srjs   int value_size = safe_mul(count, 2 * sizeof(GLfloat));
81996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform2fv) + value_size;
82096c5ddc4Srjs   struct marshal_cmd_ProgramUniform2fv *cmd;
82196c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
82296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniform2fv");
82396c5ddc4Srjs      CALL_ProgramUniform2fv(ctx->CurrentServerDispatch, (program, location, count, value));
82496c5ddc4Srjs      return;
82596c5ddc4Srjs   }
82696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2fv, cmd_size);
82796c5ddc4Srjs   cmd->program = program;
82896c5ddc4Srjs   cmd->location = location;
82996c5ddc4Srjs   cmd->count = count;
83096c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
83196c5ddc4Srjs   memcpy(variable_data, value, value_size);
83296c5ddc4Srjs}
83396c5ddc4Srjs
83496c5ddc4Srjs
83596c5ddc4Srjs/* ProgramUniform3fv: marshalled asynchronously */
83696c5ddc4Srjsstruct marshal_cmd_ProgramUniform3fv
83796c5ddc4Srjs{
83896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
83996c5ddc4Srjs   GLuint program;
84096c5ddc4Srjs   GLint location;
84196c5ddc4Srjs   GLsizei count;
84296c5ddc4Srjs   /* Next safe_mul(count, 3 * sizeof(GLfloat)) bytes are GLfloat value[count][3] */
84396c5ddc4Srjs};
84496c5ddc4Srjsuint32_t
84596c5ddc4Srjs_mesa_unmarshal_ProgramUniform3fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3fv *cmd, const uint64_t *last)
84696c5ddc4Srjs{
84796c5ddc4Srjs   GLuint program = cmd->program;
84896c5ddc4Srjs   GLint location = cmd->location;
84996c5ddc4Srjs   GLsizei count = cmd->count;
85096c5ddc4Srjs   GLfloat * value;
85196c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
85296c5ddc4Srjs   value = (GLfloat *) variable_data;
85396c5ddc4Srjs   CALL_ProgramUniform3fv(ctx->CurrentServerDispatch, (program, location, count, value));
85496c5ddc4Srjs   return cmd->cmd_base.cmd_size;
85596c5ddc4Srjs}
85696c5ddc4Srjsvoid GLAPIENTRY
85796c5ddc4Srjs_mesa_marshal_ProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
85896c5ddc4Srjs{
85996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
86096c5ddc4Srjs   int value_size = safe_mul(count, 3 * sizeof(GLfloat));
86196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform3fv) + value_size;
86296c5ddc4Srjs   struct marshal_cmd_ProgramUniform3fv *cmd;
86396c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
86496c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniform3fv");
86596c5ddc4Srjs      CALL_ProgramUniform3fv(ctx->CurrentServerDispatch, (program, location, count, value));
86696c5ddc4Srjs      return;
86796c5ddc4Srjs   }
86896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3fv, cmd_size);
86996c5ddc4Srjs   cmd->program = program;
87096c5ddc4Srjs   cmd->location = location;
87196c5ddc4Srjs   cmd->count = count;
87296c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
87396c5ddc4Srjs   memcpy(variable_data, value, value_size);
87496c5ddc4Srjs}
87596c5ddc4Srjs
87696c5ddc4Srjs
87796c5ddc4Srjs/* ProgramUniform4fv: marshalled asynchronously */
87896c5ddc4Srjsstruct marshal_cmd_ProgramUniform4fv
87996c5ddc4Srjs{
88096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
88196c5ddc4Srjs   GLuint program;
88296c5ddc4Srjs   GLint location;
88396c5ddc4Srjs   GLsizei count;
88496c5ddc4Srjs   /* Next safe_mul(count, 4 * sizeof(GLfloat)) bytes are GLfloat value[count][4] */
88596c5ddc4Srjs};
88696c5ddc4Srjsuint32_t
88796c5ddc4Srjs_mesa_unmarshal_ProgramUniform4fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4fv *cmd, const uint64_t *last)
88896c5ddc4Srjs{
88996c5ddc4Srjs   GLuint program = cmd->program;
89096c5ddc4Srjs   GLint location = cmd->location;
89196c5ddc4Srjs   GLsizei count = cmd->count;
89296c5ddc4Srjs   GLfloat * value;
89396c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
89496c5ddc4Srjs   value = (GLfloat *) variable_data;
89596c5ddc4Srjs   CALL_ProgramUniform4fv(ctx->CurrentServerDispatch, (program, location, count, value));
89696c5ddc4Srjs   return cmd->cmd_base.cmd_size;
89796c5ddc4Srjs}
89896c5ddc4Srjsvoid GLAPIENTRY
89996c5ddc4Srjs_mesa_marshal_ProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
90096c5ddc4Srjs{
90196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
90296c5ddc4Srjs   int value_size = safe_mul(count, 4 * sizeof(GLfloat));
90396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniform4fv) + value_size;
90496c5ddc4Srjs   struct marshal_cmd_ProgramUniform4fv *cmd;
90596c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
90696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniform4fv");
90796c5ddc4Srjs      CALL_ProgramUniform4fv(ctx->CurrentServerDispatch, (program, location, count, value));
90896c5ddc4Srjs      return;
90996c5ddc4Srjs   }
91096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4fv, cmd_size);
91196c5ddc4Srjs   cmd->program = program;
91296c5ddc4Srjs   cmd->location = location;
91396c5ddc4Srjs   cmd->count = count;
91496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
91596c5ddc4Srjs   memcpy(variable_data, value, value_size);
91696c5ddc4Srjs}
91796c5ddc4Srjs
91896c5ddc4Srjs
91996c5ddc4Srjs/* ProgramUniformMatrix2fv: marshalled asynchronously */
92096c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix2fv
92196c5ddc4Srjs{
92296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
92396c5ddc4Srjs   GLboolean transpose;
92496c5ddc4Srjs   GLuint program;
92596c5ddc4Srjs   GLint location;
92696c5ddc4Srjs   GLsizei count;
92796c5ddc4Srjs   /* Next safe_mul(count, 4 * sizeof(GLfloat)) bytes are GLfloat value[count][4] */
92896c5ddc4Srjs};
92996c5ddc4Srjsuint32_t
93096c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix2fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix2fv *cmd, const uint64_t *last)
93196c5ddc4Srjs{
93296c5ddc4Srjs   GLuint program = cmd->program;
93396c5ddc4Srjs   GLint location = cmd->location;
93496c5ddc4Srjs   GLsizei count = cmd->count;
93596c5ddc4Srjs   GLboolean transpose = cmd->transpose;
93696c5ddc4Srjs   GLfloat * value;
93796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
93896c5ddc4Srjs   value = (GLfloat *) variable_data;
93996c5ddc4Srjs   CALL_ProgramUniformMatrix2fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
94096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
94196c5ddc4Srjs}
94296c5ddc4Srjsvoid GLAPIENTRY
94396c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
94496c5ddc4Srjs{
94596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
94696c5ddc4Srjs   int value_size = safe_mul(count, 4 * sizeof(GLfloat));
94796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix2fv) + value_size;
94896c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix2fv *cmd;
94996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
95096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix2fv");
95196c5ddc4Srjs      CALL_ProgramUniformMatrix2fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
95296c5ddc4Srjs      return;
95396c5ddc4Srjs   }
95496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix2fv, cmd_size);
95596c5ddc4Srjs   cmd->program = program;
95696c5ddc4Srjs   cmd->location = location;
95796c5ddc4Srjs   cmd->count = count;
95896c5ddc4Srjs   cmd->transpose = transpose;
95996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
96096c5ddc4Srjs   memcpy(variable_data, value, value_size);
96196c5ddc4Srjs}
96296c5ddc4Srjs
96396c5ddc4Srjs
96496c5ddc4Srjs/* ProgramUniformMatrix3fv: marshalled asynchronously */
96596c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix3fv
96696c5ddc4Srjs{
96796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
96896c5ddc4Srjs   GLboolean transpose;
96996c5ddc4Srjs   GLuint program;
97096c5ddc4Srjs   GLint location;
97196c5ddc4Srjs   GLsizei count;
97296c5ddc4Srjs   /* Next safe_mul(count, 9 * sizeof(GLfloat)) bytes are GLfloat value[count][9] */
97396c5ddc4Srjs};
97496c5ddc4Srjsuint32_t
97596c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix3fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix3fv *cmd, const uint64_t *last)
97696c5ddc4Srjs{
97796c5ddc4Srjs   GLuint program = cmd->program;
97896c5ddc4Srjs   GLint location = cmd->location;
97996c5ddc4Srjs   GLsizei count = cmd->count;
98096c5ddc4Srjs   GLboolean transpose = cmd->transpose;
98196c5ddc4Srjs   GLfloat * value;
98296c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
98396c5ddc4Srjs   value = (GLfloat *) variable_data;
98496c5ddc4Srjs   CALL_ProgramUniformMatrix3fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
98596c5ddc4Srjs   return cmd->cmd_base.cmd_size;
98696c5ddc4Srjs}
98796c5ddc4Srjsvoid GLAPIENTRY
98896c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
98996c5ddc4Srjs{
99096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
99196c5ddc4Srjs   int value_size = safe_mul(count, 9 * sizeof(GLfloat));
99296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix3fv) + value_size;
99396c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix3fv *cmd;
99496c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
99596c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix3fv");
99696c5ddc4Srjs      CALL_ProgramUniformMatrix3fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
99796c5ddc4Srjs      return;
99896c5ddc4Srjs   }
99996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix3fv, cmd_size);
100096c5ddc4Srjs   cmd->program = program;
100196c5ddc4Srjs   cmd->location = location;
100296c5ddc4Srjs   cmd->count = count;
100396c5ddc4Srjs   cmd->transpose = transpose;
100496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
100596c5ddc4Srjs   memcpy(variable_data, value, value_size);
100696c5ddc4Srjs}
100796c5ddc4Srjs
100896c5ddc4Srjs
100996c5ddc4Srjs/* ProgramUniformMatrix4fv: marshalled asynchronously */
101096c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix4fv
101196c5ddc4Srjs{
101296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
101396c5ddc4Srjs   GLboolean transpose;
101496c5ddc4Srjs   GLuint program;
101596c5ddc4Srjs   GLint location;
101696c5ddc4Srjs   GLsizei count;
101796c5ddc4Srjs   /* Next safe_mul(count, 16 * sizeof(GLfloat)) bytes are GLfloat value[count][16] */
101896c5ddc4Srjs};
101996c5ddc4Srjsuint32_t
102096c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix4fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix4fv *cmd, const uint64_t *last)
102196c5ddc4Srjs{
102296c5ddc4Srjs   GLuint program = cmd->program;
102396c5ddc4Srjs   GLint location = cmd->location;
102496c5ddc4Srjs   GLsizei count = cmd->count;
102596c5ddc4Srjs   GLboolean transpose = cmd->transpose;
102696c5ddc4Srjs   GLfloat * value;
102796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
102896c5ddc4Srjs   value = (GLfloat *) variable_data;
102996c5ddc4Srjs   CALL_ProgramUniformMatrix4fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
103096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
103196c5ddc4Srjs}
103296c5ddc4Srjsvoid GLAPIENTRY
103396c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
103496c5ddc4Srjs{
103596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
103696c5ddc4Srjs   int value_size = safe_mul(count, 16 * sizeof(GLfloat));
103796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix4fv) + value_size;
103896c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix4fv *cmd;
103996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
104096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix4fv");
104196c5ddc4Srjs      CALL_ProgramUniformMatrix4fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
104296c5ddc4Srjs      return;
104396c5ddc4Srjs   }
104496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix4fv, cmd_size);
104596c5ddc4Srjs   cmd->program = program;
104696c5ddc4Srjs   cmd->location = location;
104796c5ddc4Srjs   cmd->count = count;
104896c5ddc4Srjs   cmd->transpose = transpose;
104996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
105096c5ddc4Srjs   memcpy(variable_data, value, value_size);
105196c5ddc4Srjs}
105296c5ddc4Srjs
105396c5ddc4Srjs
105496c5ddc4Srjs/* ProgramUniformMatrix2x3fv: marshalled asynchronously */
105596c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix2x3fv
105696c5ddc4Srjs{
105796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
105896c5ddc4Srjs   GLboolean transpose;
105996c5ddc4Srjs   GLuint program;
106096c5ddc4Srjs   GLint location;
106196c5ddc4Srjs   GLsizei count;
106296c5ddc4Srjs   /* Next safe_mul(count, 6 * sizeof(GLfloat)) bytes are GLfloat value[count][6] */
106396c5ddc4Srjs};
106496c5ddc4Srjsuint32_t
106596c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix2x3fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix2x3fv *cmd, const uint64_t *last)
106696c5ddc4Srjs{
106796c5ddc4Srjs   GLuint program = cmd->program;
106896c5ddc4Srjs   GLint location = cmd->location;
106996c5ddc4Srjs   GLsizei count = cmd->count;
107096c5ddc4Srjs   GLboolean transpose = cmd->transpose;
107196c5ddc4Srjs   GLfloat * value;
107296c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
107396c5ddc4Srjs   value = (GLfloat *) variable_data;
107496c5ddc4Srjs   CALL_ProgramUniformMatrix2x3fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
107596c5ddc4Srjs   return cmd->cmd_base.cmd_size;
107696c5ddc4Srjs}
107796c5ddc4Srjsvoid GLAPIENTRY
107896c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
107996c5ddc4Srjs{
108096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
108196c5ddc4Srjs   int value_size = safe_mul(count, 6 * sizeof(GLfloat));
108296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix2x3fv) + value_size;
108396c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix2x3fv *cmd;
108496c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
108596c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix2x3fv");
108696c5ddc4Srjs      CALL_ProgramUniformMatrix2x3fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
108796c5ddc4Srjs      return;
108896c5ddc4Srjs   }
108996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix2x3fv, cmd_size);
109096c5ddc4Srjs   cmd->program = program;
109196c5ddc4Srjs   cmd->location = location;
109296c5ddc4Srjs   cmd->count = count;
109396c5ddc4Srjs   cmd->transpose = transpose;
109496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
109596c5ddc4Srjs   memcpy(variable_data, value, value_size);
109696c5ddc4Srjs}
109796c5ddc4Srjs
109896c5ddc4Srjs
109996c5ddc4Srjs/* ProgramUniformMatrix3x2fv: marshalled asynchronously */
110096c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix3x2fv
110196c5ddc4Srjs{
110296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
110396c5ddc4Srjs   GLboolean transpose;
110496c5ddc4Srjs   GLuint program;
110596c5ddc4Srjs   GLint location;
110696c5ddc4Srjs   GLsizei count;
110796c5ddc4Srjs   /* Next safe_mul(count, 6 * sizeof(GLfloat)) bytes are GLfloat value[count][6] */
110896c5ddc4Srjs};
110996c5ddc4Srjsuint32_t
111096c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix3x2fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix3x2fv *cmd, const uint64_t *last)
111196c5ddc4Srjs{
111296c5ddc4Srjs   GLuint program = cmd->program;
111396c5ddc4Srjs   GLint location = cmd->location;
111496c5ddc4Srjs   GLsizei count = cmd->count;
111596c5ddc4Srjs   GLboolean transpose = cmd->transpose;
111696c5ddc4Srjs   GLfloat * value;
111796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
111896c5ddc4Srjs   value = (GLfloat *) variable_data;
111996c5ddc4Srjs   CALL_ProgramUniformMatrix3x2fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
112096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
112196c5ddc4Srjs}
112296c5ddc4Srjsvoid GLAPIENTRY
112396c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
112496c5ddc4Srjs{
112596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
112696c5ddc4Srjs   int value_size = safe_mul(count, 6 * sizeof(GLfloat));
112796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix3x2fv) + value_size;
112896c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix3x2fv *cmd;
112996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
113096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix3x2fv");
113196c5ddc4Srjs      CALL_ProgramUniformMatrix3x2fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
113296c5ddc4Srjs      return;
113396c5ddc4Srjs   }
113496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix3x2fv, cmd_size);
113596c5ddc4Srjs   cmd->program = program;
113696c5ddc4Srjs   cmd->location = location;
113796c5ddc4Srjs   cmd->count = count;
113896c5ddc4Srjs   cmd->transpose = transpose;
113996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
114096c5ddc4Srjs   memcpy(variable_data, value, value_size);
114196c5ddc4Srjs}
114296c5ddc4Srjs
114396c5ddc4Srjs
114496c5ddc4Srjs/* ProgramUniformMatrix2x4fv: marshalled asynchronously */
114596c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix2x4fv
114696c5ddc4Srjs{
114796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
114896c5ddc4Srjs   GLboolean transpose;
114996c5ddc4Srjs   GLuint program;
115096c5ddc4Srjs   GLint location;
115196c5ddc4Srjs   GLsizei count;
115296c5ddc4Srjs   /* Next safe_mul(count, 8 * sizeof(GLfloat)) bytes are GLfloat value[count][8] */
115396c5ddc4Srjs};
115496c5ddc4Srjsuint32_t
115596c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix2x4fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix2x4fv *cmd, const uint64_t *last)
115696c5ddc4Srjs{
115796c5ddc4Srjs   GLuint program = cmd->program;
115896c5ddc4Srjs   GLint location = cmd->location;
115996c5ddc4Srjs   GLsizei count = cmd->count;
116096c5ddc4Srjs   GLboolean transpose = cmd->transpose;
116196c5ddc4Srjs   GLfloat * value;
116296c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
116396c5ddc4Srjs   value = (GLfloat *) variable_data;
116496c5ddc4Srjs   CALL_ProgramUniformMatrix2x4fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
116596c5ddc4Srjs   return cmd->cmd_base.cmd_size;
116696c5ddc4Srjs}
116796c5ddc4Srjsvoid GLAPIENTRY
116896c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
116996c5ddc4Srjs{
117096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
117196c5ddc4Srjs   int value_size = safe_mul(count, 8 * sizeof(GLfloat));
117296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix2x4fv) + value_size;
117396c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix2x4fv *cmd;
117496c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
117596c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix2x4fv");
117696c5ddc4Srjs      CALL_ProgramUniformMatrix2x4fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
117796c5ddc4Srjs      return;
117896c5ddc4Srjs   }
117996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix2x4fv, cmd_size);
118096c5ddc4Srjs   cmd->program = program;
118196c5ddc4Srjs   cmd->location = location;
118296c5ddc4Srjs   cmd->count = count;
118396c5ddc4Srjs   cmd->transpose = transpose;
118496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
118596c5ddc4Srjs   memcpy(variable_data, value, value_size);
118696c5ddc4Srjs}
118796c5ddc4Srjs
118896c5ddc4Srjs
118996c5ddc4Srjs/* ProgramUniformMatrix4x2fv: marshalled asynchronously */
119096c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix4x2fv
119196c5ddc4Srjs{
119296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
119396c5ddc4Srjs   GLboolean transpose;
119496c5ddc4Srjs   GLuint program;
119596c5ddc4Srjs   GLint location;
119696c5ddc4Srjs   GLsizei count;
119796c5ddc4Srjs   /* Next safe_mul(count, 8 * sizeof(GLfloat)) bytes are GLfloat value[count][8] */
119896c5ddc4Srjs};
119996c5ddc4Srjsuint32_t
120096c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix4x2fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix4x2fv *cmd, const uint64_t *last)
120196c5ddc4Srjs{
120296c5ddc4Srjs   GLuint program = cmd->program;
120396c5ddc4Srjs   GLint location = cmd->location;
120496c5ddc4Srjs   GLsizei count = cmd->count;
120596c5ddc4Srjs   GLboolean transpose = cmd->transpose;
120696c5ddc4Srjs   GLfloat * value;
120796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
120896c5ddc4Srjs   value = (GLfloat *) variable_data;
120996c5ddc4Srjs   CALL_ProgramUniformMatrix4x2fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
121096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
121196c5ddc4Srjs}
121296c5ddc4Srjsvoid GLAPIENTRY
121396c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
121496c5ddc4Srjs{
121596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
121696c5ddc4Srjs   int value_size = safe_mul(count, 8 * sizeof(GLfloat));
121796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix4x2fv) + value_size;
121896c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix4x2fv *cmd;
121996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
122096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix4x2fv");
122196c5ddc4Srjs      CALL_ProgramUniformMatrix4x2fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
122296c5ddc4Srjs      return;
122396c5ddc4Srjs   }
122496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix4x2fv, cmd_size);
122596c5ddc4Srjs   cmd->program = program;
122696c5ddc4Srjs   cmd->location = location;
122796c5ddc4Srjs   cmd->count = count;
122896c5ddc4Srjs   cmd->transpose = transpose;
122996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
123096c5ddc4Srjs   memcpy(variable_data, value, value_size);
123196c5ddc4Srjs}
123296c5ddc4Srjs
123396c5ddc4Srjs
123496c5ddc4Srjs/* ProgramUniformMatrix3x4fv: marshalled asynchronously */
123596c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix3x4fv
123696c5ddc4Srjs{
123796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
123896c5ddc4Srjs   GLboolean transpose;
123996c5ddc4Srjs   GLuint program;
124096c5ddc4Srjs   GLint location;
124196c5ddc4Srjs   GLsizei count;
124296c5ddc4Srjs   /* Next safe_mul(count, 12 * sizeof(GLfloat)) bytes are GLfloat value[count][12] */
124396c5ddc4Srjs};
124496c5ddc4Srjsuint32_t
124596c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix3x4fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix3x4fv *cmd, const uint64_t *last)
124696c5ddc4Srjs{
124796c5ddc4Srjs   GLuint program = cmd->program;
124896c5ddc4Srjs   GLint location = cmd->location;
124996c5ddc4Srjs   GLsizei count = cmd->count;
125096c5ddc4Srjs   GLboolean transpose = cmd->transpose;
125196c5ddc4Srjs   GLfloat * value;
125296c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
125396c5ddc4Srjs   value = (GLfloat *) variable_data;
125496c5ddc4Srjs   CALL_ProgramUniformMatrix3x4fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
125596c5ddc4Srjs   return cmd->cmd_base.cmd_size;
125696c5ddc4Srjs}
125796c5ddc4Srjsvoid GLAPIENTRY
125896c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
125996c5ddc4Srjs{
126096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
126196c5ddc4Srjs   int value_size = safe_mul(count, 12 * sizeof(GLfloat));
126296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix3x4fv) + value_size;
126396c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix3x4fv *cmd;
126496c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
126596c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix3x4fv");
126696c5ddc4Srjs      CALL_ProgramUniformMatrix3x4fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
126796c5ddc4Srjs      return;
126896c5ddc4Srjs   }
126996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix3x4fv, cmd_size);
127096c5ddc4Srjs   cmd->program = program;
127196c5ddc4Srjs   cmd->location = location;
127296c5ddc4Srjs   cmd->count = count;
127396c5ddc4Srjs   cmd->transpose = transpose;
127496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
127596c5ddc4Srjs   memcpy(variable_data, value, value_size);
127696c5ddc4Srjs}
127796c5ddc4Srjs
127896c5ddc4Srjs
127996c5ddc4Srjs/* ProgramUniformMatrix4x3fv: marshalled asynchronously */
128096c5ddc4Srjsstruct marshal_cmd_ProgramUniformMatrix4x3fv
128196c5ddc4Srjs{
128296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
128396c5ddc4Srjs   GLboolean transpose;
128496c5ddc4Srjs   GLuint program;
128596c5ddc4Srjs   GLint location;
128696c5ddc4Srjs   GLsizei count;
128796c5ddc4Srjs   /* Next safe_mul(count, 12 * sizeof(GLfloat)) bytes are GLfloat value[count][12] */
128896c5ddc4Srjs};
128996c5ddc4Srjsuint32_t
129096c5ddc4Srjs_mesa_unmarshal_ProgramUniformMatrix4x3fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix4x3fv *cmd, const uint64_t *last)
129196c5ddc4Srjs{
129296c5ddc4Srjs   GLuint program = cmd->program;
129396c5ddc4Srjs   GLint location = cmd->location;
129496c5ddc4Srjs   GLsizei count = cmd->count;
129596c5ddc4Srjs   GLboolean transpose = cmd->transpose;
129696c5ddc4Srjs   GLfloat * value;
129796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
129896c5ddc4Srjs   value = (GLfloat *) variable_data;
129996c5ddc4Srjs   CALL_ProgramUniformMatrix4x3fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
130096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
130196c5ddc4Srjs}
130296c5ddc4Srjsvoid GLAPIENTRY
130396c5ddc4Srjs_mesa_marshal_ProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
130496c5ddc4Srjs{
130596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
130696c5ddc4Srjs   int value_size = safe_mul(count, 12 * sizeof(GLfloat));
130796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix4x3fv) + value_size;
130896c5ddc4Srjs   struct marshal_cmd_ProgramUniformMatrix4x3fv *cmd;
130996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
131096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix4x3fv");
131196c5ddc4Srjs      CALL_ProgramUniformMatrix4x3fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
131296c5ddc4Srjs      return;
131396c5ddc4Srjs   }
131496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix4x3fv, cmd_size);
131596c5ddc4Srjs   cmd->program = program;
131696c5ddc4Srjs   cmd->location = location;
131796c5ddc4Srjs   cmd->count = count;
131896c5ddc4Srjs   cmd->transpose = transpose;
131996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
132096c5ddc4Srjs   memcpy(variable_data, value, value_size);
132196c5ddc4Srjs}
132296c5ddc4Srjs
132396c5ddc4Srjs
132496c5ddc4Srjs/* ValidateProgramPipeline: marshalled asynchronously */
132596c5ddc4Srjsstruct marshal_cmd_ValidateProgramPipeline
132696c5ddc4Srjs{
132796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
132896c5ddc4Srjs   GLuint pipeline;
132996c5ddc4Srjs};
133096c5ddc4Srjsuint32_t
133196c5ddc4Srjs_mesa_unmarshal_ValidateProgramPipeline(struct gl_context *ctx, const struct marshal_cmd_ValidateProgramPipeline *cmd, const uint64_t *last)
133296c5ddc4Srjs{
133396c5ddc4Srjs   GLuint pipeline = cmd->pipeline;
133496c5ddc4Srjs   CALL_ValidateProgramPipeline(ctx->CurrentServerDispatch, (pipeline));
133596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ValidateProgramPipeline), 8) / 8);
133696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
133796c5ddc4Srjs   return cmd_size;
133896c5ddc4Srjs}
133996c5ddc4Srjsvoid GLAPIENTRY
134096c5ddc4Srjs_mesa_marshal_ValidateProgramPipeline(GLuint pipeline)
134196c5ddc4Srjs{
134296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
134396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ValidateProgramPipeline);
134496c5ddc4Srjs   struct marshal_cmd_ValidateProgramPipeline *cmd;
134596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ValidateProgramPipeline, cmd_size);
134696c5ddc4Srjs   cmd->pipeline = pipeline;
134796c5ddc4Srjs}
134896c5ddc4Srjs
134996c5ddc4Srjs
135096c5ddc4Srjs/* GetProgramPipelineInfoLog: marshalled synchronously */
135196c5ddc4Srjsvoid GLAPIENTRY
135296c5ddc4Srjs_mesa_marshal_GetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei * length, GLchar * infoLog)
135396c5ddc4Srjs{
135496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
135596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramPipelineInfoLog");
135696c5ddc4Srjs   CALL_GetProgramPipelineInfoLog(ctx->CurrentServerDispatch, (pipeline, bufSize, length, infoLog));
135796c5ddc4Srjs}
135896c5ddc4Srjs
135996c5ddc4Srjs
136096c5ddc4Srjs/* VertexAttribL1d: marshalled asynchronously */
136196c5ddc4Srjsstruct marshal_cmd_VertexAttribL1d
136296c5ddc4Srjs{
136396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
136496c5ddc4Srjs   GLuint index;
136596c5ddc4Srjs   GLdouble x;
136696c5ddc4Srjs};
136796c5ddc4Srjsuint32_t
136896c5ddc4Srjs_mesa_unmarshal_VertexAttribL1d(struct gl_context *ctx, const struct marshal_cmd_VertexAttribL1d *cmd, const uint64_t *last)
136996c5ddc4Srjs{
137096c5ddc4Srjs   GLuint index = cmd->index;
137196c5ddc4Srjs   GLdouble x = cmd->x;
137296c5ddc4Srjs   CALL_VertexAttribL1d(ctx->CurrentServerDispatch, (index, x));
137396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribL1d), 8) / 8);
137496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
137596c5ddc4Srjs   return cmd_size;
137696c5ddc4Srjs}
137796c5ddc4Srjsvoid GLAPIENTRY
137896c5ddc4Srjs_mesa_marshal_VertexAttribL1d(GLuint index, GLdouble x)
137996c5ddc4Srjs{
138096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
138196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribL1d);
138296c5ddc4Srjs   struct marshal_cmd_VertexAttribL1d *cmd;
138396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribL1d, cmd_size);
138496c5ddc4Srjs   cmd->index = index;
138596c5ddc4Srjs   cmd->x = x;
138696c5ddc4Srjs}
138796c5ddc4Srjs
138896c5ddc4Srjs
138996c5ddc4Srjs/* VertexAttribL2d: marshalled asynchronously */
139096c5ddc4Srjsstruct marshal_cmd_VertexAttribL2d
139196c5ddc4Srjs{
139296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
139396c5ddc4Srjs   GLuint index;
139496c5ddc4Srjs   GLdouble x;
139596c5ddc4Srjs   GLdouble y;
139696c5ddc4Srjs};
139796c5ddc4Srjsuint32_t
139896c5ddc4Srjs_mesa_unmarshal_VertexAttribL2d(struct gl_context *ctx, const struct marshal_cmd_VertexAttribL2d *cmd, const uint64_t *last)
139996c5ddc4Srjs{
140096c5ddc4Srjs   GLuint index = cmd->index;
140196c5ddc4Srjs   GLdouble x = cmd->x;
140296c5ddc4Srjs   GLdouble y = cmd->y;
140396c5ddc4Srjs   CALL_VertexAttribL2d(ctx->CurrentServerDispatch, (index, x, y));
140496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribL2d), 8) / 8);
140596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
140696c5ddc4Srjs   return cmd_size;
140796c5ddc4Srjs}
140896c5ddc4Srjsvoid GLAPIENTRY
140996c5ddc4Srjs_mesa_marshal_VertexAttribL2d(GLuint index, GLdouble x, GLdouble y)
141096c5ddc4Srjs{
141196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
141296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribL2d);
141396c5ddc4Srjs   struct marshal_cmd_VertexAttribL2d *cmd;
141496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribL2d, cmd_size);
141596c5ddc4Srjs   cmd->index = index;
141696c5ddc4Srjs   cmd->x = x;
141796c5ddc4Srjs   cmd->y = y;
141896c5ddc4Srjs}
141996c5ddc4Srjs
142096c5ddc4Srjs
142196c5ddc4Srjs/* VertexAttribL3d: marshalled asynchronously */
142296c5ddc4Srjsstruct marshal_cmd_VertexAttribL3d
142396c5ddc4Srjs{
142496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
142596c5ddc4Srjs   GLuint index;
142696c5ddc4Srjs   GLdouble x;
142796c5ddc4Srjs   GLdouble y;
142896c5ddc4Srjs   GLdouble z;
142996c5ddc4Srjs};
143096c5ddc4Srjsuint32_t
143196c5ddc4Srjs_mesa_unmarshal_VertexAttribL3d(struct gl_context *ctx, const struct marshal_cmd_VertexAttribL3d *cmd, const uint64_t *last)
143296c5ddc4Srjs{
143396c5ddc4Srjs   GLuint index = cmd->index;
143496c5ddc4Srjs   GLdouble x = cmd->x;
143596c5ddc4Srjs   GLdouble y = cmd->y;
143696c5ddc4Srjs   GLdouble z = cmd->z;
143796c5ddc4Srjs   CALL_VertexAttribL3d(ctx->CurrentServerDispatch, (index, x, y, z));
143896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribL3d), 8) / 8);
143996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
144096c5ddc4Srjs   return cmd_size;
144196c5ddc4Srjs}
144296c5ddc4Srjsvoid GLAPIENTRY
144396c5ddc4Srjs_mesa_marshal_VertexAttribL3d(GLuint index, GLdouble x, GLdouble y, GLdouble z)
144496c5ddc4Srjs{
144596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
144696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribL3d);
144796c5ddc4Srjs   struct marshal_cmd_VertexAttribL3d *cmd;
144896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribL3d, cmd_size);
144996c5ddc4Srjs   cmd->index = index;
145096c5ddc4Srjs   cmd->x = x;
145196c5ddc4Srjs   cmd->y = y;
145296c5ddc4Srjs   cmd->z = z;
145396c5ddc4Srjs}
145496c5ddc4Srjs
145596c5ddc4Srjs
145696c5ddc4Srjs/* VertexAttribL4d: marshalled asynchronously */
145796c5ddc4Srjsstruct marshal_cmd_VertexAttribL4d
145896c5ddc4Srjs{
145996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
146096c5ddc4Srjs   GLuint index;
146196c5ddc4Srjs   GLdouble x;
146296c5ddc4Srjs   GLdouble y;
146396c5ddc4Srjs   GLdouble z;
146496c5ddc4Srjs   GLdouble w;
146596c5ddc4Srjs};
146696c5ddc4Srjsuint32_t
146796c5ddc4Srjs_mesa_unmarshal_VertexAttribL4d(struct gl_context *ctx, const struct marshal_cmd_VertexAttribL4d *cmd, const uint64_t *last)
146896c5ddc4Srjs{
146996c5ddc4Srjs   GLuint index = cmd->index;
147096c5ddc4Srjs   GLdouble x = cmd->x;
147196c5ddc4Srjs   GLdouble y = cmd->y;
147296c5ddc4Srjs   GLdouble z = cmd->z;
147396c5ddc4Srjs   GLdouble w = cmd->w;
147496c5ddc4Srjs   CALL_VertexAttribL4d(ctx->CurrentServerDispatch, (index, x, y, z, w));
147596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribL4d), 8) / 8);
147696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
147796c5ddc4Srjs   return cmd_size;
147896c5ddc4Srjs}
147996c5ddc4Srjsvoid GLAPIENTRY
148096c5ddc4Srjs_mesa_marshal_VertexAttribL4d(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
148196c5ddc4Srjs{
148296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
148396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribL4d);
148496c5ddc4Srjs   struct marshal_cmd_VertexAttribL4d *cmd;
148596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribL4d, cmd_size);
148696c5ddc4Srjs   cmd->index = index;
148796c5ddc4Srjs   cmd->x = x;
148896c5ddc4Srjs   cmd->y = y;
148996c5ddc4Srjs   cmd->z = z;
149096c5ddc4Srjs   cmd->w = w;
149196c5ddc4Srjs}
149296c5ddc4Srjs
149396c5ddc4Srjs
149496c5ddc4Srjs/* VertexAttribL1dv: marshalled asynchronously */
149596c5ddc4Srjsstruct marshal_cmd_VertexAttribL1dv
149696c5ddc4Srjs{
149796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
149896c5ddc4Srjs   GLuint index;
149996c5ddc4Srjs   GLdouble v[1];
150096c5ddc4Srjs};
150196c5ddc4Srjsuint32_t
150296c5ddc4Srjs_mesa_unmarshal_VertexAttribL1dv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribL1dv *cmd, const uint64_t *last)
150396c5ddc4Srjs{
150496c5ddc4Srjs   GLuint index = cmd->index;
150596c5ddc4Srjs   const GLdouble * v = cmd->v;
150696c5ddc4Srjs   CALL_VertexAttribL1dv(ctx->CurrentServerDispatch, (index, v));
150796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribL1dv), 8) / 8);
150896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
150996c5ddc4Srjs   return cmd_size;
151096c5ddc4Srjs}
151196c5ddc4Srjsvoid GLAPIENTRY
151296c5ddc4Srjs_mesa_marshal_VertexAttribL1dv(GLuint index, const GLdouble * v)
151396c5ddc4Srjs{
151496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
151596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribL1dv);
151696c5ddc4Srjs   struct marshal_cmd_VertexAttribL1dv *cmd;
151796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribL1dv, cmd_size);
151896c5ddc4Srjs   cmd->index = index;
151996c5ddc4Srjs   memcpy(cmd->v, v, 1 * sizeof(GLdouble));
152096c5ddc4Srjs}
152196c5ddc4Srjs
152296c5ddc4Srjs
152396c5ddc4Srjs/* VertexAttribL2dv: marshalled asynchronously */
152496c5ddc4Srjsstruct marshal_cmd_VertexAttribL2dv
152596c5ddc4Srjs{
152696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
152796c5ddc4Srjs   GLuint index;
152896c5ddc4Srjs   GLdouble v[2];
152996c5ddc4Srjs};
153096c5ddc4Srjsuint32_t
153196c5ddc4Srjs_mesa_unmarshal_VertexAttribL2dv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribL2dv *cmd, const uint64_t *last)
153296c5ddc4Srjs{
153396c5ddc4Srjs   GLuint index = cmd->index;
153496c5ddc4Srjs   const GLdouble * v = cmd->v;
153596c5ddc4Srjs   CALL_VertexAttribL2dv(ctx->CurrentServerDispatch, (index, v));
153696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribL2dv), 8) / 8);
153796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
153896c5ddc4Srjs   return cmd_size;
153996c5ddc4Srjs}
154096c5ddc4Srjsvoid GLAPIENTRY
154196c5ddc4Srjs_mesa_marshal_VertexAttribL2dv(GLuint index, const GLdouble * v)
154296c5ddc4Srjs{
154396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
154496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribL2dv);
154596c5ddc4Srjs   struct marshal_cmd_VertexAttribL2dv *cmd;
154696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribL2dv, cmd_size);
154796c5ddc4Srjs   cmd->index = index;
154896c5ddc4Srjs   memcpy(cmd->v, v, 2 * sizeof(GLdouble));
154996c5ddc4Srjs}
155096c5ddc4Srjs
155196c5ddc4Srjs
155296c5ddc4Srjs/* VertexAttribL3dv: marshalled asynchronously */
155396c5ddc4Srjsstruct marshal_cmd_VertexAttribL3dv
155496c5ddc4Srjs{
155596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
155696c5ddc4Srjs   GLuint index;
155796c5ddc4Srjs   GLdouble v[3];
155896c5ddc4Srjs};
155996c5ddc4Srjsuint32_t
156096c5ddc4Srjs_mesa_unmarshal_VertexAttribL3dv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribL3dv *cmd, const uint64_t *last)
156196c5ddc4Srjs{
156296c5ddc4Srjs   GLuint index = cmd->index;
156396c5ddc4Srjs   const GLdouble * v = cmd->v;
156496c5ddc4Srjs   CALL_VertexAttribL3dv(ctx->CurrentServerDispatch, (index, v));
156596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribL3dv), 8) / 8);
156696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
156796c5ddc4Srjs   return cmd_size;
156896c5ddc4Srjs}
156996c5ddc4Srjsvoid GLAPIENTRY
157096c5ddc4Srjs_mesa_marshal_VertexAttribL3dv(GLuint index, const GLdouble * v)
157196c5ddc4Srjs{
157296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
157396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribL3dv);
157496c5ddc4Srjs   struct marshal_cmd_VertexAttribL3dv *cmd;
157596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribL3dv, cmd_size);
157696c5ddc4Srjs   cmd->index = index;
157796c5ddc4Srjs   memcpy(cmd->v, v, 3 * sizeof(GLdouble));
157896c5ddc4Srjs}
157996c5ddc4Srjs
158096c5ddc4Srjs
158196c5ddc4Srjs/* VertexAttribL4dv: marshalled asynchronously */
158296c5ddc4Srjsstruct marshal_cmd_VertexAttribL4dv
158396c5ddc4Srjs{
158496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
158596c5ddc4Srjs   GLuint index;
158696c5ddc4Srjs   GLdouble v[4];
158796c5ddc4Srjs};
158896c5ddc4Srjsuint32_t
158996c5ddc4Srjs_mesa_unmarshal_VertexAttribL4dv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribL4dv *cmd, const uint64_t *last)
159096c5ddc4Srjs{
159196c5ddc4Srjs   GLuint index = cmd->index;
159296c5ddc4Srjs   const GLdouble * v = cmd->v;
159396c5ddc4Srjs   CALL_VertexAttribL4dv(ctx->CurrentServerDispatch, (index, v));
159496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribL4dv), 8) / 8);
159596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
159696c5ddc4Srjs   return cmd_size;
159796c5ddc4Srjs}
159896c5ddc4Srjsvoid GLAPIENTRY
159996c5ddc4Srjs_mesa_marshal_VertexAttribL4dv(GLuint index, const GLdouble * v)
160096c5ddc4Srjs{
160196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
160296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribL4dv);
160396c5ddc4Srjs   struct marshal_cmd_VertexAttribL4dv *cmd;
160496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribL4dv, cmd_size);
160596c5ddc4Srjs   cmd->index = index;
160696c5ddc4Srjs   memcpy(cmd->v, v, 4 * sizeof(GLdouble));
160796c5ddc4Srjs}
160896c5ddc4Srjs
160996c5ddc4Srjs
161096c5ddc4Srjs/* VertexAttribLPointer: marshalled asynchronously */
161196c5ddc4Srjsstruct marshal_cmd_VertexAttribLPointer
161296c5ddc4Srjs{
161396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
161496c5ddc4Srjs   GLuint index;
161596c5ddc4Srjs   GLint size;
161696c5ddc4Srjs   GLenum type;
161796c5ddc4Srjs   GLsizei stride;
161896c5ddc4Srjs   const GLvoid * pointer;
161996c5ddc4Srjs};
162096c5ddc4Srjsuint32_t
162196c5ddc4Srjs_mesa_unmarshal_VertexAttribLPointer(struct gl_context *ctx, const struct marshal_cmd_VertexAttribLPointer *cmd, const uint64_t *last)
162296c5ddc4Srjs{
162396c5ddc4Srjs   GLuint index = cmd->index;
162496c5ddc4Srjs   GLint size = cmd->size;
162596c5ddc4Srjs   GLenum type = cmd->type;
162696c5ddc4Srjs   GLsizei stride = cmd->stride;
162796c5ddc4Srjs   const GLvoid * pointer = cmd->pointer;
162896c5ddc4Srjs   CALL_VertexAttribLPointer(ctx->CurrentServerDispatch, (index, size, type, stride, pointer));
162996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribLPointer), 8) / 8);
163096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
163196c5ddc4Srjs   return cmd_size;
163296c5ddc4Srjs}
163396c5ddc4Srjsvoid GLAPIENTRY
163496c5ddc4Srjs_mesa_marshal_VertexAttribLPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
163596c5ddc4Srjs{
163696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
163796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribLPointer);
163896c5ddc4Srjs   struct marshal_cmd_VertexAttribLPointer *cmd;
163996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribLPointer, cmd_size);
164096c5ddc4Srjs   cmd->index = index;
164196c5ddc4Srjs   cmd->size = size;
164296c5ddc4Srjs   cmd->type = type;
164396c5ddc4Srjs   cmd->stride = stride;
164496c5ddc4Srjs   cmd->pointer = pointer;
164596c5ddc4Srjs   if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_GENERIC(index), size, type, stride, pointer);
164696c5ddc4Srjs}
164796c5ddc4Srjs
164896c5ddc4Srjs
164996c5ddc4Srjs/* GetVertexAttribLdv: marshalled synchronously */
165096c5ddc4Srjsvoid GLAPIENTRY
165196c5ddc4Srjs_mesa_marshal_GetVertexAttribLdv(GLuint index, GLenum pname, GLdouble * params)
165296c5ddc4Srjs{
165396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
165496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetVertexAttribLdv");
165596c5ddc4Srjs   CALL_GetVertexAttribLdv(ctx->CurrentServerDispatch, (index, pname, params));
165696c5ddc4Srjs}
165796c5ddc4Srjs
165896c5ddc4Srjs
165996c5ddc4Srjs/* VertexArrayVertexAttribLOffsetEXT: marshalled asynchronously */
166096c5ddc4Srjsstruct marshal_cmd_VertexArrayVertexAttribLOffsetEXT
166196c5ddc4Srjs{
166296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
166396c5ddc4Srjs   GLuint vaobj;
166496c5ddc4Srjs   GLuint buffer;
166596c5ddc4Srjs   GLuint index;
166696c5ddc4Srjs   GLint size;
166796c5ddc4Srjs   GLenum type;
166896c5ddc4Srjs   GLsizei stride;
166996c5ddc4Srjs   GLintptr offset;
167096c5ddc4Srjs};
167196c5ddc4Srjsuint32_t
167296c5ddc4Srjs_mesa_unmarshal_VertexArrayVertexAttribLOffsetEXT(struct gl_context *ctx, const struct marshal_cmd_VertexArrayVertexAttribLOffsetEXT *cmd, const uint64_t *last)
167396c5ddc4Srjs{
167496c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
167596c5ddc4Srjs   GLuint buffer = cmd->buffer;
167696c5ddc4Srjs   GLuint index = cmd->index;
167796c5ddc4Srjs   GLint size = cmd->size;
167896c5ddc4Srjs   GLenum type = cmd->type;
167996c5ddc4Srjs   GLsizei stride = cmd->stride;
168096c5ddc4Srjs   GLintptr offset = cmd->offset;
168196c5ddc4Srjs   CALL_VertexArrayVertexAttribLOffsetEXT(ctx->CurrentServerDispatch, (vaobj, buffer, index, size, type, stride, offset));
168296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexArrayVertexAttribLOffsetEXT), 8) / 8);
168396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
168496c5ddc4Srjs   return cmd_size;
168596c5ddc4Srjs}
168696c5ddc4Srjsvoid GLAPIENTRY
168796c5ddc4Srjs_mesa_marshal_VertexArrayVertexAttribLOffsetEXT(GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset)
168896c5ddc4Srjs{
168996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
169096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexArrayVertexAttribLOffsetEXT);
169196c5ddc4Srjs   struct marshal_cmd_VertexArrayVertexAttribLOffsetEXT *cmd;
169296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayVertexAttribLOffsetEXT, cmd_size);
169396c5ddc4Srjs   cmd->vaobj = vaobj;
169496c5ddc4Srjs   cmd->buffer = buffer;
169596c5ddc4Srjs   cmd->index = index;
169696c5ddc4Srjs   cmd->size = size;
169796c5ddc4Srjs   cmd->type = type;
169896c5ddc4Srjs   cmd->stride = stride;
169996c5ddc4Srjs   cmd->offset = offset;
170096c5ddc4Srjs   if (COMPAT) _mesa_glthread_DSAAttribPointer(ctx, vaobj, buffer, VERT_ATTRIB_GENERIC(index), size, type, stride, offset);
170196c5ddc4Srjs}
170296c5ddc4Srjs
170396c5ddc4Srjs
170496c5ddc4Srjs/* GetShaderPrecisionFormat: marshalled synchronously */
170596c5ddc4Srjsvoid GLAPIENTRY
170696c5ddc4Srjs_mesa_marshal_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision)
170796c5ddc4Srjs{
170896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
170996c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetShaderPrecisionFormat");
171096c5ddc4Srjs   CALL_GetShaderPrecisionFormat(ctx->CurrentServerDispatch, (shadertype, precisiontype, range, precision));
171196c5ddc4Srjs}
171296c5ddc4Srjs
171396c5ddc4Srjs
171496c5ddc4Srjs/* ReleaseShaderCompiler: marshalled asynchronously */
171596c5ddc4Srjsstruct marshal_cmd_ReleaseShaderCompiler
171696c5ddc4Srjs{
171796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
171896c5ddc4Srjs};
171996c5ddc4Srjsuint32_t
172096c5ddc4Srjs_mesa_unmarshal_ReleaseShaderCompiler(struct gl_context *ctx, const struct marshal_cmd_ReleaseShaderCompiler *cmd, const uint64_t *last)
172196c5ddc4Srjs{
172296c5ddc4Srjs   CALL_ReleaseShaderCompiler(ctx->CurrentServerDispatch, ());
172396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ReleaseShaderCompiler), 8) / 8);
172496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
172596c5ddc4Srjs   return cmd_size;
172696c5ddc4Srjs}
172796c5ddc4Srjsvoid GLAPIENTRY
172896c5ddc4Srjs_mesa_marshal_ReleaseShaderCompiler(void)
172996c5ddc4Srjs{
173096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
173196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ReleaseShaderCompiler);
173296c5ddc4Srjs   struct marshal_cmd_ReleaseShaderCompiler *cmd;
173396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ReleaseShaderCompiler, cmd_size);
173496c5ddc4Srjs   (void) cmd;
173596c5ddc4Srjs}
173696c5ddc4Srjs
173796c5ddc4Srjs
173896c5ddc4Srjs/* ShaderBinary: marshalled asynchronously */
173996c5ddc4Srjsstruct marshal_cmd_ShaderBinary
174096c5ddc4Srjs{
174196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
174296c5ddc4Srjs   GLsizei n;
174396c5ddc4Srjs   GLenum binaryformat;
174496c5ddc4Srjs   GLsizei length;
174596c5ddc4Srjs   /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint shaders[n] */
174696c5ddc4Srjs   /* Next length bytes are GLvoid binary[length] */
174796c5ddc4Srjs};
174896c5ddc4Srjsuint32_t
174996c5ddc4Srjs_mesa_unmarshal_ShaderBinary(struct gl_context *ctx, const struct marshal_cmd_ShaderBinary *cmd, const uint64_t *last)
175096c5ddc4Srjs{
175196c5ddc4Srjs   GLsizei n = cmd->n;
175296c5ddc4Srjs   GLenum binaryformat = cmd->binaryformat;
175396c5ddc4Srjs   GLsizei length = cmd->length;
175496c5ddc4Srjs   GLuint * shaders;
175596c5ddc4Srjs   GLvoid * binary;
175696c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
175796c5ddc4Srjs   shaders = (GLuint *) variable_data;
175896c5ddc4Srjs   variable_data += n * 1 * sizeof(GLuint);
175996c5ddc4Srjs   binary = (GLvoid *) variable_data;
176096c5ddc4Srjs   CALL_ShaderBinary(ctx->CurrentServerDispatch, (n, shaders, binaryformat, binary, length));
176196c5ddc4Srjs   return cmd->cmd_base.cmd_size;
176296c5ddc4Srjs}
176396c5ddc4Srjsvoid GLAPIENTRY
176496c5ddc4Srjs_mesa_marshal_ShaderBinary(GLsizei n, const GLuint * shaders, GLenum binaryformat, const GLvoid * binary, GLsizei length)
176596c5ddc4Srjs{
176696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
176796c5ddc4Srjs   int shaders_size = safe_mul(n, 1 * sizeof(GLuint));
176896c5ddc4Srjs   int binary_size = length;
176996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ShaderBinary) + shaders_size + binary_size;
177096c5ddc4Srjs   struct marshal_cmd_ShaderBinary *cmd;
177196c5ddc4Srjs   if (unlikely(shaders_size < 0 || (shaders_size > 0 && !shaders) || binary_size < 0 || (binary_size > 0 && !binary) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
177296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ShaderBinary");
177396c5ddc4Srjs      CALL_ShaderBinary(ctx->CurrentServerDispatch, (n, shaders, binaryformat, binary, length));
177496c5ddc4Srjs      return;
177596c5ddc4Srjs   }
177696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ShaderBinary, cmd_size);
177796c5ddc4Srjs   cmd->n = n;
177896c5ddc4Srjs   cmd->binaryformat = binaryformat;
177996c5ddc4Srjs   cmd->length = length;
178096c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
178196c5ddc4Srjs   memcpy(variable_data, shaders, shaders_size);
178296c5ddc4Srjs   variable_data += shaders_size;
178396c5ddc4Srjs   memcpy(variable_data, binary, binary_size);
178496c5ddc4Srjs}
178596c5ddc4Srjs
178696c5ddc4Srjs
178796c5ddc4Srjs/* ClearDepthf: marshalled asynchronously */
178896c5ddc4Srjsstruct marshal_cmd_ClearDepthf
178996c5ddc4Srjs{
179096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
179196c5ddc4Srjs   GLclampf depth;
179296c5ddc4Srjs};
179396c5ddc4Srjsuint32_t
179496c5ddc4Srjs_mesa_unmarshal_ClearDepthf(struct gl_context *ctx, const struct marshal_cmd_ClearDepthf *cmd, const uint64_t *last)
179596c5ddc4Srjs{
179696c5ddc4Srjs   GLclampf depth = cmd->depth;
179796c5ddc4Srjs   CALL_ClearDepthf(ctx->CurrentServerDispatch, (depth));
179896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ClearDepthf), 8) / 8);
179996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
180096c5ddc4Srjs   return cmd_size;
180196c5ddc4Srjs}
180296c5ddc4Srjsvoid GLAPIENTRY
180396c5ddc4Srjs_mesa_marshal_ClearDepthf(GLclampf depth)
180496c5ddc4Srjs{
180596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
180696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ClearDepthf);
180796c5ddc4Srjs   struct marshal_cmd_ClearDepthf *cmd;
180896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearDepthf, cmd_size);
180996c5ddc4Srjs   cmd->depth = depth;
181096c5ddc4Srjs}
181196c5ddc4Srjs
181296c5ddc4Srjs
181396c5ddc4Srjs/* DepthRangef: marshalled asynchronously */
181496c5ddc4Srjsstruct marshal_cmd_DepthRangef
181596c5ddc4Srjs{
181696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
181796c5ddc4Srjs   GLclampf zNear;
181896c5ddc4Srjs   GLclampf zFar;
181996c5ddc4Srjs};
182096c5ddc4Srjsuint32_t
182196c5ddc4Srjs_mesa_unmarshal_DepthRangef(struct gl_context *ctx, const struct marshal_cmd_DepthRangef *cmd, const uint64_t *last)
182296c5ddc4Srjs{
182396c5ddc4Srjs   GLclampf zNear = cmd->zNear;
182496c5ddc4Srjs   GLclampf zFar = cmd->zFar;
182596c5ddc4Srjs   CALL_DepthRangef(ctx->CurrentServerDispatch, (zNear, zFar));
182696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DepthRangef), 8) / 8);
182796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
182896c5ddc4Srjs   return cmd_size;
182996c5ddc4Srjs}
183096c5ddc4Srjsvoid GLAPIENTRY
183196c5ddc4Srjs_mesa_marshal_DepthRangef(GLclampf zNear, GLclampf zFar)
183296c5ddc4Srjs{
183396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
183496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DepthRangef);
183596c5ddc4Srjs   struct marshal_cmd_DepthRangef *cmd;
183696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DepthRangef, cmd_size);
183796c5ddc4Srjs   cmd->zNear = zNear;
183896c5ddc4Srjs   cmd->zFar = zFar;
183996c5ddc4Srjs}
184096c5ddc4Srjs
184196c5ddc4Srjs
184296c5ddc4Srjs/* GetProgramBinary: marshalled synchronously */
184396c5ddc4Srjsvoid GLAPIENTRY
184496c5ddc4Srjs_mesa_marshal_GetProgramBinary(GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, GLvoid * binary)
184596c5ddc4Srjs{
184696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
184796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramBinary");
184896c5ddc4Srjs   CALL_GetProgramBinary(ctx->CurrentServerDispatch, (program, bufSize, length, binaryFormat, binary));
184996c5ddc4Srjs}
185096c5ddc4Srjs
185196c5ddc4Srjs
185296c5ddc4Srjs/* ProgramBinary: marshalled asynchronously */
185396c5ddc4Srjsstruct marshal_cmd_ProgramBinary
185496c5ddc4Srjs{
185596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
185696c5ddc4Srjs   GLuint program;
185796c5ddc4Srjs   GLenum binaryFormat;
185896c5ddc4Srjs   GLsizei length;
185996c5ddc4Srjs   /* Next length bytes are GLvoid binary[length] */
186096c5ddc4Srjs};
186196c5ddc4Srjsuint32_t
186296c5ddc4Srjs_mesa_unmarshal_ProgramBinary(struct gl_context *ctx, const struct marshal_cmd_ProgramBinary *cmd, const uint64_t *last)
186396c5ddc4Srjs{
186496c5ddc4Srjs   GLuint program = cmd->program;
186596c5ddc4Srjs   GLenum binaryFormat = cmd->binaryFormat;
186696c5ddc4Srjs   GLsizei length = cmd->length;
186796c5ddc4Srjs   GLvoid * binary;
186896c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
186996c5ddc4Srjs   binary = (GLvoid *) variable_data;
187096c5ddc4Srjs   CALL_ProgramBinary(ctx->CurrentServerDispatch, (program, binaryFormat, binary, length));
187196c5ddc4Srjs   return cmd->cmd_base.cmd_size;
187296c5ddc4Srjs}
187396c5ddc4Srjsvoid GLAPIENTRY
187496c5ddc4Srjs_mesa_marshal_ProgramBinary(GLuint program, GLenum binaryFormat, const GLvoid * binary, GLsizei length)
187596c5ddc4Srjs{
187696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
187796c5ddc4Srjs   int binary_size = length;
187896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramBinary) + binary_size;
187996c5ddc4Srjs   struct marshal_cmd_ProgramBinary *cmd;
188096c5ddc4Srjs   if (unlikely(binary_size < 0 || (binary_size > 0 && !binary) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
188196c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramBinary");
188296c5ddc4Srjs      CALL_ProgramBinary(ctx->CurrentServerDispatch, (program, binaryFormat, binary, length));
188396c5ddc4Srjs      return;
188496c5ddc4Srjs   }
188596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramBinary, cmd_size);
188696c5ddc4Srjs   cmd->program = program;
188796c5ddc4Srjs   cmd->binaryFormat = binaryFormat;
188896c5ddc4Srjs   cmd->length = length;
188996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
189096c5ddc4Srjs   memcpy(variable_data, binary, binary_size);
189196c5ddc4Srjs}
189296c5ddc4Srjs
189396c5ddc4Srjs
189496c5ddc4Srjs/* ProgramParameteri: marshalled asynchronously */
189596c5ddc4Srjsstruct marshal_cmd_ProgramParameteri
189696c5ddc4Srjs{
189796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
189896c5ddc4Srjs   GLuint program;
189996c5ddc4Srjs   GLenum pname;
190096c5ddc4Srjs   GLint value;
190196c5ddc4Srjs};
190296c5ddc4Srjsuint32_t
190396c5ddc4Srjs_mesa_unmarshal_ProgramParameteri(struct gl_context *ctx, const struct marshal_cmd_ProgramParameteri *cmd, const uint64_t *last)
190496c5ddc4Srjs{
190596c5ddc4Srjs   GLuint program = cmd->program;
190696c5ddc4Srjs   GLenum pname = cmd->pname;
190796c5ddc4Srjs   GLint value = cmd->value;
190896c5ddc4Srjs   CALL_ProgramParameteri(ctx->CurrentServerDispatch, (program, pname, value));
190996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramParameteri), 8) / 8);
191096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
191196c5ddc4Srjs   return cmd_size;
191296c5ddc4Srjs}
191396c5ddc4Srjsvoid GLAPIENTRY
191496c5ddc4Srjs_mesa_marshal_ProgramParameteri(GLuint program, GLenum pname, GLint value)
191596c5ddc4Srjs{
191696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
191796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramParameteri);
191896c5ddc4Srjs   struct marshal_cmd_ProgramParameteri *cmd;
191996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramParameteri, cmd_size);
192096c5ddc4Srjs   cmd->program = program;
192196c5ddc4Srjs   cmd->pname = pname;
192296c5ddc4Srjs   cmd->value = value;
192396c5ddc4Srjs}
192496c5ddc4Srjs
192596c5ddc4Srjs
192696c5ddc4Srjs/* DebugMessageControl: marshalled asynchronously */
192796c5ddc4Srjsstruct marshal_cmd_DebugMessageControl
192896c5ddc4Srjs{
192996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
193096c5ddc4Srjs   GLboolean enabled;
193196c5ddc4Srjs   GLenum source;
193296c5ddc4Srjs   GLenum type;
193396c5ddc4Srjs   GLenum severity;
193496c5ddc4Srjs   GLsizei count;
193596c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLuint)) bytes are GLuint ids[count] */
193696c5ddc4Srjs};
193796c5ddc4Srjsuint32_t
193896c5ddc4Srjs_mesa_unmarshal_DebugMessageControl(struct gl_context *ctx, const struct marshal_cmd_DebugMessageControl *cmd, const uint64_t *last)
193996c5ddc4Srjs{
194096c5ddc4Srjs   GLenum source = cmd->source;
194196c5ddc4Srjs   GLenum type = cmd->type;
194296c5ddc4Srjs   GLenum severity = cmd->severity;
194396c5ddc4Srjs   GLsizei count = cmd->count;
194496c5ddc4Srjs   GLboolean enabled = cmd->enabled;
194596c5ddc4Srjs   GLuint * ids;
194696c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
194796c5ddc4Srjs   ids = (GLuint *) variable_data;
194896c5ddc4Srjs   CALL_DebugMessageControl(ctx->CurrentServerDispatch, (source, type, severity, count, ids, enabled));
194996c5ddc4Srjs   return cmd->cmd_base.cmd_size;
195096c5ddc4Srjs}
195196c5ddc4Srjsvoid GLAPIENTRY
195296c5ddc4Srjs_mesa_marshal_DebugMessageControl(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled)
195396c5ddc4Srjs{
195496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
195596c5ddc4Srjs   int ids_size = safe_mul(count, 1 * sizeof(GLuint));
195696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DebugMessageControl) + ids_size;
195796c5ddc4Srjs   struct marshal_cmd_DebugMessageControl *cmd;
195896c5ddc4Srjs   if (unlikely(ids_size < 0 || (ids_size > 0 && !ids) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
195996c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "DebugMessageControl");
196096c5ddc4Srjs      CALL_DebugMessageControl(ctx->CurrentServerDispatch, (source, type, severity, count, ids, enabled));
196196c5ddc4Srjs      return;
196296c5ddc4Srjs   }
196396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DebugMessageControl, cmd_size);
196496c5ddc4Srjs   cmd->source = source;
196596c5ddc4Srjs   cmd->type = type;
196696c5ddc4Srjs   cmd->severity = severity;
196796c5ddc4Srjs   cmd->count = count;
196896c5ddc4Srjs   cmd->enabled = enabled;
196996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
197096c5ddc4Srjs   memcpy(variable_data, ids, ids_size);
197196c5ddc4Srjs}
197296c5ddc4Srjs
197396c5ddc4Srjs
197496c5ddc4Srjs/* DebugMessageInsert: marshalled asynchronously */
197596c5ddc4Srjsstruct marshal_cmd_DebugMessageInsert
197696c5ddc4Srjs{
197796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
197896c5ddc4Srjs   GLenum source;
197996c5ddc4Srjs   GLenum type;
198096c5ddc4Srjs   GLuint id;
198196c5ddc4Srjs   GLenum severity;
198296c5ddc4Srjs   GLsizei length;
198396c5ddc4Srjs   /* Next length bytes are GLchar buf[length] */
198496c5ddc4Srjs};
198596c5ddc4Srjsuint32_t
198696c5ddc4Srjs_mesa_unmarshal_DebugMessageInsert(struct gl_context *ctx, const struct marshal_cmd_DebugMessageInsert *cmd, const uint64_t *last)
198796c5ddc4Srjs{
198896c5ddc4Srjs   GLenum source = cmd->source;
198996c5ddc4Srjs   GLenum type = cmd->type;
199096c5ddc4Srjs   GLuint id = cmd->id;
199196c5ddc4Srjs   GLenum severity = cmd->severity;
199296c5ddc4Srjs   GLsizei length = cmd->length;
199396c5ddc4Srjs   GLchar * buf;
199496c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
199596c5ddc4Srjs   buf = (GLchar *) variable_data;
199696c5ddc4Srjs   CALL_DebugMessageInsert(ctx->CurrentServerDispatch, (source, type, id, severity, length, buf));
199796c5ddc4Srjs   return cmd->cmd_base.cmd_size;
199896c5ddc4Srjs}
199996c5ddc4Srjsvoid GLAPIENTRY
200096c5ddc4Srjs_mesa_marshal_DebugMessageInsert(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf)
200196c5ddc4Srjs{
200296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
200396c5ddc4Srjs   int buf_size = length;
200496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DebugMessageInsert) + buf_size;
200596c5ddc4Srjs   struct marshal_cmd_DebugMessageInsert *cmd;
200696c5ddc4Srjs   if (unlikely(buf_size < 0 || (buf_size > 0 && !buf) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
200796c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "DebugMessageInsert");
200896c5ddc4Srjs      CALL_DebugMessageInsert(ctx->CurrentServerDispatch, (source, type, id, severity, length, buf));
200996c5ddc4Srjs      return;
201096c5ddc4Srjs   }
201196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DebugMessageInsert, cmd_size);
201296c5ddc4Srjs   cmd->source = source;
201396c5ddc4Srjs   cmd->type = type;
201496c5ddc4Srjs   cmd->id = id;
201596c5ddc4Srjs   cmd->severity = severity;
201696c5ddc4Srjs   cmd->length = length;
201796c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
201896c5ddc4Srjs   memcpy(variable_data, buf, buf_size);
201996c5ddc4Srjs}
202096c5ddc4Srjs
202196c5ddc4Srjs
202296c5ddc4Srjs/* DebugMessageCallback: marshalled synchronously */
202396c5ddc4Srjsvoid GLAPIENTRY
202496c5ddc4Srjs_mesa_marshal_DebugMessageCallback(GLDEBUGPROC callback, const GLvoid * userParam)
202596c5ddc4Srjs{
202696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
202796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "DebugMessageCallback");
202896c5ddc4Srjs   CALL_DebugMessageCallback(ctx->CurrentServerDispatch, (callback, userParam));
202996c5ddc4Srjs}
203096c5ddc4Srjs
203196c5ddc4Srjs
203296c5ddc4Srjs/* GetDebugMessageLog: marshalled synchronously */
203396c5ddc4SrjsGLuint GLAPIENTRY
203496c5ddc4Srjs_mesa_marshal_GetDebugMessageLog(GLuint count, GLsizei bufsize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog)
203596c5ddc4Srjs{
203696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
203796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetDebugMessageLog");
203896c5ddc4Srjs   return CALL_GetDebugMessageLog(ctx->CurrentServerDispatch, (count, bufsize, sources, types, ids, severities, lengths, messageLog));
203996c5ddc4Srjs}
204096c5ddc4Srjs
204196c5ddc4Srjs
204296c5ddc4Srjs/* GetGraphicsResetStatusARB: marshalled synchronously */
204396c5ddc4SrjsGLenum GLAPIENTRY
204496c5ddc4Srjs_mesa_marshal_GetGraphicsResetStatusARB(void)
204596c5ddc4Srjs{
204696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
204796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetGraphicsResetStatusARB");
204896c5ddc4Srjs   return CALL_GetGraphicsResetStatusARB(ctx->CurrentServerDispatch, ());
204996c5ddc4Srjs}
205096c5ddc4Srjs
205196c5ddc4Srjs
205296c5ddc4Srjs/* GetnMapdvARB: marshalled synchronously */
205396c5ddc4Srjsvoid GLAPIENTRY
205496c5ddc4Srjs_mesa_marshal_GetnMapdvARB(GLenum target, GLenum query, GLsizei bufSize, GLdouble * v)
205596c5ddc4Srjs{
205696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
205796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetnMapdvARB");
205896c5ddc4Srjs   CALL_GetnMapdvARB(ctx->CurrentServerDispatch, (target, query, bufSize, v));
205996c5ddc4Srjs}
206096c5ddc4Srjs
206196c5ddc4Srjs
206296c5ddc4Srjs/* GetnMapfvARB: marshalled synchronously */
206396c5ddc4Srjsvoid GLAPIENTRY
206496c5ddc4Srjs_mesa_marshal_GetnMapfvARB(GLenum target, GLenum query, GLsizei bufSize, GLfloat * v)
206596c5ddc4Srjs{
206696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
206796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetnMapfvARB");
206896c5ddc4Srjs   CALL_GetnMapfvARB(ctx->CurrentServerDispatch, (target, query, bufSize, v));
206996c5ddc4Srjs}
207096c5ddc4Srjs
207196c5ddc4Srjs
207296c5ddc4Srjs/* GetnMapivARB: marshalled synchronously */
207396c5ddc4Srjsvoid GLAPIENTRY
207496c5ddc4Srjs_mesa_marshal_GetnMapivARB(GLenum target, GLenum query, GLsizei bufSize, GLint * v)
207596c5ddc4Srjs{
207696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
207796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetnMapivARB");
207896c5ddc4Srjs   CALL_GetnMapivARB(ctx->CurrentServerDispatch, (target, query, bufSize, v));
207996c5ddc4Srjs}
208096c5ddc4Srjs
208196c5ddc4Srjs
208296c5ddc4Srjs/* GetnPixelMapfvARB: marshalled synchronously */
208396c5ddc4Srjsvoid GLAPIENTRY
208496c5ddc4Srjs_mesa_marshal_GetnPixelMapfvARB(GLenum map, GLsizei bufSize, GLfloat * values)
208596c5ddc4Srjs{
208696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
208796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetnPixelMapfvARB");
208896c5ddc4Srjs   CALL_GetnPixelMapfvARB(ctx->CurrentServerDispatch, (map, bufSize, values));
208996c5ddc4Srjs}
209096c5ddc4Srjs
209196c5ddc4Srjs
209296c5ddc4Srjs/* GetnPixelMapuivARB: marshalled synchronously */
209396c5ddc4Srjsvoid GLAPIENTRY
209496c5ddc4Srjs_mesa_marshal_GetnPixelMapuivARB(GLenum map, GLsizei bufSize, GLuint * values)
209596c5ddc4Srjs{
209696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
209796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetnPixelMapuivARB");
209896c5ddc4Srjs   CALL_GetnPixelMapuivARB(ctx->CurrentServerDispatch, (map, bufSize, values));
209996c5ddc4Srjs}
210096c5ddc4Srjs
210196c5ddc4Srjs
210296c5ddc4Srjs/* GetnPixelMapusvARB: marshalled synchronously */
210396c5ddc4Srjsvoid GLAPIENTRY
210496c5ddc4Srjs_mesa_marshal_GetnPixelMapusvARB(GLenum map, GLsizei bufSize, GLushort * values)
210596c5ddc4Srjs{
210696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
210796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetnPixelMapusvARB");
210896c5ddc4Srjs   CALL_GetnPixelMapusvARB(ctx->CurrentServerDispatch, (map, bufSize, values));
210996c5ddc4Srjs}
211096c5ddc4Srjs
211196c5ddc4Srjs
211296c5ddc4Srjs/* GetnPolygonStippleARB: marshalled asynchronously */
211396c5ddc4Srjsstruct marshal_cmd_GetnPolygonStippleARB
211496c5ddc4Srjs{
211596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
211696c5ddc4Srjs   GLsizei bufSize;
211796c5ddc4Srjs   GLubyte * pattern;
211896c5ddc4Srjs};
211996c5ddc4Srjsuint32_t
212096c5ddc4Srjs_mesa_unmarshal_GetnPolygonStippleARB(struct gl_context *ctx, const struct marshal_cmd_GetnPolygonStippleARB *cmd, const uint64_t *last)
212196c5ddc4Srjs{
212296c5ddc4Srjs   GLsizei bufSize = cmd->bufSize;
212396c5ddc4Srjs   GLubyte * pattern = cmd->pattern;
212496c5ddc4Srjs   CALL_GetnPolygonStippleARB(ctx->CurrentServerDispatch, (bufSize, pattern));
212596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetnPolygonStippleARB), 8) / 8);
212696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
212796c5ddc4Srjs   return cmd_size;
212896c5ddc4Srjs}
212996c5ddc4Srjsvoid GLAPIENTRY
213096c5ddc4Srjs_mesa_marshal_GetnPolygonStippleARB(GLsizei bufSize, GLubyte * pattern)
213196c5ddc4Srjs{
213296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
213396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetnPolygonStippleARB);
213496c5ddc4Srjs   struct marshal_cmd_GetnPolygonStippleARB *cmd;
213596c5ddc4Srjs   if (_mesa_glthread_has_no_pack_buffer(ctx)) {
213696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "GetnPolygonStippleARB");
213796c5ddc4Srjs      CALL_GetnPolygonStippleARB(ctx->CurrentServerDispatch, (bufSize, pattern));
213896c5ddc4Srjs      return;
213996c5ddc4Srjs   }
214096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetnPolygonStippleARB, cmd_size);
214196c5ddc4Srjs   cmd->bufSize = bufSize;
214296c5ddc4Srjs   cmd->pattern = pattern;
214396c5ddc4Srjs}
214496c5ddc4Srjs
214596c5ddc4Srjs
214696c5ddc4Srjs/* GetnTexImageARB: marshalled asynchronously */
214796c5ddc4Srjsstruct marshal_cmd_GetnTexImageARB
214896c5ddc4Srjs{
214996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
215096c5ddc4Srjs   GLenum target;
215196c5ddc4Srjs   GLint level;
215296c5ddc4Srjs   GLenum format;
215396c5ddc4Srjs   GLenum type;
215496c5ddc4Srjs   GLsizei bufSize;
215596c5ddc4Srjs   GLvoid * img;
215696c5ddc4Srjs};
215796c5ddc4Srjsuint32_t
215896c5ddc4Srjs_mesa_unmarshal_GetnTexImageARB(struct gl_context *ctx, const struct marshal_cmd_GetnTexImageARB *cmd, const uint64_t *last)
215996c5ddc4Srjs{
216096c5ddc4Srjs   GLenum target = cmd->target;
216196c5ddc4Srjs   GLint level = cmd->level;
216296c5ddc4Srjs   GLenum format = cmd->format;
216396c5ddc4Srjs   GLenum type = cmd->type;
216496c5ddc4Srjs   GLsizei bufSize = cmd->bufSize;
216596c5ddc4Srjs   GLvoid * img = cmd->img;
216696c5ddc4Srjs   CALL_GetnTexImageARB(ctx->CurrentServerDispatch, (target, level, format, type, bufSize, img));
216796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetnTexImageARB), 8) / 8);
216896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
216996c5ddc4Srjs   return cmd_size;
217096c5ddc4Srjs}
217196c5ddc4Srjsvoid GLAPIENTRY
217296c5ddc4Srjs_mesa_marshal_GetnTexImageARB(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid * img)
217396c5ddc4Srjs{
217496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
217596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetnTexImageARB);
217696c5ddc4Srjs   struct marshal_cmd_GetnTexImageARB *cmd;
217796c5ddc4Srjs   if (_mesa_glthread_has_no_pack_buffer(ctx)) {
217896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "GetnTexImageARB");
217996c5ddc4Srjs      CALL_GetnTexImageARB(ctx->CurrentServerDispatch, (target, level, format, type, bufSize, img));
218096c5ddc4Srjs      return;
218196c5ddc4Srjs   }
218296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetnTexImageARB, cmd_size);
218396c5ddc4Srjs   cmd->target = target;
218496c5ddc4Srjs   cmd->level = level;
218596c5ddc4Srjs   cmd->format = format;
218696c5ddc4Srjs   cmd->type = type;
218796c5ddc4Srjs   cmd->bufSize = bufSize;
218896c5ddc4Srjs   cmd->img = img;
218996c5ddc4Srjs}
219096c5ddc4Srjs
219196c5ddc4Srjs
219296c5ddc4Srjs/* ReadnPixelsARB: marshalled asynchronously */
219396c5ddc4Srjsstruct marshal_cmd_ReadnPixelsARB
219496c5ddc4Srjs{
219596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
219696c5ddc4Srjs   GLint x;
219796c5ddc4Srjs   GLint y;
219896c5ddc4Srjs   GLsizei width;
219996c5ddc4Srjs   GLsizei height;
220096c5ddc4Srjs   GLenum format;
220196c5ddc4Srjs   GLenum type;
220296c5ddc4Srjs   GLsizei bufSize;
220396c5ddc4Srjs   GLvoid * data;
220496c5ddc4Srjs};
220596c5ddc4Srjsuint32_t
220696c5ddc4Srjs_mesa_unmarshal_ReadnPixelsARB(struct gl_context *ctx, const struct marshal_cmd_ReadnPixelsARB *cmd, const uint64_t *last)
220796c5ddc4Srjs{
220896c5ddc4Srjs   GLint x = cmd->x;
220996c5ddc4Srjs   GLint y = cmd->y;
221096c5ddc4Srjs   GLsizei width = cmd->width;
221196c5ddc4Srjs   GLsizei height = cmd->height;
221296c5ddc4Srjs   GLenum format = cmd->format;
221396c5ddc4Srjs   GLenum type = cmd->type;
221496c5ddc4Srjs   GLsizei bufSize = cmd->bufSize;
221596c5ddc4Srjs   GLvoid * data = cmd->data;
221696c5ddc4Srjs   CALL_ReadnPixelsARB(ctx->CurrentServerDispatch, (x, y, width, height, format, type, bufSize, data));
221796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ReadnPixelsARB), 8) / 8);
221896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
221996c5ddc4Srjs   return cmd_size;
222096c5ddc4Srjs}
222196c5ddc4Srjsvoid GLAPIENTRY
222296c5ddc4Srjs_mesa_marshal_ReadnPixelsARB(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid * data)
222396c5ddc4Srjs{
222496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
222596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ReadnPixelsARB);
222696c5ddc4Srjs   struct marshal_cmd_ReadnPixelsARB *cmd;
222796c5ddc4Srjs   if (_mesa_glthread_has_no_pack_buffer(ctx)) {
222896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ReadnPixelsARB");
222996c5ddc4Srjs      CALL_ReadnPixelsARB(ctx->CurrentServerDispatch, (x, y, width, height, format, type, bufSize, data));
223096c5ddc4Srjs      return;
223196c5ddc4Srjs   }
223296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ReadnPixelsARB, cmd_size);
223396c5ddc4Srjs   cmd->x = x;
223496c5ddc4Srjs   cmd->y = y;
223596c5ddc4Srjs   cmd->width = width;
223696c5ddc4Srjs   cmd->height = height;
223796c5ddc4Srjs   cmd->format = format;
223896c5ddc4Srjs   cmd->type = type;
223996c5ddc4Srjs   cmd->bufSize = bufSize;
224096c5ddc4Srjs   cmd->data = data;
224196c5ddc4Srjs}
224296c5ddc4Srjs
224396c5ddc4Srjs
224496c5ddc4Srjs/* GetnColorTableARB: marshalled synchronously */
224596c5ddc4Srjsvoid GLAPIENTRY
224696c5ddc4Srjs_mesa_marshal_GetnColorTableARB(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid * table)
224796c5ddc4Srjs{
224896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
224996c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetnColorTableARB");
225096c5ddc4Srjs   CALL_GetnColorTableARB(ctx->CurrentServerDispatch, (target, format, type, bufSize, table));
225196c5ddc4Srjs}
225296c5ddc4Srjs
225396c5ddc4Srjs
225496c5ddc4Srjs/* GetnConvolutionFilterARB: marshalled synchronously */
225596c5ddc4Srjsvoid GLAPIENTRY
225696c5ddc4Srjs_mesa_marshal_GetnConvolutionFilterARB(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid * image)
225796c5ddc4Srjs{
225896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
225996c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetnConvolutionFilterARB");
226096c5ddc4Srjs   CALL_GetnConvolutionFilterARB(ctx->CurrentServerDispatch, (target, format, type, bufSize, image));
226196c5ddc4Srjs}
226296c5ddc4Srjs
226396c5ddc4Srjs
226496c5ddc4Srjs/* GetnSeparableFilterARB: marshalled synchronously */
226596c5ddc4Srjsvoid GLAPIENTRY
226696c5ddc4Srjs_mesa_marshal_GetnSeparableFilterARB(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid * row, GLsizei columnBufSize, GLvoid * column, GLvoid * span)
226796c5ddc4Srjs{
226896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
226996c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetnSeparableFilterARB");
227096c5ddc4Srjs   CALL_GetnSeparableFilterARB(ctx->CurrentServerDispatch, (target, format, type, rowBufSize, row, columnBufSize, column, span));
227196c5ddc4Srjs}
227296c5ddc4Srjs
227396c5ddc4Srjs
227496c5ddc4Srjs/* GetnHistogramARB: marshalled synchronously */
227596c5ddc4Srjsvoid GLAPIENTRY
227696c5ddc4Srjs_mesa_marshal_GetnHistogramARB(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid * values)
227796c5ddc4Srjs{
227896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
227996c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetnHistogramARB");
228096c5ddc4Srjs   CALL_GetnHistogramARB(ctx->CurrentServerDispatch, (target, reset, format, type, bufSize, values));
228196c5ddc4Srjs}
228296c5ddc4Srjs
228396c5ddc4Srjs
228496c5ddc4Srjs/* GetnMinmaxARB: marshalled synchronously */
228596c5ddc4Srjsvoid GLAPIENTRY
228696c5ddc4Srjs_mesa_marshal_GetnMinmaxARB(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid * values)
228796c5ddc4Srjs{
228896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
228996c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetnMinmaxARB");
229096c5ddc4Srjs   CALL_GetnMinmaxARB(ctx->CurrentServerDispatch, (target, reset, format, type, bufSize, values));
229196c5ddc4Srjs}
229296c5ddc4Srjs
229396c5ddc4Srjs
229496c5ddc4Srjs/* GetnCompressedTexImageARB: marshalled asynchronously */
229596c5ddc4Srjsstruct marshal_cmd_GetnCompressedTexImageARB
229696c5ddc4Srjs{
229796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
229896c5ddc4Srjs   GLenum target;
229996c5ddc4Srjs   GLint lod;
230096c5ddc4Srjs   GLsizei bufSize;
230196c5ddc4Srjs   GLvoid * img;
230296c5ddc4Srjs};
230396c5ddc4Srjsuint32_t
230496c5ddc4Srjs_mesa_unmarshal_GetnCompressedTexImageARB(struct gl_context *ctx, const struct marshal_cmd_GetnCompressedTexImageARB *cmd, const uint64_t *last)
230596c5ddc4Srjs{
230696c5ddc4Srjs   GLenum target = cmd->target;
230796c5ddc4Srjs   GLint lod = cmd->lod;
230896c5ddc4Srjs   GLsizei bufSize = cmd->bufSize;
230996c5ddc4Srjs   GLvoid * img = cmd->img;
231096c5ddc4Srjs   CALL_GetnCompressedTexImageARB(ctx->CurrentServerDispatch, (target, lod, bufSize, img));
231196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetnCompressedTexImageARB), 8) / 8);
231296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
231396c5ddc4Srjs   return cmd_size;
231496c5ddc4Srjs}
231596c5ddc4Srjsvoid GLAPIENTRY
231696c5ddc4Srjs_mesa_marshal_GetnCompressedTexImageARB(GLenum target, GLint lod, GLsizei bufSize, GLvoid * img)
231796c5ddc4Srjs{
231896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
231996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetnCompressedTexImageARB);
232096c5ddc4Srjs   struct marshal_cmd_GetnCompressedTexImageARB *cmd;
232196c5ddc4Srjs   if (_mesa_glthread_has_no_pack_buffer(ctx)) {
232296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "GetnCompressedTexImageARB");
232396c5ddc4Srjs      CALL_GetnCompressedTexImageARB(ctx->CurrentServerDispatch, (target, lod, bufSize, img));
232496c5ddc4Srjs      return;
232596c5ddc4Srjs   }
232696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetnCompressedTexImageARB, cmd_size);
232796c5ddc4Srjs   cmd->target = target;
232896c5ddc4Srjs   cmd->lod = lod;
232996c5ddc4Srjs   cmd->bufSize = bufSize;
233096c5ddc4Srjs   cmd->img = img;
233196c5ddc4Srjs}
233296c5ddc4Srjs
233396c5ddc4Srjs
233496c5ddc4Srjs/* GetnUniformfvARB: marshalled synchronously */
233596c5ddc4Srjsvoid GLAPIENTRY
233696c5ddc4Srjs_mesa_marshal_GetnUniformfvARB(GLuint program, GLint location, GLsizei bufSize, GLfloat * params)
233796c5ddc4Srjs{
233896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
233996c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetnUniformfvARB");
234096c5ddc4Srjs   CALL_GetnUniformfvARB(ctx->CurrentServerDispatch, (program, location, bufSize, params));
234196c5ddc4Srjs}
234296c5ddc4Srjs
234396c5ddc4Srjs
234496c5ddc4Srjs/* GetnUniformivARB: marshalled synchronously */
234596c5ddc4Srjsvoid GLAPIENTRY
234696c5ddc4Srjs_mesa_marshal_GetnUniformivARB(GLuint program, GLint location, GLsizei bufSize, GLint * params)
234796c5ddc4Srjs{
234896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
234996c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetnUniformivARB");
235096c5ddc4Srjs   CALL_GetnUniformivARB(ctx->CurrentServerDispatch, (program, location, bufSize, params));
235196c5ddc4Srjs}
235296c5ddc4Srjs
235396c5ddc4Srjs
235496c5ddc4Srjs/* GetnUniformuivARB: marshalled synchronously */
235596c5ddc4Srjsvoid GLAPIENTRY
235696c5ddc4Srjs_mesa_marshal_GetnUniformuivARB(GLuint program, GLint location, GLsizei bufSize, GLuint * params)
235796c5ddc4Srjs{
235896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
235996c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetnUniformuivARB");
236096c5ddc4Srjs   CALL_GetnUniformuivARB(ctx->CurrentServerDispatch, (program, location, bufSize, params));
236196c5ddc4Srjs}
236296c5ddc4Srjs
236396c5ddc4Srjs
236496c5ddc4Srjs/* GetnUniformdvARB: marshalled synchronously */
236596c5ddc4Srjsvoid GLAPIENTRY
236696c5ddc4Srjs_mesa_marshal_GetnUniformdvARB(GLuint program, GLint location, GLsizei bufSize, GLdouble * params)
236796c5ddc4Srjs{
236896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
236996c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetnUniformdvARB");
237096c5ddc4Srjs   CALL_GetnUniformdvARB(ctx->CurrentServerDispatch, (program, location, bufSize, params));
237196c5ddc4Srjs}
237296c5ddc4Srjs
237396c5ddc4Srjs
237496c5ddc4Srjs/* DrawTransformFeedbackInstanced: marshalled asynchronously */
237596c5ddc4Srjsstruct marshal_cmd_DrawTransformFeedbackInstanced
237696c5ddc4Srjs{
237796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
237896c5ddc4Srjs   GLenum mode;
237996c5ddc4Srjs   GLuint id;
238096c5ddc4Srjs   GLsizei primcount;
238196c5ddc4Srjs};
238296c5ddc4Srjsuint32_t
238396c5ddc4Srjs_mesa_unmarshal_DrawTransformFeedbackInstanced(struct gl_context *ctx, const struct marshal_cmd_DrawTransformFeedbackInstanced *cmd, const uint64_t *last)
238496c5ddc4Srjs{
238596c5ddc4Srjs   GLenum mode = cmd->mode;
238696c5ddc4Srjs   GLuint id = cmd->id;
238796c5ddc4Srjs   GLsizei primcount = cmd->primcount;
238896c5ddc4Srjs   CALL_DrawTransformFeedbackInstanced(ctx->CurrentServerDispatch, (mode, id, primcount));
238996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawTransformFeedbackInstanced), 8) / 8);
239096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
239196c5ddc4Srjs   return cmd_size;
239296c5ddc4Srjs}
239396c5ddc4Srjsvoid GLAPIENTRY
239496c5ddc4Srjs_mesa_marshal_DrawTransformFeedbackInstanced(GLenum mode, GLuint id, GLsizei primcount)
239596c5ddc4Srjs{
239696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
239796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DrawTransformFeedbackInstanced);
239896c5ddc4Srjs   struct marshal_cmd_DrawTransformFeedbackInstanced *cmd;
239996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTransformFeedbackInstanced, cmd_size);
240096c5ddc4Srjs   cmd->mode = mode;
240196c5ddc4Srjs   cmd->id = id;
240296c5ddc4Srjs   cmd->primcount = primcount;
240396c5ddc4Srjs}
240496c5ddc4Srjs
240596c5ddc4Srjs
240696c5ddc4Srjs/* DrawTransformFeedbackStreamInstanced: marshalled asynchronously */
240796c5ddc4Srjsstruct marshal_cmd_DrawTransformFeedbackStreamInstanced
240896c5ddc4Srjs{
240996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
241096c5ddc4Srjs   GLenum mode;
241196c5ddc4Srjs   GLuint id;
241296c5ddc4Srjs   GLuint stream;
241396c5ddc4Srjs   GLsizei primcount;
241496c5ddc4Srjs};
241596c5ddc4Srjsuint32_t
241696c5ddc4Srjs_mesa_unmarshal_DrawTransformFeedbackStreamInstanced(struct gl_context *ctx, const struct marshal_cmd_DrawTransformFeedbackStreamInstanced *cmd, const uint64_t *last)
241796c5ddc4Srjs{
241896c5ddc4Srjs   GLenum mode = cmd->mode;
241996c5ddc4Srjs   GLuint id = cmd->id;
242096c5ddc4Srjs   GLuint stream = cmd->stream;
242196c5ddc4Srjs   GLsizei primcount = cmd->primcount;
242296c5ddc4Srjs   CALL_DrawTransformFeedbackStreamInstanced(ctx->CurrentServerDispatch, (mode, id, stream, primcount));
242396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawTransformFeedbackStreamInstanced), 8) / 8);
242496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
242596c5ddc4Srjs   return cmd_size;
242696c5ddc4Srjs}
242796c5ddc4Srjsvoid GLAPIENTRY
242896c5ddc4Srjs_mesa_marshal_DrawTransformFeedbackStreamInstanced(GLenum mode, GLuint id, GLuint stream, GLsizei primcount)
242996c5ddc4Srjs{
243096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
243196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DrawTransformFeedbackStreamInstanced);
243296c5ddc4Srjs   struct marshal_cmd_DrawTransformFeedbackStreamInstanced *cmd;
243396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTransformFeedbackStreamInstanced, cmd_size);
243496c5ddc4Srjs   cmd->mode = mode;
243596c5ddc4Srjs   cmd->id = id;
243696c5ddc4Srjs   cmd->stream = stream;
243796c5ddc4Srjs   cmd->primcount = primcount;
243896c5ddc4Srjs}
243996c5ddc4Srjs
244096c5ddc4Srjs
244196c5ddc4Srjs/* GetInternalformativ: marshalled synchronously */
244296c5ddc4Srjsvoid GLAPIENTRY
244396c5ddc4Srjs_mesa_marshal_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint * params)
244496c5ddc4Srjs{
244596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
244696c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetInternalformativ");
244796c5ddc4Srjs   CALL_GetInternalformativ(ctx->CurrentServerDispatch, (target, internalformat, pname, bufSize, params));
244896c5ddc4Srjs}
244996c5ddc4Srjs
245096c5ddc4Srjs
245196c5ddc4Srjs/* GetActiveAtomicCounterBufferiv: marshalled synchronously */
245296c5ddc4Srjsvoid GLAPIENTRY
245396c5ddc4Srjs_mesa_marshal_GetActiveAtomicCounterBufferiv(GLuint program, GLuint bufferIndex, GLenum pname, GLint * params)
245496c5ddc4Srjs{
245596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
245696c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetActiveAtomicCounterBufferiv");
245796c5ddc4Srjs   CALL_GetActiveAtomicCounterBufferiv(ctx->CurrentServerDispatch, (program, bufferIndex, pname, params));
245896c5ddc4Srjs}
245996c5ddc4Srjs
246096c5ddc4Srjs
246196c5ddc4Srjs/* BindImageTexture: marshalled asynchronously */
246296c5ddc4Srjsstruct marshal_cmd_BindImageTexture
246396c5ddc4Srjs{
246496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
246596c5ddc4Srjs   GLboolean layered;
246696c5ddc4Srjs   GLuint unit;
246796c5ddc4Srjs   GLuint texture;
246896c5ddc4Srjs   GLint level;
246996c5ddc4Srjs   GLint layer;
247096c5ddc4Srjs   GLenum access;
247196c5ddc4Srjs   GLenum format;
247296c5ddc4Srjs};
247396c5ddc4Srjsuint32_t
247496c5ddc4Srjs_mesa_unmarshal_BindImageTexture(struct gl_context *ctx, const struct marshal_cmd_BindImageTexture *cmd, const uint64_t *last)
247596c5ddc4Srjs{
247696c5ddc4Srjs   GLuint unit = cmd->unit;
247796c5ddc4Srjs   GLuint texture = cmd->texture;
247896c5ddc4Srjs   GLint level = cmd->level;
247996c5ddc4Srjs   GLboolean layered = cmd->layered;
248096c5ddc4Srjs   GLint layer = cmd->layer;
248196c5ddc4Srjs   GLenum access = cmd->access;
248296c5ddc4Srjs   GLenum format = cmd->format;
248396c5ddc4Srjs   CALL_BindImageTexture(ctx->CurrentServerDispatch, (unit, texture, level, layered, layer, access, format));
248496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindImageTexture), 8) / 8);
248596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
248696c5ddc4Srjs   return cmd_size;
248796c5ddc4Srjs}
248896c5ddc4Srjsvoid GLAPIENTRY
248996c5ddc4Srjs_mesa_marshal_BindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format)
249096c5ddc4Srjs{
249196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
249296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindImageTexture);
249396c5ddc4Srjs   struct marshal_cmd_BindImageTexture *cmd;
249496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindImageTexture, cmd_size);
249596c5ddc4Srjs   cmd->unit = unit;
249696c5ddc4Srjs   cmd->texture = texture;
249796c5ddc4Srjs   cmd->level = level;
249896c5ddc4Srjs   cmd->layered = layered;
249996c5ddc4Srjs   cmd->layer = layer;
250096c5ddc4Srjs   cmd->access = access;
250196c5ddc4Srjs   cmd->format = format;
250296c5ddc4Srjs}
250396c5ddc4Srjs
250496c5ddc4Srjs
250596c5ddc4Srjs/* MemoryBarrier: marshalled asynchronously */
250696c5ddc4Srjsstruct marshal_cmd_MemoryBarrier
250796c5ddc4Srjs{
250896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
250996c5ddc4Srjs   GLbitfield barriers;
251096c5ddc4Srjs};
251196c5ddc4Srjsuint32_t
251296c5ddc4Srjs_mesa_unmarshal_MemoryBarrier(struct gl_context *ctx, const struct marshal_cmd_MemoryBarrier *cmd, const uint64_t *last)
251396c5ddc4Srjs{
251496c5ddc4Srjs   GLbitfield barriers = cmd->barriers;
251596c5ddc4Srjs   CALL_MemoryBarrier(ctx->CurrentServerDispatch, (barriers));
251696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MemoryBarrier), 8) / 8);
251796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
251896c5ddc4Srjs   return cmd_size;
251996c5ddc4Srjs}
252096c5ddc4Srjsvoid GLAPIENTRY
252196c5ddc4Srjs_mesa_marshal_MemoryBarrier(GLbitfield barriers)
252296c5ddc4Srjs{
252396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
252496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MemoryBarrier);
252596c5ddc4Srjs   struct marshal_cmd_MemoryBarrier *cmd;
252696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MemoryBarrier, cmd_size);
252796c5ddc4Srjs   cmd->barriers = barriers;
252896c5ddc4Srjs}
252996c5ddc4Srjs
253096c5ddc4Srjs
253196c5ddc4Srjs/* TexStorage1D: marshalled asynchronously */
253296c5ddc4Srjsstruct marshal_cmd_TexStorage1D
253396c5ddc4Srjs{
253496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
253596c5ddc4Srjs   GLenum target;
253696c5ddc4Srjs   GLsizei levels;
253796c5ddc4Srjs   GLenum internalFormat;
253896c5ddc4Srjs   GLsizei width;
253996c5ddc4Srjs};
254096c5ddc4Srjsuint32_t
254196c5ddc4Srjs_mesa_unmarshal_TexStorage1D(struct gl_context *ctx, const struct marshal_cmd_TexStorage1D *cmd, const uint64_t *last)
254296c5ddc4Srjs{
254396c5ddc4Srjs   GLenum target = cmd->target;
254496c5ddc4Srjs   GLsizei levels = cmd->levels;
254596c5ddc4Srjs   GLenum internalFormat = cmd->internalFormat;
254696c5ddc4Srjs   GLsizei width = cmd->width;
254796c5ddc4Srjs   CALL_TexStorage1D(ctx->CurrentServerDispatch, (target, levels, internalFormat, width));
254896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexStorage1D), 8) / 8);
254996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
255096c5ddc4Srjs   return cmd_size;
255196c5ddc4Srjs}
255296c5ddc4Srjsvoid GLAPIENTRY
255396c5ddc4Srjs_mesa_marshal_TexStorage1D(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width)
255496c5ddc4Srjs{
255596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
255696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexStorage1D);
255796c5ddc4Srjs   struct marshal_cmd_TexStorage1D *cmd;
255896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorage1D, cmd_size);
255996c5ddc4Srjs   cmd->target = target;
256096c5ddc4Srjs   cmd->levels = levels;
256196c5ddc4Srjs   cmd->internalFormat = internalFormat;
256296c5ddc4Srjs   cmd->width = width;
256396c5ddc4Srjs}
256496c5ddc4Srjs
256596c5ddc4Srjs
256696c5ddc4Srjs/* TexStorage2D: marshalled asynchronously */
256796c5ddc4Srjsstruct marshal_cmd_TexStorage2D
256896c5ddc4Srjs{
256996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
257096c5ddc4Srjs   GLenum target;
257196c5ddc4Srjs   GLsizei levels;
257296c5ddc4Srjs   GLenum internalFormat;
257396c5ddc4Srjs   GLsizei width;
257496c5ddc4Srjs   GLsizei height;
257596c5ddc4Srjs};
257696c5ddc4Srjsuint32_t
257796c5ddc4Srjs_mesa_unmarshal_TexStorage2D(struct gl_context *ctx, const struct marshal_cmd_TexStorage2D *cmd, const uint64_t *last)
257896c5ddc4Srjs{
257996c5ddc4Srjs   GLenum target = cmd->target;
258096c5ddc4Srjs   GLsizei levels = cmd->levels;
258196c5ddc4Srjs   GLenum internalFormat = cmd->internalFormat;
258296c5ddc4Srjs   GLsizei width = cmd->width;
258396c5ddc4Srjs   GLsizei height = cmd->height;
258496c5ddc4Srjs   CALL_TexStorage2D(ctx->CurrentServerDispatch, (target, levels, internalFormat, width, height));
258596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexStorage2D), 8) / 8);
258696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
258796c5ddc4Srjs   return cmd_size;
258896c5ddc4Srjs}
258996c5ddc4Srjsvoid GLAPIENTRY
259096c5ddc4Srjs_mesa_marshal_TexStorage2D(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height)
259196c5ddc4Srjs{
259296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
259396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexStorage2D);
259496c5ddc4Srjs   struct marshal_cmd_TexStorage2D *cmd;
259596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorage2D, cmd_size);
259696c5ddc4Srjs   cmd->target = target;
259796c5ddc4Srjs   cmd->levels = levels;
259896c5ddc4Srjs   cmd->internalFormat = internalFormat;
259996c5ddc4Srjs   cmd->width = width;
260096c5ddc4Srjs   cmd->height = height;
260196c5ddc4Srjs}
260296c5ddc4Srjs
260396c5ddc4Srjs
260496c5ddc4Srjs/* TexStorage3D: marshalled asynchronously */
260596c5ddc4Srjsstruct marshal_cmd_TexStorage3D
260696c5ddc4Srjs{
260796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
260896c5ddc4Srjs   GLenum target;
260996c5ddc4Srjs   GLsizei levels;
261096c5ddc4Srjs   GLenum internalFormat;
261196c5ddc4Srjs   GLsizei width;
261296c5ddc4Srjs   GLsizei height;
261396c5ddc4Srjs   GLsizei depth;
261496c5ddc4Srjs};
261596c5ddc4Srjsuint32_t
261696c5ddc4Srjs_mesa_unmarshal_TexStorage3D(struct gl_context *ctx, const struct marshal_cmd_TexStorage3D *cmd, const uint64_t *last)
261796c5ddc4Srjs{
261896c5ddc4Srjs   GLenum target = cmd->target;
261996c5ddc4Srjs   GLsizei levels = cmd->levels;
262096c5ddc4Srjs   GLenum internalFormat = cmd->internalFormat;
262196c5ddc4Srjs   GLsizei width = cmd->width;
262296c5ddc4Srjs   GLsizei height = cmd->height;
262396c5ddc4Srjs   GLsizei depth = cmd->depth;
262496c5ddc4Srjs   CALL_TexStorage3D(ctx->CurrentServerDispatch, (target, levels, internalFormat, width, height, depth));
262596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexStorage3D), 8) / 8);
262696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
262796c5ddc4Srjs   return cmd_size;
262896c5ddc4Srjs}
262996c5ddc4Srjsvoid GLAPIENTRY
263096c5ddc4Srjs_mesa_marshal_TexStorage3D(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth)
263196c5ddc4Srjs{
263296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
263396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexStorage3D);
263496c5ddc4Srjs   struct marshal_cmd_TexStorage3D *cmd;
263596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorage3D, cmd_size);
263696c5ddc4Srjs   cmd->target = target;
263796c5ddc4Srjs   cmd->levels = levels;
263896c5ddc4Srjs   cmd->internalFormat = internalFormat;
263996c5ddc4Srjs   cmd->width = width;
264096c5ddc4Srjs   cmd->height = height;
264196c5ddc4Srjs   cmd->depth = depth;
264296c5ddc4Srjs}
264396c5ddc4Srjs
264496c5ddc4Srjs
264596c5ddc4Srjs/* TextureStorage1DEXT: marshalled asynchronously */
264696c5ddc4Srjsstruct marshal_cmd_TextureStorage1DEXT
264796c5ddc4Srjs{
264896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
264996c5ddc4Srjs   GLuint texture;
265096c5ddc4Srjs   GLenum target;
265196c5ddc4Srjs   GLsizei levels;
265296c5ddc4Srjs   GLenum internalFormat;
265396c5ddc4Srjs   GLsizei width;
265496c5ddc4Srjs};
265596c5ddc4Srjsuint32_t
265696c5ddc4Srjs_mesa_unmarshal_TextureStorage1DEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorage1DEXT *cmd, const uint64_t *last)
265796c5ddc4Srjs{
265896c5ddc4Srjs   GLuint texture = cmd->texture;
265996c5ddc4Srjs   GLenum target = cmd->target;
266096c5ddc4Srjs   GLsizei levels = cmd->levels;
266196c5ddc4Srjs   GLenum internalFormat = cmd->internalFormat;
266296c5ddc4Srjs   GLsizei width = cmd->width;
266396c5ddc4Srjs   CALL_TextureStorage1DEXT(ctx->CurrentServerDispatch, (texture, target, levels, internalFormat, width));
266496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureStorage1DEXT), 8) / 8);
266596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
266696c5ddc4Srjs   return cmd_size;
266796c5ddc4Srjs}
266896c5ddc4Srjsvoid GLAPIENTRY
266996c5ddc4Srjs_mesa_marshal_TextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width)
267096c5ddc4Srjs{
267196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
267296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureStorage1DEXT);
267396c5ddc4Srjs   struct marshal_cmd_TextureStorage1DEXT *cmd;
267496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage1DEXT, cmd_size);
267596c5ddc4Srjs   cmd->texture = texture;
267696c5ddc4Srjs   cmd->target = target;
267796c5ddc4Srjs   cmd->levels = levels;
267896c5ddc4Srjs   cmd->internalFormat = internalFormat;
267996c5ddc4Srjs   cmd->width = width;
268096c5ddc4Srjs}
268196c5ddc4Srjs
268296c5ddc4Srjs
268396c5ddc4Srjs/* TextureStorage2DEXT: marshalled asynchronously */
268496c5ddc4Srjsstruct marshal_cmd_TextureStorage2DEXT
268596c5ddc4Srjs{
268696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
268796c5ddc4Srjs   GLuint texture;
268896c5ddc4Srjs   GLenum target;
268996c5ddc4Srjs   GLsizei levels;
269096c5ddc4Srjs   GLenum internalFormat;
269196c5ddc4Srjs   GLsizei width;
269296c5ddc4Srjs   GLsizei height;
269396c5ddc4Srjs};
269496c5ddc4Srjsuint32_t
269596c5ddc4Srjs_mesa_unmarshal_TextureStorage2DEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorage2DEXT *cmd, const uint64_t *last)
269696c5ddc4Srjs{
269796c5ddc4Srjs   GLuint texture = cmd->texture;
269896c5ddc4Srjs   GLenum target = cmd->target;
269996c5ddc4Srjs   GLsizei levels = cmd->levels;
270096c5ddc4Srjs   GLenum internalFormat = cmd->internalFormat;
270196c5ddc4Srjs   GLsizei width = cmd->width;
270296c5ddc4Srjs   GLsizei height = cmd->height;
270396c5ddc4Srjs   CALL_TextureStorage2DEXT(ctx->CurrentServerDispatch, (texture, target, levels, internalFormat, width, height));
270496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureStorage2DEXT), 8) / 8);
270596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
270696c5ddc4Srjs   return cmd_size;
270796c5ddc4Srjs}
270896c5ddc4Srjsvoid GLAPIENTRY
270996c5ddc4Srjs_mesa_marshal_TextureStorage2DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height)
271096c5ddc4Srjs{
271196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
271296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureStorage2DEXT);
271396c5ddc4Srjs   struct marshal_cmd_TextureStorage2DEXT *cmd;
271496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage2DEXT, cmd_size);
271596c5ddc4Srjs   cmd->texture = texture;
271696c5ddc4Srjs   cmd->target = target;
271796c5ddc4Srjs   cmd->levels = levels;
271896c5ddc4Srjs   cmd->internalFormat = internalFormat;
271996c5ddc4Srjs   cmd->width = width;
272096c5ddc4Srjs   cmd->height = height;
272196c5ddc4Srjs}
272296c5ddc4Srjs
272396c5ddc4Srjs
272496c5ddc4Srjs/* TextureStorage3DEXT: marshalled asynchronously */
272596c5ddc4Srjsstruct marshal_cmd_TextureStorage3DEXT
272696c5ddc4Srjs{
272796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
272896c5ddc4Srjs   GLuint texture;
272996c5ddc4Srjs   GLenum target;
273096c5ddc4Srjs   GLsizei levels;
273196c5ddc4Srjs   GLenum internalFormat;
273296c5ddc4Srjs   GLsizei width;
273396c5ddc4Srjs   GLsizei height;
273496c5ddc4Srjs   GLsizei depth;
273596c5ddc4Srjs};
273696c5ddc4Srjsuint32_t
273796c5ddc4Srjs_mesa_unmarshal_TextureStorage3DEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorage3DEXT *cmd, const uint64_t *last)
273896c5ddc4Srjs{
273996c5ddc4Srjs   GLuint texture = cmd->texture;
274096c5ddc4Srjs   GLenum target = cmd->target;
274196c5ddc4Srjs   GLsizei levels = cmd->levels;
274296c5ddc4Srjs   GLenum internalFormat = cmd->internalFormat;
274396c5ddc4Srjs   GLsizei width = cmd->width;
274496c5ddc4Srjs   GLsizei height = cmd->height;
274596c5ddc4Srjs   GLsizei depth = cmd->depth;
274696c5ddc4Srjs   CALL_TextureStorage3DEXT(ctx->CurrentServerDispatch, (texture, target, levels, internalFormat, width, height, depth));
274796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureStorage3DEXT), 8) / 8);
274896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
274996c5ddc4Srjs   return cmd_size;
275096c5ddc4Srjs}
275196c5ddc4Srjsvoid GLAPIENTRY
275296c5ddc4Srjs_mesa_marshal_TextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth)
275396c5ddc4Srjs{
275496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
275596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureStorage3DEXT);
275696c5ddc4Srjs   struct marshal_cmd_TextureStorage3DEXT *cmd;
275796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage3DEXT, cmd_size);
275896c5ddc4Srjs   cmd->texture = texture;
275996c5ddc4Srjs   cmd->target = target;
276096c5ddc4Srjs   cmd->levels = levels;
276196c5ddc4Srjs   cmd->internalFormat = internalFormat;
276296c5ddc4Srjs   cmd->width = width;
276396c5ddc4Srjs   cmd->height = height;
276496c5ddc4Srjs   cmd->depth = depth;
276596c5ddc4Srjs}
276696c5ddc4Srjs
276796c5ddc4Srjs
276896c5ddc4Srjs/* PushDebugGroup: marshalled asynchronously */
276996c5ddc4Srjsstruct marshal_cmd_PushDebugGroup
277096c5ddc4Srjs{
277196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
277296c5ddc4Srjs   GLenum source;
277396c5ddc4Srjs   GLuint id;
277496c5ddc4Srjs   GLsizei length;
277596c5ddc4Srjs   /* Next length bytes are GLchar message[length] */
277696c5ddc4Srjs};
277796c5ddc4Srjsuint32_t
277896c5ddc4Srjs_mesa_unmarshal_PushDebugGroup(struct gl_context *ctx, const struct marshal_cmd_PushDebugGroup *cmd, const uint64_t *last)
277996c5ddc4Srjs{
278096c5ddc4Srjs   GLenum source = cmd->source;
278196c5ddc4Srjs   GLuint id = cmd->id;
278296c5ddc4Srjs   GLsizei length = cmd->length;
278396c5ddc4Srjs   GLchar * message;
278496c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
278596c5ddc4Srjs   message = (GLchar *) variable_data;
278696c5ddc4Srjs   CALL_PushDebugGroup(ctx->CurrentServerDispatch, (source, id, length, message));
278796c5ddc4Srjs   return cmd->cmd_base.cmd_size;
278896c5ddc4Srjs}
278996c5ddc4Srjsvoid GLAPIENTRY
279096c5ddc4Srjs_mesa_marshal_PushDebugGroup(GLenum source, GLuint id, GLsizei length, const GLchar * message)
279196c5ddc4Srjs{
279296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
279396c5ddc4Srjs   int message_size = length;
279496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_PushDebugGroup) + message_size;
279596c5ddc4Srjs   struct marshal_cmd_PushDebugGroup *cmd;
279696c5ddc4Srjs   if (unlikely(message_size < 0 || (message_size > 0 && !message) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
279796c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "PushDebugGroup");
279896c5ddc4Srjs      CALL_PushDebugGroup(ctx->CurrentServerDispatch, (source, id, length, message));
279996c5ddc4Srjs      return;
280096c5ddc4Srjs   }
280196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PushDebugGroup, cmd_size);
280296c5ddc4Srjs   cmd->source = source;
280396c5ddc4Srjs   cmd->id = id;
280496c5ddc4Srjs   cmd->length = length;
280596c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
280696c5ddc4Srjs   memcpy(variable_data, message, message_size);
280796c5ddc4Srjs}
280896c5ddc4Srjs
280996c5ddc4Srjs
281096c5ddc4Srjs/* PopDebugGroup: marshalled asynchronously */
281196c5ddc4Srjsstruct marshal_cmd_PopDebugGroup
281296c5ddc4Srjs{
281396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
281496c5ddc4Srjs};
281596c5ddc4Srjsuint32_t
281696c5ddc4Srjs_mesa_unmarshal_PopDebugGroup(struct gl_context *ctx, const struct marshal_cmd_PopDebugGroup *cmd, const uint64_t *last)
281796c5ddc4Srjs{
281896c5ddc4Srjs   CALL_PopDebugGroup(ctx->CurrentServerDispatch, ());
281996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PopDebugGroup), 8) / 8);
282096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
282196c5ddc4Srjs   return cmd_size;
282296c5ddc4Srjs}
282396c5ddc4Srjsvoid GLAPIENTRY
282496c5ddc4Srjs_mesa_marshal_PopDebugGroup(void)
282596c5ddc4Srjs{
282696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
282796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_PopDebugGroup);
282896c5ddc4Srjs   struct marshal_cmd_PopDebugGroup *cmd;
282996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PopDebugGroup, cmd_size);
283096c5ddc4Srjs   (void) cmd;
283196c5ddc4Srjs}
283296c5ddc4Srjs
283396c5ddc4Srjs
283496c5ddc4Srjs/* ObjectLabel: marshalled asynchronously */
283596c5ddc4Srjsstruct marshal_cmd_ObjectLabel
283696c5ddc4Srjs{
283796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
283896c5ddc4Srjs   GLenum identifier;
283996c5ddc4Srjs   GLuint name;
284096c5ddc4Srjs   GLsizei length;
284196c5ddc4Srjs   /* Next length bytes are GLchar label[length] */
284296c5ddc4Srjs};
284396c5ddc4Srjsuint32_t
284496c5ddc4Srjs_mesa_unmarshal_ObjectLabel(struct gl_context *ctx, const struct marshal_cmd_ObjectLabel *cmd, const uint64_t *last)
284596c5ddc4Srjs{
284696c5ddc4Srjs   GLenum identifier = cmd->identifier;
284796c5ddc4Srjs   GLuint name = cmd->name;
284896c5ddc4Srjs   GLsizei length = cmd->length;
284996c5ddc4Srjs   GLchar * label;
285096c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
285196c5ddc4Srjs   label = (GLchar *) variable_data;
285296c5ddc4Srjs   CALL_ObjectLabel(ctx->CurrentServerDispatch, (identifier, name, length, label));
285396c5ddc4Srjs   return cmd->cmd_base.cmd_size;
285496c5ddc4Srjs}
285596c5ddc4Srjsvoid GLAPIENTRY
285696c5ddc4Srjs_mesa_marshal_ObjectLabel(GLenum identifier, GLuint name, GLsizei length, const GLchar * label)
285796c5ddc4Srjs{
285896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
285996c5ddc4Srjs   int label_size = length;
286096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ObjectLabel) + label_size;
286196c5ddc4Srjs   struct marshal_cmd_ObjectLabel *cmd;
286296c5ddc4Srjs   if (unlikely(label_size < 0 || (label_size > 0 && !label) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
286396c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ObjectLabel");
286496c5ddc4Srjs      CALL_ObjectLabel(ctx->CurrentServerDispatch, (identifier, name, length, label));
286596c5ddc4Srjs      return;
286696c5ddc4Srjs   }
286796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ObjectLabel, cmd_size);
286896c5ddc4Srjs   cmd->identifier = identifier;
286996c5ddc4Srjs   cmd->name = name;
287096c5ddc4Srjs   cmd->length = length;
287196c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
287296c5ddc4Srjs   memcpy(variable_data, label, label_size);
287396c5ddc4Srjs}
287496c5ddc4Srjs
287596c5ddc4Srjs
287696c5ddc4Srjs/* GetObjectLabel: marshalled synchronously */
287796c5ddc4Srjsvoid GLAPIENTRY
287896c5ddc4Srjs_mesa_marshal_GetObjectLabel(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei * length, GLchar * label)
287996c5ddc4Srjs{
288096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
288196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetObjectLabel");
288296c5ddc4Srjs   CALL_GetObjectLabel(ctx->CurrentServerDispatch, (identifier, name, bufSize, length, label));
288396c5ddc4Srjs}
288496c5ddc4Srjs
288596c5ddc4Srjs
288696c5ddc4Srjs/* ObjectPtrLabel: marshalled synchronously */
288796c5ddc4Srjsvoid GLAPIENTRY
288896c5ddc4Srjs_mesa_marshal_ObjectPtrLabel(const GLvoid * ptr, GLsizei length, const GLchar * label)
288996c5ddc4Srjs{
289096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
289196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ObjectPtrLabel");
289296c5ddc4Srjs   CALL_ObjectPtrLabel(ctx->CurrentServerDispatch, (ptr, length, label));
289396c5ddc4Srjs}
289496c5ddc4Srjs
289596c5ddc4Srjs
289696c5ddc4Srjs/* GetObjectPtrLabel: marshalled synchronously */
289796c5ddc4Srjsvoid GLAPIENTRY
289896c5ddc4Srjs_mesa_marshal_GetObjectPtrLabel(const GLvoid * ptr, GLsizei bufSize, GLsizei * length, GLchar * label)
289996c5ddc4Srjs{
290096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
290196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetObjectPtrLabel");
290296c5ddc4Srjs   CALL_GetObjectPtrLabel(ctx->CurrentServerDispatch, (ptr, bufSize, length, label));
290396c5ddc4Srjs}
290496c5ddc4Srjs
290596c5ddc4Srjs
290696c5ddc4Srjs/* ClearBufferData: marshalled synchronously */
290796c5ddc4Srjsvoid GLAPIENTRY
290896c5ddc4Srjs_mesa_marshal_ClearBufferData(GLenum target, GLenum internalformat, GLenum format, GLenum type, const GLvoid * data)
290996c5ddc4Srjs{
291096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
291196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ClearBufferData");
291296c5ddc4Srjs   CALL_ClearBufferData(ctx->CurrentServerDispatch, (target, internalformat, format, type, data));
291396c5ddc4Srjs}
291496c5ddc4Srjs
291596c5ddc4Srjs
291696c5ddc4Srjs/* ClearBufferSubData: marshalled synchronously */
291796c5ddc4Srjsvoid GLAPIENTRY
291896c5ddc4Srjs_mesa_marshal_ClearBufferSubData(GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid * data)
291996c5ddc4Srjs{
292096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
292196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ClearBufferSubData");
292296c5ddc4Srjs   CALL_ClearBufferSubData(ctx->CurrentServerDispatch, (target, internalformat, offset, size, format, type, data));
292396c5ddc4Srjs}
292496c5ddc4Srjs
292596c5ddc4Srjs
292696c5ddc4Srjs/* ClearNamedBufferDataEXT: marshalled synchronously */
292796c5ddc4Srjsvoid GLAPIENTRY
292896c5ddc4Srjs_mesa_marshal_ClearNamedBufferDataEXT(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const GLvoid * data)
292996c5ddc4Srjs{
293096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
293196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ClearNamedBufferDataEXT");
293296c5ddc4Srjs   CALL_ClearNamedBufferDataEXT(ctx->CurrentServerDispatch, (buffer, internalformat, format, type, data));
293396c5ddc4Srjs}
293496c5ddc4Srjs
293596c5ddc4Srjs
293696c5ddc4Srjs/* ClearNamedBufferSubDataEXT: marshalled synchronously */
293796c5ddc4Srjsvoid GLAPIENTRY
293896c5ddc4Srjs_mesa_marshal_ClearNamedBufferSubDataEXT(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid * data)
293996c5ddc4Srjs{
294096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
294196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ClearNamedBufferSubDataEXT");
294296c5ddc4Srjs   CALL_ClearNamedBufferSubDataEXT(ctx->CurrentServerDispatch, (buffer, internalformat, offset, size, format, type, data));
294396c5ddc4Srjs}
294496c5ddc4Srjs
294596c5ddc4Srjs
294696c5ddc4Srjs/* DispatchCompute: marshalled asynchronously */
294796c5ddc4Srjsstruct marshal_cmd_DispatchCompute
294896c5ddc4Srjs{
294996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
295096c5ddc4Srjs   GLuint num_groups_x;
295196c5ddc4Srjs   GLuint num_groups_y;
295296c5ddc4Srjs   GLuint num_groups_z;
295396c5ddc4Srjs};
295496c5ddc4Srjsuint32_t
295596c5ddc4Srjs_mesa_unmarshal_DispatchCompute(struct gl_context *ctx, const struct marshal_cmd_DispatchCompute *cmd, const uint64_t *last)
295696c5ddc4Srjs{
295796c5ddc4Srjs   GLuint num_groups_x = cmd->num_groups_x;
295896c5ddc4Srjs   GLuint num_groups_y = cmd->num_groups_y;
295996c5ddc4Srjs   GLuint num_groups_z = cmd->num_groups_z;
296096c5ddc4Srjs   CALL_DispatchCompute(ctx->CurrentServerDispatch, (num_groups_x, num_groups_y, num_groups_z));
296196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DispatchCompute), 8) / 8);
296296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
296396c5ddc4Srjs   return cmd_size;
296496c5ddc4Srjs}
296596c5ddc4Srjsvoid GLAPIENTRY
296696c5ddc4Srjs_mesa_marshal_DispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)
296796c5ddc4Srjs{
296896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
296996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DispatchCompute);
297096c5ddc4Srjs   struct marshal_cmd_DispatchCompute *cmd;
297196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DispatchCompute, cmd_size);
297296c5ddc4Srjs   cmd->num_groups_x = num_groups_x;
297396c5ddc4Srjs   cmd->num_groups_y = num_groups_y;
297496c5ddc4Srjs   cmd->num_groups_z = num_groups_z;
297596c5ddc4Srjs}
297696c5ddc4Srjs
297796c5ddc4Srjs
297896c5ddc4Srjs/* DispatchComputeIndirect: marshalled asynchronously */
297996c5ddc4Srjsstruct marshal_cmd_DispatchComputeIndirect
298096c5ddc4Srjs{
298196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
298296c5ddc4Srjs   GLintptr indirect;
298396c5ddc4Srjs};
298496c5ddc4Srjsuint32_t
298596c5ddc4Srjs_mesa_unmarshal_DispatchComputeIndirect(struct gl_context *ctx, const struct marshal_cmd_DispatchComputeIndirect *cmd, const uint64_t *last)
298696c5ddc4Srjs{
298796c5ddc4Srjs   GLintptr indirect = cmd->indirect;
298896c5ddc4Srjs   CALL_DispatchComputeIndirect(ctx->CurrentServerDispatch, (indirect));
298996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DispatchComputeIndirect), 8) / 8);
299096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
299196c5ddc4Srjs   return cmd_size;
299296c5ddc4Srjs}
299396c5ddc4Srjsvoid GLAPIENTRY
299496c5ddc4Srjs_mesa_marshal_DispatchComputeIndirect(GLintptr indirect)
299596c5ddc4Srjs{
299696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
299796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DispatchComputeIndirect);
299896c5ddc4Srjs   struct marshal_cmd_DispatchComputeIndirect *cmd;
299996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DispatchComputeIndirect, cmd_size);
300096c5ddc4Srjs   cmd->indirect = indirect;
300196c5ddc4Srjs}
300296c5ddc4Srjs
300396c5ddc4Srjs
300496c5ddc4Srjs/* CopyImageSubData: marshalled asynchronously */
300596c5ddc4Srjsstruct marshal_cmd_CopyImageSubData
300696c5ddc4Srjs{
300796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
300896c5ddc4Srjs   GLuint srcName;
300996c5ddc4Srjs   GLenum srcTarget;
301096c5ddc4Srjs   GLint srcLevel;
301196c5ddc4Srjs   GLint srcX;
301296c5ddc4Srjs   GLint srcY;
301396c5ddc4Srjs   GLint srcZ;
301496c5ddc4Srjs   GLuint dstName;
301596c5ddc4Srjs   GLenum dstTarget;
301696c5ddc4Srjs   GLint dstLevel;
301796c5ddc4Srjs   GLint dstX;
301896c5ddc4Srjs   GLint dstY;
301996c5ddc4Srjs   GLint dstZ;
302096c5ddc4Srjs   GLsizei srcWidth;
302196c5ddc4Srjs   GLsizei srcHeight;
302296c5ddc4Srjs   GLsizei srcDepth;
302396c5ddc4Srjs};
302496c5ddc4Srjsuint32_t
302596c5ddc4Srjs_mesa_unmarshal_CopyImageSubData(struct gl_context *ctx, const struct marshal_cmd_CopyImageSubData *cmd, const uint64_t *last)
302696c5ddc4Srjs{
302796c5ddc4Srjs   GLuint srcName = cmd->srcName;
302896c5ddc4Srjs   GLenum srcTarget = cmd->srcTarget;
302996c5ddc4Srjs   GLint srcLevel = cmd->srcLevel;
303096c5ddc4Srjs   GLint srcX = cmd->srcX;
303196c5ddc4Srjs   GLint srcY = cmd->srcY;
303296c5ddc4Srjs   GLint srcZ = cmd->srcZ;
303396c5ddc4Srjs   GLuint dstName = cmd->dstName;
303496c5ddc4Srjs   GLenum dstTarget = cmd->dstTarget;
303596c5ddc4Srjs   GLint dstLevel = cmd->dstLevel;
303696c5ddc4Srjs   GLint dstX = cmd->dstX;
303796c5ddc4Srjs   GLint dstY = cmd->dstY;
303896c5ddc4Srjs   GLint dstZ = cmd->dstZ;
303996c5ddc4Srjs   GLsizei srcWidth = cmd->srcWidth;
304096c5ddc4Srjs   GLsizei srcHeight = cmd->srcHeight;
304196c5ddc4Srjs   GLsizei srcDepth = cmd->srcDepth;
304296c5ddc4Srjs   CALL_CopyImageSubData(ctx->CurrentServerDispatch, (srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth));
304396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CopyImageSubData), 8) / 8);
304496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
304596c5ddc4Srjs   return cmd_size;
304696c5ddc4Srjs}
304796c5ddc4Srjsvoid GLAPIENTRY
304896c5ddc4Srjs_mesa_marshal_CopyImageSubData(GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth)
304996c5ddc4Srjs{
305096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
305196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CopyImageSubData);
305296c5ddc4Srjs   struct marshal_cmd_CopyImageSubData *cmd;
305396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyImageSubData, cmd_size);
305496c5ddc4Srjs   cmd->srcName = srcName;
305596c5ddc4Srjs   cmd->srcTarget = srcTarget;
305696c5ddc4Srjs   cmd->srcLevel = srcLevel;
305796c5ddc4Srjs   cmd->srcX = srcX;
305896c5ddc4Srjs   cmd->srcY = srcY;
305996c5ddc4Srjs   cmd->srcZ = srcZ;
306096c5ddc4Srjs   cmd->dstName = dstName;
306196c5ddc4Srjs   cmd->dstTarget = dstTarget;
306296c5ddc4Srjs   cmd->dstLevel = dstLevel;
306396c5ddc4Srjs   cmd->dstX = dstX;
306496c5ddc4Srjs   cmd->dstY = dstY;
306596c5ddc4Srjs   cmd->dstZ = dstZ;
306696c5ddc4Srjs   cmd->srcWidth = srcWidth;
306796c5ddc4Srjs   cmd->srcHeight = srcHeight;
306896c5ddc4Srjs   cmd->srcDepth = srcDepth;
306996c5ddc4Srjs}
307096c5ddc4Srjs
307196c5ddc4Srjs
307296c5ddc4Srjs/* TextureView: marshalled asynchronously */
307396c5ddc4Srjsstruct marshal_cmd_TextureView
307496c5ddc4Srjs{
307596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
307696c5ddc4Srjs   GLuint texture;
307796c5ddc4Srjs   GLenum target;
307896c5ddc4Srjs   GLuint origtexture;
307996c5ddc4Srjs   GLenum internalformat;
308096c5ddc4Srjs   GLuint minlevel;
308196c5ddc4Srjs   GLuint numlevels;
308296c5ddc4Srjs   GLuint minlayer;
308396c5ddc4Srjs   GLuint numlayers;
308496c5ddc4Srjs};
308596c5ddc4Srjsuint32_t
308696c5ddc4Srjs_mesa_unmarshal_TextureView(struct gl_context *ctx, const struct marshal_cmd_TextureView *cmd, const uint64_t *last)
308796c5ddc4Srjs{
308896c5ddc4Srjs   GLuint texture = cmd->texture;
308996c5ddc4Srjs   GLenum target = cmd->target;
309096c5ddc4Srjs   GLuint origtexture = cmd->origtexture;
309196c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
309296c5ddc4Srjs   GLuint minlevel = cmd->minlevel;
309396c5ddc4Srjs   GLuint numlevels = cmd->numlevels;
309496c5ddc4Srjs   GLuint minlayer = cmd->minlayer;
309596c5ddc4Srjs   GLuint numlayers = cmd->numlayers;
309696c5ddc4Srjs   CALL_TextureView(ctx->CurrentServerDispatch, (texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers));
309796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureView), 8) / 8);
309896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
309996c5ddc4Srjs   return cmd_size;
310096c5ddc4Srjs}
310196c5ddc4Srjsvoid GLAPIENTRY
310296c5ddc4Srjs_mesa_marshal_TextureView(GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers)
310396c5ddc4Srjs{
310496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
310596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureView);
310696c5ddc4Srjs   struct marshal_cmd_TextureView *cmd;
310796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureView, cmd_size);
310896c5ddc4Srjs   cmd->texture = texture;
310996c5ddc4Srjs   cmd->target = target;
311096c5ddc4Srjs   cmd->origtexture = origtexture;
311196c5ddc4Srjs   cmd->internalformat = internalformat;
311296c5ddc4Srjs   cmd->minlevel = minlevel;
311396c5ddc4Srjs   cmd->numlevels = numlevels;
311496c5ddc4Srjs   cmd->minlayer = minlayer;
311596c5ddc4Srjs   cmd->numlayers = numlayers;
311696c5ddc4Srjs}
311796c5ddc4Srjs
311896c5ddc4Srjs
311996c5ddc4Srjs/* BindVertexBuffer: marshalled asynchronously */
312096c5ddc4Srjsstruct marshal_cmd_BindVertexBuffer
312196c5ddc4Srjs{
312296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
312396c5ddc4Srjs   GLuint bindingindex;
312496c5ddc4Srjs   GLuint buffer;
312596c5ddc4Srjs   GLsizei stride;
312696c5ddc4Srjs   GLintptr offset;
312796c5ddc4Srjs};
312896c5ddc4Srjsuint32_t
312996c5ddc4Srjs_mesa_unmarshal_BindVertexBuffer(struct gl_context *ctx, const struct marshal_cmd_BindVertexBuffer *cmd, const uint64_t *last)
313096c5ddc4Srjs{
313196c5ddc4Srjs   GLuint bindingindex = cmd->bindingindex;
313296c5ddc4Srjs   GLuint buffer = cmd->buffer;
313396c5ddc4Srjs   GLintptr offset = cmd->offset;
313496c5ddc4Srjs   GLsizei stride = cmd->stride;
313596c5ddc4Srjs   CALL_BindVertexBuffer(ctx->CurrentServerDispatch, (bindingindex, buffer, offset, stride));
313696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindVertexBuffer), 8) / 8);
313796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
313896c5ddc4Srjs   return cmd_size;
313996c5ddc4Srjs}
314096c5ddc4Srjsvoid GLAPIENTRY
314196c5ddc4Srjs_mesa_marshal_BindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride)
314296c5ddc4Srjs{
314396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
314496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindVertexBuffer);
314596c5ddc4Srjs   struct marshal_cmd_BindVertexBuffer *cmd;
314696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindVertexBuffer, cmd_size);
314796c5ddc4Srjs   cmd->bindingindex = bindingindex;
314896c5ddc4Srjs   cmd->buffer = buffer;
314996c5ddc4Srjs   cmd->offset = offset;
315096c5ddc4Srjs   cmd->stride = stride;
315196c5ddc4Srjs   if (COMPAT) _mesa_glthread_VertexBuffer(ctx, bindingindex, buffer, offset, stride);
315296c5ddc4Srjs}
315396c5ddc4Srjs
315496c5ddc4Srjs
315596c5ddc4Srjs/* VertexAttribFormat: marshalled asynchronously */
315696c5ddc4Srjsstruct marshal_cmd_VertexAttribFormat
315796c5ddc4Srjs{
315896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
315996c5ddc4Srjs   GLboolean normalized;
316096c5ddc4Srjs   GLuint attribindex;
316196c5ddc4Srjs   GLint size;
316296c5ddc4Srjs   GLenum type;
316396c5ddc4Srjs   GLuint relativeoffset;
316496c5ddc4Srjs};
316596c5ddc4Srjsuint32_t
316696c5ddc4Srjs_mesa_unmarshal_VertexAttribFormat(struct gl_context *ctx, const struct marshal_cmd_VertexAttribFormat *cmd, const uint64_t *last)
316796c5ddc4Srjs{
316896c5ddc4Srjs   GLuint attribindex = cmd->attribindex;
316996c5ddc4Srjs   GLint size = cmd->size;
317096c5ddc4Srjs   GLenum type = cmd->type;
317196c5ddc4Srjs   GLboolean normalized = cmd->normalized;
317296c5ddc4Srjs   GLuint relativeoffset = cmd->relativeoffset;
317396c5ddc4Srjs   CALL_VertexAttribFormat(ctx->CurrentServerDispatch, (attribindex, size, type, normalized, relativeoffset));
317496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribFormat), 8) / 8);
317596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
317696c5ddc4Srjs   return cmd_size;
317796c5ddc4Srjs}
317896c5ddc4Srjsvoid GLAPIENTRY
317996c5ddc4Srjs_mesa_marshal_VertexAttribFormat(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)
318096c5ddc4Srjs{
318196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
318296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribFormat);
318396c5ddc4Srjs   struct marshal_cmd_VertexAttribFormat *cmd;
318496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribFormat, cmd_size);
318596c5ddc4Srjs   cmd->attribindex = attribindex;
318696c5ddc4Srjs   cmd->size = size;
318796c5ddc4Srjs   cmd->type = type;
318896c5ddc4Srjs   cmd->normalized = normalized;
318996c5ddc4Srjs   cmd->relativeoffset = relativeoffset;
319096c5ddc4Srjs   if (COMPAT) _mesa_glthread_AttribFormat(ctx, attribindex, size, type, relativeoffset);
319196c5ddc4Srjs}
319296c5ddc4Srjs
319396c5ddc4Srjs
319496c5ddc4Srjs/* VertexAttribIFormat: marshalled asynchronously */
319596c5ddc4Srjsstruct marshal_cmd_VertexAttribIFormat
319696c5ddc4Srjs{
319796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
319896c5ddc4Srjs   GLuint attribindex;
319996c5ddc4Srjs   GLint size;
320096c5ddc4Srjs   GLenum type;
320196c5ddc4Srjs   GLuint relativeoffset;
320296c5ddc4Srjs};
320396c5ddc4Srjsuint32_t
320496c5ddc4Srjs_mesa_unmarshal_VertexAttribIFormat(struct gl_context *ctx, const struct marshal_cmd_VertexAttribIFormat *cmd, const uint64_t *last)
320596c5ddc4Srjs{
320696c5ddc4Srjs   GLuint attribindex = cmd->attribindex;
320796c5ddc4Srjs   GLint size = cmd->size;
320896c5ddc4Srjs   GLenum type = cmd->type;
320996c5ddc4Srjs   GLuint relativeoffset = cmd->relativeoffset;
321096c5ddc4Srjs   CALL_VertexAttribIFormat(ctx->CurrentServerDispatch, (attribindex, size, type, relativeoffset));
321196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribIFormat), 8) / 8);
321296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
321396c5ddc4Srjs   return cmd_size;
321496c5ddc4Srjs}
321596c5ddc4Srjsvoid GLAPIENTRY
321696c5ddc4Srjs_mesa_marshal_VertexAttribIFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
321796c5ddc4Srjs{
321896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
321996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribIFormat);
322096c5ddc4Srjs   struct marshal_cmd_VertexAttribIFormat *cmd;
322196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribIFormat, cmd_size);
322296c5ddc4Srjs   cmd->attribindex = attribindex;
322396c5ddc4Srjs   cmd->size = size;
322496c5ddc4Srjs   cmd->type = type;
322596c5ddc4Srjs   cmd->relativeoffset = relativeoffset;
322696c5ddc4Srjs   if (COMPAT) _mesa_glthread_AttribFormat(ctx, attribindex, size, type, relativeoffset);
322796c5ddc4Srjs}
322896c5ddc4Srjs
322996c5ddc4Srjs
323096c5ddc4Srjs/* VertexAttribLFormat: marshalled asynchronously */
323196c5ddc4Srjsstruct marshal_cmd_VertexAttribLFormat
323296c5ddc4Srjs{
323396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
323496c5ddc4Srjs   GLuint attribindex;
323596c5ddc4Srjs   GLint size;
323696c5ddc4Srjs   GLenum type;
323796c5ddc4Srjs   GLuint relativeoffset;
323896c5ddc4Srjs};
323996c5ddc4Srjsuint32_t
324096c5ddc4Srjs_mesa_unmarshal_VertexAttribLFormat(struct gl_context *ctx, const struct marshal_cmd_VertexAttribLFormat *cmd, const uint64_t *last)
324196c5ddc4Srjs{
324296c5ddc4Srjs   GLuint attribindex = cmd->attribindex;
324396c5ddc4Srjs   GLint size = cmd->size;
324496c5ddc4Srjs   GLenum type = cmd->type;
324596c5ddc4Srjs   GLuint relativeoffset = cmd->relativeoffset;
324696c5ddc4Srjs   CALL_VertexAttribLFormat(ctx->CurrentServerDispatch, (attribindex, size, type, relativeoffset));
324796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribLFormat), 8) / 8);
324896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
324996c5ddc4Srjs   return cmd_size;
325096c5ddc4Srjs}
325196c5ddc4Srjsvoid GLAPIENTRY
325296c5ddc4Srjs_mesa_marshal_VertexAttribLFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
325396c5ddc4Srjs{
325496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
325596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribLFormat);
325696c5ddc4Srjs   struct marshal_cmd_VertexAttribLFormat *cmd;
325796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribLFormat, cmd_size);
325896c5ddc4Srjs   cmd->attribindex = attribindex;
325996c5ddc4Srjs   cmd->size = size;
326096c5ddc4Srjs   cmd->type = type;
326196c5ddc4Srjs   cmd->relativeoffset = relativeoffset;
326296c5ddc4Srjs   if (COMPAT) _mesa_glthread_AttribFormat(ctx, attribindex, size, type, relativeoffset);
326396c5ddc4Srjs}
326496c5ddc4Srjs
326596c5ddc4Srjs
326696c5ddc4Srjs/* VertexAttribBinding: marshalled asynchronously */
326796c5ddc4Srjsstruct marshal_cmd_VertexAttribBinding
326896c5ddc4Srjs{
326996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
327096c5ddc4Srjs   GLuint attribindex;
327196c5ddc4Srjs   GLuint bindingindex;
327296c5ddc4Srjs};
327396c5ddc4Srjsuint32_t
327496c5ddc4Srjs_mesa_unmarshal_VertexAttribBinding(struct gl_context *ctx, const struct marshal_cmd_VertexAttribBinding *cmd, const uint64_t *last)
327596c5ddc4Srjs{
327696c5ddc4Srjs   GLuint attribindex = cmd->attribindex;
327796c5ddc4Srjs   GLuint bindingindex = cmd->bindingindex;
327896c5ddc4Srjs   CALL_VertexAttribBinding(ctx->CurrentServerDispatch, (attribindex, bindingindex));
327996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribBinding), 8) / 8);
328096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
328196c5ddc4Srjs   return cmd_size;
328296c5ddc4Srjs}
328396c5ddc4Srjsvoid GLAPIENTRY
328496c5ddc4Srjs_mesa_marshal_VertexAttribBinding(GLuint attribindex, GLuint bindingindex)
328596c5ddc4Srjs{
328696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
328796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribBinding);
328896c5ddc4Srjs   struct marshal_cmd_VertexAttribBinding *cmd;
328996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribBinding, cmd_size);
329096c5ddc4Srjs   cmd->attribindex = attribindex;
329196c5ddc4Srjs   cmd->bindingindex = bindingindex;
329296c5ddc4Srjs   if (COMPAT) _mesa_glthread_AttribBinding(ctx, attribindex, bindingindex);
329396c5ddc4Srjs}
329496c5ddc4Srjs
329596c5ddc4Srjs
329696c5ddc4Srjs/* VertexBindingDivisor: marshalled asynchronously */
329796c5ddc4Srjsstruct marshal_cmd_VertexBindingDivisor
329896c5ddc4Srjs{
329996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
330096c5ddc4Srjs   GLuint bindingindex;
330196c5ddc4Srjs   GLuint divisor;
330296c5ddc4Srjs};
330396c5ddc4Srjsuint32_t
330496c5ddc4Srjs_mesa_unmarshal_VertexBindingDivisor(struct gl_context *ctx, const struct marshal_cmd_VertexBindingDivisor *cmd, const uint64_t *last)
330596c5ddc4Srjs{
330696c5ddc4Srjs   GLuint bindingindex = cmd->bindingindex;
330796c5ddc4Srjs   GLuint divisor = cmd->divisor;
330896c5ddc4Srjs   CALL_VertexBindingDivisor(ctx->CurrentServerDispatch, (bindingindex, divisor));
330996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexBindingDivisor), 8) / 8);
331096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
331196c5ddc4Srjs   return cmd_size;
331296c5ddc4Srjs}
331396c5ddc4Srjsvoid GLAPIENTRY
331496c5ddc4Srjs_mesa_marshal_VertexBindingDivisor(GLuint bindingindex, GLuint divisor)
331596c5ddc4Srjs{
331696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
331796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexBindingDivisor);
331896c5ddc4Srjs   struct marshal_cmd_VertexBindingDivisor *cmd;
331996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexBindingDivisor, cmd_size);
332096c5ddc4Srjs   cmd->bindingindex = bindingindex;
332196c5ddc4Srjs   cmd->divisor = divisor;
332296c5ddc4Srjs   if (COMPAT) _mesa_glthread_BindingDivisor(ctx, bindingindex, divisor);
332396c5ddc4Srjs}
332496c5ddc4Srjs
332596c5ddc4Srjs
332696c5ddc4Srjs/* VertexArrayBindVertexBufferEXT: marshalled asynchronously */
332796c5ddc4Srjsstruct marshal_cmd_VertexArrayBindVertexBufferEXT
332896c5ddc4Srjs{
332996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
333096c5ddc4Srjs   GLuint vaobj;
333196c5ddc4Srjs   GLuint bindingindex;
333296c5ddc4Srjs   GLuint buffer;
333396c5ddc4Srjs   GLsizei stride;
333496c5ddc4Srjs   GLintptr offset;
333596c5ddc4Srjs};
333696c5ddc4Srjsuint32_t
333796c5ddc4Srjs_mesa_unmarshal_VertexArrayBindVertexBufferEXT(struct gl_context *ctx, const struct marshal_cmd_VertexArrayBindVertexBufferEXT *cmd, const uint64_t *last)
333896c5ddc4Srjs{
333996c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
334096c5ddc4Srjs   GLuint bindingindex = cmd->bindingindex;
334196c5ddc4Srjs   GLuint buffer = cmd->buffer;
334296c5ddc4Srjs   GLintptr offset = cmd->offset;
334396c5ddc4Srjs   GLsizei stride = cmd->stride;
334496c5ddc4Srjs   CALL_VertexArrayBindVertexBufferEXT(ctx->CurrentServerDispatch, (vaobj, bindingindex, buffer, offset, stride));
334596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexArrayBindVertexBufferEXT), 8) / 8);
334696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
334796c5ddc4Srjs   return cmd_size;
334896c5ddc4Srjs}
334996c5ddc4Srjsvoid GLAPIENTRY
335096c5ddc4Srjs_mesa_marshal_VertexArrayBindVertexBufferEXT(GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride)
335196c5ddc4Srjs{
335296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
335396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexArrayBindVertexBufferEXT);
335496c5ddc4Srjs   struct marshal_cmd_VertexArrayBindVertexBufferEXT *cmd;
335596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayBindVertexBufferEXT, cmd_size);
335696c5ddc4Srjs   cmd->vaobj = vaobj;
335796c5ddc4Srjs   cmd->bindingindex = bindingindex;
335896c5ddc4Srjs   cmd->buffer = buffer;
335996c5ddc4Srjs   cmd->offset = offset;
336096c5ddc4Srjs   cmd->stride = stride;
336196c5ddc4Srjs   if (COMPAT) _mesa_glthread_DSAVertexBuffer(ctx, vaobj, bindingindex, buffer, offset, stride);
336296c5ddc4Srjs}
336396c5ddc4Srjs
336496c5ddc4Srjs
336596c5ddc4Srjs/* VertexArrayVertexAttribFormatEXT: marshalled asynchronously */
336696c5ddc4Srjsstruct marshal_cmd_VertexArrayVertexAttribFormatEXT
336796c5ddc4Srjs{
336896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
336996c5ddc4Srjs   GLboolean normalized;
337096c5ddc4Srjs   GLuint vaobj;
337196c5ddc4Srjs   GLuint attribindex;
337296c5ddc4Srjs   GLint size;
337396c5ddc4Srjs   GLenum type;
337496c5ddc4Srjs   GLuint relativeoffset;
337596c5ddc4Srjs};
337696c5ddc4Srjsuint32_t
337796c5ddc4Srjs_mesa_unmarshal_VertexArrayVertexAttribFormatEXT(struct gl_context *ctx, const struct marshal_cmd_VertexArrayVertexAttribFormatEXT *cmd, const uint64_t *last)
337896c5ddc4Srjs{
337996c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
338096c5ddc4Srjs   GLuint attribindex = cmd->attribindex;
338196c5ddc4Srjs   GLint size = cmd->size;
338296c5ddc4Srjs   GLenum type = cmd->type;
338396c5ddc4Srjs   GLboolean normalized = cmd->normalized;
338496c5ddc4Srjs   GLuint relativeoffset = cmd->relativeoffset;
338596c5ddc4Srjs   CALL_VertexArrayVertexAttribFormatEXT(ctx->CurrentServerDispatch, (vaobj, attribindex, size, type, normalized, relativeoffset));
338696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexArrayVertexAttribFormatEXT), 8) / 8);
338796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
338896c5ddc4Srjs   return cmd_size;
338996c5ddc4Srjs}
339096c5ddc4Srjsvoid GLAPIENTRY
339196c5ddc4Srjs_mesa_marshal_VertexArrayVertexAttribFormatEXT(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)
339296c5ddc4Srjs{
339396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
339496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexArrayVertexAttribFormatEXT);
339596c5ddc4Srjs   struct marshal_cmd_VertexArrayVertexAttribFormatEXT *cmd;
339696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayVertexAttribFormatEXT, cmd_size);
339796c5ddc4Srjs   cmd->vaobj = vaobj;
339896c5ddc4Srjs   cmd->attribindex = attribindex;
339996c5ddc4Srjs   cmd->size = size;
340096c5ddc4Srjs   cmd->type = type;
340196c5ddc4Srjs   cmd->normalized = normalized;
340296c5ddc4Srjs   cmd->relativeoffset = relativeoffset;
340396c5ddc4Srjs   if (COMPAT) _mesa_glthread_DSAAttribFormat(ctx, vaobj, attribindex, size, type, relativeoffset);
340496c5ddc4Srjs}
340596c5ddc4Srjs
340696c5ddc4Srjs
340796c5ddc4Srjs/* VertexArrayVertexAttribIFormatEXT: marshalled asynchronously */
340896c5ddc4Srjsstruct marshal_cmd_VertexArrayVertexAttribIFormatEXT
340996c5ddc4Srjs{
341096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
341196c5ddc4Srjs   GLuint vaobj;
341296c5ddc4Srjs   GLuint attribindex;
341396c5ddc4Srjs   GLint size;
341496c5ddc4Srjs   GLenum type;
341596c5ddc4Srjs   GLuint relativeoffset;
341696c5ddc4Srjs};
341796c5ddc4Srjsuint32_t
341896c5ddc4Srjs_mesa_unmarshal_VertexArrayVertexAttribIFormatEXT(struct gl_context *ctx, const struct marshal_cmd_VertexArrayVertexAttribIFormatEXT *cmd, const uint64_t *last)
341996c5ddc4Srjs{
342096c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
342196c5ddc4Srjs   GLuint attribindex = cmd->attribindex;
342296c5ddc4Srjs   GLint size = cmd->size;
342396c5ddc4Srjs   GLenum type = cmd->type;
342496c5ddc4Srjs   GLuint relativeoffset = cmd->relativeoffset;
342596c5ddc4Srjs   CALL_VertexArrayVertexAttribIFormatEXT(ctx->CurrentServerDispatch, (vaobj, attribindex, size, type, relativeoffset));
342696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexArrayVertexAttribIFormatEXT), 8) / 8);
342796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
342896c5ddc4Srjs   return cmd_size;
342996c5ddc4Srjs}
343096c5ddc4Srjsvoid GLAPIENTRY
343196c5ddc4Srjs_mesa_marshal_VertexArrayVertexAttribIFormatEXT(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
343296c5ddc4Srjs{
343396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
343496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexArrayVertexAttribIFormatEXT);
343596c5ddc4Srjs   struct marshal_cmd_VertexArrayVertexAttribIFormatEXT *cmd;
343696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayVertexAttribIFormatEXT, cmd_size);
343796c5ddc4Srjs   cmd->vaobj = vaobj;
343896c5ddc4Srjs   cmd->attribindex = attribindex;
343996c5ddc4Srjs   cmd->size = size;
344096c5ddc4Srjs   cmd->type = type;
344196c5ddc4Srjs   cmd->relativeoffset = relativeoffset;
344296c5ddc4Srjs   if (COMPAT) _mesa_glthread_DSAAttribFormat(ctx, vaobj, attribindex, size, type, relativeoffset);
344396c5ddc4Srjs}
344496c5ddc4Srjs
344596c5ddc4Srjs
344696c5ddc4Srjs/* VertexArrayVertexAttribLFormatEXT: marshalled asynchronously */
344796c5ddc4Srjsstruct marshal_cmd_VertexArrayVertexAttribLFormatEXT
344896c5ddc4Srjs{
344996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
345096c5ddc4Srjs   GLuint vaobj;
345196c5ddc4Srjs   GLuint attribindex;
345296c5ddc4Srjs   GLint size;
345396c5ddc4Srjs   GLenum type;
345496c5ddc4Srjs   GLuint relativeoffset;
345596c5ddc4Srjs};
345696c5ddc4Srjsuint32_t
345796c5ddc4Srjs_mesa_unmarshal_VertexArrayVertexAttribLFormatEXT(struct gl_context *ctx, const struct marshal_cmd_VertexArrayVertexAttribLFormatEXT *cmd, const uint64_t *last)
345896c5ddc4Srjs{
345996c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
346096c5ddc4Srjs   GLuint attribindex = cmd->attribindex;
346196c5ddc4Srjs   GLint size = cmd->size;
346296c5ddc4Srjs   GLenum type = cmd->type;
346396c5ddc4Srjs   GLuint relativeoffset = cmd->relativeoffset;
346496c5ddc4Srjs   CALL_VertexArrayVertexAttribLFormatEXT(ctx->CurrentServerDispatch, (vaobj, attribindex, size, type, relativeoffset));
346596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexArrayVertexAttribLFormatEXT), 8) / 8);
346696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
346796c5ddc4Srjs   return cmd_size;
346896c5ddc4Srjs}
346996c5ddc4Srjsvoid GLAPIENTRY
347096c5ddc4Srjs_mesa_marshal_VertexArrayVertexAttribLFormatEXT(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
347196c5ddc4Srjs{
347296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
347396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexArrayVertexAttribLFormatEXT);
347496c5ddc4Srjs   struct marshal_cmd_VertexArrayVertexAttribLFormatEXT *cmd;
347596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayVertexAttribLFormatEXT, cmd_size);
347696c5ddc4Srjs   cmd->vaobj = vaobj;
347796c5ddc4Srjs   cmd->attribindex = attribindex;
347896c5ddc4Srjs   cmd->size = size;
347996c5ddc4Srjs   cmd->type = type;
348096c5ddc4Srjs   cmd->relativeoffset = relativeoffset;
348196c5ddc4Srjs   if (COMPAT) _mesa_glthread_DSAAttribFormat(ctx, vaobj, attribindex, size, type, relativeoffset);
348296c5ddc4Srjs}
348396c5ddc4Srjs
348496c5ddc4Srjs
348596c5ddc4Srjs/* VertexArrayVertexAttribBindingEXT: marshalled asynchronously */
348696c5ddc4Srjsstruct marshal_cmd_VertexArrayVertexAttribBindingEXT
348796c5ddc4Srjs{
348896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
348996c5ddc4Srjs   GLuint vaobj;
349096c5ddc4Srjs   GLuint attribindex;
349196c5ddc4Srjs   GLuint bindingindex;
349296c5ddc4Srjs};
349396c5ddc4Srjsuint32_t
349496c5ddc4Srjs_mesa_unmarshal_VertexArrayVertexAttribBindingEXT(struct gl_context *ctx, const struct marshal_cmd_VertexArrayVertexAttribBindingEXT *cmd, const uint64_t *last)
349596c5ddc4Srjs{
349696c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
349796c5ddc4Srjs   GLuint attribindex = cmd->attribindex;
349896c5ddc4Srjs   GLuint bindingindex = cmd->bindingindex;
349996c5ddc4Srjs   CALL_VertexArrayVertexAttribBindingEXT(ctx->CurrentServerDispatch, (vaobj, attribindex, bindingindex));
350096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexArrayVertexAttribBindingEXT), 8) / 8);
350196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
350296c5ddc4Srjs   return cmd_size;
350396c5ddc4Srjs}
350496c5ddc4Srjsvoid GLAPIENTRY
350596c5ddc4Srjs_mesa_marshal_VertexArrayVertexAttribBindingEXT(GLuint vaobj, GLuint attribindex, GLuint bindingindex)
350696c5ddc4Srjs{
350796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
350896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexArrayVertexAttribBindingEXT);
350996c5ddc4Srjs   struct marshal_cmd_VertexArrayVertexAttribBindingEXT *cmd;
351096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayVertexAttribBindingEXT, cmd_size);
351196c5ddc4Srjs   cmd->vaobj = vaobj;
351296c5ddc4Srjs   cmd->attribindex = attribindex;
351396c5ddc4Srjs   cmd->bindingindex = bindingindex;
351496c5ddc4Srjs   if (COMPAT) _mesa_glthread_DSAAttribBinding(ctx, vaobj, attribindex, bindingindex);
351596c5ddc4Srjs}
351696c5ddc4Srjs
351796c5ddc4Srjs
351896c5ddc4Srjs/* VertexArrayVertexBindingDivisorEXT: marshalled asynchronously */
351996c5ddc4Srjsstruct marshal_cmd_VertexArrayVertexBindingDivisorEXT
352096c5ddc4Srjs{
352196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
352296c5ddc4Srjs   GLuint vaobj;
352396c5ddc4Srjs   GLuint bindingindex;
352496c5ddc4Srjs   GLuint divisor;
352596c5ddc4Srjs};
352696c5ddc4Srjsuint32_t
352796c5ddc4Srjs_mesa_unmarshal_VertexArrayVertexBindingDivisorEXT(struct gl_context *ctx, const struct marshal_cmd_VertexArrayVertexBindingDivisorEXT *cmd, const uint64_t *last)
352896c5ddc4Srjs{
352996c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
353096c5ddc4Srjs   GLuint bindingindex = cmd->bindingindex;
353196c5ddc4Srjs   GLuint divisor = cmd->divisor;
353296c5ddc4Srjs   CALL_VertexArrayVertexBindingDivisorEXT(ctx->CurrentServerDispatch, (vaobj, bindingindex, divisor));
353396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexArrayVertexBindingDivisorEXT), 8) / 8);
353496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
353596c5ddc4Srjs   return cmd_size;
353696c5ddc4Srjs}
353796c5ddc4Srjsvoid GLAPIENTRY
353896c5ddc4Srjs_mesa_marshal_VertexArrayVertexBindingDivisorEXT(GLuint vaobj, GLuint bindingindex, GLuint divisor)
353996c5ddc4Srjs{
354096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
354196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexArrayVertexBindingDivisorEXT);
354296c5ddc4Srjs   struct marshal_cmd_VertexArrayVertexBindingDivisorEXT *cmd;
354396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayVertexBindingDivisorEXT, cmd_size);
354496c5ddc4Srjs   cmd->vaobj = vaobj;
354596c5ddc4Srjs   cmd->bindingindex = bindingindex;
354696c5ddc4Srjs   cmd->divisor = divisor;
354796c5ddc4Srjs   if (COMPAT) _mesa_glthread_DSABindingDivisor(ctx, vaobj, bindingindex, divisor);
354896c5ddc4Srjs}
354996c5ddc4Srjs
355096c5ddc4Srjs
355196c5ddc4Srjs/* FramebufferParameteri: marshalled asynchronously */
355296c5ddc4Srjsstruct marshal_cmd_FramebufferParameteri
355396c5ddc4Srjs{
355496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
355596c5ddc4Srjs   GLenum target;
355696c5ddc4Srjs   GLenum pname;
355796c5ddc4Srjs   GLint param;
355896c5ddc4Srjs};
355996c5ddc4Srjsuint32_t
356096c5ddc4Srjs_mesa_unmarshal_FramebufferParameteri(struct gl_context *ctx, const struct marshal_cmd_FramebufferParameteri *cmd, const uint64_t *last)
356196c5ddc4Srjs{
356296c5ddc4Srjs   GLenum target = cmd->target;
356396c5ddc4Srjs   GLenum pname = cmd->pname;
356496c5ddc4Srjs   GLint param = cmd->param;
356596c5ddc4Srjs   CALL_FramebufferParameteri(ctx->CurrentServerDispatch, (target, pname, param));
356696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FramebufferParameteri), 8) / 8);
356796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
356896c5ddc4Srjs   return cmd_size;
356996c5ddc4Srjs}
357096c5ddc4Srjsvoid GLAPIENTRY
357196c5ddc4Srjs_mesa_marshal_FramebufferParameteri(GLenum target, GLenum pname, GLint param)
357296c5ddc4Srjs{
357396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
357496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_FramebufferParameteri);
357596c5ddc4Srjs   struct marshal_cmd_FramebufferParameteri *cmd;
357696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferParameteri, cmd_size);
357796c5ddc4Srjs   cmd->target = target;
357896c5ddc4Srjs   cmd->pname = pname;
357996c5ddc4Srjs   cmd->param = param;
358096c5ddc4Srjs}
358196c5ddc4Srjs
358296c5ddc4Srjs
358396c5ddc4Srjs/* GetFramebufferParameteriv: marshalled synchronously */
358496c5ddc4Srjsvoid GLAPIENTRY
358596c5ddc4Srjs_mesa_marshal_GetFramebufferParameteriv(GLenum target, GLenum pname, GLint * params)
358696c5ddc4Srjs{
358796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
358896c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetFramebufferParameteriv");
358996c5ddc4Srjs   CALL_GetFramebufferParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
359096c5ddc4Srjs}
359196c5ddc4Srjs
359296c5ddc4Srjs
359396c5ddc4Srjs/* NamedFramebufferParameteriEXT: marshalled asynchronously */
359496c5ddc4Srjsstruct marshal_cmd_NamedFramebufferParameteriEXT
359596c5ddc4Srjs{
359696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
359796c5ddc4Srjs   GLuint framebuffer;
359896c5ddc4Srjs   GLenum pname;
359996c5ddc4Srjs   GLint param;
360096c5ddc4Srjs};
360196c5ddc4Srjsuint32_t
360296c5ddc4Srjs_mesa_unmarshal_NamedFramebufferParameteriEXT(struct gl_context *ctx, const struct marshal_cmd_NamedFramebufferParameteriEXT *cmd, const uint64_t *last)
360396c5ddc4Srjs{
360496c5ddc4Srjs   GLuint framebuffer = cmd->framebuffer;
360596c5ddc4Srjs   GLenum pname = cmd->pname;
360696c5ddc4Srjs   GLint param = cmd->param;
360796c5ddc4Srjs   CALL_NamedFramebufferParameteriEXT(ctx->CurrentServerDispatch, (framebuffer, pname, param));
360896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedFramebufferParameteriEXT), 8) / 8);
360996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
361096c5ddc4Srjs   return cmd_size;
361196c5ddc4Srjs}
361296c5ddc4Srjsvoid GLAPIENTRY
361396c5ddc4Srjs_mesa_marshal_NamedFramebufferParameteriEXT(GLuint framebuffer, GLenum pname, GLint param)
361496c5ddc4Srjs{
361596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
361696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_NamedFramebufferParameteriEXT);
361796c5ddc4Srjs   struct marshal_cmd_NamedFramebufferParameteriEXT *cmd;
361896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedFramebufferParameteriEXT, cmd_size);
361996c5ddc4Srjs   cmd->framebuffer = framebuffer;
362096c5ddc4Srjs   cmd->pname = pname;
362196c5ddc4Srjs   cmd->param = param;
362296c5ddc4Srjs}
362396c5ddc4Srjs
362496c5ddc4Srjs
362596c5ddc4Srjs/* GetNamedFramebufferParameterivEXT: marshalled synchronously */
362696c5ddc4Srjsvoid GLAPIENTRY
362796c5ddc4Srjs_mesa_marshal_GetNamedFramebufferParameterivEXT(GLuint framebuffer, GLenum pname, GLint* params)
362896c5ddc4Srjs{
362996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
363096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetNamedFramebufferParameterivEXT");
363196c5ddc4Srjs   CALL_GetNamedFramebufferParameterivEXT(ctx->CurrentServerDispatch, (framebuffer, pname, params));
363296c5ddc4Srjs}
363396c5ddc4Srjs
363496c5ddc4Srjs
363596c5ddc4Srjs/* GetInternalformati64v: marshalled synchronously */
363696c5ddc4Srjsvoid GLAPIENTRY
363796c5ddc4Srjs_mesa_marshal_GetInternalformati64v(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 * params)
363896c5ddc4Srjs{
363996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
364096c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetInternalformati64v");
364196c5ddc4Srjs   CALL_GetInternalformati64v(ctx->CurrentServerDispatch, (target, internalformat, pname, bufSize, params));
364296c5ddc4Srjs}
364396c5ddc4Srjs
364496c5ddc4Srjs
364596c5ddc4Srjs/* InvalidateTexSubImage: marshalled asynchronously */
364696c5ddc4Srjsstruct marshal_cmd_InvalidateTexSubImage
364796c5ddc4Srjs{
364896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
364996c5ddc4Srjs   GLuint texture;
365096c5ddc4Srjs   GLint level;
365196c5ddc4Srjs   GLint xoffset;
365296c5ddc4Srjs   GLint yoffset;
365396c5ddc4Srjs   GLint zoffset;
365496c5ddc4Srjs   GLsizei width;
365596c5ddc4Srjs   GLsizei height;
365696c5ddc4Srjs   GLsizei depth;
365796c5ddc4Srjs};
365896c5ddc4Srjsuint32_t
365996c5ddc4Srjs_mesa_unmarshal_InvalidateTexSubImage(struct gl_context *ctx, const struct marshal_cmd_InvalidateTexSubImage *cmd, const uint64_t *last)
366096c5ddc4Srjs{
366196c5ddc4Srjs   GLuint texture = cmd->texture;
366296c5ddc4Srjs   GLint level = cmd->level;
366396c5ddc4Srjs   GLint xoffset = cmd->xoffset;
366496c5ddc4Srjs   GLint yoffset = cmd->yoffset;
366596c5ddc4Srjs   GLint zoffset = cmd->zoffset;
366696c5ddc4Srjs   GLsizei width = cmd->width;
366796c5ddc4Srjs   GLsizei height = cmd->height;
366896c5ddc4Srjs   GLsizei depth = cmd->depth;
366996c5ddc4Srjs   CALL_InvalidateTexSubImage(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth));
367096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_InvalidateTexSubImage), 8) / 8);
367196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
367296c5ddc4Srjs   return cmd_size;
367396c5ddc4Srjs}
367496c5ddc4Srjsvoid GLAPIENTRY
367596c5ddc4Srjs_mesa_marshal_InvalidateTexSubImage(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth)
367696c5ddc4Srjs{
367796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
367896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_InvalidateTexSubImage);
367996c5ddc4Srjs   struct marshal_cmd_InvalidateTexSubImage *cmd;
368096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InvalidateTexSubImage, cmd_size);
368196c5ddc4Srjs   cmd->texture = texture;
368296c5ddc4Srjs   cmd->level = level;
368396c5ddc4Srjs   cmd->xoffset = xoffset;
368496c5ddc4Srjs   cmd->yoffset = yoffset;
368596c5ddc4Srjs   cmd->zoffset = zoffset;
368696c5ddc4Srjs   cmd->width = width;
368796c5ddc4Srjs   cmd->height = height;
368896c5ddc4Srjs   cmd->depth = depth;
368996c5ddc4Srjs}
369096c5ddc4Srjs
369196c5ddc4Srjs
369296c5ddc4Srjs/* InvalidateTexImage: marshalled asynchronously */
369396c5ddc4Srjsstruct marshal_cmd_InvalidateTexImage
369496c5ddc4Srjs{
369596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
369696c5ddc4Srjs   GLuint texture;
369796c5ddc4Srjs   GLint level;
369896c5ddc4Srjs};
369996c5ddc4Srjsuint32_t
370096c5ddc4Srjs_mesa_unmarshal_InvalidateTexImage(struct gl_context *ctx, const struct marshal_cmd_InvalidateTexImage *cmd, const uint64_t *last)
370196c5ddc4Srjs{
370296c5ddc4Srjs   GLuint texture = cmd->texture;
370396c5ddc4Srjs   GLint level = cmd->level;
370496c5ddc4Srjs   CALL_InvalidateTexImage(ctx->CurrentServerDispatch, (texture, level));
370596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_InvalidateTexImage), 8) / 8);
370696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
370796c5ddc4Srjs   return cmd_size;
370896c5ddc4Srjs}
370996c5ddc4Srjsvoid GLAPIENTRY
371096c5ddc4Srjs_mesa_marshal_InvalidateTexImage(GLuint texture, GLint level)
371196c5ddc4Srjs{
371296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
371396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_InvalidateTexImage);
371496c5ddc4Srjs   struct marshal_cmd_InvalidateTexImage *cmd;
371596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InvalidateTexImage, cmd_size);
371696c5ddc4Srjs   cmd->texture = texture;
371796c5ddc4Srjs   cmd->level = level;
371896c5ddc4Srjs}
371996c5ddc4Srjs
372096c5ddc4Srjs
372196c5ddc4Srjs/* InvalidateBufferSubData: marshalled asynchronously */
372296c5ddc4Srjsstruct marshal_cmd_InvalidateBufferSubData
372396c5ddc4Srjs{
372496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
372596c5ddc4Srjs   GLuint buffer;
372696c5ddc4Srjs   GLintptr offset;
372796c5ddc4Srjs   GLsizeiptr length;
372896c5ddc4Srjs};
372996c5ddc4Srjsuint32_t
373096c5ddc4Srjs_mesa_unmarshal_InvalidateBufferSubData(struct gl_context *ctx, const struct marshal_cmd_InvalidateBufferSubData *cmd, const uint64_t *last)
373196c5ddc4Srjs{
373296c5ddc4Srjs   GLuint buffer = cmd->buffer;
373396c5ddc4Srjs   GLintptr offset = cmd->offset;
373496c5ddc4Srjs   GLsizeiptr length = cmd->length;
373596c5ddc4Srjs   CALL_InvalidateBufferSubData(ctx->CurrentServerDispatch, (buffer, offset, length));
373696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_InvalidateBufferSubData), 8) / 8);
373796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
373896c5ddc4Srjs   return cmd_size;
373996c5ddc4Srjs}
374096c5ddc4Srjsvoid GLAPIENTRY
374196c5ddc4Srjs_mesa_marshal_InvalidateBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr length)
374296c5ddc4Srjs{
374396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
374496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_InvalidateBufferSubData);
374596c5ddc4Srjs   struct marshal_cmd_InvalidateBufferSubData *cmd;
374696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InvalidateBufferSubData, cmd_size);
374796c5ddc4Srjs   cmd->buffer = buffer;
374896c5ddc4Srjs   cmd->offset = offset;
374996c5ddc4Srjs   cmd->length = length;
375096c5ddc4Srjs}
375196c5ddc4Srjs
375296c5ddc4Srjs
375396c5ddc4Srjs/* InvalidateBufferData: marshalled asynchronously */
375496c5ddc4Srjsstruct marshal_cmd_InvalidateBufferData
375596c5ddc4Srjs{
375696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
375796c5ddc4Srjs   GLuint buffer;
375896c5ddc4Srjs};
375996c5ddc4Srjsuint32_t
376096c5ddc4Srjs_mesa_unmarshal_InvalidateBufferData(struct gl_context *ctx, const struct marshal_cmd_InvalidateBufferData *cmd, const uint64_t *last)
376196c5ddc4Srjs{
376296c5ddc4Srjs   GLuint buffer = cmd->buffer;
376396c5ddc4Srjs   CALL_InvalidateBufferData(ctx->CurrentServerDispatch, (buffer));
376496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_InvalidateBufferData), 8) / 8);
376596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
376696c5ddc4Srjs   return cmd_size;
376796c5ddc4Srjs}
376896c5ddc4Srjsvoid GLAPIENTRY
376996c5ddc4Srjs_mesa_marshal_InvalidateBufferData(GLuint buffer)
377096c5ddc4Srjs{
377196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
377296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_InvalidateBufferData);
377396c5ddc4Srjs   struct marshal_cmd_InvalidateBufferData *cmd;
377496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InvalidateBufferData, cmd_size);
377596c5ddc4Srjs   cmd->buffer = buffer;
377696c5ddc4Srjs}
377796c5ddc4Srjs
377896c5ddc4Srjs
377996c5ddc4Srjs/* InvalidateSubFramebuffer: marshalled asynchronously */
378096c5ddc4Srjsstruct marshal_cmd_InvalidateSubFramebuffer
378196c5ddc4Srjs{
378296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
378396c5ddc4Srjs   GLenum target;
378496c5ddc4Srjs   GLsizei numAttachments;
378596c5ddc4Srjs   GLint x;
378696c5ddc4Srjs   GLint y;
378796c5ddc4Srjs   GLsizei width;
378896c5ddc4Srjs   GLsizei height;
378996c5ddc4Srjs   /* Next safe_mul(numAttachments, 1 * sizeof(GLenum)) bytes are GLenum attachments[numAttachments] */
379096c5ddc4Srjs};
379196c5ddc4Srjsuint32_t
379296c5ddc4Srjs_mesa_unmarshal_InvalidateSubFramebuffer(struct gl_context *ctx, const struct marshal_cmd_InvalidateSubFramebuffer *cmd, const uint64_t *last)
379396c5ddc4Srjs{
379496c5ddc4Srjs   GLenum target = cmd->target;
379596c5ddc4Srjs   GLsizei numAttachments = cmd->numAttachments;
379696c5ddc4Srjs   GLint x = cmd->x;
379796c5ddc4Srjs   GLint y = cmd->y;
379896c5ddc4Srjs   GLsizei width = cmd->width;
379996c5ddc4Srjs   GLsizei height = cmd->height;
380096c5ddc4Srjs   GLenum * attachments;
380196c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
380296c5ddc4Srjs   attachments = (GLenum *) variable_data;
380396c5ddc4Srjs   CALL_InvalidateSubFramebuffer(ctx->CurrentServerDispatch, (target, numAttachments, attachments, x, y, width, height));
380496c5ddc4Srjs   return cmd->cmd_base.cmd_size;
380596c5ddc4Srjs}
380696c5ddc4Srjsvoid GLAPIENTRY
380796c5ddc4Srjs_mesa_marshal_InvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height)
380896c5ddc4Srjs{
380996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
381096c5ddc4Srjs   int attachments_size = safe_mul(numAttachments, 1 * sizeof(GLenum));
381196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_InvalidateSubFramebuffer) + attachments_size;
381296c5ddc4Srjs   struct marshal_cmd_InvalidateSubFramebuffer *cmd;
381396c5ddc4Srjs   if (unlikely(attachments_size < 0 || (attachments_size > 0 && !attachments) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
381496c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "InvalidateSubFramebuffer");
381596c5ddc4Srjs      CALL_InvalidateSubFramebuffer(ctx->CurrentServerDispatch, (target, numAttachments, attachments, x, y, width, height));
381696c5ddc4Srjs      return;
381796c5ddc4Srjs   }
381896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InvalidateSubFramebuffer, cmd_size);
381996c5ddc4Srjs   cmd->target = target;
382096c5ddc4Srjs   cmd->numAttachments = numAttachments;
382196c5ddc4Srjs   cmd->x = x;
382296c5ddc4Srjs   cmd->y = y;
382396c5ddc4Srjs   cmd->width = width;
382496c5ddc4Srjs   cmd->height = height;
382596c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
382696c5ddc4Srjs   memcpy(variable_data, attachments, attachments_size);
382796c5ddc4Srjs}
382896c5ddc4Srjs
382996c5ddc4Srjs
383096c5ddc4Srjs/* InvalidateFramebuffer: marshalled asynchronously */
383196c5ddc4Srjsstruct marshal_cmd_InvalidateFramebuffer
383296c5ddc4Srjs{
383396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
383496c5ddc4Srjs   GLenum target;
383596c5ddc4Srjs   GLsizei numAttachments;
383696c5ddc4Srjs   /* Next safe_mul(numAttachments, 1 * sizeof(GLenum)) bytes are GLenum attachments[numAttachments] */
383796c5ddc4Srjs};
383896c5ddc4Srjsuint32_t
383996c5ddc4Srjs_mesa_unmarshal_InvalidateFramebuffer(struct gl_context *ctx, const struct marshal_cmd_InvalidateFramebuffer *cmd, const uint64_t *last)
384096c5ddc4Srjs{
384196c5ddc4Srjs   GLenum target = cmd->target;
384296c5ddc4Srjs   GLsizei numAttachments = cmd->numAttachments;
384396c5ddc4Srjs   GLenum * attachments;
384496c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
384596c5ddc4Srjs   attachments = (GLenum *) variable_data;
384696c5ddc4Srjs   CALL_InvalidateFramebuffer(ctx->CurrentServerDispatch, (target, numAttachments, attachments));
384796c5ddc4Srjs   return cmd->cmd_base.cmd_size;
384896c5ddc4Srjs}
384996c5ddc4Srjsvoid GLAPIENTRY
385096c5ddc4Srjs_mesa_marshal_InvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments)
385196c5ddc4Srjs{
385296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
385396c5ddc4Srjs   int attachments_size = safe_mul(numAttachments, 1 * sizeof(GLenum));
385496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_InvalidateFramebuffer) + attachments_size;
385596c5ddc4Srjs   struct marshal_cmd_InvalidateFramebuffer *cmd;
385696c5ddc4Srjs   if (unlikely(attachments_size < 0 || (attachments_size > 0 && !attachments) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
385796c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "InvalidateFramebuffer");
385896c5ddc4Srjs      CALL_InvalidateFramebuffer(ctx->CurrentServerDispatch, (target, numAttachments, attachments));
385996c5ddc4Srjs      return;
386096c5ddc4Srjs   }
386196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InvalidateFramebuffer, cmd_size);
386296c5ddc4Srjs   cmd->target = target;
386396c5ddc4Srjs   cmd->numAttachments = numAttachments;
386496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
386596c5ddc4Srjs   memcpy(variable_data, attachments, attachments_size);
386696c5ddc4Srjs}
386796c5ddc4Srjs
386896c5ddc4Srjs
386996c5ddc4Srjs/* GetProgramInterfaceiv: marshalled synchronously */
387096c5ddc4Srjsvoid GLAPIENTRY
387196c5ddc4Srjs_mesa_marshal_GetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint * params)
387296c5ddc4Srjs{
387396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
387496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramInterfaceiv");
387596c5ddc4Srjs   CALL_GetProgramInterfaceiv(ctx->CurrentServerDispatch, (program, programInterface, pname, params));
387696c5ddc4Srjs}
387796c5ddc4Srjs
387896c5ddc4Srjs
387996c5ddc4Srjs/* GetProgramResourceIndex: marshalled synchronously */
388096c5ddc4SrjsGLuint GLAPIENTRY
388196c5ddc4Srjs_mesa_marshal_GetProgramResourceIndex(GLuint program, GLenum programInterface, const GLchar * name)
388296c5ddc4Srjs{
388396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
388496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramResourceIndex");
388596c5ddc4Srjs   return CALL_GetProgramResourceIndex(ctx->CurrentServerDispatch, (program, programInterface, name));
388696c5ddc4Srjs}
388796c5ddc4Srjs
388896c5ddc4Srjs
388996c5ddc4Srjs/* GetProgramResourceName: marshalled synchronously */
389096c5ddc4Srjsvoid GLAPIENTRY
389196c5ddc4Srjs_mesa_marshal_GetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei  bufSize, GLsizei * length, GLchar * name)
389296c5ddc4Srjs{
389396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
389496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramResourceName");
389596c5ddc4Srjs   CALL_GetProgramResourceName(ctx->CurrentServerDispatch, (program, programInterface, index, bufSize, length, name));
389696c5ddc4Srjs}
389796c5ddc4Srjs
389896c5ddc4Srjs
389996c5ddc4Srjs/* GetProgramResourceiv: marshalled synchronously */
390096c5ddc4Srjsvoid GLAPIENTRY
390196c5ddc4Srjs_mesa_marshal_GetProgramResourceiv(GLuint program, GLenum programInterface, GLuint index, GLsizei  propCount, const GLenum * props, GLsizei  bufSize, GLsizei * length, GLint * params)
390296c5ddc4Srjs{
390396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
390496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramResourceiv");
390596c5ddc4Srjs   CALL_GetProgramResourceiv(ctx->CurrentServerDispatch, (program, programInterface, index, propCount, props, bufSize, length, params));
390696c5ddc4Srjs}
390796c5ddc4Srjs
390896c5ddc4Srjs
390996c5ddc4Srjs/* GetProgramResourceLocation: marshalled synchronously */
391096c5ddc4SrjsGLint GLAPIENTRY
391196c5ddc4Srjs_mesa_marshal_GetProgramResourceLocation(GLuint program, GLenum programInterface, const GLchar * name)
391296c5ddc4Srjs{
391396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
391496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramResourceLocation");
391596c5ddc4Srjs   return CALL_GetProgramResourceLocation(ctx->CurrentServerDispatch, (program, programInterface, name));
391696c5ddc4Srjs}
391796c5ddc4Srjs
391896c5ddc4Srjs
391996c5ddc4Srjs/* GetProgramResourceLocationIndex: marshalled synchronously */
392096c5ddc4SrjsGLint GLAPIENTRY
392196c5ddc4Srjs_mesa_marshal_GetProgramResourceLocationIndex(GLuint program, GLenum programInterface, const GLchar * name)
392296c5ddc4Srjs{
392396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
392496c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetProgramResourceLocationIndex");
392596c5ddc4Srjs   return CALL_GetProgramResourceLocationIndex(ctx->CurrentServerDispatch, (program, programInterface, name));
392696c5ddc4Srjs}
392796c5ddc4Srjs
392896c5ddc4Srjs
392996c5ddc4Srjs/* ShaderStorageBlockBinding: marshalled asynchronously */
393096c5ddc4Srjsstruct marshal_cmd_ShaderStorageBlockBinding
393196c5ddc4Srjs{
393296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
393396c5ddc4Srjs   GLuint program;
393496c5ddc4Srjs   GLuint shaderStorageBlockIndex;
393596c5ddc4Srjs   GLuint shaderStorageBlockBinding;
393696c5ddc4Srjs};
393796c5ddc4Srjsuint32_t
393896c5ddc4Srjs_mesa_unmarshal_ShaderStorageBlockBinding(struct gl_context *ctx, const struct marshal_cmd_ShaderStorageBlockBinding *cmd, const uint64_t *last)
393996c5ddc4Srjs{
394096c5ddc4Srjs   GLuint program = cmd->program;
394196c5ddc4Srjs   GLuint shaderStorageBlockIndex = cmd->shaderStorageBlockIndex;
394296c5ddc4Srjs   GLuint shaderStorageBlockBinding = cmd->shaderStorageBlockBinding;
394396c5ddc4Srjs   CALL_ShaderStorageBlockBinding(ctx->CurrentServerDispatch, (program, shaderStorageBlockIndex, shaderStorageBlockBinding));
394496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ShaderStorageBlockBinding), 8) / 8);
394596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
394696c5ddc4Srjs   return cmd_size;
394796c5ddc4Srjs}
394896c5ddc4Srjsvoid GLAPIENTRY
394996c5ddc4Srjs_mesa_marshal_ShaderStorageBlockBinding(GLuint program, GLuint shaderStorageBlockIndex, GLuint shaderStorageBlockBinding)
395096c5ddc4Srjs{
395196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
395296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ShaderStorageBlockBinding);
395396c5ddc4Srjs   struct marshal_cmd_ShaderStorageBlockBinding *cmd;
395496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ShaderStorageBlockBinding, cmd_size);
395596c5ddc4Srjs   cmd->program = program;
395696c5ddc4Srjs   cmd->shaderStorageBlockIndex = shaderStorageBlockIndex;
395796c5ddc4Srjs   cmd->shaderStorageBlockBinding = shaderStorageBlockBinding;
395896c5ddc4Srjs}
395996c5ddc4Srjs
396096c5ddc4Srjs
396196c5ddc4Srjs/* TexBufferRange: marshalled asynchronously */
396296c5ddc4Srjsstruct marshal_cmd_TexBufferRange
396396c5ddc4Srjs{
396496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
396596c5ddc4Srjs   GLenum target;
396696c5ddc4Srjs   GLenum internalformat;
396796c5ddc4Srjs   GLuint buffer;
396896c5ddc4Srjs   GLintptr offset;
396996c5ddc4Srjs   GLsizeiptr size;
397096c5ddc4Srjs};
397196c5ddc4Srjsuint32_t
397296c5ddc4Srjs_mesa_unmarshal_TexBufferRange(struct gl_context *ctx, const struct marshal_cmd_TexBufferRange *cmd, const uint64_t *last)
397396c5ddc4Srjs{
397496c5ddc4Srjs   GLenum target = cmd->target;
397596c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
397696c5ddc4Srjs   GLuint buffer = cmd->buffer;
397796c5ddc4Srjs   GLintptr offset = cmd->offset;
397896c5ddc4Srjs   GLsizeiptr size = cmd->size;
397996c5ddc4Srjs   CALL_TexBufferRange(ctx->CurrentServerDispatch, (target, internalformat, buffer, offset, size));
398096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexBufferRange), 8) / 8);
398196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
398296c5ddc4Srjs   return cmd_size;
398396c5ddc4Srjs}
398496c5ddc4Srjsvoid GLAPIENTRY
398596c5ddc4Srjs_mesa_marshal_TexBufferRange(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size)
398696c5ddc4Srjs{
398796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
398896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexBufferRange);
398996c5ddc4Srjs   struct marshal_cmd_TexBufferRange *cmd;
399096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexBufferRange, cmd_size);
399196c5ddc4Srjs   cmd->target = target;
399296c5ddc4Srjs   cmd->internalformat = internalformat;
399396c5ddc4Srjs   cmd->buffer = buffer;
399496c5ddc4Srjs   cmd->offset = offset;
399596c5ddc4Srjs   cmd->size = size;
399696c5ddc4Srjs}
399796c5ddc4Srjs
399896c5ddc4Srjs
399996c5ddc4Srjs/* TextureBufferRangeEXT: marshalled asynchronously */
400096c5ddc4Srjsstruct marshal_cmd_TextureBufferRangeEXT
400196c5ddc4Srjs{
400296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
400396c5ddc4Srjs   GLuint texture;
400496c5ddc4Srjs   GLenum target;
400596c5ddc4Srjs   GLenum internalformat;
400696c5ddc4Srjs   GLuint buffer;
400796c5ddc4Srjs   GLintptr offset;
400896c5ddc4Srjs   GLsizeiptr size;
400996c5ddc4Srjs};
401096c5ddc4Srjsuint32_t
401196c5ddc4Srjs_mesa_unmarshal_TextureBufferRangeEXT(struct gl_context *ctx, const struct marshal_cmd_TextureBufferRangeEXT *cmd, const uint64_t *last)
401296c5ddc4Srjs{
401396c5ddc4Srjs   GLuint texture = cmd->texture;
401496c5ddc4Srjs   GLenum target = cmd->target;
401596c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
401696c5ddc4Srjs   GLuint buffer = cmd->buffer;
401796c5ddc4Srjs   GLintptr offset = cmd->offset;
401896c5ddc4Srjs   GLsizeiptr size = cmd->size;
401996c5ddc4Srjs   CALL_TextureBufferRangeEXT(ctx->CurrentServerDispatch, (texture, target, internalformat, buffer, offset, size));
402096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureBufferRangeEXT), 8) / 8);
402196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
402296c5ddc4Srjs   return cmd_size;
402396c5ddc4Srjs}
402496c5ddc4Srjsvoid GLAPIENTRY
402596c5ddc4Srjs_mesa_marshal_TextureBufferRangeEXT(GLuint texture, GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size)
402696c5ddc4Srjs{
402796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
402896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureBufferRangeEXT);
402996c5ddc4Srjs   struct marshal_cmd_TextureBufferRangeEXT *cmd;
403096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureBufferRangeEXT, cmd_size);
403196c5ddc4Srjs   cmd->texture = texture;
403296c5ddc4Srjs   cmd->target = target;
403396c5ddc4Srjs   cmd->internalformat = internalformat;
403496c5ddc4Srjs   cmd->buffer = buffer;
403596c5ddc4Srjs   cmd->offset = offset;
403696c5ddc4Srjs   cmd->size = size;
403796c5ddc4Srjs}
403896c5ddc4Srjs
403996c5ddc4Srjs
404096c5ddc4Srjs/* TexStorage2DMultisample: marshalled asynchronously */
404196c5ddc4Srjsstruct marshal_cmd_TexStorage2DMultisample
404296c5ddc4Srjs{
404396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
404496c5ddc4Srjs   GLboolean fixedsamplelocations;
404596c5ddc4Srjs   GLenum target;
404696c5ddc4Srjs   GLsizei samples;
404796c5ddc4Srjs   GLenum internalformat;
404896c5ddc4Srjs   GLsizei width;
404996c5ddc4Srjs   GLsizei height;
405096c5ddc4Srjs};
405196c5ddc4Srjsuint32_t
405296c5ddc4Srjs_mesa_unmarshal_TexStorage2DMultisample(struct gl_context *ctx, const struct marshal_cmd_TexStorage2DMultisample *cmd, const uint64_t *last)
405396c5ddc4Srjs{
405496c5ddc4Srjs   GLenum target = cmd->target;
405596c5ddc4Srjs   GLsizei samples = cmd->samples;
405696c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
405796c5ddc4Srjs   GLsizei width = cmd->width;
405896c5ddc4Srjs   GLsizei height = cmd->height;
405996c5ddc4Srjs   GLboolean fixedsamplelocations = cmd->fixedsamplelocations;
406096c5ddc4Srjs   CALL_TexStorage2DMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height, fixedsamplelocations));
406196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexStorage2DMultisample), 8) / 8);
406296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
406396c5ddc4Srjs   return cmd_size;
406496c5ddc4Srjs}
406596c5ddc4Srjsvoid GLAPIENTRY
406696c5ddc4Srjs_mesa_marshal_TexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
406796c5ddc4Srjs{
406896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
406996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexStorage2DMultisample);
407096c5ddc4Srjs   struct marshal_cmd_TexStorage2DMultisample *cmd;
407196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorage2DMultisample, cmd_size);
407296c5ddc4Srjs   cmd->target = target;
407396c5ddc4Srjs   cmd->samples = samples;
407496c5ddc4Srjs   cmd->internalformat = internalformat;
407596c5ddc4Srjs   cmd->width = width;
407696c5ddc4Srjs   cmd->height = height;
407796c5ddc4Srjs   cmd->fixedsamplelocations = fixedsamplelocations;
407896c5ddc4Srjs}
407996c5ddc4Srjs
408096c5ddc4Srjs
408196c5ddc4Srjs/* TexStorage3DMultisample: marshalled asynchronously */
408296c5ddc4Srjsstruct marshal_cmd_TexStorage3DMultisample
408396c5ddc4Srjs{
408496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
408596c5ddc4Srjs   GLboolean fixedsamplelocations;
408696c5ddc4Srjs   GLenum target;
408796c5ddc4Srjs   GLsizei samples;
408896c5ddc4Srjs   GLenum internalformat;
408996c5ddc4Srjs   GLsizei width;
409096c5ddc4Srjs   GLsizei height;
409196c5ddc4Srjs   GLsizei depth;
409296c5ddc4Srjs};
409396c5ddc4Srjsuint32_t
409496c5ddc4Srjs_mesa_unmarshal_TexStorage3DMultisample(struct gl_context *ctx, const struct marshal_cmd_TexStorage3DMultisample *cmd, const uint64_t *last)
409596c5ddc4Srjs{
409696c5ddc4Srjs   GLenum target = cmd->target;
409796c5ddc4Srjs   GLsizei samples = cmd->samples;
409896c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
409996c5ddc4Srjs   GLsizei width = cmd->width;
410096c5ddc4Srjs   GLsizei height = cmd->height;
410196c5ddc4Srjs   GLsizei depth = cmd->depth;
410296c5ddc4Srjs   GLboolean fixedsamplelocations = cmd->fixedsamplelocations;
410396c5ddc4Srjs   CALL_TexStorage3DMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height, depth, fixedsamplelocations));
410496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexStorage3DMultisample), 8) / 8);
410596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
410696c5ddc4Srjs   return cmd_size;
410796c5ddc4Srjs}
410896c5ddc4Srjsvoid GLAPIENTRY
410996c5ddc4Srjs_mesa_marshal_TexStorage3DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)
411096c5ddc4Srjs{
411196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
411296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TexStorage3DMultisample);
411396c5ddc4Srjs   struct marshal_cmd_TexStorage3DMultisample *cmd;
411496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorage3DMultisample, cmd_size);
411596c5ddc4Srjs   cmd->target = target;
411696c5ddc4Srjs   cmd->samples = samples;
411796c5ddc4Srjs   cmd->internalformat = internalformat;
411896c5ddc4Srjs   cmd->width = width;
411996c5ddc4Srjs   cmd->height = height;
412096c5ddc4Srjs   cmd->depth = depth;
412196c5ddc4Srjs   cmd->fixedsamplelocations = fixedsamplelocations;
412296c5ddc4Srjs}
412396c5ddc4Srjs
412496c5ddc4Srjs
412596c5ddc4Srjs/* TextureStorage2DMultisampleEXT: marshalled asynchronously */
412696c5ddc4Srjsstruct marshal_cmd_TextureStorage2DMultisampleEXT
412796c5ddc4Srjs{
412896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
412996c5ddc4Srjs   GLboolean fixedsamplelocations;
413096c5ddc4Srjs   GLuint texture;
413196c5ddc4Srjs   GLenum target;
413296c5ddc4Srjs   GLsizei samples;
413396c5ddc4Srjs   GLenum internalformat;
413496c5ddc4Srjs   GLsizei width;
413596c5ddc4Srjs   GLsizei height;
413696c5ddc4Srjs};
413796c5ddc4Srjsuint32_t
413896c5ddc4Srjs_mesa_unmarshal_TextureStorage2DMultisampleEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorage2DMultisampleEXT *cmd, const uint64_t *last)
413996c5ddc4Srjs{
414096c5ddc4Srjs   GLuint texture = cmd->texture;
414196c5ddc4Srjs   GLenum target = cmd->target;
414296c5ddc4Srjs   GLsizei samples = cmd->samples;
414396c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
414496c5ddc4Srjs   GLsizei width = cmd->width;
414596c5ddc4Srjs   GLsizei height = cmd->height;
414696c5ddc4Srjs   GLboolean fixedsamplelocations = cmd->fixedsamplelocations;
414796c5ddc4Srjs   CALL_TextureStorage2DMultisampleEXT(ctx->CurrentServerDispatch, (texture, target, samples, internalformat, width, height, fixedsamplelocations));
414896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureStorage2DMultisampleEXT), 8) / 8);
414996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
415096c5ddc4Srjs   return cmd_size;
415196c5ddc4Srjs}
415296c5ddc4Srjsvoid GLAPIENTRY
415396c5ddc4Srjs_mesa_marshal_TextureStorage2DMultisampleEXT(GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
415496c5ddc4Srjs{
415596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
415696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureStorage2DMultisampleEXT);
415796c5ddc4Srjs   struct marshal_cmd_TextureStorage2DMultisampleEXT *cmd;
415896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage2DMultisampleEXT, cmd_size);
415996c5ddc4Srjs   cmd->texture = texture;
416096c5ddc4Srjs   cmd->target = target;
416196c5ddc4Srjs   cmd->samples = samples;
416296c5ddc4Srjs   cmd->internalformat = internalformat;
416396c5ddc4Srjs   cmd->width = width;
416496c5ddc4Srjs   cmd->height = height;
416596c5ddc4Srjs   cmd->fixedsamplelocations = fixedsamplelocations;
416696c5ddc4Srjs}
416796c5ddc4Srjs
416896c5ddc4Srjs
416996c5ddc4Srjs/* TextureStorage3DMultisampleEXT: marshalled asynchronously */
417096c5ddc4Srjsstruct marshal_cmd_TextureStorage3DMultisampleEXT
417196c5ddc4Srjs{
417296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
417396c5ddc4Srjs   GLboolean fixedsamplelocations;
417496c5ddc4Srjs   GLuint texture;
417596c5ddc4Srjs   GLenum target;
417696c5ddc4Srjs   GLsizei samples;
417796c5ddc4Srjs   GLenum internalformat;
417896c5ddc4Srjs   GLsizei width;
417996c5ddc4Srjs   GLsizei height;
418096c5ddc4Srjs   GLsizei depth;
418196c5ddc4Srjs};
418296c5ddc4Srjsuint32_t
418396c5ddc4Srjs_mesa_unmarshal_TextureStorage3DMultisampleEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorage3DMultisampleEXT *cmd, const uint64_t *last)
418496c5ddc4Srjs{
418596c5ddc4Srjs   GLuint texture = cmd->texture;
418696c5ddc4Srjs   GLenum target = cmd->target;
418796c5ddc4Srjs   GLsizei samples = cmd->samples;
418896c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
418996c5ddc4Srjs   GLsizei width = cmd->width;
419096c5ddc4Srjs   GLsizei height = cmd->height;
419196c5ddc4Srjs   GLsizei depth = cmd->depth;
419296c5ddc4Srjs   GLboolean fixedsamplelocations = cmd->fixedsamplelocations;
419396c5ddc4Srjs   CALL_TextureStorage3DMultisampleEXT(ctx->CurrentServerDispatch, (texture, target, samples, internalformat, width, height, depth, fixedsamplelocations));
419496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureStorage3DMultisampleEXT), 8) / 8);
419596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
419696c5ddc4Srjs   return cmd_size;
419796c5ddc4Srjs}
419896c5ddc4Srjsvoid GLAPIENTRY
419996c5ddc4Srjs_mesa_marshal_TextureStorage3DMultisampleEXT(GLuint texture, GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)
420096c5ddc4Srjs{
420196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
420296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureStorage3DMultisampleEXT);
420396c5ddc4Srjs   struct marshal_cmd_TextureStorage3DMultisampleEXT *cmd;
420496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage3DMultisampleEXT, cmd_size);
420596c5ddc4Srjs   cmd->texture = texture;
420696c5ddc4Srjs   cmd->target = target;
420796c5ddc4Srjs   cmd->samples = samples;
420896c5ddc4Srjs   cmd->internalformat = internalformat;
420996c5ddc4Srjs   cmd->width = width;
421096c5ddc4Srjs   cmd->height = height;
421196c5ddc4Srjs   cmd->depth = depth;
421296c5ddc4Srjs   cmd->fixedsamplelocations = fixedsamplelocations;
421396c5ddc4Srjs}
421496c5ddc4Srjs
421596c5ddc4Srjs
421696c5ddc4Srjs/* BufferStorage: marshalled synchronously */
421796c5ddc4Srjsvoid GLAPIENTRY
421896c5ddc4Srjs_mesa_marshal_BufferStorage(GLenum target, GLsizeiptr size, const GLvoid * data, GLbitfield flags)
421996c5ddc4Srjs{
422096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
422196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "BufferStorage");
422296c5ddc4Srjs   CALL_BufferStorage(ctx->CurrentServerDispatch, (target, size, data, flags));
422396c5ddc4Srjs}
422496c5ddc4Srjs
422596c5ddc4Srjs
422696c5ddc4Srjs/* NamedBufferStorageEXT: marshalled synchronously */
422796c5ddc4Srjsvoid GLAPIENTRY
422896c5ddc4Srjs_mesa_marshal_NamedBufferStorageEXT(GLuint buffer, GLsizeiptr size, const GLvoid * data, GLbitfield flags)
422996c5ddc4Srjs{
423096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
423196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "NamedBufferStorageEXT");
423296c5ddc4Srjs   CALL_NamedBufferStorageEXT(ctx->CurrentServerDispatch, (buffer, size, data, flags));
423396c5ddc4Srjs}
423496c5ddc4Srjs
423596c5ddc4Srjs
423696c5ddc4Srjs/* ClearTexImage: marshalled synchronously */
423796c5ddc4Srjsvoid GLAPIENTRY
423896c5ddc4Srjs_mesa_marshal_ClearTexImage(GLuint texture, GLint level, GLenum format, GLenum type, const GLvoid * data)
423996c5ddc4Srjs{
424096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
424196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ClearTexImage");
424296c5ddc4Srjs   CALL_ClearTexImage(ctx->CurrentServerDispatch, (texture, level, format, type, data));
424396c5ddc4Srjs}
424496c5ddc4Srjs
424596c5ddc4Srjs
424696c5ddc4Srjs/* ClearTexSubImage: marshalled synchronously */
424796c5ddc4Srjsvoid GLAPIENTRY
424896c5ddc4Srjs_mesa_marshal_ClearTexSubImage(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * data)
424996c5ddc4Srjs{
425096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
425196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ClearTexSubImage");
425296c5ddc4Srjs   CALL_ClearTexSubImage(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data));
425396c5ddc4Srjs}
425496c5ddc4Srjs
425596c5ddc4Srjs
425696c5ddc4Srjs/* BindBuffersBase: marshalled asynchronously */
425796c5ddc4Srjsstruct marshal_cmd_BindBuffersBase
425896c5ddc4Srjs{
425996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
426096c5ddc4Srjs   GLenum target;
426196c5ddc4Srjs   GLuint first;
426296c5ddc4Srjs   GLsizei count;
426396c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLuint)) bytes are GLuint buffers[count] */
426496c5ddc4Srjs};
426596c5ddc4Srjsuint32_t
426696c5ddc4Srjs_mesa_unmarshal_BindBuffersBase(struct gl_context *ctx, const struct marshal_cmd_BindBuffersBase *cmd, const uint64_t *last)
426796c5ddc4Srjs{
426896c5ddc4Srjs   GLenum target = cmd->target;
426996c5ddc4Srjs   GLuint first = cmd->first;
427096c5ddc4Srjs   GLsizei count = cmd->count;
427196c5ddc4Srjs   GLuint * buffers;
427296c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
427396c5ddc4Srjs   buffers = (GLuint *) variable_data;
427496c5ddc4Srjs   CALL_BindBuffersBase(ctx->CurrentServerDispatch, (target, first, count, buffers));
427596c5ddc4Srjs   return cmd->cmd_base.cmd_size;
427696c5ddc4Srjs}
427796c5ddc4Srjsvoid GLAPIENTRY
427896c5ddc4Srjs_mesa_marshal_BindBuffersBase(GLenum target, GLuint first, GLsizei count, const GLuint * buffers)
427996c5ddc4Srjs{
428096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
428196c5ddc4Srjs   int buffers_size = safe_mul(count, 1 * sizeof(GLuint));
428296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindBuffersBase) + buffers_size;
428396c5ddc4Srjs   struct marshal_cmd_BindBuffersBase *cmd;
428496c5ddc4Srjs   if (unlikely(buffers_size < 0 || (buffers_size > 0 && !buffers) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
428596c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "BindBuffersBase");
428696c5ddc4Srjs      CALL_BindBuffersBase(ctx->CurrentServerDispatch, (target, first, count, buffers));
428796c5ddc4Srjs      return;
428896c5ddc4Srjs   }
428996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindBuffersBase, cmd_size);
429096c5ddc4Srjs   cmd->target = target;
429196c5ddc4Srjs   cmd->first = first;
429296c5ddc4Srjs   cmd->count = count;
429396c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
429496c5ddc4Srjs   memcpy(variable_data, buffers, buffers_size);
429596c5ddc4Srjs}
429696c5ddc4Srjs
429796c5ddc4Srjs
429896c5ddc4Srjs/* BindBuffersRange: marshalled asynchronously */
429996c5ddc4Srjsstruct marshal_cmd_BindBuffersRange
430096c5ddc4Srjs{
430196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
430296c5ddc4Srjs   GLenum target;
430396c5ddc4Srjs   GLuint first;
430496c5ddc4Srjs   GLsizei count;
430596c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLuint)) bytes are GLuint buffers[count] */
430696c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLintptr)) bytes are GLintptr offsets[count] */
430796c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLsizeiptr)) bytes are GLsizeiptr sizes[count] */
430896c5ddc4Srjs};
430996c5ddc4Srjsuint32_t
431096c5ddc4Srjs_mesa_unmarshal_BindBuffersRange(struct gl_context *ctx, const struct marshal_cmd_BindBuffersRange *cmd, const uint64_t *last)
431196c5ddc4Srjs{
431296c5ddc4Srjs   GLenum target = cmd->target;
431396c5ddc4Srjs   GLuint first = cmd->first;
431496c5ddc4Srjs   GLsizei count = cmd->count;
431596c5ddc4Srjs   GLuint * buffers;
431696c5ddc4Srjs   GLintptr * offsets;
431796c5ddc4Srjs   GLsizeiptr * sizes;
431896c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
431996c5ddc4Srjs   buffers = (GLuint *) variable_data;
432096c5ddc4Srjs   variable_data += count * 1 * sizeof(GLuint);
432196c5ddc4Srjs   offsets = (GLintptr *) variable_data;
432296c5ddc4Srjs   variable_data += count * 1 * sizeof(GLintptr);
432396c5ddc4Srjs   sizes = (GLsizeiptr *) variable_data;
432496c5ddc4Srjs   CALL_BindBuffersRange(ctx->CurrentServerDispatch, (target, first, count, buffers, offsets, sizes));
432596c5ddc4Srjs   return cmd->cmd_base.cmd_size;
432696c5ddc4Srjs}
432796c5ddc4Srjsvoid GLAPIENTRY
432896c5ddc4Srjs_mesa_marshal_BindBuffersRange(GLenum target, GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizeiptr * sizes)
432996c5ddc4Srjs{
433096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
433196c5ddc4Srjs   int buffers_size = safe_mul(count, 1 * sizeof(GLuint));
433296c5ddc4Srjs   int offsets_size = safe_mul(count, 1 * sizeof(GLintptr));
433396c5ddc4Srjs   int sizes_size = safe_mul(count, 1 * sizeof(GLsizeiptr));
433496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindBuffersRange) + buffers_size + offsets_size + sizes_size;
433596c5ddc4Srjs   struct marshal_cmd_BindBuffersRange *cmd;
433696c5ddc4Srjs   if (unlikely(buffers_size < 0 || (buffers_size > 0 && !buffers) || offsets_size < 0 || (offsets_size > 0 && !offsets) || sizes_size < 0 || (sizes_size > 0 && !sizes) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
433796c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "BindBuffersRange");
433896c5ddc4Srjs      CALL_BindBuffersRange(ctx->CurrentServerDispatch, (target, first, count, buffers, offsets, sizes));
433996c5ddc4Srjs      return;
434096c5ddc4Srjs   }
434196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindBuffersRange, cmd_size);
434296c5ddc4Srjs   cmd->target = target;
434396c5ddc4Srjs   cmd->first = first;
434496c5ddc4Srjs   cmd->count = count;
434596c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
434696c5ddc4Srjs   memcpy(variable_data, buffers, buffers_size);
434796c5ddc4Srjs   variable_data += buffers_size;
434896c5ddc4Srjs   memcpy(variable_data, offsets, offsets_size);
434996c5ddc4Srjs   variable_data += offsets_size;
435096c5ddc4Srjs   memcpy(variable_data, sizes, sizes_size);
435196c5ddc4Srjs}
435296c5ddc4Srjs
435396c5ddc4Srjs
435496c5ddc4Srjs/* BindTextures: marshalled asynchronously */
435596c5ddc4Srjsstruct marshal_cmd_BindTextures
435696c5ddc4Srjs{
435796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
435896c5ddc4Srjs   GLuint first;
435996c5ddc4Srjs   GLsizei count;
436096c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLuint)) bytes are GLuint textures[count] */
436196c5ddc4Srjs};
436296c5ddc4Srjsuint32_t
436396c5ddc4Srjs_mesa_unmarshal_BindTextures(struct gl_context *ctx, const struct marshal_cmd_BindTextures *cmd, const uint64_t *last)
436496c5ddc4Srjs{
436596c5ddc4Srjs   GLuint first = cmd->first;
436696c5ddc4Srjs   GLsizei count = cmd->count;
436796c5ddc4Srjs   GLuint * textures;
436896c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
436996c5ddc4Srjs   textures = (GLuint *) variable_data;
437096c5ddc4Srjs   CALL_BindTextures(ctx->CurrentServerDispatch, (first, count, textures));
437196c5ddc4Srjs   return cmd->cmd_base.cmd_size;
437296c5ddc4Srjs}
437396c5ddc4Srjsvoid GLAPIENTRY
437496c5ddc4Srjs_mesa_marshal_BindTextures(GLuint first, GLsizei count, const GLuint * textures)
437596c5ddc4Srjs{
437696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
437796c5ddc4Srjs   int textures_size = safe_mul(count, 1 * sizeof(GLuint));
437896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindTextures) + textures_size;
437996c5ddc4Srjs   struct marshal_cmd_BindTextures *cmd;
438096c5ddc4Srjs   if (unlikely(textures_size < 0 || (textures_size > 0 && !textures) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
438196c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "BindTextures");
438296c5ddc4Srjs      CALL_BindTextures(ctx->CurrentServerDispatch, (first, count, textures));
438396c5ddc4Srjs      return;
438496c5ddc4Srjs   }
438596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindTextures, cmd_size);
438696c5ddc4Srjs   cmd->first = first;
438796c5ddc4Srjs   cmd->count = count;
438896c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
438996c5ddc4Srjs   memcpy(variable_data, textures, textures_size);
439096c5ddc4Srjs}
439196c5ddc4Srjs
439296c5ddc4Srjs
439396c5ddc4Srjs/* BindSamplers: marshalled asynchronously */
439496c5ddc4Srjsstruct marshal_cmd_BindSamplers
439596c5ddc4Srjs{
439696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
439796c5ddc4Srjs   GLuint first;
439896c5ddc4Srjs   GLsizei count;
439996c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLuint)) bytes are GLuint samplers[count] */
440096c5ddc4Srjs};
440196c5ddc4Srjsuint32_t
440296c5ddc4Srjs_mesa_unmarshal_BindSamplers(struct gl_context *ctx, const struct marshal_cmd_BindSamplers *cmd, const uint64_t *last)
440396c5ddc4Srjs{
440496c5ddc4Srjs   GLuint first = cmd->first;
440596c5ddc4Srjs   GLsizei count = cmd->count;
440696c5ddc4Srjs   GLuint * samplers;
440796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
440896c5ddc4Srjs   samplers = (GLuint *) variable_data;
440996c5ddc4Srjs   CALL_BindSamplers(ctx->CurrentServerDispatch, (first, count, samplers));
441096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
441196c5ddc4Srjs}
441296c5ddc4Srjsvoid GLAPIENTRY
441396c5ddc4Srjs_mesa_marshal_BindSamplers(GLuint first, GLsizei count, const GLuint * samplers)
441496c5ddc4Srjs{
441596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
441696c5ddc4Srjs   int samplers_size = safe_mul(count, 1 * sizeof(GLuint));
441796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindSamplers) + samplers_size;
441896c5ddc4Srjs   struct marshal_cmd_BindSamplers *cmd;
441996c5ddc4Srjs   if (unlikely(samplers_size < 0 || (samplers_size > 0 && !samplers) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
442096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "BindSamplers");
442196c5ddc4Srjs      CALL_BindSamplers(ctx->CurrentServerDispatch, (first, count, samplers));
442296c5ddc4Srjs      return;
442396c5ddc4Srjs   }
442496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindSamplers, cmd_size);
442596c5ddc4Srjs   cmd->first = first;
442696c5ddc4Srjs   cmd->count = count;
442796c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
442896c5ddc4Srjs   memcpy(variable_data, samplers, samplers_size);
442996c5ddc4Srjs}
443096c5ddc4Srjs
443196c5ddc4Srjs
443296c5ddc4Srjs/* BindImageTextures: marshalled asynchronously */
443396c5ddc4Srjsstruct marshal_cmd_BindImageTextures
443496c5ddc4Srjs{
443596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
443696c5ddc4Srjs   GLuint first;
443796c5ddc4Srjs   GLsizei count;
443896c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLuint)) bytes are GLuint textures[count] */
443996c5ddc4Srjs};
444096c5ddc4Srjsuint32_t
444196c5ddc4Srjs_mesa_unmarshal_BindImageTextures(struct gl_context *ctx, const struct marshal_cmd_BindImageTextures *cmd, const uint64_t *last)
444296c5ddc4Srjs{
444396c5ddc4Srjs   GLuint first = cmd->first;
444496c5ddc4Srjs   GLsizei count = cmd->count;
444596c5ddc4Srjs   GLuint * textures;
444696c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
444796c5ddc4Srjs   textures = (GLuint *) variable_data;
444896c5ddc4Srjs   CALL_BindImageTextures(ctx->CurrentServerDispatch, (first, count, textures));
444996c5ddc4Srjs   return cmd->cmd_base.cmd_size;
445096c5ddc4Srjs}
445196c5ddc4Srjsvoid GLAPIENTRY
445296c5ddc4Srjs_mesa_marshal_BindImageTextures(GLuint first, GLsizei count, const GLuint * textures)
445396c5ddc4Srjs{
445496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
445596c5ddc4Srjs   int textures_size = safe_mul(count, 1 * sizeof(GLuint));
445696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindImageTextures) + textures_size;
445796c5ddc4Srjs   struct marshal_cmd_BindImageTextures *cmd;
445896c5ddc4Srjs   if (unlikely(textures_size < 0 || (textures_size > 0 && !textures) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
445996c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "BindImageTextures");
446096c5ddc4Srjs      CALL_BindImageTextures(ctx->CurrentServerDispatch, (first, count, textures));
446196c5ddc4Srjs      return;
446296c5ddc4Srjs   }
446396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindImageTextures, cmd_size);
446496c5ddc4Srjs   cmd->first = first;
446596c5ddc4Srjs   cmd->count = count;
446696c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
446796c5ddc4Srjs   memcpy(variable_data, textures, textures_size);
446896c5ddc4Srjs}
446996c5ddc4Srjs
447096c5ddc4Srjs
447196c5ddc4Srjs/* BindVertexBuffers: marshalled asynchronously */
447296c5ddc4Srjsstruct marshal_cmd_BindVertexBuffers
447396c5ddc4Srjs{
447496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
447596c5ddc4Srjs   GLuint first;
447696c5ddc4Srjs   GLsizei count;
447796c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLuint)) bytes are GLuint buffers[count] */
447896c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLintptr)) bytes are GLintptr offsets[count] */
447996c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLsizei)) bytes are GLsizei strides[count] */
448096c5ddc4Srjs};
448196c5ddc4Srjsuint32_t
448296c5ddc4Srjs_mesa_unmarshal_BindVertexBuffers(struct gl_context *ctx, const struct marshal_cmd_BindVertexBuffers *cmd, const uint64_t *last)
448396c5ddc4Srjs{
448496c5ddc4Srjs   GLuint first = cmd->first;
448596c5ddc4Srjs   GLsizei count = cmd->count;
448696c5ddc4Srjs   GLuint * buffers;
448796c5ddc4Srjs   GLintptr * offsets;
448896c5ddc4Srjs   GLsizei * strides;
448996c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
449096c5ddc4Srjs   buffers = (GLuint *) variable_data;
449196c5ddc4Srjs   variable_data += count * 1 * sizeof(GLuint);
449296c5ddc4Srjs   offsets = (GLintptr *) variable_data;
449396c5ddc4Srjs   variable_data += count * 1 * sizeof(GLintptr);
449496c5ddc4Srjs   strides = (GLsizei *) variable_data;
449596c5ddc4Srjs   CALL_BindVertexBuffers(ctx->CurrentServerDispatch, (first, count, buffers, offsets, strides));
449696c5ddc4Srjs   return cmd->cmd_base.cmd_size;
449796c5ddc4Srjs}
449896c5ddc4Srjsvoid GLAPIENTRY
449996c5ddc4Srjs_mesa_marshal_BindVertexBuffers(GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizei * strides)
450096c5ddc4Srjs{
450196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
450296c5ddc4Srjs   int buffers_size = safe_mul(count, 1 * sizeof(GLuint));
450396c5ddc4Srjs   int offsets_size = safe_mul(count, 1 * sizeof(GLintptr));
450496c5ddc4Srjs   int strides_size = safe_mul(count, 1 * sizeof(GLsizei));
450596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindVertexBuffers) + buffers_size + offsets_size + strides_size;
450696c5ddc4Srjs   struct marshal_cmd_BindVertexBuffers *cmd;
450796c5ddc4Srjs   if (unlikely(buffers_size < 0 || (buffers_size > 0 && !buffers) || offsets_size < 0 || (offsets_size > 0 && !offsets) || strides_size < 0 || (strides_size > 0 && !strides) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
450896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "BindVertexBuffers");
450996c5ddc4Srjs      CALL_BindVertexBuffers(ctx->CurrentServerDispatch, (first, count, buffers, offsets, strides));
451096c5ddc4Srjs      return;
451196c5ddc4Srjs   }
451296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindVertexBuffers, cmd_size);
451396c5ddc4Srjs   cmd->first = first;
451496c5ddc4Srjs   cmd->count = count;
451596c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
451696c5ddc4Srjs   memcpy(variable_data, buffers, buffers_size);
451796c5ddc4Srjs   variable_data += buffers_size;
451896c5ddc4Srjs   memcpy(variable_data, offsets, offsets_size);
451996c5ddc4Srjs   variable_data += offsets_size;
452096c5ddc4Srjs   memcpy(variable_data, strides, strides_size);
452196c5ddc4Srjs}
452296c5ddc4Srjs
452396c5ddc4Srjs
452496c5ddc4Srjs/* GetTextureHandleARB: marshalled synchronously */
452596c5ddc4SrjsGLuint64 GLAPIENTRY
452696c5ddc4Srjs_mesa_marshal_GetTextureHandleARB(GLuint texture)
452796c5ddc4Srjs{
452896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
452996c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTextureHandleARB");
453096c5ddc4Srjs   return CALL_GetTextureHandleARB(ctx->CurrentServerDispatch, (texture));
453196c5ddc4Srjs}
453296c5ddc4Srjs
453396c5ddc4Srjs
453496c5ddc4Srjs/* GetTextureSamplerHandleARB: marshalled synchronously */
453596c5ddc4SrjsGLuint64 GLAPIENTRY
453696c5ddc4Srjs_mesa_marshal_GetTextureSamplerHandleARB(GLuint texture, GLuint sampler)
453796c5ddc4Srjs{
453896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
453996c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTextureSamplerHandleARB");
454096c5ddc4Srjs   return CALL_GetTextureSamplerHandleARB(ctx->CurrentServerDispatch, (texture, sampler));
454196c5ddc4Srjs}
454296c5ddc4Srjs
454396c5ddc4Srjs
454496c5ddc4Srjs/* MakeTextureHandleResidentARB: marshalled asynchronously */
454596c5ddc4Srjsstruct marshal_cmd_MakeTextureHandleResidentARB
454696c5ddc4Srjs{
454796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
454896c5ddc4Srjs   GLuint64 handle;
454996c5ddc4Srjs};
455096c5ddc4Srjsuint32_t
455196c5ddc4Srjs_mesa_unmarshal_MakeTextureHandleResidentARB(struct gl_context *ctx, const struct marshal_cmd_MakeTextureHandleResidentARB *cmd, const uint64_t *last)
455296c5ddc4Srjs{
455396c5ddc4Srjs   GLuint64 handle = cmd->handle;
455496c5ddc4Srjs   CALL_MakeTextureHandleResidentARB(ctx->CurrentServerDispatch, (handle));
455596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MakeTextureHandleResidentARB), 8) / 8);
455696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
455796c5ddc4Srjs   return cmd_size;
455896c5ddc4Srjs}
455996c5ddc4Srjsvoid GLAPIENTRY
456096c5ddc4Srjs_mesa_marshal_MakeTextureHandleResidentARB(GLuint64 handle)
456196c5ddc4Srjs{
456296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
456396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MakeTextureHandleResidentARB);
456496c5ddc4Srjs   struct marshal_cmd_MakeTextureHandleResidentARB *cmd;
456596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MakeTextureHandleResidentARB, cmd_size);
456696c5ddc4Srjs   cmd->handle = handle;
456796c5ddc4Srjs}
456896c5ddc4Srjs
456996c5ddc4Srjs
457096c5ddc4Srjs/* MakeTextureHandleNonResidentARB: marshalled asynchronously */
457196c5ddc4Srjsstruct marshal_cmd_MakeTextureHandleNonResidentARB
457296c5ddc4Srjs{
457396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
457496c5ddc4Srjs   GLuint64 handle;
457596c5ddc4Srjs};
457696c5ddc4Srjsuint32_t
457796c5ddc4Srjs_mesa_unmarshal_MakeTextureHandleNonResidentARB(struct gl_context *ctx, const struct marshal_cmd_MakeTextureHandleNonResidentARB *cmd, const uint64_t *last)
457896c5ddc4Srjs{
457996c5ddc4Srjs   GLuint64 handle = cmd->handle;
458096c5ddc4Srjs   CALL_MakeTextureHandleNonResidentARB(ctx->CurrentServerDispatch, (handle));
458196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MakeTextureHandleNonResidentARB), 8) / 8);
458296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
458396c5ddc4Srjs   return cmd_size;
458496c5ddc4Srjs}
458596c5ddc4Srjsvoid GLAPIENTRY
458696c5ddc4Srjs_mesa_marshal_MakeTextureHandleNonResidentARB(GLuint64 handle)
458796c5ddc4Srjs{
458896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
458996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MakeTextureHandleNonResidentARB);
459096c5ddc4Srjs   struct marshal_cmd_MakeTextureHandleNonResidentARB *cmd;
459196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MakeTextureHandleNonResidentARB, cmd_size);
459296c5ddc4Srjs   cmd->handle = handle;
459396c5ddc4Srjs}
459496c5ddc4Srjs
459596c5ddc4Srjs
459696c5ddc4Srjs/* GetImageHandleARB: marshalled synchronously */
459796c5ddc4SrjsGLuint64 GLAPIENTRY
459896c5ddc4Srjs_mesa_marshal_GetImageHandleARB(GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format)
459996c5ddc4Srjs{
460096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
460196c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetImageHandleARB");
460296c5ddc4Srjs   return CALL_GetImageHandleARB(ctx->CurrentServerDispatch, (texture, level, layered, layer, format));
460396c5ddc4Srjs}
460496c5ddc4Srjs
460596c5ddc4Srjs
460696c5ddc4Srjs/* MakeImageHandleResidentARB: marshalled asynchronously */
460796c5ddc4Srjsstruct marshal_cmd_MakeImageHandleResidentARB
460896c5ddc4Srjs{
460996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
461096c5ddc4Srjs   GLenum access;
461196c5ddc4Srjs   GLuint64 handle;
461296c5ddc4Srjs};
461396c5ddc4Srjsuint32_t
461496c5ddc4Srjs_mesa_unmarshal_MakeImageHandleResidentARB(struct gl_context *ctx, const struct marshal_cmd_MakeImageHandleResidentARB *cmd, const uint64_t *last)
461596c5ddc4Srjs{
461696c5ddc4Srjs   GLuint64 handle = cmd->handle;
461796c5ddc4Srjs   GLenum access = cmd->access;
461896c5ddc4Srjs   CALL_MakeImageHandleResidentARB(ctx->CurrentServerDispatch, (handle, access));
461996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MakeImageHandleResidentARB), 8) / 8);
462096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
462196c5ddc4Srjs   return cmd_size;
462296c5ddc4Srjs}
462396c5ddc4Srjsvoid GLAPIENTRY
462496c5ddc4Srjs_mesa_marshal_MakeImageHandleResidentARB(GLuint64 handle, GLenum access)
462596c5ddc4Srjs{
462696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
462796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MakeImageHandleResidentARB);
462896c5ddc4Srjs   struct marshal_cmd_MakeImageHandleResidentARB *cmd;
462996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MakeImageHandleResidentARB, cmd_size);
463096c5ddc4Srjs   cmd->handle = handle;
463196c5ddc4Srjs   cmd->access = access;
463296c5ddc4Srjs}
463396c5ddc4Srjs
463496c5ddc4Srjs
463596c5ddc4Srjs/* MakeImageHandleNonResidentARB: marshalled asynchronously */
463696c5ddc4Srjsstruct marshal_cmd_MakeImageHandleNonResidentARB
463796c5ddc4Srjs{
463896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
463996c5ddc4Srjs   GLuint64 handle;
464096c5ddc4Srjs};
464196c5ddc4Srjsuint32_t
464296c5ddc4Srjs_mesa_unmarshal_MakeImageHandleNonResidentARB(struct gl_context *ctx, const struct marshal_cmd_MakeImageHandleNonResidentARB *cmd, const uint64_t *last)
464396c5ddc4Srjs{
464496c5ddc4Srjs   GLuint64 handle = cmd->handle;
464596c5ddc4Srjs   CALL_MakeImageHandleNonResidentARB(ctx->CurrentServerDispatch, (handle));
464696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MakeImageHandleNonResidentARB), 8) / 8);
464796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
464896c5ddc4Srjs   return cmd_size;
464996c5ddc4Srjs}
465096c5ddc4Srjsvoid GLAPIENTRY
465196c5ddc4Srjs_mesa_marshal_MakeImageHandleNonResidentARB(GLuint64 handle)
465296c5ddc4Srjs{
465396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
465496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MakeImageHandleNonResidentARB);
465596c5ddc4Srjs   struct marshal_cmd_MakeImageHandleNonResidentARB *cmd;
465696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MakeImageHandleNonResidentARB, cmd_size);
465796c5ddc4Srjs   cmd->handle = handle;
465896c5ddc4Srjs}
465996c5ddc4Srjs
466096c5ddc4Srjs
466196c5ddc4Srjs/* UniformHandleui64ARB: marshalled asynchronously */
466296c5ddc4Srjsstruct marshal_cmd_UniformHandleui64ARB
466396c5ddc4Srjs{
466496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
466596c5ddc4Srjs   GLint location;
466696c5ddc4Srjs   GLuint64 value;
466796c5ddc4Srjs};
466896c5ddc4Srjsuint32_t
466996c5ddc4Srjs_mesa_unmarshal_UniformHandleui64ARB(struct gl_context *ctx, const struct marshal_cmd_UniformHandleui64ARB *cmd, const uint64_t *last)
467096c5ddc4Srjs{
467196c5ddc4Srjs   GLint location = cmd->location;
467296c5ddc4Srjs   GLuint64 value = cmd->value;
467396c5ddc4Srjs   CALL_UniformHandleui64ARB(ctx->CurrentServerDispatch, (location, value));
467496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_UniformHandleui64ARB), 8) / 8);
467596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
467696c5ddc4Srjs   return cmd_size;
467796c5ddc4Srjs}
467896c5ddc4Srjsvoid GLAPIENTRY
467996c5ddc4Srjs_mesa_marshal_UniformHandleui64ARB(GLint location, GLuint64 value)
468096c5ddc4Srjs{
468196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
468296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformHandleui64ARB);
468396c5ddc4Srjs   struct marshal_cmd_UniformHandleui64ARB *cmd;
468496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformHandleui64ARB, cmd_size);
468596c5ddc4Srjs   cmd->location = location;
468696c5ddc4Srjs   cmd->value = value;
468796c5ddc4Srjs}
468896c5ddc4Srjs
468996c5ddc4Srjs
469096c5ddc4Srjs/* UniformHandleui64vARB: marshalled asynchronously */
469196c5ddc4Srjsstruct marshal_cmd_UniformHandleui64vARB
469296c5ddc4Srjs{
469396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
469496c5ddc4Srjs   GLint location;
469596c5ddc4Srjs   GLsizei count;
469696c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLuint64)) bytes are GLuint64 value[count] */
469796c5ddc4Srjs};
469896c5ddc4Srjsuint32_t
469996c5ddc4Srjs_mesa_unmarshal_UniformHandleui64vARB(struct gl_context *ctx, const struct marshal_cmd_UniformHandleui64vARB *cmd, const uint64_t *last)
470096c5ddc4Srjs{
470196c5ddc4Srjs   GLint location = cmd->location;
470296c5ddc4Srjs   GLsizei count = cmd->count;
470396c5ddc4Srjs   GLuint64 * value;
470496c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
470596c5ddc4Srjs   value = (GLuint64 *) variable_data;
470696c5ddc4Srjs   CALL_UniformHandleui64vARB(ctx->CurrentServerDispatch, (location, count, value));
470796c5ddc4Srjs   return cmd->cmd_base.cmd_size;
470896c5ddc4Srjs}
470996c5ddc4Srjsvoid GLAPIENTRY
471096c5ddc4Srjs_mesa_marshal_UniformHandleui64vARB(GLint location, GLsizei count, const GLuint64 * value)
471196c5ddc4Srjs{
471296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
471396c5ddc4Srjs   int value_size = safe_mul(count, 1 * sizeof(GLuint64));
471496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UniformHandleui64vARB) + value_size;
471596c5ddc4Srjs   struct marshal_cmd_UniformHandleui64vARB *cmd;
471696c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
471796c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "UniformHandleui64vARB");
471896c5ddc4Srjs      CALL_UniformHandleui64vARB(ctx->CurrentServerDispatch, (location, count, value));
471996c5ddc4Srjs      return;
472096c5ddc4Srjs   }
472196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformHandleui64vARB, cmd_size);
472296c5ddc4Srjs   cmd->location = location;
472396c5ddc4Srjs   cmd->count = count;
472496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
472596c5ddc4Srjs   memcpy(variable_data, value, value_size);
472696c5ddc4Srjs}
472796c5ddc4Srjs
472896c5ddc4Srjs
472996c5ddc4Srjs/* ProgramUniformHandleui64ARB: marshalled asynchronously */
473096c5ddc4Srjsstruct marshal_cmd_ProgramUniformHandleui64ARB
473196c5ddc4Srjs{
473296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
473396c5ddc4Srjs   GLuint program;
473496c5ddc4Srjs   GLint location;
473596c5ddc4Srjs   GLuint64 value;
473696c5ddc4Srjs};
473796c5ddc4Srjsuint32_t
473896c5ddc4Srjs_mesa_unmarshal_ProgramUniformHandleui64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformHandleui64ARB *cmd, const uint64_t *last)
473996c5ddc4Srjs{
474096c5ddc4Srjs   GLuint program = cmd->program;
474196c5ddc4Srjs   GLint location = cmd->location;
474296c5ddc4Srjs   GLuint64 value = cmd->value;
474396c5ddc4Srjs   CALL_ProgramUniformHandleui64ARB(ctx->CurrentServerDispatch, (program, location, value));
474496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniformHandleui64ARB), 8) / 8);
474596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
474696c5ddc4Srjs   return cmd_size;
474796c5ddc4Srjs}
474896c5ddc4Srjsvoid GLAPIENTRY
474996c5ddc4Srjs_mesa_marshal_ProgramUniformHandleui64ARB(GLuint program, GLint location, GLuint64 value)
475096c5ddc4Srjs{
475196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
475296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformHandleui64ARB);
475396c5ddc4Srjs   struct marshal_cmd_ProgramUniformHandleui64ARB *cmd;
475496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformHandleui64ARB, cmd_size);
475596c5ddc4Srjs   cmd->program = program;
475696c5ddc4Srjs   cmd->location = location;
475796c5ddc4Srjs   cmd->value = value;
475896c5ddc4Srjs}
475996c5ddc4Srjs
476096c5ddc4Srjs
476196c5ddc4Srjs/* ProgramUniformHandleui64vARB: marshalled asynchronously */
476296c5ddc4Srjsstruct marshal_cmd_ProgramUniformHandleui64vARB
476396c5ddc4Srjs{
476496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
476596c5ddc4Srjs   GLuint program;
476696c5ddc4Srjs   GLint location;
476796c5ddc4Srjs   GLsizei count;
476896c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLuint64)) bytes are GLuint64 value[count] */
476996c5ddc4Srjs};
477096c5ddc4Srjsuint32_t
477196c5ddc4Srjs_mesa_unmarshal_ProgramUniformHandleui64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformHandleui64vARB *cmd, const uint64_t *last)
477296c5ddc4Srjs{
477396c5ddc4Srjs   GLuint program = cmd->program;
477496c5ddc4Srjs   GLint location = cmd->location;
477596c5ddc4Srjs   GLsizei count = cmd->count;
477696c5ddc4Srjs   GLuint64 * value;
477796c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
477896c5ddc4Srjs   value = (GLuint64 *) variable_data;
477996c5ddc4Srjs   CALL_ProgramUniformHandleui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
478096c5ddc4Srjs   return cmd->cmd_base.cmd_size;
478196c5ddc4Srjs}
478296c5ddc4Srjsvoid GLAPIENTRY
478396c5ddc4Srjs_mesa_marshal_ProgramUniformHandleui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 * value)
478496c5ddc4Srjs{
478596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
478696c5ddc4Srjs   int value_size = safe_mul(count, 1 * sizeof(GLuint64));
478796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ProgramUniformHandleui64vARB) + value_size;
478896c5ddc4Srjs   struct marshal_cmd_ProgramUniformHandleui64vARB *cmd;
478996c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
479096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ProgramUniformHandleui64vARB");
479196c5ddc4Srjs      CALL_ProgramUniformHandleui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
479296c5ddc4Srjs      return;
479396c5ddc4Srjs   }
479496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformHandleui64vARB, cmd_size);
479596c5ddc4Srjs   cmd->program = program;
479696c5ddc4Srjs   cmd->location = location;
479796c5ddc4Srjs   cmd->count = count;
479896c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
479996c5ddc4Srjs   memcpy(variable_data, value, value_size);
480096c5ddc4Srjs}
480196c5ddc4Srjs
480296c5ddc4Srjs
480396c5ddc4Srjs/* IsTextureHandleResidentARB: marshalled synchronously */
480496c5ddc4SrjsGLboolean GLAPIENTRY
480596c5ddc4Srjs_mesa_marshal_IsTextureHandleResidentARB(GLuint64 handle)
480696c5ddc4Srjs{
480796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
480896c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsTextureHandleResidentARB");
480996c5ddc4Srjs   return CALL_IsTextureHandleResidentARB(ctx->CurrentServerDispatch, (handle));
481096c5ddc4Srjs}
481196c5ddc4Srjs
481296c5ddc4Srjs
481396c5ddc4Srjs/* IsImageHandleResidentARB: marshalled synchronously */
481496c5ddc4SrjsGLboolean GLAPIENTRY
481596c5ddc4Srjs_mesa_marshal_IsImageHandleResidentARB(GLuint64 handle)
481696c5ddc4Srjs{
481796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
481896c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "IsImageHandleResidentARB");
481996c5ddc4Srjs   return CALL_IsImageHandleResidentARB(ctx->CurrentServerDispatch, (handle));
482096c5ddc4Srjs}
482196c5ddc4Srjs
482296c5ddc4Srjs
482396c5ddc4Srjs/* VertexAttribL1ui64ARB: marshalled asynchronously */
482496c5ddc4Srjsstruct marshal_cmd_VertexAttribL1ui64ARB
482596c5ddc4Srjs{
482696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
482796c5ddc4Srjs   GLuint index;
482896c5ddc4Srjs   GLuint64EXT x;
482996c5ddc4Srjs};
483096c5ddc4Srjsuint32_t
483196c5ddc4Srjs_mesa_unmarshal_VertexAttribL1ui64ARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttribL1ui64ARB *cmd, const uint64_t *last)
483296c5ddc4Srjs{
483396c5ddc4Srjs   GLuint index = cmd->index;
483496c5ddc4Srjs   GLuint64EXT x = cmd->x;
483596c5ddc4Srjs   CALL_VertexAttribL1ui64ARB(ctx->CurrentServerDispatch, (index, x));
483696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribL1ui64ARB), 8) / 8);
483796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
483896c5ddc4Srjs   return cmd_size;
483996c5ddc4Srjs}
484096c5ddc4Srjsvoid GLAPIENTRY
484196c5ddc4Srjs_mesa_marshal_VertexAttribL1ui64ARB(GLuint index, GLuint64EXT x)
484296c5ddc4Srjs{
484396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
484496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribL1ui64ARB);
484596c5ddc4Srjs   struct marshal_cmd_VertexAttribL1ui64ARB *cmd;
484696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribL1ui64ARB, cmd_size);
484796c5ddc4Srjs   cmd->index = index;
484896c5ddc4Srjs   cmd->x = x;
484996c5ddc4Srjs}
485096c5ddc4Srjs
485196c5ddc4Srjs
485296c5ddc4Srjs/* VertexAttribL1ui64vARB: marshalled asynchronously */
485396c5ddc4Srjsstruct marshal_cmd_VertexAttribL1ui64vARB
485496c5ddc4Srjs{
485596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
485696c5ddc4Srjs   GLuint index;
485796c5ddc4Srjs   GLuint64EXT v[1];
485896c5ddc4Srjs};
485996c5ddc4Srjsuint32_t
486096c5ddc4Srjs_mesa_unmarshal_VertexAttribL1ui64vARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttribL1ui64vARB *cmd, const uint64_t *last)
486196c5ddc4Srjs{
486296c5ddc4Srjs   GLuint index = cmd->index;
486396c5ddc4Srjs   const GLuint64EXT * v = cmd->v;
486496c5ddc4Srjs   CALL_VertexAttribL1ui64vARB(ctx->CurrentServerDispatch, (index, v));
486596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribL1ui64vARB), 8) / 8);
486696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
486796c5ddc4Srjs   return cmd_size;
486896c5ddc4Srjs}
486996c5ddc4Srjsvoid GLAPIENTRY
487096c5ddc4Srjs_mesa_marshal_VertexAttribL1ui64vARB(GLuint index, const GLuint64EXT * v)
487196c5ddc4Srjs{
487296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
487396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexAttribL1ui64vARB);
487496c5ddc4Srjs   struct marshal_cmd_VertexAttribL1ui64vARB *cmd;
487596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribL1ui64vARB, cmd_size);
487696c5ddc4Srjs   cmd->index = index;
487796c5ddc4Srjs   memcpy(cmd->v, v, 1 * sizeof(GLuint64EXT));
487896c5ddc4Srjs}
487996c5ddc4Srjs
488096c5ddc4Srjs
488196c5ddc4Srjs/* GetVertexAttribLui64vARB: marshalled synchronously */
488296c5ddc4Srjsvoid GLAPIENTRY
488396c5ddc4Srjs_mesa_marshal_GetVertexAttribLui64vARB(GLuint index, GLenum pname, GLuint64EXT * params)
488496c5ddc4Srjs{
488596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
488696c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetVertexAttribLui64vARB");
488796c5ddc4Srjs   CALL_GetVertexAttribLui64vARB(ctx->CurrentServerDispatch, (index, pname, params));
488896c5ddc4Srjs}
488996c5ddc4Srjs
489096c5ddc4Srjs
489196c5ddc4Srjs/* DispatchComputeGroupSizeARB: marshalled asynchronously */
489296c5ddc4Srjsstruct marshal_cmd_DispatchComputeGroupSizeARB
489396c5ddc4Srjs{
489496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
489596c5ddc4Srjs   GLuint num_groups_x;
489696c5ddc4Srjs   GLuint num_groups_y;
489796c5ddc4Srjs   GLuint num_groups_z;
489896c5ddc4Srjs   GLuint group_size_x;
489996c5ddc4Srjs   GLuint group_size_y;
490096c5ddc4Srjs   GLuint group_size_z;
490196c5ddc4Srjs};
490296c5ddc4Srjsuint32_t
490396c5ddc4Srjs_mesa_unmarshal_DispatchComputeGroupSizeARB(struct gl_context *ctx, const struct marshal_cmd_DispatchComputeGroupSizeARB *cmd, const uint64_t *last)
490496c5ddc4Srjs{
490596c5ddc4Srjs   GLuint num_groups_x = cmd->num_groups_x;
490696c5ddc4Srjs   GLuint num_groups_y = cmd->num_groups_y;
490796c5ddc4Srjs   GLuint num_groups_z = cmd->num_groups_z;
490896c5ddc4Srjs   GLuint group_size_x = cmd->group_size_x;
490996c5ddc4Srjs   GLuint group_size_y = cmd->group_size_y;
491096c5ddc4Srjs   GLuint group_size_z = cmd->group_size_z;
491196c5ddc4Srjs   CALL_DispatchComputeGroupSizeARB(ctx->CurrentServerDispatch, (num_groups_x, num_groups_y, num_groups_z, group_size_x, group_size_y, group_size_z));
491296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DispatchComputeGroupSizeARB), 8) / 8);
491396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
491496c5ddc4Srjs   return cmd_size;
491596c5ddc4Srjs}
491696c5ddc4Srjsvoid GLAPIENTRY
491796c5ddc4Srjs_mesa_marshal_DispatchComputeGroupSizeARB(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z, GLuint group_size_x, GLuint group_size_y, GLuint group_size_z)
491896c5ddc4Srjs{
491996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
492096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DispatchComputeGroupSizeARB);
492196c5ddc4Srjs   struct marshal_cmd_DispatchComputeGroupSizeARB *cmd;
492296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DispatchComputeGroupSizeARB, cmd_size);
492396c5ddc4Srjs   cmd->num_groups_x = num_groups_x;
492496c5ddc4Srjs   cmd->num_groups_y = num_groups_y;
492596c5ddc4Srjs   cmd->num_groups_z = num_groups_z;
492696c5ddc4Srjs   cmd->group_size_x = group_size_x;
492796c5ddc4Srjs   cmd->group_size_y = group_size_y;
492896c5ddc4Srjs   cmd->group_size_z = group_size_z;
492996c5ddc4Srjs}
493096c5ddc4Srjs
493196c5ddc4Srjs
493296c5ddc4Srjs/* MultiDrawArraysIndirectCountARB: marshalled asynchronously */
493396c5ddc4Srjsstruct marshal_cmd_MultiDrawArraysIndirectCountARB
493496c5ddc4Srjs{
493596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
493696c5ddc4Srjs   GLenum mode;
493796c5ddc4Srjs   GLsizei maxdrawcount;
493896c5ddc4Srjs   GLsizei stride;
493996c5ddc4Srjs   GLintptr indirect;
494096c5ddc4Srjs   GLintptr drawcount;
494196c5ddc4Srjs};
494296c5ddc4Srjsuint32_t
494396c5ddc4Srjs_mesa_unmarshal_MultiDrawArraysIndirectCountARB(struct gl_context *ctx, const struct marshal_cmd_MultiDrawArraysIndirectCountARB *cmd, const uint64_t *last)
494496c5ddc4Srjs{
494596c5ddc4Srjs   GLenum mode = cmd->mode;
494696c5ddc4Srjs   GLintptr indirect = cmd->indirect;
494796c5ddc4Srjs   GLintptr drawcount = cmd->drawcount;
494896c5ddc4Srjs   GLsizei maxdrawcount = cmd->maxdrawcount;
494996c5ddc4Srjs   GLsizei stride = cmd->stride;
495096c5ddc4Srjs   CALL_MultiDrawArraysIndirectCountARB(ctx->CurrentServerDispatch, (mode, indirect, drawcount, maxdrawcount, stride));
495196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiDrawArraysIndirectCountARB), 8) / 8);
495296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
495396c5ddc4Srjs   return cmd_size;
495496c5ddc4Srjs}
495596c5ddc4Srjsvoid GLAPIENTRY
495696c5ddc4Srjs_mesa_marshal_MultiDrawArraysIndirectCountARB(GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride)
495796c5ddc4Srjs{
495896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
495996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiDrawArraysIndirectCountARB);
496096c5ddc4Srjs   struct marshal_cmd_MultiDrawArraysIndirectCountARB *cmd;
496196c5ddc4Srjs   if (_mesa_glthread_has_non_vbo_vertices(ctx)) {
496296c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "MultiDrawArraysIndirectCountARB");
496396c5ddc4Srjs      CALL_MultiDrawArraysIndirectCountARB(ctx->CurrentServerDispatch, (mode, indirect, drawcount, maxdrawcount, stride));
496496c5ddc4Srjs      return;
496596c5ddc4Srjs   }
496696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiDrawArraysIndirectCountARB, cmd_size);
496796c5ddc4Srjs   cmd->mode = mode;
496896c5ddc4Srjs   cmd->indirect = indirect;
496996c5ddc4Srjs   cmd->drawcount = drawcount;
497096c5ddc4Srjs   cmd->maxdrawcount = maxdrawcount;
497196c5ddc4Srjs   cmd->stride = stride;
497296c5ddc4Srjs}
497396c5ddc4Srjs
497496c5ddc4Srjs
497596c5ddc4Srjs/* MultiDrawElementsIndirectCountARB: marshalled asynchronously */
497696c5ddc4Srjsstruct marshal_cmd_MultiDrawElementsIndirectCountARB
497796c5ddc4Srjs{
497896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
497996c5ddc4Srjs   GLenum mode;
498096c5ddc4Srjs   GLenum type;
498196c5ddc4Srjs   GLsizei maxdrawcount;
498296c5ddc4Srjs   GLsizei stride;
498396c5ddc4Srjs   GLintptr indirect;
498496c5ddc4Srjs   GLintptr drawcount;
498596c5ddc4Srjs};
498696c5ddc4Srjsuint32_t
498796c5ddc4Srjs_mesa_unmarshal_MultiDrawElementsIndirectCountARB(struct gl_context *ctx, const struct marshal_cmd_MultiDrawElementsIndirectCountARB *cmd, const uint64_t *last)
498896c5ddc4Srjs{
498996c5ddc4Srjs   GLenum mode = cmd->mode;
499096c5ddc4Srjs   GLenum type = cmd->type;
499196c5ddc4Srjs   GLintptr indirect = cmd->indirect;
499296c5ddc4Srjs   GLintptr drawcount = cmd->drawcount;
499396c5ddc4Srjs   GLsizei maxdrawcount = cmd->maxdrawcount;
499496c5ddc4Srjs   GLsizei stride = cmd->stride;
499596c5ddc4Srjs   CALL_MultiDrawElementsIndirectCountARB(ctx->CurrentServerDispatch, (mode, type, indirect, drawcount, maxdrawcount, stride));
499696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiDrawElementsIndirectCountARB), 8) / 8);
499796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
499896c5ddc4Srjs   return cmd_size;
499996c5ddc4Srjs}
500096c5ddc4Srjsvoid GLAPIENTRY
500196c5ddc4Srjs_mesa_marshal_MultiDrawElementsIndirectCountARB(GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride)
500296c5ddc4Srjs{
500396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
500496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_MultiDrawElementsIndirectCountARB);
500596c5ddc4Srjs   struct marshal_cmd_MultiDrawElementsIndirectCountARB *cmd;
500696c5ddc4Srjs   if (_mesa_glthread_has_non_vbo_vertices(ctx)) {
500796c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "MultiDrawElementsIndirectCountARB");
500896c5ddc4Srjs      CALL_MultiDrawElementsIndirectCountARB(ctx->CurrentServerDispatch, (mode, type, indirect, drawcount, maxdrawcount, stride));
500996c5ddc4Srjs      return;
501096c5ddc4Srjs   }
501196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiDrawElementsIndirectCountARB, cmd_size);
501296c5ddc4Srjs   cmd->mode = mode;
501396c5ddc4Srjs   cmd->type = type;
501496c5ddc4Srjs   cmd->indirect = indirect;
501596c5ddc4Srjs   cmd->drawcount = drawcount;
501696c5ddc4Srjs   cmd->maxdrawcount = maxdrawcount;
501796c5ddc4Srjs   cmd->stride = stride;
501896c5ddc4Srjs}
501996c5ddc4Srjs
502096c5ddc4Srjs
502196c5ddc4Srjs/* ClipControl: marshalled asynchronously */
502296c5ddc4Srjsstruct marshal_cmd_ClipControl
502396c5ddc4Srjs{
502496c5ddc4Srjs   struct marshal_cmd_base cmd_base;
502596c5ddc4Srjs   GLenum origin;
502696c5ddc4Srjs   GLenum depth;
502796c5ddc4Srjs};
502896c5ddc4Srjsuint32_t
502996c5ddc4Srjs_mesa_unmarshal_ClipControl(struct gl_context *ctx, const struct marshal_cmd_ClipControl *cmd, const uint64_t *last)
503096c5ddc4Srjs{
503196c5ddc4Srjs   GLenum origin = cmd->origin;
503296c5ddc4Srjs   GLenum depth = cmd->depth;
503396c5ddc4Srjs   CALL_ClipControl(ctx->CurrentServerDispatch, (origin, depth));
503496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ClipControl), 8) / 8);
503596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
503696c5ddc4Srjs   return cmd_size;
503796c5ddc4Srjs}
503896c5ddc4Srjsvoid GLAPIENTRY
503996c5ddc4Srjs_mesa_marshal_ClipControl(GLenum origin, GLenum depth)
504096c5ddc4Srjs{
504196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
504296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ClipControl);
504396c5ddc4Srjs   struct marshal_cmd_ClipControl *cmd;
504496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClipControl, cmd_size);
504596c5ddc4Srjs   cmd->origin = origin;
504696c5ddc4Srjs   cmd->depth = depth;
504796c5ddc4Srjs}
504896c5ddc4Srjs
504996c5ddc4Srjs
505096c5ddc4Srjs/* CreateTransformFeedbacks: marshalled synchronously */
505196c5ddc4Srjsvoid GLAPIENTRY
505296c5ddc4Srjs_mesa_marshal_CreateTransformFeedbacks(GLsizei n, GLuint * ids)
505396c5ddc4Srjs{
505496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
505596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CreateTransformFeedbacks");
505696c5ddc4Srjs   CALL_CreateTransformFeedbacks(ctx->CurrentServerDispatch, (n, ids));
505796c5ddc4Srjs}
505896c5ddc4Srjs
505996c5ddc4Srjs
506096c5ddc4Srjs/* TransformFeedbackBufferBase: marshalled asynchronously */
506196c5ddc4Srjsstruct marshal_cmd_TransformFeedbackBufferBase
506296c5ddc4Srjs{
506396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
506496c5ddc4Srjs   GLuint xfb;
506596c5ddc4Srjs   GLuint index;
506696c5ddc4Srjs   GLuint buffer;
506796c5ddc4Srjs};
506896c5ddc4Srjsuint32_t
506996c5ddc4Srjs_mesa_unmarshal_TransformFeedbackBufferBase(struct gl_context *ctx, const struct marshal_cmd_TransformFeedbackBufferBase *cmd, const uint64_t *last)
507096c5ddc4Srjs{
507196c5ddc4Srjs   GLuint xfb = cmd->xfb;
507296c5ddc4Srjs   GLuint index = cmd->index;
507396c5ddc4Srjs   GLuint buffer = cmd->buffer;
507496c5ddc4Srjs   CALL_TransformFeedbackBufferBase(ctx->CurrentServerDispatch, (xfb, index, buffer));
507596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TransformFeedbackBufferBase), 8) / 8);
507696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
507796c5ddc4Srjs   return cmd_size;
507896c5ddc4Srjs}
507996c5ddc4Srjsvoid GLAPIENTRY
508096c5ddc4Srjs_mesa_marshal_TransformFeedbackBufferBase(GLuint xfb, GLuint index, GLuint buffer)
508196c5ddc4Srjs{
508296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
508396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TransformFeedbackBufferBase);
508496c5ddc4Srjs   struct marshal_cmd_TransformFeedbackBufferBase *cmd;
508596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TransformFeedbackBufferBase, cmd_size);
508696c5ddc4Srjs   cmd->xfb = xfb;
508796c5ddc4Srjs   cmd->index = index;
508896c5ddc4Srjs   cmd->buffer = buffer;
508996c5ddc4Srjs}
509096c5ddc4Srjs
509196c5ddc4Srjs
509296c5ddc4Srjs/* TransformFeedbackBufferRange: marshalled asynchronously */
509396c5ddc4Srjsstruct marshal_cmd_TransformFeedbackBufferRange
509496c5ddc4Srjs{
509596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
509696c5ddc4Srjs   GLuint xfb;
509796c5ddc4Srjs   GLuint index;
509896c5ddc4Srjs   GLuint buffer;
509996c5ddc4Srjs   GLintptr offset;
510096c5ddc4Srjs   GLsizeiptr size;
510196c5ddc4Srjs};
510296c5ddc4Srjsuint32_t
510396c5ddc4Srjs_mesa_unmarshal_TransformFeedbackBufferRange(struct gl_context *ctx, const struct marshal_cmd_TransformFeedbackBufferRange *cmd, const uint64_t *last)
510496c5ddc4Srjs{
510596c5ddc4Srjs   GLuint xfb = cmd->xfb;
510696c5ddc4Srjs   GLuint index = cmd->index;
510796c5ddc4Srjs   GLuint buffer = cmd->buffer;
510896c5ddc4Srjs   GLintptr offset = cmd->offset;
510996c5ddc4Srjs   GLsizeiptr size = cmd->size;
511096c5ddc4Srjs   CALL_TransformFeedbackBufferRange(ctx->CurrentServerDispatch, (xfb, index, buffer, offset, size));
511196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TransformFeedbackBufferRange), 8) / 8);
511296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
511396c5ddc4Srjs   return cmd_size;
511496c5ddc4Srjs}
511596c5ddc4Srjsvoid GLAPIENTRY
511696c5ddc4Srjs_mesa_marshal_TransformFeedbackBufferRange(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
511796c5ddc4Srjs{
511896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
511996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TransformFeedbackBufferRange);
512096c5ddc4Srjs   struct marshal_cmd_TransformFeedbackBufferRange *cmd;
512196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TransformFeedbackBufferRange, cmd_size);
512296c5ddc4Srjs   cmd->xfb = xfb;
512396c5ddc4Srjs   cmd->index = index;
512496c5ddc4Srjs   cmd->buffer = buffer;
512596c5ddc4Srjs   cmd->offset = offset;
512696c5ddc4Srjs   cmd->size = size;
512796c5ddc4Srjs}
512896c5ddc4Srjs
512996c5ddc4Srjs
513096c5ddc4Srjs/* GetTransformFeedbackiv: marshalled synchronously */
513196c5ddc4Srjsvoid GLAPIENTRY
513296c5ddc4Srjs_mesa_marshal_GetTransformFeedbackiv(GLuint xfb, GLenum pname, GLint * param)
513396c5ddc4Srjs{
513496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
513596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTransformFeedbackiv");
513696c5ddc4Srjs   CALL_GetTransformFeedbackiv(ctx->CurrentServerDispatch, (xfb, pname, param));
513796c5ddc4Srjs}
513896c5ddc4Srjs
513996c5ddc4Srjs
514096c5ddc4Srjs/* GetTransformFeedbacki_v: marshalled synchronously */
514196c5ddc4Srjsvoid GLAPIENTRY
514296c5ddc4Srjs_mesa_marshal_GetTransformFeedbacki_v(GLuint xfb, GLenum pname, GLuint index, GLint * param)
514396c5ddc4Srjs{
514496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
514596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTransformFeedbacki_v");
514696c5ddc4Srjs   CALL_GetTransformFeedbacki_v(ctx->CurrentServerDispatch, (xfb, pname, index, param));
514796c5ddc4Srjs}
514896c5ddc4Srjs
514996c5ddc4Srjs
515096c5ddc4Srjs/* GetTransformFeedbacki64_v: marshalled synchronously */
515196c5ddc4Srjsvoid GLAPIENTRY
515296c5ddc4Srjs_mesa_marshal_GetTransformFeedbacki64_v(GLuint xfb, GLenum pname, GLuint index, GLint64 * param)
515396c5ddc4Srjs{
515496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
515596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTransformFeedbacki64_v");
515696c5ddc4Srjs   CALL_GetTransformFeedbacki64_v(ctx->CurrentServerDispatch, (xfb, pname, index, param));
515796c5ddc4Srjs}
515896c5ddc4Srjs
515996c5ddc4Srjs
516096c5ddc4Srjs/* CreateBuffers: marshalled synchronously */
516196c5ddc4Srjsvoid GLAPIENTRY
516296c5ddc4Srjs_mesa_marshal_CreateBuffers(GLsizei n, GLuint * buffers)
516396c5ddc4Srjs{
516496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
516596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CreateBuffers");
516696c5ddc4Srjs   CALL_CreateBuffers(ctx->CurrentServerDispatch, (n, buffers));
516796c5ddc4Srjs}
516896c5ddc4Srjs
516996c5ddc4Srjs
517096c5ddc4Srjs/* NamedBufferStorage: marshalled synchronously */
517196c5ddc4Srjsvoid GLAPIENTRY
517296c5ddc4Srjs_mesa_marshal_NamedBufferStorage(GLuint buffer, GLsizeiptr size, const GLvoid * data, GLbitfield flags)
517396c5ddc4Srjs{
517496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
517596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "NamedBufferStorage");
517696c5ddc4Srjs   CALL_NamedBufferStorage(ctx->CurrentServerDispatch, (buffer, size, data, flags));
517796c5ddc4Srjs}
517896c5ddc4Srjs
517996c5ddc4Srjs
518096c5ddc4Srjs/* CopyNamedBufferSubData: marshalled asynchronously */
518196c5ddc4Srjsstruct marshal_cmd_CopyNamedBufferSubData
518296c5ddc4Srjs{
518396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
518496c5ddc4Srjs   GLuint readBuffer;
518596c5ddc4Srjs   GLuint writeBuffer;
518696c5ddc4Srjs   GLintptr readOffset;
518796c5ddc4Srjs   GLintptr writeOffset;
518896c5ddc4Srjs   GLsizeiptr size;
518996c5ddc4Srjs};
519096c5ddc4Srjsuint32_t
519196c5ddc4Srjs_mesa_unmarshal_CopyNamedBufferSubData(struct gl_context *ctx, const struct marshal_cmd_CopyNamedBufferSubData *cmd, const uint64_t *last)
519296c5ddc4Srjs{
519396c5ddc4Srjs   GLuint readBuffer = cmd->readBuffer;
519496c5ddc4Srjs   GLuint writeBuffer = cmd->writeBuffer;
519596c5ddc4Srjs   GLintptr readOffset = cmd->readOffset;
519696c5ddc4Srjs   GLintptr writeOffset = cmd->writeOffset;
519796c5ddc4Srjs   GLsizeiptr size = cmd->size;
519896c5ddc4Srjs   CALL_CopyNamedBufferSubData(ctx->CurrentServerDispatch, (readBuffer, writeBuffer, readOffset, writeOffset, size));
519996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CopyNamedBufferSubData), 8) / 8);
520096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
520196c5ddc4Srjs   return cmd_size;
520296c5ddc4Srjs}
520396c5ddc4Srjsvoid GLAPIENTRY
520496c5ddc4Srjs_mesa_marshal_CopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
520596c5ddc4Srjs{
520696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
520796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CopyNamedBufferSubData);
520896c5ddc4Srjs   struct marshal_cmd_CopyNamedBufferSubData *cmd;
520996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyNamedBufferSubData, cmd_size);
521096c5ddc4Srjs   cmd->readBuffer = readBuffer;
521196c5ddc4Srjs   cmd->writeBuffer = writeBuffer;
521296c5ddc4Srjs   cmd->readOffset = readOffset;
521396c5ddc4Srjs   cmd->writeOffset = writeOffset;
521496c5ddc4Srjs   cmd->size = size;
521596c5ddc4Srjs}
521696c5ddc4Srjs
521796c5ddc4Srjs
521896c5ddc4Srjs/* ClearNamedBufferData: marshalled synchronously */
521996c5ddc4Srjsvoid GLAPIENTRY
522096c5ddc4Srjs_mesa_marshal_ClearNamedBufferData(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const GLvoid * data)
522196c5ddc4Srjs{
522296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
522396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ClearNamedBufferData");
522496c5ddc4Srjs   CALL_ClearNamedBufferData(ctx->CurrentServerDispatch, (buffer, internalformat, format, type, data));
522596c5ddc4Srjs}
522696c5ddc4Srjs
522796c5ddc4Srjs
522896c5ddc4Srjs/* ClearNamedBufferSubData: marshalled synchronously */
522996c5ddc4Srjsvoid GLAPIENTRY
523096c5ddc4Srjs_mesa_marshal_ClearNamedBufferSubData(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid * data)
523196c5ddc4Srjs{
523296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
523396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "ClearNamedBufferSubData");
523496c5ddc4Srjs   CALL_ClearNamedBufferSubData(ctx->CurrentServerDispatch, (buffer, internalformat, offset, size, format, type, data));
523596c5ddc4Srjs}
523696c5ddc4Srjs
523796c5ddc4Srjs
523896c5ddc4Srjs/* MapNamedBuffer: marshalled synchronously */
523996c5ddc4SrjsGLvoid * GLAPIENTRY
524096c5ddc4Srjs_mesa_marshal_MapNamedBuffer(GLuint buffer, GLenum access)
524196c5ddc4Srjs{
524296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
524396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "MapNamedBuffer");
524496c5ddc4Srjs   return CALL_MapNamedBuffer(ctx->CurrentServerDispatch, (buffer, access));
524596c5ddc4Srjs}
524696c5ddc4Srjs
524796c5ddc4Srjs
524896c5ddc4Srjs/* MapNamedBufferRange: marshalled synchronously */
524996c5ddc4SrjsGLvoid * GLAPIENTRY
525096c5ddc4Srjs_mesa_marshal_MapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access)
525196c5ddc4Srjs{
525296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
525396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "MapNamedBufferRange");
525496c5ddc4Srjs   return CALL_MapNamedBufferRange(ctx->CurrentServerDispatch, (buffer, offset, length, access));
525596c5ddc4Srjs}
525696c5ddc4Srjs
525796c5ddc4Srjs
525896c5ddc4Srjs/* UnmapNamedBufferEXT: marshalled asynchronously */
525996c5ddc4Srjsstruct marshal_cmd_UnmapNamedBufferEXT
526096c5ddc4Srjs{
526196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
526296c5ddc4Srjs   GLuint buffer;
526396c5ddc4Srjs};
526496c5ddc4Srjsuint32_t
526596c5ddc4Srjs_mesa_unmarshal_UnmapNamedBufferEXT(struct gl_context *ctx, const struct marshal_cmd_UnmapNamedBufferEXT *cmd, const uint64_t *last)
526696c5ddc4Srjs{
526796c5ddc4Srjs   GLuint buffer = cmd->buffer;
526896c5ddc4Srjs   CALL_UnmapNamedBufferEXT(ctx->CurrentServerDispatch, (buffer));
526996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_UnmapNamedBufferEXT), 8) / 8);
527096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
527196c5ddc4Srjs   return cmd_size;
527296c5ddc4Srjs}
527396c5ddc4SrjsGLboolean GLAPIENTRY
527496c5ddc4Srjs_mesa_marshal_UnmapNamedBufferEXT(GLuint buffer)
527596c5ddc4Srjs{
527696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
527796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_UnmapNamedBufferEXT);
527896c5ddc4Srjs   struct marshal_cmd_UnmapNamedBufferEXT *cmd;
527996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UnmapNamedBufferEXT, cmd_size);
528096c5ddc4Srjs   cmd->buffer = buffer;
528196c5ddc4Srjs   return GL_TRUE;
528296c5ddc4Srjs}
528396c5ddc4Srjs
528496c5ddc4Srjs
528596c5ddc4Srjs/* FlushMappedNamedBufferRange: marshalled asynchronously */
528696c5ddc4Srjsstruct marshal_cmd_FlushMappedNamedBufferRange
528796c5ddc4Srjs{
528896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
528996c5ddc4Srjs   GLuint buffer;
529096c5ddc4Srjs   GLintptr offset;
529196c5ddc4Srjs   GLsizeiptr length;
529296c5ddc4Srjs};
529396c5ddc4Srjsuint32_t
529496c5ddc4Srjs_mesa_unmarshal_FlushMappedNamedBufferRange(struct gl_context *ctx, const struct marshal_cmd_FlushMappedNamedBufferRange *cmd, const uint64_t *last)
529596c5ddc4Srjs{
529696c5ddc4Srjs   GLuint buffer = cmd->buffer;
529796c5ddc4Srjs   GLintptr offset = cmd->offset;
529896c5ddc4Srjs   GLsizeiptr length = cmd->length;
529996c5ddc4Srjs   CALL_FlushMappedNamedBufferRange(ctx->CurrentServerDispatch, (buffer, offset, length));
530096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FlushMappedNamedBufferRange), 8) / 8);
530196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
530296c5ddc4Srjs   return cmd_size;
530396c5ddc4Srjs}
530496c5ddc4Srjsvoid GLAPIENTRY
530596c5ddc4Srjs_mesa_marshal_FlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length)
530696c5ddc4Srjs{
530796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
530896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_FlushMappedNamedBufferRange);
530996c5ddc4Srjs   struct marshal_cmd_FlushMappedNamedBufferRange *cmd;
531096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FlushMappedNamedBufferRange, cmd_size);
531196c5ddc4Srjs   cmd->buffer = buffer;
531296c5ddc4Srjs   cmd->offset = offset;
531396c5ddc4Srjs   cmd->length = length;
531496c5ddc4Srjs}
531596c5ddc4Srjs
531696c5ddc4Srjs
531796c5ddc4Srjs/* GetNamedBufferParameteriv: marshalled synchronously */
531896c5ddc4Srjsvoid GLAPIENTRY
531996c5ddc4Srjs_mesa_marshal_GetNamedBufferParameteriv(GLuint buffer, GLenum pname, GLint * params)
532096c5ddc4Srjs{
532196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
532296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetNamedBufferParameteriv");
532396c5ddc4Srjs   CALL_GetNamedBufferParameteriv(ctx->CurrentServerDispatch, (buffer, pname, params));
532496c5ddc4Srjs}
532596c5ddc4Srjs
532696c5ddc4Srjs
532796c5ddc4Srjs/* GetNamedBufferParameteri64v: marshalled synchronously */
532896c5ddc4Srjsvoid GLAPIENTRY
532996c5ddc4Srjs_mesa_marshal_GetNamedBufferParameteri64v(GLuint buffer, GLenum pname, GLint64 * params)
533096c5ddc4Srjs{
533196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
533296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetNamedBufferParameteri64v");
533396c5ddc4Srjs   CALL_GetNamedBufferParameteri64v(ctx->CurrentServerDispatch, (buffer, pname, params));
533496c5ddc4Srjs}
533596c5ddc4Srjs
533696c5ddc4Srjs
533796c5ddc4Srjs/* GetNamedBufferPointerv: marshalled synchronously */
533896c5ddc4Srjsvoid GLAPIENTRY
533996c5ddc4Srjs_mesa_marshal_GetNamedBufferPointerv(GLuint buffer, GLenum pname, GLvoid ** params)
534096c5ddc4Srjs{
534196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
534296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetNamedBufferPointerv");
534396c5ddc4Srjs   CALL_GetNamedBufferPointerv(ctx->CurrentServerDispatch, (buffer, pname, params));
534496c5ddc4Srjs}
534596c5ddc4Srjs
534696c5ddc4Srjs
534796c5ddc4Srjs/* GetNamedBufferSubData: marshalled synchronously */
534896c5ddc4Srjsvoid GLAPIENTRY
534996c5ddc4Srjs_mesa_marshal_GetNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid * data)
535096c5ddc4Srjs{
535196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
535296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetNamedBufferSubData");
535396c5ddc4Srjs   CALL_GetNamedBufferSubData(ctx->CurrentServerDispatch, (buffer, offset, size, data));
535496c5ddc4Srjs}
535596c5ddc4Srjs
535696c5ddc4Srjs
535796c5ddc4Srjs/* CreateFramebuffers: marshalled synchronously */
535896c5ddc4Srjsvoid GLAPIENTRY
535996c5ddc4Srjs_mesa_marshal_CreateFramebuffers(GLsizei n, GLuint * framebuffers)
536096c5ddc4Srjs{
536196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
536296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CreateFramebuffers");
536396c5ddc4Srjs   CALL_CreateFramebuffers(ctx->CurrentServerDispatch, (n, framebuffers));
536496c5ddc4Srjs}
536596c5ddc4Srjs
536696c5ddc4Srjs
536796c5ddc4Srjs/* NamedFramebufferRenderbuffer: marshalled asynchronously */
536896c5ddc4Srjsstruct marshal_cmd_NamedFramebufferRenderbuffer
536996c5ddc4Srjs{
537096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
537196c5ddc4Srjs   GLuint framebuffer;
537296c5ddc4Srjs   GLenum attachment;
537396c5ddc4Srjs   GLenum renderbuffertarget;
537496c5ddc4Srjs   GLuint renderbuffer;
537596c5ddc4Srjs};
537696c5ddc4Srjsuint32_t
537796c5ddc4Srjs_mesa_unmarshal_NamedFramebufferRenderbuffer(struct gl_context *ctx, const struct marshal_cmd_NamedFramebufferRenderbuffer *cmd, const uint64_t *last)
537896c5ddc4Srjs{
537996c5ddc4Srjs   GLuint framebuffer = cmd->framebuffer;
538096c5ddc4Srjs   GLenum attachment = cmd->attachment;
538196c5ddc4Srjs   GLenum renderbuffertarget = cmd->renderbuffertarget;
538296c5ddc4Srjs   GLuint renderbuffer = cmd->renderbuffer;
538396c5ddc4Srjs   CALL_NamedFramebufferRenderbuffer(ctx->CurrentServerDispatch, (framebuffer, attachment, renderbuffertarget, renderbuffer));
538496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedFramebufferRenderbuffer), 8) / 8);
538596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
538696c5ddc4Srjs   return cmd_size;
538796c5ddc4Srjs}
538896c5ddc4Srjsvoid GLAPIENTRY
538996c5ddc4Srjs_mesa_marshal_NamedFramebufferRenderbuffer(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
539096c5ddc4Srjs{
539196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
539296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_NamedFramebufferRenderbuffer);
539396c5ddc4Srjs   struct marshal_cmd_NamedFramebufferRenderbuffer *cmd;
539496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedFramebufferRenderbuffer, cmd_size);
539596c5ddc4Srjs   cmd->framebuffer = framebuffer;
539696c5ddc4Srjs   cmd->attachment = attachment;
539796c5ddc4Srjs   cmd->renderbuffertarget = renderbuffertarget;
539896c5ddc4Srjs   cmd->renderbuffer = renderbuffer;
539996c5ddc4Srjs}
540096c5ddc4Srjs
540196c5ddc4Srjs
540296c5ddc4Srjs/* NamedFramebufferParameteri: marshalled asynchronously */
540396c5ddc4Srjsstruct marshal_cmd_NamedFramebufferParameteri
540496c5ddc4Srjs{
540596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
540696c5ddc4Srjs   GLuint framebuffer;
540796c5ddc4Srjs   GLenum pname;
540896c5ddc4Srjs   GLint param;
540996c5ddc4Srjs};
541096c5ddc4Srjsuint32_t
541196c5ddc4Srjs_mesa_unmarshal_NamedFramebufferParameteri(struct gl_context *ctx, const struct marshal_cmd_NamedFramebufferParameteri *cmd, const uint64_t *last)
541296c5ddc4Srjs{
541396c5ddc4Srjs   GLuint framebuffer = cmd->framebuffer;
541496c5ddc4Srjs   GLenum pname = cmd->pname;
541596c5ddc4Srjs   GLint param = cmd->param;
541696c5ddc4Srjs   CALL_NamedFramebufferParameteri(ctx->CurrentServerDispatch, (framebuffer, pname, param));
541796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedFramebufferParameteri), 8) / 8);
541896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
541996c5ddc4Srjs   return cmd_size;
542096c5ddc4Srjs}
542196c5ddc4Srjsvoid GLAPIENTRY
542296c5ddc4Srjs_mesa_marshal_NamedFramebufferParameteri(GLuint framebuffer, GLenum pname, GLint param)
542396c5ddc4Srjs{
542496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
542596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_NamedFramebufferParameteri);
542696c5ddc4Srjs   struct marshal_cmd_NamedFramebufferParameteri *cmd;
542796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedFramebufferParameteri, cmd_size);
542896c5ddc4Srjs   cmd->framebuffer = framebuffer;
542996c5ddc4Srjs   cmd->pname = pname;
543096c5ddc4Srjs   cmd->param = param;
543196c5ddc4Srjs}
543296c5ddc4Srjs
543396c5ddc4Srjs
543496c5ddc4Srjs/* NamedFramebufferTexture: marshalled asynchronously */
543596c5ddc4Srjsstruct marshal_cmd_NamedFramebufferTexture
543696c5ddc4Srjs{
543796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
543896c5ddc4Srjs   GLuint framebuffer;
543996c5ddc4Srjs   GLenum attachment;
544096c5ddc4Srjs   GLuint texture;
544196c5ddc4Srjs   GLint level;
544296c5ddc4Srjs};
544396c5ddc4Srjsuint32_t
544496c5ddc4Srjs_mesa_unmarshal_NamedFramebufferTexture(struct gl_context *ctx, const struct marshal_cmd_NamedFramebufferTexture *cmd, const uint64_t *last)
544596c5ddc4Srjs{
544696c5ddc4Srjs   GLuint framebuffer = cmd->framebuffer;
544796c5ddc4Srjs   GLenum attachment = cmd->attachment;
544896c5ddc4Srjs   GLuint texture = cmd->texture;
544996c5ddc4Srjs   GLint level = cmd->level;
545096c5ddc4Srjs   CALL_NamedFramebufferTexture(ctx->CurrentServerDispatch, (framebuffer, attachment, texture, level));
545196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedFramebufferTexture), 8) / 8);
545296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
545396c5ddc4Srjs   return cmd_size;
545496c5ddc4Srjs}
545596c5ddc4Srjsvoid GLAPIENTRY
545696c5ddc4Srjs_mesa_marshal_NamedFramebufferTexture(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level)
545796c5ddc4Srjs{
545896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
545996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_NamedFramebufferTexture);
546096c5ddc4Srjs   struct marshal_cmd_NamedFramebufferTexture *cmd;
546196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedFramebufferTexture, cmd_size);
546296c5ddc4Srjs   cmd->framebuffer = framebuffer;
546396c5ddc4Srjs   cmd->attachment = attachment;
546496c5ddc4Srjs   cmd->texture = texture;
546596c5ddc4Srjs   cmd->level = level;
546696c5ddc4Srjs}
546796c5ddc4Srjs
546896c5ddc4Srjs
546996c5ddc4Srjs/* NamedFramebufferTextureLayer: marshalled asynchronously */
547096c5ddc4Srjsstruct marshal_cmd_NamedFramebufferTextureLayer
547196c5ddc4Srjs{
547296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
547396c5ddc4Srjs   GLuint framebuffer;
547496c5ddc4Srjs   GLenum attachment;
547596c5ddc4Srjs   GLuint texture;
547696c5ddc4Srjs   GLint level;
547796c5ddc4Srjs   GLint layer;
547896c5ddc4Srjs};
547996c5ddc4Srjsuint32_t
548096c5ddc4Srjs_mesa_unmarshal_NamedFramebufferTextureLayer(struct gl_context *ctx, const struct marshal_cmd_NamedFramebufferTextureLayer *cmd, const uint64_t *last)
548196c5ddc4Srjs{
548296c5ddc4Srjs   GLuint framebuffer = cmd->framebuffer;
548396c5ddc4Srjs   GLenum attachment = cmd->attachment;
548496c5ddc4Srjs   GLuint texture = cmd->texture;
548596c5ddc4Srjs   GLint level = cmd->level;
548696c5ddc4Srjs   GLint layer = cmd->layer;
548796c5ddc4Srjs   CALL_NamedFramebufferTextureLayer(ctx->CurrentServerDispatch, (framebuffer, attachment, texture, level, layer));
548896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedFramebufferTextureLayer), 8) / 8);
548996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
549096c5ddc4Srjs   return cmd_size;
549196c5ddc4Srjs}
549296c5ddc4Srjsvoid GLAPIENTRY
549396c5ddc4Srjs_mesa_marshal_NamedFramebufferTextureLayer(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer)
549496c5ddc4Srjs{
549596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
549696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_NamedFramebufferTextureLayer);
549796c5ddc4Srjs   struct marshal_cmd_NamedFramebufferTextureLayer *cmd;
549896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedFramebufferTextureLayer, cmd_size);
549996c5ddc4Srjs   cmd->framebuffer = framebuffer;
550096c5ddc4Srjs   cmd->attachment = attachment;
550196c5ddc4Srjs   cmd->texture = texture;
550296c5ddc4Srjs   cmd->level = level;
550396c5ddc4Srjs   cmd->layer = layer;
550496c5ddc4Srjs}
550596c5ddc4Srjs
550696c5ddc4Srjs
550796c5ddc4Srjs/* NamedFramebufferDrawBuffer: marshalled asynchronously */
550896c5ddc4Srjsstruct marshal_cmd_NamedFramebufferDrawBuffer
550996c5ddc4Srjs{
551096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
551196c5ddc4Srjs   GLuint framebuffer;
551296c5ddc4Srjs   GLenum buf;
551396c5ddc4Srjs};
551496c5ddc4Srjsuint32_t
551596c5ddc4Srjs_mesa_unmarshal_NamedFramebufferDrawBuffer(struct gl_context *ctx, const struct marshal_cmd_NamedFramebufferDrawBuffer *cmd, const uint64_t *last)
551696c5ddc4Srjs{
551796c5ddc4Srjs   GLuint framebuffer = cmd->framebuffer;
551896c5ddc4Srjs   GLenum buf = cmd->buf;
551996c5ddc4Srjs   CALL_NamedFramebufferDrawBuffer(ctx->CurrentServerDispatch, (framebuffer, buf));
552096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedFramebufferDrawBuffer), 8) / 8);
552196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
552296c5ddc4Srjs   return cmd_size;
552396c5ddc4Srjs}
552496c5ddc4Srjsvoid GLAPIENTRY
552596c5ddc4Srjs_mesa_marshal_NamedFramebufferDrawBuffer(GLuint framebuffer, GLenum buf)
552696c5ddc4Srjs{
552796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
552896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_NamedFramebufferDrawBuffer);
552996c5ddc4Srjs   struct marshal_cmd_NamedFramebufferDrawBuffer *cmd;
553096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedFramebufferDrawBuffer, cmd_size);
553196c5ddc4Srjs   cmd->framebuffer = framebuffer;
553296c5ddc4Srjs   cmd->buf = buf;
553396c5ddc4Srjs}
553496c5ddc4Srjs
553596c5ddc4Srjs
553696c5ddc4Srjs/* NamedFramebufferDrawBuffers: marshalled asynchronously */
553796c5ddc4Srjsstruct marshal_cmd_NamedFramebufferDrawBuffers
553896c5ddc4Srjs{
553996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
554096c5ddc4Srjs   GLuint framebuffer;
554196c5ddc4Srjs   GLsizei n;
554296c5ddc4Srjs   /* Next safe_mul(n, 1 * sizeof(GLenum)) bytes are GLenum bufs[n] */
554396c5ddc4Srjs};
554496c5ddc4Srjsuint32_t
554596c5ddc4Srjs_mesa_unmarshal_NamedFramebufferDrawBuffers(struct gl_context *ctx, const struct marshal_cmd_NamedFramebufferDrawBuffers *cmd, const uint64_t *last)
554696c5ddc4Srjs{
554796c5ddc4Srjs   GLuint framebuffer = cmd->framebuffer;
554896c5ddc4Srjs   GLsizei n = cmd->n;
554996c5ddc4Srjs   GLenum * bufs;
555096c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
555196c5ddc4Srjs   bufs = (GLenum *) variable_data;
555296c5ddc4Srjs   CALL_NamedFramebufferDrawBuffers(ctx->CurrentServerDispatch, (framebuffer, n, bufs));
555396c5ddc4Srjs   return cmd->cmd_base.cmd_size;
555496c5ddc4Srjs}
555596c5ddc4Srjsvoid GLAPIENTRY
555696c5ddc4Srjs_mesa_marshal_NamedFramebufferDrawBuffers(GLuint framebuffer, GLsizei n, const GLenum * bufs)
555796c5ddc4Srjs{
555896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
555996c5ddc4Srjs   int bufs_size = safe_mul(n, 1 * sizeof(GLenum));
556096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_NamedFramebufferDrawBuffers) + bufs_size;
556196c5ddc4Srjs   struct marshal_cmd_NamedFramebufferDrawBuffers *cmd;
556296c5ddc4Srjs   if (unlikely(bufs_size < 0 || (bufs_size > 0 && !bufs) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
556396c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "NamedFramebufferDrawBuffers");
556496c5ddc4Srjs      CALL_NamedFramebufferDrawBuffers(ctx->CurrentServerDispatch, (framebuffer, n, bufs));
556596c5ddc4Srjs      return;
556696c5ddc4Srjs   }
556796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedFramebufferDrawBuffers, cmd_size);
556896c5ddc4Srjs   cmd->framebuffer = framebuffer;
556996c5ddc4Srjs   cmd->n = n;
557096c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
557196c5ddc4Srjs   memcpy(variable_data, bufs, bufs_size);
557296c5ddc4Srjs}
557396c5ddc4Srjs
557496c5ddc4Srjs
557596c5ddc4Srjs/* NamedFramebufferReadBuffer: marshalled asynchronously */
557696c5ddc4Srjsstruct marshal_cmd_NamedFramebufferReadBuffer
557796c5ddc4Srjs{
557896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
557996c5ddc4Srjs   GLuint framebuffer;
558096c5ddc4Srjs   GLenum buf;
558196c5ddc4Srjs};
558296c5ddc4Srjsuint32_t
558396c5ddc4Srjs_mesa_unmarshal_NamedFramebufferReadBuffer(struct gl_context *ctx, const struct marshal_cmd_NamedFramebufferReadBuffer *cmd, const uint64_t *last)
558496c5ddc4Srjs{
558596c5ddc4Srjs   GLuint framebuffer = cmd->framebuffer;
558696c5ddc4Srjs   GLenum buf = cmd->buf;
558796c5ddc4Srjs   CALL_NamedFramebufferReadBuffer(ctx->CurrentServerDispatch, (framebuffer, buf));
558896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedFramebufferReadBuffer), 8) / 8);
558996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
559096c5ddc4Srjs   return cmd_size;
559196c5ddc4Srjs}
559296c5ddc4Srjsvoid GLAPIENTRY
559396c5ddc4Srjs_mesa_marshal_NamedFramebufferReadBuffer(GLuint framebuffer, GLenum buf)
559496c5ddc4Srjs{
559596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
559696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_NamedFramebufferReadBuffer);
559796c5ddc4Srjs   struct marshal_cmd_NamedFramebufferReadBuffer *cmd;
559896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedFramebufferReadBuffer, cmd_size);
559996c5ddc4Srjs   cmd->framebuffer = framebuffer;
560096c5ddc4Srjs   cmd->buf = buf;
560196c5ddc4Srjs}
560296c5ddc4Srjs
560396c5ddc4Srjs
560496c5ddc4Srjs/* InvalidateNamedFramebufferData: marshalled asynchronously */
560596c5ddc4Srjsstruct marshal_cmd_InvalidateNamedFramebufferData
560696c5ddc4Srjs{
560796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
560896c5ddc4Srjs   GLuint framebuffer;
560996c5ddc4Srjs   GLsizei numAttachments;
561096c5ddc4Srjs   /* Next safe_mul(numAttachments, 1 * sizeof(GLenum)) bytes are GLenum attachments[numAttachments] */
561196c5ddc4Srjs};
561296c5ddc4Srjsuint32_t
561396c5ddc4Srjs_mesa_unmarshal_InvalidateNamedFramebufferData(struct gl_context *ctx, const struct marshal_cmd_InvalidateNamedFramebufferData *cmd, const uint64_t *last)
561496c5ddc4Srjs{
561596c5ddc4Srjs   GLuint framebuffer = cmd->framebuffer;
561696c5ddc4Srjs   GLsizei numAttachments = cmd->numAttachments;
561796c5ddc4Srjs   GLenum * attachments;
561896c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
561996c5ddc4Srjs   attachments = (GLenum *) variable_data;
562096c5ddc4Srjs   CALL_InvalidateNamedFramebufferData(ctx->CurrentServerDispatch, (framebuffer, numAttachments, attachments));
562196c5ddc4Srjs   return cmd->cmd_base.cmd_size;
562296c5ddc4Srjs}
562396c5ddc4Srjsvoid GLAPIENTRY
562496c5ddc4Srjs_mesa_marshal_InvalidateNamedFramebufferData(GLuint framebuffer, GLsizei numAttachments, const GLenum * attachments)
562596c5ddc4Srjs{
562696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
562796c5ddc4Srjs   int attachments_size = safe_mul(numAttachments, 1 * sizeof(GLenum));
562896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_InvalidateNamedFramebufferData) + attachments_size;
562996c5ddc4Srjs   struct marshal_cmd_InvalidateNamedFramebufferData *cmd;
563096c5ddc4Srjs   if (unlikely(attachments_size < 0 || (attachments_size > 0 && !attachments) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
563196c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "InvalidateNamedFramebufferData");
563296c5ddc4Srjs      CALL_InvalidateNamedFramebufferData(ctx->CurrentServerDispatch, (framebuffer, numAttachments, attachments));
563396c5ddc4Srjs      return;
563496c5ddc4Srjs   }
563596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InvalidateNamedFramebufferData, cmd_size);
563696c5ddc4Srjs   cmd->framebuffer = framebuffer;
563796c5ddc4Srjs   cmd->numAttachments = numAttachments;
563896c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
563996c5ddc4Srjs   memcpy(variable_data, attachments, attachments_size);
564096c5ddc4Srjs}
564196c5ddc4Srjs
564296c5ddc4Srjs
564396c5ddc4Srjs/* InvalidateNamedFramebufferSubData: marshalled asynchronously */
564496c5ddc4Srjsstruct marshal_cmd_InvalidateNamedFramebufferSubData
564596c5ddc4Srjs{
564696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
564796c5ddc4Srjs   GLuint framebuffer;
564896c5ddc4Srjs   GLsizei numAttachments;
564996c5ddc4Srjs   GLint x;
565096c5ddc4Srjs   GLint y;
565196c5ddc4Srjs   GLsizei width;
565296c5ddc4Srjs   GLsizei height;
565396c5ddc4Srjs   /* Next safe_mul(numAttachments, 1 * sizeof(GLenum)) bytes are GLenum attachments[numAttachments] */
565496c5ddc4Srjs};
565596c5ddc4Srjsuint32_t
565696c5ddc4Srjs_mesa_unmarshal_InvalidateNamedFramebufferSubData(struct gl_context *ctx, const struct marshal_cmd_InvalidateNamedFramebufferSubData *cmd, const uint64_t *last)
565796c5ddc4Srjs{
565896c5ddc4Srjs   GLuint framebuffer = cmd->framebuffer;
565996c5ddc4Srjs   GLsizei numAttachments = cmd->numAttachments;
566096c5ddc4Srjs   GLint x = cmd->x;
566196c5ddc4Srjs   GLint y = cmd->y;
566296c5ddc4Srjs   GLsizei width = cmd->width;
566396c5ddc4Srjs   GLsizei height = cmd->height;
566496c5ddc4Srjs   GLenum * attachments;
566596c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
566696c5ddc4Srjs   attachments = (GLenum *) variable_data;
566796c5ddc4Srjs   CALL_InvalidateNamedFramebufferSubData(ctx->CurrentServerDispatch, (framebuffer, numAttachments, attachments, x, y, width, height));
566896c5ddc4Srjs   return cmd->cmd_base.cmd_size;
566996c5ddc4Srjs}
567096c5ddc4Srjsvoid GLAPIENTRY
567196c5ddc4Srjs_mesa_marshal_InvalidateNamedFramebufferSubData(GLuint framebuffer, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height)
567296c5ddc4Srjs{
567396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
567496c5ddc4Srjs   int attachments_size = safe_mul(numAttachments, 1 * sizeof(GLenum));
567596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_InvalidateNamedFramebufferSubData) + attachments_size;
567696c5ddc4Srjs   struct marshal_cmd_InvalidateNamedFramebufferSubData *cmd;
567796c5ddc4Srjs   if (unlikely(attachments_size < 0 || (attachments_size > 0 && !attachments) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
567896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "InvalidateNamedFramebufferSubData");
567996c5ddc4Srjs      CALL_InvalidateNamedFramebufferSubData(ctx->CurrentServerDispatch, (framebuffer, numAttachments, attachments, x, y, width, height));
568096c5ddc4Srjs      return;
568196c5ddc4Srjs   }
568296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InvalidateNamedFramebufferSubData, cmd_size);
568396c5ddc4Srjs   cmd->framebuffer = framebuffer;
568496c5ddc4Srjs   cmd->numAttachments = numAttachments;
568596c5ddc4Srjs   cmd->x = x;
568696c5ddc4Srjs   cmd->y = y;
568796c5ddc4Srjs   cmd->width = width;
568896c5ddc4Srjs   cmd->height = height;
568996c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
569096c5ddc4Srjs   memcpy(variable_data, attachments, attachments_size);
569196c5ddc4Srjs}
569296c5ddc4Srjs
569396c5ddc4Srjs
569496c5ddc4Srjs/* ClearNamedFramebufferiv: marshalled asynchronously */
569596c5ddc4Srjsstruct marshal_cmd_ClearNamedFramebufferiv
569696c5ddc4Srjs{
569796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
569896c5ddc4Srjs   GLuint framebuffer;
569996c5ddc4Srjs   GLenum buffer;
570096c5ddc4Srjs   GLint drawbuffer;
570196c5ddc4Srjs   /* Next safe_mul(_mesa_buffer_enum_to_count(buffer), 1 * sizeof(GLint)) bytes are GLint value[_mesa_buffer_enum_to_count(buffer)] */
570296c5ddc4Srjs};
570396c5ddc4Srjsuint32_t
570496c5ddc4Srjs_mesa_unmarshal_ClearNamedFramebufferiv(struct gl_context *ctx, const struct marshal_cmd_ClearNamedFramebufferiv *cmd, const uint64_t *last)
570596c5ddc4Srjs{
570696c5ddc4Srjs   GLuint framebuffer = cmd->framebuffer;
570796c5ddc4Srjs   GLenum buffer = cmd->buffer;
570896c5ddc4Srjs   GLint drawbuffer = cmd->drawbuffer;
570996c5ddc4Srjs   GLint * value;
571096c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
571196c5ddc4Srjs   value = (GLint *) variable_data;
571296c5ddc4Srjs   CALL_ClearNamedFramebufferiv(ctx->CurrentServerDispatch, (framebuffer, buffer, drawbuffer, value));
571396c5ddc4Srjs   return cmd->cmd_base.cmd_size;
571496c5ddc4Srjs}
571596c5ddc4Srjsvoid GLAPIENTRY
571696c5ddc4Srjs_mesa_marshal_ClearNamedFramebufferiv(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint * value)
571796c5ddc4Srjs{
571896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
571996c5ddc4Srjs   int value_size = safe_mul(_mesa_buffer_enum_to_count(buffer), 1 * sizeof(GLint));
572096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ClearNamedFramebufferiv) + value_size;
572196c5ddc4Srjs   struct marshal_cmd_ClearNamedFramebufferiv *cmd;
572296c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
572396c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ClearNamedFramebufferiv");
572496c5ddc4Srjs      CALL_ClearNamedFramebufferiv(ctx->CurrentServerDispatch, (framebuffer, buffer, drawbuffer, value));
572596c5ddc4Srjs      return;
572696c5ddc4Srjs   }
572796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearNamedFramebufferiv, cmd_size);
572896c5ddc4Srjs   cmd->framebuffer = framebuffer;
572996c5ddc4Srjs   cmd->buffer = buffer;
573096c5ddc4Srjs   cmd->drawbuffer = drawbuffer;
573196c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
573296c5ddc4Srjs   memcpy(variable_data, value, value_size);
573396c5ddc4Srjs}
573496c5ddc4Srjs
573596c5ddc4Srjs
573696c5ddc4Srjs/* ClearNamedFramebufferuiv: marshalled asynchronously */
573796c5ddc4Srjsstruct marshal_cmd_ClearNamedFramebufferuiv
573896c5ddc4Srjs{
573996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
574096c5ddc4Srjs   GLuint framebuffer;
574196c5ddc4Srjs   GLenum buffer;
574296c5ddc4Srjs   GLint drawbuffer;
574396c5ddc4Srjs   /* Next safe_mul(_mesa_buffer_enum_to_count(buffer), 1 * sizeof(GLuint)) bytes are GLuint value[_mesa_buffer_enum_to_count(buffer)] */
574496c5ddc4Srjs};
574596c5ddc4Srjsuint32_t
574696c5ddc4Srjs_mesa_unmarshal_ClearNamedFramebufferuiv(struct gl_context *ctx, const struct marshal_cmd_ClearNamedFramebufferuiv *cmd, const uint64_t *last)
574796c5ddc4Srjs{
574896c5ddc4Srjs   GLuint framebuffer = cmd->framebuffer;
574996c5ddc4Srjs   GLenum buffer = cmd->buffer;
575096c5ddc4Srjs   GLint drawbuffer = cmd->drawbuffer;
575196c5ddc4Srjs   GLuint * value;
575296c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
575396c5ddc4Srjs   value = (GLuint *) variable_data;
575496c5ddc4Srjs   CALL_ClearNamedFramebufferuiv(ctx->CurrentServerDispatch, (framebuffer, buffer, drawbuffer, value));
575596c5ddc4Srjs   return cmd->cmd_base.cmd_size;
575696c5ddc4Srjs}
575796c5ddc4Srjsvoid GLAPIENTRY
575896c5ddc4Srjs_mesa_marshal_ClearNamedFramebufferuiv(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint * value)
575996c5ddc4Srjs{
576096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
576196c5ddc4Srjs   int value_size = safe_mul(_mesa_buffer_enum_to_count(buffer), 1 * sizeof(GLuint));
576296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ClearNamedFramebufferuiv) + value_size;
576396c5ddc4Srjs   struct marshal_cmd_ClearNamedFramebufferuiv *cmd;
576496c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
576596c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ClearNamedFramebufferuiv");
576696c5ddc4Srjs      CALL_ClearNamedFramebufferuiv(ctx->CurrentServerDispatch, (framebuffer, buffer, drawbuffer, value));
576796c5ddc4Srjs      return;
576896c5ddc4Srjs   }
576996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearNamedFramebufferuiv, cmd_size);
577096c5ddc4Srjs   cmd->framebuffer = framebuffer;
577196c5ddc4Srjs   cmd->buffer = buffer;
577296c5ddc4Srjs   cmd->drawbuffer = drawbuffer;
577396c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
577496c5ddc4Srjs   memcpy(variable_data, value, value_size);
577596c5ddc4Srjs}
577696c5ddc4Srjs
577796c5ddc4Srjs
577896c5ddc4Srjs/* ClearNamedFramebufferfv: marshalled asynchronously */
577996c5ddc4Srjsstruct marshal_cmd_ClearNamedFramebufferfv
578096c5ddc4Srjs{
578196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
578296c5ddc4Srjs   GLuint framebuffer;
578396c5ddc4Srjs   GLenum buffer;
578496c5ddc4Srjs   GLint drawbuffer;
578596c5ddc4Srjs   /* Next safe_mul(_mesa_buffer_enum_to_count(buffer), 1 * sizeof(GLfloat)) bytes are GLfloat value[_mesa_buffer_enum_to_count(buffer)] */
578696c5ddc4Srjs};
578796c5ddc4Srjsuint32_t
578896c5ddc4Srjs_mesa_unmarshal_ClearNamedFramebufferfv(struct gl_context *ctx, const struct marshal_cmd_ClearNamedFramebufferfv *cmd, const uint64_t *last)
578996c5ddc4Srjs{
579096c5ddc4Srjs   GLuint framebuffer = cmd->framebuffer;
579196c5ddc4Srjs   GLenum buffer = cmd->buffer;
579296c5ddc4Srjs   GLint drawbuffer = cmd->drawbuffer;
579396c5ddc4Srjs   GLfloat * value;
579496c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
579596c5ddc4Srjs   value = (GLfloat *) variable_data;
579696c5ddc4Srjs   CALL_ClearNamedFramebufferfv(ctx->CurrentServerDispatch, (framebuffer, buffer, drawbuffer, value));
579796c5ddc4Srjs   return cmd->cmd_base.cmd_size;
579896c5ddc4Srjs}
579996c5ddc4Srjsvoid GLAPIENTRY
580096c5ddc4Srjs_mesa_marshal_ClearNamedFramebufferfv(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat * value)
580196c5ddc4Srjs{
580296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
580396c5ddc4Srjs   int value_size = safe_mul(_mesa_buffer_enum_to_count(buffer), 1 * sizeof(GLfloat));
580496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ClearNamedFramebufferfv) + value_size;
580596c5ddc4Srjs   struct marshal_cmd_ClearNamedFramebufferfv *cmd;
580696c5ddc4Srjs   if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
580796c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "ClearNamedFramebufferfv");
580896c5ddc4Srjs      CALL_ClearNamedFramebufferfv(ctx->CurrentServerDispatch, (framebuffer, buffer, drawbuffer, value));
580996c5ddc4Srjs      return;
581096c5ddc4Srjs   }
581196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearNamedFramebufferfv, cmd_size);
581296c5ddc4Srjs   cmd->framebuffer = framebuffer;
581396c5ddc4Srjs   cmd->buffer = buffer;
581496c5ddc4Srjs   cmd->drawbuffer = drawbuffer;
581596c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
581696c5ddc4Srjs   memcpy(variable_data, value, value_size);
581796c5ddc4Srjs}
581896c5ddc4Srjs
581996c5ddc4Srjs
582096c5ddc4Srjs/* ClearNamedFramebufferfi: marshalled asynchronously */
582196c5ddc4Srjsstruct marshal_cmd_ClearNamedFramebufferfi
582296c5ddc4Srjs{
582396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
582496c5ddc4Srjs   GLuint framebuffer;
582596c5ddc4Srjs   GLenum buffer;
582696c5ddc4Srjs   GLint drawbuffer;
582796c5ddc4Srjs   GLfloat depth;
582896c5ddc4Srjs   GLint stencil;
582996c5ddc4Srjs};
583096c5ddc4Srjsuint32_t
583196c5ddc4Srjs_mesa_unmarshal_ClearNamedFramebufferfi(struct gl_context *ctx, const struct marshal_cmd_ClearNamedFramebufferfi *cmd, const uint64_t *last)
583296c5ddc4Srjs{
583396c5ddc4Srjs   GLuint framebuffer = cmd->framebuffer;
583496c5ddc4Srjs   GLenum buffer = cmd->buffer;
583596c5ddc4Srjs   GLint drawbuffer = cmd->drawbuffer;
583696c5ddc4Srjs   GLfloat depth = cmd->depth;
583796c5ddc4Srjs   GLint stencil = cmd->stencil;
583896c5ddc4Srjs   CALL_ClearNamedFramebufferfi(ctx->CurrentServerDispatch, (framebuffer, buffer, drawbuffer, depth, stencil));
583996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ClearNamedFramebufferfi), 8) / 8);
584096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
584196c5ddc4Srjs   return cmd_size;
584296c5ddc4Srjs}
584396c5ddc4Srjsvoid GLAPIENTRY
584496c5ddc4Srjs_mesa_marshal_ClearNamedFramebufferfi(GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
584596c5ddc4Srjs{
584696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
584796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_ClearNamedFramebufferfi);
584896c5ddc4Srjs   struct marshal_cmd_ClearNamedFramebufferfi *cmd;
584996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearNamedFramebufferfi, cmd_size);
585096c5ddc4Srjs   cmd->framebuffer = framebuffer;
585196c5ddc4Srjs   cmd->buffer = buffer;
585296c5ddc4Srjs   cmd->drawbuffer = drawbuffer;
585396c5ddc4Srjs   cmd->depth = depth;
585496c5ddc4Srjs   cmd->stencil = stencil;
585596c5ddc4Srjs}
585696c5ddc4Srjs
585796c5ddc4Srjs
585896c5ddc4Srjs/* BlitNamedFramebuffer: marshalled asynchronously */
585996c5ddc4Srjsstruct marshal_cmd_BlitNamedFramebuffer
586096c5ddc4Srjs{
586196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
586296c5ddc4Srjs   GLuint readFramebuffer;
586396c5ddc4Srjs   GLuint drawFramebuffer;
586496c5ddc4Srjs   GLint srcX0;
586596c5ddc4Srjs   GLint srcY0;
586696c5ddc4Srjs   GLint srcX1;
586796c5ddc4Srjs   GLint srcY1;
586896c5ddc4Srjs   GLint dstX0;
586996c5ddc4Srjs   GLint dstY0;
587096c5ddc4Srjs   GLint dstX1;
587196c5ddc4Srjs   GLint dstY1;
587296c5ddc4Srjs   GLbitfield mask;
587396c5ddc4Srjs   GLenum filter;
587496c5ddc4Srjs};
587596c5ddc4Srjsuint32_t
587696c5ddc4Srjs_mesa_unmarshal_BlitNamedFramebuffer(struct gl_context *ctx, const struct marshal_cmd_BlitNamedFramebuffer *cmd, const uint64_t *last)
587796c5ddc4Srjs{
587896c5ddc4Srjs   GLuint readFramebuffer = cmd->readFramebuffer;
587996c5ddc4Srjs   GLuint drawFramebuffer = cmd->drawFramebuffer;
588096c5ddc4Srjs   GLint srcX0 = cmd->srcX0;
588196c5ddc4Srjs   GLint srcY0 = cmd->srcY0;
588296c5ddc4Srjs   GLint srcX1 = cmd->srcX1;
588396c5ddc4Srjs   GLint srcY1 = cmd->srcY1;
588496c5ddc4Srjs   GLint dstX0 = cmd->dstX0;
588596c5ddc4Srjs   GLint dstY0 = cmd->dstY0;
588696c5ddc4Srjs   GLint dstX1 = cmd->dstX1;
588796c5ddc4Srjs   GLint dstY1 = cmd->dstY1;
588896c5ddc4Srjs   GLbitfield mask = cmd->mask;
588996c5ddc4Srjs   GLenum filter = cmd->filter;
589096c5ddc4Srjs   CALL_BlitNamedFramebuffer(ctx->CurrentServerDispatch, (readFramebuffer, drawFramebuffer, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
589196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BlitNamedFramebuffer), 8) / 8);
589296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
589396c5ddc4Srjs   return cmd_size;
589496c5ddc4Srjs}
589596c5ddc4Srjsvoid GLAPIENTRY
589696c5ddc4Srjs_mesa_marshal_BlitNamedFramebuffer(GLuint readFramebuffer, GLuint drawFramebuffer, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
589796c5ddc4Srjs{
589896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
589996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BlitNamedFramebuffer);
590096c5ddc4Srjs   struct marshal_cmd_BlitNamedFramebuffer *cmd;
590196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlitNamedFramebuffer, cmd_size);
590296c5ddc4Srjs   cmd->readFramebuffer = readFramebuffer;
590396c5ddc4Srjs   cmd->drawFramebuffer = drawFramebuffer;
590496c5ddc4Srjs   cmd->srcX0 = srcX0;
590596c5ddc4Srjs   cmd->srcY0 = srcY0;
590696c5ddc4Srjs   cmd->srcX1 = srcX1;
590796c5ddc4Srjs   cmd->srcY1 = srcY1;
590896c5ddc4Srjs   cmd->dstX0 = dstX0;
590996c5ddc4Srjs   cmd->dstY0 = dstY0;
591096c5ddc4Srjs   cmd->dstX1 = dstX1;
591196c5ddc4Srjs   cmd->dstY1 = dstY1;
591296c5ddc4Srjs   cmd->mask = mask;
591396c5ddc4Srjs   cmd->filter = filter;
591496c5ddc4Srjs}
591596c5ddc4Srjs
591696c5ddc4Srjs
591796c5ddc4Srjs/* CheckNamedFramebufferStatus: marshalled synchronously */
591896c5ddc4SrjsGLenum GLAPIENTRY
591996c5ddc4Srjs_mesa_marshal_CheckNamedFramebufferStatus(GLuint framebuffer, GLenum target)
592096c5ddc4Srjs{
592196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
592296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CheckNamedFramebufferStatus");
592396c5ddc4Srjs   return CALL_CheckNamedFramebufferStatus(ctx->CurrentServerDispatch, (framebuffer, target));
592496c5ddc4Srjs}
592596c5ddc4Srjs
592696c5ddc4Srjs
592796c5ddc4Srjs/* GetNamedFramebufferParameteriv: marshalled synchronously */
592896c5ddc4Srjsvoid GLAPIENTRY
592996c5ddc4Srjs_mesa_marshal_GetNamedFramebufferParameteriv(GLuint framebuffer, GLenum pname, GLint * param)
593096c5ddc4Srjs{
593196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
593296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetNamedFramebufferParameteriv");
593396c5ddc4Srjs   CALL_GetNamedFramebufferParameteriv(ctx->CurrentServerDispatch, (framebuffer, pname, param));
593496c5ddc4Srjs}
593596c5ddc4Srjs
593696c5ddc4Srjs
593796c5ddc4Srjs/* GetNamedFramebufferAttachmentParameteriv: marshalled synchronously */
593896c5ddc4Srjsvoid GLAPIENTRY
593996c5ddc4Srjs_mesa_marshal_GetNamedFramebufferAttachmentParameteriv(GLuint framebuffer, GLenum attachment, GLenum pname, GLint * params)
594096c5ddc4Srjs{
594196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
594296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetNamedFramebufferAttachmentParameteriv");
594396c5ddc4Srjs   CALL_GetNamedFramebufferAttachmentParameteriv(ctx->CurrentServerDispatch, (framebuffer, attachment, pname, params));
594496c5ddc4Srjs}
594596c5ddc4Srjs
594696c5ddc4Srjs
594796c5ddc4Srjs/* CreateRenderbuffers: marshalled synchronously */
594896c5ddc4Srjsvoid GLAPIENTRY
594996c5ddc4Srjs_mesa_marshal_CreateRenderbuffers(GLsizei n, GLuint * renderbuffers)
595096c5ddc4Srjs{
595196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
595296c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CreateRenderbuffers");
595396c5ddc4Srjs   CALL_CreateRenderbuffers(ctx->CurrentServerDispatch, (n, renderbuffers));
595496c5ddc4Srjs}
595596c5ddc4Srjs
595696c5ddc4Srjs
595796c5ddc4Srjs/* NamedRenderbufferStorage: marshalled asynchronously */
595896c5ddc4Srjsstruct marshal_cmd_NamedRenderbufferStorage
595996c5ddc4Srjs{
596096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
596196c5ddc4Srjs   GLuint renderbuffer;
596296c5ddc4Srjs   GLenum internalformat;
596396c5ddc4Srjs   GLsizei width;
596496c5ddc4Srjs   GLsizei height;
596596c5ddc4Srjs};
596696c5ddc4Srjsuint32_t
596796c5ddc4Srjs_mesa_unmarshal_NamedRenderbufferStorage(struct gl_context *ctx, const struct marshal_cmd_NamedRenderbufferStorage *cmd, const uint64_t *last)
596896c5ddc4Srjs{
596996c5ddc4Srjs   GLuint renderbuffer = cmd->renderbuffer;
597096c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
597196c5ddc4Srjs   GLsizei width = cmd->width;
597296c5ddc4Srjs   GLsizei height = cmd->height;
597396c5ddc4Srjs   CALL_NamedRenderbufferStorage(ctx->CurrentServerDispatch, (renderbuffer, internalformat, width, height));
597496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedRenderbufferStorage), 8) / 8);
597596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
597696c5ddc4Srjs   return cmd_size;
597796c5ddc4Srjs}
597896c5ddc4Srjsvoid GLAPIENTRY
597996c5ddc4Srjs_mesa_marshal_NamedRenderbufferStorage(GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height)
598096c5ddc4Srjs{
598196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
598296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_NamedRenderbufferStorage);
598396c5ddc4Srjs   struct marshal_cmd_NamedRenderbufferStorage *cmd;
598496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedRenderbufferStorage, cmd_size);
598596c5ddc4Srjs   cmd->renderbuffer = renderbuffer;
598696c5ddc4Srjs   cmd->internalformat = internalformat;
598796c5ddc4Srjs   cmd->width = width;
598896c5ddc4Srjs   cmd->height = height;
598996c5ddc4Srjs}
599096c5ddc4Srjs
599196c5ddc4Srjs
599296c5ddc4Srjs/* NamedRenderbufferStorageMultisample: marshalled asynchronously */
599396c5ddc4Srjsstruct marshal_cmd_NamedRenderbufferStorageMultisample
599496c5ddc4Srjs{
599596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
599696c5ddc4Srjs   GLuint renderbuffer;
599796c5ddc4Srjs   GLsizei samples;
599896c5ddc4Srjs   GLenum internalformat;
599996c5ddc4Srjs   GLsizei width;
600096c5ddc4Srjs   GLsizei height;
600196c5ddc4Srjs};
600296c5ddc4Srjsuint32_t
600396c5ddc4Srjs_mesa_unmarshal_NamedRenderbufferStorageMultisample(struct gl_context *ctx, const struct marshal_cmd_NamedRenderbufferStorageMultisample *cmd, const uint64_t *last)
600496c5ddc4Srjs{
600596c5ddc4Srjs   GLuint renderbuffer = cmd->renderbuffer;
600696c5ddc4Srjs   GLsizei samples = cmd->samples;
600796c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
600896c5ddc4Srjs   GLsizei width = cmd->width;
600996c5ddc4Srjs   GLsizei height = cmd->height;
601096c5ddc4Srjs   CALL_NamedRenderbufferStorageMultisample(ctx->CurrentServerDispatch, (renderbuffer, samples, internalformat, width, height));
601196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedRenderbufferStorageMultisample), 8) / 8);
601296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
601396c5ddc4Srjs   return cmd_size;
601496c5ddc4Srjs}
601596c5ddc4Srjsvoid GLAPIENTRY
601696c5ddc4Srjs_mesa_marshal_NamedRenderbufferStorageMultisample(GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
601796c5ddc4Srjs{
601896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
601996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_NamedRenderbufferStorageMultisample);
602096c5ddc4Srjs   struct marshal_cmd_NamedRenderbufferStorageMultisample *cmd;
602196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedRenderbufferStorageMultisample, cmd_size);
602296c5ddc4Srjs   cmd->renderbuffer = renderbuffer;
602396c5ddc4Srjs   cmd->samples = samples;
602496c5ddc4Srjs   cmd->internalformat = internalformat;
602596c5ddc4Srjs   cmd->width = width;
602696c5ddc4Srjs   cmd->height = height;
602796c5ddc4Srjs}
602896c5ddc4Srjs
602996c5ddc4Srjs
603096c5ddc4Srjs/* GetNamedRenderbufferParameteriv: marshalled synchronously */
603196c5ddc4Srjsvoid GLAPIENTRY
603296c5ddc4Srjs_mesa_marshal_GetNamedRenderbufferParameteriv(GLuint renderbuffer, GLenum pname, GLint * params)
603396c5ddc4Srjs{
603496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
603596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetNamedRenderbufferParameteriv");
603696c5ddc4Srjs   CALL_GetNamedRenderbufferParameteriv(ctx->CurrentServerDispatch, (renderbuffer, pname, params));
603796c5ddc4Srjs}
603896c5ddc4Srjs
603996c5ddc4Srjs
604096c5ddc4Srjs/* CreateTextures: marshalled synchronously */
604196c5ddc4Srjsvoid GLAPIENTRY
604296c5ddc4Srjs_mesa_marshal_CreateTextures(GLenum target, GLsizei n, GLuint * textures)
604396c5ddc4Srjs{
604496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
604596c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CreateTextures");
604696c5ddc4Srjs   CALL_CreateTextures(ctx->CurrentServerDispatch, (target, n, textures));
604796c5ddc4Srjs}
604896c5ddc4Srjs
604996c5ddc4Srjs
605096c5ddc4Srjs/* TextureBuffer: marshalled asynchronously */
605196c5ddc4Srjsstruct marshal_cmd_TextureBuffer
605296c5ddc4Srjs{
605396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
605496c5ddc4Srjs   GLuint texture;
605596c5ddc4Srjs   GLenum internalformat;
605696c5ddc4Srjs   GLuint buffer;
605796c5ddc4Srjs};
605896c5ddc4Srjsuint32_t
605996c5ddc4Srjs_mesa_unmarshal_TextureBuffer(struct gl_context *ctx, const struct marshal_cmd_TextureBuffer *cmd, const uint64_t *last)
606096c5ddc4Srjs{
606196c5ddc4Srjs   GLuint texture = cmd->texture;
606296c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
606396c5ddc4Srjs   GLuint buffer = cmd->buffer;
606496c5ddc4Srjs   CALL_TextureBuffer(ctx->CurrentServerDispatch, (texture, internalformat, buffer));
606596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureBuffer), 8) / 8);
606696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
606796c5ddc4Srjs   return cmd_size;
606896c5ddc4Srjs}
606996c5ddc4Srjsvoid GLAPIENTRY
607096c5ddc4Srjs_mesa_marshal_TextureBuffer(GLuint texture, GLenum internalformat, GLuint buffer)
607196c5ddc4Srjs{
607296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
607396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureBuffer);
607496c5ddc4Srjs   struct marshal_cmd_TextureBuffer *cmd;
607596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureBuffer, cmd_size);
607696c5ddc4Srjs   cmd->texture = texture;
607796c5ddc4Srjs   cmd->internalformat = internalformat;
607896c5ddc4Srjs   cmd->buffer = buffer;
607996c5ddc4Srjs}
608096c5ddc4Srjs
608196c5ddc4Srjs
608296c5ddc4Srjs/* TextureBufferRange: marshalled asynchronously */
608396c5ddc4Srjsstruct marshal_cmd_TextureBufferRange
608496c5ddc4Srjs{
608596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
608696c5ddc4Srjs   GLuint texture;
608796c5ddc4Srjs   GLenum internalformat;
608896c5ddc4Srjs   GLuint buffer;
608996c5ddc4Srjs   GLintptr offset;
609096c5ddc4Srjs   GLsizeiptr size;
609196c5ddc4Srjs};
609296c5ddc4Srjsuint32_t
609396c5ddc4Srjs_mesa_unmarshal_TextureBufferRange(struct gl_context *ctx, const struct marshal_cmd_TextureBufferRange *cmd, const uint64_t *last)
609496c5ddc4Srjs{
609596c5ddc4Srjs   GLuint texture = cmd->texture;
609696c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
609796c5ddc4Srjs   GLuint buffer = cmd->buffer;
609896c5ddc4Srjs   GLintptr offset = cmd->offset;
609996c5ddc4Srjs   GLsizeiptr size = cmd->size;
610096c5ddc4Srjs   CALL_TextureBufferRange(ctx->CurrentServerDispatch, (texture, internalformat, buffer, offset, size));
610196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureBufferRange), 8) / 8);
610296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
610396c5ddc4Srjs   return cmd_size;
610496c5ddc4Srjs}
610596c5ddc4Srjsvoid GLAPIENTRY
610696c5ddc4Srjs_mesa_marshal_TextureBufferRange(GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size)
610796c5ddc4Srjs{
610896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
610996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureBufferRange);
611096c5ddc4Srjs   struct marshal_cmd_TextureBufferRange *cmd;
611196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureBufferRange, cmd_size);
611296c5ddc4Srjs   cmd->texture = texture;
611396c5ddc4Srjs   cmd->internalformat = internalformat;
611496c5ddc4Srjs   cmd->buffer = buffer;
611596c5ddc4Srjs   cmd->offset = offset;
611696c5ddc4Srjs   cmd->size = size;
611796c5ddc4Srjs}
611896c5ddc4Srjs
611996c5ddc4Srjs
612096c5ddc4Srjs/* TextureStorage1D: marshalled asynchronously */
612196c5ddc4Srjsstruct marshal_cmd_TextureStorage1D
612296c5ddc4Srjs{
612396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
612496c5ddc4Srjs   GLuint texture;
612596c5ddc4Srjs   GLsizei levels;
612696c5ddc4Srjs   GLenum internalformat;
612796c5ddc4Srjs   GLsizei width;
612896c5ddc4Srjs};
612996c5ddc4Srjsuint32_t
613096c5ddc4Srjs_mesa_unmarshal_TextureStorage1D(struct gl_context *ctx, const struct marshal_cmd_TextureStorage1D *cmd, const uint64_t *last)
613196c5ddc4Srjs{
613296c5ddc4Srjs   GLuint texture = cmd->texture;
613396c5ddc4Srjs   GLsizei levels = cmd->levels;
613496c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
613596c5ddc4Srjs   GLsizei width = cmd->width;
613696c5ddc4Srjs   CALL_TextureStorage1D(ctx->CurrentServerDispatch, (texture, levels, internalformat, width));
613796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureStorage1D), 8) / 8);
613896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
613996c5ddc4Srjs   return cmd_size;
614096c5ddc4Srjs}
614196c5ddc4Srjsvoid GLAPIENTRY
614296c5ddc4Srjs_mesa_marshal_TextureStorage1D(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width)
614396c5ddc4Srjs{
614496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
614596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureStorage1D);
614696c5ddc4Srjs   struct marshal_cmd_TextureStorage1D *cmd;
614796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage1D, cmd_size);
614896c5ddc4Srjs   cmd->texture = texture;
614996c5ddc4Srjs   cmd->levels = levels;
615096c5ddc4Srjs   cmd->internalformat = internalformat;
615196c5ddc4Srjs   cmd->width = width;
615296c5ddc4Srjs}
615396c5ddc4Srjs
615496c5ddc4Srjs
615596c5ddc4Srjs/* TextureStorage2D: marshalled asynchronously */
615696c5ddc4Srjsstruct marshal_cmd_TextureStorage2D
615796c5ddc4Srjs{
615896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
615996c5ddc4Srjs   GLuint texture;
616096c5ddc4Srjs   GLsizei levels;
616196c5ddc4Srjs   GLenum internalformat;
616296c5ddc4Srjs   GLsizei width;
616396c5ddc4Srjs   GLsizei height;
616496c5ddc4Srjs};
616596c5ddc4Srjsuint32_t
616696c5ddc4Srjs_mesa_unmarshal_TextureStorage2D(struct gl_context *ctx, const struct marshal_cmd_TextureStorage2D *cmd, const uint64_t *last)
616796c5ddc4Srjs{
616896c5ddc4Srjs   GLuint texture = cmd->texture;
616996c5ddc4Srjs   GLsizei levels = cmd->levels;
617096c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
617196c5ddc4Srjs   GLsizei width = cmd->width;
617296c5ddc4Srjs   GLsizei height = cmd->height;
617396c5ddc4Srjs   CALL_TextureStorage2D(ctx->CurrentServerDispatch, (texture, levels, internalformat, width, height));
617496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureStorage2D), 8) / 8);
617596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
617696c5ddc4Srjs   return cmd_size;
617796c5ddc4Srjs}
617896c5ddc4Srjsvoid GLAPIENTRY
617996c5ddc4Srjs_mesa_marshal_TextureStorage2D(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
618096c5ddc4Srjs{
618196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
618296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureStorage2D);
618396c5ddc4Srjs   struct marshal_cmd_TextureStorage2D *cmd;
618496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage2D, cmd_size);
618596c5ddc4Srjs   cmd->texture = texture;
618696c5ddc4Srjs   cmd->levels = levels;
618796c5ddc4Srjs   cmd->internalformat = internalformat;
618896c5ddc4Srjs   cmd->width = width;
618996c5ddc4Srjs   cmd->height = height;
619096c5ddc4Srjs}
619196c5ddc4Srjs
619296c5ddc4Srjs
619396c5ddc4Srjs/* TextureStorage3D: marshalled asynchronously */
619496c5ddc4Srjsstruct marshal_cmd_TextureStorage3D
619596c5ddc4Srjs{
619696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
619796c5ddc4Srjs   GLuint texture;
619896c5ddc4Srjs   GLsizei levels;
619996c5ddc4Srjs   GLenum internalformat;
620096c5ddc4Srjs   GLsizei width;
620196c5ddc4Srjs   GLsizei height;
620296c5ddc4Srjs   GLsizei depth;
620396c5ddc4Srjs};
620496c5ddc4Srjsuint32_t
620596c5ddc4Srjs_mesa_unmarshal_TextureStorage3D(struct gl_context *ctx, const struct marshal_cmd_TextureStorage3D *cmd, const uint64_t *last)
620696c5ddc4Srjs{
620796c5ddc4Srjs   GLuint texture = cmd->texture;
620896c5ddc4Srjs   GLsizei levels = cmd->levels;
620996c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
621096c5ddc4Srjs   GLsizei width = cmd->width;
621196c5ddc4Srjs   GLsizei height = cmd->height;
621296c5ddc4Srjs   GLsizei depth = cmd->depth;
621396c5ddc4Srjs   CALL_TextureStorage3D(ctx->CurrentServerDispatch, (texture, levels, internalformat, width, height, depth));
621496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureStorage3D), 8) / 8);
621596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
621696c5ddc4Srjs   return cmd_size;
621796c5ddc4Srjs}
621896c5ddc4Srjsvoid GLAPIENTRY
621996c5ddc4Srjs_mesa_marshal_TextureStorage3D(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
622096c5ddc4Srjs{
622196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
622296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureStorage3D);
622396c5ddc4Srjs   struct marshal_cmd_TextureStorage3D *cmd;
622496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage3D, cmd_size);
622596c5ddc4Srjs   cmd->texture = texture;
622696c5ddc4Srjs   cmd->levels = levels;
622796c5ddc4Srjs   cmd->internalformat = internalformat;
622896c5ddc4Srjs   cmd->width = width;
622996c5ddc4Srjs   cmd->height = height;
623096c5ddc4Srjs   cmd->depth = depth;
623196c5ddc4Srjs}
623296c5ddc4Srjs
623396c5ddc4Srjs
623496c5ddc4Srjs/* TextureStorage2DMultisample: marshalled asynchronously */
623596c5ddc4Srjsstruct marshal_cmd_TextureStorage2DMultisample
623696c5ddc4Srjs{
623796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
623896c5ddc4Srjs   GLboolean fixedsamplelocations;
623996c5ddc4Srjs   GLuint texture;
624096c5ddc4Srjs   GLsizei samples;
624196c5ddc4Srjs   GLenum internalformat;
624296c5ddc4Srjs   GLsizei width;
624396c5ddc4Srjs   GLsizei height;
624496c5ddc4Srjs};
624596c5ddc4Srjsuint32_t
624696c5ddc4Srjs_mesa_unmarshal_TextureStorage2DMultisample(struct gl_context *ctx, const struct marshal_cmd_TextureStorage2DMultisample *cmd, const uint64_t *last)
624796c5ddc4Srjs{
624896c5ddc4Srjs   GLuint texture = cmd->texture;
624996c5ddc4Srjs   GLsizei samples = cmd->samples;
625096c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
625196c5ddc4Srjs   GLsizei width = cmd->width;
625296c5ddc4Srjs   GLsizei height = cmd->height;
625396c5ddc4Srjs   GLboolean fixedsamplelocations = cmd->fixedsamplelocations;
625496c5ddc4Srjs   CALL_TextureStorage2DMultisample(ctx->CurrentServerDispatch, (texture, samples, internalformat, width, height, fixedsamplelocations));
625596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureStorage2DMultisample), 8) / 8);
625696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
625796c5ddc4Srjs   return cmd_size;
625896c5ddc4Srjs}
625996c5ddc4Srjsvoid GLAPIENTRY
626096c5ddc4Srjs_mesa_marshal_TextureStorage2DMultisample(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
626196c5ddc4Srjs{
626296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
626396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureStorage2DMultisample);
626496c5ddc4Srjs   struct marshal_cmd_TextureStorage2DMultisample *cmd;
626596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage2DMultisample, cmd_size);
626696c5ddc4Srjs   cmd->texture = texture;
626796c5ddc4Srjs   cmd->samples = samples;
626896c5ddc4Srjs   cmd->internalformat = internalformat;
626996c5ddc4Srjs   cmd->width = width;
627096c5ddc4Srjs   cmd->height = height;
627196c5ddc4Srjs   cmd->fixedsamplelocations = fixedsamplelocations;
627296c5ddc4Srjs}
627396c5ddc4Srjs
627496c5ddc4Srjs
627596c5ddc4Srjs/* TextureStorage3DMultisample: marshalled asynchronously */
627696c5ddc4Srjsstruct marshal_cmd_TextureStorage3DMultisample
627796c5ddc4Srjs{
627896c5ddc4Srjs   struct marshal_cmd_base cmd_base;
627996c5ddc4Srjs   GLboolean fixedsamplelocations;
628096c5ddc4Srjs   GLuint texture;
628196c5ddc4Srjs   GLsizei samples;
628296c5ddc4Srjs   GLenum internalformat;
628396c5ddc4Srjs   GLsizei width;
628496c5ddc4Srjs   GLsizei height;
628596c5ddc4Srjs   GLsizei depth;
628696c5ddc4Srjs};
628796c5ddc4Srjsuint32_t
628896c5ddc4Srjs_mesa_unmarshal_TextureStorage3DMultisample(struct gl_context *ctx, const struct marshal_cmd_TextureStorage3DMultisample *cmd, const uint64_t *last)
628996c5ddc4Srjs{
629096c5ddc4Srjs   GLuint texture = cmd->texture;
629196c5ddc4Srjs   GLsizei samples = cmd->samples;
629296c5ddc4Srjs   GLenum internalformat = cmd->internalformat;
629396c5ddc4Srjs   GLsizei width = cmd->width;
629496c5ddc4Srjs   GLsizei height = cmd->height;
629596c5ddc4Srjs   GLsizei depth = cmd->depth;
629696c5ddc4Srjs   GLboolean fixedsamplelocations = cmd->fixedsamplelocations;
629796c5ddc4Srjs   CALL_TextureStorage3DMultisample(ctx->CurrentServerDispatch, (texture, samples, internalformat, width, height, depth, fixedsamplelocations));
629896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureStorage3DMultisample), 8) / 8);
629996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
630096c5ddc4Srjs   return cmd_size;
630196c5ddc4Srjs}
630296c5ddc4Srjsvoid GLAPIENTRY
630396c5ddc4Srjs_mesa_marshal_TextureStorage3DMultisample(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)
630496c5ddc4Srjs{
630596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
630696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureStorage3DMultisample);
630796c5ddc4Srjs   struct marshal_cmd_TextureStorage3DMultisample *cmd;
630896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage3DMultisample, cmd_size);
630996c5ddc4Srjs   cmd->texture = texture;
631096c5ddc4Srjs   cmd->samples = samples;
631196c5ddc4Srjs   cmd->internalformat = internalformat;
631296c5ddc4Srjs   cmd->width = width;
631396c5ddc4Srjs   cmd->height = height;
631496c5ddc4Srjs   cmd->depth = depth;
631596c5ddc4Srjs   cmd->fixedsamplelocations = fixedsamplelocations;
631696c5ddc4Srjs}
631796c5ddc4Srjs
631896c5ddc4Srjs
631996c5ddc4Srjs/* TextureSubImage1D: marshalled asynchronously */
632096c5ddc4Srjsstruct marshal_cmd_TextureSubImage1D
632196c5ddc4Srjs{
632296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
632396c5ddc4Srjs   GLuint texture;
632496c5ddc4Srjs   GLint level;
632596c5ddc4Srjs   GLint xoffset;
632696c5ddc4Srjs   GLsizei width;
632796c5ddc4Srjs   GLenum format;
632896c5ddc4Srjs   GLenum type;
632996c5ddc4Srjs   const GLvoid * pixels;
633096c5ddc4Srjs};
633196c5ddc4Srjsuint32_t
633296c5ddc4Srjs_mesa_unmarshal_TextureSubImage1D(struct gl_context *ctx, const struct marshal_cmd_TextureSubImage1D *cmd, const uint64_t *last)
633396c5ddc4Srjs{
633496c5ddc4Srjs   GLuint texture = cmd->texture;
633596c5ddc4Srjs   GLint level = cmd->level;
633696c5ddc4Srjs   GLint xoffset = cmd->xoffset;
633796c5ddc4Srjs   GLsizei width = cmd->width;
633896c5ddc4Srjs   GLenum format = cmd->format;
633996c5ddc4Srjs   GLenum type = cmd->type;
634096c5ddc4Srjs   const GLvoid * pixels = cmd->pixels;
634196c5ddc4Srjs   CALL_TextureSubImage1D(ctx->CurrentServerDispatch, (texture, level, xoffset, width, format, type, pixels));
634296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureSubImage1D), 8) / 8);
634396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
634496c5ddc4Srjs   return cmd_size;
634596c5ddc4Srjs}
634696c5ddc4Srjsvoid GLAPIENTRY
634796c5ddc4Srjs_mesa_marshal_TextureSubImage1D(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels)
634896c5ddc4Srjs{
634996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
635096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureSubImage1D);
635196c5ddc4Srjs   struct marshal_cmd_TextureSubImage1D *cmd;
635296c5ddc4Srjs   if (_mesa_glthread_has_no_unpack_buffer(ctx)) {
635396c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "TextureSubImage1D");
635496c5ddc4Srjs      CALL_TextureSubImage1D(ctx->CurrentServerDispatch, (texture, level, xoffset, width, format, type, pixels));
635596c5ddc4Srjs      return;
635696c5ddc4Srjs   }
635796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureSubImage1D, cmd_size);
635896c5ddc4Srjs   cmd->texture = texture;
635996c5ddc4Srjs   cmd->level = level;
636096c5ddc4Srjs   cmd->xoffset = xoffset;
636196c5ddc4Srjs   cmd->width = width;
636296c5ddc4Srjs   cmd->format = format;
636396c5ddc4Srjs   cmd->type = type;
636496c5ddc4Srjs   cmd->pixels = pixels;
636596c5ddc4Srjs}
636696c5ddc4Srjs
636796c5ddc4Srjs
636896c5ddc4Srjs/* TextureSubImage2D: marshalled asynchronously */
636996c5ddc4Srjsstruct marshal_cmd_TextureSubImage2D
637096c5ddc4Srjs{
637196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
637296c5ddc4Srjs   GLuint texture;
637396c5ddc4Srjs   GLint level;
637496c5ddc4Srjs   GLint xoffset;
637596c5ddc4Srjs   GLint yoffset;
637696c5ddc4Srjs   GLsizei width;
637796c5ddc4Srjs   GLsizei height;
637896c5ddc4Srjs   GLenum format;
637996c5ddc4Srjs   GLenum type;
638096c5ddc4Srjs   const GLvoid * pixels;
638196c5ddc4Srjs};
638296c5ddc4Srjsuint32_t
638396c5ddc4Srjs_mesa_unmarshal_TextureSubImage2D(struct gl_context *ctx, const struct marshal_cmd_TextureSubImage2D *cmd, const uint64_t *last)
638496c5ddc4Srjs{
638596c5ddc4Srjs   GLuint texture = cmd->texture;
638696c5ddc4Srjs   GLint level = cmd->level;
638796c5ddc4Srjs   GLint xoffset = cmd->xoffset;
638896c5ddc4Srjs   GLint yoffset = cmd->yoffset;
638996c5ddc4Srjs   GLsizei width = cmd->width;
639096c5ddc4Srjs   GLsizei height = cmd->height;
639196c5ddc4Srjs   GLenum format = cmd->format;
639296c5ddc4Srjs   GLenum type = cmd->type;
639396c5ddc4Srjs   const GLvoid * pixels = cmd->pixels;
639496c5ddc4Srjs   CALL_TextureSubImage2D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, width, height, format, type, pixels));
639596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureSubImage2D), 8) / 8);
639696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
639796c5ddc4Srjs   return cmd_size;
639896c5ddc4Srjs}
639996c5ddc4Srjsvoid GLAPIENTRY
640096c5ddc4Srjs_mesa_marshal_TextureSubImage2D(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
640196c5ddc4Srjs{
640296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
640396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureSubImage2D);
640496c5ddc4Srjs   struct marshal_cmd_TextureSubImage2D *cmd;
640596c5ddc4Srjs   if (_mesa_glthread_has_no_unpack_buffer(ctx)) {
640696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "TextureSubImage2D");
640796c5ddc4Srjs      CALL_TextureSubImage2D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, width, height, format, type, pixels));
640896c5ddc4Srjs      return;
640996c5ddc4Srjs   }
641096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureSubImage2D, cmd_size);
641196c5ddc4Srjs   cmd->texture = texture;
641296c5ddc4Srjs   cmd->level = level;
641396c5ddc4Srjs   cmd->xoffset = xoffset;
641496c5ddc4Srjs   cmd->yoffset = yoffset;
641596c5ddc4Srjs   cmd->width = width;
641696c5ddc4Srjs   cmd->height = height;
641796c5ddc4Srjs   cmd->format = format;
641896c5ddc4Srjs   cmd->type = type;
641996c5ddc4Srjs   cmd->pixels = pixels;
642096c5ddc4Srjs}
642196c5ddc4Srjs
642296c5ddc4Srjs
642396c5ddc4Srjs/* TextureSubImage3D: marshalled asynchronously */
642496c5ddc4Srjsstruct marshal_cmd_TextureSubImage3D
642596c5ddc4Srjs{
642696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
642796c5ddc4Srjs   GLuint texture;
642896c5ddc4Srjs   GLint level;
642996c5ddc4Srjs   GLint xoffset;
643096c5ddc4Srjs   GLint yoffset;
643196c5ddc4Srjs   GLint zoffset;
643296c5ddc4Srjs   GLsizei width;
643396c5ddc4Srjs   GLsizei height;
643496c5ddc4Srjs   GLsizei depth;
643596c5ddc4Srjs   GLenum format;
643696c5ddc4Srjs   GLenum type;
643796c5ddc4Srjs   const GLvoid * pixels;
643896c5ddc4Srjs};
643996c5ddc4Srjsuint32_t
644096c5ddc4Srjs_mesa_unmarshal_TextureSubImage3D(struct gl_context *ctx, const struct marshal_cmd_TextureSubImage3D *cmd, const uint64_t *last)
644196c5ddc4Srjs{
644296c5ddc4Srjs   GLuint texture = cmd->texture;
644396c5ddc4Srjs   GLint level = cmd->level;
644496c5ddc4Srjs   GLint xoffset = cmd->xoffset;
644596c5ddc4Srjs   GLint yoffset = cmd->yoffset;
644696c5ddc4Srjs   GLint zoffset = cmd->zoffset;
644796c5ddc4Srjs   GLsizei width = cmd->width;
644896c5ddc4Srjs   GLsizei height = cmd->height;
644996c5ddc4Srjs   GLsizei depth = cmd->depth;
645096c5ddc4Srjs   GLenum format = cmd->format;
645196c5ddc4Srjs   GLenum type = cmd->type;
645296c5ddc4Srjs   const GLvoid * pixels = cmd->pixels;
645396c5ddc4Srjs   CALL_TextureSubImage3D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels));
645496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureSubImage3D), 8) / 8);
645596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
645696c5ddc4Srjs   return cmd_size;
645796c5ddc4Srjs}
645896c5ddc4Srjsvoid GLAPIENTRY
645996c5ddc4Srjs_mesa_marshal_TextureSubImage3D(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels)
646096c5ddc4Srjs{
646196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
646296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureSubImage3D);
646396c5ddc4Srjs   struct marshal_cmd_TextureSubImage3D *cmd;
646496c5ddc4Srjs   if (_mesa_glthread_has_no_unpack_buffer(ctx)) {
646596c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "TextureSubImage3D");
646696c5ddc4Srjs      CALL_TextureSubImage3D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels));
646796c5ddc4Srjs      return;
646896c5ddc4Srjs   }
646996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureSubImage3D, cmd_size);
647096c5ddc4Srjs   cmd->texture = texture;
647196c5ddc4Srjs   cmd->level = level;
647296c5ddc4Srjs   cmd->xoffset = xoffset;
647396c5ddc4Srjs   cmd->yoffset = yoffset;
647496c5ddc4Srjs   cmd->zoffset = zoffset;
647596c5ddc4Srjs   cmd->width = width;
647696c5ddc4Srjs   cmd->height = height;
647796c5ddc4Srjs   cmd->depth = depth;
647896c5ddc4Srjs   cmd->format = format;
647996c5ddc4Srjs   cmd->type = type;
648096c5ddc4Srjs   cmd->pixels = pixels;
648196c5ddc4Srjs}
648296c5ddc4Srjs
648396c5ddc4Srjs
648496c5ddc4Srjs/* CompressedTextureSubImage1D: marshalled asynchronously */
648596c5ddc4Srjsstruct marshal_cmd_CompressedTextureSubImage1D
648696c5ddc4Srjs{
648796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
648896c5ddc4Srjs   GLuint texture;
648996c5ddc4Srjs   GLint level;
649096c5ddc4Srjs   GLint xoffset;
649196c5ddc4Srjs   GLsizei width;
649296c5ddc4Srjs   GLenum format;
649396c5ddc4Srjs   GLsizei imageSize;
649496c5ddc4Srjs   const GLvoid * data;
649596c5ddc4Srjs};
649696c5ddc4Srjsuint32_t
649796c5ddc4Srjs_mesa_unmarshal_CompressedTextureSubImage1D(struct gl_context *ctx, const struct marshal_cmd_CompressedTextureSubImage1D *cmd, const uint64_t *last)
649896c5ddc4Srjs{
649996c5ddc4Srjs   GLuint texture = cmd->texture;
650096c5ddc4Srjs   GLint level = cmd->level;
650196c5ddc4Srjs   GLint xoffset = cmd->xoffset;
650296c5ddc4Srjs   GLsizei width = cmd->width;
650396c5ddc4Srjs   GLenum format = cmd->format;
650496c5ddc4Srjs   GLsizei imageSize = cmd->imageSize;
650596c5ddc4Srjs   const GLvoid * data = cmd->data;
650696c5ddc4Srjs   CALL_CompressedTextureSubImage1D(ctx->CurrentServerDispatch, (texture, level, xoffset, width, format, imageSize, data));
650796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CompressedTextureSubImage1D), 8) / 8);
650896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
650996c5ddc4Srjs   return cmd_size;
651096c5ddc4Srjs}
651196c5ddc4Srjsvoid GLAPIENTRY
651296c5ddc4Srjs_mesa_marshal_CompressedTextureSubImage1D(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data)
651396c5ddc4Srjs{
651496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
651596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CompressedTextureSubImage1D);
651696c5ddc4Srjs   struct marshal_cmd_CompressedTextureSubImage1D *cmd;
651796c5ddc4Srjs   if (_mesa_glthread_has_no_unpack_buffer(ctx)) {
651896c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "CompressedTextureSubImage1D");
651996c5ddc4Srjs      CALL_CompressedTextureSubImage1D(ctx->CurrentServerDispatch, (texture, level, xoffset, width, format, imageSize, data));
652096c5ddc4Srjs      return;
652196c5ddc4Srjs   }
652296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CompressedTextureSubImage1D, cmd_size);
652396c5ddc4Srjs   cmd->texture = texture;
652496c5ddc4Srjs   cmd->level = level;
652596c5ddc4Srjs   cmd->xoffset = xoffset;
652696c5ddc4Srjs   cmd->width = width;
652796c5ddc4Srjs   cmd->format = format;
652896c5ddc4Srjs   cmd->imageSize = imageSize;
652996c5ddc4Srjs   cmd->data = data;
653096c5ddc4Srjs}
653196c5ddc4Srjs
653296c5ddc4Srjs
653396c5ddc4Srjs/* CompressedTextureSubImage2D: marshalled asynchronously */
653496c5ddc4Srjsstruct marshal_cmd_CompressedTextureSubImage2D
653596c5ddc4Srjs{
653696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
653796c5ddc4Srjs   GLuint texture;
653896c5ddc4Srjs   GLint level;
653996c5ddc4Srjs   GLint xoffset;
654096c5ddc4Srjs   GLint yoffset;
654196c5ddc4Srjs   GLsizei width;
654296c5ddc4Srjs   GLsizei height;
654396c5ddc4Srjs   GLenum format;
654496c5ddc4Srjs   GLsizei imageSize;
654596c5ddc4Srjs   const GLvoid * data;
654696c5ddc4Srjs};
654796c5ddc4Srjsuint32_t
654896c5ddc4Srjs_mesa_unmarshal_CompressedTextureSubImage2D(struct gl_context *ctx, const struct marshal_cmd_CompressedTextureSubImage2D *cmd, const uint64_t *last)
654996c5ddc4Srjs{
655096c5ddc4Srjs   GLuint texture = cmd->texture;
655196c5ddc4Srjs   GLint level = cmd->level;
655296c5ddc4Srjs   GLint xoffset = cmd->xoffset;
655396c5ddc4Srjs   GLint yoffset = cmd->yoffset;
655496c5ddc4Srjs   GLsizei width = cmd->width;
655596c5ddc4Srjs   GLsizei height = cmd->height;
655696c5ddc4Srjs   GLenum format = cmd->format;
655796c5ddc4Srjs   GLsizei imageSize = cmd->imageSize;
655896c5ddc4Srjs   const GLvoid * data = cmd->data;
655996c5ddc4Srjs   CALL_CompressedTextureSubImage2D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, width, height, format, imageSize, data));
656096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CompressedTextureSubImage2D), 8) / 8);
656196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
656296c5ddc4Srjs   return cmd_size;
656396c5ddc4Srjs}
656496c5ddc4Srjsvoid GLAPIENTRY
656596c5ddc4Srjs_mesa_marshal_CompressedTextureSubImage2D(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data)
656696c5ddc4Srjs{
656796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
656896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CompressedTextureSubImage2D);
656996c5ddc4Srjs   struct marshal_cmd_CompressedTextureSubImage2D *cmd;
657096c5ddc4Srjs   if (_mesa_glthread_has_no_unpack_buffer(ctx)) {
657196c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "CompressedTextureSubImage2D");
657296c5ddc4Srjs      CALL_CompressedTextureSubImage2D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, width, height, format, imageSize, data));
657396c5ddc4Srjs      return;
657496c5ddc4Srjs   }
657596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CompressedTextureSubImage2D, cmd_size);
657696c5ddc4Srjs   cmd->texture = texture;
657796c5ddc4Srjs   cmd->level = level;
657896c5ddc4Srjs   cmd->xoffset = xoffset;
657996c5ddc4Srjs   cmd->yoffset = yoffset;
658096c5ddc4Srjs   cmd->width = width;
658196c5ddc4Srjs   cmd->height = height;
658296c5ddc4Srjs   cmd->format = format;
658396c5ddc4Srjs   cmd->imageSize = imageSize;
658496c5ddc4Srjs   cmd->data = data;
658596c5ddc4Srjs}
658696c5ddc4Srjs
658796c5ddc4Srjs
658896c5ddc4Srjs/* CompressedTextureSubImage3D: marshalled asynchronously */
658996c5ddc4Srjsstruct marshal_cmd_CompressedTextureSubImage3D
659096c5ddc4Srjs{
659196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
659296c5ddc4Srjs   GLuint texture;
659396c5ddc4Srjs   GLint level;
659496c5ddc4Srjs   GLint xoffset;
659596c5ddc4Srjs   GLint yoffset;
659696c5ddc4Srjs   GLint zoffset;
659796c5ddc4Srjs   GLsizei width;
659896c5ddc4Srjs   GLsizei height;
659996c5ddc4Srjs   GLsizei depth;
660096c5ddc4Srjs   GLenum format;
660196c5ddc4Srjs   GLsizei imageSize;
660296c5ddc4Srjs   const GLvoid * data;
660396c5ddc4Srjs};
660496c5ddc4Srjsuint32_t
660596c5ddc4Srjs_mesa_unmarshal_CompressedTextureSubImage3D(struct gl_context *ctx, const struct marshal_cmd_CompressedTextureSubImage3D *cmd, const uint64_t *last)
660696c5ddc4Srjs{
660796c5ddc4Srjs   GLuint texture = cmd->texture;
660896c5ddc4Srjs   GLint level = cmd->level;
660996c5ddc4Srjs   GLint xoffset = cmd->xoffset;
661096c5ddc4Srjs   GLint yoffset = cmd->yoffset;
661196c5ddc4Srjs   GLint zoffset = cmd->zoffset;
661296c5ddc4Srjs   GLsizei width = cmd->width;
661396c5ddc4Srjs   GLsizei height = cmd->height;
661496c5ddc4Srjs   GLsizei depth = cmd->depth;
661596c5ddc4Srjs   GLenum format = cmd->format;
661696c5ddc4Srjs   GLsizei imageSize = cmd->imageSize;
661796c5ddc4Srjs   const GLvoid * data = cmd->data;
661896c5ddc4Srjs   CALL_CompressedTextureSubImage3D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data));
661996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CompressedTextureSubImage3D), 8) / 8);
662096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
662196c5ddc4Srjs   return cmd_size;
662296c5ddc4Srjs}
662396c5ddc4Srjsvoid GLAPIENTRY
662496c5ddc4Srjs_mesa_marshal_CompressedTextureSubImage3D(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data)
662596c5ddc4Srjs{
662696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
662796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CompressedTextureSubImage3D);
662896c5ddc4Srjs   struct marshal_cmd_CompressedTextureSubImage3D *cmd;
662996c5ddc4Srjs   if (_mesa_glthread_has_no_unpack_buffer(ctx)) {
663096c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "CompressedTextureSubImage3D");
663196c5ddc4Srjs      CALL_CompressedTextureSubImage3D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data));
663296c5ddc4Srjs      return;
663396c5ddc4Srjs   }
663496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CompressedTextureSubImage3D, cmd_size);
663596c5ddc4Srjs   cmd->texture = texture;
663696c5ddc4Srjs   cmd->level = level;
663796c5ddc4Srjs   cmd->xoffset = xoffset;
663896c5ddc4Srjs   cmd->yoffset = yoffset;
663996c5ddc4Srjs   cmd->zoffset = zoffset;
664096c5ddc4Srjs   cmd->width = width;
664196c5ddc4Srjs   cmd->height = height;
664296c5ddc4Srjs   cmd->depth = depth;
664396c5ddc4Srjs   cmd->format = format;
664496c5ddc4Srjs   cmd->imageSize = imageSize;
664596c5ddc4Srjs   cmd->data = data;
664696c5ddc4Srjs}
664796c5ddc4Srjs
664896c5ddc4Srjs
664996c5ddc4Srjs/* CopyTextureSubImage1D: marshalled asynchronously */
665096c5ddc4Srjsstruct marshal_cmd_CopyTextureSubImage1D
665196c5ddc4Srjs{
665296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
665396c5ddc4Srjs   GLuint texture;
665496c5ddc4Srjs   GLint level;
665596c5ddc4Srjs   GLint xoffset;
665696c5ddc4Srjs   GLint x;
665796c5ddc4Srjs   GLint y;
665896c5ddc4Srjs   GLsizei width;
665996c5ddc4Srjs};
666096c5ddc4Srjsuint32_t
666196c5ddc4Srjs_mesa_unmarshal_CopyTextureSubImage1D(struct gl_context *ctx, const struct marshal_cmd_CopyTextureSubImage1D *cmd, const uint64_t *last)
666296c5ddc4Srjs{
666396c5ddc4Srjs   GLuint texture = cmd->texture;
666496c5ddc4Srjs   GLint level = cmd->level;
666596c5ddc4Srjs   GLint xoffset = cmd->xoffset;
666696c5ddc4Srjs   GLint x = cmd->x;
666796c5ddc4Srjs   GLint y = cmd->y;
666896c5ddc4Srjs   GLsizei width = cmd->width;
666996c5ddc4Srjs   CALL_CopyTextureSubImage1D(ctx->CurrentServerDispatch, (texture, level, xoffset, x, y, width));
667096c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CopyTextureSubImage1D), 8) / 8);
667196c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
667296c5ddc4Srjs   return cmd_size;
667396c5ddc4Srjs}
667496c5ddc4Srjsvoid GLAPIENTRY
667596c5ddc4Srjs_mesa_marshal_CopyTextureSubImage1D(GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
667696c5ddc4Srjs{
667796c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
667896c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CopyTextureSubImage1D);
667996c5ddc4Srjs   struct marshal_cmd_CopyTextureSubImage1D *cmd;
668096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyTextureSubImage1D, cmd_size);
668196c5ddc4Srjs   cmd->texture = texture;
668296c5ddc4Srjs   cmd->level = level;
668396c5ddc4Srjs   cmd->xoffset = xoffset;
668496c5ddc4Srjs   cmd->x = x;
668596c5ddc4Srjs   cmd->y = y;
668696c5ddc4Srjs   cmd->width = width;
668796c5ddc4Srjs}
668896c5ddc4Srjs
668996c5ddc4Srjs
669096c5ddc4Srjs/* CopyTextureSubImage2D: marshalled asynchronously */
669196c5ddc4Srjsstruct marshal_cmd_CopyTextureSubImage2D
669296c5ddc4Srjs{
669396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
669496c5ddc4Srjs   GLuint texture;
669596c5ddc4Srjs   GLint level;
669696c5ddc4Srjs   GLint xoffset;
669796c5ddc4Srjs   GLint yoffset;
669896c5ddc4Srjs   GLint x;
669996c5ddc4Srjs   GLint y;
670096c5ddc4Srjs   GLsizei width;
670196c5ddc4Srjs   GLsizei height;
670296c5ddc4Srjs};
670396c5ddc4Srjsuint32_t
670496c5ddc4Srjs_mesa_unmarshal_CopyTextureSubImage2D(struct gl_context *ctx, const struct marshal_cmd_CopyTextureSubImage2D *cmd, const uint64_t *last)
670596c5ddc4Srjs{
670696c5ddc4Srjs   GLuint texture = cmd->texture;
670796c5ddc4Srjs   GLint level = cmd->level;
670896c5ddc4Srjs   GLint xoffset = cmd->xoffset;
670996c5ddc4Srjs   GLint yoffset = cmd->yoffset;
671096c5ddc4Srjs   GLint x = cmd->x;
671196c5ddc4Srjs   GLint y = cmd->y;
671296c5ddc4Srjs   GLsizei width = cmd->width;
671396c5ddc4Srjs   GLsizei height = cmd->height;
671496c5ddc4Srjs   CALL_CopyTextureSubImage2D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, x, y, width, height));
671596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CopyTextureSubImage2D), 8) / 8);
671696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
671796c5ddc4Srjs   return cmd_size;
671896c5ddc4Srjs}
671996c5ddc4Srjsvoid GLAPIENTRY
672096c5ddc4Srjs_mesa_marshal_CopyTextureSubImage2D(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
672196c5ddc4Srjs{
672296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
672396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CopyTextureSubImage2D);
672496c5ddc4Srjs   struct marshal_cmd_CopyTextureSubImage2D *cmd;
672596c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyTextureSubImage2D, cmd_size);
672696c5ddc4Srjs   cmd->texture = texture;
672796c5ddc4Srjs   cmd->level = level;
672896c5ddc4Srjs   cmd->xoffset = xoffset;
672996c5ddc4Srjs   cmd->yoffset = yoffset;
673096c5ddc4Srjs   cmd->x = x;
673196c5ddc4Srjs   cmd->y = y;
673296c5ddc4Srjs   cmd->width = width;
673396c5ddc4Srjs   cmd->height = height;
673496c5ddc4Srjs}
673596c5ddc4Srjs
673696c5ddc4Srjs
673796c5ddc4Srjs/* CopyTextureSubImage3D: marshalled asynchronously */
673896c5ddc4Srjsstruct marshal_cmd_CopyTextureSubImage3D
673996c5ddc4Srjs{
674096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
674196c5ddc4Srjs   GLuint texture;
674296c5ddc4Srjs   GLint level;
674396c5ddc4Srjs   GLint xoffset;
674496c5ddc4Srjs   GLint yoffset;
674596c5ddc4Srjs   GLint zoffset;
674696c5ddc4Srjs   GLint x;
674796c5ddc4Srjs   GLint y;
674896c5ddc4Srjs   GLsizei width;
674996c5ddc4Srjs   GLsizei height;
675096c5ddc4Srjs};
675196c5ddc4Srjsuint32_t
675296c5ddc4Srjs_mesa_unmarshal_CopyTextureSubImage3D(struct gl_context *ctx, const struct marshal_cmd_CopyTextureSubImage3D *cmd, const uint64_t *last)
675396c5ddc4Srjs{
675496c5ddc4Srjs   GLuint texture = cmd->texture;
675596c5ddc4Srjs   GLint level = cmd->level;
675696c5ddc4Srjs   GLint xoffset = cmd->xoffset;
675796c5ddc4Srjs   GLint yoffset = cmd->yoffset;
675896c5ddc4Srjs   GLint zoffset = cmd->zoffset;
675996c5ddc4Srjs   GLint x = cmd->x;
676096c5ddc4Srjs   GLint y = cmd->y;
676196c5ddc4Srjs   GLsizei width = cmd->width;
676296c5ddc4Srjs   GLsizei height = cmd->height;
676396c5ddc4Srjs   CALL_CopyTextureSubImage3D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, x, y, width, height));
676496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CopyTextureSubImage3D), 8) / 8);
676596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
676696c5ddc4Srjs   return cmd_size;
676796c5ddc4Srjs}
676896c5ddc4Srjsvoid GLAPIENTRY
676996c5ddc4Srjs_mesa_marshal_CopyTextureSubImage3D(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
677096c5ddc4Srjs{
677196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
677296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_CopyTextureSubImage3D);
677396c5ddc4Srjs   struct marshal_cmd_CopyTextureSubImage3D *cmd;
677496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyTextureSubImage3D, cmd_size);
677596c5ddc4Srjs   cmd->texture = texture;
677696c5ddc4Srjs   cmd->level = level;
677796c5ddc4Srjs   cmd->xoffset = xoffset;
677896c5ddc4Srjs   cmd->yoffset = yoffset;
677996c5ddc4Srjs   cmd->zoffset = zoffset;
678096c5ddc4Srjs   cmd->x = x;
678196c5ddc4Srjs   cmd->y = y;
678296c5ddc4Srjs   cmd->width = width;
678396c5ddc4Srjs   cmd->height = height;
678496c5ddc4Srjs}
678596c5ddc4Srjs
678696c5ddc4Srjs
678796c5ddc4Srjs/* TextureParameterf: marshalled asynchronously */
678896c5ddc4Srjsstruct marshal_cmd_TextureParameterf
678996c5ddc4Srjs{
679096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
679196c5ddc4Srjs   GLuint texture;
679296c5ddc4Srjs   GLenum pname;
679396c5ddc4Srjs   GLfloat param;
679496c5ddc4Srjs};
679596c5ddc4Srjsuint32_t
679696c5ddc4Srjs_mesa_unmarshal_TextureParameterf(struct gl_context *ctx, const struct marshal_cmd_TextureParameterf *cmd, const uint64_t *last)
679796c5ddc4Srjs{
679896c5ddc4Srjs   GLuint texture = cmd->texture;
679996c5ddc4Srjs   GLenum pname = cmd->pname;
680096c5ddc4Srjs   GLfloat param = cmd->param;
680196c5ddc4Srjs   CALL_TextureParameterf(ctx->CurrentServerDispatch, (texture, pname, param));
680296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureParameterf), 8) / 8);
680396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
680496c5ddc4Srjs   return cmd_size;
680596c5ddc4Srjs}
680696c5ddc4Srjsvoid GLAPIENTRY
680796c5ddc4Srjs_mesa_marshal_TextureParameterf(GLuint texture, GLenum pname, GLfloat param)
680896c5ddc4Srjs{
680996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
681096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureParameterf);
681196c5ddc4Srjs   struct marshal_cmd_TextureParameterf *cmd;
681296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureParameterf, cmd_size);
681396c5ddc4Srjs   cmd->texture = texture;
681496c5ddc4Srjs   cmd->pname = pname;
681596c5ddc4Srjs   cmd->param = param;
681696c5ddc4Srjs}
681796c5ddc4Srjs
681896c5ddc4Srjs
681996c5ddc4Srjs/* TextureParameterfv: marshalled asynchronously */
682096c5ddc4Srjsstruct marshal_cmd_TextureParameterfv
682196c5ddc4Srjs{
682296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
682396c5ddc4Srjs   GLuint texture;
682496c5ddc4Srjs   GLenum pname;
682596c5ddc4Srjs   /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLfloat)) bytes are GLfloat param[_mesa_tex_param_enum_to_count(pname)] */
682696c5ddc4Srjs};
682796c5ddc4Srjsuint32_t
682896c5ddc4Srjs_mesa_unmarshal_TextureParameterfv(struct gl_context *ctx, const struct marshal_cmd_TextureParameterfv *cmd, const uint64_t *last)
682996c5ddc4Srjs{
683096c5ddc4Srjs   GLuint texture = cmd->texture;
683196c5ddc4Srjs   GLenum pname = cmd->pname;
683296c5ddc4Srjs   GLfloat * param;
683396c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
683496c5ddc4Srjs   param = (GLfloat *) variable_data;
683596c5ddc4Srjs   CALL_TextureParameterfv(ctx->CurrentServerDispatch, (texture, pname, param));
683696c5ddc4Srjs   return cmd->cmd_base.cmd_size;
683796c5ddc4Srjs}
683896c5ddc4Srjsvoid GLAPIENTRY
683996c5ddc4Srjs_mesa_marshal_TextureParameterfv(GLuint texture, GLenum pname, const GLfloat * param)
684096c5ddc4Srjs{
684196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
684296c5ddc4Srjs   int param_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLfloat));
684396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureParameterfv) + param_size;
684496c5ddc4Srjs   struct marshal_cmd_TextureParameterfv *cmd;
684596c5ddc4Srjs   if (unlikely(param_size < 0 || (param_size > 0 && !param) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
684696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "TextureParameterfv");
684796c5ddc4Srjs      CALL_TextureParameterfv(ctx->CurrentServerDispatch, (texture, pname, param));
684896c5ddc4Srjs      return;
684996c5ddc4Srjs   }
685096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureParameterfv, cmd_size);
685196c5ddc4Srjs   cmd->texture = texture;
685296c5ddc4Srjs   cmd->pname = pname;
685396c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
685496c5ddc4Srjs   memcpy(variable_data, param, param_size);
685596c5ddc4Srjs}
685696c5ddc4Srjs
685796c5ddc4Srjs
685896c5ddc4Srjs/* TextureParameteri: marshalled asynchronously */
685996c5ddc4Srjsstruct marshal_cmd_TextureParameteri
686096c5ddc4Srjs{
686196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
686296c5ddc4Srjs   GLuint texture;
686396c5ddc4Srjs   GLenum pname;
686496c5ddc4Srjs   GLint param;
686596c5ddc4Srjs};
686696c5ddc4Srjsuint32_t
686796c5ddc4Srjs_mesa_unmarshal_TextureParameteri(struct gl_context *ctx, const struct marshal_cmd_TextureParameteri *cmd, const uint64_t *last)
686896c5ddc4Srjs{
686996c5ddc4Srjs   GLuint texture = cmd->texture;
687096c5ddc4Srjs   GLenum pname = cmd->pname;
687196c5ddc4Srjs   GLint param = cmd->param;
687296c5ddc4Srjs   CALL_TextureParameteri(ctx->CurrentServerDispatch, (texture, pname, param));
687396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureParameteri), 8) / 8);
687496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
687596c5ddc4Srjs   return cmd_size;
687696c5ddc4Srjs}
687796c5ddc4Srjsvoid GLAPIENTRY
687896c5ddc4Srjs_mesa_marshal_TextureParameteri(GLuint texture, GLenum pname, GLint param)
687996c5ddc4Srjs{
688096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
688196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureParameteri);
688296c5ddc4Srjs   struct marshal_cmd_TextureParameteri *cmd;
688396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureParameteri, cmd_size);
688496c5ddc4Srjs   cmd->texture = texture;
688596c5ddc4Srjs   cmd->pname = pname;
688696c5ddc4Srjs   cmd->param = param;
688796c5ddc4Srjs}
688896c5ddc4Srjs
688996c5ddc4Srjs
689096c5ddc4Srjs/* TextureParameterIiv: marshalled asynchronously */
689196c5ddc4Srjsstruct marshal_cmd_TextureParameterIiv
689296c5ddc4Srjs{
689396c5ddc4Srjs   struct marshal_cmd_base cmd_base;
689496c5ddc4Srjs   GLuint texture;
689596c5ddc4Srjs   GLenum pname;
689696c5ddc4Srjs   /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint)) bytes are GLint params[_mesa_tex_param_enum_to_count(pname)] */
689796c5ddc4Srjs};
689896c5ddc4Srjsuint32_t
689996c5ddc4Srjs_mesa_unmarshal_TextureParameterIiv(struct gl_context *ctx, const struct marshal_cmd_TextureParameterIiv *cmd, const uint64_t *last)
690096c5ddc4Srjs{
690196c5ddc4Srjs   GLuint texture = cmd->texture;
690296c5ddc4Srjs   GLenum pname = cmd->pname;
690396c5ddc4Srjs   GLint * params;
690496c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
690596c5ddc4Srjs   params = (GLint *) variable_data;
690696c5ddc4Srjs   CALL_TextureParameterIiv(ctx->CurrentServerDispatch, (texture, pname, params));
690796c5ddc4Srjs   return cmd->cmd_base.cmd_size;
690896c5ddc4Srjs}
690996c5ddc4Srjsvoid GLAPIENTRY
691096c5ddc4Srjs_mesa_marshal_TextureParameterIiv(GLuint texture, GLenum pname, const GLint * params)
691196c5ddc4Srjs{
691296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
691396c5ddc4Srjs   int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint));
691496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureParameterIiv) + params_size;
691596c5ddc4Srjs   struct marshal_cmd_TextureParameterIiv *cmd;
691696c5ddc4Srjs   if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
691796c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "TextureParameterIiv");
691896c5ddc4Srjs      CALL_TextureParameterIiv(ctx->CurrentServerDispatch, (texture, pname, params));
691996c5ddc4Srjs      return;
692096c5ddc4Srjs   }
692196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureParameterIiv, cmd_size);
692296c5ddc4Srjs   cmd->texture = texture;
692396c5ddc4Srjs   cmd->pname = pname;
692496c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
692596c5ddc4Srjs   memcpy(variable_data, params, params_size);
692696c5ddc4Srjs}
692796c5ddc4Srjs
692896c5ddc4Srjs
692996c5ddc4Srjs/* TextureParameterIuiv: marshalled asynchronously */
693096c5ddc4Srjsstruct marshal_cmd_TextureParameterIuiv
693196c5ddc4Srjs{
693296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
693396c5ddc4Srjs   GLuint texture;
693496c5ddc4Srjs   GLenum pname;
693596c5ddc4Srjs   /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLuint)) bytes are GLuint params[_mesa_tex_param_enum_to_count(pname)] */
693696c5ddc4Srjs};
693796c5ddc4Srjsuint32_t
693896c5ddc4Srjs_mesa_unmarshal_TextureParameterIuiv(struct gl_context *ctx, const struct marshal_cmd_TextureParameterIuiv *cmd, const uint64_t *last)
693996c5ddc4Srjs{
694096c5ddc4Srjs   GLuint texture = cmd->texture;
694196c5ddc4Srjs   GLenum pname = cmd->pname;
694296c5ddc4Srjs   GLuint * params;
694396c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
694496c5ddc4Srjs   params = (GLuint *) variable_data;
694596c5ddc4Srjs   CALL_TextureParameterIuiv(ctx->CurrentServerDispatch, (texture, pname, params));
694696c5ddc4Srjs   return cmd->cmd_base.cmd_size;
694796c5ddc4Srjs}
694896c5ddc4Srjsvoid GLAPIENTRY
694996c5ddc4Srjs_mesa_marshal_TextureParameterIuiv(GLuint texture, GLenum pname, const GLuint * params)
695096c5ddc4Srjs{
695196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
695296c5ddc4Srjs   int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLuint));
695396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureParameterIuiv) + params_size;
695496c5ddc4Srjs   struct marshal_cmd_TextureParameterIuiv *cmd;
695596c5ddc4Srjs   if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
695696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "TextureParameterIuiv");
695796c5ddc4Srjs      CALL_TextureParameterIuiv(ctx->CurrentServerDispatch, (texture, pname, params));
695896c5ddc4Srjs      return;
695996c5ddc4Srjs   }
696096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureParameterIuiv, cmd_size);
696196c5ddc4Srjs   cmd->texture = texture;
696296c5ddc4Srjs   cmd->pname = pname;
696396c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
696496c5ddc4Srjs   memcpy(variable_data, params, params_size);
696596c5ddc4Srjs}
696696c5ddc4Srjs
696796c5ddc4Srjs
696896c5ddc4Srjs/* TextureParameteriv: marshalled asynchronously */
696996c5ddc4Srjsstruct marshal_cmd_TextureParameteriv
697096c5ddc4Srjs{
697196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
697296c5ddc4Srjs   GLuint texture;
697396c5ddc4Srjs   GLenum pname;
697496c5ddc4Srjs   /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint)) bytes are GLint param[_mesa_tex_param_enum_to_count(pname)] */
697596c5ddc4Srjs};
697696c5ddc4Srjsuint32_t
697796c5ddc4Srjs_mesa_unmarshal_TextureParameteriv(struct gl_context *ctx, const struct marshal_cmd_TextureParameteriv *cmd, const uint64_t *last)
697896c5ddc4Srjs{
697996c5ddc4Srjs   GLuint texture = cmd->texture;
698096c5ddc4Srjs   GLenum pname = cmd->pname;
698196c5ddc4Srjs   GLint * param;
698296c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
698396c5ddc4Srjs   param = (GLint *) variable_data;
698496c5ddc4Srjs   CALL_TextureParameteriv(ctx->CurrentServerDispatch, (texture, pname, param));
698596c5ddc4Srjs   return cmd->cmd_base.cmd_size;
698696c5ddc4Srjs}
698796c5ddc4Srjsvoid GLAPIENTRY
698896c5ddc4Srjs_mesa_marshal_TextureParameteriv(GLuint texture, GLenum pname, const GLint * param)
698996c5ddc4Srjs{
699096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
699196c5ddc4Srjs   int param_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint));
699296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureParameteriv) + param_size;
699396c5ddc4Srjs   struct marshal_cmd_TextureParameteriv *cmd;
699496c5ddc4Srjs   if (unlikely(param_size < 0 || (param_size > 0 && !param) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
699596c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "TextureParameteriv");
699696c5ddc4Srjs      CALL_TextureParameteriv(ctx->CurrentServerDispatch, (texture, pname, param));
699796c5ddc4Srjs      return;
699896c5ddc4Srjs   }
699996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureParameteriv, cmd_size);
700096c5ddc4Srjs   cmd->texture = texture;
700196c5ddc4Srjs   cmd->pname = pname;
700296c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
700396c5ddc4Srjs   memcpy(variable_data, param, param_size);
700496c5ddc4Srjs}
700596c5ddc4Srjs
700696c5ddc4Srjs
700796c5ddc4Srjs/* GenerateTextureMipmap: marshalled asynchronously */
700896c5ddc4Srjsstruct marshal_cmd_GenerateTextureMipmap
700996c5ddc4Srjs{
701096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
701196c5ddc4Srjs   GLuint texture;
701296c5ddc4Srjs};
701396c5ddc4Srjsuint32_t
701496c5ddc4Srjs_mesa_unmarshal_GenerateTextureMipmap(struct gl_context *ctx, const struct marshal_cmd_GenerateTextureMipmap *cmd, const uint64_t *last)
701596c5ddc4Srjs{
701696c5ddc4Srjs   GLuint texture = cmd->texture;
701796c5ddc4Srjs   CALL_GenerateTextureMipmap(ctx->CurrentServerDispatch, (texture));
701896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GenerateTextureMipmap), 8) / 8);
701996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
702096c5ddc4Srjs   return cmd_size;
702196c5ddc4Srjs}
702296c5ddc4Srjsvoid GLAPIENTRY
702396c5ddc4Srjs_mesa_marshal_GenerateTextureMipmap(GLuint texture)
702496c5ddc4Srjs{
702596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
702696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GenerateTextureMipmap);
702796c5ddc4Srjs   struct marshal_cmd_GenerateTextureMipmap *cmd;
702896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GenerateTextureMipmap, cmd_size);
702996c5ddc4Srjs   cmd->texture = texture;
703096c5ddc4Srjs}
703196c5ddc4Srjs
703296c5ddc4Srjs
703396c5ddc4Srjs/* BindTextureUnit: marshalled asynchronously */
703496c5ddc4Srjsstruct marshal_cmd_BindTextureUnit
703596c5ddc4Srjs{
703696c5ddc4Srjs   struct marshal_cmd_base cmd_base;
703796c5ddc4Srjs   GLuint unit;
703896c5ddc4Srjs   GLuint texture;
703996c5ddc4Srjs};
704096c5ddc4Srjsuint32_t
704196c5ddc4Srjs_mesa_unmarshal_BindTextureUnit(struct gl_context *ctx, const struct marshal_cmd_BindTextureUnit *cmd, const uint64_t *last)
704296c5ddc4Srjs{
704396c5ddc4Srjs   GLuint unit = cmd->unit;
704496c5ddc4Srjs   GLuint texture = cmd->texture;
704596c5ddc4Srjs   CALL_BindTextureUnit(ctx->CurrentServerDispatch, (unit, texture));
704696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindTextureUnit), 8) / 8);
704796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
704896c5ddc4Srjs   return cmd_size;
704996c5ddc4Srjs}
705096c5ddc4Srjsvoid GLAPIENTRY
705196c5ddc4Srjs_mesa_marshal_BindTextureUnit(GLuint unit, GLuint texture)
705296c5ddc4Srjs{
705396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
705496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_BindTextureUnit);
705596c5ddc4Srjs   struct marshal_cmd_BindTextureUnit *cmd;
705696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindTextureUnit, cmd_size);
705796c5ddc4Srjs   cmd->unit = unit;
705896c5ddc4Srjs   cmd->texture = texture;
705996c5ddc4Srjs}
706096c5ddc4Srjs
706196c5ddc4Srjs
706296c5ddc4Srjs/* GetTextureImage: marshalled asynchronously */
706396c5ddc4Srjsstruct marshal_cmd_GetTextureImage
706496c5ddc4Srjs{
706596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
706696c5ddc4Srjs   GLuint texture;
706796c5ddc4Srjs   GLint level;
706896c5ddc4Srjs   GLenum format;
706996c5ddc4Srjs   GLenum type;
707096c5ddc4Srjs   GLsizei bufSize;
707196c5ddc4Srjs   GLvoid * pixels;
707296c5ddc4Srjs};
707396c5ddc4Srjsuint32_t
707496c5ddc4Srjs_mesa_unmarshal_GetTextureImage(struct gl_context *ctx, const struct marshal_cmd_GetTextureImage *cmd, const uint64_t *last)
707596c5ddc4Srjs{
707696c5ddc4Srjs   GLuint texture = cmd->texture;
707796c5ddc4Srjs   GLint level = cmd->level;
707896c5ddc4Srjs   GLenum format = cmd->format;
707996c5ddc4Srjs   GLenum type = cmd->type;
708096c5ddc4Srjs   GLsizei bufSize = cmd->bufSize;
708196c5ddc4Srjs   GLvoid * pixels = cmd->pixels;
708296c5ddc4Srjs   CALL_GetTextureImage(ctx->CurrentServerDispatch, (texture, level, format, type, bufSize, pixels));
708396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetTextureImage), 8) / 8);
708496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
708596c5ddc4Srjs   return cmd_size;
708696c5ddc4Srjs}
708796c5ddc4Srjsvoid GLAPIENTRY
708896c5ddc4Srjs_mesa_marshal_GetTextureImage(GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid * pixels)
708996c5ddc4Srjs{
709096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
709196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetTextureImage);
709296c5ddc4Srjs   struct marshal_cmd_GetTextureImage *cmd;
709396c5ddc4Srjs   if (_mesa_glthread_has_no_pack_buffer(ctx)) {
709496c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "GetTextureImage");
709596c5ddc4Srjs      CALL_GetTextureImage(ctx->CurrentServerDispatch, (texture, level, format, type, bufSize, pixels));
709696c5ddc4Srjs      return;
709796c5ddc4Srjs   }
709896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetTextureImage, cmd_size);
709996c5ddc4Srjs   cmd->texture = texture;
710096c5ddc4Srjs   cmd->level = level;
710196c5ddc4Srjs   cmd->format = format;
710296c5ddc4Srjs   cmd->type = type;
710396c5ddc4Srjs   cmd->bufSize = bufSize;
710496c5ddc4Srjs   cmd->pixels = pixels;
710596c5ddc4Srjs}
710696c5ddc4Srjs
710796c5ddc4Srjs
710896c5ddc4Srjs/* GetCompressedTextureImage: marshalled asynchronously */
710996c5ddc4Srjsstruct marshal_cmd_GetCompressedTextureImage
711096c5ddc4Srjs{
711196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
711296c5ddc4Srjs   GLuint texture;
711396c5ddc4Srjs   GLint level;
711496c5ddc4Srjs   GLsizei bufSize;
711596c5ddc4Srjs   GLvoid * pixels;
711696c5ddc4Srjs};
711796c5ddc4Srjsuint32_t
711896c5ddc4Srjs_mesa_unmarshal_GetCompressedTextureImage(struct gl_context *ctx, const struct marshal_cmd_GetCompressedTextureImage *cmd, const uint64_t *last)
711996c5ddc4Srjs{
712096c5ddc4Srjs   GLuint texture = cmd->texture;
712196c5ddc4Srjs   GLint level = cmd->level;
712296c5ddc4Srjs   GLsizei bufSize = cmd->bufSize;
712396c5ddc4Srjs   GLvoid * pixels = cmd->pixels;
712496c5ddc4Srjs   CALL_GetCompressedTextureImage(ctx->CurrentServerDispatch, (texture, level, bufSize, pixels));
712596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetCompressedTextureImage), 8) / 8);
712696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
712796c5ddc4Srjs   return cmd_size;
712896c5ddc4Srjs}
712996c5ddc4Srjsvoid GLAPIENTRY
713096c5ddc4Srjs_mesa_marshal_GetCompressedTextureImage(GLuint texture, GLint level, GLsizei bufSize, GLvoid * pixels)
713196c5ddc4Srjs{
713296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
713396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetCompressedTextureImage);
713496c5ddc4Srjs   struct marshal_cmd_GetCompressedTextureImage *cmd;
713596c5ddc4Srjs   if (_mesa_glthread_has_no_pack_buffer(ctx)) {
713696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "GetCompressedTextureImage");
713796c5ddc4Srjs      CALL_GetCompressedTextureImage(ctx->CurrentServerDispatch, (texture, level, bufSize, pixels));
713896c5ddc4Srjs      return;
713996c5ddc4Srjs   }
714096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetCompressedTextureImage, cmd_size);
714196c5ddc4Srjs   cmd->texture = texture;
714296c5ddc4Srjs   cmd->level = level;
714396c5ddc4Srjs   cmd->bufSize = bufSize;
714496c5ddc4Srjs   cmd->pixels = pixels;
714596c5ddc4Srjs}
714696c5ddc4Srjs
714796c5ddc4Srjs
714896c5ddc4Srjs/* GetTextureLevelParameterfv: marshalled synchronously */
714996c5ddc4Srjsvoid GLAPIENTRY
715096c5ddc4Srjs_mesa_marshal_GetTextureLevelParameterfv(GLuint texture, GLint level, GLenum pname, GLfloat * params)
715196c5ddc4Srjs{
715296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
715396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTextureLevelParameterfv");
715496c5ddc4Srjs   CALL_GetTextureLevelParameterfv(ctx->CurrentServerDispatch, (texture, level, pname, params));
715596c5ddc4Srjs}
715696c5ddc4Srjs
715796c5ddc4Srjs
715896c5ddc4Srjs/* GetTextureLevelParameteriv: marshalled synchronously */
715996c5ddc4Srjsvoid GLAPIENTRY
716096c5ddc4Srjs_mesa_marshal_GetTextureLevelParameteriv(GLuint texture, GLint level, GLenum pname, GLint * params)
716196c5ddc4Srjs{
716296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
716396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTextureLevelParameteriv");
716496c5ddc4Srjs   CALL_GetTextureLevelParameteriv(ctx->CurrentServerDispatch, (texture, level, pname, params));
716596c5ddc4Srjs}
716696c5ddc4Srjs
716796c5ddc4Srjs
716896c5ddc4Srjs/* GetTextureParameterfv: marshalled synchronously */
716996c5ddc4Srjsvoid GLAPIENTRY
717096c5ddc4Srjs_mesa_marshal_GetTextureParameterfv(GLuint texture, GLenum pname, GLfloat * params)
717196c5ddc4Srjs{
717296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
717396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTextureParameterfv");
717496c5ddc4Srjs   CALL_GetTextureParameterfv(ctx->CurrentServerDispatch, (texture, pname, params));
717596c5ddc4Srjs}
717696c5ddc4Srjs
717796c5ddc4Srjs
717896c5ddc4Srjs/* GetTextureParameterIiv: marshalled synchronously */
717996c5ddc4Srjsvoid GLAPIENTRY
718096c5ddc4Srjs_mesa_marshal_GetTextureParameterIiv(GLuint texture, GLenum pname, GLint * params)
718196c5ddc4Srjs{
718296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
718396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTextureParameterIiv");
718496c5ddc4Srjs   CALL_GetTextureParameterIiv(ctx->CurrentServerDispatch, (texture, pname, params));
718596c5ddc4Srjs}
718696c5ddc4Srjs
718796c5ddc4Srjs
718896c5ddc4Srjs/* GetTextureParameterIuiv: marshalled synchronously */
718996c5ddc4Srjsvoid GLAPIENTRY
719096c5ddc4Srjs_mesa_marshal_GetTextureParameterIuiv(GLuint texture, GLenum pname, GLuint * params)
719196c5ddc4Srjs{
719296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
719396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTextureParameterIuiv");
719496c5ddc4Srjs   CALL_GetTextureParameterIuiv(ctx->CurrentServerDispatch, (texture, pname, params));
719596c5ddc4Srjs}
719696c5ddc4Srjs
719796c5ddc4Srjs
719896c5ddc4Srjs/* GetTextureParameteriv: marshalled synchronously */
719996c5ddc4Srjsvoid GLAPIENTRY
720096c5ddc4Srjs_mesa_marshal_GetTextureParameteriv(GLuint texture, GLenum pname, GLint * params)
720196c5ddc4Srjs{
720296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
720396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetTextureParameteriv");
720496c5ddc4Srjs   CALL_GetTextureParameteriv(ctx->CurrentServerDispatch, (texture, pname, params));
720596c5ddc4Srjs}
720696c5ddc4Srjs
720796c5ddc4Srjs
720896c5ddc4Srjs/* CreateVertexArrays: marshalled synchronously */
720996c5ddc4Srjsvoid GLAPIENTRY
721096c5ddc4Srjs_mesa_marshal_CreateVertexArrays(GLsizei n, GLuint * arrays)
721196c5ddc4Srjs{
721296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
721396c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CreateVertexArrays");
721496c5ddc4Srjs   CALL_CreateVertexArrays(ctx->CurrentServerDispatch, (n, arrays));
721596c5ddc4Srjs   if (COMPAT) _mesa_glthread_GenVertexArrays(ctx, n, arrays);
721696c5ddc4Srjs}
721796c5ddc4Srjs
721896c5ddc4Srjs
721996c5ddc4Srjs/* DisableVertexArrayAttrib: marshalled asynchronously */
722096c5ddc4Srjsstruct marshal_cmd_DisableVertexArrayAttrib
722196c5ddc4Srjs{
722296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
722396c5ddc4Srjs   GLuint vaobj;
722496c5ddc4Srjs   GLuint index;
722596c5ddc4Srjs};
722696c5ddc4Srjsuint32_t
722796c5ddc4Srjs_mesa_unmarshal_DisableVertexArrayAttrib(struct gl_context *ctx, const struct marshal_cmd_DisableVertexArrayAttrib *cmd, const uint64_t *last)
722896c5ddc4Srjs{
722996c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
723096c5ddc4Srjs   GLuint index = cmd->index;
723196c5ddc4Srjs   CALL_DisableVertexArrayAttrib(ctx->CurrentServerDispatch, (vaobj, index));
723296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DisableVertexArrayAttrib), 8) / 8);
723396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
723496c5ddc4Srjs   return cmd_size;
723596c5ddc4Srjs}
723696c5ddc4Srjsvoid GLAPIENTRY
723796c5ddc4Srjs_mesa_marshal_DisableVertexArrayAttrib(GLuint vaobj, GLuint index)
723896c5ddc4Srjs{
723996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
724096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_DisableVertexArrayAttrib);
724196c5ddc4Srjs   struct marshal_cmd_DisableVertexArrayAttrib *cmd;
724296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DisableVertexArrayAttrib, cmd_size);
724396c5ddc4Srjs   cmd->vaobj = vaobj;
724496c5ddc4Srjs   cmd->index = index;
724596c5ddc4Srjs   if (COMPAT) _mesa_glthread_ClientState(ctx, &vaobj, VERT_ATTRIB_GENERIC(index), false);
724696c5ddc4Srjs}
724796c5ddc4Srjs
724896c5ddc4Srjs
724996c5ddc4Srjs/* EnableVertexArrayAttrib: marshalled asynchronously */
725096c5ddc4Srjsstruct marshal_cmd_EnableVertexArrayAttrib
725196c5ddc4Srjs{
725296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
725396c5ddc4Srjs   GLuint vaobj;
725496c5ddc4Srjs   GLuint index;
725596c5ddc4Srjs};
725696c5ddc4Srjsuint32_t
725796c5ddc4Srjs_mesa_unmarshal_EnableVertexArrayAttrib(struct gl_context *ctx, const struct marshal_cmd_EnableVertexArrayAttrib *cmd, const uint64_t *last)
725896c5ddc4Srjs{
725996c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
726096c5ddc4Srjs   GLuint index = cmd->index;
726196c5ddc4Srjs   CALL_EnableVertexArrayAttrib(ctx->CurrentServerDispatch, (vaobj, index));
726296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_EnableVertexArrayAttrib), 8) / 8);
726396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
726496c5ddc4Srjs   return cmd_size;
726596c5ddc4Srjs}
726696c5ddc4Srjsvoid GLAPIENTRY
726796c5ddc4Srjs_mesa_marshal_EnableVertexArrayAttrib(GLuint vaobj, GLuint index)
726896c5ddc4Srjs{
726996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
727096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_EnableVertexArrayAttrib);
727196c5ddc4Srjs   struct marshal_cmd_EnableVertexArrayAttrib *cmd;
727296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EnableVertexArrayAttrib, cmd_size);
727396c5ddc4Srjs   cmd->vaobj = vaobj;
727496c5ddc4Srjs   cmd->index = index;
727596c5ddc4Srjs   if (COMPAT) _mesa_glthread_ClientState(ctx, &vaobj, VERT_ATTRIB_GENERIC(index), true);
727696c5ddc4Srjs}
727796c5ddc4Srjs
727896c5ddc4Srjs
727996c5ddc4Srjs/* VertexArrayElementBuffer: marshalled asynchronously */
728096c5ddc4Srjsstruct marshal_cmd_VertexArrayElementBuffer
728196c5ddc4Srjs{
728296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
728396c5ddc4Srjs   GLuint vaobj;
728496c5ddc4Srjs   GLuint buffer;
728596c5ddc4Srjs};
728696c5ddc4Srjsuint32_t
728796c5ddc4Srjs_mesa_unmarshal_VertexArrayElementBuffer(struct gl_context *ctx, const struct marshal_cmd_VertexArrayElementBuffer *cmd, const uint64_t *last)
728896c5ddc4Srjs{
728996c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
729096c5ddc4Srjs   GLuint buffer = cmd->buffer;
729196c5ddc4Srjs   CALL_VertexArrayElementBuffer(ctx->CurrentServerDispatch, (vaobj, buffer));
729296c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexArrayElementBuffer), 8) / 8);
729396c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
729496c5ddc4Srjs   return cmd_size;
729596c5ddc4Srjs}
729696c5ddc4Srjsvoid GLAPIENTRY
729796c5ddc4Srjs_mesa_marshal_VertexArrayElementBuffer(GLuint vaobj, GLuint buffer)
729896c5ddc4Srjs{
729996c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
730096c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexArrayElementBuffer);
730196c5ddc4Srjs   struct marshal_cmd_VertexArrayElementBuffer *cmd;
730296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayElementBuffer, cmd_size);
730396c5ddc4Srjs   cmd->vaobj = vaobj;
730496c5ddc4Srjs   cmd->buffer = buffer;
730596c5ddc4Srjs   if (COMPAT) _mesa_glthread_DSAElementBuffer(ctx, vaobj, buffer);
730696c5ddc4Srjs}
730796c5ddc4Srjs
730896c5ddc4Srjs
730996c5ddc4Srjs/* VertexArrayVertexBuffer: marshalled asynchronously */
731096c5ddc4Srjsstruct marshal_cmd_VertexArrayVertexBuffer
731196c5ddc4Srjs{
731296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
731396c5ddc4Srjs   GLuint vaobj;
731496c5ddc4Srjs   GLuint bindingindex;
731596c5ddc4Srjs   GLuint buffer;
731696c5ddc4Srjs   GLsizei stride;
731796c5ddc4Srjs   GLintptr offset;
731896c5ddc4Srjs};
731996c5ddc4Srjsuint32_t
732096c5ddc4Srjs_mesa_unmarshal_VertexArrayVertexBuffer(struct gl_context *ctx, const struct marshal_cmd_VertexArrayVertexBuffer *cmd, const uint64_t *last)
732196c5ddc4Srjs{
732296c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
732396c5ddc4Srjs   GLuint bindingindex = cmd->bindingindex;
732496c5ddc4Srjs   GLuint buffer = cmd->buffer;
732596c5ddc4Srjs   GLintptr offset = cmd->offset;
732696c5ddc4Srjs   GLsizei stride = cmd->stride;
732796c5ddc4Srjs   CALL_VertexArrayVertexBuffer(ctx->CurrentServerDispatch, (vaobj, bindingindex, buffer, offset, stride));
732896c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexArrayVertexBuffer), 8) / 8);
732996c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
733096c5ddc4Srjs   return cmd_size;
733196c5ddc4Srjs}
733296c5ddc4Srjsvoid GLAPIENTRY
733396c5ddc4Srjs_mesa_marshal_VertexArrayVertexBuffer(GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride)
733496c5ddc4Srjs{
733596c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
733696c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexArrayVertexBuffer);
733796c5ddc4Srjs   struct marshal_cmd_VertexArrayVertexBuffer *cmd;
733896c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayVertexBuffer, cmd_size);
733996c5ddc4Srjs   cmd->vaobj = vaobj;
734096c5ddc4Srjs   cmd->bindingindex = bindingindex;
734196c5ddc4Srjs   cmd->buffer = buffer;
734296c5ddc4Srjs   cmd->offset = offset;
734396c5ddc4Srjs   cmd->stride = stride;
734496c5ddc4Srjs   if (COMPAT) _mesa_glthread_DSAVertexBuffer(ctx, vaobj, bindingindex, buffer, offset, stride);
734596c5ddc4Srjs}
734696c5ddc4Srjs
734796c5ddc4Srjs
734896c5ddc4Srjs/* VertexArrayVertexBuffers: marshalled asynchronously */
734996c5ddc4Srjsstruct marshal_cmd_VertexArrayVertexBuffers
735096c5ddc4Srjs{
735196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
735296c5ddc4Srjs   GLuint vaobj;
735396c5ddc4Srjs   GLuint first;
735496c5ddc4Srjs   GLsizei count;
735596c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLuint)) bytes are GLuint buffers[count] */
735696c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLintptr)) bytes are GLintptr offsets[count] */
735796c5ddc4Srjs   /* Next safe_mul(count, 1 * sizeof(GLsizei)) bytes are GLsizei strides[count] */
735896c5ddc4Srjs};
735996c5ddc4Srjsuint32_t
736096c5ddc4Srjs_mesa_unmarshal_VertexArrayVertexBuffers(struct gl_context *ctx, const struct marshal_cmd_VertexArrayVertexBuffers *cmd, const uint64_t *last)
736196c5ddc4Srjs{
736296c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
736396c5ddc4Srjs   GLuint first = cmd->first;
736496c5ddc4Srjs   GLsizei count = cmd->count;
736596c5ddc4Srjs   GLuint * buffers;
736696c5ddc4Srjs   GLintptr * offsets;
736796c5ddc4Srjs   GLsizei * strides;
736896c5ddc4Srjs   const char *variable_data = (const char *) (cmd + 1);
736996c5ddc4Srjs   buffers = (GLuint *) variable_data;
737096c5ddc4Srjs   variable_data += count * 1 * sizeof(GLuint);
737196c5ddc4Srjs   offsets = (GLintptr *) variable_data;
737296c5ddc4Srjs   variable_data += count * 1 * sizeof(GLintptr);
737396c5ddc4Srjs   strides = (GLsizei *) variable_data;
737496c5ddc4Srjs   CALL_VertexArrayVertexBuffers(ctx->CurrentServerDispatch, (vaobj, first, count, buffers, offsets, strides));
737596c5ddc4Srjs   return cmd->cmd_base.cmd_size;
737696c5ddc4Srjs}
737796c5ddc4Srjsvoid GLAPIENTRY
737896c5ddc4Srjs_mesa_marshal_VertexArrayVertexBuffers(GLuint vaobj, GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizei * strides)
737996c5ddc4Srjs{
738096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
738196c5ddc4Srjs   int buffers_size = safe_mul(count, 1 * sizeof(GLuint));
738296c5ddc4Srjs   int offsets_size = safe_mul(count, 1 * sizeof(GLintptr));
738396c5ddc4Srjs   int strides_size = safe_mul(count, 1 * sizeof(GLsizei));
738496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexArrayVertexBuffers) + buffers_size + offsets_size + strides_size;
738596c5ddc4Srjs   struct marshal_cmd_VertexArrayVertexBuffers *cmd;
738696c5ddc4Srjs   if (unlikely(buffers_size < 0 || (buffers_size > 0 && !buffers) || offsets_size < 0 || (offsets_size > 0 && !offsets) || strides_size < 0 || (strides_size > 0 && !strides) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) {
738796c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "VertexArrayVertexBuffers");
738896c5ddc4Srjs      CALL_VertexArrayVertexBuffers(ctx->CurrentServerDispatch, (vaobj, first, count, buffers, offsets, strides));
738996c5ddc4Srjs      if (COMPAT) _mesa_glthread_DSAVertexBuffers(ctx, vaobj, first, count, buffers, offsets, strides);
739096c5ddc4Srjs      return;
739196c5ddc4Srjs   }
739296c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayVertexBuffers, cmd_size);
739396c5ddc4Srjs   cmd->vaobj = vaobj;
739496c5ddc4Srjs   cmd->first = first;
739596c5ddc4Srjs   cmd->count = count;
739696c5ddc4Srjs   char *variable_data = (char *) (cmd + 1);
739796c5ddc4Srjs   memcpy(variable_data, buffers, buffers_size);
739896c5ddc4Srjs   variable_data += buffers_size;
739996c5ddc4Srjs   memcpy(variable_data, offsets, offsets_size);
740096c5ddc4Srjs   variable_data += offsets_size;
740196c5ddc4Srjs   memcpy(variable_data, strides, strides_size);
740296c5ddc4Srjs   if (COMPAT) _mesa_glthread_DSAVertexBuffers(ctx, vaobj, first, count, buffers, offsets, strides);
740396c5ddc4Srjs}
740496c5ddc4Srjs
740596c5ddc4Srjs
740696c5ddc4Srjs/* VertexArrayAttribFormat: marshalled asynchronously */
740796c5ddc4Srjsstruct marshal_cmd_VertexArrayAttribFormat
740896c5ddc4Srjs{
740996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
741096c5ddc4Srjs   GLboolean normalized;
741196c5ddc4Srjs   GLuint vaobj;
741296c5ddc4Srjs   GLuint attribindex;
741396c5ddc4Srjs   GLint size;
741496c5ddc4Srjs   GLenum type;
741596c5ddc4Srjs   GLuint relativeoffset;
741696c5ddc4Srjs};
741796c5ddc4Srjsuint32_t
741896c5ddc4Srjs_mesa_unmarshal_VertexArrayAttribFormat(struct gl_context *ctx, const struct marshal_cmd_VertexArrayAttribFormat *cmd, const uint64_t *last)
741996c5ddc4Srjs{
742096c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
742196c5ddc4Srjs   GLuint attribindex = cmd->attribindex;
742296c5ddc4Srjs   GLint size = cmd->size;
742396c5ddc4Srjs   GLenum type = cmd->type;
742496c5ddc4Srjs   GLboolean normalized = cmd->normalized;
742596c5ddc4Srjs   GLuint relativeoffset = cmd->relativeoffset;
742696c5ddc4Srjs   CALL_VertexArrayAttribFormat(ctx->CurrentServerDispatch, (vaobj, attribindex, size, type, normalized, relativeoffset));
742796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexArrayAttribFormat), 8) / 8);
742896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
742996c5ddc4Srjs   return cmd_size;
743096c5ddc4Srjs}
743196c5ddc4Srjsvoid GLAPIENTRY
743296c5ddc4Srjs_mesa_marshal_VertexArrayAttribFormat(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)
743396c5ddc4Srjs{
743496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
743596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexArrayAttribFormat);
743696c5ddc4Srjs   struct marshal_cmd_VertexArrayAttribFormat *cmd;
743796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayAttribFormat, cmd_size);
743896c5ddc4Srjs   cmd->vaobj = vaobj;
743996c5ddc4Srjs   cmd->attribindex = attribindex;
744096c5ddc4Srjs   cmd->size = size;
744196c5ddc4Srjs   cmd->type = type;
744296c5ddc4Srjs   cmd->normalized = normalized;
744396c5ddc4Srjs   cmd->relativeoffset = relativeoffset;
744496c5ddc4Srjs   if (COMPAT) _mesa_glthread_DSAAttribFormat(ctx, vaobj, attribindex, size, type, relativeoffset);
744596c5ddc4Srjs}
744696c5ddc4Srjs
744796c5ddc4Srjs
744896c5ddc4Srjs/* VertexArrayAttribIFormat: marshalled asynchronously */
744996c5ddc4Srjsstruct marshal_cmd_VertexArrayAttribIFormat
745096c5ddc4Srjs{
745196c5ddc4Srjs   struct marshal_cmd_base cmd_base;
745296c5ddc4Srjs   GLuint vaobj;
745396c5ddc4Srjs   GLuint attribindex;
745496c5ddc4Srjs   GLint size;
745596c5ddc4Srjs   GLenum type;
745696c5ddc4Srjs   GLuint relativeoffset;
745796c5ddc4Srjs};
745896c5ddc4Srjsuint32_t
745996c5ddc4Srjs_mesa_unmarshal_VertexArrayAttribIFormat(struct gl_context *ctx, const struct marshal_cmd_VertexArrayAttribIFormat *cmd, const uint64_t *last)
746096c5ddc4Srjs{
746196c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
746296c5ddc4Srjs   GLuint attribindex = cmd->attribindex;
746396c5ddc4Srjs   GLint size = cmd->size;
746496c5ddc4Srjs   GLenum type = cmd->type;
746596c5ddc4Srjs   GLuint relativeoffset = cmd->relativeoffset;
746696c5ddc4Srjs   CALL_VertexArrayAttribIFormat(ctx->CurrentServerDispatch, (vaobj, attribindex, size, type, relativeoffset));
746796c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexArrayAttribIFormat), 8) / 8);
746896c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
746996c5ddc4Srjs   return cmd_size;
747096c5ddc4Srjs}
747196c5ddc4Srjsvoid GLAPIENTRY
747296c5ddc4Srjs_mesa_marshal_VertexArrayAttribIFormat(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
747396c5ddc4Srjs{
747496c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
747596c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexArrayAttribIFormat);
747696c5ddc4Srjs   struct marshal_cmd_VertexArrayAttribIFormat *cmd;
747796c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayAttribIFormat, cmd_size);
747896c5ddc4Srjs   cmd->vaobj = vaobj;
747996c5ddc4Srjs   cmd->attribindex = attribindex;
748096c5ddc4Srjs   cmd->size = size;
748196c5ddc4Srjs   cmd->type = type;
748296c5ddc4Srjs   cmd->relativeoffset = relativeoffset;
748396c5ddc4Srjs   if (COMPAT) _mesa_glthread_DSAAttribFormat(ctx, vaobj, attribindex, size, type, relativeoffset);
748496c5ddc4Srjs}
748596c5ddc4Srjs
748696c5ddc4Srjs
748796c5ddc4Srjs/* VertexArrayAttribLFormat: marshalled asynchronously */
748896c5ddc4Srjsstruct marshal_cmd_VertexArrayAttribLFormat
748996c5ddc4Srjs{
749096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
749196c5ddc4Srjs   GLuint vaobj;
749296c5ddc4Srjs   GLuint attribindex;
749396c5ddc4Srjs   GLint size;
749496c5ddc4Srjs   GLenum type;
749596c5ddc4Srjs   GLuint relativeoffset;
749696c5ddc4Srjs};
749796c5ddc4Srjsuint32_t
749896c5ddc4Srjs_mesa_unmarshal_VertexArrayAttribLFormat(struct gl_context *ctx, const struct marshal_cmd_VertexArrayAttribLFormat *cmd, const uint64_t *last)
749996c5ddc4Srjs{
750096c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
750196c5ddc4Srjs   GLuint attribindex = cmd->attribindex;
750296c5ddc4Srjs   GLint size = cmd->size;
750396c5ddc4Srjs   GLenum type = cmd->type;
750496c5ddc4Srjs   GLuint relativeoffset = cmd->relativeoffset;
750596c5ddc4Srjs   CALL_VertexArrayAttribLFormat(ctx->CurrentServerDispatch, (vaobj, attribindex, size, type, relativeoffset));
750696c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexArrayAttribLFormat), 8) / 8);
750796c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
750896c5ddc4Srjs   return cmd_size;
750996c5ddc4Srjs}
751096c5ddc4Srjsvoid GLAPIENTRY
751196c5ddc4Srjs_mesa_marshal_VertexArrayAttribLFormat(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
751296c5ddc4Srjs{
751396c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
751496c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexArrayAttribLFormat);
751596c5ddc4Srjs   struct marshal_cmd_VertexArrayAttribLFormat *cmd;
751696c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayAttribLFormat, cmd_size);
751796c5ddc4Srjs   cmd->vaobj = vaobj;
751896c5ddc4Srjs   cmd->attribindex = attribindex;
751996c5ddc4Srjs   cmd->size = size;
752096c5ddc4Srjs   cmd->type = type;
752196c5ddc4Srjs   cmd->relativeoffset = relativeoffset;
752296c5ddc4Srjs   if (COMPAT) _mesa_glthread_DSAAttribFormat(ctx, vaobj, attribindex, size, type, relativeoffset);
752396c5ddc4Srjs}
752496c5ddc4Srjs
752596c5ddc4Srjs
752696c5ddc4Srjs/* VertexArrayAttribBinding: marshalled asynchronously */
752796c5ddc4Srjsstruct marshal_cmd_VertexArrayAttribBinding
752896c5ddc4Srjs{
752996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
753096c5ddc4Srjs   GLuint vaobj;
753196c5ddc4Srjs   GLuint attribindex;
753296c5ddc4Srjs   GLuint bindingindex;
753396c5ddc4Srjs};
753496c5ddc4Srjsuint32_t
753596c5ddc4Srjs_mesa_unmarshal_VertexArrayAttribBinding(struct gl_context *ctx, const struct marshal_cmd_VertexArrayAttribBinding *cmd, const uint64_t *last)
753696c5ddc4Srjs{
753796c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
753896c5ddc4Srjs   GLuint attribindex = cmd->attribindex;
753996c5ddc4Srjs   GLuint bindingindex = cmd->bindingindex;
754096c5ddc4Srjs   CALL_VertexArrayAttribBinding(ctx->CurrentServerDispatch, (vaobj, attribindex, bindingindex));
754196c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexArrayAttribBinding), 8) / 8);
754296c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
754396c5ddc4Srjs   return cmd_size;
754496c5ddc4Srjs}
754596c5ddc4Srjsvoid GLAPIENTRY
754696c5ddc4Srjs_mesa_marshal_VertexArrayAttribBinding(GLuint vaobj, GLuint attribindex, GLuint bindingindex)
754796c5ddc4Srjs{
754896c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
754996c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexArrayAttribBinding);
755096c5ddc4Srjs   struct marshal_cmd_VertexArrayAttribBinding *cmd;
755196c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayAttribBinding, cmd_size);
755296c5ddc4Srjs   cmd->vaobj = vaobj;
755396c5ddc4Srjs   cmd->attribindex = attribindex;
755496c5ddc4Srjs   cmd->bindingindex = bindingindex;
755596c5ddc4Srjs   if (COMPAT) _mesa_glthread_DSAAttribBinding(ctx, vaobj, attribindex, bindingindex);
755696c5ddc4Srjs}
755796c5ddc4Srjs
755896c5ddc4Srjs
755996c5ddc4Srjs/* VertexArrayBindingDivisor: marshalled asynchronously */
756096c5ddc4Srjsstruct marshal_cmd_VertexArrayBindingDivisor
756196c5ddc4Srjs{
756296c5ddc4Srjs   struct marshal_cmd_base cmd_base;
756396c5ddc4Srjs   GLuint vaobj;
756496c5ddc4Srjs   GLuint bindingindex;
756596c5ddc4Srjs   GLuint divisor;
756696c5ddc4Srjs};
756796c5ddc4Srjsuint32_t
756896c5ddc4Srjs_mesa_unmarshal_VertexArrayBindingDivisor(struct gl_context *ctx, const struct marshal_cmd_VertexArrayBindingDivisor *cmd, const uint64_t *last)
756996c5ddc4Srjs{
757096c5ddc4Srjs   GLuint vaobj = cmd->vaobj;
757196c5ddc4Srjs   GLuint bindingindex = cmd->bindingindex;
757296c5ddc4Srjs   GLuint divisor = cmd->divisor;
757396c5ddc4Srjs   CALL_VertexArrayBindingDivisor(ctx->CurrentServerDispatch, (vaobj, bindingindex, divisor));
757496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexArrayBindingDivisor), 8) / 8);
757596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
757696c5ddc4Srjs   return cmd_size;
757796c5ddc4Srjs}
757896c5ddc4Srjsvoid GLAPIENTRY
757996c5ddc4Srjs_mesa_marshal_VertexArrayBindingDivisor(GLuint vaobj, GLuint bindingindex, GLuint divisor)
758096c5ddc4Srjs{
758196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
758296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_VertexArrayBindingDivisor);
758396c5ddc4Srjs   struct marshal_cmd_VertexArrayBindingDivisor *cmd;
758496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayBindingDivisor, cmd_size);
758596c5ddc4Srjs   cmd->vaobj = vaobj;
758696c5ddc4Srjs   cmd->bindingindex = bindingindex;
758796c5ddc4Srjs   cmd->divisor = divisor;
758896c5ddc4Srjs   if (COMPAT) _mesa_glthread_DSABindingDivisor(ctx, vaobj, bindingindex, divisor);
758996c5ddc4Srjs}
759096c5ddc4Srjs
759196c5ddc4Srjs
759296c5ddc4Srjs/* GetVertexArrayiv: marshalled synchronously */
759396c5ddc4Srjsvoid GLAPIENTRY
759496c5ddc4Srjs_mesa_marshal_GetVertexArrayiv(GLuint vaobj, GLenum pname, GLint * param)
759596c5ddc4Srjs{
759696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
759796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetVertexArrayiv");
759896c5ddc4Srjs   CALL_GetVertexArrayiv(ctx->CurrentServerDispatch, (vaobj, pname, param));
759996c5ddc4Srjs}
760096c5ddc4Srjs
760196c5ddc4Srjs
760296c5ddc4Srjs/* GetVertexArrayIndexediv: marshalled synchronously */
760396c5ddc4Srjsvoid GLAPIENTRY
760496c5ddc4Srjs_mesa_marshal_GetVertexArrayIndexediv(GLuint vaobj, GLuint index, GLenum pname, GLint * param)
760596c5ddc4Srjs{
760696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
760796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetVertexArrayIndexediv");
760896c5ddc4Srjs   CALL_GetVertexArrayIndexediv(ctx->CurrentServerDispatch, (vaobj, index, pname, param));
760996c5ddc4Srjs}
761096c5ddc4Srjs
761196c5ddc4Srjs
761296c5ddc4Srjs/* GetVertexArrayIndexed64iv: marshalled synchronously */
761396c5ddc4Srjsvoid GLAPIENTRY
761496c5ddc4Srjs_mesa_marshal_GetVertexArrayIndexed64iv(GLuint vaobj, GLuint index, GLenum pname, GLint64 * param)
761596c5ddc4Srjs{
761696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
761796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "GetVertexArrayIndexed64iv");
761896c5ddc4Srjs   CALL_GetVertexArrayIndexed64iv(ctx->CurrentServerDispatch, (vaobj, index, pname, param));
761996c5ddc4Srjs}
762096c5ddc4Srjs
762196c5ddc4Srjs
762296c5ddc4Srjs/* CreateSamplers: marshalled synchronously */
762396c5ddc4Srjsvoid GLAPIENTRY
762496c5ddc4Srjs_mesa_marshal_CreateSamplers(GLsizei n, GLuint * samplers)
762596c5ddc4Srjs{
762696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
762796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CreateSamplers");
762896c5ddc4Srjs   CALL_CreateSamplers(ctx->CurrentServerDispatch, (n, samplers));
762996c5ddc4Srjs}
763096c5ddc4Srjs
763196c5ddc4Srjs
763296c5ddc4Srjs/* CreateProgramPipelines: marshalled synchronously */
763396c5ddc4Srjsvoid GLAPIENTRY
763496c5ddc4Srjs_mesa_marshal_CreateProgramPipelines(GLsizei n, GLuint * pipelines)
763596c5ddc4Srjs{
763696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
763796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CreateProgramPipelines");
763896c5ddc4Srjs   CALL_CreateProgramPipelines(ctx->CurrentServerDispatch, (n, pipelines));
763996c5ddc4Srjs}
764096c5ddc4Srjs
764196c5ddc4Srjs
764296c5ddc4Srjs/* CreateQueries: marshalled synchronously */
764396c5ddc4Srjsvoid GLAPIENTRY
764496c5ddc4Srjs_mesa_marshal_CreateQueries(GLenum target, GLsizei n, GLuint * ids)
764596c5ddc4Srjs{
764696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
764796c5ddc4Srjs   _mesa_glthread_finish_before(ctx, "CreateQueries");
764896c5ddc4Srjs   CALL_CreateQueries(ctx->CurrentServerDispatch, (target, n, ids));
764996c5ddc4Srjs}
765096c5ddc4Srjs
765196c5ddc4Srjs
765296c5ddc4Srjs/* GetQueryBufferObjectiv: marshalled asynchronously */
765396c5ddc4Srjsstruct marshal_cmd_GetQueryBufferObjectiv
765496c5ddc4Srjs{
765596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
765696c5ddc4Srjs   GLuint id;
765796c5ddc4Srjs   GLuint buffer;
765896c5ddc4Srjs   GLenum pname;
765996c5ddc4Srjs   GLintptr offset;
766096c5ddc4Srjs};
766196c5ddc4Srjsuint32_t
766296c5ddc4Srjs_mesa_unmarshal_GetQueryBufferObjectiv(struct gl_context *ctx, const struct marshal_cmd_GetQueryBufferObjectiv *cmd, const uint64_t *last)
766396c5ddc4Srjs{
766496c5ddc4Srjs   GLuint id = cmd->id;
766596c5ddc4Srjs   GLuint buffer = cmd->buffer;
766696c5ddc4Srjs   GLenum pname = cmd->pname;
766796c5ddc4Srjs   GLintptr offset = cmd->offset;
766896c5ddc4Srjs   CALL_GetQueryBufferObjectiv(ctx->CurrentServerDispatch, (id, buffer, pname, offset));
766996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetQueryBufferObjectiv), 8) / 8);
767096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
767196c5ddc4Srjs   return cmd_size;
767296c5ddc4Srjs}
767396c5ddc4Srjsvoid GLAPIENTRY
767496c5ddc4Srjs_mesa_marshal_GetQueryBufferObjectiv(GLuint id, GLuint buffer, GLenum pname, GLintptr offset)
767596c5ddc4Srjs{
767696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
767796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetQueryBufferObjectiv);
767896c5ddc4Srjs   struct marshal_cmd_GetQueryBufferObjectiv *cmd;
767996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetQueryBufferObjectiv, cmd_size);
768096c5ddc4Srjs   cmd->id = id;
768196c5ddc4Srjs   cmd->buffer = buffer;
768296c5ddc4Srjs   cmd->pname = pname;
768396c5ddc4Srjs   cmd->offset = offset;
768496c5ddc4Srjs}
768596c5ddc4Srjs
768696c5ddc4Srjs
768796c5ddc4Srjs/* GetQueryBufferObjectuiv: marshalled asynchronously */
768896c5ddc4Srjsstruct marshal_cmd_GetQueryBufferObjectuiv
768996c5ddc4Srjs{
769096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
769196c5ddc4Srjs   GLuint id;
769296c5ddc4Srjs   GLuint buffer;
769396c5ddc4Srjs   GLenum pname;
769496c5ddc4Srjs   GLintptr offset;
769596c5ddc4Srjs};
769696c5ddc4Srjsuint32_t
769796c5ddc4Srjs_mesa_unmarshal_GetQueryBufferObjectuiv(struct gl_context *ctx, const struct marshal_cmd_GetQueryBufferObjectuiv *cmd, const uint64_t *last)
769896c5ddc4Srjs{
769996c5ddc4Srjs   GLuint id = cmd->id;
770096c5ddc4Srjs   GLuint buffer = cmd->buffer;
770196c5ddc4Srjs   GLenum pname = cmd->pname;
770296c5ddc4Srjs   GLintptr offset = cmd->offset;
770396c5ddc4Srjs   CALL_GetQueryBufferObjectuiv(ctx->CurrentServerDispatch, (id, buffer, pname, offset));
770496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetQueryBufferObjectuiv), 8) / 8);
770596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
770696c5ddc4Srjs   return cmd_size;
770796c5ddc4Srjs}
770896c5ddc4Srjsvoid GLAPIENTRY
770996c5ddc4Srjs_mesa_marshal_GetQueryBufferObjectuiv(GLuint id, GLuint buffer, GLenum pname, GLintptr offset)
771096c5ddc4Srjs{
771196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
771296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetQueryBufferObjectuiv);
771396c5ddc4Srjs   struct marshal_cmd_GetQueryBufferObjectuiv *cmd;
771496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetQueryBufferObjectuiv, cmd_size);
771596c5ddc4Srjs   cmd->id = id;
771696c5ddc4Srjs   cmd->buffer = buffer;
771796c5ddc4Srjs   cmd->pname = pname;
771896c5ddc4Srjs   cmd->offset = offset;
771996c5ddc4Srjs}
772096c5ddc4Srjs
772196c5ddc4Srjs
772296c5ddc4Srjs/* GetQueryBufferObjecti64v: marshalled asynchronously */
772396c5ddc4Srjsstruct marshal_cmd_GetQueryBufferObjecti64v
772496c5ddc4Srjs{
772596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
772696c5ddc4Srjs   GLuint id;
772796c5ddc4Srjs   GLuint buffer;
772896c5ddc4Srjs   GLenum pname;
772996c5ddc4Srjs   GLintptr offset;
773096c5ddc4Srjs};
773196c5ddc4Srjsuint32_t
773296c5ddc4Srjs_mesa_unmarshal_GetQueryBufferObjecti64v(struct gl_context *ctx, const struct marshal_cmd_GetQueryBufferObjecti64v *cmd, const uint64_t *last)
773396c5ddc4Srjs{
773496c5ddc4Srjs   GLuint id = cmd->id;
773596c5ddc4Srjs   GLuint buffer = cmd->buffer;
773696c5ddc4Srjs   GLenum pname = cmd->pname;
773796c5ddc4Srjs   GLintptr offset = cmd->offset;
773896c5ddc4Srjs   CALL_GetQueryBufferObjecti64v(ctx->CurrentServerDispatch, (id, buffer, pname, offset));
773996c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetQueryBufferObjecti64v), 8) / 8);
774096c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
774196c5ddc4Srjs   return cmd_size;
774296c5ddc4Srjs}
774396c5ddc4Srjsvoid GLAPIENTRY
774496c5ddc4Srjs_mesa_marshal_GetQueryBufferObjecti64v(GLuint id, GLuint buffer, GLenum pname, GLintptr offset)
774596c5ddc4Srjs{
774696c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
774796c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetQueryBufferObjecti64v);
774896c5ddc4Srjs   struct marshal_cmd_GetQueryBufferObjecti64v *cmd;
774996c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetQueryBufferObjecti64v, cmd_size);
775096c5ddc4Srjs   cmd->id = id;
775196c5ddc4Srjs   cmd->buffer = buffer;
775296c5ddc4Srjs   cmd->pname = pname;
775396c5ddc4Srjs   cmd->offset = offset;
775496c5ddc4Srjs}
775596c5ddc4Srjs
775696c5ddc4Srjs
775796c5ddc4Srjs/* GetQueryBufferObjectui64v: marshalled asynchronously */
775896c5ddc4Srjsstruct marshal_cmd_GetQueryBufferObjectui64v
775996c5ddc4Srjs{
776096c5ddc4Srjs   struct marshal_cmd_base cmd_base;
776196c5ddc4Srjs   GLuint id;
776296c5ddc4Srjs   GLuint buffer;
776396c5ddc4Srjs   GLenum pname;
776496c5ddc4Srjs   GLintptr offset;
776596c5ddc4Srjs};
776696c5ddc4Srjsuint32_t
776796c5ddc4Srjs_mesa_unmarshal_GetQueryBufferObjectui64v(struct gl_context *ctx, const struct marshal_cmd_GetQueryBufferObjectui64v *cmd, const uint64_t *last)
776896c5ddc4Srjs{
776996c5ddc4Srjs   GLuint id = cmd->id;
777096c5ddc4Srjs   GLuint buffer = cmd->buffer;
777196c5ddc4Srjs   GLenum pname = cmd->pname;
777296c5ddc4Srjs   GLintptr offset = cmd->offset;
777396c5ddc4Srjs   CALL_GetQueryBufferObjectui64v(ctx->CurrentServerDispatch, (id, buffer, pname, offset));
777496c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetQueryBufferObjectui64v), 8) / 8);
777596c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
777696c5ddc4Srjs   return cmd_size;
777796c5ddc4Srjs}
777896c5ddc4Srjsvoid GLAPIENTRY
777996c5ddc4Srjs_mesa_marshal_GetQueryBufferObjectui64v(GLuint id, GLuint buffer, GLenum pname, GLintptr offset)
778096c5ddc4Srjs{
778196c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
778296c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetQueryBufferObjectui64v);
778396c5ddc4Srjs   struct marshal_cmd_GetQueryBufferObjectui64v *cmd;
778496c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetQueryBufferObjectui64v, cmd_size);
778596c5ddc4Srjs   cmd->id = id;
778696c5ddc4Srjs   cmd->buffer = buffer;
778796c5ddc4Srjs   cmd->pname = pname;
778896c5ddc4Srjs   cmd->offset = offset;
778996c5ddc4Srjs}
779096c5ddc4Srjs
779196c5ddc4Srjs
779296c5ddc4Srjs/* GetTextureSubImage: marshalled asynchronously */
779396c5ddc4Srjsstruct marshal_cmd_GetTextureSubImage
779496c5ddc4Srjs{
779596c5ddc4Srjs   struct marshal_cmd_base cmd_base;
779696c5ddc4Srjs   GLuint texture;
779796c5ddc4Srjs   GLint level;
779896c5ddc4Srjs   GLint xoffset;
779996c5ddc4Srjs   GLint yoffset;
780096c5ddc4Srjs   GLint zoffset;
780196c5ddc4Srjs   GLsizei width;
780296c5ddc4Srjs   GLsizei height;
780396c5ddc4Srjs   GLsizei depth;
780496c5ddc4Srjs   GLenum format;
780596c5ddc4Srjs   GLenum type;
780696c5ddc4Srjs   GLsizei bufSize;
780796c5ddc4Srjs   GLvoid * pixels;
780896c5ddc4Srjs};
780996c5ddc4Srjsuint32_t
781096c5ddc4Srjs_mesa_unmarshal_GetTextureSubImage(struct gl_context *ctx, const struct marshal_cmd_GetTextureSubImage *cmd, const uint64_t *last)
781196c5ddc4Srjs{
781296c5ddc4Srjs   GLuint texture = cmd->texture;
781396c5ddc4Srjs   GLint level = cmd->level;
781496c5ddc4Srjs   GLint xoffset = cmd->xoffset;
781596c5ddc4Srjs   GLint yoffset = cmd->yoffset;
781696c5ddc4Srjs   GLint zoffset = cmd->zoffset;
781796c5ddc4Srjs   GLsizei width = cmd->width;
781896c5ddc4Srjs   GLsizei height = cmd->height;
781996c5ddc4Srjs   GLsizei depth = cmd->depth;
782096c5ddc4Srjs   GLenum format = cmd->format;
782196c5ddc4Srjs   GLenum type = cmd->type;
782296c5ddc4Srjs   GLsizei bufSize = cmd->bufSize;
782396c5ddc4Srjs   GLvoid * pixels = cmd->pixels;
782496c5ddc4Srjs   CALL_GetTextureSubImage(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, pixels));
782596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetTextureSubImage), 8) / 8);
782696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
782796c5ddc4Srjs   return cmd_size;
782896c5ddc4Srjs}
782996c5ddc4Srjsvoid GLAPIENTRY
783096c5ddc4Srjs_mesa_marshal_GetTextureSubImage(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei bufSize, GLvoid * pixels)
783196c5ddc4Srjs{
783296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
783396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetTextureSubImage);
783496c5ddc4Srjs   struct marshal_cmd_GetTextureSubImage *cmd;
783596c5ddc4Srjs   if (_mesa_glthread_has_no_pack_buffer(ctx)) {
783696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "GetTextureSubImage");
783796c5ddc4Srjs      CALL_GetTextureSubImage(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, pixels));
783896c5ddc4Srjs      return;
783996c5ddc4Srjs   }
784096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetTextureSubImage, cmd_size);
784196c5ddc4Srjs   cmd->texture = texture;
784296c5ddc4Srjs   cmd->level = level;
784396c5ddc4Srjs   cmd->xoffset = xoffset;
784496c5ddc4Srjs   cmd->yoffset = yoffset;
784596c5ddc4Srjs   cmd->zoffset = zoffset;
784696c5ddc4Srjs   cmd->width = width;
784796c5ddc4Srjs   cmd->height = height;
784896c5ddc4Srjs   cmd->depth = depth;
784996c5ddc4Srjs   cmd->format = format;
785096c5ddc4Srjs   cmd->type = type;
785196c5ddc4Srjs   cmd->bufSize = bufSize;
785296c5ddc4Srjs   cmd->pixels = pixels;
785396c5ddc4Srjs}
785496c5ddc4Srjs
785596c5ddc4Srjs
785696c5ddc4Srjs/* GetCompressedTextureSubImage: marshalled asynchronously */
785796c5ddc4Srjsstruct marshal_cmd_GetCompressedTextureSubImage
785896c5ddc4Srjs{
785996c5ddc4Srjs   struct marshal_cmd_base cmd_base;
786096c5ddc4Srjs   GLuint texture;
786196c5ddc4Srjs   GLint level;
786296c5ddc4Srjs   GLint xoffset;
786396c5ddc4Srjs   GLint yoffset;
786496c5ddc4Srjs   GLint zoffset;
786596c5ddc4Srjs   GLsizei width;
786696c5ddc4Srjs   GLsizei height;
786796c5ddc4Srjs   GLsizei depth;
786896c5ddc4Srjs   GLsizei bufSize;
786996c5ddc4Srjs   GLvoid * pixels;
787096c5ddc4Srjs};
787196c5ddc4Srjsuint32_t
787296c5ddc4Srjs_mesa_unmarshal_GetCompressedTextureSubImage(struct gl_context *ctx, const struct marshal_cmd_GetCompressedTextureSubImage *cmd, const uint64_t *last)
787396c5ddc4Srjs{
787496c5ddc4Srjs   GLuint texture = cmd->texture;
787596c5ddc4Srjs   GLint level = cmd->level;
787696c5ddc4Srjs   GLint xoffset = cmd->xoffset;
787796c5ddc4Srjs   GLint yoffset = cmd->yoffset;
787896c5ddc4Srjs   GLint zoffset = cmd->zoffset;
787996c5ddc4Srjs   GLsizei width = cmd->width;
788096c5ddc4Srjs   GLsizei height = cmd->height;
788196c5ddc4Srjs   GLsizei depth = cmd->depth;
788296c5ddc4Srjs   GLsizei bufSize = cmd->bufSize;
788396c5ddc4Srjs   GLvoid * pixels = cmd->pixels;
788496c5ddc4Srjs   CALL_GetCompressedTextureSubImage(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth, bufSize, pixels));
788596c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GetCompressedTextureSubImage), 8) / 8);
788696c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
788796c5ddc4Srjs   return cmd_size;
788896c5ddc4Srjs}
788996c5ddc4Srjsvoid GLAPIENTRY
789096c5ddc4Srjs_mesa_marshal_GetCompressedTextureSubImage(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, GLvoid * pixels)
789196c5ddc4Srjs{
789296c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
789396c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_GetCompressedTextureSubImage);
789496c5ddc4Srjs   struct marshal_cmd_GetCompressedTextureSubImage *cmd;
789596c5ddc4Srjs   if (_mesa_glthread_has_no_pack_buffer(ctx)) {
789696c5ddc4Srjs      _mesa_glthread_finish_before(ctx, "GetCompressedTextureSubImage");
789796c5ddc4Srjs      CALL_GetCompressedTextureSubImage(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth, bufSize, pixels));
789896c5ddc4Srjs      return;
789996c5ddc4Srjs   }
790096c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetCompressedTextureSubImage, cmd_size);
790196c5ddc4Srjs   cmd->texture = texture;
790296c5ddc4Srjs   cmd->level = level;
790396c5ddc4Srjs   cmd->xoffset = xoffset;
790496c5ddc4Srjs   cmd->yoffset = yoffset;
790596c5ddc4Srjs   cmd->zoffset = zoffset;
790696c5ddc4Srjs   cmd->width = width;
790796c5ddc4Srjs   cmd->height = height;
790896c5ddc4Srjs   cmd->depth = depth;
790996c5ddc4Srjs   cmd->bufSize = bufSize;
791096c5ddc4Srjs   cmd->pixels = pixels;
791196c5ddc4Srjs}
791296c5ddc4Srjs
791396c5ddc4Srjs
791496c5ddc4Srjs/* TextureBarrierNV: marshalled asynchronously */
791596c5ddc4Srjsstruct marshal_cmd_TextureBarrierNV
791696c5ddc4Srjs{
791796c5ddc4Srjs   struct marshal_cmd_base cmd_base;
791896c5ddc4Srjs};
791996c5ddc4Srjsuint32_t
792096c5ddc4Srjs_mesa_unmarshal_TextureBarrierNV(struct gl_context *ctx, const struct marshal_cmd_TextureBarrierNV *cmd, const uint64_t *last)
792196c5ddc4Srjs{
792296c5ddc4Srjs   CALL_TextureBarrierNV(ctx->CurrentServerDispatch, ());
792396c5ddc4Srjs   const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureBarrierNV), 8) / 8);
792496c5ddc4Srjs   assert (cmd_size == cmd->cmd_base.cmd_size);
792596c5ddc4Srjs   return cmd_size;
792696c5ddc4Srjs}
792796c5ddc4Srjsvoid GLAPIENTRY
792896c5ddc4Srjs_mesa_marshal_TextureBarrierNV(void)
792996c5ddc4Srjs{
793096c5ddc4Srjs   GET_CURRENT_CONTEXT(ctx);
793196c5ddc4Srjs   int cmd_size = sizeof(struct marshal_cmd_TextureBarrierNV);
793296c5ddc4Srjs   struct marshal_cmd_TextureBarrierNV *cmd;
793396c5ddc4Srjs   cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureBarrierNV, cmd_size);
793496c5ddc4Srjs   (void) cmd;
793596c5ddc4Srjs}
793696c5ddc4Srjs
793796c5ddc4Srjs
7938