Home | History | Annotate | Download | only in main
      1 /* DO NOT EDIT - This file generated automatically by gl_marshal.py script */
      2 
      3 /*
      4  * Copyright (C) 2012 Intel Corporation
      5  * All Rights Reserved.
      6  *
      7  * Permission is hereby granted, free of charge, to any person obtaining a
      8  * copy of this software and associated documentation files (the "Software"),
      9  * to deal in the Software without restriction, including without limitation
     10  * the rights to use, copy, modify, merge, publish, distribute, sub license,
     11  * and/or sell copies of the Software, and to permit persons to whom the
     12  * Software is furnished to do so, subject to the following conditions:
     13  *
     14  * The above copyright notice and this permission notice (including the next
     15  * paragraph) shall be included in all copies or substantial portions of the
     16  * Software.
     17  *
     18  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     19  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     20  * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
     21  * INTEL CORPORATION,
     22  * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
     23  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
     24  * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
     25  * SOFTWARE.
     26  */
     27 
     28 
     29 #include "api_exec.h"
     30 #include "context.h"
     31 #include "dispatch.h"
     32 #include "glthread.h"
     33 #include "marshal.h"
     34 #include "marshal_generated.h"
     35 
     36 static inline int safe_mul(int a, int b)
     37 {
     38     if (a < 0 || b < 0) return -1;
     39     if (a == 0 || b == 0) return 0;
     40     if (a > INT_MAX / b) return -1;
     41     return a * b;
     42 }
     43 
     44 /* MapGrid1d: marshalled asynchronously */
     45 struct marshal_cmd_MapGrid1d
     46 {
     47    struct marshal_cmd_base cmd_base;
     48    GLint un;
     49    GLdouble u1;
     50    GLdouble u2;
     51 };
     52 static inline void
     53 _mesa_unmarshal_MapGrid1d(struct gl_context *ctx, const struct marshal_cmd_MapGrid1d *cmd)
     54 {
     55    const GLint un = cmd->un;
     56    const GLdouble u1 = cmd->u1;
     57    const GLdouble u2 = cmd->u2;
     58    CALL_MapGrid1d(ctx->CurrentServerDispatch, (un, u1, u2));
     59 }
     60 static void GLAPIENTRY
     61 _mesa_marshal_MapGrid1d(GLint un, GLdouble u1, GLdouble u2)
     62 {
     63    GET_CURRENT_CONTEXT(ctx);
     64    size_t cmd_size = sizeof(struct marshal_cmd_MapGrid1d);
     65    struct marshal_cmd_MapGrid1d *cmd;
     66    debug_print_marshal("MapGrid1d");
     67    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
     68       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MapGrid1d, cmd_size);
     69       cmd->un = un;
     70       cmd->u1 = u1;
     71       cmd->u2 = u2;
     72       _mesa_post_marshal_hook(ctx);
     73       return;
     74    }
     75 
     76    _mesa_glthread_finish(ctx);
     77    debug_print_sync_fallback("MapGrid1d");
     78    CALL_MapGrid1d(ctx->CurrentServerDispatch, (un, u1, u2));
     79 }
     80 
     81 
     82 /* MapGrid1f: marshalled asynchronously */
     83 struct marshal_cmd_MapGrid1f
     84 {
     85    struct marshal_cmd_base cmd_base;
     86    GLint un;
     87    GLfloat u1;
     88    GLfloat u2;
     89 };
     90 static inline void
     91 _mesa_unmarshal_MapGrid1f(struct gl_context *ctx, const struct marshal_cmd_MapGrid1f *cmd)
     92 {
     93    const GLint un = cmd->un;
     94    const GLfloat u1 = cmd->u1;
     95    const GLfloat u2 = cmd->u2;
     96    CALL_MapGrid1f(ctx->CurrentServerDispatch, (un, u1, u2));
     97 }
     98 static void GLAPIENTRY
     99 _mesa_marshal_MapGrid1f(GLint un, GLfloat u1, GLfloat u2)
    100 {
    101    GET_CURRENT_CONTEXT(ctx);
    102    size_t cmd_size = sizeof(struct marshal_cmd_MapGrid1f);
    103    struct marshal_cmd_MapGrid1f *cmd;
    104    debug_print_marshal("MapGrid1f");
    105    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    106       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MapGrid1f, cmd_size);
    107       cmd->un = un;
    108       cmd->u1 = u1;
    109       cmd->u2 = u2;
    110       _mesa_post_marshal_hook(ctx);
    111       return;
    112    }
    113 
    114    _mesa_glthread_finish(ctx);
    115    debug_print_sync_fallback("MapGrid1f");
    116    CALL_MapGrid1f(ctx->CurrentServerDispatch, (un, u1, u2));
    117 }
    118 
    119 
    120 /* ProgramUniform3i64vARB: marshalled asynchronously */
    121 struct marshal_cmd_ProgramUniform3i64vARB
    122 {
    123    struct marshal_cmd_base cmd_base;
    124    GLuint program;
    125    GLint location;
    126    GLsizei count;
    127    /* Next safe_mul(count, 24) bytes are GLint64 value[count][3] */
    128 };
    129 static inline void
    130 _mesa_unmarshal_ProgramUniform3i64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3i64vARB *cmd)
    131 {
    132    const GLuint program = cmd->program;
    133    const GLint location = cmd->location;
    134    const GLsizei count = cmd->count;
    135    const GLint64 * value;
    136    const char *variable_data = (const char *) (cmd + 1);
    137    value = (const GLint64 *) variable_data;
    138    variable_data += count * 24;
    139    CALL_ProgramUniform3i64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
    140 }
    141 static void GLAPIENTRY
    142 _mesa_marshal_ProgramUniform3i64vARB(GLuint program, GLint location, GLsizei count, const GLint64 * value)
    143 {
    144    GET_CURRENT_CONTEXT(ctx);
    145    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform3i64vARB) + safe_mul(count, 24);
    146    struct marshal_cmd_ProgramUniform3i64vARB *cmd;
    147    debug_print_marshal("ProgramUniform3i64vARB");
    148    if (unlikely(safe_mul(count, 24) < 0)) {
    149       goto fallback_to_sync;
    150    }
    151    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    152       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3i64vARB, cmd_size);
    153       cmd->program = program;
    154       cmd->location = location;
    155       cmd->count = count;
    156       char *variable_data = (char *) (cmd + 1);
    157       memcpy(variable_data, value, count * 24);
    158       variable_data += count * 24;
    159       _mesa_post_marshal_hook(ctx);
    160       return;
    161    }
    162 
    163 fallback_to_sync:
    164    _mesa_glthread_finish(ctx);
    165    debug_print_sync_fallback("ProgramUniform3i64vARB");
    166    CALL_ProgramUniform3i64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
    167 }
    168 
    169 
    170 /* GetProgramResourceLocationIndex: marshalled synchronously */
    171 static GLint GLAPIENTRY
    172 _mesa_marshal_GetProgramResourceLocationIndex(GLuint program, GLenum programInterface, const GLchar * name)
    173 {
    174    GET_CURRENT_CONTEXT(ctx);
    175    _mesa_glthread_finish(ctx);
    176    debug_print_sync("GetProgramResourceLocationIndex");
    177    return CALL_GetProgramResourceLocationIndex(ctx->CurrentServerDispatch, (program, programInterface, name));
    178 }
    179 
    180 
    181 /* TexCoordP1ui: marshalled asynchronously */
    182 struct marshal_cmd_TexCoordP1ui
    183 {
    184    struct marshal_cmd_base cmd_base;
    185    GLenum type;
    186    GLuint coords;
    187 };
    188 static inline void
    189 _mesa_unmarshal_TexCoordP1ui(struct gl_context *ctx, const struct marshal_cmd_TexCoordP1ui *cmd)
    190 {
    191    const GLenum type = cmd->type;
    192    const GLuint coords = cmd->coords;
    193    CALL_TexCoordP1ui(ctx->CurrentServerDispatch, (type, coords));
    194 }
    195 static void GLAPIENTRY
    196 _mesa_marshal_TexCoordP1ui(GLenum type, GLuint coords)
    197 {
    198    GET_CURRENT_CONTEXT(ctx);
    199    size_t cmd_size = sizeof(struct marshal_cmd_TexCoordP1ui);
    200    struct marshal_cmd_TexCoordP1ui *cmd;
    201    debug_print_marshal("TexCoordP1ui");
    202    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    203       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP1ui, cmd_size);
    204       cmd->type = type;
    205       cmd->coords = coords;
    206       _mesa_post_marshal_hook(ctx);
    207       return;
    208    }
    209 
    210    _mesa_glthread_finish(ctx);
    211    debug_print_sync_fallback("TexCoordP1ui");
    212    CALL_TexCoordP1ui(ctx->CurrentServerDispatch, (type, coords));
    213 }
    214 
    215 
    216 /* PolygonStipple: marshalled synchronously */
    217 static void GLAPIENTRY
    218 _mesa_marshal_PolygonStipple(const GLubyte * mask)
    219 {
    220    GET_CURRENT_CONTEXT(ctx);
    221    _mesa_glthread_finish(ctx);
    222    debug_print_sync("PolygonStipple");
    223    CALL_PolygonStipple(ctx->CurrentServerDispatch, (mask));
    224 }
    225 
    226 
    227 /* MultiTexCoord1dv: marshalled asynchronously */
    228 struct marshal_cmd_MultiTexCoord1dv
    229 {
    230    struct marshal_cmd_base cmd_base;
    231    GLenum target;
    232    GLdouble v[1];
    233 };
    234 static inline void
    235 _mesa_unmarshal_MultiTexCoord1dv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1dv *cmd)
    236 {
    237    const GLenum target = cmd->target;
    238    const GLdouble * v = cmd->v;
    239    CALL_MultiTexCoord1dv(ctx->CurrentServerDispatch, (target, v));
    240 }
    241 static void GLAPIENTRY
    242 _mesa_marshal_MultiTexCoord1dv(GLenum target, const GLdouble * v)
    243 {
    244    GET_CURRENT_CONTEXT(ctx);
    245    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1dv);
    246    struct marshal_cmd_MultiTexCoord1dv *cmd;
    247    debug_print_marshal("MultiTexCoord1dv");
    248    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    249       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1dv, cmd_size);
    250       cmd->target = target;
    251       memcpy(cmd->v, v, 8);
    252       _mesa_post_marshal_hook(ctx);
    253       return;
    254    }
    255 
    256    _mesa_glthread_finish(ctx);
    257    debug_print_sync_fallback("MultiTexCoord1dv");
    258    CALL_MultiTexCoord1dv(ctx->CurrentServerDispatch, (target, v));
    259 }
    260 
    261 
    262 /* IsEnabled: marshalled synchronously */
    263 static GLboolean GLAPIENTRY
    264 _mesa_marshal_IsEnabled(GLenum cap)
    265 {
    266    GET_CURRENT_CONTEXT(ctx);
    267    _mesa_glthread_finish(ctx);
    268    debug_print_sync("IsEnabled");
    269    return CALL_IsEnabled(ctx->CurrentServerDispatch, (cap));
    270 }
    271 
    272 
    273 /* AttachShader: marshalled asynchronously */
    274 struct marshal_cmd_AttachShader
    275 {
    276    struct marshal_cmd_base cmd_base;
    277    GLuint program;
    278    GLuint shader;
    279 };
    280 static inline void
    281 _mesa_unmarshal_AttachShader(struct gl_context *ctx, const struct marshal_cmd_AttachShader *cmd)
    282 {
    283    const GLuint program = cmd->program;
    284    const GLuint shader = cmd->shader;
    285    CALL_AttachShader(ctx->CurrentServerDispatch, (program, shader));
    286 }
    287 static void GLAPIENTRY
    288 _mesa_marshal_AttachShader(GLuint program, GLuint shader)
    289 {
    290    GET_CURRENT_CONTEXT(ctx);
    291    size_t cmd_size = sizeof(struct marshal_cmd_AttachShader);
    292    struct marshal_cmd_AttachShader *cmd;
    293    debug_print_marshal("AttachShader");
    294    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    295       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_AttachShader, cmd_size);
    296       cmd->program = program;
    297       cmd->shader = shader;
    298       _mesa_post_marshal_hook(ctx);
    299       return;
    300    }
    301 
    302    _mesa_glthread_finish(ctx);
    303    debug_print_sync_fallback("AttachShader");
    304    CALL_AttachShader(ctx->CurrentServerDispatch, (program, shader));
    305 }
    306 
    307 
    308 /* VertexAttrib3fARB: marshalled asynchronously */
    309 struct marshal_cmd_VertexAttrib3fARB
    310 {
    311    struct marshal_cmd_base cmd_base;
    312    GLuint index;
    313    GLfloat x;
    314    GLfloat y;
    315    GLfloat z;
    316 };
    317 static inline void
    318 _mesa_unmarshal_VertexAttrib3fARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3fARB *cmd)
    319 {
    320    const GLuint index = cmd->index;
    321    const GLfloat x = cmd->x;
    322    const GLfloat y = cmd->y;
    323    const GLfloat z = cmd->z;
    324    CALL_VertexAttrib3fARB(ctx->CurrentServerDispatch, (index, x, y, z));
    325 }
    326 static void GLAPIENTRY
    327 _mesa_marshal_VertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z)
    328 {
    329    GET_CURRENT_CONTEXT(ctx);
    330    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib3fARB);
    331    struct marshal_cmd_VertexAttrib3fARB *cmd;
    332    debug_print_marshal("VertexAttrib3fARB");
    333    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    334       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3fARB, cmd_size);
    335       cmd->index = index;
    336       cmd->x = x;
    337       cmd->y = y;
    338       cmd->z = z;
    339       _mesa_post_marshal_hook(ctx);
    340       return;
    341    }
    342 
    343    _mesa_glthread_finish(ctx);
    344    debug_print_sync_fallback("VertexAttrib3fARB");
    345    CALL_VertexAttrib3fARB(ctx->CurrentServerDispatch, (index, x, y, z));
    346 }
    347 
    348 
    349 /* Indexubv: marshalled asynchronously */
    350 struct marshal_cmd_Indexubv
    351 {
    352    struct marshal_cmd_base cmd_base;
    353    GLubyte c[1];
    354 };
    355 static inline void
    356 _mesa_unmarshal_Indexubv(struct gl_context *ctx, const struct marshal_cmd_Indexubv *cmd)
    357 {
    358    const GLubyte * c = cmd->c;
    359    CALL_Indexubv(ctx->CurrentServerDispatch, (c));
    360 }
    361 static void GLAPIENTRY
    362 _mesa_marshal_Indexubv(const GLubyte * c)
    363 {
    364    GET_CURRENT_CONTEXT(ctx);
    365    size_t cmd_size = sizeof(struct marshal_cmd_Indexubv);
    366    struct marshal_cmd_Indexubv *cmd;
    367    debug_print_marshal("Indexubv");
    368    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    369       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Indexubv, cmd_size);
    370       memcpy(cmd->c, c, 1);
    371       _mesa_post_marshal_hook(ctx);
    372       return;
    373    }
    374 
    375    _mesa_glthread_finish(ctx);
    376    debug_print_sync_fallback("Indexubv");
    377    CALL_Indexubv(ctx->CurrentServerDispatch, (c));
    378 }
    379 
    380 
    381 /* GetCompressedTextureImage: marshalled synchronously */
    382 static void GLAPIENTRY
    383 _mesa_marshal_GetCompressedTextureImage(GLuint texture, GLint level, GLsizei bufSize, GLvoid * pixels)
    384 {
    385    GET_CURRENT_CONTEXT(ctx);
    386    _mesa_glthread_finish(ctx);
    387    debug_print_sync("GetCompressedTextureImage");
    388    CALL_GetCompressedTextureImage(ctx->CurrentServerDispatch, (texture, level, bufSize, pixels));
    389 }
    390 
    391 
    392 /* MultiTexCoordP3uiv: marshalled synchronously */
    393 static void GLAPIENTRY
    394 _mesa_marshal_MultiTexCoordP3uiv(GLenum texture, GLenum type, const GLuint * coords)
    395 {
    396    GET_CURRENT_CONTEXT(ctx);
    397    _mesa_glthread_finish(ctx);
    398    debug_print_sync("MultiTexCoordP3uiv");
    399    CALL_MultiTexCoordP3uiv(ctx->CurrentServerDispatch, (texture, type, coords));
    400 }
    401 
    402 
    403 /* VertexAttribI4usv: marshalled synchronously */
    404 static void GLAPIENTRY
    405 _mesa_marshal_VertexAttribI4usv(GLuint index, const GLushort * v)
    406 {
    407    GET_CURRENT_CONTEXT(ctx);
    408    _mesa_glthread_finish(ctx);
    409    debug_print_sync("VertexAttribI4usv");
    410    CALL_VertexAttribI4usv(ctx->CurrentServerDispatch, (index, v));
    411 }
    412 
    413 
    414 /* Color3ubv: marshalled asynchronously */
    415 struct marshal_cmd_Color3ubv
    416 {
    417    struct marshal_cmd_base cmd_base;
    418    GLubyte v[3];
    419 };
    420 static inline void
    421 _mesa_unmarshal_Color3ubv(struct gl_context *ctx, const struct marshal_cmd_Color3ubv *cmd)
    422 {
    423    const GLubyte * v = cmd->v;
    424    CALL_Color3ubv(ctx->CurrentServerDispatch, (v));
    425 }
    426 static void GLAPIENTRY
    427 _mesa_marshal_Color3ubv(const GLubyte * v)
    428 {
    429    GET_CURRENT_CONTEXT(ctx);
    430    size_t cmd_size = sizeof(struct marshal_cmd_Color3ubv);
    431    struct marshal_cmd_Color3ubv *cmd;
    432    debug_print_marshal("Color3ubv");
    433    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    434       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3ubv, cmd_size);
    435       memcpy(cmd->v, v, 3);
    436       _mesa_post_marshal_hook(ctx);
    437       return;
    438    }
    439 
    440    _mesa_glthread_finish(ctx);
    441    debug_print_sync_fallback("Color3ubv");
    442    CALL_Color3ubv(ctx->CurrentServerDispatch, (v));
    443 }
    444 
    445 
    446 /* GetClipPlanex: marshalled synchronously */
    447 static void GLAPIENTRY
    448 _mesa_marshal_GetClipPlanex(GLenum plane, GLfixed * equation)
    449 {
    450    GET_CURRENT_CONTEXT(ctx);
    451    _mesa_glthread_finish(ctx);
    452    debug_print_sync("GetClipPlanex");
    453    CALL_GetClipPlanex(ctx->CurrentServerDispatch, (plane, equation));
    454 }
    455 
    456 
    457 /* ProgramUniform2ui: marshalled asynchronously */
    458 struct marshal_cmd_ProgramUniform2ui
    459 {
    460    struct marshal_cmd_base cmd_base;
    461    GLuint program;
    462    GLint location;
    463    GLuint x;
    464    GLuint y;
    465 };
    466 static inline void
    467 _mesa_unmarshal_ProgramUniform2ui(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2ui *cmd)
    468 {
    469    const GLuint program = cmd->program;
    470    const GLint location = cmd->location;
    471    const GLuint x = cmd->x;
    472    const GLuint y = cmd->y;
    473    CALL_ProgramUniform2ui(ctx->CurrentServerDispatch, (program, location, x, y));
    474 }
    475 static void GLAPIENTRY
    476 _mesa_marshal_ProgramUniform2ui(GLuint program, GLint location, GLuint x, GLuint y)
    477 {
    478    GET_CURRENT_CONTEXT(ctx);
    479    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform2ui);
    480    struct marshal_cmd_ProgramUniform2ui *cmd;
    481    debug_print_marshal("ProgramUniform2ui");
    482    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    483       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2ui, cmd_size);
    484       cmd->program = program;
    485       cmd->location = location;
    486       cmd->x = x;
    487       cmd->y = y;
    488       _mesa_post_marshal_hook(ctx);
    489       return;
    490    }
    491 
    492    _mesa_glthread_finish(ctx);
    493    debug_print_sync_fallback("ProgramUniform2ui");
    494    CALL_ProgramUniform2ui(ctx->CurrentServerDispatch, (program, location, x, y));
    495 }
    496 
    497 
    498 /* TexCoordP1uiv: marshalled synchronously */
    499 static void GLAPIENTRY
    500 _mesa_marshal_TexCoordP1uiv(GLenum type, const GLuint * coords)
    501 {
    502    GET_CURRENT_CONTEXT(ctx);
    503    _mesa_glthread_finish(ctx);
    504    debug_print_sync("TexCoordP1uiv");
    505    CALL_TexCoordP1uiv(ctx->CurrentServerDispatch, (type, coords));
    506 }
    507 
    508 
    509 /* RenderbufferStorage: marshalled asynchronously */
    510 struct marshal_cmd_RenderbufferStorage
    511 {
    512    struct marshal_cmd_base cmd_base;
    513    GLenum target;
    514    GLenum internalformat;
    515    GLsizei width;
    516    GLsizei height;
    517 };
    518 static inline void
    519 _mesa_unmarshal_RenderbufferStorage(struct gl_context *ctx, const struct marshal_cmd_RenderbufferStorage *cmd)
    520 {
    521    const GLenum target = cmd->target;
    522    const GLenum internalformat = cmd->internalformat;
    523    const GLsizei width = cmd->width;
    524    const GLsizei height = cmd->height;
    525    CALL_RenderbufferStorage(ctx->CurrentServerDispatch, (target, internalformat, width, height));
    526 }
    527 static void GLAPIENTRY
    528 _mesa_marshal_RenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
    529 {
    530    GET_CURRENT_CONTEXT(ctx);
    531    size_t cmd_size = sizeof(struct marshal_cmd_RenderbufferStorage);
    532    struct marshal_cmd_RenderbufferStorage *cmd;
    533    debug_print_marshal("RenderbufferStorage");
    534    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    535       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RenderbufferStorage, cmd_size);
    536       cmd->target = target;
    537       cmd->internalformat = internalformat;
    538       cmd->width = width;
    539       cmd->height = height;
    540       _mesa_post_marshal_hook(ctx);
    541       return;
    542    }
    543 
    544    _mesa_glthread_finish(ctx);
    545    debug_print_sync_fallback("RenderbufferStorage");
    546    CALL_RenderbufferStorage(ctx->CurrentServerDispatch, (target, internalformat, width, height));
    547 }
    548 
    549 
    550 /* GetClipPlanef: marshalled synchronously */
    551 static void GLAPIENTRY
    552 _mesa_marshal_GetClipPlanef(GLenum plane, GLfloat * equation)
    553 {
    554    GET_CURRENT_CONTEXT(ctx);
    555    _mesa_glthread_finish(ctx);
    556    debug_print_sync("GetClipPlanef");
    557    CALL_GetClipPlanef(ctx->CurrentServerDispatch, (plane, equation));
    558 }
    559 
    560 
    561 /* GetPerfQueryDataINTEL: marshalled synchronously */
    562 static void GLAPIENTRY
    563 _mesa_marshal_GetPerfQueryDataINTEL(GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid * data, GLuint * bytesWritten)
    564 {
    565    GET_CURRENT_CONTEXT(ctx);
    566    _mesa_glthread_finish(ctx);
    567    debug_print_sync("GetPerfQueryDataINTEL");
    568    CALL_GetPerfQueryDataINTEL(ctx->CurrentServerDispatch, (queryHandle, flags, dataSize, data, bytesWritten));
    569 }
    570 
    571 
    572 /* DrawArraysIndirect: marshalled synchronously */
    573 static void GLAPIENTRY
    574 _mesa_marshal_DrawArraysIndirect(GLenum mode, const GLvoid * indirect)
    575 {
    576    GET_CURRENT_CONTEXT(ctx);
    577    _mesa_glthread_finish(ctx);
    578    debug_print_sync("DrawArraysIndirect");
    579    CALL_DrawArraysIndirect(ctx->CurrentServerDispatch, (mode, indirect));
    580 }
    581 
    582 
    583 /* Uniform3i: marshalled asynchronously */
    584 struct marshal_cmd_Uniform3i
    585 {
    586    struct marshal_cmd_base cmd_base;
    587    GLint location;
    588    GLint v0;
    589    GLint v1;
    590    GLint v2;
    591 };
    592 static inline void
    593 _mesa_unmarshal_Uniform3i(struct gl_context *ctx, const struct marshal_cmd_Uniform3i *cmd)
    594 {
    595    const GLint location = cmd->location;
    596    const GLint v0 = cmd->v0;
    597    const GLint v1 = cmd->v1;
    598    const GLint v2 = cmd->v2;
    599    CALL_Uniform3i(ctx->CurrentServerDispatch, (location, v0, v1, v2));
    600 }
    601 static void GLAPIENTRY
    602 _mesa_marshal_Uniform3i(GLint location, GLint v0, GLint v1, GLint v2)
    603 {
    604    GET_CURRENT_CONTEXT(ctx);
    605    size_t cmd_size = sizeof(struct marshal_cmd_Uniform3i);
    606    struct marshal_cmd_Uniform3i *cmd;
    607    debug_print_marshal("Uniform3i");
    608    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    609       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3i, cmd_size);
    610       cmd->location = location;
    611       cmd->v0 = v0;
    612       cmd->v1 = v1;
    613       cmd->v2 = v2;
    614       _mesa_post_marshal_hook(ctx);
    615       return;
    616    }
    617 
    618    _mesa_glthread_finish(ctx);
    619    debug_print_sync_fallback("Uniform3i");
    620    CALL_Uniform3i(ctx->CurrentServerDispatch, (location, v0, v1, v2));
    621 }
    622 
    623 
    624 /* VDPAUGetSurfaceivNV: marshalled synchronously */
    625 static void GLAPIENTRY
    626 _mesa_marshal_VDPAUGetSurfaceivNV(GLintptr surface, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values)
    627 {
    628    GET_CURRENT_CONTEXT(ctx);
    629    _mesa_glthread_finish(ctx);
    630    debug_print_sync("VDPAUGetSurfaceivNV");
    631    CALL_VDPAUGetSurfaceivNV(ctx->CurrentServerDispatch, (surface, pname, bufSize, length, values));
    632 }
    633 
    634 
    635 /* Uniform3d: marshalled asynchronously */
    636 struct marshal_cmd_Uniform3d
    637 {
    638    struct marshal_cmd_base cmd_base;
    639    GLint location;
    640    GLdouble x;
    641    GLdouble y;
    642    GLdouble z;
    643 };
    644 static inline void
    645 _mesa_unmarshal_Uniform3d(struct gl_context *ctx, const struct marshal_cmd_Uniform3d *cmd)
    646 {
    647    const GLint location = cmd->location;
    648    const GLdouble x = cmd->x;
    649    const GLdouble y = cmd->y;
    650    const GLdouble z = cmd->z;
    651    CALL_Uniform3d(ctx->CurrentServerDispatch, (location, x, y, z));
    652 }
    653 static void GLAPIENTRY
    654 _mesa_marshal_Uniform3d(GLint location, GLdouble x, GLdouble y, GLdouble z)
    655 {
    656    GET_CURRENT_CONTEXT(ctx);
    657    size_t cmd_size = sizeof(struct marshal_cmd_Uniform3d);
    658    struct marshal_cmd_Uniform3d *cmd;
    659    debug_print_marshal("Uniform3d");
    660    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    661       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3d, cmd_size);
    662       cmd->location = location;
    663       cmd->x = x;
    664       cmd->y = y;
    665       cmd->z = z;
    666       _mesa_post_marshal_hook(ctx);
    667       return;
    668    }
    669 
    670    _mesa_glthread_finish(ctx);
    671    debug_print_sync_fallback("Uniform3d");
    672    CALL_Uniform3d(ctx->CurrentServerDispatch, (location, x, y, z));
    673 }
    674 
    675 
    676 /* Uniform3f: marshalled asynchronously */
    677 struct marshal_cmd_Uniform3f
    678 {
    679    struct marshal_cmd_base cmd_base;
    680    GLint location;
    681    GLfloat v0;
    682    GLfloat v1;
    683    GLfloat v2;
    684 };
    685 static inline void
    686 _mesa_unmarshal_Uniform3f(struct gl_context *ctx, const struct marshal_cmd_Uniform3f *cmd)
    687 {
    688    const GLint location = cmd->location;
    689    const GLfloat v0 = cmd->v0;
    690    const GLfloat v1 = cmd->v1;
    691    const GLfloat v2 = cmd->v2;
    692    CALL_Uniform3f(ctx->CurrentServerDispatch, (location, v0, v1, v2));
    693 }
    694 static void GLAPIENTRY
    695 _mesa_marshal_Uniform3f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
    696 {
    697    GET_CURRENT_CONTEXT(ctx);
    698    size_t cmd_size = sizeof(struct marshal_cmd_Uniform3f);
    699    struct marshal_cmd_Uniform3f *cmd;
    700    debug_print_marshal("Uniform3f");
    701    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    702       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3f, cmd_size);
    703       cmd->location = location;
    704       cmd->v0 = v0;
    705       cmd->v1 = v1;
    706       cmd->v2 = v2;
    707       _mesa_post_marshal_hook(ctx);
    708       return;
    709    }
    710 
    711    _mesa_glthread_finish(ctx);
    712    debug_print_sync_fallback("Uniform3f");
    713    CALL_Uniform3f(ctx->CurrentServerDispatch, (location, v0, v1, v2));
    714 }
    715 
    716 
    717 /* UniformMatrix2x4fv: marshalled asynchronously */
    718 struct marshal_cmd_UniformMatrix2x4fv
    719 {
    720    struct marshal_cmd_base cmd_base;
    721    GLint location;
    722    GLsizei count;
    723    GLboolean transpose;
    724    /* Next safe_mul(count, 32) bytes are GLfloat value[count][8] */
    725 };
    726 static inline void
    727 _mesa_unmarshal_UniformMatrix2x4fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2x4fv *cmd)
    728 {
    729    const GLint location = cmd->location;
    730    const GLsizei count = cmd->count;
    731    const GLboolean transpose = cmd->transpose;
    732    const GLfloat * value;
    733    const char *variable_data = (const char *) (cmd + 1);
    734    value = (const GLfloat *) variable_data;
    735    variable_data += count * 32;
    736    CALL_UniformMatrix2x4fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
    737 }
    738 static void GLAPIENTRY
    739 _mesa_marshal_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
    740 {
    741    GET_CURRENT_CONTEXT(ctx);
    742    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix2x4fv) + safe_mul(count, 32);
    743    struct marshal_cmd_UniformMatrix2x4fv *cmd;
    744    debug_print_marshal("UniformMatrix2x4fv");
    745    if (unlikely(safe_mul(count, 32) < 0)) {
    746       goto fallback_to_sync;
    747    }
    748    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    749       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2x4fv, cmd_size);
    750       cmd->location = location;
    751       cmd->count = count;
    752       cmd->transpose = transpose;
    753       char *variable_data = (char *) (cmd + 1);
    754       memcpy(variable_data, value, count * 32);
    755       variable_data += count * 32;
    756       _mesa_post_marshal_hook(ctx);
    757       return;
    758    }
    759 
    760 fallback_to_sync:
    761    _mesa_glthread_finish(ctx);
    762    debug_print_sync_fallback("UniformMatrix2x4fv");
    763    CALL_UniformMatrix2x4fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
    764 }
    765 
    766 
    767 /* QueryMatrixxOES: marshalled synchronously */
    768 static GLbitfield GLAPIENTRY
    769 _mesa_marshal_QueryMatrixxOES(GLfixed * mantissa, GLint * exponent)
    770 {
    771    GET_CURRENT_CONTEXT(ctx);
    772    _mesa_glthread_finish(ctx);
    773    debug_print_sync("QueryMatrixxOES");
    774    return CALL_QueryMatrixxOES(ctx->CurrentServerDispatch, (mantissa, exponent));
    775 }
    776 
    777 
    778 /* Normal3iv: marshalled asynchronously */
    779 struct marshal_cmd_Normal3iv
    780 {
    781    struct marshal_cmd_base cmd_base;
    782    GLint v[3];
    783 };
    784 static inline void
    785 _mesa_unmarshal_Normal3iv(struct gl_context *ctx, const struct marshal_cmd_Normal3iv *cmd)
    786 {
    787    const GLint * v = cmd->v;
    788    CALL_Normal3iv(ctx->CurrentServerDispatch, (v));
    789 }
    790 static void GLAPIENTRY
    791 _mesa_marshal_Normal3iv(const GLint * v)
    792 {
    793    GET_CURRENT_CONTEXT(ctx);
    794    size_t cmd_size = sizeof(struct marshal_cmd_Normal3iv);
    795    struct marshal_cmd_Normal3iv *cmd;
    796    debug_print_marshal("Normal3iv");
    797    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    798       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Normal3iv, cmd_size);
    799       memcpy(cmd->v, v, 12);
    800       _mesa_post_marshal_hook(ctx);
    801       return;
    802    }
    803 
    804    _mesa_glthread_finish(ctx);
    805    debug_print_sync_fallback("Normal3iv");
    806    CALL_Normal3iv(ctx->CurrentServerDispatch, (v));
    807 }
    808 
    809 
    810 /* DrawTexiOES: marshalled asynchronously */
    811 struct marshal_cmd_DrawTexiOES
    812 {
    813    struct marshal_cmd_base cmd_base;
    814    GLint x;
    815    GLint y;
    816    GLint z;
    817    GLint width;
    818    GLint height;
    819 };
    820 static inline void
    821 _mesa_unmarshal_DrawTexiOES(struct gl_context *ctx, const struct marshal_cmd_DrawTexiOES *cmd)
    822 {
    823    const GLint x = cmd->x;
    824    const GLint y = cmd->y;
    825    const GLint z = cmd->z;
    826    const GLint width = cmd->width;
    827    const GLint height = cmd->height;
    828    CALL_DrawTexiOES(ctx->CurrentServerDispatch, (x, y, z, width, height));
    829 }
    830 static void GLAPIENTRY
    831 _mesa_marshal_DrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height)
    832 {
    833    GET_CURRENT_CONTEXT(ctx);
    834    size_t cmd_size = sizeof(struct marshal_cmd_DrawTexiOES);
    835    struct marshal_cmd_DrawTexiOES *cmd;
    836    debug_print_marshal("DrawTexiOES");
    837    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    838       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTexiOES, cmd_size);
    839       cmd->x = x;
    840       cmd->y = y;
    841       cmd->z = z;
    842       cmd->width = width;
    843       cmd->height = height;
    844       _mesa_post_marshal_hook(ctx);
    845       return;
    846    }
    847 
    848    _mesa_glthread_finish(ctx);
    849    debug_print_sync_fallback("DrawTexiOES");
    850    CALL_DrawTexiOES(ctx->CurrentServerDispatch, (x, y, z, width, height));
    851 }
    852 
    853 
    854 /* Viewport: marshalled asynchronously */
    855 struct marshal_cmd_Viewport
    856 {
    857    struct marshal_cmd_base cmd_base;
    858    GLint x;
    859    GLint y;
    860    GLsizei width;
    861    GLsizei height;
    862 };
    863 static inline void
    864 _mesa_unmarshal_Viewport(struct gl_context *ctx, const struct marshal_cmd_Viewport *cmd)
    865 {
    866    const GLint x = cmd->x;
    867    const GLint y = cmd->y;
    868    const GLsizei width = cmd->width;
    869    const GLsizei height = cmd->height;
    870    CALL_Viewport(ctx->CurrentServerDispatch, (x, y, width, height));
    871 }
    872 static void GLAPIENTRY
    873 _mesa_marshal_Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
    874 {
    875    GET_CURRENT_CONTEXT(ctx);
    876    size_t cmd_size = sizeof(struct marshal_cmd_Viewport);
    877    struct marshal_cmd_Viewport *cmd;
    878    debug_print_marshal("Viewport");
    879    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    880       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Viewport, cmd_size);
    881       cmd->x = x;
    882       cmd->y = y;
    883       cmd->width = width;
    884       cmd->height = height;
    885       _mesa_post_marshal_hook(ctx);
    886       return;
    887    }
    888 
    889    _mesa_glthread_finish(ctx);
    890    debug_print_sync_fallback("Viewport");
    891    CALL_Viewport(ctx->CurrentServerDispatch, (x, y, width, height));
    892 }
    893 
    894 
    895 /* CreateProgramPipelines: marshalled synchronously */
    896 static void GLAPIENTRY
    897 _mesa_marshal_CreateProgramPipelines(GLsizei n, GLuint * pipelines)
    898 {
    899    GET_CURRENT_CONTEXT(ctx);
    900    _mesa_glthread_finish(ctx);
    901    debug_print_sync("CreateProgramPipelines");
    902    CALL_CreateProgramPipelines(ctx->CurrentServerDispatch, (n, pipelines));
    903 }
    904 
    905 
    906 /* DeleteVertexArrays: marshalled asynchronously */
    907 struct marshal_cmd_DeleteVertexArrays
    908 {
    909    struct marshal_cmd_base cmd_base;
    910    GLsizei n;
    911    /* Next safe_mul(n, 4) bytes are GLuint arrays[n] */
    912 };
    913 static inline void
    914 _mesa_unmarshal_DeleteVertexArrays(struct gl_context *ctx, const struct marshal_cmd_DeleteVertexArrays *cmd)
    915 {
    916    const GLsizei n = cmd->n;
    917    const GLuint * arrays;
    918    const char *variable_data = (const char *) (cmd + 1);
    919    arrays = (const GLuint *) variable_data;
    920    variable_data += n * 4;
    921    CALL_DeleteVertexArrays(ctx->CurrentServerDispatch, (n, arrays));
    922 }
    923 static void GLAPIENTRY
    924 _mesa_marshal_DeleteVertexArrays(GLsizei n, const GLuint * arrays)
    925 {
    926    GET_CURRENT_CONTEXT(ctx);
    927    size_t cmd_size = sizeof(struct marshal_cmd_DeleteVertexArrays) + safe_mul(n, 4);
    928    struct marshal_cmd_DeleteVertexArrays *cmd;
    929    debug_print_marshal("DeleteVertexArrays");
    930    if (unlikely(safe_mul(n, 4) < 0)) {
    931       goto fallback_to_sync;
    932    }
    933    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    934       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteVertexArrays, cmd_size);
    935       cmd->n = n;
    936       char *variable_data = (char *) (cmd + 1);
    937       memcpy(variable_data, arrays, n * 4);
    938       variable_data += n * 4;
    939       _mesa_post_marshal_hook(ctx);
    940       return;
    941    }
    942 
    943 fallback_to_sync:
    944    _mesa_glthread_finish(ctx);
    945    debug_print_sync_fallback("DeleteVertexArrays");
    946    CALL_DeleteVertexArrays(ctx->CurrentServerDispatch, (n, arrays));
    947 }
    948 
    949 
    950 /* ClearColorIuiEXT: marshalled asynchronously */
    951 struct marshal_cmd_ClearColorIuiEXT
    952 {
    953    struct marshal_cmd_base cmd_base;
    954    GLuint r;
    955    GLuint g;
    956    GLuint b;
    957    GLuint a;
    958 };
    959 static inline void
    960 _mesa_unmarshal_ClearColorIuiEXT(struct gl_context *ctx, const struct marshal_cmd_ClearColorIuiEXT *cmd)
    961 {
    962    const GLuint r = cmd->r;
    963    const GLuint g = cmd->g;
    964    const GLuint b = cmd->b;
    965    const GLuint a = cmd->a;
    966    CALL_ClearColorIuiEXT(ctx->CurrentServerDispatch, (r, g, b, a));
    967 }
    968 static void GLAPIENTRY
    969 _mesa_marshal_ClearColorIuiEXT(GLuint r, GLuint g, GLuint b, GLuint a)
    970 {
    971    GET_CURRENT_CONTEXT(ctx);
    972    size_t cmd_size = sizeof(struct marshal_cmd_ClearColorIuiEXT);
    973    struct marshal_cmd_ClearColorIuiEXT *cmd;
    974    debug_print_marshal("ClearColorIuiEXT");
    975    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
    976       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearColorIuiEXT, cmd_size);
    977       cmd->r = r;
    978       cmd->g = g;
    979       cmd->b = b;
    980       cmd->a = a;
    981       _mesa_post_marshal_hook(ctx);
    982       return;
    983    }
    984 
    985    _mesa_glthread_finish(ctx);
    986    debug_print_sync_fallback("ClearColorIuiEXT");
    987    CALL_ClearColorIuiEXT(ctx->CurrentServerDispatch, (r, g, b, a));
    988 }
    989 
    990 
    991 /* GetnConvolutionFilterARB: marshalled synchronously */
    992 static void GLAPIENTRY
    993 _mesa_marshal_GetnConvolutionFilterARB(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid * image)
    994 {
    995    GET_CURRENT_CONTEXT(ctx);
    996    _mesa_glthread_finish(ctx);
    997    debug_print_sync("GetnConvolutionFilterARB");
    998    CALL_GetnConvolutionFilterARB(ctx->CurrentServerDispatch, (target, format, type, bufSize, image));
    999 }
   1000 
   1001 
   1002 /* PolygonOffsetx: marshalled asynchronously */
   1003 struct marshal_cmd_PolygonOffsetx
   1004 {
   1005    struct marshal_cmd_base cmd_base;
   1006    GLfixed factor;
   1007    GLfixed units;
   1008 };
   1009 static inline void
   1010 _mesa_unmarshal_PolygonOffsetx(struct gl_context *ctx, const struct marshal_cmd_PolygonOffsetx *cmd)
   1011 {
   1012    const GLfixed factor = cmd->factor;
   1013    const GLfixed units = cmd->units;
   1014    CALL_PolygonOffsetx(ctx->CurrentServerDispatch, (factor, units));
   1015 }
   1016 static void GLAPIENTRY
   1017 _mesa_marshal_PolygonOffsetx(GLfixed factor, GLfixed units)
   1018 {
   1019    GET_CURRENT_CONTEXT(ctx);
   1020    size_t cmd_size = sizeof(struct marshal_cmd_PolygonOffsetx);
   1021    struct marshal_cmd_PolygonOffsetx *cmd;
   1022    debug_print_marshal("PolygonOffsetx");
   1023    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1024       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PolygonOffsetx, cmd_size);
   1025       cmd->factor = factor;
   1026       cmd->units = units;
   1027       _mesa_post_marshal_hook(ctx);
   1028       return;
   1029    }
   1030 
   1031    _mesa_glthread_finish(ctx);
   1032    debug_print_sync_fallback("PolygonOffsetx");
   1033    CALL_PolygonOffsetx(ctx->CurrentServerDispatch, (factor, units));
   1034 }
   1035 
   1036 
   1037 /* GetLightxv: marshalled synchronously */
   1038 static void GLAPIENTRY
   1039 _mesa_marshal_GetLightxv(GLenum light, GLenum pname, GLfixed * params)
   1040 {
   1041    GET_CURRENT_CONTEXT(ctx);
   1042    _mesa_glthread_finish(ctx);
   1043    debug_print_sync("GetLightxv");
   1044    CALL_GetLightxv(ctx->CurrentServerDispatch, (light, pname, params));
   1045 }
   1046 
   1047 
   1048 /* GetConvolutionParameteriv: marshalled synchronously */
   1049 static void GLAPIENTRY
   1050 _mesa_marshal_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint * params)
   1051 {
   1052    GET_CURRENT_CONTEXT(ctx);
   1053    _mesa_glthread_finish(ctx);
   1054    debug_print_sync("GetConvolutionParameteriv");
   1055    CALL_GetConvolutionParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
   1056 }
   1057 
   1058 
   1059 /* DepthRangeIndexedfOES: marshalled asynchronously */
   1060 struct marshal_cmd_DepthRangeIndexedfOES
   1061 {
   1062    struct marshal_cmd_base cmd_base;
   1063    GLuint index;
   1064    GLfloat n;
   1065    GLfloat f;
   1066 };
   1067 static inline void
   1068 _mesa_unmarshal_DepthRangeIndexedfOES(struct gl_context *ctx, const struct marshal_cmd_DepthRangeIndexedfOES *cmd)
   1069 {
   1070    const GLuint index = cmd->index;
   1071    const GLfloat n = cmd->n;
   1072    const GLfloat f = cmd->f;
   1073    CALL_DepthRangeIndexedfOES(ctx->CurrentServerDispatch, (index, n, f));
   1074 }
   1075 static void GLAPIENTRY
   1076 _mesa_marshal_DepthRangeIndexedfOES(GLuint index, GLfloat n, GLfloat f)
   1077 {
   1078    GET_CURRENT_CONTEXT(ctx);
   1079    size_t cmd_size = sizeof(struct marshal_cmd_DepthRangeIndexedfOES);
   1080    struct marshal_cmd_DepthRangeIndexedfOES *cmd;
   1081    debug_print_marshal("DepthRangeIndexedfOES");
   1082    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1083       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DepthRangeIndexedfOES, cmd_size);
   1084       cmd->index = index;
   1085       cmd->n = n;
   1086       cmd->f = f;
   1087       _mesa_post_marshal_hook(ctx);
   1088       return;
   1089    }
   1090 
   1091    _mesa_glthread_finish(ctx);
   1092    debug_print_sync_fallback("DepthRangeIndexedfOES");
   1093    CALL_DepthRangeIndexedfOES(ctx->CurrentServerDispatch, (index, n, f));
   1094 }
   1095 
   1096 
   1097 /* GetProgramResourceLocation: marshalled synchronously */
   1098 static GLint GLAPIENTRY
   1099 _mesa_marshal_GetProgramResourceLocation(GLuint program, GLenum programInterface, const GLchar * name)
   1100 {
   1101    GET_CURRENT_CONTEXT(ctx);
   1102    _mesa_glthread_finish(ctx);
   1103    debug_print_sync("GetProgramResourceLocation");
   1104    return CALL_GetProgramResourceLocation(ctx->CurrentServerDispatch, (program, programInterface, name));
   1105 }
   1106 
   1107 
   1108 /* GetSubroutineUniformLocation: marshalled synchronously */
   1109 static GLint GLAPIENTRY
   1110 _mesa_marshal_GetSubroutineUniformLocation(GLuint program, GLenum shadertype, const GLchar * name)
   1111 {
   1112    GET_CURRENT_CONTEXT(ctx);
   1113    _mesa_glthread_finish(ctx);
   1114    debug_print_sync("GetSubroutineUniformLocation");
   1115    return CALL_GetSubroutineUniformLocation(ctx->CurrentServerDispatch, (program, shadertype, name));
   1116 }
   1117 
   1118 
   1119 /* VertexAttrib4usv: marshalled asynchronously */
   1120 struct marshal_cmd_VertexAttrib4usv
   1121 {
   1122    struct marshal_cmd_base cmd_base;
   1123    GLuint index;
   1124    GLushort v[4];
   1125 };
   1126 static inline void
   1127 _mesa_unmarshal_VertexAttrib4usv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4usv *cmd)
   1128 {
   1129    const GLuint index = cmd->index;
   1130    const GLushort * v = cmd->v;
   1131    CALL_VertexAttrib4usv(ctx->CurrentServerDispatch, (index, v));
   1132 }
   1133 static void GLAPIENTRY
   1134 _mesa_marshal_VertexAttrib4usv(GLuint index, const GLushort * v)
   1135 {
   1136    GET_CURRENT_CONTEXT(ctx);
   1137    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4usv);
   1138    struct marshal_cmd_VertexAttrib4usv *cmd;
   1139    debug_print_marshal("VertexAttrib4usv");
   1140    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1141       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4usv, cmd_size);
   1142       cmd->index = index;
   1143       memcpy(cmd->v, v, 8);
   1144       _mesa_post_marshal_hook(ctx);
   1145       return;
   1146    }
   1147 
   1148    _mesa_glthread_finish(ctx);
   1149    debug_print_sync_fallback("VertexAttrib4usv");
   1150    CALL_VertexAttrib4usv(ctx->CurrentServerDispatch, (index, v));
   1151 }
   1152 
   1153 
   1154 /* TextureStorage1DEXT: marshalled asynchronously */
   1155 struct marshal_cmd_TextureStorage1DEXT
   1156 {
   1157    struct marshal_cmd_base cmd_base;
   1158    GLuint texture;
   1159    GLenum target;
   1160    GLsizei levels;
   1161    GLenum internalFormat;
   1162    GLsizei width;
   1163 };
   1164 static inline void
   1165 _mesa_unmarshal_TextureStorage1DEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorage1DEXT *cmd)
   1166 {
   1167    const GLuint texture = cmd->texture;
   1168    const GLenum target = cmd->target;
   1169    const GLsizei levels = cmd->levels;
   1170    const GLenum internalFormat = cmd->internalFormat;
   1171    const GLsizei width = cmd->width;
   1172    CALL_TextureStorage1DEXT(ctx->CurrentServerDispatch, (texture, target, levels, internalFormat, width));
   1173 }
   1174 static void GLAPIENTRY
   1175 _mesa_marshal_TextureStorage1DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width)
   1176 {
   1177    GET_CURRENT_CONTEXT(ctx);
   1178    size_t cmd_size = sizeof(struct marshal_cmd_TextureStorage1DEXT);
   1179    struct marshal_cmd_TextureStorage1DEXT *cmd;
   1180    debug_print_marshal("TextureStorage1DEXT");
   1181    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1182       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage1DEXT, cmd_size);
   1183       cmd->texture = texture;
   1184       cmd->target = target;
   1185       cmd->levels = levels;
   1186       cmd->internalFormat = internalFormat;
   1187       cmd->width = width;
   1188       _mesa_post_marshal_hook(ctx);
   1189       return;
   1190    }
   1191 
   1192    _mesa_glthread_finish(ctx);
   1193    debug_print_sync_fallback("TextureStorage1DEXT");
   1194    CALL_TextureStorage1DEXT(ctx->CurrentServerDispatch, (texture, target, levels, internalFormat, width));
   1195 }
   1196 
   1197 
   1198 /* VertexAttrib4Nub: marshalled asynchronously */
   1199 struct marshal_cmd_VertexAttrib4Nub
   1200 {
   1201    struct marshal_cmd_base cmd_base;
   1202    GLuint index;
   1203    GLubyte x;
   1204    GLubyte y;
   1205    GLubyte z;
   1206    GLubyte w;
   1207 };
   1208 static inline void
   1209 _mesa_unmarshal_VertexAttrib4Nub(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nub *cmd)
   1210 {
   1211    const GLuint index = cmd->index;
   1212    const GLubyte x = cmd->x;
   1213    const GLubyte y = cmd->y;
   1214    const GLubyte z = cmd->z;
   1215    const GLubyte w = cmd->w;
   1216    CALL_VertexAttrib4Nub(ctx->CurrentServerDispatch, (index, x, y, z, w));
   1217 }
   1218 static void GLAPIENTRY
   1219 _mesa_marshal_VertexAttrib4Nub(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
   1220 {
   1221    GET_CURRENT_CONTEXT(ctx);
   1222    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nub);
   1223    struct marshal_cmd_VertexAttrib4Nub *cmd;
   1224    debug_print_marshal("VertexAttrib4Nub");
   1225    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1226       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nub, cmd_size);
   1227       cmd->index = index;
   1228       cmd->x = x;
   1229       cmd->y = y;
   1230       cmd->z = z;
   1231       cmd->w = w;
   1232       _mesa_post_marshal_hook(ctx);
   1233       return;
   1234    }
   1235 
   1236    _mesa_glthread_finish(ctx);
   1237    debug_print_sync_fallback("VertexAttrib4Nub");
   1238    CALL_VertexAttrib4Nub(ctx->CurrentServerDispatch, (index, x, y, z, w));
   1239 }
   1240 
   1241 
   1242 /* VertexAttribP3ui: marshalled asynchronously */
   1243 struct marshal_cmd_VertexAttribP3ui
   1244 {
   1245    struct marshal_cmd_base cmd_base;
   1246    GLuint index;
   1247    GLenum type;
   1248    GLboolean normalized;
   1249    GLuint value;
   1250 };
   1251 static inline void
   1252 _mesa_unmarshal_VertexAttribP3ui(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP3ui *cmd)
   1253 {
   1254    const GLuint index = cmd->index;
   1255    const GLenum type = cmd->type;
   1256    const GLboolean normalized = cmd->normalized;
   1257    const GLuint value = cmd->value;
   1258    CALL_VertexAttribP3ui(ctx->CurrentServerDispatch, (index, type, normalized, value));
   1259 }
   1260 static void GLAPIENTRY
   1261 _mesa_marshal_VertexAttribP3ui(GLuint index, GLenum type, GLboolean normalized, GLuint value)
   1262 {
   1263    GET_CURRENT_CONTEXT(ctx);
   1264    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribP3ui);
   1265    struct marshal_cmd_VertexAttribP3ui *cmd;
   1266    debug_print_marshal("VertexAttribP3ui");
   1267    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1268       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP3ui, cmd_size);
   1269       cmd->index = index;
   1270       cmd->type = type;
   1271       cmd->normalized = normalized;
   1272       cmd->value = value;
   1273       _mesa_post_marshal_hook(ctx);
   1274       return;
   1275    }
   1276 
   1277    _mesa_glthread_finish(ctx);
   1278    debug_print_sync_fallback("VertexAttribP3ui");
   1279    CALL_VertexAttribP3ui(ctx->CurrentServerDispatch, (index, type, normalized, value));
   1280 }
   1281 
   1282 
   1283 /* PointSize: marshalled asynchronously */
   1284 struct marshal_cmd_PointSize
   1285 {
   1286    struct marshal_cmd_base cmd_base;
   1287    GLfloat size;
   1288 };
   1289 static inline void
   1290 _mesa_unmarshal_PointSize(struct gl_context *ctx, const struct marshal_cmd_PointSize *cmd)
   1291 {
   1292    const GLfloat size = cmd->size;
   1293    CALL_PointSize(ctx->CurrentServerDispatch, (size));
   1294 }
   1295 static void GLAPIENTRY
   1296 _mesa_marshal_PointSize(GLfloat size)
   1297 {
   1298    GET_CURRENT_CONTEXT(ctx);
   1299    size_t cmd_size = sizeof(struct marshal_cmd_PointSize);
   1300    struct marshal_cmd_PointSize *cmd;
   1301    debug_print_marshal("PointSize");
   1302    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1303       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PointSize, cmd_size);
   1304       cmd->size = size;
   1305       _mesa_post_marshal_hook(ctx);
   1306       return;
   1307    }
   1308 
   1309    _mesa_glthread_finish(ctx);
   1310    debug_print_sync_fallback("PointSize");
   1311    CALL_PointSize(ctx->CurrentServerDispatch, (size));
   1312 }
   1313 
   1314 
   1315 /* PopName: marshalled asynchronously */
   1316 struct marshal_cmd_PopName
   1317 {
   1318    struct marshal_cmd_base cmd_base;
   1319 };
   1320 static inline void
   1321 _mesa_unmarshal_PopName(struct gl_context *ctx, const struct marshal_cmd_PopName *cmd)
   1322 {
   1323    CALL_PopName(ctx->CurrentServerDispatch, ());
   1324 }
   1325 static void GLAPIENTRY
   1326 _mesa_marshal_PopName(void)
   1327 {
   1328    GET_CURRENT_CONTEXT(ctx);
   1329    size_t cmd_size = sizeof(struct marshal_cmd_PopName);
   1330    struct marshal_cmd_PopName *cmd;
   1331    debug_print_marshal("PopName");
   1332    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1333       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PopName, cmd_size);
   1334       (void) cmd;
   1335 
   1336       _mesa_post_marshal_hook(ctx);
   1337       return;
   1338    }
   1339 
   1340    _mesa_glthread_finish(ctx);
   1341    debug_print_sync_fallback("PopName");
   1342    CALL_PopName(ctx->CurrentServerDispatch, ());
   1343 }
   1344 
   1345 
   1346 /* FramebufferTexture: marshalled asynchronously */
   1347 struct marshal_cmd_FramebufferTexture
   1348 {
   1349    struct marshal_cmd_base cmd_base;
   1350    GLenum target;
   1351    GLenum attachment;
   1352    GLuint texture;
   1353    GLint level;
   1354 };
   1355 static inline void
   1356 _mesa_unmarshal_FramebufferTexture(struct gl_context *ctx, const struct marshal_cmd_FramebufferTexture *cmd)
   1357 {
   1358    const GLenum target = cmd->target;
   1359    const GLenum attachment = cmd->attachment;
   1360    const GLuint texture = cmd->texture;
   1361    const GLint level = cmd->level;
   1362    CALL_FramebufferTexture(ctx->CurrentServerDispatch, (target, attachment, texture, level));
   1363 }
   1364 static void GLAPIENTRY
   1365 _mesa_marshal_FramebufferTexture(GLenum target, GLenum attachment, GLuint texture, GLint level)
   1366 {
   1367    GET_CURRENT_CONTEXT(ctx);
   1368    size_t cmd_size = sizeof(struct marshal_cmd_FramebufferTexture);
   1369    struct marshal_cmd_FramebufferTexture *cmd;
   1370    debug_print_marshal("FramebufferTexture");
   1371    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1372       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferTexture, cmd_size);
   1373       cmd->target = target;
   1374       cmd->attachment = attachment;
   1375       cmd->texture = texture;
   1376       cmd->level = level;
   1377       _mesa_post_marshal_hook(ctx);
   1378       return;
   1379    }
   1380 
   1381    _mesa_glthread_finish(ctx);
   1382    debug_print_sync_fallback("FramebufferTexture");
   1383    CALL_FramebufferTexture(ctx->CurrentServerDispatch, (target, attachment, texture, level));
   1384 }
   1385 
   1386 
   1387 /* CreateTransformFeedbacks: marshalled synchronously */
   1388 static void GLAPIENTRY
   1389 _mesa_marshal_CreateTransformFeedbacks(GLsizei n, GLuint * ids)
   1390 {
   1391    GET_CURRENT_CONTEXT(ctx);
   1392    _mesa_glthread_finish(ctx);
   1393    debug_print_sync("CreateTransformFeedbacks");
   1394    CALL_CreateTransformFeedbacks(ctx->CurrentServerDispatch, (n, ids));
   1395 }
   1396 
   1397 
   1398 /* VertexAttrib4ubNV: marshalled asynchronously */
   1399 struct marshal_cmd_VertexAttrib4ubNV
   1400 {
   1401    struct marshal_cmd_base cmd_base;
   1402    GLuint index;
   1403    GLubyte x;
   1404    GLubyte y;
   1405    GLubyte z;
   1406    GLubyte w;
   1407 };
   1408 static inline void
   1409 _mesa_unmarshal_VertexAttrib4ubNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4ubNV *cmd)
   1410 {
   1411    const GLuint index = cmd->index;
   1412    const GLubyte x = cmd->x;
   1413    const GLubyte y = cmd->y;
   1414    const GLubyte z = cmd->z;
   1415    const GLubyte w = cmd->w;
   1416    CALL_VertexAttrib4ubNV(ctx->CurrentServerDispatch, (index, x, y, z, w));
   1417 }
   1418 static void GLAPIENTRY
   1419 _mesa_marshal_VertexAttrib4ubNV(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w)
   1420 {
   1421    GET_CURRENT_CONTEXT(ctx);
   1422    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4ubNV);
   1423    struct marshal_cmd_VertexAttrib4ubNV *cmd;
   1424    debug_print_marshal("VertexAttrib4ubNV");
   1425    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1426       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4ubNV, cmd_size);
   1427       cmd->index = index;
   1428       cmd->x = x;
   1429       cmd->y = y;
   1430       cmd->z = z;
   1431       cmd->w = w;
   1432       _mesa_post_marshal_hook(ctx);
   1433       return;
   1434    }
   1435 
   1436    _mesa_glthread_finish(ctx);
   1437    debug_print_sync_fallback("VertexAttrib4ubNV");
   1438    CALL_VertexAttrib4ubNV(ctx->CurrentServerDispatch, (index, x, y, z, w));
   1439 }
   1440 
   1441 
   1442 /* ValidateProgramPipeline: marshalled asynchronously */
   1443 struct marshal_cmd_ValidateProgramPipeline
   1444 {
   1445    struct marshal_cmd_base cmd_base;
   1446    GLuint pipeline;
   1447 };
   1448 static inline void
   1449 _mesa_unmarshal_ValidateProgramPipeline(struct gl_context *ctx, const struct marshal_cmd_ValidateProgramPipeline *cmd)
   1450 {
   1451    const GLuint pipeline = cmd->pipeline;
   1452    CALL_ValidateProgramPipeline(ctx->CurrentServerDispatch, (pipeline));
   1453 }
   1454 static void GLAPIENTRY
   1455 _mesa_marshal_ValidateProgramPipeline(GLuint pipeline)
   1456 {
   1457    GET_CURRENT_CONTEXT(ctx);
   1458    size_t cmd_size = sizeof(struct marshal_cmd_ValidateProgramPipeline);
   1459    struct marshal_cmd_ValidateProgramPipeline *cmd;
   1460    debug_print_marshal("ValidateProgramPipeline");
   1461    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1462       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ValidateProgramPipeline, cmd_size);
   1463       cmd->pipeline = pipeline;
   1464       _mesa_post_marshal_hook(ctx);
   1465       return;
   1466    }
   1467 
   1468    _mesa_glthread_finish(ctx);
   1469    debug_print_sync_fallback("ValidateProgramPipeline");
   1470    CALL_ValidateProgramPipeline(ctx->CurrentServerDispatch, (pipeline));
   1471 }
   1472 
   1473 
   1474 /* BindFragDataLocationIndexed: marshalled synchronously */
   1475 static void GLAPIENTRY
   1476 _mesa_marshal_BindFragDataLocationIndexed(GLuint program, GLuint colorNumber, GLuint index, const GLchar * name)
   1477 {
   1478    GET_CURRENT_CONTEXT(ctx);
   1479    _mesa_glthread_finish(ctx);
   1480    debug_print_sync("BindFragDataLocationIndexed");
   1481    CALL_BindFragDataLocationIndexed(ctx->CurrentServerDispatch, (program, colorNumber, index, name));
   1482 }
   1483 
   1484 
   1485 /* GetClipPlane: marshalled synchronously */
   1486 static void GLAPIENTRY
   1487 _mesa_marshal_GetClipPlane(GLenum plane, GLdouble * equation)
   1488 {
   1489    GET_CURRENT_CONTEXT(ctx);
   1490    _mesa_glthread_finish(ctx);
   1491    debug_print_sync("GetClipPlane");
   1492    CALL_GetClipPlane(ctx->CurrentServerDispatch, (plane, equation));
   1493 }
   1494 
   1495 
   1496 /* DeleteSemaphoresEXT: marshalled synchronously */
   1497 static void GLAPIENTRY
   1498 _mesa_marshal_DeleteSemaphoresEXT(GLsizei n, const GLuint * semaphores)
   1499 {
   1500    GET_CURRENT_CONTEXT(ctx);
   1501    _mesa_glthread_finish(ctx);
   1502    debug_print_sync("DeleteSemaphoresEXT");
   1503    CALL_DeleteSemaphoresEXT(ctx->CurrentServerDispatch, (n, semaphores));
   1504 }
   1505 
   1506 
   1507 /* TexCoordP4uiv: marshalled synchronously */
   1508 static void GLAPIENTRY
   1509 _mesa_marshal_TexCoordP4uiv(GLenum type, const GLuint * coords)
   1510 {
   1511    GET_CURRENT_CONTEXT(ctx);
   1512    _mesa_glthread_finish(ctx);
   1513    debug_print_sync("TexCoordP4uiv");
   1514    CALL_TexCoordP4uiv(ctx->CurrentServerDispatch, (type, coords));
   1515 }
   1516 
   1517 
   1518 /* VertexAttribs3dvNV: marshalled asynchronously */
   1519 struct marshal_cmd_VertexAttribs3dvNV
   1520 {
   1521    struct marshal_cmd_base cmd_base;
   1522    GLuint index;
   1523    GLsizei n;
   1524    /* Next safe_mul(n, 24) bytes are GLdouble v[n][3] */
   1525 };
   1526 static inline void
   1527 _mesa_unmarshal_VertexAttribs3dvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs3dvNV *cmd)
   1528 {
   1529    const GLuint index = cmd->index;
   1530    const GLsizei n = cmd->n;
   1531    const GLdouble * v;
   1532    const char *variable_data = (const char *) (cmd + 1);
   1533    v = (const GLdouble *) variable_data;
   1534    variable_data += n * 24;
   1535    CALL_VertexAttribs3dvNV(ctx->CurrentServerDispatch, (index, n, v));
   1536 }
   1537 static void GLAPIENTRY
   1538 _mesa_marshal_VertexAttribs3dvNV(GLuint index, GLsizei n, const GLdouble * v)
   1539 {
   1540    GET_CURRENT_CONTEXT(ctx);
   1541    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribs3dvNV) + safe_mul(n, 24);
   1542    struct marshal_cmd_VertexAttribs3dvNV *cmd;
   1543    debug_print_marshal("VertexAttribs3dvNV");
   1544    if (unlikely(safe_mul(n, 24) < 0)) {
   1545       goto fallback_to_sync;
   1546    }
   1547    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1548       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs3dvNV, cmd_size);
   1549       cmd->index = index;
   1550       cmd->n = n;
   1551       char *variable_data = (char *) (cmd + 1);
   1552       memcpy(variable_data, v, n * 24);
   1553       variable_data += n * 24;
   1554       _mesa_post_marshal_hook(ctx);
   1555       return;
   1556    }
   1557 
   1558 fallback_to_sync:
   1559    _mesa_glthread_finish(ctx);
   1560    debug_print_sync_fallback("VertexAttribs3dvNV");
   1561    CALL_VertexAttribs3dvNV(ctx->CurrentServerDispatch, (index, n, v));
   1562 }
   1563 
   1564 
   1565 /* ProgramUniformMatrix2x4dv: marshalled asynchronously */
   1566 struct marshal_cmd_ProgramUniformMatrix2x4dv
   1567 {
   1568    struct marshal_cmd_base cmd_base;
   1569    GLuint program;
   1570    GLint location;
   1571    GLsizei count;
   1572    GLboolean transpose;
   1573    /* Next safe_mul(count, 64) bytes are GLdouble value[count][8] */
   1574 };
   1575 static inline void
   1576 _mesa_unmarshal_ProgramUniformMatrix2x4dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix2x4dv *cmd)
   1577 {
   1578    const GLuint program = cmd->program;
   1579    const GLint location = cmd->location;
   1580    const GLsizei count = cmd->count;
   1581    const GLboolean transpose = cmd->transpose;
   1582    const GLdouble * value;
   1583    const char *variable_data = (const char *) (cmd + 1);
   1584    value = (const GLdouble *) variable_data;
   1585    variable_data += count * 64;
   1586    CALL_ProgramUniformMatrix2x4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   1587 }
   1588 static void GLAPIENTRY
   1589 _mesa_marshal_ProgramUniformMatrix2x4dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   1590 {
   1591    GET_CURRENT_CONTEXT(ctx);
   1592    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix2x4dv) + safe_mul(count, 64);
   1593    struct marshal_cmd_ProgramUniformMatrix2x4dv *cmd;
   1594    debug_print_marshal("ProgramUniformMatrix2x4dv");
   1595    if (unlikely(safe_mul(count, 64) < 0)) {
   1596       goto fallback_to_sync;
   1597    }
   1598    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1599       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix2x4dv, cmd_size);
   1600       cmd->program = program;
   1601       cmd->location = location;
   1602       cmd->count = count;
   1603       cmd->transpose = transpose;
   1604       char *variable_data = (char *) (cmd + 1);
   1605       memcpy(variable_data, value, count * 64);
   1606       variable_data += count * 64;
   1607       _mesa_post_marshal_hook(ctx);
   1608       return;
   1609    }
   1610 
   1611 fallback_to_sync:
   1612    _mesa_glthread_finish(ctx);
   1613    debug_print_sync_fallback("ProgramUniformMatrix2x4dv");
   1614    CALL_ProgramUniformMatrix2x4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   1615 }
   1616 
   1617 
   1618 /* GenQueries: marshalled synchronously */
   1619 static void GLAPIENTRY
   1620 _mesa_marshal_GenQueries(GLsizei n, GLuint * ids)
   1621 {
   1622    GET_CURRENT_CONTEXT(ctx);
   1623    _mesa_glthread_finish(ctx);
   1624    debug_print_sync("GenQueries");
   1625    CALL_GenQueries(ctx->CurrentServerDispatch, (n, ids));
   1626 }
   1627 
   1628 
   1629 /* ProgramUniform4iv: marshalled asynchronously */
   1630 struct marshal_cmd_ProgramUniform4iv
   1631 {
   1632    struct marshal_cmd_base cmd_base;
   1633    GLuint program;
   1634    GLint location;
   1635    GLsizei count;
   1636    /* Next safe_mul(count, 16) bytes are GLint value[count][4] */
   1637 };
   1638 static inline void
   1639 _mesa_unmarshal_ProgramUniform4iv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4iv *cmd)
   1640 {
   1641    const GLuint program = cmd->program;
   1642    const GLint location = cmd->location;
   1643    const GLsizei count = cmd->count;
   1644    const GLint * value;
   1645    const char *variable_data = (const char *) (cmd + 1);
   1646    value = (const GLint *) variable_data;
   1647    variable_data += count * 16;
   1648    CALL_ProgramUniform4iv(ctx->CurrentServerDispatch, (program, location, count, value));
   1649 }
   1650 static void GLAPIENTRY
   1651 _mesa_marshal_ProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint * value)
   1652 {
   1653    GET_CURRENT_CONTEXT(ctx);
   1654    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform4iv) + safe_mul(count, 16);
   1655    struct marshal_cmd_ProgramUniform4iv *cmd;
   1656    debug_print_marshal("ProgramUniform4iv");
   1657    if (unlikely(safe_mul(count, 16) < 0)) {
   1658       goto fallback_to_sync;
   1659    }
   1660    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1661       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4iv, cmd_size);
   1662       cmd->program = program;
   1663       cmd->location = location;
   1664       cmd->count = count;
   1665       char *variable_data = (char *) (cmd + 1);
   1666       memcpy(variable_data, value, count * 16);
   1667       variable_data += count * 16;
   1668       _mesa_post_marshal_hook(ctx);
   1669       return;
   1670    }
   1671 
   1672 fallback_to_sync:
   1673    _mesa_glthread_finish(ctx);
   1674    debug_print_sync_fallback("ProgramUniform4iv");
   1675    CALL_ProgramUniform4iv(ctx->CurrentServerDispatch, (program, location, count, value));
   1676 }
   1677 
   1678 
   1679 /* ObjectUnpurgeableAPPLE: marshalled synchronously */
   1680 static GLenum GLAPIENTRY
   1681 _mesa_marshal_ObjectUnpurgeableAPPLE(GLenum objectType, GLuint name, GLenum option)
   1682 {
   1683    GET_CURRENT_CONTEXT(ctx);
   1684    _mesa_glthread_finish(ctx);
   1685    debug_print_sync("ObjectUnpurgeableAPPLE");
   1686    return CALL_ObjectUnpurgeableAPPLE(ctx->CurrentServerDispatch, (objectType, name, option));
   1687 }
   1688 
   1689 
   1690 /* GetCompressedTextureSubImage: marshalled synchronously */
   1691 static void GLAPIENTRY
   1692 _mesa_marshal_GetCompressedTextureSubImage(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei bufSize, GLvoid * pixels)
   1693 {
   1694    GET_CURRENT_CONTEXT(ctx);
   1695    _mesa_glthread_finish(ctx);
   1696    debug_print_sync("GetCompressedTextureSubImage");
   1697    CALL_GetCompressedTextureSubImage(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth, bufSize, pixels));
   1698 }
   1699 
   1700 
   1701 /* TexCoord2iv: marshalled asynchronously */
   1702 struct marshal_cmd_TexCoord2iv
   1703 {
   1704    struct marshal_cmd_base cmd_base;
   1705    GLint v[2];
   1706 };
   1707 static inline void
   1708 _mesa_unmarshal_TexCoord2iv(struct gl_context *ctx, const struct marshal_cmd_TexCoord2iv *cmd)
   1709 {
   1710    const GLint * v = cmd->v;
   1711    CALL_TexCoord2iv(ctx->CurrentServerDispatch, (v));
   1712 }
   1713 static void GLAPIENTRY
   1714 _mesa_marshal_TexCoord2iv(const GLint * v)
   1715 {
   1716    GET_CURRENT_CONTEXT(ctx);
   1717    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord2iv);
   1718    struct marshal_cmd_TexCoord2iv *cmd;
   1719    debug_print_marshal("TexCoord2iv");
   1720    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1721       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord2iv, cmd_size);
   1722       memcpy(cmd->v, v, 8);
   1723       _mesa_post_marshal_hook(ctx);
   1724       return;
   1725    }
   1726 
   1727    _mesa_glthread_finish(ctx);
   1728    debug_print_sync_fallback("TexCoord2iv");
   1729    CALL_TexCoord2iv(ctx->CurrentServerDispatch, (v));
   1730 }
   1731 
   1732 
   1733 /* TexImage2DMultisample: marshalled asynchronously */
   1734 struct marshal_cmd_TexImage2DMultisample
   1735 {
   1736    struct marshal_cmd_base cmd_base;
   1737    GLenum target;
   1738    GLsizei samples;
   1739    GLenum internalformat;
   1740    GLsizei width;
   1741    GLsizei height;
   1742    GLboolean fixedsamplelocations;
   1743 };
   1744 static inline void
   1745 _mesa_unmarshal_TexImage2DMultisample(struct gl_context *ctx, const struct marshal_cmd_TexImage2DMultisample *cmd)
   1746 {
   1747    const GLenum target = cmd->target;
   1748    const GLsizei samples = cmd->samples;
   1749    const GLenum internalformat = cmd->internalformat;
   1750    const GLsizei width = cmd->width;
   1751    const GLsizei height = cmd->height;
   1752    const GLboolean fixedsamplelocations = cmd->fixedsamplelocations;
   1753    CALL_TexImage2DMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height, fixedsamplelocations));
   1754 }
   1755 static void GLAPIENTRY
   1756 _mesa_marshal_TexImage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
   1757 {
   1758    GET_CURRENT_CONTEXT(ctx);
   1759    size_t cmd_size = sizeof(struct marshal_cmd_TexImage2DMultisample);
   1760    struct marshal_cmd_TexImage2DMultisample *cmd;
   1761    debug_print_marshal("TexImage2DMultisample");
   1762    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1763       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexImage2DMultisample, cmd_size);
   1764       cmd->target = target;
   1765       cmd->samples = samples;
   1766       cmd->internalformat = internalformat;
   1767       cmd->width = width;
   1768       cmd->height = height;
   1769       cmd->fixedsamplelocations = fixedsamplelocations;
   1770       _mesa_post_marshal_hook(ctx);
   1771       return;
   1772    }
   1773 
   1774    _mesa_glthread_finish(ctx);
   1775    debug_print_sync_fallback("TexImage2DMultisample");
   1776    CALL_TexImage2DMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height, fixedsamplelocations));
   1777 }
   1778 
   1779 
   1780 /* TexParameterx: marshalled asynchronously */
   1781 struct marshal_cmd_TexParameterx
   1782 {
   1783    struct marshal_cmd_base cmd_base;
   1784    GLenum target;
   1785    GLenum pname;
   1786    GLfixed param;
   1787 };
   1788 static inline void
   1789 _mesa_unmarshal_TexParameterx(struct gl_context *ctx, const struct marshal_cmd_TexParameterx *cmd)
   1790 {
   1791    const GLenum target = cmd->target;
   1792    const GLenum pname = cmd->pname;
   1793    const GLfixed param = cmd->param;
   1794    CALL_TexParameterx(ctx->CurrentServerDispatch, (target, pname, param));
   1795 }
   1796 static void GLAPIENTRY
   1797 _mesa_marshal_TexParameterx(GLenum target, GLenum pname, GLfixed param)
   1798 {
   1799    GET_CURRENT_CONTEXT(ctx);
   1800    size_t cmd_size = sizeof(struct marshal_cmd_TexParameterx);
   1801    struct marshal_cmd_TexParameterx *cmd;
   1802    debug_print_marshal("TexParameterx");
   1803    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1804       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexParameterx, cmd_size);
   1805       cmd->target = target;
   1806       cmd->pname = pname;
   1807       cmd->param = param;
   1808       _mesa_post_marshal_hook(ctx);
   1809       return;
   1810    }
   1811 
   1812    _mesa_glthread_finish(ctx);
   1813    debug_print_sync_fallback("TexParameterx");
   1814    CALL_TexParameterx(ctx->CurrentServerDispatch, (target, pname, param));
   1815 }
   1816 
   1817 
   1818 /* Rotatef: marshalled asynchronously */
   1819 struct marshal_cmd_Rotatef
   1820 {
   1821    struct marshal_cmd_base cmd_base;
   1822    GLfloat angle;
   1823    GLfloat x;
   1824    GLfloat y;
   1825    GLfloat z;
   1826 };
   1827 static inline void
   1828 _mesa_unmarshal_Rotatef(struct gl_context *ctx, const struct marshal_cmd_Rotatef *cmd)
   1829 {
   1830    const GLfloat angle = cmd->angle;
   1831    const GLfloat x = cmd->x;
   1832    const GLfloat y = cmd->y;
   1833    const GLfloat z = cmd->z;
   1834    CALL_Rotatef(ctx->CurrentServerDispatch, (angle, x, y, z));
   1835 }
   1836 static void GLAPIENTRY
   1837 _mesa_marshal_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z)
   1838 {
   1839    GET_CURRENT_CONTEXT(ctx);
   1840    size_t cmd_size = sizeof(struct marshal_cmd_Rotatef);
   1841    struct marshal_cmd_Rotatef *cmd;
   1842    debug_print_marshal("Rotatef");
   1843    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1844       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Rotatef, cmd_size);
   1845       cmd->angle = angle;
   1846       cmd->x = x;
   1847       cmd->y = y;
   1848       cmd->z = z;
   1849       _mesa_post_marshal_hook(ctx);
   1850       return;
   1851    }
   1852 
   1853    _mesa_glthread_finish(ctx);
   1854    debug_print_sync_fallback("Rotatef");
   1855    CALL_Rotatef(ctx->CurrentServerDispatch, (angle, x, y, z));
   1856 }
   1857 
   1858 
   1859 /* TexParameterf: marshalled asynchronously */
   1860 struct marshal_cmd_TexParameterf
   1861 {
   1862    struct marshal_cmd_base cmd_base;
   1863    GLenum target;
   1864    GLenum pname;
   1865    GLfloat param;
   1866 };
   1867 static inline void
   1868 _mesa_unmarshal_TexParameterf(struct gl_context *ctx, const struct marshal_cmd_TexParameterf *cmd)
   1869 {
   1870    const GLenum target = cmd->target;
   1871    const GLenum pname = cmd->pname;
   1872    const GLfloat param = cmd->param;
   1873    CALL_TexParameterf(ctx->CurrentServerDispatch, (target, pname, param));
   1874 }
   1875 static void GLAPIENTRY
   1876 _mesa_marshal_TexParameterf(GLenum target, GLenum pname, GLfloat param)
   1877 {
   1878    GET_CURRENT_CONTEXT(ctx);
   1879    size_t cmd_size = sizeof(struct marshal_cmd_TexParameterf);
   1880    struct marshal_cmd_TexParameterf *cmd;
   1881    debug_print_marshal("TexParameterf");
   1882    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1883       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexParameterf, cmd_size);
   1884       cmd->target = target;
   1885       cmd->pname = pname;
   1886       cmd->param = param;
   1887       _mesa_post_marshal_hook(ctx);
   1888       return;
   1889    }
   1890 
   1891    _mesa_glthread_finish(ctx);
   1892    debug_print_sync_fallback("TexParameterf");
   1893    CALL_TexParameterf(ctx->CurrentServerDispatch, (target, pname, param));
   1894 }
   1895 
   1896 
   1897 /* TexParameteri: marshalled asynchronously */
   1898 struct marshal_cmd_TexParameteri
   1899 {
   1900    struct marshal_cmd_base cmd_base;
   1901    GLenum target;
   1902    GLenum pname;
   1903    GLint param;
   1904 };
   1905 static inline void
   1906 _mesa_unmarshal_TexParameteri(struct gl_context *ctx, const struct marshal_cmd_TexParameteri *cmd)
   1907 {
   1908    const GLenum target = cmd->target;
   1909    const GLenum pname = cmd->pname;
   1910    const GLint param = cmd->param;
   1911    CALL_TexParameteri(ctx->CurrentServerDispatch, (target, pname, param));
   1912 }
   1913 static void GLAPIENTRY
   1914 _mesa_marshal_TexParameteri(GLenum target, GLenum pname, GLint param)
   1915 {
   1916    GET_CURRENT_CONTEXT(ctx);
   1917    size_t cmd_size = sizeof(struct marshal_cmd_TexParameteri);
   1918    struct marshal_cmd_TexParameteri *cmd;
   1919    debug_print_marshal("TexParameteri");
   1920    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1921       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexParameteri, cmd_size);
   1922       cmd->target = target;
   1923       cmd->pname = pname;
   1924       cmd->param = param;
   1925       _mesa_post_marshal_hook(ctx);
   1926       return;
   1927    }
   1928 
   1929    _mesa_glthread_finish(ctx);
   1930    debug_print_sync_fallback("TexParameteri");
   1931    CALL_TexParameteri(ctx->CurrentServerDispatch, (target, pname, param));
   1932 }
   1933 
   1934 
   1935 /* GetUniformiv: marshalled synchronously */
   1936 static void GLAPIENTRY
   1937 _mesa_marshal_GetUniformiv(GLuint program, GLint location, GLint * params)
   1938 {
   1939    GET_CURRENT_CONTEXT(ctx);
   1940    _mesa_glthread_finish(ctx);
   1941    debug_print_sync("GetUniformiv");
   1942    CALL_GetUniformiv(ctx->CurrentServerDispatch, (program, location, params));
   1943 }
   1944 
   1945 
   1946 /* ClearBufferSubData: marshalled synchronously */
   1947 static void GLAPIENTRY
   1948 _mesa_marshal_ClearBufferSubData(GLenum target, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid * data)
   1949 {
   1950    GET_CURRENT_CONTEXT(ctx);
   1951    _mesa_glthread_finish(ctx);
   1952    debug_print_sync("ClearBufferSubData");
   1953    CALL_ClearBufferSubData(ctx->CurrentServerDispatch, (target, internalformat, offset, size, format, type, data));
   1954 }
   1955 
   1956 
   1957 /* TextureParameterfv: marshalled synchronously */
   1958 static void GLAPIENTRY
   1959 _mesa_marshal_TextureParameterfv(GLuint texture, GLenum pname, const GLfloat * param)
   1960 {
   1961    GET_CURRENT_CONTEXT(ctx);
   1962    _mesa_glthread_finish(ctx);
   1963    debug_print_sync("TextureParameterfv");
   1964    CALL_TextureParameterfv(ctx->CurrentServerDispatch, (texture, pname, param));
   1965 }
   1966 
   1967 
   1968 /* VDPAUFiniNV: marshalled asynchronously */
   1969 struct marshal_cmd_VDPAUFiniNV
   1970 {
   1971    struct marshal_cmd_base cmd_base;
   1972 };
   1973 static inline void
   1974 _mesa_unmarshal_VDPAUFiniNV(struct gl_context *ctx, const struct marshal_cmd_VDPAUFiniNV *cmd)
   1975 {
   1976    CALL_VDPAUFiniNV(ctx->CurrentServerDispatch, ());
   1977 }
   1978 static void GLAPIENTRY
   1979 _mesa_marshal_VDPAUFiniNV(void)
   1980 {
   1981    GET_CURRENT_CONTEXT(ctx);
   1982    size_t cmd_size = sizeof(struct marshal_cmd_VDPAUFiniNV);
   1983    struct marshal_cmd_VDPAUFiniNV *cmd;
   1984    debug_print_marshal("VDPAUFiniNV");
   1985    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   1986       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VDPAUFiniNV, cmd_size);
   1987       (void) cmd;
   1988 
   1989       _mesa_post_marshal_hook(ctx);
   1990       return;
   1991    }
   1992 
   1993    _mesa_glthread_finish(ctx);
   1994    debug_print_sync_fallback("VDPAUFiniNV");
   1995    CALL_VDPAUFiniNV(ctx->CurrentServerDispatch, ());
   1996 }
   1997 
   1998 
   1999 /* ProgramUniformMatrix4x2fv: marshalled asynchronously */
   2000 struct marshal_cmd_ProgramUniformMatrix4x2fv
   2001 {
   2002    struct marshal_cmd_base cmd_base;
   2003    GLuint program;
   2004    GLint location;
   2005    GLsizei count;
   2006    GLboolean transpose;
   2007    /* Next safe_mul(count, 32) bytes are GLfloat value[count][8] */
   2008 };
   2009 static inline void
   2010 _mesa_unmarshal_ProgramUniformMatrix4x2fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix4x2fv *cmd)
   2011 {
   2012    const GLuint program = cmd->program;
   2013    const GLint location = cmd->location;
   2014    const GLsizei count = cmd->count;
   2015    const GLboolean transpose = cmd->transpose;
   2016    const GLfloat * value;
   2017    const char *variable_data = (const char *) (cmd + 1);
   2018    value = (const GLfloat *) variable_data;
   2019    variable_data += count * 32;
   2020    CALL_ProgramUniformMatrix4x2fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   2021 }
   2022 static void GLAPIENTRY
   2023 _mesa_marshal_ProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   2024 {
   2025    GET_CURRENT_CONTEXT(ctx);
   2026    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix4x2fv) + safe_mul(count, 32);
   2027    struct marshal_cmd_ProgramUniformMatrix4x2fv *cmd;
   2028    debug_print_marshal("ProgramUniformMatrix4x2fv");
   2029    if (unlikely(safe_mul(count, 32) < 0)) {
   2030       goto fallback_to_sync;
   2031    }
   2032    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2033       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix4x2fv, cmd_size);
   2034       cmd->program = program;
   2035       cmd->location = location;
   2036       cmd->count = count;
   2037       cmd->transpose = transpose;
   2038       char *variable_data = (char *) (cmd + 1);
   2039       memcpy(variable_data, value, count * 32);
   2040       variable_data += count * 32;
   2041       _mesa_post_marshal_hook(ctx);
   2042       return;
   2043    }
   2044 
   2045 fallback_to_sync:
   2046    _mesa_glthread_finish(ctx);
   2047    debug_print_sync_fallback("ProgramUniformMatrix4x2fv");
   2048    CALL_ProgramUniformMatrix4x2fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   2049 }
   2050 
   2051 
   2052 /* ProgramUniform2f: marshalled asynchronously */
   2053 struct marshal_cmd_ProgramUniform2f
   2054 {
   2055    struct marshal_cmd_base cmd_base;
   2056    GLuint program;
   2057    GLint location;
   2058    GLfloat x;
   2059    GLfloat y;
   2060 };
   2061 static inline void
   2062 _mesa_unmarshal_ProgramUniform2f(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2f *cmd)
   2063 {
   2064    const GLuint program = cmd->program;
   2065    const GLint location = cmd->location;
   2066    const GLfloat x = cmd->x;
   2067    const GLfloat y = cmd->y;
   2068    CALL_ProgramUniform2f(ctx->CurrentServerDispatch, (program, location, x, y));
   2069 }
   2070 static void GLAPIENTRY
   2071 _mesa_marshal_ProgramUniform2f(GLuint program, GLint location, GLfloat x, GLfloat y)
   2072 {
   2073    GET_CURRENT_CONTEXT(ctx);
   2074    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform2f);
   2075    struct marshal_cmd_ProgramUniform2f *cmd;
   2076    debug_print_marshal("ProgramUniform2f");
   2077    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2078       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2f, cmd_size);
   2079       cmd->program = program;
   2080       cmd->location = location;
   2081       cmd->x = x;
   2082       cmd->y = y;
   2083       _mesa_post_marshal_hook(ctx);
   2084       return;
   2085    }
   2086 
   2087    _mesa_glthread_finish(ctx);
   2088    debug_print_sync_fallback("ProgramUniform2f");
   2089    CALL_ProgramUniform2f(ctx->CurrentServerDispatch, (program, location, x, y));
   2090 }
   2091 
   2092 
   2093 /* ProgramUniform2d: marshalled asynchronously */
   2094 struct marshal_cmd_ProgramUniform2d
   2095 {
   2096    struct marshal_cmd_base cmd_base;
   2097    GLuint program;
   2098    GLint location;
   2099    GLdouble x;
   2100    GLdouble y;
   2101 };
   2102 static inline void
   2103 _mesa_unmarshal_ProgramUniform2d(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2d *cmd)
   2104 {
   2105    const GLuint program = cmd->program;
   2106    const GLint location = cmd->location;
   2107    const GLdouble x = cmd->x;
   2108    const GLdouble y = cmd->y;
   2109    CALL_ProgramUniform2d(ctx->CurrentServerDispatch, (program, location, x, y));
   2110 }
   2111 static void GLAPIENTRY
   2112 _mesa_marshal_ProgramUniform2d(GLuint program, GLint location, GLdouble x, GLdouble y)
   2113 {
   2114    GET_CURRENT_CONTEXT(ctx);
   2115    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform2d);
   2116    struct marshal_cmd_ProgramUniform2d *cmd;
   2117    debug_print_marshal("ProgramUniform2d");
   2118    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2119       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2d, cmd_size);
   2120       cmd->program = program;
   2121       cmd->location = location;
   2122       cmd->x = x;
   2123       cmd->y = y;
   2124       _mesa_post_marshal_hook(ctx);
   2125       return;
   2126    }
   2127 
   2128    _mesa_glthread_finish(ctx);
   2129    debug_print_sync_fallback("ProgramUniform2d");
   2130    CALL_ProgramUniform2d(ctx->CurrentServerDispatch, (program, location, x, y));
   2131 }
   2132 
   2133 
   2134 /* ProgramUniform2i: marshalled asynchronously */
   2135 struct marshal_cmd_ProgramUniform2i
   2136 {
   2137    struct marshal_cmd_base cmd_base;
   2138    GLuint program;
   2139    GLint location;
   2140    GLint x;
   2141    GLint y;
   2142 };
   2143 static inline void
   2144 _mesa_unmarshal_ProgramUniform2i(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2i *cmd)
   2145 {
   2146    const GLuint program = cmd->program;
   2147    const GLint location = cmd->location;
   2148    const GLint x = cmd->x;
   2149    const GLint y = cmd->y;
   2150    CALL_ProgramUniform2i(ctx->CurrentServerDispatch, (program, location, x, y));
   2151 }
   2152 static void GLAPIENTRY
   2153 _mesa_marshal_ProgramUniform2i(GLuint program, GLint location, GLint x, GLint y)
   2154 {
   2155    GET_CURRENT_CONTEXT(ctx);
   2156    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform2i);
   2157    struct marshal_cmd_ProgramUniform2i *cmd;
   2158    debug_print_marshal("ProgramUniform2i");
   2159    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2160       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2i, cmd_size);
   2161       cmd->program = program;
   2162       cmd->location = location;
   2163       cmd->x = x;
   2164       cmd->y = y;
   2165       _mesa_post_marshal_hook(ctx);
   2166       return;
   2167    }
   2168 
   2169    _mesa_glthread_finish(ctx);
   2170    debug_print_sync_fallback("ProgramUniform2i");
   2171    CALL_ProgramUniform2i(ctx->CurrentServerDispatch, (program, location, x, y));
   2172 }
   2173 
   2174 
   2175 /* Fogx: marshalled asynchronously */
   2176 struct marshal_cmd_Fogx
   2177 {
   2178    struct marshal_cmd_base cmd_base;
   2179    GLenum pname;
   2180    GLfixed param;
   2181 };
   2182 static inline void
   2183 _mesa_unmarshal_Fogx(struct gl_context *ctx, const struct marshal_cmd_Fogx *cmd)
   2184 {
   2185    const GLenum pname = cmd->pname;
   2186    const GLfixed param = cmd->param;
   2187    CALL_Fogx(ctx->CurrentServerDispatch, (pname, param));
   2188 }
   2189 static void GLAPIENTRY
   2190 _mesa_marshal_Fogx(GLenum pname, GLfixed param)
   2191 {
   2192    GET_CURRENT_CONTEXT(ctx);
   2193    size_t cmd_size = sizeof(struct marshal_cmd_Fogx);
   2194    struct marshal_cmd_Fogx *cmd;
   2195    debug_print_marshal("Fogx");
   2196    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2197       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Fogx, cmd_size);
   2198       cmd->pname = pname;
   2199       cmd->param = param;
   2200       _mesa_post_marshal_hook(ctx);
   2201       return;
   2202    }
   2203 
   2204    _mesa_glthread_finish(ctx);
   2205    debug_print_sync_fallback("Fogx");
   2206    CALL_Fogx(ctx->CurrentServerDispatch, (pname, param));
   2207 }
   2208 
   2209 
   2210 /* Uniform3ui64ARB: marshalled asynchronously */
   2211 struct marshal_cmd_Uniform3ui64ARB
   2212 {
   2213    struct marshal_cmd_base cmd_base;
   2214    GLint location;
   2215    GLuint64 x;
   2216    GLuint64 y;
   2217    GLuint64 z;
   2218 };
   2219 static inline void
   2220 _mesa_unmarshal_Uniform3ui64ARB(struct gl_context *ctx, const struct marshal_cmd_Uniform3ui64ARB *cmd)
   2221 {
   2222    const GLint location = cmd->location;
   2223    const GLuint64 x = cmd->x;
   2224    const GLuint64 y = cmd->y;
   2225    const GLuint64 z = cmd->z;
   2226    CALL_Uniform3ui64ARB(ctx->CurrentServerDispatch, (location, x, y, z));
   2227 }
   2228 static void GLAPIENTRY
   2229 _mesa_marshal_Uniform3ui64ARB(GLint location, GLuint64 x, GLuint64 y, GLuint64 z)
   2230 {
   2231    GET_CURRENT_CONTEXT(ctx);
   2232    size_t cmd_size = sizeof(struct marshal_cmd_Uniform3ui64ARB);
   2233    struct marshal_cmd_Uniform3ui64ARB *cmd;
   2234    debug_print_marshal("Uniform3ui64ARB");
   2235    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2236       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3ui64ARB, cmd_size);
   2237       cmd->location = location;
   2238       cmd->x = x;
   2239       cmd->y = y;
   2240       cmd->z = z;
   2241       _mesa_post_marshal_hook(ctx);
   2242       return;
   2243    }
   2244 
   2245    _mesa_glthread_finish(ctx);
   2246    debug_print_sync_fallback("Uniform3ui64ARB");
   2247    CALL_Uniform3ui64ARB(ctx->CurrentServerDispatch, (location, x, y, z));
   2248 }
   2249 
   2250 
   2251 /* Fogf: marshalled asynchronously */
   2252 struct marshal_cmd_Fogf
   2253 {
   2254    struct marshal_cmd_base cmd_base;
   2255    GLenum pname;
   2256    GLfloat param;
   2257 };
   2258 static inline void
   2259 _mesa_unmarshal_Fogf(struct gl_context *ctx, const struct marshal_cmd_Fogf *cmd)
   2260 {
   2261    const GLenum pname = cmd->pname;
   2262    const GLfloat param = cmd->param;
   2263    CALL_Fogf(ctx->CurrentServerDispatch, (pname, param));
   2264 }
   2265 static void GLAPIENTRY
   2266 _mesa_marshal_Fogf(GLenum pname, GLfloat param)
   2267 {
   2268    GET_CURRENT_CONTEXT(ctx);
   2269    size_t cmd_size = sizeof(struct marshal_cmd_Fogf);
   2270    struct marshal_cmd_Fogf *cmd;
   2271    debug_print_marshal("Fogf");
   2272    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2273       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Fogf, cmd_size);
   2274       cmd->pname = pname;
   2275       cmd->param = param;
   2276       _mesa_post_marshal_hook(ctx);
   2277       return;
   2278    }
   2279 
   2280    _mesa_glthread_finish(ctx);
   2281    debug_print_sync_fallback("Fogf");
   2282    CALL_Fogf(ctx->CurrentServerDispatch, (pname, param));
   2283 }
   2284 
   2285 
   2286 /* TexSubImage1D: marshalled synchronously */
   2287 static void GLAPIENTRY
   2288 _mesa_marshal_TexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels)
   2289 {
   2290    GET_CURRENT_CONTEXT(ctx);
   2291    _mesa_glthread_finish(ctx);
   2292    debug_print_sync("TexSubImage1D");
   2293    CALL_TexSubImage1D(ctx->CurrentServerDispatch, (target, level, xoffset, width, format, type, pixels));
   2294 }
   2295 
   2296 
   2297 /* ProgramUniform3ui64vARB: marshalled asynchronously */
   2298 struct marshal_cmd_ProgramUniform3ui64vARB
   2299 {
   2300    struct marshal_cmd_base cmd_base;
   2301    GLuint program;
   2302    GLint location;
   2303    GLsizei count;
   2304    /* Next safe_mul(count, 24) bytes are GLuint64 value[count][3] */
   2305 };
   2306 static inline void
   2307 _mesa_unmarshal_ProgramUniform3ui64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3ui64vARB *cmd)
   2308 {
   2309    const GLuint program = cmd->program;
   2310    const GLint location = cmd->location;
   2311    const GLsizei count = cmd->count;
   2312    const GLuint64 * value;
   2313    const char *variable_data = (const char *) (cmd + 1);
   2314    value = (const GLuint64 *) variable_data;
   2315    variable_data += count * 24;
   2316    CALL_ProgramUniform3ui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
   2317 }
   2318 static void GLAPIENTRY
   2319 _mesa_marshal_ProgramUniform3ui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 * value)
   2320 {
   2321    GET_CURRENT_CONTEXT(ctx);
   2322    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform3ui64vARB) + safe_mul(count, 24);
   2323    struct marshal_cmd_ProgramUniform3ui64vARB *cmd;
   2324    debug_print_marshal("ProgramUniform3ui64vARB");
   2325    if (unlikely(safe_mul(count, 24) < 0)) {
   2326       goto fallback_to_sync;
   2327    }
   2328    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2329       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3ui64vARB, cmd_size);
   2330       cmd->program = program;
   2331       cmd->location = location;
   2332       cmd->count = count;
   2333       char *variable_data = (char *) (cmd + 1);
   2334       memcpy(variable_data, value, count * 24);
   2335       variable_data += count * 24;
   2336       _mesa_post_marshal_hook(ctx);
   2337       return;
   2338    }
   2339 
   2340 fallback_to_sync:
   2341    _mesa_glthread_finish(ctx);
   2342    debug_print_sync_fallback("ProgramUniform3ui64vARB");
   2343    CALL_ProgramUniform3ui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
   2344 }
   2345 
   2346 
   2347 /* Color4usv: marshalled asynchronously */
   2348 struct marshal_cmd_Color4usv
   2349 {
   2350    struct marshal_cmd_base cmd_base;
   2351    GLushort v[4];
   2352 };
   2353 static inline void
   2354 _mesa_unmarshal_Color4usv(struct gl_context *ctx, const struct marshal_cmd_Color4usv *cmd)
   2355 {
   2356    const GLushort * v = cmd->v;
   2357    CALL_Color4usv(ctx->CurrentServerDispatch, (v));
   2358 }
   2359 static void GLAPIENTRY
   2360 _mesa_marshal_Color4usv(const GLushort * v)
   2361 {
   2362    GET_CURRENT_CONTEXT(ctx);
   2363    size_t cmd_size = sizeof(struct marshal_cmd_Color4usv);
   2364    struct marshal_cmd_Color4usv *cmd;
   2365    debug_print_marshal("Color4usv");
   2366    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2367       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4usv, cmd_size);
   2368       memcpy(cmd->v, v, 8);
   2369       _mesa_post_marshal_hook(ctx);
   2370       return;
   2371    }
   2372 
   2373    _mesa_glthread_finish(ctx);
   2374    debug_print_sync_fallback("Color4usv");
   2375    CALL_Color4usv(ctx->CurrentServerDispatch, (v));
   2376 }
   2377 
   2378 
   2379 /* Fogi: marshalled asynchronously */
   2380 struct marshal_cmd_Fogi
   2381 {
   2382    struct marshal_cmd_base cmd_base;
   2383    GLenum pname;
   2384    GLint param;
   2385 };
   2386 static inline void
   2387 _mesa_unmarshal_Fogi(struct gl_context *ctx, const struct marshal_cmd_Fogi *cmd)
   2388 {
   2389    const GLenum pname = cmd->pname;
   2390    const GLint param = cmd->param;
   2391    CALL_Fogi(ctx->CurrentServerDispatch, (pname, param));
   2392 }
   2393 static void GLAPIENTRY
   2394 _mesa_marshal_Fogi(GLenum pname, GLint param)
   2395 {
   2396    GET_CURRENT_CONTEXT(ctx);
   2397    size_t cmd_size = sizeof(struct marshal_cmd_Fogi);
   2398    struct marshal_cmd_Fogi *cmd;
   2399    debug_print_marshal("Fogi");
   2400    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2401       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Fogi, cmd_size);
   2402       cmd->pname = pname;
   2403       cmd->param = param;
   2404       _mesa_post_marshal_hook(ctx);
   2405       return;
   2406    }
   2407 
   2408    _mesa_glthread_finish(ctx);
   2409    debug_print_sync_fallback("Fogi");
   2410    CALL_Fogi(ctx->CurrentServerDispatch, (pname, param));
   2411 }
   2412 
   2413 
   2414 /* DepthFunc: marshalled asynchronously */
   2415 struct marshal_cmd_DepthFunc
   2416 {
   2417    struct marshal_cmd_base cmd_base;
   2418    GLenum func;
   2419 };
   2420 static inline void
   2421 _mesa_unmarshal_DepthFunc(struct gl_context *ctx, const struct marshal_cmd_DepthFunc *cmd)
   2422 {
   2423    const GLenum func = cmd->func;
   2424    CALL_DepthFunc(ctx->CurrentServerDispatch, (func));
   2425 }
   2426 static void GLAPIENTRY
   2427 _mesa_marshal_DepthFunc(GLenum func)
   2428 {
   2429    GET_CURRENT_CONTEXT(ctx);
   2430    size_t cmd_size = sizeof(struct marshal_cmd_DepthFunc);
   2431    struct marshal_cmd_DepthFunc *cmd;
   2432    debug_print_marshal("DepthFunc");
   2433    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2434       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DepthFunc, cmd_size);
   2435       cmd->func = func;
   2436       _mesa_post_marshal_hook(ctx);
   2437       return;
   2438    }
   2439 
   2440    _mesa_glthread_finish(ctx);
   2441    debug_print_sync_fallback("DepthFunc");
   2442    CALL_DepthFunc(ctx->CurrentServerDispatch, (func));
   2443 }
   2444 
   2445 
   2446 /* GetSamplerParameterIiv: marshalled synchronously */
   2447 static void GLAPIENTRY
   2448 _mesa_marshal_GetSamplerParameterIiv(GLuint sampler, GLenum pname, GLint * params)
   2449 {
   2450    GET_CURRENT_CONTEXT(ctx);
   2451    _mesa_glthread_finish(ctx);
   2452    debug_print_sync("GetSamplerParameterIiv");
   2453    CALL_GetSamplerParameterIiv(ctx->CurrentServerDispatch, (sampler, pname, params));
   2454 }
   2455 
   2456 
   2457 /* VertexArrayAttribLFormat: marshalled asynchronously */
   2458 struct marshal_cmd_VertexArrayAttribLFormat
   2459 {
   2460    struct marshal_cmd_base cmd_base;
   2461    GLuint vaobj;
   2462    GLuint attribindex;
   2463    GLint size;
   2464    GLenum type;
   2465    GLuint relativeoffset;
   2466 };
   2467 static inline void
   2468 _mesa_unmarshal_VertexArrayAttribLFormat(struct gl_context *ctx, const struct marshal_cmd_VertexArrayAttribLFormat *cmd)
   2469 {
   2470    const GLuint vaobj = cmd->vaobj;
   2471    const GLuint attribindex = cmd->attribindex;
   2472    const GLint size = cmd->size;
   2473    const GLenum type = cmd->type;
   2474    const GLuint relativeoffset = cmd->relativeoffset;
   2475    CALL_VertexArrayAttribLFormat(ctx->CurrentServerDispatch, (vaobj, attribindex, size, type, relativeoffset));
   2476 }
   2477 static void GLAPIENTRY
   2478 _mesa_marshal_VertexArrayAttribLFormat(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
   2479 {
   2480    GET_CURRENT_CONTEXT(ctx);
   2481    size_t cmd_size = sizeof(struct marshal_cmd_VertexArrayAttribLFormat);
   2482    struct marshal_cmd_VertexArrayAttribLFormat *cmd;
   2483    debug_print_marshal("VertexArrayAttribLFormat");
   2484    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2485       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayAttribLFormat, cmd_size);
   2486       cmd->vaobj = vaobj;
   2487       cmd->attribindex = attribindex;
   2488       cmd->size = size;
   2489       cmd->type = type;
   2490       cmd->relativeoffset = relativeoffset;
   2491       _mesa_post_marshal_hook(ctx);
   2492       return;
   2493    }
   2494 
   2495    _mesa_glthread_finish(ctx);
   2496    debug_print_sync_fallback("VertexArrayAttribLFormat");
   2497    CALL_VertexArrayAttribLFormat(ctx->CurrentServerDispatch, (vaobj, attribindex, size, type, relativeoffset));
   2498 }
   2499 
   2500 
   2501 /* VertexAttribI4uiEXT: marshalled asynchronously */
   2502 struct marshal_cmd_VertexAttribI4uiEXT
   2503 {
   2504    struct marshal_cmd_base cmd_base;
   2505    GLuint index;
   2506    GLuint x;
   2507    GLuint y;
   2508    GLuint z;
   2509    GLuint w;
   2510 };
   2511 static inline void
   2512 _mesa_unmarshal_VertexAttribI4uiEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI4uiEXT *cmd)
   2513 {
   2514    const GLuint index = cmd->index;
   2515    const GLuint x = cmd->x;
   2516    const GLuint y = cmd->y;
   2517    const GLuint z = cmd->z;
   2518    const GLuint w = cmd->w;
   2519    CALL_VertexAttribI4uiEXT(ctx->CurrentServerDispatch, (index, x, y, z, w));
   2520 }
   2521 static void GLAPIENTRY
   2522 _mesa_marshal_VertexAttribI4uiEXT(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
   2523 {
   2524    GET_CURRENT_CONTEXT(ctx);
   2525    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribI4uiEXT);
   2526    struct marshal_cmd_VertexAttribI4uiEXT *cmd;
   2527    debug_print_marshal("VertexAttribI4uiEXT");
   2528    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2529       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI4uiEXT, cmd_size);
   2530       cmd->index = index;
   2531       cmd->x = x;
   2532       cmd->y = y;
   2533       cmd->z = z;
   2534       cmd->w = w;
   2535       _mesa_post_marshal_hook(ctx);
   2536       return;
   2537    }
   2538 
   2539    _mesa_glthread_finish(ctx);
   2540    debug_print_sync_fallback("VertexAttribI4uiEXT");
   2541    CALL_VertexAttribI4uiEXT(ctx->CurrentServerDispatch, (index, x, y, z, w));
   2542 }
   2543 
   2544 
   2545 /* DrawElementsInstancedBaseVertexBaseInstance: marshalled asynchronously */
   2546 struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance
   2547 {
   2548    struct marshal_cmd_base cmd_base;
   2549    GLenum mode;
   2550    GLsizei count;
   2551    GLenum type;
   2552    const GLvoid * indices;
   2553    GLsizei primcount;
   2554    GLint basevertex;
   2555    GLuint baseinstance;
   2556 };
   2557 static inline void
   2558 _mesa_unmarshal_DrawElementsInstancedBaseVertexBaseInstance(struct gl_context *ctx, const struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance *cmd)
   2559 {
   2560    const GLenum mode = cmd->mode;
   2561    const GLsizei count = cmd->count;
   2562    const GLenum type = cmd->type;
   2563    const GLvoid * indices = cmd->indices;
   2564    const GLsizei primcount = cmd->primcount;
   2565    const GLint basevertex = cmd->basevertex;
   2566    const GLuint baseinstance = cmd->baseinstance;
   2567    CALL_DrawElementsInstancedBaseVertexBaseInstance(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount, basevertex, baseinstance));
   2568 }
   2569 static void GLAPIENTRY
   2570 _mesa_marshal_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount, GLint basevertex, GLuint baseinstance)
   2571 {
   2572    GET_CURRENT_CONTEXT(ctx);
   2573    size_t cmd_size = sizeof(struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance);
   2574    struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance *cmd;
   2575    debug_print_marshal("DrawElementsInstancedBaseVertexBaseInstance");
   2576    if (_mesa_glthread_is_non_vbo_draw_elements(ctx)) {
   2577       _mesa_glthread_finish(ctx);
   2578       _mesa_glthread_restore_dispatch(ctx);
   2579       debug_print_sync_fallback("DrawElementsInstancedBaseVertexBaseInstance");
   2580       CALL_DrawElementsInstancedBaseVertexBaseInstance(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount, basevertex, baseinstance));
   2581       return;
   2582    }
   2583    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2584       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawElementsInstancedBaseVertexBaseInstance, cmd_size);
   2585       cmd->mode = mode;
   2586       cmd->count = count;
   2587       cmd->type = type;
   2588       cmd->indices = indices;
   2589       cmd->primcount = primcount;
   2590       cmd->basevertex = basevertex;
   2591       cmd->baseinstance = baseinstance;
   2592       _mesa_post_marshal_hook(ctx);
   2593       return;
   2594    }
   2595 
   2596    _mesa_glthread_finish(ctx);
   2597    debug_print_sync_fallback("DrawElementsInstancedBaseVertexBaseInstance");
   2598    CALL_DrawElementsInstancedBaseVertexBaseInstance(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount, basevertex, baseinstance));
   2599 }
   2600 
   2601 
   2602 /* ProgramEnvParameter4dvARB: marshalled asynchronously */
   2603 struct marshal_cmd_ProgramEnvParameter4dvARB
   2604 {
   2605    struct marshal_cmd_base cmd_base;
   2606    GLenum target;
   2607    GLuint index;
   2608    GLdouble params[4];
   2609 };
   2610 static inline void
   2611 _mesa_unmarshal_ProgramEnvParameter4dvARB(struct gl_context *ctx, const struct marshal_cmd_ProgramEnvParameter4dvARB *cmd)
   2612 {
   2613    const GLenum target = cmd->target;
   2614    const GLuint index = cmd->index;
   2615    const GLdouble * params = cmd->params;
   2616    CALL_ProgramEnvParameter4dvARB(ctx->CurrentServerDispatch, (target, index, params));
   2617 }
   2618 static void GLAPIENTRY
   2619 _mesa_marshal_ProgramEnvParameter4dvARB(GLenum target, GLuint index, const GLdouble * params)
   2620 {
   2621    GET_CURRENT_CONTEXT(ctx);
   2622    size_t cmd_size = sizeof(struct marshal_cmd_ProgramEnvParameter4dvARB);
   2623    struct marshal_cmd_ProgramEnvParameter4dvARB *cmd;
   2624    debug_print_marshal("ProgramEnvParameter4dvARB");
   2625    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2626       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramEnvParameter4dvARB, cmd_size);
   2627       cmd->target = target;
   2628       cmd->index = index;
   2629       memcpy(cmd->params, params, 32);
   2630       _mesa_post_marshal_hook(ctx);
   2631       return;
   2632    }
   2633 
   2634    _mesa_glthread_finish(ctx);
   2635    debug_print_sync_fallback("ProgramEnvParameter4dvARB");
   2636    CALL_ProgramEnvParameter4dvARB(ctx->CurrentServerDispatch, (target, index, params));
   2637 }
   2638 
   2639 
   2640 /* ColorTableParameteriv: marshalled synchronously */
   2641 static void GLAPIENTRY
   2642 _mesa_marshal_ColorTableParameteriv(GLenum target, GLenum pname, const GLint * params)
   2643 {
   2644    GET_CURRENT_CONTEXT(ctx);
   2645    _mesa_glthread_finish(ctx);
   2646    debug_print_sync("ColorTableParameteriv");
   2647    CALL_ColorTableParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
   2648 }
   2649 
   2650 
   2651 /* BindSamplers: marshalled synchronously */
   2652 static void GLAPIENTRY
   2653 _mesa_marshal_BindSamplers(GLuint first, GLsizei count, const GLuint * samplers)
   2654 {
   2655    GET_CURRENT_CONTEXT(ctx);
   2656    _mesa_glthread_finish(ctx);
   2657    debug_print_sync("BindSamplers");
   2658    CALL_BindSamplers(ctx->CurrentServerDispatch, (first, count, samplers));
   2659 }
   2660 
   2661 
   2662 /* GetnCompressedTexImageARB: marshalled synchronously */
   2663 static void GLAPIENTRY
   2664 _mesa_marshal_GetnCompressedTexImageARB(GLenum target, GLint lod, GLsizei bufSize, GLvoid * img)
   2665 {
   2666    GET_CURRENT_CONTEXT(ctx);
   2667    _mesa_glthread_finish(ctx);
   2668    debug_print_sync("GetnCompressedTexImageARB");
   2669    CALL_GetnCompressedTexImageARB(ctx->CurrentServerDispatch, (target, lod, bufSize, img));
   2670 }
   2671 
   2672 
   2673 /* CopyNamedBufferSubData: marshalled asynchronously */
   2674 struct marshal_cmd_CopyNamedBufferSubData
   2675 {
   2676    struct marshal_cmd_base cmd_base;
   2677    GLuint readBuffer;
   2678    GLuint writeBuffer;
   2679    GLintptr readOffset;
   2680    GLintptr writeOffset;
   2681    GLsizeiptr size;
   2682 };
   2683 static inline void
   2684 _mesa_unmarshal_CopyNamedBufferSubData(struct gl_context *ctx, const struct marshal_cmd_CopyNamedBufferSubData *cmd)
   2685 {
   2686    const GLuint readBuffer = cmd->readBuffer;
   2687    const GLuint writeBuffer = cmd->writeBuffer;
   2688    const GLintptr readOffset = cmd->readOffset;
   2689    const GLintptr writeOffset = cmd->writeOffset;
   2690    const GLsizeiptr size = cmd->size;
   2691    CALL_CopyNamedBufferSubData(ctx->CurrentServerDispatch, (readBuffer, writeBuffer, readOffset, writeOffset, size));
   2692 }
   2693 static void GLAPIENTRY
   2694 _mesa_marshal_CopyNamedBufferSubData(GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
   2695 {
   2696    GET_CURRENT_CONTEXT(ctx);
   2697    size_t cmd_size = sizeof(struct marshal_cmd_CopyNamedBufferSubData);
   2698    struct marshal_cmd_CopyNamedBufferSubData *cmd;
   2699    debug_print_marshal("CopyNamedBufferSubData");
   2700    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2701       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyNamedBufferSubData, cmd_size);
   2702       cmd->readBuffer = readBuffer;
   2703       cmd->writeBuffer = writeBuffer;
   2704       cmd->readOffset = readOffset;
   2705       cmd->writeOffset = writeOffset;
   2706       cmd->size = size;
   2707       _mesa_post_marshal_hook(ctx);
   2708       return;
   2709    }
   2710 
   2711    _mesa_glthread_finish(ctx);
   2712    debug_print_sync_fallback("CopyNamedBufferSubData");
   2713    CALL_CopyNamedBufferSubData(ctx->CurrentServerDispatch, (readBuffer, writeBuffer, readOffset, writeOffset, size));
   2714 }
   2715 
   2716 
   2717 /* BindSampler: marshalled asynchronously */
   2718 struct marshal_cmd_BindSampler
   2719 {
   2720    struct marshal_cmd_base cmd_base;
   2721    GLuint unit;
   2722    GLuint sampler;
   2723 };
   2724 static inline void
   2725 _mesa_unmarshal_BindSampler(struct gl_context *ctx, const struct marshal_cmd_BindSampler *cmd)
   2726 {
   2727    const GLuint unit = cmd->unit;
   2728    const GLuint sampler = cmd->sampler;
   2729    CALL_BindSampler(ctx->CurrentServerDispatch, (unit, sampler));
   2730 }
   2731 static void GLAPIENTRY
   2732 _mesa_marshal_BindSampler(GLuint unit, GLuint sampler)
   2733 {
   2734    GET_CURRENT_CONTEXT(ctx);
   2735    size_t cmd_size = sizeof(struct marshal_cmd_BindSampler);
   2736    struct marshal_cmd_BindSampler *cmd;
   2737    debug_print_marshal("BindSampler");
   2738    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2739       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindSampler, cmd_size);
   2740       cmd->unit = unit;
   2741       cmd->sampler = sampler;
   2742       _mesa_post_marshal_hook(ctx);
   2743       return;
   2744    }
   2745 
   2746    _mesa_glthread_finish(ctx);
   2747    debug_print_sync_fallback("BindSampler");
   2748    CALL_BindSampler(ctx->CurrentServerDispatch, (unit, sampler));
   2749 }
   2750 
   2751 
   2752 /* GetUniformuiv: marshalled synchronously */
   2753 static void GLAPIENTRY
   2754 _mesa_marshal_GetUniformuiv(GLuint program, GLint location, GLuint * params)
   2755 {
   2756    GET_CURRENT_CONTEXT(ctx);
   2757    _mesa_glthread_finish(ctx);
   2758    debug_print_sync("GetUniformuiv");
   2759    CALL_GetUniformuiv(ctx->CurrentServerDispatch, (program, location, params));
   2760 }
   2761 
   2762 
   2763 /* GetQueryBufferObjectuiv: marshalled asynchronously */
   2764 struct marshal_cmd_GetQueryBufferObjectuiv
   2765 {
   2766    struct marshal_cmd_base cmd_base;
   2767    GLuint id;
   2768    GLuint buffer;
   2769    GLenum pname;
   2770    GLintptr offset;
   2771 };
   2772 static inline void
   2773 _mesa_unmarshal_GetQueryBufferObjectuiv(struct gl_context *ctx, const struct marshal_cmd_GetQueryBufferObjectuiv *cmd)
   2774 {
   2775    const GLuint id = cmd->id;
   2776    const GLuint buffer = cmd->buffer;
   2777    const GLenum pname = cmd->pname;
   2778    const GLintptr offset = cmd->offset;
   2779    CALL_GetQueryBufferObjectuiv(ctx->CurrentServerDispatch, (id, buffer, pname, offset));
   2780 }
   2781 static void GLAPIENTRY
   2782 _mesa_marshal_GetQueryBufferObjectuiv(GLuint id, GLuint buffer, GLenum pname, GLintptr offset)
   2783 {
   2784    GET_CURRENT_CONTEXT(ctx);
   2785    size_t cmd_size = sizeof(struct marshal_cmd_GetQueryBufferObjectuiv);
   2786    struct marshal_cmd_GetQueryBufferObjectuiv *cmd;
   2787    debug_print_marshal("GetQueryBufferObjectuiv");
   2788    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2789       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetQueryBufferObjectuiv, cmd_size);
   2790       cmd->id = id;
   2791       cmd->buffer = buffer;
   2792       cmd->pname = pname;
   2793       cmd->offset = offset;
   2794       _mesa_post_marshal_hook(ctx);
   2795       return;
   2796    }
   2797 
   2798    _mesa_glthread_finish(ctx);
   2799    debug_print_sync_fallback("GetQueryBufferObjectuiv");
   2800    CALL_GetQueryBufferObjectuiv(ctx->CurrentServerDispatch, (id, buffer, pname, offset));
   2801 }
   2802 
   2803 
   2804 /* MultiTexCoord2fARB: marshalled asynchronously */
   2805 struct marshal_cmd_MultiTexCoord2fARB
   2806 {
   2807    struct marshal_cmd_base cmd_base;
   2808    GLenum target;
   2809    GLfloat s;
   2810    GLfloat t;
   2811 };
   2812 static inline void
   2813 _mesa_unmarshal_MultiTexCoord2fARB(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2fARB *cmd)
   2814 {
   2815    const GLenum target = cmd->target;
   2816    const GLfloat s = cmd->s;
   2817    const GLfloat t = cmd->t;
   2818    CALL_MultiTexCoord2fARB(ctx->CurrentServerDispatch, (target, s, t));
   2819 }
   2820 static void GLAPIENTRY
   2821 _mesa_marshal_MultiTexCoord2fARB(GLenum target, GLfloat s, GLfloat t)
   2822 {
   2823    GET_CURRENT_CONTEXT(ctx);
   2824    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2fARB);
   2825    struct marshal_cmd_MultiTexCoord2fARB *cmd;
   2826    debug_print_marshal("MultiTexCoord2fARB");
   2827    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2828       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2fARB, cmd_size);
   2829       cmd->target = target;
   2830       cmd->s = s;
   2831       cmd->t = t;
   2832       _mesa_post_marshal_hook(ctx);
   2833       return;
   2834    }
   2835 
   2836    _mesa_glthread_finish(ctx);
   2837    debug_print_sync_fallback("MultiTexCoord2fARB");
   2838    CALL_MultiTexCoord2fARB(ctx->CurrentServerDispatch, (target, s, t));
   2839 }
   2840 
   2841 
   2842 /* Uniform1ui64ARB: marshalled asynchronously */
   2843 struct marshal_cmd_Uniform1ui64ARB
   2844 {
   2845    struct marshal_cmd_base cmd_base;
   2846    GLint location;
   2847    GLuint64 x;
   2848 };
   2849 static inline void
   2850 _mesa_unmarshal_Uniform1ui64ARB(struct gl_context *ctx, const struct marshal_cmd_Uniform1ui64ARB *cmd)
   2851 {
   2852    const GLint location = cmd->location;
   2853    const GLuint64 x = cmd->x;
   2854    CALL_Uniform1ui64ARB(ctx->CurrentServerDispatch, (location, x));
   2855 }
   2856 static void GLAPIENTRY
   2857 _mesa_marshal_Uniform1ui64ARB(GLint location, GLuint64 x)
   2858 {
   2859    GET_CURRENT_CONTEXT(ctx);
   2860    size_t cmd_size = sizeof(struct marshal_cmd_Uniform1ui64ARB);
   2861    struct marshal_cmd_Uniform1ui64ARB *cmd;
   2862    debug_print_marshal("Uniform1ui64ARB");
   2863    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2864       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1ui64ARB, cmd_size);
   2865       cmd->location = location;
   2866       cmd->x = x;
   2867       _mesa_post_marshal_hook(ctx);
   2868       return;
   2869    }
   2870 
   2871    _mesa_glthread_finish(ctx);
   2872    debug_print_sync_fallback("Uniform1ui64ARB");
   2873    CALL_Uniform1ui64ARB(ctx->CurrentServerDispatch, (location, x));
   2874 }
   2875 
   2876 
   2877 /* GetTextureImage: marshalled synchronously */
   2878 static void GLAPIENTRY
   2879 _mesa_marshal_GetTextureImage(GLuint texture, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid * pixels)
   2880 {
   2881    GET_CURRENT_CONTEXT(ctx);
   2882    _mesa_glthread_finish(ctx);
   2883    debug_print_sync("GetTextureImage");
   2884    CALL_GetTextureImage(ctx->CurrentServerDispatch, (texture, level, format, type, bufSize, pixels));
   2885 }
   2886 
   2887 
   2888 /* MultiTexCoord3iv: marshalled asynchronously */
   2889 struct marshal_cmd_MultiTexCoord3iv
   2890 {
   2891    struct marshal_cmd_base cmd_base;
   2892    GLenum target;
   2893    GLint v[3];
   2894 };
   2895 static inline void
   2896 _mesa_unmarshal_MultiTexCoord3iv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3iv *cmd)
   2897 {
   2898    const GLenum target = cmd->target;
   2899    const GLint * v = cmd->v;
   2900    CALL_MultiTexCoord3iv(ctx->CurrentServerDispatch, (target, v));
   2901 }
   2902 static void GLAPIENTRY
   2903 _mesa_marshal_MultiTexCoord3iv(GLenum target, const GLint * v)
   2904 {
   2905    GET_CURRENT_CONTEXT(ctx);
   2906    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3iv);
   2907    struct marshal_cmd_MultiTexCoord3iv *cmd;
   2908    debug_print_marshal("MultiTexCoord3iv");
   2909    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2910       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3iv, cmd_size);
   2911       cmd->target = target;
   2912       memcpy(cmd->v, v, 12);
   2913       _mesa_post_marshal_hook(ctx);
   2914       return;
   2915    }
   2916 
   2917    _mesa_glthread_finish(ctx);
   2918    debug_print_sync_fallback("MultiTexCoord3iv");
   2919    CALL_MultiTexCoord3iv(ctx->CurrentServerDispatch, (target, v));
   2920 }
   2921 
   2922 
   2923 /* Finish: marshalled synchronously */
   2924 static void GLAPIENTRY
   2925 _mesa_marshal_Finish(void)
   2926 {
   2927    GET_CURRENT_CONTEXT(ctx);
   2928    _mesa_glthread_finish(ctx);
   2929    debug_print_sync("Finish");
   2930    CALL_Finish(ctx->CurrentServerDispatch, ());
   2931 }
   2932 
   2933 
   2934 /* ClearStencil: marshalled asynchronously */
   2935 struct marshal_cmd_ClearStencil
   2936 {
   2937    struct marshal_cmd_base cmd_base;
   2938    GLint s;
   2939 };
   2940 static inline void
   2941 _mesa_unmarshal_ClearStencil(struct gl_context *ctx, const struct marshal_cmd_ClearStencil *cmd)
   2942 {
   2943    const GLint s = cmd->s;
   2944    CALL_ClearStencil(ctx->CurrentServerDispatch, (s));
   2945 }
   2946 static void GLAPIENTRY
   2947 _mesa_marshal_ClearStencil(GLint s)
   2948 {
   2949    GET_CURRENT_CONTEXT(ctx);
   2950    size_t cmd_size = sizeof(struct marshal_cmd_ClearStencil);
   2951    struct marshal_cmd_ClearStencil *cmd;
   2952    debug_print_marshal("ClearStencil");
   2953    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2954       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearStencil, cmd_size);
   2955       cmd->s = s;
   2956       _mesa_post_marshal_hook(ctx);
   2957       return;
   2958    }
   2959 
   2960    _mesa_glthread_finish(ctx);
   2961    debug_print_sync_fallback("ClearStencil");
   2962    CALL_ClearStencil(ctx->CurrentServerDispatch, (s));
   2963 }
   2964 
   2965 
   2966 /* ClearColorIiEXT: marshalled asynchronously */
   2967 struct marshal_cmd_ClearColorIiEXT
   2968 {
   2969    struct marshal_cmd_base cmd_base;
   2970    GLint r;
   2971    GLint g;
   2972    GLint b;
   2973    GLint a;
   2974 };
   2975 static inline void
   2976 _mesa_unmarshal_ClearColorIiEXT(struct gl_context *ctx, const struct marshal_cmd_ClearColorIiEXT *cmd)
   2977 {
   2978    const GLint r = cmd->r;
   2979    const GLint g = cmd->g;
   2980    const GLint b = cmd->b;
   2981    const GLint a = cmd->a;
   2982    CALL_ClearColorIiEXT(ctx->CurrentServerDispatch, (r, g, b, a));
   2983 }
   2984 static void GLAPIENTRY
   2985 _mesa_marshal_ClearColorIiEXT(GLint r, GLint g, GLint b, GLint a)
   2986 {
   2987    GET_CURRENT_CONTEXT(ctx);
   2988    size_t cmd_size = sizeof(struct marshal_cmd_ClearColorIiEXT);
   2989    struct marshal_cmd_ClearColorIiEXT *cmd;
   2990    debug_print_marshal("ClearColorIiEXT");
   2991    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   2992       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearColorIiEXT, cmd_size);
   2993       cmd->r = r;
   2994       cmd->g = g;
   2995       cmd->b = b;
   2996       cmd->a = a;
   2997       _mesa_post_marshal_hook(ctx);
   2998       return;
   2999    }
   3000 
   3001    _mesa_glthread_finish(ctx);
   3002    debug_print_sync_fallback("ClearColorIiEXT");
   3003    CALL_ClearColorIiEXT(ctx->CurrentServerDispatch, (r, g, b, a));
   3004 }
   3005 
   3006 
   3007 /* LoadMatrixd: marshalled asynchronously */
   3008 struct marshal_cmd_LoadMatrixd
   3009 {
   3010    struct marshal_cmd_base cmd_base;
   3011    GLdouble m[16];
   3012 };
   3013 static inline void
   3014 _mesa_unmarshal_LoadMatrixd(struct gl_context *ctx, const struct marshal_cmd_LoadMatrixd *cmd)
   3015 {
   3016    const GLdouble * m = cmd->m;
   3017    CALL_LoadMatrixd(ctx->CurrentServerDispatch, (m));
   3018 }
   3019 static void GLAPIENTRY
   3020 _mesa_marshal_LoadMatrixd(const GLdouble * m)
   3021 {
   3022    GET_CURRENT_CONTEXT(ctx);
   3023    size_t cmd_size = sizeof(struct marshal_cmd_LoadMatrixd);
   3024    struct marshal_cmd_LoadMatrixd *cmd;
   3025    debug_print_marshal("LoadMatrixd");
   3026    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3027       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LoadMatrixd, cmd_size);
   3028       memcpy(cmd->m, m, 128);
   3029       _mesa_post_marshal_hook(ctx);
   3030       return;
   3031    }
   3032 
   3033    _mesa_glthread_finish(ctx);
   3034    debug_print_sync_fallback("LoadMatrixd");
   3035    CALL_LoadMatrixd(ctx->CurrentServerDispatch, (m));
   3036 }
   3037 
   3038 
   3039 /* VDPAURegisterOutputSurfaceNV: marshalled synchronously */
   3040 static GLintptr GLAPIENTRY
   3041 _mesa_marshal_VDPAURegisterOutputSurfaceNV(const GLvoid * vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint * textureNames)
   3042 {
   3043    GET_CURRENT_CONTEXT(ctx);
   3044    _mesa_glthread_finish(ctx);
   3045    debug_print_sync("VDPAURegisterOutputSurfaceNV");
   3046    return CALL_VDPAURegisterOutputSurfaceNV(ctx->CurrentServerDispatch, (vdpSurface, target, numTextureNames, textureNames));
   3047 }
   3048 
   3049 
   3050 /* VertexP4ui: marshalled asynchronously */
   3051 struct marshal_cmd_VertexP4ui
   3052 {
   3053    struct marshal_cmd_base cmd_base;
   3054    GLenum type;
   3055    GLuint value;
   3056 };
   3057 static inline void
   3058 _mesa_unmarshal_VertexP4ui(struct gl_context *ctx, const struct marshal_cmd_VertexP4ui *cmd)
   3059 {
   3060    const GLenum type = cmd->type;
   3061    const GLuint value = cmd->value;
   3062    CALL_VertexP4ui(ctx->CurrentServerDispatch, (type, value));
   3063 }
   3064 static void GLAPIENTRY
   3065 _mesa_marshal_VertexP4ui(GLenum type, GLuint value)
   3066 {
   3067    GET_CURRENT_CONTEXT(ctx);
   3068    size_t cmd_size = sizeof(struct marshal_cmd_VertexP4ui);
   3069    struct marshal_cmd_VertexP4ui *cmd;
   3070    debug_print_marshal("VertexP4ui");
   3071    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3072       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexP4ui, cmd_size);
   3073       cmd->type = type;
   3074       cmd->value = value;
   3075       _mesa_post_marshal_hook(ctx);
   3076       return;
   3077    }
   3078 
   3079    _mesa_glthread_finish(ctx);
   3080    debug_print_sync_fallback("VertexP4ui");
   3081    CALL_VertexP4ui(ctx->CurrentServerDispatch, (type, value));
   3082 }
   3083 
   3084 
   3085 /* GetProgramResourceIndex: marshalled synchronously */
   3086 static GLuint GLAPIENTRY
   3087 _mesa_marshal_GetProgramResourceIndex(GLuint program, GLenum programInterface, const GLchar * name)
   3088 {
   3089    GET_CURRENT_CONTEXT(ctx);
   3090    _mesa_glthread_finish(ctx);
   3091    debug_print_sync("GetProgramResourceIndex");
   3092    return CALL_GetProgramResourceIndex(ctx->CurrentServerDispatch, (program, programInterface, name));
   3093 }
   3094 
   3095 
   3096 /* TextureStorage3DMultisample: marshalled asynchronously */
   3097 struct marshal_cmd_TextureStorage3DMultisample
   3098 {
   3099    struct marshal_cmd_base cmd_base;
   3100    GLuint texture;
   3101    GLsizei samples;
   3102    GLenum internalformat;
   3103    GLsizei width;
   3104    GLsizei height;
   3105    GLsizei depth;
   3106    GLboolean fixedsamplelocations;
   3107 };
   3108 static inline void
   3109 _mesa_unmarshal_TextureStorage3DMultisample(struct gl_context *ctx, const struct marshal_cmd_TextureStorage3DMultisample *cmd)
   3110 {
   3111    const GLuint texture = cmd->texture;
   3112    const GLsizei samples = cmd->samples;
   3113    const GLenum internalformat = cmd->internalformat;
   3114    const GLsizei width = cmd->width;
   3115    const GLsizei height = cmd->height;
   3116    const GLsizei depth = cmd->depth;
   3117    const GLboolean fixedsamplelocations = cmd->fixedsamplelocations;
   3118    CALL_TextureStorage3DMultisample(ctx->CurrentServerDispatch, (texture, samples, internalformat, width, height, depth, fixedsamplelocations));
   3119 }
   3120 static void GLAPIENTRY
   3121 _mesa_marshal_TextureStorage3DMultisample(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)
   3122 {
   3123    GET_CURRENT_CONTEXT(ctx);
   3124    size_t cmd_size = sizeof(struct marshal_cmd_TextureStorage3DMultisample);
   3125    struct marshal_cmd_TextureStorage3DMultisample *cmd;
   3126    debug_print_marshal("TextureStorage3DMultisample");
   3127    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3128       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage3DMultisample, cmd_size);
   3129       cmd->texture = texture;
   3130       cmd->samples = samples;
   3131       cmd->internalformat = internalformat;
   3132       cmd->width = width;
   3133       cmd->height = height;
   3134       cmd->depth = depth;
   3135       cmd->fixedsamplelocations = fixedsamplelocations;
   3136       _mesa_post_marshal_hook(ctx);
   3137       return;
   3138    }
   3139 
   3140    _mesa_glthread_finish(ctx);
   3141    debug_print_sync_fallback("TextureStorage3DMultisample");
   3142    CALL_TextureStorage3DMultisample(ctx->CurrentServerDispatch, (texture, samples, internalformat, width, height, depth, fixedsamplelocations));
   3143 }
   3144 
   3145 
   3146 /* GetnUniformivARB: marshalled synchronously */
   3147 static void GLAPIENTRY
   3148 _mesa_marshal_GetnUniformivARB(GLuint program, GLint location, GLsizei bufSize, GLint * params)
   3149 {
   3150    GET_CURRENT_CONTEXT(ctx);
   3151    _mesa_glthread_finish(ctx);
   3152    debug_print_sync("GetnUniformivARB");
   3153    CALL_GetnUniformivARB(ctx->CurrentServerDispatch, (program, location, bufSize, params));
   3154 }
   3155 
   3156 
   3157 /* ReleaseShaderCompiler: marshalled asynchronously */
   3158 struct marshal_cmd_ReleaseShaderCompiler
   3159 {
   3160    struct marshal_cmd_base cmd_base;
   3161 };
   3162 static inline void
   3163 _mesa_unmarshal_ReleaseShaderCompiler(struct gl_context *ctx, const struct marshal_cmd_ReleaseShaderCompiler *cmd)
   3164 {
   3165    CALL_ReleaseShaderCompiler(ctx->CurrentServerDispatch, ());
   3166 }
   3167 static void GLAPIENTRY
   3168 _mesa_marshal_ReleaseShaderCompiler(void)
   3169 {
   3170    GET_CURRENT_CONTEXT(ctx);
   3171    size_t cmd_size = sizeof(struct marshal_cmd_ReleaseShaderCompiler);
   3172    struct marshal_cmd_ReleaseShaderCompiler *cmd;
   3173    debug_print_marshal("ReleaseShaderCompiler");
   3174    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3175       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ReleaseShaderCompiler, cmd_size);
   3176       (void) cmd;
   3177 
   3178       _mesa_post_marshal_hook(ctx);
   3179       return;
   3180    }
   3181 
   3182    _mesa_glthread_finish(ctx);
   3183    debug_print_sync_fallback("ReleaseShaderCompiler");
   3184    CALL_ReleaseShaderCompiler(ctx->CurrentServerDispatch, ());
   3185 }
   3186 
   3187 
   3188 /* BlendFuncSeparate: marshalled asynchronously */
   3189 struct marshal_cmd_BlendFuncSeparate
   3190 {
   3191    struct marshal_cmd_base cmd_base;
   3192    GLenum sfactorRGB;
   3193    GLenum dfactorRGB;
   3194    GLenum sfactorAlpha;
   3195    GLenum dfactorAlpha;
   3196 };
   3197 static inline void
   3198 _mesa_unmarshal_BlendFuncSeparate(struct gl_context *ctx, const struct marshal_cmd_BlendFuncSeparate *cmd)
   3199 {
   3200    const GLenum sfactorRGB = cmd->sfactorRGB;
   3201    const GLenum dfactorRGB = cmd->dfactorRGB;
   3202    const GLenum sfactorAlpha = cmd->sfactorAlpha;
   3203    const GLenum dfactorAlpha = cmd->dfactorAlpha;
   3204    CALL_BlendFuncSeparate(ctx->CurrentServerDispatch, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
   3205 }
   3206 static void GLAPIENTRY
   3207 _mesa_marshal_BlendFuncSeparate(GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha)
   3208 {
   3209    GET_CURRENT_CONTEXT(ctx);
   3210    size_t cmd_size = sizeof(struct marshal_cmd_BlendFuncSeparate);
   3211    struct marshal_cmd_BlendFuncSeparate *cmd;
   3212    debug_print_marshal("BlendFuncSeparate");
   3213    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3214       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendFuncSeparate, cmd_size);
   3215       cmd->sfactorRGB = sfactorRGB;
   3216       cmd->dfactorRGB = dfactorRGB;
   3217       cmd->sfactorAlpha = sfactorAlpha;
   3218       cmd->dfactorAlpha = dfactorAlpha;
   3219       _mesa_post_marshal_hook(ctx);
   3220       return;
   3221    }
   3222 
   3223    _mesa_glthread_finish(ctx);
   3224    debug_print_sync_fallback("BlendFuncSeparate");
   3225    CALL_BlendFuncSeparate(ctx->CurrentServerDispatch, (sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha));
   3226 }
   3227 
   3228 
   3229 /* Color3us: marshalled asynchronously */
   3230 struct marshal_cmd_Color3us
   3231 {
   3232    struct marshal_cmd_base cmd_base;
   3233    GLushort red;
   3234    GLushort green;
   3235    GLushort blue;
   3236 };
   3237 static inline void
   3238 _mesa_unmarshal_Color3us(struct gl_context *ctx, const struct marshal_cmd_Color3us *cmd)
   3239 {
   3240    const GLushort red = cmd->red;
   3241    const GLushort green = cmd->green;
   3242    const GLushort blue = cmd->blue;
   3243    CALL_Color3us(ctx->CurrentServerDispatch, (red, green, blue));
   3244 }
   3245 static void GLAPIENTRY
   3246 _mesa_marshal_Color3us(GLushort red, GLushort green, GLushort blue)
   3247 {
   3248    GET_CURRENT_CONTEXT(ctx);
   3249    size_t cmd_size = sizeof(struct marshal_cmd_Color3us);
   3250    struct marshal_cmd_Color3us *cmd;
   3251    debug_print_marshal("Color3us");
   3252    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3253       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3us, cmd_size);
   3254       cmd->red = red;
   3255       cmd->green = green;
   3256       cmd->blue = blue;
   3257       _mesa_post_marshal_hook(ctx);
   3258       return;
   3259    }
   3260 
   3261    _mesa_glthread_finish(ctx);
   3262    debug_print_sync_fallback("Color3us");
   3263    CALL_Color3us(ctx->CurrentServerDispatch, (red, green, blue));
   3264 }
   3265 
   3266 
   3267 /* LoadMatrixx: marshalled asynchronously */
   3268 struct marshal_cmd_LoadMatrixx
   3269 {
   3270    struct marshal_cmd_base cmd_base;
   3271    GLfixed m[16];
   3272 };
   3273 static inline void
   3274 _mesa_unmarshal_LoadMatrixx(struct gl_context *ctx, const struct marshal_cmd_LoadMatrixx *cmd)
   3275 {
   3276    const GLfixed * m = cmd->m;
   3277    CALL_LoadMatrixx(ctx->CurrentServerDispatch, (m));
   3278 }
   3279 static void GLAPIENTRY
   3280 _mesa_marshal_LoadMatrixx(const GLfixed * m)
   3281 {
   3282    GET_CURRENT_CONTEXT(ctx);
   3283    size_t cmd_size = sizeof(struct marshal_cmd_LoadMatrixx);
   3284    struct marshal_cmd_LoadMatrixx *cmd;
   3285    debug_print_marshal("LoadMatrixx");
   3286    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3287       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LoadMatrixx, cmd_size);
   3288       memcpy(cmd->m, m, 64);
   3289       _mesa_post_marshal_hook(ctx);
   3290       return;
   3291    }
   3292 
   3293    _mesa_glthread_finish(ctx);
   3294    debug_print_sync_fallback("LoadMatrixx");
   3295    CALL_LoadMatrixx(ctx->CurrentServerDispatch, (m));
   3296 }
   3297 
   3298 
   3299 /* BufferStorage: marshalled synchronously */
   3300 static void GLAPIENTRY
   3301 _mesa_marshal_BufferStorage(GLenum target, GLsizeiptr size, const GLvoid * data, GLbitfield flags)
   3302 {
   3303    GET_CURRENT_CONTEXT(ctx);
   3304    _mesa_glthread_finish(ctx);
   3305    debug_print_sync("BufferStorage");
   3306    CALL_BufferStorage(ctx->CurrentServerDispatch, (target, size, data, flags));
   3307 }
   3308 
   3309 
   3310 /* Color3ub: marshalled asynchronously */
   3311 struct marshal_cmd_Color3ub
   3312 {
   3313    struct marshal_cmd_base cmd_base;
   3314    GLubyte red;
   3315    GLubyte green;
   3316    GLubyte blue;
   3317 };
   3318 static inline void
   3319 _mesa_unmarshal_Color3ub(struct gl_context *ctx, const struct marshal_cmd_Color3ub *cmd)
   3320 {
   3321    const GLubyte red = cmd->red;
   3322    const GLubyte green = cmd->green;
   3323    const GLubyte blue = cmd->blue;
   3324    CALL_Color3ub(ctx->CurrentServerDispatch, (red, green, blue));
   3325 }
   3326 static void GLAPIENTRY
   3327 _mesa_marshal_Color3ub(GLubyte red, GLubyte green, GLubyte blue)
   3328 {
   3329    GET_CURRENT_CONTEXT(ctx);
   3330    size_t cmd_size = sizeof(struct marshal_cmd_Color3ub);
   3331    struct marshal_cmd_Color3ub *cmd;
   3332    debug_print_marshal("Color3ub");
   3333    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3334       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3ub, cmd_size);
   3335       cmd->red = red;
   3336       cmd->green = green;
   3337       cmd->blue = blue;
   3338       _mesa_post_marshal_hook(ctx);
   3339       return;
   3340    }
   3341 
   3342    _mesa_glthread_finish(ctx);
   3343    debug_print_sync_fallback("Color3ub");
   3344    CALL_Color3ub(ctx->CurrentServerDispatch, (red, green, blue));
   3345 }
   3346 
   3347 
   3348 /* Color3ui: marshalled asynchronously */
   3349 struct marshal_cmd_Color3ui
   3350 {
   3351    struct marshal_cmd_base cmd_base;
   3352    GLuint red;
   3353    GLuint green;
   3354    GLuint blue;
   3355 };
   3356 static inline void
   3357 _mesa_unmarshal_Color3ui(struct gl_context *ctx, const struct marshal_cmd_Color3ui *cmd)
   3358 {
   3359    const GLuint red = cmd->red;
   3360    const GLuint green = cmd->green;
   3361    const GLuint blue = cmd->blue;
   3362    CALL_Color3ui(ctx->CurrentServerDispatch, (red, green, blue));
   3363 }
   3364 static void GLAPIENTRY
   3365 _mesa_marshal_Color3ui(GLuint red, GLuint green, GLuint blue)
   3366 {
   3367    GET_CURRENT_CONTEXT(ctx);
   3368    size_t cmd_size = sizeof(struct marshal_cmd_Color3ui);
   3369    struct marshal_cmd_Color3ui *cmd;
   3370    debug_print_marshal("Color3ui");
   3371    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3372       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3ui, cmd_size);
   3373       cmd->red = red;
   3374       cmd->green = green;
   3375       cmd->blue = blue;
   3376       _mesa_post_marshal_hook(ctx);
   3377       return;
   3378    }
   3379 
   3380    _mesa_glthread_finish(ctx);
   3381    debug_print_sync_fallback("Color3ui");
   3382    CALL_Color3ui(ctx->CurrentServerDispatch, (red, green, blue));
   3383 }
   3384 
   3385 
   3386 /* VertexAttrib4dvNV: marshalled asynchronously */
   3387 struct marshal_cmd_VertexAttrib4dvNV
   3388 {
   3389    struct marshal_cmd_base cmd_base;
   3390    GLuint index;
   3391    GLdouble v[4];
   3392 };
   3393 static inline void
   3394 _mesa_unmarshal_VertexAttrib4dvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4dvNV *cmd)
   3395 {
   3396    const GLuint index = cmd->index;
   3397    const GLdouble * v = cmd->v;
   3398    CALL_VertexAttrib4dvNV(ctx->CurrentServerDispatch, (index, v));
   3399 }
   3400 static void GLAPIENTRY
   3401 _mesa_marshal_VertexAttrib4dvNV(GLuint index, const GLdouble * v)
   3402 {
   3403    GET_CURRENT_CONTEXT(ctx);
   3404    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4dvNV);
   3405    struct marshal_cmd_VertexAttrib4dvNV *cmd;
   3406    debug_print_marshal("VertexAttrib4dvNV");
   3407    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3408       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4dvNV, cmd_size);
   3409       cmd->index = index;
   3410       memcpy(cmd->v, v, 32);
   3411       _mesa_post_marshal_hook(ctx);
   3412       return;
   3413    }
   3414 
   3415    _mesa_glthread_finish(ctx);
   3416    debug_print_sync_fallback("VertexAttrib4dvNV");
   3417    CALL_VertexAttrib4dvNV(ctx->CurrentServerDispatch, (index, v));
   3418 }
   3419 
   3420 
   3421 /* AlphaFragmentOp2ATI: marshalled asynchronously */
   3422 struct marshal_cmd_AlphaFragmentOp2ATI
   3423 {
   3424    struct marshal_cmd_base cmd_base;
   3425    GLenum op;
   3426    GLuint dst;
   3427    GLuint dstMod;
   3428    GLuint arg1;
   3429    GLuint arg1Rep;
   3430    GLuint arg1Mod;
   3431    GLuint arg2;
   3432    GLuint arg2Rep;
   3433    GLuint arg2Mod;
   3434 };
   3435 static inline void
   3436 _mesa_unmarshal_AlphaFragmentOp2ATI(struct gl_context *ctx, const struct marshal_cmd_AlphaFragmentOp2ATI *cmd)
   3437 {
   3438    const GLenum op = cmd->op;
   3439    const GLuint dst = cmd->dst;
   3440    const GLuint dstMod = cmd->dstMod;
   3441    const GLuint arg1 = cmd->arg1;
   3442    const GLuint arg1Rep = cmd->arg1Rep;
   3443    const GLuint arg1Mod = cmd->arg1Mod;
   3444    const GLuint arg2 = cmd->arg2;
   3445    const GLuint arg2Rep = cmd->arg2Rep;
   3446    const GLuint arg2Mod = cmd->arg2Mod;
   3447    CALL_AlphaFragmentOp2ATI(ctx->CurrentServerDispatch, (op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod));
   3448 }
   3449 static void GLAPIENTRY
   3450 _mesa_marshal_AlphaFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)
   3451 {
   3452    GET_CURRENT_CONTEXT(ctx);
   3453    size_t cmd_size = sizeof(struct marshal_cmd_AlphaFragmentOp2ATI);
   3454    struct marshal_cmd_AlphaFragmentOp2ATI *cmd;
   3455    debug_print_marshal("AlphaFragmentOp2ATI");
   3456    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3457       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_AlphaFragmentOp2ATI, cmd_size);
   3458       cmd->op = op;
   3459       cmd->dst = dst;
   3460       cmd->dstMod = dstMod;
   3461       cmd->arg1 = arg1;
   3462       cmd->arg1Rep = arg1Rep;
   3463       cmd->arg1Mod = arg1Mod;
   3464       cmd->arg2 = arg2;
   3465       cmd->arg2Rep = arg2Rep;
   3466       cmd->arg2Mod = arg2Mod;
   3467       _mesa_post_marshal_hook(ctx);
   3468       return;
   3469    }
   3470 
   3471    _mesa_glthread_finish(ctx);
   3472    debug_print_sync_fallback("AlphaFragmentOp2ATI");
   3473    CALL_AlphaFragmentOp2ATI(ctx->CurrentServerDispatch, (op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod));
   3474 }
   3475 
   3476 
   3477 /* RasterPos4dv: marshalled asynchronously */
   3478 struct marshal_cmd_RasterPos4dv
   3479 {
   3480    struct marshal_cmd_base cmd_base;
   3481    GLdouble v[4];
   3482 };
   3483 static inline void
   3484 _mesa_unmarshal_RasterPos4dv(struct gl_context *ctx, const struct marshal_cmd_RasterPos4dv *cmd)
   3485 {
   3486    const GLdouble * v = cmd->v;
   3487    CALL_RasterPos4dv(ctx->CurrentServerDispatch, (v));
   3488 }
   3489 static void GLAPIENTRY
   3490 _mesa_marshal_RasterPos4dv(const GLdouble * v)
   3491 {
   3492    GET_CURRENT_CONTEXT(ctx);
   3493    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos4dv);
   3494    struct marshal_cmd_RasterPos4dv *cmd;
   3495    debug_print_marshal("RasterPos4dv");
   3496    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3497       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos4dv, cmd_size);
   3498       memcpy(cmd->v, v, 32);
   3499       _mesa_post_marshal_hook(ctx);
   3500       return;
   3501    }
   3502 
   3503    _mesa_glthread_finish(ctx);
   3504    debug_print_sync_fallback("RasterPos4dv");
   3505    CALL_RasterPos4dv(ctx->CurrentServerDispatch, (v));
   3506 }
   3507 
   3508 
   3509 /* DeleteProgramPipelines: marshalled synchronously */
   3510 static void GLAPIENTRY
   3511 _mesa_marshal_DeleteProgramPipelines(GLsizei n, const GLuint * pipelines)
   3512 {
   3513    GET_CURRENT_CONTEXT(ctx);
   3514    _mesa_glthread_finish(ctx);
   3515    debug_print_sync("DeleteProgramPipelines");
   3516    CALL_DeleteProgramPipelines(ctx->CurrentServerDispatch, (n, pipelines));
   3517 }
   3518 
   3519 
   3520 /* LineWidthx: marshalled asynchronously */
   3521 struct marshal_cmd_LineWidthx
   3522 {
   3523    struct marshal_cmd_base cmd_base;
   3524    GLfixed width;
   3525 };
   3526 static inline void
   3527 _mesa_unmarshal_LineWidthx(struct gl_context *ctx, const struct marshal_cmd_LineWidthx *cmd)
   3528 {
   3529    const GLfixed width = cmd->width;
   3530    CALL_LineWidthx(ctx->CurrentServerDispatch, (width));
   3531 }
   3532 static void GLAPIENTRY
   3533 _mesa_marshal_LineWidthx(GLfixed width)
   3534 {
   3535    GET_CURRENT_CONTEXT(ctx);
   3536    size_t cmd_size = sizeof(struct marshal_cmd_LineWidthx);
   3537    struct marshal_cmd_LineWidthx *cmd;
   3538    debug_print_marshal("LineWidthx");
   3539    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3540       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LineWidthx, cmd_size);
   3541       cmd->width = width;
   3542       _mesa_post_marshal_hook(ctx);
   3543       return;
   3544    }
   3545 
   3546    _mesa_glthread_finish(ctx);
   3547    debug_print_sync_fallback("LineWidthx");
   3548    CALL_LineWidthx(ctx->CurrentServerDispatch, (width));
   3549 }
   3550 
   3551 
   3552 /* GetTransformFeedbacki_v: marshalled synchronously */
   3553 static void GLAPIENTRY
   3554 _mesa_marshal_GetTransformFeedbacki_v(GLuint xfb, GLenum pname, GLuint index, GLint * param)
   3555 {
   3556    GET_CURRENT_CONTEXT(ctx);
   3557    _mesa_glthread_finish(ctx);
   3558    debug_print_sync("GetTransformFeedbacki_v");
   3559    CALL_GetTransformFeedbacki_v(ctx->CurrentServerDispatch, (xfb, pname, index, param));
   3560 }
   3561 
   3562 
   3563 /* Indexdv: marshalled asynchronously */
   3564 struct marshal_cmd_Indexdv
   3565 {
   3566    struct marshal_cmd_base cmd_base;
   3567    GLdouble c[1];
   3568 };
   3569 static inline void
   3570 _mesa_unmarshal_Indexdv(struct gl_context *ctx, const struct marshal_cmd_Indexdv *cmd)
   3571 {
   3572    const GLdouble * c = cmd->c;
   3573    CALL_Indexdv(ctx->CurrentServerDispatch, (c));
   3574 }
   3575 static void GLAPIENTRY
   3576 _mesa_marshal_Indexdv(const GLdouble * c)
   3577 {
   3578    GET_CURRENT_CONTEXT(ctx);
   3579    size_t cmd_size = sizeof(struct marshal_cmd_Indexdv);
   3580    struct marshal_cmd_Indexdv *cmd;
   3581    debug_print_marshal("Indexdv");
   3582    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3583       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Indexdv, cmd_size);
   3584       memcpy(cmd->c, c, 8);
   3585       _mesa_post_marshal_hook(ctx);
   3586       return;
   3587    }
   3588 
   3589    _mesa_glthread_finish(ctx);
   3590    debug_print_sync_fallback("Indexdv");
   3591    CALL_Indexdv(ctx->CurrentServerDispatch, (c));
   3592 }
   3593 
   3594 
   3595 /* GetnPixelMapfvARB: marshalled synchronously */
   3596 static void GLAPIENTRY
   3597 _mesa_marshal_GetnPixelMapfvARB(GLenum map, GLsizei bufSize, GLfloat * values)
   3598 {
   3599    GET_CURRENT_CONTEXT(ctx);
   3600    _mesa_glthread_finish(ctx);
   3601    debug_print_sync("GetnPixelMapfvARB");
   3602    CALL_GetnPixelMapfvARB(ctx->CurrentServerDispatch, (map, bufSize, values));
   3603 }
   3604 
   3605 
   3606 /* EGLImageTargetTexture2DOES: marshalled synchronously */
   3607 static void GLAPIENTRY
   3608 _mesa_marshal_EGLImageTargetTexture2DOES(GLenum target, GLvoid * writeOffset)
   3609 {
   3610    GET_CURRENT_CONTEXT(ctx);
   3611    _mesa_glthread_finish(ctx);
   3612    debug_print_sync("EGLImageTargetTexture2DOES");
   3613    CALL_EGLImageTargetTexture2DOES(ctx->CurrentServerDispatch, (target, writeOffset));
   3614 }
   3615 
   3616 
   3617 /* DepthMask: marshalled asynchronously */
   3618 struct marshal_cmd_DepthMask
   3619 {
   3620    struct marshal_cmd_base cmd_base;
   3621    GLboolean flag;
   3622 };
   3623 static inline void
   3624 _mesa_unmarshal_DepthMask(struct gl_context *ctx, const struct marshal_cmd_DepthMask *cmd)
   3625 {
   3626    const GLboolean flag = cmd->flag;
   3627    CALL_DepthMask(ctx->CurrentServerDispatch, (flag));
   3628 }
   3629 static void GLAPIENTRY
   3630 _mesa_marshal_DepthMask(GLboolean flag)
   3631 {
   3632    GET_CURRENT_CONTEXT(ctx);
   3633    size_t cmd_size = sizeof(struct marshal_cmd_DepthMask);
   3634    struct marshal_cmd_DepthMask *cmd;
   3635    debug_print_marshal("DepthMask");
   3636    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3637       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DepthMask, cmd_size);
   3638       cmd->flag = flag;
   3639       _mesa_post_marshal_hook(ctx);
   3640       return;
   3641    }
   3642 
   3643    _mesa_glthread_finish(ctx);
   3644    debug_print_sync_fallback("DepthMask");
   3645    CALL_DepthMask(ctx->CurrentServerDispatch, (flag));
   3646 }
   3647 
   3648 
   3649 /* WindowPos4ivMESA: marshalled synchronously */
   3650 static void GLAPIENTRY
   3651 _mesa_marshal_WindowPos4ivMESA(const GLint * v)
   3652 {
   3653    GET_CURRENT_CONTEXT(ctx);
   3654    _mesa_glthread_finish(ctx);
   3655    debug_print_sync("WindowPos4ivMESA");
   3656    CALL_WindowPos4ivMESA(ctx->CurrentServerDispatch, (v));
   3657 }
   3658 
   3659 
   3660 /* GetShaderInfoLog: marshalled synchronously */
   3661 static void GLAPIENTRY
   3662 _mesa_marshal_GetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * infoLog)
   3663 {
   3664    GET_CURRENT_CONTEXT(ctx);
   3665    _mesa_glthread_finish(ctx);
   3666    debug_print_sync("GetShaderInfoLog");
   3667    CALL_GetShaderInfoLog(ctx->CurrentServerDispatch, (shader, bufSize, length, infoLog));
   3668 }
   3669 
   3670 
   3671 /* BindFragmentShaderATI: marshalled asynchronously */
   3672 struct marshal_cmd_BindFragmentShaderATI
   3673 {
   3674    struct marshal_cmd_base cmd_base;
   3675    GLuint id;
   3676 };
   3677 static inline void
   3678 _mesa_unmarshal_BindFragmentShaderATI(struct gl_context *ctx, const struct marshal_cmd_BindFragmentShaderATI *cmd)
   3679 {
   3680    const GLuint id = cmd->id;
   3681    CALL_BindFragmentShaderATI(ctx->CurrentServerDispatch, (id));
   3682 }
   3683 static void GLAPIENTRY
   3684 _mesa_marshal_BindFragmentShaderATI(GLuint id)
   3685 {
   3686    GET_CURRENT_CONTEXT(ctx);
   3687    size_t cmd_size = sizeof(struct marshal_cmd_BindFragmentShaderATI);
   3688    struct marshal_cmd_BindFragmentShaderATI *cmd;
   3689    debug_print_marshal("BindFragmentShaderATI");
   3690    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3691       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindFragmentShaderATI, cmd_size);
   3692       cmd->id = id;
   3693       _mesa_post_marshal_hook(ctx);
   3694       return;
   3695    }
   3696 
   3697    _mesa_glthread_finish(ctx);
   3698    debug_print_sync_fallback("BindFragmentShaderATI");
   3699    CALL_BindFragmentShaderATI(ctx->CurrentServerDispatch, (id));
   3700 }
   3701 
   3702 
   3703 /* BlendFuncSeparateiARB: marshalled asynchronously */
   3704 struct marshal_cmd_BlendFuncSeparateiARB
   3705 {
   3706    struct marshal_cmd_base cmd_base;
   3707    GLuint buf;
   3708    GLenum srcRGB;
   3709    GLenum dstRGB;
   3710    GLenum srcA;
   3711    GLenum dstA;
   3712 };
   3713 static inline void
   3714 _mesa_unmarshal_BlendFuncSeparateiARB(struct gl_context *ctx, const struct marshal_cmd_BlendFuncSeparateiARB *cmd)
   3715 {
   3716    const GLuint buf = cmd->buf;
   3717    const GLenum srcRGB = cmd->srcRGB;
   3718    const GLenum dstRGB = cmd->dstRGB;
   3719    const GLenum srcA = cmd->srcA;
   3720    const GLenum dstA = cmd->dstA;
   3721    CALL_BlendFuncSeparateiARB(ctx->CurrentServerDispatch, (buf, srcRGB, dstRGB, srcA, dstA));
   3722 }
   3723 static void GLAPIENTRY
   3724 _mesa_marshal_BlendFuncSeparateiARB(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA)
   3725 {
   3726    GET_CURRENT_CONTEXT(ctx);
   3727    size_t cmd_size = sizeof(struct marshal_cmd_BlendFuncSeparateiARB);
   3728    struct marshal_cmd_BlendFuncSeparateiARB *cmd;
   3729    debug_print_marshal("BlendFuncSeparateiARB");
   3730    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3731       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendFuncSeparateiARB, cmd_size);
   3732       cmd->buf = buf;
   3733       cmd->srcRGB = srcRGB;
   3734       cmd->dstRGB = dstRGB;
   3735       cmd->srcA = srcA;
   3736       cmd->dstA = dstA;
   3737       _mesa_post_marshal_hook(ctx);
   3738       return;
   3739    }
   3740 
   3741    _mesa_glthread_finish(ctx);
   3742    debug_print_sync_fallback("BlendFuncSeparateiARB");
   3743    CALL_BlendFuncSeparateiARB(ctx->CurrentServerDispatch, (buf, srcRGB, dstRGB, srcA, dstA));
   3744 }
   3745 
   3746 
   3747 /* EGLImageTargetRenderbufferStorageOES: marshalled synchronously */
   3748 static void GLAPIENTRY
   3749 _mesa_marshal_EGLImageTargetRenderbufferStorageOES(GLenum target, GLvoid * writeOffset)
   3750 {
   3751    GET_CURRENT_CONTEXT(ctx);
   3752    _mesa_glthread_finish(ctx);
   3753    debug_print_sync("EGLImageTargetRenderbufferStorageOES");
   3754    CALL_EGLImageTargetRenderbufferStorageOES(ctx->CurrentServerDispatch, (target, writeOffset));
   3755 }
   3756 
   3757 
   3758 /* GenTransformFeedbacks: marshalled synchronously */
   3759 static void GLAPIENTRY
   3760 _mesa_marshal_GenTransformFeedbacks(GLsizei n, GLuint * ids)
   3761 {
   3762    GET_CURRENT_CONTEXT(ctx);
   3763    _mesa_glthread_finish(ctx);
   3764    debug_print_sync("GenTransformFeedbacks");
   3765    CALL_GenTransformFeedbacks(ctx->CurrentServerDispatch, (n, ids));
   3766 }
   3767 
   3768 
   3769 /* VertexPointer: marshalled asynchronously */
   3770 struct marshal_cmd_VertexPointer
   3771 {
   3772    struct marshal_cmd_base cmd_base;
   3773    GLint size;
   3774    GLenum type;
   3775    GLsizei stride;
   3776    const GLvoid * pointer;
   3777 };
   3778 static inline void
   3779 _mesa_unmarshal_VertexPointer(struct gl_context *ctx, const struct marshal_cmd_VertexPointer *cmd)
   3780 {
   3781    const GLint size = cmd->size;
   3782    const GLenum type = cmd->type;
   3783    const GLsizei stride = cmd->stride;
   3784    const GLvoid * pointer = cmd->pointer;
   3785    CALL_VertexPointer(ctx->CurrentServerDispatch, (size, type, stride, pointer));
   3786 }
   3787 static void GLAPIENTRY
   3788 _mesa_marshal_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
   3789 {
   3790    GET_CURRENT_CONTEXT(ctx);
   3791    size_t cmd_size = sizeof(struct marshal_cmd_VertexPointer);
   3792    struct marshal_cmd_VertexPointer *cmd;
   3793    debug_print_marshal("VertexPointer");
   3794    if (_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)) {
   3795       _mesa_glthread_finish(ctx);
   3796       _mesa_glthread_restore_dispatch(ctx);
   3797       debug_print_sync_fallback("VertexPointer");
   3798       CALL_VertexPointer(ctx->CurrentServerDispatch, (size, type, stride, pointer));
   3799       return;
   3800    }
   3801    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3802       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexPointer, cmd_size);
   3803       cmd->size = size;
   3804       cmd->type = type;
   3805       cmd->stride = stride;
   3806       cmd->pointer = pointer;
   3807       _mesa_post_marshal_hook(ctx);
   3808       return;
   3809    }
   3810 
   3811    _mesa_glthread_finish(ctx);
   3812    debug_print_sync_fallback("VertexPointer");
   3813    CALL_VertexPointer(ctx->CurrentServerDispatch, (size, type, stride, pointer));
   3814 }
   3815 
   3816 
   3817 /* GetCompressedTexImage: marshalled synchronously */
   3818 static void GLAPIENTRY
   3819 _mesa_marshal_GetCompressedTexImage(GLenum target, GLint level, GLvoid * img)
   3820 {
   3821    GET_CURRENT_CONTEXT(ctx);
   3822    _mesa_glthread_finish(ctx);
   3823    debug_print_sync("GetCompressedTexImage");
   3824    CALL_GetCompressedTexImage(ctx->CurrentServerDispatch, (target, level, img));
   3825 }
   3826 
   3827 
   3828 /* ProgramLocalParameter4dvARB: marshalled asynchronously */
   3829 struct marshal_cmd_ProgramLocalParameter4dvARB
   3830 {
   3831    struct marshal_cmd_base cmd_base;
   3832    GLenum target;
   3833    GLuint index;
   3834    GLdouble params[4];
   3835 };
   3836 static inline void
   3837 _mesa_unmarshal_ProgramLocalParameter4dvARB(struct gl_context *ctx, const struct marshal_cmd_ProgramLocalParameter4dvARB *cmd)
   3838 {
   3839    const GLenum target = cmd->target;
   3840    const GLuint index = cmd->index;
   3841    const GLdouble * params = cmd->params;
   3842    CALL_ProgramLocalParameter4dvARB(ctx->CurrentServerDispatch, (target, index, params));
   3843 }
   3844 static void GLAPIENTRY
   3845 _mesa_marshal_ProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble * params)
   3846 {
   3847    GET_CURRENT_CONTEXT(ctx);
   3848    size_t cmd_size = sizeof(struct marshal_cmd_ProgramLocalParameter4dvARB);
   3849    struct marshal_cmd_ProgramLocalParameter4dvARB *cmd;
   3850    debug_print_marshal("ProgramLocalParameter4dvARB");
   3851    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3852       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramLocalParameter4dvARB, cmd_size);
   3853       cmd->target = target;
   3854       cmd->index = index;
   3855       memcpy(cmd->params, params, 32);
   3856       _mesa_post_marshal_hook(ctx);
   3857       return;
   3858    }
   3859 
   3860    _mesa_glthread_finish(ctx);
   3861    debug_print_sync_fallback("ProgramLocalParameter4dvARB");
   3862    CALL_ProgramLocalParameter4dvARB(ctx->CurrentServerDispatch, (target, index, params));
   3863 }
   3864 
   3865 
   3866 /* UniformMatrix2dv: marshalled asynchronously */
   3867 struct marshal_cmd_UniformMatrix2dv
   3868 {
   3869    struct marshal_cmd_base cmd_base;
   3870    GLint location;
   3871    GLsizei count;
   3872    GLboolean transpose;
   3873    /* Next safe_mul(count, 32) bytes are GLdouble value[count][4] */
   3874 };
   3875 static inline void
   3876 _mesa_unmarshal_UniformMatrix2dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2dv *cmd)
   3877 {
   3878    const GLint location = cmd->location;
   3879    const GLsizei count = cmd->count;
   3880    const GLboolean transpose = cmd->transpose;
   3881    const GLdouble * value;
   3882    const char *variable_data = (const char *) (cmd + 1);
   3883    value = (const GLdouble *) variable_data;
   3884    variable_data += count * 32;
   3885    CALL_UniformMatrix2dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   3886 }
   3887 static void GLAPIENTRY
   3888 _mesa_marshal_UniformMatrix2dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   3889 {
   3890    GET_CURRENT_CONTEXT(ctx);
   3891    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix2dv) + safe_mul(count, 32);
   3892    struct marshal_cmd_UniformMatrix2dv *cmd;
   3893    debug_print_marshal("UniformMatrix2dv");
   3894    if (unlikely(safe_mul(count, 32) < 0)) {
   3895       goto fallback_to_sync;
   3896    }
   3897    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   3898       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2dv, cmd_size);
   3899       cmd->location = location;
   3900       cmd->count = count;
   3901       cmd->transpose = transpose;
   3902       char *variable_data = (char *) (cmd + 1);
   3903       memcpy(variable_data, value, count * 32);
   3904       variable_data += count * 32;
   3905       _mesa_post_marshal_hook(ctx);
   3906       return;
   3907    }
   3908 
   3909 fallback_to_sync:
   3910    _mesa_glthread_finish(ctx);
   3911    debug_print_sync_fallback("UniformMatrix2dv");
   3912    CALL_UniformMatrix2dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   3913 }
   3914 
   3915 
   3916 /* GetQueryObjectui64v: marshalled synchronously */
   3917 static void GLAPIENTRY
   3918 _mesa_marshal_GetQueryObjectui64v(GLuint id, GLenum pname, GLuint64 * params)
   3919 {
   3920    GET_CURRENT_CONTEXT(ctx);
   3921    _mesa_glthread_finish(ctx);
   3922    debug_print_sync("GetQueryObjectui64v");
   3923    CALL_GetQueryObjectui64v(ctx->CurrentServerDispatch, (id, pname, params));
   3924 }
   3925 
   3926 
   3927 /* VertexAttribP1uiv: marshalled synchronously */
   3928 static void GLAPIENTRY
   3929 _mesa_marshal_VertexAttribP1uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint * value)
   3930 {
   3931    GET_CURRENT_CONTEXT(ctx);
   3932    _mesa_glthread_finish(ctx);
   3933    debug_print_sync("VertexAttribP1uiv");
   3934    CALL_VertexAttribP1uiv(ctx->CurrentServerDispatch, (index, type, normalized, value));
   3935 }
   3936 
   3937 
   3938 /* IsProgram: marshalled synchronously */
   3939 static GLboolean GLAPIENTRY
   3940 _mesa_marshal_IsProgram(GLuint program)
   3941 {
   3942    GET_CURRENT_CONTEXT(ctx);
   3943    _mesa_glthread_finish(ctx);
   3944    debug_print_sync("IsProgram");
   3945    return CALL_IsProgram(ctx->CurrentServerDispatch, (program));
   3946 }
   3947 
   3948 
   3949 /* BindBuffersBase: marshalled synchronously */
   3950 static void GLAPIENTRY
   3951 _mesa_marshal_BindBuffersBase(GLenum target, GLuint first, GLsizei count, const GLuint * buffers)
   3952 {
   3953    GET_CURRENT_CONTEXT(ctx);
   3954    _mesa_glthread_finish(ctx);
   3955    debug_print_sync("BindBuffersBase");
   3956    CALL_BindBuffersBase(ctx->CurrentServerDispatch, (target, first, count, buffers));
   3957 }
   3958 
   3959 
   3960 /* GenTextures: marshalled synchronously */
   3961 static void GLAPIENTRY
   3962 _mesa_marshal_GenTextures(GLsizei n, GLuint * textures)
   3963 {
   3964    GET_CURRENT_CONTEXT(ctx);
   3965    _mesa_glthread_finish(ctx);
   3966    debug_print_sync("GenTextures");
   3967    CALL_GenTextures(ctx->CurrentServerDispatch, (n, textures));
   3968 }
   3969 
   3970 
   3971 /* UnmapNamedBuffer: marshalled synchronously */
   3972 static GLboolean GLAPIENTRY
   3973 _mesa_marshal_UnmapNamedBuffer(GLuint buffer)
   3974 {
   3975    GET_CURRENT_CONTEXT(ctx);
   3976    _mesa_glthread_finish(ctx);
   3977    debug_print_sync("UnmapNamedBuffer");
   3978    return CALL_UnmapNamedBuffer(ctx->CurrentServerDispatch, (buffer));
   3979 }
   3980 
   3981 
   3982 /* UniformMatrix3x2dv: marshalled asynchronously */
   3983 struct marshal_cmd_UniformMatrix3x2dv
   3984 {
   3985    struct marshal_cmd_base cmd_base;
   3986    GLint location;
   3987    GLsizei count;
   3988    GLboolean transpose;
   3989    /* Next safe_mul(count, 48) bytes are GLdouble value[count][6] */
   3990 };
   3991 static inline void
   3992 _mesa_unmarshal_UniformMatrix3x2dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3x2dv *cmd)
   3993 {
   3994    const GLint location = cmd->location;
   3995    const GLsizei count = cmd->count;
   3996    const GLboolean transpose = cmd->transpose;
   3997    const GLdouble * value;
   3998    const char *variable_data = (const char *) (cmd + 1);
   3999    value = (const GLdouble *) variable_data;
   4000    variable_data += count * 48;
   4001    CALL_UniformMatrix3x2dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   4002 }
   4003 static void GLAPIENTRY
   4004 _mesa_marshal_UniformMatrix3x2dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   4005 {
   4006    GET_CURRENT_CONTEXT(ctx);
   4007    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix3x2dv) + safe_mul(count, 48);
   4008    struct marshal_cmd_UniformMatrix3x2dv *cmd;
   4009    debug_print_marshal("UniformMatrix3x2dv");
   4010    if (unlikely(safe_mul(count, 48) < 0)) {
   4011       goto fallback_to_sync;
   4012    }
   4013    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4014       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3x2dv, cmd_size);
   4015       cmd->location = location;
   4016       cmd->count = count;
   4017       cmd->transpose = transpose;
   4018       char *variable_data = (char *) (cmd + 1);
   4019       memcpy(variable_data, value, count * 48);
   4020       variable_data += count * 48;
   4021       _mesa_post_marshal_hook(ctx);
   4022       return;
   4023    }
   4024 
   4025 fallback_to_sync:
   4026    _mesa_glthread_finish(ctx);
   4027    debug_print_sync_fallback("UniformMatrix3x2dv");
   4028    CALL_UniformMatrix3x2dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   4029 }
   4030 
   4031 
   4032 /* WindowPos4fMESA: marshalled asynchronously */
   4033 struct marshal_cmd_WindowPos4fMESA
   4034 {
   4035    struct marshal_cmd_base cmd_base;
   4036    GLfloat x;
   4037    GLfloat y;
   4038    GLfloat z;
   4039    GLfloat w;
   4040 };
   4041 static inline void
   4042 _mesa_unmarshal_WindowPos4fMESA(struct gl_context *ctx, const struct marshal_cmd_WindowPos4fMESA *cmd)
   4043 {
   4044    const GLfloat x = cmd->x;
   4045    const GLfloat y = cmd->y;
   4046    const GLfloat z = cmd->z;
   4047    const GLfloat w = cmd->w;
   4048    CALL_WindowPos4fMESA(ctx->CurrentServerDispatch, (x, y, z, w));
   4049 }
   4050 static void GLAPIENTRY
   4051 _mesa_marshal_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
   4052 {
   4053    GET_CURRENT_CONTEXT(ctx);
   4054    size_t cmd_size = sizeof(struct marshal_cmd_WindowPos4fMESA);
   4055    struct marshal_cmd_WindowPos4fMESA *cmd;
   4056    debug_print_marshal("WindowPos4fMESA");
   4057    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4058       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos4fMESA, cmd_size);
   4059       cmd->x = x;
   4060       cmd->y = y;
   4061       cmd->z = z;
   4062       cmd->w = w;
   4063       _mesa_post_marshal_hook(ctx);
   4064       return;
   4065    }
   4066 
   4067    _mesa_glthread_finish(ctx);
   4068    debug_print_sync_fallback("WindowPos4fMESA");
   4069    CALL_WindowPos4fMESA(ctx->CurrentServerDispatch, (x, y, z, w));
   4070 }
   4071 
   4072 
   4073 /* VertexAttribs2fvNV: marshalled asynchronously */
   4074 struct marshal_cmd_VertexAttribs2fvNV
   4075 {
   4076    struct marshal_cmd_base cmd_base;
   4077    GLuint index;
   4078    GLsizei n;
   4079    /* Next safe_mul(n, 8) bytes are GLfloat v[n][2] */
   4080 };
   4081 static inline void
   4082 _mesa_unmarshal_VertexAttribs2fvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs2fvNV *cmd)
   4083 {
   4084    const GLuint index = cmd->index;
   4085    const GLsizei n = cmd->n;
   4086    const GLfloat * v;
   4087    const char *variable_data = (const char *) (cmd + 1);
   4088    v = (const GLfloat *) variable_data;
   4089    variable_data += n * 8;
   4090    CALL_VertexAttribs2fvNV(ctx->CurrentServerDispatch, (index, n, v));
   4091 }
   4092 static void GLAPIENTRY
   4093 _mesa_marshal_VertexAttribs2fvNV(GLuint index, GLsizei n, const GLfloat * v)
   4094 {
   4095    GET_CURRENT_CONTEXT(ctx);
   4096    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribs2fvNV) + safe_mul(n, 8);
   4097    struct marshal_cmd_VertexAttribs2fvNV *cmd;
   4098    debug_print_marshal("VertexAttribs2fvNV");
   4099    if (unlikely(safe_mul(n, 8) < 0)) {
   4100       goto fallback_to_sync;
   4101    }
   4102    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4103       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs2fvNV, cmd_size);
   4104       cmd->index = index;
   4105       cmd->n = n;
   4106       char *variable_data = (char *) (cmd + 1);
   4107       memcpy(variable_data, v, n * 8);
   4108       variable_data += n * 8;
   4109       _mesa_post_marshal_hook(ctx);
   4110       return;
   4111    }
   4112 
   4113 fallback_to_sync:
   4114    _mesa_glthread_finish(ctx);
   4115    debug_print_sync_fallback("VertexAttribs2fvNV");
   4116    CALL_VertexAttribs2fvNV(ctx->CurrentServerDispatch, (index, n, v));
   4117 }
   4118 
   4119 
   4120 /* VertexAttribP4ui: marshalled asynchronously */
   4121 struct marshal_cmd_VertexAttribP4ui
   4122 {
   4123    struct marshal_cmd_base cmd_base;
   4124    GLuint index;
   4125    GLenum type;
   4126    GLboolean normalized;
   4127    GLuint value;
   4128 };
   4129 static inline void
   4130 _mesa_unmarshal_VertexAttribP4ui(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP4ui *cmd)
   4131 {
   4132    const GLuint index = cmd->index;
   4133    const GLenum type = cmd->type;
   4134    const GLboolean normalized = cmd->normalized;
   4135    const GLuint value = cmd->value;
   4136    CALL_VertexAttribP4ui(ctx->CurrentServerDispatch, (index, type, normalized, value));
   4137 }
   4138 static void GLAPIENTRY
   4139 _mesa_marshal_VertexAttribP4ui(GLuint index, GLenum type, GLboolean normalized, GLuint value)
   4140 {
   4141    GET_CURRENT_CONTEXT(ctx);
   4142    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribP4ui);
   4143    struct marshal_cmd_VertexAttribP4ui *cmd;
   4144    debug_print_marshal("VertexAttribP4ui");
   4145    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4146       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP4ui, cmd_size);
   4147       cmd->index = index;
   4148       cmd->type = type;
   4149       cmd->normalized = normalized;
   4150       cmd->value = value;
   4151       _mesa_post_marshal_hook(ctx);
   4152       return;
   4153    }
   4154 
   4155    _mesa_glthread_finish(ctx);
   4156    debug_print_sync_fallback("VertexAttribP4ui");
   4157    CALL_VertexAttribP4ui(ctx->CurrentServerDispatch, (index, type, normalized, value));
   4158 }
   4159 
   4160 
   4161 /* StringMarkerGREMEDY: marshalled synchronously */
   4162 static void GLAPIENTRY
   4163 _mesa_marshal_StringMarkerGREMEDY(GLsizei len, const GLvoid * string)
   4164 {
   4165    GET_CURRENT_CONTEXT(ctx);
   4166    _mesa_glthread_finish(ctx);
   4167    debug_print_sync("StringMarkerGREMEDY");
   4168    CALL_StringMarkerGREMEDY(ctx->CurrentServerDispatch, (len, string));
   4169 }
   4170 
   4171 
   4172 /* Uniform4i: marshalled asynchronously */
   4173 struct marshal_cmd_Uniform4i
   4174 {
   4175    struct marshal_cmd_base cmd_base;
   4176    GLint location;
   4177    GLint v0;
   4178    GLint v1;
   4179    GLint v2;
   4180    GLint v3;
   4181 };
   4182 static inline void
   4183 _mesa_unmarshal_Uniform4i(struct gl_context *ctx, const struct marshal_cmd_Uniform4i *cmd)
   4184 {
   4185    const GLint location = cmd->location;
   4186    const GLint v0 = cmd->v0;
   4187    const GLint v1 = cmd->v1;
   4188    const GLint v2 = cmd->v2;
   4189    const GLint v3 = cmd->v3;
   4190    CALL_Uniform4i(ctx->CurrentServerDispatch, (location, v0, v1, v2, v3));
   4191 }
   4192 static void GLAPIENTRY
   4193 _mesa_marshal_Uniform4i(GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
   4194 {
   4195    GET_CURRENT_CONTEXT(ctx);
   4196    size_t cmd_size = sizeof(struct marshal_cmd_Uniform4i);
   4197    struct marshal_cmd_Uniform4i *cmd;
   4198    debug_print_marshal("Uniform4i");
   4199    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4200       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4i, cmd_size);
   4201       cmd->location = location;
   4202       cmd->v0 = v0;
   4203       cmd->v1 = v1;
   4204       cmd->v2 = v2;
   4205       cmd->v3 = v3;
   4206       _mesa_post_marshal_hook(ctx);
   4207       return;
   4208    }
   4209 
   4210    _mesa_glthread_finish(ctx);
   4211    debug_print_sync_fallback("Uniform4i");
   4212    CALL_Uniform4i(ctx->CurrentServerDispatch, (location, v0, v1, v2, v3));
   4213 }
   4214 
   4215 
   4216 /* Uniform4d: marshalled asynchronously */
   4217 struct marshal_cmd_Uniform4d
   4218 {
   4219    struct marshal_cmd_base cmd_base;
   4220    GLint location;
   4221    GLdouble x;
   4222    GLdouble y;
   4223    GLdouble z;
   4224    GLdouble w;
   4225 };
   4226 static inline void
   4227 _mesa_unmarshal_Uniform4d(struct gl_context *ctx, const struct marshal_cmd_Uniform4d *cmd)
   4228 {
   4229    const GLint location = cmd->location;
   4230    const GLdouble x = cmd->x;
   4231    const GLdouble y = cmd->y;
   4232    const GLdouble z = cmd->z;
   4233    const GLdouble w = cmd->w;
   4234    CALL_Uniform4d(ctx->CurrentServerDispatch, (location, x, y, z, w));
   4235 }
   4236 static void GLAPIENTRY
   4237 _mesa_marshal_Uniform4d(GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
   4238 {
   4239    GET_CURRENT_CONTEXT(ctx);
   4240    size_t cmd_size = sizeof(struct marshal_cmd_Uniform4d);
   4241    struct marshal_cmd_Uniform4d *cmd;
   4242    debug_print_marshal("Uniform4d");
   4243    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4244       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4d, cmd_size);
   4245       cmd->location = location;
   4246       cmd->x = x;
   4247       cmd->y = y;
   4248       cmd->z = z;
   4249       cmd->w = w;
   4250       _mesa_post_marshal_hook(ctx);
   4251       return;
   4252    }
   4253 
   4254    _mesa_glthread_finish(ctx);
   4255    debug_print_sync_fallback("Uniform4d");
   4256    CALL_Uniform4d(ctx->CurrentServerDispatch, (location, x, y, z, w));
   4257 }
   4258 
   4259 
   4260 /* Uniform4f: marshalled asynchronously */
   4261 struct marshal_cmd_Uniform4f
   4262 {
   4263    struct marshal_cmd_base cmd_base;
   4264    GLint location;
   4265    GLfloat v0;
   4266    GLfloat v1;
   4267    GLfloat v2;
   4268    GLfloat v3;
   4269 };
   4270 static inline void
   4271 _mesa_unmarshal_Uniform4f(struct gl_context *ctx, const struct marshal_cmd_Uniform4f *cmd)
   4272 {
   4273    const GLint location = cmd->location;
   4274    const GLfloat v0 = cmd->v0;
   4275    const GLfloat v1 = cmd->v1;
   4276    const GLfloat v2 = cmd->v2;
   4277    const GLfloat v3 = cmd->v3;
   4278    CALL_Uniform4f(ctx->CurrentServerDispatch, (location, v0, v1, v2, v3));
   4279 }
   4280 static void GLAPIENTRY
   4281 _mesa_marshal_Uniform4f(GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
   4282 {
   4283    GET_CURRENT_CONTEXT(ctx);
   4284    size_t cmd_size = sizeof(struct marshal_cmd_Uniform4f);
   4285    struct marshal_cmd_Uniform4f *cmd;
   4286    debug_print_marshal("Uniform4f");
   4287    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4288       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4f, cmd_size);
   4289       cmd->location = location;
   4290       cmd->v0 = v0;
   4291       cmd->v1 = v1;
   4292       cmd->v2 = v2;
   4293       cmd->v3 = v3;
   4294       _mesa_post_marshal_hook(ctx);
   4295       return;
   4296    }
   4297 
   4298    _mesa_glthread_finish(ctx);
   4299    debug_print_sync_fallback("Uniform4f");
   4300    CALL_Uniform4f(ctx->CurrentServerDispatch, (location, v0, v1, v2, v3));
   4301 }
   4302 
   4303 
   4304 /* ProgramUniform3dv: marshalled asynchronously */
   4305 struct marshal_cmd_ProgramUniform3dv
   4306 {
   4307    struct marshal_cmd_base cmd_base;
   4308    GLuint program;
   4309    GLint location;
   4310    GLsizei count;
   4311    /* Next safe_mul(count, 24) bytes are GLdouble value[count][3] */
   4312 };
   4313 static inline void
   4314 _mesa_unmarshal_ProgramUniform3dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3dv *cmd)
   4315 {
   4316    const GLuint program = cmd->program;
   4317    const GLint location = cmd->location;
   4318    const GLsizei count = cmd->count;
   4319    const GLdouble * value;
   4320    const char *variable_data = (const char *) (cmd + 1);
   4321    value = (const GLdouble *) variable_data;
   4322    variable_data += count * 24;
   4323    CALL_ProgramUniform3dv(ctx->CurrentServerDispatch, (program, location, count, value));
   4324 }
   4325 static void GLAPIENTRY
   4326 _mesa_marshal_ProgramUniform3dv(GLuint program, GLint location, GLsizei count, const GLdouble * value)
   4327 {
   4328    GET_CURRENT_CONTEXT(ctx);
   4329    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform3dv) + safe_mul(count, 24);
   4330    struct marshal_cmd_ProgramUniform3dv *cmd;
   4331    debug_print_marshal("ProgramUniform3dv");
   4332    if (unlikely(safe_mul(count, 24) < 0)) {
   4333       goto fallback_to_sync;
   4334    }
   4335    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4336       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3dv, cmd_size);
   4337       cmd->program = program;
   4338       cmd->location = location;
   4339       cmd->count = count;
   4340       char *variable_data = (char *) (cmd + 1);
   4341       memcpy(variable_data, value, count * 24);
   4342       variable_data += count * 24;
   4343       _mesa_post_marshal_hook(ctx);
   4344       return;
   4345    }
   4346 
   4347 fallback_to_sync:
   4348    _mesa_glthread_finish(ctx);
   4349    debug_print_sync_fallback("ProgramUniform3dv");
   4350    CALL_ProgramUniform3dv(ctx->CurrentServerDispatch, (program, location, count, value));
   4351 }
   4352 
   4353 
   4354 /* GetNamedBufferParameteri64v: marshalled synchronously */
   4355 static void GLAPIENTRY
   4356 _mesa_marshal_GetNamedBufferParameteri64v(GLuint buffer, GLenum pname, GLint64 * params)
   4357 {
   4358    GET_CURRENT_CONTEXT(ctx);
   4359    _mesa_glthread_finish(ctx);
   4360    debug_print_sync("GetNamedBufferParameteri64v");
   4361    CALL_GetNamedBufferParameteri64v(ctx->CurrentServerDispatch, (buffer, pname, params));
   4362 }
   4363 
   4364 
   4365 /* NamedFramebufferTexture: marshalled asynchronously */
   4366 struct marshal_cmd_NamedFramebufferTexture
   4367 {
   4368    struct marshal_cmd_base cmd_base;
   4369    GLuint framebuffer;
   4370    GLenum attachment;
   4371    GLuint texture;
   4372    GLint level;
   4373 };
   4374 static inline void
   4375 _mesa_unmarshal_NamedFramebufferTexture(struct gl_context *ctx, const struct marshal_cmd_NamedFramebufferTexture *cmd)
   4376 {
   4377    const GLuint framebuffer = cmd->framebuffer;
   4378    const GLenum attachment = cmd->attachment;
   4379    const GLuint texture = cmd->texture;
   4380    const GLint level = cmd->level;
   4381    CALL_NamedFramebufferTexture(ctx->CurrentServerDispatch, (framebuffer, attachment, texture, level));
   4382 }
   4383 static void GLAPIENTRY
   4384 _mesa_marshal_NamedFramebufferTexture(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level)
   4385 {
   4386    GET_CURRENT_CONTEXT(ctx);
   4387    size_t cmd_size = sizeof(struct marshal_cmd_NamedFramebufferTexture);
   4388    struct marshal_cmd_NamedFramebufferTexture *cmd;
   4389    debug_print_marshal("NamedFramebufferTexture");
   4390    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4391       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedFramebufferTexture, cmd_size);
   4392       cmd->framebuffer = framebuffer;
   4393       cmd->attachment = attachment;
   4394       cmd->texture = texture;
   4395       cmd->level = level;
   4396       _mesa_post_marshal_hook(ctx);
   4397       return;
   4398    }
   4399 
   4400    _mesa_glthread_finish(ctx);
   4401    debug_print_sync_fallback("NamedFramebufferTexture");
   4402    CALL_NamedFramebufferTexture(ctx->CurrentServerDispatch, (framebuffer, attachment, texture, level));
   4403 }
   4404 
   4405 
   4406 /* ProgramUniform3d: marshalled asynchronously */
   4407 struct marshal_cmd_ProgramUniform3d
   4408 {
   4409    struct marshal_cmd_base cmd_base;
   4410    GLuint program;
   4411    GLint location;
   4412    GLdouble x;
   4413    GLdouble y;
   4414    GLdouble z;
   4415 };
   4416 static inline void
   4417 _mesa_unmarshal_ProgramUniform3d(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3d *cmd)
   4418 {
   4419    const GLuint program = cmd->program;
   4420    const GLint location = cmd->location;
   4421    const GLdouble x = cmd->x;
   4422    const GLdouble y = cmd->y;
   4423    const GLdouble z = cmd->z;
   4424    CALL_ProgramUniform3d(ctx->CurrentServerDispatch, (program, location, x, y, z));
   4425 }
   4426 static void GLAPIENTRY
   4427 _mesa_marshal_ProgramUniform3d(GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z)
   4428 {
   4429    GET_CURRENT_CONTEXT(ctx);
   4430    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform3d);
   4431    struct marshal_cmd_ProgramUniform3d *cmd;
   4432    debug_print_marshal("ProgramUniform3d");
   4433    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4434       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3d, cmd_size);
   4435       cmd->program = program;
   4436       cmd->location = location;
   4437       cmd->x = x;
   4438       cmd->y = y;
   4439       cmd->z = z;
   4440       _mesa_post_marshal_hook(ctx);
   4441       return;
   4442    }
   4443 
   4444    _mesa_glthread_finish(ctx);
   4445    debug_print_sync_fallback("ProgramUniform3d");
   4446    CALL_ProgramUniform3d(ctx->CurrentServerDispatch, (program, location, x, y, z));
   4447 }
   4448 
   4449 
   4450 /* ProgramUniform3f: marshalled asynchronously */
   4451 struct marshal_cmd_ProgramUniform3f
   4452 {
   4453    struct marshal_cmd_base cmd_base;
   4454    GLuint program;
   4455    GLint location;
   4456    GLfloat x;
   4457    GLfloat y;
   4458    GLfloat z;
   4459 };
   4460 static inline void
   4461 _mesa_unmarshal_ProgramUniform3f(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3f *cmd)
   4462 {
   4463    const GLuint program = cmd->program;
   4464    const GLint location = cmd->location;
   4465    const GLfloat x = cmd->x;
   4466    const GLfloat y = cmd->y;
   4467    const GLfloat z = cmd->z;
   4468    CALL_ProgramUniform3f(ctx->CurrentServerDispatch, (program, location, x, y, z));
   4469 }
   4470 static void GLAPIENTRY
   4471 _mesa_marshal_ProgramUniform3f(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z)
   4472 {
   4473    GET_CURRENT_CONTEXT(ctx);
   4474    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform3f);
   4475    struct marshal_cmd_ProgramUniform3f *cmd;
   4476    debug_print_marshal("ProgramUniform3f");
   4477    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4478       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3f, cmd_size);
   4479       cmd->program = program;
   4480       cmd->location = location;
   4481       cmd->x = x;
   4482       cmd->y = y;
   4483       cmd->z = z;
   4484       _mesa_post_marshal_hook(ctx);
   4485       return;
   4486    }
   4487 
   4488    _mesa_glthread_finish(ctx);
   4489    debug_print_sync_fallback("ProgramUniform3f");
   4490    CALL_ProgramUniform3f(ctx->CurrentServerDispatch, (program, location, x, y, z));
   4491 }
   4492 
   4493 
   4494 /* ProgramUniform3i: marshalled asynchronously */
   4495 struct marshal_cmd_ProgramUniform3i
   4496 {
   4497    struct marshal_cmd_base cmd_base;
   4498    GLuint program;
   4499    GLint location;
   4500    GLint x;
   4501    GLint y;
   4502    GLint z;
   4503 };
   4504 static inline void
   4505 _mesa_unmarshal_ProgramUniform3i(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3i *cmd)
   4506 {
   4507    const GLuint program = cmd->program;
   4508    const GLint location = cmd->location;
   4509    const GLint x = cmd->x;
   4510    const GLint y = cmd->y;
   4511    const GLint z = cmd->z;
   4512    CALL_ProgramUniform3i(ctx->CurrentServerDispatch, (program, location, x, y, z));
   4513 }
   4514 static void GLAPIENTRY
   4515 _mesa_marshal_ProgramUniform3i(GLuint program, GLint location, GLint x, GLint y, GLint z)
   4516 {
   4517    GET_CURRENT_CONTEXT(ctx);
   4518    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform3i);
   4519    struct marshal_cmd_ProgramUniform3i *cmd;
   4520    debug_print_marshal("ProgramUniform3i");
   4521    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4522       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3i, cmd_size);
   4523       cmd->program = program;
   4524       cmd->location = location;
   4525       cmd->x = x;
   4526       cmd->y = y;
   4527       cmd->z = z;
   4528       _mesa_post_marshal_hook(ctx);
   4529       return;
   4530    }
   4531 
   4532    _mesa_glthread_finish(ctx);
   4533    debug_print_sync_fallback("ProgramUniform3i");
   4534    CALL_ProgramUniform3i(ctx->CurrentServerDispatch, (program, location, x, y, z));
   4535 }
   4536 
   4537 
   4538 /* PointParameterfv: marshalled synchronously */
   4539 static void GLAPIENTRY
   4540 _mesa_marshal_PointParameterfv(GLenum pname, const GLfloat * params)
   4541 {
   4542    GET_CURRENT_CONTEXT(ctx);
   4543    _mesa_glthread_finish(ctx);
   4544    debug_print_sync("PointParameterfv");
   4545    CALL_PointParameterfv(ctx->CurrentServerDispatch, (pname, params));
   4546 }
   4547 
   4548 
   4549 /* GetHistogramParameterfv: marshalled synchronously */
   4550 static void GLAPIENTRY
   4551 _mesa_marshal_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat * params)
   4552 {
   4553    GET_CURRENT_CONTEXT(ctx);
   4554    _mesa_glthread_finish(ctx);
   4555    debug_print_sync("GetHistogramParameterfv");
   4556    CALL_GetHistogramParameterfv(ctx->CurrentServerDispatch, (target, pname, params));
   4557 }
   4558 
   4559 
   4560 /* GetString: marshalled synchronously */
   4561 static const GLubyte * GLAPIENTRY
   4562 _mesa_marshal_GetString(GLenum name)
   4563 {
   4564    GET_CURRENT_CONTEXT(ctx);
   4565    _mesa_glthread_finish(ctx);
   4566    debug_print_sync("GetString");
   4567    return CALL_GetString(ctx->CurrentServerDispatch, (name));
   4568 }
   4569 
   4570 
   4571 /* VDPAUUnmapSurfacesNV: marshalled synchronously */
   4572 static void GLAPIENTRY
   4573 _mesa_marshal_VDPAUUnmapSurfacesNV(GLsizei numSurfaces, const GLintptr * surfaces)
   4574 {
   4575    GET_CURRENT_CONTEXT(ctx);
   4576    _mesa_glthread_finish(ctx);
   4577    debug_print_sync("VDPAUUnmapSurfacesNV");
   4578    CALL_VDPAUUnmapSurfacesNV(ctx->CurrentServerDispatch, (numSurfaces, surfaces));
   4579 }
   4580 
   4581 
   4582 /* GetnHistogramARB: marshalled synchronously */
   4583 static void GLAPIENTRY
   4584 _mesa_marshal_GetnHistogramARB(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid * values)
   4585 {
   4586    GET_CURRENT_CONTEXT(ctx);
   4587    _mesa_glthread_finish(ctx);
   4588    debug_print_sync("GetnHistogramARB");
   4589    CALL_GetnHistogramARB(ctx->CurrentServerDispatch, (target, reset, format, type, bufSize, values));
   4590 }
   4591 
   4592 
   4593 /* SecondaryColor3s: marshalled asynchronously */
   4594 struct marshal_cmd_SecondaryColor3s
   4595 {
   4596    struct marshal_cmd_base cmd_base;
   4597    GLshort red;
   4598    GLshort green;
   4599    GLshort blue;
   4600 };
   4601 static inline void
   4602 _mesa_unmarshal_SecondaryColor3s(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3s *cmd)
   4603 {
   4604    const GLshort red = cmd->red;
   4605    const GLshort green = cmd->green;
   4606    const GLshort blue = cmd->blue;
   4607    CALL_SecondaryColor3s(ctx->CurrentServerDispatch, (red, green, blue));
   4608 }
   4609 static void GLAPIENTRY
   4610 _mesa_marshal_SecondaryColor3s(GLshort red, GLshort green, GLshort blue)
   4611 {
   4612    GET_CURRENT_CONTEXT(ctx);
   4613    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColor3s);
   4614    struct marshal_cmd_SecondaryColor3s *cmd;
   4615    debug_print_marshal("SecondaryColor3s");
   4616    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4617       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3s, cmd_size);
   4618       cmd->red = red;
   4619       cmd->green = green;
   4620       cmd->blue = blue;
   4621       _mesa_post_marshal_hook(ctx);
   4622       return;
   4623    }
   4624 
   4625    _mesa_glthread_finish(ctx);
   4626    debug_print_sync_fallback("SecondaryColor3s");
   4627    CALL_SecondaryColor3s(ctx->CurrentServerDispatch, (red, green, blue));
   4628 }
   4629 
   4630 
   4631 /* TexStorageMem2DEXT: marshalled asynchronously */
   4632 struct marshal_cmd_TexStorageMem2DEXT
   4633 {
   4634    struct marshal_cmd_base cmd_base;
   4635    GLenum target;
   4636    GLsizei levels;
   4637    GLenum internalFormat;
   4638    GLsizei width;
   4639    GLsizei height;
   4640    GLuint memory;
   4641    GLuint64 offset;
   4642 };
   4643 static inline void
   4644 _mesa_unmarshal_TexStorageMem2DEXT(struct gl_context *ctx, const struct marshal_cmd_TexStorageMem2DEXT *cmd)
   4645 {
   4646    const GLenum target = cmd->target;
   4647    const GLsizei levels = cmd->levels;
   4648    const GLenum internalFormat = cmd->internalFormat;
   4649    const GLsizei width = cmd->width;
   4650    const GLsizei height = cmd->height;
   4651    const GLuint memory = cmd->memory;
   4652    const GLuint64 offset = cmd->offset;
   4653    CALL_TexStorageMem2DEXT(ctx->CurrentServerDispatch, (target, levels, internalFormat, width, height, memory, offset));
   4654 }
   4655 static void GLAPIENTRY
   4656 _mesa_marshal_TexStorageMem2DEXT(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset)
   4657 {
   4658    GET_CURRENT_CONTEXT(ctx);
   4659    size_t cmd_size = sizeof(struct marshal_cmd_TexStorageMem2DEXT);
   4660    struct marshal_cmd_TexStorageMem2DEXT *cmd;
   4661    debug_print_marshal("TexStorageMem2DEXT");
   4662    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4663       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorageMem2DEXT, cmd_size);
   4664       cmd->target = target;
   4665       cmd->levels = levels;
   4666       cmd->internalFormat = internalFormat;
   4667       cmd->width = width;
   4668       cmd->height = height;
   4669       cmd->memory = memory;
   4670       cmd->offset = offset;
   4671       _mesa_post_marshal_hook(ctx);
   4672       return;
   4673    }
   4674 
   4675    _mesa_glthread_finish(ctx);
   4676    debug_print_sync_fallback("TexStorageMem2DEXT");
   4677    CALL_TexStorageMem2DEXT(ctx->CurrentServerDispatch, (target, levels, internalFormat, width, height, memory, offset));
   4678 }
   4679 
   4680 
   4681 /* VertexAttribP2uiv: marshalled synchronously */
   4682 static void GLAPIENTRY
   4683 _mesa_marshal_VertexAttribP2uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint * value)
   4684 {
   4685    GET_CURRENT_CONTEXT(ctx);
   4686    _mesa_glthread_finish(ctx);
   4687    debug_print_sync("VertexAttribP2uiv");
   4688    CALL_VertexAttribP2uiv(ctx->CurrentServerDispatch, (index, type, normalized, value));
   4689 }
   4690 
   4691 
   4692 /* UniformMatrix3x4dv: marshalled asynchronously */
   4693 struct marshal_cmd_UniformMatrix3x4dv
   4694 {
   4695    struct marshal_cmd_base cmd_base;
   4696    GLint location;
   4697    GLsizei count;
   4698    GLboolean transpose;
   4699    /* Next safe_mul(count, 96) bytes are GLdouble value[count][12] */
   4700 };
   4701 static inline void
   4702 _mesa_unmarshal_UniformMatrix3x4dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3x4dv *cmd)
   4703 {
   4704    const GLint location = cmd->location;
   4705    const GLsizei count = cmd->count;
   4706    const GLboolean transpose = cmd->transpose;
   4707    const GLdouble * value;
   4708    const char *variable_data = (const char *) (cmd + 1);
   4709    value = (const GLdouble *) variable_data;
   4710    variable_data += count * 96;
   4711    CALL_UniformMatrix3x4dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   4712 }
   4713 static void GLAPIENTRY
   4714 _mesa_marshal_UniformMatrix3x4dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   4715 {
   4716    GET_CURRENT_CONTEXT(ctx);
   4717    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix3x4dv) + safe_mul(count, 96);
   4718    struct marshal_cmd_UniformMatrix3x4dv *cmd;
   4719    debug_print_marshal("UniformMatrix3x4dv");
   4720    if (unlikely(safe_mul(count, 96) < 0)) {
   4721       goto fallback_to_sync;
   4722    }
   4723    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4724       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3x4dv, cmd_size);
   4725       cmd->location = location;
   4726       cmd->count = count;
   4727       cmd->transpose = transpose;
   4728       char *variable_data = (char *) (cmd + 1);
   4729       memcpy(variable_data, value, count * 96);
   4730       variable_data += count * 96;
   4731       _mesa_post_marshal_hook(ctx);
   4732       return;
   4733    }
   4734 
   4735 fallback_to_sync:
   4736    _mesa_glthread_finish(ctx);
   4737    debug_print_sync_fallback("UniformMatrix3x4dv");
   4738    CALL_UniformMatrix3x4dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   4739 }
   4740 
   4741 
   4742 /* VertexAttrib3fNV: marshalled asynchronously */
   4743 struct marshal_cmd_VertexAttrib3fNV
   4744 {
   4745    struct marshal_cmd_base cmd_base;
   4746    GLuint index;
   4747    GLfloat x;
   4748    GLfloat y;
   4749    GLfloat z;
   4750 };
   4751 static inline void
   4752 _mesa_unmarshal_VertexAttrib3fNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3fNV *cmd)
   4753 {
   4754    const GLuint index = cmd->index;
   4755    const GLfloat x = cmd->x;
   4756    const GLfloat y = cmd->y;
   4757    const GLfloat z = cmd->z;
   4758    CALL_VertexAttrib3fNV(ctx->CurrentServerDispatch, (index, x, y, z));
   4759 }
   4760 static void GLAPIENTRY
   4761 _mesa_marshal_VertexAttrib3fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z)
   4762 {
   4763    GET_CURRENT_CONTEXT(ctx);
   4764    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib3fNV);
   4765    struct marshal_cmd_VertexAttrib3fNV *cmd;
   4766    debug_print_marshal("VertexAttrib3fNV");
   4767    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4768       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3fNV, cmd_size);
   4769       cmd->index = index;
   4770       cmd->x = x;
   4771       cmd->y = y;
   4772       cmd->z = z;
   4773       _mesa_post_marshal_hook(ctx);
   4774       return;
   4775    }
   4776 
   4777    _mesa_glthread_finish(ctx);
   4778    debug_print_sync_fallback("VertexAttrib3fNV");
   4779    CALL_VertexAttrib3fNV(ctx->CurrentServerDispatch, (index, x, y, z));
   4780 }
   4781 
   4782 
   4783 /* SecondaryColor3b: marshalled asynchronously */
   4784 struct marshal_cmd_SecondaryColor3b
   4785 {
   4786    struct marshal_cmd_base cmd_base;
   4787    GLbyte red;
   4788    GLbyte green;
   4789    GLbyte blue;
   4790 };
   4791 static inline void
   4792 _mesa_unmarshal_SecondaryColor3b(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3b *cmd)
   4793 {
   4794    const GLbyte red = cmd->red;
   4795    const GLbyte green = cmd->green;
   4796    const GLbyte blue = cmd->blue;
   4797    CALL_SecondaryColor3b(ctx->CurrentServerDispatch, (red, green, blue));
   4798 }
   4799 static void GLAPIENTRY
   4800 _mesa_marshal_SecondaryColor3b(GLbyte red, GLbyte green, GLbyte blue)
   4801 {
   4802    GET_CURRENT_CONTEXT(ctx);
   4803    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColor3b);
   4804    struct marshal_cmd_SecondaryColor3b *cmd;
   4805    debug_print_marshal("SecondaryColor3b");
   4806    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4807       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3b, cmd_size);
   4808       cmd->red = red;
   4809       cmd->green = green;
   4810       cmd->blue = blue;
   4811       _mesa_post_marshal_hook(ctx);
   4812       return;
   4813    }
   4814 
   4815    _mesa_glthread_finish(ctx);
   4816    debug_print_sync_fallback("SecondaryColor3b");
   4817    CALL_SecondaryColor3b(ctx->CurrentServerDispatch, (red, green, blue));
   4818 }
   4819 
   4820 
   4821 /* EnableClientState: marshalled asynchronously */
   4822 struct marshal_cmd_EnableClientState
   4823 {
   4824    struct marshal_cmd_base cmd_base;
   4825    GLenum array;
   4826 };
   4827 static inline void
   4828 _mesa_unmarshal_EnableClientState(struct gl_context *ctx, const struct marshal_cmd_EnableClientState *cmd)
   4829 {
   4830    const GLenum array = cmd->array;
   4831    CALL_EnableClientState(ctx->CurrentServerDispatch, (array));
   4832 }
   4833 static void GLAPIENTRY
   4834 _mesa_marshal_EnableClientState(GLenum array)
   4835 {
   4836    GET_CURRENT_CONTEXT(ctx);
   4837    size_t cmd_size = sizeof(struct marshal_cmd_EnableClientState);
   4838    struct marshal_cmd_EnableClientState *cmd;
   4839    debug_print_marshal("EnableClientState");
   4840    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4841       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EnableClientState, cmd_size);
   4842       cmd->array = array;
   4843       _mesa_post_marshal_hook(ctx);
   4844       return;
   4845    }
   4846 
   4847    _mesa_glthread_finish(ctx);
   4848    debug_print_sync_fallback("EnableClientState");
   4849    CALL_EnableClientState(ctx->CurrentServerDispatch, (array));
   4850 }
   4851 
   4852 
   4853 /* GetActiveSubroutineName: marshalled synchronously */
   4854 static void GLAPIENTRY
   4855 _mesa_marshal_GetActiveSubroutineName(GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei * length, GLchar * name)
   4856 {
   4857    GET_CURRENT_CONTEXT(ctx);
   4858    _mesa_glthread_finish(ctx);
   4859    debug_print_sync("GetActiveSubroutineName");
   4860    CALL_GetActiveSubroutineName(ctx->CurrentServerDispatch, (program, shadertype, index, bufsize, length, name));
   4861 }
   4862 
   4863 
   4864 /* SecondaryColor3i: marshalled asynchronously */
   4865 struct marshal_cmd_SecondaryColor3i
   4866 {
   4867    struct marshal_cmd_base cmd_base;
   4868    GLint red;
   4869    GLint green;
   4870    GLint blue;
   4871 };
   4872 static inline void
   4873 _mesa_unmarshal_SecondaryColor3i(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3i *cmd)
   4874 {
   4875    const GLint red = cmd->red;
   4876    const GLint green = cmd->green;
   4877    const GLint blue = cmd->blue;
   4878    CALL_SecondaryColor3i(ctx->CurrentServerDispatch, (red, green, blue));
   4879 }
   4880 static void GLAPIENTRY
   4881 _mesa_marshal_SecondaryColor3i(GLint red, GLint green, GLint blue)
   4882 {
   4883    GET_CURRENT_CONTEXT(ctx);
   4884    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColor3i);
   4885    struct marshal_cmd_SecondaryColor3i *cmd;
   4886    debug_print_marshal("SecondaryColor3i");
   4887    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4888       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3i, cmd_size);
   4889       cmd->red = red;
   4890       cmd->green = green;
   4891       cmd->blue = blue;
   4892       _mesa_post_marshal_hook(ctx);
   4893       return;
   4894    }
   4895 
   4896    _mesa_glthread_finish(ctx);
   4897    debug_print_sync_fallback("SecondaryColor3i");
   4898    CALL_SecondaryColor3i(ctx->CurrentServerDispatch, (red, green, blue));
   4899 }
   4900 
   4901 
   4902 /* FlushMappedBufferRange: marshalled asynchronously */
   4903 struct marshal_cmd_FlushMappedBufferRange
   4904 {
   4905    struct marshal_cmd_base cmd_base;
   4906    GLenum target;
   4907    GLintptr offset;
   4908    GLsizeiptr length;
   4909 };
   4910 static inline void
   4911 _mesa_unmarshal_FlushMappedBufferRange(struct gl_context *ctx, const struct marshal_cmd_FlushMappedBufferRange *cmd)
   4912 {
   4913    const GLenum target = cmd->target;
   4914    const GLintptr offset = cmd->offset;
   4915    const GLsizeiptr length = cmd->length;
   4916    CALL_FlushMappedBufferRange(ctx->CurrentServerDispatch, (target, offset, length));
   4917 }
   4918 static void GLAPIENTRY
   4919 _mesa_marshal_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
   4920 {
   4921    GET_CURRENT_CONTEXT(ctx);
   4922    size_t cmd_size = sizeof(struct marshal_cmd_FlushMappedBufferRange);
   4923    struct marshal_cmd_FlushMappedBufferRange *cmd;
   4924    debug_print_marshal("FlushMappedBufferRange");
   4925    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4926       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FlushMappedBufferRange, cmd_size);
   4927       cmd->target = target;
   4928       cmd->offset = offset;
   4929       cmd->length = length;
   4930       _mesa_post_marshal_hook(ctx);
   4931       return;
   4932    }
   4933 
   4934    _mesa_glthread_finish(ctx);
   4935    debug_print_sync_fallback("FlushMappedBufferRange");
   4936    CALL_FlushMappedBufferRange(ctx->CurrentServerDispatch, (target, offset, length));
   4937 }
   4938 
   4939 
   4940 /* TexStorageMem3DEXT: marshalled asynchronously */
   4941 struct marshal_cmd_TexStorageMem3DEXT
   4942 {
   4943    struct marshal_cmd_base cmd_base;
   4944    GLenum target;
   4945    GLsizei levels;
   4946    GLenum internalFormat;
   4947    GLsizei width;
   4948    GLsizei height;
   4949    GLsizei depth;
   4950    GLuint memory;
   4951    GLuint64 offset;
   4952 };
   4953 static inline void
   4954 _mesa_unmarshal_TexStorageMem3DEXT(struct gl_context *ctx, const struct marshal_cmd_TexStorageMem3DEXT *cmd)
   4955 {
   4956    const GLenum target = cmd->target;
   4957    const GLsizei levels = cmd->levels;
   4958    const GLenum internalFormat = cmd->internalFormat;
   4959    const GLsizei width = cmd->width;
   4960    const GLsizei height = cmd->height;
   4961    const GLsizei depth = cmd->depth;
   4962    const GLuint memory = cmd->memory;
   4963    const GLuint64 offset = cmd->offset;
   4964    CALL_TexStorageMem3DEXT(ctx->CurrentServerDispatch, (target, levels, internalFormat, width, height, depth, memory, offset));
   4965 }
   4966 static void GLAPIENTRY
   4967 _mesa_marshal_TexStorageMem3DEXT(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset)
   4968 {
   4969    GET_CURRENT_CONTEXT(ctx);
   4970    size_t cmd_size = sizeof(struct marshal_cmd_TexStorageMem3DEXT);
   4971    struct marshal_cmd_TexStorageMem3DEXT *cmd;
   4972    debug_print_marshal("TexStorageMem3DEXT");
   4973    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   4974       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorageMem3DEXT, cmd_size);
   4975       cmd->target = target;
   4976       cmd->levels = levels;
   4977       cmd->internalFormat = internalFormat;
   4978       cmd->width = width;
   4979       cmd->height = height;
   4980       cmd->depth = depth;
   4981       cmd->memory = memory;
   4982       cmd->offset = offset;
   4983       _mesa_post_marshal_hook(ctx);
   4984       return;
   4985    }
   4986 
   4987    _mesa_glthread_finish(ctx);
   4988    debug_print_sync_fallback("TexStorageMem3DEXT");
   4989    CALL_TexStorageMem3DEXT(ctx->CurrentServerDispatch, (target, levels, internalFormat, width, height, depth, memory, offset));
   4990 }
   4991 
   4992 
   4993 /* Lightfv: marshalled synchronously */
   4994 static void GLAPIENTRY
   4995 _mesa_marshal_Lightfv(GLenum light, GLenum pname, const GLfloat * params)
   4996 {
   4997    GET_CURRENT_CONTEXT(ctx);
   4998    _mesa_glthread_finish(ctx);
   4999    debug_print_sync("Lightfv");
   5000    CALL_Lightfv(ctx->CurrentServerDispatch, (light, pname, params));
   5001 }
   5002 
   5003 
   5004 /* GetFramebufferAttachmentParameteriv: marshalled synchronously */
   5005 static void GLAPIENTRY
   5006 _mesa_marshal_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params)
   5007 {
   5008    GET_CURRENT_CONTEXT(ctx);
   5009    _mesa_glthread_finish(ctx);
   5010    debug_print_sync("GetFramebufferAttachmentParameteriv");
   5011    CALL_GetFramebufferAttachmentParameteriv(ctx->CurrentServerDispatch, (target, attachment, pname, params));
   5012 }
   5013 
   5014 
   5015 /* ColorSubTable: marshalled synchronously */
   5016 static void GLAPIENTRY
   5017 _mesa_marshal_ColorSubTable(GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid * data)
   5018 {
   5019    GET_CURRENT_CONTEXT(ctx);
   5020    _mesa_glthread_finish(ctx);
   5021    debug_print_sync("ColorSubTable");
   5022    CALL_ColorSubTable(ctx->CurrentServerDispatch, (target, start, count, format, type, data));
   5023 }
   5024 
   5025 
   5026 /* GetVertexArrayIndexed64iv: marshalled synchronously */
   5027 static void GLAPIENTRY
   5028 _mesa_marshal_GetVertexArrayIndexed64iv(GLuint vaobj, GLuint index, GLenum pname, GLint64 * param)
   5029 {
   5030    GET_CURRENT_CONTEXT(ctx);
   5031    _mesa_glthread_finish(ctx);
   5032    debug_print_sync("GetVertexArrayIndexed64iv");
   5033    CALL_GetVertexArrayIndexed64iv(ctx->CurrentServerDispatch, (vaobj, index, pname, param));
   5034 }
   5035 
   5036 
   5037 /* EndPerfMonitorAMD: marshalled asynchronously */
   5038 struct marshal_cmd_EndPerfMonitorAMD
   5039 {
   5040    struct marshal_cmd_base cmd_base;
   5041    GLuint monitor;
   5042 };
   5043 static inline void
   5044 _mesa_unmarshal_EndPerfMonitorAMD(struct gl_context *ctx, const struct marshal_cmd_EndPerfMonitorAMD *cmd)
   5045 {
   5046    const GLuint monitor = cmd->monitor;
   5047    CALL_EndPerfMonitorAMD(ctx->CurrentServerDispatch, (monitor));
   5048 }
   5049 static void GLAPIENTRY
   5050 _mesa_marshal_EndPerfMonitorAMD(GLuint monitor)
   5051 {
   5052    GET_CURRENT_CONTEXT(ctx);
   5053    size_t cmd_size = sizeof(struct marshal_cmd_EndPerfMonitorAMD);
   5054    struct marshal_cmd_EndPerfMonitorAMD *cmd;
   5055    debug_print_marshal("EndPerfMonitorAMD");
   5056    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5057       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EndPerfMonitorAMD, cmd_size);
   5058       cmd->monitor = monitor;
   5059       _mesa_post_marshal_hook(ctx);
   5060       return;
   5061    }
   5062 
   5063    _mesa_glthread_finish(ctx);
   5064    debug_print_sync_fallback("EndPerfMonitorAMD");
   5065    CALL_EndPerfMonitorAMD(ctx->CurrentServerDispatch, (monitor));
   5066 }
   5067 
   5068 
   5069 /* CreateBuffers: marshalled synchronously */
   5070 static void GLAPIENTRY
   5071 _mesa_marshal_CreateBuffers(GLsizei n, GLuint * buffers)
   5072 {
   5073    GET_CURRENT_CONTEXT(ctx);
   5074    _mesa_glthread_finish(ctx);
   5075    debug_print_sync("CreateBuffers");
   5076    CALL_CreateBuffers(ctx->CurrentServerDispatch, (n, buffers));
   5077 }
   5078 
   5079 
   5080 /* VertexAttribs4dvNV: marshalled asynchronously */
   5081 struct marshal_cmd_VertexAttribs4dvNV
   5082 {
   5083    struct marshal_cmd_base cmd_base;
   5084    GLuint index;
   5085    GLsizei n;
   5086    /* Next safe_mul(n, 32) bytes are GLdouble v[n][4] */
   5087 };
   5088 static inline void
   5089 _mesa_unmarshal_VertexAttribs4dvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs4dvNV *cmd)
   5090 {
   5091    const GLuint index = cmd->index;
   5092    const GLsizei n = cmd->n;
   5093    const GLdouble * v;
   5094    const char *variable_data = (const char *) (cmd + 1);
   5095    v = (const GLdouble *) variable_data;
   5096    variable_data += n * 32;
   5097    CALL_VertexAttribs4dvNV(ctx->CurrentServerDispatch, (index, n, v));
   5098 }
   5099 static void GLAPIENTRY
   5100 _mesa_marshal_VertexAttribs4dvNV(GLuint index, GLsizei n, const GLdouble * v)
   5101 {
   5102    GET_CURRENT_CONTEXT(ctx);
   5103    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribs4dvNV) + safe_mul(n, 32);
   5104    struct marshal_cmd_VertexAttribs4dvNV *cmd;
   5105    debug_print_marshal("VertexAttribs4dvNV");
   5106    if (unlikely(safe_mul(n, 32) < 0)) {
   5107       goto fallback_to_sync;
   5108    }
   5109    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5110       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs4dvNV, cmd_size);
   5111       cmd->index = index;
   5112       cmd->n = n;
   5113       char *variable_data = (char *) (cmd + 1);
   5114       memcpy(variable_data, v, n * 32);
   5115       variable_data += n * 32;
   5116       _mesa_post_marshal_hook(ctx);
   5117       return;
   5118    }
   5119 
   5120 fallback_to_sync:
   5121    _mesa_glthread_finish(ctx);
   5122    debug_print_sync_fallback("VertexAttribs4dvNV");
   5123    CALL_VertexAttribs4dvNV(ctx->CurrentServerDispatch, (index, n, v));
   5124 }
   5125 
   5126 
   5127 /* Uniform2i64vARB: marshalled asynchronously */
   5128 struct marshal_cmd_Uniform2i64vARB
   5129 {
   5130    struct marshal_cmd_base cmd_base;
   5131    GLint location;
   5132    GLsizei count;
   5133    /* Next safe_mul(count, 16) bytes are GLint64 value[count][2] */
   5134 };
   5135 static inline void
   5136 _mesa_unmarshal_Uniform2i64vARB(struct gl_context *ctx, const struct marshal_cmd_Uniform2i64vARB *cmd)
   5137 {
   5138    const GLint location = cmd->location;
   5139    const GLsizei count = cmd->count;
   5140    const GLint64 * value;
   5141    const char *variable_data = (const char *) (cmd + 1);
   5142    value = (const GLint64 *) variable_data;
   5143    variable_data += count * 16;
   5144    CALL_Uniform2i64vARB(ctx->CurrentServerDispatch, (location, count, value));
   5145 }
   5146 static void GLAPIENTRY
   5147 _mesa_marshal_Uniform2i64vARB(GLint location, GLsizei count, const GLint64 * value)
   5148 {
   5149    GET_CURRENT_CONTEXT(ctx);
   5150    size_t cmd_size = sizeof(struct marshal_cmd_Uniform2i64vARB) + safe_mul(count, 16);
   5151    struct marshal_cmd_Uniform2i64vARB *cmd;
   5152    debug_print_marshal("Uniform2i64vARB");
   5153    if (unlikely(safe_mul(count, 16) < 0)) {
   5154       goto fallback_to_sync;
   5155    }
   5156    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5157       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2i64vARB, cmd_size);
   5158       cmd->location = location;
   5159       cmd->count = count;
   5160       char *variable_data = (char *) (cmd + 1);
   5161       memcpy(variable_data, value, count * 16);
   5162       variable_data += count * 16;
   5163       _mesa_post_marshal_hook(ctx);
   5164       return;
   5165    }
   5166 
   5167 fallback_to_sync:
   5168    _mesa_glthread_finish(ctx);
   5169    debug_print_sync_fallback("Uniform2i64vARB");
   5170    CALL_Uniform2i64vARB(ctx->CurrentServerDispatch, (location, count, value));
   5171 }
   5172 
   5173 
   5174 /* GetMultisamplefv: marshalled synchronously */
   5175 static void GLAPIENTRY
   5176 _mesa_marshal_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val)
   5177 {
   5178    GET_CURRENT_CONTEXT(ctx);
   5179    _mesa_glthread_finish(ctx);
   5180    debug_print_sync("GetMultisamplefv");
   5181    CALL_GetMultisamplefv(ctx->CurrentServerDispatch, (pname, index, val));
   5182 }
   5183 
   5184 
   5185 /* GetActiveSubroutineUniformName: marshalled synchronously */
   5186 static void GLAPIENTRY
   5187 _mesa_marshal_GetActiveSubroutineUniformName(GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei * length, GLchar * name)
   5188 {
   5189    GET_CURRENT_CONTEXT(ctx);
   5190    _mesa_glthread_finish(ctx);
   5191    debug_print_sync("GetActiveSubroutineUniformName");
   5192    CALL_GetActiveSubroutineUniformName(ctx->CurrentServerDispatch, (program, shadertype, index, bufsize, length, name));
   5193 }
   5194 
   5195 
   5196 /* Rectdv: marshalled asynchronously */
   5197 struct marshal_cmd_Rectdv
   5198 {
   5199    struct marshal_cmd_base cmd_base;
   5200    GLdouble v1[2];
   5201    GLdouble v2[2];
   5202 };
   5203 static inline void
   5204 _mesa_unmarshal_Rectdv(struct gl_context *ctx, const struct marshal_cmd_Rectdv *cmd)
   5205 {
   5206    const GLdouble * v1 = cmd->v1;
   5207    const GLdouble * v2 = cmd->v2;
   5208    CALL_Rectdv(ctx->CurrentServerDispatch, (v1, v2));
   5209 }
   5210 static void GLAPIENTRY
   5211 _mesa_marshal_Rectdv(const GLdouble * v1, const GLdouble * v2)
   5212 {
   5213    GET_CURRENT_CONTEXT(ctx);
   5214    size_t cmd_size = sizeof(struct marshal_cmd_Rectdv);
   5215    struct marshal_cmd_Rectdv *cmd;
   5216    debug_print_marshal("Rectdv");
   5217    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5218       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Rectdv, cmd_size);
   5219       memcpy(cmd->v1, v1, 16);
   5220       memcpy(cmd->v2, v2, 16);
   5221       _mesa_post_marshal_hook(ctx);
   5222       return;
   5223    }
   5224 
   5225    _mesa_glthread_finish(ctx);
   5226    debug_print_sync_fallback("Rectdv");
   5227    CALL_Rectdv(ctx->CurrentServerDispatch, (v1, v2));
   5228 }
   5229 
   5230 
   5231 /* DrawArraysInstancedARB: marshalled asynchronously */
   5232 struct marshal_cmd_DrawArraysInstancedARB
   5233 {
   5234    struct marshal_cmd_base cmd_base;
   5235    GLenum mode;
   5236    GLint first;
   5237    GLsizei count;
   5238    GLsizei primcount;
   5239 };
   5240 static inline void
   5241 _mesa_unmarshal_DrawArraysInstancedARB(struct gl_context *ctx, const struct marshal_cmd_DrawArraysInstancedARB *cmd)
   5242 {
   5243    const GLenum mode = cmd->mode;
   5244    const GLint first = cmd->first;
   5245    const GLsizei count = cmd->count;
   5246    const GLsizei primcount = cmd->primcount;
   5247    CALL_DrawArraysInstancedARB(ctx->CurrentServerDispatch, (mode, first, count, primcount));
   5248 }
   5249 static void GLAPIENTRY
   5250 _mesa_marshal_DrawArraysInstancedARB(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
   5251 {
   5252    GET_CURRENT_CONTEXT(ctx);
   5253    size_t cmd_size = sizeof(struct marshal_cmd_DrawArraysInstancedARB);
   5254    struct marshal_cmd_DrawArraysInstancedARB *cmd;
   5255    debug_print_marshal("DrawArraysInstancedARB");
   5256    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5257       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawArraysInstancedARB, cmd_size);
   5258       cmd->mode = mode;
   5259       cmd->first = first;
   5260       cmd->count = count;
   5261       cmd->primcount = primcount;
   5262       _mesa_post_marshal_hook(ctx);
   5263       return;
   5264    }
   5265 
   5266    _mesa_glthread_finish(ctx);
   5267    debug_print_sync_fallback("DrawArraysInstancedARB");
   5268    CALL_DrawArraysInstancedARB(ctx->CurrentServerDispatch, (mode, first, count, primcount));
   5269 }
   5270 
   5271 
   5272 /* MakeImageHandleNonResidentARB: marshalled asynchronously */
   5273 struct marshal_cmd_MakeImageHandleNonResidentARB
   5274 {
   5275    struct marshal_cmd_base cmd_base;
   5276    GLuint64 handle;
   5277 };
   5278 static inline void
   5279 _mesa_unmarshal_MakeImageHandleNonResidentARB(struct gl_context *ctx, const struct marshal_cmd_MakeImageHandleNonResidentARB *cmd)
   5280 {
   5281    const GLuint64 handle = cmd->handle;
   5282    CALL_MakeImageHandleNonResidentARB(ctx->CurrentServerDispatch, (handle));
   5283 }
   5284 static void GLAPIENTRY
   5285 _mesa_marshal_MakeImageHandleNonResidentARB(GLuint64 handle)
   5286 {
   5287    GET_CURRENT_CONTEXT(ctx);
   5288    size_t cmd_size = sizeof(struct marshal_cmd_MakeImageHandleNonResidentARB);
   5289    struct marshal_cmd_MakeImageHandleNonResidentARB *cmd;
   5290    debug_print_marshal("MakeImageHandleNonResidentARB");
   5291    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5292       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MakeImageHandleNonResidentARB, cmd_size);
   5293       cmd->handle = handle;
   5294       _mesa_post_marshal_hook(ctx);
   5295       return;
   5296    }
   5297 
   5298    _mesa_glthread_finish(ctx);
   5299    debug_print_sync_fallback("MakeImageHandleNonResidentARB");
   5300    CALL_MakeImageHandleNonResidentARB(ctx->CurrentServerDispatch, (handle));
   5301 }
   5302 
   5303 
   5304 /* ImportMemoryFdEXT: marshalled asynchronously */
   5305 struct marshal_cmd_ImportMemoryFdEXT
   5306 {
   5307    struct marshal_cmd_base cmd_base;
   5308    GLuint memory;
   5309    GLuint64 size;
   5310    GLenum handleType;
   5311    GLint fd;
   5312 };
   5313 static inline void
   5314 _mesa_unmarshal_ImportMemoryFdEXT(struct gl_context *ctx, const struct marshal_cmd_ImportMemoryFdEXT *cmd)
   5315 {
   5316    const GLuint memory = cmd->memory;
   5317    const GLuint64 size = cmd->size;
   5318    const GLenum handleType = cmd->handleType;
   5319    const GLint fd = cmd->fd;
   5320    CALL_ImportMemoryFdEXT(ctx->CurrentServerDispatch, (memory, size, handleType, fd));
   5321 }
   5322 static void GLAPIENTRY
   5323 _mesa_marshal_ImportMemoryFdEXT(GLuint memory, GLuint64 size, GLenum handleType, GLint fd)
   5324 {
   5325    GET_CURRENT_CONTEXT(ctx);
   5326    size_t cmd_size = sizeof(struct marshal_cmd_ImportMemoryFdEXT);
   5327    struct marshal_cmd_ImportMemoryFdEXT *cmd;
   5328    debug_print_marshal("ImportMemoryFdEXT");
   5329    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5330       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ImportMemoryFdEXT, cmd_size);
   5331       cmd->memory = memory;
   5332       cmd->size = size;
   5333       cmd->handleType = handleType;
   5334       cmd->fd = fd;
   5335       _mesa_post_marshal_hook(ctx);
   5336       return;
   5337    }
   5338 
   5339    _mesa_glthread_finish(ctx);
   5340    debug_print_sync_fallback("ImportMemoryFdEXT");
   5341    CALL_ImportMemoryFdEXT(ctx->CurrentServerDispatch, (memory, size, handleType, fd));
   5342 }
   5343 
   5344 
   5345 /* ProgramEnvParameters4fvEXT: marshalled synchronously */
   5346 static void GLAPIENTRY
   5347 _mesa_marshal_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
   5348 {
   5349    GET_CURRENT_CONTEXT(ctx);
   5350    _mesa_glthread_finish(ctx);
   5351    debug_print_sync("ProgramEnvParameters4fvEXT");
   5352    CALL_ProgramEnvParameters4fvEXT(ctx->CurrentServerDispatch, (target, index, count, params));
   5353 }
   5354 
   5355 
   5356 /* TexStorageMem1DEXT: marshalled asynchronously */
   5357 struct marshal_cmd_TexStorageMem1DEXT
   5358 {
   5359    struct marshal_cmd_base cmd_base;
   5360    GLenum target;
   5361    GLsizei levels;
   5362    GLenum internalFormat;
   5363    GLsizei width;
   5364    GLuint memory;
   5365    GLuint64 offset;
   5366 };
   5367 static inline void
   5368 _mesa_unmarshal_TexStorageMem1DEXT(struct gl_context *ctx, const struct marshal_cmd_TexStorageMem1DEXT *cmd)
   5369 {
   5370    const GLenum target = cmd->target;
   5371    const GLsizei levels = cmd->levels;
   5372    const GLenum internalFormat = cmd->internalFormat;
   5373    const GLsizei width = cmd->width;
   5374    const GLuint memory = cmd->memory;
   5375    const GLuint64 offset = cmd->offset;
   5376    CALL_TexStorageMem1DEXT(ctx->CurrentServerDispatch, (target, levels, internalFormat, width, memory, offset));
   5377 }
   5378 static void GLAPIENTRY
   5379 _mesa_marshal_TexStorageMem1DEXT(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset)
   5380 {
   5381    GET_CURRENT_CONTEXT(ctx);
   5382    size_t cmd_size = sizeof(struct marshal_cmd_TexStorageMem1DEXT);
   5383    struct marshal_cmd_TexStorageMem1DEXT *cmd;
   5384    debug_print_marshal("TexStorageMem1DEXT");
   5385    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5386       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorageMem1DEXT, cmd_size);
   5387       cmd->target = target;
   5388       cmd->levels = levels;
   5389       cmd->internalFormat = internalFormat;
   5390       cmd->width = width;
   5391       cmd->memory = memory;
   5392       cmd->offset = offset;
   5393       _mesa_post_marshal_hook(ctx);
   5394       return;
   5395    }
   5396 
   5397    _mesa_glthread_finish(ctx);
   5398    debug_print_sync_fallback("TexStorageMem1DEXT");
   5399    CALL_TexStorageMem1DEXT(ctx->CurrentServerDispatch, (target, levels, internalFormat, width, memory, offset));
   5400 }
   5401 
   5402 
   5403 /* BlendBarrier: marshalled asynchronously */
   5404 struct marshal_cmd_BlendBarrier
   5405 {
   5406    struct marshal_cmd_base cmd_base;
   5407 };
   5408 static inline void
   5409 _mesa_unmarshal_BlendBarrier(struct gl_context *ctx, const struct marshal_cmd_BlendBarrier *cmd)
   5410 {
   5411    CALL_BlendBarrier(ctx->CurrentServerDispatch, ());
   5412 }
   5413 static void GLAPIENTRY
   5414 _mesa_marshal_BlendBarrier(void)
   5415 {
   5416    GET_CURRENT_CONTEXT(ctx);
   5417    size_t cmd_size = sizeof(struct marshal_cmd_BlendBarrier);
   5418    struct marshal_cmd_BlendBarrier *cmd;
   5419    debug_print_marshal("BlendBarrier");
   5420    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5421       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendBarrier, cmd_size);
   5422       (void) cmd;
   5423 
   5424       _mesa_post_marshal_hook(ctx);
   5425       return;
   5426    }
   5427 
   5428    _mesa_glthread_finish(ctx);
   5429    debug_print_sync_fallback("BlendBarrier");
   5430    CALL_BlendBarrier(ctx->CurrentServerDispatch, ());
   5431 }
   5432 
   5433 
   5434 /* VertexAttrib2svNV: marshalled asynchronously */
   5435 struct marshal_cmd_VertexAttrib2svNV
   5436 {
   5437    struct marshal_cmd_base cmd_base;
   5438    GLuint index;
   5439    GLshort v[2];
   5440 };
   5441 static inline void
   5442 _mesa_unmarshal_VertexAttrib2svNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2svNV *cmd)
   5443 {
   5444    const GLuint index = cmd->index;
   5445    const GLshort * v = cmd->v;
   5446    CALL_VertexAttrib2svNV(ctx->CurrentServerDispatch, (index, v));
   5447 }
   5448 static void GLAPIENTRY
   5449 _mesa_marshal_VertexAttrib2svNV(GLuint index, const GLshort * v)
   5450 {
   5451    GET_CURRENT_CONTEXT(ctx);
   5452    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib2svNV);
   5453    struct marshal_cmd_VertexAttrib2svNV *cmd;
   5454    debug_print_marshal("VertexAttrib2svNV");
   5455    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5456       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2svNV, cmd_size);
   5457       cmd->index = index;
   5458       memcpy(cmd->v, v, 4);
   5459       _mesa_post_marshal_hook(ctx);
   5460       return;
   5461    }
   5462 
   5463    _mesa_glthread_finish(ctx);
   5464    debug_print_sync_fallback("VertexAttrib2svNV");
   5465    CALL_VertexAttrib2svNV(ctx->CurrentServerDispatch, (index, v));
   5466 }
   5467 
   5468 
   5469 /* SecondaryColorP3uiv: marshalled synchronously */
   5470 static void GLAPIENTRY
   5471 _mesa_marshal_SecondaryColorP3uiv(GLenum type, const GLuint * color)
   5472 {
   5473    GET_CURRENT_CONTEXT(ctx);
   5474    _mesa_glthread_finish(ctx);
   5475    debug_print_sync("SecondaryColorP3uiv");
   5476    CALL_SecondaryColorP3uiv(ctx->CurrentServerDispatch, (type, color));
   5477 }
   5478 
   5479 
   5480 /* GetnPixelMapuivARB: marshalled synchronously */
   5481 static void GLAPIENTRY
   5482 _mesa_marshal_GetnPixelMapuivARB(GLenum map, GLsizei bufSize, GLuint * values)
   5483 {
   5484    GET_CURRENT_CONTEXT(ctx);
   5485    _mesa_glthread_finish(ctx);
   5486    debug_print_sync("GetnPixelMapuivARB");
   5487    CALL_GetnPixelMapuivARB(ctx->CurrentServerDispatch, (map, bufSize, values));
   5488 }
   5489 
   5490 
   5491 /* GetSamplerParameterIuiv: marshalled synchronously */
   5492 static void GLAPIENTRY
   5493 _mesa_marshal_GetSamplerParameterIuiv(GLuint sampler, GLenum pname, GLuint * params)
   5494 {
   5495    GET_CURRENT_CONTEXT(ctx);
   5496    _mesa_glthread_finish(ctx);
   5497    debug_print_sync("GetSamplerParameterIuiv");
   5498    CALL_GetSamplerParameterIuiv(ctx->CurrentServerDispatch, (sampler, pname, params));
   5499 }
   5500 
   5501 
   5502 /* Disablei: marshalled asynchronously */
   5503 struct marshal_cmd_Disablei
   5504 {
   5505    struct marshal_cmd_base cmd_base;
   5506    GLenum target;
   5507    GLuint index;
   5508 };
   5509 static inline void
   5510 _mesa_unmarshal_Disablei(struct gl_context *ctx, const struct marshal_cmd_Disablei *cmd)
   5511 {
   5512    const GLenum target = cmd->target;
   5513    const GLuint index = cmd->index;
   5514    CALL_Disablei(ctx->CurrentServerDispatch, (target, index));
   5515 }
   5516 static void GLAPIENTRY
   5517 _mesa_marshal_Disablei(GLenum target, GLuint index)
   5518 {
   5519    GET_CURRENT_CONTEXT(ctx);
   5520    size_t cmd_size = sizeof(struct marshal_cmd_Disablei);
   5521    struct marshal_cmd_Disablei *cmd;
   5522    debug_print_marshal("Disablei");
   5523    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5524       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Disablei, cmd_size);
   5525       cmd->target = target;
   5526       cmd->index = index;
   5527       _mesa_post_marshal_hook(ctx);
   5528       return;
   5529    }
   5530 
   5531    _mesa_glthread_finish(ctx);
   5532    debug_print_sync_fallback("Disablei");
   5533    CALL_Disablei(ctx->CurrentServerDispatch, (target, index));
   5534 }
   5535 
   5536 
   5537 /* CompressedTexSubImage3D: marshalled synchronously */
   5538 static void GLAPIENTRY
   5539 _mesa_marshal_CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid * data)
   5540 {
   5541    GET_CURRENT_CONTEXT(ctx);
   5542    _mesa_glthread_finish(ctx);
   5543    debug_print_sync("CompressedTexSubImage3D");
   5544    CALL_CompressedTexSubImage3D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data));
   5545 }
   5546 
   5547 
   5548 /* WindowPos4svMESA: marshalled synchronously */
   5549 static void GLAPIENTRY
   5550 _mesa_marshal_WindowPos4svMESA(const GLshort * v)
   5551 {
   5552    GET_CURRENT_CONTEXT(ctx);
   5553    _mesa_glthread_finish(ctx);
   5554    debug_print_sync("WindowPos4svMESA");
   5555    CALL_WindowPos4svMESA(ctx->CurrentServerDispatch, (v));
   5556 }
   5557 
   5558 
   5559 /* ObjectLabel: marshalled synchronously */
   5560 static void GLAPIENTRY
   5561 _mesa_marshal_ObjectLabel(GLenum identifier, GLuint name, GLsizei length, const GLchar * label)
   5562 {
   5563    GET_CURRENT_CONTEXT(ctx);
   5564    _mesa_glthread_finish(ctx);
   5565    debug_print_sync("ObjectLabel");
   5566    CALL_ObjectLabel(ctx->CurrentServerDispatch, (identifier, name, length, label));
   5567 }
   5568 
   5569 
   5570 /* Color3dv: marshalled asynchronously */
   5571 struct marshal_cmd_Color3dv
   5572 {
   5573    struct marshal_cmd_base cmd_base;
   5574    GLdouble v[3];
   5575 };
   5576 static inline void
   5577 _mesa_unmarshal_Color3dv(struct gl_context *ctx, const struct marshal_cmd_Color3dv *cmd)
   5578 {
   5579    const GLdouble * v = cmd->v;
   5580    CALL_Color3dv(ctx->CurrentServerDispatch, (v));
   5581 }
   5582 static void GLAPIENTRY
   5583 _mesa_marshal_Color3dv(const GLdouble * v)
   5584 {
   5585    GET_CURRENT_CONTEXT(ctx);
   5586    size_t cmd_size = sizeof(struct marshal_cmd_Color3dv);
   5587    struct marshal_cmd_Color3dv *cmd;
   5588    debug_print_marshal("Color3dv");
   5589    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5590       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3dv, cmd_size);
   5591       memcpy(cmd->v, v, 24);
   5592       _mesa_post_marshal_hook(ctx);
   5593       return;
   5594    }
   5595 
   5596    _mesa_glthread_finish(ctx);
   5597    debug_print_sync_fallback("Color3dv");
   5598    CALL_Color3dv(ctx->CurrentServerDispatch, (v));
   5599 }
   5600 
   5601 
   5602 /* ProgramUniform1ui64ARB: marshalled asynchronously */
   5603 struct marshal_cmd_ProgramUniform1ui64ARB
   5604 {
   5605    struct marshal_cmd_base cmd_base;
   5606    GLuint program;
   5607    GLint location;
   5608    GLuint64 x;
   5609 };
   5610 static inline void
   5611 _mesa_unmarshal_ProgramUniform1ui64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1ui64ARB *cmd)
   5612 {
   5613    const GLuint program = cmd->program;
   5614    const GLint location = cmd->location;
   5615    const GLuint64 x = cmd->x;
   5616    CALL_ProgramUniform1ui64ARB(ctx->CurrentServerDispatch, (program, location, x));
   5617 }
   5618 static void GLAPIENTRY
   5619 _mesa_marshal_ProgramUniform1ui64ARB(GLuint program, GLint location, GLuint64 x)
   5620 {
   5621    GET_CURRENT_CONTEXT(ctx);
   5622    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform1ui64ARB);
   5623    struct marshal_cmd_ProgramUniform1ui64ARB *cmd;
   5624    debug_print_marshal("ProgramUniform1ui64ARB");
   5625    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5626       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1ui64ARB, cmd_size);
   5627       cmd->program = program;
   5628       cmd->location = location;
   5629       cmd->x = x;
   5630       _mesa_post_marshal_hook(ctx);
   5631       return;
   5632    }
   5633 
   5634    _mesa_glthread_finish(ctx);
   5635    debug_print_sync_fallback("ProgramUniform1ui64ARB");
   5636    CALL_ProgramUniform1ui64ARB(ctx->CurrentServerDispatch, (program, location, x));
   5637 }
   5638 
   5639 
   5640 /* BeginQuery: marshalled asynchronously */
   5641 struct marshal_cmd_BeginQuery
   5642 {
   5643    struct marshal_cmd_base cmd_base;
   5644    GLenum target;
   5645    GLuint id;
   5646 };
   5647 static inline void
   5648 _mesa_unmarshal_BeginQuery(struct gl_context *ctx, const struct marshal_cmd_BeginQuery *cmd)
   5649 {
   5650    const GLenum target = cmd->target;
   5651    const GLuint id = cmd->id;
   5652    CALL_BeginQuery(ctx->CurrentServerDispatch, (target, id));
   5653 }
   5654 static void GLAPIENTRY
   5655 _mesa_marshal_BeginQuery(GLenum target, GLuint id)
   5656 {
   5657    GET_CURRENT_CONTEXT(ctx);
   5658    size_t cmd_size = sizeof(struct marshal_cmd_BeginQuery);
   5659    struct marshal_cmd_BeginQuery *cmd;
   5660    debug_print_marshal("BeginQuery");
   5661    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5662       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BeginQuery, cmd_size);
   5663       cmd->target = target;
   5664       cmd->id = id;
   5665       _mesa_post_marshal_hook(ctx);
   5666       return;
   5667    }
   5668 
   5669    _mesa_glthread_finish(ctx);
   5670    debug_print_sync_fallback("BeginQuery");
   5671    CALL_BeginQuery(ctx->CurrentServerDispatch, (target, id));
   5672 }
   5673 
   5674 
   5675 /* VertexP3uiv: marshalled synchronously */
   5676 static void GLAPIENTRY
   5677 _mesa_marshal_VertexP3uiv(GLenum type, const GLuint * value)
   5678 {
   5679    GET_CURRENT_CONTEXT(ctx);
   5680    _mesa_glthread_finish(ctx);
   5681    debug_print_sync("VertexP3uiv");
   5682    CALL_VertexP3uiv(ctx->CurrentServerDispatch, (type, value));
   5683 }
   5684 
   5685 
   5686 /* GetUniformLocation: marshalled synchronously */
   5687 static GLint GLAPIENTRY
   5688 _mesa_marshal_GetUniformLocation(GLuint program, const GLchar * name)
   5689 {
   5690    GET_CURRENT_CONTEXT(ctx);
   5691    _mesa_glthread_finish(ctx);
   5692    debug_print_sync("GetUniformLocation");
   5693    return CALL_GetUniformLocation(ctx->CurrentServerDispatch, (program, name));
   5694 }
   5695 
   5696 
   5697 /* PixelStoref: marshalled asynchronously */
   5698 struct marshal_cmd_PixelStoref
   5699 {
   5700    struct marshal_cmd_base cmd_base;
   5701    GLenum pname;
   5702    GLfloat param;
   5703 };
   5704 static inline void
   5705 _mesa_unmarshal_PixelStoref(struct gl_context *ctx, const struct marshal_cmd_PixelStoref *cmd)
   5706 {
   5707    const GLenum pname = cmd->pname;
   5708    const GLfloat param = cmd->param;
   5709    CALL_PixelStoref(ctx->CurrentServerDispatch, (pname, param));
   5710 }
   5711 static void GLAPIENTRY
   5712 _mesa_marshal_PixelStoref(GLenum pname, GLfloat param)
   5713 {
   5714    GET_CURRENT_CONTEXT(ctx);
   5715    size_t cmd_size = sizeof(struct marshal_cmd_PixelStoref);
   5716    struct marshal_cmd_PixelStoref *cmd;
   5717    debug_print_marshal("PixelStoref");
   5718    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5719       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PixelStoref, cmd_size);
   5720       cmd->pname = pname;
   5721       cmd->param = param;
   5722       _mesa_post_marshal_hook(ctx);
   5723       return;
   5724    }
   5725 
   5726    _mesa_glthread_finish(ctx);
   5727    debug_print_sync_fallback("PixelStoref");
   5728    CALL_PixelStoref(ctx->CurrentServerDispatch, (pname, param));
   5729 }
   5730 
   5731 
   5732 /* WindowPos2iv: marshalled synchronously */
   5733 static void GLAPIENTRY
   5734 _mesa_marshal_WindowPos2iv(const GLint * v)
   5735 {
   5736    GET_CURRENT_CONTEXT(ctx);
   5737    _mesa_glthread_finish(ctx);
   5738    debug_print_sync("WindowPos2iv");
   5739    CALL_WindowPos2iv(ctx->CurrentServerDispatch, (v));
   5740 }
   5741 
   5742 
   5743 /* PixelStorei: marshalled asynchronously */
   5744 struct marshal_cmd_PixelStorei
   5745 {
   5746    struct marshal_cmd_base cmd_base;
   5747    GLenum pname;
   5748    GLint param;
   5749 };
   5750 static inline void
   5751 _mesa_unmarshal_PixelStorei(struct gl_context *ctx, const struct marshal_cmd_PixelStorei *cmd)
   5752 {
   5753    const GLenum pname = cmd->pname;
   5754    const GLint param = cmd->param;
   5755    CALL_PixelStorei(ctx->CurrentServerDispatch, (pname, param));
   5756 }
   5757 static void GLAPIENTRY
   5758 _mesa_marshal_PixelStorei(GLenum pname, GLint param)
   5759 {
   5760    GET_CURRENT_CONTEXT(ctx);
   5761    size_t cmd_size = sizeof(struct marshal_cmd_PixelStorei);
   5762    struct marshal_cmd_PixelStorei *cmd;
   5763    debug_print_marshal("PixelStorei");
   5764    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5765       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PixelStorei, cmd_size);
   5766       cmd->pname = pname;
   5767       cmd->param = param;
   5768       _mesa_post_marshal_hook(ctx);
   5769       return;
   5770    }
   5771 
   5772    _mesa_glthread_finish(ctx);
   5773    debug_print_sync_fallback("PixelStorei");
   5774    CALL_PixelStorei(ctx->CurrentServerDispatch, (pname, param));
   5775 }
   5776 
   5777 
   5778 /* VertexAttribs1svNV: marshalled asynchronously */
   5779 struct marshal_cmd_VertexAttribs1svNV
   5780 {
   5781    struct marshal_cmd_base cmd_base;
   5782    GLuint index;
   5783    GLsizei n;
   5784    /* Next safe_mul(n, 2) bytes are GLshort v[n] */
   5785 };
   5786 static inline void
   5787 _mesa_unmarshal_VertexAttribs1svNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs1svNV *cmd)
   5788 {
   5789    const GLuint index = cmd->index;
   5790    const GLsizei n = cmd->n;
   5791    const GLshort * v;
   5792    const char *variable_data = (const char *) (cmd + 1);
   5793    v = (const GLshort *) variable_data;
   5794    variable_data += n * 2;
   5795    CALL_VertexAttribs1svNV(ctx->CurrentServerDispatch, (index, n, v));
   5796 }
   5797 static void GLAPIENTRY
   5798 _mesa_marshal_VertexAttribs1svNV(GLuint index, GLsizei n, const GLshort * v)
   5799 {
   5800    GET_CURRENT_CONTEXT(ctx);
   5801    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribs1svNV) + safe_mul(n, 2);
   5802    struct marshal_cmd_VertexAttribs1svNV *cmd;
   5803    debug_print_marshal("VertexAttribs1svNV");
   5804    if (unlikely(safe_mul(n, 2) < 0)) {
   5805       goto fallback_to_sync;
   5806    }
   5807    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5808       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs1svNV, cmd_size);
   5809       cmd->index = index;
   5810       cmd->n = n;
   5811       char *variable_data = (char *) (cmd + 1);
   5812       memcpy(variable_data, v, n * 2);
   5813       variable_data += n * 2;
   5814       _mesa_post_marshal_hook(ctx);
   5815       return;
   5816    }
   5817 
   5818 fallback_to_sync:
   5819    _mesa_glthread_finish(ctx);
   5820    debug_print_sync_fallback("VertexAttribs1svNV");
   5821    CALL_VertexAttribs1svNV(ctx->CurrentServerDispatch, (index, n, v));
   5822 }
   5823 
   5824 
   5825 /* CheckNamedFramebufferStatus: marshalled synchronously */
   5826 static GLenum GLAPIENTRY
   5827 _mesa_marshal_CheckNamedFramebufferStatus(GLuint framebuffer, GLenum target)
   5828 {
   5829    GET_CURRENT_CONTEXT(ctx);
   5830    _mesa_glthread_finish(ctx);
   5831    debug_print_sync("CheckNamedFramebufferStatus");
   5832    return CALL_CheckNamedFramebufferStatus(ctx->CurrentServerDispatch, (framebuffer, target));
   5833 }
   5834 
   5835 
   5836 /* UniformSubroutinesuiv: marshalled synchronously */
   5837 static void GLAPIENTRY
   5838 _mesa_marshal_UniformSubroutinesuiv(GLenum shadertype, GLsizei count, const GLuint * indices)
   5839 {
   5840    GET_CURRENT_CONTEXT(ctx);
   5841    _mesa_glthread_finish(ctx);
   5842    debug_print_sync("UniformSubroutinesuiv");
   5843    CALL_UniformSubroutinesuiv(ctx->CurrentServerDispatch, (shadertype, count, indices));
   5844 }
   5845 
   5846 
   5847 /* CheckFramebufferStatus: marshalled synchronously */
   5848 static GLenum GLAPIENTRY
   5849 _mesa_marshal_CheckFramebufferStatus(GLenum target)
   5850 {
   5851    GET_CURRENT_CONTEXT(ctx);
   5852    _mesa_glthread_finish(ctx);
   5853    debug_print_sync("CheckFramebufferStatus");
   5854    return CALL_CheckFramebufferStatus(ctx->CurrentServerDispatch, (target));
   5855 }
   5856 
   5857 
   5858 /* DispatchComputeIndirect: marshalled asynchronously */
   5859 struct marshal_cmd_DispatchComputeIndirect
   5860 {
   5861    struct marshal_cmd_base cmd_base;
   5862    GLintptr indirect;
   5863 };
   5864 static inline void
   5865 _mesa_unmarshal_DispatchComputeIndirect(struct gl_context *ctx, const struct marshal_cmd_DispatchComputeIndirect *cmd)
   5866 {
   5867    const GLintptr indirect = cmd->indirect;
   5868    CALL_DispatchComputeIndirect(ctx->CurrentServerDispatch, (indirect));
   5869 }
   5870 static void GLAPIENTRY
   5871 _mesa_marshal_DispatchComputeIndirect(GLintptr indirect)
   5872 {
   5873    GET_CURRENT_CONTEXT(ctx);
   5874    size_t cmd_size = sizeof(struct marshal_cmd_DispatchComputeIndirect);
   5875    struct marshal_cmd_DispatchComputeIndirect *cmd;
   5876    debug_print_marshal("DispatchComputeIndirect");
   5877    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5878       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DispatchComputeIndirect, cmd_size);
   5879       cmd->indirect = indirect;
   5880       _mesa_post_marshal_hook(ctx);
   5881       return;
   5882    }
   5883 
   5884    _mesa_glthread_finish(ctx);
   5885    debug_print_sync_fallback("DispatchComputeIndirect");
   5886    CALL_DispatchComputeIndirect(ctx->CurrentServerDispatch, (indirect));
   5887 }
   5888 
   5889 
   5890 /* InvalidateBufferData: marshalled asynchronously */
   5891 struct marshal_cmd_InvalidateBufferData
   5892 {
   5893    struct marshal_cmd_base cmd_base;
   5894    GLuint buffer;
   5895 };
   5896 static inline void
   5897 _mesa_unmarshal_InvalidateBufferData(struct gl_context *ctx, const struct marshal_cmd_InvalidateBufferData *cmd)
   5898 {
   5899    const GLuint buffer = cmd->buffer;
   5900    CALL_InvalidateBufferData(ctx->CurrentServerDispatch, (buffer));
   5901 }
   5902 static void GLAPIENTRY
   5903 _mesa_marshal_InvalidateBufferData(GLuint buffer)
   5904 {
   5905    GET_CURRENT_CONTEXT(ctx);
   5906    size_t cmd_size = sizeof(struct marshal_cmd_InvalidateBufferData);
   5907    struct marshal_cmd_InvalidateBufferData *cmd;
   5908    debug_print_marshal("InvalidateBufferData");
   5909    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5910       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InvalidateBufferData, cmd_size);
   5911       cmd->buffer = buffer;
   5912       _mesa_post_marshal_hook(ctx);
   5913       return;
   5914    }
   5915 
   5916    _mesa_glthread_finish(ctx);
   5917    debug_print_sync_fallback("InvalidateBufferData");
   5918    CALL_InvalidateBufferData(ctx->CurrentServerDispatch, (buffer));
   5919 }
   5920 
   5921 
   5922 /* GetUniformdv: marshalled synchronously */
   5923 static void GLAPIENTRY
   5924 _mesa_marshal_GetUniformdv(GLuint program, GLint location, GLdouble * params)
   5925 {
   5926    GET_CURRENT_CONTEXT(ctx);
   5927    _mesa_glthread_finish(ctx);
   5928    debug_print_sync("GetUniformdv");
   5929    CALL_GetUniformdv(ctx->CurrentServerDispatch, (program, location, params));
   5930 }
   5931 
   5932 
   5933 /* ProgramLocalParameters4fvEXT: marshalled synchronously */
   5934 static void GLAPIENTRY
   5935 _mesa_marshal_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat * params)
   5936 {
   5937    GET_CURRENT_CONTEXT(ctx);
   5938    _mesa_glthread_finish(ctx);
   5939    debug_print_sync("ProgramLocalParameters4fvEXT");
   5940    CALL_ProgramLocalParameters4fvEXT(ctx->CurrentServerDispatch, (target, index, count, params));
   5941 }
   5942 
   5943 
   5944 /* VertexAttribL1dv: marshalled synchronously */
   5945 static void GLAPIENTRY
   5946 _mesa_marshal_VertexAttribL1dv(GLuint index, const GLdouble * v)
   5947 {
   5948    GET_CURRENT_CONTEXT(ctx);
   5949    _mesa_glthread_finish(ctx);
   5950    debug_print_sync("VertexAttribL1dv");
   5951    CALL_VertexAttribL1dv(ctx->CurrentServerDispatch, (index, v));
   5952 }
   5953 
   5954 
   5955 /* Uniform1ui64vARB: marshalled asynchronously */
   5956 struct marshal_cmd_Uniform1ui64vARB
   5957 {
   5958    struct marshal_cmd_base cmd_base;
   5959    GLint location;
   5960    GLsizei count;
   5961    /* Next safe_mul(count, 8) bytes are GLuint64 value[count] */
   5962 };
   5963 static inline void
   5964 _mesa_unmarshal_Uniform1ui64vARB(struct gl_context *ctx, const struct marshal_cmd_Uniform1ui64vARB *cmd)
   5965 {
   5966    const GLint location = cmd->location;
   5967    const GLsizei count = cmd->count;
   5968    const GLuint64 * value;
   5969    const char *variable_data = (const char *) (cmd + 1);
   5970    value = (const GLuint64 *) variable_data;
   5971    variable_data += count * 8;
   5972    CALL_Uniform1ui64vARB(ctx->CurrentServerDispatch, (location, count, value));
   5973 }
   5974 static void GLAPIENTRY
   5975 _mesa_marshal_Uniform1ui64vARB(GLint location, GLsizei count, const GLuint64 * value)
   5976 {
   5977    GET_CURRENT_CONTEXT(ctx);
   5978    size_t cmd_size = sizeof(struct marshal_cmd_Uniform1ui64vARB) + safe_mul(count, 8);
   5979    struct marshal_cmd_Uniform1ui64vARB *cmd;
   5980    debug_print_marshal("Uniform1ui64vARB");
   5981    if (unlikely(safe_mul(count, 8) < 0)) {
   5982       goto fallback_to_sync;
   5983    }
   5984    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   5985       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1ui64vARB, cmd_size);
   5986       cmd->location = location;
   5987       cmd->count = count;
   5988       char *variable_data = (char *) (cmd + 1);
   5989       memcpy(variable_data, value, count * 8);
   5990       variable_data += count * 8;
   5991       _mesa_post_marshal_hook(ctx);
   5992       return;
   5993    }
   5994 
   5995 fallback_to_sync:
   5996    _mesa_glthread_finish(ctx);
   5997    debug_print_sync_fallback("Uniform1ui64vARB");
   5998    CALL_Uniform1ui64vARB(ctx->CurrentServerDispatch, (location, count, value));
   5999 }
   6000 
   6001 
   6002 /* IsFramebuffer: marshalled synchronously */
   6003 static GLboolean GLAPIENTRY
   6004 _mesa_marshal_IsFramebuffer(GLuint framebuffer)
   6005 {
   6006    GET_CURRENT_CONTEXT(ctx);
   6007    _mesa_glthread_finish(ctx);
   6008    debug_print_sync("IsFramebuffer");
   6009    return CALL_IsFramebuffer(ctx->CurrentServerDispatch, (framebuffer));
   6010 }
   6011 
   6012 
   6013 /* GetDoublev: marshalled synchronously */
   6014 static void GLAPIENTRY
   6015 _mesa_marshal_GetDoublev(GLenum pname, GLdouble * params)
   6016 {
   6017    GET_CURRENT_CONTEXT(ctx);
   6018    _mesa_glthread_finish(ctx);
   6019    debug_print_sync("GetDoublev");
   6020    CALL_GetDoublev(ctx->CurrentServerDispatch, (pname, params));
   6021 }
   6022 
   6023 
   6024 /* GetObjectLabel: marshalled synchronously */
   6025 static void GLAPIENTRY
   6026 _mesa_marshal_GetObjectLabel(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei * length, GLchar * label)
   6027 {
   6028    GET_CURRENT_CONTEXT(ctx);
   6029    _mesa_glthread_finish(ctx);
   6030    debug_print_sync("GetObjectLabel");
   6031    CALL_GetObjectLabel(ctx->CurrentServerDispatch, (identifier, name, bufSize, length, label));
   6032 }
   6033 
   6034 
   6035 /* ColorP3uiv: marshalled synchronously */
   6036 static void GLAPIENTRY
   6037 _mesa_marshal_ColorP3uiv(GLenum type, const GLuint * color)
   6038 {
   6039    GET_CURRENT_CONTEXT(ctx);
   6040    _mesa_glthread_finish(ctx);
   6041    debug_print_sync("ColorP3uiv");
   6042    CALL_ColorP3uiv(ctx->CurrentServerDispatch, (type, color));
   6043 }
   6044 
   6045 
   6046 /* GetTextureSubImage: marshalled synchronously */
   6047 static void GLAPIENTRY
   6048 _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)
   6049 {
   6050    GET_CURRENT_CONTEXT(ctx);
   6051    _mesa_glthread_finish(ctx);
   6052    debug_print_sync("GetTextureSubImage");
   6053    CALL_GetTextureSubImage(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, pixels));
   6054 }
   6055 
   6056 
   6057 /* VertexAttribI4ivEXT: marshalled synchronously */
   6058 static void GLAPIENTRY
   6059 _mesa_marshal_VertexAttribI4ivEXT(GLuint index, const GLint * v)
   6060 {
   6061    GET_CURRENT_CONTEXT(ctx);
   6062    _mesa_glthread_finish(ctx);
   6063    debug_print_sync("VertexAttribI4ivEXT");
   6064    CALL_VertexAttribI4ivEXT(ctx->CurrentServerDispatch, (index, v));
   6065 }
   6066 
   6067 
   6068 /* VertexAttrib1svNV: marshalled asynchronously */
   6069 struct marshal_cmd_VertexAttrib1svNV
   6070 {
   6071    struct marshal_cmd_base cmd_base;
   6072    GLuint index;
   6073    GLshort v[1];
   6074 };
   6075 static inline void
   6076 _mesa_unmarshal_VertexAttrib1svNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1svNV *cmd)
   6077 {
   6078    const GLuint index = cmd->index;
   6079    const GLshort * v = cmd->v;
   6080    CALL_VertexAttrib1svNV(ctx->CurrentServerDispatch, (index, v));
   6081 }
   6082 static void GLAPIENTRY
   6083 _mesa_marshal_VertexAttrib1svNV(GLuint index, const GLshort * v)
   6084 {
   6085    GET_CURRENT_CONTEXT(ctx);
   6086    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib1svNV);
   6087    struct marshal_cmd_VertexAttrib1svNV *cmd;
   6088    debug_print_marshal("VertexAttrib1svNV");
   6089    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6090       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1svNV, cmd_size);
   6091       cmd->index = index;
   6092       memcpy(cmd->v, v, 2);
   6093       _mesa_post_marshal_hook(ctx);
   6094       return;
   6095    }
   6096 
   6097    _mesa_glthread_finish(ctx);
   6098    debug_print_sync_fallback("VertexAttrib1svNV");
   6099    CALL_VertexAttrib1svNV(ctx->CurrentServerDispatch, (index, v));
   6100 }
   6101 
   6102 
   6103 /* SecondaryColor3ubv: marshalled asynchronously */
   6104 struct marshal_cmd_SecondaryColor3ubv
   6105 {
   6106    struct marshal_cmd_base cmd_base;
   6107    GLubyte v[3];
   6108 };
   6109 static inline void
   6110 _mesa_unmarshal_SecondaryColor3ubv(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3ubv *cmd)
   6111 {
   6112    const GLubyte * v = cmd->v;
   6113    CALL_SecondaryColor3ubv(ctx->CurrentServerDispatch, (v));
   6114 }
   6115 static void GLAPIENTRY
   6116 _mesa_marshal_SecondaryColor3ubv(const GLubyte * v)
   6117 {
   6118    GET_CURRENT_CONTEXT(ctx);
   6119    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColor3ubv);
   6120    struct marshal_cmd_SecondaryColor3ubv *cmd;
   6121    debug_print_marshal("SecondaryColor3ubv");
   6122    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6123       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3ubv, cmd_size);
   6124       memcpy(cmd->v, v, 3);
   6125       _mesa_post_marshal_hook(ctx);
   6126       return;
   6127    }
   6128 
   6129    _mesa_glthread_finish(ctx);
   6130    debug_print_sync_fallback("SecondaryColor3ubv");
   6131    CALL_SecondaryColor3ubv(ctx->CurrentServerDispatch, (v));
   6132 }
   6133 
   6134 
   6135 /* GetDebugMessageLog: marshalled synchronously */
   6136 static GLuint GLAPIENTRY
   6137 _mesa_marshal_GetDebugMessageLog(GLuint count, GLsizei bufsize, GLenum * sources, GLenum * types, GLuint * ids, GLenum * severities, GLsizei * lengths, GLchar * messageLog)
   6138 {
   6139    GET_CURRENT_CONTEXT(ctx);
   6140    _mesa_glthread_finish(ctx);
   6141    debug_print_sync("GetDebugMessageLog");
   6142    return CALL_GetDebugMessageLog(ctx->CurrentServerDispatch, (count, bufsize, sources, types, ids, severities, lengths, messageLog));
   6143 }
   6144 
   6145 
   6146 /* Uniform4ui64ARB: marshalled asynchronously */
   6147 struct marshal_cmd_Uniform4ui64ARB
   6148 {
   6149    struct marshal_cmd_base cmd_base;
   6150    GLint location;
   6151    GLuint64 x;
   6152    GLuint64 y;
   6153    GLuint64 z;
   6154    GLuint64 w;
   6155 };
   6156 static inline void
   6157 _mesa_unmarshal_Uniform4ui64ARB(struct gl_context *ctx, const struct marshal_cmd_Uniform4ui64ARB *cmd)
   6158 {
   6159    const GLint location = cmd->location;
   6160    const GLuint64 x = cmd->x;
   6161    const GLuint64 y = cmd->y;
   6162    const GLuint64 z = cmd->z;
   6163    const GLuint64 w = cmd->w;
   6164    CALL_Uniform4ui64ARB(ctx->CurrentServerDispatch, (location, x, y, z, w));
   6165 }
   6166 static void GLAPIENTRY
   6167 _mesa_marshal_Uniform4ui64ARB(GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w)
   6168 {
   6169    GET_CURRENT_CONTEXT(ctx);
   6170    size_t cmd_size = sizeof(struct marshal_cmd_Uniform4ui64ARB);
   6171    struct marshal_cmd_Uniform4ui64ARB *cmd;
   6172    debug_print_marshal("Uniform4ui64ARB");
   6173    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6174       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4ui64ARB, cmd_size);
   6175       cmd->location = location;
   6176       cmd->x = x;
   6177       cmd->y = y;
   6178       cmd->z = z;
   6179       cmd->w = w;
   6180       _mesa_post_marshal_hook(ctx);
   6181       return;
   6182    }
   6183 
   6184    _mesa_glthread_finish(ctx);
   6185    debug_print_sync_fallback("Uniform4ui64ARB");
   6186    CALL_Uniform4ui64ARB(ctx->CurrentServerDispatch, (location, x, y, z, w));
   6187 }
   6188 
   6189 
   6190 /* RasterPos3fv: marshalled asynchronously */
   6191 struct marshal_cmd_RasterPos3fv
   6192 {
   6193    struct marshal_cmd_base cmd_base;
   6194    GLfloat v[3];
   6195 };
   6196 static inline void
   6197 _mesa_unmarshal_RasterPos3fv(struct gl_context *ctx, const struct marshal_cmd_RasterPos3fv *cmd)
   6198 {
   6199    const GLfloat * v = cmd->v;
   6200    CALL_RasterPos3fv(ctx->CurrentServerDispatch, (v));
   6201 }
   6202 static void GLAPIENTRY
   6203 _mesa_marshal_RasterPos3fv(const GLfloat * v)
   6204 {
   6205    GET_CURRENT_CONTEXT(ctx);
   6206    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos3fv);
   6207    struct marshal_cmd_RasterPos3fv *cmd;
   6208    debug_print_marshal("RasterPos3fv");
   6209    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6210       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos3fv, cmd_size);
   6211       memcpy(cmd->v, v, 12);
   6212       _mesa_post_marshal_hook(ctx);
   6213       return;
   6214    }
   6215 
   6216    _mesa_glthread_finish(ctx);
   6217    debug_print_sync_fallback("RasterPos3fv");
   6218    CALL_RasterPos3fv(ctx->CurrentServerDispatch, (v));
   6219 }
   6220 
   6221 
   6222 /* GetShaderSource: marshalled synchronously */
   6223 static void GLAPIENTRY
   6224 _mesa_marshal_GetShaderSource(GLuint shader, GLsizei bufSize, GLsizei * length, GLchar * source)
   6225 {
   6226    GET_CURRENT_CONTEXT(ctx);
   6227    _mesa_glthread_finish(ctx);
   6228    debug_print_sync("GetShaderSource");
   6229    CALL_GetShaderSource(ctx->CurrentServerDispatch, (shader, bufSize, length, source));
   6230 }
   6231 
   6232 
   6233 /* BindProgramARB: marshalled asynchronously */
   6234 struct marshal_cmd_BindProgramARB
   6235 {
   6236    struct marshal_cmd_base cmd_base;
   6237    GLenum target;
   6238    GLuint program;
   6239 };
   6240 static inline void
   6241 _mesa_unmarshal_BindProgramARB(struct gl_context *ctx, const struct marshal_cmd_BindProgramARB *cmd)
   6242 {
   6243    const GLenum target = cmd->target;
   6244    const GLuint program = cmd->program;
   6245    CALL_BindProgramARB(ctx->CurrentServerDispatch, (target, program));
   6246 }
   6247 static void GLAPIENTRY
   6248 _mesa_marshal_BindProgramARB(GLenum target, GLuint program)
   6249 {
   6250    GET_CURRENT_CONTEXT(ctx);
   6251    size_t cmd_size = sizeof(struct marshal_cmd_BindProgramARB);
   6252    struct marshal_cmd_BindProgramARB *cmd;
   6253    debug_print_marshal("BindProgramARB");
   6254    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6255       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindProgramARB, cmd_size);
   6256       cmd->target = target;
   6257       cmd->program = program;
   6258       _mesa_post_marshal_hook(ctx);
   6259       return;
   6260    }
   6261 
   6262    _mesa_glthread_finish(ctx);
   6263    debug_print_sync_fallback("BindProgramARB");
   6264    CALL_BindProgramARB(ctx->CurrentServerDispatch, (target, program));
   6265 }
   6266 
   6267 
   6268 /* VertexAttrib3sNV: marshalled asynchronously */
   6269 struct marshal_cmd_VertexAttrib3sNV
   6270 {
   6271    struct marshal_cmd_base cmd_base;
   6272    GLuint index;
   6273    GLshort x;
   6274    GLshort y;
   6275    GLshort z;
   6276 };
   6277 static inline void
   6278 _mesa_unmarshal_VertexAttrib3sNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3sNV *cmd)
   6279 {
   6280    const GLuint index = cmd->index;
   6281    const GLshort x = cmd->x;
   6282    const GLshort y = cmd->y;
   6283    const GLshort z = cmd->z;
   6284    CALL_VertexAttrib3sNV(ctx->CurrentServerDispatch, (index, x, y, z));
   6285 }
   6286 static void GLAPIENTRY
   6287 _mesa_marshal_VertexAttrib3sNV(GLuint index, GLshort x, GLshort y, GLshort z)
   6288 {
   6289    GET_CURRENT_CONTEXT(ctx);
   6290    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib3sNV);
   6291    struct marshal_cmd_VertexAttrib3sNV *cmd;
   6292    debug_print_marshal("VertexAttrib3sNV");
   6293    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6294       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3sNV, cmd_size);
   6295       cmd->index = index;
   6296       cmd->x = x;
   6297       cmd->y = y;
   6298       cmd->z = z;
   6299       _mesa_post_marshal_hook(ctx);
   6300       return;
   6301    }
   6302 
   6303    _mesa_glthread_finish(ctx);
   6304    debug_print_sync_fallback("VertexAttrib3sNV");
   6305    CALL_VertexAttrib3sNV(ctx->CurrentServerDispatch, (index, x, y, z));
   6306 }
   6307 
   6308 
   6309 /* ColorFragmentOp1ATI: marshalled asynchronously */
   6310 struct marshal_cmd_ColorFragmentOp1ATI
   6311 {
   6312    struct marshal_cmd_base cmd_base;
   6313    GLenum op;
   6314    GLuint dst;
   6315    GLuint dstMask;
   6316    GLuint dstMod;
   6317    GLuint arg1;
   6318    GLuint arg1Rep;
   6319    GLuint arg1Mod;
   6320 };
   6321 static inline void
   6322 _mesa_unmarshal_ColorFragmentOp1ATI(struct gl_context *ctx, const struct marshal_cmd_ColorFragmentOp1ATI *cmd)
   6323 {
   6324    const GLenum op = cmd->op;
   6325    const GLuint dst = cmd->dst;
   6326    const GLuint dstMask = cmd->dstMask;
   6327    const GLuint dstMod = cmd->dstMod;
   6328    const GLuint arg1 = cmd->arg1;
   6329    const GLuint arg1Rep = cmd->arg1Rep;
   6330    const GLuint arg1Mod = cmd->arg1Mod;
   6331    CALL_ColorFragmentOp1ATI(ctx->CurrentServerDispatch, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod));
   6332 }
   6333 static void GLAPIENTRY
   6334 _mesa_marshal_ColorFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)
   6335 {
   6336    GET_CURRENT_CONTEXT(ctx);
   6337    size_t cmd_size = sizeof(struct marshal_cmd_ColorFragmentOp1ATI);
   6338    struct marshal_cmd_ColorFragmentOp1ATI *cmd;
   6339    debug_print_marshal("ColorFragmentOp1ATI");
   6340    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6341       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorFragmentOp1ATI, cmd_size);
   6342       cmd->op = op;
   6343       cmd->dst = dst;
   6344       cmd->dstMask = dstMask;
   6345       cmd->dstMod = dstMod;
   6346       cmd->arg1 = arg1;
   6347       cmd->arg1Rep = arg1Rep;
   6348       cmd->arg1Mod = arg1Mod;
   6349       _mesa_post_marshal_hook(ctx);
   6350       return;
   6351    }
   6352 
   6353    _mesa_glthread_finish(ctx);
   6354    debug_print_sync_fallback("ColorFragmentOp1ATI");
   6355    CALL_ColorFragmentOp1ATI(ctx->CurrentServerDispatch, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod));
   6356 }
   6357 
   6358 
   6359 /* ProgramUniformMatrix4x3fv: marshalled asynchronously */
   6360 struct marshal_cmd_ProgramUniformMatrix4x3fv
   6361 {
   6362    struct marshal_cmd_base cmd_base;
   6363    GLuint program;
   6364    GLint location;
   6365    GLsizei count;
   6366    GLboolean transpose;
   6367    /* Next safe_mul(count, 48) bytes are GLfloat value[count][12] */
   6368 };
   6369 static inline void
   6370 _mesa_unmarshal_ProgramUniformMatrix4x3fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix4x3fv *cmd)
   6371 {
   6372    const GLuint program = cmd->program;
   6373    const GLint location = cmd->location;
   6374    const GLsizei count = cmd->count;
   6375    const GLboolean transpose = cmd->transpose;
   6376    const GLfloat * value;
   6377    const char *variable_data = (const char *) (cmd + 1);
   6378    value = (const GLfloat *) variable_data;
   6379    variable_data += count * 48;
   6380    CALL_ProgramUniformMatrix4x3fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   6381 }
   6382 static void GLAPIENTRY
   6383 _mesa_marshal_ProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   6384 {
   6385    GET_CURRENT_CONTEXT(ctx);
   6386    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix4x3fv) + safe_mul(count, 48);
   6387    struct marshal_cmd_ProgramUniformMatrix4x3fv *cmd;
   6388    debug_print_marshal("ProgramUniformMatrix4x3fv");
   6389    if (unlikely(safe_mul(count, 48) < 0)) {
   6390       goto fallback_to_sync;
   6391    }
   6392    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6393       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix4x3fv, cmd_size);
   6394       cmd->program = program;
   6395       cmd->location = location;
   6396       cmd->count = count;
   6397       cmd->transpose = transpose;
   6398       char *variable_data = (char *) (cmd + 1);
   6399       memcpy(variable_data, value, count * 48);
   6400       variable_data += count * 48;
   6401       _mesa_post_marshal_hook(ctx);
   6402       return;
   6403    }
   6404 
   6405 fallback_to_sync:
   6406    _mesa_glthread_finish(ctx);
   6407    debug_print_sync_fallback("ProgramUniformMatrix4x3fv");
   6408    CALL_ProgramUniformMatrix4x3fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   6409 }
   6410 
   6411 
   6412 /* PopClientAttrib: marshalled asynchronously */
   6413 struct marshal_cmd_PopClientAttrib
   6414 {
   6415    struct marshal_cmd_base cmd_base;
   6416 };
   6417 static inline void
   6418 _mesa_unmarshal_PopClientAttrib(struct gl_context *ctx, const struct marshal_cmd_PopClientAttrib *cmd)
   6419 {
   6420    CALL_PopClientAttrib(ctx->CurrentServerDispatch, ());
   6421 }
   6422 static void GLAPIENTRY
   6423 _mesa_marshal_PopClientAttrib(void)
   6424 {
   6425    GET_CURRENT_CONTEXT(ctx);
   6426    size_t cmd_size = sizeof(struct marshal_cmd_PopClientAttrib);
   6427    struct marshal_cmd_PopClientAttrib *cmd;
   6428    debug_print_marshal("PopClientAttrib");
   6429    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6430       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PopClientAttrib, cmd_size);
   6431       (void) cmd;
   6432 
   6433       _mesa_post_marshal_hook(ctx);
   6434       return;
   6435    }
   6436 
   6437    _mesa_glthread_finish(ctx);
   6438    debug_print_sync_fallback("PopClientAttrib");
   6439    CALL_PopClientAttrib(ctx->CurrentServerDispatch, ());
   6440 }
   6441 
   6442 
   6443 /* DrawElementsInstancedARB: marshalled asynchronously */
   6444 struct marshal_cmd_DrawElementsInstancedARB
   6445 {
   6446    struct marshal_cmd_base cmd_base;
   6447    GLenum mode;
   6448    GLsizei count;
   6449    GLenum type;
   6450    const GLvoid * indices;
   6451    GLsizei primcount;
   6452 };
   6453 static inline void
   6454 _mesa_unmarshal_DrawElementsInstancedARB(struct gl_context *ctx, const struct marshal_cmd_DrawElementsInstancedARB *cmd)
   6455 {
   6456    const GLenum mode = cmd->mode;
   6457    const GLsizei count = cmd->count;
   6458    const GLenum type = cmd->type;
   6459    const GLvoid * indices = cmd->indices;
   6460    const GLsizei primcount = cmd->primcount;
   6461    CALL_DrawElementsInstancedARB(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount));
   6462 }
   6463 static void GLAPIENTRY
   6464 _mesa_marshal_DrawElementsInstancedARB(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount)
   6465 {
   6466    GET_CURRENT_CONTEXT(ctx);
   6467    size_t cmd_size = sizeof(struct marshal_cmd_DrawElementsInstancedARB);
   6468    struct marshal_cmd_DrawElementsInstancedARB *cmd;
   6469    debug_print_marshal("DrawElementsInstancedARB");
   6470    if (_mesa_glthread_is_non_vbo_draw_elements(ctx)) {
   6471       _mesa_glthread_finish(ctx);
   6472       _mesa_glthread_restore_dispatch(ctx);
   6473       debug_print_sync_fallback("DrawElementsInstancedARB");
   6474       CALL_DrawElementsInstancedARB(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount));
   6475       return;
   6476    }
   6477    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6478       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawElementsInstancedARB, cmd_size);
   6479       cmd->mode = mode;
   6480       cmd->count = count;
   6481       cmd->type = type;
   6482       cmd->indices = indices;
   6483       cmd->primcount = primcount;
   6484       _mesa_post_marshal_hook(ctx);
   6485       return;
   6486    }
   6487 
   6488    _mesa_glthread_finish(ctx);
   6489    debug_print_sync_fallback("DrawElementsInstancedARB");
   6490    CALL_DrawElementsInstancedARB(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount));
   6491 }
   6492 
   6493 
   6494 /* GetQueryObjectuiv: marshalled synchronously */
   6495 static void GLAPIENTRY
   6496 _mesa_marshal_GetQueryObjectuiv(GLuint id, GLenum pname, GLuint * params)
   6497 {
   6498    GET_CURRENT_CONTEXT(ctx);
   6499    _mesa_glthread_finish(ctx);
   6500    debug_print_sync("GetQueryObjectuiv");
   6501    CALL_GetQueryObjectuiv(ctx->CurrentServerDispatch, (id, pname, params));
   6502 }
   6503 
   6504 
   6505 /* VertexAttribI4bv: marshalled synchronously */
   6506 static void GLAPIENTRY
   6507 _mesa_marshal_VertexAttribI4bv(GLuint index, const GLbyte * v)
   6508 {
   6509    GET_CURRENT_CONTEXT(ctx);
   6510    _mesa_glthread_finish(ctx);
   6511    debug_print_sync("VertexAttribI4bv");
   6512    CALL_VertexAttribI4bv(ctx->CurrentServerDispatch, (index, v));
   6513 }
   6514 
   6515 
   6516 /* DisableVertexArrayAttrib: marshalled asynchronously */
   6517 struct marshal_cmd_DisableVertexArrayAttrib
   6518 {
   6519    struct marshal_cmd_base cmd_base;
   6520    GLuint vaobj;
   6521    GLuint index;
   6522 };
   6523 static inline void
   6524 _mesa_unmarshal_DisableVertexArrayAttrib(struct gl_context *ctx, const struct marshal_cmd_DisableVertexArrayAttrib *cmd)
   6525 {
   6526    const GLuint vaobj = cmd->vaobj;
   6527    const GLuint index = cmd->index;
   6528    CALL_DisableVertexArrayAttrib(ctx->CurrentServerDispatch, (vaobj, index));
   6529 }
   6530 static void GLAPIENTRY
   6531 _mesa_marshal_DisableVertexArrayAttrib(GLuint vaobj, GLuint index)
   6532 {
   6533    GET_CURRENT_CONTEXT(ctx);
   6534    size_t cmd_size = sizeof(struct marshal_cmd_DisableVertexArrayAttrib);
   6535    struct marshal_cmd_DisableVertexArrayAttrib *cmd;
   6536    debug_print_marshal("DisableVertexArrayAttrib");
   6537    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6538       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DisableVertexArrayAttrib, cmd_size);
   6539       cmd->vaobj = vaobj;
   6540       cmd->index = index;
   6541       _mesa_post_marshal_hook(ctx);
   6542       return;
   6543    }
   6544 
   6545    _mesa_glthread_finish(ctx);
   6546    debug_print_sync_fallback("DisableVertexArrayAttrib");
   6547    CALL_DisableVertexArrayAttrib(ctx->CurrentServerDispatch, (vaobj, index));
   6548 }
   6549 
   6550 
   6551 /* VertexAttribL4d: marshalled asynchronously */
   6552 struct marshal_cmd_VertexAttribL4d
   6553 {
   6554    struct marshal_cmd_base cmd_base;
   6555    GLuint index;
   6556    GLdouble x;
   6557    GLdouble y;
   6558    GLdouble z;
   6559    GLdouble w;
   6560 };
   6561 static inline void
   6562 _mesa_unmarshal_VertexAttribL4d(struct gl_context *ctx, const struct marshal_cmd_VertexAttribL4d *cmd)
   6563 {
   6564    const GLuint index = cmd->index;
   6565    const GLdouble x = cmd->x;
   6566    const GLdouble y = cmd->y;
   6567    const GLdouble z = cmd->z;
   6568    const GLdouble w = cmd->w;
   6569    CALL_VertexAttribL4d(ctx->CurrentServerDispatch, (index, x, y, z, w));
   6570 }
   6571 static void GLAPIENTRY
   6572 _mesa_marshal_VertexAttribL4d(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
   6573 {
   6574    GET_CURRENT_CONTEXT(ctx);
   6575    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribL4d);
   6576    struct marshal_cmd_VertexAttribL4d *cmd;
   6577    debug_print_marshal("VertexAttribL4d");
   6578    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6579       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribL4d, cmd_size);
   6580       cmd->index = index;
   6581       cmd->x = x;
   6582       cmd->y = y;
   6583       cmd->z = z;
   6584       cmd->w = w;
   6585       _mesa_post_marshal_hook(ctx);
   6586       return;
   6587    }
   6588 
   6589    _mesa_glthread_finish(ctx);
   6590    debug_print_sync_fallback("VertexAttribL4d");
   6591    CALL_VertexAttribL4d(ctx->CurrentServerDispatch, (index, x, y, z, w));
   6592 }
   6593 
   6594 
   6595 /* ListBase: marshalled asynchronously */
   6596 struct marshal_cmd_ListBase
   6597 {
   6598    struct marshal_cmd_base cmd_base;
   6599    GLuint base;
   6600 };
   6601 static inline void
   6602 _mesa_unmarshal_ListBase(struct gl_context *ctx, const struct marshal_cmd_ListBase *cmd)
   6603 {
   6604    const GLuint base = cmd->base;
   6605    CALL_ListBase(ctx->CurrentServerDispatch, (base));
   6606 }
   6607 static void GLAPIENTRY
   6608 _mesa_marshal_ListBase(GLuint base)
   6609 {
   6610    GET_CURRENT_CONTEXT(ctx);
   6611    size_t cmd_size = sizeof(struct marshal_cmd_ListBase);
   6612    struct marshal_cmd_ListBase *cmd;
   6613    debug_print_marshal("ListBase");
   6614    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6615       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ListBase, cmd_size);
   6616       cmd->base = base;
   6617       _mesa_post_marshal_hook(ctx);
   6618       return;
   6619    }
   6620 
   6621    _mesa_glthread_finish(ctx);
   6622    debug_print_sync_fallback("ListBase");
   6623    CALL_ListBase(ctx->CurrentServerDispatch, (base));
   6624 }
   6625 
   6626 
   6627 /* GenerateMipmap: marshalled asynchronously */
   6628 struct marshal_cmd_GenerateMipmap
   6629 {
   6630    struct marshal_cmd_base cmd_base;
   6631    GLenum target;
   6632 };
   6633 static inline void
   6634 _mesa_unmarshal_GenerateMipmap(struct gl_context *ctx, const struct marshal_cmd_GenerateMipmap *cmd)
   6635 {
   6636    const GLenum target = cmd->target;
   6637    CALL_GenerateMipmap(ctx->CurrentServerDispatch, (target));
   6638 }
   6639 static void GLAPIENTRY
   6640 _mesa_marshal_GenerateMipmap(GLenum target)
   6641 {
   6642    GET_CURRENT_CONTEXT(ctx);
   6643    size_t cmd_size = sizeof(struct marshal_cmd_GenerateMipmap);
   6644    struct marshal_cmd_GenerateMipmap *cmd;
   6645    debug_print_marshal("GenerateMipmap");
   6646    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6647       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GenerateMipmap, cmd_size);
   6648       cmd->target = target;
   6649       _mesa_post_marshal_hook(ctx);
   6650       return;
   6651    }
   6652 
   6653    _mesa_glthread_finish(ctx);
   6654    debug_print_sync_fallback("GenerateMipmap");
   6655    CALL_GenerateMipmap(ctx->CurrentServerDispatch, (target));
   6656 }
   6657 
   6658 
   6659 /* BindBufferRange: marshalled asynchronously */
   6660 struct marshal_cmd_BindBufferRange
   6661 {
   6662    struct marshal_cmd_base cmd_base;
   6663    GLenum target;
   6664    GLuint index;
   6665    GLuint buffer;
   6666    GLintptr offset;
   6667    GLsizeiptr size;
   6668 };
   6669 static inline void
   6670 _mesa_unmarshal_BindBufferRange(struct gl_context *ctx, const struct marshal_cmd_BindBufferRange *cmd)
   6671 {
   6672    const GLenum target = cmd->target;
   6673    const GLuint index = cmd->index;
   6674    const GLuint buffer = cmd->buffer;
   6675    const GLintptr offset = cmd->offset;
   6676    const GLsizeiptr size = cmd->size;
   6677    CALL_BindBufferRange(ctx->CurrentServerDispatch, (target, index, buffer, offset, size));
   6678 }
   6679 static void GLAPIENTRY
   6680 _mesa_marshal_BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
   6681 {
   6682    GET_CURRENT_CONTEXT(ctx);
   6683    size_t cmd_size = sizeof(struct marshal_cmd_BindBufferRange);
   6684    struct marshal_cmd_BindBufferRange *cmd;
   6685    debug_print_marshal("BindBufferRange");
   6686    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6687       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindBufferRange, cmd_size);
   6688       cmd->target = target;
   6689       cmd->index = index;
   6690       cmd->buffer = buffer;
   6691       cmd->offset = offset;
   6692       cmd->size = size;
   6693       _mesa_post_marshal_hook(ctx);
   6694       return;
   6695    }
   6696 
   6697    _mesa_glthread_finish(ctx);
   6698    debug_print_sync_fallback("BindBufferRange");
   6699    CALL_BindBufferRange(ctx->CurrentServerDispatch, (target, index, buffer, offset, size));
   6700 }
   6701 
   6702 
   6703 /* ProgramUniformMatrix2x4fv: marshalled asynchronously */
   6704 struct marshal_cmd_ProgramUniformMatrix2x4fv
   6705 {
   6706    struct marshal_cmd_base cmd_base;
   6707    GLuint program;
   6708    GLint location;
   6709    GLsizei count;
   6710    GLboolean transpose;
   6711    /* Next safe_mul(count, 32) bytes are GLfloat value[count][8] */
   6712 };
   6713 static inline void
   6714 _mesa_unmarshal_ProgramUniformMatrix2x4fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix2x4fv *cmd)
   6715 {
   6716    const GLuint program = cmd->program;
   6717    const GLint location = cmd->location;
   6718    const GLsizei count = cmd->count;
   6719    const GLboolean transpose = cmd->transpose;
   6720    const GLfloat * value;
   6721    const char *variable_data = (const char *) (cmd + 1);
   6722    value = (const GLfloat *) variable_data;
   6723    variable_data += count * 32;
   6724    CALL_ProgramUniformMatrix2x4fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   6725 }
   6726 static void GLAPIENTRY
   6727 _mesa_marshal_ProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   6728 {
   6729    GET_CURRENT_CONTEXT(ctx);
   6730    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix2x4fv) + safe_mul(count, 32);
   6731    struct marshal_cmd_ProgramUniformMatrix2x4fv *cmd;
   6732    debug_print_marshal("ProgramUniformMatrix2x4fv");
   6733    if (unlikely(safe_mul(count, 32) < 0)) {
   6734       goto fallback_to_sync;
   6735    }
   6736    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6737       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix2x4fv, cmd_size);
   6738       cmd->program = program;
   6739       cmd->location = location;
   6740       cmd->count = count;
   6741       cmd->transpose = transpose;
   6742       char *variable_data = (char *) (cmd + 1);
   6743       memcpy(variable_data, value, count * 32);
   6744       variable_data += count * 32;
   6745       _mesa_post_marshal_hook(ctx);
   6746       return;
   6747    }
   6748 
   6749 fallback_to_sync:
   6750    _mesa_glthread_finish(ctx);
   6751    debug_print_sync_fallback("ProgramUniformMatrix2x4fv");
   6752    CALL_ProgramUniformMatrix2x4fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   6753 }
   6754 
   6755 
   6756 /* BindBufferBase: marshalled asynchronously */
   6757 struct marshal_cmd_BindBufferBase
   6758 {
   6759    struct marshal_cmd_base cmd_base;
   6760    GLenum target;
   6761    GLuint index;
   6762    GLuint buffer;
   6763 };
   6764 static inline void
   6765 _mesa_unmarshal_BindBufferBase(struct gl_context *ctx, const struct marshal_cmd_BindBufferBase *cmd)
   6766 {
   6767    const GLenum target = cmd->target;
   6768    const GLuint index = cmd->index;
   6769    const GLuint buffer = cmd->buffer;
   6770    CALL_BindBufferBase(ctx->CurrentServerDispatch, (target, index, buffer));
   6771 }
   6772 static void GLAPIENTRY
   6773 _mesa_marshal_BindBufferBase(GLenum target, GLuint index, GLuint buffer)
   6774 {
   6775    GET_CURRENT_CONTEXT(ctx);
   6776    size_t cmd_size = sizeof(struct marshal_cmd_BindBufferBase);
   6777    struct marshal_cmd_BindBufferBase *cmd;
   6778    debug_print_marshal("BindBufferBase");
   6779    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6780       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindBufferBase, cmd_size);
   6781       cmd->target = target;
   6782       cmd->index = index;
   6783       cmd->buffer = buffer;
   6784       _mesa_post_marshal_hook(ctx);
   6785       return;
   6786    }
   6787 
   6788    _mesa_glthread_finish(ctx);
   6789    debug_print_sync_fallback("BindBufferBase");
   6790    CALL_BindBufferBase(ctx->CurrentServerDispatch, (target, index, buffer));
   6791 }
   6792 
   6793 
   6794 /* GetQueryObjectiv: marshalled synchronously */
   6795 static void GLAPIENTRY
   6796 _mesa_marshal_GetQueryObjectiv(GLuint id, GLenum pname, GLint * params)
   6797 {
   6798    GET_CURRENT_CONTEXT(ctx);
   6799    _mesa_glthread_finish(ctx);
   6800    debug_print_sync("GetQueryObjectiv");
   6801    CALL_GetQueryObjectiv(ctx->CurrentServerDispatch, (id, pname, params));
   6802 }
   6803 
   6804 
   6805 /* VertexAttrib2s: marshalled asynchronously */
   6806 struct marshal_cmd_VertexAttrib2s
   6807 {
   6808    struct marshal_cmd_base cmd_base;
   6809    GLuint index;
   6810    GLshort x;
   6811    GLshort y;
   6812 };
   6813 static inline void
   6814 _mesa_unmarshal_VertexAttrib2s(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2s *cmd)
   6815 {
   6816    const GLuint index = cmd->index;
   6817    const GLshort x = cmd->x;
   6818    const GLshort y = cmd->y;
   6819    CALL_VertexAttrib2s(ctx->CurrentServerDispatch, (index, x, y));
   6820 }
   6821 static void GLAPIENTRY
   6822 _mesa_marshal_VertexAttrib2s(GLuint index, GLshort x, GLshort y)
   6823 {
   6824    GET_CURRENT_CONTEXT(ctx);
   6825    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib2s);
   6826    struct marshal_cmd_VertexAttrib2s *cmd;
   6827    debug_print_marshal("VertexAttrib2s");
   6828    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6829       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2s, cmd_size);
   6830       cmd->index = index;
   6831       cmd->x = x;
   6832       cmd->y = y;
   6833       _mesa_post_marshal_hook(ctx);
   6834       return;
   6835    }
   6836 
   6837    _mesa_glthread_finish(ctx);
   6838    debug_print_sync_fallback("VertexAttrib2s");
   6839    CALL_VertexAttrib2s(ctx->CurrentServerDispatch, (index, x, y));
   6840 }
   6841 
   6842 
   6843 /* SecondaryColor3fvEXT: marshalled asynchronously */
   6844 struct marshal_cmd_SecondaryColor3fvEXT
   6845 {
   6846    struct marshal_cmd_base cmd_base;
   6847    GLfloat v[3];
   6848 };
   6849 static inline void
   6850 _mesa_unmarshal_SecondaryColor3fvEXT(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3fvEXT *cmd)
   6851 {
   6852    const GLfloat * v = cmd->v;
   6853    CALL_SecondaryColor3fvEXT(ctx->CurrentServerDispatch, (v));
   6854 }
   6855 static void GLAPIENTRY
   6856 _mesa_marshal_SecondaryColor3fvEXT(const GLfloat * v)
   6857 {
   6858    GET_CURRENT_CONTEXT(ctx);
   6859    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColor3fvEXT);
   6860    struct marshal_cmd_SecondaryColor3fvEXT *cmd;
   6861    debug_print_marshal("SecondaryColor3fvEXT");
   6862    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6863       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3fvEXT, cmd_size);
   6864       memcpy(cmd->v, v, 12);
   6865       _mesa_post_marshal_hook(ctx);
   6866       return;
   6867    }
   6868 
   6869    _mesa_glthread_finish(ctx);
   6870    debug_print_sync_fallback("SecondaryColor3fvEXT");
   6871    CALL_SecondaryColor3fvEXT(ctx->CurrentServerDispatch, (v));
   6872 }
   6873 
   6874 
   6875 /* VertexAttrib2d: marshalled asynchronously */
   6876 struct marshal_cmd_VertexAttrib2d
   6877 {
   6878    struct marshal_cmd_base cmd_base;
   6879    GLuint index;
   6880    GLdouble x;
   6881    GLdouble y;
   6882 };
   6883 static inline void
   6884 _mesa_unmarshal_VertexAttrib2d(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2d *cmd)
   6885 {
   6886    const GLuint index = cmd->index;
   6887    const GLdouble x = cmd->x;
   6888    const GLdouble y = cmd->y;
   6889    CALL_VertexAttrib2d(ctx->CurrentServerDispatch, (index, x, y));
   6890 }
   6891 static void GLAPIENTRY
   6892 _mesa_marshal_VertexAttrib2d(GLuint index, GLdouble x, GLdouble y)
   6893 {
   6894    GET_CURRENT_CONTEXT(ctx);
   6895    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib2d);
   6896    struct marshal_cmd_VertexAttrib2d *cmd;
   6897    debug_print_marshal("VertexAttrib2d");
   6898    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6899       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2d, cmd_size);
   6900       cmd->index = index;
   6901       cmd->x = x;
   6902       cmd->y = y;
   6903       _mesa_post_marshal_hook(ctx);
   6904       return;
   6905    }
   6906 
   6907    _mesa_glthread_finish(ctx);
   6908    debug_print_sync_fallback("VertexAttrib2d");
   6909    CALL_VertexAttrib2d(ctx->CurrentServerDispatch, (index, x, y));
   6910 }
   6911 
   6912 
   6913 /* ClearNamedFramebufferiv: marshalled synchronously */
   6914 static void GLAPIENTRY
   6915 _mesa_marshal_ClearNamedFramebufferiv(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLint * value)
   6916 {
   6917    GET_CURRENT_CONTEXT(ctx);
   6918    _mesa_glthread_finish(ctx);
   6919    debug_print_sync("ClearNamedFramebufferiv");
   6920    CALL_ClearNamedFramebufferiv(ctx->CurrentServerDispatch, (framebuffer, buffer, drawbuffer, value));
   6921 }
   6922 
   6923 
   6924 /* Uniform1fv: marshalled asynchronously */
   6925 struct marshal_cmd_Uniform1fv
   6926 {
   6927    struct marshal_cmd_base cmd_base;
   6928    GLint location;
   6929    GLsizei count;
   6930    /* Next safe_mul(count, 4) bytes are GLfloat value[count] */
   6931 };
   6932 static inline void
   6933 _mesa_unmarshal_Uniform1fv(struct gl_context *ctx, const struct marshal_cmd_Uniform1fv *cmd)
   6934 {
   6935    const GLint location = cmd->location;
   6936    const GLsizei count = cmd->count;
   6937    const GLfloat * value;
   6938    const char *variable_data = (const char *) (cmd + 1);
   6939    value = (const GLfloat *) variable_data;
   6940    variable_data += count * 4;
   6941    CALL_Uniform1fv(ctx->CurrentServerDispatch, (location, count, value));
   6942 }
   6943 static void GLAPIENTRY
   6944 _mesa_marshal_Uniform1fv(GLint location, GLsizei count, const GLfloat * value)
   6945 {
   6946    GET_CURRENT_CONTEXT(ctx);
   6947    size_t cmd_size = sizeof(struct marshal_cmd_Uniform1fv) + safe_mul(count, 4);
   6948    struct marshal_cmd_Uniform1fv *cmd;
   6949    debug_print_marshal("Uniform1fv");
   6950    if (unlikely(safe_mul(count, 4) < 0)) {
   6951       goto fallback_to_sync;
   6952    }
   6953    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   6954       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1fv, cmd_size);
   6955       cmd->location = location;
   6956       cmd->count = count;
   6957       char *variable_data = (char *) (cmd + 1);
   6958       memcpy(variable_data, value, count * 4);
   6959       variable_data += count * 4;
   6960       _mesa_post_marshal_hook(ctx);
   6961       return;
   6962    }
   6963 
   6964 fallback_to_sync:
   6965    _mesa_glthread_finish(ctx);
   6966    debug_print_sync_fallback("Uniform1fv");
   6967    CALL_Uniform1fv(ctx->CurrentServerDispatch, (location, count, value));
   6968 }
   6969 
   6970 
   6971 /* GetProgramPipelineInfoLog: marshalled synchronously */
   6972 static void GLAPIENTRY
   6973 _mesa_marshal_GetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei * length, GLchar * infoLog)
   6974 {
   6975    GET_CURRENT_CONTEXT(ctx);
   6976    _mesa_glthread_finish(ctx);
   6977    debug_print_sync("GetProgramPipelineInfoLog");
   6978    CALL_GetProgramPipelineInfoLog(ctx->CurrentServerDispatch, (pipeline, bufSize, length, infoLog));
   6979 }
   6980 
   6981 
   6982 /* DepthBoundsEXT: marshalled asynchronously */
   6983 struct marshal_cmd_DepthBoundsEXT
   6984 {
   6985    struct marshal_cmd_base cmd_base;
   6986    GLclampd zmin;
   6987    GLclampd zmax;
   6988 };
   6989 static inline void
   6990 _mesa_unmarshal_DepthBoundsEXT(struct gl_context *ctx, const struct marshal_cmd_DepthBoundsEXT *cmd)
   6991 {
   6992    const GLclampd zmin = cmd->zmin;
   6993    const GLclampd zmax = cmd->zmax;
   6994    CALL_DepthBoundsEXT(ctx->CurrentServerDispatch, (zmin, zmax));
   6995 }
   6996 static void GLAPIENTRY
   6997 _mesa_marshal_DepthBoundsEXT(GLclampd zmin, GLclampd zmax)
   6998 {
   6999    GET_CURRENT_CONTEXT(ctx);
   7000    size_t cmd_size = sizeof(struct marshal_cmd_DepthBoundsEXT);
   7001    struct marshal_cmd_DepthBoundsEXT *cmd;
   7002    debug_print_marshal("DepthBoundsEXT");
   7003    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7004       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DepthBoundsEXT, cmd_size);
   7005       cmd->zmin = zmin;
   7006       cmd->zmax = zmax;
   7007       _mesa_post_marshal_hook(ctx);
   7008       return;
   7009    }
   7010 
   7011    _mesa_glthread_finish(ctx);
   7012    debug_print_sync_fallback("DepthBoundsEXT");
   7013    CALL_DepthBoundsEXT(ctx->CurrentServerDispatch, (zmin, zmax));
   7014 }
   7015 
   7016 
   7017 /* BufferStorageMemEXT: marshalled asynchronously */
   7018 struct marshal_cmd_BufferStorageMemEXT
   7019 {
   7020    struct marshal_cmd_base cmd_base;
   7021    GLenum target;
   7022    GLsizeiptr size;
   7023    GLuint memory;
   7024    GLuint64 offset;
   7025 };
   7026 static inline void
   7027 _mesa_unmarshal_BufferStorageMemEXT(struct gl_context *ctx, const struct marshal_cmd_BufferStorageMemEXT *cmd)
   7028 {
   7029    const GLenum target = cmd->target;
   7030    const GLsizeiptr size = cmd->size;
   7031    const GLuint memory = cmd->memory;
   7032    const GLuint64 offset = cmd->offset;
   7033    CALL_BufferStorageMemEXT(ctx->CurrentServerDispatch, (target, size, memory, offset));
   7034 }
   7035 static void GLAPIENTRY
   7036 _mesa_marshal_BufferStorageMemEXT(GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset)
   7037 {
   7038    GET_CURRENT_CONTEXT(ctx);
   7039    size_t cmd_size = sizeof(struct marshal_cmd_BufferStorageMemEXT);
   7040    struct marshal_cmd_BufferStorageMemEXT *cmd;
   7041    debug_print_marshal("BufferStorageMemEXT");
   7042    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7043       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BufferStorageMemEXT, cmd_size);
   7044       cmd->target = target;
   7045       cmd->size = size;
   7046       cmd->memory = memory;
   7047       cmd->offset = offset;
   7048       _mesa_post_marshal_hook(ctx);
   7049       return;
   7050    }
   7051 
   7052    _mesa_glthread_finish(ctx);
   7053    debug_print_sync_fallback("BufferStorageMemEXT");
   7054    CALL_BufferStorageMemEXT(ctx->CurrentServerDispatch, (target, size, memory, offset));
   7055 }
   7056 
   7057 
   7058 /* WindowPos3fv: marshalled asynchronously */
   7059 struct marshal_cmd_WindowPos3fv
   7060 {
   7061    struct marshal_cmd_base cmd_base;
   7062    GLfloat v[3];
   7063 };
   7064 static inline void
   7065 _mesa_unmarshal_WindowPos3fv(struct gl_context *ctx, const struct marshal_cmd_WindowPos3fv *cmd)
   7066 {
   7067    const GLfloat * v = cmd->v;
   7068    CALL_WindowPos3fv(ctx->CurrentServerDispatch, (v));
   7069 }
   7070 static void GLAPIENTRY
   7071 _mesa_marshal_WindowPos3fv(const GLfloat * v)
   7072 {
   7073    GET_CURRENT_CONTEXT(ctx);
   7074    size_t cmd_size = sizeof(struct marshal_cmd_WindowPos3fv);
   7075    struct marshal_cmd_WindowPos3fv *cmd;
   7076    debug_print_marshal("WindowPos3fv");
   7077    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7078       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos3fv, cmd_size);
   7079       memcpy(cmd->v, v, 12);
   7080       _mesa_post_marshal_hook(ctx);
   7081       return;
   7082    }
   7083 
   7084    _mesa_glthread_finish(ctx);
   7085    debug_print_sync_fallback("WindowPos3fv");
   7086    CALL_WindowPos3fv(ctx->CurrentServerDispatch, (v));
   7087 }
   7088 
   7089 
   7090 /* GetHistogramParameteriv: marshalled synchronously */
   7091 static void GLAPIENTRY
   7092 _mesa_marshal_GetHistogramParameteriv(GLenum target, GLenum pname, GLint * params)
   7093 {
   7094    GET_CURRENT_CONTEXT(ctx);
   7095    _mesa_glthread_finish(ctx);
   7096    debug_print_sync("GetHistogramParameteriv");
   7097    CALL_GetHistogramParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
   7098 }
   7099 
   7100 
   7101 /* PointParameteriv: marshalled synchronously */
   7102 static void GLAPIENTRY
   7103 _mesa_marshal_PointParameteriv(GLenum pname, const GLint * params)
   7104 {
   7105    GET_CURRENT_CONTEXT(ctx);
   7106    _mesa_glthread_finish(ctx);
   7107    debug_print_sync("PointParameteriv");
   7108    CALL_PointParameteriv(ctx->CurrentServerDispatch, (pname, params));
   7109 }
   7110 
   7111 
   7112 /* NamedRenderbufferStorage: marshalled asynchronously */
   7113 struct marshal_cmd_NamedRenderbufferStorage
   7114 {
   7115    struct marshal_cmd_base cmd_base;
   7116    GLuint renderbuffer;
   7117    GLenum internalformat;
   7118    GLsizei width;
   7119    GLsizei height;
   7120 };
   7121 static inline void
   7122 _mesa_unmarshal_NamedRenderbufferStorage(struct gl_context *ctx, const struct marshal_cmd_NamedRenderbufferStorage *cmd)
   7123 {
   7124    const GLuint renderbuffer = cmd->renderbuffer;
   7125    const GLenum internalformat = cmd->internalformat;
   7126    const GLsizei width = cmd->width;
   7127    const GLsizei height = cmd->height;
   7128    CALL_NamedRenderbufferStorage(ctx->CurrentServerDispatch, (renderbuffer, internalformat, width, height));
   7129 }
   7130 static void GLAPIENTRY
   7131 _mesa_marshal_NamedRenderbufferStorage(GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height)
   7132 {
   7133    GET_CURRENT_CONTEXT(ctx);
   7134    size_t cmd_size = sizeof(struct marshal_cmd_NamedRenderbufferStorage);
   7135    struct marshal_cmd_NamedRenderbufferStorage *cmd;
   7136    debug_print_marshal("NamedRenderbufferStorage");
   7137    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7138       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedRenderbufferStorage, cmd_size);
   7139       cmd->renderbuffer = renderbuffer;
   7140       cmd->internalformat = internalformat;
   7141       cmd->width = width;
   7142       cmd->height = height;
   7143       _mesa_post_marshal_hook(ctx);
   7144       return;
   7145    }
   7146 
   7147    _mesa_glthread_finish(ctx);
   7148    debug_print_sync_fallback("NamedRenderbufferStorage");
   7149    CALL_NamedRenderbufferStorage(ctx->CurrentServerDispatch, (renderbuffer, internalformat, width, height));
   7150 }
   7151 
   7152 
   7153 /* GetProgramivARB: marshalled synchronously */
   7154 static void GLAPIENTRY
   7155 _mesa_marshal_GetProgramivARB(GLenum target, GLenum pname, GLint * params)
   7156 {
   7157    GET_CURRENT_CONTEXT(ctx);
   7158    _mesa_glthread_finish(ctx);
   7159    debug_print_sync("GetProgramivARB");
   7160    CALL_GetProgramivARB(ctx->CurrentServerDispatch, (target, pname, params));
   7161 }
   7162 
   7163 
   7164 /* BindRenderbuffer: marshalled asynchronously */
   7165 struct marshal_cmd_BindRenderbuffer
   7166 {
   7167    struct marshal_cmd_base cmd_base;
   7168    GLenum target;
   7169    GLuint renderbuffer;
   7170 };
   7171 static inline void
   7172 _mesa_unmarshal_BindRenderbuffer(struct gl_context *ctx, const struct marshal_cmd_BindRenderbuffer *cmd)
   7173 {
   7174    const GLenum target = cmd->target;
   7175    const GLuint renderbuffer = cmd->renderbuffer;
   7176    CALL_BindRenderbuffer(ctx->CurrentServerDispatch, (target, renderbuffer));
   7177 }
   7178 static void GLAPIENTRY
   7179 _mesa_marshal_BindRenderbuffer(GLenum target, GLuint renderbuffer)
   7180 {
   7181    GET_CURRENT_CONTEXT(ctx);
   7182    size_t cmd_size = sizeof(struct marshal_cmd_BindRenderbuffer);
   7183    struct marshal_cmd_BindRenderbuffer *cmd;
   7184    debug_print_marshal("BindRenderbuffer");
   7185    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7186       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindRenderbuffer, cmd_size);
   7187       cmd->target = target;
   7188       cmd->renderbuffer = renderbuffer;
   7189       _mesa_post_marshal_hook(ctx);
   7190       return;
   7191    }
   7192 
   7193    _mesa_glthread_finish(ctx);
   7194    debug_print_sync_fallback("BindRenderbuffer");
   7195    CALL_BindRenderbuffer(ctx->CurrentServerDispatch, (target, renderbuffer));
   7196 }
   7197 
   7198 
   7199 /* SecondaryColor3fEXT: marshalled asynchronously */
   7200 struct marshal_cmd_SecondaryColor3fEXT
   7201 {
   7202    struct marshal_cmd_base cmd_base;
   7203    GLfloat red;
   7204    GLfloat green;
   7205    GLfloat blue;
   7206 };
   7207 static inline void
   7208 _mesa_unmarshal_SecondaryColor3fEXT(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3fEXT *cmd)
   7209 {
   7210    const GLfloat red = cmd->red;
   7211    const GLfloat green = cmd->green;
   7212    const GLfloat blue = cmd->blue;
   7213    CALL_SecondaryColor3fEXT(ctx->CurrentServerDispatch, (red, green, blue));
   7214 }
   7215 static void GLAPIENTRY
   7216 _mesa_marshal_SecondaryColor3fEXT(GLfloat red, GLfloat green, GLfloat blue)
   7217 {
   7218    GET_CURRENT_CONTEXT(ctx);
   7219    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColor3fEXT);
   7220    struct marshal_cmd_SecondaryColor3fEXT *cmd;
   7221    debug_print_marshal("SecondaryColor3fEXT");
   7222    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7223       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3fEXT, cmd_size);
   7224       cmd->red = red;
   7225       cmd->green = green;
   7226       cmd->blue = blue;
   7227       _mesa_post_marshal_hook(ctx);
   7228       return;
   7229    }
   7230 
   7231    _mesa_glthread_finish(ctx);
   7232    debug_print_sync_fallback("SecondaryColor3fEXT");
   7233    CALL_SecondaryColor3fEXT(ctx->CurrentServerDispatch, (red, green, blue));
   7234 }
   7235 
   7236 
   7237 /* PrimitiveRestartIndex: marshalled asynchronously */
   7238 struct marshal_cmd_PrimitiveRestartIndex
   7239 {
   7240    struct marshal_cmd_base cmd_base;
   7241    GLuint index;
   7242 };
   7243 static inline void
   7244 _mesa_unmarshal_PrimitiveRestartIndex(struct gl_context *ctx, const struct marshal_cmd_PrimitiveRestartIndex *cmd)
   7245 {
   7246    const GLuint index = cmd->index;
   7247    CALL_PrimitiveRestartIndex(ctx->CurrentServerDispatch, (index));
   7248 }
   7249 static void GLAPIENTRY
   7250 _mesa_marshal_PrimitiveRestartIndex(GLuint index)
   7251 {
   7252    GET_CURRENT_CONTEXT(ctx);
   7253    size_t cmd_size = sizeof(struct marshal_cmd_PrimitiveRestartIndex);
   7254    struct marshal_cmd_PrimitiveRestartIndex *cmd;
   7255    debug_print_marshal("PrimitiveRestartIndex");
   7256    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7257       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PrimitiveRestartIndex, cmd_size);
   7258       cmd->index = index;
   7259       _mesa_post_marshal_hook(ctx);
   7260       return;
   7261    }
   7262 
   7263    _mesa_glthread_finish(ctx);
   7264    debug_print_sync_fallback("PrimitiveRestartIndex");
   7265    CALL_PrimitiveRestartIndex(ctx->CurrentServerDispatch, (index));
   7266 }
   7267 
   7268 
   7269 /* TextureStorageMem3DEXT: marshalled asynchronously */
   7270 struct marshal_cmd_TextureStorageMem3DEXT
   7271 {
   7272    struct marshal_cmd_base cmd_base;
   7273    GLuint texture;
   7274    GLsizei levels;
   7275    GLenum internalFormat;
   7276    GLsizei width;
   7277    GLsizei height;
   7278    GLsizei depth;
   7279    GLuint memory;
   7280    GLuint64 offset;
   7281 };
   7282 static inline void
   7283 _mesa_unmarshal_TextureStorageMem3DEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorageMem3DEXT *cmd)
   7284 {
   7285    const GLuint texture = cmd->texture;
   7286    const GLsizei levels = cmd->levels;
   7287    const GLenum internalFormat = cmd->internalFormat;
   7288    const GLsizei width = cmd->width;
   7289    const GLsizei height = cmd->height;
   7290    const GLsizei depth = cmd->depth;
   7291    const GLuint memory = cmd->memory;
   7292    const GLuint64 offset = cmd->offset;
   7293    CALL_TextureStorageMem3DEXT(ctx->CurrentServerDispatch, (texture, levels, internalFormat, width, height, depth, memory, offset));
   7294 }
   7295 static void GLAPIENTRY
   7296 _mesa_marshal_TextureStorageMem3DEXT(GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset)
   7297 {
   7298    GET_CURRENT_CONTEXT(ctx);
   7299    size_t cmd_size = sizeof(struct marshal_cmd_TextureStorageMem3DEXT);
   7300    struct marshal_cmd_TextureStorageMem3DEXT *cmd;
   7301    debug_print_marshal("TextureStorageMem3DEXT");
   7302    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7303       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorageMem3DEXT, cmd_size);
   7304       cmd->texture = texture;
   7305       cmd->levels = levels;
   7306       cmd->internalFormat = internalFormat;
   7307       cmd->width = width;
   7308       cmd->height = height;
   7309       cmd->depth = depth;
   7310       cmd->memory = memory;
   7311       cmd->offset = offset;
   7312       _mesa_post_marshal_hook(ctx);
   7313       return;
   7314    }
   7315 
   7316    _mesa_glthread_finish(ctx);
   7317    debug_print_sync_fallback("TextureStorageMem3DEXT");
   7318    CALL_TextureStorageMem3DEXT(ctx->CurrentServerDispatch, (texture, levels, internalFormat, width, height, depth, memory, offset));
   7319 }
   7320 
   7321 
   7322 /* VertexAttribI4ubv: marshalled synchronously */
   7323 static void GLAPIENTRY
   7324 _mesa_marshal_VertexAttribI4ubv(GLuint index, const GLubyte * v)
   7325 {
   7326    GET_CURRENT_CONTEXT(ctx);
   7327    _mesa_glthread_finish(ctx);
   7328    debug_print_sync("VertexAttribI4ubv");
   7329    CALL_VertexAttribI4ubv(ctx->CurrentServerDispatch, (index, v));
   7330 }
   7331 
   7332 
   7333 /* GetGraphicsResetStatusARB: marshalled synchronously */
   7334 static GLenum GLAPIENTRY
   7335 _mesa_marshal_GetGraphicsResetStatusARB(void)
   7336 {
   7337    GET_CURRENT_CONTEXT(ctx);
   7338    _mesa_glthread_finish(ctx);
   7339    debug_print_sync("GetGraphicsResetStatusARB");
   7340    return CALL_GetGraphicsResetStatusARB(ctx->CurrentServerDispatch, ());
   7341 }
   7342 
   7343 
   7344 /* CreateRenderbuffers: marshalled synchronously */
   7345 static void GLAPIENTRY
   7346 _mesa_marshal_CreateRenderbuffers(GLsizei n, GLuint * renderbuffers)
   7347 {
   7348    GET_CURRENT_CONTEXT(ctx);
   7349    _mesa_glthread_finish(ctx);
   7350    debug_print_sync("CreateRenderbuffers");
   7351    CALL_CreateRenderbuffers(ctx->CurrentServerDispatch, (n, renderbuffers));
   7352 }
   7353 
   7354 
   7355 /* ActiveStencilFaceEXT: marshalled asynchronously */
   7356 struct marshal_cmd_ActiveStencilFaceEXT
   7357 {
   7358    struct marshal_cmd_base cmd_base;
   7359    GLenum face;
   7360 };
   7361 static inline void
   7362 _mesa_unmarshal_ActiveStencilFaceEXT(struct gl_context *ctx, const struct marshal_cmd_ActiveStencilFaceEXT *cmd)
   7363 {
   7364    const GLenum face = cmd->face;
   7365    CALL_ActiveStencilFaceEXT(ctx->CurrentServerDispatch, (face));
   7366 }
   7367 static void GLAPIENTRY
   7368 _mesa_marshal_ActiveStencilFaceEXT(GLenum face)
   7369 {
   7370    GET_CURRENT_CONTEXT(ctx);
   7371    size_t cmd_size = sizeof(struct marshal_cmd_ActiveStencilFaceEXT);
   7372    struct marshal_cmd_ActiveStencilFaceEXT *cmd;
   7373    debug_print_marshal("ActiveStencilFaceEXT");
   7374    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7375       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ActiveStencilFaceEXT, cmd_size);
   7376       cmd->face = face;
   7377       _mesa_post_marshal_hook(ctx);
   7378       return;
   7379    }
   7380 
   7381    _mesa_glthread_finish(ctx);
   7382    debug_print_sync_fallback("ActiveStencilFaceEXT");
   7383    CALL_ActiveStencilFaceEXT(ctx->CurrentServerDispatch, (face));
   7384 }
   7385 
   7386 
   7387 /* VertexAttrib4dNV: marshalled asynchronously */
   7388 struct marshal_cmd_VertexAttrib4dNV
   7389 {
   7390    struct marshal_cmd_base cmd_base;
   7391    GLuint index;
   7392    GLdouble x;
   7393    GLdouble y;
   7394    GLdouble z;
   7395    GLdouble w;
   7396 };
   7397 static inline void
   7398 _mesa_unmarshal_VertexAttrib4dNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4dNV *cmd)
   7399 {
   7400    const GLuint index = cmd->index;
   7401    const GLdouble x = cmd->x;
   7402    const GLdouble y = cmd->y;
   7403    const GLdouble z = cmd->z;
   7404    const GLdouble w = cmd->w;
   7405    CALL_VertexAttrib4dNV(ctx->CurrentServerDispatch, (index, x, y, z, w));
   7406 }
   7407 static void GLAPIENTRY
   7408 _mesa_marshal_VertexAttrib4dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
   7409 {
   7410    GET_CURRENT_CONTEXT(ctx);
   7411    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4dNV);
   7412    struct marshal_cmd_VertexAttrib4dNV *cmd;
   7413    debug_print_marshal("VertexAttrib4dNV");
   7414    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7415       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4dNV, cmd_size);
   7416       cmd->index = index;
   7417       cmd->x = x;
   7418       cmd->y = y;
   7419       cmd->z = z;
   7420       cmd->w = w;
   7421       _mesa_post_marshal_hook(ctx);
   7422       return;
   7423    }
   7424 
   7425    _mesa_glthread_finish(ctx);
   7426    debug_print_sync_fallback("VertexAttrib4dNV");
   7427    CALL_VertexAttrib4dNV(ctx->CurrentServerDispatch, (index, x, y, z, w));
   7428 }
   7429 
   7430 
   7431 /* DepthRange: marshalled asynchronously */
   7432 struct marshal_cmd_DepthRange
   7433 {
   7434    struct marshal_cmd_base cmd_base;
   7435    GLclampd zNear;
   7436    GLclampd zFar;
   7437 };
   7438 static inline void
   7439 _mesa_unmarshal_DepthRange(struct gl_context *ctx, const struct marshal_cmd_DepthRange *cmd)
   7440 {
   7441    const GLclampd zNear = cmd->zNear;
   7442    const GLclampd zFar = cmd->zFar;
   7443    CALL_DepthRange(ctx->CurrentServerDispatch, (zNear, zFar));
   7444 }
   7445 static void GLAPIENTRY
   7446 _mesa_marshal_DepthRange(GLclampd zNear, GLclampd zFar)
   7447 {
   7448    GET_CURRENT_CONTEXT(ctx);
   7449    size_t cmd_size = sizeof(struct marshal_cmd_DepthRange);
   7450    struct marshal_cmd_DepthRange *cmd;
   7451    debug_print_marshal("DepthRange");
   7452    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7453       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DepthRange, cmd_size);
   7454       cmd->zNear = zNear;
   7455       cmd->zFar = zFar;
   7456       _mesa_post_marshal_hook(ctx);
   7457       return;
   7458    }
   7459 
   7460    _mesa_glthread_finish(ctx);
   7461    debug_print_sync_fallback("DepthRange");
   7462    CALL_DepthRange(ctx->CurrentServerDispatch, (zNear, zFar));
   7463 }
   7464 
   7465 
   7466 /* VertexAttrib4fNV: marshalled asynchronously */
   7467 struct marshal_cmd_VertexAttrib4fNV
   7468 {
   7469    struct marshal_cmd_base cmd_base;
   7470    GLuint index;
   7471    GLfloat x;
   7472    GLfloat y;
   7473    GLfloat z;
   7474    GLfloat w;
   7475 };
   7476 static inline void
   7477 _mesa_unmarshal_VertexAttrib4fNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4fNV *cmd)
   7478 {
   7479    const GLuint index = cmd->index;
   7480    const GLfloat x = cmd->x;
   7481    const GLfloat y = cmd->y;
   7482    const GLfloat z = cmd->z;
   7483    const GLfloat w = cmd->w;
   7484    CALL_VertexAttrib4fNV(ctx->CurrentServerDispatch, (index, x, y, z, w));
   7485 }
   7486 static void GLAPIENTRY
   7487 _mesa_marshal_VertexAttrib4fNV(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
   7488 {
   7489    GET_CURRENT_CONTEXT(ctx);
   7490    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4fNV);
   7491    struct marshal_cmd_VertexAttrib4fNV *cmd;
   7492    debug_print_marshal("VertexAttrib4fNV");
   7493    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7494       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4fNV, cmd_size);
   7495       cmd->index = index;
   7496       cmd->x = x;
   7497       cmd->y = y;
   7498       cmd->z = z;
   7499       cmd->w = w;
   7500       _mesa_post_marshal_hook(ctx);
   7501       return;
   7502    }
   7503 
   7504    _mesa_glthread_finish(ctx);
   7505    debug_print_sync_fallback("VertexAttrib4fNV");
   7506    CALL_VertexAttrib4fNV(ctx->CurrentServerDispatch, (index, x, y, z, w));
   7507 }
   7508 
   7509 
   7510 /* Uniform4fv: marshalled asynchronously */
   7511 struct marshal_cmd_Uniform4fv
   7512 {
   7513    struct marshal_cmd_base cmd_base;
   7514    GLint location;
   7515    GLsizei count;
   7516    /* Next safe_mul(count, 16) bytes are GLfloat value[count][4] */
   7517 };
   7518 static inline void
   7519 _mesa_unmarshal_Uniform4fv(struct gl_context *ctx, const struct marshal_cmd_Uniform4fv *cmd)
   7520 {
   7521    const GLint location = cmd->location;
   7522    const GLsizei count = cmd->count;
   7523    const GLfloat * value;
   7524    const char *variable_data = (const char *) (cmd + 1);
   7525    value = (const GLfloat *) variable_data;
   7526    variable_data += count * 16;
   7527    CALL_Uniform4fv(ctx->CurrentServerDispatch, (location, count, value));
   7528 }
   7529 static void GLAPIENTRY
   7530 _mesa_marshal_Uniform4fv(GLint location, GLsizei count, const GLfloat * value)
   7531 {
   7532    GET_CURRENT_CONTEXT(ctx);
   7533    size_t cmd_size = sizeof(struct marshal_cmd_Uniform4fv) + safe_mul(count, 16);
   7534    struct marshal_cmd_Uniform4fv *cmd;
   7535    debug_print_marshal("Uniform4fv");
   7536    if (unlikely(safe_mul(count, 16) < 0)) {
   7537       goto fallback_to_sync;
   7538    }
   7539    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7540       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4fv, cmd_size);
   7541       cmd->location = location;
   7542       cmd->count = count;
   7543       char *variable_data = (char *) (cmd + 1);
   7544       memcpy(variable_data, value, count * 16);
   7545       variable_data += count * 16;
   7546       _mesa_post_marshal_hook(ctx);
   7547       return;
   7548    }
   7549 
   7550 fallback_to_sync:
   7551    _mesa_glthread_finish(ctx);
   7552    debug_print_sync_fallback("Uniform4fv");
   7553    CALL_Uniform4fv(ctx->CurrentServerDispatch, (location, count, value));
   7554 }
   7555 
   7556 
   7557 /* SamplerParameterIiv: marshalled synchronously */
   7558 static void GLAPIENTRY
   7559 _mesa_marshal_SamplerParameterIiv(GLuint sampler, GLenum pname, const GLint * params)
   7560 {
   7561    GET_CURRENT_CONTEXT(ctx);
   7562    _mesa_glthread_finish(ctx);
   7563    debug_print_sync("SamplerParameterIiv");
   7564    CALL_SamplerParameterIiv(ctx->CurrentServerDispatch, (sampler, pname, params));
   7565 }
   7566 
   7567 
   7568 /* Frustumf: marshalled asynchronously */
   7569 struct marshal_cmd_Frustumf
   7570 {
   7571    struct marshal_cmd_base cmd_base;
   7572    GLfloat left;
   7573    GLfloat right;
   7574    GLfloat bottom;
   7575    GLfloat top;
   7576    GLfloat zNear;
   7577    GLfloat zFar;
   7578 };
   7579 static inline void
   7580 _mesa_unmarshal_Frustumf(struct gl_context *ctx, const struct marshal_cmd_Frustumf *cmd)
   7581 {
   7582    const GLfloat left = cmd->left;
   7583    const GLfloat right = cmd->right;
   7584    const GLfloat bottom = cmd->bottom;
   7585    const GLfloat top = cmd->top;
   7586    const GLfloat zNear = cmd->zNear;
   7587    const GLfloat zFar = cmd->zFar;
   7588    CALL_Frustumf(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar));
   7589 }
   7590 static void GLAPIENTRY
   7591 _mesa_marshal_Frustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
   7592 {
   7593    GET_CURRENT_CONTEXT(ctx);
   7594    size_t cmd_size = sizeof(struct marshal_cmd_Frustumf);
   7595    struct marshal_cmd_Frustumf *cmd;
   7596    debug_print_marshal("Frustumf");
   7597    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7598       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Frustumf, cmd_size);
   7599       cmd->left = left;
   7600       cmd->right = right;
   7601       cmd->bottom = bottom;
   7602       cmd->top = top;
   7603       cmd->zNear = zNear;
   7604       cmd->zFar = zFar;
   7605       _mesa_post_marshal_hook(ctx);
   7606       return;
   7607    }
   7608 
   7609    _mesa_glthread_finish(ctx);
   7610    debug_print_sync_fallback("Frustumf");
   7611    CALL_Frustumf(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar));
   7612 }
   7613 
   7614 
   7615 /* GetQueryBufferObjectui64v: marshalled asynchronously */
   7616 struct marshal_cmd_GetQueryBufferObjectui64v
   7617 {
   7618    struct marshal_cmd_base cmd_base;
   7619    GLuint id;
   7620    GLuint buffer;
   7621    GLenum pname;
   7622    GLintptr offset;
   7623 };
   7624 static inline void
   7625 _mesa_unmarshal_GetQueryBufferObjectui64v(struct gl_context *ctx, const struct marshal_cmd_GetQueryBufferObjectui64v *cmd)
   7626 {
   7627    const GLuint id = cmd->id;
   7628    const GLuint buffer = cmd->buffer;
   7629    const GLenum pname = cmd->pname;
   7630    const GLintptr offset = cmd->offset;
   7631    CALL_GetQueryBufferObjectui64v(ctx->CurrentServerDispatch, (id, buffer, pname, offset));
   7632 }
   7633 static void GLAPIENTRY
   7634 _mesa_marshal_GetQueryBufferObjectui64v(GLuint id, GLuint buffer, GLenum pname, GLintptr offset)
   7635 {
   7636    GET_CURRENT_CONTEXT(ctx);
   7637    size_t cmd_size = sizeof(struct marshal_cmd_GetQueryBufferObjectui64v);
   7638    struct marshal_cmd_GetQueryBufferObjectui64v *cmd;
   7639    debug_print_marshal("GetQueryBufferObjectui64v");
   7640    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7641       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetQueryBufferObjectui64v, cmd_size);
   7642       cmd->id = id;
   7643       cmd->buffer = buffer;
   7644       cmd->pname = pname;
   7645       cmd->offset = offset;
   7646       _mesa_post_marshal_hook(ctx);
   7647       return;
   7648    }
   7649 
   7650    _mesa_glthread_finish(ctx);
   7651    debug_print_sync_fallback("GetQueryBufferObjectui64v");
   7652    CALL_GetQueryBufferObjectui64v(ctx->CurrentServerDispatch, (id, buffer, pname, offset));
   7653 }
   7654 
   7655 
   7656 /* ProgramUniform2uiv: marshalled asynchronously */
   7657 struct marshal_cmd_ProgramUniform2uiv
   7658 {
   7659    struct marshal_cmd_base cmd_base;
   7660    GLuint program;
   7661    GLint location;
   7662    GLsizei count;
   7663    /* Next safe_mul(count, 8) bytes are GLuint value[count][2] */
   7664 };
   7665 static inline void
   7666 _mesa_unmarshal_ProgramUniform2uiv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2uiv *cmd)
   7667 {
   7668    const GLuint program = cmd->program;
   7669    const GLint location = cmd->location;
   7670    const GLsizei count = cmd->count;
   7671    const GLuint * value;
   7672    const char *variable_data = (const char *) (cmd + 1);
   7673    value = (const GLuint *) variable_data;
   7674    variable_data += count * 8;
   7675    CALL_ProgramUniform2uiv(ctx->CurrentServerDispatch, (program, location, count, value));
   7676 }
   7677 static void GLAPIENTRY
   7678 _mesa_marshal_ProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
   7679 {
   7680    GET_CURRENT_CONTEXT(ctx);
   7681    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform2uiv) + safe_mul(count, 8);
   7682    struct marshal_cmd_ProgramUniform2uiv *cmd;
   7683    debug_print_marshal("ProgramUniform2uiv");
   7684    if (unlikely(safe_mul(count, 8) < 0)) {
   7685       goto fallback_to_sync;
   7686    }
   7687    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7688       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2uiv, cmd_size);
   7689       cmd->program = program;
   7690       cmd->location = location;
   7691       cmd->count = count;
   7692       char *variable_data = (char *) (cmd + 1);
   7693       memcpy(variable_data, value, count * 8);
   7694       variable_data += count * 8;
   7695       _mesa_post_marshal_hook(ctx);
   7696       return;
   7697    }
   7698 
   7699 fallback_to_sync:
   7700    _mesa_glthread_finish(ctx);
   7701    debug_print_sync_fallback("ProgramUniform2uiv");
   7702    CALL_ProgramUniform2uiv(ctx->CurrentServerDispatch, (program, location, count, value));
   7703 }
   7704 
   7705 
   7706 /* Rectsv: marshalled asynchronously */
   7707 struct marshal_cmd_Rectsv
   7708 {
   7709    struct marshal_cmd_base cmd_base;
   7710    GLshort v1[2];
   7711    GLshort v2[2];
   7712 };
   7713 static inline void
   7714 _mesa_unmarshal_Rectsv(struct gl_context *ctx, const struct marshal_cmd_Rectsv *cmd)
   7715 {
   7716    const GLshort * v1 = cmd->v1;
   7717    const GLshort * v2 = cmd->v2;
   7718    CALL_Rectsv(ctx->CurrentServerDispatch, (v1, v2));
   7719 }
   7720 static void GLAPIENTRY
   7721 _mesa_marshal_Rectsv(const GLshort * v1, const GLshort * v2)
   7722 {
   7723    GET_CURRENT_CONTEXT(ctx);
   7724    size_t cmd_size = sizeof(struct marshal_cmd_Rectsv);
   7725    struct marshal_cmd_Rectsv *cmd;
   7726    debug_print_marshal("Rectsv");
   7727    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7728       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Rectsv, cmd_size);
   7729       memcpy(cmd->v1, v1, 4);
   7730       memcpy(cmd->v2, v2, 4);
   7731       _mesa_post_marshal_hook(ctx);
   7732       return;
   7733    }
   7734 
   7735    _mesa_glthread_finish(ctx);
   7736    debug_print_sync_fallback("Rectsv");
   7737    CALL_Rectsv(ctx->CurrentServerDispatch, (v1, v2));
   7738 }
   7739 
   7740 
   7741 /* Frustumx: marshalled asynchronously */
   7742 struct marshal_cmd_Frustumx
   7743 {
   7744    struct marshal_cmd_base cmd_base;
   7745    GLfixed left;
   7746    GLfixed right;
   7747    GLfixed bottom;
   7748    GLfixed top;
   7749    GLfixed zNear;
   7750    GLfixed zFar;
   7751 };
   7752 static inline void
   7753 _mesa_unmarshal_Frustumx(struct gl_context *ctx, const struct marshal_cmd_Frustumx *cmd)
   7754 {
   7755    const GLfixed left = cmd->left;
   7756    const GLfixed right = cmd->right;
   7757    const GLfixed bottom = cmd->bottom;
   7758    const GLfixed top = cmd->top;
   7759    const GLfixed zNear = cmd->zNear;
   7760    const GLfixed zFar = cmd->zFar;
   7761    CALL_Frustumx(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar));
   7762 }
   7763 static void GLAPIENTRY
   7764 _mesa_marshal_Frustumx(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
   7765 {
   7766    GET_CURRENT_CONTEXT(ctx);
   7767    size_t cmd_size = sizeof(struct marshal_cmd_Frustumx);
   7768    struct marshal_cmd_Frustumx *cmd;
   7769    debug_print_marshal("Frustumx");
   7770    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7771       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Frustumx, cmd_size);
   7772       cmd->left = left;
   7773       cmd->right = right;
   7774       cmd->bottom = bottom;
   7775       cmd->top = top;
   7776       cmd->zNear = zNear;
   7777       cmd->zFar = zFar;
   7778       _mesa_post_marshal_hook(ctx);
   7779       return;
   7780    }
   7781 
   7782    _mesa_glthread_finish(ctx);
   7783    debug_print_sync_fallback("Frustumx");
   7784    CALL_Frustumx(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar));
   7785 }
   7786 
   7787 
   7788 /* CullFace: marshalled asynchronously */
   7789 struct marshal_cmd_CullFace
   7790 {
   7791    struct marshal_cmd_base cmd_base;
   7792    GLenum mode;
   7793 };
   7794 static inline void
   7795 _mesa_unmarshal_CullFace(struct gl_context *ctx, const struct marshal_cmd_CullFace *cmd)
   7796 {
   7797    const GLenum mode = cmd->mode;
   7798    CALL_CullFace(ctx->CurrentServerDispatch, (mode));
   7799 }
   7800 static void GLAPIENTRY
   7801 _mesa_marshal_CullFace(GLenum mode)
   7802 {
   7803    GET_CURRENT_CONTEXT(ctx);
   7804    size_t cmd_size = sizeof(struct marshal_cmd_CullFace);
   7805    struct marshal_cmd_CullFace *cmd;
   7806    debug_print_marshal("CullFace");
   7807    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7808       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CullFace, cmd_size);
   7809       cmd->mode = mode;
   7810       _mesa_post_marshal_hook(ctx);
   7811       return;
   7812    }
   7813 
   7814    _mesa_glthread_finish(ctx);
   7815    debug_print_sync_fallback("CullFace");
   7816    CALL_CullFace(ctx->CurrentServerDispatch, (mode));
   7817 }
   7818 
   7819 
   7820 /* BindTexture: marshalled asynchronously */
   7821 struct marshal_cmd_BindTexture
   7822 {
   7823    struct marshal_cmd_base cmd_base;
   7824    GLenum target;
   7825    GLuint texture;
   7826 };
   7827 static inline void
   7828 _mesa_unmarshal_BindTexture(struct gl_context *ctx, const struct marshal_cmd_BindTexture *cmd)
   7829 {
   7830    const GLenum target = cmd->target;
   7831    const GLuint texture = cmd->texture;
   7832    CALL_BindTexture(ctx->CurrentServerDispatch, (target, texture));
   7833 }
   7834 static void GLAPIENTRY
   7835 _mesa_marshal_BindTexture(GLenum target, GLuint texture)
   7836 {
   7837    GET_CURRENT_CONTEXT(ctx);
   7838    size_t cmd_size = sizeof(struct marshal_cmd_BindTexture);
   7839    struct marshal_cmd_BindTexture *cmd;
   7840    debug_print_marshal("BindTexture");
   7841    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7842       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindTexture, cmd_size);
   7843       cmd->target = target;
   7844       cmd->texture = texture;
   7845       _mesa_post_marshal_hook(ctx);
   7846       return;
   7847    }
   7848 
   7849    _mesa_glthread_finish(ctx);
   7850    debug_print_sync_fallback("BindTexture");
   7851    CALL_BindTexture(ctx->CurrentServerDispatch, (target, texture));
   7852 }
   7853 
   7854 
   7855 /* MultiTexCoord4fARB: marshalled asynchronously */
   7856 struct marshal_cmd_MultiTexCoord4fARB
   7857 {
   7858    struct marshal_cmd_base cmd_base;
   7859    GLenum target;
   7860    GLfloat s;
   7861    GLfloat t;
   7862    GLfloat r;
   7863    GLfloat q;
   7864 };
   7865 static inline void
   7866 _mesa_unmarshal_MultiTexCoord4fARB(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4fARB *cmd)
   7867 {
   7868    const GLenum target = cmd->target;
   7869    const GLfloat s = cmd->s;
   7870    const GLfloat t = cmd->t;
   7871    const GLfloat r = cmd->r;
   7872    const GLfloat q = cmd->q;
   7873    CALL_MultiTexCoord4fARB(ctx->CurrentServerDispatch, (target, s, t, r, q));
   7874 }
   7875 static void GLAPIENTRY
   7876 _mesa_marshal_MultiTexCoord4fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q)
   7877 {
   7878    GET_CURRENT_CONTEXT(ctx);
   7879    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4fARB);
   7880    struct marshal_cmd_MultiTexCoord4fARB *cmd;
   7881    debug_print_marshal("MultiTexCoord4fARB");
   7882    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7883       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4fARB, cmd_size);
   7884       cmd->target = target;
   7885       cmd->s = s;
   7886       cmd->t = t;
   7887       cmd->r = r;
   7888       cmd->q = q;
   7889       _mesa_post_marshal_hook(ctx);
   7890       return;
   7891    }
   7892 
   7893    _mesa_glthread_finish(ctx);
   7894    debug_print_sync_fallback("MultiTexCoord4fARB");
   7895    CALL_MultiTexCoord4fARB(ctx->CurrentServerDispatch, (target, s, t, r, q));
   7896 }
   7897 
   7898 
   7899 /* Uniform2ui64ARB: marshalled asynchronously */
   7900 struct marshal_cmd_Uniform2ui64ARB
   7901 {
   7902    struct marshal_cmd_base cmd_base;
   7903    GLint location;
   7904    GLuint64 x;
   7905    GLuint64 y;
   7906 };
   7907 static inline void
   7908 _mesa_unmarshal_Uniform2ui64ARB(struct gl_context *ctx, const struct marshal_cmd_Uniform2ui64ARB *cmd)
   7909 {
   7910    const GLint location = cmd->location;
   7911    const GLuint64 x = cmd->x;
   7912    const GLuint64 y = cmd->y;
   7913    CALL_Uniform2ui64ARB(ctx->CurrentServerDispatch, (location, x, y));
   7914 }
   7915 static void GLAPIENTRY
   7916 _mesa_marshal_Uniform2ui64ARB(GLint location, GLuint64 x, GLuint64 y)
   7917 {
   7918    GET_CURRENT_CONTEXT(ctx);
   7919    size_t cmd_size = sizeof(struct marshal_cmd_Uniform2ui64ARB);
   7920    struct marshal_cmd_Uniform2ui64ARB *cmd;
   7921    debug_print_marshal("Uniform2ui64ARB");
   7922    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7923       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2ui64ARB, cmd_size);
   7924       cmd->location = location;
   7925       cmd->x = x;
   7926       cmd->y = y;
   7927       _mesa_post_marshal_hook(ctx);
   7928       return;
   7929    }
   7930 
   7931    _mesa_glthread_finish(ctx);
   7932    debug_print_sync_fallback("Uniform2ui64ARB");
   7933    CALL_Uniform2ui64ARB(ctx->CurrentServerDispatch, (location, x, y));
   7934 }
   7935 
   7936 
   7937 /* MultiTexCoordP2uiv: marshalled synchronously */
   7938 static void GLAPIENTRY
   7939 _mesa_marshal_MultiTexCoordP2uiv(GLenum texture, GLenum type, const GLuint * coords)
   7940 {
   7941    GET_CURRENT_CONTEXT(ctx);
   7942    _mesa_glthread_finish(ctx);
   7943    debug_print_sync("MultiTexCoordP2uiv");
   7944    CALL_MultiTexCoordP2uiv(ctx->CurrentServerDispatch, (texture, type, coords));
   7945 }
   7946 
   7947 
   7948 /* BeginPerfQueryINTEL: marshalled asynchronously */
   7949 struct marshal_cmd_BeginPerfQueryINTEL
   7950 {
   7951    struct marshal_cmd_base cmd_base;
   7952    GLuint queryHandle;
   7953 };
   7954 static inline void
   7955 _mesa_unmarshal_BeginPerfQueryINTEL(struct gl_context *ctx, const struct marshal_cmd_BeginPerfQueryINTEL *cmd)
   7956 {
   7957    const GLuint queryHandle = cmd->queryHandle;
   7958    CALL_BeginPerfQueryINTEL(ctx->CurrentServerDispatch, (queryHandle));
   7959 }
   7960 static void GLAPIENTRY
   7961 _mesa_marshal_BeginPerfQueryINTEL(GLuint queryHandle)
   7962 {
   7963    GET_CURRENT_CONTEXT(ctx);
   7964    size_t cmd_size = sizeof(struct marshal_cmd_BeginPerfQueryINTEL);
   7965    struct marshal_cmd_BeginPerfQueryINTEL *cmd;
   7966    debug_print_marshal("BeginPerfQueryINTEL");
   7967    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   7968       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BeginPerfQueryINTEL, cmd_size);
   7969       cmd->queryHandle = queryHandle;
   7970       _mesa_post_marshal_hook(ctx);
   7971       return;
   7972    }
   7973 
   7974    _mesa_glthread_finish(ctx);
   7975    debug_print_sync_fallback("BeginPerfQueryINTEL");
   7976    CALL_BeginPerfQueryINTEL(ctx->CurrentServerDispatch, (queryHandle));
   7977 }
   7978 
   7979 
   7980 /* NormalPointer: marshalled asynchronously */
   7981 struct marshal_cmd_NormalPointer
   7982 {
   7983    struct marshal_cmd_base cmd_base;
   7984    GLenum type;
   7985    GLsizei stride;
   7986    const GLvoid * pointer;
   7987 };
   7988 static inline void
   7989 _mesa_unmarshal_NormalPointer(struct gl_context *ctx, const struct marshal_cmd_NormalPointer *cmd)
   7990 {
   7991    const GLenum type = cmd->type;
   7992    const GLsizei stride = cmd->stride;
   7993    const GLvoid * pointer = cmd->pointer;
   7994    CALL_NormalPointer(ctx->CurrentServerDispatch, (type, stride, pointer));
   7995 }
   7996 static void GLAPIENTRY
   7997 _mesa_marshal_NormalPointer(GLenum type, GLsizei stride, const GLvoid * pointer)
   7998 {
   7999    GET_CURRENT_CONTEXT(ctx);
   8000    size_t cmd_size = sizeof(struct marshal_cmd_NormalPointer);
   8001    struct marshal_cmd_NormalPointer *cmd;
   8002    debug_print_marshal("NormalPointer");
   8003    if (_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)) {
   8004       _mesa_glthread_finish(ctx);
   8005       _mesa_glthread_restore_dispatch(ctx);
   8006       debug_print_sync_fallback("NormalPointer");
   8007       CALL_NormalPointer(ctx->CurrentServerDispatch, (type, stride, pointer));
   8008       return;
   8009    }
   8010    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8011       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NormalPointer, cmd_size);
   8012       cmd->type = type;
   8013       cmd->stride = stride;
   8014       cmd->pointer = pointer;
   8015       _mesa_post_marshal_hook(ctx);
   8016       return;
   8017    }
   8018 
   8019    _mesa_glthread_finish(ctx);
   8020    debug_print_sync_fallback("NormalPointer");
   8021    CALL_NormalPointer(ctx->CurrentServerDispatch, (type, stride, pointer));
   8022 }
   8023 
   8024 
   8025 /* WindowPos4iMESA: marshalled asynchronously */
   8026 struct marshal_cmd_WindowPos4iMESA
   8027 {
   8028    struct marshal_cmd_base cmd_base;
   8029    GLint x;
   8030    GLint y;
   8031    GLint z;
   8032    GLint w;
   8033 };
   8034 static inline void
   8035 _mesa_unmarshal_WindowPos4iMESA(struct gl_context *ctx, const struct marshal_cmd_WindowPos4iMESA *cmd)
   8036 {
   8037    const GLint x = cmd->x;
   8038    const GLint y = cmd->y;
   8039    const GLint z = cmd->z;
   8040    const GLint w = cmd->w;
   8041    CALL_WindowPos4iMESA(ctx->CurrentServerDispatch, (x, y, z, w));
   8042 }
   8043 static void GLAPIENTRY
   8044 _mesa_marshal_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w)
   8045 {
   8046    GET_CURRENT_CONTEXT(ctx);
   8047    size_t cmd_size = sizeof(struct marshal_cmd_WindowPos4iMESA);
   8048    struct marshal_cmd_WindowPos4iMESA *cmd;
   8049    debug_print_marshal("WindowPos4iMESA");
   8050    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8051       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos4iMESA, cmd_size);
   8052       cmd->x = x;
   8053       cmd->y = y;
   8054       cmd->z = z;
   8055       cmd->w = w;
   8056       _mesa_post_marshal_hook(ctx);
   8057       return;
   8058    }
   8059 
   8060    _mesa_glthread_finish(ctx);
   8061    debug_print_sync_fallback("WindowPos4iMESA");
   8062    CALL_WindowPos4iMESA(ctx->CurrentServerDispatch, (x, y, z, w));
   8063 }
   8064 
   8065 
   8066 /* VertexAttrib4bv: marshalled asynchronously */
   8067 struct marshal_cmd_VertexAttrib4bv
   8068 {
   8069    struct marshal_cmd_base cmd_base;
   8070    GLuint index;
   8071    GLbyte v[4];
   8072 };
   8073 static inline void
   8074 _mesa_unmarshal_VertexAttrib4bv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4bv *cmd)
   8075 {
   8076    const GLuint index = cmd->index;
   8077    const GLbyte * v = cmd->v;
   8078    CALL_VertexAttrib4bv(ctx->CurrentServerDispatch, (index, v));
   8079 }
   8080 static void GLAPIENTRY
   8081 _mesa_marshal_VertexAttrib4bv(GLuint index, const GLbyte * v)
   8082 {
   8083    GET_CURRENT_CONTEXT(ctx);
   8084    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4bv);
   8085    struct marshal_cmd_VertexAttrib4bv *cmd;
   8086    debug_print_marshal("VertexAttrib4bv");
   8087    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8088       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4bv, cmd_size);
   8089       cmd->index = index;
   8090       memcpy(cmd->v, v, 4);
   8091       _mesa_post_marshal_hook(ctx);
   8092       return;
   8093    }
   8094 
   8095    _mesa_glthread_finish(ctx);
   8096    debug_print_sync_fallback("VertexAttrib4bv");
   8097    CALL_VertexAttrib4bv(ctx->CurrentServerDispatch, (index, v));
   8098 }
   8099 
   8100 
   8101 /* SecondaryColor3usv: marshalled asynchronously */
   8102 struct marshal_cmd_SecondaryColor3usv
   8103 {
   8104    struct marshal_cmd_base cmd_base;
   8105    GLushort v[3];
   8106 };
   8107 static inline void
   8108 _mesa_unmarshal_SecondaryColor3usv(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3usv *cmd)
   8109 {
   8110    const GLushort * v = cmd->v;
   8111    CALL_SecondaryColor3usv(ctx->CurrentServerDispatch, (v));
   8112 }
   8113 static void GLAPIENTRY
   8114 _mesa_marshal_SecondaryColor3usv(const GLushort * v)
   8115 {
   8116    GET_CURRENT_CONTEXT(ctx);
   8117    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColor3usv);
   8118    struct marshal_cmd_SecondaryColor3usv *cmd;
   8119    debug_print_marshal("SecondaryColor3usv");
   8120    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8121       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3usv, cmd_size);
   8122       memcpy(cmd->v, v, 6);
   8123       _mesa_post_marshal_hook(ctx);
   8124       return;
   8125    }
   8126 
   8127    _mesa_glthread_finish(ctx);
   8128    debug_print_sync_fallback("SecondaryColor3usv");
   8129    CALL_SecondaryColor3usv(ctx->CurrentServerDispatch, (v));
   8130 }
   8131 
   8132 
   8133 /* GetPixelMapuiv: marshalled synchronously */
   8134 static void GLAPIENTRY
   8135 _mesa_marshal_GetPixelMapuiv(GLenum map, GLuint * values)
   8136 {
   8137    GET_CURRENT_CONTEXT(ctx);
   8138    _mesa_glthread_finish(ctx);
   8139    debug_print_sync("GetPixelMapuiv");
   8140    CALL_GetPixelMapuiv(ctx->CurrentServerDispatch, (map, values));
   8141 }
   8142 
   8143 
   8144 /* MapNamedBuffer: marshalled synchronously */
   8145 static GLvoid * GLAPIENTRY
   8146 _mesa_marshal_MapNamedBuffer(GLuint buffer, GLenum access)
   8147 {
   8148    GET_CURRENT_CONTEXT(ctx);
   8149    _mesa_glthread_finish(ctx);
   8150    debug_print_sync("MapNamedBuffer");
   8151    return CALL_MapNamedBuffer(ctx->CurrentServerDispatch, (buffer, access));
   8152 }
   8153 
   8154 
   8155 /* Indexfv: marshalled asynchronously */
   8156 struct marshal_cmd_Indexfv
   8157 {
   8158    struct marshal_cmd_base cmd_base;
   8159    GLfloat c[1];
   8160 };
   8161 static inline void
   8162 _mesa_unmarshal_Indexfv(struct gl_context *ctx, const struct marshal_cmd_Indexfv *cmd)
   8163 {
   8164    const GLfloat * c = cmd->c;
   8165    CALL_Indexfv(ctx->CurrentServerDispatch, (c));
   8166 }
   8167 static void GLAPIENTRY
   8168 _mesa_marshal_Indexfv(const GLfloat * c)
   8169 {
   8170    GET_CURRENT_CONTEXT(ctx);
   8171    size_t cmd_size = sizeof(struct marshal_cmd_Indexfv);
   8172    struct marshal_cmd_Indexfv *cmd;
   8173    debug_print_marshal("Indexfv");
   8174    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8175       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Indexfv, cmd_size);
   8176       memcpy(cmd->c, c, 4);
   8177       _mesa_post_marshal_hook(ctx);
   8178       return;
   8179    }
   8180 
   8181    _mesa_glthread_finish(ctx);
   8182    debug_print_sync_fallback("Indexfv");
   8183    CALL_Indexfv(ctx->CurrentServerDispatch, (c));
   8184 }
   8185 
   8186 
   8187 /* AlphaFragmentOp1ATI: marshalled asynchronously */
   8188 struct marshal_cmd_AlphaFragmentOp1ATI
   8189 {
   8190    struct marshal_cmd_base cmd_base;
   8191    GLenum op;
   8192    GLuint dst;
   8193    GLuint dstMod;
   8194    GLuint arg1;
   8195    GLuint arg1Rep;
   8196    GLuint arg1Mod;
   8197 };
   8198 static inline void
   8199 _mesa_unmarshal_AlphaFragmentOp1ATI(struct gl_context *ctx, const struct marshal_cmd_AlphaFragmentOp1ATI *cmd)
   8200 {
   8201    const GLenum op = cmd->op;
   8202    const GLuint dst = cmd->dst;
   8203    const GLuint dstMod = cmd->dstMod;
   8204    const GLuint arg1 = cmd->arg1;
   8205    const GLuint arg1Rep = cmd->arg1Rep;
   8206    const GLuint arg1Mod = cmd->arg1Mod;
   8207    CALL_AlphaFragmentOp1ATI(ctx->CurrentServerDispatch, (op, dst, dstMod, arg1, arg1Rep, arg1Mod));
   8208 }
   8209 static void GLAPIENTRY
   8210 _mesa_marshal_AlphaFragmentOp1ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod)
   8211 {
   8212    GET_CURRENT_CONTEXT(ctx);
   8213    size_t cmd_size = sizeof(struct marshal_cmd_AlphaFragmentOp1ATI);
   8214    struct marshal_cmd_AlphaFragmentOp1ATI *cmd;
   8215    debug_print_marshal("AlphaFragmentOp1ATI");
   8216    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8217       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_AlphaFragmentOp1ATI, cmd_size);
   8218       cmd->op = op;
   8219       cmd->dst = dst;
   8220       cmd->dstMod = dstMod;
   8221       cmd->arg1 = arg1;
   8222       cmd->arg1Rep = arg1Rep;
   8223       cmd->arg1Mod = arg1Mod;
   8224       _mesa_post_marshal_hook(ctx);
   8225       return;
   8226    }
   8227 
   8228    _mesa_glthread_finish(ctx);
   8229    debug_print_sync_fallback("AlphaFragmentOp1ATI");
   8230    CALL_AlphaFragmentOp1ATI(ctx->CurrentServerDispatch, (op, dst, dstMod, arg1, arg1Rep, arg1Mod));
   8231 }
   8232 
   8233 
   8234 /* GetFloatv: marshalled synchronously */
   8235 static void GLAPIENTRY
   8236 _mesa_marshal_GetFloatv(GLenum pname, GLfloat * params)
   8237 {
   8238    GET_CURRENT_CONTEXT(ctx);
   8239    _mesa_glthread_finish(ctx);
   8240    debug_print_sync("GetFloatv");
   8241    CALL_GetFloatv(ctx->CurrentServerDispatch, (pname, params));
   8242 }
   8243 
   8244 
   8245 /* ProgramUniform2dv: marshalled asynchronously */
   8246 struct marshal_cmd_ProgramUniform2dv
   8247 {
   8248    struct marshal_cmd_base cmd_base;
   8249    GLuint program;
   8250    GLint location;
   8251    GLsizei count;
   8252    /* Next safe_mul(count, 16) bytes are GLdouble value[count][2] */
   8253 };
   8254 static inline void
   8255 _mesa_unmarshal_ProgramUniform2dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2dv *cmd)
   8256 {
   8257    const GLuint program = cmd->program;
   8258    const GLint location = cmd->location;
   8259    const GLsizei count = cmd->count;
   8260    const GLdouble * value;
   8261    const char *variable_data = (const char *) (cmd + 1);
   8262    value = (const GLdouble *) variable_data;
   8263    variable_data += count * 16;
   8264    CALL_ProgramUniform2dv(ctx->CurrentServerDispatch, (program, location, count, value));
   8265 }
   8266 static void GLAPIENTRY
   8267 _mesa_marshal_ProgramUniform2dv(GLuint program, GLint location, GLsizei count, const GLdouble * value)
   8268 {
   8269    GET_CURRENT_CONTEXT(ctx);
   8270    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform2dv) + safe_mul(count, 16);
   8271    struct marshal_cmd_ProgramUniform2dv *cmd;
   8272    debug_print_marshal("ProgramUniform2dv");
   8273    if (unlikely(safe_mul(count, 16) < 0)) {
   8274       goto fallback_to_sync;
   8275    }
   8276    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8277       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2dv, cmd_size);
   8278       cmd->program = program;
   8279       cmd->location = location;
   8280       cmd->count = count;
   8281       char *variable_data = (char *) (cmd + 1);
   8282       memcpy(variable_data, value, count * 16);
   8283       variable_data += count * 16;
   8284       _mesa_post_marshal_hook(ctx);
   8285       return;
   8286    }
   8287 
   8288 fallback_to_sync:
   8289    _mesa_glthread_finish(ctx);
   8290    debug_print_sync_fallback("ProgramUniform2dv");
   8291    CALL_ProgramUniform2dv(ctx->CurrentServerDispatch, (program, location, count, value));
   8292 }
   8293 
   8294 
   8295 /* MultiTexCoord3i: marshalled asynchronously */
   8296 struct marshal_cmd_MultiTexCoord3i
   8297 {
   8298    struct marshal_cmd_base cmd_base;
   8299    GLenum target;
   8300    GLint s;
   8301    GLint t;
   8302    GLint r;
   8303 };
   8304 static inline void
   8305 _mesa_unmarshal_MultiTexCoord3i(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3i *cmd)
   8306 {
   8307    const GLenum target = cmd->target;
   8308    const GLint s = cmd->s;
   8309    const GLint t = cmd->t;
   8310    const GLint r = cmd->r;
   8311    CALL_MultiTexCoord3i(ctx->CurrentServerDispatch, (target, s, t, r));
   8312 }
   8313 static void GLAPIENTRY
   8314 _mesa_marshal_MultiTexCoord3i(GLenum target, GLint s, GLint t, GLint r)
   8315 {
   8316    GET_CURRENT_CONTEXT(ctx);
   8317    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3i);
   8318    struct marshal_cmd_MultiTexCoord3i *cmd;
   8319    debug_print_marshal("MultiTexCoord3i");
   8320    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8321       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3i, cmd_size);
   8322       cmd->target = target;
   8323       cmd->s = s;
   8324       cmd->t = t;
   8325       cmd->r = r;
   8326       _mesa_post_marshal_hook(ctx);
   8327       return;
   8328    }
   8329 
   8330    _mesa_glthread_finish(ctx);
   8331    debug_print_sync_fallback("MultiTexCoord3i");
   8332    CALL_MultiTexCoord3i(ctx->CurrentServerDispatch, (target, s, t, r));
   8333 }
   8334 
   8335 
   8336 /* ProgramUniform1fv: marshalled asynchronously */
   8337 struct marshal_cmd_ProgramUniform1fv
   8338 {
   8339    struct marshal_cmd_base cmd_base;
   8340    GLuint program;
   8341    GLint location;
   8342    GLsizei count;
   8343    /* Next safe_mul(count, 4) bytes are GLfloat value[count] */
   8344 };
   8345 static inline void
   8346 _mesa_unmarshal_ProgramUniform1fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1fv *cmd)
   8347 {
   8348    const GLuint program = cmd->program;
   8349    const GLint location = cmd->location;
   8350    const GLsizei count = cmd->count;
   8351    const GLfloat * value;
   8352    const char *variable_data = (const char *) (cmd + 1);
   8353    value = (const GLfloat *) variable_data;
   8354    variable_data += count * 4;
   8355    CALL_ProgramUniform1fv(ctx->CurrentServerDispatch, (program, location, count, value));
   8356 }
   8357 static void GLAPIENTRY
   8358 _mesa_marshal_ProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
   8359 {
   8360    GET_CURRENT_CONTEXT(ctx);
   8361    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform1fv) + safe_mul(count, 4);
   8362    struct marshal_cmd_ProgramUniform1fv *cmd;
   8363    debug_print_marshal("ProgramUniform1fv");
   8364    if (unlikely(safe_mul(count, 4) < 0)) {
   8365       goto fallback_to_sync;
   8366    }
   8367    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8368       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1fv, cmd_size);
   8369       cmd->program = program;
   8370       cmd->location = location;
   8371       cmd->count = count;
   8372       char *variable_data = (char *) (cmd + 1);
   8373       memcpy(variable_data, value, count * 4);
   8374       variable_data += count * 4;
   8375       _mesa_post_marshal_hook(ctx);
   8376       return;
   8377    }
   8378 
   8379 fallback_to_sync:
   8380    _mesa_glthread_finish(ctx);
   8381    debug_print_sync_fallback("ProgramUniform1fv");
   8382    CALL_ProgramUniform1fv(ctx->CurrentServerDispatch, (program, location, count, value));
   8383 }
   8384 
   8385 
   8386 /* MultiTexCoord3d: marshalled asynchronously */
   8387 struct marshal_cmd_MultiTexCoord3d
   8388 {
   8389    struct marshal_cmd_base cmd_base;
   8390    GLenum target;
   8391    GLdouble s;
   8392    GLdouble t;
   8393    GLdouble r;
   8394 };
   8395 static inline void
   8396 _mesa_unmarshal_MultiTexCoord3d(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3d *cmd)
   8397 {
   8398    const GLenum target = cmd->target;
   8399    const GLdouble s = cmd->s;
   8400    const GLdouble t = cmd->t;
   8401    const GLdouble r = cmd->r;
   8402    CALL_MultiTexCoord3d(ctx->CurrentServerDispatch, (target, s, t, r));
   8403 }
   8404 static void GLAPIENTRY
   8405 _mesa_marshal_MultiTexCoord3d(GLenum target, GLdouble s, GLdouble t, GLdouble r)
   8406 {
   8407    GET_CURRENT_CONTEXT(ctx);
   8408    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3d);
   8409    struct marshal_cmd_MultiTexCoord3d *cmd;
   8410    debug_print_marshal("MultiTexCoord3d");
   8411    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8412       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3d, cmd_size);
   8413       cmd->target = target;
   8414       cmd->s = s;
   8415       cmd->t = t;
   8416       cmd->r = r;
   8417       _mesa_post_marshal_hook(ctx);
   8418       return;
   8419    }
   8420 
   8421    _mesa_glthread_finish(ctx);
   8422    debug_print_sync_fallback("MultiTexCoord3d");
   8423    CALL_MultiTexCoord3d(ctx->CurrentServerDispatch, (target, s, t, r));
   8424 }
   8425 
   8426 
   8427 /* TexCoord3sv: marshalled asynchronously */
   8428 struct marshal_cmd_TexCoord3sv
   8429 {
   8430    struct marshal_cmd_base cmd_base;
   8431    GLshort v[3];
   8432 };
   8433 static inline void
   8434 _mesa_unmarshal_TexCoord3sv(struct gl_context *ctx, const struct marshal_cmd_TexCoord3sv *cmd)
   8435 {
   8436    const GLshort * v = cmd->v;
   8437    CALL_TexCoord3sv(ctx->CurrentServerDispatch, (v));
   8438 }
   8439 static void GLAPIENTRY
   8440 _mesa_marshal_TexCoord3sv(const GLshort * v)
   8441 {
   8442    GET_CURRENT_CONTEXT(ctx);
   8443    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord3sv);
   8444    struct marshal_cmd_TexCoord3sv *cmd;
   8445    debug_print_marshal("TexCoord3sv");
   8446    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8447       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord3sv, cmd_size);
   8448       memcpy(cmd->v, v, 6);
   8449       _mesa_post_marshal_hook(ctx);
   8450       return;
   8451    }
   8452 
   8453    _mesa_glthread_finish(ctx);
   8454    debug_print_sync_fallback("TexCoord3sv");
   8455    CALL_TexCoord3sv(ctx->CurrentServerDispatch, (v));
   8456 }
   8457 
   8458 
   8459 /* Fogfv: marshalled synchronously */
   8460 static void GLAPIENTRY
   8461 _mesa_marshal_Fogfv(GLenum pname, const GLfloat * params)
   8462 {
   8463    GET_CURRENT_CONTEXT(ctx);
   8464    _mesa_glthread_finish(ctx);
   8465    debug_print_sync("Fogfv");
   8466    CALL_Fogfv(ctx->CurrentServerDispatch, (pname, params));
   8467 }
   8468 
   8469 
   8470 /* Minmax: marshalled asynchronously */
   8471 struct marshal_cmd_Minmax
   8472 {
   8473    struct marshal_cmd_base cmd_base;
   8474    GLenum target;
   8475    GLenum internalformat;
   8476    GLboolean sink;
   8477 };
   8478 static inline void
   8479 _mesa_unmarshal_Minmax(struct gl_context *ctx, const struct marshal_cmd_Minmax *cmd)
   8480 {
   8481    const GLenum target = cmd->target;
   8482    const GLenum internalformat = cmd->internalformat;
   8483    const GLboolean sink = cmd->sink;
   8484    CALL_Minmax(ctx->CurrentServerDispatch, (target, internalformat, sink));
   8485 }
   8486 static void GLAPIENTRY
   8487 _mesa_marshal_Minmax(GLenum target, GLenum internalformat, GLboolean sink)
   8488 {
   8489    GET_CURRENT_CONTEXT(ctx);
   8490    size_t cmd_size = sizeof(struct marshal_cmd_Minmax);
   8491    struct marshal_cmd_Minmax *cmd;
   8492    debug_print_marshal("Minmax");
   8493    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8494       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Minmax, cmd_size);
   8495       cmd->target = target;
   8496       cmd->internalformat = internalformat;
   8497       cmd->sink = sink;
   8498       _mesa_post_marshal_hook(ctx);
   8499       return;
   8500    }
   8501 
   8502    _mesa_glthread_finish(ctx);
   8503    debug_print_sync_fallback("Minmax");
   8504    CALL_Minmax(ctx->CurrentServerDispatch, (target, internalformat, sink));
   8505 }
   8506 
   8507 
   8508 /* MultiTexCoord3s: marshalled asynchronously */
   8509 struct marshal_cmd_MultiTexCoord3s
   8510 {
   8511    struct marshal_cmd_base cmd_base;
   8512    GLenum target;
   8513    GLshort s;
   8514    GLshort t;
   8515    GLshort r;
   8516 };
   8517 static inline void
   8518 _mesa_unmarshal_MultiTexCoord3s(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3s *cmd)
   8519 {
   8520    const GLenum target = cmd->target;
   8521    const GLshort s = cmd->s;
   8522    const GLshort t = cmd->t;
   8523    const GLshort r = cmd->r;
   8524    CALL_MultiTexCoord3s(ctx->CurrentServerDispatch, (target, s, t, r));
   8525 }
   8526 static void GLAPIENTRY
   8527 _mesa_marshal_MultiTexCoord3s(GLenum target, GLshort s, GLshort t, GLshort r)
   8528 {
   8529    GET_CURRENT_CONTEXT(ctx);
   8530    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3s);
   8531    struct marshal_cmd_MultiTexCoord3s *cmd;
   8532    debug_print_marshal("MultiTexCoord3s");
   8533    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8534       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3s, cmd_size);
   8535       cmd->target = target;
   8536       cmd->s = s;
   8537       cmd->t = t;
   8538       cmd->r = r;
   8539       _mesa_post_marshal_hook(ctx);
   8540       return;
   8541    }
   8542 
   8543    _mesa_glthread_finish(ctx);
   8544    debug_print_sync_fallback("MultiTexCoord3s");
   8545    CALL_MultiTexCoord3s(ctx->CurrentServerDispatch, (target, s, t, r));
   8546 }
   8547 
   8548 
   8549 /* Vertex4iv: marshalled asynchronously */
   8550 struct marshal_cmd_Vertex4iv
   8551 {
   8552    struct marshal_cmd_base cmd_base;
   8553    GLint v[4];
   8554 };
   8555 static inline void
   8556 _mesa_unmarshal_Vertex4iv(struct gl_context *ctx, const struct marshal_cmd_Vertex4iv *cmd)
   8557 {
   8558    const GLint * v = cmd->v;
   8559    CALL_Vertex4iv(ctx->CurrentServerDispatch, (v));
   8560 }
   8561 static void GLAPIENTRY
   8562 _mesa_marshal_Vertex4iv(const GLint * v)
   8563 {
   8564    GET_CURRENT_CONTEXT(ctx);
   8565    size_t cmd_size = sizeof(struct marshal_cmd_Vertex4iv);
   8566    struct marshal_cmd_Vertex4iv *cmd;
   8567    debug_print_marshal("Vertex4iv");
   8568    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8569       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex4iv, cmd_size);
   8570       memcpy(cmd->v, v, 16);
   8571       _mesa_post_marshal_hook(ctx);
   8572       return;
   8573    }
   8574 
   8575    _mesa_glthread_finish(ctx);
   8576    debug_print_sync_fallback("Vertex4iv");
   8577    CALL_Vertex4iv(ctx->CurrentServerDispatch, (v));
   8578 }
   8579 
   8580 
   8581 /* TexCoord4dv: marshalled asynchronously */
   8582 struct marshal_cmd_TexCoord4dv
   8583 {
   8584    struct marshal_cmd_base cmd_base;
   8585    GLdouble v[4];
   8586 };
   8587 static inline void
   8588 _mesa_unmarshal_TexCoord4dv(struct gl_context *ctx, const struct marshal_cmd_TexCoord4dv *cmd)
   8589 {
   8590    const GLdouble * v = cmd->v;
   8591    CALL_TexCoord4dv(ctx->CurrentServerDispatch, (v));
   8592 }
   8593 static void GLAPIENTRY
   8594 _mesa_marshal_TexCoord4dv(const GLdouble * v)
   8595 {
   8596    GET_CURRENT_CONTEXT(ctx);
   8597    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord4dv);
   8598    struct marshal_cmd_TexCoord4dv *cmd;
   8599    debug_print_marshal("TexCoord4dv");
   8600    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8601       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord4dv, cmd_size);
   8602       memcpy(cmd->v, v, 32);
   8603       _mesa_post_marshal_hook(ctx);
   8604       return;
   8605    }
   8606 
   8607    _mesa_glthread_finish(ctx);
   8608    debug_print_sync_fallback("TexCoord4dv");
   8609    CALL_TexCoord4dv(ctx->CurrentServerDispatch, (v));
   8610 }
   8611 
   8612 
   8613 /* Begin: marshalled asynchronously */
   8614 struct marshal_cmd_Begin
   8615 {
   8616    struct marshal_cmd_base cmd_base;
   8617    GLenum mode;
   8618 };
   8619 static inline void
   8620 _mesa_unmarshal_Begin(struct gl_context *ctx, const struct marshal_cmd_Begin *cmd)
   8621 {
   8622    const GLenum mode = cmd->mode;
   8623    CALL_Begin(ctx->CurrentServerDispatch, (mode));
   8624 }
   8625 static void GLAPIENTRY
   8626 _mesa_marshal_Begin(GLenum mode)
   8627 {
   8628    GET_CURRENT_CONTEXT(ctx);
   8629    size_t cmd_size = sizeof(struct marshal_cmd_Begin);
   8630    struct marshal_cmd_Begin *cmd;
   8631    debug_print_marshal("Begin");
   8632    if (true) {
   8633       _mesa_glthread_finish(ctx);
   8634       _mesa_glthread_restore_dispatch(ctx);
   8635       debug_print_sync_fallback("Begin");
   8636       CALL_Begin(ctx->CurrentServerDispatch, (mode));
   8637       return;
   8638    }
   8639    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8640       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Begin, cmd_size);
   8641       cmd->mode = mode;
   8642       _mesa_post_marshal_hook(ctx);
   8643       return;
   8644    }
   8645 
   8646    _mesa_glthread_finish(ctx);
   8647    debug_print_sync_fallback("Begin");
   8648    CALL_Begin(ctx->CurrentServerDispatch, (mode));
   8649 }
   8650 
   8651 
   8652 /* LightModeli: marshalled asynchronously */
   8653 struct marshal_cmd_LightModeli
   8654 {
   8655    struct marshal_cmd_base cmd_base;
   8656    GLenum pname;
   8657    GLint param;
   8658 };
   8659 static inline void
   8660 _mesa_unmarshal_LightModeli(struct gl_context *ctx, const struct marshal_cmd_LightModeli *cmd)
   8661 {
   8662    const GLenum pname = cmd->pname;
   8663    const GLint param = cmd->param;
   8664    CALL_LightModeli(ctx->CurrentServerDispatch, (pname, param));
   8665 }
   8666 static void GLAPIENTRY
   8667 _mesa_marshal_LightModeli(GLenum pname, GLint param)
   8668 {
   8669    GET_CURRENT_CONTEXT(ctx);
   8670    size_t cmd_size = sizeof(struct marshal_cmd_LightModeli);
   8671    struct marshal_cmd_LightModeli *cmd;
   8672    debug_print_marshal("LightModeli");
   8673    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8674       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LightModeli, cmd_size);
   8675       cmd->pname = pname;
   8676       cmd->param = param;
   8677       _mesa_post_marshal_hook(ctx);
   8678       return;
   8679    }
   8680 
   8681    _mesa_glthread_finish(ctx);
   8682    debug_print_sync_fallback("LightModeli");
   8683    CALL_LightModeli(ctx->CurrentServerDispatch, (pname, param));
   8684 }
   8685 
   8686 
   8687 /* UniformMatrix2fv: marshalled asynchronously */
   8688 struct marshal_cmd_UniformMatrix2fv
   8689 {
   8690    struct marshal_cmd_base cmd_base;
   8691    GLint location;
   8692    GLsizei count;
   8693    GLboolean transpose;
   8694    /* Next safe_mul(count, 16) bytes are GLfloat value[count][4] */
   8695 };
   8696 static inline void
   8697 _mesa_unmarshal_UniformMatrix2fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2fv *cmd)
   8698 {
   8699    const GLint location = cmd->location;
   8700    const GLsizei count = cmd->count;
   8701    const GLboolean transpose = cmd->transpose;
   8702    const GLfloat * value;
   8703    const char *variable_data = (const char *) (cmd + 1);
   8704    value = (const GLfloat *) variable_data;
   8705    variable_data += count * 16;
   8706    CALL_UniformMatrix2fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   8707 }
   8708 static void GLAPIENTRY
   8709 _mesa_marshal_UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   8710 {
   8711    GET_CURRENT_CONTEXT(ctx);
   8712    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix2fv) + safe_mul(count, 16);
   8713    struct marshal_cmd_UniformMatrix2fv *cmd;
   8714    debug_print_marshal("UniformMatrix2fv");
   8715    if (unlikely(safe_mul(count, 16) < 0)) {
   8716       goto fallback_to_sync;
   8717    }
   8718    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8719       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2fv, cmd_size);
   8720       cmd->location = location;
   8721       cmd->count = count;
   8722       cmd->transpose = transpose;
   8723       char *variable_data = (char *) (cmd + 1);
   8724       memcpy(variable_data, value, count * 16);
   8725       variable_data += count * 16;
   8726       _mesa_post_marshal_hook(ctx);
   8727       return;
   8728    }
   8729 
   8730 fallback_to_sync:
   8731    _mesa_glthread_finish(ctx);
   8732    debug_print_sync_fallback("UniformMatrix2fv");
   8733    CALL_UniformMatrix2fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   8734 }
   8735 
   8736 
   8737 /* LightModelf: marshalled asynchronously */
   8738 struct marshal_cmd_LightModelf
   8739 {
   8740    struct marshal_cmd_base cmd_base;
   8741    GLenum pname;
   8742    GLfloat param;
   8743 };
   8744 static inline void
   8745 _mesa_unmarshal_LightModelf(struct gl_context *ctx, const struct marshal_cmd_LightModelf *cmd)
   8746 {
   8747    const GLenum pname = cmd->pname;
   8748    const GLfloat param = cmd->param;
   8749    CALL_LightModelf(ctx->CurrentServerDispatch, (pname, param));
   8750 }
   8751 static void GLAPIENTRY
   8752 _mesa_marshal_LightModelf(GLenum pname, GLfloat param)
   8753 {
   8754    GET_CURRENT_CONTEXT(ctx);
   8755    size_t cmd_size = sizeof(struct marshal_cmd_LightModelf);
   8756    struct marshal_cmd_LightModelf *cmd;
   8757    debug_print_marshal("LightModelf");
   8758    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8759       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LightModelf, cmd_size);
   8760       cmd->pname = pname;
   8761       cmd->param = param;
   8762       _mesa_post_marshal_hook(ctx);
   8763       return;
   8764    }
   8765 
   8766    _mesa_glthread_finish(ctx);
   8767    debug_print_sync_fallback("LightModelf");
   8768    CALL_LightModelf(ctx->CurrentServerDispatch, (pname, param));
   8769 }
   8770 
   8771 
   8772 /* GetTexParameterfv: marshalled synchronously */
   8773 static void GLAPIENTRY
   8774 _mesa_marshal_GetTexParameterfv(GLenum target, GLenum pname, GLfloat * params)
   8775 {
   8776    GET_CURRENT_CONTEXT(ctx);
   8777    _mesa_glthread_finish(ctx);
   8778    debug_print_sync("GetTexParameterfv");
   8779    CALL_GetTexParameterfv(ctx->CurrentServerDispatch, (target, pname, params));
   8780 }
   8781 
   8782 
   8783 /* TextureStorage1D: marshalled asynchronously */
   8784 struct marshal_cmd_TextureStorage1D
   8785 {
   8786    struct marshal_cmd_base cmd_base;
   8787    GLuint texture;
   8788    GLsizei levels;
   8789    GLenum internalformat;
   8790    GLsizei width;
   8791 };
   8792 static inline void
   8793 _mesa_unmarshal_TextureStorage1D(struct gl_context *ctx, const struct marshal_cmd_TextureStorage1D *cmd)
   8794 {
   8795    const GLuint texture = cmd->texture;
   8796    const GLsizei levels = cmd->levels;
   8797    const GLenum internalformat = cmd->internalformat;
   8798    const GLsizei width = cmd->width;
   8799    CALL_TextureStorage1D(ctx->CurrentServerDispatch, (texture, levels, internalformat, width));
   8800 }
   8801 static void GLAPIENTRY
   8802 _mesa_marshal_TextureStorage1D(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width)
   8803 {
   8804    GET_CURRENT_CONTEXT(ctx);
   8805    size_t cmd_size = sizeof(struct marshal_cmd_TextureStorage1D);
   8806    struct marshal_cmd_TextureStorage1D *cmd;
   8807    debug_print_marshal("TextureStorage1D");
   8808    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8809       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage1D, cmd_size);
   8810       cmd->texture = texture;
   8811       cmd->levels = levels;
   8812       cmd->internalformat = internalformat;
   8813       cmd->width = width;
   8814       _mesa_post_marshal_hook(ctx);
   8815       return;
   8816    }
   8817 
   8818    _mesa_glthread_finish(ctx);
   8819    debug_print_sync_fallback("TextureStorage1D");
   8820    CALL_TextureStorage1D(ctx->CurrentServerDispatch, (texture, levels, internalformat, width));
   8821 }
   8822 
   8823 
   8824 /* MultiTexCoord2fvARB: marshalled asynchronously */
   8825 struct marshal_cmd_MultiTexCoord2fvARB
   8826 {
   8827    struct marshal_cmd_base cmd_base;
   8828    GLenum target;
   8829    GLfloat v[2];
   8830 };
   8831 static inline void
   8832 _mesa_unmarshal_MultiTexCoord2fvARB(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2fvARB *cmd)
   8833 {
   8834    const GLenum target = cmd->target;
   8835    const GLfloat * v = cmd->v;
   8836    CALL_MultiTexCoord2fvARB(ctx->CurrentServerDispatch, (target, v));
   8837 }
   8838 static void GLAPIENTRY
   8839 _mesa_marshal_MultiTexCoord2fvARB(GLenum target, const GLfloat * v)
   8840 {
   8841    GET_CURRENT_CONTEXT(ctx);
   8842    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2fvARB);
   8843    struct marshal_cmd_MultiTexCoord2fvARB *cmd;
   8844    debug_print_marshal("MultiTexCoord2fvARB");
   8845    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8846       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2fvARB, cmd_size);
   8847       cmd->target = target;
   8848       memcpy(cmd->v, v, 8);
   8849       _mesa_post_marshal_hook(ctx);
   8850       return;
   8851    }
   8852 
   8853    _mesa_glthread_finish(ctx);
   8854    debug_print_sync_fallback("MultiTexCoord2fvARB");
   8855    CALL_MultiTexCoord2fvARB(ctx->CurrentServerDispatch, (target, v));
   8856 }
   8857 
   8858 
   8859 /* VertexAttrib4ubv: marshalled asynchronously */
   8860 struct marshal_cmd_VertexAttrib4ubv
   8861 {
   8862    struct marshal_cmd_base cmd_base;
   8863    GLuint index;
   8864    GLubyte v[4];
   8865 };
   8866 static inline void
   8867 _mesa_unmarshal_VertexAttrib4ubv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4ubv *cmd)
   8868 {
   8869    const GLuint index = cmd->index;
   8870    const GLubyte * v = cmd->v;
   8871    CALL_VertexAttrib4ubv(ctx->CurrentServerDispatch, (index, v));
   8872 }
   8873 static void GLAPIENTRY
   8874 _mesa_marshal_VertexAttrib4ubv(GLuint index, const GLubyte * v)
   8875 {
   8876    GET_CURRENT_CONTEXT(ctx);
   8877    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4ubv);
   8878    struct marshal_cmd_VertexAttrib4ubv *cmd;
   8879    debug_print_marshal("VertexAttrib4ubv");
   8880    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8881       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4ubv, cmd_size);
   8882       cmd->index = index;
   8883       memcpy(cmd->v, v, 4);
   8884       _mesa_post_marshal_hook(ctx);
   8885       return;
   8886    }
   8887 
   8888    _mesa_glthread_finish(ctx);
   8889    debug_print_sync_fallback("VertexAttrib4ubv");
   8890    CALL_VertexAttrib4ubv(ctx->CurrentServerDispatch, (index, v));
   8891 }
   8892 
   8893 
   8894 /* GetnTexImageARB: marshalled synchronously */
   8895 static void GLAPIENTRY
   8896 _mesa_marshal_GetnTexImageARB(GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, GLvoid * img)
   8897 {
   8898    GET_CURRENT_CONTEXT(ctx);
   8899    _mesa_glthread_finish(ctx);
   8900    debug_print_sync("GetnTexImageARB");
   8901    CALL_GetnTexImageARB(ctx->CurrentServerDispatch, (target, level, format, type, bufSize, img));
   8902 }
   8903 
   8904 
   8905 /* ColorMask: marshalled asynchronously */
   8906 struct marshal_cmd_ColorMask
   8907 {
   8908    struct marshal_cmd_base cmd_base;
   8909    GLboolean red;
   8910    GLboolean green;
   8911    GLboolean blue;
   8912    GLboolean alpha;
   8913 };
   8914 static inline void
   8915 _mesa_unmarshal_ColorMask(struct gl_context *ctx, const struct marshal_cmd_ColorMask *cmd)
   8916 {
   8917    const GLboolean red = cmd->red;
   8918    const GLboolean green = cmd->green;
   8919    const GLboolean blue = cmd->blue;
   8920    const GLboolean alpha = cmd->alpha;
   8921    CALL_ColorMask(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   8922 }
   8923 static void GLAPIENTRY
   8924 _mesa_marshal_ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
   8925 {
   8926    GET_CURRENT_CONTEXT(ctx);
   8927    size_t cmd_size = sizeof(struct marshal_cmd_ColorMask);
   8928    struct marshal_cmd_ColorMask *cmd;
   8929    debug_print_marshal("ColorMask");
   8930    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8931       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorMask, cmd_size);
   8932       cmd->red = red;
   8933       cmd->green = green;
   8934       cmd->blue = blue;
   8935       cmd->alpha = alpha;
   8936       _mesa_post_marshal_hook(ctx);
   8937       return;
   8938    }
   8939 
   8940    _mesa_glthread_finish(ctx);
   8941    debug_print_sync_fallback("ColorMask");
   8942    CALL_ColorMask(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   8943 }
   8944 
   8945 
   8946 /* MultiTexCoord4x: marshalled asynchronously */
   8947 struct marshal_cmd_MultiTexCoord4x
   8948 {
   8949    struct marshal_cmd_base cmd_base;
   8950    GLenum target;
   8951    GLfixed s;
   8952    GLfixed t;
   8953    GLfixed r;
   8954    GLfixed q;
   8955 };
   8956 static inline void
   8957 _mesa_unmarshal_MultiTexCoord4x(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4x *cmd)
   8958 {
   8959    const GLenum target = cmd->target;
   8960    const GLfixed s = cmd->s;
   8961    const GLfixed t = cmd->t;
   8962    const GLfixed r = cmd->r;
   8963    const GLfixed q = cmd->q;
   8964    CALL_MultiTexCoord4x(ctx->CurrentServerDispatch, (target, s, t, r, q));
   8965 }
   8966 static void GLAPIENTRY
   8967 _mesa_marshal_MultiTexCoord4x(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)
   8968 {
   8969    GET_CURRENT_CONTEXT(ctx);
   8970    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4x);
   8971    struct marshal_cmd_MultiTexCoord4x *cmd;
   8972    debug_print_marshal("MultiTexCoord4x");
   8973    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   8974       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4x, cmd_size);
   8975       cmd->target = target;
   8976       cmd->s = s;
   8977       cmd->t = t;
   8978       cmd->r = r;
   8979       cmd->q = q;
   8980       _mesa_post_marshal_hook(ctx);
   8981       return;
   8982    }
   8983 
   8984    _mesa_glthread_finish(ctx);
   8985    debug_print_sync_fallback("MultiTexCoord4x");
   8986    CALL_MultiTexCoord4x(ctx->CurrentServerDispatch, (target, s, t, r, q));
   8987 }
   8988 
   8989 
   8990 /* UniformHandleui64ARB: marshalled asynchronously */
   8991 struct marshal_cmd_UniformHandleui64ARB
   8992 {
   8993    struct marshal_cmd_base cmd_base;
   8994    GLint location;
   8995    GLuint64 value;
   8996 };
   8997 static inline void
   8998 _mesa_unmarshal_UniformHandleui64ARB(struct gl_context *ctx, const struct marshal_cmd_UniformHandleui64ARB *cmd)
   8999 {
   9000    const GLint location = cmd->location;
   9001    const GLuint64 value = cmd->value;
   9002    CALL_UniformHandleui64ARB(ctx->CurrentServerDispatch, (location, value));
   9003 }
   9004 static void GLAPIENTRY
   9005 _mesa_marshal_UniformHandleui64ARB(GLint location, GLuint64 value)
   9006 {
   9007    GET_CURRENT_CONTEXT(ctx);
   9008    size_t cmd_size = sizeof(struct marshal_cmd_UniformHandleui64ARB);
   9009    struct marshal_cmd_UniformHandleui64ARB *cmd;
   9010    debug_print_marshal("UniformHandleui64ARB");
   9011    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9012       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformHandleui64ARB, cmd_size);
   9013       cmd->location = location;
   9014       cmd->value = value;
   9015       _mesa_post_marshal_hook(ctx);
   9016       return;
   9017    }
   9018 
   9019    _mesa_glthread_finish(ctx);
   9020    debug_print_sync_fallback("UniformHandleui64ARB");
   9021    CALL_UniformHandleui64ARB(ctx->CurrentServerDispatch, (location, value));
   9022 }
   9023 
   9024 
   9025 /* VertexAttribs4svNV: marshalled asynchronously */
   9026 struct marshal_cmd_VertexAttribs4svNV
   9027 {
   9028    struct marshal_cmd_base cmd_base;
   9029    GLuint index;
   9030    GLsizei n;
   9031    /* Next safe_mul(n, 8) bytes are GLshort v[n][4] */
   9032 };
   9033 static inline void
   9034 _mesa_unmarshal_VertexAttribs4svNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs4svNV *cmd)
   9035 {
   9036    const GLuint index = cmd->index;
   9037    const GLsizei n = cmd->n;
   9038    const GLshort * v;
   9039    const char *variable_data = (const char *) (cmd + 1);
   9040    v = (const GLshort *) variable_data;
   9041    variable_data += n * 8;
   9042    CALL_VertexAttribs4svNV(ctx->CurrentServerDispatch, (index, n, v));
   9043 }
   9044 static void GLAPIENTRY
   9045 _mesa_marshal_VertexAttribs4svNV(GLuint index, GLsizei n, const GLshort * v)
   9046 {
   9047    GET_CURRENT_CONTEXT(ctx);
   9048    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribs4svNV) + safe_mul(n, 8);
   9049    struct marshal_cmd_VertexAttribs4svNV *cmd;
   9050    debug_print_marshal("VertexAttribs4svNV");
   9051    if (unlikely(safe_mul(n, 8) < 0)) {
   9052       goto fallback_to_sync;
   9053    }
   9054    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9055       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs4svNV, cmd_size);
   9056       cmd->index = index;
   9057       cmd->n = n;
   9058       char *variable_data = (char *) (cmd + 1);
   9059       memcpy(variable_data, v, n * 8);
   9060       variable_data += n * 8;
   9061       _mesa_post_marshal_hook(ctx);
   9062       return;
   9063    }
   9064 
   9065 fallback_to_sync:
   9066    _mesa_glthread_finish(ctx);
   9067    debug_print_sync_fallback("VertexAttribs4svNV");
   9068    CALL_VertexAttribs4svNV(ctx->CurrentServerDispatch, (index, n, v));
   9069 }
   9070 
   9071 
   9072 /* DrawElementsInstancedBaseInstance: marshalled asynchronously */
   9073 struct marshal_cmd_DrawElementsInstancedBaseInstance
   9074 {
   9075    struct marshal_cmd_base cmd_base;
   9076    GLenum mode;
   9077    GLsizei count;
   9078    GLenum type;
   9079    const GLvoid * indices;
   9080    GLsizei primcount;
   9081    GLuint baseinstance;
   9082 };
   9083 static inline void
   9084 _mesa_unmarshal_DrawElementsInstancedBaseInstance(struct gl_context *ctx, const struct marshal_cmd_DrawElementsInstancedBaseInstance *cmd)
   9085 {
   9086    const GLenum mode = cmd->mode;
   9087    const GLsizei count = cmd->count;
   9088    const GLenum type = cmd->type;
   9089    const GLvoid * indices = cmd->indices;
   9090    const GLsizei primcount = cmd->primcount;
   9091    const GLuint baseinstance = cmd->baseinstance;
   9092    CALL_DrawElementsInstancedBaseInstance(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount, baseinstance));
   9093 }
   9094 static void GLAPIENTRY
   9095 _mesa_marshal_DrawElementsInstancedBaseInstance(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount, GLuint baseinstance)
   9096 {
   9097    GET_CURRENT_CONTEXT(ctx);
   9098    size_t cmd_size = sizeof(struct marshal_cmd_DrawElementsInstancedBaseInstance);
   9099    struct marshal_cmd_DrawElementsInstancedBaseInstance *cmd;
   9100    debug_print_marshal("DrawElementsInstancedBaseInstance");
   9101    if (_mesa_glthread_is_non_vbo_draw_elements(ctx)) {
   9102       _mesa_glthread_finish(ctx);
   9103       _mesa_glthread_restore_dispatch(ctx);
   9104       debug_print_sync_fallback("DrawElementsInstancedBaseInstance");
   9105       CALL_DrawElementsInstancedBaseInstance(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount, baseinstance));
   9106       return;
   9107    }
   9108    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9109       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawElementsInstancedBaseInstance, cmd_size);
   9110       cmd->mode = mode;
   9111       cmd->count = count;
   9112       cmd->type = type;
   9113       cmd->indices = indices;
   9114       cmd->primcount = primcount;
   9115       cmd->baseinstance = baseinstance;
   9116       _mesa_post_marshal_hook(ctx);
   9117       return;
   9118    }
   9119 
   9120    _mesa_glthread_finish(ctx);
   9121    debug_print_sync_fallback("DrawElementsInstancedBaseInstance");
   9122    CALL_DrawElementsInstancedBaseInstance(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount, baseinstance));
   9123 }
   9124 
   9125 
   9126 /* UniformMatrix4fv: marshalled asynchronously */
   9127 struct marshal_cmd_UniformMatrix4fv
   9128 {
   9129    struct marshal_cmd_base cmd_base;
   9130    GLint location;
   9131    GLsizei count;
   9132    GLboolean transpose;
   9133    /* Next safe_mul(count, 64) bytes are GLfloat value[count][16] */
   9134 };
   9135 static inline void
   9136 _mesa_unmarshal_UniformMatrix4fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4fv *cmd)
   9137 {
   9138    const GLint location = cmd->location;
   9139    const GLsizei count = cmd->count;
   9140    const GLboolean transpose = cmd->transpose;
   9141    const GLfloat * value;
   9142    const char *variable_data = (const char *) (cmd + 1);
   9143    value = (const GLfloat *) variable_data;
   9144    variable_data += count * 64;
   9145    CALL_UniformMatrix4fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   9146 }
   9147 static void GLAPIENTRY
   9148 _mesa_marshal_UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   9149 {
   9150    GET_CURRENT_CONTEXT(ctx);
   9151    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix4fv) + safe_mul(count, 64);
   9152    struct marshal_cmd_UniformMatrix4fv *cmd;
   9153    debug_print_marshal("UniformMatrix4fv");
   9154    if (unlikely(safe_mul(count, 64) < 0)) {
   9155       goto fallback_to_sync;
   9156    }
   9157    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9158       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4fv, cmd_size);
   9159       cmd->location = location;
   9160       cmd->count = count;
   9161       cmd->transpose = transpose;
   9162       char *variable_data = (char *) (cmd + 1);
   9163       memcpy(variable_data, value, count * 64);
   9164       variable_data += count * 64;
   9165       _mesa_post_marshal_hook(ctx);
   9166       return;
   9167    }
   9168 
   9169 fallback_to_sync:
   9170    _mesa_glthread_finish(ctx);
   9171    debug_print_sync_fallback("UniformMatrix4fv");
   9172    CALL_UniformMatrix4fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   9173 }
   9174 
   9175 
   9176 /* UniformMatrix3x2fv: marshalled asynchronously */
   9177 struct marshal_cmd_UniformMatrix3x2fv
   9178 {
   9179    struct marshal_cmd_base cmd_base;
   9180    GLint location;
   9181    GLsizei count;
   9182    GLboolean transpose;
   9183    /* Next safe_mul(count, 24) bytes are GLfloat value[count][6] */
   9184 };
   9185 static inline void
   9186 _mesa_unmarshal_UniformMatrix3x2fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3x2fv *cmd)
   9187 {
   9188    const GLint location = cmd->location;
   9189    const GLsizei count = cmd->count;
   9190    const GLboolean transpose = cmd->transpose;
   9191    const GLfloat * value;
   9192    const char *variable_data = (const char *) (cmd + 1);
   9193    value = (const GLfloat *) variable_data;
   9194    variable_data += count * 24;
   9195    CALL_UniformMatrix3x2fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   9196 }
   9197 static void GLAPIENTRY
   9198 _mesa_marshal_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   9199 {
   9200    GET_CURRENT_CONTEXT(ctx);
   9201    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix3x2fv) + safe_mul(count, 24);
   9202    struct marshal_cmd_UniformMatrix3x2fv *cmd;
   9203    debug_print_marshal("UniformMatrix3x2fv");
   9204    if (unlikely(safe_mul(count, 24) < 0)) {
   9205       goto fallback_to_sync;
   9206    }
   9207    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9208       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3x2fv, cmd_size);
   9209       cmd->location = location;
   9210       cmd->count = count;
   9211       cmd->transpose = transpose;
   9212       char *variable_data = (char *) (cmd + 1);
   9213       memcpy(variable_data, value, count * 24);
   9214       variable_data += count * 24;
   9215       _mesa_post_marshal_hook(ctx);
   9216       return;
   9217    }
   9218 
   9219 fallback_to_sync:
   9220    _mesa_glthread_finish(ctx);
   9221    debug_print_sync_fallback("UniformMatrix3x2fv");
   9222    CALL_UniformMatrix3x2fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   9223 }
   9224 
   9225 
   9226 /* VertexAttrib4Nuiv: marshalled asynchronously */
   9227 struct marshal_cmd_VertexAttrib4Nuiv
   9228 {
   9229    struct marshal_cmd_base cmd_base;
   9230    GLuint index;
   9231    GLuint v[4];
   9232 };
   9233 static inline void
   9234 _mesa_unmarshal_VertexAttrib4Nuiv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nuiv *cmd)
   9235 {
   9236    const GLuint index = cmd->index;
   9237    const GLuint * v = cmd->v;
   9238    CALL_VertexAttrib4Nuiv(ctx->CurrentServerDispatch, (index, v));
   9239 }
   9240 static void GLAPIENTRY
   9241 _mesa_marshal_VertexAttrib4Nuiv(GLuint index, const GLuint * v)
   9242 {
   9243    GET_CURRENT_CONTEXT(ctx);
   9244    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nuiv);
   9245    struct marshal_cmd_VertexAttrib4Nuiv *cmd;
   9246    debug_print_marshal("VertexAttrib4Nuiv");
   9247    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9248       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nuiv, cmd_size);
   9249       cmd->index = index;
   9250       memcpy(cmd->v, v, 16);
   9251       _mesa_post_marshal_hook(ctx);
   9252       return;
   9253    }
   9254 
   9255    _mesa_glthread_finish(ctx);
   9256    debug_print_sync_fallback("VertexAttrib4Nuiv");
   9257    CALL_VertexAttrib4Nuiv(ctx->CurrentServerDispatch, (index, v));
   9258 }
   9259 
   9260 
   9261 /* ClientActiveTexture: marshalled asynchronously */
   9262 struct marshal_cmd_ClientActiveTexture
   9263 {
   9264    struct marshal_cmd_base cmd_base;
   9265    GLenum texture;
   9266 };
   9267 static inline void
   9268 _mesa_unmarshal_ClientActiveTexture(struct gl_context *ctx, const struct marshal_cmd_ClientActiveTexture *cmd)
   9269 {
   9270    const GLenum texture = cmd->texture;
   9271    CALL_ClientActiveTexture(ctx->CurrentServerDispatch, (texture));
   9272 }
   9273 static void GLAPIENTRY
   9274 _mesa_marshal_ClientActiveTexture(GLenum texture)
   9275 {
   9276    GET_CURRENT_CONTEXT(ctx);
   9277    size_t cmd_size = sizeof(struct marshal_cmd_ClientActiveTexture);
   9278    struct marshal_cmd_ClientActiveTexture *cmd;
   9279    debug_print_marshal("ClientActiveTexture");
   9280    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9281       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClientActiveTexture, cmd_size);
   9282       cmd->texture = texture;
   9283       _mesa_post_marshal_hook(ctx);
   9284       return;
   9285    }
   9286 
   9287    _mesa_glthread_finish(ctx);
   9288    debug_print_sync_fallback("ClientActiveTexture");
   9289    CALL_ClientActiveTexture(ctx->CurrentServerDispatch, (texture));
   9290 }
   9291 
   9292 
   9293 /* GetUniformIndices: marshalled synchronously */
   9294 static void GLAPIENTRY
   9295 _mesa_marshal_GetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar * const * uniformNames, GLuint * uniformIndices)
   9296 {
   9297    GET_CURRENT_CONTEXT(ctx);
   9298    _mesa_glthread_finish(ctx);
   9299    debug_print_sync("GetUniformIndices");
   9300    CALL_GetUniformIndices(ctx->CurrentServerDispatch, (program, uniformCount, uniformNames, uniformIndices));
   9301 }
   9302 
   9303 
   9304 /* MultiTexCoord2sv: marshalled asynchronously */
   9305 struct marshal_cmd_MultiTexCoord2sv
   9306 {
   9307    struct marshal_cmd_base cmd_base;
   9308    GLenum target;
   9309    GLshort v[2];
   9310 };
   9311 static inline void
   9312 _mesa_unmarshal_MultiTexCoord2sv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2sv *cmd)
   9313 {
   9314    const GLenum target = cmd->target;
   9315    const GLshort * v = cmd->v;
   9316    CALL_MultiTexCoord2sv(ctx->CurrentServerDispatch, (target, v));
   9317 }
   9318 static void GLAPIENTRY
   9319 _mesa_marshal_MultiTexCoord2sv(GLenum target, const GLshort * v)
   9320 {
   9321    GET_CURRENT_CONTEXT(ctx);
   9322    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2sv);
   9323    struct marshal_cmd_MultiTexCoord2sv *cmd;
   9324    debug_print_marshal("MultiTexCoord2sv");
   9325    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9326       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2sv, cmd_size);
   9327       cmd->target = target;
   9328       memcpy(cmd->v, v, 4);
   9329       _mesa_post_marshal_hook(ctx);
   9330       return;
   9331    }
   9332 
   9333    _mesa_glthread_finish(ctx);
   9334    debug_print_sync_fallback("MultiTexCoord2sv");
   9335    CALL_MultiTexCoord2sv(ctx->CurrentServerDispatch, (target, v));
   9336 }
   9337 
   9338 
   9339 /* NamedBufferStorage: marshalled synchronously */
   9340 static void GLAPIENTRY
   9341 _mesa_marshal_NamedBufferStorage(GLuint buffer, GLsizeiptr size, const GLvoid * data, GLbitfield flags)
   9342 {
   9343    GET_CURRENT_CONTEXT(ctx);
   9344    _mesa_glthread_finish(ctx);
   9345    debug_print_sync("NamedBufferStorage");
   9346    CALL_NamedBufferStorage(ctx->CurrentServerDispatch, (buffer, size, data, flags));
   9347 }
   9348 
   9349 
   9350 /* NamedFramebufferDrawBuffer: marshalled asynchronously */
   9351 struct marshal_cmd_NamedFramebufferDrawBuffer
   9352 {
   9353    struct marshal_cmd_base cmd_base;
   9354    GLuint framebuffer;
   9355    GLenum buf;
   9356 };
   9357 static inline void
   9358 _mesa_unmarshal_NamedFramebufferDrawBuffer(struct gl_context *ctx, const struct marshal_cmd_NamedFramebufferDrawBuffer *cmd)
   9359 {
   9360    const GLuint framebuffer = cmd->framebuffer;
   9361    const GLenum buf = cmd->buf;
   9362    CALL_NamedFramebufferDrawBuffer(ctx->CurrentServerDispatch, (framebuffer, buf));
   9363 }
   9364 static void GLAPIENTRY
   9365 _mesa_marshal_NamedFramebufferDrawBuffer(GLuint framebuffer, GLenum buf)
   9366 {
   9367    GET_CURRENT_CONTEXT(ctx);
   9368    size_t cmd_size = sizeof(struct marshal_cmd_NamedFramebufferDrawBuffer);
   9369    struct marshal_cmd_NamedFramebufferDrawBuffer *cmd;
   9370    debug_print_marshal("NamedFramebufferDrawBuffer");
   9371    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9372       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedFramebufferDrawBuffer, cmd_size);
   9373       cmd->framebuffer = framebuffer;
   9374       cmd->buf = buf;
   9375       _mesa_post_marshal_hook(ctx);
   9376       return;
   9377    }
   9378 
   9379    _mesa_glthread_finish(ctx);
   9380    debug_print_sync_fallback("NamedFramebufferDrawBuffer");
   9381    CALL_NamedFramebufferDrawBuffer(ctx->CurrentServerDispatch, (framebuffer, buf));
   9382 }
   9383 
   9384 
   9385 /* NamedFramebufferTextureLayer: marshalled asynchronously */
   9386 struct marshal_cmd_NamedFramebufferTextureLayer
   9387 {
   9388    struct marshal_cmd_base cmd_base;
   9389    GLuint framebuffer;
   9390    GLenum attachment;
   9391    GLuint texture;
   9392    GLint level;
   9393    GLint layer;
   9394 };
   9395 static inline void
   9396 _mesa_unmarshal_NamedFramebufferTextureLayer(struct gl_context *ctx, const struct marshal_cmd_NamedFramebufferTextureLayer *cmd)
   9397 {
   9398    const GLuint framebuffer = cmd->framebuffer;
   9399    const GLenum attachment = cmd->attachment;
   9400    const GLuint texture = cmd->texture;
   9401    const GLint level = cmd->level;
   9402    const GLint layer = cmd->layer;
   9403    CALL_NamedFramebufferTextureLayer(ctx->CurrentServerDispatch, (framebuffer, attachment, texture, level, layer));
   9404 }
   9405 static void GLAPIENTRY
   9406 _mesa_marshal_NamedFramebufferTextureLayer(GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer)
   9407 {
   9408    GET_CURRENT_CONTEXT(ctx);
   9409    size_t cmd_size = sizeof(struct marshal_cmd_NamedFramebufferTextureLayer);
   9410    struct marshal_cmd_NamedFramebufferTextureLayer *cmd;
   9411    debug_print_marshal("NamedFramebufferTextureLayer");
   9412    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9413       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedFramebufferTextureLayer, cmd_size);
   9414       cmd->framebuffer = framebuffer;
   9415       cmd->attachment = attachment;
   9416       cmd->texture = texture;
   9417       cmd->level = level;
   9418       cmd->layer = layer;
   9419       _mesa_post_marshal_hook(ctx);
   9420       return;
   9421    }
   9422 
   9423    _mesa_glthread_finish(ctx);
   9424    debug_print_sync_fallback("NamedFramebufferTextureLayer");
   9425    CALL_NamedFramebufferTextureLayer(ctx->CurrentServerDispatch, (framebuffer, attachment, texture, level, layer));
   9426 }
   9427 
   9428 
   9429 /* LoadIdentity: marshalled asynchronously */
   9430 struct marshal_cmd_LoadIdentity
   9431 {
   9432    struct marshal_cmd_base cmd_base;
   9433 };
   9434 static inline void
   9435 _mesa_unmarshal_LoadIdentity(struct gl_context *ctx, const struct marshal_cmd_LoadIdentity *cmd)
   9436 {
   9437    CALL_LoadIdentity(ctx->CurrentServerDispatch, ());
   9438 }
   9439 static void GLAPIENTRY
   9440 _mesa_marshal_LoadIdentity(void)
   9441 {
   9442    GET_CURRENT_CONTEXT(ctx);
   9443    size_t cmd_size = sizeof(struct marshal_cmd_LoadIdentity);
   9444    struct marshal_cmd_LoadIdentity *cmd;
   9445    debug_print_marshal("LoadIdentity");
   9446    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9447       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LoadIdentity, cmd_size);
   9448       (void) cmd;
   9449 
   9450       _mesa_post_marshal_hook(ctx);
   9451       return;
   9452    }
   9453 
   9454    _mesa_glthread_finish(ctx);
   9455    debug_print_sync_fallback("LoadIdentity");
   9456    CALL_LoadIdentity(ctx->CurrentServerDispatch, ());
   9457 }
   9458 
   9459 
   9460 /* ActiveShaderProgram: marshalled asynchronously */
   9461 struct marshal_cmd_ActiveShaderProgram
   9462 {
   9463    struct marshal_cmd_base cmd_base;
   9464    GLuint pipeline;
   9465    GLuint program;
   9466 };
   9467 static inline void
   9468 _mesa_unmarshal_ActiveShaderProgram(struct gl_context *ctx, const struct marshal_cmd_ActiveShaderProgram *cmd)
   9469 {
   9470    const GLuint pipeline = cmd->pipeline;
   9471    const GLuint program = cmd->program;
   9472    CALL_ActiveShaderProgram(ctx->CurrentServerDispatch, (pipeline, program));
   9473 }
   9474 static void GLAPIENTRY
   9475 _mesa_marshal_ActiveShaderProgram(GLuint pipeline, GLuint program)
   9476 {
   9477    GET_CURRENT_CONTEXT(ctx);
   9478    size_t cmd_size = sizeof(struct marshal_cmd_ActiveShaderProgram);
   9479    struct marshal_cmd_ActiveShaderProgram *cmd;
   9480    debug_print_marshal("ActiveShaderProgram");
   9481    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9482       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ActiveShaderProgram, cmd_size);
   9483       cmd->pipeline = pipeline;
   9484       cmd->program = program;
   9485       _mesa_post_marshal_hook(ctx);
   9486       return;
   9487    }
   9488 
   9489    _mesa_glthread_finish(ctx);
   9490    debug_print_sync_fallback("ActiveShaderProgram");
   9491    CALL_ActiveShaderProgram(ctx->CurrentServerDispatch, (pipeline, program));
   9492 }
   9493 
   9494 
   9495 /* BindImageTextures: marshalled synchronously */
   9496 static void GLAPIENTRY
   9497 _mesa_marshal_BindImageTextures(GLuint first, GLsizei count, const GLuint * textures)
   9498 {
   9499    GET_CURRENT_CONTEXT(ctx);
   9500    _mesa_glthread_finish(ctx);
   9501    debug_print_sync("BindImageTextures");
   9502    CALL_BindImageTextures(ctx->CurrentServerDispatch, (first, count, textures));
   9503 }
   9504 
   9505 
   9506 /* DeleteTransformFeedbacks: marshalled synchronously */
   9507 static void GLAPIENTRY
   9508 _mesa_marshal_DeleteTransformFeedbacks(GLsizei n, const GLuint * ids)
   9509 {
   9510    GET_CURRENT_CONTEXT(ctx);
   9511    _mesa_glthread_finish(ctx);
   9512    debug_print_sync("DeleteTransformFeedbacks");
   9513    CALL_DeleteTransformFeedbacks(ctx->CurrentServerDispatch, (n, ids));
   9514 }
   9515 
   9516 
   9517 /* VertexAttrib4ubvNV: marshalled asynchronously */
   9518 struct marshal_cmd_VertexAttrib4ubvNV
   9519 {
   9520    struct marshal_cmd_base cmd_base;
   9521    GLuint index;
   9522    GLubyte v[4];
   9523 };
   9524 static inline void
   9525 _mesa_unmarshal_VertexAttrib4ubvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4ubvNV *cmd)
   9526 {
   9527    const GLuint index = cmd->index;
   9528    const GLubyte * v = cmd->v;
   9529    CALL_VertexAttrib4ubvNV(ctx->CurrentServerDispatch, (index, v));
   9530 }
   9531 static void GLAPIENTRY
   9532 _mesa_marshal_VertexAttrib4ubvNV(GLuint index, const GLubyte * v)
   9533 {
   9534    GET_CURRENT_CONTEXT(ctx);
   9535    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4ubvNV);
   9536    struct marshal_cmd_VertexAttrib4ubvNV *cmd;
   9537    debug_print_marshal("VertexAttrib4ubvNV");
   9538    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9539       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4ubvNV, cmd_size);
   9540       cmd->index = index;
   9541       memcpy(cmd->v, v, 4);
   9542       _mesa_post_marshal_hook(ctx);
   9543       return;
   9544    }
   9545 
   9546    _mesa_glthread_finish(ctx);
   9547    debug_print_sync_fallback("VertexAttrib4ubvNV");
   9548    CALL_VertexAttrib4ubvNV(ctx->CurrentServerDispatch, (index, v));
   9549 }
   9550 
   9551 
   9552 /* FogCoordfEXT: marshalled asynchronously */
   9553 struct marshal_cmd_FogCoordfEXT
   9554 {
   9555    struct marshal_cmd_base cmd_base;
   9556    GLfloat coord;
   9557 };
   9558 static inline void
   9559 _mesa_unmarshal_FogCoordfEXT(struct gl_context *ctx, const struct marshal_cmd_FogCoordfEXT *cmd)
   9560 {
   9561    const GLfloat coord = cmd->coord;
   9562    CALL_FogCoordfEXT(ctx->CurrentServerDispatch, (coord));
   9563 }
   9564 static void GLAPIENTRY
   9565 _mesa_marshal_FogCoordfEXT(GLfloat coord)
   9566 {
   9567    GET_CURRENT_CONTEXT(ctx);
   9568    size_t cmd_size = sizeof(struct marshal_cmd_FogCoordfEXT);
   9569    struct marshal_cmd_FogCoordfEXT *cmd;
   9570    debug_print_marshal("FogCoordfEXT");
   9571    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9572       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FogCoordfEXT, cmd_size);
   9573       cmd->coord = coord;
   9574       _mesa_post_marshal_hook(ctx);
   9575       return;
   9576    }
   9577 
   9578    _mesa_glthread_finish(ctx);
   9579    debug_print_sync_fallback("FogCoordfEXT");
   9580    CALL_FogCoordfEXT(ctx->CurrentServerDispatch, (coord));
   9581 }
   9582 
   9583 
   9584 /* GetMapfv: marshalled synchronously */
   9585 static void GLAPIENTRY
   9586 _mesa_marshal_GetMapfv(GLenum target, GLenum query, GLfloat * v)
   9587 {
   9588    GET_CURRENT_CONTEXT(ctx);
   9589    _mesa_glthread_finish(ctx);
   9590    debug_print_sync("GetMapfv");
   9591    CALL_GetMapfv(ctx->CurrentServerDispatch, (target, query, v));
   9592 }
   9593 
   9594 
   9595 /* GetProgramInfoLog: marshalled synchronously */
   9596 static void GLAPIENTRY
   9597 _mesa_marshal_GetProgramInfoLog(GLuint program, GLsizei bufSize, GLsizei * length, GLchar * infoLog)
   9598 {
   9599    GET_CURRENT_CONTEXT(ctx);
   9600    _mesa_glthread_finish(ctx);
   9601    debug_print_sync("GetProgramInfoLog");
   9602    CALL_GetProgramInfoLog(ctx->CurrentServerDispatch, (program, bufSize, length, infoLog));
   9603 }
   9604 
   9605 
   9606 /* BindTransformFeedback: marshalled asynchronously */
   9607 struct marshal_cmd_BindTransformFeedback
   9608 {
   9609    struct marshal_cmd_base cmd_base;
   9610    GLenum target;
   9611    GLuint id;
   9612 };
   9613 static inline void
   9614 _mesa_unmarshal_BindTransformFeedback(struct gl_context *ctx, const struct marshal_cmd_BindTransformFeedback *cmd)
   9615 {
   9616    const GLenum target = cmd->target;
   9617    const GLuint id = cmd->id;
   9618    CALL_BindTransformFeedback(ctx->CurrentServerDispatch, (target, id));
   9619 }
   9620 static void GLAPIENTRY
   9621 _mesa_marshal_BindTransformFeedback(GLenum target, GLuint id)
   9622 {
   9623    GET_CURRENT_CONTEXT(ctx);
   9624    size_t cmd_size = sizeof(struct marshal_cmd_BindTransformFeedback);
   9625    struct marshal_cmd_BindTransformFeedback *cmd;
   9626    debug_print_marshal("BindTransformFeedback");
   9627    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9628       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindTransformFeedback, cmd_size);
   9629       cmd->target = target;
   9630       cmd->id = id;
   9631       _mesa_post_marshal_hook(ctx);
   9632       return;
   9633    }
   9634 
   9635    _mesa_glthread_finish(ctx);
   9636    debug_print_sync_fallback("BindTransformFeedback");
   9637    CALL_BindTransformFeedback(ctx->CurrentServerDispatch, (target, id));
   9638 }
   9639 
   9640 
   9641 /* GetPixelMapfv: marshalled synchronously */
   9642 static void GLAPIENTRY
   9643 _mesa_marshal_GetPixelMapfv(GLenum map, GLfloat * values)
   9644 {
   9645    GET_CURRENT_CONTEXT(ctx);
   9646    _mesa_glthread_finish(ctx);
   9647    debug_print_sync("GetPixelMapfv");
   9648    CALL_GetPixelMapfv(ctx->CurrentServerDispatch, (map, values));
   9649 }
   9650 
   9651 
   9652 /* TextureBufferRange: marshalled asynchronously */
   9653 struct marshal_cmd_TextureBufferRange
   9654 {
   9655    struct marshal_cmd_base cmd_base;
   9656    GLuint texture;
   9657    GLenum internalformat;
   9658    GLuint buffer;
   9659    GLintptr offset;
   9660    GLsizeiptr size;
   9661 };
   9662 static inline void
   9663 _mesa_unmarshal_TextureBufferRange(struct gl_context *ctx, const struct marshal_cmd_TextureBufferRange *cmd)
   9664 {
   9665    const GLuint texture = cmd->texture;
   9666    const GLenum internalformat = cmd->internalformat;
   9667    const GLuint buffer = cmd->buffer;
   9668    const GLintptr offset = cmd->offset;
   9669    const GLsizeiptr size = cmd->size;
   9670    CALL_TextureBufferRange(ctx->CurrentServerDispatch, (texture, internalformat, buffer, offset, size));
   9671 }
   9672 static void GLAPIENTRY
   9673 _mesa_marshal_TextureBufferRange(GLuint texture, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size)
   9674 {
   9675    GET_CURRENT_CONTEXT(ctx);
   9676    size_t cmd_size = sizeof(struct marshal_cmd_TextureBufferRange);
   9677    struct marshal_cmd_TextureBufferRange *cmd;
   9678    debug_print_marshal("TextureBufferRange");
   9679    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9680       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureBufferRange, cmd_size);
   9681       cmd->texture = texture;
   9682       cmd->internalformat = internalformat;
   9683       cmd->buffer = buffer;
   9684       cmd->offset = offset;
   9685       cmd->size = size;
   9686       _mesa_post_marshal_hook(ctx);
   9687       return;
   9688    }
   9689 
   9690    _mesa_glthread_finish(ctx);
   9691    debug_print_sync_fallback("TextureBufferRange");
   9692    CALL_TextureBufferRange(ctx->CurrentServerDispatch, (texture, internalformat, buffer, offset, size));
   9693 }
   9694 
   9695 
   9696 /* VertexAttrib4svNV: marshalled asynchronously */
   9697 struct marshal_cmd_VertexAttrib4svNV
   9698 {
   9699    struct marshal_cmd_base cmd_base;
   9700    GLuint index;
   9701    GLshort v[4];
   9702 };
   9703 static inline void
   9704 _mesa_unmarshal_VertexAttrib4svNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4svNV *cmd)
   9705 {
   9706    const GLuint index = cmd->index;
   9707    const GLshort * v = cmd->v;
   9708    CALL_VertexAttrib4svNV(ctx->CurrentServerDispatch, (index, v));
   9709 }
   9710 static void GLAPIENTRY
   9711 _mesa_marshal_VertexAttrib4svNV(GLuint index, const GLshort * v)
   9712 {
   9713    GET_CURRENT_CONTEXT(ctx);
   9714    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4svNV);
   9715    struct marshal_cmd_VertexAttrib4svNV *cmd;
   9716    debug_print_marshal("VertexAttrib4svNV");
   9717    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9718       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4svNV, cmd_size);
   9719       cmd->index = index;
   9720       memcpy(cmd->v, v, 8);
   9721       _mesa_post_marshal_hook(ctx);
   9722       return;
   9723    }
   9724 
   9725    _mesa_glthread_finish(ctx);
   9726    debug_print_sync_fallback("VertexAttrib4svNV");
   9727    CALL_VertexAttrib4svNV(ctx->CurrentServerDispatch, (index, v));
   9728 }
   9729 
   9730 
   9731 /* PatchParameteri: marshalled asynchronously */
   9732 struct marshal_cmd_PatchParameteri
   9733 {
   9734    struct marshal_cmd_base cmd_base;
   9735    GLenum pname;
   9736    GLint value;
   9737 };
   9738 static inline void
   9739 _mesa_unmarshal_PatchParameteri(struct gl_context *ctx, const struct marshal_cmd_PatchParameteri *cmd)
   9740 {
   9741    const GLenum pname = cmd->pname;
   9742    const GLint value = cmd->value;
   9743    CALL_PatchParameteri(ctx->CurrentServerDispatch, (pname, value));
   9744 }
   9745 static void GLAPIENTRY
   9746 _mesa_marshal_PatchParameteri(GLenum pname, GLint value)
   9747 {
   9748    GET_CURRENT_CONTEXT(ctx);
   9749    size_t cmd_size = sizeof(struct marshal_cmd_PatchParameteri);
   9750    struct marshal_cmd_PatchParameteri *cmd;
   9751    debug_print_marshal("PatchParameteri");
   9752    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9753       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PatchParameteri, cmd_size);
   9754       cmd->pname = pname;
   9755       cmd->value = value;
   9756       _mesa_post_marshal_hook(ctx);
   9757       return;
   9758    }
   9759 
   9760    _mesa_glthread_finish(ctx);
   9761    debug_print_sync_fallback("PatchParameteri");
   9762    CALL_PatchParameteri(ctx->CurrentServerDispatch, (pname, value));
   9763 }
   9764 
   9765 
   9766 /* GetNamedBufferSubData: marshalled synchronously */
   9767 static void GLAPIENTRY
   9768 _mesa_marshal_GetNamedBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr size, GLvoid * data)
   9769 {
   9770    GET_CURRENT_CONTEXT(ctx);
   9771    _mesa_glthread_finish(ctx);
   9772    debug_print_sync("GetNamedBufferSubData");
   9773    CALL_GetNamedBufferSubData(ctx->CurrentServerDispatch, (buffer, offset, size, data));
   9774 }
   9775 
   9776 
   9777 /* VDPAUSurfaceAccessNV: marshalled asynchronously */
   9778 struct marshal_cmd_VDPAUSurfaceAccessNV
   9779 {
   9780    struct marshal_cmd_base cmd_base;
   9781    GLintptr surface;
   9782    GLenum access;
   9783 };
   9784 static inline void
   9785 _mesa_unmarshal_VDPAUSurfaceAccessNV(struct gl_context *ctx, const struct marshal_cmd_VDPAUSurfaceAccessNV *cmd)
   9786 {
   9787    const GLintptr surface = cmd->surface;
   9788    const GLenum access = cmd->access;
   9789    CALL_VDPAUSurfaceAccessNV(ctx->CurrentServerDispatch, (surface, access));
   9790 }
   9791 static void GLAPIENTRY
   9792 _mesa_marshal_VDPAUSurfaceAccessNV(GLintptr surface, GLenum access)
   9793 {
   9794    GET_CURRENT_CONTEXT(ctx);
   9795    size_t cmd_size = sizeof(struct marshal_cmd_VDPAUSurfaceAccessNV);
   9796    struct marshal_cmd_VDPAUSurfaceAccessNV *cmd;
   9797    debug_print_marshal("VDPAUSurfaceAccessNV");
   9798    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9799       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VDPAUSurfaceAccessNV, cmd_size);
   9800       cmd->surface = surface;
   9801       cmd->access = access;
   9802       _mesa_post_marshal_hook(ctx);
   9803       return;
   9804    }
   9805 
   9806    _mesa_glthread_finish(ctx);
   9807    debug_print_sync_fallback("VDPAUSurfaceAccessNV");
   9808    CALL_VDPAUSurfaceAccessNV(ctx->CurrentServerDispatch, (surface, access));
   9809 }
   9810 
   9811 
   9812 /* EdgeFlagPointer: marshalled asynchronously */
   9813 struct marshal_cmd_EdgeFlagPointer
   9814 {
   9815    struct marshal_cmd_base cmd_base;
   9816    GLsizei stride;
   9817    const GLvoid * pointer;
   9818 };
   9819 static inline void
   9820 _mesa_unmarshal_EdgeFlagPointer(struct gl_context *ctx, const struct marshal_cmd_EdgeFlagPointer *cmd)
   9821 {
   9822    const GLsizei stride = cmd->stride;
   9823    const GLvoid * pointer = cmd->pointer;
   9824    CALL_EdgeFlagPointer(ctx->CurrentServerDispatch, (stride, pointer));
   9825 }
   9826 static void GLAPIENTRY
   9827 _mesa_marshal_EdgeFlagPointer(GLsizei stride, const GLvoid * pointer)
   9828 {
   9829    GET_CURRENT_CONTEXT(ctx);
   9830    size_t cmd_size = sizeof(struct marshal_cmd_EdgeFlagPointer);
   9831    struct marshal_cmd_EdgeFlagPointer *cmd;
   9832    debug_print_marshal("EdgeFlagPointer");
   9833    if (_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)) {
   9834       _mesa_glthread_finish(ctx);
   9835       _mesa_glthread_restore_dispatch(ctx);
   9836       debug_print_sync_fallback("EdgeFlagPointer");
   9837       CALL_EdgeFlagPointer(ctx->CurrentServerDispatch, (stride, pointer));
   9838       return;
   9839    }
   9840    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9841       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EdgeFlagPointer, cmd_size);
   9842       cmd->stride = stride;
   9843       cmd->pointer = pointer;
   9844       _mesa_post_marshal_hook(ctx);
   9845       return;
   9846    }
   9847 
   9848    _mesa_glthread_finish(ctx);
   9849    debug_print_sync_fallback("EdgeFlagPointer");
   9850    CALL_EdgeFlagPointer(ctx->CurrentServerDispatch, (stride, pointer));
   9851 }
   9852 
   9853 
   9854 /* WindowPos2f: marshalled asynchronously */
   9855 struct marshal_cmd_WindowPos2f
   9856 {
   9857    struct marshal_cmd_base cmd_base;
   9858    GLfloat x;
   9859    GLfloat y;
   9860 };
   9861 static inline void
   9862 _mesa_unmarshal_WindowPos2f(struct gl_context *ctx, const struct marshal_cmd_WindowPos2f *cmd)
   9863 {
   9864    const GLfloat x = cmd->x;
   9865    const GLfloat y = cmd->y;
   9866    CALL_WindowPos2f(ctx->CurrentServerDispatch, (x, y));
   9867 }
   9868 static void GLAPIENTRY
   9869 _mesa_marshal_WindowPos2f(GLfloat x, GLfloat y)
   9870 {
   9871    GET_CURRENT_CONTEXT(ctx);
   9872    size_t cmd_size = sizeof(struct marshal_cmd_WindowPos2f);
   9873    struct marshal_cmd_WindowPos2f *cmd;
   9874    debug_print_marshal("WindowPos2f");
   9875    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9876       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos2f, cmd_size);
   9877       cmd->x = x;
   9878       cmd->y = y;
   9879       _mesa_post_marshal_hook(ctx);
   9880       return;
   9881    }
   9882 
   9883    _mesa_glthread_finish(ctx);
   9884    debug_print_sync_fallback("WindowPos2f");
   9885    CALL_WindowPos2f(ctx->CurrentServerDispatch, (x, y));
   9886 }
   9887 
   9888 
   9889 /* WindowPos2d: marshalled asynchronously */
   9890 struct marshal_cmd_WindowPos2d
   9891 {
   9892    struct marshal_cmd_base cmd_base;
   9893    GLdouble x;
   9894    GLdouble y;
   9895 };
   9896 static inline void
   9897 _mesa_unmarshal_WindowPos2d(struct gl_context *ctx, const struct marshal_cmd_WindowPos2d *cmd)
   9898 {
   9899    const GLdouble x = cmd->x;
   9900    const GLdouble y = cmd->y;
   9901    CALL_WindowPos2d(ctx->CurrentServerDispatch, (x, y));
   9902 }
   9903 static void GLAPIENTRY
   9904 _mesa_marshal_WindowPos2d(GLdouble x, GLdouble y)
   9905 {
   9906    GET_CURRENT_CONTEXT(ctx);
   9907    size_t cmd_size = sizeof(struct marshal_cmd_WindowPos2d);
   9908    struct marshal_cmd_WindowPos2d *cmd;
   9909    debug_print_marshal("WindowPos2d");
   9910    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9911       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos2d, cmd_size);
   9912       cmd->x = x;
   9913       cmd->y = y;
   9914       _mesa_post_marshal_hook(ctx);
   9915       return;
   9916    }
   9917 
   9918    _mesa_glthread_finish(ctx);
   9919    debug_print_sync_fallback("WindowPos2d");
   9920    CALL_WindowPos2d(ctx->CurrentServerDispatch, (x, y));
   9921 }
   9922 
   9923 
   9924 /* GetVertexAttribLdv: marshalled synchronously */
   9925 static void GLAPIENTRY
   9926 _mesa_marshal_GetVertexAttribLdv(GLuint index, GLenum pname, GLdouble * params)
   9927 {
   9928    GET_CURRENT_CONTEXT(ctx);
   9929    _mesa_glthread_finish(ctx);
   9930    debug_print_sync("GetVertexAttribLdv");
   9931    CALL_GetVertexAttribLdv(ctx->CurrentServerDispatch, (index, pname, params));
   9932 }
   9933 
   9934 
   9935 /* WindowPos2i: marshalled asynchronously */
   9936 struct marshal_cmd_WindowPos2i
   9937 {
   9938    struct marshal_cmd_base cmd_base;
   9939    GLint x;
   9940    GLint y;
   9941 };
   9942 static inline void
   9943 _mesa_unmarshal_WindowPos2i(struct gl_context *ctx, const struct marshal_cmd_WindowPos2i *cmd)
   9944 {
   9945    const GLint x = cmd->x;
   9946    const GLint y = cmd->y;
   9947    CALL_WindowPos2i(ctx->CurrentServerDispatch, (x, y));
   9948 }
   9949 static void GLAPIENTRY
   9950 _mesa_marshal_WindowPos2i(GLint x, GLint y)
   9951 {
   9952    GET_CURRENT_CONTEXT(ctx);
   9953    size_t cmd_size = sizeof(struct marshal_cmd_WindowPos2i);
   9954    struct marshal_cmd_WindowPos2i *cmd;
   9955    debug_print_marshal("WindowPos2i");
   9956    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9957       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos2i, cmd_size);
   9958       cmd->x = x;
   9959       cmd->y = y;
   9960       _mesa_post_marshal_hook(ctx);
   9961       return;
   9962    }
   9963 
   9964    _mesa_glthread_finish(ctx);
   9965    debug_print_sync_fallback("WindowPos2i");
   9966    CALL_WindowPos2i(ctx->CurrentServerDispatch, (x, y));
   9967 }
   9968 
   9969 
   9970 /* WindowPos2s: marshalled asynchronously */
   9971 struct marshal_cmd_WindowPos2s
   9972 {
   9973    struct marshal_cmd_base cmd_base;
   9974    GLshort x;
   9975    GLshort y;
   9976 };
   9977 static inline void
   9978 _mesa_unmarshal_WindowPos2s(struct gl_context *ctx, const struct marshal_cmd_WindowPos2s *cmd)
   9979 {
   9980    const GLshort x = cmd->x;
   9981    const GLshort y = cmd->y;
   9982    CALL_WindowPos2s(ctx->CurrentServerDispatch, (x, y));
   9983 }
   9984 static void GLAPIENTRY
   9985 _mesa_marshal_WindowPos2s(GLshort x, GLshort y)
   9986 {
   9987    GET_CURRENT_CONTEXT(ctx);
   9988    size_t cmd_size = sizeof(struct marshal_cmd_WindowPos2s);
   9989    struct marshal_cmd_WindowPos2s *cmd;
   9990    debug_print_marshal("WindowPos2s");
   9991    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   9992       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos2s, cmd_size);
   9993       cmd->x = x;
   9994       cmd->y = y;
   9995       _mesa_post_marshal_hook(ctx);
   9996       return;
   9997    }
   9998 
   9999    _mesa_glthread_finish(ctx);
   10000    debug_print_sync_fallback("WindowPos2s");
   10001    CALL_WindowPos2s(ctx->CurrentServerDispatch, (x, y));
   10002 }
   10003 
   10004 
   10005 /* VertexAttribI1uiEXT: marshalled asynchronously */
   10006 struct marshal_cmd_VertexAttribI1uiEXT
   10007 {
   10008    struct marshal_cmd_base cmd_base;
   10009    GLuint index;
   10010    GLuint x;
   10011 };
   10012 static inline void
   10013 _mesa_unmarshal_VertexAttribI1uiEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI1uiEXT *cmd)
   10014 {
   10015    const GLuint index = cmd->index;
   10016    const GLuint x = cmd->x;
   10017    CALL_VertexAttribI1uiEXT(ctx->CurrentServerDispatch, (index, x));
   10018 }
   10019 static void GLAPIENTRY
   10020 _mesa_marshal_VertexAttribI1uiEXT(GLuint index, GLuint x)
   10021 {
   10022    GET_CURRENT_CONTEXT(ctx);
   10023    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribI1uiEXT);
   10024    struct marshal_cmd_VertexAttribI1uiEXT *cmd;
   10025    debug_print_marshal("VertexAttribI1uiEXT");
   10026    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10027       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI1uiEXT, cmd_size);
   10028       cmd->index = index;
   10029       cmd->x = x;
   10030       _mesa_post_marshal_hook(ctx);
   10031       return;
   10032    }
   10033 
   10034    _mesa_glthread_finish(ctx);
   10035    debug_print_sync_fallback("VertexAttribI1uiEXT");
   10036    CALL_VertexAttribI1uiEXT(ctx->CurrentServerDispatch, (index, x));
   10037 }
   10038 
   10039 
   10040 /* DeleteSync: marshalled asynchronously */
   10041 struct marshal_cmd_DeleteSync
   10042 {
   10043    struct marshal_cmd_base cmd_base;
   10044    GLsync sync;
   10045 };
   10046 static inline void
   10047 _mesa_unmarshal_DeleteSync(struct gl_context *ctx, const struct marshal_cmd_DeleteSync *cmd)
   10048 {
   10049    const GLsync sync = cmd->sync;
   10050    CALL_DeleteSync(ctx->CurrentServerDispatch, (sync));
   10051 }
   10052 static void GLAPIENTRY
   10053 _mesa_marshal_DeleteSync(GLsync sync)
   10054 {
   10055    GET_CURRENT_CONTEXT(ctx);
   10056    size_t cmd_size = sizeof(struct marshal_cmd_DeleteSync);
   10057    struct marshal_cmd_DeleteSync *cmd;
   10058    debug_print_marshal("DeleteSync");
   10059    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10060       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteSync, cmd_size);
   10061       cmd->sync = sync;
   10062       _mesa_post_marshal_hook(ctx);
   10063       return;
   10064    }
   10065 
   10066    _mesa_glthread_finish(ctx);
   10067    debug_print_sync_fallback("DeleteSync");
   10068    CALL_DeleteSync(ctx->CurrentServerDispatch, (sync));
   10069 }
   10070 
   10071 
   10072 /* WindowPos4fvMESA: marshalled synchronously */
   10073 static void GLAPIENTRY
   10074 _mesa_marshal_WindowPos4fvMESA(const GLfloat * v)
   10075 {
   10076    GET_CURRENT_CONTEXT(ctx);
   10077    _mesa_glthread_finish(ctx);
   10078    debug_print_sync("WindowPos4fvMESA");
   10079    CALL_WindowPos4fvMESA(ctx->CurrentServerDispatch, (v));
   10080 }
   10081 
   10082 
   10083 /* CompressedTexImage3D: marshalled synchronously */
   10084 static void GLAPIENTRY
   10085 _mesa_marshal_CompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid * data)
   10086 {
   10087    GET_CURRENT_CONTEXT(ctx);
   10088    _mesa_glthread_finish(ctx);
   10089    debug_print_sync("CompressedTexImage3D");
   10090    CALL_CompressedTexImage3D(ctx->CurrentServerDispatch, (target, level, internalformat, width, height, depth, border, imageSize, data));
   10091 }
   10092 
   10093 
   10094 /* GenSemaphoresEXT: marshalled synchronously */
   10095 static void GLAPIENTRY
   10096 _mesa_marshal_GenSemaphoresEXT(GLsizei n, GLuint * semaphores)
   10097 {
   10098    GET_CURRENT_CONTEXT(ctx);
   10099    _mesa_glthread_finish(ctx);
   10100    debug_print_sync("GenSemaphoresEXT");
   10101    CALL_GenSemaphoresEXT(ctx->CurrentServerDispatch, (n, semaphores));
   10102 }
   10103 
   10104 
   10105 /* VertexAttribI1uiv: marshalled synchronously */
   10106 static void GLAPIENTRY
   10107 _mesa_marshal_VertexAttribI1uiv(GLuint index, const GLuint * v)
   10108 {
   10109    GET_CURRENT_CONTEXT(ctx);
   10110    _mesa_glthread_finish(ctx);
   10111    debug_print_sync("VertexAttribI1uiv");
   10112    CALL_VertexAttribI1uiv(ctx->CurrentServerDispatch, (index, v));
   10113 }
   10114 
   10115 
   10116 /* SecondaryColor3dv: marshalled asynchronously */
   10117 struct marshal_cmd_SecondaryColor3dv
   10118 {
   10119    struct marshal_cmd_base cmd_base;
   10120    GLdouble v[3];
   10121 };
   10122 static inline void
   10123 _mesa_unmarshal_SecondaryColor3dv(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3dv *cmd)
   10124 {
   10125    const GLdouble * v = cmd->v;
   10126    CALL_SecondaryColor3dv(ctx->CurrentServerDispatch, (v));
   10127 }
   10128 static void GLAPIENTRY
   10129 _mesa_marshal_SecondaryColor3dv(const GLdouble * v)
   10130 {
   10131    GET_CURRENT_CONTEXT(ctx);
   10132    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColor3dv);
   10133    struct marshal_cmd_SecondaryColor3dv *cmd;
   10134    debug_print_marshal("SecondaryColor3dv");
   10135    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10136       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3dv, cmd_size);
   10137       memcpy(cmd->v, v, 24);
   10138       _mesa_post_marshal_hook(ctx);
   10139       return;
   10140    }
   10141 
   10142    _mesa_glthread_finish(ctx);
   10143    debug_print_sync_fallback("SecondaryColor3dv");
   10144    CALL_SecondaryColor3dv(ctx->CurrentServerDispatch, (v));
   10145 }
   10146 
   10147 
   10148 /* GetnPixelMapusvARB: marshalled synchronously */
   10149 static void GLAPIENTRY
   10150 _mesa_marshal_GetnPixelMapusvARB(GLenum map, GLsizei bufSize, GLushort * values)
   10151 {
   10152    GET_CURRENT_CONTEXT(ctx);
   10153    _mesa_glthread_finish(ctx);
   10154    debug_print_sync("GetnPixelMapusvARB");
   10155    CALL_GetnPixelMapusvARB(ctx->CurrentServerDispatch, (map, bufSize, values));
   10156 }
   10157 
   10158 
   10159 /* VertexAttrib3s: marshalled asynchronously */
   10160 struct marshal_cmd_VertexAttrib3s
   10161 {
   10162    struct marshal_cmd_base cmd_base;
   10163    GLuint index;
   10164    GLshort x;
   10165    GLshort y;
   10166    GLshort z;
   10167 };
   10168 static inline void
   10169 _mesa_unmarshal_VertexAttrib3s(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3s *cmd)
   10170 {
   10171    const GLuint index = cmd->index;
   10172    const GLshort x = cmd->x;
   10173    const GLshort y = cmd->y;
   10174    const GLshort z = cmd->z;
   10175    CALL_VertexAttrib3s(ctx->CurrentServerDispatch, (index, x, y, z));
   10176 }
   10177 static void GLAPIENTRY
   10178 _mesa_marshal_VertexAttrib3s(GLuint index, GLshort x, GLshort y, GLshort z)
   10179 {
   10180    GET_CURRENT_CONTEXT(ctx);
   10181    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib3s);
   10182    struct marshal_cmd_VertexAttrib3s *cmd;
   10183    debug_print_marshal("VertexAttrib3s");
   10184    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10185       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3s, cmd_size);
   10186       cmd->index = index;
   10187       cmd->x = x;
   10188       cmd->y = y;
   10189       cmd->z = z;
   10190       _mesa_post_marshal_hook(ctx);
   10191       return;
   10192    }
   10193 
   10194    _mesa_glthread_finish(ctx);
   10195    debug_print_sync_fallback("VertexAttrib3s");
   10196    CALL_VertexAttrib3s(ctx->CurrentServerDispatch, (index, x, y, z));
   10197 }
   10198 
   10199 
   10200 /* UniformMatrix4x3fv: marshalled asynchronously */
   10201 struct marshal_cmd_UniformMatrix4x3fv
   10202 {
   10203    struct marshal_cmd_base cmd_base;
   10204    GLint location;
   10205    GLsizei count;
   10206    GLboolean transpose;
   10207    /* Next safe_mul(count, 48) bytes are GLfloat value[count][12] */
   10208 };
   10209 static inline void
   10210 _mesa_unmarshal_UniformMatrix4x3fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4x3fv *cmd)
   10211 {
   10212    const GLint location = cmd->location;
   10213    const GLsizei count = cmd->count;
   10214    const GLboolean transpose = cmd->transpose;
   10215    const GLfloat * value;
   10216    const char *variable_data = (const char *) (cmd + 1);
   10217    value = (const GLfloat *) variable_data;
   10218    variable_data += count * 48;
   10219    CALL_UniformMatrix4x3fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   10220 }
   10221 static void GLAPIENTRY
   10222 _mesa_marshal_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   10223 {
   10224    GET_CURRENT_CONTEXT(ctx);
   10225    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix4x3fv) + safe_mul(count, 48);
   10226    struct marshal_cmd_UniformMatrix4x3fv *cmd;
   10227    debug_print_marshal("UniformMatrix4x3fv");
   10228    if (unlikely(safe_mul(count, 48) < 0)) {
   10229       goto fallback_to_sync;
   10230    }
   10231    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10232       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4x3fv, cmd_size);
   10233       cmd->location = location;
   10234       cmd->count = count;
   10235       cmd->transpose = transpose;
   10236       char *variable_data = (char *) (cmd + 1);
   10237       memcpy(variable_data, value, count * 48);
   10238       variable_data += count * 48;
   10239       _mesa_post_marshal_hook(ctx);
   10240       return;
   10241    }
   10242 
   10243 fallback_to_sync:
   10244    _mesa_glthread_finish(ctx);
   10245    debug_print_sync_fallback("UniformMatrix4x3fv");
   10246    CALL_UniformMatrix4x3fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   10247 }
   10248 
   10249 
   10250 /* GetQueryiv: marshalled synchronously */
   10251 static void GLAPIENTRY
   10252 _mesa_marshal_GetQueryiv(GLenum target, GLenum pname, GLint * params)
   10253 {
   10254    GET_CURRENT_CONTEXT(ctx);
   10255    _mesa_glthread_finish(ctx);
   10256    debug_print_sync("GetQueryiv");
   10257    CALL_GetQueryiv(ctx->CurrentServerDispatch, (target, pname, params));
   10258 }
   10259 
   10260 
   10261 /* VertexAttrib3d: marshalled asynchronously */
   10262 struct marshal_cmd_VertexAttrib3d
   10263 {
   10264    struct marshal_cmd_base cmd_base;
   10265    GLuint index;
   10266    GLdouble x;
   10267    GLdouble y;
   10268    GLdouble z;
   10269 };
   10270 static inline void
   10271 _mesa_unmarshal_VertexAttrib3d(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3d *cmd)
   10272 {
   10273    const GLuint index = cmd->index;
   10274    const GLdouble x = cmd->x;
   10275    const GLdouble y = cmd->y;
   10276    const GLdouble z = cmd->z;
   10277    CALL_VertexAttrib3d(ctx->CurrentServerDispatch, (index, x, y, z));
   10278 }
   10279 static void GLAPIENTRY
   10280 _mesa_marshal_VertexAttrib3d(GLuint index, GLdouble x, GLdouble y, GLdouble z)
   10281 {
   10282    GET_CURRENT_CONTEXT(ctx);
   10283    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib3d);
   10284    struct marshal_cmd_VertexAttrib3d *cmd;
   10285    debug_print_marshal("VertexAttrib3d");
   10286    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10287       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3d, cmd_size);
   10288       cmd->index = index;
   10289       cmd->x = x;
   10290       cmd->y = y;
   10291       cmd->z = z;
   10292       _mesa_post_marshal_hook(ctx);
   10293       return;
   10294    }
   10295 
   10296    _mesa_glthread_finish(ctx);
   10297    debug_print_sync_fallback("VertexAttrib3d");
   10298    CALL_VertexAttrib3d(ctx->CurrentServerDispatch, (index, x, y, z));
   10299 }
   10300 
   10301 
   10302 /* MapNamedBufferRange: marshalled synchronously */
   10303 static GLvoid * GLAPIENTRY
   10304 _mesa_marshal_MapNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access)
   10305 {
   10306    GET_CURRENT_CONTEXT(ctx);
   10307    _mesa_glthread_finish(ctx);
   10308    debug_print_sync("MapNamedBufferRange");
   10309    return CALL_MapNamedBufferRange(ctx->CurrentServerDispatch, (buffer, offset, length, access));
   10310 }
   10311 
   10312 
   10313 /* MapBuffer: marshalled synchronously */
   10314 static GLvoid * GLAPIENTRY
   10315 _mesa_marshal_MapBuffer(GLenum target, GLenum access)
   10316 {
   10317    GET_CURRENT_CONTEXT(ctx);
   10318    _mesa_glthread_finish(ctx);
   10319    debug_print_sync("MapBuffer");
   10320    return CALL_MapBuffer(ctx->CurrentServerDispatch, (target, access));
   10321 }
   10322 
   10323 
   10324 /* GetProgramStageiv: marshalled synchronously */
   10325 static void GLAPIENTRY
   10326 _mesa_marshal_GetProgramStageiv(GLuint program, GLenum shadertype, GLenum pname, GLint * values)
   10327 {
   10328    GET_CURRENT_CONTEXT(ctx);
   10329    _mesa_glthread_finish(ctx);
   10330    debug_print_sync("GetProgramStageiv");
   10331    CALL_GetProgramStageiv(ctx->CurrentServerDispatch, (program, shadertype, pname, values));
   10332 }
   10333 
   10334 
   10335 /* VertexAttrib4Nbv: marshalled asynchronously */
   10336 struct marshal_cmd_VertexAttrib4Nbv
   10337 {
   10338    struct marshal_cmd_base cmd_base;
   10339    GLuint index;
   10340    GLbyte v[4];
   10341 };
   10342 static inline void
   10343 _mesa_unmarshal_VertexAttrib4Nbv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nbv *cmd)
   10344 {
   10345    const GLuint index = cmd->index;
   10346    const GLbyte * v = cmd->v;
   10347    CALL_VertexAttrib4Nbv(ctx->CurrentServerDispatch, (index, v));
   10348 }
   10349 static void GLAPIENTRY
   10350 _mesa_marshal_VertexAttrib4Nbv(GLuint index, const GLbyte * v)
   10351 {
   10352    GET_CURRENT_CONTEXT(ctx);
   10353    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nbv);
   10354    struct marshal_cmd_VertexAttrib4Nbv *cmd;
   10355    debug_print_marshal("VertexAttrib4Nbv");
   10356    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10357       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nbv, cmd_size);
   10358       cmd->index = index;
   10359       memcpy(cmd->v, v, 4);
   10360       _mesa_post_marshal_hook(ctx);
   10361       return;
   10362    }
   10363 
   10364    _mesa_glthread_finish(ctx);
   10365    debug_print_sync_fallback("VertexAttrib4Nbv");
   10366    CALL_VertexAttrib4Nbv(ctx->CurrentServerDispatch, (index, v));
   10367 }
   10368 
   10369 
   10370 /* ProgramBinary: marshalled synchronously */
   10371 static void GLAPIENTRY
   10372 _mesa_marshal_ProgramBinary(GLuint program, GLenum binaryFormat, const GLvoid * binary, GLsizei length)
   10373 {
   10374    GET_CURRENT_CONTEXT(ctx);
   10375    _mesa_glthread_finish(ctx);
   10376    debug_print_sync("ProgramBinary");
   10377    CALL_ProgramBinary(ctx->CurrentServerDispatch, (program, binaryFormat, binary, length));
   10378 }
   10379 
   10380 
   10381 /* InvalidateTexImage: marshalled asynchronously */
   10382 struct marshal_cmd_InvalidateTexImage
   10383 {
   10384    struct marshal_cmd_base cmd_base;
   10385    GLuint texture;
   10386    GLint level;
   10387 };
   10388 static inline void
   10389 _mesa_unmarshal_InvalidateTexImage(struct gl_context *ctx, const struct marshal_cmd_InvalidateTexImage *cmd)
   10390 {
   10391    const GLuint texture = cmd->texture;
   10392    const GLint level = cmd->level;
   10393    CALL_InvalidateTexImage(ctx->CurrentServerDispatch, (texture, level));
   10394 }
   10395 static void GLAPIENTRY
   10396 _mesa_marshal_InvalidateTexImage(GLuint texture, GLint level)
   10397 {
   10398    GET_CURRENT_CONTEXT(ctx);
   10399    size_t cmd_size = sizeof(struct marshal_cmd_InvalidateTexImage);
   10400    struct marshal_cmd_InvalidateTexImage *cmd;
   10401    debug_print_marshal("InvalidateTexImage");
   10402    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10403       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InvalidateTexImage, cmd_size);
   10404       cmd->texture = texture;
   10405       cmd->level = level;
   10406       _mesa_post_marshal_hook(ctx);
   10407       return;
   10408    }
   10409 
   10410    _mesa_glthread_finish(ctx);
   10411    debug_print_sync_fallback("InvalidateTexImage");
   10412    CALL_InvalidateTexImage(ctx->CurrentServerDispatch, (texture, level));
   10413 }
   10414 
   10415 
   10416 /* Uniform4ui: marshalled asynchronously */
   10417 struct marshal_cmd_Uniform4ui
   10418 {
   10419    struct marshal_cmd_base cmd_base;
   10420    GLint location;
   10421    GLuint x;
   10422    GLuint y;
   10423    GLuint z;
   10424    GLuint w;
   10425 };
   10426 static inline void
   10427 _mesa_unmarshal_Uniform4ui(struct gl_context *ctx, const struct marshal_cmd_Uniform4ui *cmd)
   10428 {
   10429    const GLint location = cmd->location;
   10430    const GLuint x = cmd->x;
   10431    const GLuint y = cmd->y;
   10432    const GLuint z = cmd->z;
   10433    const GLuint w = cmd->w;
   10434    CALL_Uniform4ui(ctx->CurrentServerDispatch, (location, x, y, z, w));
   10435 }
   10436 static void GLAPIENTRY
   10437 _mesa_marshal_Uniform4ui(GLint location, GLuint x, GLuint y, GLuint z, GLuint w)
   10438 {
   10439    GET_CURRENT_CONTEXT(ctx);
   10440    size_t cmd_size = sizeof(struct marshal_cmd_Uniform4ui);
   10441    struct marshal_cmd_Uniform4ui *cmd;
   10442    debug_print_marshal("Uniform4ui");
   10443    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10444       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4ui, cmd_size);
   10445       cmd->location = location;
   10446       cmd->x = x;
   10447       cmd->y = y;
   10448       cmd->z = z;
   10449       cmd->w = w;
   10450       _mesa_post_marshal_hook(ctx);
   10451       return;
   10452    }
   10453 
   10454    _mesa_glthread_finish(ctx);
   10455    debug_print_sync_fallback("Uniform4ui");
   10456    CALL_Uniform4ui(ctx->CurrentServerDispatch, (location, x, y, z, w));
   10457 }
   10458 
   10459 
   10460 /* VertexArrayAttribFormat: marshalled asynchronously */
   10461 struct marshal_cmd_VertexArrayAttribFormat
   10462 {
   10463    struct marshal_cmd_base cmd_base;
   10464    GLuint vaobj;
   10465    GLuint attribindex;
   10466    GLint size;
   10467    GLenum type;
   10468    GLboolean normalized;
   10469    GLuint relativeoffset;
   10470 };
   10471 static inline void
   10472 _mesa_unmarshal_VertexArrayAttribFormat(struct gl_context *ctx, const struct marshal_cmd_VertexArrayAttribFormat *cmd)
   10473 {
   10474    const GLuint vaobj = cmd->vaobj;
   10475    const GLuint attribindex = cmd->attribindex;
   10476    const GLint size = cmd->size;
   10477    const GLenum type = cmd->type;
   10478    const GLboolean normalized = cmd->normalized;
   10479    const GLuint relativeoffset = cmd->relativeoffset;
   10480    CALL_VertexArrayAttribFormat(ctx->CurrentServerDispatch, (vaobj, attribindex, size, type, normalized, relativeoffset));
   10481 }
   10482 static void GLAPIENTRY
   10483 _mesa_marshal_VertexArrayAttribFormat(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)
   10484 {
   10485    GET_CURRENT_CONTEXT(ctx);
   10486    size_t cmd_size = sizeof(struct marshal_cmd_VertexArrayAttribFormat);
   10487    struct marshal_cmd_VertexArrayAttribFormat *cmd;
   10488    debug_print_marshal("VertexArrayAttribFormat");
   10489    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10490       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayAttribFormat, cmd_size);
   10491       cmd->vaobj = vaobj;
   10492       cmd->attribindex = attribindex;
   10493       cmd->size = size;
   10494       cmd->type = type;
   10495       cmd->normalized = normalized;
   10496       cmd->relativeoffset = relativeoffset;
   10497       _mesa_post_marshal_hook(ctx);
   10498       return;
   10499    }
   10500 
   10501    _mesa_glthread_finish(ctx);
   10502    debug_print_sync_fallback("VertexArrayAttribFormat");
   10503    CALL_VertexArrayAttribFormat(ctx->CurrentServerDispatch, (vaobj, attribindex, size, type, normalized, relativeoffset));
   10504 }
   10505 
   10506 
   10507 /* VertexAttrib1fARB: marshalled asynchronously */
   10508 struct marshal_cmd_VertexAttrib1fARB
   10509 {
   10510    struct marshal_cmd_base cmd_base;
   10511    GLuint index;
   10512    GLfloat x;
   10513 };
   10514 static inline void
   10515 _mesa_unmarshal_VertexAttrib1fARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1fARB *cmd)
   10516 {
   10517    const GLuint index = cmd->index;
   10518    const GLfloat x = cmd->x;
   10519    CALL_VertexAttrib1fARB(ctx->CurrentServerDispatch, (index, x));
   10520 }
   10521 static void GLAPIENTRY
   10522 _mesa_marshal_VertexAttrib1fARB(GLuint index, GLfloat x)
   10523 {
   10524    GET_CURRENT_CONTEXT(ctx);
   10525    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib1fARB);
   10526    struct marshal_cmd_VertexAttrib1fARB *cmd;
   10527    debug_print_marshal("VertexAttrib1fARB");
   10528    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10529       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1fARB, cmd_size);
   10530       cmd->index = index;
   10531       cmd->x = x;
   10532       _mesa_post_marshal_hook(ctx);
   10533       return;
   10534    }
   10535 
   10536    _mesa_glthread_finish(ctx);
   10537    debug_print_sync_fallback("VertexAttrib1fARB");
   10538    CALL_VertexAttrib1fARB(ctx->CurrentServerDispatch, (index, x));
   10539 }
   10540 
   10541 
   10542 /* GetBooleani_v: marshalled synchronously */
   10543 static void GLAPIENTRY
   10544 _mesa_marshal_GetBooleani_v(GLenum value, GLuint index, GLboolean * data)
   10545 {
   10546    GET_CURRENT_CONTEXT(ctx);
   10547    _mesa_glthread_finish(ctx);
   10548    debug_print_sync("GetBooleani_v");
   10549    CALL_GetBooleani_v(ctx->CurrentServerDispatch, (value, index, data));
   10550 }
   10551 
   10552 
   10553 /* DrawTexsOES: marshalled asynchronously */
   10554 struct marshal_cmd_DrawTexsOES
   10555 {
   10556    struct marshal_cmd_base cmd_base;
   10557    GLshort x;
   10558    GLshort y;
   10559    GLshort z;
   10560    GLshort width;
   10561    GLshort height;
   10562 };
   10563 static inline void
   10564 _mesa_unmarshal_DrawTexsOES(struct gl_context *ctx, const struct marshal_cmd_DrawTexsOES *cmd)
   10565 {
   10566    const GLshort x = cmd->x;
   10567    const GLshort y = cmd->y;
   10568    const GLshort z = cmd->z;
   10569    const GLshort width = cmd->width;
   10570    const GLshort height = cmd->height;
   10571    CALL_DrawTexsOES(ctx->CurrentServerDispatch, (x, y, z, width, height));
   10572 }
   10573 static void GLAPIENTRY
   10574 _mesa_marshal_DrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height)
   10575 {
   10576    GET_CURRENT_CONTEXT(ctx);
   10577    size_t cmd_size = sizeof(struct marshal_cmd_DrawTexsOES);
   10578    struct marshal_cmd_DrawTexsOES *cmd;
   10579    debug_print_marshal("DrawTexsOES");
   10580    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10581       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTexsOES, cmd_size);
   10582       cmd->x = x;
   10583       cmd->y = y;
   10584       cmd->z = z;
   10585       cmd->width = width;
   10586       cmd->height = height;
   10587       _mesa_post_marshal_hook(ctx);
   10588       return;
   10589    }
   10590 
   10591    _mesa_glthread_finish(ctx);
   10592    debug_print_sync_fallback("DrawTexsOES");
   10593    CALL_DrawTexsOES(ctx->CurrentServerDispatch, (x, y, z, width, height));
   10594 }
   10595 
   10596 
   10597 /* GetObjectPtrLabel: marshalled synchronously */
   10598 static void GLAPIENTRY
   10599 _mesa_marshal_GetObjectPtrLabel(const GLvoid * ptr, GLsizei bufSize, GLsizei * length, GLchar * label)
   10600 {
   10601    GET_CURRENT_CONTEXT(ctx);
   10602    _mesa_glthread_finish(ctx);
   10603    debug_print_sync("GetObjectPtrLabel");
   10604    CALL_GetObjectPtrLabel(ctx->CurrentServerDispatch, (ptr, bufSize, length, label));
   10605 }
   10606 
   10607 
   10608 /* ProgramParameteri: marshalled asynchronously */
   10609 struct marshal_cmd_ProgramParameteri
   10610 {
   10611    struct marshal_cmd_base cmd_base;
   10612    GLuint program;
   10613    GLenum pname;
   10614    GLint value;
   10615 };
   10616 static inline void
   10617 _mesa_unmarshal_ProgramParameteri(struct gl_context *ctx, const struct marshal_cmd_ProgramParameteri *cmd)
   10618 {
   10619    const GLuint program = cmd->program;
   10620    const GLenum pname = cmd->pname;
   10621    const GLint value = cmd->value;
   10622    CALL_ProgramParameteri(ctx->CurrentServerDispatch, (program, pname, value));
   10623 }
   10624 static void GLAPIENTRY
   10625 _mesa_marshal_ProgramParameteri(GLuint program, GLenum pname, GLint value)
   10626 {
   10627    GET_CURRENT_CONTEXT(ctx);
   10628    size_t cmd_size = sizeof(struct marshal_cmd_ProgramParameteri);
   10629    struct marshal_cmd_ProgramParameteri *cmd;
   10630    debug_print_marshal("ProgramParameteri");
   10631    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10632       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramParameteri, cmd_size);
   10633       cmd->program = program;
   10634       cmd->pname = pname;
   10635       cmd->value = value;
   10636       _mesa_post_marshal_hook(ctx);
   10637       return;
   10638    }
   10639 
   10640    _mesa_glthread_finish(ctx);
   10641    debug_print_sync_fallback("ProgramParameteri");
   10642    CALL_ProgramParameteri(ctx->CurrentServerDispatch, (program, pname, value));
   10643 }
   10644 
   10645 
   10646 /* Color3fv: marshalled asynchronously */
   10647 struct marshal_cmd_Color3fv
   10648 {
   10649    struct marshal_cmd_base cmd_base;
   10650    GLfloat v[3];
   10651 };
   10652 static inline void
   10653 _mesa_unmarshal_Color3fv(struct gl_context *ctx, const struct marshal_cmd_Color3fv *cmd)
   10654 {
   10655    const GLfloat * v = cmd->v;
   10656    CALL_Color3fv(ctx->CurrentServerDispatch, (v));
   10657 }
   10658 static void GLAPIENTRY
   10659 _mesa_marshal_Color3fv(const GLfloat * v)
   10660 {
   10661    GET_CURRENT_CONTEXT(ctx);
   10662    size_t cmd_size = sizeof(struct marshal_cmd_Color3fv);
   10663    struct marshal_cmd_Color3fv *cmd;
   10664    debug_print_marshal("Color3fv");
   10665    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10666       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3fv, cmd_size);
   10667       memcpy(cmd->v, v, 12);
   10668       _mesa_post_marshal_hook(ctx);
   10669       return;
   10670    }
   10671 
   10672    _mesa_glthread_finish(ctx);
   10673    debug_print_sync_fallback("Color3fv");
   10674    CALL_Color3fv(ctx->CurrentServerDispatch, (v));
   10675 }
   10676 
   10677 
   10678 /* GetnMapfvARB: marshalled synchronously */
   10679 static void GLAPIENTRY
   10680 _mesa_marshal_GetnMapfvARB(GLenum target, GLenum query, GLsizei bufSize, GLfloat * v)
   10681 {
   10682    GET_CURRENT_CONTEXT(ctx);
   10683    _mesa_glthread_finish(ctx);
   10684    debug_print_sync("GetnMapfvARB");
   10685    CALL_GetnMapfvARB(ctx->CurrentServerDispatch, (target, query, bufSize, v));
   10686 }
   10687 
   10688 
   10689 /* MultiTexCoord2i: marshalled asynchronously */
   10690 struct marshal_cmd_MultiTexCoord2i
   10691 {
   10692    struct marshal_cmd_base cmd_base;
   10693    GLenum target;
   10694    GLint s;
   10695    GLint t;
   10696 };
   10697 static inline void
   10698 _mesa_unmarshal_MultiTexCoord2i(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2i *cmd)
   10699 {
   10700    const GLenum target = cmd->target;
   10701    const GLint s = cmd->s;
   10702    const GLint t = cmd->t;
   10703    CALL_MultiTexCoord2i(ctx->CurrentServerDispatch, (target, s, t));
   10704 }
   10705 static void GLAPIENTRY
   10706 _mesa_marshal_MultiTexCoord2i(GLenum target, GLint s, GLint t)
   10707 {
   10708    GET_CURRENT_CONTEXT(ctx);
   10709    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2i);
   10710    struct marshal_cmd_MultiTexCoord2i *cmd;
   10711    debug_print_marshal("MultiTexCoord2i");
   10712    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10713       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2i, cmd_size);
   10714       cmd->target = target;
   10715       cmd->s = s;
   10716       cmd->t = t;
   10717       _mesa_post_marshal_hook(ctx);
   10718       return;
   10719    }
   10720 
   10721    _mesa_glthread_finish(ctx);
   10722    debug_print_sync_fallback("MultiTexCoord2i");
   10723    CALL_MultiTexCoord2i(ctx->CurrentServerDispatch, (target, s, t));
   10724 }
   10725 
   10726 
   10727 /* MultiTexCoord2d: marshalled asynchronously */
   10728 struct marshal_cmd_MultiTexCoord2d
   10729 {
   10730    struct marshal_cmd_base cmd_base;
   10731    GLenum target;
   10732    GLdouble s;
   10733    GLdouble t;
   10734 };
   10735 static inline void
   10736 _mesa_unmarshal_MultiTexCoord2d(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2d *cmd)
   10737 {
   10738    const GLenum target = cmd->target;
   10739    const GLdouble s = cmd->s;
   10740    const GLdouble t = cmd->t;
   10741    CALL_MultiTexCoord2d(ctx->CurrentServerDispatch, (target, s, t));
   10742 }
   10743 static void GLAPIENTRY
   10744 _mesa_marshal_MultiTexCoord2d(GLenum target, GLdouble s, GLdouble t)
   10745 {
   10746    GET_CURRENT_CONTEXT(ctx);
   10747    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2d);
   10748    struct marshal_cmd_MultiTexCoord2d *cmd;
   10749    debug_print_marshal("MultiTexCoord2d");
   10750    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10751       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2d, cmd_size);
   10752       cmd->target = target;
   10753       cmd->s = s;
   10754       cmd->t = t;
   10755       _mesa_post_marshal_hook(ctx);
   10756       return;
   10757    }
   10758 
   10759    _mesa_glthread_finish(ctx);
   10760    debug_print_sync_fallback("MultiTexCoord2d");
   10761    CALL_MultiTexCoord2d(ctx->CurrentServerDispatch, (target, s, t));
   10762 }
   10763 
   10764 
   10765 /* SamplerParameterIuiv: marshalled synchronously */
   10766 static void GLAPIENTRY
   10767 _mesa_marshal_SamplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint * params)
   10768 {
   10769    GET_CURRENT_CONTEXT(ctx);
   10770    _mesa_glthread_finish(ctx);
   10771    debug_print_sync("SamplerParameterIuiv");
   10772    CALL_SamplerParameterIuiv(ctx->CurrentServerDispatch, (sampler, pname, params));
   10773 }
   10774 
   10775 
   10776 /* MultiTexCoord2s: marshalled asynchronously */
   10777 struct marshal_cmd_MultiTexCoord2s
   10778 {
   10779    struct marshal_cmd_base cmd_base;
   10780    GLenum target;
   10781    GLshort s;
   10782    GLshort t;
   10783 };
   10784 static inline void
   10785 _mesa_unmarshal_MultiTexCoord2s(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2s *cmd)
   10786 {
   10787    const GLenum target = cmd->target;
   10788    const GLshort s = cmd->s;
   10789    const GLshort t = cmd->t;
   10790    CALL_MultiTexCoord2s(ctx->CurrentServerDispatch, (target, s, t));
   10791 }
   10792 static void GLAPIENTRY
   10793 _mesa_marshal_MultiTexCoord2s(GLenum target, GLshort s, GLshort t)
   10794 {
   10795    GET_CURRENT_CONTEXT(ctx);
   10796    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2s);
   10797    struct marshal_cmd_MultiTexCoord2s *cmd;
   10798    debug_print_marshal("MultiTexCoord2s");
   10799    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10800       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2s, cmd_size);
   10801       cmd->target = target;
   10802       cmd->s = s;
   10803       cmd->t = t;
   10804       _mesa_post_marshal_hook(ctx);
   10805       return;
   10806    }
   10807 
   10808    _mesa_glthread_finish(ctx);
   10809    debug_print_sync_fallback("MultiTexCoord2s");
   10810    CALL_MultiTexCoord2s(ctx->CurrentServerDispatch, (target, s, t));
   10811 }
   10812 
   10813 
   10814 /* GetInternalformati64v: marshalled synchronously */
   10815 static void GLAPIENTRY
   10816 _mesa_marshal_GetInternalformati64v(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint64 * params)
   10817 {
   10818    GET_CURRENT_CONTEXT(ctx);
   10819    _mesa_glthread_finish(ctx);
   10820    debug_print_sync("GetInternalformati64v");
   10821    CALL_GetInternalformati64v(ctx->CurrentServerDispatch, (target, internalformat, pname, bufSize, params));
   10822 }
   10823 
   10824 
   10825 /* VDPAURegisterVideoSurfaceNV: marshalled synchronously */
   10826 static GLintptr GLAPIENTRY
   10827 _mesa_marshal_VDPAURegisterVideoSurfaceNV(const GLvoid * vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint * textureNames)
   10828 {
   10829    GET_CURRENT_CONTEXT(ctx);
   10830    _mesa_glthread_finish(ctx);
   10831    debug_print_sync("VDPAURegisterVideoSurfaceNV");
   10832    return CALL_VDPAURegisterVideoSurfaceNV(ctx->CurrentServerDispatch, (vdpSurface, target, numTextureNames, textureNames));
   10833 }
   10834 
   10835 
   10836 /* Indexub: marshalled asynchronously */
   10837 struct marshal_cmd_Indexub
   10838 {
   10839    struct marshal_cmd_base cmd_base;
   10840    GLubyte c;
   10841 };
   10842 static inline void
   10843 _mesa_unmarshal_Indexub(struct gl_context *ctx, const struct marshal_cmd_Indexub *cmd)
   10844 {
   10845    const GLubyte c = cmd->c;
   10846    CALL_Indexub(ctx->CurrentServerDispatch, (c));
   10847 }
   10848 static void GLAPIENTRY
   10849 _mesa_marshal_Indexub(GLubyte c)
   10850 {
   10851    GET_CURRENT_CONTEXT(ctx);
   10852    size_t cmd_size = sizeof(struct marshal_cmd_Indexub);
   10853    struct marshal_cmd_Indexub *cmd;
   10854    debug_print_marshal("Indexub");
   10855    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10856       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Indexub, cmd_size);
   10857       cmd->c = c;
   10858       _mesa_post_marshal_hook(ctx);
   10859       return;
   10860    }
   10861 
   10862    _mesa_glthread_finish(ctx);
   10863    debug_print_sync_fallback("Indexub");
   10864    CALL_Indexub(ctx->CurrentServerDispatch, (c));
   10865 }
   10866 
   10867 
   10868 /* GetPerfMonitorCounterDataAMD: marshalled synchronously */
   10869 static void GLAPIENTRY
   10870 _mesa_marshal_GetPerfMonitorCounterDataAMD(GLuint monitor, GLenum pname, GLsizei dataSize, GLuint * data, GLint * bytesWritten)
   10871 {
   10872    GET_CURRENT_CONTEXT(ctx);
   10873    _mesa_glthread_finish(ctx);
   10874    debug_print_sync("GetPerfMonitorCounterDataAMD");
   10875    CALL_GetPerfMonitorCounterDataAMD(ctx->CurrentServerDispatch, (monitor, pname, dataSize, data, bytesWritten));
   10876 }
   10877 
   10878 
   10879 /* MultTransposeMatrixf: marshalled synchronously */
   10880 static void GLAPIENTRY
   10881 _mesa_marshal_MultTransposeMatrixf(const GLfloat * m)
   10882 {
   10883    GET_CURRENT_CONTEXT(ctx);
   10884    _mesa_glthread_finish(ctx);
   10885    debug_print_sync("MultTransposeMatrixf");
   10886    CALL_MultTransposeMatrixf(ctx->CurrentServerDispatch, (m));
   10887 }
   10888 
   10889 
   10890 /* PolygonOffsetEXT: marshalled asynchronously */
   10891 struct marshal_cmd_PolygonOffsetEXT
   10892 {
   10893    struct marshal_cmd_base cmd_base;
   10894    GLfloat factor;
   10895    GLfloat bias;
   10896 };
   10897 static inline void
   10898 _mesa_unmarshal_PolygonOffsetEXT(struct gl_context *ctx, const struct marshal_cmd_PolygonOffsetEXT *cmd)
   10899 {
   10900    const GLfloat factor = cmd->factor;
   10901    const GLfloat bias = cmd->bias;
   10902    CALL_PolygonOffsetEXT(ctx->CurrentServerDispatch, (factor, bias));
   10903 }
   10904 static void GLAPIENTRY
   10905 _mesa_marshal_PolygonOffsetEXT(GLfloat factor, GLfloat bias)
   10906 {
   10907    GET_CURRENT_CONTEXT(ctx);
   10908    size_t cmd_size = sizeof(struct marshal_cmd_PolygonOffsetEXT);
   10909    struct marshal_cmd_PolygonOffsetEXT *cmd;
   10910    debug_print_marshal("PolygonOffsetEXT");
   10911    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10912       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PolygonOffsetEXT, cmd_size);
   10913       cmd->factor = factor;
   10914       cmd->bias = bias;
   10915       _mesa_post_marshal_hook(ctx);
   10916       return;
   10917    }
   10918 
   10919    _mesa_glthread_finish(ctx);
   10920    debug_print_sync_fallback("PolygonOffsetEXT");
   10921    CALL_PolygonOffsetEXT(ctx->CurrentServerDispatch, (factor, bias));
   10922 }
   10923 
   10924 
   10925 /* Scalex: marshalled asynchronously */
   10926 struct marshal_cmd_Scalex
   10927 {
   10928    struct marshal_cmd_base cmd_base;
   10929    GLfixed x;
   10930    GLfixed y;
   10931    GLfixed z;
   10932 };
   10933 static inline void
   10934 _mesa_unmarshal_Scalex(struct gl_context *ctx, const struct marshal_cmd_Scalex *cmd)
   10935 {
   10936    const GLfixed x = cmd->x;
   10937    const GLfixed y = cmd->y;
   10938    const GLfixed z = cmd->z;
   10939    CALL_Scalex(ctx->CurrentServerDispatch, (x, y, z));
   10940 }
   10941 static void GLAPIENTRY
   10942 _mesa_marshal_Scalex(GLfixed x, GLfixed y, GLfixed z)
   10943 {
   10944    GET_CURRENT_CONTEXT(ctx);
   10945    size_t cmd_size = sizeof(struct marshal_cmd_Scalex);
   10946    struct marshal_cmd_Scalex *cmd;
   10947    debug_print_marshal("Scalex");
   10948    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10949       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Scalex, cmd_size);
   10950       cmd->x = x;
   10951       cmd->y = y;
   10952       cmd->z = z;
   10953       _mesa_post_marshal_hook(ctx);
   10954       return;
   10955    }
   10956 
   10957    _mesa_glthread_finish(ctx);
   10958    debug_print_sync_fallback("Scalex");
   10959    CALL_Scalex(ctx->CurrentServerDispatch, (x, y, z));
   10960 }
   10961 
   10962 
   10963 /* Scaled: marshalled asynchronously */
   10964 struct marshal_cmd_Scaled
   10965 {
   10966    struct marshal_cmd_base cmd_base;
   10967    GLdouble x;
   10968    GLdouble y;
   10969    GLdouble z;
   10970 };
   10971 static inline void
   10972 _mesa_unmarshal_Scaled(struct gl_context *ctx, const struct marshal_cmd_Scaled *cmd)
   10973 {
   10974    const GLdouble x = cmd->x;
   10975    const GLdouble y = cmd->y;
   10976    const GLdouble z = cmd->z;
   10977    CALL_Scaled(ctx->CurrentServerDispatch, (x, y, z));
   10978 }
   10979 static void GLAPIENTRY
   10980 _mesa_marshal_Scaled(GLdouble x, GLdouble y, GLdouble z)
   10981 {
   10982    GET_CURRENT_CONTEXT(ctx);
   10983    size_t cmd_size = sizeof(struct marshal_cmd_Scaled);
   10984    struct marshal_cmd_Scaled *cmd;
   10985    debug_print_marshal("Scaled");
   10986    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   10987       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Scaled, cmd_size);
   10988       cmd->x = x;
   10989       cmd->y = y;
   10990       cmd->z = z;
   10991       _mesa_post_marshal_hook(ctx);
   10992       return;
   10993    }
   10994 
   10995    _mesa_glthread_finish(ctx);
   10996    debug_print_sync_fallback("Scaled");
   10997    CALL_Scaled(ctx->CurrentServerDispatch, (x, y, z));
   10998 }
   10999 
   11000 
   11001 /* Scalef: marshalled asynchronously */
   11002 struct marshal_cmd_Scalef
   11003 {
   11004    struct marshal_cmd_base cmd_base;
   11005    GLfloat x;
   11006    GLfloat y;
   11007    GLfloat z;
   11008 };
   11009 static inline void
   11010 _mesa_unmarshal_Scalef(struct gl_context *ctx, const struct marshal_cmd_Scalef *cmd)
   11011 {
   11012    const GLfloat x = cmd->x;
   11013    const GLfloat y = cmd->y;
   11014    const GLfloat z = cmd->z;
   11015    CALL_Scalef(ctx->CurrentServerDispatch, (x, y, z));
   11016 }
   11017 static void GLAPIENTRY
   11018 _mesa_marshal_Scalef(GLfloat x, GLfloat y, GLfloat z)
   11019 {
   11020    GET_CURRENT_CONTEXT(ctx);
   11021    size_t cmd_size = sizeof(struct marshal_cmd_Scalef);
   11022    struct marshal_cmd_Scalef *cmd;
   11023    debug_print_marshal("Scalef");
   11024    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11025       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Scalef, cmd_size);
   11026       cmd->x = x;
   11027       cmd->y = y;
   11028       cmd->z = z;
   11029       _mesa_post_marshal_hook(ctx);
   11030       return;
   11031    }
   11032 
   11033    _mesa_glthread_finish(ctx);
   11034    debug_print_sync_fallback("Scalef");
   11035    CALL_Scalef(ctx->CurrentServerDispatch, (x, y, z));
   11036 }
   11037 
   11038 
   11039 /* IndexPointerEXT: marshalled asynchronously */
   11040 struct marshal_cmd_IndexPointerEXT
   11041 {
   11042    struct marshal_cmd_base cmd_base;
   11043    GLenum type;
   11044    GLsizei stride;
   11045    GLsizei count;
   11046    const GLvoid * pointer;
   11047 };
   11048 static inline void
   11049 _mesa_unmarshal_IndexPointerEXT(struct gl_context *ctx, const struct marshal_cmd_IndexPointerEXT *cmd)
   11050 {
   11051    const GLenum type = cmd->type;
   11052    const GLsizei stride = cmd->stride;
   11053    const GLsizei count = cmd->count;
   11054    const GLvoid * pointer = cmd->pointer;
   11055    CALL_IndexPointerEXT(ctx->CurrentServerDispatch, (type, stride, count, pointer));
   11056 }
   11057 static void GLAPIENTRY
   11058 _mesa_marshal_IndexPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
   11059 {
   11060    GET_CURRENT_CONTEXT(ctx);
   11061    size_t cmd_size = sizeof(struct marshal_cmd_IndexPointerEXT);
   11062    struct marshal_cmd_IndexPointerEXT *cmd;
   11063    debug_print_marshal("IndexPointerEXT");
   11064    if (_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)) {
   11065       _mesa_glthread_finish(ctx);
   11066       _mesa_glthread_restore_dispatch(ctx);
   11067       debug_print_sync_fallback("IndexPointerEXT");
   11068       CALL_IndexPointerEXT(ctx->CurrentServerDispatch, (type, stride, count, pointer));
   11069       return;
   11070    }
   11071    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11072       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_IndexPointerEXT, cmd_size);
   11073       cmd->type = type;
   11074       cmd->stride = stride;
   11075       cmd->count = count;
   11076       cmd->pointer = pointer;
   11077       _mesa_post_marshal_hook(ctx);
   11078       return;
   11079    }
   11080 
   11081    _mesa_glthread_finish(ctx);
   11082    debug_print_sync_fallback("IndexPointerEXT");
   11083    CALL_IndexPointerEXT(ctx->CurrentServerDispatch, (type, stride, count, pointer));
   11084 }
   11085 
   11086 
   11087 /* GetUniformfv: marshalled synchronously */
   11088 static void GLAPIENTRY
   11089 _mesa_marshal_GetUniformfv(GLuint program, GLint location, GLfloat * params)
   11090 {
   11091    GET_CURRENT_CONTEXT(ctx);
   11092    _mesa_glthread_finish(ctx);
   11093    debug_print_sync("GetUniformfv");
   11094    CALL_GetUniformfv(ctx->CurrentServerDispatch, (program, location, params));
   11095 }
   11096 
   11097 
   11098 /* ColorFragmentOp2ATI: marshalled asynchronously */
   11099 struct marshal_cmd_ColorFragmentOp2ATI
   11100 {
   11101    struct marshal_cmd_base cmd_base;
   11102    GLenum op;
   11103    GLuint dst;
   11104    GLuint dstMask;
   11105    GLuint dstMod;
   11106    GLuint arg1;
   11107    GLuint arg1Rep;
   11108    GLuint arg1Mod;
   11109    GLuint arg2;
   11110    GLuint arg2Rep;
   11111    GLuint arg2Mod;
   11112 };
   11113 static inline void
   11114 _mesa_unmarshal_ColorFragmentOp2ATI(struct gl_context *ctx, const struct marshal_cmd_ColorFragmentOp2ATI *cmd)
   11115 {
   11116    const GLenum op = cmd->op;
   11117    const GLuint dst = cmd->dst;
   11118    const GLuint dstMask = cmd->dstMask;
   11119    const GLuint dstMod = cmd->dstMod;
   11120    const GLuint arg1 = cmd->arg1;
   11121    const GLuint arg1Rep = cmd->arg1Rep;
   11122    const GLuint arg1Mod = cmd->arg1Mod;
   11123    const GLuint arg2 = cmd->arg2;
   11124    const GLuint arg2Rep = cmd->arg2Rep;
   11125    const GLuint arg2Mod = cmd->arg2Mod;
   11126    CALL_ColorFragmentOp2ATI(ctx->CurrentServerDispatch, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod));
   11127 }
   11128 static void GLAPIENTRY
   11129 _mesa_marshal_ColorFragmentOp2ATI(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod)
   11130 {
   11131    GET_CURRENT_CONTEXT(ctx);
   11132    size_t cmd_size = sizeof(struct marshal_cmd_ColorFragmentOp2ATI);
   11133    struct marshal_cmd_ColorFragmentOp2ATI *cmd;
   11134    debug_print_marshal("ColorFragmentOp2ATI");
   11135    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11136       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorFragmentOp2ATI, cmd_size);
   11137       cmd->op = op;
   11138       cmd->dst = dst;
   11139       cmd->dstMask = dstMask;
   11140       cmd->dstMod = dstMod;
   11141       cmd->arg1 = arg1;
   11142       cmd->arg1Rep = arg1Rep;
   11143       cmd->arg1Mod = arg1Mod;
   11144       cmd->arg2 = arg2;
   11145       cmd->arg2Rep = arg2Rep;
   11146       cmd->arg2Mod = arg2Mod;
   11147       _mesa_post_marshal_hook(ctx);
   11148       return;
   11149    }
   11150 
   11151    _mesa_glthread_finish(ctx);
   11152    debug_print_sync_fallback("ColorFragmentOp2ATI");
   11153    CALL_ColorFragmentOp2ATI(ctx->CurrentServerDispatch, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod));
   11154 }
   11155 
   11156 
   11157 /* VertexAttrib2sNV: marshalled asynchronously */
   11158 struct marshal_cmd_VertexAttrib2sNV
   11159 {
   11160    struct marshal_cmd_base cmd_base;
   11161    GLuint index;
   11162    GLshort x;
   11163    GLshort y;
   11164 };
   11165 static inline void
   11166 _mesa_unmarshal_VertexAttrib2sNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2sNV *cmd)
   11167 {
   11168    const GLuint index = cmd->index;
   11169    const GLshort x = cmd->x;
   11170    const GLshort y = cmd->y;
   11171    CALL_VertexAttrib2sNV(ctx->CurrentServerDispatch, (index, x, y));
   11172 }
   11173 static void GLAPIENTRY
   11174 _mesa_marshal_VertexAttrib2sNV(GLuint index, GLshort x, GLshort y)
   11175 {
   11176    GET_CURRENT_CONTEXT(ctx);
   11177    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib2sNV);
   11178    struct marshal_cmd_VertexAttrib2sNV *cmd;
   11179    debug_print_marshal("VertexAttrib2sNV");
   11180    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11181       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2sNV, cmd_size);
   11182       cmd->index = index;
   11183       cmd->x = x;
   11184       cmd->y = y;
   11185       _mesa_post_marshal_hook(ctx);
   11186       return;
   11187    }
   11188 
   11189    _mesa_glthread_finish(ctx);
   11190    debug_print_sync_fallback("VertexAttrib2sNV");
   11191    CALL_VertexAttrib2sNV(ctx->CurrentServerDispatch, (index, x, y));
   11192 }
   11193 
   11194 
   11195 /* ReadPixels: marshalled synchronously */
   11196 static void GLAPIENTRY
   11197 _mesa_marshal_ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid * pixels)
   11198 {
   11199    GET_CURRENT_CONTEXT(ctx);
   11200    _mesa_glthread_finish(ctx);
   11201    debug_print_sync("ReadPixels");
   11202    CALL_ReadPixels(ctx->CurrentServerDispatch, (x, y, width, height, format, type, pixels));
   11203 }
   11204 
   11205 
   11206 /* QueryCounter: marshalled asynchronously */
   11207 struct marshal_cmd_QueryCounter
   11208 {
   11209    struct marshal_cmd_base cmd_base;
   11210    GLuint id;
   11211    GLenum target;
   11212 };
   11213 static inline void
   11214 _mesa_unmarshal_QueryCounter(struct gl_context *ctx, const struct marshal_cmd_QueryCounter *cmd)
   11215 {
   11216    const GLuint id = cmd->id;
   11217    const GLenum target = cmd->target;
   11218    CALL_QueryCounter(ctx->CurrentServerDispatch, (id, target));
   11219 }
   11220 static void GLAPIENTRY
   11221 _mesa_marshal_QueryCounter(GLuint id, GLenum target)
   11222 {
   11223    GET_CURRENT_CONTEXT(ctx);
   11224    size_t cmd_size = sizeof(struct marshal_cmd_QueryCounter);
   11225    struct marshal_cmd_QueryCounter *cmd;
   11226    debug_print_marshal("QueryCounter");
   11227    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11228       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_QueryCounter, cmd_size);
   11229       cmd->id = id;
   11230       cmd->target = target;
   11231       _mesa_post_marshal_hook(ctx);
   11232       return;
   11233    }
   11234 
   11235    _mesa_glthread_finish(ctx);
   11236    debug_print_sync_fallback("QueryCounter");
   11237    CALL_QueryCounter(ctx->CurrentServerDispatch, (id, target));
   11238 }
   11239 
   11240 
   11241 /* NormalPointerEXT: marshalled asynchronously */
   11242 struct marshal_cmd_NormalPointerEXT
   11243 {
   11244    struct marshal_cmd_base cmd_base;
   11245    GLenum type;
   11246    GLsizei stride;
   11247    GLsizei count;
   11248    const GLvoid * pointer;
   11249 };
   11250 static inline void
   11251 _mesa_unmarshal_NormalPointerEXT(struct gl_context *ctx, const struct marshal_cmd_NormalPointerEXT *cmd)
   11252 {
   11253    const GLenum type = cmd->type;
   11254    const GLsizei stride = cmd->stride;
   11255    const GLsizei count = cmd->count;
   11256    const GLvoid * pointer = cmd->pointer;
   11257    CALL_NormalPointerEXT(ctx->CurrentServerDispatch, (type, stride, count, pointer));
   11258 }
   11259 static void GLAPIENTRY
   11260 _mesa_marshal_NormalPointerEXT(GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
   11261 {
   11262    GET_CURRENT_CONTEXT(ctx);
   11263    size_t cmd_size = sizeof(struct marshal_cmd_NormalPointerEXT);
   11264    struct marshal_cmd_NormalPointerEXT *cmd;
   11265    debug_print_marshal("NormalPointerEXT");
   11266    if (_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)) {
   11267       _mesa_glthread_finish(ctx);
   11268       _mesa_glthread_restore_dispatch(ctx);
   11269       debug_print_sync_fallback("NormalPointerEXT");
   11270       CALL_NormalPointerEXT(ctx->CurrentServerDispatch, (type, stride, count, pointer));
   11271       return;
   11272    }
   11273    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11274       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NormalPointerEXT, cmd_size);
   11275       cmd->type = type;
   11276       cmd->stride = stride;
   11277       cmd->count = count;
   11278       cmd->pointer = pointer;
   11279       _mesa_post_marshal_hook(ctx);
   11280       return;
   11281    }
   11282 
   11283    _mesa_glthread_finish(ctx);
   11284    debug_print_sync_fallback("NormalPointerEXT");
   11285    CALL_NormalPointerEXT(ctx->CurrentServerDispatch, (type, stride, count, pointer));
   11286 }
   11287 
   11288 
   11289 /* GetSubroutineIndex: marshalled synchronously */
   11290 static GLuint GLAPIENTRY
   11291 _mesa_marshal_GetSubroutineIndex(GLuint program, GLenum shadertype, const GLchar * name)
   11292 {
   11293    GET_CURRENT_CONTEXT(ctx);
   11294    _mesa_glthread_finish(ctx);
   11295    debug_print_sync("GetSubroutineIndex");
   11296    return CALL_GetSubroutineIndex(ctx->CurrentServerDispatch, (program, shadertype, name));
   11297 }
   11298 
   11299 
   11300 /* ProgramUniform3iv: marshalled asynchronously */
   11301 struct marshal_cmd_ProgramUniform3iv
   11302 {
   11303    struct marshal_cmd_base cmd_base;
   11304    GLuint program;
   11305    GLint location;
   11306    GLsizei count;
   11307    /* Next safe_mul(count, 12) bytes are GLint value[count][3] */
   11308 };
   11309 static inline void
   11310 _mesa_unmarshal_ProgramUniform3iv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3iv *cmd)
   11311 {
   11312    const GLuint program = cmd->program;
   11313    const GLint location = cmd->location;
   11314    const GLsizei count = cmd->count;
   11315    const GLint * value;
   11316    const char *variable_data = (const char *) (cmd + 1);
   11317    value = (const GLint *) variable_data;
   11318    variable_data += count * 12;
   11319    CALL_ProgramUniform3iv(ctx->CurrentServerDispatch, (program, location, count, value));
   11320 }
   11321 static void GLAPIENTRY
   11322 _mesa_marshal_ProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint * value)
   11323 {
   11324    GET_CURRENT_CONTEXT(ctx);
   11325    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform3iv) + safe_mul(count, 12);
   11326    struct marshal_cmd_ProgramUniform3iv *cmd;
   11327    debug_print_marshal("ProgramUniform3iv");
   11328    if (unlikely(safe_mul(count, 12) < 0)) {
   11329       goto fallback_to_sync;
   11330    }
   11331    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11332       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3iv, cmd_size);
   11333       cmd->program = program;
   11334       cmd->location = location;
   11335       cmd->count = count;
   11336       char *variable_data = (char *) (cmd + 1);
   11337       memcpy(variable_data, value, count * 12);
   11338       variable_data += count * 12;
   11339       _mesa_post_marshal_hook(ctx);
   11340       return;
   11341    }
   11342 
   11343 fallback_to_sync:
   11344    _mesa_glthread_finish(ctx);
   11345    debug_print_sync_fallback("ProgramUniform3iv");
   11346    CALL_ProgramUniform3iv(ctx->CurrentServerDispatch, (program, location, count, value));
   11347 }
   11348 
   11349 
   11350 /* ProgramUniformMatrix2dv: marshalled asynchronously */
   11351 struct marshal_cmd_ProgramUniformMatrix2dv
   11352 {
   11353    struct marshal_cmd_base cmd_base;
   11354    GLuint program;
   11355    GLint location;
   11356    GLsizei count;
   11357    GLboolean transpose;
   11358    /* Next safe_mul(count, 32) bytes are GLdouble value[count][4] */
   11359 };
   11360 static inline void
   11361 _mesa_unmarshal_ProgramUniformMatrix2dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix2dv *cmd)
   11362 {
   11363    const GLuint program = cmd->program;
   11364    const GLint location = cmd->location;
   11365    const GLsizei count = cmd->count;
   11366    const GLboolean transpose = cmd->transpose;
   11367    const GLdouble * value;
   11368    const char *variable_data = (const char *) (cmd + 1);
   11369    value = (const GLdouble *) variable_data;
   11370    variable_data += count * 32;
   11371    CALL_ProgramUniformMatrix2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   11372 }
   11373 static void GLAPIENTRY
   11374 _mesa_marshal_ProgramUniformMatrix2dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   11375 {
   11376    GET_CURRENT_CONTEXT(ctx);
   11377    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix2dv) + safe_mul(count, 32);
   11378    struct marshal_cmd_ProgramUniformMatrix2dv *cmd;
   11379    debug_print_marshal("ProgramUniformMatrix2dv");
   11380    if (unlikely(safe_mul(count, 32) < 0)) {
   11381       goto fallback_to_sync;
   11382    }
   11383    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11384       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix2dv, cmd_size);
   11385       cmd->program = program;
   11386       cmd->location = location;
   11387       cmd->count = count;
   11388       cmd->transpose = transpose;
   11389       char *variable_data = (char *) (cmd + 1);
   11390       memcpy(variable_data, value, count * 32);
   11391       variable_data += count * 32;
   11392       _mesa_post_marshal_hook(ctx);
   11393       return;
   11394    }
   11395 
   11396 fallback_to_sync:
   11397    _mesa_glthread_finish(ctx);
   11398    debug_print_sync_fallback("ProgramUniformMatrix2dv");
   11399    CALL_ProgramUniformMatrix2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   11400 }
   11401 
   11402 
   11403 /* ClearTexSubImage: marshalled synchronously */
   11404 static void GLAPIENTRY
   11405 _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)
   11406 {
   11407    GET_CURRENT_CONTEXT(ctx);
   11408    _mesa_glthread_finish(ctx);
   11409    debug_print_sync("ClearTexSubImage");
   11410    CALL_ClearTexSubImage(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data));
   11411 }
   11412 
   11413 
   11414 /* GetActiveUniformBlockName: marshalled synchronously */
   11415 static void GLAPIENTRY
   11416 _mesa_marshal_GetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName)
   11417 {
   11418    GET_CURRENT_CONTEXT(ctx);
   11419    _mesa_glthread_finish(ctx);
   11420    debug_print_sync("GetActiveUniformBlockName");
   11421    CALL_GetActiveUniformBlockName(ctx->CurrentServerDispatch, (program, uniformBlockIndex, bufSize, length, uniformBlockName));
   11422 }
   11423 
   11424 
   11425 /* DrawElementsBaseVertex: marshalled asynchronously */
   11426 struct marshal_cmd_DrawElementsBaseVertex
   11427 {
   11428    struct marshal_cmd_base cmd_base;
   11429    GLenum mode;
   11430    GLsizei count;
   11431    GLenum type;
   11432    const GLvoid * indices;
   11433    GLint basevertex;
   11434 };
   11435 static inline void
   11436 _mesa_unmarshal_DrawElementsBaseVertex(struct gl_context *ctx, const struct marshal_cmd_DrawElementsBaseVertex *cmd)
   11437 {
   11438    const GLenum mode = cmd->mode;
   11439    const GLsizei count = cmd->count;
   11440    const GLenum type = cmd->type;
   11441    const GLvoid * indices = cmd->indices;
   11442    const GLint basevertex = cmd->basevertex;
   11443    CALL_DrawElementsBaseVertex(ctx->CurrentServerDispatch, (mode, count, type, indices, basevertex));
   11444 }
   11445 static void GLAPIENTRY
   11446 _mesa_marshal_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex)
   11447 {
   11448    GET_CURRENT_CONTEXT(ctx);
   11449    size_t cmd_size = sizeof(struct marshal_cmd_DrawElementsBaseVertex);
   11450    struct marshal_cmd_DrawElementsBaseVertex *cmd;
   11451    debug_print_marshal("DrawElementsBaseVertex");
   11452    if (_mesa_glthread_is_non_vbo_draw_elements(ctx)) {
   11453       _mesa_glthread_finish(ctx);
   11454       _mesa_glthread_restore_dispatch(ctx);
   11455       debug_print_sync_fallback("DrawElementsBaseVertex");
   11456       CALL_DrawElementsBaseVertex(ctx->CurrentServerDispatch, (mode, count, type, indices, basevertex));
   11457       return;
   11458    }
   11459    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11460       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawElementsBaseVertex, cmd_size);
   11461       cmd->mode = mode;
   11462       cmd->count = count;
   11463       cmd->type = type;
   11464       cmd->indices = indices;
   11465       cmd->basevertex = basevertex;
   11466       _mesa_post_marshal_hook(ctx);
   11467       return;
   11468    }
   11469 
   11470    _mesa_glthread_finish(ctx);
   11471    debug_print_sync_fallback("DrawElementsBaseVertex");
   11472    CALL_DrawElementsBaseVertex(ctx->CurrentServerDispatch, (mode, count, type, indices, basevertex));
   11473 }
   11474 
   11475 
   11476 /* RasterPos3iv: marshalled asynchronously */
   11477 struct marshal_cmd_RasterPos3iv
   11478 {
   11479    struct marshal_cmd_base cmd_base;
   11480    GLint v[3];
   11481 };
   11482 static inline void
   11483 _mesa_unmarshal_RasterPos3iv(struct gl_context *ctx, const struct marshal_cmd_RasterPos3iv *cmd)
   11484 {
   11485    const GLint * v = cmd->v;
   11486    CALL_RasterPos3iv(ctx->CurrentServerDispatch, (v));
   11487 }
   11488 static void GLAPIENTRY
   11489 _mesa_marshal_RasterPos3iv(const GLint * v)
   11490 {
   11491    GET_CURRENT_CONTEXT(ctx);
   11492    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos3iv);
   11493    struct marshal_cmd_RasterPos3iv *cmd;
   11494    debug_print_marshal("RasterPos3iv");
   11495    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11496       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos3iv, cmd_size);
   11497       memcpy(cmd->v, v, 12);
   11498       _mesa_post_marshal_hook(ctx);
   11499       return;
   11500    }
   11501 
   11502    _mesa_glthread_finish(ctx);
   11503    debug_print_sync_fallback("RasterPos3iv");
   11504    CALL_RasterPos3iv(ctx->CurrentServerDispatch, (v));
   11505 }
   11506 
   11507 
   11508 /* ColorMaski: marshalled asynchronously */
   11509 struct marshal_cmd_ColorMaski
   11510 {
   11511    struct marshal_cmd_base cmd_base;
   11512    GLuint buf;
   11513    GLboolean r;
   11514    GLboolean g;
   11515    GLboolean b;
   11516    GLboolean a;
   11517 };
   11518 static inline void
   11519 _mesa_unmarshal_ColorMaski(struct gl_context *ctx, const struct marshal_cmd_ColorMaski *cmd)
   11520 {
   11521    const GLuint buf = cmd->buf;
   11522    const GLboolean r = cmd->r;
   11523    const GLboolean g = cmd->g;
   11524    const GLboolean b = cmd->b;
   11525    const GLboolean a = cmd->a;
   11526    CALL_ColorMaski(ctx->CurrentServerDispatch, (buf, r, g, b, a));
   11527 }
   11528 static void GLAPIENTRY
   11529 _mesa_marshal_ColorMaski(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a)
   11530 {
   11531    GET_CURRENT_CONTEXT(ctx);
   11532    size_t cmd_size = sizeof(struct marshal_cmd_ColorMaski);
   11533    struct marshal_cmd_ColorMaski *cmd;
   11534    debug_print_marshal("ColorMaski");
   11535    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11536       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorMaski, cmd_size);
   11537       cmd->buf = buf;
   11538       cmd->r = r;
   11539       cmd->g = g;
   11540       cmd->b = b;
   11541       cmd->a = a;
   11542       _mesa_post_marshal_hook(ctx);
   11543       return;
   11544    }
   11545 
   11546    _mesa_glthread_finish(ctx);
   11547    debug_print_sync_fallback("ColorMaski");
   11548    CALL_ColorMaski(ctx->CurrentServerDispatch, (buf, r, g, b, a));
   11549 }
   11550 
   11551 
   11552 /* Uniform2uiv: marshalled asynchronously */
   11553 struct marshal_cmd_Uniform2uiv
   11554 {
   11555    struct marshal_cmd_base cmd_base;
   11556    GLint location;
   11557    GLsizei count;
   11558    /* Next safe_mul(count, 8) bytes are GLuint value[count][2] */
   11559 };
   11560 static inline void
   11561 _mesa_unmarshal_Uniform2uiv(struct gl_context *ctx, const struct marshal_cmd_Uniform2uiv *cmd)
   11562 {
   11563    const GLint location = cmd->location;
   11564    const GLsizei count = cmd->count;
   11565    const GLuint * value;
   11566    const char *variable_data = (const char *) (cmd + 1);
   11567    value = (const GLuint *) variable_data;
   11568    variable_data += count * 8;
   11569    CALL_Uniform2uiv(ctx->CurrentServerDispatch, (location, count, value));
   11570 }
   11571 static void GLAPIENTRY
   11572 _mesa_marshal_Uniform2uiv(GLint location, GLsizei count, const GLuint * value)
   11573 {
   11574    GET_CURRENT_CONTEXT(ctx);
   11575    size_t cmd_size = sizeof(struct marshal_cmd_Uniform2uiv) + safe_mul(count, 8);
   11576    struct marshal_cmd_Uniform2uiv *cmd;
   11577    debug_print_marshal("Uniform2uiv");
   11578    if (unlikely(safe_mul(count, 8) < 0)) {
   11579       goto fallback_to_sync;
   11580    }
   11581    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11582       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2uiv, cmd_size);
   11583       cmd->location = location;
   11584       cmd->count = count;
   11585       char *variable_data = (char *) (cmd + 1);
   11586       memcpy(variable_data, value, count * 8);
   11587       variable_data += count * 8;
   11588       _mesa_post_marshal_hook(ctx);
   11589       return;
   11590    }
   11591 
   11592 fallback_to_sync:
   11593    _mesa_glthread_finish(ctx);
   11594    debug_print_sync_fallback("Uniform2uiv");
   11595    CALL_Uniform2uiv(ctx->CurrentServerDispatch, (location, count, value));
   11596 }
   11597 
   11598 
   11599 /* RasterPos3s: marshalled asynchronously */
   11600 struct marshal_cmd_RasterPos3s
   11601 {
   11602    struct marshal_cmd_base cmd_base;
   11603    GLshort x;
   11604    GLshort y;
   11605    GLshort z;
   11606 };
   11607 static inline void
   11608 _mesa_unmarshal_RasterPos3s(struct gl_context *ctx, const struct marshal_cmd_RasterPos3s *cmd)
   11609 {
   11610    const GLshort x = cmd->x;
   11611    const GLshort y = cmd->y;
   11612    const GLshort z = cmd->z;
   11613    CALL_RasterPos3s(ctx->CurrentServerDispatch, (x, y, z));
   11614 }
   11615 static void GLAPIENTRY
   11616 _mesa_marshal_RasterPos3s(GLshort x, GLshort y, GLshort z)
   11617 {
   11618    GET_CURRENT_CONTEXT(ctx);
   11619    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos3s);
   11620    struct marshal_cmd_RasterPos3s *cmd;
   11621    debug_print_marshal("RasterPos3s");
   11622    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11623       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos3s, cmd_size);
   11624       cmd->x = x;
   11625       cmd->y = y;
   11626       cmd->z = z;
   11627       _mesa_post_marshal_hook(ctx);
   11628       return;
   11629    }
   11630 
   11631    _mesa_glthread_finish(ctx);
   11632    debug_print_sync_fallback("RasterPos3s");
   11633    CALL_RasterPos3s(ctx->CurrentServerDispatch, (x, y, z));
   11634 }
   11635 
   11636 
   11637 /* RasterPos3d: marshalled asynchronously */
   11638 struct marshal_cmd_RasterPos3d
   11639 {
   11640    struct marshal_cmd_base cmd_base;
   11641    GLdouble x;
   11642    GLdouble y;
   11643    GLdouble z;
   11644 };
   11645 static inline void
   11646 _mesa_unmarshal_RasterPos3d(struct gl_context *ctx, const struct marshal_cmd_RasterPos3d *cmd)
   11647 {
   11648    const GLdouble x = cmd->x;
   11649    const GLdouble y = cmd->y;
   11650    const GLdouble z = cmd->z;
   11651    CALL_RasterPos3d(ctx->CurrentServerDispatch, (x, y, z));
   11652 }
   11653 static void GLAPIENTRY
   11654 _mesa_marshal_RasterPos3d(GLdouble x, GLdouble y, GLdouble z)
   11655 {
   11656    GET_CURRENT_CONTEXT(ctx);
   11657    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos3d);
   11658    struct marshal_cmd_RasterPos3d *cmd;
   11659    debug_print_marshal("RasterPos3d");
   11660    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11661       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos3d, cmd_size);
   11662       cmd->x = x;
   11663       cmd->y = y;
   11664       cmd->z = z;
   11665       _mesa_post_marshal_hook(ctx);
   11666       return;
   11667    }
   11668 
   11669    _mesa_glthread_finish(ctx);
   11670    debug_print_sync_fallback("RasterPos3d");
   11671    CALL_RasterPos3d(ctx->CurrentServerDispatch, (x, y, z));
   11672 }
   11673 
   11674 
   11675 /* RasterPos3f: marshalled asynchronously */
   11676 struct marshal_cmd_RasterPos3f
   11677 {
   11678    struct marshal_cmd_base cmd_base;
   11679    GLfloat x;
   11680    GLfloat y;
   11681    GLfloat z;
   11682 };
   11683 static inline void
   11684 _mesa_unmarshal_RasterPos3f(struct gl_context *ctx, const struct marshal_cmd_RasterPos3f *cmd)
   11685 {
   11686    const GLfloat x = cmd->x;
   11687    const GLfloat y = cmd->y;
   11688    const GLfloat z = cmd->z;
   11689    CALL_RasterPos3f(ctx->CurrentServerDispatch, (x, y, z));
   11690 }
   11691 static void GLAPIENTRY
   11692 _mesa_marshal_RasterPos3f(GLfloat x, GLfloat y, GLfloat z)
   11693 {
   11694    GET_CURRENT_CONTEXT(ctx);
   11695    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos3f);
   11696    struct marshal_cmd_RasterPos3f *cmd;
   11697    debug_print_marshal("RasterPos3f");
   11698    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11699       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos3f, cmd_size);
   11700       cmd->x = x;
   11701       cmd->y = y;
   11702       cmd->z = z;
   11703       _mesa_post_marshal_hook(ctx);
   11704       return;
   11705    }
   11706 
   11707    _mesa_glthread_finish(ctx);
   11708    debug_print_sync_fallback("RasterPos3f");
   11709    CALL_RasterPos3f(ctx->CurrentServerDispatch, (x, y, z));
   11710 }
   11711 
   11712 
   11713 /* BindVertexArray: marshalled asynchronously */
   11714 struct marshal_cmd_BindVertexArray
   11715 {
   11716    struct marshal_cmd_base cmd_base;
   11717    GLuint array;
   11718 };
   11719 static inline void
   11720 _mesa_unmarshal_BindVertexArray(struct gl_context *ctx, const struct marshal_cmd_BindVertexArray *cmd)
   11721 {
   11722    const GLuint array = cmd->array;
   11723    CALL_BindVertexArray(ctx->CurrentServerDispatch, (array));
   11724 }
   11725 static void GLAPIENTRY
   11726 _mesa_marshal_BindVertexArray(GLuint array)
   11727 {
   11728    GET_CURRENT_CONTEXT(ctx);
   11729    size_t cmd_size = sizeof(struct marshal_cmd_BindVertexArray);
   11730    struct marshal_cmd_BindVertexArray *cmd;
   11731    debug_print_marshal("BindVertexArray");
   11732    if (_mesa_glthread_is_compat_bind_vertex_array(ctx)) {
   11733       _mesa_glthread_finish(ctx);
   11734       _mesa_glthread_restore_dispatch(ctx);
   11735       debug_print_sync_fallback("BindVertexArray");
   11736       CALL_BindVertexArray(ctx->CurrentServerDispatch, (array));
   11737       return;
   11738    }
   11739    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11740       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindVertexArray, cmd_size);
   11741       cmd->array = array;
   11742       _mesa_post_marshal_hook(ctx);
   11743       return;
   11744    }
   11745 
   11746    _mesa_glthread_finish(ctx);
   11747    debug_print_sync_fallback("BindVertexArray");
   11748    CALL_BindVertexArray(ctx->CurrentServerDispatch, (array));
   11749 }
   11750 
   11751 
   11752 /* RasterPos3i: marshalled asynchronously */
   11753 struct marshal_cmd_RasterPos3i
   11754 {
   11755    struct marshal_cmd_base cmd_base;
   11756    GLint x;
   11757    GLint y;
   11758    GLint z;
   11759 };
   11760 static inline void
   11761 _mesa_unmarshal_RasterPos3i(struct gl_context *ctx, const struct marshal_cmd_RasterPos3i *cmd)
   11762 {
   11763    const GLint x = cmd->x;
   11764    const GLint y = cmd->y;
   11765    const GLint z = cmd->z;
   11766    CALL_RasterPos3i(ctx->CurrentServerDispatch, (x, y, z));
   11767 }
   11768 static void GLAPIENTRY
   11769 _mesa_marshal_RasterPos3i(GLint x, GLint y, GLint z)
   11770 {
   11771    GET_CURRENT_CONTEXT(ctx);
   11772    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos3i);
   11773    struct marshal_cmd_RasterPos3i *cmd;
   11774    debug_print_marshal("RasterPos3i");
   11775    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11776       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos3i, cmd_size);
   11777       cmd->x = x;
   11778       cmd->y = y;
   11779       cmd->z = z;
   11780       _mesa_post_marshal_hook(ctx);
   11781       return;
   11782    }
   11783 
   11784    _mesa_glthread_finish(ctx);
   11785    debug_print_sync_fallback("RasterPos3i");
   11786    CALL_RasterPos3i(ctx->CurrentServerDispatch, (x, y, z));
   11787 }
   11788 
   11789 
   11790 /* VertexAttribL3dv: marshalled synchronously */
   11791 static void GLAPIENTRY
   11792 _mesa_marshal_VertexAttribL3dv(GLuint index, const GLdouble * v)
   11793 {
   11794    GET_CURRENT_CONTEXT(ctx);
   11795    _mesa_glthread_finish(ctx);
   11796    debug_print_sync("VertexAttribL3dv");
   11797    CALL_VertexAttribL3dv(ctx->CurrentServerDispatch, (index, v));
   11798 }
   11799 
   11800 
   11801 /* GetTexParameteriv: marshalled synchronously */
   11802 static void GLAPIENTRY
   11803 _mesa_marshal_GetTexParameteriv(GLenum target, GLenum pname, GLint * params)
   11804 {
   11805    GET_CURRENT_CONTEXT(ctx);
   11806    _mesa_glthread_finish(ctx);
   11807    debug_print_sync("GetTexParameteriv");
   11808    CALL_GetTexParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
   11809 }
   11810 
   11811 
   11812 /* DrawTransformFeedbackStreamInstanced: marshalled asynchronously */
   11813 struct marshal_cmd_DrawTransformFeedbackStreamInstanced
   11814 {
   11815    struct marshal_cmd_base cmd_base;
   11816    GLenum mode;
   11817    GLuint id;
   11818    GLuint stream;
   11819    GLsizei primcount;
   11820 };
   11821 static inline void
   11822 _mesa_unmarshal_DrawTransformFeedbackStreamInstanced(struct gl_context *ctx, const struct marshal_cmd_DrawTransformFeedbackStreamInstanced *cmd)
   11823 {
   11824    const GLenum mode = cmd->mode;
   11825    const GLuint id = cmd->id;
   11826    const GLuint stream = cmd->stream;
   11827    const GLsizei primcount = cmd->primcount;
   11828    CALL_DrawTransformFeedbackStreamInstanced(ctx->CurrentServerDispatch, (mode, id, stream, primcount));
   11829 }
   11830 static void GLAPIENTRY
   11831 _mesa_marshal_DrawTransformFeedbackStreamInstanced(GLenum mode, GLuint id, GLuint stream, GLsizei primcount)
   11832 {
   11833    GET_CURRENT_CONTEXT(ctx);
   11834    size_t cmd_size = sizeof(struct marshal_cmd_DrawTransformFeedbackStreamInstanced);
   11835    struct marshal_cmd_DrawTransformFeedbackStreamInstanced *cmd;
   11836    debug_print_marshal("DrawTransformFeedbackStreamInstanced");
   11837    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11838       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTransformFeedbackStreamInstanced, cmd_size);
   11839       cmd->mode = mode;
   11840       cmd->id = id;
   11841       cmd->stream = stream;
   11842       cmd->primcount = primcount;
   11843       _mesa_post_marshal_hook(ctx);
   11844       return;
   11845    }
   11846 
   11847    _mesa_glthread_finish(ctx);
   11848    debug_print_sync_fallback("DrawTransformFeedbackStreamInstanced");
   11849    CALL_DrawTransformFeedbackStreamInstanced(ctx->CurrentServerDispatch, (mode, id, stream, primcount));
   11850 }
   11851 
   11852 
   11853 /* VertexAttrib2fvARB: marshalled asynchronously */
   11854 struct marshal_cmd_VertexAttrib2fvARB
   11855 {
   11856    struct marshal_cmd_base cmd_base;
   11857    GLuint index;
   11858    GLfloat v[2];
   11859 };
   11860 static inline void
   11861 _mesa_unmarshal_VertexAttrib2fvARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2fvARB *cmd)
   11862 {
   11863    const GLuint index = cmd->index;
   11864    const GLfloat * v = cmd->v;
   11865    CALL_VertexAttrib2fvARB(ctx->CurrentServerDispatch, (index, v));
   11866 }
   11867 static void GLAPIENTRY
   11868 _mesa_marshal_VertexAttrib2fvARB(GLuint index, const GLfloat * v)
   11869 {
   11870    GET_CURRENT_CONTEXT(ctx);
   11871    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib2fvARB);
   11872    struct marshal_cmd_VertexAttrib2fvARB *cmd;
   11873    debug_print_marshal("VertexAttrib2fvARB");
   11874    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11875       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2fvARB, cmd_size);
   11876       cmd->index = index;
   11877       memcpy(cmd->v, v, 8);
   11878       _mesa_post_marshal_hook(ctx);
   11879       return;
   11880    }
   11881 
   11882    _mesa_glthread_finish(ctx);
   11883    debug_print_sync_fallback("VertexAttrib2fvARB");
   11884    CALL_VertexAttrib2fvARB(ctx->CurrentServerDispatch, (index, v));
   11885 }
   11886 
   11887 
   11888 /* GetProgramResourceName: marshalled synchronously */
   11889 static void GLAPIENTRY
   11890 _mesa_marshal_GetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei  bufSize, GLsizei * length, GLchar * name)
   11891 {
   11892    GET_CURRENT_CONTEXT(ctx);
   11893    _mesa_glthread_finish(ctx);
   11894    debug_print_sync("GetProgramResourceName");
   11895    CALL_GetProgramResourceName(ctx->CurrentServerDispatch, (program, programInterface, index, bufSize, length, name));
   11896 }
   11897 
   11898 
   11899 /* ProgramUniformMatrix4x3dv: marshalled asynchronously */
   11900 struct marshal_cmd_ProgramUniformMatrix4x3dv
   11901 {
   11902    struct marshal_cmd_base cmd_base;
   11903    GLuint program;
   11904    GLint location;
   11905    GLsizei count;
   11906    GLboolean transpose;
   11907    /* Next safe_mul(count, 96) bytes are GLdouble value[count][12] */
   11908 };
   11909 static inline void
   11910 _mesa_unmarshal_ProgramUniformMatrix4x3dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix4x3dv *cmd)
   11911 {
   11912    const GLuint program = cmd->program;
   11913    const GLint location = cmd->location;
   11914    const GLsizei count = cmd->count;
   11915    const GLboolean transpose = cmd->transpose;
   11916    const GLdouble * value;
   11917    const char *variable_data = (const char *) (cmd + 1);
   11918    value = (const GLdouble *) variable_data;
   11919    variable_data += count * 96;
   11920    CALL_ProgramUniformMatrix4x3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   11921 }
   11922 static void GLAPIENTRY
   11923 _mesa_marshal_ProgramUniformMatrix4x3dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   11924 {
   11925    GET_CURRENT_CONTEXT(ctx);
   11926    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix4x3dv) + safe_mul(count, 96);
   11927    struct marshal_cmd_ProgramUniformMatrix4x3dv *cmd;
   11928    debug_print_marshal("ProgramUniformMatrix4x3dv");
   11929    if (unlikely(safe_mul(count, 96) < 0)) {
   11930       goto fallback_to_sync;
   11931    }
   11932    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11933       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix4x3dv, cmd_size);
   11934       cmd->program = program;
   11935       cmd->location = location;
   11936       cmd->count = count;
   11937       cmd->transpose = transpose;
   11938       char *variable_data = (char *) (cmd + 1);
   11939       memcpy(variable_data, value, count * 96);
   11940       variable_data += count * 96;
   11941       _mesa_post_marshal_hook(ctx);
   11942       return;
   11943    }
   11944 
   11945 fallback_to_sync:
   11946    _mesa_glthread_finish(ctx);
   11947    debug_print_sync_fallback("ProgramUniformMatrix4x3dv");
   11948    CALL_ProgramUniformMatrix4x3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   11949 }
   11950 
   11951 
   11952 /* ColorTable: marshalled synchronously */
   11953 static void GLAPIENTRY
   11954 _mesa_marshal_ColorTable(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * table)
   11955 {
   11956    GET_CURRENT_CONTEXT(ctx);
   11957    _mesa_glthread_finish(ctx);
   11958    debug_print_sync("ColorTable");
   11959    CALL_ColorTable(ctx->CurrentServerDispatch, (target, internalformat, width, format, type, table));
   11960 }
   11961 
   11962 
   11963 /* LoadName: marshalled asynchronously */
   11964 struct marshal_cmd_LoadName
   11965 {
   11966    struct marshal_cmd_base cmd_base;
   11967    GLuint name;
   11968 };
   11969 static inline void
   11970 _mesa_unmarshal_LoadName(struct gl_context *ctx, const struct marshal_cmd_LoadName *cmd)
   11971 {
   11972    const GLuint name = cmd->name;
   11973    CALL_LoadName(ctx->CurrentServerDispatch, (name));
   11974 }
   11975 static void GLAPIENTRY
   11976 _mesa_marshal_LoadName(GLuint name)
   11977 {
   11978    GET_CURRENT_CONTEXT(ctx);
   11979    size_t cmd_size = sizeof(struct marshal_cmd_LoadName);
   11980    struct marshal_cmd_LoadName *cmd;
   11981    debug_print_marshal("LoadName");
   11982    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   11983       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LoadName, cmd_size);
   11984       cmd->name = name;
   11985       _mesa_post_marshal_hook(ctx);
   11986       return;
   11987    }
   11988 
   11989    _mesa_glthread_finish(ctx);
   11990    debug_print_sync_fallback("LoadName");
   11991    CALL_LoadName(ctx->CurrentServerDispatch, (name));
   11992 }
   11993 
   11994 
   11995 /* GetnUniformuivARB: marshalled synchronously */
   11996 static void GLAPIENTRY
   11997 _mesa_marshal_GetnUniformuivARB(GLuint program, GLint location, GLsizei bufSize, GLuint * params)
   11998 {
   11999    GET_CURRENT_CONTEXT(ctx);
   12000    _mesa_glthread_finish(ctx);
   12001    debug_print_sync("GetnUniformuivARB");
   12002    CALL_GetnUniformuivARB(ctx->CurrentServerDispatch, (program, location, bufSize, params));
   12003 }
   12004 
   12005 
   12006 /* ClearIndex: marshalled asynchronously */
   12007 struct marshal_cmd_ClearIndex
   12008 {
   12009    struct marshal_cmd_base cmd_base;
   12010    GLfloat c;
   12011 };
   12012 static inline void
   12013 _mesa_unmarshal_ClearIndex(struct gl_context *ctx, const struct marshal_cmd_ClearIndex *cmd)
   12014 {
   12015    const GLfloat c = cmd->c;
   12016    CALL_ClearIndex(ctx->CurrentServerDispatch, (c));
   12017 }
   12018 static void GLAPIENTRY
   12019 _mesa_marshal_ClearIndex(GLfloat c)
   12020 {
   12021    GET_CURRENT_CONTEXT(ctx);
   12022    size_t cmd_size = sizeof(struct marshal_cmd_ClearIndex);
   12023    struct marshal_cmd_ClearIndex *cmd;
   12024    debug_print_marshal("ClearIndex");
   12025    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12026       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearIndex, cmd_size);
   12027       cmd->c = c;
   12028       _mesa_post_marshal_hook(ctx);
   12029       return;
   12030    }
   12031 
   12032    _mesa_glthread_finish(ctx);
   12033    debug_print_sync_fallback("ClearIndex");
   12034    CALL_ClearIndex(ctx->CurrentServerDispatch, (c));
   12035 }
   12036 
   12037 
   12038 /* ConvolutionParameterfv: marshalled synchronously */
   12039 static void GLAPIENTRY
   12040 _mesa_marshal_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat * params)
   12041 {
   12042    GET_CURRENT_CONTEXT(ctx);
   12043    _mesa_glthread_finish(ctx);
   12044    debug_print_sync("ConvolutionParameterfv");
   12045    CALL_ConvolutionParameterfv(ctx->CurrentServerDispatch, (target, pname, params));
   12046 }
   12047 
   12048 
   12049 /* GetTexGendv: marshalled synchronously */
   12050 static void GLAPIENTRY
   12051 _mesa_marshal_GetTexGendv(GLenum coord, GLenum pname, GLdouble * params)
   12052 {
   12053    GET_CURRENT_CONTEXT(ctx);
   12054    _mesa_glthread_finish(ctx);
   12055    debug_print_sync("GetTexGendv");
   12056    CALL_GetTexGendv(ctx->CurrentServerDispatch, (coord, pname, params));
   12057 }
   12058 
   12059 
   12060 /* FlushMappedNamedBufferRange: marshalled asynchronously */
   12061 struct marshal_cmd_FlushMappedNamedBufferRange
   12062 {
   12063    struct marshal_cmd_base cmd_base;
   12064    GLuint buffer;
   12065    GLintptr offset;
   12066    GLsizeiptr length;
   12067 };
   12068 static inline void
   12069 _mesa_unmarshal_FlushMappedNamedBufferRange(struct gl_context *ctx, const struct marshal_cmd_FlushMappedNamedBufferRange *cmd)
   12070 {
   12071    const GLuint buffer = cmd->buffer;
   12072    const GLintptr offset = cmd->offset;
   12073    const GLsizeiptr length = cmd->length;
   12074    CALL_FlushMappedNamedBufferRange(ctx->CurrentServerDispatch, (buffer, offset, length));
   12075 }
   12076 static void GLAPIENTRY
   12077 _mesa_marshal_FlushMappedNamedBufferRange(GLuint buffer, GLintptr offset, GLsizeiptr length)
   12078 {
   12079    GET_CURRENT_CONTEXT(ctx);
   12080    size_t cmd_size = sizeof(struct marshal_cmd_FlushMappedNamedBufferRange);
   12081    struct marshal_cmd_FlushMappedNamedBufferRange *cmd;
   12082    debug_print_marshal("FlushMappedNamedBufferRange");
   12083    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12084       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FlushMappedNamedBufferRange, cmd_size);
   12085       cmd->buffer = buffer;
   12086       cmd->offset = offset;
   12087       cmd->length = length;
   12088       _mesa_post_marshal_hook(ctx);
   12089       return;
   12090    }
   12091 
   12092    _mesa_glthread_finish(ctx);
   12093    debug_print_sync_fallback("FlushMappedNamedBufferRange");
   12094    CALL_FlushMappedNamedBufferRange(ctx->CurrentServerDispatch, (buffer, offset, length));
   12095 }
   12096 
   12097 
   12098 /* MultiTexCoordP1ui: marshalled asynchronously */
   12099 struct marshal_cmd_MultiTexCoordP1ui
   12100 {
   12101    struct marshal_cmd_base cmd_base;
   12102    GLenum texture;
   12103    GLenum type;
   12104    GLuint coords;
   12105 };
   12106 static inline void
   12107 _mesa_unmarshal_MultiTexCoordP1ui(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP1ui *cmd)
   12108 {
   12109    const GLenum texture = cmd->texture;
   12110    const GLenum type = cmd->type;
   12111    const GLuint coords = cmd->coords;
   12112    CALL_MultiTexCoordP1ui(ctx->CurrentServerDispatch, (texture, type, coords));
   12113 }
   12114 static void GLAPIENTRY
   12115 _mesa_marshal_MultiTexCoordP1ui(GLenum texture, GLenum type, GLuint coords)
   12116 {
   12117    GET_CURRENT_CONTEXT(ctx);
   12118    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP1ui);
   12119    struct marshal_cmd_MultiTexCoordP1ui *cmd;
   12120    debug_print_marshal("MultiTexCoordP1ui");
   12121    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12122       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP1ui, cmd_size);
   12123       cmd->texture = texture;
   12124       cmd->type = type;
   12125       cmd->coords = coords;
   12126       _mesa_post_marshal_hook(ctx);
   12127       return;
   12128    }
   12129 
   12130    _mesa_glthread_finish(ctx);
   12131    debug_print_sync_fallback("MultiTexCoordP1ui");
   12132    CALL_MultiTexCoordP1ui(ctx->CurrentServerDispatch, (texture, type, coords));
   12133 }
   12134 
   12135 
   12136 /* EvalMesh2: marshalled asynchronously */
   12137 struct marshal_cmd_EvalMesh2
   12138 {
   12139    struct marshal_cmd_base cmd_base;
   12140    GLenum mode;
   12141    GLint i1;
   12142    GLint i2;
   12143    GLint j1;
   12144    GLint j2;
   12145 };
   12146 static inline void
   12147 _mesa_unmarshal_EvalMesh2(struct gl_context *ctx, const struct marshal_cmd_EvalMesh2 *cmd)
   12148 {
   12149    const GLenum mode = cmd->mode;
   12150    const GLint i1 = cmd->i1;
   12151    const GLint i2 = cmd->i2;
   12152    const GLint j1 = cmd->j1;
   12153    const GLint j2 = cmd->j2;
   12154    CALL_EvalMesh2(ctx->CurrentServerDispatch, (mode, i1, i2, j1, j2));
   12155 }
   12156 static void GLAPIENTRY
   12157 _mesa_marshal_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
   12158 {
   12159    GET_CURRENT_CONTEXT(ctx);
   12160    size_t cmd_size = sizeof(struct marshal_cmd_EvalMesh2);
   12161    struct marshal_cmd_EvalMesh2 *cmd;
   12162    debug_print_marshal("EvalMesh2");
   12163    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12164       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EvalMesh2, cmd_size);
   12165       cmd->mode = mode;
   12166       cmd->i1 = i1;
   12167       cmd->i2 = i2;
   12168       cmd->j1 = j1;
   12169       cmd->j2 = j2;
   12170       _mesa_post_marshal_hook(ctx);
   12171       return;
   12172    }
   12173 
   12174    _mesa_glthread_finish(ctx);
   12175    debug_print_sync_fallback("EvalMesh2");
   12176    CALL_EvalMesh2(ctx->CurrentServerDispatch, (mode, i1, i2, j1, j2));
   12177 }
   12178 
   12179 
   12180 /* Vertex4fv: marshalled asynchronously */
   12181 struct marshal_cmd_Vertex4fv
   12182 {
   12183    struct marshal_cmd_base cmd_base;
   12184    GLfloat v[4];
   12185 };
   12186 static inline void
   12187 _mesa_unmarshal_Vertex4fv(struct gl_context *ctx, const struct marshal_cmd_Vertex4fv *cmd)
   12188 {
   12189    const GLfloat * v = cmd->v;
   12190    CALL_Vertex4fv(ctx->CurrentServerDispatch, (v));
   12191 }
   12192 static void GLAPIENTRY
   12193 _mesa_marshal_Vertex4fv(const GLfloat * v)
   12194 {
   12195    GET_CURRENT_CONTEXT(ctx);
   12196    size_t cmd_size = sizeof(struct marshal_cmd_Vertex4fv);
   12197    struct marshal_cmd_Vertex4fv *cmd;
   12198    debug_print_marshal("Vertex4fv");
   12199    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12200       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex4fv, cmd_size);
   12201       memcpy(cmd->v, v, 16);
   12202       _mesa_post_marshal_hook(ctx);
   12203       return;
   12204    }
   12205 
   12206    _mesa_glthread_finish(ctx);
   12207    debug_print_sync_fallback("Vertex4fv");
   12208    CALL_Vertex4fv(ctx->CurrentServerDispatch, (v));
   12209 }
   12210 
   12211 
   12212 /* ProgramUniform4i64ARB: marshalled asynchronously */
   12213 struct marshal_cmd_ProgramUniform4i64ARB
   12214 {
   12215    struct marshal_cmd_base cmd_base;
   12216    GLuint program;
   12217    GLint location;
   12218    GLint64 x;
   12219    GLint64 y;
   12220    GLint64 z;
   12221    GLint64 w;
   12222 };
   12223 static inline void
   12224 _mesa_unmarshal_ProgramUniform4i64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4i64ARB *cmd)
   12225 {
   12226    const GLuint program = cmd->program;
   12227    const GLint location = cmd->location;
   12228    const GLint64 x = cmd->x;
   12229    const GLint64 y = cmd->y;
   12230    const GLint64 z = cmd->z;
   12231    const GLint64 w = cmd->w;
   12232    CALL_ProgramUniform4i64ARB(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
   12233 }
   12234 static void GLAPIENTRY
   12235 _mesa_marshal_ProgramUniform4i64ARB(GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w)
   12236 {
   12237    GET_CURRENT_CONTEXT(ctx);
   12238    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform4i64ARB);
   12239    struct marshal_cmd_ProgramUniform4i64ARB *cmd;
   12240    debug_print_marshal("ProgramUniform4i64ARB");
   12241    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12242       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4i64ARB, cmd_size);
   12243       cmd->program = program;
   12244       cmd->location = location;
   12245       cmd->x = x;
   12246       cmd->y = y;
   12247       cmd->z = z;
   12248       cmd->w = w;
   12249       _mesa_post_marshal_hook(ctx);
   12250       return;
   12251    }
   12252 
   12253    _mesa_glthread_finish(ctx);
   12254    debug_print_sync_fallback("ProgramUniform4i64ARB");
   12255    CALL_ProgramUniform4i64ARB(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
   12256 }
   12257 
   12258 
   12259 /* SelectPerfMonitorCountersAMD: marshalled synchronously */
   12260 static void GLAPIENTRY
   12261 _mesa_marshal_SelectPerfMonitorCountersAMD(GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint * counterList)
   12262 {
   12263    GET_CURRENT_CONTEXT(ctx);
   12264    _mesa_glthread_finish(ctx);
   12265    debug_print_sync("SelectPerfMonitorCountersAMD");
   12266    CALL_SelectPerfMonitorCountersAMD(ctx->CurrentServerDispatch, (monitor, enable, group, numCounters, counterList));
   12267 }
   12268 
   12269 
   12270 /* TextureStorage2D: marshalled asynchronously */
   12271 struct marshal_cmd_TextureStorage2D
   12272 {
   12273    struct marshal_cmd_base cmd_base;
   12274    GLuint texture;
   12275    GLsizei levels;
   12276    GLenum internalformat;
   12277    GLsizei width;
   12278    GLsizei height;
   12279 };
   12280 static inline void
   12281 _mesa_unmarshal_TextureStorage2D(struct gl_context *ctx, const struct marshal_cmd_TextureStorage2D *cmd)
   12282 {
   12283    const GLuint texture = cmd->texture;
   12284    const GLsizei levels = cmd->levels;
   12285    const GLenum internalformat = cmd->internalformat;
   12286    const GLsizei width = cmd->width;
   12287    const GLsizei height = cmd->height;
   12288    CALL_TextureStorage2D(ctx->CurrentServerDispatch, (texture, levels, internalformat, width, height));
   12289 }
   12290 static void GLAPIENTRY
   12291 _mesa_marshal_TextureStorage2D(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
   12292 {
   12293    GET_CURRENT_CONTEXT(ctx);
   12294    size_t cmd_size = sizeof(struct marshal_cmd_TextureStorage2D);
   12295    struct marshal_cmd_TextureStorage2D *cmd;
   12296    debug_print_marshal("TextureStorage2D");
   12297    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12298       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage2D, cmd_size);
   12299       cmd->texture = texture;
   12300       cmd->levels = levels;
   12301       cmd->internalformat = internalformat;
   12302       cmd->width = width;
   12303       cmd->height = height;
   12304       _mesa_post_marshal_hook(ctx);
   12305       return;
   12306    }
   12307 
   12308    _mesa_glthread_finish(ctx);
   12309    debug_print_sync_fallback("TextureStorage2D");
   12310    CALL_TextureStorage2D(ctx->CurrentServerDispatch, (texture, levels, internalformat, width, height));
   12311 }
   12312 
   12313 
   12314 /* GetTextureParameterIiv: marshalled synchronously */
   12315 static void GLAPIENTRY
   12316 _mesa_marshal_GetTextureParameterIiv(GLuint texture, GLenum pname, GLint * params)
   12317 {
   12318    GET_CURRENT_CONTEXT(ctx);
   12319    _mesa_glthread_finish(ctx);
   12320    debug_print_sync("GetTextureParameterIiv");
   12321    CALL_GetTextureParameterIiv(ctx->CurrentServerDispatch, (texture, pname, params));
   12322 }
   12323 
   12324 
   12325 /* BindFramebuffer: marshalled asynchronously */
   12326 struct marshal_cmd_BindFramebuffer
   12327 {
   12328    struct marshal_cmd_base cmd_base;
   12329    GLenum target;
   12330    GLuint framebuffer;
   12331 };
   12332 static inline void
   12333 _mesa_unmarshal_BindFramebuffer(struct gl_context *ctx, const struct marshal_cmd_BindFramebuffer *cmd)
   12334 {
   12335    const GLenum target = cmd->target;
   12336    const GLuint framebuffer = cmd->framebuffer;
   12337    CALL_BindFramebuffer(ctx->CurrentServerDispatch, (target, framebuffer));
   12338 }
   12339 static void GLAPIENTRY
   12340 _mesa_marshal_BindFramebuffer(GLenum target, GLuint framebuffer)
   12341 {
   12342    GET_CURRENT_CONTEXT(ctx);
   12343    size_t cmd_size = sizeof(struct marshal_cmd_BindFramebuffer);
   12344    struct marshal_cmd_BindFramebuffer *cmd;
   12345    debug_print_marshal("BindFramebuffer");
   12346    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12347       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindFramebuffer, cmd_size);
   12348       cmd->target = target;
   12349       cmd->framebuffer = framebuffer;
   12350       _mesa_post_marshal_hook(ctx);
   12351       return;
   12352    }
   12353 
   12354    _mesa_glthread_finish(ctx);
   12355    debug_print_sync_fallback("BindFramebuffer");
   12356    CALL_BindFramebuffer(ctx->CurrentServerDispatch, (target, framebuffer));
   12357 }
   12358 
   12359 
   12360 /* GetMinmax: marshalled synchronously */
   12361 static void GLAPIENTRY
   12362 _mesa_marshal_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
   12363 {
   12364    GET_CURRENT_CONTEXT(ctx);
   12365    _mesa_glthread_finish(ctx);
   12366    debug_print_sync("GetMinmax");
   12367    CALL_GetMinmax(ctx->CurrentServerDispatch, (target, reset, format, type, values));
   12368 }
   12369 
   12370 
   12371 /* VertexAttribs3svNV: marshalled asynchronously */
   12372 struct marshal_cmd_VertexAttribs3svNV
   12373 {
   12374    struct marshal_cmd_base cmd_base;
   12375    GLuint index;
   12376    GLsizei n;
   12377    /* Next safe_mul(n, 6) bytes are GLshort v[n][3] */
   12378 };
   12379 static inline void
   12380 _mesa_unmarshal_VertexAttribs3svNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs3svNV *cmd)
   12381 {
   12382    const GLuint index = cmd->index;
   12383    const GLsizei n = cmd->n;
   12384    const GLshort * v;
   12385    const char *variable_data = (const char *) (cmd + 1);
   12386    v = (const GLshort *) variable_data;
   12387    variable_data += n * 6;
   12388    CALL_VertexAttribs3svNV(ctx->CurrentServerDispatch, (index, n, v));
   12389 }
   12390 static void GLAPIENTRY
   12391 _mesa_marshal_VertexAttribs3svNV(GLuint index, GLsizei n, const GLshort * v)
   12392 {
   12393    GET_CURRENT_CONTEXT(ctx);
   12394    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribs3svNV) + safe_mul(n, 6);
   12395    struct marshal_cmd_VertexAttribs3svNV *cmd;
   12396    debug_print_marshal("VertexAttribs3svNV");
   12397    if (unlikely(safe_mul(n, 6) < 0)) {
   12398       goto fallback_to_sync;
   12399    }
   12400    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12401       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs3svNV, cmd_size);
   12402       cmd->index = index;
   12403       cmd->n = n;
   12404       char *variable_data = (char *) (cmd + 1);
   12405       memcpy(variable_data, v, n * 6);
   12406       variable_data += n * 6;
   12407       _mesa_post_marshal_hook(ctx);
   12408       return;
   12409    }
   12410 
   12411 fallback_to_sync:
   12412    _mesa_glthread_finish(ctx);
   12413    debug_print_sync_fallback("VertexAttribs3svNV");
   12414    CALL_VertexAttribs3svNV(ctx->CurrentServerDispatch, (index, n, v));
   12415 }
   12416 
   12417 
   12418 /* GetActiveUniformsiv: marshalled synchronously */
   12419 static void GLAPIENTRY
   12420 _mesa_marshal_GetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params)
   12421 {
   12422    GET_CURRENT_CONTEXT(ctx);
   12423    _mesa_glthread_finish(ctx);
   12424    debug_print_sync("GetActiveUniformsiv");
   12425    CALL_GetActiveUniformsiv(ctx->CurrentServerDispatch, (program, uniformCount, uniformIndices, pname, params));
   12426 }
   12427 
   12428 
   12429 /* VertexAttrib2sv: marshalled asynchronously */
   12430 struct marshal_cmd_VertexAttrib2sv
   12431 {
   12432    struct marshal_cmd_base cmd_base;
   12433    GLuint index;
   12434    GLshort v[2];
   12435 };
   12436 static inline void
   12437 _mesa_unmarshal_VertexAttrib2sv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2sv *cmd)
   12438 {
   12439    const GLuint index = cmd->index;
   12440    const GLshort * v = cmd->v;
   12441    CALL_VertexAttrib2sv(ctx->CurrentServerDispatch, (index, v));
   12442 }
   12443 static void GLAPIENTRY
   12444 _mesa_marshal_VertexAttrib2sv(GLuint index, const GLshort * v)
   12445 {
   12446    GET_CURRENT_CONTEXT(ctx);
   12447    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib2sv);
   12448    struct marshal_cmd_VertexAttrib2sv *cmd;
   12449    debug_print_marshal("VertexAttrib2sv");
   12450    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12451       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2sv, cmd_size);
   12452       cmd->index = index;
   12453       memcpy(cmd->v, v, 4);
   12454       _mesa_post_marshal_hook(ctx);
   12455       return;
   12456    }
   12457 
   12458    _mesa_glthread_finish(ctx);
   12459    debug_print_sync_fallback("VertexAttrib2sv");
   12460    CALL_VertexAttrib2sv(ctx->CurrentServerDispatch, (index, v));
   12461 }
   12462 
   12463 
   12464 /* GetProgramEnvParameterdvARB: marshalled synchronously */
   12465 static void GLAPIENTRY
   12466 _mesa_marshal_GetProgramEnvParameterdvARB(GLenum target, GLuint index, GLdouble * params)
   12467 {
   12468    GET_CURRENT_CONTEXT(ctx);
   12469    _mesa_glthread_finish(ctx);
   12470    debug_print_sync("GetProgramEnvParameterdvARB");
   12471    CALL_GetProgramEnvParameterdvARB(ctx->CurrentServerDispatch, (target, index, params));
   12472 }
   12473 
   12474 
   12475 /* Uniform1dv: marshalled asynchronously */
   12476 struct marshal_cmd_Uniform1dv
   12477 {
   12478    struct marshal_cmd_base cmd_base;
   12479    GLint location;
   12480    GLsizei count;
   12481    /* Next safe_mul(count, 8) bytes are GLdouble value[count] */
   12482 };
   12483 static inline void
   12484 _mesa_unmarshal_Uniform1dv(struct gl_context *ctx, const struct marshal_cmd_Uniform1dv *cmd)
   12485 {
   12486    const GLint location = cmd->location;
   12487    const GLsizei count = cmd->count;
   12488    const GLdouble * value;
   12489    const char *variable_data = (const char *) (cmd + 1);
   12490    value = (const GLdouble *) variable_data;
   12491    variable_data += count * 8;
   12492    CALL_Uniform1dv(ctx->CurrentServerDispatch, (location, count, value));
   12493 }
   12494 static void GLAPIENTRY
   12495 _mesa_marshal_Uniform1dv(GLint location, GLsizei count, const GLdouble * value)
   12496 {
   12497    GET_CURRENT_CONTEXT(ctx);
   12498    size_t cmd_size = sizeof(struct marshal_cmd_Uniform1dv) + safe_mul(count, 8);
   12499    struct marshal_cmd_Uniform1dv *cmd;
   12500    debug_print_marshal("Uniform1dv");
   12501    if (unlikely(safe_mul(count, 8) < 0)) {
   12502       goto fallback_to_sync;
   12503    }
   12504    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12505       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1dv, cmd_size);
   12506       cmd->location = location;
   12507       cmd->count = count;
   12508       char *variable_data = (char *) (cmd + 1);
   12509       memcpy(variable_data, value, count * 8);
   12510       variable_data += count * 8;
   12511       _mesa_post_marshal_hook(ctx);
   12512       return;
   12513    }
   12514 
   12515 fallback_to_sync:
   12516    _mesa_glthread_finish(ctx);
   12517    debug_print_sync_fallback("Uniform1dv");
   12518    CALL_Uniform1dv(ctx->CurrentServerDispatch, (location, count, value));
   12519 }
   12520 
   12521 
   12522 /* TransformFeedbackBufferRange: marshalled asynchronously */
   12523 struct marshal_cmd_TransformFeedbackBufferRange
   12524 {
   12525    struct marshal_cmd_base cmd_base;
   12526    GLuint xfb;
   12527    GLuint index;
   12528    GLuint buffer;
   12529    GLintptr offset;
   12530    GLsizeiptr size;
   12531 };
   12532 static inline void
   12533 _mesa_unmarshal_TransformFeedbackBufferRange(struct gl_context *ctx, const struct marshal_cmd_TransformFeedbackBufferRange *cmd)
   12534 {
   12535    const GLuint xfb = cmd->xfb;
   12536    const GLuint index = cmd->index;
   12537    const GLuint buffer = cmd->buffer;
   12538    const GLintptr offset = cmd->offset;
   12539    const GLsizeiptr size = cmd->size;
   12540    CALL_TransformFeedbackBufferRange(ctx->CurrentServerDispatch, (xfb, index, buffer, offset, size));
   12541 }
   12542 static void GLAPIENTRY
   12543 _mesa_marshal_TransformFeedbackBufferRange(GLuint xfb, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
   12544 {
   12545    GET_CURRENT_CONTEXT(ctx);
   12546    size_t cmd_size = sizeof(struct marshal_cmd_TransformFeedbackBufferRange);
   12547    struct marshal_cmd_TransformFeedbackBufferRange *cmd;
   12548    debug_print_marshal("TransformFeedbackBufferRange");
   12549    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12550       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TransformFeedbackBufferRange, cmd_size);
   12551       cmd->xfb = xfb;
   12552       cmd->index = index;
   12553       cmd->buffer = buffer;
   12554       cmd->offset = offset;
   12555       cmd->size = size;
   12556       _mesa_post_marshal_hook(ctx);
   12557       return;
   12558    }
   12559 
   12560    _mesa_glthread_finish(ctx);
   12561    debug_print_sync_fallback("TransformFeedbackBufferRange");
   12562    CALL_TransformFeedbackBufferRange(ctx->CurrentServerDispatch, (xfb, index, buffer, offset, size));
   12563 }
   12564 
   12565 
   12566 /* PushDebugGroup: marshalled synchronously */
   12567 static void GLAPIENTRY
   12568 _mesa_marshal_PushDebugGroup(GLenum source, GLuint id, GLsizei length, const GLchar * message)
   12569 {
   12570    GET_CURRENT_CONTEXT(ctx);
   12571    _mesa_glthread_finish(ctx);
   12572    debug_print_sync("PushDebugGroup");
   12573    CALL_PushDebugGroup(ctx->CurrentServerDispatch, (source, id, length, message));
   12574 }
   12575 
   12576 
   12577 /* GetPerfMonitorGroupStringAMD: marshalled synchronously */
   12578 static void GLAPIENTRY
   12579 _mesa_marshal_GetPerfMonitorGroupStringAMD(GLuint group, GLsizei bufSize, GLsizei * length, GLchar * groupString)
   12580 {
   12581    GET_CURRENT_CONTEXT(ctx);
   12582    _mesa_glthread_finish(ctx);
   12583    debug_print_sync("GetPerfMonitorGroupStringAMD");
   12584    CALL_GetPerfMonitorGroupStringAMD(ctx->CurrentServerDispatch, (group, bufSize, length, groupString));
   12585 }
   12586 
   12587 
   12588 /* GetError: marshalled synchronously */
   12589 static GLenum GLAPIENTRY
   12590 _mesa_marshal_GetError(void)
   12591 {
   12592    GET_CURRENT_CONTEXT(ctx);
   12593    _mesa_glthread_finish(ctx);
   12594    debug_print_sync("GetError");
   12595    return CALL_GetError(ctx->CurrentServerDispatch, ());
   12596 }
   12597 
   12598 
   12599 /* PassThrough: marshalled asynchronously */
   12600 struct marshal_cmd_PassThrough
   12601 {
   12602    struct marshal_cmd_base cmd_base;
   12603    GLfloat token;
   12604 };
   12605 static inline void
   12606 _mesa_unmarshal_PassThrough(struct gl_context *ctx, const struct marshal_cmd_PassThrough *cmd)
   12607 {
   12608    const GLfloat token = cmd->token;
   12609    CALL_PassThrough(ctx->CurrentServerDispatch, (token));
   12610 }
   12611 static void GLAPIENTRY
   12612 _mesa_marshal_PassThrough(GLfloat token)
   12613 {
   12614    GET_CURRENT_CONTEXT(ctx);
   12615    size_t cmd_size = sizeof(struct marshal_cmd_PassThrough);
   12616    struct marshal_cmd_PassThrough *cmd;
   12617    debug_print_marshal("PassThrough");
   12618    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12619       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PassThrough, cmd_size);
   12620       cmd->token = token;
   12621       _mesa_post_marshal_hook(ctx);
   12622       return;
   12623    }
   12624 
   12625    _mesa_glthread_finish(ctx);
   12626    debug_print_sync_fallback("PassThrough");
   12627    CALL_PassThrough(ctx->CurrentServerDispatch, (token));
   12628 }
   12629 
   12630 
   12631 /* PatchParameterfv: marshalled synchronously */
   12632 static void GLAPIENTRY
   12633 _mesa_marshal_PatchParameterfv(GLenum pname, const GLfloat * values)
   12634 {
   12635    GET_CURRENT_CONTEXT(ctx);
   12636    _mesa_glthread_finish(ctx);
   12637    debug_print_sync("PatchParameterfv");
   12638    CALL_PatchParameterfv(ctx->CurrentServerDispatch, (pname, values));
   12639 }
   12640 
   12641 
   12642 /* GetObjectParameterivAPPLE: marshalled synchronously */
   12643 static void GLAPIENTRY
   12644 _mesa_marshal_GetObjectParameterivAPPLE(GLenum objectType, GLuint name, GLenum pname, GLint * value)
   12645 {
   12646    GET_CURRENT_CONTEXT(ctx);
   12647    _mesa_glthread_finish(ctx);
   12648    debug_print_sync("GetObjectParameterivAPPLE");
   12649    CALL_GetObjectParameterivAPPLE(ctx->CurrentServerDispatch, (objectType, name, pname, value));
   12650 }
   12651 
   12652 
   12653 /* BindBuffersRange: marshalled synchronously */
   12654 static void GLAPIENTRY
   12655 _mesa_marshal_BindBuffersRange(GLenum target, GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizeiptr * sizes)
   12656 {
   12657    GET_CURRENT_CONTEXT(ctx);
   12658    _mesa_glthread_finish(ctx);
   12659    debug_print_sync("BindBuffersRange");
   12660    CALL_BindBuffersRange(ctx->CurrentServerDispatch, (target, first, count, buffers, offsets, sizes));
   12661 }
   12662 
   12663 
   12664 /* VertexAttrib4fvARB: marshalled asynchronously */
   12665 struct marshal_cmd_VertexAttrib4fvARB
   12666 {
   12667    struct marshal_cmd_base cmd_base;
   12668    GLuint index;
   12669    GLfloat v[4];
   12670 };
   12671 static inline void
   12672 _mesa_unmarshal_VertexAttrib4fvARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4fvARB *cmd)
   12673 {
   12674    const GLuint index = cmd->index;
   12675    const GLfloat * v = cmd->v;
   12676    CALL_VertexAttrib4fvARB(ctx->CurrentServerDispatch, (index, v));
   12677 }
   12678 static void GLAPIENTRY
   12679 _mesa_marshal_VertexAttrib4fvARB(GLuint index, const GLfloat * v)
   12680 {
   12681    GET_CURRENT_CONTEXT(ctx);
   12682    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4fvARB);
   12683    struct marshal_cmd_VertexAttrib4fvARB *cmd;
   12684    debug_print_marshal("VertexAttrib4fvARB");
   12685    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12686       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4fvARB, cmd_size);
   12687       cmd->index = index;
   12688       memcpy(cmd->v, v, 16);
   12689       _mesa_post_marshal_hook(ctx);
   12690       return;
   12691    }
   12692 
   12693    _mesa_glthread_finish(ctx);
   12694    debug_print_sync_fallback("VertexAttrib4fvARB");
   12695    CALL_VertexAttrib4fvARB(ctx->CurrentServerDispatch, (index, v));
   12696 }
   12697 
   12698 
   12699 /* Uniform3i64vARB: marshalled asynchronously */
   12700 struct marshal_cmd_Uniform3i64vARB
   12701 {
   12702    struct marshal_cmd_base cmd_base;
   12703    GLint location;
   12704    GLsizei count;
   12705    /* Next safe_mul(count, 24) bytes are GLint64 value[count][3] */
   12706 };
   12707 static inline void
   12708 _mesa_unmarshal_Uniform3i64vARB(struct gl_context *ctx, const struct marshal_cmd_Uniform3i64vARB *cmd)
   12709 {
   12710    const GLint location = cmd->location;
   12711    const GLsizei count = cmd->count;
   12712    const GLint64 * value;
   12713    const char *variable_data = (const char *) (cmd + 1);
   12714    value = (const GLint64 *) variable_data;
   12715    variable_data += count * 24;
   12716    CALL_Uniform3i64vARB(ctx->CurrentServerDispatch, (location, count, value));
   12717 }
   12718 static void GLAPIENTRY
   12719 _mesa_marshal_Uniform3i64vARB(GLint location, GLsizei count, const GLint64 * value)
   12720 {
   12721    GET_CURRENT_CONTEXT(ctx);
   12722    size_t cmd_size = sizeof(struct marshal_cmd_Uniform3i64vARB) + safe_mul(count, 24);
   12723    struct marshal_cmd_Uniform3i64vARB *cmd;
   12724    debug_print_marshal("Uniform3i64vARB");
   12725    if (unlikely(safe_mul(count, 24) < 0)) {
   12726       goto fallback_to_sync;
   12727    }
   12728    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12729       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3i64vARB, cmd_size);
   12730       cmd->location = location;
   12731       cmd->count = count;
   12732       char *variable_data = (char *) (cmd + 1);
   12733       memcpy(variable_data, value, count * 24);
   12734       variable_data += count * 24;
   12735       _mesa_post_marshal_hook(ctx);
   12736       return;
   12737    }
   12738 
   12739 fallback_to_sync:
   12740    _mesa_glthread_finish(ctx);
   12741    debug_print_sync_fallback("Uniform3i64vARB");
   12742    CALL_Uniform3i64vARB(ctx->CurrentServerDispatch, (location, count, value));
   12743 }
   12744 
   12745 
   12746 /* WindowPos3dv: marshalled synchronously */
   12747 static void GLAPIENTRY
   12748 _mesa_marshal_WindowPos3dv(const GLdouble * v)
   12749 {
   12750    GET_CURRENT_CONTEXT(ctx);
   12751    _mesa_glthread_finish(ctx);
   12752    debug_print_sync("WindowPos3dv");
   12753    CALL_WindowPos3dv(ctx->CurrentServerDispatch, (v));
   12754 }
   12755 
   12756 
   12757 /* TexGenxOES: marshalled asynchronously */
   12758 struct marshal_cmd_TexGenxOES
   12759 {
   12760    struct marshal_cmd_base cmd_base;
   12761    GLenum coord;
   12762    GLenum pname;
   12763    GLint param;
   12764 };
   12765 static inline void
   12766 _mesa_unmarshal_TexGenxOES(struct gl_context *ctx, const struct marshal_cmd_TexGenxOES *cmd)
   12767 {
   12768    const GLenum coord = cmd->coord;
   12769    const GLenum pname = cmd->pname;
   12770    const GLint param = cmd->param;
   12771    CALL_TexGenxOES(ctx->CurrentServerDispatch, (coord, pname, param));
   12772 }
   12773 static void GLAPIENTRY
   12774 _mesa_marshal_TexGenxOES(GLenum coord, GLenum pname, GLint param)
   12775 {
   12776    GET_CURRENT_CONTEXT(ctx);
   12777    size_t cmd_size = sizeof(struct marshal_cmd_TexGenxOES);
   12778    struct marshal_cmd_TexGenxOES *cmd;
   12779    debug_print_marshal("TexGenxOES");
   12780    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12781       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexGenxOES, cmd_size);
   12782       cmd->coord = coord;
   12783       cmd->pname = pname;
   12784       cmd->param = param;
   12785       _mesa_post_marshal_hook(ctx);
   12786       return;
   12787    }
   12788 
   12789    _mesa_glthread_finish(ctx);
   12790    debug_print_sync_fallback("TexGenxOES");
   12791    CALL_TexGenxOES(ctx->CurrentServerDispatch, (coord, pname, param));
   12792 }
   12793 
   12794 
   12795 /* VertexArrayAttribIFormat: marshalled asynchronously */
   12796 struct marshal_cmd_VertexArrayAttribIFormat
   12797 {
   12798    struct marshal_cmd_base cmd_base;
   12799    GLuint vaobj;
   12800    GLuint attribindex;
   12801    GLint size;
   12802    GLenum type;
   12803    GLuint relativeoffset;
   12804 };
   12805 static inline void
   12806 _mesa_unmarshal_VertexArrayAttribIFormat(struct gl_context *ctx, const struct marshal_cmd_VertexArrayAttribIFormat *cmd)
   12807 {
   12808    const GLuint vaobj = cmd->vaobj;
   12809    const GLuint attribindex = cmd->attribindex;
   12810    const GLint size = cmd->size;
   12811    const GLenum type = cmd->type;
   12812    const GLuint relativeoffset = cmd->relativeoffset;
   12813    CALL_VertexArrayAttribIFormat(ctx->CurrentServerDispatch, (vaobj, attribindex, size, type, relativeoffset));
   12814 }
   12815 static void GLAPIENTRY
   12816 _mesa_marshal_VertexArrayAttribIFormat(GLuint vaobj, GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
   12817 {
   12818    GET_CURRENT_CONTEXT(ctx);
   12819    size_t cmd_size = sizeof(struct marshal_cmd_VertexArrayAttribIFormat);
   12820    struct marshal_cmd_VertexArrayAttribIFormat *cmd;
   12821    debug_print_marshal("VertexArrayAttribIFormat");
   12822    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12823       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayAttribIFormat, cmd_size);
   12824       cmd->vaobj = vaobj;
   12825       cmd->attribindex = attribindex;
   12826       cmd->size = size;
   12827       cmd->type = type;
   12828       cmd->relativeoffset = relativeoffset;
   12829       _mesa_post_marshal_hook(ctx);
   12830       return;
   12831    }
   12832 
   12833    _mesa_glthread_finish(ctx);
   12834    debug_print_sync_fallback("VertexArrayAttribIFormat");
   12835    CALL_VertexArrayAttribIFormat(ctx->CurrentServerDispatch, (vaobj, attribindex, size, type, relativeoffset));
   12836 }
   12837 
   12838 
   12839 /* StencilOp: marshalled asynchronously */
   12840 struct marshal_cmd_StencilOp
   12841 {
   12842    struct marshal_cmd_base cmd_base;
   12843    GLenum fail;
   12844    GLenum zfail;
   12845    GLenum zpass;
   12846 };
   12847 static inline void
   12848 _mesa_unmarshal_StencilOp(struct gl_context *ctx, const struct marshal_cmd_StencilOp *cmd)
   12849 {
   12850    const GLenum fail = cmd->fail;
   12851    const GLenum zfail = cmd->zfail;
   12852    const GLenum zpass = cmd->zpass;
   12853    CALL_StencilOp(ctx->CurrentServerDispatch, (fail, zfail, zpass));
   12854 }
   12855 static void GLAPIENTRY
   12856 _mesa_marshal_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
   12857 {
   12858    GET_CURRENT_CONTEXT(ctx);
   12859    size_t cmd_size = sizeof(struct marshal_cmd_StencilOp);
   12860    struct marshal_cmd_StencilOp *cmd;
   12861    debug_print_marshal("StencilOp");
   12862    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12863       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_StencilOp, cmd_size);
   12864       cmd->fail = fail;
   12865       cmd->zfail = zfail;
   12866       cmd->zpass = zpass;
   12867       _mesa_post_marshal_hook(ctx);
   12868       return;
   12869    }
   12870 
   12871    _mesa_glthread_finish(ctx);
   12872    debug_print_sync_fallback("StencilOp");
   12873    CALL_StencilOp(ctx->CurrentServerDispatch, (fail, zfail, zpass));
   12874 }
   12875 
   12876 
   12877 /* ProgramUniform1iv: marshalled asynchronously */
   12878 struct marshal_cmd_ProgramUniform1iv
   12879 {
   12880    struct marshal_cmd_base cmd_base;
   12881    GLuint program;
   12882    GLint location;
   12883    GLsizei count;
   12884    /* Next safe_mul(count, 4) bytes are GLint value[count] */
   12885 };
   12886 static inline void
   12887 _mesa_unmarshal_ProgramUniform1iv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1iv *cmd)
   12888 {
   12889    const GLuint program = cmd->program;
   12890    const GLint location = cmd->location;
   12891    const GLsizei count = cmd->count;
   12892    const GLint * value;
   12893    const char *variable_data = (const char *) (cmd + 1);
   12894    value = (const GLint *) variable_data;
   12895    variable_data += count * 4;
   12896    CALL_ProgramUniform1iv(ctx->CurrentServerDispatch, (program, location, count, value));
   12897 }
   12898 static void GLAPIENTRY
   12899 _mesa_marshal_ProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint * value)
   12900 {
   12901    GET_CURRENT_CONTEXT(ctx);
   12902    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform1iv) + safe_mul(count, 4);
   12903    struct marshal_cmd_ProgramUniform1iv *cmd;
   12904    debug_print_marshal("ProgramUniform1iv");
   12905    if (unlikely(safe_mul(count, 4) < 0)) {
   12906       goto fallback_to_sync;
   12907    }
   12908    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12909       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1iv, cmd_size);
   12910       cmd->program = program;
   12911       cmd->location = location;
   12912       cmd->count = count;
   12913       char *variable_data = (char *) (cmd + 1);
   12914       memcpy(variable_data, value, count * 4);
   12915       variable_data += count * 4;
   12916       _mesa_post_marshal_hook(ctx);
   12917       return;
   12918    }
   12919 
   12920 fallback_to_sync:
   12921    _mesa_glthread_finish(ctx);
   12922    debug_print_sync_fallback("ProgramUniform1iv");
   12923    CALL_ProgramUniform1iv(ctx->CurrentServerDispatch, (program, location, count, value));
   12924 }
   12925 
   12926 
   12927 /* ProgramUniform3ui: marshalled asynchronously */
   12928 struct marshal_cmd_ProgramUniform3ui
   12929 {
   12930    struct marshal_cmd_base cmd_base;
   12931    GLuint program;
   12932    GLint location;
   12933    GLuint x;
   12934    GLuint y;
   12935    GLuint z;
   12936 };
   12937 static inline void
   12938 _mesa_unmarshal_ProgramUniform3ui(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3ui *cmd)
   12939 {
   12940    const GLuint program = cmd->program;
   12941    const GLint location = cmd->location;
   12942    const GLuint x = cmd->x;
   12943    const GLuint y = cmd->y;
   12944    const GLuint z = cmd->z;
   12945    CALL_ProgramUniform3ui(ctx->CurrentServerDispatch, (program, location, x, y, z));
   12946 }
   12947 static void GLAPIENTRY
   12948 _mesa_marshal_ProgramUniform3ui(GLuint program, GLint location, GLuint x, GLuint y, GLuint z)
   12949 {
   12950    GET_CURRENT_CONTEXT(ctx);
   12951    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform3ui);
   12952    struct marshal_cmd_ProgramUniform3ui *cmd;
   12953    debug_print_marshal("ProgramUniform3ui");
   12954    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12955       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3ui, cmd_size);
   12956       cmd->program = program;
   12957       cmd->location = location;
   12958       cmd->x = x;
   12959       cmd->y = y;
   12960       cmd->z = z;
   12961       _mesa_post_marshal_hook(ctx);
   12962       return;
   12963    }
   12964 
   12965    _mesa_glthread_finish(ctx);
   12966    debug_print_sync_fallback("ProgramUniform3ui");
   12967    CALL_ProgramUniform3ui(ctx->CurrentServerDispatch, (program, location, x, y, z));
   12968 }
   12969 
   12970 
   12971 /* SecondaryColor3sv: marshalled asynchronously */
   12972 struct marshal_cmd_SecondaryColor3sv
   12973 {
   12974    struct marshal_cmd_base cmd_base;
   12975    GLshort v[3];
   12976 };
   12977 static inline void
   12978 _mesa_unmarshal_SecondaryColor3sv(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3sv *cmd)
   12979 {
   12980    const GLshort * v = cmd->v;
   12981    CALL_SecondaryColor3sv(ctx->CurrentServerDispatch, (v));
   12982 }
   12983 static void GLAPIENTRY
   12984 _mesa_marshal_SecondaryColor3sv(const GLshort * v)
   12985 {
   12986    GET_CURRENT_CONTEXT(ctx);
   12987    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColor3sv);
   12988    struct marshal_cmd_SecondaryColor3sv *cmd;
   12989    debug_print_marshal("SecondaryColor3sv");
   12990    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   12991       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3sv, cmd_size);
   12992       memcpy(cmd->v, v, 6);
   12993       _mesa_post_marshal_hook(ctx);
   12994       return;
   12995    }
   12996 
   12997    _mesa_glthread_finish(ctx);
   12998    debug_print_sync_fallback("SecondaryColor3sv");
   12999    CALL_SecondaryColor3sv(ctx->CurrentServerDispatch, (v));
   13000 }
   13001 
   13002 
   13003 /* TexCoordP3ui: marshalled asynchronously */
   13004 struct marshal_cmd_TexCoordP3ui
   13005 {
   13006    struct marshal_cmd_base cmd_base;
   13007    GLenum type;
   13008    GLuint coords;
   13009 };
   13010 static inline void
   13011 _mesa_unmarshal_TexCoordP3ui(struct gl_context *ctx, const struct marshal_cmd_TexCoordP3ui *cmd)
   13012 {
   13013    const GLenum type = cmd->type;
   13014    const GLuint coords = cmd->coords;
   13015    CALL_TexCoordP3ui(ctx->CurrentServerDispatch, (type, coords));
   13016 }
   13017 static void GLAPIENTRY
   13018 _mesa_marshal_TexCoordP3ui(GLenum type, GLuint coords)
   13019 {
   13020    GET_CURRENT_CONTEXT(ctx);
   13021    size_t cmd_size = sizeof(struct marshal_cmd_TexCoordP3ui);
   13022    struct marshal_cmd_TexCoordP3ui *cmd;
   13023    debug_print_marshal("TexCoordP3ui");
   13024    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13025       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP3ui, cmd_size);
   13026       cmd->type = type;
   13027       cmd->coords = coords;
   13028       _mesa_post_marshal_hook(ctx);
   13029       return;
   13030    }
   13031 
   13032    _mesa_glthread_finish(ctx);
   13033    debug_print_sync_fallback("TexCoordP3ui");
   13034    CALL_TexCoordP3ui(ctx->CurrentServerDispatch, (type, coords));
   13035 }
   13036 
   13037 
   13038 /* VertexArrayElementBuffer: marshalled asynchronously */
   13039 struct marshal_cmd_VertexArrayElementBuffer
   13040 {
   13041    struct marshal_cmd_base cmd_base;
   13042    GLuint vaobj;
   13043    GLuint buffer;
   13044 };
   13045 static inline void
   13046 _mesa_unmarshal_VertexArrayElementBuffer(struct gl_context *ctx, const struct marshal_cmd_VertexArrayElementBuffer *cmd)
   13047 {
   13048    const GLuint vaobj = cmd->vaobj;
   13049    const GLuint buffer = cmd->buffer;
   13050    CALL_VertexArrayElementBuffer(ctx->CurrentServerDispatch, (vaobj, buffer));
   13051 }
   13052 static void GLAPIENTRY
   13053 _mesa_marshal_VertexArrayElementBuffer(GLuint vaobj, GLuint buffer)
   13054 {
   13055    GET_CURRENT_CONTEXT(ctx);
   13056    size_t cmd_size = sizeof(struct marshal_cmd_VertexArrayElementBuffer);
   13057    struct marshal_cmd_VertexArrayElementBuffer *cmd;
   13058    debug_print_marshal("VertexArrayElementBuffer");
   13059    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13060       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayElementBuffer, cmd_size);
   13061       cmd->vaobj = vaobj;
   13062       cmd->buffer = buffer;
   13063       _mesa_post_marshal_hook(ctx);
   13064       return;
   13065    }
   13066 
   13067    _mesa_glthread_finish(ctx);
   13068    debug_print_sync_fallback("VertexArrayElementBuffer");
   13069    CALL_VertexArrayElementBuffer(ctx->CurrentServerDispatch, (vaobj, buffer));
   13070 }
   13071 
   13072 
   13073 /* Fogxv: marshalled synchronously */
   13074 static void GLAPIENTRY
   13075 _mesa_marshal_Fogxv(GLenum pname, const GLfixed * params)
   13076 {
   13077    GET_CURRENT_CONTEXT(ctx);
   13078    _mesa_glthread_finish(ctx);
   13079    debug_print_sync("Fogxv");
   13080    CALL_Fogxv(ctx->CurrentServerDispatch, (pname, params));
   13081 }
   13082 
   13083 
   13084 /* Uniform3i64ARB: marshalled asynchronously */
   13085 struct marshal_cmd_Uniform3i64ARB
   13086 {
   13087    struct marshal_cmd_base cmd_base;
   13088    GLint location;
   13089    GLint64 x;
   13090    GLint64 y;
   13091    GLint64 z;
   13092 };
   13093 static inline void
   13094 _mesa_unmarshal_Uniform3i64ARB(struct gl_context *ctx, const struct marshal_cmd_Uniform3i64ARB *cmd)
   13095 {
   13096    const GLint location = cmd->location;
   13097    const GLint64 x = cmd->x;
   13098    const GLint64 y = cmd->y;
   13099    const GLint64 z = cmd->z;
   13100    CALL_Uniform3i64ARB(ctx->CurrentServerDispatch, (location, x, y, z));
   13101 }
   13102 static void GLAPIENTRY
   13103 _mesa_marshal_Uniform3i64ARB(GLint location, GLint64 x, GLint64 y, GLint64 z)
   13104 {
   13105    GET_CURRENT_CONTEXT(ctx);
   13106    size_t cmd_size = sizeof(struct marshal_cmd_Uniform3i64ARB);
   13107    struct marshal_cmd_Uniform3i64ARB *cmd;
   13108    debug_print_marshal("Uniform3i64ARB");
   13109    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13110       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3i64ARB, cmd_size);
   13111       cmd->location = location;
   13112       cmd->x = x;
   13113       cmd->y = y;
   13114       cmd->z = z;
   13115       _mesa_post_marshal_hook(ctx);
   13116       return;
   13117    }
   13118 
   13119    _mesa_glthread_finish(ctx);
   13120    debug_print_sync_fallback("Uniform3i64ARB");
   13121    CALL_Uniform3i64ARB(ctx->CurrentServerDispatch, (location, x, y, z));
   13122 }
   13123 
   13124 
   13125 /* VertexAttribP1ui: marshalled asynchronously */
   13126 struct marshal_cmd_VertexAttribP1ui
   13127 {
   13128    struct marshal_cmd_base cmd_base;
   13129    GLuint index;
   13130    GLenum type;
   13131    GLboolean normalized;
   13132    GLuint value;
   13133 };
   13134 static inline void
   13135 _mesa_unmarshal_VertexAttribP1ui(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP1ui *cmd)
   13136 {
   13137    const GLuint index = cmd->index;
   13138    const GLenum type = cmd->type;
   13139    const GLboolean normalized = cmd->normalized;
   13140    const GLuint value = cmd->value;
   13141    CALL_VertexAttribP1ui(ctx->CurrentServerDispatch, (index, type, normalized, value));
   13142 }
   13143 static void GLAPIENTRY
   13144 _mesa_marshal_VertexAttribP1ui(GLuint index, GLenum type, GLboolean normalized, GLuint value)
   13145 {
   13146    GET_CURRENT_CONTEXT(ctx);
   13147    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribP1ui);
   13148    struct marshal_cmd_VertexAttribP1ui *cmd;
   13149    debug_print_marshal("VertexAttribP1ui");
   13150    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13151       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP1ui, cmd_size);
   13152       cmd->index = index;
   13153       cmd->type = type;
   13154       cmd->normalized = normalized;
   13155       cmd->value = value;
   13156       _mesa_post_marshal_hook(ctx);
   13157       return;
   13158    }
   13159 
   13160    _mesa_glthread_finish(ctx);
   13161    debug_print_sync_fallback("VertexAttribP1ui");
   13162    CALL_VertexAttribP1ui(ctx->CurrentServerDispatch, (index, type, normalized, value));
   13163 }
   13164 
   13165 
   13166 /* GetImageHandleARB: marshalled synchronously */
   13167 static GLuint64 GLAPIENTRY
   13168 _mesa_marshal_GetImageHandleARB(GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum format)
   13169 {
   13170    GET_CURRENT_CONTEXT(ctx);
   13171    _mesa_glthread_finish(ctx);
   13172    debug_print_sync("GetImageHandleARB");
   13173    return CALL_GetImageHandleARB(ctx->CurrentServerDispatch, (texture, level, layered, layer, format));
   13174 }
   13175 
   13176 
   13177 /* DeleteLists: marshalled asynchronously */
   13178 struct marshal_cmd_DeleteLists
   13179 {
   13180    struct marshal_cmd_base cmd_base;
   13181    GLuint list;
   13182    GLsizei range;
   13183 };
   13184 static inline void
   13185 _mesa_unmarshal_DeleteLists(struct gl_context *ctx, const struct marshal_cmd_DeleteLists *cmd)
   13186 {
   13187    const GLuint list = cmd->list;
   13188    const GLsizei range = cmd->range;
   13189    CALL_DeleteLists(ctx->CurrentServerDispatch, (list, range));
   13190 }
   13191 static void GLAPIENTRY
   13192 _mesa_marshal_DeleteLists(GLuint list, GLsizei range)
   13193 {
   13194    GET_CURRENT_CONTEXT(ctx);
   13195    size_t cmd_size = sizeof(struct marshal_cmd_DeleteLists);
   13196    struct marshal_cmd_DeleteLists *cmd;
   13197    debug_print_marshal("DeleteLists");
   13198    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13199       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteLists, cmd_size);
   13200       cmd->list = list;
   13201       cmd->range = range;
   13202       _mesa_post_marshal_hook(ctx);
   13203       return;
   13204    }
   13205 
   13206    _mesa_glthread_finish(ctx);
   13207    debug_print_sync_fallback("DeleteLists");
   13208    CALL_DeleteLists(ctx->CurrentServerDispatch, (list, range));
   13209 }
   13210 
   13211 
   13212 /* LogicOp: marshalled asynchronously */
   13213 struct marshal_cmd_LogicOp
   13214 {
   13215    struct marshal_cmd_base cmd_base;
   13216    GLenum opcode;
   13217 };
   13218 static inline void
   13219 _mesa_unmarshal_LogicOp(struct gl_context *ctx, const struct marshal_cmd_LogicOp *cmd)
   13220 {
   13221    const GLenum opcode = cmd->opcode;
   13222    CALL_LogicOp(ctx->CurrentServerDispatch, (opcode));
   13223 }
   13224 static void GLAPIENTRY
   13225 _mesa_marshal_LogicOp(GLenum opcode)
   13226 {
   13227    GET_CURRENT_CONTEXT(ctx);
   13228    size_t cmd_size = sizeof(struct marshal_cmd_LogicOp);
   13229    struct marshal_cmd_LogicOp *cmd;
   13230    debug_print_marshal("LogicOp");
   13231    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13232       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LogicOp, cmd_size);
   13233       cmd->opcode = opcode;
   13234       _mesa_post_marshal_hook(ctx);
   13235       return;
   13236    }
   13237 
   13238    _mesa_glthread_finish(ctx);
   13239    debug_print_sync_fallback("LogicOp");
   13240    CALL_LogicOp(ctx->CurrentServerDispatch, (opcode));
   13241 }
   13242 
   13243 
   13244 /* RenderbufferStorageMultisample: marshalled asynchronously */
   13245 struct marshal_cmd_RenderbufferStorageMultisample
   13246 {
   13247    struct marshal_cmd_base cmd_base;
   13248    GLenum target;
   13249    GLsizei samples;
   13250    GLenum internalformat;
   13251    GLsizei width;
   13252    GLsizei height;
   13253 };
   13254 static inline void
   13255 _mesa_unmarshal_RenderbufferStorageMultisample(struct gl_context *ctx, const struct marshal_cmd_RenderbufferStorageMultisample *cmd)
   13256 {
   13257    const GLenum target = cmd->target;
   13258    const GLsizei samples = cmd->samples;
   13259    const GLenum internalformat = cmd->internalformat;
   13260    const GLsizei width = cmd->width;
   13261    const GLsizei height = cmd->height;
   13262    CALL_RenderbufferStorageMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height));
   13263 }
   13264 static void GLAPIENTRY
   13265 _mesa_marshal_RenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
   13266 {
   13267    GET_CURRENT_CONTEXT(ctx);
   13268    size_t cmd_size = sizeof(struct marshal_cmd_RenderbufferStorageMultisample);
   13269    struct marshal_cmd_RenderbufferStorageMultisample *cmd;
   13270    debug_print_marshal("RenderbufferStorageMultisample");
   13271    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13272       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RenderbufferStorageMultisample, cmd_size);
   13273       cmd->target = target;
   13274       cmd->samples = samples;
   13275       cmd->internalformat = internalformat;
   13276       cmd->width = width;
   13277       cmd->height = height;
   13278       _mesa_post_marshal_hook(ctx);
   13279       return;
   13280    }
   13281 
   13282    _mesa_glthread_finish(ctx);
   13283    debug_print_sync_fallback("RenderbufferStorageMultisample");
   13284    CALL_RenderbufferStorageMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height));
   13285 }
   13286 
   13287 
   13288 /* GetTransformFeedbacki64_v: marshalled synchronously */
   13289 static void GLAPIENTRY
   13290 _mesa_marshal_GetTransformFeedbacki64_v(GLuint xfb, GLenum pname, GLuint index, GLint64 * param)
   13291 {
   13292    GET_CURRENT_CONTEXT(ctx);
   13293    _mesa_glthread_finish(ctx);
   13294    debug_print_sync("GetTransformFeedbacki64_v");
   13295    CALL_GetTransformFeedbacki64_v(ctx->CurrentServerDispatch, (xfb, pname, index, param));
   13296 }
   13297 
   13298 
   13299 /* WindowPos3d: marshalled asynchronously */
   13300 struct marshal_cmd_WindowPos3d
   13301 {
   13302    struct marshal_cmd_base cmd_base;
   13303    GLdouble x;
   13304    GLdouble y;
   13305    GLdouble z;
   13306 };
   13307 static inline void
   13308 _mesa_unmarshal_WindowPos3d(struct gl_context *ctx, const struct marshal_cmd_WindowPos3d *cmd)
   13309 {
   13310    const GLdouble x = cmd->x;
   13311    const GLdouble y = cmd->y;
   13312    const GLdouble z = cmd->z;
   13313    CALL_WindowPos3d(ctx->CurrentServerDispatch, (x, y, z));
   13314 }
   13315 static void GLAPIENTRY
   13316 _mesa_marshal_WindowPos3d(GLdouble x, GLdouble y, GLdouble z)
   13317 {
   13318    GET_CURRENT_CONTEXT(ctx);
   13319    size_t cmd_size = sizeof(struct marshal_cmd_WindowPos3d);
   13320    struct marshal_cmd_WindowPos3d *cmd;
   13321    debug_print_marshal("WindowPos3d");
   13322    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13323       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos3d, cmd_size);
   13324       cmd->x = x;
   13325       cmd->y = y;
   13326       cmd->z = z;
   13327       _mesa_post_marshal_hook(ctx);
   13328       return;
   13329    }
   13330 
   13331    _mesa_glthread_finish(ctx);
   13332    debug_print_sync_fallback("WindowPos3d");
   13333    CALL_WindowPos3d(ctx->CurrentServerDispatch, (x, y, z));
   13334 }
   13335 
   13336 
   13337 /* Enablei: marshalled asynchronously */
   13338 struct marshal_cmd_Enablei
   13339 {
   13340    struct marshal_cmd_base cmd_base;
   13341    GLenum target;
   13342    GLuint index;
   13343 };
   13344 static inline void
   13345 _mesa_unmarshal_Enablei(struct gl_context *ctx, const struct marshal_cmd_Enablei *cmd)
   13346 {
   13347    const GLenum target = cmd->target;
   13348    const GLuint index = cmd->index;
   13349    CALL_Enablei(ctx->CurrentServerDispatch, (target, index));
   13350 }
   13351 static void GLAPIENTRY
   13352 _mesa_marshal_Enablei(GLenum target, GLuint index)
   13353 {
   13354    GET_CURRENT_CONTEXT(ctx);
   13355    size_t cmd_size = sizeof(struct marshal_cmd_Enablei);
   13356    struct marshal_cmd_Enablei *cmd;
   13357    debug_print_marshal("Enablei");
   13358    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13359       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Enablei, cmd_size);
   13360       cmd->target = target;
   13361       cmd->index = index;
   13362       _mesa_post_marshal_hook(ctx);
   13363       return;
   13364    }
   13365 
   13366    _mesa_glthread_finish(ctx);
   13367    debug_print_sync_fallback("Enablei");
   13368    CALL_Enablei(ctx->CurrentServerDispatch, (target, index));
   13369 }
   13370 
   13371 
   13372 /* WindowPos3f: marshalled asynchronously */
   13373 struct marshal_cmd_WindowPos3f
   13374 {
   13375    struct marshal_cmd_base cmd_base;
   13376    GLfloat x;
   13377    GLfloat y;
   13378    GLfloat z;
   13379 };
   13380 static inline void
   13381 _mesa_unmarshal_WindowPos3f(struct gl_context *ctx, const struct marshal_cmd_WindowPos3f *cmd)
   13382 {
   13383    const GLfloat x = cmd->x;
   13384    const GLfloat y = cmd->y;
   13385    const GLfloat z = cmd->z;
   13386    CALL_WindowPos3f(ctx->CurrentServerDispatch, (x, y, z));
   13387 }
   13388 static void GLAPIENTRY
   13389 _mesa_marshal_WindowPos3f(GLfloat x, GLfloat y, GLfloat z)
   13390 {
   13391    GET_CURRENT_CONTEXT(ctx);
   13392    size_t cmd_size = sizeof(struct marshal_cmd_WindowPos3f);
   13393    struct marshal_cmd_WindowPos3f *cmd;
   13394    debug_print_marshal("WindowPos3f");
   13395    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13396       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos3f, cmd_size);
   13397       cmd->x = x;
   13398       cmd->y = y;
   13399       cmd->z = z;
   13400       _mesa_post_marshal_hook(ctx);
   13401       return;
   13402    }
   13403 
   13404    _mesa_glthread_finish(ctx);
   13405    debug_print_sync_fallback("WindowPos3f");
   13406    CALL_WindowPos3f(ctx->CurrentServerDispatch, (x, y, z));
   13407 }
   13408 
   13409 
   13410 /* GenProgramsARB: marshalled synchronously */
   13411 static void GLAPIENTRY
   13412 _mesa_marshal_GenProgramsARB(GLsizei n, GLuint * programs)
   13413 {
   13414    GET_CURRENT_CONTEXT(ctx);
   13415    _mesa_glthread_finish(ctx);
   13416    debug_print_sync("GenProgramsARB");
   13417    CALL_GenProgramsARB(ctx->CurrentServerDispatch, (n, programs));
   13418 }
   13419 
   13420 
   13421 /* RasterPos2sv: marshalled asynchronously */
   13422 struct marshal_cmd_RasterPos2sv
   13423 {
   13424    struct marshal_cmd_base cmd_base;
   13425    GLshort v[2];
   13426 };
   13427 static inline void
   13428 _mesa_unmarshal_RasterPos2sv(struct gl_context *ctx, const struct marshal_cmd_RasterPos2sv *cmd)
   13429 {
   13430    const GLshort * v = cmd->v;
   13431    CALL_RasterPos2sv(ctx->CurrentServerDispatch, (v));
   13432 }
   13433 static void GLAPIENTRY
   13434 _mesa_marshal_RasterPos2sv(const GLshort * v)
   13435 {
   13436    GET_CURRENT_CONTEXT(ctx);
   13437    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos2sv);
   13438    struct marshal_cmd_RasterPos2sv *cmd;
   13439    debug_print_marshal("RasterPos2sv");
   13440    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13441       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos2sv, cmd_size);
   13442       memcpy(cmd->v, v, 4);
   13443       _mesa_post_marshal_hook(ctx);
   13444       return;
   13445    }
   13446 
   13447    _mesa_glthread_finish(ctx);
   13448    debug_print_sync_fallback("RasterPos2sv");
   13449    CALL_RasterPos2sv(ctx->CurrentServerDispatch, (v));
   13450 }
   13451 
   13452 
   13453 /* WindowPos3i: marshalled asynchronously */
   13454 struct marshal_cmd_WindowPos3i
   13455 {
   13456    struct marshal_cmd_base cmd_base;
   13457    GLint x;
   13458    GLint y;
   13459    GLint z;
   13460 };
   13461 static inline void
   13462 _mesa_unmarshal_WindowPos3i(struct gl_context *ctx, const struct marshal_cmd_WindowPos3i *cmd)
   13463 {
   13464    const GLint x = cmd->x;
   13465    const GLint y = cmd->y;
   13466    const GLint z = cmd->z;
   13467    CALL_WindowPos3i(ctx->CurrentServerDispatch, (x, y, z));
   13468 }
   13469 static void GLAPIENTRY
   13470 _mesa_marshal_WindowPos3i(GLint x, GLint y, GLint z)
   13471 {
   13472    GET_CURRENT_CONTEXT(ctx);
   13473    size_t cmd_size = sizeof(struct marshal_cmd_WindowPos3i);
   13474    struct marshal_cmd_WindowPos3i *cmd;
   13475    debug_print_marshal("WindowPos3i");
   13476    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13477       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos3i, cmd_size);
   13478       cmd->x = x;
   13479       cmd->y = y;
   13480       cmd->z = z;
   13481       _mesa_post_marshal_hook(ctx);
   13482       return;
   13483    }
   13484 
   13485    _mesa_glthread_finish(ctx);
   13486    debug_print_sync_fallback("WindowPos3i");
   13487    CALL_WindowPos3i(ctx->CurrentServerDispatch, (x, y, z));
   13488 }
   13489 
   13490 
   13491 /* MultiTexCoord4iv: marshalled asynchronously */
   13492 struct marshal_cmd_MultiTexCoord4iv
   13493 {
   13494    struct marshal_cmd_base cmd_base;
   13495    GLenum target;
   13496    GLint v[4];
   13497 };
   13498 static inline void
   13499 _mesa_unmarshal_MultiTexCoord4iv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4iv *cmd)
   13500 {
   13501    const GLenum target = cmd->target;
   13502    const GLint * v = cmd->v;
   13503    CALL_MultiTexCoord4iv(ctx->CurrentServerDispatch, (target, v));
   13504 }
   13505 static void GLAPIENTRY
   13506 _mesa_marshal_MultiTexCoord4iv(GLenum target, const GLint * v)
   13507 {
   13508    GET_CURRENT_CONTEXT(ctx);
   13509    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4iv);
   13510    struct marshal_cmd_MultiTexCoord4iv *cmd;
   13511    debug_print_marshal("MultiTexCoord4iv");
   13512    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13513       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4iv, cmd_size);
   13514       cmd->target = target;
   13515       memcpy(cmd->v, v, 16);
   13516       _mesa_post_marshal_hook(ctx);
   13517       return;
   13518    }
   13519 
   13520    _mesa_glthread_finish(ctx);
   13521    debug_print_sync_fallback("MultiTexCoord4iv");
   13522    CALL_MultiTexCoord4iv(ctx->CurrentServerDispatch, (target, v));
   13523 }
   13524 
   13525 
   13526 /* TexCoord1sv: marshalled asynchronously */
   13527 struct marshal_cmd_TexCoord1sv
   13528 {
   13529    struct marshal_cmd_base cmd_base;
   13530    GLshort v[1];
   13531 };
   13532 static inline void
   13533 _mesa_unmarshal_TexCoord1sv(struct gl_context *ctx, const struct marshal_cmd_TexCoord1sv *cmd)
   13534 {
   13535    const GLshort * v = cmd->v;
   13536    CALL_TexCoord1sv(ctx->CurrentServerDispatch, (v));
   13537 }
   13538 static void GLAPIENTRY
   13539 _mesa_marshal_TexCoord1sv(const GLshort * v)
   13540 {
   13541    GET_CURRENT_CONTEXT(ctx);
   13542    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord1sv);
   13543    struct marshal_cmd_TexCoord1sv *cmd;
   13544    debug_print_marshal("TexCoord1sv");
   13545    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13546       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord1sv, cmd_size);
   13547       memcpy(cmd->v, v, 2);
   13548       _mesa_post_marshal_hook(ctx);
   13549       return;
   13550    }
   13551 
   13552    _mesa_glthread_finish(ctx);
   13553    debug_print_sync_fallback("TexCoord1sv");
   13554    CALL_TexCoord1sv(ctx->CurrentServerDispatch, (v));
   13555 }
   13556 
   13557 
   13558 /* WindowPos3s: marshalled asynchronously */
   13559 struct marshal_cmd_WindowPos3s
   13560 {
   13561    struct marshal_cmd_base cmd_base;
   13562    GLshort x;
   13563    GLshort y;
   13564    GLshort z;
   13565 };
   13566 static inline void
   13567 _mesa_unmarshal_WindowPos3s(struct gl_context *ctx, const struct marshal_cmd_WindowPos3s *cmd)
   13568 {
   13569    const GLshort x = cmd->x;
   13570    const GLshort y = cmd->y;
   13571    const GLshort z = cmd->z;
   13572    CALL_WindowPos3s(ctx->CurrentServerDispatch, (x, y, z));
   13573 }
   13574 static void GLAPIENTRY
   13575 _mesa_marshal_WindowPos3s(GLshort x, GLshort y, GLshort z)
   13576 {
   13577    GET_CURRENT_CONTEXT(ctx);
   13578    size_t cmd_size = sizeof(struct marshal_cmd_WindowPos3s);
   13579    struct marshal_cmd_WindowPos3s *cmd;
   13580    debug_print_marshal("WindowPos3s");
   13581    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13582       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos3s, cmd_size);
   13583       cmd->x = x;
   13584       cmd->y = y;
   13585       cmd->z = z;
   13586       _mesa_post_marshal_hook(ctx);
   13587       return;
   13588    }
   13589 
   13590    _mesa_glthread_finish(ctx);
   13591    debug_print_sync_fallback("WindowPos3s");
   13592    CALL_WindowPos3s(ctx->CurrentServerDispatch, (x, y, z));
   13593 }
   13594 
   13595 
   13596 /* PixelMapusv: marshalled synchronously */
   13597 static void GLAPIENTRY
   13598 _mesa_marshal_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort * values)
   13599 {
   13600    GET_CURRENT_CONTEXT(ctx);
   13601    _mesa_glthread_finish(ctx);
   13602    debug_print_sync("PixelMapusv");
   13603    CALL_PixelMapusv(ctx->CurrentServerDispatch, (map, mapsize, values));
   13604 }
   13605 
   13606 
   13607 /* DebugMessageInsert: marshalled synchronously */
   13608 static void GLAPIENTRY
   13609 _mesa_marshal_DebugMessageInsert(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar * buf)
   13610 {
   13611    GET_CURRENT_CONTEXT(ctx);
   13612    _mesa_glthread_finish(ctx);
   13613    debug_print_sync("DebugMessageInsert");
   13614    CALL_DebugMessageInsert(ctx->CurrentServerDispatch, (source, type, id, severity, length, buf));
   13615 }
   13616 
   13617 
   13618 /* Orthof: marshalled asynchronously */
   13619 struct marshal_cmd_Orthof
   13620 {
   13621    struct marshal_cmd_base cmd_base;
   13622    GLfloat left;
   13623    GLfloat right;
   13624    GLfloat bottom;
   13625    GLfloat top;
   13626    GLfloat zNear;
   13627    GLfloat zFar;
   13628 };
   13629 static inline void
   13630 _mesa_unmarshal_Orthof(struct gl_context *ctx, const struct marshal_cmd_Orthof *cmd)
   13631 {
   13632    const GLfloat left = cmd->left;
   13633    const GLfloat right = cmd->right;
   13634    const GLfloat bottom = cmd->bottom;
   13635    const GLfloat top = cmd->top;
   13636    const GLfloat zNear = cmd->zNear;
   13637    const GLfloat zFar = cmd->zFar;
   13638    CALL_Orthof(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar));
   13639 }
   13640 static void GLAPIENTRY
   13641 _mesa_marshal_Orthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)
   13642 {
   13643    GET_CURRENT_CONTEXT(ctx);
   13644    size_t cmd_size = sizeof(struct marshal_cmd_Orthof);
   13645    struct marshal_cmd_Orthof *cmd;
   13646    debug_print_marshal("Orthof");
   13647    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13648       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Orthof, cmd_size);
   13649       cmd->left = left;
   13650       cmd->right = right;
   13651       cmd->bottom = bottom;
   13652       cmd->top = top;
   13653       cmd->zNear = zNear;
   13654       cmd->zFar = zFar;
   13655       _mesa_post_marshal_hook(ctx);
   13656       return;
   13657    }
   13658 
   13659    _mesa_glthread_finish(ctx);
   13660    debug_print_sync_fallback("Orthof");
   13661    CALL_Orthof(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar));
   13662 }
   13663 
   13664 
   13665 /* CompressedTexImage2D: marshalled synchronously */
   13666 static void GLAPIENTRY
   13667 _mesa_marshal_CompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid * data)
   13668 {
   13669    GET_CURRENT_CONTEXT(ctx);
   13670    _mesa_glthread_finish(ctx);
   13671    debug_print_sync("CompressedTexImage2D");
   13672    CALL_CompressedTexImage2D(ctx->CurrentServerDispatch, (target, level, internalformat, width, height, border, imageSize, data));
   13673 }
   13674 
   13675 
   13676 /* DeleteObjectARB: marshalled asynchronously */
   13677 struct marshal_cmd_DeleteObjectARB
   13678 {
   13679    struct marshal_cmd_base cmd_base;
   13680    GLhandleARB obj;
   13681 };
   13682 static inline void
   13683 _mesa_unmarshal_DeleteObjectARB(struct gl_context *ctx, const struct marshal_cmd_DeleteObjectARB *cmd)
   13684 {
   13685    const GLhandleARB obj = cmd->obj;
   13686    CALL_DeleteObjectARB(ctx->CurrentServerDispatch, (obj));
   13687 }
   13688 static void GLAPIENTRY
   13689 _mesa_marshal_DeleteObjectARB(GLhandleARB obj)
   13690 {
   13691    GET_CURRENT_CONTEXT(ctx);
   13692    size_t cmd_size = sizeof(struct marshal_cmd_DeleteObjectARB);
   13693    struct marshal_cmd_DeleteObjectARB *cmd;
   13694    debug_print_marshal("DeleteObjectARB");
   13695    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13696       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteObjectARB, cmd_size);
   13697       cmd->obj = obj;
   13698       _mesa_post_marshal_hook(ctx);
   13699       return;
   13700    }
   13701 
   13702    _mesa_glthread_finish(ctx);
   13703    debug_print_sync_fallback("DeleteObjectARB");
   13704    CALL_DeleteObjectARB(ctx->CurrentServerDispatch, (obj));
   13705 }
   13706 
   13707 
   13708 /* ProgramUniformMatrix2x3dv: marshalled asynchronously */
   13709 struct marshal_cmd_ProgramUniformMatrix2x3dv
   13710 {
   13711    struct marshal_cmd_base cmd_base;
   13712    GLuint program;
   13713    GLint location;
   13714    GLsizei count;
   13715    GLboolean transpose;
   13716    /* Next safe_mul(count, 48) bytes are GLdouble value[count][6] */
   13717 };
   13718 static inline void
   13719 _mesa_unmarshal_ProgramUniformMatrix2x3dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix2x3dv *cmd)
   13720 {
   13721    const GLuint program = cmd->program;
   13722    const GLint location = cmd->location;
   13723    const GLsizei count = cmd->count;
   13724    const GLboolean transpose = cmd->transpose;
   13725    const GLdouble * value;
   13726    const char *variable_data = (const char *) (cmd + 1);
   13727    value = (const GLdouble *) variable_data;
   13728    variable_data += count * 48;
   13729    CALL_ProgramUniformMatrix2x3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   13730 }
   13731 static void GLAPIENTRY
   13732 _mesa_marshal_ProgramUniformMatrix2x3dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   13733 {
   13734    GET_CURRENT_CONTEXT(ctx);
   13735    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix2x3dv) + safe_mul(count, 48);
   13736    struct marshal_cmd_ProgramUniformMatrix2x3dv *cmd;
   13737    debug_print_marshal("ProgramUniformMatrix2x3dv");
   13738    if (unlikely(safe_mul(count, 48) < 0)) {
   13739       goto fallback_to_sync;
   13740    }
   13741    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13742       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix2x3dv, cmd_size);
   13743       cmd->program = program;
   13744       cmd->location = location;
   13745       cmd->count = count;
   13746       cmd->transpose = transpose;
   13747       char *variable_data = (char *) (cmd + 1);
   13748       memcpy(variable_data, value, count * 48);
   13749       variable_data += count * 48;
   13750       _mesa_post_marshal_hook(ctx);
   13751       return;
   13752    }
   13753 
   13754 fallback_to_sync:
   13755    _mesa_glthread_finish(ctx);
   13756    debug_print_sync_fallback("ProgramUniformMatrix2x3dv");
   13757    CALL_ProgramUniformMatrix2x3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   13758 }
   13759 
   13760 
   13761 /* GetVertexArrayiv: marshalled synchronously */
   13762 static void GLAPIENTRY
   13763 _mesa_marshal_GetVertexArrayiv(GLuint vaobj, GLenum pname, GLint * param)
   13764 {
   13765    GET_CURRENT_CONTEXT(ctx);
   13766    _mesa_glthread_finish(ctx);
   13767    debug_print_sync("GetVertexArrayiv");
   13768    CALL_GetVertexArrayiv(ctx->CurrentServerDispatch, (vaobj, pname, param));
   13769 }
   13770 
   13771 
   13772 /* IsSync: marshalled synchronously */
   13773 static GLboolean GLAPIENTRY
   13774 _mesa_marshal_IsSync(GLsync sync)
   13775 {
   13776    GET_CURRENT_CONTEXT(ctx);
   13777    _mesa_glthread_finish(ctx);
   13778    debug_print_sync("IsSync");
   13779    return CALL_IsSync(ctx->CurrentServerDispatch, (sync));
   13780 }
   13781 
   13782 
   13783 /* Color4uiv: marshalled asynchronously */
   13784 struct marshal_cmd_Color4uiv
   13785 {
   13786    struct marshal_cmd_base cmd_base;
   13787    GLuint v[4];
   13788 };
   13789 static inline void
   13790 _mesa_unmarshal_Color4uiv(struct gl_context *ctx, const struct marshal_cmd_Color4uiv *cmd)
   13791 {
   13792    const GLuint * v = cmd->v;
   13793    CALL_Color4uiv(ctx->CurrentServerDispatch, (v));
   13794 }
   13795 static void GLAPIENTRY
   13796 _mesa_marshal_Color4uiv(const GLuint * v)
   13797 {
   13798    GET_CURRENT_CONTEXT(ctx);
   13799    size_t cmd_size = sizeof(struct marshal_cmd_Color4uiv);
   13800    struct marshal_cmd_Color4uiv *cmd;
   13801    debug_print_marshal("Color4uiv");
   13802    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13803       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4uiv, cmd_size);
   13804       memcpy(cmd->v, v, 16);
   13805       _mesa_post_marshal_hook(ctx);
   13806       return;
   13807    }
   13808 
   13809    _mesa_glthread_finish(ctx);
   13810    debug_print_sync_fallback("Color4uiv");
   13811    CALL_Color4uiv(ctx->CurrentServerDispatch, (v));
   13812 }
   13813 
   13814 
   13815 /* MultiTexCoord1sv: marshalled asynchronously */
   13816 struct marshal_cmd_MultiTexCoord1sv
   13817 {
   13818    struct marshal_cmd_base cmd_base;
   13819    GLenum target;
   13820    GLshort v[1];
   13821 };
   13822 static inline void
   13823 _mesa_unmarshal_MultiTexCoord1sv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1sv *cmd)
   13824 {
   13825    const GLenum target = cmd->target;
   13826    const GLshort * v = cmd->v;
   13827    CALL_MultiTexCoord1sv(ctx->CurrentServerDispatch, (target, v));
   13828 }
   13829 static void GLAPIENTRY
   13830 _mesa_marshal_MultiTexCoord1sv(GLenum target, const GLshort * v)
   13831 {
   13832    GET_CURRENT_CONTEXT(ctx);
   13833    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1sv);
   13834    struct marshal_cmd_MultiTexCoord1sv *cmd;
   13835    debug_print_marshal("MultiTexCoord1sv");
   13836    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13837       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1sv, cmd_size);
   13838       cmd->target = target;
   13839       memcpy(cmd->v, v, 2);
   13840       _mesa_post_marshal_hook(ctx);
   13841       return;
   13842    }
   13843 
   13844    _mesa_glthread_finish(ctx);
   13845    debug_print_sync_fallback("MultiTexCoord1sv");
   13846    CALL_MultiTexCoord1sv(ctx->CurrentServerDispatch, (target, v));
   13847 }
   13848 
   13849 
   13850 /* Orthox: marshalled asynchronously */
   13851 struct marshal_cmd_Orthox
   13852 {
   13853    struct marshal_cmd_base cmd_base;
   13854    GLfixed left;
   13855    GLfixed right;
   13856    GLfixed bottom;
   13857    GLfixed top;
   13858    GLfixed zNear;
   13859    GLfixed zFar;
   13860 };
   13861 static inline void
   13862 _mesa_unmarshal_Orthox(struct gl_context *ctx, const struct marshal_cmd_Orthox *cmd)
   13863 {
   13864    const GLfixed left = cmd->left;
   13865    const GLfixed right = cmd->right;
   13866    const GLfixed bottom = cmd->bottom;
   13867    const GLfixed top = cmd->top;
   13868    const GLfixed zNear = cmd->zNear;
   13869    const GLfixed zFar = cmd->zFar;
   13870    CALL_Orthox(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar));
   13871 }
   13872 static void GLAPIENTRY
   13873 _mesa_marshal_Orthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)
   13874 {
   13875    GET_CURRENT_CONTEXT(ctx);
   13876    size_t cmd_size = sizeof(struct marshal_cmd_Orthox);
   13877    struct marshal_cmd_Orthox *cmd;
   13878    debug_print_marshal("Orthox");
   13879    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13880       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Orthox, cmd_size);
   13881       cmd->left = left;
   13882       cmd->right = right;
   13883       cmd->bottom = bottom;
   13884       cmd->top = top;
   13885       cmd->zNear = zNear;
   13886       cmd->zFar = zFar;
   13887       _mesa_post_marshal_hook(ctx);
   13888       return;
   13889    }
   13890 
   13891    _mesa_glthread_finish(ctx);
   13892    debug_print_sync_fallback("Orthox");
   13893    CALL_Orthox(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar));
   13894 }
   13895 
   13896 
   13897 /* PushAttrib: marshalled asynchronously */
   13898 struct marshal_cmd_PushAttrib
   13899 {
   13900    struct marshal_cmd_base cmd_base;
   13901    GLbitfield mask;
   13902 };
   13903 static inline void
   13904 _mesa_unmarshal_PushAttrib(struct gl_context *ctx, const struct marshal_cmd_PushAttrib *cmd)
   13905 {
   13906    const GLbitfield mask = cmd->mask;
   13907    CALL_PushAttrib(ctx->CurrentServerDispatch, (mask));
   13908 }
   13909 static void GLAPIENTRY
   13910 _mesa_marshal_PushAttrib(GLbitfield mask)
   13911 {
   13912    GET_CURRENT_CONTEXT(ctx);
   13913    size_t cmd_size = sizeof(struct marshal_cmd_PushAttrib);
   13914    struct marshal_cmd_PushAttrib *cmd;
   13915    debug_print_marshal("PushAttrib");
   13916    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13917       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PushAttrib, cmd_size);
   13918       cmd->mask = mask;
   13919       _mesa_post_marshal_hook(ctx);
   13920       return;
   13921    }
   13922 
   13923    _mesa_glthread_finish(ctx);
   13924    debug_print_sync_fallback("PushAttrib");
   13925    CALL_PushAttrib(ctx->CurrentServerDispatch, (mask));
   13926 }
   13927 
   13928 
   13929 /* RasterPos2i: marshalled asynchronously */
   13930 struct marshal_cmd_RasterPos2i
   13931 {
   13932    struct marshal_cmd_base cmd_base;
   13933    GLint x;
   13934    GLint y;
   13935 };
   13936 static inline void
   13937 _mesa_unmarshal_RasterPos2i(struct gl_context *ctx, const struct marshal_cmd_RasterPos2i *cmd)
   13938 {
   13939    const GLint x = cmd->x;
   13940    const GLint y = cmd->y;
   13941    CALL_RasterPos2i(ctx->CurrentServerDispatch, (x, y));
   13942 }
   13943 static void GLAPIENTRY
   13944 _mesa_marshal_RasterPos2i(GLint x, GLint y)
   13945 {
   13946    GET_CURRENT_CONTEXT(ctx);
   13947    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos2i);
   13948    struct marshal_cmd_RasterPos2i *cmd;
   13949    debug_print_marshal("RasterPos2i");
   13950    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13951       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos2i, cmd_size);
   13952       cmd->x = x;
   13953       cmd->y = y;
   13954       _mesa_post_marshal_hook(ctx);
   13955       return;
   13956    }
   13957 
   13958    _mesa_glthread_finish(ctx);
   13959    debug_print_sync_fallback("RasterPos2i");
   13960    CALL_RasterPos2i(ctx->CurrentServerDispatch, (x, y));
   13961 }
   13962 
   13963 
   13964 /* ClipPlane: marshalled asynchronously */
   13965 struct marshal_cmd_ClipPlane
   13966 {
   13967    struct marshal_cmd_base cmd_base;
   13968    GLenum plane;
   13969    GLdouble equation[4];
   13970 };
   13971 static inline void
   13972 _mesa_unmarshal_ClipPlane(struct gl_context *ctx, const struct marshal_cmd_ClipPlane *cmd)
   13973 {
   13974    const GLenum plane = cmd->plane;
   13975    const GLdouble * equation = cmd->equation;
   13976    CALL_ClipPlane(ctx->CurrentServerDispatch, (plane, equation));
   13977 }
   13978 static void GLAPIENTRY
   13979 _mesa_marshal_ClipPlane(GLenum plane, const GLdouble * equation)
   13980 {
   13981    GET_CURRENT_CONTEXT(ctx);
   13982    size_t cmd_size = sizeof(struct marshal_cmd_ClipPlane);
   13983    struct marshal_cmd_ClipPlane *cmd;
   13984    debug_print_marshal("ClipPlane");
   13985    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   13986       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClipPlane, cmd_size);
   13987       cmd->plane = plane;
   13988       memcpy(cmd->equation, equation, 32);
   13989       _mesa_post_marshal_hook(ctx);
   13990       return;
   13991    }
   13992 
   13993    _mesa_glthread_finish(ctx);
   13994    debug_print_sync_fallback("ClipPlane");
   13995    CALL_ClipPlane(ctx->CurrentServerDispatch, (plane, equation));
   13996 }
   13997 
   13998 
   13999 /* RasterPos2f: marshalled asynchronously */
   14000 struct marshal_cmd_RasterPos2f
   14001 {
   14002    struct marshal_cmd_base cmd_base;
   14003    GLfloat x;
   14004    GLfloat y;
   14005 };
   14006 static inline void
   14007 _mesa_unmarshal_RasterPos2f(struct gl_context *ctx, const struct marshal_cmd_RasterPos2f *cmd)
   14008 {
   14009    const GLfloat x = cmd->x;
   14010    const GLfloat y = cmd->y;
   14011    CALL_RasterPos2f(ctx->CurrentServerDispatch, (x, y));
   14012 }
   14013 static void GLAPIENTRY
   14014 _mesa_marshal_RasterPos2f(GLfloat x, GLfloat y)
   14015 {
   14016    GET_CURRENT_CONTEXT(ctx);
   14017    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos2f);
   14018    struct marshal_cmd_RasterPos2f *cmd;
   14019    debug_print_marshal("RasterPos2f");
   14020    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14021       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos2f, cmd_size);
   14022       cmd->x = x;
   14023       cmd->y = y;
   14024       _mesa_post_marshal_hook(ctx);
   14025       return;
   14026    }
   14027 
   14028    _mesa_glthread_finish(ctx);
   14029    debug_print_sync_fallback("RasterPos2f");
   14030    CALL_RasterPos2f(ctx->CurrentServerDispatch, (x, y));
   14031 }
   14032 
   14033 
   14034 /* GetActiveSubroutineUniformiv: marshalled synchronously */
   14035 static void GLAPIENTRY
   14036 _mesa_marshal_GetActiveSubroutineUniformiv(GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint * values)
   14037 {
   14038    GET_CURRENT_CONTEXT(ctx);
   14039    _mesa_glthread_finish(ctx);
   14040    debug_print_sync("GetActiveSubroutineUniformiv");
   14041    CALL_GetActiveSubroutineUniformiv(ctx->CurrentServerDispatch, (program, shadertype, index, pname, values));
   14042 }
   14043 
   14044 
   14045 /* RasterPos2d: marshalled asynchronously */
   14046 struct marshal_cmd_RasterPos2d
   14047 {
   14048    struct marshal_cmd_base cmd_base;
   14049    GLdouble x;
   14050    GLdouble y;
   14051 };
   14052 static inline void
   14053 _mesa_unmarshal_RasterPos2d(struct gl_context *ctx, const struct marshal_cmd_RasterPos2d *cmd)
   14054 {
   14055    const GLdouble x = cmd->x;
   14056    const GLdouble y = cmd->y;
   14057    CALL_RasterPos2d(ctx->CurrentServerDispatch, (x, y));
   14058 }
   14059 static void GLAPIENTRY
   14060 _mesa_marshal_RasterPos2d(GLdouble x, GLdouble y)
   14061 {
   14062    GET_CURRENT_CONTEXT(ctx);
   14063    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos2d);
   14064    struct marshal_cmd_RasterPos2d *cmd;
   14065    debug_print_marshal("RasterPos2d");
   14066    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14067       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos2d, cmd_size);
   14068       cmd->x = x;
   14069       cmd->y = y;
   14070       _mesa_post_marshal_hook(ctx);
   14071       return;
   14072    }
   14073 
   14074    _mesa_glthread_finish(ctx);
   14075    debug_print_sync_fallback("RasterPos2d");
   14076    CALL_RasterPos2d(ctx->CurrentServerDispatch, (x, y));
   14077 }
   14078 
   14079 
   14080 /* MakeImageHandleResidentARB: marshalled asynchronously */
   14081 struct marshal_cmd_MakeImageHandleResidentARB
   14082 {
   14083    struct marshal_cmd_base cmd_base;
   14084    GLuint64 handle;
   14085    GLenum access;
   14086 };
   14087 static inline void
   14088 _mesa_unmarshal_MakeImageHandleResidentARB(struct gl_context *ctx, const struct marshal_cmd_MakeImageHandleResidentARB *cmd)
   14089 {
   14090    const GLuint64 handle = cmd->handle;
   14091    const GLenum access = cmd->access;
   14092    CALL_MakeImageHandleResidentARB(ctx->CurrentServerDispatch, (handle, access));
   14093 }
   14094 static void GLAPIENTRY
   14095 _mesa_marshal_MakeImageHandleResidentARB(GLuint64 handle, GLenum access)
   14096 {
   14097    GET_CURRENT_CONTEXT(ctx);
   14098    size_t cmd_size = sizeof(struct marshal_cmd_MakeImageHandleResidentARB);
   14099    struct marshal_cmd_MakeImageHandleResidentARB *cmd;
   14100    debug_print_marshal("MakeImageHandleResidentARB");
   14101    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14102       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MakeImageHandleResidentARB, cmd_size);
   14103       cmd->handle = handle;
   14104       cmd->access = access;
   14105       _mesa_post_marshal_hook(ctx);
   14106       return;
   14107    }
   14108 
   14109    _mesa_glthread_finish(ctx);
   14110    debug_print_sync_fallback("MakeImageHandleResidentARB");
   14111    CALL_MakeImageHandleResidentARB(ctx->CurrentServerDispatch, (handle, access));
   14112 }
   14113 
   14114 
   14115 /* InvalidateSubFramebuffer: marshalled asynchronously */
   14116 struct marshal_cmd_InvalidateSubFramebuffer
   14117 {
   14118    struct marshal_cmd_base cmd_base;
   14119    GLenum target;
   14120    GLsizei numAttachments;
   14121    GLint x;
   14122    GLint y;
   14123    GLsizei width;
   14124    GLsizei height;
   14125    /* Next safe_mul(numAttachments, 4) bytes are GLenum attachments[numAttachments] */
   14126 };
   14127 static inline void
   14128 _mesa_unmarshal_InvalidateSubFramebuffer(struct gl_context *ctx, const struct marshal_cmd_InvalidateSubFramebuffer *cmd)
   14129 {
   14130    const GLenum target = cmd->target;
   14131    const GLsizei numAttachments = cmd->numAttachments;
   14132    const GLint x = cmd->x;
   14133    const GLint y = cmd->y;
   14134    const GLsizei width = cmd->width;
   14135    const GLsizei height = cmd->height;
   14136    const GLenum * attachments;
   14137    const char *variable_data = (const char *) (cmd + 1);
   14138    attachments = (const GLenum *) variable_data;
   14139    variable_data += numAttachments * 4;
   14140    CALL_InvalidateSubFramebuffer(ctx->CurrentServerDispatch, (target, numAttachments, attachments, x, y, width, height));
   14141 }
   14142 static void GLAPIENTRY
   14143 _mesa_marshal_InvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height)
   14144 {
   14145    GET_CURRENT_CONTEXT(ctx);
   14146    size_t cmd_size = sizeof(struct marshal_cmd_InvalidateSubFramebuffer) + safe_mul(numAttachments, 4);
   14147    struct marshal_cmd_InvalidateSubFramebuffer *cmd;
   14148    debug_print_marshal("InvalidateSubFramebuffer");
   14149    if (unlikely(safe_mul(numAttachments, 4) < 0)) {
   14150       goto fallback_to_sync;
   14151    }
   14152    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14153       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InvalidateSubFramebuffer, cmd_size);
   14154       cmd->target = target;
   14155       cmd->numAttachments = numAttachments;
   14156       cmd->x = x;
   14157       cmd->y = y;
   14158       cmd->width = width;
   14159       cmd->height = height;
   14160       char *variable_data = (char *) (cmd + 1);
   14161       memcpy(variable_data, attachments, numAttachments * 4);
   14162       variable_data += numAttachments * 4;
   14163       _mesa_post_marshal_hook(ctx);
   14164       return;
   14165    }
   14166 
   14167 fallback_to_sync:
   14168    _mesa_glthread_finish(ctx);
   14169    debug_print_sync_fallback("InvalidateSubFramebuffer");
   14170    CALL_InvalidateSubFramebuffer(ctx->CurrentServerDispatch, (target, numAttachments, attachments, x, y, width, height));
   14171 }
   14172 
   14173 
   14174 /* Color4ub: marshalled asynchronously */
   14175 struct marshal_cmd_Color4ub
   14176 {
   14177    struct marshal_cmd_base cmd_base;
   14178    GLubyte red;
   14179    GLubyte green;
   14180    GLubyte blue;
   14181    GLubyte alpha;
   14182 };
   14183 static inline void
   14184 _mesa_unmarshal_Color4ub(struct gl_context *ctx, const struct marshal_cmd_Color4ub *cmd)
   14185 {
   14186    const GLubyte red = cmd->red;
   14187    const GLubyte green = cmd->green;
   14188    const GLubyte blue = cmd->blue;
   14189    const GLubyte alpha = cmd->alpha;
   14190    CALL_Color4ub(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   14191 }
   14192 static void GLAPIENTRY
   14193 _mesa_marshal_Color4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha)
   14194 {
   14195    GET_CURRENT_CONTEXT(ctx);
   14196    size_t cmd_size = sizeof(struct marshal_cmd_Color4ub);
   14197    struct marshal_cmd_Color4ub *cmd;
   14198    debug_print_marshal("Color4ub");
   14199    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14200       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4ub, cmd_size);
   14201       cmd->red = red;
   14202       cmd->green = green;
   14203       cmd->blue = blue;
   14204       cmd->alpha = alpha;
   14205       _mesa_post_marshal_hook(ctx);
   14206       return;
   14207    }
   14208 
   14209    _mesa_glthread_finish(ctx);
   14210    debug_print_sync_fallback("Color4ub");
   14211    CALL_Color4ub(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   14212 }
   14213 
   14214 
   14215 /* UniformMatrix2x4dv: marshalled asynchronously */
   14216 struct marshal_cmd_UniformMatrix2x4dv
   14217 {
   14218    struct marshal_cmd_base cmd_base;
   14219    GLint location;
   14220    GLsizei count;
   14221    GLboolean transpose;
   14222    /* Next safe_mul(count, 64) bytes are GLdouble value[count][8] */
   14223 };
   14224 static inline void
   14225 _mesa_unmarshal_UniformMatrix2x4dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2x4dv *cmd)
   14226 {
   14227    const GLint location = cmd->location;
   14228    const GLsizei count = cmd->count;
   14229    const GLboolean transpose = cmd->transpose;
   14230    const GLdouble * value;
   14231    const char *variable_data = (const char *) (cmd + 1);
   14232    value = (const GLdouble *) variable_data;
   14233    variable_data += count * 64;
   14234    CALL_UniformMatrix2x4dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   14235 }
   14236 static void GLAPIENTRY
   14237 _mesa_marshal_UniformMatrix2x4dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   14238 {
   14239    GET_CURRENT_CONTEXT(ctx);
   14240    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix2x4dv) + safe_mul(count, 64);
   14241    struct marshal_cmd_UniformMatrix2x4dv *cmd;
   14242    debug_print_marshal("UniformMatrix2x4dv");
   14243    if (unlikely(safe_mul(count, 64) < 0)) {
   14244       goto fallback_to_sync;
   14245    }
   14246    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14247       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2x4dv, cmd_size);
   14248       cmd->location = location;
   14249       cmd->count = count;
   14250       cmd->transpose = transpose;
   14251       char *variable_data = (char *) (cmd + 1);
   14252       memcpy(variable_data, value, count * 64);
   14253       variable_data += count * 64;
   14254       _mesa_post_marshal_hook(ctx);
   14255       return;
   14256    }
   14257 
   14258 fallback_to_sync:
   14259    _mesa_glthread_finish(ctx);
   14260    debug_print_sync_fallback("UniformMatrix2x4dv");
   14261    CALL_UniformMatrix2x4dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   14262 }
   14263 
   14264 
   14265 /* RasterPos2s: marshalled asynchronously */
   14266 struct marshal_cmd_RasterPos2s
   14267 {
   14268    struct marshal_cmd_base cmd_base;
   14269    GLshort x;
   14270    GLshort y;
   14271 };
   14272 static inline void
   14273 _mesa_unmarshal_RasterPos2s(struct gl_context *ctx, const struct marshal_cmd_RasterPos2s *cmd)
   14274 {
   14275    const GLshort x = cmd->x;
   14276    const GLshort y = cmd->y;
   14277    CALL_RasterPos2s(ctx->CurrentServerDispatch, (x, y));
   14278 }
   14279 static void GLAPIENTRY
   14280 _mesa_marshal_RasterPos2s(GLshort x, GLshort y)
   14281 {
   14282    GET_CURRENT_CONTEXT(ctx);
   14283    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos2s);
   14284    struct marshal_cmd_RasterPos2s *cmd;
   14285    debug_print_marshal("RasterPos2s");
   14286    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14287       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos2s, cmd_size);
   14288       cmd->x = x;
   14289       cmd->y = y;
   14290       _mesa_post_marshal_hook(ctx);
   14291       return;
   14292    }
   14293 
   14294    _mesa_glthread_finish(ctx);
   14295    debug_print_sync_fallback("RasterPos2s");
   14296    CALL_RasterPos2s(ctx->CurrentServerDispatch, (x, y));
   14297 }
   14298 
   14299 
   14300 /* DispatchComputeGroupSizeARB: marshalled asynchronously */
   14301 struct marshal_cmd_DispatchComputeGroupSizeARB
   14302 {
   14303    struct marshal_cmd_base cmd_base;
   14304    GLuint num_groups_x;
   14305    GLuint num_groups_y;
   14306    GLuint num_groups_z;
   14307    GLuint group_size_x;
   14308    GLuint group_size_y;
   14309    GLuint group_size_z;
   14310 };
   14311 static inline void
   14312 _mesa_unmarshal_DispatchComputeGroupSizeARB(struct gl_context *ctx, const struct marshal_cmd_DispatchComputeGroupSizeARB *cmd)
   14313 {
   14314    const GLuint num_groups_x = cmd->num_groups_x;
   14315    const GLuint num_groups_y = cmd->num_groups_y;
   14316    const GLuint num_groups_z = cmd->num_groups_z;
   14317    const GLuint group_size_x = cmd->group_size_x;
   14318    const GLuint group_size_y = cmd->group_size_y;
   14319    const GLuint group_size_z = cmd->group_size_z;
   14320    CALL_DispatchComputeGroupSizeARB(ctx->CurrentServerDispatch, (num_groups_x, num_groups_y, num_groups_z, group_size_x, group_size_y, group_size_z));
   14321 }
   14322 static void GLAPIENTRY
   14323 _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)
   14324 {
   14325    GET_CURRENT_CONTEXT(ctx);
   14326    size_t cmd_size = sizeof(struct marshal_cmd_DispatchComputeGroupSizeARB);
   14327    struct marshal_cmd_DispatchComputeGroupSizeARB *cmd;
   14328    debug_print_marshal("DispatchComputeGroupSizeARB");
   14329    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14330       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DispatchComputeGroupSizeARB, cmd_size);
   14331       cmd->num_groups_x = num_groups_x;
   14332       cmd->num_groups_y = num_groups_y;
   14333       cmd->num_groups_z = num_groups_z;
   14334       cmd->group_size_x = group_size_x;
   14335       cmd->group_size_y = group_size_y;
   14336       cmd->group_size_z = group_size_z;
   14337       _mesa_post_marshal_hook(ctx);
   14338       return;
   14339    }
   14340 
   14341    _mesa_glthread_finish(ctx);
   14342    debug_print_sync_fallback("DispatchComputeGroupSizeARB");
   14343    CALL_DispatchComputeGroupSizeARB(ctx->CurrentServerDispatch, (num_groups_x, num_groups_y, num_groups_z, group_size_x, group_size_y, group_size_z));
   14344 }
   14345 
   14346 
   14347 /* VertexP2uiv: marshalled synchronously */
   14348 static void GLAPIENTRY
   14349 _mesa_marshal_VertexP2uiv(GLenum type, const GLuint * value)
   14350 {
   14351    GET_CURRENT_CONTEXT(ctx);
   14352    _mesa_glthread_finish(ctx);
   14353    debug_print_sync("VertexP2uiv");
   14354    CALL_VertexP2uiv(ctx->CurrentServerDispatch, (type, value));
   14355 }
   14356 
   14357 
   14358 /* VertexArrayBindingDivisor: marshalled asynchronously */
   14359 struct marshal_cmd_VertexArrayBindingDivisor
   14360 {
   14361    struct marshal_cmd_base cmd_base;
   14362    GLuint vaobj;
   14363    GLuint bindingindex;
   14364    GLuint divisor;
   14365 };
   14366 static inline void
   14367 _mesa_unmarshal_VertexArrayBindingDivisor(struct gl_context *ctx, const struct marshal_cmd_VertexArrayBindingDivisor *cmd)
   14368 {
   14369    const GLuint vaobj = cmd->vaobj;
   14370    const GLuint bindingindex = cmd->bindingindex;
   14371    const GLuint divisor = cmd->divisor;
   14372    CALL_VertexArrayBindingDivisor(ctx->CurrentServerDispatch, (vaobj, bindingindex, divisor));
   14373 }
   14374 static void GLAPIENTRY
   14375 _mesa_marshal_VertexArrayBindingDivisor(GLuint vaobj, GLuint bindingindex, GLuint divisor)
   14376 {
   14377    GET_CURRENT_CONTEXT(ctx);
   14378    size_t cmd_size = sizeof(struct marshal_cmd_VertexArrayBindingDivisor);
   14379    struct marshal_cmd_VertexArrayBindingDivisor *cmd;
   14380    debug_print_marshal("VertexArrayBindingDivisor");
   14381    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14382       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayBindingDivisor, cmd_size);
   14383       cmd->vaobj = vaobj;
   14384       cmd->bindingindex = bindingindex;
   14385       cmd->divisor = divisor;
   14386       _mesa_post_marshal_hook(ctx);
   14387       return;
   14388    }
   14389 
   14390    _mesa_glthread_finish(ctx);
   14391    debug_print_sync_fallback("VertexArrayBindingDivisor");
   14392    CALL_VertexArrayBindingDivisor(ctx->CurrentServerDispatch, (vaobj, bindingindex, divisor));
   14393 }
   14394 
   14395 
   14396 /* MultiTexCoord3dv: marshalled asynchronously */
   14397 struct marshal_cmd_MultiTexCoord3dv
   14398 {
   14399    struct marshal_cmd_base cmd_base;
   14400    GLenum target;
   14401    GLdouble v[3];
   14402 };
   14403 static inline void
   14404 _mesa_unmarshal_MultiTexCoord3dv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3dv *cmd)
   14405 {
   14406    const GLenum target = cmd->target;
   14407    const GLdouble * v = cmd->v;
   14408    CALL_MultiTexCoord3dv(ctx->CurrentServerDispatch, (target, v));
   14409 }
   14410 static void GLAPIENTRY
   14411 _mesa_marshal_MultiTexCoord3dv(GLenum target, const GLdouble * v)
   14412 {
   14413    GET_CURRENT_CONTEXT(ctx);
   14414    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3dv);
   14415    struct marshal_cmd_MultiTexCoord3dv *cmd;
   14416    debug_print_marshal("MultiTexCoord3dv");
   14417    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14418       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3dv, cmd_size);
   14419       cmd->target = target;
   14420       memcpy(cmd->v, v, 24);
   14421       _mesa_post_marshal_hook(ctx);
   14422       return;
   14423    }
   14424 
   14425    _mesa_glthread_finish(ctx);
   14426    debug_print_sync_fallback("MultiTexCoord3dv");
   14427    CALL_MultiTexCoord3dv(ctx->CurrentServerDispatch, (target, v));
   14428 }
   14429 
   14430 
   14431 /* BindProgramPipeline: marshalled asynchronously */
   14432 struct marshal_cmd_BindProgramPipeline
   14433 {
   14434    struct marshal_cmd_base cmd_base;
   14435    GLuint pipeline;
   14436 };
   14437 static inline void
   14438 _mesa_unmarshal_BindProgramPipeline(struct gl_context *ctx, const struct marshal_cmd_BindProgramPipeline *cmd)
   14439 {
   14440    const GLuint pipeline = cmd->pipeline;
   14441    CALL_BindProgramPipeline(ctx->CurrentServerDispatch, (pipeline));
   14442 }
   14443 static void GLAPIENTRY
   14444 _mesa_marshal_BindProgramPipeline(GLuint pipeline)
   14445 {
   14446    GET_CURRENT_CONTEXT(ctx);
   14447    size_t cmd_size = sizeof(struct marshal_cmd_BindProgramPipeline);
   14448    struct marshal_cmd_BindProgramPipeline *cmd;
   14449    debug_print_marshal("BindProgramPipeline");
   14450    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14451       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindProgramPipeline, cmd_size);
   14452       cmd->pipeline = pipeline;
   14453       _mesa_post_marshal_hook(ctx);
   14454       return;
   14455    }
   14456 
   14457    _mesa_glthread_finish(ctx);
   14458    debug_print_sync_fallback("BindProgramPipeline");
   14459    CALL_BindProgramPipeline(ctx->CurrentServerDispatch, (pipeline));
   14460 }
   14461 
   14462 
   14463 /* VertexAttribP4uiv: marshalled synchronously */
   14464 static void GLAPIENTRY
   14465 _mesa_marshal_VertexAttribP4uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint * value)
   14466 {
   14467    GET_CURRENT_CONTEXT(ctx);
   14468    _mesa_glthread_finish(ctx);
   14469    debug_print_sync("VertexAttribP4uiv");
   14470    CALL_VertexAttribP4uiv(ctx->CurrentServerDispatch, (index, type, normalized, value));
   14471 }
   14472 
   14473 
   14474 /* DebugMessageCallback: marshalled synchronously */
   14475 static void GLAPIENTRY
   14476 _mesa_marshal_DebugMessageCallback(GLDEBUGPROC callback, const GLvoid * userParam)
   14477 {
   14478    GET_CURRENT_CONTEXT(ctx);
   14479    _mesa_glthread_finish(ctx);
   14480    debug_print_sync("DebugMessageCallback");
   14481    CALL_DebugMessageCallback(ctx->CurrentServerDispatch, (callback, userParam));
   14482 }
   14483 
   14484 
   14485 /* MultiTexCoord1i: marshalled asynchronously */
   14486 struct marshal_cmd_MultiTexCoord1i
   14487 {
   14488    struct marshal_cmd_base cmd_base;
   14489    GLenum target;
   14490    GLint s;
   14491 };
   14492 static inline void
   14493 _mesa_unmarshal_MultiTexCoord1i(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1i *cmd)
   14494 {
   14495    const GLenum target = cmd->target;
   14496    const GLint s = cmd->s;
   14497    CALL_MultiTexCoord1i(ctx->CurrentServerDispatch, (target, s));
   14498 }
   14499 static void GLAPIENTRY
   14500 _mesa_marshal_MultiTexCoord1i(GLenum target, GLint s)
   14501 {
   14502    GET_CURRENT_CONTEXT(ctx);
   14503    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1i);
   14504    struct marshal_cmd_MultiTexCoord1i *cmd;
   14505    debug_print_marshal("MultiTexCoord1i");
   14506    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14507       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1i, cmd_size);
   14508       cmd->target = target;
   14509       cmd->s = s;
   14510       _mesa_post_marshal_hook(ctx);
   14511       return;
   14512    }
   14513 
   14514    _mesa_glthread_finish(ctx);
   14515    debug_print_sync_fallback("MultiTexCoord1i");
   14516    CALL_MultiTexCoord1i(ctx->CurrentServerDispatch, (target, s));
   14517 }
   14518 
   14519 
   14520 /* WindowPos2dv: marshalled synchronously */
   14521 static void GLAPIENTRY
   14522 _mesa_marshal_WindowPos2dv(const GLdouble * v)
   14523 {
   14524    GET_CURRENT_CONTEXT(ctx);
   14525    _mesa_glthread_finish(ctx);
   14526    debug_print_sync("WindowPos2dv");
   14527    CALL_WindowPos2dv(ctx->CurrentServerDispatch, (v));
   14528 }
   14529 
   14530 
   14531 /* TexParameterIuiv: marshalled synchronously */
   14532 static void GLAPIENTRY
   14533 _mesa_marshal_TexParameterIuiv(GLenum target, GLenum pname, const GLuint * params)
   14534 {
   14535    GET_CURRENT_CONTEXT(ctx);
   14536    _mesa_glthread_finish(ctx);
   14537    debug_print_sync("TexParameterIuiv");
   14538    CALL_TexParameterIuiv(ctx->CurrentServerDispatch, (target, pname, params));
   14539 }
   14540 
   14541 
   14542 /* DeletePerfQueryINTEL: marshalled asynchronously */
   14543 struct marshal_cmd_DeletePerfQueryINTEL
   14544 {
   14545    struct marshal_cmd_base cmd_base;
   14546    GLuint queryHandle;
   14547 };
   14548 static inline void
   14549 _mesa_unmarshal_DeletePerfQueryINTEL(struct gl_context *ctx, const struct marshal_cmd_DeletePerfQueryINTEL *cmd)
   14550 {
   14551    const GLuint queryHandle = cmd->queryHandle;
   14552    CALL_DeletePerfQueryINTEL(ctx->CurrentServerDispatch, (queryHandle));
   14553 }
   14554 static void GLAPIENTRY
   14555 _mesa_marshal_DeletePerfQueryINTEL(GLuint queryHandle)
   14556 {
   14557    GET_CURRENT_CONTEXT(ctx);
   14558    size_t cmd_size = sizeof(struct marshal_cmd_DeletePerfQueryINTEL);
   14559    struct marshal_cmd_DeletePerfQueryINTEL *cmd;
   14560    debug_print_marshal("DeletePerfQueryINTEL");
   14561    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14562       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeletePerfQueryINTEL, cmd_size);
   14563       cmd->queryHandle = queryHandle;
   14564       _mesa_post_marshal_hook(ctx);
   14565       return;
   14566    }
   14567 
   14568    _mesa_glthread_finish(ctx);
   14569    debug_print_sync_fallback("DeletePerfQueryINTEL");
   14570    CALL_DeletePerfQueryINTEL(ctx->CurrentServerDispatch, (queryHandle));
   14571 }
   14572 
   14573 
   14574 /* MultiTexCoord1d: marshalled asynchronously */
   14575 struct marshal_cmd_MultiTexCoord1d
   14576 {
   14577    struct marshal_cmd_base cmd_base;
   14578    GLenum target;
   14579    GLdouble s;
   14580 };
   14581 static inline void
   14582 _mesa_unmarshal_MultiTexCoord1d(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1d *cmd)
   14583 {
   14584    const GLenum target = cmd->target;
   14585    const GLdouble s = cmd->s;
   14586    CALL_MultiTexCoord1d(ctx->CurrentServerDispatch, (target, s));
   14587 }
   14588 static void GLAPIENTRY
   14589 _mesa_marshal_MultiTexCoord1d(GLenum target, GLdouble s)
   14590 {
   14591    GET_CURRENT_CONTEXT(ctx);
   14592    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1d);
   14593    struct marshal_cmd_MultiTexCoord1d *cmd;
   14594    debug_print_marshal("MultiTexCoord1d");
   14595    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14596       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1d, cmd_size);
   14597       cmd->target = target;
   14598       cmd->s = s;
   14599       _mesa_post_marshal_hook(ctx);
   14600       return;
   14601    }
   14602 
   14603    _mesa_glthread_finish(ctx);
   14604    debug_print_sync_fallback("MultiTexCoord1d");
   14605    CALL_MultiTexCoord1d(ctx->CurrentServerDispatch, (target, s));
   14606 }
   14607 
   14608 
   14609 /* MultiTexCoord1s: marshalled asynchronously */
   14610 struct marshal_cmd_MultiTexCoord1s
   14611 {
   14612    struct marshal_cmd_base cmd_base;
   14613    GLenum target;
   14614    GLshort s;
   14615 };
   14616 static inline void
   14617 _mesa_unmarshal_MultiTexCoord1s(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1s *cmd)
   14618 {
   14619    const GLenum target = cmd->target;
   14620    const GLshort s = cmd->s;
   14621    CALL_MultiTexCoord1s(ctx->CurrentServerDispatch, (target, s));
   14622 }
   14623 static void GLAPIENTRY
   14624 _mesa_marshal_MultiTexCoord1s(GLenum target, GLshort s)
   14625 {
   14626    GET_CURRENT_CONTEXT(ctx);
   14627    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1s);
   14628    struct marshal_cmd_MultiTexCoord1s *cmd;
   14629    debug_print_marshal("MultiTexCoord1s");
   14630    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14631       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1s, cmd_size);
   14632       cmd->target = target;
   14633       cmd->s = s;
   14634       _mesa_post_marshal_hook(ctx);
   14635       return;
   14636    }
   14637 
   14638    _mesa_glthread_finish(ctx);
   14639    debug_print_sync_fallback("MultiTexCoord1s");
   14640    CALL_MultiTexCoord1s(ctx->CurrentServerDispatch, (target, s));
   14641 }
   14642 
   14643 
   14644 /* BeginConditionalRender: marshalled asynchronously */
   14645 struct marshal_cmd_BeginConditionalRender
   14646 {
   14647    struct marshal_cmd_base cmd_base;
   14648    GLuint query;
   14649    GLenum mode;
   14650 };
   14651 static inline void
   14652 _mesa_unmarshal_BeginConditionalRender(struct gl_context *ctx, const struct marshal_cmd_BeginConditionalRender *cmd)
   14653 {
   14654    const GLuint query = cmd->query;
   14655    const GLenum mode = cmd->mode;
   14656    CALL_BeginConditionalRender(ctx->CurrentServerDispatch, (query, mode));
   14657 }
   14658 static void GLAPIENTRY
   14659 _mesa_marshal_BeginConditionalRender(GLuint query, GLenum mode)
   14660 {
   14661    GET_CURRENT_CONTEXT(ctx);
   14662    size_t cmd_size = sizeof(struct marshal_cmd_BeginConditionalRender);
   14663    struct marshal_cmd_BeginConditionalRender *cmd;
   14664    debug_print_marshal("BeginConditionalRender");
   14665    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14666       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BeginConditionalRender, cmd_size);
   14667       cmd->query = query;
   14668       cmd->mode = mode;
   14669       _mesa_post_marshal_hook(ctx);
   14670       return;
   14671    }
   14672 
   14673    _mesa_glthread_finish(ctx);
   14674    debug_print_sync_fallback("BeginConditionalRender");
   14675    CALL_BeginConditionalRender(ctx->CurrentServerDispatch, (query, mode));
   14676 }
   14677 
   14678 
   14679 /* GetShaderiv: marshalled synchronously */
   14680 static void GLAPIENTRY
   14681 _mesa_marshal_GetShaderiv(GLuint shader, GLenum pname, GLint * params)
   14682 {
   14683    GET_CURRENT_CONTEXT(ctx);
   14684    _mesa_glthread_finish(ctx);
   14685    debug_print_sync("GetShaderiv");
   14686    CALL_GetShaderiv(ctx->CurrentServerDispatch, (shader, pname, params));
   14687 }
   14688 
   14689 
   14690 /* CopyConvolutionFilter1D: marshalled asynchronously */
   14691 struct marshal_cmd_CopyConvolutionFilter1D
   14692 {
   14693    struct marshal_cmd_base cmd_base;
   14694    GLenum target;
   14695    GLenum internalformat;
   14696    GLint x;
   14697    GLint y;
   14698    GLsizei width;
   14699 };
   14700 static inline void
   14701 _mesa_unmarshal_CopyConvolutionFilter1D(struct gl_context *ctx, const struct marshal_cmd_CopyConvolutionFilter1D *cmd)
   14702 {
   14703    const GLenum target = cmd->target;
   14704    const GLenum internalformat = cmd->internalformat;
   14705    const GLint x = cmd->x;
   14706    const GLint y = cmd->y;
   14707    const GLsizei width = cmd->width;
   14708    CALL_CopyConvolutionFilter1D(ctx->CurrentServerDispatch, (target, internalformat, x, y, width));
   14709 }
   14710 static void GLAPIENTRY
   14711 _mesa_marshal_CopyConvolutionFilter1D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
   14712 {
   14713    GET_CURRENT_CONTEXT(ctx);
   14714    size_t cmd_size = sizeof(struct marshal_cmd_CopyConvolutionFilter1D);
   14715    struct marshal_cmd_CopyConvolutionFilter1D *cmd;
   14716    debug_print_marshal("CopyConvolutionFilter1D");
   14717    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14718       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyConvolutionFilter1D, cmd_size);
   14719       cmd->target = target;
   14720       cmd->internalformat = internalformat;
   14721       cmd->x = x;
   14722       cmd->y = y;
   14723       cmd->width = width;
   14724       _mesa_post_marshal_hook(ctx);
   14725       return;
   14726    }
   14727 
   14728    _mesa_glthread_finish(ctx);
   14729    debug_print_sync_fallback("CopyConvolutionFilter1D");
   14730    CALL_CopyConvolutionFilter1D(ctx->CurrentServerDispatch, (target, internalformat, x, y, width));
   14731 }
   14732 
   14733 
   14734 /* UniformMatrix4dv: marshalled asynchronously */
   14735 struct marshal_cmd_UniformMatrix4dv
   14736 {
   14737    struct marshal_cmd_base cmd_base;
   14738    GLint location;
   14739    GLsizei count;
   14740    GLboolean transpose;
   14741    /* Next safe_mul(count, 128) bytes are GLdouble value[count][16] */
   14742 };
   14743 static inline void
   14744 _mesa_unmarshal_UniformMatrix4dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4dv *cmd)
   14745 {
   14746    const GLint location = cmd->location;
   14747    const GLsizei count = cmd->count;
   14748    const GLboolean transpose = cmd->transpose;
   14749    const GLdouble * value;
   14750    const char *variable_data = (const char *) (cmd + 1);
   14751    value = (const GLdouble *) variable_data;
   14752    variable_data += count * 128;
   14753    CALL_UniformMatrix4dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   14754 }
   14755 static void GLAPIENTRY
   14756 _mesa_marshal_UniformMatrix4dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   14757 {
   14758    GET_CURRENT_CONTEXT(ctx);
   14759    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix4dv) + safe_mul(count, 128);
   14760    struct marshal_cmd_UniformMatrix4dv *cmd;
   14761    debug_print_marshal("UniformMatrix4dv");
   14762    if (unlikely(safe_mul(count, 128) < 0)) {
   14763       goto fallback_to_sync;
   14764    }
   14765    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14766       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4dv, cmd_size);
   14767       cmd->location = location;
   14768       cmd->count = count;
   14769       cmd->transpose = transpose;
   14770       char *variable_data = (char *) (cmd + 1);
   14771       memcpy(variable_data, value, count * 128);
   14772       variable_data += count * 128;
   14773       _mesa_post_marshal_hook(ctx);
   14774       return;
   14775    }
   14776 
   14777 fallback_to_sync:
   14778    _mesa_glthread_finish(ctx);
   14779    debug_print_sync_fallback("UniformMatrix4dv");
   14780    CALL_UniformMatrix4dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   14781 }
   14782 
   14783 
   14784 /* CreateShaderObjectARB: marshalled synchronously */
   14785 static GLhandleARB GLAPIENTRY
   14786 _mesa_marshal_CreateShaderObjectARB(GLenum shaderType)
   14787 {
   14788    GET_CURRENT_CONTEXT(ctx);
   14789    _mesa_glthread_finish(ctx);
   14790    debug_print_sync("CreateShaderObjectARB");
   14791    return CALL_CreateShaderObjectARB(ctx->CurrentServerDispatch, (shaderType));
   14792 }
   14793 
   14794 
   14795 /* GetTexParameterxv: marshalled synchronously */
   14796 static void GLAPIENTRY
   14797 _mesa_marshal_GetTexParameterxv(GLenum target, GLenum pname, GLfixed * params)
   14798 {
   14799    GET_CURRENT_CONTEXT(ctx);
   14800    _mesa_glthread_finish(ctx);
   14801    debug_print_sync("GetTexParameterxv");
   14802    CALL_GetTexParameterxv(ctx->CurrentServerDispatch, (target, pname, params));
   14803 }
   14804 
   14805 
   14806 /* GetAttachedShaders: marshalled synchronously */
   14807 static void GLAPIENTRY
   14808 _mesa_marshal_GetAttachedShaders(GLuint program, GLsizei maxCount, GLsizei * count, GLuint * obj)
   14809 {
   14810    GET_CURRENT_CONTEXT(ctx);
   14811    _mesa_glthread_finish(ctx);
   14812    debug_print_sync("GetAttachedShaders");
   14813    CALL_GetAttachedShaders(ctx->CurrentServerDispatch, (program, maxCount, count, obj));
   14814 }
   14815 
   14816 
   14817 /* Materialiv: marshalled synchronously */
   14818 static void GLAPIENTRY
   14819 _mesa_marshal_Materialiv(GLenum face, GLenum pname, const GLint * params)
   14820 {
   14821    GET_CURRENT_CONTEXT(ctx);
   14822    _mesa_glthread_finish(ctx);
   14823    debug_print_sync("Materialiv");
   14824    CALL_Materialiv(ctx->CurrentServerDispatch, (face, pname, params));
   14825 }
   14826 
   14827 
   14828 /* DeleteFragmentShaderATI: marshalled asynchronously */
   14829 struct marshal_cmd_DeleteFragmentShaderATI
   14830 {
   14831    struct marshal_cmd_base cmd_base;
   14832    GLuint id;
   14833 };
   14834 static inline void
   14835 _mesa_unmarshal_DeleteFragmentShaderATI(struct gl_context *ctx, const struct marshal_cmd_DeleteFragmentShaderATI *cmd)
   14836 {
   14837    const GLuint id = cmd->id;
   14838    CALL_DeleteFragmentShaderATI(ctx->CurrentServerDispatch, (id));
   14839 }
   14840 static void GLAPIENTRY
   14841 _mesa_marshal_DeleteFragmentShaderATI(GLuint id)
   14842 {
   14843    GET_CURRENT_CONTEXT(ctx);
   14844    size_t cmd_size = sizeof(struct marshal_cmd_DeleteFragmentShaderATI);
   14845    struct marshal_cmd_DeleteFragmentShaderATI *cmd;
   14846    debug_print_marshal("DeleteFragmentShaderATI");
   14847    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14848       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteFragmentShaderATI, cmd_size);
   14849       cmd->id = id;
   14850       _mesa_post_marshal_hook(ctx);
   14851       return;
   14852    }
   14853 
   14854    _mesa_glthread_finish(ctx);
   14855    debug_print_sync_fallback("DeleteFragmentShaderATI");
   14856    CALL_DeleteFragmentShaderATI(ctx->CurrentServerDispatch, (id));
   14857 }
   14858 
   14859 
   14860 /* VertexArrayVertexBuffers: marshalled synchronously */
   14861 static void GLAPIENTRY
   14862 _mesa_marshal_VertexArrayVertexBuffers(GLuint vaobj, GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizei * strides)
   14863 {
   14864    GET_CURRENT_CONTEXT(ctx);
   14865    _mesa_glthread_finish(ctx);
   14866    debug_print_sync("VertexArrayVertexBuffers");
   14867    CALL_VertexArrayVertexBuffers(ctx->CurrentServerDispatch, (vaobj, first, count, buffers, offsets, strides));
   14868 }
   14869 
   14870 
   14871 /* DrawElementsInstancedBaseVertex: marshalled asynchronously */
   14872 struct marshal_cmd_DrawElementsInstancedBaseVertex
   14873 {
   14874    struct marshal_cmd_base cmd_base;
   14875    GLenum mode;
   14876    GLsizei count;
   14877    GLenum type;
   14878    const GLvoid * indices;
   14879    GLsizei primcount;
   14880    GLint basevertex;
   14881 };
   14882 static inline void
   14883 _mesa_unmarshal_DrawElementsInstancedBaseVertex(struct gl_context *ctx, const struct marshal_cmd_DrawElementsInstancedBaseVertex *cmd)
   14884 {
   14885    const GLenum mode = cmd->mode;
   14886    const GLsizei count = cmd->count;
   14887    const GLenum type = cmd->type;
   14888    const GLvoid * indices = cmd->indices;
   14889    const GLsizei primcount = cmd->primcount;
   14890    const GLint basevertex = cmd->basevertex;
   14891    CALL_DrawElementsInstancedBaseVertex(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount, basevertex));
   14892 }
   14893 static void GLAPIENTRY
   14894 _mesa_marshal_DrawElementsInstancedBaseVertex(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei primcount, GLint basevertex)
   14895 {
   14896    GET_CURRENT_CONTEXT(ctx);
   14897    size_t cmd_size = sizeof(struct marshal_cmd_DrawElementsInstancedBaseVertex);
   14898    struct marshal_cmd_DrawElementsInstancedBaseVertex *cmd;
   14899    debug_print_marshal("DrawElementsInstancedBaseVertex");
   14900    if (_mesa_glthread_is_non_vbo_draw_elements(ctx)) {
   14901       _mesa_glthread_finish(ctx);
   14902       _mesa_glthread_restore_dispatch(ctx);
   14903       debug_print_sync_fallback("DrawElementsInstancedBaseVertex");
   14904       CALL_DrawElementsInstancedBaseVertex(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount, basevertex));
   14905       return;
   14906    }
   14907    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14908       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawElementsInstancedBaseVertex, cmd_size);
   14909       cmd->mode = mode;
   14910       cmd->count = count;
   14911       cmd->type = type;
   14912       cmd->indices = indices;
   14913       cmd->primcount = primcount;
   14914       cmd->basevertex = basevertex;
   14915       _mesa_post_marshal_hook(ctx);
   14916       return;
   14917    }
   14918 
   14919    _mesa_glthread_finish(ctx);
   14920    debug_print_sync_fallback("DrawElementsInstancedBaseVertex");
   14921    CALL_DrawElementsInstancedBaseVertex(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount, basevertex));
   14922 }
   14923 
   14924 
   14925 /* DisableClientState: marshalled asynchronously */
   14926 struct marshal_cmd_DisableClientState
   14927 {
   14928    struct marshal_cmd_base cmd_base;
   14929    GLenum array;
   14930 };
   14931 static inline void
   14932 _mesa_unmarshal_DisableClientState(struct gl_context *ctx, const struct marshal_cmd_DisableClientState *cmd)
   14933 {
   14934    const GLenum array = cmd->array;
   14935    CALL_DisableClientState(ctx->CurrentServerDispatch, (array));
   14936 }
   14937 static void GLAPIENTRY
   14938 _mesa_marshal_DisableClientState(GLenum array)
   14939 {
   14940    GET_CURRENT_CONTEXT(ctx);
   14941    size_t cmd_size = sizeof(struct marshal_cmd_DisableClientState);
   14942    struct marshal_cmd_DisableClientState *cmd;
   14943    debug_print_marshal("DisableClientState");
   14944    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14945       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DisableClientState, cmd_size);
   14946       cmd->array = array;
   14947       _mesa_post_marshal_hook(ctx);
   14948       return;
   14949    }
   14950 
   14951    _mesa_glthread_finish(ctx);
   14952    debug_print_sync_fallback("DisableClientState");
   14953    CALL_DisableClientState(ctx->CurrentServerDispatch, (array));
   14954 }
   14955 
   14956 
   14957 /* TexGeni: marshalled asynchronously */
   14958 struct marshal_cmd_TexGeni
   14959 {
   14960    struct marshal_cmd_base cmd_base;
   14961    GLenum coord;
   14962    GLenum pname;
   14963    GLint param;
   14964 };
   14965 static inline void
   14966 _mesa_unmarshal_TexGeni(struct gl_context *ctx, const struct marshal_cmd_TexGeni *cmd)
   14967 {
   14968    const GLenum coord = cmd->coord;
   14969    const GLenum pname = cmd->pname;
   14970    const GLint param = cmd->param;
   14971    CALL_TexGeni(ctx->CurrentServerDispatch, (coord, pname, param));
   14972 }
   14973 static void GLAPIENTRY
   14974 _mesa_marshal_TexGeni(GLenum coord, GLenum pname, GLint param)
   14975 {
   14976    GET_CURRENT_CONTEXT(ctx);
   14977    size_t cmd_size = sizeof(struct marshal_cmd_TexGeni);
   14978    struct marshal_cmd_TexGeni *cmd;
   14979    debug_print_marshal("TexGeni");
   14980    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   14981       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexGeni, cmd_size);
   14982       cmd->coord = coord;
   14983       cmd->pname = pname;
   14984       cmd->param = param;
   14985       _mesa_post_marshal_hook(ctx);
   14986       return;
   14987    }
   14988 
   14989    _mesa_glthread_finish(ctx);
   14990    debug_print_sync_fallback("TexGeni");
   14991    CALL_TexGeni(ctx->CurrentServerDispatch, (coord, pname, param));
   14992 }
   14993 
   14994 
   14995 /* TexGenf: marshalled asynchronously */
   14996 struct marshal_cmd_TexGenf
   14997 {
   14998    struct marshal_cmd_base cmd_base;
   14999    GLenum coord;
   15000    GLenum pname;
   15001    GLfloat param;
   15002 };
   15003 static inline void
   15004 _mesa_unmarshal_TexGenf(struct gl_context *ctx, const struct marshal_cmd_TexGenf *cmd)
   15005 {
   15006    const GLenum coord = cmd->coord;
   15007    const GLenum pname = cmd->pname;
   15008    const GLfloat param = cmd->param;
   15009    CALL_TexGenf(ctx->CurrentServerDispatch, (coord, pname, param));
   15010 }
   15011 static void GLAPIENTRY
   15012 _mesa_marshal_TexGenf(GLenum coord, GLenum pname, GLfloat param)
   15013 {
   15014    GET_CURRENT_CONTEXT(ctx);
   15015    size_t cmd_size = sizeof(struct marshal_cmd_TexGenf);
   15016    struct marshal_cmd_TexGenf *cmd;
   15017    debug_print_marshal("TexGenf");
   15018    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15019       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexGenf, cmd_size);
   15020       cmd->coord = coord;
   15021       cmd->pname = pname;
   15022       cmd->param = param;
   15023       _mesa_post_marshal_hook(ctx);
   15024       return;
   15025    }
   15026 
   15027    _mesa_glthread_finish(ctx);
   15028    debug_print_sync_fallback("TexGenf");
   15029    CALL_TexGenf(ctx->CurrentServerDispatch, (coord, pname, param));
   15030 }
   15031 
   15032 
   15033 /* TexGend: marshalled asynchronously */
   15034 struct marshal_cmd_TexGend
   15035 {
   15036    struct marshal_cmd_base cmd_base;
   15037    GLenum coord;
   15038    GLenum pname;
   15039    GLdouble param;
   15040 };
   15041 static inline void
   15042 _mesa_unmarshal_TexGend(struct gl_context *ctx, const struct marshal_cmd_TexGend *cmd)
   15043 {
   15044    const GLenum coord = cmd->coord;
   15045    const GLenum pname = cmd->pname;
   15046    const GLdouble param = cmd->param;
   15047    CALL_TexGend(ctx->CurrentServerDispatch, (coord, pname, param));
   15048 }
   15049 static void GLAPIENTRY
   15050 _mesa_marshal_TexGend(GLenum coord, GLenum pname, GLdouble param)
   15051 {
   15052    GET_CURRENT_CONTEXT(ctx);
   15053    size_t cmd_size = sizeof(struct marshal_cmd_TexGend);
   15054    struct marshal_cmd_TexGend *cmd;
   15055    debug_print_marshal("TexGend");
   15056    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15057       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexGend, cmd_size);
   15058       cmd->coord = coord;
   15059       cmd->pname = pname;
   15060       cmd->param = param;
   15061       _mesa_post_marshal_hook(ctx);
   15062       return;
   15063    }
   15064 
   15065    _mesa_glthread_finish(ctx);
   15066    debug_print_sync_fallback("TexGend");
   15067    CALL_TexGend(ctx->CurrentServerDispatch, (coord, pname, param));
   15068 }
   15069 
   15070 
   15071 /* ProgramUniform4i64vARB: marshalled asynchronously */
   15072 struct marshal_cmd_ProgramUniform4i64vARB
   15073 {
   15074    struct marshal_cmd_base cmd_base;
   15075    GLuint program;
   15076    GLint location;
   15077    GLsizei count;
   15078    /* Next safe_mul(count, 32) bytes are GLint64 value[count][4] */
   15079 };
   15080 static inline void
   15081 _mesa_unmarshal_ProgramUniform4i64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4i64vARB *cmd)
   15082 {
   15083    const GLuint program = cmd->program;
   15084    const GLint location = cmd->location;
   15085    const GLsizei count = cmd->count;
   15086    const GLint64 * value;
   15087    const char *variable_data = (const char *) (cmd + 1);
   15088    value = (const GLint64 *) variable_data;
   15089    variable_data += count * 32;
   15090    CALL_ProgramUniform4i64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
   15091 }
   15092 static void GLAPIENTRY
   15093 _mesa_marshal_ProgramUniform4i64vARB(GLuint program, GLint location, GLsizei count, const GLint64 * value)
   15094 {
   15095    GET_CURRENT_CONTEXT(ctx);
   15096    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform4i64vARB) + safe_mul(count, 32);
   15097    struct marshal_cmd_ProgramUniform4i64vARB *cmd;
   15098    debug_print_marshal("ProgramUniform4i64vARB");
   15099    if (unlikely(safe_mul(count, 32) < 0)) {
   15100       goto fallback_to_sync;
   15101    }
   15102    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15103       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4i64vARB, cmd_size);
   15104       cmd->program = program;
   15105       cmd->location = location;
   15106       cmd->count = count;
   15107       char *variable_data = (char *) (cmd + 1);
   15108       memcpy(variable_data, value, count * 32);
   15109       variable_data += count * 32;
   15110       _mesa_post_marshal_hook(ctx);
   15111       return;
   15112    }
   15113 
   15114 fallback_to_sync:
   15115    _mesa_glthread_finish(ctx);
   15116    debug_print_sync_fallback("ProgramUniform4i64vARB");
   15117    CALL_ProgramUniform4i64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
   15118 }
   15119 
   15120 
   15121 /* Color4sv: marshalled asynchronously */
   15122 struct marshal_cmd_Color4sv
   15123 {
   15124    struct marshal_cmd_base cmd_base;
   15125    GLshort v[4];
   15126 };
   15127 static inline void
   15128 _mesa_unmarshal_Color4sv(struct gl_context *ctx, const struct marshal_cmd_Color4sv *cmd)
   15129 {
   15130    const GLshort * v = cmd->v;
   15131    CALL_Color4sv(ctx->CurrentServerDispatch, (v));
   15132 }
   15133 static void GLAPIENTRY
   15134 _mesa_marshal_Color4sv(const GLshort * v)
   15135 {
   15136    GET_CURRENT_CONTEXT(ctx);
   15137    size_t cmd_size = sizeof(struct marshal_cmd_Color4sv);
   15138    struct marshal_cmd_Color4sv *cmd;
   15139    debug_print_marshal("Color4sv");
   15140    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15141       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4sv, cmd_size);
   15142       memcpy(cmd->v, v, 8);
   15143       _mesa_post_marshal_hook(ctx);
   15144       return;
   15145    }
   15146 
   15147    _mesa_glthread_finish(ctx);
   15148    debug_print_sync_fallback("Color4sv");
   15149    CALL_Color4sv(ctx->CurrentServerDispatch, (v));
   15150 }
   15151 
   15152 
   15153 /* LoadTransposeMatrixf: marshalled synchronously */
   15154 static void GLAPIENTRY
   15155 _mesa_marshal_LoadTransposeMatrixf(const GLfloat * m)
   15156 {
   15157    GET_CURRENT_CONTEXT(ctx);
   15158    _mesa_glthread_finish(ctx);
   15159    debug_print_sync("LoadTransposeMatrixf");
   15160    CALL_LoadTransposeMatrixf(ctx->CurrentServerDispatch, (m));
   15161 }
   15162 
   15163 
   15164 /* LoadTransposeMatrixd: marshalled synchronously */
   15165 static void GLAPIENTRY
   15166 _mesa_marshal_LoadTransposeMatrixd(const GLdouble * m)
   15167 {
   15168    GET_CURRENT_CONTEXT(ctx);
   15169    _mesa_glthread_finish(ctx);
   15170    debug_print_sync("LoadTransposeMatrixd");
   15171    CALL_LoadTransposeMatrixd(ctx->CurrentServerDispatch, (m));
   15172 }
   15173 
   15174 
   15175 /* PixelZoom: marshalled asynchronously */
   15176 struct marshal_cmd_PixelZoom
   15177 {
   15178    struct marshal_cmd_base cmd_base;
   15179    GLfloat xfactor;
   15180    GLfloat yfactor;
   15181 };
   15182 static inline void
   15183 _mesa_unmarshal_PixelZoom(struct gl_context *ctx, const struct marshal_cmd_PixelZoom *cmd)
   15184 {
   15185    const GLfloat xfactor = cmd->xfactor;
   15186    const GLfloat yfactor = cmd->yfactor;
   15187    CALL_PixelZoom(ctx->CurrentServerDispatch, (xfactor, yfactor));
   15188 }
   15189 static void GLAPIENTRY
   15190 _mesa_marshal_PixelZoom(GLfloat xfactor, GLfloat yfactor)
   15191 {
   15192    GET_CURRENT_CONTEXT(ctx);
   15193    size_t cmd_size = sizeof(struct marshal_cmd_PixelZoom);
   15194    struct marshal_cmd_PixelZoom *cmd;
   15195    debug_print_marshal("PixelZoom");
   15196    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15197       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PixelZoom, cmd_size);
   15198       cmd->xfactor = xfactor;
   15199       cmd->yfactor = yfactor;
   15200       _mesa_post_marshal_hook(ctx);
   15201       return;
   15202    }
   15203 
   15204    _mesa_glthread_finish(ctx);
   15205    debug_print_sync_fallback("PixelZoom");
   15206    CALL_PixelZoom(ctx->CurrentServerDispatch, (xfactor, yfactor));
   15207 }
   15208 
   15209 
   15210 /* ProgramEnvParameter4dARB: marshalled asynchronously */
   15211 struct marshal_cmd_ProgramEnvParameter4dARB
   15212 {
   15213    struct marshal_cmd_base cmd_base;
   15214    GLenum target;
   15215    GLuint index;
   15216    GLdouble x;
   15217    GLdouble y;
   15218    GLdouble z;
   15219    GLdouble w;
   15220 };
   15221 static inline void
   15222 _mesa_unmarshal_ProgramEnvParameter4dARB(struct gl_context *ctx, const struct marshal_cmd_ProgramEnvParameter4dARB *cmd)
   15223 {
   15224    const GLenum target = cmd->target;
   15225    const GLuint index = cmd->index;
   15226    const GLdouble x = cmd->x;
   15227    const GLdouble y = cmd->y;
   15228    const GLdouble z = cmd->z;
   15229    const GLdouble w = cmd->w;
   15230    CALL_ProgramEnvParameter4dARB(ctx->CurrentServerDispatch, (target, index, x, y, z, w));
   15231 }
   15232 static void GLAPIENTRY
   15233 _mesa_marshal_ProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
   15234 {
   15235    GET_CURRENT_CONTEXT(ctx);
   15236    size_t cmd_size = sizeof(struct marshal_cmd_ProgramEnvParameter4dARB);
   15237    struct marshal_cmd_ProgramEnvParameter4dARB *cmd;
   15238    debug_print_marshal("ProgramEnvParameter4dARB");
   15239    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15240       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramEnvParameter4dARB, cmd_size);
   15241       cmd->target = target;
   15242       cmd->index = index;
   15243       cmd->x = x;
   15244       cmd->y = y;
   15245       cmd->z = z;
   15246       cmd->w = w;
   15247       _mesa_post_marshal_hook(ctx);
   15248       return;
   15249    }
   15250 
   15251    _mesa_glthread_finish(ctx);
   15252    debug_print_sync_fallback("ProgramEnvParameter4dARB");
   15253    CALL_ProgramEnvParameter4dARB(ctx->CurrentServerDispatch, (target, index, x, y, z, w));
   15254 }
   15255 
   15256 
   15257 /* ColorTableParameterfv: marshalled synchronously */
   15258 static void GLAPIENTRY
   15259 _mesa_marshal_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat * params)
   15260 {
   15261    GET_CURRENT_CONTEXT(ctx);
   15262    _mesa_glthread_finish(ctx);
   15263    debug_print_sync("ColorTableParameterfv");
   15264    CALL_ColorTableParameterfv(ctx->CurrentServerDispatch, (target, pname, params));
   15265 }
   15266 
   15267 
   15268 /* IsSemaphoreEXT: marshalled synchronously */
   15269 static GLboolean GLAPIENTRY
   15270 _mesa_marshal_IsSemaphoreEXT(GLuint semaphore)
   15271 {
   15272    GET_CURRENT_CONTEXT(ctx);
   15273    _mesa_glthread_finish(ctx);
   15274    debug_print_sync("IsSemaphoreEXT");
   15275    return CALL_IsSemaphoreEXT(ctx->CurrentServerDispatch, (semaphore));
   15276 }
   15277 
   15278 
   15279 /* IsTexture: marshalled synchronously */
   15280 static GLboolean GLAPIENTRY
   15281 _mesa_marshal_IsTexture(GLuint texture)
   15282 {
   15283    GET_CURRENT_CONTEXT(ctx);
   15284    _mesa_glthread_finish(ctx);
   15285    debug_print_sync("IsTexture");
   15286    return CALL_IsTexture(ctx->CurrentServerDispatch, (texture));
   15287 }
   15288 
   15289 
   15290 /* ProgramUniform3uiv: marshalled asynchronously */
   15291 struct marshal_cmd_ProgramUniform3uiv
   15292 {
   15293    struct marshal_cmd_base cmd_base;
   15294    GLuint program;
   15295    GLint location;
   15296    GLsizei count;
   15297    /* Next safe_mul(count, 12) bytes are GLuint value[count][3] */
   15298 };
   15299 static inline void
   15300 _mesa_unmarshal_ProgramUniform3uiv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3uiv *cmd)
   15301 {
   15302    const GLuint program = cmd->program;
   15303    const GLint location = cmd->location;
   15304    const GLsizei count = cmd->count;
   15305    const GLuint * value;
   15306    const char *variable_data = (const char *) (cmd + 1);
   15307    value = (const GLuint *) variable_data;
   15308    variable_data += count * 12;
   15309    CALL_ProgramUniform3uiv(ctx->CurrentServerDispatch, (program, location, count, value));
   15310 }
   15311 static void GLAPIENTRY
   15312 _mesa_marshal_ProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
   15313 {
   15314    GET_CURRENT_CONTEXT(ctx);
   15315    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform3uiv) + safe_mul(count, 12);
   15316    struct marshal_cmd_ProgramUniform3uiv *cmd;
   15317    debug_print_marshal("ProgramUniform3uiv");
   15318    if (unlikely(safe_mul(count, 12) < 0)) {
   15319       goto fallback_to_sync;
   15320    }
   15321    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15322       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3uiv, cmd_size);
   15323       cmd->program = program;
   15324       cmd->location = location;
   15325       cmd->count = count;
   15326       char *variable_data = (char *) (cmd + 1);
   15327       memcpy(variable_data, value, count * 12);
   15328       variable_data += count * 12;
   15329       _mesa_post_marshal_hook(ctx);
   15330       return;
   15331    }
   15332 
   15333 fallback_to_sync:
   15334    _mesa_glthread_finish(ctx);
   15335    debug_print_sync_fallback("ProgramUniform3uiv");
   15336    CALL_ProgramUniform3uiv(ctx->CurrentServerDispatch, (program, location, count, value));
   15337 }
   15338 
   15339 
   15340 /* IndexPointer: marshalled asynchronously */
   15341 struct marshal_cmd_IndexPointer
   15342 {
   15343    struct marshal_cmd_base cmd_base;
   15344    GLenum type;
   15345    GLsizei stride;
   15346    const GLvoid * pointer;
   15347 };
   15348 static inline void
   15349 _mesa_unmarshal_IndexPointer(struct gl_context *ctx, const struct marshal_cmd_IndexPointer *cmd)
   15350 {
   15351    const GLenum type = cmd->type;
   15352    const GLsizei stride = cmd->stride;
   15353    const GLvoid * pointer = cmd->pointer;
   15354    CALL_IndexPointer(ctx->CurrentServerDispatch, (type, stride, pointer));
   15355 }
   15356 static void GLAPIENTRY
   15357 _mesa_marshal_IndexPointer(GLenum type, GLsizei stride, const GLvoid * pointer)
   15358 {
   15359    GET_CURRENT_CONTEXT(ctx);
   15360    size_t cmd_size = sizeof(struct marshal_cmd_IndexPointer);
   15361    struct marshal_cmd_IndexPointer *cmd;
   15362    debug_print_marshal("IndexPointer");
   15363    if (_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)) {
   15364       _mesa_glthread_finish(ctx);
   15365       _mesa_glthread_restore_dispatch(ctx);
   15366       debug_print_sync_fallback("IndexPointer");
   15367       CALL_IndexPointer(ctx->CurrentServerDispatch, (type, stride, pointer));
   15368       return;
   15369    }
   15370    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15371       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_IndexPointer, cmd_size);
   15372       cmd->type = type;
   15373       cmd->stride = stride;
   15374       cmd->pointer = pointer;
   15375       _mesa_post_marshal_hook(ctx);
   15376       return;
   15377    }
   15378 
   15379    _mesa_glthread_finish(ctx);
   15380    debug_print_sync_fallback("IndexPointer");
   15381    CALL_IndexPointer(ctx->CurrentServerDispatch, (type, stride, pointer));
   15382 }
   15383 
   15384 
   15385 /* VertexAttrib4sNV: marshalled asynchronously */
   15386 struct marshal_cmd_VertexAttrib4sNV
   15387 {
   15388    struct marshal_cmd_base cmd_base;
   15389    GLuint index;
   15390    GLshort x;
   15391    GLshort y;
   15392    GLshort z;
   15393    GLshort w;
   15394 };
   15395 static inline void
   15396 _mesa_unmarshal_VertexAttrib4sNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4sNV *cmd)
   15397 {
   15398    const GLuint index = cmd->index;
   15399    const GLshort x = cmd->x;
   15400    const GLshort y = cmd->y;
   15401    const GLshort z = cmd->z;
   15402    const GLshort w = cmd->w;
   15403    CALL_VertexAttrib4sNV(ctx->CurrentServerDispatch, (index, x, y, z, w));
   15404 }
   15405 static void GLAPIENTRY
   15406 _mesa_marshal_VertexAttrib4sNV(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
   15407 {
   15408    GET_CURRENT_CONTEXT(ctx);
   15409    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4sNV);
   15410    struct marshal_cmd_VertexAttrib4sNV *cmd;
   15411    debug_print_marshal("VertexAttrib4sNV");
   15412    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15413       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4sNV, cmd_size);
   15414       cmd->index = index;
   15415       cmd->x = x;
   15416       cmd->y = y;
   15417       cmd->z = z;
   15418       cmd->w = w;
   15419       _mesa_post_marshal_hook(ctx);
   15420       return;
   15421    }
   15422 
   15423    _mesa_glthread_finish(ctx);
   15424    debug_print_sync_fallback("VertexAttrib4sNV");
   15425    CALL_VertexAttrib4sNV(ctx->CurrentServerDispatch, (index, x, y, z, w));
   15426 }
   15427 
   15428 
   15429 /* GetMapdv: marshalled synchronously */
   15430 static void GLAPIENTRY
   15431 _mesa_marshal_GetMapdv(GLenum target, GLenum query, GLdouble * v)
   15432 {
   15433    GET_CURRENT_CONTEXT(ctx);
   15434    _mesa_glthread_finish(ctx);
   15435    debug_print_sync("GetMapdv");
   15436    CALL_GetMapdv(ctx->CurrentServerDispatch, (target, query, v));
   15437 }
   15438 
   15439 
   15440 /* Uniform3ui64vARB: marshalled asynchronously */
   15441 struct marshal_cmd_Uniform3ui64vARB
   15442 {
   15443    struct marshal_cmd_base cmd_base;
   15444    GLint location;
   15445    GLsizei count;
   15446    /* Next safe_mul(count, 24) bytes are GLuint64 value[count][3] */
   15447 };
   15448 static inline void
   15449 _mesa_unmarshal_Uniform3ui64vARB(struct gl_context *ctx, const struct marshal_cmd_Uniform3ui64vARB *cmd)
   15450 {
   15451    const GLint location = cmd->location;
   15452    const GLsizei count = cmd->count;
   15453    const GLuint64 * value;
   15454    const char *variable_data = (const char *) (cmd + 1);
   15455    value = (const GLuint64 *) variable_data;
   15456    variable_data += count * 24;
   15457    CALL_Uniform3ui64vARB(ctx->CurrentServerDispatch, (location, count, value));
   15458 }
   15459 static void GLAPIENTRY
   15460 _mesa_marshal_Uniform3ui64vARB(GLint location, GLsizei count, const GLuint64 * value)
   15461 {
   15462    GET_CURRENT_CONTEXT(ctx);
   15463    size_t cmd_size = sizeof(struct marshal_cmd_Uniform3ui64vARB) + safe_mul(count, 24);
   15464    struct marshal_cmd_Uniform3ui64vARB *cmd;
   15465    debug_print_marshal("Uniform3ui64vARB");
   15466    if (unlikely(safe_mul(count, 24) < 0)) {
   15467       goto fallback_to_sync;
   15468    }
   15469    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15470       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3ui64vARB, cmd_size);
   15471       cmd->location = location;
   15472       cmd->count = count;
   15473       char *variable_data = (char *) (cmd + 1);
   15474       memcpy(variable_data, value, count * 24);
   15475       variable_data += count * 24;
   15476       _mesa_post_marshal_hook(ctx);
   15477       return;
   15478    }
   15479 
   15480 fallback_to_sync:
   15481    _mesa_glthread_finish(ctx);
   15482    debug_print_sync_fallback("Uniform3ui64vARB");
   15483    CALL_Uniform3ui64vARB(ctx->CurrentServerDispatch, (location, count, value));
   15484 }
   15485 
   15486 
   15487 /* GetInteger64i_v: marshalled synchronously */
   15488 static void GLAPIENTRY
   15489 _mesa_marshal_GetInteger64i_v(GLenum cap, GLuint index, GLint64 * data)
   15490 {
   15491    GET_CURRENT_CONTEXT(ctx);
   15492    _mesa_glthread_finish(ctx);
   15493    debug_print_sync("GetInteger64i_v");
   15494    CALL_GetInteger64i_v(ctx->CurrentServerDispatch, (cap, index, data));
   15495 }
   15496 
   15497 
   15498 /* BufferPageCommitmentARB: marshalled asynchronously */
   15499 struct marshal_cmd_BufferPageCommitmentARB
   15500 {
   15501    struct marshal_cmd_base cmd_base;
   15502    GLenum target;
   15503    GLintptr offset;
   15504    GLsizeiptr size;
   15505    GLboolean commit;
   15506 };
   15507 static inline void
   15508 _mesa_unmarshal_BufferPageCommitmentARB(struct gl_context *ctx, const struct marshal_cmd_BufferPageCommitmentARB *cmd)
   15509 {
   15510    const GLenum target = cmd->target;
   15511    const GLintptr offset = cmd->offset;
   15512    const GLsizeiptr size = cmd->size;
   15513    const GLboolean commit = cmd->commit;
   15514    CALL_BufferPageCommitmentARB(ctx->CurrentServerDispatch, (target, offset, size, commit));
   15515 }
   15516 static void GLAPIENTRY
   15517 _mesa_marshal_BufferPageCommitmentARB(GLenum target, GLintptr offset, GLsizeiptr size, GLboolean commit)
   15518 {
   15519    GET_CURRENT_CONTEXT(ctx);
   15520    size_t cmd_size = sizeof(struct marshal_cmd_BufferPageCommitmentARB);
   15521    struct marshal_cmd_BufferPageCommitmentARB *cmd;
   15522    debug_print_marshal("BufferPageCommitmentARB");
   15523    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15524       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BufferPageCommitmentARB, cmd_size);
   15525       cmd->target = target;
   15526       cmd->offset = offset;
   15527       cmd->size = size;
   15528       cmd->commit = commit;
   15529       _mesa_post_marshal_hook(ctx);
   15530       return;
   15531    }
   15532 
   15533    _mesa_glthread_finish(ctx);
   15534    debug_print_sync_fallback("BufferPageCommitmentARB");
   15535    CALL_BufferPageCommitmentARB(ctx->CurrentServerDispatch, (target, offset, size, commit));
   15536 }
   15537 
   15538 
   15539 /* IsBuffer: marshalled synchronously */
   15540 static GLboolean GLAPIENTRY
   15541 _mesa_marshal_IsBuffer(GLuint buffer)
   15542 {
   15543    GET_CURRENT_CONTEXT(ctx);
   15544    _mesa_glthread_finish(ctx);
   15545    debug_print_sync("IsBuffer");
   15546    return CALL_IsBuffer(ctx->CurrentServerDispatch, (buffer));
   15547 }
   15548 
   15549 
   15550 /* ColorP4ui: marshalled asynchronously */
   15551 struct marshal_cmd_ColorP4ui
   15552 {
   15553    struct marshal_cmd_base cmd_base;
   15554    GLenum type;
   15555    GLuint color;
   15556 };
   15557 static inline void
   15558 _mesa_unmarshal_ColorP4ui(struct gl_context *ctx, const struct marshal_cmd_ColorP4ui *cmd)
   15559 {
   15560    const GLenum type = cmd->type;
   15561    const GLuint color = cmd->color;
   15562    CALL_ColorP4ui(ctx->CurrentServerDispatch, (type, color));
   15563 }
   15564 static void GLAPIENTRY
   15565 _mesa_marshal_ColorP4ui(GLenum type, GLuint color)
   15566 {
   15567    GET_CURRENT_CONTEXT(ctx);
   15568    size_t cmd_size = sizeof(struct marshal_cmd_ColorP4ui);
   15569    struct marshal_cmd_ColorP4ui *cmd;
   15570    debug_print_marshal("ColorP4ui");
   15571    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15572       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorP4ui, cmd_size);
   15573       cmd->type = type;
   15574       cmd->color = color;
   15575       _mesa_post_marshal_hook(ctx);
   15576       return;
   15577    }
   15578 
   15579    _mesa_glthread_finish(ctx);
   15580    debug_print_sync_fallback("ColorP4ui");
   15581    CALL_ColorP4ui(ctx->CurrentServerDispatch, (type, color));
   15582 }
   15583 
   15584 
   15585 /* TextureStorage3D: marshalled asynchronously */
   15586 struct marshal_cmd_TextureStorage3D
   15587 {
   15588    struct marshal_cmd_base cmd_base;
   15589    GLuint texture;
   15590    GLsizei levels;
   15591    GLenum internalformat;
   15592    GLsizei width;
   15593    GLsizei height;
   15594    GLsizei depth;
   15595 };
   15596 static inline void
   15597 _mesa_unmarshal_TextureStorage3D(struct gl_context *ctx, const struct marshal_cmd_TextureStorage3D *cmd)
   15598 {
   15599    const GLuint texture = cmd->texture;
   15600    const GLsizei levels = cmd->levels;
   15601    const GLenum internalformat = cmd->internalformat;
   15602    const GLsizei width = cmd->width;
   15603    const GLsizei height = cmd->height;
   15604    const GLsizei depth = cmd->depth;
   15605    CALL_TextureStorage3D(ctx->CurrentServerDispatch, (texture, levels, internalformat, width, height, depth));
   15606 }
   15607 static void GLAPIENTRY
   15608 _mesa_marshal_TextureStorage3D(GLuint texture, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
   15609 {
   15610    GET_CURRENT_CONTEXT(ctx);
   15611    size_t cmd_size = sizeof(struct marshal_cmd_TextureStorage3D);
   15612    struct marshal_cmd_TextureStorage3D *cmd;
   15613    debug_print_marshal("TextureStorage3D");
   15614    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15615       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage3D, cmd_size);
   15616       cmd->texture = texture;
   15617       cmd->levels = levels;
   15618       cmd->internalformat = internalformat;
   15619       cmd->width = width;
   15620       cmd->height = height;
   15621       cmd->depth = depth;
   15622       _mesa_post_marshal_hook(ctx);
   15623       return;
   15624    }
   15625 
   15626    _mesa_glthread_finish(ctx);
   15627    debug_print_sync_fallback("TextureStorage3D");
   15628    CALL_TextureStorage3D(ctx->CurrentServerDispatch, (texture, levels, internalformat, width, height, depth));
   15629 }
   15630 
   15631 
   15632 /* TexCoordP3uiv: marshalled synchronously */
   15633 static void GLAPIENTRY
   15634 _mesa_marshal_TexCoordP3uiv(GLenum type, const GLuint * coords)
   15635 {
   15636    GET_CURRENT_CONTEXT(ctx);
   15637    _mesa_glthread_finish(ctx);
   15638    debug_print_sync("TexCoordP3uiv");
   15639    CALL_TexCoordP3uiv(ctx->CurrentServerDispatch, (type, coords));
   15640 }
   15641 
   15642 
   15643 /* GetnUniformui64vARB: marshalled synchronously */
   15644 static void GLAPIENTRY
   15645 _mesa_marshal_GetnUniformui64vARB(GLuint program, GLint location, GLsizei bufSize, GLuint64 * params)
   15646 {
   15647    GET_CURRENT_CONTEXT(ctx);
   15648    _mesa_glthread_finish(ctx);
   15649    debug_print_sync("GetnUniformui64vARB");
   15650    CALL_GetnUniformui64vARB(ctx->CurrentServerDispatch, (program, location, bufSize, params));
   15651 }
   15652 
   15653 
   15654 /* TextureStorageMem2DMultisampleEXT: marshalled asynchronously */
   15655 struct marshal_cmd_TextureStorageMem2DMultisampleEXT
   15656 {
   15657    struct marshal_cmd_base cmd_base;
   15658    GLuint texture;
   15659    GLsizei samples;
   15660    GLenum internalFormat;
   15661    GLsizei width;
   15662    GLsizei height;
   15663    GLboolean fixedSampleLocations;
   15664    GLuint memory;
   15665    GLuint64 offset;
   15666 };
   15667 static inline void
   15668 _mesa_unmarshal_TextureStorageMem2DMultisampleEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorageMem2DMultisampleEXT *cmd)
   15669 {
   15670    const GLuint texture = cmd->texture;
   15671    const GLsizei samples = cmd->samples;
   15672    const GLenum internalFormat = cmd->internalFormat;
   15673    const GLsizei width = cmd->width;
   15674    const GLsizei height = cmd->height;
   15675    const GLboolean fixedSampleLocations = cmd->fixedSampleLocations;
   15676    const GLuint memory = cmd->memory;
   15677    const GLuint64 offset = cmd->offset;
   15678    CALL_TextureStorageMem2DMultisampleEXT(ctx->CurrentServerDispatch, (texture, samples, internalFormat, width, height, fixedSampleLocations, memory, offset));
   15679 }
   15680 static void GLAPIENTRY
   15681 _mesa_marshal_TextureStorageMem2DMultisampleEXT(GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset)
   15682 {
   15683    GET_CURRENT_CONTEXT(ctx);
   15684    size_t cmd_size = sizeof(struct marshal_cmd_TextureStorageMem2DMultisampleEXT);
   15685    struct marshal_cmd_TextureStorageMem2DMultisampleEXT *cmd;
   15686    debug_print_marshal("TextureStorageMem2DMultisampleEXT");
   15687    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15688       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorageMem2DMultisampleEXT, cmd_size);
   15689       cmd->texture = texture;
   15690       cmd->samples = samples;
   15691       cmd->internalFormat = internalFormat;
   15692       cmd->width = width;
   15693       cmd->height = height;
   15694       cmd->fixedSampleLocations = fixedSampleLocations;
   15695       cmd->memory = memory;
   15696       cmd->offset = offset;
   15697       _mesa_post_marshal_hook(ctx);
   15698       return;
   15699    }
   15700 
   15701    _mesa_glthread_finish(ctx);
   15702    debug_print_sync_fallback("TextureStorageMem2DMultisampleEXT");
   15703    CALL_TextureStorageMem2DMultisampleEXT(ctx->CurrentServerDispatch, (texture, samples, internalFormat, width, height, fixedSampleLocations, memory, offset));
   15704 }
   15705 
   15706 
   15707 /* Uniform1iv: marshalled asynchronously */
   15708 struct marshal_cmd_Uniform1iv
   15709 {
   15710    struct marshal_cmd_base cmd_base;
   15711    GLint location;
   15712    GLsizei count;
   15713    /* Next safe_mul(count, 4) bytes are GLint value[count] */
   15714 };
   15715 static inline void
   15716 _mesa_unmarshal_Uniform1iv(struct gl_context *ctx, const struct marshal_cmd_Uniform1iv *cmd)
   15717 {
   15718    const GLint location = cmd->location;
   15719    const GLsizei count = cmd->count;
   15720    const GLint * value;
   15721    const char *variable_data = (const char *) (cmd + 1);
   15722    value = (const GLint *) variable_data;
   15723    variable_data += count * 4;
   15724    CALL_Uniform1iv(ctx->CurrentServerDispatch, (location, count, value));
   15725 }
   15726 static void GLAPIENTRY
   15727 _mesa_marshal_Uniform1iv(GLint location, GLsizei count, const GLint * value)
   15728 {
   15729    GET_CURRENT_CONTEXT(ctx);
   15730    size_t cmd_size = sizeof(struct marshal_cmd_Uniform1iv) + safe_mul(count, 4);
   15731    struct marshal_cmd_Uniform1iv *cmd;
   15732    debug_print_marshal("Uniform1iv");
   15733    if (unlikely(safe_mul(count, 4) < 0)) {
   15734       goto fallback_to_sync;
   15735    }
   15736    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15737       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1iv, cmd_size);
   15738       cmd->location = location;
   15739       cmd->count = count;
   15740       char *variable_data = (char *) (cmd + 1);
   15741       memcpy(variable_data, value, count * 4);
   15742       variable_data += count * 4;
   15743       _mesa_post_marshal_hook(ctx);
   15744       return;
   15745    }
   15746 
   15747 fallback_to_sync:
   15748    _mesa_glthread_finish(ctx);
   15749    debug_print_sync_fallback("Uniform1iv");
   15750    CALL_Uniform1iv(ctx->CurrentServerDispatch, (location, count, value));
   15751 }
   15752 
   15753 
   15754 /* Uniform4uiv: marshalled asynchronously */
   15755 struct marshal_cmd_Uniform4uiv
   15756 {
   15757    struct marshal_cmd_base cmd_base;
   15758    GLint location;
   15759    GLsizei count;
   15760    /* Next safe_mul(count, 16) bytes are GLuint value[count][4] */
   15761 };
   15762 static inline void
   15763 _mesa_unmarshal_Uniform4uiv(struct gl_context *ctx, const struct marshal_cmd_Uniform4uiv *cmd)
   15764 {
   15765    const GLint location = cmd->location;
   15766    const GLsizei count = cmd->count;
   15767    const GLuint * value;
   15768    const char *variable_data = (const char *) (cmd + 1);
   15769    value = (const GLuint *) variable_data;
   15770    variable_data += count * 16;
   15771    CALL_Uniform4uiv(ctx->CurrentServerDispatch, (location, count, value));
   15772 }
   15773 static void GLAPIENTRY
   15774 _mesa_marshal_Uniform4uiv(GLint location, GLsizei count, const GLuint * value)
   15775 {
   15776    GET_CURRENT_CONTEXT(ctx);
   15777    size_t cmd_size = sizeof(struct marshal_cmd_Uniform4uiv) + safe_mul(count, 16);
   15778    struct marshal_cmd_Uniform4uiv *cmd;
   15779    debug_print_marshal("Uniform4uiv");
   15780    if (unlikely(safe_mul(count, 16) < 0)) {
   15781       goto fallback_to_sync;
   15782    }
   15783    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15784       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4uiv, cmd_size);
   15785       cmd->location = location;
   15786       cmd->count = count;
   15787       char *variable_data = (char *) (cmd + 1);
   15788       memcpy(variable_data, value, count * 16);
   15789       variable_data += count * 16;
   15790       _mesa_post_marshal_hook(ctx);
   15791       return;
   15792    }
   15793 
   15794 fallback_to_sync:
   15795    _mesa_glthread_finish(ctx);
   15796    debug_print_sync_fallback("Uniform4uiv");
   15797    CALL_Uniform4uiv(ctx->CurrentServerDispatch, (location, count, value));
   15798 }
   15799 
   15800 
   15801 /* PopDebugGroup: marshalled asynchronously */
   15802 struct marshal_cmd_PopDebugGroup
   15803 {
   15804    struct marshal_cmd_base cmd_base;
   15805 };
   15806 static inline void
   15807 _mesa_unmarshal_PopDebugGroup(struct gl_context *ctx, const struct marshal_cmd_PopDebugGroup *cmd)
   15808 {
   15809    CALL_PopDebugGroup(ctx->CurrentServerDispatch, ());
   15810 }
   15811 static void GLAPIENTRY
   15812 _mesa_marshal_PopDebugGroup(void)
   15813 {
   15814    GET_CURRENT_CONTEXT(ctx);
   15815    size_t cmd_size = sizeof(struct marshal_cmd_PopDebugGroup);
   15816    struct marshal_cmd_PopDebugGroup *cmd;
   15817    debug_print_marshal("PopDebugGroup");
   15818    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15819       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PopDebugGroup, cmd_size);
   15820       (void) cmd;
   15821 
   15822       _mesa_post_marshal_hook(ctx);
   15823       return;
   15824    }
   15825 
   15826    _mesa_glthread_finish(ctx);
   15827    debug_print_sync_fallback("PopDebugGroup");
   15828    CALL_PopDebugGroup(ctx->CurrentServerDispatch, ());
   15829 }
   15830 
   15831 
   15832 /* VertexAttrib1d: marshalled asynchronously */
   15833 struct marshal_cmd_VertexAttrib1d
   15834 {
   15835    struct marshal_cmd_base cmd_base;
   15836    GLuint index;
   15837    GLdouble x;
   15838 };
   15839 static inline void
   15840 _mesa_unmarshal_VertexAttrib1d(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1d *cmd)
   15841 {
   15842    const GLuint index = cmd->index;
   15843    const GLdouble x = cmd->x;
   15844    CALL_VertexAttrib1d(ctx->CurrentServerDispatch, (index, x));
   15845 }
   15846 static void GLAPIENTRY
   15847 _mesa_marshal_VertexAttrib1d(GLuint index, GLdouble x)
   15848 {
   15849    GET_CURRENT_CONTEXT(ctx);
   15850    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib1d);
   15851    struct marshal_cmd_VertexAttrib1d *cmd;
   15852    debug_print_marshal("VertexAttrib1d");
   15853    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15854       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1d, cmd_size);
   15855       cmd->index = index;
   15856       cmd->x = x;
   15857       _mesa_post_marshal_hook(ctx);
   15858       return;
   15859    }
   15860 
   15861    _mesa_glthread_finish(ctx);
   15862    debug_print_sync_fallback("VertexAttrib1d");
   15863    CALL_VertexAttrib1d(ctx->CurrentServerDispatch, (index, x));
   15864 }
   15865 
   15866 
   15867 /* CompressedTexImage1D: marshalled synchronously */
   15868 static void GLAPIENTRY
   15869 _mesa_marshal_CompressedTexImage1D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid * data)
   15870 {
   15871    GET_CURRENT_CONTEXT(ctx);
   15872    _mesa_glthread_finish(ctx);
   15873    debug_print_sync("CompressedTexImage1D");
   15874    CALL_CompressedTexImage1D(ctx->CurrentServerDispatch, (target, level, internalformat, width, border, imageSize, data));
   15875 }
   15876 
   15877 
   15878 /* TexBufferRange: marshalled asynchronously */
   15879 struct marshal_cmd_TexBufferRange
   15880 {
   15881    struct marshal_cmd_base cmd_base;
   15882    GLenum target;
   15883    GLenum internalformat;
   15884    GLuint buffer;
   15885    GLintptr offset;
   15886    GLsizeiptr size;
   15887 };
   15888 static inline void
   15889 _mesa_unmarshal_TexBufferRange(struct gl_context *ctx, const struct marshal_cmd_TexBufferRange *cmd)
   15890 {
   15891    const GLenum target = cmd->target;
   15892    const GLenum internalformat = cmd->internalformat;
   15893    const GLuint buffer = cmd->buffer;
   15894    const GLintptr offset = cmd->offset;
   15895    const GLsizeiptr size = cmd->size;
   15896    CALL_TexBufferRange(ctx->CurrentServerDispatch, (target, internalformat, buffer, offset, size));
   15897 }
   15898 static void GLAPIENTRY
   15899 _mesa_marshal_TexBufferRange(GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size)
   15900 {
   15901    GET_CURRENT_CONTEXT(ctx);
   15902    size_t cmd_size = sizeof(struct marshal_cmd_TexBufferRange);
   15903    struct marshal_cmd_TexBufferRange *cmd;
   15904    debug_print_marshal("TexBufferRange");
   15905    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15906       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexBufferRange, cmd_size);
   15907       cmd->target = target;
   15908       cmd->internalformat = internalformat;
   15909       cmd->buffer = buffer;
   15910       cmd->offset = offset;
   15911       cmd->size = size;
   15912       _mesa_post_marshal_hook(ctx);
   15913       return;
   15914    }
   15915 
   15916    _mesa_glthread_finish(ctx);
   15917    debug_print_sync_fallback("TexBufferRange");
   15918    CALL_TexBufferRange(ctx->CurrentServerDispatch, (target, internalformat, buffer, offset, size));
   15919 }
   15920 
   15921 
   15922 /* VertexAttrib1s: marshalled asynchronously */
   15923 struct marshal_cmd_VertexAttrib1s
   15924 {
   15925    struct marshal_cmd_base cmd_base;
   15926    GLuint index;
   15927    GLshort x;
   15928 };
   15929 static inline void
   15930 _mesa_unmarshal_VertexAttrib1s(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1s *cmd)
   15931 {
   15932    const GLuint index = cmd->index;
   15933    const GLshort x = cmd->x;
   15934    CALL_VertexAttrib1s(ctx->CurrentServerDispatch, (index, x));
   15935 }
   15936 static void GLAPIENTRY
   15937 _mesa_marshal_VertexAttrib1s(GLuint index, GLshort x)
   15938 {
   15939    GET_CURRENT_CONTEXT(ctx);
   15940    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib1s);
   15941    struct marshal_cmd_VertexAttrib1s *cmd;
   15942    debug_print_marshal("VertexAttrib1s");
   15943    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   15944       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1s, cmd_size);
   15945       cmd->index = index;
   15946       cmd->x = x;
   15947       _mesa_post_marshal_hook(ctx);
   15948       return;
   15949    }
   15950 
   15951    _mesa_glthread_finish(ctx);
   15952    debug_print_sync_fallback("VertexAttrib1s");
   15953    CALL_VertexAttrib1s(ctx->CurrentServerDispatch, (index, x));
   15954 }
   15955 
   15956 
   15957 /* MultiDrawElementsIndirect: marshalled synchronously */
   15958 static void GLAPIENTRY
   15959 _mesa_marshal_MultiDrawElementsIndirect(GLenum mode, GLenum type, const GLvoid * indirect, GLsizei primcount, GLsizei stride)
   15960 {
   15961    GET_CURRENT_CONTEXT(ctx);
   15962    _mesa_glthread_finish(ctx);
   15963    debug_print_sync("MultiDrawElementsIndirect");
   15964    CALL_MultiDrawElementsIndirect(ctx->CurrentServerDispatch, (mode, type, indirect, primcount, stride));
   15965 }
   15966 
   15967 
   15968 /* UniformMatrix4x3dv: marshalled asynchronously */
   15969 struct marshal_cmd_UniformMatrix4x3dv
   15970 {
   15971    struct marshal_cmd_base cmd_base;
   15972    GLint location;
   15973    GLsizei count;
   15974    GLboolean transpose;
   15975    /* Next safe_mul(count, 96) bytes are GLdouble value[count][12] */
   15976 };
   15977 static inline void
   15978 _mesa_unmarshal_UniformMatrix4x3dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4x3dv *cmd)
   15979 {
   15980    const GLint location = cmd->location;
   15981    const GLsizei count = cmd->count;
   15982    const GLboolean transpose = cmd->transpose;
   15983    const GLdouble * value;
   15984    const char *variable_data = (const char *) (cmd + 1);
   15985    value = (const GLdouble *) variable_data;
   15986    variable_data += count * 96;
   15987    CALL_UniformMatrix4x3dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   15988 }
   15989 static void GLAPIENTRY
   15990 _mesa_marshal_UniformMatrix4x3dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   15991 {
   15992    GET_CURRENT_CONTEXT(ctx);
   15993    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix4x3dv) + safe_mul(count, 96);
   15994    struct marshal_cmd_UniformMatrix4x3dv *cmd;
   15995    debug_print_marshal("UniformMatrix4x3dv");
   15996    if (unlikely(safe_mul(count, 96) < 0)) {
   15997       goto fallback_to_sync;
   15998    }
   15999    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16000       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4x3dv, cmd_size);
   16001       cmd->location = location;
   16002       cmd->count = count;
   16003       cmd->transpose = transpose;
   16004       char *variable_data = (char *) (cmd + 1);
   16005       memcpy(variable_data, value, count * 96);
   16006       variable_data += count * 96;
   16007       _mesa_post_marshal_hook(ctx);
   16008       return;
   16009    }
   16010 
   16011 fallback_to_sync:
   16012    _mesa_glthread_finish(ctx);
   16013    debug_print_sync_fallback("UniformMatrix4x3dv");
   16014    CALL_UniformMatrix4x3dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   16015 }
   16016 
   16017 
   16018 /* TransformFeedbackBufferBase: marshalled asynchronously */
   16019 struct marshal_cmd_TransformFeedbackBufferBase
   16020 {
   16021    struct marshal_cmd_base cmd_base;
   16022    GLuint xfb;
   16023    GLuint index;
   16024    GLuint buffer;
   16025 };
   16026 static inline void
   16027 _mesa_unmarshal_TransformFeedbackBufferBase(struct gl_context *ctx, const struct marshal_cmd_TransformFeedbackBufferBase *cmd)
   16028 {
   16029    const GLuint xfb = cmd->xfb;
   16030    const GLuint index = cmd->index;
   16031    const GLuint buffer = cmd->buffer;
   16032    CALL_TransformFeedbackBufferBase(ctx->CurrentServerDispatch, (xfb, index, buffer));
   16033 }
   16034 static void GLAPIENTRY
   16035 _mesa_marshal_TransformFeedbackBufferBase(GLuint xfb, GLuint index, GLuint buffer)
   16036 {
   16037    GET_CURRENT_CONTEXT(ctx);
   16038    size_t cmd_size = sizeof(struct marshal_cmd_TransformFeedbackBufferBase);
   16039    struct marshal_cmd_TransformFeedbackBufferBase *cmd;
   16040    debug_print_marshal("TransformFeedbackBufferBase");
   16041    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16042       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TransformFeedbackBufferBase, cmd_size);
   16043       cmd->xfb = xfb;
   16044       cmd->index = index;
   16045       cmd->buffer = buffer;
   16046       _mesa_post_marshal_hook(ctx);
   16047       return;
   16048    }
   16049 
   16050    _mesa_glthread_finish(ctx);
   16051    debug_print_sync_fallback("TransformFeedbackBufferBase");
   16052    CALL_TransformFeedbackBufferBase(ctx->CurrentServerDispatch, (xfb, index, buffer));
   16053 }
   16054 
   16055 
   16056 /* FogCoordfvEXT: marshalled asynchronously */
   16057 struct marshal_cmd_FogCoordfvEXT
   16058 {
   16059    struct marshal_cmd_base cmd_base;
   16060    GLfloat coord[1];
   16061 };
   16062 static inline void
   16063 _mesa_unmarshal_FogCoordfvEXT(struct gl_context *ctx, const struct marshal_cmd_FogCoordfvEXT *cmd)
   16064 {
   16065    const GLfloat * coord = cmd->coord;
   16066    CALL_FogCoordfvEXT(ctx->CurrentServerDispatch, (coord));
   16067 }
   16068 static void GLAPIENTRY
   16069 _mesa_marshal_FogCoordfvEXT(const GLfloat * coord)
   16070 {
   16071    GET_CURRENT_CONTEXT(ctx);
   16072    size_t cmd_size = sizeof(struct marshal_cmd_FogCoordfvEXT);
   16073    struct marshal_cmd_FogCoordfvEXT *cmd;
   16074    debug_print_marshal("FogCoordfvEXT");
   16075    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16076       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FogCoordfvEXT, cmd_size);
   16077       memcpy(cmd->coord, coord, 4);
   16078       _mesa_post_marshal_hook(ctx);
   16079       return;
   16080    }
   16081 
   16082    _mesa_glthread_finish(ctx);
   16083    debug_print_sync_fallback("FogCoordfvEXT");
   16084    CALL_FogCoordfvEXT(ctx->CurrentServerDispatch, (coord));
   16085 }
   16086 
   16087 
   16088 /* Uniform2ui64vARB: marshalled asynchronously */
   16089 struct marshal_cmd_Uniform2ui64vARB
   16090 {
   16091    struct marshal_cmd_base cmd_base;
   16092    GLint location;
   16093    GLsizei count;
   16094    /* Next safe_mul(count, 16) bytes are GLuint64 value[count][2] */
   16095 };
   16096 static inline void
   16097 _mesa_unmarshal_Uniform2ui64vARB(struct gl_context *ctx, const struct marshal_cmd_Uniform2ui64vARB *cmd)
   16098 {
   16099    const GLint location = cmd->location;
   16100    const GLsizei count = cmd->count;
   16101    const GLuint64 * value;
   16102    const char *variable_data = (const char *) (cmd + 1);
   16103    value = (const GLuint64 *) variable_data;
   16104    variable_data += count * 16;
   16105    CALL_Uniform2ui64vARB(ctx->CurrentServerDispatch, (location, count, value));
   16106 }
   16107 static void GLAPIENTRY
   16108 _mesa_marshal_Uniform2ui64vARB(GLint location, GLsizei count, const GLuint64 * value)
   16109 {
   16110    GET_CURRENT_CONTEXT(ctx);
   16111    size_t cmd_size = sizeof(struct marshal_cmd_Uniform2ui64vARB) + safe_mul(count, 16);
   16112    struct marshal_cmd_Uniform2ui64vARB *cmd;
   16113    debug_print_marshal("Uniform2ui64vARB");
   16114    if (unlikely(safe_mul(count, 16) < 0)) {
   16115       goto fallback_to_sync;
   16116    }
   16117    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16118       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2ui64vARB, cmd_size);
   16119       cmd->location = location;
   16120       cmd->count = count;
   16121       char *variable_data = (char *) (cmd + 1);
   16122       memcpy(variable_data, value, count * 16);
   16123       variable_data += count * 16;
   16124       _mesa_post_marshal_hook(ctx);
   16125       return;
   16126    }
   16127 
   16128 fallback_to_sync:
   16129    _mesa_glthread_finish(ctx);
   16130    debug_print_sync_fallback("Uniform2ui64vARB");
   16131    CALL_Uniform2ui64vARB(ctx->CurrentServerDispatch, (location, count, value));
   16132 }
   16133 
   16134 
   16135 /* GetColorTableParameterfv: marshalled synchronously */
   16136 static void GLAPIENTRY
   16137 _mesa_marshal_GetColorTableParameterfv(GLenum target, GLenum pname, GLfloat * params)
   16138 {
   16139    GET_CURRENT_CONTEXT(ctx);
   16140    _mesa_glthread_finish(ctx);
   16141    debug_print_sync("GetColorTableParameterfv");
   16142    CALL_GetColorTableParameterfv(ctx->CurrentServerDispatch, (target, pname, params));
   16143 }
   16144 
   16145 
   16146 /* MultiTexCoord3fARB: marshalled asynchronously */
   16147 struct marshal_cmd_MultiTexCoord3fARB
   16148 {
   16149    struct marshal_cmd_base cmd_base;
   16150    GLenum target;
   16151    GLfloat s;
   16152    GLfloat t;
   16153    GLfloat r;
   16154 };
   16155 static inline void
   16156 _mesa_unmarshal_MultiTexCoord3fARB(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3fARB *cmd)
   16157 {
   16158    const GLenum target = cmd->target;
   16159    const GLfloat s = cmd->s;
   16160    const GLfloat t = cmd->t;
   16161    const GLfloat r = cmd->r;
   16162    CALL_MultiTexCoord3fARB(ctx->CurrentServerDispatch, (target, s, t, r));
   16163 }
   16164 static void GLAPIENTRY
   16165 _mesa_marshal_MultiTexCoord3fARB(GLenum target, GLfloat s, GLfloat t, GLfloat r)
   16166 {
   16167    GET_CURRENT_CONTEXT(ctx);
   16168    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3fARB);
   16169    struct marshal_cmd_MultiTexCoord3fARB *cmd;
   16170    debug_print_marshal("MultiTexCoord3fARB");
   16171    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16172       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3fARB, cmd_size);
   16173       cmd->target = target;
   16174       cmd->s = s;
   16175       cmd->t = t;
   16176       cmd->r = r;
   16177       _mesa_post_marshal_hook(ctx);
   16178       return;
   16179    }
   16180 
   16181    _mesa_glthread_finish(ctx);
   16182    debug_print_sync_fallback("MultiTexCoord3fARB");
   16183    CALL_MultiTexCoord3fARB(ctx->CurrentServerDispatch, (target, s, t, r));
   16184 }
   16185 
   16186 
   16187 /* GetTexLevelParameterfv: marshalled synchronously */
   16188 static void GLAPIENTRY
   16189 _mesa_marshal_GetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat * params)
   16190 {
   16191    GET_CURRENT_CONTEXT(ctx);
   16192    _mesa_glthread_finish(ctx);
   16193    debug_print_sync("GetTexLevelParameterfv");
   16194    CALL_GetTexLevelParameterfv(ctx->CurrentServerDispatch, (target, level, pname, params));
   16195 }
   16196 
   16197 
   16198 /* Vertex2sv: marshalled asynchronously */
   16199 struct marshal_cmd_Vertex2sv
   16200 {
   16201    struct marshal_cmd_base cmd_base;
   16202    GLshort v[2];
   16203 };
   16204 static inline void
   16205 _mesa_unmarshal_Vertex2sv(struct gl_context *ctx, const struct marshal_cmd_Vertex2sv *cmd)
   16206 {
   16207    const GLshort * v = cmd->v;
   16208    CALL_Vertex2sv(ctx->CurrentServerDispatch, (v));
   16209 }
   16210 static void GLAPIENTRY
   16211 _mesa_marshal_Vertex2sv(const GLshort * v)
   16212 {
   16213    GET_CURRENT_CONTEXT(ctx);
   16214    size_t cmd_size = sizeof(struct marshal_cmd_Vertex2sv);
   16215    struct marshal_cmd_Vertex2sv *cmd;
   16216    debug_print_marshal("Vertex2sv");
   16217    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16218       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex2sv, cmd_size);
   16219       memcpy(cmd->v, v, 4);
   16220       _mesa_post_marshal_hook(ctx);
   16221       return;
   16222    }
   16223 
   16224    _mesa_glthread_finish(ctx);
   16225    debug_print_sync_fallback("Vertex2sv");
   16226    CALL_Vertex2sv(ctx->CurrentServerDispatch, (v));
   16227 }
   16228 
   16229 
   16230 /* GetnMapdvARB: marshalled synchronously */
   16231 static void GLAPIENTRY
   16232 _mesa_marshal_GetnMapdvARB(GLenum target, GLenum query, GLsizei bufSize, GLdouble * v)
   16233 {
   16234    GET_CURRENT_CONTEXT(ctx);
   16235    _mesa_glthread_finish(ctx);
   16236    debug_print_sync("GetnMapdvARB");
   16237    CALL_GetnMapdvARB(ctx->CurrentServerDispatch, (target, query, bufSize, v));
   16238 }
   16239 
   16240 
   16241 /* VertexAttrib2dNV: marshalled asynchronously */
   16242 struct marshal_cmd_VertexAttrib2dNV
   16243 {
   16244    struct marshal_cmd_base cmd_base;
   16245    GLuint index;
   16246    GLdouble x;
   16247    GLdouble y;
   16248 };
   16249 static inline void
   16250 _mesa_unmarshal_VertexAttrib2dNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2dNV *cmd)
   16251 {
   16252    const GLuint index = cmd->index;
   16253    const GLdouble x = cmd->x;
   16254    const GLdouble y = cmd->y;
   16255    CALL_VertexAttrib2dNV(ctx->CurrentServerDispatch, (index, x, y));
   16256 }
   16257 static void GLAPIENTRY
   16258 _mesa_marshal_VertexAttrib2dNV(GLuint index, GLdouble x, GLdouble y)
   16259 {
   16260    GET_CURRENT_CONTEXT(ctx);
   16261    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib2dNV);
   16262    struct marshal_cmd_VertexAttrib2dNV *cmd;
   16263    debug_print_marshal("VertexAttrib2dNV");
   16264    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16265       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2dNV, cmd_size);
   16266       cmd->index = index;
   16267       cmd->x = x;
   16268       cmd->y = y;
   16269       _mesa_post_marshal_hook(ctx);
   16270       return;
   16271    }
   16272 
   16273    _mesa_glthread_finish(ctx);
   16274    debug_print_sync_fallback("VertexAttrib2dNV");
   16275    CALL_VertexAttrib2dNV(ctx->CurrentServerDispatch, (index, x, y));
   16276 }
   16277 
   16278 
   16279 /* VertexAttrib3svNV: marshalled asynchronously */
   16280 struct marshal_cmd_VertexAttrib3svNV
   16281 {
   16282    struct marshal_cmd_base cmd_base;
   16283    GLuint index;
   16284    GLshort v[3];
   16285 };
   16286 static inline void
   16287 _mesa_unmarshal_VertexAttrib3svNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3svNV *cmd)
   16288 {
   16289    const GLuint index = cmd->index;
   16290    const GLshort * v = cmd->v;
   16291    CALL_VertexAttrib3svNV(ctx->CurrentServerDispatch, (index, v));
   16292 }
   16293 static void GLAPIENTRY
   16294 _mesa_marshal_VertexAttrib3svNV(GLuint index, const GLshort * v)
   16295 {
   16296    GET_CURRENT_CONTEXT(ctx);
   16297    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib3svNV);
   16298    struct marshal_cmd_VertexAttrib3svNV *cmd;
   16299    debug_print_marshal("VertexAttrib3svNV");
   16300    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16301       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3svNV, cmd_size);
   16302       cmd->index = index;
   16303       memcpy(cmd->v, v, 6);
   16304       _mesa_post_marshal_hook(ctx);
   16305       return;
   16306    }
   16307 
   16308    _mesa_glthread_finish(ctx);
   16309    debug_print_sync_fallback("VertexAttrib3svNV");
   16310    CALL_VertexAttrib3svNV(ctx->CurrentServerDispatch, (index, v));
   16311 }
   16312 
   16313 
   16314 /* GetTexEnviv: marshalled synchronously */
   16315 static void GLAPIENTRY
   16316 _mesa_marshal_GetTexEnviv(GLenum target, GLenum pname, GLint * params)
   16317 {
   16318    GET_CURRENT_CONTEXT(ctx);
   16319    _mesa_glthread_finish(ctx);
   16320    debug_print_sync("GetTexEnviv");
   16321    CALL_GetTexEnviv(ctx->CurrentServerDispatch, (target, pname, params));
   16322 }
   16323 
   16324 
   16325 /* ViewportArrayv: marshalled asynchronously */
   16326 struct marshal_cmd_ViewportArrayv
   16327 {
   16328    struct marshal_cmd_base cmd_base;
   16329    GLuint first;
   16330    GLsizei count;
   16331    /* Next safe_mul(count, 16) bytes are GLfloat v[count][4] */
   16332 };
   16333 static inline void
   16334 _mesa_unmarshal_ViewportArrayv(struct gl_context *ctx, const struct marshal_cmd_ViewportArrayv *cmd)
   16335 {
   16336    const GLuint first = cmd->first;
   16337    const GLsizei count = cmd->count;
   16338    const GLfloat * v;
   16339    const char *variable_data = (const char *) (cmd + 1);
   16340    v = (const GLfloat *) variable_data;
   16341    variable_data += count * 16;
   16342    CALL_ViewportArrayv(ctx->CurrentServerDispatch, (first, count, v));
   16343 }
   16344 static void GLAPIENTRY
   16345 _mesa_marshal_ViewportArrayv(GLuint first, GLsizei count, const GLfloat * v)
   16346 {
   16347    GET_CURRENT_CONTEXT(ctx);
   16348    size_t cmd_size = sizeof(struct marshal_cmd_ViewportArrayv) + safe_mul(count, 16);
   16349    struct marshal_cmd_ViewportArrayv *cmd;
   16350    debug_print_marshal("ViewportArrayv");
   16351    if (unlikely(safe_mul(count, 16) < 0)) {
   16352       goto fallback_to_sync;
   16353    }
   16354    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16355       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ViewportArrayv, cmd_size);
   16356       cmd->first = first;
   16357       cmd->count = count;
   16358       char *variable_data = (char *) (cmd + 1);
   16359       memcpy(variable_data, v, count * 16);
   16360       variable_data += count * 16;
   16361       _mesa_post_marshal_hook(ctx);
   16362       return;
   16363    }
   16364 
   16365 fallback_to_sync:
   16366    _mesa_glthread_finish(ctx);
   16367    debug_print_sync_fallback("ViewportArrayv");
   16368    CALL_ViewportArrayv(ctx->CurrentServerDispatch, (first, count, v));
   16369 }
   16370 
   16371 
   16372 /* SeparableFilter2D: marshalled synchronously */
   16373 static void GLAPIENTRY
   16374 _mesa_marshal_SeparableFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * row, const GLvoid * column)
   16375 {
   16376    GET_CURRENT_CONTEXT(ctx);
   16377    _mesa_glthread_finish(ctx);
   16378    debug_print_sync("SeparableFilter2D");
   16379    CALL_SeparableFilter2D(ctx->CurrentServerDispatch, (target, internalformat, width, height, format, type, row, column));
   16380 }
   16381 
   16382 
   16383 /* ArrayElement: marshalled asynchronously */
   16384 struct marshal_cmd_ArrayElement
   16385 {
   16386    struct marshal_cmd_base cmd_base;
   16387    GLint i;
   16388 };
   16389 static inline void
   16390 _mesa_unmarshal_ArrayElement(struct gl_context *ctx, const struct marshal_cmd_ArrayElement *cmd)
   16391 {
   16392    const GLint i = cmd->i;
   16393    CALL_ArrayElement(ctx->CurrentServerDispatch, (i));
   16394 }
   16395 static void GLAPIENTRY
   16396 _mesa_marshal_ArrayElement(GLint i)
   16397 {
   16398    GET_CURRENT_CONTEXT(ctx);
   16399    size_t cmd_size = sizeof(struct marshal_cmd_ArrayElement);
   16400    struct marshal_cmd_ArrayElement *cmd;
   16401    debug_print_marshal("ArrayElement");
   16402    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16403       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ArrayElement, cmd_size);
   16404       cmd->i = i;
   16405       _mesa_post_marshal_hook(ctx);
   16406       return;
   16407    }
   16408 
   16409    _mesa_glthread_finish(ctx);
   16410    debug_print_sync_fallback("ArrayElement");
   16411    CALL_ArrayElement(ctx->CurrentServerDispatch, (i));
   16412 }
   16413 
   16414 
   16415 /* TexImage2D: marshalled synchronously */
   16416 static void GLAPIENTRY
   16417 _mesa_marshal_TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
   16418 {
   16419    GET_CURRENT_CONTEXT(ctx);
   16420    _mesa_glthread_finish(ctx);
   16421    debug_print_sync("TexImage2D");
   16422    CALL_TexImage2D(ctx->CurrentServerDispatch, (target, level, internalformat, width, height, border, format, type, pixels));
   16423 }
   16424 
   16425 
   16426 /* RasterPos2dv: marshalled asynchronously */
   16427 struct marshal_cmd_RasterPos2dv
   16428 {
   16429    struct marshal_cmd_base cmd_base;
   16430    GLdouble v[2];
   16431 };
   16432 static inline void
   16433 _mesa_unmarshal_RasterPos2dv(struct gl_context *ctx, const struct marshal_cmd_RasterPos2dv *cmd)
   16434 {
   16435    const GLdouble * v = cmd->v;
   16436    CALL_RasterPos2dv(ctx->CurrentServerDispatch, (v));
   16437 }
   16438 static void GLAPIENTRY
   16439 _mesa_marshal_RasterPos2dv(const GLdouble * v)
   16440 {
   16441    GET_CURRENT_CONTEXT(ctx);
   16442    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos2dv);
   16443    struct marshal_cmd_RasterPos2dv *cmd;
   16444    debug_print_marshal("RasterPos2dv");
   16445    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16446       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos2dv, cmd_size);
   16447       memcpy(cmd->v, v, 16);
   16448       _mesa_post_marshal_hook(ctx);
   16449       return;
   16450    }
   16451 
   16452    _mesa_glthread_finish(ctx);
   16453    debug_print_sync_fallback("RasterPos2dv");
   16454    CALL_RasterPos2dv(ctx->CurrentServerDispatch, (v));
   16455 }
   16456 
   16457 
   16458 /* Fogiv: marshalled synchronously */
   16459 static void GLAPIENTRY
   16460 _mesa_marshal_Fogiv(GLenum pname, const GLint * params)
   16461 {
   16462    GET_CURRENT_CONTEXT(ctx);
   16463    _mesa_glthread_finish(ctx);
   16464    debug_print_sync("Fogiv");
   16465    CALL_Fogiv(ctx->CurrentServerDispatch, (pname, params));
   16466 }
   16467 
   16468 
   16469 /* EndQuery: marshalled asynchronously */
   16470 struct marshal_cmd_EndQuery
   16471 {
   16472    struct marshal_cmd_base cmd_base;
   16473    GLenum target;
   16474 };
   16475 static inline void
   16476 _mesa_unmarshal_EndQuery(struct gl_context *ctx, const struct marshal_cmd_EndQuery *cmd)
   16477 {
   16478    const GLenum target = cmd->target;
   16479    CALL_EndQuery(ctx->CurrentServerDispatch, (target));
   16480 }
   16481 static void GLAPIENTRY
   16482 _mesa_marshal_EndQuery(GLenum target)
   16483 {
   16484    GET_CURRENT_CONTEXT(ctx);
   16485    size_t cmd_size = sizeof(struct marshal_cmd_EndQuery);
   16486    struct marshal_cmd_EndQuery *cmd;
   16487    debug_print_marshal("EndQuery");
   16488    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16489       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EndQuery, cmd_size);
   16490       cmd->target = target;
   16491       _mesa_post_marshal_hook(ctx);
   16492       return;
   16493    }
   16494 
   16495    _mesa_glthread_finish(ctx);
   16496    debug_print_sync_fallback("EndQuery");
   16497    CALL_EndQuery(ctx->CurrentServerDispatch, (target));
   16498 }
   16499 
   16500 
   16501 /* TexCoord1dv: marshalled asynchronously */
   16502 struct marshal_cmd_TexCoord1dv
   16503 {
   16504    struct marshal_cmd_base cmd_base;
   16505    GLdouble v[1];
   16506 };
   16507 static inline void
   16508 _mesa_unmarshal_TexCoord1dv(struct gl_context *ctx, const struct marshal_cmd_TexCoord1dv *cmd)
   16509 {
   16510    const GLdouble * v = cmd->v;
   16511    CALL_TexCoord1dv(ctx->CurrentServerDispatch, (v));
   16512 }
   16513 static void GLAPIENTRY
   16514 _mesa_marshal_TexCoord1dv(const GLdouble * v)
   16515 {
   16516    GET_CURRENT_CONTEXT(ctx);
   16517    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord1dv);
   16518    struct marshal_cmd_TexCoord1dv *cmd;
   16519    debug_print_marshal("TexCoord1dv");
   16520    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16521       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord1dv, cmd_size);
   16522       memcpy(cmd->v, v, 8);
   16523       _mesa_post_marshal_hook(ctx);
   16524       return;
   16525    }
   16526 
   16527    _mesa_glthread_finish(ctx);
   16528    debug_print_sync_fallback("TexCoord1dv");
   16529    CALL_TexCoord1dv(ctx->CurrentServerDispatch, (v));
   16530 }
   16531 
   16532 
   16533 /* AlphaFragmentOp3ATI: marshalled asynchronously */
   16534 struct marshal_cmd_AlphaFragmentOp3ATI
   16535 {
   16536    struct marshal_cmd_base cmd_base;
   16537    GLenum op;
   16538    GLuint dst;
   16539    GLuint dstMod;
   16540    GLuint arg1;
   16541    GLuint arg1Rep;
   16542    GLuint arg1Mod;
   16543    GLuint arg2;
   16544    GLuint arg2Rep;
   16545    GLuint arg2Mod;
   16546    GLuint arg3;
   16547    GLuint arg3Rep;
   16548    GLuint arg3Mod;
   16549 };
   16550 static inline void
   16551 _mesa_unmarshal_AlphaFragmentOp3ATI(struct gl_context *ctx, const struct marshal_cmd_AlphaFragmentOp3ATI *cmd)
   16552 {
   16553    const GLenum op = cmd->op;
   16554    const GLuint dst = cmd->dst;
   16555    const GLuint dstMod = cmd->dstMod;
   16556    const GLuint arg1 = cmd->arg1;
   16557    const GLuint arg1Rep = cmd->arg1Rep;
   16558    const GLuint arg1Mod = cmd->arg1Mod;
   16559    const GLuint arg2 = cmd->arg2;
   16560    const GLuint arg2Rep = cmd->arg2Rep;
   16561    const GLuint arg2Mod = cmd->arg2Mod;
   16562    const GLuint arg3 = cmd->arg3;
   16563    const GLuint arg3Rep = cmd->arg3Rep;
   16564    const GLuint arg3Mod = cmd->arg3Mod;
   16565    CALL_AlphaFragmentOp3ATI(ctx->CurrentServerDispatch, (op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod));
   16566 }
   16567 static void GLAPIENTRY
   16568 _mesa_marshal_AlphaFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)
   16569 {
   16570    GET_CURRENT_CONTEXT(ctx);
   16571    size_t cmd_size = sizeof(struct marshal_cmd_AlphaFragmentOp3ATI);
   16572    struct marshal_cmd_AlphaFragmentOp3ATI *cmd;
   16573    debug_print_marshal("AlphaFragmentOp3ATI");
   16574    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16575       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_AlphaFragmentOp3ATI, cmd_size);
   16576       cmd->op = op;
   16577       cmd->dst = dst;
   16578       cmd->dstMod = dstMod;
   16579       cmd->arg1 = arg1;
   16580       cmd->arg1Rep = arg1Rep;
   16581       cmd->arg1Mod = arg1Mod;
   16582       cmd->arg2 = arg2;
   16583       cmd->arg2Rep = arg2Rep;
   16584       cmd->arg2Mod = arg2Mod;
   16585       cmd->arg3 = arg3;
   16586       cmd->arg3Rep = arg3Rep;
   16587       cmd->arg3Mod = arg3Mod;
   16588       _mesa_post_marshal_hook(ctx);
   16589       return;
   16590    }
   16591 
   16592    _mesa_glthread_finish(ctx);
   16593    debug_print_sync_fallback("AlphaFragmentOp3ATI");
   16594    CALL_AlphaFragmentOp3ATI(ctx->CurrentServerDispatch, (op, dst, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod));
   16595 }
   16596 
   16597 
   16598 /* Clear: marshalled asynchronously */
   16599 struct marshal_cmd_Clear
   16600 {
   16601    struct marshal_cmd_base cmd_base;
   16602    GLbitfield mask;
   16603 };
   16604 static inline void
   16605 _mesa_unmarshal_Clear(struct gl_context *ctx, const struct marshal_cmd_Clear *cmd)
   16606 {
   16607    const GLbitfield mask = cmd->mask;
   16608    CALL_Clear(ctx->CurrentServerDispatch, (mask));
   16609 }
   16610 static void GLAPIENTRY
   16611 _mesa_marshal_Clear(GLbitfield mask)
   16612 {
   16613    GET_CURRENT_CONTEXT(ctx);
   16614    size_t cmd_size = sizeof(struct marshal_cmd_Clear);
   16615    struct marshal_cmd_Clear *cmd;
   16616    debug_print_marshal("Clear");
   16617    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16618       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Clear, cmd_size);
   16619       cmd->mask = mask;
   16620       _mesa_post_marshal_hook(ctx);
   16621       return;
   16622    }
   16623 
   16624    _mesa_glthread_finish(ctx);
   16625    debug_print_sync_fallback("Clear");
   16626    CALL_Clear(ctx->CurrentServerDispatch, (mask));
   16627 }
   16628 
   16629 
   16630 /* VertexAttrib4sv: marshalled asynchronously */
   16631 struct marshal_cmd_VertexAttrib4sv
   16632 {
   16633    struct marshal_cmd_base cmd_base;
   16634    GLuint index;
   16635    GLshort v[4];
   16636 };
   16637 static inline void
   16638 _mesa_unmarshal_VertexAttrib4sv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4sv *cmd)
   16639 {
   16640    const GLuint index = cmd->index;
   16641    const GLshort * v = cmd->v;
   16642    CALL_VertexAttrib4sv(ctx->CurrentServerDispatch, (index, v));
   16643 }
   16644 static void GLAPIENTRY
   16645 _mesa_marshal_VertexAttrib4sv(GLuint index, const GLshort * v)
   16646 {
   16647    GET_CURRENT_CONTEXT(ctx);
   16648    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4sv);
   16649    struct marshal_cmd_VertexAttrib4sv *cmd;
   16650    debug_print_marshal("VertexAttrib4sv");
   16651    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16652       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4sv, cmd_size);
   16653       cmd->index = index;
   16654       memcpy(cmd->v, v, 8);
   16655       _mesa_post_marshal_hook(ctx);
   16656       return;
   16657    }
   16658 
   16659    _mesa_glthread_finish(ctx);
   16660    debug_print_sync_fallback("VertexAttrib4sv");
   16661    CALL_VertexAttrib4sv(ctx->CurrentServerDispatch, (index, v));
   16662 }
   16663 
   16664 
   16665 /* Ortho: marshalled asynchronously */
   16666 struct marshal_cmd_Ortho
   16667 {
   16668    struct marshal_cmd_base cmd_base;
   16669    GLdouble left;
   16670    GLdouble right;
   16671    GLdouble bottom;
   16672    GLdouble top;
   16673    GLdouble zNear;
   16674    GLdouble zFar;
   16675 };
   16676 static inline void
   16677 _mesa_unmarshal_Ortho(struct gl_context *ctx, const struct marshal_cmd_Ortho *cmd)
   16678 {
   16679    const GLdouble left = cmd->left;
   16680    const GLdouble right = cmd->right;
   16681    const GLdouble bottom = cmd->bottom;
   16682    const GLdouble top = cmd->top;
   16683    const GLdouble zNear = cmd->zNear;
   16684    const GLdouble zFar = cmd->zFar;
   16685    CALL_Ortho(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar));
   16686 }
   16687 static void GLAPIENTRY
   16688 _mesa_marshal_Ortho(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
   16689 {
   16690    GET_CURRENT_CONTEXT(ctx);
   16691    size_t cmd_size = sizeof(struct marshal_cmd_Ortho);
   16692    struct marshal_cmd_Ortho *cmd;
   16693    debug_print_marshal("Ortho");
   16694    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16695       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Ortho, cmd_size);
   16696       cmd->left = left;
   16697       cmd->right = right;
   16698       cmd->bottom = bottom;
   16699       cmd->top = top;
   16700       cmd->zNear = zNear;
   16701       cmd->zFar = zFar;
   16702       _mesa_post_marshal_hook(ctx);
   16703       return;
   16704    }
   16705 
   16706    _mesa_glthread_finish(ctx);
   16707    debug_print_sync_fallback("Ortho");
   16708    CALL_Ortho(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar));
   16709 }
   16710 
   16711 
   16712 /* Uniform3uiv: marshalled asynchronously */
   16713 struct marshal_cmd_Uniform3uiv
   16714 {
   16715    struct marshal_cmd_base cmd_base;
   16716    GLint location;
   16717    GLsizei count;
   16718    /* Next safe_mul(count, 12) bytes are GLuint value[count][3] */
   16719 };
   16720 static inline void
   16721 _mesa_unmarshal_Uniform3uiv(struct gl_context *ctx, const struct marshal_cmd_Uniform3uiv *cmd)
   16722 {
   16723    const GLint location = cmd->location;
   16724    const GLsizei count = cmd->count;
   16725    const GLuint * value;
   16726    const char *variable_data = (const char *) (cmd + 1);
   16727    value = (const GLuint *) variable_data;
   16728    variable_data += count * 12;
   16729    CALL_Uniform3uiv(ctx->CurrentServerDispatch, (location, count, value));
   16730 }
   16731 static void GLAPIENTRY
   16732 _mesa_marshal_Uniform3uiv(GLint location, GLsizei count, const GLuint * value)
   16733 {
   16734    GET_CURRENT_CONTEXT(ctx);
   16735    size_t cmd_size = sizeof(struct marshal_cmd_Uniform3uiv) + safe_mul(count, 12);
   16736    struct marshal_cmd_Uniform3uiv *cmd;
   16737    debug_print_marshal("Uniform3uiv");
   16738    if (unlikely(safe_mul(count, 12) < 0)) {
   16739       goto fallback_to_sync;
   16740    }
   16741    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16742       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3uiv, cmd_size);
   16743       cmd->location = location;
   16744       cmd->count = count;
   16745       char *variable_data = (char *) (cmd + 1);
   16746       memcpy(variable_data, value, count * 12);
   16747       variable_data += count * 12;
   16748       _mesa_post_marshal_hook(ctx);
   16749       return;
   16750    }
   16751 
   16752 fallback_to_sync:
   16753    _mesa_glthread_finish(ctx);
   16754    debug_print_sync_fallback("Uniform3uiv");
   16755    CALL_Uniform3uiv(ctx->CurrentServerDispatch, (location, count, value));
   16756 }
   16757 
   16758 
   16759 /* GetUniformi64vARB: marshalled synchronously */
   16760 static void GLAPIENTRY
   16761 _mesa_marshal_GetUniformi64vARB(GLuint program, GLint location, GLint64 * params)
   16762 {
   16763    GET_CURRENT_CONTEXT(ctx);
   16764    _mesa_glthread_finish(ctx);
   16765    debug_print_sync("GetUniformi64vARB");
   16766    CALL_GetUniformi64vARB(ctx->CurrentServerDispatch, (program, location, params));
   16767 }
   16768 
   16769 
   16770 /* EndQueryIndexed: marshalled asynchronously */
   16771 struct marshal_cmd_EndQueryIndexed
   16772 {
   16773    struct marshal_cmd_base cmd_base;
   16774    GLenum target;
   16775    GLuint index;
   16776 };
   16777 static inline void
   16778 _mesa_unmarshal_EndQueryIndexed(struct gl_context *ctx, const struct marshal_cmd_EndQueryIndexed *cmd)
   16779 {
   16780    const GLenum target = cmd->target;
   16781    const GLuint index = cmd->index;
   16782    CALL_EndQueryIndexed(ctx->CurrentServerDispatch, (target, index));
   16783 }
   16784 static void GLAPIENTRY
   16785 _mesa_marshal_EndQueryIndexed(GLenum target, GLuint index)
   16786 {
   16787    GET_CURRENT_CONTEXT(ctx);
   16788    size_t cmd_size = sizeof(struct marshal_cmd_EndQueryIndexed);
   16789    struct marshal_cmd_EndQueryIndexed *cmd;
   16790    debug_print_marshal("EndQueryIndexed");
   16791    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16792       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EndQueryIndexed, cmd_size);
   16793       cmd->target = target;
   16794       cmd->index = index;
   16795       _mesa_post_marshal_hook(ctx);
   16796       return;
   16797    }
   16798 
   16799    _mesa_glthread_finish(ctx);
   16800    debug_print_sync_fallback("EndQueryIndexed");
   16801    CALL_EndQueryIndexed(ctx->CurrentServerDispatch, (target, index));
   16802 }
   16803 
   16804 
   16805 /* TexParameterxv: marshalled synchronously */
   16806 static void GLAPIENTRY
   16807 _mesa_marshal_TexParameterxv(GLenum target, GLenum pname, const GLfixed * params)
   16808 {
   16809    GET_CURRENT_CONTEXT(ctx);
   16810    _mesa_glthread_finish(ctx);
   16811    debug_print_sync("TexParameterxv");
   16812    CALL_TexParameterxv(ctx->CurrentServerDispatch, (target, pname, params));
   16813 }
   16814 
   16815 
   16816 /* MultiDrawArraysIndirectCountARB: marshalled asynchronously */
   16817 struct marshal_cmd_MultiDrawArraysIndirectCountARB
   16818 {
   16819    struct marshal_cmd_base cmd_base;
   16820    GLenum mode;
   16821    GLintptr indirect;
   16822    GLintptr drawcount;
   16823    GLsizei maxdrawcount;
   16824    GLsizei stride;
   16825 };
   16826 static inline void
   16827 _mesa_unmarshal_MultiDrawArraysIndirectCountARB(struct gl_context *ctx, const struct marshal_cmd_MultiDrawArraysIndirectCountARB *cmd)
   16828 {
   16829    const GLenum mode = cmd->mode;
   16830    const GLintptr indirect = cmd->indirect;
   16831    const GLintptr drawcount = cmd->drawcount;
   16832    const GLsizei maxdrawcount = cmd->maxdrawcount;
   16833    const GLsizei stride = cmd->stride;
   16834    CALL_MultiDrawArraysIndirectCountARB(ctx->CurrentServerDispatch, (mode, indirect, drawcount, maxdrawcount, stride));
   16835 }
   16836 static void GLAPIENTRY
   16837 _mesa_marshal_MultiDrawArraysIndirectCountARB(GLenum mode, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride)
   16838 {
   16839    GET_CURRENT_CONTEXT(ctx);
   16840    size_t cmd_size = sizeof(struct marshal_cmd_MultiDrawArraysIndirectCountARB);
   16841    struct marshal_cmd_MultiDrawArraysIndirectCountARB *cmd;
   16842    debug_print_marshal("MultiDrawArraysIndirectCountARB");
   16843    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16844       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiDrawArraysIndirectCountARB, cmd_size);
   16845       cmd->mode = mode;
   16846       cmd->indirect = indirect;
   16847       cmd->drawcount = drawcount;
   16848       cmd->maxdrawcount = maxdrawcount;
   16849       cmd->stride = stride;
   16850       _mesa_post_marshal_hook(ctx);
   16851       return;
   16852    }
   16853 
   16854    _mesa_glthread_finish(ctx);
   16855    debug_print_sync_fallback("MultiDrawArraysIndirectCountARB");
   16856    CALL_MultiDrawArraysIndirectCountARB(ctx->CurrentServerDispatch, (mode, indirect, drawcount, maxdrawcount, stride));
   16857 }
   16858 
   16859 
   16860 /* ProgramUniformMatrix2fv: marshalled asynchronously */
   16861 struct marshal_cmd_ProgramUniformMatrix2fv
   16862 {
   16863    struct marshal_cmd_base cmd_base;
   16864    GLuint program;
   16865    GLint location;
   16866    GLsizei count;
   16867    GLboolean transpose;
   16868    /* Next safe_mul(count, 16) bytes are GLfloat value[count][4] */
   16869 };
   16870 static inline void
   16871 _mesa_unmarshal_ProgramUniformMatrix2fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix2fv *cmd)
   16872 {
   16873    const GLuint program = cmd->program;
   16874    const GLint location = cmd->location;
   16875    const GLsizei count = cmd->count;
   16876    const GLboolean transpose = cmd->transpose;
   16877    const GLfloat * value;
   16878    const char *variable_data = (const char *) (cmd + 1);
   16879    value = (const GLfloat *) variable_data;
   16880    variable_data += count * 16;
   16881    CALL_ProgramUniformMatrix2fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   16882 }
   16883 static void GLAPIENTRY
   16884 _mesa_marshal_ProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   16885 {
   16886    GET_CURRENT_CONTEXT(ctx);
   16887    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix2fv) + safe_mul(count, 16);
   16888    struct marshal_cmd_ProgramUniformMatrix2fv *cmd;
   16889    debug_print_marshal("ProgramUniformMatrix2fv");
   16890    if (unlikely(safe_mul(count, 16) < 0)) {
   16891       goto fallback_to_sync;
   16892    }
   16893    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16894       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix2fv, cmd_size);
   16895       cmd->program = program;
   16896       cmd->location = location;
   16897       cmd->count = count;
   16898       cmd->transpose = transpose;
   16899       char *variable_data = (char *) (cmd + 1);
   16900       memcpy(variable_data, value, count * 16);
   16901       variable_data += count * 16;
   16902       _mesa_post_marshal_hook(ctx);
   16903       return;
   16904    }
   16905 
   16906 fallback_to_sync:
   16907    _mesa_glthread_finish(ctx);
   16908    debug_print_sync_fallback("ProgramUniformMatrix2fv");
   16909    CALL_ProgramUniformMatrix2fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   16910 }
   16911 
   16912 
   16913 /* ProgramLocalParameter4fvARB: marshalled asynchronously */
   16914 struct marshal_cmd_ProgramLocalParameter4fvARB
   16915 {
   16916    struct marshal_cmd_base cmd_base;
   16917    GLenum target;
   16918    GLuint index;
   16919    GLfloat params[4];
   16920 };
   16921 static inline void
   16922 _mesa_unmarshal_ProgramLocalParameter4fvARB(struct gl_context *ctx, const struct marshal_cmd_ProgramLocalParameter4fvARB *cmd)
   16923 {
   16924    const GLenum target = cmd->target;
   16925    const GLuint index = cmd->index;
   16926    const GLfloat * params = cmd->params;
   16927    CALL_ProgramLocalParameter4fvARB(ctx->CurrentServerDispatch, (target, index, params));
   16928 }
   16929 static void GLAPIENTRY
   16930 _mesa_marshal_ProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat * params)
   16931 {
   16932    GET_CURRENT_CONTEXT(ctx);
   16933    size_t cmd_size = sizeof(struct marshal_cmd_ProgramLocalParameter4fvARB);
   16934    struct marshal_cmd_ProgramLocalParameter4fvARB *cmd;
   16935    debug_print_marshal("ProgramLocalParameter4fvARB");
   16936    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16937       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramLocalParameter4fvARB, cmd_size);
   16938       cmd->target = target;
   16939       cmd->index = index;
   16940       memcpy(cmd->params, params, 16);
   16941       _mesa_post_marshal_hook(ctx);
   16942       return;
   16943    }
   16944 
   16945    _mesa_glthread_finish(ctx);
   16946    debug_print_sync_fallback("ProgramLocalParameter4fvARB");
   16947    CALL_ProgramLocalParameter4fvARB(ctx->CurrentServerDispatch, (target, index, params));
   16948 }
   16949 
   16950 
   16951 /* Uniform4dv: marshalled asynchronously */
   16952 struct marshal_cmd_Uniform4dv
   16953 {
   16954    struct marshal_cmd_base cmd_base;
   16955    GLint location;
   16956    GLsizei count;
   16957    /* Next safe_mul(count, 32) bytes are GLdouble value[count][4] */
   16958 };
   16959 static inline void
   16960 _mesa_unmarshal_Uniform4dv(struct gl_context *ctx, const struct marshal_cmd_Uniform4dv *cmd)
   16961 {
   16962    const GLint location = cmd->location;
   16963    const GLsizei count = cmd->count;
   16964    const GLdouble * value;
   16965    const char *variable_data = (const char *) (cmd + 1);
   16966    value = (const GLdouble *) variable_data;
   16967    variable_data += count * 32;
   16968    CALL_Uniform4dv(ctx->CurrentServerDispatch, (location, count, value));
   16969 }
   16970 static void GLAPIENTRY
   16971 _mesa_marshal_Uniform4dv(GLint location, GLsizei count, const GLdouble * value)
   16972 {
   16973    GET_CURRENT_CONTEXT(ctx);
   16974    size_t cmd_size = sizeof(struct marshal_cmd_Uniform4dv) + safe_mul(count, 32);
   16975    struct marshal_cmd_Uniform4dv *cmd;
   16976    debug_print_marshal("Uniform4dv");
   16977    if (unlikely(safe_mul(count, 32) < 0)) {
   16978       goto fallback_to_sync;
   16979    }
   16980    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   16981       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4dv, cmd_size);
   16982       cmd->location = location;
   16983       cmd->count = count;
   16984       char *variable_data = (char *) (cmd + 1);
   16985       memcpy(variable_data, value, count * 32);
   16986       variable_data += count * 32;
   16987       _mesa_post_marshal_hook(ctx);
   16988       return;
   16989    }
   16990 
   16991 fallback_to_sync:
   16992    _mesa_glthread_finish(ctx);
   16993    debug_print_sync_fallback("Uniform4dv");
   16994    CALL_Uniform4dv(ctx->CurrentServerDispatch, (location, count, value));
   16995 }
   16996 
   16997 
   16998 /* GetUnsignedBytevEXT: marshalled synchronously */
   16999 static void GLAPIENTRY
   17000 _mesa_marshal_GetUnsignedBytevEXT(GLenum pname, GLubyte * data)
   17001 {
   17002    GET_CURRENT_CONTEXT(ctx);
   17003    _mesa_glthread_finish(ctx);
   17004    debug_print_sync("GetUnsignedBytevEXT");
   17005    CALL_GetUnsignedBytevEXT(ctx->CurrentServerDispatch, (pname, data));
   17006 }
   17007 
   17008 
   17009 /* LightModelx: marshalled asynchronously */
   17010 struct marshal_cmd_LightModelx
   17011 {
   17012    struct marshal_cmd_base cmd_base;
   17013    GLenum pname;
   17014    GLfixed param;
   17015 };
   17016 static inline void
   17017 _mesa_unmarshal_LightModelx(struct gl_context *ctx, const struct marshal_cmd_LightModelx *cmd)
   17018 {
   17019    const GLenum pname = cmd->pname;
   17020    const GLfixed param = cmd->param;
   17021    CALL_LightModelx(ctx->CurrentServerDispatch, (pname, param));
   17022 }
   17023 static void GLAPIENTRY
   17024 _mesa_marshal_LightModelx(GLenum pname, GLfixed param)
   17025 {
   17026    GET_CURRENT_CONTEXT(ctx);
   17027    size_t cmd_size = sizeof(struct marshal_cmd_LightModelx);
   17028    struct marshal_cmd_LightModelx *cmd;
   17029    debug_print_marshal("LightModelx");
   17030    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17031       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LightModelx, cmd_size);
   17032       cmd->pname = pname;
   17033       cmd->param = param;
   17034       _mesa_post_marshal_hook(ctx);
   17035       return;
   17036    }
   17037 
   17038    _mesa_glthread_finish(ctx);
   17039    debug_print_sync_fallback("LightModelx");
   17040    CALL_LightModelx(ctx->CurrentServerDispatch, (pname, param));
   17041 }
   17042 
   17043 
   17044 /* VertexAttribI3iEXT: marshalled asynchronously */
   17045 struct marshal_cmd_VertexAttribI3iEXT
   17046 {
   17047    struct marshal_cmd_base cmd_base;
   17048    GLuint index;
   17049    GLint x;
   17050    GLint y;
   17051    GLint z;
   17052 };
   17053 static inline void
   17054 _mesa_unmarshal_VertexAttribI3iEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI3iEXT *cmd)
   17055 {
   17056    const GLuint index = cmd->index;
   17057    const GLint x = cmd->x;
   17058    const GLint y = cmd->y;
   17059    const GLint z = cmd->z;
   17060    CALL_VertexAttribI3iEXT(ctx->CurrentServerDispatch, (index, x, y, z));
   17061 }
   17062 static void GLAPIENTRY
   17063 _mesa_marshal_VertexAttribI3iEXT(GLuint index, GLint x, GLint y, GLint z)
   17064 {
   17065    GET_CURRENT_CONTEXT(ctx);
   17066    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribI3iEXT);
   17067    struct marshal_cmd_VertexAttribI3iEXT *cmd;
   17068    debug_print_marshal("VertexAttribI3iEXT");
   17069    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17070       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI3iEXT, cmd_size);
   17071       cmd->index = index;
   17072       cmd->x = x;
   17073       cmd->y = y;
   17074       cmd->z = z;
   17075       _mesa_post_marshal_hook(ctx);
   17076       return;
   17077    }
   17078 
   17079    _mesa_glthread_finish(ctx);
   17080    debug_print_sync_fallback("VertexAttribI3iEXT");
   17081    CALL_VertexAttribI3iEXT(ctx->CurrentServerDispatch, (index, x, y, z));
   17082 }
   17083 
   17084 
   17085 /* ClearColorx: marshalled asynchronously */
   17086 struct marshal_cmd_ClearColorx
   17087 {
   17088    struct marshal_cmd_base cmd_base;
   17089    GLclampx red;
   17090    GLclampx green;
   17091    GLclampx blue;
   17092    GLclampx alpha;
   17093 };
   17094 static inline void
   17095 _mesa_unmarshal_ClearColorx(struct gl_context *ctx, const struct marshal_cmd_ClearColorx *cmd)
   17096 {
   17097    const GLclampx red = cmd->red;
   17098    const GLclampx green = cmd->green;
   17099    const GLclampx blue = cmd->blue;
   17100    const GLclampx alpha = cmd->alpha;
   17101    CALL_ClearColorx(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   17102 }
   17103 static void GLAPIENTRY
   17104 _mesa_marshal_ClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)
   17105 {
   17106    GET_CURRENT_CONTEXT(ctx);
   17107    size_t cmd_size = sizeof(struct marshal_cmd_ClearColorx);
   17108    struct marshal_cmd_ClearColorx *cmd;
   17109    debug_print_marshal("ClearColorx");
   17110    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17111       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearColorx, cmd_size);
   17112       cmd->red = red;
   17113       cmd->green = green;
   17114       cmd->blue = blue;
   17115       cmd->alpha = alpha;
   17116       _mesa_post_marshal_hook(ctx);
   17117       return;
   17118    }
   17119 
   17120    _mesa_glthread_finish(ctx);
   17121    debug_print_sync_fallback("ClearColorx");
   17122    CALL_ClearColorx(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   17123 }
   17124 
   17125 
   17126 /* EndTransformFeedback: marshalled asynchronously */
   17127 struct marshal_cmd_EndTransformFeedback
   17128 {
   17129    struct marshal_cmd_base cmd_base;
   17130 };
   17131 static inline void
   17132 _mesa_unmarshal_EndTransformFeedback(struct gl_context *ctx, const struct marshal_cmd_EndTransformFeedback *cmd)
   17133 {
   17134    CALL_EndTransformFeedback(ctx->CurrentServerDispatch, ());
   17135 }
   17136 static void GLAPIENTRY
   17137 _mesa_marshal_EndTransformFeedback(void)
   17138 {
   17139    GET_CURRENT_CONTEXT(ctx);
   17140    size_t cmd_size = sizeof(struct marshal_cmd_EndTransformFeedback);
   17141    struct marshal_cmd_EndTransformFeedback *cmd;
   17142    debug_print_marshal("EndTransformFeedback");
   17143    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17144       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EndTransformFeedback, cmd_size);
   17145       (void) cmd;
   17146 
   17147       _mesa_post_marshal_hook(ctx);
   17148       return;
   17149    }
   17150 
   17151    _mesa_glthread_finish(ctx);
   17152    debug_print_sync_fallback("EndTransformFeedback");
   17153    CALL_EndTransformFeedback(ctx->CurrentServerDispatch, ());
   17154 }
   17155 
   17156 
   17157 /* VertexAttribL2dv: marshalled synchronously */
   17158 static void GLAPIENTRY
   17159 _mesa_marshal_VertexAttribL2dv(GLuint index, const GLdouble * v)
   17160 {
   17161    GET_CURRENT_CONTEXT(ctx);
   17162    _mesa_glthread_finish(ctx);
   17163    debug_print_sync("VertexAttribL2dv");
   17164    CALL_VertexAttribL2dv(ctx->CurrentServerDispatch, (index, v));
   17165 }
   17166 
   17167 
   17168 /* GetActiveUniformName: marshalled synchronously */
   17169 static void GLAPIENTRY
   17170 _mesa_marshal_GetActiveUniformName(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformName)
   17171 {
   17172    GET_CURRENT_CONTEXT(ctx);
   17173    _mesa_glthread_finish(ctx);
   17174    debug_print_sync("GetActiveUniformName");
   17175    CALL_GetActiveUniformName(ctx->CurrentServerDispatch, (program, uniformIndex, bufSize, length, uniformName));
   17176 }
   17177 
   17178 
   17179 /* GetProgramBinary: marshalled synchronously */
   17180 static void GLAPIENTRY
   17181 _mesa_marshal_GetProgramBinary(GLuint program, GLsizei bufSize, GLsizei * length, GLenum * binaryFormat, GLvoid * binary)
   17182 {
   17183    GET_CURRENT_CONTEXT(ctx);
   17184    _mesa_glthread_finish(ctx);
   17185    debug_print_sync("GetProgramBinary");
   17186    CALL_GetProgramBinary(ctx->CurrentServerDispatch, (program, bufSize, length, binaryFormat, binary));
   17187 }
   17188 
   17189 
   17190 /* ViewportIndexedfv: marshalled asynchronously */
   17191 struct marshal_cmd_ViewportIndexedfv
   17192 {
   17193    struct marshal_cmd_base cmd_base;
   17194    GLuint index;
   17195    GLfloat v[4];
   17196 };
   17197 static inline void
   17198 _mesa_unmarshal_ViewportIndexedfv(struct gl_context *ctx, const struct marshal_cmd_ViewportIndexedfv *cmd)
   17199 {
   17200    const GLuint index = cmd->index;
   17201    const GLfloat * v = cmd->v;
   17202    CALL_ViewportIndexedfv(ctx->CurrentServerDispatch, (index, v));
   17203 }
   17204 static void GLAPIENTRY
   17205 _mesa_marshal_ViewportIndexedfv(GLuint index, const GLfloat * v)
   17206 {
   17207    GET_CURRENT_CONTEXT(ctx);
   17208    size_t cmd_size = sizeof(struct marshal_cmd_ViewportIndexedfv);
   17209    struct marshal_cmd_ViewportIndexedfv *cmd;
   17210    debug_print_marshal("ViewportIndexedfv");
   17211    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17212       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ViewportIndexedfv, cmd_size);
   17213       cmd->index = index;
   17214       memcpy(cmd->v, v, 16);
   17215       _mesa_post_marshal_hook(ctx);
   17216       return;
   17217    }
   17218 
   17219    _mesa_glthread_finish(ctx);
   17220    debug_print_sync_fallback("ViewportIndexedfv");
   17221    CALL_ViewportIndexedfv(ctx->CurrentServerDispatch, (index, v));
   17222 }
   17223 
   17224 
   17225 /* BindTextureUnit: marshalled asynchronously */
   17226 struct marshal_cmd_BindTextureUnit
   17227 {
   17228    struct marshal_cmd_base cmd_base;
   17229    GLuint unit;
   17230    GLuint texture;
   17231 };
   17232 static inline void
   17233 _mesa_unmarshal_BindTextureUnit(struct gl_context *ctx, const struct marshal_cmd_BindTextureUnit *cmd)
   17234 {
   17235    const GLuint unit = cmd->unit;
   17236    const GLuint texture = cmd->texture;
   17237    CALL_BindTextureUnit(ctx->CurrentServerDispatch, (unit, texture));
   17238 }
   17239 static void GLAPIENTRY
   17240 _mesa_marshal_BindTextureUnit(GLuint unit, GLuint texture)
   17241 {
   17242    GET_CURRENT_CONTEXT(ctx);
   17243    size_t cmd_size = sizeof(struct marshal_cmd_BindTextureUnit);
   17244    struct marshal_cmd_BindTextureUnit *cmd;
   17245    debug_print_marshal("BindTextureUnit");
   17246    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17247       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindTextureUnit, cmd_size);
   17248       cmd->unit = unit;
   17249       cmd->texture = texture;
   17250       _mesa_post_marshal_hook(ctx);
   17251       return;
   17252    }
   17253 
   17254    _mesa_glthread_finish(ctx);
   17255    debug_print_sync_fallback("BindTextureUnit");
   17256    CALL_BindTextureUnit(ctx->CurrentServerDispatch, (unit, texture));
   17257 }
   17258 
   17259 
   17260 /* CallList: marshalled asynchronously */
   17261 struct marshal_cmd_CallList
   17262 {
   17263    struct marshal_cmd_base cmd_base;
   17264    GLuint list;
   17265 };
   17266 static inline void
   17267 _mesa_unmarshal_CallList(struct gl_context *ctx, const struct marshal_cmd_CallList *cmd)
   17268 {
   17269    const GLuint list = cmd->list;
   17270    CALL_CallList(ctx->CurrentServerDispatch, (list));
   17271 }
   17272 static void GLAPIENTRY
   17273 _mesa_marshal_CallList(GLuint list)
   17274 {
   17275    GET_CURRENT_CONTEXT(ctx);
   17276    size_t cmd_size = sizeof(struct marshal_cmd_CallList);
   17277    struct marshal_cmd_CallList *cmd;
   17278    debug_print_marshal("CallList");
   17279    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17280       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CallList, cmd_size);
   17281       cmd->list = list;
   17282       _mesa_post_marshal_hook(ctx);
   17283       return;
   17284    }
   17285 
   17286    _mesa_glthread_finish(ctx);
   17287    debug_print_sync_fallback("CallList");
   17288    CALL_CallList(ctx->CurrentServerDispatch, (list));
   17289 }
   17290 
   17291 
   17292 /* Materialfv: marshalled synchronously */
   17293 static void GLAPIENTRY
   17294 _mesa_marshal_Materialfv(GLenum face, GLenum pname, const GLfloat * params)
   17295 {
   17296    GET_CURRENT_CONTEXT(ctx);
   17297    _mesa_glthread_finish(ctx);
   17298    debug_print_sync("Materialfv");
   17299    CALL_Materialfv(ctx->CurrentServerDispatch, (face, pname, params));
   17300 }
   17301 
   17302 
   17303 /* DeleteProgram: marshalled asynchronously */
   17304 struct marshal_cmd_DeleteProgram
   17305 {
   17306    struct marshal_cmd_base cmd_base;
   17307    GLuint program;
   17308 };
   17309 static inline void
   17310 _mesa_unmarshal_DeleteProgram(struct gl_context *ctx, const struct marshal_cmd_DeleteProgram *cmd)
   17311 {
   17312    const GLuint program = cmd->program;
   17313    CALL_DeleteProgram(ctx->CurrentServerDispatch, (program));
   17314 }
   17315 static void GLAPIENTRY
   17316 _mesa_marshal_DeleteProgram(GLuint program)
   17317 {
   17318    GET_CURRENT_CONTEXT(ctx);
   17319    size_t cmd_size = sizeof(struct marshal_cmd_DeleteProgram);
   17320    struct marshal_cmd_DeleteProgram *cmd;
   17321    debug_print_marshal("DeleteProgram");
   17322    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17323       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteProgram, cmd_size);
   17324       cmd->program = program;
   17325       _mesa_post_marshal_hook(ctx);
   17326       return;
   17327    }
   17328 
   17329    _mesa_glthread_finish(ctx);
   17330    debug_print_sync_fallback("DeleteProgram");
   17331    CALL_DeleteProgram(ctx->CurrentServerDispatch, (program));
   17332 }
   17333 
   17334 
   17335 /* GetActiveAtomicCounterBufferiv: marshalled synchronously */
   17336 static void GLAPIENTRY
   17337 _mesa_marshal_GetActiveAtomicCounterBufferiv(GLuint program, GLuint bufferIndex, GLenum pname, GLint * params)
   17338 {
   17339    GET_CURRENT_CONTEXT(ctx);
   17340    _mesa_glthread_finish(ctx);
   17341    debug_print_sync("GetActiveAtomicCounterBufferiv");
   17342    CALL_GetActiveAtomicCounterBufferiv(ctx->CurrentServerDispatch, (program, bufferIndex, pname, params));
   17343 }
   17344 
   17345 
   17346 /* ClearDepthf: marshalled asynchronously */
   17347 struct marshal_cmd_ClearDepthf
   17348 {
   17349    struct marshal_cmd_base cmd_base;
   17350    GLclampf depth;
   17351 };
   17352 static inline void
   17353 _mesa_unmarshal_ClearDepthf(struct gl_context *ctx, const struct marshal_cmd_ClearDepthf *cmd)
   17354 {
   17355    const GLclampf depth = cmd->depth;
   17356    CALL_ClearDepthf(ctx->CurrentServerDispatch, (depth));
   17357 }
   17358 static void GLAPIENTRY
   17359 _mesa_marshal_ClearDepthf(GLclampf depth)
   17360 {
   17361    GET_CURRENT_CONTEXT(ctx);
   17362    size_t cmd_size = sizeof(struct marshal_cmd_ClearDepthf);
   17363    struct marshal_cmd_ClearDepthf *cmd;
   17364    debug_print_marshal("ClearDepthf");
   17365    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17366       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearDepthf, cmd_size);
   17367       cmd->depth = depth;
   17368       _mesa_post_marshal_hook(ctx);
   17369       return;
   17370    }
   17371 
   17372    _mesa_glthread_finish(ctx);
   17373    debug_print_sync_fallback("ClearDepthf");
   17374    CALL_ClearDepthf(ctx->CurrentServerDispatch, (depth));
   17375 }
   17376 
   17377 
   17378 /* GetTextureHandleARB: marshalled synchronously */
   17379 static GLuint64 GLAPIENTRY
   17380 _mesa_marshal_GetTextureHandleARB(GLuint texture)
   17381 {
   17382    GET_CURRENT_CONTEXT(ctx);
   17383    _mesa_glthread_finish(ctx);
   17384    debug_print_sync("GetTextureHandleARB");
   17385    return CALL_GetTextureHandleARB(ctx->CurrentServerDispatch, (texture));
   17386 }
   17387 
   17388 
   17389 /* GetConvolutionFilter: marshalled synchronously */
   17390 static void GLAPIENTRY
   17391 _mesa_marshal_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid * image)
   17392 {
   17393    GET_CURRENT_CONTEXT(ctx);
   17394    _mesa_glthread_finish(ctx);
   17395    debug_print_sync("GetConvolutionFilter");
   17396    CALL_GetConvolutionFilter(ctx->CurrentServerDispatch, (target, format, type, image));
   17397 }
   17398 
   17399 
   17400 /* MultiModeDrawElementsIBM: marshalled synchronously */
   17401 static void GLAPIENTRY
   17402 _mesa_marshal_MultiModeDrawElementsIBM(const GLenum * mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, GLint modestride)
   17403 {
   17404    GET_CURRENT_CONTEXT(ctx);
   17405    _mesa_glthread_finish(ctx);
   17406    debug_print_sync("MultiModeDrawElementsIBM");
   17407    CALL_MultiModeDrawElementsIBM(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount, modestride));
   17408 }
   17409 
   17410 
   17411 /* Uniform2iv: marshalled asynchronously */
   17412 struct marshal_cmd_Uniform2iv
   17413 {
   17414    struct marshal_cmd_base cmd_base;
   17415    GLint location;
   17416    GLsizei count;
   17417    /* Next safe_mul(count, 8) bytes are GLint value[count][2] */
   17418 };
   17419 static inline void
   17420 _mesa_unmarshal_Uniform2iv(struct gl_context *ctx, const struct marshal_cmd_Uniform2iv *cmd)
   17421 {
   17422    const GLint location = cmd->location;
   17423    const GLsizei count = cmd->count;
   17424    const GLint * value;
   17425    const char *variable_data = (const char *) (cmd + 1);
   17426    value = (const GLint *) variable_data;
   17427    variable_data += count * 8;
   17428    CALL_Uniform2iv(ctx->CurrentServerDispatch, (location, count, value));
   17429 }
   17430 static void GLAPIENTRY
   17431 _mesa_marshal_Uniform2iv(GLint location, GLsizei count, const GLint * value)
   17432 {
   17433    GET_CURRENT_CONTEXT(ctx);
   17434    size_t cmd_size = sizeof(struct marshal_cmd_Uniform2iv) + safe_mul(count, 8);
   17435    struct marshal_cmd_Uniform2iv *cmd;
   17436    debug_print_marshal("Uniform2iv");
   17437    if (unlikely(safe_mul(count, 8) < 0)) {
   17438       goto fallback_to_sync;
   17439    }
   17440    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17441       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2iv, cmd_size);
   17442       cmd->location = location;
   17443       cmd->count = count;
   17444       char *variable_data = (char *) (cmd + 1);
   17445       memcpy(variable_data, value, count * 8);
   17446       variable_data += count * 8;
   17447       _mesa_post_marshal_hook(ctx);
   17448       return;
   17449    }
   17450 
   17451 fallback_to_sync:
   17452    _mesa_glthread_finish(ctx);
   17453    debug_print_sync_fallback("Uniform2iv");
   17454    CALL_Uniform2iv(ctx->CurrentServerDispatch, (location, count, value));
   17455 }
   17456 
   17457 
   17458 /* GetFixedv: marshalled synchronously */
   17459 static void GLAPIENTRY
   17460 _mesa_marshal_GetFixedv(GLenum pname, GLfixed * params)
   17461 {
   17462    GET_CURRENT_CONTEXT(ctx);
   17463    _mesa_glthread_finish(ctx);
   17464    debug_print_sync("GetFixedv");
   17465    CALL_GetFixedv(ctx->CurrentServerDispatch, (pname, params));
   17466 }
   17467 
   17468 
   17469 /* SampleCoveragex: marshalled asynchronously */
   17470 struct marshal_cmd_SampleCoveragex
   17471 {
   17472    struct marshal_cmd_base cmd_base;
   17473    GLclampx value;
   17474    GLboolean invert;
   17475 };
   17476 static inline void
   17477 _mesa_unmarshal_SampleCoveragex(struct gl_context *ctx, const struct marshal_cmd_SampleCoveragex *cmd)
   17478 {
   17479    const GLclampx value = cmd->value;
   17480    const GLboolean invert = cmd->invert;
   17481    CALL_SampleCoveragex(ctx->CurrentServerDispatch, (value, invert));
   17482 }
   17483 static void GLAPIENTRY
   17484 _mesa_marshal_SampleCoveragex(GLclampx value, GLboolean invert)
   17485 {
   17486    GET_CURRENT_CONTEXT(ctx);
   17487    size_t cmd_size = sizeof(struct marshal_cmd_SampleCoveragex);
   17488    struct marshal_cmd_SampleCoveragex *cmd;
   17489    debug_print_marshal("SampleCoveragex");
   17490    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17491       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SampleCoveragex, cmd_size);
   17492       cmd->value = value;
   17493       cmd->invert = invert;
   17494       _mesa_post_marshal_hook(ctx);
   17495       return;
   17496    }
   17497 
   17498    _mesa_glthread_finish(ctx);
   17499    debug_print_sync_fallback("SampleCoveragex");
   17500    CALL_SampleCoveragex(ctx->CurrentServerDispatch, (value, invert));
   17501 }
   17502 
   17503 
   17504 /* GetPerfQueryInfoINTEL: marshalled synchronously */
   17505 static void GLAPIENTRY
   17506 _mesa_marshal_GetPerfQueryInfoINTEL(GLuint queryId, GLuint queryNameLength, GLchar * queryName, GLuint * dataSize, GLuint * noCounters, GLuint * noInstances, GLuint * capsMask)
   17507 {
   17508    GET_CURRENT_CONTEXT(ctx);
   17509    _mesa_glthread_finish(ctx);
   17510    debug_print_sync("GetPerfQueryInfoINTEL");
   17511    CALL_GetPerfQueryInfoINTEL(ctx->CurrentServerDispatch, (queryId, queryNameLength, queryName, dataSize, noCounters, noInstances, capsMask));
   17512 }
   17513 
   17514 
   17515 /* DeleteFramebuffers: marshalled asynchronously */
   17516 struct marshal_cmd_DeleteFramebuffers
   17517 {
   17518    struct marshal_cmd_base cmd_base;
   17519    GLsizei n;
   17520    /* Next safe_mul(n, 4) bytes are GLuint framebuffers[n] */
   17521 };
   17522 static inline void
   17523 _mesa_unmarshal_DeleteFramebuffers(struct gl_context *ctx, const struct marshal_cmd_DeleteFramebuffers *cmd)
   17524 {
   17525    const GLsizei n = cmd->n;
   17526    const GLuint * framebuffers;
   17527    const char *variable_data = (const char *) (cmd + 1);
   17528    framebuffers = (const GLuint *) variable_data;
   17529    variable_data += n * 4;
   17530    CALL_DeleteFramebuffers(ctx->CurrentServerDispatch, (n, framebuffers));
   17531 }
   17532 static void GLAPIENTRY
   17533 _mesa_marshal_DeleteFramebuffers(GLsizei n, const GLuint * framebuffers)
   17534 {
   17535    GET_CURRENT_CONTEXT(ctx);
   17536    size_t cmd_size = sizeof(struct marshal_cmd_DeleteFramebuffers) + safe_mul(n, 4);
   17537    struct marshal_cmd_DeleteFramebuffers *cmd;
   17538    debug_print_marshal("DeleteFramebuffers");
   17539    if (unlikely(safe_mul(n, 4) < 0)) {
   17540       goto fallback_to_sync;
   17541    }
   17542    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17543       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteFramebuffers, cmd_size);
   17544       cmd->n = n;
   17545       char *variable_data = (char *) (cmd + 1);
   17546       memcpy(variable_data, framebuffers, n * 4);
   17547       variable_data += n * 4;
   17548       _mesa_post_marshal_hook(ctx);
   17549       return;
   17550    }
   17551 
   17552 fallback_to_sync:
   17553    _mesa_glthread_finish(ctx);
   17554    debug_print_sync_fallback("DeleteFramebuffers");
   17555    CALL_DeleteFramebuffers(ctx->CurrentServerDispatch, (n, framebuffers));
   17556 }
   17557 
   17558 
   17559 /* VertexAttrib4uiv: marshalled asynchronously */
   17560 struct marshal_cmd_VertexAttrib4uiv
   17561 {
   17562    struct marshal_cmd_base cmd_base;
   17563    GLuint index;
   17564    GLuint v[4];
   17565 };
   17566 static inline void
   17567 _mesa_unmarshal_VertexAttrib4uiv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4uiv *cmd)
   17568 {
   17569    const GLuint index = cmd->index;
   17570    const GLuint * v = cmd->v;
   17571    CALL_VertexAttrib4uiv(ctx->CurrentServerDispatch, (index, v));
   17572 }
   17573 static void GLAPIENTRY
   17574 _mesa_marshal_VertexAttrib4uiv(GLuint index, const GLuint * v)
   17575 {
   17576    GET_CURRENT_CONTEXT(ctx);
   17577    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4uiv);
   17578    struct marshal_cmd_VertexAttrib4uiv *cmd;
   17579    debug_print_marshal("VertexAttrib4uiv");
   17580    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17581       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4uiv, cmd_size);
   17582       cmd->index = index;
   17583       memcpy(cmd->v, v, 16);
   17584       _mesa_post_marshal_hook(ctx);
   17585       return;
   17586    }
   17587 
   17588    _mesa_glthread_finish(ctx);
   17589    debug_print_sync_fallback("VertexAttrib4uiv");
   17590    CALL_VertexAttrib4uiv(ctx->CurrentServerDispatch, (index, v));
   17591 }
   17592 
   17593 
   17594 /* VertexAttrib4Nsv: marshalled asynchronously */
   17595 struct marshal_cmd_VertexAttrib4Nsv
   17596 {
   17597    struct marshal_cmd_base cmd_base;
   17598    GLuint index;
   17599    GLshort v[4];
   17600 };
   17601 static inline void
   17602 _mesa_unmarshal_VertexAttrib4Nsv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nsv *cmd)
   17603 {
   17604    const GLuint index = cmd->index;
   17605    const GLshort * v = cmd->v;
   17606    CALL_VertexAttrib4Nsv(ctx->CurrentServerDispatch, (index, v));
   17607 }
   17608 static void GLAPIENTRY
   17609 _mesa_marshal_VertexAttrib4Nsv(GLuint index, const GLshort * v)
   17610 {
   17611    GET_CURRENT_CONTEXT(ctx);
   17612    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nsv);
   17613    struct marshal_cmd_VertexAttrib4Nsv *cmd;
   17614    debug_print_marshal("VertexAttrib4Nsv");
   17615    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17616       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nsv, cmd_size);
   17617       cmd->index = index;
   17618       memcpy(cmd->v, v, 8);
   17619       _mesa_post_marshal_hook(ctx);
   17620       return;
   17621    }
   17622 
   17623    _mesa_glthread_finish(ctx);
   17624    debug_print_sync_fallback("VertexAttrib4Nsv");
   17625    CALL_VertexAttrib4Nsv(ctx->CurrentServerDispatch, (index, v));
   17626 }
   17627 
   17628 
   17629 /* Vertex4s: marshalled asynchronously */
   17630 struct marshal_cmd_Vertex4s
   17631 {
   17632    struct marshal_cmd_base cmd_base;
   17633    GLshort x;
   17634    GLshort y;
   17635    GLshort z;
   17636    GLshort w;
   17637 };
   17638 static inline void
   17639 _mesa_unmarshal_Vertex4s(struct gl_context *ctx, const struct marshal_cmd_Vertex4s *cmd)
   17640 {
   17641    const GLshort x = cmd->x;
   17642    const GLshort y = cmd->y;
   17643    const GLshort z = cmd->z;
   17644    const GLshort w = cmd->w;
   17645    CALL_Vertex4s(ctx->CurrentServerDispatch, (x, y, z, w));
   17646 }
   17647 static void GLAPIENTRY
   17648 _mesa_marshal_Vertex4s(GLshort x, GLshort y, GLshort z, GLshort w)
   17649 {
   17650    GET_CURRENT_CONTEXT(ctx);
   17651    size_t cmd_size = sizeof(struct marshal_cmd_Vertex4s);
   17652    struct marshal_cmd_Vertex4s *cmd;
   17653    debug_print_marshal("Vertex4s");
   17654    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17655       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex4s, cmd_size);
   17656       cmd->x = x;
   17657       cmd->y = y;
   17658       cmd->z = z;
   17659       cmd->w = w;
   17660       _mesa_post_marshal_hook(ctx);
   17661       return;
   17662    }
   17663 
   17664    _mesa_glthread_finish(ctx);
   17665    debug_print_sync_fallback("Vertex4s");
   17666    CALL_Vertex4s(ctx->CurrentServerDispatch, (x, y, z, w));
   17667 }
   17668 
   17669 
   17670 /* VertexAttribI2iEXT: marshalled asynchronously */
   17671 struct marshal_cmd_VertexAttribI2iEXT
   17672 {
   17673    struct marshal_cmd_base cmd_base;
   17674    GLuint index;
   17675    GLint x;
   17676    GLint y;
   17677 };
   17678 static inline void
   17679 _mesa_unmarshal_VertexAttribI2iEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI2iEXT *cmd)
   17680 {
   17681    const GLuint index = cmd->index;
   17682    const GLint x = cmd->x;
   17683    const GLint y = cmd->y;
   17684    CALL_VertexAttribI2iEXT(ctx->CurrentServerDispatch, (index, x, y));
   17685 }
   17686 static void GLAPIENTRY
   17687 _mesa_marshal_VertexAttribI2iEXT(GLuint index, GLint x, GLint y)
   17688 {
   17689    GET_CURRENT_CONTEXT(ctx);
   17690    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribI2iEXT);
   17691    struct marshal_cmd_VertexAttribI2iEXT *cmd;
   17692    debug_print_marshal("VertexAttribI2iEXT");
   17693    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17694       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI2iEXT, cmd_size);
   17695       cmd->index = index;
   17696       cmd->x = x;
   17697       cmd->y = y;
   17698       _mesa_post_marshal_hook(ctx);
   17699       return;
   17700    }
   17701 
   17702    _mesa_glthread_finish(ctx);
   17703    debug_print_sync_fallback("VertexAttribI2iEXT");
   17704    CALL_VertexAttribI2iEXT(ctx->CurrentServerDispatch, (index, x, y));
   17705 }
   17706 
   17707 
   17708 /* Vertex4f: marshalled asynchronously */
   17709 struct marshal_cmd_Vertex4f
   17710 {
   17711    struct marshal_cmd_base cmd_base;
   17712    GLfloat x;
   17713    GLfloat y;
   17714    GLfloat z;
   17715    GLfloat w;
   17716 };
   17717 static inline void
   17718 _mesa_unmarshal_Vertex4f(struct gl_context *ctx, const struct marshal_cmd_Vertex4f *cmd)
   17719 {
   17720    const GLfloat x = cmd->x;
   17721    const GLfloat y = cmd->y;
   17722    const GLfloat z = cmd->z;
   17723    const GLfloat w = cmd->w;
   17724    CALL_Vertex4f(ctx->CurrentServerDispatch, (x, y, z, w));
   17725 }
   17726 static void GLAPIENTRY
   17727 _mesa_marshal_Vertex4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
   17728 {
   17729    GET_CURRENT_CONTEXT(ctx);
   17730    size_t cmd_size = sizeof(struct marshal_cmd_Vertex4f);
   17731    struct marshal_cmd_Vertex4f *cmd;
   17732    debug_print_marshal("Vertex4f");
   17733    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17734       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex4f, cmd_size);
   17735       cmd->x = x;
   17736       cmd->y = y;
   17737       cmd->z = z;
   17738       cmd->w = w;
   17739       _mesa_post_marshal_hook(ctx);
   17740       return;
   17741    }
   17742 
   17743    _mesa_glthread_finish(ctx);
   17744    debug_print_sync_fallback("Vertex4f");
   17745    CALL_Vertex4f(ctx->CurrentServerDispatch, (x, y, z, w));
   17746 }
   17747 
   17748 
   17749 /* Vertex4d: marshalled asynchronously */
   17750 struct marshal_cmd_Vertex4d
   17751 {
   17752    struct marshal_cmd_base cmd_base;
   17753    GLdouble x;
   17754    GLdouble y;
   17755    GLdouble z;
   17756    GLdouble w;
   17757 };
   17758 static inline void
   17759 _mesa_unmarshal_Vertex4d(struct gl_context *ctx, const struct marshal_cmd_Vertex4d *cmd)
   17760 {
   17761    const GLdouble x = cmd->x;
   17762    const GLdouble y = cmd->y;
   17763    const GLdouble z = cmd->z;
   17764    const GLdouble w = cmd->w;
   17765    CALL_Vertex4d(ctx->CurrentServerDispatch, (x, y, z, w));
   17766 }
   17767 static void GLAPIENTRY
   17768 _mesa_marshal_Vertex4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
   17769 {
   17770    GET_CURRENT_CONTEXT(ctx);
   17771    size_t cmd_size = sizeof(struct marshal_cmd_Vertex4d);
   17772    struct marshal_cmd_Vertex4d *cmd;
   17773    debug_print_marshal("Vertex4d");
   17774    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17775       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex4d, cmd_size);
   17776       cmd->x = x;
   17777       cmd->y = y;
   17778       cmd->z = z;
   17779       cmd->w = w;
   17780       _mesa_post_marshal_hook(ctx);
   17781       return;
   17782    }
   17783 
   17784    _mesa_glthread_finish(ctx);
   17785    debug_print_sync_fallback("Vertex4d");
   17786    CALL_Vertex4d(ctx->CurrentServerDispatch, (x, y, z, w));
   17787 }
   17788 
   17789 
   17790 /* VertexAttribL4dv: marshalled synchronously */
   17791 static void GLAPIENTRY
   17792 _mesa_marshal_VertexAttribL4dv(GLuint index, const GLdouble * v)
   17793 {
   17794    GET_CURRENT_CONTEXT(ctx);
   17795    _mesa_glthread_finish(ctx);
   17796    debug_print_sync("VertexAttribL4dv");
   17797    CALL_VertexAttribL4dv(ctx->CurrentServerDispatch, (index, v));
   17798 }
   17799 
   17800 
   17801 /* GetnUniformi64vARB: marshalled synchronously */
   17802 static void GLAPIENTRY
   17803 _mesa_marshal_GetnUniformi64vARB(GLuint program, GLint location, GLsizei bufSize, GLint64 * params)
   17804 {
   17805    GET_CURRENT_CONTEXT(ctx);
   17806    _mesa_glthread_finish(ctx);
   17807    debug_print_sync("GetnUniformi64vARB");
   17808    CALL_GetnUniformi64vARB(ctx->CurrentServerDispatch, (program, location, bufSize, params));
   17809 }
   17810 
   17811 
   17812 /* GetTexGenfv: marshalled synchronously */
   17813 static void GLAPIENTRY
   17814 _mesa_marshal_GetTexGenfv(GLenum coord, GLenum pname, GLfloat * params)
   17815 {
   17816    GET_CURRENT_CONTEXT(ctx);
   17817    _mesa_glthread_finish(ctx);
   17818    debug_print_sync("GetTexGenfv");
   17819    CALL_GetTexGenfv(ctx->CurrentServerDispatch, (coord, pname, params));
   17820 }
   17821 
   17822 
   17823 /* Vertex4i: marshalled asynchronously */
   17824 struct marshal_cmd_Vertex4i
   17825 {
   17826    struct marshal_cmd_base cmd_base;
   17827    GLint x;
   17828    GLint y;
   17829    GLint z;
   17830    GLint w;
   17831 };
   17832 static inline void
   17833 _mesa_unmarshal_Vertex4i(struct gl_context *ctx, const struct marshal_cmd_Vertex4i *cmd)
   17834 {
   17835    const GLint x = cmd->x;
   17836    const GLint y = cmd->y;
   17837    const GLint z = cmd->z;
   17838    const GLint w = cmd->w;
   17839    CALL_Vertex4i(ctx->CurrentServerDispatch, (x, y, z, w));
   17840 }
   17841 static void GLAPIENTRY
   17842 _mesa_marshal_Vertex4i(GLint x, GLint y, GLint z, GLint w)
   17843 {
   17844    GET_CURRENT_CONTEXT(ctx);
   17845    size_t cmd_size = sizeof(struct marshal_cmd_Vertex4i);
   17846    struct marshal_cmd_Vertex4i *cmd;
   17847    debug_print_marshal("Vertex4i");
   17848    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17849       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex4i, cmd_size);
   17850       cmd->x = x;
   17851       cmd->y = y;
   17852       cmd->z = z;
   17853       cmd->w = w;
   17854       _mesa_post_marshal_hook(ctx);
   17855       return;
   17856    }
   17857 
   17858    _mesa_glthread_finish(ctx);
   17859    debug_print_sync_fallback("Vertex4i");
   17860    CALL_Vertex4i(ctx->CurrentServerDispatch, (x, y, z, w));
   17861 }
   17862 
   17863 
   17864 /* MemoryBarrierByRegion: marshalled asynchronously */
   17865 struct marshal_cmd_MemoryBarrierByRegion
   17866 {
   17867    struct marshal_cmd_base cmd_base;
   17868    GLbitfield barriers;
   17869 };
   17870 static inline void
   17871 _mesa_unmarshal_MemoryBarrierByRegion(struct gl_context *ctx, const struct marshal_cmd_MemoryBarrierByRegion *cmd)
   17872 {
   17873    const GLbitfield barriers = cmd->barriers;
   17874    CALL_MemoryBarrierByRegion(ctx->CurrentServerDispatch, (barriers));
   17875 }
   17876 static void GLAPIENTRY
   17877 _mesa_marshal_MemoryBarrierByRegion(GLbitfield barriers)
   17878 {
   17879    GET_CURRENT_CONTEXT(ctx);
   17880    size_t cmd_size = sizeof(struct marshal_cmd_MemoryBarrierByRegion);
   17881    struct marshal_cmd_MemoryBarrierByRegion *cmd;
   17882    debug_print_marshal("MemoryBarrierByRegion");
   17883    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17884       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MemoryBarrierByRegion, cmd_size);
   17885       cmd->barriers = barriers;
   17886       _mesa_post_marshal_hook(ctx);
   17887       return;
   17888    }
   17889 
   17890    _mesa_glthread_finish(ctx);
   17891    debug_print_sync_fallback("MemoryBarrierByRegion");
   17892    CALL_MemoryBarrierByRegion(ctx->CurrentServerDispatch, (barriers));
   17893 }
   17894 
   17895 
   17896 /* StencilFuncSeparateATI: marshalled asynchronously */
   17897 struct marshal_cmd_StencilFuncSeparateATI
   17898 {
   17899    struct marshal_cmd_base cmd_base;
   17900    GLenum frontfunc;
   17901    GLenum backfunc;
   17902    GLint ref;
   17903    GLuint mask;
   17904 };
   17905 static inline void
   17906 _mesa_unmarshal_StencilFuncSeparateATI(struct gl_context *ctx, const struct marshal_cmd_StencilFuncSeparateATI *cmd)
   17907 {
   17908    const GLenum frontfunc = cmd->frontfunc;
   17909    const GLenum backfunc = cmd->backfunc;
   17910    const GLint ref = cmd->ref;
   17911    const GLuint mask = cmd->mask;
   17912    CALL_StencilFuncSeparateATI(ctx->CurrentServerDispatch, (frontfunc, backfunc, ref, mask));
   17913 }
   17914 static void GLAPIENTRY
   17915 _mesa_marshal_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask)
   17916 {
   17917    GET_CURRENT_CONTEXT(ctx);
   17918    size_t cmd_size = sizeof(struct marshal_cmd_StencilFuncSeparateATI);
   17919    struct marshal_cmd_StencilFuncSeparateATI *cmd;
   17920    debug_print_marshal("StencilFuncSeparateATI");
   17921    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17922       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_StencilFuncSeparateATI, cmd_size);
   17923       cmd->frontfunc = frontfunc;
   17924       cmd->backfunc = backfunc;
   17925       cmd->ref = ref;
   17926       cmd->mask = mask;
   17927       _mesa_post_marshal_hook(ctx);
   17928       return;
   17929    }
   17930 
   17931    _mesa_glthread_finish(ctx);
   17932    debug_print_sync_fallback("StencilFuncSeparateATI");
   17933    CALL_StencilFuncSeparateATI(ctx->CurrentServerDispatch, (frontfunc, backfunc, ref, mask));
   17934 }
   17935 
   17936 
   17937 /* GetVertexAttribIuiv: marshalled synchronously */
   17938 static void GLAPIENTRY
   17939 _mesa_marshal_GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint * params)
   17940 {
   17941    GET_CURRENT_CONTEXT(ctx);
   17942    _mesa_glthread_finish(ctx);
   17943    debug_print_sync("GetVertexAttribIuiv");
   17944    CALL_GetVertexAttribIuiv(ctx->CurrentServerDispatch, (index, pname, params));
   17945 }
   17946 
   17947 
   17948 /* LightModelfv: marshalled synchronously */
   17949 static void GLAPIENTRY
   17950 _mesa_marshal_LightModelfv(GLenum pname, const GLfloat * params)
   17951 {
   17952    GET_CURRENT_CONTEXT(ctx);
   17953    _mesa_glthread_finish(ctx);
   17954    debug_print_sync("LightModelfv");
   17955    CALL_LightModelfv(ctx->CurrentServerDispatch, (pname, params));
   17956 }
   17957 
   17958 
   17959 /* Vertex4dv: marshalled asynchronously */
   17960 struct marshal_cmd_Vertex4dv
   17961 {
   17962    struct marshal_cmd_base cmd_base;
   17963    GLdouble v[4];
   17964 };
   17965 static inline void
   17966 _mesa_unmarshal_Vertex4dv(struct gl_context *ctx, const struct marshal_cmd_Vertex4dv *cmd)
   17967 {
   17968    const GLdouble * v = cmd->v;
   17969    CALL_Vertex4dv(ctx->CurrentServerDispatch, (v));
   17970 }
   17971 static void GLAPIENTRY
   17972 _mesa_marshal_Vertex4dv(const GLdouble * v)
   17973 {
   17974    GET_CURRENT_CONTEXT(ctx);
   17975    size_t cmd_size = sizeof(struct marshal_cmd_Vertex4dv);
   17976    struct marshal_cmd_Vertex4dv *cmd;
   17977    debug_print_marshal("Vertex4dv");
   17978    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   17979       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex4dv, cmd_size);
   17980       memcpy(cmd->v, v, 32);
   17981       _mesa_post_marshal_hook(ctx);
   17982       return;
   17983    }
   17984 
   17985    _mesa_glthread_finish(ctx);
   17986    debug_print_sync_fallback("Vertex4dv");
   17987    CALL_Vertex4dv(ctx->CurrentServerDispatch, (v));
   17988 }
   17989 
   17990 
   17991 /* GetInfoLogARB: marshalled synchronously */
   17992 static void GLAPIENTRY
   17993 _mesa_marshal_GetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog)
   17994 {
   17995    GET_CURRENT_CONTEXT(ctx);
   17996    _mesa_glthread_finish(ctx);
   17997    debug_print_sync("GetInfoLogARB");
   17998    CALL_GetInfoLogARB(ctx->CurrentServerDispatch, (obj, maxLength, length, infoLog));
   17999 }
   18000 
   18001 
   18002 /* StencilMask: marshalled asynchronously */
   18003 struct marshal_cmd_StencilMask
   18004 {
   18005    struct marshal_cmd_base cmd_base;
   18006    GLuint mask;
   18007 };
   18008 static inline void
   18009 _mesa_unmarshal_StencilMask(struct gl_context *ctx, const struct marshal_cmd_StencilMask *cmd)
   18010 {
   18011    const GLuint mask = cmd->mask;
   18012    CALL_StencilMask(ctx->CurrentServerDispatch, (mask));
   18013 }
   18014 static void GLAPIENTRY
   18015 _mesa_marshal_StencilMask(GLuint mask)
   18016 {
   18017    GET_CURRENT_CONTEXT(ctx);
   18018    size_t cmd_size = sizeof(struct marshal_cmd_StencilMask);
   18019    struct marshal_cmd_StencilMask *cmd;
   18020    debug_print_marshal("StencilMask");
   18021    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18022       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_StencilMask, cmd_size);
   18023       cmd->mask = mask;
   18024       _mesa_post_marshal_hook(ctx);
   18025       return;
   18026    }
   18027 
   18028    _mesa_glthread_finish(ctx);
   18029    debug_print_sync_fallback("StencilMask");
   18030    CALL_StencilMask(ctx->CurrentServerDispatch, (mask));
   18031 }
   18032 
   18033 
   18034 /* NamedFramebufferReadBuffer: marshalled asynchronously */
   18035 struct marshal_cmd_NamedFramebufferReadBuffer
   18036 {
   18037    struct marshal_cmd_base cmd_base;
   18038    GLuint framebuffer;
   18039    GLenum buf;
   18040 };
   18041 static inline void
   18042 _mesa_unmarshal_NamedFramebufferReadBuffer(struct gl_context *ctx, const struct marshal_cmd_NamedFramebufferReadBuffer *cmd)
   18043 {
   18044    const GLuint framebuffer = cmd->framebuffer;
   18045    const GLenum buf = cmd->buf;
   18046    CALL_NamedFramebufferReadBuffer(ctx->CurrentServerDispatch, (framebuffer, buf));
   18047 }
   18048 static void GLAPIENTRY
   18049 _mesa_marshal_NamedFramebufferReadBuffer(GLuint framebuffer, GLenum buf)
   18050 {
   18051    GET_CURRENT_CONTEXT(ctx);
   18052    size_t cmd_size = sizeof(struct marshal_cmd_NamedFramebufferReadBuffer);
   18053    struct marshal_cmd_NamedFramebufferReadBuffer *cmd;
   18054    debug_print_marshal("NamedFramebufferReadBuffer");
   18055    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18056       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedFramebufferReadBuffer, cmd_size);
   18057       cmd->framebuffer = framebuffer;
   18058       cmd->buf = buf;
   18059       _mesa_post_marshal_hook(ctx);
   18060       return;
   18061    }
   18062 
   18063    _mesa_glthread_finish(ctx);
   18064    debug_print_sync_fallback("NamedFramebufferReadBuffer");
   18065    CALL_NamedFramebufferReadBuffer(ctx->CurrentServerDispatch, (framebuffer, buf));
   18066 }
   18067 
   18068 
   18069 /* ProgramUniformHandleui64ARB: marshalled asynchronously */
   18070 struct marshal_cmd_ProgramUniformHandleui64ARB
   18071 {
   18072    struct marshal_cmd_base cmd_base;
   18073    GLuint program;
   18074    GLint location;
   18075    GLuint64 value;
   18076 };
   18077 static inline void
   18078 _mesa_unmarshal_ProgramUniformHandleui64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformHandleui64ARB *cmd)
   18079 {
   18080    const GLuint program = cmd->program;
   18081    const GLint location = cmd->location;
   18082    const GLuint64 value = cmd->value;
   18083    CALL_ProgramUniformHandleui64ARB(ctx->CurrentServerDispatch, (program, location, value));
   18084 }
   18085 static void GLAPIENTRY
   18086 _mesa_marshal_ProgramUniformHandleui64ARB(GLuint program, GLint location, GLuint64 value)
   18087 {
   18088    GET_CURRENT_CONTEXT(ctx);
   18089    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformHandleui64ARB);
   18090    struct marshal_cmd_ProgramUniformHandleui64ARB *cmd;
   18091    debug_print_marshal("ProgramUniformHandleui64ARB");
   18092    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18093       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformHandleui64ARB, cmd_size);
   18094       cmd->program = program;
   18095       cmd->location = location;
   18096       cmd->value = value;
   18097       _mesa_post_marshal_hook(ctx);
   18098       return;
   18099    }
   18100 
   18101    _mesa_glthread_finish(ctx);
   18102    debug_print_sync_fallback("ProgramUniformHandleui64ARB");
   18103    CALL_ProgramUniformHandleui64ARB(ctx->CurrentServerDispatch, (program, location, value));
   18104 }
   18105 
   18106 
   18107 /* ProgramUniform2i64ARB: marshalled asynchronously */
   18108 struct marshal_cmd_ProgramUniform2i64ARB
   18109 {
   18110    struct marshal_cmd_base cmd_base;
   18111    GLuint program;
   18112    GLint location;
   18113    GLint64 x;
   18114    GLint64 y;
   18115 };
   18116 static inline void
   18117 _mesa_unmarshal_ProgramUniform2i64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2i64ARB *cmd)
   18118 {
   18119    const GLuint program = cmd->program;
   18120    const GLint location = cmd->location;
   18121    const GLint64 x = cmd->x;
   18122    const GLint64 y = cmd->y;
   18123    CALL_ProgramUniform2i64ARB(ctx->CurrentServerDispatch, (program, location, x, y));
   18124 }
   18125 static void GLAPIENTRY
   18126 _mesa_marshal_ProgramUniform2i64ARB(GLuint program, GLint location, GLint64 x, GLint64 y)
   18127 {
   18128    GET_CURRENT_CONTEXT(ctx);
   18129    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform2i64ARB);
   18130    struct marshal_cmd_ProgramUniform2i64ARB *cmd;
   18131    debug_print_marshal("ProgramUniform2i64ARB");
   18132    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18133       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2i64ARB, cmd_size);
   18134       cmd->program = program;
   18135       cmd->location = location;
   18136       cmd->x = x;
   18137       cmd->y = y;
   18138       _mesa_post_marshal_hook(ctx);
   18139       return;
   18140    }
   18141 
   18142    _mesa_glthread_finish(ctx);
   18143    debug_print_sync_fallback("ProgramUniform2i64ARB");
   18144    CALL_ProgramUniform2i64ARB(ctx->CurrentServerDispatch, (program, location, x, y));
   18145 }
   18146 
   18147 
   18148 /* IsList: marshalled synchronously */
   18149 static GLboolean GLAPIENTRY
   18150 _mesa_marshal_IsList(GLuint list)
   18151 {
   18152    GET_CURRENT_CONTEXT(ctx);
   18153    _mesa_glthread_finish(ctx);
   18154    debug_print_sync("IsList");
   18155    return CALL_IsList(ctx->CurrentServerDispatch, (list));
   18156 }
   18157 
   18158 
   18159 /* GetIntegeri_v: marshalled synchronously */
   18160 static void GLAPIENTRY
   18161 _mesa_marshal_GetIntegeri_v(GLenum value, GLuint index, GLint * data)
   18162 {
   18163    GET_CURRENT_CONTEXT(ctx);
   18164    _mesa_glthread_finish(ctx);
   18165    debug_print_sync("GetIntegeri_v");
   18166    CALL_GetIntegeri_v(ctx->CurrentServerDispatch, (value, index, data));
   18167 }
   18168 
   18169 
   18170 /* ProgramUniform2iv: marshalled asynchronously */
   18171 struct marshal_cmd_ProgramUniform2iv
   18172 {
   18173    struct marshal_cmd_base cmd_base;
   18174    GLuint program;
   18175    GLint location;
   18176    GLsizei count;
   18177    /* Next safe_mul(count, 8) bytes are GLint value[count][2] */
   18178 };
   18179 static inline void
   18180 _mesa_unmarshal_ProgramUniform2iv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2iv *cmd)
   18181 {
   18182    const GLuint program = cmd->program;
   18183    const GLint location = cmd->location;
   18184    const GLsizei count = cmd->count;
   18185    const GLint * value;
   18186    const char *variable_data = (const char *) (cmd + 1);
   18187    value = (const GLint *) variable_data;
   18188    variable_data += count * 8;
   18189    CALL_ProgramUniform2iv(ctx->CurrentServerDispatch, (program, location, count, value));
   18190 }
   18191 static void GLAPIENTRY
   18192 _mesa_marshal_ProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint * value)
   18193 {
   18194    GET_CURRENT_CONTEXT(ctx);
   18195    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform2iv) + safe_mul(count, 8);
   18196    struct marshal_cmd_ProgramUniform2iv *cmd;
   18197    debug_print_marshal("ProgramUniform2iv");
   18198    if (unlikely(safe_mul(count, 8) < 0)) {
   18199       goto fallback_to_sync;
   18200    }
   18201    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18202       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2iv, cmd_size);
   18203       cmd->program = program;
   18204       cmd->location = location;
   18205       cmd->count = count;
   18206       char *variable_data = (char *) (cmd + 1);
   18207       memcpy(variable_data, value, count * 8);
   18208       variable_data += count * 8;
   18209       _mesa_post_marshal_hook(ctx);
   18210       return;
   18211    }
   18212 
   18213 fallback_to_sync:
   18214    _mesa_glthread_finish(ctx);
   18215    debug_print_sync_fallback("ProgramUniform2iv");
   18216    CALL_ProgramUniform2iv(ctx->CurrentServerDispatch, (program, location, count, value));
   18217 }
   18218 
   18219 
   18220 /* CreateVertexArrays: marshalled synchronously */
   18221 static void GLAPIENTRY
   18222 _mesa_marshal_CreateVertexArrays(GLsizei n, GLuint * arrays)
   18223 {
   18224    GET_CURRENT_CONTEXT(ctx);
   18225    _mesa_glthread_finish(ctx);
   18226    debug_print_sync("CreateVertexArrays");
   18227    CALL_CreateVertexArrays(ctx->CurrentServerDispatch, (n, arrays));
   18228 }
   18229 
   18230 
   18231 /* FogCoordPointer: marshalled asynchronously */
   18232 struct marshal_cmd_FogCoordPointer
   18233 {
   18234    struct marshal_cmd_base cmd_base;
   18235    GLenum type;
   18236    GLsizei stride;
   18237    const GLvoid * pointer;
   18238 };
   18239 static inline void
   18240 _mesa_unmarshal_FogCoordPointer(struct gl_context *ctx, const struct marshal_cmd_FogCoordPointer *cmd)
   18241 {
   18242    const GLenum type = cmd->type;
   18243    const GLsizei stride = cmd->stride;
   18244    const GLvoid * pointer = cmd->pointer;
   18245    CALL_FogCoordPointer(ctx->CurrentServerDispatch, (type, stride, pointer));
   18246 }
   18247 static void GLAPIENTRY
   18248 _mesa_marshal_FogCoordPointer(GLenum type, GLsizei stride, const GLvoid * pointer)
   18249 {
   18250    GET_CURRENT_CONTEXT(ctx);
   18251    size_t cmd_size = sizeof(struct marshal_cmd_FogCoordPointer);
   18252    struct marshal_cmd_FogCoordPointer *cmd;
   18253    debug_print_marshal("FogCoordPointer");
   18254    if (_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)) {
   18255       _mesa_glthread_finish(ctx);
   18256       _mesa_glthread_restore_dispatch(ctx);
   18257       debug_print_sync_fallback("FogCoordPointer");
   18258       CALL_FogCoordPointer(ctx->CurrentServerDispatch, (type, stride, pointer));
   18259       return;
   18260    }
   18261    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18262       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FogCoordPointer, cmd_size);
   18263       cmd->type = type;
   18264       cmd->stride = stride;
   18265       cmd->pointer = pointer;
   18266       _mesa_post_marshal_hook(ctx);
   18267       return;
   18268    }
   18269 
   18270    _mesa_glthread_finish(ctx);
   18271    debug_print_sync_fallback("FogCoordPointer");
   18272    CALL_FogCoordPointer(ctx->CurrentServerDispatch, (type, stride, pointer));
   18273 }
   18274 
   18275 
   18276 /* SecondaryColor3us: marshalled asynchronously */
   18277 struct marshal_cmd_SecondaryColor3us
   18278 {
   18279    struct marshal_cmd_base cmd_base;
   18280    GLushort red;
   18281    GLushort green;
   18282    GLushort blue;
   18283 };
   18284 static inline void
   18285 _mesa_unmarshal_SecondaryColor3us(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3us *cmd)
   18286 {
   18287    const GLushort red = cmd->red;
   18288    const GLushort green = cmd->green;
   18289    const GLushort blue = cmd->blue;
   18290    CALL_SecondaryColor3us(ctx->CurrentServerDispatch, (red, green, blue));
   18291 }
   18292 static void GLAPIENTRY
   18293 _mesa_marshal_SecondaryColor3us(GLushort red, GLushort green, GLushort blue)
   18294 {
   18295    GET_CURRENT_CONTEXT(ctx);
   18296    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColor3us);
   18297    struct marshal_cmd_SecondaryColor3us *cmd;
   18298    debug_print_marshal("SecondaryColor3us");
   18299    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18300       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3us, cmd_size);
   18301       cmd->red = red;
   18302       cmd->green = green;
   18303       cmd->blue = blue;
   18304       _mesa_post_marshal_hook(ctx);
   18305       return;
   18306    }
   18307 
   18308    _mesa_glthread_finish(ctx);
   18309    debug_print_sync_fallback("SecondaryColor3us");
   18310    CALL_SecondaryColor3us(ctx->CurrentServerDispatch, (red, green, blue));
   18311 }
   18312 
   18313 
   18314 /* TextureStorageMem1DEXT: marshalled asynchronously */
   18315 struct marshal_cmd_TextureStorageMem1DEXT
   18316 {
   18317    struct marshal_cmd_base cmd_base;
   18318    GLuint texture;
   18319    GLsizei levels;
   18320    GLenum internalFormat;
   18321    GLsizei width;
   18322    GLuint memory;
   18323    GLuint64 offset;
   18324 };
   18325 static inline void
   18326 _mesa_unmarshal_TextureStorageMem1DEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorageMem1DEXT *cmd)
   18327 {
   18328    const GLuint texture = cmd->texture;
   18329    const GLsizei levels = cmd->levels;
   18330    const GLenum internalFormat = cmd->internalFormat;
   18331    const GLsizei width = cmd->width;
   18332    const GLuint memory = cmd->memory;
   18333    const GLuint64 offset = cmd->offset;
   18334    CALL_TextureStorageMem1DEXT(ctx->CurrentServerDispatch, (texture, levels, internalFormat, width, memory, offset));
   18335 }
   18336 static void GLAPIENTRY
   18337 _mesa_marshal_TextureStorageMem1DEXT(GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset)
   18338 {
   18339    GET_CURRENT_CONTEXT(ctx);
   18340    size_t cmd_size = sizeof(struct marshal_cmd_TextureStorageMem1DEXT);
   18341    struct marshal_cmd_TextureStorageMem1DEXT *cmd;
   18342    debug_print_marshal("TextureStorageMem1DEXT");
   18343    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18344       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorageMem1DEXT, cmd_size);
   18345       cmd->texture = texture;
   18346       cmd->levels = levels;
   18347       cmd->internalFormat = internalFormat;
   18348       cmd->width = width;
   18349       cmd->memory = memory;
   18350       cmd->offset = offset;
   18351       _mesa_post_marshal_hook(ctx);
   18352       return;
   18353    }
   18354 
   18355    _mesa_glthread_finish(ctx);
   18356    debug_print_sync_fallback("TextureStorageMem1DEXT");
   18357    CALL_TextureStorageMem1DEXT(ctx->CurrentServerDispatch, (texture, levels, internalFormat, width, memory, offset));
   18358 }
   18359 
   18360 
   18361 /* SecondaryColor3ub: marshalled asynchronously */
   18362 struct marshal_cmd_SecondaryColor3ub
   18363 {
   18364    struct marshal_cmd_base cmd_base;
   18365    GLubyte red;
   18366    GLubyte green;
   18367    GLubyte blue;
   18368 };
   18369 static inline void
   18370 _mesa_unmarshal_SecondaryColor3ub(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3ub *cmd)
   18371 {
   18372    const GLubyte red = cmd->red;
   18373    const GLubyte green = cmd->green;
   18374    const GLubyte blue = cmd->blue;
   18375    CALL_SecondaryColor3ub(ctx->CurrentServerDispatch, (red, green, blue));
   18376 }
   18377 static void GLAPIENTRY
   18378 _mesa_marshal_SecondaryColor3ub(GLubyte red, GLubyte green, GLubyte blue)
   18379 {
   18380    GET_CURRENT_CONTEXT(ctx);
   18381    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColor3ub);
   18382    struct marshal_cmd_SecondaryColor3ub *cmd;
   18383    debug_print_marshal("SecondaryColor3ub");
   18384    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18385       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3ub, cmd_size);
   18386       cmd->red = red;
   18387       cmd->green = green;
   18388       cmd->blue = blue;
   18389       _mesa_post_marshal_hook(ctx);
   18390       return;
   18391    }
   18392 
   18393    _mesa_glthread_finish(ctx);
   18394    debug_print_sync_fallback("SecondaryColor3ub");
   18395    CALL_SecondaryColor3ub(ctx->CurrentServerDispatch, (red, green, blue));
   18396 }
   18397 
   18398 
   18399 /* NamedBufferStorageMemEXT: marshalled asynchronously */
   18400 struct marshal_cmd_NamedBufferStorageMemEXT
   18401 {
   18402    struct marshal_cmd_base cmd_base;
   18403    GLuint buffer;
   18404    GLsizeiptr size;
   18405    GLuint memory;
   18406    GLuint64 offset;
   18407 };
   18408 static inline void
   18409 _mesa_unmarshal_NamedBufferStorageMemEXT(struct gl_context *ctx, const struct marshal_cmd_NamedBufferStorageMemEXT *cmd)
   18410 {
   18411    const GLuint buffer = cmd->buffer;
   18412    const GLsizeiptr size = cmd->size;
   18413    const GLuint memory = cmd->memory;
   18414    const GLuint64 offset = cmd->offset;
   18415    CALL_NamedBufferStorageMemEXT(ctx->CurrentServerDispatch, (buffer, size, memory, offset));
   18416 }
   18417 static void GLAPIENTRY
   18418 _mesa_marshal_NamedBufferStorageMemEXT(GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset)
   18419 {
   18420    GET_CURRENT_CONTEXT(ctx);
   18421    size_t cmd_size = sizeof(struct marshal_cmd_NamedBufferStorageMemEXT);
   18422    struct marshal_cmd_NamedBufferStorageMemEXT *cmd;
   18423    debug_print_marshal("NamedBufferStorageMemEXT");
   18424    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18425       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedBufferStorageMemEXT, cmd_size);
   18426       cmd->buffer = buffer;
   18427       cmd->size = size;
   18428       cmd->memory = memory;
   18429       cmd->offset = offset;
   18430       _mesa_post_marshal_hook(ctx);
   18431       return;
   18432    }
   18433 
   18434    _mesa_glthread_finish(ctx);
   18435    debug_print_sync_fallback("NamedBufferStorageMemEXT");
   18436    CALL_NamedBufferStorageMemEXT(ctx->CurrentServerDispatch, (buffer, size, memory, offset));
   18437 }
   18438 
   18439 
   18440 /* SecondaryColor3ui: marshalled asynchronously */
   18441 struct marshal_cmd_SecondaryColor3ui
   18442 {
   18443    struct marshal_cmd_base cmd_base;
   18444    GLuint red;
   18445    GLuint green;
   18446    GLuint blue;
   18447 };
   18448 static inline void
   18449 _mesa_unmarshal_SecondaryColor3ui(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3ui *cmd)
   18450 {
   18451    const GLuint red = cmd->red;
   18452    const GLuint green = cmd->green;
   18453    const GLuint blue = cmd->blue;
   18454    CALL_SecondaryColor3ui(ctx->CurrentServerDispatch, (red, green, blue));
   18455 }
   18456 static void GLAPIENTRY
   18457 _mesa_marshal_SecondaryColor3ui(GLuint red, GLuint green, GLuint blue)
   18458 {
   18459    GET_CURRENT_CONTEXT(ctx);
   18460    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColor3ui);
   18461    struct marshal_cmd_SecondaryColor3ui *cmd;
   18462    debug_print_marshal("SecondaryColor3ui");
   18463    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18464       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3ui, cmd_size);
   18465       cmd->red = red;
   18466       cmd->green = green;
   18467       cmd->blue = blue;
   18468       _mesa_post_marshal_hook(ctx);
   18469       return;
   18470    }
   18471 
   18472    _mesa_glthread_finish(ctx);
   18473    debug_print_sync_fallback("SecondaryColor3ui");
   18474    CALL_SecondaryColor3ui(ctx->CurrentServerDispatch, (red, green, blue));
   18475 }
   18476 
   18477 
   18478 /* ProgramUniform4ui64ARB: marshalled asynchronously */
   18479 struct marshal_cmd_ProgramUniform4ui64ARB
   18480 {
   18481    struct marshal_cmd_base cmd_base;
   18482    GLuint program;
   18483    GLint location;
   18484    GLuint64 x;
   18485    GLuint64 y;
   18486    GLuint64 z;
   18487    GLuint64 w;
   18488 };
   18489 static inline void
   18490 _mesa_unmarshal_ProgramUniform4ui64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4ui64ARB *cmd)
   18491 {
   18492    const GLuint program = cmd->program;
   18493    const GLint location = cmd->location;
   18494    const GLuint64 x = cmd->x;
   18495    const GLuint64 y = cmd->y;
   18496    const GLuint64 z = cmd->z;
   18497    const GLuint64 w = cmd->w;
   18498    CALL_ProgramUniform4ui64ARB(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
   18499 }
   18500 static void GLAPIENTRY
   18501 _mesa_marshal_ProgramUniform4ui64ARB(GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z, GLuint64 w)
   18502 {
   18503    GET_CURRENT_CONTEXT(ctx);
   18504    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform4ui64ARB);
   18505    struct marshal_cmd_ProgramUniform4ui64ARB *cmd;
   18506    debug_print_marshal("ProgramUniform4ui64ARB");
   18507    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18508       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4ui64ARB, cmd_size);
   18509       cmd->program = program;
   18510       cmd->location = location;
   18511       cmd->x = x;
   18512       cmd->y = y;
   18513       cmd->z = z;
   18514       cmd->w = w;
   18515       _mesa_post_marshal_hook(ctx);
   18516       return;
   18517    }
   18518 
   18519    _mesa_glthread_finish(ctx);
   18520    debug_print_sync_fallback("ProgramUniform4ui64ARB");
   18521    CALL_ProgramUniform4ui64ARB(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
   18522 }
   18523 
   18524 
   18525 /* VertexAttrib1sNV: marshalled asynchronously */
   18526 struct marshal_cmd_VertexAttrib1sNV
   18527 {
   18528    struct marshal_cmd_base cmd_base;
   18529    GLuint index;
   18530    GLshort x;
   18531 };
   18532 static inline void
   18533 _mesa_unmarshal_VertexAttrib1sNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1sNV *cmd)
   18534 {
   18535    const GLuint index = cmd->index;
   18536    const GLshort x = cmd->x;
   18537    CALL_VertexAttrib1sNV(ctx->CurrentServerDispatch, (index, x));
   18538 }
   18539 static void GLAPIENTRY
   18540 _mesa_marshal_VertexAttrib1sNV(GLuint index, GLshort x)
   18541 {
   18542    GET_CURRENT_CONTEXT(ctx);
   18543    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib1sNV);
   18544    struct marshal_cmd_VertexAttrib1sNV *cmd;
   18545    debug_print_marshal("VertexAttrib1sNV");
   18546    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18547       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1sNV, cmd_size);
   18548       cmd->index = index;
   18549       cmd->x = x;
   18550       _mesa_post_marshal_hook(ctx);
   18551       return;
   18552    }
   18553 
   18554    _mesa_glthread_finish(ctx);
   18555    debug_print_sync_fallback("VertexAttrib1sNV");
   18556    CALL_VertexAttrib1sNV(ctx->CurrentServerDispatch, (index, x));
   18557 }
   18558 
   18559 
   18560 /* SignalSemaphoreEXT: marshalled synchronously */
   18561 static void GLAPIENTRY
   18562 _mesa_marshal_SignalSemaphoreEXT(GLuint semaphore, GLuint numBufferBarriers, const GLuint * buffers, GLuint numTextureBarriers, const GLuint * textures, const GLenum * dstLayouts)
   18563 {
   18564    GET_CURRENT_CONTEXT(ctx);
   18565    _mesa_glthread_finish(ctx);
   18566    debug_print_sync("SignalSemaphoreEXT");
   18567    CALL_SignalSemaphoreEXT(ctx->CurrentServerDispatch, (semaphore, numBufferBarriers, buffers, numTextureBarriers, textures, dstLayouts));
   18568 }
   18569 
   18570 
   18571 /* TextureBuffer: marshalled asynchronously */
   18572 struct marshal_cmd_TextureBuffer
   18573 {
   18574    struct marshal_cmd_base cmd_base;
   18575    GLuint texture;
   18576    GLenum internalformat;
   18577    GLuint buffer;
   18578 };
   18579 static inline void
   18580 _mesa_unmarshal_TextureBuffer(struct gl_context *ctx, const struct marshal_cmd_TextureBuffer *cmd)
   18581 {
   18582    const GLuint texture = cmd->texture;
   18583    const GLenum internalformat = cmd->internalformat;
   18584    const GLuint buffer = cmd->buffer;
   18585    CALL_TextureBuffer(ctx->CurrentServerDispatch, (texture, internalformat, buffer));
   18586 }
   18587 static void GLAPIENTRY
   18588 _mesa_marshal_TextureBuffer(GLuint texture, GLenum internalformat, GLuint buffer)
   18589 {
   18590    GET_CURRENT_CONTEXT(ctx);
   18591    size_t cmd_size = sizeof(struct marshal_cmd_TextureBuffer);
   18592    struct marshal_cmd_TextureBuffer *cmd;
   18593    debug_print_marshal("TextureBuffer");
   18594    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18595       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureBuffer, cmd_size);
   18596       cmd->texture = texture;
   18597       cmd->internalformat = internalformat;
   18598       cmd->buffer = buffer;
   18599       _mesa_post_marshal_hook(ctx);
   18600       return;
   18601    }
   18602 
   18603    _mesa_glthread_finish(ctx);
   18604    debug_print_sync_fallback("TextureBuffer");
   18605    CALL_TextureBuffer(ctx->CurrentServerDispatch, (texture, internalformat, buffer));
   18606 }
   18607 
   18608 
   18609 /* InitNames: marshalled asynchronously */
   18610 struct marshal_cmd_InitNames
   18611 {
   18612    struct marshal_cmd_base cmd_base;
   18613 };
   18614 static inline void
   18615 _mesa_unmarshal_InitNames(struct gl_context *ctx, const struct marshal_cmd_InitNames *cmd)
   18616 {
   18617    CALL_InitNames(ctx->CurrentServerDispatch, ());
   18618 }
   18619 static void GLAPIENTRY
   18620 _mesa_marshal_InitNames(void)
   18621 {
   18622    GET_CURRENT_CONTEXT(ctx);
   18623    size_t cmd_size = sizeof(struct marshal_cmd_InitNames);
   18624    struct marshal_cmd_InitNames *cmd;
   18625    debug_print_marshal("InitNames");
   18626    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18627       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InitNames, cmd_size);
   18628       (void) cmd;
   18629 
   18630       _mesa_post_marshal_hook(ctx);
   18631       return;
   18632    }
   18633 
   18634    _mesa_glthread_finish(ctx);
   18635    debug_print_sync_fallback("InitNames");
   18636    CALL_InitNames(ctx->CurrentServerDispatch, ());
   18637 }
   18638 
   18639 
   18640 /* Normal3sv: marshalled asynchronously */
   18641 struct marshal_cmd_Normal3sv
   18642 {
   18643    struct marshal_cmd_base cmd_base;
   18644    GLshort v[3];
   18645 };
   18646 static inline void
   18647 _mesa_unmarshal_Normal3sv(struct gl_context *ctx, const struct marshal_cmd_Normal3sv *cmd)
   18648 {
   18649    const GLshort * v = cmd->v;
   18650    CALL_Normal3sv(ctx->CurrentServerDispatch, (v));
   18651 }
   18652 static void GLAPIENTRY
   18653 _mesa_marshal_Normal3sv(const GLshort * v)
   18654 {
   18655    GET_CURRENT_CONTEXT(ctx);
   18656    size_t cmd_size = sizeof(struct marshal_cmd_Normal3sv);
   18657    struct marshal_cmd_Normal3sv *cmd;
   18658    debug_print_marshal("Normal3sv");
   18659    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18660       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Normal3sv, cmd_size);
   18661       memcpy(cmd->v, v, 6);
   18662       _mesa_post_marshal_hook(ctx);
   18663       return;
   18664    }
   18665 
   18666    _mesa_glthread_finish(ctx);
   18667    debug_print_sync_fallback("Normal3sv");
   18668    CALL_Normal3sv(ctx->CurrentServerDispatch, (v));
   18669 }
   18670 
   18671 
   18672 /* DeleteQueries: marshalled asynchronously */
   18673 struct marshal_cmd_DeleteQueries
   18674 {
   18675    struct marshal_cmd_base cmd_base;
   18676    GLsizei n;
   18677    /* Next safe_mul(n, 4) bytes are GLuint ids[n] */
   18678 };
   18679 static inline void
   18680 _mesa_unmarshal_DeleteQueries(struct gl_context *ctx, const struct marshal_cmd_DeleteQueries *cmd)
   18681 {
   18682    const GLsizei n = cmd->n;
   18683    const GLuint * ids;
   18684    const char *variable_data = (const char *) (cmd + 1);
   18685    ids = (const GLuint *) variable_data;
   18686    variable_data += n * 4;
   18687    CALL_DeleteQueries(ctx->CurrentServerDispatch, (n, ids));
   18688 }
   18689 static void GLAPIENTRY
   18690 _mesa_marshal_DeleteQueries(GLsizei n, const GLuint * ids)
   18691 {
   18692    GET_CURRENT_CONTEXT(ctx);
   18693    size_t cmd_size = sizeof(struct marshal_cmd_DeleteQueries) + safe_mul(n, 4);
   18694    struct marshal_cmd_DeleteQueries *cmd;
   18695    debug_print_marshal("DeleteQueries");
   18696    if (unlikely(safe_mul(n, 4) < 0)) {
   18697       goto fallback_to_sync;
   18698    }
   18699    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18700       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteQueries, cmd_size);
   18701       cmd->n = n;
   18702       char *variable_data = (char *) (cmd + 1);
   18703       memcpy(variable_data, ids, n * 4);
   18704       variable_data += n * 4;
   18705       _mesa_post_marshal_hook(ctx);
   18706       return;
   18707    }
   18708 
   18709 fallback_to_sync:
   18710    _mesa_glthread_finish(ctx);
   18711    debug_print_sync_fallback("DeleteQueries");
   18712    CALL_DeleteQueries(ctx->CurrentServerDispatch, (n, ids));
   18713 }
   18714 
   18715 
   18716 /* InvalidateFramebuffer: marshalled asynchronously */
   18717 struct marshal_cmd_InvalidateFramebuffer
   18718 {
   18719    struct marshal_cmd_base cmd_base;
   18720    GLenum target;
   18721    GLsizei numAttachments;
   18722    /* Next safe_mul(numAttachments, 4) bytes are GLenum attachments[numAttachments] */
   18723 };
   18724 static inline void
   18725 _mesa_unmarshal_InvalidateFramebuffer(struct gl_context *ctx, const struct marshal_cmd_InvalidateFramebuffer *cmd)
   18726 {
   18727    const GLenum target = cmd->target;
   18728    const GLsizei numAttachments = cmd->numAttachments;
   18729    const GLenum * attachments;
   18730    const char *variable_data = (const char *) (cmd + 1);
   18731    attachments = (const GLenum *) variable_data;
   18732    variable_data += numAttachments * 4;
   18733    CALL_InvalidateFramebuffer(ctx->CurrentServerDispatch, (target, numAttachments, attachments));
   18734 }
   18735 static void GLAPIENTRY
   18736 _mesa_marshal_InvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum * attachments)
   18737 {
   18738    GET_CURRENT_CONTEXT(ctx);
   18739    size_t cmd_size = sizeof(struct marshal_cmd_InvalidateFramebuffer) + safe_mul(numAttachments, 4);
   18740    struct marshal_cmd_InvalidateFramebuffer *cmd;
   18741    debug_print_marshal("InvalidateFramebuffer");
   18742    if (unlikely(safe_mul(numAttachments, 4) < 0)) {
   18743       goto fallback_to_sync;
   18744    }
   18745    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18746       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InvalidateFramebuffer, cmd_size);
   18747       cmd->target = target;
   18748       cmd->numAttachments = numAttachments;
   18749       char *variable_data = (char *) (cmd + 1);
   18750       memcpy(variable_data, attachments, numAttachments * 4);
   18751       variable_data += numAttachments * 4;
   18752       _mesa_post_marshal_hook(ctx);
   18753       return;
   18754    }
   18755 
   18756 fallback_to_sync:
   18757    _mesa_glthread_finish(ctx);
   18758    debug_print_sync_fallback("InvalidateFramebuffer");
   18759    CALL_InvalidateFramebuffer(ctx->CurrentServerDispatch, (target, numAttachments, attachments));
   18760 }
   18761 
   18762 
   18763 /* Hint: marshalled asynchronously */
   18764 struct marshal_cmd_Hint
   18765 {
   18766    struct marshal_cmd_base cmd_base;
   18767    GLenum target;
   18768    GLenum mode;
   18769 };
   18770 static inline void
   18771 _mesa_unmarshal_Hint(struct gl_context *ctx, const struct marshal_cmd_Hint *cmd)
   18772 {
   18773    const GLenum target = cmd->target;
   18774    const GLenum mode = cmd->mode;
   18775    CALL_Hint(ctx->CurrentServerDispatch, (target, mode));
   18776 }
   18777 static void GLAPIENTRY
   18778 _mesa_marshal_Hint(GLenum target, GLenum mode)
   18779 {
   18780    GET_CURRENT_CONTEXT(ctx);
   18781    size_t cmd_size = sizeof(struct marshal_cmd_Hint);
   18782    struct marshal_cmd_Hint *cmd;
   18783    debug_print_marshal("Hint");
   18784    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18785       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Hint, cmd_size);
   18786       cmd->target = target;
   18787       cmd->mode = mode;
   18788       _mesa_post_marshal_hook(ctx);
   18789       return;
   18790    }
   18791 
   18792    _mesa_glthread_finish(ctx);
   18793    debug_print_sync_fallback("Hint");
   18794    CALL_Hint(ctx->CurrentServerDispatch, (target, mode));
   18795 }
   18796 
   18797 
   18798 /* MemoryBarrier: marshalled asynchronously */
   18799 struct marshal_cmd_MemoryBarrier
   18800 {
   18801    struct marshal_cmd_base cmd_base;
   18802    GLbitfield barriers;
   18803 };
   18804 static inline void
   18805 _mesa_unmarshal_MemoryBarrier(struct gl_context *ctx, const struct marshal_cmd_MemoryBarrier *cmd)
   18806 {
   18807    const GLbitfield barriers = cmd->barriers;
   18808    CALL_MemoryBarrier(ctx->CurrentServerDispatch, (barriers));
   18809 }
   18810 static void GLAPIENTRY
   18811 _mesa_marshal_MemoryBarrier(GLbitfield barriers)
   18812 {
   18813    GET_CURRENT_CONTEXT(ctx);
   18814    size_t cmd_size = sizeof(struct marshal_cmd_MemoryBarrier);
   18815    struct marshal_cmd_MemoryBarrier *cmd;
   18816    debug_print_marshal("MemoryBarrier");
   18817    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18818       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MemoryBarrier, cmd_size);
   18819       cmd->barriers = barriers;
   18820       _mesa_post_marshal_hook(ctx);
   18821       return;
   18822    }
   18823 
   18824    _mesa_glthread_finish(ctx);
   18825    debug_print_sync_fallback("MemoryBarrier");
   18826    CALL_MemoryBarrier(ctx->CurrentServerDispatch, (barriers));
   18827 }
   18828 
   18829 
   18830 /* CopyColorSubTable: marshalled asynchronously */
   18831 struct marshal_cmd_CopyColorSubTable
   18832 {
   18833    struct marshal_cmd_base cmd_base;
   18834    GLenum target;
   18835    GLsizei start;
   18836    GLint x;
   18837    GLint y;
   18838    GLsizei width;
   18839 };
   18840 static inline void
   18841 _mesa_unmarshal_CopyColorSubTable(struct gl_context *ctx, const struct marshal_cmd_CopyColorSubTable *cmd)
   18842 {
   18843    const GLenum target = cmd->target;
   18844    const GLsizei start = cmd->start;
   18845    const GLint x = cmd->x;
   18846    const GLint y = cmd->y;
   18847    const GLsizei width = cmd->width;
   18848    CALL_CopyColorSubTable(ctx->CurrentServerDispatch, (target, start, x, y, width));
   18849 }
   18850 static void GLAPIENTRY
   18851 _mesa_marshal_CopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width)
   18852 {
   18853    GET_CURRENT_CONTEXT(ctx);
   18854    size_t cmd_size = sizeof(struct marshal_cmd_CopyColorSubTable);
   18855    struct marshal_cmd_CopyColorSubTable *cmd;
   18856    debug_print_marshal("CopyColorSubTable");
   18857    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18858       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyColorSubTable, cmd_size);
   18859       cmd->target = target;
   18860       cmd->start = start;
   18861       cmd->x = x;
   18862       cmd->y = y;
   18863       cmd->width = width;
   18864       _mesa_post_marshal_hook(ctx);
   18865       return;
   18866    }
   18867 
   18868    _mesa_glthread_finish(ctx);
   18869    debug_print_sync_fallback("CopyColorSubTable");
   18870    CALL_CopyColorSubTable(ctx->CurrentServerDispatch, (target, start, x, y, width));
   18871 }
   18872 
   18873 
   18874 /* GetObjectParameterfvARB: marshalled synchronously */
   18875 static void GLAPIENTRY
   18876 _mesa_marshal_GetObjectParameterfvARB(GLhandleARB obj, GLenum pname, GLfloat * params)
   18877 {
   18878    GET_CURRENT_CONTEXT(ctx);
   18879    _mesa_glthread_finish(ctx);
   18880    debug_print_sync("GetObjectParameterfvARB");
   18881    CALL_GetObjectParameterfvARB(ctx->CurrentServerDispatch, (obj, pname, params));
   18882 }
   18883 
   18884 
   18885 /* GetTexEnvxv: marshalled synchronously */
   18886 static void GLAPIENTRY
   18887 _mesa_marshal_GetTexEnvxv(GLenum target, GLenum pname, GLfixed * params)
   18888 {
   18889    GET_CURRENT_CONTEXT(ctx);
   18890    _mesa_glthread_finish(ctx);
   18891    debug_print_sync("GetTexEnvxv");
   18892    CALL_GetTexEnvxv(ctx->CurrentServerDispatch, (target, pname, params));
   18893 }
   18894 
   18895 
   18896 /* DrawTexsvOES: marshalled asynchronously */
   18897 struct marshal_cmd_DrawTexsvOES
   18898 {
   18899    struct marshal_cmd_base cmd_base;
   18900    GLshort coords[5];
   18901 };
   18902 static inline void
   18903 _mesa_unmarshal_DrawTexsvOES(struct gl_context *ctx, const struct marshal_cmd_DrawTexsvOES *cmd)
   18904 {
   18905    const GLshort * coords = cmd->coords;
   18906    CALL_DrawTexsvOES(ctx->CurrentServerDispatch, (coords));
   18907 }
   18908 static void GLAPIENTRY
   18909 _mesa_marshal_DrawTexsvOES(const GLshort * coords)
   18910 {
   18911    GET_CURRENT_CONTEXT(ctx);
   18912    size_t cmd_size = sizeof(struct marshal_cmd_DrawTexsvOES);
   18913    struct marshal_cmd_DrawTexsvOES *cmd;
   18914    debug_print_marshal("DrawTexsvOES");
   18915    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18916       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTexsvOES, cmd_size);
   18917       memcpy(cmd->coords, coords, 10);
   18918       _mesa_post_marshal_hook(ctx);
   18919       return;
   18920    }
   18921 
   18922    _mesa_glthread_finish(ctx);
   18923    debug_print_sync_fallback("DrawTexsvOES");
   18924    CALL_DrawTexsvOES(ctx->CurrentServerDispatch, (coords));
   18925 }
   18926 
   18927 
   18928 /* Disable: marshalled asynchronously */
   18929 struct marshal_cmd_Disable
   18930 {
   18931    struct marshal_cmd_base cmd_base;
   18932    GLenum cap;
   18933 };
   18934 static inline void
   18935 _mesa_unmarshal_Disable(struct gl_context *ctx, const struct marshal_cmd_Disable *cmd)
   18936 {
   18937    const GLenum cap = cmd->cap;
   18938    CALL_Disable(ctx->CurrentServerDispatch, (cap));
   18939 }
   18940 static void GLAPIENTRY
   18941 _mesa_marshal_Disable(GLenum cap)
   18942 {
   18943    GET_CURRENT_CONTEXT(ctx);
   18944    size_t cmd_size = sizeof(struct marshal_cmd_Disable);
   18945    struct marshal_cmd_Disable *cmd;
   18946    debug_print_marshal("Disable");
   18947    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18948       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Disable, cmd_size);
   18949       cmd->cap = cap;
   18950       _mesa_post_marshal_hook(ctx);
   18951       return;
   18952    }
   18953 
   18954    _mesa_glthread_finish(ctx);
   18955    debug_print_sync_fallback("Disable");
   18956    CALL_Disable(ctx->CurrentServerDispatch, (cap));
   18957 }
   18958 
   18959 
   18960 /* ClearColor: marshalled asynchronously */
   18961 struct marshal_cmd_ClearColor
   18962 {
   18963    struct marshal_cmd_base cmd_base;
   18964    GLclampf red;
   18965    GLclampf green;
   18966    GLclampf blue;
   18967    GLclampf alpha;
   18968 };
   18969 static inline void
   18970 _mesa_unmarshal_ClearColor(struct gl_context *ctx, const struct marshal_cmd_ClearColor *cmd)
   18971 {
   18972    const GLclampf red = cmd->red;
   18973    const GLclampf green = cmd->green;
   18974    const GLclampf blue = cmd->blue;
   18975    const GLclampf alpha = cmd->alpha;
   18976    CALL_ClearColor(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   18977 }
   18978 static void GLAPIENTRY
   18979 _mesa_marshal_ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
   18980 {
   18981    GET_CURRENT_CONTEXT(ctx);
   18982    size_t cmd_size = sizeof(struct marshal_cmd_ClearColor);
   18983    struct marshal_cmd_ClearColor *cmd;
   18984    debug_print_marshal("ClearColor");
   18985    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   18986       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearColor, cmd_size);
   18987       cmd->red = red;
   18988       cmd->green = green;
   18989       cmd->blue = blue;
   18990       cmd->alpha = alpha;
   18991       _mesa_post_marshal_hook(ctx);
   18992       return;
   18993    }
   18994 
   18995    _mesa_glthread_finish(ctx);
   18996    debug_print_sync_fallback("ClearColor");
   18997    CALL_ClearColor(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   18998 }
   18999 
   19000 
   19001 /* GetTextureParameterIuiv: marshalled synchronously */
   19002 static void GLAPIENTRY
   19003 _mesa_marshal_GetTextureParameterIuiv(GLuint texture, GLenum pname, GLuint * params)
   19004 {
   19005    GET_CURRENT_CONTEXT(ctx);
   19006    _mesa_glthread_finish(ctx);
   19007    debug_print_sync("GetTextureParameterIuiv");
   19008    CALL_GetTextureParameterIuiv(ctx->CurrentServerDispatch, (texture, pname, params));
   19009 }
   19010 
   19011 
   19012 /* RasterPos4iv: marshalled asynchronously */
   19013 struct marshal_cmd_RasterPos4iv
   19014 {
   19015    struct marshal_cmd_base cmd_base;
   19016    GLint v[4];
   19017 };
   19018 static inline void
   19019 _mesa_unmarshal_RasterPos4iv(struct gl_context *ctx, const struct marshal_cmd_RasterPos4iv *cmd)
   19020 {
   19021    const GLint * v = cmd->v;
   19022    CALL_RasterPos4iv(ctx->CurrentServerDispatch, (v));
   19023 }
   19024 static void GLAPIENTRY
   19025 _mesa_marshal_RasterPos4iv(const GLint * v)
   19026 {
   19027    GET_CURRENT_CONTEXT(ctx);
   19028    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos4iv);
   19029    struct marshal_cmd_RasterPos4iv *cmd;
   19030    debug_print_marshal("RasterPos4iv");
   19031    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19032       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos4iv, cmd_size);
   19033       memcpy(cmd->v, v, 16);
   19034       _mesa_post_marshal_hook(ctx);
   19035       return;
   19036    }
   19037 
   19038    _mesa_glthread_finish(ctx);
   19039    debug_print_sync_fallback("RasterPos4iv");
   19040    CALL_RasterPos4iv(ctx->CurrentServerDispatch, (v));
   19041 }
   19042 
   19043 
   19044 /* VDPAUIsSurfaceNV: marshalled synchronously */
   19045 static GLboolean GLAPIENTRY
   19046 _mesa_marshal_VDPAUIsSurfaceNV(GLintptr surface)
   19047 {
   19048    GET_CURRENT_CONTEXT(ctx);
   19049    _mesa_glthread_finish(ctx);
   19050    debug_print_sync("VDPAUIsSurfaceNV");
   19051    return CALL_VDPAUIsSurfaceNV(ctx->CurrentServerDispatch, (surface));
   19052 }
   19053 
   19054 
   19055 /* ProgramUniformMatrix2x3fv: marshalled asynchronously */
   19056 struct marshal_cmd_ProgramUniformMatrix2x3fv
   19057 {
   19058    struct marshal_cmd_base cmd_base;
   19059    GLuint program;
   19060    GLint location;
   19061    GLsizei count;
   19062    GLboolean transpose;
   19063    /* Next safe_mul(count, 24) bytes are GLfloat value[count][6] */
   19064 };
   19065 static inline void
   19066 _mesa_unmarshal_ProgramUniformMatrix2x3fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix2x3fv *cmd)
   19067 {
   19068    const GLuint program = cmd->program;
   19069    const GLint location = cmd->location;
   19070    const GLsizei count = cmd->count;
   19071    const GLboolean transpose = cmd->transpose;
   19072    const GLfloat * value;
   19073    const char *variable_data = (const char *) (cmd + 1);
   19074    value = (const GLfloat *) variable_data;
   19075    variable_data += count * 24;
   19076    CALL_ProgramUniformMatrix2x3fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   19077 }
   19078 static void GLAPIENTRY
   19079 _mesa_marshal_ProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   19080 {
   19081    GET_CURRENT_CONTEXT(ctx);
   19082    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix2x3fv) + safe_mul(count, 24);
   19083    struct marshal_cmd_ProgramUniformMatrix2x3fv *cmd;
   19084    debug_print_marshal("ProgramUniformMatrix2x3fv");
   19085    if (unlikely(safe_mul(count, 24) < 0)) {
   19086       goto fallback_to_sync;
   19087    }
   19088    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19089       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix2x3fv, cmd_size);
   19090       cmd->program = program;
   19091       cmd->location = location;
   19092       cmd->count = count;
   19093       cmd->transpose = transpose;
   19094       char *variable_data = (char *) (cmd + 1);
   19095       memcpy(variable_data, value, count * 24);
   19096       variable_data += count * 24;
   19097       _mesa_post_marshal_hook(ctx);
   19098       return;
   19099    }
   19100 
   19101 fallback_to_sync:
   19102    _mesa_glthread_finish(ctx);
   19103    debug_print_sync_fallback("ProgramUniformMatrix2x3fv");
   19104    CALL_ProgramUniformMatrix2x3fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   19105 }
   19106 
   19107 
   19108 /* BindVertexBuffer: marshalled asynchronously */
   19109 struct marshal_cmd_BindVertexBuffer
   19110 {
   19111    struct marshal_cmd_base cmd_base;
   19112    GLuint bindingindex;
   19113    GLuint buffer;
   19114    GLintptr offset;
   19115    GLsizei stride;
   19116 };
   19117 static inline void
   19118 _mesa_unmarshal_BindVertexBuffer(struct gl_context *ctx, const struct marshal_cmd_BindVertexBuffer *cmd)
   19119 {
   19120    const GLuint bindingindex = cmd->bindingindex;
   19121    const GLuint buffer = cmd->buffer;
   19122    const GLintptr offset = cmd->offset;
   19123    const GLsizei stride = cmd->stride;
   19124    CALL_BindVertexBuffer(ctx->CurrentServerDispatch, (bindingindex, buffer, offset, stride));
   19125 }
   19126 static void GLAPIENTRY
   19127 _mesa_marshal_BindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride)
   19128 {
   19129    GET_CURRENT_CONTEXT(ctx);
   19130    size_t cmd_size = sizeof(struct marshal_cmd_BindVertexBuffer);
   19131    struct marshal_cmd_BindVertexBuffer *cmd;
   19132    debug_print_marshal("BindVertexBuffer");
   19133    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19134       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindVertexBuffer, cmd_size);
   19135       cmd->bindingindex = bindingindex;
   19136       cmd->buffer = buffer;
   19137       cmd->offset = offset;
   19138       cmd->stride = stride;
   19139       _mesa_post_marshal_hook(ctx);
   19140       return;
   19141    }
   19142 
   19143    _mesa_glthread_finish(ctx);
   19144    debug_print_sync_fallback("BindVertexBuffer");
   19145    CALL_BindVertexBuffer(ctx->CurrentServerDispatch, (bindingindex, buffer, offset, stride));
   19146 }
   19147 
   19148 
   19149 /* RasterPos4i: marshalled asynchronously */
   19150 struct marshal_cmd_RasterPos4i
   19151 {
   19152    struct marshal_cmd_base cmd_base;
   19153    GLint x;
   19154    GLint y;
   19155    GLint z;
   19156    GLint w;
   19157 };
   19158 static inline void
   19159 _mesa_unmarshal_RasterPos4i(struct gl_context *ctx, const struct marshal_cmd_RasterPos4i *cmd)
   19160 {
   19161    const GLint x = cmd->x;
   19162    const GLint y = cmd->y;
   19163    const GLint z = cmd->z;
   19164    const GLint w = cmd->w;
   19165    CALL_RasterPos4i(ctx->CurrentServerDispatch, (x, y, z, w));
   19166 }
   19167 static void GLAPIENTRY
   19168 _mesa_marshal_RasterPos4i(GLint x, GLint y, GLint z, GLint w)
   19169 {
   19170    GET_CURRENT_CONTEXT(ctx);
   19171    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos4i);
   19172    struct marshal_cmd_RasterPos4i *cmd;
   19173    debug_print_marshal("RasterPos4i");
   19174    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19175       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos4i, cmd_size);
   19176       cmd->x = x;
   19177       cmd->y = y;
   19178       cmd->z = z;
   19179       cmd->w = w;
   19180       _mesa_post_marshal_hook(ctx);
   19181       return;
   19182    }
   19183 
   19184    _mesa_glthread_finish(ctx);
   19185    debug_print_sync_fallback("RasterPos4i");
   19186    CALL_RasterPos4i(ctx->CurrentServerDispatch, (x, y, z, w));
   19187 }
   19188 
   19189 
   19190 /* RasterPos4d: marshalled asynchronously */
   19191 struct marshal_cmd_RasterPos4d
   19192 {
   19193    struct marshal_cmd_base cmd_base;
   19194    GLdouble x;
   19195    GLdouble y;
   19196    GLdouble z;
   19197    GLdouble w;
   19198 };
   19199 static inline void
   19200 _mesa_unmarshal_RasterPos4d(struct gl_context *ctx, const struct marshal_cmd_RasterPos4d *cmd)
   19201 {
   19202    const GLdouble x = cmd->x;
   19203    const GLdouble y = cmd->y;
   19204    const GLdouble z = cmd->z;
   19205    const GLdouble w = cmd->w;
   19206    CALL_RasterPos4d(ctx->CurrentServerDispatch, (x, y, z, w));
   19207 }
   19208 static void GLAPIENTRY
   19209 _mesa_marshal_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
   19210 {
   19211    GET_CURRENT_CONTEXT(ctx);
   19212    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos4d);
   19213    struct marshal_cmd_RasterPos4d *cmd;
   19214    debug_print_marshal("RasterPos4d");
   19215    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19216       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos4d, cmd_size);
   19217       cmd->x = x;
   19218       cmd->y = y;
   19219       cmd->z = z;
   19220       cmd->w = w;
   19221       _mesa_post_marshal_hook(ctx);
   19222       return;
   19223    }
   19224 
   19225    _mesa_glthread_finish(ctx);
   19226    debug_print_sync_fallback("RasterPos4d");
   19227    CALL_RasterPos4d(ctx->CurrentServerDispatch, (x, y, z, w));
   19228 }
   19229 
   19230 
   19231 /* RasterPos4f: marshalled asynchronously */
   19232 struct marshal_cmd_RasterPos4f
   19233 {
   19234    struct marshal_cmd_base cmd_base;
   19235    GLfloat x;
   19236    GLfloat y;
   19237    GLfloat z;
   19238    GLfloat w;
   19239 };
   19240 static inline void
   19241 _mesa_unmarshal_RasterPos4f(struct gl_context *ctx, const struct marshal_cmd_RasterPos4f *cmd)
   19242 {
   19243    const GLfloat x = cmd->x;
   19244    const GLfloat y = cmd->y;
   19245    const GLfloat z = cmd->z;
   19246    const GLfloat w = cmd->w;
   19247    CALL_RasterPos4f(ctx->CurrentServerDispatch, (x, y, z, w));
   19248 }
   19249 static void GLAPIENTRY
   19250 _mesa_marshal_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w)
   19251 {
   19252    GET_CURRENT_CONTEXT(ctx);
   19253    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos4f);
   19254    struct marshal_cmd_RasterPos4f *cmd;
   19255    debug_print_marshal("RasterPos4f");
   19256    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19257       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos4f, cmd_size);
   19258       cmd->x = x;
   19259       cmd->y = y;
   19260       cmd->z = z;
   19261       cmd->w = w;
   19262       _mesa_post_marshal_hook(ctx);
   19263       return;
   19264    }
   19265 
   19266    _mesa_glthread_finish(ctx);
   19267    debug_print_sync_fallback("RasterPos4f");
   19268    CALL_RasterPos4f(ctx->CurrentServerDispatch, (x, y, z, w));
   19269 }
   19270 
   19271 
   19272 /* VDPAUMapSurfacesNV: marshalled synchronously */
   19273 static void GLAPIENTRY
   19274 _mesa_marshal_VDPAUMapSurfacesNV(GLsizei numSurfaces, const GLintptr * surfaces)
   19275 {
   19276    GET_CURRENT_CONTEXT(ctx);
   19277    _mesa_glthread_finish(ctx);
   19278    debug_print_sync("VDPAUMapSurfacesNV");
   19279    CALL_VDPAUMapSurfacesNV(ctx->CurrentServerDispatch, (numSurfaces, surfaces));
   19280 }
   19281 
   19282 
   19283 /* GetQueryIndexediv: marshalled synchronously */
   19284 static void GLAPIENTRY
   19285 _mesa_marshal_GetQueryIndexediv(GLenum target, GLuint index, GLenum pname, GLint * params)
   19286 {
   19287    GET_CURRENT_CONTEXT(ctx);
   19288    _mesa_glthread_finish(ctx);
   19289    debug_print_sync("GetQueryIndexediv");
   19290    CALL_GetQueryIndexediv(ctx->CurrentServerDispatch, (target, index, pname, params));
   19291 }
   19292 
   19293 
   19294 /* RasterPos3dv: marshalled asynchronously */
   19295 struct marshal_cmd_RasterPos3dv
   19296 {
   19297    struct marshal_cmd_base cmd_base;
   19298    GLdouble v[3];
   19299 };
   19300 static inline void
   19301 _mesa_unmarshal_RasterPos3dv(struct gl_context *ctx, const struct marshal_cmd_RasterPos3dv *cmd)
   19302 {
   19303    const GLdouble * v = cmd->v;
   19304    CALL_RasterPos3dv(ctx->CurrentServerDispatch, (v));
   19305 }
   19306 static void GLAPIENTRY
   19307 _mesa_marshal_RasterPos3dv(const GLdouble * v)
   19308 {
   19309    GET_CURRENT_CONTEXT(ctx);
   19310    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos3dv);
   19311    struct marshal_cmd_RasterPos3dv *cmd;
   19312    debug_print_marshal("RasterPos3dv");
   19313    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19314       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos3dv, cmd_size);
   19315       memcpy(cmd->v, v, 24);
   19316       _mesa_post_marshal_hook(ctx);
   19317       return;
   19318    }
   19319 
   19320    _mesa_glthread_finish(ctx);
   19321    debug_print_sync_fallback("RasterPos3dv");
   19322    CALL_RasterPos3dv(ctx->CurrentServerDispatch, (v));
   19323 }
   19324 
   19325 
   19326 /* GetProgramiv: marshalled synchronously */
   19327 static void GLAPIENTRY
   19328 _mesa_marshal_GetProgramiv(GLuint program, GLenum pname, GLint * params)
   19329 {
   19330    GET_CURRENT_CONTEXT(ctx);
   19331    _mesa_glthread_finish(ctx);
   19332    debug_print_sync("GetProgramiv");
   19333    CALL_GetProgramiv(ctx->CurrentServerDispatch, (program, pname, params));
   19334 }
   19335 
   19336 
   19337 /* TexCoord1iv: marshalled asynchronously */
   19338 struct marshal_cmd_TexCoord1iv
   19339 {
   19340    struct marshal_cmd_base cmd_base;
   19341    GLint v[1];
   19342 };
   19343 static inline void
   19344 _mesa_unmarshal_TexCoord1iv(struct gl_context *ctx, const struct marshal_cmd_TexCoord1iv *cmd)
   19345 {
   19346    const GLint * v = cmd->v;
   19347    CALL_TexCoord1iv(ctx->CurrentServerDispatch, (v));
   19348 }
   19349 static void GLAPIENTRY
   19350 _mesa_marshal_TexCoord1iv(const GLint * v)
   19351 {
   19352    GET_CURRENT_CONTEXT(ctx);
   19353    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord1iv);
   19354    struct marshal_cmd_TexCoord1iv *cmd;
   19355    debug_print_marshal("TexCoord1iv");
   19356    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19357       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord1iv, cmd_size);
   19358       memcpy(cmd->v, v, 4);
   19359       _mesa_post_marshal_hook(ctx);
   19360       return;
   19361    }
   19362 
   19363    _mesa_glthread_finish(ctx);
   19364    debug_print_sync_fallback("TexCoord1iv");
   19365    CALL_TexCoord1iv(ctx->CurrentServerDispatch, (v));
   19366 }
   19367 
   19368 
   19369 /* RasterPos4s: marshalled asynchronously */
   19370 struct marshal_cmd_RasterPos4s
   19371 {
   19372    struct marshal_cmd_base cmd_base;
   19373    GLshort x;
   19374    GLshort y;
   19375    GLshort z;
   19376    GLshort w;
   19377 };
   19378 static inline void
   19379 _mesa_unmarshal_RasterPos4s(struct gl_context *ctx, const struct marshal_cmd_RasterPos4s *cmd)
   19380 {
   19381    const GLshort x = cmd->x;
   19382    const GLshort y = cmd->y;
   19383    const GLshort z = cmd->z;
   19384    const GLshort w = cmd->w;
   19385    CALL_RasterPos4s(ctx->CurrentServerDispatch, (x, y, z, w));
   19386 }
   19387 static void GLAPIENTRY
   19388 _mesa_marshal_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w)
   19389 {
   19390    GET_CURRENT_CONTEXT(ctx);
   19391    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos4s);
   19392    struct marshal_cmd_RasterPos4s *cmd;
   19393    debug_print_marshal("RasterPos4s");
   19394    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19395       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos4s, cmd_size);
   19396       cmd->x = x;
   19397       cmd->y = y;
   19398       cmd->z = z;
   19399       cmd->w = w;
   19400       _mesa_post_marshal_hook(ctx);
   19401       return;
   19402    }
   19403 
   19404    _mesa_glthread_finish(ctx);
   19405    debug_print_sync_fallback("RasterPos4s");
   19406    CALL_RasterPos4s(ctx->CurrentServerDispatch, (x, y, z, w));
   19407 }
   19408 
   19409 
   19410 /* VertexAttrib3dv: marshalled asynchronously */
   19411 struct marshal_cmd_VertexAttrib3dv
   19412 {
   19413    struct marshal_cmd_base cmd_base;
   19414    GLuint index;
   19415    GLdouble v[3];
   19416 };
   19417 static inline void
   19418 _mesa_unmarshal_VertexAttrib3dv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3dv *cmd)
   19419 {
   19420    const GLuint index = cmd->index;
   19421    const GLdouble * v = cmd->v;
   19422    CALL_VertexAttrib3dv(ctx->CurrentServerDispatch, (index, v));
   19423 }
   19424 static void GLAPIENTRY
   19425 _mesa_marshal_VertexAttrib3dv(GLuint index, const GLdouble * v)
   19426 {
   19427    GET_CURRENT_CONTEXT(ctx);
   19428    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib3dv);
   19429    struct marshal_cmd_VertexAttrib3dv *cmd;
   19430    debug_print_marshal("VertexAttrib3dv");
   19431    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19432       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3dv, cmd_size);
   19433       cmd->index = index;
   19434       memcpy(cmd->v, v, 24);
   19435       _mesa_post_marshal_hook(ctx);
   19436       return;
   19437    }
   19438 
   19439    _mesa_glthread_finish(ctx);
   19440    debug_print_sync_fallback("VertexAttrib3dv");
   19441    CALL_VertexAttrib3dv(ctx->CurrentServerDispatch, (index, v));
   19442 }
   19443 
   19444 
   19445 /* Histogram: marshalled asynchronously */
   19446 struct marshal_cmd_Histogram
   19447 {
   19448    struct marshal_cmd_base cmd_base;
   19449    GLenum target;
   19450    GLsizei width;
   19451    GLenum internalformat;
   19452    GLboolean sink;
   19453 };
   19454 static inline void
   19455 _mesa_unmarshal_Histogram(struct gl_context *ctx, const struct marshal_cmd_Histogram *cmd)
   19456 {
   19457    const GLenum target = cmd->target;
   19458    const GLsizei width = cmd->width;
   19459    const GLenum internalformat = cmd->internalformat;
   19460    const GLboolean sink = cmd->sink;
   19461    CALL_Histogram(ctx->CurrentServerDispatch, (target, width, internalformat, sink));
   19462 }
   19463 static void GLAPIENTRY
   19464 _mesa_marshal_Histogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink)
   19465 {
   19466    GET_CURRENT_CONTEXT(ctx);
   19467    size_t cmd_size = sizeof(struct marshal_cmd_Histogram);
   19468    struct marshal_cmd_Histogram *cmd;
   19469    debug_print_marshal("Histogram");
   19470    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19471       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Histogram, cmd_size);
   19472       cmd->target = target;
   19473       cmd->width = width;
   19474       cmd->internalformat = internalformat;
   19475       cmd->sink = sink;
   19476       _mesa_post_marshal_hook(ctx);
   19477       return;
   19478    }
   19479 
   19480    _mesa_glthread_finish(ctx);
   19481    debug_print_sync_fallback("Histogram");
   19482    CALL_Histogram(ctx->CurrentServerDispatch, (target, width, internalformat, sink));
   19483 }
   19484 
   19485 
   19486 /* Uniform2fv: marshalled asynchronously */
   19487 struct marshal_cmd_Uniform2fv
   19488 {
   19489    struct marshal_cmd_base cmd_base;
   19490    GLint location;
   19491    GLsizei count;
   19492    /* Next safe_mul(count, 8) bytes are GLfloat value[count][2] */
   19493 };
   19494 static inline void
   19495 _mesa_unmarshal_Uniform2fv(struct gl_context *ctx, const struct marshal_cmd_Uniform2fv *cmd)
   19496 {
   19497    const GLint location = cmd->location;
   19498    const GLsizei count = cmd->count;
   19499    const GLfloat * value;
   19500    const char *variable_data = (const char *) (cmd + 1);
   19501    value = (const GLfloat *) variable_data;
   19502    variable_data += count * 8;
   19503    CALL_Uniform2fv(ctx->CurrentServerDispatch, (location, count, value));
   19504 }
   19505 static void GLAPIENTRY
   19506 _mesa_marshal_Uniform2fv(GLint location, GLsizei count, const GLfloat * value)
   19507 {
   19508    GET_CURRENT_CONTEXT(ctx);
   19509    size_t cmd_size = sizeof(struct marshal_cmd_Uniform2fv) + safe_mul(count, 8);
   19510    struct marshal_cmd_Uniform2fv *cmd;
   19511    debug_print_marshal("Uniform2fv");
   19512    if (unlikely(safe_mul(count, 8) < 0)) {
   19513       goto fallback_to_sync;
   19514    }
   19515    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19516       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2fv, cmd_size);
   19517       cmd->location = location;
   19518       cmd->count = count;
   19519       char *variable_data = (char *) (cmd + 1);
   19520       memcpy(variable_data, value, count * 8);
   19521       variable_data += count * 8;
   19522       _mesa_post_marshal_hook(ctx);
   19523       return;
   19524    }
   19525 
   19526 fallback_to_sync:
   19527    _mesa_glthread_finish(ctx);
   19528    debug_print_sync_fallback("Uniform2fv");
   19529    CALL_Uniform2fv(ctx->CurrentServerDispatch, (location, count, value));
   19530 }
   19531 
   19532 
   19533 /* ProgramUniformMatrix3x4dv: marshalled asynchronously */
   19534 struct marshal_cmd_ProgramUniformMatrix3x4dv
   19535 {
   19536    struct marshal_cmd_base cmd_base;
   19537    GLuint program;
   19538    GLint location;
   19539    GLsizei count;
   19540    GLboolean transpose;
   19541    /* Next safe_mul(count, 96) bytes are GLdouble value[count][12] */
   19542 };
   19543 static inline void
   19544 _mesa_unmarshal_ProgramUniformMatrix3x4dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix3x4dv *cmd)
   19545 {
   19546    const GLuint program = cmd->program;
   19547    const GLint location = cmd->location;
   19548    const GLsizei count = cmd->count;
   19549    const GLboolean transpose = cmd->transpose;
   19550    const GLdouble * value;
   19551    const char *variable_data = (const char *) (cmd + 1);
   19552    value = (const GLdouble *) variable_data;
   19553    variable_data += count * 96;
   19554    CALL_ProgramUniformMatrix3x4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   19555 }
   19556 static void GLAPIENTRY
   19557 _mesa_marshal_ProgramUniformMatrix3x4dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   19558 {
   19559    GET_CURRENT_CONTEXT(ctx);
   19560    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix3x4dv) + safe_mul(count, 96);
   19561    struct marshal_cmd_ProgramUniformMatrix3x4dv *cmd;
   19562    debug_print_marshal("ProgramUniformMatrix3x4dv");
   19563    if (unlikely(safe_mul(count, 96) < 0)) {
   19564       goto fallback_to_sync;
   19565    }
   19566    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19567       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix3x4dv, cmd_size);
   19568       cmd->program = program;
   19569       cmd->location = location;
   19570       cmd->count = count;
   19571       cmd->transpose = transpose;
   19572       char *variable_data = (char *) (cmd + 1);
   19573       memcpy(variable_data, value, count * 96);
   19574       variable_data += count * 96;
   19575       _mesa_post_marshal_hook(ctx);
   19576       return;
   19577    }
   19578 
   19579 fallback_to_sync:
   19580    _mesa_glthread_finish(ctx);
   19581    debug_print_sync_fallback("ProgramUniformMatrix3x4dv");
   19582    CALL_ProgramUniformMatrix3x4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   19583 }
   19584 
   19585 
   19586 /* DrawBuffers: marshalled asynchronously */
   19587 struct marshal_cmd_DrawBuffers
   19588 {
   19589    struct marshal_cmd_base cmd_base;
   19590    GLsizei n;
   19591    /* Next safe_mul(n, 4) bytes are GLenum bufs[n] */
   19592 };
   19593 static inline void
   19594 _mesa_unmarshal_DrawBuffers(struct gl_context *ctx, const struct marshal_cmd_DrawBuffers *cmd)
   19595 {
   19596    const GLsizei n = cmd->n;
   19597    const GLenum * bufs;
   19598    const char *variable_data = (const char *) (cmd + 1);
   19599    bufs = (const GLenum *) variable_data;
   19600    variable_data += n * 4;
   19601    CALL_DrawBuffers(ctx->CurrentServerDispatch, (n, bufs));
   19602 }
   19603 static void GLAPIENTRY
   19604 _mesa_marshal_DrawBuffers(GLsizei n, const GLenum * bufs)
   19605 {
   19606    GET_CURRENT_CONTEXT(ctx);
   19607    size_t cmd_size = sizeof(struct marshal_cmd_DrawBuffers) + safe_mul(n, 4);
   19608    struct marshal_cmd_DrawBuffers *cmd;
   19609    debug_print_marshal("DrawBuffers");
   19610    if (unlikely(safe_mul(n, 4) < 0)) {
   19611       goto fallback_to_sync;
   19612    }
   19613    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19614       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawBuffers, cmd_size);
   19615       cmd->n = n;
   19616       char *variable_data = (char *) (cmd + 1);
   19617       memcpy(variable_data, bufs, n * 4);
   19618       variable_data += n * 4;
   19619       _mesa_post_marshal_hook(ctx);
   19620       return;
   19621    }
   19622 
   19623 fallback_to_sync:
   19624    _mesa_glthread_finish(ctx);
   19625    debug_print_sync_fallback("DrawBuffers");
   19626    CALL_DrawBuffers(ctx->CurrentServerDispatch, (n, bufs));
   19627 }
   19628 
   19629 
   19630 /* VertexAttribL1ui64ARB: marshalled asynchronously */
   19631 struct marshal_cmd_VertexAttribL1ui64ARB
   19632 {
   19633    struct marshal_cmd_base cmd_base;
   19634    GLuint index;
   19635    GLuint64EXT x;
   19636 };
   19637 static inline void
   19638 _mesa_unmarshal_VertexAttribL1ui64ARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttribL1ui64ARB *cmd)
   19639 {
   19640    const GLuint index = cmd->index;
   19641    const GLuint64EXT x = cmd->x;
   19642    CALL_VertexAttribL1ui64ARB(ctx->CurrentServerDispatch, (index, x));
   19643 }
   19644 static void GLAPIENTRY
   19645 _mesa_marshal_VertexAttribL1ui64ARB(GLuint index, GLuint64EXT x)
   19646 {
   19647    GET_CURRENT_CONTEXT(ctx);
   19648    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribL1ui64ARB);
   19649    struct marshal_cmd_VertexAttribL1ui64ARB *cmd;
   19650    debug_print_marshal("VertexAttribL1ui64ARB");
   19651    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19652       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribL1ui64ARB, cmd_size);
   19653       cmd->index = index;
   19654       cmd->x = x;
   19655       _mesa_post_marshal_hook(ctx);
   19656       return;
   19657    }
   19658 
   19659    _mesa_glthread_finish(ctx);
   19660    debug_print_sync_fallback("VertexAttribL1ui64ARB");
   19661    CALL_VertexAttribL1ui64ARB(ctx->CurrentServerDispatch, (index, x));
   19662 }
   19663 
   19664 
   19665 /* GetnPolygonStippleARB: marshalled synchronously */
   19666 static void GLAPIENTRY
   19667 _mesa_marshal_GetnPolygonStippleARB(GLsizei bufSize, GLubyte * pattern)
   19668 {
   19669    GET_CURRENT_CONTEXT(ctx);
   19670    _mesa_glthread_finish(ctx);
   19671    debug_print_sync("GetnPolygonStippleARB");
   19672    CALL_GetnPolygonStippleARB(ctx->CurrentServerDispatch, (bufSize, pattern));
   19673 }
   19674 
   19675 
   19676 /* Color3uiv: marshalled asynchronously */
   19677 struct marshal_cmd_Color3uiv
   19678 {
   19679    struct marshal_cmd_base cmd_base;
   19680    GLuint v[3];
   19681 };
   19682 static inline void
   19683 _mesa_unmarshal_Color3uiv(struct gl_context *ctx, const struct marshal_cmd_Color3uiv *cmd)
   19684 {
   19685    const GLuint * v = cmd->v;
   19686    CALL_Color3uiv(ctx->CurrentServerDispatch, (v));
   19687 }
   19688 static void GLAPIENTRY
   19689 _mesa_marshal_Color3uiv(const GLuint * v)
   19690 {
   19691    GET_CURRENT_CONTEXT(ctx);
   19692    size_t cmd_size = sizeof(struct marshal_cmd_Color3uiv);
   19693    struct marshal_cmd_Color3uiv *cmd;
   19694    debug_print_marshal("Color3uiv");
   19695    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19696       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3uiv, cmd_size);
   19697       memcpy(cmd->v, v, 12);
   19698       _mesa_post_marshal_hook(ctx);
   19699       return;
   19700    }
   19701 
   19702    _mesa_glthread_finish(ctx);
   19703    debug_print_sync_fallback("Color3uiv");
   19704    CALL_Color3uiv(ctx->CurrentServerDispatch, (v));
   19705 }
   19706 
   19707 
   19708 /* EvalCoord2fv: marshalled asynchronously */
   19709 struct marshal_cmd_EvalCoord2fv
   19710 {
   19711    struct marshal_cmd_base cmd_base;
   19712    GLfloat u[2];
   19713 };
   19714 static inline void
   19715 _mesa_unmarshal_EvalCoord2fv(struct gl_context *ctx, const struct marshal_cmd_EvalCoord2fv *cmd)
   19716 {
   19717    const GLfloat * u = cmd->u;
   19718    CALL_EvalCoord2fv(ctx->CurrentServerDispatch, (u));
   19719 }
   19720 static void GLAPIENTRY
   19721 _mesa_marshal_EvalCoord2fv(const GLfloat * u)
   19722 {
   19723    GET_CURRENT_CONTEXT(ctx);
   19724    size_t cmd_size = sizeof(struct marshal_cmd_EvalCoord2fv);
   19725    struct marshal_cmd_EvalCoord2fv *cmd;
   19726    debug_print_marshal("EvalCoord2fv");
   19727    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19728       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EvalCoord2fv, cmd_size);
   19729       memcpy(cmd->u, u, 8);
   19730       _mesa_post_marshal_hook(ctx);
   19731       return;
   19732    }
   19733 
   19734    _mesa_glthread_finish(ctx);
   19735    debug_print_sync_fallback("EvalCoord2fv");
   19736    CALL_EvalCoord2fv(ctx->CurrentServerDispatch, (u));
   19737 }
   19738 
   19739 
   19740 /* TextureStorage3DEXT: marshalled asynchronously */
   19741 struct marshal_cmd_TextureStorage3DEXT
   19742 {
   19743    struct marshal_cmd_base cmd_base;
   19744    GLuint texture;
   19745    GLenum target;
   19746    GLsizei levels;
   19747    GLenum internalFormat;
   19748    GLsizei width;
   19749    GLsizei height;
   19750    GLsizei depth;
   19751 };
   19752 static inline void
   19753 _mesa_unmarshal_TextureStorage3DEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorage3DEXT *cmd)
   19754 {
   19755    const GLuint texture = cmd->texture;
   19756    const GLenum target = cmd->target;
   19757    const GLsizei levels = cmd->levels;
   19758    const GLenum internalFormat = cmd->internalFormat;
   19759    const GLsizei width = cmd->width;
   19760    const GLsizei height = cmd->height;
   19761    const GLsizei depth = cmd->depth;
   19762    CALL_TextureStorage3DEXT(ctx->CurrentServerDispatch, (texture, target, levels, internalFormat, width, height, depth));
   19763 }
   19764 static void GLAPIENTRY
   19765 _mesa_marshal_TextureStorage3DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth)
   19766 {
   19767    GET_CURRENT_CONTEXT(ctx);
   19768    size_t cmd_size = sizeof(struct marshal_cmd_TextureStorage3DEXT);
   19769    struct marshal_cmd_TextureStorage3DEXT *cmd;
   19770    debug_print_marshal("TextureStorage3DEXT");
   19771    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19772       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage3DEXT, cmd_size);
   19773       cmd->texture = texture;
   19774       cmd->target = target;
   19775       cmd->levels = levels;
   19776       cmd->internalFormat = internalFormat;
   19777       cmd->width = width;
   19778       cmd->height = height;
   19779       cmd->depth = depth;
   19780       _mesa_post_marshal_hook(ctx);
   19781       return;
   19782    }
   19783 
   19784    _mesa_glthread_finish(ctx);
   19785    debug_print_sync_fallback("TextureStorage3DEXT");
   19786    CALL_TextureStorage3DEXT(ctx->CurrentServerDispatch, (texture, target, levels, internalFormat, width, height, depth));
   19787 }
   19788 
   19789 
   19790 /* VertexAttrib2fARB: marshalled asynchronously */
   19791 struct marshal_cmd_VertexAttrib2fARB
   19792 {
   19793    struct marshal_cmd_base cmd_base;
   19794    GLuint index;
   19795    GLfloat x;
   19796    GLfloat y;
   19797 };
   19798 static inline void
   19799 _mesa_unmarshal_VertexAttrib2fARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2fARB *cmd)
   19800 {
   19801    const GLuint index = cmd->index;
   19802    const GLfloat x = cmd->x;
   19803    const GLfloat y = cmd->y;
   19804    CALL_VertexAttrib2fARB(ctx->CurrentServerDispatch, (index, x, y));
   19805 }
   19806 static void GLAPIENTRY
   19807 _mesa_marshal_VertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y)
   19808 {
   19809    GET_CURRENT_CONTEXT(ctx);
   19810    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib2fARB);
   19811    struct marshal_cmd_VertexAttrib2fARB *cmd;
   19812    debug_print_marshal("VertexAttrib2fARB");
   19813    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19814       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2fARB, cmd_size);
   19815       cmd->index = index;
   19816       cmd->x = x;
   19817       cmd->y = y;
   19818       _mesa_post_marshal_hook(ctx);
   19819       return;
   19820    }
   19821 
   19822    _mesa_glthread_finish(ctx);
   19823    debug_print_sync_fallback("VertexAttrib2fARB");
   19824    CALL_VertexAttrib2fARB(ctx->CurrentServerDispatch, (index, x, y));
   19825 }
   19826 
   19827 
   19828 /* SpecializeShaderARB: marshalled synchronously */
   19829 static void GLAPIENTRY
   19830 _mesa_marshal_SpecializeShaderARB(GLuint shader, const GLchar * pEntryPoint, GLuint numSpecializationConstants, const GLuint * pConstantIndex, const GLuint * pConstantValue)
   19831 {
   19832    GET_CURRENT_CONTEXT(ctx);
   19833    _mesa_glthread_finish(ctx);
   19834    debug_print_sync("SpecializeShaderARB");
   19835    CALL_SpecializeShaderARB(ctx->CurrentServerDispatch, (shader, pEntryPoint, numSpecializationConstants, pConstantIndex, pConstantValue));
   19836 }
   19837 
   19838 
   19839 /* BeginPerfMonitorAMD: marshalled asynchronously */
   19840 struct marshal_cmd_BeginPerfMonitorAMD
   19841 {
   19842    struct marshal_cmd_base cmd_base;
   19843    GLuint monitor;
   19844 };
   19845 static inline void
   19846 _mesa_unmarshal_BeginPerfMonitorAMD(struct gl_context *ctx, const struct marshal_cmd_BeginPerfMonitorAMD *cmd)
   19847 {
   19848    const GLuint monitor = cmd->monitor;
   19849    CALL_BeginPerfMonitorAMD(ctx->CurrentServerDispatch, (monitor));
   19850 }
   19851 static void GLAPIENTRY
   19852 _mesa_marshal_BeginPerfMonitorAMD(GLuint monitor)
   19853 {
   19854    GET_CURRENT_CONTEXT(ctx);
   19855    size_t cmd_size = sizeof(struct marshal_cmd_BeginPerfMonitorAMD);
   19856    struct marshal_cmd_BeginPerfMonitorAMD *cmd;
   19857    debug_print_marshal("BeginPerfMonitorAMD");
   19858    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19859       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BeginPerfMonitorAMD, cmd_size);
   19860       cmd->monitor = monitor;
   19861       _mesa_post_marshal_hook(ctx);
   19862       return;
   19863    }
   19864 
   19865    _mesa_glthread_finish(ctx);
   19866    debug_print_sync_fallback("BeginPerfMonitorAMD");
   19867    CALL_BeginPerfMonitorAMD(ctx->CurrentServerDispatch, (monitor));
   19868 }
   19869 
   19870 
   19871 /* WindowPos2fv: marshalled synchronously */
   19872 static void GLAPIENTRY
   19873 _mesa_marshal_WindowPos2fv(const GLfloat * v)
   19874 {
   19875    GET_CURRENT_CONTEXT(ctx);
   19876    _mesa_glthread_finish(ctx);
   19877    debug_print_sync("WindowPos2fv");
   19878    CALL_WindowPos2fv(ctx->CurrentServerDispatch, (v));
   19879 }
   19880 
   19881 
   19882 /* TexImage3D: marshalled synchronously */
   19883 static void GLAPIENTRY
   19884 _mesa_marshal_TexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
   19885 {
   19886    GET_CURRENT_CONTEXT(ctx);
   19887    _mesa_glthread_finish(ctx);
   19888    debug_print_sync("TexImage3D");
   19889    CALL_TexImage3D(ctx->CurrentServerDispatch, (target, level, internalformat, width, height, depth, border, format, type, pixels));
   19890 }
   19891 
   19892 
   19893 /* GetPerfQueryIdByNameINTEL: marshalled synchronously */
   19894 static void GLAPIENTRY
   19895 _mesa_marshal_GetPerfQueryIdByNameINTEL(GLchar * queryName, GLuint * queryId)
   19896 {
   19897    GET_CURRENT_CONTEXT(ctx);
   19898    _mesa_glthread_finish(ctx);
   19899    debug_print_sync("GetPerfQueryIdByNameINTEL");
   19900    CALL_GetPerfQueryIdByNameINTEL(ctx->CurrentServerDispatch, (queryName, queryId));
   19901 }
   19902 
   19903 
   19904 /* BindFragDataLocation: marshalled synchronously */
   19905 static void GLAPIENTRY
   19906 _mesa_marshal_BindFragDataLocation(GLuint program, GLuint colorNumber, const GLchar * name)
   19907 {
   19908    GET_CURRENT_CONTEXT(ctx);
   19909    _mesa_glthread_finish(ctx);
   19910    debug_print_sync("BindFragDataLocation");
   19911    CALL_BindFragDataLocation(ctx->CurrentServerDispatch, (program, colorNumber, name));
   19912 }
   19913 
   19914 
   19915 /* LightModeliv: marshalled synchronously */
   19916 static void GLAPIENTRY
   19917 _mesa_marshal_LightModeliv(GLenum pname, const GLint * params)
   19918 {
   19919    GET_CURRENT_CONTEXT(ctx);
   19920    _mesa_glthread_finish(ctx);
   19921    debug_print_sync("LightModeliv");
   19922    CALL_LightModeliv(ctx->CurrentServerDispatch, (pname, params));
   19923 }
   19924 
   19925 
   19926 /* Normal3bv: marshalled asynchronously */
   19927 struct marshal_cmd_Normal3bv
   19928 {
   19929    struct marshal_cmd_base cmd_base;
   19930    GLbyte v[3];
   19931 };
   19932 static inline void
   19933 _mesa_unmarshal_Normal3bv(struct gl_context *ctx, const struct marshal_cmd_Normal3bv *cmd)
   19934 {
   19935    const GLbyte * v = cmd->v;
   19936    CALL_Normal3bv(ctx->CurrentServerDispatch, (v));
   19937 }
   19938 static void GLAPIENTRY
   19939 _mesa_marshal_Normal3bv(const GLbyte * v)
   19940 {
   19941    GET_CURRENT_CONTEXT(ctx);
   19942    size_t cmd_size = sizeof(struct marshal_cmd_Normal3bv);
   19943    struct marshal_cmd_Normal3bv *cmd;
   19944    debug_print_marshal("Normal3bv");
   19945    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19946       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Normal3bv, cmd_size);
   19947       memcpy(cmd->v, v, 3);
   19948       _mesa_post_marshal_hook(ctx);
   19949       return;
   19950    }
   19951 
   19952    _mesa_glthread_finish(ctx);
   19953    debug_print_sync_fallback("Normal3bv");
   19954    CALL_Normal3bv(ctx->CurrentServerDispatch, (v));
   19955 }
   19956 
   19957 
   19958 /* BeginQueryIndexed: marshalled asynchronously */
   19959 struct marshal_cmd_BeginQueryIndexed
   19960 {
   19961    struct marshal_cmd_base cmd_base;
   19962    GLenum target;
   19963    GLuint index;
   19964    GLuint id;
   19965 };
   19966 static inline void
   19967 _mesa_unmarshal_BeginQueryIndexed(struct gl_context *ctx, const struct marshal_cmd_BeginQueryIndexed *cmd)
   19968 {
   19969    const GLenum target = cmd->target;
   19970    const GLuint index = cmd->index;
   19971    const GLuint id = cmd->id;
   19972    CALL_BeginQueryIndexed(ctx->CurrentServerDispatch, (target, index, id));
   19973 }
   19974 static void GLAPIENTRY
   19975 _mesa_marshal_BeginQueryIndexed(GLenum target, GLuint index, GLuint id)
   19976 {
   19977    GET_CURRENT_CONTEXT(ctx);
   19978    size_t cmd_size = sizeof(struct marshal_cmd_BeginQueryIndexed);
   19979    struct marshal_cmd_BeginQueryIndexed *cmd;
   19980    debug_print_marshal("BeginQueryIndexed");
   19981    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   19982       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BeginQueryIndexed, cmd_size);
   19983       cmd->target = target;
   19984       cmd->index = index;
   19985       cmd->id = id;
   19986       _mesa_post_marshal_hook(ctx);
   19987       return;
   19988    }
   19989 
   19990    _mesa_glthread_finish(ctx);
   19991    debug_print_sync_fallback("BeginQueryIndexed");
   19992    CALL_BeginQueryIndexed(ctx->CurrentServerDispatch, (target, index, id));
   19993 }
   19994 
   19995 
   19996 /* ClearNamedBufferData: marshalled synchronously */
   19997 static void GLAPIENTRY
   19998 _mesa_marshal_ClearNamedBufferData(GLuint buffer, GLenum internalformat, GLenum format, GLenum type, const GLvoid * data)
   19999 {
   20000    GET_CURRENT_CONTEXT(ctx);
   20001    _mesa_glthread_finish(ctx);
   20002    debug_print_sync("ClearNamedBufferData");
   20003    CALL_ClearNamedBufferData(ctx->CurrentServerDispatch, (buffer, internalformat, format, type, data));
   20004 }
   20005 
   20006 
   20007 /* Vertex3iv: marshalled asynchronously */
   20008 struct marshal_cmd_Vertex3iv
   20009 {
   20010    struct marshal_cmd_base cmd_base;
   20011    GLint v[3];
   20012 };
   20013 static inline void
   20014 _mesa_unmarshal_Vertex3iv(struct gl_context *ctx, const struct marshal_cmd_Vertex3iv *cmd)
   20015 {
   20016    const GLint * v = cmd->v;
   20017    CALL_Vertex3iv(ctx->CurrentServerDispatch, (v));
   20018 }
   20019 static void GLAPIENTRY
   20020 _mesa_marshal_Vertex3iv(const GLint * v)
   20021 {
   20022    GET_CURRENT_CONTEXT(ctx);
   20023    size_t cmd_size = sizeof(struct marshal_cmd_Vertex3iv);
   20024    struct marshal_cmd_Vertex3iv *cmd;
   20025    debug_print_marshal("Vertex3iv");
   20026    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20027       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex3iv, cmd_size);
   20028       memcpy(cmd->v, v, 12);
   20029       _mesa_post_marshal_hook(ctx);
   20030       return;
   20031    }
   20032 
   20033    _mesa_glthread_finish(ctx);
   20034    debug_print_sync_fallback("Vertex3iv");
   20035    CALL_Vertex3iv(ctx->CurrentServerDispatch, (v));
   20036 }
   20037 
   20038 
   20039 /* UniformMatrix2x3dv: marshalled asynchronously */
   20040 struct marshal_cmd_UniformMatrix2x3dv
   20041 {
   20042    struct marshal_cmd_base cmd_base;
   20043    GLint location;
   20044    GLsizei count;
   20045    GLboolean transpose;
   20046    /* Next safe_mul(count, 48) bytes are GLdouble value[count][6] */
   20047 };
   20048 static inline void
   20049 _mesa_unmarshal_UniformMatrix2x3dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2x3dv *cmd)
   20050 {
   20051    const GLint location = cmd->location;
   20052    const GLsizei count = cmd->count;
   20053    const GLboolean transpose = cmd->transpose;
   20054    const GLdouble * value;
   20055    const char *variable_data = (const char *) (cmd + 1);
   20056    value = (const GLdouble *) variable_data;
   20057    variable_data += count * 48;
   20058    CALL_UniformMatrix2x3dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   20059 }
   20060 static void GLAPIENTRY
   20061 _mesa_marshal_UniformMatrix2x3dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   20062 {
   20063    GET_CURRENT_CONTEXT(ctx);
   20064    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix2x3dv) + safe_mul(count, 48);
   20065    struct marshal_cmd_UniformMatrix2x3dv *cmd;
   20066    debug_print_marshal("UniformMatrix2x3dv");
   20067    if (unlikely(safe_mul(count, 48) < 0)) {
   20068       goto fallback_to_sync;
   20069    }
   20070    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20071       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2x3dv, cmd_size);
   20072       cmd->location = location;
   20073       cmd->count = count;
   20074       cmd->transpose = transpose;
   20075       char *variable_data = (char *) (cmd + 1);
   20076       memcpy(variable_data, value, count * 48);
   20077       variable_data += count * 48;
   20078       _mesa_post_marshal_hook(ctx);
   20079       return;
   20080    }
   20081 
   20082 fallback_to_sync:
   20083    _mesa_glthread_finish(ctx);
   20084    debug_print_sync_fallback("UniformMatrix2x3dv");
   20085    CALL_UniformMatrix2x3dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   20086 }
   20087 
   20088 
   20089 /* UniformHandleui64vARB: marshalled synchronously */
   20090 static void GLAPIENTRY
   20091 _mesa_marshal_UniformHandleui64vARB(GLint location, GLsizei count, const GLuint64 * value)
   20092 {
   20093    GET_CURRENT_CONTEXT(ctx);
   20094    _mesa_glthread_finish(ctx);
   20095    debug_print_sync("UniformHandleui64vARB");
   20096    CALL_UniformHandleui64vARB(ctx->CurrentServerDispatch, (location, count, value));
   20097 }
   20098 
   20099 
   20100 /* TexCoord3dv: marshalled asynchronously */
   20101 struct marshal_cmd_TexCoord3dv
   20102 {
   20103    struct marshal_cmd_base cmd_base;
   20104    GLdouble v[3];
   20105 };
   20106 static inline void
   20107 _mesa_unmarshal_TexCoord3dv(struct gl_context *ctx, const struct marshal_cmd_TexCoord3dv *cmd)
   20108 {
   20109    const GLdouble * v = cmd->v;
   20110    CALL_TexCoord3dv(ctx->CurrentServerDispatch, (v));
   20111 }
   20112 static void GLAPIENTRY
   20113 _mesa_marshal_TexCoord3dv(const GLdouble * v)
   20114 {
   20115    GET_CURRENT_CONTEXT(ctx);
   20116    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord3dv);
   20117    struct marshal_cmd_TexCoord3dv *cmd;
   20118    debug_print_marshal("TexCoord3dv");
   20119    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20120       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord3dv, cmd_size);
   20121       memcpy(cmd->v, v, 24);
   20122       _mesa_post_marshal_hook(ctx);
   20123       return;
   20124    }
   20125 
   20126    _mesa_glthread_finish(ctx);
   20127    debug_print_sync_fallback("TexCoord3dv");
   20128    CALL_TexCoord3dv(ctx->CurrentServerDispatch, (v));
   20129 }
   20130 
   20131 
   20132 /* GetProgramStringARB: marshalled synchronously */
   20133 static void GLAPIENTRY
   20134 _mesa_marshal_GetProgramStringARB(GLenum target, GLenum pname, GLvoid * string)
   20135 {
   20136    GET_CURRENT_CONTEXT(ctx);
   20137    _mesa_glthread_finish(ctx);
   20138    debug_print_sync("GetProgramStringARB");
   20139    CALL_GetProgramStringARB(ctx->CurrentServerDispatch, (target, pname, string));
   20140 }
   20141 
   20142 
   20143 /* VertexP3ui: marshalled asynchronously */
   20144 struct marshal_cmd_VertexP3ui
   20145 {
   20146    struct marshal_cmd_base cmd_base;
   20147    GLenum type;
   20148    GLuint value;
   20149 };
   20150 static inline void
   20151 _mesa_unmarshal_VertexP3ui(struct gl_context *ctx, const struct marshal_cmd_VertexP3ui *cmd)
   20152 {
   20153    const GLenum type = cmd->type;
   20154    const GLuint value = cmd->value;
   20155    CALL_VertexP3ui(ctx->CurrentServerDispatch, (type, value));
   20156 }
   20157 static void GLAPIENTRY
   20158 _mesa_marshal_VertexP3ui(GLenum type, GLuint value)
   20159 {
   20160    GET_CURRENT_CONTEXT(ctx);
   20161    size_t cmd_size = sizeof(struct marshal_cmd_VertexP3ui);
   20162    struct marshal_cmd_VertexP3ui *cmd;
   20163    debug_print_marshal("VertexP3ui");
   20164    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20165       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexP3ui, cmd_size);
   20166       cmd->type = type;
   20167       cmd->value = value;
   20168       _mesa_post_marshal_hook(ctx);
   20169       return;
   20170    }
   20171 
   20172    _mesa_glthread_finish(ctx);
   20173    debug_print_sync_fallback("VertexP3ui");
   20174    CALL_VertexP3ui(ctx->CurrentServerDispatch, (type, value));
   20175 }
   20176 
   20177 
   20178 /* CreateProgramObjectARB: marshalled synchronously */
   20179 static GLhandleARB GLAPIENTRY
   20180 _mesa_marshal_CreateProgramObjectARB(void)
   20181 {
   20182    GET_CURRENT_CONTEXT(ctx);
   20183    _mesa_glthread_finish(ctx);
   20184    debug_print_sync("CreateProgramObjectARB");
   20185    return CALL_CreateProgramObjectARB(ctx->CurrentServerDispatch, ());
   20186 }
   20187 
   20188 
   20189 /* UniformMatrix3fv: marshalled asynchronously */
   20190 struct marshal_cmd_UniformMatrix3fv
   20191 {
   20192    struct marshal_cmd_base cmd_base;
   20193    GLint location;
   20194    GLsizei count;
   20195    GLboolean transpose;
   20196    /* Next safe_mul(count, 36) bytes are GLfloat value[count][9] */
   20197 };
   20198 static inline void
   20199 _mesa_unmarshal_UniformMatrix3fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3fv *cmd)
   20200 {
   20201    const GLint location = cmd->location;
   20202    const GLsizei count = cmd->count;
   20203    const GLboolean transpose = cmd->transpose;
   20204    const GLfloat * value;
   20205    const char *variable_data = (const char *) (cmd + 1);
   20206    value = (const GLfloat *) variable_data;
   20207    variable_data += count * 36;
   20208    CALL_UniformMatrix3fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   20209 }
   20210 static void GLAPIENTRY
   20211 _mesa_marshal_UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   20212 {
   20213    GET_CURRENT_CONTEXT(ctx);
   20214    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix3fv) + safe_mul(count, 36);
   20215    struct marshal_cmd_UniformMatrix3fv *cmd;
   20216    debug_print_marshal("UniformMatrix3fv");
   20217    if (unlikely(safe_mul(count, 36) < 0)) {
   20218       goto fallback_to_sync;
   20219    }
   20220    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20221       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3fv, cmd_size);
   20222       cmd->location = location;
   20223       cmd->count = count;
   20224       cmd->transpose = transpose;
   20225       char *variable_data = (char *) (cmd + 1);
   20226       memcpy(variable_data, value, count * 36);
   20227       variable_data += count * 36;
   20228       _mesa_post_marshal_hook(ctx);
   20229       return;
   20230    }
   20231 
   20232 fallback_to_sync:
   20233    _mesa_glthread_finish(ctx);
   20234    debug_print_sync_fallback("UniformMatrix3fv");
   20235    CALL_UniformMatrix3fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   20236 }
   20237 
   20238 
   20239 /* PrioritizeTextures: marshalled asynchronously */
   20240 struct marshal_cmd_PrioritizeTextures
   20241 {
   20242    struct marshal_cmd_base cmd_base;
   20243    GLsizei n;
   20244    /* Next safe_mul(n, 4) bytes are GLuint textures[n] */
   20245    /* Next safe_mul(n, 4) bytes are GLclampf priorities[n] */
   20246 };
   20247 static inline void
   20248 _mesa_unmarshal_PrioritizeTextures(struct gl_context *ctx, const struct marshal_cmd_PrioritizeTextures *cmd)
   20249 {
   20250    const GLsizei n = cmd->n;
   20251    const GLuint * textures;
   20252    const GLclampf * priorities;
   20253    const char *variable_data = (const char *) (cmd + 1);
   20254    textures = (const GLuint *) variable_data;
   20255    variable_data += n * 4;
   20256    priorities = (const GLclampf *) variable_data;
   20257    variable_data += n * 4;
   20258    CALL_PrioritizeTextures(ctx->CurrentServerDispatch, (n, textures, priorities));
   20259 }
   20260 static void GLAPIENTRY
   20261 _mesa_marshal_PrioritizeTextures(GLsizei n, const GLuint * textures, const GLclampf * priorities)
   20262 {
   20263    GET_CURRENT_CONTEXT(ctx);
   20264    size_t cmd_size = sizeof(struct marshal_cmd_PrioritizeTextures) + safe_mul(n, 4) + safe_mul(n, 4);
   20265    struct marshal_cmd_PrioritizeTextures *cmd;
   20266    debug_print_marshal("PrioritizeTextures");
   20267    if (unlikely(safe_mul(n, 4) < 0)) {
   20268       goto fallback_to_sync;
   20269    }
   20270    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20271       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PrioritizeTextures, cmd_size);
   20272       cmd->n = n;
   20273       char *variable_data = (char *) (cmd + 1);
   20274       memcpy(variable_data, textures, n * 4);
   20275       variable_data += n * 4;
   20276       memcpy(variable_data, priorities, n * 4);
   20277       variable_data += n * 4;
   20278       _mesa_post_marshal_hook(ctx);
   20279       return;
   20280    }
   20281 
   20282 fallback_to_sync:
   20283    _mesa_glthread_finish(ctx);
   20284    debug_print_sync_fallback("PrioritizeTextures");
   20285    CALL_PrioritizeTextures(ctx->CurrentServerDispatch, (n, textures, priorities));
   20286 }
   20287 
   20288 
   20289 /* VertexAttribI3uiEXT: marshalled asynchronously */
   20290 struct marshal_cmd_VertexAttribI3uiEXT
   20291 {
   20292    struct marshal_cmd_base cmd_base;
   20293    GLuint index;
   20294    GLuint x;
   20295    GLuint y;
   20296    GLuint z;
   20297 };
   20298 static inline void
   20299 _mesa_unmarshal_VertexAttribI3uiEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI3uiEXT *cmd)
   20300 {
   20301    const GLuint index = cmd->index;
   20302    const GLuint x = cmd->x;
   20303    const GLuint y = cmd->y;
   20304    const GLuint z = cmd->z;
   20305    CALL_VertexAttribI3uiEXT(ctx->CurrentServerDispatch, (index, x, y, z));
   20306 }
   20307 static void GLAPIENTRY
   20308 _mesa_marshal_VertexAttribI3uiEXT(GLuint index, GLuint x, GLuint y, GLuint z)
   20309 {
   20310    GET_CURRENT_CONTEXT(ctx);
   20311    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribI3uiEXT);
   20312    struct marshal_cmd_VertexAttribI3uiEXT *cmd;
   20313    debug_print_marshal("VertexAttribI3uiEXT");
   20314    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20315       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI3uiEXT, cmd_size);
   20316       cmd->index = index;
   20317       cmd->x = x;
   20318       cmd->y = y;
   20319       cmd->z = z;
   20320       _mesa_post_marshal_hook(ctx);
   20321       return;
   20322    }
   20323 
   20324    _mesa_glthread_finish(ctx);
   20325    debug_print_sync_fallback("VertexAttribI3uiEXT");
   20326    CALL_VertexAttribI3uiEXT(ctx->CurrentServerDispatch, (index, x, y, z));
   20327 }
   20328 
   20329 
   20330 /* ProgramUniform1i64ARB: marshalled asynchronously */
   20331 struct marshal_cmd_ProgramUniform1i64ARB
   20332 {
   20333    struct marshal_cmd_base cmd_base;
   20334    GLuint program;
   20335    GLint location;
   20336    GLint64 x;
   20337 };
   20338 static inline void
   20339 _mesa_unmarshal_ProgramUniform1i64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1i64ARB *cmd)
   20340 {
   20341    const GLuint program = cmd->program;
   20342    const GLint location = cmd->location;
   20343    const GLint64 x = cmd->x;
   20344    CALL_ProgramUniform1i64ARB(ctx->CurrentServerDispatch, (program, location, x));
   20345 }
   20346 static void GLAPIENTRY
   20347 _mesa_marshal_ProgramUniform1i64ARB(GLuint program, GLint location, GLint64 x)
   20348 {
   20349    GET_CURRENT_CONTEXT(ctx);
   20350    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform1i64ARB);
   20351    struct marshal_cmd_ProgramUniform1i64ARB *cmd;
   20352    debug_print_marshal("ProgramUniform1i64ARB");
   20353    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20354       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1i64ARB, cmd_size);
   20355       cmd->program = program;
   20356       cmd->location = location;
   20357       cmd->x = x;
   20358       _mesa_post_marshal_hook(ctx);
   20359       return;
   20360    }
   20361 
   20362    _mesa_glthread_finish(ctx);
   20363    debug_print_sync_fallback("ProgramUniform1i64ARB");
   20364    CALL_ProgramUniform1i64ARB(ctx->CurrentServerDispatch, (program, location, x));
   20365 }
   20366 
   20367 
   20368 /* GetMaterialxv: marshalled synchronously */
   20369 static void GLAPIENTRY
   20370 _mesa_marshal_GetMaterialxv(GLenum face, GLenum pname, GLfixed * params)
   20371 {
   20372    GET_CURRENT_CONTEXT(ctx);
   20373    _mesa_glthread_finish(ctx);
   20374    debug_print_sync("GetMaterialxv");
   20375    CALL_GetMaterialxv(ctx->CurrentServerDispatch, (face, pname, params));
   20376 }
   20377 
   20378 
   20379 /* SecondaryColor3uiv: marshalled asynchronously */
   20380 struct marshal_cmd_SecondaryColor3uiv
   20381 {
   20382    struct marshal_cmd_base cmd_base;
   20383    GLuint v[3];
   20384 };
   20385 static inline void
   20386 _mesa_unmarshal_SecondaryColor3uiv(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3uiv *cmd)
   20387 {
   20388    const GLuint * v = cmd->v;
   20389    CALL_SecondaryColor3uiv(ctx->CurrentServerDispatch, (v));
   20390 }
   20391 static void GLAPIENTRY
   20392 _mesa_marshal_SecondaryColor3uiv(const GLuint * v)
   20393 {
   20394    GET_CURRENT_CONTEXT(ctx);
   20395    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColor3uiv);
   20396    struct marshal_cmd_SecondaryColor3uiv *cmd;
   20397    debug_print_marshal("SecondaryColor3uiv");
   20398    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20399       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3uiv, cmd_size);
   20400       memcpy(cmd->v, v, 12);
   20401       _mesa_post_marshal_hook(ctx);
   20402       return;
   20403    }
   20404 
   20405    _mesa_glthread_finish(ctx);
   20406    debug_print_sync_fallback("SecondaryColor3uiv");
   20407    CALL_SecondaryColor3uiv(ctx->CurrentServerDispatch, (v));
   20408 }
   20409 
   20410 
   20411 /* EndConditionalRender: marshalled asynchronously */
   20412 struct marshal_cmd_EndConditionalRender
   20413 {
   20414    struct marshal_cmd_base cmd_base;
   20415 };
   20416 static inline void
   20417 _mesa_unmarshal_EndConditionalRender(struct gl_context *ctx, const struct marshal_cmd_EndConditionalRender *cmd)
   20418 {
   20419    CALL_EndConditionalRender(ctx->CurrentServerDispatch, ());
   20420 }
   20421 static void GLAPIENTRY
   20422 _mesa_marshal_EndConditionalRender(void)
   20423 {
   20424    GET_CURRENT_CONTEXT(ctx);
   20425    size_t cmd_size = sizeof(struct marshal_cmd_EndConditionalRender);
   20426    struct marshal_cmd_EndConditionalRender *cmd;
   20427    debug_print_marshal("EndConditionalRender");
   20428    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20429       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EndConditionalRender, cmd_size);
   20430       (void) cmd;
   20431 
   20432       _mesa_post_marshal_hook(ctx);
   20433       return;
   20434    }
   20435 
   20436    _mesa_glthread_finish(ctx);
   20437    debug_print_sync_fallback("EndConditionalRender");
   20438    CALL_EndConditionalRender(ctx->CurrentServerDispatch, ());
   20439 }
   20440 
   20441 
   20442 /* ProgramLocalParameter4dARB: marshalled asynchronously */
   20443 struct marshal_cmd_ProgramLocalParameter4dARB
   20444 {
   20445    struct marshal_cmd_base cmd_base;
   20446    GLenum target;
   20447    GLuint index;
   20448    GLdouble x;
   20449    GLdouble y;
   20450    GLdouble z;
   20451    GLdouble w;
   20452 };
   20453 static inline void
   20454 _mesa_unmarshal_ProgramLocalParameter4dARB(struct gl_context *ctx, const struct marshal_cmd_ProgramLocalParameter4dARB *cmd)
   20455 {
   20456    const GLenum target = cmd->target;
   20457    const GLuint index = cmd->index;
   20458    const GLdouble x = cmd->x;
   20459    const GLdouble y = cmd->y;
   20460    const GLdouble z = cmd->z;
   20461    const GLdouble w = cmd->w;
   20462    CALL_ProgramLocalParameter4dARB(ctx->CurrentServerDispatch, (target, index, x, y, z, w));
   20463 }
   20464 static void GLAPIENTRY
   20465 _mesa_marshal_ProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
   20466 {
   20467    GET_CURRENT_CONTEXT(ctx);
   20468    size_t cmd_size = sizeof(struct marshal_cmd_ProgramLocalParameter4dARB);
   20469    struct marshal_cmd_ProgramLocalParameter4dARB *cmd;
   20470    debug_print_marshal("ProgramLocalParameter4dARB");
   20471    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20472       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramLocalParameter4dARB, cmd_size);
   20473       cmd->target = target;
   20474       cmd->index = index;
   20475       cmd->x = x;
   20476       cmd->y = y;
   20477       cmd->z = z;
   20478       cmd->w = w;
   20479       _mesa_post_marshal_hook(ctx);
   20480       return;
   20481    }
   20482 
   20483    _mesa_glthread_finish(ctx);
   20484    debug_print_sync_fallback("ProgramLocalParameter4dARB");
   20485    CALL_ProgramLocalParameter4dARB(ctx->CurrentServerDispatch, (target, index, x, y, z, w));
   20486 }
   20487 
   20488 
   20489 /* Color3sv: marshalled asynchronously */
   20490 struct marshal_cmd_Color3sv
   20491 {
   20492    struct marshal_cmd_base cmd_base;
   20493    GLshort v[3];
   20494 };
   20495 static inline void
   20496 _mesa_unmarshal_Color3sv(struct gl_context *ctx, const struct marshal_cmd_Color3sv *cmd)
   20497 {
   20498    const GLshort * v = cmd->v;
   20499    CALL_Color3sv(ctx->CurrentServerDispatch, (v));
   20500 }
   20501 static void GLAPIENTRY
   20502 _mesa_marshal_Color3sv(const GLshort * v)
   20503 {
   20504    GET_CURRENT_CONTEXT(ctx);
   20505    size_t cmd_size = sizeof(struct marshal_cmd_Color3sv);
   20506    struct marshal_cmd_Color3sv *cmd;
   20507    debug_print_marshal("Color3sv");
   20508    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20509       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3sv, cmd_size);
   20510       memcpy(cmd->v, v, 6);
   20511       _mesa_post_marshal_hook(ctx);
   20512       return;
   20513    }
   20514 
   20515    _mesa_glthread_finish(ctx);
   20516    debug_print_sync_fallback("Color3sv");
   20517    CALL_Color3sv(ctx->CurrentServerDispatch, (v));
   20518 }
   20519 
   20520 
   20521 /* GenFragmentShadersATI: marshalled synchronously */
   20522 static GLuint GLAPIENTRY
   20523 _mesa_marshal_GenFragmentShadersATI(GLuint range)
   20524 {
   20525    GET_CURRENT_CONTEXT(ctx);
   20526    _mesa_glthread_finish(ctx);
   20527    debug_print_sync("GenFragmentShadersATI");
   20528    return CALL_GenFragmentShadersATI(ctx->CurrentServerDispatch, (range));
   20529 }
   20530 
   20531 
   20532 /* GetNamedBufferParameteriv: marshalled synchronously */
   20533 static void GLAPIENTRY
   20534 _mesa_marshal_GetNamedBufferParameteriv(GLuint buffer, GLenum pname, GLint * params)
   20535 {
   20536    GET_CURRENT_CONTEXT(ctx);
   20537    _mesa_glthread_finish(ctx);
   20538    debug_print_sync("GetNamedBufferParameteriv");
   20539    CALL_GetNamedBufferParameteriv(ctx->CurrentServerDispatch, (buffer, pname, params));
   20540 }
   20541 
   20542 
   20543 /* BlendEquationSeparateiARB: marshalled asynchronously */
   20544 struct marshal_cmd_BlendEquationSeparateiARB
   20545 {
   20546    struct marshal_cmd_base cmd_base;
   20547    GLuint buf;
   20548    GLenum modeRGB;
   20549    GLenum modeA;
   20550 };
   20551 static inline void
   20552 _mesa_unmarshal_BlendEquationSeparateiARB(struct gl_context *ctx, const struct marshal_cmd_BlendEquationSeparateiARB *cmd)
   20553 {
   20554    const GLuint buf = cmd->buf;
   20555    const GLenum modeRGB = cmd->modeRGB;
   20556    const GLenum modeA = cmd->modeA;
   20557    CALL_BlendEquationSeparateiARB(ctx->CurrentServerDispatch, (buf, modeRGB, modeA));
   20558 }
   20559 static void GLAPIENTRY
   20560 _mesa_marshal_BlendEquationSeparateiARB(GLuint buf, GLenum modeRGB, GLenum modeA)
   20561 {
   20562    GET_CURRENT_CONTEXT(ctx);
   20563    size_t cmd_size = sizeof(struct marshal_cmd_BlendEquationSeparateiARB);
   20564    struct marshal_cmd_BlendEquationSeparateiARB *cmd;
   20565    debug_print_marshal("BlendEquationSeparateiARB");
   20566    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20567       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendEquationSeparateiARB, cmd_size);
   20568       cmd->buf = buf;
   20569       cmd->modeRGB = modeRGB;
   20570       cmd->modeA = modeA;
   20571       _mesa_post_marshal_hook(ctx);
   20572       return;
   20573    }
   20574 
   20575    _mesa_glthread_finish(ctx);
   20576    debug_print_sync_fallback("BlendEquationSeparateiARB");
   20577    CALL_BlendEquationSeparateiARB(ctx->CurrentServerDispatch, (buf, modeRGB, modeA));
   20578 }
   20579 
   20580 
   20581 /* MultiTexCoord1fvARB: marshalled asynchronously */
   20582 struct marshal_cmd_MultiTexCoord1fvARB
   20583 {
   20584    struct marshal_cmd_base cmd_base;
   20585    GLenum target;
   20586    GLfloat v[1];
   20587 };
   20588 static inline void
   20589 _mesa_unmarshal_MultiTexCoord1fvARB(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1fvARB *cmd)
   20590 {
   20591    const GLenum target = cmd->target;
   20592    const GLfloat * v = cmd->v;
   20593    CALL_MultiTexCoord1fvARB(ctx->CurrentServerDispatch, (target, v));
   20594 }
   20595 static void GLAPIENTRY
   20596 _mesa_marshal_MultiTexCoord1fvARB(GLenum target, const GLfloat * v)
   20597 {
   20598    GET_CURRENT_CONTEXT(ctx);
   20599    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1fvARB);
   20600    struct marshal_cmd_MultiTexCoord1fvARB *cmd;
   20601    debug_print_marshal("MultiTexCoord1fvARB");
   20602    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20603       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1fvARB, cmd_size);
   20604       cmd->target = target;
   20605       memcpy(cmd->v, v, 4);
   20606       _mesa_post_marshal_hook(ctx);
   20607       return;
   20608    }
   20609 
   20610    _mesa_glthread_finish(ctx);
   20611    debug_print_sync_fallback("MultiTexCoord1fvARB");
   20612    CALL_MultiTexCoord1fvARB(ctx->CurrentServerDispatch, (target, v));
   20613 }
   20614 
   20615 
   20616 /* TexStorage2D: marshalled asynchronously */
   20617 struct marshal_cmd_TexStorage2D
   20618 {
   20619    struct marshal_cmd_base cmd_base;
   20620    GLenum target;
   20621    GLsizei levels;
   20622    GLenum internalFormat;
   20623    GLsizei width;
   20624    GLsizei height;
   20625 };
   20626 static inline void
   20627 _mesa_unmarshal_TexStorage2D(struct gl_context *ctx, const struct marshal_cmd_TexStorage2D *cmd)
   20628 {
   20629    const GLenum target = cmd->target;
   20630    const GLsizei levels = cmd->levels;
   20631    const GLenum internalFormat = cmd->internalFormat;
   20632    const GLsizei width = cmd->width;
   20633    const GLsizei height = cmd->height;
   20634    CALL_TexStorage2D(ctx->CurrentServerDispatch, (target, levels, internalFormat, width, height));
   20635 }
   20636 static void GLAPIENTRY
   20637 _mesa_marshal_TexStorage2D(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height)
   20638 {
   20639    GET_CURRENT_CONTEXT(ctx);
   20640    size_t cmd_size = sizeof(struct marshal_cmd_TexStorage2D);
   20641    struct marshal_cmd_TexStorage2D *cmd;
   20642    debug_print_marshal("TexStorage2D");
   20643    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20644       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorage2D, cmd_size);
   20645       cmd->target = target;
   20646       cmd->levels = levels;
   20647       cmd->internalFormat = internalFormat;
   20648       cmd->width = width;
   20649       cmd->height = height;
   20650       _mesa_post_marshal_hook(ctx);
   20651       return;
   20652    }
   20653 
   20654    _mesa_glthread_finish(ctx);
   20655    debug_print_sync_fallback("TexStorage2D");
   20656    CALL_TexStorage2D(ctx->CurrentServerDispatch, (target, levels, internalFormat, width, height));
   20657 }
   20658 
   20659 
   20660 /* FramebufferTexture2D: marshalled asynchronously */
   20661 struct marshal_cmd_FramebufferTexture2D
   20662 {
   20663    struct marshal_cmd_base cmd_base;
   20664    GLenum target;
   20665    GLenum attachment;
   20666    GLenum textarget;
   20667    GLuint texture;
   20668    GLint level;
   20669 };
   20670 static inline void
   20671 _mesa_unmarshal_FramebufferTexture2D(struct gl_context *ctx, const struct marshal_cmd_FramebufferTexture2D *cmd)
   20672 {
   20673    const GLenum target = cmd->target;
   20674    const GLenum attachment = cmd->attachment;
   20675    const GLenum textarget = cmd->textarget;
   20676    const GLuint texture = cmd->texture;
   20677    const GLint level = cmd->level;
   20678    CALL_FramebufferTexture2D(ctx->CurrentServerDispatch, (target, attachment, textarget, texture, level));
   20679 }
   20680 static void GLAPIENTRY
   20681 _mesa_marshal_FramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
   20682 {
   20683    GET_CURRENT_CONTEXT(ctx);
   20684    size_t cmd_size = sizeof(struct marshal_cmd_FramebufferTexture2D);
   20685    struct marshal_cmd_FramebufferTexture2D *cmd;
   20686    debug_print_marshal("FramebufferTexture2D");
   20687    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20688       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferTexture2D, cmd_size);
   20689       cmd->target = target;
   20690       cmd->attachment = attachment;
   20691       cmd->textarget = textarget;
   20692       cmd->texture = texture;
   20693       cmd->level = level;
   20694       _mesa_post_marshal_hook(ctx);
   20695       return;
   20696    }
   20697 
   20698    _mesa_glthread_finish(ctx);
   20699    debug_print_sync_fallback("FramebufferTexture2D");
   20700    CALL_FramebufferTexture2D(ctx->CurrentServerDispatch, (target, attachment, textarget, texture, level));
   20701 }
   20702 
   20703 
   20704 /* GetSamplerParameterfv: marshalled synchronously */
   20705 static void GLAPIENTRY
   20706 _mesa_marshal_GetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat * params)
   20707 {
   20708    GET_CURRENT_CONTEXT(ctx);
   20709    _mesa_glthread_finish(ctx);
   20710    debug_print_sync("GetSamplerParameterfv");
   20711    CALL_GetSamplerParameterfv(ctx->CurrentServerDispatch, (sampler, pname, params));
   20712 }
   20713 
   20714 
   20715 /* VertexAttrib2dv: marshalled asynchronously */
   20716 struct marshal_cmd_VertexAttrib2dv
   20717 {
   20718    struct marshal_cmd_base cmd_base;
   20719    GLuint index;
   20720    GLdouble v[2];
   20721 };
   20722 static inline void
   20723 _mesa_unmarshal_VertexAttrib2dv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2dv *cmd)
   20724 {
   20725    const GLuint index = cmd->index;
   20726    const GLdouble * v = cmd->v;
   20727    CALL_VertexAttrib2dv(ctx->CurrentServerDispatch, (index, v));
   20728 }
   20729 static void GLAPIENTRY
   20730 _mesa_marshal_VertexAttrib2dv(GLuint index, const GLdouble * v)
   20731 {
   20732    GET_CURRENT_CONTEXT(ctx);
   20733    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib2dv);
   20734    struct marshal_cmd_VertexAttrib2dv *cmd;
   20735    debug_print_marshal("VertexAttrib2dv");
   20736    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20737       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2dv, cmd_size);
   20738       cmd->index = index;
   20739       memcpy(cmd->v, v, 16);
   20740       _mesa_post_marshal_hook(ctx);
   20741       return;
   20742    }
   20743 
   20744    _mesa_glthread_finish(ctx);
   20745    debug_print_sync_fallback("VertexAttrib2dv");
   20746    CALL_VertexAttrib2dv(ctx->CurrentServerDispatch, (index, v));
   20747 }
   20748 
   20749 
   20750 /* Vertex4sv: marshalled asynchronously */
   20751 struct marshal_cmd_Vertex4sv
   20752 {
   20753    struct marshal_cmd_base cmd_base;
   20754    GLshort v[4];
   20755 };
   20756 static inline void
   20757 _mesa_unmarshal_Vertex4sv(struct gl_context *ctx, const struct marshal_cmd_Vertex4sv *cmd)
   20758 {
   20759    const GLshort * v = cmd->v;
   20760    CALL_Vertex4sv(ctx->CurrentServerDispatch, (v));
   20761 }
   20762 static void GLAPIENTRY
   20763 _mesa_marshal_Vertex4sv(const GLshort * v)
   20764 {
   20765    GET_CURRENT_CONTEXT(ctx);
   20766    size_t cmd_size = sizeof(struct marshal_cmd_Vertex4sv);
   20767    struct marshal_cmd_Vertex4sv *cmd;
   20768    debug_print_marshal("Vertex4sv");
   20769    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20770       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex4sv, cmd_size);
   20771       memcpy(cmd->v, v, 8);
   20772       _mesa_post_marshal_hook(ctx);
   20773       return;
   20774    }
   20775 
   20776    _mesa_glthread_finish(ctx);
   20777    debug_print_sync_fallback("Vertex4sv");
   20778    CALL_Vertex4sv(ctx->CurrentServerDispatch, (v));
   20779 }
   20780 
   20781 
   20782 /* GetQueryObjecti64v: marshalled synchronously */
   20783 static void GLAPIENTRY
   20784 _mesa_marshal_GetQueryObjecti64v(GLuint id, GLenum pname, GLint64 * params)
   20785 {
   20786    GET_CURRENT_CONTEXT(ctx);
   20787    _mesa_glthread_finish(ctx);
   20788    debug_print_sync("GetQueryObjecti64v");
   20789    CALL_GetQueryObjecti64v(ctx->CurrentServerDispatch, (id, pname, params));
   20790 }
   20791 
   20792 
   20793 /* ClampColor: marshalled asynchronously */
   20794 struct marshal_cmd_ClampColor
   20795 {
   20796    struct marshal_cmd_base cmd_base;
   20797    GLenum target;
   20798    GLenum clamp;
   20799 };
   20800 static inline void
   20801 _mesa_unmarshal_ClampColor(struct gl_context *ctx, const struct marshal_cmd_ClampColor *cmd)
   20802 {
   20803    const GLenum target = cmd->target;
   20804    const GLenum clamp = cmd->clamp;
   20805    CALL_ClampColor(ctx->CurrentServerDispatch, (target, clamp));
   20806 }
   20807 static void GLAPIENTRY
   20808 _mesa_marshal_ClampColor(GLenum target, GLenum clamp)
   20809 {
   20810    GET_CURRENT_CONTEXT(ctx);
   20811    size_t cmd_size = sizeof(struct marshal_cmd_ClampColor);
   20812    struct marshal_cmd_ClampColor *cmd;
   20813    debug_print_marshal("ClampColor");
   20814    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20815       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClampColor, cmd_size);
   20816       cmd->target = target;
   20817       cmd->clamp = clamp;
   20818       _mesa_post_marshal_hook(ctx);
   20819       return;
   20820    }
   20821 
   20822    _mesa_glthread_finish(ctx);
   20823    debug_print_sync_fallback("ClampColor");
   20824    CALL_ClampColor(ctx->CurrentServerDispatch, (target, clamp));
   20825 }
   20826 
   20827 
   20828 /* Uniform1i64ARB: marshalled asynchronously */
   20829 struct marshal_cmd_Uniform1i64ARB
   20830 {
   20831    struct marshal_cmd_base cmd_base;
   20832    GLint location;
   20833    GLint64 x;
   20834 };
   20835 static inline void
   20836 _mesa_unmarshal_Uniform1i64ARB(struct gl_context *ctx, const struct marshal_cmd_Uniform1i64ARB *cmd)
   20837 {
   20838    const GLint location = cmd->location;
   20839    const GLint64 x = cmd->x;
   20840    CALL_Uniform1i64ARB(ctx->CurrentServerDispatch, (location, x));
   20841 }
   20842 static void GLAPIENTRY
   20843 _mesa_marshal_Uniform1i64ARB(GLint location, GLint64 x)
   20844 {
   20845    GET_CURRENT_CONTEXT(ctx);
   20846    size_t cmd_size = sizeof(struct marshal_cmd_Uniform1i64ARB);
   20847    struct marshal_cmd_Uniform1i64ARB *cmd;
   20848    debug_print_marshal("Uniform1i64ARB");
   20849    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20850       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1i64ARB, cmd_size);
   20851       cmd->location = location;
   20852       cmd->x = x;
   20853       _mesa_post_marshal_hook(ctx);
   20854       return;
   20855    }
   20856 
   20857    _mesa_glthread_finish(ctx);
   20858    debug_print_sync_fallback("Uniform1i64ARB");
   20859    CALL_Uniform1i64ARB(ctx->CurrentServerDispatch, (location, x));
   20860 }
   20861 
   20862 
   20863 /* DepthRangeArrayfvOES: marshalled synchronously */
   20864 static void GLAPIENTRY
   20865 _mesa_marshal_DepthRangeArrayfvOES(GLuint first, GLsizei count, const GLfloat * v)
   20866 {
   20867    GET_CURRENT_CONTEXT(ctx);
   20868    _mesa_glthread_finish(ctx);
   20869    debug_print_sync("DepthRangeArrayfvOES");
   20870    CALL_DepthRangeArrayfvOES(ctx->CurrentServerDispatch, (first, count, v));
   20871 }
   20872 
   20873 
   20874 /* ConvolutionFilter1D: marshalled synchronously */
   20875 static void GLAPIENTRY
   20876 _mesa_marshal_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid * image)
   20877 {
   20878    GET_CURRENT_CONTEXT(ctx);
   20879    _mesa_glthread_finish(ctx);
   20880    debug_print_sync("ConvolutionFilter1D");
   20881    CALL_ConvolutionFilter1D(ctx->CurrentServerDispatch, (target, internalformat, width, format, type, image));
   20882 }
   20883 
   20884 
   20885 /* DrawElementsIndirect: marshalled synchronously */
   20886 static void GLAPIENTRY
   20887 _mesa_marshal_DrawElementsIndirect(GLenum mode, GLenum type, const GLvoid * indirect)
   20888 {
   20889    GET_CURRENT_CONTEXT(ctx);
   20890    _mesa_glthread_finish(ctx);
   20891    debug_print_sync("DrawElementsIndirect");
   20892    CALL_DrawElementsIndirect(ctx->CurrentServerDispatch, (mode, type, indirect));
   20893 }
   20894 
   20895 
   20896 /* WindowPos3sv: marshalled synchronously */
   20897 static void GLAPIENTRY
   20898 _mesa_marshal_WindowPos3sv(const GLshort * v)
   20899 {
   20900    GET_CURRENT_CONTEXT(ctx);
   20901    _mesa_glthread_finish(ctx);
   20902    debug_print_sync("WindowPos3sv");
   20903    CALL_WindowPos3sv(ctx->CurrentServerDispatch, (v));
   20904 }
   20905 
   20906 
   20907 /* CallLists: marshalled synchronously */
   20908 static void GLAPIENTRY
   20909 _mesa_marshal_CallLists(GLsizei n, GLenum type, const GLvoid * lists)
   20910 {
   20911    GET_CURRENT_CONTEXT(ctx);
   20912    _mesa_glthread_finish(ctx);
   20913    debug_print_sync("CallLists");
   20914    CALL_CallLists(ctx->CurrentServerDispatch, (n, type, lists));
   20915 }
   20916 
   20917 
   20918 /* AlphaFunc: marshalled asynchronously */
   20919 struct marshal_cmd_AlphaFunc
   20920 {
   20921    struct marshal_cmd_base cmd_base;
   20922    GLenum func;
   20923    GLclampf ref;
   20924 };
   20925 static inline void
   20926 _mesa_unmarshal_AlphaFunc(struct gl_context *ctx, const struct marshal_cmd_AlphaFunc *cmd)
   20927 {
   20928    const GLenum func = cmd->func;
   20929    const GLclampf ref = cmd->ref;
   20930    CALL_AlphaFunc(ctx->CurrentServerDispatch, (func, ref));
   20931 }
   20932 static void GLAPIENTRY
   20933 _mesa_marshal_AlphaFunc(GLenum func, GLclampf ref)
   20934 {
   20935    GET_CURRENT_CONTEXT(ctx);
   20936    size_t cmd_size = sizeof(struct marshal_cmd_AlphaFunc);
   20937    struct marshal_cmd_AlphaFunc *cmd;
   20938    debug_print_marshal("AlphaFunc");
   20939    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20940       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_AlphaFunc, cmd_size);
   20941       cmd->func = func;
   20942       cmd->ref = ref;
   20943       _mesa_post_marshal_hook(ctx);
   20944       return;
   20945    }
   20946 
   20947    _mesa_glthread_finish(ctx);
   20948    debug_print_sync_fallback("AlphaFunc");
   20949    CALL_AlphaFunc(ctx->CurrentServerDispatch, (func, ref));
   20950 }
   20951 
   20952 
   20953 /* GetTextureParameterfv: marshalled synchronously */
   20954 static void GLAPIENTRY
   20955 _mesa_marshal_GetTextureParameterfv(GLuint texture, GLenum pname, GLfloat * params)
   20956 {
   20957    GET_CURRENT_CONTEXT(ctx);
   20958    _mesa_glthread_finish(ctx);
   20959    debug_print_sync("GetTextureParameterfv");
   20960    CALL_GetTextureParameterfv(ctx->CurrentServerDispatch, (texture, pname, params));
   20961 }
   20962 
   20963 
   20964 /* EdgeFlag: marshalled asynchronously */
   20965 struct marshal_cmd_EdgeFlag
   20966 {
   20967    struct marshal_cmd_base cmd_base;
   20968    GLboolean flag;
   20969 };
   20970 static inline void
   20971 _mesa_unmarshal_EdgeFlag(struct gl_context *ctx, const struct marshal_cmd_EdgeFlag *cmd)
   20972 {
   20973    const GLboolean flag = cmd->flag;
   20974    CALL_EdgeFlag(ctx->CurrentServerDispatch, (flag));
   20975 }
   20976 static void GLAPIENTRY
   20977 _mesa_marshal_EdgeFlag(GLboolean flag)
   20978 {
   20979    GET_CURRENT_CONTEXT(ctx);
   20980    size_t cmd_size = sizeof(struct marshal_cmd_EdgeFlag);
   20981    struct marshal_cmd_EdgeFlag *cmd;
   20982    debug_print_marshal("EdgeFlag");
   20983    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   20984       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EdgeFlag, cmd_size);
   20985       cmd->flag = flag;
   20986       _mesa_post_marshal_hook(ctx);
   20987       return;
   20988    }
   20989 
   20990    _mesa_glthread_finish(ctx);
   20991    debug_print_sync_fallback("EdgeFlag");
   20992    CALL_EdgeFlag(ctx->CurrentServerDispatch, (flag));
   20993 }
   20994 
   20995 
   20996 /* EdgeFlagv: marshalled asynchronously */
   20997 struct marshal_cmd_EdgeFlagv
   20998 {
   20999    struct marshal_cmd_base cmd_base;
   21000    GLboolean flag[1];
   21001 };
   21002 static inline void
   21003 _mesa_unmarshal_EdgeFlagv(struct gl_context *ctx, const struct marshal_cmd_EdgeFlagv *cmd)
   21004 {
   21005    const GLboolean * flag = cmd->flag;
   21006    CALL_EdgeFlagv(ctx->CurrentServerDispatch, (flag));
   21007 }
   21008 static void GLAPIENTRY
   21009 _mesa_marshal_EdgeFlagv(const GLboolean * flag)
   21010 {
   21011    GET_CURRENT_CONTEXT(ctx);
   21012    size_t cmd_size = sizeof(struct marshal_cmd_EdgeFlagv);
   21013    struct marshal_cmd_EdgeFlagv *cmd;
   21014    debug_print_marshal("EdgeFlagv");
   21015    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21016       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EdgeFlagv, cmd_size);
   21017       memcpy(cmd->flag, flag, 1);
   21018       _mesa_post_marshal_hook(ctx);
   21019       return;
   21020    }
   21021 
   21022    _mesa_glthread_finish(ctx);
   21023    debug_print_sync_fallback("EdgeFlagv");
   21024    CALL_EdgeFlagv(ctx->CurrentServerDispatch, (flag));
   21025 }
   21026 
   21027 
   21028 /* DepthRangex: marshalled asynchronously */
   21029 struct marshal_cmd_DepthRangex
   21030 {
   21031    struct marshal_cmd_base cmd_base;
   21032    GLclampx zNear;
   21033    GLclampx zFar;
   21034 };
   21035 static inline void
   21036 _mesa_unmarshal_DepthRangex(struct gl_context *ctx, const struct marshal_cmd_DepthRangex *cmd)
   21037 {
   21038    const GLclampx zNear = cmd->zNear;
   21039    const GLclampx zFar = cmd->zFar;
   21040    CALL_DepthRangex(ctx->CurrentServerDispatch, (zNear, zFar));
   21041 }
   21042 static void GLAPIENTRY
   21043 _mesa_marshal_DepthRangex(GLclampx zNear, GLclampx zFar)
   21044 {
   21045    GET_CURRENT_CONTEXT(ctx);
   21046    size_t cmd_size = sizeof(struct marshal_cmd_DepthRangex);
   21047    struct marshal_cmd_DepthRangex *cmd;
   21048    debug_print_marshal("DepthRangex");
   21049    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21050       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DepthRangex, cmd_size);
   21051       cmd->zNear = zNear;
   21052       cmd->zFar = zFar;
   21053       _mesa_post_marshal_hook(ctx);
   21054       return;
   21055    }
   21056 
   21057    _mesa_glthread_finish(ctx);
   21058    debug_print_sync_fallback("DepthRangex");
   21059    CALL_DepthRangex(ctx->CurrentServerDispatch, (zNear, zFar));
   21060 }
   21061 
   21062 
   21063 /* ProgramUniformHandleui64vARB: marshalled synchronously */
   21064 static void GLAPIENTRY
   21065 _mesa_marshal_ProgramUniformHandleui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 * value)
   21066 {
   21067    GET_CURRENT_CONTEXT(ctx);
   21068    _mesa_glthread_finish(ctx);
   21069    debug_print_sync("ProgramUniformHandleui64vARB");
   21070    CALL_ProgramUniformHandleui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
   21071 }
   21072 
   21073 
   21074 /* VDPAUInitNV: marshalled synchronously */
   21075 static void GLAPIENTRY
   21076 _mesa_marshal_VDPAUInitNV(const GLvoid * vdpDevice, const GLvoid * getProcAddress)
   21077 {
   21078    GET_CURRENT_CONTEXT(ctx);
   21079    _mesa_glthread_finish(ctx);
   21080    debug_print_sync("VDPAUInitNV");
   21081    CALL_VDPAUInitNV(ctx->CurrentServerDispatch, (vdpDevice, getProcAddress));
   21082 }
   21083 
   21084 
   21085 /* GetBufferParameteri64v: marshalled synchronously */
   21086 static void GLAPIENTRY
   21087 _mesa_marshal_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 * params)
   21088 {
   21089    GET_CURRENT_CONTEXT(ctx);
   21090    _mesa_glthread_finish(ctx);
   21091    debug_print_sync("GetBufferParameteri64v");
   21092    CALL_GetBufferParameteri64v(ctx->CurrentServerDispatch, (target, pname, params));
   21093 }
   21094 
   21095 
   21096 /* CreateProgram: marshalled synchronously */
   21097 static GLuint GLAPIENTRY
   21098 _mesa_marshal_CreateProgram(void)
   21099 {
   21100    GET_CURRENT_CONTEXT(ctx);
   21101    _mesa_glthread_finish(ctx);
   21102    debug_print_sync("CreateProgram");
   21103    return CALL_CreateProgram(ctx->CurrentServerDispatch, ());
   21104 }
   21105 
   21106 
   21107 /* DepthRangef: marshalled asynchronously */
   21108 struct marshal_cmd_DepthRangef
   21109 {
   21110    struct marshal_cmd_base cmd_base;
   21111    GLclampf zNear;
   21112    GLclampf zFar;
   21113 };
   21114 static inline void
   21115 _mesa_unmarshal_DepthRangef(struct gl_context *ctx, const struct marshal_cmd_DepthRangef *cmd)
   21116 {
   21117    const GLclampf zNear = cmd->zNear;
   21118    const GLclampf zFar = cmd->zFar;
   21119    CALL_DepthRangef(ctx->CurrentServerDispatch, (zNear, zFar));
   21120 }
   21121 static void GLAPIENTRY
   21122 _mesa_marshal_DepthRangef(GLclampf zNear, GLclampf zFar)
   21123 {
   21124    GET_CURRENT_CONTEXT(ctx);
   21125    size_t cmd_size = sizeof(struct marshal_cmd_DepthRangef);
   21126    struct marshal_cmd_DepthRangef *cmd;
   21127    debug_print_marshal("DepthRangef");
   21128    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21129       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DepthRangef, cmd_size);
   21130       cmd->zNear = zNear;
   21131       cmd->zFar = zFar;
   21132       _mesa_post_marshal_hook(ctx);
   21133       return;
   21134    }
   21135 
   21136    _mesa_glthread_finish(ctx);
   21137    debug_print_sync_fallback("DepthRangef");
   21138    CALL_DepthRangef(ctx->CurrentServerDispatch, (zNear, zFar));
   21139 }
   21140 
   21141 
   21142 /* TextureParameteriv: marshalled synchronously */
   21143 static void GLAPIENTRY
   21144 _mesa_marshal_TextureParameteriv(GLuint texture, GLenum pname, const GLint * param)
   21145 {
   21146    GET_CURRENT_CONTEXT(ctx);
   21147    _mesa_glthread_finish(ctx);
   21148    debug_print_sync("TextureParameteriv");
   21149    CALL_TextureParameteriv(ctx->CurrentServerDispatch, (texture, pname, param));
   21150 }
   21151 
   21152 
   21153 /* ColorFragmentOp3ATI: marshalled asynchronously */
   21154 struct marshal_cmd_ColorFragmentOp3ATI
   21155 {
   21156    struct marshal_cmd_base cmd_base;
   21157    GLenum op;
   21158    GLuint dst;
   21159    GLuint dstMask;
   21160    GLuint dstMod;
   21161    GLuint arg1;
   21162    GLuint arg1Rep;
   21163    GLuint arg1Mod;
   21164    GLuint arg2;
   21165    GLuint arg2Rep;
   21166    GLuint arg2Mod;
   21167    GLuint arg3;
   21168    GLuint arg3Rep;
   21169    GLuint arg3Mod;
   21170 };
   21171 static inline void
   21172 _mesa_unmarshal_ColorFragmentOp3ATI(struct gl_context *ctx, const struct marshal_cmd_ColorFragmentOp3ATI *cmd)
   21173 {
   21174    const GLenum op = cmd->op;
   21175    const GLuint dst = cmd->dst;
   21176    const GLuint dstMask = cmd->dstMask;
   21177    const GLuint dstMod = cmd->dstMod;
   21178    const GLuint arg1 = cmd->arg1;
   21179    const GLuint arg1Rep = cmd->arg1Rep;
   21180    const GLuint arg1Mod = cmd->arg1Mod;
   21181    const GLuint arg2 = cmd->arg2;
   21182    const GLuint arg2Rep = cmd->arg2Rep;
   21183    const GLuint arg2Mod = cmd->arg2Mod;
   21184    const GLuint arg3 = cmd->arg3;
   21185    const GLuint arg3Rep = cmd->arg3Rep;
   21186    const GLuint arg3Mod = cmd->arg3Mod;
   21187    CALL_ColorFragmentOp3ATI(ctx->CurrentServerDispatch, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod));
   21188 }
   21189 static void GLAPIENTRY
   21190 _mesa_marshal_ColorFragmentOp3ATI(GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod)
   21191 {
   21192    GET_CURRENT_CONTEXT(ctx);
   21193    size_t cmd_size = sizeof(struct marshal_cmd_ColorFragmentOp3ATI);
   21194    struct marshal_cmd_ColorFragmentOp3ATI *cmd;
   21195    debug_print_marshal("ColorFragmentOp3ATI");
   21196    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21197       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorFragmentOp3ATI, cmd_size);
   21198       cmd->op = op;
   21199       cmd->dst = dst;
   21200       cmd->dstMask = dstMask;
   21201       cmd->dstMod = dstMod;
   21202       cmd->arg1 = arg1;
   21203       cmd->arg1Rep = arg1Rep;
   21204       cmd->arg1Mod = arg1Mod;
   21205       cmd->arg2 = arg2;
   21206       cmd->arg2Rep = arg2Rep;
   21207       cmd->arg2Mod = arg2Mod;
   21208       cmd->arg3 = arg3;
   21209       cmd->arg3Rep = arg3Rep;
   21210       cmd->arg3Mod = arg3Mod;
   21211       _mesa_post_marshal_hook(ctx);
   21212       return;
   21213    }
   21214 
   21215    _mesa_glthread_finish(ctx);
   21216    debug_print_sync_fallback("ColorFragmentOp3ATI");
   21217    CALL_ColorFragmentOp3ATI(ctx->CurrentServerDispatch, (op, dst, dstMask, dstMod, arg1, arg1Rep, arg1Mod, arg2, arg2Rep, arg2Mod, arg3, arg3Rep, arg3Mod));
   21218 }
   21219 
   21220 
   21221 /* ValidateProgram: marshalled asynchronously */
   21222 struct marshal_cmd_ValidateProgram
   21223 {
   21224    struct marshal_cmd_base cmd_base;
   21225    GLuint program;
   21226 };
   21227 static inline void
   21228 _mesa_unmarshal_ValidateProgram(struct gl_context *ctx, const struct marshal_cmd_ValidateProgram *cmd)
   21229 {
   21230    const GLuint program = cmd->program;
   21231    CALL_ValidateProgram(ctx->CurrentServerDispatch, (program));
   21232 }
   21233 static void GLAPIENTRY
   21234 _mesa_marshal_ValidateProgram(GLuint program)
   21235 {
   21236    GET_CURRENT_CONTEXT(ctx);
   21237    size_t cmd_size = sizeof(struct marshal_cmd_ValidateProgram);
   21238    struct marshal_cmd_ValidateProgram *cmd;
   21239    debug_print_marshal("ValidateProgram");
   21240    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21241       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ValidateProgram, cmd_size);
   21242       cmd->program = program;
   21243       _mesa_post_marshal_hook(ctx);
   21244       return;
   21245    }
   21246 
   21247    _mesa_glthread_finish(ctx);
   21248    debug_print_sync_fallback("ValidateProgram");
   21249    CALL_ValidateProgram(ctx->CurrentServerDispatch, (program));
   21250 }
   21251 
   21252 
   21253 /* VertexPointerEXT: marshalled asynchronously */
   21254 struct marshal_cmd_VertexPointerEXT
   21255 {
   21256    struct marshal_cmd_base cmd_base;
   21257    GLint size;
   21258    GLenum type;
   21259    GLsizei stride;
   21260    GLsizei count;
   21261    const GLvoid * pointer;
   21262 };
   21263 static inline void
   21264 _mesa_unmarshal_VertexPointerEXT(struct gl_context *ctx, const struct marshal_cmd_VertexPointerEXT *cmd)
   21265 {
   21266    const GLint size = cmd->size;
   21267    const GLenum type = cmd->type;
   21268    const GLsizei stride = cmd->stride;
   21269    const GLsizei count = cmd->count;
   21270    const GLvoid * pointer = cmd->pointer;
   21271    CALL_VertexPointerEXT(ctx->CurrentServerDispatch, (size, type, stride, count, pointer));
   21272 }
   21273 static void GLAPIENTRY
   21274 _mesa_marshal_VertexPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
   21275 {
   21276    GET_CURRENT_CONTEXT(ctx);
   21277    size_t cmd_size = sizeof(struct marshal_cmd_VertexPointerEXT);
   21278    struct marshal_cmd_VertexPointerEXT *cmd;
   21279    debug_print_marshal("VertexPointerEXT");
   21280    if (_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)) {
   21281       _mesa_glthread_finish(ctx);
   21282       _mesa_glthread_restore_dispatch(ctx);
   21283       debug_print_sync_fallback("VertexPointerEXT");
   21284       CALL_VertexPointerEXT(ctx->CurrentServerDispatch, (size, type, stride, count, pointer));
   21285       return;
   21286    }
   21287    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21288       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexPointerEXT, cmd_size);
   21289       cmd->size = size;
   21290       cmd->type = type;
   21291       cmd->stride = stride;
   21292       cmd->count = count;
   21293       cmd->pointer = pointer;
   21294       _mesa_post_marshal_hook(ctx);
   21295       return;
   21296    }
   21297 
   21298    _mesa_glthread_finish(ctx);
   21299    debug_print_sync_fallback("VertexPointerEXT");
   21300    CALL_VertexPointerEXT(ctx->CurrentServerDispatch, (size, type, stride, count, pointer));
   21301 }
   21302 
   21303 
   21304 /* VertexAttribI4sv: marshalled synchronously */
   21305 static void GLAPIENTRY
   21306 _mesa_marshal_VertexAttribI4sv(GLuint index, const GLshort * v)
   21307 {
   21308    GET_CURRENT_CONTEXT(ctx);
   21309    _mesa_glthread_finish(ctx);
   21310    debug_print_sync("VertexAttribI4sv");
   21311    CALL_VertexAttribI4sv(ctx->CurrentServerDispatch, (index, v));
   21312 }
   21313 
   21314 
   21315 /* Scissor: marshalled asynchronously */
   21316 struct marshal_cmd_Scissor
   21317 {
   21318    struct marshal_cmd_base cmd_base;
   21319    GLint x;
   21320    GLint y;
   21321    GLsizei width;
   21322    GLsizei height;
   21323 };
   21324 static inline void
   21325 _mesa_unmarshal_Scissor(struct gl_context *ctx, const struct marshal_cmd_Scissor *cmd)
   21326 {
   21327    const GLint x = cmd->x;
   21328    const GLint y = cmd->y;
   21329    const GLsizei width = cmd->width;
   21330    const GLsizei height = cmd->height;
   21331    CALL_Scissor(ctx->CurrentServerDispatch, (x, y, width, height));
   21332 }
   21333 static void GLAPIENTRY
   21334 _mesa_marshal_Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
   21335 {
   21336    GET_CURRENT_CONTEXT(ctx);
   21337    size_t cmd_size = sizeof(struct marshal_cmd_Scissor);
   21338    struct marshal_cmd_Scissor *cmd;
   21339    debug_print_marshal("Scissor");
   21340    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21341       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Scissor, cmd_size);
   21342       cmd->x = x;
   21343       cmd->y = y;
   21344       cmd->width = width;
   21345       cmd->height = height;
   21346       _mesa_post_marshal_hook(ctx);
   21347       return;
   21348    }
   21349 
   21350    _mesa_glthread_finish(ctx);
   21351    debug_print_sync_fallback("Scissor");
   21352    CALL_Scissor(ctx->CurrentServerDispatch, (x, y, width, height));
   21353 }
   21354 
   21355 
   21356 /* BeginTransformFeedback: marshalled asynchronously */
   21357 struct marshal_cmd_BeginTransformFeedback
   21358 {
   21359    struct marshal_cmd_base cmd_base;
   21360    GLenum mode;
   21361 };
   21362 static inline void
   21363 _mesa_unmarshal_BeginTransformFeedback(struct gl_context *ctx, const struct marshal_cmd_BeginTransformFeedback *cmd)
   21364 {
   21365    const GLenum mode = cmd->mode;
   21366    CALL_BeginTransformFeedback(ctx->CurrentServerDispatch, (mode));
   21367 }
   21368 static void GLAPIENTRY
   21369 _mesa_marshal_BeginTransformFeedback(GLenum mode)
   21370 {
   21371    GET_CURRENT_CONTEXT(ctx);
   21372    size_t cmd_size = sizeof(struct marshal_cmd_BeginTransformFeedback);
   21373    struct marshal_cmd_BeginTransformFeedback *cmd;
   21374    debug_print_marshal("BeginTransformFeedback");
   21375    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21376       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BeginTransformFeedback, cmd_size);
   21377       cmd->mode = mode;
   21378       _mesa_post_marshal_hook(ctx);
   21379       return;
   21380    }
   21381 
   21382    _mesa_glthread_finish(ctx);
   21383    debug_print_sync_fallback("BeginTransformFeedback");
   21384    CALL_BeginTransformFeedback(ctx->CurrentServerDispatch, (mode));
   21385 }
   21386 
   21387 
   21388 /* TexCoord2i: marshalled asynchronously */
   21389 struct marshal_cmd_TexCoord2i
   21390 {
   21391    struct marshal_cmd_base cmd_base;
   21392    GLint s;
   21393    GLint t;
   21394 };
   21395 static inline void
   21396 _mesa_unmarshal_TexCoord2i(struct gl_context *ctx, const struct marshal_cmd_TexCoord2i *cmd)
   21397 {
   21398    const GLint s = cmd->s;
   21399    const GLint t = cmd->t;
   21400    CALL_TexCoord2i(ctx->CurrentServerDispatch, (s, t));
   21401 }
   21402 static void GLAPIENTRY
   21403 _mesa_marshal_TexCoord2i(GLint s, GLint t)
   21404 {
   21405    GET_CURRENT_CONTEXT(ctx);
   21406    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord2i);
   21407    struct marshal_cmd_TexCoord2i *cmd;
   21408    debug_print_marshal("TexCoord2i");
   21409    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21410       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord2i, cmd_size);
   21411       cmd->s = s;
   21412       cmd->t = t;
   21413       _mesa_post_marshal_hook(ctx);
   21414       return;
   21415    }
   21416 
   21417    _mesa_glthread_finish(ctx);
   21418    debug_print_sync_fallback("TexCoord2i");
   21419    CALL_TexCoord2i(ctx->CurrentServerDispatch, (s, t));
   21420 }
   21421 
   21422 
   21423 /* VertexArrayAttribBinding: marshalled asynchronously */
   21424 struct marshal_cmd_VertexArrayAttribBinding
   21425 {
   21426    struct marshal_cmd_base cmd_base;
   21427    GLuint vaobj;
   21428    GLuint attribindex;
   21429    GLuint bindingindex;
   21430 };
   21431 static inline void
   21432 _mesa_unmarshal_VertexArrayAttribBinding(struct gl_context *ctx, const struct marshal_cmd_VertexArrayAttribBinding *cmd)
   21433 {
   21434    const GLuint vaobj = cmd->vaobj;
   21435    const GLuint attribindex = cmd->attribindex;
   21436    const GLuint bindingindex = cmd->bindingindex;
   21437    CALL_VertexArrayAttribBinding(ctx->CurrentServerDispatch, (vaobj, attribindex, bindingindex));
   21438 }
   21439 static void GLAPIENTRY
   21440 _mesa_marshal_VertexArrayAttribBinding(GLuint vaobj, GLuint attribindex, GLuint bindingindex)
   21441 {
   21442    GET_CURRENT_CONTEXT(ctx);
   21443    size_t cmd_size = sizeof(struct marshal_cmd_VertexArrayAttribBinding);
   21444    struct marshal_cmd_VertexArrayAttribBinding *cmd;
   21445    debug_print_marshal("VertexArrayAttribBinding");
   21446    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21447       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayAttribBinding, cmd_size);
   21448       cmd->vaobj = vaobj;
   21449       cmd->attribindex = attribindex;
   21450       cmd->bindingindex = bindingindex;
   21451       _mesa_post_marshal_hook(ctx);
   21452       return;
   21453    }
   21454 
   21455    _mesa_glthread_finish(ctx);
   21456    debug_print_sync_fallback("VertexArrayAttribBinding");
   21457    CALL_VertexArrayAttribBinding(ctx->CurrentServerDispatch, (vaobj, attribindex, bindingindex));
   21458 }
   21459 
   21460 
   21461 /* Color4ui: marshalled asynchronously */
   21462 struct marshal_cmd_Color4ui
   21463 {
   21464    struct marshal_cmd_base cmd_base;
   21465    GLuint red;
   21466    GLuint green;
   21467    GLuint blue;
   21468    GLuint alpha;
   21469 };
   21470 static inline void
   21471 _mesa_unmarshal_Color4ui(struct gl_context *ctx, const struct marshal_cmd_Color4ui *cmd)
   21472 {
   21473    const GLuint red = cmd->red;
   21474    const GLuint green = cmd->green;
   21475    const GLuint blue = cmd->blue;
   21476    const GLuint alpha = cmd->alpha;
   21477    CALL_Color4ui(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   21478 }
   21479 static void GLAPIENTRY
   21480 _mesa_marshal_Color4ui(GLuint red, GLuint green, GLuint blue, GLuint alpha)
   21481 {
   21482    GET_CURRENT_CONTEXT(ctx);
   21483    size_t cmd_size = sizeof(struct marshal_cmd_Color4ui);
   21484    struct marshal_cmd_Color4ui *cmd;
   21485    debug_print_marshal("Color4ui");
   21486    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21487       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4ui, cmd_size);
   21488       cmd->red = red;
   21489       cmd->green = green;
   21490       cmd->blue = blue;
   21491       cmd->alpha = alpha;
   21492       _mesa_post_marshal_hook(ctx);
   21493       return;
   21494    }
   21495 
   21496    _mesa_glthread_finish(ctx);
   21497    debug_print_sync_fallback("Color4ui");
   21498    CALL_Color4ui(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   21499 }
   21500 
   21501 
   21502 /* TexCoord2f: marshalled asynchronously */
   21503 struct marshal_cmd_TexCoord2f
   21504 {
   21505    struct marshal_cmd_base cmd_base;
   21506    GLfloat s;
   21507    GLfloat t;
   21508 };
   21509 static inline void
   21510 _mesa_unmarshal_TexCoord2f(struct gl_context *ctx, const struct marshal_cmd_TexCoord2f *cmd)
   21511 {
   21512    const GLfloat s = cmd->s;
   21513    const GLfloat t = cmd->t;
   21514    CALL_TexCoord2f(ctx->CurrentServerDispatch, (s, t));
   21515 }
   21516 static void GLAPIENTRY
   21517 _mesa_marshal_TexCoord2f(GLfloat s, GLfloat t)
   21518 {
   21519    GET_CURRENT_CONTEXT(ctx);
   21520    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord2f);
   21521    struct marshal_cmd_TexCoord2f *cmd;
   21522    debug_print_marshal("TexCoord2f");
   21523    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21524       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord2f, cmd_size);
   21525       cmd->s = s;
   21526       cmd->t = t;
   21527       _mesa_post_marshal_hook(ctx);
   21528       return;
   21529    }
   21530 
   21531    _mesa_glthread_finish(ctx);
   21532    debug_print_sync_fallback("TexCoord2f");
   21533    CALL_TexCoord2f(ctx->CurrentServerDispatch, (s, t));
   21534 }
   21535 
   21536 
   21537 /* TexCoord2d: marshalled asynchronously */
   21538 struct marshal_cmd_TexCoord2d
   21539 {
   21540    struct marshal_cmd_base cmd_base;
   21541    GLdouble s;
   21542    GLdouble t;
   21543 };
   21544 static inline void
   21545 _mesa_unmarshal_TexCoord2d(struct gl_context *ctx, const struct marshal_cmd_TexCoord2d *cmd)
   21546 {
   21547    const GLdouble s = cmd->s;
   21548    const GLdouble t = cmd->t;
   21549    CALL_TexCoord2d(ctx->CurrentServerDispatch, (s, t));
   21550 }
   21551 static void GLAPIENTRY
   21552 _mesa_marshal_TexCoord2d(GLdouble s, GLdouble t)
   21553 {
   21554    GET_CURRENT_CONTEXT(ctx);
   21555    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord2d);
   21556    struct marshal_cmd_TexCoord2d *cmd;
   21557    debug_print_marshal("TexCoord2d");
   21558    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21559       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord2d, cmd_size);
   21560       cmd->s = s;
   21561       cmd->t = t;
   21562       _mesa_post_marshal_hook(ctx);
   21563       return;
   21564    }
   21565 
   21566    _mesa_glthread_finish(ctx);
   21567    debug_print_sync_fallback("TexCoord2d");
   21568    CALL_TexCoord2d(ctx->CurrentServerDispatch, (s, t));
   21569 }
   21570 
   21571 
   21572 /* GetTransformFeedbackiv: marshalled synchronously */
   21573 static void GLAPIENTRY
   21574 _mesa_marshal_GetTransformFeedbackiv(GLuint xfb, GLenum pname, GLint * param)
   21575 {
   21576    GET_CURRENT_CONTEXT(ctx);
   21577    _mesa_glthread_finish(ctx);
   21578    debug_print_sync("GetTransformFeedbackiv");
   21579    CALL_GetTransformFeedbackiv(ctx->CurrentServerDispatch, (xfb, pname, param));
   21580 }
   21581 
   21582 
   21583 /* TexCoord2s: marshalled asynchronously */
   21584 struct marshal_cmd_TexCoord2s
   21585 {
   21586    struct marshal_cmd_base cmd_base;
   21587    GLshort s;
   21588    GLshort t;
   21589 };
   21590 static inline void
   21591 _mesa_unmarshal_TexCoord2s(struct gl_context *ctx, const struct marshal_cmd_TexCoord2s *cmd)
   21592 {
   21593    const GLshort s = cmd->s;
   21594    const GLshort t = cmd->t;
   21595    CALL_TexCoord2s(ctx->CurrentServerDispatch, (s, t));
   21596 }
   21597 static void GLAPIENTRY
   21598 _mesa_marshal_TexCoord2s(GLshort s, GLshort t)
   21599 {
   21600    GET_CURRENT_CONTEXT(ctx);
   21601    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord2s);
   21602    struct marshal_cmd_TexCoord2s *cmd;
   21603    debug_print_marshal("TexCoord2s");
   21604    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21605       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord2s, cmd_size);
   21606       cmd->s = s;
   21607       cmd->t = t;
   21608       _mesa_post_marshal_hook(ctx);
   21609       return;
   21610    }
   21611 
   21612    _mesa_glthread_finish(ctx);
   21613    debug_print_sync_fallback("TexCoord2s");
   21614    CALL_TexCoord2s(ctx->CurrentServerDispatch, (s, t));
   21615 }
   21616 
   21617 
   21618 /* PointSizePointerOES: marshalled synchronously */
   21619 static void GLAPIENTRY
   21620 _mesa_marshal_PointSizePointerOES(GLenum type, GLsizei stride, const GLvoid * pointer)
   21621 {
   21622    GET_CURRENT_CONTEXT(ctx);
   21623    _mesa_glthread_finish(ctx);
   21624    debug_print_sync("PointSizePointerOES");
   21625    CALL_PointSizePointerOES(ctx->CurrentServerDispatch, (type, stride, pointer));
   21626 }
   21627 
   21628 
   21629 /* Color4us: marshalled asynchronously */
   21630 struct marshal_cmd_Color4us
   21631 {
   21632    struct marshal_cmd_base cmd_base;
   21633    GLushort red;
   21634    GLushort green;
   21635    GLushort blue;
   21636    GLushort alpha;
   21637 };
   21638 static inline void
   21639 _mesa_unmarshal_Color4us(struct gl_context *ctx, const struct marshal_cmd_Color4us *cmd)
   21640 {
   21641    const GLushort red = cmd->red;
   21642    const GLushort green = cmd->green;
   21643    const GLushort blue = cmd->blue;
   21644    const GLushort alpha = cmd->alpha;
   21645    CALL_Color4us(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   21646 }
   21647 static void GLAPIENTRY
   21648 _mesa_marshal_Color4us(GLushort red, GLushort green, GLushort blue, GLushort alpha)
   21649 {
   21650    GET_CURRENT_CONTEXT(ctx);
   21651    size_t cmd_size = sizeof(struct marshal_cmd_Color4us);
   21652    struct marshal_cmd_Color4us *cmd;
   21653    debug_print_marshal("Color4us");
   21654    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21655       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4us, cmd_size);
   21656       cmd->red = red;
   21657       cmd->green = green;
   21658       cmd->blue = blue;
   21659       cmd->alpha = alpha;
   21660       _mesa_post_marshal_hook(ctx);
   21661       return;
   21662    }
   21663 
   21664    _mesa_glthread_finish(ctx);
   21665    debug_print_sync_fallback("Color4us");
   21666    CALL_Color4us(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   21667 }
   21668 
   21669 
   21670 /* Color3bv: marshalled asynchronously */
   21671 struct marshal_cmd_Color3bv
   21672 {
   21673    struct marshal_cmd_base cmd_base;
   21674    GLbyte v[3];
   21675 };
   21676 static inline void
   21677 _mesa_unmarshal_Color3bv(struct gl_context *ctx, const struct marshal_cmd_Color3bv *cmd)
   21678 {
   21679    const GLbyte * v = cmd->v;
   21680    CALL_Color3bv(ctx->CurrentServerDispatch, (v));
   21681 }
   21682 static void GLAPIENTRY
   21683 _mesa_marshal_Color3bv(const GLbyte * v)
   21684 {
   21685    GET_CURRENT_CONTEXT(ctx);
   21686    size_t cmd_size = sizeof(struct marshal_cmd_Color3bv);
   21687    struct marshal_cmd_Color3bv *cmd;
   21688    debug_print_marshal("Color3bv");
   21689    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21690       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3bv, cmd_size);
   21691       memcpy(cmd->v, v, 3);
   21692       _mesa_post_marshal_hook(ctx);
   21693       return;
   21694    }
   21695 
   21696    _mesa_glthread_finish(ctx);
   21697    debug_print_sync_fallback("Color3bv");
   21698    CALL_Color3bv(ctx->CurrentServerDispatch, (v));
   21699 }
   21700 
   21701 
   21702 /* PrimitiveRestartNV: marshalled asynchronously */
   21703 struct marshal_cmd_PrimitiveRestartNV
   21704 {
   21705    struct marshal_cmd_base cmd_base;
   21706 };
   21707 static inline void
   21708 _mesa_unmarshal_PrimitiveRestartNV(struct gl_context *ctx, const struct marshal_cmd_PrimitiveRestartNV *cmd)
   21709 {
   21710    CALL_PrimitiveRestartNV(ctx->CurrentServerDispatch, ());
   21711 }
   21712 static void GLAPIENTRY
   21713 _mesa_marshal_PrimitiveRestartNV(void)
   21714 {
   21715    GET_CURRENT_CONTEXT(ctx);
   21716    size_t cmd_size = sizeof(struct marshal_cmd_PrimitiveRestartNV);
   21717    struct marshal_cmd_PrimitiveRestartNV *cmd;
   21718    debug_print_marshal("PrimitiveRestartNV");
   21719    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21720       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PrimitiveRestartNV, cmd_size);
   21721       (void) cmd;
   21722 
   21723       _mesa_post_marshal_hook(ctx);
   21724       return;
   21725    }
   21726 
   21727    _mesa_glthread_finish(ctx);
   21728    debug_print_sync_fallback("PrimitiveRestartNV");
   21729    CALL_PrimitiveRestartNV(ctx->CurrentServerDispatch, ());
   21730 }
   21731 
   21732 
   21733 /* BindBufferOffsetEXT: marshalled asynchronously */
   21734 struct marshal_cmd_BindBufferOffsetEXT
   21735 {
   21736    struct marshal_cmd_base cmd_base;
   21737    GLenum target;
   21738    GLuint index;
   21739    GLuint buffer;
   21740    GLintptr offset;
   21741 };
   21742 static inline void
   21743 _mesa_unmarshal_BindBufferOffsetEXT(struct gl_context *ctx, const struct marshal_cmd_BindBufferOffsetEXT *cmd)
   21744 {
   21745    const GLenum target = cmd->target;
   21746    const GLuint index = cmd->index;
   21747    const GLuint buffer = cmd->buffer;
   21748    const GLintptr offset = cmd->offset;
   21749    CALL_BindBufferOffsetEXT(ctx->CurrentServerDispatch, (target, index, buffer, offset));
   21750 }
   21751 static void GLAPIENTRY
   21752 _mesa_marshal_BindBufferOffsetEXT(GLenum target, GLuint index, GLuint buffer, GLintptr offset)
   21753 {
   21754    GET_CURRENT_CONTEXT(ctx);
   21755    size_t cmd_size = sizeof(struct marshal_cmd_BindBufferOffsetEXT);
   21756    struct marshal_cmd_BindBufferOffsetEXT *cmd;
   21757    debug_print_marshal("BindBufferOffsetEXT");
   21758    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21759       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindBufferOffsetEXT, cmd_size);
   21760       cmd->target = target;
   21761       cmd->index = index;
   21762       cmd->buffer = buffer;
   21763       cmd->offset = offset;
   21764       _mesa_post_marshal_hook(ctx);
   21765       return;
   21766    }
   21767 
   21768    _mesa_glthread_finish(ctx);
   21769    debug_print_sync_fallback("BindBufferOffsetEXT");
   21770    CALL_BindBufferOffsetEXT(ctx->CurrentServerDispatch, (target, index, buffer, offset));
   21771 }
   21772 
   21773 
   21774 /* ProvokingVertex: marshalled asynchronously */
   21775 struct marshal_cmd_ProvokingVertex
   21776 {
   21777    struct marshal_cmd_base cmd_base;
   21778    GLenum mode;
   21779 };
   21780 static inline void
   21781 _mesa_unmarshal_ProvokingVertex(struct gl_context *ctx, const struct marshal_cmd_ProvokingVertex *cmd)
   21782 {
   21783    const GLenum mode = cmd->mode;
   21784    CALL_ProvokingVertex(ctx->CurrentServerDispatch, (mode));
   21785 }
   21786 static void GLAPIENTRY
   21787 _mesa_marshal_ProvokingVertex(GLenum mode)
   21788 {
   21789    GET_CURRENT_CONTEXT(ctx);
   21790    size_t cmd_size = sizeof(struct marshal_cmd_ProvokingVertex);
   21791    struct marshal_cmd_ProvokingVertex *cmd;
   21792    debug_print_marshal("ProvokingVertex");
   21793    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21794       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProvokingVertex, cmd_size);
   21795       cmd->mode = mode;
   21796       _mesa_post_marshal_hook(ctx);
   21797       return;
   21798    }
   21799 
   21800    _mesa_glthread_finish(ctx);
   21801    debug_print_sync_fallback("ProvokingVertex");
   21802    CALL_ProvokingVertex(ctx->CurrentServerDispatch, (mode));
   21803 }
   21804 
   21805 
   21806 /* VertexAttribs4fvNV: marshalled asynchronously */
   21807 struct marshal_cmd_VertexAttribs4fvNV
   21808 {
   21809    struct marshal_cmd_base cmd_base;
   21810    GLuint index;
   21811    GLsizei n;
   21812    /* Next safe_mul(n, 16) bytes are GLfloat v[n][4] */
   21813 };
   21814 static inline void
   21815 _mesa_unmarshal_VertexAttribs4fvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs4fvNV *cmd)
   21816 {
   21817    const GLuint index = cmd->index;
   21818    const GLsizei n = cmd->n;
   21819    const GLfloat * v;
   21820    const char *variable_data = (const char *) (cmd + 1);
   21821    v = (const GLfloat *) variable_data;
   21822    variable_data += n * 16;
   21823    CALL_VertexAttribs4fvNV(ctx->CurrentServerDispatch, (index, n, v));
   21824 }
   21825 static void GLAPIENTRY
   21826 _mesa_marshal_VertexAttribs4fvNV(GLuint index, GLsizei n, const GLfloat * v)
   21827 {
   21828    GET_CURRENT_CONTEXT(ctx);
   21829    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribs4fvNV) + safe_mul(n, 16);
   21830    struct marshal_cmd_VertexAttribs4fvNV *cmd;
   21831    debug_print_marshal("VertexAttribs4fvNV");
   21832    if (unlikely(safe_mul(n, 16) < 0)) {
   21833       goto fallback_to_sync;
   21834    }
   21835    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21836       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs4fvNV, cmd_size);
   21837       cmd->index = index;
   21838       cmd->n = n;
   21839       char *variable_data = (char *) (cmd + 1);
   21840       memcpy(variable_data, v, n * 16);
   21841       variable_data += n * 16;
   21842       _mesa_post_marshal_hook(ctx);
   21843       return;
   21844    }
   21845 
   21846 fallback_to_sync:
   21847    _mesa_glthread_finish(ctx);
   21848    debug_print_sync_fallback("VertexAttribs4fvNV");
   21849    CALL_VertexAttribs4fvNV(ctx->CurrentServerDispatch, (index, n, v));
   21850 }
   21851 
   21852 
   21853 /* Vertex2i: marshalled asynchronously */
   21854 struct marshal_cmd_Vertex2i
   21855 {
   21856    struct marshal_cmd_base cmd_base;
   21857    GLint x;
   21858    GLint y;
   21859 };
   21860 static inline void
   21861 _mesa_unmarshal_Vertex2i(struct gl_context *ctx, const struct marshal_cmd_Vertex2i *cmd)
   21862 {
   21863    const GLint x = cmd->x;
   21864    const GLint y = cmd->y;
   21865    CALL_Vertex2i(ctx->CurrentServerDispatch, (x, y));
   21866 }
   21867 static void GLAPIENTRY
   21868 _mesa_marshal_Vertex2i(GLint x, GLint y)
   21869 {
   21870    GET_CURRENT_CONTEXT(ctx);
   21871    size_t cmd_size = sizeof(struct marshal_cmd_Vertex2i);
   21872    struct marshal_cmd_Vertex2i *cmd;
   21873    debug_print_marshal("Vertex2i");
   21874    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21875       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex2i, cmd_size);
   21876       cmd->x = x;
   21877       cmd->y = y;
   21878       _mesa_post_marshal_hook(ctx);
   21879       return;
   21880    }
   21881 
   21882    _mesa_glthread_finish(ctx);
   21883    debug_print_sync_fallback("Vertex2i");
   21884    CALL_Vertex2i(ctx->CurrentServerDispatch, (x, y));
   21885 }
   21886 
   21887 
   21888 /* GetQueryBufferObjecti64v: marshalled asynchronously */
   21889 struct marshal_cmd_GetQueryBufferObjecti64v
   21890 {
   21891    struct marshal_cmd_base cmd_base;
   21892    GLuint id;
   21893    GLuint buffer;
   21894    GLenum pname;
   21895    GLintptr offset;
   21896 };
   21897 static inline void
   21898 _mesa_unmarshal_GetQueryBufferObjecti64v(struct gl_context *ctx, const struct marshal_cmd_GetQueryBufferObjecti64v *cmd)
   21899 {
   21900    const GLuint id = cmd->id;
   21901    const GLuint buffer = cmd->buffer;
   21902    const GLenum pname = cmd->pname;
   21903    const GLintptr offset = cmd->offset;
   21904    CALL_GetQueryBufferObjecti64v(ctx->CurrentServerDispatch, (id, buffer, pname, offset));
   21905 }
   21906 static void GLAPIENTRY
   21907 _mesa_marshal_GetQueryBufferObjecti64v(GLuint id, GLuint buffer, GLenum pname, GLintptr offset)
   21908 {
   21909    GET_CURRENT_CONTEXT(ctx);
   21910    size_t cmd_size = sizeof(struct marshal_cmd_GetQueryBufferObjecti64v);
   21911    struct marshal_cmd_GetQueryBufferObjecti64v *cmd;
   21912    debug_print_marshal("GetQueryBufferObjecti64v");
   21913    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21914       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetQueryBufferObjecti64v, cmd_size);
   21915       cmd->id = id;
   21916       cmd->buffer = buffer;
   21917       cmd->pname = pname;
   21918       cmd->offset = offset;
   21919       _mesa_post_marshal_hook(ctx);
   21920       return;
   21921    }
   21922 
   21923    _mesa_glthread_finish(ctx);
   21924    debug_print_sync_fallback("GetQueryBufferObjecti64v");
   21925    CALL_GetQueryBufferObjecti64v(ctx->CurrentServerDispatch, (id, buffer, pname, offset));
   21926 }
   21927 
   21928 
   21929 /* InterleavedArrays: marshalled synchronously */
   21930 static void GLAPIENTRY
   21931 _mesa_marshal_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid * pointer)
   21932 {
   21933    GET_CURRENT_CONTEXT(ctx);
   21934    _mesa_glthread_finish(ctx);
   21935    debug_print_sync("InterleavedArrays");
   21936    CALL_InterleavedArrays(ctx->CurrentServerDispatch, (format, stride, pointer));
   21937 }
   21938 
   21939 
   21940 /* RasterPos2fv: marshalled asynchronously */
   21941 struct marshal_cmd_RasterPos2fv
   21942 {
   21943    struct marshal_cmd_base cmd_base;
   21944    GLfloat v[2];
   21945 };
   21946 static inline void
   21947 _mesa_unmarshal_RasterPos2fv(struct gl_context *ctx, const struct marshal_cmd_RasterPos2fv *cmd)
   21948 {
   21949    const GLfloat * v = cmd->v;
   21950    CALL_RasterPos2fv(ctx->CurrentServerDispatch, (v));
   21951 }
   21952 static void GLAPIENTRY
   21953 _mesa_marshal_RasterPos2fv(const GLfloat * v)
   21954 {
   21955    GET_CURRENT_CONTEXT(ctx);
   21956    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos2fv);
   21957    struct marshal_cmd_RasterPos2fv *cmd;
   21958    debug_print_marshal("RasterPos2fv");
   21959    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21960       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos2fv, cmd_size);
   21961       memcpy(cmd->v, v, 8);
   21962       _mesa_post_marshal_hook(ctx);
   21963       return;
   21964    }
   21965 
   21966    _mesa_glthread_finish(ctx);
   21967    debug_print_sync_fallback("RasterPos2fv");
   21968    CALL_RasterPos2fv(ctx->CurrentServerDispatch, (v));
   21969 }
   21970 
   21971 
   21972 /* TexCoord1fv: marshalled asynchronously */
   21973 struct marshal_cmd_TexCoord1fv
   21974 {
   21975    struct marshal_cmd_base cmd_base;
   21976    GLfloat v[1];
   21977 };
   21978 static inline void
   21979 _mesa_unmarshal_TexCoord1fv(struct gl_context *ctx, const struct marshal_cmd_TexCoord1fv *cmd)
   21980 {
   21981    const GLfloat * v = cmd->v;
   21982    CALL_TexCoord1fv(ctx->CurrentServerDispatch, (v));
   21983 }
   21984 static void GLAPIENTRY
   21985 _mesa_marshal_TexCoord1fv(const GLfloat * v)
   21986 {
   21987    GET_CURRENT_CONTEXT(ctx);
   21988    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord1fv);
   21989    struct marshal_cmd_TexCoord1fv *cmd;
   21990    debug_print_marshal("TexCoord1fv");
   21991    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   21992       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord1fv, cmd_size);
   21993       memcpy(cmd->v, v, 4);
   21994       _mesa_post_marshal_hook(ctx);
   21995       return;
   21996    }
   21997 
   21998    _mesa_glthread_finish(ctx);
   21999    debug_print_sync_fallback("TexCoord1fv");
   22000    CALL_TexCoord1fv(ctx->CurrentServerDispatch, (v));
   22001 }
   22002 
   22003 
   22004 /* MultiTexCoord4dv: marshalled asynchronously */
   22005 struct marshal_cmd_MultiTexCoord4dv
   22006 {
   22007    struct marshal_cmd_base cmd_base;
   22008    GLenum target;
   22009    GLdouble v[4];
   22010 };
   22011 static inline void
   22012 _mesa_unmarshal_MultiTexCoord4dv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4dv *cmd)
   22013 {
   22014    const GLenum target = cmd->target;
   22015    const GLdouble * v = cmd->v;
   22016    CALL_MultiTexCoord4dv(ctx->CurrentServerDispatch, (target, v));
   22017 }
   22018 static void GLAPIENTRY
   22019 _mesa_marshal_MultiTexCoord4dv(GLenum target, const GLdouble * v)
   22020 {
   22021    GET_CURRENT_CONTEXT(ctx);
   22022    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4dv);
   22023    struct marshal_cmd_MultiTexCoord4dv *cmd;
   22024    debug_print_marshal("MultiTexCoord4dv");
   22025    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22026       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4dv, cmd_size);
   22027       cmd->target = target;
   22028       memcpy(cmd->v, v, 32);
   22029       _mesa_post_marshal_hook(ctx);
   22030       return;
   22031    }
   22032 
   22033    _mesa_glthread_finish(ctx);
   22034    debug_print_sync_fallback("MultiTexCoord4dv");
   22035    CALL_MultiTexCoord4dv(ctx->CurrentServerDispatch, (target, v));
   22036 }
   22037 
   22038 
   22039 /* ProgramEnvParameter4fvARB: marshalled asynchronously */
   22040 struct marshal_cmd_ProgramEnvParameter4fvARB
   22041 {
   22042    struct marshal_cmd_base cmd_base;
   22043    GLenum target;
   22044    GLuint index;
   22045    GLfloat params[4];
   22046 };
   22047 static inline void
   22048 _mesa_unmarshal_ProgramEnvParameter4fvARB(struct gl_context *ctx, const struct marshal_cmd_ProgramEnvParameter4fvARB *cmd)
   22049 {
   22050    const GLenum target = cmd->target;
   22051    const GLuint index = cmd->index;
   22052    const GLfloat * params = cmd->params;
   22053    CALL_ProgramEnvParameter4fvARB(ctx->CurrentServerDispatch, (target, index, params));
   22054 }
   22055 static void GLAPIENTRY
   22056 _mesa_marshal_ProgramEnvParameter4fvARB(GLenum target, GLuint index, const GLfloat * params)
   22057 {
   22058    GET_CURRENT_CONTEXT(ctx);
   22059    size_t cmd_size = sizeof(struct marshal_cmd_ProgramEnvParameter4fvARB);
   22060    struct marshal_cmd_ProgramEnvParameter4fvARB *cmd;
   22061    debug_print_marshal("ProgramEnvParameter4fvARB");
   22062    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22063       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramEnvParameter4fvARB, cmd_size);
   22064       cmd->target = target;
   22065       cmd->index = index;
   22066       memcpy(cmd->params, params, 16);
   22067       _mesa_post_marshal_hook(ctx);
   22068       return;
   22069    }
   22070 
   22071    _mesa_glthread_finish(ctx);
   22072    debug_print_sync_fallback("ProgramEnvParameter4fvARB");
   22073    CALL_ProgramEnvParameter4fvARB(ctx->CurrentServerDispatch, (target, index, params));
   22074 }
   22075 
   22076 
   22077 /* RasterPos4fv: marshalled asynchronously */
   22078 struct marshal_cmd_RasterPos4fv
   22079 {
   22080    struct marshal_cmd_base cmd_base;
   22081    GLfloat v[4];
   22082 };
   22083 static inline void
   22084 _mesa_unmarshal_RasterPos4fv(struct gl_context *ctx, const struct marshal_cmd_RasterPos4fv *cmd)
   22085 {
   22086    const GLfloat * v = cmd->v;
   22087    CALL_RasterPos4fv(ctx->CurrentServerDispatch, (v));
   22088 }
   22089 static void GLAPIENTRY
   22090 _mesa_marshal_RasterPos4fv(const GLfloat * v)
   22091 {
   22092    GET_CURRENT_CONTEXT(ctx);
   22093    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos4fv);
   22094    struct marshal_cmd_RasterPos4fv *cmd;
   22095    debug_print_marshal("RasterPos4fv");
   22096    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22097       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos4fv, cmd_size);
   22098       memcpy(cmd->v, v, 16);
   22099       _mesa_post_marshal_hook(ctx);
   22100       return;
   22101    }
   22102 
   22103    _mesa_glthread_finish(ctx);
   22104    debug_print_sync_fallback("RasterPos4fv");
   22105    CALL_RasterPos4fv(ctx->CurrentServerDispatch, (v));
   22106 }
   22107 
   22108 
   22109 /* PushMatrix: marshalled asynchronously */
   22110 struct marshal_cmd_PushMatrix
   22111 {
   22112    struct marshal_cmd_base cmd_base;
   22113 };
   22114 static inline void
   22115 _mesa_unmarshal_PushMatrix(struct gl_context *ctx, const struct marshal_cmd_PushMatrix *cmd)
   22116 {
   22117    CALL_PushMatrix(ctx->CurrentServerDispatch, ());
   22118 }
   22119 static void GLAPIENTRY
   22120 _mesa_marshal_PushMatrix(void)
   22121 {
   22122    GET_CURRENT_CONTEXT(ctx);
   22123    size_t cmd_size = sizeof(struct marshal_cmd_PushMatrix);
   22124    struct marshal_cmd_PushMatrix *cmd;
   22125    debug_print_marshal("PushMatrix");
   22126    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22127       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PushMatrix, cmd_size);
   22128       (void) cmd;
   22129 
   22130       _mesa_post_marshal_hook(ctx);
   22131       return;
   22132    }
   22133 
   22134    _mesa_glthread_finish(ctx);
   22135    debug_print_sync_fallback("PushMatrix");
   22136    CALL_PushMatrix(ctx->CurrentServerDispatch, ());
   22137 }
   22138 
   22139 
   22140 /* EndList: marshalled asynchronously */
   22141 struct marshal_cmd_EndList
   22142 {
   22143    struct marshal_cmd_base cmd_base;
   22144 };
   22145 static inline void
   22146 _mesa_unmarshal_EndList(struct gl_context *ctx, const struct marshal_cmd_EndList *cmd)
   22147 {
   22148    CALL_EndList(ctx->CurrentServerDispatch, ());
   22149 }
   22150 static void GLAPIENTRY
   22151 _mesa_marshal_EndList(void)
   22152 {
   22153    GET_CURRENT_CONTEXT(ctx);
   22154    size_t cmd_size = sizeof(struct marshal_cmd_EndList);
   22155    struct marshal_cmd_EndList *cmd;
   22156    debug_print_marshal("EndList");
   22157    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22158       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EndList, cmd_size);
   22159       (void) cmd;
   22160 
   22161       _mesa_post_marshal_hook(ctx);
   22162       return;
   22163    }
   22164 
   22165    _mesa_glthread_finish(ctx);
   22166    debug_print_sync_fallback("EndList");
   22167    CALL_EndList(ctx->CurrentServerDispatch, ());
   22168 }
   22169 
   22170 
   22171 /* DrawRangeElements: marshalled asynchronously */
   22172 struct marshal_cmd_DrawRangeElements
   22173 {
   22174    struct marshal_cmd_base cmd_base;
   22175    GLenum mode;
   22176    GLuint start;
   22177    GLuint end;
   22178    GLsizei count;
   22179    GLenum type;
   22180    const GLvoid * indices;
   22181 };
   22182 static inline void
   22183 _mesa_unmarshal_DrawRangeElements(struct gl_context *ctx, const struct marshal_cmd_DrawRangeElements *cmd)
   22184 {
   22185    const GLenum mode = cmd->mode;
   22186    const GLuint start = cmd->start;
   22187    const GLuint end = cmd->end;
   22188    const GLsizei count = cmd->count;
   22189    const GLenum type = cmd->type;
   22190    const GLvoid * indices = cmd->indices;
   22191    CALL_DrawRangeElements(ctx->CurrentServerDispatch, (mode, start, end, count, type, indices));
   22192 }
   22193 static void GLAPIENTRY
   22194 _mesa_marshal_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices)
   22195 {
   22196    GET_CURRENT_CONTEXT(ctx);
   22197    size_t cmd_size = sizeof(struct marshal_cmd_DrawRangeElements);
   22198    struct marshal_cmd_DrawRangeElements *cmd;
   22199    debug_print_marshal("DrawRangeElements");
   22200    if (_mesa_glthread_is_non_vbo_draw_elements(ctx)) {
   22201       _mesa_glthread_finish(ctx);
   22202       _mesa_glthread_restore_dispatch(ctx);
   22203       debug_print_sync_fallback("DrawRangeElements");
   22204       CALL_DrawRangeElements(ctx->CurrentServerDispatch, (mode, start, end, count, type, indices));
   22205       return;
   22206    }
   22207    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22208       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawRangeElements, cmd_size);
   22209       cmd->mode = mode;
   22210       cmd->start = start;
   22211       cmd->end = end;
   22212       cmd->count = count;
   22213       cmd->type = type;
   22214       cmd->indices = indices;
   22215       _mesa_post_marshal_hook(ctx);
   22216       return;
   22217    }
   22218 
   22219    _mesa_glthread_finish(ctx);
   22220    debug_print_sync_fallback("DrawRangeElements");
   22221    CALL_DrawRangeElements(ctx->CurrentServerDispatch, (mode, start, end, count, type, indices));
   22222 }
   22223 
   22224 
   22225 /* GetTexGenxvOES: marshalled synchronously */
   22226 static void GLAPIENTRY
   22227 _mesa_marshal_GetTexGenxvOES(GLenum coord, GLenum pname, GLfixed * params)
   22228 {
   22229    GET_CURRENT_CONTEXT(ctx);
   22230    _mesa_glthread_finish(ctx);
   22231    debug_print_sync("GetTexGenxvOES");
   22232    CALL_GetTexGenxvOES(ctx->CurrentServerDispatch, (coord, pname, params));
   22233 }
   22234 
   22235 
   22236 /* GetHandleARB: marshalled synchronously */
   22237 static GLhandleARB GLAPIENTRY
   22238 _mesa_marshal_GetHandleARB(GLenum pname)
   22239 {
   22240    GET_CURRENT_CONTEXT(ctx);
   22241    _mesa_glthread_finish(ctx);
   22242    debug_print_sync("GetHandleARB");
   22243    return CALL_GetHandleARB(ctx->CurrentServerDispatch, (pname));
   22244 }
   22245 
   22246 
   22247 /* DrawTexfvOES: marshalled asynchronously */
   22248 struct marshal_cmd_DrawTexfvOES
   22249 {
   22250    struct marshal_cmd_base cmd_base;
   22251    GLfloat coords[5];
   22252 };
   22253 static inline void
   22254 _mesa_unmarshal_DrawTexfvOES(struct gl_context *ctx, const struct marshal_cmd_DrawTexfvOES *cmd)
   22255 {
   22256    const GLfloat * coords = cmd->coords;
   22257    CALL_DrawTexfvOES(ctx->CurrentServerDispatch, (coords));
   22258 }
   22259 static void GLAPIENTRY
   22260 _mesa_marshal_DrawTexfvOES(const GLfloat * coords)
   22261 {
   22262    GET_CURRENT_CONTEXT(ctx);
   22263    size_t cmd_size = sizeof(struct marshal_cmd_DrawTexfvOES);
   22264    struct marshal_cmd_DrawTexfvOES *cmd;
   22265    debug_print_marshal("DrawTexfvOES");
   22266    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22267       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTexfvOES, cmd_size);
   22268       memcpy(cmd->coords, coords, 20);
   22269       _mesa_post_marshal_hook(ctx);
   22270       return;
   22271    }
   22272 
   22273    _mesa_glthread_finish(ctx);
   22274    debug_print_sync_fallback("DrawTexfvOES");
   22275    CALL_DrawTexfvOES(ctx->CurrentServerDispatch, (coords));
   22276 }
   22277 
   22278 
   22279 /* BlendFunciARB: marshalled asynchronously */
   22280 struct marshal_cmd_BlendFunciARB
   22281 {
   22282    struct marshal_cmd_base cmd_base;
   22283    GLuint buf;
   22284    GLenum src;
   22285    GLenum dst;
   22286 };
   22287 static inline void
   22288 _mesa_unmarshal_BlendFunciARB(struct gl_context *ctx, const struct marshal_cmd_BlendFunciARB *cmd)
   22289 {
   22290    const GLuint buf = cmd->buf;
   22291    const GLenum src = cmd->src;
   22292    const GLenum dst = cmd->dst;
   22293    CALL_BlendFunciARB(ctx->CurrentServerDispatch, (buf, src, dst));
   22294 }
   22295 static void GLAPIENTRY
   22296 _mesa_marshal_BlendFunciARB(GLuint buf, GLenum src, GLenum dst)
   22297 {
   22298    GET_CURRENT_CONTEXT(ctx);
   22299    size_t cmd_size = sizeof(struct marshal_cmd_BlendFunciARB);
   22300    struct marshal_cmd_BlendFunciARB *cmd;
   22301    debug_print_marshal("BlendFunciARB");
   22302    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22303       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendFunciARB, cmd_size);
   22304       cmd->buf = buf;
   22305       cmd->src = src;
   22306       cmd->dst = dst;
   22307       _mesa_post_marshal_hook(ctx);
   22308       return;
   22309    }
   22310 
   22311    _mesa_glthread_finish(ctx);
   22312    debug_print_sync_fallback("BlendFunciARB");
   22313    CALL_BlendFunciARB(ctx->CurrentServerDispatch, (buf, src, dst));
   22314 }
   22315 
   22316 
   22317 /* ClearNamedFramebufferfi: marshalled asynchronously */
   22318 struct marshal_cmd_ClearNamedFramebufferfi
   22319 {
   22320    struct marshal_cmd_base cmd_base;
   22321    GLuint framebuffer;
   22322    GLenum buffer;
   22323    GLint drawbuffer;
   22324    GLfloat depth;
   22325    GLint stencil;
   22326 };
   22327 static inline void
   22328 _mesa_unmarshal_ClearNamedFramebufferfi(struct gl_context *ctx, const struct marshal_cmd_ClearNamedFramebufferfi *cmd)
   22329 {
   22330    const GLuint framebuffer = cmd->framebuffer;
   22331    const GLenum buffer = cmd->buffer;
   22332    const GLint drawbuffer = cmd->drawbuffer;
   22333    const GLfloat depth = cmd->depth;
   22334    const GLint stencil = cmd->stencil;
   22335    CALL_ClearNamedFramebufferfi(ctx->CurrentServerDispatch, (framebuffer, buffer, drawbuffer, depth, stencil));
   22336 }
   22337 static void GLAPIENTRY
   22338 _mesa_marshal_ClearNamedFramebufferfi(GLuint framebuffer, GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
   22339 {
   22340    GET_CURRENT_CONTEXT(ctx);
   22341    size_t cmd_size = sizeof(struct marshal_cmd_ClearNamedFramebufferfi);
   22342    struct marshal_cmd_ClearNamedFramebufferfi *cmd;
   22343    debug_print_marshal("ClearNamedFramebufferfi");
   22344    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22345       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearNamedFramebufferfi, cmd_size);
   22346       cmd->framebuffer = framebuffer;
   22347       cmd->buffer = buffer;
   22348       cmd->drawbuffer = drawbuffer;
   22349       cmd->depth = depth;
   22350       cmd->stencil = stencil;
   22351       _mesa_post_marshal_hook(ctx);
   22352       return;
   22353    }
   22354 
   22355    _mesa_glthread_finish(ctx);
   22356    debug_print_sync_fallback("ClearNamedFramebufferfi");
   22357    CALL_ClearNamedFramebufferfi(ctx->CurrentServerDispatch, (framebuffer, buffer, drawbuffer, depth, stencil));
   22358 }
   22359 
   22360 
   22361 /* ClearNamedFramebufferfv: marshalled synchronously */
   22362 static void GLAPIENTRY
   22363 _mesa_marshal_ClearNamedFramebufferfv(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLfloat * value)
   22364 {
   22365    GET_CURRENT_CONTEXT(ctx);
   22366    _mesa_glthread_finish(ctx);
   22367    debug_print_sync("ClearNamedFramebufferfv");
   22368    CALL_ClearNamedFramebufferfv(ctx->CurrentServerDispatch, (framebuffer, buffer, drawbuffer, value));
   22369 }
   22370 
   22371 
   22372 /* Uniform2ui: marshalled asynchronously */
   22373 struct marshal_cmd_Uniform2ui
   22374 {
   22375    struct marshal_cmd_base cmd_base;
   22376    GLint location;
   22377    GLuint x;
   22378    GLuint y;
   22379 };
   22380 static inline void
   22381 _mesa_unmarshal_Uniform2ui(struct gl_context *ctx, const struct marshal_cmd_Uniform2ui *cmd)
   22382 {
   22383    const GLint location = cmd->location;
   22384    const GLuint x = cmd->x;
   22385    const GLuint y = cmd->y;
   22386    CALL_Uniform2ui(ctx->CurrentServerDispatch, (location, x, y));
   22387 }
   22388 static void GLAPIENTRY
   22389 _mesa_marshal_Uniform2ui(GLint location, GLuint x, GLuint y)
   22390 {
   22391    GET_CURRENT_CONTEXT(ctx);
   22392    size_t cmd_size = sizeof(struct marshal_cmd_Uniform2ui);
   22393    struct marshal_cmd_Uniform2ui *cmd;
   22394    debug_print_marshal("Uniform2ui");
   22395    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22396       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2ui, cmd_size);
   22397       cmd->location = location;
   22398       cmd->x = x;
   22399       cmd->y = y;
   22400       _mesa_post_marshal_hook(ctx);
   22401       return;
   22402    }
   22403 
   22404    _mesa_glthread_finish(ctx);
   22405    debug_print_sync_fallback("Uniform2ui");
   22406    CALL_Uniform2ui(ctx->CurrentServerDispatch, (location, x, y));
   22407 }
   22408 
   22409 
   22410 /* ScissorIndexed: marshalled asynchronously */
   22411 struct marshal_cmd_ScissorIndexed
   22412 {
   22413    struct marshal_cmd_base cmd_base;
   22414    GLuint index;
   22415    GLint left;
   22416    GLint bottom;
   22417    GLsizei width;
   22418    GLsizei height;
   22419 };
   22420 static inline void
   22421 _mesa_unmarshal_ScissorIndexed(struct gl_context *ctx, const struct marshal_cmd_ScissorIndexed *cmd)
   22422 {
   22423    const GLuint index = cmd->index;
   22424    const GLint left = cmd->left;
   22425    const GLint bottom = cmd->bottom;
   22426    const GLsizei width = cmd->width;
   22427    const GLsizei height = cmd->height;
   22428    CALL_ScissorIndexed(ctx->CurrentServerDispatch, (index, left, bottom, width, height));
   22429 }
   22430 static void GLAPIENTRY
   22431 _mesa_marshal_ScissorIndexed(GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height)
   22432 {
   22433    GET_CURRENT_CONTEXT(ctx);
   22434    size_t cmd_size = sizeof(struct marshal_cmd_ScissorIndexed);
   22435    struct marshal_cmd_ScissorIndexed *cmd;
   22436    debug_print_marshal("ScissorIndexed");
   22437    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22438       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ScissorIndexed, cmd_size);
   22439       cmd->index = index;
   22440       cmd->left = left;
   22441       cmd->bottom = bottom;
   22442       cmd->width = width;
   22443       cmd->height = height;
   22444       _mesa_post_marshal_hook(ctx);
   22445       return;
   22446    }
   22447 
   22448    _mesa_glthread_finish(ctx);
   22449    debug_print_sync_fallback("ScissorIndexed");
   22450    CALL_ScissorIndexed(ctx->CurrentServerDispatch, (index, left, bottom, width, height));
   22451 }
   22452 
   22453 
   22454 /* End: marshalled asynchronously */
   22455 struct marshal_cmd_End
   22456 {
   22457    struct marshal_cmd_base cmd_base;
   22458 };
   22459 static inline void
   22460 _mesa_unmarshal_End(struct gl_context *ctx, const struct marshal_cmd_End *cmd)
   22461 {
   22462    CALL_End(ctx->CurrentServerDispatch, ());
   22463 }
   22464 static void GLAPIENTRY
   22465 _mesa_marshal_End(void)
   22466 {
   22467    GET_CURRENT_CONTEXT(ctx);
   22468    size_t cmd_size = sizeof(struct marshal_cmd_End);
   22469    struct marshal_cmd_End *cmd;
   22470    debug_print_marshal("End");
   22471    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22472       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_End, cmd_size);
   22473       (void) cmd;
   22474 
   22475       _mesa_post_marshal_hook(ctx);
   22476       return;
   22477    }
   22478 
   22479    _mesa_glthread_finish(ctx);
   22480    debug_print_sync_fallback("End");
   22481    CALL_End(ctx->CurrentServerDispatch, ());
   22482 }
   22483 
   22484 
   22485 /* NamedFramebufferParameteri: marshalled asynchronously */
   22486 struct marshal_cmd_NamedFramebufferParameteri
   22487 {
   22488    struct marshal_cmd_base cmd_base;
   22489    GLuint framebuffer;
   22490    GLenum pname;
   22491    GLint param;
   22492 };
   22493 static inline void
   22494 _mesa_unmarshal_NamedFramebufferParameteri(struct gl_context *ctx, const struct marshal_cmd_NamedFramebufferParameteri *cmd)
   22495 {
   22496    const GLuint framebuffer = cmd->framebuffer;
   22497    const GLenum pname = cmd->pname;
   22498    const GLint param = cmd->param;
   22499    CALL_NamedFramebufferParameteri(ctx->CurrentServerDispatch, (framebuffer, pname, param));
   22500 }
   22501 static void GLAPIENTRY
   22502 _mesa_marshal_NamedFramebufferParameteri(GLuint framebuffer, GLenum pname, GLint param)
   22503 {
   22504    GET_CURRENT_CONTEXT(ctx);
   22505    size_t cmd_size = sizeof(struct marshal_cmd_NamedFramebufferParameteri);
   22506    struct marshal_cmd_NamedFramebufferParameteri *cmd;
   22507    debug_print_marshal("NamedFramebufferParameteri");
   22508    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22509       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedFramebufferParameteri, cmd_size);
   22510       cmd->framebuffer = framebuffer;
   22511       cmd->pname = pname;
   22512       cmd->param = param;
   22513       _mesa_post_marshal_hook(ctx);
   22514       return;
   22515    }
   22516 
   22517    _mesa_glthread_finish(ctx);
   22518    debug_print_sync_fallback("NamedFramebufferParameteri");
   22519    CALL_NamedFramebufferParameteri(ctx->CurrentServerDispatch, (framebuffer, pname, param));
   22520 }
   22521 
   22522 
   22523 /* BindVertexBuffers: marshalled synchronously */
   22524 static void GLAPIENTRY
   22525 _mesa_marshal_BindVertexBuffers(GLuint first, GLsizei count, const GLuint * buffers, const GLintptr * offsets, const GLsizei * strides)
   22526 {
   22527    GET_CURRENT_CONTEXT(ctx);
   22528    _mesa_glthread_finish(ctx);
   22529    debug_print_sync("BindVertexBuffers");
   22530    CALL_BindVertexBuffers(ctx->CurrentServerDispatch, (first, count, buffers, offsets, strides));
   22531 }
   22532 
   22533 
   22534 /* GetSamplerParameteriv: marshalled synchronously */
   22535 static void GLAPIENTRY
   22536 _mesa_marshal_GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint * params)
   22537 {
   22538    GET_CURRENT_CONTEXT(ctx);
   22539    _mesa_glthread_finish(ctx);
   22540    debug_print_sync("GetSamplerParameteriv");
   22541    CALL_GetSamplerParameteriv(ctx->CurrentServerDispatch, (sampler, pname, params));
   22542 }
   22543 
   22544 
   22545 /* GenProgramPipelines: marshalled synchronously */
   22546 static void GLAPIENTRY
   22547 _mesa_marshal_GenProgramPipelines(GLsizei n, GLuint * pipelines)
   22548 {
   22549    GET_CURRENT_CONTEXT(ctx);
   22550    _mesa_glthread_finish(ctx);
   22551    debug_print_sync("GenProgramPipelines");
   22552    CALL_GenProgramPipelines(ctx->CurrentServerDispatch, (n, pipelines));
   22553 }
   22554 
   22555 
   22556 /* IsProgramPipeline: marshalled synchronously */
   22557 static GLboolean GLAPIENTRY
   22558 _mesa_marshal_IsProgramPipeline(GLuint pipeline)
   22559 {
   22560    GET_CURRENT_CONTEXT(ctx);
   22561    _mesa_glthread_finish(ctx);
   22562    debug_print_sync("IsProgramPipeline");
   22563    return CALL_IsProgramPipeline(ctx->CurrentServerDispatch, (pipeline));
   22564 }
   22565 
   22566 
   22567 /* ShaderBinary: marshalled synchronously */
   22568 static void GLAPIENTRY
   22569 _mesa_marshal_ShaderBinary(GLsizei n, const GLuint * shaders, GLenum binaryformat, const GLvoid * binary, GLsizei length)
   22570 {
   22571    GET_CURRENT_CONTEXT(ctx);
   22572    _mesa_glthread_finish(ctx);
   22573    debug_print_sync("ShaderBinary");
   22574    CALL_ShaderBinary(ctx->CurrentServerDispatch, (n, shaders, binaryformat, binary, length));
   22575 }
   22576 
   22577 
   22578 /* TextureSubImage1D: marshalled synchronously */
   22579 static void GLAPIENTRY
   22580 _mesa_marshal_TextureSubImage1D(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid * pixels)
   22581 {
   22582    GET_CURRENT_CONTEXT(ctx);
   22583    _mesa_glthread_finish(ctx);
   22584    debug_print_sync("TextureSubImage1D");
   22585    CALL_TextureSubImage1D(ctx->CurrentServerDispatch, (texture, level, xoffset, width, format, type, pixels));
   22586 }
   22587 
   22588 
   22589 /* Normal3x: marshalled asynchronously */
   22590 struct marshal_cmd_Normal3x
   22591 {
   22592    struct marshal_cmd_base cmd_base;
   22593    GLfixed nx;
   22594    GLfixed ny;
   22595    GLfixed nz;
   22596 };
   22597 static inline void
   22598 _mesa_unmarshal_Normal3x(struct gl_context *ctx, const struct marshal_cmd_Normal3x *cmd)
   22599 {
   22600    const GLfixed nx = cmd->nx;
   22601    const GLfixed ny = cmd->ny;
   22602    const GLfixed nz = cmd->nz;
   22603    CALL_Normal3x(ctx->CurrentServerDispatch, (nx, ny, nz));
   22604 }
   22605 static void GLAPIENTRY
   22606 _mesa_marshal_Normal3x(GLfixed nx, GLfixed ny, GLfixed nz)
   22607 {
   22608    GET_CURRENT_CONTEXT(ctx);
   22609    size_t cmd_size = sizeof(struct marshal_cmd_Normal3x);
   22610    struct marshal_cmd_Normal3x *cmd;
   22611    debug_print_marshal("Normal3x");
   22612    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22613       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Normal3x, cmd_size);
   22614       cmd->nx = nx;
   22615       cmd->ny = ny;
   22616       cmd->nz = nz;
   22617       _mesa_post_marshal_hook(ctx);
   22618       return;
   22619    }
   22620 
   22621    _mesa_glthread_finish(ctx);
   22622    debug_print_sync_fallback("Normal3x");
   22623    CALL_Normal3x(ctx->CurrentServerDispatch, (nx, ny, nz));
   22624 }
   22625 
   22626 
   22627 /* VertexAttrib4fARB: marshalled asynchronously */
   22628 struct marshal_cmd_VertexAttrib4fARB
   22629 {
   22630    struct marshal_cmd_base cmd_base;
   22631    GLuint index;
   22632    GLfloat x;
   22633    GLfloat y;
   22634    GLfloat z;
   22635    GLfloat w;
   22636 };
   22637 static inline void
   22638 _mesa_unmarshal_VertexAttrib4fARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4fARB *cmd)
   22639 {
   22640    const GLuint index = cmd->index;
   22641    const GLfloat x = cmd->x;
   22642    const GLfloat y = cmd->y;
   22643    const GLfloat z = cmd->z;
   22644    const GLfloat w = cmd->w;
   22645    CALL_VertexAttrib4fARB(ctx->CurrentServerDispatch, (index, x, y, z, w));
   22646 }
   22647 static void GLAPIENTRY
   22648 _mesa_marshal_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
   22649 {
   22650    GET_CURRENT_CONTEXT(ctx);
   22651    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4fARB);
   22652    struct marshal_cmd_VertexAttrib4fARB *cmd;
   22653    debug_print_marshal("VertexAttrib4fARB");
   22654    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22655       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4fARB, cmd_size);
   22656       cmd->index = index;
   22657       cmd->x = x;
   22658       cmd->y = y;
   22659       cmd->z = z;
   22660       cmd->w = w;
   22661       _mesa_post_marshal_hook(ctx);
   22662       return;
   22663    }
   22664 
   22665    _mesa_glthread_finish(ctx);
   22666    debug_print_sync_fallback("VertexAttrib4fARB");
   22667    CALL_VertexAttrib4fARB(ctx->CurrentServerDispatch, (index, x, y, z, w));
   22668 }
   22669 
   22670 
   22671 /* TexCoord4fv: marshalled asynchronously */
   22672 struct marshal_cmd_TexCoord4fv
   22673 {
   22674    struct marshal_cmd_base cmd_base;
   22675    GLfloat v[4];
   22676 };
   22677 static inline void
   22678 _mesa_unmarshal_TexCoord4fv(struct gl_context *ctx, const struct marshal_cmd_TexCoord4fv *cmd)
   22679 {
   22680    const GLfloat * v = cmd->v;
   22681    CALL_TexCoord4fv(ctx->CurrentServerDispatch, (v));
   22682 }
   22683 static void GLAPIENTRY
   22684 _mesa_marshal_TexCoord4fv(const GLfloat * v)
   22685 {
   22686    GET_CURRENT_CONTEXT(ctx);
   22687    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord4fv);
   22688    struct marshal_cmd_TexCoord4fv *cmd;
   22689    debug_print_marshal("TexCoord4fv");
   22690    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22691       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord4fv, cmd_size);
   22692       memcpy(cmd->v, v, 16);
   22693       _mesa_post_marshal_hook(ctx);
   22694       return;
   22695    }
   22696 
   22697    _mesa_glthread_finish(ctx);
   22698    debug_print_sync_fallback("TexCoord4fv");
   22699    CALL_TexCoord4fv(ctx->CurrentServerDispatch, (v));
   22700 }
   22701 
   22702 
   22703 /* ReadnPixelsARB: marshalled synchronously */
   22704 static void GLAPIENTRY
   22705 _mesa_marshal_ReadnPixelsARB(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLvoid * data)
   22706 {
   22707    GET_CURRENT_CONTEXT(ctx);
   22708    _mesa_glthread_finish(ctx);
   22709    debug_print_sync("ReadnPixelsARB");
   22710    CALL_ReadnPixelsARB(ctx->CurrentServerDispatch, (x, y, width, height, format, type, bufSize, data));
   22711 }
   22712 
   22713 
   22714 /* InvalidateTexSubImage: marshalled asynchronously */
   22715 struct marshal_cmd_InvalidateTexSubImage
   22716 {
   22717    struct marshal_cmd_base cmd_base;
   22718    GLuint texture;
   22719    GLint level;
   22720    GLint xoffset;
   22721    GLint yoffset;
   22722    GLint zoffset;
   22723    GLsizei width;
   22724    GLsizei height;
   22725    GLsizei depth;
   22726 };
   22727 static inline void
   22728 _mesa_unmarshal_InvalidateTexSubImage(struct gl_context *ctx, const struct marshal_cmd_InvalidateTexSubImage *cmd)
   22729 {
   22730    const GLuint texture = cmd->texture;
   22731    const GLint level = cmd->level;
   22732    const GLint xoffset = cmd->xoffset;
   22733    const GLint yoffset = cmd->yoffset;
   22734    const GLint zoffset = cmd->zoffset;
   22735    const GLsizei width = cmd->width;
   22736    const GLsizei height = cmd->height;
   22737    const GLsizei depth = cmd->depth;
   22738    CALL_InvalidateTexSubImage(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth));
   22739 }
   22740 static void GLAPIENTRY
   22741 _mesa_marshal_InvalidateTexSubImage(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth)
   22742 {
   22743    GET_CURRENT_CONTEXT(ctx);
   22744    size_t cmd_size = sizeof(struct marshal_cmd_InvalidateTexSubImage);
   22745    struct marshal_cmd_InvalidateTexSubImage *cmd;
   22746    debug_print_marshal("InvalidateTexSubImage");
   22747    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22748       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InvalidateTexSubImage, cmd_size);
   22749       cmd->texture = texture;
   22750       cmd->level = level;
   22751       cmd->xoffset = xoffset;
   22752       cmd->yoffset = yoffset;
   22753       cmd->zoffset = zoffset;
   22754       cmd->width = width;
   22755       cmd->height = height;
   22756       cmd->depth = depth;
   22757       _mesa_post_marshal_hook(ctx);
   22758       return;
   22759    }
   22760 
   22761    _mesa_glthread_finish(ctx);
   22762    debug_print_sync_fallback("InvalidateTexSubImage");
   22763    CALL_InvalidateTexSubImage(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth));
   22764 }
   22765 
   22766 
   22767 /* Normal3s: marshalled asynchronously */
   22768 struct marshal_cmd_Normal3s
   22769 {
   22770    struct marshal_cmd_base cmd_base;
   22771    GLshort nx;
   22772    GLshort ny;
   22773    GLshort nz;
   22774 };
   22775 static inline void
   22776 _mesa_unmarshal_Normal3s(struct gl_context *ctx, const struct marshal_cmd_Normal3s *cmd)
   22777 {
   22778    const GLshort nx = cmd->nx;
   22779    const GLshort ny = cmd->ny;
   22780    const GLshort nz = cmd->nz;
   22781    CALL_Normal3s(ctx->CurrentServerDispatch, (nx, ny, nz));
   22782 }
   22783 static void GLAPIENTRY
   22784 _mesa_marshal_Normal3s(GLshort nx, GLshort ny, GLshort nz)
   22785 {
   22786    GET_CURRENT_CONTEXT(ctx);
   22787    size_t cmd_size = sizeof(struct marshal_cmd_Normal3s);
   22788    struct marshal_cmd_Normal3s *cmd;
   22789    debug_print_marshal("Normal3s");
   22790    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22791       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Normal3s, cmd_size);
   22792       cmd->nx = nx;
   22793       cmd->ny = ny;
   22794       cmd->nz = nz;
   22795       _mesa_post_marshal_hook(ctx);
   22796       return;
   22797    }
   22798 
   22799    _mesa_glthread_finish(ctx);
   22800    debug_print_sync_fallback("Normal3s");
   22801    CALL_Normal3s(ctx->CurrentServerDispatch, (nx, ny, nz));
   22802 }
   22803 
   22804 
   22805 /* Materialxv: marshalled synchronously */
   22806 static void GLAPIENTRY
   22807 _mesa_marshal_Materialxv(GLenum face, GLenum pname, const GLfixed * params)
   22808 {
   22809    GET_CURRENT_CONTEXT(ctx);
   22810    _mesa_glthread_finish(ctx);
   22811    debug_print_sync("Materialxv");
   22812    CALL_Materialxv(ctx->CurrentServerDispatch, (face, pname, params));
   22813 }
   22814 
   22815 
   22816 /* Normal3i: marshalled asynchronously */
   22817 struct marshal_cmd_Normal3i
   22818 {
   22819    struct marshal_cmd_base cmd_base;
   22820    GLint nx;
   22821    GLint ny;
   22822    GLint nz;
   22823 };
   22824 static inline void
   22825 _mesa_unmarshal_Normal3i(struct gl_context *ctx, const struct marshal_cmd_Normal3i *cmd)
   22826 {
   22827    const GLint nx = cmd->nx;
   22828    const GLint ny = cmd->ny;
   22829    const GLint nz = cmd->nz;
   22830    CALL_Normal3i(ctx->CurrentServerDispatch, (nx, ny, nz));
   22831 }
   22832 static void GLAPIENTRY
   22833 _mesa_marshal_Normal3i(GLint nx, GLint ny, GLint nz)
   22834 {
   22835    GET_CURRENT_CONTEXT(ctx);
   22836    size_t cmd_size = sizeof(struct marshal_cmd_Normal3i);
   22837    struct marshal_cmd_Normal3i *cmd;
   22838    debug_print_marshal("Normal3i");
   22839    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22840       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Normal3i, cmd_size);
   22841       cmd->nx = nx;
   22842       cmd->ny = ny;
   22843       cmd->nz = nz;
   22844       _mesa_post_marshal_hook(ctx);
   22845       return;
   22846    }
   22847 
   22848    _mesa_glthread_finish(ctx);
   22849    debug_print_sync_fallback("Normal3i");
   22850    CALL_Normal3i(ctx->CurrentServerDispatch, (nx, ny, nz));
   22851 }
   22852 
   22853 
   22854 /* Normal3b: marshalled asynchronously */
   22855 struct marshal_cmd_Normal3b
   22856 {
   22857    struct marshal_cmd_base cmd_base;
   22858    GLbyte nx;
   22859    GLbyte ny;
   22860    GLbyte nz;
   22861 };
   22862 static inline void
   22863 _mesa_unmarshal_Normal3b(struct gl_context *ctx, const struct marshal_cmd_Normal3b *cmd)
   22864 {
   22865    const GLbyte nx = cmd->nx;
   22866    const GLbyte ny = cmd->ny;
   22867    const GLbyte nz = cmd->nz;
   22868    CALL_Normal3b(ctx->CurrentServerDispatch, (nx, ny, nz));
   22869 }
   22870 static void GLAPIENTRY
   22871 _mesa_marshal_Normal3b(GLbyte nx, GLbyte ny, GLbyte nz)
   22872 {
   22873    GET_CURRENT_CONTEXT(ctx);
   22874    size_t cmd_size = sizeof(struct marshal_cmd_Normal3b);
   22875    struct marshal_cmd_Normal3b *cmd;
   22876    debug_print_marshal("Normal3b");
   22877    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22878       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Normal3b, cmd_size);
   22879       cmd->nx = nx;
   22880       cmd->ny = ny;
   22881       cmd->nz = nz;
   22882       _mesa_post_marshal_hook(ctx);
   22883       return;
   22884    }
   22885 
   22886    _mesa_glthread_finish(ctx);
   22887    debug_print_sync_fallback("Normal3b");
   22888    CALL_Normal3b(ctx->CurrentServerDispatch, (nx, ny, nz));
   22889 }
   22890 
   22891 
   22892 /* Normal3d: marshalled asynchronously */
   22893 struct marshal_cmd_Normal3d
   22894 {
   22895    struct marshal_cmd_base cmd_base;
   22896    GLdouble nx;
   22897    GLdouble ny;
   22898    GLdouble nz;
   22899 };
   22900 static inline void
   22901 _mesa_unmarshal_Normal3d(struct gl_context *ctx, const struct marshal_cmd_Normal3d *cmd)
   22902 {
   22903    const GLdouble nx = cmd->nx;
   22904    const GLdouble ny = cmd->ny;
   22905    const GLdouble nz = cmd->nz;
   22906    CALL_Normal3d(ctx->CurrentServerDispatch, (nx, ny, nz));
   22907 }
   22908 static void GLAPIENTRY
   22909 _mesa_marshal_Normal3d(GLdouble nx, GLdouble ny, GLdouble nz)
   22910 {
   22911    GET_CURRENT_CONTEXT(ctx);
   22912    size_t cmd_size = sizeof(struct marshal_cmd_Normal3d);
   22913    struct marshal_cmd_Normal3d *cmd;
   22914    debug_print_marshal("Normal3d");
   22915    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22916       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Normal3d, cmd_size);
   22917       cmd->nx = nx;
   22918       cmd->ny = ny;
   22919       cmd->nz = nz;
   22920       _mesa_post_marshal_hook(ctx);
   22921       return;
   22922    }
   22923 
   22924    _mesa_glthread_finish(ctx);
   22925    debug_print_sync_fallback("Normal3d");
   22926    CALL_Normal3d(ctx->CurrentServerDispatch, (nx, ny, nz));
   22927 }
   22928 
   22929 
   22930 /* Normal3f: marshalled asynchronously */
   22931 struct marshal_cmd_Normal3f
   22932 {
   22933    struct marshal_cmd_base cmd_base;
   22934    GLfloat nx;
   22935    GLfloat ny;
   22936    GLfloat nz;
   22937 };
   22938 static inline void
   22939 _mesa_unmarshal_Normal3f(struct gl_context *ctx, const struct marshal_cmd_Normal3f *cmd)
   22940 {
   22941    const GLfloat nx = cmd->nx;
   22942    const GLfloat ny = cmd->ny;
   22943    const GLfloat nz = cmd->nz;
   22944    CALL_Normal3f(ctx->CurrentServerDispatch, (nx, ny, nz));
   22945 }
   22946 static void GLAPIENTRY
   22947 _mesa_marshal_Normal3f(GLfloat nx, GLfloat ny, GLfloat nz)
   22948 {
   22949    GET_CURRENT_CONTEXT(ctx);
   22950    size_t cmd_size = sizeof(struct marshal_cmd_Normal3f);
   22951    struct marshal_cmd_Normal3f *cmd;
   22952    debug_print_marshal("Normal3f");
   22953    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22954       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Normal3f, cmd_size);
   22955       cmd->nx = nx;
   22956       cmd->ny = ny;
   22957       cmd->nz = nz;
   22958       _mesa_post_marshal_hook(ctx);
   22959       return;
   22960    }
   22961 
   22962    _mesa_glthread_finish(ctx);
   22963    debug_print_sync_fallback("Normal3f");
   22964    CALL_Normal3f(ctx->CurrentServerDispatch, (nx, ny, nz));
   22965 }
   22966 
   22967 
   22968 /* Indexi: marshalled asynchronously */
   22969 struct marshal_cmd_Indexi
   22970 {
   22971    struct marshal_cmd_base cmd_base;
   22972    GLint c;
   22973 };
   22974 static inline void
   22975 _mesa_unmarshal_Indexi(struct gl_context *ctx, const struct marshal_cmd_Indexi *cmd)
   22976 {
   22977    const GLint c = cmd->c;
   22978    CALL_Indexi(ctx->CurrentServerDispatch, (c));
   22979 }
   22980 static void GLAPIENTRY
   22981 _mesa_marshal_Indexi(GLint c)
   22982 {
   22983    GET_CURRENT_CONTEXT(ctx);
   22984    size_t cmd_size = sizeof(struct marshal_cmd_Indexi);
   22985    struct marshal_cmd_Indexi *cmd;
   22986    debug_print_marshal("Indexi");
   22987    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   22988       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Indexi, cmd_size);
   22989       cmd->c = c;
   22990       _mesa_post_marshal_hook(ctx);
   22991       return;
   22992    }
   22993 
   22994    _mesa_glthread_finish(ctx);
   22995    debug_print_sync_fallback("Indexi");
   22996    CALL_Indexi(ctx->CurrentServerDispatch, (c));
   22997 }
   22998 
   22999 
   23000 /* Uniform1uiv: marshalled asynchronously */
   23001 struct marshal_cmd_Uniform1uiv
   23002 {
   23003    struct marshal_cmd_base cmd_base;
   23004    GLint location;
   23005    GLsizei count;
   23006    /* Next safe_mul(count, 4) bytes are GLuint value[count] */
   23007 };
   23008 static inline void
   23009 _mesa_unmarshal_Uniform1uiv(struct gl_context *ctx, const struct marshal_cmd_Uniform1uiv *cmd)
   23010 {
   23011    const GLint location = cmd->location;
   23012    const GLsizei count = cmd->count;
   23013    const GLuint * value;
   23014    const char *variable_data = (const char *) (cmd + 1);
   23015    value = (const GLuint *) variable_data;
   23016    variable_data += count * 4;
   23017    CALL_Uniform1uiv(ctx->CurrentServerDispatch, (location, count, value));
   23018 }
   23019 static void GLAPIENTRY
   23020 _mesa_marshal_Uniform1uiv(GLint location, GLsizei count, const GLuint * value)
   23021 {
   23022    GET_CURRENT_CONTEXT(ctx);
   23023    size_t cmd_size = sizeof(struct marshal_cmd_Uniform1uiv) + safe_mul(count, 4);
   23024    struct marshal_cmd_Uniform1uiv *cmd;
   23025    debug_print_marshal("Uniform1uiv");
   23026    if (unlikely(safe_mul(count, 4) < 0)) {
   23027       goto fallback_to_sync;
   23028    }
   23029    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23030       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1uiv, cmd_size);
   23031       cmd->location = location;
   23032       cmd->count = count;
   23033       char *variable_data = (char *) (cmd + 1);
   23034       memcpy(variable_data, value, count * 4);
   23035       variable_data += count * 4;
   23036       _mesa_post_marshal_hook(ctx);
   23037       return;
   23038    }
   23039 
   23040 fallback_to_sync:
   23041    _mesa_glthread_finish(ctx);
   23042    debug_print_sync_fallback("Uniform1uiv");
   23043    CALL_Uniform1uiv(ctx->CurrentServerDispatch, (location, count, value));
   23044 }
   23045 
   23046 
   23047 /* VertexAttribI2uiEXT: marshalled asynchronously */
   23048 struct marshal_cmd_VertexAttribI2uiEXT
   23049 {
   23050    struct marshal_cmd_base cmd_base;
   23051    GLuint index;
   23052    GLuint x;
   23053    GLuint y;
   23054 };
   23055 static inline void
   23056 _mesa_unmarshal_VertexAttribI2uiEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI2uiEXT *cmd)
   23057 {
   23058    const GLuint index = cmd->index;
   23059    const GLuint x = cmd->x;
   23060    const GLuint y = cmd->y;
   23061    CALL_VertexAttribI2uiEXT(ctx->CurrentServerDispatch, (index, x, y));
   23062 }
   23063 static void GLAPIENTRY
   23064 _mesa_marshal_VertexAttribI2uiEXT(GLuint index, GLuint x, GLuint y)
   23065 {
   23066    GET_CURRENT_CONTEXT(ctx);
   23067    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribI2uiEXT);
   23068    struct marshal_cmd_VertexAttribI2uiEXT *cmd;
   23069    debug_print_marshal("VertexAttribI2uiEXT");
   23070    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23071       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI2uiEXT, cmd_size);
   23072       cmd->index = index;
   23073       cmd->x = x;
   23074       cmd->y = y;
   23075       _mesa_post_marshal_hook(ctx);
   23076       return;
   23077    }
   23078 
   23079    _mesa_glthread_finish(ctx);
   23080    debug_print_sync_fallback("VertexAttribI2uiEXT");
   23081    CALL_VertexAttribI2uiEXT(ctx->CurrentServerDispatch, (index, x, y));
   23082 }
   23083 
   23084 
   23085 /* IsRenderbuffer: marshalled synchronously */
   23086 static GLboolean GLAPIENTRY
   23087 _mesa_marshal_IsRenderbuffer(GLuint renderbuffer)
   23088 {
   23089    GET_CURRENT_CONTEXT(ctx);
   23090    _mesa_glthread_finish(ctx);
   23091    debug_print_sync("IsRenderbuffer");
   23092    return CALL_IsRenderbuffer(ctx->CurrentServerDispatch, (renderbuffer));
   23093 }
   23094 
   23095 
   23096 /* NormalP3uiv: marshalled synchronously */
   23097 static void GLAPIENTRY
   23098 _mesa_marshal_NormalP3uiv(GLenum type, const GLuint * coords)
   23099 {
   23100    GET_CURRENT_CONTEXT(ctx);
   23101    _mesa_glthread_finish(ctx);
   23102    debug_print_sync("NormalP3uiv");
   23103    CALL_NormalP3uiv(ctx->CurrentServerDispatch, (type, coords));
   23104 }
   23105 
   23106 
   23107 /* Indexf: marshalled asynchronously */
   23108 struct marshal_cmd_Indexf
   23109 {
   23110    struct marshal_cmd_base cmd_base;
   23111    GLfloat c;
   23112 };
   23113 static inline void
   23114 _mesa_unmarshal_Indexf(struct gl_context *ctx, const struct marshal_cmd_Indexf *cmd)
   23115 {
   23116    const GLfloat c = cmd->c;
   23117    CALL_Indexf(ctx->CurrentServerDispatch, (c));
   23118 }
   23119 static void GLAPIENTRY
   23120 _mesa_marshal_Indexf(GLfloat c)
   23121 {
   23122    GET_CURRENT_CONTEXT(ctx);
   23123    size_t cmd_size = sizeof(struct marshal_cmd_Indexf);
   23124    struct marshal_cmd_Indexf *cmd;
   23125    debug_print_marshal("Indexf");
   23126    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23127       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Indexf, cmd_size);
   23128       cmd->c = c;
   23129       _mesa_post_marshal_hook(ctx);
   23130       return;
   23131    }
   23132 
   23133    _mesa_glthread_finish(ctx);
   23134    debug_print_sync_fallback("Indexf");
   23135    CALL_Indexf(ctx->CurrentServerDispatch, (c));
   23136 }
   23137 
   23138 
   23139 /* Indexd: marshalled asynchronously */
   23140 struct marshal_cmd_Indexd
   23141 {
   23142    struct marshal_cmd_base cmd_base;
   23143    GLdouble c;
   23144 };
   23145 static inline void
   23146 _mesa_unmarshal_Indexd(struct gl_context *ctx, const struct marshal_cmd_Indexd *cmd)
   23147 {
   23148    const GLdouble c = cmd->c;
   23149    CALL_Indexd(ctx->CurrentServerDispatch, (c));
   23150 }
   23151 static void GLAPIENTRY
   23152 _mesa_marshal_Indexd(GLdouble c)
   23153 {
   23154    GET_CURRENT_CONTEXT(ctx);
   23155    size_t cmd_size = sizeof(struct marshal_cmd_Indexd);
   23156    struct marshal_cmd_Indexd *cmd;
   23157    debug_print_marshal("Indexd");
   23158    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23159       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Indexd, cmd_size);
   23160       cmd->c = c;
   23161       _mesa_post_marshal_hook(ctx);
   23162       return;
   23163    }
   23164 
   23165    _mesa_glthread_finish(ctx);
   23166    debug_print_sync_fallback("Indexd");
   23167    CALL_Indexd(ctx->CurrentServerDispatch, (c));
   23168 }
   23169 
   23170 
   23171 /* GetMaterialiv: marshalled synchronously */
   23172 static void GLAPIENTRY
   23173 _mesa_marshal_GetMaterialiv(GLenum face, GLenum pname, GLint * params)
   23174 {
   23175    GET_CURRENT_CONTEXT(ctx);
   23176    _mesa_glthread_finish(ctx);
   23177    debug_print_sync("GetMaterialiv");
   23178    CALL_GetMaterialiv(ctx->CurrentServerDispatch, (face, pname, params));
   23179 }
   23180 
   23181 
   23182 /* Indexs: marshalled asynchronously */
   23183 struct marshal_cmd_Indexs
   23184 {
   23185    struct marshal_cmd_base cmd_base;
   23186    GLshort c;
   23187 };
   23188 static inline void
   23189 _mesa_unmarshal_Indexs(struct gl_context *ctx, const struct marshal_cmd_Indexs *cmd)
   23190 {
   23191    const GLshort c = cmd->c;
   23192    CALL_Indexs(ctx->CurrentServerDispatch, (c));
   23193 }
   23194 static void GLAPIENTRY
   23195 _mesa_marshal_Indexs(GLshort c)
   23196 {
   23197    GET_CURRENT_CONTEXT(ctx);
   23198    size_t cmd_size = sizeof(struct marshal_cmd_Indexs);
   23199    struct marshal_cmd_Indexs *cmd;
   23200    debug_print_marshal("Indexs");
   23201    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23202       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Indexs, cmd_size);
   23203       cmd->c = c;
   23204       _mesa_post_marshal_hook(ctx);
   23205       return;
   23206    }
   23207 
   23208    _mesa_glthread_finish(ctx);
   23209    debug_print_sync_fallback("Indexs");
   23210    CALL_Indexs(ctx->CurrentServerDispatch, (c));
   23211 }
   23212 
   23213 
   23214 /* MultiTexCoordP1uiv: marshalled synchronously */
   23215 static void GLAPIENTRY
   23216 _mesa_marshal_MultiTexCoordP1uiv(GLenum texture, GLenum type, const GLuint * coords)
   23217 {
   23218    GET_CURRENT_CONTEXT(ctx);
   23219    _mesa_glthread_finish(ctx);
   23220    debug_print_sync("MultiTexCoordP1uiv");
   23221    CALL_MultiTexCoordP1uiv(ctx->CurrentServerDispatch, (texture, type, coords));
   23222 }
   23223 
   23224 
   23225 /* ConvolutionFilter2D: marshalled synchronously */
   23226 static void GLAPIENTRY
   23227 _mesa_marshal_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * image)
   23228 {
   23229    GET_CURRENT_CONTEXT(ctx);
   23230    _mesa_glthread_finish(ctx);
   23231    debug_print_sync("ConvolutionFilter2D");
   23232    CALL_ConvolutionFilter2D(ctx->CurrentServerDispatch, (target, internalformat, width, height, format, type, image));
   23233 }
   23234 
   23235 
   23236 /* Vertex2d: marshalled asynchronously */
   23237 struct marshal_cmd_Vertex2d
   23238 {
   23239    struct marshal_cmd_base cmd_base;
   23240    GLdouble x;
   23241    GLdouble y;
   23242 };
   23243 static inline void
   23244 _mesa_unmarshal_Vertex2d(struct gl_context *ctx, const struct marshal_cmd_Vertex2d *cmd)
   23245 {
   23246    const GLdouble x = cmd->x;
   23247    const GLdouble y = cmd->y;
   23248    CALL_Vertex2d(ctx->CurrentServerDispatch, (x, y));
   23249 }
   23250 static void GLAPIENTRY
   23251 _mesa_marshal_Vertex2d(GLdouble x, GLdouble y)
   23252 {
   23253    GET_CURRENT_CONTEXT(ctx);
   23254    size_t cmd_size = sizeof(struct marshal_cmd_Vertex2d);
   23255    struct marshal_cmd_Vertex2d *cmd;
   23256    debug_print_marshal("Vertex2d");
   23257    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23258       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex2d, cmd_size);
   23259       cmd->x = x;
   23260       cmd->y = y;
   23261       _mesa_post_marshal_hook(ctx);
   23262       return;
   23263    }
   23264 
   23265    _mesa_glthread_finish(ctx);
   23266    debug_print_sync_fallback("Vertex2d");
   23267    CALL_Vertex2d(ctx->CurrentServerDispatch, (x, y));
   23268 }
   23269 
   23270 
   23271 /* Vertex2f: marshalled asynchronously */
   23272 struct marshal_cmd_Vertex2f
   23273 {
   23274    struct marshal_cmd_base cmd_base;
   23275    GLfloat x;
   23276    GLfloat y;
   23277 };
   23278 static inline void
   23279 _mesa_unmarshal_Vertex2f(struct gl_context *ctx, const struct marshal_cmd_Vertex2f *cmd)
   23280 {
   23281    const GLfloat x = cmd->x;
   23282    const GLfloat y = cmd->y;
   23283    CALL_Vertex2f(ctx->CurrentServerDispatch, (x, y));
   23284 }
   23285 static void GLAPIENTRY
   23286 _mesa_marshal_Vertex2f(GLfloat x, GLfloat y)
   23287 {
   23288    GET_CURRENT_CONTEXT(ctx);
   23289    size_t cmd_size = sizeof(struct marshal_cmd_Vertex2f);
   23290    struct marshal_cmd_Vertex2f *cmd;
   23291    debug_print_marshal("Vertex2f");
   23292    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23293       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex2f, cmd_size);
   23294       cmd->x = x;
   23295       cmd->y = y;
   23296       _mesa_post_marshal_hook(ctx);
   23297       return;
   23298    }
   23299 
   23300    _mesa_glthread_finish(ctx);
   23301    debug_print_sync_fallback("Vertex2f");
   23302    CALL_Vertex2f(ctx->CurrentServerDispatch, (x, y));
   23303 }
   23304 
   23305 
   23306 /* Color4bv: marshalled asynchronously */
   23307 struct marshal_cmd_Color4bv
   23308 {
   23309    struct marshal_cmd_base cmd_base;
   23310    GLbyte v[4];
   23311 };
   23312 static inline void
   23313 _mesa_unmarshal_Color4bv(struct gl_context *ctx, const struct marshal_cmd_Color4bv *cmd)
   23314 {
   23315    const GLbyte * v = cmd->v;
   23316    CALL_Color4bv(ctx->CurrentServerDispatch, (v));
   23317 }
   23318 static void GLAPIENTRY
   23319 _mesa_marshal_Color4bv(const GLbyte * v)
   23320 {
   23321    GET_CURRENT_CONTEXT(ctx);
   23322    size_t cmd_size = sizeof(struct marshal_cmd_Color4bv);
   23323    struct marshal_cmd_Color4bv *cmd;
   23324    debug_print_marshal("Color4bv");
   23325    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23326       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4bv, cmd_size);
   23327       memcpy(cmd->v, v, 4);
   23328       _mesa_post_marshal_hook(ctx);
   23329       return;
   23330    }
   23331 
   23332    _mesa_glthread_finish(ctx);
   23333    debug_print_sync_fallback("Color4bv");
   23334    CALL_Color4bv(ctx->CurrentServerDispatch, (v));
   23335 }
   23336 
   23337 
   23338 /* ProgramUniformMatrix3x2dv: marshalled asynchronously */
   23339 struct marshal_cmd_ProgramUniformMatrix3x2dv
   23340 {
   23341    struct marshal_cmd_base cmd_base;
   23342    GLuint program;
   23343    GLint location;
   23344    GLsizei count;
   23345    GLboolean transpose;
   23346    /* Next safe_mul(count, 48) bytes are GLdouble value[count][6] */
   23347 };
   23348 static inline void
   23349 _mesa_unmarshal_ProgramUniformMatrix3x2dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix3x2dv *cmd)
   23350 {
   23351    const GLuint program = cmd->program;
   23352    const GLint location = cmd->location;
   23353    const GLsizei count = cmd->count;
   23354    const GLboolean transpose = cmd->transpose;
   23355    const GLdouble * value;
   23356    const char *variable_data = (const char *) (cmd + 1);
   23357    value = (const GLdouble *) variable_data;
   23358    variable_data += count * 48;
   23359    CALL_ProgramUniformMatrix3x2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   23360 }
   23361 static void GLAPIENTRY
   23362 _mesa_marshal_ProgramUniformMatrix3x2dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   23363 {
   23364    GET_CURRENT_CONTEXT(ctx);
   23365    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix3x2dv) + safe_mul(count, 48);
   23366    struct marshal_cmd_ProgramUniformMatrix3x2dv *cmd;
   23367    debug_print_marshal("ProgramUniformMatrix3x2dv");
   23368    if (unlikely(safe_mul(count, 48) < 0)) {
   23369       goto fallback_to_sync;
   23370    }
   23371    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23372       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix3x2dv, cmd_size);
   23373       cmd->program = program;
   23374       cmd->location = location;
   23375       cmd->count = count;
   23376       cmd->transpose = transpose;
   23377       char *variable_data = (char *) (cmd + 1);
   23378       memcpy(variable_data, value, count * 48);
   23379       variable_data += count * 48;
   23380       _mesa_post_marshal_hook(ctx);
   23381       return;
   23382    }
   23383 
   23384 fallback_to_sync:
   23385    _mesa_glthread_finish(ctx);
   23386    debug_print_sync_fallback("ProgramUniformMatrix3x2dv");
   23387    CALL_ProgramUniformMatrix3x2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   23388 }
   23389 
   23390 
   23391 /* VertexAttrib2fvNV: marshalled asynchronously */
   23392 struct marshal_cmd_VertexAttrib2fvNV
   23393 {
   23394    struct marshal_cmd_base cmd_base;
   23395    GLuint index;
   23396    GLfloat v[2];
   23397 };
   23398 static inline void
   23399 _mesa_unmarshal_VertexAttrib2fvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2fvNV *cmd)
   23400 {
   23401    const GLuint index = cmd->index;
   23402    const GLfloat * v = cmd->v;
   23403    CALL_VertexAttrib2fvNV(ctx->CurrentServerDispatch, (index, v));
   23404 }
   23405 static void GLAPIENTRY
   23406 _mesa_marshal_VertexAttrib2fvNV(GLuint index, const GLfloat * v)
   23407 {
   23408    GET_CURRENT_CONTEXT(ctx);
   23409    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib2fvNV);
   23410    struct marshal_cmd_VertexAttrib2fvNV *cmd;
   23411    debug_print_marshal("VertexAttrib2fvNV");
   23412    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23413       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2fvNV, cmd_size);
   23414       cmd->index = index;
   23415       memcpy(cmd->v, v, 8);
   23416       _mesa_post_marshal_hook(ctx);
   23417       return;
   23418    }
   23419 
   23420    _mesa_glthread_finish(ctx);
   23421    debug_print_sync_fallback("VertexAttrib2fvNV");
   23422    CALL_VertexAttrib2fvNV(ctx->CurrentServerDispatch, (index, v));
   23423 }
   23424 
   23425 
   23426 /* Vertex2s: marshalled asynchronously */
   23427 struct marshal_cmd_Vertex2s
   23428 {
   23429    struct marshal_cmd_base cmd_base;
   23430    GLshort x;
   23431    GLshort y;
   23432 };
   23433 static inline void
   23434 _mesa_unmarshal_Vertex2s(struct gl_context *ctx, const struct marshal_cmd_Vertex2s *cmd)
   23435 {
   23436    const GLshort x = cmd->x;
   23437    const GLshort y = cmd->y;
   23438    CALL_Vertex2s(ctx->CurrentServerDispatch, (x, y));
   23439 }
   23440 static void GLAPIENTRY
   23441 _mesa_marshal_Vertex2s(GLshort x, GLshort y)
   23442 {
   23443    GET_CURRENT_CONTEXT(ctx);
   23444    size_t cmd_size = sizeof(struct marshal_cmd_Vertex2s);
   23445    struct marshal_cmd_Vertex2s *cmd;
   23446    debug_print_marshal("Vertex2s");
   23447    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23448       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex2s, cmd_size);
   23449       cmd->x = x;
   23450       cmd->y = y;
   23451       _mesa_post_marshal_hook(ctx);
   23452       return;
   23453    }
   23454 
   23455    _mesa_glthread_finish(ctx);
   23456    debug_print_sync_fallback("Vertex2s");
   23457    CALL_Vertex2s(ctx->CurrentServerDispatch, (x, y));
   23458 }
   23459 
   23460 
   23461 /* ActiveTexture: marshalled asynchronously */
   23462 struct marshal_cmd_ActiveTexture
   23463 {
   23464    struct marshal_cmd_base cmd_base;
   23465    GLenum texture;
   23466 };
   23467 static inline void
   23468 _mesa_unmarshal_ActiveTexture(struct gl_context *ctx, const struct marshal_cmd_ActiveTexture *cmd)
   23469 {
   23470    const GLenum texture = cmd->texture;
   23471    CALL_ActiveTexture(ctx->CurrentServerDispatch, (texture));
   23472 }
   23473 static void GLAPIENTRY
   23474 _mesa_marshal_ActiveTexture(GLenum texture)
   23475 {
   23476    GET_CURRENT_CONTEXT(ctx);
   23477    size_t cmd_size = sizeof(struct marshal_cmd_ActiveTexture);
   23478    struct marshal_cmd_ActiveTexture *cmd;
   23479    debug_print_marshal("ActiveTexture");
   23480    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23481       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ActiveTexture, cmd_size);
   23482       cmd->texture = texture;
   23483       _mesa_post_marshal_hook(ctx);
   23484       return;
   23485    }
   23486 
   23487    _mesa_glthread_finish(ctx);
   23488    debug_print_sync_fallback("ActiveTexture");
   23489    CALL_ActiveTexture(ctx->CurrentServerDispatch, (texture));
   23490 }
   23491 
   23492 
   23493 /* InvalidateNamedFramebufferSubData: marshalled synchronously */
   23494 static void GLAPIENTRY
   23495 _mesa_marshal_InvalidateNamedFramebufferSubData(GLuint framebuffer, GLsizei numAttachments, const GLenum * attachments, GLint x, GLint y, GLsizei width, GLsizei height)
   23496 {
   23497    GET_CURRENT_CONTEXT(ctx);
   23498    _mesa_glthread_finish(ctx);
   23499    debug_print_sync("InvalidateNamedFramebufferSubData");
   23500    CALL_InvalidateNamedFramebufferSubData(ctx->CurrentServerDispatch, (framebuffer, numAttachments, attachments, x, y, width, height));
   23501 }
   23502 
   23503 
   23504 /* ColorP4uiv: marshalled synchronously */
   23505 static void GLAPIENTRY
   23506 _mesa_marshal_ColorP4uiv(GLenum type, const GLuint * color)
   23507 {
   23508    GET_CURRENT_CONTEXT(ctx);
   23509    _mesa_glthread_finish(ctx);
   23510    debug_print_sync("ColorP4uiv");
   23511    CALL_ColorP4uiv(ctx->CurrentServerDispatch, (type, color));
   23512 }
   23513 
   23514 
   23515 /* DrawTexxOES: marshalled asynchronously */
   23516 struct marshal_cmd_DrawTexxOES
   23517 {
   23518    struct marshal_cmd_base cmd_base;
   23519    GLfixed x;
   23520    GLfixed y;
   23521    GLfixed z;
   23522    GLfixed width;
   23523    GLfixed height;
   23524 };
   23525 static inline void
   23526 _mesa_unmarshal_DrawTexxOES(struct gl_context *ctx, const struct marshal_cmd_DrawTexxOES *cmd)
   23527 {
   23528    const GLfixed x = cmd->x;
   23529    const GLfixed y = cmd->y;
   23530    const GLfixed z = cmd->z;
   23531    const GLfixed width = cmd->width;
   23532    const GLfixed height = cmd->height;
   23533    CALL_DrawTexxOES(ctx->CurrentServerDispatch, (x, y, z, width, height));
   23534 }
   23535 static void GLAPIENTRY
   23536 _mesa_marshal_DrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height)
   23537 {
   23538    GET_CURRENT_CONTEXT(ctx);
   23539    size_t cmd_size = sizeof(struct marshal_cmd_DrawTexxOES);
   23540    struct marshal_cmd_DrawTexxOES *cmd;
   23541    debug_print_marshal("DrawTexxOES");
   23542    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23543       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTexxOES, cmd_size);
   23544       cmd->x = x;
   23545       cmd->y = y;
   23546       cmd->z = z;
   23547       cmd->width = width;
   23548       cmd->height = height;
   23549       _mesa_post_marshal_hook(ctx);
   23550       return;
   23551    }
   23552 
   23553    _mesa_glthread_finish(ctx);
   23554    debug_print_sync_fallback("DrawTexxOES");
   23555    CALL_DrawTexxOES(ctx->CurrentServerDispatch, (x, y, z, width, height));
   23556 }
   23557 
   23558 
   23559 /* MultiTexCoordP3ui: marshalled asynchronously */
   23560 struct marshal_cmd_MultiTexCoordP3ui
   23561 {
   23562    struct marshal_cmd_base cmd_base;
   23563    GLenum texture;
   23564    GLenum type;
   23565    GLuint coords;
   23566 };
   23567 static inline void
   23568 _mesa_unmarshal_MultiTexCoordP3ui(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP3ui *cmd)
   23569 {
   23570    const GLenum texture = cmd->texture;
   23571    const GLenum type = cmd->type;
   23572    const GLuint coords = cmd->coords;
   23573    CALL_MultiTexCoordP3ui(ctx->CurrentServerDispatch, (texture, type, coords));
   23574 }
   23575 static void GLAPIENTRY
   23576 _mesa_marshal_MultiTexCoordP3ui(GLenum texture, GLenum type, GLuint coords)
   23577 {
   23578    GET_CURRENT_CONTEXT(ctx);
   23579    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP3ui);
   23580    struct marshal_cmd_MultiTexCoordP3ui *cmd;
   23581    debug_print_marshal("MultiTexCoordP3ui");
   23582    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23583       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP3ui, cmd_size);
   23584       cmd->texture = texture;
   23585       cmd->type = type;
   23586       cmd->coords = coords;
   23587       _mesa_post_marshal_hook(ctx);
   23588       return;
   23589    }
   23590 
   23591    _mesa_glthread_finish(ctx);
   23592    debug_print_sync_fallback("MultiTexCoordP3ui");
   23593    CALL_MultiTexCoordP3ui(ctx->CurrentServerDispatch, (texture, type, coords));
   23594 }
   23595 
   23596 
   23597 /* GetAttribLocation: marshalled synchronously */
   23598 static GLint GLAPIENTRY
   23599 _mesa_marshal_GetAttribLocation(GLuint program, const GLchar * name)
   23600 {
   23601    GET_CURRENT_CONTEXT(ctx);
   23602    _mesa_glthread_finish(ctx);
   23603    debug_print_sync("GetAttribLocation");
   23604    return CALL_GetAttribLocation(ctx->CurrentServerDispatch, (program, name));
   23605 }
   23606 
   23607 
   23608 /* DrawBuffer: marshalled asynchronously */
   23609 struct marshal_cmd_DrawBuffer
   23610 {
   23611    struct marshal_cmd_base cmd_base;
   23612    GLenum mode;
   23613 };
   23614 static inline void
   23615 _mesa_unmarshal_DrawBuffer(struct gl_context *ctx, const struct marshal_cmd_DrawBuffer *cmd)
   23616 {
   23617    const GLenum mode = cmd->mode;
   23618    CALL_DrawBuffer(ctx->CurrentServerDispatch, (mode));
   23619 }
   23620 static void GLAPIENTRY
   23621 _mesa_marshal_DrawBuffer(GLenum mode)
   23622 {
   23623    GET_CURRENT_CONTEXT(ctx);
   23624    size_t cmd_size = sizeof(struct marshal_cmd_DrawBuffer);
   23625    struct marshal_cmd_DrawBuffer *cmd;
   23626    debug_print_marshal("DrawBuffer");
   23627    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23628       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawBuffer, cmd_size);
   23629       cmd->mode = mode;
   23630       _mesa_post_marshal_hook(ctx);
   23631       return;
   23632    }
   23633 
   23634    _mesa_glthread_finish(ctx);
   23635    debug_print_sync_fallback("DrawBuffer");
   23636    CALL_DrawBuffer(ctx->CurrentServerDispatch, (mode));
   23637 }
   23638 
   23639 
   23640 /* GetPointerv: marshalled synchronously */
   23641 static void GLAPIENTRY
   23642 _mesa_marshal_GetPointerv(GLenum pname, GLvoid ** params)
   23643 {
   23644    GET_CURRENT_CONTEXT(ctx);
   23645    _mesa_glthread_finish(ctx);
   23646    debug_print_sync("GetPointerv");
   23647    CALL_GetPointerv(ctx->CurrentServerDispatch, (pname, params));
   23648 }
   23649 
   23650 
   23651 /* MultiTexCoord2dv: marshalled asynchronously */
   23652 struct marshal_cmd_MultiTexCoord2dv
   23653 {
   23654    struct marshal_cmd_base cmd_base;
   23655    GLenum target;
   23656    GLdouble v[2];
   23657 };
   23658 static inline void
   23659 _mesa_unmarshal_MultiTexCoord2dv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2dv *cmd)
   23660 {
   23661    const GLenum target = cmd->target;
   23662    const GLdouble * v = cmd->v;
   23663    CALL_MultiTexCoord2dv(ctx->CurrentServerDispatch, (target, v));
   23664 }
   23665 static void GLAPIENTRY
   23666 _mesa_marshal_MultiTexCoord2dv(GLenum target, const GLdouble * v)
   23667 {
   23668    GET_CURRENT_CONTEXT(ctx);
   23669    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2dv);
   23670    struct marshal_cmd_MultiTexCoord2dv *cmd;
   23671    debug_print_marshal("MultiTexCoord2dv");
   23672    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23673       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2dv, cmd_size);
   23674       cmd->target = target;
   23675       memcpy(cmd->v, v, 16);
   23676       _mesa_post_marshal_hook(ctx);
   23677       return;
   23678    }
   23679 
   23680    _mesa_glthread_finish(ctx);
   23681    debug_print_sync_fallback("MultiTexCoord2dv");
   23682    CALL_MultiTexCoord2dv(ctx->CurrentServerDispatch, (target, v));
   23683 }
   23684 
   23685 
   23686 /* IsSampler: marshalled synchronously */
   23687 static GLboolean GLAPIENTRY
   23688 _mesa_marshal_IsSampler(GLuint sampler)
   23689 {
   23690    GET_CURRENT_CONTEXT(ctx);
   23691    _mesa_glthread_finish(ctx);
   23692    debug_print_sync("IsSampler");
   23693    return CALL_IsSampler(ctx->CurrentServerDispatch, (sampler));
   23694 }
   23695 
   23696 
   23697 /* BlendFunc: marshalled asynchronously */
   23698 struct marshal_cmd_BlendFunc
   23699 {
   23700    struct marshal_cmd_base cmd_base;
   23701    GLenum sfactor;
   23702    GLenum dfactor;
   23703 };
   23704 static inline void
   23705 _mesa_unmarshal_BlendFunc(struct gl_context *ctx, const struct marshal_cmd_BlendFunc *cmd)
   23706 {
   23707    const GLenum sfactor = cmd->sfactor;
   23708    const GLenum dfactor = cmd->dfactor;
   23709    CALL_BlendFunc(ctx->CurrentServerDispatch, (sfactor, dfactor));
   23710 }
   23711 static void GLAPIENTRY
   23712 _mesa_marshal_BlendFunc(GLenum sfactor, GLenum dfactor)
   23713 {
   23714    GET_CURRENT_CONTEXT(ctx);
   23715    size_t cmd_size = sizeof(struct marshal_cmd_BlendFunc);
   23716    struct marshal_cmd_BlendFunc *cmd;
   23717    debug_print_marshal("BlendFunc");
   23718    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23719       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendFunc, cmd_size);
   23720       cmd->sfactor = sfactor;
   23721       cmd->dfactor = dfactor;
   23722       _mesa_post_marshal_hook(ctx);
   23723       return;
   23724    }
   23725 
   23726    _mesa_glthread_finish(ctx);
   23727    debug_print_sync_fallback("BlendFunc");
   23728    CALL_BlendFunc(ctx->CurrentServerDispatch, (sfactor, dfactor));
   23729 }
   23730 
   23731 
   23732 /* NamedRenderbufferStorageMultisample: marshalled asynchronously */
   23733 struct marshal_cmd_NamedRenderbufferStorageMultisample
   23734 {
   23735    struct marshal_cmd_base cmd_base;
   23736    GLuint renderbuffer;
   23737    GLsizei samples;
   23738    GLenum internalformat;
   23739    GLsizei width;
   23740    GLsizei height;
   23741 };
   23742 static inline void
   23743 _mesa_unmarshal_NamedRenderbufferStorageMultisample(struct gl_context *ctx, const struct marshal_cmd_NamedRenderbufferStorageMultisample *cmd)
   23744 {
   23745    const GLuint renderbuffer = cmd->renderbuffer;
   23746    const GLsizei samples = cmd->samples;
   23747    const GLenum internalformat = cmd->internalformat;
   23748    const GLsizei width = cmd->width;
   23749    const GLsizei height = cmd->height;
   23750    CALL_NamedRenderbufferStorageMultisample(ctx->CurrentServerDispatch, (renderbuffer, samples, internalformat, width, height));
   23751 }
   23752 static void GLAPIENTRY
   23753 _mesa_marshal_NamedRenderbufferStorageMultisample(GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
   23754 {
   23755    GET_CURRENT_CONTEXT(ctx);
   23756    size_t cmd_size = sizeof(struct marshal_cmd_NamedRenderbufferStorageMultisample);
   23757    struct marshal_cmd_NamedRenderbufferStorageMultisample *cmd;
   23758    debug_print_marshal("NamedRenderbufferStorageMultisample");
   23759    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23760       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedRenderbufferStorageMultisample, cmd_size);
   23761       cmd->renderbuffer = renderbuffer;
   23762       cmd->samples = samples;
   23763       cmd->internalformat = internalformat;
   23764       cmd->width = width;
   23765       cmd->height = height;
   23766       _mesa_post_marshal_hook(ctx);
   23767       return;
   23768    }
   23769 
   23770    _mesa_glthread_finish(ctx);
   23771    debug_print_sync_fallback("NamedRenderbufferStorageMultisample");
   23772    CALL_NamedRenderbufferStorageMultisample(ctx->CurrentServerDispatch, (renderbuffer, samples, internalformat, width, height));
   23773 }
   23774 
   23775 
   23776 /* ColorMaterial: marshalled asynchronously */
   23777 struct marshal_cmd_ColorMaterial
   23778 {
   23779    struct marshal_cmd_base cmd_base;
   23780    GLenum face;
   23781    GLenum mode;
   23782 };
   23783 static inline void
   23784 _mesa_unmarshal_ColorMaterial(struct gl_context *ctx, const struct marshal_cmd_ColorMaterial *cmd)
   23785 {
   23786    const GLenum face = cmd->face;
   23787    const GLenum mode = cmd->mode;
   23788    CALL_ColorMaterial(ctx->CurrentServerDispatch, (face, mode));
   23789 }
   23790 static void GLAPIENTRY
   23791 _mesa_marshal_ColorMaterial(GLenum face, GLenum mode)
   23792 {
   23793    GET_CURRENT_CONTEXT(ctx);
   23794    size_t cmd_size = sizeof(struct marshal_cmd_ColorMaterial);
   23795    struct marshal_cmd_ColorMaterial *cmd;
   23796    debug_print_marshal("ColorMaterial");
   23797    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23798       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorMaterial, cmd_size);
   23799       cmd->face = face;
   23800       cmd->mode = mode;
   23801       _mesa_post_marshal_hook(ctx);
   23802       return;
   23803    }
   23804 
   23805    _mesa_glthread_finish(ctx);
   23806    debug_print_sync_fallback("ColorMaterial");
   23807    CALL_ColorMaterial(ctx->CurrentServerDispatch, (face, mode));
   23808 }
   23809 
   23810 
   23811 /* RasterPos3sv: marshalled asynchronously */
   23812 struct marshal_cmd_RasterPos3sv
   23813 {
   23814    struct marshal_cmd_base cmd_base;
   23815    GLshort v[3];
   23816 };
   23817 static inline void
   23818 _mesa_unmarshal_RasterPos3sv(struct gl_context *ctx, const struct marshal_cmd_RasterPos3sv *cmd)
   23819 {
   23820    const GLshort * v = cmd->v;
   23821    CALL_RasterPos3sv(ctx->CurrentServerDispatch, (v));
   23822 }
   23823 static void GLAPIENTRY
   23824 _mesa_marshal_RasterPos3sv(const GLshort * v)
   23825 {
   23826    GET_CURRENT_CONTEXT(ctx);
   23827    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos3sv);
   23828    struct marshal_cmd_RasterPos3sv *cmd;
   23829    debug_print_marshal("RasterPos3sv");
   23830    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23831       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos3sv, cmd_size);
   23832       memcpy(cmd->v, v, 6);
   23833       _mesa_post_marshal_hook(ctx);
   23834       return;
   23835    }
   23836 
   23837    _mesa_glthread_finish(ctx);
   23838    debug_print_sync_fallback("RasterPos3sv");
   23839    CALL_RasterPos3sv(ctx->CurrentServerDispatch, (v));
   23840 }
   23841 
   23842 
   23843 /* TexCoordP2ui: marshalled asynchronously */
   23844 struct marshal_cmd_TexCoordP2ui
   23845 {
   23846    struct marshal_cmd_base cmd_base;
   23847    GLenum type;
   23848    GLuint coords;
   23849 };
   23850 static inline void
   23851 _mesa_unmarshal_TexCoordP2ui(struct gl_context *ctx, const struct marshal_cmd_TexCoordP2ui *cmd)
   23852 {
   23853    const GLenum type = cmd->type;
   23854    const GLuint coords = cmd->coords;
   23855    CALL_TexCoordP2ui(ctx->CurrentServerDispatch, (type, coords));
   23856 }
   23857 static void GLAPIENTRY
   23858 _mesa_marshal_TexCoordP2ui(GLenum type, GLuint coords)
   23859 {
   23860    GET_CURRENT_CONTEXT(ctx);
   23861    size_t cmd_size = sizeof(struct marshal_cmd_TexCoordP2ui);
   23862    struct marshal_cmd_TexCoordP2ui *cmd;
   23863    debug_print_marshal("TexCoordP2ui");
   23864    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23865       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP2ui, cmd_size);
   23866       cmd->type = type;
   23867       cmd->coords = coords;
   23868       _mesa_post_marshal_hook(ctx);
   23869       return;
   23870    }
   23871 
   23872    _mesa_glthread_finish(ctx);
   23873    debug_print_sync_fallback("TexCoordP2ui");
   23874    CALL_TexCoordP2ui(ctx->CurrentServerDispatch, (type, coords));
   23875 }
   23876 
   23877 
   23878 /* TexParameteriv: marshalled synchronously */
   23879 static void GLAPIENTRY
   23880 _mesa_marshal_TexParameteriv(GLenum target, GLenum pname, const GLint * params)
   23881 {
   23882    GET_CURRENT_CONTEXT(ctx);
   23883    _mesa_glthread_finish(ctx);
   23884    debug_print_sync("TexParameteriv");
   23885    CALL_TexParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
   23886 }
   23887 
   23888 
   23889 /* WaitSemaphoreEXT: marshalled synchronously */
   23890 static void GLAPIENTRY
   23891 _mesa_marshal_WaitSemaphoreEXT(GLuint semaphore, GLuint numBufferBarriers, const GLuint * buffers, GLuint numTextureBarriers, const GLuint * textures, const GLenum * srcLayouts)
   23892 {
   23893    GET_CURRENT_CONTEXT(ctx);
   23894    _mesa_glthread_finish(ctx);
   23895    debug_print_sync("WaitSemaphoreEXT");
   23896    CALL_WaitSemaphoreEXT(ctx->CurrentServerDispatch, (semaphore, numBufferBarriers, buffers, numTextureBarriers, textures, srcLayouts));
   23897 }
   23898 
   23899 
   23900 /* VertexAttrib3fvARB: marshalled asynchronously */
   23901 struct marshal_cmd_VertexAttrib3fvARB
   23902 {
   23903    struct marshal_cmd_base cmd_base;
   23904    GLuint index;
   23905    GLfloat v[3];
   23906 };
   23907 static inline void
   23908 _mesa_unmarshal_VertexAttrib3fvARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3fvARB *cmd)
   23909 {
   23910    const GLuint index = cmd->index;
   23911    const GLfloat * v = cmd->v;
   23912    CALL_VertexAttrib3fvARB(ctx->CurrentServerDispatch, (index, v));
   23913 }
   23914 static void GLAPIENTRY
   23915 _mesa_marshal_VertexAttrib3fvARB(GLuint index, const GLfloat * v)
   23916 {
   23917    GET_CURRENT_CONTEXT(ctx);
   23918    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib3fvARB);
   23919    struct marshal_cmd_VertexAttrib3fvARB *cmd;
   23920    debug_print_marshal("VertexAttrib3fvARB");
   23921    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23922       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3fvARB, cmd_size);
   23923       cmd->index = index;
   23924       memcpy(cmd->v, v, 12);
   23925       _mesa_post_marshal_hook(ctx);
   23926       return;
   23927    }
   23928 
   23929    _mesa_glthread_finish(ctx);
   23930    debug_print_sync_fallback("VertexAttrib3fvARB");
   23931    CALL_VertexAttrib3fvARB(ctx->CurrentServerDispatch, (index, v));
   23932 }
   23933 
   23934 
   23935 /* ProgramUniformMatrix3x4fv: marshalled asynchronously */
   23936 struct marshal_cmd_ProgramUniformMatrix3x4fv
   23937 {
   23938    struct marshal_cmd_base cmd_base;
   23939    GLuint program;
   23940    GLint location;
   23941    GLsizei count;
   23942    GLboolean transpose;
   23943    /* Next safe_mul(count, 48) bytes are GLfloat value[count][12] */
   23944 };
   23945 static inline void
   23946 _mesa_unmarshal_ProgramUniformMatrix3x4fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix3x4fv *cmd)
   23947 {
   23948    const GLuint program = cmd->program;
   23949    const GLint location = cmd->location;
   23950    const GLsizei count = cmd->count;
   23951    const GLboolean transpose = cmd->transpose;
   23952    const GLfloat * value;
   23953    const char *variable_data = (const char *) (cmd + 1);
   23954    value = (const GLfloat *) variable_data;
   23955    variable_data += count * 48;
   23956    CALL_ProgramUniformMatrix3x4fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   23957 }
   23958 static void GLAPIENTRY
   23959 _mesa_marshal_ProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   23960 {
   23961    GET_CURRENT_CONTEXT(ctx);
   23962    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix3x4fv) + safe_mul(count, 48);
   23963    struct marshal_cmd_ProgramUniformMatrix3x4fv *cmd;
   23964    debug_print_marshal("ProgramUniformMatrix3x4fv");
   23965    if (unlikely(safe_mul(count, 48) < 0)) {
   23966       goto fallback_to_sync;
   23967    }
   23968    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   23969       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix3x4fv, cmd_size);
   23970       cmd->program = program;
   23971       cmd->location = location;
   23972       cmd->count = count;
   23973       cmd->transpose = transpose;
   23974       char *variable_data = (char *) (cmd + 1);
   23975       memcpy(variable_data, value, count * 48);
   23976       variable_data += count * 48;
   23977       _mesa_post_marshal_hook(ctx);
   23978       return;
   23979    }
   23980 
   23981 fallback_to_sync:
   23982    _mesa_glthread_finish(ctx);
   23983    debug_print_sync_fallback("ProgramUniformMatrix3x4fv");
   23984    CALL_ProgramUniformMatrix3x4fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   23985 }
   23986 
   23987 
   23988 /* GetColorTable: marshalled synchronously */
   23989 static void GLAPIENTRY
   23990 _mesa_marshal_GetColorTable(GLenum target, GLenum format, GLenum type, GLvoid * table)
   23991 {
   23992    GET_CURRENT_CONTEXT(ctx);
   23993    _mesa_glthread_finish(ctx);
   23994    debug_print_sync("GetColorTable");
   23995    CALL_GetColorTable(ctx->CurrentServerDispatch, (target, format, type, table));
   23996 }
   23997 
   23998 
   23999 /* TexCoord3i: marshalled asynchronously */
   24000 struct marshal_cmd_TexCoord3i
   24001 {
   24002    struct marshal_cmd_base cmd_base;
   24003    GLint s;
   24004    GLint t;
   24005    GLint r;
   24006 };
   24007 static inline void
   24008 _mesa_unmarshal_TexCoord3i(struct gl_context *ctx, const struct marshal_cmd_TexCoord3i *cmd)
   24009 {
   24010    const GLint s = cmd->s;
   24011    const GLint t = cmd->t;
   24012    const GLint r = cmd->r;
   24013    CALL_TexCoord3i(ctx->CurrentServerDispatch, (s, t, r));
   24014 }
   24015 static void GLAPIENTRY
   24016 _mesa_marshal_TexCoord3i(GLint s, GLint t, GLint r)
   24017 {
   24018    GET_CURRENT_CONTEXT(ctx);
   24019    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord3i);
   24020    struct marshal_cmd_TexCoord3i *cmd;
   24021    debug_print_marshal("TexCoord3i");
   24022    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24023       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord3i, cmd_size);
   24024       cmd->s = s;
   24025       cmd->t = t;
   24026       cmd->r = r;
   24027       _mesa_post_marshal_hook(ctx);
   24028       return;
   24029    }
   24030 
   24031    _mesa_glthread_finish(ctx);
   24032    debug_print_sync_fallback("TexCoord3i");
   24033    CALL_TexCoord3i(ctx->CurrentServerDispatch, (s, t, r));
   24034 }
   24035 
   24036 
   24037 /* CopyColorTable: marshalled asynchronously */
   24038 struct marshal_cmd_CopyColorTable
   24039 {
   24040    struct marshal_cmd_base cmd_base;
   24041    GLenum target;
   24042    GLenum internalformat;
   24043    GLint x;
   24044    GLint y;
   24045    GLsizei width;
   24046 };
   24047 static inline void
   24048 _mesa_unmarshal_CopyColorTable(struct gl_context *ctx, const struct marshal_cmd_CopyColorTable *cmd)
   24049 {
   24050    const GLenum target = cmd->target;
   24051    const GLenum internalformat = cmd->internalformat;
   24052    const GLint x = cmd->x;
   24053    const GLint y = cmd->y;
   24054    const GLsizei width = cmd->width;
   24055    CALL_CopyColorTable(ctx->CurrentServerDispatch, (target, internalformat, x, y, width));
   24056 }
   24057 static void GLAPIENTRY
   24058 _mesa_marshal_CopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width)
   24059 {
   24060    GET_CURRENT_CONTEXT(ctx);
   24061    size_t cmd_size = sizeof(struct marshal_cmd_CopyColorTable);
   24062    struct marshal_cmd_CopyColorTable *cmd;
   24063    debug_print_marshal("CopyColorTable");
   24064    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24065       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyColorTable, cmd_size);
   24066       cmd->target = target;
   24067       cmd->internalformat = internalformat;
   24068       cmd->x = x;
   24069       cmd->y = y;
   24070       cmd->width = width;
   24071       _mesa_post_marshal_hook(ctx);
   24072       return;
   24073    }
   24074 
   24075    _mesa_glthread_finish(ctx);
   24076    debug_print_sync_fallback("CopyColorTable");
   24077    CALL_CopyColorTable(ctx->CurrentServerDispatch, (target, internalformat, x, y, width));
   24078 }
   24079 
   24080 
   24081 /* Frustum: marshalled asynchronously */
   24082 struct marshal_cmd_Frustum
   24083 {
   24084    struct marshal_cmd_base cmd_base;
   24085    GLdouble left;
   24086    GLdouble right;
   24087    GLdouble bottom;
   24088    GLdouble top;
   24089    GLdouble zNear;
   24090    GLdouble zFar;
   24091 };
   24092 static inline void
   24093 _mesa_unmarshal_Frustum(struct gl_context *ctx, const struct marshal_cmd_Frustum *cmd)
   24094 {
   24095    const GLdouble left = cmd->left;
   24096    const GLdouble right = cmd->right;
   24097    const GLdouble bottom = cmd->bottom;
   24098    const GLdouble top = cmd->top;
   24099    const GLdouble zNear = cmd->zNear;
   24100    const GLdouble zFar = cmd->zFar;
   24101    CALL_Frustum(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar));
   24102 }
   24103 static void GLAPIENTRY
   24104 _mesa_marshal_Frustum(GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar)
   24105 {
   24106    GET_CURRENT_CONTEXT(ctx);
   24107    size_t cmd_size = sizeof(struct marshal_cmd_Frustum);
   24108    struct marshal_cmd_Frustum *cmd;
   24109    debug_print_marshal("Frustum");
   24110    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24111       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Frustum, cmd_size);
   24112       cmd->left = left;
   24113       cmd->right = right;
   24114       cmd->bottom = bottom;
   24115       cmd->top = top;
   24116       cmd->zNear = zNear;
   24117       cmd->zFar = zFar;
   24118       _mesa_post_marshal_hook(ctx);
   24119       return;
   24120    }
   24121 
   24122    _mesa_glthread_finish(ctx);
   24123    debug_print_sync_fallback("Frustum");
   24124    CALL_Frustum(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar));
   24125 }
   24126 
   24127 
   24128 /* TexCoord3d: marshalled asynchronously */
   24129 struct marshal_cmd_TexCoord3d
   24130 {
   24131    struct marshal_cmd_base cmd_base;
   24132    GLdouble s;
   24133    GLdouble t;
   24134    GLdouble r;
   24135 };
   24136 static inline void
   24137 _mesa_unmarshal_TexCoord3d(struct gl_context *ctx, const struct marshal_cmd_TexCoord3d *cmd)
   24138 {
   24139    const GLdouble s = cmd->s;
   24140    const GLdouble t = cmd->t;
   24141    const GLdouble r = cmd->r;
   24142    CALL_TexCoord3d(ctx->CurrentServerDispatch, (s, t, r));
   24143 }
   24144 static void GLAPIENTRY
   24145 _mesa_marshal_TexCoord3d(GLdouble s, GLdouble t, GLdouble r)
   24146 {
   24147    GET_CURRENT_CONTEXT(ctx);
   24148    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord3d);
   24149    struct marshal_cmd_TexCoord3d *cmd;
   24150    debug_print_marshal("TexCoord3d");
   24151    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24152       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord3d, cmd_size);
   24153       cmd->s = s;
   24154       cmd->t = t;
   24155       cmd->r = r;
   24156       _mesa_post_marshal_hook(ctx);
   24157       return;
   24158    }
   24159 
   24160    _mesa_glthread_finish(ctx);
   24161    debug_print_sync_fallback("TexCoord3d");
   24162    CALL_TexCoord3d(ctx->CurrentServerDispatch, (s, t, r));
   24163 }
   24164 
   24165 
   24166 /* GetTextureParameteriv: marshalled synchronously */
   24167 static void GLAPIENTRY
   24168 _mesa_marshal_GetTextureParameteriv(GLuint texture, GLenum pname, GLint * params)
   24169 {
   24170    GET_CURRENT_CONTEXT(ctx);
   24171    _mesa_glthread_finish(ctx);
   24172    debug_print_sync("GetTextureParameteriv");
   24173    CALL_GetTextureParameteriv(ctx->CurrentServerDispatch, (texture, pname, params));
   24174 }
   24175 
   24176 
   24177 /* TexCoord3f: marshalled asynchronously */
   24178 struct marshal_cmd_TexCoord3f
   24179 {
   24180    struct marshal_cmd_base cmd_base;
   24181    GLfloat s;
   24182    GLfloat t;
   24183    GLfloat r;
   24184 };
   24185 static inline void
   24186 _mesa_unmarshal_TexCoord3f(struct gl_context *ctx, const struct marshal_cmd_TexCoord3f *cmd)
   24187 {
   24188    const GLfloat s = cmd->s;
   24189    const GLfloat t = cmd->t;
   24190    const GLfloat r = cmd->r;
   24191    CALL_TexCoord3f(ctx->CurrentServerDispatch, (s, t, r));
   24192 }
   24193 static void GLAPIENTRY
   24194 _mesa_marshal_TexCoord3f(GLfloat s, GLfloat t, GLfloat r)
   24195 {
   24196    GET_CURRENT_CONTEXT(ctx);
   24197    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord3f);
   24198    struct marshal_cmd_TexCoord3f *cmd;
   24199    debug_print_marshal("TexCoord3f");
   24200    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24201       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord3f, cmd_size);
   24202       cmd->s = s;
   24203       cmd->t = t;
   24204       cmd->r = r;
   24205       _mesa_post_marshal_hook(ctx);
   24206       return;
   24207    }
   24208 
   24209    _mesa_glthread_finish(ctx);
   24210    debug_print_sync_fallback("TexCoord3f");
   24211    CALL_TexCoord3f(ctx->CurrentServerDispatch, (s, t, r));
   24212 }
   24213 
   24214 
   24215 /* DepthRangeArrayv: marshalled asynchronously */
   24216 struct marshal_cmd_DepthRangeArrayv
   24217 {
   24218    struct marshal_cmd_base cmd_base;
   24219    GLuint first;
   24220    GLsizei count;
   24221    /* Next safe_mul(count, 16) bytes are GLclampd v[count][2] */
   24222 };
   24223 static inline void
   24224 _mesa_unmarshal_DepthRangeArrayv(struct gl_context *ctx, const struct marshal_cmd_DepthRangeArrayv *cmd)
   24225 {
   24226    const GLuint first = cmd->first;
   24227    const GLsizei count = cmd->count;
   24228    const GLclampd * v;
   24229    const char *variable_data = (const char *) (cmd + 1);
   24230    v = (const GLclampd *) variable_data;
   24231    variable_data += count * 16;
   24232    CALL_DepthRangeArrayv(ctx->CurrentServerDispatch, (first, count, v));
   24233 }
   24234 static void GLAPIENTRY
   24235 _mesa_marshal_DepthRangeArrayv(GLuint first, GLsizei count, const GLclampd * v)
   24236 {
   24237    GET_CURRENT_CONTEXT(ctx);
   24238    size_t cmd_size = sizeof(struct marshal_cmd_DepthRangeArrayv) + safe_mul(count, 16);
   24239    struct marshal_cmd_DepthRangeArrayv *cmd;
   24240    debug_print_marshal("DepthRangeArrayv");
   24241    if (unlikely(safe_mul(count, 16) < 0)) {
   24242       goto fallback_to_sync;
   24243    }
   24244    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24245       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DepthRangeArrayv, cmd_size);
   24246       cmd->first = first;
   24247       cmd->count = count;
   24248       char *variable_data = (char *) (cmd + 1);
   24249       memcpy(variable_data, v, count * 16);
   24250       variable_data += count * 16;
   24251       _mesa_post_marshal_hook(ctx);
   24252       return;
   24253    }
   24254 
   24255 fallback_to_sync:
   24256    _mesa_glthread_finish(ctx);
   24257    debug_print_sync_fallback("DepthRangeArrayv");
   24258    CALL_DepthRangeArrayv(ctx->CurrentServerDispatch, (first, count, v));
   24259 }
   24260 
   24261 
   24262 /* DeleteTextures: marshalled asynchronously */
   24263 struct marshal_cmd_DeleteTextures
   24264 {
   24265    struct marshal_cmd_base cmd_base;
   24266    GLsizei n;
   24267    /* Next safe_mul(n, 4) bytes are GLuint textures[n] */
   24268 };
   24269 static inline void
   24270 _mesa_unmarshal_DeleteTextures(struct gl_context *ctx, const struct marshal_cmd_DeleteTextures *cmd)
   24271 {
   24272    const GLsizei n = cmd->n;
   24273    const GLuint * textures;
   24274    const char *variable_data = (const char *) (cmd + 1);
   24275    textures = (const GLuint *) variable_data;
   24276    variable_data += n * 4;
   24277    CALL_DeleteTextures(ctx->CurrentServerDispatch, (n, textures));
   24278 }
   24279 static void GLAPIENTRY
   24280 _mesa_marshal_DeleteTextures(GLsizei n, const GLuint * textures)
   24281 {
   24282    GET_CURRENT_CONTEXT(ctx);
   24283    size_t cmd_size = sizeof(struct marshal_cmd_DeleteTextures) + safe_mul(n, 4);
   24284    struct marshal_cmd_DeleteTextures *cmd;
   24285    debug_print_marshal("DeleteTextures");
   24286    if (unlikely(safe_mul(n, 4) < 0)) {
   24287       goto fallback_to_sync;
   24288    }
   24289    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24290       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteTextures, cmd_size);
   24291       cmd->n = n;
   24292       char *variable_data = (char *) (cmd + 1);
   24293       memcpy(variable_data, textures, n * 4);
   24294       variable_data += n * 4;
   24295       _mesa_post_marshal_hook(ctx);
   24296       return;
   24297    }
   24298 
   24299 fallback_to_sync:
   24300    _mesa_glthread_finish(ctx);
   24301    debug_print_sync_fallback("DeleteTextures");
   24302    CALL_DeleteTextures(ctx->CurrentServerDispatch, (n, textures));
   24303 }
   24304 
   24305 
   24306 /* TexCoordPointerEXT: marshalled asynchronously */
   24307 struct marshal_cmd_TexCoordPointerEXT
   24308 {
   24309    struct marshal_cmd_base cmd_base;
   24310    GLint size;
   24311    GLenum type;
   24312    GLsizei stride;
   24313    GLsizei count;
   24314    const GLvoid * pointer;
   24315 };
   24316 static inline void
   24317 _mesa_unmarshal_TexCoordPointerEXT(struct gl_context *ctx, const struct marshal_cmd_TexCoordPointerEXT *cmd)
   24318 {
   24319    const GLint size = cmd->size;
   24320    const GLenum type = cmd->type;
   24321    const GLsizei stride = cmd->stride;
   24322    const GLsizei count = cmd->count;
   24323    const GLvoid * pointer = cmd->pointer;
   24324    CALL_TexCoordPointerEXT(ctx->CurrentServerDispatch, (size, type, stride, count, pointer));
   24325 }
   24326 static void GLAPIENTRY
   24327 _mesa_marshal_TexCoordPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
   24328 {
   24329    GET_CURRENT_CONTEXT(ctx);
   24330    size_t cmd_size = sizeof(struct marshal_cmd_TexCoordPointerEXT);
   24331    struct marshal_cmd_TexCoordPointerEXT *cmd;
   24332    debug_print_marshal("TexCoordPointerEXT");
   24333    if (_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)) {
   24334       _mesa_glthread_finish(ctx);
   24335       _mesa_glthread_restore_dispatch(ctx);
   24336       debug_print_sync_fallback("TexCoordPointerEXT");
   24337       CALL_TexCoordPointerEXT(ctx->CurrentServerDispatch, (size, type, stride, count, pointer));
   24338       return;
   24339    }
   24340    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24341       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordPointerEXT, cmd_size);
   24342       cmd->size = size;
   24343       cmd->type = type;
   24344       cmd->stride = stride;
   24345       cmd->count = count;
   24346       cmd->pointer = pointer;
   24347       _mesa_post_marshal_hook(ctx);
   24348       return;
   24349    }
   24350 
   24351    _mesa_glthread_finish(ctx);
   24352    debug_print_sync_fallback("TexCoordPointerEXT");
   24353    CALL_TexCoordPointerEXT(ctx->CurrentServerDispatch, (size, type, stride, count, pointer));
   24354 }
   24355 
   24356 
   24357 /* TexCoord3s: marshalled asynchronously */
   24358 struct marshal_cmd_TexCoord3s
   24359 {
   24360    struct marshal_cmd_base cmd_base;
   24361    GLshort s;
   24362    GLshort t;
   24363    GLshort r;
   24364 };
   24365 static inline void
   24366 _mesa_unmarshal_TexCoord3s(struct gl_context *ctx, const struct marshal_cmd_TexCoord3s *cmd)
   24367 {
   24368    const GLshort s = cmd->s;
   24369    const GLshort t = cmd->t;
   24370    const GLshort r = cmd->r;
   24371    CALL_TexCoord3s(ctx->CurrentServerDispatch, (s, t, r));
   24372 }
   24373 static void GLAPIENTRY
   24374 _mesa_marshal_TexCoord3s(GLshort s, GLshort t, GLshort r)
   24375 {
   24376    GET_CURRENT_CONTEXT(ctx);
   24377    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord3s);
   24378    struct marshal_cmd_TexCoord3s *cmd;
   24379    debug_print_marshal("TexCoord3s");
   24380    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24381       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord3s, cmd_size);
   24382       cmd->s = s;
   24383       cmd->t = t;
   24384       cmd->r = r;
   24385       _mesa_post_marshal_hook(ctx);
   24386       return;
   24387    }
   24388 
   24389    _mesa_glthread_finish(ctx);
   24390    debug_print_sync_fallback("TexCoord3s");
   24391    CALL_TexCoord3s(ctx->CurrentServerDispatch, (s, t, r));
   24392 }
   24393 
   24394 
   24395 /* GetTexLevelParameteriv: marshalled synchronously */
   24396 static void GLAPIENTRY
   24397 _mesa_marshal_GetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint * params)
   24398 {
   24399    GET_CURRENT_CONTEXT(ctx);
   24400    _mesa_glthread_finish(ctx);
   24401    debug_print_sync("GetTexLevelParameteriv");
   24402    CALL_GetTexLevelParameteriv(ctx->CurrentServerDispatch, (target, level, pname, params));
   24403 }
   24404 
   24405 
   24406 /* TextureParameterIuiv: marshalled synchronously */
   24407 static void GLAPIENTRY
   24408 _mesa_marshal_TextureParameterIuiv(GLuint texture, GLenum pname, const GLuint * params)
   24409 {
   24410    GET_CURRENT_CONTEXT(ctx);
   24411    _mesa_glthread_finish(ctx);
   24412    debug_print_sync("TextureParameterIuiv");
   24413    CALL_TextureParameterIuiv(ctx->CurrentServerDispatch, (texture, pname, params));
   24414 }
   24415 
   24416 
   24417 /* GenPerfMonitorsAMD: marshalled synchronously */
   24418 static void GLAPIENTRY
   24419 _mesa_marshal_GenPerfMonitorsAMD(GLsizei n, GLuint * monitors)
   24420 {
   24421    GET_CURRENT_CONTEXT(ctx);
   24422    _mesa_glthread_finish(ctx);
   24423    debug_print_sync("GenPerfMonitorsAMD");
   24424    CALL_GenPerfMonitorsAMD(ctx->CurrentServerDispatch, (n, monitors));
   24425 }
   24426 
   24427 
   24428 /* ClearAccum: marshalled asynchronously */
   24429 struct marshal_cmd_ClearAccum
   24430 {
   24431    struct marshal_cmd_base cmd_base;
   24432    GLfloat red;
   24433    GLfloat green;
   24434    GLfloat blue;
   24435    GLfloat alpha;
   24436 };
   24437 static inline void
   24438 _mesa_unmarshal_ClearAccum(struct gl_context *ctx, const struct marshal_cmd_ClearAccum *cmd)
   24439 {
   24440    const GLfloat red = cmd->red;
   24441    const GLfloat green = cmd->green;
   24442    const GLfloat blue = cmd->blue;
   24443    const GLfloat alpha = cmd->alpha;
   24444    CALL_ClearAccum(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   24445 }
   24446 static void GLAPIENTRY
   24447 _mesa_marshal_ClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
   24448 {
   24449    GET_CURRENT_CONTEXT(ctx);
   24450    size_t cmd_size = sizeof(struct marshal_cmd_ClearAccum);
   24451    struct marshal_cmd_ClearAccum *cmd;
   24452    debug_print_marshal("ClearAccum");
   24453    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24454       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearAccum, cmd_size);
   24455       cmd->red = red;
   24456       cmd->green = green;
   24457       cmd->blue = blue;
   24458       cmd->alpha = alpha;
   24459       _mesa_post_marshal_hook(ctx);
   24460       return;
   24461    }
   24462 
   24463    _mesa_glthread_finish(ctx);
   24464    debug_print_sync_fallback("ClearAccum");
   24465    CALL_ClearAccum(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   24466 }
   24467 
   24468 
   24469 /* TexCoord4iv: marshalled asynchronously */
   24470 struct marshal_cmd_TexCoord4iv
   24471 {
   24472    struct marshal_cmd_base cmd_base;
   24473    GLint v[4];
   24474 };
   24475 static inline void
   24476 _mesa_unmarshal_TexCoord4iv(struct gl_context *ctx, const struct marshal_cmd_TexCoord4iv *cmd)
   24477 {
   24478    const GLint * v = cmd->v;
   24479    CALL_TexCoord4iv(ctx->CurrentServerDispatch, (v));
   24480 }
   24481 static void GLAPIENTRY
   24482 _mesa_marshal_TexCoord4iv(const GLint * v)
   24483 {
   24484    GET_CURRENT_CONTEXT(ctx);
   24485    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord4iv);
   24486    struct marshal_cmd_TexCoord4iv *cmd;
   24487    debug_print_marshal("TexCoord4iv");
   24488    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24489       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord4iv, cmd_size);
   24490       memcpy(cmd->v, v, 16);
   24491       _mesa_post_marshal_hook(ctx);
   24492       return;
   24493    }
   24494 
   24495    _mesa_glthread_finish(ctx);
   24496    debug_print_sync_fallback("TexCoord4iv");
   24497    CALL_TexCoord4iv(ctx->CurrentServerDispatch, (v));
   24498 }
   24499 
   24500 
   24501 /* TexStorage3D: marshalled asynchronously */
   24502 struct marshal_cmd_TexStorage3D
   24503 {
   24504    struct marshal_cmd_base cmd_base;
   24505    GLenum target;
   24506    GLsizei levels;
   24507    GLenum internalFormat;
   24508    GLsizei width;
   24509    GLsizei height;
   24510    GLsizei depth;
   24511 };
   24512 static inline void
   24513 _mesa_unmarshal_TexStorage3D(struct gl_context *ctx, const struct marshal_cmd_TexStorage3D *cmd)
   24514 {
   24515    const GLenum target = cmd->target;
   24516    const GLsizei levels = cmd->levels;
   24517    const GLenum internalFormat = cmd->internalFormat;
   24518    const GLsizei width = cmd->width;
   24519    const GLsizei height = cmd->height;
   24520    const GLsizei depth = cmd->depth;
   24521    CALL_TexStorage3D(ctx->CurrentServerDispatch, (target, levels, internalFormat, width, height, depth));
   24522 }
   24523 static void GLAPIENTRY
   24524 _mesa_marshal_TexStorage3D(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth)
   24525 {
   24526    GET_CURRENT_CONTEXT(ctx);
   24527    size_t cmd_size = sizeof(struct marshal_cmd_TexStorage3D);
   24528    struct marshal_cmd_TexStorage3D *cmd;
   24529    debug_print_marshal("TexStorage3D");
   24530    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24531       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorage3D, cmd_size);
   24532       cmd->target = target;
   24533       cmd->levels = levels;
   24534       cmd->internalFormat = internalFormat;
   24535       cmd->width = width;
   24536       cmd->height = height;
   24537       cmd->depth = depth;
   24538       _mesa_post_marshal_hook(ctx);
   24539       return;
   24540    }
   24541 
   24542    _mesa_glthread_finish(ctx);
   24543    debug_print_sync_fallback("TexStorage3D");
   24544    CALL_TexStorage3D(ctx->CurrentServerDispatch, (target, levels, internalFormat, width, height, depth));
   24545 }
   24546 
   24547 
   24548 /* Uniform2i64ARB: marshalled asynchronously */
   24549 struct marshal_cmd_Uniform2i64ARB
   24550 {
   24551    struct marshal_cmd_base cmd_base;
   24552    GLint location;
   24553    GLint64 x;
   24554    GLint64 y;
   24555 };
   24556 static inline void
   24557 _mesa_unmarshal_Uniform2i64ARB(struct gl_context *ctx, const struct marshal_cmd_Uniform2i64ARB *cmd)
   24558 {
   24559    const GLint location = cmd->location;
   24560    const GLint64 x = cmd->x;
   24561    const GLint64 y = cmd->y;
   24562    CALL_Uniform2i64ARB(ctx->CurrentServerDispatch, (location, x, y));
   24563 }
   24564 static void GLAPIENTRY
   24565 _mesa_marshal_Uniform2i64ARB(GLint location, GLint64 x, GLint64 y)
   24566 {
   24567    GET_CURRENT_CONTEXT(ctx);
   24568    size_t cmd_size = sizeof(struct marshal_cmd_Uniform2i64ARB);
   24569    struct marshal_cmd_Uniform2i64ARB *cmd;
   24570    debug_print_marshal("Uniform2i64ARB");
   24571    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24572       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2i64ARB, cmd_size);
   24573       cmd->location = location;
   24574       cmd->x = x;
   24575       cmd->y = y;
   24576       _mesa_post_marshal_hook(ctx);
   24577       return;
   24578    }
   24579 
   24580    _mesa_glthread_finish(ctx);
   24581    debug_print_sync_fallback("Uniform2i64ARB");
   24582    CALL_Uniform2i64ARB(ctx->CurrentServerDispatch, (location, x, y));
   24583 }
   24584 
   24585 
   24586 /* FramebufferTexture3D: marshalled asynchronously */
   24587 struct marshal_cmd_FramebufferTexture3D
   24588 {
   24589    struct marshal_cmd_base cmd_base;
   24590    GLenum target;
   24591    GLenum attachment;
   24592    GLenum textarget;
   24593    GLuint texture;
   24594    GLint level;
   24595    GLint layer;
   24596 };
   24597 static inline void
   24598 _mesa_unmarshal_FramebufferTexture3D(struct gl_context *ctx, const struct marshal_cmd_FramebufferTexture3D *cmd)
   24599 {
   24600    const GLenum target = cmd->target;
   24601    const GLenum attachment = cmd->attachment;
   24602    const GLenum textarget = cmd->textarget;
   24603    const GLuint texture = cmd->texture;
   24604    const GLint level = cmd->level;
   24605    const GLint layer = cmd->layer;
   24606    CALL_FramebufferTexture3D(ctx->CurrentServerDispatch, (target, attachment, textarget, texture, level, layer));
   24607 }
   24608 static void GLAPIENTRY
   24609 _mesa_marshal_FramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer)
   24610 {
   24611    GET_CURRENT_CONTEXT(ctx);
   24612    size_t cmd_size = sizeof(struct marshal_cmd_FramebufferTexture3D);
   24613    struct marshal_cmd_FramebufferTexture3D *cmd;
   24614    debug_print_marshal("FramebufferTexture3D");
   24615    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24616       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferTexture3D, cmd_size);
   24617       cmd->target = target;
   24618       cmd->attachment = attachment;
   24619       cmd->textarget = textarget;
   24620       cmd->texture = texture;
   24621       cmd->level = level;
   24622       cmd->layer = layer;
   24623       _mesa_post_marshal_hook(ctx);
   24624       return;
   24625    }
   24626 
   24627    _mesa_glthread_finish(ctx);
   24628    debug_print_sync_fallback("FramebufferTexture3D");
   24629    CALL_FramebufferTexture3D(ctx->CurrentServerDispatch, (target, attachment, textarget, texture, level, layer));
   24630 }
   24631 
   24632 
   24633 /* GetBufferParameteriv: marshalled synchronously */
   24634 static void GLAPIENTRY
   24635 _mesa_marshal_GetBufferParameteriv(GLenum target, GLenum pname, GLint * params)
   24636 {
   24637    GET_CURRENT_CONTEXT(ctx);
   24638    _mesa_glthread_finish(ctx);
   24639    debug_print_sync("GetBufferParameteriv");
   24640    CALL_GetBufferParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
   24641 }
   24642 
   24643 
   24644 /* VertexAttrib2fNV: marshalled asynchronously */
   24645 struct marshal_cmd_VertexAttrib2fNV
   24646 {
   24647    struct marshal_cmd_base cmd_base;
   24648    GLuint index;
   24649    GLfloat x;
   24650    GLfloat y;
   24651 };
   24652 static inline void
   24653 _mesa_unmarshal_VertexAttrib2fNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2fNV *cmd)
   24654 {
   24655    const GLuint index = cmd->index;
   24656    const GLfloat x = cmd->x;
   24657    const GLfloat y = cmd->y;
   24658    CALL_VertexAttrib2fNV(ctx->CurrentServerDispatch, (index, x, y));
   24659 }
   24660 static void GLAPIENTRY
   24661 _mesa_marshal_VertexAttrib2fNV(GLuint index, GLfloat x, GLfloat y)
   24662 {
   24663    GET_CURRENT_CONTEXT(ctx);
   24664    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib2fNV);
   24665    struct marshal_cmd_VertexAttrib2fNV *cmd;
   24666    debug_print_marshal("VertexAttrib2fNV");
   24667    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24668       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2fNV, cmd_size);
   24669       cmd->index = index;
   24670       cmd->x = x;
   24671       cmd->y = y;
   24672       _mesa_post_marshal_hook(ctx);
   24673       return;
   24674    }
   24675 
   24676    _mesa_glthread_finish(ctx);
   24677    debug_print_sync_fallback("VertexAttrib2fNV");
   24678    CALL_VertexAttrib2fNV(ctx->CurrentServerDispatch, (index, x, y));
   24679 }
   24680 
   24681 
   24682 /* CopyTexImage2D: marshalled asynchronously */
   24683 struct marshal_cmd_CopyTexImage2D
   24684 {
   24685    struct marshal_cmd_base cmd_base;
   24686    GLenum target;
   24687    GLint level;
   24688    GLenum internalformat;
   24689    GLint x;
   24690    GLint y;
   24691    GLsizei width;
   24692    GLsizei height;
   24693    GLint border;
   24694 };
   24695 static inline void
   24696 _mesa_unmarshal_CopyTexImage2D(struct gl_context *ctx, const struct marshal_cmd_CopyTexImage2D *cmd)
   24697 {
   24698    const GLenum target = cmd->target;
   24699    const GLint level = cmd->level;
   24700    const GLenum internalformat = cmd->internalformat;
   24701    const GLint x = cmd->x;
   24702    const GLint y = cmd->y;
   24703    const GLsizei width = cmd->width;
   24704    const GLsizei height = cmd->height;
   24705    const GLint border = cmd->border;
   24706    CALL_CopyTexImage2D(ctx->CurrentServerDispatch, (target, level, internalformat, x, y, width, height, border));
   24707 }
   24708 static void GLAPIENTRY
   24709 _mesa_marshal_CopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
   24710 {
   24711    GET_CURRENT_CONTEXT(ctx);
   24712    size_t cmd_size = sizeof(struct marshal_cmd_CopyTexImage2D);
   24713    struct marshal_cmd_CopyTexImage2D *cmd;
   24714    debug_print_marshal("CopyTexImage2D");
   24715    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24716       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyTexImage2D, cmd_size);
   24717       cmd->target = target;
   24718       cmd->level = level;
   24719       cmd->internalformat = internalformat;
   24720       cmd->x = x;
   24721       cmd->y = y;
   24722       cmd->width = width;
   24723       cmd->height = height;
   24724       cmd->border = border;
   24725       _mesa_post_marshal_hook(ctx);
   24726       return;
   24727    }
   24728 
   24729    _mesa_glthread_finish(ctx);
   24730    debug_print_sync_fallback("CopyTexImage2D");
   24731    CALL_CopyTexImage2D(ctx->CurrentServerDispatch, (target, level, internalformat, x, y, width, height, border));
   24732 }
   24733 
   24734 
   24735 /* Vertex3fv: marshalled asynchronously */
   24736 struct marshal_cmd_Vertex3fv
   24737 {
   24738    struct marshal_cmd_base cmd_base;
   24739    GLfloat v[3];
   24740 };
   24741 static inline void
   24742 _mesa_unmarshal_Vertex3fv(struct gl_context *ctx, const struct marshal_cmd_Vertex3fv *cmd)
   24743 {
   24744    const GLfloat * v = cmd->v;
   24745    CALL_Vertex3fv(ctx->CurrentServerDispatch, (v));
   24746 }
   24747 static void GLAPIENTRY
   24748 _mesa_marshal_Vertex3fv(const GLfloat * v)
   24749 {
   24750    GET_CURRENT_CONTEXT(ctx);
   24751    size_t cmd_size = sizeof(struct marshal_cmd_Vertex3fv);
   24752    struct marshal_cmd_Vertex3fv *cmd;
   24753    debug_print_marshal("Vertex3fv");
   24754    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24755       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex3fv, cmd_size);
   24756       memcpy(cmd->v, v, 12);
   24757       _mesa_post_marshal_hook(ctx);
   24758       return;
   24759    }
   24760 
   24761    _mesa_glthread_finish(ctx);
   24762    debug_print_sync_fallback("Vertex3fv");
   24763    CALL_Vertex3fv(ctx->CurrentServerDispatch, (v));
   24764 }
   24765 
   24766 
   24767 /* WindowPos4dvMESA: marshalled synchronously */
   24768 static void GLAPIENTRY
   24769 _mesa_marshal_WindowPos4dvMESA(const GLdouble * v)
   24770 {
   24771    GET_CURRENT_CONTEXT(ctx);
   24772    _mesa_glthread_finish(ctx);
   24773    debug_print_sync("WindowPos4dvMESA");
   24774    CALL_WindowPos4dvMESA(ctx->CurrentServerDispatch, (v));
   24775 }
   24776 
   24777 
   24778 /* ProgramUniform2i64vARB: marshalled asynchronously */
   24779 struct marshal_cmd_ProgramUniform2i64vARB
   24780 {
   24781    struct marshal_cmd_base cmd_base;
   24782    GLuint program;
   24783    GLint location;
   24784    GLsizei count;
   24785    /* Next safe_mul(count, 16) bytes are GLint64 value[count][2] */
   24786 };
   24787 static inline void
   24788 _mesa_unmarshal_ProgramUniform2i64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2i64vARB *cmd)
   24789 {
   24790    const GLuint program = cmd->program;
   24791    const GLint location = cmd->location;
   24792    const GLsizei count = cmd->count;
   24793    const GLint64 * value;
   24794    const char *variable_data = (const char *) (cmd + 1);
   24795    value = (const GLint64 *) variable_data;
   24796    variable_data += count * 16;
   24797    CALL_ProgramUniform2i64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
   24798 }
   24799 static void GLAPIENTRY
   24800 _mesa_marshal_ProgramUniform2i64vARB(GLuint program, GLint location, GLsizei count, const GLint64 * value)
   24801 {
   24802    GET_CURRENT_CONTEXT(ctx);
   24803    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform2i64vARB) + safe_mul(count, 16);
   24804    struct marshal_cmd_ProgramUniform2i64vARB *cmd;
   24805    debug_print_marshal("ProgramUniform2i64vARB");
   24806    if (unlikely(safe_mul(count, 16) < 0)) {
   24807       goto fallback_to_sync;
   24808    }
   24809    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24810       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2i64vARB, cmd_size);
   24811       cmd->program = program;
   24812       cmd->location = location;
   24813       cmd->count = count;
   24814       char *variable_data = (char *) (cmd + 1);
   24815       memcpy(variable_data, value, count * 16);
   24816       variable_data += count * 16;
   24817       _mesa_post_marshal_hook(ctx);
   24818       return;
   24819    }
   24820 
   24821 fallback_to_sync:
   24822    _mesa_glthread_finish(ctx);
   24823    debug_print_sync_fallback("ProgramUniform2i64vARB");
   24824    CALL_ProgramUniform2i64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
   24825 }
   24826 
   24827 
   24828 /* MultiTexCoordP2ui: marshalled asynchronously */
   24829 struct marshal_cmd_MultiTexCoordP2ui
   24830 {
   24831    struct marshal_cmd_base cmd_base;
   24832    GLenum texture;
   24833    GLenum type;
   24834    GLuint coords;
   24835 };
   24836 static inline void
   24837 _mesa_unmarshal_MultiTexCoordP2ui(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP2ui *cmd)
   24838 {
   24839    const GLenum texture = cmd->texture;
   24840    const GLenum type = cmd->type;
   24841    const GLuint coords = cmd->coords;
   24842    CALL_MultiTexCoordP2ui(ctx->CurrentServerDispatch, (texture, type, coords));
   24843 }
   24844 static void GLAPIENTRY
   24845 _mesa_marshal_MultiTexCoordP2ui(GLenum texture, GLenum type, GLuint coords)
   24846 {
   24847    GET_CURRENT_CONTEXT(ctx);
   24848    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP2ui);
   24849    struct marshal_cmd_MultiTexCoordP2ui *cmd;
   24850    debug_print_marshal("MultiTexCoordP2ui");
   24851    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24852       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP2ui, cmd_size);
   24853       cmd->texture = texture;
   24854       cmd->type = type;
   24855       cmd->coords = coords;
   24856       _mesa_post_marshal_hook(ctx);
   24857       return;
   24858    }
   24859 
   24860    _mesa_glthread_finish(ctx);
   24861    debug_print_sync_fallback("MultiTexCoordP2ui");
   24862    CALL_MultiTexCoordP2ui(ctx->CurrentServerDispatch, (texture, type, coords));
   24863 }
   24864 
   24865 
   24866 /* VertexAttribs1dvNV: marshalled asynchronously */
   24867 struct marshal_cmd_VertexAttribs1dvNV
   24868 {
   24869    struct marshal_cmd_base cmd_base;
   24870    GLuint index;
   24871    GLsizei n;
   24872    /* Next safe_mul(n, 8) bytes are GLdouble v[n] */
   24873 };
   24874 static inline void
   24875 _mesa_unmarshal_VertexAttribs1dvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs1dvNV *cmd)
   24876 {
   24877    const GLuint index = cmd->index;
   24878    const GLsizei n = cmd->n;
   24879    const GLdouble * v;
   24880    const char *variable_data = (const char *) (cmd + 1);
   24881    v = (const GLdouble *) variable_data;
   24882    variable_data += n * 8;
   24883    CALL_VertexAttribs1dvNV(ctx->CurrentServerDispatch, (index, n, v));
   24884 }
   24885 static void GLAPIENTRY
   24886 _mesa_marshal_VertexAttribs1dvNV(GLuint index, GLsizei n, const GLdouble * v)
   24887 {
   24888    GET_CURRENT_CONTEXT(ctx);
   24889    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribs1dvNV) + safe_mul(n, 8);
   24890    struct marshal_cmd_VertexAttribs1dvNV *cmd;
   24891    debug_print_marshal("VertexAttribs1dvNV");
   24892    if (unlikely(safe_mul(n, 8) < 0)) {
   24893       goto fallback_to_sync;
   24894    }
   24895    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24896       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs1dvNV, cmd_size);
   24897       cmd->index = index;
   24898       cmd->n = n;
   24899       char *variable_data = (char *) (cmd + 1);
   24900       memcpy(variable_data, v, n * 8);
   24901       variable_data += n * 8;
   24902       _mesa_post_marshal_hook(ctx);
   24903       return;
   24904    }
   24905 
   24906 fallback_to_sync:
   24907    _mesa_glthread_finish(ctx);
   24908    debug_print_sync_fallback("VertexAttribs1dvNV");
   24909    CALL_VertexAttribs1dvNV(ctx->CurrentServerDispatch, (index, n, v));
   24910 }
   24911 
   24912 
   24913 /* ImportSemaphoreFdEXT: marshalled asynchronously */
   24914 struct marshal_cmd_ImportSemaphoreFdEXT
   24915 {
   24916    struct marshal_cmd_base cmd_base;
   24917    GLuint semaphore;
   24918    GLenum handleType;
   24919    GLint fd;
   24920 };
   24921 static inline void
   24922 _mesa_unmarshal_ImportSemaphoreFdEXT(struct gl_context *ctx, const struct marshal_cmd_ImportSemaphoreFdEXT *cmd)
   24923 {
   24924    const GLuint semaphore = cmd->semaphore;
   24925    const GLenum handleType = cmd->handleType;
   24926    const GLint fd = cmd->fd;
   24927    CALL_ImportSemaphoreFdEXT(ctx->CurrentServerDispatch, (semaphore, handleType, fd));
   24928 }
   24929 static void GLAPIENTRY
   24930 _mesa_marshal_ImportSemaphoreFdEXT(GLuint semaphore, GLenum handleType, GLint fd)
   24931 {
   24932    GET_CURRENT_CONTEXT(ctx);
   24933    size_t cmd_size = sizeof(struct marshal_cmd_ImportSemaphoreFdEXT);
   24934    struct marshal_cmd_ImportSemaphoreFdEXT *cmd;
   24935    debug_print_marshal("ImportSemaphoreFdEXT");
   24936    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24937       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ImportSemaphoreFdEXT, cmd_size);
   24938       cmd->semaphore = semaphore;
   24939       cmd->handleType = handleType;
   24940       cmd->fd = fd;
   24941       _mesa_post_marshal_hook(ctx);
   24942       return;
   24943    }
   24944 
   24945    _mesa_glthread_finish(ctx);
   24946    debug_print_sync_fallback("ImportSemaphoreFdEXT");
   24947    CALL_ImportSemaphoreFdEXT(ctx->CurrentServerDispatch, (semaphore, handleType, fd));
   24948 }
   24949 
   24950 
   24951 /* IsQuery: marshalled synchronously */
   24952 static GLboolean GLAPIENTRY
   24953 _mesa_marshal_IsQuery(GLuint id)
   24954 {
   24955    GET_CURRENT_CONTEXT(ctx);
   24956    _mesa_glthread_finish(ctx);
   24957    debug_print_sync("IsQuery");
   24958    return CALL_IsQuery(ctx->CurrentServerDispatch, (id));
   24959 }
   24960 
   24961 
   24962 /* EdgeFlagPointerEXT: marshalled asynchronously */
   24963 struct marshal_cmd_EdgeFlagPointerEXT
   24964 {
   24965    struct marshal_cmd_base cmd_base;
   24966    GLsizei stride;
   24967    GLsizei count;
   24968    const GLboolean * pointer;
   24969 };
   24970 static inline void
   24971 _mesa_unmarshal_EdgeFlagPointerEXT(struct gl_context *ctx, const struct marshal_cmd_EdgeFlagPointerEXT *cmd)
   24972 {
   24973    const GLsizei stride = cmd->stride;
   24974    const GLsizei count = cmd->count;
   24975    const GLboolean * pointer = cmd->pointer;
   24976    CALL_EdgeFlagPointerEXT(ctx->CurrentServerDispatch, (stride, count, pointer));
   24977 }
   24978 static void GLAPIENTRY
   24979 _mesa_marshal_EdgeFlagPointerEXT(GLsizei stride, GLsizei count, const GLboolean * pointer)
   24980 {
   24981    GET_CURRENT_CONTEXT(ctx);
   24982    size_t cmd_size = sizeof(struct marshal_cmd_EdgeFlagPointerEXT);
   24983    struct marshal_cmd_EdgeFlagPointerEXT *cmd;
   24984    debug_print_marshal("EdgeFlagPointerEXT");
   24985    if (_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)) {
   24986       _mesa_glthread_finish(ctx);
   24987       _mesa_glthread_restore_dispatch(ctx);
   24988       debug_print_sync_fallback("EdgeFlagPointerEXT");
   24989       CALL_EdgeFlagPointerEXT(ctx->CurrentServerDispatch, (stride, count, pointer));
   24990       return;
   24991    }
   24992    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   24993       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EdgeFlagPointerEXT, cmd_size);
   24994       cmd->stride = stride;
   24995       cmd->count = count;
   24996       cmd->pointer = pointer;
   24997       _mesa_post_marshal_hook(ctx);
   24998       return;
   24999    }
   25000 
   25001    _mesa_glthread_finish(ctx);
   25002    debug_print_sync_fallback("EdgeFlagPointerEXT");
   25003    CALL_EdgeFlagPointerEXT(ctx->CurrentServerDispatch, (stride, count, pointer));
   25004 }
   25005 
   25006 
   25007 /* VertexAttribs2svNV: marshalled asynchronously */
   25008 struct marshal_cmd_VertexAttribs2svNV
   25009 {
   25010    struct marshal_cmd_base cmd_base;
   25011    GLuint index;
   25012    GLsizei n;
   25013    /* Next safe_mul(n, 4) bytes are GLshort v[n][2] */
   25014 };
   25015 static inline void
   25016 _mesa_unmarshal_VertexAttribs2svNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs2svNV *cmd)
   25017 {
   25018    const GLuint index = cmd->index;
   25019    const GLsizei n = cmd->n;
   25020    const GLshort * v;
   25021    const char *variable_data = (const char *) (cmd + 1);
   25022    v = (const GLshort *) variable_data;
   25023    variable_data += n * 4;
   25024    CALL_VertexAttribs2svNV(ctx->CurrentServerDispatch, (index, n, v));
   25025 }
   25026 static void GLAPIENTRY
   25027 _mesa_marshal_VertexAttribs2svNV(GLuint index, GLsizei n, const GLshort * v)
   25028 {
   25029    GET_CURRENT_CONTEXT(ctx);
   25030    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribs2svNV) + safe_mul(n, 4);
   25031    struct marshal_cmd_VertexAttribs2svNV *cmd;
   25032    debug_print_marshal("VertexAttribs2svNV");
   25033    if (unlikely(safe_mul(n, 4) < 0)) {
   25034       goto fallback_to_sync;
   25035    }
   25036    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25037       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs2svNV, cmd_size);
   25038       cmd->index = index;
   25039       cmd->n = n;
   25040       char *variable_data = (char *) (cmd + 1);
   25041       memcpy(variable_data, v, n * 4);
   25042       variable_data += n * 4;
   25043       _mesa_post_marshal_hook(ctx);
   25044       return;
   25045    }
   25046 
   25047 fallback_to_sync:
   25048    _mesa_glthread_finish(ctx);
   25049    debug_print_sync_fallback("VertexAttribs2svNV");
   25050    CALL_VertexAttribs2svNV(ctx->CurrentServerDispatch, (index, n, v));
   25051 }
   25052 
   25053 
   25054 /* CreateShaderProgramv: marshalled synchronously */
   25055 static GLuint GLAPIENTRY
   25056 _mesa_marshal_CreateShaderProgramv(GLenum type, GLsizei count, const GLchar * const * strings)
   25057 {
   25058    GET_CURRENT_CONTEXT(ctx);
   25059    _mesa_glthread_finish(ctx);
   25060    debug_print_sync("CreateShaderProgramv");
   25061    return CALL_CreateShaderProgramv(ctx->CurrentServerDispatch, (type, count, strings));
   25062 }
   25063 
   25064 
   25065 /* BlendEquationiARB: marshalled asynchronously */
   25066 struct marshal_cmd_BlendEquationiARB
   25067 {
   25068    struct marshal_cmd_base cmd_base;
   25069    GLuint buf;
   25070    GLenum mode;
   25071 };
   25072 static inline void
   25073 _mesa_unmarshal_BlendEquationiARB(struct gl_context *ctx, const struct marshal_cmd_BlendEquationiARB *cmd)
   25074 {
   25075    const GLuint buf = cmd->buf;
   25076    const GLenum mode = cmd->mode;
   25077    CALL_BlendEquationiARB(ctx->CurrentServerDispatch, (buf, mode));
   25078 }
   25079 static void GLAPIENTRY
   25080 _mesa_marshal_BlendEquationiARB(GLuint buf, GLenum mode)
   25081 {
   25082    GET_CURRENT_CONTEXT(ctx);
   25083    size_t cmd_size = sizeof(struct marshal_cmd_BlendEquationiARB);
   25084    struct marshal_cmd_BlendEquationiARB *cmd;
   25085    debug_print_marshal("BlendEquationiARB");
   25086    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25087       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendEquationiARB, cmd_size);
   25088       cmd->buf = buf;
   25089       cmd->mode = mode;
   25090       _mesa_post_marshal_hook(ctx);
   25091       return;
   25092    }
   25093 
   25094    _mesa_glthread_finish(ctx);
   25095    debug_print_sync_fallback("BlendEquationiARB");
   25096    CALL_BlendEquationiARB(ctx->CurrentServerDispatch, (buf, mode));
   25097 }
   25098 
   25099 
   25100 /* VertexAttribI4uivEXT: marshalled synchronously */
   25101 static void GLAPIENTRY
   25102 _mesa_marshal_VertexAttribI4uivEXT(GLuint index, const GLuint * v)
   25103 {
   25104    GET_CURRENT_CONTEXT(ctx);
   25105    _mesa_glthread_finish(ctx);
   25106    debug_print_sync("VertexAttribI4uivEXT");
   25107    CALL_VertexAttribI4uivEXT(ctx->CurrentServerDispatch, (index, v));
   25108 }
   25109 
   25110 
   25111 /* PointSizex: marshalled asynchronously */
   25112 struct marshal_cmd_PointSizex
   25113 {
   25114    struct marshal_cmd_base cmd_base;
   25115    GLfixed size;
   25116 };
   25117 static inline void
   25118 _mesa_unmarshal_PointSizex(struct gl_context *ctx, const struct marshal_cmd_PointSizex *cmd)
   25119 {
   25120    const GLfixed size = cmd->size;
   25121    CALL_PointSizex(ctx->CurrentServerDispatch, (size));
   25122 }
   25123 static void GLAPIENTRY
   25124 _mesa_marshal_PointSizex(GLfixed size)
   25125 {
   25126    GET_CURRENT_CONTEXT(ctx);
   25127    size_t cmd_size = sizeof(struct marshal_cmd_PointSizex);
   25128    struct marshal_cmd_PointSizex *cmd;
   25129    debug_print_marshal("PointSizex");
   25130    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25131       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PointSizex, cmd_size);
   25132       cmd->size = size;
   25133       _mesa_post_marshal_hook(ctx);
   25134       return;
   25135    }
   25136 
   25137    _mesa_glthread_finish(ctx);
   25138    debug_print_sync_fallback("PointSizex");
   25139    CALL_PointSizex(ctx->CurrentServerDispatch, (size));
   25140 }
   25141 
   25142 
   25143 /* PolygonMode: marshalled asynchronously */
   25144 struct marshal_cmd_PolygonMode
   25145 {
   25146    struct marshal_cmd_base cmd_base;
   25147    GLenum face;
   25148    GLenum mode;
   25149 };
   25150 static inline void
   25151 _mesa_unmarshal_PolygonMode(struct gl_context *ctx, const struct marshal_cmd_PolygonMode *cmd)
   25152 {
   25153    const GLenum face = cmd->face;
   25154    const GLenum mode = cmd->mode;
   25155    CALL_PolygonMode(ctx->CurrentServerDispatch, (face, mode));
   25156 }
   25157 static void GLAPIENTRY
   25158 _mesa_marshal_PolygonMode(GLenum face, GLenum mode)
   25159 {
   25160    GET_CURRENT_CONTEXT(ctx);
   25161    size_t cmd_size = sizeof(struct marshal_cmd_PolygonMode);
   25162    struct marshal_cmd_PolygonMode *cmd;
   25163    debug_print_marshal("PolygonMode");
   25164    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25165       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PolygonMode, cmd_size);
   25166       cmd->face = face;
   25167       cmd->mode = mode;
   25168       _mesa_post_marshal_hook(ctx);
   25169       return;
   25170    }
   25171 
   25172    _mesa_glthread_finish(ctx);
   25173    debug_print_sync_fallback("PolygonMode");
   25174    CALL_PolygonMode(ctx->CurrentServerDispatch, (face, mode));
   25175 }
   25176 
   25177 
   25178 /* SecondaryColor3iv: marshalled asynchronously */
   25179 struct marshal_cmd_SecondaryColor3iv
   25180 {
   25181    struct marshal_cmd_base cmd_base;
   25182    GLint v[3];
   25183 };
   25184 static inline void
   25185 _mesa_unmarshal_SecondaryColor3iv(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3iv *cmd)
   25186 {
   25187    const GLint * v = cmd->v;
   25188    CALL_SecondaryColor3iv(ctx->CurrentServerDispatch, (v));
   25189 }
   25190 static void GLAPIENTRY
   25191 _mesa_marshal_SecondaryColor3iv(const GLint * v)
   25192 {
   25193    GET_CURRENT_CONTEXT(ctx);
   25194    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColor3iv);
   25195    struct marshal_cmd_SecondaryColor3iv *cmd;
   25196    debug_print_marshal("SecondaryColor3iv");
   25197    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25198       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3iv, cmd_size);
   25199       memcpy(cmd->v, v, 12);
   25200       _mesa_post_marshal_hook(ctx);
   25201       return;
   25202    }
   25203 
   25204    _mesa_glthread_finish(ctx);
   25205    debug_print_sync_fallback("SecondaryColor3iv");
   25206    CALL_SecondaryColor3iv(ctx->CurrentServerDispatch, (v));
   25207 }
   25208 
   25209 
   25210 /* VertexAttribI1iEXT: marshalled asynchronously */
   25211 struct marshal_cmd_VertexAttribI1iEXT
   25212 {
   25213    struct marshal_cmd_base cmd_base;
   25214    GLuint index;
   25215    GLint x;
   25216 };
   25217 static inline void
   25218 _mesa_unmarshal_VertexAttribI1iEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI1iEXT *cmd)
   25219 {
   25220    const GLuint index = cmd->index;
   25221    const GLint x = cmd->x;
   25222    CALL_VertexAttribI1iEXT(ctx->CurrentServerDispatch, (index, x));
   25223 }
   25224 static void GLAPIENTRY
   25225 _mesa_marshal_VertexAttribI1iEXT(GLuint index, GLint x)
   25226 {
   25227    GET_CURRENT_CONTEXT(ctx);
   25228    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribI1iEXT);
   25229    struct marshal_cmd_VertexAttribI1iEXT *cmd;
   25230    debug_print_marshal("VertexAttribI1iEXT");
   25231    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25232       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI1iEXT, cmd_size);
   25233       cmd->index = index;
   25234       cmd->x = x;
   25235       _mesa_post_marshal_hook(ctx);
   25236       return;
   25237    }
   25238 
   25239    _mesa_glthread_finish(ctx);
   25240    debug_print_sync_fallback("VertexAttribI1iEXT");
   25241    CALL_VertexAttribI1iEXT(ctx->CurrentServerDispatch, (index, x));
   25242 }
   25243 
   25244 
   25245 /* VertexAttrib4Niv: marshalled asynchronously */
   25246 struct marshal_cmd_VertexAttrib4Niv
   25247 {
   25248    struct marshal_cmd_base cmd_base;
   25249    GLuint index;
   25250    GLint v[4];
   25251 };
   25252 static inline void
   25253 _mesa_unmarshal_VertexAttrib4Niv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Niv *cmd)
   25254 {
   25255    const GLuint index = cmd->index;
   25256    const GLint * v = cmd->v;
   25257    CALL_VertexAttrib4Niv(ctx->CurrentServerDispatch, (index, v));
   25258 }
   25259 static void GLAPIENTRY
   25260 _mesa_marshal_VertexAttrib4Niv(GLuint index, const GLint * v)
   25261 {
   25262    GET_CURRENT_CONTEXT(ctx);
   25263    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Niv);
   25264    struct marshal_cmd_VertexAttrib4Niv *cmd;
   25265    debug_print_marshal("VertexAttrib4Niv");
   25266    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25267       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Niv, cmd_size);
   25268       cmd->index = index;
   25269       memcpy(cmd->v, v, 16);
   25270       _mesa_post_marshal_hook(ctx);
   25271       return;
   25272    }
   25273 
   25274    _mesa_glthread_finish(ctx);
   25275    debug_print_sync_fallback("VertexAttrib4Niv");
   25276    CALL_VertexAttrib4Niv(ctx->CurrentServerDispatch, (index, v));
   25277 }
   25278 
   25279 
   25280 /* GetnUniformdvARB: marshalled synchronously */
   25281 static void GLAPIENTRY
   25282 _mesa_marshal_GetnUniformdvARB(GLuint program, GLint location, GLsizei bufSize, GLdouble * params)
   25283 {
   25284    GET_CURRENT_CONTEXT(ctx);
   25285    _mesa_glthread_finish(ctx);
   25286    debug_print_sync("GetnUniformdvARB");
   25287    CALL_GetnUniformdvARB(ctx->CurrentServerDispatch, (program, location, bufSize, params));
   25288 }
   25289 
   25290 
   25291 /* LinkProgram: marshalled asynchronously */
   25292 struct marshal_cmd_LinkProgram
   25293 {
   25294    struct marshal_cmd_base cmd_base;
   25295    GLuint program;
   25296 };
   25297 static inline void
   25298 _mesa_unmarshal_LinkProgram(struct gl_context *ctx, const struct marshal_cmd_LinkProgram *cmd)
   25299 {
   25300    const GLuint program = cmd->program;
   25301    CALL_LinkProgram(ctx->CurrentServerDispatch, (program));
   25302 }
   25303 static void GLAPIENTRY
   25304 _mesa_marshal_LinkProgram(GLuint program)
   25305 {
   25306    GET_CURRENT_CONTEXT(ctx);
   25307    size_t cmd_size = sizeof(struct marshal_cmd_LinkProgram);
   25308    struct marshal_cmd_LinkProgram *cmd;
   25309    debug_print_marshal("LinkProgram");
   25310    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25311       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LinkProgram, cmd_size);
   25312       cmd->program = program;
   25313       _mesa_post_marshal_hook(ctx);
   25314       return;
   25315    }
   25316 
   25317    _mesa_glthread_finish(ctx);
   25318    debug_print_sync_fallback("LinkProgram");
   25319    CALL_LinkProgram(ctx->CurrentServerDispatch, (program));
   25320 }
   25321 
   25322 
   25323 /* ProgramUniform4d: marshalled asynchronously */
   25324 struct marshal_cmd_ProgramUniform4d
   25325 {
   25326    struct marshal_cmd_base cmd_base;
   25327    GLuint program;
   25328    GLint location;
   25329    GLdouble x;
   25330    GLdouble y;
   25331    GLdouble z;
   25332    GLdouble w;
   25333 };
   25334 static inline void
   25335 _mesa_unmarshal_ProgramUniform4d(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4d *cmd)
   25336 {
   25337    const GLuint program = cmd->program;
   25338    const GLint location = cmd->location;
   25339    const GLdouble x = cmd->x;
   25340    const GLdouble y = cmd->y;
   25341    const GLdouble z = cmd->z;
   25342    const GLdouble w = cmd->w;
   25343    CALL_ProgramUniform4d(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
   25344 }
   25345 static void GLAPIENTRY
   25346 _mesa_marshal_ProgramUniform4d(GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
   25347 {
   25348    GET_CURRENT_CONTEXT(ctx);
   25349    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform4d);
   25350    struct marshal_cmd_ProgramUniform4d *cmd;
   25351    debug_print_marshal("ProgramUniform4d");
   25352    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25353       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4d, cmd_size);
   25354       cmd->program = program;
   25355       cmd->location = location;
   25356       cmd->x = x;
   25357       cmd->y = y;
   25358       cmd->z = z;
   25359       cmd->w = w;
   25360       _mesa_post_marshal_hook(ctx);
   25361       return;
   25362    }
   25363 
   25364    _mesa_glthread_finish(ctx);
   25365    debug_print_sync_fallback("ProgramUniform4d");
   25366    CALL_ProgramUniform4d(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
   25367 }
   25368 
   25369 
   25370 /* ProgramUniform4f: marshalled asynchronously */
   25371 struct marshal_cmd_ProgramUniform4f
   25372 {
   25373    struct marshal_cmd_base cmd_base;
   25374    GLuint program;
   25375    GLint location;
   25376    GLfloat x;
   25377    GLfloat y;
   25378    GLfloat z;
   25379    GLfloat w;
   25380 };
   25381 static inline void
   25382 _mesa_unmarshal_ProgramUniform4f(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4f *cmd)
   25383 {
   25384    const GLuint program = cmd->program;
   25385    const GLint location = cmd->location;
   25386    const GLfloat x = cmd->x;
   25387    const GLfloat y = cmd->y;
   25388    const GLfloat z = cmd->z;
   25389    const GLfloat w = cmd->w;
   25390    CALL_ProgramUniform4f(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
   25391 }
   25392 static void GLAPIENTRY
   25393 _mesa_marshal_ProgramUniform4f(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
   25394 {
   25395    GET_CURRENT_CONTEXT(ctx);
   25396    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform4f);
   25397    struct marshal_cmd_ProgramUniform4f *cmd;
   25398    debug_print_marshal("ProgramUniform4f");
   25399    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25400       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4f, cmd_size);
   25401       cmd->program = program;
   25402       cmd->location = location;
   25403       cmd->x = x;
   25404       cmd->y = y;
   25405       cmd->z = z;
   25406       cmd->w = w;
   25407       _mesa_post_marshal_hook(ctx);
   25408       return;
   25409    }
   25410 
   25411    _mesa_glthread_finish(ctx);
   25412    debug_print_sync_fallback("ProgramUniform4f");
   25413    CALL_ProgramUniform4f(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
   25414 }
   25415 
   25416 
   25417 /* ProgramUniform4i: marshalled asynchronously */
   25418 struct marshal_cmd_ProgramUniform4i
   25419 {
   25420    struct marshal_cmd_base cmd_base;
   25421    GLuint program;
   25422    GLint location;
   25423    GLint x;
   25424    GLint y;
   25425    GLint z;
   25426    GLint w;
   25427 };
   25428 static inline void
   25429 _mesa_unmarshal_ProgramUniform4i(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4i *cmd)
   25430 {
   25431    const GLuint program = cmd->program;
   25432    const GLint location = cmd->location;
   25433    const GLint x = cmd->x;
   25434    const GLint y = cmd->y;
   25435    const GLint z = cmd->z;
   25436    const GLint w = cmd->w;
   25437    CALL_ProgramUniform4i(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
   25438 }
   25439 static void GLAPIENTRY
   25440 _mesa_marshal_ProgramUniform4i(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w)
   25441 {
   25442    GET_CURRENT_CONTEXT(ctx);
   25443    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform4i);
   25444    struct marshal_cmd_ProgramUniform4i *cmd;
   25445    debug_print_marshal("ProgramUniform4i");
   25446    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25447       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4i, cmd_size);
   25448       cmd->program = program;
   25449       cmd->location = location;
   25450       cmd->x = x;
   25451       cmd->y = y;
   25452       cmd->z = z;
   25453       cmd->w = w;
   25454       _mesa_post_marshal_hook(ctx);
   25455       return;
   25456    }
   25457 
   25458    _mesa_glthread_finish(ctx);
   25459    debug_print_sync_fallback("ProgramUniform4i");
   25460    CALL_ProgramUniform4i(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
   25461 }
   25462 
   25463 
   25464 /* GetFramebufferParameteriv: marshalled synchronously */
   25465 static void GLAPIENTRY
   25466 _mesa_marshal_GetFramebufferParameteriv(GLenum target, GLenum pname, GLint * params)
   25467 {
   25468    GET_CURRENT_CONTEXT(ctx);
   25469    _mesa_glthread_finish(ctx);
   25470    debug_print_sync("GetFramebufferParameteriv");
   25471    CALL_GetFramebufferParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
   25472 }
   25473 
   25474 
   25475 /* GetNamedBufferPointerv: marshalled synchronously */
   25476 static void GLAPIENTRY
   25477 _mesa_marshal_GetNamedBufferPointerv(GLuint buffer, GLenum pname, GLvoid ** params)
   25478 {
   25479    GET_CURRENT_CONTEXT(ctx);
   25480    _mesa_glthread_finish(ctx);
   25481    debug_print_sync("GetNamedBufferPointerv");
   25482    CALL_GetNamedBufferPointerv(ctx->CurrentServerDispatch, (buffer, pname, params));
   25483 }
   25484 
   25485 
   25486 /* VertexAttrib4d: marshalled asynchronously */
   25487 struct marshal_cmd_VertexAttrib4d
   25488 {
   25489    struct marshal_cmd_base cmd_base;
   25490    GLuint index;
   25491    GLdouble x;
   25492    GLdouble y;
   25493    GLdouble z;
   25494    GLdouble w;
   25495 };
   25496 static inline void
   25497 _mesa_unmarshal_VertexAttrib4d(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4d *cmd)
   25498 {
   25499    const GLuint index = cmd->index;
   25500    const GLdouble x = cmd->x;
   25501    const GLdouble y = cmd->y;
   25502    const GLdouble z = cmd->z;
   25503    const GLdouble w = cmd->w;
   25504    CALL_VertexAttrib4d(ctx->CurrentServerDispatch, (index, x, y, z, w));
   25505 }
   25506 static void GLAPIENTRY
   25507 _mesa_marshal_VertexAttrib4d(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w)
   25508 {
   25509    GET_CURRENT_CONTEXT(ctx);
   25510    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4d);
   25511    struct marshal_cmd_VertexAttrib4d *cmd;
   25512    debug_print_marshal("VertexAttrib4d");
   25513    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25514       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4d, cmd_size);
   25515       cmd->index = index;
   25516       cmd->x = x;
   25517       cmd->y = y;
   25518       cmd->z = z;
   25519       cmd->w = w;
   25520       _mesa_post_marshal_hook(ctx);
   25521       return;
   25522    }
   25523 
   25524    _mesa_glthread_finish(ctx);
   25525    debug_print_sync_fallback("VertexAttrib4d");
   25526    CALL_VertexAttrib4d(ctx->CurrentServerDispatch, (index, x, y, z, w));
   25527 }
   25528 
   25529 
   25530 /* ProgramUniform4ui64vARB: marshalled asynchronously */
   25531 struct marshal_cmd_ProgramUniform4ui64vARB
   25532 {
   25533    struct marshal_cmd_base cmd_base;
   25534    GLuint program;
   25535    GLint location;
   25536    GLsizei count;
   25537    /* Next safe_mul(count, 32) bytes are GLuint64 value[count][4] */
   25538 };
   25539 static inline void
   25540 _mesa_unmarshal_ProgramUniform4ui64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4ui64vARB *cmd)
   25541 {
   25542    const GLuint program = cmd->program;
   25543    const GLint location = cmd->location;
   25544    const GLsizei count = cmd->count;
   25545    const GLuint64 * value;
   25546    const char *variable_data = (const char *) (cmd + 1);
   25547    value = (const GLuint64 *) variable_data;
   25548    variable_data += count * 32;
   25549    CALL_ProgramUniform4ui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
   25550 }
   25551 static void GLAPIENTRY
   25552 _mesa_marshal_ProgramUniform4ui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 * value)
   25553 {
   25554    GET_CURRENT_CONTEXT(ctx);
   25555    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform4ui64vARB) + safe_mul(count, 32);
   25556    struct marshal_cmd_ProgramUniform4ui64vARB *cmd;
   25557    debug_print_marshal("ProgramUniform4ui64vARB");
   25558    if (unlikely(safe_mul(count, 32) < 0)) {
   25559       goto fallback_to_sync;
   25560    }
   25561    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25562       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4ui64vARB, cmd_size);
   25563       cmd->program = program;
   25564       cmd->location = location;
   25565       cmd->count = count;
   25566       char *variable_data = (char *) (cmd + 1);
   25567       memcpy(variable_data, value, count * 32);
   25568       variable_data += count * 32;
   25569       _mesa_post_marshal_hook(ctx);
   25570       return;
   25571    }
   25572 
   25573 fallback_to_sync:
   25574    _mesa_glthread_finish(ctx);
   25575    debug_print_sync_fallback("ProgramUniform4ui64vARB");
   25576    CALL_ProgramUniform4ui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
   25577 }
   25578 
   25579 
   25580 /* WindowPos4sMESA: marshalled asynchronously */
   25581 struct marshal_cmd_WindowPos4sMESA
   25582 {
   25583    struct marshal_cmd_base cmd_base;
   25584    GLshort x;
   25585    GLshort y;
   25586    GLshort z;
   25587    GLshort w;
   25588 };
   25589 static inline void
   25590 _mesa_unmarshal_WindowPos4sMESA(struct gl_context *ctx, const struct marshal_cmd_WindowPos4sMESA *cmd)
   25591 {
   25592    const GLshort x = cmd->x;
   25593    const GLshort y = cmd->y;
   25594    const GLshort z = cmd->z;
   25595    const GLshort w = cmd->w;
   25596    CALL_WindowPos4sMESA(ctx->CurrentServerDispatch, (x, y, z, w));
   25597 }
   25598 static void GLAPIENTRY
   25599 _mesa_marshal_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w)
   25600 {
   25601    GET_CURRENT_CONTEXT(ctx);
   25602    size_t cmd_size = sizeof(struct marshal_cmd_WindowPos4sMESA);
   25603    struct marshal_cmd_WindowPos4sMESA *cmd;
   25604    debug_print_marshal("WindowPos4sMESA");
   25605    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25606       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos4sMESA, cmd_size);
   25607       cmd->x = x;
   25608       cmd->y = y;
   25609       cmd->z = z;
   25610       cmd->w = w;
   25611       _mesa_post_marshal_hook(ctx);
   25612       return;
   25613    }
   25614 
   25615    _mesa_glthread_finish(ctx);
   25616    debug_print_sync_fallback("WindowPos4sMESA");
   25617    CALL_WindowPos4sMESA(ctx->CurrentServerDispatch, (x, y, z, w));
   25618 }
   25619 
   25620 
   25621 /* VertexAttrib4s: marshalled asynchronously */
   25622 struct marshal_cmd_VertexAttrib4s
   25623 {
   25624    struct marshal_cmd_base cmd_base;
   25625    GLuint index;
   25626    GLshort x;
   25627    GLshort y;
   25628    GLshort z;
   25629    GLshort w;
   25630 };
   25631 static inline void
   25632 _mesa_unmarshal_VertexAttrib4s(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4s *cmd)
   25633 {
   25634    const GLuint index = cmd->index;
   25635    const GLshort x = cmd->x;
   25636    const GLshort y = cmd->y;
   25637    const GLshort z = cmd->z;
   25638    const GLshort w = cmd->w;
   25639    CALL_VertexAttrib4s(ctx->CurrentServerDispatch, (index, x, y, z, w));
   25640 }
   25641 static void GLAPIENTRY
   25642 _mesa_marshal_VertexAttrib4s(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w)
   25643 {
   25644    GET_CURRENT_CONTEXT(ctx);
   25645    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4s);
   25646    struct marshal_cmd_VertexAttrib4s *cmd;
   25647    debug_print_marshal("VertexAttrib4s");
   25648    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25649       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4s, cmd_size);
   25650       cmd->index = index;
   25651       cmd->x = x;
   25652       cmd->y = y;
   25653       cmd->z = z;
   25654       cmd->w = w;
   25655       _mesa_post_marshal_hook(ctx);
   25656       return;
   25657    }
   25658 
   25659    _mesa_glthread_finish(ctx);
   25660    debug_print_sync_fallback("VertexAttrib4s");
   25661    CALL_VertexAttrib4s(ctx->CurrentServerDispatch, (index, x, y, z, w));
   25662 }
   25663 
   25664 
   25665 /* ProgramUniform1i64vARB: marshalled asynchronously */
   25666 struct marshal_cmd_ProgramUniform1i64vARB
   25667 {
   25668    struct marshal_cmd_base cmd_base;
   25669    GLuint program;
   25670    GLint location;
   25671    GLsizei count;
   25672    /* Next safe_mul(count, 8) bytes are GLint64 value[count] */
   25673 };
   25674 static inline void
   25675 _mesa_unmarshal_ProgramUniform1i64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1i64vARB *cmd)
   25676 {
   25677    const GLuint program = cmd->program;
   25678    const GLint location = cmd->location;
   25679    const GLsizei count = cmd->count;
   25680    const GLint64 * value;
   25681    const char *variable_data = (const char *) (cmd + 1);
   25682    value = (const GLint64 *) variable_data;
   25683    variable_data += count * 8;
   25684    CALL_ProgramUniform1i64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
   25685 }
   25686 static void GLAPIENTRY
   25687 _mesa_marshal_ProgramUniform1i64vARB(GLuint program, GLint location, GLsizei count, const GLint64 * value)
   25688 {
   25689    GET_CURRENT_CONTEXT(ctx);
   25690    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform1i64vARB) + safe_mul(count, 8);
   25691    struct marshal_cmd_ProgramUniform1i64vARB *cmd;
   25692    debug_print_marshal("ProgramUniform1i64vARB");
   25693    if (unlikely(safe_mul(count, 8) < 0)) {
   25694       goto fallback_to_sync;
   25695    }
   25696    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25697       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1i64vARB, cmd_size);
   25698       cmd->program = program;
   25699       cmd->location = location;
   25700       cmd->count = count;
   25701       char *variable_data = (char *) (cmd + 1);
   25702       memcpy(variable_data, value, count * 8);
   25703       variable_data += count * 8;
   25704       _mesa_post_marshal_hook(ctx);
   25705       return;
   25706    }
   25707 
   25708 fallback_to_sync:
   25709    _mesa_glthread_finish(ctx);
   25710    debug_print_sync_fallback("ProgramUniform1i64vARB");
   25711    CALL_ProgramUniform1i64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
   25712 }
   25713 
   25714 
   25715 /* VertexAttrib1dvNV: marshalled asynchronously */
   25716 struct marshal_cmd_VertexAttrib1dvNV
   25717 {
   25718    struct marshal_cmd_base cmd_base;
   25719    GLuint index;
   25720    GLdouble v[1];
   25721 };
   25722 static inline void
   25723 _mesa_unmarshal_VertexAttrib1dvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1dvNV *cmd)
   25724 {
   25725    const GLuint index = cmd->index;
   25726    const GLdouble * v = cmd->v;
   25727    CALL_VertexAttrib1dvNV(ctx->CurrentServerDispatch, (index, v));
   25728 }
   25729 static void GLAPIENTRY
   25730 _mesa_marshal_VertexAttrib1dvNV(GLuint index, const GLdouble * v)
   25731 {
   25732    GET_CURRENT_CONTEXT(ctx);
   25733    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib1dvNV);
   25734    struct marshal_cmd_VertexAttrib1dvNV *cmd;
   25735    debug_print_marshal("VertexAttrib1dvNV");
   25736    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25737       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1dvNV, cmd_size);
   25738       cmd->index = index;
   25739       memcpy(cmd->v, v, 8);
   25740       _mesa_post_marshal_hook(ctx);
   25741       return;
   25742    }
   25743 
   25744    _mesa_glthread_finish(ctx);
   25745    debug_print_sync_fallback("VertexAttrib1dvNV");
   25746    CALL_VertexAttrib1dvNV(ctx->CurrentServerDispatch, (index, v));
   25747 }
   25748 
   25749 
   25750 /* GetSemaphoreParameterui64vEXT: marshalled synchronously */
   25751 static void GLAPIENTRY
   25752 _mesa_marshal_GetSemaphoreParameterui64vEXT(GLuint semaphore, GLenum pname, GLuint64 * params)
   25753 {
   25754    GET_CURRENT_CONTEXT(ctx);
   25755    _mesa_glthread_finish(ctx);
   25756    debug_print_sync("GetSemaphoreParameterui64vEXT");
   25757    CALL_GetSemaphoreParameterui64vEXT(ctx->CurrentServerDispatch, (semaphore, pname, params));
   25758 }
   25759 
   25760 
   25761 /* TexStorage3DMultisample: marshalled asynchronously */
   25762 struct marshal_cmd_TexStorage3DMultisample
   25763 {
   25764    struct marshal_cmd_base cmd_base;
   25765    GLenum target;
   25766    GLsizei samples;
   25767    GLenum internalformat;
   25768    GLsizei width;
   25769    GLsizei height;
   25770    GLsizei depth;
   25771    GLboolean fixedsamplelocations;
   25772 };
   25773 static inline void
   25774 _mesa_unmarshal_TexStorage3DMultisample(struct gl_context *ctx, const struct marshal_cmd_TexStorage3DMultisample *cmd)
   25775 {
   25776    const GLenum target = cmd->target;
   25777    const GLsizei samples = cmd->samples;
   25778    const GLenum internalformat = cmd->internalformat;
   25779    const GLsizei width = cmd->width;
   25780    const GLsizei height = cmd->height;
   25781    const GLsizei depth = cmd->depth;
   25782    const GLboolean fixedsamplelocations = cmd->fixedsamplelocations;
   25783    CALL_TexStorage3DMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height, depth, fixedsamplelocations));
   25784 }
   25785 static void GLAPIENTRY
   25786 _mesa_marshal_TexStorage3DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)
   25787 {
   25788    GET_CURRENT_CONTEXT(ctx);
   25789    size_t cmd_size = sizeof(struct marshal_cmd_TexStorage3DMultisample);
   25790    struct marshal_cmd_TexStorage3DMultisample *cmd;
   25791    debug_print_marshal("TexStorage3DMultisample");
   25792    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25793       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorage3DMultisample, cmd_size);
   25794       cmd->target = target;
   25795       cmd->samples = samples;
   25796       cmd->internalformat = internalformat;
   25797       cmd->width = width;
   25798       cmd->height = height;
   25799       cmd->depth = depth;
   25800       cmd->fixedsamplelocations = fixedsamplelocations;
   25801       _mesa_post_marshal_hook(ctx);
   25802       return;
   25803    }
   25804 
   25805    _mesa_glthread_finish(ctx);
   25806    debug_print_sync_fallback("TexStorage3DMultisample");
   25807    CALL_TexStorage3DMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height, depth, fixedsamplelocations));
   25808 }
   25809 
   25810 
   25811 /* SamplerParameteriv: marshalled synchronously */
   25812 static void GLAPIENTRY
   25813 _mesa_marshal_SamplerParameteriv(GLuint sampler, GLenum pname, const GLint * params)
   25814 {
   25815    GET_CURRENT_CONTEXT(ctx);
   25816    _mesa_glthread_finish(ctx);
   25817    debug_print_sync("SamplerParameteriv");
   25818    CALL_SamplerParameteriv(ctx->CurrentServerDispatch, (sampler, pname, params));
   25819 }
   25820 
   25821 
   25822 /* VertexAttribP3uiv: marshalled synchronously */
   25823 static void GLAPIENTRY
   25824 _mesa_marshal_VertexAttribP3uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint * value)
   25825 {
   25826    GET_CURRENT_CONTEXT(ctx);
   25827    _mesa_glthread_finish(ctx);
   25828    debug_print_sync("VertexAttribP3uiv");
   25829    CALL_VertexAttribP3uiv(ctx->CurrentServerDispatch, (index, type, normalized, value));
   25830 }
   25831 
   25832 
   25833 /* ScissorIndexedv: marshalled asynchronously */
   25834 struct marshal_cmd_ScissorIndexedv
   25835 {
   25836    struct marshal_cmd_base cmd_base;
   25837    GLuint index;
   25838    GLint v[4];
   25839 };
   25840 static inline void
   25841 _mesa_unmarshal_ScissorIndexedv(struct gl_context *ctx, const struct marshal_cmd_ScissorIndexedv *cmd)
   25842 {
   25843    const GLuint index = cmd->index;
   25844    const GLint * v = cmd->v;
   25845    CALL_ScissorIndexedv(ctx->CurrentServerDispatch, (index, v));
   25846 }
   25847 static void GLAPIENTRY
   25848 _mesa_marshal_ScissorIndexedv(GLuint index, const GLint * v)
   25849 {
   25850    GET_CURRENT_CONTEXT(ctx);
   25851    size_t cmd_size = sizeof(struct marshal_cmd_ScissorIndexedv);
   25852    struct marshal_cmd_ScissorIndexedv *cmd;
   25853    debug_print_marshal("ScissorIndexedv");
   25854    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25855       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ScissorIndexedv, cmd_size);
   25856       cmd->index = index;
   25857       memcpy(cmd->v, v, 16);
   25858       _mesa_post_marshal_hook(ctx);
   25859       return;
   25860    }
   25861 
   25862    _mesa_glthread_finish(ctx);
   25863    debug_print_sync_fallback("ScissorIndexedv");
   25864    CALL_ScissorIndexedv(ctx->CurrentServerDispatch, (index, v));
   25865 }
   25866 
   25867 
   25868 /* GetStringi: marshalled synchronously */
   25869 static const GLubyte * GLAPIENTRY
   25870 _mesa_marshal_GetStringi(GLenum name, GLuint index)
   25871 {
   25872    GET_CURRENT_CONTEXT(ctx);
   25873    _mesa_glthread_finish(ctx);
   25874    debug_print_sync("GetStringi");
   25875    return CALL_GetStringi(ctx->CurrentServerDispatch, (name, index));
   25876 }
   25877 
   25878 
   25879 /* Uniform2dv: marshalled asynchronously */
   25880 struct marshal_cmd_Uniform2dv
   25881 {
   25882    struct marshal_cmd_base cmd_base;
   25883    GLint location;
   25884    GLsizei count;
   25885    /* Next safe_mul(count, 16) bytes are GLdouble value[count][2] */
   25886 };
   25887 static inline void
   25888 _mesa_unmarshal_Uniform2dv(struct gl_context *ctx, const struct marshal_cmd_Uniform2dv *cmd)
   25889 {
   25890    const GLint location = cmd->location;
   25891    const GLsizei count = cmd->count;
   25892    const GLdouble * value;
   25893    const char *variable_data = (const char *) (cmd + 1);
   25894    value = (const GLdouble *) variable_data;
   25895    variable_data += count * 16;
   25896    CALL_Uniform2dv(ctx->CurrentServerDispatch, (location, count, value));
   25897 }
   25898 static void GLAPIENTRY
   25899 _mesa_marshal_Uniform2dv(GLint location, GLsizei count, const GLdouble * value)
   25900 {
   25901    GET_CURRENT_CONTEXT(ctx);
   25902    size_t cmd_size = sizeof(struct marshal_cmd_Uniform2dv) + safe_mul(count, 16);
   25903    struct marshal_cmd_Uniform2dv *cmd;
   25904    debug_print_marshal("Uniform2dv");
   25905    if (unlikely(safe_mul(count, 16) < 0)) {
   25906       goto fallback_to_sync;
   25907    }
   25908    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25909       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2dv, cmd_size);
   25910       cmd->location = location;
   25911       cmd->count = count;
   25912       char *variable_data = (char *) (cmd + 1);
   25913       memcpy(variable_data, value, count * 16);
   25914       variable_data += count * 16;
   25915       _mesa_post_marshal_hook(ctx);
   25916       return;
   25917    }
   25918 
   25919 fallback_to_sync:
   25920    _mesa_glthread_finish(ctx);
   25921    debug_print_sync_fallback("Uniform2dv");
   25922    CALL_Uniform2dv(ctx->CurrentServerDispatch, (location, count, value));
   25923 }
   25924 
   25925 
   25926 /* VertexAttrib4dv: marshalled asynchronously */
   25927 struct marshal_cmd_VertexAttrib4dv
   25928 {
   25929    struct marshal_cmd_base cmd_base;
   25930    GLuint index;
   25931    GLdouble v[4];
   25932 };
   25933 static inline void
   25934 _mesa_unmarshal_VertexAttrib4dv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4dv *cmd)
   25935 {
   25936    const GLuint index = cmd->index;
   25937    const GLdouble * v = cmd->v;
   25938    CALL_VertexAttrib4dv(ctx->CurrentServerDispatch, (index, v));
   25939 }
   25940 static void GLAPIENTRY
   25941 _mesa_marshal_VertexAttrib4dv(GLuint index, const GLdouble * v)
   25942 {
   25943    GET_CURRENT_CONTEXT(ctx);
   25944    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4dv);
   25945    struct marshal_cmd_VertexAttrib4dv *cmd;
   25946    debug_print_marshal("VertexAttrib4dv");
   25947    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25948       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4dv, cmd_size);
   25949       cmd->index = index;
   25950       memcpy(cmd->v, v, 32);
   25951       _mesa_post_marshal_hook(ctx);
   25952       return;
   25953    }
   25954 
   25955    _mesa_glthread_finish(ctx);
   25956    debug_print_sync_fallback("VertexAttrib4dv");
   25957    CALL_VertexAttrib4dv(ctx->CurrentServerDispatch, (index, v));
   25958 }
   25959 
   25960 
   25961 /* CreateTextures: marshalled synchronously */
   25962 static void GLAPIENTRY
   25963 _mesa_marshal_CreateTextures(GLenum target, GLsizei n, GLuint * textures)
   25964 {
   25965    GET_CURRENT_CONTEXT(ctx);
   25966    _mesa_glthread_finish(ctx);
   25967    debug_print_sync("CreateTextures");
   25968    CALL_CreateTextures(ctx->CurrentServerDispatch, (target, n, textures));
   25969 }
   25970 
   25971 
   25972 /* EvalCoord2dv: marshalled asynchronously */
   25973 struct marshal_cmd_EvalCoord2dv
   25974 {
   25975    struct marshal_cmd_base cmd_base;
   25976    GLdouble u[2];
   25977 };
   25978 static inline void
   25979 _mesa_unmarshal_EvalCoord2dv(struct gl_context *ctx, const struct marshal_cmd_EvalCoord2dv *cmd)
   25980 {
   25981    const GLdouble * u = cmd->u;
   25982    CALL_EvalCoord2dv(ctx->CurrentServerDispatch, (u));
   25983 }
   25984 static void GLAPIENTRY
   25985 _mesa_marshal_EvalCoord2dv(const GLdouble * u)
   25986 {
   25987    GET_CURRENT_CONTEXT(ctx);
   25988    size_t cmd_size = sizeof(struct marshal_cmd_EvalCoord2dv);
   25989    struct marshal_cmd_EvalCoord2dv *cmd;
   25990    debug_print_marshal("EvalCoord2dv");
   25991    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   25992       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EvalCoord2dv, cmd_size);
   25993       memcpy(cmd->u, u, 16);
   25994       _mesa_post_marshal_hook(ctx);
   25995       return;
   25996    }
   25997 
   25998    _mesa_glthread_finish(ctx);
   25999    debug_print_sync_fallback("EvalCoord2dv");
   26000    CALL_EvalCoord2dv(ctx->CurrentServerDispatch, (u));
   26001 }
   26002 
   26003 
   26004 /* VertexAttrib1fNV: marshalled asynchronously */
   26005 struct marshal_cmd_VertexAttrib1fNV
   26006 {
   26007    struct marshal_cmd_base cmd_base;
   26008    GLuint index;
   26009    GLfloat x;
   26010 };
   26011 static inline void
   26012 _mesa_unmarshal_VertexAttrib1fNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1fNV *cmd)
   26013 {
   26014    const GLuint index = cmd->index;
   26015    const GLfloat x = cmd->x;
   26016    CALL_VertexAttrib1fNV(ctx->CurrentServerDispatch, (index, x));
   26017 }
   26018 static void GLAPIENTRY
   26019 _mesa_marshal_VertexAttrib1fNV(GLuint index, GLfloat x)
   26020 {
   26021    GET_CURRENT_CONTEXT(ctx);
   26022    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib1fNV);
   26023    struct marshal_cmd_VertexAttrib1fNV *cmd;
   26024    debug_print_marshal("VertexAttrib1fNV");
   26025    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26026       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1fNV, cmd_size);
   26027       cmd->index = index;
   26028       cmd->x = x;
   26029       _mesa_post_marshal_hook(ctx);
   26030       return;
   26031    }
   26032 
   26033    _mesa_glthread_finish(ctx);
   26034    debug_print_sync_fallback("VertexAttrib1fNV");
   26035    CALL_VertexAttrib1fNV(ctx->CurrentServerDispatch, (index, x));
   26036 }
   26037 
   26038 
   26039 /* CompressedTexSubImage1D: marshalled synchronously */
   26040 static void GLAPIENTRY
   26041 _mesa_marshal_CompressedTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data)
   26042 {
   26043    GET_CURRENT_CONTEXT(ctx);
   26044    _mesa_glthread_finish(ctx);
   26045    debug_print_sync("CompressedTexSubImage1D");
   26046    CALL_CompressedTexSubImage1D(ctx->CurrentServerDispatch, (target, level, xoffset, width, format, imageSize, data));
   26047 }
   26048 
   26049 
   26050 /* GetSeparableFilter: marshalled synchronously */
   26051 static void GLAPIENTRY
   26052 _mesa_marshal_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid * row, GLvoid * column, GLvoid * span)
   26053 {
   26054    GET_CURRENT_CONTEXT(ctx);
   26055    _mesa_glthread_finish(ctx);
   26056    debug_print_sync("GetSeparableFilter");
   26057    CALL_GetSeparableFilter(ctx->CurrentServerDispatch, (target, format, type, row, column, span));
   26058 }
   26059 
   26060 
   26061 /* FeedbackBuffer: marshalled synchronously */
   26062 static void GLAPIENTRY
   26063 _mesa_marshal_FeedbackBuffer(GLsizei size, GLenum type, GLfloat * buffer)
   26064 {
   26065    GET_CURRENT_CONTEXT(ctx);
   26066    _mesa_glthread_finish(ctx);
   26067    debug_print_sync("FeedbackBuffer");
   26068    CALL_FeedbackBuffer(ctx->CurrentServerDispatch, (size, type, buffer));
   26069 }
   26070 
   26071 
   26072 /* RasterPos2iv: marshalled asynchronously */
   26073 struct marshal_cmd_RasterPos2iv
   26074 {
   26075    struct marshal_cmd_base cmd_base;
   26076    GLint v[2];
   26077 };
   26078 static inline void
   26079 _mesa_unmarshal_RasterPos2iv(struct gl_context *ctx, const struct marshal_cmd_RasterPos2iv *cmd)
   26080 {
   26081    const GLint * v = cmd->v;
   26082    CALL_RasterPos2iv(ctx->CurrentServerDispatch, (v));
   26083 }
   26084 static void GLAPIENTRY
   26085 _mesa_marshal_RasterPos2iv(const GLint * v)
   26086 {
   26087    GET_CURRENT_CONTEXT(ctx);
   26088    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos2iv);
   26089    struct marshal_cmd_RasterPos2iv *cmd;
   26090    debug_print_marshal("RasterPos2iv");
   26091    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26092       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos2iv, cmd_size);
   26093       memcpy(cmd->v, v, 8);
   26094       _mesa_post_marshal_hook(ctx);
   26095       return;
   26096    }
   26097 
   26098    _mesa_glthread_finish(ctx);
   26099    debug_print_sync_fallback("RasterPos2iv");
   26100    CALL_RasterPos2iv(ctx->CurrentServerDispatch, (v));
   26101 }
   26102 
   26103 
   26104 /* TexImage1D: marshalled synchronously */
   26105 static void GLAPIENTRY
   26106 _mesa_marshal_TexImage1D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid * pixels)
   26107 {
   26108    GET_CURRENT_CONTEXT(ctx);
   26109    _mesa_glthread_finish(ctx);
   26110    debug_print_sync("TexImage1D");
   26111    CALL_TexImage1D(ctx->CurrentServerDispatch, (target, level, internalformat, width, border, format, type, pixels));
   26112 }
   26113 
   26114 
   26115 /* MultiDrawElementsEXT: marshalled synchronously */
   26116 static void GLAPIENTRY
   26117 _mesa_marshal_MultiDrawElementsEXT(GLenum mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount)
   26118 {
   26119    GET_CURRENT_CONTEXT(ctx);
   26120    _mesa_glthread_finish(ctx);
   26121    debug_print_sync("MultiDrawElementsEXT");
   26122    CALL_MultiDrawElementsEXT(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount));
   26123 }
   26124 
   26125 
   26126 /* GetnSeparableFilterARB: marshalled synchronously */
   26127 static void GLAPIENTRY
   26128 _mesa_marshal_GetnSeparableFilterARB(GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, GLvoid * row, GLsizei columnBufSize, GLvoid * column, GLvoid * span)
   26129 {
   26130    GET_CURRENT_CONTEXT(ctx);
   26131    _mesa_glthread_finish(ctx);
   26132    debug_print_sync("GetnSeparableFilterARB");
   26133    CALL_GetnSeparableFilterARB(ctx->CurrentServerDispatch, (target, format, type, rowBufSize, row, columnBufSize, column, span));
   26134 }
   26135 
   26136 
   26137 /* FrontFace: marshalled asynchronously */
   26138 struct marshal_cmd_FrontFace
   26139 {
   26140    struct marshal_cmd_base cmd_base;
   26141    GLenum mode;
   26142 };
   26143 static inline void
   26144 _mesa_unmarshal_FrontFace(struct gl_context *ctx, const struct marshal_cmd_FrontFace *cmd)
   26145 {
   26146    const GLenum mode = cmd->mode;
   26147    CALL_FrontFace(ctx->CurrentServerDispatch, (mode));
   26148 }
   26149 static void GLAPIENTRY
   26150 _mesa_marshal_FrontFace(GLenum mode)
   26151 {
   26152    GET_CURRENT_CONTEXT(ctx);
   26153    size_t cmd_size = sizeof(struct marshal_cmd_FrontFace);
   26154    struct marshal_cmd_FrontFace *cmd;
   26155    debug_print_marshal("FrontFace");
   26156    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26157       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FrontFace, cmd_size);
   26158       cmd->mode = mode;
   26159       _mesa_post_marshal_hook(ctx);
   26160       return;
   26161    }
   26162 
   26163    _mesa_glthread_finish(ctx);
   26164    debug_print_sync_fallback("FrontFace");
   26165    CALL_FrontFace(ctx->CurrentServerDispatch, (mode));
   26166 }
   26167 
   26168 
   26169 /* MultiModeDrawArraysIBM: marshalled synchronously */
   26170 static void GLAPIENTRY
   26171 _mesa_marshal_MultiModeDrawArraysIBM(const GLenum * mode, const GLint * first, const GLsizei * count, GLsizei primcount, GLint modestride)
   26172 {
   26173    GET_CURRENT_CONTEXT(ctx);
   26174    _mesa_glthread_finish(ctx);
   26175    debug_print_sync("MultiModeDrawArraysIBM");
   26176    CALL_MultiModeDrawArraysIBM(ctx->CurrentServerDispatch, (mode, first, count, primcount, modestride));
   26177 }
   26178 
   26179 
   26180 /* Normal3dv: marshalled asynchronously */
   26181 struct marshal_cmd_Normal3dv
   26182 {
   26183    struct marshal_cmd_base cmd_base;
   26184    GLdouble v[3];
   26185 };
   26186 static inline void
   26187 _mesa_unmarshal_Normal3dv(struct gl_context *ctx, const struct marshal_cmd_Normal3dv *cmd)
   26188 {
   26189    const GLdouble * v = cmd->v;
   26190    CALL_Normal3dv(ctx->CurrentServerDispatch, (v));
   26191 }
   26192 static void GLAPIENTRY
   26193 _mesa_marshal_Normal3dv(const GLdouble * v)
   26194 {
   26195    GET_CURRENT_CONTEXT(ctx);
   26196    size_t cmd_size = sizeof(struct marshal_cmd_Normal3dv);
   26197    struct marshal_cmd_Normal3dv *cmd;
   26198    debug_print_marshal("Normal3dv");
   26199    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26200       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Normal3dv, cmd_size);
   26201       memcpy(cmd->v, v, 24);
   26202       _mesa_post_marshal_hook(ctx);
   26203       return;
   26204    }
   26205 
   26206    _mesa_glthread_finish(ctx);
   26207    debug_print_sync_fallback("Normal3dv");
   26208    CALL_Normal3dv(ctx->CurrentServerDispatch, (v));
   26209 }
   26210 
   26211 
   26212 /* Lightf: marshalled asynchronously */
   26213 struct marshal_cmd_Lightf
   26214 {
   26215    struct marshal_cmd_base cmd_base;
   26216    GLenum light;
   26217    GLenum pname;
   26218    GLfloat param;
   26219 };
   26220 static inline void
   26221 _mesa_unmarshal_Lightf(struct gl_context *ctx, const struct marshal_cmd_Lightf *cmd)
   26222 {
   26223    const GLenum light = cmd->light;
   26224    const GLenum pname = cmd->pname;
   26225    const GLfloat param = cmd->param;
   26226    CALL_Lightf(ctx->CurrentServerDispatch, (light, pname, param));
   26227 }
   26228 static void GLAPIENTRY
   26229 _mesa_marshal_Lightf(GLenum light, GLenum pname, GLfloat param)
   26230 {
   26231    GET_CURRENT_CONTEXT(ctx);
   26232    size_t cmd_size = sizeof(struct marshal_cmd_Lightf);
   26233    struct marshal_cmd_Lightf *cmd;
   26234    debug_print_marshal("Lightf");
   26235    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26236       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Lightf, cmd_size);
   26237       cmd->light = light;
   26238       cmd->pname = pname;
   26239       cmd->param = param;
   26240       _mesa_post_marshal_hook(ctx);
   26241       return;
   26242    }
   26243 
   26244    _mesa_glthread_finish(ctx);
   26245    debug_print_sync_fallback("Lightf");
   26246    CALL_Lightf(ctx->CurrentServerDispatch, (light, pname, param));
   26247 }
   26248 
   26249 
   26250 /* MatrixMode: marshalled asynchronously */
   26251 struct marshal_cmd_MatrixMode
   26252 {
   26253    struct marshal_cmd_base cmd_base;
   26254    GLenum mode;
   26255 };
   26256 static inline void
   26257 _mesa_unmarshal_MatrixMode(struct gl_context *ctx, const struct marshal_cmd_MatrixMode *cmd)
   26258 {
   26259    const GLenum mode = cmd->mode;
   26260    CALL_MatrixMode(ctx->CurrentServerDispatch, (mode));
   26261 }
   26262 static void GLAPIENTRY
   26263 _mesa_marshal_MatrixMode(GLenum mode)
   26264 {
   26265    GET_CURRENT_CONTEXT(ctx);
   26266    size_t cmd_size = sizeof(struct marshal_cmd_MatrixMode);
   26267    struct marshal_cmd_MatrixMode *cmd;
   26268    debug_print_marshal("MatrixMode");
   26269    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26270       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MatrixMode, cmd_size);
   26271       cmd->mode = mode;
   26272       _mesa_post_marshal_hook(ctx);
   26273       return;
   26274    }
   26275 
   26276    _mesa_glthread_finish(ctx);
   26277    debug_print_sync_fallback("MatrixMode");
   26278    CALL_MatrixMode(ctx->CurrentServerDispatch, (mode));
   26279 }
   26280 
   26281 
   26282 /* GetPixelMapusv: marshalled synchronously */
   26283 static void GLAPIENTRY
   26284 _mesa_marshal_GetPixelMapusv(GLenum map, GLushort * values)
   26285 {
   26286    GET_CURRENT_CONTEXT(ctx);
   26287    _mesa_glthread_finish(ctx);
   26288    debug_print_sync("GetPixelMapusv");
   26289    CALL_GetPixelMapusv(ctx->CurrentServerDispatch, (map, values));
   26290 }
   26291 
   26292 
   26293 /* Lighti: marshalled asynchronously */
   26294 struct marshal_cmd_Lighti
   26295 {
   26296    struct marshal_cmd_base cmd_base;
   26297    GLenum light;
   26298    GLenum pname;
   26299    GLint param;
   26300 };
   26301 static inline void
   26302 _mesa_unmarshal_Lighti(struct gl_context *ctx, const struct marshal_cmd_Lighti *cmd)
   26303 {
   26304    const GLenum light = cmd->light;
   26305    const GLenum pname = cmd->pname;
   26306    const GLint param = cmd->param;
   26307    CALL_Lighti(ctx->CurrentServerDispatch, (light, pname, param));
   26308 }
   26309 static void GLAPIENTRY
   26310 _mesa_marshal_Lighti(GLenum light, GLenum pname, GLint param)
   26311 {
   26312    GET_CURRENT_CONTEXT(ctx);
   26313    size_t cmd_size = sizeof(struct marshal_cmd_Lighti);
   26314    struct marshal_cmd_Lighti *cmd;
   26315    debug_print_marshal("Lighti");
   26316    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26317       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Lighti, cmd_size);
   26318       cmd->light = light;
   26319       cmd->pname = pname;
   26320       cmd->param = param;
   26321       _mesa_post_marshal_hook(ctx);
   26322       return;
   26323    }
   26324 
   26325    _mesa_glthread_finish(ctx);
   26326    debug_print_sync_fallback("Lighti");
   26327    CALL_Lighti(ctx->CurrentServerDispatch, (light, pname, param));
   26328 }
   26329 
   26330 
   26331 /* GetFragDataIndex: marshalled synchronously */
   26332 static GLint GLAPIENTRY
   26333 _mesa_marshal_GetFragDataIndex(GLuint program, const GLchar * name)
   26334 {
   26335    GET_CURRENT_CONTEXT(ctx);
   26336    _mesa_glthread_finish(ctx);
   26337    debug_print_sync("GetFragDataIndex");
   26338    return CALL_GetFragDataIndex(ctx->CurrentServerDispatch, (program, name));
   26339 }
   26340 
   26341 
   26342 /* Lightx: marshalled asynchronously */
   26343 struct marshal_cmd_Lightx
   26344 {
   26345    struct marshal_cmd_base cmd_base;
   26346    GLenum light;
   26347    GLenum pname;
   26348    GLfixed param;
   26349 };
   26350 static inline void
   26351 _mesa_unmarshal_Lightx(struct gl_context *ctx, const struct marshal_cmd_Lightx *cmd)
   26352 {
   26353    const GLenum light = cmd->light;
   26354    const GLenum pname = cmd->pname;
   26355    const GLfixed param = cmd->param;
   26356    CALL_Lightx(ctx->CurrentServerDispatch, (light, pname, param));
   26357 }
   26358 static void GLAPIENTRY
   26359 _mesa_marshal_Lightx(GLenum light, GLenum pname, GLfixed param)
   26360 {
   26361    GET_CURRENT_CONTEXT(ctx);
   26362    size_t cmd_size = sizeof(struct marshal_cmd_Lightx);
   26363    struct marshal_cmd_Lightx *cmd;
   26364    debug_print_marshal("Lightx");
   26365    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26366       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Lightx, cmd_size);
   26367       cmd->light = light;
   26368       cmd->pname = pname;
   26369       cmd->param = param;
   26370       _mesa_post_marshal_hook(ctx);
   26371       return;
   26372    }
   26373 
   26374    _mesa_glthread_finish(ctx);
   26375    debug_print_sync_fallback("Lightx");
   26376    CALL_Lightx(ctx->CurrentServerDispatch, (light, pname, param));
   26377 }
   26378 
   26379 
   26380 /* ProgramUniform3fv: marshalled asynchronously */
   26381 struct marshal_cmd_ProgramUniform3fv
   26382 {
   26383    struct marshal_cmd_base cmd_base;
   26384    GLuint program;
   26385    GLint location;
   26386    GLsizei count;
   26387    /* Next safe_mul(count, 12) bytes are GLfloat value[count][3] */
   26388 };
   26389 static inline void
   26390 _mesa_unmarshal_ProgramUniform3fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3fv *cmd)
   26391 {
   26392    const GLuint program = cmd->program;
   26393    const GLint location = cmd->location;
   26394    const GLsizei count = cmd->count;
   26395    const GLfloat * value;
   26396    const char *variable_data = (const char *) (cmd + 1);
   26397    value = (const GLfloat *) variable_data;
   26398    variable_data += count * 12;
   26399    CALL_ProgramUniform3fv(ctx->CurrentServerDispatch, (program, location, count, value));
   26400 }
   26401 static void GLAPIENTRY
   26402 _mesa_marshal_ProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
   26403 {
   26404    GET_CURRENT_CONTEXT(ctx);
   26405    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform3fv) + safe_mul(count, 12);
   26406    struct marshal_cmd_ProgramUniform3fv *cmd;
   26407    debug_print_marshal("ProgramUniform3fv");
   26408    if (unlikely(safe_mul(count, 12) < 0)) {
   26409       goto fallback_to_sync;
   26410    }
   26411    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26412       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3fv, cmd_size);
   26413       cmd->program = program;
   26414       cmd->location = location;
   26415       cmd->count = count;
   26416       char *variable_data = (char *) (cmd + 1);
   26417       memcpy(variable_data, value, count * 12);
   26418       variable_data += count * 12;
   26419       _mesa_post_marshal_hook(ctx);
   26420       return;
   26421    }
   26422 
   26423 fallback_to_sync:
   26424    _mesa_glthread_finish(ctx);
   26425    debug_print_sync_fallback("ProgramUniform3fv");
   26426    CALL_ProgramUniform3fv(ctx->CurrentServerDispatch, (program, location, count, value));
   26427 }
   26428 
   26429 
   26430 /* MultMatrixd: marshalled asynchronously */
   26431 struct marshal_cmd_MultMatrixd
   26432 {
   26433    struct marshal_cmd_base cmd_base;
   26434    GLdouble m[16];
   26435 };
   26436 static inline void
   26437 _mesa_unmarshal_MultMatrixd(struct gl_context *ctx, const struct marshal_cmd_MultMatrixd *cmd)
   26438 {
   26439    const GLdouble * m = cmd->m;
   26440    CALL_MultMatrixd(ctx->CurrentServerDispatch, (m));
   26441 }
   26442 static void GLAPIENTRY
   26443 _mesa_marshal_MultMatrixd(const GLdouble * m)
   26444 {
   26445    GET_CURRENT_CONTEXT(ctx);
   26446    size_t cmd_size = sizeof(struct marshal_cmd_MultMatrixd);
   26447    struct marshal_cmd_MultMatrixd *cmd;
   26448    debug_print_marshal("MultMatrixd");
   26449    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26450       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultMatrixd, cmd_size);
   26451       memcpy(cmd->m, m, 128);
   26452       _mesa_post_marshal_hook(ctx);
   26453       return;
   26454    }
   26455 
   26456    _mesa_glthread_finish(ctx);
   26457    debug_print_sync_fallback("MultMatrixd");
   26458    CALL_MultMatrixd(ctx->CurrentServerDispatch, (m));
   26459 }
   26460 
   26461 
   26462 /* MultMatrixf: marshalled asynchronously */
   26463 struct marshal_cmd_MultMatrixf
   26464 {
   26465    struct marshal_cmd_base cmd_base;
   26466    GLfloat m[16];
   26467 };
   26468 static inline void
   26469 _mesa_unmarshal_MultMatrixf(struct gl_context *ctx, const struct marshal_cmd_MultMatrixf *cmd)
   26470 {
   26471    const GLfloat * m = cmd->m;
   26472    CALL_MultMatrixf(ctx->CurrentServerDispatch, (m));
   26473 }
   26474 static void GLAPIENTRY
   26475 _mesa_marshal_MultMatrixf(const GLfloat * m)
   26476 {
   26477    GET_CURRENT_CONTEXT(ctx);
   26478    size_t cmd_size = sizeof(struct marshal_cmd_MultMatrixf);
   26479    struct marshal_cmd_MultMatrixf *cmd;
   26480    debug_print_marshal("MultMatrixf");
   26481    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26482       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultMatrixf, cmd_size);
   26483       memcpy(cmd->m, m, 64);
   26484       _mesa_post_marshal_hook(ctx);
   26485       return;
   26486    }
   26487 
   26488    _mesa_glthread_finish(ctx);
   26489    debug_print_sync_fallback("MultMatrixf");
   26490    CALL_MultMatrixf(ctx->CurrentServerDispatch, (m));
   26491 }
   26492 
   26493 
   26494 /* Uniform4ui64vARB: marshalled asynchronously */
   26495 struct marshal_cmd_Uniform4ui64vARB
   26496 {
   26497    struct marshal_cmd_base cmd_base;
   26498    GLint location;
   26499    GLsizei count;
   26500    /* Next safe_mul(count, 32) bytes are GLuint64 value[count][4] */
   26501 };
   26502 static inline void
   26503 _mesa_unmarshal_Uniform4ui64vARB(struct gl_context *ctx, const struct marshal_cmd_Uniform4ui64vARB *cmd)
   26504 {
   26505    const GLint location = cmd->location;
   26506    const GLsizei count = cmd->count;
   26507    const GLuint64 * value;
   26508    const char *variable_data = (const char *) (cmd + 1);
   26509    value = (const GLuint64 *) variable_data;
   26510    variable_data += count * 32;
   26511    CALL_Uniform4ui64vARB(ctx->CurrentServerDispatch, (location, count, value));
   26512 }
   26513 static void GLAPIENTRY
   26514 _mesa_marshal_Uniform4ui64vARB(GLint location, GLsizei count, const GLuint64 * value)
   26515 {
   26516    GET_CURRENT_CONTEXT(ctx);
   26517    size_t cmd_size = sizeof(struct marshal_cmd_Uniform4ui64vARB) + safe_mul(count, 32);
   26518    struct marshal_cmd_Uniform4ui64vARB *cmd;
   26519    debug_print_marshal("Uniform4ui64vARB");
   26520    if (unlikely(safe_mul(count, 32) < 0)) {
   26521       goto fallback_to_sync;
   26522    }
   26523    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26524       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4ui64vARB, cmd_size);
   26525       cmd->location = location;
   26526       cmd->count = count;
   26527       char *variable_data = (char *) (cmd + 1);
   26528       memcpy(variable_data, value, count * 32);
   26529       variable_data += count * 32;
   26530       _mesa_post_marshal_hook(ctx);
   26531       return;
   26532    }
   26533 
   26534 fallback_to_sync:
   26535    _mesa_glthread_finish(ctx);
   26536    debug_print_sync_fallback("Uniform4ui64vARB");
   26537    CALL_Uniform4ui64vARB(ctx->CurrentServerDispatch, (location, count, value));
   26538 }
   26539 
   26540 
   26541 /* MultiTexCoord4fvARB: marshalled asynchronously */
   26542 struct marshal_cmd_MultiTexCoord4fvARB
   26543 {
   26544    struct marshal_cmd_base cmd_base;
   26545    GLenum target;
   26546    GLfloat v[4];
   26547 };
   26548 static inline void
   26549 _mesa_unmarshal_MultiTexCoord4fvARB(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4fvARB *cmd)
   26550 {
   26551    const GLenum target = cmd->target;
   26552    const GLfloat * v = cmd->v;
   26553    CALL_MultiTexCoord4fvARB(ctx->CurrentServerDispatch, (target, v));
   26554 }
   26555 static void GLAPIENTRY
   26556 _mesa_marshal_MultiTexCoord4fvARB(GLenum target, const GLfloat * v)
   26557 {
   26558    GET_CURRENT_CONTEXT(ctx);
   26559    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4fvARB);
   26560    struct marshal_cmd_MultiTexCoord4fvARB *cmd;
   26561    debug_print_marshal("MultiTexCoord4fvARB");
   26562    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26563       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4fvARB, cmd_size);
   26564       cmd->target = target;
   26565       memcpy(cmd->v, v, 16);
   26566       _mesa_post_marshal_hook(ctx);
   26567       return;
   26568    }
   26569 
   26570    _mesa_glthread_finish(ctx);
   26571    debug_print_sync_fallback("MultiTexCoord4fvARB");
   26572    CALL_MultiTexCoord4fvARB(ctx->CurrentServerDispatch, (target, v));
   26573 }
   26574 
   26575 
   26576 /* UniformMatrix2x3fv: marshalled asynchronously */
   26577 struct marshal_cmd_UniformMatrix2x3fv
   26578 {
   26579    struct marshal_cmd_base cmd_base;
   26580    GLint location;
   26581    GLsizei count;
   26582    GLboolean transpose;
   26583    /* Next safe_mul(count, 24) bytes are GLfloat value[count][6] */
   26584 };
   26585 static inline void
   26586 _mesa_unmarshal_UniformMatrix2x3fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2x3fv *cmd)
   26587 {
   26588    const GLint location = cmd->location;
   26589    const GLsizei count = cmd->count;
   26590    const GLboolean transpose = cmd->transpose;
   26591    const GLfloat * value;
   26592    const char *variable_data = (const char *) (cmd + 1);
   26593    value = (const GLfloat *) variable_data;
   26594    variable_data += count * 24;
   26595    CALL_UniformMatrix2x3fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   26596 }
   26597 static void GLAPIENTRY
   26598 _mesa_marshal_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   26599 {
   26600    GET_CURRENT_CONTEXT(ctx);
   26601    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix2x3fv) + safe_mul(count, 24);
   26602    struct marshal_cmd_UniformMatrix2x3fv *cmd;
   26603    debug_print_marshal("UniformMatrix2x3fv");
   26604    if (unlikely(safe_mul(count, 24) < 0)) {
   26605       goto fallback_to_sync;
   26606    }
   26607    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26608       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2x3fv, cmd_size);
   26609       cmd->location = location;
   26610       cmd->count = count;
   26611       cmd->transpose = transpose;
   26612       char *variable_data = (char *) (cmd + 1);
   26613       memcpy(variable_data, value, count * 24);
   26614       variable_data += count * 24;
   26615       _mesa_post_marshal_hook(ctx);
   26616       return;
   26617    }
   26618 
   26619 fallback_to_sync:
   26620    _mesa_glthread_finish(ctx);
   26621    debug_print_sync_fallback("UniformMatrix2x3fv");
   26622    CALL_UniformMatrix2x3fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   26623 }
   26624 
   26625 
   26626 /* SamplerParameterf: marshalled asynchronously */
   26627 struct marshal_cmd_SamplerParameterf
   26628 {
   26629    struct marshal_cmd_base cmd_base;
   26630    GLuint sampler;
   26631    GLenum pname;
   26632    GLfloat param;
   26633 };
   26634 static inline void
   26635 _mesa_unmarshal_SamplerParameterf(struct gl_context *ctx, const struct marshal_cmd_SamplerParameterf *cmd)
   26636 {
   26637    const GLuint sampler = cmd->sampler;
   26638    const GLenum pname = cmd->pname;
   26639    const GLfloat param = cmd->param;
   26640    CALL_SamplerParameterf(ctx->CurrentServerDispatch, (sampler, pname, param));
   26641 }
   26642 static void GLAPIENTRY
   26643 _mesa_marshal_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
   26644 {
   26645    GET_CURRENT_CONTEXT(ctx);
   26646    size_t cmd_size = sizeof(struct marshal_cmd_SamplerParameterf);
   26647    struct marshal_cmd_SamplerParameterf *cmd;
   26648    debug_print_marshal("SamplerParameterf");
   26649    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26650       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SamplerParameterf, cmd_size);
   26651       cmd->sampler = sampler;
   26652       cmd->pname = pname;
   26653       cmd->param = param;
   26654       _mesa_post_marshal_hook(ctx);
   26655       return;
   26656    }
   26657 
   26658    _mesa_glthread_finish(ctx);
   26659    debug_print_sync_fallback("SamplerParameterf");
   26660    CALL_SamplerParameterf(ctx->CurrentServerDispatch, (sampler, pname, param));
   26661 }
   26662 
   26663 
   26664 /* UniformMatrix3dv: marshalled asynchronously */
   26665 struct marshal_cmd_UniformMatrix3dv
   26666 {
   26667    struct marshal_cmd_base cmd_base;
   26668    GLint location;
   26669    GLsizei count;
   26670    GLboolean transpose;
   26671    /* Next safe_mul(count, 72) bytes are GLdouble value[count][9] */
   26672 };
   26673 static inline void
   26674 _mesa_unmarshal_UniformMatrix3dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3dv *cmd)
   26675 {
   26676    const GLint location = cmd->location;
   26677    const GLsizei count = cmd->count;
   26678    const GLboolean transpose = cmd->transpose;
   26679    const GLdouble * value;
   26680    const char *variable_data = (const char *) (cmd + 1);
   26681    value = (const GLdouble *) variable_data;
   26682    variable_data += count * 72;
   26683    CALL_UniformMatrix3dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   26684 }
   26685 static void GLAPIENTRY
   26686 _mesa_marshal_UniformMatrix3dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   26687 {
   26688    GET_CURRENT_CONTEXT(ctx);
   26689    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix3dv) + safe_mul(count, 72);
   26690    struct marshal_cmd_UniformMatrix3dv *cmd;
   26691    debug_print_marshal("UniformMatrix3dv");
   26692    if (unlikely(safe_mul(count, 72) < 0)) {
   26693       goto fallback_to_sync;
   26694    }
   26695    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26696       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3dv, cmd_size);
   26697       cmd->location = location;
   26698       cmd->count = count;
   26699       cmd->transpose = transpose;
   26700       char *variable_data = (char *) (cmd + 1);
   26701       memcpy(variable_data, value, count * 72);
   26702       variable_data += count * 72;
   26703       _mesa_post_marshal_hook(ctx);
   26704       return;
   26705    }
   26706 
   26707 fallback_to_sync:
   26708    _mesa_glthread_finish(ctx);
   26709    debug_print_sync_fallback("UniformMatrix3dv");
   26710    CALL_UniformMatrix3dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   26711 }
   26712 
   26713 
   26714 /* PointParameterx: marshalled asynchronously */
   26715 struct marshal_cmd_PointParameterx
   26716 {
   26717    struct marshal_cmd_base cmd_base;
   26718    GLenum pname;
   26719    GLfixed param;
   26720 };
   26721 static inline void
   26722 _mesa_unmarshal_PointParameterx(struct gl_context *ctx, const struct marshal_cmd_PointParameterx *cmd)
   26723 {
   26724    const GLenum pname = cmd->pname;
   26725    const GLfixed param = cmd->param;
   26726    CALL_PointParameterx(ctx->CurrentServerDispatch, (pname, param));
   26727 }
   26728 static void GLAPIENTRY
   26729 _mesa_marshal_PointParameterx(GLenum pname, GLfixed param)
   26730 {
   26731    GET_CURRENT_CONTEXT(ctx);
   26732    size_t cmd_size = sizeof(struct marshal_cmd_PointParameterx);
   26733    struct marshal_cmd_PointParameterx *cmd;
   26734    debug_print_marshal("PointParameterx");
   26735    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26736       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PointParameterx, cmd_size);
   26737       cmd->pname = pname;
   26738       cmd->param = param;
   26739       _mesa_post_marshal_hook(ctx);
   26740       return;
   26741    }
   26742 
   26743    _mesa_glthread_finish(ctx);
   26744    debug_print_sync_fallback("PointParameterx");
   26745    CALL_PointParameterx(ctx->CurrentServerDispatch, (pname, param));
   26746 }
   26747 
   26748 
   26749 /* DrawArrays: marshalled asynchronously */
   26750 struct marshal_cmd_DrawArrays
   26751 {
   26752    struct marshal_cmd_base cmd_base;
   26753    GLenum mode;
   26754    GLint first;
   26755    GLsizei count;
   26756 };
   26757 static inline void
   26758 _mesa_unmarshal_DrawArrays(struct gl_context *ctx, const struct marshal_cmd_DrawArrays *cmd)
   26759 {
   26760    const GLenum mode = cmd->mode;
   26761    const GLint first = cmd->first;
   26762    const GLsizei count = cmd->count;
   26763    CALL_DrawArrays(ctx->CurrentServerDispatch, (mode, first, count));
   26764 }
   26765 static void GLAPIENTRY
   26766 _mesa_marshal_DrawArrays(GLenum mode, GLint first, GLsizei count)
   26767 {
   26768    GET_CURRENT_CONTEXT(ctx);
   26769    size_t cmd_size = sizeof(struct marshal_cmd_DrawArrays);
   26770    struct marshal_cmd_DrawArrays *cmd;
   26771    debug_print_marshal("DrawArrays");
   26772    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26773       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawArrays, cmd_size);
   26774       cmd->mode = mode;
   26775       cmd->first = first;
   26776       cmd->count = count;
   26777       _mesa_post_marshal_hook(ctx);
   26778       return;
   26779    }
   26780 
   26781    _mesa_glthread_finish(ctx);
   26782    debug_print_sync_fallback("DrawArrays");
   26783    CALL_DrawArrays(ctx->CurrentServerDispatch, (mode, first, count));
   26784 }
   26785 
   26786 
   26787 /* Uniform3dv: marshalled asynchronously */
   26788 struct marshal_cmd_Uniform3dv
   26789 {
   26790    struct marshal_cmd_base cmd_base;
   26791    GLint location;
   26792    GLsizei count;
   26793    /* Next safe_mul(count, 24) bytes are GLdouble value[count][3] */
   26794 };
   26795 static inline void
   26796 _mesa_unmarshal_Uniform3dv(struct gl_context *ctx, const struct marshal_cmd_Uniform3dv *cmd)
   26797 {
   26798    const GLint location = cmd->location;
   26799    const GLsizei count = cmd->count;
   26800    const GLdouble * value;
   26801    const char *variable_data = (const char *) (cmd + 1);
   26802    value = (const GLdouble *) variable_data;
   26803    variable_data += count * 24;
   26804    CALL_Uniform3dv(ctx->CurrentServerDispatch, (location, count, value));
   26805 }
   26806 static void GLAPIENTRY
   26807 _mesa_marshal_Uniform3dv(GLint location, GLsizei count, const GLdouble * value)
   26808 {
   26809    GET_CURRENT_CONTEXT(ctx);
   26810    size_t cmd_size = sizeof(struct marshal_cmd_Uniform3dv) + safe_mul(count, 24);
   26811    struct marshal_cmd_Uniform3dv *cmd;
   26812    debug_print_marshal("Uniform3dv");
   26813    if (unlikely(safe_mul(count, 24) < 0)) {
   26814       goto fallback_to_sync;
   26815    }
   26816    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26817       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3dv, cmd_size);
   26818       cmd->location = location;
   26819       cmd->count = count;
   26820       char *variable_data = (char *) (cmd + 1);
   26821       memcpy(variable_data, value, count * 24);
   26822       variable_data += count * 24;
   26823       _mesa_post_marshal_hook(ctx);
   26824       return;
   26825    }
   26826 
   26827 fallback_to_sync:
   26828    _mesa_glthread_finish(ctx);
   26829    debug_print_sync_fallback("Uniform3dv");
   26830    CALL_Uniform3dv(ctx->CurrentServerDispatch, (location, count, value));
   26831 }
   26832 
   26833 
   26834 /* PointParameteri: marshalled asynchronously */
   26835 struct marshal_cmd_PointParameteri
   26836 {
   26837    struct marshal_cmd_base cmd_base;
   26838    GLenum pname;
   26839    GLint param;
   26840 };
   26841 static inline void
   26842 _mesa_unmarshal_PointParameteri(struct gl_context *ctx, const struct marshal_cmd_PointParameteri *cmd)
   26843 {
   26844    const GLenum pname = cmd->pname;
   26845    const GLint param = cmd->param;
   26846    CALL_PointParameteri(ctx->CurrentServerDispatch, (pname, param));
   26847 }
   26848 static void GLAPIENTRY
   26849 _mesa_marshal_PointParameteri(GLenum pname, GLint param)
   26850 {
   26851    GET_CURRENT_CONTEXT(ctx);
   26852    size_t cmd_size = sizeof(struct marshal_cmd_PointParameteri);
   26853    struct marshal_cmd_PointParameteri *cmd;
   26854    debug_print_marshal("PointParameteri");
   26855    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26856       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PointParameteri, cmd_size);
   26857       cmd->pname = pname;
   26858       cmd->param = param;
   26859       _mesa_post_marshal_hook(ctx);
   26860       return;
   26861    }
   26862 
   26863    _mesa_glthread_finish(ctx);
   26864    debug_print_sync_fallback("PointParameteri");
   26865    CALL_PointParameteri(ctx->CurrentServerDispatch, (pname, param));
   26866 }
   26867 
   26868 
   26869 /* PointParameterf: marshalled asynchronously */
   26870 struct marshal_cmd_PointParameterf
   26871 {
   26872    struct marshal_cmd_base cmd_base;
   26873    GLenum pname;
   26874    GLfloat param;
   26875 };
   26876 static inline void
   26877 _mesa_unmarshal_PointParameterf(struct gl_context *ctx, const struct marshal_cmd_PointParameterf *cmd)
   26878 {
   26879    const GLenum pname = cmd->pname;
   26880    const GLfloat param = cmd->param;
   26881    CALL_PointParameterf(ctx->CurrentServerDispatch, (pname, param));
   26882 }
   26883 static void GLAPIENTRY
   26884 _mesa_marshal_PointParameterf(GLenum pname, GLfloat param)
   26885 {
   26886    GET_CURRENT_CONTEXT(ctx);
   26887    size_t cmd_size = sizeof(struct marshal_cmd_PointParameterf);
   26888    struct marshal_cmd_PointParameterf *cmd;
   26889    debug_print_marshal("PointParameterf");
   26890    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26891       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PointParameterf, cmd_size);
   26892       cmd->pname = pname;
   26893       cmd->param = param;
   26894       _mesa_post_marshal_hook(ctx);
   26895       return;
   26896    }
   26897 
   26898    _mesa_glthread_finish(ctx);
   26899    debug_print_sync_fallback("PointParameterf");
   26900    CALL_PointParameterf(ctx->CurrentServerDispatch, (pname, param));
   26901 }
   26902 
   26903 
   26904 /* VertexAttribBinding: marshalled asynchronously */
   26905 struct marshal_cmd_VertexAttribBinding
   26906 {
   26907    struct marshal_cmd_base cmd_base;
   26908    GLuint attribindex;
   26909    GLuint bindingindex;
   26910 };
   26911 static inline void
   26912 _mesa_unmarshal_VertexAttribBinding(struct gl_context *ctx, const struct marshal_cmd_VertexAttribBinding *cmd)
   26913 {
   26914    const GLuint attribindex = cmd->attribindex;
   26915    const GLuint bindingindex = cmd->bindingindex;
   26916    CALL_VertexAttribBinding(ctx->CurrentServerDispatch, (attribindex, bindingindex));
   26917 }
   26918 static void GLAPIENTRY
   26919 _mesa_marshal_VertexAttribBinding(GLuint attribindex, GLuint bindingindex)
   26920 {
   26921    GET_CURRENT_CONTEXT(ctx);
   26922    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribBinding);
   26923    struct marshal_cmd_VertexAttribBinding *cmd;
   26924    debug_print_marshal("VertexAttribBinding");
   26925    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26926       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribBinding, cmd_size);
   26927       cmd->attribindex = attribindex;
   26928       cmd->bindingindex = bindingindex;
   26929       _mesa_post_marshal_hook(ctx);
   26930       return;
   26931    }
   26932 
   26933    _mesa_glthread_finish(ctx);
   26934    debug_print_sync_fallback("VertexAttribBinding");
   26935    CALL_VertexAttribBinding(ctx->CurrentServerDispatch, (attribindex, bindingindex));
   26936 }
   26937 
   26938 
   26939 /* TextureSubImage2D: marshalled synchronously */
   26940 static void GLAPIENTRY
   26941 _mesa_marshal_TextureSubImage2D(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
   26942 {
   26943    GET_CURRENT_CONTEXT(ctx);
   26944    _mesa_glthread_finish(ctx);
   26945    debug_print_sync("TextureSubImage2D");
   26946    CALL_TextureSubImage2D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, width, height, format, type, pixels));
   26947 }
   26948 
   26949 
   26950 /* CreateShader: marshalled synchronously */
   26951 static GLuint GLAPIENTRY
   26952 _mesa_marshal_CreateShader(GLenum type)
   26953 {
   26954    GET_CURRENT_CONTEXT(ctx);
   26955    _mesa_glthread_finish(ctx);
   26956    debug_print_sync("CreateShader");
   26957    return CALL_CreateShader(ctx->CurrentServerDispatch, (type));
   26958 }
   26959 
   26960 
   26961 /* ProgramUniform1dv: marshalled asynchronously */
   26962 struct marshal_cmd_ProgramUniform1dv
   26963 {
   26964    struct marshal_cmd_base cmd_base;
   26965    GLuint program;
   26966    GLint location;
   26967    GLsizei count;
   26968    /* Next safe_mul(count, 8) bytes are GLdouble value[count] */
   26969 };
   26970 static inline void
   26971 _mesa_unmarshal_ProgramUniform1dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1dv *cmd)
   26972 {
   26973    const GLuint program = cmd->program;
   26974    const GLint location = cmd->location;
   26975    const GLsizei count = cmd->count;
   26976    const GLdouble * value;
   26977    const char *variable_data = (const char *) (cmd + 1);
   26978    value = (const GLdouble *) variable_data;
   26979    variable_data += count * 8;
   26980    CALL_ProgramUniform1dv(ctx->CurrentServerDispatch, (program, location, count, value));
   26981 }
   26982 static void GLAPIENTRY
   26983 _mesa_marshal_ProgramUniform1dv(GLuint program, GLint location, GLsizei count, const GLdouble * value)
   26984 {
   26985    GET_CURRENT_CONTEXT(ctx);
   26986    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform1dv) + safe_mul(count, 8);
   26987    struct marshal_cmd_ProgramUniform1dv *cmd;
   26988    debug_print_marshal("ProgramUniform1dv");
   26989    if (unlikely(safe_mul(count, 8) < 0)) {
   26990       goto fallback_to_sync;
   26991    }
   26992    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   26993       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1dv, cmd_size);
   26994       cmd->program = program;
   26995       cmd->location = location;
   26996       cmd->count = count;
   26997       char *variable_data = (char *) (cmd + 1);
   26998       memcpy(variable_data, value, count * 8);
   26999       variable_data += count * 8;
   27000       _mesa_post_marshal_hook(ctx);
   27001       return;
   27002    }
   27003 
   27004 fallback_to_sync:
   27005    _mesa_glthread_finish(ctx);
   27006    debug_print_sync_fallback("ProgramUniform1dv");
   27007    CALL_ProgramUniform1dv(ctx->CurrentServerDispatch, (program, location, count, value));
   27008 }
   27009 
   27010 
   27011 /* GetProgramEnvParameterfvARB: marshalled synchronously */
   27012 static void GLAPIENTRY
   27013 _mesa_marshal_GetProgramEnvParameterfvARB(GLenum target, GLuint index, GLfloat * params)
   27014 {
   27015    GET_CURRENT_CONTEXT(ctx);
   27016    _mesa_glthread_finish(ctx);
   27017    debug_print_sync("GetProgramEnvParameterfvARB");
   27018    CALL_GetProgramEnvParameterfvARB(ctx->CurrentServerDispatch, (target, index, params));
   27019 }
   27020 
   27021 
   27022 /* DeleteBuffers: marshalled asynchronously */
   27023 struct marshal_cmd_DeleteBuffers
   27024 {
   27025    struct marshal_cmd_base cmd_base;
   27026    GLsizei n;
   27027    /* Next safe_mul(n, 4) bytes are GLuint buffer[n] */
   27028 };
   27029 static inline void
   27030 _mesa_unmarshal_DeleteBuffers(struct gl_context *ctx, const struct marshal_cmd_DeleteBuffers *cmd)
   27031 {
   27032    const GLsizei n = cmd->n;
   27033    const GLuint * buffer;
   27034    const char *variable_data = (const char *) (cmd + 1);
   27035    buffer = (const GLuint *) variable_data;
   27036    variable_data += n * 4;
   27037    CALL_DeleteBuffers(ctx->CurrentServerDispatch, (n, buffer));
   27038 }
   27039 static void GLAPIENTRY
   27040 _mesa_marshal_DeleteBuffers(GLsizei n, const GLuint * buffer)
   27041 {
   27042    GET_CURRENT_CONTEXT(ctx);
   27043    size_t cmd_size = sizeof(struct marshal_cmd_DeleteBuffers) + safe_mul(n, 4);
   27044    struct marshal_cmd_DeleteBuffers *cmd;
   27045    debug_print_marshal("DeleteBuffers");
   27046    if (unlikely(safe_mul(n, 4) < 0)) {
   27047       goto fallback_to_sync;
   27048    }
   27049    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27050       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteBuffers, cmd_size);
   27051       cmd->n = n;
   27052       char *variable_data = (char *) (cmd + 1);
   27053       memcpy(variable_data, buffer, n * 4);
   27054       variable_data += n * 4;
   27055       _mesa_post_marshal_hook(ctx);
   27056       return;
   27057    }
   27058 
   27059 fallback_to_sync:
   27060    _mesa_glthread_finish(ctx);
   27061    debug_print_sync_fallback("DeleteBuffers");
   27062    CALL_DeleteBuffers(ctx->CurrentServerDispatch, (n, buffer));
   27063 }
   27064 
   27065 
   27066 /* GetBufferSubData: marshalled synchronously */
   27067 static void GLAPIENTRY
   27068 _mesa_marshal_GetBufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, GLvoid * data)
   27069 {
   27070    GET_CURRENT_CONTEXT(ctx);
   27071    _mesa_glthread_finish(ctx);
   27072    debug_print_sync("GetBufferSubData");
   27073    CALL_GetBufferSubData(ctx->CurrentServerDispatch, (target, offset, size, data));
   27074 }
   27075 
   27076 
   27077 /* GetNamedRenderbufferParameteriv: marshalled synchronously */
   27078 static void GLAPIENTRY
   27079 _mesa_marshal_GetNamedRenderbufferParameteriv(GLuint renderbuffer, GLenum pname, GLint * params)
   27080 {
   27081    GET_CURRENT_CONTEXT(ctx);
   27082    _mesa_glthread_finish(ctx);
   27083    debug_print_sync("GetNamedRenderbufferParameteriv");
   27084    CALL_GetNamedRenderbufferParameteriv(ctx->CurrentServerDispatch, (renderbuffer, pname, params));
   27085 }
   27086 
   27087 
   27088 /* GetPerfMonitorGroupsAMD: marshalled synchronously */
   27089 static void GLAPIENTRY
   27090 _mesa_marshal_GetPerfMonitorGroupsAMD(GLint * numGroups, GLsizei groupsSize, GLuint * groups)
   27091 {
   27092    GET_CURRENT_CONTEXT(ctx);
   27093    _mesa_glthread_finish(ctx);
   27094    debug_print_sync("GetPerfMonitorGroupsAMD");
   27095    CALL_GetPerfMonitorGroupsAMD(ctx->CurrentServerDispatch, (numGroups, groupsSize, groups));
   27096 }
   27097 
   27098 
   27099 /* VertexAttribP2ui: marshalled asynchronously */
   27100 struct marshal_cmd_VertexAttribP2ui
   27101 {
   27102    struct marshal_cmd_base cmd_base;
   27103    GLuint index;
   27104    GLenum type;
   27105    GLboolean normalized;
   27106    GLuint value;
   27107 };
   27108 static inline void
   27109 _mesa_unmarshal_VertexAttribP2ui(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP2ui *cmd)
   27110 {
   27111    const GLuint index = cmd->index;
   27112    const GLenum type = cmd->type;
   27113    const GLboolean normalized = cmd->normalized;
   27114    const GLuint value = cmd->value;
   27115    CALL_VertexAttribP2ui(ctx->CurrentServerDispatch, (index, type, normalized, value));
   27116 }
   27117 static void GLAPIENTRY
   27118 _mesa_marshal_VertexAttribP2ui(GLuint index, GLenum type, GLboolean normalized, GLuint value)
   27119 {
   27120    GET_CURRENT_CONTEXT(ctx);
   27121    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribP2ui);
   27122    struct marshal_cmd_VertexAttribP2ui *cmd;
   27123    debug_print_marshal("VertexAttribP2ui");
   27124    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27125       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP2ui, cmd_size);
   27126       cmd->index = index;
   27127       cmd->type = type;
   27128       cmd->normalized = normalized;
   27129       cmd->value = value;
   27130       _mesa_post_marshal_hook(ctx);
   27131       return;
   27132    }
   27133 
   27134    _mesa_glthread_finish(ctx);
   27135    debug_print_sync_fallback("VertexAttribP2ui");
   27136    CALL_VertexAttribP2ui(ctx->CurrentServerDispatch, (index, type, normalized, value));
   27137 }
   27138 
   27139 
   27140 /* ProgramUniform4dv: marshalled asynchronously */
   27141 struct marshal_cmd_ProgramUniform4dv
   27142 {
   27143    struct marshal_cmd_base cmd_base;
   27144    GLuint program;
   27145    GLint location;
   27146    GLsizei count;
   27147    /* Next safe_mul(count, 32) bytes are GLdouble value[count][4] */
   27148 };
   27149 static inline void
   27150 _mesa_unmarshal_ProgramUniform4dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4dv *cmd)
   27151 {
   27152    const GLuint program = cmd->program;
   27153    const GLint location = cmd->location;
   27154    const GLsizei count = cmd->count;
   27155    const GLdouble * value;
   27156    const char *variable_data = (const char *) (cmd + 1);
   27157    value = (const GLdouble *) variable_data;
   27158    variable_data += count * 32;
   27159    CALL_ProgramUniform4dv(ctx->CurrentServerDispatch, (program, location, count, value));
   27160 }
   27161 static void GLAPIENTRY
   27162 _mesa_marshal_ProgramUniform4dv(GLuint program, GLint location, GLsizei count, const GLdouble * value)
   27163 {
   27164    GET_CURRENT_CONTEXT(ctx);
   27165    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform4dv) + safe_mul(count, 32);
   27166    struct marshal_cmd_ProgramUniform4dv *cmd;
   27167    debug_print_marshal("ProgramUniform4dv");
   27168    if (unlikely(safe_mul(count, 32) < 0)) {
   27169       goto fallback_to_sync;
   27170    }
   27171    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27172       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4dv, cmd_size);
   27173       cmd->program = program;
   27174       cmd->location = location;
   27175       cmd->count = count;
   27176       char *variable_data = (char *) (cmd + 1);
   27177       memcpy(variable_data, value, count * 32);
   27178       variable_data += count * 32;
   27179       _mesa_post_marshal_hook(ctx);
   27180       return;
   27181    }
   27182 
   27183 fallback_to_sync:
   27184    _mesa_glthread_finish(ctx);
   27185    debug_print_sync_fallback("ProgramUniform4dv");
   27186    CALL_ProgramUniform4dv(ctx->CurrentServerDispatch, (program, location, count, value));
   27187 }
   27188 
   27189 
   27190 /* GetMinmaxParameteriv: marshalled synchronously */
   27191 static void GLAPIENTRY
   27192 _mesa_marshal_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint * params)
   27193 {
   27194    GET_CURRENT_CONTEXT(ctx);
   27195    _mesa_glthread_finish(ctx);
   27196    debug_print_sync("GetMinmaxParameteriv");
   27197    CALL_GetMinmaxParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
   27198 }
   27199 
   27200 
   27201 /* DrawTexivOES: marshalled asynchronously */
   27202 struct marshal_cmd_DrawTexivOES
   27203 {
   27204    struct marshal_cmd_base cmd_base;
   27205    GLint coords[5];
   27206 };
   27207 static inline void
   27208 _mesa_unmarshal_DrawTexivOES(struct gl_context *ctx, const struct marshal_cmd_DrawTexivOES *cmd)
   27209 {
   27210    const GLint * coords = cmd->coords;
   27211    CALL_DrawTexivOES(ctx->CurrentServerDispatch, (coords));
   27212 }
   27213 static void GLAPIENTRY
   27214 _mesa_marshal_DrawTexivOES(const GLint * coords)
   27215 {
   27216    GET_CURRENT_CONTEXT(ctx);
   27217    size_t cmd_size = sizeof(struct marshal_cmd_DrawTexivOES);
   27218    struct marshal_cmd_DrawTexivOES *cmd;
   27219    debug_print_marshal("DrawTexivOES");
   27220    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27221       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTexivOES, cmd_size);
   27222       memcpy(cmd->coords, coords, 20);
   27223       _mesa_post_marshal_hook(ctx);
   27224       return;
   27225    }
   27226 
   27227    _mesa_glthread_finish(ctx);
   27228    debug_print_sync_fallback("DrawTexivOES");
   27229    CALL_DrawTexivOES(ctx->CurrentServerDispatch, (coords));
   27230 }
   27231 
   27232 
   27233 /* CopyTexImage1D: marshalled asynchronously */
   27234 struct marshal_cmd_CopyTexImage1D
   27235 {
   27236    struct marshal_cmd_base cmd_base;
   27237    GLenum target;
   27238    GLint level;
   27239    GLenum internalformat;
   27240    GLint x;
   27241    GLint y;
   27242    GLsizei width;
   27243    GLint border;
   27244 };
   27245 static inline void
   27246 _mesa_unmarshal_CopyTexImage1D(struct gl_context *ctx, const struct marshal_cmd_CopyTexImage1D *cmd)
   27247 {
   27248    const GLenum target = cmd->target;
   27249    const GLint level = cmd->level;
   27250    const GLenum internalformat = cmd->internalformat;
   27251    const GLint x = cmd->x;
   27252    const GLint y = cmd->y;
   27253    const GLsizei width = cmd->width;
   27254    const GLint border = cmd->border;
   27255    CALL_CopyTexImage1D(ctx->CurrentServerDispatch, (target, level, internalformat, x, y, width, border));
   27256 }
   27257 static void GLAPIENTRY
   27258 _mesa_marshal_CopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border)
   27259 {
   27260    GET_CURRENT_CONTEXT(ctx);
   27261    size_t cmd_size = sizeof(struct marshal_cmd_CopyTexImage1D);
   27262    struct marshal_cmd_CopyTexImage1D *cmd;
   27263    debug_print_marshal("CopyTexImage1D");
   27264    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27265       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyTexImage1D, cmd_size);
   27266       cmd->target = target;
   27267       cmd->level = level;
   27268       cmd->internalformat = internalformat;
   27269       cmd->x = x;
   27270       cmd->y = y;
   27271       cmd->width = width;
   27272       cmd->border = border;
   27273       _mesa_post_marshal_hook(ctx);
   27274       return;
   27275    }
   27276 
   27277    _mesa_glthread_finish(ctx);
   27278    debug_print_sync_fallback("CopyTexImage1D");
   27279    CALL_CopyTexImage1D(ctx->CurrentServerDispatch, (target, level, internalformat, x, y, width, border));
   27280 }
   27281 
   27282 
   27283 /* InvalidateNamedFramebufferData: marshalled synchronously */
   27284 static void GLAPIENTRY
   27285 _mesa_marshal_InvalidateNamedFramebufferData(GLuint framebuffer, GLsizei numAttachments, const GLenum * attachments)
   27286 {
   27287    GET_CURRENT_CONTEXT(ctx);
   27288    _mesa_glthread_finish(ctx);
   27289    debug_print_sync("InvalidateNamedFramebufferData");
   27290    CALL_InvalidateNamedFramebufferData(ctx->CurrentServerDispatch, (framebuffer, numAttachments, attachments));
   27291 }
   27292 
   27293 
   27294 /* SemaphoreParameterui64vEXT: marshalled synchronously */
   27295 static void GLAPIENTRY
   27296 _mesa_marshal_SemaphoreParameterui64vEXT(GLuint semaphore, GLenum pname, const GLuint64 * params)
   27297 {
   27298    GET_CURRENT_CONTEXT(ctx);
   27299    _mesa_glthread_finish(ctx);
   27300    debug_print_sync("SemaphoreParameterui64vEXT");
   27301    CALL_SemaphoreParameterui64vEXT(ctx->CurrentServerDispatch, (semaphore, pname, params));
   27302 }
   27303 
   27304 
   27305 /* GetnColorTableARB: marshalled synchronously */
   27306 static void GLAPIENTRY
   27307 _mesa_marshal_GetnColorTableARB(GLenum target, GLenum format, GLenum type, GLsizei bufSize, GLvoid * table)
   27308 {
   27309    GET_CURRENT_CONTEXT(ctx);
   27310    _mesa_glthread_finish(ctx);
   27311    debug_print_sync("GetnColorTableARB");
   27312    CALL_GetnColorTableARB(ctx->CurrentServerDispatch, (target, format, type, bufSize, table));
   27313 }
   27314 
   27315 
   27316 /* VertexAttribFormat: marshalled asynchronously */
   27317 struct marshal_cmd_VertexAttribFormat
   27318 {
   27319    struct marshal_cmd_base cmd_base;
   27320    GLuint attribindex;
   27321    GLint size;
   27322    GLenum type;
   27323    GLboolean normalized;
   27324    GLuint relativeoffset;
   27325 };
   27326 static inline void
   27327 _mesa_unmarshal_VertexAttribFormat(struct gl_context *ctx, const struct marshal_cmd_VertexAttribFormat *cmd)
   27328 {
   27329    const GLuint attribindex = cmd->attribindex;
   27330    const GLint size = cmd->size;
   27331    const GLenum type = cmd->type;
   27332    const GLboolean normalized = cmd->normalized;
   27333    const GLuint relativeoffset = cmd->relativeoffset;
   27334    CALL_VertexAttribFormat(ctx->CurrentServerDispatch, (attribindex, size, type, normalized, relativeoffset));
   27335 }
   27336 static void GLAPIENTRY
   27337 _mesa_marshal_VertexAttribFormat(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)
   27338 {
   27339    GET_CURRENT_CONTEXT(ctx);
   27340    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribFormat);
   27341    struct marshal_cmd_VertexAttribFormat *cmd;
   27342    debug_print_marshal("VertexAttribFormat");
   27343    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27344       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribFormat, cmd_size);
   27345       cmd->attribindex = attribindex;
   27346       cmd->size = size;
   27347       cmd->type = type;
   27348       cmd->normalized = normalized;
   27349       cmd->relativeoffset = relativeoffset;
   27350       _mesa_post_marshal_hook(ctx);
   27351       return;
   27352    }
   27353 
   27354    _mesa_glthread_finish(ctx);
   27355    debug_print_sync_fallback("VertexAttribFormat");
   27356    CALL_VertexAttribFormat(ctx->CurrentServerDispatch, (attribindex, size, type, normalized, relativeoffset));
   27357 }
   27358 
   27359 
   27360 /* Vertex3i: marshalled asynchronously */
   27361 struct marshal_cmd_Vertex3i
   27362 {
   27363    struct marshal_cmd_base cmd_base;
   27364    GLint x;
   27365    GLint y;
   27366    GLint z;
   27367 };
   27368 static inline void
   27369 _mesa_unmarshal_Vertex3i(struct gl_context *ctx, const struct marshal_cmd_Vertex3i *cmd)
   27370 {
   27371    const GLint x = cmd->x;
   27372    const GLint y = cmd->y;
   27373    const GLint z = cmd->z;
   27374    CALL_Vertex3i(ctx->CurrentServerDispatch, (x, y, z));
   27375 }
   27376 static void GLAPIENTRY
   27377 _mesa_marshal_Vertex3i(GLint x, GLint y, GLint z)
   27378 {
   27379    GET_CURRENT_CONTEXT(ctx);
   27380    size_t cmd_size = sizeof(struct marshal_cmd_Vertex3i);
   27381    struct marshal_cmd_Vertex3i *cmd;
   27382    debug_print_marshal("Vertex3i");
   27383    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27384       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex3i, cmd_size);
   27385       cmd->x = x;
   27386       cmd->y = y;
   27387       cmd->z = z;
   27388       _mesa_post_marshal_hook(ctx);
   27389       return;
   27390    }
   27391 
   27392    _mesa_glthread_finish(ctx);
   27393    debug_print_sync_fallback("Vertex3i");
   27394    CALL_Vertex3i(ctx->CurrentServerDispatch, (x, y, z));
   27395 }
   27396 
   27397 
   27398 /* Vertex3f: marshalled asynchronously */
   27399 struct marshal_cmd_Vertex3f
   27400 {
   27401    struct marshal_cmd_base cmd_base;
   27402    GLfloat x;
   27403    GLfloat y;
   27404    GLfloat z;
   27405 };
   27406 static inline void
   27407 _mesa_unmarshal_Vertex3f(struct gl_context *ctx, const struct marshal_cmd_Vertex3f *cmd)
   27408 {
   27409    const GLfloat x = cmd->x;
   27410    const GLfloat y = cmd->y;
   27411    const GLfloat z = cmd->z;
   27412    CALL_Vertex3f(ctx->CurrentServerDispatch, (x, y, z));
   27413 }
   27414 static void GLAPIENTRY
   27415 _mesa_marshal_Vertex3f(GLfloat x, GLfloat y, GLfloat z)
   27416 {
   27417    GET_CURRENT_CONTEXT(ctx);
   27418    size_t cmd_size = sizeof(struct marshal_cmd_Vertex3f);
   27419    struct marshal_cmd_Vertex3f *cmd;
   27420    debug_print_marshal("Vertex3f");
   27421    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27422       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex3f, cmd_size);
   27423       cmd->x = x;
   27424       cmd->y = y;
   27425       cmd->z = z;
   27426       _mesa_post_marshal_hook(ctx);
   27427       return;
   27428    }
   27429 
   27430    _mesa_glthread_finish(ctx);
   27431    debug_print_sync_fallback("Vertex3f");
   27432    CALL_Vertex3f(ctx->CurrentServerDispatch, (x, y, z));
   27433 }
   27434 
   27435 
   27436 /* Vertex3d: marshalled asynchronously */
   27437 struct marshal_cmd_Vertex3d
   27438 {
   27439    struct marshal_cmd_base cmd_base;
   27440    GLdouble x;
   27441    GLdouble y;
   27442    GLdouble z;
   27443 };
   27444 static inline void
   27445 _mesa_unmarshal_Vertex3d(struct gl_context *ctx, const struct marshal_cmd_Vertex3d *cmd)
   27446 {
   27447    const GLdouble x = cmd->x;
   27448    const GLdouble y = cmd->y;
   27449    const GLdouble z = cmd->z;
   27450    CALL_Vertex3d(ctx->CurrentServerDispatch, (x, y, z));
   27451 }
   27452 static void GLAPIENTRY
   27453 _mesa_marshal_Vertex3d(GLdouble x, GLdouble y, GLdouble z)
   27454 {
   27455    GET_CURRENT_CONTEXT(ctx);
   27456    size_t cmd_size = sizeof(struct marshal_cmd_Vertex3d);
   27457    struct marshal_cmd_Vertex3d *cmd;
   27458    debug_print_marshal("Vertex3d");
   27459    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27460       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex3d, cmd_size);
   27461       cmd->x = x;
   27462       cmd->y = y;
   27463       cmd->z = z;
   27464       _mesa_post_marshal_hook(ctx);
   27465       return;
   27466    }
   27467 
   27468    _mesa_glthread_finish(ctx);
   27469    debug_print_sync_fallback("Vertex3d");
   27470    CALL_Vertex3d(ctx->CurrentServerDispatch, (x, y, z));
   27471 }
   27472 
   27473 
   27474 /* GetProgramPipelineiv: marshalled synchronously */
   27475 static void GLAPIENTRY
   27476 _mesa_marshal_GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint * params)
   27477 {
   27478    GET_CURRENT_CONTEXT(ctx);
   27479    _mesa_glthread_finish(ctx);
   27480    debug_print_sync("GetProgramPipelineiv");
   27481    CALL_GetProgramPipelineiv(ctx->CurrentServerDispatch, (pipeline, pname, params));
   27482 }
   27483 
   27484 
   27485 /* ReadBuffer: marshalled asynchronously */
   27486 struct marshal_cmd_ReadBuffer
   27487 {
   27488    struct marshal_cmd_base cmd_base;
   27489    GLenum mode;
   27490 };
   27491 static inline void
   27492 _mesa_unmarshal_ReadBuffer(struct gl_context *ctx, const struct marshal_cmd_ReadBuffer *cmd)
   27493 {
   27494    const GLenum mode = cmd->mode;
   27495    CALL_ReadBuffer(ctx->CurrentServerDispatch, (mode));
   27496 }
   27497 static void GLAPIENTRY
   27498 _mesa_marshal_ReadBuffer(GLenum mode)
   27499 {
   27500    GET_CURRENT_CONTEXT(ctx);
   27501    size_t cmd_size = sizeof(struct marshal_cmd_ReadBuffer);
   27502    struct marshal_cmd_ReadBuffer *cmd;
   27503    debug_print_marshal("ReadBuffer");
   27504    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27505       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ReadBuffer, cmd_size);
   27506       cmd->mode = mode;
   27507       _mesa_post_marshal_hook(ctx);
   27508       return;
   27509    }
   27510 
   27511    _mesa_glthread_finish(ctx);
   27512    debug_print_sync_fallback("ReadBuffer");
   27513    CALL_ReadBuffer(ctx->CurrentServerDispatch, (mode));
   27514 }
   27515 
   27516 
   27517 /* ConvolutionParameteri: marshalled asynchronously */
   27518 struct marshal_cmd_ConvolutionParameteri
   27519 {
   27520    struct marshal_cmd_base cmd_base;
   27521    GLenum target;
   27522    GLenum pname;
   27523    GLint params;
   27524 };
   27525 static inline void
   27526 _mesa_unmarshal_ConvolutionParameteri(struct gl_context *ctx, const struct marshal_cmd_ConvolutionParameteri *cmd)
   27527 {
   27528    const GLenum target = cmd->target;
   27529    const GLenum pname = cmd->pname;
   27530    const GLint params = cmd->params;
   27531    CALL_ConvolutionParameteri(ctx->CurrentServerDispatch, (target, pname, params));
   27532 }
   27533 static void GLAPIENTRY
   27534 _mesa_marshal_ConvolutionParameteri(GLenum target, GLenum pname, GLint params)
   27535 {
   27536    GET_CURRENT_CONTEXT(ctx);
   27537    size_t cmd_size = sizeof(struct marshal_cmd_ConvolutionParameteri);
   27538    struct marshal_cmd_ConvolutionParameteri *cmd;
   27539    debug_print_marshal("ConvolutionParameteri");
   27540    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27541       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ConvolutionParameteri, cmd_size);
   27542       cmd->target = target;
   27543       cmd->pname = pname;
   27544       cmd->params = params;
   27545       _mesa_post_marshal_hook(ctx);
   27546       return;
   27547    }
   27548 
   27549    _mesa_glthread_finish(ctx);
   27550    debug_print_sync_fallback("ConvolutionParameteri");
   27551    CALL_ConvolutionParameteri(ctx->CurrentServerDispatch, (target, pname, params));
   27552 }
   27553 
   27554 
   27555 /* GetTexParameterIiv: marshalled synchronously */
   27556 static void GLAPIENTRY
   27557 _mesa_marshal_GetTexParameterIiv(GLenum target, GLenum pname, GLint * params)
   27558 {
   27559    GET_CURRENT_CONTEXT(ctx);
   27560    _mesa_glthread_finish(ctx);
   27561    debug_print_sync("GetTexParameterIiv");
   27562    CALL_GetTexParameterIiv(ctx->CurrentServerDispatch, (target, pname, params));
   27563 }
   27564 
   27565 
   27566 /* Vertex3s: marshalled asynchronously */
   27567 struct marshal_cmd_Vertex3s
   27568 {
   27569    struct marshal_cmd_base cmd_base;
   27570    GLshort x;
   27571    GLshort y;
   27572    GLshort z;
   27573 };
   27574 static inline void
   27575 _mesa_unmarshal_Vertex3s(struct gl_context *ctx, const struct marshal_cmd_Vertex3s *cmd)
   27576 {
   27577    const GLshort x = cmd->x;
   27578    const GLshort y = cmd->y;
   27579    const GLshort z = cmd->z;
   27580    CALL_Vertex3s(ctx->CurrentServerDispatch, (x, y, z));
   27581 }
   27582 static void GLAPIENTRY
   27583 _mesa_marshal_Vertex3s(GLshort x, GLshort y, GLshort z)
   27584 {
   27585    GET_CURRENT_CONTEXT(ctx);
   27586    size_t cmd_size = sizeof(struct marshal_cmd_Vertex3s);
   27587    struct marshal_cmd_Vertex3s *cmd;
   27588    debug_print_marshal("Vertex3s");
   27589    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27590       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex3s, cmd_size);
   27591       cmd->x = x;
   27592       cmd->y = y;
   27593       cmd->z = z;
   27594       _mesa_post_marshal_hook(ctx);
   27595       return;
   27596    }
   27597 
   27598    _mesa_glthread_finish(ctx);
   27599    debug_print_sync_fallback("Vertex3s");
   27600    CALL_Vertex3s(ctx->CurrentServerDispatch, (x, y, z));
   27601 }
   27602 
   27603 
   27604 /* ConvolutionParameterf: marshalled asynchronously */
   27605 struct marshal_cmd_ConvolutionParameterf
   27606 {
   27607    struct marshal_cmd_base cmd_base;
   27608    GLenum target;
   27609    GLenum pname;
   27610    GLfloat params;
   27611 };
   27612 static inline void
   27613 _mesa_unmarshal_ConvolutionParameterf(struct gl_context *ctx, const struct marshal_cmd_ConvolutionParameterf *cmd)
   27614 {
   27615    const GLenum target = cmd->target;
   27616    const GLenum pname = cmd->pname;
   27617    const GLfloat params = cmd->params;
   27618    CALL_ConvolutionParameterf(ctx->CurrentServerDispatch, (target, pname, params));
   27619 }
   27620 static void GLAPIENTRY
   27621 _mesa_marshal_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat params)
   27622 {
   27623    GET_CURRENT_CONTEXT(ctx);
   27624    size_t cmd_size = sizeof(struct marshal_cmd_ConvolutionParameterf);
   27625    struct marshal_cmd_ConvolutionParameterf *cmd;
   27626    debug_print_marshal("ConvolutionParameterf");
   27627    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27628       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ConvolutionParameterf, cmd_size);
   27629       cmd->target = target;
   27630       cmd->pname = pname;
   27631       cmd->params = params;
   27632       _mesa_post_marshal_hook(ctx);
   27633       return;
   27634    }
   27635 
   27636    _mesa_glthread_finish(ctx);
   27637    debug_print_sync_fallback("ConvolutionParameterf");
   27638    CALL_ConvolutionParameterf(ctx->CurrentServerDispatch, (target, pname, params));
   27639 }
   27640 
   27641 
   27642 /* GetColorTableParameteriv: marshalled synchronously */
   27643 static void GLAPIENTRY
   27644 _mesa_marshal_GetColorTableParameteriv(GLenum target, GLenum pname, GLint * params)
   27645 {
   27646    GET_CURRENT_CONTEXT(ctx);
   27647    _mesa_glthread_finish(ctx);
   27648    debug_print_sync("GetColorTableParameteriv");
   27649    CALL_GetColorTableParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
   27650 }
   27651 
   27652 
   27653 /* GetTransformFeedbackVarying: marshalled synchronously */
   27654 static void GLAPIENTRY
   27655 _mesa_marshal_GetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name)
   27656 {
   27657    GET_CURRENT_CONTEXT(ctx);
   27658    _mesa_glthread_finish(ctx);
   27659    debug_print_sync("GetTransformFeedbackVarying");
   27660    CALL_GetTransformFeedbackVarying(ctx->CurrentServerDispatch, (program, index, bufSize, length, size, type, name));
   27661 }
   27662 
   27663 
   27664 /* GetNextPerfQueryIdINTEL: marshalled synchronously */
   27665 static void GLAPIENTRY
   27666 _mesa_marshal_GetNextPerfQueryIdINTEL(GLuint queryId, GLuint * nextQueryId)
   27667 {
   27668    GET_CURRENT_CONTEXT(ctx);
   27669    _mesa_glthread_finish(ctx);
   27670    debug_print_sync("GetNextPerfQueryIdINTEL");
   27671    CALL_GetNextPerfQueryIdINTEL(ctx->CurrentServerDispatch, (queryId, nextQueryId));
   27672 }
   27673 
   27674 
   27675 /* TexCoord3fv: marshalled asynchronously */
   27676 struct marshal_cmd_TexCoord3fv
   27677 {
   27678    struct marshal_cmd_base cmd_base;
   27679    GLfloat v[3];
   27680 };
   27681 static inline void
   27682 _mesa_unmarshal_TexCoord3fv(struct gl_context *ctx, const struct marshal_cmd_TexCoord3fv *cmd)
   27683 {
   27684    const GLfloat * v = cmd->v;
   27685    CALL_TexCoord3fv(ctx->CurrentServerDispatch, (v));
   27686 }
   27687 static void GLAPIENTRY
   27688 _mesa_marshal_TexCoord3fv(const GLfloat * v)
   27689 {
   27690    GET_CURRENT_CONTEXT(ctx);
   27691    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord3fv);
   27692    struct marshal_cmd_TexCoord3fv *cmd;
   27693    debug_print_marshal("TexCoord3fv");
   27694    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27695       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord3fv, cmd_size);
   27696       memcpy(cmd->v, v, 12);
   27697       _mesa_post_marshal_hook(ctx);
   27698       return;
   27699    }
   27700 
   27701    _mesa_glthread_finish(ctx);
   27702    debug_print_sync_fallback("TexCoord3fv");
   27703    CALL_TexCoord3fv(ctx->CurrentServerDispatch, (v));
   27704 }
   27705 
   27706 
   27707 /* TextureBarrierNV: marshalled asynchronously */
   27708 struct marshal_cmd_TextureBarrierNV
   27709 {
   27710    struct marshal_cmd_base cmd_base;
   27711 };
   27712 static inline void
   27713 _mesa_unmarshal_TextureBarrierNV(struct gl_context *ctx, const struct marshal_cmd_TextureBarrierNV *cmd)
   27714 {
   27715    CALL_TextureBarrierNV(ctx->CurrentServerDispatch, ());
   27716 }
   27717 static void GLAPIENTRY
   27718 _mesa_marshal_TextureBarrierNV(void)
   27719 {
   27720    GET_CURRENT_CONTEXT(ctx);
   27721    size_t cmd_size = sizeof(struct marshal_cmd_TextureBarrierNV);
   27722    struct marshal_cmd_TextureBarrierNV *cmd;
   27723    debug_print_marshal("TextureBarrierNV");
   27724    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27725       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureBarrierNV, cmd_size);
   27726       (void) cmd;
   27727 
   27728       _mesa_post_marshal_hook(ctx);
   27729       return;
   27730    }
   27731 
   27732    _mesa_glthread_finish(ctx);
   27733    debug_print_sync_fallback("TextureBarrierNV");
   27734    CALL_TextureBarrierNV(ctx->CurrentServerDispatch, ());
   27735 }
   27736 
   27737 
   27738 /* GetProgramInterfaceiv: marshalled synchronously */
   27739 static void GLAPIENTRY
   27740 _mesa_marshal_GetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint * params)
   27741 {
   27742    GET_CURRENT_CONTEXT(ctx);
   27743    _mesa_glthread_finish(ctx);
   27744    debug_print_sync("GetProgramInterfaceiv");
   27745    CALL_GetProgramInterfaceiv(ctx->CurrentServerDispatch, (program, programInterface, pname, params));
   27746 }
   27747 
   27748 
   27749 /* VertexAttribL1ui64vARB: marshalled synchronously */
   27750 static void GLAPIENTRY
   27751 _mesa_marshal_VertexAttribL1ui64vARB(GLuint index, const GLuint64EXT * v)
   27752 {
   27753    GET_CURRENT_CONTEXT(ctx);
   27754    _mesa_glthread_finish(ctx);
   27755    debug_print_sync("VertexAttribL1ui64vARB");
   27756    CALL_VertexAttribL1ui64vARB(ctx->CurrentServerDispatch, (index, v));
   27757 }
   27758 
   27759 
   27760 /* ProgramLocalParameter4fARB: marshalled asynchronously */
   27761 struct marshal_cmd_ProgramLocalParameter4fARB
   27762 {
   27763    struct marshal_cmd_base cmd_base;
   27764    GLenum target;
   27765    GLuint index;
   27766    GLfloat x;
   27767    GLfloat y;
   27768    GLfloat z;
   27769    GLfloat w;
   27770 };
   27771 static inline void
   27772 _mesa_unmarshal_ProgramLocalParameter4fARB(struct gl_context *ctx, const struct marshal_cmd_ProgramLocalParameter4fARB *cmd)
   27773 {
   27774    const GLenum target = cmd->target;
   27775    const GLuint index = cmd->index;
   27776    const GLfloat x = cmd->x;
   27777    const GLfloat y = cmd->y;
   27778    const GLfloat z = cmd->z;
   27779    const GLfloat w = cmd->w;
   27780    CALL_ProgramLocalParameter4fARB(ctx->CurrentServerDispatch, (target, index, x, y, z, w));
   27781 }
   27782 static void GLAPIENTRY
   27783 _mesa_marshal_ProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
   27784 {
   27785    GET_CURRENT_CONTEXT(ctx);
   27786    size_t cmd_size = sizeof(struct marshal_cmd_ProgramLocalParameter4fARB);
   27787    struct marshal_cmd_ProgramLocalParameter4fARB *cmd;
   27788    debug_print_marshal("ProgramLocalParameter4fARB");
   27789    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27790       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramLocalParameter4fARB, cmd_size);
   27791       cmd->target = target;
   27792       cmd->index = index;
   27793       cmd->x = x;
   27794       cmd->y = y;
   27795       cmd->z = z;
   27796       cmd->w = w;
   27797       _mesa_post_marshal_hook(ctx);
   27798       return;
   27799    }
   27800 
   27801    _mesa_glthread_finish(ctx);
   27802    debug_print_sync_fallback("ProgramLocalParameter4fARB");
   27803    CALL_ProgramLocalParameter4fARB(ctx->CurrentServerDispatch, (target, index, x, y, z, w));
   27804 }
   27805 
   27806 
   27807 /* PauseTransformFeedback: marshalled asynchronously */
   27808 struct marshal_cmd_PauseTransformFeedback
   27809 {
   27810    struct marshal_cmd_base cmd_base;
   27811 };
   27812 static inline void
   27813 _mesa_unmarshal_PauseTransformFeedback(struct gl_context *ctx, const struct marshal_cmd_PauseTransformFeedback *cmd)
   27814 {
   27815    CALL_PauseTransformFeedback(ctx->CurrentServerDispatch, ());
   27816 }
   27817 static void GLAPIENTRY
   27818 _mesa_marshal_PauseTransformFeedback(void)
   27819 {
   27820    GET_CURRENT_CONTEXT(ctx);
   27821    size_t cmd_size = sizeof(struct marshal_cmd_PauseTransformFeedback);
   27822    struct marshal_cmd_PauseTransformFeedback *cmd;
   27823    debug_print_marshal("PauseTransformFeedback");
   27824    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27825       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PauseTransformFeedback, cmd_size);
   27826       (void) cmd;
   27827 
   27828       _mesa_post_marshal_hook(ctx);
   27829       return;
   27830    }
   27831 
   27832    _mesa_glthread_finish(ctx);
   27833    debug_print_sync_fallback("PauseTransformFeedback");
   27834    CALL_PauseTransformFeedback(ctx->CurrentServerDispatch, ());
   27835 }
   27836 
   27837 
   27838 /* DeleteShader: marshalled asynchronously */
   27839 struct marshal_cmd_DeleteShader
   27840 {
   27841    struct marshal_cmd_base cmd_base;
   27842    GLuint program;
   27843 };
   27844 static inline void
   27845 _mesa_unmarshal_DeleteShader(struct gl_context *ctx, const struct marshal_cmd_DeleteShader *cmd)
   27846 {
   27847    const GLuint program = cmd->program;
   27848    CALL_DeleteShader(ctx->CurrentServerDispatch, (program));
   27849 }
   27850 static void GLAPIENTRY
   27851 _mesa_marshal_DeleteShader(GLuint program)
   27852 {
   27853    GET_CURRENT_CONTEXT(ctx);
   27854    size_t cmd_size = sizeof(struct marshal_cmd_DeleteShader);
   27855    struct marshal_cmd_DeleteShader *cmd;
   27856    debug_print_marshal("DeleteShader");
   27857    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27858       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteShader, cmd_size);
   27859       cmd->program = program;
   27860       _mesa_post_marshal_hook(ctx);
   27861       return;
   27862    }
   27863 
   27864    _mesa_glthread_finish(ctx);
   27865    debug_print_sync_fallback("DeleteShader");
   27866    CALL_DeleteShader(ctx->CurrentServerDispatch, (program));
   27867 }
   27868 
   27869 
   27870 /* NamedFramebufferRenderbuffer: marshalled asynchronously */
   27871 struct marshal_cmd_NamedFramebufferRenderbuffer
   27872 {
   27873    struct marshal_cmd_base cmd_base;
   27874    GLuint framebuffer;
   27875    GLenum attachment;
   27876    GLenum renderbuffertarget;
   27877    GLuint renderbuffer;
   27878 };
   27879 static inline void
   27880 _mesa_unmarshal_NamedFramebufferRenderbuffer(struct gl_context *ctx, const struct marshal_cmd_NamedFramebufferRenderbuffer *cmd)
   27881 {
   27882    const GLuint framebuffer = cmd->framebuffer;
   27883    const GLenum attachment = cmd->attachment;
   27884    const GLenum renderbuffertarget = cmd->renderbuffertarget;
   27885    const GLuint renderbuffer = cmd->renderbuffer;
   27886    CALL_NamedFramebufferRenderbuffer(ctx->CurrentServerDispatch, (framebuffer, attachment, renderbuffertarget, renderbuffer));
   27887 }
   27888 static void GLAPIENTRY
   27889 _mesa_marshal_NamedFramebufferRenderbuffer(GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
   27890 {
   27891    GET_CURRENT_CONTEXT(ctx);
   27892    size_t cmd_size = sizeof(struct marshal_cmd_NamedFramebufferRenderbuffer);
   27893    struct marshal_cmd_NamedFramebufferRenderbuffer *cmd;
   27894    debug_print_marshal("NamedFramebufferRenderbuffer");
   27895    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27896       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedFramebufferRenderbuffer, cmd_size);
   27897       cmd->framebuffer = framebuffer;
   27898       cmd->attachment = attachment;
   27899       cmd->renderbuffertarget = renderbuffertarget;
   27900       cmd->renderbuffer = renderbuffer;
   27901       _mesa_post_marshal_hook(ctx);
   27902       return;
   27903    }
   27904 
   27905    _mesa_glthread_finish(ctx);
   27906    debug_print_sync_fallback("NamedFramebufferRenderbuffer");
   27907    CALL_NamedFramebufferRenderbuffer(ctx->CurrentServerDispatch, (framebuffer, attachment, renderbuffertarget, renderbuffer));
   27908 }
   27909 
   27910 
   27911 /* CompileShader: marshalled asynchronously */
   27912 struct marshal_cmd_CompileShader
   27913 {
   27914    struct marshal_cmd_base cmd_base;
   27915    GLuint shader;
   27916 };
   27917 static inline void
   27918 _mesa_unmarshal_CompileShader(struct gl_context *ctx, const struct marshal_cmd_CompileShader *cmd)
   27919 {
   27920    const GLuint shader = cmd->shader;
   27921    CALL_CompileShader(ctx->CurrentServerDispatch, (shader));
   27922 }
   27923 static void GLAPIENTRY
   27924 _mesa_marshal_CompileShader(GLuint shader)
   27925 {
   27926    GET_CURRENT_CONTEXT(ctx);
   27927    size_t cmd_size = sizeof(struct marshal_cmd_CompileShader);
   27928    struct marshal_cmd_CompileShader *cmd;
   27929    debug_print_marshal("CompileShader");
   27930    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27931       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CompileShader, cmd_size);
   27932       cmd->shader = shader;
   27933       _mesa_post_marshal_hook(ctx);
   27934       return;
   27935    }
   27936 
   27937    _mesa_glthread_finish(ctx);
   27938    debug_print_sync_fallback("CompileShader");
   27939    CALL_CompileShader(ctx->CurrentServerDispatch, (shader));
   27940 }
   27941 
   27942 
   27943 /* Vertex2iv: marshalled asynchronously */
   27944 struct marshal_cmd_Vertex2iv
   27945 {
   27946    struct marshal_cmd_base cmd_base;
   27947    GLint v[2];
   27948 };
   27949 static inline void
   27950 _mesa_unmarshal_Vertex2iv(struct gl_context *ctx, const struct marshal_cmd_Vertex2iv *cmd)
   27951 {
   27952    const GLint * v = cmd->v;
   27953    CALL_Vertex2iv(ctx->CurrentServerDispatch, (v));
   27954 }
   27955 static void GLAPIENTRY
   27956 _mesa_marshal_Vertex2iv(const GLint * v)
   27957 {
   27958    GET_CURRENT_CONTEXT(ctx);
   27959    size_t cmd_size = sizeof(struct marshal_cmd_Vertex2iv);
   27960    struct marshal_cmd_Vertex2iv *cmd;
   27961    debug_print_marshal("Vertex2iv");
   27962    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   27963       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex2iv, cmd_size);
   27964       memcpy(cmd->v, v, 8);
   27965       _mesa_post_marshal_hook(ctx);
   27966       return;
   27967    }
   27968 
   27969    _mesa_glthread_finish(ctx);
   27970    debug_print_sync_fallback("Vertex2iv");
   27971    CALL_Vertex2iv(ctx->CurrentServerDispatch, (v));
   27972 }
   27973 
   27974 
   27975 /* GetVertexArrayIndexediv: marshalled synchronously */
   27976 static void GLAPIENTRY
   27977 _mesa_marshal_GetVertexArrayIndexediv(GLuint vaobj, GLuint index, GLenum pname, GLint * param)
   27978 {
   27979    GET_CURRENT_CONTEXT(ctx);
   27980    _mesa_glthread_finish(ctx);
   27981    debug_print_sync("GetVertexArrayIndexediv");
   27982    CALL_GetVertexArrayIndexediv(ctx->CurrentServerDispatch, (vaobj, index, pname, param));
   27983 }
   27984 
   27985 
   27986 /* TexParameterIiv: marshalled synchronously */
   27987 static void GLAPIENTRY
   27988 _mesa_marshal_TexParameterIiv(GLenum target, GLenum pname, const GLint * params)
   27989 {
   27990    GET_CURRENT_CONTEXT(ctx);
   27991    _mesa_glthread_finish(ctx);
   27992    debug_print_sync("TexParameterIiv");
   27993    CALL_TexParameterIiv(ctx->CurrentServerDispatch, (target, pname, params));
   27994 }
   27995 
   27996 
   27997 /* TexGendv: marshalled synchronously */
   27998 static void GLAPIENTRY
   27999 _mesa_marshal_TexGendv(GLenum coord, GLenum pname, const GLdouble * params)
   28000 {
   28001    GET_CURRENT_CONTEXT(ctx);
   28002    _mesa_glthread_finish(ctx);
   28003    debug_print_sync("TexGendv");
   28004    CALL_TexGendv(ctx->CurrentServerDispatch, (coord, pname, params));
   28005 }
   28006 
   28007 
   28008 /* ResetMinmax: marshalled asynchronously */
   28009 struct marshal_cmd_ResetMinmax
   28010 {
   28011    struct marshal_cmd_base cmd_base;
   28012    GLenum target;
   28013 };
   28014 static inline void
   28015 _mesa_unmarshal_ResetMinmax(struct gl_context *ctx, const struct marshal_cmd_ResetMinmax *cmd)
   28016 {
   28017    const GLenum target = cmd->target;
   28018    CALL_ResetMinmax(ctx->CurrentServerDispatch, (target));
   28019 }
   28020 static void GLAPIENTRY
   28021 _mesa_marshal_ResetMinmax(GLenum target)
   28022 {
   28023    GET_CURRENT_CONTEXT(ctx);
   28024    size_t cmd_size = sizeof(struct marshal_cmd_ResetMinmax);
   28025    struct marshal_cmd_ResetMinmax *cmd;
   28026    debug_print_marshal("ResetMinmax");
   28027    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28028       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ResetMinmax, cmd_size);
   28029       cmd->target = target;
   28030       _mesa_post_marshal_hook(ctx);
   28031       return;
   28032    }
   28033 
   28034    _mesa_glthread_finish(ctx);
   28035    debug_print_sync_fallback("ResetMinmax");
   28036    CALL_ResetMinmax(ctx->CurrentServerDispatch, (target));
   28037 }
   28038 
   28039 
   28040 /* SampleCoverage: marshalled asynchronously */
   28041 struct marshal_cmd_SampleCoverage
   28042 {
   28043    struct marshal_cmd_base cmd_base;
   28044    GLclampf value;
   28045    GLboolean invert;
   28046 };
   28047 static inline void
   28048 _mesa_unmarshal_SampleCoverage(struct gl_context *ctx, const struct marshal_cmd_SampleCoverage *cmd)
   28049 {
   28050    const GLclampf value = cmd->value;
   28051    const GLboolean invert = cmd->invert;
   28052    CALL_SampleCoverage(ctx->CurrentServerDispatch, (value, invert));
   28053 }
   28054 static void GLAPIENTRY
   28055 _mesa_marshal_SampleCoverage(GLclampf value, GLboolean invert)
   28056 {
   28057    GET_CURRENT_CONTEXT(ctx);
   28058    size_t cmd_size = sizeof(struct marshal_cmd_SampleCoverage);
   28059    struct marshal_cmd_SampleCoverage *cmd;
   28060    debug_print_marshal("SampleCoverage");
   28061    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28062       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SampleCoverage, cmd_size);
   28063       cmd->value = value;
   28064       cmd->invert = invert;
   28065       _mesa_post_marshal_hook(ctx);
   28066       return;
   28067    }
   28068 
   28069    _mesa_glthread_finish(ctx);
   28070    debug_print_sync_fallback("SampleCoverage");
   28071    CALL_SampleCoverage(ctx->CurrentServerDispatch, (value, invert));
   28072 }
   28073 
   28074 
   28075 /* GenerateTextureMipmap: marshalled asynchronously */
   28076 struct marshal_cmd_GenerateTextureMipmap
   28077 {
   28078    struct marshal_cmd_base cmd_base;
   28079    GLuint texture;
   28080 };
   28081 static inline void
   28082 _mesa_unmarshal_GenerateTextureMipmap(struct gl_context *ctx, const struct marshal_cmd_GenerateTextureMipmap *cmd)
   28083 {
   28084    const GLuint texture = cmd->texture;
   28085    CALL_GenerateTextureMipmap(ctx->CurrentServerDispatch, (texture));
   28086 }
   28087 static void GLAPIENTRY
   28088 _mesa_marshal_GenerateTextureMipmap(GLuint texture)
   28089 {
   28090    GET_CURRENT_CONTEXT(ctx);
   28091    size_t cmd_size = sizeof(struct marshal_cmd_GenerateTextureMipmap);
   28092    struct marshal_cmd_GenerateTextureMipmap *cmd;
   28093    debug_print_marshal("GenerateTextureMipmap");
   28094    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28095       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GenerateTextureMipmap, cmd_size);
   28096       cmd->texture = texture;
   28097       _mesa_post_marshal_hook(ctx);
   28098       return;
   28099    }
   28100 
   28101    _mesa_glthread_finish(ctx);
   28102    debug_print_sync_fallback("GenerateTextureMipmap");
   28103    CALL_GenerateTextureMipmap(ctx->CurrentServerDispatch, (texture));
   28104 }
   28105 
   28106 
   28107 /* DeleteProgramsARB: marshalled asynchronously */
   28108 struct marshal_cmd_DeleteProgramsARB
   28109 {
   28110    struct marshal_cmd_base cmd_base;
   28111    GLsizei n;
   28112    /* Next safe_mul(n, 4) bytes are GLuint programs[n] */
   28113 };
   28114 static inline void
   28115 _mesa_unmarshal_DeleteProgramsARB(struct gl_context *ctx, const struct marshal_cmd_DeleteProgramsARB *cmd)
   28116 {
   28117    const GLsizei n = cmd->n;
   28118    const GLuint * programs;
   28119    const char *variable_data = (const char *) (cmd + 1);
   28120    programs = (const GLuint *) variable_data;
   28121    variable_data += n * 4;
   28122    CALL_DeleteProgramsARB(ctx->CurrentServerDispatch, (n, programs));
   28123 }
   28124 static void GLAPIENTRY
   28125 _mesa_marshal_DeleteProgramsARB(GLsizei n, const GLuint * programs)
   28126 {
   28127    GET_CURRENT_CONTEXT(ctx);
   28128    size_t cmd_size = sizeof(struct marshal_cmd_DeleteProgramsARB) + safe_mul(n, 4);
   28129    struct marshal_cmd_DeleteProgramsARB *cmd;
   28130    debug_print_marshal("DeleteProgramsARB");
   28131    if (unlikely(safe_mul(n, 4) < 0)) {
   28132       goto fallback_to_sync;
   28133    }
   28134    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28135       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteProgramsARB, cmd_size);
   28136       cmd->n = n;
   28137       char *variable_data = (char *) (cmd + 1);
   28138       memcpy(variable_data, programs, n * 4);
   28139       variable_data += n * 4;
   28140       _mesa_post_marshal_hook(ctx);
   28141       return;
   28142    }
   28143 
   28144 fallback_to_sync:
   28145    _mesa_glthread_finish(ctx);
   28146    debug_print_sync_fallback("DeleteProgramsARB");
   28147    CALL_DeleteProgramsARB(ctx->CurrentServerDispatch, (n, programs));
   28148 }
   28149 
   28150 
   28151 /* ShadeModel: marshalled asynchronously */
   28152 struct marshal_cmd_ShadeModel
   28153 {
   28154    struct marshal_cmd_base cmd_base;
   28155    GLenum mode;
   28156 };
   28157 static inline void
   28158 _mesa_unmarshal_ShadeModel(struct gl_context *ctx, const struct marshal_cmd_ShadeModel *cmd)
   28159 {
   28160    const GLenum mode = cmd->mode;
   28161    CALL_ShadeModel(ctx->CurrentServerDispatch, (mode));
   28162 }
   28163 static void GLAPIENTRY
   28164 _mesa_marshal_ShadeModel(GLenum mode)
   28165 {
   28166    GET_CURRENT_CONTEXT(ctx);
   28167    size_t cmd_size = sizeof(struct marshal_cmd_ShadeModel);
   28168    struct marshal_cmd_ShadeModel *cmd;
   28169    debug_print_marshal("ShadeModel");
   28170    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28171       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ShadeModel, cmd_size);
   28172       cmd->mode = mode;
   28173       _mesa_post_marshal_hook(ctx);
   28174       return;
   28175    }
   28176 
   28177    _mesa_glthread_finish(ctx);
   28178    debug_print_sync_fallback("ShadeModel");
   28179    CALL_ShadeModel(ctx->CurrentServerDispatch, (mode));
   28180 }
   28181 
   28182 
   28183 /* CreateQueries: marshalled synchronously */
   28184 static void GLAPIENTRY
   28185 _mesa_marshal_CreateQueries(GLenum target, GLsizei n, GLuint * ids)
   28186 {
   28187    GET_CURRENT_CONTEXT(ctx);
   28188    _mesa_glthread_finish(ctx);
   28189    debug_print_sync("CreateQueries");
   28190    CALL_CreateQueries(ctx->CurrentServerDispatch, (target, n, ids));
   28191 }
   28192 
   28193 
   28194 /* MultiDrawArrays: marshalled synchronously */
   28195 static void GLAPIENTRY
   28196 _mesa_marshal_MultiDrawArrays(GLenum mode, const GLint * first, const GLsizei * count, GLsizei primcount)
   28197 {
   28198    GET_CURRENT_CONTEXT(ctx);
   28199    _mesa_glthread_finish(ctx);
   28200    debug_print_sync("MultiDrawArrays");
   28201    CALL_MultiDrawArrays(ctx->CurrentServerDispatch, (mode, first, count, primcount));
   28202 }
   28203 
   28204 
   28205 /* GetProgramLocalParameterdvARB: marshalled synchronously */
   28206 static void GLAPIENTRY
   28207 _mesa_marshal_GetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble * params)
   28208 {
   28209    GET_CURRENT_CONTEXT(ctx);
   28210    _mesa_glthread_finish(ctx);
   28211    debug_print_sync("GetProgramLocalParameterdvARB");
   28212    CALL_GetProgramLocalParameterdvARB(ctx->CurrentServerDispatch, (target, index, params));
   28213 }
   28214 
   28215 
   28216 /* MapBufferRange: marshalled synchronously */
   28217 static GLvoid * GLAPIENTRY
   28218 _mesa_marshal_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
   28219 {
   28220    GET_CURRENT_CONTEXT(ctx);
   28221    _mesa_glthread_finish(ctx);
   28222    debug_print_sync("MapBufferRange");
   28223    return CALL_MapBufferRange(ctx->CurrentServerDispatch, (target, offset, length, access));
   28224 }
   28225 
   28226 
   28227 /* DispatchCompute: marshalled asynchronously */
   28228 struct marshal_cmd_DispatchCompute
   28229 {
   28230    struct marshal_cmd_base cmd_base;
   28231    GLuint num_groups_x;
   28232    GLuint num_groups_y;
   28233    GLuint num_groups_z;
   28234 };
   28235 static inline void
   28236 _mesa_unmarshal_DispatchCompute(struct gl_context *ctx, const struct marshal_cmd_DispatchCompute *cmd)
   28237 {
   28238    const GLuint num_groups_x = cmd->num_groups_x;
   28239    const GLuint num_groups_y = cmd->num_groups_y;
   28240    const GLuint num_groups_z = cmd->num_groups_z;
   28241    CALL_DispatchCompute(ctx->CurrentServerDispatch, (num_groups_x, num_groups_y, num_groups_z));
   28242 }
   28243 static void GLAPIENTRY
   28244 _mesa_marshal_DispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)
   28245 {
   28246    GET_CURRENT_CONTEXT(ctx);
   28247    size_t cmd_size = sizeof(struct marshal_cmd_DispatchCompute);
   28248    struct marshal_cmd_DispatchCompute *cmd;
   28249    debug_print_marshal("DispatchCompute");
   28250    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28251       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DispatchCompute, cmd_size);
   28252       cmd->num_groups_x = num_groups_x;
   28253       cmd->num_groups_y = num_groups_y;
   28254       cmd->num_groups_z = num_groups_z;
   28255       _mesa_post_marshal_hook(ctx);
   28256       return;
   28257    }
   28258 
   28259    _mesa_glthread_finish(ctx);
   28260    debug_print_sync_fallback("DispatchCompute");
   28261    CALL_DispatchCompute(ctx->CurrentServerDispatch, (num_groups_x, num_groups_y, num_groups_z));
   28262 }
   28263 
   28264 
   28265 /* UseProgramStages: marshalled asynchronously */
   28266 struct marshal_cmd_UseProgramStages
   28267 {
   28268    struct marshal_cmd_base cmd_base;
   28269    GLuint pipeline;
   28270    GLbitfield stages;
   28271    GLuint program;
   28272 };
   28273 static inline void
   28274 _mesa_unmarshal_UseProgramStages(struct gl_context *ctx, const struct marshal_cmd_UseProgramStages *cmd)
   28275 {
   28276    const GLuint pipeline = cmd->pipeline;
   28277    const GLbitfield stages = cmd->stages;
   28278    const GLuint program = cmd->program;
   28279    CALL_UseProgramStages(ctx->CurrentServerDispatch, (pipeline, stages, program));
   28280 }
   28281 static void GLAPIENTRY
   28282 _mesa_marshal_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
   28283 {
   28284    GET_CURRENT_CONTEXT(ctx);
   28285    size_t cmd_size = sizeof(struct marshal_cmd_UseProgramStages);
   28286    struct marshal_cmd_UseProgramStages *cmd;
   28287    debug_print_marshal("UseProgramStages");
   28288    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28289       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UseProgramStages, cmd_size);
   28290       cmd->pipeline = pipeline;
   28291       cmd->stages = stages;
   28292       cmd->program = program;
   28293       _mesa_post_marshal_hook(ctx);
   28294       return;
   28295    }
   28296 
   28297    _mesa_glthread_finish(ctx);
   28298    debug_print_sync_fallback("UseProgramStages");
   28299    CALL_UseProgramStages(ctx->CurrentServerDispatch, (pipeline, stages, program));
   28300 }
   28301 
   28302 
   28303 /* ProgramUniformMatrix4fv: marshalled asynchronously */
   28304 struct marshal_cmd_ProgramUniformMatrix4fv
   28305 {
   28306    struct marshal_cmd_base cmd_base;
   28307    GLuint program;
   28308    GLint location;
   28309    GLsizei count;
   28310    GLboolean transpose;
   28311    /* Next safe_mul(count, 64) bytes are GLfloat value[count][16] */
   28312 };
   28313 static inline void
   28314 _mesa_unmarshal_ProgramUniformMatrix4fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix4fv *cmd)
   28315 {
   28316    const GLuint program = cmd->program;
   28317    const GLint location = cmd->location;
   28318    const GLsizei count = cmd->count;
   28319    const GLboolean transpose = cmd->transpose;
   28320    const GLfloat * value;
   28321    const char *variable_data = (const char *) (cmd + 1);
   28322    value = (const GLfloat *) variable_data;
   28323    variable_data += count * 64;
   28324    CALL_ProgramUniformMatrix4fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   28325 }
   28326 static void GLAPIENTRY
   28327 _mesa_marshal_ProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   28328 {
   28329    GET_CURRENT_CONTEXT(ctx);
   28330    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix4fv) + safe_mul(count, 64);
   28331    struct marshal_cmd_ProgramUniformMatrix4fv *cmd;
   28332    debug_print_marshal("ProgramUniformMatrix4fv");
   28333    if (unlikely(safe_mul(count, 64) < 0)) {
   28334       goto fallback_to_sync;
   28335    }
   28336    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28337       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix4fv, cmd_size);
   28338       cmd->program = program;
   28339       cmd->location = location;
   28340       cmd->count = count;
   28341       cmd->transpose = transpose;
   28342       char *variable_data = (char *) (cmd + 1);
   28343       memcpy(variable_data, value, count * 64);
   28344       variable_data += count * 64;
   28345       _mesa_post_marshal_hook(ctx);
   28346       return;
   28347    }
   28348 
   28349 fallback_to_sync:
   28350    _mesa_glthread_finish(ctx);
   28351    debug_print_sync_fallback("ProgramUniformMatrix4fv");
   28352    CALL_ProgramUniformMatrix4fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   28353 }
   28354 
   28355 
   28356 /* FramebufferRenderbuffer: marshalled asynchronously */
   28357 struct marshal_cmd_FramebufferRenderbuffer
   28358 {
   28359    struct marshal_cmd_base cmd_base;
   28360    GLenum target;
   28361    GLenum attachment;
   28362    GLenum renderbuffertarget;
   28363    GLuint renderbuffer;
   28364 };
   28365 static inline void
   28366 _mesa_unmarshal_FramebufferRenderbuffer(struct gl_context *ctx, const struct marshal_cmd_FramebufferRenderbuffer *cmd)
   28367 {
   28368    const GLenum target = cmd->target;
   28369    const GLenum attachment = cmd->attachment;
   28370    const GLenum renderbuffertarget = cmd->renderbuffertarget;
   28371    const GLuint renderbuffer = cmd->renderbuffer;
   28372    CALL_FramebufferRenderbuffer(ctx->CurrentServerDispatch, (target, attachment, renderbuffertarget, renderbuffer));
   28373 }
   28374 static void GLAPIENTRY
   28375 _mesa_marshal_FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
   28376 {
   28377    GET_CURRENT_CONTEXT(ctx);
   28378    size_t cmd_size = sizeof(struct marshal_cmd_FramebufferRenderbuffer);
   28379    struct marshal_cmd_FramebufferRenderbuffer *cmd;
   28380    debug_print_marshal("FramebufferRenderbuffer");
   28381    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28382       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferRenderbuffer, cmd_size);
   28383       cmd->target = target;
   28384       cmd->attachment = attachment;
   28385       cmd->renderbuffertarget = renderbuffertarget;
   28386       cmd->renderbuffer = renderbuffer;
   28387       _mesa_post_marshal_hook(ctx);
   28388       return;
   28389    }
   28390 
   28391    _mesa_glthread_finish(ctx);
   28392    debug_print_sync_fallback("FramebufferRenderbuffer");
   28393    CALL_FramebufferRenderbuffer(ctx->CurrentServerDispatch, (target, attachment, renderbuffertarget, renderbuffer));
   28394 }
   28395 
   28396 
   28397 /* IsProgramARB: marshalled synchronously */
   28398 static GLboolean GLAPIENTRY
   28399 _mesa_marshal_IsProgramARB(GLuint program)
   28400 {
   28401    GET_CURRENT_CONTEXT(ctx);
   28402    _mesa_glthread_finish(ctx);
   28403    debug_print_sync("IsProgramARB");
   28404    return CALL_IsProgramARB(ctx->CurrentServerDispatch, (program));
   28405 }
   28406 
   28407 
   28408 /* Map2d: marshalled synchronously */
   28409 static void GLAPIENTRY
   28410 _mesa_marshal_Map2d(GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble * points)
   28411 {
   28412    GET_CURRENT_CONTEXT(ctx);
   28413    _mesa_glthread_finish(ctx);
   28414    debug_print_sync("Map2d");
   28415    CALL_Map2d(ctx->CurrentServerDispatch, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points));
   28416 }
   28417 
   28418 
   28419 /* Map2f: marshalled synchronously */
   28420 static void GLAPIENTRY
   28421 _mesa_marshal_Map2f(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat * points)
   28422 {
   28423    GET_CURRENT_CONTEXT(ctx);
   28424    _mesa_glthread_finish(ctx);
   28425    debug_print_sync("Map2f");
   28426    CALL_Map2f(ctx->CurrentServerDispatch, (target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points));
   28427 }
   28428 
   28429 
   28430 /* ProgramStringARB: marshalled asynchronously */
   28431 struct marshal_cmd_ProgramStringARB
   28432 {
   28433    struct marshal_cmd_base cmd_base;
   28434    GLenum target;
   28435    GLenum format;
   28436    GLsizei len;
   28437    /* Next len bytes are GLvoid string[len] */
   28438 };
   28439 static inline void
   28440 _mesa_unmarshal_ProgramStringARB(struct gl_context *ctx, const struct marshal_cmd_ProgramStringARB *cmd)
   28441 {
   28442    const GLenum target = cmd->target;
   28443    const GLenum format = cmd->format;
   28444    const GLsizei len = cmd->len;
   28445    const GLvoid * string;
   28446    const char *variable_data = (const char *) (cmd + 1);
   28447    string = (const GLvoid *) variable_data;
   28448    variable_data += len;
   28449    CALL_ProgramStringARB(ctx->CurrentServerDispatch, (target, format, len, string));
   28450 }
   28451 static void GLAPIENTRY
   28452 _mesa_marshal_ProgramStringARB(GLenum target, GLenum format, GLsizei len, const GLvoid * string)
   28453 {
   28454    GET_CURRENT_CONTEXT(ctx);
   28455    size_t cmd_size = sizeof(struct marshal_cmd_ProgramStringARB) + len;
   28456    struct marshal_cmd_ProgramStringARB *cmd;
   28457    debug_print_marshal("ProgramStringARB");
   28458    if (unlikely(len < 0)) {
   28459       goto fallback_to_sync;
   28460    }
   28461    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28462       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramStringARB, cmd_size);
   28463       cmd->target = target;
   28464       cmd->format = format;
   28465       cmd->len = len;
   28466       char *variable_data = (char *) (cmd + 1);
   28467       memcpy(variable_data, string, len);
   28468       variable_data += len;
   28469       _mesa_post_marshal_hook(ctx);
   28470       return;
   28471    }
   28472 
   28473 fallback_to_sync:
   28474    _mesa_glthread_finish(ctx);
   28475    debug_print_sync_fallback("ProgramStringARB");
   28476    CALL_ProgramStringARB(ctx->CurrentServerDispatch, (target, format, len, string));
   28477 }
   28478 
   28479 
   28480 /* CopyTextureSubImage2D: marshalled asynchronously */
   28481 struct marshal_cmd_CopyTextureSubImage2D
   28482 {
   28483    struct marshal_cmd_base cmd_base;
   28484    GLuint texture;
   28485    GLint level;
   28486    GLint xoffset;
   28487    GLint yoffset;
   28488    GLint x;
   28489    GLint y;
   28490    GLsizei width;
   28491    GLsizei height;
   28492 };
   28493 static inline void
   28494 _mesa_unmarshal_CopyTextureSubImage2D(struct gl_context *ctx, const struct marshal_cmd_CopyTextureSubImage2D *cmd)
   28495 {
   28496    const GLuint texture = cmd->texture;
   28497    const GLint level = cmd->level;
   28498    const GLint xoffset = cmd->xoffset;
   28499    const GLint yoffset = cmd->yoffset;
   28500    const GLint x = cmd->x;
   28501    const GLint y = cmd->y;
   28502    const GLsizei width = cmd->width;
   28503    const GLsizei height = cmd->height;
   28504    CALL_CopyTextureSubImage2D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, x, y, width, height));
   28505 }
   28506 static void GLAPIENTRY
   28507 _mesa_marshal_CopyTextureSubImage2D(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
   28508 {
   28509    GET_CURRENT_CONTEXT(ctx);
   28510    size_t cmd_size = sizeof(struct marshal_cmd_CopyTextureSubImage2D);
   28511    struct marshal_cmd_CopyTextureSubImage2D *cmd;
   28512    debug_print_marshal("CopyTextureSubImage2D");
   28513    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28514       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyTextureSubImage2D, cmd_size);
   28515       cmd->texture = texture;
   28516       cmd->level = level;
   28517       cmd->xoffset = xoffset;
   28518       cmd->yoffset = yoffset;
   28519       cmd->x = x;
   28520       cmd->y = y;
   28521       cmd->width = width;
   28522       cmd->height = height;
   28523       _mesa_post_marshal_hook(ctx);
   28524       return;
   28525    }
   28526 
   28527    _mesa_glthread_finish(ctx);
   28528    debug_print_sync_fallback("CopyTextureSubImage2D");
   28529    CALL_CopyTextureSubImage2D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, x, y, width, height));
   28530 }
   28531 
   28532 
   28533 /* MultiTexCoord4s: marshalled asynchronously */
   28534 struct marshal_cmd_MultiTexCoord4s
   28535 {
   28536    struct marshal_cmd_base cmd_base;
   28537    GLenum target;
   28538    GLshort s;
   28539    GLshort t;
   28540    GLshort r;
   28541    GLshort q;
   28542 };
   28543 static inline void
   28544 _mesa_unmarshal_MultiTexCoord4s(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4s *cmd)
   28545 {
   28546    const GLenum target = cmd->target;
   28547    const GLshort s = cmd->s;
   28548    const GLshort t = cmd->t;
   28549    const GLshort r = cmd->r;
   28550    const GLshort q = cmd->q;
   28551    CALL_MultiTexCoord4s(ctx->CurrentServerDispatch, (target, s, t, r, q));
   28552 }
   28553 static void GLAPIENTRY
   28554 _mesa_marshal_MultiTexCoord4s(GLenum target, GLshort s, GLshort t, GLshort r, GLshort q)
   28555 {
   28556    GET_CURRENT_CONTEXT(ctx);
   28557    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4s);
   28558    struct marshal_cmd_MultiTexCoord4s *cmd;
   28559    debug_print_marshal("MultiTexCoord4s");
   28560    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28561       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4s, cmd_size);
   28562       cmd->target = target;
   28563       cmd->s = s;
   28564       cmd->t = t;
   28565       cmd->r = r;
   28566       cmd->q = q;
   28567       _mesa_post_marshal_hook(ctx);
   28568       return;
   28569    }
   28570 
   28571    _mesa_glthread_finish(ctx);
   28572    debug_print_sync_fallback("MultiTexCoord4s");
   28573    CALL_MultiTexCoord4s(ctx->CurrentServerDispatch, (target, s, t, r, q));
   28574 }
   28575 
   28576 
   28577 /* ViewportIndexedf: marshalled asynchronously */
   28578 struct marshal_cmd_ViewportIndexedf
   28579 {
   28580    struct marshal_cmd_base cmd_base;
   28581    GLuint index;
   28582    GLfloat x;
   28583    GLfloat y;
   28584    GLfloat w;
   28585    GLfloat h;
   28586 };
   28587 static inline void
   28588 _mesa_unmarshal_ViewportIndexedf(struct gl_context *ctx, const struct marshal_cmd_ViewportIndexedf *cmd)
   28589 {
   28590    const GLuint index = cmd->index;
   28591    const GLfloat x = cmd->x;
   28592    const GLfloat y = cmd->y;
   28593    const GLfloat w = cmd->w;
   28594    const GLfloat h = cmd->h;
   28595    CALL_ViewportIndexedf(ctx->CurrentServerDispatch, (index, x, y, w, h));
   28596 }
   28597 static void GLAPIENTRY
   28598 _mesa_marshal_ViewportIndexedf(GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h)
   28599 {
   28600    GET_CURRENT_CONTEXT(ctx);
   28601    size_t cmd_size = sizeof(struct marshal_cmd_ViewportIndexedf);
   28602    struct marshal_cmd_ViewportIndexedf *cmd;
   28603    debug_print_marshal("ViewportIndexedf");
   28604    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28605       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ViewportIndexedf, cmd_size);
   28606       cmd->index = index;
   28607       cmd->x = x;
   28608       cmd->y = y;
   28609       cmd->w = w;
   28610       cmd->h = h;
   28611       _mesa_post_marshal_hook(ctx);
   28612       return;
   28613    }
   28614 
   28615    _mesa_glthread_finish(ctx);
   28616    debug_print_sync_fallback("ViewportIndexedf");
   28617    CALL_ViewportIndexedf(ctx->CurrentServerDispatch, (index, x, y, w, h));
   28618 }
   28619 
   28620 
   28621 /* MultiTexCoord4i: marshalled asynchronously */
   28622 struct marshal_cmd_MultiTexCoord4i
   28623 {
   28624    struct marshal_cmd_base cmd_base;
   28625    GLenum target;
   28626    GLint s;
   28627    GLint t;
   28628    GLint r;
   28629    GLint q;
   28630 };
   28631 static inline void
   28632 _mesa_unmarshal_MultiTexCoord4i(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4i *cmd)
   28633 {
   28634    const GLenum target = cmd->target;
   28635    const GLint s = cmd->s;
   28636    const GLint t = cmd->t;
   28637    const GLint r = cmd->r;
   28638    const GLint q = cmd->q;
   28639    CALL_MultiTexCoord4i(ctx->CurrentServerDispatch, (target, s, t, r, q));
   28640 }
   28641 static void GLAPIENTRY
   28642 _mesa_marshal_MultiTexCoord4i(GLenum target, GLint s, GLint t, GLint r, GLint q)
   28643 {
   28644    GET_CURRENT_CONTEXT(ctx);
   28645    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4i);
   28646    struct marshal_cmd_MultiTexCoord4i *cmd;
   28647    debug_print_marshal("MultiTexCoord4i");
   28648    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28649       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4i, cmd_size);
   28650       cmd->target = target;
   28651       cmd->s = s;
   28652       cmd->t = t;
   28653       cmd->r = r;
   28654       cmd->q = q;
   28655       _mesa_post_marshal_hook(ctx);
   28656       return;
   28657    }
   28658 
   28659    _mesa_glthread_finish(ctx);
   28660    debug_print_sync_fallback("MultiTexCoord4i");
   28661    CALL_MultiTexCoord4i(ctx->CurrentServerDispatch, (target, s, t, r, q));
   28662 }
   28663 
   28664 
   28665 /* DebugMessageControl: marshalled asynchronously */
   28666 struct marshal_cmd_DebugMessageControl
   28667 {
   28668    struct marshal_cmd_base cmd_base;
   28669    GLenum source;
   28670    GLenum type;
   28671    GLenum severity;
   28672    GLsizei count;
   28673    GLboolean enabled;
   28674    /* Next safe_mul(count, 4) bytes are GLuint ids[count] */
   28675 };
   28676 static inline void
   28677 _mesa_unmarshal_DebugMessageControl(struct gl_context *ctx, const struct marshal_cmd_DebugMessageControl *cmd)
   28678 {
   28679    const GLenum source = cmd->source;
   28680    const GLenum type = cmd->type;
   28681    const GLenum severity = cmd->severity;
   28682    const GLsizei count = cmd->count;
   28683    const GLboolean enabled = cmd->enabled;
   28684    const GLuint * ids;
   28685    const char *variable_data = (const char *) (cmd + 1);
   28686    ids = (const GLuint *) variable_data;
   28687    variable_data += count * 4;
   28688    CALL_DebugMessageControl(ctx->CurrentServerDispatch, (source, type, severity, count, ids, enabled));
   28689 }
   28690 static void GLAPIENTRY
   28691 _mesa_marshal_DebugMessageControl(GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint * ids, GLboolean enabled)
   28692 {
   28693    GET_CURRENT_CONTEXT(ctx);
   28694    size_t cmd_size = sizeof(struct marshal_cmd_DebugMessageControl) + safe_mul(count, 4);
   28695    struct marshal_cmd_DebugMessageControl *cmd;
   28696    debug_print_marshal("DebugMessageControl");
   28697    if (unlikely(safe_mul(count, 4) < 0)) {
   28698       goto fallback_to_sync;
   28699    }
   28700    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28701       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DebugMessageControl, cmd_size);
   28702       cmd->source = source;
   28703       cmd->type = type;
   28704       cmd->severity = severity;
   28705       cmd->count = count;
   28706       cmd->enabled = enabled;
   28707       char *variable_data = (char *) (cmd + 1);
   28708       memcpy(variable_data, ids, count * 4);
   28709       variable_data += count * 4;
   28710       _mesa_post_marshal_hook(ctx);
   28711       return;
   28712    }
   28713 
   28714 fallback_to_sync:
   28715    _mesa_glthread_finish(ctx);
   28716    debug_print_sync_fallback("DebugMessageControl");
   28717    CALL_DebugMessageControl(ctx->CurrentServerDispatch, (source, type, severity, count, ids, enabled));
   28718 }
   28719 
   28720 
   28721 /* MultiTexCoord4d: marshalled asynchronously */
   28722 struct marshal_cmd_MultiTexCoord4d
   28723 {
   28724    struct marshal_cmd_base cmd_base;
   28725    GLenum target;
   28726    GLdouble s;
   28727    GLdouble t;
   28728    GLdouble r;
   28729    GLdouble q;
   28730 };
   28731 static inline void
   28732 _mesa_unmarshal_MultiTexCoord4d(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4d *cmd)
   28733 {
   28734    const GLenum target = cmd->target;
   28735    const GLdouble s = cmd->s;
   28736    const GLdouble t = cmd->t;
   28737    const GLdouble r = cmd->r;
   28738    const GLdouble q = cmd->q;
   28739    CALL_MultiTexCoord4d(ctx->CurrentServerDispatch, (target, s, t, r, q));
   28740 }
   28741 static void GLAPIENTRY
   28742 _mesa_marshal_MultiTexCoord4d(GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q)
   28743 {
   28744    GET_CURRENT_CONTEXT(ctx);
   28745    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4d);
   28746    struct marshal_cmd_MultiTexCoord4d *cmd;
   28747    debug_print_marshal("MultiTexCoord4d");
   28748    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28749       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4d, cmd_size);
   28750       cmd->target = target;
   28751       cmd->s = s;
   28752       cmd->t = t;
   28753       cmd->r = r;
   28754       cmd->q = q;
   28755       _mesa_post_marshal_hook(ctx);
   28756       return;
   28757    }
   28758 
   28759    _mesa_glthread_finish(ctx);
   28760    debug_print_sync_fallback("MultiTexCoord4d");
   28761    CALL_MultiTexCoord4d(ctx->CurrentServerDispatch, (target, s, t, r, q));
   28762 }
   28763 
   28764 
   28765 /* GetHistogram: marshalled synchronously */
   28766 static void GLAPIENTRY
   28767 _mesa_marshal_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid * values)
   28768 {
   28769    GET_CURRENT_CONTEXT(ctx);
   28770    _mesa_glthread_finish(ctx);
   28771    debug_print_sync("GetHistogram");
   28772    CALL_GetHistogram(ctx->CurrentServerDispatch, (target, reset, format, type, values));
   28773 }
   28774 
   28775 
   28776 /* Translatex: marshalled asynchronously */
   28777 struct marshal_cmd_Translatex
   28778 {
   28779    struct marshal_cmd_base cmd_base;
   28780    GLfixed x;
   28781    GLfixed y;
   28782    GLfixed z;
   28783 };
   28784 static inline void
   28785 _mesa_unmarshal_Translatex(struct gl_context *ctx, const struct marshal_cmd_Translatex *cmd)
   28786 {
   28787    const GLfixed x = cmd->x;
   28788    const GLfixed y = cmd->y;
   28789    const GLfixed z = cmd->z;
   28790    CALL_Translatex(ctx->CurrentServerDispatch, (x, y, z));
   28791 }
   28792 static void GLAPIENTRY
   28793 _mesa_marshal_Translatex(GLfixed x, GLfixed y, GLfixed z)
   28794 {
   28795    GET_CURRENT_CONTEXT(ctx);
   28796    size_t cmd_size = sizeof(struct marshal_cmd_Translatex);
   28797    struct marshal_cmd_Translatex *cmd;
   28798    debug_print_marshal("Translatex");
   28799    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28800       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Translatex, cmd_size);
   28801       cmd->x = x;
   28802       cmd->y = y;
   28803       cmd->z = z;
   28804       _mesa_post_marshal_hook(ctx);
   28805       return;
   28806    }
   28807 
   28808    _mesa_glthread_finish(ctx);
   28809    debug_print_sync_fallback("Translatex");
   28810    CALL_Translatex(ctx->CurrentServerDispatch, (x, y, z));
   28811 }
   28812 
   28813 
   28814 /* MultiDrawElementsIndirectCountARB: marshalled asynchronously */
   28815 struct marshal_cmd_MultiDrawElementsIndirectCountARB
   28816 {
   28817    struct marshal_cmd_base cmd_base;
   28818    GLenum mode;
   28819    GLenum type;
   28820    GLintptr indirect;
   28821    GLintptr drawcount;
   28822    GLsizei maxdrawcount;
   28823    GLsizei stride;
   28824 };
   28825 static inline void
   28826 _mesa_unmarshal_MultiDrawElementsIndirectCountARB(struct gl_context *ctx, const struct marshal_cmd_MultiDrawElementsIndirectCountARB *cmd)
   28827 {
   28828    const GLenum mode = cmd->mode;
   28829    const GLenum type = cmd->type;
   28830    const GLintptr indirect = cmd->indirect;
   28831    const GLintptr drawcount = cmd->drawcount;
   28832    const GLsizei maxdrawcount = cmd->maxdrawcount;
   28833    const GLsizei stride = cmd->stride;
   28834    CALL_MultiDrawElementsIndirectCountARB(ctx->CurrentServerDispatch, (mode, type, indirect, drawcount, maxdrawcount, stride));
   28835 }
   28836 static void GLAPIENTRY
   28837 _mesa_marshal_MultiDrawElementsIndirectCountARB(GLenum mode, GLenum type, GLintptr indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride)
   28838 {
   28839    GET_CURRENT_CONTEXT(ctx);
   28840    size_t cmd_size = sizeof(struct marshal_cmd_MultiDrawElementsIndirectCountARB);
   28841    struct marshal_cmd_MultiDrawElementsIndirectCountARB *cmd;
   28842    debug_print_marshal("MultiDrawElementsIndirectCountARB");
   28843    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28844       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiDrawElementsIndirectCountARB, cmd_size);
   28845       cmd->mode = mode;
   28846       cmd->type = type;
   28847       cmd->indirect = indirect;
   28848       cmd->drawcount = drawcount;
   28849       cmd->maxdrawcount = maxdrawcount;
   28850       cmd->stride = stride;
   28851       _mesa_post_marshal_hook(ctx);
   28852       return;
   28853    }
   28854 
   28855    _mesa_glthread_finish(ctx);
   28856    debug_print_sync_fallback("MultiDrawElementsIndirectCountARB");
   28857    CALL_MultiDrawElementsIndirectCountARB(ctx->CurrentServerDispatch, (mode, type, indirect, drawcount, maxdrawcount, stride));
   28858 }
   28859 
   28860 
   28861 /* Indexsv: marshalled asynchronously */
   28862 struct marshal_cmd_Indexsv
   28863 {
   28864    struct marshal_cmd_base cmd_base;
   28865    GLshort c[1];
   28866 };
   28867 static inline void
   28868 _mesa_unmarshal_Indexsv(struct gl_context *ctx, const struct marshal_cmd_Indexsv *cmd)
   28869 {
   28870    const GLshort * c = cmd->c;
   28871    CALL_Indexsv(ctx->CurrentServerDispatch, (c));
   28872 }
   28873 static void GLAPIENTRY
   28874 _mesa_marshal_Indexsv(const GLshort * c)
   28875 {
   28876    GET_CURRENT_CONTEXT(ctx);
   28877    size_t cmd_size = sizeof(struct marshal_cmd_Indexsv);
   28878    struct marshal_cmd_Indexsv *cmd;
   28879    debug_print_marshal("Indexsv");
   28880    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28881       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Indexsv, cmd_size);
   28882       memcpy(cmd->c, c, 2);
   28883       _mesa_post_marshal_hook(ctx);
   28884       return;
   28885    }
   28886 
   28887    _mesa_glthread_finish(ctx);
   28888    debug_print_sync_fallback("Indexsv");
   28889    CALL_Indexsv(ctx->CurrentServerDispatch, (c));
   28890 }
   28891 
   28892 
   28893 /* VertexAttrib1fvARB: marshalled asynchronously */
   28894 struct marshal_cmd_VertexAttrib1fvARB
   28895 {
   28896    struct marshal_cmd_base cmd_base;
   28897    GLuint index;
   28898    GLfloat v[1];
   28899 };
   28900 static inline void
   28901 _mesa_unmarshal_VertexAttrib1fvARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1fvARB *cmd)
   28902 {
   28903    const GLuint index = cmd->index;
   28904    const GLfloat * v = cmd->v;
   28905    CALL_VertexAttrib1fvARB(ctx->CurrentServerDispatch, (index, v));
   28906 }
   28907 static void GLAPIENTRY
   28908 _mesa_marshal_VertexAttrib1fvARB(GLuint index, const GLfloat * v)
   28909 {
   28910    GET_CURRENT_CONTEXT(ctx);
   28911    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib1fvARB);
   28912    struct marshal_cmd_VertexAttrib1fvARB *cmd;
   28913    debug_print_marshal("VertexAttrib1fvARB");
   28914    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28915       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1fvARB, cmd_size);
   28916       cmd->index = index;
   28917       memcpy(cmd->v, v, 4);
   28918       _mesa_post_marshal_hook(ctx);
   28919       return;
   28920    }
   28921 
   28922    _mesa_glthread_finish(ctx);
   28923    debug_print_sync_fallback("VertexAttrib1fvARB");
   28924    CALL_VertexAttrib1fvARB(ctx->CurrentServerDispatch, (index, v));
   28925 }
   28926 
   28927 
   28928 /* TexCoord2dv: marshalled asynchronously */
   28929 struct marshal_cmd_TexCoord2dv
   28930 {
   28931    struct marshal_cmd_base cmd_base;
   28932    GLdouble v[2];
   28933 };
   28934 static inline void
   28935 _mesa_unmarshal_TexCoord2dv(struct gl_context *ctx, const struct marshal_cmd_TexCoord2dv *cmd)
   28936 {
   28937    const GLdouble * v = cmd->v;
   28938    CALL_TexCoord2dv(ctx->CurrentServerDispatch, (v));
   28939 }
   28940 static void GLAPIENTRY
   28941 _mesa_marshal_TexCoord2dv(const GLdouble * v)
   28942 {
   28943    GET_CURRENT_CONTEXT(ctx);
   28944    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord2dv);
   28945    struct marshal_cmd_TexCoord2dv *cmd;
   28946    debug_print_marshal("TexCoord2dv");
   28947    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28948       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord2dv, cmd_size);
   28949       memcpy(cmd->v, v, 16);
   28950       _mesa_post_marshal_hook(ctx);
   28951       return;
   28952    }
   28953 
   28954    _mesa_glthread_finish(ctx);
   28955    debug_print_sync_fallback("TexCoord2dv");
   28956    CALL_TexCoord2dv(ctx->CurrentServerDispatch, (v));
   28957 }
   28958 
   28959 
   28960 /* Translated: marshalled asynchronously */
   28961 struct marshal_cmd_Translated
   28962 {
   28963    struct marshal_cmd_base cmd_base;
   28964    GLdouble x;
   28965    GLdouble y;
   28966    GLdouble z;
   28967 };
   28968 static inline void
   28969 _mesa_unmarshal_Translated(struct gl_context *ctx, const struct marshal_cmd_Translated *cmd)
   28970 {
   28971    const GLdouble x = cmd->x;
   28972    const GLdouble y = cmd->y;
   28973    const GLdouble z = cmd->z;
   28974    CALL_Translated(ctx->CurrentServerDispatch, (x, y, z));
   28975 }
   28976 static void GLAPIENTRY
   28977 _mesa_marshal_Translated(GLdouble x, GLdouble y, GLdouble z)
   28978 {
   28979    GET_CURRENT_CONTEXT(ctx);
   28980    size_t cmd_size = sizeof(struct marshal_cmd_Translated);
   28981    struct marshal_cmd_Translated *cmd;
   28982    debug_print_marshal("Translated");
   28983    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   28984       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Translated, cmd_size);
   28985       cmd->x = x;
   28986       cmd->y = y;
   28987       cmd->z = z;
   28988       _mesa_post_marshal_hook(ctx);
   28989       return;
   28990    }
   28991 
   28992    _mesa_glthread_finish(ctx);
   28993    debug_print_sync_fallback("Translated");
   28994    CALL_Translated(ctx->CurrentServerDispatch, (x, y, z));
   28995 }
   28996 
   28997 
   28998 /* Translatef: marshalled asynchronously */
   28999 struct marshal_cmd_Translatef
   29000 {
   29001    struct marshal_cmd_base cmd_base;
   29002    GLfloat x;
   29003    GLfloat y;
   29004    GLfloat z;
   29005 };
   29006 static inline void
   29007 _mesa_unmarshal_Translatef(struct gl_context *ctx, const struct marshal_cmd_Translatef *cmd)
   29008 {
   29009    const GLfloat x = cmd->x;
   29010    const GLfloat y = cmd->y;
   29011    const GLfloat z = cmd->z;
   29012    CALL_Translatef(ctx->CurrentServerDispatch, (x, y, z));
   29013 }
   29014 static void GLAPIENTRY
   29015 _mesa_marshal_Translatef(GLfloat x, GLfloat y, GLfloat z)
   29016 {
   29017    GET_CURRENT_CONTEXT(ctx);
   29018    size_t cmd_size = sizeof(struct marshal_cmd_Translatef);
   29019    struct marshal_cmd_Translatef *cmd;
   29020    debug_print_marshal("Translatef");
   29021    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29022       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Translatef, cmd_size);
   29023       cmd->x = x;
   29024       cmd->y = y;
   29025       cmd->z = z;
   29026       _mesa_post_marshal_hook(ctx);
   29027       return;
   29028    }
   29029 
   29030    _mesa_glthread_finish(ctx);
   29031    debug_print_sync_fallback("Translatef");
   29032    CALL_Translatef(ctx->CurrentServerDispatch, (x, y, z));
   29033 }
   29034 
   29035 
   29036 /* MultTransposeMatrixd: marshalled synchronously */
   29037 static void GLAPIENTRY
   29038 _mesa_marshal_MultTransposeMatrixd(const GLdouble * m)
   29039 {
   29040    GET_CURRENT_CONTEXT(ctx);
   29041    _mesa_glthread_finish(ctx);
   29042    debug_print_sync("MultTransposeMatrixd");
   29043    CALL_MultTransposeMatrixd(ctx->CurrentServerDispatch, (m));
   29044 }
   29045 
   29046 
   29047 /* ProgramUniform4uiv: marshalled asynchronously */
   29048 struct marshal_cmd_ProgramUniform4uiv
   29049 {
   29050    struct marshal_cmd_base cmd_base;
   29051    GLuint program;
   29052    GLint location;
   29053    GLsizei count;
   29054    /* Next safe_mul(count, 16) bytes are GLuint value[count][4] */
   29055 };
   29056 static inline void
   29057 _mesa_unmarshal_ProgramUniform4uiv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4uiv *cmd)
   29058 {
   29059    const GLuint program = cmd->program;
   29060    const GLint location = cmd->location;
   29061    const GLsizei count = cmd->count;
   29062    const GLuint * value;
   29063    const char *variable_data = (const char *) (cmd + 1);
   29064    value = (const GLuint *) variable_data;
   29065    variable_data += count * 16;
   29066    CALL_ProgramUniform4uiv(ctx->CurrentServerDispatch, (program, location, count, value));
   29067 }
   29068 static void GLAPIENTRY
   29069 _mesa_marshal_ProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
   29070 {
   29071    GET_CURRENT_CONTEXT(ctx);
   29072    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform4uiv) + safe_mul(count, 16);
   29073    struct marshal_cmd_ProgramUniform4uiv *cmd;
   29074    debug_print_marshal("ProgramUniform4uiv");
   29075    if (unlikely(safe_mul(count, 16) < 0)) {
   29076       goto fallback_to_sync;
   29077    }
   29078    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29079       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4uiv, cmd_size);
   29080       cmd->program = program;
   29081       cmd->location = location;
   29082       cmd->count = count;
   29083       char *variable_data = (char *) (cmd + 1);
   29084       memcpy(variable_data, value, count * 16);
   29085       variable_data += count * 16;
   29086       _mesa_post_marshal_hook(ctx);
   29087       return;
   29088    }
   29089 
   29090 fallback_to_sync:
   29091    _mesa_glthread_finish(ctx);
   29092    debug_print_sync_fallback("ProgramUniform4uiv");
   29093    CALL_ProgramUniform4uiv(ctx->CurrentServerDispatch, (program, location, count, value));
   29094 }
   29095 
   29096 
   29097 /* GetPerfCounterInfoINTEL: marshalled synchronously */
   29098 static void GLAPIENTRY
   29099 _mesa_marshal_GetPerfCounterInfoINTEL(GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar * counterName, GLuint counterDescLength, GLchar * counterDesc, GLuint * counterOffset, GLuint * counterDataSize, GLuint * counterTypeEnum, GLuint * counterDataTypeEnum, GLuint64 * rawCounterMaxValue)
   29100 {
   29101    GET_CURRENT_CONTEXT(ctx);
   29102    _mesa_glthread_finish(ctx);
   29103    debug_print_sync("GetPerfCounterInfoINTEL");
   29104    CALL_GetPerfCounterInfoINTEL(ctx->CurrentServerDispatch, (queryId, counterId, counterNameLength, counterName, counterDescLength, counterDesc, counterOffset, counterDataSize, counterTypeEnum, counterDataTypeEnum, rawCounterMaxValue));
   29105 }
   29106 
   29107 
   29108 /* RenderMode: marshalled synchronously */
   29109 static GLint GLAPIENTRY
   29110 _mesa_marshal_RenderMode(GLenum mode)
   29111 {
   29112    GET_CURRENT_CONTEXT(ctx);
   29113    _mesa_glthread_finish(ctx);
   29114    debug_print_sync("RenderMode");
   29115    return CALL_RenderMode(ctx->CurrentServerDispatch, (mode));
   29116 }
   29117 
   29118 
   29119 /* MultiTexCoord1fARB: marshalled asynchronously */
   29120 struct marshal_cmd_MultiTexCoord1fARB
   29121 {
   29122    struct marshal_cmd_base cmd_base;
   29123    GLenum target;
   29124    GLfloat s;
   29125 };
   29126 static inline void
   29127 _mesa_unmarshal_MultiTexCoord1fARB(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1fARB *cmd)
   29128 {
   29129    const GLenum target = cmd->target;
   29130    const GLfloat s = cmd->s;
   29131    CALL_MultiTexCoord1fARB(ctx->CurrentServerDispatch, (target, s));
   29132 }
   29133 static void GLAPIENTRY
   29134 _mesa_marshal_MultiTexCoord1fARB(GLenum target, GLfloat s)
   29135 {
   29136    GET_CURRENT_CONTEXT(ctx);
   29137    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1fARB);
   29138    struct marshal_cmd_MultiTexCoord1fARB *cmd;
   29139    debug_print_marshal("MultiTexCoord1fARB");
   29140    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29141       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1fARB, cmd_size);
   29142       cmd->target = target;
   29143       cmd->s = s;
   29144       _mesa_post_marshal_hook(ctx);
   29145       return;
   29146    }
   29147 
   29148    _mesa_glthread_finish(ctx);
   29149    debug_print_sync_fallback("MultiTexCoord1fARB");
   29150    CALL_MultiTexCoord1fARB(ctx->CurrentServerDispatch, (target, s));
   29151 }
   29152 
   29153 
   29154 /* SecondaryColor3d: marshalled asynchronously */
   29155 struct marshal_cmd_SecondaryColor3d
   29156 {
   29157    struct marshal_cmd_base cmd_base;
   29158    GLdouble red;
   29159    GLdouble green;
   29160    GLdouble blue;
   29161 };
   29162 static inline void
   29163 _mesa_unmarshal_SecondaryColor3d(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3d *cmd)
   29164 {
   29165    const GLdouble red = cmd->red;
   29166    const GLdouble green = cmd->green;
   29167    const GLdouble blue = cmd->blue;
   29168    CALL_SecondaryColor3d(ctx->CurrentServerDispatch, (red, green, blue));
   29169 }
   29170 static void GLAPIENTRY
   29171 _mesa_marshal_SecondaryColor3d(GLdouble red, GLdouble green, GLdouble blue)
   29172 {
   29173    GET_CURRENT_CONTEXT(ctx);
   29174    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColor3d);
   29175    struct marshal_cmd_SecondaryColor3d *cmd;
   29176    debug_print_marshal("SecondaryColor3d");
   29177    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29178       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3d, cmd_size);
   29179       cmd->red = red;
   29180       cmd->green = green;
   29181       cmd->blue = blue;
   29182       _mesa_post_marshal_hook(ctx);
   29183       return;
   29184    }
   29185 
   29186    _mesa_glthread_finish(ctx);
   29187    debug_print_sync_fallback("SecondaryColor3d");
   29188    CALL_SecondaryColor3d(ctx->CurrentServerDispatch, (red, green, blue));
   29189 }
   29190 
   29191 
   29192 /* FramebufferParameteri: marshalled asynchronously */
   29193 struct marshal_cmd_FramebufferParameteri
   29194 {
   29195    struct marshal_cmd_base cmd_base;
   29196    GLenum target;
   29197    GLenum pname;
   29198    GLint param;
   29199 };
   29200 static inline void
   29201 _mesa_unmarshal_FramebufferParameteri(struct gl_context *ctx, const struct marshal_cmd_FramebufferParameteri *cmd)
   29202 {
   29203    const GLenum target = cmd->target;
   29204    const GLenum pname = cmd->pname;
   29205    const GLint param = cmd->param;
   29206    CALL_FramebufferParameteri(ctx->CurrentServerDispatch, (target, pname, param));
   29207 }
   29208 static void GLAPIENTRY
   29209 _mesa_marshal_FramebufferParameteri(GLenum target, GLenum pname, GLint param)
   29210 {
   29211    GET_CURRENT_CONTEXT(ctx);
   29212    size_t cmd_size = sizeof(struct marshal_cmd_FramebufferParameteri);
   29213    struct marshal_cmd_FramebufferParameteri *cmd;
   29214    debug_print_marshal("FramebufferParameteri");
   29215    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29216       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferParameteri, cmd_size);
   29217       cmd->target = target;
   29218       cmd->pname = pname;
   29219       cmd->param = param;
   29220       _mesa_post_marshal_hook(ctx);
   29221       return;
   29222    }
   29223 
   29224    _mesa_glthread_finish(ctx);
   29225    debug_print_sync_fallback("FramebufferParameteri");
   29226    CALL_FramebufferParameteri(ctx->CurrentServerDispatch, (target, pname, param));
   29227 }
   29228 
   29229 
   29230 /* VertexAttribs4ubvNV: marshalled asynchronously */
   29231 struct marshal_cmd_VertexAttribs4ubvNV
   29232 {
   29233    struct marshal_cmd_base cmd_base;
   29234    GLuint index;
   29235    GLsizei n;
   29236    /* Next safe_mul(n, 4) bytes are GLubyte v[n][4] */
   29237 };
   29238 static inline void
   29239 _mesa_unmarshal_VertexAttribs4ubvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs4ubvNV *cmd)
   29240 {
   29241    const GLuint index = cmd->index;
   29242    const GLsizei n = cmd->n;
   29243    const GLubyte * v;
   29244    const char *variable_data = (const char *) (cmd + 1);
   29245    v = (const GLubyte *) variable_data;
   29246    variable_data += n * 4;
   29247    CALL_VertexAttribs4ubvNV(ctx->CurrentServerDispatch, (index, n, v));
   29248 }
   29249 static void GLAPIENTRY
   29250 _mesa_marshal_VertexAttribs4ubvNV(GLuint index, GLsizei n, const GLubyte * v)
   29251 {
   29252    GET_CURRENT_CONTEXT(ctx);
   29253    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribs4ubvNV) + safe_mul(n, 4);
   29254    struct marshal_cmd_VertexAttribs4ubvNV *cmd;
   29255    debug_print_marshal("VertexAttribs4ubvNV");
   29256    if (unlikely(safe_mul(n, 4) < 0)) {
   29257       goto fallback_to_sync;
   29258    }
   29259    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29260       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs4ubvNV, cmd_size);
   29261       cmd->index = index;
   29262       cmd->n = n;
   29263       char *variable_data = (char *) (cmd + 1);
   29264       memcpy(variable_data, v, n * 4);
   29265       variable_data += n * 4;
   29266       _mesa_post_marshal_hook(ctx);
   29267       return;
   29268    }
   29269 
   29270 fallback_to_sync:
   29271    _mesa_glthread_finish(ctx);
   29272    debug_print_sync_fallback("VertexAttribs4ubvNV");
   29273    CALL_VertexAttribs4ubvNV(ctx->CurrentServerDispatch, (index, n, v));
   29274 }
   29275 
   29276 
   29277 /* LightModelxv: marshalled synchronously */
   29278 static void GLAPIENTRY
   29279 _mesa_marshal_LightModelxv(GLenum pname, const GLfixed * params)
   29280 {
   29281    GET_CURRENT_CONTEXT(ctx);
   29282    _mesa_glthread_finish(ctx);
   29283    debug_print_sync("LightModelxv");
   29284    CALL_LightModelxv(ctx->CurrentServerDispatch, (pname, params));
   29285 }
   29286 
   29287 
   29288 /* CopyTexSubImage1D: marshalled asynchronously */
   29289 struct marshal_cmd_CopyTexSubImage1D
   29290 {
   29291    struct marshal_cmd_base cmd_base;
   29292    GLenum target;
   29293    GLint level;
   29294    GLint xoffset;
   29295    GLint x;
   29296    GLint y;
   29297    GLsizei width;
   29298 };
   29299 static inline void
   29300 _mesa_unmarshal_CopyTexSubImage1D(struct gl_context *ctx, const struct marshal_cmd_CopyTexSubImage1D *cmd)
   29301 {
   29302    const GLenum target = cmd->target;
   29303    const GLint level = cmd->level;
   29304    const GLint xoffset = cmd->xoffset;
   29305    const GLint x = cmd->x;
   29306    const GLint y = cmd->y;
   29307    const GLsizei width = cmd->width;
   29308    CALL_CopyTexSubImage1D(ctx->CurrentServerDispatch, (target, level, xoffset, x, y, width));
   29309 }
   29310 static void GLAPIENTRY
   29311 _mesa_marshal_CopyTexSubImage1D(GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
   29312 {
   29313    GET_CURRENT_CONTEXT(ctx);
   29314    size_t cmd_size = sizeof(struct marshal_cmd_CopyTexSubImage1D);
   29315    struct marshal_cmd_CopyTexSubImage1D *cmd;
   29316    debug_print_marshal("CopyTexSubImage1D");
   29317    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29318       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyTexSubImage1D, cmd_size);
   29319       cmd->target = target;
   29320       cmd->level = level;
   29321       cmd->xoffset = xoffset;
   29322       cmd->x = x;
   29323       cmd->y = y;
   29324       cmd->width = width;
   29325       _mesa_post_marshal_hook(ctx);
   29326       return;
   29327    }
   29328 
   29329    _mesa_glthread_finish(ctx);
   29330    debug_print_sync_fallback("CopyTexSubImage1D");
   29331    CALL_CopyTexSubImage1D(ctx->CurrentServerDispatch, (target, level, xoffset, x, y, width));
   29332 }
   29333 
   29334 
   29335 /* TextureSubImage3D: marshalled synchronously */
   29336 static void GLAPIENTRY
   29337 _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)
   29338 {
   29339    GET_CURRENT_CONTEXT(ctx);
   29340    _mesa_glthread_finish(ctx);
   29341    debug_print_sync("TextureSubImage3D");
   29342    CALL_TextureSubImage3D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels));
   29343 }
   29344 
   29345 
   29346 /* StencilFunc: marshalled asynchronously */
   29347 struct marshal_cmd_StencilFunc
   29348 {
   29349    struct marshal_cmd_base cmd_base;
   29350    GLenum func;
   29351    GLint ref;
   29352    GLuint mask;
   29353 };
   29354 static inline void
   29355 _mesa_unmarshal_StencilFunc(struct gl_context *ctx, const struct marshal_cmd_StencilFunc *cmd)
   29356 {
   29357    const GLenum func = cmd->func;
   29358    const GLint ref = cmd->ref;
   29359    const GLuint mask = cmd->mask;
   29360    CALL_StencilFunc(ctx->CurrentServerDispatch, (func, ref, mask));
   29361 }
   29362 static void GLAPIENTRY
   29363 _mesa_marshal_StencilFunc(GLenum func, GLint ref, GLuint mask)
   29364 {
   29365    GET_CURRENT_CONTEXT(ctx);
   29366    size_t cmd_size = sizeof(struct marshal_cmd_StencilFunc);
   29367    struct marshal_cmd_StencilFunc *cmd;
   29368    debug_print_marshal("StencilFunc");
   29369    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29370       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_StencilFunc, cmd_size);
   29371       cmd->func = func;
   29372       cmd->ref = ref;
   29373       cmd->mask = mask;
   29374       _mesa_post_marshal_hook(ctx);
   29375       return;
   29376    }
   29377 
   29378    _mesa_glthread_finish(ctx);
   29379    debug_print_sync_fallback("StencilFunc");
   29380    CALL_StencilFunc(ctx->CurrentServerDispatch, (func, ref, mask));
   29381 }
   29382 
   29383 
   29384 /* CopyPixels: marshalled asynchronously */
   29385 struct marshal_cmd_CopyPixels
   29386 {
   29387    struct marshal_cmd_base cmd_base;
   29388    GLint x;
   29389    GLint y;
   29390    GLsizei width;
   29391    GLsizei height;
   29392    GLenum type;
   29393 };
   29394 static inline void
   29395 _mesa_unmarshal_CopyPixels(struct gl_context *ctx, const struct marshal_cmd_CopyPixels *cmd)
   29396 {
   29397    const GLint x = cmd->x;
   29398    const GLint y = cmd->y;
   29399    const GLsizei width = cmd->width;
   29400    const GLsizei height = cmd->height;
   29401    const GLenum type = cmd->type;
   29402    CALL_CopyPixels(ctx->CurrentServerDispatch, (x, y, width, height, type));
   29403 }
   29404 static void GLAPIENTRY
   29405 _mesa_marshal_CopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type)
   29406 {
   29407    GET_CURRENT_CONTEXT(ctx);
   29408    size_t cmd_size = sizeof(struct marshal_cmd_CopyPixels);
   29409    struct marshal_cmd_CopyPixels *cmd;
   29410    debug_print_marshal("CopyPixels");
   29411    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29412       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyPixels, cmd_size);
   29413       cmd->x = x;
   29414       cmd->y = y;
   29415       cmd->width = width;
   29416       cmd->height = height;
   29417       cmd->type = type;
   29418       _mesa_post_marshal_hook(ctx);
   29419       return;
   29420    }
   29421 
   29422    _mesa_glthread_finish(ctx);
   29423    debug_print_sync_fallback("CopyPixels");
   29424    CALL_CopyPixels(ctx->CurrentServerDispatch, (x, y, width, height, type));
   29425 }
   29426 
   29427 
   29428 /* TexGenxvOES: marshalled synchronously */
   29429 static void GLAPIENTRY
   29430 _mesa_marshal_TexGenxvOES(GLenum coord, GLenum pname, const GLfixed * params)
   29431 {
   29432    GET_CURRENT_CONTEXT(ctx);
   29433    _mesa_glthread_finish(ctx);
   29434    debug_print_sync("TexGenxvOES");
   29435    CALL_TexGenxvOES(ctx->CurrentServerDispatch, (coord, pname, params));
   29436 }
   29437 
   29438 
   29439 /* GetTextureLevelParameterfv: marshalled synchronously */
   29440 static void GLAPIENTRY
   29441 _mesa_marshal_GetTextureLevelParameterfv(GLuint texture, GLint level, GLenum pname, GLfloat * params)
   29442 {
   29443    GET_CURRENT_CONTEXT(ctx);
   29444    _mesa_glthread_finish(ctx);
   29445    debug_print_sync("GetTextureLevelParameterfv");
   29446    CALL_GetTextureLevelParameterfv(ctx->CurrentServerDispatch, (texture, level, pname, params));
   29447 }
   29448 
   29449 
   29450 /* VertexAttrib4Nubv: marshalled asynchronously */
   29451 struct marshal_cmd_VertexAttrib4Nubv
   29452 {
   29453    struct marshal_cmd_base cmd_base;
   29454    GLuint index;
   29455    GLubyte v[4];
   29456 };
   29457 static inline void
   29458 _mesa_unmarshal_VertexAttrib4Nubv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nubv *cmd)
   29459 {
   29460    const GLuint index = cmd->index;
   29461    const GLubyte * v = cmd->v;
   29462    CALL_VertexAttrib4Nubv(ctx->CurrentServerDispatch, (index, v));
   29463 }
   29464 static void GLAPIENTRY
   29465 _mesa_marshal_VertexAttrib4Nubv(GLuint index, const GLubyte * v)
   29466 {
   29467    GET_CURRENT_CONTEXT(ctx);
   29468    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nubv);
   29469    struct marshal_cmd_VertexAttrib4Nubv *cmd;
   29470    debug_print_marshal("VertexAttrib4Nubv");
   29471    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29472       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nubv, cmd_size);
   29473       cmd->index = index;
   29474       memcpy(cmd->v, v, 4);
   29475       _mesa_post_marshal_hook(ctx);
   29476       return;
   29477    }
   29478 
   29479    _mesa_glthread_finish(ctx);
   29480    debug_print_sync_fallback("VertexAttrib4Nubv");
   29481    CALL_VertexAttrib4Nubv(ctx->CurrentServerDispatch, (index, v));
   29482 }
   29483 
   29484 
   29485 /* UniformMatrix4x2dv: marshalled asynchronously */
   29486 struct marshal_cmd_UniformMatrix4x2dv
   29487 {
   29488    struct marshal_cmd_base cmd_base;
   29489    GLint location;
   29490    GLsizei count;
   29491    GLboolean transpose;
   29492    /* Next safe_mul(count, 64) bytes are GLdouble value[count][8] */
   29493 };
   29494 static inline void
   29495 _mesa_unmarshal_UniformMatrix4x2dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4x2dv *cmd)
   29496 {
   29497    const GLint location = cmd->location;
   29498    const GLsizei count = cmd->count;
   29499    const GLboolean transpose = cmd->transpose;
   29500    const GLdouble * value;
   29501    const char *variable_data = (const char *) (cmd + 1);
   29502    value = (const GLdouble *) variable_data;
   29503    variable_data += count * 64;
   29504    CALL_UniformMatrix4x2dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   29505 }
   29506 static void GLAPIENTRY
   29507 _mesa_marshal_UniformMatrix4x2dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   29508 {
   29509    GET_CURRENT_CONTEXT(ctx);
   29510    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix4x2dv) + safe_mul(count, 64);
   29511    struct marshal_cmd_UniformMatrix4x2dv *cmd;
   29512    debug_print_marshal("UniformMatrix4x2dv");
   29513    if (unlikely(safe_mul(count, 64) < 0)) {
   29514       goto fallback_to_sync;
   29515    }
   29516    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29517       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4x2dv, cmd_size);
   29518       cmd->location = location;
   29519       cmd->count = count;
   29520       cmd->transpose = transpose;
   29521       char *variable_data = (char *) (cmd + 1);
   29522       memcpy(variable_data, value, count * 64);
   29523       variable_data += count * 64;
   29524       _mesa_post_marshal_hook(ctx);
   29525       return;
   29526    }
   29527 
   29528 fallback_to_sync:
   29529    _mesa_glthread_finish(ctx);
   29530    debug_print_sync_fallback("UniformMatrix4x2dv");
   29531    CALL_UniformMatrix4x2dv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   29532 }
   29533 
   29534 
   29535 /* VertexAttribPointer: marshalled asynchronously */
   29536 struct marshal_cmd_VertexAttribPointer
   29537 {
   29538    struct marshal_cmd_base cmd_base;
   29539    GLuint index;
   29540    GLint size;
   29541    GLenum type;
   29542    GLboolean normalized;
   29543    GLsizei stride;
   29544    const GLvoid * pointer;
   29545 };
   29546 static inline void
   29547 _mesa_unmarshal_VertexAttribPointer(struct gl_context *ctx, const struct marshal_cmd_VertexAttribPointer *cmd)
   29548 {
   29549    const GLuint index = cmd->index;
   29550    const GLint size = cmd->size;
   29551    const GLenum type = cmd->type;
   29552    const GLboolean normalized = cmd->normalized;
   29553    const GLsizei stride = cmd->stride;
   29554    const GLvoid * pointer = cmd->pointer;
   29555    CALL_VertexAttribPointer(ctx->CurrentServerDispatch, (index, size, type, normalized, stride, pointer));
   29556 }
   29557 static void GLAPIENTRY
   29558 _mesa_marshal_VertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer)
   29559 {
   29560    GET_CURRENT_CONTEXT(ctx);
   29561    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribPointer);
   29562    struct marshal_cmd_VertexAttribPointer *cmd;
   29563    debug_print_marshal("VertexAttribPointer");
   29564    if (_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)) {
   29565       _mesa_glthread_finish(ctx);
   29566       _mesa_glthread_restore_dispatch(ctx);
   29567       debug_print_sync_fallback("VertexAttribPointer");
   29568       CALL_VertexAttribPointer(ctx->CurrentServerDispatch, (index, size, type, normalized, stride, pointer));
   29569       return;
   29570    }
   29571    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29572       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribPointer, cmd_size);
   29573       cmd->index = index;
   29574       cmd->size = size;
   29575       cmd->type = type;
   29576       cmd->normalized = normalized;
   29577       cmd->stride = stride;
   29578       cmd->pointer = pointer;
   29579       _mesa_post_marshal_hook(ctx);
   29580       return;
   29581    }
   29582 
   29583    _mesa_glthread_finish(ctx);
   29584    debug_print_sync_fallback("VertexAttribPointer");
   29585    CALL_VertexAttribPointer(ctx->CurrentServerDispatch, (index, size, type, normalized, stride, pointer));
   29586 }
   29587 
   29588 
   29589 /* IndexMask: marshalled asynchronously */
   29590 struct marshal_cmd_IndexMask
   29591 {
   29592    struct marshal_cmd_base cmd_base;
   29593    GLuint mask;
   29594 };
   29595 static inline void
   29596 _mesa_unmarshal_IndexMask(struct gl_context *ctx, const struct marshal_cmd_IndexMask *cmd)
   29597 {
   29598    const GLuint mask = cmd->mask;
   29599    CALL_IndexMask(ctx->CurrentServerDispatch, (mask));
   29600 }
   29601 static void GLAPIENTRY
   29602 _mesa_marshal_IndexMask(GLuint mask)
   29603 {
   29604    GET_CURRENT_CONTEXT(ctx);
   29605    size_t cmd_size = sizeof(struct marshal_cmd_IndexMask);
   29606    struct marshal_cmd_IndexMask *cmd;
   29607    debug_print_marshal("IndexMask");
   29608    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29609       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_IndexMask, cmd_size);
   29610       cmd->mask = mask;
   29611       _mesa_post_marshal_hook(ctx);
   29612       return;
   29613    }
   29614 
   29615    _mesa_glthread_finish(ctx);
   29616    debug_print_sync_fallback("IndexMask");
   29617    CALL_IndexMask(ctx->CurrentServerDispatch, (mask));
   29618 }
   29619 
   29620 
   29621 /* VertexAttribIFormat: marshalled asynchronously */
   29622 struct marshal_cmd_VertexAttribIFormat
   29623 {
   29624    struct marshal_cmd_base cmd_base;
   29625    GLuint attribindex;
   29626    GLint size;
   29627    GLenum type;
   29628    GLuint relativeoffset;
   29629 };
   29630 static inline void
   29631 _mesa_unmarshal_VertexAttribIFormat(struct gl_context *ctx, const struct marshal_cmd_VertexAttribIFormat *cmd)
   29632 {
   29633    const GLuint attribindex = cmd->attribindex;
   29634    const GLint size = cmd->size;
   29635    const GLenum type = cmd->type;
   29636    const GLuint relativeoffset = cmd->relativeoffset;
   29637    CALL_VertexAttribIFormat(ctx->CurrentServerDispatch, (attribindex, size, type, relativeoffset));
   29638 }
   29639 static void GLAPIENTRY
   29640 _mesa_marshal_VertexAttribIFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
   29641 {
   29642    GET_CURRENT_CONTEXT(ctx);
   29643    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribIFormat);
   29644    struct marshal_cmd_VertexAttribIFormat *cmd;
   29645    debug_print_marshal("VertexAttribIFormat");
   29646    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29647       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribIFormat, cmd_size);
   29648       cmd->attribindex = attribindex;
   29649       cmd->size = size;
   29650       cmd->type = type;
   29651       cmd->relativeoffset = relativeoffset;
   29652       _mesa_post_marshal_hook(ctx);
   29653       return;
   29654    }
   29655 
   29656    _mesa_glthread_finish(ctx);
   29657    debug_print_sync_fallback("VertexAttribIFormat");
   29658    CALL_VertexAttribIFormat(ctx->CurrentServerDispatch, (attribindex, size, type, relativeoffset));
   29659 }
   29660 
   29661 
   29662 /* DrawArraysInstancedBaseInstance: marshalled asynchronously */
   29663 struct marshal_cmd_DrawArraysInstancedBaseInstance
   29664 {
   29665    struct marshal_cmd_base cmd_base;
   29666    GLenum mode;
   29667    GLint first;
   29668    GLsizei count;
   29669    GLsizei primcount;
   29670    GLuint baseinstance;
   29671 };
   29672 static inline void
   29673 _mesa_unmarshal_DrawArraysInstancedBaseInstance(struct gl_context *ctx, const struct marshal_cmd_DrawArraysInstancedBaseInstance *cmd)
   29674 {
   29675    const GLenum mode = cmd->mode;
   29676    const GLint first = cmd->first;
   29677    const GLsizei count = cmd->count;
   29678    const GLsizei primcount = cmd->primcount;
   29679    const GLuint baseinstance = cmd->baseinstance;
   29680    CALL_DrawArraysInstancedBaseInstance(ctx->CurrentServerDispatch, (mode, first, count, primcount, baseinstance));
   29681 }
   29682 static void GLAPIENTRY
   29683 _mesa_marshal_DrawArraysInstancedBaseInstance(GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance)
   29684 {
   29685    GET_CURRENT_CONTEXT(ctx);
   29686    size_t cmd_size = sizeof(struct marshal_cmd_DrawArraysInstancedBaseInstance);
   29687    struct marshal_cmd_DrawArraysInstancedBaseInstance *cmd;
   29688    debug_print_marshal("DrawArraysInstancedBaseInstance");
   29689    if (_mesa_glthread_is_non_vbo_draw_elements(ctx)) {
   29690       _mesa_glthread_finish(ctx);
   29691       _mesa_glthread_restore_dispatch(ctx);
   29692       debug_print_sync_fallback("DrawArraysInstancedBaseInstance");
   29693       CALL_DrawArraysInstancedBaseInstance(ctx->CurrentServerDispatch, (mode, first, count, primcount, baseinstance));
   29694       return;
   29695    }
   29696    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29697       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawArraysInstancedBaseInstance, cmd_size);
   29698       cmd->mode = mode;
   29699       cmd->first = first;
   29700       cmd->count = count;
   29701       cmd->primcount = primcount;
   29702       cmd->baseinstance = baseinstance;
   29703       _mesa_post_marshal_hook(ctx);
   29704       return;
   29705    }
   29706 
   29707    _mesa_glthread_finish(ctx);
   29708    debug_print_sync_fallback("DrawArraysInstancedBaseInstance");
   29709    CALL_DrawArraysInstancedBaseInstance(ctx->CurrentServerDispatch, (mode, first, count, primcount, baseinstance));
   29710 }
   29711 
   29712 
   29713 /* TextureStorageMem3DMultisampleEXT: marshalled asynchronously */
   29714 struct marshal_cmd_TextureStorageMem3DMultisampleEXT
   29715 {
   29716    struct marshal_cmd_base cmd_base;
   29717    GLuint texture;
   29718    GLsizei samples;
   29719    GLenum internalFormat;
   29720    GLsizei width;
   29721    GLsizei height;
   29722    GLsizei depth;
   29723    GLboolean fixedSampleLocations;
   29724    GLuint memory;
   29725    GLuint64 offset;
   29726 };
   29727 static inline void
   29728 _mesa_unmarshal_TextureStorageMem3DMultisampleEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorageMem3DMultisampleEXT *cmd)
   29729 {
   29730    const GLuint texture = cmd->texture;
   29731    const GLsizei samples = cmd->samples;
   29732    const GLenum internalFormat = cmd->internalFormat;
   29733    const GLsizei width = cmd->width;
   29734    const GLsizei height = cmd->height;
   29735    const GLsizei depth = cmd->depth;
   29736    const GLboolean fixedSampleLocations = cmd->fixedSampleLocations;
   29737    const GLuint memory = cmd->memory;
   29738    const GLuint64 offset = cmd->offset;
   29739    CALL_TextureStorageMem3DMultisampleEXT(ctx->CurrentServerDispatch, (texture, samples, internalFormat, width, height, depth, fixedSampleLocations, memory, offset));
   29740 }
   29741 static void GLAPIENTRY
   29742 _mesa_marshal_TextureStorageMem3DMultisampleEXT(GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset)
   29743 {
   29744    GET_CURRENT_CONTEXT(ctx);
   29745    size_t cmd_size = sizeof(struct marshal_cmd_TextureStorageMem3DMultisampleEXT);
   29746    struct marshal_cmd_TextureStorageMem3DMultisampleEXT *cmd;
   29747    debug_print_marshal("TextureStorageMem3DMultisampleEXT");
   29748    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29749       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorageMem3DMultisampleEXT, cmd_size);
   29750       cmd->texture = texture;
   29751       cmd->samples = samples;
   29752       cmd->internalFormat = internalFormat;
   29753       cmd->width = width;
   29754       cmd->height = height;
   29755       cmd->depth = depth;
   29756       cmd->fixedSampleLocations = fixedSampleLocations;
   29757       cmd->memory = memory;
   29758       cmd->offset = offset;
   29759       _mesa_post_marshal_hook(ctx);
   29760       return;
   29761    }
   29762 
   29763    _mesa_glthread_finish(ctx);
   29764    debug_print_sync_fallback("TextureStorageMem3DMultisampleEXT");
   29765    CALL_TextureStorageMem3DMultisampleEXT(ctx->CurrentServerDispatch, (texture, samples, internalFormat, width, height, depth, fixedSampleLocations, memory, offset));
   29766 }
   29767 
   29768 
   29769 /* CompressedTextureSubImage3D: marshalled synchronously */
   29770 static void GLAPIENTRY
   29771 _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)
   29772 {
   29773    GET_CURRENT_CONTEXT(ctx);
   29774    _mesa_glthread_finish(ctx);
   29775    debug_print_sync("CompressedTextureSubImage3D");
   29776    CALL_CompressedTextureSubImage3D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data));
   29777 }
   29778 
   29779 
   29780 /* PopAttrib: marshalled asynchronously */
   29781 struct marshal_cmd_PopAttrib
   29782 {
   29783    struct marshal_cmd_base cmd_base;
   29784 };
   29785 static inline void
   29786 _mesa_unmarshal_PopAttrib(struct gl_context *ctx, const struct marshal_cmd_PopAttrib *cmd)
   29787 {
   29788    CALL_PopAttrib(ctx->CurrentServerDispatch, ());
   29789 }
   29790 static void GLAPIENTRY
   29791 _mesa_marshal_PopAttrib(void)
   29792 {
   29793    GET_CURRENT_CONTEXT(ctx);
   29794    size_t cmd_size = sizeof(struct marshal_cmd_PopAttrib);
   29795    struct marshal_cmd_PopAttrib *cmd;
   29796    debug_print_marshal("PopAttrib");
   29797    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29798       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PopAttrib, cmd_size);
   29799       (void) cmd;
   29800 
   29801       _mesa_post_marshal_hook(ctx);
   29802       return;
   29803    }
   29804 
   29805    _mesa_glthread_finish(ctx);
   29806    debug_print_sync_fallback("PopAttrib");
   29807    CALL_PopAttrib(ctx->CurrentServerDispatch, ());
   29808 }
   29809 
   29810 
   29811 /* Uniform3ui: marshalled asynchronously */
   29812 struct marshal_cmd_Uniform3ui
   29813 {
   29814    struct marshal_cmd_base cmd_base;
   29815    GLint location;
   29816    GLuint x;
   29817    GLuint y;
   29818    GLuint z;
   29819 };
   29820 static inline void
   29821 _mesa_unmarshal_Uniform3ui(struct gl_context *ctx, const struct marshal_cmd_Uniform3ui *cmd)
   29822 {
   29823    const GLint location = cmd->location;
   29824    const GLuint x = cmd->x;
   29825    const GLuint y = cmd->y;
   29826    const GLuint z = cmd->z;
   29827    CALL_Uniform3ui(ctx->CurrentServerDispatch, (location, x, y, z));
   29828 }
   29829 static void GLAPIENTRY
   29830 _mesa_marshal_Uniform3ui(GLint location, GLuint x, GLuint y, GLuint z)
   29831 {
   29832    GET_CURRENT_CONTEXT(ctx);
   29833    size_t cmd_size = sizeof(struct marshal_cmd_Uniform3ui);
   29834    struct marshal_cmd_Uniform3ui *cmd;
   29835    debug_print_marshal("Uniform3ui");
   29836    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29837       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3ui, cmd_size);
   29838       cmd->location = location;
   29839       cmd->x = x;
   29840       cmd->y = y;
   29841       cmd->z = z;
   29842       _mesa_post_marshal_hook(ctx);
   29843       return;
   29844    }
   29845 
   29846    _mesa_glthread_finish(ctx);
   29847    debug_print_sync_fallback("Uniform3ui");
   29848    CALL_Uniform3ui(ctx->CurrentServerDispatch, (location, x, y, z));
   29849 }
   29850 
   29851 
   29852 /* DeletePerfMonitorsAMD: marshalled synchronously */
   29853 static void GLAPIENTRY
   29854 _mesa_marshal_DeletePerfMonitorsAMD(GLsizei n, GLuint * monitors)
   29855 {
   29856    GET_CURRENT_CONTEXT(ctx);
   29857    _mesa_glthread_finish(ctx);
   29858    debug_print_sync("DeletePerfMonitorsAMD");
   29859    CALL_DeletePerfMonitorsAMD(ctx->CurrentServerDispatch, (n, monitors));
   29860 }
   29861 
   29862 
   29863 /* Color4dv: marshalled asynchronously */
   29864 struct marshal_cmd_Color4dv
   29865 {
   29866    struct marshal_cmd_base cmd_base;
   29867    GLdouble v[4];
   29868 };
   29869 static inline void
   29870 _mesa_unmarshal_Color4dv(struct gl_context *ctx, const struct marshal_cmd_Color4dv *cmd)
   29871 {
   29872    const GLdouble * v = cmd->v;
   29873    CALL_Color4dv(ctx->CurrentServerDispatch, (v));
   29874 }
   29875 static void GLAPIENTRY
   29876 _mesa_marshal_Color4dv(const GLdouble * v)
   29877 {
   29878    GET_CURRENT_CONTEXT(ctx);
   29879    size_t cmd_size = sizeof(struct marshal_cmd_Color4dv);
   29880    struct marshal_cmd_Color4dv *cmd;
   29881    debug_print_marshal("Color4dv");
   29882    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29883       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4dv, cmd_size);
   29884       memcpy(cmd->v, v, 32);
   29885       _mesa_post_marshal_hook(ctx);
   29886       return;
   29887    }
   29888 
   29889    _mesa_glthread_finish(ctx);
   29890    debug_print_sync_fallback("Color4dv");
   29891    CALL_Color4dv(ctx->CurrentServerDispatch, (v));
   29892 }
   29893 
   29894 
   29895 /* DisableVertexAttribArray: marshalled asynchronously */
   29896 struct marshal_cmd_DisableVertexAttribArray
   29897 {
   29898    struct marshal_cmd_base cmd_base;
   29899    GLuint index;
   29900 };
   29901 static inline void
   29902 _mesa_unmarshal_DisableVertexAttribArray(struct gl_context *ctx, const struct marshal_cmd_DisableVertexAttribArray *cmd)
   29903 {
   29904    const GLuint index = cmd->index;
   29905    CALL_DisableVertexAttribArray(ctx->CurrentServerDispatch, (index));
   29906 }
   29907 static void GLAPIENTRY
   29908 _mesa_marshal_DisableVertexAttribArray(GLuint index)
   29909 {
   29910    GET_CURRENT_CONTEXT(ctx);
   29911    size_t cmd_size = sizeof(struct marshal_cmd_DisableVertexAttribArray);
   29912    struct marshal_cmd_DisableVertexAttribArray *cmd;
   29913    debug_print_marshal("DisableVertexAttribArray");
   29914    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29915       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DisableVertexAttribArray, cmd_size);
   29916       cmd->index = index;
   29917       _mesa_post_marshal_hook(ctx);
   29918       return;
   29919    }
   29920 
   29921    _mesa_glthread_finish(ctx);
   29922    debug_print_sync_fallback("DisableVertexAttribArray");
   29923    CALL_DisableVertexAttribArray(ctx->CurrentServerDispatch, (index));
   29924 }
   29925 
   29926 
   29927 /* ProgramUniformMatrix3x2fv: marshalled asynchronously */
   29928 struct marshal_cmd_ProgramUniformMatrix3x2fv
   29929 {
   29930    struct marshal_cmd_base cmd_base;
   29931    GLuint program;
   29932    GLint location;
   29933    GLsizei count;
   29934    GLboolean transpose;
   29935    /* Next safe_mul(count, 24) bytes are GLfloat value[count][6] */
   29936 };
   29937 static inline void
   29938 _mesa_unmarshal_ProgramUniformMatrix3x2fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix3x2fv *cmd)
   29939 {
   29940    const GLuint program = cmd->program;
   29941    const GLint location = cmd->location;
   29942    const GLsizei count = cmd->count;
   29943    const GLboolean transpose = cmd->transpose;
   29944    const GLfloat * value;
   29945    const char *variable_data = (const char *) (cmd + 1);
   29946    value = (const GLfloat *) variable_data;
   29947    variable_data += count * 24;
   29948    CALL_ProgramUniformMatrix3x2fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   29949 }
   29950 static void GLAPIENTRY
   29951 _mesa_marshal_ProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   29952 {
   29953    GET_CURRENT_CONTEXT(ctx);
   29954    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix3x2fv) + safe_mul(count, 24);
   29955    struct marshal_cmd_ProgramUniformMatrix3x2fv *cmd;
   29956    debug_print_marshal("ProgramUniformMatrix3x2fv");
   29957    if (unlikely(safe_mul(count, 24) < 0)) {
   29958       goto fallback_to_sync;
   29959    }
   29960    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   29961       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix3x2fv, cmd_size);
   29962       cmd->program = program;
   29963       cmd->location = location;
   29964       cmd->count = count;
   29965       cmd->transpose = transpose;
   29966       char *variable_data = (char *) (cmd + 1);
   29967       memcpy(variable_data, value, count * 24);
   29968       variable_data += count * 24;
   29969       _mesa_post_marshal_hook(ctx);
   29970       return;
   29971    }
   29972 
   29973 fallback_to_sync:
   29974    _mesa_glthread_finish(ctx);
   29975    debug_print_sync_fallback("ProgramUniformMatrix3x2fv");
   29976    CALL_ProgramUniformMatrix3x2fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   29977 }
   29978 
   29979 
   29980 /* GetDoublei_v: marshalled synchronously */
   29981 static void GLAPIENTRY
   29982 _mesa_marshal_GetDoublei_v(GLenum target, GLuint index, GLdouble * data)
   29983 {
   29984    GET_CURRENT_CONTEXT(ctx);
   29985    _mesa_glthread_finish(ctx);
   29986    debug_print_sync("GetDoublei_v");
   29987    CALL_GetDoublei_v(ctx->CurrentServerDispatch, (target, index, data));
   29988 }
   29989 
   29990 
   29991 /* IsTransformFeedback: marshalled synchronously */
   29992 static GLboolean GLAPIENTRY
   29993 _mesa_marshal_IsTransformFeedback(GLuint id)
   29994 {
   29995    GET_CURRENT_CONTEXT(ctx);
   29996    _mesa_glthread_finish(ctx);
   29997    debug_print_sync("IsTransformFeedback");
   29998    return CALL_IsTransformFeedback(ctx->CurrentServerDispatch, (id));
   29999 }
   30000 
   30001 
   30002 /* GetMemoryObjectParameterivEXT: marshalled synchronously */
   30003 static void GLAPIENTRY
   30004 _mesa_marshal_GetMemoryObjectParameterivEXT(GLuint memoryObject, GLenum pname, GLint * params)
   30005 {
   30006    GET_CURRENT_CONTEXT(ctx);
   30007    _mesa_glthread_finish(ctx);
   30008    debug_print_sync("GetMemoryObjectParameterivEXT");
   30009    CALL_GetMemoryObjectParameterivEXT(ctx->CurrentServerDispatch, (memoryObject, pname, params));
   30010 }
   30011 
   30012 
   30013 /* ClipPlanex: marshalled asynchronously */
   30014 struct marshal_cmd_ClipPlanex
   30015 {
   30016    struct marshal_cmd_base cmd_base;
   30017    GLenum plane;
   30018    GLfixed equation[4];
   30019 };
   30020 static inline void
   30021 _mesa_unmarshal_ClipPlanex(struct gl_context *ctx, const struct marshal_cmd_ClipPlanex *cmd)
   30022 {
   30023    const GLenum plane = cmd->plane;
   30024    const GLfixed * equation = cmd->equation;
   30025    CALL_ClipPlanex(ctx->CurrentServerDispatch, (plane, equation));
   30026 }
   30027 static void GLAPIENTRY
   30028 _mesa_marshal_ClipPlanex(GLenum plane, const GLfixed * equation)
   30029 {
   30030    GET_CURRENT_CONTEXT(ctx);
   30031    size_t cmd_size = sizeof(struct marshal_cmd_ClipPlanex);
   30032    struct marshal_cmd_ClipPlanex *cmd;
   30033    debug_print_marshal("ClipPlanex");
   30034    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30035       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClipPlanex, cmd_size);
   30036       cmd->plane = plane;
   30037       memcpy(cmd->equation, equation, 16);
   30038       _mesa_post_marshal_hook(ctx);
   30039       return;
   30040    }
   30041 
   30042    _mesa_glthread_finish(ctx);
   30043    debug_print_sync_fallback("ClipPlanex");
   30044    CALL_ClipPlanex(ctx->CurrentServerDispatch, (plane, equation));
   30045 }
   30046 
   30047 
   30048 /* GetLightfv: marshalled synchronously */
   30049 static void GLAPIENTRY
   30050 _mesa_marshal_GetLightfv(GLenum light, GLenum pname, GLfloat * params)
   30051 {
   30052    GET_CURRENT_CONTEXT(ctx);
   30053    _mesa_glthread_finish(ctx);
   30054    debug_print_sync("GetLightfv");
   30055    CALL_GetLightfv(ctx->CurrentServerDispatch, (light, pname, params));
   30056 }
   30057 
   30058 
   30059 /* ClipPlanef: marshalled asynchronously */
   30060 struct marshal_cmd_ClipPlanef
   30061 {
   30062    struct marshal_cmd_base cmd_base;
   30063    GLenum plane;
   30064    GLfloat equation[4];
   30065 };
   30066 static inline void
   30067 _mesa_unmarshal_ClipPlanef(struct gl_context *ctx, const struct marshal_cmd_ClipPlanef *cmd)
   30068 {
   30069    const GLenum plane = cmd->plane;
   30070    const GLfloat * equation = cmd->equation;
   30071    CALL_ClipPlanef(ctx->CurrentServerDispatch, (plane, equation));
   30072 }
   30073 static void GLAPIENTRY
   30074 _mesa_marshal_ClipPlanef(GLenum plane, const GLfloat * equation)
   30075 {
   30076    GET_CURRENT_CONTEXT(ctx);
   30077    size_t cmd_size = sizeof(struct marshal_cmd_ClipPlanef);
   30078    struct marshal_cmd_ClipPlanef *cmd;
   30079    debug_print_marshal("ClipPlanef");
   30080    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30081       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClipPlanef, cmd_size);
   30082       cmd->plane = plane;
   30083       memcpy(cmd->equation, equation, 16);
   30084       _mesa_post_marshal_hook(ctx);
   30085       return;
   30086    }
   30087 
   30088    _mesa_glthread_finish(ctx);
   30089    debug_print_sync_fallback("ClipPlanef");
   30090    CALL_ClipPlanef(ctx->CurrentServerDispatch, (plane, equation));
   30091 }
   30092 
   30093 
   30094 /* ProgramUniform1ui: marshalled asynchronously */
   30095 struct marshal_cmd_ProgramUniform1ui
   30096 {
   30097    struct marshal_cmd_base cmd_base;
   30098    GLuint program;
   30099    GLint location;
   30100    GLuint x;
   30101 };
   30102 static inline void
   30103 _mesa_unmarshal_ProgramUniform1ui(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1ui *cmd)
   30104 {
   30105    const GLuint program = cmd->program;
   30106    const GLint location = cmd->location;
   30107    const GLuint x = cmd->x;
   30108    CALL_ProgramUniform1ui(ctx->CurrentServerDispatch, (program, location, x));
   30109 }
   30110 static void GLAPIENTRY
   30111 _mesa_marshal_ProgramUniform1ui(GLuint program, GLint location, GLuint x)
   30112 {
   30113    GET_CURRENT_CONTEXT(ctx);
   30114    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform1ui);
   30115    struct marshal_cmd_ProgramUniform1ui *cmd;
   30116    debug_print_marshal("ProgramUniform1ui");
   30117    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30118       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1ui, cmd_size);
   30119       cmd->program = program;
   30120       cmd->location = location;
   30121       cmd->x = x;
   30122       _mesa_post_marshal_hook(ctx);
   30123       return;
   30124    }
   30125 
   30126    _mesa_glthread_finish(ctx);
   30127    debug_print_sync_fallback("ProgramUniform1ui");
   30128    CALL_ProgramUniform1ui(ctx->CurrentServerDispatch, (program, location, x));
   30129 }
   30130 
   30131 
   30132 /* SecondaryColorPointer: marshalled asynchronously */
   30133 struct marshal_cmd_SecondaryColorPointer
   30134 {
   30135    struct marshal_cmd_base cmd_base;
   30136    GLint size;
   30137    GLenum type;
   30138    GLsizei stride;
   30139    const GLvoid * pointer;
   30140 };
   30141 static inline void
   30142 _mesa_unmarshal_SecondaryColorPointer(struct gl_context *ctx, const struct marshal_cmd_SecondaryColorPointer *cmd)
   30143 {
   30144    const GLint size = cmd->size;
   30145    const GLenum type = cmd->type;
   30146    const GLsizei stride = cmd->stride;
   30147    const GLvoid * pointer = cmd->pointer;
   30148    CALL_SecondaryColorPointer(ctx->CurrentServerDispatch, (size, type, stride, pointer));
   30149 }
   30150 static void GLAPIENTRY
   30151 _mesa_marshal_SecondaryColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
   30152 {
   30153    GET_CURRENT_CONTEXT(ctx);
   30154    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColorPointer);
   30155    struct marshal_cmd_SecondaryColorPointer *cmd;
   30156    debug_print_marshal("SecondaryColorPointer");
   30157    if (_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)) {
   30158       _mesa_glthread_finish(ctx);
   30159       _mesa_glthread_restore_dispatch(ctx);
   30160       debug_print_sync_fallback("SecondaryColorPointer");
   30161       CALL_SecondaryColorPointer(ctx->CurrentServerDispatch, (size, type, stride, pointer));
   30162       return;
   30163    }
   30164    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30165       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColorPointer, cmd_size);
   30166       cmd->size = size;
   30167       cmd->type = type;
   30168       cmd->stride = stride;
   30169       cmd->pointer = pointer;
   30170       _mesa_post_marshal_hook(ctx);
   30171       return;
   30172    }
   30173 
   30174    _mesa_glthread_finish(ctx);
   30175    debug_print_sync_fallback("SecondaryColorPointer");
   30176    CALL_SecondaryColorPointer(ctx->CurrentServerDispatch, (size, type, stride, pointer));
   30177 }
   30178 
   30179 
   30180 /* LineStipple: marshalled asynchronously */
   30181 struct marshal_cmd_LineStipple
   30182 {
   30183    struct marshal_cmd_base cmd_base;
   30184    GLint factor;
   30185    GLushort pattern;
   30186 };
   30187 static inline void
   30188 _mesa_unmarshal_LineStipple(struct gl_context *ctx, const struct marshal_cmd_LineStipple *cmd)
   30189 {
   30190    const GLint factor = cmd->factor;
   30191    const GLushort pattern = cmd->pattern;
   30192    CALL_LineStipple(ctx->CurrentServerDispatch, (factor, pattern));
   30193 }
   30194 static void GLAPIENTRY
   30195 _mesa_marshal_LineStipple(GLint factor, GLushort pattern)
   30196 {
   30197    GET_CURRENT_CONTEXT(ctx);
   30198    size_t cmd_size = sizeof(struct marshal_cmd_LineStipple);
   30199    struct marshal_cmd_LineStipple *cmd;
   30200    debug_print_marshal("LineStipple");
   30201    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30202       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LineStipple, cmd_size);
   30203       cmd->factor = factor;
   30204       cmd->pattern = pattern;
   30205       _mesa_post_marshal_hook(ctx);
   30206       return;
   30207    }
   30208 
   30209    _mesa_glthread_finish(ctx);
   30210    debug_print_sync_fallback("LineStipple");
   30211    CALL_LineStipple(ctx->CurrentServerDispatch, (factor, pattern));
   30212 }
   30213 
   30214 
   30215 /* BeginFragmentShaderATI: marshalled asynchronously */
   30216 struct marshal_cmd_BeginFragmentShaderATI
   30217 {
   30218    struct marshal_cmd_base cmd_base;
   30219 };
   30220 static inline void
   30221 _mesa_unmarshal_BeginFragmentShaderATI(struct gl_context *ctx, const struct marshal_cmd_BeginFragmentShaderATI *cmd)
   30222 {
   30223    CALL_BeginFragmentShaderATI(ctx->CurrentServerDispatch, ());
   30224 }
   30225 static void GLAPIENTRY
   30226 _mesa_marshal_BeginFragmentShaderATI(void)
   30227 {
   30228    GET_CURRENT_CONTEXT(ctx);
   30229    size_t cmd_size = sizeof(struct marshal_cmd_BeginFragmentShaderATI);
   30230    struct marshal_cmd_BeginFragmentShaderATI *cmd;
   30231    debug_print_marshal("BeginFragmentShaderATI");
   30232    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30233       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BeginFragmentShaderATI, cmd_size);
   30234       (void) cmd;
   30235 
   30236       _mesa_post_marshal_hook(ctx);
   30237       return;
   30238    }
   30239 
   30240    _mesa_glthread_finish(ctx);
   30241    debug_print_sync_fallback("BeginFragmentShaderATI");
   30242    CALL_BeginFragmentShaderATI(ctx->CurrentServerDispatch, ());
   30243 }
   30244 
   30245 
   30246 /* GenRenderbuffers: marshalled synchronously */
   30247 static void GLAPIENTRY
   30248 _mesa_marshal_GenRenderbuffers(GLsizei n, GLuint * renderbuffers)
   30249 {
   30250    GET_CURRENT_CONTEXT(ctx);
   30251    _mesa_glthread_finish(ctx);
   30252    debug_print_sync("GenRenderbuffers");
   30253    CALL_GenRenderbuffers(ctx->CurrentServerDispatch, (n, renderbuffers));
   30254 }
   30255 
   30256 
   30257 /* GetMinmaxParameterfv: marshalled synchronously */
   30258 static void GLAPIENTRY
   30259 _mesa_marshal_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat * params)
   30260 {
   30261    GET_CURRENT_CONTEXT(ctx);
   30262    _mesa_glthread_finish(ctx);
   30263    debug_print_sync("GetMinmaxParameterfv");
   30264    CALL_GetMinmaxParameterfv(ctx->CurrentServerDispatch, (target, pname, params));
   30265 }
   30266 
   30267 
   30268 /* TextureStorageMem2DEXT: marshalled asynchronously */
   30269 struct marshal_cmd_TextureStorageMem2DEXT
   30270 {
   30271    struct marshal_cmd_base cmd_base;
   30272    GLenum texture;
   30273    GLsizei levels;
   30274    GLenum internalFormat;
   30275    GLsizei width;
   30276    GLsizei height;
   30277    GLuint memory;
   30278    GLuint64 offset;
   30279 };
   30280 static inline void
   30281 _mesa_unmarshal_TextureStorageMem2DEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorageMem2DEXT *cmd)
   30282 {
   30283    const GLenum texture = cmd->texture;
   30284    const GLsizei levels = cmd->levels;
   30285    const GLenum internalFormat = cmd->internalFormat;
   30286    const GLsizei width = cmd->width;
   30287    const GLsizei height = cmd->height;
   30288    const GLuint memory = cmd->memory;
   30289    const GLuint64 offset = cmd->offset;
   30290    CALL_TextureStorageMem2DEXT(ctx->CurrentServerDispatch, (texture, levels, internalFormat, width, height, memory, offset));
   30291 }
   30292 static void GLAPIENTRY
   30293 _mesa_marshal_TextureStorageMem2DEXT(GLenum texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset)
   30294 {
   30295    GET_CURRENT_CONTEXT(ctx);
   30296    size_t cmd_size = sizeof(struct marshal_cmd_TextureStorageMem2DEXT);
   30297    struct marshal_cmd_TextureStorageMem2DEXT *cmd;
   30298    debug_print_marshal("TextureStorageMem2DEXT");
   30299    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30300       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorageMem2DEXT, cmd_size);
   30301       cmd->texture = texture;
   30302       cmd->levels = levels;
   30303       cmd->internalFormat = internalFormat;
   30304       cmd->width = width;
   30305       cmd->height = height;
   30306       cmd->memory = memory;
   30307       cmd->offset = offset;
   30308       _mesa_post_marshal_hook(ctx);
   30309       return;
   30310    }
   30311 
   30312    _mesa_glthread_finish(ctx);
   30313    debug_print_sync_fallback("TextureStorageMem2DEXT");
   30314    CALL_TextureStorageMem2DEXT(ctx->CurrentServerDispatch, (texture, levels, internalFormat, width, height, memory, offset));
   30315 }
   30316 
   30317 
   30318 /* IsEnabledi: marshalled synchronously */
   30319 static GLboolean GLAPIENTRY
   30320 _mesa_marshal_IsEnabledi(GLenum target, GLuint index)
   30321 {
   30322    GET_CURRENT_CONTEXT(ctx);
   30323    _mesa_glthread_finish(ctx);
   30324    debug_print_sync("IsEnabledi");
   30325    return CALL_IsEnabledi(ctx->CurrentServerDispatch, (target, index));
   30326 }
   30327 
   30328 
   30329 /* WaitSync: marshalled asynchronously */
   30330 struct marshal_cmd_WaitSync
   30331 {
   30332    struct marshal_cmd_base cmd_base;
   30333    GLsync sync;
   30334    GLbitfield flags;
   30335    GLuint64 timeout;
   30336 };
   30337 static inline void
   30338 _mesa_unmarshal_WaitSync(struct gl_context *ctx, const struct marshal_cmd_WaitSync *cmd)
   30339 {
   30340    const GLsync sync = cmd->sync;
   30341    const GLbitfield flags = cmd->flags;
   30342    const GLuint64 timeout = cmd->timeout;
   30343    CALL_WaitSync(ctx->CurrentServerDispatch, (sync, flags, timeout));
   30344 }
   30345 static void GLAPIENTRY
   30346 _mesa_marshal_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
   30347 {
   30348    GET_CURRENT_CONTEXT(ctx);
   30349    size_t cmd_size = sizeof(struct marshal_cmd_WaitSync);
   30350    struct marshal_cmd_WaitSync *cmd;
   30351    debug_print_marshal("WaitSync");
   30352    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30353       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WaitSync, cmd_size);
   30354       cmd->sync = sync;
   30355       cmd->flags = flags;
   30356       cmd->timeout = timeout;
   30357       _mesa_post_marshal_hook(ctx);
   30358       return;
   30359    }
   30360 
   30361    _mesa_glthread_finish(ctx);
   30362    debug_print_sync_fallback("WaitSync");
   30363    CALL_WaitSync(ctx->CurrentServerDispatch, (sync, flags, timeout));
   30364 }
   30365 
   30366 
   30367 /* GetVertexAttribPointerv: marshalled synchronously */
   30368 static void GLAPIENTRY
   30369 _mesa_marshal_GetVertexAttribPointerv(GLuint index, GLenum pname, GLvoid ** pointer)
   30370 {
   30371    GET_CURRENT_CONTEXT(ctx);
   30372    _mesa_glthread_finish(ctx);
   30373    debug_print_sync("GetVertexAttribPointerv");
   30374    CALL_GetVertexAttribPointerv(ctx->CurrentServerDispatch, (index, pname, pointer));
   30375 }
   30376 
   30377 
   30378 /* Uniform1i64vARB: marshalled asynchronously */
   30379 struct marshal_cmd_Uniform1i64vARB
   30380 {
   30381    struct marshal_cmd_base cmd_base;
   30382    GLint location;
   30383    GLsizei count;
   30384    /* Next safe_mul(count, 8) bytes are GLint64 value[count] */
   30385 };
   30386 static inline void
   30387 _mesa_unmarshal_Uniform1i64vARB(struct gl_context *ctx, const struct marshal_cmd_Uniform1i64vARB *cmd)
   30388 {
   30389    const GLint location = cmd->location;
   30390    const GLsizei count = cmd->count;
   30391    const GLint64 * value;
   30392    const char *variable_data = (const char *) (cmd + 1);
   30393    value = (const GLint64 *) variable_data;
   30394    variable_data += count * 8;
   30395    CALL_Uniform1i64vARB(ctx->CurrentServerDispatch, (location, count, value));
   30396 }
   30397 static void GLAPIENTRY
   30398 _mesa_marshal_Uniform1i64vARB(GLint location, GLsizei count, const GLint64 * value)
   30399 {
   30400    GET_CURRENT_CONTEXT(ctx);
   30401    size_t cmd_size = sizeof(struct marshal_cmd_Uniform1i64vARB) + safe_mul(count, 8);
   30402    struct marshal_cmd_Uniform1i64vARB *cmd;
   30403    debug_print_marshal("Uniform1i64vARB");
   30404    if (unlikely(safe_mul(count, 8) < 0)) {
   30405       goto fallback_to_sync;
   30406    }
   30407    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30408       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1i64vARB, cmd_size);
   30409       cmd->location = location;
   30410       cmd->count = count;
   30411       char *variable_data = (char *) (cmd + 1);
   30412       memcpy(variable_data, value, count * 8);
   30413       variable_data += count * 8;
   30414       _mesa_post_marshal_hook(ctx);
   30415       return;
   30416    }
   30417 
   30418 fallback_to_sync:
   30419    _mesa_glthread_finish(ctx);
   30420    debug_print_sync_fallback("Uniform1i64vARB");
   30421    CALL_Uniform1i64vARB(ctx->CurrentServerDispatch, (location, count, value));
   30422 }
   30423 
   30424 
   30425 /* CreatePerfQueryINTEL: marshalled synchronously */
   30426 static void GLAPIENTRY
   30427 _mesa_marshal_CreatePerfQueryINTEL(GLuint queryId, GLuint * queryHandle)
   30428 {
   30429    GET_CURRENT_CONTEXT(ctx);
   30430    _mesa_glthread_finish(ctx);
   30431    debug_print_sync("CreatePerfQueryINTEL");
   30432    CALL_CreatePerfQueryINTEL(ctx->CurrentServerDispatch, (queryId, queryHandle));
   30433 }
   30434 
   30435 
   30436 /* NewList: marshalled asynchronously */
   30437 struct marshal_cmd_NewList
   30438 {
   30439    struct marshal_cmd_base cmd_base;
   30440    GLuint list;
   30441    GLenum mode;
   30442 };
   30443 static inline void
   30444 _mesa_unmarshal_NewList(struct gl_context *ctx, const struct marshal_cmd_NewList *cmd)
   30445 {
   30446    const GLuint list = cmd->list;
   30447    const GLenum mode = cmd->mode;
   30448    CALL_NewList(ctx->CurrentServerDispatch, (list, mode));
   30449 }
   30450 static void GLAPIENTRY
   30451 _mesa_marshal_NewList(GLuint list, GLenum mode)
   30452 {
   30453    GET_CURRENT_CONTEXT(ctx);
   30454    size_t cmd_size = sizeof(struct marshal_cmd_NewList);
   30455    struct marshal_cmd_NewList *cmd;
   30456    debug_print_marshal("NewList");
   30457    if (true) {
   30458       _mesa_glthread_finish(ctx);
   30459       _mesa_glthread_restore_dispatch(ctx);
   30460       debug_print_sync_fallback("NewList");
   30461       CALL_NewList(ctx->CurrentServerDispatch, (list, mode));
   30462       return;
   30463    }
   30464    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30465       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NewList, cmd_size);
   30466       cmd->list = list;
   30467       cmd->mode = mode;
   30468       _mesa_post_marshal_hook(ctx);
   30469       return;
   30470    }
   30471 
   30472    _mesa_glthread_finish(ctx);
   30473    debug_print_sync_fallback("NewList");
   30474    CALL_NewList(ctx->CurrentServerDispatch, (list, mode));
   30475 }
   30476 
   30477 
   30478 /* TexBuffer: marshalled asynchronously */
   30479 struct marshal_cmd_TexBuffer
   30480 {
   30481    struct marshal_cmd_base cmd_base;
   30482    GLenum target;
   30483    GLenum internalFormat;
   30484    GLuint buffer;
   30485 };
   30486 static inline void
   30487 _mesa_unmarshal_TexBuffer(struct gl_context *ctx, const struct marshal_cmd_TexBuffer *cmd)
   30488 {
   30489    const GLenum target = cmd->target;
   30490    const GLenum internalFormat = cmd->internalFormat;
   30491    const GLuint buffer = cmd->buffer;
   30492    CALL_TexBuffer(ctx->CurrentServerDispatch, (target, internalFormat, buffer));
   30493 }
   30494 static void GLAPIENTRY
   30495 _mesa_marshal_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer)
   30496 {
   30497    GET_CURRENT_CONTEXT(ctx);
   30498    size_t cmd_size = sizeof(struct marshal_cmd_TexBuffer);
   30499    struct marshal_cmd_TexBuffer *cmd;
   30500    debug_print_marshal("TexBuffer");
   30501    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30502       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexBuffer, cmd_size);
   30503       cmd->target = target;
   30504       cmd->internalFormat = internalFormat;
   30505       cmd->buffer = buffer;
   30506       _mesa_post_marshal_hook(ctx);
   30507       return;
   30508    }
   30509 
   30510    _mesa_glthread_finish(ctx);
   30511    debug_print_sync_fallback("TexBuffer");
   30512    CALL_TexBuffer(ctx->CurrentServerDispatch, (target, internalFormat, buffer));
   30513 }
   30514 
   30515 
   30516 /* TexCoord4sv: marshalled asynchronously */
   30517 struct marshal_cmd_TexCoord4sv
   30518 {
   30519    struct marshal_cmd_base cmd_base;
   30520    GLshort v[4];
   30521 };
   30522 static inline void
   30523 _mesa_unmarshal_TexCoord4sv(struct gl_context *ctx, const struct marshal_cmd_TexCoord4sv *cmd)
   30524 {
   30525    const GLshort * v = cmd->v;
   30526    CALL_TexCoord4sv(ctx->CurrentServerDispatch, (v));
   30527 }
   30528 static void GLAPIENTRY
   30529 _mesa_marshal_TexCoord4sv(const GLshort * v)
   30530 {
   30531    GET_CURRENT_CONTEXT(ctx);
   30532    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord4sv);
   30533    struct marshal_cmd_TexCoord4sv *cmd;
   30534    debug_print_marshal("TexCoord4sv");
   30535    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30536       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord4sv, cmd_size);
   30537       memcpy(cmd->v, v, 8);
   30538       _mesa_post_marshal_hook(ctx);
   30539       return;
   30540    }
   30541 
   30542    _mesa_glthread_finish(ctx);
   30543    debug_print_sync_fallback("TexCoord4sv");
   30544    CALL_TexCoord4sv(ctx->CurrentServerDispatch, (v));
   30545 }
   30546 
   30547 
   30548 /* TexCoord1f: marshalled asynchronously */
   30549 struct marshal_cmd_TexCoord1f
   30550 {
   30551    struct marshal_cmd_base cmd_base;
   30552    GLfloat s;
   30553 };
   30554 static inline void
   30555 _mesa_unmarshal_TexCoord1f(struct gl_context *ctx, const struct marshal_cmd_TexCoord1f *cmd)
   30556 {
   30557    const GLfloat s = cmd->s;
   30558    CALL_TexCoord1f(ctx->CurrentServerDispatch, (s));
   30559 }
   30560 static void GLAPIENTRY
   30561 _mesa_marshal_TexCoord1f(GLfloat s)
   30562 {
   30563    GET_CURRENT_CONTEXT(ctx);
   30564    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord1f);
   30565    struct marshal_cmd_TexCoord1f *cmd;
   30566    debug_print_marshal("TexCoord1f");
   30567    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30568       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord1f, cmd_size);
   30569       cmd->s = s;
   30570       _mesa_post_marshal_hook(ctx);
   30571       return;
   30572    }
   30573 
   30574    _mesa_glthread_finish(ctx);
   30575    debug_print_sync_fallback("TexCoord1f");
   30576    CALL_TexCoord1f(ctx->CurrentServerDispatch, (s));
   30577 }
   30578 
   30579 
   30580 /* TexCoord1d: marshalled asynchronously */
   30581 struct marshal_cmd_TexCoord1d
   30582 {
   30583    struct marshal_cmd_base cmd_base;
   30584    GLdouble s;
   30585 };
   30586 static inline void
   30587 _mesa_unmarshal_TexCoord1d(struct gl_context *ctx, const struct marshal_cmd_TexCoord1d *cmd)
   30588 {
   30589    const GLdouble s = cmd->s;
   30590    CALL_TexCoord1d(ctx->CurrentServerDispatch, (s));
   30591 }
   30592 static void GLAPIENTRY
   30593 _mesa_marshal_TexCoord1d(GLdouble s)
   30594 {
   30595    GET_CURRENT_CONTEXT(ctx);
   30596    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord1d);
   30597    struct marshal_cmd_TexCoord1d *cmd;
   30598    debug_print_marshal("TexCoord1d");
   30599    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30600       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord1d, cmd_size);
   30601       cmd->s = s;
   30602       _mesa_post_marshal_hook(ctx);
   30603       return;
   30604    }
   30605 
   30606    _mesa_glthread_finish(ctx);
   30607    debug_print_sync_fallback("TexCoord1d");
   30608    CALL_TexCoord1d(ctx->CurrentServerDispatch, (s));
   30609 }
   30610 
   30611 
   30612 /* TexCoord1i: marshalled asynchronously */
   30613 struct marshal_cmd_TexCoord1i
   30614 {
   30615    struct marshal_cmd_base cmd_base;
   30616    GLint s;
   30617 };
   30618 static inline void
   30619 _mesa_unmarshal_TexCoord1i(struct gl_context *ctx, const struct marshal_cmd_TexCoord1i *cmd)
   30620 {
   30621    const GLint s = cmd->s;
   30622    CALL_TexCoord1i(ctx->CurrentServerDispatch, (s));
   30623 }
   30624 static void GLAPIENTRY
   30625 _mesa_marshal_TexCoord1i(GLint s)
   30626 {
   30627    GET_CURRENT_CONTEXT(ctx);
   30628    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord1i);
   30629    struct marshal_cmd_TexCoord1i *cmd;
   30630    debug_print_marshal("TexCoord1i");
   30631    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30632       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord1i, cmd_size);
   30633       cmd->s = s;
   30634       _mesa_post_marshal_hook(ctx);
   30635       return;
   30636    }
   30637 
   30638    _mesa_glthread_finish(ctx);
   30639    debug_print_sync_fallback("TexCoord1i");
   30640    CALL_TexCoord1i(ctx->CurrentServerDispatch, (s));
   30641 }
   30642 
   30643 
   30644 /* GetnUniformfvARB: marshalled synchronously */
   30645 static void GLAPIENTRY
   30646 _mesa_marshal_GetnUniformfvARB(GLuint program, GLint location, GLsizei bufSize, GLfloat * params)
   30647 {
   30648    GET_CURRENT_CONTEXT(ctx);
   30649    _mesa_glthread_finish(ctx);
   30650    debug_print_sync("GetnUniformfvARB");
   30651    CALL_GetnUniformfvARB(ctx->CurrentServerDispatch, (program, location, bufSize, params));
   30652 }
   30653 
   30654 
   30655 /* TexCoord1s: marshalled asynchronously */
   30656 struct marshal_cmd_TexCoord1s
   30657 {
   30658    struct marshal_cmd_base cmd_base;
   30659    GLshort s;
   30660 };
   30661 static inline void
   30662 _mesa_unmarshal_TexCoord1s(struct gl_context *ctx, const struct marshal_cmd_TexCoord1s *cmd)
   30663 {
   30664    const GLshort s = cmd->s;
   30665    CALL_TexCoord1s(ctx->CurrentServerDispatch, (s));
   30666 }
   30667 static void GLAPIENTRY
   30668 _mesa_marshal_TexCoord1s(GLshort s)
   30669 {
   30670    GET_CURRENT_CONTEXT(ctx);
   30671    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord1s);
   30672    struct marshal_cmd_TexCoord1s *cmd;
   30673    debug_print_marshal("TexCoord1s");
   30674    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30675       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord1s, cmd_size);
   30676       cmd->s = s;
   30677       _mesa_post_marshal_hook(ctx);
   30678       return;
   30679    }
   30680 
   30681    _mesa_glthread_finish(ctx);
   30682    debug_print_sync_fallback("TexCoord1s");
   30683    CALL_TexCoord1s(ctx->CurrentServerDispatch, (s));
   30684 }
   30685 
   30686 
   30687 /* Uniform1ui: marshalled asynchronously */
   30688 struct marshal_cmd_Uniform1ui
   30689 {
   30690    struct marshal_cmd_base cmd_base;
   30691    GLint location;
   30692    GLuint x;
   30693 };
   30694 static inline void
   30695 _mesa_unmarshal_Uniform1ui(struct gl_context *ctx, const struct marshal_cmd_Uniform1ui *cmd)
   30696 {
   30697    const GLint location = cmd->location;
   30698    const GLuint x = cmd->x;
   30699    CALL_Uniform1ui(ctx->CurrentServerDispatch, (location, x));
   30700 }
   30701 static void GLAPIENTRY
   30702 _mesa_marshal_Uniform1ui(GLint location, GLuint x)
   30703 {
   30704    GET_CURRENT_CONTEXT(ctx);
   30705    size_t cmd_size = sizeof(struct marshal_cmd_Uniform1ui);
   30706    struct marshal_cmd_Uniform1ui *cmd;
   30707    debug_print_marshal("Uniform1ui");
   30708    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30709       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1ui, cmd_size);
   30710       cmd->location = location;
   30711       cmd->x = x;
   30712       _mesa_post_marshal_hook(ctx);
   30713       return;
   30714    }
   30715 
   30716    _mesa_glthread_finish(ctx);
   30717    debug_print_sync_fallback("Uniform1ui");
   30718    CALL_Uniform1ui(ctx->CurrentServerDispatch, (location, x));
   30719 }
   30720 
   30721 
   30722 /* TexStorage1D: marshalled asynchronously */
   30723 struct marshal_cmd_TexStorage1D
   30724 {
   30725    struct marshal_cmd_base cmd_base;
   30726    GLenum target;
   30727    GLsizei levels;
   30728    GLenum internalFormat;
   30729    GLsizei width;
   30730 };
   30731 static inline void
   30732 _mesa_unmarshal_TexStorage1D(struct gl_context *ctx, const struct marshal_cmd_TexStorage1D *cmd)
   30733 {
   30734    const GLenum target = cmd->target;
   30735    const GLsizei levels = cmd->levels;
   30736    const GLenum internalFormat = cmd->internalFormat;
   30737    const GLsizei width = cmd->width;
   30738    CALL_TexStorage1D(ctx->CurrentServerDispatch, (target, levels, internalFormat, width));
   30739 }
   30740 static void GLAPIENTRY
   30741 _mesa_marshal_TexStorage1D(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width)
   30742 {
   30743    GET_CURRENT_CONTEXT(ctx);
   30744    size_t cmd_size = sizeof(struct marshal_cmd_TexStorage1D);
   30745    struct marshal_cmd_TexStorage1D *cmd;
   30746    debug_print_marshal("TexStorage1D");
   30747    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30748       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorage1D, cmd_size);
   30749       cmd->target = target;
   30750       cmd->levels = levels;
   30751       cmd->internalFormat = internalFormat;
   30752       cmd->width = width;
   30753       _mesa_post_marshal_hook(ctx);
   30754       return;
   30755    }
   30756 
   30757    _mesa_glthread_finish(ctx);
   30758    debug_print_sync_fallback("TexStorage1D");
   30759    CALL_TexStorage1D(ctx->CurrentServerDispatch, (target, levels, internalFormat, width));
   30760 }
   30761 
   30762 
   30763 /* BlitFramebuffer: marshalled asynchronously */
   30764 struct marshal_cmd_BlitFramebuffer
   30765 {
   30766    struct marshal_cmd_base cmd_base;
   30767    GLint srcX0;
   30768    GLint srcY0;
   30769    GLint srcX1;
   30770    GLint srcY1;
   30771    GLint dstX0;
   30772    GLint dstY0;
   30773    GLint dstX1;
   30774    GLint dstY1;
   30775    GLbitfield mask;
   30776    GLenum filter;
   30777 };
   30778 static inline void
   30779 _mesa_unmarshal_BlitFramebuffer(struct gl_context *ctx, const struct marshal_cmd_BlitFramebuffer *cmd)
   30780 {
   30781    const GLint srcX0 = cmd->srcX0;
   30782    const GLint srcY0 = cmd->srcY0;
   30783    const GLint srcX1 = cmd->srcX1;
   30784    const GLint srcY1 = cmd->srcY1;
   30785    const GLint dstX0 = cmd->dstX0;
   30786    const GLint dstY0 = cmd->dstY0;
   30787    const GLint dstX1 = cmd->dstX1;
   30788    const GLint dstY1 = cmd->dstY1;
   30789    const GLbitfield mask = cmd->mask;
   30790    const GLenum filter = cmd->filter;
   30791    CALL_BlitFramebuffer(ctx->CurrentServerDispatch, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
   30792 }
   30793 static void GLAPIENTRY
   30794 _mesa_marshal_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
   30795 {
   30796    GET_CURRENT_CONTEXT(ctx);
   30797    size_t cmd_size = sizeof(struct marshal_cmd_BlitFramebuffer);
   30798    struct marshal_cmd_BlitFramebuffer *cmd;
   30799    debug_print_marshal("BlitFramebuffer");
   30800    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30801       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlitFramebuffer, cmd_size);
   30802       cmd->srcX0 = srcX0;
   30803       cmd->srcY0 = srcY0;
   30804       cmd->srcX1 = srcX1;
   30805       cmd->srcY1 = srcY1;
   30806       cmd->dstX0 = dstX0;
   30807       cmd->dstY0 = dstY0;
   30808       cmd->dstX1 = dstX1;
   30809       cmd->dstY1 = dstY1;
   30810       cmd->mask = mask;
   30811       cmd->filter = filter;
   30812       _mesa_post_marshal_hook(ctx);
   30813       return;
   30814    }
   30815 
   30816    _mesa_glthread_finish(ctx);
   30817    debug_print_sync_fallback("BlitFramebuffer");
   30818    CALL_BlitFramebuffer(ctx->CurrentServerDispatch, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
   30819 }
   30820 
   30821 
   30822 /* TextureParameterf: marshalled asynchronously */
   30823 struct marshal_cmd_TextureParameterf
   30824 {
   30825    struct marshal_cmd_base cmd_base;
   30826    GLuint texture;
   30827    GLenum pname;
   30828    GLfloat param;
   30829 };
   30830 static inline void
   30831 _mesa_unmarshal_TextureParameterf(struct gl_context *ctx, const struct marshal_cmd_TextureParameterf *cmd)
   30832 {
   30833    const GLuint texture = cmd->texture;
   30834    const GLenum pname = cmd->pname;
   30835    const GLfloat param = cmd->param;
   30836    CALL_TextureParameterf(ctx->CurrentServerDispatch, (texture, pname, param));
   30837 }
   30838 static void GLAPIENTRY
   30839 _mesa_marshal_TextureParameterf(GLuint texture, GLenum pname, GLfloat param)
   30840 {
   30841    GET_CURRENT_CONTEXT(ctx);
   30842    size_t cmd_size = sizeof(struct marshal_cmd_TextureParameterf);
   30843    struct marshal_cmd_TextureParameterf *cmd;
   30844    debug_print_marshal("TextureParameterf");
   30845    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30846       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureParameterf, cmd_size);
   30847       cmd->texture = texture;
   30848       cmd->pname = pname;
   30849       cmd->param = param;
   30850       _mesa_post_marshal_hook(ctx);
   30851       return;
   30852    }
   30853 
   30854    _mesa_glthread_finish(ctx);
   30855    debug_print_sync_fallback("TextureParameterf");
   30856    CALL_TextureParameterf(ctx->CurrentServerDispatch, (texture, pname, param));
   30857 }
   30858 
   30859 
   30860 /* FramebufferTexture1D: marshalled asynchronously */
   30861 struct marshal_cmd_FramebufferTexture1D
   30862 {
   30863    struct marshal_cmd_base cmd_base;
   30864    GLenum target;
   30865    GLenum attachment;
   30866    GLenum textarget;
   30867    GLuint texture;
   30868    GLint level;
   30869 };
   30870 static inline void
   30871 _mesa_unmarshal_FramebufferTexture1D(struct gl_context *ctx, const struct marshal_cmd_FramebufferTexture1D *cmd)
   30872 {
   30873    const GLenum target = cmd->target;
   30874    const GLenum attachment = cmd->attachment;
   30875    const GLenum textarget = cmd->textarget;
   30876    const GLuint texture = cmd->texture;
   30877    const GLint level = cmd->level;
   30878    CALL_FramebufferTexture1D(ctx->CurrentServerDispatch, (target, attachment, textarget, texture, level));
   30879 }
   30880 static void GLAPIENTRY
   30881 _mesa_marshal_FramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
   30882 {
   30883    GET_CURRENT_CONTEXT(ctx);
   30884    size_t cmd_size = sizeof(struct marshal_cmd_FramebufferTexture1D);
   30885    struct marshal_cmd_FramebufferTexture1D *cmd;
   30886    debug_print_marshal("FramebufferTexture1D");
   30887    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30888       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferTexture1D, cmd_size);
   30889       cmd->target = target;
   30890       cmd->attachment = attachment;
   30891       cmd->textarget = textarget;
   30892       cmd->texture = texture;
   30893       cmd->level = level;
   30894       _mesa_post_marshal_hook(ctx);
   30895       return;
   30896    }
   30897 
   30898    _mesa_glthread_finish(ctx);
   30899    debug_print_sync_fallback("FramebufferTexture1D");
   30900    CALL_FramebufferTexture1D(ctx->CurrentServerDispatch, (target, attachment, textarget, texture, level));
   30901 }
   30902 
   30903 
   30904 /* TextureParameteri: marshalled asynchronously */
   30905 struct marshal_cmd_TextureParameteri
   30906 {
   30907    struct marshal_cmd_base cmd_base;
   30908    GLuint texture;
   30909    GLenum pname;
   30910    GLint param;
   30911 };
   30912 static inline void
   30913 _mesa_unmarshal_TextureParameteri(struct gl_context *ctx, const struct marshal_cmd_TextureParameteri *cmd)
   30914 {
   30915    const GLuint texture = cmd->texture;
   30916    const GLenum pname = cmd->pname;
   30917    const GLint param = cmd->param;
   30918    CALL_TextureParameteri(ctx->CurrentServerDispatch, (texture, pname, param));
   30919 }
   30920 static void GLAPIENTRY
   30921 _mesa_marshal_TextureParameteri(GLuint texture, GLenum pname, GLint param)
   30922 {
   30923    GET_CURRENT_CONTEXT(ctx);
   30924    size_t cmd_size = sizeof(struct marshal_cmd_TextureParameteri);
   30925    struct marshal_cmd_TextureParameteri *cmd;
   30926    debug_print_marshal("TextureParameteri");
   30927    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30928       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureParameteri, cmd_size);
   30929       cmd->texture = texture;
   30930       cmd->pname = pname;
   30931       cmd->param = param;
   30932       _mesa_post_marshal_hook(ctx);
   30933       return;
   30934    }
   30935 
   30936    _mesa_glthread_finish(ctx);
   30937    debug_print_sync_fallback("TextureParameteri");
   30938    CALL_TextureParameteri(ctx->CurrentServerDispatch, (texture, pname, param));
   30939 }
   30940 
   30941 
   30942 /* GetMapiv: marshalled synchronously */
   30943 static void GLAPIENTRY
   30944 _mesa_marshal_GetMapiv(GLenum target, GLenum query, GLint * v)
   30945 {
   30946    GET_CURRENT_CONTEXT(ctx);
   30947    _mesa_glthread_finish(ctx);
   30948    debug_print_sync("GetMapiv");
   30949    CALL_GetMapiv(ctx->CurrentServerDispatch, (target, query, v));
   30950 }
   30951 
   30952 
   30953 /* GetUniformui64vARB: marshalled synchronously */
   30954 static void GLAPIENTRY
   30955 _mesa_marshal_GetUniformui64vARB(GLuint program, GLint location, GLuint64 * params)
   30956 {
   30957    GET_CURRENT_CONTEXT(ctx);
   30958    _mesa_glthread_finish(ctx);
   30959    debug_print_sync("GetUniformui64vARB");
   30960    CALL_GetUniformui64vARB(ctx->CurrentServerDispatch, (program, location, params));
   30961 }
   30962 
   30963 
   30964 /* TexCoordP4ui: marshalled asynchronously */
   30965 struct marshal_cmd_TexCoordP4ui
   30966 {
   30967    struct marshal_cmd_base cmd_base;
   30968    GLenum type;
   30969    GLuint coords;
   30970 };
   30971 static inline void
   30972 _mesa_unmarshal_TexCoordP4ui(struct gl_context *ctx, const struct marshal_cmd_TexCoordP4ui *cmd)
   30973 {
   30974    const GLenum type = cmd->type;
   30975    const GLuint coords = cmd->coords;
   30976    CALL_TexCoordP4ui(ctx->CurrentServerDispatch, (type, coords));
   30977 }
   30978 static void GLAPIENTRY
   30979 _mesa_marshal_TexCoordP4ui(GLenum type, GLuint coords)
   30980 {
   30981    GET_CURRENT_CONTEXT(ctx);
   30982    size_t cmd_size = sizeof(struct marshal_cmd_TexCoordP4ui);
   30983    struct marshal_cmd_TexCoordP4ui *cmd;
   30984    debug_print_marshal("TexCoordP4ui");
   30985    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   30986       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP4ui, cmd_size);
   30987       cmd->type = type;
   30988       cmd->coords = coords;
   30989       _mesa_post_marshal_hook(ctx);
   30990       return;
   30991    }
   30992 
   30993    _mesa_glthread_finish(ctx);
   30994    debug_print_sync_fallback("TexCoordP4ui");
   30995    CALL_TexCoordP4ui(ctx->CurrentServerDispatch, (type, coords));
   30996 }
   30997 
   30998 
   30999 /* VertexAttrib1sv: marshalled asynchronously */
   31000 struct marshal_cmd_VertexAttrib1sv
   31001 {
   31002    struct marshal_cmd_base cmd_base;
   31003    GLuint index;
   31004    GLshort v[1];
   31005 };
   31006 static inline void
   31007 _mesa_unmarshal_VertexAttrib1sv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1sv *cmd)
   31008 {
   31009    const GLuint index = cmd->index;
   31010    const GLshort * v = cmd->v;
   31011    CALL_VertexAttrib1sv(ctx->CurrentServerDispatch, (index, v));
   31012 }
   31013 static void GLAPIENTRY
   31014 _mesa_marshal_VertexAttrib1sv(GLuint index, const GLshort * v)
   31015 {
   31016    GET_CURRENT_CONTEXT(ctx);
   31017    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib1sv);
   31018    struct marshal_cmd_VertexAttrib1sv *cmd;
   31019    debug_print_marshal("VertexAttrib1sv");
   31020    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31021       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1sv, cmd_size);
   31022       cmd->index = index;
   31023       memcpy(cmd->v, v, 2);
   31024       _mesa_post_marshal_hook(ctx);
   31025       return;
   31026    }
   31027 
   31028    _mesa_glthread_finish(ctx);
   31029    debug_print_sync_fallback("VertexAttrib1sv");
   31030    CALL_VertexAttrib1sv(ctx->CurrentServerDispatch, (index, v));
   31031 }
   31032 
   31033 
   31034 /* WindowPos4dMESA: marshalled asynchronously */
   31035 struct marshal_cmd_WindowPos4dMESA
   31036 {
   31037    struct marshal_cmd_base cmd_base;
   31038    GLdouble x;
   31039    GLdouble y;
   31040    GLdouble z;
   31041    GLdouble w;
   31042 };
   31043 static inline void
   31044 _mesa_unmarshal_WindowPos4dMESA(struct gl_context *ctx, const struct marshal_cmd_WindowPos4dMESA *cmd)
   31045 {
   31046    const GLdouble x = cmd->x;
   31047    const GLdouble y = cmd->y;
   31048    const GLdouble z = cmd->z;
   31049    const GLdouble w = cmd->w;
   31050    CALL_WindowPos4dMESA(ctx->CurrentServerDispatch, (x, y, z, w));
   31051 }
   31052 static void GLAPIENTRY
   31053 _mesa_marshal_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w)
   31054 {
   31055    GET_CURRENT_CONTEXT(ctx);
   31056    size_t cmd_size = sizeof(struct marshal_cmd_WindowPos4dMESA);
   31057    struct marshal_cmd_WindowPos4dMESA *cmd;
   31058    debug_print_marshal("WindowPos4dMESA");
   31059    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31060       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowPos4dMESA, cmd_size);
   31061       cmd->x = x;
   31062       cmd->y = y;
   31063       cmd->z = z;
   31064       cmd->w = w;
   31065       _mesa_post_marshal_hook(ctx);
   31066       return;
   31067    }
   31068 
   31069    _mesa_glthread_finish(ctx);
   31070    debug_print_sync_fallback("WindowPos4dMESA");
   31071    CALL_WindowPos4dMESA(ctx->CurrentServerDispatch, (x, y, z, w));
   31072 }
   31073 
   31074 
   31075 /* Vertex3dv: marshalled asynchronously */
   31076 struct marshal_cmd_Vertex3dv
   31077 {
   31078    struct marshal_cmd_base cmd_base;
   31079    GLdouble v[3];
   31080 };
   31081 static inline void
   31082 _mesa_unmarshal_Vertex3dv(struct gl_context *ctx, const struct marshal_cmd_Vertex3dv *cmd)
   31083 {
   31084    const GLdouble * v = cmd->v;
   31085    CALL_Vertex3dv(ctx->CurrentServerDispatch, (v));
   31086 }
   31087 static void GLAPIENTRY
   31088 _mesa_marshal_Vertex3dv(const GLdouble * v)
   31089 {
   31090    GET_CURRENT_CONTEXT(ctx);
   31091    size_t cmd_size = sizeof(struct marshal_cmd_Vertex3dv);
   31092    struct marshal_cmd_Vertex3dv *cmd;
   31093    debug_print_marshal("Vertex3dv");
   31094    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31095       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex3dv, cmd_size);
   31096       memcpy(cmd->v, v, 24);
   31097       _mesa_post_marshal_hook(ctx);
   31098       return;
   31099    }
   31100 
   31101    _mesa_glthread_finish(ctx);
   31102    debug_print_sync_fallback("Vertex3dv");
   31103    CALL_Vertex3dv(ctx->CurrentServerDispatch, (v));
   31104 }
   31105 
   31106 
   31107 /* VertexAttribL2d: marshalled asynchronously */
   31108 struct marshal_cmd_VertexAttribL2d
   31109 {
   31110    struct marshal_cmd_base cmd_base;
   31111    GLuint index;
   31112    GLdouble x;
   31113    GLdouble y;
   31114 };
   31115 static inline void
   31116 _mesa_unmarshal_VertexAttribL2d(struct gl_context *ctx, const struct marshal_cmd_VertexAttribL2d *cmd)
   31117 {
   31118    const GLuint index = cmd->index;
   31119    const GLdouble x = cmd->x;
   31120    const GLdouble y = cmd->y;
   31121    CALL_VertexAttribL2d(ctx->CurrentServerDispatch, (index, x, y));
   31122 }
   31123 static void GLAPIENTRY
   31124 _mesa_marshal_VertexAttribL2d(GLuint index, GLdouble x, GLdouble y)
   31125 {
   31126    GET_CURRENT_CONTEXT(ctx);
   31127    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribL2d);
   31128    struct marshal_cmd_VertexAttribL2d *cmd;
   31129    debug_print_marshal("VertexAttribL2d");
   31130    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31131       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribL2d, cmd_size);
   31132       cmd->index = index;
   31133       cmd->x = x;
   31134       cmd->y = y;
   31135       _mesa_post_marshal_hook(ctx);
   31136       return;
   31137    }
   31138 
   31139    _mesa_glthread_finish(ctx);
   31140    debug_print_sync_fallback("VertexAttribL2d");
   31141    CALL_VertexAttribL2d(ctx->CurrentServerDispatch, (index, x, y));
   31142 }
   31143 
   31144 
   31145 /* GetnMapivARB: marshalled synchronously */
   31146 static void GLAPIENTRY
   31147 _mesa_marshal_GetnMapivARB(GLenum target, GLenum query, GLsizei bufSize, GLint * v)
   31148 {
   31149    GET_CURRENT_CONTEXT(ctx);
   31150    _mesa_glthread_finish(ctx);
   31151    debug_print_sync("GetnMapivARB");
   31152    CALL_GetnMapivARB(ctx->CurrentServerDispatch, (target, query, bufSize, v));
   31153 }
   31154 
   31155 
   31156 /* GetVertexAttribfv: marshalled synchronously */
   31157 static void GLAPIENTRY
   31158 _mesa_marshal_GetVertexAttribfv(GLuint index, GLenum pname, GLfloat * params)
   31159 {
   31160    GET_CURRENT_CONTEXT(ctx);
   31161    _mesa_glthread_finish(ctx);
   31162    debug_print_sync("GetVertexAttribfv");
   31163    CALL_GetVertexAttribfv(ctx->CurrentServerDispatch, (index, pname, params));
   31164 }
   31165 
   31166 
   31167 /* MultiTexCoordP4uiv: marshalled synchronously */
   31168 static void GLAPIENTRY
   31169 _mesa_marshal_MultiTexCoordP4uiv(GLenum texture, GLenum type, const GLuint * coords)
   31170 {
   31171    GET_CURRENT_CONTEXT(ctx);
   31172    _mesa_glthread_finish(ctx);
   31173    debug_print_sync("MultiTexCoordP4uiv");
   31174    CALL_MultiTexCoordP4uiv(ctx->CurrentServerDispatch, (texture, type, coords));
   31175 }
   31176 
   31177 
   31178 /* TexGeniv: marshalled synchronously */
   31179 static void GLAPIENTRY
   31180 _mesa_marshal_TexGeniv(GLenum coord, GLenum pname, const GLint * params)
   31181 {
   31182    GET_CURRENT_CONTEXT(ctx);
   31183    _mesa_glthread_finish(ctx);
   31184    debug_print_sync("TexGeniv");
   31185    CALL_TexGeniv(ctx->CurrentServerDispatch, (coord, pname, params));
   31186 }
   31187 
   31188 
   31189 /* IsMemoryObjectEXT: marshalled synchronously */
   31190 static GLboolean GLAPIENTRY
   31191 _mesa_marshal_IsMemoryObjectEXT(GLuint memoryObject)
   31192 {
   31193    GET_CURRENT_CONTEXT(ctx);
   31194    _mesa_glthread_finish(ctx);
   31195    debug_print_sync("IsMemoryObjectEXT");
   31196    return CALL_IsMemoryObjectEXT(ctx->CurrentServerDispatch, (memoryObject));
   31197 }
   31198 
   31199 
   31200 /* BlendColor: marshalled asynchronously */
   31201 struct marshal_cmd_BlendColor
   31202 {
   31203    struct marshal_cmd_base cmd_base;
   31204    GLclampf red;
   31205    GLclampf green;
   31206    GLclampf blue;
   31207    GLclampf alpha;
   31208 };
   31209 static inline void
   31210 _mesa_unmarshal_BlendColor(struct gl_context *ctx, const struct marshal_cmd_BlendColor *cmd)
   31211 {
   31212    const GLclampf red = cmd->red;
   31213    const GLclampf green = cmd->green;
   31214    const GLclampf blue = cmd->blue;
   31215    const GLclampf alpha = cmd->alpha;
   31216    CALL_BlendColor(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   31217 }
   31218 static void GLAPIENTRY
   31219 _mesa_marshal_BlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
   31220 {
   31221    GET_CURRENT_CONTEXT(ctx);
   31222    size_t cmd_size = sizeof(struct marshal_cmd_BlendColor);
   31223    struct marshal_cmd_BlendColor *cmd;
   31224    debug_print_marshal("BlendColor");
   31225    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31226       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendColor, cmd_size);
   31227       cmd->red = red;
   31228       cmd->green = green;
   31229       cmd->blue = blue;
   31230       cmd->alpha = alpha;
   31231       _mesa_post_marshal_hook(ctx);
   31232       return;
   31233    }
   31234 
   31235    _mesa_glthread_finish(ctx);
   31236    debug_print_sync_fallback("BlendColor");
   31237    CALL_BlendColor(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   31238 }
   31239 
   31240 
   31241 /* VertexAttribs2dvNV: marshalled asynchronously */
   31242 struct marshal_cmd_VertexAttribs2dvNV
   31243 {
   31244    struct marshal_cmd_base cmd_base;
   31245    GLuint index;
   31246    GLsizei n;
   31247    /* Next safe_mul(n, 16) bytes are GLdouble v[n][2] */
   31248 };
   31249 static inline void
   31250 _mesa_unmarshal_VertexAttribs2dvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs2dvNV *cmd)
   31251 {
   31252    const GLuint index = cmd->index;
   31253    const GLsizei n = cmd->n;
   31254    const GLdouble * v;
   31255    const char *variable_data = (const char *) (cmd + 1);
   31256    v = (const GLdouble *) variable_data;
   31257    variable_data += n * 16;
   31258    CALL_VertexAttribs2dvNV(ctx->CurrentServerDispatch, (index, n, v));
   31259 }
   31260 static void GLAPIENTRY
   31261 _mesa_marshal_VertexAttribs2dvNV(GLuint index, GLsizei n, const GLdouble * v)
   31262 {
   31263    GET_CURRENT_CONTEXT(ctx);
   31264    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribs2dvNV) + safe_mul(n, 16);
   31265    struct marshal_cmd_VertexAttribs2dvNV *cmd;
   31266    debug_print_marshal("VertexAttribs2dvNV");
   31267    if (unlikely(safe_mul(n, 16) < 0)) {
   31268       goto fallback_to_sync;
   31269    }
   31270    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31271       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs2dvNV, cmd_size);
   31272       cmd->index = index;
   31273       cmd->n = n;
   31274       char *variable_data = (char *) (cmd + 1);
   31275       memcpy(variable_data, v, n * 16);
   31276       variable_data += n * 16;
   31277       _mesa_post_marshal_hook(ctx);
   31278       return;
   31279    }
   31280 
   31281 fallback_to_sync:
   31282    _mesa_glthread_finish(ctx);
   31283    debug_print_sync_fallback("VertexAttribs2dvNV");
   31284    CALL_VertexAttribs2dvNV(ctx->CurrentServerDispatch, (index, n, v));
   31285 }
   31286 
   31287 
   31288 /* VertexAttrib2dvNV: marshalled asynchronously */
   31289 struct marshal_cmd_VertexAttrib2dvNV
   31290 {
   31291    struct marshal_cmd_base cmd_base;
   31292    GLuint index;
   31293    GLdouble v[2];
   31294 };
   31295 static inline void
   31296 _mesa_unmarshal_VertexAttrib2dvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2dvNV *cmd)
   31297 {
   31298    const GLuint index = cmd->index;
   31299    const GLdouble * v = cmd->v;
   31300    CALL_VertexAttrib2dvNV(ctx->CurrentServerDispatch, (index, v));
   31301 }
   31302 static void GLAPIENTRY
   31303 _mesa_marshal_VertexAttrib2dvNV(GLuint index, const GLdouble * v)
   31304 {
   31305    GET_CURRENT_CONTEXT(ctx);
   31306    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib2dvNV);
   31307    struct marshal_cmd_VertexAttrib2dvNV *cmd;
   31308    debug_print_marshal("VertexAttrib2dvNV");
   31309    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31310       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2dvNV, cmd_size);
   31311       cmd->index = index;
   31312       memcpy(cmd->v, v, 16);
   31313       _mesa_post_marshal_hook(ctx);
   31314       return;
   31315    }
   31316 
   31317    _mesa_glthread_finish(ctx);
   31318    debug_print_sync_fallback("VertexAttrib2dvNV");
   31319    CALL_VertexAttrib2dvNV(ctx->CurrentServerDispatch, (index, v));
   31320 }
   31321 
   31322 
   31323 /* NamedFramebufferDrawBuffers: marshalled synchronously */
   31324 static void GLAPIENTRY
   31325 _mesa_marshal_NamedFramebufferDrawBuffers(GLuint framebuffer, GLsizei n, const GLenum * bufs)
   31326 {
   31327    GET_CURRENT_CONTEXT(ctx);
   31328    _mesa_glthread_finish(ctx);
   31329    debug_print_sync("NamedFramebufferDrawBuffers");
   31330    CALL_NamedFramebufferDrawBuffers(ctx->CurrentServerDispatch, (framebuffer, n, bufs));
   31331 }
   31332 
   31333 
   31334 /* ResetHistogram: marshalled asynchronously */
   31335 struct marshal_cmd_ResetHistogram
   31336 {
   31337    struct marshal_cmd_base cmd_base;
   31338    GLenum target;
   31339 };
   31340 static inline void
   31341 _mesa_unmarshal_ResetHistogram(struct gl_context *ctx, const struct marshal_cmd_ResetHistogram *cmd)
   31342 {
   31343    const GLenum target = cmd->target;
   31344    CALL_ResetHistogram(ctx->CurrentServerDispatch, (target));
   31345 }
   31346 static void GLAPIENTRY
   31347 _mesa_marshal_ResetHistogram(GLenum target)
   31348 {
   31349    GET_CURRENT_CONTEXT(ctx);
   31350    size_t cmd_size = sizeof(struct marshal_cmd_ResetHistogram);
   31351    struct marshal_cmd_ResetHistogram *cmd;
   31352    debug_print_marshal("ResetHistogram");
   31353    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31354       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ResetHistogram, cmd_size);
   31355       cmd->target = target;
   31356       _mesa_post_marshal_hook(ctx);
   31357       return;
   31358    }
   31359 
   31360    _mesa_glthread_finish(ctx);
   31361    debug_print_sync_fallback("ResetHistogram");
   31362    CALL_ResetHistogram(ctx->CurrentServerDispatch, (target));
   31363 }
   31364 
   31365 
   31366 /* CompressedTexSubImage2D: marshalled synchronously */
   31367 static void GLAPIENTRY
   31368 _mesa_marshal_CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data)
   31369 {
   31370    GET_CURRENT_CONTEXT(ctx);
   31371    _mesa_glthread_finish(ctx);
   31372    debug_print_sync("CompressedTexSubImage2D");
   31373    CALL_CompressedTexSubImage2D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, width, height, format, imageSize, data));
   31374 }
   31375 
   31376 
   31377 /* TexCoord2sv: marshalled asynchronously */
   31378 struct marshal_cmd_TexCoord2sv
   31379 {
   31380    struct marshal_cmd_base cmd_base;
   31381    GLshort v[2];
   31382 };
   31383 static inline void
   31384 _mesa_unmarshal_TexCoord2sv(struct gl_context *ctx, const struct marshal_cmd_TexCoord2sv *cmd)
   31385 {
   31386    const GLshort * v = cmd->v;
   31387    CALL_TexCoord2sv(ctx->CurrentServerDispatch, (v));
   31388 }
   31389 static void GLAPIENTRY
   31390 _mesa_marshal_TexCoord2sv(const GLshort * v)
   31391 {
   31392    GET_CURRENT_CONTEXT(ctx);
   31393    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord2sv);
   31394    struct marshal_cmd_TexCoord2sv *cmd;
   31395    debug_print_marshal("TexCoord2sv");
   31396    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31397       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord2sv, cmd_size);
   31398       memcpy(cmd->v, v, 4);
   31399       _mesa_post_marshal_hook(ctx);
   31400       return;
   31401    }
   31402 
   31403    _mesa_glthread_finish(ctx);
   31404    debug_print_sync_fallback("TexCoord2sv");
   31405    CALL_TexCoord2sv(ctx->CurrentServerDispatch, (v));
   31406 }
   31407 
   31408 
   31409 /* StencilMaskSeparate: marshalled asynchronously */
   31410 struct marshal_cmd_StencilMaskSeparate
   31411 {
   31412    struct marshal_cmd_base cmd_base;
   31413    GLenum face;
   31414    GLuint mask;
   31415 };
   31416 static inline void
   31417 _mesa_unmarshal_StencilMaskSeparate(struct gl_context *ctx, const struct marshal_cmd_StencilMaskSeparate *cmd)
   31418 {
   31419    const GLenum face = cmd->face;
   31420    const GLuint mask = cmd->mask;
   31421    CALL_StencilMaskSeparate(ctx->CurrentServerDispatch, (face, mask));
   31422 }
   31423 static void GLAPIENTRY
   31424 _mesa_marshal_StencilMaskSeparate(GLenum face, GLuint mask)
   31425 {
   31426    GET_CURRENT_CONTEXT(ctx);
   31427    size_t cmd_size = sizeof(struct marshal_cmd_StencilMaskSeparate);
   31428    struct marshal_cmd_StencilMaskSeparate *cmd;
   31429    debug_print_marshal("StencilMaskSeparate");
   31430    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31431       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_StencilMaskSeparate, cmd_size);
   31432       cmd->face = face;
   31433       cmd->mask = mask;
   31434       _mesa_post_marshal_hook(ctx);
   31435       return;
   31436    }
   31437 
   31438    _mesa_glthread_finish(ctx);
   31439    debug_print_sync_fallback("StencilMaskSeparate");
   31440    CALL_StencilMaskSeparate(ctx->CurrentServerDispatch, (face, mask));
   31441 }
   31442 
   31443 
   31444 /* MultiTexCoord3sv: marshalled asynchronously */
   31445 struct marshal_cmd_MultiTexCoord3sv
   31446 {
   31447    struct marshal_cmd_base cmd_base;
   31448    GLenum target;
   31449    GLshort v[3];
   31450 };
   31451 static inline void
   31452 _mesa_unmarshal_MultiTexCoord3sv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3sv *cmd)
   31453 {
   31454    const GLenum target = cmd->target;
   31455    const GLshort * v = cmd->v;
   31456    CALL_MultiTexCoord3sv(ctx->CurrentServerDispatch, (target, v));
   31457 }
   31458 static void GLAPIENTRY
   31459 _mesa_marshal_MultiTexCoord3sv(GLenum target, const GLshort * v)
   31460 {
   31461    GET_CURRENT_CONTEXT(ctx);
   31462    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3sv);
   31463    struct marshal_cmd_MultiTexCoord3sv *cmd;
   31464    debug_print_marshal("MultiTexCoord3sv");
   31465    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31466       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3sv, cmd_size);
   31467       cmd->target = target;
   31468       memcpy(cmd->v, v, 6);
   31469       _mesa_post_marshal_hook(ctx);
   31470       return;
   31471    }
   31472 
   31473    _mesa_glthread_finish(ctx);
   31474    debug_print_sync_fallback("MultiTexCoord3sv");
   31475    CALL_MultiTexCoord3sv(ctx->CurrentServerDispatch, (target, v));
   31476 }
   31477 
   31478 
   31479 /* TexCoord3iv: marshalled asynchronously */
   31480 struct marshal_cmd_TexCoord3iv
   31481 {
   31482    struct marshal_cmd_base cmd_base;
   31483    GLint v[3];
   31484 };
   31485 static inline void
   31486 _mesa_unmarshal_TexCoord3iv(struct gl_context *ctx, const struct marshal_cmd_TexCoord3iv *cmd)
   31487 {
   31488    const GLint * v = cmd->v;
   31489    CALL_TexCoord3iv(ctx->CurrentServerDispatch, (v));
   31490 }
   31491 static void GLAPIENTRY
   31492 _mesa_marshal_TexCoord3iv(const GLint * v)
   31493 {
   31494    GET_CURRENT_CONTEXT(ctx);
   31495    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord3iv);
   31496    struct marshal_cmd_TexCoord3iv *cmd;
   31497    debug_print_marshal("TexCoord3iv");
   31498    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31499       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord3iv, cmd_size);
   31500       memcpy(cmd->v, v, 12);
   31501       _mesa_post_marshal_hook(ctx);
   31502       return;
   31503    }
   31504 
   31505    _mesa_glthread_finish(ctx);
   31506    debug_print_sync_fallback("TexCoord3iv");
   31507    CALL_TexCoord3iv(ctx->CurrentServerDispatch, (v));
   31508 }
   31509 
   31510 
   31511 /* MultiTexCoord4sv: marshalled asynchronously */
   31512 struct marshal_cmd_MultiTexCoord4sv
   31513 {
   31514    struct marshal_cmd_base cmd_base;
   31515    GLenum target;
   31516    GLshort v[4];
   31517 };
   31518 static inline void
   31519 _mesa_unmarshal_MultiTexCoord4sv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4sv *cmd)
   31520 {
   31521    const GLenum target = cmd->target;
   31522    const GLshort * v = cmd->v;
   31523    CALL_MultiTexCoord4sv(ctx->CurrentServerDispatch, (target, v));
   31524 }
   31525 static void GLAPIENTRY
   31526 _mesa_marshal_MultiTexCoord4sv(GLenum target, const GLshort * v)
   31527 {
   31528    GET_CURRENT_CONTEXT(ctx);
   31529    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4sv);
   31530    struct marshal_cmd_MultiTexCoord4sv *cmd;
   31531    debug_print_marshal("MultiTexCoord4sv");
   31532    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31533       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4sv, cmd_size);
   31534       cmd->target = target;
   31535       memcpy(cmd->v, v, 8);
   31536       _mesa_post_marshal_hook(ctx);
   31537       return;
   31538    }
   31539 
   31540    _mesa_glthread_finish(ctx);
   31541    debug_print_sync_fallback("MultiTexCoord4sv");
   31542    CALL_MultiTexCoord4sv(ctx->CurrentServerDispatch, (target, v));
   31543 }
   31544 
   31545 
   31546 /* VertexBindingDivisor: marshalled asynchronously */
   31547 struct marshal_cmd_VertexBindingDivisor
   31548 {
   31549    struct marshal_cmd_base cmd_base;
   31550    GLuint attribindex;
   31551    GLuint divisor;
   31552 };
   31553 static inline void
   31554 _mesa_unmarshal_VertexBindingDivisor(struct gl_context *ctx, const struct marshal_cmd_VertexBindingDivisor *cmd)
   31555 {
   31556    const GLuint attribindex = cmd->attribindex;
   31557    const GLuint divisor = cmd->divisor;
   31558    CALL_VertexBindingDivisor(ctx->CurrentServerDispatch, (attribindex, divisor));
   31559 }
   31560 static void GLAPIENTRY
   31561 _mesa_marshal_VertexBindingDivisor(GLuint attribindex, GLuint divisor)
   31562 {
   31563    GET_CURRENT_CONTEXT(ctx);
   31564    size_t cmd_size = sizeof(struct marshal_cmd_VertexBindingDivisor);
   31565    struct marshal_cmd_VertexBindingDivisor *cmd;
   31566    debug_print_marshal("VertexBindingDivisor");
   31567    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31568       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexBindingDivisor, cmd_size);
   31569       cmd->attribindex = attribindex;
   31570       cmd->divisor = divisor;
   31571       _mesa_post_marshal_hook(ctx);
   31572       return;
   31573    }
   31574 
   31575    _mesa_glthread_finish(ctx);
   31576    debug_print_sync_fallback("VertexBindingDivisor");
   31577    CALL_VertexBindingDivisor(ctx->CurrentServerDispatch, (attribindex, divisor));
   31578 }
   31579 
   31580 
   31581 /* PrimitiveBoundingBox: marshalled asynchronously */
   31582 struct marshal_cmd_PrimitiveBoundingBox
   31583 {
   31584    struct marshal_cmd_base cmd_base;
   31585    GLfloat minX;
   31586    GLfloat minY;
   31587    GLfloat minZ;
   31588    GLfloat minW;
   31589    GLfloat maxX;
   31590    GLfloat maxY;
   31591    GLfloat maxZ;
   31592    GLfloat maxW;
   31593 };
   31594 static inline void
   31595 _mesa_unmarshal_PrimitiveBoundingBox(struct gl_context *ctx, const struct marshal_cmd_PrimitiveBoundingBox *cmd)
   31596 {
   31597    const GLfloat minX = cmd->minX;
   31598    const GLfloat minY = cmd->minY;
   31599    const GLfloat minZ = cmd->minZ;
   31600    const GLfloat minW = cmd->minW;
   31601    const GLfloat maxX = cmd->maxX;
   31602    const GLfloat maxY = cmd->maxY;
   31603    const GLfloat maxZ = cmd->maxZ;
   31604    const GLfloat maxW = cmd->maxW;
   31605    CALL_PrimitiveBoundingBox(ctx->CurrentServerDispatch, (minX, minY, minZ, minW, maxX, maxY, maxZ, maxW));
   31606 }
   31607 static void GLAPIENTRY
   31608 _mesa_marshal_PrimitiveBoundingBox(GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW)
   31609 {
   31610    GET_CURRENT_CONTEXT(ctx);
   31611    size_t cmd_size = sizeof(struct marshal_cmd_PrimitiveBoundingBox);
   31612    struct marshal_cmd_PrimitiveBoundingBox *cmd;
   31613    debug_print_marshal("PrimitiveBoundingBox");
   31614    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31615       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PrimitiveBoundingBox, cmd_size);
   31616       cmd->minX = minX;
   31617       cmd->minY = minY;
   31618       cmd->minZ = minZ;
   31619       cmd->minW = minW;
   31620       cmd->maxX = maxX;
   31621       cmd->maxY = maxY;
   31622       cmd->maxZ = maxZ;
   31623       cmd->maxW = maxW;
   31624       _mesa_post_marshal_hook(ctx);
   31625       return;
   31626    }
   31627 
   31628    _mesa_glthread_finish(ctx);
   31629    debug_print_sync_fallback("PrimitiveBoundingBox");
   31630    CALL_PrimitiveBoundingBox(ctx->CurrentServerDispatch, (minX, minY, minZ, minW, maxX, maxY, maxZ, maxW));
   31631 }
   31632 
   31633 
   31634 /* GetPerfMonitorCounterInfoAMD: marshalled synchronously */
   31635 static void GLAPIENTRY
   31636 _mesa_marshal_GetPerfMonitorCounterInfoAMD(GLuint group, GLuint counter, GLenum pname, GLvoid * data)
   31637 {
   31638    GET_CURRENT_CONTEXT(ctx);
   31639    _mesa_glthread_finish(ctx);
   31640    debug_print_sync("GetPerfMonitorCounterInfoAMD");
   31641    CALL_GetPerfMonitorCounterInfoAMD(ctx->CurrentServerDispatch, (group, counter, pname, data));
   31642 }
   31643 
   31644 
   31645 /* UniformBlockBinding: marshalled asynchronously */
   31646 struct marshal_cmd_UniformBlockBinding
   31647 {
   31648    struct marshal_cmd_base cmd_base;
   31649    GLuint program;
   31650    GLuint uniformBlockIndex;
   31651    GLuint uniformBlockBinding;
   31652 };
   31653 static inline void
   31654 _mesa_unmarshal_UniformBlockBinding(struct gl_context *ctx, const struct marshal_cmd_UniformBlockBinding *cmd)
   31655 {
   31656    const GLuint program = cmd->program;
   31657    const GLuint uniformBlockIndex = cmd->uniformBlockIndex;
   31658    const GLuint uniformBlockBinding = cmd->uniformBlockBinding;
   31659    CALL_UniformBlockBinding(ctx->CurrentServerDispatch, (program, uniformBlockIndex, uniformBlockBinding));
   31660 }
   31661 static void GLAPIENTRY
   31662 _mesa_marshal_UniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
   31663 {
   31664    GET_CURRENT_CONTEXT(ctx);
   31665    size_t cmd_size = sizeof(struct marshal_cmd_UniformBlockBinding);
   31666    struct marshal_cmd_UniformBlockBinding *cmd;
   31667    debug_print_marshal("UniformBlockBinding");
   31668    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31669       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformBlockBinding, cmd_size);
   31670       cmd->program = program;
   31671       cmd->uniformBlockIndex = uniformBlockIndex;
   31672       cmd->uniformBlockBinding = uniformBlockBinding;
   31673       _mesa_post_marshal_hook(ctx);
   31674       return;
   31675    }
   31676 
   31677    _mesa_glthread_finish(ctx);
   31678    debug_print_sync_fallback("UniformBlockBinding");
   31679    CALL_UniformBlockBinding(ctx->CurrentServerDispatch, (program, uniformBlockIndex, uniformBlockBinding));
   31680 }
   31681 
   31682 
   31683 /* FenceSync: marshalled synchronously */
   31684 static GLsync GLAPIENTRY
   31685 _mesa_marshal_FenceSync(GLenum condition, GLbitfield flags)
   31686 {
   31687    GET_CURRENT_CONTEXT(ctx);
   31688    _mesa_glthread_finish(ctx);
   31689    debug_print_sync("FenceSync");
   31690    return CALL_FenceSync(ctx->CurrentServerDispatch, (condition, flags));
   31691 }
   31692 
   31693 
   31694 /* CompressedTextureSubImage2D: marshalled synchronously */
   31695 static void GLAPIENTRY
   31696 _mesa_marshal_CompressedTextureSubImage2D(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid * data)
   31697 {
   31698    GET_CURRENT_CONTEXT(ctx);
   31699    _mesa_glthread_finish(ctx);
   31700    debug_print_sync("CompressedTextureSubImage2D");
   31701    CALL_CompressedTextureSubImage2D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, width, height, format, imageSize, data));
   31702 }
   31703 
   31704 
   31705 /* VertexAttrib4Nusv: marshalled asynchronously */
   31706 struct marshal_cmd_VertexAttrib4Nusv
   31707 {
   31708    struct marshal_cmd_base cmd_base;
   31709    GLuint index;
   31710    GLushort v[4];
   31711 };
   31712 static inline void
   31713 _mesa_unmarshal_VertexAttrib4Nusv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nusv *cmd)
   31714 {
   31715    const GLuint index = cmd->index;
   31716    const GLushort * v = cmd->v;
   31717    CALL_VertexAttrib4Nusv(ctx->CurrentServerDispatch, (index, v));
   31718 }
   31719 static void GLAPIENTRY
   31720 _mesa_marshal_VertexAttrib4Nusv(GLuint index, const GLushort * v)
   31721 {
   31722    GET_CURRENT_CONTEXT(ctx);
   31723    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nusv);
   31724    struct marshal_cmd_VertexAttrib4Nusv *cmd;
   31725    debug_print_marshal("VertexAttrib4Nusv");
   31726    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31727       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nusv, cmd_size);
   31728       cmd->index = index;
   31729       memcpy(cmd->v, v, 8);
   31730       _mesa_post_marshal_hook(ctx);
   31731       return;
   31732    }
   31733 
   31734    _mesa_glthread_finish(ctx);
   31735    debug_print_sync_fallback("VertexAttrib4Nusv");
   31736    CALL_VertexAttrib4Nusv(ctx->CurrentServerDispatch, (index, v));
   31737 }
   31738 
   31739 
   31740 /* SetFragmentShaderConstantATI: marshalled synchronously */
   31741 static void GLAPIENTRY
   31742 _mesa_marshal_SetFragmentShaderConstantATI(GLuint dst, const GLfloat * value)
   31743 {
   31744    GET_CURRENT_CONTEXT(ctx);
   31745    _mesa_glthread_finish(ctx);
   31746    debug_print_sync("SetFragmentShaderConstantATI");
   31747    CALL_SetFragmentShaderConstantATI(ctx->CurrentServerDispatch, (dst, value));
   31748 }
   31749 
   31750 
   31751 /* VertexP2ui: marshalled asynchronously */
   31752 struct marshal_cmd_VertexP2ui
   31753 {
   31754    struct marshal_cmd_base cmd_base;
   31755    GLenum type;
   31756    GLuint value;
   31757 };
   31758 static inline void
   31759 _mesa_unmarshal_VertexP2ui(struct gl_context *ctx, const struct marshal_cmd_VertexP2ui *cmd)
   31760 {
   31761    const GLenum type = cmd->type;
   31762    const GLuint value = cmd->value;
   31763    CALL_VertexP2ui(ctx->CurrentServerDispatch, (type, value));
   31764 }
   31765 static void GLAPIENTRY
   31766 _mesa_marshal_VertexP2ui(GLenum type, GLuint value)
   31767 {
   31768    GET_CURRENT_CONTEXT(ctx);
   31769    size_t cmd_size = sizeof(struct marshal_cmd_VertexP2ui);
   31770    struct marshal_cmd_VertexP2ui *cmd;
   31771    debug_print_marshal("VertexP2ui");
   31772    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31773       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexP2ui, cmd_size);
   31774       cmd->type = type;
   31775       cmd->value = value;
   31776       _mesa_post_marshal_hook(ctx);
   31777       return;
   31778    }
   31779 
   31780    _mesa_glthread_finish(ctx);
   31781    debug_print_sync_fallback("VertexP2ui");
   31782    CALL_VertexP2ui(ctx->CurrentServerDispatch, (type, value));
   31783 }
   31784 
   31785 
   31786 /* ProgramUniform2fv: marshalled asynchronously */
   31787 struct marshal_cmd_ProgramUniform2fv
   31788 {
   31789    struct marshal_cmd_base cmd_base;
   31790    GLuint program;
   31791    GLint location;
   31792    GLsizei count;
   31793    /* Next safe_mul(count, 8) bytes are GLfloat value[count][2] */
   31794 };
   31795 static inline void
   31796 _mesa_unmarshal_ProgramUniform2fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2fv *cmd)
   31797 {
   31798    const GLuint program = cmd->program;
   31799    const GLint location = cmd->location;
   31800    const GLsizei count = cmd->count;
   31801    const GLfloat * value;
   31802    const char *variable_data = (const char *) (cmd + 1);
   31803    value = (const GLfloat *) variable_data;
   31804    variable_data += count * 8;
   31805    CALL_ProgramUniform2fv(ctx->CurrentServerDispatch, (program, location, count, value));
   31806 }
   31807 static void GLAPIENTRY
   31808 _mesa_marshal_ProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
   31809 {
   31810    GET_CURRENT_CONTEXT(ctx);
   31811    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform2fv) + safe_mul(count, 8);
   31812    struct marshal_cmd_ProgramUniform2fv *cmd;
   31813    debug_print_marshal("ProgramUniform2fv");
   31814    if (unlikely(safe_mul(count, 8) < 0)) {
   31815       goto fallback_to_sync;
   31816    }
   31817    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31818       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2fv, cmd_size);
   31819       cmd->program = program;
   31820       cmd->location = location;
   31821       cmd->count = count;
   31822       char *variable_data = (char *) (cmd + 1);
   31823       memcpy(variable_data, value, count * 8);
   31824       variable_data += count * 8;
   31825       _mesa_post_marshal_hook(ctx);
   31826       return;
   31827    }
   31828 
   31829 fallback_to_sync:
   31830    _mesa_glthread_finish(ctx);
   31831    debug_print_sync_fallback("ProgramUniform2fv");
   31832    CALL_ProgramUniform2fv(ctx->CurrentServerDispatch, (program, location, count, value));
   31833 }
   31834 
   31835 
   31836 /* GetTextureLevelParameteriv: marshalled synchronously */
   31837 static void GLAPIENTRY
   31838 _mesa_marshal_GetTextureLevelParameteriv(GLuint texture, GLint level, GLenum pname, GLint * params)
   31839 {
   31840    GET_CURRENT_CONTEXT(ctx);
   31841    _mesa_glthread_finish(ctx);
   31842    debug_print_sync("GetTextureLevelParameteriv");
   31843    CALL_GetTextureLevelParameteriv(ctx->CurrentServerDispatch, (texture, level, pname, params));
   31844 }
   31845 
   31846 
   31847 /* GetTexEnvfv: marshalled synchronously */
   31848 static void GLAPIENTRY
   31849 _mesa_marshal_GetTexEnvfv(GLenum target, GLenum pname, GLfloat * params)
   31850 {
   31851    GET_CURRENT_CONTEXT(ctx);
   31852    _mesa_glthread_finish(ctx);
   31853    debug_print_sync("GetTexEnvfv");
   31854    CALL_GetTexEnvfv(ctx->CurrentServerDispatch, (target, pname, params));
   31855 }
   31856 
   31857 
   31858 /* BindAttribLocation: marshalled synchronously */
   31859 static void GLAPIENTRY
   31860 _mesa_marshal_BindAttribLocation(GLuint program, GLuint index, const GLchar * name)
   31861 {
   31862    GET_CURRENT_CONTEXT(ctx);
   31863    _mesa_glthread_finish(ctx);
   31864    debug_print_sync("BindAttribLocation");
   31865    CALL_BindAttribLocation(ctx->CurrentServerDispatch, (program, index, name));
   31866 }
   31867 
   31868 
   31869 /* TextureStorage2DEXT: marshalled asynchronously */
   31870 struct marshal_cmd_TextureStorage2DEXT
   31871 {
   31872    struct marshal_cmd_base cmd_base;
   31873    GLuint texture;
   31874    GLenum target;
   31875    GLsizei levels;
   31876    GLenum internalFormat;
   31877    GLsizei width;
   31878    GLsizei height;
   31879 };
   31880 static inline void
   31881 _mesa_unmarshal_TextureStorage2DEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorage2DEXT *cmd)
   31882 {
   31883    const GLuint texture = cmd->texture;
   31884    const GLenum target = cmd->target;
   31885    const GLsizei levels = cmd->levels;
   31886    const GLenum internalFormat = cmd->internalFormat;
   31887    const GLsizei width = cmd->width;
   31888    const GLsizei height = cmd->height;
   31889    CALL_TextureStorage2DEXT(ctx->CurrentServerDispatch, (texture, target, levels, internalFormat, width, height));
   31890 }
   31891 static void GLAPIENTRY
   31892 _mesa_marshal_TextureStorage2DEXT(GLuint texture, GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height)
   31893 {
   31894    GET_CURRENT_CONTEXT(ctx);
   31895    size_t cmd_size = sizeof(struct marshal_cmd_TextureStorage2DEXT);
   31896    struct marshal_cmd_TextureStorage2DEXT *cmd;
   31897    debug_print_marshal("TextureStorage2DEXT");
   31898    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31899       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage2DEXT, cmd_size);
   31900       cmd->texture = texture;
   31901       cmd->target = target;
   31902       cmd->levels = levels;
   31903       cmd->internalFormat = internalFormat;
   31904       cmd->width = width;
   31905       cmd->height = height;
   31906       _mesa_post_marshal_hook(ctx);
   31907       return;
   31908    }
   31909 
   31910    _mesa_glthread_finish(ctx);
   31911    debug_print_sync_fallback("TextureStorage2DEXT");
   31912    CALL_TextureStorage2DEXT(ctx->CurrentServerDispatch, (texture, target, levels, internalFormat, width, height));
   31913 }
   31914 
   31915 
   31916 /* TextureParameterIiv: marshalled synchronously */
   31917 static void GLAPIENTRY
   31918 _mesa_marshal_TextureParameterIiv(GLuint texture, GLenum pname, const GLint * params)
   31919 {
   31920    GET_CURRENT_CONTEXT(ctx);
   31921    _mesa_glthread_finish(ctx);
   31922    debug_print_sync("TextureParameterIiv");
   31923    CALL_TextureParameterIiv(ctx->CurrentServerDispatch, (texture, pname, params));
   31924 }
   31925 
   31926 
   31927 /* DrawTransformFeedbackInstanced: marshalled asynchronously */
   31928 struct marshal_cmd_DrawTransformFeedbackInstanced
   31929 {
   31930    struct marshal_cmd_base cmd_base;
   31931    GLenum mode;
   31932    GLuint id;
   31933    GLsizei primcount;
   31934 };
   31935 static inline void
   31936 _mesa_unmarshal_DrawTransformFeedbackInstanced(struct gl_context *ctx, const struct marshal_cmd_DrawTransformFeedbackInstanced *cmd)
   31937 {
   31938    const GLenum mode = cmd->mode;
   31939    const GLuint id = cmd->id;
   31940    const GLsizei primcount = cmd->primcount;
   31941    CALL_DrawTransformFeedbackInstanced(ctx->CurrentServerDispatch, (mode, id, primcount));
   31942 }
   31943 static void GLAPIENTRY
   31944 _mesa_marshal_DrawTransformFeedbackInstanced(GLenum mode, GLuint id, GLsizei primcount)
   31945 {
   31946    GET_CURRENT_CONTEXT(ctx);
   31947    size_t cmd_size = sizeof(struct marshal_cmd_DrawTransformFeedbackInstanced);
   31948    struct marshal_cmd_DrawTransformFeedbackInstanced *cmd;
   31949    debug_print_marshal("DrawTransformFeedbackInstanced");
   31950    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31951       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTransformFeedbackInstanced, cmd_size);
   31952       cmd->mode = mode;
   31953       cmd->id = id;
   31954       cmd->primcount = primcount;
   31955       _mesa_post_marshal_hook(ctx);
   31956       return;
   31957    }
   31958 
   31959    _mesa_glthread_finish(ctx);
   31960    debug_print_sync_fallback("DrawTransformFeedbackInstanced");
   31961    CALL_DrawTransformFeedbackInstanced(ctx->CurrentServerDispatch, (mode, id, primcount));
   31962 }
   31963 
   31964 
   31965 /* CopyTextureSubImage1D: marshalled asynchronously */
   31966 struct marshal_cmd_CopyTextureSubImage1D
   31967 {
   31968    struct marshal_cmd_base cmd_base;
   31969    GLuint texture;
   31970    GLint level;
   31971    GLint xoffset;
   31972    GLint x;
   31973    GLint y;
   31974    GLsizei width;
   31975 };
   31976 static inline void
   31977 _mesa_unmarshal_CopyTextureSubImage1D(struct gl_context *ctx, const struct marshal_cmd_CopyTextureSubImage1D *cmd)
   31978 {
   31979    const GLuint texture = cmd->texture;
   31980    const GLint level = cmd->level;
   31981    const GLint xoffset = cmd->xoffset;
   31982    const GLint x = cmd->x;
   31983    const GLint y = cmd->y;
   31984    const GLsizei width = cmd->width;
   31985    CALL_CopyTextureSubImage1D(ctx->CurrentServerDispatch, (texture, level, xoffset, x, y, width));
   31986 }
   31987 static void GLAPIENTRY
   31988 _mesa_marshal_CopyTextureSubImage1D(GLuint texture, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width)
   31989 {
   31990    GET_CURRENT_CONTEXT(ctx);
   31991    size_t cmd_size = sizeof(struct marshal_cmd_CopyTextureSubImage1D);
   31992    struct marshal_cmd_CopyTextureSubImage1D *cmd;
   31993    debug_print_marshal("CopyTextureSubImage1D");
   31994    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   31995       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyTextureSubImage1D, cmd_size);
   31996       cmd->texture = texture;
   31997       cmd->level = level;
   31998       cmd->xoffset = xoffset;
   31999       cmd->x = x;
   32000       cmd->y = y;
   32001       cmd->width = width;
   32002       _mesa_post_marshal_hook(ctx);
   32003       return;
   32004    }
   32005 
   32006    _mesa_glthread_finish(ctx);
   32007    debug_print_sync_fallback("CopyTextureSubImage1D");
   32008    CALL_CopyTextureSubImage1D(ctx->CurrentServerDispatch, (texture, level, xoffset, x, y, width));
   32009 }
   32010 
   32011 
   32012 /* ResumeTransformFeedback: marshalled asynchronously */
   32013 struct marshal_cmd_ResumeTransformFeedback
   32014 {
   32015    struct marshal_cmd_base cmd_base;
   32016 };
   32017 static inline void
   32018 _mesa_unmarshal_ResumeTransformFeedback(struct gl_context *ctx, const struct marshal_cmd_ResumeTransformFeedback *cmd)
   32019 {
   32020    CALL_ResumeTransformFeedback(ctx->CurrentServerDispatch, ());
   32021 }
   32022 static void GLAPIENTRY
   32023 _mesa_marshal_ResumeTransformFeedback(void)
   32024 {
   32025    GET_CURRENT_CONTEXT(ctx);
   32026    size_t cmd_size = sizeof(struct marshal_cmd_ResumeTransformFeedback);
   32027    struct marshal_cmd_ResumeTransformFeedback *cmd;
   32028    debug_print_marshal("ResumeTransformFeedback");
   32029    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32030       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ResumeTransformFeedback, cmd_size);
   32031       (void) cmd;
   32032 
   32033       _mesa_post_marshal_hook(ctx);
   32034       return;
   32035    }
   32036 
   32037    _mesa_glthread_finish(ctx);
   32038    debug_print_sync_fallback("ResumeTransformFeedback");
   32039    CALL_ResumeTransformFeedback(ctx->CurrentServerDispatch, ());
   32040 }
   32041 
   32042 
   32043 /* VertexAttribI1iv: marshalled synchronously */
   32044 static void GLAPIENTRY
   32045 _mesa_marshal_VertexAttribI1iv(GLuint index, const GLint * v)
   32046 {
   32047    GET_CURRENT_CONTEXT(ctx);
   32048    _mesa_glthread_finish(ctx);
   32049    debug_print_sync("VertexAttribI1iv");
   32050    CALL_VertexAttribI1iv(ctx->CurrentServerDispatch, (index, v));
   32051 }
   32052 
   32053 
   32054 /* Vertex2dv: marshalled asynchronously */
   32055 struct marshal_cmd_Vertex2dv
   32056 {
   32057    struct marshal_cmd_base cmd_base;
   32058    GLdouble v[2];
   32059 };
   32060 static inline void
   32061 _mesa_unmarshal_Vertex2dv(struct gl_context *ctx, const struct marshal_cmd_Vertex2dv *cmd)
   32062 {
   32063    const GLdouble * v = cmd->v;
   32064    CALL_Vertex2dv(ctx->CurrentServerDispatch, (v));
   32065 }
   32066 static void GLAPIENTRY
   32067 _mesa_marshal_Vertex2dv(const GLdouble * v)
   32068 {
   32069    GET_CURRENT_CONTEXT(ctx);
   32070    size_t cmd_size = sizeof(struct marshal_cmd_Vertex2dv);
   32071    struct marshal_cmd_Vertex2dv *cmd;
   32072    debug_print_marshal("Vertex2dv");
   32073    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32074       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex2dv, cmd_size);
   32075       memcpy(cmd->v, v, 16);
   32076       _mesa_post_marshal_hook(ctx);
   32077       return;
   32078    }
   32079 
   32080    _mesa_glthread_finish(ctx);
   32081    debug_print_sync_fallback("Vertex2dv");
   32082    CALL_Vertex2dv(ctx->CurrentServerDispatch, (v));
   32083 }
   32084 
   32085 
   32086 /* VertexAttribI2uivEXT: marshalled synchronously */
   32087 static void GLAPIENTRY
   32088 _mesa_marshal_VertexAttribI2uivEXT(GLuint index, const GLuint * v)
   32089 {
   32090    GET_CURRENT_CONTEXT(ctx);
   32091    _mesa_glthread_finish(ctx);
   32092    debug_print_sync("VertexAttribI2uivEXT");
   32093    CALL_VertexAttribI2uivEXT(ctx->CurrentServerDispatch, (index, v));
   32094 }
   32095 
   32096 
   32097 /* SampleMaski: marshalled asynchronously */
   32098 struct marshal_cmd_SampleMaski
   32099 {
   32100    struct marshal_cmd_base cmd_base;
   32101    GLuint index;
   32102    GLbitfield mask;
   32103 };
   32104 static inline void
   32105 _mesa_unmarshal_SampleMaski(struct gl_context *ctx, const struct marshal_cmd_SampleMaski *cmd)
   32106 {
   32107    const GLuint index = cmd->index;
   32108    const GLbitfield mask = cmd->mask;
   32109    CALL_SampleMaski(ctx->CurrentServerDispatch, (index, mask));
   32110 }
   32111 static void GLAPIENTRY
   32112 _mesa_marshal_SampleMaski(GLuint index, GLbitfield mask)
   32113 {
   32114    GET_CURRENT_CONTEXT(ctx);
   32115    size_t cmd_size = sizeof(struct marshal_cmd_SampleMaski);
   32116    struct marshal_cmd_SampleMaski *cmd;
   32117    debug_print_marshal("SampleMaski");
   32118    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32119       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SampleMaski, cmd_size);
   32120       cmd->index = index;
   32121       cmd->mask = mask;
   32122       _mesa_post_marshal_hook(ctx);
   32123       return;
   32124    }
   32125 
   32126    _mesa_glthread_finish(ctx);
   32127    debug_print_sync_fallback("SampleMaski");
   32128    CALL_SampleMaski(ctx->CurrentServerDispatch, (index, mask));
   32129 }
   32130 
   32131 
   32132 /* GetFloati_v: marshalled synchronously */
   32133 static void GLAPIENTRY
   32134 _mesa_marshal_GetFloati_v(GLenum target, GLuint index, GLfloat * data)
   32135 {
   32136    GET_CURRENT_CONTEXT(ctx);
   32137    _mesa_glthread_finish(ctx);
   32138    debug_print_sync("GetFloati_v");
   32139    CALL_GetFloati_v(ctx->CurrentServerDispatch, (target, index, data));
   32140 }
   32141 
   32142 
   32143 /* MultiTexCoord2iv: marshalled asynchronously */
   32144 struct marshal_cmd_MultiTexCoord2iv
   32145 {
   32146    struct marshal_cmd_base cmd_base;
   32147    GLenum target;
   32148    GLint v[2];
   32149 };
   32150 static inline void
   32151 _mesa_unmarshal_MultiTexCoord2iv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2iv *cmd)
   32152 {
   32153    const GLenum target = cmd->target;
   32154    const GLint * v = cmd->v;
   32155    CALL_MultiTexCoord2iv(ctx->CurrentServerDispatch, (target, v));
   32156 }
   32157 static void GLAPIENTRY
   32158 _mesa_marshal_MultiTexCoord2iv(GLenum target, const GLint * v)
   32159 {
   32160    GET_CURRENT_CONTEXT(ctx);
   32161    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2iv);
   32162    struct marshal_cmd_MultiTexCoord2iv *cmd;
   32163    debug_print_marshal("MultiTexCoord2iv");
   32164    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32165       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2iv, cmd_size);
   32166       cmd->target = target;
   32167       memcpy(cmd->v, v, 8);
   32168       _mesa_post_marshal_hook(ctx);
   32169       return;
   32170    }
   32171 
   32172    _mesa_glthread_finish(ctx);
   32173    debug_print_sync_fallback("MultiTexCoord2iv");
   32174    CALL_MultiTexCoord2iv(ctx->CurrentServerDispatch, (target, v));
   32175 }
   32176 
   32177 
   32178 /* DrawPixels: marshalled synchronously */
   32179 static void GLAPIENTRY
   32180 _mesa_marshal_DrawPixels(GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
   32181 {
   32182    GET_CURRENT_CONTEXT(ctx);
   32183    _mesa_glthread_finish(ctx);
   32184    debug_print_sync("DrawPixels");
   32185    CALL_DrawPixels(ctx->CurrentServerDispatch, (width, height, format, type, pixels));
   32186 }
   32187 
   32188 
   32189 /* CreateFramebuffers: marshalled synchronously */
   32190 static void GLAPIENTRY
   32191 _mesa_marshal_CreateFramebuffers(GLsizei n, GLuint * framebuffers)
   32192 {
   32193    GET_CURRENT_CONTEXT(ctx);
   32194    _mesa_glthread_finish(ctx);
   32195    debug_print_sync("CreateFramebuffers");
   32196    CALL_CreateFramebuffers(ctx->CurrentServerDispatch, (n, framebuffers));
   32197 }
   32198 
   32199 
   32200 /* DrawTransformFeedback: marshalled asynchronously */
   32201 struct marshal_cmd_DrawTransformFeedback
   32202 {
   32203    struct marshal_cmd_base cmd_base;
   32204    GLenum mode;
   32205    GLuint id;
   32206 };
   32207 static inline void
   32208 _mesa_unmarshal_DrawTransformFeedback(struct gl_context *ctx, const struct marshal_cmd_DrawTransformFeedback *cmd)
   32209 {
   32210    const GLenum mode = cmd->mode;
   32211    const GLuint id = cmd->id;
   32212    CALL_DrawTransformFeedback(ctx->CurrentServerDispatch, (mode, id));
   32213 }
   32214 static void GLAPIENTRY
   32215 _mesa_marshal_DrawTransformFeedback(GLenum mode, GLuint id)
   32216 {
   32217    GET_CURRENT_CONTEXT(ctx);
   32218    size_t cmd_size = sizeof(struct marshal_cmd_DrawTransformFeedback);
   32219    struct marshal_cmd_DrawTransformFeedback *cmd;
   32220    debug_print_marshal("DrawTransformFeedback");
   32221    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32222       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTransformFeedback, cmd_size);
   32223       cmd->mode = mode;
   32224       cmd->id = id;
   32225       _mesa_post_marshal_hook(ctx);
   32226       return;
   32227    }
   32228 
   32229    _mesa_glthread_finish(ctx);
   32230    debug_print_sync_fallback("DrawTransformFeedback");
   32231    CALL_DrawTransformFeedback(ctx->CurrentServerDispatch, (mode, id));
   32232 }
   32233 
   32234 
   32235 /* VertexAttribs3fvNV: marshalled asynchronously */
   32236 struct marshal_cmd_VertexAttribs3fvNV
   32237 {
   32238    struct marshal_cmd_base cmd_base;
   32239    GLuint index;
   32240    GLsizei n;
   32241    /* Next safe_mul(n, 12) bytes are GLfloat v[n][3] */
   32242 };
   32243 static inline void
   32244 _mesa_unmarshal_VertexAttribs3fvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs3fvNV *cmd)
   32245 {
   32246    const GLuint index = cmd->index;
   32247    const GLsizei n = cmd->n;
   32248    const GLfloat * v;
   32249    const char *variable_data = (const char *) (cmd + 1);
   32250    v = (const GLfloat *) variable_data;
   32251    variable_data += n * 12;
   32252    CALL_VertexAttribs3fvNV(ctx->CurrentServerDispatch, (index, n, v));
   32253 }
   32254 static void GLAPIENTRY
   32255 _mesa_marshal_VertexAttribs3fvNV(GLuint index, GLsizei n, const GLfloat * v)
   32256 {
   32257    GET_CURRENT_CONTEXT(ctx);
   32258    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribs3fvNV) + safe_mul(n, 12);
   32259    struct marshal_cmd_VertexAttribs3fvNV *cmd;
   32260    debug_print_marshal("VertexAttribs3fvNV");
   32261    if (unlikely(safe_mul(n, 12) < 0)) {
   32262       goto fallback_to_sync;
   32263    }
   32264    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32265       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs3fvNV, cmd_size);
   32266       cmd->index = index;
   32267       cmd->n = n;
   32268       char *variable_data = (char *) (cmd + 1);
   32269       memcpy(variable_data, v, n * 12);
   32270       variable_data += n * 12;
   32271       _mesa_post_marshal_hook(ctx);
   32272       return;
   32273    }
   32274 
   32275 fallback_to_sync:
   32276    _mesa_glthread_finish(ctx);
   32277    debug_print_sync_fallback("VertexAttribs3fvNV");
   32278    CALL_VertexAttribs3fvNV(ctx->CurrentServerDispatch, (index, n, v));
   32279 }
   32280 
   32281 
   32282 /* GenLists: marshalled synchronously */
   32283 static GLuint GLAPIENTRY
   32284 _mesa_marshal_GenLists(GLsizei range)
   32285 {
   32286    GET_CURRENT_CONTEXT(ctx);
   32287    _mesa_glthread_finish(ctx);
   32288    debug_print_sync("GenLists");
   32289    return CALL_GenLists(ctx->CurrentServerDispatch, (range));
   32290 }
   32291 
   32292 
   32293 /* ProgramUniform2ui64vARB: marshalled asynchronously */
   32294 struct marshal_cmd_ProgramUniform2ui64vARB
   32295 {
   32296    struct marshal_cmd_base cmd_base;
   32297    GLuint program;
   32298    GLint location;
   32299    GLsizei count;
   32300    /* Next safe_mul(count, 16) bytes are GLuint64 value[count][2] */
   32301 };
   32302 static inline void
   32303 _mesa_unmarshal_ProgramUniform2ui64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2ui64vARB *cmd)
   32304 {
   32305    const GLuint program = cmd->program;
   32306    const GLint location = cmd->location;
   32307    const GLsizei count = cmd->count;
   32308    const GLuint64 * value;
   32309    const char *variable_data = (const char *) (cmd + 1);
   32310    value = (const GLuint64 *) variable_data;
   32311    variable_data += count * 16;
   32312    CALL_ProgramUniform2ui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
   32313 }
   32314 static void GLAPIENTRY
   32315 _mesa_marshal_ProgramUniform2ui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 * value)
   32316 {
   32317    GET_CURRENT_CONTEXT(ctx);
   32318    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform2ui64vARB) + safe_mul(count, 16);
   32319    struct marshal_cmd_ProgramUniform2ui64vARB *cmd;
   32320    debug_print_marshal("ProgramUniform2ui64vARB");
   32321    if (unlikely(safe_mul(count, 16) < 0)) {
   32322       goto fallback_to_sync;
   32323    }
   32324    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32325       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2ui64vARB, cmd_size);
   32326       cmd->program = program;
   32327       cmd->location = location;
   32328       cmd->count = count;
   32329       char *variable_data = (char *) (cmd + 1);
   32330       memcpy(variable_data, value, count * 16);
   32331       variable_data += count * 16;
   32332       _mesa_post_marshal_hook(ctx);
   32333       return;
   32334    }
   32335 
   32336 fallback_to_sync:
   32337    _mesa_glthread_finish(ctx);
   32338    debug_print_sync_fallback("ProgramUniform2ui64vARB");
   32339    CALL_ProgramUniform2ui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
   32340 }
   32341 
   32342 
   32343 /* MapGrid2d: marshalled asynchronously */
   32344 struct marshal_cmd_MapGrid2d
   32345 {
   32346    struct marshal_cmd_base cmd_base;
   32347    GLint un;
   32348    GLdouble u1;
   32349    GLdouble u2;
   32350    GLint vn;
   32351    GLdouble v1;
   32352    GLdouble v2;
   32353 };
   32354 static inline void
   32355 _mesa_unmarshal_MapGrid2d(struct gl_context *ctx, const struct marshal_cmd_MapGrid2d *cmd)
   32356 {
   32357    const GLint un = cmd->un;
   32358    const GLdouble u1 = cmd->u1;
   32359    const GLdouble u2 = cmd->u2;
   32360    const GLint vn = cmd->vn;
   32361    const GLdouble v1 = cmd->v1;
   32362    const GLdouble v2 = cmd->v2;
   32363    CALL_MapGrid2d(ctx->CurrentServerDispatch, (un, u1, u2, vn, v1, v2));
   32364 }
   32365 static void GLAPIENTRY
   32366 _mesa_marshal_MapGrid2d(GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2)
   32367 {
   32368    GET_CURRENT_CONTEXT(ctx);
   32369    size_t cmd_size = sizeof(struct marshal_cmd_MapGrid2d);
   32370    struct marshal_cmd_MapGrid2d *cmd;
   32371    debug_print_marshal("MapGrid2d");
   32372    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32373       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MapGrid2d, cmd_size);
   32374       cmd->un = un;
   32375       cmd->u1 = u1;
   32376       cmd->u2 = u2;
   32377       cmd->vn = vn;
   32378       cmd->v1 = v1;
   32379       cmd->v2 = v2;
   32380       _mesa_post_marshal_hook(ctx);
   32381       return;
   32382    }
   32383 
   32384    _mesa_glthread_finish(ctx);
   32385    debug_print_sync_fallback("MapGrid2d");
   32386    CALL_MapGrid2d(ctx->CurrentServerDispatch, (un, u1, u2, vn, v1, v2));
   32387 }
   32388 
   32389 
   32390 /* MapGrid2f: marshalled asynchronously */
   32391 struct marshal_cmd_MapGrid2f
   32392 {
   32393    struct marshal_cmd_base cmd_base;
   32394    GLint un;
   32395    GLfloat u1;
   32396    GLfloat u2;
   32397    GLint vn;
   32398    GLfloat v1;
   32399    GLfloat v2;
   32400 };
   32401 static inline void
   32402 _mesa_unmarshal_MapGrid2f(struct gl_context *ctx, const struct marshal_cmd_MapGrid2f *cmd)
   32403 {
   32404    const GLint un = cmd->un;
   32405    const GLfloat u1 = cmd->u1;
   32406    const GLfloat u2 = cmd->u2;
   32407    const GLint vn = cmd->vn;
   32408    const GLfloat v1 = cmd->v1;
   32409    const GLfloat v2 = cmd->v2;
   32410    CALL_MapGrid2f(ctx->CurrentServerDispatch, (un, u1, u2, vn, v1, v2));
   32411 }
   32412 static void GLAPIENTRY
   32413 _mesa_marshal_MapGrid2f(GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2)
   32414 {
   32415    GET_CURRENT_CONTEXT(ctx);
   32416    size_t cmd_size = sizeof(struct marshal_cmd_MapGrid2f);
   32417    struct marshal_cmd_MapGrid2f *cmd;
   32418    debug_print_marshal("MapGrid2f");
   32419    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32420       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MapGrid2f, cmd_size);
   32421       cmd->un = un;
   32422       cmd->u1 = u1;
   32423       cmd->u2 = u2;
   32424       cmd->vn = vn;
   32425       cmd->v1 = v1;
   32426       cmd->v2 = v2;
   32427       _mesa_post_marshal_hook(ctx);
   32428       return;
   32429    }
   32430 
   32431    _mesa_glthread_finish(ctx);
   32432    debug_print_sync_fallback("MapGrid2f");
   32433    CALL_MapGrid2f(ctx->CurrentServerDispatch, (un, u1, u2, vn, v1, v2));
   32434 }
   32435 
   32436 
   32437 /* SampleMapATI: marshalled asynchronously */
   32438 struct marshal_cmd_SampleMapATI
   32439 {
   32440    struct marshal_cmd_base cmd_base;
   32441    GLuint dst;
   32442    GLuint interp;
   32443    GLenum swizzle;
   32444 };
   32445 static inline void
   32446 _mesa_unmarshal_SampleMapATI(struct gl_context *ctx, const struct marshal_cmd_SampleMapATI *cmd)
   32447 {
   32448    const GLuint dst = cmd->dst;
   32449    const GLuint interp = cmd->interp;
   32450    const GLenum swizzle = cmd->swizzle;
   32451    CALL_SampleMapATI(ctx->CurrentServerDispatch, (dst, interp, swizzle));
   32452 }
   32453 static void GLAPIENTRY
   32454 _mesa_marshal_SampleMapATI(GLuint dst, GLuint interp, GLenum swizzle)
   32455 {
   32456    GET_CURRENT_CONTEXT(ctx);
   32457    size_t cmd_size = sizeof(struct marshal_cmd_SampleMapATI);
   32458    struct marshal_cmd_SampleMapATI *cmd;
   32459    debug_print_marshal("SampleMapATI");
   32460    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32461       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SampleMapATI, cmd_size);
   32462       cmd->dst = dst;
   32463       cmd->interp = interp;
   32464       cmd->swizzle = swizzle;
   32465       _mesa_post_marshal_hook(ctx);
   32466       return;
   32467    }
   32468 
   32469    _mesa_glthread_finish(ctx);
   32470    debug_print_sync_fallback("SampleMapATI");
   32471    CALL_SampleMapATI(ctx->CurrentServerDispatch, (dst, interp, swizzle));
   32472 }
   32473 
   32474 
   32475 /* GetActiveAttrib: marshalled synchronously */
   32476 static void GLAPIENTRY
   32477 _mesa_marshal_GetActiveAttrib(GLuint program, GLuint index, GLsizei  bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name)
   32478 {
   32479    GET_CURRENT_CONTEXT(ctx);
   32480    _mesa_glthread_finish(ctx);
   32481    debug_print_sync("GetActiveAttrib");
   32482    CALL_GetActiveAttrib(ctx->CurrentServerDispatch, (program, index, bufSize, length, size, type, name));
   32483 }
   32484 
   32485 
   32486 /* PixelMapfv: marshalled synchronously */
   32487 static void GLAPIENTRY
   32488 _mesa_marshal_PixelMapfv(GLenum map, GLsizei mapsize, const GLfloat * values)
   32489 {
   32490    GET_CURRENT_CONTEXT(ctx);
   32491    _mesa_glthread_finish(ctx);
   32492    debug_print_sync("PixelMapfv");
   32493    CALL_PixelMapfv(ctx->CurrentServerDispatch, (map, mapsize, values));
   32494 }
   32495 
   32496 
   32497 /* ClearBufferData: marshalled synchronously */
   32498 static void GLAPIENTRY
   32499 _mesa_marshal_ClearBufferData(GLenum target, GLenum internalformat, GLenum format, GLenum type, const GLvoid * data)
   32500 {
   32501    GET_CURRENT_CONTEXT(ctx);
   32502    _mesa_glthread_finish(ctx);
   32503    debug_print_sync("ClearBufferData");
   32504    CALL_ClearBufferData(ctx->CurrentServerDispatch, (target, internalformat, format, type, data));
   32505 }
   32506 
   32507 
   32508 /* Color3usv: marshalled asynchronously */
   32509 struct marshal_cmd_Color3usv
   32510 {
   32511    struct marshal_cmd_base cmd_base;
   32512    GLushort v[3];
   32513 };
   32514 static inline void
   32515 _mesa_unmarshal_Color3usv(struct gl_context *ctx, const struct marshal_cmd_Color3usv *cmd)
   32516 {
   32517    const GLushort * v = cmd->v;
   32518    CALL_Color3usv(ctx->CurrentServerDispatch, (v));
   32519 }
   32520 static void GLAPIENTRY
   32521 _mesa_marshal_Color3usv(const GLushort * v)
   32522 {
   32523    GET_CURRENT_CONTEXT(ctx);
   32524    size_t cmd_size = sizeof(struct marshal_cmd_Color3usv);
   32525    struct marshal_cmd_Color3usv *cmd;
   32526    debug_print_marshal("Color3usv");
   32527    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32528       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3usv, cmd_size);
   32529       memcpy(cmd->v, v, 6);
   32530       _mesa_post_marshal_hook(ctx);
   32531       return;
   32532    }
   32533 
   32534    _mesa_glthread_finish(ctx);
   32535    debug_print_sync_fallback("Color3usv");
   32536    CALL_Color3usv(ctx->CurrentServerDispatch, (v));
   32537 }
   32538 
   32539 
   32540 /* CopyImageSubData: marshalled asynchronously */
   32541 struct marshal_cmd_CopyImageSubData
   32542 {
   32543    struct marshal_cmd_base cmd_base;
   32544    GLuint srcName;
   32545    GLenum srcTarget;
   32546    GLint srcLevel;
   32547    GLint srcX;
   32548    GLint srcY;
   32549    GLint srcZ;
   32550    GLuint dstName;
   32551    GLenum dstTarget;
   32552    GLint dstLevel;
   32553    GLint dstX;
   32554    GLint dstY;
   32555    GLint dstZ;
   32556    GLsizei srcWidth;
   32557    GLsizei srcHeight;
   32558    GLsizei srcDepth;
   32559 };
   32560 static inline void
   32561 _mesa_unmarshal_CopyImageSubData(struct gl_context *ctx, const struct marshal_cmd_CopyImageSubData *cmd)
   32562 {
   32563    const GLuint srcName = cmd->srcName;
   32564    const GLenum srcTarget = cmd->srcTarget;
   32565    const GLint srcLevel = cmd->srcLevel;
   32566    const GLint srcX = cmd->srcX;
   32567    const GLint srcY = cmd->srcY;
   32568    const GLint srcZ = cmd->srcZ;
   32569    const GLuint dstName = cmd->dstName;
   32570    const GLenum dstTarget = cmd->dstTarget;
   32571    const GLint dstLevel = cmd->dstLevel;
   32572    const GLint dstX = cmd->dstX;
   32573    const GLint dstY = cmd->dstY;
   32574    const GLint dstZ = cmd->dstZ;
   32575    const GLsizei srcWidth = cmd->srcWidth;
   32576    const GLsizei srcHeight = cmd->srcHeight;
   32577    const GLsizei srcDepth = cmd->srcDepth;
   32578    CALL_CopyImageSubData(ctx->CurrentServerDispatch, (srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth));
   32579 }
   32580 static void GLAPIENTRY
   32581 _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)
   32582 {
   32583    GET_CURRENT_CONTEXT(ctx);
   32584    size_t cmd_size = sizeof(struct marshal_cmd_CopyImageSubData);
   32585    struct marshal_cmd_CopyImageSubData *cmd;
   32586    debug_print_marshal("CopyImageSubData");
   32587    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32588       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyImageSubData, cmd_size);
   32589       cmd->srcName = srcName;
   32590       cmd->srcTarget = srcTarget;
   32591       cmd->srcLevel = srcLevel;
   32592       cmd->srcX = srcX;
   32593       cmd->srcY = srcY;
   32594       cmd->srcZ = srcZ;
   32595       cmd->dstName = dstName;
   32596       cmd->dstTarget = dstTarget;
   32597       cmd->dstLevel = dstLevel;
   32598       cmd->dstX = dstX;
   32599       cmd->dstY = dstY;
   32600       cmd->dstZ = dstZ;
   32601       cmd->srcWidth = srcWidth;
   32602       cmd->srcHeight = srcHeight;
   32603       cmd->srcDepth = srcDepth;
   32604       _mesa_post_marshal_hook(ctx);
   32605       return;
   32606    }
   32607 
   32608    _mesa_glthread_finish(ctx);
   32609    debug_print_sync_fallback("CopyImageSubData");
   32610    CALL_CopyImageSubData(ctx->CurrentServerDispatch, (srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth));
   32611 }
   32612 
   32613 
   32614 /* StencilOpSeparate: marshalled asynchronously */
   32615 struct marshal_cmd_StencilOpSeparate
   32616 {
   32617    struct marshal_cmd_base cmd_base;
   32618    GLenum face;
   32619    GLenum sfail;
   32620    GLenum zfail;
   32621    GLenum zpass;
   32622 };
   32623 static inline void
   32624 _mesa_unmarshal_StencilOpSeparate(struct gl_context *ctx, const struct marshal_cmd_StencilOpSeparate *cmd)
   32625 {
   32626    const GLenum face = cmd->face;
   32627    const GLenum sfail = cmd->sfail;
   32628    const GLenum zfail = cmd->zfail;
   32629    const GLenum zpass = cmd->zpass;
   32630    CALL_StencilOpSeparate(ctx->CurrentServerDispatch, (face, sfail, zfail, zpass));
   32631 }
   32632 static void GLAPIENTRY
   32633 _mesa_marshal_StencilOpSeparate(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass)
   32634 {
   32635    GET_CURRENT_CONTEXT(ctx);
   32636    size_t cmd_size = sizeof(struct marshal_cmd_StencilOpSeparate);
   32637    struct marshal_cmd_StencilOpSeparate *cmd;
   32638    debug_print_marshal("StencilOpSeparate");
   32639    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32640       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_StencilOpSeparate, cmd_size);
   32641       cmd->face = face;
   32642       cmd->sfail = sfail;
   32643       cmd->zfail = zfail;
   32644       cmd->zpass = zpass;
   32645       _mesa_post_marshal_hook(ctx);
   32646       return;
   32647    }
   32648 
   32649    _mesa_glthread_finish(ctx);
   32650    debug_print_sync_fallback("StencilOpSeparate");
   32651    CALL_StencilOpSeparate(ctx->CurrentServerDispatch, (face, sfail, zfail, zpass));
   32652 }
   32653 
   32654 
   32655 /* GenSamplers: marshalled synchronously */
   32656 static void GLAPIENTRY
   32657 _mesa_marshal_GenSamplers(GLsizei count, GLuint * samplers)
   32658 {
   32659    GET_CURRENT_CONTEXT(ctx);
   32660    _mesa_glthread_finish(ctx);
   32661    debug_print_sync("GenSamplers");
   32662    CALL_GenSamplers(ctx->CurrentServerDispatch, (count, samplers));
   32663 }
   32664 
   32665 
   32666 /* ClipControl: marshalled asynchronously */
   32667 struct marshal_cmd_ClipControl
   32668 {
   32669    struct marshal_cmd_base cmd_base;
   32670    GLenum origin;
   32671    GLenum depth;
   32672 };
   32673 static inline void
   32674 _mesa_unmarshal_ClipControl(struct gl_context *ctx, const struct marshal_cmd_ClipControl *cmd)
   32675 {
   32676    const GLenum origin = cmd->origin;
   32677    const GLenum depth = cmd->depth;
   32678    CALL_ClipControl(ctx->CurrentServerDispatch, (origin, depth));
   32679 }
   32680 static void GLAPIENTRY
   32681 _mesa_marshal_ClipControl(GLenum origin, GLenum depth)
   32682 {
   32683    GET_CURRENT_CONTEXT(ctx);
   32684    size_t cmd_size = sizeof(struct marshal_cmd_ClipControl);
   32685    struct marshal_cmd_ClipControl *cmd;
   32686    debug_print_marshal("ClipControl");
   32687    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32688       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClipControl, cmd_size);
   32689       cmd->origin = origin;
   32690       cmd->depth = depth;
   32691       _mesa_post_marshal_hook(ctx);
   32692       return;
   32693    }
   32694 
   32695    _mesa_glthread_finish(ctx);
   32696    debug_print_sync_fallback("ClipControl");
   32697    CALL_ClipControl(ctx->CurrentServerDispatch, (origin, depth));
   32698 }
   32699 
   32700 
   32701 /* DrawTexfOES: marshalled asynchronously */
   32702 struct marshal_cmd_DrawTexfOES
   32703 {
   32704    struct marshal_cmd_base cmd_base;
   32705    GLfloat x;
   32706    GLfloat y;
   32707    GLfloat z;
   32708    GLfloat width;
   32709    GLfloat height;
   32710 };
   32711 static inline void
   32712 _mesa_unmarshal_DrawTexfOES(struct gl_context *ctx, const struct marshal_cmd_DrawTexfOES *cmd)
   32713 {
   32714    const GLfloat x = cmd->x;
   32715    const GLfloat y = cmd->y;
   32716    const GLfloat z = cmd->z;
   32717    const GLfloat width = cmd->width;
   32718    const GLfloat height = cmd->height;
   32719    CALL_DrawTexfOES(ctx->CurrentServerDispatch, (x, y, z, width, height));
   32720 }
   32721 static void GLAPIENTRY
   32722 _mesa_marshal_DrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height)
   32723 {
   32724    GET_CURRENT_CONTEXT(ctx);
   32725    size_t cmd_size = sizeof(struct marshal_cmd_DrawTexfOES);
   32726    struct marshal_cmd_DrawTexfOES *cmd;
   32727    debug_print_marshal("DrawTexfOES");
   32728    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32729       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTexfOES, cmd_size);
   32730       cmd->x = x;
   32731       cmd->y = y;
   32732       cmd->z = z;
   32733       cmd->width = width;
   32734       cmd->height = height;
   32735       _mesa_post_marshal_hook(ctx);
   32736       return;
   32737    }
   32738 
   32739    _mesa_glthread_finish(ctx);
   32740    debug_print_sync_fallback("DrawTexfOES");
   32741    CALL_DrawTexfOES(ctx->CurrentServerDispatch, (x, y, z, width, height));
   32742 }
   32743 
   32744 
   32745 /* Uniform4i64vARB: marshalled asynchronously */
   32746 struct marshal_cmd_Uniform4i64vARB
   32747 {
   32748    struct marshal_cmd_base cmd_base;
   32749    GLint location;
   32750    GLsizei count;
   32751    /* Next safe_mul(count, 32) bytes are GLint64 value[count][4] */
   32752 };
   32753 static inline void
   32754 _mesa_unmarshal_Uniform4i64vARB(struct gl_context *ctx, const struct marshal_cmd_Uniform4i64vARB *cmd)
   32755 {
   32756    const GLint location = cmd->location;
   32757    const GLsizei count = cmd->count;
   32758    const GLint64 * value;
   32759    const char *variable_data = (const char *) (cmd + 1);
   32760    value = (const GLint64 *) variable_data;
   32761    variable_data += count * 32;
   32762    CALL_Uniform4i64vARB(ctx->CurrentServerDispatch, (location, count, value));
   32763 }
   32764 static void GLAPIENTRY
   32765 _mesa_marshal_Uniform4i64vARB(GLint location, GLsizei count, const GLint64 * value)
   32766 {
   32767    GET_CURRENT_CONTEXT(ctx);
   32768    size_t cmd_size = sizeof(struct marshal_cmd_Uniform4i64vARB) + safe_mul(count, 32);
   32769    struct marshal_cmd_Uniform4i64vARB *cmd;
   32770    debug_print_marshal("Uniform4i64vARB");
   32771    if (unlikely(safe_mul(count, 32) < 0)) {
   32772       goto fallback_to_sync;
   32773    }
   32774    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32775       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4i64vARB, cmd_size);
   32776       cmd->location = location;
   32777       cmd->count = count;
   32778       char *variable_data = (char *) (cmd + 1);
   32779       memcpy(variable_data, value, count * 32);
   32780       variable_data += count * 32;
   32781       _mesa_post_marshal_hook(ctx);
   32782       return;
   32783    }
   32784 
   32785 fallback_to_sync:
   32786    _mesa_glthread_finish(ctx);
   32787    debug_print_sync_fallback("Uniform4i64vARB");
   32788    CALL_Uniform4i64vARB(ctx->CurrentServerDispatch, (location, count, value));
   32789 }
   32790 
   32791 
   32792 /* AttachObjectARB: marshalled asynchronously */
   32793 struct marshal_cmd_AttachObjectARB
   32794 {
   32795    struct marshal_cmd_base cmd_base;
   32796    GLhandleARB containerObj;
   32797    GLhandleARB obj;
   32798 };
   32799 static inline void
   32800 _mesa_unmarshal_AttachObjectARB(struct gl_context *ctx, const struct marshal_cmd_AttachObjectARB *cmd)
   32801 {
   32802    const GLhandleARB containerObj = cmd->containerObj;
   32803    const GLhandleARB obj = cmd->obj;
   32804    CALL_AttachObjectARB(ctx->CurrentServerDispatch, (containerObj, obj));
   32805 }
   32806 static void GLAPIENTRY
   32807 _mesa_marshal_AttachObjectARB(GLhandleARB containerObj, GLhandleARB obj)
   32808 {
   32809    GET_CURRENT_CONTEXT(ctx);
   32810    size_t cmd_size = sizeof(struct marshal_cmd_AttachObjectARB);
   32811    struct marshal_cmd_AttachObjectARB *cmd;
   32812    debug_print_marshal("AttachObjectARB");
   32813    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32814       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_AttachObjectARB, cmd_size);
   32815       cmd->containerObj = containerObj;
   32816       cmd->obj = obj;
   32817       _mesa_post_marshal_hook(ctx);
   32818       return;
   32819    }
   32820 
   32821    _mesa_glthread_finish(ctx);
   32822    debug_print_sync_fallback("AttachObjectARB");
   32823    CALL_AttachObjectARB(ctx->CurrentServerDispatch, (containerObj, obj));
   32824 }
   32825 
   32826 
   32827 /* Accum: marshalled asynchronously */
   32828 struct marshal_cmd_Accum
   32829 {
   32830    struct marshal_cmd_base cmd_base;
   32831    GLenum op;
   32832    GLfloat value;
   32833 };
   32834 static inline void
   32835 _mesa_unmarshal_Accum(struct gl_context *ctx, const struct marshal_cmd_Accum *cmd)
   32836 {
   32837    const GLenum op = cmd->op;
   32838    const GLfloat value = cmd->value;
   32839    CALL_Accum(ctx->CurrentServerDispatch, (op, value));
   32840 }
   32841 static void GLAPIENTRY
   32842 _mesa_marshal_Accum(GLenum op, GLfloat value)
   32843 {
   32844    GET_CURRENT_CONTEXT(ctx);
   32845    size_t cmd_size = sizeof(struct marshal_cmd_Accum);
   32846    struct marshal_cmd_Accum *cmd;
   32847    debug_print_marshal("Accum");
   32848    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32849       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Accum, cmd_size);
   32850       cmd->op = op;
   32851       cmd->value = value;
   32852       _mesa_post_marshal_hook(ctx);
   32853       return;
   32854    }
   32855 
   32856    _mesa_glthread_finish(ctx);
   32857    debug_print_sync_fallback("Accum");
   32858    CALL_Accum(ctx->CurrentServerDispatch, (op, value));
   32859 }
   32860 
   32861 
   32862 /* GetTexImage: marshalled synchronously */
   32863 static void GLAPIENTRY
   32864 _mesa_marshal_GetTexImage(GLenum target, GLint level, GLenum format, GLenum type, GLvoid * pixels)
   32865 {
   32866    GET_CURRENT_CONTEXT(ctx);
   32867    _mesa_glthread_finish(ctx);
   32868    debug_print_sync("GetTexImage");
   32869    CALL_GetTexImage(ctx->CurrentServerDispatch, (target, level, format, type, pixels));
   32870 }
   32871 
   32872 
   32873 /* Color4x: marshalled asynchronously */
   32874 struct marshal_cmd_Color4x
   32875 {
   32876    struct marshal_cmd_base cmd_base;
   32877    GLfixed red;
   32878    GLfixed green;
   32879    GLfixed blue;
   32880    GLfixed alpha;
   32881 };
   32882 static inline void
   32883 _mesa_unmarshal_Color4x(struct gl_context *ctx, const struct marshal_cmd_Color4x *cmd)
   32884 {
   32885    const GLfixed red = cmd->red;
   32886    const GLfixed green = cmd->green;
   32887    const GLfixed blue = cmd->blue;
   32888    const GLfixed alpha = cmd->alpha;
   32889    CALL_Color4x(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   32890 }
   32891 static void GLAPIENTRY
   32892 _mesa_marshal_Color4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
   32893 {
   32894    GET_CURRENT_CONTEXT(ctx);
   32895    size_t cmd_size = sizeof(struct marshal_cmd_Color4x);
   32896    struct marshal_cmd_Color4x *cmd;
   32897    debug_print_marshal("Color4x");
   32898    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32899       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4x, cmd_size);
   32900       cmd->red = red;
   32901       cmd->green = green;
   32902       cmd->blue = blue;
   32903       cmd->alpha = alpha;
   32904       _mesa_post_marshal_hook(ctx);
   32905       return;
   32906    }
   32907 
   32908    _mesa_glthread_finish(ctx);
   32909    debug_print_sync_fallback("Color4x");
   32910    CALL_Color4x(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   32911 }
   32912 
   32913 
   32914 /* ConvolutionParameteriv: marshalled synchronously */
   32915 static void GLAPIENTRY
   32916 _mesa_marshal_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint * params)
   32917 {
   32918    GET_CURRENT_CONTEXT(ctx);
   32919    _mesa_glthread_finish(ctx);
   32920    debug_print_sync("ConvolutionParameteriv");
   32921    CALL_ConvolutionParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
   32922 }
   32923 
   32924 
   32925 /* Color4s: marshalled asynchronously */
   32926 struct marshal_cmd_Color4s
   32927 {
   32928    struct marshal_cmd_base cmd_base;
   32929    GLshort red;
   32930    GLshort green;
   32931    GLshort blue;
   32932    GLshort alpha;
   32933 };
   32934 static inline void
   32935 _mesa_unmarshal_Color4s(struct gl_context *ctx, const struct marshal_cmd_Color4s *cmd)
   32936 {
   32937    const GLshort red = cmd->red;
   32938    const GLshort green = cmd->green;
   32939    const GLshort blue = cmd->blue;
   32940    const GLshort alpha = cmd->alpha;
   32941    CALL_Color4s(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   32942 }
   32943 static void GLAPIENTRY
   32944 _mesa_marshal_Color4s(GLshort red, GLshort green, GLshort blue, GLshort alpha)
   32945 {
   32946    GET_CURRENT_CONTEXT(ctx);
   32947    size_t cmd_size = sizeof(struct marshal_cmd_Color4s);
   32948    struct marshal_cmd_Color4s *cmd;
   32949    debug_print_marshal("Color4s");
   32950    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32951       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4s, cmd_size);
   32952       cmd->red = red;
   32953       cmd->green = green;
   32954       cmd->blue = blue;
   32955       cmd->alpha = alpha;
   32956       _mesa_post_marshal_hook(ctx);
   32957       return;
   32958    }
   32959 
   32960    _mesa_glthread_finish(ctx);
   32961    debug_print_sync_fallback("Color4s");
   32962    CALL_Color4s(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   32963 }
   32964 
   32965 
   32966 /* EnableVertexAttribArray: marshalled asynchronously */
   32967 struct marshal_cmd_EnableVertexAttribArray
   32968 {
   32969    struct marshal_cmd_base cmd_base;
   32970    GLuint index;
   32971 };
   32972 static inline void
   32973 _mesa_unmarshal_EnableVertexAttribArray(struct gl_context *ctx, const struct marshal_cmd_EnableVertexAttribArray *cmd)
   32974 {
   32975    const GLuint index = cmd->index;
   32976    CALL_EnableVertexAttribArray(ctx->CurrentServerDispatch, (index));
   32977 }
   32978 static void GLAPIENTRY
   32979 _mesa_marshal_EnableVertexAttribArray(GLuint index)
   32980 {
   32981    GET_CURRENT_CONTEXT(ctx);
   32982    size_t cmd_size = sizeof(struct marshal_cmd_EnableVertexAttribArray);
   32983    struct marshal_cmd_EnableVertexAttribArray *cmd;
   32984    debug_print_marshal("EnableVertexAttribArray");
   32985    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   32986       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EnableVertexAttribArray, cmd_size);
   32987       cmd->index = index;
   32988       _mesa_post_marshal_hook(ctx);
   32989       return;
   32990    }
   32991 
   32992    _mesa_glthread_finish(ctx);
   32993    debug_print_sync_fallback("EnableVertexAttribArray");
   32994    CALL_EnableVertexAttribArray(ctx->CurrentServerDispatch, (index));
   32995 }
   32996 
   32997 
   32998 /* Color4i: marshalled asynchronously */
   32999 struct marshal_cmd_Color4i
   33000 {
   33001    struct marshal_cmd_base cmd_base;
   33002    GLint red;
   33003    GLint green;
   33004    GLint blue;
   33005    GLint alpha;
   33006 };
   33007 static inline void
   33008 _mesa_unmarshal_Color4i(struct gl_context *ctx, const struct marshal_cmd_Color4i *cmd)
   33009 {
   33010    const GLint red = cmd->red;
   33011    const GLint green = cmd->green;
   33012    const GLint blue = cmd->blue;
   33013    const GLint alpha = cmd->alpha;
   33014    CALL_Color4i(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   33015 }
   33016 static void GLAPIENTRY
   33017 _mesa_marshal_Color4i(GLint red, GLint green, GLint blue, GLint alpha)
   33018 {
   33019    GET_CURRENT_CONTEXT(ctx);
   33020    size_t cmd_size = sizeof(struct marshal_cmd_Color4i);
   33021    struct marshal_cmd_Color4i *cmd;
   33022    debug_print_marshal("Color4i");
   33023    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33024       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4i, cmd_size);
   33025       cmd->red = red;
   33026       cmd->green = green;
   33027       cmd->blue = blue;
   33028       cmd->alpha = alpha;
   33029       _mesa_post_marshal_hook(ctx);
   33030       return;
   33031    }
   33032 
   33033    _mesa_glthread_finish(ctx);
   33034    debug_print_sync_fallback("Color4i");
   33035    CALL_Color4i(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   33036 }
   33037 
   33038 
   33039 /* Color4f: marshalled asynchronously */
   33040 struct marshal_cmd_Color4f
   33041 {
   33042    struct marshal_cmd_base cmd_base;
   33043    GLfloat red;
   33044    GLfloat green;
   33045    GLfloat blue;
   33046    GLfloat alpha;
   33047 };
   33048 static inline void
   33049 _mesa_unmarshal_Color4f(struct gl_context *ctx, const struct marshal_cmd_Color4f *cmd)
   33050 {
   33051    const GLfloat red = cmd->red;
   33052    const GLfloat green = cmd->green;
   33053    const GLfloat blue = cmd->blue;
   33054    const GLfloat alpha = cmd->alpha;
   33055    CALL_Color4f(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   33056 }
   33057 static void GLAPIENTRY
   33058 _mesa_marshal_Color4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
   33059 {
   33060    GET_CURRENT_CONTEXT(ctx);
   33061    size_t cmd_size = sizeof(struct marshal_cmd_Color4f);
   33062    struct marshal_cmd_Color4f *cmd;
   33063    debug_print_marshal("Color4f");
   33064    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33065       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4f, cmd_size);
   33066       cmd->red = red;
   33067       cmd->green = green;
   33068       cmd->blue = blue;
   33069       cmd->alpha = alpha;
   33070       _mesa_post_marshal_hook(ctx);
   33071       return;
   33072    }
   33073 
   33074    _mesa_glthread_finish(ctx);
   33075    debug_print_sync_fallback("Color4f");
   33076    CALL_Color4f(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   33077 }
   33078 
   33079 
   33080 /* ShaderStorageBlockBinding: marshalled asynchronously */
   33081 struct marshal_cmd_ShaderStorageBlockBinding
   33082 {
   33083    struct marshal_cmd_base cmd_base;
   33084    GLuint program;
   33085    GLuint shaderStorageBlockIndex;
   33086    GLuint shaderStorageBlockBinding;
   33087 };
   33088 static inline void
   33089 _mesa_unmarshal_ShaderStorageBlockBinding(struct gl_context *ctx, const struct marshal_cmd_ShaderStorageBlockBinding *cmd)
   33090 {
   33091    const GLuint program = cmd->program;
   33092    const GLuint shaderStorageBlockIndex = cmd->shaderStorageBlockIndex;
   33093    const GLuint shaderStorageBlockBinding = cmd->shaderStorageBlockBinding;
   33094    CALL_ShaderStorageBlockBinding(ctx->CurrentServerDispatch, (program, shaderStorageBlockIndex, shaderStorageBlockBinding));
   33095 }
   33096 static void GLAPIENTRY
   33097 _mesa_marshal_ShaderStorageBlockBinding(GLuint program, GLuint shaderStorageBlockIndex, GLuint shaderStorageBlockBinding)
   33098 {
   33099    GET_CURRENT_CONTEXT(ctx);
   33100    size_t cmd_size = sizeof(struct marshal_cmd_ShaderStorageBlockBinding);
   33101    struct marshal_cmd_ShaderStorageBlockBinding *cmd;
   33102    debug_print_marshal("ShaderStorageBlockBinding");
   33103    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33104       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ShaderStorageBlockBinding, cmd_size);
   33105       cmd->program = program;
   33106       cmd->shaderStorageBlockIndex = shaderStorageBlockIndex;
   33107       cmd->shaderStorageBlockBinding = shaderStorageBlockBinding;
   33108       _mesa_post_marshal_hook(ctx);
   33109       return;
   33110    }
   33111 
   33112    _mesa_glthread_finish(ctx);
   33113    debug_print_sync_fallback("ShaderStorageBlockBinding");
   33114    CALL_ShaderStorageBlockBinding(ctx->CurrentServerDispatch, (program, shaderStorageBlockIndex, shaderStorageBlockBinding));
   33115 }
   33116 
   33117 
   33118 /* Color4d: marshalled asynchronously */
   33119 struct marshal_cmd_Color4d
   33120 {
   33121    struct marshal_cmd_base cmd_base;
   33122    GLdouble red;
   33123    GLdouble green;
   33124    GLdouble blue;
   33125    GLdouble alpha;
   33126 };
   33127 static inline void
   33128 _mesa_unmarshal_Color4d(struct gl_context *ctx, const struct marshal_cmd_Color4d *cmd)
   33129 {
   33130    const GLdouble red = cmd->red;
   33131    const GLdouble green = cmd->green;
   33132    const GLdouble blue = cmd->blue;
   33133    const GLdouble alpha = cmd->alpha;
   33134    CALL_Color4d(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   33135 }
   33136 static void GLAPIENTRY
   33137 _mesa_marshal_Color4d(GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha)
   33138 {
   33139    GET_CURRENT_CONTEXT(ctx);
   33140    size_t cmd_size = sizeof(struct marshal_cmd_Color4d);
   33141    struct marshal_cmd_Color4d *cmd;
   33142    debug_print_marshal("Color4d");
   33143    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33144       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4d, cmd_size);
   33145       cmd->red = red;
   33146       cmd->green = green;
   33147       cmd->blue = blue;
   33148       cmd->alpha = alpha;
   33149       _mesa_post_marshal_hook(ctx);
   33150       return;
   33151    }
   33152 
   33153    _mesa_glthread_finish(ctx);
   33154    debug_print_sync_fallback("Color4d");
   33155    CALL_Color4d(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   33156 }
   33157 
   33158 
   33159 /* Color4b: marshalled asynchronously */
   33160 struct marshal_cmd_Color4b
   33161 {
   33162    struct marshal_cmd_base cmd_base;
   33163    GLbyte red;
   33164    GLbyte green;
   33165    GLbyte blue;
   33166    GLbyte alpha;
   33167 };
   33168 static inline void
   33169 _mesa_unmarshal_Color4b(struct gl_context *ctx, const struct marshal_cmd_Color4b *cmd)
   33170 {
   33171    const GLbyte red = cmd->red;
   33172    const GLbyte green = cmd->green;
   33173    const GLbyte blue = cmd->blue;
   33174    const GLbyte alpha = cmd->alpha;
   33175    CALL_Color4b(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   33176 }
   33177 static void GLAPIENTRY
   33178 _mesa_marshal_Color4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha)
   33179 {
   33180    GET_CURRENT_CONTEXT(ctx);
   33181    size_t cmd_size = sizeof(struct marshal_cmd_Color4b);
   33182    struct marshal_cmd_Color4b *cmd;
   33183    debug_print_marshal("Color4b");
   33184    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33185       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4b, cmd_size);
   33186       cmd->red = red;
   33187       cmd->green = green;
   33188       cmd->blue = blue;
   33189       cmd->alpha = alpha;
   33190       _mesa_post_marshal_hook(ctx);
   33191       return;
   33192    }
   33193 
   33194    _mesa_glthread_finish(ctx);
   33195    debug_print_sync_fallback("Color4b");
   33196    CALL_Color4b(ctx->CurrentServerDispatch, (red, green, blue, alpha));
   33197 }
   33198 
   33199 
   33200 /* MemoryObjectParameterivEXT: marshalled synchronously */
   33201 static void GLAPIENTRY
   33202 _mesa_marshal_MemoryObjectParameterivEXT(GLuint memoryObject, GLenum pname, const GLint * params)
   33203 {
   33204    GET_CURRENT_CONTEXT(ctx);
   33205    _mesa_glthread_finish(ctx);
   33206    debug_print_sync("MemoryObjectParameterivEXT");
   33207    CALL_MemoryObjectParameterivEXT(ctx->CurrentServerDispatch, (memoryObject, pname, params));
   33208 }
   33209 
   33210 
   33211 /* GetAttachedObjectsARB: marshalled synchronously */
   33212 static void GLAPIENTRY
   33213 _mesa_marshal_GetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog)
   33214 {
   33215    GET_CURRENT_CONTEXT(ctx);
   33216    _mesa_glthread_finish(ctx);
   33217    debug_print_sync("GetAttachedObjectsARB");
   33218    CALL_GetAttachedObjectsARB(ctx->CurrentServerDispatch, (containerObj, maxLength, length, infoLog));
   33219 }
   33220 
   33221 
   33222 /* EvalCoord1fv: marshalled asynchronously */
   33223 struct marshal_cmd_EvalCoord1fv
   33224 {
   33225    struct marshal_cmd_base cmd_base;
   33226    GLfloat u[1];
   33227 };
   33228 static inline void
   33229 _mesa_unmarshal_EvalCoord1fv(struct gl_context *ctx, const struct marshal_cmd_EvalCoord1fv *cmd)
   33230 {
   33231    const GLfloat * u = cmd->u;
   33232    CALL_EvalCoord1fv(ctx->CurrentServerDispatch, (u));
   33233 }
   33234 static void GLAPIENTRY
   33235 _mesa_marshal_EvalCoord1fv(const GLfloat * u)
   33236 {
   33237    GET_CURRENT_CONTEXT(ctx);
   33238    size_t cmd_size = sizeof(struct marshal_cmd_EvalCoord1fv);
   33239    struct marshal_cmd_EvalCoord1fv *cmd;
   33240    debug_print_marshal("EvalCoord1fv");
   33241    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33242       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EvalCoord1fv, cmd_size);
   33243       memcpy(cmd->u, u, 4);
   33244       _mesa_post_marshal_hook(ctx);
   33245       return;
   33246    }
   33247 
   33248    _mesa_glthread_finish(ctx);
   33249    debug_print_sync_fallback("EvalCoord1fv");
   33250    CALL_EvalCoord1fv(ctx->CurrentServerDispatch, (u));
   33251 }
   33252 
   33253 
   33254 /* VertexAttribLFormat: marshalled asynchronously */
   33255 struct marshal_cmd_VertexAttribLFormat
   33256 {
   33257    struct marshal_cmd_base cmd_base;
   33258    GLuint attribindex;
   33259    GLint size;
   33260    GLenum type;
   33261    GLuint relativeoffset;
   33262 };
   33263 static inline void
   33264 _mesa_unmarshal_VertexAttribLFormat(struct gl_context *ctx, const struct marshal_cmd_VertexAttribLFormat *cmd)
   33265 {
   33266    const GLuint attribindex = cmd->attribindex;
   33267    const GLint size = cmd->size;
   33268    const GLenum type = cmd->type;
   33269    const GLuint relativeoffset = cmd->relativeoffset;
   33270    CALL_VertexAttribLFormat(ctx->CurrentServerDispatch, (attribindex, size, type, relativeoffset));
   33271 }
   33272 static void GLAPIENTRY
   33273 _mesa_marshal_VertexAttribLFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
   33274 {
   33275    GET_CURRENT_CONTEXT(ctx);
   33276    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribLFormat);
   33277    struct marshal_cmd_VertexAttribLFormat *cmd;
   33278    debug_print_marshal("VertexAttribLFormat");
   33279    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33280       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribLFormat, cmd_size);
   33281       cmd->attribindex = attribindex;
   33282       cmd->size = size;
   33283       cmd->type = type;
   33284       cmd->relativeoffset = relativeoffset;
   33285       _mesa_post_marshal_hook(ctx);
   33286       return;
   33287    }
   33288 
   33289    _mesa_glthread_finish(ctx);
   33290    debug_print_sync_fallback("VertexAttribLFormat");
   33291    CALL_VertexAttribLFormat(ctx->CurrentServerDispatch, (attribindex, size, type, relativeoffset));
   33292 }
   33293 
   33294 
   33295 /* VertexAttribL3d: marshalled asynchronously */
   33296 struct marshal_cmd_VertexAttribL3d
   33297 {
   33298    struct marshal_cmd_base cmd_base;
   33299    GLuint index;
   33300    GLdouble x;
   33301    GLdouble y;
   33302    GLdouble z;
   33303 };
   33304 static inline void
   33305 _mesa_unmarshal_VertexAttribL3d(struct gl_context *ctx, const struct marshal_cmd_VertexAttribL3d *cmd)
   33306 {
   33307    const GLuint index = cmd->index;
   33308    const GLdouble x = cmd->x;
   33309    const GLdouble y = cmd->y;
   33310    const GLdouble z = cmd->z;
   33311    CALL_VertexAttribL3d(ctx->CurrentServerDispatch, (index, x, y, z));
   33312 }
   33313 static void GLAPIENTRY
   33314 _mesa_marshal_VertexAttribL3d(GLuint index, GLdouble x, GLdouble y, GLdouble z)
   33315 {
   33316    GET_CURRENT_CONTEXT(ctx);
   33317    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribL3d);
   33318    struct marshal_cmd_VertexAttribL3d *cmd;
   33319    debug_print_marshal("VertexAttribL3d");
   33320    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33321       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribL3d, cmd_size);
   33322       cmd->index = index;
   33323       cmd->x = x;
   33324       cmd->y = y;
   33325       cmd->z = z;
   33326       _mesa_post_marshal_hook(ctx);
   33327       return;
   33328    }
   33329 
   33330    _mesa_glthread_finish(ctx);
   33331    debug_print_sync_fallback("VertexAttribL3d");
   33332    CALL_VertexAttribL3d(ctx->CurrentServerDispatch, (index, x, y, z));
   33333 }
   33334 
   33335 
   33336 /* ClearNamedFramebufferuiv: marshalled synchronously */
   33337 static void GLAPIENTRY
   33338 _mesa_marshal_ClearNamedFramebufferuiv(GLuint framebuffer, GLenum buffer, GLint drawbuffer, const GLuint * value)
   33339 {
   33340    GET_CURRENT_CONTEXT(ctx);
   33341    _mesa_glthread_finish(ctx);
   33342    debug_print_sync("ClearNamedFramebufferuiv");
   33343    CALL_ClearNamedFramebufferuiv(ctx->CurrentServerDispatch, (framebuffer, buffer, drawbuffer, value));
   33344 }
   33345 
   33346 
   33347 /* StencilFuncSeparate: marshalled asynchronously */
   33348 struct marshal_cmd_StencilFuncSeparate
   33349 {
   33350    struct marshal_cmd_base cmd_base;
   33351    GLenum face;
   33352    GLenum func;
   33353    GLint ref;
   33354    GLuint mask;
   33355 };
   33356 static inline void
   33357 _mesa_unmarshal_StencilFuncSeparate(struct gl_context *ctx, const struct marshal_cmd_StencilFuncSeparate *cmd)
   33358 {
   33359    const GLenum face = cmd->face;
   33360    const GLenum func = cmd->func;
   33361    const GLint ref = cmd->ref;
   33362    const GLuint mask = cmd->mask;
   33363    CALL_StencilFuncSeparate(ctx->CurrentServerDispatch, (face, func, ref, mask));
   33364 }
   33365 static void GLAPIENTRY
   33366 _mesa_marshal_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
   33367 {
   33368    GET_CURRENT_CONTEXT(ctx);
   33369    size_t cmd_size = sizeof(struct marshal_cmd_StencilFuncSeparate);
   33370    struct marshal_cmd_StencilFuncSeparate *cmd;
   33371    debug_print_marshal("StencilFuncSeparate");
   33372    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33373       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_StencilFuncSeparate, cmd_size);
   33374       cmd->face = face;
   33375       cmd->func = func;
   33376       cmd->ref = ref;
   33377       cmd->mask = mask;
   33378       _mesa_post_marshal_hook(ctx);
   33379       return;
   33380    }
   33381 
   33382    _mesa_glthread_finish(ctx);
   33383    debug_print_sync_fallback("StencilFuncSeparate");
   33384    CALL_StencilFuncSeparate(ctx->CurrentServerDispatch, (face, func, ref, mask));
   33385 }
   33386 
   33387 
   33388 /* Normal3fv: marshalled asynchronously */
   33389 struct marshal_cmd_Normal3fv
   33390 {
   33391    struct marshal_cmd_base cmd_base;
   33392    GLfloat v[3];
   33393 };
   33394 static inline void
   33395 _mesa_unmarshal_Normal3fv(struct gl_context *ctx, const struct marshal_cmd_Normal3fv *cmd)
   33396 {
   33397    const GLfloat * v = cmd->v;
   33398    CALL_Normal3fv(ctx->CurrentServerDispatch, (v));
   33399 }
   33400 static void GLAPIENTRY
   33401 _mesa_marshal_Normal3fv(const GLfloat * v)
   33402 {
   33403    GET_CURRENT_CONTEXT(ctx);
   33404    size_t cmd_size = sizeof(struct marshal_cmd_Normal3fv);
   33405    struct marshal_cmd_Normal3fv *cmd;
   33406    debug_print_marshal("Normal3fv");
   33407    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33408       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Normal3fv, cmd_size);
   33409       memcpy(cmd->v, v, 12);
   33410       _mesa_post_marshal_hook(ctx);
   33411       return;
   33412    }
   33413 
   33414    _mesa_glthread_finish(ctx);
   33415    debug_print_sync_fallback("Normal3fv");
   33416    CALL_Normal3fv(ctx->CurrentServerDispatch, (v));
   33417 }
   33418 
   33419 
   33420 /* NormalP3ui: marshalled asynchronously */
   33421 struct marshal_cmd_NormalP3ui
   33422 {
   33423    struct marshal_cmd_base cmd_base;
   33424    GLenum type;
   33425    GLuint coords;
   33426 };
   33427 static inline void
   33428 _mesa_unmarshal_NormalP3ui(struct gl_context *ctx, const struct marshal_cmd_NormalP3ui *cmd)
   33429 {
   33430    const GLenum type = cmd->type;
   33431    const GLuint coords = cmd->coords;
   33432    CALL_NormalP3ui(ctx->CurrentServerDispatch, (type, coords));
   33433 }
   33434 static void GLAPIENTRY
   33435 _mesa_marshal_NormalP3ui(GLenum type, GLuint coords)
   33436 {
   33437    GET_CURRENT_CONTEXT(ctx);
   33438    size_t cmd_size = sizeof(struct marshal_cmd_NormalP3ui);
   33439    struct marshal_cmd_NormalP3ui *cmd;
   33440    debug_print_marshal("NormalP3ui");
   33441    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33442       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NormalP3ui, cmd_size);
   33443       cmd->type = type;
   33444       cmd->coords = coords;
   33445       _mesa_post_marshal_hook(ctx);
   33446       return;
   33447    }
   33448 
   33449    _mesa_glthread_finish(ctx);
   33450    debug_print_sync_fallback("NormalP3ui");
   33451    CALL_NormalP3ui(ctx->CurrentServerDispatch, (type, coords));
   33452 }
   33453 
   33454 
   33455 /* CreateSamplers: marshalled synchronously */
   33456 static void GLAPIENTRY
   33457 _mesa_marshal_CreateSamplers(GLsizei n, GLuint * samplers)
   33458 {
   33459    GET_CURRENT_CONTEXT(ctx);
   33460    _mesa_glthread_finish(ctx);
   33461    debug_print_sync("CreateSamplers");
   33462    CALL_CreateSamplers(ctx->CurrentServerDispatch, (n, samplers));
   33463 }
   33464 
   33465 
   33466 /* MultiTexCoord3fvARB: marshalled asynchronously */
   33467 struct marshal_cmd_MultiTexCoord3fvARB
   33468 {
   33469    struct marshal_cmd_base cmd_base;
   33470    GLenum target;
   33471    GLfloat v[3];
   33472 };
   33473 static inline void
   33474 _mesa_unmarshal_MultiTexCoord3fvARB(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3fvARB *cmd)
   33475 {
   33476    const GLenum target = cmd->target;
   33477    const GLfloat * v = cmd->v;
   33478    CALL_MultiTexCoord3fvARB(ctx->CurrentServerDispatch, (target, v));
   33479 }
   33480 static void GLAPIENTRY
   33481 _mesa_marshal_MultiTexCoord3fvARB(GLenum target, const GLfloat * v)
   33482 {
   33483    GET_CURRENT_CONTEXT(ctx);
   33484    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3fvARB);
   33485    struct marshal_cmd_MultiTexCoord3fvARB *cmd;
   33486    debug_print_marshal("MultiTexCoord3fvARB");
   33487    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33488       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3fvARB, cmd_size);
   33489       cmd->target = target;
   33490       memcpy(cmd->v, v, 12);
   33491       _mesa_post_marshal_hook(ctx);
   33492       return;
   33493    }
   33494 
   33495    _mesa_glthread_finish(ctx);
   33496    debug_print_sync_fallback("MultiTexCoord3fvARB");
   33497    CALL_MultiTexCoord3fvARB(ctx->CurrentServerDispatch, (target, v));
   33498 }
   33499 
   33500 
   33501 /* TexSubImage2D: marshalled synchronously */
   33502 static void GLAPIENTRY
   33503 _mesa_marshal_TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid * pixels)
   33504 {
   33505    GET_CURRENT_CONTEXT(ctx);
   33506    _mesa_glthread_finish(ctx);
   33507    debug_print_sync("TexSubImage2D");
   33508    CALL_TexSubImage2D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, width, height, format, type, pixels));
   33509 }
   33510 
   33511 
   33512 /* TexGenfv: marshalled synchronously */
   33513 static void GLAPIENTRY
   33514 _mesa_marshal_TexGenfv(GLenum coord, GLenum pname, const GLfloat * params)
   33515 {
   33516    GET_CURRENT_CONTEXT(ctx);
   33517    _mesa_glthread_finish(ctx);
   33518    debug_print_sync("TexGenfv");
   33519    CALL_TexGenfv(ctx->CurrentServerDispatch, (coord, pname, params));
   33520 }
   33521 
   33522 
   33523 /* GetVertexAttribiv: marshalled synchronously */
   33524 static void GLAPIENTRY
   33525 _mesa_marshal_GetVertexAttribiv(GLuint index, GLenum pname, GLint * params)
   33526 {
   33527    GET_CURRENT_CONTEXT(ctx);
   33528    _mesa_glthread_finish(ctx);
   33529    debug_print_sync("GetVertexAttribiv");
   33530    CALL_GetVertexAttribiv(ctx->CurrentServerDispatch, (index, pname, params));
   33531 }
   33532 
   33533 
   33534 /* TexCoordP2uiv: marshalled synchronously */
   33535 static void GLAPIENTRY
   33536 _mesa_marshal_TexCoordP2uiv(GLenum type, const GLuint * coords)
   33537 {
   33538    GET_CURRENT_CONTEXT(ctx);
   33539    _mesa_glthread_finish(ctx);
   33540    debug_print_sync("TexCoordP2uiv");
   33541    CALL_TexCoordP2uiv(ctx->CurrentServerDispatch, (type, coords));
   33542 }
   33543 
   33544 
   33545 /* Uniform3fv: marshalled asynchronously */
   33546 struct marshal_cmd_Uniform3fv
   33547 {
   33548    struct marshal_cmd_base cmd_base;
   33549    GLint location;
   33550    GLsizei count;
   33551    /* Next safe_mul(count, 12) bytes are GLfloat value[count][3] */
   33552 };
   33553 static inline void
   33554 _mesa_unmarshal_Uniform3fv(struct gl_context *ctx, const struct marshal_cmd_Uniform3fv *cmd)
   33555 {
   33556    const GLint location = cmd->location;
   33557    const GLsizei count = cmd->count;
   33558    const GLfloat * value;
   33559    const char *variable_data = (const char *) (cmd + 1);
   33560    value = (const GLfloat *) variable_data;
   33561    variable_data += count * 12;
   33562    CALL_Uniform3fv(ctx->CurrentServerDispatch, (location, count, value));
   33563 }
   33564 static void GLAPIENTRY
   33565 _mesa_marshal_Uniform3fv(GLint location, GLsizei count, const GLfloat * value)
   33566 {
   33567    GET_CURRENT_CONTEXT(ctx);
   33568    size_t cmd_size = sizeof(struct marshal_cmd_Uniform3fv) + safe_mul(count, 12);
   33569    struct marshal_cmd_Uniform3fv *cmd;
   33570    debug_print_marshal("Uniform3fv");
   33571    if (unlikely(safe_mul(count, 12) < 0)) {
   33572       goto fallback_to_sync;
   33573    }
   33574    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33575       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3fv, cmd_size);
   33576       cmd->location = location;
   33577       cmd->count = count;
   33578       char *variable_data = (char *) (cmd + 1);
   33579       memcpy(variable_data, value, count * 12);
   33580       variable_data += count * 12;
   33581       _mesa_post_marshal_hook(ctx);
   33582       return;
   33583    }
   33584 
   33585 fallback_to_sync:
   33586    _mesa_glthread_finish(ctx);
   33587    debug_print_sync_fallback("Uniform3fv");
   33588    CALL_Uniform3fv(ctx->CurrentServerDispatch, (location, count, value));
   33589 }
   33590 
   33591 
   33592 /* BlendEquation: marshalled asynchronously */
   33593 struct marshal_cmd_BlendEquation
   33594 {
   33595    struct marshal_cmd_base cmd_base;
   33596    GLenum mode;
   33597 };
   33598 static inline void
   33599 _mesa_unmarshal_BlendEquation(struct gl_context *ctx, const struct marshal_cmd_BlendEquation *cmd)
   33600 {
   33601    const GLenum mode = cmd->mode;
   33602    CALL_BlendEquation(ctx->CurrentServerDispatch, (mode));
   33603 }
   33604 static void GLAPIENTRY
   33605 _mesa_marshal_BlendEquation(GLenum mode)
   33606 {
   33607    GET_CURRENT_CONTEXT(ctx);
   33608    size_t cmd_size = sizeof(struct marshal_cmd_BlendEquation);
   33609    struct marshal_cmd_BlendEquation *cmd;
   33610    debug_print_marshal("BlendEquation");
   33611    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33612       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendEquation, cmd_size);
   33613       cmd->mode = mode;
   33614       _mesa_post_marshal_hook(ctx);
   33615       return;
   33616    }
   33617 
   33618    _mesa_glthread_finish(ctx);
   33619    debug_print_sync_fallback("BlendEquation");
   33620    CALL_BlendEquation(ctx->CurrentServerDispatch, (mode));
   33621 }
   33622 
   33623 
   33624 /* VertexAttrib3dNV: marshalled asynchronously */
   33625 struct marshal_cmd_VertexAttrib3dNV
   33626 {
   33627    struct marshal_cmd_base cmd_base;
   33628    GLuint index;
   33629    GLdouble x;
   33630    GLdouble y;
   33631    GLdouble z;
   33632 };
   33633 static inline void
   33634 _mesa_unmarshal_VertexAttrib3dNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3dNV *cmd)
   33635 {
   33636    const GLuint index = cmd->index;
   33637    const GLdouble x = cmd->x;
   33638    const GLdouble y = cmd->y;
   33639    const GLdouble z = cmd->z;
   33640    CALL_VertexAttrib3dNV(ctx->CurrentServerDispatch, (index, x, y, z));
   33641 }
   33642 static void GLAPIENTRY
   33643 _mesa_marshal_VertexAttrib3dNV(GLuint index, GLdouble x, GLdouble y, GLdouble z)
   33644 {
   33645    GET_CURRENT_CONTEXT(ctx);
   33646    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib3dNV);
   33647    struct marshal_cmd_VertexAttrib3dNV *cmd;
   33648    debug_print_marshal("VertexAttrib3dNV");
   33649    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33650       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3dNV, cmd_size);
   33651       cmd->index = index;
   33652       cmd->x = x;
   33653       cmd->y = y;
   33654       cmd->z = z;
   33655       _mesa_post_marshal_hook(ctx);
   33656       return;
   33657    }
   33658 
   33659    _mesa_glthread_finish(ctx);
   33660    debug_print_sync_fallback("VertexAttrib3dNV");
   33661    CALL_VertexAttrib3dNV(ctx->CurrentServerDispatch, (index, x, y, z));
   33662 }
   33663 
   33664 
   33665 /* PushName: marshalled asynchronously */
   33666 struct marshal_cmd_PushName
   33667 {
   33668    struct marshal_cmd_base cmd_base;
   33669    GLuint name;
   33670 };
   33671 static inline void
   33672 _mesa_unmarshal_PushName(struct gl_context *ctx, const struct marshal_cmd_PushName *cmd)
   33673 {
   33674    const GLuint name = cmd->name;
   33675    CALL_PushName(ctx->CurrentServerDispatch, (name));
   33676 }
   33677 static void GLAPIENTRY
   33678 _mesa_marshal_PushName(GLuint name)
   33679 {
   33680    GET_CURRENT_CONTEXT(ctx);
   33681    size_t cmd_size = sizeof(struct marshal_cmd_PushName);
   33682    struct marshal_cmd_PushName *cmd;
   33683    debug_print_marshal("PushName");
   33684    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33685       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PushName, cmd_size);
   33686       cmd->name = name;
   33687       _mesa_post_marshal_hook(ctx);
   33688       return;
   33689    }
   33690 
   33691    _mesa_glthread_finish(ctx);
   33692    debug_print_sync_fallback("PushName");
   33693    CALL_PushName(ctx->CurrentServerDispatch, (name));
   33694 }
   33695 
   33696 
   33697 /* DeleteRenderbuffers: marshalled asynchronously */
   33698 struct marshal_cmd_DeleteRenderbuffers
   33699 {
   33700    struct marshal_cmd_base cmd_base;
   33701    GLsizei n;
   33702    /* Next safe_mul(n, 4) bytes are GLuint renderbuffers[n] */
   33703 };
   33704 static inline void
   33705 _mesa_unmarshal_DeleteRenderbuffers(struct gl_context *ctx, const struct marshal_cmd_DeleteRenderbuffers *cmd)
   33706 {
   33707    const GLsizei n = cmd->n;
   33708    const GLuint * renderbuffers;
   33709    const char *variable_data = (const char *) (cmd + 1);
   33710    renderbuffers = (const GLuint *) variable_data;
   33711    variable_data += n * 4;
   33712    CALL_DeleteRenderbuffers(ctx->CurrentServerDispatch, (n, renderbuffers));
   33713 }
   33714 static void GLAPIENTRY
   33715 _mesa_marshal_DeleteRenderbuffers(GLsizei n, const GLuint * renderbuffers)
   33716 {
   33717    GET_CURRENT_CONTEXT(ctx);
   33718    size_t cmd_size = sizeof(struct marshal_cmd_DeleteRenderbuffers) + safe_mul(n, 4);
   33719    struct marshal_cmd_DeleteRenderbuffers *cmd;
   33720    debug_print_marshal("DeleteRenderbuffers");
   33721    if (unlikely(safe_mul(n, 4) < 0)) {
   33722       goto fallback_to_sync;
   33723    }
   33724    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33725       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteRenderbuffers, cmd_size);
   33726       cmd->n = n;
   33727       char *variable_data = (char *) (cmd + 1);
   33728       memcpy(variable_data, renderbuffers, n * 4);
   33729       variable_data += n * 4;
   33730       _mesa_post_marshal_hook(ctx);
   33731       return;
   33732    }
   33733 
   33734 fallback_to_sync:
   33735    _mesa_glthread_finish(ctx);
   33736    debug_print_sync_fallback("DeleteRenderbuffers");
   33737    CALL_DeleteRenderbuffers(ctx->CurrentServerDispatch, (n, renderbuffers));
   33738 }
   33739 
   33740 
   33741 /* VertexAttrib1dv: marshalled asynchronously */
   33742 struct marshal_cmd_VertexAttrib1dv
   33743 {
   33744    struct marshal_cmd_base cmd_base;
   33745    GLuint index;
   33746    GLdouble v[1];
   33747 };
   33748 static inline void
   33749 _mesa_unmarshal_VertexAttrib1dv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1dv *cmd)
   33750 {
   33751    const GLuint index = cmd->index;
   33752    const GLdouble * v = cmd->v;
   33753    CALL_VertexAttrib1dv(ctx->CurrentServerDispatch, (index, v));
   33754 }
   33755 static void GLAPIENTRY
   33756 _mesa_marshal_VertexAttrib1dv(GLuint index, const GLdouble * v)
   33757 {
   33758    GET_CURRENT_CONTEXT(ctx);
   33759    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib1dv);
   33760    struct marshal_cmd_VertexAttrib1dv *cmd;
   33761    debug_print_marshal("VertexAttrib1dv");
   33762    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33763       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1dv, cmd_size);
   33764       cmd->index = index;
   33765       memcpy(cmd->v, v, 8);
   33766       _mesa_post_marshal_hook(ctx);
   33767       return;
   33768    }
   33769 
   33770    _mesa_glthread_finish(ctx);
   33771    debug_print_sync_fallback("VertexAttrib1dv");
   33772    CALL_VertexAttrib1dv(ctx->CurrentServerDispatch, (index, v));
   33773 }
   33774 
   33775 
   33776 /* IsShader: marshalled synchronously */
   33777 static GLboolean GLAPIENTRY
   33778 _mesa_marshal_IsShader(GLuint shader)
   33779 {
   33780    GET_CURRENT_CONTEXT(ctx);
   33781    _mesa_glthread_finish(ctx);
   33782    debug_print_sync("IsShader");
   33783    return CALL_IsShader(ctx->CurrentServerDispatch, (shader));
   33784 }
   33785 
   33786 
   33787 /* Rotated: marshalled asynchronously */
   33788 struct marshal_cmd_Rotated
   33789 {
   33790    struct marshal_cmd_base cmd_base;
   33791    GLdouble angle;
   33792    GLdouble x;
   33793    GLdouble y;
   33794    GLdouble z;
   33795 };
   33796 static inline void
   33797 _mesa_unmarshal_Rotated(struct gl_context *ctx, const struct marshal_cmd_Rotated *cmd)
   33798 {
   33799    const GLdouble angle = cmd->angle;
   33800    const GLdouble x = cmd->x;
   33801    const GLdouble y = cmd->y;
   33802    const GLdouble z = cmd->z;
   33803    CALL_Rotated(ctx->CurrentServerDispatch, (angle, x, y, z));
   33804 }
   33805 static void GLAPIENTRY
   33806 _mesa_marshal_Rotated(GLdouble angle, GLdouble x, GLdouble y, GLdouble z)
   33807 {
   33808    GET_CURRENT_CONTEXT(ctx);
   33809    size_t cmd_size = sizeof(struct marshal_cmd_Rotated);
   33810    struct marshal_cmd_Rotated *cmd;
   33811    debug_print_marshal("Rotated");
   33812    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33813       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Rotated, cmd_size);
   33814       cmd->angle = angle;
   33815       cmd->x = x;
   33816       cmd->y = y;
   33817       cmd->z = z;
   33818       _mesa_post_marshal_hook(ctx);
   33819       return;
   33820    }
   33821 
   33822    _mesa_glthread_finish(ctx);
   33823    debug_print_sync_fallback("Rotated");
   33824    CALL_Rotated(ctx->CurrentServerDispatch, (angle, x, y, z));
   33825 }
   33826 
   33827 
   33828 /* Color4iv: marshalled asynchronously */
   33829 struct marshal_cmd_Color4iv
   33830 {
   33831    struct marshal_cmd_base cmd_base;
   33832    GLint v[4];
   33833 };
   33834 static inline void
   33835 _mesa_unmarshal_Color4iv(struct gl_context *ctx, const struct marshal_cmd_Color4iv *cmd)
   33836 {
   33837    const GLint * v = cmd->v;
   33838    CALL_Color4iv(ctx->CurrentServerDispatch, (v));
   33839 }
   33840 static void GLAPIENTRY
   33841 _mesa_marshal_Color4iv(const GLint * v)
   33842 {
   33843    GET_CURRENT_CONTEXT(ctx);
   33844    size_t cmd_size = sizeof(struct marshal_cmd_Color4iv);
   33845    struct marshal_cmd_Color4iv *cmd;
   33846    debug_print_marshal("Color4iv");
   33847    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33848       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4iv, cmd_size);
   33849       memcpy(cmd->v, v, 16);
   33850       _mesa_post_marshal_hook(ctx);
   33851       return;
   33852    }
   33853 
   33854    _mesa_glthread_finish(ctx);
   33855    debug_print_sync_fallback("Color4iv");
   33856    CALL_Color4iv(ctx->CurrentServerDispatch, (v));
   33857 }
   33858 
   33859 
   33860 /* PointParameterxv: marshalled synchronously */
   33861 static void GLAPIENTRY
   33862 _mesa_marshal_PointParameterxv(GLenum pname, const GLfixed * params)
   33863 {
   33864    GET_CURRENT_CONTEXT(ctx);
   33865    _mesa_glthread_finish(ctx);
   33866    debug_print_sync("PointParameterxv");
   33867    CALL_PointParameterxv(ctx->CurrentServerDispatch, (pname, params));
   33868 }
   33869 
   33870 
   33871 /* Rotatex: marshalled asynchronously */
   33872 struct marshal_cmd_Rotatex
   33873 {
   33874    struct marshal_cmd_base cmd_base;
   33875    GLfixed angle;
   33876    GLfixed x;
   33877    GLfixed y;
   33878    GLfixed z;
   33879 };
   33880 static inline void
   33881 _mesa_unmarshal_Rotatex(struct gl_context *ctx, const struct marshal_cmd_Rotatex *cmd)
   33882 {
   33883    const GLfixed angle = cmd->angle;
   33884    const GLfixed x = cmd->x;
   33885    const GLfixed y = cmd->y;
   33886    const GLfixed z = cmd->z;
   33887    CALL_Rotatex(ctx->CurrentServerDispatch, (angle, x, y, z));
   33888 }
   33889 static void GLAPIENTRY
   33890 _mesa_marshal_Rotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z)
   33891 {
   33892    GET_CURRENT_CONTEXT(ctx);
   33893    size_t cmd_size = sizeof(struct marshal_cmd_Rotatex);
   33894    struct marshal_cmd_Rotatex *cmd;
   33895    debug_print_marshal("Rotatex");
   33896    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33897       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Rotatex, cmd_size);
   33898       cmd->angle = angle;
   33899       cmd->x = x;
   33900       cmd->y = y;
   33901       cmd->z = z;
   33902       _mesa_post_marshal_hook(ctx);
   33903       return;
   33904    }
   33905 
   33906    _mesa_glthread_finish(ctx);
   33907    debug_print_sync_fallback("Rotatex");
   33908    CALL_Rotatex(ctx->CurrentServerDispatch, (angle, x, y, z));
   33909 }
   33910 
   33911 
   33912 /* FramebufferTextureLayer: marshalled asynchronously */
   33913 struct marshal_cmd_FramebufferTextureLayer
   33914 {
   33915    struct marshal_cmd_base cmd_base;
   33916    GLenum target;
   33917    GLenum attachment;
   33918    GLuint texture;
   33919    GLint level;
   33920    GLint layer;
   33921 };
   33922 static inline void
   33923 _mesa_unmarshal_FramebufferTextureLayer(struct gl_context *ctx, const struct marshal_cmd_FramebufferTextureLayer *cmd)
   33924 {
   33925    const GLenum target = cmd->target;
   33926    const GLenum attachment = cmd->attachment;
   33927    const GLuint texture = cmd->texture;
   33928    const GLint level = cmd->level;
   33929    const GLint layer = cmd->layer;
   33930    CALL_FramebufferTextureLayer(ctx->CurrentServerDispatch, (target, attachment, texture, level, layer));
   33931 }
   33932 static void GLAPIENTRY
   33933 _mesa_marshal_FramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
   33934 {
   33935    GET_CURRENT_CONTEXT(ctx);
   33936    size_t cmd_size = sizeof(struct marshal_cmd_FramebufferTextureLayer);
   33937    struct marshal_cmd_FramebufferTextureLayer *cmd;
   33938    debug_print_marshal("FramebufferTextureLayer");
   33939    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   33940       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferTextureLayer, cmd_size);
   33941       cmd->target = target;
   33942       cmd->attachment = attachment;
   33943       cmd->texture = texture;
   33944       cmd->level = level;
   33945       cmd->layer = layer;
   33946       _mesa_post_marshal_hook(ctx);
   33947       return;
   33948    }
   33949 
   33950    _mesa_glthread_finish(ctx);
   33951    debug_print_sync_fallback("FramebufferTextureLayer");
   33952    CALL_FramebufferTextureLayer(ctx->CurrentServerDispatch, (target, attachment, texture, level, layer));
   33953 }
   33954 
   33955 
   33956 /* TexEnvfv: marshalled synchronously */
   33957 static void GLAPIENTRY
   33958 _mesa_marshal_TexEnvfv(GLenum target, GLenum pname, const GLfloat * params)
   33959 {
   33960    GET_CURRENT_CONTEXT(ctx);
   33961    _mesa_glthread_finish(ctx);
   33962    debug_print_sync("TexEnvfv");
   33963    CALL_TexEnvfv(ctx->CurrentServerDispatch, (target, pname, params));
   33964 }
   33965 
   33966 
   33967 /* ProgramUniformMatrix3fv: marshalled asynchronously */
   33968 struct marshal_cmd_ProgramUniformMatrix3fv
   33969 {
   33970    struct marshal_cmd_base cmd_base;
   33971    GLuint program;
   33972    GLint location;
   33973    GLsizei count;
   33974    GLboolean transpose;
   33975    /* Next safe_mul(count, 36) bytes are GLfloat value[count][9] */
   33976 };
   33977 static inline void
   33978 _mesa_unmarshal_ProgramUniformMatrix3fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix3fv *cmd)
   33979 {
   33980    const GLuint program = cmd->program;
   33981    const GLint location = cmd->location;
   33982    const GLsizei count = cmd->count;
   33983    const GLboolean transpose = cmd->transpose;
   33984    const GLfloat * value;
   33985    const char *variable_data = (const char *) (cmd + 1);
   33986    value = (const GLfloat *) variable_data;
   33987    variable_data += count * 36;
   33988    CALL_ProgramUniformMatrix3fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   33989 }
   33990 static void GLAPIENTRY
   33991 _mesa_marshal_ProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   33992 {
   33993    GET_CURRENT_CONTEXT(ctx);
   33994    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix3fv) + safe_mul(count, 36);
   33995    struct marshal_cmd_ProgramUniformMatrix3fv *cmd;
   33996    debug_print_marshal("ProgramUniformMatrix3fv");
   33997    if (unlikely(safe_mul(count, 36) < 0)) {
   33998       goto fallback_to_sync;
   33999    }
   34000    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34001       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix3fv, cmd_size);
   34002       cmd->program = program;
   34003       cmd->location = location;
   34004       cmd->count = count;
   34005       cmd->transpose = transpose;
   34006       char *variable_data = (char *) (cmd + 1);
   34007       memcpy(variable_data, value, count * 36);
   34008       variable_data += count * 36;
   34009       _mesa_post_marshal_hook(ctx);
   34010       return;
   34011    }
   34012 
   34013 fallback_to_sync:
   34014    _mesa_glthread_finish(ctx);
   34015    debug_print_sync_fallback("ProgramUniformMatrix3fv");
   34016    CALL_ProgramUniformMatrix3fv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   34017 }
   34018 
   34019 
   34020 /* DeleteMemoryObjectsEXT: marshalled synchronously */
   34021 static void GLAPIENTRY
   34022 _mesa_marshal_DeleteMemoryObjectsEXT(GLsizei n, const GLuint * memoryObjects)
   34023 {
   34024    GET_CURRENT_CONTEXT(ctx);
   34025    _mesa_glthread_finish(ctx);
   34026    debug_print_sync("DeleteMemoryObjectsEXT");
   34027    CALL_DeleteMemoryObjectsEXT(ctx->CurrentServerDispatch, (n, memoryObjects));
   34028 }
   34029 
   34030 
   34031 /* LoadMatrixf: marshalled asynchronously */
   34032 struct marshal_cmd_LoadMatrixf
   34033 {
   34034    struct marshal_cmd_base cmd_base;
   34035    GLfloat m[16];
   34036 };
   34037 static inline void
   34038 _mesa_unmarshal_LoadMatrixf(struct gl_context *ctx, const struct marshal_cmd_LoadMatrixf *cmd)
   34039 {
   34040    const GLfloat * m = cmd->m;
   34041    CALL_LoadMatrixf(ctx->CurrentServerDispatch, (m));
   34042 }
   34043 static void GLAPIENTRY
   34044 _mesa_marshal_LoadMatrixf(const GLfloat * m)
   34045 {
   34046    GET_CURRENT_CONTEXT(ctx);
   34047    size_t cmd_size = sizeof(struct marshal_cmd_LoadMatrixf);
   34048    struct marshal_cmd_LoadMatrixf *cmd;
   34049    debug_print_marshal("LoadMatrixf");
   34050    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34051       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LoadMatrixf, cmd_size);
   34052       memcpy(cmd->m, m, 64);
   34053       _mesa_post_marshal_hook(ctx);
   34054       return;
   34055    }
   34056 
   34057    _mesa_glthread_finish(ctx);
   34058    debug_print_sync_fallback("LoadMatrixf");
   34059    CALL_LoadMatrixf(ctx->CurrentServerDispatch, (m));
   34060 }
   34061 
   34062 
   34063 /* GetProgramLocalParameterfvARB: marshalled synchronously */
   34064 static void GLAPIENTRY
   34065 _mesa_marshal_GetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat * params)
   34066 {
   34067    GET_CURRENT_CONTEXT(ctx);
   34068    _mesa_glthread_finish(ctx);
   34069    debug_print_sync("GetProgramLocalParameterfvARB");
   34070    CALL_GetProgramLocalParameterfvARB(ctx->CurrentServerDispatch, (target, index, params));
   34071 }
   34072 
   34073 
   34074 /* MakeTextureHandleResidentARB: marshalled asynchronously */
   34075 struct marshal_cmd_MakeTextureHandleResidentARB
   34076 {
   34077    struct marshal_cmd_base cmd_base;
   34078    GLuint64 handle;
   34079 };
   34080 static inline void
   34081 _mesa_unmarshal_MakeTextureHandleResidentARB(struct gl_context *ctx, const struct marshal_cmd_MakeTextureHandleResidentARB *cmd)
   34082 {
   34083    const GLuint64 handle = cmd->handle;
   34084    CALL_MakeTextureHandleResidentARB(ctx->CurrentServerDispatch, (handle));
   34085 }
   34086 static void GLAPIENTRY
   34087 _mesa_marshal_MakeTextureHandleResidentARB(GLuint64 handle)
   34088 {
   34089    GET_CURRENT_CONTEXT(ctx);
   34090    size_t cmd_size = sizeof(struct marshal_cmd_MakeTextureHandleResidentARB);
   34091    struct marshal_cmd_MakeTextureHandleResidentARB *cmd;
   34092    debug_print_marshal("MakeTextureHandleResidentARB");
   34093    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34094       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MakeTextureHandleResidentARB, cmd_size);
   34095       cmd->handle = handle;
   34096       _mesa_post_marshal_hook(ctx);
   34097       return;
   34098    }
   34099 
   34100    _mesa_glthread_finish(ctx);
   34101    debug_print_sync_fallback("MakeTextureHandleResidentARB");
   34102    CALL_MakeTextureHandleResidentARB(ctx->CurrentServerDispatch, (handle));
   34103 }
   34104 
   34105 
   34106 /* MultiDrawArraysIndirect: marshalled synchronously */
   34107 static void GLAPIENTRY
   34108 _mesa_marshal_MultiDrawArraysIndirect(GLenum mode, const GLvoid * indirect, GLsizei primcount, GLsizei stride)
   34109 {
   34110    GET_CURRENT_CONTEXT(ctx);
   34111    _mesa_glthread_finish(ctx);
   34112    debug_print_sync("MultiDrawArraysIndirect");
   34113    CALL_MultiDrawArraysIndirect(ctx->CurrentServerDispatch, (mode, indirect, primcount, stride));
   34114 }
   34115 
   34116 
   34117 /* DrawRangeElementsBaseVertex: marshalled asynchronously */
   34118 struct marshal_cmd_DrawRangeElementsBaseVertex
   34119 {
   34120    struct marshal_cmd_base cmd_base;
   34121    GLenum mode;
   34122    GLuint start;
   34123    GLuint end;
   34124    GLsizei count;
   34125    GLenum type;
   34126    const GLvoid * indices;
   34127    GLint basevertex;
   34128 };
   34129 static inline void
   34130 _mesa_unmarshal_DrawRangeElementsBaseVertex(struct gl_context *ctx, const struct marshal_cmd_DrawRangeElementsBaseVertex *cmd)
   34131 {
   34132    const GLenum mode = cmd->mode;
   34133    const GLuint start = cmd->start;
   34134    const GLuint end = cmd->end;
   34135    const GLsizei count = cmd->count;
   34136    const GLenum type = cmd->type;
   34137    const GLvoid * indices = cmd->indices;
   34138    const GLint basevertex = cmd->basevertex;
   34139    CALL_DrawRangeElementsBaseVertex(ctx->CurrentServerDispatch, (mode, start, end, count, type, indices, basevertex));
   34140 }
   34141 static void GLAPIENTRY
   34142 _mesa_marshal_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex)
   34143 {
   34144    GET_CURRENT_CONTEXT(ctx);
   34145    size_t cmd_size = sizeof(struct marshal_cmd_DrawRangeElementsBaseVertex);
   34146    struct marshal_cmd_DrawRangeElementsBaseVertex *cmd;
   34147    debug_print_marshal("DrawRangeElementsBaseVertex");
   34148    if (_mesa_glthread_is_non_vbo_draw_elements(ctx)) {
   34149       _mesa_glthread_finish(ctx);
   34150       _mesa_glthread_restore_dispatch(ctx);
   34151       debug_print_sync_fallback("DrawRangeElementsBaseVertex");
   34152       CALL_DrawRangeElementsBaseVertex(ctx->CurrentServerDispatch, (mode, start, end, count, type, indices, basevertex));
   34153       return;
   34154    }
   34155    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34156       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawRangeElementsBaseVertex, cmd_size);
   34157       cmd->mode = mode;
   34158       cmd->start = start;
   34159       cmd->end = end;
   34160       cmd->count = count;
   34161       cmd->type = type;
   34162       cmd->indices = indices;
   34163       cmd->basevertex = basevertex;
   34164       _mesa_post_marshal_hook(ctx);
   34165       return;
   34166    }
   34167 
   34168    _mesa_glthread_finish(ctx);
   34169    debug_print_sync_fallback("DrawRangeElementsBaseVertex");
   34170    CALL_DrawRangeElementsBaseVertex(ctx->CurrentServerDispatch, (mode, start, end, count, type, indices, basevertex));
   34171 }
   34172 
   34173 
   34174 /* ProgramUniformMatrix4dv: marshalled asynchronously */
   34175 struct marshal_cmd_ProgramUniformMatrix4dv
   34176 {
   34177    struct marshal_cmd_base cmd_base;
   34178    GLuint program;
   34179    GLint location;
   34180    GLsizei count;
   34181    GLboolean transpose;
   34182    /* Next safe_mul(count, 128) bytes are GLdouble value[count][16] */
   34183 };
   34184 static inline void
   34185 _mesa_unmarshal_ProgramUniformMatrix4dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix4dv *cmd)
   34186 {
   34187    const GLuint program = cmd->program;
   34188    const GLint location = cmd->location;
   34189    const GLsizei count = cmd->count;
   34190    const GLboolean transpose = cmd->transpose;
   34191    const GLdouble * value;
   34192    const char *variable_data = (const char *) (cmd + 1);
   34193    value = (const GLdouble *) variable_data;
   34194    variable_data += count * 128;
   34195    CALL_ProgramUniformMatrix4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   34196 }
   34197 static void GLAPIENTRY
   34198 _mesa_marshal_ProgramUniformMatrix4dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   34199 {
   34200    GET_CURRENT_CONTEXT(ctx);
   34201    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix4dv) + safe_mul(count, 128);
   34202    struct marshal_cmd_ProgramUniformMatrix4dv *cmd;
   34203    debug_print_marshal("ProgramUniformMatrix4dv");
   34204    if (unlikely(safe_mul(count, 128) < 0)) {
   34205       goto fallback_to_sync;
   34206    }
   34207    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34208       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix4dv, cmd_size);
   34209       cmd->program = program;
   34210       cmd->location = location;
   34211       cmd->count = count;
   34212       cmd->transpose = transpose;
   34213       char *variable_data = (char *) (cmd + 1);
   34214       memcpy(variable_data, value, count * 128);
   34215       variable_data += count * 128;
   34216       _mesa_post_marshal_hook(ctx);
   34217       return;
   34218    }
   34219 
   34220 fallback_to_sync:
   34221    _mesa_glthread_finish(ctx);
   34222    debug_print_sync_fallback("ProgramUniformMatrix4dv");
   34223    CALL_ProgramUniformMatrix4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   34224 }
   34225 
   34226 
   34227 /* SecondaryColor3bv: marshalled asynchronously */
   34228 struct marshal_cmd_SecondaryColor3bv
   34229 {
   34230    struct marshal_cmd_base cmd_base;
   34231    GLbyte v[3];
   34232 };
   34233 static inline void
   34234 _mesa_unmarshal_SecondaryColor3bv(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3bv *cmd)
   34235 {
   34236    const GLbyte * v = cmd->v;
   34237    CALL_SecondaryColor3bv(ctx->CurrentServerDispatch, (v));
   34238 }
   34239 static void GLAPIENTRY
   34240 _mesa_marshal_SecondaryColor3bv(const GLbyte * v)
   34241 {
   34242    GET_CURRENT_CONTEXT(ctx);
   34243    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColor3bv);
   34244    struct marshal_cmd_SecondaryColor3bv *cmd;
   34245    debug_print_marshal("SecondaryColor3bv");
   34246    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34247       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3bv, cmd_size);
   34248       memcpy(cmd->v, v, 3);
   34249       _mesa_post_marshal_hook(ctx);
   34250       return;
   34251    }
   34252 
   34253    _mesa_glthread_finish(ctx);
   34254    debug_print_sync_fallback("SecondaryColor3bv");
   34255    CALL_SecondaryColor3bv(ctx->CurrentServerDispatch, (v));
   34256 }
   34257 
   34258 
   34259 /* DrawTexxvOES: marshalled asynchronously */
   34260 struct marshal_cmd_DrawTexxvOES
   34261 {
   34262    struct marshal_cmd_base cmd_base;
   34263    GLfixed coords[5];
   34264 };
   34265 static inline void
   34266 _mesa_unmarshal_DrawTexxvOES(struct gl_context *ctx, const struct marshal_cmd_DrawTexxvOES *cmd)
   34267 {
   34268    const GLfixed * coords = cmd->coords;
   34269    CALL_DrawTexxvOES(ctx->CurrentServerDispatch, (coords));
   34270 }
   34271 static void GLAPIENTRY
   34272 _mesa_marshal_DrawTexxvOES(const GLfixed * coords)
   34273 {
   34274    GET_CURRENT_CONTEXT(ctx);
   34275    size_t cmd_size = sizeof(struct marshal_cmd_DrawTexxvOES);
   34276    struct marshal_cmd_DrawTexxvOES *cmd;
   34277    debug_print_marshal("DrawTexxvOES");
   34278    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34279       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTexxvOES, cmd_size);
   34280       memcpy(cmd->coords, coords, 20);
   34281       _mesa_post_marshal_hook(ctx);
   34282       return;
   34283    }
   34284 
   34285    _mesa_glthread_finish(ctx);
   34286    debug_print_sync_fallback("DrawTexxvOES");
   34287    CALL_DrawTexxvOES(ctx->CurrentServerDispatch, (coords));
   34288 }
   34289 
   34290 
   34291 /* TexParameterfv: marshalled synchronously */
   34292 static void GLAPIENTRY
   34293 _mesa_marshal_TexParameterfv(GLenum target, GLenum pname, const GLfloat * params)
   34294 {
   34295    GET_CURRENT_CONTEXT(ctx);
   34296    _mesa_glthread_finish(ctx);
   34297    debug_print_sync("TexParameterfv");
   34298    CALL_TexParameterfv(ctx->CurrentServerDispatch, (target, pname, params));
   34299 }
   34300 
   34301 
   34302 /* Color4ubv: marshalled asynchronously */
   34303 struct marshal_cmd_Color4ubv
   34304 {
   34305    struct marshal_cmd_base cmd_base;
   34306    GLubyte v[4];
   34307 };
   34308 static inline void
   34309 _mesa_unmarshal_Color4ubv(struct gl_context *ctx, const struct marshal_cmd_Color4ubv *cmd)
   34310 {
   34311    const GLubyte * v = cmd->v;
   34312    CALL_Color4ubv(ctx->CurrentServerDispatch, (v));
   34313 }
   34314 static void GLAPIENTRY
   34315 _mesa_marshal_Color4ubv(const GLubyte * v)
   34316 {
   34317    GET_CURRENT_CONTEXT(ctx);
   34318    size_t cmd_size = sizeof(struct marshal_cmd_Color4ubv);
   34319    struct marshal_cmd_Color4ubv *cmd;
   34320    debug_print_marshal("Color4ubv");
   34321    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34322       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4ubv, cmd_size);
   34323       memcpy(cmd->v, v, 4);
   34324       _mesa_post_marshal_hook(ctx);
   34325       return;
   34326    }
   34327 
   34328    _mesa_glthread_finish(ctx);
   34329    debug_print_sync_fallback("Color4ubv");
   34330    CALL_Color4ubv(ctx->CurrentServerDispatch, (v));
   34331 }
   34332 
   34333 
   34334 /* TexCoord2fv: marshalled asynchronously */
   34335 struct marshal_cmd_TexCoord2fv
   34336 {
   34337    struct marshal_cmd_base cmd_base;
   34338    GLfloat v[2];
   34339 };
   34340 static inline void
   34341 _mesa_unmarshal_TexCoord2fv(struct gl_context *ctx, const struct marshal_cmd_TexCoord2fv *cmd)
   34342 {
   34343    const GLfloat * v = cmd->v;
   34344    CALL_TexCoord2fv(ctx->CurrentServerDispatch, (v));
   34345 }
   34346 static void GLAPIENTRY
   34347 _mesa_marshal_TexCoord2fv(const GLfloat * v)
   34348 {
   34349    GET_CURRENT_CONTEXT(ctx);
   34350    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord2fv);
   34351    struct marshal_cmd_TexCoord2fv *cmd;
   34352    debug_print_marshal("TexCoord2fv");
   34353    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34354       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord2fv, cmd_size);
   34355       memcpy(cmd->v, v, 8);
   34356       _mesa_post_marshal_hook(ctx);
   34357       return;
   34358    }
   34359 
   34360    _mesa_glthread_finish(ctx);
   34361    debug_print_sync_fallback("TexCoord2fv");
   34362    CALL_TexCoord2fv(ctx->CurrentServerDispatch, (v));
   34363 }
   34364 
   34365 
   34366 /* FogCoorddv: marshalled asynchronously */
   34367 struct marshal_cmd_FogCoorddv
   34368 {
   34369    struct marshal_cmd_base cmd_base;
   34370    GLdouble coord[1];
   34371 };
   34372 static inline void
   34373 _mesa_unmarshal_FogCoorddv(struct gl_context *ctx, const struct marshal_cmd_FogCoorddv *cmd)
   34374 {
   34375    const GLdouble * coord = cmd->coord;
   34376    CALL_FogCoorddv(ctx->CurrentServerDispatch, (coord));
   34377 }
   34378 static void GLAPIENTRY
   34379 _mesa_marshal_FogCoorddv(const GLdouble * coord)
   34380 {
   34381    GET_CURRENT_CONTEXT(ctx);
   34382    size_t cmd_size = sizeof(struct marshal_cmd_FogCoorddv);
   34383    struct marshal_cmd_FogCoorddv *cmd;
   34384    debug_print_marshal("FogCoorddv");
   34385    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34386       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FogCoorddv, cmd_size);
   34387       memcpy(cmd->coord, coord, 8);
   34388       _mesa_post_marshal_hook(ctx);
   34389       return;
   34390    }
   34391 
   34392    _mesa_glthread_finish(ctx);
   34393    debug_print_sync_fallback("FogCoorddv");
   34394    CALL_FogCoorddv(ctx->CurrentServerDispatch, (coord));
   34395 }
   34396 
   34397 
   34398 /* VDPAUUnregisterSurfaceNV: marshalled asynchronously */
   34399 struct marshal_cmd_VDPAUUnregisterSurfaceNV
   34400 {
   34401    struct marshal_cmd_base cmd_base;
   34402    GLintptr surface;
   34403 };
   34404 static inline void
   34405 _mesa_unmarshal_VDPAUUnregisterSurfaceNV(struct gl_context *ctx, const struct marshal_cmd_VDPAUUnregisterSurfaceNV *cmd)
   34406 {
   34407    const GLintptr surface = cmd->surface;
   34408    CALL_VDPAUUnregisterSurfaceNV(ctx->CurrentServerDispatch, (surface));
   34409 }
   34410 static void GLAPIENTRY
   34411 _mesa_marshal_VDPAUUnregisterSurfaceNV(GLintptr surface)
   34412 {
   34413    GET_CURRENT_CONTEXT(ctx);
   34414    size_t cmd_size = sizeof(struct marshal_cmd_VDPAUUnregisterSurfaceNV);
   34415    struct marshal_cmd_VDPAUUnregisterSurfaceNV *cmd;
   34416    debug_print_marshal("VDPAUUnregisterSurfaceNV");
   34417    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34418       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VDPAUUnregisterSurfaceNV, cmd_size);
   34419       cmd->surface = surface;
   34420       _mesa_post_marshal_hook(ctx);
   34421       return;
   34422    }
   34423 
   34424    _mesa_glthread_finish(ctx);
   34425    debug_print_sync_fallback("VDPAUUnregisterSurfaceNV");
   34426    CALL_VDPAUUnregisterSurfaceNV(ctx->CurrentServerDispatch, (surface));
   34427 }
   34428 
   34429 
   34430 /* ColorP3ui: marshalled asynchronously */
   34431 struct marshal_cmd_ColorP3ui
   34432 {
   34433    struct marshal_cmd_base cmd_base;
   34434    GLenum type;
   34435    GLuint color;
   34436 };
   34437 static inline void
   34438 _mesa_unmarshal_ColorP3ui(struct gl_context *ctx, const struct marshal_cmd_ColorP3ui *cmd)
   34439 {
   34440    const GLenum type = cmd->type;
   34441    const GLuint color = cmd->color;
   34442    CALL_ColorP3ui(ctx->CurrentServerDispatch, (type, color));
   34443 }
   34444 static void GLAPIENTRY
   34445 _mesa_marshal_ColorP3ui(GLenum type, GLuint color)
   34446 {
   34447    GET_CURRENT_CONTEXT(ctx);
   34448    size_t cmd_size = sizeof(struct marshal_cmd_ColorP3ui);
   34449    struct marshal_cmd_ColorP3ui *cmd;
   34450    debug_print_marshal("ColorP3ui");
   34451    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34452       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorP3ui, cmd_size);
   34453       cmd->type = type;
   34454       cmd->color = color;
   34455       _mesa_post_marshal_hook(ctx);
   34456       return;
   34457    }
   34458 
   34459    _mesa_glthread_finish(ctx);
   34460    debug_print_sync_fallback("ColorP3ui");
   34461    CALL_ColorP3ui(ctx->CurrentServerDispatch, (type, color));
   34462 }
   34463 
   34464 
   34465 /* GetUnsignedBytei_vEXT: marshalled synchronously */
   34466 static void GLAPIENTRY
   34467 _mesa_marshal_GetUnsignedBytei_vEXT(GLenum target, GLuint index, GLubyte * data)
   34468 {
   34469    GET_CURRENT_CONTEXT(ctx);
   34470    _mesa_glthread_finish(ctx);
   34471    debug_print_sync("GetUnsignedBytei_vEXT");
   34472    CALL_GetUnsignedBytei_vEXT(ctx->CurrentServerDispatch, (target, index, data));
   34473 }
   34474 
   34475 
   34476 /* GetShaderPrecisionFormat: marshalled synchronously */
   34477 static void GLAPIENTRY
   34478 _mesa_marshal_GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint * range, GLint * precision)
   34479 {
   34480    GET_CURRENT_CONTEXT(ctx);
   34481    _mesa_glthread_finish(ctx);
   34482    debug_print_sync("GetShaderPrecisionFormat");
   34483    CALL_GetShaderPrecisionFormat(ctx->CurrentServerDispatch, (shadertype, precisiontype, range, precision));
   34484 }
   34485 
   34486 
   34487 /* MakeTextureHandleNonResidentARB: marshalled asynchronously */
   34488 struct marshal_cmd_MakeTextureHandleNonResidentARB
   34489 {
   34490    struct marshal_cmd_base cmd_base;
   34491    GLuint64 handle;
   34492 };
   34493 static inline void
   34494 _mesa_unmarshal_MakeTextureHandleNonResidentARB(struct gl_context *ctx, const struct marshal_cmd_MakeTextureHandleNonResidentARB *cmd)
   34495 {
   34496    const GLuint64 handle = cmd->handle;
   34497    CALL_MakeTextureHandleNonResidentARB(ctx->CurrentServerDispatch, (handle));
   34498 }
   34499 static void GLAPIENTRY
   34500 _mesa_marshal_MakeTextureHandleNonResidentARB(GLuint64 handle)
   34501 {
   34502    GET_CURRENT_CONTEXT(ctx);
   34503    size_t cmd_size = sizeof(struct marshal_cmd_MakeTextureHandleNonResidentARB);
   34504    struct marshal_cmd_MakeTextureHandleNonResidentARB *cmd;
   34505    debug_print_marshal("MakeTextureHandleNonResidentARB");
   34506    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34507       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MakeTextureHandleNonResidentARB, cmd_size);
   34508       cmd->handle = handle;
   34509       _mesa_post_marshal_hook(ctx);
   34510       return;
   34511    }
   34512 
   34513    _mesa_glthread_finish(ctx);
   34514    debug_print_sync_fallback("MakeTextureHandleNonResidentARB");
   34515    CALL_MakeTextureHandleNonResidentARB(ctx->CurrentServerDispatch, (handle));
   34516 }
   34517 
   34518 
   34519 /* VertexAttribI4iEXT: marshalled asynchronously */
   34520 struct marshal_cmd_VertexAttribI4iEXT
   34521 {
   34522    struct marshal_cmd_base cmd_base;
   34523    GLuint index;
   34524    GLint x;
   34525    GLint y;
   34526    GLint z;
   34527    GLint w;
   34528 };
   34529 static inline void
   34530 _mesa_unmarshal_VertexAttribI4iEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI4iEXT *cmd)
   34531 {
   34532    const GLuint index = cmd->index;
   34533    const GLint x = cmd->x;
   34534    const GLint y = cmd->y;
   34535    const GLint z = cmd->z;
   34536    const GLint w = cmd->w;
   34537    CALL_VertexAttribI4iEXT(ctx->CurrentServerDispatch, (index, x, y, z, w));
   34538 }
   34539 static void GLAPIENTRY
   34540 _mesa_marshal_VertexAttribI4iEXT(GLuint index, GLint x, GLint y, GLint z, GLint w)
   34541 {
   34542    GET_CURRENT_CONTEXT(ctx);
   34543    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribI4iEXT);
   34544    struct marshal_cmd_VertexAttribI4iEXT *cmd;
   34545    debug_print_marshal("VertexAttribI4iEXT");
   34546    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34547       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI4iEXT, cmd_size);
   34548       cmd->index = index;
   34549       cmd->x = x;
   34550       cmd->y = y;
   34551       cmd->z = z;
   34552       cmd->w = w;
   34553       _mesa_post_marshal_hook(ctx);
   34554       return;
   34555    }
   34556 
   34557    _mesa_glthread_finish(ctx);
   34558    debug_print_sync_fallback("VertexAttribI4iEXT");
   34559    CALL_VertexAttribI4iEXT(ctx->CurrentServerDispatch, (index, x, y, z, w));
   34560 }
   34561 
   34562 
   34563 /* VertexAttribI3uivEXT: marshalled synchronously */
   34564 static void GLAPIENTRY
   34565 _mesa_marshal_VertexAttribI3uivEXT(GLuint index, const GLuint * v)
   34566 {
   34567    GET_CURRENT_CONTEXT(ctx);
   34568    _mesa_glthread_finish(ctx);
   34569    debug_print_sync("VertexAttribI3uivEXT");
   34570    CALL_VertexAttribI3uivEXT(ctx->CurrentServerDispatch, (index, v));
   34571 }
   34572 
   34573 
   34574 /* FogCoordd: marshalled asynchronously */
   34575 struct marshal_cmd_FogCoordd
   34576 {
   34577    struct marshal_cmd_base cmd_base;
   34578    GLdouble coord;
   34579 };
   34580 static inline void
   34581 _mesa_unmarshal_FogCoordd(struct gl_context *ctx, const struct marshal_cmd_FogCoordd *cmd)
   34582 {
   34583    const GLdouble coord = cmd->coord;
   34584    CALL_FogCoordd(ctx->CurrentServerDispatch, (coord));
   34585 }
   34586 static void GLAPIENTRY
   34587 _mesa_marshal_FogCoordd(GLdouble coord)
   34588 {
   34589    GET_CURRENT_CONTEXT(ctx);
   34590    size_t cmd_size = sizeof(struct marshal_cmd_FogCoordd);
   34591    struct marshal_cmd_FogCoordd *cmd;
   34592    debug_print_marshal("FogCoordd");
   34593    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34594       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FogCoordd, cmd_size);
   34595       cmd->coord = coord;
   34596       _mesa_post_marshal_hook(ctx);
   34597       return;
   34598    }
   34599 
   34600    _mesa_glthread_finish(ctx);
   34601    debug_print_sync_fallback("FogCoordd");
   34602    CALL_FogCoordd(ctx->CurrentServerDispatch, (coord));
   34603 }
   34604 
   34605 
   34606 /* BindFramebufferEXT: marshalled asynchronously */
   34607 struct marshal_cmd_BindFramebufferEXT
   34608 {
   34609    struct marshal_cmd_base cmd_base;
   34610    GLenum target;
   34611    GLuint framebuffer;
   34612 };
   34613 static inline void
   34614 _mesa_unmarshal_BindFramebufferEXT(struct gl_context *ctx, const struct marshal_cmd_BindFramebufferEXT *cmd)
   34615 {
   34616    const GLenum target = cmd->target;
   34617    const GLuint framebuffer = cmd->framebuffer;
   34618    CALL_BindFramebufferEXT(ctx->CurrentServerDispatch, (target, framebuffer));
   34619 }
   34620 static void GLAPIENTRY
   34621 _mesa_marshal_BindFramebufferEXT(GLenum target, GLuint framebuffer)
   34622 {
   34623    GET_CURRENT_CONTEXT(ctx);
   34624    size_t cmd_size = sizeof(struct marshal_cmd_BindFramebufferEXT);
   34625    struct marshal_cmd_BindFramebufferEXT *cmd;
   34626    debug_print_marshal("BindFramebufferEXT");
   34627    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34628       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindFramebufferEXT, cmd_size);
   34629       cmd->target = target;
   34630       cmd->framebuffer = framebuffer;
   34631       _mesa_post_marshal_hook(ctx);
   34632       return;
   34633    }
   34634 
   34635    _mesa_glthread_finish(ctx);
   34636    debug_print_sync_fallback("BindFramebufferEXT");
   34637    CALL_BindFramebufferEXT(ctx->CurrentServerDispatch, (target, framebuffer));
   34638 }
   34639 
   34640 
   34641 /* Uniform3iv: marshalled asynchronously */
   34642 struct marshal_cmd_Uniform3iv
   34643 {
   34644    struct marshal_cmd_base cmd_base;
   34645    GLint location;
   34646    GLsizei count;
   34647    /* Next safe_mul(count, 12) bytes are GLint value[count][3] */
   34648 };
   34649 static inline void
   34650 _mesa_unmarshal_Uniform3iv(struct gl_context *ctx, const struct marshal_cmd_Uniform3iv *cmd)
   34651 {
   34652    const GLint location = cmd->location;
   34653    const GLsizei count = cmd->count;
   34654    const GLint * value;
   34655    const char *variable_data = (const char *) (cmd + 1);
   34656    value = (const GLint *) variable_data;
   34657    variable_data += count * 12;
   34658    CALL_Uniform3iv(ctx->CurrentServerDispatch, (location, count, value));
   34659 }
   34660 static void GLAPIENTRY
   34661 _mesa_marshal_Uniform3iv(GLint location, GLsizei count, const GLint * value)
   34662 {
   34663    GET_CURRENT_CONTEXT(ctx);
   34664    size_t cmd_size = sizeof(struct marshal_cmd_Uniform3iv) + safe_mul(count, 12);
   34665    struct marshal_cmd_Uniform3iv *cmd;
   34666    debug_print_marshal("Uniform3iv");
   34667    if (unlikely(safe_mul(count, 12) < 0)) {
   34668       goto fallback_to_sync;
   34669    }
   34670    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34671       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3iv, cmd_size);
   34672       cmd->location = location;
   34673       cmd->count = count;
   34674       char *variable_data = (char *) (cmd + 1);
   34675       memcpy(variable_data, value, count * 12);
   34676       variable_data += count * 12;
   34677       _mesa_post_marshal_hook(ctx);
   34678       return;
   34679    }
   34680 
   34681 fallback_to_sync:
   34682    _mesa_glthread_finish(ctx);
   34683    debug_print_sync_fallback("Uniform3iv");
   34684    CALL_Uniform3iv(ctx->CurrentServerDispatch, (location, count, value));
   34685 }
   34686 
   34687 
   34688 /* TexStorage2DMultisample: marshalled asynchronously */
   34689 struct marshal_cmd_TexStorage2DMultisample
   34690 {
   34691    struct marshal_cmd_base cmd_base;
   34692    GLenum target;
   34693    GLsizei samples;
   34694    GLenum internalformat;
   34695    GLsizei width;
   34696    GLsizei height;
   34697    GLboolean fixedsamplelocations;
   34698 };
   34699 static inline void
   34700 _mesa_unmarshal_TexStorage2DMultisample(struct gl_context *ctx, const struct marshal_cmd_TexStorage2DMultisample *cmd)
   34701 {
   34702    const GLenum target = cmd->target;
   34703    const GLsizei samples = cmd->samples;
   34704    const GLenum internalformat = cmd->internalformat;
   34705    const GLsizei width = cmd->width;
   34706    const GLsizei height = cmd->height;
   34707    const GLboolean fixedsamplelocations = cmd->fixedsamplelocations;
   34708    CALL_TexStorage2DMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height, fixedsamplelocations));
   34709 }
   34710 static void GLAPIENTRY
   34711 _mesa_marshal_TexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
   34712 {
   34713    GET_CURRENT_CONTEXT(ctx);
   34714    size_t cmd_size = sizeof(struct marshal_cmd_TexStorage2DMultisample);
   34715    struct marshal_cmd_TexStorage2DMultisample *cmd;
   34716    debug_print_marshal("TexStorage2DMultisample");
   34717    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34718       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorage2DMultisample, cmd_size);
   34719       cmd->target = target;
   34720       cmd->samples = samples;
   34721       cmd->internalformat = internalformat;
   34722       cmd->width = width;
   34723       cmd->height = height;
   34724       cmd->fixedsamplelocations = fixedsamplelocations;
   34725       _mesa_post_marshal_hook(ctx);
   34726       return;
   34727    }
   34728 
   34729    _mesa_glthread_finish(ctx);
   34730    debug_print_sync_fallback("TexStorage2DMultisample");
   34731    CALL_TexStorage2DMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height, fixedsamplelocations));
   34732 }
   34733 
   34734 
   34735 /* UnlockArraysEXT: marshalled asynchronously */
   34736 struct marshal_cmd_UnlockArraysEXT
   34737 {
   34738    struct marshal_cmd_base cmd_base;
   34739 };
   34740 static inline void
   34741 _mesa_unmarshal_UnlockArraysEXT(struct gl_context *ctx, const struct marshal_cmd_UnlockArraysEXT *cmd)
   34742 {
   34743    CALL_UnlockArraysEXT(ctx->CurrentServerDispatch, ());
   34744 }
   34745 static void GLAPIENTRY
   34746 _mesa_marshal_UnlockArraysEXT(void)
   34747 {
   34748    GET_CURRENT_CONTEXT(ctx);
   34749    size_t cmd_size = sizeof(struct marshal_cmd_UnlockArraysEXT);
   34750    struct marshal_cmd_UnlockArraysEXT *cmd;
   34751    debug_print_marshal("UnlockArraysEXT");
   34752    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34753       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UnlockArraysEXT, cmd_size);
   34754       (void) cmd;
   34755 
   34756       _mesa_post_marshal_hook(ctx);
   34757       return;
   34758    }
   34759 
   34760    _mesa_glthread_finish(ctx);
   34761    debug_print_sync_fallback("UnlockArraysEXT");
   34762    CALL_UnlockArraysEXT(ctx->CurrentServerDispatch, ());
   34763 }
   34764 
   34765 
   34766 /* GetVertexAttribLui64vARB: marshalled synchronously */
   34767 static void GLAPIENTRY
   34768 _mesa_marshal_GetVertexAttribLui64vARB(GLuint index, GLenum pname, GLuint64EXT * params)
   34769 {
   34770    GET_CURRENT_CONTEXT(ctx);
   34771    _mesa_glthread_finish(ctx);
   34772    debug_print_sync("GetVertexAttribLui64vARB");
   34773    CALL_GetVertexAttribLui64vARB(ctx->CurrentServerDispatch, (index, pname, params));
   34774 }
   34775 
   34776 
   34777 /* VertexAttrib4iv: marshalled asynchronously */
   34778 struct marshal_cmd_VertexAttrib4iv
   34779 {
   34780    struct marshal_cmd_base cmd_base;
   34781    GLuint index;
   34782    GLint v[4];
   34783 };
   34784 static inline void
   34785 _mesa_unmarshal_VertexAttrib4iv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4iv *cmd)
   34786 {
   34787    const GLuint index = cmd->index;
   34788    const GLint * v = cmd->v;
   34789    CALL_VertexAttrib4iv(ctx->CurrentServerDispatch, (index, v));
   34790 }
   34791 static void GLAPIENTRY
   34792 _mesa_marshal_VertexAttrib4iv(GLuint index, const GLint * v)
   34793 {
   34794    GET_CURRENT_CONTEXT(ctx);
   34795    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4iv);
   34796    struct marshal_cmd_VertexAttrib4iv *cmd;
   34797    debug_print_marshal("VertexAttrib4iv");
   34798    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34799       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4iv, cmd_size);
   34800       cmd->index = index;
   34801       memcpy(cmd->v, v, 16);
   34802       _mesa_post_marshal_hook(ctx);
   34803       return;
   34804    }
   34805 
   34806    _mesa_glthread_finish(ctx);
   34807    debug_print_sync_fallback("VertexAttrib4iv");
   34808    CALL_VertexAttrib4iv(ctx->CurrentServerDispatch, (index, v));
   34809 }
   34810 
   34811 
   34812 /* CopyTexSubImage3D: marshalled asynchronously */
   34813 struct marshal_cmd_CopyTexSubImage3D
   34814 {
   34815    struct marshal_cmd_base cmd_base;
   34816    GLenum target;
   34817    GLint level;
   34818    GLint xoffset;
   34819    GLint yoffset;
   34820    GLint zoffset;
   34821    GLint x;
   34822    GLint y;
   34823    GLsizei width;
   34824    GLsizei height;
   34825 };
   34826 static inline void
   34827 _mesa_unmarshal_CopyTexSubImage3D(struct gl_context *ctx, const struct marshal_cmd_CopyTexSubImage3D *cmd)
   34828 {
   34829    const GLenum target = cmd->target;
   34830    const GLint level = cmd->level;
   34831    const GLint xoffset = cmd->xoffset;
   34832    const GLint yoffset = cmd->yoffset;
   34833    const GLint zoffset = cmd->zoffset;
   34834    const GLint x = cmd->x;
   34835    const GLint y = cmd->y;
   34836    const GLsizei width = cmd->width;
   34837    const GLsizei height = cmd->height;
   34838    CALL_CopyTexSubImage3D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, zoffset, x, y, width, height));
   34839 }
   34840 static void GLAPIENTRY
   34841 _mesa_marshal_CopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
   34842 {
   34843    GET_CURRENT_CONTEXT(ctx);
   34844    size_t cmd_size = sizeof(struct marshal_cmd_CopyTexSubImage3D);
   34845    struct marshal_cmd_CopyTexSubImage3D *cmd;
   34846    debug_print_marshal("CopyTexSubImage3D");
   34847    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34848       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyTexSubImage3D, cmd_size);
   34849       cmd->target = target;
   34850       cmd->level = level;
   34851       cmd->xoffset = xoffset;
   34852       cmd->yoffset = yoffset;
   34853       cmd->zoffset = zoffset;
   34854       cmd->x = x;
   34855       cmd->y = y;
   34856       cmd->width = width;
   34857       cmd->height = height;
   34858       _mesa_post_marshal_hook(ctx);
   34859       return;
   34860    }
   34861 
   34862    _mesa_glthread_finish(ctx);
   34863    debug_print_sync_fallback("CopyTexSubImage3D");
   34864    CALL_CopyTexSubImage3D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, zoffset, x, y, width, height));
   34865 }
   34866 
   34867 
   34868 /* PolygonOffsetClampEXT: marshalled asynchronously */
   34869 struct marshal_cmd_PolygonOffsetClampEXT
   34870 {
   34871    struct marshal_cmd_base cmd_base;
   34872    GLfloat factor;
   34873    GLfloat units;
   34874    GLfloat clamp;
   34875 };
   34876 static inline void
   34877 _mesa_unmarshal_PolygonOffsetClampEXT(struct gl_context *ctx, const struct marshal_cmd_PolygonOffsetClampEXT *cmd)
   34878 {
   34879    const GLfloat factor = cmd->factor;
   34880    const GLfloat units = cmd->units;
   34881    const GLfloat clamp = cmd->clamp;
   34882    CALL_PolygonOffsetClampEXT(ctx->CurrentServerDispatch, (factor, units, clamp));
   34883 }
   34884 static void GLAPIENTRY
   34885 _mesa_marshal_PolygonOffsetClampEXT(GLfloat factor, GLfloat units, GLfloat clamp)
   34886 {
   34887    GET_CURRENT_CONTEXT(ctx);
   34888    size_t cmd_size = sizeof(struct marshal_cmd_PolygonOffsetClampEXT);
   34889    struct marshal_cmd_PolygonOffsetClampEXT *cmd;
   34890    debug_print_marshal("PolygonOffsetClampEXT");
   34891    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34892       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PolygonOffsetClampEXT, cmd_size);
   34893       cmd->factor = factor;
   34894       cmd->units = units;
   34895       cmd->clamp = clamp;
   34896       _mesa_post_marshal_hook(ctx);
   34897       return;
   34898    }
   34899 
   34900    _mesa_glthread_finish(ctx);
   34901    debug_print_sync_fallback("PolygonOffsetClampEXT");
   34902    CALL_PolygonOffsetClampEXT(ctx->CurrentServerDispatch, (factor, units, clamp));
   34903 }
   34904 
   34905 
   34906 /* GetInteger64v: marshalled synchronously */
   34907 static void GLAPIENTRY
   34908 _mesa_marshal_GetInteger64v(GLenum pname, GLint64 * params)
   34909 {
   34910    GET_CURRENT_CONTEXT(ctx);
   34911    _mesa_glthread_finish(ctx);
   34912    debug_print_sync("GetInteger64v");
   34913    CALL_GetInteger64v(ctx->CurrentServerDispatch, (pname, params));
   34914 }
   34915 
   34916 
   34917 /* DetachObjectARB: marshalled asynchronously */
   34918 struct marshal_cmd_DetachObjectARB
   34919 {
   34920    struct marshal_cmd_base cmd_base;
   34921    GLhandleARB containerObj;
   34922    GLhandleARB attachedObj;
   34923 };
   34924 static inline void
   34925 _mesa_unmarshal_DetachObjectARB(struct gl_context *ctx, const struct marshal_cmd_DetachObjectARB *cmd)
   34926 {
   34927    const GLhandleARB containerObj = cmd->containerObj;
   34928    const GLhandleARB attachedObj = cmd->attachedObj;
   34929    CALL_DetachObjectARB(ctx->CurrentServerDispatch, (containerObj, attachedObj));
   34930 }
   34931 static void GLAPIENTRY
   34932 _mesa_marshal_DetachObjectARB(GLhandleARB containerObj, GLhandleARB attachedObj)
   34933 {
   34934    GET_CURRENT_CONTEXT(ctx);
   34935    size_t cmd_size = sizeof(struct marshal_cmd_DetachObjectARB);
   34936    struct marshal_cmd_DetachObjectARB *cmd;
   34937    debug_print_marshal("DetachObjectARB");
   34938    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34939       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DetachObjectARB, cmd_size);
   34940       cmd->containerObj = containerObj;
   34941       cmd->attachedObj = attachedObj;
   34942       _mesa_post_marshal_hook(ctx);
   34943       return;
   34944    }
   34945 
   34946    _mesa_glthread_finish(ctx);
   34947    debug_print_sync_fallback("DetachObjectARB");
   34948    CALL_DetachObjectARB(ctx->CurrentServerDispatch, (containerObj, attachedObj));
   34949 }
   34950 
   34951 
   34952 /* Indexiv: marshalled asynchronously */
   34953 struct marshal_cmd_Indexiv
   34954 {
   34955    struct marshal_cmd_base cmd_base;
   34956    GLint c[1];
   34957 };
   34958 static inline void
   34959 _mesa_unmarshal_Indexiv(struct gl_context *ctx, const struct marshal_cmd_Indexiv *cmd)
   34960 {
   34961    const GLint * c = cmd->c;
   34962    CALL_Indexiv(ctx->CurrentServerDispatch, (c));
   34963 }
   34964 static void GLAPIENTRY
   34965 _mesa_marshal_Indexiv(const GLint * c)
   34966 {
   34967    GET_CURRENT_CONTEXT(ctx);
   34968    size_t cmd_size = sizeof(struct marshal_cmd_Indexiv);
   34969    struct marshal_cmd_Indexiv *cmd;
   34970    debug_print_marshal("Indexiv");
   34971    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   34972       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Indexiv, cmd_size);
   34973       memcpy(cmd->c, c, 4);
   34974       _mesa_post_marshal_hook(ctx);
   34975       return;
   34976    }
   34977 
   34978    _mesa_glthread_finish(ctx);
   34979    debug_print_sync_fallback("Indexiv");
   34980    CALL_Indexiv(ctx->CurrentServerDispatch, (c));
   34981 }
   34982 
   34983 
   34984 /* TexEnvi: marshalled asynchronously */
   34985 struct marshal_cmd_TexEnvi
   34986 {
   34987    struct marshal_cmd_base cmd_base;
   34988    GLenum target;
   34989    GLenum pname;
   34990    GLint param;
   34991 };
   34992 static inline void
   34993 _mesa_unmarshal_TexEnvi(struct gl_context *ctx, const struct marshal_cmd_TexEnvi *cmd)
   34994 {
   34995    const GLenum target = cmd->target;
   34996    const GLenum pname = cmd->pname;
   34997    const GLint param = cmd->param;
   34998    CALL_TexEnvi(ctx->CurrentServerDispatch, (target, pname, param));
   34999 }
   35000 static void GLAPIENTRY
   35001 _mesa_marshal_TexEnvi(GLenum target, GLenum pname, GLint param)
   35002 {
   35003    GET_CURRENT_CONTEXT(ctx);
   35004    size_t cmd_size = sizeof(struct marshal_cmd_TexEnvi);
   35005    struct marshal_cmd_TexEnvi *cmd;
   35006    debug_print_marshal("TexEnvi");
   35007    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35008       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexEnvi, cmd_size);
   35009       cmd->target = target;
   35010       cmd->pname = pname;
   35011       cmd->param = param;
   35012       _mesa_post_marshal_hook(ctx);
   35013       return;
   35014    }
   35015 
   35016    _mesa_glthread_finish(ctx);
   35017    debug_print_sync_fallback("TexEnvi");
   35018    CALL_TexEnvi(ctx->CurrentServerDispatch, (target, pname, param));
   35019 }
   35020 
   35021 
   35022 /* TexEnvf: marshalled asynchronously */
   35023 struct marshal_cmd_TexEnvf
   35024 {
   35025    struct marshal_cmd_base cmd_base;
   35026    GLenum target;
   35027    GLenum pname;
   35028    GLfloat param;
   35029 };
   35030 static inline void
   35031 _mesa_unmarshal_TexEnvf(struct gl_context *ctx, const struct marshal_cmd_TexEnvf *cmd)
   35032 {
   35033    const GLenum target = cmd->target;
   35034    const GLenum pname = cmd->pname;
   35035    const GLfloat param = cmd->param;
   35036    CALL_TexEnvf(ctx->CurrentServerDispatch, (target, pname, param));
   35037 }
   35038 static void GLAPIENTRY
   35039 _mesa_marshal_TexEnvf(GLenum target, GLenum pname, GLfloat param)
   35040 {
   35041    GET_CURRENT_CONTEXT(ctx);
   35042    size_t cmd_size = sizeof(struct marshal_cmd_TexEnvf);
   35043    struct marshal_cmd_TexEnvf *cmd;
   35044    debug_print_marshal("TexEnvf");
   35045    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35046       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexEnvf, cmd_size);
   35047       cmd->target = target;
   35048       cmd->pname = pname;
   35049       cmd->param = param;
   35050       _mesa_post_marshal_hook(ctx);
   35051       return;
   35052    }
   35053 
   35054    _mesa_glthread_finish(ctx);
   35055    debug_print_sync_fallback("TexEnvf");
   35056    CALL_TexEnvf(ctx->CurrentServerDispatch, (target, pname, param));
   35057 }
   35058 
   35059 
   35060 /* TexEnvx: marshalled asynchronously */
   35061 struct marshal_cmd_TexEnvx
   35062 {
   35063    struct marshal_cmd_base cmd_base;
   35064    GLenum target;
   35065    GLenum pname;
   35066    GLfixed param;
   35067 };
   35068 static inline void
   35069 _mesa_unmarshal_TexEnvx(struct gl_context *ctx, const struct marshal_cmd_TexEnvx *cmd)
   35070 {
   35071    const GLenum target = cmd->target;
   35072    const GLenum pname = cmd->pname;
   35073    const GLfixed param = cmd->param;
   35074    CALL_TexEnvx(ctx->CurrentServerDispatch, (target, pname, param));
   35075 }
   35076 static void GLAPIENTRY
   35077 _mesa_marshal_TexEnvx(GLenum target, GLenum pname, GLfixed param)
   35078 {
   35079    GET_CURRENT_CONTEXT(ctx);
   35080    size_t cmd_size = sizeof(struct marshal_cmd_TexEnvx);
   35081    struct marshal_cmd_TexEnvx *cmd;
   35082    debug_print_marshal("TexEnvx");
   35083    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35084       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexEnvx, cmd_size);
   35085       cmd->target = target;
   35086       cmd->pname = pname;
   35087       cmd->param = param;
   35088       _mesa_post_marshal_hook(ctx);
   35089       return;
   35090    }
   35091 
   35092    _mesa_glthread_finish(ctx);
   35093    debug_print_sync_fallback("TexEnvx");
   35094    CALL_TexEnvx(ctx->CurrentServerDispatch, (target, pname, param));
   35095 }
   35096 
   35097 
   35098 /* InvalidateBufferSubData: marshalled asynchronously */
   35099 struct marshal_cmd_InvalidateBufferSubData
   35100 {
   35101    struct marshal_cmd_base cmd_base;
   35102    GLuint buffer;
   35103    GLintptr offset;
   35104    GLsizeiptr length;
   35105 };
   35106 static inline void
   35107 _mesa_unmarshal_InvalidateBufferSubData(struct gl_context *ctx, const struct marshal_cmd_InvalidateBufferSubData *cmd)
   35108 {
   35109    const GLuint buffer = cmd->buffer;
   35110    const GLintptr offset = cmd->offset;
   35111    const GLsizeiptr length = cmd->length;
   35112    CALL_InvalidateBufferSubData(ctx->CurrentServerDispatch, (buffer, offset, length));
   35113 }
   35114 static void GLAPIENTRY
   35115 _mesa_marshal_InvalidateBufferSubData(GLuint buffer, GLintptr offset, GLsizeiptr length)
   35116 {
   35117    GET_CURRENT_CONTEXT(ctx);
   35118    size_t cmd_size = sizeof(struct marshal_cmd_InvalidateBufferSubData);
   35119    struct marshal_cmd_InvalidateBufferSubData *cmd;
   35120    debug_print_marshal("InvalidateBufferSubData");
   35121    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35122       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InvalidateBufferSubData, cmd_size);
   35123       cmd->buffer = buffer;
   35124       cmd->offset = offset;
   35125       cmd->length = length;
   35126       _mesa_post_marshal_hook(ctx);
   35127       return;
   35128    }
   35129 
   35130    _mesa_glthread_finish(ctx);
   35131    debug_print_sync_fallback("InvalidateBufferSubData");
   35132    CALL_InvalidateBufferSubData(ctx->CurrentServerDispatch, (buffer, offset, length));
   35133 }
   35134 
   35135 
   35136 /* UniformMatrix4x2fv: marshalled asynchronously */
   35137 struct marshal_cmd_UniformMatrix4x2fv
   35138 {
   35139    struct marshal_cmd_base cmd_base;
   35140    GLint location;
   35141    GLsizei count;
   35142    GLboolean transpose;
   35143    /* Next safe_mul(count, 32) bytes are GLfloat value[count][8] */
   35144 };
   35145 static inline void
   35146 _mesa_unmarshal_UniformMatrix4x2fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4x2fv *cmd)
   35147 {
   35148    const GLint location = cmd->location;
   35149    const GLsizei count = cmd->count;
   35150    const GLboolean transpose = cmd->transpose;
   35151    const GLfloat * value;
   35152    const char *variable_data = (const char *) (cmd + 1);
   35153    value = (const GLfloat *) variable_data;
   35154    variable_data += count * 32;
   35155    CALL_UniformMatrix4x2fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   35156 }
   35157 static void GLAPIENTRY
   35158 _mesa_marshal_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   35159 {
   35160    GET_CURRENT_CONTEXT(ctx);
   35161    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix4x2fv) + safe_mul(count, 32);
   35162    struct marshal_cmd_UniformMatrix4x2fv *cmd;
   35163    debug_print_marshal("UniformMatrix4x2fv");
   35164    if (unlikely(safe_mul(count, 32) < 0)) {
   35165       goto fallback_to_sync;
   35166    }
   35167    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35168       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4x2fv, cmd_size);
   35169       cmd->location = location;
   35170       cmd->count = count;
   35171       cmd->transpose = transpose;
   35172       char *variable_data = (char *) (cmd + 1);
   35173       memcpy(variable_data, value, count * 32);
   35174       variable_data += count * 32;
   35175       _mesa_post_marshal_hook(ctx);
   35176       return;
   35177    }
   35178 
   35179 fallback_to_sync:
   35180    _mesa_glthread_finish(ctx);
   35181    debug_print_sync_fallback("UniformMatrix4x2fv");
   35182    CALL_UniformMatrix4x2fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   35183 }
   35184 
   35185 
   35186 /* ClearTexImage: marshalled synchronously */
   35187 static void GLAPIENTRY
   35188 _mesa_marshal_ClearTexImage(GLuint texture, GLint level, GLenum format, GLenum type, const GLvoid * data)
   35189 {
   35190    GET_CURRENT_CONTEXT(ctx);
   35191    _mesa_glthread_finish(ctx);
   35192    debug_print_sync("ClearTexImage");
   35193    CALL_ClearTexImage(ctx->CurrentServerDispatch, (texture, level, format, type, data));
   35194 }
   35195 
   35196 
   35197 /* PolygonOffset: marshalled asynchronously */
   35198 struct marshal_cmd_PolygonOffset
   35199 {
   35200    struct marshal_cmd_base cmd_base;
   35201    GLfloat factor;
   35202    GLfloat units;
   35203 };
   35204 static inline void
   35205 _mesa_unmarshal_PolygonOffset(struct gl_context *ctx, const struct marshal_cmd_PolygonOffset *cmd)
   35206 {
   35207    const GLfloat factor = cmd->factor;
   35208    const GLfloat units = cmd->units;
   35209    CALL_PolygonOffset(ctx->CurrentServerDispatch, (factor, units));
   35210 }
   35211 static void GLAPIENTRY
   35212 _mesa_marshal_PolygonOffset(GLfloat factor, GLfloat units)
   35213 {
   35214    GET_CURRENT_CONTEXT(ctx);
   35215    size_t cmd_size = sizeof(struct marshal_cmd_PolygonOffset);
   35216    struct marshal_cmd_PolygonOffset *cmd;
   35217    debug_print_marshal("PolygonOffset");
   35218    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35219       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PolygonOffset, cmd_size);
   35220       cmd->factor = factor;
   35221       cmd->units = units;
   35222       _mesa_post_marshal_hook(ctx);
   35223       return;
   35224    }
   35225 
   35226    _mesa_glthread_finish(ctx);
   35227    debug_print_sync_fallback("PolygonOffset");
   35228    CALL_PolygonOffset(ctx->CurrentServerDispatch, (factor, units));
   35229 }
   35230 
   35231 
   35232 /* SamplerParameterfv: marshalled synchronously */
   35233 static void GLAPIENTRY
   35234 _mesa_marshal_SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat * params)
   35235 {
   35236    GET_CURRENT_CONTEXT(ctx);
   35237    _mesa_glthread_finish(ctx);
   35238    debug_print_sync("SamplerParameterfv");
   35239    CALL_SamplerParameterfv(ctx->CurrentServerDispatch, (sampler, pname, params));
   35240 }
   35241 
   35242 
   35243 /* CompressedTextureSubImage1D: marshalled synchronously */
   35244 static void GLAPIENTRY
   35245 _mesa_marshal_CompressedTextureSubImage1D(GLuint texture, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid * data)
   35246 {
   35247    GET_CURRENT_CONTEXT(ctx);
   35248    _mesa_glthread_finish(ctx);
   35249    debug_print_sync("CompressedTextureSubImage1D");
   35250    CALL_CompressedTextureSubImage1D(ctx->CurrentServerDispatch, (texture, level, xoffset, width, format, imageSize, data));
   35251 }
   35252 
   35253 
   35254 /* ProgramUniformMatrix4x2dv: marshalled asynchronously */
   35255 struct marshal_cmd_ProgramUniformMatrix4x2dv
   35256 {
   35257    struct marshal_cmd_base cmd_base;
   35258    GLuint program;
   35259    GLint location;
   35260    GLsizei count;
   35261    GLboolean transpose;
   35262    /* Next safe_mul(count, 64) bytes are GLdouble value[count][8] */
   35263 };
   35264 static inline void
   35265 _mesa_unmarshal_ProgramUniformMatrix4x2dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix4x2dv *cmd)
   35266 {
   35267    const GLuint program = cmd->program;
   35268    const GLint location = cmd->location;
   35269    const GLsizei count = cmd->count;
   35270    const GLboolean transpose = cmd->transpose;
   35271    const GLdouble * value;
   35272    const char *variable_data = (const char *) (cmd + 1);
   35273    value = (const GLdouble *) variable_data;
   35274    variable_data += count * 64;
   35275    CALL_ProgramUniformMatrix4x2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   35276 }
   35277 static void GLAPIENTRY
   35278 _mesa_marshal_ProgramUniformMatrix4x2dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   35279 {
   35280    GET_CURRENT_CONTEXT(ctx);
   35281    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix4x2dv) + safe_mul(count, 64);
   35282    struct marshal_cmd_ProgramUniformMatrix4x2dv *cmd;
   35283    debug_print_marshal("ProgramUniformMatrix4x2dv");
   35284    if (unlikely(safe_mul(count, 64) < 0)) {
   35285       goto fallback_to_sync;
   35286    }
   35287    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35288       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix4x2dv, cmd_size);
   35289       cmd->program = program;
   35290       cmd->location = location;
   35291       cmd->count = count;
   35292       cmd->transpose = transpose;
   35293       char *variable_data = (char *) (cmd + 1);
   35294       memcpy(variable_data, value, count * 64);
   35295       variable_data += count * 64;
   35296       _mesa_post_marshal_hook(ctx);
   35297       return;
   35298    }
   35299 
   35300 fallback_to_sync:
   35301    _mesa_glthread_finish(ctx);
   35302    debug_print_sync_fallback("ProgramUniformMatrix4x2dv");
   35303    CALL_ProgramUniformMatrix4x2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   35304 }
   35305 
   35306 
   35307 /* ProgramEnvParameter4fARB: marshalled asynchronously */
   35308 struct marshal_cmd_ProgramEnvParameter4fARB
   35309 {
   35310    struct marshal_cmd_base cmd_base;
   35311    GLenum target;
   35312    GLuint index;
   35313    GLfloat x;
   35314    GLfloat y;
   35315    GLfloat z;
   35316    GLfloat w;
   35317 };
   35318 static inline void
   35319 _mesa_unmarshal_ProgramEnvParameter4fARB(struct gl_context *ctx, const struct marshal_cmd_ProgramEnvParameter4fARB *cmd)
   35320 {
   35321    const GLenum target = cmd->target;
   35322    const GLuint index = cmd->index;
   35323    const GLfloat x = cmd->x;
   35324    const GLfloat y = cmd->y;
   35325    const GLfloat z = cmd->z;
   35326    const GLfloat w = cmd->w;
   35327    CALL_ProgramEnvParameter4fARB(ctx->CurrentServerDispatch, (target, index, x, y, z, w));
   35328 }
   35329 static void GLAPIENTRY
   35330 _mesa_marshal_ProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
   35331 {
   35332    GET_CURRENT_CONTEXT(ctx);
   35333    size_t cmd_size = sizeof(struct marshal_cmd_ProgramEnvParameter4fARB);
   35334    struct marshal_cmd_ProgramEnvParameter4fARB *cmd;
   35335    debug_print_marshal("ProgramEnvParameter4fARB");
   35336    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35337       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramEnvParameter4fARB, cmd_size);
   35338       cmd->target = target;
   35339       cmd->index = index;
   35340       cmd->x = x;
   35341       cmd->y = y;
   35342       cmd->z = z;
   35343       cmd->w = w;
   35344       _mesa_post_marshal_hook(ctx);
   35345       return;
   35346    }
   35347 
   35348    _mesa_glthread_finish(ctx);
   35349    debug_print_sync_fallback("ProgramEnvParameter4fARB");
   35350    CALL_ProgramEnvParameter4fARB(ctx->CurrentServerDispatch, (target, index, x, y, z, w));
   35351 }
   35352 
   35353 
   35354 /* ClearDepth: marshalled asynchronously */
   35355 struct marshal_cmd_ClearDepth
   35356 {
   35357    struct marshal_cmd_base cmd_base;
   35358    GLclampd depth;
   35359 };
   35360 static inline void
   35361 _mesa_unmarshal_ClearDepth(struct gl_context *ctx, const struct marshal_cmd_ClearDepth *cmd)
   35362 {
   35363    const GLclampd depth = cmd->depth;
   35364    CALL_ClearDepth(ctx->CurrentServerDispatch, (depth));
   35365 }
   35366 static void GLAPIENTRY
   35367 _mesa_marshal_ClearDepth(GLclampd depth)
   35368 {
   35369    GET_CURRENT_CONTEXT(ctx);
   35370    size_t cmd_size = sizeof(struct marshal_cmd_ClearDepth);
   35371    struct marshal_cmd_ClearDepth *cmd;
   35372    debug_print_marshal("ClearDepth");
   35373    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35374       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearDepth, cmd_size);
   35375       cmd->depth = depth;
   35376       _mesa_post_marshal_hook(ctx);
   35377       return;
   35378    }
   35379 
   35380    _mesa_glthread_finish(ctx);
   35381    debug_print_sync_fallback("ClearDepth");
   35382    CALL_ClearDepth(ctx->CurrentServerDispatch, (depth));
   35383 }
   35384 
   35385 
   35386 /* VertexAttrib3dvNV: marshalled asynchronously */
   35387 struct marshal_cmd_VertexAttrib3dvNV
   35388 {
   35389    struct marshal_cmd_base cmd_base;
   35390    GLuint index;
   35391    GLdouble v[3];
   35392 };
   35393 static inline void
   35394 _mesa_unmarshal_VertexAttrib3dvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3dvNV *cmd)
   35395 {
   35396    const GLuint index = cmd->index;
   35397    const GLdouble * v = cmd->v;
   35398    CALL_VertexAttrib3dvNV(ctx->CurrentServerDispatch, (index, v));
   35399 }
   35400 static void GLAPIENTRY
   35401 _mesa_marshal_VertexAttrib3dvNV(GLuint index, const GLdouble * v)
   35402 {
   35403    GET_CURRENT_CONTEXT(ctx);
   35404    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib3dvNV);
   35405    struct marshal_cmd_VertexAttrib3dvNV *cmd;
   35406    debug_print_marshal("VertexAttrib3dvNV");
   35407    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35408       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3dvNV, cmd_size);
   35409       cmd->index = index;
   35410       memcpy(cmd->v, v, 24);
   35411       _mesa_post_marshal_hook(ctx);
   35412       return;
   35413    }
   35414 
   35415    _mesa_glthread_finish(ctx);
   35416    debug_print_sync_fallback("VertexAttrib3dvNV");
   35417    CALL_VertexAttrib3dvNV(ctx->CurrentServerDispatch, (index, v));
   35418 }
   35419 
   35420 
   35421 /* Color4fv: marshalled asynchronously */
   35422 struct marshal_cmd_Color4fv
   35423 {
   35424    struct marshal_cmd_base cmd_base;
   35425    GLfloat v[4];
   35426 };
   35427 static inline void
   35428 _mesa_unmarshal_Color4fv(struct gl_context *ctx, const struct marshal_cmd_Color4fv *cmd)
   35429 {
   35430    const GLfloat * v = cmd->v;
   35431    CALL_Color4fv(ctx->CurrentServerDispatch, (v));
   35432 }
   35433 static void GLAPIENTRY
   35434 _mesa_marshal_Color4fv(const GLfloat * v)
   35435 {
   35436    GET_CURRENT_CONTEXT(ctx);
   35437    size_t cmd_size = sizeof(struct marshal_cmd_Color4fv);
   35438    struct marshal_cmd_Color4fv *cmd;
   35439    debug_print_marshal("Color4fv");
   35440    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35441       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4fv, cmd_size);
   35442       memcpy(cmd->v, v, 16);
   35443       _mesa_post_marshal_hook(ctx);
   35444       return;
   35445    }
   35446 
   35447    _mesa_glthread_finish(ctx);
   35448    debug_print_sync_fallback("Color4fv");
   35449    CALL_Color4fv(ctx->CurrentServerDispatch, (v));
   35450 }
   35451 
   35452 
   35453 /* GetnMinmaxARB: marshalled synchronously */
   35454 static void GLAPIENTRY
   35455 _mesa_marshal_GetnMinmaxARB(GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, GLvoid * values)
   35456 {
   35457    GET_CURRENT_CONTEXT(ctx);
   35458    _mesa_glthread_finish(ctx);
   35459    debug_print_sync("GetnMinmaxARB");
   35460    CALL_GetnMinmaxARB(ctx->CurrentServerDispatch, (target, reset, format, type, bufSize, values));
   35461 }
   35462 
   35463 
   35464 /* IsImageHandleResidentARB: marshalled synchronously */
   35465 static GLboolean GLAPIENTRY
   35466 _mesa_marshal_IsImageHandleResidentARB(GLuint64 handle)
   35467 {
   35468    GET_CURRENT_CONTEXT(ctx);
   35469    _mesa_glthread_finish(ctx);
   35470    debug_print_sync("IsImageHandleResidentARB");
   35471    return CALL_IsImageHandleResidentARB(ctx->CurrentServerDispatch, (handle));
   35472 }
   35473 
   35474 
   35475 /* ColorPointer: marshalled asynchronously */
   35476 struct marshal_cmd_ColorPointer
   35477 {
   35478    struct marshal_cmd_base cmd_base;
   35479    GLint size;
   35480    GLenum type;
   35481    GLsizei stride;
   35482    const GLvoid * pointer;
   35483 };
   35484 static inline void
   35485 _mesa_unmarshal_ColorPointer(struct gl_context *ctx, const struct marshal_cmd_ColorPointer *cmd)
   35486 {
   35487    const GLint size = cmd->size;
   35488    const GLenum type = cmd->type;
   35489    const GLsizei stride = cmd->stride;
   35490    const GLvoid * pointer = cmd->pointer;
   35491    CALL_ColorPointer(ctx->CurrentServerDispatch, (size, type, stride, pointer));
   35492 }
   35493 static void GLAPIENTRY
   35494 _mesa_marshal_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
   35495 {
   35496    GET_CURRENT_CONTEXT(ctx);
   35497    size_t cmd_size = sizeof(struct marshal_cmd_ColorPointer);
   35498    struct marshal_cmd_ColorPointer *cmd;
   35499    debug_print_marshal("ColorPointer");
   35500    if (_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)) {
   35501       _mesa_glthread_finish(ctx);
   35502       _mesa_glthread_restore_dispatch(ctx);
   35503       debug_print_sync_fallback("ColorPointer");
   35504       CALL_ColorPointer(ctx->CurrentServerDispatch, (size, type, stride, pointer));
   35505       return;
   35506    }
   35507    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35508       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorPointer, cmd_size);
   35509       cmd->size = size;
   35510       cmd->type = type;
   35511       cmd->stride = stride;
   35512       cmd->pointer = pointer;
   35513       _mesa_post_marshal_hook(ctx);
   35514       return;
   35515    }
   35516 
   35517    _mesa_glthread_finish(ctx);
   35518    debug_print_sync_fallback("ColorPointer");
   35519    CALL_ColorPointer(ctx->CurrentServerDispatch, (size, type, stride, pointer));
   35520 }
   35521 
   35522 
   35523 /* ProgramUniform2ui64ARB: marshalled asynchronously */
   35524 struct marshal_cmd_ProgramUniform2ui64ARB
   35525 {
   35526    struct marshal_cmd_base cmd_base;
   35527    GLuint program;
   35528    GLint location;
   35529    GLuint64 x;
   35530    GLuint64 y;
   35531 };
   35532 static inline void
   35533 _mesa_unmarshal_ProgramUniform2ui64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2ui64ARB *cmd)
   35534 {
   35535    const GLuint program = cmd->program;
   35536    const GLint location = cmd->location;
   35537    const GLuint64 x = cmd->x;
   35538    const GLuint64 y = cmd->y;
   35539    CALL_ProgramUniform2ui64ARB(ctx->CurrentServerDispatch, (program, location, x, y));
   35540 }
   35541 static void GLAPIENTRY
   35542 _mesa_marshal_ProgramUniform2ui64ARB(GLuint program, GLint location, GLuint64 x, GLuint64 y)
   35543 {
   35544    GET_CURRENT_CONTEXT(ctx);
   35545    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform2ui64ARB);
   35546    struct marshal_cmd_ProgramUniform2ui64ARB *cmd;
   35547    debug_print_marshal("ProgramUniform2ui64ARB");
   35548    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35549       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2ui64ARB, cmd_size);
   35550       cmd->program = program;
   35551       cmd->location = location;
   35552       cmd->x = x;
   35553       cmd->y = y;
   35554       _mesa_post_marshal_hook(ctx);
   35555       return;
   35556    }
   35557 
   35558    _mesa_glthread_finish(ctx);
   35559    debug_print_sync_fallback("ProgramUniform2ui64ARB");
   35560    CALL_ProgramUniform2ui64ARB(ctx->CurrentServerDispatch, (program, location, x, y));
   35561 }
   35562 
   35563 
   35564 /* Lightiv: marshalled synchronously */
   35565 static void GLAPIENTRY
   35566 _mesa_marshal_Lightiv(GLenum light, GLenum pname, const GLint * params)
   35567 {
   35568    GET_CURRENT_CONTEXT(ctx);
   35569    _mesa_glthread_finish(ctx);
   35570    debug_print_sync("Lightiv");
   35571    CALL_Lightiv(ctx->CurrentServerDispatch, (light, pname, params));
   35572 }
   35573 
   35574 
   35575 /* GetTexParameterIuiv: marshalled synchronously */
   35576 static void GLAPIENTRY
   35577 _mesa_marshal_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint * params)
   35578 {
   35579    GET_CURRENT_CONTEXT(ctx);
   35580    _mesa_glthread_finish(ctx);
   35581    debug_print_sync("GetTexParameterIuiv");
   35582    CALL_GetTexParameterIuiv(ctx->CurrentServerDispatch, (target, pname, params));
   35583 }
   35584 
   35585 
   35586 /* TransformFeedbackVaryings: marshalled synchronously */
   35587 static void GLAPIENTRY
   35588 _mesa_marshal_TransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar * const * varyings, GLenum bufferMode)
   35589 {
   35590    GET_CURRENT_CONTEXT(ctx);
   35591    _mesa_glthread_finish(ctx);
   35592    debug_print_sync("TransformFeedbackVaryings");
   35593    CALL_TransformFeedbackVaryings(ctx->CurrentServerDispatch, (program, count, varyings, bufferMode));
   35594 }
   35595 
   35596 
   35597 /* VertexAttrib3sv: marshalled asynchronously */
   35598 struct marshal_cmd_VertexAttrib3sv
   35599 {
   35600    struct marshal_cmd_base cmd_base;
   35601    GLuint index;
   35602    GLshort v[3];
   35603 };
   35604 static inline void
   35605 _mesa_unmarshal_VertexAttrib3sv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3sv *cmd)
   35606 {
   35607    const GLuint index = cmd->index;
   35608    const GLshort * v = cmd->v;
   35609    CALL_VertexAttrib3sv(ctx->CurrentServerDispatch, (index, v));
   35610 }
   35611 static void GLAPIENTRY
   35612 _mesa_marshal_VertexAttrib3sv(GLuint index, const GLshort * v)
   35613 {
   35614    GET_CURRENT_CONTEXT(ctx);
   35615    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib3sv);
   35616    struct marshal_cmd_VertexAttrib3sv *cmd;
   35617    debug_print_marshal("VertexAttrib3sv");
   35618    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35619       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3sv, cmd_size);
   35620       cmd->index = index;
   35621       memcpy(cmd->v, v, 6);
   35622       _mesa_post_marshal_hook(ctx);
   35623       return;
   35624    }
   35625 
   35626    _mesa_glthread_finish(ctx);
   35627    debug_print_sync_fallback("VertexAttrib3sv");
   35628    CALL_VertexAttrib3sv(ctx->CurrentServerDispatch, (index, v));
   35629 }
   35630 
   35631 
   35632 /* Uniform4i64ARB: marshalled asynchronously */
   35633 struct marshal_cmd_Uniform4i64ARB
   35634 {
   35635    struct marshal_cmd_base cmd_base;
   35636    GLint location;
   35637    GLint64 x;
   35638    GLint64 y;
   35639    GLint64 z;
   35640    GLint64 w;
   35641 };
   35642 static inline void
   35643 _mesa_unmarshal_Uniform4i64ARB(struct gl_context *ctx, const struct marshal_cmd_Uniform4i64ARB *cmd)
   35644 {
   35645    const GLint location = cmd->location;
   35646    const GLint64 x = cmd->x;
   35647    const GLint64 y = cmd->y;
   35648    const GLint64 z = cmd->z;
   35649    const GLint64 w = cmd->w;
   35650    CALL_Uniform4i64ARB(ctx->CurrentServerDispatch, (location, x, y, z, w));
   35651 }
   35652 static void GLAPIENTRY
   35653 _mesa_marshal_Uniform4i64ARB(GLint location, GLint64 x, GLint64 y, GLint64 z, GLint64 w)
   35654 {
   35655    GET_CURRENT_CONTEXT(ctx);
   35656    size_t cmd_size = sizeof(struct marshal_cmd_Uniform4i64ARB);
   35657    struct marshal_cmd_Uniform4i64ARB *cmd;
   35658    debug_print_marshal("Uniform4i64ARB");
   35659    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35660       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4i64ARB, cmd_size);
   35661       cmd->location = location;
   35662       cmd->x = x;
   35663       cmd->y = y;
   35664       cmd->z = z;
   35665       cmd->w = w;
   35666       _mesa_post_marshal_hook(ctx);
   35667       return;
   35668    }
   35669 
   35670    _mesa_glthread_finish(ctx);
   35671    debug_print_sync_fallback("Uniform4i64ARB");
   35672    CALL_Uniform4i64ARB(ctx->CurrentServerDispatch, (location, x, y, z, w));
   35673 }
   35674 
   35675 
   35676 /* IsVertexArray: marshalled synchronously */
   35677 static GLboolean GLAPIENTRY
   35678 _mesa_marshal_IsVertexArray(GLuint array)
   35679 {
   35680    GET_CURRENT_CONTEXT(ctx);
   35681    _mesa_glthread_finish(ctx);
   35682    debug_print_sync("IsVertexArray");
   35683    return CALL_IsVertexArray(ctx->CurrentServerDispatch, (array));
   35684 }
   35685 
   35686 
   35687 /* ProgramUniform3ui64ARB: marshalled asynchronously */
   35688 struct marshal_cmd_ProgramUniform3ui64ARB
   35689 {
   35690    struct marshal_cmd_base cmd_base;
   35691    GLuint program;
   35692    GLint location;
   35693    GLuint64 x;
   35694    GLuint64 y;
   35695    GLuint64 z;
   35696 };
   35697 static inline void
   35698 _mesa_unmarshal_ProgramUniform3ui64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3ui64ARB *cmd)
   35699 {
   35700    const GLuint program = cmd->program;
   35701    const GLint location = cmd->location;
   35702    const GLuint64 x = cmd->x;
   35703    const GLuint64 y = cmd->y;
   35704    const GLuint64 z = cmd->z;
   35705    CALL_ProgramUniform3ui64ARB(ctx->CurrentServerDispatch, (program, location, x, y, z));
   35706 }
   35707 static void GLAPIENTRY
   35708 _mesa_marshal_ProgramUniform3ui64ARB(GLuint program, GLint location, GLuint64 x, GLuint64 y, GLuint64 z)
   35709 {
   35710    GET_CURRENT_CONTEXT(ctx);
   35711    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform3ui64ARB);
   35712    struct marshal_cmd_ProgramUniform3ui64ARB *cmd;
   35713    debug_print_marshal("ProgramUniform3ui64ARB");
   35714    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35715       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3ui64ARB, cmd_size);
   35716       cmd->program = program;
   35717       cmd->location = location;
   35718       cmd->x = x;
   35719       cmd->y = y;
   35720       cmd->z = z;
   35721       _mesa_post_marshal_hook(ctx);
   35722       return;
   35723    }
   35724 
   35725    _mesa_glthread_finish(ctx);
   35726    debug_print_sync_fallback("ProgramUniform3ui64ARB");
   35727    CALL_ProgramUniform3ui64ARB(ctx->CurrentServerDispatch, (program, location, x, y, z));
   35728 }
   35729 
   35730 
   35731 /* PushClientAttrib: marshalled asynchronously */
   35732 struct marshal_cmd_PushClientAttrib
   35733 {
   35734    struct marshal_cmd_base cmd_base;
   35735    GLbitfield mask;
   35736 };
   35737 static inline void
   35738 _mesa_unmarshal_PushClientAttrib(struct gl_context *ctx, const struct marshal_cmd_PushClientAttrib *cmd)
   35739 {
   35740    const GLbitfield mask = cmd->mask;
   35741    CALL_PushClientAttrib(ctx->CurrentServerDispatch, (mask));
   35742 }
   35743 static void GLAPIENTRY
   35744 _mesa_marshal_PushClientAttrib(GLbitfield mask)
   35745 {
   35746    GET_CURRENT_CONTEXT(ctx);
   35747    size_t cmd_size = sizeof(struct marshal_cmd_PushClientAttrib);
   35748    struct marshal_cmd_PushClientAttrib *cmd;
   35749    debug_print_marshal("PushClientAttrib");
   35750    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35751       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PushClientAttrib, cmd_size);
   35752       cmd->mask = mask;
   35753       _mesa_post_marshal_hook(ctx);
   35754       return;
   35755    }
   35756 
   35757    _mesa_glthread_finish(ctx);
   35758    debug_print_sync_fallback("PushClientAttrib");
   35759    CALL_PushClientAttrib(ctx->CurrentServerDispatch, (mask));
   35760 }
   35761 
   35762 
   35763 /* ProgramUniform4ui: marshalled asynchronously */
   35764 struct marshal_cmd_ProgramUniform4ui
   35765 {
   35766    struct marshal_cmd_base cmd_base;
   35767    GLuint program;
   35768    GLint location;
   35769    GLuint x;
   35770    GLuint y;
   35771    GLuint z;
   35772    GLuint w;
   35773 };
   35774 static inline void
   35775 _mesa_unmarshal_ProgramUniform4ui(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4ui *cmd)
   35776 {
   35777    const GLuint program = cmd->program;
   35778    const GLint location = cmd->location;
   35779    const GLuint x = cmd->x;
   35780    const GLuint y = cmd->y;
   35781    const GLuint z = cmd->z;
   35782    const GLuint w = cmd->w;
   35783    CALL_ProgramUniform4ui(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
   35784 }
   35785 static void GLAPIENTRY
   35786 _mesa_marshal_ProgramUniform4ui(GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w)
   35787 {
   35788    GET_CURRENT_CONTEXT(ctx);
   35789    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform4ui);
   35790    struct marshal_cmd_ProgramUniform4ui *cmd;
   35791    debug_print_marshal("ProgramUniform4ui");
   35792    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35793       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4ui, cmd_size);
   35794       cmd->program = program;
   35795       cmd->location = location;
   35796       cmd->x = x;
   35797       cmd->y = y;
   35798       cmd->z = z;
   35799       cmd->w = w;
   35800       _mesa_post_marshal_hook(ctx);
   35801       return;
   35802    }
   35803 
   35804    _mesa_glthread_finish(ctx);
   35805    debug_print_sync_fallback("ProgramUniform4ui");
   35806    CALL_ProgramUniform4ui(ctx->CurrentServerDispatch, (program, location, x, y, z, w));
   35807 }
   35808 
   35809 
   35810 /* Uniform1f: marshalled asynchronously */
   35811 struct marshal_cmd_Uniform1f
   35812 {
   35813    struct marshal_cmd_base cmd_base;
   35814    GLint location;
   35815    GLfloat v0;
   35816 };
   35817 static inline void
   35818 _mesa_unmarshal_Uniform1f(struct gl_context *ctx, const struct marshal_cmd_Uniform1f *cmd)
   35819 {
   35820    const GLint location = cmd->location;
   35821    const GLfloat v0 = cmd->v0;
   35822    CALL_Uniform1f(ctx->CurrentServerDispatch, (location, v0));
   35823 }
   35824 static void GLAPIENTRY
   35825 _mesa_marshal_Uniform1f(GLint location, GLfloat v0)
   35826 {
   35827    GET_CURRENT_CONTEXT(ctx);
   35828    size_t cmd_size = sizeof(struct marshal_cmd_Uniform1f);
   35829    struct marshal_cmd_Uniform1f *cmd;
   35830    debug_print_marshal("Uniform1f");
   35831    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35832       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1f, cmd_size);
   35833       cmd->location = location;
   35834       cmd->v0 = v0;
   35835       _mesa_post_marshal_hook(ctx);
   35836       return;
   35837    }
   35838 
   35839    _mesa_glthread_finish(ctx);
   35840    debug_print_sync_fallback("Uniform1f");
   35841    CALL_Uniform1f(ctx->CurrentServerDispatch, (location, v0));
   35842 }
   35843 
   35844 
   35845 /* Uniform1d: marshalled asynchronously */
   35846 struct marshal_cmd_Uniform1d
   35847 {
   35848    struct marshal_cmd_base cmd_base;
   35849    GLint location;
   35850    GLdouble x;
   35851 };
   35852 static inline void
   35853 _mesa_unmarshal_Uniform1d(struct gl_context *ctx, const struct marshal_cmd_Uniform1d *cmd)
   35854 {
   35855    const GLint location = cmd->location;
   35856    const GLdouble x = cmd->x;
   35857    CALL_Uniform1d(ctx->CurrentServerDispatch, (location, x));
   35858 }
   35859 static void GLAPIENTRY
   35860 _mesa_marshal_Uniform1d(GLint location, GLdouble x)
   35861 {
   35862    GET_CURRENT_CONTEXT(ctx);
   35863    size_t cmd_size = sizeof(struct marshal_cmd_Uniform1d);
   35864    struct marshal_cmd_Uniform1d *cmd;
   35865    debug_print_marshal("Uniform1d");
   35866    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35867       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1d, cmd_size);
   35868       cmd->location = location;
   35869       cmd->x = x;
   35870       _mesa_post_marshal_hook(ctx);
   35871       return;
   35872    }
   35873 
   35874    _mesa_glthread_finish(ctx);
   35875    debug_print_sync_fallback("Uniform1d");
   35876    CALL_Uniform1d(ctx->CurrentServerDispatch, (location, x));
   35877 }
   35878 
   35879 
   35880 /* Uniform1i: marshalled asynchronously */
   35881 struct marshal_cmd_Uniform1i
   35882 {
   35883    struct marshal_cmd_base cmd_base;
   35884    GLint location;
   35885    GLint v0;
   35886 };
   35887 static inline void
   35888 _mesa_unmarshal_Uniform1i(struct gl_context *ctx, const struct marshal_cmd_Uniform1i *cmd)
   35889 {
   35890    const GLint location = cmd->location;
   35891    const GLint v0 = cmd->v0;
   35892    CALL_Uniform1i(ctx->CurrentServerDispatch, (location, v0));
   35893 }
   35894 static void GLAPIENTRY
   35895 _mesa_marshal_Uniform1i(GLint location, GLint v0)
   35896 {
   35897    GET_CURRENT_CONTEXT(ctx);
   35898    size_t cmd_size = sizeof(struct marshal_cmd_Uniform1i);
   35899    struct marshal_cmd_Uniform1i *cmd;
   35900    debug_print_marshal("Uniform1i");
   35901    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35902       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1i, cmd_size);
   35903       cmd->location = location;
   35904       cmd->v0 = v0;
   35905       _mesa_post_marshal_hook(ctx);
   35906       return;
   35907    }
   35908 
   35909    _mesa_glthread_finish(ctx);
   35910    debug_print_sync_fallback("Uniform1i");
   35911    CALL_Uniform1i(ctx->CurrentServerDispatch, (location, v0));
   35912 }
   35913 
   35914 
   35915 /* GetPolygonStipple: marshalled synchronously */
   35916 static void GLAPIENTRY
   35917 _mesa_marshal_GetPolygonStipple(GLubyte * mask)
   35918 {
   35919    GET_CURRENT_CONTEXT(ctx);
   35920    _mesa_glthread_finish(ctx);
   35921    debug_print_sync("GetPolygonStipple");
   35922    CALL_GetPolygonStipple(ctx->CurrentServerDispatch, (mask));
   35923 }
   35924 
   35925 
   35926 /* BlitNamedFramebuffer: marshalled asynchronously */
   35927 struct marshal_cmd_BlitNamedFramebuffer
   35928 {
   35929    struct marshal_cmd_base cmd_base;
   35930    GLuint readFramebuffer;
   35931    GLuint drawFramebuffer;
   35932    GLint srcX0;
   35933    GLint srcY0;
   35934    GLint srcX1;
   35935    GLint srcY1;
   35936    GLint dstX0;
   35937    GLint dstY0;
   35938    GLint dstX1;
   35939    GLint dstY1;
   35940    GLbitfield mask;
   35941    GLenum filter;
   35942 };
   35943 static inline void
   35944 _mesa_unmarshal_BlitNamedFramebuffer(struct gl_context *ctx, const struct marshal_cmd_BlitNamedFramebuffer *cmd)
   35945 {
   35946    const GLuint readFramebuffer = cmd->readFramebuffer;
   35947    const GLuint drawFramebuffer = cmd->drawFramebuffer;
   35948    const GLint srcX0 = cmd->srcX0;
   35949    const GLint srcY0 = cmd->srcY0;
   35950    const GLint srcX1 = cmd->srcX1;
   35951    const GLint srcY1 = cmd->srcY1;
   35952    const GLint dstX0 = cmd->dstX0;
   35953    const GLint dstY0 = cmd->dstY0;
   35954    const GLint dstX1 = cmd->dstX1;
   35955    const GLint dstY1 = cmd->dstY1;
   35956    const GLbitfield mask = cmd->mask;
   35957    const GLenum filter = cmd->filter;
   35958    CALL_BlitNamedFramebuffer(ctx->CurrentServerDispatch, (readFramebuffer, drawFramebuffer, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
   35959 }
   35960 static void GLAPIENTRY
   35961 _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)
   35962 {
   35963    GET_CURRENT_CONTEXT(ctx);
   35964    size_t cmd_size = sizeof(struct marshal_cmd_BlitNamedFramebuffer);
   35965    struct marshal_cmd_BlitNamedFramebuffer *cmd;
   35966    debug_print_marshal("BlitNamedFramebuffer");
   35967    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   35968       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlitNamedFramebuffer, cmd_size);
   35969       cmd->readFramebuffer = readFramebuffer;
   35970       cmd->drawFramebuffer = drawFramebuffer;
   35971       cmd->srcX0 = srcX0;
   35972       cmd->srcY0 = srcY0;
   35973       cmd->srcX1 = srcX1;
   35974       cmd->srcY1 = srcY1;
   35975       cmd->dstX0 = dstX0;
   35976       cmd->dstY0 = dstY0;
   35977       cmd->dstX1 = dstX1;
   35978       cmd->dstY1 = dstY1;
   35979       cmd->mask = mask;
   35980       cmd->filter = filter;
   35981       _mesa_post_marshal_hook(ctx);
   35982       return;
   35983    }
   35984 
   35985    _mesa_glthread_finish(ctx);
   35986    debug_print_sync_fallback("BlitNamedFramebuffer");
   35987    CALL_BlitNamedFramebuffer(ctx->CurrentServerDispatch, (readFramebuffer, drawFramebuffer, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter));
   35988 }
   35989 
   35990 
   35991 /* UseProgram: marshalled asynchronously */
   35992 struct marshal_cmd_UseProgram
   35993 {
   35994    struct marshal_cmd_base cmd_base;
   35995    GLuint program;
   35996 };
   35997 static inline void
   35998 _mesa_unmarshal_UseProgram(struct gl_context *ctx, const struct marshal_cmd_UseProgram *cmd)
   35999 {
   36000    const GLuint program = cmd->program;
   36001    CALL_UseProgram(ctx->CurrentServerDispatch, (program));
   36002 }
   36003 static void GLAPIENTRY
   36004 _mesa_marshal_UseProgram(GLuint program)
   36005 {
   36006    GET_CURRENT_CONTEXT(ctx);
   36007    size_t cmd_size = sizeof(struct marshal_cmd_UseProgram);
   36008    struct marshal_cmd_UseProgram *cmd;
   36009    debug_print_marshal("UseProgram");
   36010    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36011       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UseProgram, cmd_size);
   36012       cmd->program = program;
   36013       _mesa_post_marshal_hook(ctx);
   36014       return;
   36015    }
   36016 
   36017    _mesa_glthread_finish(ctx);
   36018    debug_print_sync_fallback("UseProgram");
   36019    CALL_UseProgram(ctx->CurrentServerDispatch, (program));
   36020 }
   36021 
   36022 
   36023 /* GetFragDataLocation: marshalled synchronously */
   36024 static GLint GLAPIENTRY
   36025 _mesa_marshal_GetFragDataLocation(GLuint program, const GLchar * name)
   36026 {
   36027    GET_CURRENT_CONTEXT(ctx);
   36028    _mesa_glthread_finish(ctx);
   36029    debug_print_sync("GetFragDataLocation");
   36030    return CALL_GetFragDataLocation(ctx->CurrentServerDispatch, (program, name));
   36031 }
   36032 
   36033 
   36034 /* PixelMapuiv: marshalled synchronously */
   36035 static void GLAPIENTRY
   36036 _mesa_marshal_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint * values)
   36037 {
   36038    GET_CURRENT_CONTEXT(ctx);
   36039    _mesa_glthread_finish(ctx);
   36040    debug_print_sync("PixelMapuiv");
   36041    CALL_PixelMapuiv(ctx->CurrentServerDispatch, (map, mapsize, values));
   36042 }
   36043 
   36044 
   36045 /* ClearNamedBufferSubData: marshalled synchronously */
   36046 static void GLAPIENTRY
   36047 _mesa_marshal_ClearNamedBufferSubData(GLuint buffer, GLenum internalformat, GLintptr offset, GLsizeiptr size, GLenum format, GLenum type, const GLvoid * data)
   36048 {
   36049    GET_CURRENT_CONTEXT(ctx);
   36050    _mesa_glthread_finish(ctx);
   36051    debug_print_sync("ClearNamedBufferSubData");
   36052    CALL_ClearNamedBufferSubData(ctx->CurrentServerDispatch, (buffer, internalformat, offset, size, format, type, data));
   36053 }
   36054 
   36055 
   36056 /* GetNamedFramebufferAttachmentParameteriv: marshalled synchronously */
   36057 static void GLAPIENTRY
   36058 _mesa_marshal_GetNamedFramebufferAttachmentParameteriv(GLuint framebuffer, GLenum attachment, GLenum pname, GLint * params)
   36059 {
   36060    GET_CURRENT_CONTEXT(ctx);
   36061    _mesa_glthread_finish(ctx);
   36062    debug_print_sync("GetNamedFramebufferAttachmentParameteriv");
   36063    CALL_GetNamedFramebufferAttachmentParameteriv(ctx->CurrentServerDispatch, (framebuffer, attachment, pname, params));
   36064 }
   36065 
   36066 
   36067 /* GenVertexArrays: marshalled synchronously */
   36068 static void GLAPIENTRY
   36069 _mesa_marshal_GenVertexArrays(GLsizei n, GLuint * arrays)
   36070 {
   36071    GET_CURRENT_CONTEXT(ctx);
   36072    _mesa_glthread_finish(ctx);
   36073    debug_print_sync("GenVertexArrays");
   36074    CALL_GenVertexArrays(ctx->CurrentServerDispatch, (n, arrays));
   36075 }
   36076 
   36077 
   36078 /* TexStorageMem2DMultisampleEXT: marshalled asynchronously */
   36079 struct marshal_cmd_TexStorageMem2DMultisampleEXT
   36080 {
   36081    struct marshal_cmd_base cmd_base;
   36082    GLenum target;
   36083    GLsizei samples;
   36084    GLenum internalFormat;
   36085    GLsizei width;
   36086    GLsizei height;
   36087    GLboolean fixedSampleLocations;
   36088    GLuint memory;
   36089    GLuint64 offset;
   36090 };
   36091 static inline void
   36092 _mesa_unmarshal_TexStorageMem2DMultisampleEXT(struct gl_context *ctx, const struct marshal_cmd_TexStorageMem2DMultisampleEXT *cmd)
   36093 {
   36094    const GLenum target = cmd->target;
   36095    const GLsizei samples = cmd->samples;
   36096    const GLenum internalFormat = cmd->internalFormat;
   36097    const GLsizei width = cmd->width;
   36098    const GLsizei height = cmd->height;
   36099    const GLboolean fixedSampleLocations = cmd->fixedSampleLocations;
   36100    const GLuint memory = cmd->memory;
   36101    const GLuint64 offset = cmd->offset;
   36102    CALL_TexStorageMem2DMultisampleEXT(ctx->CurrentServerDispatch, (target, samples, internalFormat, width, height, fixedSampleLocations, memory, offset));
   36103 }
   36104 static void GLAPIENTRY
   36105 _mesa_marshal_TexStorageMem2DMultisampleEXT(GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset)
   36106 {
   36107    GET_CURRENT_CONTEXT(ctx);
   36108    size_t cmd_size = sizeof(struct marshal_cmd_TexStorageMem2DMultisampleEXT);
   36109    struct marshal_cmd_TexStorageMem2DMultisampleEXT *cmd;
   36110    debug_print_marshal("TexStorageMem2DMultisampleEXT");
   36111    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36112       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorageMem2DMultisampleEXT, cmd_size);
   36113       cmd->target = target;
   36114       cmd->samples = samples;
   36115       cmd->internalFormat = internalFormat;
   36116       cmd->width = width;
   36117       cmd->height = height;
   36118       cmd->fixedSampleLocations = fixedSampleLocations;
   36119       cmd->memory = memory;
   36120       cmd->offset = offset;
   36121       _mesa_post_marshal_hook(ctx);
   36122       return;
   36123    }
   36124 
   36125    _mesa_glthread_finish(ctx);
   36126    debug_print_sync_fallback("TexStorageMem2DMultisampleEXT");
   36127    CALL_TexStorageMem2DMultisampleEXT(ctx->CurrentServerDispatch, (target, samples, internalFormat, width, height, fixedSampleLocations, memory, offset));
   36128 }
   36129 
   36130 
   36131 /* Color3s: marshalled asynchronously */
   36132 struct marshal_cmd_Color3s
   36133 {
   36134    struct marshal_cmd_base cmd_base;
   36135    GLshort red;
   36136    GLshort green;
   36137    GLshort blue;
   36138 };
   36139 static inline void
   36140 _mesa_unmarshal_Color3s(struct gl_context *ctx, const struct marshal_cmd_Color3s *cmd)
   36141 {
   36142    const GLshort red = cmd->red;
   36143    const GLshort green = cmd->green;
   36144    const GLshort blue = cmd->blue;
   36145    CALL_Color3s(ctx->CurrentServerDispatch, (red, green, blue));
   36146 }
   36147 static void GLAPIENTRY
   36148 _mesa_marshal_Color3s(GLshort red, GLshort green, GLshort blue)
   36149 {
   36150    GET_CURRENT_CONTEXT(ctx);
   36151    size_t cmd_size = sizeof(struct marshal_cmd_Color3s);
   36152    struct marshal_cmd_Color3s *cmd;
   36153    debug_print_marshal("Color3s");
   36154    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36155       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3s, cmd_size);
   36156       cmd->red = red;
   36157       cmd->green = green;
   36158       cmd->blue = blue;
   36159       _mesa_post_marshal_hook(ctx);
   36160       return;
   36161    }
   36162 
   36163    _mesa_glthread_finish(ctx);
   36164    debug_print_sync_fallback("Color3s");
   36165    CALL_Color3s(ctx->CurrentServerDispatch, (red, green, blue));
   36166 }
   36167 
   36168 
   36169 /* TextureStorage2DMultisample: marshalled asynchronously */
   36170 struct marshal_cmd_TextureStorage2DMultisample
   36171 {
   36172    struct marshal_cmd_base cmd_base;
   36173    GLuint texture;
   36174    GLsizei samples;
   36175    GLenum internalformat;
   36176    GLsizei width;
   36177    GLsizei height;
   36178    GLboolean fixedsamplelocations;
   36179 };
   36180 static inline void
   36181 _mesa_unmarshal_TextureStorage2DMultisample(struct gl_context *ctx, const struct marshal_cmd_TextureStorage2DMultisample *cmd)
   36182 {
   36183    const GLuint texture = cmd->texture;
   36184    const GLsizei samples = cmd->samples;
   36185    const GLenum internalformat = cmd->internalformat;
   36186    const GLsizei width = cmd->width;
   36187    const GLsizei height = cmd->height;
   36188    const GLboolean fixedsamplelocations = cmd->fixedsamplelocations;
   36189    CALL_TextureStorage2DMultisample(ctx->CurrentServerDispatch, (texture, samples, internalformat, width, height, fixedsamplelocations));
   36190 }
   36191 static void GLAPIENTRY
   36192 _mesa_marshal_TextureStorage2DMultisample(GLuint texture, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
   36193 {
   36194    GET_CURRENT_CONTEXT(ctx);
   36195    size_t cmd_size = sizeof(struct marshal_cmd_TextureStorage2DMultisample);
   36196    struct marshal_cmd_TextureStorage2DMultisample *cmd;
   36197    debug_print_marshal("TextureStorage2DMultisample");
   36198    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36199       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorage2DMultisample, cmd_size);
   36200       cmd->texture = texture;
   36201       cmd->samples = samples;
   36202       cmd->internalformat = internalformat;
   36203       cmd->width = width;
   36204       cmd->height = height;
   36205       cmd->fixedsamplelocations = fixedsamplelocations;
   36206       _mesa_post_marshal_hook(ctx);
   36207       return;
   36208    }
   36209 
   36210    _mesa_glthread_finish(ctx);
   36211    debug_print_sync_fallback("TextureStorage2DMultisample");
   36212    CALL_TextureStorage2DMultisample(ctx->CurrentServerDispatch, (texture, samples, internalformat, width, height, fixedsamplelocations));
   36213 }
   36214 
   36215 
   36216 /* TexCoordPointer: marshalled asynchronously */
   36217 struct marshal_cmd_TexCoordPointer
   36218 {
   36219    struct marshal_cmd_base cmd_base;
   36220    GLint size;
   36221    GLenum type;
   36222    GLsizei stride;
   36223    const GLvoid * pointer;
   36224 };
   36225 static inline void
   36226 _mesa_unmarshal_TexCoordPointer(struct gl_context *ctx, const struct marshal_cmd_TexCoordPointer *cmd)
   36227 {
   36228    const GLint size = cmd->size;
   36229    const GLenum type = cmd->type;
   36230    const GLsizei stride = cmd->stride;
   36231    const GLvoid * pointer = cmd->pointer;
   36232    CALL_TexCoordPointer(ctx->CurrentServerDispatch, (size, type, stride, pointer));
   36233 }
   36234 static void GLAPIENTRY
   36235 _mesa_marshal_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
   36236 {
   36237    GET_CURRENT_CONTEXT(ctx);
   36238    size_t cmd_size = sizeof(struct marshal_cmd_TexCoordPointer);
   36239    struct marshal_cmd_TexCoordPointer *cmd;
   36240    debug_print_marshal("TexCoordPointer");
   36241    if (_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)) {
   36242       _mesa_glthread_finish(ctx);
   36243       _mesa_glthread_restore_dispatch(ctx);
   36244       debug_print_sync_fallback("TexCoordPointer");
   36245       CALL_TexCoordPointer(ctx->CurrentServerDispatch, (size, type, stride, pointer));
   36246       return;
   36247    }
   36248    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36249       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordPointer, cmd_size);
   36250       cmd->size = size;
   36251       cmd->type = type;
   36252       cmd->stride = stride;
   36253       cmd->pointer = pointer;
   36254       _mesa_post_marshal_hook(ctx);
   36255       return;
   36256    }
   36257 
   36258    _mesa_glthread_finish(ctx);
   36259    debug_print_sync_fallback("TexCoordPointer");
   36260    CALL_TexCoordPointer(ctx->CurrentServerDispatch, (size, type, stride, pointer));
   36261 }
   36262 
   36263 
   36264 /* Color3i: marshalled asynchronously */
   36265 struct marshal_cmd_Color3i
   36266 {
   36267    struct marshal_cmd_base cmd_base;
   36268    GLint red;
   36269    GLint green;
   36270    GLint blue;
   36271 };
   36272 static inline void
   36273 _mesa_unmarshal_Color3i(struct gl_context *ctx, const struct marshal_cmd_Color3i *cmd)
   36274 {
   36275    const GLint red = cmd->red;
   36276    const GLint green = cmd->green;
   36277    const GLint blue = cmd->blue;
   36278    CALL_Color3i(ctx->CurrentServerDispatch, (red, green, blue));
   36279 }
   36280 static void GLAPIENTRY
   36281 _mesa_marshal_Color3i(GLint red, GLint green, GLint blue)
   36282 {
   36283    GET_CURRENT_CONTEXT(ctx);
   36284    size_t cmd_size = sizeof(struct marshal_cmd_Color3i);
   36285    struct marshal_cmd_Color3i *cmd;
   36286    debug_print_marshal("Color3i");
   36287    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36288       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3i, cmd_size);
   36289       cmd->red = red;
   36290       cmd->green = green;
   36291       cmd->blue = blue;
   36292       _mesa_post_marshal_hook(ctx);
   36293       return;
   36294    }
   36295 
   36296    _mesa_glthread_finish(ctx);
   36297    debug_print_sync_fallback("Color3i");
   36298    CALL_Color3i(ctx->CurrentServerDispatch, (red, green, blue));
   36299 }
   36300 
   36301 
   36302 /* EvalCoord2d: marshalled asynchronously */
   36303 struct marshal_cmd_EvalCoord2d
   36304 {
   36305    struct marshal_cmd_base cmd_base;
   36306    GLdouble u;
   36307    GLdouble v;
   36308 };
   36309 static inline void
   36310 _mesa_unmarshal_EvalCoord2d(struct gl_context *ctx, const struct marshal_cmd_EvalCoord2d *cmd)
   36311 {
   36312    const GLdouble u = cmd->u;
   36313    const GLdouble v = cmd->v;
   36314    CALL_EvalCoord2d(ctx->CurrentServerDispatch, (u, v));
   36315 }
   36316 static void GLAPIENTRY
   36317 _mesa_marshal_EvalCoord2d(GLdouble u, GLdouble v)
   36318 {
   36319    GET_CURRENT_CONTEXT(ctx);
   36320    size_t cmd_size = sizeof(struct marshal_cmd_EvalCoord2d);
   36321    struct marshal_cmd_EvalCoord2d *cmd;
   36322    debug_print_marshal("EvalCoord2d");
   36323    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36324       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EvalCoord2d, cmd_size);
   36325       cmd->u = u;
   36326       cmd->v = v;
   36327       _mesa_post_marshal_hook(ctx);
   36328       return;
   36329    }
   36330 
   36331    _mesa_glthread_finish(ctx);
   36332    debug_print_sync_fallback("EvalCoord2d");
   36333    CALL_EvalCoord2d(ctx->CurrentServerDispatch, (u, v));
   36334 }
   36335 
   36336 
   36337 /* EvalCoord2f: marshalled asynchronously */
   36338 struct marshal_cmd_EvalCoord2f
   36339 {
   36340    struct marshal_cmd_base cmd_base;
   36341    GLfloat u;
   36342    GLfloat v;
   36343 };
   36344 static inline void
   36345 _mesa_unmarshal_EvalCoord2f(struct gl_context *ctx, const struct marshal_cmd_EvalCoord2f *cmd)
   36346 {
   36347    const GLfloat u = cmd->u;
   36348    const GLfloat v = cmd->v;
   36349    CALL_EvalCoord2f(ctx->CurrentServerDispatch, (u, v));
   36350 }
   36351 static void GLAPIENTRY
   36352 _mesa_marshal_EvalCoord2f(GLfloat u, GLfloat v)
   36353 {
   36354    GET_CURRENT_CONTEXT(ctx);
   36355    size_t cmd_size = sizeof(struct marshal_cmd_EvalCoord2f);
   36356    struct marshal_cmd_EvalCoord2f *cmd;
   36357    debug_print_marshal("EvalCoord2f");
   36358    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36359       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EvalCoord2f, cmd_size);
   36360       cmd->u = u;
   36361       cmd->v = v;
   36362       _mesa_post_marshal_hook(ctx);
   36363       return;
   36364    }
   36365 
   36366    _mesa_glthread_finish(ctx);
   36367    debug_print_sync_fallback("EvalCoord2f");
   36368    CALL_EvalCoord2f(ctx->CurrentServerDispatch, (u, v));
   36369 }
   36370 
   36371 
   36372 /* Color3b: marshalled asynchronously */
   36373 struct marshal_cmd_Color3b
   36374 {
   36375    struct marshal_cmd_base cmd_base;
   36376    GLbyte red;
   36377    GLbyte green;
   36378    GLbyte blue;
   36379 };
   36380 static inline void
   36381 _mesa_unmarshal_Color3b(struct gl_context *ctx, const struct marshal_cmd_Color3b *cmd)
   36382 {
   36383    const GLbyte red = cmd->red;
   36384    const GLbyte green = cmd->green;
   36385    const GLbyte blue = cmd->blue;
   36386    CALL_Color3b(ctx->CurrentServerDispatch, (red, green, blue));
   36387 }
   36388 static void GLAPIENTRY
   36389 _mesa_marshal_Color3b(GLbyte red, GLbyte green, GLbyte blue)
   36390 {
   36391    GET_CURRENT_CONTEXT(ctx);
   36392    size_t cmd_size = sizeof(struct marshal_cmd_Color3b);
   36393    struct marshal_cmd_Color3b *cmd;
   36394    debug_print_marshal("Color3b");
   36395    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36396       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3b, cmd_size);
   36397       cmd->red = red;
   36398       cmd->green = green;
   36399       cmd->blue = blue;
   36400       _mesa_post_marshal_hook(ctx);
   36401       return;
   36402    }
   36403 
   36404    _mesa_glthread_finish(ctx);
   36405    debug_print_sync_fallback("Color3b");
   36406    CALL_Color3b(ctx->CurrentServerDispatch, (red, green, blue));
   36407 }
   36408 
   36409 
   36410 /* Color3f: marshalled asynchronously */
   36411 struct marshal_cmd_Color3f
   36412 {
   36413    struct marshal_cmd_base cmd_base;
   36414    GLfloat red;
   36415    GLfloat green;
   36416    GLfloat blue;
   36417 };
   36418 static inline void
   36419 _mesa_unmarshal_Color3f(struct gl_context *ctx, const struct marshal_cmd_Color3f *cmd)
   36420 {
   36421    const GLfloat red = cmd->red;
   36422    const GLfloat green = cmd->green;
   36423    const GLfloat blue = cmd->blue;
   36424    CALL_Color3f(ctx->CurrentServerDispatch, (red, green, blue));
   36425 }
   36426 static void GLAPIENTRY
   36427 _mesa_marshal_Color3f(GLfloat red, GLfloat green, GLfloat blue)
   36428 {
   36429    GET_CURRENT_CONTEXT(ctx);
   36430    size_t cmd_size = sizeof(struct marshal_cmd_Color3f);
   36431    struct marshal_cmd_Color3f *cmd;
   36432    debug_print_marshal("Color3f");
   36433    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36434       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3f, cmd_size);
   36435       cmd->red = red;
   36436       cmd->green = green;
   36437       cmd->blue = blue;
   36438       _mesa_post_marshal_hook(ctx);
   36439       return;
   36440    }
   36441 
   36442    _mesa_glthread_finish(ctx);
   36443    debug_print_sync_fallback("Color3f");
   36444    CALL_Color3f(ctx->CurrentServerDispatch, (red, green, blue));
   36445 }
   36446 
   36447 
   36448 /* Color3d: marshalled asynchronously */
   36449 struct marshal_cmd_Color3d
   36450 {
   36451    struct marshal_cmd_base cmd_base;
   36452    GLdouble red;
   36453    GLdouble green;
   36454    GLdouble blue;
   36455 };
   36456 static inline void
   36457 _mesa_unmarshal_Color3d(struct gl_context *ctx, const struct marshal_cmd_Color3d *cmd)
   36458 {
   36459    const GLdouble red = cmd->red;
   36460    const GLdouble green = cmd->green;
   36461    const GLdouble blue = cmd->blue;
   36462    CALL_Color3d(ctx->CurrentServerDispatch, (red, green, blue));
   36463 }
   36464 static void GLAPIENTRY
   36465 _mesa_marshal_Color3d(GLdouble red, GLdouble green, GLdouble blue)
   36466 {
   36467    GET_CURRENT_CONTEXT(ctx);
   36468    size_t cmd_size = sizeof(struct marshal_cmd_Color3d);
   36469    struct marshal_cmd_Color3d *cmd;
   36470    debug_print_marshal("Color3d");
   36471    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36472       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3d, cmd_size);
   36473       cmd->red = red;
   36474       cmd->green = green;
   36475       cmd->blue = blue;
   36476       _mesa_post_marshal_hook(ctx);
   36477       return;
   36478    }
   36479 
   36480    _mesa_glthread_finish(ctx);
   36481    debug_print_sync_fallback("Color3d");
   36482    CALL_Color3d(ctx->CurrentServerDispatch, (red, green, blue));
   36483 }
   36484 
   36485 
   36486 /* GetVertexAttribdv: marshalled synchronously */
   36487 static void GLAPIENTRY
   36488 _mesa_marshal_GetVertexAttribdv(GLuint index, GLenum pname, GLdouble * params)
   36489 {
   36490    GET_CURRENT_CONTEXT(ctx);
   36491    _mesa_glthread_finish(ctx);
   36492    debug_print_sync("GetVertexAttribdv");
   36493    CALL_GetVertexAttribdv(ctx->CurrentServerDispatch, (index, pname, params));
   36494 }
   36495 
   36496 
   36497 /* GetBufferPointerv: marshalled synchronously */
   36498 static void GLAPIENTRY
   36499 _mesa_marshal_GetBufferPointerv(GLenum target, GLenum pname, GLvoid ** params)
   36500 {
   36501    GET_CURRENT_CONTEXT(ctx);
   36502    _mesa_glthread_finish(ctx);
   36503    debug_print_sync("GetBufferPointerv");
   36504    CALL_GetBufferPointerv(ctx->CurrentServerDispatch, (target, pname, params));
   36505 }
   36506 
   36507 
   36508 /* GenFramebuffers: marshalled synchronously */
   36509 static void GLAPIENTRY
   36510 _mesa_marshal_GenFramebuffers(GLsizei n, GLuint * framebuffers)
   36511 {
   36512    GET_CURRENT_CONTEXT(ctx);
   36513    _mesa_glthread_finish(ctx);
   36514    debug_print_sync("GenFramebuffers");
   36515    CALL_GenFramebuffers(ctx->CurrentServerDispatch, (n, framebuffers));
   36516 }
   36517 
   36518 
   36519 /* IsTextureHandleResidentARB: marshalled synchronously */
   36520 static GLboolean GLAPIENTRY
   36521 _mesa_marshal_IsTextureHandleResidentARB(GLuint64 handle)
   36522 {
   36523    GET_CURRENT_CONTEXT(ctx);
   36524    _mesa_glthread_finish(ctx);
   36525    debug_print_sync("IsTextureHandleResidentARB");
   36526    return CALL_IsTextureHandleResidentARB(ctx->CurrentServerDispatch, (handle));
   36527 }
   36528 
   36529 
   36530 /* GenBuffers: marshalled synchronously */
   36531 static void GLAPIENTRY
   36532 _mesa_marshal_GenBuffers(GLsizei n, GLuint * buffer)
   36533 {
   36534    GET_CURRENT_CONTEXT(ctx);
   36535    _mesa_glthread_finish(ctx);
   36536    debug_print_sync("GenBuffers");
   36537    CALL_GenBuffers(ctx->CurrentServerDispatch, (n, buffer));
   36538 }
   36539 
   36540 
   36541 /* ClearDepthx: marshalled asynchronously */
   36542 struct marshal_cmd_ClearDepthx
   36543 {
   36544    struct marshal_cmd_base cmd_base;
   36545    GLclampx depth;
   36546 };
   36547 static inline void
   36548 _mesa_unmarshal_ClearDepthx(struct gl_context *ctx, const struct marshal_cmd_ClearDepthx *cmd)
   36549 {
   36550    const GLclampx depth = cmd->depth;
   36551    CALL_ClearDepthx(ctx->CurrentServerDispatch, (depth));
   36552 }
   36553 static void GLAPIENTRY
   36554 _mesa_marshal_ClearDepthx(GLclampx depth)
   36555 {
   36556    GET_CURRENT_CONTEXT(ctx);
   36557    size_t cmd_size = sizeof(struct marshal_cmd_ClearDepthx);
   36558    struct marshal_cmd_ClearDepthx *cmd;
   36559    debug_print_marshal("ClearDepthx");
   36560    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36561       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearDepthx, cmd_size);
   36562       cmd->depth = depth;
   36563       _mesa_post_marshal_hook(ctx);
   36564       return;
   36565    }
   36566 
   36567    _mesa_glthread_finish(ctx);
   36568    debug_print_sync_fallback("ClearDepthx");
   36569    CALL_ClearDepthx(ctx->CurrentServerDispatch, (depth));
   36570 }
   36571 
   36572 
   36573 /* EnableVertexArrayAttrib: marshalled asynchronously */
   36574 struct marshal_cmd_EnableVertexArrayAttrib
   36575 {
   36576    struct marshal_cmd_base cmd_base;
   36577    GLuint vaobj;
   36578    GLuint index;
   36579 };
   36580 static inline void
   36581 _mesa_unmarshal_EnableVertexArrayAttrib(struct gl_context *ctx, const struct marshal_cmd_EnableVertexArrayAttrib *cmd)
   36582 {
   36583    const GLuint vaobj = cmd->vaobj;
   36584    const GLuint index = cmd->index;
   36585    CALL_EnableVertexArrayAttrib(ctx->CurrentServerDispatch, (vaobj, index));
   36586 }
   36587 static void GLAPIENTRY
   36588 _mesa_marshal_EnableVertexArrayAttrib(GLuint vaobj, GLuint index)
   36589 {
   36590    GET_CURRENT_CONTEXT(ctx);
   36591    size_t cmd_size = sizeof(struct marshal_cmd_EnableVertexArrayAttrib);
   36592    struct marshal_cmd_EnableVertexArrayAttrib *cmd;
   36593    debug_print_marshal("EnableVertexArrayAttrib");
   36594    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36595       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EnableVertexArrayAttrib, cmd_size);
   36596       cmd->vaobj = vaobj;
   36597       cmd->index = index;
   36598       _mesa_post_marshal_hook(ctx);
   36599       return;
   36600    }
   36601 
   36602    _mesa_glthread_finish(ctx);
   36603    debug_print_sync_fallback("EnableVertexArrayAttrib");
   36604    CALL_EnableVertexArrayAttrib(ctx->CurrentServerDispatch, (vaobj, index));
   36605 }
   36606 
   36607 
   36608 /* BlendEquationSeparate: marshalled asynchronously */
   36609 struct marshal_cmd_BlendEquationSeparate
   36610 {
   36611    struct marshal_cmd_base cmd_base;
   36612    GLenum modeRGB;
   36613    GLenum modeA;
   36614 };
   36615 static inline void
   36616 _mesa_unmarshal_BlendEquationSeparate(struct gl_context *ctx, const struct marshal_cmd_BlendEquationSeparate *cmd)
   36617 {
   36618    const GLenum modeRGB = cmd->modeRGB;
   36619    const GLenum modeA = cmd->modeA;
   36620    CALL_BlendEquationSeparate(ctx->CurrentServerDispatch, (modeRGB, modeA));
   36621 }
   36622 static void GLAPIENTRY
   36623 _mesa_marshal_BlendEquationSeparate(GLenum modeRGB, GLenum modeA)
   36624 {
   36625    GET_CURRENT_CONTEXT(ctx);
   36626    size_t cmd_size = sizeof(struct marshal_cmd_BlendEquationSeparate);
   36627    struct marshal_cmd_BlendEquationSeparate *cmd;
   36628    debug_print_marshal("BlendEquationSeparate");
   36629    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36630       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendEquationSeparate, cmd_size);
   36631       cmd->modeRGB = modeRGB;
   36632       cmd->modeA = modeA;
   36633       _mesa_post_marshal_hook(ctx);
   36634       return;
   36635    }
   36636 
   36637    _mesa_glthread_finish(ctx);
   36638    debug_print_sync_fallback("BlendEquationSeparate");
   36639    CALL_BlendEquationSeparate(ctx->CurrentServerDispatch, (modeRGB, modeA));
   36640 }
   36641 
   36642 
   36643 /* MultiTexCoordP4ui: marshalled asynchronously */
   36644 struct marshal_cmd_MultiTexCoordP4ui
   36645 {
   36646    struct marshal_cmd_base cmd_base;
   36647    GLenum texture;
   36648    GLenum type;
   36649    GLuint coords;
   36650 };
   36651 static inline void
   36652 _mesa_unmarshal_MultiTexCoordP4ui(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP4ui *cmd)
   36653 {
   36654    const GLenum texture = cmd->texture;
   36655    const GLenum type = cmd->type;
   36656    const GLuint coords = cmd->coords;
   36657    CALL_MultiTexCoordP4ui(ctx->CurrentServerDispatch, (texture, type, coords));
   36658 }
   36659 static void GLAPIENTRY
   36660 _mesa_marshal_MultiTexCoordP4ui(GLenum texture, GLenum type, GLuint coords)
   36661 {
   36662    GET_CURRENT_CONTEXT(ctx);
   36663    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP4ui);
   36664    struct marshal_cmd_MultiTexCoordP4ui *cmd;
   36665    debug_print_marshal("MultiTexCoordP4ui");
   36666    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36667       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP4ui, cmd_size);
   36668       cmd->texture = texture;
   36669       cmd->type = type;
   36670       cmd->coords = coords;
   36671       _mesa_post_marshal_hook(ctx);
   36672       return;
   36673    }
   36674 
   36675    _mesa_glthread_finish(ctx);
   36676    debug_print_sync_fallback("MultiTexCoordP4ui");
   36677    CALL_MultiTexCoordP4ui(ctx->CurrentServerDispatch, (texture, type, coords));
   36678 }
   36679 
   36680 
   36681 /* VertexAttribs1fvNV: marshalled asynchronously */
   36682 struct marshal_cmd_VertexAttribs1fvNV
   36683 {
   36684    struct marshal_cmd_base cmd_base;
   36685    GLuint index;
   36686    GLsizei n;
   36687    /* Next safe_mul(n, 4) bytes are GLfloat v[n] */
   36688 };
   36689 static inline void
   36690 _mesa_unmarshal_VertexAttribs1fvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs1fvNV *cmd)
   36691 {
   36692    const GLuint index = cmd->index;
   36693    const GLsizei n = cmd->n;
   36694    const GLfloat * v;
   36695    const char *variable_data = (const char *) (cmd + 1);
   36696    v = (const GLfloat *) variable_data;
   36697    variable_data += n * 4;
   36698    CALL_VertexAttribs1fvNV(ctx->CurrentServerDispatch, (index, n, v));
   36699 }
   36700 static void GLAPIENTRY
   36701 _mesa_marshal_VertexAttribs1fvNV(GLuint index, GLsizei n, const GLfloat * v)
   36702 {
   36703    GET_CURRENT_CONTEXT(ctx);
   36704    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribs1fvNV) + safe_mul(n, 4);
   36705    struct marshal_cmd_VertexAttribs1fvNV *cmd;
   36706    debug_print_marshal("VertexAttribs1fvNV");
   36707    if (unlikely(safe_mul(n, 4) < 0)) {
   36708       goto fallback_to_sync;
   36709    }
   36710    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36711       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs1fvNV, cmd_size);
   36712       cmd->index = index;
   36713       cmd->n = n;
   36714       char *variable_data = (char *) (cmd + 1);
   36715       memcpy(variable_data, v, n * 4);
   36716       variable_data += n * 4;
   36717       _mesa_post_marshal_hook(ctx);
   36718       return;
   36719    }
   36720 
   36721 fallback_to_sync:
   36722    _mesa_glthread_finish(ctx);
   36723    debug_print_sync_fallback("VertexAttribs1fvNV");
   36724    CALL_VertexAttribs1fvNV(ctx->CurrentServerDispatch, (index, n, v));
   36725 }
   36726 
   36727 
   36728 /* VertexAttribIPointer: marshalled asynchronously */
   36729 struct marshal_cmd_VertexAttribIPointer
   36730 {
   36731    struct marshal_cmd_base cmd_base;
   36732    GLuint index;
   36733    GLint size;
   36734    GLenum type;
   36735    GLsizei stride;
   36736    const GLvoid * pointer;
   36737 };
   36738 static inline void
   36739 _mesa_unmarshal_VertexAttribIPointer(struct gl_context *ctx, const struct marshal_cmd_VertexAttribIPointer *cmd)
   36740 {
   36741    const GLuint index = cmd->index;
   36742    const GLint size = cmd->size;
   36743    const GLenum type = cmd->type;
   36744    const GLsizei stride = cmd->stride;
   36745    const GLvoid * pointer = cmd->pointer;
   36746    CALL_VertexAttribIPointer(ctx->CurrentServerDispatch, (index, size, type, stride, pointer));
   36747 }
   36748 static void GLAPIENTRY
   36749 _mesa_marshal_VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
   36750 {
   36751    GET_CURRENT_CONTEXT(ctx);
   36752    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribIPointer);
   36753    struct marshal_cmd_VertexAttribIPointer *cmd;
   36754    debug_print_marshal("VertexAttribIPointer");
   36755    if (_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)) {
   36756       _mesa_glthread_finish(ctx);
   36757       _mesa_glthread_restore_dispatch(ctx);
   36758       debug_print_sync_fallback("VertexAttribIPointer");
   36759       CALL_VertexAttribIPointer(ctx->CurrentServerDispatch, (index, size, type, stride, pointer));
   36760       return;
   36761    }
   36762    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36763       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribIPointer, cmd_size);
   36764       cmd->index = index;
   36765       cmd->size = size;
   36766       cmd->type = type;
   36767       cmd->stride = stride;
   36768       cmd->pointer = pointer;
   36769       _mesa_post_marshal_hook(ctx);
   36770       return;
   36771    }
   36772 
   36773    _mesa_glthread_finish(ctx);
   36774    debug_print_sync_fallback("VertexAttribIPointer");
   36775    CALL_VertexAttribIPointer(ctx->CurrentServerDispatch, (index, size, type, stride, pointer));
   36776 }
   36777 
   36778 
   36779 /* ProgramUniform4fv: marshalled asynchronously */
   36780 struct marshal_cmd_ProgramUniform4fv
   36781 {
   36782    struct marshal_cmd_base cmd_base;
   36783    GLuint program;
   36784    GLint location;
   36785    GLsizei count;
   36786    /* Next safe_mul(count, 16) bytes are GLfloat value[count][4] */
   36787 };
   36788 static inline void
   36789 _mesa_unmarshal_ProgramUniform4fv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4fv *cmd)
   36790 {
   36791    const GLuint program = cmd->program;
   36792    const GLint location = cmd->location;
   36793    const GLsizei count = cmd->count;
   36794    const GLfloat * value;
   36795    const char *variable_data = (const char *) (cmd + 1);
   36796    value = (const GLfloat *) variable_data;
   36797    variable_data += count * 16;
   36798    CALL_ProgramUniform4fv(ctx->CurrentServerDispatch, (program, location, count, value));
   36799 }
   36800 static void GLAPIENTRY
   36801 _mesa_marshal_ProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat * value)
   36802 {
   36803    GET_CURRENT_CONTEXT(ctx);
   36804    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform4fv) + safe_mul(count, 16);
   36805    struct marshal_cmd_ProgramUniform4fv *cmd;
   36806    debug_print_marshal("ProgramUniform4fv");
   36807    if (unlikely(safe_mul(count, 16) < 0)) {
   36808       goto fallback_to_sync;
   36809    }
   36810    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36811       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4fv, cmd_size);
   36812       cmd->program = program;
   36813       cmd->location = location;
   36814       cmd->count = count;
   36815       char *variable_data = (char *) (cmd + 1);
   36816       memcpy(variable_data, value, count * 16);
   36817       variable_data += count * 16;
   36818       _mesa_post_marshal_hook(ctx);
   36819       return;
   36820    }
   36821 
   36822 fallback_to_sync:
   36823    _mesa_glthread_finish(ctx);
   36824    debug_print_sync_fallback("ProgramUniform4fv");
   36825    CALL_ProgramUniform4fv(ctx->CurrentServerDispatch, (program, location, count, value));
   36826 }
   36827 
   36828 
   36829 /* RasterPos4sv: marshalled asynchronously */
   36830 struct marshal_cmd_RasterPos4sv
   36831 {
   36832    struct marshal_cmd_base cmd_base;
   36833    GLshort v[4];
   36834 };
   36835 static inline void
   36836 _mesa_unmarshal_RasterPos4sv(struct gl_context *ctx, const struct marshal_cmd_RasterPos4sv *cmd)
   36837 {
   36838    const GLshort * v = cmd->v;
   36839    CALL_RasterPos4sv(ctx->CurrentServerDispatch, (v));
   36840 }
   36841 static void GLAPIENTRY
   36842 _mesa_marshal_RasterPos4sv(const GLshort * v)
   36843 {
   36844    GET_CURRENT_CONTEXT(ctx);
   36845    size_t cmd_size = sizeof(struct marshal_cmd_RasterPos4sv);
   36846    struct marshal_cmd_RasterPos4sv *cmd;
   36847    debug_print_marshal("RasterPos4sv");
   36848    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36849       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RasterPos4sv, cmd_size);
   36850       memcpy(cmd->v, v, 8);
   36851       _mesa_post_marshal_hook(ctx);
   36852       return;
   36853    }
   36854 
   36855    _mesa_glthread_finish(ctx);
   36856    debug_print_sync_fallback("RasterPos4sv");
   36857    CALL_RasterPos4sv(ctx->CurrentServerDispatch, (v));
   36858 }
   36859 
   36860 
   36861 /* CopyTextureSubImage3D: marshalled asynchronously */
   36862 struct marshal_cmd_CopyTextureSubImage3D
   36863 {
   36864    struct marshal_cmd_base cmd_base;
   36865    GLuint texture;
   36866    GLint level;
   36867    GLint xoffset;
   36868    GLint yoffset;
   36869    GLint zoffset;
   36870    GLint x;
   36871    GLint y;
   36872    GLsizei width;
   36873    GLsizei height;
   36874 };
   36875 static inline void
   36876 _mesa_unmarshal_CopyTextureSubImage3D(struct gl_context *ctx, const struct marshal_cmd_CopyTextureSubImage3D *cmd)
   36877 {
   36878    const GLuint texture = cmd->texture;
   36879    const GLint level = cmd->level;
   36880    const GLint xoffset = cmd->xoffset;
   36881    const GLint yoffset = cmd->yoffset;
   36882    const GLint zoffset = cmd->zoffset;
   36883    const GLint x = cmd->x;
   36884    const GLint y = cmd->y;
   36885    const GLsizei width = cmd->width;
   36886    const GLsizei height = cmd->height;
   36887    CALL_CopyTextureSubImage3D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, x, y, width, height));
   36888 }
   36889 static void GLAPIENTRY
   36890 _mesa_marshal_CopyTextureSubImage3D(GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
   36891 {
   36892    GET_CURRENT_CONTEXT(ctx);
   36893    size_t cmd_size = sizeof(struct marshal_cmd_CopyTextureSubImage3D);
   36894    struct marshal_cmd_CopyTextureSubImage3D *cmd;
   36895    debug_print_marshal("CopyTextureSubImage3D");
   36896    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36897       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyTextureSubImage3D, cmd_size);
   36898       cmd->texture = texture;
   36899       cmd->level = level;
   36900       cmd->xoffset = xoffset;
   36901       cmd->yoffset = yoffset;
   36902       cmd->zoffset = zoffset;
   36903       cmd->x = x;
   36904       cmd->y = y;
   36905       cmd->width = width;
   36906       cmd->height = height;
   36907       _mesa_post_marshal_hook(ctx);
   36908       return;
   36909    }
   36910 
   36911    _mesa_glthread_finish(ctx);
   36912    debug_print_sync_fallback("CopyTextureSubImage3D");
   36913    CALL_CopyTextureSubImage3D(ctx->CurrentServerDispatch, (texture, level, xoffset, yoffset, zoffset, x, y, width, height));
   36914 }
   36915 
   36916 
   36917 /* SelectBuffer: marshalled synchronously */
   36918 static void GLAPIENTRY
   36919 _mesa_marshal_SelectBuffer(GLsizei size, GLuint * buffer)
   36920 {
   36921    GET_CURRENT_CONTEXT(ctx);
   36922    _mesa_glthread_finish(ctx);
   36923    debug_print_sync("SelectBuffer");
   36924    CALL_SelectBuffer(ctx->CurrentServerDispatch, (size, buffer));
   36925 }
   36926 
   36927 
   36928 /* GetSynciv: marshalled synchronously */
   36929 static void GLAPIENTRY
   36930 _mesa_marshal_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values)
   36931 {
   36932    GET_CURRENT_CONTEXT(ctx);
   36933    _mesa_glthread_finish(ctx);
   36934    debug_print_sync("GetSynciv");
   36935    CALL_GetSynciv(ctx->CurrentServerDispatch, (sync, pname, bufSize, length, values));
   36936 }
   36937 
   36938 
   36939 /* TextureView: marshalled asynchronously */
   36940 struct marshal_cmd_TextureView
   36941 {
   36942    struct marshal_cmd_base cmd_base;
   36943    GLuint texture;
   36944    GLenum target;
   36945    GLuint origtexture;
   36946    GLenum internalformat;
   36947    GLuint minlevel;
   36948    GLuint numlevels;
   36949    GLuint minlayer;
   36950    GLuint numlayers;
   36951 };
   36952 static inline void
   36953 _mesa_unmarshal_TextureView(struct gl_context *ctx, const struct marshal_cmd_TextureView *cmd)
   36954 {
   36955    const GLuint texture = cmd->texture;
   36956    const GLenum target = cmd->target;
   36957    const GLuint origtexture = cmd->origtexture;
   36958    const GLenum internalformat = cmd->internalformat;
   36959    const GLuint minlevel = cmd->minlevel;
   36960    const GLuint numlevels = cmd->numlevels;
   36961    const GLuint minlayer = cmd->minlayer;
   36962    const GLuint numlayers = cmd->numlayers;
   36963    CALL_TextureView(ctx->CurrentServerDispatch, (texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers));
   36964 }
   36965 static void GLAPIENTRY
   36966 _mesa_marshal_TextureView(GLuint texture, GLenum target, GLuint origtexture, GLenum internalformat, GLuint minlevel, GLuint numlevels, GLuint minlayer, GLuint numlayers)
   36967 {
   36968    GET_CURRENT_CONTEXT(ctx);
   36969    size_t cmd_size = sizeof(struct marshal_cmd_TextureView);
   36970    struct marshal_cmd_TextureView *cmd;
   36971    debug_print_marshal("TextureView");
   36972    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   36973       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureView, cmd_size);
   36974       cmd->texture = texture;
   36975       cmd->target = target;
   36976       cmd->origtexture = origtexture;
   36977       cmd->internalformat = internalformat;
   36978       cmd->minlevel = minlevel;
   36979       cmd->numlevels = numlevels;
   36980       cmd->minlayer = minlayer;
   36981       cmd->numlayers = numlayers;
   36982       _mesa_post_marshal_hook(ctx);
   36983       return;
   36984    }
   36985 
   36986    _mesa_glthread_finish(ctx);
   36987    debug_print_sync_fallback("TextureView");
   36988    CALL_TextureView(ctx->CurrentServerDispatch, (texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers));
   36989 }
   36990 
   36991 
   36992 /* TexEnviv: marshalled synchronously */
   36993 static void GLAPIENTRY
   36994 _mesa_marshal_TexEnviv(GLenum target, GLenum pname, const GLint * params)
   36995 {
   36996    GET_CURRENT_CONTEXT(ctx);
   36997    _mesa_glthread_finish(ctx);
   36998    debug_print_sync("TexEnviv");
   36999    CALL_TexEnviv(ctx->CurrentServerDispatch, (target, pname, params));
   37000 }
   37001 
   37002 
   37003 /* TexSubImage3D: marshalled synchronously */
   37004 static void GLAPIENTRY
   37005 _mesa_marshal_TexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid * pixels)
   37006 {
   37007    GET_CURRENT_CONTEXT(ctx);
   37008    _mesa_glthread_finish(ctx);
   37009    debug_print_sync("TexSubImage3D");
   37010    CALL_TexSubImage3D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels));
   37011 }
   37012 
   37013 
   37014 /* Bitmap: marshalled synchronously */
   37015 static void GLAPIENTRY
   37016 _mesa_marshal_Bitmap(GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte * bitmap)
   37017 {
   37018    GET_CURRENT_CONTEXT(ctx);
   37019    _mesa_glthread_finish(ctx);
   37020    debug_print_sync("Bitmap");
   37021    CALL_Bitmap(ctx->CurrentServerDispatch, (width, height, xorig, yorig, xmove, ymove, bitmap));
   37022 }
   37023 
   37024 
   37025 /* VertexAttribDivisor: marshalled asynchronously */
   37026 struct marshal_cmd_VertexAttribDivisor
   37027 {
   37028    struct marshal_cmd_base cmd_base;
   37029    GLuint index;
   37030    GLuint divisor;
   37031 };
   37032 static inline void
   37033 _mesa_unmarshal_VertexAttribDivisor(struct gl_context *ctx, const struct marshal_cmd_VertexAttribDivisor *cmd)
   37034 {
   37035    const GLuint index = cmd->index;
   37036    const GLuint divisor = cmd->divisor;
   37037    CALL_VertexAttribDivisor(ctx->CurrentServerDispatch, (index, divisor));
   37038 }
   37039 static void GLAPIENTRY
   37040 _mesa_marshal_VertexAttribDivisor(GLuint index, GLuint divisor)
   37041 {
   37042    GET_CURRENT_CONTEXT(ctx);
   37043    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribDivisor);
   37044    struct marshal_cmd_VertexAttribDivisor *cmd;
   37045    debug_print_marshal("VertexAttribDivisor");
   37046    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37047       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribDivisor, cmd_size);
   37048       cmd->index = index;
   37049       cmd->divisor = divisor;
   37050       _mesa_post_marshal_hook(ctx);
   37051       return;
   37052    }
   37053 
   37054    _mesa_glthread_finish(ctx);
   37055    debug_print_sync_fallback("VertexAttribDivisor");
   37056    CALL_VertexAttribDivisor(ctx->CurrentServerDispatch, (index, divisor));
   37057 }
   37058 
   37059 
   37060 /* DrawTransformFeedbackStream: marshalled asynchronously */
   37061 struct marshal_cmd_DrawTransformFeedbackStream
   37062 {
   37063    struct marshal_cmd_base cmd_base;
   37064    GLenum mode;
   37065    GLuint id;
   37066    GLuint stream;
   37067 };
   37068 static inline void
   37069 _mesa_unmarshal_DrawTransformFeedbackStream(struct gl_context *ctx, const struct marshal_cmd_DrawTransformFeedbackStream *cmd)
   37070 {
   37071    const GLenum mode = cmd->mode;
   37072    const GLuint id = cmd->id;
   37073    const GLuint stream = cmd->stream;
   37074    CALL_DrawTransformFeedbackStream(ctx->CurrentServerDispatch, (mode, id, stream));
   37075 }
   37076 static void GLAPIENTRY
   37077 _mesa_marshal_DrawTransformFeedbackStream(GLenum mode, GLuint id, GLuint stream)
   37078 {
   37079    GET_CURRENT_CONTEXT(ctx);
   37080    size_t cmd_size = sizeof(struct marshal_cmd_DrawTransformFeedbackStream);
   37081    struct marshal_cmd_DrawTransformFeedbackStream *cmd;
   37082    debug_print_marshal("DrawTransformFeedbackStream");
   37083    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37084       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTransformFeedbackStream, cmd_size);
   37085       cmd->mode = mode;
   37086       cmd->id = id;
   37087       cmd->stream = stream;
   37088       _mesa_post_marshal_hook(ctx);
   37089       return;
   37090    }
   37091 
   37092    _mesa_glthread_finish(ctx);
   37093    debug_print_sync_fallback("DrawTransformFeedbackStream");
   37094    CALL_DrawTransformFeedbackStream(ctx->CurrentServerDispatch, (mode, id, stream));
   37095 }
   37096 
   37097 
   37098 /* GetIntegerv: marshalled synchronously */
   37099 static void GLAPIENTRY
   37100 _mesa_marshal_GetIntegerv(GLenum pname, GLint * params)
   37101 {
   37102    GET_CURRENT_CONTEXT(ctx);
   37103    _mesa_glthread_finish(ctx);
   37104    debug_print_sync("GetIntegerv");
   37105    CALL_GetIntegerv(ctx->CurrentServerDispatch, (pname, params));
   37106 }
   37107 
   37108 
   37109 /* EndPerfQueryINTEL: marshalled asynchronously */
   37110 struct marshal_cmd_EndPerfQueryINTEL
   37111 {
   37112    struct marshal_cmd_base cmd_base;
   37113    GLuint queryHandle;
   37114 };
   37115 static inline void
   37116 _mesa_unmarshal_EndPerfQueryINTEL(struct gl_context *ctx, const struct marshal_cmd_EndPerfQueryINTEL *cmd)
   37117 {
   37118    const GLuint queryHandle = cmd->queryHandle;
   37119    CALL_EndPerfQueryINTEL(ctx->CurrentServerDispatch, (queryHandle));
   37120 }
   37121 static void GLAPIENTRY
   37122 _mesa_marshal_EndPerfQueryINTEL(GLuint queryHandle)
   37123 {
   37124    GET_CURRENT_CONTEXT(ctx);
   37125    size_t cmd_size = sizeof(struct marshal_cmd_EndPerfQueryINTEL);
   37126    struct marshal_cmd_EndPerfQueryINTEL *cmd;
   37127    debug_print_marshal("EndPerfQueryINTEL");
   37128    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37129       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EndPerfQueryINTEL, cmd_size);
   37130       cmd->queryHandle = queryHandle;
   37131       _mesa_post_marshal_hook(ctx);
   37132       return;
   37133    }
   37134 
   37135    _mesa_glthread_finish(ctx);
   37136    debug_print_sync_fallback("EndPerfQueryINTEL");
   37137    CALL_EndPerfQueryINTEL(ctx->CurrentServerDispatch, (queryHandle));
   37138 }
   37139 
   37140 
   37141 /* NamedBufferPageCommitmentARB: marshalled asynchronously */
   37142 struct marshal_cmd_NamedBufferPageCommitmentARB
   37143 {
   37144    struct marshal_cmd_base cmd_base;
   37145    GLuint buffer;
   37146    GLintptr offset;
   37147    GLsizeiptr size;
   37148    GLboolean commit;
   37149 };
   37150 static inline void
   37151 _mesa_unmarshal_NamedBufferPageCommitmentARB(struct gl_context *ctx, const struct marshal_cmd_NamedBufferPageCommitmentARB *cmd)
   37152 {
   37153    const GLuint buffer = cmd->buffer;
   37154    const GLintptr offset = cmd->offset;
   37155    const GLsizeiptr size = cmd->size;
   37156    const GLboolean commit = cmd->commit;
   37157    CALL_NamedBufferPageCommitmentARB(ctx->CurrentServerDispatch, (buffer, offset, size, commit));
   37158 }
   37159 static void GLAPIENTRY
   37160 _mesa_marshal_NamedBufferPageCommitmentARB(GLuint buffer, GLintptr offset, GLsizeiptr size, GLboolean commit)
   37161 {
   37162    GET_CURRENT_CONTEXT(ctx);
   37163    size_t cmd_size = sizeof(struct marshal_cmd_NamedBufferPageCommitmentARB);
   37164    struct marshal_cmd_NamedBufferPageCommitmentARB *cmd;
   37165    debug_print_marshal("NamedBufferPageCommitmentARB");
   37166    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37167       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedBufferPageCommitmentARB, cmd_size);
   37168       cmd->buffer = buffer;
   37169       cmd->offset = offset;
   37170       cmd->size = size;
   37171       cmd->commit = commit;
   37172       _mesa_post_marshal_hook(ctx);
   37173       return;
   37174    }
   37175 
   37176    _mesa_glthread_finish(ctx);
   37177    debug_print_sync_fallback("NamedBufferPageCommitmentARB");
   37178    CALL_NamedBufferPageCommitmentARB(ctx->CurrentServerDispatch, (buffer, offset, size, commit));
   37179 }
   37180 
   37181 
   37182 /* GetActiveUniform: marshalled synchronously */
   37183 static void GLAPIENTRY
   37184 _mesa_marshal_GetActiveUniform(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLint * size, GLenum * type, GLchar * name)
   37185 {
   37186    GET_CURRENT_CONTEXT(ctx);
   37187    _mesa_glthread_finish(ctx);
   37188    debug_print_sync("GetActiveUniform");
   37189    CALL_GetActiveUniform(ctx->CurrentServerDispatch, (program, index, bufSize, length, size, type, name));
   37190 }
   37191 
   37192 
   37193 /* AlphaFuncx: marshalled asynchronously */
   37194 struct marshal_cmd_AlphaFuncx
   37195 {
   37196    struct marshal_cmd_base cmd_base;
   37197    GLenum func;
   37198    GLclampx ref;
   37199 };
   37200 static inline void
   37201 _mesa_unmarshal_AlphaFuncx(struct gl_context *ctx, const struct marshal_cmd_AlphaFuncx *cmd)
   37202 {
   37203    const GLenum func = cmd->func;
   37204    const GLclampx ref = cmd->ref;
   37205    CALL_AlphaFuncx(ctx->CurrentServerDispatch, (func, ref));
   37206 }
   37207 static void GLAPIENTRY
   37208 _mesa_marshal_AlphaFuncx(GLenum func, GLclampx ref)
   37209 {
   37210    GET_CURRENT_CONTEXT(ctx);
   37211    size_t cmd_size = sizeof(struct marshal_cmd_AlphaFuncx);
   37212    struct marshal_cmd_AlphaFuncx *cmd;
   37213    debug_print_marshal("AlphaFuncx");
   37214    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37215       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_AlphaFuncx, cmd_size);
   37216       cmd->func = func;
   37217       cmd->ref = ref;
   37218       _mesa_post_marshal_hook(ctx);
   37219       return;
   37220    }
   37221 
   37222    _mesa_glthread_finish(ctx);
   37223    debug_print_sync_fallback("AlphaFuncx");
   37224    CALL_AlphaFuncx(ctx->CurrentServerDispatch, (func, ref));
   37225 }
   37226 
   37227 
   37228 /* VertexAttribI2ivEXT: marshalled synchronously */
   37229 static void GLAPIENTRY
   37230 _mesa_marshal_VertexAttribI2ivEXT(GLuint index, const GLint * v)
   37231 {
   37232    GET_CURRENT_CONTEXT(ctx);
   37233    _mesa_glthread_finish(ctx);
   37234    debug_print_sync("VertexAttribI2ivEXT");
   37235    CALL_VertexAttribI2ivEXT(ctx->CurrentServerDispatch, (index, v));
   37236 }
   37237 
   37238 
   37239 /* Map1d: marshalled synchronously */
   37240 static void GLAPIENTRY
   37241 _mesa_marshal_Map1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble * points)
   37242 {
   37243    GET_CURRENT_CONTEXT(ctx);
   37244    _mesa_glthread_finish(ctx);
   37245    debug_print_sync("Map1d");
   37246    CALL_Map1d(ctx->CurrentServerDispatch, (target, u1, u2, stride, order, points));
   37247 }
   37248 
   37249 
   37250 /* Map1f: marshalled synchronously */
   37251 static void GLAPIENTRY
   37252 _mesa_marshal_Map1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat * points)
   37253 {
   37254    GET_CURRENT_CONTEXT(ctx);
   37255    _mesa_glthread_finish(ctx);
   37256    debug_print_sync("Map1f");
   37257    CALL_Map1f(ctx->CurrentServerDispatch, (target, u1, u2, stride, order, points));
   37258 }
   37259 
   37260 
   37261 /* AreTexturesResident: marshalled synchronously */
   37262 static GLboolean GLAPIENTRY
   37263 _mesa_marshal_AreTexturesResident(GLsizei n, const GLuint * textures, GLboolean * residences)
   37264 {
   37265    GET_CURRENT_CONTEXT(ctx);
   37266    _mesa_glthread_finish(ctx);
   37267    debug_print_sync("AreTexturesResident");
   37268    return CALL_AreTexturesResident(ctx->CurrentServerDispatch, (n, textures, residences));
   37269 }
   37270 
   37271 
   37272 /* VertexArrayVertexBuffer: marshalled asynchronously */
   37273 struct marshal_cmd_VertexArrayVertexBuffer
   37274 {
   37275    struct marshal_cmd_base cmd_base;
   37276    GLuint vaobj;
   37277    GLuint bindingindex;
   37278    GLuint buffer;
   37279    GLintptr offset;
   37280    GLsizei stride;
   37281 };
   37282 static inline void
   37283 _mesa_unmarshal_VertexArrayVertexBuffer(struct gl_context *ctx, const struct marshal_cmd_VertexArrayVertexBuffer *cmd)
   37284 {
   37285    const GLuint vaobj = cmd->vaobj;
   37286    const GLuint bindingindex = cmd->bindingindex;
   37287    const GLuint buffer = cmd->buffer;
   37288    const GLintptr offset = cmd->offset;
   37289    const GLsizei stride = cmd->stride;
   37290    CALL_VertexArrayVertexBuffer(ctx->CurrentServerDispatch, (vaobj, bindingindex, buffer, offset, stride));
   37291 }
   37292 static void GLAPIENTRY
   37293 _mesa_marshal_VertexArrayVertexBuffer(GLuint vaobj, GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride)
   37294 {
   37295    GET_CURRENT_CONTEXT(ctx);
   37296    size_t cmd_size = sizeof(struct marshal_cmd_VertexArrayVertexBuffer);
   37297    struct marshal_cmd_VertexArrayVertexBuffer *cmd;
   37298    debug_print_marshal("VertexArrayVertexBuffer");
   37299    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37300       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayVertexBuffer, cmd_size);
   37301       cmd->vaobj = vaobj;
   37302       cmd->bindingindex = bindingindex;
   37303       cmd->buffer = buffer;
   37304       cmd->offset = offset;
   37305       cmd->stride = stride;
   37306       _mesa_post_marshal_hook(ctx);
   37307       return;
   37308    }
   37309 
   37310    _mesa_glthread_finish(ctx);
   37311    debug_print_sync_fallback("VertexArrayVertexBuffer");
   37312    CALL_VertexArrayVertexBuffer(ctx->CurrentServerDispatch, (vaobj, bindingindex, buffer, offset, stride));
   37313 }
   37314 
   37315 
   37316 /* PixelTransferf: marshalled asynchronously */
   37317 struct marshal_cmd_PixelTransferf
   37318 {
   37319    struct marshal_cmd_base cmd_base;
   37320    GLenum pname;
   37321    GLfloat param;
   37322 };
   37323 static inline void
   37324 _mesa_unmarshal_PixelTransferf(struct gl_context *ctx, const struct marshal_cmd_PixelTransferf *cmd)
   37325 {
   37326    const GLenum pname = cmd->pname;
   37327    const GLfloat param = cmd->param;
   37328    CALL_PixelTransferf(ctx->CurrentServerDispatch, (pname, param));
   37329 }
   37330 static void GLAPIENTRY
   37331 _mesa_marshal_PixelTransferf(GLenum pname, GLfloat param)
   37332 {
   37333    GET_CURRENT_CONTEXT(ctx);
   37334    size_t cmd_size = sizeof(struct marshal_cmd_PixelTransferf);
   37335    struct marshal_cmd_PixelTransferf *cmd;
   37336    debug_print_marshal("PixelTransferf");
   37337    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37338       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PixelTransferf, cmd_size);
   37339       cmd->pname = pname;
   37340       cmd->param = param;
   37341       _mesa_post_marshal_hook(ctx);
   37342       return;
   37343    }
   37344 
   37345    _mesa_glthread_finish(ctx);
   37346    debug_print_sync_fallback("PixelTransferf");
   37347    CALL_PixelTransferf(ctx->CurrentServerDispatch, (pname, param));
   37348 }
   37349 
   37350 
   37351 /* PixelTransferi: marshalled asynchronously */
   37352 struct marshal_cmd_PixelTransferi
   37353 {
   37354    struct marshal_cmd_base cmd_base;
   37355    GLenum pname;
   37356    GLint param;
   37357 };
   37358 static inline void
   37359 _mesa_unmarshal_PixelTransferi(struct gl_context *ctx, const struct marshal_cmd_PixelTransferi *cmd)
   37360 {
   37361    const GLenum pname = cmd->pname;
   37362    const GLint param = cmd->param;
   37363    CALL_PixelTransferi(ctx->CurrentServerDispatch, (pname, param));
   37364 }
   37365 static void GLAPIENTRY
   37366 _mesa_marshal_PixelTransferi(GLenum pname, GLint param)
   37367 {
   37368    GET_CURRENT_CONTEXT(ctx);
   37369    size_t cmd_size = sizeof(struct marshal_cmd_PixelTransferi);
   37370    struct marshal_cmd_PixelTransferi *cmd;
   37371    debug_print_marshal("PixelTransferi");
   37372    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37373       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PixelTransferi, cmd_size);
   37374       cmd->pname = pname;
   37375       cmd->param = param;
   37376       _mesa_post_marshal_hook(ctx);
   37377       return;
   37378    }
   37379 
   37380    _mesa_glthread_finish(ctx);
   37381    debug_print_sync_fallback("PixelTransferi");
   37382    CALL_PixelTransferi(ctx->CurrentServerDispatch, (pname, param));
   37383 }
   37384 
   37385 
   37386 /* GetProgramResourceiv: marshalled synchronously */
   37387 static void GLAPIENTRY
   37388 _mesa_marshal_GetProgramResourceiv(GLuint program, GLenum programInterface, GLuint index, GLsizei  propCount, const GLenum * props, GLsizei  bufSize, GLsizei * length, GLint * params)
   37389 {
   37390    GET_CURRENT_CONTEXT(ctx);
   37391    _mesa_glthread_finish(ctx);
   37392    debug_print_sync("GetProgramResourceiv");
   37393    CALL_GetProgramResourceiv(ctx->CurrentServerDispatch, (program, programInterface, index, propCount, props, bufSize, length, params));
   37394 }
   37395 
   37396 
   37397 /* VertexAttrib3fvNV: marshalled asynchronously */
   37398 struct marshal_cmd_VertexAttrib3fvNV
   37399 {
   37400    struct marshal_cmd_base cmd_base;
   37401    GLuint index;
   37402    GLfloat v[3];
   37403 };
   37404 static inline void
   37405 _mesa_unmarshal_VertexAttrib3fvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3fvNV *cmd)
   37406 {
   37407    const GLuint index = cmd->index;
   37408    const GLfloat * v = cmd->v;
   37409    CALL_VertexAttrib3fvNV(ctx->CurrentServerDispatch, (index, v));
   37410 }
   37411 static void GLAPIENTRY
   37412 _mesa_marshal_VertexAttrib3fvNV(GLuint index, const GLfloat * v)
   37413 {
   37414    GET_CURRENT_CONTEXT(ctx);
   37415    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib3fvNV);
   37416    struct marshal_cmd_VertexAttrib3fvNV *cmd;
   37417    debug_print_marshal("VertexAttrib3fvNV");
   37418    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37419       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3fvNV, cmd_size);
   37420       cmd->index = index;
   37421       memcpy(cmd->v, v, 12);
   37422       _mesa_post_marshal_hook(ctx);
   37423       return;
   37424    }
   37425 
   37426    _mesa_glthread_finish(ctx);
   37427    debug_print_sync_fallback("VertexAttrib3fvNV");
   37428    CALL_VertexAttrib3fvNV(ctx->CurrentServerDispatch, (index, v));
   37429 }
   37430 
   37431 
   37432 /* SecondaryColorP3ui: marshalled asynchronously */
   37433 struct marshal_cmd_SecondaryColorP3ui
   37434 {
   37435    struct marshal_cmd_base cmd_base;
   37436    GLenum type;
   37437    GLuint color;
   37438 };
   37439 static inline void
   37440 _mesa_unmarshal_SecondaryColorP3ui(struct gl_context *ctx, const struct marshal_cmd_SecondaryColorP3ui *cmd)
   37441 {
   37442    const GLenum type = cmd->type;
   37443    const GLuint color = cmd->color;
   37444    CALL_SecondaryColorP3ui(ctx->CurrentServerDispatch, (type, color));
   37445 }
   37446 static void GLAPIENTRY
   37447 _mesa_marshal_SecondaryColorP3ui(GLenum type, GLuint color)
   37448 {
   37449    GET_CURRENT_CONTEXT(ctx);
   37450    size_t cmd_size = sizeof(struct marshal_cmd_SecondaryColorP3ui);
   37451    struct marshal_cmd_SecondaryColorP3ui *cmd;
   37452    debug_print_marshal("SecondaryColorP3ui");
   37453    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37454       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColorP3ui, cmd_size);
   37455       cmd->type = type;
   37456       cmd->color = color;
   37457       _mesa_post_marshal_hook(ctx);
   37458       return;
   37459    }
   37460 
   37461    _mesa_glthread_finish(ctx);
   37462    debug_print_sync_fallback("SecondaryColorP3ui");
   37463    CALL_SecondaryColorP3ui(ctx->CurrentServerDispatch, (type, color));
   37464 }
   37465 
   37466 
   37467 /* BindTextures: marshalled synchronously */
   37468 static void GLAPIENTRY
   37469 _mesa_marshal_BindTextures(GLuint first, GLsizei count, const GLuint * textures)
   37470 {
   37471    GET_CURRENT_CONTEXT(ctx);
   37472    _mesa_glthread_finish(ctx);
   37473    debug_print_sync("BindTextures");
   37474    CALL_BindTextures(ctx->CurrentServerDispatch, (first, count, textures));
   37475 }
   37476 
   37477 
   37478 /* VertexAttrib4fvNV: marshalled asynchronously */
   37479 struct marshal_cmd_VertexAttrib4fvNV
   37480 {
   37481    struct marshal_cmd_base cmd_base;
   37482    GLuint index;
   37483    GLfloat v[4];
   37484 };
   37485 static inline void
   37486 _mesa_unmarshal_VertexAttrib4fvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4fvNV *cmd)
   37487 {
   37488    const GLuint index = cmd->index;
   37489    const GLfloat * v = cmd->v;
   37490    CALL_VertexAttrib4fvNV(ctx->CurrentServerDispatch, (index, v));
   37491 }
   37492 static void GLAPIENTRY
   37493 _mesa_marshal_VertexAttrib4fvNV(GLuint index, const GLfloat * v)
   37494 {
   37495    GET_CURRENT_CONTEXT(ctx);
   37496    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib4fvNV);
   37497    struct marshal_cmd_VertexAttrib4fvNV *cmd;
   37498    debug_print_marshal("VertexAttrib4fvNV");
   37499    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37500       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4fvNV, cmd_size);
   37501       cmd->index = index;
   37502       memcpy(cmd->v, v, 16);
   37503       _mesa_post_marshal_hook(ctx);
   37504       return;
   37505    }
   37506 
   37507    _mesa_glthread_finish(ctx);
   37508    debug_print_sync_fallback("VertexAttrib4fvNV");
   37509    CALL_VertexAttrib4fvNV(ctx->CurrentServerDispatch, (index, v));
   37510 }
   37511 
   37512 
   37513 /* Rectiv: marshalled asynchronously */
   37514 struct marshal_cmd_Rectiv
   37515 {
   37516    struct marshal_cmd_base cmd_base;
   37517    GLint v1[2];
   37518    GLint v2[2];
   37519 };
   37520 static inline void
   37521 _mesa_unmarshal_Rectiv(struct gl_context *ctx, const struct marshal_cmd_Rectiv *cmd)
   37522 {
   37523    const GLint * v1 = cmd->v1;
   37524    const GLint * v2 = cmd->v2;
   37525    CALL_Rectiv(ctx->CurrentServerDispatch, (v1, v2));
   37526 }
   37527 static void GLAPIENTRY
   37528 _mesa_marshal_Rectiv(const GLint * v1, const GLint * v2)
   37529 {
   37530    GET_CURRENT_CONTEXT(ctx);
   37531    size_t cmd_size = sizeof(struct marshal_cmd_Rectiv);
   37532    struct marshal_cmd_Rectiv *cmd;
   37533    debug_print_marshal("Rectiv");
   37534    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37535       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Rectiv, cmd_size);
   37536       memcpy(cmd->v1, v1, 8);
   37537       memcpy(cmd->v2, v2, 8);
   37538       _mesa_post_marshal_hook(ctx);
   37539       return;
   37540    }
   37541 
   37542    _mesa_glthread_finish(ctx);
   37543    debug_print_sync_fallback("Rectiv");
   37544    CALL_Rectiv(ctx->CurrentServerDispatch, (v1, v2));
   37545 }
   37546 
   37547 
   37548 /* MultiTexCoord1iv: marshalled asynchronously */
   37549 struct marshal_cmd_MultiTexCoord1iv
   37550 {
   37551    struct marshal_cmd_base cmd_base;
   37552    GLenum target;
   37553    GLint v[1];
   37554 };
   37555 static inline void
   37556 _mesa_unmarshal_MultiTexCoord1iv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1iv *cmd)
   37557 {
   37558    const GLenum target = cmd->target;
   37559    const GLint * v = cmd->v;
   37560    CALL_MultiTexCoord1iv(ctx->CurrentServerDispatch, (target, v));
   37561 }
   37562 static void GLAPIENTRY
   37563 _mesa_marshal_MultiTexCoord1iv(GLenum target, const GLint * v)
   37564 {
   37565    GET_CURRENT_CONTEXT(ctx);
   37566    size_t cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1iv);
   37567    struct marshal_cmd_MultiTexCoord1iv *cmd;
   37568    debug_print_marshal("MultiTexCoord1iv");
   37569    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37570       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1iv, cmd_size);
   37571       cmd->target = target;
   37572       memcpy(cmd->v, v, 4);
   37573       _mesa_post_marshal_hook(ctx);
   37574       return;
   37575    }
   37576 
   37577    _mesa_glthread_finish(ctx);
   37578    debug_print_sync_fallback("MultiTexCoord1iv");
   37579    CALL_MultiTexCoord1iv(ctx->CurrentServerDispatch, (target, v));
   37580 }
   37581 
   37582 
   37583 /* PassTexCoordATI: marshalled asynchronously */
   37584 struct marshal_cmd_PassTexCoordATI
   37585 {
   37586    struct marshal_cmd_base cmd_base;
   37587    GLuint dst;
   37588    GLuint coord;
   37589    GLenum swizzle;
   37590 };
   37591 static inline void
   37592 _mesa_unmarshal_PassTexCoordATI(struct gl_context *ctx, const struct marshal_cmd_PassTexCoordATI *cmd)
   37593 {
   37594    const GLuint dst = cmd->dst;
   37595    const GLuint coord = cmd->coord;
   37596    const GLenum swizzle = cmd->swizzle;
   37597    CALL_PassTexCoordATI(ctx->CurrentServerDispatch, (dst, coord, swizzle));
   37598 }
   37599 static void GLAPIENTRY
   37600 _mesa_marshal_PassTexCoordATI(GLuint dst, GLuint coord, GLenum swizzle)
   37601 {
   37602    GET_CURRENT_CONTEXT(ctx);
   37603    size_t cmd_size = sizeof(struct marshal_cmd_PassTexCoordATI);
   37604    struct marshal_cmd_PassTexCoordATI *cmd;
   37605    debug_print_marshal("PassTexCoordATI");
   37606    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37607       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PassTexCoordATI, cmd_size);
   37608       cmd->dst = dst;
   37609       cmd->coord = coord;
   37610       cmd->swizzle = swizzle;
   37611       _mesa_post_marshal_hook(ctx);
   37612       return;
   37613    }
   37614 
   37615    _mesa_glthread_finish(ctx);
   37616    debug_print_sync_fallback("PassTexCoordATI");
   37617    CALL_PassTexCoordATI(ctx->CurrentServerDispatch, (dst, coord, swizzle));
   37618 }
   37619 
   37620 
   37621 /* Vertex2fv: marshalled asynchronously */
   37622 struct marshal_cmd_Vertex2fv
   37623 {
   37624    struct marshal_cmd_base cmd_base;
   37625    GLfloat v[2];
   37626 };
   37627 static inline void
   37628 _mesa_unmarshal_Vertex2fv(struct gl_context *ctx, const struct marshal_cmd_Vertex2fv *cmd)
   37629 {
   37630    const GLfloat * v = cmd->v;
   37631    CALL_Vertex2fv(ctx->CurrentServerDispatch, (v));
   37632 }
   37633 static void GLAPIENTRY
   37634 _mesa_marshal_Vertex2fv(const GLfloat * v)
   37635 {
   37636    GET_CURRENT_CONTEXT(ctx);
   37637    size_t cmd_size = sizeof(struct marshal_cmd_Vertex2fv);
   37638    struct marshal_cmd_Vertex2fv *cmd;
   37639    debug_print_marshal("Vertex2fv");
   37640    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37641       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex2fv, cmd_size);
   37642       memcpy(cmd->v, v, 8);
   37643       _mesa_post_marshal_hook(ctx);
   37644       return;
   37645    }
   37646 
   37647    _mesa_glthread_finish(ctx);
   37648    debug_print_sync_fallback("Vertex2fv");
   37649    CALL_Vertex2fv(ctx->CurrentServerDispatch, (v));
   37650 }
   37651 
   37652 
   37653 /* BindRenderbufferEXT: marshalled asynchronously */
   37654 struct marshal_cmd_BindRenderbufferEXT
   37655 {
   37656    struct marshal_cmd_base cmd_base;
   37657    GLenum target;
   37658    GLuint renderbuffer;
   37659 };
   37660 static inline void
   37661 _mesa_unmarshal_BindRenderbufferEXT(struct gl_context *ctx, const struct marshal_cmd_BindRenderbufferEXT *cmd)
   37662 {
   37663    const GLenum target = cmd->target;
   37664    const GLuint renderbuffer = cmd->renderbuffer;
   37665    CALL_BindRenderbufferEXT(ctx->CurrentServerDispatch, (target, renderbuffer));
   37666 }
   37667 static void GLAPIENTRY
   37668 _mesa_marshal_BindRenderbufferEXT(GLenum target, GLuint renderbuffer)
   37669 {
   37670    GET_CURRENT_CONTEXT(ctx);
   37671    size_t cmd_size = sizeof(struct marshal_cmd_BindRenderbufferEXT);
   37672    struct marshal_cmd_BindRenderbufferEXT *cmd;
   37673    debug_print_marshal("BindRenderbufferEXT");
   37674    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37675       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindRenderbufferEXT, cmd_size);
   37676       cmd->target = target;
   37677       cmd->renderbuffer = renderbuffer;
   37678       _mesa_post_marshal_hook(ctx);
   37679       return;
   37680    }
   37681 
   37682    _mesa_glthread_finish(ctx);
   37683    debug_print_sync_fallback("BindRenderbufferEXT");
   37684    CALL_BindRenderbufferEXT(ctx->CurrentServerDispatch, (target, renderbuffer));
   37685 }
   37686 
   37687 
   37688 /* Vertex3sv: marshalled asynchronously */
   37689 struct marshal_cmd_Vertex3sv
   37690 {
   37691    struct marshal_cmd_base cmd_base;
   37692    GLshort v[3];
   37693 };
   37694 static inline void
   37695 _mesa_unmarshal_Vertex3sv(struct gl_context *ctx, const struct marshal_cmd_Vertex3sv *cmd)
   37696 {
   37697    const GLshort * v = cmd->v;
   37698    CALL_Vertex3sv(ctx->CurrentServerDispatch, (v));
   37699 }
   37700 static void GLAPIENTRY
   37701 _mesa_marshal_Vertex3sv(const GLshort * v)
   37702 {
   37703    GET_CURRENT_CONTEXT(ctx);
   37704    size_t cmd_size = sizeof(struct marshal_cmd_Vertex3sv);
   37705    struct marshal_cmd_Vertex3sv *cmd;
   37706    debug_print_marshal("Vertex3sv");
   37707    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37708       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex3sv, cmd_size);
   37709       memcpy(cmd->v, v, 6);
   37710       _mesa_post_marshal_hook(ctx);
   37711       return;
   37712    }
   37713 
   37714    _mesa_glthread_finish(ctx);
   37715    debug_print_sync_fallback("Vertex3sv");
   37716    CALL_Vertex3sv(ctx->CurrentServerDispatch, (v));
   37717 }
   37718 
   37719 
   37720 /* EvalMesh1: marshalled asynchronously */
   37721 struct marshal_cmd_EvalMesh1
   37722 {
   37723    struct marshal_cmd_base cmd_base;
   37724    GLenum mode;
   37725    GLint i1;
   37726    GLint i2;
   37727 };
   37728 static inline void
   37729 _mesa_unmarshal_EvalMesh1(struct gl_context *ctx, const struct marshal_cmd_EvalMesh1 *cmd)
   37730 {
   37731    const GLenum mode = cmd->mode;
   37732    const GLint i1 = cmd->i1;
   37733    const GLint i2 = cmd->i2;
   37734    CALL_EvalMesh1(ctx->CurrentServerDispatch, (mode, i1, i2));
   37735 }
   37736 static void GLAPIENTRY
   37737 _mesa_marshal_EvalMesh1(GLenum mode, GLint i1, GLint i2)
   37738 {
   37739    GET_CURRENT_CONTEXT(ctx);
   37740    size_t cmd_size = sizeof(struct marshal_cmd_EvalMesh1);
   37741    struct marshal_cmd_EvalMesh1 *cmd;
   37742    debug_print_marshal("EvalMesh1");
   37743    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37744       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EvalMesh1, cmd_size);
   37745       cmd->mode = mode;
   37746       cmd->i1 = i1;
   37747       cmd->i2 = i2;
   37748       _mesa_post_marshal_hook(ctx);
   37749       return;
   37750    }
   37751 
   37752    _mesa_glthread_finish(ctx);
   37753    debug_print_sync_fallback("EvalMesh1");
   37754    CALL_EvalMesh1(ctx->CurrentServerDispatch, (mode, i1, i2));
   37755 }
   37756 
   37757 
   37758 /* DiscardFramebufferEXT: marshalled asynchronously */
   37759 struct marshal_cmd_DiscardFramebufferEXT
   37760 {
   37761    struct marshal_cmd_base cmd_base;
   37762    GLenum target;
   37763    GLsizei numAttachments;
   37764    /* Next safe_mul(numAttachments, 4) bytes are GLenum attachments[numAttachments] */
   37765 };
   37766 static inline void
   37767 _mesa_unmarshal_DiscardFramebufferEXT(struct gl_context *ctx, const struct marshal_cmd_DiscardFramebufferEXT *cmd)
   37768 {
   37769    const GLenum target = cmd->target;
   37770    const GLsizei numAttachments = cmd->numAttachments;
   37771    const GLenum * attachments;
   37772    const char *variable_data = (const char *) (cmd + 1);
   37773    attachments = (const GLenum *) variable_data;
   37774    variable_data += numAttachments * 4;
   37775    CALL_DiscardFramebufferEXT(ctx->CurrentServerDispatch, (target, numAttachments, attachments));
   37776 }
   37777 static void GLAPIENTRY
   37778 _mesa_marshal_DiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum * attachments)
   37779 {
   37780    GET_CURRENT_CONTEXT(ctx);
   37781    size_t cmd_size = sizeof(struct marshal_cmd_DiscardFramebufferEXT) + safe_mul(numAttachments, 4);
   37782    struct marshal_cmd_DiscardFramebufferEXT *cmd;
   37783    debug_print_marshal("DiscardFramebufferEXT");
   37784    if (unlikely(safe_mul(numAttachments, 4) < 0)) {
   37785       goto fallback_to_sync;
   37786    }
   37787    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37788       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DiscardFramebufferEXT, cmd_size);
   37789       cmd->target = target;
   37790       cmd->numAttachments = numAttachments;
   37791       char *variable_data = (char *) (cmd + 1);
   37792       memcpy(variable_data, attachments, numAttachments * 4);
   37793       variable_data += numAttachments * 4;
   37794       _mesa_post_marshal_hook(ctx);
   37795       return;
   37796    }
   37797 
   37798 fallback_to_sync:
   37799    _mesa_glthread_finish(ctx);
   37800    debug_print_sync_fallback("DiscardFramebufferEXT");
   37801    CALL_DiscardFramebufferEXT(ctx->CurrentServerDispatch, (target, numAttachments, attachments));
   37802 }
   37803 
   37804 
   37805 /* Uniform2f: marshalled asynchronously */
   37806 struct marshal_cmd_Uniform2f
   37807 {
   37808    struct marshal_cmd_base cmd_base;
   37809    GLint location;
   37810    GLfloat v0;
   37811    GLfloat v1;
   37812 };
   37813 static inline void
   37814 _mesa_unmarshal_Uniform2f(struct gl_context *ctx, const struct marshal_cmd_Uniform2f *cmd)
   37815 {
   37816    const GLint location = cmd->location;
   37817    const GLfloat v0 = cmd->v0;
   37818    const GLfloat v1 = cmd->v1;
   37819    CALL_Uniform2f(ctx->CurrentServerDispatch, (location, v0, v1));
   37820 }
   37821 static void GLAPIENTRY
   37822 _mesa_marshal_Uniform2f(GLint location, GLfloat v0, GLfloat v1)
   37823 {
   37824    GET_CURRENT_CONTEXT(ctx);
   37825    size_t cmd_size = sizeof(struct marshal_cmd_Uniform2f);
   37826    struct marshal_cmd_Uniform2f *cmd;
   37827    debug_print_marshal("Uniform2f");
   37828    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37829       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2f, cmd_size);
   37830       cmd->location = location;
   37831       cmd->v0 = v0;
   37832       cmd->v1 = v1;
   37833       _mesa_post_marshal_hook(ctx);
   37834       return;
   37835    }
   37836 
   37837    _mesa_glthread_finish(ctx);
   37838    debug_print_sync_fallback("Uniform2f");
   37839    CALL_Uniform2f(ctx->CurrentServerDispatch, (location, v0, v1));
   37840 }
   37841 
   37842 
   37843 /* Uniform2d: marshalled asynchronously */
   37844 struct marshal_cmd_Uniform2d
   37845 {
   37846    struct marshal_cmd_base cmd_base;
   37847    GLint location;
   37848    GLdouble x;
   37849    GLdouble y;
   37850 };
   37851 static inline void
   37852 _mesa_unmarshal_Uniform2d(struct gl_context *ctx, const struct marshal_cmd_Uniform2d *cmd)
   37853 {
   37854    const GLint location = cmd->location;
   37855    const GLdouble x = cmd->x;
   37856    const GLdouble y = cmd->y;
   37857    CALL_Uniform2d(ctx->CurrentServerDispatch, (location, x, y));
   37858 }
   37859 static void GLAPIENTRY
   37860 _mesa_marshal_Uniform2d(GLint location, GLdouble x, GLdouble y)
   37861 {
   37862    GET_CURRENT_CONTEXT(ctx);
   37863    size_t cmd_size = sizeof(struct marshal_cmd_Uniform2d);
   37864    struct marshal_cmd_Uniform2d *cmd;
   37865    debug_print_marshal("Uniform2d");
   37866    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37867       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2d, cmd_size);
   37868       cmd->location = location;
   37869       cmd->x = x;
   37870       cmd->y = y;
   37871       _mesa_post_marshal_hook(ctx);
   37872       return;
   37873    }
   37874 
   37875    _mesa_glthread_finish(ctx);
   37876    debug_print_sync_fallback("Uniform2d");
   37877    CALL_Uniform2d(ctx->CurrentServerDispatch, (location, x, y));
   37878 }
   37879 
   37880 
   37881 /* ColorPointerEXT: marshalled asynchronously */
   37882 struct marshal_cmd_ColorPointerEXT
   37883 {
   37884    struct marshal_cmd_base cmd_base;
   37885    GLint size;
   37886    GLenum type;
   37887    GLsizei stride;
   37888    GLsizei count;
   37889    const GLvoid * pointer;
   37890 };
   37891 static inline void
   37892 _mesa_unmarshal_ColorPointerEXT(struct gl_context *ctx, const struct marshal_cmd_ColorPointerEXT *cmd)
   37893 {
   37894    const GLint size = cmd->size;
   37895    const GLenum type = cmd->type;
   37896    const GLsizei stride = cmd->stride;
   37897    const GLsizei count = cmd->count;
   37898    const GLvoid * pointer = cmd->pointer;
   37899    CALL_ColorPointerEXT(ctx->CurrentServerDispatch, (size, type, stride, count, pointer));
   37900 }
   37901 static void GLAPIENTRY
   37902 _mesa_marshal_ColorPointerEXT(GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid * pointer)
   37903 {
   37904    GET_CURRENT_CONTEXT(ctx);
   37905    size_t cmd_size = sizeof(struct marshal_cmd_ColorPointerEXT);
   37906    struct marshal_cmd_ColorPointerEXT *cmd;
   37907    debug_print_marshal("ColorPointerEXT");
   37908    if (_mesa_glthread_is_non_vbo_vertex_attrib_pointer(ctx)) {
   37909       _mesa_glthread_finish(ctx);
   37910       _mesa_glthread_restore_dispatch(ctx);
   37911       debug_print_sync_fallback("ColorPointerEXT");
   37912       CALL_ColorPointerEXT(ctx->CurrentServerDispatch, (size, type, stride, count, pointer));
   37913       return;
   37914    }
   37915    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37916       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorPointerEXT, cmd_size);
   37917       cmd->size = size;
   37918       cmd->type = type;
   37919       cmd->stride = stride;
   37920       cmd->count = count;
   37921       cmd->pointer = pointer;
   37922       _mesa_post_marshal_hook(ctx);
   37923       return;
   37924    }
   37925 
   37926    _mesa_glthread_finish(ctx);
   37927    debug_print_sync_fallback("ColorPointerEXT");
   37928    CALL_ColorPointerEXT(ctx->CurrentServerDispatch, (size, type, stride, count, pointer));
   37929 }
   37930 
   37931 
   37932 /* LineWidth: marshalled asynchronously */
   37933 struct marshal_cmd_LineWidth
   37934 {
   37935    struct marshal_cmd_base cmd_base;
   37936    GLfloat width;
   37937 };
   37938 static inline void
   37939 _mesa_unmarshal_LineWidth(struct gl_context *ctx, const struct marshal_cmd_LineWidth *cmd)
   37940 {
   37941    const GLfloat width = cmd->width;
   37942    CALL_LineWidth(ctx->CurrentServerDispatch, (width));
   37943 }
   37944 static void GLAPIENTRY
   37945 _mesa_marshal_LineWidth(GLfloat width)
   37946 {
   37947    GET_CURRENT_CONTEXT(ctx);
   37948    size_t cmd_size = sizeof(struct marshal_cmd_LineWidth);
   37949    struct marshal_cmd_LineWidth *cmd;
   37950    debug_print_marshal("LineWidth");
   37951    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37952       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LineWidth, cmd_size);
   37953       cmd->width = width;
   37954       _mesa_post_marshal_hook(ctx);
   37955       return;
   37956    }
   37957 
   37958    _mesa_glthread_finish(ctx);
   37959    debug_print_sync_fallback("LineWidth");
   37960    CALL_LineWidth(ctx->CurrentServerDispatch, (width));
   37961 }
   37962 
   37963 
   37964 /* Uniform2i: marshalled asynchronously */
   37965 struct marshal_cmd_Uniform2i
   37966 {
   37967    struct marshal_cmd_base cmd_base;
   37968    GLint location;
   37969    GLint v0;
   37970    GLint v1;
   37971 };
   37972 static inline void
   37973 _mesa_unmarshal_Uniform2i(struct gl_context *ctx, const struct marshal_cmd_Uniform2i *cmd)
   37974 {
   37975    const GLint location = cmd->location;
   37976    const GLint v0 = cmd->v0;
   37977    const GLint v1 = cmd->v1;
   37978    CALL_Uniform2i(ctx->CurrentServerDispatch, (location, v0, v1));
   37979 }
   37980 static void GLAPIENTRY
   37981 _mesa_marshal_Uniform2i(GLint location, GLint v0, GLint v1)
   37982 {
   37983    GET_CURRENT_CONTEXT(ctx);
   37984    size_t cmd_size = sizeof(struct marshal_cmd_Uniform2i);
   37985    struct marshal_cmd_Uniform2i *cmd;
   37986    debug_print_marshal("Uniform2i");
   37987    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   37988       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2i, cmd_size);
   37989       cmd->location = location;
   37990       cmd->v0 = v0;
   37991       cmd->v1 = v1;
   37992       _mesa_post_marshal_hook(ctx);
   37993       return;
   37994    }
   37995 
   37996    _mesa_glthread_finish(ctx);
   37997    debug_print_sync_fallback("Uniform2i");
   37998    CALL_Uniform2i(ctx->CurrentServerDispatch, (location, v0, v1));
   37999 }
   38000 
   38001 
   38002 /* MultiDrawElementsBaseVertex: marshalled synchronously */
   38003 static void GLAPIENTRY
   38004 _mesa_marshal_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei * count, GLenum type, const GLvoid * const * indices, GLsizei primcount, const GLint * basevertex)
   38005 {
   38006    GET_CURRENT_CONTEXT(ctx);
   38007    _mesa_glthread_finish(ctx);
   38008    debug_print_sync("MultiDrawElementsBaseVertex");
   38009    CALL_MultiDrawElementsBaseVertex(ctx->CurrentServerDispatch, (mode, count, type, indices, primcount, basevertex));
   38010 }
   38011 
   38012 
   38013 /* Lightxv: marshalled synchronously */
   38014 static void GLAPIENTRY
   38015 _mesa_marshal_Lightxv(GLenum light, GLenum pname, const GLfixed * params)
   38016 {
   38017    GET_CURRENT_CONTEXT(ctx);
   38018    _mesa_glthread_finish(ctx);
   38019    debug_print_sync("Lightxv");
   38020    CALL_Lightxv(ctx->CurrentServerDispatch, (light, pname, params));
   38021 }
   38022 
   38023 
   38024 /* DepthRangeIndexed: marshalled asynchronously */
   38025 struct marshal_cmd_DepthRangeIndexed
   38026 {
   38027    struct marshal_cmd_base cmd_base;
   38028    GLuint index;
   38029    GLclampd n;
   38030    GLclampd f;
   38031 };
   38032 static inline void
   38033 _mesa_unmarshal_DepthRangeIndexed(struct gl_context *ctx, const struct marshal_cmd_DepthRangeIndexed *cmd)
   38034 {
   38035    const GLuint index = cmd->index;
   38036    const GLclampd n = cmd->n;
   38037    const GLclampd f = cmd->f;
   38038    CALL_DepthRangeIndexed(ctx->CurrentServerDispatch, (index, n, f));
   38039 }
   38040 static void GLAPIENTRY
   38041 _mesa_marshal_DepthRangeIndexed(GLuint index, GLclampd n, GLclampd f)
   38042 {
   38043    GET_CURRENT_CONTEXT(ctx);
   38044    size_t cmd_size = sizeof(struct marshal_cmd_DepthRangeIndexed);
   38045    struct marshal_cmd_DepthRangeIndexed *cmd;
   38046    debug_print_marshal("DepthRangeIndexed");
   38047    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38048       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DepthRangeIndexed, cmd_size);
   38049       cmd->index = index;
   38050       cmd->n = n;
   38051       cmd->f = f;
   38052       _mesa_post_marshal_hook(ctx);
   38053       return;
   38054    }
   38055 
   38056    _mesa_glthread_finish(ctx);
   38057    debug_print_sync_fallback("DepthRangeIndexed");
   38058    CALL_DepthRangeIndexed(ctx->CurrentServerDispatch, (index, n, f));
   38059 }
   38060 
   38061 
   38062 /* GetConvolutionParameterfv: marshalled synchronously */
   38063 static void GLAPIENTRY
   38064 _mesa_marshal_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat * params)
   38065 {
   38066    GET_CURRENT_CONTEXT(ctx);
   38067    _mesa_glthread_finish(ctx);
   38068    debug_print_sync("GetConvolutionParameterfv");
   38069    CALL_GetConvolutionParameterfv(ctx->CurrentServerDispatch, (target, pname, params));
   38070 }
   38071 
   38072 
   38073 /* GetMaterialfv: marshalled synchronously */
   38074 static void GLAPIENTRY
   38075 _mesa_marshal_GetMaterialfv(GLenum face, GLenum pname, GLfloat * params)
   38076 {
   38077    GET_CURRENT_CONTEXT(ctx);
   38078    _mesa_glthread_finish(ctx);
   38079    debug_print_sync("GetMaterialfv");
   38080    CALL_GetMaterialfv(ctx->CurrentServerDispatch, (face, pname, params));
   38081 }
   38082 
   38083 
   38084 /* TexImage3DMultisample: marshalled asynchronously */
   38085 struct marshal_cmd_TexImage3DMultisample
   38086 {
   38087    struct marshal_cmd_base cmd_base;
   38088    GLenum target;
   38089    GLsizei samples;
   38090    GLenum internalformat;
   38091    GLsizei width;
   38092    GLsizei height;
   38093    GLsizei depth;
   38094    GLboolean fixedsamplelocations;
   38095 };
   38096 static inline void
   38097 _mesa_unmarshal_TexImage3DMultisample(struct gl_context *ctx, const struct marshal_cmd_TexImage3DMultisample *cmd)
   38098 {
   38099    const GLenum target = cmd->target;
   38100    const GLsizei samples = cmd->samples;
   38101    const GLenum internalformat = cmd->internalformat;
   38102    const GLsizei width = cmd->width;
   38103    const GLsizei height = cmd->height;
   38104    const GLsizei depth = cmd->depth;
   38105    const GLboolean fixedsamplelocations = cmd->fixedsamplelocations;
   38106    CALL_TexImage3DMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height, depth, fixedsamplelocations));
   38107 }
   38108 static void GLAPIENTRY
   38109 _mesa_marshal_TexImage3DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)
   38110 {
   38111    GET_CURRENT_CONTEXT(ctx);
   38112    size_t cmd_size = sizeof(struct marshal_cmd_TexImage3DMultisample);
   38113    struct marshal_cmd_TexImage3DMultisample *cmd;
   38114    debug_print_marshal("TexImage3DMultisample");
   38115    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38116       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexImage3DMultisample, cmd_size);
   38117       cmd->target = target;
   38118       cmd->samples = samples;
   38119       cmd->internalformat = internalformat;
   38120       cmd->width = width;
   38121       cmd->height = height;
   38122       cmd->depth = depth;
   38123       cmd->fixedsamplelocations = fixedsamplelocations;
   38124       _mesa_post_marshal_hook(ctx);
   38125       return;
   38126    }
   38127 
   38128    _mesa_glthread_finish(ctx);
   38129    debug_print_sync_fallback("TexImage3DMultisample");
   38130    CALL_TexImage3DMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height, depth, fixedsamplelocations));
   38131 }
   38132 
   38133 
   38134 /* VertexAttrib1fvNV: marshalled asynchronously */
   38135 struct marshal_cmd_VertexAttrib1fvNV
   38136 {
   38137    struct marshal_cmd_base cmd_base;
   38138    GLuint index;
   38139    GLfloat v[1];
   38140 };
   38141 static inline void
   38142 _mesa_unmarshal_VertexAttrib1fvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1fvNV *cmd)
   38143 {
   38144    const GLuint index = cmd->index;
   38145    const GLfloat * v = cmd->v;
   38146    CALL_VertexAttrib1fvNV(ctx->CurrentServerDispatch, (index, v));
   38147 }
   38148 static void GLAPIENTRY
   38149 _mesa_marshal_VertexAttrib1fvNV(GLuint index, const GLfloat * v)
   38150 {
   38151    GET_CURRENT_CONTEXT(ctx);
   38152    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib1fvNV);
   38153    struct marshal_cmd_VertexAttrib1fvNV *cmd;
   38154    debug_print_marshal("VertexAttrib1fvNV");
   38155    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38156       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1fvNV, cmd_size);
   38157       cmd->index = index;
   38158       memcpy(cmd->v, v, 4);
   38159       _mesa_post_marshal_hook(ctx);
   38160       return;
   38161    }
   38162 
   38163    _mesa_glthread_finish(ctx);
   38164    debug_print_sync_fallback("VertexAttrib1fvNV");
   38165    CALL_VertexAttrib1fvNV(ctx->CurrentServerDispatch, (index, v));
   38166 }
   38167 
   38168 
   38169 /* GetUniformBlockIndex: marshalled synchronously */
   38170 static GLuint GLAPIENTRY
   38171 _mesa_marshal_GetUniformBlockIndex(GLuint program, const GLchar * uniformBlockName)
   38172 {
   38173    GET_CURRENT_CONTEXT(ctx);
   38174    _mesa_glthread_finish(ctx);
   38175    debug_print_sync("GetUniformBlockIndex");
   38176    return CALL_GetUniformBlockIndex(ctx->CurrentServerDispatch, (program, uniformBlockName));
   38177 }
   38178 
   38179 
   38180 /* DetachShader: marshalled asynchronously */
   38181 struct marshal_cmd_DetachShader
   38182 {
   38183    struct marshal_cmd_base cmd_base;
   38184    GLuint program;
   38185    GLuint shader;
   38186 };
   38187 static inline void
   38188 _mesa_unmarshal_DetachShader(struct gl_context *ctx, const struct marshal_cmd_DetachShader *cmd)
   38189 {
   38190    const GLuint program = cmd->program;
   38191    const GLuint shader = cmd->shader;
   38192    CALL_DetachShader(ctx->CurrentServerDispatch, (program, shader));
   38193 }
   38194 static void GLAPIENTRY
   38195 _mesa_marshal_DetachShader(GLuint program, GLuint shader)
   38196 {
   38197    GET_CURRENT_CONTEXT(ctx);
   38198    size_t cmd_size = sizeof(struct marshal_cmd_DetachShader);
   38199    struct marshal_cmd_DetachShader *cmd;
   38200    debug_print_marshal("DetachShader");
   38201    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38202       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DetachShader, cmd_size);
   38203       cmd->program = program;
   38204       cmd->shader = shader;
   38205       _mesa_post_marshal_hook(ctx);
   38206       return;
   38207    }
   38208 
   38209    _mesa_glthread_finish(ctx);
   38210    debug_print_sync_fallback("DetachShader");
   38211    CALL_DetachShader(ctx->CurrentServerDispatch, (program, shader));
   38212 }
   38213 
   38214 
   38215 /* CopyTexSubImage2D: marshalled asynchronously */
   38216 struct marshal_cmd_CopyTexSubImage2D
   38217 {
   38218    struct marshal_cmd_base cmd_base;
   38219    GLenum target;
   38220    GLint level;
   38221    GLint xoffset;
   38222    GLint yoffset;
   38223    GLint x;
   38224    GLint y;
   38225    GLsizei width;
   38226    GLsizei height;
   38227 };
   38228 static inline void
   38229 _mesa_unmarshal_CopyTexSubImage2D(struct gl_context *ctx, const struct marshal_cmd_CopyTexSubImage2D *cmd)
   38230 {
   38231    const GLenum target = cmd->target;
   38232    const GLint level = cmd->level;
   38233    const GLint xoffset = cmd->xoffset;
   38234    const GLint yoffset = cmd->yoffset;
   38235    const GLint x = cmd->x;
   38236    const GLint y = cmd->y;
   38237    const GLsizei width = cmd->width;
   38238    const GLsizei height = cmd->height;
   38239    CALL_CopyTexSubImage2D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, x, y, width, height));
   38240 }
   38241 static void GLAPIENTRY
   38242 _mesa_marshal_CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
   38243 {
   38244    GET_CURRENT_CONTEXT(ctx);
   38245    size_t cmd_size = sizeof(struct marshal_cmd_CopyTexSubImage2D);
   38246    struct marshal_cmd_CopyTexSubImage2D *cmd;
   38247    debug_print_marshal("CopyTexSubImage2D");
   38248    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38249       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyTexSubImage2D, cmd_size);
   38250       cmd->target = target;
   38251       cmd->level = level;
   38252       cmd->xoffset = xoffset;
   38253       cmd->yoffset = yoffset;
   38254       cmd->x = x;
   38255       cmd->y = y;
   38256       cmd->width = width;
   38257       cmd->height = height;
   38258       _mesa_post_marshal_hook(ctx);
   38259       return;
   38260    }
   38261 
   38262    _mesa_glthread_finish(ctx);
   38263    debug_print_sync_fallback("CopyTexSubImage2D");
   38264    CALL_CopyTexSubImage2D(ctx->CurrentServerDispatch, (target, level, xoffset, yoffset, x, y, width, height));
   38265 }
   38266 
   38267 
   38268 /* GetNamedFramebufferParameteriv: marshalled synchronously */
   38269 static void GLAPIENTRY
   38270 _mesa_marshal_GetNamedFramebufferParameteriv(GLuint framebuffer, GLenum pname, GLint * param)
   38271 {
   38272    GET_CURRENT_CONTEXT(ctx);
   38273    _mesa_glthread_finish(ctx);
   38274    debug_print_sync("GetNamedFramebufferParameteriv");
   38275    CALL_GetNamedFramebufferParameteriv(ctx->CurrentServerDispatch, (framebuffer, pname, param));
   38276 }
   38277 
   38278 
   38279 /* GetObjectParameterivARB: marshalled synchronously */
   38280 static void GLAPIENTRY
   38281 _mesa_marshal_GetObjectParameterivARB(GLhandleARB obj, GLenum pname, GLint * params)
   38282 {
   38283    GET_CURRENT_CONTEXT(ctx);
   38284    _mesa_glthread_finish(ctx);
   38285    debug_print_sync("GetObjectParameterivARB");
   38286    CALL_GetObjectParameterivARB(ctx->CurrentServerDispatch, (obj, pname, params));
   38287 }
   38288 
   38289 
   38290 /* Color3iv: marshalled asynchronously */
   38291 struct marshal_cmd_Color3iv
   38292 {
   38293    struct marshal_cmd_base cmd_base;
   38294    GLint v[3];
   38295 };
   38296 static inline void
   38297 _mesa_unmarshal_Color3iv(struct gl_context *ctx, const struct marshal_cmd_Color3iv *cmd)
   38298 {
   38299    const GLint * v = cmd->v;
   38300    CALL_Color3iv(ctx->CurrentServerDispatch, (v));
   38301 }
   38302 static void GLAPIENTRY
   38303 _mesa_marshal_Color3iv(const GLint * v)
   38304 {
   38305    GET_CURRENT_CONTEXT(ctx);
   38306    size_t cmd_size = sizeof(struct marshal_cmd_Color3iv);
   38307    struct marshal_cmd_Color3iv *cmd;
   38308    debug_print_marshal("Color3iv");
   38309    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38310       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3iv, cmd_size);
   38311       memcpy(cmd->v, v, 12);
   38312       _mesa_post_marshal_hook(ctx);
   38313       return;
   38314    }
   38315 
   38316    _mesa_glthread_finish(ctx);
   38317    debug_print_sync_fallback("Color3iv");
   38318    CALL_Color3iv(ctx->CurrentServerDispatch, (v));
   38319 }
   38320 
   38321 
   38322 /* DrawElements: marshalled asynchronously */
   38323 struct marshal_cmd_DrawElements
   38324 {
   38325    struct marshal_cmd_base cmd_base;
   38326    GLenum mode;
   38327    GLsizei count;
   38328    GLenum type;
   38329    const GLvoid * indices;
   38330 };
   38331 static inline void
   38332 _mesa_unmarshal_DrawElements(struct gl_context *ctx, const struct marshal_cmd_DrawElements *cmd)
   38333 {
   38334    const GLenum mode = cmd->mode;
   38335    const GLsizei count = cmd->count;
   38336    const GLenum type = cmd->type;
   38337    const GLvoid * indices = cmd->indices;
   38338    CALL_DrawElements(ctx->CurrentServerDispatch, (mode, count, type, indices));
   38339 }
   38340 static void GLAPIENTRY
   38341 _mesa_marshal_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices)
   38342 {
   38343    GET_CURRENT_CONTEXT(ctx);
   38344    size_t cmd_size = sizeof(struct marshal_cmd_DrawElements);
   38345    struct marshal_cmd_DrawElements *cmd;
   38346    debug_print_marshal("DrawElements");
   38347    if (_mesa_glthread_is_non_vbo_draw_elements(ctx)) {
   38348       _mesa_glthread_finish(ctx);
   38349       _mesa_glthread_restore_dispatch(ctx);
   38350       debug_print_sync_fallback("DrawElements");
   38351       CALL_DrawElements(ctx->CurrentServerDispatch, (mode, count, type, indices));
   38352       return;
   38353    }
   38354    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38355       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawElements, cmd_size);
   38356       cmd->mode = mode;
   38357       cmd->count = count;
   38358       cmd->type = type;
   38359       cmd->indices = indices;
   38360       _mesa_post_marshal_hook(ctx);
   38361       return;
   38362    }
   38363 
   38364    _mesa_glthread_finish(ctx);
   38365    debug_print_sync_fallback("DrawElements");
   38366    CALL_DrawElements(ctx->CurrentServerDispatch, (mode, count, type, indices));
   38367 }
   38368 
   38369 
   38370 /* ScissorArrayv: marshalled asynchronously */
   38371 struct marshal_cmd_ScissorArrayv
   38372 {
   38373    struct marshal_cmd_base cmd_base;
   38374    GLuint first;
   38375    GLsizei count;
   38376    /* Next safe_mul(count, 16) bytes are int v[count][4] */
   38377 };
   38378 static inline void
   38379 _mesa_unmarshal_ScissorArrayv(struct gl_context *ctx, const struct marshal_cmd_ScissorArrayv *cmd)
   38380 {
   38381    const GLuint first = cmd->first;
   38382    const GLsizei count = cmd->count;
   38383    const int * v;
   38384    const char *variable_data = (const char *) (cmd + 1);
   38385    v = (const int *) variable_data;
   38386    variable_data += count * 16;
   38387    CALL_ScissorArrayv(ctx->CurrentServerDispatch, (first, count, v));
   38388 }
   38389 static void GLAPIENTRY
   38390 _mesa_marshal_ScissorArrayv(GLuint first, GLsizei count, const int * v)
   38391 {
   38392    GET_CURRENT_CONTEXT(ctx);
   38393    size_t cmd_size = sizeof(struct marshal_cmd_ScissorArrayv) + safe_mul(count, 16);
   38394    struct marshal_cmd_ScissorArrayv *cmd;
   38395    debug_print_marshal("ScissorArrayv");
   38396    if (unlikely(safe_mul(count, 16) < 0)) {
   38397       goto fallback_to_sync;
   38398    }
   38399    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38400       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ScissorArrayv, cmd_size);
   38401       cmd->first = first;
   38402       cmd->count = count;
   38403       char *variable_data = (char *) (cmd + 1);
   38404       memcpy(variable_data, v, count * 16);
   38405       variable_data += count * 16;
   38406       _mesa_post_marshal_hook(ctx);
   38407       return;
   38408    }
   38409 
   38410 fallback_to_sync:
   38411    _mesa_glthread_finish(ctx);
   38412    debug_print_sync_fallback("ScissorArrayv");
   38413    CALL_ScissorArrayv(ctx->CurrentServerDispatch, (first, count, v));
   38414 }
   38415 
   38416 
   38417 /* GetInternalformativ: marshalled synchronously */
   38418 static void GLAPIENTRY
   38419 _mesa_marshal_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint * params)
   38420 {
   38421    GET_CURRENT_CONTEXT(ctx);
   38422    _mesa_glthread_finish(ctx);
   38423    debug_print_sync("GetInternalformativ");
   38424    CALL_GetInternalformativ(ctx->CurrentServerDispatch, (target, internalformat, pname, bufSize, params));
   38425 }
   38426 
   38427 
   38428 /* EvalPoint2: marshalled asynchronously */
   38429 struct marshal_cmd_EvalPoint2
   38430 {
   38431    struct marshal_cmd_base cmd_base;
   38432    GLint i;
   38433    GLint j;
   38434 };
   38435 static inline void
   38436 _mesa_unmarshal_EvalPoint2(struct gl_context *ctx, const struct marshal_cmd_EvalPoint2 *cmd)
   38437 {
   38438    const GLint i = cmd->i;
   38439    const GLint j = cmd->j;
   38440    CALL_EvalPoint2(ctx->CurrentServerDispatch, (i, j));
   38441 }
   38442 static void GLAPIENTRY
   38443 _mesa_marshal_EvalPoint2(GLint i, GLint j)
   38444 {
   38445    GET_CURRENT_CONTEXT(ctx);
   38446    size_t cmd_size = sizeof(struct marshal_cmd_EvalPoint2);
   38447    struct marshal_cmd_EvalPoint2 *cmd;
   38448    debug_print_marshal("EvalPoint2");
   38449    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38450       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EvalPoint2, cmd_size);
   38451       cmd->i = i;
   38452       cmd->j = j;
   38453       _mesa_post_marshal_hook(ctx);
   38454       return;
   38455    }
   38456 
   38457    _mesa_glthread_finish(ctx);
   38458    debug_print_sync_fallback("EvalPoint2");
   38459    CALL_EvalPoint2(ctx->CurrentServerDispatch, (i, j));
   38460 }
   38461 
   38462 
   38463 /* EvalPoint1: marshalled asynchronously */
   38464 struct marshal_cmd_EvalPoint1
   38465 {
   38466    struct marshal_cmd_base cmd_base;
   38467    GLint i;
   38468 };
   38469 static inline void
   38470 _mesa_unmarshal_EvalPoint1(struct gl_context *ctx, const struct marshal_cmd_EvalPoint1 *cmd)
   38471 {
   38472    const GLint i = cmd->i;
   38473    CALL_EvalPoint1(ctx->CurrentServerDispatch, (i));
   38474 }
   38475 static void GLAPIENTRY
   38476 _mesa_marshal_EvalPoint1(GLint i)
   38477 {
   38478    GET_CURRENT_CONTEXT(ctx);
   38479    size_t cmd_size = sizeof(struct marshal_cmd_EvalPoint1);
   38480    struct marshal_cmd_EvalPoint1 *cmd;
   38481    debug_print_marshal("EvalPoint1");
   38482    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38483       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EvalPoint1, cmd_size);
   38484       cmd->i = i;
   38485       _mesa_post_marshal_hook(ctx);
   38486       return;
   38487    }
   38488 
   38489    _mesa_glthread_finish(ctx);
   38490    debug_print_sync_fallback("EvalPoint1");
   38491    CALL_EvalPoint1(ctx->CurrentServerDispatch, (i));
   38492 }
   38493 
   38494 
   38495 /* VertexAttribLPointer: marshalled synchronously */
   38496 static void GLAPIENTRY
   38497 _mesa_marshal_VertexAttribLPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer)
   38498 {
   38499    GET_CURRENT_CONTEXT(ctx);
   38500    _mesa_glthread_finish(ctx);
   38501    debug_print_sync("VertexAttribLPointer");
   38502    CALL_VertexAttribLPointer(ctx->CurrentServerDispatch, (index, size, type, stride, pointer));
   38503 }
   38504 
   38505 
   38506 /* PopMatrix: marshalled asynchronously */
   38507 struct marshal_cmd_PopMatrix
   38508 {
   38509    struct marshal_cmd_base cmd_base;
   38510 };
   38511 static inline void
   38512 _mesa_unmarshal_PopMatrix(struct gl_context *ctx, const struct marshal_cmd_PopMatrix *cmd)
   38513 {
   38514    CALL_PopMatrix(ctx->CurrentServerDispatch, ());
   38515 }
   38516 static void GLAPIENTRY
   38517 _mesa_marshal_PopMatrix(void)
   38518 {
   38519    GET_CURRENT_CONTEXT(ctx);
   38520    size_t cmd_size = sizeof(struct marshal_cmd_PopMatrix);
   38521    struct marshal_cmd_PopMatrix *cmd;
   38522    debug_print_marshal("PopMatrix");
   38523    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38524       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PopMatrix, cmd_size);
   38525       (void) cmd;
   38526 
   38527       _mesa_post_marshal_hook(ctx);
   38528       return;
   38529    }
   38530 
   38531    _mesa_glthread_finish(ctx);
   38532    debug_print_sync_fallback("PopMatrix");
   38533    CALL_PopMatrix(ctx->CurrentServerDispatch, ());
   38534 }
   38535 
   38536 
   38537 /* GetTexGeniv: marshalled synchronously */
   38538 static void GLAPIENTRY
   38539 _mesa_marshal_GetTexGeniv(GLenum coord, GLenum pname, GLint * params)
   38540 {
   38541    GET_CURRENT_CONTEXT(ctx);
   38542    _mesa_glthread_finish(ctx);
   38543    debug_print_sync("GetTexGeniv");
   38544    CALL_GetTexGeniv(ctx->CurrentServerDispatch, (coord, pname, params));
   38545 }
   38546 
   38547 
   38548 /* GetFirstPerfQueryIdINTEL: marshalled synchronously */
   38549 static void GLAPIENTRY
   38550 _mesa_marshal_GetFirstPerfQueryIdINTEL(GLuint * queryId)
   38551 {
   38552    GET_CURRENT_CONTEXT(ctx);
   38553    _mesa_glthread_finish(ctx);
   38554    debug_print_sync("GetFirstPerfQueryIdINTEL");
   38555    CALL_GetFirstPerfQueryIdINTEL(ctx->CurrentServerDispatch, (queryId));
   38556 }
   38557 
   38558 
   38559 /* UnmapBuffer: marshalled synchronously */
   38560 static GLboolean GLAPIENTRY
   38561 _mesa_marshal_UnmapBuffer(GLenum target)
   38562 {
   38563    GET_CURRENT_CONTEXT(ctx);
   38564    _mesa_glthread_finish(ctx);
   38565    debug_print_sync("UnmapBuffer");
   38566    return CALL_UnmapBuffer(ctx->CurrentServerDispatch, (target));
   38567 }
   38568 
   38569 
   38570 /* EvalCoord1d: marshalled asynchronously */
   38571 struct marshal_cmd_EvalCoord1d
   38572 {
   38573    struct marshal_cmd_base cmd_base;
   38574    GLdouble u;
   38575 };
   38576 static inline void
   38577 _mesa_unmarshal_EvalCoord1d(struct gl_context *ctx, const struct marshal_cmd_EvalCoord1d *cmd)
   38578 {
   38579    const GLdouble u = cmd->u;
   38580    CALL_EvalCoord1d(ctx->CurrentServerDispatch, (u));
   38581 }
   38582 static void GLAPIENTRY
   38583 _mesa_marshal_EvalCoord1d(GLdouble u)
   38584 {
   38585    GET_CURRENT_CONTEXT(ctx);
   38586    size_t cmd_size = sizeof(struct marshal_cmd_EvalCoord1d);
   38587    struct marshal_cmd_EvalCoord1d *cmd;
   38588    debug_print_marshal("EvalCoord1d");
   38589    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38590       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EvalCoord1d, cmd_size);
   38591       cmd->u = u;
   38592       _mesa_post_marshal_hook(ctx);
   38593       return;
   38594    }
   38595 
   38596    _mesa_glthread_finish(ctx);
   38597    debug_print_sync_fallback("EvalCoord1d");
   38598    CALL_EvalCoord1d(ctx->CurrentServerDispatch, (u));
   38599 }
   38600 
   38601 
   38602 /* VertexAttribL1d: marshalled asynchronously */
   38603 struct marshal_cmd_VertexAttribL1d
   38604 {
   38605    struct marshal_cmd_base cmd_base;
   38606    GLuint index;
   38607    GLdouble x;
   38608 };
   38609 static inline void
   38610 _mesa_unmarshal_VertexAttribL1d(struct gl_context *ctx, const struct marshal_cmd_VertexAttribL1d *cmd)
   38611 {
   38612    const GLuint index = cmd->index;
   38613    const GLdouble x = cmd->x;
   38614    CALL_VertexAttribL1d(ctx->CurrentServerDispatch, (index, x));
   38615 }
   38616 static void GLAPIENTRY
   38617 _mesa_marshal_VertexAttribL1d(GLuint index, GLdouble x)
   38618 {
   38619    GET_CURRENT_CONTEXT(ctx);
   38620    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttribL1d);
   38621    struct marshal_cmd_VertexAttribL1d *cmd;
   38622    debug_print_marshal("VertexAttribL1d");
   38623    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38624       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribL1d, cmd_size);
   38625       cmd->index = index;
   38626       cmd->x = x;
   38627       _mesa_post_marshal_hook(ctx);
   38628       return;
   38629    }
   38630 
   38631    _mesa_glthread_finish(ctx);
   38632    debug_print_sync_fallback("VertexAttribL1d");
   38633    CALL_VertexAttribL1d(ctx->CurrentServerDispatch, (index, x));
   38634 }
   38635 
   38636 
   38637 /* EvalCoord1f: marshalled asynchronously */
   38638 struct marshal_cmd_EvalCoord1f
   38639 {
   38640    struct marshal_cmd_base cmd_base;
   38641    GLfloat u;
   38642 };
   38643 static inline void
   38644 _mesa_unmarshal_EvalCoord1f(struct gl_context *ctx, const struct marshal_cmd_EvalCoord1f *cmd)
   38645 {
   38646    const GLfloat u = cmd->u;
   38647    CALL_EvalCoord1f(ctx->CurrentServerDispatch, (u));
   38648 }
   38649 static void GLAPIENTRY
   38650 _mesa_marshal_EvalCoord1f(GLfloat u)
   38651 {
   38652    GET_CURRENT_CONTEXT(ctx);
   38653    size_t cmd_size = sizeof(struct marshal_cmd_EvalCoord1f);
   38654    struct marshal_cmd_EvalCoord1f *cmd;
   38655    debug_print_marshal("EvalCoord1f");
   38656    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38657       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EvalCoord1f, cmd_size);
   38658       cmd->u = u;
   38659       _mesa_post_marshal_hook(ctx);
   38660       return;
   38661    }
   38662 
   38663    _mesa_glthread_finish(ctx);
   38664    debug_print_sync_fallback("EvalCoord1f");
   38665    CALL_EvalCoord1f(ctx->CurrentServerDispatch, (u));
   38666 }
   38667 
   38668 
   38669 /* Materialf: marshalled asynchronously */
   38670 struct marshal_cmd_Materialf
   38671 {
   38672    struct marshal_cmd_base cmd_base;
   38673    GLenum face;
   38674    GLenum pname;
   38675    GLfloat param;
   38676 };
   38677 static inline void
   38678 _mesa_unmarshal_Materialf(struct gl_context *ctx, const struct marshal_cmd_Materialf *cmd)
   38679 {
   38680    const GLenum face = cmd->face;
   38681    const GLenum pname = cmd->pname;
   38682    const GLfloat param = cmd->param;
   38683    CALL_Materialf(ctx->CurrentServerDispatch, (face, pname, param));
   38684 }
   38685 static void GLAPIENTRY
   38686 _mesa_marshal_Materialf(GLenum face, GLenum pname, GLfloat param)
   38687 {
   38688    GET_CURRENT_CONTEXT(ctx);
   38689    size_t cmd_size = sizeof(struct marshal_cmd_Materialf);
   38690    struct marshal_cmd_Materialf *cmd;
   38691    debug_print_marshal("Materialf");
   38692    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38693       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Materialf, cmd_size);
   38694       cmd->face = face;
   38695       cmd->pname = pname;
   38696       cmd->param = param;
   38697       _mesa_post_marshal_hook(ctx);
   38698       return;
   38699    }
   38700 
   38701    _mesa_glthread_finish(ctx);
   38702    debug_print_sync_fallback("Materialf");
   38703    CALL_Materialf(ctx->CurrentServerDispatch, (face, pname, param));
   38704 }
   38705 
   38706 
   38707 /* Materiali: marshalled asynchronously */
   38708 struct marshal_cmd_Materiali
   38709 {
   38710    struct marshal_cmd_base cmd_base;
   38711    GLenum face;
   38712    GLenum pname;
   38713    GLint param;
   38714 };
   38715 static inline void
   38716 _mesa_unmarshal_Materiali(struct gl_context *ctx, const struct marshal_cmd_Materiali *cmd)
   38717 {
   38718    const GLenum face = cmd->face;
   38719    const GLenum pname = cmd->pname;
   38720    const GLint param = cmd->param;
   38721    CALL_Materiali(ctx->CurrentServerDispatch, (face, pname, param));
   38722 }
   38723 static void GLAPIENTRY
   38724 _mesa_marshal_Materiali(GLenum face, GLenum pname, GLint param)
   38725 {
   38726    GET_CURRENT_CONTEXT(ctx);
   38727    size_t cmd_size = sizeof(struct marshal_cmd_Materiali);
   38728    struct marshal_cmd_Materiali *cmd;
   38729    debug_print_marshal("Materiali");
   38730    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38731       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Materiali, cmd_size);
   38732       cmd->face = face;
   38733       cmd->pname = pname;
   38734       cmd->param = param;
   38735       _mesa_post_marshal_hook(ctx);
   38736       return;
   38737    }
   38738 
   38739    _mesa_glthread_finish(ctx);
   38740    debug_print_sync_fallback("Materiali");
   38741    CALL_Materiali(ctx->CurrentServerDispatch, (face, pname, param));
   38742 }
   38743 
   38744 
   38745 /* ProgramUniform1uiv: marshalled asynchronously */
   38746 struct marshal_cmd_ProgramUniform1uiv
   38747 {
   38748    struct marshal_cmd_base cmd_base;
   38749    GLuint program;
   38750    GLint location;
   38751    GLsizei count;
   38752    /* Next safe_mul(count, 4) bytes are GLuint value[count] */
   38753 };
   38754 static inline void
   38755 _mesa_unmarshal_ProgramUniform1uiv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1uiv *cmd)
   38756 {
   38757    const GLuint program = cmd->program;
   38758    const GLint location = cmd->location;
   38759    const GLsizei count = cmd->count;
   38760    const GLuint * value;
   38761    const char *variable_data = (const char *) (cmd + 1);
   38762    value = (const GLuint *) variable_data;
   38763    variable_data += count * 4;
   38764    CALL_ProgramUniform1uiv(ctx->CurrentServerDispatch, (program, location, count, value));
   38765 }
   38766 static void GLAPIENTRY
   38767 _mesa_marshal_ProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint * value)
   38768 {
   38769    GET_CURRENT_CONTEXT(ctx);
   38770    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform1uiv) + safe_mul(count, 4);
   38771    struct marshal_cmd_ProgramUniform1uiv *cmd;
   38772    debug_print_marshal("ProgramUniform1uiv");
   38773    if (unlikely(safe_mul(count, 4) < 0)) {
   38774       goto fallback_to_sync;
   38775    }
   38776    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38777       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1uiv, cmd_size);
   38778       cmd->program = program;
   38779       cmd->location = location;
   38780       cmd->count = count;
   38781       char *variable_data = (char *) (cmd + 1);
   38782       memcpy(variable_data, value, count * 4);
   38783       variable_data += count * 4;
   38784       _mesa_post_marshal_hook(ctx);
   38785       return;
   38786    }
   38787 
   38788 fallback_to_sync:
   38789    _mesa_glthread_finish(ctx);
   38790    debug_print_sync_fallback("ProgramUniform1uiv");
   38791    CALL_ProgramUniform1uiv(ctx->CurrentServerDispatch, (program, location, count, value));
   38792 }
   38793 
   38794 
   38795 /* EvalCoord1dv: marshalled asynchronously */
   38796 struct marshal_cmd_EvalCoord1dv
   38797 {
   38798    struct marshal_cmd_base cmd_base;
   38799    GLdouble u[1];
   38800 };
   38801 static inline void
   38802 _mesa_unmarshal_EvalCoord1dv(struct gl_context *ctx, const struct marshal_cmd_EvalCoord1dv *cmd)
   38803 {
   38804    const GLdouble * u = cmd->u;
   38805    CALL_EvalCoord1dv(ctx->CurrentServerDispatch, (u));
   38806 }
   38807 static void GLAPIENTRY
   38808 _mesa_marshal_EvalCoord1dv(const GLdouble * u)
   38809 {
   38810    GET_CURRENT_CONTEXT(ctx);
   38811    size_t cmd_size = sizeof(struct marshal_cmd_EvalCoord1dv);
   38812    struct marshal_cmd_EvalCoord1dv *cmd;
   38813    debug_print_marshal("EvalCoord1dv");
   38814    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38815       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EvalCoord1dv, cmd_size);
   38816       memcpy(cmd->u, u, 8);
   38817       _mesa_post_marshal_hook(ctx);
   38818       return;
   38819    }
   38820 
   38821    _mesa_glthread_finish(ctx);
   38822    debug_print_sync_fallback("EvalCoord1dv");
   38823    CALL_EvalCoord1dv(ctx->CurrentServerDispatch, (u));
   38824 }
   38825 
   38826 
   38827 /* Materialx: marshalled asynchronously */
   38828 struct marshal_cmd_Materialx
   38829 {
   38830    struct marshal_cmd_base cmd_base;
   38831    GLenum face;
   38832    GLenum pname;
   38833    GLfixed param;
   38834 };
   38835 static inline void
   38836 _mesa_unmarshal_Materialx(struct gl_context *ctx, const struct marshal_cmd_Materialx *cmd)
   38837 {
   38838    const GLenum face = cmd->face;
   38839    const GLenum pname = cmd->pname;
   38840    const GLfixed param = cmd->param;
   38841    CALL_Materialx(ctx->CurrentServerDispatch, (face, pname, param));
   38842 }
   38843 static void GLAPIENTRY
   38844 _mesa_marshal_Materialx(GLenum face, GLenum pname, GLfixed param)
   38845 {
   38846    GET_CURRENT_CONTEXT(ctx);
   38847    size_t cmd_size = sizeof(struct marshal_cmd_Materialx);
   38848    struct marshal_cmd_Materialx *cmd;
   38849    debug_print_marshal("Materialx");
   38850    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38851       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Materialx, cmd_size);
   38852       cmd->face = face;
   38853       cmd->pname = pname;
   38854       cmd->param = param;
   38855       _mesa_post_marshal_hook(ctx);
   38856       return;
   38857    }
   38858 
   38859    _mesa_glthread_finish(ctx);
   38860    debug_print_sync_fallback("Materialx");
   38861    CALL_Materialx(ctx->CurrentServerDispatch, (face, pname, param));
   38862 }
   38863 
   38864 
   38865 /* GetQueryBufferObjectiv: marshalled asynchronously */
   38866 struct marshal_cmd_GetQueryBufferObjectiv
   38867 {
   38868    struct marshal_cmd_base cmd_base;
   38869    GLuint id;
   38870    GLuint buffer;
   38871    GLenum pname;
   38872    GLintptr offset;
   38873 };
   38874 static inline void
   38875 _mesa_unmarshal_GetQueryBufferObjectiv(struct gl_context *ctx, const struct marshal_cmd_GetQueryBufferObjectiv *cmd)
   38876 {
   38877    const GLuint id = cmd->id;
   38878    const GLuint buffer = cmd->buffer;
   38879    const GLenum pname = cmd->pname;
   38880    const GLintptr offset = cmd->offset;
   38881    CALL_GetQueryBufferObjectiv(ctx->CurrentServerDispatch, (id, buffer, pname, offset));
   38882 }
   38883 static void GLAPIENTRY
   38884 _mesa_marshal_GetQueryBufferObjectiv(GLuint id, GLuint buffer, GLenum pname, GLintptr offset)
   38885 {
   38886    GET_CURRENT_CONTEXT(ctx);
   38887    size_t cmd_size = sizeof(struct marshal_cmd_GetQueryBufferObjectiv);
   38888    struct marshal_cmd_GetQueryBufferObjectiv *cmd;
   38889    debug_print_marshal("GetQueryBufferObjectiv");
   38890    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38891       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GetQueryBufferObjectiv, cmd_size);
   38892       cmd->id = id;
   38893       cmd->buffer = buffer;
   38894       cmd->pname = pname;
   38895       cmd->offset = offset;
   38896       _mesa_post_marshal_hook(ctx);
   38897       return;
   38898    }
   38899 
   38900    _mesa_glthread_finish(ctx);
   38901    debug_print_sync_fallback("GetQueryBufferObjectiv");
   38902    CALL_GetQueryBufferObjectiv(ctx->CurrentServerDispatch, (id, buffer, pname, offset));
   38903 }
   38904 
   38905 
   38906 /* GetTextureSamplerHandleARB: marshalled synchronously */
   38907 static GLuint64 GLAPIENTRY
   38908 _mesa_marshal_GetTextureSamplerHandleARB(GLuint texture, GLuint sampler)
   38909 {
   38910    GET_CURRENT_CONTEXT(ctx);
   38911    _mesa_glthread_finish(ctx);
   38912    debug_print_sync("GetTextureSamplerHandleARB");
   38913    return CALL_GetTextureSamplerHandleARB(ctx->CurrentServerDispatch, (texture, sampler));
   38914 }
   38915 
   38916 
   38917 /* GetLightiv: marshalled synchronously */
   38918 static void GLAPIENTRY
   38919 _mesa_marshal_GetLightiv(GLenum light, GLenum pname, GLint * params)
   38920 {
   38921    GET_CURRENT_CONTEXT(ctx);
   38922    _mesa_glthread_finish(ctx);
   38923    debug_print_sync("GetLightiv");
   38924    CALL_GetLightiv(ctx->CurrentServerDispatch, (light, pname, params));
   38925 }
   38926 
   38927 
   38928 /* ProgramUniform3i64ARB: marshalled asynchronously */
   38929 struct marshal_cmd_ProgramUniform3i64ARB
   38930 {
   38931    struct marshal_cmd_base cmd_base;
   38932    GLuint program;
   38933    GLint location;
   38934    GLint64 x;
   38935    GLint64 y;
   38936    GLint64 z;
   38937 };
   38938 static inline void
   38939 _mesa_unmarshal_ProgramUniform3i64ARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3i64ARB *cmd)
   38940 {
   38941    const GLuint program = cmd->program;
   38942    const GLint location = cmd->location;
   38943    const GLint64 x = cmd->x;
   38944    const GLint64 y = cmd->y;
   38945    const GLint64 z = cmd->z;
   38946    CALL_ProgramUniform3i64ARB(ctx->CurrentServerDispatch, (program, location, x, y, z));
   38947 }
   38948 static void GLAPIENTRY
   38949 _mesa_marshal_ProgramUniform3i64ARB(GLuint program, GLint location, GLint64 x, GLint64 y, GLint64 z)
   38950 {
   38951    GET_CURRENT_CONTEXT(ctx);
   38952    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform3i64ARB);
   38953    struct marshal_cmd_ProgramUniform3i64ARB *cmd;
   38954    debug_print_marshal("ProgramUniform3i64ARB");
   38955    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38956       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3i64ARB, cmd_size);
   38957       cmd->program = program;
   38958       cmd->location = location;
   38959       cmd->x = x;
   38960       cmd->y = y;
   38961       cmd->z = z;
   38962       _mesa_post_marshal_hook(ctx);
   38963       return;
   38964    }
   38965 
   38966    _mesa_glthread_finish(ctx);
   38967    debug_print_sync_fallback("ProgramUniform3i64ARB");
   38968    CALL_ProgramUniform3i64ARB(ctx->CurrentServerDispatch, (program, location, x, y, z));
   38969 }
   38970 
   38971 
   38972 /* ProgramUniform1i: marshalled asynchronously */
   38973 struct marshal_cmd_ProgramUniform1i
   38974 {
   38975    struct marshal_cmd_base cmd_base;
   38976    GLuint program;
   38977    GLint location;
   38978    GLint x;
   38979 };
   38980 static inline void
   38981 _mesa_unmarshal_ProgramUniform1i(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1i *cmd)
   38982 {
   38983    const GLuint program = cmd->program;
   38984    const GLint location = cmd->location;
   38985    const GLint x = cmd->x;
   38986    CALL_ProgramUniform1i(ctx->CurrentServerDispatch, (program, location, x));
   38987 }
   38988 static void GLAPIENTRY
   38989 _mesa_marshal_ProgramUniform1i(GLuint program, GLint location, GLint x)
   38990 {
   38991    GET_CURRENT_CONTEXT(ctx);
   38992    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform1i);
   38993    struct marshal_cmd_ProgramUniform1i *cmd;
   38994    debug_print_marshal("ProgramUniform1i");
   38995    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   38996       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1i, cmd_size);
   38997       cmd->program = program;
   38998       cmd->location = location;
   38999       cmd->x = x;
   39000       _mesa_post_marshal_hook(ctx);
   39001       return;
   39002    }
   39003 
   39004    _mesa_glthread_finish(ctx);
   39005    debug_print_sync_fallback("ProgramUniform1i");
   39006    CALL_ProgramUniform1i(ctx->CurrentServerDispatch, (program, location, x));
   39007 }
   39008 
   39009 
   39010 /* ProgramUniform1f: marshalled asynchronously */
   39011 struct marshal_cmd_ProgramUniform1f
   39012 {
   39013    struct marshal_cmd_base cmd_base;
   39014    GLuint program;
   39015    GLint location;
   39016    GLfloat x;
   39017 };
   39018 static inline void
   39019 _mesa_unmarshal_ProgramUniform1f(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1f *cmd)
   39020 {
   39021    const GLuint program = cmd->program;
   39022    const GLint location = cmd->location;
   39023    const GLfloat x = cmd->x;
   39024    CALL_ProgramUniform1f(ctx->CurrentServerDispatch, (program, location, x));
   39025 }
   39026 static void GLAPIENTRY
   39027 _mesa_marshal_ProgramUniform1f(GLuint program, GLint location, GLfloat x)
   39028 {
   39029    GET_CURRENT_CONTEXT(ctx);
   39030    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform1f);
   39031    struct marshal_cmd_ProgramUniform1f *cmd;
   39032    debug_print_marshal("ProgramUniform1f");
   39033    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39034       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1f, cmd_size);
   39035       cmd->program = program;
   39036       cmd->location = location;
   39037       cmd->x = x;
   39038       _mesa_post_marshal_hook(ctx);
   39039       return;
   39040    }
   39041 
   39042    _mesa_glthread_finish(ctx);
   39043    debug_print_sync_fallback("ProgramUniform1f");
   39044    CALL_ProgramUniform1f(ctx->CurrentServerDispatch, (program, location, x));
   39045 }
   39046 
   39047 
   39048 /* ProgramUniform1d: marshalled asynchronously */
   39049 struct marshal_cmd_ProgramUniform1d
   39050 {
   39051    struct marshal_cmd_base cmd_base;
   39052    GLuint program;
   39053    GLint location;
   39054    GLdouble x;
   39055 };
   39056 static inline void
   39057 _mesa_unmarshal_ProgramUniform1d(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1d *cmd)
   39058 {
   39059    const GLuint program = cmd->program;
   39060    const GLint location = cmd->location;
   39061    const GLdouble x = cmd->x;
   39062    CALL_ProgramUniform1d(ctx->CurrentServerDispatch, (program, location, x));
   39063 }
   39064 static void GLAPIENTRY
   39065 _mesa_marshal_ProgramUniform1d(GLuint program, GLint location, GLdouble x)
   39066 {
   39067    GET_CURRENT_CONTEXT(ctx);
   39068    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform1d);
   39069    struct marshal_cmd_ProgramUniform1d *cmd;
   39070    debug_print_marshal("ProgramUniform1d");
   39071    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39072       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1d, cmd_size);
   39073       cmd->program = program;
   39074       cmd->location = location;
   39075       cmd->x = x;
   39076       _mesa_post_marshal_hook(ctx);
   39077       return;
   39078    }
   39079 
   39080    _mesa_glthread_finish(ctx);
   39081    debug_print_sync_fallback("ProgramUniform1d");
   39082    CALL_ProgramUniform1d(ctx->CurrentServerDispatch, (program, location, x));
   39083 }
   39084 
   39085 
   39086 /* WindowPos3iv: marshalled synchronously */
   39087 static void GLAPIENTRY
   39088 _mesa_marshal_WindowPos3iv(const GLint * v)
   39089 {
   39090    GET_CURRENT_CONTEXT(ctx);
   39091    _mesa_glthread_finish(ctx);
   39092    debug_print_sync("WindowPos3iv");
   39093    CALL_WindowPos3iv(ctx->CurrentServerDispatch, (v));
   39094 }
   39095 
   39096 
   39097 /* CopyConvolutionFilter2D: marshalled asynchronously */
   39098 struct marshal_cmd_CopyConvolutionFilter2D
   39099 {
   39100    struct marshal_cmd_base cmd_base;
   39101    GLenum target;
   39102    GLenum internalformat;
   39103    GLint x;
   39104    GLint y;
   39105    GLsizei width;
   39106    GLsizei height;
   39107 };
   39108 static inline void
   39109 _mesa_unmarshal_CopyConvolutionFilter2D(struct gl_context *ctx, const struct marshal_cmd_CopyConvolutionFilter2D *cmd)
   39110 {
   39111    const GLenum target = cmd->target;
   39112    const GLenum internalformat = cmd->internalformat;
   39113    const GLint x = cmd->x;
   39114    const GLint y = cmd->y;
   39115    const GLsizei width = cmd->width;
   39116    const GLsizei height = cmd->height;
   39117    CALL_CopyConvolutionFilter2D(ctx->CurrentServerDispatch, (target, internalformat, x, y, width, height));
   39118 }
   39119 static void GLAPIENTRY
   39120 _mesa_marshal_CopyConvolutionFilter2D(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height)
   39121 {
   39122    GET_CURRENT_CONTEXT(ctx);
   39123    size_t cmd_size = sizeof(struct marshal_cmd_CopyConvolutionFilter2D);
   39124    struct marshal_cmd_CopyConvolutionFilter2D *cmd;
   39125    debug_print_marshal("CopyConvolutionFilter2D");
   39126    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39127       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyConvolutionFilter2D, cmd_size);
   39128       cmd->target = target;
   39129       cmd->internalformat = internalformat;
   39130       cmd->x = x;
   39131       cmd->y = y;
   39132       cmd->width = width;
   39133       cmd->height = height;
   39134       _mesa_post_marshal_hook(ctx);
   39135       return;
   39136    }
   39137 
   39138    _mesa_glthread_finish(ctx);
   39139    debug_print_sync_fallback("CopyConvolutionFilter2D");
   39140    CALL_CopyConvolutionFilter2D(ctx->CurrentServerDispatch, (target, internalformat, x, y, width, height));
   39141 }
   39142 
   39143 
   39144 /* CopyBufferSubData: marshalled asynchronously */
   39145 struct marshal_cmd_CopyBufferSubData
   39146 {
   39147    struct marshal_cmd_base cmd_base;
   39148    GLenum readTarget;
   39149    GLenum writeTarget;
   39150    GLintptr readOffset;
   39151    GLintptr writeOffset;
   39152    GLsizeiptr size;
   39153 };
   39154 static inline void
   39155 _mesa_unmarshal_CopyBufferSubData(struct gl_context *ctx, const struct marshal_cmd_CopyBufferSubData *cmd)
   39156 {
   39157    const GLenum readTarget = cmd->readTarget;
   39158    const GLenum writeTarget = cmd->writeTarget;
   39159    const GLintptr readOffset = cmd->readOffset;
   39160    const GLintptr writeOffset = cmd->writeOffset;
   39161    const GLsizeiptr size = cmd->size;
   39162    CALL_CopyBufferSubData(ctx->CurrentServerDispatch, (readTarget, writeTarget, readOffset, writeOffset, size));
   39163 }
   39164 static void GLAPIENTRY
   39165 _mesa_marshal_CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
   39166 {
   39167    GET_CURRENT_CONTEXT(ctx);
   39168    size_t cmd_size = sizeof(struct marshal_cmd_CopyBufferSubData);
   39169    struct marshal_cmd_CopyBufferSubData *cmd;
   39170    debug_print_marshal("CopyBufferSubData");
   39171    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39172       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyBufferSubData, cmd_size);
   39173       cmd->readTarget = readTarget;
   39174       cmd->writeTarget = writeTarget;
   39175       cmd->readOffset = readOffset;
   39176       cmd->writeOffset = writeOffset;
   39177       cmd->size = size;
   39178       _mesa_post_marshal_hook(ctx);
   39179       return;
   39180    }
   39181 
   39182    _mesa_glthread_finish(ctx);
   39183    debug_print_sync_fallback("CopyBufferSubData");
   39184    CALL_CopyBufferSubData(ctx->CurrentServerDispatch, (readTarget, writeTarget, readOffset, writeOffset, size));
   39185 }
   39186 
   39187 
   39188 /* UniformMatrix3x4fv: marshalled asynchronously */
   39189 struct marshal_cmd_UniformMatrix3x4fv
   39190 {
   39191    struct marshal_cmd_base cmd_base;
   39192    GLint location;
   39193    GLsizei count;
   39194    GLboolean transpose;
   39195    /* Next safe_mul(count, 48) bytes are GLfloat value[count][12] */
   39196 };
   39197 static inline void
   39198 _mesa_unmarshal_UniformMatrix3x4fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3x4fv *cmd)
   39199 {
   39200    const GLint location = cmd->location;
   39201    const GLsizei count = cmd->count;
   39202    const GLboolean transpose = cmd->transpose;
   39203    const GLfloat * value;
   39204    const char *variable_data = (const char *) (cmd + 1);
   39205    value = (const GLfloat *) variable_data;
   39206    variable_data += count * 48;
   39207    CALL_UniformMatrix3x4fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   39208 }
   39209 static void GLAPIENTRY
   39210 _mesa_marshal_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value)
   39211 {
   39212    GET_CURRENT_CONTEXT(ctx);
   39213    size_t cmd_size = sizeof(struct marshal_cmd_UniformMatrix3x4fv) + safe_mul(count, 48);
   39214    struct marshal_cmd_UniformMatrix3x4fv *cmd;
   39215    debug_print_marshal("UniformMatrix3x4fv");
   39216    if (unlikely(safe_mul(count, 48) < 0)) {
   39217       goto fallback_to_sync;
   39218    }
   39219    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39220       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3x4fv, cmd_size);
   39221       cmd->location = location;
   39222       cmd->count = count;
   39223       cmd->transpose = transpose;
   39224       char *variable_data = (char *) (cmd + 1);
   39225       memcpy(variable_data, value, count * 48);
   39226       variable_data += count * 48;
   39227       _mesa_post_marshal_hook(ctx);
   39228       return;
   39229    }
   39230 
   39231 fallback_to_sync:
   39232    _mesa_glthread_finish(ctx);
   39233    debug_print_sync_fallback("UniformMatrix3x4fv");
   39234    CALL_UniformMatrix3x4fv(ctx->CurrentServerDispatch, (location, count, transpose, value));
   39235 }
   39236 
   39237 
   39238 /* Recti: marshalled asynchronously */
   39239 struct marshal_cmd_Recti
   39240 {
   39241    struct marshal_cmd_base cmd_base;
   39242    GLint x1;
   39243    GLint y1;
   39244    GLint x2;
   39245    GLint y2;
   39246 };
   39247 static inline void
   39248 _mesa_unmarshal_Recti(struct gl_context *ctx, const struct marshal_cmd_Recti *cmd)
   39249 {
   39250    const GLint x1 = cmd->x1;
   39251    const GLint y1 = cmd->y1;
   39252    const GLint x2 = cmd->x2;
   39253    const GLint y2 = cmd->y2;
   39254    CALL_Recti(ctx->CurrentServerDispatch, (x1, y1, x2, y2));
   39255 }
   39256 static void GLAPIENTRY
   39257 _mesa_marshal_Recti(GLint x1, GLint y1, GLint x2, GLint y2)
   39258 {
   39259    GET_CURRENT_CONTEXT(ctx);
   39260    size_t cmd_size = sizeof(struct marshal_cmd_Recti);
   39261    struct marshal_cmd_Recti *cmd;
   39262    debug_print_marshal("Recti");
   39263    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39264       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Recti, cmd_size);
   39265       cmd->x1 = x1;
   39266       cmd->y1 = y1;
   39267       cmd->x2 = x2;
   39268       cmd->y2 = y2;
   39269       _mesa_post_marshal_hook(ctx);
   39270       return;
   39271    }
   39272 
   39273    _mesa_glthread_finish(ctx);
   39274    debug_print_sync_fallback("Recti");
   39275    CALL_Recti(ctx->CurrentServerDispatch, (x1, y1, x2, y2));
   39276 }
   39277 
   39278 
   39279 /* VertexAttribI3ivEXT: marshalled synchronously */
   39280 static void GLAPIENTRY
   39281 _mesa_marshal_VertexAttribI3ivEXT(GLuint index, const GLint * v)
   39282 {
   39283    GET_CURRENT_CONTEXT(ctx);
   39284    _mesa_glthread_finish(ctx);
   39285    debug_print_sync("VertexAttribI3ivEXT");
   39286    CALL_VertexAttribI3ivEXT(ctx->CurrentServerDispatch, (index, v));
   39287 }
   39288 
   39289 
   39290 /* DeleteSamplers: marshalled synchronously */
   39291 static void GLAPIENTRY
   39292 _mesa_marshal_DeleteSamplers(GLsizei count, const GLuint * samplers)
   39293 {
   39294    GET_CURRENT_CONTEXT(ctx);
   39295    _mesa_glthread_finish(ctx);
   39296    debug_print_sync("DeleteSamplers");
   39297    CALL_DeleteSamplers(ctx->CurrentServerDispatch, (count, samplers));
   39298 }
   39299 
   39300 
   39301 /* SamplerParameteri: marshalled asynchronously */
   39302 struct marshal_cmd_SamplerParameteri
   39303 {
   39304    struct marshal_cmd_base cmd_base;
   39305    GLuint sampler;
   39306    GLenum pname;
   39307    GLint param;
   39308 };
   39309 static inline void
   39310 _mesa_unmarshal_SamplerParameteri(struct gl_context *ctx, const struct marshal_cmd_SamplerParameteri *cmd)
   39311 {
   39312    const GLuint sampler = cmd->sampler;
   39313    const GLenum pname = cmd->pname;
   39314    const GLint param = cmd->param;
   39315    CALL_SamplerParameteri(ctx->CurrentServerDispatch, (sampler, pname, param));
   39316 }
   39317 static void GLAPIENTRY
   39318 _mesa_marshal_SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
   39319 {
   39320    GET_CURRENT_CONTEXT(ctx);
   39321    size_t cmd_size = sizeof(struct marshal_cmd_SamplerParameteri);
   39322    struct marshal_cmd_SamplerParameteri *cmd;
   39323    debug_print_marshal("SamplerParameteri");
   39324    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39325       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SamplerParameteri, cmd_size);
   39326       cmd->sampler = sampler;
   39327       cmd->pname = pname;
   39328       cmd->param = param;
   39329       _mesa_post_marshal_hook(ctx);
   39330       return;
   39331    }
   39332 
   39333    _mesa_glthread_finish(ctx);
   39334    debug_print_sync_fallback("SamplerParameteri");
   39335    CALL_SamplerParameteri(ctx->CurrentServerDispatch, (sampler, pname, param));
   39336 }
   39337 
   39338 
   39339 /* WindowRectanglesEXT: marshalled synchronously */
   39340 static void GLAPIENTRY
   39341 _mesa_marshal_WindowRectanglesEXT(GLenum mode, GLsizei count, const GLint * box)
   39342 {
   39343    GET_CURRENT_CONTEXT(ctx);
   39344    _mesa_glthread_finish(ctx);
   39345    debug_print_sync("WindowRectanglesEXT");
   39346    CALL_WindowRectanglesEXT(ctx->CurrentServerDispatch, (mode, count, box));
   39347 }
   39348 
   39349 
   39350 /* Rectf: marshalled asynchronously */
   39351 struct marshal_cmd_Rectf
   39352 {
   39353    struct marshal_cmd_base cmd_base;
   39354    GLfloat x1;
   39355    GLfloat y1;
   39356    GLfloat x2;
   39357    GLfloat y2;
   39358 };
   39359 static inline void
   39360 _mesa_unmarshal_Rectf(struct gl_context *ctx, const struct marshal_cmd_Rectf *cmd)
   39361 {
   39362    const GLfloat x1 = cmd->x1;
   39363    const GLfloat y1 = cmd->y1;
   39364    const GLfloat x2 = cmd->x2;
   39365    const GLfloat y2 = cmd->y2;
   39366    CALL_Rectf(ctx->CurrentServerDispatch, (x1, y1, x2, y2));
   39367 }
   39368 static void GLAPIENTRY
   39369 _mesa_marshal_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
   39370 {
   39371    GET_CURRENT_CONTEXT(ctx);
   39372    size_t cmd_size = sizeof(struct marshal_cmd_Rectf);
   39373    struct marshal_cmd_Rectf *cmd;
   39374    debug_print_marshal("Rectf");
   39375    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39376       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Rectf, cmd_size);
   39377       cmd->x1 = x1;
   39378       cmd->y1 = y1;
   39379       cmd->x2 = x2;
   39380       cmd->y2 = y2;
   39381       _mesa_post_marshal_hook(ctx);
   39382       return;
   39383    }
   39384 
   39385    _mesa_glthread_finish(ctx);
   39386    debug_print_sync_fallback("Rectf");
   39387    CALL_Rectf(ctx->CurrentServerDispatch, (x1, y1, x2, y2));
   39388 }
   39389 
   39390 
   39391 /* Rectd: marshalled asynchronously */
   39392 struct marshal_cmd_Rectd
   39393 {
   39394    struct marshal_cmd_base cmd_base;
   39395    GLdouble x1;
   39396    GLdouble y1;
   39397    GLdouble x2;
   39398    GLdouble y2;
   39399 };
   39400 static inline void
   39401 _mesa_unmarshal_Rectd(struct gl_context *ctx, const struct marshal_cmd_Rectd *cmd)
   39402 {
   39403    const GLdouble x1 = cmd->x1;
   39404    const GLdouble y1 = cmd->y1;
   39405    const GLdouble x2 = cmd->x2;
   39406    const GLdouble y2 = cmd->y2;
   39407    CALL_Rectd(ctx->CurrentServerDispatch, (x1, y1, x2, y2));
   39408 }
   39409 static void GLAPIENTRY
   39410 _mesa_marshal_Rectd(GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2)
   39411 {
   39412    GET_CURRENT_CONTEXT(ctx);
   39413    size_t cmd_size = sizeof(struct marshal_cmd_Rectd);
   39414    struct marshal_cmd_Rectd *cmd;
   39415    debug_print_marshal("Rectd");
   39416    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39417       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Rectd, cmd_size);
   39418       cmd->x1 = x1;
   39419       cmd->y1 = y1;
   39420       cmd->x2 = x2;
   39421       cmd->y2 = y2;
   39422       _mesa_post_marshal_hook(ctx);
   39423       return;
   39424    }
   39425 
   39426    _mesa_glthread_finish(ctx);
   39427    debug_print_sync_fallback("Rectd");
   39428    CALL_Rectd(ctx->CurrentServerDispatch, (x1, y1, x2, y2));
   39429 }
   39430 
   39431 
   39432 /* MultMatrixx: marshalled asynchronously */
   39433 struct marshal_cmd_MultMatrixx
   39434 {
   39435    struct marshal_cmd_base cmd_base;
   39436    GLfixed m[16];
   39437 };
   39438 static inline void
   39439 _mesa_unmarshal_MultMatrixx(struct gl_context *ctx, const struct marshal_cmd_MultMatrixx *cmd)
   39440 {
   39441    const GLfixed * m = cmd->m;
   39442    CALL_MultMatrixx(ctx->CurrentServerDispatch, (m));
   39443 }
   39444 static void GLAPIENTRY
   39445 _mesa_marshal_MultMatrixx(const GLfixed * m)
   39446 {
   39447    GET_CURRENT_CONTEXT(ctx);
   39448    size_t cmd_size = sizeof(struct marshal_cmd_MultMatrixx);
   39449    struct marshal_cmd_MultMatrixx *cmd;
   39450    debug_print_marshal("MultMatrixx");
   39451    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39452       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultMatrixx, cmd_size);
   39453       memcpy(cmd->m, m, 64);
   39454       _mesa_post_marshal_hook(ctx);
   39455       return;
   39456    }
   39457 
   39458    _mesa_glthread_finish(ctx);
   39459    debug_print_sync_fallback("MultMatrixx");
   39460    CALL_MultMatrixx(ctx->CurrentServerDispatch, (m));
   39461 }
   39462 
   39463 
   39464 /* TexStorageMem3DMultisampleEXT: marshalled asynchronously */
   39465 struct marshal_cmd_TexStorageMem3DMultisampleEXT
   39466 {
   39467    struct marshal_cmd_base cmd_base;
   39468    GLenum target;
   39469    GLsizei samples;
   39470    GLenum internalFormat;
   39471    GLsizei width;
   39472    GLsizei height;
   39473    GLsizei depth;
   39474    GLboolean fixedSampleLocations;
   39475    GLuint memory;
   39476    GLuint64 offset;
   39477 };
   39478 static inline void
   39479 _mesa_unmarshal_TexStorageMem3DMultisampleEXT(struct gl_context *ctx, const struct marshal_cmd_TexStorageMem3DMultisampleEXT *cmd)
   39480 {
   39481    const GLenum target = cmd->target;
   39482    const GLsizei samples = cmd->samples;
   39483    const GLenum internalFormat = cmd->internalFormat;
   39484    const GLsizei width = cmd->width;
   39485    const GLsizei height = cmd->height;
   39486    const GLsizei depth = cmd->depth;
   39487    const GLboolean fixedSampleLocations = cmd->fixedSampleLocations;
   39488    const GLuint memory = cmd->memory;
   39489    const GLuint64 offset = cmd->offset;
   39490    CALL_TexStorageMem3DMultisampleEXT(ctx->CurrentServerDispatch, (target, samples, internalFormat, width, height, depth, fixedSampleLocations, memory, offset));
   39491 }
   39492 static void GLAPIENTRY
   39493 _mesa_marshal_TexStorageMem3DMultisampleEXT(GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset)
   39494 {
   39495    GET_CURRENT_CONTEXT(ctx);
   39496    size_t cmd_size = sizeof(struct marshal_cmd_TexStorageMem3DMultisampleEXT);
   39497    struct marshal_cmd_TexStorageMem3DMultisampleEXT *cmd;
   39498    debug_print_marshal("TexStorageMem3DMultisampleEXT");
   39499    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39500       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorageMem3DMultisampleEXT, cmd_size);
   39501       cmd->target = target;
   39502       cmd->samples = samples;
   39503       cmd->internalFormat = internalFormat;
   39504       cmd->width = width;
   39505       cmd->height = height;
   39506       cmd->depth = depth;
   39507       cmd->fixedSampleLocations = fixedSampleLocations;
   39508       cmd->memory = memory;
   39509       cmd->offset = offset;
   39510       _mesa_post_marshal_hook(ctx);
   39511       return;
   39512    }
   39513 
   39514    _mesa_glthread_finish(ctx);
   39515    debug_print_sync_fallback("TexStorageMem3DMultisampleEXT");
   39516    CALL_TexStorageMem3DMultisampleEXT(ctx->CurrentServerDispatch, (target, samples, internalFormat, width, height, depth, fixedSampleLocations, memory, offset));
   39517 }
   39518 
   39519 
   39520 /* Rects: marshalled asynchronously */
   39521 struct marshal_cmd_Rects
   39522 {
   39523    struct marshal_cmd_base cmd_base;
   39524    GLshort x1;
   39525    GLshort y1;
   39526    GLshort x2;
   39527    GLshort y2;
   39528 };
   39529 static inline void
   39530 _mesa_unmarshal_Rects(struct gl_context *ctx, const struct marshal_cmd_Rects *cmd)
   39531 {
   39532    const GLshort x1 = cmd->x1;
   39533    const GLshort y1 = cmd->y1;
   39534    const GLshort x2 = cmd->x2;
   39535    const GLshort y2 = cmd->y2;
   39536    CALL_Rects(ctx->CurrentServerDispatch, (x1, y1, x2, y2));
   39537 }
   39538 static void GLAPIENTRY
   39539 _mesa_marshal_Rects(GLshort x1, GLshort y1, GLshort x2, GLshort y2)
   39540 {
   39541    GET_CURRENT_CONTEXT(ctx);
   39542    size_t cmd_size = sizeof(struct marshal_cmd_Rects);
   39543    struct marshal_cmd_Rects *cmd;
   39544    debug_print_marshal("Rects");
   39545    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39546       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Rects, cmd_size);
   39547       cmd->x1 = x1;
   39548       cmd->y1 = y1;
   39549       cmd->x2 = x2;
   39550       cmd->y2 = y2;
   39551       _mesa_post_marshal_hook(ctx);
   39552       return;
   39553    }
   39554 
   39555    _mesa_glthread_finish(ctx);
   39556    debug_print_sync_fallback("Rects");
   39557    CALL_Rects(ctx->CurrentServerDispatch, (x1, y1, x2, y2));
   39558 }
   39559 
   39560 
   39561 /* GetVertexAttribIiv: marshalled synchronously */
   39562 static void GLAPIENTRY
   39563 _mesa_marshal_GetVertexAttribIiv(GLuint index, GLenum pname, GLint * params)
   39564 {
   39565    GET_CURRENT_CONTEXT(ctx);
   39566    _mesa_glthread_finish(ctx);
   39567    debug_print_sync("GetVertexAttribIiv");
   39568    CALL_GetVertexAttribIiv(ctx->CurrentServerDispatch, (index, pname, params));
   39569 }
   39570 
   39571 
   39572 /* ClientWaitSync: marshalled synchronously */
   39573 static GLenum GLAPIENTRY
   39574 _mesa_marshal_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
   39575 {
   39576    GET_CURRENT_CONTEXT(ctx);
   39577    _mesa_glthread_finish(ctx);
   39578    debug_print_sync("ClientWaitSync");
   39579    return CALL_ClientWaitSync(ctx->CurrentServerDispatch, (sync, flags, timeout));
   39580 }
   39581 
   39582 
   39583 /* TexCoord4s: marshalled asynchronously */
   39584 struct marshal_cmd_TexCoord4s
   39585 {
   39586    struct marshal_cmd_base cmd_base;
   39587    GLshort s;
   39588    GLshort t;
   39589    GLshort r;
   39590    GLshort q;
   39591 };
   39592 static inline void
   39593 _mesa_unmarshal_TexCoord4s(struct gl_context *ctx, const struct marshal_cmd_TexCoord4s *cmd)
   39594 {
   39595    const GLshort s = cmd->s;
   39596    const GLshort t = cmd->t;
   39597    const GLshort r = cmd->r;
   39598    const GLshort q = cmd->q;
   39599    CALL_TexCoord4s(ctx->CurrentServerDispatch, (s, t, r, q));
   39600 }
   39601 static void GLAPIENTRY
   39602 _mesa_marshal_TexCoord4s(GLshort s, GLshort t, GLshort r, GLshort q)
   39603 {
   39604    GET_CURRENT_CONTEXT(ctx);
   39605    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord4s);
   39606    struct marshal_cmd_TexCoord4s *cmd;
   39607    debug_print_marshal("TexCoord4s");
   39608    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39609       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord4s, cmd_size);
   39610       cmd->s = s;
   39611       cmd->t = t;
   39612       cmd->r = r;
   39613       cmd->q = q;
   39614       _mesa_post_marshal_hook(ctx);
   39615       return;
   39616    }
   39617 
   39618    _mesa_glthread_finish(ctx);
   39619    debug_print_sync_fallback("TexCoord4s");
   39620    CALL_TexCoord4s(ctx->CurrentServerDispatch, (s, t, r, q));
   39621 }
   39622 
   39623 
   39624 /* TexEnvxv: marshalled synchronously */
   39625 static void GLAPIENTRY
   39626 _mesa_marshal_TexEnvxv(GLenum target, GLenum pname, const GLfixed * params)
   39627 {
   39628    GET_CURRENT_CONTEXT(ctx);
   39629    _mesa_glthread_finish(ctx);
   39630    debug_print_sync("TexEnvxv");
   39631    CALL_TexEnvxv(ctx->CurrentServerDispatch, (target, pname, params));
   39632 }
   39633 
   39634 
   39635 /* TexCoord4i: marshalled asynchronously */
   39636 struct marshal_cmd_TexCoord4i
   39637 {
   39638    struct marshal_cmd_base cmd_base;
   39639    GLint s;
   39640    GLint t;
   39641    GLint r;
   39642    GLint q;
   39643 };
   39644 static inline void
   39645 _mesa_unmarshal_TexCoord4i(struct gl_context *ctx, const struct marshal_cmd_TexCoord4i *cmd)
   39646 {
   39647    const GLint s = cmd->s;
   39648    const GLint t = cmd->t;
   39649    const GLint r = cmd->r;
   39650    const GLint q = cmd->q;
   39651    CALL_TexCoord4i(ctx->CurrentServerDispatch, (s, t, r, q));
   39652 }
   39653 static void GLAPIENTRY
   39654 _mesa_marshal_TexCoord4i(GLint s, GLint t, GLint r, GLint q)
   39655 {
   39656    GET_CURRENT_CONTEXT(ctx);
   39657    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord4i);
   39658    struct marshal_cmd_TexCoord4i *cmd;
   39659    debug_print_marshal("TexCoord4i");
   39660    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39661       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord4i, cmd_size);
   39662       cmd->s = s;
   39663       cmd->t = t;
   39664       cmd->r = r;
   39665       cmd->q = q;
   39666       _mesa_post_marshal_hook(ctx);
   39667       return;
   39668    }
   39669 
   39670    _mesa_glthread_finish(ctx);
   39671    debug_print_sync_fallback("TexCoord4i");
   39672    CALL_TexCoord4i(ctx->CurrentServerDispatch, (s, t, r, q));
   39673 }
   39674 
   39675 
   39676 /* ObjectPurgeableAPPLE: marshalled synchronously */
   39677 static GLenum GLAPIENTRY
   39678 _mesa_marshal_ObjectPurgeableAPPLE(GLenum objectType, GLuint name, GLenum option)
   39679 {
   39680    GET_CURRENT_CONTEXT(ctx);
   39681    _mesa_glthread_finish(ctx);
   39682    debug_print_sync("ObjectPurgeableAPPLE");
   39683    return CALL_ObjectPurgeableAPPLE(ctx->CurrentServerDispatch, (objectType, name, option));
   39684 }
   39685 
   39686 
   39687 /* ProgramUniform1ui64vARB: marshalled asynchronously */
   39688 struct marshal_cmd_ProgramUniform1ui64vARB
   39689 {
   39690    struct marshal_cmd_base cmd_base;
   39691    GLuint program;
   39692    GLint location;
   39693    GLsizei count;
   39694    /* Next safe_mul(count, 8) bytes are GLuint64 value[count] */
   39695 };
   39696 static inline void
   39697 _mesa_unmarshal_ProgramUniform1ui64vARB(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1ui64vARB *cmd)
   39698 {
   39699    const GLuint program = cmd->program;
   39700    const GLint location = cmd->location;
   39701    const GLsizei count = cmd->count;
   39702    const GLuint64 * value;
   39703    const char *variable_data = (const char *) (cmd + 1);
   39704    value = (const GLuint64 *) variable_data;
   39705    variable_data += count * 8;
   39706    CALL_ProgramUniform1ui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
   39707 }
   39708 static void GLAPIENTRY
   39709 _mesa_marshal_ProgramUniform1ui64vARB(GLuint program, GLint location, GLsizei count, const GLuint64 * value)
   39710 {
   39711    GET_CURRENT_CONTEXT(ctx);
   39712    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniform1ui64vARB) + safe_mul(count, 8);
   39713    struct marshal_cmd_ProgramUniform1ui64vARB *cmd;
   39714    debug_print_marshal("ProgramUniform1ui64vARB");
   39715    if (unlikely(safe_mul(count, 8) < 0)) {
   39716       goto fallback_to_sync;
   39717    }
   39718    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39719       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1ui64vARB, cmd_size);
   39720       cmd->program = program;
   39721       cmd->location = location;
   39722       cmd->count = count;
   39723       char *variable_data = (char *) (cmd + 1);
   39724       memcpy(variable_data, value, count * 8);
   39725       variable_data += count * 8;
   39726       _mesa_post_marshal_hook(ctx);
   39727       return;
   39728    }
   39729 
   39730 fallback_to_sync:
   39731    _mesa_glthread_finish(ctx);
   39732    debug_print_sync_fallback("ProgramUniform1ui64vARB");
   39733    CALL_ProgramUniform1ui64vARB(ctx->CurrentServerDispatch, (program, location, count, value));
   39734 }
   39735 
   39736 
   39737 /* TexCoord4d: marshalled asynchronously */
   39738 struct marshal_cmd_TexCoord4d
   39739 {
   39740    struct marshal_cmd_base cmd_base;
   39741    GLdouble s;
   39742    GLdouble t;
   39743    GLdouble r;
   39744    GLdouble q;
   39745 };
   39746 static inline void
   39747 _mesa_unmarshal_TexCoord4d(struct gl_context *ctx, const struct marshal_cmd_TexCoord4d *cmd)
   39748 {
   39749    const GLdouble s = cmd->s;
   39750    const GLdouble t = cmd->t;
   39751    const GLdouble r = cmd->r;
   39752    const GLdouble q = cmd->q;
   39753    CALL_TexCoord4d(ctx->CurrentServerDispatch, (s, t, r, q));
   39754 }
   39755 static void GLAPIENTRY
   39756 _mesa_marshal_TexCoord4d(GLdouble s, GLdouble t, GLdouble r, GLdouble q)
   39757 {
   39758    GET_CURRENT_CONTEXT(ctx);
   39759    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord4d);
   39760    struct marshal_cmd_TexCoord4d *cmd;
   39761    debug_print_marshal("TexCoord4d");
   39762    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39763       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord4d, cmd_size);
   39764       cmd->s = s;
   39765       cmd->t = t;
   39766       cmd->r = r;
   39767       cmd->q = q;
   39768       _mesa_post_marshal_hook(ctx);
   39769       return;
   39770    }
   39771 
   39772    _mesa_glthread_finish(ctx);
   39773    debug_print_sync_fallback("TexCoord4d");
   39774    CALL_TexCoord4d(ctx->CurrentServerDispatch, (s, t, r, q));
   39775 }
   39776 
   39777 
   39778 /* TexCoord4f: marshalled asynchronously */
   39779 struct marshal_cmd_TexCoord4f
   39780 {
   39781    struct marshal_cmd_base cmd_base;
   39782    GLfloat s;
   39783    GLfloat t;
   39784    GLfloat r;
   39785    GLfloat q;
   39786 };
   39787 static inline void
   39788 _mesa_unmarshal_TexCoord4f(struct gl_context *ctx, const struct marshal_cmd_TexCoord4f *cmd)
   39789 {
   39790    const GLfloat s = cmd->s;
   39791    const GLfloat t = cmd->t;
   39792    const GLfloat r = cmd->r;
   39793    const GLfloat q = cmd->q;
   39794    CALL_TexCoord4f(ctx->CurrentServerDispatch, (s, t, r, q));
   39795 }
   39796 static void GLAPIENTRY
   39797 _mesa_marshal_TexCoord4f(GLfloat s, GLfloat t, GLfloat r, GLfloat q)
   39798 {
   39799    GET_CURRENT_CONTEXT(ctx);
   39800    size_t cmd_size = sizeof(struct marshal_cmd_TexCoord4f);
   39801    struct marshal_cmd_TexCoord4f *cmd;
   39802    debug_print_marshal("TexCoord4f");
   39803    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39804       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord4f, cmd_size);
   39805       cmd->s = s;
   39806       cmd->t = t;
   39807       cmd->r = r;
   39808       cmd->q = q;
   39809       _mesa_post_marshal_hook(ctx);
   39810       return;
   39811    }
   39812 
   39813    _mesa_glthread_finish(ctx);
   39814    debug_print_sync_fallback("TexCoord4f");
   39815    CALL_TexCoord4f(ctx->CurrentServerDispatch, (s, t, r, q));
   39816 }
   39817 
   39818 
   39819 /* GetBooleanv: marshalled synchronously */
   39820 static void GLAPIENTRY
   39821 _mesa_marshal_GetBooleanv(GLenum pname, GLboolean * params)
   39822 {
   39823    GET_CURRENT_CONTEXT(ctx);
   39824    _mesa_glthread_finish(ctx);
   39825    debug_print_sync("GetBooleanv");
   39826    CALL_GetBooleanv(ctx->CurrentServerDispatch, (pname, params));
   39827 }
   39828 
   39829 
   39830 /* ProgramUniformMatrix3dv: marshalled asynchronously */
   39831 struct marshal_cmd_ProgramUniformMatrix3dv
   39832 {
   39833    struct marshal_cmd_base cmd_base;
   39834    GLuint program;
   39835    GLint location;
   39836    GLsizei count;
   39837    GLboolean transpose;
   39838    /* Next safe_mul(count, 72) bytes are GLdouble value[count][9] */
   39839 };
   39840 static inline void
   39841 _mesa_unmarshal_ProgramUniformMatrix3dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix3dv *cmd)
   39842 {
   39843    const GLuint program = cmd->program;
   39844    const GLint location = cmd->location;
   39845    const GLsizei count = cmd->count;
   39846    const GLboolean transpose = cmd->transpose;
   39847    const GLdouble * value;
   39848    const char *variable_data = (const char *) (cmd + 1);
   39849    value = (const GLdouble *) variable_data;
   39850    variable_data += count * 72;
   39851    CALL_ProgramUniformMatrix3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   39852 }
   39853 static void GLAPIENTRY
   39854 _mesa_marshal_ProgramUniformMatrix3dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value)
   39855 {
   39856    GET_CURRENT_CONTEXT(ctx);
   39857    size_t cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix3dv) + safe_mul(count, 72);
   39858    struct marshal_cmd_ProgramUniformMatrix3dv *cmd;
   39859    debug_print_marshal("ProgramUniformMatrix3dv");
   39860    if (unlikely(safe_mul(count, 72) < 0)) {
   39861       goto fallback_to_sync;
   39862    }
   39863    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39864       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix3dv, cmd_size);
   39865       cmd->program = program;
   39866       cmd->location = location;
   39867       cmd->count = count;
   39868       cmd->transpose = transpose;
   39869       char *variable_data = (char *) (cmd + 1);
   39870       memcpy(variable_data, value, count * 72);
   39871       variable_data += count * 72;
   39872       _mesa_post_marshal_hook(ctx);
   39873       return;
   39874    }
   39875 
   39876 fallback_to_sync:
   39877    _mesa_glthread_finish(ctx);
   39878    debug_print_sync_fallback("ProgramUniformMatrix3dv");
   39879    CALL_ProgramUniformMatrix3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value));
   39880 }
   39881 
   39882 
   39883 /* LockArraysEXT: marshalled asynchronously */
   39884 struct marshal_cmd_LockArraysEXT
   39885 {
   39886    struct marshal_cmd_base cmd_base;
   39887    GLint first;
   39888    GLsizei count;
   39889 };
   39890 static inline void
   39891 _mesa_unmarshal_LockArraysEXT(struct gl_context *ctx, const struct marshal_cmd_LockArraysEXT *cmd)
   39892 {
   39893    const GLint first = cmd->first;
   39894    const GLsizei count = cmd->count;
   39895    CALL_LockArraysEXT(ctx->CurrentServerDispatch, (first, count));
   39896 }
   39897 static void GLAPIENTRY
   39898 _mesa_marshal_LockArraysEXT(GLint first, GLsizei count)
   39899 {
   39900    GET_CURRENT_CONTEXT(ctx);
   39901    size_t cmd_size = sizeof(struct marshal_cmd_LockArraysEXT);
   39902    struct marshal_cmd_LockArraysEXT *cmd;
   39903    debug_print_marshal("LockArraysEXT");
   39904    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39905       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LockArraysEXT, cmd_size);
   39906       cmd->first = first;
   39907       cmd->count = count;
   39908       _mesa_post_marshal_hook(ctx);
   39909       return;
   39910    }
   39911 
   39912    _mesa_glthread_finish(ctx);
   39913    debug_print_sync_fallback("LockArraysEXT");
   39914    CALL_LockArraysEXT(ctx->CurrentServerDispatch, (first, count));
   39915 }
   39916 
   39917 
   39918 /* GetActiveUniformBlockiv: marshalled synchronously */
   39919 static void GLAPIENTRY
   39920 _mesa_marshal_GetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params)
   39921 {
   39922    GET_CURRENT_CONTEXT(ctx);
   39923    _mesa_glthread_finish(ctx);
   39924    debug_print_sync("GetActiveUniformBlockiv");
   39925    CALL_GetActiveUniformBlockiv(ctx->CurrentServerDispatch, (program, uniformBlockIndex, pname, params));
   39926 }
   39927 
   39928 
   39929 /* GetPerfMonitorCountersAMD: marshalled synchronously */
   39930 static void GLAPIENTRY
   39931 _mesa_marshal_GetPerfMonitorCountersAMD(GLuint group, GLint * numCounters, GLint * maxActiveCounters, GLsizei countersSize, GLuint * counters)
   39932 {
   39933    GET_CURRENT_CONTEXT(ctx);
   39934    _mesa_glthread_finish(ctx);
   39935    debug_print_sync("GetPerfMonitorCountersAMD");
   39936    CALL_GetPerfMonitorCountersAMD(ctx->CurrentServerDispatch, (group, numCounters, maxActiveCounters, countersSize, counters));
   39937 }
   39938 
   39939 
   39940 /* ObjectPtrLabel: marshalled synchronously */
   39941 static void GLAPIENTRY
   39942 _mesa_marshal_ObjectPtrLabel(const GLvoid * ptr, GLsizei length, const GLchar * label)
   39943 {
   39944    GET_CURRENT_CONTEXT(ctx);
   39945    _mesa_glthread_finish(ctx);
   39946    debug_print_sync("ObjectPtrLabel");
   39947    CALL_ObjectPtrLabel(ctx->CurrentServerDispatch, (ptr, length, label));
   39948 }
   39949 
   39950 
   39951 /* Rectfv: marshalled asynchronously */
   39952 struct marshal_cmd_Rectfv
   39953 {
   39954    struct marshal_cmd_base cmd_base;
   39955    GLfloat v1[2];
   39956    GLfloat v2[2];
   39957 };
   39958 static inline void
   39959 _mesa_unmarshal_Rectfv(struct gl_context *ctx, const struct marshal_cmd_Rectfv *cmd)
   39960 {
   39961    const GLfloat * v1 = cmd->v1;
   39962    const GLfloat * v2 = cmd->v2;
   39963    CALL_Rectfv(ctx->CurrentServerDispatch, (v1, v2));
   39964 }
   39965 static void GLAPIENTRY
   39966 _mesa_marshal_Rectfv(const GLfloat * v1, const GLfloat * v2)
   39967 {
   39968    GET_CURRENT_CONTEXT(ctx);
   39969    size_t cmd_size = sizeof(struct marshal_cmd_Rectfv);
   39970    struct marshal_cmd_Rectfv *cmd;
   39971    debug_print_marshal("Rectfv");
   39972    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   39973       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Rectfv, cmd_size);
   39974       memcpy(cmd->v1, v1, 8);
   39975       memcpy(cmd->v2, v2, 8);
   39976       _mesa_post_marshal_hook(ctx);
   39977       return;
   39978    }
   39979 
   39980    _mesa_glthread_finish(ctx);
   39981    debug_print_sync_fallback("Rectfv");
   39982    CALL_Rectfv(ctx->CurrentServerDispatch, (v1, v2));
   39983 }
   39984 
   39985 
   39986 /* BindImageTexture: marshalled asynchronously */
   39987 struct marshal_cmd_BindImageTexture
   39988 {
   39989    struct marshal_cmd_base cmd_base;
   39990    GLuint unit;
   39991    GLuint texture;
   39992    GLint level;
   39993    GLboolean layered;
   39994    GLint layer;
   39995    GLenum access;
   39996    GLenum format;
   39997 };
   39998 static inline void
   39999 _mesa_unmarshal_BindImageTexture(struct gl_context *ctx, const struct marshal_cmd_BindImageTexture *cmd)
   40000 {
   40001    const GLuint unit = cmd->unit;
   40002    const GLuint texture = cmd->texture;
   40003    const GLint level = cmd->level;
   40004    const GLboolean layered = cmd->layered;
   40005    const GLint layer = cmd->layer;
   40006    const GLenum access = cmd->access;
   40007    const GLenum format = cmd->format;
   40008    CALL_BindImageTexture(ctx->CurrentServerDispatch, (unit, texture, level, layered, layer, access, format));
   40009 }
   40010 static void GLAPIENTRY
   40011 _mesa_marshal_BindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format)
   40012 {
   40013    GET_CURRENT_CONTEXT(ctx);
   40014    size_t cmd_size = sizeof(struct marshal_cmd_BindImageTexture);
   40015    struct marshal_cmd_BindImageTexture *cmd;
   40016    debug_print_marshal("BindImageTexture");
   40017    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   40018       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindImageTexture, cmd_size);
   40019       cmd->unit = unit;
   40020       cmd->texture = texture;
   40021       cmd->level = level;
   40022       cmd->layered = layered;
   40023       cmd->layer = layer;
   40024       cmd->access = access;
   40025       cmd->format = format;
   40026       _mesa_post_marshal_hook(ctx);
   40027       return;
   40028    }
   40029 
   40030    _mesa_glthread_finish(ctx);
   40031    debug_print_sync_fallback("BindImageTexture");
   40032    CALL_BindImageTexture(ctx->CurrentServerDispatch, (unit, texture, level, layered, layer, access, format));
   40033 }
   40034 
   40035 
   40036 /* VertexP4uiv: marshalled synchronously */
   40037 static void GLAPIENTRY
   40038 _mesa_marshal_VertexP4uiv(GLenum type, const GLuint * value)
   40039 {
   40040    GET_CURRENT_CONTEXT(ctx);
   40041    _mesa_glthread_finish(ctx);
   40042    debug_print_sync("VertexP4uiv");
   40043    CALL_VertexP4uiv(ctx->CurrentServerDispatch, (type, value));
   40044 }
   40045 
   40046 
   40047 /* GetUniformSubroutineuiv: marshalled synchronously */
   40048 static void GLAPIENTRY
   40049 _mesa_marshal_GetUniformSubroutineuiv(GLenum shadertype, GLint location, GLuint * params)
   40050 {
   40051    GET_CURRENT_CONTEXT(ctx);
   40052    _mesa_glthread_finish(ctx);
   40053    debug_print_sync("GetUniformSubroutineuiv");
   40054    CALL_GetUniformSubroutineuiv(ctx->CurrentServerDispatch, (shadertype, location, params));
   40055 }
   40056 
   40057 
   40058 /* MinSampleShading: marshalled asynchronously */
   40059 struct marshal_cmd_MinSampleShading
   40060 {
   40061    struct marshal_cmd_base cmd_base;
   40062    GLfloat value;
   40063 };
   40064 static inline void
   40065 _mesa_unmarshal_MinSampleShading(struct gl_context *ctx, const struct marshal_cmd_MinSampleShading *cmd)
   40066 {
   40067    const GLfloat value = cmd->value;
   40068    CALL_MinSampleShading(ctx->CurrentServerDispatch, (value));
   40069 }
   40070 static void GLAPIENTRY
   40071 _mesa_marshal_MinSampleShading(GLfloat value)
   40072 {
   40073    GET_CURRENT_CONTEXT(ctx);
   40074    size_t cmd_size = sizeof(struct marshal_cmd_MinSampleShading);
   40075    struct marshal_cmd_MinSampleShading *cmd;
   40076    debug_print_marshal("MinSampleShading");
   40077    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   40078       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MinSampleShading, cmd_size);
   40079       cmd->value = value;
   40080       _mesa_post_marshal_hook(ctx);
   40081       return;
   40082    }
   40083 
   40084    _mesa_glthread_finish(ctx);
   40085    debug_print_sync_fallback("MinSampleShading");
   40086    CALL_MinSampleShading(ctx->CurrentServerDispatch, (value));
   40087 }
   40088 
   40089 
   40090 /* GetRenderbufferParameteriv: marshalled synchronously */
   40091 static void GLAPIENTRY
   40092 _mesa_marshal_GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params)
   40093 {
   40094    GET_CURRENT_CONTEXT(ctx);
   40095    _mesa_glthread_finish(ctx);
   40096    debug_print_sync("GetRenderbufferParameteriv");
   40097    CALL_GetRenderbufferParameteriv(ctx->CurrentServerDispatch, (target, pname, params));
   40098 }
   40099 
   40100 
   40101 /* VertexAttrib1dNV: marshalled asynchronously */
   40102 struct marshal_cmd_VertexAttrib1dNV
   40103 {
   40104    struct marshal_cmd_base cmd_base;
   40105    GLuint index;
   40106    GLdouble x;
   40107 };
   40108 static inline void
   40109 _mesa_unmarshal_VertexAttrib1dNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1dNV *cmd)
   40110 {
   40111    const GLuint index = cmd->index;
   40112    const GLdouble x = cmd->x;
   40113    CALL_VertexAttrib1dNV(ctx->CurrentServerDispatch, (index, x));
   40114 }
   40115 static void GLAPIENTRY
   40116 _mesa_marshal_VertexAttrib1dNV(GLuint index, GLdouble x)
   40117 {
   40118    GET_CURRENT_CONTEXT(ctx);
   40119    size_t cmd_size = sizeof(struct marshal_cmd_VertexAttrib1dNV);
   40120    struct marshal_cmd_VertexAttrib1dNV *cmd;
   40121    debug_print_marshal("VertexAttrib1dNV");
   40122    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   40123       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1dNV, cmd_size);
   40124       cmd->index = index;
   40125       cmd->x = x;
   40126       _mesa_post_marshal_hook(ctx);
   40127       return;
   40128    }
   40129 
   40130    _mesa_glthread_finish(ctx);
   40131    debug_print_sync_fallback("VertexAttrib1dNV");
   40132    CALL_VertexAttrib1dNV(ctx->CurrentServerDispatch, (index, x));
   40133 }
   40134 
   40135 
   40136 /* WindowPos2sv: marshalled synchronously */
   40137 static void GLAPIENTRY
   40138 _mesa_marshal_WindowPos2sv(const GLshort * v)
   40139 {
   40140    GET_CURRENT_CONTEXT(ctx);
   40141    _mesa_glthread_finish(ctx);
   40142    debug_print_sync("WindowPos2sv");
   40143    CALL_WindowPos2sv(ctx->CurrentServerDispatch, (v));
   40144 }
   40145 
   40146 
   40147 /* GetPerfMonitorCounterStringAMD: marshalled synchronously */
   40148 static void GLAPIENTRY
   40149 _mesa_marshal_GetPerfMonitorCounterStringAMD(GLuint group, GLuint counter, GLsizei bufSize, GLsizei * length, GLchar * counterString)
   40150 {
   40151    GET_CURRENT_CONTEXT(ctx);
   40152    _mesa_glthread_finish(ctx);
   40153    debug_print_sync("GetPerfMonitorCounterStringAMD");
   40154    CALL_GetPerfMonitorCounterStringAMD(ctx->CurrentServerDispatch, (group, counter, bufSize, length, counterString));
   40155 }
   40156 
   40157 
   40158 /* EndFragmentShaderATI: marshalled asynchronously */
   40159 struct marshal_cmd_EndFragmentShaderATI
   40160 {
   40161    struct marshal_cmd_base cmd_base;
   40162 };
   40163 static inline void
   40164 _mesa_unmarshal_EndFragmentShaderATI(struct gl_context *ctx, const struct marshal_cmd_EndFragmentShaderATI *cmd)
   40165 {
   40166    CALL_EndFragmentShaderATI(ctx->CurrentServerDispatch, ());
   40167 }
   40168 static void GLAPIENTRY
   40169 _mesa_marshal_EndFragmentShaderATI(void)
   40170 {
   40171    GET_CURRENT_CONTEXT(ctx);
   40172    size_t cmd_size = sizeof(struct marshal_cmd_EndFragmentShaderATI);
   40173    struct marshal_cmd_EndFragmentShaderATI *cmd;
   40174    debug_print_marshal("EndFragmentShaderATI");
   40175    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   40176       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EndFragmentShaderATI, cmd_size);
   40177       (void) cmd;
   40178 
   40179       _mesa_post_marshal_hook(ctx);
   40180       return;
   40181    }
   40182 
   40183    _mesa_glthread_finish(ctx);
   40184    debug_print_sync_fallback("EndFragmentShaderATI");
   40185    CALL_EndFragmentShaderATI(ctx->CurrentServerDispatch, ());
   40186 }
   40187 
   40188 
   40189 /* Uniform4iv: marshalled asynchronously */
   40190 struct marshal_cmd_Uniform4iv
   40191 {
   40192    struct marshal_cmd_base cmd_base;
   40193    GLint location;
   40194    GLsizei count;
   40195    /* Next safe_mul(count, 16) bytes are GLint value[count][4] */
   40196 };
   40197 static inline void
   40198 _mesa_unmarshal_Uniform4iv(struct gl_context *ctx, const struct marshal_cmd_Uniform4iv *cmd)
   40199 {
   40200    const GLint location = cmd->location;
   40201    const GLsizei count = cmd->count;
   40202    const GLint * value;
   40203    const char *variable_data = (const char *) (cmd + 1);
   40204    value = (const GLint *) variable_data;
   40205    variable_data += count * 16;
   40206    CALL_Uniform4iv(ctx->CurrentServerDispatch, (location, count, value));
   40207 }
   40208 static void GLAPIENTRY
   40209 _mesa_marshal_Uniform4iv(GLint location, GLsizei count, const GLint * value)
   40210 {
   40211    GET_CURRENT_CONTEXT(ctx);
   40212    size_t cmd_size = sizeof(struct marshal_cmd_Uniform4iv) + safe_mul(count, 16);
   40213    struct marshal_cmd_Uniform4iv *cmd;
   40214    debug_print_marshal("Uniform4iv");
   40215    if (unlikely(safe_mul(count, 16) < 0)) {
   40216       goto fallback_to_sync;
   40217    }
   40218    if (cmd_size <= MARSHAL_MAX_CMD_SIZE) {
   40219       cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4iv, cmd_size);
   40220       cmd->location = location;
   40221       cmd->count = count;
   40222       char *variable_data = (char *) (cmd + 1);
   40223       memcpy(variable_data, value, count * 16);
   40224       variable_data += count * 16;
   40225       _mesa_post_marshal_hook(ctx);
   40226       return;
   40227    }
   40228 
   40229 fallback_to_sync:
   40230    _mesa_glthread_finish(ctx);
   40231    debug_print_sync_fallback("Uniform4iv");
   40232    CALL_Uniform4iv(ctx->CurrentServerDispatch, (location, count, value));
   40233 }
   40234 
   40235 
   40236 /* CreateMemoryObjectsEXT: marshalled synchronously */
   40237 static void GLAPIENTRY
   40238 _mesa_marshal_CreateMemoryObjectsEXT(GLsizei n, GLuint * memoryObjects)
   40239 {
   40240    GET_CURRENT_CONTEXT(ctx);
   40241    _mesa_glthread_finish(ctx);
   40242    debug_print_sync("CreateMemoryObjectsEXT");
   40243    CALL_CreateMemoryObjectsEXT(ctx->CurrentServerDispatch, (n, memoryObjects));
   40244 }
   40245 
   40246 
   40247 size_t
   40248 _mesa_unmarshal_dispatch_cmd(struct gl_context *ctx, const void *cmd)
   40249 {
   40250    const struct marshal_cmd_base *cmd_base = cmd;
   40251    switch (cmd_base->cmd_id) {
   40252    case DISPATCH_CMD_MapGrid1d:
   40253       debug_print_unmarshal("MapGrid1d");
   40254       _mesa_unmarshal_MapGrid1d(ctx, (const struct marshal_cmd_MapGrid1d *) cmd);
   40255       break;
   40256    case DISPATCH_CMD_MapGrid1f:
   40257       debug_print_unmarshal("MapGrid1f");
   40258       _mesa_unmarshal_MapGrid1f(ctx, (const struct marshal_cmd_MapGrid1f *) cmd);
   40259       break;
   40260    case DISPATCH_CMD_ProgramUniform3i64vARB:
   40261       debug_print_unmarshal("ProgramUniform3i64vARB");
   40262       _mesa_unmarshal_ProgramUniform3i64vARB(ctx, (const struct marshal_cmd_ProgramUniform3i64vARB *) cmd);
   40263       break;
   40264    case DISPATCH_CMD_TexCoordP1ui:
   40265       debug_print_unmarshal("TexCoordP1ui");
   40266       _mesa_unmarshal_TexCoordP1ui(ctx, (const struct marshal_cmd_TexCoordP1ui *) cmd);
   40267       break;
   40268    case DISPATCH_CMD_MultiTexCoord1dv:
   40269       debug_print_unmarshal("MultiTexCoord1dv");
   40270       _mesa_unmarshal_MultiTexCoord1dv(ctx, (const struct marshal_cmd_MultiTexCoord1dv *) cmd);
   40271       break;
   40272    case DISPATCH_CMD_AttachShader:
   40273       debug_print_unmarshal("AttachShader");
   40274       _mesa_unmarshal_AttachShader(ctx, (const struct marshal_cmd_AttachShader *) cmd);
   40275       break;
   40276    case DISPATCH_CMD_VertexAttrib3fARB:
   40277       debug_print_unmarshal("VertexAttrib3fARB");
   40278       _mesa_unmarshal_VertexAttrib3fARB(ctx, (const struct marshal_cmd_VertexAttrib3fARB *) cmd);
   40279       break;
   40280    case DISPATCH_CMD_Indexubv:
   40281       debug_print_unmarshal("Indexubv");
   40282       _mesa_unmarshal_Indexubv(ctx, (const struct marshal_cmd_Indexubv *) cmd);
   40283       break;
   40284    case DISPATCH_CMD_Color3ubv:
   40285       debug_print_unmarshal("Color3ubv");
   40286       _mesa_unmarshal_Color3ubv(ctx, (const struct marshal_cmd_Color3ubv *) cmd);
   40287       break;
   40288    case DISPATCH_CMD_ProgramUniform2ui:
   40289       debug_print_unmarshal("ProgramUniform2ui");
   40290       _mesa_unmarshal_ProgramUniform2ui(ctx, (const struct marshal_cmd_ProgramUniform2ui *) cmd);
   40291       break;
   40292    case DISPATCH_CMD_RenderbufferStorage:
   40293       debug_print_unmarshal("RenderbufferStorage");
   40294       _mesa_unmarshal_RenderbufferStorage(ctx, (const struct marshal_cmd_RenderbufferStorage *) cmd);
   40295       break;
   40296    case DISPATCH_CMD_Uniform3i:
   40297       debug_print_unmarshal("Uniform3i");
   40298       _mesa_unmarshal_Uniform3i(ctx, (const struct marshal_cmd_Uniform3i *) cmd);
   40299       break;
   40300    case DISPATCH_CMD_Uniform3d:
   40301       debug_print_unmarshal("Uniform3d");
   40302       _mesa_unmarshal_Uniform3d(ctx, (const struct marshal_cmd_Uniform3d *) cmd);
   40303       break;
   40304    case DISPATCH_CMD_Uniform3f:
   40305       debug_print_unmarshal("Uniform3f");
   40306       _mesa_unmarshal_Uniform3f(ctx, (const struct marshal_cmd_Uniform3f *) cmd);
   40307       break;
   40308    case DISPATCH_CMD_UniformMatrix2x4fv:
   40309       debug_print_unmarshal("UniformMatrix2x4fv");
   40310       _mesa_unmarshal_UniformMatrix2x4fv(ctx, (const struct marshal_cmd_UniformMatrix2x4fv *) cmd);
   40311       break;
   40312    case DISPATCH_CMD_Normal3iv:
   40313       debug_print_unmarshal("Normal3iv");
   40314       _mesa_unmarshal_Normal3iv(ctx, (const struct marshal_cmd_Normal3iv *) cmd);
   40315       break;
   40316    case DISPATCH_CMD_DrawTexiOES:
   40317       debug_print_unmarshal("DrawTexiOES");
   40318       _mesa_unmarshal_DrawTexiOES(ctx, (const struct marshal_cmd_DrawTexiOES *) cmd);
   40319       break;
   40320    case DISPATCH_CMD_Viewport:
   40321       debug_print_unmarshal("Viewport");
   40322       _mesa_unmarshal_Viewport(ctx, (const struct marshal_cmd_Viewport *) cmd);
   40323       break;
   40324    case DISPATCH_CMD_DeleteVertexArrays:
   40325       debug_print_unmarshal("DeleteVertexArrays");
   40326       _mesa_unmarshal_DeleteVertexArrays(ctx, (const struct marshal_cmd_DeleteVertexArrays *) cmd);
   40327       break;
   40328    case DISPATCH_CMD_ClearColorIuiEXT:
   40329       debug_print_unmarshal("ClearColorIuiEXT");
   40330       _mesa_unmarshal_ClearColorIuiEXT(ctx, (const struct marshal_cmd_ClearColorIuiEXT *) cmd);
   40331       break;
   40332    case DISPATCH_CMD_PolygonOffsetx:
   40333       debug_print_unmarshal("PolygonOffsetx");
   40334       _mesa_unmarshal_PolygonOffsetx(ctx, (const struct marshal_cmd_PolygonOffsetx *) cmd);
   40335       break;
   40336    case DISPATCH_CMD_DepthRangeIndexedfOES:
   40337       debug_print_unmarshal("DepthRangeIndexedfOES");
   40338       _mesa_unmarshal_DepthRangeIndexedfOES(ctx, (const struct marshal_cmd_DepthRangeIndexedfOES *) cmd);
   40339       break;
   40340    case DISPATCH_CMD_VertexAttrib4usv:
   40341       debug_print_unmarshal("VertexAttrib4usv");
   40342       _mesa_unmarshal_VertexAttrib4usv(ctx, (const struct marshal_cmd_VertexAttrib4usv *) cmd);
   40343       break;
   40344    case DISPATCH_CMD_TextureStorage1DEXT:
   40345       debug_print_unmarshal("TextureStorage1DEXT");
   40346       _mesa_unmarshal_TextureStorage1DEXT(ctx, (const struct marshal_cmd_TextureStorage1DEXT *) cmd);
   40347       break;
   40348    case DISPATCH_CMD_VertexAttrib4Nub:
   40349       debug_print_unmarshal("VertexAttrib4Nub");
   40350       _mesa_unmarshal_VertexAttrib4Nub(ctx, (const struct marshal_cmd_VertexAttrib4Nub *) cmd);
   40351       break;
   40352    case DISPATCH_CMD_VertexAttribP3ui:
   40353       debug_print_unmarshal("VertexAttribP3ui");
   40354       _mesa_unmarshal_VertexAttribP3ui(ctx, (const struct marshal_cmd_VertexAttribP3ui *) cmd);
   40355       break;
   40356    case DISPATCH_CMD_PointSize:
   40357       debug_print_unmarshal("PointSize");
   40358       _mesa_unmarshal_PointSize(ctx, (const struct marshal_cmd_PointSize *) cmd);
   40359       break;
   40360    case DISPATCH_CMD_PopName:
   40361       debug_print_unmarshal("PopName");
   40362       _mesa_unmarshal_PopName(ctx, (const struct marshal_cmd_PopName *) cmd);
   40363       break;
   40364    case DISPATCH_CMD_FramebufferTexture:
   40365       debug_print_unmarshal("FramebufferTexture");
   40366       _mesa_unmarshal_FramebufferTexture(ctx, (const struct marshal_cmd_FramebufferTexture *) cmd);
   40367       break;
   40368    case DISPATCH_CMD_VertexAttrib4ubNV:
   40369       debug_print_unmarshal("VertexAttrib4ubNV");
   40370       _mesa_unmarshal_VertexAttrib4ubNV(ctx, (const struct marshal_cmd_VertexAttrib4ubNV *) cmd);
   40371       break;
   40372    case DISPATCH_CMD_ValidateProgramPipeline:
   40373       debug_print_unmarshal("ValidateProgramPipeline");
   40374       _mesa_unmarshal_ValidateProgramPipeline(ctx, (const struct marshal_cmd_ValidateProgramPipeline *) cmd);
   40375       break;
   40376    case DISPATCH_CMD_VertexAttribs3dvNV:
   40377       debug_print_unmarshal("VertexAttribs3dvNV");
   40378       _mesa_unmarshal_VertexAttribs3dvNV(ctx, (const struct marshal_cmd_VertexAttribs3dvNV *) cmd);
   40379       break;
   40380    case DISPATCH_CMD_ProgramUniformMatrix2x4dv:
   40381       debug_print_unmarshal("ProgramUniformMatrix2x4dv");
   40382       _mesa_unmarshal_ProgramUniformMatrix2x4dv(ctx, (const struct marshal_cmd_ProgramUniformMatrix2x4dv *) cmd);
   40383       break;
   40384    case DISPATCH_CMD_ProgramUniform4iv:
   40385       debug_print_unmarshal("ProgramUniform4iv");
   40386       _mesa_unmarshal_ProgramUniform4iv(ctx, (const struct marshal_cmd_ProgramUniform4iv *) cmd);
   40387       break;
   40388    case DISPATCH_CMD_TexCoord2iv:
   40389       debug_print_unmarshal("TexCoord2iv");
   40390       _mesa_unmarshal_TexCoord2iv(ctx, (const struct marshal_cmd_TexCoord2iv *) cmd);
   40391       break;
   40392    case DISPATCH_CMD_TexImage2DMultisample:
   40393       debug_print_unmarshal("TexImage2DMultisample");
   40394       _mesa_unmarshal_TexImage2DMultisample(ctx, (const struct marshal_cmd_TexImage2DMultisample *) cmd);
   40395       break;
   40396    case DISPATCH_CMD_TexParameterx:
   40397       debug_print_unmarshal("TexParameterx");
   40398       _mesa_unmarshal_TexParameterx(ctx, (const struct marshal_cmd_TexParameterx *) cmd);
   40399       break;
   40400    case DISPATCH_CMD_Rotatef:
   40401       debug_print_unmarshal("Rotatef");
   40402       _mesa_unmarshal_Rotatef(ctx, (const struct marshal_cmd_Rotatef *) cmd);
   40403       break;
   40404    case DISPATCH_CMD_TexParameterf:
   40405       debug_print_unmarshal("TexParameterf");
   40406       _mesa_unmarshal_TexParameterf(ctx, (const struct marshal_cmd_TexParameterf *) cmd);
   40407       break;
   40408    case DISPATCH_CMD_TexParameteri:
   40409       debug_print_unmarshal("TexParameteri");
   40410       _mesa_unmarshal_TexParameteri(ctx, (const struct marshal_cmd_TexParameteri *) cmd);
   40411       break;
   40412    case DISPATCH_CMD_VDPAUFiniNV:
   40413       debug_print_unmarshal("VDPAUFiniNV");
   40414       _mesa_unmarshal_VDPAUFiniNV(ctx, (const struct marshal_cmd_VDPAUFiniNV *) cmd);
   40415       break;
   40416    case DISPATCH_CMD_ProgramUniformMatrix4x2fv:
   40417       debug_print_unmarshal("ProgramUniformMatrix4x2fv");
   40418       _mesa_unmarshal_ProgramUniformMatrix4x2fv(ctx, (const struct marshal_cmd_ProgramUniformMatrix4x2fv *) cmd);
   40419       break;
   40420    case DISPATCH_CMD_ProgramUniform2f:
   40421       debug_print_unmarshal("ProgramUniform2f");
   40422       _mesa_unmarshal_ProgramUniform2f(ctx, (const struct marshal_cmd_ProgramUniform2f *) cmd);
   40423       break;
   40424    case DISPATCH_CMD_ProgramUniform2d:
   40425       debug_print_unmarshal("ProgramUniform2d");
   40426       _mesa_unmarshal_ProgramUniform2d(ctx, (const struct marshal_cmd_ProgramUniform2d *) cmd);
   40427       break;
   40428    case DISPATCH_CMD_ProgramUniform2i:
   40429       debug_print_unmarshal("ProgramUniform2i");
   40430       _mesa_unmarshal_ProgramUniform2i(ctx, (const struct marshal_cmd_ProgramUniform2i *) cmd);
   40431       break;
   40432    case DISPATCH_CMD_Fogx:
   40433       debug_print_unmarshal("Fogx");
   40434       _mesa_unmarshal_Fogx(ctx, (const struct marshal_cmd_Fogx *) cmd);
   40435       break;
   40436    case DISPATCH_CMD_Uniform3ui64ARB:
   40437       debug_print_unmarshal("Uniform3ui64ARB");
   40438       _mesa_unmarshal_Uniform3ui64ARB(ctx, (const struct marshal_cmd_Uniform3ui64ARB *) cmd);
   40439       break;
   40440    case DISPATCH_CMD_Fogf:
   40441       debug_print_unmarshal("Fogf");
   40442       _mesa_unmarshal_Fogf(ctx, (const struct marshal_cmd_Fogf *) cmd);
   40443       break;
   40444    case DISPATCH_CMD_ProgramUniform3ui64vARB:
   40445       debug_print_unmarshal("ProgramUniform3ui64vARB");
   40446       _mesa_unmarshal_ProgramUniform3ui64vARB(ctx, (const struct marshal_cmd_ProgramUniform3ui64vARB *) cmd);
   40447       break;
   40448    case DISPATCH_CMD_Color4usv:
   40449       debug_print_unmarshal("Color4usv");
   40450       _mesa_unmarshal_Color4usv(ctx, (const struct marshal_cmd_Color4usv *) cmd);
   40451       break;
   40452    case DISPATCH_CMD_Fogi:
   40453       debug_print_unmarshal("Fogi");
   40454       _mesa_unmarshal_Fogi(ctx, (const struct marshal_cmd_Fogi *) cmd);
   40455       break;
   40456    case DISPATCH_CMD_DepthFunc:
   40457       debug_print_unmarshal("DepthFunc");
   40458       _mesa_unmarshal_DepthFunc(ctx, (const struct marshal_cmd_DepthFunc *) cmd);
   40459       break;
   40460    case DISPATCH_CMD_VertexArrayAttribLFormat:
   40461       debug_print_unmarshal("VertexArrayAttribLFormat");
   40462       _mesa_unmarshal_VertexArrayAttribLFormat(ctx, (const struct marshal_cmd_VertexArrayAttribLFormat *) cmd);
   40463       break;
   40464    case DISPATCH_CMD_VertexAttribI4uiEXT:
   40465       debug_print_unmarshal("VertexAttribI4uiEXT");
   40466       _mesa_unmarshal_VertexAttribI4uiEXT(ctx, (const struct marshal_cmd_VertexAttribI4uiEXT *) cmd);
   40467       break;
   40468    case DISPATCH_CMD_DrawElementsInstancedBaseVertexBaseInstance:
   40469       debug_print_unmarshal("DrawElementsInstancedBaseVertexBaseInstance");
   40470       _mesa_unmarshal_DrawElementsInstancedBaseVertexBaseInstance(ctx, (const struct marshal_cmd_DrawElementsInstancedBaseVertexBaseInstance *) cmd);
   40471       break;
   40472    case DISPATCH_CMD_ProgramEnvParameter4dvARB:
   40473       debug_print_unmarshal("ProgramEnvParameter4dvARB");
   40474       _mesa_unmarshal_ProgramEnvParameter4dvARB(ctx, (const struct marshal_cmd_ProgramEnvParameter4dvARB *) cmd);
   40475       break;
   40476    case DISPATCH_CMD_CopyNamedBufferSubData:
   40477       debug_print_unmarshal("CopyNamedBufferSubData");
   40478       _mesa_unmarshal_CopyNamedBufferSubData(ctx, (const struct marshal_cmd_CopyNamedBufferSubData *) cmd);
   40479       break;
   40480    case DISPATCH_CMD_BindSampler:
   40481       debug_print_unmarshal("BindSampler");
   40482       _mesa_unmarshal_BindSampler(ctx, (const struct marshal_cmd_BindSampler *) cmd);
   40483       break;
   40484    case DISPATCH_CMD_GetQueryBufferObjectuiv:
   40485       debug_print_unmarshal("GetQueryBufferObjectuiv");
   40486       _mesa_unmarshal_GetQueryBufferObjectuiv(ctx, (const struct marshal_cmd_GetQueryBufferObjectuiv *) cmd);
   40487       break;
   40488    case DISPATCH_CMD_MultiTexCoord2fARB:
   40489       debug_print_unmarshal("MultiTexCoord2fARB");
   40490       _mesa_unmarshal_MultiTexCoord2fARB(ctx, (const struct marshal_cmd_MultiTexCoord2fARB *) cmd);
   40491       break;
   40492    case DISPATCH_CMD_Uniform1ui64ARB:
   40493       debug_print_unmarshal("Uniform1ui64ARB");
   40494       _mesa_unmarshal_Uniform1ui64ARB(ctx, (const struct marshal_cmd_Uniform1ui64ARB *) cmd);
   40495       break;
   40496    case DISPATCH_CMD_MultiTexCoord3iv:
   40497       debug_print_unmarshal("MultiTexCoord3iv");
   40498       _mesa_unmarshal_MultiTexCoord3iv(ctx, (const struct marshal_cmd_MultiTexCoord3iv *) cmd);
   40499       break;
   40500    case DISPATCH_CMD_ClearStencil:
   40501       debug_print_unmarshal("ClearStencil");
   40502       _mesa_unmarshal_ClearStencil(ctx, (const struct marshal_cmd_ClearStencil *) cmd);
   40503       break;
   40504    case DISPATCH_CMD_ClearColorIiEXT:
   40505       debug_print_unmarshal("ClearColorIiEXT");
   40506       _mesa_unmarshal_ClearColorIiEXT(ctx, (const struct marshal_cmd_ClearColorIiEXT *) cmd);
   40507       break;
   40508    case DISPATCH_CMD_LoadMatrixd:
   40509       debug_print_unmarshal("LoadMatrixd");
   40510       _mesa_unmarshal_LoadMatrixd(ctx, (const struct marshal_cmd_LoadMatrixd *) cmd);
   40511       break;
   40512    case DISPATCH_CMD_VertexP4ui:
   40513       debug_print_unmarshal("VertexP4ui");
   40514       _mesa_unmarshal_VertexP4ui(ctx, (const struct marshal_cmd_VertexP4ui *) cmd);
   40515       break;
   40516    case DISPATCH_CMD_TextureStorage3DMultisample:
   40517       debug_print_unmarshal("TextureStorage3DMultisample");
   40518       _mesa_unmarshal_TextureStorage3DMultisample(ctx, (const struct marshal_cmd_TextureStorage3DMultisample *) cmd);
   40519       break;
   40520    case DISPATCH_CMD_ReleaseShaderCompiler:
   40521       debug_print_unmarshal("ReleaseShaderCompiler");
   40522       _mesa_unmarshal_ReleaseShaderCompiler(ctx, (const struct marshal_cmd_ReleaseShaderCompiler *) cmd);
   40523       break;
   40524    case DISPATCH_CMD_BlendFuncSeparate:
   40525       debug_print_unmarshal("BlendFuncSeparate");
   40526       _mesa_unmarshal_BlendFuncSeparate(ctx, (const struct marshal_cmd_BlendFuncSeparate *) cmd);
   40527       break;
   40528    case DISPATCH_CMD_Color3us:
   40529       debug_print_unmarshal("Color3us");
   40530       _mesa_unmarshal_Color3us(ctx, (const struct marshal_cmd_Color3us *) cmd);
   40531       break;
   40532    case DISPATCH_CMD_LoadMatrixx:
   40533       debug_print_unmarshal("LoadMatrixx");
   40534       _mesa_unmarshal_LoadMatrixx(ctx, (const struct marshal_cmd_LoadMatrixx *) cmd);
   40535       break;
   40536    case DISPATCH_CMD_Color3ub:
   40537       debug_print_unmarshal("Color3ub");
   40538       _mesa_unmarshal_Color3ub(ctx, (const struct marshal_cmd_Color3ub *) cmd);
   40539       break;
   40540    case DISPATCH_CMD_Color3ui:
   40541       debug_print_unmarshal("Color3ui");
   40542       _mesa_unmarshal_Color3ui(ctx, (const struct marshal_cmd_Color3ui *) cmd);
   40543       break;
   40544    case DISPATCH_CMD_VertexAttrib4dvNV:
   40545       debug_print_unmarshal("VertexAttrib4dvNV");
   40546       _mesa_unmarshal_VertexAttrib4dvNV(ctx, (const struct marshal_cmd_VertexAttrib4dvNV *) cmd);
   40547       break;
   40548    case DISPATCH_CMD_AlphaFragmentOp2ATI:
   40549       debug_print_unmarshal("AlphaFragmentOp2ATI");
   40550       _mesa_unmarshal_AlphaFragmentOp2ATI(ctx, (const struct marshal_cmd_AlphaFragmentOp2ATI *) cmd);
   40551       break;
   40552    case DISPATCH_CMD_RasterPos4dv:
   40553       debug_print_unmarshal("RasterPos4dv");
   40554       _mesa_unmarshal_RasterPos4dv(ctx, (const struct marshal_cmd_RasterPos4dv *) cmd);
   40555       break;
   40556    case DISPATCH_CMD_LineWidthx:
   40557       debug_print_unmarshal("LineWidthx");
   40558       _mesa_unmarshal_LineWidthx(ctx, (const struct marshal_cmd_LineWidthx *) cmd);
   40559       break;
   40560    case DISPATCH_CMD_Indexdv:
   40561       debug_print_unmarshal("Indexdv");
   40562       _mesa_unmarshal_Indexdv(ctx, (const struct marshal_cmd_Indexdv *) cmd);
   40563       break;
   40564    case DISPATCH_CMD_DepthMask:
   40565       debug_print_unmarshal("DepthMask");
   40566       _mesa_unmarshal_DepthMask(ctx, (const struct marshal_cmd_DepthMask *) cmd);
   40567       break;
   40568    case DISPATCH_CMD_BindFragmentShaderATI:
   40569       debug_print_unmarshal("BindFragmentShaderATI");
   40570       _mesa_unmarshal_BindFragmentShaderATI(ctx, (const struct marshal_cmd_BindFragmentShaderATI *) cmd);
   40571       break;
   40572    case DISPATCH_CMD_BlendFuncSeparateiARB:
   40573       debug_print_unmarshal("BlendFuncSeparateiARB");
   40574       _mesa_unmarshal_BlendFuncSeparateiARB(ctx, (const struct marshal_cmd_BlendFuncSeparateiARB *) cmd);
   40575       break;
   40576    case DISPATCH_CMD_VertexPointer:
   40577       debug_print_unmarshal("VertexPointer");
   40578       _mesa_unmarshal_VertexPointer(ctx, (const struct marshal_cmd_VertexPointer *) cmd);
   40579       break;
   40580    case DISPATCH_CMD_ProgramLocalParameter4dvARB:
   40581       debug_print_unmarshal("ProgramLocalParameter4dvARB");
   40582       _mesa_unmarshal_ProgramLocalParameter4dvARB(ctx, (const struct marshal_cmd_ProgramLocalParameter4dvARB *) cmd);
   40583       break;
   40584    case DISPATCH_CMD_UniformMatrix2dv:
   40585       debug_print_unmarshal("UniformMatrix2dv");
   40586       _mesa_unmarshal_UniformMatrix2dv(ctx, (const struct marshal_cmd_UniformMatrix2dv *) cmd);
   40587       break;
   40588    case DISPATCH_CMD_UniformMatrix3x2dv:
   40589       debug_print_unmarshal("UniformMatrix3x2dv");
   40590       _mesa_unmarshal_UniformMatrix3x2dv(ctx, (const struct marshal_cmd_UniformMatrix3x2dv *) cmd);
   40591       break;
   40592    case DISPATCH_CMD_WindowPos4fMESA:
   40593       debug_print_unmarshal("WindowPos4fMESA");
   40594       _mesa_unmarshal_WindowPos4fMESA(ctx, (const struct marshal_cmd_WindowPos4fMESA *) cmd);
   40595       break;
   40596    case DISPATCH_CMD_VertexAttribs2fvNV:
   40597       debug_print_unmarshal("VertexAttribs2fvNV");
   40598       _mesa_unmarshal_VertexAttribs2fvNV(ctx, (const struct marshal_cmd_VertexAttribs2fvNV *) cmd);
   40599       break;
   40600    case DISPATCH_CMD_VertexAttribP4ui:
   40601       debug_print_unmarshal("VertexAttribP4ui");
   40602       _mesa_unmarshal_VertexAttribP4ui(ctx, (const struct marshal_cmd_VertexAttribP4ui *) cmd);
   40603       break;
   40604    case DISPATCH_CMD_Uniform4i:
   40605       debug_print_unmarshal("Uniform4i");
   40606       _mesa_unmarshal_Uniform4i(ctx, (const struct marshal_cmd_Uniform4i *) cmd);
   40607       break;
   40608    case DISPATCH_CMD_Uniform4d:
   40609       debug_print_unmarshal("Uniform4d");
   40610       _mesa_unmarshal_Uniform4d(ctx, (const struct marshal_cmd_Uniform4d *) cmd);
   40611       break;
   40612    case DISPATCH_CMD_Uniform4f:
   40613       debug_print_unmarshal("Uniform4f");
   40614       _mesa_unmarshal_Uniform4f(ctx, (const struct marshal_cmd_Uniform4f *) cmd);
   40615       break;
   40616    case DISPATCH_CMD_ProgramUniform3dv:
   40617       debug_print_unmarshal("ProgramUniform3dv");
   40618       _mesa_unmarshal_ProgramUniform3dv(ctx, (const struct marshal_cmd_ProgramUniform3dv *) cmd);
   40619       break;
   40620    case DISPATCH_CMD_NamedFramebufferTexture:
   40621       debug_print_unmarshal("NamedFramebufferTexture");
   40622       _mesa_unmarshal_NamedFramebufferTexture(ctx, (const struct marshal_cmd_NamedFramebufferTexture *) cmd);
   40623       break;
   40624    case DISPATCH_CMD_ProgramUniform3d:
   40625       debug_print_unmarshal("ProgramUniform3d");
   40626       _mesa_unmarshal_ProgramUniform3d(ctx, (const struct marshal_cmd_ProgramUniform3d *) cmd);
   40627       break;
   40628    case DISPATCH_CMD_ProgramUniform3f:
   40629       debug_print_unmarshal("ProgramUniform3f");
   40630       _mesa_unmarshal_ProgramUniform3f(ctx, (const struct marshal_cmd_ProgramUniform3f *) cmd);
   40631       break;
   40632    case DISPATCH_CMD_ProgramUniform3i:
   40633       debug_print_unmarshal("ProgramUniform3i");
   40634       _mesa_unmarshal_ProgramUniform3i(ctx, (const struct marshal_cmd_ProgramUniform3i *) cmd);
   40635       break;
   40636    case DISPATCH_CMD_SecondaryColor3s:
   40637       debug_print_unmarshal("SecondaryColor3s");
   40638       _mesa_unmarshal_SecondaryColor3s(ctx, (const struct marshal_cmd_SecondaryColor3s *) cmd);
   40639       break;
   40640    case DISPATCH_CMD_TexStorageMem2DEXT:
   40641       debug_print_unmarshal("TexStorageMem2DEXT");
   40642       _mesa_unmarshal_TexStorageMem2DEXT(ctx, (const struct marshal_cmd_TexStorageMem2DEXT *) cmd);
   40643       break;
   40644    case DISPATCH_CMD_UniformMatrix3x4dv:
   40645       debug_print_unmarshal("UniformMatrix3x4dv");
   40646       _mesa_unmarshal_UniformMatrix3x4dv(ctx, (const struct marshal_cmd_UniformMatrix3x4dv *) cmd);
   40647       break;
   40648    case DISPATCH_CMD_VertexAttrib3fNV:
   40649       debug_print_unmarshal("VertexAttrib3fNV");
   40650       _mesa_unmarshal_VertexAttrib3fNV(ctx, (const struct marshal_cmd_VertexAttrib3fNV *) cmd);
   40651       break;
   40652    case DISPATCH_CMD_SecondaryColor3b:
   40653       debug_print_unmarshal("SecondaryColor3b");
   40654       _mesa_unmarshal_SecondaryColor3b(ctx, (const struct marshal_cmd_SecondaryColor3b *) cmd);
   40655       break;
   40656    case DISPATCH_CMD_EnableClientState:
   40657       debug_print_unmarshal("EnableClientState");
   40658       _mesa_unmarshal_EnableClientState(ctx, (const struct marshal_cmd_EnableClientState *) cmd);
   40659       break;
   40660    case DISPATCH_CMD_SecondaryColor3i:
   40661       debug_print_unmarshal("SecondaryColor3i");
   40662       _mesa_unmarshal_SecondaryColor3i(ctx, (const struct marshal_cmd_SecondaryColor3i *) cmd);
   40663       break;
   40664    case DISPATCH_CMD_FlushMappedBufferRange:
   40665       debug_print_unmarshal("FlushMappedBufferRange");
   40666       _mesa_unmarshal_FlushMappedBufferRange(ctx, (const struct marshal_cmd_FlushMappedBufferRange *) cmd);
   40667       break;
   40668    case DISPATCH_CMD_TexStorageMem3DEXT:
   40669       debug_print_unmarshal("TexStorageMem3DEXT");
   40670       _mesa_unmarshal_TexStorageMem3DEXT(ctx, (const struct marshal_cmd_TexStorageMem3DEXT *) cmd);
   40671       break;
   40672    case DISPATCH_CMD_EndPerfMonitorAMD:
   40673       debug_print_unmarshal("EndPerfMonitorAMD");
   40674       _mesa_unmarshal_EndPerfMonitorAMD(ctx, (const struct marshal_cmd_EndPerfMonitorAMD *) cmd);
   40675       break;
   40676    case DISPATCH_CMD_VertexAttribs4dvNV:
   40677       debug_print_unmarshal("VertexAttribs4dvNV");
   40678       _mesa_unmarshal_VertexAttribs4dvNV(ctx, (const struct marshal_cmd_VertexAttribs4dvNV *) cmd);
   40679       break;
   40680    case DISPATCH_CMD_Uniform2i64vARB:
   40681       debug_print_unmarshal("Uniform2i64vARB");
   40682       _mesa_unmarshal_Uniform2i64vARB(ctx, (const struct marshal_cmd_Uniform2i64vARB *) cmd);
   40683       break;
   40684    case DISPATCH_CMD_Rectdv:
   40685       debug_print_unmarshal("Rectdv");
   40686       _mesa_unmarshal_Rectdv(ctx, (const struct marshal_cmd_Rectdv *) cmd);
   40687       break;
   40688    case DISPATCH_CMD_DrawArraysInstancedARB:
   40689       debug_print_unmarshal("DrawArraysInstancedARB");
   40690       _mesa_unmarshal_DrawArraysInstancedARB(ctx, (const struct marshal_cmd_DrawArraysInstancedARB *) cmd);
   40691       break;
   40692    case DISPATCH_CMD_MakeImageHandleNonResidentARB:
   40693       debug_print_unmarshal("MakeImageHandleNonResidentARB");
   40694       _mesa_unmarshal_MakeImageHandleNonResidentARB(ctx, (const struct marshal_cmd_MakeImageHandleNonResidentARB *) cmd);
   40695       break;
   40696    case DISPATCH_CMD_ImportMemoryFdEXT:
   40697       debug_print_unmarshal("ImportMemoryFdEXT");
   40698       _mesa_unmarshal_ImportMemoryFdEXT(ctx, (const struct marshal_cmd_ImportMemoryFdEXT *) cmd);
   40699       break;
   40700    case DISPATCH_CMD_TexStorageMem1DEXT:
   40701       debug_print_unmarshal("TexStorageMem1DEXT");
   40702       _mesa_unmarshal_TexStorageMem1DEXT(ctx, (const struct marshal_cmd_TexStorageMem1DEXT *) cmd);
   40703       break;
   40704    case DISPATCH_CMD_BlendBarrier:
   40705       debug_print_unmarshal("BlendBarrier");
   40706       _mesa_unmarshal_BlendBarrier(ctx, (const struct marshal_cmd_BlendBarrier *) cmd);
   40707       break;
   40708    case DISPATCH_CMD_VertexAttrib2svNV:
   40709       debug_print_unmarshal("VertexAttrib2svNV");
   40710       _mesa_unmarshal_VertexAttrib2svNV(ctx, (const struct marshal_cmd_VertexAttrib2svNV *) cmd);
   40711       break;
   40712    case DISPATCH_CMD_Disablei:
   40713       debug_print_unmarshal("Disablei");
   40714       _mesa_unmarshal_Disablei(ctx, (const struct marshal_cmd_Disablei *) cmd);
   40715       break;
   40716    case DISPATCH_CMD_Color3dv:
   40717       debug_print_unmarshal("Color3dv");
   40718       _mesa_unmarshal_Color3dv(ctx, (const struct marshal_cmd_Color3dv *) cmd);
   40719       break;
   40720    case DISPATCH_CMD_ProgramUniform1ui64ARB:
   40721       debug_print_unmarshal("ProgramUniform1ui64ARB");
   40722       _mesa_unmarshal_ProgramUniform1ui64ARB(ctx, (const struct marshal_cmd_ProgramUniform1ui64ARB *) cmd);
   40723       break;
   40724    case DISPATCH_CMD_BeginQuery:
   40725       debug_print_unmarshal("BeginQuery");
   40726       _mesa_unmarshal_BeginQuery(ctx, (const struct marshal_cmd_BeginQuery *) cmd);
   40727       break;
   40728    case DISPATCH_CMD_PixelStoref:
   40729       debug_print_unmarshal("PixelStoref");
   40730       _mesa_unmarshal_PixelStoref(ctx, (const struct marshal_cmd_PixelStoref *) cmd);
   40731       break;
   40732    case DISPATCH_CMD_PixelStorei:
   40733       debug_print_unmarshal("PixelStorei");
   40734       _mesa_unmarshal_PixelStorei(ctx, (const struct marshal_cmd_PixelStorei *) cmd);
   40735       break;
   40736    case DISPATCH_CMD_VertexAttribs1svNV:
   40737       debug_print_unmarshal("VertexAttribs1svNV");
   40738       _mesa_unmarshal_VertexAttribs1svNV(ctx, (const struct marshal_cmd_VertexAttribs1svNV *) cmd);
   40739       break;
   40740    case DISPATCH_CMD_DispatchComputeIndirect:
   40741       debug_print_unmarshal("DispatchComputeIndirect");
   40742       _mesa_unmarshal_DispatchComputeIndirect(ctx, (const struct marshal_cmd_DispatchComputeIndirect *) cmd);
   40743       break;
   40744    case DISPATCH_CMD_InvalidateBufferData:
   40745       debug_print_unmarshal("InvalidateBufferData");
   40746       _mesa_unmarshal_InvalidateBufferData(ctx, (const struct marshal_cmd_InvalidateBufferData *) cmd);
   40747       break;
   40748    case DISPATCH_CMD_Uniform1ui64vARB:
   40749       debug_print_unmarshal("Uniform1ui64vARB");
   40750       _mesa_unmarshal_Uniform1ui64vARB(ctx, (const struct marshal_cmd_Uniform1ui64vARB *) cmd);
   40751       break;
   40752    case DISPATCH_CMD_VertexAttrib1svNV:
   40753       debug_print_unmarshal("VertexAttrib1svNV");
   40754       _mesa_unmarshal_VertexAttrib1svNV(ctx, (const struct marshal_cmd_VertexAttrib1svNV *) cmd);
   40755       break;
   40756    case DISPATCH_CMD_SecondaryColor3ubv:
   40757       debug_print_unmarshal("SecondaryColor3ubv");
   40758       _mesa_unmarshal_SecondaryColor3ubv(ctx, (const struct marshal_cmd_SecondaryColor3ubv *) cmd);
   40759       break;
   40760    case DISPATCH_CMD_Uniform4ui64ARB:
   40761       debug_print_unmarshal("Uniform4ui64ARB");
   40762       _mesa_unmarshal_Uniform4ui64ARB(ctx, (const struct marshal_cmd_Uniform4ui64ARB *) cmd);
   40763       break;
   40764    case DISPATCH_CMD_RasterPos3fv:
   40765       debug_print_unmarshal("RasterPos3fv");
   40766       _mesa_unmarshal_RasterPos3fv(ctx, (const struct marshal_cmd_RasterPos3fv *) cmd);
   40767       break;
   40768    case DISPATCH_CMD_BindProgramARB:
   40769       debug_print_unmarshal("BindProgramARB");
   40770       _mesa_unmarshal_BindProgramARB(ctx, (const struct marshal_cmd_BindProgramARB *) cmd);
   40771       break;
   40772    case DISPATCH_CMD_VertexAttrib3sNV:
   40773       debug_print_unmarshal("VertexAttrib3sNV");
   40774       _mesa_unmarshal_VertexAttrib3sNV(ctx, (const struct marshal_cmd_VertexAttrib3sNV *) cmd);
   40775       break;
   40776    case DISPATCH_CMD_ColorFragmentOp1ATI:
   40777       debug_print_unmarshal("ColorFragmentOp1ATI");
   40778       _mesa_unmarshal_ColorFragmentOp1ATI(ctx, (const struct marshal_cmd_ColorFragmentOp1ATI *) cmd);
   40779       break;
   40780    case DISPATCH_CMD_ProgramUniformMatrix4x3fv:
   40781       debug_print_unmarshal("ProgramUniformMatrix4x3fv");
   40782       _mesa_unmarshal_ProgramUniformMatrix4x3fv(ctx, (const struct marshal_cmd_ProgramUniformMatrix4x3fv *) cmd);
   40783       break;
   40784    case DISPATCH_CMD_PopClientAttrib:
   40785       debug_print_unmarshal("PopClientAttrib");
   40786       _mesa_unmarshal_PopClientAttrib(ctx, (const struct marshal_cmd_PopClientAttrib *) cmd);
   40787       break;
   40788    case DISPATCH_CMD_DrawElementsInstancedARB:
   40789       debug_print_unmarshal("DrawElementsInstancedARB");
   40790       _mesa_unmarshal_DrawElementsInstancedARB(ctx, (const struct marshal_cmd_DrawElementsInstancedARB *) cmd);
   40791       break;
   40792    case DISPATCH_CMD_DisableVertexArrayAttrib:
   40793       debug_print_unmarshal("DisableVertexArrayAttrib");
   40794       _mesa_unmarshal_DisableVertexArrayAttrib(ctx, (const struct marshal_cmd_DisableVertexArrayAttrib *) cmd);
   40795       break;
   40796    case DISPATCH_CMD_VertexAttribL4d:
   40797       debug_print_unmarshal("VertexAttribL4d");
   40798       _mesa_unmarshal_VertexAttribL4d(ctx, (const struct marshal_cmd_VertexAttribL4d *) cmd);
   40799       break;
   40800    case DISPATCH_CMD_ListBase:
   40801       debug_print_unmarshal("ListBase");
   40802       _mesa_unmarshal_ListBase(ctx, (const struct marshal_cmd_ListBase *) cmd);
   40803       break;
   40804    case DISPATCH_CMD_GenerateMipmap:
   40805       debug_print_unmarshal("GenerateMipmap");
   40806       _mesa_unmarshal_GenerateMipmap(ctx, (const struct marshal_cmd_GenerateMipmap *) cmd);
   40807       break;
   40808    case DISPATCH_CMD_BindBufferRange:
   40809       debug_print_unmarshal("BindBufferRange");
   40810       _mesa_unmarshal_BindBufferRange(ctx, (const struct marshal_cmd_BindBufferRange *) cmd);
   40811       break;
   40812    case DISPATCH_CMD_ProgramUniformMatrix2x4fv:
   40813       debug_print_unmarshal("ProgramUniformMatrix2x4fv");
   40814       _mesa_unmarshal_ProgramUniformMatrix2x4fv(ctx, (const struct marshal_cmd_ProgramUniformMatrix2x4fv *) cmd);
   40815       break;
   40816    case DISPATCH_CMD_BindBufferBase:
   40817       debug_print_unmarshal("BindBufferBase");
   40818       _mesa_unmarshal_BindBufferBase(ctx, (const struct marshal_cmd_BindBufferBase *) cmd);
   40819       break;
   40820    case DISPATCH_CMD_VertexAttrib2s:
   40821       debug_print_unmarshal("VertexAttrib2s");
   40822       _mesa_unmarshal_VertexAttrib2s(ctx, (const struct marshal_cmd_VertexAttrib2s *) cmd);
   40823       break;
   40824    case DISPATCH_CMD_SecondaryColor3fvEXT:
   40825       debug_print_unmarshal("SecondaryColor3fvEXT");
   40826       _mesa_unmarshal_SecondaryColor3fvEXT(ctx, (const struct marshal_cmd_SecondaryColor3fvEXT *) cmd);
   40827       break;
   40828    case DISPATCH_CMD_VertexAttrib2d:
   40829       debug_print_unmarshal("VertexAttrib2d");
   40830       _mesa_unmarshal_VertexAttrib2d(ctx, (const struct marshal_cmd_VertexAttrib2d *) cmd);
   40831       break;
   40832    case DISPATCH_CMD_Uniform1fv:
   40833       debug_print_unmarshal("Uniform1fv");
   40834       _mesa_unmarshal_Uniform1fv(ctx, (const struct marshal_cmd_Uniform1fv *) cmd);
   40835       break;
   40836    case DISPATCH_CMD_DepthBoundsEXT:
   40837       debug_print_unmarshal("DepthBoundsEXT");
   40838       _mesa_unmarshal_DepthBoundsEXT(ctx, (const struct marshal_cmd_DepthBoundsEXT *) cmd);
   40839       break;
   40840    case DISPATCH_CMD_BufferStorageMemEXT:
   40841       debug_print_unmarshal("BufferStorageMemEXT");
   40842       _mesa_unmarshal_BufferStorageMemEXT(ctx, (const struct marshal_cmd_BufferStorageMemEXT *) cmd);
   40843       break;
   40844    case DISPATCH_CMD_WindowPos3fv:
   40845       debug_print_unmarshal("WindowPos3fv");
   40846       _mesa_unmarshal_WindowPos3fv(ctx, (const struct marshal_cmd_WindowPos3fv *) cmd);
   40847       break;
   40848    case DISPATCH_CMD_NamedRenderbufferStorage:
   40849       debug_print_unmarshal("NamedRenderbufferStorage");
   40850       _mesa_unmarshal_NamedRenderbufferStorage(ctx, (const struct marshal_cmd_NamedRenderbufferStorage *) cmd);
   40851       break;
   40852    case DISPATCH_CMD_BindRenderbuffer:
   40853       debug_print_unmarshal("BindRenderbuffer");
   40854       _mesa_unmarshal_BindRenderbuffer(ctx, (const struct marshal_cmd_BindRenderbuffer *) cmd);
   40855       break;
   40856    case DISPATCH_CMD_SecondaryColor3fEXT:
   40857       debug_print_unmarshal("SecondaryColor3fEXT");
   40858       _mesa_unmarshal_SecondaryColor3fEXT(ctx, (const struct marshal_cmd_SecondaryColor3fEXT *) cmd);
   40859       break;
   40860    case DISPATCH_CMD_PrimitiveRestartIndex:
   40861       debug_print_unmarshal("PrimitiveRestartIndex");
   40862       _mesa_unmarshal_PrimitiveRestartIndex(ctx, (const struct marshal_cmd_PrimitiveRestartIndex *) cmd);
   40863       break;
   40864    case DISPATCH_CMD_TextureStorageMem3DEXT:
   40865       debug_print_unmarshal("TextureStorageMem3DEXT");
   40866       _mesa_unmarshal_TextureStorageMem3DEXT(ctx, (const struct marshal_cmd_TextureStorageMem3DEXT *) cmd);
   40867       break;
   40868    case DISPATCH_CMD_ActiveStencilFaceEXT:
   40869       debug_print_unmarshal("ActiveStencilFaceEXT");
   40870       _mesa_unmarshal_ActiveStencilFaceEXT(ctx, (const struct marshal_cmd_ActiveStencilFaceEXT *) cmd);
   40871       break;
   40872    case DISPATCH_CMD_VertexAttrib4dNV:
   40873       debug_print_unmarshal("VertexAttrib4dNV");
   40874       _mesa_unmarshal_VertexAttrib4dNV(ctx, (const struct marshal_cmd_VertexAttrib4dNV *) cmd);
   40875       break;
   40876    case DISPATCH_CMD_DepthRange:
   40877       debug_print_unmarshal("DepthRange");
   40878       _mesa_unmarshal_DepthRange(ctx, (const struct marshal_cmd_DepthRange *) cmd);
   40879       break;
   40880    case DISPATCH_CMD_VertexAttrib4fNV:
   40881       debug_print_unmarshal("VertexAttrib4fNV");
   40882       _mesa_unmarshal_VertexAttrib4fNV(ctx, (const struct marshal_cmd_VertexAttrib4fNV *) cmd);
   40883       break;
   40884    case DISPATCH_CMD_Uniform4fv:
   40885       debug_print_unmarshal("Uniform4fv");
   40886       _mesa_unmarshal_Uniform4fv(ctx, (const struct marshal_cmd_Uniform4fv *) cmd);
   40887       break;
   40888    case DISPATCH_CMD_Frustumf:
   40889       debug_print_unmarshal("Frustumf");
   40890       _mesa_unmarshal_Frustumf(ctx, (const struct marshal_cmd_Frustumf *) cmd);
   40891       break;
   40892    case DISPATCH_CMD_GetQueryBufferObjectui64v:
   40893       debug_print_unmarshal("GetQueryBufferObjectui64v");
   40894       _mesa_unmarshal_GetQueryBufferObjectui64v(ctx, (const struct marshal_cmd_GetQueryBufferObjectui64v *) cmd);
   40895       break;
   40896    case DISPATCH_CMD_ProgramUniform2uiv:
   40897       debug_print_unmarshal("ProgramUniform2uiv");
   40898       _mesa_unmarshal_ProgramUniform2uiv(ctx, (const struct marshal_cmd_ProgramUniform2uiv *) cmd);
   40899       break;
   40900    case DISPATCH_CMD_Rectsv:
   40901       debug_print_unmarshal("Rectsv");
   40902       _mesa_unmarshal_Rectsv(ctx, (const struct marshal_cmd_Rectsv *) cmd);
   40903       break;
   40904    case DISPATCH_CMD_Frustumx:
   40905       debug_print_unmarshal("Frustumx");
   40906       _mesa_unmarshal_Frustumx(ctx, (const struct marshal_cmd_Frustumx *) cmd);
   40907       break;
   40908    case DISPATCH_CMD_CullFace:
   40909       debug_print_unmarshal("CullFace");
   40910       _mesa_unmarshal_CullFace(ctx, (const struct marshal_cmd_CullFace *) cmd);
   40911       break;
   40912    case DISPATCH_CMD_BindTexture:
   40913       debug_print_unmarshal("BindTexture");
   40914       _mesa_unmarshal_BindTexture(ctx, (const struct marshal_cmd_BindTexture *) cmd);
   40915       break;
   40916    case DISPATCH_CMD_MultiTexCoord4fARB:
   40917       debug_print_unmarshal("MultiTexCoord4fARB");
   40918       _mesa_unmarshal_MultiTexCoord4fARB(ctx, (const struct marshal_cmd_MultiTexCoord4fARB *) cmd);
   40919       break;
   40920    case DISPATCH_CMD_Uniform2ui64ARB:
   40921       debug_print_unmarshal("Uniform2ui64ARB");
   40922       _mesa_unmarshal_Uniform2ui64ARB(ctx, (const struct marshal_cmd_Uniform2ui64ARB *) cmd);
   40923       break;
   40924    case DISPATCH_CMD_BeginPerfQueryINTEL:
   40925       debug_print_unmarshal("BeginPerfQueryINTEL");
   40926       _mesa_unmarshal_BeginPerfQueryINTEL(ctx, (const struct marshal_cmd_BeginPerfQueryINTEL *) cmd);
   40927       break;
   40928    case DISPATCH_CMD_NormalPointer:
   40929       debug_print_unmarshal("NormalPointer");
   40930       _mesa_unmarshal_NormalPointer(ctx, (const struct marshal_cmd_NormalPointer *) cmd);
   40931       break;
   40932    case DISPATCH_CMD_WindowPos4iMESA:
   40933       debug_print_unmarshal("WindowPos4iMESA");
   40934       _mesa_unmarshal_WindowPos4iMESA(ctx, (const struct marshal_cmd_WindowPos4iMESA *) cmd);
   40935       break;
   40936    case DISPATCH_CMD_VertexAttrib4bv:
   40937       debug_print_unmarshal("VertexAttrib4bv");
   40938       _mesa_unmarshal_VertexAttrib4bv(ctx, (const struct marshal_cmd_VertexAttrib4bv *) cmd);
   40939       break;
   40940    case DISPATCH_CMD_SecondaryColor3usv:
   40941       debug_print_unmarshal("SecondaryColor3usv");
   40942       _mesa_unmarshal_SecondaryColor3usv(ctx, (const struct marshal_cmd_SecondaryColor3usv *) cmd);
   40943       break;
   40944    case DISPATCH_CMD_Indexfv:
   40945       debug_print_unmarshal("Indexfv");
   40946       _mesa_unmarshal_Indexfv(ctx, (const struct marshal_cmd_Indexfv *) cmd);
   40947       break;
   40948    case DISPATCH_CMD_AlphaFragmentOp1ATI:
   40949       debug_print_unmarshal("AlphaFragmentOp1ATI");
   40950       _mesa_unmarshal_AlphaFragmentOp1ATI(ctx, (const struct marshal_cmd_AlphaFragmentOp1ATI *) cmd);
   40951       break;
   40952    case DISPATCH_CMD_ProgramUniform2dv:
   40953       debug_print_unmarshal("ProgramUniform2dv");
   40954       _mesa_unmarshal_ProgramUniform2dv(ctx, (const struct marshal_cmd_ProgramUniform2dv *) cmd);
   40955       break;
   40956    case DISPATCH_CMD_MultiTexCoord3i:
   40957       debug_print_unmarshal("MultiTexCoord3i");
   40958       _mesa_unmarshal_MultiTexCoord3i(ctx, (const struct marshal_cmd_MultiTexCoord3i *) cmd);
   40959       break;
   40960    case DISPATCH_CMD_ProgramUniform1fv:
   40961       debug_print_unmarshal("ProgramUniform1fv");
   40962       _mesa_unmarshal_ProgramUniform1fv(ctx, (const struct marshal_cmd_ProgramUniform1fv *) cmd);
   40963       break;
   40964    case DISPATCH_CMD_MultiTexCoord3d:
   40965       debug_print_unmarshal("MultiTexCoord3d");
   40966       _mesa_unmarshal_MultiTexCoord3d(ctx, (const struct marshal_cmd_MultiTexCoord3d *) cmd);
   40967       break;
   40968    case DISPATCH_CMD_TexCoord3sv:
   40969       debug_print_unmarshal("TexCoord3sv");
   40970       _mesa_unmarshal_TexCoord3sv(ctx, (const struct marshal_cmd_TexCoord3sv *) cmd);
   40971       break;
   40972    case DISPATCH_CMD_Minmax:
   40973       debug_print_unmarshal("Minmax");
   40974       _mesa_unmarshal_Minmax(ctx, (const struct marshal_cmd_Minmax *) cmd);
   40975       break;
   40976    case DISPATCH_CMD_MultiTexCoord3s:
   40977       debug_print_unmarshal("MultiTexCoord3s");
   40978       _mesa_unmarshal_MultiTexCoord3s(ctx, (const struct marshal_cmd_MultiTexCoord3s *) cmd);
   40979       break;
   40980    case DISPATCH_CMD_Vertex4iv:
   40981       debug_print_unmarshal("Vertex4iv");
   40982       _mesa_unmarshal_Vertex4iv(ctx, (const struct marshal_cmd_Vertex4iv *) cmd);
   40983       break;
   40984    case DISPATCH_CMD_BufferSubData:
   40985       debug_print_unmarshal("BufferSubData");
   40986       _mesa_unmarshal_BufferSubData(ctx, (const struct marshal_cmd_BufferSubData *) cmd);
   40987       break;
   40988    case DISPATCH_CMD_TexCoord4dv:
   40989       debug_print_unmarshal("TexCoord4dv");
   40990       _mesa_unmarshal_TexCoord4dv(ctx, (const struct marshal_cmd_TexCoord4dv *) cmd);
   40991       break;
   40992    case DISPATCH_CMD_Begin:
   40993       debug_print_unmarshal("Begin");
   40994       _mesa_unmarshal_Begin(ctx, (const struct marshal_cmd_Begin *) cmd);
   40995       break;
   40996    case DISPATCH_CMD_LightModeli:
   40997       debug_print_unmarshal("LightModeli");
   40998       _mesa_unmarshal_LightModeli(ctx, (const struct marshal_cmd_LightModeli *) cmd);
   40999       break;
   41000    case DISPATCH_CMD_UniformMatrix2fv:
   41001       debug_print_unmarshal("UniformMatrix2fv");
   41002       _mesa_unmarshal_UniformMatrix2fv(ctx, (const struct marshal_cmd_UniformMatrix2fv *) cmd);
   41003       break;
   41004    case DISPATCH_CMD_LightModelf:
   41005       debug_print_unmarshal("LightModelf");
   41006       _mesa_unmarshal_LightModelf(ctx, (const struct marshal_cmd_LightModelf *) cmd);
   41007       break;
   41008    case DISPATCH_CMD_TextureStorage1D:
   41009       debug_print_unmarshal("TextureStorage1D");
   41010       _mesa_unmarshal_TextureStorage1D(ctx, (const struct marshal_cmd_TextureStorage1D *) cmd);
   41011       break;
   41012    case DISPATCH_CMD_MultiTexCoord2fvARB:
   41013       debug_print_unmarshal("MultiTexCoord2fvARB");
   41014       _mesa_unmarshal_MultiTexCoord2fvARB(ctx, (const struct marshal_cmd_MultiTexCoord2fvARB *) cmd);
   41015       break;
   41016    case DISPATCH_CMD_VertexAttrib4ubv:
   41017       debug_print_unmarshal("VertexAttrib4ubv");
   41018       _mesa_unmarshal_VertexAttrib4ubv(ctx, (const struct marshal_cmd_VertexAttrib4ubv *) cmd);
   41019       break;
   41020    case DISPATCH_CMD_ColorMask:
   41021       debug_print_unmarshal("ColorMask");
   41022       _mesa_unmarshal_ColorMask(ctx, (const struct marshal_cmd_ColorMask *) cmd);
   41023       break;
   41024    case DISPATCH_CMD_MultiTexCoord4x:
   41025       debug_print_unmarshal("MultiTexCoord4x");
   41026       _mesa_unmarshal_MultiTexCoord4x(ctx, (const struct marshal_cmd_MultiTexCoord4x *) cmd);
   41027       break;
   41028    case DISPATCH_CMD_UniformHandleui64ARB:
   41029       debug_print_unmarshal("UniformHandleui64ARB");
   41030       _mesa_unmarshal_UniformHandleui64ARB(ctx, (const struct marshal_cmd_UniformHandleui64ARB *) cmd);
   41031       break;
   41032    case DISPATCH_CMD_VertexAttribs4svNV:
   41033       debug_print_unmarshal("VertexAttribs4svNV");
   41034       _mesa_unmarshal_VertexAttribs4svNV(ctx, (const struct marshal_cmd_VertexAttribs4svNV *) cmd);
   41035       break;
   41036    case DISPATCH_CMD_DrawElementsInstancedBaseInstance:
   41037       debug_print_unmarshal("DrawElementsInstancedBaseInstance");
   41038       _mesa_unmarshal_DrawElementsInstancedBaseInstance(ctx, (const struct marshal_cmd_DrawElementsInstancedBaseInstance *) cmd);
   41039       break;
   41040    case DISPATCH_CMD_UniformMatrix4fv:
   41041       debug_print_unmarshal("UniformMatrix4fv");
   41042       _mesa_unmarshal_UniformMatrix4fv(ctx, (const struct marshal_cmd_UniformMatrix4fv *) cmd);
   41043       break;
   41044    case DISPATCH_CMD_UniformMatrix3x2fv:
   41045       debug_print_unmarshal("UniformMatrix3x2fv");
   41046       _mesa_unmarshal_UniformMatrix3x2fv(ctx, (const struct marshal_cmd_UniformMatrix3x2fv *) cmd);
   41047       break;
   41048    case DISPATCH_CMD_VertexAttrib4Nuiv:
   41049       debug_print_unmarshal("VertexAttrib4Nuiv");
   41050       _mesa_unmarshal_VertexAttrib4Nuiv(ctx, (const struct marshal_cmd_VertexAttrib4Nuiv *) cmd);
   41051       break;
   41052    case DISPATCH_CMD_ClientActiveTexture:
   41053       debug_print_unmarshal("ClientActiveTexture");
   41054       _mesa_unmarshal_ClientActiveTexture(ctx, (const struct marshal_cmd_ClientActiveTexture *) cmd);
   41055       break;
   41056    case DISPATCH_CMD_MultiTexCoord2sv:
   41057       debug_print_unmarshal("MultiTexCoord2sv");
   41058       _mesa_unmarshal_MultiTexCoord2sv(ctx, (const struct marshal_cmd_MultiTexCoord2sv *) cmd);
   41059       break;
   41060    case DISPATCH_CMD_NamedFramebufferDrawBuffer:
   41061       debug_print_unmarshal("NamedFramebufferDrawBuffer");
   41062       _mesa_unmarshal_NamedFramebufferDrawBuffer(ctx, (const struct marshal_cmd_NamedFramebufferDrawBuffer *) cmd);
   41063       break;
   41064    case DISPATCH_CMD_NamedFramebufferTextureLayer:
   41065       debug_print_unmarshal("NamedFramebufferTextureLayer");
   41066       _mesa_unmarshal_NamedFramebufferTextureLayer(ctx, (const struct marshal_cmd_NamedFramebufferTextureLayer *) cmd);
   41067       break;
   41068    case DISPATCH_CMD_LoadIdentity:
   41069       debug_print_unmarshal("LoadIdentity");
   41070       _mesa_unmarshal_LoadIdentity(ctx, (const struct marshal_cmd_LoadIdentity *) cmd);
   41071       break;
   41072    case DISPATCH_CMD_ActiveShaderProgram:
   41073       debug_print_unmarshal("ActiveShaderProgram");
   41074       _mesa_unmarshal_ActiveShaderProgram(ctx, (const struct marshal_cmd_ActiveShaderProgram *) cmd);
   41075       break;
   41076    case DISPATCH_CMD_VertexAttrib4ubvNV:
   41077       debug_print_unmarshal("VertexAttrib4ubvNV");
   41078       _mesa_unmarshal_VertexAttrib4ubvNV(ctx, (const struct marshal_cmd_VertexAttrib4ubvNV *) cmd);
   41079       break;
   41080    case DISPATCH_CMD_FogCoordfEXT:
   41081       debug_print_unmarshal("FogCoordfEXT");
   41082       _mesa_unmarshal_FogCoordfEXT(ctx, (const struct marshal_cmd_FogCoordfEXT *) cmd);
   41083       break;
   41084    case DISPATCH_CMD_BindTransformFeedback:
   41085       debug_print_unmarshal("BindTransformFeedback");
   41086       _mesa_unmarshal_BindTransformFeedback(ctx, (const struct marshal_cmd_BindTransformFeedback *) cmd);
   41087       break;
   41088    case DISPATCH_CMD_TextureBufferRange:
   41089       debug_print_unmarshal("TextureBufferRange");
   41090       _mesa_unmarshal_TextureBufferRange(ctx, (const struct marshal_cmd_TextureBufferRange *) cmd);
   41091       break;
   41092    case DISPATCH_CMD_VertexAttrib4svNV:
   41093       debug_print_unmarshal("VertexAttrib4svNV");
   41094       _mesa_unmarshal_VertexAttrib4svNV(ctx, (const struct marshal_cmd_VertexAttrib4svNV *) cmd);
   41095       break;
   41096    case DISPATCH_CMD_PatchParameteri:
   41097       debug_print_unmarshal("PatchParameteri");
   41098       _mesa_unmarshal_PatchParameteri(ctx, (const struct marshal_cmd_PatchParameteri *) cmd);
   41099       break;
   41100    case DISPATCH_CMD_VDPAUSurfaceAccessNV:
   41101       debug_print_unmarshal("VDPAUSurfaceAccessNV");
   41102       _mesa_unmarshal_VDPAUSurfaceAccessNV(ctx, (const struct marshal_cmd_VDPAUSurfaceAccessNV *) cmd);
   41103       break;
   41104    case DISPATCH_CMD_EdgeFlagPointer:
   41105       debug_print_unmarshal("EdgeFlagPointer");
   41106       _mesa_unmarshal_EdgeFlagPointer(ctx, (const struct marshal_cmd_EdgeFlagPointer *) cmd);
   41107       break;
   41108    case DISPATCH_CMD_WindowPos2f:
   41109       debug_print_unmarshal("WindowPos2f");
   41110       _mesa_unmarshal_WindowPos2f(ctx, (const struct marshal_cmd_WindowPos2f *) cmd);
   41111       break;
   41112    case DISPATCH_CMD_WindowPos2d:
   41113       debug_print_unmarshal("WindowPos2d");
   41114       _mesa_unmarshal_WindowPos2d(ctx, (const struct marshal_cmd_WindowPos2d *) cmd);
   41115       break;
   41116    case DISPATCH_CMD_WindowPos2i:
   41117       debug_print_unmarshal("WindowPos2i");
   41118       _mesa_unmarshal_WindowPos2i(ctx, (const struct marshal_cmd_WindowPos2i *) cmd);
   41119       break;
   41120    case DISPATCH_CMD_WindowPos2s:
   41121       debug_print_unmarshal("WindowPos2s");
   41122       _mesa_unmarshal_WindowPos2s(ctx, (const struct marshal_cmd_WindowPos2s *) cmd);
   41123       break;
   41124    case DISPATCH_CMD_VertexAttribI1uiEXT:
   41125       debug_print_unmarshal("VertexAttribI1uiEXT");
   41126       _mesa_unmarshal_VertexAttribI1uiEXT(ctx, (const struct marshal_cmd_VertexAttribI1uiEXT *) cmd);
   41127       break;
   41128    case DISPATCH_CMD_DeleteSync:
   41129       debug_print_unmarshal("DeleteSync");
   41130       _mesa_unmarshal_DeleteSync(ctx, (const struct marshal_cmd_DeleteSync *) cmd);
   41131       break;
   41132    case DISPATCH_CMD_SecondaryColor3dv:
   41133       debug_print_unmarshal("SecondaryColor3dv");
   41134       _mesa_unmarshal_SecondaryColor3dv(ctx, (const struct marshal_cmd_SecondaryColor3dv *) cmd);
   41135       break;
   41136    case DISPATCH_CMD_VertexAttrib3s:
   41137       debug_print_unmarshal("VertexAttrib3s");
   41138       _mesa_unmarshal_VertexAttrib3s(ctx, (const struct marshal_cmd_VertexAttrib3s *) cmd);
   41139       break;
   41140    case DISPATCH_CMD_UniformMatrix4x3fv:
   41141       debug_print_unmarshal("UniformMatrix4x3fv");
   41142       _mesa_unmarshal_UniformMatrix4x3fv(ctx, (const struct marshal_cmd_UniformMatrix4x3fv *) cmd);
   41143       break;
   41144    case DISPATCH_CMD_VertexAttrib3d:
   41145       debug_print_unmarshal("VertexAttrib3d");
   41146       _mesa_unmarshal_VertexAttrib3d(ctx, (const struct marshal_cmd_VertexAttrib3d *) cmd);
   41147       break;
   41148    case DISPATCH_CMD_VertexAttrib4Nbv:
   41149       debug_print_unmarshal("VertexAttrib4Nbv");
   41150       _mesa_unmarshal_VertexAttrib4Nbv(ctx, (const struct marshal_cmd_VertexAttrib4Nbv *) cmd);
   41151       break;
   41152    case DISPATCH_CMD_InvalidateTexImage:
   41153       debug_print_unmarshal("InvalidateTexImage");
   41154       _mesa_unmarshal_InvalidateTexImage(ctx, (const struct marshal_cmd_InvalidateTexImage *) cmd);
   41155       break;
   41156    case DISPATCH_CMD_Uniform4ui:
   41157       debug_print_unmarshal("Uniform4ui");
   41158       _mesa_unmarshal_Uniform4ui(ctx, (const struct marshal_cmd_Uniform4ui *) cmd);
   41159       break;
   41160    case DISPATCH_CMD_VertexArrayAttribFormat:
   41161       debug_print_unmarshal("VertexArrayAttribFormat");
   41162       _mesa_unmarshal_VertexArrayAttribFormat(ctx, (const struct marshal_cmd_VertexArrayAttribFormat *) cmd);
   41163       break;
   41164    case DISPATCH_CMD_VertexAttrib1fARB:
   41165       debug_print_unmarshal("VertexAttrib1fARB");
   41166       _mesa_unmarshal_VertexAttrib1fARB(ctx, (const struct marshal_cmd_VertexAttrib1fARB *) cmd);
   41167       break;
   41168    case DISPATCH_CMD_DrawTexsOES:
   41169       debug_print_unmarshal("DrawTexsOES");
   41170       _mesa_unmarshal_DrawTexsOES(ctx, (const struct marshal_cmd_DrawTexsOES *) cmd);
   41171       break;
   41172    case DISPATCH_CMD_ProgramParameteri:
   41173       debug_print_unmarshal("ProgramParameteri");
   41174       _mesa_unmarshal_ProgramParameteri(ctx, (const struct marshal_cmd_ProgramParameteri *) cmd);
   41175       break;
   41176    case DISPATCH_CMD_Color3fv:
   41177       debug_print_unmarshal("Color3fv");
   41178       _mesa_unmarshal_Color3fv(ctx, (const struct marshal_cmd_Color3fv *) cmd);
   41179       break;
   41180    case DISPATCH_CMD_MultiTexCoord2i:
   41181       debug_print_unmarshal("MultiTexCoord2i");
   41182       _mesa_unmarshal_MultiTexCoord2i(ctx, (const struct marshal_cmd_MultiTexCoord2i *) cmd);
   41183       break;
   41184    case DISPATCH_CMD_MultiTexCoord2d:
   41185       debug_print_unmarshal("MultiTexCoord2d");
   41186       _mesa_unmarshal_MultiTexCoord2d(ctx, (const struct marshal_cmd_MultiTexCoord2d *) cmd);
   41187       break;
   41188    case DISPATCH_CMD_MultiTexCoord2s:
   41189       debug_print_unmarshal("MultiTexCoord2s");
   41190       _mesa_unmarshal_MultiTexCoord2s(ctx, (const struct marshal_cmd_MultiTexCoord2s *) cmd);
   41191       break;
   41192    case DISPATCH_CMD_Indexub:
   41193       debug_print_unmarshal("Indexub");
   41194       _mesa_unmarshal_Indexub(ctx, (const struct marshal_cmd_Indexub *) cmd);
   41195       break;
   41196    case DISPATCH_CMD_PolygonOffsetEXT:
   41197       debug_print_unmarshal("PolygonOffsetEXT");
   41198       _mesa_unmarshal_PolygonOffsetEXT(ctx, (const struct marshal_cmd_PolygonOffsetEXT *) cmd);
   41199       break;
   41200    case DISPATCH_CMD_Scalex:
   41201       debug_print_unmarshal("Scalex");
   41202       _mesa_unmarshal_Scalex(ctx, (const struct marshal_cmd_Scalex *) cmd);
   41203       break;
   41204    case DISPATCH_CMD_Scaled:
   41205       debug_print_unmarshal("Scaled");
   41206       _mesa_unmarshal_Scaled(ctx, (const struct marshal_cmd_Scaled *) cmd);
   41207       break;
   41208    case DISPATCH_CMD_Scalef:
   41209       debug_print_unmarshal("Scalef");
   41210       _mesa_unmarshal_Scalef(ctx, (const struct marshal_cmd_Scalef *) cmd);
   41211       break;
   41212    case DISPATCH_CMD_IndexPointerEXT:
   41213       debug_print_unmarshal("IndexPointerEXT");
   41214       _mesa_unmarshal_IndexPointerEXT(ctx, (const struct marshal_cmd_IndexPointerEXT *) cmd);
   41215       break;
   41216    case DISPATCH_CMD_ColorFragmentOp2ATI:
   41217       debug_print_unmarshal("ColorFragmentOp2ATI");
   41218       _mesa_unmarshal_ColorFragmentOp2ATI(ctx, (const struct marshal_cmd_ColorFragmentOp2ATI *) cmd);
   41219       break;
   41220    case DISPATCH_CMD_VertexAttrib2sNV:
   41221       debug_print_unmarshal("VertexAttrib2sNV");
   41222       _mesa_unmarshal_VertexAttrib2sNV(ctx, (const struct marshal_cmd_VertexAttrib2sNV *) cmd);
   41223       break;
   41224    case DISPATCH_CMD_QueryCounter:
   41225       debug_print_unmarshal("QueryCounter");
   41226       _mesa_unmarshal_QueryCounter(ctx, (const struct marshal_cmd_QueryCounter *) cmd);
   41227       break;
   41228    case DISPATCH_CMD_NormalPointerEXT:
   41229       debug_print_unmarshal("NormalPointerEXT");
   41230       _mesa_unmarshal_NormalPointerEXT(ctx, (const struct marshal_cmd_NormalPointerEXT *) cmd);
   41231       break;
   41232    case DISPATCH_CMD_ProgramUniform3iv:
   41233       debug_print_unmarshal("ProgramUniform3iv");
   41234       _mesa_unmarshal_ProgramUniform3iv(ctx, (const struct marshal_cmd_ProgramUniform3iv *) cmd);
   41235       break;
   41236    case DISPATCH_CMD_ProgramUniformMatrix2dv:
   41237       debug_print_unmarshal("ProgramUniformMatrix2dv");
   41238       _mesa_unmarshal_ProgramUniformMatrix2dv(ctx, (const struct marshal_cmd_ProgramUniformMatrix2dv *) cmd);
   41239       break;
   41240    case DISPATCH_CMD_DrawElementsBaseVertex:
   41241       debug_print_unmarshal("DrawElementsBaseVertex");
   41242       _mesa_unmarshal_DrawElementsBaseVertex(ctx, (const struct marshal_cmd_DrawElementsBaseVertex *) cmd);
   41243       break;
   41244    case DISPATCH_CMD_RasterPos3iv:
   41245       debug_print_unmarshal("RasterPos3iv");
   41246       _mesa_unmarshal_RasterPos3iv(ctx, (const struct marshal_cmd_RasterPos3iv *) cmd);
   41247       break;
   41248    case DISPATCH_CMD_ColorMaski:
   41249       debug_print_unmarshal("ColorMaski");
   41250       _mesa_unmarshal_ColorMaski(ctx, (const struct marshal_cmd_ColorMaski *) cmd);
   41251       break;
   41252    case DISPATCH_CMD_Uniform2uiv:
   41253       debug_print_unmarshal("Uniform2uiv");
   41254       _mesa_unmarshal_Uniform2uiv(ctx, (const struct marshal_cmd_Uniform2uiv *) cmd);
   41255       break;
   41256    case DISPATCH_CMD_RasterPos3s:
   41257       debug_print_unmarshal("RasterPos3s");
   41258       _mesa_unmarshal_RasterPos3s(ctx, (const struct marshal_cmd_RasterPos3s *) cmd);
   41259       break;
   41260    case DISPATCH_CMD_RasterPos3d:
   41261       debug_print_unmarshal("RasterPos3d");
   41262       _mesa_unmarshal_RasterPos3d(ctx, (const struct marshal_cmd_RasterPos3d *) cmd);
   41263       break;
   41264    case DISPATCH_CMD_RasterPos3f:
   41265       debug_print_unmarshal("RasterPos3f");
   41266       _mesa_unmarshal_RasterPos3f(ctx, (const struct marshal_cmd_RasterPos3f *) cmd);
   41267       break;
   41268    case DISPATCH_CMD_BindVertexArray:
   41269       debug_print_unmarshal("BindVertexArray");
   41270       _mesa_unmarshal_BindVertexArray(ctx, (const struct marshal_cmd_BindVertexArray *) cmd);
   41271       break;
   41272    case DISPATCH_CMD_RasterPos3i:
   41273       debug_print_unmarshal("RasterPos3i");
   41274       _mesa_unmarshal_RasterPos3i(ctx, (const struct marshal_cmd_RasterPos3i *) cmd);
   41275       break;
   41276    case DISPATCH_CMD_DrawTransformFeedbackStreamInstanced:
   41277       debug_print_unmarshal("DrawTransformFeedbackStreamInstanced");
   41278       _mesa_unmarshal_DrawTransformFeedbackStreamInstanced(ctx, (const struct marshal_cmd_DrawTransformFeedbackStreamInstanced *) cmd);
   41279       break;
   41280    case DISPATCH_CMD_VertexAttrib2fvARB:
   41281       debug_print_unmarshal("VertexAttrib2fvARB");
   41282       _mesa_unmarshal_VertexAttrib2fvARB(ctx, (const struct marshal_cmd_VertexAttrib2fvARB *) cmd);
   41283       break;
   41284    case DISPATCH_CMD_ProgramUniformMatrix4x3dv:
   41285       debug_print_unmarshal("ProgramUniformMatrix4x3dv");
   41286       _mesa_unmarshal_ProgramUniformMatrix4x3dv(ctx, (const struct marshal_cmd_ProgramUniformMatrix4x3dv *) cmd);
   41287       break;
   41288    case DISPATCH_CMD_LoadName:
   41289       debug_print_unmarshal("LoadName");
   41290       _mesa_unmarshal_LoadName(ctx, (const struct marshal_cmd_LoadName *) cmd);
   41291       break;
   41292    case DISPATCH_CMD_ClearIndex:
   41293       debug_print_unmarshal("ClearIndex");
   41294       _mesa_unmarshal_ClearIndex(ctx, (const struct marshal_cmd_ClearIndex *) cmd);
   41295       break;
   41296    case DISPATCH_CMD_FlushMappedNamedBufferRange:
   41297       debug_print_unmarshal("FlushMappedNamedBufferRange");
   41298       _mesa_unmarshal_FlushMappedNamedBufferRange(ctx, (const struct marshal_cmd_FlushMappedNamedBufferRange *) cmd);
   41299       break;
   41300    case DISPATCH_CMD_MultiTexCoordP1ui:
   41301       debug_print_unmarshal("MultiTexCoordP1ui");
   41302       _mesa_unmarshal_MultiTexCoordP1ui(ctx, (const struct marshal_cmd_MultiTexCoordP1ui *) cmd);
   41303       break;
   41304    case DISPATCH_CMD_EvalMesh2:
   41305       debug_print_unmarshal("EvalMesh2");
   41306       _mesa_unmarshal_EvalMesh2(ctx, (const struct marshal_cmd_EvalMesh2 *) cmd);
   41307       break;
   41308    case DISPATCH_CMD_Vertex4fv:
   41309       debug_print_unmarshal("Vertex4fv");
   41310       _mesa_unmarshal_Vertex4fv(ctx, (const struct marshal_cmd_Vertex4fv *) cmd);
   41311       break;
   41312    case DISPATCH_CMD_ProgramUniform4i64ARB:
   41313       debug_print_unmarshal("ProgramUniform4i64ARB");
   41314       _mesa_unmarshal_ProgramUniform4i64ARB(ctx, (const struct marshal_cmd_ProgramUniform4i64ARB *) cmd);
   41315       break;
   41316    case DISPATCH_CMD_TextureStorage2D:
   41317       debug_print_unmarshal("TextureStorage2D");
   41318       _mesa_unmarshal_TextureStorage2D(ctx, (const struct marshal_cmd_TextureStorage2D *) cmd);
   41319       break;
   41320    case DISPATCH_CMD_BindFramebuffer:
   41321       debug_print_unmarshal("BindFramebuffer");
   41322       _mesa_unmarshal_BindFramebuffer(ctx, (const struct marshal_cmd_BindFramebuffer *) cmd);
   41323       break;
   41324    case DISPATCH_CMD_VertexAttribs3svNV:
   41325       debug_print_unmarshal("VertexAttribs3svNV");
   41326       _mesa_unmarshal_VertexAttribs3svNV(ctx, (const struct marshal_cmd_VertexAttribs3svNV *) cmd);
   41327       break;
   41328    case DISPATCH_CMD_VertexAttrib2sv:
   41329       debug_print_unmarshal("VertexAttrib2sv");
   41330       _mesa_unmarshal_VertexAttrib2sv(ctx, (const struct marshal_cmd_VertexAttrib2sv *) cmd);
   41331       break;
   41332    case DISPATCH_CMD_Uniform1dv:
   41333       debug_print_unmarshal("Uniform1dv");
   41334       _mesa_unmarshal_Uniform1dv(ctx, (const struct marshal_cmd_Uniform1dv *) cmd);
   41335       break;
   41336    case DISPATCH_CMD_TransformFeedbackBufferRange:
   41337       debug_print_unmarshal("TransformFeedbackBufferRange");
   41338       _mesa_unmarshal_TransformFeedbackBufferRange(ctx, (const struct marshal_cmd_TransformFeedbackBufferRange *) cmd);
   41339       break;
   41340    case DISPATCH_CMD_PassThrough:
   41341       debug_print_unmarshal("PassThrough");
   41342       _mesa_unmarshal_PassThrough(ctx, (const struct marshal_cmd_PassThrough *) cmd);
   41343       break;
   41344    case DISPATCH_CMD_VertexAttrib4fvARB:
   41345       debug_print_unmarshal("VertexAttrib4fvARB");
   41346       _mesa_unmarshal_VertexAttrib4fvARB(ctx, (const struct marshal_cmd_VertexAttrib4fvARB *) cmd);
   41347       break;
   41348    case DISPATCH_CMD_Uniform3i64vARB:
   41349       debug_print_unmarshal("Uniform3i64vARB");
   41350       _mesa_unmarshal_Uniform3i64vARB(ctx, (const struct marshal_cmd_Uniform3i64vARB *) cmd);
   41351       break;
   41352    case DISPATCH_CMD_TexGenxOES:
   41353       debug_print_unmarshal("TexGenxOES");
   41354       _mesa_unmarshal_TexGenxOES(ctx, (const struct marshal_cmd_TexGenxOES *) cmd);
   41355       break;
   41356    case DISPATCH_CMD_VertexArrayAttribIFormat:
   41357       debug_print_unmarshal("VertexArrayAttribIFormat");
   41358       _mesa_unmarshal_VertexArrayAttribIFormat(ctx, (const struct marshal_cmd_VertexArrayAttribIFormat *) cmd);
   41359       break;
   41360    case DISPATCH_CMD_StencilOp:
   41361       debug_print_unmarshal("StencilOp");
   41362       _mesa_unmarshal_StencilOp(ctx, (const struct marshal_cmd_StencilOp *) cmd);
   41363       break;
   41364    case DISPATCH_CMD_ProgramUniform1iv:
   41365       debug_print_unmarshal("ProgramUniform1iv");
   41366       _mesa_unmarshal_ProgramUniform1iv(ctx, (const struct marshal_cmd_ProgramUniform1iv *) cmd);
   41367       break;
   41368    case DISPATCH_CMD_ProgramUniform3ui:
   41369       debug_print_unmarshal("ProgramUniform3ui");
   41370       _mesa_unmarshal_ProgramUniform3ui(ctx, (const struct marshal_cmd_ProgramUniform3ui *) cmd);
   41371       break;
   41372    case DISPATCH_CMD_SecondaryColor3sv:
   41373       debug_print_unmarshal("SecondaryColor3sv");
   41374       _mesa_unmarshal_SecondaryColor3sv(ctx, (const struct marshal_cmd_SecondaryColor3sv *) cmd);
   41375       break;
   41376    case DISPATCH_CMD_TexCoordP3ui:
   41377       debug_print_unmarshal("TexCoordP3ui");
   41378       _mesa_unmarshal_TexCoordP3ui(ctx, (const struct marshal_cmd_TexCoordP3ui *) cmd);
   41379       break;
   41380    case DISPATCH_CMD_VertexArrayElementBuffer:
   41381       debug_print_unmarshal("VertexArrayElementBuffer");
   41382       _mesa_unmarshal_VertexArrayElementBuffer(ctx, (const struct marshal_cmd_VertexArrayElementBuffer *) cmd);
   41383       break;
   41384    case DISPATCH_CMD_Uniform3i64ARB:
   41385       debug_print_unmarshal("Uniform3i64ARB");
   41386       _mesa_unmarshal_Uniform3i64ARB(ctx, (const struct marshal_cmd_Uniform3i64ARB *) cmd);
   41387       break;
   41388    case DISPATCH_CMD_VertexAttribP1ui:
   41389       debug_print_unmarshal("VertexAttribP1ui");
   41390       _mesa_unmarshal_VertexAttribP1ui(ctx, (const struct marshal_cmd_VertexAttribP1ui *) cmd);
   41391       break;
   41392    case DISPATCH_CMD_DeleteLists:
   41393       debug_print_unmarshal("DeleteLists");
   41394       _mesa_unmarshal_DeleteLists(ctx, (const struct marshal_cmd_DeleteLists *) cmd);
   41395       break;
   41396    case DISPATCH_CMD_LogicOp:
   41397       debug_print_unmarshal("LogicOp");
   41398       _mesa_unmarshal_LogicOp(ctx, (const struct marshal_cmd_LogicOp *) cmd);
   41399       break;
   41400    case DISPATCH_CMD_RenderbufferStorageMultisample:
   41401       debug_print_unmarshal("RenderbufferStorageMultisample");
   41402       _mesa_unmarshal_RenderbufferStorageMultisample(ctx, (const struct marshal_cmd_RenderbufferStorageMultisample *) cmd);
   41403       break;
   41404    case DISPATCH_CMD_WindowPos3d:
   41405       debug_print_unmarshal("WindowPos3d");
   41406       _mesa_unmarshal_WindowPos3d(ctx, (const struct marshal_cmd_WindowPos3d *) cmd);
   41407       break;
   41408    case DISPATCH_CMD_Enablei:
   41409       debug_print_unmarshal("Enablei");
   41410       _mesa_unmarshal_Enablei(ctx, (const struct marshal_cmd_Enablei *) cmd);
   41411       break;
   41412    case DISPATCH_CMD_WindowPos3f:
   41413       debug_print_unmarshal("WindowPos3f");
   41414       _mesa_unmarshal_WindowPos3f(ctx, (const struct marshal_cmd_WindowPos3f *) cmd);
   41415       break;
   41416    case DISPATCH_CMD_RasterPos2sv:
   41417       debug_print_unmarshal("RasterPos2sv");
   41418       _mesa_unmarshal_RasterPos2sv(ctx, (const struct marshal_cmd_RasterPos2sv *) cmd);
   41419       break;
   41420    case DISPATCH_CMD_WindowPos3i:
   41421       debug_print_unmarshal("WindowPos3i");
   41422       _mesa_unmarshal_WindowPos3i(ctx, (const struct marshal_cmd_WindowPos3i *) cmd);
   41423       break;
   41424    case DISPATCH_CMD_MultiTexCoord4iv:
   41425       debug_print_unmarshal("MultiTexCoord4iv");
   41426       _mesa_unmarshal_MultiTexCoord4iv(ctx, (const struct marshal_cmd_MultiTexCoord4iv *) cmd);
   41427       break;
   41428    case DISPATCH_CMD_TexCoord1sv:
   41429       debug_print_unmarshal("TexCoord1sv");
   41430       _mesa_unmarshal_TexCoord1sv(ctx, (const struct marshal_cmd_TexCoord1sv *) cmd);
   41431       break;
   41432    case DISPATCH_CMD_WindowPos3s:
   41433       debug_print_unmarshal("WindowPos3s");
   41434       _mesa_unmarshal_WindowPos3s(ctx, (const struct marshal_cmd_WindowPos3s *) cmd);
   41435       break;
   41436    case DISPATCH_CMD_Orthof:
   41437       debug_print_unmarshal("Orthof");
   41438       _mesa_unmarshal_Orthof(ctx, (const struct marshal_cmd_Orthof *) cmd);
   41439       break;
   41440    case DISPATCH_CMD_DeleteObjectARB:
   41441       debug_print_unmarshal("DeleteObjectARB");
   41442       _mesa_unmarshal_DeleteObjectARB(ctx, (const struct marshal_cmd_DeleteObjectARB *) cmd);
   41443       break;
   41444    case DISPATCH_CMD_ProgramUniformMatrix2x3dv:
   41445       debug_print_unmarshal("ProgramUniformMatrix2x3dv");
   41446       _mesa_unmarshal_ProgramUniformMatrix2x3dv(ctx, (const struct marshal_cmd_ProgramUniformMatrix2x3dv *) cmd);
   41447       break;
   41448    case DISPATCH_CMD_Color4uiv:
   41449       debug_print_unmarshal("Color4uiv");
   41450       _mesa_unmarshal_Color4uiv(ctx, (const struct marshal_cmd_Color4uiv *) cmd);
   41451       break;
   41452    case DISPATCH_CMD_MultiTexCoord1sv:
   41453       debug_print_unmarshal("MultiTexCoord1sv");
   41454       _mesa_unmarshal_MultiTexCoord1sv(ctx, (const struct marshal_cmd_MultiTexCoord1sv *) cmd);
   41455       break;
   41456    case DISPATCH_CMD_Orthox:
   41457       debug_print_unmarshal("Orthox");
   41458       _mesa_unmarshal_Orthox(ctx, (const struct marshal_cmd_Orthox *) cmd);
   41459       break;
   41460    case DISPATCH_CMD_PushAttrib:
   41461       debug_print_unmarshal("PushAttrib");
   41462       _mesa_unmarshal_PushAttrib(ctx, (const struct marshal_cmd_PushAttrib *) cmd);
   41463       break;
   41464    case DISPATCH_CMD_RasterPos2i:
   41465       debug_print_unmarshal("RasterPos2i");
   41466       _mesa_unmarshal_RasterPos2i(ctx, (const struct marshal_cmd_RasterPos2i *) cmd);
   41467       break;
   41468    case DISPATCH_CMD_ClipPlane:
   41469       debug_print_unmarshal("ClipPlane");
   41470       _mesa_unmarshal_ClipPlane(ctx, (const struct marshal_cmd_ClipPlane *) cmd);
   41471       break;
   41472    case DISPATCH_CMD_RasterPos2f:
   41473       debug_print_unmarshal("RasterPos2f");
   41474       _mesa_unmarshal_RasterPos2f(ctx, (const struct marshal_cmd_RasterPos2f *) cmd);
   41475       break;
   41476    case DISPATCH_CMD_RasterPos2d:
   41477       debug_print_unmarshal("RasterPos2d");
   41478       _mesa_unmarshal_RasterPos2d(ctx, (const struct marshal_cmd_RasterPos2d *) cmd);
   41479       break;
   41480    case DISPATCH_CMD_MakeImageHandleResidentARB:
   41481       debug_print_unmarshal("MakeImageHandleResidentARB");
   41482       _mesa_unmarshal_MakeImageHandleResidentARB(ctx, (const struct marshal_cmd_MakeImageHandleResidentARB *) cmd);
   41483       break;
   41484    case DISPATCH_CMD_InvalidateSubFramebuffer:
   41485       debug_print_unmarshal("InvalidateSubFramebuffer");
   41486       _mesa_unmarshal_InvalidateSubFramebuffer(ctx, (const struct marshal_cmd_InvalidateSubFramebuffer *) cmd);
   41487       break;
   41488    case DISPATCH_CMD_Color4ub:
   41489       debug_print_unmarshal("Color4ub");
   41490       _mesa_unmarshal_Color4ub(ctx, (const struct marshal_cmd_Color4ub *) cmd);
   41491       break;
   41492    case DISPATCH_CMD_UniformMatrix2x4dv:
   41493       debug_print_unmarshal("UniformMatrix2x4dv");
   41494       _mesa_unmarshal_UniformMatrix2x4dv(ctx, (const struct marshal_cmd_UniformMatrix2x4dv *) cmd);
   41495       break;
   41496    case DISPATCH_CMD_RasterPos2s:
   41497       debug_print_unmarshal("RasterPos2s");
   41498       _mesa_unmarshal_RasterPos2s(ctx, (const struct marshal_cmd_RasterPos2s *) cmd);
   41499       break;
   41500    case DISPATCH_CMD_DispatchComputeGroupSizeARB:
   41501       debug_print_unmarshal("DispatchComputeGroupSizeARB");
   41502       _mesa_unmarshal_DispatchComputeGroupSizeARB(ctx, (const struct marshal_cmd_DispatchComputeGroupSizeARB *) cmd);
   41503       break;
   41504    case DISPATCH_CMD_VertexArrayBindingDivisor:
   41505       debug_print_unmarshal("VertexArrayBindingDivisor");
   41506       _mesa_unmarshal_VertexArrayBindingDivisor(ctx, (const struct marshal_cmd_VertexArrayBindingDivisor *) cmd);
   41507       break;
   41508    case DISPATCH_CMD_MultiTexCoord3dv:
   41509       debug_print_unmarshal("MultiTexCoord3dv");
   41510       _mesa_unmarshal_MultiTexCoord3dv(ctx, (const struct marshal_cmd_MultiTexCoord3dv *) cmd);
   41511       break;
   41512    case DISPATCH_CMD_BindProgramPipeline:
   41513       debug_print_unmarshal("BindProgramPipeline");
   41514       _mesa_unmarshal_BindProgramPipeline(ctx, (const struct marshal_cmd_BindProgramPipeline *) cmd);
   41515       break;
   41516    case DISPATCH_CMD_MultiTexCoord1i:
   41517       debug_print_unmarshal("MultiTexCoord1i");
   41518       _mesa_unmarshal_MultiTexCoord1i(ctx, (const struct marshal_cmd_MultiTexCoord1i *) cmd);
   41519       break;
   41520    case DISPATCH_CMD_DeletePerfQueryINTEL:
   41521       debug_print_unmarshal("DeletePerfQueryINTEL");
   41522       _mesa_unmarshal_DeletePerfQueryINTEL(ctx, (const struct marshal_cmd_DeletePerfQueryINTEL *) cmd);
   41523       break;
   41524    case DISPATCH_CMD_MultiTexCoord1d:
   41525       debug_print_unmarshal("MultiTexCoord1d");
   41526       _mesa_unmarshal_MultiTexCoord1d(ctx, (const struct marshal_cmd_MultiTexCoord1d *) cmd);
   41527       break;
   41528    case DISPATCH_CMD_MultiTexCoord1s:
   41529       debug_print_unmarshal("MultiTexCoord1s");
   41530       _mesa_unmarshal_MultiTexCoord1s(ctx, (const struct marshal_cmd_MultiTexCoord1s *) cmd);
   41531       break;
   41532    case DISPATCH_CMD_BeginConditionalRender:
   41533       debug_print_unmarshal("BeginConditionalRender");
   41534       _mesa_unmarshal_BeginConditionalRender(ctx, (const struct marshal_cmd_BeginConditionalRender *) cmd);
   41535       break;
   41536    case DISPATCH_CMD_CopyConvolutionFilter1D:
   41537       debug_print_unmarshal("CopyConvolutionFilter1D");
   41538       _mesa_unmarshal_CopyConvolutionFilter1D(ctx, (const struct marshal_cmd_CopyConvolutionFilter1D *) cmd);
   41539       break;
   41540    case DISPATCH_CMD_ClearBufferfv:
   41541       debug_print_unmarshal("ClearBufferfv");
   41542       _mesa_unmarshal_ClearBufferfv(ctx, (const struct marshal_cmd_ClearBufferfv *) cmd);
   41543       break;
   41544    case DISPATCH_CMD_UniformMatrix4dv:
   41545       debug_print_unmarshal("UniformMatrix4dv");
   41546       _mesa_unmarshal_UniformMatrix4dv(ctx, (const struct marshal_cmd_UniformMatrix4dv *) cmd);
   41547       break;
   41548    case DISPATCH_CMD_ClearBufferfi:
   41549       debug_print_unmarshal("ClearBufferfi");
   41550       _mesa_unmarshal_ClearBufferfi(ctx, (const struct marshal_cmd_ClearBufferfi *) cmd);
   41551       break;
   41552    case DISPATCH_CMD_DeleteFragmentShaderATI:
   41553       debug_print_unmarshal("DeleteFragmentShaderATI");
   41554       _mesa_unmarshal_DeleteFragmentShaderATI(ctx, (const struct marshal_cmd_DeleteFragmentShaderATI *) cmd);
   41555       break;
   41556    case DISPATCH_CMD_DrawElementsInstancedBaseVertex:
   41557       debug_print_unmarshal("DrawElementsInstancedBaseVertex");
   41558       _mesa_unmarshal_DrawElementsInstancedBaseVertex(ctx, (const struct marshal_cmd_DrawElementsInstancedBaseVertex *) cmd);
   41559       break;
   41560    case DISPATCH_CMD_DisableClientState:
   41561       debug_print_unmarshal("DisableClientState");
   41562       _mesa_unmarshal_DisableClientState(ctx, (const struct marshal_cmd_DisableClientState *) cmd);
   41563       break;
   41564    case DISPATCH_CMD_TexGeni:
   41565       debug_print_unmarshal("TexGeni");
   41566       _mesa_unmarshal_TexGeni(ctx, (const struct marshal_cmd_TexGeni *) cmd);
   41567       break;
   41568    case DISPATCH_CMD_TexGenf:
   41569       debug_print_unmarshal("TexGenf");
   41570       _mesa_unmarshal_TexGenf(ctx, (const struct marshal_cmd_TexGenf *) cmd);
   41571       break;
   41572    case DISPATCH_CMD_TexGend:
   41573       debug_print_unmarshal("TexGend");
   41574       _mesa_unmarshal_TexGend(ctx, (const struct marshal_cmd_TexGend *) cmd);
   41575       break;
   41576    case DISPATCH_CMD_ProgramUniform4i64vARB:
   41577       debug_print_unmarshal("ProgramUniform4i64vARB");
   41578       _mesa_unmarshal_ProgramUniform4i64vARB(ctx, (const struct marshal_cmd_ProgramUniform4i64vARB *) cmd);
   41579       break;
   41580    case DISPATCH_CMD_Color4sv:
   41581       debug_print_unmarshal("Color4sv");
   41582       _mesa_unmarshal_Color4sv(ctx, (const struct marshal_cmd_Color4sv *) cmd);
   41583       break;
   41584    case DISPATCH_CMD_PixelZoom:
   41585       debug_print_unmarshal("PixelZoom");
   41586       _mesa_unmarshal_PixelZoom(ctx, (const struct marshal_cmd_PixelZoom *) cmd);
   41587       break;
   41588    case DISPATCH_CMD_ProgramEnvParameter4dARB:
   41589       debug_print_unmarshal("ProgramEnvParameter4dARB");
   41590       _mesa_unmarshal_ProgramEnvParameter4dARB(ctx, (const struct marshal_cmd_ProgramEnvParameter4dARB *) cmd);
   41591       break;
   41592    case DISPATCH_CMD_ProgramUniform3uiv:
   41593       debug_print_unmarshal("ProgramUniform3uiv");
   41594       _mesa_unmarshal_ProgramUniform3uiv(ctx, (const struct marshal_cmd_ProgramUniform3uiv *) cmd);
   41595       break;
   41596    case DISPATCH_CMD_IndexPointer:
   41597       debug_print_unmarshal("IndexPointer");
   41598       _mesa_unmarshal_IndexPointer(ctx, (const struct marshal_cmd_IndexPointer *) cmd);
   41599       break;
   41600    case DISPATCH_CMD_VertexAttrib4sNV:
   41601       debug_print_unmarshal("VertexAttrib4sNV");
   41602       _mesa_unmarshal_VertexAttrib4sNV(ctx, (const struct marshal_cmd_VertexAttrib4sNV *) cmd);
   41603       break;
   41604    case DISPATCH_CMD_Uniform3ui64vARB:
   41605       debug_print_unmarshal("Uniform3ui64vARB");
   41606       _mesa_unmarshal_Uniform3ui64vARB(ctx, (const struct marshal_cmd_Uniform3ui64vARB *) cmd);
   41607       break;
   41608    case DISPATCH_CMD_BufferPageCommitmentARB:
   41609       debug_print_unmarshal("BufferPageCommitmentARB");
   41610       _mesa_unmarshal_BufferPageCommitmentARB(ctx, (const struct marshal_cmd_BufferPageCommitmentARB *) cmd);
   41611       break;
   41612    case DISPATCH_CMD_ColorP4ui:
   41613       debug_print_unmarshal("ColorP4ui");
   41614       _mesa_unmarshal_ColorP4ui(ctx, (const struct marshal_cmd_ColorP4ui *) cmd);
   41615       break;
   41616    case DISPATCH_CMD_TextureStorage3D:
   41617       debug_print_unmarshal("TextureStorage3D");
   41618       _mesa_unmarshal_TextureStorage3D(ctx, (const struct marshal_cmd_TextureStorage3D *) cmd);
   41619       break;
   41620    case DISPATCH_CMD_TextureStorageMem2DMultisampleEXT:
   41621       debug_print_unmarshal("TextureStorageMem2DMultisampleEXT");
   41622       _mesa_unmarshal_TextureStorageMem2DMultisampleEXT(ctx, (const struct marshal_cmd_TextureStorageMem2DMultisampleEXT *) cmd);
   41623       break;
   41624    case DISPATCH_CMD_Uniform1iv:
   41625       debug_print_unmarshal("Uniform1iv");
   41626       _mesa_unmarshal_Uniform1iv(ctx, (const struct marshal_cmd_Uniform1iv *) cmd);
   41627       break;
   41628    case DISPATCH_CMD_Uniform4uiv:
   41629       debug_print_unmarshal("Uniform4uiv");
   41630       _mesa_unmarshal_Uniform4uiv(ctx, (const struct marshal_cmd_Uniform4uiv *) cmd);
   41631       break;
   41632    case DISPATCH_CMD_PopDebugGroup:
   41633       debug_print_unmarshal("PopDebugGroup");
   41634       _mesa_unmarshal_PopDebugGroup(ctx, (const struct marshal_cmd_PopDebugGroup *) cmd);
   41635       break;
   41636    case DISPATCH_CMD_VertexAttrib1d:
   41637       debug_print_unmarshal("VertexAttrib1d");
   41638       _mesa_unmarshal_VertexAttrib1d(ctx, (const struct marshal_cmd_VertexAttrib1d *) cmd);
   41639       break;
   41640    case DISPATCH_CMD_NamedBufferSubData:
   41641       debug_print_unmarshal("NamedBufferSubData");
   41642       _mesa_unmarshal_NamedBufferSubData(ctx, (const struct marshal_cmd_NamedBufferSubData *) cmd);
   41643       break;
   41644    case DISPATCH_CMD_TexBufferRange:
   41645       debug_print_unmarshal("TexBufferRange");
   41646       _mesa_unmarshal_TexBufferRange(ctx, (const struct marshal_cmd_TexBufferRange *) cmd);
   41647       break;
   41648    case DISPATCH_CMD_VertexAttrib1s:
   41649       debug_print_unmarshal("VertexAttrib1s");
   41650       _mesa_unmarshal_VertexAttrib1s(ctx, (const struct marshal_cmd_VertexAttrib1s *) cmd);
   41651       break;
   41652    case DISPATCH_CMD_UniformMatrix4x3dv:
   41653       debug_print_unmarshal("UniformMatrix4x3dv");
   41654       _mesa_unmarshal_UniformMatrix4x3dv(ctx, (const struct marshal_cmd_UniformMatrix4x3dv *) cmd);
   41655       break;
   41656    case DISPATCH_CMD_TransformFeedbackBufferBase:
   41657       debug_print_unmarshal("TransformFeedbackBufferBase");
   41658       _mesa_unmarshal_TransformFeedbackBufferBase(ctx, (const struct marshal_cmd_TransformFeedbackBufferBase *) cmd);
   41659       break;
   41660    case DISPATCH_CMD_FogCoordfvEXT:
   41661       debug_print_unmarshal("FogCoordfvEXT");
   41662       _mesa_unmarshal_FogCoordfvEXT(ctx, (const struct marshal_cmd_FogCoordfvEXT *) cmd);
   41663       break;
   41664    case DISPATCH_CMD_Uniform2ui64vARB:
   41665       debug_print_unmarshal("Uniform2ui64vARB");
   41666       _mesa_unmarshal_Uniform2ui64vARB(ctx, (const struct marshal_cmd_Uniform2ui64vARB *) cmd);
   41667       break;
   41668    case DISPATCH_CMD_MultiTexCoord3fARB:
   41669       debug_print_unmarshal("MultiTexCoord3fARB");
   41670       _mesa_unmarshal_MultiTexCoord3fARB(ctx, (const struct marshal_cmd_MultiTexCoord3fARB *) cmd);
   41671       break;
   41672    case DISPATCH_CMD_Vertex2sv:
   41673       debug_print_unmarshal("Vertex2sv");
   41674       _mesa_unmarshal_Vertex2sv(ctx, (const struct marshal_cmd_Vertex2sv *) cmd);
   41675       break;
   41676    case DISPATCH_CMD_VertexAttrib2dNV:
   41677       debug_print_unmarshal("VertexAttrib2dNV");
   41678       _mesa_unmarshal_VertexAttrib2dNV(ctx, (const struct marshal_cmd_VertexAttrib2dNV *) cmd);
   41679       break;
   41680    case DISPATCH_CMD_VertexAttrib3svNV:
   41681       debug_print_unmarshal("VertexAttrib3svNV");
   41682       _mesa_unmarshal_VertexAttrib3svNV(ctx, (const struct marshal_cmd_VertexAttrib3svNV *) cmd);
   41683       break;
   41684    case DISPATCH_CMD_ViewportArrayv:
   41685       debug_print_unmarshal("ViewportArrayv");
   41686       _mesa_unmarshal_ViewportArrayv(ctx, (const struct marshal_cmd_ViewportArrayv *) cmd);
   41687       break;
   41688    case DISPATCH_CMD_ArrayElement:
   41689       debug_print_unmarshal("ArrayElement");
   41690       _mesa_unmarshal_ArrayElement(ctx, (const struct marshal_cmd_ArrayElement *) cmd);
   41691       break;
   41692    case DISPATCH_CMD_RasterPos2dv:
   41693       debug_print_unmarshal("RasterPos2dv");
   41694       _mesa_unmarshal_RasterPos2dv(ctx, (const struct marshal_cmd_RasterPos2dv *) cmd);
   41695       break;
   41696    case DISPATCH_CMD_EndQuery:
   41697       debug_print_unmarshal("EndQuery");
   41698       _mesa_unmarshal_EndQuery(ctx, (const struct marshal_cmd_EndQuery *) cmd);
   41699       break;
   41700    case DISPATCH_CMD_TexCoord1dv:
   41701       debug_print_unmarshal("TexCoord1dv");
   41702       _mesa_unmarshal_TexCoord1dv(ctx, (const struct marshal_cmd_TexCoord1dv *) cmd);
   41703       break;
   41704    case DISPATCH_CMD_AlphaFragmentOp3ATI:
   41705       debug_print_unmarshal("AlphaFragmentOp3ATI");
   41706       _mesa_unmarshal_AlphaFragmentOp3ATI(ctx, (const struct marshal_cmd_AlphaFragmentOp3ATI *) cmd);
   41707       break;
   41708    case DISPATCH_CMD_Clear:
   41709       debug_print_unmarshal("Clear");
   41710       _mesa_unmarshal_Clear(ctx, (const struct marshal_cmd_Clear *) cmd);
   41711       break;
   41712    case DISPATCH_CMD_VertexAttrib4sv:
   41713       debug_print_unmarshal("VertexAttrib4sv");
   41714       _mesa_unmarshal_VertexAttrib4sv(ctx, (const struct marshal_cmd_VertexAttrib4sv *) cmd);
   41715       break;
   41716    case DISPATCH_CMD_Ortho:
   41717       debug_print_unmarshal("Ortho");
   41718       _mesa_unmarshal_Ortho(ctx, (const struct marshal_cmd_Ortho *) cmd);
   41719       break;
   41720    case DISPATCH_CMD_Uniform3uiv:
   41721       debug_print_unmarshal("Uniform3uiv");
   41722       _mesa_unmarshal_Uniform3uiv(ctx, (const struct marshal_cmd_Uniform3uiv *) cmd);
   41723       break;
   41724    case DISPATCH_CMD_EndQueryIndexed:
   41725       debug_print_unmarshal("EndQueryIndexed");
   41726       _mesa_unmarshal_EndQueryIndexed(ctx, (const struct marshal_cmd_EndQueryIndexed *) cmd);
   41727       break;
   41728    case DISPATCH_CMD_MultiDrawArraysIndirectCountARB:
   41729       debug_print_unmarshal("MultiDrawArraysIndirectCountARB");
   41730       _mesa_unmarshal_MultiDrawArraysIndirectCountARB(ctx, (const struct marshal_cmd_MultiDrawArraysIndirectCountARB *) cmd);
   41731       break;
   41732    case DISPATCH_CMD_ProgramUniformMatrix2fv:
   41733       debug_print_unmarshal("ProgramUniformMatrix2fv");
   41734       _mesa_unmarshal_ProgramUniformMatrix2fv(ctx, (const struct marshal_cmd_ProgramUniformMatrix2fv *) cmd);
   41735       break;
   41736    case DISPATCH_CMD_ProgramLocalParameter4fvARB:
   41737       debug_print_unmarshal("ProgramLocalParameter4fvARB");
   41738       _mesa_unmarshal_ProgramLocalParameter4fvARB(ctx, (const struct marshal_cmd_ProgramLocalParameter4fvARB *) cmd);
   41739       break;
   41740    case DISPATCH_CMD_Uniform4dv:
   41741       debug_print_unmarshal("Uniform4dv");
   41742       _mesa_unmarshal_Uniform4dv(ctx, (const struct marshal_cmd_Uniform4dv *) cmd);
   41743       break;
   41744    case DISPATCH_CMD_LightModelx:
   41745       debug_print_unmarshal("LightModelx");
   41746       _mesa_unmarshal_LightModelx(ctx, (const struct marshal_cmd_LightModelx *) cmd);
   41747       break;
   41748    case DISPATCH_CMD_VertexAttribI3iEXT:
   41749       debug_print_unmarshal("VertexAttribI3iEXT");
   41750       _mesa_unmarshal_VertexAttribI3iEXT(ctx, (const struct marshal_cmd_VertexAttribI3iEXT *) cmd);
   41751       break;
   41752    case DISPATCH_CMD_ClearColorx:
   41753       debug_print_unmarshal("ClearColorx");
   41754       _mesa_unmarshal_ClearColorx(ctx, (const struct marshal_cmd_ClearColorx *) cmd);
   41755       break;
   41756    case DISPATCH_CMD_EndTransformFeedback:
   41757       debug_print_unmarshal("EndTransformFeedback");
   41758       _mesa_unmarshal_EndTransformFeedback(ctx, (const struct marshal_cmd_EndTransformFeedback *) cmd);
   41759       break;
   41760    case DISPATCH_CMD_ViewportIndexedfv:
   41761       debug_print_unmarshal("ViewportIndexedfv");
   41762       _mesa_unmarshal_ViewportIndexedfv(ctx, (const struct marshal_cmd_ViewportIndexedfv *) cmd);
   41763       break;
   41764    case DISPATCH_CMD_BindTextureUnit:
   41765       debug_print_unmarshal("BindTextureUnit");
   41766       _mesa_unmarshal_BindTextureUnit(ctx, (const struct marshal_cmd_BindTextureUnit *) cmd);
   41767       break;
   41768    case DISPATCH_CMD_CallList:
   41769       debug_print_unmarshal("CallList");
   41770       _mesa_unmarshal_CallList(ctx, (const struct marshal_cmd_CallList *) cmd);
   41771       break;
   41772    case DISPATCH_CMD_DeleteProgram:
   41773       debug_print_unmarshal("DeleteProgram");
   41774       _mesa_unmarshal_DeleteProgram(ctx, (const struct marshal_cmd_DeleteProgram *) cmd);
   41775       break;
   41776    case DISPATCH_CMD_ClearDepthf:
   41777       debug_print_unmarshal("ClearDepthf");
   41778       _mesa_unmarshal_ClearDepthf(ctx, (const struct marshal_cmd_ClearDepthf *) cmd);
   41779       break;
   41780    case DISPATCH_CMD_Uniform2iv:
   41781       debug_print_unmarshal("Uniform2iv");
   41782       _mesa_unmarshal_Uniform2iv(ctx, (const struct marshal_cmd_Uniform2iv *) cmd);
   41783       break;
   41784    case DISPATCH_CMD_SampleCoveragex:
   41785       debug_print_unmarshal("SampleCoveragex");
   41786       _mesa_unmarshal_SampleCoveragex(ctx, (const struct marshal_cmd_SampleCoveragex *) cmd);
   41787       break;
   41788    case DISPATCH_CMD_DeleteFramebuffers:
   41789       debug_print_unmarshal("DeleteFramebuffers");
   41790       _mesa_unmarshal_DeleteFramebuffers(ctx, (const struct marshal_cmd_DeleteFramebuffers *) cmd);
   41791       break;
   41792    case DISPATCH_CMD_VertexAttrib4uiv:
   41793       debug_print_unmarshal("VertexAttrib4uiv");
   41794       _mesa_unmarshal_VertexAttrib4uiv(ctx, (const struct marshal_cmd_VertexAttrib4uiv *) cmd);
   41795       break;
   41796    case DISPATCH_CMD_VertexAttrib4Nsv:
   41797       debug_print_unmarshal("VertexAttrib4Nsv");
   41798       _mesa_unmarshal_VertexAttrib4Nsv(ctx, (const struct marshal_cmd_VertexAttrib4Nsv *) cmd);
   41799       break;
   41800    case DISPATCH_CMD_Vertex4s:
   41801       debug_print_unmarshal("Vertex4s");
   41802       _mesa_unmarshal_Vertex4s(ctx, (const struct marshal_cmd_Vertex4s *) cmd);
   41803       break;
   41804    case DISPATCH_CMD_VertexAttribI2iEXT:
   41805       debug_print_unmarshal("VertexAttribI2iEXT");
   41806       _mesa_unmarshal_VertexAttribI2iEXT(ctx, (const struct marshal_cmd_VertexAttribI2iEXT *) cmd);
   41807       break;
   41808    case DISPATCH_CMD_Vertex4f:
   41809       debug_print_unmarshal("Vertex4f");
   41810       _mesa_unmarshal_Vertex4f(ctx, (const struct marshal_cmd_Vertex4f *) cmd);
   41811       break;
   41812    case DISPATCH_CMD_Vertex4d:
   41813       debug_print_unmarshal("Vertex4d");
   41814       _mesa_unmarshal_Vertex4d(ctx, (const struct marshal_cmd_Vertex4d *) cmd);
   41815       break;
   41816    case DISPATCH_CMD_Vertex4i:
   41817       debug_print_unmarshal("Vertex4i");
   41818       _mesa_unmarshal_Vertex4i(ctx, (const struct marshal_cmd_Vertex4i *) cmd);
   41819       break;
   41820    case DISPATCH_CMD_MemoryBarrierByRegion:
   41821       debug_print_unmarshal("MemoryBarrierByRegion");
   41822       _mesa_unmarshal_MemoryBarrierByRegion(ctx, (const struct marshal_cmd_MemoryBarrierByRegion *) cmd);
   41823       break;
   41824    case DISPATCH_CMD_StencilFuncSeparateATI:
   41825       debug_print_unmarshal("StencilFuncSeparateATI");
   41826       _mesa_unmarshal_StencilFuncSeparateATI(ctx, (const struct marshal_cmd_StencilFuncSeparateATI *) cmd);
   41827       break;
   41828    case DISPATCH_CMD_Vertex4dv:
   41829       debug_print_unmarshal("Vertex4dv");
   41830       _mesa_unmarshal_Vertex4dv(ctx, (const struct marshal_cmd_Vertex4dv *) cmd);
   41831       break;
   41832    case DISPATCH_CMD_StencilMask:
   41833       debug_print_unmarshal("StencilMask");
   41834       _mesa_unmarshal_StencilMask(ctx, (const struct marshal_cmd_StencilMask *) cmd);
   41835       break;
   41836    case DISPATCH_CMD_NamedFramebufferReadBuffer:
   41837       debug_print_unmarshal("NamedFramebufferReadBuffer");
   41838       _mesa_unmarshal_NamedFramebufferReadBuffer(ctx, (const struct marshal_cmd_NamedFramebufferReadBuffer *) cmd);
   41839       break;
   41840    case DISPATCH_CMD_ProgramUniformHandleui64ARB:
   41841       debug_print_unmarshal("ProgramUniformHandleui64ARB");
   41842       _mesa_unmarshal_ProgramUniformHandleui64ARB(ctx, (const struct marshal_cmd_ProgramUniformHandleui64ARB *) cmd);
   41843       break;
   41844    case DISPATCH_CMD_ProgramUniform2i64ARB:
   41845       debug_print_unmarshal("ProgramUniform2i64ARB");
   41846       _mesa_unmarshal_ProgramUniform2i64ARB(ctx, (const struct marshal_cmd_ProgramUniform2i64ARB *) cmd);
   41847       break;
   41848    case DISPATCH_CMD_ClearBufferiv:
   41849       debug_print_unmarshal("ClearBufferiv");
   41850       _mesa_unmarshal_ClearBufferiv(ctx, (const struct marshal_cmd_ClearBufferiv *) cmd);
   41851       break;
   41852    case DISPATCH_CMD_ProgramUniform2iv:
   41853       debug_print_unmarshal("ProgramUniform2iv");
   41854       _mesa_unmarshal_ProgramUniform2iv(ctx, (const struct marshal_cmd_ProgramUniform2iv *) cmd);
   41855       break;
   41856    case DISPATCH_CMD_FogCoordPointer:
   41857       debug_print_unmarshal("FogCoordPointer");
   41858       _mesa_unmarshal_FogCoordPointer(ctx, (const struct marshal_cmd_FogCoordPointer *) cmd);
   41859       break;
   41860    case DISPATCH_CMD_SecondaryColor3us:
   41861       debug_print_unmarshal("SecondaryColor3us");
   41862       _mesa_unmarshal_SecondaryColor3us(ctx, (const struct marshal_cmd_SecondaryColor3us *) cmd);
   41863       break;
   41864    case DISPATCH_CMD_TextureStorageMem1DEXT:
   41865       debug_print_unmarshal("TextureStorageMem1DEXT");
   41866       _mesa_unmarshal_TextureStorageMem1DEXT(ctx, (const struct marshal_cmd_TextureStorageMem1DEXT *) cmd);
   41867       break;
   41868    case DISPATCH_CMD_SecondaryColor3ub:
   41869       debug_print_unmarshal("SecondaryColor3ub");
   41870       _mesa_unmarshal_SecondaryColor3ub(ctx, (const struct marshal_cmd_SecondaryColor3ub *) cmd);
   41871       break;
   41872    case DISPATCH_CMD_NamedBufferStorageMemEXT:
   41873       debug_print_unmarshal("NamedBufferStorageMemEXT");
   41874       _mesa_unmarshal_NamedBufferStorageMemEXT(ctx, (const struct marshal_cmd_NamedBufferStorageMemEXT *) cmd);
   41875       break;
   41876    case DISPATCH_CMD_SecondaryColor3ui:
   41877       debug_print_unmarshal("SecondaryColor3ui");
   41878       _mesa_unmarshal_SecondaryColor3ui(ctx, (const struct marshal_cmd_SecondaryColor3ui *) cmd);
   41879       break;
   41880    case DISPATCH_CMD_ProgramUniform4ui64ARB:
   41881       debug_print_unmarshal("ProgramUniform4ui64ARB");
   41882       _mesa_unmarshal_ProgramUniform4ui64ARB(ctx, (const struct marshal_cmd_ProgramUniform4ui64ARB *) cmd);
   41883       break;
   41884    case DISPATCH_CMD_VertexAttrib1sNV:
   41885       debug_print_unmarshal("VertexAttrib1sNV");
   41886       _mesa_unmarshal_VertexAttrib1sNV(ctx, (const struct marshal_cmd_VertexAttrib1sNV *) cmd);
   41887       break;
   41888    case DISPATCH_CMD_TextureBuffer:
   41889       debug_print_unmarshal("TextureBuffer");
   41890       _mesa_unmarshal_TextureBuffer(ctx, (const struct marshal_cmd_TextureBuffer *) cmd);
   41891       break;
   41892    case DISPATCH_CMD_InitNames:
   41893       debug_print_unmarshal("InitNames");
   41894       _mesa_unmarshal_InitNames(ctx, (const struct marshal_cmd_InitNames *) cmd);
   41895       break;
   41896    case DISPATCH_CMD_Normal3sv:
   41897       debug_print_unmarshal("Normal3sv");
   41898       _mesa_unmarshal_Normal3sv(ctx, (const struct marshal_cmd_Normal3sv *) cmd);
   41899       break;
   41900    case DISPATCH_CMD_DeleteQueries:
   41901       debug_print_unmarshal("DeleteQueries");
   41902       _mesa_unmarshal_DeleteQueries(ctx, (const struct marshal_cmd_DeleteQueries *) cmd);
   41903       break;
   41904    case DISPATCH_CMD_InvalidateFramebuffer:
   41905       debug_print_unmarshal("InvalidateFramebuffer");
   41906       _mesa_unmarshal_InvalidateFramebuffer(ctx, (const struct marshal_cmd_InvalidateFramebuffer *) cmd);
   41907       break;
   41908    case DISPATCH_CMD_Hint:
   41909       debug_print_unmarshal("Hint");
   41910       _mesa_unmarshal_Hint(ctx, (const struct marshal_cmd_Hint *) cmd);
   41911       break;
   41912    case DISPATCH_CMD_MemoryBarrier:
   41913       debug_print_unmarshal("MemoryBarrier");
   41914       _mesa_unmarshal_MemoryBarrier(ctx, (const struct marshal_cmd_MemoryBarrier *) cmd);
   41915       break;
   41916    case DISPATCH_CMD_CopyColorSubTable:
   41917       debug_print_unmarshal("CopyColorSubTable");
   41918       _mesa_unmarshal_CopyColorSubTable(ctx, (const struct marshal_cmd_CopyColorSubTable *) cmd);
   41919       break;
   41920    case DISPATCH_CMD_DrawTexsvOES:
   41921       debug_print_unmarshal("DrawTexsvOES");
   41922       _mesa_unmarshal_DrawTexsvOES(ctx, (const struct marshal_cmd_DrawTexsvOES *) cmd);
   41923       break;
   41924    case DISPATCH_CMD_Disable:
   41925       debug_print_unmarshal("Disable");
   41926       _mesa_unmarshal_Disable(ctx, (const struct marshal_cmd_Disable *) cmd);
   41927       break;
   41928    case DISPATCH_CMD_ClearColor:
   41929       debug_print_unmarshal("ClearColor");
   41930       _mesa_unmarshal_ClearColor(ctx, (const struct marshal_cmd_ClearColor *) cmd);
   41931       break;
   41932    case DISPATCH_CMD_RasterPos4iv:
   41933       debug_print_unmarshal("RasterPos4iv");
   41934       _mesa_unmarshal_RasterPos4iv(ctx, (const struct marshal_cmd_RasterPos4iv *) cmd);
   41935       break;
   41936    case DISPATCH_CMD_ProgramUniformMatrix2x3fv:
   41937       debug_print_unmarshal("ProgramUniformMatrix2x3fv");
   41938       _mesa_unmarshal_ProgramUniformMatrix2x3fv(ctx, (const struct marshal_cmd_ProgramUniformMatrix2x3fv *) cmd);
   41939       break;
   41940    case DISPATCH_CMD_BindVertexBuffer:
   41941       debug_print_unmarshal("BindVertexBuffer");
   41942       _mesa_unmarshal_BindVertexBuffer(ctx, (const struct marshal_cmd_BindVertexBuffer *) cmd);
   41943       break;
   41944    case DISPATCH_CMD_RasterPos4i:
   41945       debug_print_unmarshal("RasterPos4i");
   41946       _mesa_unmarshal_RasterPos4i(ctx, (const struct marshal_cmd_RasterPos4i *) cmd);
   41947       break;
   41948    case DISPATCH_CMD_RasterPos4d:
   41949       debug_print_unmarshal("RasterPos4d");
   41950       _mesa_unmarshal_RasterPos4d(ctx, (const struct marshal_cmd_RasterPos4d *) cmd);
   41951       break;
   41952    case DISPATCH_CMD_RasterPos4f:
   41953       debug_print_unmarshal("RasterPos4f");
   41954       _mesa_unmarshal_RasterPos4f(ctx, (const struct marshal_cmd_RasterPos4f *) cmd);
   41955       break;
   41956    case DISPATCH_CMD_RasterPos3dv:
   41957       debug_print_unmarshal("RasterPos3dv");
   41958       _mesa_unmarshal_RasterPos3dv(ctx, (const struct marshal_cmd_RasterPos3dv *) cmd);
   41959       break;
   41960    case DISPATCH_CMD_TexCoord1iv:
   41961       debug_print_unmarshal("TexCoord1iv");
   41962       _mesa_unmarshal_TexCoord1iv(ctx, (const struct marshal_cmd_TexCoord1iv *) cmd);
   41963       break;
   41964    case DISPATCH_CMD_RasterPos4s:
   41965       debug_print_unmarshal("RasterPos4s");
   41966       _mesa_unmarshal_RasterPos4s(ctx, (const struct marshal_cmd_RasterPos4s *) cmd);
   41967       break;
   41968    case DISPATCH_CMD_VertexAttrib3dv:
   41969       debug_print_unmarshal("VertexAttrib3dv");
   41970       _mesa_unmarshal_VertexAttrib3dv(ctx, (const struct marshal_cmd_VertexAttrib3dv *) cmd);
   41971       break;
   41972    case DISPATCH_CMD_Histogram:
   41973       debug_print_unmarshal("Histogram");
   41974       _mesa_unmarshal_Histogram(ctx, (const struct marshal_cmd_Histogram *) cmd);
   41975       break;
   41976    case DISPATCH_CMD_Uniform2fv:
   41977       debug_print_unmarshal("Uniform2fv");
   41978       _mesa_unmarshal_Uniform2fv(ctx, (const struct marshal_cmd_Uniform2fv *) cmd);
   41979       break;
   41980    case DISPATCH_CMD_ProgramUniformMatrix3x4dv:
   41981       debug_print_unmarshal("ProgramUniformMatrix3x4dv");
   41982       _mesa_unmarshal_ProgramUniformMatrix3x4dv(ctx, (const struct marshal_cmd_ProgramUniformMatrix3x4dv *) cmd);
   41983       break;
   41984    case DISPATCH_CMD_DrawBuffers:
   41985       debug_print_unmarshal("DrawBuffers");
   41986       _mesa_unmarshal_DrawBuffers(ctx, (const struct marshal_cmd_DrawBuffers *) cmd);
   41987       break;
   41988    case DISPATCH_CMD_VertexAttribL1ui64ARB:
   41989       debug_print_unmarshal("VertexAttribL1ui64ARB");
   41990       _mesa_unmarshal_VertexAttribL1ui64ARB(ctx, (const struct marshal_cmd_VertexAttribL1ui64ARB *) cmd);
   41991       break;
   41992    case DISPATCH_CMD_Color3uiv:
   41993       debug_print_unmarshal("Color3uiv");
   41994       _mesa_unmarshal_Color3uiv(ctx, (const struct marshal_cmd_Color3uiv *) cmd);
   41995       break;
   41996    case DISPATCH_CMD_EvalCoord2fv:
   41997       debug_print_unmarshal("EvalCoord2fv");
   41998       _mesa_unmarshal_EvalCoord2fv(ctx, (const struct marshal_cmd_EvalCoord2fv *) cmd);
   41999       break;
   42000    case DISPATCH_CMD_TextureStorage3DEXT:
   42001       debug_print_unmarshal("TextureStorage3DEXT");
   42002       _mesa_unmarshal_TextureStorage3DEXT(ctx, (const struct marshal_cmd_TextureStorage3DEXT *) cmd);
   42003       break;
   42004    case DISPATCH_CMD_VertexAttrib2fARB:
   42005       debug_print_unmarshal("VertexAttrib2fARB");
   42006       _mesa_unmarshal_VertexAttrib2fARB(ctx, (const struct marshal_cmd_VertexAttrib2fARB *) cmd);
   42007       break;
   42008    case DISPATCH_CMD_BeginPerfMonitorAMD:
   42009       debug_print_unmarshal("BeginPerfMonitorAMD");
   42010       _mesa_unmarshal_BeginPerfMonitorAMD(ctx, (const struct marshal_cmd_BeginPerfMonitorAMD *) cmd);
   42011       break;
   42012    case DISPATCH_CMD_Normal3bv:
   42013       debug_print_unmarshal("Normal3bv");
   42014       _mesa_unmarshal_Normal3bv(ctx, (const struct marshal_cmd_Normal3bv *) cmd);
   42015       break;
   42016    case DISPATCH_CMD_BeginQueryIndexed:
   42017       debug_print_unmarshal("BeginQueryIndexed");
   42018       _mesa_unmarshal_BeginQueryIndexed(ctx, (const struct marshal_cmd_BeginQueryIndexed *) cmd);
   42019       break;
   42020    case DISPATCH_CMD_Vertex3iv:
   42021       debug_print_unmarshal("Vertex3iv");
   42022       _mesa_unmarshal_Vertex3iv(ctx, (const struct marshal_cmd_Vertex3iv *) cmd);
   42023       break;
   42024    case DISPATCH_CMD_UniformMatrix2x3dv:
   42025       debug_print_unmarshal("UniformMatrix2x3dv");
   42026       _mesa_unmarshal_UniformMatrix2x3dv(ctx, (const struct marshal_cmd_UniformMatrix2x3dv *) cmd);
   42027       break;
   42028    case DISPATCH_CMD_TexCoord3dv:
   42029       debug_print_unmarshal("TexCoord3dv");
   42030       _mesa_unmarshal_TexCoord3dv(ctx, (const struct marshal_cmd_TexCoord3dv *) cmd);
   42031       break;
   42032    case DISPATCH_CMD_VertexP3ui:
   42033       debug_print_unmarshal("VertexP3ui");
   42034       _mesa_unmarshal_VertexP3ui(ctx, (const struct marshal_cmd_VertexP3ui *) cmd);
   42035       break;
   42036    case DISPATCH_CMD_UniformMatrix3fv:
   42037       debug_print_unmarshal("UniformMatrix3fv");
   42038       _mesa_unmarshal_UniformMatrix3fv(ctx, (const struct marshal_cmd_UniformMatrix3fv *) cmd);
   42039       break;
   42040    case DISPATCH_CMD_PrioritizeTextures:
   42041       debug_print_unmarshal("PrioritizeTextures");
   42042       _mesa_unmarshal_PrioritizeTextures(ctx, (const struct marshal_cmd_PrioritizeTextures *) cmd);
   42043       break;
   42044    case DISPATCH_CMD_VertexAttribI3uiEXT:
   42045       debug_print_unmarshal("VertexAttribI3uiEXT");
   42046       _mesa_unmarshal_VertexAttribI3uiEXT(ctx, (const struct marshal_cmd_VertexAttribI3uiEXT *) cmd);
   42047       break;
   42048    case DISPATCH_CMD_ProgramUniform1i64ARB:
   42049       debug_print_unmarshal("ProgramUniform1i64ARB");
   42050       _mesa_unmarshal_ProgramUniform1i64ARB(ctx, (const struct marshal_cmd_ProgramUniform1i64ARB *) cmd);
   42051       break;
   42052    case DISPATCH_CMD_SecondaryColor3uiv:
   42053       debug_print_unmarshal("SecondaryColor3uiv");
   42054       _mesa_unmarshal_SecondaryColor3uiv(ctx, (const struct marshal_cmd_SecondaryColor3uiv *) cmd);
   42055       break;
   42056    case DISPATCH_CMD_EndConditionalRender:
   42057       debug_print_unmarshal("EndConditionalRender");
   42058       _mesa_unmarshal_EndConditionalRender(ctx, (const struct marshal_cmd_EndConditionalRender *) cmd);
   42059       break;
   42060    case DISPATCH_CMD_ProgramLocalParameter4dARB:
   42061       debug_print_unmarshal("ProgramLocalParameter4dARB");
   42062       _mesa_unmarshal_ProgramLocalParameter4dARB(ctx, (const struct marshal_cmd_ProgramLocalParameter4dARB *) cmd);
   42063       break;
   42064    case DISPATCH_CMD_Color3sv:
   42065       debug_print_unmarshal("Color3sv");
   42066       _mesa_unmarshal_Color3sv(ctx, (const struct marshal_cmd_Color3sv *) cmd);
   42067       break;
   42068    case DISPATCH_CMD_BlendEquationSeparateiARB:
   42069       debug_print_unmarshal("BlendEquationSeparateiARB");
   42070       _mesa_unmarshal_BlendEquationSeparateiARB(ctx, (const struct marshal_cmd_BlendEquationSeparateiARB *) cmd);
   42071       break;
   42072    case DISPATCH_CMD_MultiTexCoord1fvARB:
   42073       debug_print_unmarshal("MultiTexCoord1fvARB");
   42074       _mesa_unmarshal_MultiTexCoord1fvARB(ctx, (const struct marshal_cmd_MultiTexCoord1fvARB *) cmd);
   42075       break;
   42076    case DISPATCH_CMD_TexStorage2D:
   42077       debug_print_unmarshal("TexStorage2D");
   42078       _mesa_unmarshal_TexStorage2D(ctx, (const struct marshal_cmd_TexStorage2D *) cmd);
   42079       break;
   42080    case DISPATCH_CMD_FramebufferTexture2D:
   42081       debug_print_unmarshal("FramebufferTexture2D");
   42082       _mesa_unmarshal_FramebufferTexture2D(ctx, (const struct marshal_cmd_FramebufferTexture2D *) cmd);
   42083       break;
   42084    case DISPATCH_CMD_VertexAttrib2dv:
   42085       debug_print_unmarshal("VertexAttrib2dv");
   42086       _mesa_unmarshal_VertexAttrib2dv(ctx, (const struct marshal_cmd_VertexAttrib2dv *) cmd);
   42087       break;
   42088    case DISPATCH_CMD_Vertex4sv:
   42089       debug_print_unmarshal("Vertex4sv");
   42090       _mesa_unmarshal_Vertex4sv(ctx, (const struct marshal_cmd_Vertex4sv *) cmd);
   42091       break;
   42092    case DISPATCH_CMD_ClampColor:
   42093       debug_print_unmarshal("ClampColor");
   42094       _mesa_unmarshal_ClampColor(ctx, (const struct marshal_cmd_ClampColor *) cmd);
   42095       break;
   42096    case DISPATCH_CMD_Uniform1i64ARB:
   42097       debug_print_unmarshal("Uniform1i64ARB");
   42098       _mesa_unmarshal_Uniform1i64ARB(ctx, (const struct marshal_cmd_Uniform1i64ARB *) cmd);
   42099       break;
   42100    case DISPATCH_CMD_AlphaFunc:
   42101       debug_print_unmarshal("AlphaFunc");
   42102       _mesa_unmarshal_AlphaFunc(ctx, (const struct marshal_cmd_AlphaFunc *) cmd);
   42103       break;
   42104    case DISPATCH_CMD_EdgeFlag:
   42105       debug_print_unmarshal("EdgeFlag");
   42106       _mesa_unmarshal_EdgeFlag(ctx, (const struct marshal_cmd_EdgeFlag *) cmd);
   42107       break;
   42108    case DISPATCH_CMD_EdgeFlagv:
   42109       debug_print_unmarshal("EdgeFlagv");
   42110       _mesa_unmarshal_EdgeFlagv(ctx, (const struct marshal_cmd_EdgeFlagv *) cmd);
   42111       break;
   42112    case DISPATCH_CMD_DepthRangex:
   42113       debug_print_unmarshal("DepthRangex");
   42114       _mesa_unmarshal_DepthRangex(ctx, (const struct marshal_cmd_DepthRangex *) cmd);
   42115       break;
   42116    case DISPATCH_CMD_DepthRangef:
   42117       debug_print_unmarshal("DepthRangef");
   42118       _mesa_unmarshal_DepthRangef(ctx, (const struct marshal_cmd_DepthRangef *) cmd);
   42119       break;
   42120    case DISPATCH_CMD_ColorFragmentOp3ATI:
   42121       debug_print_unmarshal("ColorFragmentOp3ATI");
   42122       _mesa_unmarshal_ColorFragmentOp3ATI(ctx, (const struct marshal_cmd_ColorFragmentOp3ATI *) cmd);
   42123       break;
   42124    case DISPATCH_CMD_ValidateProgram:
   42125       debug_print_unmarshal("ValidateProgram");
   42126       _mesa_unmarshal_ValidateProgram(ctx, (const struct marshal_cmd_ValidateProgram *) cmd);
   42127       break;
   42128    case DISPATCH_CMD_VertexPointerEXT:
   42129       debug_print_unmarshal("VertexPointerEXT");
   42130       _mesa_unmarshal_VertexPointerEXT(ctx, (const struct marshal_cmd_VertexPointerEXT *) cmd);
   42131       break;
   42132    case DISPATCH_CMD_Scissor:
   42133       debug_print_unmarshal("Scissor");
   42134       _mesa_unmarshal_Scissor(ctx, (const struct marshal_cmd_Scissor *) cmd);
   42135       break;
   42136    case DISPATCH_CMD_BeginTransformFeedback:
   42137       debug_print_unmarshal("BeginTransformFeedback");
   42138       _mesa_unmarshal_BeginTransformFeedback(ctx, (const struct marshal_cmd_BeginTransformFeedback *) cmd);
   42139       break;
   42140    case DISPATCH_CMD_TexCoord2i:
   42141       debug_print_unmarshal("TexCoord2i");
   42142       _mesa_unmarshal_TexCoord2i(ctx, (const struct marshal_cmd_TexCoord2i *) cmd);
   42143       break;
   42144    case DISPATCH_CMD_VertexArrayAttribBinding:
   42145       debug_print_unmarshal("VertexArrayAttribBinding");
   42146       _mesa_unmarshal_VertexArrayAttribBinding(ctx, (const struct marshal_cmd_VertexArrayAttribBinding *) cmd);
   42147       break;
   42148    case DISPATCH_CMD_Color4ui:
   42149       debug_print_unmarshal("Color4ui");
   42150       _mesa_unmarshal_Color4ui(ctx, (const struct marshal_cmd_Color4ui *) cmd);
   42151       break;
   42152    case DISPATCH_CMD_TexCoord2f:
   42153       debug_print_unmarshal("TexCoord2f");
   42154       _mesa_unmarshal_TexCoord2f(ctx, (const struct marshal_cmd_TexCoord2f *) cmd);
   42155       break;
   42156    case DISPATCH_CMD_TexCoord2d:
   42157       debug_print_unmarshal("TexCoord2d");
   42158       _mesa_unmarshal_TexCoord2d(ctx, (const struct marshal_cmd_TexCoord2d *) cmd);
   42159       break;
   42160    case DISPATCH_CMD_TexCoord2s:
   42161       debug_print_unmarshal("TexCoord2s");
   42162       _mesa_unmarshal_TexCoord2s(ctx, (const struct marshal_cmd_TexCoord2s *) cmd);
   42163       break;
   42164    case DISPATCH_CMD_Color4us:
   42165       debug_print_unmarshal("Color4us");
   42166       _mesa_unmarshal_Color4us(ctx, (const struct marshal_cmd_Color4us *) cmd);
   42167       break;
   42168    case DISPATCH_CMD_Color3bv:
   42169       debug_print_unmarshal("Color3bv");
   42170       _mesa_unmarshal_Color3bv(ctx, (const struct marshal_cmd_Color3bv *) cmd);
   42171       break;
   42172    case DISPATCH_CMD_PrimitiveRestartNV:
   42173       debug_print_unmarshal("PrimitiveRestartNV");
   42174       _mesa_unmarshal_PrimitiveRestartNV(ctx, (const struct marshal_cmd_PrimitiveRestartNV *) cmd);
   42175       break;
   42176    case DISPATCH_CMD_BindBufferOffsetEXT:
   42177       debug_print_unmarshal("BindBufferOffsetEXT");
   42178       _mesa_unmarshal_BindBufferOffsetEXT(ctx, (const struct marshal_cmd_BindBufferOffsetEXT *) cmd);
   42179       break;
   42180    case DISPATCH_CMD_ProvokingVertex:
   42181       debug_print_unmarshal("ProvokingVertex");
   42182       _mesa_unmarshal_ProvokingVertex(ctx, (const struct marshal_cmd_ProvokingVertex *) cmd);
   42183       break;
   42184    case DISPATCH_CMD_VertexAttribs4fvNV:
   42185       debug_print_unmarshal("VertexAttribs4fvNV");
   42186       _mesa_unmarshal_VertexAttribs4fvNV(ctx, (const struct marshal_cmd_VertexAttribs4fvNV *) cmd);
   42187       break;
   42188    case DISPATCH_CMD_Vertex2i:
   42189       debug_print_unmarshal("Vertex2i");
   42190       _mesa_unmarshal_Vertex2i(ctx, (const struct marshal_cmd_Vertex2i *) cmd);
   42191       break;
   42192    case DISPATCH_CMD_GetQueryBufferObjecti64v:
   42193       debug_print_unmarshal("GetQueryBufferObjecti64v");
   42194       _mesa_unmarshal_GetQueryBufferObjecti64v(ctx, (const struct marshal_cmd_GetQueryBufferObjecti64v *) cmd);
   42195       break;
   42196    case DISPATCH_CMD_RasterPos2fv:
   42197       debug_print_unmarshal("RasterPos2fv");
   42198       _mesa_unmarshal_RasterPos2fv(ctx, (const struct marshal_cmd_RasterPos2fv *) cmd);
   42199       break;
   42200    case DISPATCH_CMD_TexCoord1fv:
   42201       debug_print_unmarshal("TexCoord1fv");
   42202       _mesa_unmarshal_TexCoord1fv(ctx, (const struct marshal_cmd_TexCoord1fv *) cmd);
   42203       break;
   42204    case DISPATCH_CMD_MultiTexCoord4dv:
   42205       debug_print_unmarshal("MultiTexCoord4dv");
   42206       _mesa_unmarshal_MultiTexCoord4dv(ctx, (const struct marshal_cmd_MultiTexCoord4dv *) cmd);
   42207       break;
   42208    case DISPATCH_CMD_ProgramEnvParameter4fvARB:
   42209       debug_print_unmarshal("ProgramEnvParameter4fvARB");
   42210       _mesa_unmarshal_ProgramEnvParameter4fvARB(ctx, (const struct marshal_cmd_ProgramEnvParameter4fvARB *) cmd);
   42211       break;
   42212    case DISPATCH_CMD_RasterPos4fv:
   42213       debug_print_unmarshal("RasterPos4fv");
   42214       _mesa_unmarshal_RasterPos4fv(ctx, (const struct marshal_cmd_RasterPos4fv *) cmd);
   42215       break;
   42216    case DISPATCH_CMD_PushMatrix:
   42217       debug_print_unmarshal("PushMatrix");
   42218       _mesa_unmarshal_PushMatrix(ctx, (const struct marshal_cmd_PushMatrix *) cmd);
   42219       break;
   42220    case DISPATCH_CMD_EndList:
   42221       debug_print_unmarshal("EndList");
   42222       _mesa_unmarshal_EndList(ctx, (const struct marshal_cmd_EndList *) cmd);
   42223       break;
   42224    case DISPATCH_CMD_DrawRangeElements:
   42225       debug_print_unmarshal("DrawRangeElements");
   42226       _mesa_unmarshal_DrawRangeElements(ctx, (const struct marshal_cmd_DrawRangeElements *) cmd);
   42227       break;
   42228    case DISPATCH_CMD_DrawTexfvOES:
   42229       debug_print_unmarshal("DrawTexfvOES");
   42230       _mesa_unmarshal_DrawTexfvOES(ctx, (const struct marshal_cmd_DrawTexfvOES *) cmd);
   42231       break;
   42232    case DISPATCH_CMD_BlendFunciARB:
   42233       debug_print_unmarshal("BlendFunciARB");
   42234       _mesa_unmarshal_BlendFunciARB(ctx, (const struct marshal_cmd_BlendFunciARB *) cmd);
   42235       break;
   42236    case DISPATCH_CMD_ClearNamedFramebufferfi:
   42237       debug_print_unmarshal("ClearNamedFramebufferfi");
   42238       _mesa_unmarshal_ClearNamedFramebufferfi(ctx, (const struct marshal_cmd_ClearNamedFramebufferfi *) cmd);
   42239       break;
   42240    case DISPATCH_CMD_Uniform2ui:
   42241       debug_print_unmarshal("Uniform2ui");
   42242       _mesa_unmarshal_Uniform2ui(ctx, (const struct marshal_cmd_Uniform2ui *) cmd);
   42243       break;
   42244    case DISPATCH_CMD_ScissorIndexed:
   42245       debug_print_unmarshal("ScissorIndexed");
   42246       _mesa_unmarshal_ScissorIndexed(ctx, (const struct marshal_cmd_ScissorIndexed *) cmd);
   42247       break;
   42248    case DISPATCH_CMD_End:
   42249       debug_print_unmarshal("End");
   42250       _mesa_unmarshal_End(ctx, (const struct marshal_cmd_End *) cmd);
   42251       break;
   42252    case DISPATCH_CMD_NamedFramebufferParameteri:
   42253       debug_print_unmarshal("NamedFramebufferParameteri");
   42254       _mesa_unmarshal_NamedFramebufferParameteri(ctx, (const struct marshal_cmd_NamedFramebufferParameteri *) cmd);
   42255       break;
   42256    case DISPATCH_CMD_Enable:
   42257       debug_print_unmarshal("Enable");
   42258       _mesa_unmarshal_Enable(ctx, (const struct marshal_cmd_Enable *) cmd);
   42259       break;
   42260    case DISPATCH_CMD_Normal3x:
   42261       debug_print_unmarshal("Normal3x");
   42262       _mesa_unmarshal_Normal3x(ctx, (const struct marshal_cmd_Normal3x *) cmd);
   42263       break;
   42264    case DISPATCH_CMD_VertexAttrib4fARB:
   42265       debug_print_unmarshal("VertexAttrib4fARB");
   42266       _mesa_unmarshal_VertexAttrib4fARB(ctx, (const struct marshal_cmd_VertexAttrib4fARB *) cmd);
   42267       break;
   42268    case DISPATCH_CMD_TexCoord4fv:
   42269       debug_print_unmarshal("TexCoord4fv");
   42270       _mesa_unmarshal_TexCoord4fv(ctx, (const struct marshal_cmd_TexCoord4fv *) cmd);
   42271       break;
   42272    case DISPATCH_CMD_InvalidateTexSubImage:
   42273       debug_print_unmarshal("InvalidateTexSubImage");
   42274       _mesa_unmarshal_InvalidateTexSubImage(ctx, (const struct marshal_cmd_InvalidateTexSubImage *) cmd);
   42275       break;
   42276    case DISPATCH_CMD_Normal3s:
   42277       debug_print_unmarshal("Normal3s");
   42278       _mesa_unmarshal_Normal3s(ctx, (const struct marshal_cmd_Normal3s *) cmd);
   42279       break;
   42280    case DISPATCH_CMD_Normal3i:
   42281       debug_print_unmarshal("Normal3i");
   42282       _mesa_unmarshal_Normal3i(ctx, (const struct marshal_cmd_Normal3i *) cmd);
   42283       break;
   42284    case DISPATCH_CMD_Normal3b:
   42285       debug_print_unmarshal("Normal3b");
   42286       _mesa_unmarshal_Normal3b(ctx, (const struct marshal_cmd_Normal3b *) cmd);
   42287       break;
   42288    case DISPATCH_CMD_Normal3d:
   42289       debug_print_unmarshal("Normal3d");
   42290       _mesa_unmarshal_Normal3d(ctx, (const struct marshal_cmd_Normal3d *) cmd);
   42291       break;
   42292    case DISPATCH_CMD_Normal3f:
   42293       debug_print_unmarshal("Normal3f");
   42294       _mesa_unmarshal_Normal3f(ctx, (const struct marshal_cmd_Normal3f *) cmd);
   42295       break;
   42296    case DISPATCH_CMD_Indexi:
   42297       debug_print_unmarshal("Indexi");
   42298       _mesa_unmarshal_Indexi(ctx, (const struct marshal_cmd_Indexi *) cmd);
   42299       break;
   42300    case DISPATCH_CMD_Uniform1uiv:
   42301       debug_print_unmarshal("Uniform1uiv");
   42302       _mesa_unmarshal_Uniform1uiv(ctx, (const struct marshal_cmd_Uniform1uiv *) cmd);
   42303       break;
   42304    case DISPATCH_CMD_VertexAttribI2uiEXT:
   42305       debug_print_unmarshal("VertexAttribI2uiEXT");
   42306       _mesa_unmarshal_VertexAttribI2uiEXT(ctx, (const struct marshal_cmd_VertexAttribI2uiEXT *) cmd);
   42307       break;
   42308    case DISPATCH_CMD_Indexf:
   42309       debug_print_unmarshal("Indexf");
   42310       _mesa_unmarshal_Indexf(ctx, (const struct marshal_cmd_Indexf *) cmd);
   42311       break;
   42312    case DISPATCH_CMD_Indexd:
   42313       debug_print_unmarshal("Indexd");
   42314       _mesa_unmarshal_Indexd(ctx, (const struct marshal_cmd_Indexd *) cmd);
   42315       break;
   42316    case DISPATCH_CMD_Indexs:
   42317       debug_print_unmarshal("Indexs");
   42318       _mesa_unmarshal_Indexs(ctx, (const struct marshal_cmd_Indexs *) cmd);
   42319       break;
   42320    case DISPATCH_CMD_Vertex2d:
   42321       debug_print_unmarshal("Vertex2d");
   42322       _mesa_unmarshal_Vertex2d(ctx, (const struct marshal_cmd_Vertex2d *) cmd);
   42323       break;
   42324    case DISPATCH_CMD_Vertex2f:
   42325       debug_print_unmarshal("Vertex2f");
   42326       _mesa_unmarshal_Vertex2f(ctx, (const struct marshal_cmd_Vertex2f *) cmd);
   42327       break;
   42328    case DISPATCH_CMD_Color4bv:
   42329       debug_print_unmarshal("Color4bv");
   42330       _mesa_unmarshal_Color4bv(ctx, (const struct marshal_cmd_Color4bv *) cmd);
   42331       break;
   42332    case DISPATCH_CMD_ProgramUniformMatrix3x2dv:
   42333       debug_print_unmarshal("ProgramUniformMatrix3x2dv");
   42334       _mesa_unmarshal_ProgramUniformMatrix3x2dv(ctx, (const struct marshal_cmd_ProgramUniformMatrix3x2dv *) cmd);
   42335       break;
   42336    case DISPATCH_CMD_VertexAttrib2fvNV:
   42337       debug_print_unmarshal("VertexAttrib2fvNV");
   42338       _mesa_unmarshal_VertexAttrib2fvNV(ctx, (const struct marshal_cmd_VertexAttrib2fvNV *) cmd);
   42339       break;
   42340    case DISPATCH_CMD_Vertex2s:
   42341       debug_print_unmarshal("Vertex2s");
   42342       _mesa_unmarshal_Vertex2s(ctx, (const struct marshal_cmd_Vertex2s *) cmd);
   42343       break;
   42344    case DISPATCH_CMD_ActiveTexture:
   42345       debug_print_unmarshal("ActiveTexture");
   42346       _mesa_unmarshal_ActiveTexture(ctx, (const struct marshal_cmd_ActiveTexture *) cmd);
   42347       break;
   42348    case DISPATCH_CMD_DrawTexxOES:
   42349       debug_print_unmarshal("DrawTexxOES");
   42350       _mesa_unmarshal_DrawTexxOES(ctx, (const struct marshal_cmd_DrawTexxOES *) cmd);
   42351       break;
   42352    case DISPATCH_CMD_MultiTexCoordP3ui:
   42353       debug_print_unmarshal("MultiTexCoordP3ui");
   42354       _mesa_unmarshal_MultiTexCoordP3ui(ctx, (const struct marshal_cmd_MultiTexCoordP3ui *) cmd);
   42355       break;
   42356    case DISPATCH_CMD_DrawBuffer:
   42357       debug_print_unmarshal("DrawBuffer");
   42358       _mesa_unmarshal_DrawBuffer(ctx, (const struct marshal_cmd_DrawBuffer *) cmd);
   42359       break;
   42360    case DISPATCH_CMD_MultiTexCoord2dv:
   42361       debug_print_unmarshal("MultiTexCoord2dv");
   42362       _mesa_unmarshal_MultiTexCoord2dv(ctx, (const struct marshal_cmd_MultiTexCoord2dv *) cmd);
   42363       break;
   42364    case DISPATCH_CMD_BlendFunc:
   42365       debug_print_unmarshal("BlendFunc");
   42366       _mesa_unmarshal_BlendFunc(ctx, (const struct marshal_cmd_BlendFunc *) cmd);
   42367       break;
   42368    case DISPATCH_CMD_NamedRenderbufferStorageMultisample:
   42369       debug_print_unmarshal("NamedRenderbufferStorageMultisample");
   42370       _mesa_unmarshal_NamedRenderbufferStorageMultisample(ctx, (const struct marshal_cmd_NamedRenderbufferStorageMultisample *) cmd);
   42371       break;
   42372    case DISPATCH_CMD_ColorMaterial:
   42373       debug_print_unmarshal("ColorMaterial");
   42374       _mesa_unmarshal_ColorMaterial(ctx, (const struct marshal_cmd_ColorMaterial *) cmd);
   42375       break;
   42376    case DISPATCH_CMD_RasterPos3sv:
   42377       debug_print_unmarshal("RasterPos3sv");
   42378       _mesa_unmarshal_RasterPos3sv(ctx, (const struct marshal_cmd_RasterPos3sv *) cmd);
   42379       break;
   42380    case DISPATCH_CMD_TexCoordP2ui:
   42381       debug_print_unmarshal("TexCoordP2ui");
   42382       _mesa_unmarshal_TexCoordP2ui(ctx, (const struct marshal_cmd_TexCoordP2ui *) cmd);
   42383       break;
   42384    case DISPATCH_CMD_VertexAttrib3fvARB:
   42385       debug_print_unmarshal("VertexAttrib3fvARB");
   42386       _mesa_unmarshal_VertexAttrib3fvARB(ctx, (const struct marshal_cmd_VertexAttrib3fvARB *) cmd);
   42387       break;
   42388    case DISPATCH_CMD_ProgramUniformMatrix3x4fv:
   42389       debug_print_unmarshal("ProgramUniformMatrix3x4fv");
   42390       _mesa_unmarshal_ProgramUniformMatrix3x4fv(ctx, (const struct marshal_cmd_ProgramUniformMatrix3x4fv *) cmd);
   42391       break;
   42392    case DISPATCH_CMD_TexCoord3i:
   42393       debug_print_unmarshal("TexCoord3i");
   42394       _mesa_unmarshal_TexCoord3i(ctx, (const struct marshal_cmd_TexCoord3i *) cmd);
   42395       break;
   42396    case DISPATCH_CMD_CopyColorTable:
   42397       debug_print_unmarshal("CopyColorTable");
   42398       _mesa_unmarshal_CopyColorTable(ctx, (const struct marshal_cmd_CopyColorTable *) cmd);
   42399       break;
   42400    case DISPATCH_CMD_Frustum:
   42401       debug_print_unmarshal("Frustum");
   42402       _mesa_unmarshal_Frustum(ctx, (const struct marshal_cmd_Frustum *) cmd);
   42403       break;
   42404    case DISPATCH_CMD_TexCoord3d:
   42405       debug_print_unmarshal("TexCoord3d");
   42406       _mesa_unmarshal_TexCoord3d(ctx, (const struct marshal_cmd_TexCoord3d *) cmd);
   42407       break;
   42408    case DISPATCH_CMD_TexCoord3f:
   42409       debug_print_unmarshal("TexCoord3f");
   42410       _mesa_unmarshal_TexCoord3f(ctx, (const struct marshal_cmd_TexCoord3f *) cmd);
   42411       break;
   42412    case DISPATCH_CMD_DepthRangeArrayv:
   42413       debug_print_unmarshal("DepthRangeArrayv");
   42414       _mesa_unmarshal_DepthRangeArrayv(ctx, (const struct marshal_cmd_DepthRangeArrayv *) cmd);
   42415       break;
   42416    case DISPATCH_CMD_DeleteTextures:
   42417       debug_print_unmarshal("DeleteTextures");
   42418       _mesa_unmarshal_DeleteTextures(ctx, (const struct marshal_cmd_DeleteTextures *) cmd);
   42419       break;
   42420    case DISPATCH_CMD_TexCoordPointerEXT:
   42421       debug_print_unmarshal("TexCoordPointerEXT");
   42422       _mesa_unmarshal_TexCoordPointerEXT(ctx, (const struct marshal_cmd_TexCoordPointerEXT *) cmd);
   42423       break;
   42424    case DISPATCH_CMD_TexCoord3s:
   42425       debug_print_unmarshal("TexCoord3s");
   42426       _mesa_unmarshal_TexCoord3s(ctx, (const struct marshal_cmd_TexCoord3s *) cmd);
   42427       break;
   42428    case DISPATCH_CMD_ClearAccum:
   42429       debug_print_unmarshal("ClearAccum");
   42430       _mesa_unmarshal_ClearAccum(ctx, (const struct marshal_cmd_ClearAccum *) cmd);
   42431       break;
   42432    case DISPATCH_CMD_TexCoord4iv:
   42433       debug_print_unmarshal("TexCoord4iv");
   42434       _mesa_unmarshal_TexCoord4iv(ctx, (const struct marshal_cmd_TexCoord4iv *) cmd);
   42435       break;
   42436    case DISPATCH_CMD_TexStorage3D:
   42437       debug_print_unmarshal("TexStorage3D");
   42438       _mesa_unmarshal_TexStorage3D(ctx, (const struct marshal_cmd_TexStorage3D *) cmd);
   42439       break;
   42440    case DISPATCH_CMD_Uniform2i64ARB:
   42441       debug_print_unmarshal("Uniform2i64ARB");
   42442       _mesa_unmarshal_Uniform2i64ARB(ctx, (const struct marshal_cmd_Uniform2i64ARB *) cmd);
   42443       break;
   42444    case DISPATCH_CMD_FramebufferTexture3D:
   42445       debug_print_unmarshal("FramebufferTexture3D");
   42446       _mesa_unmarshal_FramebufferTexture3D(ctx, (const struct marshal_cmd_FramebufferTexture3D *) cmd);
   42447       break;
   42448    case DISPATCH_CMD_VertexAttrib2fNV:
   42449       debug_print_unmarshal("VertexAttrib2fNV");
   42450       _mesa_unmarshal_VertexAttrib2fNV(ctx, (const struct marshal_cmd_VertexAttrib2fNV *) cmd);
   42451       break;
   42452    case DISPATCH_CMD_CopyTexImage2D:
   42453       debug_print_unmarshal("CopyTexImage2D");
   42454       _mesa_unmarshal_CopyTexImage2D(ctx, (const struct marshal_cmd_CopyTexImage2D *) cmd);
   42455       break;
   42456    case DISPATCH_CMD_Vertex3fv:
   42457       debug_print_unmarshal("Vertex3fv");
   42458       _mesa_unmarshal_Vertex3fv(ctx, (const struct marshal_cmd_Vertex3fv *) cmd);
   42459       break;
   42460    case DISPATCH_CMD_ProgramUniform2i64vARB:
   42461       debug_print_unmarshal("ProgramUniform2i64vARB");
   42462       _mesa_unmarshal_ProgramUniform2i64vARB(ctx, (const struct marshal_cmd_ProgramUniform2i64vARB *) cmd);
   42463       break;
   42464    case DISPATCH_CMD_MultiTexCoordP2ui:
   42465       debug_print_unmarshal("MultiTexCoordP2ui");
   42466       _mesa_unmarshal_MultiTexCoordP2ui(ctx, (const struct marshal_cmd_MultiTexCoordP2ui *) cmd);
   42467       break;
   42468    case DISPATCH_CMD_VertexAttribs1dvNV:
   42469       debug_print_unmarshal("VertexAttribs1dvNV");
   42470       _mesa_unmarshal_VertexAttribs1dvNV(ctx, (const struct marshal_cmd_VertexAttribs1dvNV *) cmd);
   42471       break;
   42472    case DISPATCH_CMD_ImportSemaphoreFdEXT:
   42473       debug_print_unmarshal("ImportSemaphoreFdEXT");
   42474       _mesa_unmarshal_ImportSemaphoreFdEXT(ctx, (const struct marshal_cmd_ImportSemaphoreFdEXT *) cmd);
   42475       break;
   42476    case DISPATCH_CMD_EdgeFlagPointerEXT:
   42477       debug_print_unmarshal("EdgeFlagPointerEXT");
   42478       _mesa_unmarshal_EdgeFlagPointerEXT(ctx, (const struct marshal_cmd_EdgeFlagPointerEXT *) cmd);
   42479       break;
   42480    case DISPATCH_CMD_VertexAttribs2svNV:
   42481       debug_print_unmarshal("VertexAttribs2svNV");
   42482       _mesa_unmarshal_VertexAttribs2svNV(ctx, (const struct marshal_cmd_VertexAttribs2svNV *) cmd);
   42483       break;
   42484    case DISPATCH_CMD_BlendEquationiARB:
   42485       debug_print_unmarshal("BlendEquationiARB");
   42486       _mesa_unmarshal_BlendEquationiARB(ctx, (const struct marshal_cmd_BlendEquationiARB *) cmd);
   42487       break;
   42488    case DISPATCH_CMD_PointSizex:
   42489       debug_print_unmarshal("PointSizex");
   42490       _mesa_unmarshal_PointSizex(ctx, (const struct marshal_cmd_PointSizex *) cmd);
   42491       break;
   42492    case DISPATCH_CMD_PolygonMode:
   42493       debug_print_unmarshal("PolygonMode");
   42494       _mesa_unmarshal_PolygonMode(ctx, (const struct marshal_cmd_PolygonMode *) cmd);
   42495       break;
   42496    case DISPATCH_CMD_SecondaryColor3iv:
   42497       debug_print_unmarshal("SecondaryColor3iv");
   42498       _mesa_unmarshal_SecondaryColor3iv(ctx, (const struct marshal_cmd_SecondaryColor3iv *) cmd);
   42499       break;
   42500    case DISPATCH_CMD_VertexAttribI1iEXT:
   42501       debug_print_unmarshal("VertexAttribI1iEXT");
   42502       _mesa_unmarshal_VertexAttribI1iEXT(ctx, (const struct marshal_cmd_VertexAttribI1iEXT *) cmd);
   42503       break;
   42504    case DISPATCH_CMD_VertexAttrib4Niv:
   42505       debug_print_unmarshal("VertexAttrib4Niv");
   42506       _mesa_unmarshal_VertexAttrib4Niv(ctx, (const struct marshal_cmd_VertexAttrib4Niv *) cmd);
   42507       break;
   42508    case DISPATCH_CMD_LinkProgram:
   42509       debug_print_unmarshal("LinkProgram");
   42510       _mesa_unmarshal_LinkProgram(ctx, (const struct marshal_cmd_LinkProgram *) cmd);
   42511       break;
   42512    case DISPATCH_CMD_ProgramUniform4d:
   42513       debug_print_unmarshal("ProgramUniform4d");
   42514       _mesa_unmarshal_ProgramUniform4d(ctx, (const struct marshal_cmd_ProgramUniform4d *) cmd);
   42515       break;
   42516    case DISPATCH_CMD_ProgramUniform4f:
   42517       debug_print_unmarshal("ProgramUniform4f");
   42518       _mesa_unmarshal_ProgramUniform4f(ctx, (const struct marshal_cmd_ProgramUniform4f *) cmd);
   42519       break;
   42520    case DISPATCH_CMD_ProgramUniform4i:
   42521       debug_print_unmarshal("ProgramUniform4i");
   42522       _mesa_unmarshal_ProgramUniform4i(ctx, (const struct marshal_cmd_ProgramUniform4i *) cmd);
   42523       break;
   42524    case DISPATCH_CMD_VertexAttrib4d:
   42525       debug_print_unmarshal("VertexAttrib4d");
   42526       _mesa_unmarshal_VertexAttrib4d(ctx, (const struct marshal_cmd_VertexAttrib4d *) cmd);
   42527       break;
   42528    case DISPATCH_CMD_ProgramUniform4ui64vARB:
   42529       debug_print_unmarshal("ProgramUniform4ui64vARB");
   42530       _mesa_unmarshal_ProgramUniform4ui64vARB(ctx, (const struct marshal_cmd_ProgramUniform4ui64vARB *) cmd);
   42531       break;
   42532    case DISPATCH_CMD_WindowPos4sMESA:
   42533       debug_print_unmarshal("WindowPos4sMESA");
   42534       _mesa_unmarshal_WindowPos4sMESA(ctx, (const struct marshal_cmd_WindowPos4sMESA *) cmd);
   42535       break;
   42536    case DISPATCH_CMD_VertexAttrib4s:
   42537       debug_print_unmarshal("VertexAttrib4s");
   42538       _mesa_unmarshal_VertexAttrib4s(ctx, (const struct marshal_cmd_VertexAttrib4s *) cmd);
   42539       break;
   42540    case DISPATCH_CMD_ProgramUniform1i64vARB:
   42541       debug_print_unmarshal("ProgramUniform1i64vARB");
   42542       _mesa_unmarshal_ProgramUniform1i64vARB(ctx, (const struct marshal_cmd_ProgramUniform1i64vARB *) cmd);
   42543       break;
   42544    case DISPATCH_CMD_VertexAttrib1dvNV:
   42545       debug_print_unmarshal("VertexAttrib1dvNV");
   42546       _mesa_unmarshal_VertexAttrib1dvNV(ctx, (const struct marshal_cmd_VertexAttrib1dvNV *) cmd);
   42547       break;
   42548    case DISPATCH_CMD_TexStorage3DMultisample:
   42549       debug_print_unmarshal("TexStorage3DMultisample");
   42550       _mesa_unmarshal_TexStorage3DMultisample(ctx, (const struct marshal_cmd_TexStorage3DMultisample *) cmd);
   42551       break;
   42552    case DISPATCH_CMD_ScissorIndexedv:
   42553       debug_print_unmarshal("ScissorIndexedv");
   42554       _mesa_unmarshal_ScissorIndexedv(ctx, (const struct marshal_cmd_ScissorIndexedv *) cmd);
   42555       break;
   42556    case DISPATCH_CMD_Uniform2dv:
   42557       debug_print_unmarshal("Uniform2dv");
   42558       _mesa_unmarshal_Uniform2dv(ctx, (const struct marshal_cmd_Uniform2dv *) cmd);
   42559       break;
   42560    case DISPATCH_CMD_VertexAttrib4dv:
   42561       debug_print_unmarshal("VertexAttrib4dv");
   42562       _mesa_unmarshal_VertexAttrib4dv(ctx, (const struct marshal_cmd_VertexAttrib4dv *) cmd);
   42563       break;
   42564    case DISPATCH_CMD_EvalCoord2dv:
   42565       debug_print_unmarshal("EvalCoord2dv");
   42566       _mesa_unmarshal_EvalCoord2dv(ctx, (const struct marshal_cmd_EvalCoord2dv *) cmd);
   42567       break;
   42568    case DISPATCH_CMD_VertexAttrib1fNV:
   42569       debug_print_unmarshal("VertexAttrib1fNV");
   42570       _mesa_unmarshal_VertexAttrib1fNV(ctx, (const struct marshal_cmd_VertexAttrib1fNV *) cmd);
   42571       break;
   42572    case DISPATCH_CMD_RasterPos2iv:
   42573       debug_print_unmarshal("RasterPos2iv");
   42574       _mesa_unmarshal_RasterPos2iv(ctx, (const struct marshal_cmd_RasterPos2iv *) cmd);
   42575       break;
   42576    case DISPATCH_CMD_FrontFace:
   42577       debug_print_unmarshal("FrontFace");
   42578       _mesa_unmarshal_FrontFace(ctx, (const struct marshal_cmd_FrontFace *) cmd);
   42579       break;
   42580    case DISPATCH_CMD_Normal3dv:
   42581       debug_print_unmarshal("Normal3dv");
   42582       _mesa_unmarshal_Normal3dv(ctx, (const struct marshal_cmd_Normal3dv *) cmd);
   42583       break;
   42584    case DISPATCH_CMD_Lightf:
   42585       debug_print_unmarshal("Lightf");
   42586       _mesa_unmarshal_Lightf(ctx, (const struct marshal_cmd_Lightf *) cmd);
   42587       break;
   42588    case DISPATCH_CMD_MatrixMode:
   42589       debug_print_unmarshal("MatrixMode");
   42590       _mesa_unmarshal_MatrixMode(ctx, (const struct marshal_cmd_MatrixMode *) cmd);
   42591       break;
   42592    case DISPATCH_CMD_Lighti:
   42593       debug_print_unmarshal("Lighti");
   42594       _mesa_unmarshal_Lighti(ctx, (const struct marshal_cmd_Lighti *) cmd);
   42595       break;
   42596    case DISPATCH_CMD_Lightx:
   42597       debug_print_unmarshal("Lightx");
   42598       _mesa_unmarshal_Lightx(ctx, (const struct marshal_cmd_Lightx *) cmd);
   42599       break;
   42600    case DISPATCH_CMD_ProgramUniform3fv:
   42601       debug_print_unmarshal("ProgramUniform3fv");
   42602       _mesa_unmarshal_ProgramUniform3fv(ctx, (const struct marshal_cmd_ProgramUniform3fv *) cmd);
   42603       break;
   42604    case DISPATCH_CMD_MultMatrixd:
   42605       debug_print_unmarshal("MultMatrixd");
   42606       _mesa_unmarshal_MultMatrixd(ctx, (const struct marshal_cmd_MultMatrixd *) cmd);
   42607       break;
   42608    case DISPATCH_CMD_MultMatrixf:
   42609       debug_print_unmarshal("MultMatrixf");
   42610       _mesa_unmarshal_MultMatrixf(ctx, (const struct marshal_cmd_MultMatrixf *) cmd);
   42611       break;
   42612    case DISPATCH_CMD_Uniform4ui64vARB:
   42613       debug_print_unmarshal("Uniform4ui64vARB");
   42614       _mesa_unmarshal_Uniform4ui64vARB(ctx, (const struct marshal_cmd_Uniform4ui64vARB *) cmd);
   42615       break;
   42616    case DISPATCH_CMD_MultiTexCoord4fvARB:
   42617       debug_print_unmarshal("MultiTexCoord4fvARB");
   42618       _mesa_unmarshal_MultiTexCoord4fvARB(ctx, (const struct marshal_cmd_MultiTexCoord4fvARB *) cmd);
   42619       break;
   42620    case DISPATCH_CMD_UniformMatrix2x3fv:
   42621       debug_print_unmarshal("UniformMatrix2x3fv");
   42622       _mesa_unmarshal_UniformMatrix2x3fv(ctx, (const struct marshal_cmd_UniformMatrix2x3fv *) cmd);
   42623       break;
   42624    case DISPATCH_CMD_SamplerParameterf:
   42625       debug_print_unmarshal("SamplerParameterf");
   42626       _mesa_unmarshal_SamplerParameterf(ctx, (const struct marshal_cmd_SamplerParameterf *) cmd);
   42627       break;
   42628    case DISPATCH_CMD_UniformMatrix3dv:
   42629       debug_print_unmarshal("UniformMatrix3dv");
   42630       _mesa_unmarshal_UniformMatrix3dv(ctx, (const struct marshal_cmd_UniformMatrix3dv *) cmd);
   42631       break;
   42632    case DISPATCH_CMD_PointParameterx:
   42633       debug_print_unmarshal("PointParameterx");
   42634       _mesa_unmarshal_PointParameterx(ctx, (const struct marshal_cmd_PointParameterx *) cmd);
   42635       break;
   42636    case DISPATCH_CMD_DrawArrays:
   42637       debug_print_unmarshal("DrawArrays");
   42638       _mesa_unmarshal_DrawArrays(ctx, (const struct marshal_cmd_DrawArrays *) cmd);
   42639       break;
   42640    case DISPATCH_CMD_Uniform3dv:
   42641       debug_print_unmarshal("Uniform3dv");
   42642       _mesa_unmarshal_Uniform3dv(ctx, (const struct marshal_cmd_Uniform3dv *) cmd);
   42643       break;
   42644    case DISPATCH_CMD_PointParameteri:
   42645       debug_print_unmarshal("PointParameteri");
   42646       _mesa_unmarshal_PointParameteri(ctx, (const struct marshal_cmd_PointParameteri *) cmd);
   42647       break;
   42648    case DISPATCH_CMD_PointParameterf:
   42649       debug_print_unmarshal("PointParameterf");
   42650       _mesa_unmarshal_PointParameterf(ctx, (const struct marshal_cmd_PointParameterf *) cmd);
   42651       break;
   42652    case DISPATCH_CMD_VertexAttribBinding:
   42653       debug_print_unmarshal("VertexAttribBinding");
   42654       _mesa_unmarshal_VertexAttribBinding(ctx, (const struct marshal_cmd_VertexAttribBinding *) cmd);
   42655       break;
   42656    case DISPATCH_CMD_ProgramUniform1dv:
   42657       debug_print_unmarshal("ProgramUniform1dv");
   42658       _mesa_unmarshal_ProgramUniform1dv(ctx, (const struct marshal_cmd_ProgramUniform1dv *) cmd);
   42659       break;
   42660    case DISPATCH_CMD_DeleteBuffers:
   42661       debug_print_unmarshal("DeleteBuffers");
   42662       _mesa_unmarshal_DeleteBuffers(ctx, (const struct marshal_cmd_DeleteBuffers *) cmd);
   42663       break;
   42664    case DISPATCH_CMD_VertexAttribP2ui:
   42665       debug_print_unmarshal("VertexAttribP2ui");
   42666       _mesa_unmarshal_VertexAttribP2ui(ctx, (const struct marshal_cmd_VertexAttribP2ui *) cmd);
   42667       break;
   42668    case DISPATCH_CMD_ProgramUniform4dv:
   42669       debug_print_unmarshal("ProgramUniform4dv");
   42670       _mesa_unmarshal_ProgramUniform4dv(ctx, (const struct marshal_cmd_ProgramUniform4dv *) cmd);
   42671       break;
   42672    case DISPATCH_CMD_DrawTexivOES:
   42673       debug_print_unmarshal("DrawTexivOES");
   42674       _mesa_unmarshal_DrawTexivOES(ctx, (const struct marshal_cmd_DrawTexivOES *) cmd);
   42675       break;
   42676    case DISPATCH_CMD_CopyTexImage1D:
   42677       debug_print_unmarshal("CopyTexImage1D");
   42678       _mesa_unmarshal_CopyTexImage1D(ctx, (const struct marshal_cmd_CopyTexImage1D *) cmd);
   42679       break;
   42680    case DISPATCH_CMD_VertexAttribFormat:
   42681       debug_print_unmarshal("VertexAttribFormat");
   42682       _mesa_unmarshal_VertexAttribFormat(ctx, (const struct marshal_cmd_VertexAttribFormat *) cmd);
   42683       break;
   42684    case DISPATCH_CMD_Vertex3i:
   42685       debug_print_unmarshal("Vertex3i");
   42686       _mesa_unmarshal_Vertex3i(ctx, (const struct marshal_cmd_Vertex3i *) cmd);
   42687       break;
   42688    case DISPATCH_CMD_Vertex3f:
   42689       debug_print_unmarshal("Vertex3f");
   42690       _mesa_unmarshal_Vertex3f(ctx, (const struct marshal_cmd_Vertex3f *) cmd);
   42691       break;
   42692    case DISPATCH_CMD_Vertex3d:
   42693       debug_print_unmarshal("Vertex3d");
   42694       _mesa_unmarshal_Vertex3d(ctx, (const struct marshal_cmd_Vertex3d *) cmd);
   42695       break;
   42696    case DISPATCH_CMD_ReadBuffer:
   42697       debug_print_unmarshal("ReadBuffer");
   42698       _mesa_unmarshal_ReadBuffer(ctx, (const struct marshal_cmd_ReadBuffer *) cmd);
   42699       break;
   42700    case DISPATCH_CMD_ConvolutionParameteri:
   42701       debug_print_unmarshal("ConvolutionParameteri");
   42702       _mesa_unmarshal_ConvolutionParameteri(ctx, (const struct marshal_cmd_ConvolutionParameteri *) cmd);
   42703       break;
   42704    case DISPATCH_CMD_Vertex3s:
   42705       debug_print_unmarshal("Vertex3s");
   42706       _mesa_unmarshal_Vertex3s(ctx, (const struct marshal_cmd_Vertex3s *) cmd);
   42707       break;
   42708    case DISPATCH_CMD_ConvolutionParameterf:
   42709       debug_print_unmarshal("ConvolutionParameterf");
   42710       _mesa_unmarshal_ConvolutionParameterf(ctx, (const struct marshal_cmd_ConvolutionParameterf *) cmd);
   42711       break;
   42712    case DISPATCH_CMD_TexCoord3fv:
   42713       debug_print_unmarshal("TexCoord3fv");
   42714       _mesa_unmarshal_TexCoord3fv(ctx, (const struct marshal_cmd_TexCoord3fv *) cmd);
   42715       break;
   42716    case DISPATCH_CMD_TextureBarrierNV:
   42717       debug_print_unmarshal("TextureBarrierNV");
   42718       _mesa_unmarshal_TextureBarrierNV(ctx, (const struct marshal_cmd_TextureBarrierNV *) cmd);
   42719       break;
   42720    case DISPATCH_CMD_ProgramLocalParameter4fARB:
   42721       debug_print_unmarshal("ProgramLocalParameter4fARB");
   42722       _mesa_unmarshal_ProgramLocalParameter4fARB(ctx, (const struct marshal_cmd_ProgramLocalParameter4fARB *) cmd);
   42723       break;
   42724    case DISPATCH_CMD_PauseTransformFeedback:
   42725       debug_print_unmarshal("PauseTransformFeedback");
   42726       _mesa_unmarshal_PauseTransformFeedback(ctx, (const struct marshal_cmd_PauseTransformFeedback *) cmd);
   42727       break;
   42728    case DISPATCH_CMD_DeleteShader:
   42729       debug_print_unmarshal("DeleteShader");
   42730       _mesa_unmarshal_DeleteShader(ctx, (const struct marshal_cmd_DeleteShader *) cmd);
   42731       break;
   42732    case DISPATCH_CMD_NamedFramebufferRenderbuffer:
   42733       debug_print_unmarshal("NamedFramebufferRenderbuffer");
   42734       _mesa_unmarshal_NamedFramebufferRenderbuffer(ctx, (const struct marshal_cmd_NamedFramebufferRenderbuffer *) cmd);
   42735       break;
   42736    case DISPATCH_CMD_CompileShader:
   42737       debug_print_unmarshal("CompileShader");
   42738       _mesa_unmarshal_CompileShader(ctx, (const struct marshal_cmd_CompileShader *) cmd);
   42739       break;
   42740    case DISPATCH_CMD_Vertex2iv:
   42741       debug_print_unmarshal("Vertex2iv");
   42742       _mesa_unmarshal_Vertex2iv(ctx, (const struct marshal_cmd_Vertex2iv *) cmd);
   42743       break;
   42744    case DISPATCH_CMD_ResetMinmax:
   42745       debug_print_unmarshal("ResetMinmax");
   42746       _mesa_unmarshal_ResetMinmax(ctx, (const struct marshal_cmd_ResetMinmax *) cmd);
   42747       break;
   42748    case DISPATCH_CMD_SampleCoverage:
   42749       debug_print_unmarshal("SampleCoverage");
   42750       _mesa_unmarshal_SampleCoverage(ctx, (const struct marshal_cmd_SampleCoverage *) cmd);
   42751       break;
   42752    case DISPATCH_CMD_GenerateTextureMipmap:
   42753       debug_print_unmarshal("GenerateTextureMipmap");
   42754       _mesa_unmarshal_GenerateTextureMipmap(ctx, (const struct marshal_cmd_GenerateTextureMipmap *) cmd);
   42755       break;
   42756    case DISPATCH_CMD_DeleteProgramsARB:
   42757       debug_print_unmarshal("DeleteProgramsARB");
   42758       _mesa_unmarshal_DeleteProgramsARB(ctx, (const struct marshal_cmd_DeleteProgramsARB *) cmd);
   42759       break;
   42760    case DISPATCH_CMD_ShadeModel:
   42761       debug_print_unmarshal("ShadeModel");
   42762       _mesa_unmarshal_ShadeModel(ctx, (const struct marshal_cmd_ShadeModel *) cmd);
   42763       break;
   42764    case DISPATCH_CMD_DispatchCompute:
   42765       debug_print_unmarshal("DispatchCompute");
   42766       _mesa_unmarshal_DispatchCompute(ctx, (const struct marshal_cmd_DispatchCompute *) cmd);
   42767       break;
   42768    case DISPATCH_CMD_UseProgramStages:
   42769       debug_print_unmarshal("UseProgramStages");
   42770       _mesa_unmarshal_UseProgramStages(ctx, (const struct marshal_cmd_UseProgramStages *) cmd);
   42771       break;
   42772    case DISPATCH_CMD_ProgramUniformMatrix4fv:
   42773       debug_print_unmarshal("ProgramUniformMatrix4fv");
   42774       _mesa_unmarshal_ProgramUniformMatrix4fv(ctx, (const struct marshal_cmd_ProgramUniformMatrix4fv *) cmd);
   42775       break;
   42776    case DISPATCH_CMD_FramebufferRenderbuffer:
   42777       debug_print_unmarshal("FramebufferRenderbuffer");
   42778       _mesa_unmarshal_FramebufferRenderbuffer(ctx, (const struct marshal_cmd_FramebufferRenderbuffer *) cmd);
   42779       break;
   42780    case DISPATCH_CMD_ProgramStringARB:
   42781       debug_print_unmarshal("ProgramStringARB");
   42782       _mesa_unmarshal_ProgramStringARB(ctx, (const struct marshal_cmd_ProgramStringARB *) cmd);
   42783       break;
   42784    case DISPATCH_CMD_CopyTextureSubImage2D:
   42785       debug_print_unmarshal("CopyTextureSubImage2D");
   42786       _mesa_unmarshal_CopyTextureSubImage2D(ctx, (const struct marshal_cmd_CopyTextureSubImage2D *) cmd);
   42787       break;
   42788    case DISPATCH_CMD_MultiTexCoord4s:
   42789       debug_print_unmarshal("MultiTexCoord4s");
   42790       _mesa_unmarshal_MultiTexCoord4s(ctx, (const struct marshal_cmd_MultiTexCoord4s *) cmd);
   42791       break;
   42792    case DISPATCH_CMD_ViewportIndexedf:
   42793       debug_print_unmarshal("ViewportIndexedf");
   42794       _mesa_unmarshal_ViewportIndexedf(ctx, (const struct marshal_cmd_ViewportIndexedf *) cmd);
   42795       break;
   42796    case DISPATCH_CMD_MultiTexCoord4i:
   42797       debug_print_unmarshal("MultiTexCoord4i");
   42798       _mesa_unmarshal_MultiTexCoord4i(ctx, (const struct marshal_cmd_MultiTexCoord4i *) cmd);
   42799       break;
   42800    case DISPATCH_CMD_DebugMessageControl:
   42801       debug_print_unmarshal("DebugMessageControl");
   42802       _mesa_unmarshal_DebugMessageControl(ctx, (const struct marshal_cmd_DebugMessageControl *) cmd);
   42803       break;
   42804    case DISPATCH_CMD_MultiTexCoord4d:
   42805       debug_print_unmarshal("MultiTexCoord4d");
   42806       _mesa_unmarshal_MultiTexCoord4d(ctx, (const struct marshal_cmd_MultiTexCoord4d *) cmd);
   42807       break;
   42808    case DISPATCH_CMD_Translatex:
   42809       debug_print_unmarshal("Translatex");
   42810       _mesa_unmarshal_Translatex(ctx, (const struct marshal_cmd_Translatex *) cmd);
   42811       break;
   42812    case DISPATCH_CMD_MultiDrawElementsIndirectCountARB:
   42813       debug_print_unmarshal("MultiDrawElementsIndirectCountARB");
   42814       _mesa_unmarshal_MultiDrawElementsIndirectCountARB(ctx, (const struct marshal_cmd_MultiDrawElementsIndirectCountARB *) cmd);
   42815       break;
   42816    case DISPATCH_CMD_Indexsv:
   42817       debug_print_unmarshal("Indexsv");
   42818       _mesa_unmarshal_Indexsv(ctx, (const struct marshal_cmd_Indexsv *) cmd);
   42819       break;
   42820    case DISPATCH_CMD_VertexAttrib1fvARB:
   42821       debug_print_unmarshal("VertexAttrib1fvARB");
   42822       _mesa_unmarshal_VertexAttrib1fvARB(ctx, (const struct marshal_cmd_VertexAttrib1fvARB *) cmd);
   42823       break;
   42824    case DISPATCH_CMD_TexCoord2dv:
   42825       debug_print_unmarshal("TexCoord2dv");
   42826       _mesa_unmarshal_TexCoord2dv(ctx, (const struct marshal_cmd_TexCoord2dv *) cmd);
   42827       break;
   42828    case DISPATCH_CMD_Translated:
   42829       debug_print_unmarshal("Translated");
   42830       _mesa_unmarshal_Translated(ctx, (const struct marshal_cmd_Translated *) cmd);
   42831       break;
   42832    case DISPATCH_CMD_Translatef:
   42833       debug_print_unmarshal("Translatef");
   42834       _mesa_unmarshal_Translatef(ctx, (const struct marshal_cmd_Translatef *) cmd);
   42835       break;
   42836    case DISPATCH_CMD_ProgramUniform4uiv:
   42837       debug_print_unmarshal("ProgramUniform4uiv");
   42838       _mesa_unmarshal_ProgramUniform4uiv(ctx, (const struct marshal_cmd_ProgramUniform4uiv *) cmd);
   42839       break;
   42840    case DISPATCH_CMD_MultiTexCoord1fARB:
   42841       debug_print_unmarshal("MultiTexCoord1fARB");
   42842       _mesa_unmarshal_MultiTexCoord1fARB(ctx, (const struct marshal_cmd_MultiTexCoord1fARB *) cmd);
   42843       break;
   42844    case DISPATCH_CMD_SecondaryColor3d:
   42845       debug_print_unmarshal("SecondaryColor3d");
   42846       _mesa_unmarshal_SecondaryColor3d(ctx, (const struct marshal_cmd_SecondaryColor3d *) cmd);
   42847       break;
   42848    case DISPATCH_CMD_FramebufferParameteri:
   42849       debug_print_unmarshal("FramebufferParameteri");
   42850       _mesa_unmarshal_FramebufferParameteri(ctx, (const struct marshal_cmd_FramebufferParameteri *) cmd);
   42851       break;
   42852    case DISPATCH_CMD_VertexAttribs4ubvNV:
   42853       debug_print_unmarshal("VertexAttribs4ubvNV");
   42854       _mesa_unmarshal_VertexAttribs4ubvNV(ctx, (const struct marshal_cmd_VertexAttribs4ubvNV *) cmd);
   42855       break;
   42856    case DISPATCH_CMD_CopyTexSubImage1D:
   42857       debug_print_unmarshal("CopyTexSubImage1D");
   42858       _mesa_unmarshal_CopyTexSubImage1D(ctx, (const struct marshal_cmd_CopyTexSubImage1D *) cmd);
   42859       break;
   42860    case DISPATCH_CMD_StencilFunc:
   42861       debug_print_unmarshal("StencilFunc");
   42862       _mesa_unmarshal_StencilFunc(ctx, (const struct marshal_cmd_StencilFunc *) cmd);
   42863       break;
   42864    case DISPATCH_CMD_CopyPixels:
   42865       debug_print_unmarshal("CopyPixels");
   42866       _mesa_unmarshal_CopyPixels(ctx, (const struct marshal_cmd_CopyPixels *) cmd);
   42867       break;
   42868    case DISPATCH_CMD_VertexAttrib4Nubv:
   42869       debug_print_unmarshal("VertexAttrib4Nubv");
   42870       _mesa_unmarshal_VertexAttrib4Nubv(ctx, (const struct marshal_cmd_VertexAttrib4Nubv *) cmd);
   42871       break;
   42872    case DISPATCH_CMD_UniformMatrix4x2dv:
   42873       debug_print_unmarshal("UniformMatrix4x2dv");
   42874       _mesa_unmarshal_UniformMatrix4x2dv(ctx, (const struct marshal_cmd_UniformMatrix4x2dv *) cmd);
   42875       break;
   42876    case DISPATCH_CMD_VertexAttribPointer:
   42877       debug_print_unmarshal("VertexAttribPointer");
   42878       _mesa_unmarshal_VertexAttribPointer(ctx, (const struct marshal_cmd_VertexAttribPointer *) cmd);
   42879       break;
   42880    case DISPATCH_CMD_IndexMask:
   42881       debug_print_unmarshal("IndexMask");
   42882       _mesa_unmarshal_IndexMask(ctx, (const struct marshal_cmd_IndexMask *) cmd);
   42883       break;
   42884    case DISPATCH_CMD_VertexAttribIFormat:
   42885       debug_print_unmarshal("VertexAttribIFormat");
   42886       _mesa_unmarshal_VertexAttribIFormat(ctx, (const struct marshal_cmd_VertexAttribIFormat *) cmd);
   42887       break;
   42888    case DISPATCH_CMD_DrawArraysInstancedBaseInstance:
   42889       debug_print_unmarshal("DrawArraysInstancedBaseInstance");
   42890       _mesa_unmarshal_DrawArraysInstancedBaseInstance(ctx, (const struct marshal_cmd_DrawArraysInstancedBaseInstance *) cmd);
   42891       break;
   42892    case DISPATCH_CMD_TextureStorageMem3DMultisampleEXT:
   42893       debug_print_unmarshal("TextureStorageMem3DMultisampleEXT");
   42894       _mesa_unmarshal_TextureStorageMem3DMultisampleEXT(ctx, (const struct marshal_cmd_TextureStorageMem3DMultisampleEXT *) cmd);
   42895       break;
   42896    case DISPATCH_CMD_PopAttrib:
   42897       debug_print_unmarshal("PopAttrib");
   42898       _mesa_unmarshal_PopAttrib(ctx, (const struct marshal_cmd_PopAttrib *) cmd);
   42899       break;
   42900    case DISPATCH_CMD_Uniform3ui:
   42901       debug_print_unmarshal("Uniform3ui");
   42902       _mesa_unmarshal_Uniform3ui(ctx, (const struct marshal_cmd_Uniform3ui *) cmd);
   42903       break;
   42904    case DISPATCH_CMD_Color4dv:
   42905       debug_print_unmarshal("Color4dv");
   42906       _mesa_unmarshal_Color4dv(ctx, (const struct marshal_cmd_Color4dv *) cmd);
   42907       break;
   42908    case DISPATCH_CMD_DisableVertexAttribArray:
   42909       debug_print_unmarshal("DisableVertexAttribArray");
   42910       _mesa_unmarshal_DisableVertexAttribArray(ctx, (const struct marshal_cmd_DisableVertexAttribArray *) cmd);
   42911       break;
   42912    case DISPATCH_CMD_ProgramUniformMatrix3x2fv:
   42913       debug_print_unmarshal("ProgramUniformMatrix3x2fv");
   42914       _mesa_unmarshal_ProgramUniformMatrix3x2fv(ctx, (const struct marshal_cmd_ProgramUniformMatrix3x2fv *) cmd);
   42915       break;
   42916    case DISPATCH_CMD_ClipPlanex:
   42917       debug_print_unmarshal("ClipPlanex");
   42918       _mesa_unmarshal_ClipPlanex(ctx, (const struct marshal_cmd_ClipPlanex *) cmd);
   42919       break;
   42920    case DISPATCH_CMD_ClipPlanef:
   42921       debug_print_unmarshal("ClipPlanef");
   42922       _mesa_unmarshal_ClipPlanef(ctx, (const struct marshal_cmd_ClipPlanef *) cmd);
   42923       break;
   42924    case DISPATCH_CMD_ProgramUniform1ui:
   42925       debug_print_unmarshal("ProgramUniform1ui");
   42926       _mesa_unmarshal_ProgramUniform1ui(ctx, (const struct marshal_cmd_ProgramUniform1ui *) cmd);
   42927       break;
   42928    case DISPATCH_CMD_SecondaryColorPointer:
   42929       debug_print_unmarshal("SecondaryColorPointer");
   42930       _mesa_unmarshal_SecondaryColorPointer(ctx, (const struct marshal_cmd_SecondaryColorPointer *) cmd);
   42931       break;
   42932    case DISPATCH_CMD_LineStipple:
   42933       debug_print_unmarshal("LineStipple");
   42934       _mesa_unmarshal_LineStipple(ctx, (const struct marshal_cmd_LineStipple *) cmd);
   42935       break;
   42936    case DISPATCH_CMD_BeginFragmentShaderATI:
   42937       debug_print_unmarshal("BeginFragmentShaderATI");
   42938       _mesa_unmarshal_BeginFragmentShaderATI(ctx, (const struct marshal_cmd_BeginFragmentShaderATI *) cmd);
   42939       break;
   42940    case DISPATCH_CMD_TextureStorageMem2DEXT:
   42941       debug_print_unmarshal("TextureStorageMem2DEXT");
   42942       _mesa_unmarshal_TextureStorageMem2DEXT(ctx, (const struct marshal_cmd_TextureStorageMem2DEXT *) cmd);
   42943       break;
   42944    case DISPATCH_CMD_WaitSync:
   42945       debug_print_unmarshal("WaitSync");
   42946       _mesa_unmarshal_WaitSync(ctx, (const struct marshal_cmd_WaitSync *) cmd);
   42947       break;
   42948    case DISPATCH_CMD_Uniform1i64vARB:
   42949       debug_print_unmarshal("Uniform1i64vARB");
   42950       _mesa_unmarshal_Uniform1i64vARB(ctx, (const struct marshal_cmd_Uniform1i64vARB *) cmd);
   42951       break;
   42952    case DISPATCH_CMD_NewList:
   42953       debug_print_unmarshal("NewList");
   42954       _mesa_unmarshal_NewList(ctx, (const struct marshal_cmd_NewList *) cmd);
   42955       break;
   42956    case DISPATCH_CMD_TexBuffer:
   42957       debug_print_unmarshal("TexBuffer");
   42958       _mesa_unmarshal_TexBuffer(ctx, (const struct marshal_cmd_TexBuffer *) cmd);
   42959       break;
   42960    case DISPATCH_CMD_TexCoord4sv:
   42961       debug_print_unmarshal("TexCoord4sv");
   42962       _mesa_unmarshal_TexCoord4sv(ctx, (const struct marshal_cmd_TexCoord4sv *) cmd);
   42963       break;
   42964    case DISPATCH_CMD_TexCoord1f:
   42965       debug_print_unmarshal("TexCoord1f");
   42966       _mesa_unmarshal_TexCoord1f(ctx, (const struct marshal_cmd_TexCoord1f *) cmd);
   42967       break;
   42968    case DISPATCH_CMD_TexCoord1d:
   42969       debug_print_unmarshal("TexCoord1d");
   42970       _mesa_unmarshal_TexCoord1d(ctx, (const struct marshal_cmd_TexCoord1d *) cmd);
   42971       break;
   42972    case DISPATCH_CMD_TexCoord1i:
   42973       debug_print_unmarshal("TexCoord1i");
   42974       _mesa_unmarshal_TexCoord1i(ctx, (const struct marshal_cmd_TexCoord1i *) cmd);
   42975       break;
   42976    case DISPATCH_CMD_TexCoord1s:
   42977       debug_print_unmarshal("TexCoord1s");
   42978       _mesa_unmarshal_TexCoord1s(ctx, (const struct marshal_cmd_TexCoord1s *) cmd);
   42979       break;
   42980    case DISPATCH_CMD_Uniform1ui:
   42981       debug_print_unmarshal("Uniform1ui");
   42982       _mesa_unmarshal_Uniform1ui(ctx, (const struct marshal_cmd_Uniform1ui *) cmd);
   42983       break;
   42984    case DISPATCH_CMD_TexStorage1D:
   42985       debug_print_unmarshal("TexStorage1D");
   42986       _mesa_unmarshal_TexStorage1D(ctx, (const struct marshal_cmd_TexStorage1D *) cmd);
   42987       break;
   42988    case DISPATCH_CMD_BlitFramebuffer:
   42989       debug_print_unmarshal("BlitFramebuffer");
   42990       _mesa_unmarshal_BlitFramebuffer(ctx, (const struct marshal_cmd_BlitFramebuffer *) cmd);
   42991       break;
   42992    case DISPATCH_CMD_TextureParameterf:
   42993       debug_print_unmarshal("TextureParameterf");
   42994       _mesa_unmarshal_TextureParameterf(ctx, (const struct marshal_cmd_TextureParameterf *) cmd);
   42995       break;
   42996    case DISPATCH_CMD_FramebufferTexture1D:
   42997       debug_print_unmarshal("FramebufferTexture1D");
   42998       _mesa_unmarshal_FramebufferTexture1D(ctx, (const struct marshal_cmd_FramebufferTexture1D *) cmd);
   42999       break;
   43000    case DISPATCH_CMD_TextureParameteri:
   43001       debug_print_unmarshal("TextureParameteri");
   43002       _mesa_unmarshal_TextureParameteri(ctx, (const struct marshal_cmd_TextureParameteri *) cmd);
   43003       break;
   43004    case DISPATCH_CMD_TexCoordP4ui:
   43005       debug_print_unmarshal("TexCoordP4ui");
   43006       _mesa_unmarshal_TexCoordP4ui(ctx, (const struct marshal_cmd_TexCoordP4ui *) cmd);
   43007       break;
   43008    case DISPATCH_CMD_VertexAttrib1sv:
   43009       debug_print_unmarshal("VertexAttrib1sv");
   43010       _mesa_unmarshal_VertexAttrib1sv(ctx, (const struct marshal_cmd_VertexAttrib1sv *) cmd);
   43011       break;
   43012    case DISPATCH_CMD_WindowPos4dMESA:
   43013       debug_print_unmarshal("WindowPos4dMESA");
   43014       _mesa_unmarshal_WindowPos4dMESA(ctx, (const struct marshal_cmd_WindowPos4dMESA *) cmd);
   43015       break;
   43016    case DISPATCH_CMD_Vertex3dv:
   43017       debug_print_unmarshal("Vertex3dv");
   43018       _mesa_unmarshal_Vertex3dv(ctx, (const struct marshal_cmd_Vertex3dv *) cmd);
   43019       break;
   43020    case DISPATCH_CMD_VertexAttribL2d:
   43021       debug_print_unmarshal("VertexAttribL2d");
   43022       _mesa_unmarshal_VertexAttribL2d(ctx, (const struct marshal_cmd_VertexAttribL2d *) cmd);
   43023       break;
   43024    case DISPATCH_CMD_BlendColor:
   43025       debug_print_unmarshal("BlendColor");
   43026       _mesa_unmarshal_BlendColor(ctx, (const struct marshal_cmd_BlendColor *) cmd);
   43027       break;
   43028    case DISPATCH_CMD_VertexAttribs2dvNV:
   43029       debug_print_unmarshal("VertexAttribs2dvNV");
   43030       _mesa_unmarshal_VertexAttribs2dvNV(ctx, (const struct marshal_cmd_VertexAttribs2dvNV *) cmd);
   43031       break;
   43032    case DISPATCH_CMD_VertexAttrib2dvNV:
   43033       debug_print_unmarshal("VertexAttrib2dvNV");
   43034       _mesa_unmarshal_VertexAttrib2dvNV(ctx, (const struct marshal_cmd_VertexAttrib2dvNV *) cmd);
   43035       break;
   43036    case DISPATCH_CMD_ResetHistogram:
   43037       debug_print_unmarshal("ResetHistogram");
   43038       _mesa_unmarshal_ResetHistogram(ctx, (const struct marshal_cmd_ResetHistogram *) cmd);
   43039       break;
   43040    case DISPATCH_CMD_TexCoord2sv:
   43041       debug_print_unmarshal("TexCoord2sv");
   43042       _mesa_unmarshal_TexCoord2sv(ctx, (const struct marshal_cmd_TexCoord2sv *) cmd);
   43043       break;
   43044    case DISPATCH_CMD_StencilMaskSeparate:
   43045       debug_print_unmarshal("StencilMaskSeparate");
   43046       _mesa_unmarshal_StencilMaskSeparate(ctx, (const struct marshal_cmd_StencilMaskSeparate *) cmd);
   43047       break;
   43048    case DISPATCH_CMD_MultiTexCoord3sv:
   43049       debug_print_unmarshal("MultiTexCoord3sv");
   43050       _mesa_unmarshal_MultiTexCoord3sv(ctx, (const struct marshal_cmd_MultiTexCoord3sv *) cmd);
   43051       break;
   43052    case DISPATCH_CMD_TexCoord3iv:
   43053       debug_print_unmarshal("TexCoord3iv");
   43054       _mesa_unmarshal_TexCoord3iv(ctx, (const struct marshal_cmd_TexCoord3iv *) cmd);
   43055       break;
   43056    case DISPATCH_CMD_MultiTexCoord4sv:
   43057       debug_print_unmarshal("MultiTexCoord4sv");
   43058       _mesa_unmarshal_MultiTexCoord4sv(ctx, (const struct marshal_cmd_MultiTexCoord4sv *) cmd);
   43059       break;
   43060    case DISPATCH_CMD_VertexBindingDivisor:
   43061       debug_print_unmarshal("VertexBindingDivisor");
   43062       _mesa_unmarshal_VertexBindingDivisor(ctx, (const struct marshal_cmd_VertexBindingDivisor *) cmd);
   43063       break;
   43064    case DISPATCH_CMD_PrimitiveBoundingBox:
   43065       debug_print_unmarshal("PrimitiveBoundingBox");
   43066       _mesa_unmarshal_PrimitiveBoundingBox(ctx, (const struct marshal_cmd_PrimitiveBoundingBox *) cmd);
   43067       break;
   43068    case DISPATCH_CMD_UniformBlockBinding:
   43069       debug_print_unmarshal("UniformBlockBinding");
   43070       _mesa_unmarshal_UniformBlockBinding(ctx, (const struct marshal_cmd_UniformBlockBinding *) cmd);
   43071       break;
   43072    case DISPATCH_CMD_VertexAttrib4Nusv:
   43073       debug_print_unmarshal("VertexAttrib4Nusv");
   43074       _mesa_unmarshal_VertexAttrib4Nusv(ctx, (const struct marshal_cmd_VertexAttrib4Nusv *) cmd);
   43075       break;
   43076    case DISPATCH_CMD_VertexP2ui:
   43077       debug_print_unmarshal("VertexP2ui");
   43078       _mesa_unmarshal_VertexP2ui(ctx, (const struct marshal_cmd_VertexP2ui *) cmd);
   43079       break;
   43080    case DISPATCH_CMD_ProgramUniform2fv:
   43081       debug_print_unmarshal("ProgramUniform2fv");
   43082       _mesa_unmarshal_ProgramUniform2fv(ctx, (const struct marshal_cmd_ProgramUniform2fv *) cmd);
   43083       break;
   43084    case DISPATCH_CMD_TextureStorage2DEXT:
   43085       debug_print_unmarshal("TextureStorage2DEXT");
   43086       _mesa_unmarshal_TextureStorage2DEXT(ctx, (const struct marshal_cmd_TextureStorage2DEXT *) cmd);
   43087       break;
   43088    case DISPATCH_CMD_DrawTransformFeedbackInstanced:
   43089       debug_print_unmarshal("DrawTransformFeedbackInstanced");
   43090       _mesa_unmarshal_DrawTransformFeedbackInstanced(ctx, (const struct marshal_cmd_DrawTransformFeedbackInstanced *) cmd);
   43091       break;
   43092    case DISPATCH_CMD_CopyTextureSubImage1D:
   43093       debug_print_unmarshal("CopyTextureSubImage1D");
   43094       _mesa_unmarshal_CopyTextureSubImage1D(ctx, (const struct marshal_cmd_CopyTextureSubImage1D *) cmd);
   43095       break;
   43096    case DISPATCH_CMD_ResumeTransformFeedback:
   43097       debug_print_unmarshal("ResumeTransformFeedback");
   43098       _mesa_unmarshal_ResumeTransformFeedback(ctx, (const struct marshal_cmd_ResumeTransformFeedback *) cmd);
   43099       break;
   43100    case DISPATCH_CMD_Vertex2dv:
   43101       debug_print_unmarshal("Vertex2dv");
   43102       _mesa_unmarshal_Vertex2dv(ctx, (const struct marshal_cmd_Vertex2dv *) cmd);
   43103       break;
   43104    case DISPATCH_CMD_SampleMaski:
   43105       debug_print_unmarshal("SampleMaski");
   43106       _mesa_unmarshal_SampleMaski(ctx, (const struct marshal_cmd_SampleMaski *) cmd);
   43107       break;
   43108    case DISPATCH_CMD_MultiTexCoord2iv:
   43109       debug_print_unmarshal("MultiTexCoord2iv");
   43110       _mesa_unmarshal_MultiTexCoord2iv(ctx, (const struct marshal_cmd_MultiTexCoord2iv *) cmd);
   43111       break;
   43112    case DISPATCH_CMD_DrawTransformFeedback:
   43113       debug_print_unmarshal("DrawTransformFeedback");
   43114       _mesa_unmarshal_DrawTransformFeedback(ctx, (const struct marshal_cmd_DrawTransformFeedback *) cmd);
   43115       break;
   43116    case DISPATCH_CMD_VertexAttribs3fvNV:
   43117       debug_print_unmarshal("VertexAttribs3fvNV");
   43118       _mesa_unmarshal_VertexAttribs3fvNV(ctx, (const struct marshal_cmd_VertexAttribs3fvNV *) cmd);
   43119       break;
   43120    case DISPATCH_CMD_ProgramUniform2ui64vARB:
   43121       debug_print_unmarshal("ProgramUniform2ui64vARB");
   43122       _mesa_unmarshal_ProgramUniform2ui64vARB(ctx, (const struct marshal_cmd_ProgramUniform2ui64vARB *) cmd);
   43123       break;
   43124    case DISPATCH_CMD_MapGrid2d:
   43125       debug_print_unmarshal("MapGrid2d");
   43126       _mesa_unmarshal_MapGrid2d(ctx, (const struct marshal_cmd_MapGrid2d *) cmd);
   43127       break;
   43128    case DISPATCH_CMD_MapGrid2f:
   43129       debug_print_unmarshal("MapGrid2f");
   43130       _mesa_unmarshal_MapGrid2f(ctx, (const struct marshal_cmd_MapGrid2f *) cmd);
   43131       break;
   43132    case DISPATCH_CMD_SampleMapATI:
   43133       debug_print_unmarshal("SampleMapATI");
   43134       _mesa_unmarshal_SampleMapATI(ctx, (const struct marshal_cmd_SampleMapATI *) cmd);
   43135       break;
   43136    case DISPATCH_CMD_Color3usv:
   43137       debug_print_unmarshal("Color3usv");
   43138       _mesa_unmarshal_Color3usv(ctx, (const struct marshal_cmd_Color3usv *) cmd);
   43139       break;
   43140    case DISPATCH_CMD_CopyImageSubData:
   43141       debug_print_unmarshal("CopyImageSubData");
   43142       _mesa_unmarshal_CopyImageSubData(ctx, (const struct marshal_cmd_CopyImageSubData *) cmd);
   43143       break;
   43144    case DISPATCH_CMD_StencilOpSeparate:
   43145       debug_print_unmarshal("StencilOpSeparate");
   43146       _mesa_unmarshal_StencilOpSeparate(ctx, (const struct marshal_cmd_StencilOpSeparate *) cmd);
   43147       break;
   43148    case DISPATCH_CMD_ClipControl:
   43149       debug_print_unmarshal("ClipControl");
   43150       _mesa_unmarshal_ClipControl(ctx, (const struct marshal_cmd_ClipControl *) cmd);
   43151       break;
   43152    case DISPATCH_CMD_DrawTexfOES:
   43153       debug_print_unmarshal("DrawTexfOES");
   43154       _mesa_unmarshal_DrawTexfOES(ctx, (const struct marshal_cmd_DrawTexfOES *) cmd);
   43155       break;
   43156    case DISPATCH_CMD_Uniform4i64vARB:
   43157       debug_print_unmarshal("Uniform4i64vARB");
   43158       _mesa_unmarshal_Uniform4i64vARB(ctx, (const struct marshal_cmd_Uniform4i64vARB *) cmd);
   43159       break;
   43160    case DISPATCH_CMD_AttachObjectARB:
   43161       debug_print_unmarshal("AttachObjectARB");
   43162       _mesa_unmarshal_AttachObjectARB(ctx, (const struct marshal_cmd_AttachObjectARB *) cmd);
   43163       break;
   43164    case DISPATCH_CMD_Accum:
   43165       debug_print_unmarshal("Accum");
   43166       _mesa_unmarshal_Accum(ctx, (const struct marshal_cmd_Accum *) cmd);
   43167       break;
   43168    case DISPATCH_CMD_Color4x:
   43169       debug_print_unmarshal("Color4x");
   43170       _mesa_unmarshal_Color4x(ctx, (const struct marshal_cmd_Color4x *) cmd);
   43171       break;
   43172    case DISPATCH_CMD_Color4s:
   43173       debug_print_unmarshal("Color4s");
   43174       _mesa_unmarshal_Color4s(ctx, (const struct marshal_cmd_Color4s *) cmd);
   43175       break;
   43176    case DISPATCH_CMD_EnableVertexAttribArray:
   43177       debug_print_unmarshal("EnableVertexAttribArray");
   43178       _mesa_unmarshal_EnableVertexAttribArray(ctx, (const struct marshal_cmd_EnableVertexAttribArray *) cmd);
   43179       break;
   43180    case DISPATCH_CMD_Color4i:
   43181       debug_print_unmarshal("Color4i");
   43182       _mesa_unmarshal_Color4i(ctx, (const struct marshal_cmd_Color4i *) cmd);
   43183       break;
   43184    case DISPATCH_CMD_Color4f:
   43185       debug_print_unmarshal("Color4f");
   43186       _mesa_unmarshal_Color4f(ctx, (const struct marshal_cmd_Color4f *) cmd);
   43187       break;
   43188    case DISPATCH_CMD_ShaderStorageBlockBinding:
   43189       debug_print_unmarshal("ShaderStorageBlockBinding");
   43190       _mesa_unmarshal_ShaderStorageBlockBinding(ctx, (const struct marshal_cmd_ShaderStorageBlockBinding *) cmd);
   43191       break;
   43192    case DISPATCH_CMD_Color4d:
   43193       debug_print_unmarshal("Color4d");
   43194       _mesa_unmarshal_Color4d(ctx, (const struct marshal_cmd_Color4d *) cmd);
   43195       break;
   43196    case DISPATCH_CMD_Color4b:
   43197       debug_print_unmarshal("Color4b");
   43198       _mesa_unmarshal_Color4b(ctx, (const struct marshal_cmd_Color4b *) cmd);
   43199       break;
   43200    case DISPATCH_CMD_EvalCoord1fv:
   43201       debug_print_unmarshal("EvalCoord1fv");
   43202       _mesa_unmarshal_EvalCoord1fv(ctx, (const struct marshal_cmd_EvalCoord1fv *) cmd);
   43203       break;
   43204    case DISPATCH_CMD_VertexAttribLFormat:
   43205       debug_print_unmarshal("VertexAttribLFormat");
   43206       _mesa_unmarshal_VertexAttribLFormat(ctx, (const struct marshal_cmd_VertexAttribLFormat *) cmd);
   43207       break;
   43208    case DISPATCH_CMD_VertexAttribL3d:
   43209       debug_print_unmarshal("VertexAttribL3d");
   43210       _mesa_unmarshal_VertexAttribL3d(ctx, (const struct marshal_cmd_VertexAttribL3d *) cmd);
   43211       break;
   43212    case DISPATCH_CMD_StencilFuncSeparate:
   43213       debug_print_unmarshal("StencilFuncSeparate");
   43214       _mesa_unmarshal_StencilFuncSeparate(ctx, (const struct marshal_cmd_StencilFuncSeparate *) cmd);
   43215       break;
   43216    case DISPATCH_CMD_ShaderSource:
   43217       debug_print_unmarshal("ShaderSource");
   43218       _mesa_unmarshal_ShaderSource(ctx, (const struct marshal_cmd_ShaderSource *) cmd);
   43219       break;
   43220    case DISPATCH_CMD_Normal3fv:
   43221       debug_print_unmarshal("Normal3fv");
   43222       _mesa_unmarshal_Normal3fv(ctx, (const struct marshal_cmd_Normal3fv *) cmd);
   43223       break;
   43224    case DISPATCH_CMD_NormalP3ui:
   43225       debug_print_unmarshal("NormalP3ui");
   43226       _mesa_unmarshal_NormalP3ui(ctx, (const struct marshal_cmd_NormalP3ui *) cmd);
   43227       break;
   43228    case DISPATCH_CMD_MultiTexCoord3fvARB:
   43229       debug_print_unmarshal("MultiTexCoord3fvARB");
   43230       _mesa_unmarshal_MultiTexCoord3fvARB(ctx, (const struct marshal_cmd_MultiTexCoord3fvARB *) cmd);
   43231       break;
   43232    case DISPATCH_CMD_BufferData:
   43233       debug_print_unmarshal("BufferData");
   43234       _mesa_unmarshal_BufferData(ctx, (const struct marshal_cmd_BufferData *) cmd);
   43235       break;
   43236    case DISPATCH_CMD_Uniform3fv:
   43237       debug_print_unmarshal("Uniform3fv");
   43238       _mesa_unmarshal_Uniform3fv(ctx, (const struct marshal_cmd_Uniform3fv *) cmd);
   43239       break;
   43240    case DISPATCH_CMD_BlendEquation:
   43241       debug_print_unmarshal("BlendEquation");
   43242       _mesa_unmarshal_BlendEquation(ctx, (const struct marshal_cmd_BlendEquation *) cmd);
   43243       break;
   43244    case DISPATCH_CMD_VertexAttrib3dNV:
   43245       debug_print_unmarshal("VertexAttrib3dNV");
   43246       _mesa_unmarshal_VertexAttrib3dNV(ctx, (const struct marshal_cmd_VertexAttrib3dNV *) cmd);
   43247       break;
   43248    case DISPATCH_CMD_PushName:
   43249       debug_print_unmarshal("PushName");
   43250       _mesa_unmarshal_PushName(ctx, (const struct marshal_cmd_PushName *) cmd);
   43251       break;
   43252    case DISPATCH_CMD_DeleteRenderbuffers:
   43253       debug_print_unmarshal("DeleteRenderbuffers");
   43254       _mesa_unmarshal_DeleteRenderbuffers(ctx, (const struct marshal_cmd_DeleteRenderbuffers *) cmd);
   43255       break;
   43256    case DISPATCH_CMD_VertexAttrib1dv:
   43257       debug_print_unmarshal("VertexAttrib1dv");
   43258       _mesa_unmarshal_VertexAttrib1dv(ctx, (const struct marshal_cmd_VertexAttrib1dv *) cmd);
   43259       break;
   43260    case DISPATCH_CMD_Rotated:
   43261       debug_print_unmarshal("Rotated");
   43262       _mesa_unmarshal_Rotated(ctx, (const struct marshal_cmd_Rotated *) cmd);
   43263       break;
   43264    case DISPATCH_CMD_Color4iv:
   43265       debug_print_unmarshal("Color4iv");
   43266       _mesa_unmarshal_Color4iv(ctx, (const struct marshal_cmd_Color4iv *) cmd);
   43267       break;
   43268    case DISPATCH_CMD_Rotatex:
   43269       debug_print_unmarshal("Rotatex");
   43270       _mesa_unmarshal_Rotatex(ctx, (const struct marshal_cmd_Rotatex *) cmd);
   43271       break;
   43272    case DISPATCH_CMD_FramebufferTextureLayer:
   43273       debug_print_unmarshal("FramebufferTextureLayer");
   43274       _mesa_unmarshal_FramebufferTextureLayer(ctx, (const struct marshal_cmd_FramebufferTextureLayer *) cmd);
   43275       break;
   43276    case DISPATCH_CMD_ProgramUniformMatrix3fv:
   43277       debug_print_unmarshal("ProgramUniformMatrix3fv");
   43278       _mesa_unmarshal_ProgramUniformMatrix3fv(ctx, (const struct marshal_cmd_ProgramUniformMatrix3fv *) cmd);
   43279       break;
   43280    case DISPATCH_CMD_LoadMatrixf:
   43281       debug_print_unmarshal("LoadMatrixf");
   43282       _mesa_unmarshal_LoadMatrixf(ctx, (const struct marshal_cmd_LoadMatrixf *) cmd);
   43283       break;
   43284    case DISPATCH_CMD_MakeTextureHandleResidentARB:
   43285       debug_print_unmarshal("MakeTextureHandleResidentARB");
   43286       _mesa_unmarshal_MakeTextureHandleResidentARB(ctx, (const struct marshal_cmd_MakeTextureHandleResidentARB *) cmd);
   43287       break;
   43288    case DISPATCH_CMD_DrawRangeElementsBaseVertex:
   43289       debug_print_unmarshal("DrawRangeElementsBaseVertex");
   43290       _mesa_unmarshal_DrawRangeElementsBaseVertex(ctx, (const struct marshal_cmd_DrawRangeElementsBaseVertex *) cmd);
   43291       break;
   43292    case DISPATCH_CMD_ProgramUniformMatrix4dv:
   43293       debug_print_unmarshal("ProgramUniformMatrix4dv");
   43294       _mesa_unmarshal_ProgramUniformMatrix4dv(ctx, (const struct marshal_cmd_ProgramUniformMatrix4dv *) cmd);
   43295       break;
   43296    case DISPATCH_CMD_SecondaryColor3bv:
   43297       debug_print_unmarshal("SecondaryColor3bv");
   43298       _mesa_unmarshal_SecondaryColor3bv(ctx, (const struct marshal_cmd_SecondaryColor3bv *) cmd);
   43299       break;
   43300    case DISPATCH_CMD_DrawTexxvOES:
   43301       debug_print_unmarshal("DrawTexxvOES");
   43302       _mesa_unmarshal_DrawTexxvOES(ctx, (const struct marshal_cmd_DrawTexxvOES *) cmd);
   43303       break;
   43304    case DISPATCH_CMD_Color4ubv:
   43305       debug_print_unmarshal("Color4ubv");
   43306       _mesa_unmarshal_Color4ubv(ctx, (const struct marshal_cmd_Color4ubv *) cmd);
   43307       break;
   43308    case DISPATCH_CMD_TexCoord2fv:
   43309       debug_print_unmarshal("TexCoord2fv");
   43310       _mesa_unmarshal_TexCoord2fv(ctx, (const struct marshal_cmd_TexCoord2fv *) cmd);
   43311       break;
   43312    case DISPATCH_CMD_FogCoorddv:
   43313       debug_print_unmarshal("FogCoorddv");
   43314       _mesa_unmarshal_FogCoorddv(ctx, (const struct marshal_cmd_FogCoorddv *) cmd);
   43315       break;
   43316    case DISPATCH_CMD_VDPAUUnregisterSurfaceNV:
   43317       debug_print_unmarshal("VDPAUUnregisterSurfaceNV");
   43318       _mesa_unmarshal_VDPAUUnregisterSurfaceNV(ctx, (const struct marshal_cmd_VDPAUUnregisterSurfaceNV *) cmd);
   43319       break;
   43320    case DISPATCH_CMD_ColorP3ui:
   43321       debug_print_unmarshal("ColorP3ui");
   43322       _mesa_unmarshal_ColorP3ui(ctx, (const struct marshal_cmd_ColorP3ui *) cmd);
   43323       break;
   43324    case DISPATCH_CMD_ClearBufferuiv:
   43325       debug_print_unmarshal("ClearBufferuiv");
   43326       _mesa_unmarshal_ClearBufferuiv(ctx, (const struct marshal_cmd_ClearBufferuiv *) cmd);
   43327       break;
   43328    case DISPATCH_CMD_Flush:
   43329       debug_print_unmarshal("Flush");
   43330       _mesa_unmarshal_Flush(ctx, (const struct marshal_cmd_Flush *) cmd);
   43331       break;
   43332    case DISPATCH_CMD_MakeTextureHandleNonResidentARB:
   43333       debug_print_unmarshal("MakeTextureHandleNonResidentARB");
   43334       _mesa_unmarshal_MakeTextureHandleNonResidentARB(ctx, (const struct marshal_cmd_MakeTextureHandleNonResidentARB *) cmd);
   43335       break;
   43336    case DISPATCH_CMD_VertexAttribI4iEXT:
   43337       debug_print_unmarshal("VertexAttribI4iEXT");
   43338       _mesa_unmarshal_VertexAttribI4iEXT(ctx, (const struct marshal_cmd_VertexAttribI4iEXT *) cmd);
   43339       break;
   43340    case DISPATCH_CMD_FogCoordd:
   43341       debug_print_unmarshal("FogCoordd");
   43342       _mesa_unmarshal_FogCoordd(ctx, (const struct marshal_cmd_FogCoordd *) cmd);
   43343       break;
   43344    case DISPATCH_CMD_BindFramebufferEXT:
   43345       debug_print_unmarshal("BindFramebufferEXT");
   43346       _mesa_unmarshal_BindFramebufferEXT(ctx, (const struct marshal_cmd_BindFramebufferEXT *) cmd);
   43347       break;
   43348    case DISPATCH_CMD_Uniform3iv:
   43349       debug_print_unmarshal("Uniform3iv");
   43350       _mesa_unmarshal_Uniform3iv(ctx, (const struct marshal_cmd_Uniform3iv *) cmd);
   43351       break;
   43352    case DISPATCH_CMD_TexStorage2DMultisample:
   43353       debug_print_unmarshal("TexStorage2DMultisample");
   43354       _mesa_unmarshal_TexStorage2DMultisample(ctx, (const struct marshal_cmd_TexStorage2DMultisample *) cmd);
   43355       break;
   43356    case DISPATCH_CMD_UnlockArraysEXT:
   43357       debug_print_unmarshal("UnlockArraysEXT");
   43358       _mesa_unmarshal_UnlockArraysEXT(ctx, (const struct marshal_cmd_UnlockArraysEXT *) cmd);
   43359       break;
   43360    case DISPATCH_CMD_VertexAttrib4iv:
   43361       debug_print_unmarshal("VertexAttrib4iv");
   43362       _mesa_unmarshal_VertexAttrib4iv(ctx, (const struct marshal_cmd_VertexAttrib4iv *) cmd);
   43363       break;
   43364    case DISPATCH_CMD_CopyTexSubImage3D:
   43365       debug_print_unmarshal("CopyTexSubImage3D");
   43366       _mesa_unmarshal_CopyTexSubImage3D(ctx, (const struct marshal_cmd_CopyTexSubImage3D *) cmd);
   43367       break;
   43368    case DISPATCH_CMD_PolygonOffsetClampEXT:
   43369       debug_print_unmarshal("PolygonOffsetClampEXT");
   43370       _mesa_unmarshal_PolygonOffsetClampEXT(ctx, (const struct marshal_cmd_PolygonOffsetClampEXT *) cmd);
   43371       break;
   43372    case DISPATCH_CMD_DetachObjectARB:
   43373       debug_print_unmarshal("DetachObjectARB");
   43374       _mesa_unmarshal_DetachObjectARB(ctx, (const struct marshal_cmd_DetachObjectARB *) cmd);
   43375       break;
   43376    case DISPATCH_CMD_Indexiv:
   43377       debug_print_unmarshal("Indexiv");
   43378       _mesa_unmarshal_Indexiv(ctx, (const struct marshal_cmd_Indexiv *) cmd);
   43379       break;
   43380    case DISPATCH_CMD_TexEnvi:
   43381       debug_print_unmarshal("TexEnvi");
   43382       _mesa_unmarshal_TexEnvi(ctx, (const struct marshal_cmd_TexEnvi *) cmd);
   43383       break;
   43384    case DISPATCH_CMD_TexEnvf:
   43385       debug_print_unmarshal("TexEnvf");
   43386       _mesa_unmarshal_TexEnvf(ctx, (const struct marshal_cmd_TexEnvf *) cmd);
   43387       break;
   43388    case DISPATCH_CMD_TexEnvx:
   43389       debug_print_unmarshal("TexEnvx");
   43390       _mesa_unmarshal_TexEnvx(ctx, (const struct marshal_cmd_TexEnvx *) cmd);
   43391       break;
   43392    case DISPATCH_CMD_InvalidateBufferSubData:
   43393       debug_print_unmarshal("InvalidateBufferSubData");
   43394       _mesa_unmarshal_InvalidateBufferSubData(ctx, (const struct marshal_cmd_InvalidateBufferSubData *) cmd);
   43395       break;
   43396    case DISPATCH_CMD_UniformMatrix4x2fv:
   43397       debug_print_unmarshal("UniformMatrix4x2fv");
   43398       _mesa_unmarshal_UniformMatrix4x2fv(ctx, (const struct marshal_cmd_UniformMatrix4x2fv *) cmd);
   43399       break;
   43400    case DISPATCH_CMD_PolygonOffset:
   43401       debug_print_unmarshal("PolygonOffset");
   43402       _mesa_unmarshal_PolygonOffset(ctx, (const struct marshal_cmd_PolygonOffset *) cmd);
   43403       break;
   43404    case DISPATCH_CMD_ProgramUniformMatrix4x2dv:
   43405       debug_print_unmarshal("ProgramUniformMatrix4x2dv");
   43406       _mesa_unmarshal_ProgramUniformMatrix4x2dv(ctx, (const struct marshal_cmd_ProgramUniformMatrix4x2dv *) cmd);
   43407       break;
   43408    case DISPATCH_CMD_ProgramEnvParameter4fARB:
   43409       debug_print_unmarshal("ProgramEnvParameter4fARB");
   43410       _mesa_unmarshal_ProgramEnvParameter4fARB(ctx, (const struct marshal_cmd_ProgramEnvParameter4fARB *) cmd);
   43411       break;
   43412    case DISPATCH_CMD_ClearDepth:
   43413       debug_print_unmarshal("ClearDepth");
   43414       _mesa_unmarshal_ClearDepth(ctx, (const struct marshal_cmd_ClearDepth *) cmd);
   43415       break;
   43416    case DISPATCH_CMD_VertexAttrib3dvNV:
   43417       debug_print_unmarshal("VertexAttrib3dvNV");
   43418       _mesa_unmarshal_VertexAttrib3dvNV(ctx, (const struct marshal_cmd_VertexAttrib3dvNV *) cmd);
   43419       break;
   43420    case DISPATCH_CMD_Color4fv:
   43421       debug_print_unmarshal("Color4fv");
   43422       _mesa_unmarshal_Color4fv(ctx, (const struct marshal_cmd_Color4fv *) cmd);
   43423       break;
   43424    case DISPATCH_CMD_ColorPointer:
   43425       debug_print_unmarshal("ColorPointer");
   43426       _mesa_unmarshal_ColorPointer(ctx, (const struct marshal_cmd_ColorPointer *) cmd);
   43427       break;
   43428    case DISPATCH_CMD_ProgramUniform2ui64ARB:
   43429       debug_print_unmarshal("ProgramUniform2ui64ARB");
   43430       _mesa_unmarshal_ProgramUniform2ui64ARB(ctx, (const struct marshal_cmd_ProgramUniform2ui64ARB *) cmd);
   43431       break;
   43432    case DISPATCH_CMD_VertexAttrib3sv:
   43433       debug_print_unmarshal("VertexAttrib3sv");
   43434       _mesa_unmarshal_VertexAttrib3sv(ctx, (const struct marshal_cmd_VertexAttrib3sv *) cmd);
   43435       break;
   43436    case DISPATCH_CMD_Uniform4i64ARB:
   43437       debug_print_unmarshal("Uniform4i64ARB");
   43438       _mesa_unmarshal_Uniform4i64ARB(ctx, (const struct marshal_cmd_Uniform4i64ARB *) cmd);
   43439       break;
   43440    case DISPATCH_CMD_ProgramUniform3ui64ARB:
   43441       debug_print_unmarshal("ProgramUniform3ui64ARB");
   43442       _mesa_unmarshal_ProgramUniform3ui64ARB(ctx, (const struct marshal_cmd_ProgramUniform3ui64ARB *) cmd);
   43443       break;
   43444    case DISPATCH_CMD_PushClientAttrib:
   43445       debug_print_unmarshal("PushClientAttrib");
   43446       _mesa_unmarshal_PushClientAttrib(ctx, (const struct marshal_cmd_PushClientAttrib *) cmd);
   43447       break;
   43448    case DISPATCH_CMD_ProgramUniform4ui:
   43449       debug_print_unmarshal("ProgramUniform4ui");
   43450       _mesa_unmarshal_ProgramUniform4ui(ctx, (const struct marshal_cmd_ProgramUniform4ui *) cmd);
   43451       break;
   43452    case DISPATCH_CMD_Uniform1f:
   43453       debug_print_unmarshal("Uniform1f");
   43454       _mesa_unmarshal_Uniform1f(ctx, (const struct marshal_cmd_Uniform1f *) cmd);
   43455       break;
   43456    case DISPATCH_CMD_Uniform1d:
   43457       debug_print_unmarshal("Uniform1d");
   43458       _mesa_unmarshal_Uniform1d(ctx, (const struct marshal_cmd_Uniform1d *) cmd);
   43459       break;
   43460    case DISPATCH_CMD_Uniform1i:
   43461       debug_print_unmarshal("Uniform1i");
   43462       _mesa_unmarshal_Uniform1i(ctx, (const struct marshal_cmd_Uniform1i *) cmd);
   43463       break;
   43464    case DISPATCH_CMD_BlitNamedFramebuffer:
   43465       debug_print_unmarshal("BlitNamedFramebuffer");
   43466       _mesa_unmarshal_BlitNamedFramebuffer(ctx, (const struct marshal_cmd_BlitNamedFramebuffer *) cmd);
   43467       break;
   43468    case DISPATCH_CMD_UseProgram:
   43469       debug_print_unmarshal("UseProgram");
   43470       _mesa_unmarshal_UseProgram(ctx, (const struct marshal_cmd_UseProgram *) cmd);
   43471       break;
   43472    case DISPATCH_CMD_TexStorageMem2DMultisampleEXT:
   43473       debug_print_unmarshal("TexStorageMem2DMultisampleEXT");
   43474       _mesa_unmarshal_TexStorageMem2DMultisampleEXT(ctx, (const struct marshal_cmd_TexStorageMem2DMultisampleEXT *) cmd);
   43475       break;
   43476    case DISPATCH_CMD_Color3s:
   43477       debug_print_unmarshal("Color3s");
   43478       _mesa_unmarshal_Color3s(ctx, (const struct marshal_cmd_Color3s *) cmd);
   43479       break;
   43480    case DISPATCH_CMD_TextureStorage2DMultisample:
   43481       debug_print_unmarshal("TextureStorage2DMultisample");
   43482       _mesa_unmarshal_TextureStorage2DMultisample(ctx, (const struct marshal_cmd_TextureStorage2DMultisample *) cmd);
   43483       break;
   43484    case DISPATCH_CMD_TexCoordPointer:
   43485       debug_print_unmarshal("TexCoordPointer");
   43486       _mesa_unmarshal_TexCoordPointer(ctx, (const struct marshal_cmd_TexCoordPointer *) cmd);
   43487       break;
   43488    case DISPATCH_CMD_Color3i:
   43489       debug_print_unmarshal("Color3i");
   43490       _mesa_unmarshal_Color3i(ctx, (const struct marshal_cmd_Color3i *) cmd);
   43491       break;
   43492    case DISPATCH_CMD_EvalCoord2d:
   43493       debug_print_unmarshal("EvalCoord2d");
   43494       _mesa_unmarshal_EvalCoord2d(ctx, (const struct marshal_cmd_EvalCoord2d *) cmd);
   43495       break;
   43496    case DISPATCH_CMD_EvalCoord2f:
   43497       debug_print_unmarshal("EvalCoord2f");
   43498       _mesa_unmarshal_EvalCoord2f(ctx, (const struct marshal_cmd_EvalCoord2f *) cmd);
   43499       break;
   43500    case DISPATCH_CMD_Color3b:
   43501       debug_print_unmarshal("Color3b");
   43502       _mesa_unmarshal_Color3b(ctx, (const struct marshal_cmd_Color3b *) cmd);
   43503       break;
   43504    case DISPATCH_CMD_Color3f:
   43505       debug_print_unmarshal("Color3f");
   43506       _mesa_unmarshal_Color3f(ctx, (const struct marshal_cmd_Color3f *) cmd);
   43507       break;
   43508    case DISPATCH_CMD_Color3d:
   43509       debug_print_unmarshal("Color3d");
   43510       _mesa_unmarshal_Color3d(ctx, (const struct marshal_cmd_Color3d *) cmd);
   43511       break;
   43512    case DISPATCH_CMD_ClearDepthx:
   43513       debug_print_unmarshal("ClearDepthx");
   43514       _mesa_unmarshal_ClearDepthx(ctx, (const struct marshal_cmd_ClearDepthx *) cmd);
   43515       break;
   43516    case DISPATCH_CMD_EnableVertexArrayAttrib:
   43517       debug_print_unmarshal("EnableVertexArrayAttrib");
   43518       _mesa_unmarshal_EnableVertexArrayAttrib(ctx, (const struct marshal_cmd_EnableVertexArrayAttrib *) cmd);
   43519       break;
   43520    case DISPATCH_CMD_BlendEquationSeparate:
   43521       debug_print_unmarshal("BlendEquationSeparate");
   43522       _mesa_unmarshal_BlendEquationSeparate(ctx, (const struct marshal_cmd_BlendEquationSeparate *) cmd);
   43523       break;
   43524    case DISPATCH_CMD_MultiTexCoordP4ui:
   43525       debug_print_unmarshal("MultiTexCoordP4ui");
   43526       _mesa_unmarshal_MultiTexCoordP4ui(ctx, (const struct marshal_cmd_MultiTexCoordP4ui *) cmd);
   43527       break;
   43528    case DISPATCH_CMD_VertexAttribs1fvNV:
   43529       debug_print_unmarshal("VertexAttribs1fvNV");
   43530       _mesa_unmarshal_VertexAttribs1fvNV(ctx, (const struct marshal_cmd_VertexAttribs1fvNV *) cmd);
   43531       break;
   43532    case DISPATCH_CMD_VertexAttribIPointer:
   43533       debug_print_unmarshal("VertexAttribIPointer");
   43534       _mesa_unmarshal_VertexAttribIPointer(ctx, (const struct marshal_cmd_VertexAttribIPointer *) cmd);
   43535       break;
   43536    case DISPATCH_CMD_ProgramUniform4fv:
   43537       debug_print_unmarshal("ProgramUniform4fv");
   43538       _mesa_unmarshal_ProgramUniform4fv(ctx, (const struct marshal_cmd_ProgramUniform4fv *) cmd);
   43539       break;
   43540    case DISPATCH_CMD_RasterPos4sv:
   43541       debug_print_unmarshal("RasterPos4sv");
   43542       _mesa_unmarshal_RasterPos4sv(ctx, (const struct marshal_cmd_RasterPos4sv *) cmd);
   43543       break;
   43544    case DISPATCH_CMD_CopyTextureSubImage3D:
   43545       debug_print_unmarshal("CopyTextureSubImage3D");
   43546       _mesa_unmarshal_CopyTextureSubImage3D(ctx, (const struct marshal_cmd_CopyTextureSubImage3D *) cmd);
   43547       break;
   43548    case DISPATCH_CMD_TextureView:
   43549       debug_print_unmarshal("TextureView");
   43550       _mesa_unmarshal_TextureView(ctx, (const struct marshal_cmd_TextureView *) cmd);
   43551       break;
   43552    case DISPATCH_CMD_VertexAttribDivisor:
   43553       debug_print_unmarshal("VertexAttribDivisor");
   43554       _mesa_unmarshal_VertexAttribDivisor(ctx, (const struct marshal_cmd_VertexAttribDivisor *) cmd);
   43555       break;
   43556    case DISPATCH_CMD_DrawTransformFeedbackStream:
   43557       debug_print_unmarshal("DrawTransformFeedbackStream");
   43558       _mesa_unmarshal_DrawTransformFeedbackStream(ctx, (const struct marshal_cmd_DrawTransformFeedbackStream *) cmd);
   43559       break;
   43560    case DISPATCH_CMD_EndPerfQueryINTEL:
   43561       debug_print_unmarshal("EndPerfQueryINTEL");
   43562       _mesa_unmarshal_EndPerfQueryINTEL(ctx, (const struct marshal_cmd_EndPerfQueryINTEL *) cmd);
   43563       break;
   43564    case DISPATCH_CMD_NamedBufferPageCommitmentARB:
   43565       debug_print_unmarshal("NamedBufferPageCommitmentARB");
   43566       _mesa_unmarshal_NamedBufferPageCommitmentARB(ctx, (const struct marshal_cmd_NamedBufferPageCommitmentARB *) cmd);
   43567       break;
   43568    case DISPATCH_CMD_AlphaFuncx:
   43569       debug_print_unmarshal("AlphaFuncx");
   43570       _mesa_unmarshal_AlphaFuncx(ctx, (const struct marshal_cmd_AlphaFuncx *) cmd);
   43571       break;
   43572    case DISPATCH_CMD_VertexArrayVertexBuffer:
   43573       debug_print_unmarshal("VertexArrayVertexBuffer");
   43574       _mesa_unmarshal_VertexArrayVertexBuffer(ctx, (const struct marshal_cmd_VertexArrayVertexBuffer *) cmd);
   43575       break;
   43576    case DISPATCH_CMD_PixelTransferf:
   43577       debug_print_unmarshal("PixelTransferf");
   43578       _mesa_unmarshal_PixelTransferf(ctx, (const struct marshal_cmd_PixelTransferf *) cmd);
   43579       break;
   43580    case DISPATCH_CMD_PixelTransferi:
   43581       debug_print_unmarshal("PixelTransferi");
   43582       _mesa_unmarshal_PixelTransferi(ctx, (const struct marshal_cmd_PixelTransferi *) cmd);
   43583       break;
   43584    case DISPATCH_CMD_VertexAttrib3fvNV:
   43585       debug_print_unmarshal("VertexAttrib3fvNV");
   43586       _mesa_unmarshal_VertexAttrib3fvNV(ctx, (const struct marshal_cmd_VertexAttrib3fvNV *) cmd);
   43587       break;
   43588    case DISPATCH_CMD_SecondaryColorP3ui:
   43589       debug_print_unmarshal("SecondaryColorP3ui");
   43590       _mesa_unmarshal_SecondaryColorP3ui(ctx, (const struct marshal_cmd_SecondaryColorP3ui *) cmd);
   43591       break;
   43592    case DISPATCH_CMD_VertexAttrib4fvNV:
   43593       debug_print_unmarshal("VertexAttrib4fvNV");
   43594       _mesa_unmarshal_VertexAttrib4fvNV(ctx, (const struct marshal_cmd_VertexAttrib4fvNV *) cmd);
   43595       break;
   43596    case DISPATCH_CMD_Rectiv:
   43597       debug_print_unmarshal("Rectiv");
   43598       _mesa_unmarshal_Rectiv(ctx, (const struct marshal_cmd_Rectiv *) cmd);
   43599       break;
   43600    case DISPATCH_CMD_MultiTexCoord1iv:
   43601       debug_print_unmarshal("MultiTexCoord1iv");
   43602       _mesa_unmarshal_MultiTexCoord1iv(ctx, (const struct marshal_cmd_MultiTexCoord1iv *) cmd);
   43603       break;
   43604    case DISPATCH_CMD_PassTexCoordATI:
   43605       debug_print_unmarshal("PassTexCoordATI");
   43606       _mesa_unmarshal_PassTexCoordATI(ctx, (const struct marshal_cmd_PassTexCoordATI *) cmd);
   43607       break;
   43608    case DISPATCH_CMD_Vertex2fv:
   43609       debug_print_unmarshal("Vertex2fv");
   43610       _mesa_unmarshal_Vertex2fv(ctx, (const struct marshal_cmd_Vertex2fv *) cmd);
   43611       break;
   43612    case DISPATCH_CMD_BindRenderbufferEXT:
   43613       debug_print_unmarshal("BindRenderbufferEXT");
   43614       _mesa_unmarshal_BindRenderbufferEXT(ctx, (const struct marshal_cmd_BindRenderbufferEXT *) cmd);
   43615       break;
   43616    case DISPATCH_CMD_Vertex3sv:
   43617       debug_print_unmarshal("Vertex3sv");
   43618       _mesa_unmarshal_Vertex3sv(ctx, (const struct marshal_cmd_Vertex3sv *) cmd);
   43619       break;
   43620    case DISPATCH_CMD_EvalMesh1:
   43621       debug_print_unmarshal("EvalMesh1");
   43622       _mesa_unmarshal_EvalMesh1(ctx, (const struct marshal_cmd_EvalMesh1 *) cmd);
   43623       break;
   43624    case DISPATCH_CMD_DiscardFramebufferEXT:
   43625       debug_print_unmarshal("DiscardFramebufferEXT");
   43626       _mesa_unmarshal_DiscardFramebufferEXT(ctx, (const struct marshal_cmd_DiscardFramebufferEXT *) cmd);
   43627       break;
   43628    case DISPATCH_CMD_Uniform2f:
   43629       debug_print_unmarshal("Uniform2f");
   43630       _mesa_unmarshal_Uniform2f(ctx, (const struct marshal_cmd_Uniform2f *) cmd);
   43631       break;
   43632    case DISPATCH_CMD_Uniform2d:
   43633       debug_print_unmarshal("Uniform2d");
   43634       _mesa_unmarshal_Uniform2d(ctx, (const struct marshal_cmd_Uniform2d *) cmd);
   43635       break;
   43636    case DISPATCH_CMD_ColorPointerEXT:
   43637       debug_print_unmarshal("ColorPointerEXT");
   43638       _mesa_unmarshal_ColorPointerEXT(ctx, (const struct marshal_cmd_ColorPointerEXT *) cmd);
   43639       break;
   43640    case DISPATCH_CMD_LineWidth:
   43641       debug_print_unmarshal("LineWidth");
   43642       _mesa_unmarshal_LineWidth(ctx, (const struct marshal_cmd_LineWidth *) cmd);
   43643       break;
   43644    case DISPATCH_CMD_Uniform2i:
   43645       debug_print_unmarshal("Uniform2i");
   43646       _mesa_unmarshal_Uniform2i(ctx, (const struct marshal_cmd_Uniform2i *) cmd);
   43647       break;
   43648    case DISPATCH_CMD_DepthRangeIndexed:
   43649       debug_print_unmarshal("DepthRangeIndexed");
   43650       _mesa_unmarshal_DepthRangeIndexed(ctx, (const struct marshal_cmd_DepthRangeIndexed *) cmd);
   43651       break;
   43652    case DISPATCH_CMD_TexImage3DMultisample:
   43653       debug_print_unmarshal("TexImage3DMultisample");
   43654       _mesa_unmarshal_TexImage3DMultisample(ctx, (const struct marshal_cmd_TexImage3DMultisample *) cmd);
   43655       break;
   43656    case DISPATCH_CMD_VertexAttrib1fvNV:
   43657       debug_print_unmarshal("VertexAttrib1fvNV");
   43658       _mesa_unmarshal_VertexAttrib1fvNV(ctx, (const struct marshal_cmd_VertexAttrib1fvNV *) cmd);
   43659       break;
   43660    case DISPATCH_CMD_DetachShader:
   43661       debug_print_unmarshal("DetachShader");
   43662       _mesa_unmarshal_DetachShader(ctx, (const struct marshal_cmd_DetachShader *) cmd);
   43663       break;
   43664    case DISPATCH_CMD_CopyTexSubImage2D:
   43665       debug_print_unmarshal("CopyTexSubImage2D");
   43666       _mesa_unmarshal_CopyTexSubImage2D(ctx, (const struct marshal_cmd_CopyTexSubImage2D *) cmd);
   43667       break;
   43668    case DISPATCH_CMD_Color3iv:
   43669       debug_print_unmarshal("Color3iv");
   43670       _mesa_unmarshal_Color3iv(ctx, (const struct marshal_cmd_Color3iv *) cmd);
   43671       break;
   43672    case DISPATCH_CMD_DrawElements:
   43673       debug_print_unmarshal("DrawElements");
   43674       _mesa_unmarshal_DrawElements(ctx, (const struct marshal_cmd_DrawElements *) cmd);
   43675       break;
   43676    case DISPATCH_CMD_ScissorArrayv:
   43677       debug_print_unmarshal("ScissorArrayv");
   43678       _mesa_unmarshal_ScissorArrayv(ctx, (const struct marshal_cmd_ScissorArrayv *) cmd);
   43679       break;
   43680    case DISPATCH_CMD_EvalPoint2:
   43681       debug_print_unmarshal("EvalPoint2");
   43682       _mesa_unmarshal_EvalPoint2(ctx, (const struct marshal_cmd_EvalPoint2 *) cmd);
   43683       break;
   43684    case DISPATCH_CMD_EvalPoint1:
   43685       debug_print_unmarshal("EvalPoint1");
   43686       _mesa_unmarshal_EvalPoint1(ctx, (const struct marshal_cmd_EvalPoint1 *) cmd);
   43687       break;
   43688    case DISPATCH_CMD_PopMatrix:
   43689       debug_print_unmarshal("PopMatrix");
   43690       _mesa_unmarshal_PopMatrix(ctx, (const struct marshal_cmd_PopMatrix *) cmd);
   43691       break;
   43692    case DISPATCH_CMD_NamedBufferData:
   43693       debug_print_unmarshal("NamedBufferData");
   43694       _mesa_unmarshal_NamedBufferData(ctx, (const struct marshal_cmd_NamedBufferData *) cmd);
   43695       break;
   43696    case DISPATCH_CMD_EvalCoord1d:
   43697       debug_print_unmarshal("EvalCoord1d");
   43698       _mesa_unmarshal_EvalCoord1d(ctx, (const struct marshal_cmd_EvalCoord1d *) cmd);
   43699       break;
   43700    case DISPATCH_CMD_VertexAttribL1d:
   43701       debug_print_unmarshal("VertexAttribL1d");
   43702       _mesa_unmarshal_VertexAttribL1d(ctx, (const struct marshal_cmd_VertexAttribL1d *) cmd);
   43703       break;
   43704    case DISPATCH_CMD_EvalCoord1f:
   43705       debug_print_unmarshal("EvalCoord1f");
   43706       _mesa_unmarshal_EvalCoord1f(ctx, (const struct marshal_cmd_EvalCoord1f *) cmd);
   43707       break;
   43708    case DISPATCH_CMD_Materialf:
   43709       debug_print_unmarshal("Materialf");
   43710       _mesa_unmarshal_Materialf(ctx, (const struct marshal_cmd_Materialf *) cmd);
   43711       break;
   43712    case DISPATCH_CMD_Materiali:
   43713       debug_print_unmarshal("Materiali");
   43714       _mesa_unmarshal_Materiali(ctx, (const struct marshal_cmd_Materiali *) cmd);
   43715       break;
   43716    case DISPATCH_CMD_ProgramUniform1uiv:
   43717       debug_print_unmarshal("ProgramUniform1uiv");
   43718       _mesa_unmarshal_ProgramUniform1uiv(ctx, (const struct marshal_cmd_ProgramUniform1uiv *) cmd);
   43719       break;
   43720    case DISPATCH_CMD_EvalCoord1dv:
   43721       debug_print_unmarshal("EvalCoord1dv");
   43722       _mesa_unmarshal_EvalCoord1dv(ctx, (const struct marshal_cmd_EvalCoord1dv *) cmd);
   43723       break;
   43724    case DISPATCH_CMD_Materialx:
   43725       debug_print_unmarshal("Materialx");
   43726       _mesa_unmarshal_Materialx(ctx, (const struct marshal_cmd_Materialx *) cmd);
   43727       break;
   43728    case DISPATCH_CMD_GetQueryBufferObjectiv:
   43729       debug_print_unmarshal("GetQueryBufferObjectiv");
   43730       _mesa_unmarshal_GetQueryBufferObjectiv(ctx, (const struct marshal_cmd_GetQueryBufferObjectiv *) cmd);
   43731       break;
   43732    case DISPATCH_CMD_ProgramUniform3i64ARB:
   43733       debug_print_unmarshal("ProgramUniform3i64ARB");
   43734       _mesa_unmarshal_ProgramUniform3i64ARB(ctx, (const struct marshal_cmd_ProgramUniform3i64ARB *) cmd);
   43735       break;
   43736    case DISPATCH_CMD_BindBuffer:
   43737       debug_print_unmarshal("BindBuffer");
   43738       _mesa_unmarshal_BindBuffer(ctx, (const struct marshal_cmd_BindBuffer *) cmd);
   43739       break;
   43740    case DISPATCH_CMD_ProgramUniform1i:
   43741       debug_print_unmarshal("ProgramUniform1i");
   43742       _mesa_unmarshal_ProgramUniform1i(ctx, (const struct marshal_cmd_ProgramUniform1i *) cmd);
   43743       break;
   43744    case DISPATCH_CMD_ProgramUniform1f:
   43745       debug_print_unmarshal("ProgramUniform1f");
   43746       _mesa_unmarshal_ProgramUniform1f(ctx, (const struct marshal_cmd_ProgramUniform1f *) cmd);
   43747       break;
   43748    case DISPATCH_CMD_ProgramUniform1d:
   43749       debug_print_unmarshal("ProgramUniform1d");
   43750       _mesa_unmarshal_ProgramUniform1d(ctx, (const struct marshal_cmd_ProgramUniform1d *) cmd);
   43751       break;
   43752    case DISPATCH_CMD_CopyConvolutionFilter2D:
   43753       debug_print_unmarshal("CopyConvolutionFilter2D");
   43754       _mesa_unmarshal_CopyConvolutionFilter2D(ctx, (const struct marshal_cmd_CopyConvolutionFilter2D *) cmd);
   43755       break;
   43756    case DISPATCH_CMD_CopyBufferSubData:
   43757       debug_print_unmarshal("CopyBufferSubData");
   43758       _mesa_unmarshal_CopyBufferSubData(ctx, (const struct marshal_cmd_CopyBufferSubData *) cmd);
   43759       break;
   43760    case DISPATCH_CMD_UniformMatrix3x4fv:
   43761       debug_print_unmarshal("UniformMatrix3x4fv");
   43762       _mesa_unmarshal_UniformMatrix3x4fv(ctx, (const struct marshal_cmd_UniformMatrix3x4fv *) cmd);
   43763       break;
   43764    case DISPATCH_CMD_Recti:
   43765       debug_print_unmarshal("Recti");
   43766       _mesa_unmarshal_Recti(ctx, (const struct marshal_cmd_Recti *) cmd);
   43767       break;
   43768    case DISPATCH_CMD_SamplerParameteri:
   43769       debug_print_unmarshal("SamplerParameteri");
   43770       _mesa_unmarshal_SamplerParameteri(ctx, (const struct marshal_cmd_SamplerParameteri *) cmd);
   43771       break;
   43772    case DISPATCH_CMD_Rectf:
   43773       debug_print_unmarshal("Rectf");
   43774       _mesa_unmarshal_Rectf(ctx, (const struct marshal_cmd_Rectf *) cmd);
   43775       break;
   43776    case DISPATCH_CMD_Rectd:
   43777       debug_print_unmarshal("Rectd");
   43778       _mesa_unmarshal_Rectd(ctx, (const struct marshal_cmd_Rectd *) cmd);
   43779       break;
   43780    case DISPATCH_CMD_MultMatrixx:
   43781       debug_print_unmarshal("MultMatrixx");
   43782       _mesa_unmarshal_MultMatrixx(ctx, (const struct marshal_cmd_MultMatrixx *) cmd);
   43783       break;
   43784    case DISPATCH_CMD_TexStorageMem3DMultisampleEXT:
   43785       debug_print_unmarshal("TexStorageMem3DMultisampleEXT");
   43786       _mesa_unmarshal_TexStorageMem3DMultisampleEXT(ctx, (const struct marshal_cmd_TexStorageMem3DMultisampleEXT *) cmd);
   43787       break;
   43788    case DISPATCH_CMD_Rects:
   43789       debug_print_unmarshal("Rects");
   43790       _mesa_unmarshal_Rects(ctx, (const struct marshal_cmd_Rects *) cmd);
   43791       break;
   43792    case DISPATCH_CMD_TexCoord4s:
   43793       debug_print_unmarshal("TexCoord4s");
   43794       _mesa_unmarshal_TexCoord4s(ctx, (const struct marshal_cmd_TexCoord4s *) cmd);
   43795       break;
   43796    case DISPATCH_CMD_TexCoord4i:
   43797       debug_print_unmarshal("TexCoord4i");
   43798       _mesa_unmarshal_TexCoord4i(ctx, (const struct marshal_cmd_TexCoord4i *) cmd);
   43799       break;
   43800    case DISPATCH_CMD_ProgramUniform1ui64vARB:
   43801       debug_print_unmarshal("ProgramUniform1ui64vARB");
   43802       _mesa_unmarshal_ProgramUniform1ui64vARB(ctx, (const struct marshal_cmd_ProgramUniform1ui64vARB *) cmd);
   43803       break;
   43804    case DISPATCH_CMD_TexCoord4d:
   43805       debug_print_unmarshal("TexCoord4d");
   43806       _mesa_unmarshal_TexCoord4d(ctx, (const struct marshal_cmd_TexCoord4d *) cmd);
   43807       break;
   43808    case DISPATCH_CMD_TexCoord4f:
   43809       debug_print_unmarshal("TexCoord4f");
   43810       _mesa_unmarshal_TexCoord4f(ctx, (const struct marshal_cmd_TexCoord4f *) cmd);
   43811       break;
   43812    case DISPATCH_CMD_ProgramUniformMatrix3dv:
   43813       debug_print_unmarshal("ProgramUniformMatrix3dv");
   43814       _mesa_unmarshal_ProgramUniformMatrix3dv(ctx, (const struct marshal_cmd_ProgramUniformMatrix3dv *) cmd);
   43815       break;
   43816    case DISPATCH_CMD_LockArraysEXT:
   43817       debug_print_unmarshal("LockArraysEXT");
   43818       _mesa_unmarshal_LockArraysEXT(ctx, (const struct marshal_cmd_LockArraysEXT *) cmd);
   43819       break;
   43820    case DISPATCH_CMD_Rectfv:
   43821       debug_print_unmarshal("Rectfv");
   43822       _mesa_unmarshal_Rectfv(ctx, (const struct marshal_cmd_Rectfv *) cmd);
   43823       break;
   43824    case DISPATCH_CMD_BindImageTexture:
   43825       debug_print_unmarshal("BindImageTexture");
   43826       _mesa_unmarshal_BindImageTexture(ctx, (const struct marshal_cmd_BindImageTexture *) cmd);
   43827       break;
   43828    case DISPATCH_CMD_MinSampleShading:
   43829       debug_print_unmarshal("MinSampleShading");
   43830       _mesa_unmarshal_MinSampleShading(ctx, (const struct marshal_cmd_MinSampleShading *) cmd);
   43831       break;
   43832    case DISPATCH_CMD_VertexAttrib1dNV:
   43833       debug_print_unmarshal("VertexAttrib1dNV");
   43834       _mesa_unmarshal_VertexAttrib1dNV(ctx, (const struct marshal_cmd_VertexAttrib1dNV *) cmd);
   43835       break;
   43836    case DISPATCH_CMD_EndFragmentShaderATI:
   43837       debug_print_unmarshal("EndFragmentShaderATI");
   43838       _mesa_unmarshal_EndFragmentShaderATI(ctx, (const struct marshal_cmd_EndFragmentShaderATI *) cmd);
   43839       break;
   43840    case DISPATCH_CMD_Uniform4iv:
   43841       debug_print_unmarshal("Uniform4iv");
   43842       _mesa_unmarshal_Uniform4iv(ctx, (const struct marshal_cmd_Uniform4iv *) cmd);
   43843       break;
   43844    default:
   43845       assert(!"Unrecognized command ID");
   43846       break;
   43847    }
   43848 
   43849    return cmd_base->cmd_size;
   43850 }
   43851 
   43852 
   43853 struct _glapi_table *
   43854 _mesa_create_marshal_table(const struct gl_context *ctx)
   43855 {
   43856    struct _glapi_table *table;
   43857 
   43858    table = _mesa_alloc_dispatch_table();
   43859    if (table == NULL)
   43860       return NULL;
   43861 
   43862    SET_MapGrid1d(table, _mesa_marshal_MapGrid1d);
   43863    SET_MapGrid1f(table, _mesa_marshal_MapGrid1f);
   43864    SET_ProgramUniform3i64vARB(table, _mesa_marshal_ProgramUniform3i64vARB);
   43865    SET_GetProgramResourceLocationIndex(table, _mesa_marshal_GetProgramResourceLocationIndex);
   43866    SET_TexCoordP1ui(table, _mesa_marshal_TexCoordP1ui);
   43867    SET_PolygonStipple(table, _mesa_marshal_PolygonStipple);
   43868    SET_MultiTexCoord1dv(table, _mesa_marshal_MultiTexCoord1dv);
   43869    SET_IsEnabled(table, _mesa_marshal_IsEnabled);
   43870    SET_AttachShader(table, _mesa_marshal_AttachShader);
   43871    SET_VertexAttrib3fARB(table, _mesa_marshal_VertexAttrib3fARB);
   43872    SET_Indexubv(table, _mesa_marshal_Indexubv);
   43873    SET_GetCompressedTextureImage(table, _mesa_marshal_GetCompressedTextureImage);
   43874    SET_MultiTexCoordP3uiv(table, _mesa_marshal_MultiTexCoordP3uiv);
   43875    SET_VertexAttribI4usv(table, _mesa_marshal_VertexAttribI4usv);
   43876    SET_Color3ubv(table, _mesa_marshal_Color3ubv);
   43877    SET_GetClipPlanex(table, _mesa_marshal_GetClipPlanex);
   43878    SET_ProgramUniform2ui(table, _mesa_marshal_ProgramUniform2ui);
   43879    SET_TexCoordP1uiv(table, _mesa_marshal_TexCoordP1uiv);
   43880    SET_RenderbufferStorage(table, _mesa_marshal_RenderbufferStorage);
   43881    SET_GetClipPlanef(table, _mesa_marshal_GetClipPlanef);
   43882    SET_GetPerfQueryDataINTEL(table, _mesa_marshal_GetPerfQueryDataINTEL);
   43883    SET_DrawArraysIndirect(table, _mesa_marshal_DrawArraysIndirect);
   43884    SET_Uniform3i(table, _mesa_marshal_Uniform3i);
   43885    SET_VDPAUGetSurfaceivNV(table, _mesa_marshal_VDPAUGetSurfaceivNV);
   43886    SET_Uniform3d(table, _mesa_marshal_Uniform3d);
   43887    SET_Uniform3f(table, _mesa_marshal_Uniform3f);
   43888    SET_UniformMatrix2x4fv(table, _mesa_marshal_UniformMatrix2x4fv);
   43889    SET_QueryMatrixxOES(table, _mesa_marshal_QueryMatrixxOES);
   43890    SET_Normal3iv(table, _mesa_marshal_Normal3iv);
   43891    SET_DrawTexiOES(table, _mesa_marshal_DrawTexiOES);
   43892    SET_Viewport(table, _mesa_marshal_Viewport);
   43893    SET_CreateProgramPipelines(table, _mesa_marshal_CreateProgramPipelines);
   43894    SET_DeleteVertexArrays(table, _mesa_marshal_DeleteVertexArrays);
   43895    SET_ClearColorIuiEXT(table, _mesa_marshal_ClearColorIuiEXT);
   43896    SET_GetnConvolutionFilterARB(table, _mesa_marshal_GetnConvolutionFilterARB);
   43897    SET_PolygonOffsetx(table, _mesa_marshal_PolygonOffsetx);
   43898    SET_GetLightxv(table, _mesa_marshal_GetLightxv);
   43899    SET_GetConvolutionParameteriv(table, _mesa_marshal_GetConvolutionParameteriv);
   43900    SET_DepthRangeIndexedfOES(table, _mesa_marshal_DepthRangeIndexedfOES);
   43901    SET_GetProgramResourceLocation(table, _mesa_marshal_GetProgramResourceLocation);
   43902    SET_GetSubroutineUniformLocation(table, _mesa_marshal_GetSubroutineUniformLocation);
   43903    SET_VertexAttrib4usv(table, _mesa_marshal_VertexAttrib4usv);
   43904    SET_TextureStorage1DEXT(table, _mesa_marshal_TextureStorage1DEXT);
   43905    SET_VertexAttrib4Nub(table, _mesa_marshal_VertexAttrib4Nub);
   43906    SET_VertexAttribP3ui(table, _mesa_marshal_VertexAttribP3ui);
   43907    SET_PointSize(table, _mesa_marshal_PointSize);
   43908    SET_PopName(table, _mesa_marshal_PopName);
   43909    SET_FramebufferTexture(table, _mesa_marshal_FramebufferTexture);
   43910    SET_CreateTransformFeedbacks(table, _mesa_marshal_CreateTransformFeedbacks);
   43911    SET_VertexAttrib4ubNV(table, _mesa_marshal_VertexAttrib4ubNV);
   43912    SET_ValidateProgramPipeline(table, _mesa_marshal_ValidateProgramPipeline);
   43913    SET_BindFragDataLocationIndexed(table, _mesa_marshal_BindFragDataLocationIndexed);
   43914    SET_GetClipPlane(table, _mesa_marshal_GetClipPlane);
   43915    SET_DeleteSemaphoresEXT(table, _mesa_marshal_DeleteSemaphoresEXT);
   43916    SET_TexCoordP4uiv(table, _mesa_marshal_TexCoordP4uiv);
   43917    SET_VertexAttribs3dvNV(table, _mesa_marshal_VertexAttribs3dvNV);
   43918    SET_ProgramUniformMatrix2x4dv(table, _mesa_marshal_ProgramUniformMatrix2x4dv);
   43919    SET_GenQueries(table, _mesa_marshal_GenQueries);
   43920    SET_ProgramUniform4iv(table, _mesa_marshal_ProgramUniform4iv);
   43921    SET_ObjectUnpurgeableAPPLE(table, _mesa_marshal_ObjectUnpurgeableAPPLE);
   43922    SET_GetCompressedTextureSubImage(table, _mesa_marshal_GetCompressedTextureSubImage);
   43923    SET_TexCoord2iv(table, _mesa_marshal_TexCoord2iv);
   43924    SET_TexImage2DMultisample(table, _mesa_marshal_TexImage2DMultisample);
   43925    SET_TexParameterx(table, _mesa_marshal_TexParameterx);
   43926    SET_Rotatef(table, _mesa_marshal_Rotatef);
   43927    SET_TexParameterf(table, _mesa_marshal_TexParameterf);
   43928    SET_TexParameteri(table, _mesa_marshal_TexParameteri);
   43929    SET_GetUniformiv(table, _mesa_marshal_GetUniformiv);
   43930    SET_ClearBufferSubData(table, _mesa_marshal_ClearBufferSubData);
   43931    SET_TextureParameterfv(table, _mesa_marshal_TextureParameterfv);
   43932    SET_VDPAUFiniNV(table, _mesa_marshal_VDPAUFiniNV);
   43933    SET_ProgramUniformMatrix4x2fv(table, _mesa_marshal_ProgramUniformMatrix4x2fv);
   43934    SET_ProgramUniform2f(table, _mesa_marshal_ProgramUniform2f);
   43935    SET_ProgramUniform2d(table, _mesa_marshal_ProgramUniform2d);
   43936    SET_ProgramUniform2i(table, _mesa_marshal_ProgramUniform2i);
   43937    SET_Fogx(table, _mesa_marshal_Fogx);
   43938    SET_Uniform3ui64ARB(table, _mesa_marshal_Uniform3ui64ARB);
   43939    SET_Fogf(table, _mesa_marshal_Fogf);
   43940    SET_TexSubImage1D(table, _mesa_marshal_TexSubImage1D);
   43941    SET_ProgramUniform3ui64vARB(table, _mesa_marshal_ProgramUniform3ui64vARB);
   43942    SET_Color4usv(table, _mesa_marshal_Color4usv);
   43943    SET_Fogi(table, _mesa_marshal_Fogi);
   43944    SET_DepthFunc(table, _mesa_marshal_DepthFunc);
   43945    SET_GetSamplerParameterIiv(table, _mesa_marshal_GetSamplerParameterIiv);
   43946    SET_VertexArrayAttribLFormat(table, _mesa_marshal_VertexArrayAttribLFormat);
   43947    SET_VertexAttribI4uiEXT(table, _mesa_marshal_VertexAttribI4uiEXT);
   43948    SET_DrawElementsInstancedBaseVertexBaseInstance(table, _mesa_marshal_DrawElementsInstancedBaseVertexBaseInstance);
   43949    SET_ProgramEnvParameter4dvARB(table, _mesa_marshal_ProgramEnvParameter4dvARB);
   43950    SET_ColorTableParameteriv(table, _mesa_marshal_ColorTableParameteriv);
   43951    SET_BindSamplers(table, _mesa_marshal_BindSamplers);
   43952    SET_GetnCompressedTexImageARB(table, _mesa_marshal_GetnCompressedTexImageARB);
   43953    SET_CopyNamedBufferSubData(table, _mesa_marshal_CopyNamedBufferSubData);
   43954    SET_BindSampler(table, _mesa_marshal_BindSampler);
   43955    SET_GetUniformuiv(table, _mesa_marshal_GetUniformuiv);
   43956    SET_GetQueryBufferObjectuiv(table, _mesa_marshal_GetQueryBufferObjectuiv);
   43957    SET_MultiTexCoord2fARB(table, _mesa_marshal_MultiTexCoord2fARB);
   43958    SET_Uniform1ui64ARB(table, _mesa_marshal_Uniform1ui64ARB);
   43959    SET_GetTextureImage(table, _mesa_marshal_GetTextureImage);
   43960    SET_MultiTexCoord3iv(table, _mesa_marshal_MultiTexCoord3iv);
   43961    SET_Finish(table, _mesa_marshal_Finish);
   43962    SET_ClearStencil(table, _mesa_marshal_ClearStencil);
   43963    SET_ClearColorIiEXT(table, _mesa_marshal_ClearColorIiEXT);
   43964    SET_LoadMatrixd(table, _mesa_marshal_LoadMatrixd);
   43965    SET_VDPAURegisterOutputSurfaceNV(table, _mesa_marshal_VDPAURegisterOutputSurfaceNV);
   43966    SET_VertexP4ui(table, _mesa_marshal_VertexP4ui);
   43967    SET_GetProgramResourceIndex(table, _mesa_marshal_GetProgramResourceIndex);
   43968    SET_TextureStorage3DMultisample(table, _mesa_marshal_TextureStorage3DMultisample);
   43969    SET_GetnUniformivARB(table, _mesa_marshal_GetnUniformivARB);
   43970    SET_ReleaseShaderCompiler(table, _mesa_marshal_ReleaseShaderCompiler);
   43971    SET_BlendFuncSeparate(table, _mesa_marshal_BlendFuncSeparate);
   43972    SET_Color3us(table, _mesa_marshal_Color3us);
   43973    SET_LoadMatrixx(table, _mesa_marshal_LoadMatrixx);
   43974    SET_BufferStorage(table, _mesa_marshal_BufferStorage);
   43975    SET_Color3ub(table, _mesa_marshal_Color3ub);
   43976    SET_Color3ui(table, _mesa_marshal_Color3ui);
   43977    SET_VertexAttrib4dvNV(table, _mesa_marshal_VertexAttrib4dvNV);
   43978    SET_AlphaFragmentOp2ATI(table, _mesa_marshal_AlphaFragmentOp2ATI);
   43979    SET_RasterPos4dv(table, _mesa_marshal_RasterPos4dv);
   43980    SET_DeleteProgramPipelines(table, _mesa_marshal_DeleteProgramPipelines);
   43981    SET_LineWidthx(table, _mesa_marshal_LineWidthx);
   43982    SET_GetTransformFeedbacki_v(table, _mesa_marshal_GetTransformFeedbacki_v);
   43983    SET_Indexdv(table, _mesa_marshal_Indexdv);
   43984    SET_GetnPixelMapfvARB(table, _mesa_marshal_GetnPixelMapfvARB);
   43985    SET_EGLImageTargetTexture2DOES(table, _mesa_marshal_EGLImageTargetTexture2DOES);
   43986    SET_DepthMask(table, _mesa_marshal_DepthMask);
   43987    SET_WindowPos4ivMESA(table, _mesa_marshal_WindowPos4ivMESA);
   43988    SET_GetShaderInfoLog(table, _mesa_marshal_GetShaderInfoLog);
   43989    SET_BindFragmentShaderATI(table, _mesa_marshal_BindFragmentShaderATI);
   43990    SET_BlendFuncSeparateiARB(table, _mesa_marshal_BlendFuncSeparateiARB);
   43991    SET_EGLImageTargetRenderbufferStorageOES(table, _mesa_marshal_EGLImageTargetRenderbufferStorageOES);
   43992    SET_GenTransformFeedbacks(table, _mesa_marshal_GenTransformFeedbacks);
   43993    SET_VertexPointer(table, _mesa_marshal_VertexPointer);
   43994    SET_GetCompressedTexImage(table, _mesa_marshal_GetCompressedTexImage);
   43995    SET_ProgramLocalParameter4dvARB(table, _mesa_marshal_ProgramLocalParameter4dvARB);
   43996    SET_UniformMatrix2dv(table, _mesa_marshal_UniformMatrix2dv);
   43997    SET_GetQueryObjectui64v(table, _mesa_marshal_GetQueryObjectui64v);
   43998    SET_VertexAttribP1uiv(table, _mesa_marshal_VertexAttribP1uiv);
   43999    SET_IsProgram(table, _mesa_marshal_IsProgram);
   44000    SET_BindBuffersBase(table, _mesa_marshal_BindBuffersBase);
   44001    SET_GenTextures(table, _mesa_marshal_GenTextures);
   44002    SET_UnmapNamedBuffer(table, _mesa_marshal_UnmapNamedBuffer);
   44003    SET_UniformMatrix3x2dv(table, _mesa_marshal_UniformMatrix3x2dv);
   44004    SET_WindowPos4fMESA(table, _mesa_marshal_WindowPos4fMESA);
   44005    SET_VertexAttribs2fvNV(table, _mesa_marshal_VertexAttribs2fvNV);
   44006    SET_VertexAttribP4ui(table, _mesa_marshal_VertexAttribP4ui);
   44007    SET_StringMarkerGREMEDY(table, _mesa_marshal_StringMarkerGREMEDY);
   44008    SET_Uniform4i(table, _mesa_marshal_Uniform4i);
   44009    SET_Uniform4d(table, _mesa_marshal_Uniform4d);
   44010    SET_Uniform4f(table, _mesa_marshal_Uniform4f);
   44011    SET_ProgramUniform3dv(table, _mesa_marshal_ProgramUniform3dv);
   44012    SET_GetNamedBufferParameteri64v(table, _mesa_marshal_GetNamedBufferParameteri64v);
   44013    SET_NamedFramebufferTexture(table, _mesa_marshal_NamedFramebufferTexture);
   44014    SET_ProgramUniform3d(table, _mesa_marshal_ProgramUniform3d);
   44015    SET_ProgramUniform3f(table, _mesa_marshal_ProgramUniform3f);
   44016    SET_ProgramUniform3i(table, _mesa_marshal_ProgramUniform3i);
   44017    SET_PointParameterfv(table, _mesa_marshal_PointParameterfv);
   44018    SET_GetHistogramParameterfv(table, _mesa_marshal_GetHistogramParameterfv);
   44019    SET_GetString(table, _mesa_marshal_GetString);
   44020    SET_VDPAUUnmapSurfacesNV(table, _mesa_marshal_VDPAUUnmapSurfacesNV);
   44021    SET_GetnHistogramARB(table, _mesa_marshal_GetnHistogramARB);
   44022    SET_SecondaryColor3s(table, _mesa_marshal_SecondaryColor3s);
   44023    SET_TexStorageMem2DEXT(table, _mesa_marshal_TexStorageMem2DEXT);
   44024    SET_VertexAttribP2uiv(table, _mesa_marshal_VertexAttribP2uiv);
   44025    SET_UniformMatrix3x4dv(table, _mesa_marshal_UniformMatrix3x4dv);
   44026    SET_VertexAttrib3fNV(table, _mesa_marshal_VertexAttrib3fNV);
   44027    SET_SecondaryColor3b(table, _mesa_marshal_SecondaryColor3b);
   44028    SET_EnableClientState(table, _mesa_marshal_EnableClientState);
   44029    SET_GetActiveSubroutineName(table, _mesa_marshal_GetActiveSubroutineName);
   44030    SET_SecondaryColor3i(table, _mesa_marshal_SecondaryColor3i);
   44031    SET_FlushMappedBufferRange(table, _mesa_marshal_FlushMappedBufferRange);
   44032    SET_TexStorageMem3DEXT(table, _mesa_marshal_TexStorageMem3DEXT);
   44033    SET_Lightfv(table, _mesa_marshal_Lightfv);
   44034    SET_GetFramebufferAttachmentParameteriv(table, _mesa_marshal_GetFramebufferAttachmentParameteriv);
   44035    SET_ColorSubTable(table, _mesa_marshal_ColorSubTable);
   44036    SET_GetVertexArrayIndexed64iv(table, _mesa_marshal_GetVertexArrayIndexed64iv);
   44037    SET_EndPerfMonitorAMD(table, _mesa_marshal_EndPerfMonitorAMD);
   44038    SET_CreateBuffers(table, _mesa_marshal_CreateBuffers);
   44039    SET_VertexAttribs4dvNV(table, _mesa_marshal_VertexAttribs4dvNV);
   44040    SET_Uniform2i64vARB(table, _mesa_marshal_Uniform2i64vARB);
   44041    SET_GetMultisamplefv(table, _mesa_marshal_GetMultisamplefv);
   44042    SET_GetActiveSubroutineUniformName(table, _mesa_marshal_GetActiveSubroutineUniformName);
   44043    SET_Rectdv(table, _mesa_marshal_Rectdv);
   44044    SET_DrawArraysInstancedARB(table, _mesa_marshal_DrawArraysInstancedARB);
   44045    SET_MakeImageHandleNonResidentARB(table, _mesa_marshal_MakeImageHandleNonResidentARB);
   44046    SET_ImportMemoryFdEXT(table, _mesa_marshal_ImportMemoryFdEXT);
   44047    SET_ProgramEnvParameters4fvEXT(table, _mesa_marshal_ProgramEnvParameters4fvEXT);
   44048    SET_TexStorageMem1DEXT(table, _mesa_marshal_TexStorageMem1DEXT);
   44049    SET_BlendBarrier(table, _mesa_marshal_BlendBarrier);
   44050    SET_VertexAttrib2svNV(table, _mesa_marshal_VertexAttrib2svNV);
   44051    SET_SecondaryColorP3uiv(table, _mesa_marshal_SecondaryColorP3uiv);
   44052    SET_GetnPixelMapuivARB(table, _mesa_marshal_GetnPixelMapuivARB);
   44053    SET_GetSamplerParameterIuiv(table, _mesa_marshal_GetSamplerParameterIuiv);
   44054    SET_Disablei(table, _mesa_marshal_Disablei);
   44055    SET_CompressedTexSubImage3D(table, _mesa_marshal_CompressedTexSubImage3D);
   44056    SET_WindowPos4svMESA(table, _mesa_marshal_WindowPos4svMESA);
   44057    SET_ObjectLabel(table, _mesa_marshal_ObjectLabel);
   44058    SET_Color3dv(table, _mesa_marshal_Color3dv);
   44059    SET_ProgramUniform1ui64ARB(table, _mesa_marshal_ProgramUniform1ui64ARB);
   44060    SET_BeginQuery(table, _mesa_marshal_BeginQuery);
   44061    SET_VertexP3uiv(table, _mesa_marshal_VertexP3uiv);
   44062    SET_GetUniformLocation(table, _mesa_marshal_GetUniformLocation);
   44063    SET_PixelStoref(table, _mesa_marshal_PixelStoref);
   44064    SET_WindowPos2iv(table, _mesa_marshal_WindowPos2iv);
   44065    SET_PixelStorei(table, _mesa_marshal_PixelStorei);
   44066    SET_VertexAttribs1svNV(table, _mesa_marshal_VertexAttribs1svNV);
   44067    SET_CheckNamedFramebufferStatus(table, _mesa_marshal_CheckNamedFramebufferStatus);
   44068    SET_UniformSubroutinesuiv(table, _mesa_marshal_UniformSubroutinesuiv);
   44069    SET_CheckFramebufferStatus(table, _mesa_marshal_CheckFramebufferStatus);
   44070    SET_DispatchComputeIndirect(table, _mesa_marshal_DispatchComputeIndirect);
   44071    SET_InvalidateBufferData(table, _mesa_marshal_InvalidateBufferData);
   44072    SET_GetUniformdv(table, _mesa_marshal_GetUniformdv);
   44073    SET_ProgramLocalParameters4fvEXT(table, _mesa_marshal_ProgramLocalParameters4fvEXT);
   44074    SET_VertexAttribL1dv(table, _mesa_marshal_VertexAttribL1dv);
   44075    SET_Uniform1ui64vARB(table, _mesa_marshal_Uniform1ui64vARB);
   44076    SET_IsFramebuffer(table, _mesa_marshal_IsFramebuffer);
   44077    SET_GetDoublev(table, _mesa_marshal_GetDoublev);
   44078    SET_GetObjectLabel(table, _mesa_marshal_GetObjectLabel);
   44079    SET_ColorP3uiv(table, _mesa_marshal_ColorP3uiv);
   44080    SET_GetTextureSubImage(table, _mesa_marshal_GetTextureSubImage);
   44081    SET_VertexAttribI4ivEXT(table, _mesa_marshal_VertexAttribI4ivEXT);
   44082    SET_VertexAttrib1svNV(table, _mesa_marshal_VertexAttrib1svNV);
   44083    SET_SecondaryColor3ubv(table, _mesa_marshal_SecondaryColor3ubv);
   44084    SET_GetDebugMessageLog(table, _mesa_marshal_GetDebugMessageLog);
   44085    SET_Uniform4ui64ARB(table, _mesa_marshal_Uniform4ui64ARB);
   44086    SET_RasterPos3fv(table, _mesa_marshal_RasterPos3fv);
   44087    SET_GetShaderSource(table, _mesa_marshal_GetShaderSource);
   44088    SET_BindProgramARB(table, _mesa_marshal_BindProgramARB);
   44089    SET_VertexAttrib3sNV(table, _mesa_marshal_VertexAttrib3sNV);
   44090    SET_ColorFragmentOp1ATI(table, _mesa_marshal_ColorFragmentOp1ATI);
   44091    SET_ProgramUniformMatrix4x3fv(table, _mesa_marshal_ProgramUniformMatrix4x3fv);
   44092    SET_PopClientAttrib(table, _mesa_marshal_PopClientAttrib);
   44093    SET_DrawElementsInstancedARB(table, _mesa_marshal_DrawElementsInstancedARB);
   44094    SET_GetQueryObjectuiv(table, _mesa_marshal_GetQueryObjectuiv);
   44095    SET_VertexAttribI4bv(table, _mesa_marshal_VertexAttribI4bv);
   44096    SET_DisableVertexArrayAttrib(table, _mesa_marshal_DisableVertexArrayAttrib);
   44097    SET_VertexAttribL4d(table, _mesa_marshal_VertexAttribL4d);
   44098    SET_ListBase(table, _mesa_marshal_ListBase);
   44099    SET_GenerateMipmap(table, _mesa_marshal_GenerateMipmap);
   44100    SET_BindBufferRange(table, _mesa_marshal_BindBufferRange);
   44101    SET_ProgramUniformMatrix2x4fv(table, _mesa_marshal_ProgramUniformMatrix2x4fv);
   44102    SET_BindBufferBase(table, _mesa_marshal_BindBufferBase);
   44103    SET_GetQueryObjectiv(table, _mesa_marshal_GetQueryObjectiv);
   44104    SET_VertexAttrib2s(table, _mesa_marshal_VertexAttrib2s);
   44105    SET_SecondaryColor3fvEXT(table, _mesa_marshal_SecondaryColor3fvEXT);
   44106    SET_VertexAttrib2d(table, _mesa_marshal_VertexAttrib2d);
   44107    SET_ClearNamedFramebufferiv(table, _mesa_marshal_ClearNamedFramebufferiv);
   44108    SET_Uniform1fv(table, _mesa_marshal_Uniform1fv);
   44109    SET_GetProgramPipelineInfoLog(table, _mesa_marshal_GetProgramPipelineInfoLog);
   44110    SET_DepthBoundsEXT(table, _mesa_marshal_DepthBoundsEXT);
   44111    SET_BufferStorageMemEXT(table, _mesa_marshal_BufferStorageMemEXT);
   44112    SET_WindowPos3fv(table, _mesa_marshal_WindowPos3fv);
   44113    SET_GetHistogramParameteriv(table, _mesa_marshal_GetHistogramParameteriv);
   44114    SET_PointParameteriv(table, _mesa_marshal_PointParameteriv);
   44115    SET_NamedRenderbufferStorage(table, _mesa_marshal_NamedRenderbufferStorage);
   44116    SET_GetProgramivARB(table, _mesa_marshal_GetProgramivARB);
   44117    SET_BindRenderbuffer(table, _mesa_marshal_BindRenderbuffer);
   44118    SET_SecondaryColor3fEXT(table, _mesa_marshal_SecondaryColor3fEXT);
   44119    SET_PrimitiveRestartIndex(table, _mesa_marshal_PrimitiveRestartIndex);
   44120    SET_TextureStorageMem3DEXT(table, _mesa_marshal_TextureStorageMem3DEXT);
   44121    SET_VertexAttribI4ubv(table, _mesa_marshal_VertexAttribI4ubv);
   44122    SET_GetGraphicsResetStatusARB(table, _mesa_marshal_GetGraphicsResetStatusARB);
   44123    SET_CreateRenderbuffers(table, _mesa_marshal_CreateRenderbuffers);
   44124    SET_ActiveStencilFaceEXT(table, _mesa_marshal_ActiveStencilFaceEXT);
   44125    SET_VertexAttrib4dNV(table, _mesa_marshal_VertexAttrib4dNV);
   44126    SET_DepthRange(table, _mesa_marshal_DepthRange);
   44127    SET_VertexAttrib4fNV(table, _mesa_marshal_VertexAttrib4fNV);
   44128    SET_Uniform4fv(table, _mesa_marshal_Uniform4fv);
   44129    SET_SamplerParameterIiv(table, _mesa_marshal_SamplerParameterIiv);
   44130    SET_Frustumf(table, _mesa_marshal_Frustumf);
   44131    SET_GetQueryBufferObjectui64v(table, _mesa_marshal_GetQueryBufferObjectui64v);
   44132    SET_ProgramUniform2uiv(table, _mesa_marshal_ProgramUniform2uiv);
   44133    SET_Rectsv(table, _mesa_marshal_Rectsv);
   44134    SET_Frustumx(table, _mesa_marshal_Frustumx);
   44135    SET_CullFace(table, _mesa_marshal_CullFace);
   44136    SET_BindTexture(table, _mesa_marshal_BindTexture);
   44137    SET_MultiTexCoord4fARB(table, _mesa_marshal_MultiTexCoord4fARB);
   44138    SET_Uniform2ui64ARB(table, _mesa_marshal_Uniform2ui64ARB);
   44139    SET_MultiTexCoordP2uiv(table, _mesa_marshal_MultiTexCoordP2uiv);
   44140    SET_BeginPerfQueryINTEL(table, _mesa_marshal_BeginPerfQueryINTEL);
   44141    SET_NormalPointer(table, _mesa_marshal_NormalPointer);
   44142    SET_WindowPos4iMESA(table, _mesa_marshal_WindowPos4iMESA);
   44143    SET_VertexAttrib4bv(table, _mesa_marshal_VertexAttrib4bv);
   44144    SET_SecondaryColor3usv(table, _mesa_marshal_SecondaryColor3usv);
   44145    SET_GetPixelMapuiv(table, _mesa_marshal_GetPixelMapuiv);
   44146    SET_MapNamedBuffer(table, _mesa_marshal_MapNamedBuffer);
   44147    SET_Indexfv(table, _mesa_marshal_Indexfv);
   44148    SET_AlphaFragmentOp1ATI(table, _mesa_marshal_AlphaFragmentOp1ATI);
   44149    SET_GetFloatv(table, _mesa_marshal_GetFloatv);
   44150    SET_ProgramUniform2dv(table, _mesa_marshal_ProgramUniform2dv);
   44151    SET_MultiTexCoord3i(table, _mesa_marshal_MultiTexCoord3i);
   44152    SET_ProgramUniform1fv(table, _mesa_marshal_ProgramUniform1fv);
   44153    SET_MultiTexCoord3d(table, _mesa_marshal_MultiTexCoord3d);
   44154    SET_TexCoord3sv(table, _mesa_marshal_TexCoord3sv);
   44155    SET_Fogfv(table, _mesa_marshal_Fogfv);
   44156    SET_Minmax(table, _mesa_marshal_Minmax);
   44157    SET_MultiTexCoord3s(table, _mesa_marshal_MultiTexCoord3s);
   44158    SET_Vertex4iv(table, _mesa_marshal_Vertex4iv);
   44159    SET_BufferSubData(table, _mesa_marshal_BufferSubData);
   44160    SET_TexCoord4dv(table, _mesa_marshal_TexCoord4dv);
   44161    SET_Begin(table, _mesa_marshal_Begin);
   44162    SET_LightModeli(table, _mesa_marshal_LightModeli);
   44163    SET_UniformMatrix2fv(table, _mesa_marshal_UniformMatrix2fv);
   44164    SET_LightModelf(table, _mesa_marshal_LightModelf);
   44165    SET_GetTexParameterfv(table, _mesa_marshal_GetTexParameterfv);
   44166    SET_TextureStorage1D(table, _mesa_marshal_TextureStorage1D);
   44167    SET_MultiTexCoord2fvARB(table, _mesa_marshal_MultiTexCoord2fvARB);
   44168    SET_VertexAttrib4ubv(table, _mesa_marshal_VertexAttrib4ubv);
   44169    SET_GetnTexImageARB(table, _mesa_marshal_GetnTexImageARB);
   44170    SET_ColorMask(table, _mesa_marshal_ColorMask);
   44171    SET_MultiTexCoord4x(table, _mesa_marshal_MultiTexCoord4x);
   44172    SET_UniformHandleui64ARB(table, _mesa_marshal_UniformHandleui64ARB);
   44173    SET_VertexAttribs4svNV(table, _mesa_marshal_VertexAttribs4svNV);
   44174    SET_DrawElementsInstancedBaseInstance(table, _mesa_marshal_DrawElementsInstancedBaseInstance);
   44175    SET_UniformMatrix4fv(table, _mesa_marshal_UniformMatrix4fv);
   44176    SET_UniformMatrix3x2fv(table, _mesa_marshal_UniformMatrix3x2fv);
   44177    SET_VertexAttrib4Nuiv(table, _mesa_marshal_VertexAttrib4Nuiv);
   44178    SET_ClientActiveTexture(table, _mesa_marshal_ClientActiveTexture);
   44179    SET_GetUniformIndices(table, _mesa_marshal_GetUniformIndices);
   44180    SET_MultiTexCoord2sv(table, _mesa_marshal_MultiTexCoord2sv);
   44181    SET_NamedBufferStorage(table, _mesa_marshal_NamedBufferStorage);
   44182    SET_NamedFramebufferDrawBuffer(table, _mesa_marshal_NamedFramebufferDrawBuffer);
   44183    SET_NamedFramebufferTextureLayer(table, _mesa_marshal_NamedFramebufferTextureLayer);
   44184    SET_LoadIdentity(table, _mesa_marshal_LoadIdentity);
   44185    SET_ActiveShaderProgram(table, _mesa_marshal_ActiveShaderProgram);
   44186    SET_BindImageTextures(table, _mesa_marshal_BindImageTextures);
   44187    SET_DeleteTransformFeedbacks(table, _mesa_marshal_DeleteTransformFeedbacks);
   44188    SET_VertexAttrib4ubvNV(table, _mesa_marshal_VertexAttrib4ubvNV);
   44189    SET_FogCoordfEXT(table, _mesa_marshal_FogCoordfEXT);
   44190    SET_GetMapfv(table, _mesa_marshal_GetMapfv);
   44191    SET_GetProgramInfoLog(table, _mesa_marshal_GetProgramInfoLog);
   44192    SET_BindTransformFeedback(table, _mesa_marshal_BindTransformFeedback);
   44193    SET_GetPixelMapfv(table, _mesa_marshal_GetPixelMapfv);
   44194    SET_TextureBufferRange(table, _mesa_marshal_TextureBufferRange);
   44195    SET_VertexAttrib4svNV(table, _mesa_marshal_VertexAttrib4svNV);
   44196    SET_PatchParameteri(table, _mesa_marshal_PatchParameteri);
   44197    SET_GetNamedBufferSubData(table, _mesa_marshal_GetNamedBufferSubData);
   44198    SET_VDPAUSurfaceAccessNV(table, _mesa_marshal_VDPAUSurfaceAccessNV);
   44199    SET_EdgeFlagPointer(table, _mesa_marshal_EdgeFlagPointer);
   44200    SET_WindowPos2f(table, _mesa_marshal_WindowPos2f);
   44201    SET_WindowPos2d(table, _mesa_marshal_WindowPos2d);
   44202    SET_GetVertexAttribLdv(table, _mesa_marshal_GetVertexAttribLdv);
   44203    SET_WindowPos2i(table, _mesa_marshal_WindowPos2i);
   44204    SET_WindowPos2s(table, _mesa_marshal_WindowPos2s);
   44205    SET_VertexAttribI1uiEXT(table, _mesa_marshal_VertexAttribI1uiEXT);
   44206    SET_DeleteSync(table, _mesa_marshal_DeleteSync);
   44207    SET_WindowPos4fvMESA(table, _mesa_marshal_WindowPos4fvMESA);
   44208    SET_CompressedTexImage3D(table, _mesa_marshal_CompressedTexImage3D);
   44209    SET_GenSemaphoresEXT(table, _mesa_marshal_GenSemaphoresEXT);
   44210    SET_VertexAttribI1uiv(table, _mesa_marshal_VertexAttribI1uiv);
   44211    SET_SecondaryColor3dv(table, _mesa_marshal_SecondaryColor3dv);
   44212    SET_GetnPixelMapusvARB(table, _mesa_marshal_GetnPixelMapusvARB);
   44213    SET_VertexAttrib3s(table, _mesa_marshal_VertexAttrib3s);
   44214    SET_UniformMatrix4x3fv(table, _mesa_marshal_UniformMatrix4x3fv);
   44215    SET_GetQueryiv(table, _mesa_marshal_GetQueryiv);
   44216    SET_VertexAttrib3d(table, _mesa_marshal_VertexAttrib3d);
   44217    SET_MapNamedBufferRange(table, _mesa_marshal_MapNamedBufferRange);
   44218    SET_MapBuffer(table, _mesa_marshal_MapBuffer);
   44219    SET_GetProgramStageiv(table, _mesa_marshal_GetProgramStageiv);
   44220    SET_VertexAttrib4Nbv(table, _mesa_marshal_VertexAttrib4Nbv);
   44221    SET_ProgramBinary(table, _mesa_marshal_ProgramBinary);
   44222    SET_InvalidateTexImage(table, _mesa_marshal_InvalidateTexImage);
   44223    SET_Uniform4ui(table, _mesa_marshal_Uniform4ui);
   44224    SET_VertexArrayAttribFormat(table, _mesa_marshal_VertexArrayAttribFormat);
   44225    SET_VertexAttrib1fARB(table, _mesa_marshal_VertexAttrib1fARB);
   44226    SET_GetBooleani_v(table, _mesa_marshal_GetBooleani_v);
   44227    SET_DrawTexsOES(table, _mesa_marshal_DrawTexsOES);
   44228    SET_GetObjectPtrLabel(table, _mesa_marshal_GetObjectPtrLabel);
   44229    SET_ProgramParameteri(table, _mesa_marshal_ProgramParameteri);
   44230    SET_Color3fv(table, _mesa_marshal_Color3fv);
   44231    SET_GetnMapfvARB(table, _mesa_marshal_GetnMapfvARB);
   44232    SET_MultiTexCoord2i(table, _mesa_marshal_MultiTexCoord2i);
   44233    SET_MultiTexCoord2d(table, _mesa_marshal_MultiTexCoord2d);
   44234    SET_SamplerParameterIuiv(table, _mesa_marshal_SamplerParameterIuiv);
   44235    SET_MultiTexCoord2s(table, _mesa_marshal_MultiTexCoord2s);
   44236    SET_GetInternalformati64v(table, _mesa_marshal_GetInternalformati64v);
   44237    SET_VDPAURegisterVideoSurfaceNV(table, _mesa_marshal_VDPAURegisterVideoSurfaceNV);
   44238    SET_Indexub(table, _mesa_marshal_Indexub);
   44239    SET_GetPerfMonitorCounterDataAMD(table, _mesa_marshal_GetPerfMonitorCounterDataAMD);
   44240    SET_MultTransposeMatrixf(table, _mesa_marshal_MultTransposeMatrixf);
   44241    SET_PolygonOffsetEXT(table, _mesa_marshal_PolygonOffsetEXT);
   44242    SET_Scalex(table, _mesa_marshal_Scalex);
   44243    SET_Scaled(table, _mesa_marshal_Scaled);
   44244    SET_Scalef(table, _mesa_marshal_Scalef);
   44245    SET_IndexPointerEXT(table, _mesa_marshal_IndexPointerEXT);
   44246    SET_GetUniformfv(table, _mesa_marshal_GetUniformfv);
   44247    SET_ColorFragmentOp2ATI(table, _mesa_marshal_ColorFragmentOp2ATI);
   44248    SET_VertexAttrib2sNV(table, _mesa_marshal_VertexAttrib2sNV);
   44249    SET_ReadPixels(table, _mesa_marshal_ReadPixels);
   44250    SET_QueryCounter(table, _mesa_marshal_QueryCounter);
   44251    SET_NormalPointerEXT(table, _mesa_marshal_NormalPointerEXT);
   44252    SET_GetSubroutineIndex(table, _mesa_marshal_GetSubroutineIndex);
   44253    SET_ProgramUniform3iv(table, _mesa_marshal_ProgramUniform3iv);
   44254    SET_ProgramUniformMatrix2dv(table, _mesa_marshal_ProgramUniformMatrix2dv);
   44255    SET_ClearTexSubImage(table, _mesa_marshal_ClearTexSubImage);
   44256    SET_GetActiveUniformBlockName(table, _mesa_marshal_GetActiveUniformBlockName);
   44257    SET_DrawElementsBaseVertex(table, _mesa_marshal_DrawElementsBaseVertex);
   44258    SET_RasterPos3iv(table, _mesa_marshal_RasterPos3iv);
   44259    SET_ColorMaski(table, _mesa_marshal_ColorMaski);
   44260    SET_Uniform2uiv(table, _mesa_marshal_Uniform2uiv);
   44261    SET_RasterPos3s(table, _mesa_marshal_RasterPos3s);
   44262    SET_RasterPos3d(table, _mesa_marshal_RasterPos3d);
   44263    SET_RasterPos3f(table, _mesa_marshal_RasterPos3f);
   44264    SET_BindVertexArray(table, _mesa_marshal_BindVertexArray);
   44265    SET_RasterPos3i(table, _mesa_marshal_RasterPos3i);
   44266    SET_VertexAttribL3dv(table, _mesa_marshal_VertexAttribL3dv);
   44267    SET_GetTexParameteriv(table, _mesa_marshal_GetTexParameteriv);
   44268    SET_DrawTransformFeedbackStreamInstanced(table, _mesa_marshal_DrawTransformFeedbackStreamInstanced);
   44269    SET_VertexAttrib2fvARB(table, _mesa_marshal_VertexAttrib2fvARB);
   44270    SET_GetProgramResourceName(table, _mesa_marshal_GetProgramResourceName);
   44271    SET_ProgramUniformMatrix4x3dv(table, _mesa_marshal_ProgramUniformMatrix4x3dv);
   44272    SET_ColorTable(table, _mesa_marshal_ColorTable);
   44273    SET_LoadName(table, _mesa_marshal_LoadName);
   44274    SET_GetnUniformuivARB(table, _mesa_marshal_GetnUniformuivARB);
   44275    SET_ClearIndex(table, _mesa_marshal_ClearIndex);
   44276    SET_ConvolutionParameterfv(table, _mesa_marshal_ConvolutionParameterfv);
   44277    SET_GetTexGendv(table, _mesa_marshal_GetTexGendv);
   44278    SET_FlushMappedNamedBufferRange(table, _mesa_marshal_FlushMappedNamedBufferRange);
   44279    SET_MultiTexCoordP1ui(table, _mesa_marshal_MultiTexCoordP1ui);
   44280    SET_EvalMesh2(table, _mesa_marshal_EvalMesh2);
   44281    SET_Vertex4fv(table, _mesa_marshal_Vertex4fv);
   44282    SET_ProgramUniform4i64ARB(table, _mesa_marshal_ProgramUniform4i64ARB);
   44283    SET_SelectPerfMonitorCountersAMD(table, _mesa_marshal_SelectPerfMonitorCountersAMD);
   44284    SET_TextureStorage2D(table, _mesa_marshal_TextureStorage2D);
   44285    SET_GetTextureParameterIiv(table, _mesa_marshal_GetTextureParameterIiv);
   44286    SET_BindFramebuffer(table, _mesa_marshal_BindFramebuffer);
   44287    SET_GetMinmax(table, _mesa_marshal_GetMinmax);
   44288    SET_VertexAttribs3svNV(table, _mesa_marshal_VertexAttribs3svNV);
   44289    SET_GetActiveUniformsiv(table, _mesa_marshal_GetActiveUniformsiv);
   44290    SET_VertexAttrib2sv(table, _mesa_marshal_VertexAttrib2sv);
   44291    SET_GetProgramEnvParameterdvARB(table, _mesa_marshal_GetProgramEnvParameterdvARB);
   44292    SET_Uniform1dv(table, _mesa_marshal_Uniform1dv);
   44293    SET_TransformFeedbackBufferRange(table, _mesa_marshal_TransformFeedbackBufferRange);
   44294    SET_PushDebugGroup(table, _mesa_marshal_PushDebugGroup);
   44295    SET_GetPerfMonitorGroupStringAMD(table, _mesa_marshal_GetPerfMonitorGroupStringAMD);
   44296    SET_GetError(table, _mesa_marshal_GetError);
   44297    SET_PassThrough(table, _mesa_marshal_PassThrough);
   44298    SET_PatchParameterfv(table, _mesa_marshal_PatchParameterfv);
   44299    SET_GetObjectParameterivAPPLE(table, _mesa_marshal_GetObjectParameterivAPPLE);
   44300    SET_BindBuffersRange(table, _mesa_marshal_BindBuffersRange);
   44301    SET_VertexAttrib4fvARB(table, _mesa_marshal_VertexAttrib4fvARB);
   44302    SET_Uniform3i64vARB(table, _mesa_marshal_Uniform3i64vARB);
   44303    SET_WindowPos3dv(table, _mesa_marshal_WindowPos3dv);
   44304    SET_TexGenxOES(table, _mesa_marshal_TexGenxOES);
   44305    SET_VertexArrayAttribIFormat(table, _mesa_marshal_VertexArrayAttribIFormat);
   44306    SET_StencilOp(table, _mesa_marshal_StencilOp);
   44307    SET_ProgramUniform1iv(table, _mesa_marshal_ProgramUniform1iv);
   44308    SET_ProgramUniform3ui(table, _mesa_marshal_ProgramUniform3ui);
   44309    SET_SecondaryColor3sv(table, _mesa_marshal_SecondaryColor3sv);
   44310    SET_TexCoordP3ui(table, _mesa_marshal_TexCoordP3ui);
   44311    SET_VertexArrayElementBuffer(table, _mesa_marshal_VertexArrayElementBuffer);
   44312    SET_Fogxv(table, _mesa_marshal_Fogxv);
   44313    SET_Uniform3i64ARB(table, _mesa_marshal_Uniform3i64ARB);
   44314    SET_VertexAttribP1ui(table, _mesa_marshal_VertexAttribP1ui);
   44315    SET_GetImageHandleARB(table, _mesa_marshal_GetImageHandleARB);
   44316    SET_DeleteLists(table, _mesa_marshal_DeleteLists);
   44317    SET_LogicOp(table, _mesa_marshal_LogicOp);
   44318    SET_RenderbufferStorageMultisample(table, _mesa_marshal_RenderbufferStorageMultisample);
   44319    SET_GetTransformFeedbacki64_v(table, _mesa_marshal_GetTransformFeedbacki64_v);
   44320    SET_WindowPos3d(table, _mesa_marshal_WindowPos3d);
   44321    SET_Enablei(table, _mesa_marshal_Enablei);
   44322    SET_WindowPos3f(table, _mesa_marshal_WindowPos3f);
   44323    SET_GenProgramsARB(table, _mesa_marshal_GenProgramsARB);
   44324    SET_RasterPos2sv(table, _mesa_marshal_RasterPos2sv);
   44325    SET_WindowPos3i(table, _mesa_marshal_WindowPos3i);
   44326    SET_MultiTexCoord4iv(table, _mesa_marshal_MultiTexCoord4iv);
   44327    SET_TexCoord1sv(table, _mesa_marshal_TexCoord1sv);
   44328    SET_WindowPos3s(table, _mesa_marshal_WindowPos3s);
   44329    SET_PixelMapusv(table, _mesa_marshal_PixelMapusv);
   44330    SET_DebugMessageInsert(table, _mesa_marshal_DebugMessageInsert);
   44331    SET_Orthof(table, _mesa_marshal_Orthof);
   44332    SET_CompressedTexImage2D(table, _mesa_marshal_CompressedTexImage2D);
   44333    SET_DeleteObjectARB(table, _mesa_marshal_DeleteObjectARB);
   44334    SET_ProgramUniformMatrix2x3dv(table, _mesa_marshal_ProgramUniformMatrix2x3dv);
   44335    SET_GetVertexArrayiv(table, _mesa_marshal_GetVertexArrayiv);
   44336    SET_IsSync(table, _mesa_marshal_IsSync);
   44337    SET_Color4uiv(table, _mesa_marshal_Color4uiv);
   44338    SET_MultiTexCoord1sv(table, _mesa_marshal_MultiTexCoord1sv);
   44339    SET_Orthox(table, _mesa_marshal_Orthox);
   44340    SET_PushAttrib(table, _mesa_marshal_PushAttrib);
   44341    SET_RasterPos2i(table, _mesa_marshal_RasterPos2i);
   44342    SET_ClipPlane(table, _mesa_marshal_ClipPlane);
   44343    SET_RasterPos2f(table, _mesa_marshal_RasterPos2f);
   44344    SET_GetActiveSubroutineUniformiv(table, _mesa_marshal_GetActiveSubroutineUniformiv);
   44345    SET_RasterPos2d(table, _mesa_marshal_RasterPos2d);
   44346    SET_MakeImageHandleResidentARB(table, _mesa_marshal_MakeImageHandleResidentARB);
   44347    SET_InvalidateSubFramebuffer(table, _mesa_marshal_InvalidateSubFramebuffer);
   44348    SET_Color4ub(table, _mesa_marshal_Color4ub);
   44349    SET_UniformMatrix2x4dv(table, _mesa_marshal_UniformMatrix2x4dv);
   44350    SET_RasterPos2s(table, _mesa_marshal_RasterPos2s);
   44351    SET_DispatchComputeGroupSizeARB(table, _mesa_marshal_DispatchComputeGroupSizeARB);
   44352    SET_VertexP2uiv(table, _mesa_marshal_VertexP2uiv);
   44353    SET_VertexArrayBindingDivisor(table, _mesa_marshal_VertexArrayBindingDivisor);
   44354    SET_MultiTexCoord3dv(table, _mesa_marshal_MultiTexCoord3dv);
   44355    SET_BindProgramPipeline(table, _mesa_marshal_BindProgramPipeline);
   44356    SET_VertexAttribP4uiv(table, _mesa_marshal_VertexAttribP4uiv);
   44357    SET_DebugMessageCallback(table, _mesa_marshal_DebugMessageCallback);
   44358    SET_MultiTexCoord1i(table, _mesa_marshal_MultiTexCoord1i);
   44359    SET_WindowPos2dv(table, _mesa_marshal_WindowPos2dv);
   44360    SET_TexParameterIuiv(table, _mesa_marshal_TexParameterIuiv);
   44361    SET_DeletePerfQueryINTEL(table, _mesa_marshal_DeletePerfQueryINTEL);
   44362    SET_MultiTexCoord1d(table, _mesa_marshal_MultiTexCoord1d);
   44363    SET_MultiTexCoord1s(table, _mesa_marshal_MultiTexCoord1s);
   44364    SET_BeginConditionalRender(table, _mesa_marshal_BeginConditionalRender);
   44365    SET_GetShaderiv(table, _mesa_marshal_GetShaderiv);
   44366    SET_CopyConvolutionFilter1D(table, _mesa_marshal_CopyConvolutionFilter1D);
   44367    SET_ClearBufferfv(table, _mesa_marshal_ClearBufferfv);
   44368    SET_UniformMatrix4dv(table, _mesa_marshal_UniformMatrix4dv);
   44369    SET_CreateShaderObjectARB(table, _mesa_marshal_CreateShaderObjectARB);
   44370    SET_GetTexParameterxv(table, _mesa_marshal_GetTexParameterxv);
   44371    SET_GetAttachedShaders(table, _mesa_marshal_GetAttachedShaders);
   44372    SET_ClearBufferfi(table, _mesa_marshal_ClearBufferfi);
   44373    SET_Materialiv(table, _mesa_marshal_Materialiv);
   44374    SET_DeleteFragmentShaderATI(table, _mesa_marshal_DeleteFragmentShaderATI);
   44375    SET_VertexArrayVertexBuffers(table, _mesa_marshal_VertexArrayVertexBuffers);
   44376    SET_DrawElementsInstancedBaseVertex(table, _mesa_marshal_DrawElementsInstancedBaseVertex);
   44377    SET_DisableClientState(table, _mesa_marshal_DisableClientState);
   44378    SET_TexGeni(table, _mesa_marshal_TexGeni);
   44379    SET_TexGenf(table, _mesa_marshal_TexGenf);
   44380    SET_TexGend(table, _mesa_marshal_TexGend);
   44381    SET_ProgramUniform4i64vARB(table, _mesa_marshal_ProgramUniform4i64vARB);
   44382    SET_Color4sv(table, _mesa_marshal_Color4sv);
   44383    SET_LoadTransposeMatrixf(table, _mesa_marshal_LoadTransposeMatrixf);
   44384    SET_LoadTransposeMatrixd(table, _mesa_marshal_LoadTransposeMatrixd);
   44385    SET_PixelZoom(table, _mesa_marshal_PixelZoom);
   44386    SET_ProgramEnvParameter4dARB(table, _mesa_marshal_ProgramEnvParameter4dARB);
   44387    SET_ColorTableParameterfv(table, _mesa_marshal_ColorTableParameterfv);
   44388    SET_IsSemaphoreEXT(table, _mesa_marshal_IsSemaphoreEXT);
   44389    SET_IsTexture(table, _mesa_marshal_IsTexture);
   44390    SET_ProgramUniform3uiv(table, _mesa_marshal_ProgramUniform3uiv);
   44391    SET_IndexPointer(table, _mesa_marshal_IndexPointer);
   44392    SET_VertexAttrib4sNV(table, _mesa_marshal_VertexAttrib4sNV);
   44393    SET_GetMapdv(table, _mesa_marshal_GetMapdv);
   44394    SET_Uniform3ui64vARB(table, _mesa_marshal_Uniform3ui64vARB);
   44395    SET_GetInteger64i_v(table, _mesa_marshal_GetInteger64i_v);
   44396    SET_BufferPageCommitmentARB(table, _mesa_marshal_BufferPageCommitmentARB);
   44397    SET_IsBuffer(table, _mesa_marshal_IsBuffer);
   44398    SET_ColorP4ui(table, _mesa_marshal_ColorP4ui);
   44399    SET_TextureStorage3D(table, _mesa_marshal_TextureStorage3D);
   44400    SET_TexCoordP3uiv(table, _mesa_marshal_TexCoordP3uiv);
   44401    SET_GetnUniformui64vARB(table, _mesa_marshal_GetnUniformui64vARB);
   44402    SET_TextureStorageMem2DMultisampleEXT(table, _mesa_marshal_TextureStorageMem2DMultisampleEXT);
   44403    SET_Uniform1iv(table, _mesa_marshal_Uniform1iv);
   44404    SET_Uniform4uiv(table, _mesa_marshal_Uniform4uiv);
   44405    SET_PopDebugGroup(table, _mesa_marshal_PopDebugGroup);
   44406    SET_VertexAttrib1d(table, _mesa_marshal_VertexAttrib1d);
   44407    SET_CompressedTexImage1D(table, _mesa_marshal_CompressedTexImage1D);
   44408    SET_NamedBufferSubData(table, _mesa_marshal_NamedBufferSubData);
   44409    SET_TexBufferRange(table, _mesa_marshal_TexBufferRange);
   44410    SET_VertexAttrib1s(table, _mesa_marshal_VertexAttrib1s);
   44411    SET_MultiDrawElementsIndirect(table, _mesa_marshal_MultiDrawElementsIndirect);
   44412    SET_UniformMatrix4x3dv(table, _mesa_marshal_UniformMatrix4x3dv);
   44413    SET_TransformFeedbackBufferBase(table, _mesa_marshal_TransformFeedbackBufferBase);
   44414    SET_FogCoordfvEXT(table, _mesa_marshal_FogCoordfvEXT);
   44415    SET_Uniform2ui64vARB(table, _mesa_marshal_Uniform2ui64vARB);
   44416    SET_GetColorTableParameterfv(table, _mesa_marshal_GetColorTableParameterfv);
   44417    SET_MultiTexCoord3fARB(table, _mesa_marshal_MultiTexCoord3fARB);
   44418    SET_GetTexLevelParameterfv(table, _mesa_marshal_GetTexLevelParameterfv);
   44419    SET_Vertex2sv(table, _mesa_marshal_Vertex2sv);
   44420    SET_GetnMapdvARB(table, _mesa_marshal_GetnMapdvARB);
   44421    SET_VertexAttrib2dNV(table, _mesa_marshal_VertexAttrib2dNV);
   44422    SET_VertexAttrib3svNV(table, _mesa_marshal_VertexAttrib3svNV);
   44423    SET_GetTexEnviv(table, _mesa_marshal_GetTexEnviv);
   44424    SET_ViewportArrayv(table, _mesa_marshal_ViewportArrayv);
   44425    SET_SeparableFilter2D(table, _mesa_marshal_SeparableFilter2D);
   44426    SET_ArrayElement(table, _mesa_marshal_ArrayElement);
   44427    SET_TexImage2D(table, _mesa_marshal_TexImage2D);
   44428    SET_RasterPos2dv(table, _mesa_marshal_RasterPos2dv);
   44429    SET_Fogiv(table, _mesa_marshal_Fogiv);
   44430    SET_EndQuery(table, _mesa_marshal_EndQuery);
   44431    SET_TexCoord1dv(table, _mesa_marshal_TexCoord1dv);
   44432    SET_AlphaFragmentOp3ATI(table, _mesa_marshal_AlphaFragmentOp3ATI);
   44433    SET_Clear(table, _mesa_marshal_Clear);
   44434    SET_VertexAttrib4sv(table, _mesa_marshal_VertexAttrib4sv);
   44435    SET_Ortho(table, _mesa_marshal_Ortho);
   44436    SET_Uniform3uiv(table, _mesa_marshal_Uniform3uiv);
   44437    SET_GetUniformi64vARB(table, _mesa_marshal_GetUniformi64vARB);
   44438    SET_EndQueryIndexed(table, _mesa_marshal_EndQueryIndexed);
   44439    SET_TexParameterxv(table, _mesa_marshal_TexParameterxv);
   44440    SET_MultiDrawArraysIndirectCountARB(table, _mesa_marshal_MultiDrawArraysIndirectCountARB);
   44441    SET_ProgramUniformMatrix2fv(table, _mesa_marshal_ProgramUniformMatrix2fv);
   44442    SET_ProgramLocalParameter4fvARB(table, _mesa_marshal_ProgramLocalParameter4fvARB);
   44443    SET_Uniform4dv(table, _mesa_marshal_Uniform4dv);
   44444    SET_GetUnsignedBytevEXT(table, _mesa_marshal_GetUnsignedBytevEXT);
   44445    SET_LightModelx(table, _mesa_marshal_LightModelx);
   44446    SET_VertexAttribI3iEXT(table, _mesa_marshal_VertexAttribI3iEXT);
   44447    SET_ClearColorx(table, _mesa_marshal_ClearColorx);
   44448    SET_EndTransformFeedback(table, _mesa_marshal_EndTransformFeedback);
   44449    SET_VertexAttribL2dv(table, _mesa_marshal_VertexAttribL2dv);
   44450    SET_GetActiveUniformName(table, _mesa_marshal_GetActiveUniformName);
   44451    SET_GetProgramBinary(table, _mesa_marshal_GetProgramBinary);
   44452    SET_ViewportIndexedfv(table, _mesa_marshal_ViewportIndexedfv);
   44453    SET_BindTextureUnit(table, _mesa_marshal_BindTextureUnit);
   44454    SET_CallList(table, _mesa_marshal_CallList);
   44455    SET_Materialfv(table, _mesa_marshal_Materialfv);
   44456    SET_DeleteProgram(table, _mesa_marshal_DeleteProgram);
   44457    SET_GetActiveAtomicCounterBufferiv(table, _mesa_marshal_GetActiveAtomicCounterBufferiv);
   44458    SET_ClearDepthf(table, _mesa_marshal_ClearDepthf);
   44459    SET_GetTextureHandleARB(table, _mesa_marshal_GetTextureHandleARB);
   44460    SET_GetConvolutionFilter(table, _mesa_marshal_GetConvolutionFilter);
   44461    SET_MultiModeDrawElementsIBM(table, _mesa_marshal_MultiModeDrawElementsIBM);
   44462    SET_Uniform2iv(table, _mesa_marshal_Uniform2iv);
   44463    SET_GetFixedv(table, _mesa_marshal_GetFixedv);
   44464    SET_SampleCoveragex(table, _mesa_marshal_SampleCoveragex);
   44465    SET_GetPerfQueryInfoINTEL(table, _mesa_marshal_GetPerfQueryInfoINTEL);
   44466    SET_DeleteFramebuffers(table, _mesa_marshal_DeleteFramebuffers);
   44467    SET_VertexAttrib4uiv(table, _mesa_marshal_VertexAttrib4uiv);
   44468    SET_VertexAttrib4Nsv(table, _mesa_marshal_VertexAttrib4Nsv);
   44469    SET_Vertex4s(table, _mesa_marshal_Vertex4s);
   44470    SET_VertexAttribI2iEXT(table, _mesa_marshal_VertexAttribI2iEXT);
   44471    SET_Vertex4f(table, _mesa_marshal_Vertex4f);
   44472    SET_Vertex4d(table, _mesa_marshal_Vertex4d);
   44473    SET_VertexAttribL4dv(table, _mesa_marshal_VertexAttribL4dv);
   44474    SET_GetnUniformi64vARB(table, _mesa_marshal_GetnUniformi64vARB);
   44475    SET_GetTexGenfv(table, _mesa_marshal_GetTexGenfv);
   44476    SET_Vertex4i(table, _mesa_marshal_Vertex4i);
   44477    SET_MemoryBarrierByRegion(table, _mesa_marshal_MemoryBarrierByRegion);
   44478    SET_StencilFuncSeparateATI(table, _mesa_marshal_StencilFuncSeparateATI);
   44479    SET_GetVertexAttribIuiv(table, _mesa_marshal_GetVertexAttribIuiv);
   44480    SET_LightModelfv(table, _mesa_marshal_LightModelfv);
   44481    SET_Vertex4dv(table, _mesa_marshal_Vertex4dv);
   44482    SET_GetInfoLogARB(table, _mesa_marshal_GetInfoLogARB);
   44483    SET_StencilMask(table, _mesa_marshal_StencilMask);
   44484    SET_NamedFramebufferReadBuffer(table, _mesa_marshal_NamedFramebufferReadBuffer);
   44485    SET_ProgramUniformHandleui64ARB(table, _mesa_marshal_ProgramUniformHandleui64ARB);
   44486    SET_ProgramUniform2i64ARB(table, _mesa_marshal_ProgramUniform2i64ARB);
   44487    SET_IsList(table, _mesa_marshal_IsList);
   44488    SET_ClearBufferiv(table, _mesa_marshal_ClearBufferiv);
   44489    SET_GetIntegeri_v(table, _mesa_marshal_GetIntegeri_v);
   44490    SET_ProgramUniform2iv(table, _mesa_marshal_ProgramUniform2iv);
   44491    SET_CreateVertexArrays(table, _mesa_marshal_CreateVertexArrays);
   44492    SET_FogCoordPointer(table, _mesa_marshal_FogCoordPointer);
   44493    SET_SecondaryColor3us(table, _mesa_marshal_SecondaryColor3us);
   44494    SET_TextureStorageMem1DEXT(table, _mesa_marshal_TextureStorageMem1DEXT);
   44495    SET_SecondaryColor3ub(table, _mesa_marshal_SecondaryColor3ub);
   44496    SET_NamedBufferStorageMemEXT(table, _mesa_marshal_NamedBufferStorageMemEXT);
   44497    SET_SecondaryColor3ui(table, _mesa_marshal_SecondaryColor3ui);
   44498    SET_ProgramUniform4ui64ARB(table, _mesa_marshal_ProgramUniform4ui64ARB);
   44499    SET_VertexAttrib1sNV(table, _mesa_marshal_VertexAttrib1sNV);
   44500    SET_SignalSemaphoreEXT(table, _mesa_marshal_SignalSemaphoreEXT);
   44501    SET_TextureBuffer(table, _mesa_marshal_TextureBuffer);
   44502    SET_InitNames(table, _mesa_marshal_InitNames);
   44503    SET_Normal3sv(table, _mesa_marshal_Normal3sv);
   44504    SET_DeleteQueries(table, _mesa_marshal_DeleteQueries);
   44505    SET_InvalidateFramebuffer(table, _mesa_marshal_InvalidateFramebuffer);
   44506    SET_Hint(table, _mesa_marshal_Hint);
   44507    SET_MemoryBarrier(table, _mesa_marshal_MemoryBarrier);
   44508    SET_CopyColorSubTable(table, _mesa_marshal_CopyColorSubTable);
   44509    SET_GetObjectParameterfvARB(table, _mesa_marshal_GetObjectParameterfvARB);
   44510    SET_GetTexEnvxv(table, _mesa_marshal_GetTexEnvxv);
   44511    SET_DrawTexsvOES(table, _mesa_marshal_DrawTexsvOES);
   44512    SET_Disable(table, _mesa_marshal_Disable);
   44513    SET_ClearColor(table, _mesa_marshal_ClearColor);
   44514    SET_GetTextureParameterIuiv(table, _mesa_marshal_GetTextureParameterIuiv);
   44515    SET_RasterPos4iv(table, _mesa_marshal_RasterPos4iv);
   44516    SET_VDPAUIsSurfaceNV(table, _mesa_marshal_VDPAUIsSurfaceNV);
   44517    SET_ProgramUniformMatrix2x3fv(table, _mesa_marshal_ProgramUniformMatrix2x3fv);
   44518    SET_BindVertexBuffer(table, _mesa_marshal_BindVertexBuffer);
   44519    SET_RasterPos4i(table, _mesa_marshal_RasterPos4i);
   44520    SET_RasterPos4d(table, _mesa_marshal_RasterPos4d);
   44521    SET_RasterPos4f(table, _mesa_marshal_RasterPos4f);
   44522    SET_VDPAUMapSurfacesNV(table, _mesa_marshal_VDPAUMapSurfacesNV);
   44523    SET_GetQueryIndexediv(table, _mesa_marshal_GetQueryIndexediv);
   44524    SET_RasterPos3dv(table, _mesa_marshal_RasterPos3dv);
   44525    SET_GetProgramiv(table, _mesa_marshal_GetProgramiv);
   44526    SET_TexCoord1iv(table, _mesa_marshal_TexCoord1iv);
   44527    SET_RasterPos4s(table, _mesa_marshal_RasterPos4s);
   44528    SET_VertexAttrib3dv(table, _mesa_marshal_VertexAttrib3dv);
   44529    SET_Histogram(table, _mesa_marshal_Histogram);
   44530    SET_Uniform2fv(table, _mesa_marshal_Uniform2fv);
   44531    SET_ProgramUniformMatrix3x4dv(table, _mesa_marshal_ProgramUniformMatrix3x4dv);
   44532    SET_DrawBuffers(table, _mesa_marshal_DrawBuffers);
   44533    SET_VertexAttribL1ui64ARB(table, _mesa_marshal_VertexAttribL1ui64ARB);
   44534    SET_GetnPolygonStippleARB(table, _mesa_marshal_GetnPolygonStippleARB);
   44535    SET_Color3uiv(table, _mesa_marshal_Color3uiv);
   44536    SET_EvalCoord2fv(table, _mesa_marshal_EvalCoord2fv);
   44537    SET_TextureStorage3DEXT(table, _mesa_marshal_TextureStorage3DEXT);
   44538    SET_VertexAttrib2fARB(table, _mesa_marshal_VertexAttrib2fARB);
   44539    SET_SpecializeShaderARB(table, _mesa_marshal_SpecializeShaderARB);
   44540    SET_BeginPerfMonitorAMD(table, _mesa_marshal_BeginPerfMonitorAMD);
   44541    SET_WindowPos2fv(table, _mesa_marshal_WindowPos2fv);
   44542    SET_TexImage3D(table, _mesa_marshal_TexImage3D);
   44543    SET_GetPerfQueryIdByNameINTEL(table, _mesa_marshal_GetPerfQueryIdByNameINTEL);
   44544    SET_BindFragDataLocation(table, _mesa_marshal_BindFragDataLocation);
   44545    SET_LightModeliv(table, _mesa_marshal_LightModeliv);
   44546    SET_Normal3bv(table, _mesa_marshal_Normal3bv);
   44547    SET_BeginQueryIndexed(table, _mesa_marshal_BeginQueryIndexed);
   44548    SET_ClearNamedBufferData(table, _mesa_marshal_ClearNamedBufferData);
   44549    SET_Vertex3iv(table, _mesa_marshal_Vertex3iv);
   44550    SET_UniformMatrix2x3dv(table, _mesa_marshal_UniformMatrix2x3dv);
   44551    SET_UniformHandleui64vARB(table, _mesa_marshal_UniformHandleui64vARB);
   44552    SET_TexCoord3dv(table, _mesa_marshal_TexCoord3dv);
   44553    SET_GetProgramStringARB(table, _mesa_marshal_GetProgramStringARB);
   44554    SET_VertexP3ui(table, _mesa_marshal_VertexP3ui);
   44555    SET_CreateProgramObjectARB(table, _mesa_marshal_CreateProgramObjectARB);
   44556    SET_UniformMatrix3fv(table, _mesa_marshal_UniformMatrix3fv);
   44557    SET_PrioritizeTextures(table, _mesa_marshal_PrioritizeTextures);
   44558    SET_VertexAttribI3uiEXT(table, _mesa_marshal_VertexAttribI3uiEXT);
   44559    SET_ProgramUniform1i64ARB(table, _mesa_marshal_ProgramUniform1i64ARB);
   44560    SET_GetMaterialxv(table, _mesa_marshal_GetMaterialxv);
   44561    SET_SecondaryColor3uiv(table, _mesa_marshal_SecondaryColor3uiv);
   44562    SET_EndConditionalRender(table, _mesa_marshal_EndConditionalRender);
   44563    SET_ProgramLocalParameter4dARB(table, _mesa_marshal_ProgramLocalParameter4dARB);
   44564    SET_Color3sv(table, _mesa_marshal_Color3sv);
   44565    SET_GenFragmentShadersATI(table, _mesa_marshal_GenFragmentShadersATI);
   44566    SET_GetNamedBufferParameteriv(table, _mesa_marshal_GetNamedBufferParameteriv);
   44567    SET_BlendEquationSeparateiARB(table, _mesa_marshal_BlendEquationSeparateiARB);
   44568    SET_MultiTexCoord1fvARB(table, _mesa_marshal_MultiTexCoord1fvARB);
   44569    SET_TexStorage2D(table, _mesa_marshal_TexStorage2D);
   44570    SET_FramebufferTexture2D(table, _mesa_marshal_FramebufferTexture2D);
   44571    SET_GetSamplerParameterfv(table, _mesa_marshal_GetSamplerParameterfv);
   44572    SET_VertexAttrib2dv(table, _mesa_marshal_VertexAttrib2dv);
   44573    SET_Vertex4sv(table, _mesa_marshal_Vertex4sv);
   44574    SET_GetQueryObjecti64v(table, _mesa_marshal_GetQueryObjecti64v);
   44575    SET_ClampColor(table, _mesa_marshal_ClampColor);
   44576    SET_Uniform1i64ARB(table, _mesa_marshal_Uniform1i64ARB);
   44577    SET_DepthRangeArrayfvOES(table, _mesa_marshal_DepthRangeArrayfvOES);
   44578    SET_ConvolutionFilter1D(table, _mesa_marshal_ConvolutionFilter1D);
   44579    SET_DrawElementsIndirect(table, _mesa_marshal_DrawElementsIndirect);
   44580    SET_WindowPos3sv(table, _mesa_marshal_WindowPos3sv);
   44581    SET_CallLists(table, _mesa_marshal_CallLists);
   44582    SET_AlphaFunc(table, _mesa_marshal_AlphaFunc);
   44583    SET_GetTextureParameterfv(table, _mesa_marshal_GetTextureParameterfv);
   44584    SET_EdgeFlag(table, _mesa_marshal_EdgeFlag);
   44585    SET_EdgeFlagv(table, _mesa_marshal_EdgeFlagv);
   44586    SET_DepthRangex(table, _mesa_marshal_DepthRangex);
   44587    SET_ProgramUniformHandleui64vARB(table, _mesa_marshal_ProgramUniformHandleui64vARB);
   44588    SET_VDPAUInitNV(table, _mesa_marshal_VDPAUInitNV);
   44589    SET_GetBufferParameteri64v(table, _mesa_marshal_GetBufferParameteri64v);
   44590    SET_CreateProgram(table, _mesa_marshal_CreateProgram);
   44591    SET_DepthRangef(table, _mesa_marshal_DepthRangef);
   44592    SET_TextureParameteriv(table, _mesa_marshal_TextureParameteriv);
   44593    SET_ColorFragmentOp3ATI(table, _mesa_marshal_ColorFragmentOp3ATI);
   44594    SET_ValidateProgram(table, _mesa_marshal_ValidateProgram);
   44595    SET_VertexPointerEXT(table, _mesa_marshal_VertexPointerEXT);
   44596    SET_VertexAttribI4sv(table, _mesa_marshal_VertexAttribI4sv);
   44597    SET_Scissor(table, _mesa_marshal_Scissor);
   44598    SET_BeginTransformFeedback(table, _mesa_marshal_BeginTransformFeedback);
   44599    SET_TexCoord2i(table, _mesa_marshal_TexCoord2i);
   44600    SET_VertexArrayAttribBinding(table, _mesa_marshal_VertexArrayAttribBinding);
   44601    SET_Color4ui(table, _mesa_marshal_Color4ui);
   44602    SET_TexCoord2f(table, _mesa_marshal_TexCoord2f);
   44603    SET_TexCoord2d(table, _mesa_marshal_TexCoord2d);
   44604    SET_GetTransformFeedbackiv(table, _mesa_marshal_GetTransformFeedbackiv);
   44605    SET_TexCoord2s(table, _mesa_marshal_TexCoord2s);
   44606    SET_PointSizePointerOES(table, _mesa_marshal_PointSizePointerOES);
   44607    SET_Color4us(table, _mesa_marshal_Color4us);
   44608    SET_Color3bv(table, _mesa_marshal_Color3bv);
   44609    SET_PrimitiveRestartNV(table, _mesa_marshal_PrimitiveRestartNV);
   44610    SET_BindBufferOffsetEXT(table, _mesa_marshal_BindBufferOffsetEXT);
   44611    SET_ProvokingVertex(table, _mesa_marshal_ProvokingVertex);
   44612    SET_VertexAttribs4fvNV(table, _mesa_marshal_VertexAttribs4fvNV);
   44613    SET_Vertex2i(table, _mesa_marshal_Vertex2i);
   44614    SET_GetQueryBufferObjecti64v(table, _mesa_marshal_GetQueryBufferObjecti64v);
   44615    SET_InterleavedArrays(table, _mesa_marshal_InterleavedArrays);
   44616    SET_RasterPos2fv(table, _mesa_marshal_RasterPos2fv);
   44617    SET_TexCoord1fv(table, _mesa_marshal_TexCoord1fv);
   44618    SET_MultiTexCoord4dv(table, _mesa_marshal_MultiTexCoord4dv);
   44619    SET_ProgramEnvParameter4fvARB(table, _mesa_marshal_ProgramEnvParameter4fvARB);
   44620    SET_RasterPos4fv(table, _mesa_marshal_RasterPos4fv);
   44621    SET_PushMatrix(table, _mesa_marshal_PushMatrix);
   44622    SET_EndList(table, _mesa_marshal_EndList);
   44623    SET_DrawRangeElements(table, _mesa_marshal_DrawRangeElements);
   44624    SET_GetTexGenxvOES(table, _mesa_marshal_GetTexGenxvOES);
   44625    SET_GetHandleARB(table, _mesa_marshal_GetHandleARB);
   44626    SET_DrawTexfvOES(table, _mesa_marshal_DrawTexfvOES);
   44627    SET_BlendFunciARB(table, _mesa_marshal_BlendFunciARB);
   44628    SET_ClearNamedFramebufferfi(table, _mesa_marshal_ClearNamedFramebufferfi);
   44629    SET_ClearNamedFramebufferfv(table, _mesa_marshal_ClearNamedFramebufferfv);
   44630    SET_Uniform2ui(table, _mesa_marshal_Uniform2ui);
   44631    SET_ScissorIndexed(table, _mesa_marshal_ScissorIndexed);
   44632    SET_End(table, _mesa_marshal_End);
   44633    SET_NamedFramebufferParameteri(table, _mesa_marshal_NamedFramebufferParameteri);
   44634    SET_BindVertexBuffers(table, _mesa_marshal_BindVertexBuffers);
   44635    SET_GetSamplerParameteriv(table, _mesa_marshal_GetSamplerParameteriv);
   44636    SET_GenProgramPipelines(table, _mesa_marshal_GenProgramPipelines);
   44637    SET_Enable(table, _mesa_marshal_Enable);
   44638    SET_IsProgramPipeline(table, _mesa_marshal_IsProgramPipeline);
   44639    SET_ShaderBinary(table, _mesa_marshal_ShaderBinary);
   44640    SET_TextureSubImage1D(table, _mesa_marshal_TextureSubImage1D);
   44641    SET_Normal3x(table, _mesa_marshal_Normal3x);
   44642    SET_VertexAttrib4fARB(table, _mesa_marshal_VertexAttrib4fARB);
   44643    SET_TexCoord4fv(table, _mesa_marshal_TexCoord4fv);
   44644    SET_ReadnPixelsARB(table, _mesa_marshal_ReadnPixelsARB);
   44645    SET_InvalidateTexSubImage(table, _mesa_marshal_InvalidateTexSubImage);
   44646    SET_Normal3s(table, _mesa_marshal_Normal3s);
   44647    SET_Materialxv(table, _mesa_marshal_Materialxv);
   44648    SET_Normal3i(table, _mesa_marshal_Normal3i);
   44649    SET_Normal3b(table, _mesa_marshal_Normal3b);
   44650    SET_Normal3d(table, _mesa_marshal_Normal3d);
   44651    SET_Normal3f(table, _mesa_marshal_Normal3f);
   44652    SET_Indexi(table, _mesa_marshal_Indexi);
   44653    SET_Uniform1uiv(table, _mesa_marshal_Uniform1uiv);
   44654    SET_VertexAttribI2uiEXT(table, _mesa_marshal_VertexAttribI2uiEXT);
   44655    SET_IsRenderbuffer(table, _mesa_marshal_IsRenderbuffer);
   44656    SET_NormalP3uiv(table, _mesa_marshal_NormalP3uiv);
   44657    SET_Indexf(table, _mesa_marshal_Indexf);
   44658    SET_Indexd(table, _mesa_marshal_Indexd);
   44659    SET_GetMaterialiv(table, _mesa_marshal_GetMaterialiv);
   44660    SET_Indexs(table, _mesa_marshal_Indexs);
   44661    SET_MultiTexCoordP1uiv(table, _mesa_marshal_MultiTexCoordP1uiv);
   44662    SET_ConvolutionFilter2D(table, _mesa_marshal_ConvolutionFilter2D);
   44663    SET_Vertex2d(table, _mesa_marshal_Vertex2d);
   44664    SET_Vertex2f(table, _mesa_marshal_Vertex2f);
   44665    SET_Color4bv(table, _mesa_marshal_Color4bv);
   44666    SET_ProgramUniformMatrix3x2dv(table, _mesa_marshal_ProgramUniformMatrix3x2dv);
   44667    SET_VertexAttrib2fvNV(table, _mesa_marshal_VertexAttrib2fvNV);
   44668    SET_Vertex2s(table, _mesa_marshal_Vertex2s);
   44669    SET_ActiveTexture(table, _mesa_marshal_ActiveTexture);
   44670    SET_InvalidateNamedFramebufferSubData(table, _mesa_marshal_InvalidateNamedFramebufferSubData);
   44671    SET_ColorP4uiv(table, _mesa_marshal_ColorP4uiv);
   44672    SET_DrawTexxOES(table, _mesa_marshal_DrawTexxOES);
   44673    SET_MultiTexCoordP3ui(table, _mesa_marshal_MultiTexCoordP3ui);
   44674    SET_GetAttribLocation(table, _mesa_marshal_GetAttribLocation);
   44675    SET_DrawBuffer(table, _mesa_marshal_DrawBuffer);
   44676    SET_GetPointerv(table, _mesa_marshal_GetPointerv);
   44677    SET_MultiTexCoord2dv(table, _mesa_marshal_MultiTexCoord2dv);
   44678    SET_IsSampler(table, _mesa_marshal_IsSampler);
   44679    SET_BlendFunc(table, _mesa_marshal_BlendFunc);
   44680    SET_NamedRenderbufferStorageMultisample(table, _mesa_marshal_NamedRenderbufferStorageMultisample);
   44681    SET_ColorMaterial(table, _mesa_marshal_ColorMaterial);
   44682    SET_RasterPos3sv(table, _mesa_marshal_RasterPos3sv);
   44683    SET_TexCoordP2ui(table, _mesa_marshal_TexCoordP2ui);
   44684    SET_TexParameteriv(table, _mesa_marshal_TexParameteriv);
   44685    SET_WaitSemaphoreEXT(table, _mesa_marshal_WaitSemaphoreEXT);
   44686    SET_VertexAttrib3fvARB(table, _mesa_marshal_VertexAttrib3fvARB);
   44687    SET_ProgramUniformMatrix3x4fv(table, _mesa_marshal_ProgramUniformMatrix3x4fv);
   44688    SET_GetColorTable(table, _mesa_marshal_GetColorTable);
   44689    SET_TexCoord3i(table, _mesa_marshal_TexCoord3i);
   44690    SET_CopyColorTable(table, _mesa_marshal_CopyColorTable);
   44691    SET_Frustum(table, _mesa_marshal_Frustum);
   44692    SET_TexCoord3d(table, _mesa_marshal_TexCoord3d);
   44693    SET_GetTextureParameteriv(table, _mesa_marshal_GetTextureParameteriv);
   44694    SET_TexCoord3f(table, _mesa_marshal_TexCoord3f);
   44695    SET_DepthRangeArrayv(table, _mesa_marshal_DepthRangeArrayv);
   44696    SET_DeleteTextures(table, _mesa_marshal_DeleteTextures);
   44697    SET_TexCoordPointerEXT(table, _mesa_marshal_TexCoordPointerEXT);
   44698    SET_TexCoord3s(table, _mesa_marshal_TexCoord3s);
   44699    SET_GetTexLevelParameteriv(table, _mesa_marshal_GetTexLevelParameteriv);
   44700    SET_TextureParameterIuiv(table, _mesa_marshal_TextureParameterIuiv);
   44701    SET_GenPerfMonitorsAMD(table, _mesa_marshal_GenPerfMonitorsAMD);
   44702    SET_ClearAccum(table, _mesa_marshal_ClearAccum);
   44703    SET_TexCoord4iv(table, _mesa_marshal_TexCoord4iv);
   44704    SET_TexStorage3D(table, _mesa_marshal_TexStorage3D);
   44705    SET_Uniform2i64ARB(table, _mesa_marshal_Uniform2i64ARB);
   44706    SET_FramebufferTexture3D(table, _mesa_marshal_FramebufferTexture3D);
   44707    SET_GetBufferParameteriv(table, _mesa_marshal_GetBufferParameteriv);
   44708    SET_VertexAttrib2fNV(table, _mesa_marshal_VertexAttrib2fNV);
   44709    SET_CopyTexImage2D(table, _mesa_marshal_CopyTexImage2D);
   44710    SET_Vertex3fv(table, _mesa_marshal_Vertex3fv);
   44711    SET_WindowPos4dvMESA(table, _mesa_marshal_WindowPos4dvMESA);
   44712    SET_ProgramUniform2i64vARB(table, _mesa_marshal_ProgramUniform2i64vARB);
   44713    SET_MultiTexCoordP2ui(table, _mesa_marshal_MultiTexCoordP2ui);
   44714    SET_VertexAttribs1dvNV(table, _mesa_marshal_VertexAttribs1dvNV);
   44715    SET_ImportSemaphoreFdEXT(table, _mesa_marshal_ImportSemaphoreFdEXT);
   44716    SET_IsQuery(table, _mesa_marshal_IsQuery);
   44717    SET_EdgeFlagPointerEXT(table, _mesa_marshal_EdgeFlagPointerEXT);
   44718    SET_VertexAttribs2svNV(table, _mesa_marshal_VertexAttribs2svNV);
   44719    SET_CreateShaderProgramv(table, _mesa_marshal_CreateShaderProgramv);
   44720    SET_BlendEquationiARB(table, _mesa_marshal_BlendEquationiARB);
   44721    SET_VertexAttribI4uivEXT(table, _mesa_marshal_VertexAttribI4uivEXT);
   44722    SET_PointSizex(table, _mesa_marshal_PointSizex);
   44723    SET_PolygonMode(table, _mesa_marshal_PolygonMode);
   44724    SET_SecondaryColor3iv(table, _mesa_marshal_SecondaryColor3iv);
   44725    SET_VertexAttribI1iEXT(table, _mesa_marshal_VertexAttribI1iEXT);
   44726    SET_VertexAttrib4Niv(table, _mesa_marshal_VertexAttrib4Niv);
   44727    SET_GetnUniformdvARB(table, _mesa_marshal_GetnUniformdvARB);
   44728    SET_LinkProgram(table, _mesa_marshal_LinkProgram);
   44729    SET_ProgramUniform4d(table, _mesa_marshal_ProgramUniform4d);
   44730    SET_ProgramUniform4f(table, _mesa_marshal_ProgramUniform4f);
   44731    SET_ProgramUniform4i(table, _mesa_marshal_ProgramUniform4i);
   44732    SET_GetFramebufferParameteriv(table, _mesa_marshal_GetFramebufferParameteriv);
   44733    SET_GetNamedBufferPointerv(table, _mesa_marshal_GetNamedBufferPointerv);
   44734    SET_VertexAttrib4d(table, _mesa_marshal_VertexAttrib4d);
   44735    SET_ProgramUniform4ui64vARB(table, _mesa_marshal_ProgramUniform4ui64vARB);
   44736    SET_WindowPos4sMESA(table, _mesa_marshal_WindowPos4sMESA);
   44737    SET_VertexAttrib4s(table, _mesa_marshal_VertexAttrib4s);
   44738    SET_ProgramUniform1i64vARB(table, _mesa_marshal_ProgramUniform1i64vARB);
   44739    SET_VertexAttrib1dvNV(table, _mesa_marshal_VertexAttrib1dvNV);
   44740    SET_GetSemaphoreParameterui64vEXT(table, _mesa_marshal_GetSemaphoreParameterui64vEXT);
   44741    SET_TexStorage3DMultisample(table, _mesa_marshal_TexStorage3DMultisample);
   44742    SET_SamplerParameteriv(table, _mesa_marshal_SamplerParameteriv);
   44743    SET_VertexAttribP3uiv(table, _mesa_marshal_VertexAttribP3uiv);
   44744    SET_ScissorIndexedv(table, _mesa_marshal_ScissorIndexedv);
   44745    SET_GetStringi(table, _mesa_marshal_GetStringi);
   44746    SET_Uniform2dv(table, _mesa_marshal_Uniform2dv);
   44747    SET_VertexAttrib4dv(table, _mesa_marshal_VertexAttrib4dv);
   44748    SET_CreateTextures(table, _mesa_marshal_CreateTextures);
   44749    SET_EvalCoord2dv(table, _mesa_marshal_EvalCoord2dv);
   44750    SET_VertexAttrib1fNV(table, _mesa_marshal_VertexAttrib1fNV);
   44751    SET_CompressedTexSubImage1D(table, _mesa_marshal_CompressedTexSubImage1D);
   44752    SET_GetSeparableFilter(table, _mesa_marshal_GetSeparableFilter);
   44753    SET_FeedbackBuffer(table, _mesa_marshal_FeedbackBuffer);
   44754    SET_RasterPos2iv(table, _mesa_marshal_RasterPos2iv);
   44755    SET_TexImage1D(table, _mesa_marshal_TexImage1D);
   44756    SET_MultiDrawElementsEXT(table, _mesa_marshal_MultiDrawElementsEXT);
   44757    SET_GetnSeparableFilterARB(table, _mesa_marshal_GetnSeparableFilterARB);
   44758    SET_FrontFace(table, _mesa_marshal_FrontFace);
   44759    SET_MultiModeDrawArraysIBM(table, _mesa_marshal_MultiModeDrawArraysIBM);
   44760    SET_Normal3dv(table, _mesa_marshal_Normal3dv);
   44761    SET_Lightf(table, _mesa_marshal_Lightf);
   44762    SET_MatrixMode(table, _mesa_marshal_MatrixMode);
   44763    SET_GetPixelMapusv(table, _mesa_marshal_GetPixelMapusv);
   44764    SET_Lighti(table, _mesa_marshal_Lighti);
   44765    SET_GetFragDataIndex(table, _mesa_marshal_GetFragDataIndex);
   44766    SET_Lightx(table, _mesa_marshal_Lightx);
   44767    SET_ProgramUniform3fv(table, _mesa_marshal_ProgramUniform3fv);
   44768    SET_MultMatrixd(table, _mesa_marshal_MultMatrixd);
   44769    SET_MultMatrixf(table, _mesa_marshal_MultMatrixf);
   44770    SET_Uniform4ui64vARB(table, _mesa_marshal_Uniform4ui64vARB);
   44771    SET_MultiTexCoord4fvARB(table, _mesa_marshal_MultiTexCoord4fvARB);
   44772    SET_UniformMatrix2x3fv(table, _mesa_marshal_UniformMatrix2x3fv);
   44773    SET_SamplerParameterf(table, _mesa_marshal_SamplerParameterf);
   44774    SET_UniformMatrix3dv(table, _mesa_marshal_UniformMatrix3dv);
   44775    SET_PointParameterx(table, _mesa_marshal_PointParameterx);
   44776    SET_DrawArrays(table, _mesa_marshal_DrawArrays);
   44777    SET_Uniform3dv(table, _mesa_marshal_Uniform3dv);
   44778    SET_PointParameteri(table, _mesa_marshal_PointParameteri);
   44779    SET_PointParameterf(table, _mesa_marshal_PointParameterf);
   44780    SET_VertexAttribBinding(table, _mesa_marshal_VertexAttribBinding);
   44781    SET_TextureSubImage2D(table, _mesa_marshal_TextureSubImage2D);
   44782    SET_CreateShader(table, _mesa_marshal_CreateShader);
   44783    SET_ProgramUniform1dv(table, _mesa_marshal_ProgramUniform1dv);
   44784    SET_GetProgramEnvParameterfvARB(table, _mesa_marshal_GetProgramEnvParameterfvARB);
   44785    SET_DeleteBuffers(table, _mesa_marshal_DeleteBuffers);
   44786    SET_GetBufferSubData(table, _mesa_marshal_GetBufferSubData);
   44787    SET_GetNamedRenderbufferParameteriv(table, _mesa_marshal_GetNamedRenderbufferParameteriv);
   44788    SET_GetPerfMonitorGroupsAMD(table, _mesa_marshal_GetPerfMonitorGroupsAMD);
   44789    SET_VertexAttribP2ui(table, _mesa_marshal_VertexAttribP2ui);
   44790    SET_ProgramUniform4dv(table, _mesa_marshal_ProgramUniform4dv);
   44791    SET_GetMinmaxParameteriv(table, _mesa_marshal_GetMinmaxParameteriv);
   44792    SET_DrawTexivOES(table, _mesa_marshal_DrawTexivOES);
   44793    SET_CopyTexImage1D(table, _mesa_marshal_CopyTexImage1D);
   44794    SET_InvalidateNamedFramebufferData(table, _mesa_marshal_InvalidateNamedFramebufferData);
   44795    SET_SemaphoreParameterui64vEXT(table, _mesa_marshal_SemaphoreParameterui64vEXT);
   44796    SET_GetnColorTableARB(table, _mesa_marshal_GetnColorTableARB);
   44797    SET_VertexAttribFormat(table, _mesa_marshal_VertexAttribFormat);
   44798    SET_Vertex3i(table, _mesa_marshal_Vertex3i);
   44799    SET_Vertex3f(table, _mesa_marshal_Vertex3f);
   44800    SET_Vertex3d(table, _mesa_marshal_Vertex3d);
   44801    SET_GetProgramPipelineiv(table, _mesa_marshal_GetProgramPipelineiv);
   44802    SET_ReadBuffer(table, _mesa_marshal_ReadBuffer);
   44803    SET_ConvolutionParameteri(table, _mesa_marshal_ConvolutionParameteri);
   44804    SET_GetTexParameterIiv(table, _mesa_marshal_GetTexParameterIiv);
   44805    SET_Vertex3s(table, _mesa_marshal_Vertex3s);
   44806    SET_ConvolutionParameterf(table, _mesa_marshal_ConvolutionParameterf);
   44807    SET_GetColorTableParameteriv(table, _mesa_marshal_GetColorTableParameteriv);
   44808    SET_GetTransformFeedbackVarying(table, _mesa_marshal_GetTransformFeedbackVarying);
   44809    SET_GetNextPerfQueryIdINTEL(table, _mesa_marshal_GetNextPerfQueryIdINTEL);
   44810    SET_TexCoord3fv(table, _mesa_marshal_TexCoord3fv);
   44811    SET_TextureBarrierNV(table, _mesa_marshal_TextureBarrierNV);
   44812    SET_GetProgramInterfaceiv(table, _mesa_marshal_GetProgramInterfaceiv);
   44813    SET_VertexAttribL1ui64vARB(table, _mesa_marshal_VertexAttribL1ui64vARB);
   44814    SET_ProgramLocalParameter4fARB(table, _mesa_marshal_ProgramLocalParameter4fARB);
   44815    SET_PauseTransformFeedback(table, _mesa_marshal_PauseTransformFeedback);
   44816    SET_DeleteShader(table, _mesa_marshal_DeleteShader);
   44817    SET_NamedFramebufferRenderbuffer(table, _mesa_marshal_NamedFramebufferRenderbuffer);
   44818    SET_CompileShader(table, _mesa_marshal_CompileShader);
   44819    SET_Vertex2iv(table, _mesa_marshal_Vertex2iv);
   44820    SET_GetVertexArrayIndexediv(table, _mesa_marshal_GetVertexArrayIndexediv);
   44821    SET_TexParameterIiv(table, _mesa_marshal_TexParameterIiv);
   44822    SET_TexGendv(table, _mesa_marshal_TexGendv);
   44823    SET_ResetMinmax(table, _mesa_marshal_ResetMinmax);
   44824    SET_SampleCoverage(table, _mesa_marshal_SampleCoverage);
   44825    SET_GenerateTextureMipmap(table, _mesa_marshal_GenerateTextureMipmap);
   44826    SET_DeleteProgramsARB(table, _mesa_marshal_DeleteProgramsARB);
   44827    SET_ShadeModel(table, _mesa_marshal_ShadeModel);
   44828    SET_CreateQueries(table, _mesa_marshal_CreateQueries);
   44829    SET_MultiDrawArrays(table, _mesa_marshal_MultiDrawArrays);
   44830    SET_GetProgramLocalParameterdvARB(table, _mesa_marshal_GetProgramLocalParameterdvARB);
   44831    SET_MapBufferRange(table, _mesa_marshal_MapBufferRange);
   44832    SET_DispatchCompute(table, _mesa_marshal_DispatchCompute);
   44833    SET_UseProgramStages(table, _mesa_marshal_UseProgramStages);
   44834    SET_ProgramUniformMatrix4fv(table, _mesa_marshal_ProgramUniformMatrix4fv);
   44835    SET_FramebufferRenderbuffer(table, _mesa_marshal_FramebufferRenderbuffer);
   44836    SET_IsProgramARB(table, _mesa_marshal_IsProgramARB);
   44837    SET_Map2d(table, _mesa_marshal_Map2d);
   44838    SET_Map2f(table, _mesa_marshal_Map2f);
   44839    SET_ProgramStringARB(table, _mesa_marshal_ProgramStringARB);
   44840    SET_CopyTextureSubImage2D(table, _mesa_marshal_CopyTextureSubImage2D);
   44841    SET_MultiTexCoord4s(table, _mesa_marshal_MultiTexCoord4s);
   44842    SET_ViewportIndexedf(table, _mesa_marshal_ViewportIndexedf);
   44843    SET_MultiTexCoord4i(table, _mesa_marshal_MultiTexCoord4i);
   44844    SET_DebugMessageControl(table, _mesa_marshal_DebugMessageControl);
   44845    SET_MultiTexCoord4d(table, _mesa_marshal_MultiTexCoord4d);
   44846    SET_GetHistogram(table, _mesa_marshal_GetHistogram);
   44847    SET_Translatex(table, _mesa_marshal_Translatex);
   44848    SET_MultiDrawElementsIndirectCountARB(table, _mesa_marshal_MultiDrawElementsIndirectCountARB);
   44849    SET_Indexsv(table, _mesa_marshal_Indexsv);
   44850    SET_VertexAttrib1fvARB(table, _mesa_marshal_VertexAttrib1fvARB);
   44851    SET_TexCoord2dv(table, _mesa_marshal_TexCoord2dv);
   44852    SET_Translated(table, _mesa_marshal_Translated);
   44853    SET_Translatef(table, _mesa_marshal_Translatef);
   44854    SET_MultTransposeMatrixd(table, _mesa_marshal_MultTransposeMatrixd);
   44855    SET_ProgramUniform4uiv(table, _mesa_marshal_ProgramUniform4uiv);
   44856    SET_GetPerfCounterInfoINTEL(table, _mesa_marshal_GetPerfCounterInfoINTEL);
   44857    SET_RenderMode(table, _mesa_marshal_RenderMode);
   44858    SET_MultiTexCoord1fARB(table, _mesa_marshal_MultiTexCoord1fARB);
   44859    SET_SecondaryColor3d(table, _mesa_marshal_SecondaryColor3d);
   44860    SET_FramebufferParameteri(table, _mesa_marshal_FramebufferParameteri);
   44861    SET_VertexAttribs4ubvNV(table, _mesa_marshal_VertexAttribs4ubvNV);
   44862    SET_LightModelxv(table, _mesa_marshal_LightModelxv);
   44863    SET_CopyTexSubImage1D(table, _mesa_marshal_CopyTexSubImage1D);
   44864    SET_TextureSubImage3D(table, _mesa_marshal_TextureSubImage3D);
   44865    SET_StencilFunc(table, _mesa_marshal_StencilFunc);
   44866    SET_CopyPixels(table, _mesa_marshal_CopyPixels);
   44867    SET_TexGenxvOES(table, _mesa_marshal_TexGenxvOES);
   44868    SET_GetTextureLevelParameterfv(table, _mesa_marshal_GetTextureLevelParameterfv);
   44869    SET_VertexAttrib4Nubv(table, _mesa_marshal_VertexAttrib4Nubv);
   44870    SET_UniformMatrix4x2dv(table, _mesa_marshal_UniformMatrix4x2dv);
   44871    SET_VertexAttribPointer(table, _mesa_marshal_VertexAttribPointer);
   44872    SET_IndexMask(table, _mesa_marshal_IndexMask);
   44873    SET_VertexAttribIFormat(table, _mesa_marshal_VertexAttribIFormat);
   44874    SET_DrawArraysInstancedBaseInstance(table, _mesa_marshal_DrawArraysInstancedBaseInstance);
   44875    SET_TextureStorageMem3DMultisampleEXT(table, _mesa_marshal_TextureStorageMem3DMultisampleEXT);
   44876    SET_CompressedTextureSubImage3D(table, _mesa_marshal_CompressedTextureSubImage3D);
   44877    SET_PopAttrib(table, _mesa_marshal_PopAttrib);
   44878    SET_Uniform3ui(table, _mesa_marshal_Uniform3ui);
   44879    SET_DeletePerfMonitorsAMD(table, _mesa_marshal_DeletePerfMonitorsAMD);
   44880    SET_Color4dv(table, _mesa_marshal_Color4dv);
   44881    SET_DisableVertexAttribArray(table, _mesa_marshal_DisableVertexAttribArray);
   44882    SET_ProgramUniformMatrix3x2fv(table, _mesa_marshal_ProgramUniformMatrix3x2fv);
   44883    SET_GetDoublei_v(table, _mesa_marshal_GetDoublei_v);
   44884    SET_IsTransformFeedback(table, _mesa_marshal_IsTransformFeedback);
   44885    SET_GetMemoryObjectParameterivEXT(table, _mesa_marshal_GetMemoryObjectParameterivEXT);
   44886    SET_ClipPlanex(table, _mesa_marshal_ClipPlanex);
   44887    SET_GetLightfv(table, _mesa_marshal_GetLightfv);
   44888    SET_ClipPlanef(table, _mesa_marshal_ClipPlanef);
   44889    SET_ProgramUniform1ui(table, _mesa_marshal_ProgramUniform1ui);
   44890    SET_SecondaryColorPointer(table, _mesa_marshal_SecondaryColorPointer);
   44891    SET_LineStipple(table, _mesa_marshal_LineStipple);
   44892    SET_BeginFragmentShaderATI(table, _mesa_marshal_BeginFragmentShaderATI);
   44893    SET_GenRenderbuffers(table, _mesa_marshal_GenRenderbuffers);
   44894    SET_GetMinmaxParameterfv(table, _mesa_marshal_GetMinmaxParameterfv);
   44895    SET_TextureStorageMem2DEXT(table, _mesa_marshal_TextureStorageMem2DEXT);
   44896    SET_IsEnabledi(table, _mesa_marshal_IsEnabledi);
   44897    SET_WaitSync(table, _mesa_marshal_WaitSync);
   44898    SET_GetVertexAttribPointerv(table, _mesa_marshal_GetVertexAttribPointerv);
   44899    SET_Uniform1i64vARB(table, _mesa_marshal_Uniform1i64vARB);
   44900    SET_CreatePerfQueryINTEL(table, _mesa_marshal_CreatePerfQueryINTEL);
   44901    SET_NewList(table, _mesa_marshal_NewList);
   44902    SET_TexBuffer(table, _mesa_marshal_TexBuffer);
   44903    SET_TexCoord4sv(table, _mesa_marshal_TexCoord4sv);
   44904    SET_TexCoord1f(table, _mesa_marshal_TexCoord1f);
   44905    SET_TexCoord1d(table, _mesa_marshal_TexCoord1d);
   44906    SET_TexCoord1i(table, _mesa_marshal_TexCoord1i);
   44907    SET_GetnUniformfvARB(table, _mesa_marshal_GetnUniformfvARB);
   44908    SET_TexCoord1s(table, _mesa_marshal_TexCoord1s);
   44909    SET_Uniform1ui(table, _mesa_marshal_Uniform1ui);
   44910    SET_TexStorage1D(table, _mesa_marshal_TexStorage1D);
   44911    SET_BlitFramebuffer(table, _mesa_marshal_BlitFramebuffer);
   44912    SET_TextureParameterf(table, _mesa_marshal_TextureParameterf);
   44913    SET_FramebufferTexture1D(table, _mesa_marshal_FramebufferTexture1D);
   44914    SET_TextureParameteri(table, _mesa_marshal_TextureParameteri);
   44915    SET_GetMapiv(table, _mesa_marshal_GetMapiv);
   44916    SET_GetUniformui64vARB(table, _mesa_marshal_GetUniformui64vARB);
   44917    SET_TexCoordP4ui(table, _mesa_marshal_TexCoordP4ui);
   44918    SET_VertexAttrib1sv(table, _mesa_marshal_VertexAttrib1sv);
   44919    SET_WindowPos4dMESA(table, _mesa_marshal_WindowPos4dMESA);
   44920    SET_Vertex3dv(table, _mesa_marshal_Vertex3dv);
   44921    SET_VertexAttribL2d(table, _mesa_marshal_VertexAttribL2d);
   44922    SET_GetnMapivARB(table, _mesa_marshal_GetnMapivARB);
   44923    SET_GetVertexAttribfv(table, _mesa_marshal_GetVertexAttribfv);
   44924    SET_MultiTexCoordP4uiv(table, _mesa_marshal_MultiTexCoordP4uiv);
   44925    SET_TexGeniv(table, _mesa_marshal_TexGeniv);
   44926    SET_IsMemoryObjectEXT(table, _mesa_marshal_IsMemoryObjectEXT);
   44927    SET_BlendColor(table, _mesa_marshal_BlendColor);
   44928    SET_VertexAttribs2dvNV(table, _mesa_marshal_VertexAttribs2dvNV);
   44929    SET_VertexAttrib2dvNV(table, _mesa_marshal_VertexAttrib2dvNV);
   44930    SET_NamedFramebufferDrawBuffers(table, _mesa_marshal_NamedFramebufferDrawBuffers);
   44931    SET_ResetHistogram(table, _mesa_marshal_ResetHistogram);
   44932    SET_CompressedTexSubImage2D(table, _mesa_marshal_CompressedTexSubImage2D);
   44933    SET_TexCoord2sv(table, _mesa_marshal_TexCoord2sv);
   44934    SET_StencilMaskSeparate(table, _mesa_marshal_StencilMaskSeparate);
   44935    SET_MultiTexCoord3sv(table, _mesa_marshal_MultiTexCoord3sv);
   44936    SET_TexCoord3iv(table, _mesa_marshal_TexCoord3iv);
   44937    SET_MultiTexCoord4sv(table, _mesa_marshal_MultiTexCoord4sv);
   44938    SET_VertexBindingDivisor(table, _mesa_marshal_VertexBindingDivisor);
   44939    SET_PrimitiveBoundingBox(table, _mesa_marshal_PrimitiveBoundingBox);
   44940    SET_GetPerfMonitorCounterInfoAMD(table, _mesa_marshal_GetPerfMonitorCounterInfoAMD);
   44941    SET_UniformBlockBinding(table, _mesa_marshal_UniformBlockBinding);
   44942    SET_FenceSync(table, _mesa_marshal_FenceSync);
   44943    SET_CompressedTextureSubImage2D(table, _mesa_marshal_CompressedTextureSubImage2D);
   44944    SET_VertexAttrib4Nusv(table, _mesa_marshal_VertexAttrib4Nusv);
   44945    SET_SetFragmentShaderConstantATI(table, _mesa_marshal_SetFragmentShaderConstantATI);
   44946    SET_VertexP2ui(table, _mesa_marshal_VertexP2ui);
   44947    SET_ProgramUniform2fv(table, _mesa_marshal_ProgramUniform2fv);
   44948    SET_GetTextureLevelParameteriv(table, _mesa_marshal_GetTextureLevelParameteriv);
   44949    SET_GetTexEnvfv(table, _mesa_marshal_GetTexEnvfv);
   44950    SET_BindAttribLocation(table, _mesa_marshal_BindAttribLocation);
   44951    SET_TextureStorage2DEXT(table, _mesa_marshal_TextureStorage2DEXT);
   44952    SET_TextureParameterIiv(table, _mesa_marshal_TextureParameterIiv);
   44953    SET_DrawTransformFeedbackInstanced(table, _mesa_marshal_DrawTransformFeedbackInstanced);
   44954    SET_CopyTextureSubImage1D(table, _mesa_marshal_CopyTextureSubImage1D);
   44955    SET_ResumeTransformFeedback(table, _mesa_marshal_ResumeTransformFeedback);
   44956    SET_VertexAttribI1iv(table, _mesa_marshal_VertexAttribI1iv);
   44957    SET_Vertex2dv(table, _mesa_marshal_Vertex2dv);
   44958    SET_VertexAttribI2uivEXT(table, _mesa_marshal_VertexAttribI2uivEXT);
   44959    SET_SampleMaski(table, _mesa_marshal_SampleMaski);
   44960    SET_GetFloati_v(table, _mesa_marshal_GetFloati_v);
   44961    SET_MultiTexCoord2iv(table, _mesa_marshal_MultiTexCoord2iv);
   44962    SET_DrawPixels(table, _mesa_marshal_DrawPixels);
   44963    SET_CreateFramebuffers(table, _mesa_marshal_CreateFramebuffers);
   44964    SET_DrawTransformFeedback(table, _mesa_marshal_DrawTransformFeedback);
   44965    SET_VertexAttribs3fvNV(table, _mesa_marshal_VertexAttribs3fvNV);
   44966    SET_GenLists(table, _mesa_marshal_GenLists);
   44967    SET_ProgramUniform2ui64vARB(table, _mesa_marshal_ProgramUniform2ui64vARB);
   44968    SET_MapGrid2d(table, _mesa_marshal_MapGrid2d);
   44969    SET_MapGrid2f(table, _mesa_marshal_MapGrid2f);
   44970    SET_SampleMapATI(table, _mesa_marshal_SampleMapATI);
   44971    SET_GetActiveAttrib(table, _mesa_marshal_GetActiveAttrib);
   44972    SET_PixelMapfv(table, _mesa_marshal_PixelMapfv);
   44973    SET_ClearBufferData(table, _mesa_marshal_ClearBufferData);
   44974    SET_Color3usv(table, _mesa_marshal_Color3usv);
   44975    SET_CopyImageSubData(table, _mesa_marshal_CopyImageSubData);
   44976    SET_StencilOpSeparate(table, _mesa_marshal_StencilOpSeparate);
   44977    SET_GenSamplers(table, _mesa_marshal_GenSamplers);
   44978    SET_ClipControl(table, _mesa_marshal_ClipControl);
   44979    SET_DrawTexfOES(table, _mesa_marshal_DrawTexfOES);
   44980    SET_Uniform4i64vARB(table, _mesa_marshal_Uniform4i64vARB);
   44981    SET_AttachObjectARB(table, _mesa_marshal_AttachObjectARB);
   44982    SET_Accum(table, _mesa_marshal_Accum);
   44983    SET_GetTexImage(table, _mesa_marshal_GetTexImage);
   44984    SET_Color4x(table, _mesa_marshal_Color4x);
   44985    SET_ConvolutionParameteriv(table, _mesa_marshal_ConvolutionParameteriv);
   44986    SET_Color4s(table, _mesa_marshal_Color4s);
   44987    SET_EnableVertexAttribArray(table, _mesa_marshal_EnableVertexAttribArray);
   44988    SET_Color4i(table, _mesa_marshal_Color4i);
   44989    SET_Color4f(table, _mesa_marshal_Color4f);
   44990    SET_ShaderStorageBlockBinding(table, _mesa_marshal_ShaderStorageBlockBinding);
   44991    SET_Color4d(table, _mesa_marshal_Color4d);
   44992    SET_Color4b(table, _mesa_marshal_Color4b);
   44993    SET_MemoryObjectParameterivEXT(table, _mesa_marshal_MemoryObjectParameterivEXT);
   44994    SET_GetAttachedObjectsARB(table, _mesa_marshal_GetAttachedObjectsARB);
   44995    SET_EvalCoord1fv(table, _mesa_marshal_EvalCoord1fv);
   44996    SET_VertexAttribLFormat(table, _mesa_marshal_VertexAttribLFormat);
   44997    SET_VertexAttribL3d(table, _mesa_marshal_VertexAttribL3d);
   44998    SET_ClearNamedFramebufferuiv(table, _mesa_marshal_ClearNamedFramebufferuiv);
   44999    SET_StencilFuncSeparate(table, _mesa_marshal_StencilFuncSeparate);
   45000    SET_ShaderSource(table, _mesa_marshal_ShaderSource);
   45001    SET_Normal3fv(table, _mesa_marshal_Normal3fv);
   45002    SET_NormalP3ui(table, _mesa_marshal_NormalP3ui);
   45003    SET_CreateSamplers(table, _mesa_marshal_CreateSamplers);
   45004    SET_MultiTexCoord3fvARB(table, _mesa_marshal_MultiTexCoord3fvARB);
   45005    SET_BufferData(table, _mesa_marshal_BufferData);
   45006    SET_TexSubImage2D(table, _mesa_marshal_TexSubImage2D);
   45007    SET_TexGenfv(table, _mesa_marshal_TexGenfv);
   45008    SET_GetVertexAttribiv(table, _mesa_marshal_GetVertexAttribiv);
   45009    SET_TexCoordP2uiv(table, _mesa_marshal_TexCoordP2uiv);
   45010    SET_Uniform3fv(table, _mesa_marshal_Uniform3fv);
   45011    SET_BlendEquation(table, _mesa_marshal_BlendEquation);
   45012    SET_VertexAttrib3dNV(table, _mesa_marshal_VertexAttrib3dNV);
   45013    SET_PushName(table, _mesa_marshal_PushName);
   45014    SET_DeleteRenderbuffers(table, _mesa_marshal_DeleteRenderbuffers);
   45015    SET_VertexAttrib1dv(table, _mesa_marshal_VertexAttrib1dv);
   45016    SET_IsShader(table, _mesa_marshal_IsShader);
   45017    SET_Rotated(table, _mesa_marshal_Rotated);
   45018    SET_Color4iv(table, _mesa_marshal_Color4iv);
   45019    SET_PointParameterxv(table, _mesa_marshal_PointParameterxv);
   45020    SET_Rotatex(table, _mesa_marshal_Rotatex);
   45021    SET_FramebufferTextureLayer(table, _mesa_marshal_FramebufferTextureLayer);
   45022    SET_TexEnvfv(table, _mesa_marshal_TexEnvfv);
   45023    SET_ProgramUniformMatrix3fv(table, _mesa_marshal_ProgramUniformMatrix3fv);
   45024    SET_DeleteMemoryObjectsEXT(table, _mesa_marshal_DeleteMemoryObjectsEXT);
   45025    SET_LoadMatrixf(table, _mesa_marshal_LoadMatrixf);
   45026    SET_GetProgramLocalParameterfvARB(table, _mesa_marshal_GetProgramLocalParameterfvARB);
   45027    SET_MakeTextureHandleResidentARB(table, _mesa_marshal_MakeTextureHandleResidentARB);
   45028    SET_MultiDrawArraysIndirect(table, _mesa_marshal_MultiDrawArraysIndirect);
   45029    SET_DrawRangeElementsBaseVertex(table, _mesa_marshal_DrawRangeElementsBaseVertex);
   45030    SET_ProgramUniformMatrix4dv(table, _mesa_marshal_ProgramUniformMatrix4dv);
   45031    SET_SecondaryColor3bv(table, _mesa_marshal_SecondaryColor3bv);
   45032    SET_DrawTexxvOES(table, _mesa_marshal_DrawTexxvOES);
   45033    SET_TexParameterfv(table, _mesa_marshal_TexParameterfv);
   45034    SET_Color4ubv(table, _mesa_marshal_Color4ubv);
   45035    SET_TexCoord2fv(table, _mesa_marshal_TexCoord2fv);
   45036    SET_FogCoorddv(table, _mesa_marshal_FogCoorddv);
   45037    SET_VDPAUUnregisterSurfaceNV(table, _mesa_marshal_VDPAUUnregisterSurfaceNV);
   45038    SET_ColorP3ui(table, _mesa_marshal_ColorP3ui);
   45039    SET_ClearBufferuiv(table, _mesa_marshal_ClearBufferuiv);
   45040    SET_GetUnsignedBytei_vEXT(table, _mesa_marshal_GetUnsignedBytei_vEXT);
   45041    SET_GetShaderPrecisionFormat(table, _mesa_marshal_GetShaderPrecisionFormat);
   45042    SET_Flush(table, _mesa_marshal_Flush);
   45043    SET_MakeTextureHandleNonResidentARB(table, _mesa_marshal_MakeTextureHandleNonResidentARB);
   45044    SET_VertexAttribI4iEXT(table, _mesa_marshal_VertexAttribI4iEXT);
   45045    SET_VertexAttribI3uivEXT(table, _mesa_marshal_VertexAttribI3uivEXT);
   45046    SET_FogCoordd(table, _mesa_marshal_FogCoordd);
   45047    SET_BindFramebufferEXT(table, _mesa_marshal_BindFramebufferEXT);
   45048    SET_Uniform3iv(table, _mesa_marshal_Uniform3iv);
   45049    SET_TexStorage2DMultisample(table, _mesa_marshal_TexStorage2DMultisample);
   45050    SET_UnlockArraysEXT(table, _mesa_marshal_UnlockArraysEXT);
   45051    SET_GetVertexAttribLui64vARB(table, _mesa_marshal_GetVertexAttribLui64vARB);
   45052    SET_VertexAttrib4iv(table, _mesa_marshal_VertexAttrib4iv);
   45053    SET_CopyTexSubImage3D(table, _mesa_marshal_CopyTexSubImage3D);
   45054    SET_PolygonOffsetClampEXT(table, _mesa_marshal_PolygonOffsetClampEXT);
   45055    SET_GetInteger64v(table, _mesa_marshal_GetInteger64v);
   45056    SET_DetachObjectARB(table, _mesa_marshal_DetachObjectARB);
   45057    SET_Indexiv(table, _mesa_marshal_Indexiv);
   45058    SET_TexEnvi(table, _mesa_marshal_TexEnvi);
   45059    SET_TexEnvf(table, _mesa_marshal_TexEnvf);
   45060    SET_TexEnvx(table, _mesa_marshal_TexEnvx);
   45061    SET_InvalidateBufferSubData(table, _mesa_marshal_InvalidateBufferSubData);
   45062    SET_UniformMatrix4x2fv(table, _mesa_marshal_UniformMatrix4x2fv);
   45063    SET_ClearTexImage(table, _mesa_marshal_ClearTexImage);
   45064    SET_PolygonOffset(table, _mesa_marshal_PolygonOffset);
   45065    SET_SamplerParameterfv(table, _mesa_marshal_SamplerParameterfv);
   45066    SET_CompressedTextureSubImage1D(table, _mesa_marshal_CompressedTextureSubImage1D);
   45067    SET_ProgramUniformMatrix4x2dv(table, _mesa_marshal_ProgramUniformMatrix4x2dv);
   45068    SET_ProgramEnvParameter4fARB(table, _mesa_marshal_ProgramEnvParameter4fARB);
   45069    SET_ClearDepth(table, _mesa_marshal_ClearDepth);
   45070    SET_VertexAttrib3dvNV(table, _mesa_marshal_VertexAttrib3dvNV);
   45071    SET_Color4fv(table, _mesa_marshal_Color4fv);
   45072    SET_GetnMinmaxARB(table, _mesa_marshal_GetnMinmaxARB);
   45073    SET_IsImageHandleResidentARB(table, _mesa_marshal_IsImageHandleResidentARB);
   45074    SET_ColorPointer(table, _mesa_marshal_ColorPointer);
   45075    SET_ProgramUniform2ui64ARB(table, _mesa_marshal_ProgramUniform2ui64ARB);
   45076    SET_Lightiv(table, _mesa_marshal_Lightiv);
   45077    SET_GetTexParameterIuiv(table, _mesa_marshal_GetTexParameterIuiv);
   45078    SET_TransformFeedbackVaryings(table, _mesa_marshal_TransformFeedbackVaryings);
   45079    SET_VertexAttrib3sv(table, _mesa_marshal_VertexAttrib3sv);
   45080    SET_Uniform4i64ARB(table, _mesa_marshal_Uniform4i64ARB);
   45081    SET_IsVertexArray(table, _mesa_marshal_IsVertexArray);
   45082    SET_ProgramUniform3ui64ARB(table, _mesa_marshal_ProgramUniform3ui64ARB);
   45083    SET_PushClientAttrib(table, _mesa_marshal_PushClientAttrib);
   45084    SET_ProgramUniform4ui(table, _mesa_marshal_ProgramUniform4ui);
   45085    SET_Uniform1f(table, _mesa_marshal_Uniform1f);
   45086    SET_Uniform1d(table, _mesa_marshal_Uniform1d);
   45087    SET_Uniform1i(table, _mesa_marshal_Uniform1i);
   45088    SET_GetPolygonStipple(table, _mesa_marshal_GetPolygonStipple);
   45089    SET_BlitNamedFramebuffer(table, _mesa_marshal_BlitNamedFramebuffer);
   45090    SET_UseProgram(table, _mesa_marshal_UseProgram);
   45091    SET_GetFragDataLocation(table, _mesa_marshal_GetFragDataLocation);
   45092    SET_PixelMapuiv(table, _mesa_marshal_PixelMapuiv);
   45093    SET_ClearNamedBufferSubData(table, _mesa_marshal_ClearNamedBufferSubData);
   45094    SET_GetNamedFramebufferAttachmentParameteriv(table, _mesa_marshal_GetNamedFramebufferAttachmentParameteriv);
   45095    SET_GenVertexArrays(table, _mesa_marshal_GenVertexArrays);
   45096    SET_TexStorageMem2DMultisampleEXT(table, _mesa_marshal_TexStorageMem2DMultisampleEXT);
   45097    SET_Color3s(table, _mesa_marshal_Color3s);
   45098    SET_TextureStorage2DMultisample(table, _mesa_marshal_TextureStorage2DMultisample);
   45099    SET_TexCoordPointer(table, _mesa_marshal_TexCoordPointer);
   45100    SET_Color3i(table, _mesa_marshal_Color3i);
   45101    SET_EvalCoord2d(table, _mesa_marshal_EvalCoord2d);
   45102    SET_EvalCoord2f(table, _mesa_marshal_EvalCoord2f);
   45103    SET_Color3b(table, _mesa_marshal_Color3b);
   45104    SET_Color3f(table, _mesa_marshal_Color3f);
   45105    SET_Color3d(table, _mesa_marshal_Color3d);
   45106    SET_GetVertexAttribdv(table, _mesa_marshal_GetVertexAttribdv);
   45107    SET_GetBufferPointerv(table, _mesa_marshal_GetBufferPointerv);
   45108    SET_GenFramebuffers(table, _mesa_marshal_GenFramebuffers);
   45109    SET_IsTextureHandleResidentARB(table, _mesa_marshal_IsTextureHandleResidentARB);
   45110    SET_GenBuffers(table, _mesa_marshal_GenBuffers);
   45111    SET_ClearDepthx(table, _mesa_marshal_ClearDepthx);
   45112    SET_EnableVertexArrayAttrib(table, _mesa_marshal_EnableVertexArrayAttrib);
   45113    SET_BlendEquationSeparate(table, _mesa_marshal_BlendEquationSeparate);
   45114    SET_MultiTexCoordP4ui(table, _mesa_marshal_MultiTexCoordP4ui);
   45115    SET_VertexAttribs1fvNV(table, _mesa_marshal_VertexAttribs1fvNV);
   45116    SET_VertexAttribIPointer(table, _mesa_marshal_VertexAttribIPointer);
   45117    SET_ProgramUniform4fv(table, _mesa_marshal_ProgramUniform4fv);
   45118    SET_RasterPos4sv(table, _mesa_marshal_RasterPos4sv);
   45119    SET_CopyTextureSubImage3D(table, _mesa_marshal_CopyTextureSubImage3D);
   45120    SET_SelectBuffer(table, _mesa_marshal_SelectBuffer);
   45121    SET_GetSynciv(table, _mesa_marshal_GetSynciv);
   45122    SET_TextureView(table, _mesa_marshal_TextureView);
   45123    SET_TexEnviv(table, _mesa_marshal_TexEnviv);
   45124    SET_TexSubImage3D(table, _mesa_marshal_TexSubImage3D);
   45125    SET_Bitmap(table, _mesa_marshal_Bitmap);
   45126    SET_VertexAttribDivisor(table, _mesa_marshal_VertexAttribDivisor);
   45127    SET_DrawTransformFeedbackStream(table, _mesa_marshal_DrawTransformFeedbackStream);
   45128    SET_GetIntegerv(table, _mesa_marshal_GetIntegerv);
   45129    SET_EndPerfQueryINTEL(table, _mesa_marshal_EndPerfQueryINTEL);
   45130    SET_NamedBufferPageCommitmentARB(table, _mesa_marshal_NamedBufferPageCommitmentARB);
   45131    SET_GetActiveUniform(table, _mesa_marshal_GetActiveUniform);
   45132    SET_AlphaFuncx(table, _mesa_marshal_AlphaFuncx);
   45133    SET_VertexAttribI2ivEXT(table, _mesa_marshal_VertexAttribI2ivEXT);
   45134    SET_Map1d(table, _mesa_marshal_Map1d);
   45135    SET_Map1f(table, _mesa_marshal_Map1f);
   45136    SET_AreTexturesResident(table, _mesa_marshal_AreTexturesResident);
   45137    SET_VertexArrayVertexBuffer(table, _mesa_marshal_VertexArrayVertexBuffer);
   45138    SET_PixelTransferf(table, _mesa_marshal_PixelTransferf);
   45139    SET_PixelTransferi(table, _mesa_marshal_PixelTransferi);
   45140    SET_GetProgramResourceiv(table, _mesa_marshal_GetProgramResourceiv);
   45141    SET_VertexAttrib3fvNV(table, _mesa_marshal_VertexAttrib3fvNV);
   45142    SET_SecondaryColorP3ui(table, _mesa_marshal_SecondaryColorP3ui);
   45143    SET_BindTextures(table, _mesa_marshal_BindTextures);
   45144    SET_VertexAttrib4fvNV(table, _mesa_marshal_VertexAttrib4fvNV);
   45145    SET_Rectiv(table, _mesa_marshal_Rectiv);
   45146    SET_MultiTexCoord1iv(table, _mesa_marshal_MultiTexCoord1iv);
   45147    SET_PassTexCoordATI(table, _mesa_marshal_PassTexCoordATI);
   45148    SET_Vertex2fv(table, _mesa_marshal_Vertex2fv);
   45149    SET_BindRenderbufferEXT(table, _mesa_marshal_BindRenderbufferEXT);
   45150    SET_Vertex3sv(table, _mesa_marshal_Vertex3sv);
   45151    SET_EvalMesh1(table, _mesa_marshal_EvalMesh1);
   45152    SET_DiscardFramebufferEXT(table, _mesa_marshal_DiscardFramebufferEXT);
   45153    SET_Uniform2f(table, _mesa_marshal_Uniform2f);
   45154    SET_Uniform2d(table, _mesa_marshal_Uniform2d);
   45155    SET_ColorPointerEXT(table, _mesa_marshal_ColorPointerEXT);
   45156    SET_LineWidth(table, _mesa_marshal_LineWidth);
   45157    SET_Uniform2i(table, _mesa_marshal_Uniform2i);
   45158    SET_MultiDrawElementsBaseVertex(table, _mesa_marshal_MultiDrawElementsBaseVertex);
   45159    SET_Lightxv(table, _mesa_marshal_Lightxv);
   45160    SET_DepthRangeIndexed(table, _mesa_marshal_DepthRangeIndexed);
   45161    SET_GetConvolutionParameterfv(table, _mesa_marshal_GetConvolutionParameterfv);
   45162    SET_GetMaterialfv(table, _mesa_marshal_GetMaterialfv);
   45163    SET_TexImage3DMultisample(table, _mesa_marshal_TexImage3DMultisample);
   45164    SET_VertexAttrib1fvNV(table, _mesa_marshal_VertexAttrib1fvNV);
   45165    SET_GetUniformBlockIndex(table, _mesa_marshal_GetUniformBlockIndex);
   45166    SET_DetachShader(table, _mesa_marshal_DetachShader);
   45167    SET_CopyTexSubImage2D(table, _mesa_marshal_CopyTexSubImage2D);
   45168    SET_GetNamedFramebufferParameteriv(table, _mesa_marshal_GetNamedFramebufferParameteriv);
   45169    SET_GetObjectParameterivARB(table, _mesa_marshal_GetObjectParameterivARB);
   45170    SET_Color3iv(table, _mesa_marshal_Color3iv);
   45171    SET_DrawElements(table, _mesa_marshal_DrawElements);
   45172    SET_ScissorArrayv(table, _mesa_marshal_ScissorArrayv);
   45173    SET_GetInternalformativ(table, _mesa_marshal_GetInternalformativ);
   45174    SET_EvalPoint2(table, _mesa_marshal_EvalPoint2);
   45175    SET_EvalPoint1(table, _mesa_marshal_EvalPoint1);
   45176    SET_VertexAttribLPointer(table, _mesa_marshal_VertexAttribLPointer);
   45177    SET_PopMatrix(table, _mesa_marshal_PopMatrix);
   45178    SET_NamedBufferData(table, _mesa_marshal_NamedBufferData);
   45179    SET_GetTexGeniv(table, _mesa_marshal_GetTexGeniv);
   45180    SET_GetFirstPerfQueryIdINTEL(table, _mesa_marshal_GetFirstPerfQueryIdINTEL);
   45181    SET_UnmapBuffer(table, _mesa_marshal_UnmapBuffer);
   45182    SET_EvalCoord1d(table, _mesa_marshal_EvalCoord1d);
   45183    SET_VertexAttribL1d(table, _mesa_marshal_VertexAttribL1d);
   45184    SET_EvalCoord1f(table, _mesa_marshal_EvalCoord1f);
   45185    SET_Materialf(table, _mesa_marshal_Materialf);
   45186    SET_Materiali(table, _mesa_marshal_Materiali);
   45187    SET_ProgramUniform1uiv(table, _mesa_marshal_ProgramUniform1uiv);
   45188    SET_EvalCoord1dv(table, _mesa_marshal_EvalCoord1dv);
   45189    SET_Materialx(table, _mesa_marshal_Materialx);
   45190    SET_GetQueryBufferObjectiv(table, _mesa_marshal_GetQueryBufferObjectiv);
   45191    SET_GetTextureSamplerHandleARB(table, _mesa_marshal_GetTextureSamplerHandleARB);
   45192    SET_GetLightiv(table, _mesa_marshal_GetLightiv);
   45193    SET_ProgramUniform3i64ARB(table, _mesa_marshal_ProgramUniform3i64ARB);
   45194    SET_BindBuffer(table, _mesa_marshal_BindBuffer);
   45195    SET_ProgramUniform1i(table, _mesa_marshal_ProgramUniform1i);
   45196    SET_ProgramUniform1f(table, _mesa_marshal_ProgramUniform1f);
   45197    SET_ProgramUniform1d(table, _mesa_marshal_ProgramUniform1d);
   45198    SET_WindowPos3iv(table, _mesa_marshal_WindowPos3iv);
   45199    SET_CopyConvolutionFilter2D(table, _mesa_marshal_CopyConvolutionFilter2D);
   45200    SET_CopyBufferSubData(table, _mesa_marshal_CopyBufferSubData);
   45201    SET_UniformMatrix3x4fv(table, _mesa_marshal_UniformMatrix3x4fv);
   45202    SET_Recti(table, _mesa_marshal_Recti);
   45203    SET_VertexAttribI3ivEXT(table, _mesa_marshal_VertexAttribI3ivEXT);
   45204    SET_DeleteSamplers(table, _mesa_marshal_DeleteSamplers);
   45205    SET_SamplerParameteri(table, _mesa_marshal_SamplerParameteri);
   45206    SET_WindowRectanglesEXT(table, _mesa_marshal_WindowRectanglesEXT);
   45207    SET_Rectf(table, _mesa_marshal_Rectf);
   45208    SET_Rectd(table, _mesa_marshal_Rectd);
   45209    SET_MultMatrixx(table, _mesa_marshal_MultMatrixx);
   45210    SET_TexStorageMem3DMultisampleEXT(table, _mesa_marshal_TexStorageMem3DMultisampleEXT);
   45211    SET_Rects(table, _mesa_marshal_Rects);
   45212    SET_GetVertexAttribIiv(table, _mesa_marshal_GetVertexAttribIiv);
   45213    SET_ClientWaitSync(table, _mesa_marshal_ClientWaitSync);
   45214    SET_TexCoord4s(table, _mesa_marshal_TexCoord4s);
   45215    SET_TexEnvxv(table, _mesa_marshal_TexEnvxv);
   45216    SET_TexCoord4i(table, _mesa_marshal_TexCoord4i);
   45217    SET_ObjectPurgeableAPPLE(table, _mesa_marshal_ObjectPurgeableAPPLE);
   45218    SET_ProgramUniform1ui64vARB(table, _mesa_marshal_ProgramUniform1ui64vARB);
   45219    SET_TexCoord4d(table, _mesa_marshal_TexCoord4d);
   45220    SET_TexCoord4f(table, _mesa_marshal_TexCoord4f);
   45221    SET_GetBooleanv(table, _mesa_marshal_GetBooleanv);
   45222    SET_ProgramUniformMatrix3dv(table, _mesa_marshal_ProgramUniformMatrix3dv);
   45223    SET_LockArraysEXT(table, _mesa_marshal_LockArraysEXT);
   45224    SET_GetActiveUniformBlockiv(table, _mesa_marshal_GetActiveUniformBlockiv);
   45225    SET_GetPerfMonitorCountersAMD(table, _mesa_marshal_GetPerfMonitorCountersAMD);
   45226    SET_ObjectPtrLabel(table, _mesa_marshal_ObjectPtrLabel);
   45227    SET_Rectfv(table, _mesa_marshal_Rectfv);
   45228    SET_BindImageTexture(table, _mesa_marshal_BindImageTexture);
   45229    SET_VertexP4uiv(table, _mesa_marshal_VertexP4uiv);
   45230    SET_GetUniformSubroutineuiv(table, _mesa_marshal_GetUniformSubroutineuiv);
   45231    SET_MinSampleShading(table, _mesa_marshal_MinSampleShading);
   45232    SET_GetRenderbufferParameteriv(table, _mesa_marshal_GetRenderbufferParameteriv);
   45233    SET_VertexAttrib1dNV(table, _mesa_marshal_VertexAttrib1dNV);
   45234    SET_WindowPos2sv(table, _mesa_marshal_WindowPos2sv);
   45235    SET_GetPerfMonitorCounterStringAMD(table, _mesa_marshal_GetPerfMonitorCounterStringAMD);
   45236    SET_EndFragmentShaderATI(table, _mesa_marshal_EndFragmentShaderATI);
   45237    SET_Uniform4iv(table, _mesa_marshal_Uniform4iv);
   45238    SET_CreateMemoryObjectsEXT(table, _mesa_marshal_CreateMemoryObjectsEXT);
   45239 
   45240    return table;
   45241 }
   45242 
   45243 
   45244