1/* DO NOT EDIT - This file generated automatically by gl_marshal.py script */ 2 3/* 4 * Copyright (C) 2012 Intel Corporation 5 * All Rights Reserved. 6 * 7 * Permission is hereby granted, free of charge, to any person obtaining a 8 * copy of this software and associated documentation files (the "Software"), 9 * to deal in the Software without restriction, including without limitation 10 * the rights to use, copy, modify, merge, publish, distribute, sub license, 11 * and/or sell copies of the Software, and to permit persons to whom the 12 * Software is furnished to do so, subject to the following conditions: 13 * 14 * The above copyright notice and this permission notice (including the next 15 * paragraph) shall be included in all copies or substantial portions of the 16 * Software. 17 * 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL 21 * INTEL CORPORATION, 22 * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 23 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 24 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 25 * SOFTWARE. 26 */ 27 28 29#include "api_exec.h" 30#include "glthread_marshal.h" 31#include "bufferobj.h" 32#include "dispatch.h" 33 34#define COMPAT (ctx->API != API_OPENGL_CORE) 35 36UNUSED static inline int safe_mul(int a, int b) 37{ 38 if (a < 0 || b < 0) return -1; 39 if (a == 0 || b == 0) return 0; 40 if (a > INT_MAX / b) return -1; 41 return a * b; 42} 43 44/* VertexAttrib1fARB: marshalled asynchronously */ 45struct marshal_cmd_VertexAttrib1fARB 46{ 47 struct marshal_cmd_base cmd_base; 48 GLuint index; 49 GLfloat x; 50}; 51uint32_t 52_mesa_unmarshal_VertexAttrib1fARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1fARB *cmd, const uint64_t *last) 53{ 54 GLuint index = cmd->index; 55 GLfloat x = cmd->x; 56 CALL_VertexAttrib1fARB(ctx->CurrentServerDispatch, (index, x)); 57 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib1fARB), 8) / 8); 58 assert (cmd_size == cmd->cmd_base.cmd_size); 59 return cmd_size; 60} 61void GLAPIENTRY 62_mesa_marshal_VertexAttrib1fARB(GLuint index, GLfloat x) 63{ 64 GET_CURRENT_CONTEXT(ctx); 65 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib1fARB); 66 struct marshal_cmd_VertexAttrib1fARB *cmd; 67 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1fARB, cmd_size); 68 cmd->index = index; 69 cmd->x = x; 70} 71 72 73/* VertexAttrib1fvARB: marshalled asynchronously */ 74struct marshal_cmd_VertexAttrib1fvARB 75{ 76 struct marshal_cmd_base cmd_base; 77 GLuint index; 78 GLfloat v[1]; 79}; 80uint32_t 81_mesa_unmarshal_VertexAttrib1fvARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1fvARB *cmd, const uint64_t *last) 82{ 83 GLuint index = cmd->index; 84 const GLfloat * v = cmd->v; 85 CALL_VertexAttrib1fvARB(ctx->CurrentServerDispatch, (index, v)); 86 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib1fvARB), 8) / 8); 87 assert (cmd_size == cmd->cmd_base.cmd_size); 88 return cmd_size; 89} 90void GLAPIENTRY 91_mesa_marshal_VertexAttrib1fvARB(GLuint index, const GLfloat * v) 92{ 93 GET_CURRENT_CONTEXT(ctx); 94 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib1fvARB); 95 struct marshal_cmd_VertexAttrib1fvARB *cmd; 96 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1fvARB, cmd_size); 97 cmd->index = index; 98 memcpy(cmd->v, v, 1 * sizeof(GLfloat)); 99} 100 101 102/* VertexAttrib1s: marshalled asynchronously */ 103struct marshal_cmd_VertexAttrib1s 104{ 105 struct marshal_cmd_base cmd_base; 106 GLshort x; 107 GLuint index; 108}; 109uint32_t 110_mesa_unmarshal_VertexAttrib1s(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1s *cmd, const uint64_t *last) 111{ 112 GLuint index = cmd->index; 113 GLshort x = cmd->x; 114 CALL_VertexAttrib1s(ctx->CurrentServerDispatch, (index, x)); 115 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib1s), 8) / 8); 116 assert (cmd_size == cmd->cmd_base.cmd_size); 117 return cmd_size; 118} 119void GLAPIENTRY 120_mesa_marshal_VertexAttrib1s(GLuint index, GLshort x) 121{ 122 GET_CURRENT_CONTEXT(ctx); 123 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib1s); 124 struct marshal_cmd_VertexAttrib1s *cmd; 125 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1s, cmd_size); 126 cmd->index = index; 127 cmd->x = x; 128} 129 130 131/* VertexAttrib1sv: marshalled asynchronously */ 132struct marshal_cmd_VertexAttrib1sv 133{ 134 struct marshal_cmd_base cmd_base; 135 GLuint index; 136 GLshort v[1]; 137}; 138uint32_t 139_mesa_unmarshal_VertexAttrib1sv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1sv *cmd, const uint64_t *last) 140{ 141 GLuint index = cmd->index; 142 const GLshort * v = cmd->v; 143 CALL_VertexAttrib1sv(ctx->CurrentServerDispatch, (index, v)); 144 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib1sv), 8) / 8); 145 assert (cmd_size == cmd->cmd_base.cmd_size); 146 return cmd_size; 147} 148void GLAPIENTRY 149_mesa_marshal_VertexAttrib1sv(GLuint index, const GLshort * v) 150{ 151 GET_CURRENT_CONTEXT(ctx); 152 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib1sv); 153 struct marshal_cmd_VertexAttrib1sv *cmd; 154 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1sv, cmd_size); 155 cmd->index = index; 156 memcpy(cmd->v, v, 1 * sizeof(GLshort)); 157} 158 159 160/* VertexAttrib2d: marshalled asynchronously */ 161struct marshal_cmd_VertexAttrib2d 162{ 163 struct marshal_cmd_base cmd_base; 164 GLuint index; 165 GLdouble x; 166 GLdouble y; 167}; 168uint32_t 169_mesa_unmarshal_VertexAttrib2d(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2d *cmd, const uint64_t *last) 170{ 171 GLuint index = cmd->index; 172 GLdouble x = cmd->x; 173 GLdouble y = cmd->y; 174 CALL_VertexAttrib2d(ctx->CurrentServerDispatch, (index, x, y)); 175 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib2d), 8) / 8); 176 assert (cmd_size == cmd->cmd_base.cmd_size); 177 return cmd_size; 178} 179void GLAPIENTRY 180_mesa_marshal_VertexAttrib2d(GLuint index, GLdouble x, GLdouble y) 181{ 182 GET_CURRENT_CONTEXT(ctx); 183 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib2d); 184 struct marshal_cmd_VertexAttrib2d *cmd; 185 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2d, cmd_size); 186 cmd->index = index; 187 cmd->x = x; 188 cmd->y = y; 189} 190 191 192/* VertexAttrib2dv: marshalled asynchronously */ 193struct marshal_cmd_VertexAttrib2dv 194{ 195 struct marshal_cmd_base cmd_base; 196 GLuint index; 197 GLdouble v[2]; 198}; 199uint32_t 200_mesa_unmarshal_VertexAttrib2dv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2dv *cmd, const uint64_t *last) 201{ 202 GLuint index = cmd->index; 203 const GLdouble * v = cmd->v; 204 CALL_VertexAttrib2dv(ctx->CurrentServerDispatch, (index, v)); 205 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib2dv), 8) / 8); 206 assert (cmd_size == cmd->cmd_base.cmd_size); 207 return cmd_size; 208} 209void GLAPIENTRY 210_mesa_marshal_VertexAttrib2dv(GLuint index, const GLdouble * v) 211{ 212 GET_CURRENT_CONTEXT(ctx); 213 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib2dv); 214 struct marshal_cmd_VertexAttrib2dv *cmd; 215 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2dv, cmd_size); 216 cmd->index = index; 217 memcpy(cmd->v, v, 2 * sizeof(GLdouble)); 218} 219 220 221/* VertexAttrib2fARB: marshalled asynchronously */ 222struct marshal_cmd_VertexAttrib2fARB 223{ 224 struct marshal_cmd_base cmd_base; 225 GLuint index; 226 GLfloat x; 227 GLfloat y; 228}; 229uint32_t 230_mesa_unmarshal_VertexAttrib2fARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2fARB *cmd, const uint64_t *last) 231{ 232 GLuint index = cmd->index; 233 GLfloat x = cmd->x; 234 GLfloat y = cmd->y; 235 CALL_VertexAttrib2fARB(ctx->CurrentServerDispatch, (index, x, y)); 236 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib2fARB), 8) / 8); 237 assert (cmd_size == cmd->cmd_base.cmd_size); 238 return cmd_size; 239} 240void GLAPIENTRY 241_mesa_marshal_VertexAttrib2fARB(GLuint index, GLfloat x, GLfloat y) 242{ 243 GET_CURRENT_CONTEXT(ctx); 244 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib2fARB); 245 struct marshal_cmd_VertexAttrib2fARB *cmd; 246 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2fARB, cmd_size); 247 cmd->index = index; 248 cmd->x = x; 249 cmd->y = y; 250} 251 252 253/* VertexAttrib2fvARB: marshalled asynchronously */ 254struct marshal_cmd_VertexAttrib2fvARB 255{ 256 struct marshal_cmd_base cmd_base; 257 GLuint index; 258 GLfloat v[2]; 259}; 260uint32_t 261_mesa_unmarshal_VertexAttrib2fvARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2fvARB *cmd, const uint64_t *last) 262{ 263 GLuint index = cmd->index; 264 const GLfloat * v = cmd->v; 265 CALL_VertexAttrib2fvARB(ctx->CurrentServerDispatch, (index, v)); 266 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib2fvARB), 8) / 8); 267 assert (cmd_size == cmd->cmd_base.cmd_size); 268 return cmd_size; 269} 270void GLAPIENTRY 271_mesa_marshal_VertexAttrib2fvARB(GLuint index, const GLfloat * v) 272{ 273 GET_CURRENT_CONTEXT(ctx); 274 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib2fvARB); 275 struct marshal_cmd_VertexAttrib2fvARB *cmd; 276 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2fvARB, cmd_size); 277 cmd->index = index; 278 memcpy(cmd->v, v, 2 * sizeof(GLfloat)); 279} 280 281 282/* VertexAttrib2s: marshalled asynchronously */ 283struct marshal_cmd_VertexAttrib2s 284{ 285 struct marshal_cmd_base cmd_base; 286 GLshort x; 287 GLshort y; 288 GLuint index; 289}; 290uint32_t 291_mesa_unmarshal_VertexAttrib2s(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2s *cmd, const uint64_t *last) 292{ 293 GLuint index = cmd->index; 294 GLshort x = cmd->x; 295 GLshort y = cmd->y; 296 CALL_VertexAttrib2s(ctx->CurrentServerDispatch, (index, x, y)); 297 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib2s), 8) / 8); 298 assert (cmd_size == cmd->cmd_base.cmd_size); 299 return cmd_size; 300} 301void GLAPIENTRY 302_mesa_marshal_VertexAttrib2s(GLuint index, GLshort x, GLshort y) 303{ 304 GET_CURRENT_CONTEXT(ctx); 305 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib2s); 306 struct marshal_cmd_VertexAttrib2s *cmd; 307 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2s, cmd_size); 308 cmd->index = index; 309 cmd->x = x; 310 cmd->y = y; 311} 312 313 314/* VertexAttrib2sv: marshalled asynchronously */ 315struct marshal_cmd_VertexAttrib2sv 316{ 317 struct marshal_cmd_base cmd_base; 318 GLuint index; 319 GLshort v[2]; 320}; 321uint32_t 322_mesa_unmarshal_VertexAttrib2sv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2sv *cmd, const uint64_t *last) 323{ 324 GLuint index = cmd->index; 325 const GLshort * v = cmd->v; 326 CALL_VertexAttrib2sv(ctx->CurrentServerDispatch, (index, v)); 327 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib2sv), 8) / 8); 328 assert (cmd_size == cmd->cmd_base.cmd_size); 329 return cmd_size; 330} 331void GLAPIENTRY 332_mesa_marshal_VertexAttrib2sv(GLuint index, const GLshort * v) 333{ 334 GET_CURRENT_CONTEXT(ctx); 335 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib2sv); 336 struct marshal_cmd_VertexAttrib2sv *cmd; 337 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2sv, cmd_size); 338 cmd->index = index; 339 memcpy(cmd->v, v, 2 * sizeof(GLshort)); 340} 341 342 343/* VertexAttrib3d: marshalled asynchronously */ 344struct marshal_cmd_VertexAttrib3d 345{ 346 struct marshal_cmd_base cmd_base; 347 GLuint index; 348 GLdouble x; 349 GLdouble y; 350 GLdouble z; 351}; 352uint32_t 353_mesa_unmarshal_VertexAttrib3d(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3d *cmd, const uint64_t *last) 354{ 355 GLuint index = cmd->index; 356 GLdouble x = cmd->x; 357 GLdouble y = cmd->y; 358 GLdouble z = cmd->z; 359 CALL_VertexAttrib3d(ctx->CurrentServerDispatch, (index, x, y, z)); 360 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib3d), 8) / 8); 361 assert (cmd_size == cmd->cmd_base.cmd_size); 362 return cmd_size; 363} 364void GLAPIENTRY 365_mesa_marshal_VertexAttrib3d(GLuint index, GLdouble x, GLdouble y, GLdouble z) 366{ 367 GET_CURRENT_CONTEXT(ctx); 368 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib3d); 369 struct marshal_cmd_VertexAttrib3d *cmd; 370 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3d, cmd_size); 371 cmd->index = index; 372 cmd->x = x; 373 cmd->y = y; 374 cmd->z = z; 375} 376 377 378/* VertexAttrib3dv: marshalled asynchronously */ 379struct marshal_cmd_VertexAttrib3dv 380{ 381 struct marshal_cmd_base cmd_base; 382 GLuint index; 383 GLdouble v[3]; 384}; 385uint32_t 386_mesa_unmarshal_VertexAttrib3dv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3dv *cmd, const uint64_t *last) 387{ 388 GLuint index = cmd->index; 389 const GLdouble * v = cmd->v; 390 CALL_VertexAttrib3dv(ctx->CurrentServerDispatch, (index, v)); 391 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib3dv), 8) / 8); 392 assert (cmd_size == cmd->cmd_base.cmd_size); 393 return cmd_size; 394} 395void GLAPIENTRY 396_mesa_marshal_VertexAttrib3dv(GLuint index, const GLdouble * v) 397{ 398 GET_CURRENT_CONTEXT(ctx); 399 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib3dv); 400 struct marshal_cmd_VertexAttrib3dv *cmd; 401 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3dv, cmd_size); 402 cmd->index = index; 403 memcpy(cmd->v, v, 3 * sizeof(GLdouble)); 404} 405 406 407/* VertexAttrib3fARB: marshalled asynchronously */ 408struct marshal_cmd_VertexAttrib3fARB 409{ 410 struct marshal_cmd_base cmd_base; 411 GLuint index; 412 GLfloat x; 413 GLfloat y; 414 GLfloat z; 415}; 416uint32_t 417_mesa_unmarshal_VertexAttrib3fARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3fARB *cmd, const uint64_t *last) 418{ 419 GLuint index = cmd->index; 420 GLfloat x = cmd->x; 421 GLfloat y = cmd->y; 422 GLfloat z = cmd->z; 423 CALL_VertexAttrib3fARB(ctx->CurrentServerDispatch, (index, x, y, z)); 424 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib3fARB), 8) / 8); 425 assert (cmd_size == cmd->cmd_base.cmd_size); 426 return cmd_size; 427} 428void GLAPIENTRY 429_mesa_marshal_VertexAttrib3fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z) 430{ 431 GET_CURRENT_CONTEXT(ctx); 432 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib3fARB); 433 struct marshal_cmd_VertexAttrib3fARB *cmd; 434 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3fARB, cmd_size); 435 cmd->index = index; 436 cmd->x = x; 437 cmd->y = y; 438 cmd->z = z; 439} 440 441 442/* VertexAttrib3fvARB: marshalled asynchronously */ 443struct marshal_cmd_VertexAttrib3fvARB 444{ 445 struct marshal_cmd_base cmd_base; 446 GLuint index; 447 GLfloat v[3]; 448}; 449uint32_t 450_mesa_unmarshal_VertexAttrib3fvARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3fvARB *cmd, const uint64_t *last) 451{ 452 GLuint index = cmd->index; 453 const GLfloat * v = cmd->v; 454 CALL_VertexAttrib3fvARB(ctx->CurrentServerDispatch, (index, v)); 455 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib3fvARB), 8) / 8); 456 assert (cmd_size == cmd->cmd_base.cmd_size); 457 return cmd_size; 458} 459void GLAPIENTRY 460_mesa_marshal_VertexAttrib3fvARB(GLuint index, const GLfloat * v) 461{ 462 GET_CURRENT_CONTEXT(ctx); 463 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib3fvARB); 464 struct marshal_cmd_VertexAttrib3fvARB *cmd; 465 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3fvARB, cmd_size); 466 cmd->index = index; 467 memcpy(cmd->v, v, 3 * sizeof(GLfloat)); 468} 469 470 471/* VertexAttrib3s: marshalled asynchronously */ 472struct marshal_cmd_VertexAttrib3s 473{ 474 struct marshal_cmd_base cmd_base; 475 GLshort x; 476 GLshort y; 477 GLshort z; 478 GLuint index; 479}; 480uint32_t 481_mesa_unmarshal_VertexAttrib3s(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3s *cmd, const uint64_t *last) 482{ 483 GLuint index = cmd->index; 484 GLshort x = cmd->x; 485 GLshort y = cmd->y; 486 GLshort z = cmd->z; 487 CALL_VertexAttrib3s(ctx->CurrentServerDispatch, (index, x, y, z)); 488 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib3s), 8) / 8); 489 assert (cmd_size == cmd->cmd_base.cmd_size); 490 return cmd_size; 491} 492void GLAPIENTRY 493_mesa_marshal_VertexAttrib3s(GLuint index, GLshort x, GLshort y, GLshort z) 494{ 495 GET_CURRENT_CONTEXT(ctx); 496 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib3s); 497 struct marshal_cmd_VertexAttrib3s *cmd; 498 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3s, cmd_size); 499 cmd->index = index; 500 cmd->x = x; 501 cmd->y = y; 502 cmd->z = z; 503} 504 505 506/* VertexAttrib3sv: marshalled asynchronously */ 507struct marshal_cmd_VertexAttrib3sv 508{ 509 struct marshal_cmd_base cmd_base; 510 GLuint index; 511 GLshort v[3]; 512}; 513uint32_t 514_mesa_unmarshal_VertexAttrib3sv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3sv *cmd, const uint64_t *last) 515{ 516 GLuint index = cmd->index; 517 const GLshort * v = cmd->v; 518 CALL_VertexAttrib3sv(ctx->CurrentServerDispatch, (index, v)); 519 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib3sv), 8) / 8); 520 assert (cmd_size == cmd->cmd_base.cmd_size); 521 return cmd_size; 522} 523void GLAPIENTRY 524_mesa_marshal_VertexAttrib3sv(GLuint index, const GLshort * v) 525{ 526 GET_CURRENT_CONTEXT(ctx); 527 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib3sv); 528 struct marshal_cmd_VertexAttrib3sv *cmd; 529 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3sv, cmd_size); 530 cmd->index = index; 531 memcpy(cmd->v, v, 3 * sizeof(GLshort)); 532} 533 534 535/* VertexAttrib4Nbv: marshalled asynchronously */ 536struct marshal_cmd_VertexAttrib4Nbv 537{ 538 struct marshal_cmd_base cmd_base; 539 GLuint index; 540 GLbyte v[4]; 541}; 542uint32_t 543_mesa_unmarshal_VertexAttrib4Nbv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nbv *cmd, const uint64_t *last) 544{ 545 GLuint index = cmd->index; 546 const GLbyte * v = cmd->v; 547 CALL_VertexAttrib4Nbv(ctx->CurrentServerDispatch, (index, v)); 548 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4Nbv), 8) / 8); 549 assert (cmd_size == cmd->cmd_base.cmd_size); 550 return cmd_size; 551} 552void GLAPIENTRY 553_mesa_marshal_VertexAttrib4Nbv(GLuint index, const GLbyte * v) 554{ 555 GET_CURRENT_CONTEXT(ctx); 556 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nbv); 557 struct marshal_cmd_VertexAttrib4Nbv *cmd; 558 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nbv, cmd_size); 559 cmd->index = index; 560 memcpy(cmd->v, v, 4 * sizeof(GLbyte)); 561} 562 563 564/* VertexAttrib4Niv: marshalled asynchronously */ 565struct marshal_cmd_VertexAttrib4Niv 566{ 567 struct marshal_cmd_base cmd_base; 568 GLuint index; 569 GLint v[4]; 570}; 571uint32_t 572_mesa_unmarshal_VertexAttrib4Niv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Niv *cmd, const uint64_t *last) 573{ 574 GLuint index = cmd->index; 575 const GLint * v = cmd->v; 576 CALL_VertexAttrib4Niv(ctx->CurrentServerDispatch, (index, v)); 577 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4Niv), 8) / 8); 578 assert (cmd_size == cmd->cmd_base.cmd_size); 579 return cmd_size; 580} 581void GLAPIENTRY 582_mesa_marshal_VertexAttrib4Niv(GLuint index, const GLint * v) 583{ 584 GET_CURRENT_CONTEXT(ctx); 585 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Niv); 586 struct marshal_cmd_VertexAttrib4Niv *cmd; 587 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Niv, cmd_size); 588 cmd->index = index; 589 memcpy(cmd->v, v, 4 * sizeof(GLint)); 590} 591 592 593/* VertexAttrib4Nsv: marshalled asynchronously */ 594struct marshal_cmd_VertexAttrib4Nsv 595{ 596 struct marshal_cmd_base cmd_base; 597 GLuint index; 598 GLshort v[4]; 599}; 600uint32_t 601_mesa_unmarshal_VertexAttrib4Nsv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nsv *cmd, const uint64_t *last) 602{ 603 GLuint index = cmd->index; 604 const GLshort * v = cmd->v; 605 CALL_VertexAttrib4Nsv(ctx->CurrentServerDispatch, (index, v)); 606 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4Nsv), 8) / 8); 607 assert (cmd_size == cmd->cmd_base.cmd_size); 608 return cmd_size; 609} 610void GLAPIENTRY 611_mesa_marshal_VertexAttrib4Nsv(GLuint index, const GLshort * v) 612{ 613 GET_CURRENT_CONTEXT(ctx); 614 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nsv); 615 struct marshal_cmd_VertexAttrib4Nsv *cmd; 616 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nsv, cmd_size); 617 cmd->index = index; 618 memcpy(cmd->v, v, 4 * sizeof(GLshort)); 619} 620 621 622/* VertexAttrib4Nub: marshalled asynchronously */ 623struct marshal_cmd_VertexAttrib4Nub 624{ 625 struct marshal_cmd_base cmd_base; 626 GLubyte x; 627 GLubyte y; 628 GLubyte z; 629 GLubyte w; 630 GLuint index; 631}; 632uint32_t 633_mesa_unmarshal_VertexAttrib4Nub(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nub *cmd, const uint64_t *last) 634{ 635 GLuint index = cmd->index; 636 GLubyte x = cmd->x; 637 GLubyte y = cmd->y; 638 GLubyte z = cmd->z; 639 GLubyte w = cmd->w; 640 CALL_VertexAttrib4Nub(ctx->CurrentServerDispatch, (index, x, y, z, w)); 641 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4Nub), 8) / 8); 642 assert (cmd_size == cmd->cmd_base.cmd_size); 643 return cmd_size; 644} 645void GLAPIENTRY 646_mesa_marshal_VertexAttrib4Nub(GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w) 647{ 648 GET_CURRENT_CONTEXT(ctx); 649 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nub); 650 struct marshal_cmd_VertexAttrib4Nub *cmd; 651 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nub, cmd_size); 652 cmd->index = index; 653 cmd->x = x; 654 cmd->y = y; 655 cmd->z = z; 656 cmd->w = w; 657} 658 659 660/* VertexAttrib4Nubv: marshalled asynchronously */ 661struct marshal_cmd_VertexAttrib4Nubv 662{ 663 struct marshal_cmd_base cmd_base; 664 GLuint index; 665 GLubyte v[4]; 666}; 667uint32_t 668_mesa_unmarshal_VertexAttrib4Nubv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nubv *cmd, const uint64_t *last) 669{ 670 GLuint index = cmd->index; 671 const GLubyte * v = cmd->v; 672 CALL_VertexAttrib4Nubv(ctx->CurrentServerDispatch, (index, v)); 673 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4Nubv), 8) / 8); 674 assert (cmd_size == cmd->cmd_base.cmd_size); 675 return cmd_size; 676} 677void GLAPIENTRY 678_mesa_marshal_VertexAttrib4Nubv(GLuint index, const GLubyte * v) 679{ 680 GET_CURRENT_CONTEXT(ctx); 681 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nubv); 682 struct marshal_cmd_VertexAttrib4Nubv *cmd; 683 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nubv, cmd_size); 684 cmd->index = index; 685 memcpy(cmd->v, v, 4 * sizeof(GLubyte)); 686} 687 688 689/* VertexAttrib4Nuiv: marshalled asynchronously */ 690struct marshal_cmd_VertexAttrib4Nuiv 691{ 692 struct marshal_cmd_base cmd_base; 693 GLuint index; 694 GLuint v[4]; 695}; 696uint32_t 697_mesa_unmarshal_VertexAttrib4Nuiv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nuiv *cmd, const uint64_t *last) 698{ 699 GLuint index = cmd->index; 700 const GLuint * v = cmd->v; 701 CALL_VertexAttrib4Nuiv(ctx->CurrentServerDispatch, (index, v)); 702 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4Nuiv), 8) / 8); 703 assert (cmd_size == cmd->cmd_base.cmd_size); 704 return cmd_size; 705} 706void GLAPIENTRY 707_mesa_marshal_VertexAttrib4Nuiv(GLuint index, const GLuint * v) 708{ 709 GET_CURRENT_CONTEXT(ctx); 710 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nuiv); 711 struct marshal_cmd_VertexAttrib4Nuiv *cmd; 712 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nuiv, cmd_size); 713 cmd->index = index; 714 memcpy(cmd->v, v, 4 * sizeof(GLuint)); 715} 716 717 718/* VertexAttrib4Nusv: marshalled asynchronously */ 719struct marshal_cmd_VertexAttrib4Nusv 720{ 721 struct marshal_cmd_base cmd_base; 722 GLuint index; 723 GLushort v[4]; 724}; 725uint32_t 726_mesa_unmarshal_VertexAttrib4Nusv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4Nusv *cmd, const uint64_t *last) 727{ 728 GLuint index = cmd->index; 729 const GLushort * v = cmd->v; 730 CALL_VertexAttrib4Nusv(ctx->CurrentServerDispatch, (index, v)); 731 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4Nusv), 8) / 8); 732 assert (cmd_size == cmd->cmd_base.cmd_size); 733 return cmd_size; 734} 735void GLAPIENTRY 736_mesa_marshal_VertexAttrib4Nusv(GLuint index, const GLushort * v) 737{ 738 GET_CURRENT_CONTEXT(ctx); 739 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4Nusv); 740 struct marshal_cmd_VertexAttrib4Nusv *cmd; 741 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4Nusv, cmd_size); 742 cmd->index = index; 743 memcpy(cmd->v, v, 4 * sizeof(GLushort)); 744} 745 746 747/* VertexAttrib4bv: marshalled asynchronously */ 748struct marshal_cmd_VertexAttrib4bv 749{ 750 struct marshal_cmd_base cmd_base; 751 GLuint index; 752 GLbyte v[4]; 753}; 754uint32_t 755_mesa_unmarshal_VertexAttrib4bv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4bv *cmd, const uint64_t *last) 756{ 757 GLuint index = cmd->index; 758 const GLbyte * v = cmd->v; 759 CALL_VertexAttrib4bv(ctx->CurrentServerDispatch, (index, v)); 760 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4bv), 8) / 8); 761 assert (cmd_size == cmd->cmd_base.cmd_size); 762 return cmd_size; 763} 764void GLAPIENTRY 765_mesa_marshal_VertexAttrib4bv(GLuint index, const GLbyte * v) 766{ 767 GET_CURRENT_CONTEXT(ctx); 768 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4bv); 769 struct marshal_cmd_VertexAttrib4bv *cmd; 770 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4bv, cmd_size); 771 cmd->index = index; 772 memcpy(cmd->v, v, 4 * sizeof(GLbyte)); 773} 774 775 776/* VertexAttrib4d: marshalled asynchronously */ 777struct marshal_cmd_VertexAttrib4d 778{ 779 struct marshal_cmd_base cmd_base; 780 GLuint index; 781 GLdouble x; 782 GLdouble y; 783 GLdouble z; 784 GLdouble w; 785}; 786uint32_t 787_mesa_unmarshal_VertexAttrib4d(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4d *cmd, const uint64_t *last) 788{ 789 GLuint index = cmd->index; 790 GLdouble x = cmd->x; 791 GLdouble y = cmd->y; 792 GLdouble z = cmd->z; 793 GLdouble w = cmd->w; 794 CALL_VertexAttrib4d(ctx->CurrentServerDispatch, (index, x, y, z, w)); 795 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4d), 8) / 8); 796 assert (cmd_size == cmd->cmd_base.cmd_size); 797 return cmd_size; 798} 799void GLAPIENTRY 800_mesa_marshal_VertexAttrib4d(GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) 801{ 802 GET_CURRENT_CONTEXT(ctx); 803 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4d); 804 struct marshal_cmd_VertexAttrib4d *cmd; 805 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4d, cmd_size); 806 cmd->index = index; 807 cmd->x = x; 808 cmd->y = y; 809 cmd->z = z; 810 cmd->w = w; 811} 812 813 814/* VertexAttrib4dv: marshalled asynchronously */ 815struct marshal_cmd_VertexAttrib4dv 816{ 817 struct marshal_cmd_base cmd_base; 818 GLuint index; 819 GLdouble v[4]; 820}; 821uint32_t 822_mesa_unmarshal_VertexAttrib4dv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4dv *cmd, const uint64_t *last) 823{ 824 GLuint index = cmd->index; 825 const GLdouble * v = cmd->v; 826 CALL_VertexAttrib4dv(ctx->CurrentServerDispatch, (index, v)); 827 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4dv), 8) / 8); 828 assert (cmd_size == cmd->cmd_base.cmd_size); 829 return cmd_size; 830} 831void GLAPIENTRY 832_mesa_marshal_VertexAttrib4dv(GLuint index, const GLdouble * v) 833{ 834 GET_CURRENT_CONTEXT(ctx); 835 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4dv); 836 struct marshal_cmd_VertexAttrib4dv *cmd; 837 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4dv, cmd_size); 838 cmd->index = index; 839 memcpy(cmd->v, v, 4 * sizeof(GLdouble)); 840} 841 842 843/* VertexAttrib4fARB: marshalled asynchronously */ 844struct marshal_cmd_VertexAttrib4fARB 845{ 846 struct marshal_cmd_base cmd_base; 847 GLuint index; 848 GLfloat x; 849 GLfloat y; 850 GLfloat z; 851 GLfloat w; 852}; 853uint32_t 854_mesa_unmarshal_VertexAttrib4fARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4fARB *cmd, const uint64_t *last) 855{ 856 GLuint index = cmd->index; 857 GLfloat x = cmd->x; 858 GLfloat y = cmd->y; 859 GLfloat z = cmd->z; 860 GLfloat w = cmd->w; 861 CALL_VertexAttrib4fARB(ctx->CurrentServerDispatch, (index, x, y, z, w)); 862 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4fARB), 8) / 8); 863 assert (cmd_size == cmd->cmd_base.cmd_size); 864 return cmd_size; 865} 866void GLAPIENTRY 867_mesa_marshal_VertexAttrib4fARB(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) 868{ 869 GET_CURRENT_CONTEXT(ctx); 870 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4fARB); 871 struct marshal_cmd_VertexAttrib4fARB *cmd; 872 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4fARB, cmd_size); 873 cmd->index = index; 874 cmd->x = x; 875 cmd->y = y; 876 cmd->z = z; 877 cmd->w = w; 878} 879 880 881/* VertexAttrib4fvARB: marshalled asynchronously */ 882struct marshal_cmd_VertexAttrib4fvARB 883{ 884 struct marshal_cmd_base cmd_base; 885 GLuint index; 886 GLfloat v[4]; 887}; 888uint32_t 889_mesa_unmarshal_VertexAttrib4fvARB(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4fvARB *cmd, const uint64_t *last) 890{ 891 GLuint index = cmd->index; 892 const GLfloat * v = cmd->v; 893 CALL_VertexAttrib4fvARB(ctx->CurrentServerDispatch, (index, v)); 894 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4fvARB), 8) / 8); 895 assert (cmd_size == cmd->cmd_base.cmd_size); 896 return cmd_size; 897} 898void GLAPIENTRY 899_mesa_marshal_VertexAttrib4fvARB(GLuint index, const GLfloat * v) 900{ 901 GET_CURRENT_CONTEXT(ctx); 902 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4fvARB); 903 struct marshal_cmd_VertexAttrib4fvARB *cmd; 904 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4fvARB, cmd_size); 905 cmd->index = index; 906 memcpy(cmd->v, v, 4 * sizeof(GLfloat)); 907} 908 909 910/* VertexAttrib4iv: marshalled asynchronously */ 911struct marshal_cmd_VertexAttrib4iv 912{ 913 struct marshal_cmd_base cmd_base; 914 GLuint index; 915 GLint v[4]; 916}; 917uint32_t 918_mesa_unmarshal_VertexAttrib4iv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4iv *cmd, const uint64_t *last) 919{ 920 GLuint index = cmd->index; 921 const GLint * v = cmd->v; 922 CALL_VertexAttrib4iv(ctx->CurrentServerDispatch, (index, v)); 923 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4iv), 8) / 8); 924 assert (cmd_size == cmd->cmd_base.cmd_size); 925 return cmd_size; 926} 927void GLAPIENTRY 928_mesa_marshal_VertexAttrib4iv(GLuint index, const GLint * v) 929{ 930 GET_CURRENT_CONTEXT(ctx); 931 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4iv); 932 struct marshal_cmd_VertexAttrib4iv *cmd; 933 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4iv, cmd_size); 934 cmd->index = index; 935 memcpy(cmd->v, v, 4 * sizeof(GLint)); 936} 937 938 939/* VertexAttrib4s: marshalled asynchronously */ 940struct marshal_cmd_VertexAttrib4s 941{ 942 struct marshal_cmd_base cmd_base; 943 GLshort x; 944 GLshort y; 945 GLshort z; 946 GLshort w; 947 GLuint index; 948}; 949uint32_t 950_mesa_unmarshal_VertexAttrib4s(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4s *cmd, const uint64_t *last) 951{ 952 GLuint index = cmd->index; 953 GLshort x = cmd->x; 954 GLshort y = cmd->y; 955 GLshort z = cmd->z; 956 GLshort w = cmd->w; 957 CALL_VertexAttrib4s(ctx->CurrentServerDispatch, (index, x, y, z, w)); 958 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4s), 8) / 8); 959 assert (cmd_size == cmd->cmd_base.cmd_size); 960 return cmd_size; 961} 962void GLAPIENTRY 963_mesa_marshal_VertexAttrib4s(GLuint index, GLshort x, GLshort y, GLshort z, GLshort w) 964{ 965 GET_CURRENT_CONTEXT(ctx); 966 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4s); 967 struct marshal_cmd_VertexAttrib4s *cmd; 968 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4s, cmd_size); 969 cmd->index = index; 970 cmd->x = x; 971 cmd->y = y; 972 cmd->z = z; 973 cmd->w = w; 974} 975 976 977/* VertexAttrib4sv: marshalled asynchronously */ 978struct marshal_cmd_VertexAttrib4sv 979{ 980 struct marshal_cmd_base cmd_base; 981 GLuint index; 982 GLshort v[4]; 983}; 984uint32_t 985_mesa_unmarshal_VertexAttrib4sv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4sv *cmd, const uint64_t *last) 986{ 987 GLuint index = cmd->index; 988 const GLshort * v = cmd->v; 989 CALL_VertexAttrib4sv(ctx->CurrentServerDispatch, (index, v)); 990 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4sv), 8) / 8); 991 assert (cmd_size == cmd->cmd_base.cmd_size); 992 return cmd_size; 993} 994void GLAPIENTRY 995_mesa_marshal_VertexAttrib4sv(GLuint index, const GLshort * v) 996{ 997 GET_CURRENT_CONTEXT(ctx); 998 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4sv); 999 struct marshal_cmd_VertexAttrib4sv *cmd; 1000 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4sv, cmd_size); 1001 cmd->index = index; 1002 memcpy(cmd->v, v, 4 * sizeof(GLshort)); 1003} 1004 1005 1006/* VertexAttrib4ubv: marshalled asynchronously */ 1007struct marshal_cmd_VertexAttrib4ubv 1008{ 1009 struct marshal_cmd_base cmd_base; 1010 GLuint index; 1011 GLubyte v[4]; 1012}; 1013uint32_t 1014_mesa_unmarshal_VertexAttrib4ubv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4ubv *cmd, const uint64_t *last) 1015{ 1016 GLuint index = cmd->index; 1017 const GLubyte * v = cmd->v; 1018 CALL_VertexAttrib4ubv(ctx->CurrentServerDispatch, (index, v)); 1019 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4ubv), 8) / 8); 1020 assert (cmd_size == cmd->cmd_base.cmd_size); 1021 return cmd_size; 1022} 1023void GLAPIENTRY 1024_mesa_marshal_VertexAttrib4ubv(GLuint index, const GLubyte * v) 1025{ 1026 GET_CURRENT_CONTEXT(ctx); 1027 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4ubv); 1028 struct marshal_cmd_VertexAttrib4ubv *cmd; 1029 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4ubv, cmd_size); 1030 cmd->index = index; 1031 memcpy(cmd->v, v, 4 * sizeof(GLubyte)); 1032} 1033 1034 1035/* VertexAttrib4uiv: marshalled asynchronously */ 1036struct marshal_cmd_VertexAttrib4uiv 1037{ 1038 struct marshal_cmd_base cmd_base; 1039 GLuint index; 1040 GLuint v[4]; 1041}; 1042uint32_t 1043_mesa_unmarshal_VertexAttrib4uiv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4uiv *cmd, const uint64_t *last) 1044{ 1045 GLuint index = cmd->index; 1046 const GLuint * v = cmd->v; 1047 CALL_VertexAttrib4uiv(ctx->CurrentServerDispatch, (index, v)); 1048 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4uiv), 8) / 8); 1049 assert (cmd_size == cmd->cmd_base.cmd_size); 1050 return cmd_size; 1051} 1052void GLAPIENTRY 1053_mesa_marshal_VertexAttrib4uiv(GLuint index, const GLuint * v) 1054{ 1055 GET_CURRENT_CONTEXT(ctx); 1056 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4uiv); 1057 struct marshal_cmd_VertexAttrib4uiv *cmd; 1058 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4uiv, cmd_size); 1059 cmd->index = index; 1060 memcpy(cmd->v, v, 4 * sizeof(GLuint)); 1061} 1062 1063 1064/* VertexAttrib4usv: marshalled asynchronously */ 1065struct marshal_cmd_VertexAttrib4usv 1066{ 1067 struct marshal_cmd_base cmd_base; 1068 GLuint index; 1069 GLushort v[4]; 1070}; 1071uint32_t 1072_mesa_unmarshal_VertexAttrib4usv(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4usv *cmd, const uint64_t *last) 1073{ 1074 GLuint index = cmd->index; 1075 const GLushort * v = cmd->v; 1076 CALL_VertexAttrib4usv(ctx->CurrentServerDispatch, (index, v)); 1077 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4usv), 8) / 8); 1078 assert (cmd_size == cmd->cmd_base.cmd_size); 1079 return cmd_size; 1080} 1081void GLAPIENTRY 1082_mesa_marshal_VertexAttrib4usv(GLuint index, const GLushort * v) 1083{ 1084 GET_CURRENT_CONTEXT(ctx); 1085 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4usv); 1086 struct marshal_cmd_VertexAttrib4usv *cmd; 1087 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4usv, cmd_size); 1088 cmd->index = index; 1089 memcpy(cmd->v, v, 4 * sizeof(GLushort)); 1090} 1091 1092 1093/* VertexAttribPointer: marshalled asynchronously */ 1094struct marshal_cmd_VertexAttribPointer 1095{ 1096 struct marshal_cmd_base cmd_base; 1097 GLboolean normalized; 1098 GLuint index; 1099 GLint size; 1100 GLenum type; 1101 GLsizei stride; 1102 const GLvoid * pointer; 1103}; 1104uint32_t 1105_mesa_unmarshal_VertexAttribPointer(struct gl_context *ctx, const struct marshal_cmd_VertexAttribPointer *cmd, const uint64_t *last) 1106{ 1107 GLuint index = cmd->index; 1108 GLint size = cmd->size; 1109 GLenum type = cmd->type; 1110 GLboolean normalized = cmd->normalized; 1111 GLsizei stride = cmd->stride; 1112 const GLvoid * pointer = cmd->pointer; 1113 CALL_VertexAttribPointer(ctx->CurrentServerDispatch, (index, size, type, normalized, stride, pointer)); 1114 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribPointer), 8) / 8); 1115 assert (cmd_size == cmd->cmd_base.cmd_size); 1116 return cmd_size; 1117} 1118void GLAPIENTRY 1119_mesa_marshal_VertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * pointer) 1120{ 1121 GET_CURRENT_CONTEXT(ctx); 1122 int cmd_size = sizeof(struct marshal_cmd_VertexAttribPointer); 1123 struct marshal_cmd_VertexAttribPointer *cmd; 1124 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribPointer, cmd_size); 1125 cmd->index = index; 1126 cmd->size = size; 1127 cmd->type = type; 1128 cmd->normalized = normalized; 1129 cmd->stride = stride; 1130 cmd->pointer = pointer; 1131 if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_GENERIC(index), size, type, stride, pointer); 1132} 1133 1134 1135/* UniformMatrix2x3fv: marshalled asynchronously */ 1136struct marshal_cmd_UniformMatrix2x3fv 1137{ 1138 struct marshal_cmd_base cmd_base; 1139 GLboolean transpose; 1140 GLint location; 1141 GLsizei count; 1142 /* Next safe_mul(count, 6 * sizeof(GLfloat)) bytes are GLfloat value[count][6] */ 1143}; 1144uint32_t 1145_mesa_unmarshal_UniformMatrix2x3fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2x3fv *cmd, const uint64_t *last) 1146{ 1147 GLint location = cmd->location; 1148 GLsizei count = cmd->count; 1149 GLboolean transpose = cmd->transpose; 1150 GLfloat * value; 1151 const char *variable_data = (const char *) (cmd + 1); 1152 value = (GLfloat *) variable_data; 1153 CALL_UniformMatrix2x3fv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 1154 return cmd->cmd_base.cmd_size; 1155} 1156void GLAPIENTRY 1157_mesa_marshal_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) 1158{ 1159 GET_CURRENT_CONTEXT(ctx); 1160 int value_size = safe_mul(count, 6 * sizeof(GLfloat)); 1161 int cmd_size = sizeof(struct marshal_cmd_UniformMatrix2x3fv) + value_size; 1162 struct marshal_cmd_UniformMatrix2x3fv *cmd; 1163 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 1164 _mesa_glthread_finish_before(ctx, "UniformMatrix2x3fv"); 1165 CALL_UniformMatrix2x3fv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 1166 return; 1167 } 1168 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2x3fv, cmd_size); 1169 cmd->location = location; 1170 cmd->count = count; 1171 cmd->transpose = transpose; 1172 char *variable_data = (char *) (cmd + 1); 1173 memcpy(variable_data, value, value_size); 1174} 1175 1176 1177/* UniformMatrix3x2fv: marshalled asynchronously */ 1178struct marshal_cmd_UniformMatrix3x2fv 1179{ 1180 struct marshal_cmd_base cmd_base; 1181 GLboolean transpose; 1182 GLint location; 1183 GLsizei count; 1184 /* Next safe_mul(count, 6 * sizeof(GLfloat)) bytes are GLfloat value[count][6] */ 1185}; 1186uint32_t 1187_mesa_unmarshal_UniformMatrix3x2fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3x2fv *cmd, const uint64_t *last) 1188{ 1189 GLint location = cmd->location; 1190 GLsizei count = cmd->count; 1191 GLboolean transpose = cmd->transpose; 1192 GLfloat * value; 1193 const char *variable_data = (const char *) (cmd + 1); 1194 value = (GLfloat *) variable_data; 1195 CALL_UniformMatrix3x2fv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 1196 return cmd->cmd_base.cmd_size; 1197} 1198void GLAPIENTRY 1199_mesa_marshal_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) 1200{ 1201 GET_CURRENT_CONTEXT(ctx); 1202 int value_size = safe_mul(count, 6 * sizeof(GLfloat)); 1203 int cmd_size = sizeof(struct marshal_cmd_UniformMatrix3x2fv) + value_size; 1204 struct marshal_cmd_UniformMatrix3x2fv *cmd; 1205 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 1206 _mesa_glthread_finish_before(ctx, "UniformMatrix3x2fv"); 1207 CALL_UniformMatrix3x2fv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 1208 return; 1209 } 1210 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3x2fv, cmd_size); 1211 cmd->location = location; 1212 cmd->count = count; 1213 cmd->transpose = transpose; 1214 char *variable_data = (char *) (cmd + 1); 1215 memcpy(variable_data, value, value_size); 1216} 1217 1218 1219/* UniformMatrix2x4fv: marshalled asynchronously */ 1220struct marshal_cmd_UniformMatrix2x4fv 1221{ 1222 struct marshal_cmd_base cmd_base; 1223 GLboolean transpose; 1224 GLint location; 1225 GLsizei count; 1226 /* Next safe_mul(count, 8 * sizeof(GLfloat)) bytes are GLfloat value[count][8] */ 1227}; 1228uint32_t 1229_mesa_unmarshal_UniformMatrix2x4fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2x4fv *cmd, const uint64_t *last) 1230{ 1231 GLint location = cmd->location; 1232 GLsizei count = cmd->count; 1233 GLboolean transpose = cmd->transpose; 1234 GLfloat * value; 1235 const char *variable_data = (const char *) (cmd + 1); 1236 value = (GLfloat *) variable_data; 1237 CALL_UniformMatrix2x4fv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 1238 return cmd->cmd_base.cmd_size; 1239} 1240void GLAPIENTRY 1241_mesa_marshal_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) 1242{ 1243 GET_CURRENT_CONTEXT(ctx); 1244 int value_size = safe_mul(count, 8 * sizeof(GLfloat)); 1245 int cmd_size = sizeof(struct marshal_cmd_UniformMatrix2x4fv) + value_size; 1246 struct marshal_cmd_UniformMatrix2x4fv *cmd; 1247 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 1248 _mesa_glthread_finish_before(ctx, "UniformMatrix2x4fv"); 1249 CALL_UniformMatrix2x4fv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 1250 return; 1251 } 1252 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2x4fv, cmd_size); 1253 cmd->location = location; 1254 cmd->count = count; 1255 cmd->transpose = transpose; 1256 char *variable_data = (char *) (cmd + 1); 1257 memcpy(variable_data, value, value_size); 1258} 1259 1260 1261/* UniformMatrix4x2fv: marshalled asynchronously */ 1262struct marshal_cmd_UniformMatrix4x2fv 1263{ 1264 struct marshal_cmd_base cmd_base; 1265 GLboolean transpose; 1266 GLint location; 1267 GLsizei count; 1268 /* Next safe_mul(count, 8 * sizeof(GLfloat)) bytes are GLfloat value[count][8] */ 1269}; 1270uint32_t 1271_mesa_unmarshal_UniformMatrix4x2fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4x2fv *cmd, const uint64_t *last) 1272{ 1273 GLint location = cmd->location; 1274 GLsizei count = cmd->count; 1275 GLboolean transpose = cmd->transpose; 1276 GLfloat * value; 1277 const char *variable_data = (const char *) (cmd + 1); 1278 value = (GLfloat *) variable_data; 1279 CALL_UniformMatrix4x2fv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 1280 return cmd->cmd_base.cmd_size; 1281} 1282void GLAPIENTRY 1283_mesa_marshal_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) 1284{ 1285 GET_CURRENT_CONTEXT(ctx); 1286 int value_size = safe_mul(count, 8 * sizeof(GLfloat)); 1287 int cmd_size = sizeof(struct marshal_cmd_UniformMatrix4x2fv) + value_size; 1288 struct marshal_cmd_UniformMatrix4x2fv *cmd; 1289 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 1290 _mesa_glthread_finish_before(ctx, "UniformMatrix4x2fv"); 1291 CALL_UniformMatrix4x2fv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 1292 return; 1293 } 1294 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4x2fv, cmd_size); 1295 cmd->location = location; 1296 cmd->count = count; 1297 cmd->transpose = transpose; 1298 char *variable_data = (char *) (cmd + 1); 1299 memcpy(variable_data, value, value_size); 1300} 1301 1302 1303/* UniformMatrix3x4fv: marshalled asynchronously */ 1304struct marshal_cmd_UniformMatrix3x4fv 1305{ 1306 struct marshal_cmd_base cmd_base; 1307 GLboolean transpose; 1308 GLint location; 1309 GLsizei count; 1310 /* Next safe_mul(count, 12 * sizeof(GLfloat)) bytes are GLfloat value[count][12] */ 1311}; 1312uint32_t 1313_mesa_unmarshal_UniformMatrix3x4fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3x4fv *cmd, const uint64_t *last) 1314{ 1315 GLint location = cmd->location; 1316 GLsizei count = cmd->count; 1317 GLboolean transpose = cmd->transpose; 1318 GLfloat * value; 1319 const char *variable_data = (const char *) (cmd + 1); 1320 value = (GLfloat *) variable_data; 1321 CALL_UniformMatrix3x4fv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 1322 return cmd->cmd_base.cmd_size; 1323} 1324void GLAPIENTRY 1325_mesa_marshal_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) 1326{ 1327 GET_CURRENT_CONTEXT(ctx); 1328 int value_size = safe_mul(count, 12 * sizeof(GLfloat)); 1329 int cmd_size = sizeof(struct marshal_cmd_UniformMatrix3x4fv) + value_size; 1330 struct marshal_cmd_UniformMatrix3x4fv *cmd; 1331 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 1332 _mesa_glthread_finish_before(ctx, "UniformMatrix3x4fv"); 1333 CALL_UniformMatrix3x4fv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 1334 return; 1335 } 1336 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3x4fv, cmd_size); 1337 cmd->location = location; 1338 cmd->count = count; 1339 cmd->transpose = transpose; 1340 char *variable_data = (char *) (cmd + 1); 1341 memcpy(variable_data, value, value_size); 1342} 1343 1344 1345/* UniformMatrix4x3fv: marshalled asynchronously */ 1346struct marshal_cmd_UniformMatrix4x3fv 1347{ 1348 struct marshal_cmd_base cmd_base; 1349 GLboolean transpose; 1350 GLint location; 1351 GLsizei count; 1352 /* Next safe_mul(count, 12 * sizeof(GLfloat)) bytes are GLfloat value[count][12] */ 1353}; 1354uint32_t 1355_mesa_unmarshal_UniformMatrix4x3fv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4x3fv *cmd, const uint64_t *last) 1356{ 1357 GLint location = cmd->location; 1358 GLsizei count = cmd->count; 1359 GLboolean transpose = cmd->transpose; 1360 GLfloat * value; 1361 const char *variable_data = (const char *) (cmd + 1); 1362 value = (GLfloat *) variable_data; 1363 CALL_UniformMatrix4x3fv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 1364 return cmd->cmd_base.cmd_size; 1365} 1366void GLAPIENTRY 1367_mesa_marshal_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat * value) 1368{ 1369 GET_CURRENT_CONTEXT(ctx); 1370 int value_size = safe_mul(count, 12 * sizeof(GLfloat)); 1371 int cmd_size = sizeof(struct marshal_cmd_UniformMatrix4x3fv) + value_size; 1372 struct marshal_cmd_UniformMatrix4x3fv *cmd; 1373 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 1374 _mesa_glthread_finish_before(ctx, "UniformMatrix4x3fv"); 1375 CALL_UniformMatrix4x3fv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 1376 return; 1377 } 1378 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4x3fv, cmd_size); 1379 cmd->location = location; 1380 cmd->count = count; 1381 cmd->transpose = transpose; 1382 char *variable_data = (char *) (cmd + 1); 1383 memcpy(variable_data, value, value_size); 1384} 1385 1386 1387/* ProgramStringARB: marshalled asynchronously */ 1388struct marshal_cmd_ProgramStringARB 1389{ 1390 struct marshal_cmd_base cmd_base; 1391 GLenum target; 1392 GLenum format; 1393 GLsizei len; 1394 /* Next len bytes are GLvoid string[len] */ 1395}; 1396uint32_t 1397_mesa_unmarshal_ProgramStringARB(struct gl_context *ctx, const struct marshal_cmd_ProgramStringARB *cmd, const uint64_t *last) 1398{ 1399 GLenum target = cmd->target; 1400 GLenum format = cmd->format; 1401 GLsizei len = cmd->len; 1402 GLvoid * string; 1403 const char *variable_data = (const char *) (cmd + 1); 1404 string = (GLvoid *) variable_data; 1405 CALL_ProgramStringARB(ctx->CurrentServerDispatch, (target, format, len, string)); 1406 return cmd->cmd_base.cmd_size; 1407} 1408void GLAPIENTRY 1409_mesa_marshal_ProgramStringARB(GLenum target, GLenum format, GLsizei len, const GLvoid * string) 1410{ 1411 GET_CURRENT_CONTEXT(ctx); 1412 int string_size = len; 1413 int cmd_size = sizeof(struct marshal_cmd_ProgramStringARB) + string_size; 1414 struct marshal_cmd_ProgramStringARB *cmd; 1415 if (unlikely(string_size < 0 || (string_size > 0 && !string) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 1416 _mesa_glthread_finish_before(ctx, "ProgramStringARB"); 1417 CALL_ProgramStringARB(ctx->CurrentServerDispatch, (target, format, len, string)); 1418 return; 1419 } 1420 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramStringARB, cmd_size); 1421 cmd->target = target; 1422 cmd->format = format; 1423 cmd->len = len; 1424 char *variable_data = (char *) (cmd + 1); 1425 memcpy(variable_data, string, string_size); 1426} 1427 1428 1429/* BindProgramARB: marshalled asynchronously */ 1430struct marshal_cmd_BindProgramARB 1431{ 1432 struct marshal_cmd_base cmd_base; 1433 GLenum target; 1434 GLuint program; 1435}; 1436uint32_t 1437_mesa_unmarshal_BindProgramARB(struct gl_context *ctx, const struct marshal_cmd_BindProgramARB *cmd, const uint64_t *last) 1438{ 1439 GLenum target = cmd->target; 1440 GLuint program = cmd->program; 1441 CALL_BindProgramARB(ctx->CurrentServerDispatch, (target, program)); 1442 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindProgramARB), 8) / 8); 1443 assert (cmd_size == cmd->cmd_base.cmd_size); 1444 return cmd_size; 1445} 1446void GLAPIENTRY 1447_mesa_marshal_BindProgramARB(GLenum target, GLuint program) 1448{ 1449 GET_CURRENT_CONTEXT(ctx); 1450 int cmd_size = sizeof(struct marshal_cmd_BindProgramARB); 1451 struct marshal_cmd_BindProgramARB *cmd; 1452 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindProgramARB, cmd_size); 1453 cmd->target = target; 1454 cmd->program = program; 1455} 1456 1457 1458/* DeleteProgramsARB: marshalled asynchronously */ 1459struct marshal_cmd_DeleteProgramsARB 1460{ 1461 struct marshal_cmd_base cmd_base; 1462 GLsizei n; 1463 /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint programs[n] */ 1464}; 1465uint32_t 1466_mesa_unmarshal_DeleteProgramsARB(struct gl_context *ctx, const struct marshal_cmd_DeleteProgramsARB *cmd, const uint64_t *last) 1467{ 1468 GLsizei n = cmd->n; 1469 GLuint * programs; 1470 const char *variable_data = (const char *) (cmd + 1); 1471 programs = (GLuint *) variable_data; 1472 CALL_DeleteProgramsARB(ctx->CurrentServerDispatch, (n, programs)); 1473 return cmd->cmd_base.cmd_size; 1474} 1475void GLAPIENTRY 1476_mesa_marshal_DeleteProgramsARB(GLsizei n, const GLuint * programs) 1477{ 1478 GET_CURRENT_CONTEXT(ctx); 1479 int programs_size = safe_mul(n, 1 * sizeof(GLuint)); 1480 int cmd_size = sizeof(struct marshal_cmd_DeleteProgramsARB) + programs_size; 1481 struct marshal_cmd_DeleteProgramsARB *cmd; 1482 if (unlikely(programs_size < 0 || (programs_size > 0 && !programs) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 1483 _mesa_glthread_finish_before(ctx, "DeleteProgramsARB"); 1484 CALL_DeleteProgramsARB(ctx->CurrentServerDispatch, (n, programs)); 1485 return; 1486 } 1487 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteProgramsARB, cmd_size); 1488 cmd->n = n; 1489 char *variable_data = (char *) (cmd + 1); 1490 memcpy(variable_data, programs, programs_size); 1491} 1492 1493 1494/* GenProgramsARB: marshalled synchronously */ 1495void GLAPIENTRY 1496_mesa_marshal_GenProgramsARB(GLsizei n, GLuint * programs) 1497{ 1498 GET_CURRENT_CONTEXT(ctx); 1499 _mesa_glthread_finish_before(ctx, "GenProgramsARB"); 1500 CALL_GenProgramsARB(ctx->CurrentServerDispatch, (n, programs)); 1501} 1502 1503 1504/* IsProgramARB: marshalled synchronously */ 1505GLboolean GLAPIENTRY 1506_mesa_marshal_IsProgramARB(GLuint program) 1507{ 1508 GET_CURRENT_CONTEXT(ctx); 1509 _mesa_glthread_finish_before(ctx, "IsProgramARB"); 1510 return CALL_IsProgramARB(ctx->CurrentServerDispatch, (program)); 1511} 1512 1513 1514/* ProgramEnvParameter4dARB: marshalled asynchronously */ 1515struct marshal_cmd_ProgramEnvParameter4dARB 1516{ 1517 struct marshal_cmd_base cmd_base; 1518 GLenum target; 1519 GLuint index; 1520 GLdouble x; 1521 GLdouble y; 1522 GLdouble z; 1523 GLdouble w; 1524}; 1525uint32_t 1526_mesa_unmarshal_ProgramEnvParameter4dARB(struct gl_context *ctx, const struct marshal_cmd_ProgramEnvParameter4dARB *cmd, const uint64_t *last) 1527{ 1528 GLenum target = cmd->target; 1529 GLuint index = cmd->index; 1530 GLdouble x = cmd->x; 1531 GLdouble y = cmd->y; 1532 GLdouble z = cmd->z; 1533 GLdouble w = cmd->w; 1534 CALL_ProgramEnvParameter4dARB(ctx->CurrentServerDispatch, (target, index, x, y, z, w)); 1535 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramEnvParameter4dARB), 8) / 8); 1536 assert (cmd_size == cmd->cmd_base.cmd_size); 1537 return cmd_size; 1538} 1539void GLAPIENTRY 1540_mesa_marshal_ProgramEnvParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) 1541{ 1542 GET_CURRENT_CONTEXT(ctx); 1543 int cmd_size = sizeof(struct marshal_cmd_ProgramEnvParameter4dARB); 1544 struct marshal_cmd_ProgramEnvParameter4dARB *cmd; 1545 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramEnvParameter4dARB, cmd_size); 1546 cmd->target = target; 1547 cmd->index = index; 1548 cmd->x = x; 1549 cmd->y = y; 1550 cmd->z = z; 1551 cmd->w = w; 1552} 1553 1554 1555/* ProgramEnvParameter4dvARB: marshalled asynchronously */ 1556struct marshal_cmd_ProgramEnvParameter4dvARB 1557{ 1558 struct marshal_cmd_base cmd_base; 1559 GLenum target; 1560 GLuint index; 1561 GLdouble params[4]; 1562}; 1563uint32_t 1564_mesa_unmarshal_ProgramEnvParameter4dvARB(struct gl_context *ctx, const struct marshal_cmd_ProgramEnvParameter4dvARB *cmd, const uint64_t *last) 1565{ 1566 GLenum target = cmd->target; 1567 GLuint index = cmd->index; 1568 const GLdouble * params = cmd->params; 1569 CALL_ProgramEnvParameter4dvARB(ctx->CurrentServerDispatch, (target, index, params)); 1570 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramEnvParameter4dvARB), 8) / 8); 1571 assert (cmd_size == cmd->cmd_base.cmd_size); 1572 return cmd_size; 1573} 1574void GLAPIENTRY 1575_mesa_marshal_ProgramEnvParameter4dvARB(GLenum target, GLuint index, const GLdouble * params) 1576{ 1577 GET_CURRENT_CONTEXT(ctx); 1578 int cmd_size = sizeof(struct marshal_cmd_ProgramEnvParameter4dvARB); 1579 struct marshal_cmd_ProgramEnvParameter4dvARB *cmd; 1580 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramEnvParameter4dvARB, cmd_size); 1581 cmd->target = target; 1582 cmd->index = index; 1583 memcpy(cmd->params, params, 4 * sizeof(GLdouble)); 1584} 1585 1586 1587/* ProgramEnvParameter4fARB: marshalled asynchronously */ 1588struct marshal_cmd_ProgramEnvParameter4fARB 1589{ 1590 struct marshal_cmd_base cmd_base; 1591 GLenum target; 1592 GLuint index; 1593 GLfloat x; 1594 GLfloat y; 1595 GLfloat z; 1596 GLfloat w; 1597}; 1598uint32_t 1599_mesa_unmarshal_ProgramEnvParameter4fARB(struct gl_context *ctx, const struct marshal_cmd_ProgramEnvParameter4fARB *cmd, const uint64_t *last) 1600{ 1601 GLenum target = cmd->target; 1602 GLuint index = cmd->index; 1603 GLfloat x = cmd->x; 1604 GLfloat y = cmd->y; 1605 GLfloat z = cmd->z; 1606 GLfloat w = cmd->w; 1607 CALL_ProgramEnvParameter4fARB(ctx->CurrentServerDispatch, (target, index, x, y, z, w)); 1608 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramEnvParameter4fARB), 8) / 8); 1609 assert (cmd_size == cmd->cmd_base.cmd_size); 1610 return cmd_size; 1611} 1612void GLAPIENTRY 1613_mesa_marshal_ProgramEnvParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) 1614{ 1615 GET_CURRENT_CONTEXT(ctx); 1616 int cmd_size = sizeof(struct marshal_cmd_ProgramEnvParameter4fARB); 1617 struct marshal_cmd_ProgramEnvParameter4fARB *cmd; 1618 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramEnvParameter4fARB, cmd_size); 1619 cmd->target = target; 1620 cmd->index = index; 1621 cmd->x = x; 1622 cmd->y = y; 1623 cmd->z = z; 1624 cmd->w = w; 1625} 1626 1627 1628/* ProgramEnvParameter4fvARB: marshalled asynchronously */ 1629struct marshal_cmd_ProgramEnvParameter4fvARB 1630{ 1631 struct marshal_cmd_base cmd_base; 1632 GLenum target; 1633 GLuint index; 1634 GLfloat params[4]; 1635}; 1636uint32_t 1637_mesa_unmarshal_ProgramEnvParameter4fvARB(struct gl_context *ctx, const struct marshal_cmd_ProgramEnvParameter4fvARB *cmd, const uint64_t *last) 1638{ 1639 GLenum target = cmd->target; 1640 GLuint index = cmd->index; 1641 const GLfloat * params = cmd->params; 1642 CALL_ProgramEnvParameter4fvARB(ctx->CurrentServerDispatch, (target, index, params)); 1643 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramEnvParameter4fvARB), 8) / 8); 1644 assert (cmd_size == cmd->cmd_base.cmd_size); 1645 return cmd_size; 1646} 1647void GLAPIENTRY 1648_mesa_marshal_ProgramEnvParameter4fvARB(GLenum target, GLuint index, const GLfloat * params) 1649{ 1650 GET_CURRENT_CONTEXT(ctx); 1651 int cmd_size = sizeof(struct marshal_cmd_ProgramEnvParameter4fvARB); 1652 struct marshal_cmd_ProgramEnvParameter4fvARB *cmd; 1653 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramEnvParameter4fvARB, cmd_size); 1654 cmd->target = target; 1655 cmd->index = index; 1656 memcpy(cmd->params, params, 4 * sizeof(GLfloat)); 1657} 1658 1659 1660/* ProgramLocalParameter4dARB: marshalled asynchronously */ 1661struct marshal_cmd_ProgramLocalParameter4dARB 1662{ 1663 struct marshal_cmd_base cmd_base; 1664 GLenum target; 1665 GLuint index; 1666 GLdouble x; 1667 GLdouble y; 1668 GLdouble z; 1669 GLdouble w; 1670}; 1671uint32_t 1672_mesa_unmarshal_ProgramLocalParameter4dARB(struct gl_context *ctx, const struct marshal_cmd_ProgramLocalParameter4dARB *cmd, const uint64_t *last) 1673{ 1674 GLenum target = cmd->target; 1675 GLuint index = cmd->index; 1676 GLdouble x = cmd->x; 1677 GLdouble y = cmd->y; 1678 GLdouble z = cmd->z; 1679 GLdouble w = cmd->w; 1680 CALL_ProgramLocalParameter4dARB(ctx->CurrentServerDispatch, (target, index, x, y, z, w)); 1681 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramLocalParameter4dARB), 8) / 8); 1682 assert (cmd_size == cmd->cmd_base.cmd_size); 1683 return cmd_size; 1684} 1685void GLAPIENTRY 1686_mesa_marshal_ProgramLocalParameter4dARB(GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) 1687{ 1688 GET_CURRENT_CONTEXT(ctx); 1689 int cmd_size = sizeof(struct marshal_cmd_ProgramLocalParameter4dARB); 1690 struct marshal_cmd_ProgramLocalParameter4dARB *cmd; 1691 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramLocalParameter4dARB, cmd_size); 1692 cmd->target = target; 1693 cmd->index = index; 1694 cmd->x = x; 1695 cmd->y = y; 1696 cmd->z = z; 1697 cmd->w = w; 1698} 1699 1700 1701/* ProgramLocalParameter4dvARB: marshalled asynchronously */ 1702struct marshal_cmd_ProgramLocalParameter4dvARB 1703{ 1704 struct marshal_cmd_base cmd_base; 1705 GLenum target; 1706 GLuint index; 1707 GLdouble params[4]; 1708}; 1709uint32_t 1710_mesa_unmarshal_ProgramLocalParameter4dvARB(struct gl_context *ctx, const struct marshal_cmd_ProgramLocalParameter4dvARB *cmd, const uint64_t *last) 1711{ 1712 GLenum target = cmd->target; 1713 GLuint index = cmd->index; 1714 const GLdouble * params = cmd->params; 1715 CALL_ProgramLocalParameter4dvARB(ctx->CurrentServerDispatch, (target, index, params)); 1716 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramLocalParameter4dvARB), 8) / 8); 1717 assert (cmd_size == cmd->cmd_base.cmd_size); 1718 return cmd_size; 1719} 1720void GLAPIENTRY 1721_mesa_marshal_ProgramLocalParameter4dvARB(GLenum target, GLuint index, const GLdouble * params) 1722{ 1723 GET_CURRENT_CONTEXT(ctx); 1724 int cmd_size = sizeof(struct marshal_cmd_ProgramLocalParameter4dvARB); 1725 struct marshal_cmd_ProgramLocalParameter4dvARB *cmd; 1726 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramLocalParameter4dvARB, cmd_size); 1727 cmd->target = target; 1728 cmd->index = index; 1729 memcpy(cmd->params, params, 4 * sizeof(GLdouble)); 1730} 1731 1732 1733/* ProgramLocalParameter4fARB: marshalled asynchronously */ 1734struct marshal_cmd_ProgramLocalParameter4fARB 1735{ 1736 struct marshal_cmd_base cmd_base; 1737 GLenum target; 1738 GLuint index; 1739 GLfloat x; 1740 GLfloat y; 1741 GLfloat z; 1742 GLfloat w; 1743}; 1744uint32_t 1745_mesa_unmarshal_ProgramLocalParameter4fARB(struct gl_context *ctx, const struct marshal_cmd_ProgramLocalParameter4fARB *cmd, const uint64_t *last) 1746{ 1747 GLenum target = cmd->target; 1748 GLuint index = cmd->index; 1749 GLfloat x = cmd->x; 1750 GLfloat y = cmd->y; 1751 GLfloat z = cmd->z; 1752 GLfloat w = cmd->w; 1753 CALL_ProgramLocalParameter4fARB(ctx->CurrentServerDispatch, (target, index, x, y, z, w)); 1754 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramLocalParameter4fARB), 8) / 8); 1755 assert (cmd_size == cmd->cmd_base.cmd_size); 1756 return cmd_size; 1757} 1758void GLAPIENTRY 1759_mesa_marshal_ProgramLocalParameter4fARB(GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) 1760{ 1761 GET_CURRENT_CONTEXT(ctx); 1762 int cmd_size = sizeof(struct marshal_cmd_ProgramLocalParameter4fARB); 1763 struct marshal_cmd_ProgramLocalParameter4fARB *cmd; 1764 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramLocalParameter4fARB, cmd_size); 1765 cmd->target = target; 1766 cmd->index = index; 1767 cmd->x = x; 1768 cmd->y = y; 1769 cmd->z = z; 1770 cmd->w = w; 1771} 1772 1773 1774/* ProgramLocalParameter4fvARB: marshalled asynchronously */ 1775struct marshal_cmd_ProgramLocalParameter4fvARB 1776{ 1777 struct marshal_cmd_base cmd_base; 1778 GLenum target; 1779 GLuint index; 1780 GLfloat params[4]; 1781}; 1782uint32_t 1783_mesa_unmarshal_ProgramLocalParameter4fvARB(struct gl_context *ctx, const struct marshal_cmd_ProgramLocalParameter4fvARB *cmd, const uint64_t *last) 1784{ 1785 GLenum target = cmd->target; 1786 GLuint index = cmd->index; 1787 const GLfloat * params = cmd->params; 1788 CALL_ProgramLocalParameter4fvARB(ctx->CurrentServerDispatch, (target, index, params)); 1789 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramLocalParameter4fvARB), 8) / 8); 1790 assert (cmd_size == cmd->cmd_base.cmd_size); 1791 return cmd_size; 1792} 1793void GLAPIENTRY 1794_mesa_marshal_ProgramLocalParameter4fvARB(GLenum target, GLuint index, const GLfloat * params) 1795{ 1796 GET_CURRENT_CONTEXT(ctx); 1797 int cmd_size = sizeof(struct marshal_cmd_ProgramLocalParameter4fvARB); 1798 struct marshal_cmd_ProgramLocalParameter4fvARB *cmd; 1799 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramLocalParameter4fvARB, cmd_size); 1800 cmd->target = target; 1801 cmd->index = index; 1802 memcpy(cmd->params, params, 4 * sizeof(GLfloat)); 1803} 1804 1805 1806/* GetProgramEnvParameterdvARB: marshalled synchronously */ 1807void GLAPIENTRY 1808_mesa_marshal_GetProgramEnvParameterdvARB(GLenum target, GLuint index, GLdouble * params) 1809{ 1810 GET_CURRENT_CONTEXT(ctx); 1811 _mesa_glthread_finish_before(ctx, "GetProgramEnvParameterdvARB"); 1812 CALL_GetProgramEnvParameterdvARB(ctx->CurrentServerDispatch, (target, index, params)); 1813} 1814 1815 1816/* GetProgramEnvParameterfvARB: marshalled synchronously */ 1817void GLAPIENTRY 1818_mesa_marshal_GetProgramEnvParameterfvARB(GLenum target, GLuint index, GLfloat * params) 1819{ 1820 GET_CURRENT_CONTEXT(ctx); 1821 _mesa_glthread_finish_before(ctx, "GetProgramEnvParameterfvARB"); 1822 CALL_GetProgramEnvParameterfvARB(ctx->CurrentServerDispatch, (target, index, params)); 1823} 1824 1825 1826/* GetProgramLocalParameterdvARB: marshalled synchronously */ 1827void GLAPIENTRY 1828_mesa_marshal_GetProgramLocalParameterdvARB(GLenum target, GLuint index, GLdouble * params) 1829{ 1830 GET_CURRENT_CONTEXT(ctx); 1831 _mesa_glthread_finish_before(ctx, "GetProgramLocalParameterdvARB"); 1832 CALL_GetProgramLocalParameterdvARB(ctx->CurrentServerDispatch, (target, index, params)); 1833} 1834 1835 1836/* GetProgramLocalParameterfvARB: marshalled synchronously */ 1837void GLAPIENTRY 1838_mesa_marshal_GetProgramLocalParameterfvARB(GLenum target, GLuint index, GLfloat * params) 1839{ 1840 GET_CURRENT_CONTEXT(ctx); 1841 _mesa_glthread_finish_before(ctx, "GetProgramLocalParameterfvARB"); 1842 CALL_GetProgramLocalParameterfvARB(ctx->CurrentServerDispatch, (target, index, params)); 1843} 1844 1845 1846/* GetProgramivARB: marshalled synchronously */ 1847void GLAPIENTRY 1848_mesa_marshal_GetProgramivARB(GLenum target, GLenum pname, GLint * params) 1849{ 1850 GET_CURRENT_CONTEXT(ctx); 1851 _mesa_glthread_finish_before(ctx, "GetProgramivARB"); 1852 CALL_GetProgramivARB(ctx->CurrentServerDispatch, (target, pname, params)); 1853} 1854 1855 1856/* GetProgramStringARB: marshalled synchronously */ 1857void GLAPIENTRY 1858_mesa_marshal_GetProgramStringARB(GLenum target, GLenum pname, GLvoid * string) 1859{ 1860 GET_CURRENT_CONTEXT(ctx); 1861 _mesa_glthread_finish_before(ctx, "GetProgramStringARB"); 1862 CALL_GetProgramStringARB(ctx->CurrentServerDispatch, (target, pname, string)); 1863} 1864 1865 1866/* DeleteObjectARB: marshalled asynchronously */ 1867struct marshal_cmd_DeleteObjectARB 1868{ 1869 struct marshal_cmd_base cmd_base; 1870 GLhandleARB obj; 1871}; 1872uint32_t 1873_mesa_unmarshal_DeleteObjectARB(struct gl_context *ctx, const struct marshal_cmd_DeleteObjectARB *cmd, const uint64_t *last) 1874{ 1875 GLhandleARB obj = cmd->obj; 1876 CALL_DeleteObjectARB(ctx->CurrentServerDispatch, (obj)); 1877 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DeleteObjectARB), 8) / 8); 1878 assert (cmd_size == cmd->cmd_base.cmd_size); 1879 return cmd_size; 1880} 1881void GLAPIENTRY 1882_mesa_marshal_DeleteObjectARB(GLhandleARB obj) 1883{ 1884 GET_CURRENT_CONTEXT(ctx); 1885 int cmd_size = sizeof(struct marshal_cmd_DeleteObjectARB); 1886 struct marshal_cmd_DeleteObjectARB *cmd; 1887 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteObjectARB, cmd_size); 1888 cmd->obj = obj; 1889 _mesa_glthread_ProgramChanged(ctx); 1890} 1891 1892 1893/* GetHandleARB: marshalled synchronously */ 1894GLhandleARB GLAPIENTRY 1895_mesa_marshal_GetHandleARB(GLenum pname) 1896{ 1897 GET_CURRENT_CONTEXT(ctx); 1898 _mesa_glthread_finish_before(ctx, "GetHandleARB"); 1899 return CALL_GetHandleARB(ctx->CurrentServerDispatch, (pname)); 1900} 1901 1902 1903/* DetachObjectARB: marshalled asynchronously */ 1904struct marshal_cmd_DetachObjectARB 1905{ 1906 struct marshal_cmd_base cmd_base; 1907 GLhandleARB containerObj; 1908 GLhandleARB attachedObj; 1909}; 1910uint32_t 1911_mesa_unmarshal_DetachObjectARB(struct gl_context *ctx, const struct marshal_cmd_DetachObjectARB *cmd, const uint64_t *last) 1912{ 1913 GLhandleARB containerObj = cmd->containerObj; 1914 GLhandleARB attachedObj = cmd->attachedObj; 1915 CALL_DetachObjectARB(ctx->CurrentServerDispatch, (containerObj, attachedObj)); 1916 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DetachObjectARB), 8) / 8); 1917 assert (cmd_size == cmd->cmd_base.cmd_size); 1918 return cmd_size; 1919} 1920void GLAPIENTRY 1921_mesa_marshal_DetachObjectARB(GLhandleARB containerObj, GLhandleARB attachedObj) 1922{ 1923 GET_CURRENT_CONTEXT(ctx); 1924 int cmd_size = sizeof(struct marshal_cmd_DetachObjectARB); 1925 struct marshal_cmd_DetachObjectARB *cmd; 1926 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DetachObjectARB, cmd_size); 1927 cmd->containerObj = containerObj; 1928 cmd->attachedObj = attachedObj; 1929} 1930 1931 1932/* CreateShaderObjectARB: marshalled synchronously */ 1933GLhandleARB GLAPIENTRY 1934_mesa_marshal_CreateShaderObjectARB(GLenum shaderType) 1935{ 1936 GET_CURRENT_CONTEXT(ctx); 1937 _mesa_glthread_finish_before(ctx, "CreateShaderObjectARB"); 1938 return CALL_CreateShaderObjectARB(ctx->CurrentServerDispatch, (shaderType)); 1939} 1940 1941 1942/* CreateProgramObjectARB: marshalled synchronously */ 1943GLhandleARB GLAPIENTRY 1944_mesa_marshal_CreateProgramObjectARB(void) 1945{ 1946 GET_CURRENT_CONTEXT(ctx); 1947 _mesa_glthread_finish_before(ctx, "CreateProgramObjectARB"); 1948 return CALL_CreateProgramObjectARB(ctx->CurrentServerDispatch, ()); 1949} 1950 1951 1952/* AttachObjectARB: marshalled asynchronously */ 1953struct marshal_cmd_AttachObjectARB 1954{ 1955 struct marshal_cmd_base cmd_base; 1956 GLhandleARB containerObj; 1957 GLhandleARB obj; 1958}; 1959uint32_t 1960_mesa_unmarshal_AttachObjectARB(struct gl_context *ctx, const struct marshal_cmd_AttachObjectARB *cmd, const uint64_t *last) 1961{ 1962 GLhandleARB containerObj = cmd->containerObj; 1963 GLhandleARB obj = cmd->obj; 1964 CALL_AttachObjectARB(ctx->CurrentServerDispatch, (containerObj, obj)); 1965 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_AttachObjectARB), 8) / 8); 1966 assert (cmd_size == cmd->cmd_base.cmd_size); 1967 return cmd_size; 1968} 1969void GLAPIENTRY 1970_mesa_marshal_AttachObjectARB(GLhandleARB containerObj, GLhandleARB obj) 1971{ 1972 GET_CURRENT_CONTEXT(ctx); 1973 int cmd_size = sizeof(struct marshal_cmd_AttachObjectARB); 1974 struct marshal_cmd_AttachObjectARB *cmd; 1975 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_AttachObjectARB, cmd_size); 1976 cmd->containerObj = containerObj; 1977 cmd->obj = obj; 1978} 1979 1980 1981/* GetObjectParameterfvARB: marshalled synchronously */ 1982void GLAPIENTRY 1983_mesa_marshal_GetObjectParameterfvARB(GLhandleARB obj, GLenum pname, GLfloat * params) 1984{ 1985 GET_CURRENT_CONTEXT(ctx); 1986 _mesa_glthread_finish_before(ctx, "GetObjectParameterfvARB"); 1987 CALL_GetObjectParameterfvARB(ctx->CurrentServerDispatch, (obj, pname, params)); 1988} 1989 1990 1991/* GetObjectParameterivARB: marshalled synchronously */ 1992void GLAPIENTRY 1993_mesa_marshal_GetObjectParameterivARB(GLhandleARB obj, GLenum pname, GLint * params) 1994{ 1995 GET_CURRENT_CONTEXT(ctx); 1996 _mesa_glthread_finish_before(ctx, "GetObjectParameterivARB"); 1997 CALL_GetObjectParameterivARB(ctx->CurrentServerDispatch, (obj, pname, params)); 1998} 1999 2000 2001/* GetInfoLogARB: marshalled synchronously */ 2002void GLAPIENTRY 2003_mesa_marshal_GetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog) 2004{ 2005 GET_CURRENT_CONTEXT(ctx); 2006 _mesa_glthread_finish_before(ctx, "GetInfoLogARB"); 2007 CALL_GetInfoLogARB(ctx->CurrentServerDispatch, (obj, maxLength, length, infoLog)); 2008} 2009 2010 2011/* GetAttachedObjectsARB: marshalled synchronously */ 2012void GLAPIENTRY 2013_mesa_marshal_GetAttachedObjectsARB(GLhandleARB containerObj, GLsizei maxLength, GLsizei * length, GLhandleARB * infoLog) 2014{ 2015 GET_CURRENT_CONTEXT(ctx); 2016 _mesa_glthread_finish_before(ctx, "GetAttachedObjectsARB"); 2017 CALL_GetAttachedObjectsARB(ctx->CurrentServerDispatch, (containerObj, maxLength, length, infoLog)); 2018} 2019 2020 2021/* ClampColor: marshalled asynchronously */ 2022struct marshal_cmd_ClampColor 2023{ 2024 struct marshal_cmd_base cmd_base; 2025 GLenum target; 2026 GLenum clamp; 2027}; 2028uint32_t 2029_mesa_unmarshal_ClampColor(struct gl_context *ctx, const struct marshal_cmd_ClampColor *cmd, const uint64_t *last) 2030{ 2031 GLenum target = cmd->target; 2032 GLenum clamp = cmd->clamp; 2033 CALL_ClampColor(ctx->CurrentServerDispatch, (target, clamp)); 2034 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ClampColor), 8) / 8); 2035 assert (cmd_size == cmd->cmd_base.cmd_size); 2036 return cmd_size; 2037} 2038void GLAPIENTRY 2039_mesa_marshal_ClampColor(GLenum target, GLenum clamp) 2040{ 2041 GET_CURRENT_CONTEXT(ctx); 2042 int cmd_size = sizeof(struct marshal_cmd_ClampColor); 2043 struct marshal_cmd_ClampColor *cmd; 2044 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClampColor, cmd_size); 2045 cmd->target = target; 2046 cmd->clamp = clamp; 2047} 2048 2049 2050/* IsRenderbuffer: marshalled synchronously */ 2051GLboolean GLAPIENTRY 2052_mesa_marshal_IsRenderbuffer(GLuint renderbuffer) 2053{ 2054 GET_CURRENT_CONTEXT(ctx); 2055 _mesa_glthread_finish_before(ctx, "IsRenderbuffer"); 2056 return CALL_IsRenderbuffer(ctx->CurrentServerDispatch, (renderbuffer)); 2057} 2058 2059 2060/* BindRenderbuffer: marshalled asynchronously */ 2061struct marshal_cmd_BindRenderbuffer 2062{ 2063 struct marshal_cmd_base cmd_base; 2064 GLenum target; 2065 GLuint renderbuffer; 2066}; 2067uint32_t 2068_mesa_unmarshal_BindRenderbuffer(struct gl_context *ctx, const struct marshal_cmd_BindRenderbuffer *cmd, const uint64_t *last) 2069{ 2070 GLenum target = cmd->target; 2071 GLuint renderbuffer = cmd->renderbuffer; 2072 CALL_BindRenderbuffer(ctx->CurrentServerDispatch, (target, renderbuffer)); 2073 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindRenderbuffer), 8) / 8); 2074 assert (cmd_size == cmd->cmd_base.cmd_size); 2075 return cmd_size; 2076} 2077void GLAPIENTRY 2078_mesa_marshal_BindRenderbuffer(GLenum target, GLuint renderbuffer) 2079{ 2080 GET_CURRENT_CONTEXT(ctx); 2081 int cmd_size = sizeof(struct marshal_cmd_BindRenderbuffer); 2082 struct marshal_cmd_BindRenderbuffer *cmd; 2083 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindRenderbuffer, cmd_size); 2084 cmd->target = target; 2085 cmd->renderbuffer = renderbuffer; 2086} 2087 2088 2089/* DeleteRenderbuffers: marshalled asynchronously */ 2090struct marshal_cmd_DeleteRenderbuffers 2091{ 2092 struct marshal_cmd_base cmd_base; 2093 GLsizei n; 2094 /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint renderbuffers[n] */ 2095}; 2096uint32_t 2097_mesa_unmarshal_DeleteRenderbuffers(struct gl_context *ctx, const struct marshal_cmd_DeleteRenderbuffers *cmd, const uint64_t *last) 2098{ 2099 GLsizei n = cmd->n; 2100 GLuint * renderbuffers; 2101 const char *variable_data = (const char *) (cmd + 1); 2102 renderbuffers = (GLuint *) variable_data; 2103 CALL_DeleteRenderbuffers(ctx->CurrentServerDispatch, (n, renderbuffers)); 2104 return cmd->cmd_base.cmd_size; 2105} 2106void GLAPIENTRY 2107_mesa_marshal_DeleteRenderbuffers(GLsizei n, const GLuint * renderbuffers) 2108{ 2109 GET_CURRENT_CONTEXT(ctx); 2110 int renderbuffers_size = safe_mul(n, 1 * sizeof(GLuint)); 2111 int cmd_size = sizeof(struct marshal_cmd_DeleteRenderbuffers) + renderbuffers_size; 2112 struct marshal_cmd_DeleteRenderbuffers *cmd; 2113 if (unlikely(renderbuffers_size < 0 || (renderbuffers_size > 0 && !renderbuffers) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 2114 _mesa_glthread_finish_before(ctx, "DeleteRenderbuffers"); 2115 CALL_DeleteRenderbuffers(ctx->CurrentServerDispatch, (n, renderbuffers)); 2116 return; 2117 } 2118 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteRenderbuffers, cmd_size); 2119 cmd->n = n; 2120 char *variable_data = (char *) (cmd + 1); 2121 memcpy(variable_data, renderbuffers, renderbuffers_size); 2122} 2123 2124 2125/* GenRenderbuffers: marshalled synchronously */ 2126void GLAPIENTRY 2127_mesa_marshal_GenRenderbuffers(GLsizei n, GLuint * renderbuffers) 2128{ 2129 GET_CURRENT_CONTEXT(ctx); 2130 _mesa_glthread_finish_before(ctx, "GenRenderbuffers"); 2131 CALL_GenRenderbuffers(ctx->CurrentServerDispatch, (n, renderbuffers)); 2132} 2133 2134 2135/* RenderbufferStorage: marshalled asynchronously */ 2136struct marshal_cmd_RenderbufferStorage 2137{ 2138 struct marshal_cmd_base cmd_base; 2139 GLenum target; 2140 GLenum internalformat; 2141 GLsizei width; 2142 GLsizei height; 2143}; 2144uint32_t 2145_mesa_unmarshal_RenderbufferStorage(struct gl_context *ctx, const struct marshal_cmd_RenderbufferStorage *cmd, const uint64_t *last) 2146{ 2147 GLenum target = cmd->target; 2148 GLenum internalformat = cmd->internalformat; 2149 GLsizei width = cmd->width; 2150 GLsizei height = cmd->height; 2151 CALL_RenderbufferStorage(ctx->CurrentServerDispatch, (target, internalformat, width, height)); 2152 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_RenderbufferStorage), 8) / 8); 2153 assert (cmd_size == cmd->cmd_base.cmd_size); 2154 return cmd_size; 2155} 2156void GLAPIENTRY 2157_mesa_marshal_RenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) 2158{ 2159 GET_CURRENT_CONTEXT(ctx); 2160 int cmd_size = sizeof(struct marshal_cmd_RenderbufferStorage); 2161 struct marshal_cmd_RenderbufferStorage *cmd; 2162 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RenderbufferStorage, cmd_size); 2163 cmd->target = target; 2164 cmd->internalformat = internalformat; 2165 cmd->width = width; 2166 cmd->height = height; 2167} 2168 2169 2170/* RenderbufferStorageMultisample: marshalled asynchronously */ 2171struct marshal_cmd_RenderbufferStorageMultisample 2172{ 2173 struct marshal_cmd_base cmd_base; 2174 GLenum target; 2175 GLsizei samples; 2176 GLenum internalformat; 2177 GLsizei width; 2178 GLsizei height; 2179}; 2180uint32_t 2181_mesa_unmarshal_RenderbufferStorageMultisample(struct gl_context *ctx, const struct marshal_cmd_RenderbufferStorageMultisample *cmd, const uint64_t *last) 2182{ 2183 GLenum target = cmd->target; 2184 GLsizei samples = cmd->samples; 2185 GLenum internalformat = cmd->internalformat; 2186 GLsizei width = cmd->width; 2187 GLsizei height = cmd->height; 2188 CALL_RenderbufferStorageMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height)); 2189 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_RenderbufferStorageMultisample), 8) / 8); 2190 assert (cmd_size == cmd->cmd_base.cmd_size); 2191 return cmd_size; 2192} 2193void GLAPIENTRY 2194_mesa_marshal_RenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) 2195{ 2196 GET_CURRENT_CONTEXT(ctx); 2197 int cmd_size = sizeof(struct marshal_cmd_RenderbufferStorageMultisample); 2198 struct marshal_cmd_RenderbufferStorageMultisample *cmd; 2199 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RenderbufferStorageMultisample, cmd_size); 2200 cmd->target = target; 2201 cmd->samples = samples; 2202 cmd->internalformat = internalformat; 2203 cmd->width = width; 2204 cmd->height = height; 2205} 2206 2207 2208/* GetRenderbufferParameteriv: marshalled synchronously */ 2209void GLAPIENTRY 2210_mesa_marshal_GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint * params) 2211{ 2212 GET_CURRENT_CONTEXT(ctx); 2213 _mesa_glthread_finish_before(ctx, "GetRenderbufferParameteriv"); 2214 CALL_GetRenderbufferParameteriv(ctx->CurrentServerDispatch, (target, pname, params)); 2215} 2216 2217 2218/* IsFramebuffer: marshalled synchronously */ 2219GLboolean GLAPIENTRY 2220_mesa_marshal_IsFramebuffer(GLuint framebuffer) 2221{ 2222 GET_CURRENT_CONTEXT(ctx); 2223 _mesa_glthread_finish_before(ctx, "IsFramebuffer"); 2224 return CALL_IsFramebuffer(ctx->CurrentServerDispatch, (framebuffer)); 2225} 2226 2227 2228/* BindFramebuffer: marshalled asynchronously */ 2229struct marshal_cmd_BindFramebuffer 2230{ 2231 struct marshal_cmd_base cmd_base; 2232 GLenum target; 2233 GLuint framebuffer; 2234}; 2235uint32_t 2236_mesa_unmarshal_BindFramebuffer(struct gl_context *ctx, const struct marshal_cmd_BindFramebuffer *cmd, const uint64_t *last) 2237{ 2238 GLenum target = cmd->target; 2239 GLuint framebuffer = cmd->framebuffer; 2240 CALL_BindFramebuffer(ctx->CurrentServerDispatch, (target, framebuffer)); 2241 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindFramebuffer), 8) / 8); 2242 assert (cmd_size == cmd->cmd_base.cmd_size); 2243 return cmd_size; 2244} 2245void GLAPIENTRY 2246_mesa_marshal_BindFramebuffer(GLenum target, GLuint framebuffer) 2247{ 2248 GET_CURRENT_CONTEXT(ctx); 2249 int cmd_size = sizeof(struct marshal_cmd_BindFramebuffer); 2250 struct marshal_cmd_BindFramebuffer *cmd; 2251 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindFramebuffer, cmd_size); 2252 cmd->target = target; 2253 cmd->framebuffer = framebuffer; 2254} 2255 2256 2257/* DeleteFramebuffers: marshalled asynchronously */ 2258struct marshal_cmd_DeleteFramebuffers 2259{ 2260 struct marshal_cmd_base cmd_base; 2261 GLsizei n; 2262 /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint framebuffers[n] */ 2263}; 2264uint32_t 2265_mesa_unmarshal_DeleteFramebuffers(struct gl_context *ctx, const struct marshal_cmd_DeleteFramebuffers *cmd, const uint64_t *last) 2266{ 2267 GLsizei n = cmd->n; 2268 GLuint * framebuffers; 2269 const char *variable_data = (const char *) (cmd + 1); 2270 framebuffers = (GLuint *) variable_data; 2271 CALL_DeleteFramebuffers(ctx->CurrentServerDispatch, (n, framebuffers)); 2272 return cmd->cmd_base.cmd_size; 2273} 2274void GLAPIENTRY 2275_mesa_marshal_DeleteFramebuffers(GLsizei n, const GLuint * framebuffers) 2276{ 2277 GET_CURRENT_CONTEXT(ctx); 2278 int framebuffers_size = safe_mul(n, 1 * sizeof(GLuint)); 2279 int cmd_size = sizeof(struct marshal_cmd_DeleteFramebuffers) + framebuffers_size; 2280 struct marshal_cmd_DeleteFramebuffers *cmd; 2281 if (unlikely(framebuffers_size < 0 || (framebuffers_size > 0 && !framebuffers) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 2282 _mesa_glthread_finish_before(ctx, "DeleteFramebuffers"); 2283 CALL_DeleteFramebuffers(ctx->CurrentServerDispatch, (n, framebuffers)); 2284 return; 2285 } 2286 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteFramebuffers, cmd_size); 2287 cmd->n = n; 2288 char *variable_data = (char *) (cmd + 1); 2289 memcpy(variable_data, framebuffers, framebuffers_size); 2290} 2291 2292 2293/* GenFramebuffers: marshalled synchronously */ 2294void GLAPIENTRY 2295_mesa_marshal_GenFramebuffers(GLsizei n, GLuint * framebuffers) 2296{ 2297 GET_CURRENT_CONTEXT(ctx); 2298 _mesa_glthread_finish_before(ctx, "GenFramebuffers"); 2299 CALL_GenFramebuffers(ctx->CurrentServerDispatch, (n, framebuffers)); 2300} 2301 2302 2303/* CheckFramebufferStatus: marshalled synchronously */ 2304GLenum GLAPIENTRY 2305_mesa_marshal_CheckFramebufferStatus(GLenum target) 2306{ 2307 GET_CURRENT_CONTEXT(ctx); 2308 _mesa_glthread_finish_before(ctx, "CheckFramebufferStatus"); 2309 return CALL_CheckFramebufferStatus(ctx->CurrentServerDispatch, (target)); 2310} 2311 2312 2313/* FramebufferTexture1D: marshalled asynchronously */ 2314struct marshal_cmd_FramebufferTexture1D 2315{ 2316 struct marshal_cmd_base cmd_base; 2317 GLenum target; 2318 GLenum attachment; 2319 GLenum textarget; 2320 GLuint texture; 2321 GLint level; 2322}; 2323uint32_t 2324_mesa_unmarshal_FramebufferTexture1D(struct gl_context *ctx, const struct marshal_cmd_FramebufferTexture1D *cmd, const uint64_t *last) 2325{ 2326 GLenum target = cmd->target; 2327 GLenum attachment = cmd->attachment; 2328 GLenum textarget = cmd->textarget; 2329 GLuint texture = cmd->texture; 2330 GLint level = cmd->level; 2331 CALL_FramebufferTexture1D(ctx->CurrentServerDispatch, (target, attachment, textarget, texture, level)); 2332 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FramebufferTexture1D), 8) / 8); 2333 assert (cmd_size == cmd->cmd_base.cmd_size); 2334 return cmd_size; 2335} 2336void GLAPIENTRY 2337_mesa_marshal_FramebufferTexture1D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) 2338{ 2339 GET_CURRENT_CONTEXT(ctx); 2340 int cmd_size = sizeof(struct marshal_cmd_FramebufferTexture1D); 2341 struct marshal_cmd_FramebufferTexture1D *cmd; 2342 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferTexture1D, cmd_size); 2343 cmd->target = target; 2344 cmd->attachment = attachment; 2345 cmd->textarget = textarget; 2346 cmd->texture = texture; 2347 cmd->level = level; 2348} 2349 2350 2351/* FramebufferTexture2D: marshalled asynchronously */ 2352struct marshal_cmd_FramebufferTexture2D 2353{ 2354 struct marshal_cmd_base cmd_base; 2355 GLenum target; 2356 GLenum attachment; 2357 GLenum textarget; 2358 GLuint texture; 2359 GLint level; 2360}; 2361uint32_t 2362_mesa_unmarshal_FramebufferTexture2D(struct gl_context *ctx, const struct marshal_cmd_FramebufferTexture2D *cmd, const uint64_t *last) 2363{ 2364 GLenum target = cmd->target; 2365 GLenum attachment = cmd->attachment; 2366 GLenum textarget = cmd->textarget; 2367 GLuint texture = cmd->texture; 2368 GLint level = cmd->level; 2369 CALL_FramebufferTexture2D(ctx->CurrentServerDispatch, (target, attachment, textarget, texture, level)); 2370 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FramebufferTexture2D), 8) / 8); 2371 assert (cmd_size == cmd->cmd_base.cmd_size); 2372 return cmd_size; 2373} 2374void GLAPIENTRY 2375_mesa_marshal_FramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) 2376{ 2377 GET_CURRENT_CONTEXT(ctx); 2378 int cmd_size = sizeof(struct marshal_cmd_FramebufferTexture2D); 2379 struct marshal_cmd_FramebufferTexture2D *cmd; 2380 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferTexture2D, cmd_size); 2381 cmd->target = target; 2382 cmd->attachment = attachment; 2383 cmd->textarget = textarget; 2384 cmd->texture = texture; 2385 cmd->level = level; 2386} 2387 2388 2389/* FramebufferTexture3D: marshalled asynchronously */ 2390struct marshal_cmd_FramebufferTexture3D 2391{ 2392 struct marshal_cmd_base cmd_base; 2393 GLenum target; 2394 GLenum attachment; 2395 GLenum textarget; 2396 GLuint texture; 2397 GLint level; 2398 GLint layer; 2399}; 2400uint32_t 2401_mesa_unmarshal_FramebufferTexture3D(struct gl_context *ctx, const struct marshal_cmd_FramebufferTexture3D *cmd, const uint64_t *last) 2402{ 2403 GLenum target = cmd->target; 2404 GLenum attachment = cmd->attachment; 2405 GLenum textarget = cmd->textarget; 2406 GLuint texture = cmd->texture; 2407 GLint level = cmd->level; 2408 GLint layer = cmd->layer; 2409 CALL_FramebufferTexture3D(ctx->CurrentServerDispatch, (target, attachment, textarget, texture, level, layer)); 2410 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FramebufferTexture3D), 8) / 8); 2411 assert (cmd_size == cmd->cmd_base.cmd_size); 2412 return cmd_size; 2413} 2414void GLAPIENTRY 2415_mesa_marshal_FramebufferTexture3D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer) 2416{ 2417 GET_CURRENT_CONTEXT(ctx); 2418 int cmd_size = sizeof(struct marshal_cmd_FramebufferTexture3D); 2419 struct marshal_cmd_FramebufferTexture3D *cmd; 2420 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferTexture3D, cmd_size); 2421 cmd->target = target; 2422 cmd->attachment = attachment; 2423 cmd->textarget = textarget; 2424 cmd->texture = texture; 2425 cmd->level = level; 2426 cmd->layer = layer; 2427} 2428 2429 2430/* FramebufferTextureLayer: marshalled asynchronously */ 2431struct marshal_cmd_FramebufferTextureLayer 2432{ 2433 struct marshal_cmd_base cmd_base; 2434 GLenum target; 2435 GLenum attachment; 2436 GLuint texture; 2437 GLint level; 2438 GLint layer; 2439}; 2440uint32_t 2441_mesa_unmarshal_FramebufferTextureLayer(struct gl_context *ctx, const struct marshal_cmd_FramebufferTextureLayer *cmd, const uint64_t *last) 2442{ 2443 GLenum target = cmd->target; 2444 GLenum attachment = cmd->attachment; 2445 GLuint texture = cmd->texture; 2446 GLint level = cmd->level; 2447 GLint layer = cmd->layer; 2448 CALL_FramebufferTextureLayer(ctx->CurrentServerDispatch, (target, attachment, texture, level, layer)); 2449 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FramebufferTextureLayer), 8) / 8); 2450 assert (cmd_size == cmd->cmd_base.cmd_size); 2451 return cmd_size; 2452} 2453void GLAPIENTRY 2454_mesa_marshal_FramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) 2455{ 2456 GET_CURRENT_CONTEXT(ctx); 2457 int cmd_size = sizeof(struct marshal_cmd_FramebufferTextureLayer); 2458 struct marshal_cmd_FramebufferTextureLayer *cmd; 2459 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferTextureLayer, cmd_size); 2460 cmd->target = target; 2461 cmd->attachment = attachment; 2462 cmd->texture = texture; 2463 cmd->level = level; 2464 cmd->layer = layer; 2465} 2466 2467 2468/* FramebufferRenderbuffer: marshalled asynchronously */ 2469struct marshal_cmd_FramebufferRenderbuffer 2470{ 2471 struct marshal_cmd_base cmd_base; 2472 GLenum target; 2473 GLenum attachment; 2474 GLenum renderbuffertarget; 2475 GLuint renderbuffer; 2476}; 2477uint32_t 2478_mesa_unmarshal_FramebufferRenderbuffer(struct gl_context *ctx, const struct marshal_cmd_FramebufferRenderbuffer *cmd, const uint64_t *last) 2479{ 2480 GLenum target = cmd->target; 2481 GLenum attachment = cmd->attachment; 2482 GLenum renderbuffertarget = cmd->renderbuffertarget; 2483 GLuint renderbuffer = cmd->renderbuffer; 2484 CALL_FramebufferRenderbuffer(ctx->CurrentServerDispatch, (target, attachment, renderbuffertarget, renderbuffer)); 2485 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FramebufferRenderbuffer), 8) / 8); 2486 assert (cmd_size == cmd->cmd_base.cmd_size); 2487 return cmd_size; 2488} 2489void GLAPIENTRY 2490_mesa_marshal_FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) 2491{ 2492 GET_CURRENT_CONTEXT(ctx); 2493 int cmd_size = sizeof(struct marshal_cmd_FramebufferRenderbuffer); 2494 struct marshal_cmd_FramebufferRenderbuffer *cmd; 2495 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferRenderbuffer, cmd_size); 2496 cmd->target = target; 2497 cmd->attachment = attachment; 2498 cmd->renderbuffertarget = renderbuffertarget; 2499 cmd->renderbuffer = renderbuffer; 2500} 2501 2502 2503/* GetFramebufferAttachmentParameteriv: marshalled synchronously */ 2504void GLAPIENTRY 2505_mesa_marshal_GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint * params) 2506{ 2507 GET_CURRENT_CONTEXT(ctx); 2508 _mesa_glthread_finish_before(ctx, "GetFramebufferAttachmentParameteriv"); 2509 CALL_GetFramebufferAttachmentParameteriv(ctx->CurrentServerDispatch, (target, attachment, pname, params)); 2510} 2511 2512 2513/* BlitFramebuffer: marshalled asynchronously */ 2514struct marshal_cmd_BlitFramebuffer 2515{ 2516 struct marshal_cmd_base cmd_base; 2517 GLint srcX0; 2518 GLint srcY0; 2519 GLint srcX1; 2520 GLint srcY1; 2521 GLint dstX0; 2522 GLint dstY0; 2523 GLint dstX1; 2524 GLint dstY1; 2525 GLbitfield mask; 2526 GLenum filter; 2527}; 2528uint32_t 2529_mesa_unmarshal_BlitFramebuffer(struct gl_context *ctx, const struct marshal_cmd_BlitFramebuffer *cmd, const uint64_t *last) 2530{ 2531 GLint srcX0 = cmd->srcX0; 2532 GLint srcY0 = cmd->srcY0; 2533 GLint srcX1 = cmd->srcX1; 2534 GLint srcY1 = cmd->srcY1; 2535 GLint dstX0 = cmd->dstX0; 2536 GLint dstY0 = cmd->dstY0; 2537 GLint dstX1 = cmd->dstX1; 2538 GLint dstY1 = cmd->dstY1; 2539 GLbitfield mask = cmd->mask; 2540 GLenum filter = cmd->filter; 2541 CALL_BlitFramebuffer(ctx->CurrentServerDispatch, (srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter)); 2542 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BlitFramebuffer), 8) / 8); 2543 assert (cmd_size == cmd->cmd_base.cmd_size); 2544 return cmd_size; 2545} 2546void GLAPIENTRY 2547_mesa_marshal_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) 2548{ 2549 GET_CURRENT_CONTEXT(ctx); 2550 int cmd_size = sizeof(struct marshal_cmd_BlitFramebuffer); 2551 struct marshal_cmd_BlitFramebuffer *cmd; 2552 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlitFramebuffer, cmd_size); 2553 cmd->srcX0 = srcX0; 2554 cmd->srcY0 = srcY0; 2555 cmd->srcX1 = srcX1; 2556 cmd->srcY1 = srcY1; 2557 cmd->dstX0 = dstX0; 2558 cmd->dstY0 = dstY0; 2559 cmd->dstX1 = dstX1; 2560 cmd->dstY1 = dstY1; 2561 cmd->mask = mask; 2562 cmd->filter = filter; 2563} 2564 2565 2566/* GenerateMipmap: marshalled asynchronously */ 2567struct marshal_cmd_GenerateMipmap 2568{ 2569 struct marshal_cmd_base cmd_base; 2570 GLenum target; 2571}; 2572uint32_t 2573_mesa_unmarshal_GenerateMipmap(struct gl_context *ctx, const struct marshal_cmd_GenerateMipmap *cmd, const uint64_t *last) 2574{ 2575 GLenum target = cmd->target; 2576 CALL_GenerateMipmap(ctx->CurrentServerDispatch, (target)); 2577 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_GenerateMipmap), 8) / 8); 2578 assert (cmd_size == cmd->cmd_base.cmd_size); 2579 return cmd_size; 2580} 2581void GLAPIENTRY 2582_mesa_marshal_GenerateMipmap(GLenum target) 2583{ 2584 GET_CURRENT_CONTEXT(ctx); 2585 int cmd_size = sizeof(struct marshal_cmd_GenerateMipmap); 2586 struct marshal_cmd_GenerateMipmap *cmd; 2587 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_GenerateMipmap, cmd_size); 2588 cmd->target = target; 2589} 2590 2591 2592/* VertexAttribDivisor: marshalled asynchronously */ 2593struct marshal_cmd_VertexAttribDivisor 2594{ 2595 struct marshal_cmd_base cmd_base; 2596 GLuint index; 2597 GLuint divisor; 2598}; 2599uint32_t 2600_mesa_unmarshal_VertexAttribDivisor(struct gl_context *ctx, const struct marshal_cmd_VertexAttribDivisor *cmd, const uint64_t *last) 2601{ 2602 GLuint index = cmd->index; 2603 GLuint divisor = cmd->divisor; 2604 CALL_VertexAttribDivisor(ctx->CurrentServerDispatch, (index, divisor)); 2605 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribDivisor), 8) / 8); 2606 assert (cmd_size == cmd->cmd_base.cmd_size); 2607 return cmd_size; 2608} 2609void GLAPIENTRY 2610_mesa_marshal_VertexAttribDivisor(GLuint index, GLuint divisor) 2611{ 2612 GET_CURRENT_CONTEXT(ctx); 2613 int cmd_size = sizeof(struct marshal_cmd_VertexAttribDivisor); 2614 struct marshal_cmd_VertexAttribDivisor *cmd; 2615 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribDivisor, cmd_size); 2616 cmd->index = index; 2617 cmd->divisor = divisor; 2618 if (COMPAT) _mesa_glthread_AttribDivisor(ctx, NULL, VERT_ATTRIB_GENERIC(index), divisor); 2619} 2620 2621 2622/* VertexArrayVertexAttribDivisorEXT: marshalled asynchronously */ 2623struct marshal_cmd_VertexArrayVertexAttribDivisorEXT 2624{ 2625 struct marshal_cmd_base cmd_base; 2626 GLuint vaobj; 2627 GLuint index; 2628 GLuint divisor; 2629}; 2630uint32_t 2631_mesa_unmarshal_VertexArrayVertexAttribDivisorEXT(struct gl_context *ctx, const struct marshal_cmd_VertexArrayVertexAttribDivisorEXT *cmd, const uint64_t *last) 2632{ 2633 GLuint vaobj = cmd->vaobj; 2634 GLuint index = cmd->index; 2635 GLuint divisor = cmd->divisor; 2636 CALL_VertexArrayVertexAttribDivisorEXT(ctx->CurrentServerDispatch, (vaobj, index, divisor)); 2637 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexArrayVertexAttribDivisorEXT), 8) / 8); 2638 assert (cmd_size == cmd->cmd_base.cmd_size); 2639 return cmd_size; 2640} 2641void GLAPIENTRY 2642_mesa_marshal_VertexArrayVertexAttribDivisorEXT(GLuint vaobj, GLuint index, GLuint divisor) 2643{ 2644 GET_CURRENT_CONTEXT(ctx); 2645 int cmd_size = sizeof(struct marshal_cmd_VertexArrayVertexAttribDivisorEXT); 2646 struct marshal_cmd_VertexArrayVertexAttribDivisorEXT *cmd; 2647 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexArrayVertexAttribDivisorEXT, cmd_size); 2648 cmd->vaobj = vaobj; 2649 cmd->index = index; 2650 cmd->divisor = divisor; 2651 if (COMPAT) _mesa_glthread_AttribDivisor(ctx, &vaobj, VERT_ATTRIB_GENERIC(index), divisor); 2652} 2653 2654 2655/* MapBufferRange: marshalled synchronously */ 2656GLvoid * GLAPIENTRY 2657_mesa_marshal_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) 2658{ 2659 GET_CURRENT_CONTEXT(ctx); 2660 _mesa_glthread_finish_before(ctx, "MapBufferRange"); 2661 return CALL_MapBufferRange(ctx->CurrentServerDispatch, (target, offset, length, access)); 2662} 2663 2664 2665/* FlushMappedBufferRange: marshalled asynchronously */ 2666struct marshal_cmd_FlushMappedBufferRange 2667{ 2668 struct marshal_cmd_base cmd_base; 2669 GLenum target; 2670 GLintptr offset; 2671 GLsizeiptr length; 2672}; 2673uint32_t 2674_mesa_unmarshal_FlushMappedBufferRange(struct gl_context *ctx, const struct marshal_cmd_FlushMappedBufferRange *cmd, const uint64_t *last) 2675{ 2676 GLenum target = cmd->target; 2677 GLintptr offset = cmd->offset; 2678 GLsizeiptr length = cmd->length; 2679 CALL_FlushMappedBufferRange(ctx->CurrentServerDispatch, (target, offset, length)); 2680 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FlushMappedBufferRange), 8) / 8); 2681 assert (cmd_size == cmd->cmd_base.cmd_size); 2682 return cmd_size; 2683} 2684void GLAPIENTRY 2685_mesa_marshal_FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) 2686{ 2687 GET_CURRENT_CONTEXT(ctx); 2688 int cmd_size = sizeof(struct marshal_cmd_FlushMappedBufferRange); 2689 struct marshal_cmd_FlushMappedBufferRange *cmd; 2690 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FlushMappedBufferRange, cmd_size); 2691 cmd->target = target; 2692 cmd->offset = offset; 2693 cmd->length = length; 2694} 2695 2696 2697/* TexBuffer: marshalled asynchronously */ 2698struct marshal_cmd_TexBuffer 2699{ 2700 struct marshal_cmd_base cmd_base; 2701 GLenum target; 2702 GLenum internalFormat; 2703 GLuint buffer; 2704}; 2705uint32_t 2706_mesa_unmarshal_TexBuffer(struct gl_context *ctx, const struct marshal_cmd_TexBuffer *cmd, const uint64_t *last) 2707{ 2708 GLenum target = cmd->target; 2709 GLenum internalFormat = cmd->internalFormat; 2710 GLuint buffer = cmd->buffer; 2711 CALL_TexBuffer(ctx->CurrentServerDispatch, (target, internalFormat, buffer)); 2712 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexBuffer), 8) / 8); 2713 assert (cmd_size == cmd->cmd_base.cmd_size); 2714 return cmd_size; 2715} 2716void GLAPIENTRY 2717_mesa_marshal_TexBuffer(GLenum target, GLenum internalFormat, GLuint buffer) 2718{ 2719 GET_CURRENT_CONTEXT(ctx); 2720 int cmd_size = sizeof(struct marshal_cmd_TexBuffer); 2721 struct marshal_cmd_TexBuffer *cmd; 2722 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexBuffer, cmd_size); 2723 cmd->target = target; 2724 cmd->internalFormat = internalFormat; 2725 cmd->buffer = buffer; 2726} 2727 2728 2729/* BindVertexArray: marshalled asynchronously */ 2730struct marshal_cmd_BindVertexArray 2731{ 2732 struct marshal_cmd_base cmd_base; 2733 GLuint array; 2734}; 2735uint32_t 2736_mesa_unmarshal_BindVertexArray(struct gl_context *ctx, const struct marshal_cmd_BindVertexArray *cmd, const uint64_t *last) 2737{ 2738 GLuint array = cmd->array; 2739 CALL_BindVertexArray(ctx->CurrentServerDispatch, (array)); 2740 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindVertexArray), 8) / 8); 2741 assert (cmd_size == cmd->cmd_base.cmd_size); 2742 return cmd_size; 2743} 2744void GLAPIENTRY 2745_mesa_marshal_BindVertexArray(GLuint array) 2746{ 2747 GET_CURRENT_CONTEXT(ctx); 2748 int cmd_size = sizeof(struct marshal_cmd_BindVertexArray); 2749 struct marshal_cmd_BindVertexArray *cmd; 2750 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindVertexArray, cmd_size); 2751 cmd->array = array; 2752 if (COMPAT) _mesa_glthread_BindVertexArray(ctx, array); 2753} 2754 2755 2756/* DeleteVertexArrays: marshalled asynchronously */ 2757struct marshal_cmd_DeleteVertexArrays 2758{ 2759 struct marshal_cmd_base cmd_base; 2760 GLsizei n; 2761 /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint arrays[n] */ 2762}; 2763uint32_t 2764_mesa_unmarshal_DeleteVertexArrays(struct gl_context *ctx, const struct marshal_cmd_DeleteVertexArrays *cmd, const uint64_t *last) 2765{ 2766 GLsizei n = cmd->n; 2767 GLuint * arrays; 2768 const char *variable_data = (const char *) (cmd + 1); 2769 arrays = (GLuint *) variable_data; 2770 CALL_DeleteVertexArrays(ctx->CurrentServerDispatch, (n, arrays)); 2771 return cmd->cmd_base.cmd_size; 2772} 2773void GLAPIENTRY 2774_mesa_marshal_DeleteVertexArrays(GLsizei n, const GLuint * arrays) 2775{ 2776 GET_CURRENT_CONTEXT(ctx); 2777 int arrays_size = safe_mul(n, 1 * sizeof(GLuint)); 2778 int cmd_size = sizeof(struct marshal_cmd_DeleteVertexArrays) + arrays_size; 2779 struct marshal_cmd_DeleteVertexArrays *cmd; 2780 if (unlikely(arrays_size < 0 || (arrays_size > 0 && !arrays) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 2781 _mesa_glthread_finish_before(ctx, "DeleteVertexArrays"); 2782 CALL_DeleteVertexArrays(ctx->CurrentServerDispatch, (n, arrays)); 2783 if (COMPAT) _mesa_glthread_DeleteVertexArrays(ctx, n, arrays); 2784 return; 2785 } 2786 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteVertexArrays, cmd_size); 2787 cmd->n = n; 2788 char *variable_data = (char *) (cmd + 1); 2789 memcpy(variable_data, arrays, arrays_size); 2790 if (COMPAT) _mesa_glthread_DeleteVertexArrays(ctx, n, arrays); 2791} 2792 2793 2794/* GenVertexArrays: marshalled synchronously */ 2795void GLAPIENTRY 2796_mesa_marshal_GenVertexArrays(GLsizei n, GLuint * arrays) 2797{ 2798 GET_CURRENT_CONTEXT(ctx); 2799 _mesa_glthread_finish_before(ctx, "GenVertexArrays"); 2800 CALL_GenVertexArrays(ctx->CurrentServerDispatch, (n, arrays)); 2801 if (COMPAT) _mesa_glthread_GenVertexArrays(ctx, n, arrays); 2802} 2803 2804 2805/* IsVertexArray: marshalled synchronously */ 2806GLboolean GLAPIENTRY 2807_mesa_marshal_IsVertexArray(GLuint array) 2808{ 2809 GET_CURRENT_CONTEXT(ctx); 2810 _mesa_glthread_finish_before(ctx, "IsVertexArray"); 2811 return CALL_IsVertexArray(ctx->CurrentServerDispatch, (array)); 2812} 2813 2814 2815/* GetUniformIndices: marshalled synchronously */ 2816void GLAPIENTRY 2817_mesa_marshal_GetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar * const * uniformNames, GLuint * uniformIndices) 2818{ 2819 GET_CURRENT_CONTEXT(ctx); 2820 _mesa_glthread_finish_before(ctx, "GetUniformIndices"); 2821 CALL_GetUniformIndices(ctx->CurrentServerDispatch, (program, uniformCount, uniformNames, uniformIndices)); 2822} 2823 2824 2825/* GetActiveUniformsiv: marshalled synchronously */ 2826void GLAPIENTRY 2827_mesa_marshal_GetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint * uniformIndices, GLenum pname, GLint * params) 2828{ 2829 GET_CURRENT_CONTEXT(ctx); 2830 _mesa_glthread_finish_before(ctx, "GetActiveUniformsiv"); 2831 CALL_GetActiveUniformsiv(ctx->CurrentServerDispatch, (program, uniformCount, uniformIndices, pname, params)); 2832} 2833 2834 2835/* GetActiveUniformName: marshalled synchronously */ 2836void GLAPIENTRY 2837_mesa_marshal_GetActiveUniformName(GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformName) 2838{ 2839 GET_CURRENT_CONTEXT(ctx); 2840 _mesa_glthread_finish_before(ctx, "GetActiveUniformName"); 2841 CALL_GetActiveUniformName(ctx->CurrentServerDispatch, (program, uniformIndex, bufSize, length, uniformName)); 2842} 2843 2844 2845/* GetUniformBlockIndex: marshalled synchronously */ 2846GLuint GLAPIENTRY 2847_mesa_marshal_GetUniformBlockIndex(GLuint program, const GLchar * uniformBlockName) 2848{ 2849 GET_CURRENT_CONTEXT(ctx); 2850 _mesa_glthread_finish_before(ctx, "GetUniformBlockIndex"); 2851 return CALL_GetUniformBlockIndex(ctx->CurrentServerDispatch, (program, uniformBlockName)); 2852} 2853 2854 2855/* GetActiveUniformBlockiv: marshalled synchronously */ 2856void GLAPIENTRY 2857_mesa_marshal_GetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint * params) 2858{ 2859 GET_CURRENT_CONTEXT(ctx); 2860 _mesa_glthread_finish_before(ctx, "GetActiveUniformBlockiv"); 2861 CALL_GetActiveUniformBlockiv(ctx->CurrentServerDispatch, (program, uniformBlockIndex, pname, params)); 2862} 2863 2864 2865/* GetActiveUniformBlockName: marshalled synchronously */ 2866void GLAPIENTRY 2867_mesa_marshal_GetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei * length, GLchar * uniformBlockName) 2868{ 2869 GET_CURRENT_CONTEXT(ctx); 2870 _mesa_glthread_finish_before(ctx, "GetActiveUniformBlockName"); 2871 CALL_GetActiveUniformBlockName(ctx->CurrentServerDispatch, (program, uniformBlockIndex, bufSize, length, uniformBlockName)); 2872} 2873 2874 2875/* UniformBlockBinding: marshalled asynchronously */ 2876struct marshal_cmd_UniformBlockBinding 2877{ 2878 struct marshal_cmd_base cmd_base; 2879 GLuint program; 2880 GLuint uniformBlockIndex; 2881 GLuint uniformBlockBinding; 2882}; 2883uint32_t 2884_mesa_unmarshal_UniformBlockBinding(struct gl_context *ctx, const struct marshal_cmd_UniformBlockBinding *cmd, const uint64_t *last) 2885{ 2886 GLuint program = cmd->program; 2887 GLuint uniformBlockIndex = cmd->uniformBlockIndex; 2888 GLuint uniformBlockBinding = cmd->uniformBlockBinding; 2889 CALL_UniformBlockBinding(ctx->CurrentServerDispatch, (program, uniformBlockIndex, uniformBlockBinding)); 2890 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_UniformBlockBinding), 8) / 8); 2891 assert (cmd_size == cmd->cmd_base.cmd_size); 2892 return cmd_size; 2893} 2894void GLAPIENTRY 2895_mesa_marshal_UniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding) 2896{ 2897 GET_CURRENT_CONTEXT(ctx); 2898 int cmd_size = sizeof(struct marshal_cmd_UniformBlockBinding); 2899 struct marshal_cmd_UniformBlockBinding *cmd; 2900 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformBlockBinding, cmd_size); 2901 cmd->program = program; 2902 cmd->uniformBlockIndex = uniformBlockIndex; 2903 cmd->uniformBlockBinding = uniformBlockBinding; 2904} 2905 2906 2907/* CopyBufferSubData: marshalled asynchronously */ 2908struct marshal_cmd_CopyBufferSubData 2909{ 2910 struct marshal_cmd_base cmd_base; 2911 GLenum readTarget; 2912 GLenum writeTarget; 2913 GLintptr readOffset; 2914 GLintptr writeOffset; 2915 GLsizeiptr size; 2916}; 2917uint32_t 2918_mesa_unmarshal_CopyBufferSubData(struct gl_context *ctx, const struct marshal_cmd_CopyBufferSubData *cmd, const uint64_t *last) 2919{ 2920 GLenum readTarget = cmd->readTarget; 2921 GLenum writeTarget = cmd->writeTarget; 2922 GLintptr readOffset = cmd->readOffset; 2923 GLintptr writeOffset = cmd->writeOffset; 2924 GLsizeiptr size = cmd->size; 2925 CALL_CopyBufferSubData(ctx->CurrentServerDispatch, (readTarget, writeTarget, readOffset, writeOffset, size)); 2926 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_CopyBufferSubData), 8) / 8); 2927 assert (cmd_size == cmd->cmd_base.cmd_size); 2928 return cmd_size; 2929} 2930void GLAPIENTRY 2931_mesa_marshal_CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) 2932{ 2933 GET_CURRENT_CONTEXT(ctx); 2934 int cmd_size = sizeof(struct marshal_cmd_CopyBufferSubData); 2935 struct marshal_cmd_CopyBufferSubData *cmd; 2936 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_CopyBufferSubData, cmd_size); 2937 cmd->readTarget = readTarget; 2938 cmd->writeTarget = writeTarget; 2939 cmd->readOffset = readOffset; 2940 cmd->writeOffset = writeOffset; 2941 cmd->size = size; 2942} 2943 2944 2945/* FenceSync: marshalled synchronously */ 2946GLsync GLAPIENTRY 2947_mesa_marshal_FenceSync(GLenum condition, GLbitfield flags) 2948{ 2949 GET_CURRENT_CONTEXT(ctx); 2950 _mesa_glthread_finish_before(ctx, "FenceSync"); 2951 return CALL_FenceSync(ctx->CurrentServerDispatch, (condition, flags)); 2952} 2953 2954 2955/* IsSync: marshalled synchronously */ 2956GLboolean GLAPIENTRY 2957_mesa_marshal_IsSync(GLsync sync) 2958{ 2959 GET_CURRENT_CONTEXT(ctx); 2960 _mesa_glthread_finish_before(ctx, "IsSync"); 2961 return CALL_IsSync(ctx->CurrentServerDispatch, (sync)); 2962} 2963 2964 2965/* DeleteSync: marshalled asynchronously */ 2966struct marshal_cmd_DeleteSync 2967{ 2968 struct marshal_cmd_base cmd_base; 2969 GLsync sync; 2970}; 2971uint32_t 2972_mesa_unmarshal_DeleteSync(struct gl_context *ctx, const struct marshal_cmd_DeleteSync *cmd, const uint64_t *last) 2973{ 2974 GLsync sync = cmd->sync; 2975 CALL_DeleteSync(ctx->CurrentServerDispatch, (sync)); 2976 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DeleteSync), 8) / 8); 2977 assert (cmd_size == cmd->cmd_base.cmd_size); 2978 return cmd_size; 2979} 2980void GLAPIENTRY 2981_mesa_marshal_DeleteSync(GLsync sync) 2982{ 2983 GET_CURRENT_CONTEXT(ctx); 2984 int cmd_size = sizeof(struct marshal_cmd_DeleteSync); 2985 struct marshal_cmd_DeleteSync *cmd; 2986 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteSync, cmd_size); 2987 cmd->sync = sync; 2988} 2989 2990 2991/* ClientWaitSync: marshalled synchronously */ 2992GLenum GLAPIENTRY 2993_mesa_marshal_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) 2994{ 2995 GET_CURRENT_CONTEXT(ctx); 2996 _mesa_glthread_finish_before(ctx, "ClientWaitSync"); 2997 return CALL_ClientWaitSync(ctx->CurrentServerDispatch, (sync, flags, timeout)); 2998} 2999 3000 3001/* WaitSync: marshalled asynchronously */ 3002struct marshal_cmd_WaitSync 3003{ 3004 struct marshal_cmd_base cmd_base; 3005 GLbitfield flags; 3006 GLsync sync; 3007 GLuint64 timeout; 3008}; 3009uint32_t 3010_mesa_unmarshal_WaitSync(struct gl_context *ctx, const struct marshal_cmd_WaitSync *cmd, const uint64_t *last) 3011{ 3012 GLsync sync = cmd->sync; 3013 GLbitfield flags = cmd->flags; 3014 GLuint64 timeout = cmd->timeout; 3015 CALL_WaitSync(ctx->CurrentServerDispatch, (sync, flags, timeout)); 3016 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_WaitSync), 8) / 8); 3017 assert (cmd_size == cmd->cmd_base.cmd_size); 3018 return cmd_size; 3019} 3020void GLAPIENTRY 3021_mesa_marshal_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) 3022{ 3023 GET_CURRENT_CONTEXT(ctx); 3024 int cmd_size = sizeof(struct marshal_cmd_WaitSync); 3025 struct marshal_cmd_WaitSync *cmd; 3026 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WaitSync, cmd_size); 3027 cmd->sync = sync; 3028 cmd->flags = flags; 3029 cmd->timeout = timeout; 3030} 3031 3032 3033/* GetInteger64v: marshalled synchronously */ 3034void GLAPIENTRY 3035_mesa_marshal_GetInteger64v(GLenum pname, GLint64 * params) 3036{ 3037 GET_CURRENT_CONTEXT(ctx); 3038 _mesa_glthread_finish_before(ctx, "GetInteger64v"); 3039 CALL_GetInteger64v(ctx->CurrentServerDispatch, (pname, params)); 3040} 3041 3042 3043/* GetSynciv: marshalled synchronously */ 3044void GLAPIENTRY 3045_mesa_marshal_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values) 3046{ 3047 GET_CURRENT_CONTEXT(ctx); 3048 _mesa_glthread_finish_before(ctx, "GetSynciv"); 3049 CALL_GetSynciv(ctx->CurrentServerDispatch, (sync, pname, bufSize, length, values)); 3050} 3051 3052 3053/* TexImage2DMultisample: marshalled asynchronously */ 3054struct marshal_cmd_TexImage2DMultisample 3055{ 3056 struct marshal_cmd_base cmd_base; 3057 GLboolean fixedsamplelocations; 3058 GLenum target; 3059 GLsizei samples; 3060 GLenum internalformat; 3061 GLsizei width; 3062 GLsizei height; 3063}; 3064uint32_t 3065_mesa_unmarshal_TexImage2DMultisample(struct gl_context *ctx, const struct marshal_cmd_TexImage2DMultisample *cmd, const uint64_t *last) 3066{ 3067 GLenum target = cmd->target; 3068 GLsizei samples = cmd->samples; 3069 GLenum internalformat = cmd->internalformat; 3070 GLsizei width = cmd->width; 3071 GLsizei height = cmd->height; 3072 GLboolean fixedsamplelocations = cmd->fixedsamplelocations; 3073 CALL_TexImage2DMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height, fixedsamplelocations)); 3074 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexImage2DMultisample), 8) / 8); 3075 assert (cmd_size == cmd->cmd_base.cmd_size); 3076 return cmd_size; 3077} 3078void GLAPIENTRY 3079_mesa_marshal_TexImage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) 3080{ 3081 GET_CURRENT_CONTEXT(ctx); 3082 int cmd_size = sizeof(struct marshal_cmd_TexImage2DMultisample); 3083 struct marshal_cmd_TexImage2DMultisample *cmd; 3084 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexImage2DMultisample, cmd_size); 3085 cmd->target = target; 3086 cmd->samples = samples; 3087 cmd->internalformat = internalformat; 3088 cmd->width = width; 3089 cmd->height = height; 3090 cmd->fixedsamplelocations = fixedsamplelocations; 3091} 3092 3093 3094/* TexImage3DMultisample: marshalled asynchronously */ 3095struct marshal_cmd_TexImage3DMultisample 3096{ 3097 struct marshal_cmd_base cmd_base; 3098 GLboolean fixedsamplelocations; 3099 GLenum target; 3100 GLsizei samples; 3101 GLenum internalformat; 3102 GLsizei width; 3103 GLsizei height; 3104 GLsizei depth; 3105}; 3106uint32_t 3107_mesa_unmarshal_TexImage3DMultisample(struct gl_context *ctx, const struct marshal_cmd_TexImage3DMultisample *cmd, const uint64_t *last) 3108{ 3109 GLenum target = cmd->target; 3110 GLsizei samples = cmd->samples; 3111 GLenum internalformat = cmd->internalformat; 3112 GLsizei width = cmd->width; 3113 GLsizei height = cmd->height; 3114 GLsizei depth = cmd->depth; 3115 GLboolean fixedsamplelocations = cmd->fixedsamplelocations; 3116 CALL_TexImage3DMultisample(ctx->CurrentServerDispatch, (target, samples, internalformat, width, height, depth, fixedsamplelocations)); 3117 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexImage3DMultisample), 8) / 8); 3118 assert (cmd_size == cmd->cmd_base.cmd_size); 3119 return cmd_size; 3120} 3121void GLAPIENTRY 3122_mesa_marshal_TexImage3DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) 3123{ 3124 GET_CURRENT_CONTEXT(ctx); 3125 int cmd_size = sizeof(struct marshal_cmd_TexImage3DMultisample); 3126 struct marshal_cmd_TexImage3DMultisample *cmd; 3127 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexImage3DMultisample, cmd_size); 3128 cmd->target = target; 3129 cmd->samples = samples; 3130 cmd->internalformat = internalformat; 3131 cmd->width = width; 3132 cmd->height = height; 3133 cmd->depth = depth; 3134 cmd->fixedsamplelocations = fixedsamplelocations; 3135} 3136 3137 3138/* GetMultisamplefv: marshalled synchronously */ 3139void GLAPIENTRY 3140_mesa_marshal_GetMultisamplefv(GLenum pname, GLuint index, GLfloat * val) 3141{ 3142 GET_CURRENT_CONTEXT(ctx); 3143 _mesa_glthread_finish_before(ctx, "GetMultisamplefv"); 3144 CALL_GetMultisamplefv(ctx->CurrentServerDispatch, (pname, index, val)); 3145} 3146 3147 3148/* SampleMaski: marshalled asynchronously */ 3149struct marshal_cmd_SampleMaski 3150{ 3151 struct marshal_cmd_base cmd_base; 3152 GLuint index; 3153 GLbitfield mask; 3154}; 3155uint32_t 3156_mesa_unmarshal_SampleMaski(struct gl_context *ctx, const struct marshal_cmd_SampleMaski *cmd, const uint64_t *last) 3157{ 3158 GLuint index = cmd->index; 3159 GLbitfield mask = cmd->mask; 3160 CALL_SampleMaski(ctx->CurrentServerDispatch, (index, mask)); 3161 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SampleMaski), 8) / 8); 3162 assert (cmd_size == cmd->cmd_base.cmd_size); 3163 return cmd_size; 3164} 3165void GLAPIENTRY 3166_mesa_marshal_SampleMaski(GLuint index, GLbitfield mask) 3167{ 3168 GET_CURRENT_CONTEXT(ctx); 3169 int cmd_size = sizeof(struct marshal_cmd_SampleMaski); 3170 struct marshal_cmd_SampleMaski *cmd; 3171 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SampleMaski, cmd_size); 3172 cmd->index = index; 3173 cmd->mask = mask; 3174} 3175 3176 3177/* BlendEquationiARB: marshalled asynchronously */ 3178struct marshal_cmd_BlendEquationiARB 3179{ 3180 struct marshal_cmd_base cmd_base; 3181 GLuint buf; 3182 GLenum mode; 3183}; 3184uint32_t 3185_mesa_unmarshal_BlendEquationiARB(struct gl_context *ctx, const struct marshal_cmd_BlendEquationiARB *cmd, const uint64_t *last) 3186{ 3187 GLuint buf = cmd->buf; 3188 GLenum mode = cmd->mode; 3189 CALL_BlendEquationiARB(ctx->CurrentServerDispatch, (buf, mode)); 3190 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BlendEquationiARB), 8) / 8); 3191 assert (cmd_size == cmd->cmd_base.cmd_size); 3192 return cmd_size; 3193} 3194void GLAPIENTRY 3195_mesa_marshal_BlendEquationiARB(GLuint buf, GLenum mode) 3196{ 3197 GET_CURRENT_CONTEXT(ctx); 3198 int cmd_size = sizeof(struct marshal_cmd_BlendEquationiARB); 3199 struct marshal_cmd_BlendEquationiARB *cmd; 3200 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendEquationiARB, cmd_size); 3201 cmd->buf = buf; 3202 cmd->mode = mode; 3203} 3204 3205 3206/* BlendEquationSeparateiARB: marshalled asynchronously */ 3207struct marshal_cmd_BlendEquationSeparateiARB 3208{ 3209 struct marshal_cmd_base cmd_base; 3210 GLuint buf; 3211 GLenum modeRGB; 3212 GLenum modeA; 3213}; 3214uint32_t 3215_mesa_unmarshal_BlendEquationSeparateiARB(struct gl_context *ctx, const struct marshal_cmd_BlendEquationSeparateiARB *cmd, const uint64_t *last) 3216{ 3217 GLuint buf = cmd->buf; 3218 GLenum modeRGB = cmd->modeRGB; 3219 GLenum modeA = cmd->modeA; 3220 CALL_BlendEquationSeparateiARB(ctx->CurrentServerDispatch, (buf, modeRGB, modeA)); 3221 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BlendEquationSeparateiARB), 8) / 8); 3222 assert (cmd_size == cmd->cmd_base.cmd_size); 3223 return cmd_size; 3224} 3225void GLAPIENTRY 3226_mesa_marshal_BlendEquationSeparateiARB(GLuint buf, GLenum modeRGB, GLenum modeA) 3227{ 3228 GET_CURRENT_CONTEXT(ctx); 3229 int cmd_size = sizeof(struct marshal_cmd_BlendEquationSeparateiARB); 3230 struct marshal_cmd_BlendEquationSeparateiARB *cmd; 3231 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendEquationSeparateiARB, cmd_size); 3232 cmd->buf = buf; 3233 cmd->modeRGB = modeRGB; 3234 cmd->modeA = modeA; 3235} 3236 3237 3238/* BlendFunciARB: marshalled asynchronously */ 3239struct marshal_cmd_BlendFunciARB 3240{ 3241 struct marshal_cmd_base cmd_base; 3242 GLuint buf; 3243 GLenum src; 3244 GLenum dst; 3245}; 3246uint32_t 3247_mesa_unmarshal_BlendFunciARB(struct gl_context *ctx, const struct marshal_cmd_BlendFunciARB *cmd, const uint64_t *last) 3248{ 3249 GLuint buf = cmd->buf; 3250 GLenum src = cmd->src; 3251 GLenum dst = cmd->dst; 3252 CALL_BlendFunciARB(ctx->CurrentServerDispatch, (buf, src, dst)); 3253 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BlendFunciARB), 8) / 8); 3254 assert (cmd_size == cmd->cmd_base.cmd_size); 3255 return cmd_size; 3256} 3257void GLAPIENTRY 3258_mesa_marshal_BlendFunciARB(GLuint buf, GLenum src, GLenum dst) 3259{ 3260 GET_CURRENT_CONTEXT(ctx); 3261 int cmd_size = sizeof(struct marshal_cmd_BlendFunciARB); 3262 struct marshal_cmd_BlendFunciARB *cmd; 3263 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendFunciARB, cmd_size); 3264 cmd->buf = buf; 3265 cmd->src = src; 3266 cmd->dst = dst; 3267} 3268 3269 3270/* BlendFuncSeparateiARB: marshalled asynchronously */ 3271struct marshal_cmd_BlendFuncSeparateiARB 3272{ 3273 struct marshal_cmd_base cmd_base; 3274 GLuint buf; 3275 GLenum srcRGB; 3276 GLenum dstRGB; 3277 GLenum srcA; 3278 GLenum dstA; 3279}; 3280uint32_t 3281_mesa_unmarshal_BlendFuncSeparateiARB(struct gl_context *ctx, const struct marshal_cmd_BlendFuncSeparateiARB *cmd, const uint64_t *last) 3282{ 3283 GLuint buf = cmd->buf; 3284 GLenum srcRGB = cmd->srcRGB; 3285 GLenum dstRGB = cmd->dstRGB; 3286 GLenum srcA = cmd->srcA; 3287 GLenum dstA = cmd->dstA; 3288 CALL_BlendFuncSeparateiARB(ctx->CurrentServerDispatch, (buf, srcRGB, dstRGB, srcA, dstA)); 3289 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BlendFuncSeparateiARB), 8) / 8); 3290 assert (cmd_size == cmd->cmd_base.cmd_size); 3291 return cmd_size; 3292} 3293void GLAPIENTRY 3294_mesa_marshal_BlendFuncSeparateiARB(GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcA, GLenum dstA) 3295{ 3296 GET_CURRENT_CONTEXT(ctx); 3297 int cmd_size = sizeof(struct marshal_cmd_BlendFuncSeparateiARB); 3298 struct marshal_cmd_BlendFuncSeparateiARB *cmd; 3299 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BlendFuncSeparateiARB, cmd_size); 3300 cmd->buf = buf; 3301 cmd->srcRGB = srcRGB; 3302 cmd->dstRGB = dstRGB; 3303 cmd->srcA = srcA; 3304 cmd->dstA = dstA; 3305} 3306 3307 3308/* MinSampleShading: marshalled asynchronously */ 3309struct marshal_cmd_MinSampleShading 3310{ 3311 struct marshal_cmd_base cmd_base; 3312 GLfloat value; 3313}; 3314uint32_t 3315_mesa_unmarshal_MinSampleShading(struct gl_context *ctx, const struct marshal_cmd_MinSampleShading *cmd, const uint64_t *last) 3316{ 3317 GLfloat value = cmd->value; 3318 CALL_MinSampleShading(ctx->CurrentServerDispatch, (value)); 3319 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MinSampleShading), 8) / 8); 3320 assert (cmd_size == cmd->cmd_base.cmd_size); 3321 return cmd_size; 3322} 3323void GLAPIENTRY 3324_mesa_marshal_MinSampleShading(GLfloat value) 3325{ 3326 GET_CURRENT_CONTEXT(ctx); 3327 int cmd_size = sizeof(struct marshal_cmd_MinSampleShading); 3328 struct marshal_cmd_MinSampleShading *cmd; 3329 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MinSampleShading, cmd_size); 3330 cmd->value = value; 3331} 3332 3333 3334/* NamedStringARB: marshalled asynchronously */ 3335struct marshal_cmd_NamedStringARB 3336{ 3337 struct marshal_cmd_base cmd_base; 3338 GLenum type; 3339 GLint namelen; 3340 GLint stringlen; 3341 /* Next namelen bytes are GLchar name[namelen] */ 3342 /* Next stringlen bytes are GLchar string[stringlen] */ 3343}; 3344uint32_t 3345_mesa_unmarshal_NamedStringARB(struct gl_context *ctx, const struct marshal_cmd_NamedStringARB *cmd, const uint64_t *last) 3346{ 3347 GLenum type = cmd->type; 3348 GLint namelen = cmd->namelen; 3349 GLint stringlen = cmd->stringlen; 3350 GLchar * name; 3351 GLchar * string; 3352 const char *variable_data = (const char *) (cmd + 1); 3353 name = (GLchar *) variable_data; 3354 variable_data += namelen; 3355 string = (GLchar *) variable_data; 3356 CALL_NamedStringARB(ctx->CurrentServerDispatch, (type, namelen, name, stringlen, string)); 3357 return cmd->cmd_base.cmd_size; 3358} 3359void GLAPIENTRY 3360_mesa_marshal_NamedStringARB(GLenum type, GLint namelen, const GLchar * name, GLint stringlen, const GLchar * string) 3361{ 3362 GET_CURRENT_CONTEXT(ctx); 3363 int name_size = namelen; 3364 int string_size = stringlen; 3365 int cmd_size = sizeof(struct marshal_cmd_NamedStringARB) + name_size + string_size; 3366 struct marshal_cmd_NamedStringARB *cmd; 3367 if (unlikely(name_size < 0 || (name_size > 0 && !name) || string_size < 0 || (string_size > 0 && !string) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 3368 _mesa_glthread_finish_before(ctx, "NamedStringARB"); 3369 CALL_NamedStringARB(ctx->CurrentServerDispatch, (type, namelen, name, stringlen, string)); 3370 return; 3371 } 3372 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedStringARB, cmd_size); 3373 cmd->type = type; 3374 cmd->namelen = namelen; 3375 cmd->stringlen = stringlen; 3376 char *variable_data = (char *) (cmd + 1); 3377 memcpy(variable_data, name, name_size); 3378 variable_data += name_size; 3379 memcpy(variable_data, string, string_size); 3380} 3381 3382 3383/* DeleteNamedStringARB: marshalled asynchronously */ 3384struct marshal_cmd_DeleteNamedStringARB 3385{ 3386 struct marshal_cmd_base cmd_base; 3387 GLint namelen; 3388 /* Next namelen bytes are GLchar name[namelen] */ 3389}; 3390uint32_t 3391_mesa_unmarshal_DeleteNamedStringARB(struct gl_context *ctx, const struct marshal_cmd_DeleteNamedStringARB *cmd, const uint64_t *last) 3392{ 3393 GLint namelen = cmd->namelen; 3394 GLchar * name; 3395 const char *variable_data = (const char *) (cmd + 1); 3396 name = (GLchar *) variable_data; 3397 CALL_DeleteNamedStringARB(ctx->CurrentServerDispatch, (namelen, name)); 3398 return cmd->cmd_base.cmd_size; 3399} 3400void GLAPIENTRY 3401_mesa_marshal_DeleteNamedStringARB(GLint namelen, const GLchar * name) 3402{ 3403 GET_CURRENT_CONTEXT(ctx); 3404 int name_size = namelen; 3405 int cmd_size = sizeof(struct marshal_cmd_DeleteNamedStringARB) + name_size; 3406 struct marshal_cmd_DeleteNamedStringARB *cmd; 3407 if (unlikely(name_size < 0 || (name_size > 0 && !name) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 3408 _mesa_glthread_finish_before(ctx, "DeleteNamedStringARB"); 3409 CALL_DeleteNamedStringARB(ctx->CurrentServerDispatch, (namelen, name)); 3410 return; 3411 } 3412 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteNamedStringARB, cmd_size); 3413 cmd->namelen = namelen; 3414 char *variable_data = (char *) (cmd + 1); 3415 memcpy(variable_data, name, name_size); 3416} 3417 3418 3419/* CompileShaderIncludeARB: marshalled synchronously */ 3420void GLAPIENTRY 3421_mesa_marshal_CompileShaderIncludeARB(GLuint shader, GLsizei count, const GLchar * const * path, const GLint * length) 3422{ 3423 GET_CURRENT_CONTEXT(ctx); 3424 _mesa_glthread_finish_before(ctx, "CompileShaderIncludeARB"); 3425 CALL_CompileShaderIncludeARB(ctx->CurrentServerDispatch, (shader, count, path, length)); 3426} 3427 3428 3429/* IsNamedStringARB: marshalled synchronously */ 3430GLboolean GLAPIENTRY 3431_mesa_marshal_IsNamedStringARB(GLint namelen, const GLchar * name) 3432{ 3433 GET_CURRENT_CONTEXT(ctx); 3434 _mesa_glthread_finish_before(ctx, "IsNamedStringARB"); 3435 return CALL_IsNamedStringARB(ctx->CurrentServerDispatch, (namelen, name)); 3436} 3437 3438 3439/* GetNamedStringARB: marshalled synchronously */ 3440void GLAPIENTRY 3441_mesa_marshal_GetNamedStringARB(GLint namelen, const GLchar * name, GLsizei bufSize, GLint * stringlen, GLchar * string) 3442{ 3443 GET_CURRENT_CONTEXT(ctx); 3444 _mesa_glthread_finish_before(ctx, "GetNamedStringARB"); 3445 CALL_GetNamedStringARB(ctx->CurrentServerDispatch, (namelen, name, bufSize, stringlen, string)); 3446} 3447 3448 3449/* GetNamedStringivARB: marshalled synchronously */ 3450void GLAPIENTRY 3451_mesa_marshal_GetNamedStringivARB(GLint namelen, const GLchar * name, GLenum pname, GLint * params) 3452{ 3453 GET_CURRENT_CONTEXT(ctx); 3454 _mesa_glthread_finish_before(ctx, "GetNamedStringivARB"); 3455 CALL_GetNamedStringivARB(ctx->CurrentServerDispatch, (namelen, name, pname, params)); 3456} 3457 3458 3459/* BindFragDataLocationIndexed: marshalled asynchronously */ 3460struct marshal_cmd_BindFragDataLocationIndexed 3461{ 3462 struct marshal_cmd_base cmd_base; 3463 GLuint program; 3464 GLuint colorNumber; 3465 GLuint index; 3466 /* Next (strlen(name) + 1) bytes are GLchar name[(strlen(name) + 1)] */ 3467}; 3468uint32_t 3469_mesa_unmarshal_BindFragDataLocationIndexed(struct gl_context *ctx, const struct marshal_cmd_BindFragDataLocationIndexed *cmd, const uint64_t *last) 3470{ 3471 GLuint program = cmd->program; 3472 GLuint colorNumber = cmd->colorNumber; 3473 GLuint index = cmd->index; 3474 GLchar * name; 3475 const char *variable_data = (const char *) (cmd + 1); 3476 name = (GLchar *) variable_data; 3477 CALL_BindFragDataLocationIndexed(ctx->CurrentServerDispatch, (program, colorNumber, index, name)); 3478 return cmd->cmd_base.cmd_size; 3479} 3480void GLAPIENTRY 3481_mesa_marshal_BindFragDataLocationIndexed(GLuint program, GLuint colorNumber, GLuint index, const GLchar * name) 3482{ 3483 GET_CURRENT_CONTEXT(ctx); 3484 int name_size = (strlen(name) + 1); 3485 int cmd_size = sizeof(struct marshal_cmd_BindFragDataLocationIndexed) + name_size; 3486 struct marshal_cmd_BindFragDataLocationIndexed *cmd; 3487 if (unlikely(name_size < 0 || (name_size > 0 && !name) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 3488 _mesa_glthread_finish_before(ctx, "BindFragDataLocationIndexed"); 3489 CALL_BindFragDataLocationIndexed(ctx->CurrentServerDispatch, (program, colorNumber, index, name)); 3490 return; 3491 } 3492 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindFragDataLocationIndexed, cmd_size); 3493 cmd->program = program; 3494 cmd->colorNumber = colorNumber; 3495 cmd->index = index; 3496 char *variable_data = (char *) (cmd + 1); 3497 memcpy(variable_data, name, name_size); 3498} 3499 3500 3501/* GetFragDataIndex: marshalled synchronously */ 3502GLint GLAPIENTRY 3503_mesa_marshal_GetFragDataIndex(GLuint program, const GLchar * name) 3504{ 3505 GET_CURRENT_CONTEXT(ctx); 3506 _mesa_glthread_finish_before(ctx, "GetFragDataIndex"); 3507 return CALL_GetFragDataIndex(ctx->CurrentServerDispatch, (program, name)); 3508} 3509 3510 3511/* GenSamplers: marshalled synchronously */ 3512void GLAPIENTRY 3513_mesa_marshal_GenSamplers(GLsizei count, GLuint * samplers) 3514{ 3515 GET_CURRENT_CONTEXT(ctx); 3516 _mesa_glthread_finish_before(ctx, "GenSamplers"); 3517 CALL_GenSamplers(ctx->CurrentServerDispatch, (count, samplers)); 3518} 3519 3520 3521/* DeleteSamplers: marshalled asynchronously */ 3522struct marshal_cmd_DeleteSamplers 3523{ 3524 struct marshal_cmd_base cmd_base; 3525 GLsizei count; 3526 /* Next safe_mul(count, 1 * sizeof(GLuint)) bytes are GLuint samplers[count] */ 3527}; 3528uint32_t 3529_mesa_unmarshal_DeleteSamplers(struct gl_context *ctx, const struct marshal_cmd_DeleteSamplers *cmd, const uint64_t *last) 3530{ 3531 GLsizei count = cmd->count; 3532 GLuint * samplers; 3533 const char *variable_data = (const char *) (cmd + 1); 3534 samplers = (GLuint *) variable_data; 3535 CALL_DeleteSamplers(ctx->CurrentServerDispatch, (count, samplers)); 3536 return cmd->cmd_base.cmd_size; 3537} 3538void GLAPIENTRY 3539_mesa_marshal_DeleteSamplers(GLsizei count, const GLuint * samplers) 3540{ 3541 GET_CURRENT_CONTEXT(ctx); 3542 int samplers_size = safe_mul(count, 1 * sizeof(GLuint)); 3543 int cmd_size = sizeof(struct marshal_cmd_DeleteSamplers) + samplers_size; 3544 struct marshal_cmd_DeleteSamplers *cmd; 3545 if (unlikely(samplers_size < 0 || (samplers_size > 0 && !samplers) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 3546 _mesa_glthread_finish_before(ctx, "DeleteSamplers"); 3547 CALL_DeleteSamplers(ctx->CurrentServerDispatch, (count, samplers)); 3548 return; 3549 } 3550 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteSamplers, cmd_size); 3551 cmd->count = count; 3552 char *variable_data = (char *) (cmd + 1); 3553 memcpy(variable_data, samplers, samplers_size); 3554} 3555 3556 3557/* IsSampler: marshalled synchronously */ 3558GLboolean GLAPIENTRY 3559_mesa_marshal_IsSampler(GLuint sampler) 3560{ 3561 GET_CURRENT_CONTEXT(ctx); 3562 _mesa_glthread_finish_before(ctx, "IsSampler"); 3563 return CALL_IsSampler(ctx->CurrentServerDispatch, (sampler)); 3564} 3565 3566 3567/* BindSampler: marshalled asynchronously */ 3568struct marshal_cmd_BindSampler 3569{ 3570 struct marshal_cmd_base cmd_base; 3571 GLuint unit; 3572 GLuint sampler; 3573}; 3574uint32_t 3575_mesa_unmarshal_BindSampler(struct gl_context *ctx, const struct marshal_cmd_BindSampler *cmd, const uint64_t *last) 3576{ 3577 GLuint unit = cmd->unit; 3578 GLuint sampler = cmd->sampler; 3579 CALL_BindSampler(ctx->CurrentServerDispatch, (unit, sampler)); 3580 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindSampler), 8) / 8); 3581 assert (cmd_size == cmd->cmd_base.cmd_size); 3582 return cmd_size; 3583} 3584void GLAPIENTRY 3585_mesa_marshal_BindSampler(GLuint unit, GLuint sampler) 3586{ 3587 GET_CURRENT_CONTEXT(ctx); 3588 int cmd_size = sizeof(struct marshal_cmd_BindSampler); 3589 struct marshal_cmd_BindSampler *cmd; 3590 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindSampler, cmd_size); 3591 cmd->unit = unit; 3592 cmd->sampler = sampler; 3593} 3594 3595 3596/* SamplerParameteri: marshalled asynchronously */ 3597struct marshal_cmd_SamplerParameteri 3598{ 3599 struct marshal_cmd_base cmd_base; 3600 GLuint sampler; 3601 GLenum pname; 3602 GLint param; 3603}; 3604uint32_t 3605_mesa_unmarshal_SamplerParameteri(struct gl_context *ctx, const struct marshal_cmd_SamplerParameteri *cmd, const uint64_t *last) 3606{ 3607 GLuint sampler = cmd->sampler; 3608 GLenum pname = cmd->pname; 3609 GLint param = cmd->param; 3610 CALL_SamplerParameteri(ctx->CurrentServerDispatch, (sampler, pname, param)); 3611 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SamplerParameteri), 8) / 8); 3612 assert (cmd_size == cmd->cmd_base.cmd_size); 3613 return cmd_size; 3614} 3615void GLAPIENTRY 3616_mesa_marshal_SamplerParameteri(GLuint sampler, GLenum pname, GLint param) 3617{ 3618 GET_CURRENT_CONTEXT(ctx); 3619 int cmd_size = sizeof(struct marshal_cmd_SamplerParameteri); 3620 struct marshal_cmd_SamplerParameteri *cmd; 3621 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SamplerParameteri, cmd_size); 3622 cmd->sampler = sampler; 3623 cmd->pname = pname; 3624 cmd->param = param; 3625} 3626 3627 3628/* SamplerParameterf: marshalled asynchronously */ 3629struct marshal_cmd_SamplerParameterf 3630{ 3631 struct marshal_cmd_base cmd_base; 3632 GLuint sampler; 3633 GLenum pname; 3634 GLfloat param; 3635}; 3636uint32_t 3637_mesa_unmarshal_SamplerParameterf(struct gl_context *ctx, const struct marshal_cmd_SamplerParameterf *cmd, const uint64_t *last) 3638{ 3639 GLuint sampler = cmd->sampler; 3640 GLenum pname = cmd->pname; 3641 GLfloat param = cmd->param; 3642 CALL_SamplerParameterf(ctx->CurrentServerDispatch, (sampler, pname, param)); 3643 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SamplerParameterf), 8) / 8); 3644 assert (cmd_size == cmd->cmd_base.cmd_size); 3645 return cmd_size; 3646} 3647void GLAPIENTRY 3648_mesa_marshal_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param) 3649{ 3650 GET_CURRENT_CONTEXT(ctx); 3651 int cmd_size = sizeof(struct marshal_cmd_SamplerParameterf); 3652 struct marshal_cmd_SamplerParameterf *cmd; 3653 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SamplerParameterf, cmd_size); 3654 cmd->sampler = sampler; 3655 cmd->pname = pname; 3656 cmd->param = param; 3657} 3658 3659 3660/* SamplerParameteriv: marshalled asynchronously */ 3661struct marshal_cmd_SamplerParameteriv 3662{ 3663 struct marshal_cmd_base cmd_base; 3664 GLuint sampler; 3665 GLenum pname; 3666 /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint)) bytes are GLint params[_mesa_tex_param_enum_to_count(pname)] */ 3667}; 3668uint32_t 3669_mesa_unmarshal_SamplerParameteriv(struct gl_context *ctx, const struct marshal_cmd_SamplerParameteriv *cmd, const uint64_t *last) 3670{ 3671 GLuint sampler = cmd->sampler; 3672 GLenum pname = cmd->pname; 3673 GLint * params; 3674 const char *variable_data = (const char *) (cmd + 1); 3675 params = (GLint *) variable_data; 3676 CALL_SamplerParameteriv(ctx->CurrentServerDispatch, (sampler, pname, params)); 3677 return cmd->cmd_base.cmd_size; 3678} 3679void GLAPIENTRY 3680_mesa_marshal_SamplerParameteriv(GLuint sampler, GLenum pname, const GLint * params) 3681{ 3682 GET_CURRENT_CONTEXT(ctx); 3683 int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint)); 3684 int cmd_size = sizeof(struct marshal_cmd_SamplerParameteriv) + params_size; 3685 struct marshal_cmd_SamplerParameteriv *cmd; 3686 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 3687 _mesa_glthread_finish_before(ctx, "SamplerParameteriv"); 3688 CALL_SamplerParameteriv(ctx->CurrentServerDispatch, (sampler, pname, params)); 3689 return; 3690 } 3691 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SamplerParameteriv, cmd_size); 3692 cmd->sampler = sampler; 3693 cmd->pname = pname; 3694 char *variable_data = (char *) (cmd + 1); 3695 memcpy(variable_data, params, params_size); 3696} 3697 3698 3699/* SamplerParameterfv: marshalled asynchronously */ 3700struct marshal_cmd_SamplerParameterfv 3701{ 3702 struct marshal_cmd_base cmd_base; 3703 GLuint sampler; 3704 GLenum pname; 3705 /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLfloat)) bytes are GLfloat params[_mesa_tex_param_enum_to_count(pname)] */ 3706}; 3707uint32_t 3708_mesa_unmarshal_SamplerParameterfv(struct gl_context *ctx, const struct marshal_cmd_SamplerParameterfv *cmd, const uint64_t *last) 3709{ 3710 GLuint sampler = cmd->sampler; 3711 GLenum pname = cmd->pname; 3712 GLfloat * params; 3713 const char *variable_data = (const char *) (cmd + 1); 3714 params = (GLfloat *) variable_data; 3715 CALL_SamplerParameterfv(ctx->CurrentServerDispatch, (sampler, pname, params)); 3716 return cmd->cmd_base.cmd_size; 3717} 3718void GLAPIENTRY 3719_mesa_marshal_SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat * params) 3720{ 3721 GET_CURRENT_CONTEXT(ctx); 3722 int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLfloat)); 3723 int cmd_size = sizeof(struct marshal_cmd_SamplerParameterfv) + params_size; 3724 struct marshal_cmd_SamplerParameterfv *cmd; 3725 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 3726 _mesa_glthread_finish_before(ctx, "SamplerParameterfv"); 3727 CALL_SamplerParameterfv(ctx->CurrentServerDispatch, (sampler, pname, params)); 3728 return; 3729 } 3730 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SamplerParameterfv, cmd_size); 3731 cmd->sampler = sampler; 3732 cmd->pname = pname; 3733 char *variable_data = (char *) (cmd + 1); 3734 memcpy(variable_data, params, params_size); 3735} 3736 3737 3738/* SamplerParameterIiv: marshalled asynchronously */ 3739struct marshal_cmd_SamplerParameterIiv 3740{ 3741 struct marshal_cmd_base cmd_base; 3742 GLuint sampler; 3743 GLenum pname; 3744 /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint)) bytes are GLint params[_mesa_tex_param_enum_to_count(pname)] */ 3745}; 3746uint32_t 3747_mesa_unmarshal_SamplerParameterIiv(struct gl_context *ctx, const struct marshal_cmd_SamplerParameterIiv *cmd, const uint64_t *last) 3748{ 3749 GLuint sampler = cmd->sampler; 3750 GLenum pname = cmd->pname; 3751 GLint * params; 3752 const char *variable_data = (const char *) (cmd + 1); 3753 params = (GLint *) variable_data; 3754 CALL_SamplerParameterIiv(ctx->CurrentServerDispatch, (sampler, pname, params)); 3755 return cmd->cmd_base.cmd_size; 3756} 3757void GLAPIENTRY 3758_mesa_marshal_SamplerParameterIiv(GLuint sampler, GLenum pname, const GLint * params) 3759{ 3760 GET_CURRENT_CONTEXT(ctx); 3761 int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint)); 3762 int cmd_size = sizeof(struct marshal_cmd_SamplerParameterIiv) + params_size; 3763 struct marshal_cmd_SamplerParameterIiv *cmd; 3764 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 3765 _mesa_glthread_finish_before(ctx, "SamplerParameterIiv"); 3766 CALL_SamplerParameterIiv(ctx->CurrentServerDispatch, (sampler, pname, params)); 3767 return; 3768 } 3769 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SamplerParameterIiv, cmd_size); 3770 cmd->sampler = sampler; 3771 cmd->pname = pname; 3772 char *variable_data = (char *) (cmd + 1); 3773 memcpy(variable_data, params, params_size); 3774} 3775 3776 3777/* SamplerParameterIuiv: marshalled asynchronously */ 3778struct marshal_cmd_SamplerParameterIuiv 3779{ 3780 struct marshal_cmd_base cmd_base; 3781 GLuint sampler; 3782 GLenum pname; 3783 /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLuint)) bytes are GLuint params[_mesa_tex_param_enum_to_count(pname)] */ 3784}; 3785uint32_t 3786_mesa_unmarshal_SamplerParameterIuiv(struct gl_context *ctx, const struct marshal_cmd_SamplerParameterIuiv *cmd, const uint64_t *last) 3787{ 3788 GLuint sampler = cmd->sampler; 3789 GLenum pname = cmd->pname; 3790 GLuint * params; 3791 const char *variable_data = (const char *) (cmd + 1); 3792 params = (GLuint *) variable_data; 3793 CALL_SamplerParameterIuiv(ctx->CurrentServerDispatch, (sampler, pname, params)); 3794 return cmd->cmd_base.cmd_size; 3795} 3796void GLAPIENTRY 3797_mesa_marshal_SamplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint * params) 3798{ 3799 GET_CURRENT_CONTEXT(ctx); 3800 int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLuint)); 3801 int cmd_size = sizeof(struct marshal_cmd_SamplerParameterIuiv) + params_size; 3802 struct marshal_cmd_SamplerParameterIuiv *cmd; 3803 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 3804 _mesa_glthread_finish_before(ctx, "SamplerParameterIuiv"); 3805 CALL_SamplerParameterIuiv(ctx->CurrentServerDispatch, (sampler, pname, params)); 3806 return; 3807 } 3808 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SamplerParameterIuiv, cmd_size); 3809 cmd->sampler = sampler; 3810 cmd->pname = pname; 3811 char *variable_data = (char *) (cmd + 1); 3812 memcpy(variable_data, params, params_size); 3813} 3814 3815 3816/* GetSamplerParameteriv: marshalled synchronously */ 3817void GLAPIENTRY 3818_mesa_marshal_GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint * params) 3819{ 3820 GET_CURRENT_CONTEXT(ctx); 3821 _mesa_glthread_finish_before(ctx, "GetSamplerParameteriv"); 3822 CALL_GetSamplerParameteriv(ctx->CurrentServerDispatch, (sampler, pname, params)); 3823} 3824 3825 3826/* GetSamplerParameterfv: marshalled synchronously */ 3827void GLAPIENTRY 3828_mesa_marshal_GetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat * params) 3829{ 3830 GET_CURRENT_CONTEXT(ctx); 3831 _mesa_glthread_finish_before(ctx, "GetSamplerParameterfv"); 3832 CALL_GetSamplerParameterfv(ctx->CurrentServerDispatch, (sampler, pname, params)); 3833} 3834 3835 3836/* GetSamplerParameterIiv: marshalled synchronously */ 3837void GLAPIENTRY 3838_mesa_marshal_GetSamplerParameterIiv(GLuint sampler, GLenum pname, GLint * params) 3839{ 3840 GET_CURRENT_CONTEXT(ctx); 3841 _mesa_glthread_finish_before(ctx, "GetSamplerParameterIiv"); 3842 CALL_GetSamplerParameterIiv(ctx->CurrentServerDispatch, (sampler, pname, params)); 3843} 3844 3845 3846/* GetSamplerParameterIuiv: marshalled synchronously */ 3847void GLAPIENTRY 3848_mesa_marshal_GetSamplerParameterIuiv(GLuint sampler, GLenum pname, GLuint * params) 3849{ 3850 GET_CURRENT_CONTEXT(ctx); 3851 _mesa_glthread_finish_before(ctx, "GetSamplerParameterIuiv"); 3852 CALL_GetSamplerParameterIuiv(ctx->CurrentServerDispatch, (sampler, pname, params)); 3853} 3854 3855 3856/* GetQueryObjecti64v: marshalled synchronously */ 3857void GLAPIENTRY 3858_mesa_marshal_GetQueryObjecti64v(GLuint id, GLenum pname, GLint64 * params) 3859{ 3860 GET_CURRENT_CONTEXT(ctx); 3861 _mesa_glthread_finish_before(ctx, "GetQueryObjecti64v"); 3862 CALL_GetQueryObjecti64v(ctx->CurrentServerDispatch, (id, pname, params)); 3863} 3864 3865 3866/* GetQueryObjectui64v: marshalled synchronously */ 3867void GLAPIENTRY 3868_mesa_marshal_GetQueryObjectui64v(GLuint id, GLenum pname, GLuint64 * params) 3869{ 3870 GET_CURRENT_CONTEXT(ctx); 3871 _mesa_glthread_finish_before(ctx, "GetQueryObjectui64v"); 3872 CALL_GetQueryObjectui64v(ctx->CurrentServerDispatch, (id, pname, params)); 3873} 3874 3875 3876/* QueryCounter: marshalled asynchronously */ 3877struct marshal_cmd_QueryCounter 3878{ 3879 struct marshal_cmd_base cmd_base; 3880 GLuint id; 3881 GLenum target; 3882}; 3883uint32_t 3884_mesa_unmarshal_QueryCounter(struct gl_context *ctx, const struct marshal_cmd_QueryCounter *cmd, const uint64_t *last) 3885{ 3886 GLuint id = cmd->id; 3887 GLenum target = cmd->target; 3888 CALL_QueryCounter(ctx->CurrentServerDispatch, (id, target)); 3889 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_QueryCounter), 8) / 8); 3890 assert (cmd_size == cmd->cmd_base.cmd_size); 3891 return cmd_size; 3892} 3893void GLAPIENTRY 3894_mesa_marshal_QueryCounter(GLuint id, GLenum target) 3895{ 3896 GET_CURRENT_CONTEXT(ctx); 3897 int cmd_size = sizeof(struct marshal_cmd_QueryCounter); 3898 struct marshal_cmd_QueryCounter *cmd; 3899 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_QueryCounter, cmd_size); 3900 cmd->id = id; 3901 cmd->target = target; 3902} 3903 3904 3905/* VertexP2ui: marshalled asynchronously */ 3906struct marshal_cmd_VertexP2ui 3907{ 3908 struct marshal_cmd_base cmd_base; 3909 GLenum type; 3910 GLuint value; 3911}; 3912uint32_t 3913_mesa_unmarshal_VertexP2ui(struct gl_context *ctx, const struct marshal_cmd_VertexP2ui *cmd, const uint64_t *last) 3914{ 3915 GLenum type = cmd->type; 3916 GLuint value = cmd->value; 3917 CALL_VertexP2ui(ctx->CurrentServerDispatch, (type, value)); 3918 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexP2ui), 8) / 8); 3919 assert (cmd_size == cmd->cmd_base.cmd_size); 3920 return cmd_size; 3921} 3922void GLAPIENTRY 3923_mesa_marshal_VertexP2ui(GLenum type, GLuint value) 3924{ 3925 GET_CURRENT_CONTEXT(ctx); 3926 int cmd_size = sizeof(struct marshal_cmd_VertexP2ui); 3927 struct marshal_cmd_VertexP2ui *cmd; 3928 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexP2ui, cmd_size); 3929 cmd->type = type; 3930 cmd->value = value; 3931} 3932 3933 3934/* VertexP3ui: marshalled asynchronously */ 3935struct marshal_cmd_VertexP3ui 3936{ 3937 struct marshal_cmd_base cmd_base; 3938 GLenum type; 3939 GLuint value; 3940}; 3941uint32_t 3942_mesa_unmarshal_VertexP3ui(struct gl_context *ctx, const struct marshal_cmd_VertexP3ui *cmd, const uint64_t *last) 3943{ 3944 GLenum type = cmd->type; 3945 GLuint value = cmd->value; 3946 CALL_VertexP3ui(ctx->CurrentServerDispatch, (type, value)); 3947 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexP3ui), 8) / 8); 3948 assert (cmd_size == cmd->cmd_base.cmd_size); 3949 return cmd_size; 3950} 3951void GLAPIENTRY 3952_mesa_marshal_VertexP3ui(GLenum type, GLuint value) 3953{ 3954 GET_CURRENT_CONTEXT(ctx); 3955 int cmd_size = sizeof(struct marshal_cmd_VertexP3ui); 3956 struct marshal_cmd_VertexP3ui *cmd; 3957 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexP3ui, cmd_size); 3958 cmd->type = type; 3959 cmd->value = value; 3960} 3961 3962 3963/* VertexP4ui: marshalled asynchronously */ 3964struct marshal_cmd_VertexP4ui 3965{ 3966 struct marshal_cmd_base cmd_base; 3967 GLenum type; 3968 GLuint value; 3969}; 3970uint32_t 3971_mesa_unmarshal_VertexP4ui(struct gl_context *ctx, const struct marshal_cmd_VertexP4ui *cmd, const uint64_t *last) 3972{ 3973 GLenum type = cmd->type; 3974 GLuint value = cmd->value; 3975 CALL_VertexP4ui(ctx->CurrentServerDispatch, (type, value)); 3976 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexP4ui), 8) / 8); 3977 assert (cmd_size == cmd->cmd_base.cmd_size); 3978 return cmd_size; 3979} 3980void GLAPIENTRY 3981_mesa_marshal_VertexP4ui(GLenum type, GLuint value) 3982{ 3983 GET_CURRENT_CONTEXT(ctx); 3984 int cmd_size = sizeof(struct marshal_cmd_VertexP4ui); 3985 struct marshal_cmd_VertexP4ui *cmd; 3986 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexP4ui, cmd_size); 3987 cmd->type = type; 3988 cmd->value = value; 3989} 3990 3991 3992/* VertexP2uiv: marshalled asynchronously */ 3993struct marshal_cmd_VertexP2uiv 3994{ 3995 struct marshal_cmd_base cmd_base; 3996 GLenum type; 3997 GLuint value[1]; 3998}; 3999uint32_t 4000_mesa_unmarshal_VertexP2uiv(struct gl_context *ctx, const struct marshal_cmd_VertexP2uiv *cmd, const uint64_t *last) 4001{ 4002 GLenum type = cmd->type; 4003 const GLuint * value = cmd->value; 4004 CALL_VertexP2uiv(ctx->CurrentServerDispatch, (type, value)); 4005 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexP2uiv), 8) / 8); 4006 assert (cmd_size == cmd->cmd_base.cmd_size); 4007 return cmd_size; 4008} 4009void GLAPIENTRY 4010_mesa_marshal_VertexP2uiv(GLenum type, const GLuint * value) 4011{ 4012 GET_CURRENT_CONTEXT(ctx); 4013 int cmd_size = sizeof(struct marshal_cmd_VertexP2uiv); 4014 struct marshal_cmd_VertexP2uiv *cmd; 4015 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexP2uiv, cmd_size); 4016 cmd->type = type; 4017 memcpy(cmd->value, value, 1 * sizeof(GLuint)); 4018} 4019 4020 4021/* VertexP3uiv: marshalled asynchronously */ 4022struct marshal_cmd_VertexP3uiv 4023{ 4024 struct marshal_cmd_base cmd_base; 4025 GLenum type; 4026 GLuint value[1]; 4027}; 4028uint32_t 4029_mesa_unmarshal_VertexP3uiv(struct gl_context *ctx, const struct marshal_cmd_VertexP3uiv *cmd, const uint64_t *last) 4030{ 4031 GLenum type = cmd->type; 4032 const GLuint * value = cmd->value; 4033 CALL_VertexP3uiv(ctx->CurrentServerDispatch, (type, value)); 4034 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexP3uiv), 8) / 8); 4035 assert (cmd_size == cmd->cmd_base.cmd_size); 4036 return cmd_size; 4037} 4038void GLAPIENTRY 4039_mesa_marshal_VertexP3uiv(GLenum type, const GLuint * value) 4040{ 4041 GET_CURRENT_CONTEXT(ctx); 4042 int cmd_size = sizeof(struct marshal_cmd_VertexP3uiv); 4043 struct marshal_cmd_VertexP3uiv *cmd; 4044 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexP3uiv, cmd_size); 4045 cmd->type = type; 4046 memcpy(cmd->value, value, 1 * sizeof(GLuint)); 4047} 4048 4049 4050/* VertexP4uiv: marshalled asynchronously */ 4051struct marshal_cmd_VertexP4uiv 4052{ 4053 struct marshal_cmd_base cmd_base; 4054 GLenum type; 4055 GLuint value[1]; 4056}; 4057uint32_t 4058_mesa_unmarshal_VertexP4uiv(struct gl_context *ctx, const struct marshal_cmd_VertexP4uiv *cmd, const uint64_t *last) 4059{ 4060 GLenum type = cmd->type; 4061 const GLuint * value = cmd->value; 4062 CALL_VertexP4uiv(ctx->CurrentServerDispatch, (type, value)); 4063 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexP4uiv), 8) / 8); 4064 assert (cmd_size == cmd->cmd_base.cmd_size); 4065 return cmd_size; 4066} 4067void GLAPIENTRY 4068_mesa_marshal_VertexP4uiv(GLenum type, const GLuint * value) 4069{ 4070 GET_CURRENT_CONTEXT(ctx); 4071 int cmd_size = sizeof(struct marshal_cmd_VertexP4uiv); 4072 struct marshal_cmd_VertexP4uiv *cmd; 4073 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexP4uiv, cmd_size); 4074 cmd->type = type; 4075 memcpy(cmd->value, value, 1 * sizeof(GLuint)); 4076} 4077 4078 4079/* TexCoordP1ui: marshalled asynchronously */ 4080struct marshal_cmd_TexCoordP1ui 4081{ 4082 struct marshal_cmd_base cmd_base; 4083 GLenum type; 4084 GLuint coords; 4085}; 4086uint32_t 4087_mesa_unmarshal_TexCoordP1ui(struct gl_context *ctx, const struct marshal_cmd_TexCoordP1ui *cmd, const uint64_t *last) 4088{ 4089 GLenum type = cmd->type; 4090 GLuint coords = cmd->coords; 4091 CALL_TexCoordP1ui(ctx->CurrentServerDispatch, (type, coords)); 4092 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordP1ui), 8) / 8); 4093 assert (cmd_size == cmd->cmd_base.cmd_size); 4094 return cmd_size; 4095} 4096void GLAPIENTRY 4097_mesa_marshal_TexCoordP1ui(GLenum type, GLuint coords) 4098{ 4099 GET_CURRENT_CONTEXT(ctx); 4100 int cmd_size = sizeof(struct marshal_cmd_TexCoordP1ui); 4101 struct marshal_cmd_TexCoordP1ui *cmd; 4102 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP1ui, cmd_size); 4103 cmd->type = type; 4104 cmd->coords = coords; 4105} 4106 4107 4108/* TexCoordP2ui: marshalled asynchronously */ 4109struct marshal_cmd_TexCoordP2ui 4110{ 4111 struct marshal_cmd_base cmd_base; 4112 GLenum type; 4113 GLuint coords; 4114}; 4115uint32_t 4116_mesa_unmarshal_TexCoordP2ui(struct gl_context *ctx, const struct marshal_cmd_TexCoordP2ui *cmd, const uint64_t *last) 4117{ 4118 GLenum type = cmd->type; 4119 GLuint coords = cmd->coords; 4120 CALL_TexCoordP2ui(ctx->CurrentServerDispatch, (type, coords)); 4121 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordP2ui), 8) / 8); 4122 assert (cmd_size == cmd->cmd_base.cmd_size); 4123 return cmd_size; 4124} 4125void GLAPIENTRY 4126_mesa_marshal_TexCoordP2ui(GLenum type, GLuint coords) 4127{ 4128 GET_CURRENT_CONTEXT(ctx); 4129 int cmd_size = sizeof(struct marshal_cmd_TexCoordP2ui); 4130 struct marshal_cmd_TexCoordP2ui *cmd; 4131 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP2ui, cmd_size); 4132 cmd->type = type; 4133 cmd->coords = coords; 4134} 4135 4136 4137/* TexCoordP3ui: marshalled asynchronously */ 4138struct marshal_cmd_TexCoordP3ui 4139{ 4140 struct marshal_cmd_base cmd_base; 4141 GLenum type; 4142 GLuint coords; 4143}; 4144uint32_t 4145_mesa_unmarshal_TexCoordP3ui(struct gl_context *ctx, const struct marshal_cmd_TexCoordP3ui *cmd, const uint64_t *last) 4146{ 4147 GLenum type = cmd->type; 4148 GLuint coords = cmd->coords; 4149 CALL_TexCoordP3ui(ctx->CurrentServerDispatch, (type, coords)); 4150 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordP3ui), 8) / 8); 4151 assert (cmd_size == cmd->cmd_base.cmd_size); 4152 return cmd_size; 4153} 4154void GLAPIENTRY 4155_mesa_marshal_TexCoordP3ui(GLenum type, GLuint coords) 4156{ 4157 GET_CURRENT_CONTEXT(ctx); 4158 int cmd_size = sizeof(struct marshal_cmd_TexCoordP3ui); 4159 struct marshal_cmd_TexCoordP3ui *cmd; 4160 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP3ui, cmd_size); 4161 cmd->type = type; 4162 cmd->coords = coords; 4163} 4164 4165 4166/* TexCoordP4ui: marshalled asynchronously */ 4167struct marshal_cmd_TexCoordP4ui 4168{ 4169 struct marshal_cmd_base cmd_base; 4170 GLenum type; 4171 GLuint coords; 4172}; 4173uint32_t 4174_mesa_unmarshal_TexCoordP4ui(struct gl_context *ctx, const struct marshal_cmd_TexCoordP4ui *cmd, const uint64_t *last) 4175{ 4176 GLenum type = cmd->type; 4177 GLuint coords = cmd->coords; 4178 CALL_TexCoordP4ui(ctx->CurrentServerDispatch, (type, coords)); 4179 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordP4ui), 8) / 8); 4180 assert (cmd_size == cmd->cmd_base.cmd_size); 4181 return cmd_size; 4182} 4183void GLAPIENTRY 4184_mesa_marshal_TexCoordP4ui(GLenum type, GLuint coords) 4185{ 4186 GET_CURRENT_CONTEXT(ctx); 4187 int cmd_size = sizeof(struct marshal_cmd_TexCoordP4ui); 4188 struct marshal_cmd_TexCoordP4ui *cmd; 4189 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP4ui, cmd_size); 4190 cmd->type = type; 4191 cmd->coords = coords; 4192} 4193 4194 4195/* TexCoordP1uiv: marshalled asynchronously */ 4196struct marshal_cmd_TexCoordP1uiv 4197{ 4198 struct marshal_cmd_base cmd_base; 4199 GLenum type; 4200 GLuint coords[1]; 4201}; 4202uint32_t 4203_mesa_unmarshal_TexCoordP1uiv(struct gl_context *ctx, const struct marshal_cmd_TexCoordP1uiv *cmd, const uint64_t *last) 4204{ 4205 GLenum type = cmd->type; 4206 const GLuint * coords = cmd->coords; 4207 CALL_TexCoordP1uiv(ctx->CurrentServerDispatch, (type, coords)); 4208 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordP1uiv), 8) / 8); 4209 assert (cmd_size == cmd->cmd_base.cmd_size); 4210 return cmd_size; 4211} 4212void GLAPIENTRY 4213_mesa_marshal_TexCoordP1uiv(GLenum type, const GLuint * coords) 4214{ 4215 GET_CURRENT_CONTEXT(ctx); 4216 int cmd_size = sizeof(struct marshal_cmd_TexCoordP1uiv); 4217 struct marshal_cmd_TexCoordP1uiv *cmd; 4218 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP1uiv, cmd_size); 4219 cmd->type = type; 4220 memcpy(cmd->coords, coords, 1 * sizeof(GLuint)); 4221} 4222 4223 4224/* TexCoordP2uiv: marshalled asynchronously */ 4225struct marshal_cmd_TexCoordP2uiv 4226{ 4227 struct marshal_cmd_base cmd_base; 4228 GLenum type; 4229 GLuint coords[1]; 4230}; 4231uint32_t 4232_mesa_unmarshal_TexCoordP2uiv(struct gl_context *ctx, const struct marshal_cmd_TexCoordP2uiv *cmd, const uint64_t *last) 4233{ 4234 GLenum type = cmd->type; 4235 const GLuint * coords = cmd->coords; 4236 CALL_TexCoordP2uiv(ctx->CurrentServerDispatch, (type, coords)); 4237 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordP2uiv), 8) / 8); 4238 assert (cmd_size == cmd->cmd_base.cmd_size); 4239 return cmd_size; 4240} 4241void GLAPIENTRY 4242_mesa_marshal_TexCoordP2uiv(GLenum type, const GLuint * coords) 4243{ 4244 GET_CURRENT_CONTEXT(ctx); 4245 int cmd_size = sizeof(struct marshal_cmd_TexCoordP2uiv); 4246 struct marshal_cmd_TexCoordP2uiv *cmd; 4247 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP2uiv, cmd_size); 4248 cmd->type = type; 4249 memcpy(cmd->coords, coords, 1 * sizeof(GLuint)); 4250} 4251 4252 4253/* TexCoordP3uiv: marshalled asynchronously */ 4254struct marshal_cmd_TexCoordP3uiv 4255{ 4256 struct marshal_cmd_base cmd_base; 4257 GLenum type; 4258 GLuint coords[1]; 4259}; 4260uint32_t 4261_mesa_unmarshal_TexCoordP3uiv(struct gl_context *ctx, const struct marshal_cmd_TexCoordP3uiv *cmd, const uint64_t *last) 4262{ 4263 GLenum type = cmd->type; 4264 const GLuint * coords = cmd->coords; 4265 CALL_TexCoordP3uiv(ctx->CurrentServerDispatch, (type, coords)); 4266 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordP3uiv), 8) / 8); 4267 assert (cmd_size == cmd->cmd_base.cmd_size); 4268 return cmd_size; 4269} 4270void GLAPIENTRY 4271_mesa_marshal_TexCoordP3uiv(GLenum type, const GLuint * coords) 4272{ 4273 GET_CURRENT_CONTEXT(ctx); 4274 int cmd_size = sizeof(struct marshal_cmd_TexCoordP3uiv); 4275 struct marshal_cmd_TexCoordP3uiv *cmd; 4276 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP3uiv, cmd_size); 4277 cmd->type = type; 4278 memcpy(cmd->coords, coords, 1 * sizeof(GLuint)); 4279} 4280 4281 4282/* TexCoordP4uiv: marshalled asynchronously */ 4283struct marshal_cmd_TexCoordP4uiv 4284{ 4285 struct marshal_cmd_base cmd_base; 4286 GLenum type; 4287 GLuint coords[1]; 4288}; 4289uint32_t 4290_mesa_unmarshal_TexCoordP4uiv(struct gl_context *ctx, const struct marshal_cmd_TexCoordP4uiv *cmd, const uint64_t *last) 4291{ 4292 GLenum type = cmd->type; 4293 const GLuint * coords = cmd->coords; 4294 CALL_TexCoordP4uiv(ctx->CurrentServerDispatch, (type, coords)); 4295 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoordP4uiv), 8) / 8); 4296 assert (cmd_size == cmd->cmd_base.cmd_size); 4297 return cmd_size; 4298} 4299void GLAPIENTRY 4300_mesa_marshal_TexCoordP4uiv(GLenum type, const GLuint * coords) 4301{ 4302 GET_CURRENT_CONTEXT(ctx); 4303 int cmd_size = sizeof(struct marshal_cmd_TexCoordP4uiv); 4304 struct marshal_cmd_TexCoordP4uiv *cmd; 4305 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoordP4uiv, cmd_size); 4306 cmd->type = type; 4307 memcpy(cmd->coords, coords, 1 * sizeof(GLuint)); 4308} 4309 4310 4311/* MultiTexCoordP1ui: marshalled asynchronously */ 4312struct marshal_cmd_MultiTexCoordP1ui 4313{ 4314 struct marshal_cmd_base cmd_base; 4315 GLenum texture; 4316 GLenum type; 4317 GLuint coords; 4318}; 4319uint32_t 4320_mesa_unmarshal_MultiTexCoordP1ui(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP1ui *cmd, const uint64_t *last) 4321{ 4322 GLenum texture = cmd->texture; 4323 GLenum type = cmd->type; 4324 GLuint coords = cmd->coords; 4325 CALL_MultiTexCoordP1ui(ctx->CurrentServerDispatch, (texture, type, coords)); 4326 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoordP1ui), 8) / 8); 4327 assert (cmd_size == cmd->cmd_base.cmd_size); 4328 return cmd_size; 4329} 4330void GLAPIENTRY 4331_mesa_marshal_MultiTexCoordP1ui(GLenum texture, GLenum type, GLuint coords) 4332{ 4333 GET_CURRENT_CONTEXT(ctx); 4334 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP1ui); 4335 struct marshal_cmd_MultiTexCoordP1ui *cmd; 4336 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP1ui, cmd_size); 4337 cmd->texture = texture; 4338 cmd->type = type; 4339 cmd->coords = coords; 4340} 4341 4342 4343/* MultiTexCoordP2ui: marshalled asynchronously */ 4344struct marshal_cmd_MultiTexCoordP2ui 4345{ 4346 struct marshal_cmd_base cmd_base; 4347 GLenum texture; 4348 GLenum type; 4349 GLuint coords; 4350}; 4351uint32_t 4352_mesa_unmarshal_MultiTexCoordP2ui(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP2ui *cmd, const uint64_t *last) 4353{ 4354 GLenum texture = cmd->texture; 4355 GLenum type = cmd->type; 4356 GLuint coords = cmd->coords; 4357 CALL_MultiTexCoordP2ui(ctx->CurrentServerDispatch, (texture, type, coords)); 4358 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoordP2ui), 8) / 8); 4359 assert (cmd_size == cmd->cmd_base.cmd_size); 4360 return cmd_size; 4361} 4362void GLAPIENTRY 4363_mesa_marshal_MultiTexCoordP2ui(GLenum texture, GLenum type, GLuint coords) 4364{ 4365 GET_CURRENT_CONTEXT(ctx); 4366 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP2ui); 4367 struct marshal_cmd_MultiTexCoordP2ui *cmd; 4368 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP2ui, cmd_size); 4369 cmd->texture = texture; 4370 cmd->type = type; 4371 cmd->coords = coords; 4372} 4373 4374 4375/* MultiTexCoordP3ui: marshalled asynchronously */ 4376struct marshal_cmd_MultiTexCoordP3ui 4377{ 4378 struct marshal_cmd_base cmd_base; 4379 GLenum texture; 4380 GLenum type; 4381 GLuint coords; 4382}; 4383uint32_t 4384_mesa_unmarshal_MultiTexCoordP3ui(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP3ui *cmd, const uint64_t *last) 4385{ 4386 GLenum texture = cmd->texture; 4387 GLenum type = cmd->type; 4388 GLuint coords = cmd->coords; 4389 CALL_MultiTexCoordP3ui(ctx->CurrentServerDispatch, (texture, type, coords)); 4390 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoordP3ui), 8) / 8); 4391 assert (cmd_size == cmd->cmd_base.cmd_size); 4392 return cmd_size; 4393} 4394void GLAPIENTRY 4395_mesa_marshal_MultiTexCoordP3ui(GLenum texture, GLenum type, GLuint coords) 4396{ 4397 GET_CURRENT_CONTEXT(ctx); 4398 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP3ui); 4399 struct marshal_cmd_MultiTexCoordP3ui *cmd; 4400 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP3ui, cmd_size); 4401 cmd->texture = texture; 4402 cmd->type = type; 4403 cmd->coords = coords; 4404} 4405 4406 4407/* MultiTexCoordP4ui: marshalled asynchronously */ 4408struct marshal_cmd_MultiTexCoordP4ui 4409{ 4410 struct marshal_cmd_base cmd_base; 4411 GLenum texture; 4412 GLenum type; 4413 GLuint coords; 4414}; 4415uint32_t 4416_mesa_unmarshal_MultiTexCoordP4ui(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP4ui *cmd, const uint64_t *last) 4417{ 4418 GLenum texture = cmd->texture; 4419 GLenum type = cmd->type; 4420 GLuint coords = cmd->coords; 4421 CALL_MultiTexCoordP4ui(ctx->CurrentServerDispatch, (texture, type, coords)); 4422 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoordP4ui), 8) / 8); 4423 assert (cmd_size == cmd->cmd_base.cmd_size); 4424 return cmd_size; 4425} 4426void GLAPIENTRY 4427_mesa_marshal_MultiTexCoordP4ui(GLenum texture, GLenum type, GLuint coords) 4428{ 4429 GET_CURRENT_CONTEXT(ctx); 4430 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP4ui); 4431 struct marshal_cmd_MultiTexCoordP4ui *cmd; 4432 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP4ui, cmd_size); 4433 cmd->texture = texture; 4434 cmd->type = type; 4435 cmd->coords = coords; 4436} 4437 4438 4439/* MultiTexCoordP1uiv: marshalled asynchronously */ 4440struct marshal_cmd_MultiTexCoordP1uiv 4441{ 4442 struct marshal_cmd_base cmd_base; 4443 GLenum texture; 4444 GLenum type; 4445 GLuint coords[1]; 4446}; 4447uint32_t 4448_mesa_unmarshal_MultiTexCoordP1uiv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP1uiv *cmd, const uint64_t *last) 4449{ 4450 GLenum texture = cmd->texture; 4451 GLenum type = cmd->type; 4452 const GLuint * coords = cmd->coords; 4453 CALL_MultiTexCoordP1uiv(ctx->CurrentServerDispatch, (texture, type, coords)); 4454 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoordP1uiv), 8) / 8); 4455 assert (cmd_size == cmd->cmd_base.cmd_size); 4456 return cmd_size; 4457} 4458void GLAPIENTRY 4459_mesa_marshal_MultiTexCoordP1uiv(GLenum texture, GLenum type, const GLuint * coords) 4460{ 4461 GET_CURRENT_CONTEXT(ctx); 4462 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP1uiv); 4463 struct marshal_cmd_MultiTexCoordP1uiv *cmd; 4464 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP1uiv, cmd_size); 4465 cmd->texture = texture; 4466 cmd->type = type; 4467 memcpy(cmd->coords, coords, 1 * sizeof(GLuint)); 4468} 4469 4470 4471/* MultiTexCoordP2uiv: marshalled asynchronously */ 4472struct marshal_cmd_MultiTexCoordP2uiv 4473{ 4474 struct marshal_cmd_base cmd_base; 4475 GLenum texture; 4476 GLenum type; 4477 GLuint coords[1]; 4478}; 4479uint32_t 4480_mesa_unmarshal_MultiTexCoordP2uiv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP2uiv *cmd, const uint64_t *last) 4481{ 4482 GLenum texture = cmd->texture; 4483 GLenum type = cmd->type; 4484 const GLuint * coords = cmd->coords; 4485 CALL_MultiTexCoordP2uiv(ctx->CurrentServerDispatch, (texture, type, coords)); 4486 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoordP2uiv), 8) / 8); 4487 assert (cmd_size == cmd->cmd_base.cmd_size); 4488 return cmd_size; 4489} 4490void GLAPIENTRY 4491_mesa_marshal_MultiTexCoordP2uiv(GLenum texture, GLenum type, const GLuint * coords) 4492{ 4493 GET_CURRENT_CONTEXT(ctx); 4494 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP2uiv); 4495 struct marshal_cmd_MultiTexCoordP2uiv *cmd; 4496 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP2uiv, cmd_size); 4497 cmd->texture = texture; 4498 cmd->type = type; 4499 memcpy(cmd->coords, coords, 1 * sizeof(GLuint)); 4500} 4501 4502 4503/* MultiTexCoordP3uiv: marshalled asynchronously */ 4504struct marshal_cmd_MultiTexCoordP3uiv 4505{ 4506 struct marshal_cmd_base cmd_base; 4507 GLenum texture; 4508 GLenum type; 4509 GLuint coords[1]; 4510}; 4511uint32_t 4512_mesa_unmarshal_MultiTexCoordP3uiv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP3uiv *cmd, const uint64_t *last) 4513{ 4514 GLenum texture = cmd->texture; 4515 GLenum type = cmd->type; 4516 const GLuint * coords = cmd->coords; 4517 CALL_MultiTexCoordP3uiv(ctx->CurrentServerDispatch, (texture, type, coords)); 4518 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoordP3uiv), 8) / 8); 4519 assert (cmd_size == cmd->cmd_base.cmd_size); 4520 return cmd_size; 4521} 4522void GLAPIENTRY 4523_mesa_marshal_MultiTexCoordP3uiv(GLenum texture, GLenum type, const GLuint * coords) 4524{ 4525 GET_CURRENT_CONTEXT(ctx); 4526 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP3uiv); 4527 struct marshal_cmd_MultiTexCoordP3uiv *cmd; 4528 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP3uiv, cmd_size); 4529 cmd->texture = texture; 4530 cmd->type = type; 4531 memcpy(cmd->coords, coords, 1 * sizeof(GLuint)); 4532} 4533 4534 4535/* MultiTexCoordP4uiv: marshalled asynchronously */ 4536struct marshal_cmd_MultiTexCoordP4uiv 4537{ 4538 struct marshal_cmd_base cmd_base; 4539 GLenum texture; 4540 GLenum type; 4541 GLuint coords[1]; 4542}; 4543uint32_t 4544_mesa_unmarshal_MultiTexCoordP4uiv(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoordP4uiv *cmd, const uint64_t *last) 4545{ 4546 GLenum texture = cmd->texture; 4547 GLenum type = cmd->type; 4548 const GLuint * coords = cmd->coords; 4549 CALL_MultiTexCoordP4uiv(ctx->CurrentServerDispatch, (texture, type, coords)); 4550 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoordP4uiv), 8) / 8); 4551 assert (cmd_size == cmd->cmd_base.cmd_size); 4552 return cmd_size; 4553} 4554void GLAPIENTRY 4555_mesa_marshal_MultiTexCoordP4uiv(GLenum texture, GLenum type, const GLuint * coords) 4556{ 4557 GET_CURRENT_CONTEXT(ctx); 4558 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoordP4uiv); 4559 struct marshal_cmd_MultiTexCoordP4uiv *cmd; 4560 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoordP4uiv, cmd_size); 4561 cmd->texture = texture; 4562 cmd->type = type; 4563 memcpy(cmd->coords, coords, 1 * sizeof(GLuint)); 4564} 4565 4566 4567/* NormalP3ui: marshalled asynchronously */ 4568struct marshal_cmd_NormalP3ui 4569{ 4570 struct marshal_cmd_base cmd_base; 4571 GLenum type; 4572 GLuint coords; 4573}; 4574uint32_t 4575_mesa_unmarshal_NormalP3ui(struct gl_context *ctx, const struct marshal_cmd_NormalP3ui *cmd, const uint64_t *last) 4576{ 4577 GLenum type = cmd->type; 4578 GLuint coords = cmd->coords; 4579 CALL_NormalP3ui(ctx->CurrentServerDispatch, (type, coords)); 4580 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NormalP3ui), 8) / 8); 4581 assert (cmd_size == cmd->cmd_base.cmd_size); 4582 return cmd_size; 4583} 4584void GLAPIENTRY 4585_mesa_marshal_NormalP3ui(GLenum type, GLuint coords) 4586{ 4587 GET_CURRENT_CONTEXT(ctx); 4588 int cmd_size = sizeof(struct marshal_cmd_NormalP3ui); 4589 struct marshal_cmd_NormalP3ui *cmd; 4590 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NormalP3ui, cmd_size); 4591 cmd->type = type; 4592 cmd->coords = coords; 4593} 4594 4595 4596/* NormalP3uiv: marshalled asynchronously */ 4597struct marshal_cmd_NormalP3uiv 4598{ 4599 struct marshal_cmd_base cmd_base; 4600 GLenum type; 4601 GLuint coords[1]; 4602}; 4603uint32_t 4604_mesa_unmarshal_NormalP3uiv(struct gl_context *ctx, const struct marshal_cmd_NormalP3uiv *cmd, const uint64_t *last) 4605{ 4606 GLenum type = cmd->type; 4607 const GLuint * coords = cmd->coords; 4608 CALL_NormalP3uiv(ctx->CurrentServerDispatch, (type, coords)); 4609 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NormalP3uiv), 8) / 8); 4610 assert (cmd_size == cmd->cmd_base.cmd_size); 4611 return cmd_size; 4612} 4613void GLAPIENTRY 4614_mesa_marshal_NormalP3uiv(GLenum type, const GLuint * coords) 4615{ 4616 GET_CURRENT_CONTEXT(ctx); 4617 int cmd_size = sizeof(struct marshal_cmd_NormalP3uiv); 4618 struct marshal_cmd_NormalP3uiv *cmd; 4619 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NormalP3uiv, cmd_size); 4620 cmd->type = type; 4621 memcpy(cmd->coords, coords, 1 * sizeof(GLuint)); 4622} 4623 4624 4625/* ColorP3ui: marshalled asynchronously */ 4626struct marshal_cmd_ColorP3ui 4627{ 4628 struct marshal_cmd_base cmd_base; 4629 GLenum type; 4630 GLuint color; 4631}; 4632uint32_t 4633_mesa_unmarshal_ColorP3ui(struct gl_context *ctx, const struct marshal_cmd_ColorP3ui *cmd, const uint64_t *last) 4634{ 4635 GLenum type = cmd->type; 4636 GLuint color = cmd->color; 4637 CALL_ColorP3ui(ctx->CurrentServerDispatch, (type, color)); 4638 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ColorP3ui), 8) / 8); 4639 assert (cmd_size == cmd->cmd_base.cmd_size); 4640 return cmd_size; 4641} 4642void GLAPIENTRY 4643_mesa_marshal_ColorP3ui(GLenum type, GLuint color) 4644{ 4645 GET_CURRENT_CONTEXT(ctx); 4646 int cmd_size = sizeof(struct marshal_cmd_ColorP3ui); 4647 struct marshal_cmd_ColorP3ui *cmd; 4648 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorP3ui, cmd_size); 4649 cmd->type = type; 4650 cmd->color = color; 4651} 4652 4653 4654/* ColorP4ui: marshalled asynchronously */ 4655struct marshal_cmd_ColorP4ui 4656{ 4657 struct marshal_cmd_base cmd_base; 4658 GLenum type; 4659 GLuint color; 4660}; 4661uint32_t 4662_mesa_unmarshal_ColorP4ui(struct gl_context *ctx, const struct marshal_cmd_ColorP4ui *cmd, const uint64_t *last) 4663{ 4664 GLenum type = cmd->type; 4665 GLuint color = cmd->color; 4666 CALL_ColorP4ui(ctx->CurrentServerDispatch, (type, color)); 4667 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ColorP4ui), 8) / 8); 4668 assert (cmd_size == cmd->cmd_base.cmd_size); 4669 return cmd_size; 4670} 4671void GLAPIENTRY 4672_mesa_marshal_ColorP4ui(GLenum type, GLuint color) 4673{ 4674 GET_CURRENT_CONTEXT(ctx); 4675 int cmd_size = sizeof(struct marshal_cmd_ColorP4ui); 4676 struct marshal_cmd_ColorP4ui *cmd; 4677 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorP4ui, cmd_size); 4678 cmd->type = type; 4679 cmd->color = color; 4680} 4681 4682 4683/* ColorP3uiv: marshalled asynchronously */ 4684struct marshal_cmd_ColorP3uiv 4685{ 4686 struct marshal_cmd_base cmd_base; 4687 GLenum type; 4688 GLuint color[1]; 4689}; 4690uint32_t 4691_mesa_unmarshal_ColorP3uiv(struct gl_context *ctx, const struct marshal_cmd_ColorP3uiv *cmd, const uint64_t *last) 4692{ 4693 GLenum type = cmd->type; 4694 const GLuint * color = cmd->color; 4695 CALL_ColorP3uiv(ctx->CurrentServerDispatch, (type, color)); 4696 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ColorP3uiv), 8) / 8); 4697 assert (cmd_size == cmd->cmd_base.cmd_size); 4698 return cmd_size; 4699} 4700void GLAPIENTRY 4701_mesa_marshal_ColorP3uiv(GLenum type, const GLuint * color) 4702{ 4703 GET_CURRENT_CONTEXT(ctx); 4704 int cmd_size = sizeof(struct marshal_cmd_ColorP3uiv); 4705 struct marshal_cmd_ColorP3uiv *cmd; 4706 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorP3uiv, cmd_size); 4707 cmd->type = type; 4708 memcpy(cmd->color, color, 1 * sizeof(GLuint)); 4709} 4710 4711 4712/* ColorP4uiv: marshalled asynchronously */ 4713struct marshal_cmd_ColorP4uiv 4714{ 4715 struct marshal_cmd_base cmd_base; 4716 GLenum type; 4717 GLuint color[1]; 4718}; 4719uint32_t 4720_mesa_unmarshal_ColorP4uiv(struct gl_context *ctx, const struct marshal_cmd_ColorP4uiv *cmd, const uint64_t *last) 4721{ 4722 GLenum type = cmd->type; 4723 const GLuint * color = cmd->color; 4724 CALL_ColorP4uiv(ctx->CurrentServerDispatch, (type, color)); 4725 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ColorP4uiv), 8) / 8); 4726 assert (cmd_size == cmd->cmd_base.cmd_size); 4727 return cmd_size; 4728} 4729void GLAPIENTRY 4730_mesa_marshal_ColorP4uiv(GLenum type, const GLuint * color) 4731{ 4732 GET_CURRENT_CONTEXT(ctx); 4733 int cmd_size = sizeof(struct marshal_cmd_ColorP4uiv); 4734 struct marshal_cmd_ColorP4uiv *cmd; 4735 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ColorP4uiv, cmd_size); 4736 cmd->type = type; 4737 memcpy(cmd->color, color, 1 * sizeof(GLuint)); 4738} 4739 4740 4741/* SecondaryColorP3ui: marshalled asynchronously */ 4742struct marshal_cmd_SecondaryColorP3ui 4743{ 4744 struct marshal_cmd_base cmd_base; 4745 GLenum type; 4746 GLuint color; 4747}; 4748uint32_t 4749_mesa_unmarshal_SecondaryColorP3ui(struct gl_context *ctx, const struct marshal_cmd_SecondaryColorP3ui *cmd, const uint64_t *last) 4750{ 4751 GLenum type = cmd->type; 4752 GLuint color = cmd->color; 4753 CALL_SecondaryColorP3ui(ctx->CurrentServerDispatch, (type, color)); 4754 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColorP3ui), 8) / 8); 4755 assert (cmd_size == cmd->cmd_base.cmd_size); 4756 return cmd_size; 4757} 4758void GLAPIENTRY 4759_mesa_marshal_SecondaryColorP3ui(GLenum type, GLuint color) 4760{ 4761 GET_CURRENT_CONTEXT(ctx); 4762 int cmd_size = sizeof(struct marshal_cmd_SecondaryColorP3ui); 4763 struct marshal_cmd_SecondaryColorP3ui *cmd; 4764 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColorP3ui, cmd_size); 4765 cmd->type = type; 4766 cmd->color = color; 4767} 4768 4769 4770/* SecondaryColorP3uiv: marshalled asynchronously */ 4771struct marshal_cmd_SecondaryColorP3uiv 4772{ 4773 struct marshal_cmd_base cmd_base; 4774 GLenum type; 4775 GLuint color[1]; 4776}; 4777uint32_t 4778_mesa_unmarshal_SecondaryColorP3uiv(struct gl_context *ctx, const struct marshal_cmd_SecondaryColorP3uiv *cmd, const uint64_t *last) 4779{ 4780 GLenum type = cmd->type; 4781 const GLuint * color = cmd->color; 4782 CALL_SecondaryColorP3uiv(ctx->CurrentServerDispatch, (type, color)); 4783 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColorP3uiv), 8) / 8); 4784 assert (cmd_size == cmd->cmd_base.cmd_size); 4785 return cmd_size; 4786} 4787void GLAPIENTRY 4788_mesa_marshal_SecondaryColorP3uiv(GLenum type, const GLuint * color) 4789{ 4790 GET_CURRENT_CONTEXT(ctx); 4791 int cmd_size = sizeof(struct marshal_cmd_SecondaryColorP3uiv); 4792 struct marshal_cmd_SecondaryColorP3uiv *cmd; 4793 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColorP3uiv, cmd_size); 4794 cmd->type = type; 4795 memcpy(cmd->color, color, 1 * sizeof(GLuint)); 4796} 4797 4798 4799/* VertexAttribP1ui: marshalled asynchronously */ 4800struct marshal_cmd_VertexAttribP1ui 4801{ 4802 struct marshal_cmd_base cmd_base; 4803 GLboolean normalized; 4804 GLuint index; 4805 GLenum type; 4806 GLuint value; 4807}; 4808uint32_t 4809_mesa_unmarshal_VertexAttribP1ui(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP1ui *cmd, const uint64_t *last) 4810{ 4811 GLuint index = cmd->index; 4812 GLenum type = cmd->type; 4813 GLboolean normalized = cmd->normalized; 4814 GLuint value = cmd->value; 4815 CALL_VertexAttribP1ui(ctx->CurrentServerDispatch, (index, type, normalized, value)); 4816 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribP1ui), 8) / 8); 4817 assert (cmd_size == cmd->cmd_base.cmd_size); 4818 return cmd_size; 4819} 4820void GLAPIENTRY 4821_mesa_marshal_VertexAttribP1ui(GLuint index, GLenum type, GLboolean normalized, GLuint value) 4822{ 4823 GET_CURRENT_CONTEXT(ctx); 4824 int cmd_size = sizeof(struct marshal_cmd_VertexAttribP1ui); 4825 struct marshal_cmd_VertexAttribP1ui *cmd; 4826 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP1ui, cmd_size); 4827 cmd->index = index; 4828 cmd->type = type; 4829 cmd->normalized = normalized; 4830 cmd->value = value; 4831} 4832 4833 4834/* VertexAttribP2ui: marshalled asynchronously */ 4835struct marshal_cmd_VertexAttribP2ui 4836{ 4837 struct marshal_cmd_base cmd_base; 4838 GLboolean normalized; 4839 GLuint index; 4840 GLenum type; 4841 GLuint value; 4842}; 4843uint32_t 4844_mesa_unmarshal_VertexAttribP2ui(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP2ui *cmd, const uint64_t *last) 4845{ 4846 GLuint index = cmd->index; 4847 GLenum type = cmd->type; 4848 GLboolean normalized = cmd->normalized; 4849 GLuint value = cmd->value; 4850 CALL_VertexAttribP2ui(ctx->CurrentServerDispatch, (index, type, normalized, value)); 4851 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribP2ui), 8) / 8); 4852 assert (cmd_size == cmd->cmd_base.cmd_size); 4853 return cmd_size; 4854} 4855void GLAPIENTRY 4856_mesa_marshal_VertexAttribP2ui(GLuint index, GLenum type, GLboolean normalized, GLuint value) 4857{ 4858 GET_CURRENT_CONTEXT(ctx); 4859 int cmd_size = sizeof(struct marshal_cmd_VertexAttribP2ui); 4860 struct marshal_cmd_VertexAttribP2ui *cmd; 4861 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP2ui, cmd_size); 4862 cmd->index = index; 4863 cmd->type = type; 4864 cmd->normalized = normalized; 4865 cmd->value = value; 4866} 4867 4868 4869/* VertexAttribP3ui: marshalled asynchronously */ 4870struct marshal_cmd_VertexAttribP3ui 4871{ 4872 struct marshal_cmd_base cmd_base; 4873 GLboolean normalized; 4874 GLuint index; 4875 GLenum type; 4876 GLuint value; 4877}; 4878uint32_t 4879_mesa_unmarshal_VertexAttribP3ui(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP3ui *cmd, const uint64_t *last) 4880{ 4881 GLuint index = cmd->index; 4882 GLenum type = cmd->type; 4883 GLboolean normalized = cmd->normalized; 4884 GLuint value = cmd->value; 4885 CALL_VertexAttribP3ui(ctx->CurrentServerDispatch, (index, type, normalized, value)); 4886 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribP3ui), 8) / 8); 4887 assert (cmd_size == cmd->cmd_base.cmd_size); 4888 return cmd_size; 4889} 4890void GLAPIENTRY 4891_mesa_marshal_VertexAttribP3ui(GLuint index, GLenum type, GLboolean normalized, GLuint value) 4892{ 4893 GET_CURRENT_CONTEXT(ctx); 4894 int cmd_size = sizeof(struct marshal_cmd_VertexAttribP3ui); 4895 struct marshal_cmd_VertexAttribP3ui *cmd; 4896 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP3ui, cmd_size); 4897 cmd->index = index; 4898 cmd->type = type; 4899 cmd->normalized = normalized; 4900 cmd->value = value; 4901} 4902 4903 4904/* VertexAttribP4ui: marshalled asynchronously */ 4905struct marshal_cmd_VertexAttribP4ui 4906{ 4907 struct marshal_cmd_base cmd_base; 4908 GLboolean normalized; 4909 GLuint index; 4910 GLenum type; 4911 GLuint value; 4912}; 4913uint32_t 4914_mesa_unmarshal_VertexAttribP4ui(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP4ui *cmd, const uint64_t *last) 4915{ 4916 GLuint index = cmd->index; 4917 GLenum type = cmd->type; 4918 GLboolean normalized = cmd->normalized; 4919 GLuint value = cmd->value; 4920 CALL_VertexAttribP4ui(ctx->CurrentServerDispatch, (index, type, normalized, value)); 4921 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribP4ui), 8) / 8); 4922 assert (cmd_size == cmd->cmd_base.cmd_size); 4923 return cmd_size; 4924} 4925void GLAPIENTRY 4926_mesa_marshal_VertexAttribP4ui(GLuint index, GLenum type, GLboolean normalized, GLuint value) 4927{ 4928 GET_CURRENT_CONTEXT(ctx); 4929 int cmd_size = sizeof(struct marshal_cmd_VertexAttribP4ui); 4930 struct marshal_cmd_VertexAttribP4ui *cmd; 4931 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP4ui, cmd_size); 4932 cmd->index = index; 4933 cmd->type = type; 4934 cmd->normalized = normalized; 4935 cmd->value = value; 4936} 4937 4938 4939/* VertexAttribP1uiv: marshalled asynchronously */ 4940struct marshal_cmd_VertexAttribP1uiv 4941{ 4942 struct marshal_cmd_base cmd_base; 4943 GLboolean normalized; 4944 GLuint index; 4945 GLenum type; 4946 GLuint value[1]; 4947}; 4948uint32_t 4949_mesa_unmarshal_VertexAttribP1uiv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP1uiv *cmd, const uint64_t *last) 4950{ 4951 GLuint index = cmd->index; 4952 GLenum type = cmd->type; 4953 GLboolean normalized = cmd->normalized; 4954 const GLuint * value = cmd->value; 4955 CALL_VertexAttribP1uiv(ctx->CurrentServerDispatch, (index, type, normalized, value)); 4956 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribP1uiv), 8) / 8); 4957 assert (cmd_size == cmd->cmd_base.cmd_size); 4958 return cmd_size; 4959} 4960void GLAPIENTRY 4961_mesa_marshal_VertexAttribP1uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint * value) 4962{ 4963 GET_CURRENT_CONTEXT(ctx); 4964 int cmd_size = sizeof(struct marshal_cmd_VertexAttribP1uiv); 4965 struct marshal_cmd_VertexAttribP1uiv *cmd; 4966 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP1uiv, cmd_size); 4967 cmd->index = index; 4968 cmd->type = type; 4969 cmd->normalized = normalized; 4970 memcpy(cmd->value, value, 1 * sizeof(GLuint)); 4971} 4972 4973 4974/* VertexAttribP2uiv: marshalled asynchronously */ 4975struct marshal_cmd_VertexAttribP2uiv 4976{ 4977 struct marshal_cmd_base cmd_base; 4978 GLboolean normalized; 4979 GLuint index; 4980 GLenum type; 4981 GLuint value[1]; 4982}; 4983uint32_t 4984_mesa_unmarshal_VertexAttribP2uiv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP2uiv *cmd, const uint64_t *last) 4985{ 4986 GLuint index = cmd->index; 4987 GLenum type = cmd->type; 4988 GLboolean normalized = cmd->normalized; 4989 const GLuint * value = cmd->value; 4990 CALL_VertexAttribP2uiv(ctx->CurrentServerDispatch, (index, type, normalized, value)); 4991 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribP2uiv), 8) / 8); 4992 assert (cmd_size == cmd->cmd_base.cmd_size); 4993 return cmd_size; 4994} 4995void GLAPIENTRY 4996_mesa_marshal_VertexAttribP2uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint * value) 4997{ 4998 GET_CURRENT_CONTEXT(ctx); 4999 int cmd_size = sizeof(struct marshal_cmd_VertexAttribP2uiv); 5000 struct marshal_cmd_VertexAttribP2uiv *cmd; 5001 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP2uiv, cmd_size); 5002 cmd->index = index; 5003 cmd->type = type; 5004 cmd->normalized = normalized; 5005 memcpy(cmd->value, value, 1 * sizeof(GLuint)); 5006} 5007 5008 5009/* VertexAttribP3uiv: marshalled asynchronously */ 5010struct marshal_cmd_VertexAttribP3uiv 5011{ 5012 struct marshal_cmd_base cmd_base; 5013 GLboolean normalized; 5014 GLuint index; 5015 GLenum type; 5016 GLuint value[1]; 5017}; 5018uint32_t 5019_mesa_unmarshal_VertexAttribP3uiv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP3uiv *cmd, const uint64_t *last) 5020{ 5021 GLuint index = cmd->index; 5022 GLenum type = cmd->type; 5023 GLboolean normalized = cmd->normalized; 5024 const GLuint * value = cmd->value; 5025 CALL_VertexAttribP3uiv(ctx->CurrentServerDispatch, (index, type, normalized, value)); 5026 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribP3uiv), 8) / 8); 5027 assert (cmd_size == cmd->cmd_base.cmd_size); 5028 return cmd_size; 5029} 5030void GLAPIENTRY 5031_mesa_marshal_VertexAttribP3uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint * value) 5032{ 5033 GET_CURRENT_CONTEXT(ctx); 5034 int cmd_size = sizeof(struct marshal_cmd_VertexAttribP3uiv); 5035 struct marshal_cmd_VertexAttribP3uiv *cmd; 5036 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP3uiv, cmd_size); 5037 cmd->index = index; 5038 cmd->type = type; 5039 cmd->normalized = normalized; 5040 memcpy(cmd->value, value, 1 * sizeof(GLuint)); 5041} 5042 5043 5044/* VertexAttribP4uiv: marshalled asynchronously */ 5045struct marshal_cmd_VertexAttribP4uiv 5046{ 5047 struct marshal_cmd_base cmd_base; 5048 GLboolean normalized; 5049 GLuint index; 5050 GLenum type; 5051 GLuint value[1]; 5052}; 5053uint32_t 5054_mesa_unmarshal_VertexAttribP4uiv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribP4uiv *cmd, const uint64_t *last) 5055{ 5056 GLuint index = cmd->index; 5057 GLenum type = cmd->type; 5058 GLboolean normalized = cmd->normalized; 5059 const GLuint * value = cmd->value; 5060 CALL_VertexAttribP4uiv(ctx->CurrentServerDispatch, (index, type, normalized, value)); 5061 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribP4uiv), 8) / 8); 5062 assert (cmd_size == cmd->cmd_base.cmd_size); 5063 return cmd_size; 5064} 5065void GLAPIENTRY 5066_mesa_marshal_VertexAttribP4uiv(GLuint index, GLenum type, GLboolean normalized, const GLuint * value) 5067{ 5068 GET_CURRENT_CONTEXT(ctx); 5069 int cmd_size = sizeof(struct marshal_cmd_VertexAttribP4uiv); 5070 struct marshal_cmd_VertexAttribP4uiv *cmd; 5071 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribP4uiv, cmd_size); 5072 cmd->index = index; 5073 cmd->type = type; 5074 cmd->normalized = normalized; 5075 memcpy(cmd->value, value, 1 * sizeof(GLuint)); 5076} 5077 5078 5079/* GetSubroutineUniformLocation: marshalled synchronously */ 5080GLint GLAPIENTRY 5081_mesa_marshal_GetSubroutineUniformLocation(GLuint program, GLenum shadertype, const GLchar * name) 5082{ 5083 GET_CURRENT_CONTEXT(ctx); 5084 _mesa_glthread_finish_before(ctx, "GetSubroutineUniformLocation"); 5085 return CALL_GetSubroutineUniformLocation(ctx->CurrentServerDispatch, (program, shadertype, name)); 5086} 5087 5088 5089/* GetSubroutineIndex: marshalled synchronously */ 5090GLuint GLAPIENTRY 5091_mesa_marshal_GetSubroutineIndex(GLuint program, GLenum shadertype, const GLchar * name) 5092{ 5093 GET_CURRENT_CONTEXT(ctx); 5094 _mesa_glthread_finish_before(ctx, "GetSubroutineIndex"); 5095 return CALL_GetSubroutineIndex(ctx->CurrentServerDispatch, (program, shadertype, name)); 5096} 5097 5098 5099/* GetActiveSubroutineUniformiv: marshalled synchronously */ 5100void GLAPIENTRY 5101_mesa_marshal_GetActiveSubroutineUniformiv(GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint * values) 5102{ 5103 GET_CURRENT_CONTEXT(ctx); 5104 _mesa_glthread_finish_before(ctx, "GetActiveSubroutineUniformiv"); 5105 CALL_GetActiveSubroutineUniformiv(ctx->CurrentServerDispatch, (program, shadertype, index, pname, values)); 5106} 5107 5108 5109/* GetActiveSubroutineUniformName: marshalled synchronously */ 5110void GLAPIENTRY 5111_mesa_marshal_GetActiveSubroutineUniformName(GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei * length, GLchar * name) 5112{ 5113 GET_CURRENT_CONTEXT(ctx); 5114 _mesa_glthread_finish_before(ctx, "GetActiveSubroutineUniformName"); 5115 CALL_GetActiveSubroutineUniformName(ctx->CurrentServerDispatch, (program, shadertype, index, bufsize, length, name)); 5116} 5117 5118 5119/* GetActiveSubroutineName: marshalled synchronously */ 5120void GLAPIENTRY 5121_mesa_marshal_GetActiveSubroutineName(GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei * length, GLchar * name) 5122{ 5123 GET_CURRENT_CONTEXT(ctx); 5124 _mesa_glthread_finish_before(ctx, "GetActiveSubroutineName"); 5125 CALL_GetActiveSubroutineName(ctx->CurrentServerDispatch, (program, shadertype, index, bufsize, length, name)); 5126} 5127 5128 5129/* UniformSubroutinesuiv: marshalled asynchronously */ 5130struct marshal_cmd_UniformSubroutinesuiv 5131{ 5132 struct marshal_cmd_base cmd_base; 5133 GLenum shadertype; 5134 GLsizei count; 5135 /* Next safe_mul(count, 1 * sizeof(GLuint)) bytes are GLuint indices[count] */ 5136}; 5137uint32_t 5138_mesa_unmarshal_UniformSubroutinesuiv(struct gl_context *ctx, const struct marshal_cmd_UniformSubroutinesuiv *cmd, const uint64_t *last) 5139{ 5140 GLenum shadertype = cmd->shadertype; 5141 GLsizei count = cmd->count; 5142 GLuint * indices; 5143 const char *variable_data = (const char *) (cmd + 1); 5144 indices = (GLuint *) variable_data; 5145 CALL_UniformSubroutinesuiv(ctx->CurrentServerDispatch, (shadertype, count, indices)); 5146 return cmd->cmd_base.cmd_size; 5147} 5148void GLAPIENTRY 5149_mesa_marshal_UniformSubroutinesuiv(GLenum shadertype, GLsizei count, const GLuint * indices) 5150{ 5151 GET_CURRENT_CONTEXT(ctx); 5152 int indices_size = safe_mul(count, 1 * sizeof(GLuint)); 5153 int cmd_size = sizeof(struct marshal_cmd_UniformSubroutinesuiv) + indices_size; 5154 struct marshal_cmd_UniformSubroutinesuiv *cmd; 5155 if (unlikely(indices_size < 0 || (indices_size > 0 && !indices) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5156 _mesa_glthread_finish_before(ctx, "UniformSubroutinesuiv"); 5157 CALL_UniformSubroutinesuiv(ctx->CurrentServerDispatch, (shadertype, count, indices)); 5158 return; 5159 } 5160 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformSubroutinesuiv, cmd_size); 5161 cmd->shadertype = shadertype; 5162 cmd->count = count; 5163 char *variable_data = (char *) (cmd + 1); 5164 memcpy(variable_data, indices, indices_size); 5165} 5166 5167 5168/* GetUniformSubroutineuiv: marshalled synchronously */ 5169void GLAPIENTRY 5170_mesa_marshal_GetUniformSubroutineuiv(GLenum shadertype, GLint location, GLuint * params) 5171{ 5172 GET_CURRENT_CONTEXT(ctx); 5173 _mesa_glthread_finish_before(ctx, "GetUniformSubroutineuiv"); 5174 CALL_GetUniformSubroutineuiv(ctx->CurrentServerDispatch, (shadertype, location, params)); 5175} 5176 5177 5178/* GetProgramStageiv: marshalled synchronously */ 5179void GLAPIENTRY 5180_mesa_marshal_GetProgramStageiv(GLuint program, GLenum shadertype, GLenum pname, GLint * values) 5181{ 5182 GET_CURRENT_CONTEXT(ctx); 5183 _mesa_glthread_finish_before(ctx, "GetProgramStageiv"); 5184 CALL_GetProgramStageiv(ctx->CurrentServerDispatch, (program, shadertype, pname, values)); 5185} 5186 5187 5188/* PatchParameteri: marshalled asynchronously */ 5189struct marshal_cmd_PatchParameteri 5190{ 5191 struct marshal_cmd_base cmd_base; 5192 GLenum pname; 5193 GLint value; 5194}; 5195uint32_t 5196_mesa_unmarshal_PatchParameteri(struct gl_context *ctx, const struct marshal_cmd_PatchParameteri *cmd, const uint64_t *last) 5197{ 5198 GLenum pname = cmd->pname; 5199 GLint value = cmd->value; 5200 CALL_PatchParameteri(ctx->CurrentServerDispatch, (pname, value)); 5201 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PatchParameteri), 8) / 8); 5202 assert (cmd_size == cmd->cmd_base.cmd_size); 5203 return cmd_size; 5204} 5205void GLAPIENTRY 5206_mesa_marshal_PatchParameteri(GLenum pname, GLint value) 5207{ 5208 GET_CURRENT_CONTEXT(ctx); 5209 int cmd_size = sizeof(struct marshal_cmd_PatchParameteri); 5210 struct marshal_cmd_PatchParameteri *cmd; 5211 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PatchParameteri, cmd_size); 5212 cmd->pname = pname; 5213 cmd->value = value; 5214} 5215 5216 5217/* PatchParameterfv: marshalled asynchronously */ 5218struct marshal_cmd_PatchParameterfv 5219{ 5220 struct marshal_cmd_base cmd_base; 5221 GLenum pname; 5222 /* Next safe_mul(_mesa_patch_param_enum_to_count(pname), 1 * sizeof(GLfloat)) bytes are GLfloat values[_mesa_patch_param_enum_to_count(pname)] */ 5223}; 5224uint32_t 5225_mesa_unmarshal_PatchParameterfv(struct gl_context *ctx, const struct marshal_cmd_PatchParameterfv *cmd, const uint64_t *last) 5226{ 5227 GLenum pname = cmd->pname; 5228 GLfloat * values; 5229 const char *variable_data = (const char *) (cmd + 1); 5230 values = (GLfloat *) variable_data; 5231 CALL_PatchParameterfv(ctx->CurrentServerDispatch, (pname, values)); 5232 return cmd->cmd_base.cmd_size; 5233} 5234void GLAPIENTRY 5235_mesa_marshal_PatchParameterfv(GLenum pname, const GLfloat * values) 5236{ 5237 GET_CURRENT_CONTEXT(ctx); 5238 int values_size = safe_mul(_mesa_patch_param_enum_to_count(pname), 1 * sizeof(GLfloat)); 5239 int cmd_size = sizeof(struct marshal_cmd_PatchParameterfv) + values_size; 5240 struct marshal_cmd_PatchParameterfv *cmd; 5241 if (unlikely(values_size < 0 || (values_size > 0 && !values) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5242 _mesa_glthread_finish_before(ctx, "PatchParameterfv"); 5243 CALL_PatchParameterfv(ctx->CurrentServerDispatch, (pname, values)); 5244 return; 5245 } 5246 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PatchParameterfv, cmd_size); 5247 cmd->pname = pname; 5248 char *variable_data = (char *) (cmd + 1); 5249 memcpy(variable_data, values, values_size); 5250} 5251 5252 5253/* DrawArraysIndirect: marshalled asynchronously */ 5254struct marshal_cmd_DrawArraysIndirect 5255{ 5256 struct marshal_cmd_base cmd_base; 5257 GLenum mode; 5258 const GLvoid * indirect; 5259}; 5260uint32_t 5261_mesa_unmarshal_DrawArraysIndirect(struct gl_context *ctx, const struct marshal_cmd_DrawArraysIndirect *cmd, const uint64_t *last) 5262{ 5263 GLenum mode = cmd->mode; 5264 const GLvoid * indirect = cmd->indirect; 5265 CALL_DrawArraysIndirect(ctx->CurrentServerDispatch, (mode, indirect)); 5266 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawArraysIndirect), 8) / 8); 5267 assert (cmd_size == cmd->cmd_base.cmd_size); 5268 return cmd_size; 5269} 5270void GLAPIENTRY 5271_mesa_marshal_DrawArraysIndirect(GLenum mode, const GLvoid * indirect) 5272{ 5273 GET_CURRENT_CONTEXT(ctx); 5274 int cmd_size = sizeof(struct marshal_cmd_DrawArraysIndirect); 5275 struct marshal_cmd_DrawArraysIndirect *cmd; 5276 if (_mesa_glthread_has_non_vbo_vertices_or_indirect(ctx)) { 5277 _mesa_glthread_finish_before(ctx, "DrawArraysIndirect"); 5278 CALL_DrawArraysIndirect(ctx->CurrentServerDispatch, (mode, indirect)); 5279 return; 5280 } 5281 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawArraysIndirect, cmd_size); 5282 cmd->mode = mode; 5283 cmd->indirect = indirect; 5284} 5285 5286 5287/* DrawElementsIndirect: marshalled asynchronously */ 5288struct marshal_cmd_DrawElementsIndirect 5289{ 5290 struct marshal_cmd_base cmd_base; 5291 GLenum mode; 5292 GLenum type; 5293 const GLvoid * indirect; 5294}; 5295uint32_t 5296_mesa_unmarshal_DrawElementsIndirect(struct gl_context *ctx, const struct marshal_cmd_DrawElementsIndirect *cmd, const uint64_t *last) 5297{ 5298 GLenum mode = cmd->mode; 5299 GLenum type = cmd->type; 5300 const GLvoid * indirect = cmd->indirect; 5301 CALL_DrawElementsIndirect(ctx->CurrentServerDispatch, (mode, type, indirect)); 5302 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawElementsIndirect), 8) / 8); 5303 assert (cmd_size == cmd->cmd_base.cmd_size); 5304 return cmd_size; 5305} 5306void GLAPIENTRY 5307_mesa_marshal_DrawElementsIndirect(GLenum mode, GLenum type, const GLvoid * indirect) 5308{ 5309 GET_CURRENT_CONTEXT(ctx); 5310 int cmd_size = sizeof(struct marshal_cmd_DrawElementsIndirect); 5311 struct marshal_cmd_DrawElementsIndirect *cmd; 5312 if (_mesa_glthread_has_non_vbo_vertices_or_indices_or_indirect(ctx)) { 5313 _mesa_glthread_finish_before(ctx, "DrawElementsIndirect"); 5314 CALL_DrawElementsIndirect(ctx->CurrentServerDispatch, (mode, type, indirect)); 5315 return; 5316 } 5317 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawElementsIndirect, cmd_size); 5318 cmd->mode = mode; 5319 cmd->type = type; 5320 cmd->indirect = indirect; 5321} 5322 5323 5324/* MultiDrawArraysIndirect: marshalled asynchronously */ 5325struct marshal_cmd_MultiDrawArraysIndirect 5326{ 5327 struct marshal_cmd_base cmd_base; 5328 GLenum mode; 5329 GLsizei primcount; 5330 GLsizei stride; 5331 const GLvoid * indirect; 5332}; 5333uint32_t 5334_mesa_unmarshal_MultiDrawArraysIndirect(struct gl_context *ctx, const struct marshal_cmd_MultiDrawArraysIndirect *cmd, const uint64_t *last) 5335{ 5336 GLenum mode = cmd->mode; 5337 const GLvoid * indirect = cmd->indirect; 5338 GLsizei primcount = cmd->primcount; 5339 GLsizei stride = cmd->stride; 5340 CALL_MultiDrawArraysIndirect(ctx->CurrentServerDispatch, (mode, indirect, primcount, stride)); 5341 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiDrawArraysIndirect), 8) / 8); 5342 assert (cmd_size == cmd->cmd_base.cmd_size); 5343 return cmd_size; 5344} 5345void GLAPIENTRY 5346_mesa_marshal_MultiDrawArraysIndirect(GLenum mode, const GLvoid * indirect, GLsizei primcount, GLsizei stride) 5347{ 5348 GET_CURRENT_CONTEXT(ctx); 5349 int cmd_size = sizeof(struct marshal_cmd_MultiDrawArraysIndirect); 5350 struct marshal_cmd_MultiDrawArraysIndirect *cmd; 5351 if (_mesa_glthread_has_non_vbo_vertices_or_indirect(ctx)) { 5352 _mesa_glthread_finish_before(ctx, "MultiDrawArraysIndirect"); 5353 CALL_MultiDrawArraysIndirect(ctx->CurrentServerDispatch, (mode, indirect, primcount, stride)); 5354 return; 5355 } 5356 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiDrawArraysIndirect, cmd_size); 5357 cmd->mode = mode; 5358 cmd->indirect = indirect; 5359 cmd->primcount = primcount; 5360 cmd->stride = stride; 5361} 5362 5363 5364/* MultiDrawElementsIndirect: marshalled asynchronously */ 5365struct marshal_cmd_MultiDrawElementsIndirect 5366{ 5367 struct marshal_cmd_base cmd_base; 5368 GLenum mode; 5369 GLenum type; 5370 GLsizei primcount; 5371 GLsizei stride; 5372 const GLvoid * indirect; 5373}; 5374uint32_t 5375_mesa_unmarshal_MultiDrawElementsIndirect(struct gl_context *ctx, const struct marshal_cmd_MultiDrawElementsIndirect *cmd, const uint64_t *last) 5376{ 5377 GLenum mode = cmd->mode; 5378 GLenum type = cmd->type; 5379 const GLvoid * indirect = cmd->indirect; 5380 GLsizei primcount = cmd->primcount; 5381 GLsizei stride = cmd->stride; 5382 CALL_MultiDrawElementsIndirect(ctx->CurrentServerDispatch, (mode, type, indirect, primcount, stride)); 5383 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiDrawElementsIndirect), 8) / 8); 5384 assert (cmd_size == cmd->cmd_base.cmd_size); 5385 return cmd_size; 5386} 5387void GLAPIENTRY 5388_mesa_marshal_MultiDrawElementsIndirect(GLenum mode, GLenum type, const GLvoid * indirect, GLsizei primcount, GLsizei stride) 5389{ 5390 GET_CURRENT_CONTEXT(ctx); 5391 int cmd_size = sizeof(struct marshal_cmd_MultiDrawElementsIndirect); 5392 struct marshal_cmd_MultiDrawElementsIndirect *cmd; 5393 if (_mesa_glthread_has_non_vbo_vertices_or_indices_or_indirect(ctx)) { 5394 _mesa_glthread_finish_before(ctx, "MultiDrawElementsIndirect"); 5395 CALL_MultiDrawElementsIndirect(ctx->CurrentServerDispatch, (mode, type, indirect, primcount, stride)); 5396 return; 5397 } 5398 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiDrawElementsIndirect, cmd_size); 5399 cmd->mode = mode; 5400 cmd->type = type; 5401 cmd->indirect = indirect; 5402 cmd->primcount = primcount; 5403 cmd->stride = stride; 5404} 5405 5406 5407/* Uniform1d: marshalled asynchronously */ 5408struct marshal_cmd_Uniform1d 5409{ 5410 struct marshal_cmd_base cmd_base; 5411 GLint location; 5412 GLdouble x; 5413}; 5414uint32_t 5415_mesa_unmarshal_Uniform1d(struct gl_context *ctx, const struct marshal_cmd_Uniform1d *cmd, const uint64_t *last) 5416{ 5417 GLint location = cmd->location; 5418 GLdouble x = cmd->x; 5419 CALL_Uniform1d(ctx->CurrentServerDispatch, (location, x)); 5420 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform1d), 8) / 8); 5421 assert (cmd_size == cmd->cmd_base.cmd_size); 5422 return cmd_size; 5423} 5424void GLAPIENTRY 5425_mesa_marshal_Uniform1d(GLint location, GLdouble x) 5426{ 5427 GET_CURRENT_CONTEXT(ctx); 5428 int cmd_size = sizeof(struct marshal_cmd_Uniform1d); 5429 struct marshal_cmd_Uniform1d *cmd; 5430 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1d, cmd_size); 5431 cmd->location = location; 5432 cmd->x = x; 5433} 5434 5435 5436/* Uniform2d: marshalled asynchronously */ 5437struct marshal_cmd_Uniform2d 5438{ 5439 struct marshal_cmd_base cmd_base; 5440 GLint location; 5441 GLdouble x; 5442 GLdouble y; 5443}; 5444uint32_t 5445_mesa_unmarshal_Uniform2d(struct gl_context *ctx, const struct marshal_cmd_Uniform2d *cmd, const uint64_t *last) 5446{ 5447 GLint location = cmd->location; 5448 GLdouble x = cmd->x; 5449 GLdouble y = cmd->y; 5450 CALL_Uniform2d(ctx->CurrentServerDispatch, (location, x, y)); 5451 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform2d), 8) / 8); 5452 assert (cmd_size == cmd->cmd_base.cmd_size); 5453 return cmd_size; 5454} 5455void GLAPIENTRY 5456_mesa_marshal_Uniform2d(GLint location, GLdouble x, GLdouble y) 5457{ 5458 GET_CURRENT_CONTEXT(ctx); 5459 int cmd_size = sizeof(struct marshal_cmd_Uniform2d); 5460 struct marshal_cmd_Uniform2d *cmd; 5461 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2d, cmd_size); 5462 cmd->location = location; 5463 cmd->x = x; 5464 cmd->y = y; 5465} 5466 5467 5468/* Uniform3d: marshalled asynchronously */ 5469struct marshal_cmd_Uniform3d 5470{ 5471 struct marshal_cmd_base cmd_base; 5472 GLint location; 5473 GLdouble x; 5474 GLdouble y; 5475 GLdouble z; 5476}; 5477uint32_t 5478_mesa_unmarshal_Uniform3d(struct gl_context *ctx, const struct marshal_cmd_Uniform3d *cmd, const uint64_t *last) 5479{ 5480 GLint location = cmd->location; 5481 GLdouble x = cmd->x; 5482 GLdouble y = cmd->y; 5483 GLdouble z = cmd->z; 5484 CALL_Uniform3d(ctx->CurrentServerDispatch, (location, x, y, z)); 5485 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform3d), 8) / 8); 5486 assert (cmd_size == cmd->cmd_base.cmd_size); 5487 return cmd_size; 5488} 5489void GLAPIENTRY 5490_mesa_marshal_Uniform3d(GLint location, GLdouble x, GLdouble y, GLdouble z) 5491{ 5492 GET_CURRENT_CONTEXT(ctx); 5493 int cmd_size = sizeof(struct marshal_cmd_Uniform3d); 5494 struct marshal_cmd_Uniform3d *cmd; 5495 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3d, cmd_size); 5496 cmd->location = location; 5497 cmd->x = x; 5498 cmd->y = y; 5499 cmd->z = z; 5500} 5501 5502 5503/* Uniform4d: marshalled asynchronously */ 5504struct marshal_cmd_Uniform4d 5505{ 5506 struct marshal_cmd_base cmd_base; 5507 GLint location; 5508 GLdouble x; 5509 GLdouble y; 5510 GLdouble z; 5511 GLdouble w; 5512}; 5513uint32_t 5514_mesa_unmarshal_Uniform4d(struct gl_context *ctx, const struct marshal_cmd_Uniform4d *cmd, const uint64_t *last) 5515{ 5516 GLint location = cmd->location; 5517 GLdouble x = cmd->x; 5518 GLdouble y = cmd->y; 5519 GLdouble z = cmd->z; 5520 GLdouble w = cmd->w; 5521 CALL_Uniform4d(ctx->CurrentServerDispatch, (location, x, y, z, w)); 5522 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform4d), 8) / 8); 5523 assert (cmd_size == cmd->cmd_base.cmd_size); 5524 return cmd_size; 5525} 5526void GLAPIENTRY 5527_mesa_marshal_Uniform4d(GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w) 5528{ 5529 GET_CURRENT_CONTEXT(ctx); 5530 int cmd_size = sizeof(struct marshal_cmd_Uniform4d); 5531 struct marshal_cmd_Uniform4d *cmd; 5532 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4d, cmd_size); 5533 cmd->location = location; 5534 cmd->x = x; 5535 cmd->y = y; 5536 cmd->z = z; 5537 cmd->w = w; 5538} 5539 5540 5541/* Uniform1dv: marshalled asynchronously */ 5542struct marshal_cmd_Uniform1dv 5543{ 5544 struct marshal_cmd_base cmd_base; 5545 GLint location; 5546 GLsizei count; 5547 /* Next safe_mul(count, 1 * sizeof(GLdouble)) bytes are GLdouble value[count] */ 5548}; 5549uint32_t 5550_mesa_unmarshal_Uniform1dv(struct gl_context *ctx, const struct marshal_cmd_Uniform1dv *cmd, const uint64_t *last) 5551{ 5552 GLint location = cmd->location; 5553 GLsizei count = cmd->count; 5554 GLdouble * value; 5555 const char *variable_data = (const char *) (cmd + 1); 5556 value = (GLdouble *) variable_data; 5557 CALL_Uniform1dv(ctx->CurrentServerDispatch, (location, count, value)); 5558 return cmd->cmd_base.cmd_size; 5559} 5560void GLAPIENTRY 5561_mesa_marshal_Uniform1dv(GLint location, GLsizei count, const GLdouble * value) 5562{ 5563 GET_CURRENT_CONTEXT(ctx); 5564 int value_size = safe_mul(count, 1 * sizeof(GLdouble)); 5565 int cmd_size = sizeof(struct marshal_cmd_Uniform1dv) + value_size; 5566 struct marshal_cmd_Uniform1dv *cmd; 5567 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5568 _mesa_glthread_finish_before(ctx, "Uniform1dv"); 5569 CALL_Uniform1dv(ctx->CurrentServerDispatch, (location, count, value)); 5570 return; 5571 } 5572 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1dv, cmd_size); 5573 cmd->location = location; 5574 cmd->count = count; 5575 char *variable_data = (char *) (cmd + 1); 5576 memcpy(variable_data, value, value_size); 5577} 5578 5579 5580/* Uniform2dv: marshalled asynchronously */ 5581struct marshal_cmd_Uniform2dv 5582{ 5583 struct marshal_cmd_base cmd_base; 5584 GLint location; 5585 GLsizei count; 5586 /* Next safe_mul(count, 2 * sizeof(GLdouble)) bytes are GLdouble value[count][2] */ 5587}; 5588uint32_t 5589_mesa_unmarshal_Uniform2dv(struct gl_context *ctx, const struct marshal_cmd_Uniform2dv *cmd, const uint64_t *last) 5590{ 5591 GLint location = cmd->location; 5592 GLsizei count = cmd->count; 5593 GLdouble * value; 5594 const char *variable_data = (const char *) (cmd + 1); 5595 value = (GLdouble *) variable_data; 5596 CALL_Uniform2dv(ctx->CurrentServerDispatch, (location, count, value)); 5597 return cmd->cmd_base.cmd_size; 5598} 5599void GLAPIENTRY 5600_mesa_marshal_Uniform2dv(GLint location, GLsizei count, const GLdouble * value) 5601{ 5602 GET_CURRENT_CONTEXT(ctx); 5603 int value_size = safe_mul(count, 2 * sizeof(GLdouble)); 5604 int cmd_size = sizeof(struct marshal_cmd_Uniform2dv) + value_size; 5605 struct marshal_cmd_Uniform2dv *cmd; 5606 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5607 _mesa_glthread_finish_before(ctx, "Uniform2dv"); 5608 CALL_Uniform2dv(ctx->CurrentServerDispatch, (location, count, value)); 5609 return; 5610 } 5611 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2dv, cmd_size); 5612 cmd->location = location; 5613 cmd->count = count; 5614 char *variable_data = (char *) (cmd + 1); 5615 memcpy(variable_data, value, value_size); 5616} 5617 5618 5619/* Uniform3dv: marshalled asynchronously */ 5620struct marshal_cmd_Uniform3dv 5621{ 5622 struct marshal_cmd_base cmd_base; 5623 GLint location; 5624 GLsizei count; 5625 /* Next safe_mul(count, 3 * sizeof(GLdouble)) bytes are GLdouble value[count][3] */ 5626}; 5627uint32_t 5628_mesa_unmarshal_Uniform3dv(struct gl_context *ctx, const struct marshal_cmd_Uniform3dv *cmd, const uint64_t *last) 5629{ 5630 GLint location = cmd->location; 5631 GLsizei count = cmd->count; 5632 GLdouble * value; 5633 const char *variable_data = (const char *) (cmd + 1); 5634 value = (GLdouble *) variable_data; 5635 CALL_Uniform3dv(ctx->CurrentServerDispatch, (location, count, value)); 5636 return cmd->cmd_base.cmd_size; 5637} 5638void GLAPIENTRY 5639_mesa_marshal_Uniform3dv(GLint location, GLsizei count, const GLdouble * value) 5640{ 5641 GET_CURRENT_CONTEXT(ctx); 5642 int value_size = safe_mul(count, 3 * sizeof(GLdouble)); 5643 int cmd_size = sizeof(struct marshal_cmd_Uniform3dv) + value_size; 5644 struct marshal_cmd_Uniform3dv *cmd; 5645 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5646 _mesa_glthread_finish_before(ctx, "Uniform3dv"); 5647 CALL_Uniform3dv(ctx->CurrentServerDispatch, (location, count, value)); 5648 return; 5649 } 5650 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3dv, cmd_size); 5651 cmd->location = location; 5652 cmd->count = count; 5653 char *variable_data = (char *) (cmd + 1); 5654 memcpy(variable_data, value, value_size); 5655} 5656 5657 5658/* Uniform4dv: marshalled asynchronously */ 5659struct marshal_cmd_Uniform4dv 5660{ 5661 struct marshal_cmd_base cmd_base; 5662 GLint location; 5663 GLsizei count; 5664 /* Next safe_mul(count, 4 * sizeof(GLdouble)) bytes are GLdouble value[count][4] */ 5665}; 5666uint32_t 5667_mesa_unmarshal_Uniform4dv(struct gl_context *ctx, const struct marshal_cmd_Uniform4dv *cmd, const uint64_t *last) 5668{ 5669 GLint location = cmd->location; 5670 GLsizei count = cmd->count; 5671 GLdouble * value; 5672 const char *variable_data = (const char *) (cmd + 1); 5673 value = (GLdouble *) variable_data; 5674 CALL_Uniform4dv(ctx->CurrentServerDispatch, (location, count, value)); 5675 return cmd->cmd_base.cmd_size; 5676} 5677void GLAPIENTRY 5678_mesa_marshal_Uniform4dv(GLint location, GLsizei count, const GLdouble * value) 5679{ 5680 GET_CURRENT_CONTEXT(ctx); 5681 int value_size = safe_mul(count, 4 * sizeof(GLdouble)); 5682 int cmd_size = sizeof(struct marshal_cmd_Uniform4dv) + value_size; 5683 struct marshal_cmd_Uniform4dv *cmd; 5684 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5685 _mesa_glthread_finish_before(ctx, "Uniform4dv"); 5686 CALL_Uniform4dv(ctx->CurrentServerDispatch, (location, count, value)); 5687 return; 5688 } 5689 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4dv, cmd_size); 5690 cmd->location = location; 5691 cmd->count = count; 5692 char *variable_data = (char *) (cmd + 1); 5693 memcpy(variable_data, value, value_size); 5694} 5695 5696 5697/* UniformMatrix2dv: marshalled asynchronously */ 5698struct marshal_cmd_UniformMatrix2dv 5699{ 5700 struct marshal_cmd_base cmd_base; 5701 GLboolean transpose; 5702 GLint location; 5703 GLsizei count; 5704 /* Next safe_mul(count, 4 * sizeof(GLdouble)) bytes are GLdouble value[count][4] */ 5705}; 5706uint32_t 5707_mesa_unmarshal_UniformMatrix2dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2dv *cmd, const uint64_t *last) 5708{ 5709 GLint location = cmd->location; 5710 GLsizei count = cmd->count; 5711 GLboolean transpose = cmd->transpose; 5712 GLdouble * value; 5713 const char *variable_data = (const char *) (cmd + 1); 5714 value = (GLdouble *) variable_data; 5715 CALL_UniformMatrix2dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 5716 return cmd->cmd_base.cmd_size; 5717} 5718void GLAPIENTRY 5719_mesa_marshal_UniformMatrix2dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 5720{ 5721 GET_CURRENT_CONTEXT(ctx); 5722 int value_size = safe_mul(count, 4 * sizeof(GLdouble)); 5723 int cmd_size = sizeof(struct marshal_cmd_UniformMatrix2dv) + value_size; 5724 struct marshal_cmd_UniformMatrix2dv *cmd; 5725 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5726 _mesa_glthread_finish_before(ctx, "UniformMatrix2dv"); 5727 CALL_UniformMatrix2dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 5728 return; 5729 } 5730 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2dv, cmd_size); 5731 cmd->location = location; 5732 cmd->count = count; 5733 cmd->transpose = transpose; 5734 char *variable_data = (char *) (cmd + 1); 5735 memcpy(variable_data, value, value_size); 5736} 5737 5738 5739/* UniformMatrix3dv: marshalled asynchronously */ 5740struct marshal_cmd_UniformMatrix3dv 5741{ 5742 struct marshal_cmd_base cmd_base; 5743 GLboolean transpose; 5744 GLint location; 5745 GLsizei count; 5746 /* Next safe_mul(count, 9 * sizeof(GLdouble)) bytes are GLdouble value[count][9] */ 5747}; 5748uint32_t 5749_mesa_unmarshal_UniformMatrix3dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3dv *cmd, const uint64_t *last) 5750{ 5751 GLint location = cmd->location; 5752 GLsizei count = cmd->count; 5753 GLboolean transpose = cmd->transpose; 5754 GLdouble * value; 5755 const char *variable_data = (const char *) (cmd + 1); 5756 value = (GLdouble *) variable_data; 5757 CALL_UniformMatrix3dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 5758 return cmd->cmd_base.cmd_size; 5759} 5760void GLAPIENTRY 5761_mesa_marshal_UniformMatrix3dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 5762{ 5763 GET_CURRENT_CONTEXT(ctx); 5764 int value_size = safe_mul(count, 9 * sizeof(GLdouble)); 5765 int cmd_size = sizeof(struct marshal_cmd_UniformMatrix3dv) + value_size; 5766 struct marshal_cmd_UniformMatrix3dv *cmd; 5767 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5768 _mesa_glthread_finish_before(ctx, "UniformMatrix3dv"); 5769 CALL_UniformMatrix3dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 5770 return; 5771 } 5772 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3dv, cmd_size); 5773 cmd->location = location; 5774 cmd->count = count; 5775 cmd->transpose = transpose; 5776 char *variable_data = (char *) (cmd + 1); 5777 memcpy(variable_data, value, value_size); 5778} 5779 5780 5781/* UniformMatrix4dv: marshalled asynchronously */ 5782struct marshal_cmd_UniformMatrix4dv 5783{ 5784 struct marshal_cmd_base cmd_base; 5785 GLboolean transpose; 5786 GLint location; 5787 GLsizei count; 5788 /* Next safe_mul(count, 16 * sizeof(GLdouble)) bytes are GLdouble value[count][16] */ 5789}; 5790uint32_t 5791_mesa_unmarshal_UniformMatrix4dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4dv *cmd, const uint64_t *last) 5792{ 5793 GLint location = cmd->location; 5794 GLsizei count = cmd->count; 5795 GLboolean transpose = cmd->transpose; 5796 GLdouble * value; 5797 const char *variable_data = (const char *) (cmd + 1); 5798 value = (GLdouble *) variable_data; 5799 CALL_UniformMatrix4dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 5800 return cmd->cmd_base.cmd_size; 5801} 5802void GLAPIENTRY 5803_mesa_marshal_UniformMatrix4dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 5804{ 5805 GET_CURRENT_CONTEXT(ctx); 5806 int value_size = safe_mul(count, 16 * sizeof(GLdouble)); 5807 int cmd_size = sizeof(struct marshal_cmd_UniformMatrix4dv) + value_size; 5808 struct marshal_cmd_UniformMatrix4dv *cmd; 5809 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5810 _mesa_glthread_finish_before(ctx, "UniformMatrix4dv"); 5811 CALL_UniformMatrix4dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 5812 return; 5813 } 5814 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4dv, cmd_size); 5815 cmd->location = location; 5816 cmd->count = count; 5817 cmd->transpose = transpose; 5818 char *variable_data = (char *) (cmd + 1); 5819 memcpy(variable_data, value, value_size); 5820} 5821 5822 5823/* UniformMatrix2x3dv: marshalled asynchronously */ 5824struct marshal_cmd_UniformMatrix2x3dv 5825{ 5826 struct marshal_cmd_base cmd_base; 5827 GLboolean transpose; 5828 GLint location; 5829 GLsizei count; 5830 /* Next safe_mul(count, 6 * sizeof(GLdouble)) bytes are GLdouble value[count][6] */ 5831}; 5832uint32_t 5833_mesa_unmarshal_UniformMatrix2x3dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2x3dv *cmd, const uint64_t *last) 5834{ 5835 GLint location = cmd->location; 5836 GLsizei count = cmd->count; 5837 GLboolean transpose = cmd->transpose; 5838 GLdouble * value; 5839 const char *variable_data = (const char *) (cmd + 1); 5840 value = (GLdouble *) variable_data; 5841 CALL_UniformMatrix2x3dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 5842 return cmd->cmd_base.cmd_size; 5843} 5844void GLAPIENTRY 5845_mesa_marshal_UniformMatrix2x3dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 5846{ 5847 GET_CURRENT_CONTEXT(ctx); 5848 int value_size = safe_mul(count, 6 * sizeof(GLdouble)); 5849 int cmd_size = sizeof(struct marshal_cmd_UniformMatrix2x3dv) + value_size; 5850 struct marshal_cmd_UniformMatrix2x3dv *cmd; 5851 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5852 _mesa_glthread_finish_before(ctx, "UniformMatrix2x3dv"); 5853 CALL_UniformMatrix2x3dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 5854 return; 5855 } 5856 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2x3dv, cmd_size); 5857 cmd->location = location; 5858 cmd->count = count; 5859 cmd->transpose = transpose; 5860 char *variable_data = (char *) (cmd + 1); 5861 memcpy(variable_data, value, value_size); 5862} 5863 5864 5865/* UniformMatrix2x4dv: marshalled asynchronously */ 5866struct marshal_cmd_UniformMatrix2x4dv 5867{ 5868 struct marshal_cmd_base cmd_base; 5869 GLboolean transpose; 5870 GLint location; 5871 GLsizei count; 5872 /* Next safe_mul(count, 8 * sizeof(GLdouble)) bytes are GLdouble value[count][8] */ 5873}; 5874uint32_t 5875_mesa_unmarshal_UniformMatrix2x4dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix2x4dv *cmd, const uint64_t *last) 5876{ 5877 GLint location = cmd->location; 5878 GLsizei count = cmd->count; 5879 GLboolean transpose = cmd->transpose; 5880 GLdouble * value; 5881 const char *variable_data = (const char *) (cmd + 1); 5882 value = (GLdouble *) variable_data; 5883 CALL_UniformMatrix2x4dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 5884 return cmd->cmd_base.cmd_size; 5885} 5886void GLAPIENTRY 5887_mesa_marshal_UniformMatrix2x4dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 5888{ 5889 GET_CURRENT_CONTEXT(ctx); 5890 int value_size = safe_mul(count, 8 * sizeof(GLdouble)); 5891 int cmd_size = sizeof(struct marshal_cmd_UniformMatrix2x4dv) + value_size; 5892 struct marshal_cmd_UniformMatrix2x4dv *cmd; 5893 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5894 _mesa_glthread_finish_before(ctx, "UniformMatrix2x4dv"); 5895 CALL_UniformMatrix2x4dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 5896 return; 5897 } 5898 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix2x4dv, cmd_size); 5899 cmd->location = location; 5900 cmd->count = count; 5901 cmd->transpose = transpose; 5902 char *variable_data = (char *) (cmd + 1); 5903 memcpy(variable_data, value, value_size); 5904} 5905 5906 5907/* UniformMatrix3x2dv: marshalled asynchronously */ 5908struct marshal_cmd_UniformMatrix3x2dv 5909{ 5910 struct marshal_cmd_base cmd_base; 5911 GLboolean transpose; 5912 GLint location; 5913 GLsizei count; 5914 /* Next safe_mul(count, 6 * sizeof(GLdouble)) bytes are GLdouble value[count][6] */ 5915}; 5916uint32_t 5917_mesa_unmarshal_UniformMatrix3x2dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3x2dv *cmd, const uint64_t *last) 5918{ 5919 GLint location = cmd->location; 5920 GLsizei count = cmd->count; 5921 GLboolean transpose = cmd->transpose; 5922 GLdouble * value; 5923 const char *variable_data = (const char *) (cmd + 1); 5924 value = (GLdouble *) variable_data; 5925 CALL_UniformMatrix3x2dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 5926 return cmd->cmd_base.cmd_size; 5927} 5928void GLAPIENTRY 5929_mesa_marshal_UniformMatrix3x2dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 5930{ 5931 GET_CURRENT_CONTEXT(ctx); 5932 int value_size = safe_mul(count, 6 * sizeof(GLdouble)); 5933 int cmd_size = sizeof(struct marshal_cmd_UniformMatrix3x2dv) + value_size; 5934 struct marshal_cmd_UniformMatrix3x2dv *cmd; 5935 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5936 _mesa_glthread_finish_before(ctx, "UniformMatrix3x2dv"); 5937 CALL_UniformMatrix3x2dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 5938 return; 5939 } 5940 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3x2dv, cmd_size); 5941 cmd->location = location; 5942 cmd->count = count; 5943 cmd->transpose = transpose; 5944 char *variable_data = (char *) (cmd + 1); 5945 memcpy(variable_data, value, value_size); 5946} 5947 5948 5949/* UniformMatrix3x4dv: marshalled asynchronously */ 5950struct marshal_cmd_UniformMatrix3x4dv 5951{ 5952 struct marshal_cmd_base cmd_base; 5953 GLboolean transpose; 5954 GLint location; 5955 GLsizei count; 5956 /* Next safe_mul(count, 12 * sizeof(GLdouble)) bytes are GLdouble value[count][12] */ 5957}; 5958uint32_t 5959_mesa_unmarshal_UniformMatrix3x4dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix3x4dv *cmd, const uint64_t *last) 5960{ 5961 GLint location = cmd->location; 5962 GLsizei count = cmd->count; 5963 GLboolean transpose = cmd->transpose; 5964 GLdouble * value; 5965 const char *variable_data = (const char *) (cmd + 1); 5966 value = (GLdouble *) variable_data; 5967 CALL_UniformMatrix3x4dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 5968 return cmd->cmd_base.cmd_size; 5969} 5970void GLAPIENTRY 5971_mesa_marshal_UniformMatrix3x4dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 5972{ 5973 GET_CURRENT_CONTEXT(ctx); 5974 int value_size = safe_mul(count, 12 * sizeof(GLdouble)); 5975 int cmd_size = sizeof(struct marshal_cmd_UniformMatrix3x4dv) + value_size; 5976 struct marshal_cmd_UniformMatrix3x4dv *cmd; 5977 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5978 _mesa_glthread_finish_before(ctx, "UniformMatrix3x4dv"); 5979 CALL_UniformMatrix3x4dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 5980 return; 5981 } 5982 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix3x4dv, cmd_size); 5983 cmd->location = location; 5984 cmd->count = count; 5985 cmd->transpose = transpose; 5986 char *variable_data = (char *) (cmd + 1); 5987 memcpy(variable_data, value, value_size); 5988} 5989 5990 5991/* UniformMatrix4x2dv: marshalled asynchronously */ 5992struct marshal_cmd_UniformMatrix4x2dv 5993{ 5994 struct marshal_cmd_base cmd_base; 5995 GLboolean transpose; 5996 GLint location; 5997 GLsizei count; 5998 /* Next safe_mul(count, 8 * sizeof(GLdouble)) bytes are GLdouble value[count][8] */ 5999}; 6000uint32_t 6001_mesa_unmarshal_UniformMatrix4x2dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4x2dv *cmd, const uint64_t *last) 6002{ 6003 GLint location = cmd->location; 6004 GLsizei count = cmd->count; 6005 GLboolean transpose = cmd->transpose; 6006 GLdouble * value; 6007 const char *variable_data = (const char *) (cmd + 1); 6008 value = (GLdouble *) variable_data; 6009 CALL_UniformMatrix4x2dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 6010 return cmd->cmd_base.cmd_size; 6011} 6012void GLAPIENTRY 6013_mesa_marshal_UniformMatrix4x2dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 6014{ 6015 GET_CURRENT_CONTEXT(ctx); 6016 int value_size = safe_mul(count, 8 * sizeof(GLdouble)); 6017 int cmd_size = sizeof(struct marshal_cmd_UniformMatrix4x2dv) + value_size; 6018 struct marshal_cmd_UniformMatrix4x2dv *cmd; 6019 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6020 _mesa_glthread_finish_before(ctx, "UniformMatrix4x2dv"); 6021 CALL_UniformMatrix4x2dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 6022 return; 6023 } 6024 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4x2dv, cmd_size); 6025 cmd->location = location; 6026 cmd->count = count; 6027 cmd->transpose = transpose; 6028 char *variable_data = (char *) (cmd + 1); 6029 memcpy(variable_data, value, value_size); 6030} 6031 6032 6033/* UniformMatrix4x3dv: marshalled asynchronously */ 6034struct marshal_cmd_UniformMatrix4x3dv 6035{ 6036 struct marshal_cmd_base cmd_base; 6037 GLboolean transpose; 6038 GLint location; 6039 GLsizei count; 6040 /* Next safe_mul(count, 12 * sizeof(GLdouble)) bytes are GLdouble value[count][12] */ 6041}; 6042uint32_t 6043_mesa_unmarshal_UniformMatrix4x3dv(struct gl_context *ctx, const struct marshal_cmd_UniformMatrix4x3dv *cmd, const uint64_t *last) 6044{ 6045 GLint location = cmd->location; 6046 GLsizei count = cmd->count; 6047 GLboolean transpose = cmd->transpose; 6048 GLdouble * value; 6049 const char *variable_data = (const char *) (cmd + 1); 6050 value = (GLdouble *) variable_data; 6051 CALL_UniformMatrix4x3dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 6052 return cmd->cmd_base.cmd_size; 6053} 6054void GLAPIENTRY 6055_mesa_marshal_UniformMatrix4x3dv(GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 6056{ 6057 GET_CURRENT_CONTEXT(ctx); 6058 int value_size = safe_mul(count, 12 * sizeof(GLdouble)); 6059 int cmd_size = sizeof(struct marshal_cmd_UniformMatrix4x3dv) + value_size; 6060 struct marshal_cmd_UniformMatrix4x3dv *cmd; 6061 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6062 _mesa_glthread_finish_before(ctx, "UniformMatrix4x3dv"); 6063 CALL_UniformMatrix4x3dv(ctx->CurrentServerDispatch, (location, count, transpose, value)); 6064 return; 6065 } 6066 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UniformMatrix4x3dv, cmd_size); 6067 cmd->location = location; 6068 cmd->count = count; 6069 cmd->transpose = transpose; 6070 char *variable_data = (char *) (cmd + 1); 6071 memcpy(variable_data, value, value_size); 6072} 6073 6074 6075/* GetUniformdv: marshalled synchronously */ 6076void GLAPIENTRY 6077_mesa_marshal_GetUniformdv(GLuint program, GLint location, GLdouble * params) 6078{ 6079 GET_CURRENT_CONTEXT(ctx); 6080 _mesa_glthread_finish_before(ctx, "GetUniformdv"); 6081 CALL_GetUniformdv(ctx->CurrentServerDispatch, (program, location, params)); 6082} 6083 6084 6085/* ProgramUniform1d: marshalled asynchronously */ 6086struct marshal_cmd_ProgramUniform1d 6087{ 6088 struct marshal_cmd_base cmd_base; 6089 GLuint program; 6090 GLint location; 6091 GLdouble x; 6092}; 6093uint32_t 6094_mesa_unmarshal_ProgramUniform1d(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1d *cmd, const uint64_t *last) 6095{ 6096 GLuint program = cmd->program; 6097 GLint location = cmd->location; 6098 GLdouble x = cmd->x; 6099 CALL_ProgramUniform1d(ctx->CurrentServerDispatch, (program, location, x)); 6100 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform1d), 8) / 8); 6101 assert (cmd_size == cmd->cmd_base.cmd_size); 6102 return cmd_size; 6103} 6104void GLAPIENTRY 6105_mesa_marshal_ProgramUniform1d(GLuint program, GLint location, GLdouble x) 6106{ 6107 GET_CURRENT_CONTEXT(ctx); 6108 int cmd_size = sizeof(struct marshal_cmd_ProgramUniform1d); 6109 struct marshal_cmd_ProgramUniform1d *cmd; 6110 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1d, cmd_size); 6111 cmd->program = program; 6112 cmd->location = location; 6113 cmd->x = x; 6114} 6115 6116 6117/* ProgramUniform2d: marshalled asynchronously */ 6118struct marshal_cmd_ProgramUniform2d 6119{ 6120 struct marshal_cmd_base cmd_base; 6121 GLuint program; 6122 GLint location; 6123 GLdouble x; 6124 GLdouble y; 6125}; 6126uint32_t 6127_mesa_unmarshal_ProgramUniform2d(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2d *cmd, const uint64_t *last) 6128{ 6129 GLuint program = cmd->program; 6130 GLint location = cmd->location; 6131 GLdouble x = cmd->x; 6132 GLdouble y = cmd->y; 6133 CALL_ProgramUniform2d(ctx->CurrentServerDispatch, (program, location, x, y)); 6134 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform2d), 8) / 8); 6135 assert (cmd_size == cmd->cmd_base.cmd_size); 6136 return cmd_size; 6137} 6138void GLAPIENTRY 6139_mesa_marshal_ProgramUniform2d(GLuint program, GLint location, GLdouble x, GLdouble y) 6140{ 6141 GET_CURRENT_CONTEXT(ctx); 6142 int cmd_size = sizeof(struct marshal_cmd_ProgramUniform2d); 6143 struct marshal_cmd_ProgramUniform2d *cmd; 6144 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2d, cmd_size); 6145 cmd->program = program; 6146 cmd->location = location; 6147 cmd->x = x; 6148 cmd->y = y; 6149} 6150 6151 6152/* ProgramUniform3d: marshalled asynchronously */ 6153struct marshal_cmd_ProgramUniform3d 6154{ 6155 struct marshal_cmd_base cmd_base; 6156 GLuint program; 6157 GLint location; 6158 GLdouble x; 6159 GLdouble y; 6160 GLdouble z; 6161}; 6162uint32_t 6163_mesa_unmarshal_ProgramUniform3d(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3d *cmd, const uint64_t *last) 6164{ 6165 GLuint program = cmd->program; 6166 GLint location = cmd->location; 6167 GLdouble x = cmd->x; 6168 GLdouble y = cmd->y; 6169 GLdouble z = cmd->z; 6170 CALL_ProgramUniform3d(ctx->CurrentServerDispatch, (program, location, x, y, z)); 6171 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform3d), 8) / 8); 6172 assert (cmd_size == cmd->cmd_base.cmd_size); 6173 return cmd_size; 6174} 6175void GLAPIENTRY 6176_mesa_marshal_ProgramUniform3d(GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z) 6177{ 6178 GET_CURRENT_CONTEXT(ctx); 6179 int cmd_size = sizeof(struct marshal_cmd_ProgramUniform3d); 6180 struct marshal_cmd_ProgramUniform3d *cmd; 6181 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3d, cmd_size); 6182 cmd->program = program; 6183 cmd->location = location; 6184 cmd->x = x; 6185 cmd->y = y; 6186 cmd->z = z; 6187} 6188 6189 6190/* ProgramUniform4d: marshalled asynchronously */ 6191struct marshal_cmd_ProgramUniform4d 6192{ 6193 struct marshal_cmd_base cmd_base; 6194 GLuint program; 6195 GLint location; 6196 GLdouble x; 6197 GLdouble y; 6198 GLdouble z; 6199 GLdouble w; 6200}; 6201uint32_t 6202_mesa_unmarshal_ProgramUniform4d(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4d *cmd, const uint64_t *last) 6203{ 6204 GLuint program = cmd->program; 6205 GLint location = cmd->location; 6206 GLdouble x = cmd->x; 6207 GLdouble y = cmd->y; 6208 GLdouble z = cmd->z; 6209 GLdouble w = cmd->w; 6210 CALL_ProgramUniform4d(ctx->CurrentServerDispatch, (program, location, x, y, z, w)); 6211 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform4d), 8) / 8); 6212 assert (cmd_size == cmd->cmd_base.cmd_size); 6213 return cmd_size; 6214} 6215void GLAPIENTRY 6216_mesa_marshal_ProgramUniform4d(GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w) 6217{ 6218 GET_CURRENT_CONTEXT(ctx); 6219 int cmd_size = sizeof(struct marshal_cmd_ProgramUniform4d); 6220 struct marshal_cmd_ProgramUniform4d *cmd; 6221 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4d, cmd_size); 6222 cmd->program = program; 6223 cmd->location = location; 6224 cmd->x = x; 6225 cmd->y = y; 6226 cmd->z = z; 6227 cmd->w = w; 6228} 6229 6230 6231/* ProgramUniform1dv: marshalled asynchronously */ 6232struct marshal_cmd_ProgramUniform1dv 6233{ 6234 struct marshal_cmd_base cmd_base; 6235 GLuint program; 6236 GLint location; 6237 GLsizei count; 6238 /* Next safe_mul(count, 1 * sizeof(GLdouble)) bytes are GLdouble value[count] */ 6239}; 6240uint32_t 6241_mesa_unmarshal_ProgramUniform1dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1dv *cmd, const uint64_t *last) 6242{ 6243 GLuint program = cmd->program; 6244 GLint location = cmd->location; 6245 GLsizei count = cmd->count; 6246 GLdouble * value; 6247 const char *variable_data = (const char *) (cmd + 1); 6248 value = (GLdouble *) variable_data; 6249 CALL_ProgramUniform1dv(ctx->CurrentServerDispatch, (program, location, count, value)); 6250 return cmd->cmd_base.cmd_size; 6251} 6252void GLAPIENTRY 6253_mesa_marshal_ProgramUniform1dv(GLuint program, GLint location, GLsizei count, const GLdouble * value) 6254{ 6255 GET_CURRENT_CONTEXT(ctx); 6256 int value_size = safe_mul(count, 1 * sizeof(GLdouble)); 6257 int cmd_size = sizeof(struct marshal_cmd_ProgramUniform1dv) + value_size; 6258 struct marshal_cmd_ProgramUniform1dv *cmd; 6259 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6260 _mesa_glthread_finish_before(ctx, "ProgramUniform1dv"); 6261 CALL_ProgramUniform1dv(ctx->CurrentServerDispatch, (program, location, count, value)); 6262 return; 6263 } 6264 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1dv, cmd_size); 6265 cmd->program = program; 6266 cmd->location = location; 6267 cmd->count = count; 6268 char *variable_data = (char *) (cmd + 1); 6269 memcpy(variable_data, value, value_size); 6270} 6271 6272 6273/* ProgramUniform2dv: marshalled asynchronously */ 6274struct marshal_cmd_ProgramUniform2dv 6275{ 6276 struct marshal_cmd_base cmd_base; 6277 GLuint program; 6278 GLint location; 6279 GLsizei count; 6280 /* Next safe_mul(count, 2 * sizeof(GLdouble)) bytes are GLdouble value[count][2] */ 6281}; 6282uint32_t 6283_mesa_unmarshal_ProgramUniform2dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2dv *cmd, const uint64_t *last) 6284{ 6285 GLuint program = cmd->program; 6286 GLint location = cmd->location; 6287 GLsizei count = cmd->count; 6288 GLdouble * value; 6289 const char *variable_data = (const char *) (cmd + 1); 6290 value = (GLdouble *) variable_data; 6291 CALL_ProgramUniform2dv(ctx->CurrentServerDispatch, (program, location, count, value)); 6292 return cmd->cmd_base.cmd_size; 6293} 6294void GLAPIENTRY 6295_mesa_marshal_ProgramUniform2dv(GLuint program, GLint location, GLsizei count, const GLdouble * value) 6296{ 6297 GET_CURRENT_CONTEXT(ctx); 6298 int value_size = safe_mul(count, 2 * sizeof(GLdouble)); 6299 int cmd_size = sizeof(struct marshal_cmd_ProgramUniform2dv) + value_size; 6300 struct marshal_cmd_ProgramUniform2dv *cmd; 6301 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6302 _mesa_glthread_finish_before(ctx, "ProgramUniform2dv"); 6303 CALL_ProgramUniform2dv(ctx->CurrentServerDispatch, (program, location, count, value)); 6304 return; 6305 } 6306 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2dv, cmd_size); 6307 cmd->program = program; 6308 cmd->location = location; 6309 cmd->count = count; 6310 char *variable_data = (char *) (cmd + 1); 6311 memcpy(variable_data, value, value_size); 6312} 6313 6314 6315/* ProgramUniform3dv: marshalled asynchronously */ 6316struct marshal_cmd_ProgramUniform3dv 6317{ 6318 struct marshal_cmd_base cmd_base; 6319 GLuint program; 6320 GLint location; 6321 GLsizei count; 6322 /* Next safe_mul(count, 3 * sizeof(GLdouble)) bytes are GLdouble value[count][3] */ 6323}; 6324uint32_t 6325_mesa_unmarshal_ProgramUniform3dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform3dv *cmd, const uint64_t *last) 6326{ 6327 GLuint program = cmd->program; 6328 GLint location = cmd->location; 6329 GLsizei count = cmd->count; 6330 GLdouble * value; 6331 const char *variable_data = (const char *) (cmd + 1); 6332 value = (GLdouble *) variable_data; 6333 CALL_ProgramUniform3dv(ctx->CurrentServerDispatch, (program, location, count, value)); 6334 return cmd->cmd_base.cmd_size; 6335} 6336void GLAPIENTRY 6337_mesa_marshal_ProgramUniform3dv(GLuint program, GLint location, GLsizei count, const GLdouble * value) 6338{ 6339 GET_CURRENT_CONTEXT(ctx); 6340 int value_size = safe_mul(count, 3 * sizeof(GLdouble)); 6341 int cmd_size = sizeof(struct marshal_cmd_ProgramUniform3dv) + value_size; 6342 struct marshal_cmd_ProgramUniform3dv *cmd; 6343 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6344 _mesa_glthread_finish_before(ctx, "ProgramUniform3dv"); 6345 CALL_ProgramUniform3dv(ctx->CurrentServerDispatch, (program, location, count, value)); 6346 return; 6347 } 6348 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform3dv, cmd_size); 6349 cmd->program = program; 6350 cmd->location = location; 6351 cmd->count = count; 6352 char *variable_data = (char *) (cmd + 1); 6353 memcpy(variable_data, value, value_size); 6354} 6355 6356 6357/* ProgramUniform4dv: marshalled asynchronously */ 6358struct marshal_cmd_ProgramUniform4dv 6359{ 6360 struct marshal_cmd_base cmd_base; 6361 GLuint program; 6362 GLint location; 6363 GLsizei count; 6364 /* Next safe_mul(count, 4 * sizeof(GLdouble)) bytes are GLdouble value[count][4] */ 6365}; 6366uint32_t 6367_mesa_unmarshal_ProgramUniform4dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform4dv *cmd, const uint64_t *last) 6368{ 6369 GLuint program = cmd->program; 6370 GLint location = cmd->location; 6371 GLsizei count = cmd->count; 6372 GLdouble * value; 6373 const char *variable_data = (const char *) (cmd + 1); 6374 value = (GLdouble *) variable_data; 6375 CALL_ProgramUniform4dv(ctx->CurrentServerDispatch, (program, location, count, value)); 6376 return cmd->cmd_base.cmd_size; 6377} 6378void GLAPIENTRY 6379_mesa_marshal_ProgramUniform4dv(GLuint program, GLint location, GLsizei count, const GLdouble * value) 6380{ 6381 GET_CURRENT_CONTEXT(ctx); 6382 int value_size = safe_mul(count, 4 * sizeof(GLdouble)); 6383 int cmd_size = sizeof(struct marshal_cmd_ProgramUniform4dv) + value_size; 6384 struct marshal_cmd_ProgramUniform4dv *cmd; 6385 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6386 _mesa_glthread_finish_before(ctx, "ProgramUniform4dv"); 6387 CALL_ProgramUniform4dv(ctx->CurrentServerDispatch, (program, location, count, value)); 6388 return; 6389 } 6390 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform4dv, cmd_size); 6391 cmd->program = program; 6392 cmd->location = location; 6393 cmd->count = count; 6394 char *variable_data = (char *) (cmd + 1); 6395 memcpy(variable_data, value, value_size); 6396} 6397 6398 6399/* ProgramUniformMatrix2dv: marshalled asynchronously */ 6400struct marshal_cmd_ProgramUniformMatrix2dv 6401{ 6402 struct marshal_cmd_base cmd_base; 6403 GLboolean transpose; 6404 GLuint program; 6405 GLint location; 6406 GLsizei count; 6407 /* Next safe_mul(count, 4 * sizeof(GLdouble)) bytes are GLdouble value[count][4] */ 6408}; 6409uint32_t 6410_mesa_unmarshal_ProgramUniformMatrix2dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix2dv *cmd, const uint64_t *last) 6411{ 6412 GLuint program = cmd->program; 6413 GLint location = cmd->location; 6414 GLsizei count = cmd->count; 6415 GLboolean transpose = cmd->transpose; 6416 GLdouble * value; 6417 const char *variable_data = (const char *) (cmd + 1); 6418 value = (GLdouble *) variable_data; 6419 CALL_ProgramUniformMatrix2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6420 return cmd->cmd_base.cmd_size; 6421} 6422void GLAPIENTRY 6423_mesa_marshal_ProgramUniformMatrix2dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 6424{ 6425 GET_CURRENT_CONTEXT(ctx); 6426 int value_size = safe_mul(count, 4 * sizeof(GLdouble)); 6427 int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix2dv) + value_size; 6428 struct marshal_cmd_ProgramUniformMatrix2dv *cmd; 6429 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6430 _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix2dv"); 6431 CALL_ProgramUniformMatrix2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6432 return; 6433 } 6434 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix2dv, cmd_size); 6435 cmd->program = program; 6436 cmd->location = location; 6437 cmd->count = count; 6438 cmd->transpose = transpose; 6439 char *variable_data = (char *) (cmd + 1); 6440 memcpy(variable_data, value, value_size); 6441} 6442 6443 6444/* ProgramUniformMatrix3dv: marshalled asynchronously */ 6445struct marshal_cmd_ProgramUniformMatrix3dv 6446{ 6447 struct marshal_cmd_base cmd_base; 6448 GLboolean transpose; 6449 GLuint program; 6450 GLint location; 6451 GLsizei count; 6452 /* Next safe_mul(count, 9 * sizeof(GLdouble)) bytes are GLdouble value[count][9] */ 6453}; 6454uint32_t 6455_mesa_unmarshal_ProgramUniformMatrix3dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix3dv *cmd, const uint64_t *last) 6456{ 6457 GLuint program = cmd->program; 6458 GLint location = cmd->location; 6459 GLsizei count = cmd->count; 6460 GLboolean transpose = cmd->transpose; 6461 GLdouble * value; 6462 const char *variable_data = (const char *) (cmd + 1); 6463 value = (GLdouble *) variable_data; 6464 CALL_ProgramUniformMatrix3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6465 return cmd->cmd_base.cmd_size; 6466} 6467void GLAPIENTRY 6468_mesa_marshal_ProgramUniformMatrix3dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 6469{ 6470 GET_CURRENT_CONTEXT(ctx); 6471 int value_size = safe_mul(count, 9 * sizeof(GLdouble)); 6472 int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix3dv) + value_size; 6473 struct marshal_cmd_ProgramUniformMatrix3dv *cmd; 6474 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6475 _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix3dv"); 6476 CALL_ProgramUniformMatrix3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6477 return; 6478 } 6479 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix3dv, cmd_size); 6480 cmd->program = program; 6481 cmd->location = location; 6482 cmd->count = count; 6483 cmd->transpose = transpose; 6484 char *variable_data = (char *) (cmd + 1); 6485 memcpy(variable_data, value, value_size); 6486} 6487 6488 6489/* ProgramUniformMatrix4dv: marshalled asynchronously */ 6490struct marshal_cmd_ProgramUniformMatrix4dv 6491{ 6492 struct marshal_cmd_base cmd_base; 6493 GLboolean transpose; 6494 GLuint program; 6495 GLint location; 6496 GLsizei count; 6497 /* Next safe_mul(count, 16 * sizeof(GLdouble)) bytes are GLdouble value[count][16] */ 6498}; 6499uint32_t 6500_mesa_unmarshal_ProgramUniformMatrix4dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix4dv *cmd, const uint64_t *last) 6501{ 6502 GLuint program = cmd->program; 6503 GLint location = cmd->location; 6504 GLsizei count = cmd->count; 6505 GLboolean transpose = cmd->transpose; 6506 GLdouble * value; 6507 const char *variable_data = (const char *) (cmd + 1); 6508 value = (GLdouble *) variable_data; 6509 CALL_ProgramUniformMatrix4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6510 return cmd->cmd_base.cmd_size; 6511} 6512void GLAPIENTRY 6513_mesa_marshal_ProgramUniformMatrix4dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 6514{ 6515 GET_CURRENT_CONTEXT(ctx); 6516 int value_size = safe_mul(count, 16 * sizeof(GLdouble)); 6517 int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix4dv) + value_size; 6518 struct marshal_cmd_ProgramUniformMatrix4dv *cmd; 6519 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6520 _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix4dv"); 6521 CALL_ProgramUniformMatrix4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6522 return; 6523 } 6524 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix4dv, cmd_size); 6525 cmd->program = program; 6526 cmd->location = location; 6527 cmd->count = count; 6528 cmd->transpose = transpose; 6529 char *variable_data = (char *) (cmd + 1); 6530 memcpy(variable_data, value, value_size); 6531} 6532 6533 6534/* ProgramUniformMatrix2x3dv: marshalled asynchronously */ 6535struct marshal_cmd_ProgramUniformMatrix2x3dv 6536{ 6537 struct marshal_cmd_base cmd_base; 6538 GLboolean transpose; 6539 GLuint program; 6540 GLint location; 6541 GLsizei count; 6542 /* Next safe_mul(count, 6 * sizeof(GLdouble)) bytes are GLdouble value[count][6] */ 6543}; 6544uint32_t 6545_mesa_unmarshal_ProgramUniformMatrix2x3dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix2x3dv *cmd, const uint64_t *last) 6546{ 6547 GLuint program = cmd->program; 6548 GLint location = cmd->location; 6549 GLsizei count = cmd->count; 6550 GLboolean transpose = cmd->transpose; 6551 GLdouble * value; 6552 const char *variable_data = (const char *) (cmd + 1); 6553 value = (GLdouble *) variable_data; 6554 CALL_ProgramUniformMatrix2x3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6555 return cmd->cmd_base.cmd_size; 6556} 6557void GLAPIENTRY 6558_mesa_marshal_ProgramUniformMatrix2x3dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 6559{ 6560 GET_CURRENT_CONTEXT(ctx); 6561 int value_size = safe_mul(count, 6 * sizeof(GLdouble)); 6562 int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix2x3dv) + value_size; 6563 struct marshal_cmd_ProgramUniformMatrix2x3dv *cmd; 6564 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6565 _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix2x3dv"); 6566 CALL_ProgramUniformMatrix2x3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6567 return; 6568 } 6569 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix2x3dv, cmd_size); 6570 cmd->program = program; 6571 cmd->location = location; 6572 cmd->count = count; 6573 cmd->transpose = transpose; 6574 char *variable_data = (char *) (cmd + 1); 6575 memcpy(variable_data, value, value_size); 6576} 6577 6578 6579/* ProgramUniformMatrix2x4dv: marshalled asynchronously */ 6580struct marshal_cmd_ProgramUniformMatrix2x4dv 6581{ 6582 struct marshal_cmd_base cmd_base; 6583 GLboolean transpose; 6584 GLuint program; 6585 GLint location; 6586 GLsizei count; 6587 /* Next safe_mul(count, 8 * sizeof(GLdouble)) bytes are GLdouble value[count][8] */ 6588}; 6589uint32_t 6590_mesa_unmarshal_ProgramUniformMatrix2x4dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix2x4dv *cmd, const uint64_t *last) 6591{ 6592 GLuint program = cmd->program; 6593 GLint location = cmd->location; 6594 GLsizei count = cmd->count; 6595 GLboolean transpose = cmd->transpose; 6596 GLdouble * value; 6597 const char *variable_data = (const char *) (cmd + 1); 6598 value = (GLdouble *) variable_data; 6599 CALL_ProgramUniformMatrix2x4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6600 return cmd->cmd_base.cmd_size; 6601} 6602void GLAPIENTRY 6603_mesa_marshal_ProgramUniformMatrix2x4dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 6604{ 6605 GET_CURRENT_CONTEXT(ctx); 6606 int value_size = safe_mul(count, 8 * sizeof(GLdouble)); 6607 int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix2x4dv) + value_size; 6608 struct marshal_cmd_ProgramUniformMatrix2x4dv *cmd; 6609 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6610 _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix2x4dv"); 6611 CALL_ProgramUniformMatrix2x4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6612 return; 6613 } 6614 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix2x4dv, cmd_size); 6615 cmd->program = program; 6616 cmd->location = location; 6617 cmd->count = count; 6618 cmd->transpose = transpose; 6619 char *variable_data = (char *) (cmd + 1); 6620 memcpy(variable_data, value, value_size); 6621} 6622 6623 6624/* ProgramUniformMatrix3x2dv: marshalled asynchronously */ 6625struct marshal_cmd_ProgramUniformMatrix3x2dv 6626{ 6627 struct marshal_cmd_base cmd_base; 6628 GLboolean transpose; 6629 GLuint program; 6630 GLint location; 6631 GLsizei count; 6632 /* Next safe_mul(count, 6 * sizeof(GLdouble)) bytes are GLdouble value[count][6] */ 6633}; 6634uint32_t 6635_mesa_unmarshal_ProgramUniformMatrix3x2dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix3x2dv *cmd, const uint64_t *last) 6636{ 6637 GLuint program = cmd->program; 6638 GLint location = cmd->location; 6639 GLsizei count = cmd->count; 6640 GLboolean transpose = cmd->transpose; 6641 GLdouble * value; 6642 const char *variable_data = (const char *) (cmd + 1); 6643 value = (GLdouble *) variable_data; 6644 CALL_ProgramUniformMatrix3x2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6645 return cmd->cmd_base.cmd_size; 6646} 6647void GLAPIENTRY 6648_mesa_marshal_ProgramUniformMatrix3x2dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 6649{ 6650 GET_CURRENT_CONTEXT(ctx); 6651 int value_size = safe_mul(count, 6 * sizeof(GLdouble)); 6652 int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix3x2dv) + value_size; 6653 struct marshal_cmd_ProgramUniformMatrix3x2dv *cmd; 6654 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6655 _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix3x2dv"); 6656 CALL_ProgramUniformMatrix3x2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6657 return; 6658 } 6659 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix3x2dv, cmd_size); 6660 cmd->program = program; 6661 cmd->location = location; 6662 cmd->count = count; 6663 cmd->transpose = transpose; 6664 char *variable_data = (char *) (cmd + 1); 6665 memcpy(variable_data, value, value_size); 6666} 6667 6668 6669/* ProgramUniformMatrix3x4dv: marshalled asynchronously */ 6670struct marshal_cmd_ProgramUniformMatrix3x4dv 6671{ 6672 struct marshal_cmd_base cmd_base; 6673 GLboolean transpose; 6674 GLuint program; 6675 GLint location; 6676 GLsizei count; 6677 /* Next safe_mul(count, 12 * sizeof(GLdouble)) bytes are GLdouble value[count][12] */ 6678}; 6679uint32_t 6680_mesa_unmarshal_ProgramUniformMatrix3x4dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix3x4dv *cmd, const uint64_t *last) 6681{ 6682 GLuint program = cmd->program; 6683 GLint location = cmd->location; 6684 GLsizei count = cmd->count; 6685 GLboolean transpose = cmd->transpose; 6686 GLdouble * value; 6687 const char *variable_data = (const char *) (cmd + 1); 6688 value = (GLdouble *) variable_data; 6689 CALL_ProgramUniformMatrix3x4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6690 return cmd->cmd_base.cmd_size; 6691} 6692void GLAPIENTRY 6693_mesa_marshal_ProgramUniformMatrix3x4dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 6694{ 6695 GET_CURRENT_CONTEXT(ctx); 6696 int value_size = safe_mul(count, 12 * sizeof(GLdouble)); 6697 int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix3x4dv) + value_size; 6698 struct marshal_cmd_ProgramUniformMatrix3x4dv *cmd; 6699 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6700 _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix3x4dv"); 6701 CALL_ProgramUniformMatrix3x4dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6702 return; 6703 } 6704 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix3x4dv, cmd_size); 6705 cmd->program = program; 6706 cmd->location = location; 6707 cmd->count = count; 6708 cmd->transpose = transpose; 6709 char *variable_data = (char *) (cmd + 1); 6710 memcpy(variable_data, value, value_size); 6711} 6712 6713 6714/* ProgramUniformMatrix4x2dv: marshalled asynchronously */ 6715struct marshal_cmd_ProgramUniformMatrix4x2dv 6716{ 6717 struct marshal_cmd_base cmd_base; 6718 GLboolean transpose; 6719 GLuint program; 6720 GLint location; 6721 GLsizei count; 6722 /* Next safe_mul(count, 8 * sizeof(GLdouble)) bytes are GLdouble value[count][8] */ 6723}; 6724uint32_t 6725_mesa_unmarshal_ProgramUniformMatrix4x2dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix4x2dv *cmd, const uint64_t *last) 6726{ 6727 GLuint program = cmd->program; 6728 GLint location = cmd->location; 6729 GLsizei count = cmd->count; 6730 GLboolean transpose = cmd->transpose; 6731 GLdouble * value; 6732 const char *variable_data = (const char *) (cmd + 1); 6733 value = (GLdouble *) variable_data; 6734 CALL_ProgramUniformMatrix4x2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6735 return cmd->cmd_base.cmd_size; 6736} 6737void GLAPIENTRY 6738_mesa_marshal_ProgramUniformMatrix4x2dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 6739{ 6740 GET_CURRENT_CONTEXT(ctx); 6741 int value_size = safe_mul(count, 8 * sizeof(GLdouble)); 6742 int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix4x2dv) + value_size; 6743 struct marshal_cmd_ProgramUniformMatrix4x2dv *cmd; 6744 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6745 _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix4x2dv"); 6746 CALL_ProgramUniformMatrix4x2dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6747 return; 6748 } 6749 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix4x2dv, cmd_size); 6750 cmd->program = program; 6751 cmd->location = location; 6752 cmd->count = count; 6753 cmd->transpose = transpose; 6754 char *variable_data = (char *) (cmd + 1); 6755 memcpy(variable_data, value, value_size); 6756} 6757 6758 6759/* ProgramUniformMatrix4x3dv: marshalled asynchronously */ 6760struct marshal_cmd_ProgramUniformMatrix4x3dv 6761{ 6762 struct marshal_cmd_base cmd_base; 6763 GLboolean transpose; 6764 GLuint program; 6765 GLint location; 6766 GLsizei count; 6767 /* Next safe_mul(count, 12 * sizeof(GLdouble)) bytes are GLdouble value[count][12] */ 6768}; 6769uint32_t 6770_mesa_unmarshal_ProgramUniformMatrix4x3dv(struct gl_context *ctx, const struct marshal_cmd_ProgramUniformMatrix4x3dv *cmd, const uint64_t *last) 6771{ 6772 GLuint program = cmd->program; 6773 GLint location = cmd->location; 6774 GLsizei count = cmd->count; 6775 GLboolean transpose = cmd->transpose; 6776 GLdouble * value; 6777 const char *variable_data = (const char *) (cmd + 1); 6778 value = (GLdouble *) variable_data; 6779 CALL_ProgramUniformMatrix4x3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6780 return cmd->cmd_base.cmd_size; 6781} 6782void GLAPIENTRY 6783_mesa_marshal_ProgramUniformMatrix4x3dv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble * value) 6784{ 6785 GET_CURRENT_CONTEXT(ctx); 6786 int value_size = safe_mul(count, 12 * sizeof(GLdouble)); 6787 int cmd_size = sizeof(struct marshal_cmd_ProgramUniformMatrix4x3dv) + value_size; 6788 struct marshal_cmd_ProgramUniformMatrix4x3dv *cmd; 6789 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6790 _mesa_glthread_finish_before(ctx, "ProgramUniformMatrix4x3dv"); 6791 CALL_ProgramUniformMatrix4x3dv(ctx->CurrentServerDispatch, (program, location, count, transpose, value)); 6792 return; 6793 } 6794 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniformMatrix4x3dv, cmd_size); 6795 cmd->program = program; 6796 cmd->location = location; 6797 cmd->count = count; 6798 cmd->transpose = transpose; 6799 char *variable_data = (char *) (cmd + 1); 6800 memcpy(variable_data, value, value_size); 6801} 6802 6803 6804/* DrawTransformFeedbackStream: marshalled asynchronously */ 6805struct marshal_cmd_DrawTransformFeedbackStream 6806{ 6807 struct marshal_cmd_base cmd_base; 6808 GLenum mode; 6809 GLuint id; 6810 GLuint stream; 6811}; 6812uint32_t 6813_mesa_unmarshal_DrawTransformFeedbackStream(struct gl_context *ctx, const struct marshal_cmd_DrawTransformFeedbackStream *cmd, const uint64_t *last) 6814{ 6815 GLenum mode = cmd->mode; 6816 GLuint id = cmd->id; 6817 GLuint stream = cmd->stream; 6818 CALL_DrawTransformFeedbackStream(ctx->CurrentServerDispatch, (mode, id, stream)); 6819 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawTransformFeedbackStream), 8) / 8); 6820 assert (cmd_size == cmd->cmd_base.cmd_size); 6821 return cmd_size; 6822} 6823void GLAPIENTRY 6824_mesa_marshal_DrawTransformFeedbackStream(GLenum mode, GLuint id, GLuint stream) 6825{ 6826 GET_CURRENT_CONTEXT(ctx); 6827 int cmd_size = sizeof(struct marshal_cmd_DrawTransformFeedbackStream); 6828 struct marshal_cmd_DrawTransformFeedbackStream *cmd; 6829 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTransformFeedbackStream, cmd_size); 6830 cmd->mode = mode; 6831 cmd->id = id; 6832 cmd->stream = stream; 6833} 6834 6835 6836/* BeginQueryIndexed: marshalled asynchronously */ 6837struct marshal_cmd_BeginQueryIndexed 6838{ 6839 struct marshal_cmd_base cmd_base; 6840 GLenum target; 6841 GLuint index; 6842 GLuint id; 6843}; 6844uint32_t 6845_mesa_unmarshal_BeginQueryIndexed(struct gl_context *ctx, const struct marshal_cmd_BeginQueryIndexed *cmd, const uint64_t *last) 6846{ 6847 GLenum target = cmd->target; 6848 GLuint index = cmd->index; 6849 GLuint id = cmd->id; 6850 CALL_BeginQueryIndexed(ctx->CurrentServerDispatch, (target, index, id)); 6851 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BeginQueryIndexed), 8) / 8); 6852 assert (cmd_size == cmd->cmd_base.cmd_size); 6853 return cmd_size; 6854} 6855void GLAPIENTRY 6856_mesa_marshal_BeginQueryIndexed(GLenum target, GLuint index, GLuint id) 6857{ 6858 GET_CURRENT_CONTEXT(ctx); 6859 int cmd_size = sizeof(struct marshal_cmd_BeginQueryIndexed); 6860 struct marshal_cmd_BeginQueryIndexed *cmd; 6861 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BeginQueryIndexed, cmd_size); 6862 cmd->target = target; 6863 cmd->index = index; 6864 cmd->id = id; 6865} 6866 6867 6868/* EndQueryIndexed: marshalled asynchronously */ 6869struct marshal_cmd_EndQueryIndexed 6870{ 6871 struct marshal_cmd_base cmd_base; 6872 GLenum target; 6873 GLuint index; 6874}; 6875uint32_t 6876_mesa_unmarshal_EndQueryIndexed(struct gl_context *ctx, const struct marshal_cmd_EndQueryIndexed *cmd, const uint64_t *last) 6877{ 6878 GLenum target = cmd->target; 6879 GLuint index = cmd->index; 6880 CALL_EndQueryIndexed(ctx->CurrentServerDispatch, (target, index)); 6881 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_EndQueryIndexed), 8) / 8); 6882 assert (cmd_size == cmd->cmd_base.cmd_size); 6883 return cmd_size; 6884} 6885void GLAPIENTRY 6886_mesa_marshal_EndQueryIndexed(GLenum target, GLuint index) 6887{ 6888 GET_CURRENT_CONTEXT(ctx); 6889 int cmd_size = sizeof(struct marshal_cmd_EndQueryIndexed); 6890 struct marshal_cmd_EndQueryIndexed *cmd; 6891 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EndQueryIndexed, cmd_size); 6892 cmd->target = target; 6893 cmd->index = index; 6894} 6895 6896 6897/* GetQueryIndexediv: marshalled synchronously */ 6898void GLAPIENTRY 6899_mesa_marshal_GetQueryIndexediv(GLenum target, GLuint index, GLenum pname, GLint * params) 6900{ 6901 GET_CURRENT_CONTEXT(ctx); 6902 _mesa_glthread_finish_before(ctx, "GetQueryIndexediv"); 6903 CALL_GetQueryIndexediv(ctx->CurrentServerDispatch, (target, index, pname, params)); 6904} 6905 6906 6907/* UseProgramStages: marshalled asynchronously */ 6908struct marshal_cmd_UseProgramStages 6909{ 6910 struct marshal_cmd_base cmd_base; 6911 GLuint pipeline; 6912 GLbitfield stages; 6913 GLuint program; 6914}; 6915uint32_t 6916_mesa_unmarshal_UseProgramStages(struct gl_context *ctx, const struct marshal_cmd_UseProgramStages *cmd, const uint64_t *last) 6917{ 6918 GLuint pipeline = cmd->pipeline; 6919 GLbitfield stages = cmd->stages; 6920 GLuint program = cmd->program; 6921 CALL_UseProgramStages(ctx->CurrentServerDispatch, (pipeline, stages, program)); 6922 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_UseProgramStages), 8) / 8); 6923 assert (cmd_size == cmd->cmd_base.cmd_size); 6924 return cmd_size; 6925} 6926void GLAPIENTRY 6927_mesa_marshal_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program) 6928{ 6929 GET_CURRENT_CONTEXT(ctx); 6930 int cmd_size = sizeof(struct marshal_cmd_UseProgramStages); 6931 struct marshal_cmd_UseProgramStages *cmd; 6932 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_UseProgramStages, cmd_size); 6933 cmd->pipeline = pipeline; 6934 cmd->stages = stages; 6935 cmd->program = program; 6936} 6937 6938 6939/* ActiveShaderProgram: marshalled asynchronously */ 6940struct marshal_cmd_ActiveShaderProgram 6941{ 6942 struct marshal_cmd_base cmd_base; 6943 GLuint pipeline; 6944 GLuint program; 6945}; 6946uint32_t 6947_mesa_unmarshal_ActiveShaderProgram(struct gl_context *ctx, const struct marshal_cmd_ActiveShaderProgram *cmd, const uint64_t *last) 6948{ 6949 GLuint pipeline = cmd->pipeline; 6950 GLuint program = cmd->program; 6951 CALL_ActiveShaderProgram(ctx->CurrentServerDispatch, (pipeline, program)); 6952 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ActiveShaderProgram), 8) / 8); 6953 assert (cmd_size == cmd->cmd_base.cmd_size); 6954 return cmd_size; 6955} 6956void GLAPIENTRY 6957_mesa_marshal_ActiveShaderProgram(GLuint pipeline, GLuint program) 6958{ 6959 GET_CURRENT_CONTEXT(ctx); 6960 int cmd_size = sizeof(struct marshal_cmd_ActiveShaderProgram); 6961 struct marshal_cmd_ActiveShaderProgram *cmd; 6962 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ActiveShaderProgram, cmd_size); 6963 cmd->pipeline = pipeline; 6964 cmd->program = program; 6965} 6966 6967 6968/* CreateShaderProgramv: marshalled synchronously */ 6969GLuint GLAPIENTRY 6970_mesa_marshal_CreateShaderProgramv(GLenum type, GLsizei count, const GLchar * const * strings) 6971{ 6972 GET_CURRENT_CONTEXT(ctx); 6973 _mesa_glthread_finish_before(ctx, "CreateShaderProgramv"); 6974 return CALL_CreateShaderProgramv(ctx->CurrentServerDispatch, (type, count, strings)); 6975} 6976 6977 6978/* BindProgramPipeline: marshalled asynchronously */ 6979struct marshal_cmd_BindProgramPipeline 6980{ 6981 struct marshal_cmd_base cmd_base; 6982 GLuint pipeline; 6983}; 6984uint32_t 6985_mesa_unmarshal_BindProgramPipeline(struct gl_context *ctx, const struct marshal_cmd_BindProgramPipeline *cmd, const uint64_t *last) 6986{ 6987 GLuint pipeline = cmd->pipeline; 6988 CALL_BindProgramPipeline(ctx->CurrentServerDispatch, (pipeline)); 6989 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindProgramPipeline), 8) / 8); 6990 assert (cmd_size == cmd->cmd_base.cmd_size); 6991 return cmd_size; 6992} 6993void GLAPIENTRY 6994_mesa_marshal_BindProgramPipeline(GLuint pipeline) 6995{ 6996 GET_CURRENT_CONTEXT(ctx); 6997 int cmd_size = sizeof(struct marshal_cmd_BindProgramPipeline); 6998 struct marshal_cmd_BindProgramPipeline *cmd; 6999 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindProgramPipeline, cmd_size); 7000 cmd->pipeline = pipeline; 7001} 7002 7003 7004/* DeleteProgramPipelines: marshalled asynchronously */ 7005struct marshal_cmd_DeleteProgramPipelines 7006{ 7007 struct marshal_cmd_base cmd_base; 7008 GLsizei n; 7009 /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint pipelines[n] */ 7010}; 7011uint32_t 7012_mesa_unmarshal_DeleteProgramPipelines(struct gl_context *ctx, const struct marshal_cmd_DeleteProgramPipelines *cmd, const uint64_t *last) 7013{ 7014 GLsizei n = cmd->n; 7015 GLuint * pipelines; 7016 const char *variable_data = (const char *) (cmd + 1); 7017 pipelines = (GLuint *) variable_data; 7018 CALL_DeleteProgramPipelines(ctx->CurrentServerDispatch, (n, pipelines)); 7019 return cmd->cmd_base.cmd_size; 7020} 7021void GLAPIENTRY 7022_mesa_marshal_DeleteProgramPipelines(GLsizei n, const GLuint * pipelines) 7023{ 7024 GET_CURRENT_CONTEXT(ctx); 7025 int pipelines_size = safe_mul(n, 1 * sizeof(GLuint)); 7026 int cmd_size = sizeof(struct marshal_cmd_DeleteProgramPipelines) + pipelines_size; 7027 struct marshal_cmd_DeleteProgramPipelines *cmd; 7028 if (unlikely(pipelines_size < 0 || (pipelines_size > 0 && !pipelines) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 7029 _mesa_glthread_finish_before(ctx, "DeleteProgramPipelines"); 7030 CALL_DeleteProgramPipelines(ctx->CurrentServerDispatch, (n, pipelines)); 7031 return; 7032 } 7033 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteProgramPipelines, cmd_size); 7034 cmd->n = n; 7035 char *variable_data = (char *) (cmd + 1); 7036 memcpy(variable_data, pipelines, pipelines_size); 7037} 7038 7039 7040/* GenProgramPipelines: marshalled synchronously */ 7041void GLAPIENTRY 7042_mesa_marshal_GenProgramPipelines(GLsizei n, GLuint * pipelines) 7043{ 7044 GET_CURRENT_CONTEXT(ctx); 7045 _mesa_glthread_finish_before(ctx, "GenProgramPipelines"); 7046 CALL_GenProgramPipelines(ctx->CurrentServerDispatch, (n, pipelines)); 7047} 7048 7049 7050/* IsProgramPipeline: marshalled synchronously */ 7051GLboolean GLAPIENTRY 7052_mesa_marshal_IsProgramPipeline(GLuint pipeline) 7053{ 7054 GET_CURRENT_CONTEXT(ctx); 7055 _mesa_glthread_finish_before(ctx, "IsProgramPipeline"); 7056 return CALL_IsProgramPipeline(ctx->CurrentServerDispatch, (pipeline)); 7057} 7058 7059 7060/* GetProgramPipelineiv: marshalled synchronously */ 7061void GLAPIENTRY 7062_mesa_marshal_GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint * params) 7063{ 7064 GET_CURRENT_CONTEXT(ctx); 7065 _mesa_glthread_finish_before(ctx, "GetProgramPipelineiv"); 7066 CALL_GetProgramPipelineiv(ctx->CurrentServerDispatch, (pipeline, pname, params)); 7067} 7068 7069 7070/* ProgramUniform1i: marshalled asynchronously */ 7071struct marshal_cmd_ProgramUniform1i 7072{ 7073 struct marshal_cmd_base cmd_base; 7074 GLuint program; 7075 GLint location; 7076 GLint x; 7077}; 7078uint32_t 7079_mesa_unmarshal_ProgramUniform1i(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform1i *cmd, const uint64_t *last) 7080{ 7081 GLuint program = cmd->program; 7082 GLint location = cmd->location; 7083 GLint x = cmd->x; 7084 CALL_ProgramUniform1i(ctx->CurrentServerDispatch, (program, location, x)); 7085 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform1i), 8) / 8); 7086 assert (cmd_size == cmd->cmd_base.cmd_size); 7087 return cmd_size; 7088} 7089void GLAPIENTRY 7090_mesa_marshal_ProgramUniform1i(GLuint program, GLint location, GLint x) 7091{ 7092 GET_CURRENT_CONTEXT(ctx); 7093 int cmd_size = sizeof(struct marshal_cmd_ProgramUniform1i); 7094 struct marshal_cmd_ProgramUniform1i *cmd; 7095 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform1i, cmd_size); 7096 cmd->program = program; 7097 cmd->location = location; 7098 cmd->x = x; 7099} 7100 7101 7102/* ProgramUniform2i: marshalled asynchronously */ 7103struct marshal_cmd_ProgramUniform2i 7104{ 7105 struct marshal_cmd_base cmd_base; 7106 GLuint program; 7107 GLint location; 7108 GLint x; 7109 GLint y; 7110}; 7111uint32_t 7112_mesa_unmarshal_ProgramUniform2i(struct gl_context *ctx, const struct marshal_cmd_ProgramUniform2i *cmd, const uint64_t *last) 7113{ 7114 GLuint program = cmd->program; 7115 GLint location = cmd->location; 7116 GLint x = cmd->x; 7117 GLint y = cmd->y; 7118 CALL_ProgramUniform2i(ctx->CurrentServerDispatch, (program, location, x, y)); 7119 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramUniform2i), 8) / 8); 7120 assert (cmd_size == cmd->cmd_base.cmd_size); 7121 return cmd_size; 7122} 7123void GLAPIENTRY 7124_mesa_marshal_ProgramUniform2i(GLuint program, GLint location, GLint x, GLint y) 7125{ 7126 GET_CURRENT_CONTEXT(ctx); 7127 int cmd_size = sizeof(struct marshal_cmd_ProgramUniform2i); 7128 struct marshal_cmd_ProgramUniform2i *cmd; 7129 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramUniform2i, cmd_size); 7130 cmd->program = program; 7131 cmd->location = location; 7132 cmd->x = x; 7133 cmd->y = y; 7134} 7135 7136 7137