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/* GetNamedProgramStringEXT: marshalled synchronously */ 45void GLAPIENTRY 46_mesa_marshal_GetNamedProgramStringEXT(GLuint program, GLenum target, GLenum pname, GLvoid* string) 47{ 48 GET_CURRENT_CONTEXT(ctx); 49 _mesa_glthread_finish_before(ctx, "GetNamedProgramStringEXT"); 50 CALL_GetNamedProgramStringEXT(ctx->CurrentServerDispatch, (program, target, pname, string)); 51} 52 53 54/* NamedProgramLocalParameter4fEXT: marshalled asynchronously */ 55struct marshal_cmd_NamedProgramLocalParameter4fEXT 56{ 57 struct marshal_cmd_base cmd_base; 58 GLuint program; 59 GLenum target; 60 GLuint index; 61 GLfloat x; 62 GLfloat y; 63 GLfloat z; 64 GLfloat w; 65}; 66uint32_t 67_mesa_unmarshal_NamedProgramLocalParameter4fEXT(struct gl_context *ctx, const struct marshal_cmd_NamedProgramLocalParameter4fEXT *cmd, const uint64_t *last) 68{ 69 GLuint program = cmd->program; 70 GLenum target = cmd->target; 71 GLuint index = cmd->index; 72 GLfloat x = cmd->x; 73 GLfloat y = cmd->y; 74 GLfloat z = cmd->z; 75 GLfloat w = cmd->w; 76 CALL_NamedProgramLocalParameter4fEXT(ctx->CurrentServerDispatch, (program, target, index, x, y, z, w)); 77 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedProgramLocalParameter4fEXT), 8) / 8); 78 assert (cmd_size == cmd->cmd_base.cmd_size); 79 return cmd_size; 80} 81void GLAPIENTRY 82_mesa_marshal_NamedProgramLocalParameter4fEXT(GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w) 83{ 84 GET_CURRENT_CONTEXT(ctx); 85 int cmd_size = sizeof(struct marshal_cmd_NamedProgramLocalParameter4fEXT); 86 struct marshal_cmd_NamedProgramLocalParameter4fEXT *cmd; 87 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedProgramLocalParameter4fEXT, cmd_size); 88 cmd->program = program; 89 cmd->target = target; 90 cmd->index = index; 91 cmd->x = x; 92 cmd->y = y; 93 cmd->z = z; 94 cmd->w = w; 95} 96 97 98/* NamedProgramLocalParameter4fvEXT: marshalled asynchronously */ 99struct marshal_cmd_NamedProgramLocalParameter4fvEXT 100{ 101 struct marshal_cmd_base cmd_base; 102 GLuint program; 103 GLenum target; 104 GLuint index; 105 GLfloat params[4]; 106}; 107uint32_t 108_mesa_unmarshal_NamedProgramLocalParameter4fvEXT(struct gl_context *ctx, const struct marshal_cmd_NamedProgramLocalParameter4fvEXT *cmd, const uint64_t *last) 109{ 110 GLuint program = cmd->program; 111 GLenum target = cmd->target; 112 GLuint index = cmd->index; 113 const GLfloat * params = cmd->params; 114 CALL_NamedProgramLocalParameter4fvEXT(ctx->CurrentServerDispatch, (program, target, index, params)); 115 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedProgramLocalParameter4fvEXT), 8) / 8); 116 assert (cmd_size == cmd->cmd_base.cmd_size); 117 return cmd_size; 118} 119void GLAPIENTRY 120_mesa_marshal_NamedProgramLocalParameter4fvEXT(GLuint program, GLenum target, GLuint index, const GLfloat* params) 121{ 122 GET_CURRENT_CONTEXT(ctx); 123 int cmd_size = sizeof(struct marshal_cmd_NamedProgramLocalParameter4fvEXT); 124 struct marshal_cmd_NamedProgramLocalParameter4fvEXT *cmd; 125 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedProgramLocalParameter4fvEXT, cmd_size); 126 cmd->program = program; 127 cmd->target = target; 128 cmd->index = index; 129 memcpy(cmd->params, params, 4 * sizeof(GLfloat)); 130} 131 132 133/* GetNamedProgramLocalParameterfvEXT: marshalled synchronously */ 134void GLAPIENTRY 135_mesa_marshal_GetNamedProgramLocalParameterfvEXT(GLuint program, GLenum target, GLuint index, GLfloat* params) 136{ 137 GET_CURRENT_CONTEXT(ctx); 138 _mesa_glthread_finish_before(ctx, "GetNamedProgramLocalParameterfvEXT"); 139 CALL_GetNamedProgramLocalParameterfvEXT(ctx->CurrentServerDispatch, (program, target, index, params)); 140} 141 142 143/* NamedProgramLocalParameter4dEXT: marshalled asynchronously */ 144struct marshal_cmd_NamedProgramLocalParameter4dEXT 145{ 146 struct marshal_cmd_base cmd_base; 147 GLuint program; 148 GLenum target; 149 GLuint index; 150 GLdouble x; 151 GLdouble y; 152 GLdouble z; 153 GLdouble w; 154}; 155uint32_t 156_mesa_unmarshal_NamedProgramLocalParameter4dEXT(struct gl_context *ctx, const struct marshal_cmd_NamedProgramLocalParameter4dEXT *cmd, const uint64_t *last) 157{ 158 GLuint program = cmd->program; 159 GLenum target = cmd->target; 160 GLuint index = cmd->index; 161 GLdouble x = cmd->x; 162 GLdouble y = cmd->y; 163 GLdouble z = cmd->z; 164 GLdouble w = cmd->w; 165 CALL_NamedProgramLocalParameter4dEXT(ctx->CurrentServerDispatch, (program, target, index, x, y, z, w)); 166 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedProgramLocalParameter4dEXT), 8) / 8); 167 assert (cmd_size == cmd->cmd_base.cmd_size); 168 return cmd_size; 169} 170void GLAPIENTRY 171_mesa_marshal_NamedProgramLocalParameter4dEXT(GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w) 172{ 173 GET_CURRENT_CONTEXT(ctx); 174 int cmd_size = sizeof(struct marshal_cmd_NamedProgramLocalParameter4dEXT); 175 struct marshal_cmd_NamedProgramLocalParameter4dEXT *cmd; 176 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedProgramLocalParameter4dEXT, cmd_size); 177 cmd->program = program; 178 cmd->target = target; 179 cmd->index = index; 180 cmd->x = x; 181 cmd->y = y; 182 cmd->z = z; 183 cmd->w = w; 184} 185 186 187/* NamedProgramLocalParameter4dvEXT: marshalled asynchronously */ 188struct marshal_cmd_NamedProgramLocalParameter4dvEXT 189{ 190 struct marshal_cmd_base cmd_base; 191 GLuint program; 192 GLenum target; 193 GLuint index; 194 GLdouble params[4]; 195}; 196uint32_t 197_mesa_unmarshal_NamedProgramLocalParameter4dvEXT(struct gl_context *ctx, const struct marshal_cmd_NamedProgramLocalParameter4dvEXT *cmd, const uint64_t *last) 198{ 199 GLuint program = cmd->program; 200 GLenum target = cmd->target; 201 GLuint index = cmd->index; 202 const GLdouble * params = cmd->params; 203 CALL_NamedProgramLocalParameter4dvEXT(ctx->CurrentServerDispatch, (program, target, index, params)); 204 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedProgramLocalParameter4dvEXT), 8) / 8); 205 assert (cmd_size == cmd->cmd_base.cmd_size); 206 return cmd_size; 207} 208void GLAPIENTRY 209_mesa_marshal_NamedProgramLocalParameter4dvEXT(GLuint program, GLenum target, GLuint index, const GLdouble* params) 210{ 211 GET_CURRENT_CONTEXT(ctx); 212 int cmd_size = sizeof(struct marshal_cmd_NamedProgramLocalParameter4dvEXT); 213 struct marshal_cmd_NamedProgramLocalParameter4dvEXT *cmd; 214 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedProgramLocalParameter4dvEXT, cmd_size); 215 cmd->program = program; 216 cmd->target = target; 217 cmd->index = index; 218 memcpy(cmd->params, params, 4 * sizeof(GLdouble)); 219} 220 221 222/* GetNamedProgramLocalParameterdvEXT: marshalled synchronously */ 223void GLAPIENTRY 224_mesa_marshal_GetNamedProgramLocalParameterdvEXT(GLuint program, GLenum target, GLuint index, GLdouble* params) 225{ 226 GET_CURRENT_CONTEXT(ctx); 227 _mesa_glthread_finish_before(ctx, "GetNamedProgramLocalParameterdvEXT"); 228 CALL_GetNamedProgramLocalParameterdvEXT(ctx->CurrentServerDispatch, (program, target, index, params)); 229} 230 231 232/* GetNamedProgramivEXT: marshalled synchronously */ 233void GLAPIENTRY 234_mesa_marshal_GetNamedProgramivEXT(GLuint program, GLenum target, GLenum pname, GLint* params) 235{ 236 GET_CURRENT_CONTEXT(ctx); 237 _mesa_glthread_finish_before(ctx, "GetNamedProgramivEXT"); 238 CALL_GetNamedProgramivEXT(ctx->CurrentServerDispatch, (program, target, pname, params)); 239} 240 241 242/* TextureBufferEXT: marshalled asynchronously */ 243struct marshal_cmd_TextureBufferEXT 244{ 245 struct marshal_cmd_base cmd_base; 246 GLuint texture; 247 GLenum target; 248 GLenum internalformat; 249 GLuint buffer; 250}; 251uint32_t 252_mesa_unmarshal_TextureBufferEXT(struct gl_context *ctx, const struct marshal_cmd_TextureBufferEXT *cmd, const uint64_t *last) 253{ 254 GLuint texture = cmd->texture; 255 GLenum target = cmd->target; 256 GLenum internalformat = cmd->internalformat; 257 GLuint buffer = cmd->buffer; 258 CALL_TextureBufferEXT(ctx->CurrentServerDispatch, (texture, target, internalformat, buffer)); 259 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureBufferEXT), 8) / 8); 260 assert (cmd_size == cmd->cmd_base.cmd_size); 261 return cmd_size; 262} 263void GLAPIENTRY 264_mesa_marshal_TextureBufferEXT(GLuint texture, GLenum target, GLenum internalformat, GLuint buffer) 265{ 266 GET_CURRENT_CONTEXT(ctx); 267 int cmd_size = sizeof(struct marshal_cmd_TextureBufferEXT); 268 struct marshal_cmd_TextureBufferEXT *cmd; 269 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureBufferEXT, cmd_size); 270 cmd->texture = texture; 271 cmd->target = target; 272 cmd->internalformat = internalformat; 273 cmd->buffer = buffer; 274} 275 276 277/* MultiTexBufferEXT: marshalled asynchronously */ 278struct marshal_cmd_MultiTexBufferEXT 279{ 280 struct marshal_cmd_base cmd_base; 281 GLenum texunit; 282 GLenum target; 283 GLenum internalformat; 284 GLuint buffer; 285}; 286uint32_t 287_mesa_unmarshal_MultiTexBufferEXT(struct gl_context *ctx, const struct marshal_cmd_MultiTexBufferEXT *cmd, const uint64_t *last) 288{ 289 GLenum texunit = cmd->texunit; 290 GLenum target = cmd->target; 291 GLenum internalformat = cmd->internalformat; 292 GLuint buffer = cmd->buffer; 293 CALL_MultiTexBufferEXT(ctx->CurrentServerDispatch, (texunit, target, internalformat, buffer)); 294 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexBufferEXT), 8) / 8); 295 assert (cmd_size == cmd->cmd_base.cmd_size); 296 return cmd_size; 297} 298void GLAPIENTRY 299_mesa_marshal_MultiTexBufferEXT(GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer) 300{ 301 GET_CURRENT_CONTEXT(ctx); 302 int cmd_size = sizeof(struct marshal_cmd_MultiTexBufferEXT); 303 struct marshal_cmd_MultiTexBufferEXT *cmd; 304 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexBufferEXT, cmd_size); 305 cmd->texunit = texunit; 306 cmd->target = target; 307 cmd->internalformat = internalformat; 308 cmd->buffer = buffer; 309} 310 311 312/* TextureParameterIivEXT: marshalled asynchronously */ 313struct marshal_cmd_TextureParameterIivEXT 314{ 315 struct marshal_cmd_base cmd_base; 316 GLuint texture; 317 GLenum target; 318 GLenum pname; 319 /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint)) bytes are GLint params[_mesa_tex_param_enum_to_count(pname)] */ 320}; 321uint32_t 322_mesa_unmarshal_TextureParameterIivEXT(struct gl_context *ctx, const struct marshal_cmd_TextureParameterIivEXT *cmd, const uint64_t *last) 323{ 324 GLuint texture = cmd->texture; 325 GLenum target = cmd->target; 326 GLenum pname = cmd->pname; 327 GLint * params; 328 const char *variable_data = (const char *) (cmd + 1); 329 params = (GLint *) variable_data; 330 CALL_TextureParameterIivEXT(ctx->CurrentServerDispatch, (texture, target, pname, params)); 331 return cmd->cmd_base.cmd_size; 332} 333void GLAPIENTRY 334_mesa_marshal_TextureParameterIivEXT(GLuint texture, GLenum target, GLenum pname, const GLint* params) 335{ 336 GET_CURRENT_CONTEXT(ctx); 337 int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint)); 338 int cmd_size = sizeof(struct marshal_cmd_TextureParameterIivEXT) + params_size; 339 struct marshal_cmd_TextureParameterIivEXT *cmd; 340 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 341 _mesa_glthread_finish_before(ctx, "TextureParameterIivEXT"); 342 CALL_TextureParameterIivEXT(ctx->CurrentServerDispatch, (texture, target, pname, params)); 343 return; 344 } 345 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureParameterIivEXT, cmd_size); 346 cmd->texture = texture; 347 cmd->target = target; 348 cmd->pname = pname; 349 char *variable_data = (char *) (cmd + 1); 350 memcpy(variable_data, params, params_size); 351} 352 353 354/* TextureParameterIuivEXT: marshalled asynchronously */ 355struct marshal_cmd_TextureParameterIuivEXT 356{ 357 struct marshal_cmd_base cmd_base; 358 GLuint texture; 359 GLenum target; 360 GLenum pname; 361 /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLuint)) bytes are GLuint params[_mesa_tex_param_enum_to_count(pname)] */ 362}; 363uint32_t 364_mesa_unmarshal_TextureParameterIuivEXT(struct gl_context *ctx, const struct marshal_cmd_TextureParameterIuivEXT *cmd, const uint64_t *last) 365{ 366 GLuint texture = cmd->texture; 367 GLenum target = cmd->target; 368 GLenum pname = cmd->pname; 369 GLuint * params; 370 const char *variable_data = (const char *) (cmd + 1); 371 params = (GLuint *) variable_data; 372 CALL_TextureParameterIuivEXT(ctx->CurrentServerDispatch, (texture, target, pname, params)); 373 return cmd->cmd_base.cmd_size; 374} 375void GLAPIENTRY 376_mesa_marshal_TextureParameterIuivEXT(GLuint texture, GLenum target, GLenum pname, const GLuint* params) 377{ 378 GET_CURRENT_CONTEXT(ctx); 379 int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLuint)); 380 int cmd_size = sizeof(struct marshal_cmd_TextureParameterIuivEXT) + params_size; 381 struct marshal_cmd_TextureParameterIuivEXT *cmd; 382 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 383 _mesa_glthread_finish_before(ctx, "TextureParameterIuivEXT"); 384 CALL_TextureParameterIuivEXT(ctx->CurrentServerDispatch, (texture, target, pname, params)); 385 return; 386 } 387 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureParameterIuivEXT, cmd_size); 388 cmd->texture = texture; 389 cmd->target = target; 390 cmd->pname = pname; 391 char *variable_data = (char *) (cmd + 1); 392 memcpy(variable_data, params, params_size); 393} 394 395 396/* GetTextureParameterIivEXT: marshalled synchronously */ 397void GLAPIENTRY 398_mesa_marshal_GetTextureParameterIivEXT(GLuint texture, GLenum target, GLenum pname, GLint* params) 399{ 400 GET_CURRENT_CONTEXT(ctx); 401 _mesa_glthread_finish_before(ctx, "GetTextureParameterIivEXT"); 402 CALL_GetTextureParameterIivEXT(ctx->CurrentServerDispatch, (texture, target, pname, params)); 403} 404 405 406/* GetTextureParameterIuivEXT: marshalled synchronously */ 407void GLAPIENTRY 408_mesa_marshal_GetTextureParameterIuivEXT(GLuint texture, GLenum target, GLenum pname, GLuint* params) 409{ 410 GET_CURRENT_CONTEXT(ctx); 411 _mesa_glthread_finish_before(ctx, "GetTextureParameterIuivEXT"); 412 CALL_GetTextureParameterIuivEXT(ctx->CurrentServerDispatch, (texture, target, pname, params)); 413} 414 415 416/* MultiTexParameterIivEXT: marshalled asynchronously */ 417struct marshal_cmd_MultiTexParameterIivEXT 418{ 419 struct marshal_cmd_base cmd_base; 420 GLenum texunit; 421 GLenum target; 422 GLenum pname; 423 /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint)) bytes are GLint params[_mesa_tex_param_enum_to_count(pname)] */ 424}; 425uint32_t 426_mesa_unmarshal_MultiTexParameterIivEXT(struct gl_context *ctx, const struct marshal_cmd_MultiTexParameterIivEXT *cmd, const uint64_t *last) 427{ 428 GLenum texunit = cmd->texunit; 429 GLenum target = cmd->target; 430 GLenum pname = cmd->pname; 431 GLint * params; 432 const char *variable_data = (const char *) (cmd + 1); 433 params = (GLint *) variable_data; 434 CALL_MultiTexParameterIivEXT(ctx->CurrentServerDispatch, (texunit, target, pname, params)); 435 return cmd->cmd_base.cmd_size; 436} 437void GLAPIENTRY 438_mesa_marshal_MultiTexParameterIivEXT(GLenum texunit, GLenum target, GLenum pname, const GLint* params) 439{ 440 GET_CURRENT_CONTEXT(ctx); 441 int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint)); 442 int cmd_size = sizeof(struct marshal_cmd_MultiTexParameterIivEXT) + params_size; 443 struct marshal_cmd_MultiTexParameterIivEXT *cmd; 444 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 445 _mesa_glthread_finish_before(ctx, "MultiTexParameterIivEXT"); 446 CALL_MultiTexParameterIivEXT(ctx->CurrentServerDispatch, (texunit, target, pname, params)); 447 return; 448 } 449 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexParameterIivEXT, cmd_size); 450 cmd->texunit = texunit; 451 cmd->target = target; 452 cmd->pname = pname; 453 char *variable_data = (char *) (cmd + 1); 454 memcpy(variable_data, params, params_size); 455} 456 457 458/* MultiTexParameterIuivEXT: marshalled asynchronously */ 459struct marshal_cmd_MultiTexParameterIuivEXT 460{ 461 struct marshal_cmd_base cmd_base; 462 GLenum texunit; 463 GLenum target; 464 GLenum pname; 465 /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLuint)) bytes are GLuint params[_mesa_tex_param_enum_to_count(pname)] */ 466}; 467uint32_t 468_mesa_unmarshal_MultiTexParameterIuivEXT(struct gl_context *ctx, const struct marshal_cmd_MultiTexParameterIuivEXT *cmd, const uint64_t *last) 469{ 470 GLenum texunit = cmd->texunit; 471 GLenum target = cmd->target; 472 GLenum pname = cmd->pname; 473 GLuint * params; 474 const char *variable_data = (const char *) (cmd + 1); 475 params = (GLuint *) variable_data; 476 CALL_MultiTexParameterIuivEXT(ctx->CurrentServerDispatch, (texunit, target, pname, params)); 477 return cmd->cmd_base.cmd_size; 478} 479void GLAPIENTRY 480_mesa_marshal_MultiTexParameterIuivEXT(GLenum texunit, GLenum target, GLenum pname, const GLuint* params) 481{ 482 GET_CURRENT_CONTEXT(ctx); 483 int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLuint)); 484 int cmd_size = sizeof(struct marshal_cmd_MultiTexParameterIuivEXT) + params_size; 485 struct marshal_cmd_MultiTexParameterIuivEXT *cmd; 486 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 487 _mesa_glthread_finish_before(ctx, "MultiTexParameterIuivEXT"); 488 CALL_MultiTexParameterIuivEXT(ctx->CurrentServerDispatch, (texunit, target, pname, params)); 489 return; 490 } 491 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexParameterIuivEXT, cmd_size); 492 cmd->texunit = texunit; 493 cmd->target = target; 494 cmd->pname = pname; 495 char *variable_data = (char *) (cmd + 1); 496 memcpy(variable_data, params, params_size); 497} 498 499 500/* GetMultiTexParameterIivEXT: marshalled synchronously */ 501void GLAPIENTRY 502_mesa_marshal_GetMultiTexParameterIivEXT(GLenum texunit, GLenum target, GLenum pname, GLint* params) 503{ 504 GET_CURRENT_CONTEXT(ctx); 505 _mesa_glthread_finish_before(ctx, "GetMultiTexParameterIivEXT"); 506 CALL_GetMultiTexParameterIivEXT(ctx->CurrentServerDispatch, (texunit, target, pname, params)); 507} 508 509 510/* GetMultiTexParameterIuivEXT: marshalled synchronously */ 511void GLAPIENTRY 512_mesa_marshal_GetMultiTexParameterIuivEXT(GLenum texunit, GLenum target, GLenum pname, GLuint* params) 513{ 514 GET_CURRENT_CONTEXT(ctx); 515 _mesa_glthread_finish_before(ctx, "GetMultiTexParameterIuivEXT"); 516 CALL_GetMultiTexParameterIuivEXT(ctx->CurrentServerDispatch, (texunit, target, pname, params)); 517} 518 519 520/* NamedProgramLocalParameters4fvEXT: marshalled asynchronously */ 521struct marshal_cmd_NamedProgramLocalParameters4fvEXT 522{ 523 struct marshal_cmd_base cmd_base; 524 GLuint program; 525 GLenum target; 526 GLuint index; 527 GLsizei count; 528 GLfloat params[4]; 529}; 530uint32_t 531_mesa_unmarshal_NamedProgramLocalParameters4fvEXT(struct gl_context *ctx, const struct marshal_cmd_NamedProgramLocalParameters4fvEXT *cmd, const uint64_t *last) 532{ 533 GLuint program = cmd->program; 534 GLenum target = cmd->target; 535 GLuint index = cmd->index; 536 GLsizei count = cmd->count; 537 const GLfloat * params = cmd->params; 538 CALL_NamedProgramLocalParameters4fvEXT(ctx->CurrentServerDispatch, (program, target, index, count, params)); 539 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedProgramLocalParameters4fvEXT), 8) / 8); 540 assert (cmd_size == cmd->cmd_base.cmd_size); 541 return cmd_size; 542} 543void GLAPIENTRY 544_mesa_marshal_NamedProgramLocalParameters4fvEXT(GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params) 545{ 546 GET_CURRENT_CONTEXT(ctx); 547 int cmd_size = sizeof(struct marshal_cmd_NamedProgramLocalParameters4fvEXT); 548 struct marshal_cmd_NamedProgramLocalParameters4fvEXT *cmd; 549 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedProgramLocalParameters4fvEXT, cmd_size); 550 cmd->program = program; 551 cmd->target = target; 552 cmd->index = index; 553 cmd->count = count; 554 memcpy(cmd->params, params, 4 * sizeof(GLfloat)); 555} 556 557 558/* BindImageTextureEXT: marshalled asynchronously */ 559struct marshal_cmd_BindImageTextureEXT 560{ 561 struct marshal_cmd_base cmd_base; 562 GLboolean layered; 563 GLuint index; 564 GLuint texture; 565 GLint level; 566 GLint layer; 567 GLenum access; 568 GLint format; 569}; 570uint32_t 571_mesa_unmarshal_BindImageTextureEXT(struct gl_context *ctx, const struct marshal_cmd_BindImageTextureEXT *cmd, const uint64_t *last) 572{ 573 GLuint index = cmd->index; 574 GLuint texture = cmd->texture; 575 GLint level = cmd->level; 576 GLboolean layered = cmd->layered; 577 GLint layer = cmd->layer; 578 GLenum access = cmd->access; 579 GLint format = cmd->format; 580 CALL_BindImageTextureEXT(ctx->CurrentServerDispatch, (index, texture, level, layered, layer, access, format)); 581 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindImageTextureEXT), 8) / 8); 582 assert (cmd_size == cmd->cmd_base.cmd_size); 583 return cmd_size; 584} 585void GLAPIENTRY 586_mesa_marshal_BindImageTextureEXT(GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format) 587{ 588 GET_CURRENT_CONTEXT(ctx); 589 int cmd_size = sizeof(struct marshal_cmd_BindImageTextureEXT); 590 struct marshal_cmd_BindImageTextureEXT *cmd; 591 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindImageTextureEXT, cmd_size); 592 cmd->index = index; 593 cmd->texture = texture; 594 cmd->level = level; 595 cmd->layered = layered; 596 cmd->layer = layer; 597 cmd->access = access; 598 cmd->format = format; 599} 600 601 602/* SubpixelPrecisionBiasNV: marshalled asynchronously */ 603struct marshal_cmd_SubpixelPrecisionBiasNV 604{ 605 struct marshal_cmd_base cmd_base; 606 GLuint xbits; 607 GLuint ybits; 608}; 609uint32_t 610_mesa_unmarshal_SubpixelPrecisionBiasNV(struct gl_context *ctx, const struct marshal_cmd_SubpixelPrecisionBiasNV *cmd, const uint64_t *last) 611{ 612 GLuint xbits = cmd->xbits; 613 GLuint ybits = cmd->ybits; 614 CALL_SubpixelPrecisionBiasNV(ctx->CurrentServerDispatch, (xbits, ybits)); 615 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SubpixelPrecisionBiasNV), 8) / 8); 616 assert (cmd_size == cmd->cmd_base.cmd_size); 617 return cmd_size; 618} 619void GLAPIENTRY 620_mesa_marshal_SubpixelPrecisionBiasNV(GLuint xbits, GLuint ybits) 621{ 622 GET_CURRENT_CONTEXT(ctx); 623 int cmd_size = sizeof(struct marshal_cmd_SubpixelPrecisionBiasNV); 624 struct marshal_cmd_SubpixelPrecisionBiasNV *cmd; 625 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SubpixelPrecisionBiasNV, cmd_size); 626 cmd->xbits = xbits; 627 cmd->ybits = ybits; 628} 629 630 631/* ConservativeRasterParameterfNV: marshalled asynchronously */ 632struct marshal_cmd_ConservativeRasterParameterfNV 633{ 634 struct marshal_cmd_base cmd_base; 635 GLenum pname; 636 GLfloat param; 637}; 638uint32_t 639_mesa_unmarshal_ConservativeRasterParameterfNV(struct gl_context *ctx, const struct marshal_cmd_ConservativeRasterParameterfNV *cmd, const uint64_t *last) 640{ 641 GLenum pname = cmd->pname; 642 GLfloat param = cmd->param; 643 CALL_ConservativeRasterParameterfNV(ctx->CurrentServerDispatch, (pname, param)); 644 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ConservativeRasterParameterfNV), 8) / 8); 645 assert (cmd_size == cmd->cmd_base.cmd_size); 646 return cmd_size; 647} 648void GLAPIENTRY 649_mesa_marshal_ConservativeRasterParameterfNV(GLenum pname, GLfloat param) 650{ 651 GET_CURRENT_CONTEXT(ctx); 652 int cmd_size = sizeof(struct marshal_cmd_ConservativeRasterParameterfNV); 653 struct marshal_cmd_ConservativeRasterParameterfNV *cmd; 654 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ConservativeRasterParameterfNV, cmd_size); 655 cmd->pname = pname; 656 cmd->param = param; 657} 658 659 660/* ConservativeRasterParameteriNV: marshalled asynchronously */ 661struct marshal_cmd_ConservativeRasterParameteriNV 662{ 663 struct marshal_cmd_base cmd_base; 664 GLenum pname; 665 GLint param; 666}; 667uint32_t 668_mesa_unmarshal_ConservativeRasterParameteriNV(struct gl_context *ctx, const struct marshal_cmd_ConservativeRasterParameteriNV *cmd, const uint64_t *last) 669{ 670 GLenum pname = cmd->pname; 671 GLint param = cmd->param; 672 CALL_ConservativeRasterParameteriNV(ctx->CurrentServerDispatch, (pname, param)); 673 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ConservativeRasterParameteriNV), 8) / 8); 674 assert (cmd_size == cmd->cmd_base.cmd_size); 675 return cmd_size; 676} 677void GLAPIENTRY 678_mesa_marshal_ConservativeRasterParameteriNV(GLenum pname, GLint param) 679{ 680 GET_CURRENT_CONTEXT(ctx); 681 int cmd_size = sizeof(struct marshal_cmd_ConservativeRasterParameteriNV); 682 struct marshal_cmd_ConservativeRasterParameteriNV *cmd; 683 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ConservativeRasterParameteriNV, cmd_size); 684 cmd->pname = pname; 685 cmd->param = param; 686} 687 688 689/* GetFirstPerfQueryIdINTEL: marshalled synchronously */ 690void GLAPIENTRY 691_mesa_marshal_GetFirstPerfQueryIdINTEL(GLuint * queryId) 692{ 693 GET_CURRENT_CONTEXT(ctx); 694 _mesa_glthread_finish_before(ctx, "GetFirstPerfQueryIdINTEL"); 695 CALL_GetFirstPerfQueryIdINTEL(ctx->CurrentServerDispatch, (queryId)); 696} 697 698 699/* GetNextPerfQueryIdINTEL: marshalled synchronously */ 700void GLAPIENTRY 701_mesa_marshal_GetNextPerfQueryIdINTEL(GLuint queryId, GLuint * nextQueryId) 702{ 703 GET_CURRENT_CONTEXT(ctx); 704 _mesa_glthread_finish_before(ctx, "GetNextPerfQueryIdINTEL"); 705 CALL_GetNextPerfQueryIdINTEL(ctx->CurrentServerDispatch, (queryId, nextQueryId)); 706} 707 708 709/* GetPerfQueryIdByNameINTEL: marshalled synchronously */ 710void GLAPIENTRY 711_mesa_marshal_GetPerfQueryIdByNameINTEL(GLchar * queryName, GLuint * queryId) 712{ 713 GET_CURRENT_CONTEXT(ctx); 714 _mesa_glthread_finish_before(ctx, "GetPerfQueryIdByNameINTEL"); 715 CALL_GetPerfQueryIdByNameINTEL(ctx->CurrentServerDispatch, (queryName, queryId)); 716} 717 718 719/* GetPerfQueryInfoINTEL: marshalled synchronously */ 720void GLAPIENTRY 721_mesa_marshal_GetPerfQueryInfoINTEL(GLuint queryId, GLuint queryNameLength, GLchar * queryName, GLuint * dataSize, GLuint * noCounters, GLuint * noInstances, GLuint * capsMask) 722{ 723 GET_CURRENT_CONTEXT(ctx); 724 _mesa_glthread_finish_before(ctx, "GetPerfQueryInfoINTEL"); 725 CALL_GetPerfQueryInfoINTEL(ctx->CurrentServerDispatch, (queryId, queryNameLength, queryName, dataSize, noCounters, noInstances, capsMask)); 726} 727 728 729/* GetPerfCounterInfoINTEL: marshalled synchronously */ 730void GLAPIENTRY 731_mesa_marshal_GetPerfCounterInfoINTEL(GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar * counterName, GLuint counterDescLength, GLchar * counterDesc, GLuint * counterOffset, GLuint * counterDataSize, GLuint * counterTypeEnum, GLuint * counterDataTypeEnum, GLuint64 * rawCounterMaxValue) 732{ 733 GET_CURRENT_CONTEXT(ctx); 734 _mesa_glthread_finish_before(ctx, "GetPerfCounterInfoINTEL"); 735 CALL_GetPerfCounterInfoINTEL(ctx->CurrentServerDispatch, (queryId, counterId, counterNameLength, counterName, counterDescLength, counterDesc, counterOffset, counterDataSize, counterTypeEnum, counterDataTypeEnum, rawCounterMaxValue)); 736} 737 738 739/* CreatePerfQueryINTEL: marshalled synchronously */ 740void GLAPIENTRY 741_mesa_marshal_CreatePerfQueryINTEL(GLuint queryId, GLuint * queryHandle) 742{ 743 GET_CURRENT_CONTEXT(ctx); 744 _mesa_glthread_finish_before(ctx, "CreatePerfQueryINTEL"); 745 CALL_CreatePerfQueryINTEL(ctx->CurrentServerDispatch, (queryId, queryHandle)); 746} 747 748 749/* DeletePerfQueryINTEL: marshalled asynchronously */ 750struct marshal_cmd_DeletePerfQueryINTEL 751{ 752 struct marshal_cmd_base cmd_base; 753 GLuint queryHandle; 754}; 755uint32_t 756_mesa_unmarshal_DeletePerfQueryINTEL(struct gl_context *ctx, const struct marshal_cmd_DeletePerfQueryINTEL *cmd, const uint64_t *last) 757{ 758 GLuint queryHandle = cmd->queryHandle; 759 CALL_DeletePerfQueryINTEL(ctx->CurrentServerDispatch, (queryHandle)); 760 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DeletePerfQueryINTEL), 8) / 8); 761 assert (cmd_size == cmd->cmd_base.cmd_size); 762 return cmd_size; 763} 764void GLAPIENTRY 765_mesa_marshal_DeletePerfQueryINTEL(GLuint queryHandle) 766{ 767 GET_CURRENT_CONTEXT(ctx); 768 int cmd_size = sizeof(struct marshal_cmd_DeletePerfQueryINTEL); 769 struct marshal_cmd_DeletePerfQueryINTEL *cmd; 770 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeletePerfQueryINTEL, cmd_size); 771 cmd->queryHandle = queryHandle; 772} 773 774 775/* BeginPerfQueryINTEL: marshalled asynchronously */ 776struct marshal_cmd_BeginPerfQueryINTEL 777{ 778 struct marshal_cmd_base cmd_base; 779 GLuint queryHandle; 780}; 781uint32_t 782_mesa_unmarshal_BeginPerfQueryINTEL(struct gl_context *ctx, const struct marshal_cmd_BeginPerfQueryINTEL *cmd, const uint64_t *last) 783{ 784 GLuint queryHandle = cmd->queryHandle; 785 CALL_BeginPerfQueryINTEL(ctx->CurrentServerDispatch, (queryHandle)); 786 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BeginPerfQueryINTEL), 8) / 8); 787 assert (cmd_size == cmd->cmd_base.cmd_size); 788 return cmd_size; 789} 790void GLAPIENTRY 791_mesa_marshal_BeginPerfQueryINTEL(GLuint queryHandle) 792{ 793 GET_CURRENT_CONTEXT(ctx); 794 int cmd_size = sizeof(struct marshal_cmd_BeginPerfQueryINTEL); 795 struct marshal_cmd_BeginPerfQueryINTEL *cmd; 796 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BeginPerfQueryINTEL, cmd_size); 797 cmd->queryHandle = queryHandle; 798} 799 800 801/* EndPerfQueryINTEL: marshalled asynchronously */ 802struct marshal_cmd_EndPerfQueryINTEL 803{ 804 struct marshal_cmd_base cmd_base; 805 GLuint queryHandle; 806}; 807uint32_t 808_mesa_unmarshal_EndPerfQueryINTEL(struct gl_context *ctx, const struct marshal_cmd_EndPerfQueryINTEL *cmd, const uint64_t *last) 809{ 810 GLuint queryHandle = cmd->queryHandle; 811 CALL_EndPerfQueryINTEL(ctx->CurrentServerDispatch, (queryHandle)); 812 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_EndPerfQueryINTEL), 8) / 8); 813 assert (cmd_size == cmd->cmd_base.cmd_size); 814 return cmd_size; 815} 816void GLAPIENTRY 817_mesa_marshal_EndPerfQueryINTEL(GLuint queryHandle) 818{ 819 GET_CURRENT_CONTEXT(ctx); 820 int cmd_size = sizeof(struct marshal_cmd_EndPerfQueryINTEL); 821 struct marshal_cmd_EndPerfQueryINTEL *cmd; 822 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EndPerfQueryINTEL, cmd_size); 823 cmd->queryHandle = queryHandle; 824} 825 826 827/* GetPerfQueryDataINTEL: marshalled synchronously */ 828void GLAPIENTRY 829_mesa_marshal_GetPerfQueryDataINTEL(GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid * data, GLuint * bytesWritten) 830{ 831 GET_CURRENT_CONTEXT(ctx); 832 _mesa_glthread_finish_before(ctx, "GetPerfQueryDataINTEL"); 833 CALL_GetPerfQueryDataINTEL(ctx->CurrentServerDispatch, (queryHandle, flags, dataSize, data, bytesWritten)); 834} 835 836 837/* AlphaToCoverageDitherControlNV: marshalled asynchronously */ 838struct marshal_cmd_AlphaToCoverageDitherControlNV 839{ 840 struct marshal_cmd_base cmd_base; 841 GLenum mode; 842}; 843uint32_t 844_mesa_unmarshal_AlphaToCoverageDitherControlNV(struct gl_context *ctx, const struct marshal_cmd_AlphaToCoverageDitherControlNV *cmd, const uint64_t *last) 845{ 846 GLenum mode = cmd->mode; 847 CALL_AlphaToCoverageDitherControlNV(ctx->CurrentServerDispatch, (mode)); 848 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_AlphaToCoverageDitherControlNV), 8) / 8); 849 assert (cmd_size == cmd->cmd_base.cmd_size); 850 return cmd_size; 851} 852void GLAPIENTRY 853_mesa_marshal_AlphaToCoverageDitherControlNV(GLenum mode) 854{ 855 GET_CURRENT_CONTEXT(ctx); 856 int cmd_size = sizeof(struct marshal_cmd_AlphaToCoverageDitherControlNV); 857 struct marshal_cmd_AlphaToCoverageDitherControlNV *cmd; 858 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_AlphaToCoverageDitherControlNV, cmd_size); 859 cmd->mode = mode; 860} 861 862 863/* PolygonOffsetClampEXT: marshalled asynchronously */ 864struct marshal_cmd_PolygonOffsetClampEXT 865{ 866 struct marshal_cmd_base cmd_base; 867 GLfloat factor; 868 GLfloat units; 869 GLfloat clamp; 870}; 871uint32_t 872_mesa_unmarshal_PolygonOffsetClampEXT(struct gl_context *ctx, const struct marshal_cmd_PolygonOffsetClampEXT *cmd, const uint64_t *last) 873{ 874 GLfloat factor = cmd->factor; 875 GLfloat units = cmd->units; 876 GLfloat clamp = cmd->clamp; 877 CALL_PolygonOffsetClampEXT(ctx->CurrentServerDispatch, (factor, units, clamp)); 878 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PolygonOffsetClampEXT), 8) / 8); 879 assert (cmd_size == cmd->cmd_base.cmd_size); 880 return cmd_size; 881} 882void GLAPIENTRY 883_mesa_marshal_PolygonOffsetClampEXT(GLfloat factor, GLfloat units, GLfloat clamp) 884{ 885 GET_CURRENT_CONTEXT(ctx); 886 int cmd_size = sizeof(struct marshal_cmd_PolygonOffsetClampEXT); 887 struct marshal_cmd_PolygonOffsetClampEXT *cmd; 888 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PolygonOffsetClampEXT, cmd_size); 889 cmd->factor = factor; 890 cmd->units = units; 891 cmd->clamp = clamp; 892} 893 894 895/* WindowRectanglesEXT: marshalled asynchronously */ 896struct marshal_cmd_WindowRectanglesEXT 897{ 898 struct marshal_cmd_base cmd_base; 899 GLenum mode; 900 GLsizei count; 901 /* Next safe_mul((4 * count), 1 * sizeof(GLint)) bytes are GLint box[(4 * count)] */ 902}; 903uint32_t 904_mesa_unmarshal_WindowRectanglesEXT(struct gl_context *ctx, const struct marshal_cmd_WindowRectanglesEXT *cmd, const uint64_t *last) 905{ 906 GLenum mode = cmd->mode; 907 GLsizei count = cmd->count; 908 GLint * box; 909 const char *variable_data = (const char *) (cmd + 1); 910 box = (GLint *) variable_data; 911 CALL_WindowRectanglesEXT(ctx->CurrentServerDispatch, (mode, count, box)); 912 return cmd->cmd_base.cmd_size; 913} 914void GLAPIENTRY 915_mesa_marshal_WindowRectanglesEXT(GLenum mode, GLsizei count, const GLint * box) 916{ 917 GET_CURRENT_CONTEXT(ctx); 918 int box_size = safe_mul((4 * count), 1 * sizeof(GLint)); 919 int cmd_size = sizeof(struct marshal_cmd_WindowRectanglesEXT) + box_size; 920 struct marshal_cmd_WindowRectanglesEXT *cmd; 921 if (unlikely(box_size < 0 || (box_size > 0 && !box) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 922 _mesa_glthread_finish_before(ctx, "WindowRectanglesEXT"); 923 CALL_WindowRectanglesEXT(ctx->CurrentServerDispatch, (mode, count, box)); 924 return; 925 } 926 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WindowRectanglesEXT, cmd_size); 927 cmd->mode = mode; 928 cmd->count = count; 929 char *variable_data = (char *) (cmd + 1); 930 memcpy(variable_data, box, box_size); 931} 932 933 934/* FramebufferFetchBarrierEXT: marshalled asynchronously */ 935struct marshal_cmd_FramebufferFetchBarrierEXT 936{ 937 struct marshal_cmd_base cmd_base; 938}; 939uint32_t 940_mesa_unmarshal_FramebufferFetchBarrierEXT(struct gl_context *ctx, const struct marshal_cmd_FramebufferFetchBarrierEXT *cmd, const uint64_t *last) 941{ 942 CALL_FramebufferFetchBarrierEXT(ctx->CurrentServerDispatch, ()); 943 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FramebufferFetchBarrierEXT), 8) / 8); 944 assert (cmd_size == cmd->cmd_base.cmd_size); 945 return cmd_size; 946} 947void GLAPIENTRY 948_mesa_marshal_FramebufferFetchBarrierEXT(void) 949{ 950 GET_CURRENT_CONTEXT(ctx); 951 int cmd_size = sizeof(struct marshal_cmd_FramebufferFetchBarrierEXT); 952 struct marshal_cmd_FramebufferFetchBarrierEXT *cmd; 953 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferFetchBarrierEXT, cmd_size); 954 (void) cmd; 955} 956 957 958/* RenderbufferStorageMultisampleAdvancedAMD: marshalled asynchronously */ 959struct marshal_cmd_RenderbufferStorageMultisampleAdvancedAMD 960{ 961 struct marshal_cmd_base cmd_base; 962 GLenum target; 963 GLsizei samples; 964 GLsizei storageSamples; 965 GLenum internalformat; 966 GLsizei width; 967 GLsizei height; 968}; 969uint32_t 970_mesa_unmarshal_RenderbufferStorageMultisampleAdvancedAMD(struct gl_context *ctx, const struct marshal_cmd_RenderbufferStorageMultisampleAdvancedAMD *cmd, const uint64_t *last) 971{ 972 GLenum target = cmd->target; 973 GLsizei samples = cmd->samples; 974 GLsizei storageSamples = cmd->storageSamples; 975 GLenum internalformat = cmd->internalformat; 976 GLsizei width = cmd->width; 977 GLsizei height = cmd->height; 978 CALL_RenderbufferStorageMultisampleAdvancedAMD(ctx->CurrentServerDispatch, (target, samples, storageSamples, internalformat, width, height)); 979 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_RenderbufferStorageMultisampleAdvancedAMD), 8) / 8); 980 assert (cmd_size == cmd->cmd_base.cmd_size); 981 return cmd_size; 982} 983void GLAPIENTRY 984_mesa_marshal_RenderbufferStorageMultisampleAdvancedAMD(GLenum target, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height) 985{ 986 GET_CURRENT_CONTEXT(ctx); 987 int cmd_size = sizeof(struct marshal_cmd_RenderbufferStorageMultisampleAdvancedAMD); 988 struct marshal_cmd_RenderbufferStorageMultisampleAdvancedAMD *cmd; 989 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_RenderbufferStorageMultisampleAdvancedAMD, cmd_size); 990 cmd->target = target; 991 cmd->samples = samples; 992 cmd->storageSamples = storageSamples; 993 cmd->internalformat = internalformat; 994 cmd->width = width; 995 cmd->height = height; 996} 997 998 999/* NamedRenderbufferStorageMultisampleAdvancedAMD: marshalled asynchronously */ 1000struct marshal_cmd_NamedRenderbufferStorageMultisampleAdvancedAMD 1001{ 1002 struct marshal_cmd_base cmd_base; 1003 GLuint renderbuffer; 1004 GLsizei samples; 1005 GLsizei storageSamples; 1006 GLenum internalformat; 1007 GLsizei width; 1008 GLsizei height; 1009}; 1010uint32_t 1011_mesa_unmarshal_NamedRenderbufferStorageMultisampleAdvancedAMD(struct gl_context *ctx, const struct marshal_cmd_NamedRenderbufferStorageMultisampleAdvancedAMD *cmd, const uint64_t *last) 1012{ 1013 GLuint renderbuffer = cmd->renderbuffer; 1014 GLsizei samples = cmd->samples; 1015 GLsizei storageSamples = cmd->storageSamples; 1016 GLenum internalformat = cmd->internalformat; 1017 GLsizei width = cmd->width; 1018 GLsizei height = cmd->height; 1019 CALL_NamedRenderbufferStorageMultisampleAdvancedAMD(ctx->CurrentServerDispatch, (renderbuffer, samples, storageSamples, internalformat, width, height)); 1020 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedRenderbufferStorageMultisampleAdvancedAMD), 8) / 8); 1021 assert (cmd_size == cmd->cmd_base.cmd_size); 1022 return cmd_size; 1023} 1024void GLAPIENTRY 1025_mesa_marshal_NamedRenderbufferStorageMultisampleAdvancedAMD(GLuint renderbuffer, GLsizei samples, GLsizei storageSamples, GLenum internalformat, GLsizei width, GLsizei height) 1026{ 1027 GET_CURRENT_CONTEXT(ctx); 1028 int cmd_size = sizeof(struct marshal_cmd_NamedRenderbufferStorageMultisampleAdvancedAMD); 1029 struct marshal_cmd_NamedRenderbufferStorageMultisampleAdvancedAMD *cmd; 1030 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedRenderbufferStorageMultisampleAdvancedAMD, cmd_size); 1031 cmd->renderbuffer = renderbuffer; 1032 cmd->samples = samples; 1033 cmd->storageSamples = storageSamples; 1034 cmd->internalformat = internalformat; 1035 cmd->width = width; 1036 cmd->height = height; 1037} 1038 1039 1040/* StencilFuncSeparateATI: marshalled asynchronously */ 1041struct marshal_cmd_StencilFuncSeparateATI 1042{ 1043 struct marshal_cmd_base cmd_base; 1044 GLenum frontfunc; 1045 GLenum backfunc; 1046 GLint ref; 1047 GLuint mask; 1048}; 1049uint32_t 1050_mesa_unmarshal_StencilFuncSeparateATI(struct gl_context *ctx, const struct marshal_cmd_StencilFuncSeparateATI *cmd, const uint64_t *last) 1051{ 1052 GLenum frontfunc = cmd->frontfunc; 1053 GLenum backfunc = cmd->backfunc; 1054 GLint ref = cmd->ref; 1055 GLuint mask = cmd->mask; 1056 CALL_StencilFuncSeparateATI(ctx->CurrentServerDispatch, (frontfunc, backfunc, ref, mask)); 1057 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_StencilFuncSeparateATI), 8) / 8); 1058 assert (cmd_size == cmd->cmd_base.cmd_size); 1059 return cmd_size; 1060} 1061void GLAPIENTRY 1062_mesa_marshal_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) 1063{ 1064 GET_CURRENT_CONTEXT(ctx); 1065 int cmd_size = sizeof(struct marshal_cmd_StencilFuncSeparateATI); 1066 struct marshal_cmd_StencilFuncSeparateATI *cmd; 1067 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_StencilFuncSeparateATI, cmd_size); 1068 cmd->frontfunc = frontfunc; 1069 cmd->backfunc = backfunc; 1070 cmd->ref = ref; 1071 cmd->mask = mask; 1072} 1073 1074 1075/* ProgramEnvParameters4fvEXT: marshalled asynchronously */ 1076struct marshal_cmd_ProgramEnvParameters4fvEXT 1077{ 1078 struct marshal_cmd_base cmd_base; 1079 GLenum target; 1080 GLuint index; 1081 GLsizei count; 1082 GLfloat params[4]; 1083}; 1084uint32_t 1085_mesa_unmarshal_ProgramEnvParameters4fvEXT(struct gl_context *ctx, const struct marshal_cmd_ProgramEnvParameters4fvEXT *cmd, const uint64_t *last) 1086{ 1087 GLenum target = cmd->target; 1088 GLuint index = cmd->index; 1089 GLsizei count = cmd->count; 1090 const GLfloat * params = cmd->params; 1091 CALL_ProgramEnvParameters4fvEXT(ctx->CurrentServerDispatch, (target, index, count, params)); 1092 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramEnvParameters4fvEXT), 8) / 8); 1093 assert (cmd_size == cmd->cmd_base.cmd_size); 1094 return cmd_size; 1095} 1096void GLAPIENTRY 1097_mesa_marshal_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat * params) 1098{ 1099 GET_CURRENT_CONTEXT(ctx); 1100 int cmd_size = sizeof(struct marshal_cmd_ProgramEnvParameters4fvEXT); 1101 struct marshal_cmd_ProgramEnvParameters4fvEXT *cmd; 1102 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramEnvParameters4fvEXT, cmd_size); 1103 cmd->target = target; 1104 cmd->index = index; 1105 cmd->count = count; 1106 memcpy(cmd->params, params, 4 * sizeof(GLfloat)); 1107} 1108 1109 1110/* ProgramLocalParameters4fvEXT: marshalled asynchronously */ 1111struct marshal_cmd_ProgramLocalParameters4fvEXT 1112{ 1113 struct marshal_cmd_base cmd_base; 1114 GLenum target; 1115 GLuint index; 1116 GLsizei count; 1117 GLfloat params[4]; 1118}; 1119uint32_t 1120_mesa_unmarshal_ProgramLocalParameters4fvEXT(struct gl_context *ctx, const struct marshal_cmd_ProgramLocalParameters4fvEXT *cmd, const uint64_t *last) 1121{ 1122 GLenum target = cmd->target; 1123 GLuint index = cmd->index; 1124 GLsizei count = cmd->count; 1125 const GLfloat * params = cmd->params; 1126 CALL_ProgramLocalParameters4fvEXT(ctx->CurrentServerDispatch, (target, index, count, params)); 1127 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ProgramLocalParameters4fvEXT), 8) / 8); 1128 assert (cmd_size == cmd->cmd_base.cmd_size); 1129 return cmd_size; 1130} 1131void GLAPIENTRY 1132_mesa_marshal_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat * params) 1133{ 1134 GET_CURRENT_CONTEXT(ctx); 1135 int cmd_size = sizeof(struct marshal_cmd_ProgramLocalParameters4fvEXT); 1136 struct marshal_cmd_ProgramLocalParameters4fvEXT *cmd; 1137 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ProgramLocalParameters4fvEXT, cmd_size); 1138 cmd->target = target; 1139 cmd->index = index; 1140 cmd->count = count; 1141 memcpy(cmd->params, params, 4 * sizeof(GLfloat)); 1142} 1143 1144 1145/* InternalBufferSubDataCopyMESA: marshalled asynchronously */ 1146struct marshal_cmd_InternalBufferSubDataCopyMESA 1147{ 1148 struct marshal_cmd_base cmd_base; 1149 GLboolean named; 1150 GLboolean ext_dsa; 1151 GLuint srcOffset; 1152 GLuint dstTargetOrName; 1153 GLintptr srcBuffer; 1154 GLintptr dstOffset; 1155 GLsizeiptr size; 1156}; 1157uint32_t 1158_mesa_unmarshal_InternalBufferSubDataCopyMESA(struct gl_context *ctx, const struct marshal_cmd_InternalBufferSubDataCopyMESA *cmd, const uint64_t *last) 1159{ 1160 GLintptr srcBuffer = cmd->srcBuffer; 1161 GLuint srcOffset = cmd->srcOffset; 1162 GLuint dstTargetOrName = cmd->dstTargetOrName; 1163 GLintptr dstOffset = cmd->dstOffset; 1164 GLsizeiptr size = cmd->size; 1165 GLboolean named = cmd->named; 1166 GLboolean ext_dsa = cmd->ext_dsa; 1167 CALL_InternalBufferSubDataCopyMESA(ctx->CurrentServerDispatch, (srcBuffer, srcOffset, dstTargetOrName, dstOffset, size, named, ext_dsa)); 1168 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_InternalBufferSubDataCopyMESA), 8) / 8); 1169 assert (cmd_size == cmd->cmd_base.cmd_size); 1170 return cmd_size; 1171} 1172void GLAPIENTRY 1173_mesa_marshal_InternalBufferSubDataCopyMESA(GLintptr srcBuffer, GLuint srcOffset, GLuint dstTargetOrName, GLintptr dstOffset, GLsizeiptr size, GLboolean named, GLboolean ext_dsa) 1174{ 1175 GET_CURRENT_CONTEXT(ctx); 1176 int cmd_size = sizeof(struct marshal_cmd_InternalBufferSubDataCopyMESA); 1177 struct marshal_cmd_InternalBufferSubDataCopyMESA *cmd; 1178 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InternalBufferSubDataCopyMESA, cmd_size); 1179 cmd->srcBuffer = srcBuffer; 1180 cmd->srcOffset = srcOffset; 1181 cmd->dstTargetOrName = dstTargetOrName; 1182 cmd->dstOffset = dstOffset; 1183 cmd->size = size; 1184 cmd->named = named; 1185 cmd->ext_dsa = ext_dsa; 1186} 1187 1188 1189/* InternalSetError: marshalled asynchronously */ 1190struct marshal_cmd_InternalSetError 1191{ 1192 struct marshal_cmd_base cmd_base; 1193 GLenum error; 1194}; 1195uint32_t 1196_mesa_unmarshal_InternalSetError(struct gl_context *ctx, const struct marshal_cmd_InternalSetError *cmd, const uint64_t *last) 1197{ 1198 GLenum error = cmd->error; 1199 CALL_InternalSetError(ctx->CurrentServerDispatch, (error)); 1200 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_InternalSetError), 8) / 8); 1201 assert (cmd_size == cmd->cmd_base.cmd_size); 1202 return cmd_size; 1203} 1204void GLAPIENTRY 1205_mesa_marshal_InternalSetError(GLenum error) 1206{ 1207 GET_CURRENT_CONTEXT(ctx); 1208 int cmd_size = sizeof(struct marshal_cmd_InternalSetError); 1209 struct marshal_cmd_InternalSetError *cmd; 1210 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_InternalSetError, cmd_size); 1211 cmd->error = error; 1212} 1213 1214 1215/* EGLImageTargetTexture2DOES: marshalled synchronously */ 1216void GLAPIENTRY 1217_mesa_marshal_EGLImageTargetTexture2DOES(GLenum target, GLvoid * writeOffset) 1218{ 1219 GET_CURRENT_CONTEXT(ctx); 1220 _mesa_glthread_finish_before(ctx, "EGLImageTargetTexture2DOES"); 1221 CALL_EGLImageTargetTexture2DOES(ctx->CurrentServerDispatch, (target, writeOffset)); 1222} 1223 1224 1225/* EGLImageTargetRenderbufferStorageOES: marshalled synchronously */ 1226void GLAPIENTRY 1227_mesa_marshal_EGLImageTargetRenderbufferStorageOES(GLenum target, GLvoid * writeOffset) 1228{ 1229 GET_CURRENT_CONTEXT(ctx); 1230 _mesa_glthread_finish_before(ctx, "EGLImageTargetRenderbufferStorageOES"); 1231 CALL_EGLImageTargetRenderbufferStorageOES(ctx->CurrentServerDispatch, (target, writeOffset)); 1232} 1233 1234 1235/* EGLImageTargetTexStorageEXT: marshalled synchronously */ 1236void GLAPIENTRY 1237_mesa_marshal_EGLImageTargetTexStorageEXT(GLenum target, GLvoid * image, const GLint * attrib_list) 1238{ 1239 GET_CURRENT_CONTEXT(ctx); 1240 _mesa_glthread_finish_before(ctx, "EGLImageTargetTexStorageEXT"); 1241 CALL_EGLImageTargetTexStorageEXT(ctx->CurrentServerDispatch, (target, image, attrib_list)); 1242} 1243 1244 1245/* EGLImageTargetTextureStorageEXT: marshalled synchronously */ 1246void GLAPIENTRY 1247_mesa_marshal_EGLImageTargetTextureStorageEXT(GLuint texture, GLvoid * image, const GLint * attrib_list) 1248{ 1249 GET_CURRENT_CONTEXT(ctx); 1250 _mesa_glthread_finish_before(ctx, "EGLImageTargetTextureStorageEXT"); 1251 CALL_EGLImageTargetTextureStorageEXT(ctx->CurrentServerDispatch, (texture, image, attrib_list)); 1252} 1253 1254 1255/* ClearColorIiEXT: marshalled asynchronously */ 1256struct marshal_cmd_ClearColorIiEXT 1257{ 1258 struct marshal_cmd_base cmd_base; 1259 GLint r; 1260 GLint g; 1261 GLint b; 1262 GLint a; 1263}; 1264uint32_t 1265_mesa_unmarshal_ClearColorIiEXT(struct gl_context *ctx, const struct marshal_cmd_ClearColorIiEXT *cmd, const uint64_t *last) 1266{ 1267 GLint r = cmd->r; 1268 GLint g = cmd->g; 1269 GLint b = cmd->b; 1270 GLint a = cmd->a; 1271 CALL_ClearColorIiEXT(ctx->CurrentServerDispatch, (r, g, b, a)); 1272 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ClearColorIiEXT), 8) / 8); 1273 assert (cmd_size == cmd->cmd_base.cmd_size); 1274 return cmd_size; 1275} 1276void GLAPIENTRY 1277_mesa_marshal_ClearColorIiEXT(GLint r, GLint g, GLint b, GLint a) 1278{ 1279 GET_CURRENT_CONTEXT(ctx); 1280 int cmd_size = sizeof(struct marshal_cmd_ClearColorIiEXT); 1281 struct marshal_cmd_ClearColorIiEXT *cmd; 1282 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearColorIiEXT, cmd_size); 1283 cmd->r = r; 1284 cmd->g = g; 1285 cmd->b = b; 1286 cmd->a = a; 1287} 1288 1289 1290/* ClearColorIuiEXT: marshalled asynchronously */ 1291struct marshal_cmd_ClearColorIuiEXT 1292{ 1293 struct marshal_cmd_base cmd_base; 1294 GLuint r; 1295 GLuint g; 1296 GLuint b; 1297 GLuint a; 1298}; 1299uint32_t 1300_mesa_unmarshal_ClearColorIuiEXT(struct gl_context *ctx, const struct marshal_cmd_ClearColorIuiEXT *cmd, const uint64_t *last) 1301{ 1302 GLuint r = cmd->r; 1303 GLuint g = cmd->g; 1304 GLuint b = cmd->b; 1305 GLuint a = cmd->a; 1306 CALL_ClearColorIuiEXT(ctx->CurrentServerDispatch, (r, g, b, a)); 1307 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ClearColorIuiEXT), 8) / 8); 1308 assert (cmd_size == cmd->cmd_base.cmd_size); 1309 return cmd_size; 1310} 1311void GLAPIENTRY 1312_mesa_marshal_ClearColorIuiEXT(GLuint r, GLuint g, GLuint b, GLuint a) 1313{ 1314 GET_CURRENT_CONTEXT(ctx); 1315 int cmd_size = sizeof(struct marshal_cmd_ClearColorIuiEXT); 1316 struct marshal_cmd_ClearColorIuiEXT *cmd; 1317 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearColorIuiEXT, cmd_size); 1318 cmd->r = r; 1319 cmd->g = g; 1320 cmd->b = b; 1321 cmd->a = a; 1322} 1323 1324 1325/* TexParameterIiv: marshalled asynchronously */ 1326struct marshal_cmd_TexParameterIiv 1327{ 1328 struct marshal_cmd_base cmd_base; 1329 GLenum target; 1330 GLenum pname; 1331 /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint)) bytes are GLint params[_mesa_tex_param_enum_to_count(pname)] */ 1332}; 1333uint32_t 1334_mesa_unmarshal_TexParameterIiv(struct gl_context *ctx, const struct marshal_cmd_TexParameterIiv *cmd, const uint64_t *last) 1335{ 1336 GLenum target = cmd->target; 1337 GLenum pname = cmd->pname; 1338 GLint * params; 1339 const char *variable_data = (const char *) (cmd + 1); 1340 params = (GLint *) variable_data; 1341 CALL_TexParameterIiv(ctx->CurrentServerDispatch, (target, pname, params)); 1342 return cmd->cmd_base.cmd_size; 1343} 1344void GLAPIENTRY 1345_mesa_marshal_TexParameterIiv(GLenum target, GLenum pname, const GLint * params) 1346{ 1347 GET_CURRENT_CONTEXT(ctx); 1348 int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLint)); 1349 int cmd_size = sizeof(struct marshal_cmd_TexParameterIiv) + params_size; 1350 struct marshal_cmd_TexParameterIiv *cmd; 1351 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 1352 _mesa_glthread_finish_before(ctx, "TexParameterIiv"); 1353 CALL_TexParameterIiv(ctx->CurrentServerDispatch, (target, pname, params)); 1354 return; 1355 } 1356 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexParameterIiv, cmd_size); 1357 cmd->target = target; 1358 cmd->pname = pname; 1359 char *variable_data = (char *) (cmd + 1); 1360 memcpy(variable_data, params, params_size); 1361} 1362 1363 1364/* TexParameterIuiv: marshalled asynchronously */ 1365struct marshal_cmd_TexParameterIuiv 1366{ 1367 struct marshal_cmd_base cmd_base; 1368 GLenum target; 1369 GLenum pname; 1370 /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLuint)) bytes are GLuint params[_mesa_tex_param_enum_to_count(pname)] */ 1371}; 1372uint32_t 1373_mesa_unmarshal_TexParameterIuiv(struct gl_context *ctx, const struct marshal_cmd_TexParameterIuiv *cmd, const uint64_t *last) 1374{ 1375 GLenum target = cmd->target; 1376 GLenum pname = cmd->pname; 1377 GLuint * params; 1378 const char *variable_data = (const char *) (cmd + 1); 1379 params = (GLuint *) variable_data; 1380 CALL_TexParameterIuiv(ctx->CurrentServerDispatch, (target, pname, params)); 1381 return cmd->cmd_base.cmd_size; 1382} 1383void GLAPIENTRY 1384_mesa_marshal_TexParameterIuiv(GLenum target, GLenum pname, const GLuint * params) 1385{ 1386 GET_CURRENT_CONTEXT(ctx); 1387 int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLuint)); 1388 int cmd_size = sizeof(struct marshal_cmd_TexParameterIuiv) + params_size; 1389 struct marshal_cmd_TexParameterIuiv *cmd; 1390 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 1391 _mesa_glthread_finish_before(ctx, "TexParameterIuiv"); 1392 CALL_TexParameterIuiv(ctx->CurrentServerDispatch, (target, pname, params)); 1393 return; 1394 } 1395 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexParameterIuiv, cmd_size); 1396 cmd->target = target; 1397 cmd->pname = pname; 1398 char *variable_data = (char *) (cmd + 1); 1399 memcpy(variable_data, params, params_size); 1400} 1401 1402 1403/* GetTexParameterIiv: marshalled synchronously */ 1404void GLAPIENTRY 1405_mesa_marshal_GetTexParameterIiv(GLenum target, GLenum pname, GLint * params) 1406{ 1407 GET_CURRENT_CONTEXT(ctx); 1408 _mesa_glthread_finish_before(ctx, "GetTexParameterIiv"); 1409 CALL_GetTexParameterIiv(ctx->CurrentServerDispatch, (target, pname, params)); 1410} 1411 1412 1413/* GetTexParameterIuiv: marshalled synchronously */ 1414void GLAPIENTRY 1415_mesa_marshal_GetTexParameterIuiv(GLenum target, GLenum pname, GLuint * params) 1416{ 1417 GET_CURRENT_CONTEXT(ctx); 1418 _mesa_glthread_finish_before(ctx, "GetTexParameterIuiv"); 1419 CALL_GetTexParameterIuiv(ctx->CurrentServerDispatch, (target, pname, params)); 1420} 1421 1422 1423/* VertexAttribI1iEXT: marshalled asynchronously */ 1424struct marshal_cmd_VertexAttribI1iEXT 1425{ 1426 struct marshal_cmd_base cmd_base; 1427 GLuint index; 1428 GLint x; 1429}; 1430uint32_t 1431_mesa_unmarshal_VertexAttribI1iEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI1iEXT *cmd, const uint64_t *last) 1432{ 1433 GLuint index = cmd->index; 1434 GLint x = cmd->x; 1435 CALL_VertexAttribI1iEXT(ctx->CurrentServerDispatch, (index, x)); 1436 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI1iEXT), 8) / 8); 1437 assert (cmd_size == cmd->cmd_base.cmd_size); 1438 return cmd_size; 1439} 1440void GLAPIENTRY 1441_mesa_marshal_VertexAttribI1iEXT(GLuint index, GLint x) 1442{ 1443 GET_CURRENT_CONTEXT(ctx); 1444 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI1iEXT); 1445 struct marshal_cmd_VertexAttribI1iEXT *cmd; 1446 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI1iEXT, cmd_size); 1447 cmd->index = index; 1448 cmd->x = x; 1449} 1450 1451 1452/* VertexAttribI2iEXT: marshalled asynchronously */ 1453struct marshal_cmd_VertexAttribI2iEXT 1454{ 1455 struct marshal_cmd_base cmd_base; 1456 GLuint index; 1457 GLint x; 1458 GLint y; 1459}; 1460uint32_t 1461_mesa_unmarshal_VertexAttribI2iEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI2iEXT *cmd, const uint64_t *last) 1462{ 1463 GLuint index = cmd->index; 1464 GLint x = cmd->x; 1465 GLint y = cmd->y; 1466 CALL_VertexAttribI2iEXT(ctx->CurrentServerDispatch, (index, x, y)); 1467 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI2iEXT), 8) / 8); 1468 assert (cmd_size == cmd->cmd_base.cmd_size); 1469 return cmd_size; 1470} 1471void GLAPIENTRY 1472_mesa_marshal_VertexAttribI2iEXT(GLuint index, GLint x, GLint y) 1473{ 1474 GET_CURRENT_CONTEXT(ctx); 1475 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI2iEXT); 1476 struct marshal_cmd_VertexAttribI2iEXT *cmd; 1477 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI2iEXT, cmd_size); 1478 cmd->index = index; 1479 cmd->x = x; 1480 cmd->y = y; 1481} 1482 1483 1484/* VertexAttribI3iEXT: marshalled asynchronously */ 1485struct marshal_cmd_VertexAttribI3iEXT 1486{ 1487 struct marshal_cmd_base cmd_base; 1488 GLuint index; 1489 GLint x; 1490 GLint y; 1491 GLint z; 1492}; 1493uint32_t 1494_mesa_unmarshal_VertexAttribI3iEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI3iEXT *cmd, const uint64_t *last) 1495{ 1496 GLuint index = cmd->index; 1497 GLint x = cmd->x; 1498 GLint y = cmd->y; 1499 GLint z = cmd->z; 1500 CALL_VertexAttribI3iEXT(ctx->CurrentServerDispatch, (index, x, y, z)); 1501 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI3iEXT), 8) / 8); 1502 assert (cmd_size == cmd->cmd_base.cmd_size); 1503 return cmd_size; 1504} 1505void GLAPIENTRY 1506_mesa_marshal_VertexAttribI3iEXT(GLuint index, GLint x, GLint y, GLint z) 1507{ 1508 GET_CURRENT_CONTEXT(ctx); 1509 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI3iEXT); 1510 struct marshal_cmd_VertexAttribI3iEXT *cmd; 1511 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI3iEXT, cmd_size); 1512 cmd->index = index; 1513 cmd->x = x; 1514 cmd->y = y; 1515 cmd->z = z; 1516} 1517 1518 1519/* VertexAttribI4iEXT: marshalled asynchronously */ 1520struct marshal_cmd_VertexAttribI4iEXT 1521{ 1522 struct marshal_cmd_base cmd_base; 1523 GLuint index; 1524 GLint x; 1525 GLint y; 1526 GLint z; 1527 GLint w; 1528}; 1529uint32_t 1530_mesa_unmarshal_VertexAttribI4iEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI4iEXT *cmd, const uint64_t *last) 1531{ 1532 GLuint index = cmd->index; 1533 GLint x = cmd->x; 1534 GLint y = cmd->y; 1535 GLint z = cmd->z; 1536 GLint w = cmd->w; 1537 CALL_VertexAttribI4iEXT(ctx->CurrentServerDispatch, (index, x, y, z, w)); 1538 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI4iEXT), 8) / 8); 1539 assert (cmd_size == cmd->cmd_base.cmd_size); 1540 return cmd_size; 1541} 1542void GLAPIENTRY 1543_mesa_marshal_VertexAttribI4iEXT(GLuint index, GLint x, GLint y, GLint z, GLint w) 1544{ 1545 GET_CURRENT_CONTEXT(ctx); 1546 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI4iEXT); 1547 struct marshal_cmd_VertexAttribI4iEXT *cmd; 1548 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI4iEXT, cmd_size); 1549 cmd->index = index; 1550 cmd->x = x; 1551 cmd->y = y; 1552 cmd->z = z; 1553 cmd->w = w; 1554} 1555 1556 1557/* VertexAttribI1uiEXT: marshalled asynchronously */ 1558struct marshal_cmd_VertexAttribI1uiEXT 1559{ 1560 struct marshal_cmd_base cmd_base; 1561 GLuint index; 1562 GLuint x; 1563}; 1564uint32_t 1565_mesa_unmarshal_VertexAttribI1uiEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI1uiEXT *cmd, const uint64_t *last) 1566{ 1567 GLuint index = cmd->index; 1568 GLuint x = cmd->x; 1569 CALL_VertexAttribI1uiEXT(ctx->CurrentServerDispatch, (index, x)); 1570 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI1uiEXT), 8) / 8); 1571 assert (cmd_size == cmd->cmd_base.cmd_size); 1572 return cmd_size; 1573} 1574void GLAPIENTRY 1575_mesa_marshal_VertexAttribI1uiEXT(GLuint index, GLuint x) 1576{ 1577 GET_CURRENT_CONTEXT(ctx); 1578 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI1uiEXT); 1579 struct marshal_cmd_VertexAttribI1uiEXT *cmd; 1580 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI1uiEXT, cmd_size); 1581 cmd->index = index; 1582 cmd->x = x; 1583} 1584 1585 1586/* VertexAttribI2uiEXT: marshalled asynchronously */ 1587struct marshal_cmd_VertexAttribI2uiEXT 1588{ 1589 struct marshal_cmd_base cmd_base; 1590 GLuint index; 1591 GLuint x; 1592 GLuint y; 1593}; 1594uint32_t 1595_mesa_unmarshal_VertexAttribI2uiEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI2uiEXT *cmd, const uint64_t *last) 1596{ 1597 GLuint index = cmd->index; 1598 GLuint x = cmd->x; 1599 GLuint y = cmd->y; 1600 CALL_VertexAttribI2uiEXT(ctx->CurrentServerDispatch, (index, x, y)); 1601 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI2uiEXT), 8) / 8); 1602 assert (cmd_size == cmd->cmd_base.cmd_size); 1603 return cmd_size; 1604} 1605void GLAPIENTRY 1606_mesa_marshal_VertexAttribI2uiEXT(GLuint index, GLuint x, GLuint y) 1607{ 1608 GET_CURRENT_CONTEXT(ctx); 1609 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI2uiEXT); 1610 struct marshal_cmd_VertexAttribI2uiEXT *cmd; 1611 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI2uiEXT, cmd_size); 1612 cmd->index = index; 1613 cmd->x = x; 1614 cmd->y = y; 1615} 1616 1617 1618/* VertexAttribI3uiEXT: marshalled asynchronously */ 1619struct marshal_cmd_VertexAttribI3uiEXT 1620{ 1621 struct marshal_cmd_base cmd_base; 1622 GLuint index; 1623 GLuint x; 1624 GLuint y; 1625 GLuint z; 1626}; 1627uint32_t 1628_mesa_unmarshal_VertexAttribI3uiEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI3uiEXT *cmd, const uint64_t *last) 1629{ 1630 GLuint index = cmd->index; 1631 GLuint x = cmd->x; 1632 GLuint y = cmd->y; 1633 GLuint z = cmd->z; 1634 CALL_VertexAttribI3uiEXT(ctx->CurrentServerDispatch, (index, x, y, z)); 1635 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI3uiEXT), 8) / 8); 1636 assert (cmd_size == cmd->cmd_base.cmd_size); 1637 return cmd_size; 1638} 1639void GLAPIENTRY 1640_mesa_marshal_VertexAttribI3uiEXT(GLuint index, GLuint x, GLuint y, GLuint z) 1641{ 1642 GET_CURRENT_CONTEXT(ctx); 1643 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI3uiEXT); 1644 struct marshal_cmd_VertexAttribI3uiEXT *cmd; 1645 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI3uiEXT, cmd_size); 1646 cmd->index = index; 1647 cmd->x = x; 1648 cmd->y = y; 1649 cmd->z = z; 1650} 1651 1652 1653/* VertexAttribI4uiEXT: marshalled asynchronously */ 1654struct marshal_cmd_VertexAttribI4uiEXT 1655{ 1656 struct marshal_cmd_base cmd_base; 1657 GLuint index; 1658 GLuint x; 1659 GLuint y; 1660 GLuint z; 1661 GLuint w; 1662}; 1663uint32_t 1664_mesa_unmarshal_VertexAttribI4uiEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI4uiEXT *cmd, const uint64_t *last) 1665{ 1666 GLuint index = cmd->index; 1667 GLuint x = cmd->x; 1668 GLuint y = cmd->y; 1669 GLuint z = cmd->z; 1670 GLuint w = cmd->w; 1671 CALL_VertexAttribI4uiEXT(ctx->CurrentServerDispatch, (index, x, y, z, w)); 1672 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI4uiEXT), 8) / 8); 1673 assert (cmd_size == cmd->cmd_base.cmd_size); 1674 return cmd_size; 1675} 1676void GLAPIENTRY 1677_mesa_marshal_VertexAttribI4uiEXT(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) 1678{ 1679 GET_CURRENT_CONTEXT(ctx); 1680 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI4uiEXT); 1681 struct marshal_cmd_VertexAttribI4uiEXT *cmd; 1682 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI4uiEXT, cmd_size); 1683 cmd->index = index; 1684 cmd->x = x; 1685 cmd->y = y; 1686 cmd->z = z; 1687 cmd->w = w; 1688} 1689 1690 1691/* VertexAttribI1iv: marshalled asynchronously */ 1692struct marshal_cmd_VertexAttribI1iv 1693{ 1694 struct marshal_cmd_base cmd_base; 1695 GLuint index; 1696 GLint v[1]; 1697}; 1698uint32_t 1699_mesa_unmarshal_VertexAttribI1iv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI1iv *cmd, const uint64_t *last) 1700{ 1701 GLuint index = cmd->index; 1702 const GLint * v = cmd->v; 1703 CALL_VertexAttribI1iv(ctx->CurrentServerDispatch, (index, v)); 1704 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI1iv), 8) / 8); 1705 assert (cmd_size == cmd->cmd_base.cmd_size); 1706 return cmd_size; 1707} 1708void GLAPIENTRY 1709_mesa_marshal_VertexAttribI1iv(GLuint index, const GLint * v) 1710{ 1711 GET_CURRENT_CONTEXT(ctx); 1712 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI1iv); 1713 struct marshal_cmd_VertexAttribI1iv *cmd; 1714 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI1iv, cmd_size); 1715 cmd->index = index; 1716 memcpy(cmd->v, v, 1 * sizeof(GLint)); 1717} 1718 1719 1720/* VertexAttribI2ivEXT: marshalled asynchronously */ 1721struct marshal_cmd_VertexAttribI2ivEXT 1722{ 1723 struct marshal_cmd_base cmd_base; 1724 GLuint index; 1725 GLint v[2]; 1726}; 1727uint32_t 1728_mesa_unmarshal_VertexAttribI2ivEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI2ivEXT *cmd, const uint64_t *last) 1729{ 1730 GLuint index = cmd->index; 1731 const GLint * v = cmd->v; 1732 CALL_VertexAttribI2ivEXT(ctx->CurrentServerDispatch, (index, v)); 1733 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI2ivEXT), 8) / 8); 1734 assert (cmd_size == cmd->cmd_base.cmd_size); 1735 return cmd_size; 1736} 1737void GLAPIENTRY 1738_mesa_marshal_VertexAttribI2ivEXT(GLuint index, const GLint * v) 1739{ 1740 GET_CURRENT_CONTEXT(ctx); 1741 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI2ivEXT); 1742 struct marshal_cmd_VertexAttribI2ivEXT *cmd; 1743 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI2ivEXT, cmd_size); 1744 cmd->index = index; 1745 memcpy(cmd->v, v, 2 * sizeof(GLint)); 1746} 1747 1748 1749/* VertexAttribI3ivEXT: marshalled asynchronously */ 1750struct marshal_cmd_VertexAttribI3ivEXT 1751{ 1752 struct marshal_cmd_base cmd_base; 1753 GLuint index; 1754 GLint v[3]; 1755}; 1756uint32_t 1757_mesa_unmarshal_VertexAttribI3ivEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI3ivEXT *cmd, const uint64_t *last) 1758{ 1759 GLuint index = cmd->index; 1760 const GLint * v = cmd->v; 1761 CALL_VertexAttribI3ivEXT(ctx->CurrentServerDispatch, (index, v)); 1762 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI3ivEXT), 8) / 8); 1763 assert (cmd_size == cmd->cmd_base.cmd_size); 1764 return cmd_size; 1765} 1766void GLAPIENTRY 1767_mesa_marshal_VertexAttribI3ivEXT(GLuint index, const GLint * v) 1768{ 1769 GET_CURRENT_CONTEXT(ctx); 1770 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI3ivEXT); 1771 struct marshal_cmd_VertexAttribI3ivEXT *cmd; 1772 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI3ivEXT, cmd_size); 1773 cmd->index = index; 1774 memcpy(cmd->v, v, 3 * sizeof(GLint)); 1775} 1776 1777 1778/* VertexAttribI4ivEXT: marshalled asynchronously */ 1779struct marshal_cmd_VertexAttribI4ivEXT 1780{ 1781 struct marshal_cmd_base cmd_base; 1782 GLuint index; 1783 GLint v[4]; 1784}; 1785uint32_t 1786_mesa_unmarshal_VertexAttribI4ivEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI4ivEXT *cmd, const uint64_t *last) 1787{ 1788 GLuint index = cmd->index; 1789 const GLint * v = cmd->v; 1790 CALL_VertexAttribI4ivEXT(ctx->CurrentServerDispatch, (index, v)); 1791 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI4ivEXT), 8) / 8); 1792 assert (cmd_size == cmd->cmd_base.cmd_size); 1793 return cmd_size; 1794} 1795void GLAPIENTRY 1796_mesa_marshal_VertexAttribI4ivEXT(GLuint index, const GLint * v) 1797{ 1798 GET_CURRENT_CONTEXT(ctx); 1799 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI4ivEXT); 1800 struct marshal_cmd_VertexAttribI4ivEXT *cmd; 1801 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI4ivEXT, cmd_size); 1802 cmd->index = index; 1803 memcpy(cmd->v, v, 4 * sizeof(GLint)); 1804} 1805 1806 1807/* VertexAttribI1uiv: marshalled asynchronously */ 1808struct marshal_cmd_VertexAttribI1uiv 1809{ 1810 struct marshal_cmd_base cmd_base; 1811 GLuint index; 1812 GLuint v[1]; 1813}; 1814uint32_t 1815_mesa_unmarshal_VertexAttribI1uiv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI1uiv *cmd, const uint64_t *last) 1816{ 1817 GLuint index = cmd->index; 1818 const GLuint * v = cmd->v; 1819 CALL_VertexAttribI1uiv(ctx->CurrentServerDispatch, (index, v)); 1820 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI1uiv), 8) / 8); 1821 assert (cmd_size == cmd->cmd_base.cmd_size); 1822 return cmd_size; 1823} 1824void GLAPIENTRY 1825_mesa_marshal_VertexAttribI1uiv(GLuint index, const GLuint * v) 1826{ 1827 GET_CURRENT_CONTEXT(ctx); 1828 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI1uiv); 1829 struct marshal_cmd_VertexAttribI1uiv *cmd; 1830 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI1uiv, cmd_size); 1831 cmd->index = index; 1832 memcpy(cmd->v, v, 1 * sizeof(GLuint)); 1833} 1834 1835 1836/* VertexAttribI2uivEXT: marshalled asynchronously */ 1837struct marshal_cmd_VertexAttribI2uivEXT 1838{ 1839 struct marshal_cmd_base cmd_base; 1840 GLuint index; 1841 GLuint v[2]; 1842}; 1843uint32_t 1844_mesa_unmarshal_VertexAttribI2uivEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI2uivEXT *cmd, const uint64_t *last) 1845{ 1846 GLuint index = cmd->index; 1847 const GLuint * v = cmd->v; 1848 CALL_VertexAttribI2uivEXT(ctx->CurrentServerDispatch, (index, v)); 1849 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI2uivEXT), 8) / 8); 1850 assert (cmd_size == cmd->cmd_base.cmd_size); 1851 return cmd_size; 1852} 1853void GLAPIENTRY 1854_mesa_marshal_VertexAttribI2uivEXT(GLuint index, const GLuint * v) 1855{ 1856 GET_CURRENT_CONTEXT(ctx); 1857 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI2uivEXT); 1858 struct marshal_cmd_VertexAttribI2uivEXT *cmd; 1859 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI2uivEXT, cmd_size); 1860 cmd->index = index; 1861 memcpy(cmd->v, v, 2 * sizeof(GLuint)); 1862} 1863 1864 1865/* VertexAttribI3uivEXT: marshalled asynchronously */ 1866struct marshal_cmd_VertexAttribI3uivEXT 1867{ 1868 struct marshal_cmd_base cmd_base; 1869 GLuint index; 1870 GLuint v[3]; 1871}; 1872uint32_t 1873_mesa_unmarshal_VertexAttribI3uivEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI3uivEXT *cmd, const uint64_t *last) 1874{ 1875 GLuint index = cmd->index; 1876 const GLuint * v = cmd->v; 1877 CALL_VertexAttribI3uivEXT(ctx->CurrentServerDispatch, (index, v)); 1878 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI3uivEXT), 8) / 8); 1879 assert (cmd_size == cmd->cmd_base.cmd_size); 1880 return cmd_size; 1881} 1882void GLAPIENTRY 1883_mesa_marshal_VertexAttribI3uivEXT(GLuint index, const GLuint * v) 1884{ 1885 GET_CURRENT_CONTEXT(ctx); 1886 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI3uivEXT); 1887 struct marshal_cmd_VertexAttribI3uivEXT *cmd; 1888 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI3uivEXT, cmd_size); 1889 cmd->index = index; 1890 memcpy(cmd->v, v, 3 * sizeof(GLuint)); 1891} 1892 1893 1894/* VertexAttribI4uivEXT: marshalled asynchronously */ 1895struct marshal_cmd_VertexAttribI4uivEXT 1896{ 1897 struct marshal_cmd_base cmd_base; 1898 GLuint index; 1899 GLuint v[4]; 1900}; 1901uint32_t 1902_mesa_unmarshal_VertexAttribI4uivEXT(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI4uivEXT *cmd, const uint64_t *last) 1903{ 1904 GLuint index = cmd->index; 1905 const GLuint * v = cmd->v; 1906 CALL_VertexAttribI4uivEXT(ctx->CurrentServerDispatch, (index, v)); 1907 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI4uivEXT), 8) / 8); 1908 assert (cmd_size == cmd->cmd_base.cmd_size); 1909 return cmd_size; 1910} 1911void GLAPIENTRY 1912_mesa_marshal_VertexAttribI4uivEXT(GLuint index, const GLuint * v) 1913{ 1914 GET_CURRENT_CONTEXT(ctx); 1915 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI4uivEXT); 1916 struct marshal_cmd_VertexAttribI4uivEXT *cmd; 1917 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI4uivEXT, cmd_size); 1918 cmd->index = index; 1919 memcpy(cmd->v, v, 4 * sizeof(GLuint)); 1920} 1921 1922 1923/* VertexAttribI4bv: marshalled asynchronously */ 1924struct marshal_cmd_VertexAttribI4bv 1925{ 1926 struct marshal_cmd_base cmd_base; 1927 GLuint index; 1928 GLbyte v[4]; 1929}; 1930uint32_t 1931_mesa_unmarshal_VertexAttribI4bv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI4bv *cmd, const uint64_t *last) 1932{ 1933 GLuint index = cmd->index; 1934 const GLbyte * v = cmd->v; 1935 CALL_VertexAttribI4bv(ctx->CurrentServerDispatch, (index, v)); 1936 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI4bv), 8) / 8); 1937 assert (cmd_size == cmd->cmd_base.cmd_size); 1938 return cmd_size; 1939} 1940void GLAPIENTRY 1941_mesa_marshal_VertexAttribI4bv(GLuint index, const GLbyte * v) 1942{ 1943 GET_CURRENT_CONTEXT(ctx); 1944 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI4bv); 1945 struct marshal_cmd_VertexAttribI4bv *cmd; 1946 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI4bv, cmd_size); 1947 cmd->index = index; 1948 memcpy(cmd->v, v, 4 * sizeof(GLbyte)); 1949} 1950 1951 1952/* VertexAttribI4sv: marshalled asynchronously */ 1953struct marshal_cmd_VertexAttribI4sv 1954{ 1955 struct marshal_cmd_base cmd_base; 1956 GLuint index; 1957 GLshort v[4]; 1958}; 1959uint32_t 1960_mesa_unmarshal_VertexAttribI4sv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI4sv *cmd, const uint64_t *last) 1961{ 1962 GLuint index = cmd->index; 1963 const GLshort * v = cmd->v; 1964 CALL_VertexAttribI4sv(ctx->CurrentServerDispatch, (index, v)); 1965 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI4sv), 8) / 8); 1966 assert (cmd_size == cmd->cmd_base.cmd_size); 1967 return cmd_size; 1968} 1969void GLAPIENTRY 1970_mesa_marshal_VertexAttribI4sv(GLuint index, const GLshort * v) 1971{ 1972 GET_CURRENT_CONTEXT(ctx); 1973 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI4sv); 1974 struct marshal_cmd_VertexAttribI4sv *cmd; 1975 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI4sv, cmd_size); 1976 cmd->index = index; 1977 memcpy(cmd->v, v, 4 * sizeof(GLshort)); 1978} 1979 1980 1981/* VertexAttribI4ubv: marshalled asynchronously */ 1982struct marshal_cmd_VertexAttribI4ubv 1983{ 1984 struct marshal_cmd_base cmd_base; 1985 GLuint index; 1986 GLubyte v[4]; 1987}; 1988uint32_t 1989_mesa_unmarshal_VertexAttribI4ubv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI4ubv *cmd, const uint64_t *last) 1990{ 1991 GLuint index = cmd->index; 1992 const GLubyte * v = cmd->v; 1993 CALL_VertexAttribI4ubv(ctx->CurrentServerDispatch, (index, v)); 1994 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI4ubv), 8) / 8); 1995 assert (cmd_size == cmd->cmd_base.cmd_size); 1996 return cmd_size; 1997} 1998void GLAPIENTRY 1999_mesa_marshal_VertexAttribI4ubv(GLuint index, const GLubyte * v) 2000{ 2001 GET_CURRENT_CONTEXT(ctx); 2002 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI4ubv); 2003 struct marshal_cmd_VertexAttribI4ubv *cmd; 2004 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI4ubv, cmd_size); 2005 cmd->index = index; 2006 memcpy(cmd->v, v, 4 * sizeof(GLubyte)); 2007} 2008 2009 2010/* VertexAttribI4usv: marshalled asynchronously */ 2011struct marshal_cmd_VertexAttribI4usv 2012{ 2013 struct marshal_cmd_base cmd_base; 2014 GLuint index; 2015 GLushort v[4]; 2016}; 2017uint32_t 2018_mesa_unmarshal_VertexAttribI4usv(struct gl_context *ctx, const struct marshal_cmd_VertexAttribI4usv *cmd, const uint64_t *last) 2019{ 2020 GLuint index = cmd->index; 2021 const GLushort * v = cmd->v; 2022 CALL_VertexAttribI4usv(ctx->CurrentServerDispatch, (index, v)); 2023 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribI4usv), 8) / 8); 2024 assert (cmd_size == cmd->cmd_base.cmd_size); 2025 return cmd_size; 2026} 2027void GLAPIENTRY 2028_mesa_marshal_VertexAttribI4usv(GLuint index, const GLushort * v) 2029{ 2030 GET_CURRENT_CONTEXT(ctx); 2031 int cmd_size = sizeof(struct marshal_cmd_VertexAttribI4usv); 2032 struct marshal_cmd_VertexAttribI4usv *cmd; 2033 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribI4usv, cmd_size); 2034 cmd->index = index; 2035 memcpy(cmd->v, v, 4 * sizeof(GLushort)); 2036} 2037 2038 2039/* VertexAttribIPointer: marshalled asynchronously */ 2040struct marshal_cmd_VertexAttribIPointer 2041{ 2042 struct marshal_cmd_base cmd_base; 2043 GLuint index; 2044 GLint size; 2045 GLenum type; 2046 GLsizei stride; 2047 const GLvoid * pointer; 2048}; 2049uint32_t 2050_mesa_unmarshal_VertexAttribIPointer(struct gl_context *ctx, const struct marshal_cmd_VertexAttribIPointer *cmd, const uint64_t *last) 2051{ 2052 GLuint index = cmd->index; 2053 GLint size = cmd->size; 2054 GLenum type = cmd->type; 2055 GLsizei stride = cmd->stride; 2056 const GLvoid * pointer = cmd->pointer; 2057 CALL_VertexAttribIPointer(ctx->CurrentServerDispatch, (index, size, type, stride, pointer)); 2058 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttribIPointer), 8) / 8); 2059 assert (cmd_size == cmd->cmd_base.cmd_size); 2060 return cmd_size; 2061} 2062void GLAPIENTRY 2063_mesa_marshal_VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer) 2064{ 2065 GET_CURRENT_CONTEXT(ctx); 2066 int cmd_size = sizeof(struct marshal_cmd_VertexAttribIPointer); 2067 struct marshal_cmd_VertexAttribIPointer *cmd; 2068 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribIPointer, cmd_size); 2069 cmd->index = index; 2070 cmd->size = size; 2071 cmd->type = type; 2072 cmd->stride = stride; 2073 cmd->pointer = pointer; 2074 if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_GENERIC(index), size, type, stride, pointer); 2075} 2076 2077 2078/* GetVertexAttribIiv: marshalled synchronously */ 2079void GLAPIENTRY 2080_mesa_marshal_GetVertexAttribIiv(GLuint index, GLenum pname, GLint * params) 2081{ 2082 GET_CURRENT_CONTEXT(ctx); 2083 _mesa_glthread_finish_before(ctx, "GetVertexAttribIiv"); 2084 CALL_GetVertexAttribIiv(ctx->CurrentServerDispatch, (index, pname, params)); 2085} 2086 2087 2088/* GetVertexAttribIuiv: marshalled synchronously */ 2089void GLAPIENTRY 2090_mesa_marshal_GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint * params) 2091{ 2092 GET_CURRENT_CONTEXT(ctx); 2093 _mesa_glthread_finish_before(ctx, "GetVertexAttribIuiv"); 2094 CALL_GetVertexAttribIuiv(ctx->CurrentServerDispatch, (index, pname, params)); 2095} 2096 2097 2098/* Uniform1ui: marshalled asynchronously */ 2099struct marshal_cmd_Uniform1ui 2100{ 2101 struct marshal_cmd_base cmd_base; 2102 GLint location; 2103 GLuint x; 2104}; 2105uint32_t 2106_mesa_unmarshal_Uniform1ui(struct gl_context *ctx, const struct marshal_cmd_Uniform1ui *cmd, const uint64_t *last) 2107{ 2108 GLint location = cmd->location; 2109 GLuint x = cmd->x; 2110 CALL_Uniform1ui(ctx->CurrentServerDispatch, (location, x)); 2111 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform1ui), 8) / 8); 2112 assert (cmd_size == cmd->cmd_base.cmd_size); 2113 return cmd_size; 2114} 2115void GLAPIENTRY 2116_mesa_marshal_Uniform1ui(GLint location, GLuint x) 2117{ 2118 GET_CURRENT_CONTEXT(ctx); 2119 int cmd_size = sizeof(struct marshal_cmd_Uniform1ui); 2120 struct marshal_cmd_Uniform1ui *cmd; 2121 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1ui, cmd_size); 2122 cmd->location = location; 2123 cmd->x = x; 2124} 2125 2126 2127/* Uniform2ui: marshalled asynchronously */ 2128struct marshal_cmd_Uniform2ui 2129{ 2130 struct marshal_cmd_base cmd_base; 2131 GLint location; 2132 GLuint x; 2133 GLuint y; 2134}; 2135uint32_t 2136_mesa_unmarshal_Uniform2ui(struct gl_context *ctx, const struct marshal_cmd_Uniform2ui *cmd, const uint64_t *last) 2137{ 2138 GLint location = cmd->location; 2139 GLuint x = cmd->x; 2140 GLuint y = cmd->y; 2141 CALL_Uniform2ui(ctx->CurrentServerDispatch, (location, x, y)); 2142 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform2ui), 8) / 8); 2143 assert (cmd_size == cmd->cmd_base.cmd_size); 2144 return cmd_size; 2145} 2146void GLAPIENTRY 2147_mesa_marshal_Uniform2ui(GLint location, GLuint x, GLuint y) 2148{ 2149 GET_CURRENT_CONTEXT(ctx); 2150 int cmd_size = sizeof(struct marshal_cmd_Uniform2ui); 2151 struct marshal_cmd_Uniform2ui *cmd; 2152 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2ui, cmd_size); 2153 cmd->location = location; 2154 cmd->x = x; 2155 cmd->y = y; 2156} 2157 2158 2159/* Uniform3ui: marshalled asynchronously */ 2160struct marshal_cmd_Uniform3ui 2161{ 2162 struct marshal_cmd_base cmd_base; 2163 GLint location; 2164 GLuint x; 2165 GLuint y; 2166 GLuint z; 2167}; 2168uint32_t 2169_mesa_unmarshal_Uniform3ui(struct gl_context *ctx, const struct marshal_cmd_Uniform3ui *cmd, const uint64_t *last) 2170{ 2171 GLint location = cmd->location; 2172 GLuint x = cmd->x; 2173 GLuint y = cmd->y; 2174 GLuint z = cmd->z; 2175 CALL_Uniform3ui(ctx->CurrentServerDispatch, (location, x, y, z)); 2176 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform3ui), 8) / 8); 2177 assert (cmd_size == cmd->cmd_base.cmd_size); 2178 return cmd_size; 2179} 2180void GLAPIENTRY 2181_mesa_marshal_Uniform3ui(GLint location, GLuint x, GLuint y, GLuint z) 2182{ 2183 GET_CURRENT_CONTEXT(ctx); 2184 int cmd_size = sizeof(struct marshal_cmd_Uniform3ui); 2185 struct marshal_cmd_Uniform3ui *cmd; 2186 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3ui, cmd_size); 2187 cmd->location = location; 2188 cmd->x = x; 2189 cmd->y = y; 2190 cmd->z = z; 2191} 2192 2193 2194/* Uniform4ui: marshalled asynchronously */ 2195struct marshal_cmd_Uniform4ui 2196{ 2197 struct marshal_cmd_base cmd_base; 2198 GLint location; 2199 GLuint x; 2200 GLuint y; 2201 GLuint z; 2202 GLuint w; 2203}; 2204uint32_t 2205_mesa_unmarshal_Uniform4ui(struct gl_context *ctx, const struct marshal_cmd_Uniform4ui *cmd, const uint64_t *last) 2206{ 2207 GLint location = cmd->location; 2208 GLuint x = cmd->x; 2209 GLuint y = cmd->y; 2210 GLuint z = cmd->z; 2211 GLuint w = cmd->w; 2212 CALL_Uniform4ui(ctx->CurrentServerDispatch, (location, x, y, z, w)); 2213 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Uniform4ui), 8) / 8); 2214 assert (cmd_size == cmd->cmd_base.cmd_size); 2215 return cmd_size; 2216} 2217void GLAPIENTRY 2218_mesa_marshal_Uniform4ui(GLint location, GLuint x, GLuint y, GLuint z, GLuint w) 2219{ 2220 GET_CURRENT_CONTEXT(ctx); 2221 int cmd_size = sizeof(struct marshal_cmd_Uniform4ui); 2222 struct marshal_cmd_Uniform4ui *cmd; 2223 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4ui, cmd_size); 2224 cmd->location = location; 2225 cmd->x = x; 2226 cmd->y = y; 2227 cmd->z = z; 2228 cmd->w = w; 2229} 2230 2231 2232/* Uniform1uiv: marshalled asynchronously */ 2233struct marshal_cmd_Uniform1uiv 2234{ 2235 struct marshal_cmd_base cmd_base; 2236 GLint location; 2237 GLsizei count; 2238 /* Next safe_mul(count, 1 * sizeof(GLuint)) bytes are GLuint value[count] */ 2239}; 2240uint32_t 2241_mesa_unmarshal_Uniform1uiv(struct gl_context *ctx, const struct marshal_cmd_Uniform1uiv *cmd, const uint64_t *last) 2242{ 2243 GLint location = cmd->location; 2244 GLsizei count = cmd->count; 2245 GLuint * value; 2246 const char *variable_data = (const char *) (cmd + 1); 2247 value = (GLuint *) variable_data; 2248 CALL_Uniform1uiv(ctx->CurrentServerDispatch, (location, count, value)); 2249 return cmd->cmd_base.cmd_size; 2250} 2251void GLAPIENTRY 2252_mesa_marshal_Uniform1uiv(GLint location, GLsizei count, const GLuint * value) 2253{ 2254 GET_CURRENT_CONTEXT(ctx); 2255 int value_size = safe_mul(count, 1 * sizeof(GLuint)); 2256 int cmd_size = sizeof(struct marshal_cmd_Uniform1uiv) + value_size; 2257 struct marshal_cmd_Uniform1uiv *cmd; 2258 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 2259 _mesa_glthread_finish_before(ctx, "Uniform1uiv"); 2260 CALL_Uniform1uiv(ctx->CurrentServerDispatch, (location, count, value)); 2261 return; 2262 } 2263 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform1uiv, cmd_size); 2264 cmd->location = location; 2265 cmd->count = count; 2266 char *variable_data = (char *) (cmd + 1); 2267 memcpy(variable_data, value, value_size); 2268} 2269 2270 2271/* Uniform2uiv: marshalled asynchronously */ 2272struct marshal_cmd_Uniform2uiv 2273{ 2274 struct marshal_cmd_base cmd_base; 2275 GLint location; 2276 GLsizei count; 2277 /* Next safe_mul(count, 2 * sizeof(GLuint)) bytes are GLuint value[count][2] */ 2278}; 2279uint32_t 2280_mesa_unmarshal_Uniform2uiv(struct gl_context *ctx, const struct marshal_cmd_Uniform2uiv *cmd, const uint64_t *last) 2281{ 2282 GLint location = cmd->location; 2283 GLsizei count = cmd->count; 2284 GLuint * value; 2285 const char *variable_data = (const char *) (cmd + 1); 2286 value = (GLuint *) variable_data; 2287 CALL_Uniform2uiv(ctx->CurrentServerDispatch, (location, count, value)); 2288 return cmd->cmd_base.cmd_size; 2289} 2290void GLAPIENTRY 2291_mesa_marshal_Uniform2uiv(GLint location, GLsizei count, const GLuint * value) 2292{ 2293 GET_CURRENT_CONTEXT(ctx); 2294 int value_size = safe_mul(count, 2 * sizeof(GLuint)); 2295 int cmd_size = sizeof(struct marshal_cmd_Uniform2uiv) + value_size; 2296 struct marshal_cmd_Uniform2uiv *cmd; 2297 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 2298 _mesa_glthread_finish_before(ctx, "Uniform2uiv"); 2299 CALL_Uniform2uiv(ctx->CurrentServerDispatch, (location, count, value)); 2300 return; 2301 } 2302 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform2uiv, cmd_size); 2303 cmd->location = location; 2304 cmd->count = count; 2305 char *variable_data = (char *) (cmd + 1); 2306 memcpy(variable_data, value, value_size); 2307} 2308 2309 2310/* Uniform3uiv: marshalled asynchronously */ 2311struct marshal_cmd_Uniform3uiv 2312{ 2313 struct marshal_cmd_base cmd_base; 2314 GLint location; 2315 GLsizei count; 2316 /* Next safe_mul(count, 3 * sizeof(GLuint)) bytes are GLuint value[count][3] */ 2317}; 2318uint32_t 2319_mesa_unmarshal_Uniform3uiv(struct gl_context *ctx, const struct marshal_cmd_Uniform3uiv *cmd, const uint64_t *last) 2320{ 2321 GLint location = cmd->location; 2322 GLsizei count = cmd->count; 2323 GLuint * value; 2324 const char *variable_data = (const char *) (cmd + 1); 2325 value = (GLuint *) variable_data; 2326 CALL_Uniform3uiv(ctx->CurrentServerDispatch, (location, count, value)); 2327 return cmd->cmd_base.cmd_size; 2328} 2329void GLAPIENTRY 2330_mesa_marshal_Uniform3uiv(GLint location, GLsizei count, const GLuint * value) 2331{ 2332 GET_CURRENT_CONTEXT(ctx); 2333 int value_size = safe_mul(count, 3 * sizeof(GLuint)); 2334 int cmd_size = sizeof(struct marshal_cmd_Uniform3uiv) + value_size; 2335 struct marshal_cmd_Uniform3uiv *cmd; 2336 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 2337 _mesa_glthread_finish_before(ctx, "Uniform3uiv"); 2338 CALL_Uniform3uiv(ctx->CurrentServerDispatch, (location, count, value)); 2339 return; 2340 } 2341 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform3uiv, cmd_size); 2342 cmd->location = location; 2343 cmd->count = count; 2344 char *variable_data = (char *) (cmd + 1); 2345 memcpy(variable_data, value, value_size); 2346} 2347 2348 2349/* Uniform4uiv: marshalled asynchronously */ 2350struct marshal_cmd_Uniform4uiv 2351{ 2352 struct marshal_cmd_base cmd_base; 2353 GLint location; 2354 GLsizei count; 2355 /* Next safe_mul(count, 4 * sizeof(GLuint)) bytes are GLuint value[count][4] */ 2356}; 2357uint32_t 2358_mesa_unmarshal_Uniform4uiv(struct gl_context *ctx, const struct marshal_cmd_Uniform4uiv *cmd, const uint64_t *last) 2359{ 2360 GLint location = cmd->location; 2361 GLsizei count = cmd->count; 2362 GLuint * value; 2363 const char *variable_data = (const char *) (cmd + 1); 2364 value = (GLuint *) variable_data; 2365 CALL_Uniform4uiv(ctx->CurrentServerDispatch, (location, count, value)); 2366 return cmd->cmd_base.cmd_size; 2367} 2368void GLAPIENTRY 2369_mesa_marshal_Uniform4uiv(GLint location, GLsizei count, const GLuint * value) 2370{ 2371 GET_CURRENT_CONTEXT(ctx); 2372 int value_size = safe_mul(count, 4 * sizeof(GLuint)); 2373 int cmd_size = sizeof(struct marshal_cmd_Uniform4uiv) + value_size; 2374 struct marshal_cmd_Uniform4uiv *cmd; 2375 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 2376 _mesa_glthread_finish_before(ctx, "Uniform4uiv"); 2377 CALL_Uniform4uiv(ctx->CurrentServerDispatch, (location, count, value)); 2378 return; 2379 } 2380 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Uniform4uiv, cmd_size); 2381 cmd->location = location; 2382 cmd->count = count; 2383 char *variable_data = (char *) (cmd + 1); 2384 memcpy(variable_data, value, value_size); 2385} 2386 2387 2388/* GetUniformuiv: marshalled synchronously */ 2389void GLAPIENTRY 2390_mesa_marshal_GetUniformuiv(GLuint program, GLint location, GLuint * params) 2391{ 2392 GET_CURRENT_CONTEXT(ctx); 2393 _mesa_glthread_finish_before(ctx, "GetUniformuiv"); 2394 CALL_GetUniformuiv(ctx->CurrentServerDispatch, (program, location, params)); 2395} 2396 2397 2398/* BindFragDataLocation: marshalled asynchronously */ 2399struct marshal_cmd_BindFragDataLocation 2400{ 2401 struct marshal_cmd_base cmd_base; 2402 GLuint program; 2403 GLuint colorNumber; 2404 /* Next (strlen(name) + 1) bytes are GLchar name[(strlen(name) + 1)] */ 2405}; 2406uint32_t 2407_mesa_unmarshal_BindFragDataLocation(struct gl_context *ctx, const struct marshal_cmd_BindFragDataLocation *cmd, const uint64_t *last) 2408{ 2409 GLuint program = cmd->program; 2410 GLuint colorNumber = cmd->colorNumber; 2411 GLchar * name; 2412 const char *variable_data = (const char *) (cmd + 1); 2413 name = (GLchar *) variable_data; 2414 CALL_BindFragDataLocation(ctx->CurrentServerDispatch, (program, colorNumber, name)); 2415 return cmd->cmd_base.cmd_size; 2416} 2417void GLAPIENTRY 2418_mesa_marshal_BindFragDataLocation(GLuint program, GLuint colorNumber, const GLchar * name) 2419{ 2420 GET_CURRENT_CONTEXT(ctx); 2421 int name_size = (strlen(name) + 1); 2422 int cmd_size = sizeof(struct marshal_cmd_BindFragDataLocation) + name_size; 2423 struct marshal_cmd_BindFragDataLocation *cmd; 2424 if (unlikely(name_size < 0 || (name_size > 0 && !name) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 2425 _mesa_glthread_finish_before(ctx, "BindFragDataLocation"); 2426 CALL_BindFragDataLocation(ctx->CurrentServerDispatch, (program, colorNumber, name)); 2427 return; 2428 } 2429 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindFragDataLocation, cmd_size); 2430 cmd->program = program; 2431 cmd->colorNumber = colorNumber; 2432 char *variable_data = (char *) (cmd + 1); 2433 memcpy(variable_data, name, name_size); 2434} 2435 2436 2437/* GetFragDataLocation: marshalled synchronously */ 2438GLint GLAPIENTRY 2439_mesa_marshal_GetFragDataLocation(GLuint program, const GLchar * name) 2440{ 2441 GET_CURRENT_CONTEXT(ctx); 2442 _mesa_glthread_finish_before(ctx, "GetFragDataLocation"); 2443 return CALL_GetFragDataLocation(ctx->CurrentServerDispatch, (program, name)); 2444} 2445 2446 2447/* ClearBufferiv: marshalled asynchronously */ 2448struct marshal_cmd_ClearBufferiv 2449{ 2450 struct marshal_cmd_base cmd_base; 2451 GLenum buffer; 2452 GLint drawbuffer; 2453 /* Next safe_mul(_mesa_buffer_enum_to_count(buffer), 1 * sizeof(GLint)) bytes are GLint value[_mesa_buffer_enum_to_count(buffer)] */ 2454}; 2455uint32_t 2456_mesa_unmarshal_ClearBufferiv(struct gl_context *ctx, const struct marshal_cmd_ClearBufferiv *cmd, const uint64_t *last) 2457{ 2458 GLenum buffer = cmd->buffer; 2459 GLint drawbuffer = cmd->drawbuffer; 2460 GLint * value; 2461 const char *variable_data = (const char *) (cmd + 1); 2462 value = (GLint *) variable_data; 2463 CALL_ClearBufferiv(ctx->CurrentServerDispatch, (buffer, drawbuffer, value)); 2464 return cmd->cmd_base.cmd_size; 2465} 2466void GLAPIENTRY 2467_mesa_marshal_ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint * value) 2468{ 2469 GET_CURRENT_CONTEXT(ctx); 2470 int value_size = safe_mul(_mesa_buffer_enum_to_count(buffer), 1 * sizeof(GLint)); 2471 int cmd_size = sizeof(struct marshal_cmd_ClearBufferiv) + value_size; 2472 struct marshal_cmd_ClearBufferiv *cmd; 2473 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 2474 _mesa_glthread_finish_before(ctx, "ClearBufferiv"); 2475 CALL_ClearBufferiv(ctx->CurrentServerDispatch, (buffer, drawbuffer, value)); 2476 return; 2477 } 2478 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearBufferiv, cmd_size); 2479 cmd->buffer = buffer; 2480 cmd->drawbuffer = drawbuffer; 2481 char *variable_data = (char *) (cmd + 1); 2482 memcpy(variable_data, value, value_size); 2483} 2484 2485 2486/* ClearBufferuiv: marshalled asynchronously */ 2487struct marshal_cmd_ClearBufferuiv 2488{ 2489 struct marshal_cmd_base cmd_base; 2490 GLenum buffer; 2491 GLint drawbuffer; 2492 /* Next safe_mul(_mesa_buffer_enum_to_count(buffer), 1 * sizeof(GLuint)) bytes are GLuint value[_mesa_buffer_enum_to_count(buffer)] */ 2493}; 2494uint32_t 2495_mesa_unmarshal_ClearBufferuiv(struct gl_context *ctx, const struct marshal_cmd_ClearBufferuiv *cmd, const uint64_t *last) 2496{ 2497 GLenum buffer = cmd->buffer; 2498 GLint drawbuffer = cmd->drawbuffer; 2499 GLuint * value; 2500 const char *variable_data = (const char *) (cmd + 1); 2501 value = (GLuint *) variable_data; 2502 CALL_ClearBufferuiv(ctx->CurrentServerDispatch, (buffer, drawbuffer, value)); 2503 return cmd->cmd_base.cmd_size; 2504} 2505void GLAPIENTRY 2506_mesa_marshal_ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint * value) 2507{ 2508 GET_CURRENT_CONTEXT(ctx); 2509 int value_size = safe_mul(_mesa_buffer_enum_to_count(buffer), 1 * sizeof(GLuint)); 2510 int cmd_size = sizeof(struct marshal_cmd_ClearBufferuiv) + value_size; 2511 struct marshal_cmd_ClearBufferuiv *cmd; 2512 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 2513 _mesa_glthread_finish_before(ctx, "ClearBufferuiv"); 2514 CALL_ClearBufferuiv(ctx->CurrentServerDispatch, (buffer, drawbuffer, value)); 2515 return; 2516 } 2517 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearBufferuiv, cmd_size); 2518 cmd->buffer = buffer; 2519 cmd->drawbuffer = drawbuffer; 2520 char *variable_data = (char *) (cmd + 1); 2521 memcpy(variable_data, value, value_size); 2522} 2523 2524 2525/* ClearBufferfv: marshalled asynchronously */ 2526struct marshal_cmd_ClearBufferfv 2527{ 2528 struct marshal_cmd_base cmd_base; 2529 GLenum buffer; 2530 GLint drawbuffer; 2531 /* Next safe_mul(_mesa_buffer_enum_to_count(buffer), 1 * sizeof(GLfloat)) bytes are GLfloat value[_mesa_buffer_enum_to_count(buffer)] */ 2532}; 2533uint32_t 2534_mesa_unmarshal_ClearBufferfv(struct gl_context *ctx, const struct marshal_cmd_ClearBufferfv *cmd, const uint64_t *last) 2535{ 2536 GLenum buffer = cmd->buffer; 2537 GLint drawbuffer = cmd->drawbuffer; 2538 GLfloat * value; 2539 const char *variable_data = (const char *) (cmd + 1); 2540 value = (GLfloat *) variable_data; 2541 CALL_ClearBufferfv(ctx->CurrentServerDispatch, (buffer, drawbuffer, value)); 2542 return cmd->cmd_base.cmd_size; 2543} 2544void GLAPIENTRY 2545_mesa_marshal_ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat * value) 2546{ 2547 GET_CURRENT_CONTEXT(ctx); 2548 int value_size = safe_mul(_mesa_buffer_enum_to_count(buffer), 1 * sizeof(GLfloat)); 2549 int cmd_size = sizeof(struct marshal_cmd_ClearBufferfv) + value_size; 2550 struct marshal_cmd_ClearBufferfv *cmd; 2551 if (unlikely(value_size < 0 || (value_size > 0 && !value) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 2552 _mesa_glthread_finish_before(ctx, "ClearBufferfv"); 2553 CALL_ClearBufferfv(ctx->CurrentServerDispatch, (buffer, drawbuffer, value)); 2554 return; 2555 } 2556 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearBufferfv, cmd_size); 2557 cmd->buffer = buffer; 2558 cmd->drawbuffer = drawbuffer; 2559 char *variable_data = (char *) (cmd + 1); 2560 memcpy(variable_data, value, value_size); 2561} 2562 2563 2564/* ClearBufferfi: marshalled asynchronously */ 2565struct marshal_cmd_ClearBufferfi 2566{ 2567 struct marshal_cmd_base cmd_base; 2568 GLenum buffer; 2569 GLint drawbuffer; 2570 GLfloat depth; 2571 GLint stencil; 2572}; 2573uint32_t 2574_mesa_unmarshal_ClearBufferfi(struct gl_context *ctx, const struct marshal_cmd_ClearBufferfi *cmd, const uint64_t *last) 2575{ 2576 GLenum buffer = cmd->buffer; 2577 GLint drawbuffer = cmd->drawbuffer; 2578 GLfloat depth = cmd->depth; 2579 GLint stencil = cmd->stencil; 2580 CALL_ClearBufferfi(ctx->CurrentServerDispatch, (buffer, drawbuffer, depth, stencil)); 2581 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ClearBufferfi), 8) / 8); 2582 assert (cmd_size == cmd->cmd_base.cmd_size); 2583 return cmd_size; 2584} 2585void GLAPIENTRY 2586_mesa_marshal_ClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) 2587{ 2588 GET_CURRENT_CONTEXT(ctx); 2589 int cmd_size = sizeof(struct marshal_cmd_ClearBufferfi); 2590 struct marshal_cmd_ClearBufferfi *cmd; 2591 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearBufferfi, cmd_size); 2592 cmd->buffer = buffer; 2593 cmd->drawbuffer = drawbuffer; 2594 cmd->depth = depth; 2595 cmd->stencil = stencil; 2596} 2597 2598 2599/* GetStringi: marshalled synchronously */ 2600const GLubyte * GLAPIENTRY 2601_mesa_marshal_GetStringi(GLenum name, GLuint index) 2602{ 2603 GET_CURRENT_CONTEXT(ctx); 2604 _mesa_glthread_finish_before(ctx, "GetStringi"); 2605 return CALL_GetStringi(ctx->CurrentServerDispatch, (name, index)); 2606} 2607 2608 2609/* BeginTransformFeedback: marshalled asynchronously */ 2610struct marshal_cmd_BeginTransformFeedback 2611{ 2612 struct marshal_cmd_base cmd_base; 2613 GLenum mode; 2614}; 2615uint32_t 2616_mesa_unmarshal_BeginTransformFeedback(struct gl_context *ctx, const struct marshal_cmd_BeginTransformFeedback *cmd, const uint64_t *last) 2617{ 2618 GLenum mode = cmd->mode; 2619 CALL_BeginTransformFeedback(ctx->CurrentServerDispatch, (mode)); 2620 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BeginTransformFeedback), 8) / 8); 2621 assert (cmd_size == cmd->cmd_base.cmd_size); 2622 return cmd_size; 2623} 2624void GLAPIENTRY 2625_mesa_marshal_BeginTransformFeedback(GLenum mode) 2626{ 2627 GET_CURRENT_CONTEXT(ctx); 2628 int cmd_size = sizeof(struct marshal_cmd_BeginTransformFeedback); 2629 struct marshal_cmd_BeginTransformFeedback *cmd; 2630 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BeginTransformFeedback, cmd_size); 2631 cmd->mode = mode; 2632} 2633 2634 2635/* EndTransformFeedback: marshalled asynchronously */ 2636struct marshal_cmd_EndTransformFeedback 2637{ 2638 struct marshal_cmd_base cmd_base; 2639}; 2640uint32_t 2641_mesa_unmarshal_EndTransformFeedback(struct gl_context *ctx, const struct marshal_cmd_EndTransformFeedback *cmd, const uint64_t *last) 2642{ 2643 CALL_EndTransformFeedback(ctx->CurrentServerDispatch, ()); 2644 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_EndTransformFeedback), 8) / 8); 2645 assert (cmd_size == cmd->cmd_base.cmd_size); 2646 return cmd_size; 2647} 2648void GLAPIENTRY 2649_mesa_marshal_EndTransformFeedback(void) 2650{ 2651 GET_CURRENT_CONTEXT(ctx); 2652 int cmd_size = sizeof(struct marshal_cmd_EndTransformFeedback); 2653 struct marshal_cmd_EndTransformFeedback *cmd; 2654 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EndTransformFeedback, cmd_size); 2655 (void) cmd; 2656} 2657 2658 2659/* BindBufferRange: marshalled asynchronously */ 2660struct marshal_cmd_BindBufferRange 2661{ 2662 struct marshal_cmd_base cmd_base; 2663 GLenum target; 2664 GLuint index; 2665 GLuint buffer; 2666 GLintptr offset; 2667 GLsizeiptr size; 2668}; 2669uint32_t 2670_mesa_unmarshal_BindBufferRange(struct gl_context *ctx, const struct marshal_cmd_BindBufferRange *cmd, const uint64_t *last) 2671{ 2672 GLenum target = cmd->target; 2673 GLuint index = cmd->index; 2674 GLuint buffer = cmd->buffer; 2675 GLintptr offset = cmd->offset; 2676 GLsizeiptr size = cmd->size; 2677 CALL_BindBufferRange(ctx->CurrentServerDispatch, (target, index, buffer, offset, size)); 2678 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindBufferRange), 8) / 8); 2679 assert (cmd_size == cmd->cmd_base.cmd_size); 2680 return cmd_size; 2681} 2682void GLAPIENTRY 2683_mesa_marshal_BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) 2684{ 2685 GET_CURRENT_CONTEXT(ctx); 2686 int cmd_size = sizeof(struct marshal_cmd_BindBufferRange); 2687 struct marshal_cmd_BindBufferRange *cmd; 2688 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindBufferRange, cmd_size); 2689 cmd->target = target; 2690 cmd->index = index; 2691 cmd->buffer = buffer; 2692 cmd->offset = offset; 2693 cmd->size = size; 2694} 2695 2696 2697/* BindBufferBase: marshalled asynchronously */ 2698struct marshal_cmd_BindBufferBase 2699{ 2700 struct marshal_cmd_base cmd_base; 2701 GLenum target; 2702 GLuint index; 2703 GLuint buffer; 2704}; 2705uint32_t 2706_mesa_unmarshal_BindBufferBase(struct gl_context *ctx, const struct marshal_cmd_BindBufferBase *cmd, const uint64_t *last) 2707{ 2708 GLenum target = cmd->target; 2709 GLuint index = cmd->index; 2710 GLuint buffer = cmd->buffer; 2711 CALL_BindBufferBase(ctx->CurrentServerDispatch, (target, index, buffer)); 2712 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindBufferBase), 8) / 8); 2713 assert (cmd_size == cmd->cmd_base.cmd_size); 2714 return cmd_size; 2715} 2716void GLAPIENTRY 2717_mesa_marshal_BindBufferBase(GLenum target, GLuint index, GLuint buffer) 2718{ 2719 GET_CURRENT_CONTEXT(ctx); 2720 int cmd_size = sizeof(struct marshal_cmd_BindBufferBase); 2721 struct marshal_cmd_BindBufferBase *cmd; 2722 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindBufferBase, cmd_size); 2723 cmd->target = target; 2724 cmd->index = index; 2725 cmd->buffer = buffer; 2726} 2727 2728 2729/* TransformFeedbackVaryings: marshalled synchronously */ 2730void GLAPIENTRY 2731_mesa_marshal_TransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar * const * varyings, GLenum bufferMode) 2732{ 2733 GET_CURRENT_CONTEXT(ctx); 2734 _mesa_glthread_finish_before(ctx, "TransformFeedbackVaryings"); 2735 CALL_TransformFeedbackVaryings(ctx->CurrentServerDispatch, (program, count, varyings, bufferMode)); 2736} 2737 2738 2739/* GetTransformFeedbackVarying: marshalled synchronously */ 2740void GLAPIENTRY 2741_mesa_marshal_GetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei * length, GLsizei * size, GLenum * type, GLchar * name) 2742{ 2743 GET_CURRENT_CONTEXT(ctx); 2744 _mesa_glthread_finish_before(ctx, "GetTransformFeedbackVarying"); 2745 CALL_GetTransformFeedbackVarying(ctx->CurrentServerDispatch, (program, index, bufSize, length, size, type, name)); 2746} 2747 2748 2749/* BeginConditionalRender: marshalled asynchronously */ 2750struct marshal_cmd_BeginConditionalRender 2751{ 2752 struct marshal_cmd_base cmd_base; 2753 GLuint query; 2754 GLenum mode; 2755}; 2756uint32_t 2757_mesa_unmarshal_BeginConditionalRender(struct gl_context *ctx, const struct marshal_cmd_BeginConditionalRender *cmd, const uint64_t *last) 2758{ 2759 GLuint query = cmd->query; 2760 GLenum mode = cmd->mode; 2761 CALL_BeginConditionalRender(ctx->CurrentServerDispatch, (query, mode)); 2762 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BeginConditionalRender), 8) / 8); 2763 assert (cmd_size == cmd->cmd_base.cmd_size); 2764 return cmd_size; 2765} 2766void GLAPIENTRY 2767_mesa_marshal_BeginConditionalRender(GLuint query, GLenum mode) 2768{ 2769 GET_CURRENT_CONTEXT(ctx); 2770 int cmd_size = sizeof(struct marshal_cmd_BeginConditionalRender); 2771 struct marshal_cmd_BeginConditionalRender *cmd; 2772 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BeginConditionalRender, cmd_size); 2773 cmd->query = query; 2774 cmd->mode = mode; 2775} 2776 2777 2778/* EndConditionalRender: marshalled asynchronously */ 2779struct marshal_cmd_EndConditionalRender 2780{ 2781 struct marshal_cmd_base cmd_base; 2782}; 2783uint32_t 2784_mesa_unmarshal_EndConditionalRender(struct gl_context *ctx, const struct marshal_cmd_EndConditionalRender *cmd, const uint64_t *last) 2785{ 2786 CALL_EndConditionalRender(ctx->CurrentServerDispatch, ()); 2787 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_EndConditionalRender), 8) / 8); 2788 assert (cmd_size == cmd->cmd_base.cmd_size); 2789 return cmd_size; 2790} 2791void GLAPIENTRY 2792_mesa_marshal_EndConditionalRender(void) 2793{ 2794 GET_CURRENT_CONTEXT(ctx); 2795 int cmd_size = sizeof(struct marshal_cmd_EndConditionalRender); 2796 struct marshal_cmd_EndConditionalRender *cmd; 2797 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_EndConditionalRender, cmd_size); 2798 (void) cmd; 2799} 2800 2801 2802/* PrimitiveRestartIndex: marshalled asynchronously */ 2803struct marshal_cmd_PrimitiveRestartIndex 2804{ 2805 struct marshal_cmd_base cmd_base; 2806 GLuint index; 2807}; 2808uint32_t 2809_mesa_unmarshal_PrimitiveRestartIndex(struct gl_context *ctx, const struct marshal_cmd_PrimitiveRestartIndex *cmd, const uint64_t *last) 2810{ 2811 GLuint index = cmd->index; 2812 CALL_PrimitiveRestartIndex(ctx->CurrentServerDispatch, (index)); 2813 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PrimitiveRestartIndex), 8) / 8); 2814 assert (cmd_size == cmd->cmd_base.cmd_size); 2815 return cmd_size; 2816} 2817void GLAPIENTRY 2818_mesa_marshal_PrimitiveRestartIndex(GLuint index) 2819{ 2820 GET_CURRENT_CONTEXT(ctx); 2821 int cmd_size = sizeof(struct marshal_cmd_PrimitiveRestartIndex); 2822 struct marshal_cmd_PrimitiveRestartIndex *cmd; 2823 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PrimitiveRestartIndex, cmd_size); 2824 cmd->index = index; 2825 _mesa_glthread_PrimitiveRestartIndex(ctx, index); 2826} 2827 2828 2829/* GetInteger64i_v: marshalled synchronously */ 2830void GLAPIENTRY 2831_mesa_marshal_GetInteger64i_v(GLenum cap, GLuint index, GLint64 * data) 2832{ 2833 GET_CURRENT_CONTEXT(ctx); 2834 _mesa_glthread_finish_before(ctx, "GetInteger64i_v"); 2835 CALL_GetInteger64i_v(ctx->CurrentServerDispatch, (cap, index, data)); 2836} 2837 2838 2839/* GetBufferParameteri64v: marshalled synchronously */ 2840void GLAPIENTRY 2841_mesa_marshal_GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 * params) 2842{ 2843 GET_CURRENT_CONTEXT(ctx); 2844 _mesa_glthread_finish_before(ctx, "GetBufferParameteri64v"); 2845 CALL_GetBufferParameteri64v(ctx->CurrentServerDispatch, (target, pname, params)); 2846} 2847 2848 2849/* FramebufferTexture: marshalled asynchronously */ 2850struct marshal_cmd_FramebufferTexture 2851{ 2852 struct marshal_cmd_base cmd_base; 2853 GLenum target; 2854 GLenum attachment; 2855 GLuint texture; 2856 GLint level; 2857}; 2858uint32_t 2859_mesa_unmarshal_FramebufferTexture(struct gl_context *ctx, const struct marshal_cmd_FramebufferTexture *cmd, const uint64_t *last) 2860{ 2861 GLenum target = cmd->target; 2862 GLenum attachment = cmd->attachment; 2863 GLuint texture = cmd->texture; 2864 GLint level = cmd->level; 2865 CALL_FramebufferTexture(ctx->CurrentServerDispatch, (target, attachment, texture, level)); 2866 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FramebufferTexture), 8) / 8); 2867 assert (cmd_size == cmd->cmd_base.cmd_size); 2868 return cmd_size; 2869} 2870void GLAPIENTRY 2871_mesa_marshal_FramebufferTexture(GLenum target, GLenum attachment, GLuint texture, GLint level) 2872{ 2873 GET_CURRENT_CONTEXT(ctx); 2874 int cmd_size = sizeof(struct marshal_cmd_FramebufferTexture); 2875 struct marshal_cmd_FramebufferTexture *cmd; 2876 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferTexture, cmd_size); 2877 cmd->target = target; 2878 cmd->attachment = attachment; 2879 cmd->texture = texture; 2880 cmd->level = level; 2881} 2882 2883 2884/* PrimitiveRestartNV: marshalled asynchronously */ 2885struct marshal_cmd_PrimitiveRestartNV 2886{ 2887 struct marshal_cmd_base cmd_base; 2888}; 2889uint32_t 2890_mesa_unmarshal_PrimitiveRestartNV(struct gl_context *ctx, const struct marshal_cmd_PrimitiveRestartNV *cmd, const uint64_t *last) 2891{ 2892 CALL_PrimitiveRestartNV(ctx->CurrentServerDispatch, ()); 2893 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PrimitiveRestartNV), 8) / 8); 2894 assert (cmd_size == cmd->cmd_base.cmd_size); 2895 return cmd_size; 2896} 2897void GLAPIENTRY 2898_mesa_marshal_PrimitiveRestartNV(void) 2899{ 2900 GET_CURRENT_CONTEXT(ctx); 2901 int cmd_size = sizeof(struct marshal_cmd_PrimitiveRestartNV); 2902 struct marshal_cmd_PrimitiveRestartNV *cmd; 2903 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PrimitiveRestartNV, cmd_size); 2904 (void) cmd; 2905} 2906 2907 2908/* BindBufferOffsetEXT: marshalled asynchronously */ 2909struct marshal_cmd_BindBufferOffsetEXT 2910{ 2911 struct marshal_cmd_base cmd_base; 2912 GLenum target; 2913 GLuint index; 2914 GLuint buffer; 2915 GLintptr offset; 2916}; 2917uint32_t 2918_mesa_unmarshal_BindBufferOffsetEXT(struct gl_context *ctx, const struct marshal_cmd_BindBufferOffsetEXT *cmd, const uint64_t *last) 2919{ 2920 GLenum target = cmd->target; 2921 GLuint index = cmd->index; 2922 GLuint buffer = cmd->buffer; 2923 GLintptr offset = cmd->offset; 2924 CALL_BindBufferOffsetEXT(ctx->CurrentServerDispatch, (target, index, buffer, offset)); 2925 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindBufferOffsetEXT), 8) / 8); 2926 assert (cmd_size == cmd->cmd_base.cmd_size); 2927 return cmd_size; 2928} 2929void GLAPIENTRY 2930_mesa_marshal_BindBufferOffsetEXT(GLenum target, GLuint index, GLuint buffer, GLintptr offset) 2931{ 2932 GET_CURRENT_CONTEXT(ctx); 2933 int cmd_size = sizeof(struct marshal_cmd_BindBufferOffsetEXT); 2934 struct marshal_cmd_BindBufferOffsetEXT *cmd; 2935 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindBufferOffsetEXT, cmd_size); 2936 cmd->target = target; 2937 cmd->index = index; 2938 cmd->buffer = buffer; 2939 cmd->offset = offset; 2940} 2941 2942 2943/* BindTransformFeedback: marshalled asynchronously */ 2944struct marshal_cmd_BindTransformFeedback 2945{ 2946 struct marshal_cmd_base cmd_base; 2947 GLenum target; 2948 GLuint id; 2949}; 2950uint32_t 2951_mesa_unmarshal_BindTransformFeedback(struct gl_context *ctx, const struct marshal_cmd_BindTransformFeedback *cmd, const uint64_t *last) 2952{ 2953 GLenum target = cmd->target; 2954 GLuint id = cmd->id; 2955 CALL_BindTransformFeedback(ctx->CurrentServerDispatch, (target, id)); 2956 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BindTransformFeedback), 8) / 8); 2957 assert (cmd_size == cmd->cmd_base.cmd_size); 2958 return cmd_size; 2959} 2960void GLAPIENTRY 2961_mesa_marshal_BindTransformFeedback(GLenum target, GLuint id) 2962{ 2963 GET_CURRENT_CONTEXT(ctx); 2964 int cmd_size = sizeof(struct marshal_cmd_BindTransformFeedback); 2965 struct marshal_cmd_BindTransformFeedback *cmd; 2966 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BindTransformFeedback, cmd_size); 2967 cmd->target = target; 2968 cmd->id = id; 2969} 2970 2971 2972/* DeleteTransformFeedbacks: marshalled asynchronously */ 2973struct marshal_cmd_DeleteTransformFeedbacks 2974{ 2975 struct marshal_cmd_base cmd_base; 2976 GLsizei n; 2977 /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint ids[n] */ 2978}; 2979uint32_t 2980_mesa_unmarshal_DeleteTransformFeedbacks(struct gl_context *ctx, const struct marshal_cmd_DeleteTransformFeedbacks *cmd, const uint64_t *last) 2981{ 2982 GLsizei n = cmd->n; 2983 GLuint * ids; 2984 const char *variable_data = (const char *) (cmd + 1); 2985 ids = (GLuint *) variable_data; 2986 CALL_DeleteTransformFeedbacks(ctx->CurrentServerDispatch, (n, ids)); 2987 return cmd->cmd_base.cmd_size; 2988} 2989void GLAPIENTRY 2990_mesa_marshal_DeleteTransformFeedbacks(GLsizei n, const GLuint * ids) 2991{ 2992 GET_CURRENT_CONTEXT(ctx); 2993 int ids_size = safe_mul(n, 1 * sizeof(GLuint)); 2994 int cmd_size = sizeof(struct marshal_cmd_DeleteTransformFeedbacks) + ids_size; 2995 struct marshal_cmd_DeleteTransformFeedbacks *cmd; 2996 if (unlikely(ids_size < 0 || (ids_size > 0 && !ids) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 2997 _mesa_glthread_finish_before(ctx, "DeleteTransformFeedbacks"); 2998 CALL_DeleteTransformFeedbacks(ctx->CurrentServerDispatch, (n, ids)); 2999 return; 3000 } 3001 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteTransformFeedbacks, cmd_size); 3002 cmd->n = n; 3003 char *variable_data = (char *) (cmd + 1); 3004 memcpy(variable_data, ids, ids_size); 3005} 3006 3007 3008/* GenTransformFeedbacks: marshalled synchronously */ 3009void GLAPIENTRY 3010_mesa_marshal_GenTransformFeedbacks(GLsizei n, GLuint * ids) 3011{ 3012 GET_CURRENT_CONTEXT(ctx); 3013 _mesa_glthread_finish_before(ctx, "GenTransformFeedbacks"); 3014 CALL_GenTransformFeedbacks(ctx->CurrentServerDispatch, (n, ids)); 3015} 3016 3017 3018/* IsTransformFeedback: marshalled synchronously */ 3019GLboolean GLAPIENTRY 3020_mesa_marshal_IsTransformFeedback(GLuint id) 3021{ 3022 GET_CURRENT_CONTEXT(ctx); 3023 _mesa_glthread_finish_before(ctx, "IsTransformFeedback"); 3024 return CALL_IsTransformFeedback(ctx->CurrentServerDispatch, (id)); 3025} 3026 3027 3028/* PauseTransformFeedback: marshalled asynchronously */ 3029struct marshal_cmd_PauseTransformFeedback 3030{ 3031 struct marshal_cmd_base cmd_base; 3032}; 3033uint32_t 3034_mesa_unmarshal_PauseTransformFeedback(struct gl_context *ctx, const struct marshal_cmd_PauseTransformFeedback *cmd, const uint64_t *last) 3035{ 3036 CALL_PauseTransformFeedback(ctx->CurrentServerDispatch, ()); 3037 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PauseTransformFeedback), 8) / 8); 3038 assert (cmd_size == cmd->cmd_base.cmd_size); 3039 return cmd_size; 3040} 3041void GLAPIENTRY 3042_mesa_marshal_PauseTransformFeedback(void) 3043{ 3044 GET_CURRENT_CONTEXT(ctx); 3045 int cmd_size = sizeof(struct marshal_cmd_PauseTransformFeedback); 3046 struct marshal_cmd_PauseTransformFeedback *cmd; 3047 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PauseTransformFeedback, cmd_size); 3048 (void) cmd; 3049} 3050 3051 3052/* ResumeTransformFeedback: marshalled asynchronously */ 3053struct marshal_cmd_ResumeTransformFeedback 3054{ 3055 struct marshal_cmd_base cmd_base; 3056}; 3057uint32_t 3058_mesa_unmarshal_ResumeTransformFeedback(struct gl_context *ctx, const struct marshal_cmd_ResumeTransformFeedback *cmd, const uint64_t *last) 3059{ 3060 CALL_ResumeTransformFeedback(ctx->CurrentServerDispatch, ()); 3061 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ResumeTransformFeedback), 8) / 8); 3062 assert (cmd_size == cmd->cmd_base.cmd_size); 3063 return cmd_size; 3064} 3065void GLAPIENTRY 3066_mesa_marshal_ResumeTransformFeedback(void) 3067{ 3068 GET_CURRENT_CONTEXT(ctx); 3069 int cmd_size = sizeof(struct marshal_cmd_ResumeTransformFeedback); 3070 struct marshal_cmd_ResumeTransformFeedback *cmd; 3071 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ResumeTransformFeedback, cmd_size); 3072 (void) cmd; 3073} 3074 3075 3076/* DrawTransformFeedback: marshalled asynchronously */ 3077struct marshal_cmd_DrawTransformFeedback 3078{ 3079 struct marshal_cmd_base cmd_base; 3080 GLenum mode; 3081 GLuint id; 3082}; 3083uint32_t 3084_mesa_unmarshal_DrawTransformFeedback(struct gl_context *ctx, const struct marshal_cmd_DrawTransformFeedback *cmd, const uint64_t *last) 3085{ 3086 GLenum mode = cmd->mode; 3087 GLuint id = cmd->id; 3088 CALL_DrawTransformFeedback(ctx->CurrentServerDispatch, (mode, id)); 3089 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawTransformFeedback), 8) / 8); 3090 assert (cmd_size == cmd->cmd_base.cmd_size); 3091 return cmd_size; 3092} 3093void GLAPIENTRY 3094_mesa_marshal_DrawTransformFeedback(GLenum mode, GLuint id) 3095{ 3096 GET_CURRENT_CONTEXT(ctx); 3097 int cmd_size = sizeof(struct marshal_cmd_DrawTransformFeedback); 3098 struct marshal_cmd_DrawTransformFeedback *cmd; 3099 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTransformFeedback, cmd_size); 3100 cmd->mode = mode; 3101 cmd->id = id; 3102} 3103 3104 3105/* VDPAUInitNV: marshalled synchronously */ 3106void GLAPIENTRY 3107_mesa_marshal_VDPAUInitNV(const GLvoid * vdpDevice, const GLvoid * getProcAddress) 3108{ 3109 GET_CURRENT_CONTEXT(ctx); 3110 _mesa_glthread_finish_before(ctx, "VDPAUInitNV"); 3111 CALL_VDPAUInitNV(ctx->CurrentServerDispatch, (vdpDevice, getProcAddress)); 3112} 3113 3114 3115/* VDPAUFiniNV: marshalled asynchronously */ 3116struct marshal_cmd_VDPAUFiniNV 3117{ 3118 struct marshal_cmd_base cmd_base; 3119}; 3120uint32_t 3121_mesa_unmarshal_VDPAUFiniNV(struct gl_context *ctx, const struct marshal_cmd_VDPAUFiniNV *cmd, const uint64_t *last) 3122{ 3123 CALL_VDPAUFiniNV(ctx->CurrentServerDispatch, ()); 3124 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VDPAUFiniNV), 8) / 8); 3125 assert (cmd_size == cmd->cmd_base.cmd_size); 3126 return cmd_size; 3127} 3128void GLAPIENTRY 3129_mesa_marshal_VDPAUFiniNV(void) 3130{ 3131 GET_CURRENT_CONTEXT(ctx); 3132 int cmd_size = sizeof(struct marshal_cmd_VDPAUFiniNV); 3133 struct marshal_cmd_VDPAUFiniNV *cmd; 3134 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VDPAUFiniNV, cmd_size); 3135 (void) cmd; 3136} 3137 3138 3139/* VDPAURegisterVideoSurfaceNV: marshalled synchronously */ 3140GLintptr GLAPIENTRY 3141_mesa_marshal_VDPAURegisterVideoSurfaceNV(const GLvoid * vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint * textureNames) 3142{ 3143 GET_CURRENT_CONTEXT(ctx); 3144 _mesa_glthread_finish_before(ctx, "VDPAURegisterVideoSurfaceNV"); 3145 return CALL_VDPAURegisterVideoSurfaceNV(ctx->CurrentServerDispatch, (vdpSurface, target, numTextureNames, textureNames)); 3146} 3147 3148 3149/* VDPAURegisterOutputSurfaceNV: marshalled synchronously */ 3150GLintptr GLAPIENTRY 3151_mesa_marshal_VDPAURegisterOutputSurfaceNV(const GLvoid * vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint * textureNames) 3152{ 3153 GET_CURRENT_CONTEXT(ctx); 3154 _mesa_glthread_finish_before(ctx, "VDPAURegisterOutputSurfaceNV"); 3155 return CALL_VDPAURegisterOutputSurfaceNV(ctx->CurrentServerDispatch, (vdpSurface, target, numTextureNames, textureNames)); 3156} 3157 3158 3159/* VDPAUIsSurfaceNV: marshalled synchronously */ 3160GLboolean GLAPIENTRY 3161_mesa_marshal_VDPAUIsSurfaceNV(GLintptr surface) 3162{ 3163 GET_CURRENT_CONTEXT(ctx); 3164 _mesa_glthread_finish_before(ctx, "VDPAUIsSurfaceNV"); 3165 return CALL_VDPAUIsSurfaceNV(ctx->CurrentServerDispatch, (surface)); 3166} 3167 3168 3169/* VDPAUUnregisterSurfaceNV: marshalled asynchronously */ 3170struct marshal_cmd_VDPAUUnregisterSurfaceNV 3171{ 3172 struct marshal_cmd_base cmd_base; 3173 GLintptr surface; 3174}; 3175uint32_t 3176_mesa_unmarshal_VDPAUUnregisterSurfaceNV(struct gl_context *ctx, const struct marshal_cmd_VDPAUUnregisterSurfaceNV *cmd, const uint64_t *last) 3177{ 3178 GLintptr surface = cmd->surface; 3179 CALL_VDPAUUnregisterSurfaceNV(ctx->CurrentServerDispatch, (surface)); 3180 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VDPAUUnregisterSurfaceNV), 8) / 8); 3181 assert (cmd_size == cmd->cmd_base.cmd_size); 3182 return cmd_size; 3183} 3184void GLAPIENTRY 3185_mesa_marshal_VDPAUUnregisterSurfaceNV(GLintptr surface) 3186{ 3187 GET_CURRENT_CONTEXT(ctx); 3188 int cmd_size = sizeof(struct marshal_cmd_VDPAUUnregisterSurfaceNV); 3189 struct marshal_cmd_VDPAUUnregisterSurfaceNV *cmd; 3190 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VDPAUUnregisterSurfaceNV, cmd_size); 3191 cmd->surface = surface; 3192} 3193 3194 3195/* VDPAUGetSurfaceivNV: marshalled synchronously */ 3196void GLAPIENTRY 3197_mesa_marshal_VDPAUGetSurfaceivNV(GLintptr surface, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * values) 3198{ 3199 GET_CURRENT_CONTEXT(ctx); 3200 _mesa_glthread_finish_before(ctx, "VDPAUGetSurfaceivNV"); 3201 CALL_VDPAUGetSurfaceivNV(ctx->CurrentServerDispatch, (surface, pname, bufSize, length, values)); 3202} 3203 3204 3205/* VDPAUSurfaceAccessNV: marshalled asynchronously */ 3206struct marshal_cmd_VDPAUSurfaceAccessNV 3207{ 3208 struct marshal_cmd_base cmd_base; 3209 GLenum access; 3210 GLintptr surface; 3211}; 3212uint32_t 3213_mesa_unmarshal_VDPAUSurfaceAccessNV(struct gl_context *ctx, const struct marshal_cmd_VDPAUSurfaceAccessNV *cmd, const uint64_t *last) 3214{ 3215 GLintptr surface = cmd->surface; 3216 GLenum access = cmd->access; 3217 CALL_VDPAUSurfaceAccessNV(ctx->CurrentServerDispatch, (surface, access)); 3218 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VDPAUSurfaceAccessNV), 8) / 8); 3219 assert (cmd_size == cmd->cmd_base.cmd_size); 3220 return cmd_size; 3221} 3222void GLAPIENTRY 3223_mesa_marshal_VDPAUSurfaceAccessNV(GLintptr surface, GLenum access) 3224{ 3225 GET_CURRENT_CONTEXT(ctx); 3226 int cmd_size = sizeof(struct marshal_cmd_VDPAUSurfaceAccessNV); 3227 struct marshal_cmd_VDPAUSurfaceAccessNV *cmd; 3228 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VDPAUSurfaceAccessNV, cmd_size); 3229 cmd->surface = surface; 3230 cmd->access = access; 3231} 3232 3233 3234/* VDPAUMapSurfacesNV: marshalled asynchronously */ 3235struct marshal_cmd_VDPAUMapSurfacesNV 3236{ 3237 struct marshal_cmd_base cmd_base; 3238 GLsizei numSurfaces; 3239 /* Next safe_mul(numSurfaces, 1 * sizeof(GLintptr)) bytes are GLintptr surfaces[numSurfaces] */ 3240}; 3241uint32_t 3242_mesa_unmarshal_VDPAUMapSurfacesNV(struct gl_context *ctx, const struct marshal_cmd_VDPAUMapSurfacesNV *cmd, const uint64_t *last) 3243{ 3244 GLsizei numSurfaces = cmd->numSurfaces; 3245 GLintptr * surfaces; 3246 const char *variable_data = (const char *) (cmd + 1); 3247 surfaces = (GLintptr *) variable_data; 3248 CALL_VDPAUMapSurfacesNV(ctx->CurrentServerDispatch, (numSurfaces, surfaces)); 3249 return cmd->cmd_base.cmd_size; 3250} 3251void GLAPIENTRY 3252_mesa_marshal_VDPAUMapSurfacesNV(GLsizei numSurfaces, const GLintptr * surfaces) 3253{ 3254 GET_CURRENT_CONTEXT(ctx); 3255 int surfaces_size = safe_mul(numSurfaces, 1 * sizeof(GLintptr)); 3256 int cmd_size = sizeof(struct marshal_cmd_VDPAUMapSurfacesNV) + surfaces_size; 3257 struct marshal_cmd_VDPAUMapSurfacesNV *cmd; 3258 if (unlikely(surfaces_size < 0 || (surfaces_size > 0 && !surfaces) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 3259 _mesa_glthread_finish_before(ctx, "VDPAUMapSurfacesNV"); 3260 CALL_VDPAUMapSurfacesNV(ctx->CurrentServerDispatch, (numSurfaces, surfaces)); 3261 return; 3262 } 3263 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VDPAUMapSurfacesNV, cmd_size); 3264 cmd->numSurfaces = numSurfaces; 3265 char *variable_data = (char *) (cmd + 1); 3266 memcpy(variable_data, surfaces, surfaces_size); 3267} 3268 3269 3270/* VDPAUUnmapSurfacesNV: marshalled asynchronously */ 3271struct marshal_cmd_VDPAUUnmapSurfacesNV 3272{ 3273 struct marshal_cmd_base cmd_base; 3274 GLsizei numSurfaces; 3275 /* Next safe_mul(numSurfaces, 1 * sizeof(GLintptr)) bytes are GLintptr surfaces[numSurfaces] */ 3276}; 3277uint32_t 3278_mesa_unmarshal_VDPAUUnmapSurfacesNV(struct gl_context *ctx, const struct marshal_cmd_VDPAUUnmapSurfacesNV *cmd, const uint64_t *last) 3279{ 3280 GLsizei numSurfaces = cmd->numSurfaces; 3281 GLintptr * surfaces; 3282 const char *variable_data = (const char *) (cmd + 1); 3283 surfaces = (GLintptr *) variable_data; 3284 CALL_VDPAUUnmapSurfacesNV(ctx->CurrentServerDispatch, (numSurfaces, surfaces)); 3285 return cmd->cmd_base.cmd_size; 3286} 3287void GLAPIENTRY 3288_mesa_marshal_VDPAUUnmapSurfacesNV(GLsizei numSurfaces, const GLintptr * surfaces) 3289{ 3290 GET_CURRENT_CONTEXT(ctx); 3291 int surfaces_size = safe_mul(numSurfaces, 1 * sizeof(GLintptr)); 3292 int cmd_size = sizeof(struct marshal_cmd_VDPAUUnmapSurfacesNV) + surfaces_size; 3293 struct marshal_cmd_VDPAUUnmapSurfacesNV *cmd; 3294 if (unlikely(surfaces_size < 0 || (surfaces_size > 0 && !surfaces) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 3295 _mesa_glthread_finish_before(ctx, "VDPAUUnmapSurfacesNV"); 3296 CALL_VDPAUUnmapSurfacesNV(ctx->CurrentServerDispatch, (numSurfaces, surfaces)); 3297 return; 3298 } 3299 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VDPAUUnmapSurfacesNV, cmd_size); 3300 cmd->numSurfaces = numSurfaces; 3301 char *variable_data = (char *) (cmd + 1); 3302 memcpy(variable_data, surfaces, surfaces_size); 3303} 3304 3305 3306/* GetUnsignedBytevEXT: marshalled synchronously */ 3307void GLAPIENTRY 3308_mesa_marshal_GetUnsignedBytevEXT(GLenum pname, GLubyte * data) 3309{ 3310 GET_CURRENT_CONTEXT(ctx); 3311 _mesa_glthread_finish_before(ctx, "GetUnsignedBytevEXT"); 3312 CALL_GetUnsignedBytevEXT(ctx->CurrentServerDispatch, (pname, data)); 3313} 3314 3315 3316/* GetUnsignedBytei_vEXT: marshalled synchronously */ 3317void GLAPIENTRY 3318_mesa_marshal_GetUnsignedBytei_vEXT(GLenum target, GLuint index, GLubyte * data) 3319{ 3320 GET_CURRENT_CONTEXT(ctx); 3321 _mesa_glthread_finish_before(ctx, "GetUnsignedBytei_vEXT"); 3322 CALL_GetUnsignedBytei_vEXT(ctx->CurrentServerDispatch, (target, index, data)); 3323} 3324 3325 3326/* DeleteMemoryObjectsEXT: marshalled asynchronously */ 3327struct marshal_cmd_DeleteMemoryObjectsEXT 3328{ 3329 struct marshal_cmd_base cmd_base; 3330 GLsizei n; 3331 /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint memoryObjects[n] */ 3332}; 3333uint32_t 3334_mesa_unmarshal_DeleteMemoryObjectsEXT(struct gl_context *ctx, const struct marshal_cmd_DeleteMemoryObjectsEXT *cmd, const uint64_t *last) 3335{ 3336 GLsizei n = cmd->n; 3337 GLuint * memoryObjects; 3338 const char *variable_data = (const char *) (cmd + 1); 3339 memoryObjects = (GLuint *) variable_data; 3340 CALL_DeleteMemoryObjectsEXT(ctx->CurrentServerDispatch, (n, memoryObjects)); 3341 return cmd->cmd_base.cmd_size; 3342} 3343void GLAPIENTRY 3344_mesa_marshal_DeleteMemoryObjectsEXT(GLsizei n, const GLuint * memoryObjects) 3345{ 3346 GET_CURRENT_CONTEXT(ctx); 3347 int memoryObjects_size = safe_mul(n, 1 * sizeof(GLuint)); 3348 int cmd_size = sizeof(struct marshal_cmd_DeleteMemoryObjectsEXT) + memoryObjects_size; 3349 struct marshal_cmd_DeleteMemoryObjectsEXT *cmd; 3350 if (unlikely(memoryObjects_size < 0 || (memoryObjects_size > 0 && !memoryObjects) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 3351 _mesa_glthread_finish_before(ctx, "DeleteMemoryObjectsEXT"); 3352 CALL_DeleteMemoryObjectsEXT(ctx->CurrentServerDispatch, (n, memoryObjects)); 3353 return; 3354 } 3355 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteMemoryObjectsEXT, cmd_size); 3356 cmd->n = n; 3357 char *variable_data = (char *) (cmd + 1); 3358 memcpy(variable_data, memoryObjects, memoryObjects_size); 3359} 3360 3361 3362/* IsMemoryObjectEXT: marshalled synchronously */ 3363GLboolean GLAPIENTRY 3364_mesa_marshal_IsMemoryObjectEXT(GLuint memoryObject) 3365{ 3366 GET_CURRENT_CONTEXT(ctx); 3367 _mesa_glthread_finish_before(ctx, "IsMemoryObjectEXT"); 3368 return CALL_IsMemoryObjectEXT(ctx->CurrentServerDispatch, (memoryObject)); 3369} 3370 3371 3372/* CreateMemoryObjectsEXT: marshalled synchronously */ 3373void GLAPIENTRY 3374_mesa_marshal_CreateMemoryObjectsEXT(GLsizei n, GLuint * memoryObjects) 3375{ 3376 GET_CURRENT_CONTEXT(ctx); 3377 _mesa_glthread_finish_before(ctx, "CreateMemoryObjectsEXT"); 3378 CALL_CreateMemoryObjectsEXT(ctx->CurrentServerDispatch, (n, memoryObjects)); 3379} 3380 3381 3382/* MemoryObjectParameterivEXT: marshalled asynchronously */ 3383struct marshal_cmd_MemoryObjectParameterivEXT 3384{ 3385 struct marshal_cmd_base cmd_base; 3386 GLuint memoryObject; 3387 GLenum pname; 3388 /* Next safe_mul(_mesa_memobj_enum_to_count(pname), 1 * sizeof(GLint)) bytes are GLint params[_mesa_memobj_enum_to_count(pname)] */ 3389}; 3390uint32_t 3391_mesa_unmarshal_MemoryObjectParameterivEXT(struct gl_context *ctx, const struct marshal_cmd_MemoryObjectParameterivEXT *cmd, const uint64_t *last) 3392{ 3393 GLuint memoryObject = cmd->memoryObject; 3394 GLenum pname = cmd->pname; 3395 GLint * params; 3396 const char *variable_data = (const char *) (cmd + 1); 3397 params = (GLint *) variable_data; 3398 CALL_MemoryObjectParameterivEXT(ctx->CurrentServerDispatch, (memoryObject, pname, params)); 3399 return cmd->cmd_base.cmd_size; 3400} 3401void GLAPIENTRY 3402_mesa_marshal_MemoryObjectParameterivEXT(GLuint memoryObject, GLenum pname, const GLint * params) 3403{ 3404 GET_CURRENT_CONTEXT(ctx); 3405 int params_size = safe_mul(_mesa_memobj_enum_to_count(pname), 1 * sizeof(GLint)); 3406 int cmd_size = sizeof(struct marshal_cmd_MemoryObjectParameterivEXT) + params_size; 3407 struct marshal_cmd_MemoryObjectParameterivEXT *cmd; 3408 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 3409 _mesa_glthread_finish_before(ctx, "MemoryObjectParameterivEXT"); 3410 CALL_MemoryObjectParameterivEXT(ctx->CurrentServerDispatch, (memoryObject, pname, params)); 3411 return; 3412 } 3413 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MemoryObjectParameterivEXT, cmd_size); 3414 cmd->memoryObject = memoryObject; 3415 cmd->pname = pname; 3416 char *variable_data = (char *) (cmd + 1); 3417 memcpy(variable_data, params, params_size); 3418} 3419 3420 3421/* GetMemoryObjectParameterivEXT: marshalled synchronously */ 3422void GLAPIENTRY 3423_mesa_marshal_GetMemoryObjectParameterivEXT(GLuint memoryObject, GLenum pname, GLint * params) 3424{ 3425 GET_CURRENT_CONTEXT(ctx); 3426 _mesa_glthread_finish_before(ctx, "GetMemoryObjectParameterivEXT"); 3427 CALL_GetMemoryObjectParameterivEXT(ctx->CurrentServerDispatch, (memoryObject, pname, params)); 3428} 3429 3430 3431/* TexStorageMem2DEXT: marshalled asynchronously */ 3432struct marshal_cmd_TexStorageMem2DEXT 3433{ 3434 struct marshal_cmd_base cmd_base; 3435 GLenum target; 3436 GLsizei levels; 3437 GLenum internalFormat; 3438 GLsizei width; 3439 GLsizei height; 3440 GLuint memory; 3441 GLuint64 offset; 3442}; 3443uint32_t 3444_mesa_unmarshal_TexStorageMem2DEXT(struct gl_context *ctx, const struct marshal_cmd_TexStorageMem2DEXT *cmd, const uint64_t *last) 3445{ 3446 GLenum target = cmd->target; 3447 GLsizei levels = cmd->levels; 3448 GLenum internalFormat = cmd->internalFormat; 3449 GLsizei width = cmd->width; 3450 GLsizei height = cmd->height; 3451 GLuint memory = cmd->memory; 3452 GLuint64 offset = cmd->offset; 3453 CALL_TexStorageMem2DEXT(ctx->CurrentServerDispatch, (target, levels, internalFormat, width, height, memory, offset)); 3454 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexStorageMem2DEXT), 8) / 8); 3455 assert (cmd_size == cmd->cmd_base.cmd_size); 3456 return cmd_size; 3457} 3458void GLAPIENTRY 3459_mesa_marshal_TexStorageMem2DEXT(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset) 3460{ 3461 GET_CURRENT_CONTEXT(ctx); 3462 int cmd_size = sizeof(struct marshal_cmd_TexStorageMem2DEXT); 3463 struct marshal_cmd_TexStorageMem2DEXT *cmd; 3464 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorageMem2DEXT, cmd_size); 3465 cmd->target = target; 3466 cmd->levels = levels; 3467 cmd->internalFormat = internalFormat; 3468 cmd->width = width; 3469 cmd->height = height; 3470 cmd->memory = memory; 3471 cmd->offset = offset; 3472} 3473 3474 3475/* TexStorageMem2DMultisampleEXT: marshalled asynchronously */ 3476struct marshal_cmd_TexStorageMem2DMultisampleEXT 3477{ 3478 struct marshal_cmd_base cmd_base; 3479 GLboolean fixedSampleLocations; 3480 GLenum target; 3481 GLsizei samples; 3482 GLenum internalFormat; 3483 GLsizei width; 3484 GLsizei height; 3485 GLuint memory; 3486 GLuint64 offset; 3487}; 3488uint32_t 3489_mesa_unmarshal_TexStorageMem2DMultisampleEXT(struct gl_context *ctx, const struct marshal_cmd_TexStorageMem2DMultisampleEXT *cmd, const uint64_t *last) 3490{ 3491 GLenum target = cmd->target; 3492 GLsizei samples = cmd->samples; 3493 GLenum internalFormat = cmd->internalFormat; 3494 GLsizei width = cmd->width; 3495 GLsizei height = cmd->height; 3496 GLboolean fixedSampleLocations = cmd->fixedSampleLocations; 3497 GLuint memory = cmd->memory; 3498 GLuint64 offset = cmd->offset; 3499 CALL_TexStorageMem2DMultisampleEXT(ctx->CurrentServerDispatch, (target, samples, internalFormat, width, height, fixedSampleLocations, memory, offset)); 3500 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexStorageMem2DMultisampleEXT), 8) / 8); 3501 assert (cmd_size == cmd->cmd_base.cmd_size); 3502 return cmd_size; 3503} 3504void GLAPIENTRY 3505_mesa_marshal_TexStorageMem2DMultisampleEXT(GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset) 3506{ 3507 GET_CURRENT_CONTEXT(ctx); 3508 int cmd_size = sizeof(struct marshal_cmd_TexStorageMem2DMultisampleEXT); 3509 struct marshal_cmd_TexStorageMem2DMultisampleEXT *cmd; 3510 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorageMem2DMultisampleEXT, cmd_size); 3511 cmd->target = target; 3512 cmd->samples = samples; 3513 cmd->internalFormat = internalFormat; 3514 cmd->width = width; 3515 cmd->height = height; 3516 cmd->fixedSampleLocations = fixedSampleLocations; 3517 cmd->memory = memory; 3518 cmd->offset = offset; 3519} 3520 3521 3522/* TexStorageMem3DEXT: marshalled asynchronously */ 3523struct marshal_cmd_TexStorageMem3DEXT 3524{ 3525 struct marshal_cmd_base cmd_base; 3526 GLenum target; 3527 GLsizei levels; 3528 GLenum internalFormat; 3529 GLsizei width; 3530 GLsizei height; 3531 GLsizei depth; 3532 GLuint memory; 3533 GLuint64 offset; 3534}; 3535uint32_t 3536_mesa_unmarshal_TexStorageMem3DEXT(struct gl_context *ctx, const struct marshal_cmd_TexStorageMem3DEXT *cmd, const uint64_t *last) 3537{ 3538 GLenum target = cmd->target; 3539 GLsizei levels = cmd->levels; 3540 GLenum internalFormat = cmd->internalFormat; 3541 GLsizei width = cmd->width; 3542 GLsizei height = cmd->height; 3543 GLsizei depth = cmd->depth; 3544 GLuint memory = cmd->memory; 3545 GLuint64 offset = cmd->offset; 3546 CALL_TexStorageMem3DEXT(ctx->CurrentServerDispatch, (target, levels, internalFormat, width, height, depth, memory, offset)); 3547 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexStorageMem3DEXT), 8) / 8); 3548 assert (cmd_size == cmd->cmd_base.cmd_size); 3549 return cmd_size; 3550} 3551void GLAPIENTRY 3552_mesa_marshal_TexStorageMem3DEXT(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset) 3553{ 3554 GET_CURRENT_CONTEXT(ctx); 3555 int cmd_size = sizeof(struct marshal_cmd_TexStorageMem3DEXT); 3556 struct marshal_cmd_TexStorageMem3DEXT *cmd; 3557 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorageMem3DEXT, cmd_size); 3558 cmd->target = target; 3559 cmd->levels = levels; 3560 cmd->internalFormat = internalFormat; 3561 cmd->width = width; 3562 cmd->height = height; 3563 cmd->depth = depth; 3564 cmd->memory = memory; 3565 cmd->offset = offset; 3566} 3567 3568 3569/* TexStorageMem3DMultisampleEXT: marshalled asynchronously */ 3570struct marshal_cmd_TexStorageMem3DMultisampleEXT 3571{ 3572 struct marshal_cmd_base cmd_base; 3573 GLboolean fixedSampleLocations; 3574 GLenum target; 3575 GLsizei samples; 3576 GLenum internalFormat; 3577 GLsizei width; 3578 GLsizei height; 3579 GLsizei depth; 3580 GLuint memory; 3581 GLuint64 offset; 3582}; 3583uint32_t 3584_mesa_unmarshal_TexStorageMem3DMultisampleEXT(struct gl_context *ctx, const struct marshal_cmd_TexStorageMem3DMultisampleEXT *cmd, const uint64_t *last) 3585{ 3586 GLenum target = cmd->target; 3587 GLsizei samples = cmd->samples; 3588 GLenum internalFormat = cmd->internalFormat; 3589 GLsizei width = cmd->width; 3590 GLsizei height = cmd->height; 3591 GLsizei depth = cmd->depth; 3592 GLboolean fixedSampleLocations = cmd->fixedSampleLocations; 3593 GLuint memory = cmd->memory; 3594 GLuint64 offset = cmd->offset; 3595 CALL_TexStorageMem3DMultisampleEXT(ctx->CurrentServerDispatch, (target, samples, internalFormat, width, height, depth, fixedSampleLocations, memory, offset)); 3596 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexStorageMem3DMultisampleEXT), 8) / 8); 3597 assert (cmd_size == cmd->cmd_base.cmd_size); 3598 return cmd_size; 3599} 3600void GLAPIENTRY 3601_mesa_marshal_TexStorageMem3DMultisampleEXT(GLenum target, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset) 3602{ 3603 GET_CURRENT_CONTEXT(ctx); 3604 int cmd_size = sizeof(struct marshal_cmd_TexStorageMem3DMultisampleEXT); 3605 struct marshal_cmd_TexStorageMem3DMultisampleEXT *cmd; 3606 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorageMem3DMultisampleEXT, cmd_size); 3607 cmd->target = target; 3608 cmd->samples = samples; 3609 cmd->internalFormat = internalFormat; 3610 cmd->width = width; 3611 cmd->height = height; 3612 cmd->depth = depth; 3613 cmd->fixedSampleLocations = fixedSampleLocations; 3614 cmd->memory = memory; 3615 cmd->offset = offset; 3616} 3617 3618 3619/* BufferStorageMemEXT: marshalled asynchronously */ 3620struct marshal_cmd_BufferStorageMemEXT 3621{ 3622 struct marshal_cmd_base cmd_base; 3623 GLenum target; 3624 GLuint memory; 3625 GLsizeiptr size; 3626 GLuint64 offset; 3627}; 3628uint32_t 3629_mesa_unmarshal_BufferStorageMemEXT(struct gl_context *ctx, const struct marshal_cmd_BufferStorageMemEXT *cmd, const uint64_t *last) 3630{ 3631 GLenum target = cmd->target; 3632 GLsizeiptr size = cmd->size; 3633 GLuint memory = cmd->memory; 3634 GLuint64 offset = cmd->offset; 3635 CALL_BufferStorageMemEXT(ctx->CurrentServerDispatch, (target, size, memory, offset)); 3636 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_BufferStorageMemEXT), 8) / 8); 3637 assert (cmd_size == cmd->cmd_base.cmd_size); 3638 return cmd_size; 3639} 3640void GLAPIENTRY 3641_mesa_marshal_BufferStorageMemEXT(GLenum target, GLsizeiptr size, GLuint memory, GLuint64 offset) 3642{ 3643 GET_CURRENT_CONTEXT(ctx); 3644 int cmd_size = sizeof(struct marshal_cmd_BufferStorageMemEXT); 3645 struct marshal_cmd_BufferStorageMemEXT *cmd; 3646 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_BufferStorageMemEXT, cmd_size); 3647 cmd->target = target; 3648 cmd->size = size; 3649 cmd->memory = memory; 3650 cmd->offset = offset; 3651} 3652 3653 3654/* TextureStorageMem2DEXT: marshalled asynchronously */ 3655struct marshal_cmd_TextureStorageMem2DEXT 3656{ 3657 struct marshal_cmd_base cmd_base; 3658 GLenum texture; 3659 GLsizei levels; 3660 GLenum internalFormat; 3661 GLsizei width; 3662 GLsizei height; 3663 GLuint memory; 3664 GLuint64 offset; 3665}; 3666uint32_t 3667_mesa_unmarshal_TextureStorageMem2DEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorageMem2DEXT *cmd, const uint64_t *last) 3668{ 3669 GLenum texture = cmd->texture; 3670 GLsizei levels = cmd->levels; 3671 GLenum internalFormat = cmd->internalFormat; 3672 GLsizei width = cmd->width; 3673 GLsizei height = cmd->height; 3674 GLuint memory = cmd->memory; 3675 GLuint64 offset = cmd->offset; 3676 CALL_TextureStorageMem2DEXT(ctx->CurrentServerDispatch, (texture, levels, internalFormat, width, height, memory, offset)); 3677 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureStorageMem2DEXT), 8) / 8); 3678 assert (cmd_size == cmd->cmd_base.cmd_size); 3679 return cmd_size; 3680} 3681void GLAPIENTRY 3682_mesa_marshal_TextureStorageMem2DEXT(GLenum texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLuint memory, GLuint64 offset) 3683{ 3684 GET_CURRENT_CONTEXT(ctx); 3685 int cmd_size = sizeof(struct marshal_cmd_TextureStorageMem2DEXT); 3686 struct marshal_cmd_TextureStorageMem2DEXT *cmd; 3687 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorageMem2DEXT, cmd_size); 3688 cmd->texture = texture; 3689 cmd->levels = levels; 3690 cmd->internalFormat = internalFormat; 3691 cmd->width = width; 3692 cmd->height = height; 3693 cmd->memory = memory; 3694 cmd->offset = offset; 3695} 3696 3697 3698/* TextureStorageMem2DMultisampleEXT: marshalled asynchronously */ 3699struct marshal_cmd_TextureStorageMem2DMultisampleEXT 3700{ 3701 struct marshal_cmd_base cmd_base; 3702 GLboolean fixedSampleLocations; 3703 GLuint texture; 3704 GLsizei samples; 3705 GLenum internalFormat; 3706 GLsizei width; 3707 GLsizei height; 3708 GLuint memory; 3709 GLuint64 offset; 3710}; 3711uint32_t 3712_mesa_unmarshal_TextureStorageMem2DMultisampleEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorageMem2DMultisampleEXT *cmd, const uint64_t *last) 3713{ 3714 GLuint texture = cmd->texture; 3715 GLsizei samples = cmd->samples; 3716 GLenum internalFormat = cmd->internalFormat; 3717 GLsizei width = cmd->width; 3718 GLsizei height = cmd->height; 3719 GLboolean fixedSampleLocations = cmd->fixedSampleLocations; 3720 GLuint memory = cmd->memory; 3721 GLuint64 offset = cmd->offset; 3722 CALL_TextureStorageMem2DMultisampleEXT(ctx->CurrentServerDispatch, (texture, samples, internalFormat, width, height, fixedSampleLocations, memory, offset)); 3723 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureStorageMem2DMultisampleEXT), 8) / 8); 3724 assert (cmd_size == cmd->cmd_base.cmd_size); 3725 return cmd_size; 3726} 3727void GLAPIENTRY 3728_mesa_marshal_TextureStorageMem2DMultisampleEXT(GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset) 3729{ 3730 GET_CURRENT_CONTEXT(ctx); 3731 int cmd_size = sizeof(struct marshal_cmd_TextureStorageMem2DMultisampleEXT); 3732 struct marshal_cmd_TextureStorageMem2DMultisampleEXT *cmd; 3733 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorageMem2DMultisampleEXT, cmd_size); 3734 cmd->texture = texture; 3735 cmd->samples = samples; 3736 cmd->internalFormat = internalFormat; 3737 cmd->width = width; 3738 cmd->height = height; 3739 cmd->fixedSampleLocations = fixedSampleLocations; 3740 cmd->memory = memory; 3741 cmd->offset = offset; 3742} 3743 3744 3745/* TextureStorageMem3DEXT: marshalled asynchronously */ 3746struct marshal_cmd_TextureStorageMem3DEXT 3747{ 3748 struct marshal_cmd_base cmd_base; 3749 GLuint texture; 3750 GLsizei levels; 3751 GLenum internalFormat; 3752 GLsizei width; 3753 GLsizei height; 3754 GLsizei depth; 3755 GLuint memory; 3756 GLuint64 offset; 3757}; 3758uint32_t 3759_mesa_unmarshal_TextureStorageMem3DEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorageMem3DEXT *cmd, const uint64_t *last) 3760{ 3761 GLuint texture = cmd->texture; 3762 GLsizei levels = cmd->levels; 3763 GLenum internalFormat = cmd->internalFormat; 3764 GLsizei width = cmd->width; 3765 GLsizei height = cmd->height; 3766 GLsizei depth = cmd->depth; 3767 GLuint memory = cmd->memory; 3768 GLuint64 offset = cmd->offset; 3769 CALL_TextureStorageMem3DEXT(ctx->CurrentServerDispatch, (texture, levels, internalFormat, width, height, depth, memory, offset)); 3770 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureStorageMem3DEXT), 8) / 8); 3771 assert (cmd_size == cmd->cmd_base.cmd_size); 3772 return cmd_size; 3773} 3774void GLAPIENTRY 3775_mesa_marshal_TextureStorageMem3DEXT(GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLuint memory, GLuint64 offset) 3776{ 3777 GET_CURRENT_CONTEXT(ctx); 3778 int cmd_size = sizeof(struct marshal_cmd_TextureStorageMem3DEXT); 3779 struct marshal_cmd_TextureStorageMem3DEXT *cmd; 3780 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorageMem3DEXT, cmd_size); 3781 cmd->texture = texture; 3782 cmd->levels = levels; 3783 cmd->internalFormat = internalFormat; 3784 cmd->width = width; 3785 cmd->height = height; 3786 cmd->depth = depth; 3787 cmd->memory = memory; 3788 cmd->offset = offset; 3789} 3790 3791 3792/* TextureStorageMem3DMultisampleEXT: marshalled asynchronously */ 3793struct marshal_cmd_TextureStorageMem3DMultisampleEXT 3794{ 3795 struct marshal_cmd_base cmd_base; 3796 GLboolean fixedSampleLocations; 3797 GLuint texture; 3798 GLsizei samples; 3799 GLenum internalFormat; 3800 GLsizei width; 3801 GLsizei height; 3802 GLsizei depth; 3803 GLuint memory; 3804 GLuint64 offset; 3805}; 3806uint32_t 3807_mesa_unmarshal_TextureStorageMem3DMultisampleEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorageMem3DMultisampleEXT *cmd, const uint64_t *last) 3808{ 3809 GLuint texture = cmd->texture; 3810 GLsizei samples = cmd->samples; 3811 GLenum internalFormat = cmd->internalFormat; 3812 GLsizei width = cmd->width; 3813 GLsizei height = cmd->height; 3814 GLsizei depth = cmd->depth; 3815 GLboolean fixedSampleLocations = cmd->fixedSampleLocations; 3816 GLuint memory = cmd->memory; 3817 GLuint64 offset = cmd->offset; 3818 CALL_TextureStorageMem3DMultisampleEXT(ctx->CurrentServerDispatch, (texture, samples, internalFormat, width, height, depth, fixedSampleLocations, memory, offset)); 3819 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureStorageMem3DMultisampleEXT), 8) / 8); 3820 assert (cmd_size == cmd->cmd_base.cmd_size); 3821 return cmd_size; 3822} 3823void GLAPIENTRY 3824_mesa_marshal_TextureStorageMem3DMultisampleEXT(GLuint texture, GLsizei samples, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations, GLuint memory, GLuint64 offset) 3825{ 3826 GET_CURRENT_CONTEXT(ctx); 3827 int cmd_size = sizeof(struct marshal_cmd_TextureStorageMem3DMultisampleEXT); 3828 struct marshal_cmd_TextureStorageMem3DMultisampleEXT *cmd; 3829 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorageMem3DMultisampleEXT, cmd_size); 3830 cmd->texture = texture; 3831 cmd->samples = samples; 3832 cmd->internalFormat = internalFormat; 3833 cmd->width = width; 3834 cmd->height = height; 3835 cmd->depth = depth; 3836 cmd->fixedSampleLocations = fixedSampleLocations; 3837 cmd->memory = memory; 3838 cmd->offset = offset; 3839} 3840 3841 3842/* NamedBufferStorageMemEXT: marshalled asynchronously */ 3843struct marshal_cmd_NamedBufferStorageMemEXT 3844{ 3845 struct marshal_cmd_base cmd_base; 3846 GLuint buffer; 3847 GLuint memory; 3848 GLsizeiptr size; 3849 GLuint64 offset; 3850}; 3851uint32_t 3852_mesa_unmarshal_NamedBufferStorageMemEXT(struct gl_context *ctx, const struct marshal_cmd_NamedBufferStorageMemEXT *cmd, const uint64_t *last) 3853{ 3854 GLuint buffer = cmd->buffer; 3855 GLsizeiptr size = cmd->size; 3856 GLuint memory = cmd->memory; 3857 GLuint64 offset = cmd->offset; 3858 CALL_NamedBufferStorageMemEXT(ctx->CurrentServerDispatch, (buffer, size, memory, offset)); 3859 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_NamedBufferStorageMemEXT), 8) / 8); 3860 assert (cmd_size == cmd->cmd_base.cmd_size); 3861 return cmd_size; 3862} 3863void GLAPIENTRY 3864_mesa_marshal_NamedBufferStorageMemEXT(GLuint buffer, GLsizeiptr size, GLuint memory, GLuint64 offset) 3865{ 3866 GET_CURRENT_CONTEXT(ctx); 3867 int cmd_size = sizeof(struct marshal_cmd_NamedBufferStorageMemEXT); 3868 struct marshal_cmd_NamedBufferStorageMemEXT *cmd; 3869 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_NamedBufferStorageMemEXT, cmd_size); 3870 cmd->buffer = buffer; 3871 cmd->size = size; 3872 cmd->memory = memory; 3873 cmd->offset = offset; 3874} 3875 3876 3877/* TexStorageMem1DEXT: marshalled asynchronously */ 3878struct marshal_cmd_TexStorageMem1DEXT 3879{ 3880 struct marshal_cmd_base cmd_base; 3881 GLenum target; 3882 GLsizei levels; 3883 GLenum internalFormat; 3884 GLsizei width; 3885 GLuint memory; 3886 GLuint64 offset; 3887}; 3888uint32_t 3889_mesa_unmarshal_TexStorageMem1DEXT(struct gl_context *ctx, const struct marshal_cmd_TexStorageMem1DEXT *cmd, const uint64_t *last) 3890{ 3891 GLenum target = cmd->target; 3892 GLsizei levels = cmd->levels; 3893 GLenum internalFormat = cmd->internalFormat; 3894 GLsizei width = cmd->width; 3895 GLuint memory = cmd->memory; 3896 GLuint64 offset = cmd->offset; 3897 CALL_TexStorageMem1DEXT(ctx->CurrentServerDispatch, (target, levels, internalFormat, width, memory, offset)); 3898 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexStorageMem1DEXT), 8) / 8); 3899 assert (cmd_size == cmd->cmd_base.cmd_size); 3900 return cmd_size; 3901} 3902void GLAPIENTRY 3903_mesa_marshal_TexStorageMem1DEXT(GLenum target, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset) 3904{ 3905 GET_CURRENT_CONTEXT(ctx); 3906 int cmd_size = sizeof(struct marshal_cmd_TexStorageMem1DEXT); 3907 struct marshal_cmd_TexStorageMem1DEXT *cmd; 3908 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexStorageMem1DEXT, cmd_size); 3909 cmd->target = target; 3910 cmd->levels = levels; 3911 cmd->internalFormat = internalFormat; 3912 cmd->width = width; 3913 cmd->memory = memory; 3914 cmd->offset = offset; 3915} 3916 3917 3918/* TextureStorageMem1DEXT: marshalled asynchronously */ 3919struct marshal_cmd_TextureStorageMem1DEXT 3920{ 3921 struct marshal_cmd_base cmd_base; 3922 GLuint texture; 3923 GLsizei levels; 3924 GLenum internalFormat; 3925 GLsizei width; 3926 GLuint memory; 3927 GLuint64 offset; 3928}; 3929uint32_t 3930_mesa_unmarshal_TextureStorageMem1DEXT(struct gl_context *ctx, const struct marshal_cmd_TextureStorageMem1DEXT *cmd, const uint64_t *last) 3931{ 3932 GLuint texture = cmd->texture; 3933 GLsizei levels = cmd->levels; 3934 GLenum internalFormat = cmd->internalFormat; 3935 GLsizei width = cmd->width; 3936 GLuint memory = cmd->memory; 3937 GLuint64 offset = cmd->offset; 3938 CALL_TextureStorageMem1DEXT(ctx->CurrentServerDispatch, (texture, levels, internalFormat, width, memory, offset)); 3939 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TextureStorageMem1DEXT), 8) / 8); 3940 assert (cmd_size == cmd->cmd_base.cmd_size); 3941 return cmd_size; 3942} 3943void GLAPIENTRY 3944_mesa_marshal_TextureStorageMem1DEXT(GLuint texture, GLsizei levels, GLenum internalFormat, GLsizei width, GLuint memory, GLuint64 offset) 3945{ 3946 GET_CURRENT_CONTEXT(ctx); 3947 int cmd_size = sizeof(struct marshal_cmd_TextureStorageMem1DEXT); 3948 struct marshal_cmd_TextureStorageMem1DEXT *cmd; 3949 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TextureStorageMem1DEXT, cmd_size); 3950 cmd->texture = texture; 3951 cmd->levels = levels; 3952 cmd->internalFormat = internalFormat; 3953 cmd->width = width; 3954 cmd->memory = memory; 3955 cmd->offset = offset; 3956} 3957 3958 3959/* GenSemaphoresEXT: marshalled synchronously */ 3960void GLAPIENTRY 3961_mesa_marshal_GenSemaphoresEXT(GLsizei n, GLuint * semaphores) 3962{ 3963 GET_CURRENT_CONTEXT(ctx); 3964 _mesa_glthread_finish_before(ctx, "GenSemaphoresEXT"); 3965 CALL_GenSemaphoresEXT(ctx->CurrentServerDispatch, (n, semaphores)); 3966} 3967 3968 3969/* DeleteSemaphoresEXT: marshalled asynchronously */ 3970struct marshal_cmd_DeleteSemaphoresEXT 3971{ 3972 struct marshal_cmd_base cmd_base; 3973 GLsizei n; 3974 /* Next safe_mul(n, 1 * sizeof(GLuint)) bytes are GLuint semaphores[n] */ 3975}; 3976uint32_t 3977_mesa_unmarshal_DeleteSemaphoresEXT(struct gl_context *ctx, const struct marshal_cmd_DeleteSemaphoresEXT *cmd, const uint64_t *last) 3978{ 3979 GLsizei n = cmd->n; 3980 GLuint * semaphores; 3981 const char *variable_data = (const char *) (cmd + 1); 3982 semaphores = (GLuint *) variable_data; 3983 CALL_DeleteSemaphoresEXT(ctx->CurrentServerDispatch, (n, semaphores)); 3984 return cmd->cmd_base.cmd_size; 3985} 3986void GLAPIENTRY 3987_mesa_marshal_DeleteSemaphoresEXT(GLsizei n, const GLuint * semaphores) 3988{ 3989 GET_CURRENT_CONTEXT(ctx); 3990 int semaphores_size = safe_mul(n, 1 * sizeof(GLuint)); 3991 int cmd_size = sizeof(struct marshal_cmd_DeleteSemaphoresEXT) + semaphores_size; 3992 struct marshal_cmd_DeleteSemaphoresEXT *cmd; 3993 if (unlikely(semaphores_size < 0 || (semaphores_size > 0 && !semaphores) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 3994 _mesa_glthread_finish_before(ctx, "DeleteSemaphoresEXT"); 3995 CALL_DeleteSemaphoresEXT(ctx->CurrentServerDispatch, (n, semaphores)); 3996 return; 3997 } 3998 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DeleteSemaphoresEXT, cmd_size); 3999 cmd->n = n; 4000 char *variable_data = (char *) (cmd + 1); 4001 memcpy(variable_data, semaphores, semaphores_size); 4002} 4003 4004 4005/* IsSemaphoreEXT: marshalled synchronously */ 4006GLboolean GLAPIENTRY 4007_mesa_marshal_IsSemaphoreEXT(GLuint semaphore) 4008{ 4009 GET_CURRENT_CONTEXT(ctx); 4010 _mesa_glthread_finish_before(ctx, "IsSemaphoreEXT"); 4011 return CALL_IsSemaphoreEXT(ctx->CurrentServerDispatch, (semaphore)); 4012} 4013 4014 4015/* SemaphoreParameterui64vEXT: marshalled asynchronously */ 4016struct marshal_cmd_SemaphoreParameterui64vEXT 4017{ 4018 struct marshal_cmd_base cmd_base; 4019 GLuint semaphore; 4020 GLenum pname; 4021 /* Next safe_mul(_mesa_semaphore_enum_to_count(pname), 1 * sizeof(GLuint64)) bytes are GLuint64 params[_mesa_semaphore_enum_to_count(pname)] */ 4022}; 4023uint32_t 4024_mesa_unmarshal_SemaphoreParameterui64vEXT(struct gl_context *ctx, const struct marshal_cmd_SemaphoreParameterui64vEXT *cmd, const uint64_t *last) 4025{ 4026 GLuint semaphore = cmd->semaphore; 4027 GLenum pname = cmd->pname; 4028 GLuint64 * params; 4029 const char *variable_data = (const char *) (cmd + 1); 4030 params = (GLuint64 *) variable_data; 4031 CALL_SemaphoreParameterui64vEXT(ctx->CurrentServerDispatch, (semaphore, pname, params)); 4032 return cmd->cmd_base.cmd_size; 4033} 4034void GLAPIENTRY 4035_mesa_marshal_SemaphoreParameterui64vEXT(GLuint semaphore, GLenum pname, const GLuint64 * params) 4036{ 4037 GET_CURRENT_CONTEXT(ctx); 4038 int params_size = safe_mul(_mesa_semaphore_enum_to_count(pname), 1 * sizeof(GLuint64)); 4039 int cmd_size = sizeof(struct marshal_cmd_SemaphoreParameterui64vEXT) + params_size; 4040 struct marshal_cmd_SemaphoreParameterui64vEXT *cmd; 4041 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 4042 _mesa_glthread_finish_before(ctx, "SemaphoreParameterui64vEXT"); 4043 CALL_SemaphoreParameterui64vEXT(ctx->CurrentServerDispatch, (semaphore, pname, params)); 4044 return; 4045 } 4046 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SemaphoreParameterui64vEXT, cmd_size); 4047 cmd->semaphore = semaphore; 4048 cmd->pname = pname; 4049 char *variable_data = (char *) (cmd + 1); 4050 memcpy(variable_data, params, params_size); 4051} 4052 4053 4054/* GetSemaphoreParameterui64vEXT: marshalled synchronously */ 4055void GLAPIENTRY 4056_mesa_marshal_GetSemaphoreParameterui64vEXT(GLuint semaphore, GLenum pname, GLuint64 * params) 4057{ 4058 GET_CURRENT_CONTEXT(ctx); 4059 _mesa_glthread_finish_before(ctx, "GetSemaphoreParameterui64vEXT"); 4060 CALL_GetSemaphoreParameterui64vEXT(ctx->CurrentServerDispatch, (semaphore, pname, params)); 4061} 4062 4063 4064/* WaitSemaphoreEXT: marshalled asynchronously */ 4065struct marshal_cmd_WaitSemaphoreEXT 4066{ 4067 struct marshal_cmd_base cmd_base; 4068 GLuint semaphore; 4069 GLuint numBufferBarriers; 4070 GLuint numTextureBarriers; 4071 /* Next safe_mul(numBufferBarriers, 1 * sizeof(GLuint)) bytes are GLuint buffers[numBufferBarriers] */ 4072 /* Next safe_mul(numTextureBarriers, 1 * sizeof(GLuint)) bytes are GLuint textures[numTextureBarriers] */ 4073 /* Next safe_mul(numTextureBarriers, 1 * sizeof(GLenum)) bytes are GLenum srcLayouts[numTextureBarriers] */ 4074}; 4075uint32_t 4076_mesa_unmarshal_WaitSemaphoreEXT(struct gl_context *ctx, const struct marshal_cmd_WaitSemaphoreEXT *cmd, const uint64_t *last) 4077{ 4078 GLuint semaphore = cmd->semaphore; 4079 GLuint numBufferBarriers = cmd->numBufferBarriers; 4080 GLuint numTextureBarriers = cmd->numTextureBarriers; 4081 GLuint * buffers; 4082 GLuint * textures; 4083 GLenum * srcLayouts; 4084 const char *variable_data = (const char *) (cmd + 1); 4085 buffers = (GLuint *) variable_data; 4086 variable_data += numBufferBarriers * 1 * sizeof(GLuint); 4087 textures = (GLuint *) variable_data; 4088 variable_data += numTextureBarriers * 1 * sizeof(GLuint); 4089 srcLayouts = (GLenum *) variable_data; 4090 CALL_WaitSemaphoreEXT(ctx->CurrentServerDispatch, (semaphore, numBufferBarriers, buffers, numTextureBarriers, textures, srcLayouts)); 4091 return cmd->cmd_base.cmd_size; 4092} 4093void GLAPIENTRY 4094_mesa_marshal_WaitSemaphoreEXT(GLuint semaphore, GLuint numBufferBarriers, const GLuint * buffers, GLuint numTextureBarriers, const GLuint * textures, const GLenum * srcLayouts) 4095{ 4096 GET_CURRENT_CONTEXT(ctx); 4097 int buffers_size = safe_mul(numBufferBarriers, 1 * sizeof(GLuint)); 4098 int textures_size = safe_mul(numTextureBarriers, 1 * sizeof(GLuint)); 4099 int srcLayouts_size = safe_mul(numTextureBarriers, 1 * sizeof(GLenum)); 4100 int cmd_size = sizeof(struct marshal_cmd_WaitSemaphoreEXT) + buffers_size + textures_size + srcLayouts_size; 4101 struct marshal_cmd_WaitSemaphoreEXT *cmd; 4102 if (unlikely(buffers_size < 0 || (buffers_size > 0 && !buffers) || textures_size < 0 || (textures_size > 0 && !textures) || srcLayouts_size < 0 || (srcLayouts_size > 0 && !srcLayouts) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 4103 _mesa_glthread_finish_before(ctx, "WaitSemaphoreEXT"); 4104 CALL_WaitSemaphoreEXT(ctx->CurrentServerDispatch, (semaphore, numBufferBarriers, buffers, numTextureBarriers, textures, srcLayouts)); 4105 return; 4106 } 4107 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_WaitSemaphoreEXT, cmd_size); 4108 cmd->semaphore = semaphore; 4109 cmd->numBufferBarriers = numBufferBarriers; 4110 cmd->numTextureBarriers = numTextureBarriers; 4111 char *variable_data = (char *) (cmd + 1); 4112 memcpy(variable_data, buffers, buffers_size); 4113 variable_data += buffers_size; 4114 memcpy(variable_data, textures, textures_size); 4115 variable_data += textures_size; 4116 memcpy(variable_data, srcLayouts, srcLayouts_size); 4117} 4118 4119 4120/* SignalSemaphoreEXT: marshalled asynchronously */ 4121struct marshal_cmd_SignalSemaphoreEXT 4122{ 4123 struct marshal_cmd_base cmd_base; 4124 GLuint semaphore; 4125 GLuint numBufferBarriers; 4126 GLuint numTextureBarriers; 4127 /* Next safe_mul(numBufferBarriers, 1 * sizeof(GLuint)) bytes are GLuint buffers[numBufferBarriers] */ 4128 /* Next safe_mul(numTextureBarriers, 1 * sizeof(GLuint)) bytes are GLuint textures[numTextureBarriers] */ 4129 /* Next safe_mul(numTextureBarriers, 1 * sizeof(GLenum)) bytes are GLenum dstLayouts[numTextureBarriers] */ 4130}; 4131uint32_t 4132_mesa_unmarshal_SignalSemaphoreEXT(struct gl_context *ctx, const struct marshal_cmd_SignalSemaphoreEXT *cmd, const uint64_t *last) 4133{ 4134 GLuint semaphore = cmd->semaphore; 4135 GLuint numBufferBarriers = cmd->numBufferBarriers; 4136 GLuint numTextureBarriers = cmd->numTextureBarriers; 4137 GLuint * buffers; 4138 GLuint * textures; 4139 GLenum * dstLayouts; 4140 const char *variable_data = (const char *) (cmd + 1); 4141 buffers = (GLuint *) variable_data; 4142 variable_data += numBufferBarriers * 1 * sizeof(GLuint); 4143 textures = (GLuint *) variable_data; 4144 variable_data += numTextureBarriers * 1 * sizeof(GLuint); 4145 dstLayouts = (GLenum *) variable_data; 4146 CALL_SignalSemaphoreEXT(ctx->CurrentServerDispatch, (semaphore, numBufferBarriers, buffers, numTextureBarriers, textures, dstLayouts)); 4147 return cmd->cmd_base.cmd_size; 4148} 4149void GLAPIENTRY 4150_mesa_marshal_SignalSemaphoreEXT(GLuint semaphore, GLuint numBufferBarriers, const GLuint * buffers, GLuint numTextureBarriers, const GLuint * textures, const GLenum * dstLayouts) 4151{ 4152 GET_CURRENT_CONTEXT(ctx); 4153 int buffers_size = safe_mul(numBufferBarriers, 1 * sizeof(GLuint)); 4154 int textures_size = safe_mul(numTextureBarriers, 1 * sizeof(GLuint)); 4155 int dstLayouts_size = safe_mul(numTextureBarriers, 1 * sizeof(GLenum)); 4156 int cmd_size = sizeof(struct marshal_cmd_SignalSemaphoreEXT) + buffers_size + textures_size + dstLayouts_size; 4157 struct marshal_cmd_SignalSemaphoreEXT *cmd; 4158 if (unlikely(buffers_size < 0 || (buffers_size > 0 && !buffers) || textures_size < 0 || (textures_size > 0 && !textures) || dstLayouts_size < 0 || (dstLayouts_size > 0 && !dstLayouts) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 4159 _mesa_glthread_finish_before(ctx, "SignalSemaphoreEXT"); 4160 CALL_SignalSemaphoreEXT(ctx->CurrentServerDispatch, (semaphore, numBufferBarriers, buffers, numTextureBarriers, textures, dstLayouts)); 4161 return; 4162 } 4163 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SignalSemaphoreEXT, cmd_size); 4164 cmd->semaphore = semaphore; 4165 cmd->numBufferBarriers = numBufferBarriers; 4166 cmd->numTextureBarriers = numTextureBarriers; 4167 char *variable_data = (char *) (cmd + 1); 4168 memcpy(variable_data, buffers, buffers_size); 4169 variable_data += buffers_size; 4170 memcpy(variable_data, textures, textures_size); 4171 variable_data += textures_size; 4172 memcpy(variable_data, dstLayouts, dstLayouts_size); 4173} 4174 4175 4176/* ImportMemoryFdEXT: marshalled asynchronously */ 4177struct marshal_cmd_ImportMemoryFdEXT 4178{ 4179 struct marshal_cmd_base cmd_base; 4180 GLuint memory; 4181 GLenum handleType; 4182 GLint fd; 4183 GLuint64 size; 4184}; 4185uint32_t 4186_mesa_unmarshal_ImportMemoryFdEXT(struct gl_context *ctx, const struct marshal_cmd_ImportMemoryFdEXT *cmd, const uint64_t *last) 4187{ 4188 GLuint memory = cmd->memory; 4189 GLuint64 size = cmd->size; 4190 GLenum handleType = cmd->handleType; 4191 GLint fd = cmd->fd; 4192 CALL_ImportMemoryFdEXT(ctx->CurrentServerDispatch, (memory, size, handleType, fd)); 4193 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ImportMemoryFdEXT), 8) / 8); 4194 assert (cmd_size == cmd->cmd_base.cmd_size); 4195 return cmd_size; 4196} 4197void GLAPIENTRY 4198_mesa_marshal_ImportMemoryFdEXT(GLuint memory, GLuint64 size, GLenum handleType, GLint fd) 4199{ 4200 GET_CURRENT_CONTEXT(ctx); 4201 int cmd_size = sizeof(struct marshal_cmd_ImportMemoryFdEXT); 4202 struct marshal_cmd_ImportMemoryFdEXT *cmd; 4203 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ImportMemoryFdEXT, cmd_size); 4204 cmd->memory = memory; 4205 cmd->size = size; 4206 cmd->handleType = handleType; 4207 cmd->fd = fd; 4208} 4209 4210 4211/* ImportSemaphoreFdEXT: marshalled asynchronously */ 4212struct marshal_cmd_ImportSemaphoreFdEXT 4213{ 4214 struct marshal_cmd_base cmd_base; 4215 GLuint semaphore; 4216 GLenum handleType; 4217 GLint fd; 4218}; 4219uint32_t 4220_mesa_unmarshal_ImportSemaphoreFdEXT(struct gl_context *ctx, const struct marshal_cmd_ImportSemaphoreFdEXT *cmd, const uint64_t *last) 4221{ 4222 GLuint semaphore = cmd->semaphore; 4223 GLenum handleType = cmd->handleType; 4224 GLint fd = cmd->fd; 4225 CALL_ImportSemaphoreFdEXT(ctx->CurrentServerDispatch, (semaphore, handleType, fd)); 4226 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ImportSemaphoreFdEXT), 8) / 8); 4227 assert (cmd_size == cmd->cmd_base.cmd_size); 4228 return cmd_size; 4229} 4230void GLAPIENTRY 4231_mesa_marshal_ImportSemaphoreFdEXT(GLuint semaphore, GLenum handleType, GLint fd) 4232{ 4233 GET_CURRENT_CONTEXT(ctx); 4234 int cmd_size = sizeof(struct marshal_cmd_ImportSemaphoreFdEXT); 4235 struct marshal_cmd_ImportSemaphoreFdEXT *cmd; 4236 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ImportSemaphoreFdEXT, cmd_size); 4237 cmd->semaphore = semaphore; 4238 cmd->handleType = handleType; 4239 cmd->fd = fd; 4240} 4241 4242 4243/* ViewportSwizzleNV: marshalled asynchronously */ 4244struct marshal_cmd_ViewportSwizzleNV 4245{ 4246 struct marshal_cmd_base cmd_base; 4247 GLuint index; 4248 GLenum swizzlex; 4249 GLenum swizzley; 4250 GLenum swizzlez; 4251 GLenum swizzlew; 4252}; 4253uint32_t 4254_mesa_unmarshal_ViewportSwizzleNV(struct gl_context *ctx, const struct marshal_cmd_ViewportSwizzleNV *cmd, const uint64_t *last) 4255{ 4256 GLuint index = cmd->index; 4257 GLenum swizzlex = cmd->swizzlex; 4258 GLenum swizzley = cmd->swizzley; 4259 GLenum swizzlez = cmd->swizzlez; 4260 GLenum swizzlew = cmd->swizzlew; 4261 CALL_ViewportSwizzleNV(ctx->CurrentServerDispatch, (index, swizzlex, swizzley, swizzlez, swizzlew)); 4262 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ViewportSwizzleNV), 8) / 8); 4263 assert (cmd_size == cmd->cmd_base.cmd_size); 4264 return cmd_size; 4265} 4266void GLAPIENTRY 4267_mesa_marshal_ViewportSwizzleNV(GLuint index, GLenum swizzlex, GLenum swizzley, GLenum swizzlez, GLenum swizzlew) 4268{ 4269 GET_CURRENT_CONTEXT(ctx); 4270 int cmd_size = sizeof(struct marshal_cmd_ViewportSwizzleNV); 4271 struct marshal_cmd_ViewportSwizzleNV *cmd; 4272 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ViewportSwizzleNV, cmd_size); 4273 cmd->index = index; 4274 cmd->swizzlex = swizzlex; 4275 cmd->swizzley = swizzley; 4276 cmd->swizzlez = swizzlez; 4277 cmd->swizzlew = swizzlew; 4278} 4279 4280 4281/* Vertex2hNV: marshalled asynchronously */ 4282struct marshal_cmd_Vertex2hNV 4283{ 4284 struct marshal_cmd_base cmd_base; 4285 GLhalfNV x; 4286 GLhalfNV y; 4287}; 4288uint32_t 4289_mesa_unmarshal_Vertex2hNV(struct gl_context *ctx, const struct marshal_cmd_Vertex2hNV *cmd, const uint64_t *last) 4290{ 4291 GLhalfNV x = cmd->x; 4292 GLhalfNV y = cmd->y; 4293 CALL_Vertex2hNV(ctx->CurrentServerDispatch, (x, y)); 4294 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Vertex2hNV), 8) / 8); 4295 assert (cmd_size == cmd->cmd_base.cmd_size); 4296 return cmd_size; 4297} 4298void GLAPIENTRY 4299_mesa_marshal_Vertex2hNV(GLhalfNV x, GLhalfNV y) 4300{ 4301 GET_CURRENT_CONTEXT(ctx); 4302 int cmd_size = sizeof(struct marshal_cmd_Vertex2hNV); 4303 struct marshal_cmd_Vertex2hNV *cmd; 4304 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex2hNV, cmd_size); 4305 cmd->x = x; 4306 cmd->y = y; 4307} 4308 4309 4310/* Vertex2hvNV: marshalled asynchronously */ 4311struct marshal_cmd_Vertex2hvNV 4312{ 4313 struct marshal_cmd_base cmd_base; 4314 GLhalfNV v[2]; 4315}; 4316uint32_t 4317_mesa_unmarshal_Vertex2hvNV(struct gl_context *ctx, const struct marshal_cmd_Vertex2hvNV *cmd, const uint64_t *last) 4318{ 4319 const GLhalfNV * v = cmd->v; 4320 CALL_Vertex2hvNV(ctx->CurrentServerDispatch, (v)); 4321 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Vertex2hvNV), 8) / 8); 4322 assert (cmd_size == cmd->cmd_base.cmd_size); 4323 return cmd_size; 4324} 4325void GLAPIENTRY 4326_mesa_marshal_Vertex2hvNV(const GLhalfNV * v) 4327{ 4328 GET_CURRENT_CONTEXT(ctx); 4329 int cmd_size = sizeof(struct marshal_cmd_Vertex2hvNV); 4330 struct marshal_cmd_Vertex2hvNV *cmd; 4331 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex2hvNV, cmd_size); 4332 memcpy(cmd->v, v, 2 * sizeof(GLhalfNV)); 4333} 4334 4335 4336/* Vertex3hNV: marshalled asynchronously */ 4337struct marshal_cmd_Vertex3hNV 4338{ 4339 struct marshal_cmd_base cmd_base; 4340 GLhalfNV x; 4341 GLhalfNV y; 4342 GLhalfNV z; 4343}; 4344uint32_t 4345_mesa_unmarshal_Vertex3hNV(struct gl_context *ctx, const struct marshal_cmd_Vertex3hNV *cmd, const uint64_t *last) 4346{ 4347 GLhalfNV x = cmd->x; 4348 GLhalfNV y = cmd->y; 4349 GLhalfNV z = cmd->z; 4350 CALL_Vertex3hNV(ctx->CurrentServerDispatch, (x, y, z)); 4351 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Vertex3hNV), 8) / 8); 4352 assert (cmd_size == cmd->cmd_base.cmd_size); 4353 return cmd_size; 4354} 4355void GLAPIENTRY 4356_mesa_marshal_Vertex3hNV(GLhalfNV x, GLhalfNV y, GLhalfNV z) 4357{ 4358 GET_CURRENT_CONTEXT(ctx); 4359 int cmd_size = sizeof(struct marshal_cmd_Vertex3hNV); 4360 struct marshal_cmd_Vertex3hNV *cmd; 4361 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex3hNV, cmd_size); 4362 cmd->x = x; 4363 cmd->y = y; 4364 cmd->z = z; 4365} 4366 4367 4368/* Vertex3hvNV: marshalled asynchronously */ 4369struct marshal_cmd_Vertex3hvNV 4370{ 4371 struct marshal_cmd_base cmd_base; 4372 GLhalfNV v[3]; 4373}; 4374uint32_t 4375_mesa_unmarshal_Vertex3hvNV(struct gl_context *ctx, const struct marshal_cmd_Vertex3hvNV *cmd, const uint64_t *last) 4376{ 4377 const GLhalfNV * v = cmd->v; 4378 CALL_Vertex3hvNV(ctx->CurrentServerDispatch, (v)); 4379 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Vertex3hvNV), 8) / 8); 4380 assert (cmd_size == cmd->cmd_base.cmd_size); 4381 return cmd_size; 4382} 4383void GLAPIENTRY 4384_mesa_marshal_Vertex3hvNV(const GLhalfNV * v) 4385{ 4386 GET_CURRENT_CONTEXT(ctx); 4387 int cmd_size = sizeof(struct marshal_cmd_Vertex3hvNV); 4388 struct marshal_cmd_Vertex3hvNV *cmd; 4389 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex3hvNV, cmd_size); 4390 memcpy(cmd->v, v, 3 * sizeof(GLhalfNV)); 4391} 4392 4393 4394/* Vertex4hNV: marshalled asynchronously */ 4395struct marshal_cmd_Vertex4hNV 4396{ 4397 struct marshal_cmd_base cmd_base; 4398 GLhalfNV x; 4399 GLhalfNV y; 4400 GLhalfNV z; 4401 GLhalfNV w; 4402}; 4403uint32_t 4404_mesa_unmarshal_Vertex4hNV(struct gl_context *ctx, const struct marshal_cmd_Vertex4hNV *cmd, const uint64_t *last) 4405{ 4406 GLhalfNV x = cmd->x; 4407 GLhalfNV y = cmd->y; 4408 GLhalfNV z = cmd->z; 4409 GLhalfNV w = cmd->w; 4410 CALL_Vertex4hNV(ctx->CurrentServerDispatch, (x, y, z, w)); 4411 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Vertex4hNV), 8) / 8); 4412 assert (cmd_size == cmd->cmd_base.cmd_size); 4413 return cmd_size; 4414} 4415void GLAPIENTRY 4416_mesa_marshal_Vertex4hNV(GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w) 4417{ 4418 GET_CURRENT_CONTEXT(ctx); 4419 int cmd_size = sizeof(struct marshal_cmd_Vertex4hNV); 4420 struct marshal_cmd_Vertex4hNV *cmd; 4421 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex4hNV, cmd_size); 4422 cmd->x = x; 4423 cmd->y = y; 4424 cmd->z = z; 4425 cmd->w = w; 4426} 4427 4428 4429/* Vertex4hvNV: marshalled asynchronously */ 4430struct marshal_cmd_Vertex4hvNV 4431{ 4432 struct marshal_cmd_base cmd_base; 4433 GLhalfNV v[4]; 4434}; 4435uint32_t 4436_mesa_unmarshal_Vertex4hvNV(struct gl_context *ctx, const struct marshal_cmd_Vertex4hvNV *cmd, const uint64_t *last) 4437{ 4438 const GLhalfNV * v = cmd->v; 4439 CALL_Vertex4hvNV(ctx->CurrentServerDispatch, (v)); 4440 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Vertex4hvNV), 8) / 8); 4441 assert (cmd_size == cmd->cmd_base.cmd_size); 4442 return cmd_size; 4443} 4444void GLAPIENTRY 4445_mesa_marshal_Vertex4hvNV(const GLhalfNV * v) 4446{ 4447 GET_CURRENT_CONTEXT(ctx); 4448 int cmd_size = sizeof(struct marshal_cmd_Vertex4hvNV); 4449 struct marshal_cmd_Vertex4hvNV *cmd; 4450 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Vertex4hvNV, cmd_size); 4451 memcpy(cmd->v, v, 4 * sizeof(GLhalfNV)); 4452} 4453 4454 4455/* Normal3hNV: marshalled asynchronously */ 4456struct marshal_cmd_Normal3hNV 4457{ 4458 struct marshal_cmd_base cmd_base; 4459 GLhalfNV nx; 4460 GLhalfNV ny; 4461 GLhalfNV nz; 4462}; 4463uint32_t 4464_mesa_unmarshal_Normal3hNV(struct gl_context *ctx, const struct marshal_cmd_Normal3hNV *cmd, const uint64_t *last) 4465{ 4466 GLhalfNV nx = cmd->nx; 4467 GLhalfNV ny = cmd->ny; 4468 GLhalfNV nz = cmd->nz; 4469 CALL_Normal3hNV(ctx->CurrentServerDispatch, (nx, ny, nz)); 4470 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Normal3hNV), 8) / 8); 4471 assert (cmd_size == cmd->cmd_base.cmd_size); 4472 return cmd_size; 4473} 4474void GLAPIENTRY 4475_mesa_marshal_Normal3hNV(GLhalfNV nx, GLhalfNV ny, GLhalfNV nz) 4476{ 4477 GET_CURRENT_CONTEXT(ctx); 4478 int cmd_size = sizeof(struct marshal_cmd_Normal3hNV); 4479 struct marshal_cmd_Normal3hNV *cmd; 4480 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Normal3hNV, cmd_size); 4481 cmd->nx = nx; 4482 cmd->ny = ny; 4483 cmd->nz = nz; 4484} 4485 4486 4487/* Normal3hvNV: marshalled asynchronously */ 4488struct marshal_cmd_Normal3hvNV 4489{ 4490 struct marshal_cmd_base cmd_base; 4491 GLhalfNV v[3]; 4492}; 4493uint32_t 4494_mesa_unmarshal_Normal3hvNV(struct gl_context *ctx, const struct marshal_cmd_Normal3hvNV *cmd, const uint64_t *last) 4495{ 4496 const GLhalfNV * v = cmd->v; 4497 CALL_Normal3hvNV(ctx->CurrentServerDispatch, (v)); 4498 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Normal3hvNV), 8) / 8); 4499 assert (cmd_size == cmd->cmd_base.cmd_size); 4500 return cmd_size; 4501} 4502void GLAPIENTRY 4503_mesa_marshal_Normal3hvNV(const GLhalfNV * v) 4504{ 4505 GET_CURRENT_CONTEXT(ctx); 4506 int cmd_size = sizeof(struct marshal_cmd_Normal3hvNV); 4507 struct marshal_cmd_Normal3hvNV *cmd; 4508 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Normal3hvNV, cmd_size); 4509 memcpy(cmd->v, v, 3 * sizeof(GLhalfNV)); 4510} 4511 4512 4513/* Color3hNV: marshalled asynchronously */ 4514struct marshal_cmd_Color3hNV 4515{ 4516 struct marshal_cmd_base cmd_base; 4517 GLhalfNV red; 4518 GLhalfNV green; 4519 GLhalfNV blue; 4520}; 4521uint32_t 4522_mesa_unmarshal_Color3hNV(struct gl_context *ctx, const struct marshal_cmd_Color3hNV *cmd, const uint64_t *last) 4523{ 4524 GLhalfNV red = cmd->red; 4525 GLhalfNV green = cmd->green; 4526 GLhalfNV blue = cmd->blue; 4527 CALL_Color3hNV(ctx->CurrentServerDispatch, (red, green, blue)); 4528 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Color3hNV), 8) / 8); 4529 assert (cmd_size == cmd->cmd_base.cmd_size); 4530 return cmd_size; 4531} 4532void GLAPIENTRY 4533_mesa_marshal_Color3hNV(GLhalfNV red, GLhalfNV green, GLhalfNV blue) 4534{ 4535 GET_CURRENT_CONTEXT(ctx); 4536 int cmd_size = sizeof(struct marshal_cmd_Color3hNV); 4537 struct marshal_cmd_Color3hNV *cmd; 4538 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3hNV, cmd_size); 4539 cmd->red = red; 4540 cmd->green = green; 4541 cmd->blue = blue; 4542} 4543 4544 4545/* Color3hvNV: marshalled asynchronously */ 4546struct marshal_cmd_Color3hvNV 4547{ 4548 struct marshal_cmd_base cmd_base; 4549 GLhalfNV v[3]; 4550}; 4551uint32_t 4552_mesa_unmarshal_Color3hvNV(struct gl_context *ctx, const struct marshal_cmd_Color3hvNV *cmd, const uint64_t *last) 4553{ 4554 const GLhalfNV * v = cmd->v; 4555 CALL_Color3hvNV(ctx->CurrentServerDispatch, (v)); 4556 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Color3hvNV), 8) / 8); 4557 assert (cmd_size == cmd->cmd_base.cmd_size); 4558 return cmd_size; 4559} 4560void GLAPIENTRY 4561_mesa_marshal_Color3hvNV(const GLhalfNV * v) 4562{ 4563 GET_CURRENT_CONTEXT(ctx); 4564 int cmd_size = sizeof(struct marshal_cmd_Color3hvNV); 4565 struct marshal_cmd_Color3hvNV *cmd; 4566 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color3hvNV, cmd_size); 4567 memcpy(cmd->v, v, 3 * sizeof(GLhalfNV)); 4568} 4569 4570 4571/* Color4hNV: marshalled asynchronously */ 4572struct marshal_cmd_Color4hNV 4573{ 4574 struct marshal_cmd_base cmd_base; 4575 GLhalfNV red; 4576 GLhalfNV green; 4577 GLhalfNV blue; 4578 GLhalfNV alpha; 4579}; 4580uint32_t 4581_mesa_unmarshal_Color4hNV(struct gl_context *ctx, const struct marshal_cmd_Color4hNV *cmd, const uint64_t *last) 4582{ 4583 GLhalfNV red = cmd->red; 4584 GLhalfNV green = cmd->green; 4585 GLhalfNV blue = cmd->blue; 4586 GLhalfNV alpha = cmd->alpha; 4587 CALL_Color4hNV(ctx->CurrentServerDispatch, (red, green, blue, alpha)); 4588 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Color4hNV), 8) / 8); 4589 assert (cmd_size == cmd->cmd_base.cmd_size); 4590 return cmd_size; 4591} 4592void GLAPIENTRY 4593_mesa_marshal_Color4hNV(GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha) 4594{ 4595 GET_CURRENT_CONTEXT(ctx); 4596 int cmd_size = sizeof(struct marshal_cmd_Color4hNV); 4597 struct marshal_cmd_Color4hNV *cmd; 4598 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4hNV, cmd_size); 4599 cmd->red = red; 4600 cmd->green = green; 4601 cmd->blue = blue; 4602 cmd->alpha = alpha; 4603} 4604 4605 4606/* Color4hvNV: marshalled asynchronously */ 4607struct marshal_cmd_Color4hvNV 4608{ 4609 struct marshal_cmd_base cmd_base; 4610 GLhalfNV v[4]; 4611}; 4612uint32_t 4613_mesa_unmarshal_Color4hvNV(struct gl_context *ctx, const struct marshal_cmd_Color4hvNV *cmd, const uint64_t *last) 4614{ 4615 const GLhalfNV * v = cmd->v; 4616 CALL_Color4hvNV(ctx->CurrentServerDispatch, (v)); 4617 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Color4hvNV), 8) / 8); 4618 assert (cmd_size == cmd->cmd_base.cmd_size); 4619 return cmd_size; 4620} 4621void GLAPIENTRY 4622_mesa_marshal_Color4hvNV(const GLhalfNV * v) 4623{ 4624 GET_CURRENT_CONTEXT(ctx); 4625 int cmd_size = sizeof(struct marshal_cmd_Color4hvNV); 4626 struct marshal_cmd_Color4hvNV *cmd; 4627 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4hvNV, cmd_size); 4628 memcpy(cmd->v, v, 4 * sizeof(GLhalfNV)); 4629} 4630 4631 4632/* TexCoord1hNV: marshalled asynchronously */ 4633struct marshal_cmd_TexCoord1hNV 4634{ 4635 struct marshal_cmd_base cmd_base; 4636 GLhalfNV s; 4637}; 4638uint32_t 4639_mesa_unmarshal_TexCoord1hNV(struct gl_context *ctx, const struct marshal_cmd_TexCoord1hNV *cmd, const uint64_t *last) 4640{ 4641 GLhalfNV s = cmd->s; 4642 CALL_TexCoord1hNV(ctx->CurrentServerDispatch, (s)); 4643 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoord1hNV), 8) / 8); 4644 assert (cmd_size == cmd->cmd_base.cmd_size); 4645 return cmd_size; 4646} 4647void GLAPIENTRY 4648_mesa_marshal_TexCoord1hNV(GLhalfNV s) 4649{ 4650 GET_CURRENT_CONTEXT(ctx); 4651 int cmd_size = sizeof(struct marshal_cmd_TexCoord1hNV); 4652 struct marshal_cmd_TexCoord1hNV *cmd; 4653 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord1hNV, cmd_size); 4654 cmd->s = s; 4655} 4656 4657 4658/* TexCoord1hvNV: marshalled asynchronously */ 4659struct marshal_cmd_TexCoord1hvNV 4660{ 4661 struct marshal_cmd_base cmd_base; 4662 GLhalfNV v[1]; 4663}; 4664uint32_t 4665_mesa_unmarshal_TexCoord1hvNV(struct gl_context *ctx, const struct marshal_cmd_TexCoord1hvNV *cmd, const uint64_t *last) 4666{ 4667 const GLhalfNV * v = cmd->v; 4668 CALL_TexCoord1hvNV(ctx->CurrentServerDispatch, (v)); 4669 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoord1hvNV), 8) / 8); 4670 assert (cmd_size == cmd->cmd_base.cmd_size); 4671 return cmd_size; 4672} 4673void GLAPIENTRY 4674_mesa_marshal_TexCoord1hvNV(const GLhalfNV * v) 4675{ 4676 GET_CURRENT_CONTEXT(ctx); 4677 int cmd_size = sizeof(struct marshal_cmd_TexCoord1hvNV); 4678 struct marshal_cmd_TexCoord1hvNV *cmd; 4679 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord1hvNV, cmd_size); 4680 memcpy(cmd->v, v, 1 * sizeof(GLhalfNV)); 4681} 4682 4683 4684/* TexCoord2hNV: marshalled asynchronously */ 4685struct marshal_cmd_TexCoord2hNV 4686{ 4687 struct marshal_cmd_base cmd_base; 4688 GLhalfNV s; 4689 GLhalfNV t; 4690}; 4691uint32_t 4692_mesa_unmarshal_TexCoord2hNV(struct gl_context *ctx, const struct marshal_cmd_TexCoord2hNV *cmd, const uint64_t *last) 4693{ 4694 GLhalfNV s = cmd->s; 4695 GLhalfNV t = cmd->t; 4696 CALL_TexCoord2hNV(ctx->CurrentServerDispatch, (s, t)); 4697 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoord2hNV), 8) / 8); 4698 assert (cmd_size == cmd->cmd_base.cmd_size); 4699 return cmd_size; 4700} 4701void GLAPIENTRY 4702_mesa_marshal_TexCoord2hNV(GLhalfNV s, GLhalfNV t) 4703{ 4704 GET_CURRENT_CONTEXT(ctx); 4705 int cmd_size = sizeof(struct marshal_cmd_TexCoord2hNV); 4706 struct marshal_cmd_TexCoord2hNV *cmd; 4707 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord2hNV, cmd_size); 4708 cmd->s = s; 4709 cmd->t = t; 4710} 4711 4712 4713/* TexCoord2hvNV: marshalled asynchronously */ 4714struct marshal_cmd_TexCoord2hvNV 4715{ 4716 struct marshal_cmd_base cmd_base; 4717 GLhalfNV v[2]; 4718}; 4719uint32_t 4720_mesa_unmarshal_TexCoord2hvNV(struct gl_context *ctx, const struct marshal_cmd_TexCoord2hvNV *cmd, const uint64_t *last) 4721{ 4722 const GLhalfNV * v = cmd->v; 4723 CALL_TexCoord2hvNV(ctx->CurrentServerDispatch, (v)); 4724 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoord2hvNV), 8) / 8); 4725 assert (cmd_size == cmd->cmd_base.cmd_size); 4726 return cmd_size; 4727} 4728void GLAPIENTRY 4729_mesa_marshal_TexCoord2hvNV(const GLhalfNV * v) 4730{ 4731 GET_CURRENT_CONTEXT(ctx); 4732 int cmd_size = sizeof(struct marshal_cmd_TexCoord2hvNV); 4733 struct marshal_cmd_TexCoord2hvNV *cmd; 4734 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord2hvNV, cmd_size); 4735 memcpy(cmd->v, v, 2 * sizeof(GLhalfNV)); 4736} 4737 4738 4739/* TexCoord3hNV: marshalled asynchronously */ 4740struct marshal_cmd_TexCoord3hNV 4741{ 4742 struct marshal_cmd_base cmd_base; 4743 GLhalfNV s; 4744 GLhalfNV t; 4745 GLhalfNV r; 4746}; 4747uint32_t 4748_mesa_unmarshal_TexCoord3hNV(struct gl_context *ctx, const struct marshal_cmd_TexCoord3hNV *cmd, const uint64_t *last) 4749{ 4750 GLhalfNV s = cmd->s; 4751 GLhalfNV t = cmd->t; 4752 GLhalfNV r = cmd->r; 4753 CALL_TexCoord3hNV(ctx->CurrentServerDispatch, (s, t, r)); 4754 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoord3hNV), 8) / 8); 4755 assert (cmd_size == cmd->cmd_base.cmd_size); 4756 return cmd_size; 4757} 4758void GLAPIENTRY 4759_mesa_marshal_TexCoord3hNV(GLhalfNV s, GLhalfNV t, GLhalfNV r) 4760{ 4761 GET_CURRENT_CONTEXT(ctx); 4762 int cmd_size = sizeof(struct marshal_cmd_TexCoord3hNV); 4763 struct marshal_cmd_TexCoord3hNV *cmd; 4764 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord3hNV, cmd_size); 4765 cmd->s = s; 4766 cmd->t = t; 4767 cmd->r = r; 4768} 4769 4770 4771/* TexCoord3hvNV: marshalled asynchronously */ 4772struct marshal_cmd_TexCoord3hvNV 4773{ 4774 struct marshal_cmd_base cmd_base; 4775 GLhalfNV v[3]; 4776}; 4777uint32_t 4778_mesa_unmarshal_TexCoord3hvNV(struct gl_context *ctx, const struct marshal_cmd_TexCoord3hvNV *cmd, const uint64_t *last) 4779{ 4780 const GLhalfNV * v = cmd->v; 4781 CALL_TexCoord3hvNV(ctx->CurrentServerDispatch, (v)); 4782 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoord3hvNV), 8) / 8); 4783 assert (cmd_size == cmd->cmd_base.cmd_size); 4784 return cmd_size; 4785} 4786void GLAPIENTRY 4787_mesa_marshal_TexCoord3hvNV(const GLhalfNV * v) 4788{ 4789 GET_CURRENT_CONTEXT(ctx); 4790 int cmd_size = sizeof(struct marshal_cmd_TexCoord3hvNV); 4791 struct marshal_cmd_TexCoord3hvNV *cmd; 4792 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord3hvNV, cmd_size); 4793 memcpy(cmd->v, v, 3 * sizeof(GLhalfNV)); 4794} 4795 4796 4797/* TexCoord4hNV: marshalled asynchronously */ 4798struct marshal_cmd_TexCoord4hNV 4799{ 4800 struct marshal_cmd_base cmd_base; 4801 GLhalfNV s; 4802 GLhalfNV t; 4803 GLhalfNV r; 4804 GLhalfNV q; 4805}; 4806uint32_t 4807_mesa_unmarshal_TexCoord4hNV(struct gl_context *ctx, const struct marshal_cmd_TexCoord4hNV *cmd, const uint64_t *last) 4808{ 4809 GLhalfNV s = cmd->s; 4810 GLhalfNV t = cmd->t; 4811 GLhalfNV r = cmd->r; 4812 GLhalfNV q = cmd->q; 4813 CALL_TexCoord4hNV(ctx->CurrentServerDispatch, (s, t, r, q)); 4814 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoord4hNV), 8) / 8); 4815 assert (cmd_size == cmd->cmd_base.cmd_size); 4816 return cmd_size; 4817} 4818void GLAPIENTRY 4819_mesa_marshal_TexCoord4hNV(GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q) 4820{ 4821 GET_CURRENT_CONTEXT(ctx); 4822 int cmd_size = sizeof(struct marshal_cmd_TexCoord4hNV); 4823 struct marshal_cmd_TexCoord4hNV *cmd; 4824 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord4hNV, cmd_size); 4825 cmd->s = s; 4826 cmd->t = t; 4827 cmd->r = r; 4828 cmd->q = q; 4829} 4830 4831 4832/* TexCoord4hvNV: marshalled asynchronously */ 4833struct marshal_cmd_TexCoord4hvNV 4834{ 4835 struct marshal_cmd_base cmd_base; 4836 GLhalfNV v[4]; 4837}; 4838uint32_t 4839_mesa_unmarshal_TexCoord4hvNV(struct gl_context *ctx, const struct marshal_cmd_TexCoord4hvNV *cmd, const uint64_t *last) 4840{ 4841 const GLhalfNV * v = cmd->v; 4842 CALL_TexCoord4hvNV(ctx->CurrentServerDispatch, (v)); 4843 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexCoord4hvNV), 8) / 8); 4844 assert (cmd_size == cmd->cmd_base.cmd_size); 4845 return cmd_size; 4846} 4847void GLAPIENTRY 4848_mesa_marshal_TexCoord4hvNV(const GLhalfNV * v) 4849{ 4850 GET_CURRENT_CONTEXT(ctx); 4851 int cmd_size = sizeof(struct marshal_cmd_TexCoord4hvNV); 4852 struct marshal_cmd_TexCoord4hvNV *cmd; 4853 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexCoord4hvNV, cmd_size); 4854 memcpy(cmd->v, v, 4 * sizeof(GLhalfNV)); 4855} 4856 4857 4858/* MultiTexCoord1hNV: marshalled asynchronously */ 4859struct marshal_cmd_MultiTexCoord1hNV 4860{ 4861 struct marshal_cmd_base cmd_base; 4862 GLhalfNV s; 4863 GLenum target; 4864}; 4865uint32_t 4866_mesa_unmarshal_MultiTexCoord1hNV(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1hNV *cmd, const uint64_t *last) 4867{ 4868 GLenum target = cmd->target; 4869 GLhalfNV s = cmd->s; 4870 CALL_MultiTexCoord1hNV(ctx->CurrentServerDispatch, (target, s)); 4871 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord1hNV), 8) / 8); 4872 assert (cmd_size == cmd->cmd_base.cmd_size); 4873 return cmd_size; 4874} 4875void GLAPIENTRY 4876_mesa_marshal_MultiTexCoord1hNV(GLenum target, GLhalfNV s) 4877{ 4878 GET_CURRENT_CONTEXT(ctx); 4879 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1hNV); 4880 struct marshal_cmd_MultiTexCoord1hNV *cmd; 4881 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1hNV, cmd_size); 4882 cmd->target = target; 4883 cmd->s = s; 4884} 4885 4886 4887/* MultiTexCoord1hvNV: marshalled asynchronously */ 4888struct marshal_cmd_MultiTexCoord1hvNV 4889{ 4890 struct marshal_cmd_base cmd_base; 4891 GLenum target; 4892 GLhalfNV v[1]; 4893}; 4894uint32_t 4895_mesa_unmarshal_MultiTexCoord1hvNV(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord1hvNV *cmd, const uint64_t *last) 4896{ 4897 GLenum target = cmd->target; 4898 const GLhalfNV * v = cmd->v; 4899 CALL_MultiTexCoord1hvNV(ctx->CurrentServerDispatch, (target, v)); 4900 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord1hvNV), 8) / 8); 4901 assert (cmd_size == cmd->cmd_base.cmd_size); 4902 return cmd_size; 4903} 4904void GLAPIENTRY 4905_mesa_marshal_MultiTexCoord1hvNV(GLenum target, const GLhalfNV * v) 4906{ 4907 GET_CURRENT_CONTEXT(ctx); 4908 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord1hvNV); 4909 struct marshal_cmd_MultiTexCoord1hvNV *cmd; 4910 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord1hvNV, cmd_size); 4911 cmd->target = target; 4912 memcpy(cmd->v, v, 1 * sizeof(GLhalfNV)); 4913} 4914 4915 4916/* MultiTexCoord2hNV: marshalled asynchronously */ 4917struct marshal_cmd_MultiTexCoord2hNV 4918{ 4919 struct marshal_cmd_base cmd_base; 4920 GLhalfNV s; 4921 GLhalfNV t; 4922 GLenum target; 4923}; 4924uint32_t 4925_mesa_unmarshal_MultiTexCoord2hNV(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2hNV *cmd, const uint64_t *last) 4926{ 4927 GLenum target = cmd->target; 4928 GLhalfNV s = cmd->s; 4929 GLhalfNV t = cmd->t; 4930 CALL_MultiTexCoord2hNV(ctx->CurrentServerDispatch, (target, s, t)); 4931 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord2hNV), 8) / 8); 4932 assert (cmd_size == cmd->cmd_base.cmd_size); 4933 return cmd_size; 4934} 4935void GLAPIENTRY 4936_mesa_marshal_MultiTexCoord2hNV(GLenum target, GLhalfNV s, GLhalfNV t) 4937{ 4938 GET_CURRENT_CONTEXT(ctx); 4939 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2hNV); 4940 struct marshal_cmd_MultiTexCoord2hNV *cmd; 4941 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2hNV, cmd_size); 4942 cmd->target = target; 4943 cmd->s = s; 4944 cmd->t = t; 4945} 4946 4947 4948/* MultiTexCoord2hvNV: marshalled asynchronously */ 4949struct marshal_cmd_MultiTexCoord2hvNV 4950{ 4951 struct marshal_cmd_base cmd_base; 4952 GLenum target; 4953 GLhalfNV v[2]; 4954}; 4955uint32_t 4956_mesa_unmarshal_MultiTexCoord2hvNV(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord2hvNV *cmd, const uint64_t *last) 4957{ 4958 GLenum target = cmd->target; 4959 const GLhalfNV * v = cmd->v; 4960 CALL_MultiTexCoord2hvNV(ctx->CurrentServerDispatch, (target, v)); 4961 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord2hvNV), 8) / 8); 4962 assert (cmd_size == cmd->cmd_base.cmd_size); 4963 return cmd_size; 4964} 4965void GLAPIENTRY 4966_mesa_marshal_MultiTexCoord2hvNV(GLenum target, const GLhalfNV * v) 4967{ 4968 GET_CURRENT_CONTEXT(ctx); 4969 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord2hvNV); 4970 struct marshal_cmd_MultiTexCoord2hvNV *cmd; 4971 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord2hvNV, cmd_size); 4972 cmd->target = target; 4973 memcpy(cmd->v, v, 2 * sizeof(GLhalfNV)); 4974} 4975 4976 4977/* MultiTexCoord3hNV: marshalled asynchronously */ 4978struct marshal_cmd_MultiTexCoord3hNV 4979{ 4980 struct marshal_cmd_base cmd_base; 4981 GLhalfNV s; 4982 GLhalfNV t; 4983 GLhalfNV r; 4984 GLenum target; 4985}; 4986uint32_t 4987_mesa_unmarshal_MultiTexCoord3hNV(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3hNV *cmd, const uint64_t *last) 4988{ 4989 GLenum target = cmd->target; 4990 GLhalfNV s = cmd->s; 4991 GLhalfNV t = cmd->t; 4992 GLhalfNV r = cmd->r; 4993 CALL_MultiTexCoord3hNV(ctx->CurrentServerDispatch, (target, s, t, r)); 4994 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord3hNV), 8) / 8); 4995 assert (cmd_size == cmd->cmd_base.cmd_size); 4996 return cmd_size; 4997} 4998void GLAPIENTRY 4999_mesa_marshal_MultiTexCoord3hNV(GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r) 5000{ 5001 GET_CURRENT_CONTEXT(ctx); 5002 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3hNV); 5003 struct marshal_cmd_MultiTexCoord3hNV *cmd; 5004 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3hNV, cmd_size); 5005 cmd->target = target; 5006 cmd->s = s; 5007 cmd->t = t; 5008 cmd->r = r; 5009} 5010 5011 5012/* MultiTexCoord3hvNV: marshalled asynchronously */ 5013struct marshal_cmd_MultiTexCoord3hvNV 5014{ 5015 struct marshal_cmd_base cmd_base; 5016 GLenum target; 5017 GLhalfNV v[3]; 5018}; 5019uint32_t 5020_mesa_unmarshal_MultiTexCoord3hvNV(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord3hvNV *cmd, const uint64_t *last) 5021{ 5022 GLenum target = cmd->target; 5023 const GLhalfNV * v = cmd->v; 5024 CALL_MultiTexCoord3hvNV(ctx->CurrentServerDispatch, (target, v)); 5025 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord3hvNV), 8) / 8); 5026 assert (cmd_size == cmd->cmd_base.cmd_size); 5027 return cmd_size; 5028} 5029void GLAPIENTRY 5030_mesa_marshal_MultiTexCoord3hvNV(GLenum target, const GLhalfNV * v) 5031{ 5032 GET_CURRENT_CONTEXT(ctx); 5033 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord3hvNV); 5034 struct marshal_cmd_MultiTexCoord3hvNV *cmd; 5035 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord3hvNV, cmd_size); 5036 cmd->target = target; 5037 memcpy(cmd->v, v, 3 * sizeof(GLhalfNV)); 5038} 5039 5040 5041/* MultiTexCoord4hNV: marshalled asynchronously */ 5042struct marshal_cmd_MultiTexCoord4hNV 5043{ 5044 struct marshal_cmd_base cmd_base; 5045 GLhalfNV s; 5046 GLhalfNV t; 5047 GLhalfNV r; 5048 GLhalfNV q; 5049 GLenum target; 5050}; 5051uint32_t 5052_mesa_unmarshal_MultiTexCoord4hNV(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4hNV *cmd, const uint64_t *last) 5053{ 5054 GLenum target = cmd->target; 5055 GLhalfNV s = cmd->s; 5056 GLhalfNV t = cmd->t; 5057 GLhalfNV r = cmd->r; 5058 GLhalfNV q = cmd->q; 5059 CALL_MultiTexCoord4hNV(ctx->CurrentServerDispatch, (target, s, t, r, q)); 5060 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord4hNV), 8) / 8); 5061 assert (cmd_size == cmd->cmd_base.cmd_size); 5062 return cmd_size; 5063} 5064void GLAPIENTRY 5065_mesa_marshal_MultiTexCoord4hNV(GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q) 5066{ 5067 GET_CURRENT_CONTEXT(ctx); 5068 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4hNV); 5069 struct marshal_cmd_MultiTexCoord4hNV *cmd; 5070 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4hNV, cmd_size); 5071 cmd->target = target; 5072 cmd->s = s; 5073 cmd->t = t; 5074 cmd->r = r; 5075 cmd->q = q; 5076} 5077 5078 5079/* MultiTexCoord4hvNV: marshalled asynchronously */ 5080struct marshal_cmd_MultiTexCoord4hvNV 5081{ 5082 struct marshal_cmd_base cmd_base; 5083 GLenum target; 5084 GLhalfNV v[4]; 5085}; 5086uint32_t 5087_mesa_unmarshal_MultiTexCoord4hvNV(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4hvNV *cmd, const uint64_t *last) 5088{ 5089 GLenum target = cmd->target; 5090 const GLhalfNV * v = cmd->v; 5091 CALL_MultiTexCoord4hvNV(ctx->CurrentServerDispatch, (target, v)); 5092 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord4hvNV), 8) / 8); 5093 assert (cmd_size == cmd->cmd_base.cmd_size); 5094 return cmd_size; 5095} 5096void GLAPIENTRY 5097_mesa_marshal_MultiTexCoord4hvNV(GLenum target, const GLhalfNV * v) 5098{ 5099 GET_CURRENT_CONTEXT(ctx); 5100 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4hvNV); 5101 struct marshal_cmd_MultiTexCoord4hvNV *cmd; 5102 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4hvNV, cmd_size); 5103 cmd->target = target; 5104 memcpy(cmd->v, v, 4 * sizeof(GLhalfNV)); 5105} 5106 5107 5108/* VertexAttrib1hNV: marshalled asynchronously */ 5109struct marshal_cmd_VertexAttrib1hNV 5110{ 5111 struct marshal_cmd_base cmd_base; 5112 GLhalfNV x; 5113 GLuint index; 5114}; 5115uint32_t 5116_mesa_unmarshal_VertexAttrib1hNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1hNV *cmd, const uint64_t *last) 5117{ 5118 GLuint index = cmd->index; 5119 GLhalfNV x = cmd->x; 5120 CALL_VertexAttrib1hNV(ctx->CurrentServerDispatch, (index, x)); 5121 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib1hNV), 8) / 8); 5122 assert (cmd_size == cmd->cmd_base.cmd_size); 5123 return cmd_size; 5124} 5125void GLAPIENTRY 5126_mesa_marshal_VertexAttrib1hNV(GLuint index, GLhalfNV x) 5127{ 5128 GET_CURRENT_CONTEXT(ctx); 5129 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib1hNV); 5130 struct marshal_cmd_VertexAttrib1hNV *cmd; 5131 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1hNV, cmd_size); 5132 cmd->index = index; 5133 cmd->x = x; 5134} 5135 5136 5137/* VertexAttrib1hvNV: marshalled asynchronously */ 5138struct marshal_cmd_VertexAttrib1hvNV 5139{ 5140 struct marshal_cmd_base cmd_base; 5141 GLuint index; 5142 GLhalfNV v[1]; 5143}; 5144uint32_t 5145_mesa_unmarshal_VertexAttrib1hvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib1hvNV *cmd, const uint64_t *last) 5146{ 5147 GLuint index = cmd->index; 5148 const GLhalfNV * v = cmd->v; 5149 CALL_VertexAttrib1hvNV(ctx->CurrentServerDispatch, (index, v)); 5150 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib1hvNV), 8) / 8); 5151 assert (cmd_size == cmd->cmd_base.cmd_size); 5152 return cmd_size; 5153} 5154void GLAPIENTRY 5155_mesa_marshal_VertexAttrib1hvNV(GLuint index, const GLhalfNV * v) 5156{ 5157 GET_CURRENT_CONTEXT(ctx); 5158 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib1hvNV); 5159 struct marshal_cmd_VertexAttrib1hvNV *cmd; 5160 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib1hvNV, cmd_size); 5161 cmd->index = index; 5162 memcpy(cmd->v, v, 1 * sizeof(GLhalfNV)); 5163} 5164 5165 5166/* VertexAttrib2hNV: marshalled asynchronously */ 5167struct marshal_cmd_VertexAttrib2hNV 5168{ 5169 struct marshal_cmd_base cmd_base; 5170 GLhalfNV x; 5171 GLhalfNV y; 5172 GLuint index; 5173}; 5174uint32_t 5175_mesa_unmarshal_VertexAttrib2hNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2hNV *cmd, const uint64_t *last) 5176{ 5177 GLuint index = cmd->index; 5178 GLhalfNV x = cmd->x; 5179 GLhalfNV y = cmd->y; 5180 CALL_VertexAttrib2hNV(ctx->CurrentServerDispatch, (index, x, y)); 5181 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib2hNV), 8) / 8); 5182 assert (cmd_size == cmd->cmd_base.cmd_size); 5183 return cmd_size; 5184} 5185void GLAPIENTRY 5186_mesa_marshal_VertexAttrib2hNV(GLuint index, GLhalfNV x, GLhalfNV y) 5187{ 5188 GET_CURRENT_CONTEXT(ctx); 5189 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib2hNV); 5190 struct marshal_cmd_VertexAttrib2hNV *cmd; 5191 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2hNV, cmd_size); 5192 cmd->index = index; 5193 cmd->x = x; 5194 cmd->y = y; 5195} 5196 5197 5198/* VertexAttrib2hvNV: marshalled asynchronously */ 5199struct marshal_cmd_VertexAttrib2hvNV 5200{ 5201 struct marshal_cmd_base cmd_base; 5202 GLuint index; 5203 GLhalfNV v[2]; 5204}; 5205uint32_t 5206_mesa_unmarshal_VertexAttrib2hvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib2hvNV *cmd, const uint64_t *last) 5207{ 5208 GLuint index = cmd->index; 5209 const GLhalfNV * v = cmd->v; 5210 CALL_VertexAttrib2hvNV(ctx->CurrentServerDispatch, (index, v)); 5211 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib2hvNV), 8) / 8); 5212 assert (cmd_size == cmd->cmd_base.cmd_size); 5213 return cmd_size; 5214} 5215void GLAPIENTRY 5216_mesa_marshal_VertexAttrib2hvNV(GLuint index, const GLhalfNV * v) 5217{ 5218 GET_CURRENT_CONTEXT(ctx); 5219 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib2hvNV); 5220 struct marshal_cmd_VertexAttrib2hvNV *cmd; 5221 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib2hvNV, cmd_size); 5222 cmd->index = index; 5223 memcpy(cmd->v, v, 2 * sizeof(GLhalfNV)); 5224} 5225 5226 5227/* VertexAttrib3hNV: marshalled asynchronously */ 5228struct marshal_cmd_VertexAttrib3hNV 5229{ 5230 struct marshal_cmd_base cmd_base; 5231 GLhalfNV x; 5232 GLhalfNV y; 5233 GLhalfNV z; 5234 GLuint index; 5235}; 5236uint32_t 5237_mesa_unmarshal_VertexAttrib3hNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3hNV *cmd, const uint64_t *last) 5238{ 5239 GLuint index = cmd->index; 5240 GLhalfNV x = cmd->x; 5241 GLhalfNV y = cmd->y; 5242 GLhalfNV z = cmd->z; 5243 CALL_VertexAttrib3hNV(ctx->CurrentServerDispatch, (index, x, y, z)); 5244 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib3hNV), 8) / 8); 5245 assert (cmd_size == cmd->cmd_base.cmd_size); 5246 return cmd_size; 5247} 5248void GLAPIENTRY 5249_mesa_marshal_VertexAttrib3hNV(GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z) 5250{ 5251 GET_CURRENT_CONTEXT(ctx); 5252 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib3hNV); 5253 struct marshal_cmd_VertexAttrib3hNV *cmd; 5254 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3hNV, cmd_size); 5255 cmd->index = index; 5256 cmd->x = x; 5257 cmd->y = y; 5258 cmd->z = z; 5259} 5260 5261 5262/* VertexAttrib3hvNV: marshalled asynchronously */ 5263struct marshal_cmd_VertexAttrib3hvNV 5264{ 5265 struct marshal_cmd_base cmd_base; 5266 GLuint index; 5267 GLhalfNV v[3]; 5268}; 5269uint32_t 5270_mesa_unmarshal_VertexAttrib3hvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib3hvNV *cmd, const uint64_t *last) 5271{ 5272 GLuint index = cmd->index; 5273 const GLhalfNV * v = cmd->v; 5274 CALL_VertexAttrib3hvNV(ctx->CurrentServerDispatch, (index, v)); 5275 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib3hvNV), 8) / 8); 5276 assert (cmd_size == cmd->cmd_base.cmd_size); 5277 return cmd_size; 5278} 5279void GLAPIENTRY 5280_mesa_marshal_VertexAttrib3hvNV(GLuint index, const GLhalfNV * v) 5281{ 5282 GET_CURRENT_CONTEXT(ctx); 5283 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib3hvNV); 5284 struct marshal_cmd_VertexAttrib3hvNV *cmd; 5285 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib3hvNV, cmd_size); 5286 cmd->index = index; 5287 memcpy(cmd->v, v, 3 * sizeof(GLhalfNV)); 5288} 5289 5290 5291/* VertexAttrib4hNV: marshalled asynchronously */ 5292struct marshal_cmd_VertexAttrib4hNV 5293{ 5294 struct marshal_cmd_base cmd_base; 5295 GLhalfNV x; 5296 GLhalfNV y; 5297 GLhalfNV z; 5298 GLhalfNV w; 5299 GLuint index; 5300}; 5301uint32_t 5302_mesa_unmarshal_VertexAttrib4hNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4hNV *cmd, const uint64_t *last) 5303{ 5304 GLuint index = cmd->index; 5305 GLhalfNV x = cmd->x; 5306 GLhalfNV y = cmd->y; 5307 GLhalfNV z = cmd->z; 5308 GLhalfNV w = cmd->w; 5309 CALL_VertexAttrib4hNV(ctx->CurrentServerDispatch, (index, x, y, z, w)); 5310 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4hNV), 8) / 8); 5311 assert (cmd_size == cmd->cmd_base.cmd_size); 5312 return cmd_size; 5313} 5314void GLAPIENTRY 5315_mesa_marshal_VertexAttrib4hNV(GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w) 5316{ 5317 GET_CURRENT_CONTEXT(ctx); 5318 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4hNV); 5319 struct marshal_cmd_VertexAttrib4hNV *cmd; 5320 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4hNV, cmd_size); 5321 cmd->index = index; 5322 cmd->x = x; 5323 cmd->y = y; 5324 cmd->z = z; 5325 cmd->w = w; 5326} 5327 5328 5329/* VertexAttrib4hvNV: marshalled asynchronously */ 5330struct marshal_cmd_VertexAttrib4hvNV 5331{ 5332 struct marshal_cmd_base cmd_base; 5333 GLuint index; 5334 GLhalfNV v[4]; 5335}; 5336uint32_t 5337_mesa_unmarshal_VertexAttrib4hvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttrib4hvNV *cmd, const uint64_t *last) 5338{ 5339 GLuint index = cmd->index; 5340 const GLhalfNV * v = cmd->v; 5341 CALL_VertexAttrib4hvNV(ctx->CurrentServerDispatch, (index, v)); 5342 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_VertexAttrib4hvNV), 8) / 8); 5343 assert (cmd_size == cmd->cmd_base.cmd_size); 5344 return cmd_size; 5345} 5346void GLAPIENTRY 5347_mesa_marshal_VertexAttrib4hvNV(GLuint index, const GLhalfNV * v) 5348{ 5349 GET_CURRENT_CONTEXT(ctx); 5350 int cmd_size = sizeof(struct marshal_cmd_VertexAttrib4hvNV); 5351 struct marshal_cmd_VertexAttrib4hvNV *cmd; 5352 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttrib4hvNV, cmd_size); 5353 cmd->index = index; 5354 memcpy(cmd->v, v, 4 * sizeof(GLhalfNV)); 5355} 5356 5357 5358/* VertexAttribs1hvNV: marshalled asynchronously */ 5359struct marshal_cmd_VertexAttribs1hvNV 5360{ 5361 struct marshal_cmd_base cmd_base; 5362 GLuint index; 5363 GLsizei n; 5364 /* Next safe_mul(n, 1 * sizeof(GLhalfNV)) bytes are GLhalfNV v[n] */ 5365}; 5366uint32_t 5367_mesa_unmarshal_VertexAttribs1hvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs1hvNV *cmd, const uint64_t *last) 5368{ 5369 GLuint index = cmd->index; 5370 GLsizei n = cmd->n; 5371 GLhalfNV * v; 5372 const char *variable_data = (const char *) (cmd + 1); 5373 v = (GLhalfNV *) variable_data; 5374 CALL_VertexAttribs1hvNV(ctx->CurrentServerDispatch, (index, n, v)); 5375 return cmd->cmd_base.cmd_size; 5376} 5377void GLAPIENTRY 5378_mesa_marshal_VertexAttribs1hvNV(GLuint index, GLsizei n, const GLhalfNV * v) 5379{ 5380 GET_CURRENT_CONTEXT(ctx); 5381 int v_size = safe_mul(n, 1 * sizeof(GLhalfNV)); 5382 int cmd_size = sizeof(struct marshal_cmd_VertexAttribs1hvNV) + v_size; 5383 struct marshal_cmd_VertexAttribs1hvNV *cmd; 5384 if (unlikely(v_size < 0 || (v_size > 0 && !v) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5385 _mesa_glthread_finish_before(ctx, "VertexAttribs1hvNV"); 5386 CALL_VertexAttribs1hvNV(ctx->CurrentServerDispatch, (index, n, v)); 5387 return; 5388 } 5389 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs1hvNV, cmd_size); 5390 cmd->index = index; 5391 cmd->n = n; 5392 char *variable_data = (char *) (cmd + 1); 5393 memcpy(variable_data, v, v_size); 5394} 5395 5396 5397/* VertexAttribs2hvNV: marshalled asynchronously */ 5398struct marshal_cmd_VertexAttribs2hvNV 5399{ 5400 struct marshal_cmd_base cmd_base; 5401 GLuint index; 5402 GLsizei n; 5403 /* Next safe_mul(n, 2 * sizeof(GLhalfNV)) bytes are GLhalfNV v[n][2] */ 5404}; 5405uint32_t 5406_mesa_unmarshal_VertexAttribs2hvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs2hvNV *cmd, const uint64_t *last) 5407{ 5408 GLuint index = cmd->index; 5409 GLsizei n = cmd->n; 5410 GLhalfNV * v; 5411 const char *variable_data = (const char *) (cmd + 1); 5412 v = (GLhalfNV *) variable_data; 5413 CALL_VertexAttribs2hvNV(ctx->CurrentServerDispatch, (index, n, v)); 5414 return cmd->cmd_base.cmd_size; 5415} 5416void GLAPIENTRY 5417_mesa_marshal_VertexAttribs2hvNV(GLuint index, GLsizei n, const GLhalfNV * v) 5418{ 5419 GET_CURRENT_CONTEXT(ctx); 5420 int v_size = safe_mul(n, 2 * sizeof(GLhalfNV)); 5421 int cmd_size = sizeof(struct marshal_cmd_VertexAttribs2hvNV) + v_size; 5422 struct marshal_cmd_VertexAttribs2hvNV *cmd; 5423 if (unlikely(v_size < 0 || (v_size > 0 && !v) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5424 _mesa_glthread_finish_before(ctx, "VertexAttribs2hvNV"); 5425 CALL_VertexAttribs2hvNV(ctx->CurrentServerDispatch, (index, n, v)); 5426 return; 5427 } 5428 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs2hvNV, cmd_size); 5429 cmd->index = index; 5430 cmd->n = n; 5431 char *variable_data = (char *) (cmd + 1); 5432 memcpy(variable_data, v, v_size); 5433} 5434 5435 5436/* VertexAttribs3hvNV: marshalled asynchronously */ 5437struct marshal_cmd_VertexAttribs3hvNV 5438{ 5439 struct marshal_cmd_base cmd_base; 5440 GLuint index; 5441 GLsizei n; 5442 /* Next safe_mul(n, 3 * sizeof(GLhalfNV)) bytes are GLhalfNV v[n][3] */ 5443}; 5444uint32_t 5445_mesa_unmarshal_VertexAttribs3hvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs3hvNV *cmd, const uint64_t *last) 5446{ 5447 GLuint index = cmd->index; 5448 GLsizei n = cmd->n; 5449 GLhalfNV * v; 5450 const char *variable_data = (const char *) (cmd + 1); 5451 v = (GLhalfNV *) variable_data; 5452 CALL_VertexAttribs3hvNV(ctx->CurrentServerDispatch, (index, n, v)); 5453 return cmd->cmd_base.cmd_size; 5454} 5455void GLAPIENTRY 5456_mesa_marshal_VertexAttribs3hvNV(GLuint index, GLsizei n, const GLhalfNV * v) 5457{ 5458 GET_CURRENT_CONTEXT(ctx); 5459 int v_size = safe_mul(n, 3 * sizeof(GLhalfNV)); 5460 int cmd_size = sizeof(struct marshal_cmd_VertexAttribs3hvNV) + v_size; 5461 struct marshal_cmd_VertexAttribs3hvNV *cmd; 5462 if (unlikely(v_size < 0 || (v_size > 0 && !v) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5463 _mesa_glthread_finish_before(ctx, "VertexAttribs3hvNV"); 5464 CALL_VertexAttribs3hvNV(ctx->CurrentServerDispatch, (index, n, v)); 5465 return; 5466 } 5467 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs3hvNV, cmd_size); 5468 cmd->index = index; 5469 cmd->n = n; 5470 char *variable_data = (char *) (cmd + 1); 5471 memcpy(variable_data, v, v_size); 5472} 5473 5474 5475/* VertexAttribs4hvNV: marshalled asynchronously */ 5476struct marshal_cmd_VertexAttribs4hvNV 5477{ 5478 struct marshal_cmd_base cmd_base; 5479 GLuint index; 5480 GLsizei n; 5481 /* Next safe_mul(n, 4 * sizeof(GLhalfNV)) bytes are GLhalfNV v[n][4] */ 5482}; 5483uint32_t 5484_mesa_unmarshal_VertexAttribs4hvNV(struct gl_context *ctx, const struct marshal_cmd_VertexAttribs4hvNV *cmd, const uint64_t *last) 5485{ 5486 GLuint index = cmd->index; 5487 GLsizei n = cmd->n; 5488 GLhalfNV * v; 5489 const char *variable_data = (const char *) (cmd + 1); 5490 v = (GLhalfNV *) variable_data; 5491 CALL_VertexAttribs4hvNV(ctx->CurrentServerDispatch, (index, n, v)); 5492 return cmd->cmd_base.cmd_size; 5493} 5494void GLAPIENTRY 5495_mesa_marshal_VertexAttribs4hvNV(GLuint index, GLsizei n, const GLhalfNV * v) 5496{ 5497 GET_CURRENT_CONTEXT(ctx); 5498 int v_size = safe_mul(n, 4 * sizeof(GLhalfNV)); 5499 int cmd_size = sizeof(struct marshal_cmd_VertexAttribs4hvNV) + v_size; 5500 struct marshal_cmd_VertexAttribs4hvNV *cmd; 5501 if (unlikely(v_size < 0 || (v_size > 0 && !v) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5502 _mesa_glthread_finish_before(ctx, "VertexAttribs4hvNV"); 5503 CALL_VertexAttribs4hvNV(ctx->CurrentServerDispatch, (index, n, v)); 5504 return; 5505 } 5506 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_VertexAttribs4hvNV, cmd_size); 5507 cmd->index = index; 5508 cmd->n = n; 5509 char *variable_data = (char *) (cmd + 1); 5510 memcpy(variable_data, v, v_size); 5511} 5512 5513 5514/* FogCoordhNV: marshalled asynchronously */ 5515struct marshal_cmd_FogCoordhNV 5516{ 5517 struct marshal_cmd_base cmd_base; 5518 GLhalfNV x; 5519}; 5520uint32_t 5521_mesa_unmarshal_FogCoordhNV(struct gl_context *ctx, const struct marshal_cmd_FogCoordhNV *cmd, const uint64_t *last) 5522{ 5523 GLhalfNV x = cmd->x; 5524 CALL_FogCoordhNV(ctx->CurrentServerDispatch, (x)); 5525 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FogCoordhNV), 8) / 8); 5526 assert (cmd_size == cmd->cmd_base.cmd_size); 5527 return cmd_size; 5528} 5529void GLAPIENTRY 5530_mesa_marshal_FogCoordhNV(GLhalfNV x) 5531{ 5532 GET_CURRENT_CONTEXT(ctx); 5533 int cmd_size = sizeof(struct marshal_cmd_FogCoordhNV); 5534 struct marshal_cmd_FogCoordhNV *cmd; 5535 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FogCoordhNV, cmd_size); 5536 cmd->x = x; 5537} 5538 5539 5540/* FogCoordhvNV: marshalled asynchronously */ 5541struct marshal_cmd_FogCoordhvNV 5542{ 5543 struct marshal_cmd_base cmd_base; 5544 GLhalfNV v[1]; 5545}; 5546uint32_t 5547_mesa_unmarshal_FogCoordhvNV(struct gl_context *ctx, const struct marshal_cmd_FogCoordhvNV *cmd, const uint64_t *last) 5548{ 5549 const GLhalfNV * v = cmd->v; 5550 CALL_FogCoordhvNV(ctx->CurrentServerDispatch, (v)); 5551 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FogCoordhvNV), 8) / 8); 5552 assert (cmd_size == cmd->cmd_base.cmd_size); 5553 return cmd_size; 5554} 5555void GLAPIENTRY 5556_mesa_marshal_FogCoordhvNV(const GLhalfNV * v) 5557{ 5558 GET_CURRENT_CONTEXT(ctx); 5559 int cmd_size = sizeof(struct marshal_cmd_FogCoordhvNV); 5560 struct marshal_cmd_FogCoordhvNV *cmd; 5561 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FogCoordhvNV, cmd_size); 5562 memcpy(cmd->v, v, 1 * sizeof(GLhalfNV)); 5563} 5564 5565 5566/* SecondaryColor3hNV: marshalled asynchronously */ 5567struct marshal_cmd_SecondaryColor3hNV 5568{ 5569 struct marshal_cmd_base cmd_base; 5570 GLhalfNV red; 5571 GLhalfNV green; 5572 GLhalfNV blue; 5573}; 5574uint32_t 5575_mesa_unmarshal_SecondaryColor3hNV(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3hNV *cmd, const uint64_t *last) 5576{ 5577 GLhalfNV red = cmd->red; 5578 GLhalfNV green = cmd->green; 5579 GLhalfNV blue = cmd->blue; 5580 CALL_SecondaryColor3hNV(ctx->CurrentServerDispatch, (red, green, blue)); 5581 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3hNV), 8) / 8); 5582 assert (cmd_size == cmd->cmd_base.cmd_size); 5583 return cmd_size; 5584} 5585void GLAPIENTRY 5586_mesa_marshal_SecondaryColor3hNV(GLhalfNV red, GLhalfNV green, GLhalfNV blue) 5587{ 5588 GET_CURRENT_CONTEXT(ctx); 5589 int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3hNV); 5590 struct marshal_cmd_SecondaryColor3hNV *cmd; 5591 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3hNV, cmd_size); 5592 cmd->red = red; 5593 cmd->green = green; 5594 cmd->blue = blue; 5595} 5596 5597 5598/* SecondaryColor3hvNV: marshalled asynchronously */ 5599struct marshal_cmd_SecondaryColor3hvNV 5600{ 5601 struct marshal_cmd_base cmd_base; 5602 GLhalfNV v[3]; 5603}; 5604uint32_t 5605_mesa_unmarshal_SecondaryColor3hvNV(struct gl_context *ctx, const struct marshal_cmd_SecondaryColor3hvNV *cmd, const uint64_t *last) 5606{ 5607 const GLhalfNV * v = cmd->v; 5608 CALL_SecondaryColor3hvNV(ctx->CurrentServerDispatch, (v)); 5609 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SecondaryColor3hvNV), 8) / 8); 5610 assert (cmd_size == cmd->cmd_base.cmd_size); 5611 return cmd_size; 5612} 5613void GLAPIENTRY 5614_mesa_marshal_SecondaryColor3hvNV(const GLhalfNV * v) 5615{ 5616 GET_CURRENT_CONTEXT(ctx); 5617 int cmd_size = sizeof(struct marshal_cmd_SecondaryColor3hvNV); 5618 struct marshal_cmd_SecondaryColor3hvNV *cmd; 5619 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SecondaryColor3hvNV, cmd_size); 5620 memcpy(cmd->v, v, 3 * sizeof(GLhalfNV)); 5621} 5622 5623 5624/* MemoryBarrierByRegion: marshalled asynchronously */ 5625struct marshal_cmd_MemoryBarrierByRegion 5626{ 5627 struct marshal_cmd_base cmd_base; 5628 GLbitfield barriers; 5629}; 5630uint32_t 5631_mesa_unmarshal_MemoryBarrierByRegion(struct gl_context *ctx, const struct marshal_cmd_MemoryBarrierByRegion *cmd, const uint64_t *last) 5632{ 5633 GLbitfield barriers = cmd->barriers; 5634 CALL_MemoryBarrierByRegion(ctx->CurrentServerDispatch, (barriers)); 5635 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MemoryBarrierByRegion), 8) / 8); 5636 assert (cmd_size == cmd->cmd_base.cmd_size); 5637 return cmd_size; 5638} 5639void GLAPIENTRY 5640_mesa_marshal_MemoryBarrierByRegion(GLbitfield barriers) 5641{ 5642 GET_CURRENT_CONTEXT(ctx); 5643 int cmd_size = sizeof(struct marshal_cmd_MemoryBarrierByRegion); 5644 struct marshal_cmd_MemoryBarrierByRegion *cmd; 5645 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MemoryBarrierByRegion, cmd_size); 5646 cmd->barriers = barriers; 5647} 5648 5649 5650/* AlphaFuncx: marshalled asynchronously */ 5651struct marshal_cmd_AlphaFuncx 5652{ 5653 struct marshal_cmd_base cmd_base; 5654 GLenum func; 5655 GLclampx ref; 5656}; 5657uint32_t 5658_mesa_unmarshal_AlphaFuncx(struct gl_context *ctx, const struct marshal_cmd_AlphaFuncx *cmd, const uint64_t *last) 5659{ 5660 GLenum func = cmd->func; 5661 GLclampx ref = cmd->ref; 5662 CALL_AlphaFuncx(ctx->CurrentServerDispatch, (func, ref)); 5663 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_AlphaFuncx), 8) / 8); 5664 assert (cmd_size == cmd->cmd_base.cmd_size); 5665 return cmd_size; 5666} 5667void GLAPIENTRY 5668_mesa_marshal_AlphaFuncx(GLenum func, GLclampx ref) 5669{ 5670 GET_CURRENT_CONTEXT(ctx); 5671 int cmd_size = sizeof(struct marshal_cmd_AlphaFuncx); 5672 struct marshal_cmd_AlphaFuncx *cmd; 5673 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_AlphaFuncx, cmd_size); 5674 cmd->func = func; 5675 cmd->ref = ref; 5676} 5677 5678 5679/* ClearColorx: marshalled asynchronously */ 5680struct marshal_cmd_ClearColorx 5681{ 5682 struct marshal_cmd_base cmd_base; 5683 GLclampx red; 5684 GLclampx green; 5685 GLclampx blue; 5686 GLclampx alpha; 5687}; 5688uint32_t 5689_mesa_unmarshal_ClearColorx(struct gl_context *ctx, const struct marshal_cmd_ClearColorx *cmd, const uint64_t *last) 5690{ 5691 GLclampx red = cmd->red; 5692 GLclampx green = cmd->green; 5693 GLclampx blue = cmd->blue; 5694 GLclampx alpha = cmd->alpha; 5695 CALL_ClearColorx(ctx->CurrentServerDispatch, (red, green, blue, alpha)); 5696 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ClearColorx), 8) / 8); 5697 assert (cmd_size == cmd->cmd_base.cmd_size); 5698 return cmd_size; 5699} 5700void GLAPIENTRY 5701_mesa_marshal_ClearColorx(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) 5702{ 5703 GET_CURRENT_CONTEXT(ctx); 5704 int cmd_size = sizeof(struct marshal_cmd_ClearColorx); 5705 struct marshal_cmd_ClearColorx *cmd; 5706 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearColorx, cmd_size); 5707 cmd->red = red; 5708 cmd->green = green; 5709 cmd->blue = blue; 5710 cmd->alpha = alpha; 5711} 5712 5713 5714/* ClearDepthx: marshalled asynchronously */ 5715struct marshal_cmd_ClearDepthx 5716{ 5717 struct marshal_cmd_base cmd_base; 5718 GLclampx depth; 5719}; 5720uint32_t 5721_mesa_unmarshal_ClearDepthx(struct gl_context *ctx, const struct marshal_cmd_ClearDepthx *cmd, const uint64_t *last) 5722{ 5723 GLclampx depth = cmd->depth; 5724 CALL_ClearDepthx(ctx->CurrentServerDispatch, (depth)); 5725 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ClearDepthx), 8) / 8); 5726 assert (cmd_size == cmd->cmd_base.cmd_size); 5727 return cmd_size; 5728} 5729void GLAPIENTRY 5730_mesa_marshal_ClearDepthx(GLclampx depth) 5731{ 5732 GET_CURRENT_CONTEXT(ctx); 5733 int cmd_size = sizeof(struct marshal_cmd_ClearDepthx); 5734 struct marshal_cmd_ClearDepthx *cmd; 5735 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClearDepthx, cmd_size); 5736 cmd->depth = depth; 5737} 5738 5739 5740/* Color4x: marshalled asynchronously */ 5741struct marshal_cmd_Color4x 5742{ 5743 struct marshal_cmd_base cmd_base; 5744 GLfixed red; 5745 GLfixed green; 5746 GLfixed blue; 5747 GLfixed alpha; 5748}; 5749uint32_t 5750_mesa_unmarshal_Color4x(struct gl_context *ctx, const struct marshal_cmd_Color4x *cmd, const uint64_t *last) 5751{ 5752 GLfixed red = cmd->red; 5753 GLfixed green = cmd->green; 5754 GLfixed blue = cmd->blue; 5755 GLfixed alpha = cmd->alpha; 5756 CALL_Color4x(ctx->CurrentServerDispatch, (red, green, blue, alpha)); 5757 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Color4x), 8) / 8); 5758 assert (cmd_size == cmd->cmd_base.cmd_size); 5759 return cmd_size; 5760} 5761void GLAPIENTRY 5762_mesa_marshal_Color4x(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) 5763{ 5764 GET_CURRENT_CONTEXT(ctx); 5765 int cmd_size = sizeof(struct marshal_cmd_Color4x); 5766 struct marshal_cmd_Color4x *cmd; 5767 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Color4x, cmd_size); 5768 cmd->red = red; 5769 cmd->green = green; 5770 cmd->blue = blue; 5771 cmd->alpha = alpha; 5772} 5773 5774 5775/* DepthRangex: marshalled asynchronously */ 5776struct marshal_cmd_DepthRangex 5777{ 5778 struct marshal_cmd_base cmd_base; 5779 GLclampx zNear; 5780 GLclampx zFar; 5781}; 5782uint32_t 5783_mesa_unmarshal_DepthRangex(struct gl_context *ctx, const struct marshal_cmd_DepthRangex *cmd, const uint64_t *last) 5784{ 5785 GLclampx zNear = cmd->zNear; 5786 GLclampx zFar = cmd->zFar; 5787 CALL_DepthRangex(ctx->CurrentServerDispatch, (zNear, zFar)); 5788 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DepthRangex), 8) / 8); 5789 assert (cmd_size == cmd->cmd_base.cmd_size); 5790 return cmd_size; 5791} 5792void GLAPIENTRY 5793_mesa_marshal_DepthRangex(GLclampx zNear, GLclampx zFar) 5794{ 5795 GET_CURRENT_CONTEXT(ctx); 5796 int cmd_size = sizeof(struct marshal_cmd_DepthRangex); 5797 struct marshal_cmd_DepthRangex *cmd; 5798 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DepthRangex, cmd_size); 5799 cmd->zNear = zNear; 5800 cmd->zFar = zFar; 5801} 5802 5803 5804/* Fogx: marshalled asynchronously */ 5805struct marshal_cmd_Fogx 5806{ 5807 struct marshal_cmd_base cmd_base; 5808 GLenum pname; 5809 GLfixed param; 5810}; 5811uint32_t 5812_mesa_unmarshal_Fogx(struct gl_context *ctx, const struct marshal_cmd_Fogx *cmd, const uint64_t *last) 5813{ 5814 GLenum pname = cmd->pname; 5815 GLfixed param = cmd->param; 5816 CALL_Fogx(ctx->CurrentServerDispatch, (pname, param)); 5817 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Fogx), 8) / 8); 5818 assert (cmd_size == cmd->cmd_base.cmd_size); 5819 return cmd_size; 5820} 5821void GLAPIENTRY 5822_mesa_marshal_Fogx(GLenum pname, GLfixed param) 5823{ 5824 GET_CURRENT_CONTEXT(ctx); 5825 int cmd_size = sizeof(struct marshal_cmd_Fogx); 5826 struct marshal_cmd_Fogx *cmd; 5827 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Fogx, cmd_size); 5828 cmd->pname = pname; 5829 cmd->param = param; 5830} 5831 5832 5833/* Fogxv: marshalled asynchronously */ 5834struct marshal_cmd_Fogxv 5835{ 5836 struct marshal_cmd_base cmd_base; 5837 GLenum pname; 5838 /* Next safe_mul(_mesa_fog_enum_to_count(pname), 1 * sizeof(GLfixed)) bytes are GLfixed params[None] */ 5839}; 5840uint32_t 5841_mesa_unmarshal_Fogxv(struct gl_context *ctx, const struct marshal_cmd_Fogxv *cmd, const uint64_t *last) 5842{ 5843 GLenum pname = cmd->pname; 5844 GLfixed * params; 5845 const char *variable_data = (const char *) (cmd + 1); 5846 params = (GLfixed *) variable_data; 5847 CALL_Fogxv(ctx->CurrentServerDispatch, (pname, params)); 5848 return cmd->cmd_base.cmd_size; 5849} 5850void GLAPIENTRY 5851_mesa_marshal_Fogxv(GLenum pname, const GLfixed * params) 5852{ 5853 GET_CURRENT_CONTEXT(ctx); 5854 int params_size = safe_mul(_mesa_fog_enum_to_count(pname), 1 * sizeof(GLfixed)); 5855 int cmd_size = sizeof(struct marshal_cmd_Fogxv) + params_size; 5856 struct marshal_cmd_Fogxv *cmd; 5857 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5858 _mesa_glthread_finish_before(ctx, "Fogxv"); 5859 CALL_Fogxv(ctx->CurrentServerDispatch, (pname, params)); 5860 return; 5861 } 5862 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Fogxv, cmd_size); 5863 cmd->pname = pname; 5864 char *variable_data = (char *) (cmd + 1); 5865 memcpy(variable_data, params, params_size); 5866} 5867 5868 5869/* Frustumx: marshalled asynchronously */ 5870struct marshal_cmd_Frustumx 5871{ 5872 struct marshal_cmd_base cmd_base; 5873 GLfixed left; 5874 GLfixed right; 5875 GLfixed bottom; 5876 GLfixed top; 5877 GLfixed zNear; 5878 GLfixed zFar; 5879}; 5880uint32_t 5881_mesa_unmarshal_Frustumx(struct gl_context *ctx, const struct marshal_cmd_Frustumx *cmd, const uint64_t *last) 5882{ 5883 GLfixed left = cmd->left; 5884 GLfixed right = cmd->right; 5885 GLfixed bottom = cmd->bottom; 5886 GLfixed top = cmd->top; 5887 GLfixed zNear = cmd->zNear; 5888 GLfixed zFar = cmd->zFar; 5889 CALL_Frustumx(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar)); 5890 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Frustumx), 8) / 8); 5891 assert (cmd_size == cmd->cmd_base.cmd_size); 5892 return cmd_size; 5893} 5894void GLAPIENTRY 5895_mesa_marshal_Frustumx(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) 5896{ 5897 GET_CURRENT_CONTEXT(ctx); 5898 int cmd_size = sizeof(struct marshal_cmd_Frustumx); 5899 struct marshal_cmd_Frustumx *cmd; 5900 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Frustumx, cmd_size); 5901 cmd->left = left; 5902 cmd->right = right; 5903 cmd->bottom = bottom; 5904 cmd->top = top; 5905 cmd->zNear = zNear; 5906 cmd->zFar = zFar; 5907} 5908 5909 5910/* LightModelx: marshalled asynchronously */ 5911struct marshal_cmd_LightModelx 5912{ 5913 struct marshal_cmd_base cmd_base; 5914 GLenum pname; 5915 GLfixed param; 5916}; 5917uint32_t 5918_mesa_unmarshal_LightModelx(struct gl_context *ctx, const struct marshal_cmd_LightModelx *cmd, const uint64_t *last) 5919{ 5920 GLenum pname = cmd->pname; 5921 GLfixed param = cmd->param; 5922 CALL_LightModelx(ctx->CurrentServerDispatch, (pname, param)); 5923 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_LightModelx), 8) / 8); 5924 assert (cmd_size == cmd->cmd_base.cmd_size); 5925 return cmd_size; 5926} 5927void GLAPIENTRY 5928_mesa_marshal_LightModelx(GLenum pname, GLfixed param) 5929{ 5930 GET_CURRENT_CONTEXT(ctx); 5931 int cmd_size = sizeof(struct marshal_cmd_LightModelx); 5932 struct marshal_cmd_LightModelx *cmd; 5933 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LightModelx, cmd_size); 5934 cmd->pname = pname; 5935 cmd->param = param; 5936} 5937 5938 5939/* LightModelxv: marshalled asynchronously */ 5940struct marshal_cmd_LightModelxv 5941{ 5942 struct marshal_cmd_base cmd_base; 5943 GLenum pname; 5944 /* Next safe_mul(_mesa_light_model_enum_to_count(pname), 1 * sizeof(GLfixed)) bytes are GLfixed params[None] */ 5945}; 5946uint32_t 5947_mesa_unmarshal_LightModelxv(struct gl_context *ctx, const struct marshal_cmd_LightModelxv *cmd, const uint64_t *last) 5948{ 5949 GLenum pname = cmd->pname; 5950 GLfixed * params; 5951 const char *variable_data = (const char *) (cmd + 1); 5952 params = (GLfixed *) variable_data; 5953 CALL_LightModelxv(ctx->CurrentServerDispatch, (pname, params)); 5954 return cmd->cmd_base.cmd_size; 5955} 5956void GLAPIENTRY 5957_mesa_marshal_LightModelxv(GLenum pname, const GLfixed * params) 5958{ 5959 GET_CURRENT_CONTEXT(ctx); 5960 int params_size = safe_mul(_mesa_light_model_enum_to_count(pname), 1 * sizeof(GLfixed)); 5961 int cmd_size = sizeof(struct marshal_cmd_LightModelxv) + params_size; 5962 struct marshal_cmd_LightModelxv *cmd; 5963 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 5964 _mesa_glthread_finish_before(ctx, "LightModelxv"); 5965 CALL_LightModelxv(ctx->CurrentServerDispatch, (pname, params)); 5966 return; 5967 } 5968 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LightModelxv, cmd_size); 5969 cmd->pname = pname; 5970 char *variable_data = (char *) (cmd + 1); 5971 memcpy(variable_data, params, params_size); 5972} 5973 5974 5975/* Lightx: marshalled asynchronously */ 5976struct marshal_cmd_Lightx 5977{ 5978 struct marshal_cmd_base cmd_base; 5979 GLenum light; 5980 GLenum pname; 5981 GLfixed param; 5982}; 5983uint32_t 5984_mesa_unmarshal_Lightx(struct gl_context *ctx, const struct marshal_cmd_Lightx *cmd, const uint64_t *last) 5985{ 5986 GLenum light = cmd->light; 5987 GLenum pname = cmd->pname; 5988 GLfixed param = cmd->param; 5989 CALL_Lightx(ctx->CurrentServerDispatch, (light, pname, param)); 5990 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Lightx), 8) / 8); 5991 assert (cmd_size == cmd->cmd_base.cmd_size); 5992 return cmd_size; 5993} 5994void GLAPIENTRY 5995_mesa_marshal_Lightx(GLenum light, GLenum pname, GLfixed param) 5996{ 5997 GET_CURRENT_CONTEXT(ctx); 5998 int cmd_size = sizeof(struct marshal_cmd_Lightx); 5999 struct marshal_cmd_Lightx *cmd; 6000 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Lightx, cmd_size); 6001 cmd->light = light; 6002 cmd->pname = pname; 6003 cmd->param = param; 6004} 6005 6006 6007/* Lightxv: marshalled asynchronously */ 6008struct marshal_cmd_Lightxv 6009{ 6010 struct marshal_cmd_base cmd_base; 6011 GLenum light; 6012 GLenum pname; 6013 /* Next safe_mul(_mesa_light_enum_to_count(pname), 1 * sizeof(GLfixed)) bytes are GLfixed params[None] */ 6014}; 6015uint32_t 6016_mesa_unmarshal_Lightxv(struct gl_context *ctx, const struct marshal_cmd_Lightxv *cmd, const uint64_t *last) 6017{ 6018 GLenum light = cmd->light; 6019 GLenum pname = cmd->pname; 6020 GLfixed * params; 6021 const char *variable_data = (const char *) (cmd + 1); 6022 params = (GLfixed *) variable_data; 6023 CALL_Lightxv(ctx->CurrentServerDispatch, (light, pname, params)); 6024 return cmd->cmd_base.cmd_size; 6025} 6026void GLAPIENTRY 6027_mesa_marshal_Lightxv(GLenum light, GLenum pname, const GLfixed * params) 6028{ 6029 GET_CURRENT_CONTEXT(ctx); 6030 int params_size = safe_mul(_mesa_light_enum_to_count(pname), 1 * sizeof(GLfixed)); 6031 int cmd_size = sizeof(struct marshal_cmd_Lightxv) + params_size; 6032 struct marshal_cmd_Lightxv *cmd; 6033 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6034 _mesa_glthread_finish_before(ctx, "Lightxv"); 6035 CALL_Lightxv(ctx->CurrentServerDispatch, (light, pname, params)); 6036 return; 6037 } 6038 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Lightxv, cmd_size); 6039 cmd->light = light; 6040 cmd->pname = pname; 6041 char *variable_data = (char *) (cmd + 1); 6042 memcpy(variable_data, params, params_size); 6043} 6044 6045 6046/* LineWidthx: marshalled asynchronously */ 6047struct marshal_cmd_LineWidthx 6048{ 6049 struct marshal_cmd_base cmd_base; 6050 GLfixed width; 6051}; 6052uint32_t 6053_mesa_unmarshal_LineWidthx(struct gl_context *ctx, const struct marshal_cmd_LineWidthx *cmd, const uint64_t *last) 6054{ 6055 GLfixed width = cmd->width; 6056 CALL_LineWidthx(ctx->CurrentServerDispatch, (width)); 6057 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_LineWidthx), 8) / 8); 6058 assert (cmd_size == cmd->cmd_base.cmd_size); 6059 return cmd_size; 6060} 6061void GLAPIENTRY 6062_mesa_marshal_LineWidthx(GLfixed width) 6063{ 6064 GET_CURRENT_CONTEXT(ctx); 6065 int cmd_size = sizeof(struct marshal_cmd_LineWidthx); 6066 struct marshal_cmd_LineWidthx *cmd; 6067 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LineWidthx, cmd_size); 6068 cmd->width = width; 6069} 6070 6071 6072/* LoadMatrixx: marshalled asynchronously */ 6073struct marshal_cmd_LoadMatrixx 6074{ 6075 struct marshal_cmd_base cmd_base; 6076 GLfixed m[16]; 6077}; 6078uint32_t 6079_mesa_unmarshal_LoadMatrixx(struct gl_context *ctx, const struct marshal_cmd_LoadMatrixx *cmd, const uint64_t *last) 6080{ 6081 const GLfixed * m = cmd->m; 6082 CALL_LoadMatrixx(ctx->CurrentServerDispatch, (m)); 6083 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_LoadMatrixx), 8) / 8); 6084 assert (cmd_size == cmd->cmd_base.cmd_size); 6085 return cmd_size; 6086} 6087void GLAPIENTRY 6088_mesa_marshal_LoadMatrixx(const GLfixed * m) 6089{ 6090 GET_CURRENT_CONTEXT(ctx); 6091 int cmd_size = sizeof(struct marshal_cmd_LoadMatrixx); 6092 struct marshal_cmd_LoadMatrixx *cmd; 6093 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_LoadMatrixx, cmd_size); 6094 memcpy(cmd->m, m, 16 * sizeof(GLfixed)); 6095} 6096 6097 6098/* Materialx: marshalled asynchronously */ 6099struct marshal_cmd_Materialx 6100{ 6101 struct marshal_cmd_base cmd_base; 6102 GLenum face; 6103 GLenum pname; 6104 GLfixed param; 6105}; 6106uint32_t 6107_mesa_unmarshal_Materialx(struct gl_context *ctx, const struct marshal_cmd_Materialx *cmd, const uint64_t *last) 6108{ 6109 GLenum face = cmd->face; 6110 GLenum pname = cmd->pname; 6111 GLfixed param = cmd->param; 6112 CALL_Materialx(ctx->CurrentServerDispatch, (face, pname, param)); 6113 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Materialx), 8) / 8); 6114 assert (cmd_size == cmd->cmd_base.cmd_size); 6115 return cmd_size; 6116} 6117void GLAPIENTRY 6118_mesa_marshal_Materialx(GLenum face, GLenum pname, GLfixed param) 6119{ 6120 GET_CURRENT_CONTEXT(ctx); 6121 int cmd_size = sizeof(struct marshal_cmd_Materialx); 6122 struct marshal_cmd_Materialx *cmd; 6123 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Materialx, cmd_size); 6124 cmd->face = face; 6125 cmd->pname = pname; 6126 cmd->param = param; 6127} 6128 6129 6130/* Materialxv: marshalled asynchronously */ 6131struct marshal_cmd_Materialxv 6132{ 6133 struct marshal_cmd_base cmd_base; 6134 GLenum face; 6135 GLenum pname; 6136 /* Next safe_mul(_mesa_material_enum_to_count(pname), 1 * sizeof(GLfixed)) bytes are GLfixed params[None] */ 6137}; 6138uint32_t 6139_mesa_unmarshal_Materialxv(struct gl_context *ctx, const struct marshal_cmd_Materialxv *cmd, const uint64_t *last) 6140{ 6141 GLenum face = cmd->face; 6142 GLenum pname = cmd->pname; 6143 GLfixed * params; 6144 const char *variable_data = (const char *) (cmd + 1); 6145 params = (GLfixed *) variable_data; 6146 CALL_Materialxv(ctx->CurrentServerDispatch, (face, pname, params)); 6147 return cmd->cmd_base.cmd_size; 6148} 6149void GLAPIENTRY 6150_mesa_marshal_Materialxv(GLenum face, GLenum pname, const GLfixed * params) 6151{ 6152 GET_CURRENT_CONTEXT(ctx); 6153 int params_size = safe_mul(_mesa_material_enum_to_count(pname), 1 * sizeof(GLfixed)); 6154 int cmd_size = sizeof(struct marshal_cmd_Materialxv) + params_size; 6155 struct marshal_cmd_Materialxv *cmd; 6156 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6157 _mesa_glthread_finish_before(ctx, "Materialxv"); 6158 CALL_Materialxv(ctx->CurrentServerDispatch, (face, pname, params)); 6159 return; 6160 } 6161 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Materialxv, cmd_size); 6162 cmd->face = face; 6163 cmd->pname = pname; 6164 char *variable_data = (char *) (cmd + 1); 6165 memcpy(variable_data, params, params_size); 6166} 6167 6168 6169/* MultMatrixx: marshalled asynchronously */ 6170struct marshal_cmd_MultMatrixx 6171{ 6172 struct marshal_cmd_base cmd_base; 6173 GLfixed m[16]; 6174}; 6175uint32_t 6176_mesa_unmarshal_MultMatrixx(struct gl_context *ctx, const struct marshal_cmd_MultMatrixx *cmd, const uint64_t *last) 6177{ 6178 const GLfixed * m = cmd->m; 6179 CALL_MultMatrixx(ctx->CurrentServerDispatch, (m)); 6180 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultMatrixx), 8) / 8); 6181 assert (cmd_size == cmd->cmd_base.cmd_size); 6182 return cmd_size; 6183} 6184void GLAPIENTRY 6185_mesa_marshal_MultMatrixx(const GLfixed * m) 6186{ 6187 GET_CURRENT_CONTEXT(ctx); 6188 int cmd_size = sizeof(struct marshal_cmd_MultMatrixx); 6189 struct marshal_cmd_MultMatrixx *cmd; 6190 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultMatrixx, cmd_size); 6191 memcpy(cmd->m, m, 16 * sizeof(GLfixed)); 6192} 6193 6194 6195/* MultiTexCoord4x: marshalled asynchronously */ 6196struct marshal_cmd_MultiTexCoord4x 6197{ 6198 struct marshal_cmd_base cmd_base; 6199 GLenum target; 6200 GLfixed s; 6201 GLfixed t; 6202 GLfixed r; 6203 GLfixed q; 6204}; 6205uint32_t 6206_mesa_unmarshal_MultiTexCoord4x(struct gl_context *ctx, const struct marshal_cmd_MultiTexCoord4x *cmd, const uint64_t *last) 6207{ 6208 GLenum target = cmd->target; 6209 GLfixed s = cmd->s; 6210 GLfixed t = cmd->t; 6211 GLfixed r = cmd->r; 6212 GLfixed q = cmd->q; 6213 CALL_MultiTexCoord4x(ctx->CurrentServerDispatch, (target, s, t, r, q)); 6214 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_MultiTexCoord4x), 8) / 8); 6215 assert (cmd_size == cmd->cmd_base.cmd_size); 6216 return cmd_size; 6217} 6218void GLAPIENTRY 6219_mesa_marshal_MultiTexCoord4x(GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) 6220{ 6221 GET_CURRENT_CONTEXT(ctx); 6222 int cmd_size = sizeof(struct marshal_cmd_MultiTexCoord4x); 6223 struct marshal_cmd_MultiTexCoord4x *cmd; 6224 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_MultiTexCoord4x, cmd_size); 6225 cmd->target = target; 6226 cmd->s = s; 6227 cmd->t = t; 6228 cmd->r = r; 6229 cmd->q = q; 6230} 6231 6232 6233/* Normal3x: marshalled asynchronously */ 6234struct marshal_cmd_Normal3x 6235{ 6236 struct marshal_cmd_base cmd_base; 6237 GLfixed nx; 6238 GLfixed ny; 6239 GLfixed nz; 6240}; 6241uint32_t 6242_mesa_unmarshal_Normal3x(struct gl_context *ctx, const struct marshal_cmd_Normal3x *cmd, const uint64_t *last) 6243{ 6244 GLfixed nx = cmd->nx; 6245 GLfixed ny = cmd->ny; 6246 GLfixed nz = cmd->nz; 6247 CALL_Normal3x(ctx->CurrentServerDispatch, (nx, ny, nz)); 6248 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Normal3x), 8) / 8); 6249 assert (cmd_size == cmd->cmd_base.cmd_size); 6250 return cmd_size; 6251} 6252void GLAPIENTRY 6253_mesa_marshal_Normal3x(GLfixed nx, GLfixed ny, GLfixed nz) 6254{ 6255 GET_CURRENT_CONTEXT(ctx); 6256 int cmd_size = sizeof(struct marshal_cmd_Normal3x); 6257 struct marshal_cmd_Normal3x *cmd; 6258 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Normal3x, cmd_size); 6259 cmd->nx = nx; 6260 cmd->ny = ny; 6261 cmd->nz = nz; 6262} 6263 6264 6265/* Orthox: marshalled asynchronously */ 6266struct marshal_cmd_Orthox 6267{ 6268 struct marshal_cmd_base cmd_base; 6269 GLfixed left; 6270 GLfixed right; 6271 GLfixed bottom; 6272 GLfixed top; 6273 GLfixed zNear; 6274 GLfixed zFar; 6275}; 6276uint32_t 6277_mesa_unmarshal_Orthox(struct gl_context *ctx, const struct marshal_cmd_Orthox *cmd, const uint64_t *last) 6278{ 6279 GLfixed left = cmd->left; 6280 GLfixed right = cmd->right; 6281 GLfixed bottom = cmd->bottom; 6282 GLfixed top = cmd->top; 6283 GLfixed zNear = cmd->zNear; 6284 GLfixed zFar = cmd->zFar; 6285 CALL_Orthox(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar)); 6286 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Orthox), 8) / 8); 6287 assert (cmd_size == cmd->cmd_base.cmd_size); 6288 return cmd_size; 6289} 6290void GLAPIENTRY 6291_mesa_marshal_Orthox(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) 6292{ 6293 GET_CURRENT_CONTEXT(ctx); 6294 int cmd_size = sizeof(struct marshal_cmd_Orthox); 6295 struct marshal_cmd_Orthox *cmd; 6296 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Orthox, cmd_size); 6297 cmd->left = left; 6298 cmd->right = right; 6299 cmd->bottom = bottom; 6300 cmd->top = top; 6301 cmd->zNear = zNear; 6302 cmd->zFar = zFar; 6303} 6304 6305 6306/* PointSizex: marshalled asynchronously */ 6307struct marshal_cmd_PointSizex 6308{ 6309 struct marshal_cmd_base cmd_base; 6310 GLfixed size; 6311}; 6312uint32_t 6313_mesa_unmarshal_PointSizex(struct gl_context *ctx, const struct marshal_cmd_PointSizex *cmd, const uint64_t *last) 6314{ 6315 GLfixed size = cmd->size; 6316 CALL_PointSizex(ctx->CurrentServerDispatch, (size)); 6317 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PointSizex), 8) / 8); 6318 assert (cmd_size == cmd->cmd_base.cmd_size); 6319 return cmd_size; 6320} 6321void GLAPIENTRY 6322_mesa_marshal_PointSizex(GLfixed size) 6323{ 6324 GET_CURRENT_CONTEXT(ctx); 6325 int cmd_size = sizeof(struct marshal_cmd_PointSizex); 6326 struct marshal_cmd_PointSizex *cmd; 6327 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PointSizex, cmd_size); 6328 cmd->size = size; 6329} 6330 6331 6332/* PolygonOffsetx: marshalled asynchronously */ 6333struct marshal_cmd_PolygonOffsetx 6334{ 6335 struct marshal_cmd_base cmd_base; 6336 GLfixed factor; 6337 GLfixed units; 6338}; 6339uint32_t 6340_mesa_unmarshal_PolygonOffsetx(struct gl_context *ctx, const struct marshal_cmd_PolygonOffsetx *cmd, const uint64_t *last) 6341{ 6342 GLfixed factor = cmd->factor; 6343 GLfixed units = cmd->units; 6344 CALL_PolygonOffsetx(ctx->CurrentServerDispatch, (factor, units)); 6345 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PolygonOffsetx), 8) / 8); 6346 assert (cmd_size == cmd->cmd_base.cmd_size); 6347 return cmd_size; 6348} 6349void GLAPIENTRY 6350_mesa_marshal_PolygonOffsetx(GLfixed factor, GLfixed units) 6351{ 6352 GET_CURRENT_CONTEXT(ctx); 6353 int cmd_size = sizeof(struct marshal_cmd_PolygonOffsetx); 6354 struct marshal_cmd_PolygonOffsetx *cmd; 6355 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PolygonOffsetx, cmd_size); 6356 cmd->factor = factor; 6357 cmd->units = units; 6358} 6359 6360 6361/* Rotatex: marshalled asynchronously */ 6362struct marshal_cmd_Rotatex 6363{ 6364 struct marshal_cmd_base cmd_base; 6365 GLfixed angle; 6366 GLfixed x; 6367 GLfixed y; 6368 GLfixed z; 6369}; 6370uint32_t 6371_mesa_unmarshal_Rotatex(struct gl_context *ctx, const struct marshal_cmd_Rotatex *cmd, const uint64_t *last) 6372{ 6373 GLfixed angle = cmd->angle; 6374 GLfixed x = cmd->x; 6375 GLfixed y = cmd->y; 6376 GLfixed z = cmd->z; 6377 CALL_Rotatex(ctx->CurrentServerDispatch, (angle, x, y, z)); 6378 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Rotatex), 8) / 8); 6379 assert (cmd_size == cmd->cmd_base.cmd_size); 6380 return cmd_size; 6381} 6382void GLAPIENTRY 6383_mesa_marshal_Rotatex(GLfixed angle, GLfixed x, GLfixed y, GLfixed z) 6384{ 6385 GET_CURRENT_CONTEXT(ctx); 6386 int cmd_size = sizeof(struct marshal_cmd_Rotatex); 6387 struct marshal_cmd_Rotatex *cmd; 6388 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Rotatex, cmd_size); 6389 cmd->angle = angle; 6390 cmd->x = x; 6391 cmd->y = y; 6392 cmd->z = z; 6393} 6394 6395 6396/* SampleCoveragex: marshalled asynchronously */ 6397struct marshal_cmd_SampleCoveragex 6398{ 6399 struct marshal_cmd_base cmd_base; 6400 GLboolean invert; 6401 GLclampx value; 6402}; 6403uint32_t 6404_mesa_unmarshal_SampleCoveragex(struct gl_context *ctx, const struct marshal_cmd_SampleCoveragex *cmd, const uint64_t *last) 6405{ 6406 GLclampx value = cmd->value; 6407 GLboolean invert = cmd->invert; 6408 CALL_SampleCoveragex(ctx->CurrentServerDispatch, (value, invert)); 6409 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_SampleCoveragex), 8) / 8); 6410 assert (cmd_size == cmd->cmd_base.cmd_size); 6411 return cmd_size; 6412} 6413void GLAPIENTRY 6414_mesa_marshal_SampleCoveragex(GLclampx value, GLboolean invert) 6415{ 6416 GET_CURRENT_CONTEXT(ctx); 6417 int cmd_size = sizeof(struct marshal_cmd_SampleCoveragex); 6418 struct marshal_cmd_SampleCoveragex *cmd; 6419 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_SampleCoveragex, cmd_size); 6420 cmd->value = value; 6421 cmd->invert = invert; 6422} 6423 6424 6425/* Scalex: marshalled asynchronously */ 6426struct marshal_cmd_Scalex 6427{ 6428 struct marshal_cmd_base cmd_base; 6429 GLfixed x; 6430 GLfixed y; 6431 GLfixed z; 6432}; 6433uint32_t 6434_mesa_unmarshal_Scalex(struct gl_context *ctx, const struct marshal_cmd_Scalex *cmd, const uint64_t *last) 6435{ 6436 GLfixed x = cmd->x; 6437 GLfixed y = cmd->y; 6438 GLfixed z = cmd->z; 6439 CALL_Scalex(ctx->CurrentServerDispatch, (x, y, z)); 6440 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Scalex), 8) / 8); 6441 assert (cmd_size == cmd->cmd_base.cmd_size); 6442 return cmd_size; 6443} 6444void GLAPIENTRY 6445_mesa_marshal_Scalex(GLfixed x, GLfixed y, GLfixed z) 6446{ 6447 GET_CURRENT_CONTEXT(ctx); 6448 int cmd_size = sizeof(struct marshal_cmd_Scalex); 6449 struct marshal_cmd_Scalex *cmd; 6450 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Scalex, cmd_size); 6451 cmd->x = x; 6452 cmd->y = y; 6453 cmd->z = z; 6454} 6455 6456 6457/* TexEnvx: marshalled asynchronously */ 6458struct marshal_cmd_TexEnvx 6459{ 6460 struct marshal_cmd_base cmd_base; 6461 GLenum target; 6462 GLenum pname; 6463 GLfixed param; 6464}; 6465uint32_t 6466_mesa_unmarshal_TexEnvx(struct gl_context *ctx, const struct marshal_cmd_TexEnvx *cmd, const uint64_t *last) 6467{ 6468 GLenum target = cmd->target; 6469 GLenum pname = cmd->pname; 6470 GLfixed param = cmd->param; 6471 CALL_TexEnvx(ctx->CurrentServerDispatch, (target, pname, param)); 6472 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexEnvx), 8) / 8); 6473 assert (cmd_size == cmd->cmd_base.cmd_size); 6474 return cmd_size; 6475} 6476void GLAPIENTRY 6477_mesa_marshal_TexEnvx(GLenum target, GLenum pname, GLfixed param) 6478{ 6479 GET_CURRENT_CONTEXT(ctx); 6480 int cmd_size = sizeof(struct marshal_cmd_TexEnvx); 6481 struct marshal_cmd_TexEnvx *cmd; 6482 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexEnvx, cmd_size); 6483 cmd->target = target; 6484 cmd->pname = pname; 6485 cmd->param = param; 6486} 6487 6488 6489/* TexEnvxv: marshalled asynchronously */ 6490struct marshal_cmd_TexEnvxv 6491{ 6492 struct marshal_cmd_base cmd_base; 6493 GLenum target; 6494 GLenum pname; 6495 /* Next safe_mul(_mesa_texenv_enum_to_count(pname), 1 * sizeof(GLfixed)) bytes are GLfixed params[None] */ 6496}; 6497uint32_t 6498_mesa_unmarshal_TexEnvxv(struct gl_context *ctx, const struct marshal_cmd_TexEnvxv *cmd, const uint64_t *last) 6499{ 6500 GLenum target = cmd->target; 6501 GLenum pname = cmd->pname; 6502 GLfixed * params; 6503 const char *variable_data = (const char *) (cmd + 1); 6504 params = (GLfixed *) variable_data; 6505 CALL_TexEnvxv(ctx->CurrentServerDispatch, (target, pname, params)); 6506 return cmd->cmd_base.cmd_size; 6507} 6508void GLAPIENTRY 6509_mesa_marshal_TexEnvxv(GLenum target, GLenum pname, const GLfixed * params) 6510{ 6511 GET_CURRENT_CONTEXT(ctx); 6512 int params_size = safe_mul(_mesa_texenv_enum_to_count(pname), 1 * sizeof(GLfixed)); 6513 int cmd_size = sizeof(struct marshal_cmd_TexEnvxv) + params_size; 6514 struct marshal_cmd_TexEnvxv *cmd; 6515 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6516 _mesa_glthread_finish_before(ctx, "TexEnvxv"); 6517 CALL_TexEnvxv(ctx->CurrentServerDispatch, (target, pname, params)); 6518 return; 6519 } 6520 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexEnvxv, cmd_size); 6521 cmd->target = target; 6522 cmd->pname = pname; 6523 char *variable_data = (char *) (cmd + 1); 6524 memcpy(variable_data, params, params_size); 6525} 6526 6527 6528/* TexParameterx: marshalled asynchronously */ 6529struct marshal_cmd_TexParameterx 6530{ 6531 struct marshal_cmd_base cmd_base; 6532 GLenum target; 6533 GLenum pname; 6534 GLfixed param; 6535}; 6536uint32_t 6537_mesa_unmarshal_TexParameterx(struct gl_context *ctx, const struct marshal_cmd_TexParameterx *cmd, const uint64_t *last) 6538{ 6539 GLenum target = cmd->target; 6540 GLenum pname = cmd->pname; 6541 GLfixed param = cmd->param; 6542 CALL_TexParameterx(ctx->CurrentServerDispatch, (target, pname, param)); 6543 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexParameterx), 8) / 8); 6544 assert (cmd_size == cmd->cmd_base.cmd_size); 6545 return cmd_size; 6546} 6547void GLAPIENTRY 6548_mesa_marshal_TexParameterx(GLenum target, GLenum pname, GLfixed param) 6549{ 6550 GET_CURRENT_CONTEXT(ctx); 6551 int cmd_size = sizeof(struct marshal_cmd_TexParameterx); 6552 struct marshal_cmd_TexParameterx *cmd; 6553 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexParameterx, cmd_size); 6554 cmd->target = target; 6555 cmd->pname = pname; 6556 cmd->param = param; 6557} 6558 6559 6560/* Translatex: marshalled asynchronously */ 6561struct marshal_cmd_Translatex 6562{ 6563 struct marshal_cmd_base cmd_base; 6564 GLfixed x; 6565 GLfixed y; 6566 GLfixed z; 6567}; 6568uint32_t 6569_mesa_unmarshal_Translatex(struct gl_context *ctx, const struct marshal_cmd_Translatex *cmd, const uint64_t *last) 6570{ 6571 GLfixed x = cmd->x; 6572 GLfixed y = cmd->y; 6573 GLfixed z = cmd->z; 6574 CALL_Translatex(ctx->CurrentServerDispatch, (x, y, z)); 6575 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Translatex), 8) / 8); 6576 assert (cmd_size == cmd->cmd_base.cmd_size); 6577 return cmd_size; 6578} 6579void GLAPIENTRY 6580_mesa_marshal_Translatex(GLfixed x, GLfixed y, GLfixed z) 6581{ 6582 GET_CURRENT_CONTEXT(ctx); 6583 int cmd_size = sizeof(struct marshal_cmd_Translatex); 6584 struct marshal_cmd_Translatex *cmd; 6585 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Translatex, cmd_size); 6586 cmd->x = x; 6587 cmd->y = y; 6588 cmd->z = z; 6589} 6590 6591 6592/* ClipPlanex: marshalled asynchronously */ 6593struct marshal_cmd_ClipPlanex 6594{ 6595 struct marshal_cmd_base cmd_base; 6596 GLenum plane; 6597 GLfixed equation[4]; 6598}; 6599uint32_t 6600_mesa_unmarshal_ClipPlanex(struct gl_context *ctx, const struct marshal_cmd_ClipPlanex *cmd, const uint64_t *last) 6601{ 6602 GLenum plane = cmd->plane; 6603 const GLfixed * equation = cmd->equation; 6604 CALL_ClipPlanex(ctx->CurrentServerDispatch, (plane, equation)); 6605 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ClipPlanex), 8) / 8); 6606 assert (cmd_size == cmd->cmd_base.cmd_size); 6607 return cmd_size; 6608} 6609void GLAPIENTRY 6610_mesa_marshal_ClipPlanex(GLenum plane, const GLfixed * equation) 6611{ 6612 GET_CURRENT_CONTEXT(ctx); 6613 int cmd_size = sizeof(struct marshal_cmd_ClipPlanex); 6614 struct marshal_cmd_ClipPlanex *cmd; 6615 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClipPlanex, cmd_size); 6616 cmd->plane = plane; 6617 memcpy(cmd->equation, equation, 4 * sizeof(GLfixed)); 6618} 6619 6620 6621/* GetClipPlanex: marshalled synchronously */ 6622void GLAPIENTRY 6623_mesa_marshal_GetClipPlanex(GLenum plane, GLfixed * equation) 6624{ 6625 GET_CURRENT_CONTEXT(ctx); 6626 _mesa_glthread_finish_before(ctx, "GetClipPlanex"); 6627 CALL_GetClipPlanex(ctx->CurrentServerDispatch, (plane, equation)); 6628} 6629 6630 6631/* GetFixedv: marshalled synchronously */ 6632void GLAPIENTRY 6633_mesa_marshal_GetFixedv(GLenum pname, GLfixed * params) 6634{ 6635 GET_CURRENT_CONTEXT(ctx); 6636 _mesa_glthread_finish_before(ctx, "GetFixedv"); 6637 CALL_GetFixedv(ctx->CurrentServerDispatch, (pname, params)); 6638} 6639 6640 6641/* GetLightxv: marshalled synchronously */ 6642void GLAPIENTRY 6643_mesa_marshal_GetLightxv(GLenum light, GLenum pname, GLfixed * params) 6644{ 6645 GET_CURRENT_CONTEXT(ctx); 6646 _mesa_glthread_finish_before(ctx, "GetLightxv"); 6647 CALL_GetLightxv(ctx->CurrentServerDispatch, (light, pname, params)); 6648} 6649 6650 6651/* GetMaterialxv: marshalled synchronously */ 6652void GLAPIENTRY 6653_mesa_marshal_GetMaterialxv(GLenum face, GLenum pname, GLfixed * params) 6654{ 6655 GET_CURRENT_CONTEXT(ctx); 6656 _mesa_glthread_finish_before(ctx, "GetMaterialxv"); 6657 CALL_GetMaterialxv(ctx->CurrentServerDispatch, (face, pname, params)); 6658} 6659 6660 6661/* GetTexEnvxv: marshalled synchronously */ 6662void GLAPIENTRY 6663_mesa_marshal_GetTexEnvxv(GLenum target, GLenum pname, GLfixed * params) 6664{ 6665 GET_CURRENT_CONTEXT(ctx); 6666 _mesa_glthread_finish_before(ctx, "GetTexEnvxv"); 6667 CALL_GetTexEnvxv(ctx->CurrentServerDispatch, (target, pname, params)); 6668} 6669 6670 6671/* GetTexParameterxv: marshalled synchronously */ 6672void GLAPIENTRY 6673_mesa_marshal_GetTexParameterxv(GLenum target, GLenum pname, GLfixed * params) 6674{ 6675 GET_CURRENT_CONTEXT(ctx); 6676 _mesa_glthread_finish_before(ctx, "GetTexParameterxv"); 6677 CALL_GetTexParameterxv(ctx->CurrentServerDispatch, (target, pname, params)); 6678} 6679 6680 6681/* PointParameterx: marshalled asynchronously */ 6682struct marshal_cmd_PointParameterx 6683{ 6684 struct marshal_cmd_base cmd_base; 6685 GLenum pname; 6686 GLfixed param; 6687}; 6688uint32_t 6689_mesa_unmarshal_PointParameterx(struct gl_context *ctx, const struct marshal_cmd_PointParameterx *cmd, const uint64_t *last) 6690{ 6691 GLenum pname = cmd->pname; 6692 GLfixed param = cmd->param; 6693 CALL_PointParameterx(ctx->CurrentServerDispatch, (pname, param)); 6694 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PointParameterx), 8) / 8); 6695 assert (cmd_size == cmd->cmd_base.cmd_size); 6696 return cmd_size; 6697} 6698void GLAPIENTRY 6699_mesa_marshal_PointParameterx(GLenum pname, GLfixed param) 6700{ 6701 GET_CURRENT_CONTEXT(ctx); 6702 int cmd_size = sizeof(struct marshal_cmd_PointParameterx); 6703 struct marshal_cmd_PointParameterx *cmd; 6704 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PointParameterx, cmd_size); 6705 cmd->pname = pname; 6706 cmd->param = param; 6707} 6708 6709 6710/* PointParameterxv: marshalled asynchronously */ 6711struct marshal_cmd_PointParameterxv 6712{ 6713 struct marshal_cmd_base cmd_base; 6714 GLenum pname; 6715 /* Next safe_mul(_mesa_point_param_enum_to_count(pname), 1 * sizeof(GLfixed)) bytes are GLfixed params[_mesa_point_param_enum_to_count(pname)] */ 6716}; 6717uint32_t 6718_mesa_unmarshal_PointParameterxv(struct gl_context *ctx, const struct marshal_cmd_PointParameterxv *cmd, const uint64_t *last) 6719{ 6720 GLenum pname = cmd->pname; 6721 GLfixed * params; 6722 const char *variable_data = (const char *) (cmd + 1); 6723 params = (GLfixed *) variable_data; 6724 CALL_PointParameterxv(ctx->CurrentServerDispatch, (pname, params)); 6725 return cmd->cmd_base.cmd_size; 6726} 6727void GLAPIENTRY 6728_mesa_marshal_PointParameterxv(GLenum pname, const GLfixed * params) 6729{ 6730 GET_CURRENT_CONTEXT(ctx); 6731 int params_size = safe_mul(_mesa_point_param_enum_to_count(pname), 1 * sizeof(GLfixed)); 6732 int cmd_size = sizeof(struct marshal_cmd_PointParameterxv) + params_size; 6733 struct marshal_cmd_PointParameterxv *cmd; 6734 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6735 _mesa_glthread_finish_before(ctx, "PointParameterxv"); 6736 CALL_PointParameterxv(ctx->CurrentServerDispatch, (pname, params)); 6737 return; 6738 } 6739 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PointParameterxv, cmd_size); 6740 cmd->pname = pname; 6741 char *variable_data = (char *) (cmd + 1); 6742 memcpy(variable_data, params, params_size); 6743} 6744 6745 6746/* TexParameterxv: marshalled asynchronously */ 6747struct marshal_cmd_TexParameterxv 6748{ 6749 struct marshal_cmd_base cmd_base; 6750 GLenum target; 6751 GLenum pname; 6752 /* Next safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLfixed)) bytes are GLfixed params[None] */ 6753}; 6754uint32_t 6755_mesa_unmarshal_TexParameterxv(struct gl_context *ctx, const struct marshal_cmd_TexParameterxv *cmd, const uint64_t *last) 6756{ 6757 GLenum target = cmd->target; 6758 GLenum pname = cmd->pname; 6759 GLfixed * params; 6760 const char *variable_data = (const char *) (cmd + 1); 6761 params = (GLfixed *) variable_data; 6762 CALL_TexParameterxv(ctx->CurrentServerDispatch, (target, pname, params)); 6763 return cmd->cmd_base.cmd_size; 6764} 6765void GLAPIENTRY 6766_mesa_marshal_TexParameterxv(GLenum target, GLenum pname, const GLfixed * params) 6767{ 6768 GET_CURRENT_CONTEXT(ctx); 6769 int params_size = safe_mul(_mesa_tex_param_enum_to_count(pname), 1 * sizeof(GLfixed)); 6770 int cmd_size = sizeof(struct marshal_cmd_TexParameterxv) + params_size; 6771 struct marshal_cmd_TexParameterxv *cmd; 6772 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6773 _mesa_glthread_finish_before(ctx, "TexParameterxv"); 6774 CALL_TexParameterxv(ctx->CurrentServerDispatch, (target, pname, params)); 6775 return; 6776 } 6777 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexParameterxv, cmd_size); 6778 cmd->target = target; 6779 cmd->pname = pname; 6780 char *variable_data = (char *) (cmd + 1); 6781 memcpy(variable_data, params, params_size); 6782} 6783 6784 6785/* GetTexGenxvOES: marshalled synchronously */ 6786void GLAPIENTRY 6787_mesa_marshal_GetTexGenxvOES(GLenum coord, GLenum pname, GLfixed * params) 6788{ 6789 GET_CURRENT_CONTEXT(ctx); 6790 _mesa_glthread_finish_before(ctx, "GetTexGenxvOES"); 6791 CALL_GetTexGenxvOES(ctx->CurrentServerDispatch, (coord, pname, params)); 6792} 6793 6794 6795/* TexGenxOES: marshalled asynchronously */ 6796struct marshal_cmd_TexGenxOES 6797{ 6798 struct marshal_cmd_base cmd_base; 6799 GLenum coord; 6800 GLenum pname; 6801 GLint param; 6802}; 6803uint32_t 6804_mesa_unmarshal_TexGenxOES(struct gl_context *ctx, const struct marshal_cmd_TexGenxOES *cmd, const uint64_t *last) 6805{ 6806 GLenum coord = cmd->coord; 6807 GLenum pname = cmd->pname; 6808 GLint param = cmd->param; 6809 CALL_TexGenxOES(ctx->CurrentServerDispatch, (coord, pname, param)); 6810 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_TexGenxOES), 8) / 8); 6811 assert (cmd_size == cmd->cmd_base.cmd_size); 6812 return cmd_size; 6813} 6814void GLAPIENTRY 6815_mesa_marshal_TexGenxOES(GLenum coord, GLenum pname, GLint param) 6816{ 6817 GET_CURRENT_CONTEXT(ctx); 6818 int cmd_size = sizeof(struct marshal_cmd_TexGenxOES); 6819 struct marshal_cmd_TexGenxOES *cmd; 6820 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexGenxOES, cmd_size); 6821 cmd->coord = coord; 6822 cmd->pname = pname; 6823 cmd->param = param; 6824} 6825 6826 6827/* TexGenxvOES: marshalled asynchronously */ 6828struct marshal_cmd_TexGenxvOES 6829{ 6830 struct marshal_cmd_base cmd_base; 6831 GLenum coord; 6832 GLenum pname; 6833 /* Next safe_mul(_mesa_texgen_enum_to_count(pname), 1 * sizeof(GLfixed)) bytes are GLfixed params[None] */ 6834}; 6835uint32_t 6836_mesa_unmarshal_TexGenxvOES(struct gl_context *ctx, const struct marshal_cmd_TexGenxvOES *cmd, const uint64_t *last) 6837{ 6838 GLenum coord = cmd->coord; 6839 GLenum pname = cmd->pname; 6840 GLfixed * params; 6841 const char *variable_data = (const char *) (cmd + 1); 6842 params = (GLfixed *) variable_data; 6843 CALL_TexGenxvOES(ctx->CurrentServerDispatch, (coord, pname, params)); 6844 return cmd->cmd_base.cmd_size; 6845} 6846void GLAPIENTRY 6847_mesa_marshal_TexGenxvOES(GLenum coord, GLenum pname, const GLfixed * params) 6848{ 6849 GET_CURRENT_CONTEXT(ctx); 6850 int params_size = safe_mul(_mesa_texgen_enum_to_count(pname), 1 * sizeof(GLfixed)); 6851 int cmd_size = sizeof(struct marshal_cmd_TexGenxvOES) + params_size; 6852 struct marshal_cmd_TexGenxvOES *cmd; 6853 if (unlikely(params_size < 0 || (params_size > 0 && !params) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 6854 _mesa_glthread_finish_before(ctx, "TexGenxvOES"); 6855 CALL_TexGenxvOES(ctx->CurrentServerDispatch, (coord, pname, params)); 6856 return; 6857 } 6858 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_TexGenxvOES, cmd_size); 6859 cmd->coord = coord; 6860 cmd->pname = pname; 6861 char *variable_data = (char *) (cmd + 1); 6862 memcpy(variable_data, params, params_size); 6863} 6864 6865 6866/* ClipPlanef: marshalled asynchronously */ 6867struct marshal_cmd_ClipPlanef 6868{ 6869 struct marshal_cmd_base cmd_base; 6870 GLenum plane; 6871 GLfloat equation[4]; 6872}; 6873uint32_t 6874_mesa_unmarshal_ClipPlanef(struct gl_context *ctx, const struct marshal_cmd_ClipPlanef *cmd, const uint64_t *last) 6875{ 6876 GLenum plane = cmd->plane; 6877 const GLfloat * equation = cmd->equation; 6878 CALL_ClipPlanef(ctx->CurrentServerDispatch, (plane, equation)); 6879 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_ClipPlanef), 8) / 8); 6880 assert (cmd_size == cmd->cmd_base.cmd_size); 6881 return cmd_size; 6882} 6883void GLAPIENTRY 6884_mesa_marshal_ClipPlanef(GLenum plane, const GLfloat * equation) 6885{ 6886 GET_CURRENT_CONTEXT(ctx); 6887 int cmd_size = sizeof(struct marshal_cmd_ClipPlanef); 6888 struct marshal_cmd_ClipPlanef *cmd; 6889 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_ClipPlanef, cmd_size); 6890 cmd->plane = plane; 6891 memcpy(cmd->equation, equation, 4 * sizeof(GLfloat)); 6892} 6893 6894 6895/* GetClipPlanef: marshalled synchronously */ 6896void GLAPIENTRY 6897_mesa_marshal_GetClipPlanef(GLenum plane, GLfloat * equation) 6898{ 6899 GET_CURRENT_CONTEXT(ctx); 6900 _mesa_glthread_finish_before(ctx, "GetClipPlanef"); 6901 CALL_GetClipPlanef(ctx->CurrentServerDispatch, (plane, equation)); 6902} 6903 6904 6905/* Frustumf: marshalled asynchronously */ 6906struct marshal_cmd_Frustumf 6907{ 6908 struct marshal_cmd_base cmd_base; 6909 GLfloat left; 6910 GLfloat right; 6911 GLfloat bottom; 6912 GLfloat top; 6913 GLfloat zNear; 6914 GLfloat zFar; 6915}; 6916uint32_t 6917_mesa_unmarshal_Frustumf(struct gl_context *ctx, const struct marshal_cmd_Frustumf *cmd, const uint64_t *last) 6918{ 6919 GLfloat left = cmd->left; 6920 GLfloat right = cmd->right; 6921 GLfloat bottom = cmd->bottom; 6922 GLfloat top = cmd->top; 6923 GLfloat zNear = cmd->zNear; 6924 GLfloat zFar = cmd->zFar; 6925 CALL_Frustumf(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar)); 6926 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Frustumf), 8) / 8); 6927 assert (cmd_size == cmd->cmd_base.cmd_size); 6928 return cmd_size; 6929} 6930void GLAPIENTRY 6931_mesa_marshal_Frustumf(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) 6932{ 6933 GET_CURRENT_CONTEXT(ctx); 6934 int cmd_size = sizeof(struct marshal_cmd_Frustumf); 6935 struct marshal_cmd_Frustumf *cmd; 6936 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Frustumf, cmd_size); 6937 cmd->left = left; 6938 cmd->right = right; 6939 cmd->bottom = bottom; 6940 cmd->top = top; 6941 cmd->zNear = zNear; 6942 cmd->zFar = zFar; 6943} 6944 6945 6946/* Orthof: marshalled asynchronously */ 6947struct marshal_cmd_Orthof 6948{ 6949 struct marshal_cmd_base cmd_base; 6950 GLfloat left; 6951 GLfloat right; 6952 GLfloat bottom; 6953 GLfloat top; 6954 GLfloat zNear; 6955 GLfloat zFar; 6956}; 6957uint32_t 6958_mesa_unmarshal_Orthof(struct gl_context *ctx, const struct marshal_cmd_Orthof *cmd, const uint64_t *last) 6959{ 6960 GLfloat left = cmd->left; 6961 GLfloat right = cmd->right; 6962 GLfloat bottom = cmd->bottom; 6963 GLfloat top = cmd->top; 6964 GLfloat zNear = cmd->zNear; 6965 GLfloat zFar = cmd->zFar; 6966 CALL_Orthof(ctx->CurrentServerDispatch, (left, right, bottom, top, zNear, zFar)); 6967 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_Orthof), 8) / 8); 6968 assert (cmd_size == cmd->cmd_base.cmd_size); 6969 return cmd_size; 6970} 6971void GLAPIENTRY 6972_mesa_marshal_Orthof(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) 6973{ 6974 GET_CURRENT_CONTEXT(ctx); 6975 int cmd_size = sizeof(struct marshal_cmd_Orthof); 6976 struct marshal_cmd_Orthof *cmd; 6977 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_Orthof, cmd_size); 6978 cmd->left = left; 6979 cmd->right = right; 6980 cmd->bottom = bottom; 6981 cmd->top = top; 6982 cmd->zNear = zNear; 6983 cmd->zFar = zFar; 6984} 6985 6986 6987/* DrawTexiOES: marshalled asynchronously */ 6988struct marshal_cmd_DrawTexiOES 6989{ 6990 struct marshal_cmd_base cmd_base; 6991 GLint x; 6992 GLint y; 6993 GLint z; 6994 GLint width; 6995 GLint height; 6996}; 6997uint32_t 6998_mesa_unmarshal_DrawTexiOES(struct gl_context *ctx, const struct marshal_cmd_DrawTexiOES *cmd, const uint64_t *last) 6999{ 7000 GLint x = cmd->x; 7001 GLint y = cmd->y; 7002 GLint z = cmd->z; 7003 GLint width = cmd->width; 7004 GLint height = cmd->height; 7005 CALL_DrawTexiOES(ctx->CurrentServerDispatch, (x, y, z, width, height)); 7006 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawTexiOES), 8) / 8); 7007 assert (cmd_size == cmd->cmd_base.cmd_size); 7008 return cmd_size; 7009} 7010void GLAPIENTRY 7011_mesa_marshal_DrawTexiOES(GLint x, GLint y, GLint z, GLint width, GLint height) 7012{ 7013 GET_CURRENT_CONTEXT(ctx); 7014 int cmd_size = sizeof(struct marshal_cmd_DrawTexiOES); 7015 struct marshal_cmd_DrawTexiOES *cmd; 7016 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTexiOES, cmd_size); 7017 cmd->x = x; 7018 cmd->y = y; 7019 cmd->z = z; 7020 cmd->width = width; 7021 cmd->height = height; 7022} 7023 7024 7025/* DrawTexivOES: marshalled asynchronously */ 7026struct marshal_cmd_DrawTexivOES 7027{ 7028 struct marshal_cmd_base cmd_base; 7029 GLint coords[5]; 7030}; 7031uint32_t 7032_mesa_unmarshal_DrawTexivOES(struct gl_context *ctx, const struct marshal_cmd_DrawTexivOES *cmd, const uint64_t *last) 7033{ 7034 const GLint * coords = cmd->coords; 7035 CALL_DrawTexivOES(ctx->CurrentServerDispatch, (coords)); 7036 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawTexivOES), 8) / 8); 7037 assert (cmd_size == cmd->cmd_base.cmd_size); 7038 return cmd_size; 7039} 7040void GLAPIENTRY 7041_mesa_marshal_DrawTexivOES(const GLint * coords) 7042{ 7043 GET_CURRENT_CONTEXT(ctx); 7044 int cmd_size = sizeof(struct marshal_cmd_DrawTexivOES); 7045 struct marshal_cmd_DrawTexivOES *cmd; 7046 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTexivOES, cmd_size); 7047 memcpy(cmd->coords, coords, 5 * sizeof(GLint)); 7048} 7049 7050 7051/* DrawTexfOES: marshalled asynchronously */ 7052struct marshal_cmd_DrawTexfOES 7053{ 7054 struct marshal_cmd_base cmd_base; 7055 GLfloat x; 7056 GLfloat y; 7057 GLfloat z; 7058 GLfloat width; 7059 GLfloat height; 7060}; 7061uint32_t 7062_mesa_unmarshal_DrawTexfOES(struct gl_context *ctx, const struct marshal_cmd_DrawTexfOES *cmd, const uint64_t *last) 7063{ 7064 GLfloat x = cmd->x; 7065 GLfloat y = cmd->y; 7066 GLfloat z = cmd->z; 7067 GLfloat width = cmd->width; 7068 GLfloat height = cmd->height; 7069 CALL_DrawTexfOES(ctx->CurrentServerDispatch, (x, y, z, width, height)); 7070 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawTexfOES), 8) / 8); 7071 assert (cmd_size == cmd->cmd_base.cmd_size); 7072 return cmd_size; 7073} 7074void GLAPIENTRY 7075_mesa_marshal_DrawTexfOES(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height) 7076{ 7077 GET_CURRENT_CONTEXT(ctx); 7078 int cmd_size = sizeof(struct marshal_cmd_DrawTexfOES); 7079 struct marshal_cmd_DrawTexfOES *cmd; 7080 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTexfOES, cmd_size); 7081 cmd->x = x; 7082 cmd->y = y; 7083 cmd->z = z; 7084 cmd->width = width; 7085 cmd->height = height; 7086} 7087 7088 7089/* DrawTexfvOES: marshalled asynchronously */ 7090struct marshal_cmd_DrawTexfvOES 7091{ 7092 struct marshal_cmd_base cmd_base; 7093 GLfloat coords[5]; 7094}; 7095uint32_t 7096_mesa_unmarshal_DrawTexfvOES(struct gl_context *ctx, const struct marshal_cmd_DrawTexfvOES *cmd, const uint64_t *last) 7097{ 7098 const GLfloat * coords = cmd->coords; 7099 CALL_DrawTexfvOES(ctx->CurrentServerDispatch, (coords)); 7100 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawTexfvOES), 8) / 8); 7101 assert (cmd_size == cmd->cmd_base.cmd_size); 7102 return cmd_size; 7103} 7104void GLAPIENTRY 7105_mesa_marshal_DrawTexfvOES(const GLfloat * coords) 7106{ 7107 GET_CURRENT_CONTEXT(ctx); 7108 int cmd_size = sizeof(struct marshal_cmd_DrawTexfvOES); 7109 struct marshal_cmd_DrawTexfvOES *cmd; 7110 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTexfvOES, cmd_size); 7111 memcpy(cmd->coords, coords, 5 * sizeof(GLfloat)); 7112} 7113 7114 7115/* DrawTexsOES: marshalled asynchronously */ 7116struct marshal_cmd_DrawTexsOES 7117{ 7118 struct marshal_cmd_base cmd_base; 7119 GLshort x; 7120 GLshort y; 7121 GLshort z; 7122 GLshort width; 7123 GLshort height; 7124}; 7125uint32_t 7126_mesa_unmarshal_DrawTexsOES(struct gl_context *ctx, const struct marshal_cmd_DrawTexsOES *cmd, const uint64_t *last) 7127{ 7128 GLshort x = cmd->x; 7129 GLshort y = cmd->y; 7130 GLshort z = cmd->z; 7131 GLshort width = cmd->width; 7132 GLshort height = cmd->height; 7133 CALL_DrawTexsOES(ctx->CurrentServerDispatch, (x, y, z, width, height)); 7134 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawTexsOES), 8) / 8); 7135 assert (cmd_size == cmd->cmd_base.cmd_size); 7136 return cmd_size; 7137} 7138void GLAPIENTRY 7139_mesa_marshal_DrawTexsOES(GLshort x, GLshort y, GLshort z, GLshort width, GLshort height) 7140{ 7141 GET_CURRENT_CONTEXT(ctx); 7142 int cmd_size = sizeof(struct marshal_cmd_DrawTexsOES); 7143 struct marshal_cmd_DrawTexsOES *cmd; 7144 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTexsOES, cmd_size); 7145 cmd->x = x; 7146 cmd->y = y; 7147 cmd->z = z; 7148 cmd->width = width; 7149 cmd->height = height; 7150} 7151 7152 7153/* DrawTexsvOES: marshalled asynchronously */ 7154struct marshal_cmd_DrawTexsvOES 7155{ 7156 struct marshal_cmd_base cmd_base; 7157 GLshort coords[5]; 7158}; 7159uint32_t 7160_mesa_unmarshal_DrawTexsvOES(struct gl_context *ctx, const struct marshal_cmd_DrawTexsvOES *cmd, const uint64_t *last) 7161{ 7162 const GLshort * coords = cmd->coords; 7163 CALL_DrawTexsvOES(ctx->CurrentServerDispatch, (coords)); 7164 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawTexsvOES), 8) / 8); 7165 assert (cmd_size == cmd->cmd_base.cmd_size); 7166 return cmd_size; 7167} 7168void GLAPIENTRY 7169_mesa_marshal_DrawTexsvOES(const GLshort * coords) 7170{ 7171 GET_CURRENT_CONTEXT(ctx); 7172 int cmd_size = sizeof(struct marshal_cmd_DrawTexsvOES); 7173 struct marshal_cmd_DrawTexsvOES *cmd; 7174 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTexsvOES, cmd_size); 7175 memcpy(cmd->coords, coords, 5 * sizeof(GLshort)); 7176} 7177 7178 7179/* DrawTexxOES: marshalled asynchronously */ 7180struct marshal_cmd_DrawTexxOES 7181{ 7182 struct marshal_cmd_base cmd_base; 7183 GLfixed x; 7184 GLfixed y; 7185 GLfixed z; 7186 GLfixed width; 7187 GLfixed height; 7188}; 7189uint32_t 7190_mesa_unmarshal_DrawTexxOES(struct gl_context *ctx, const struct marshal_cmd_DrawTexxOES *cmd, const uint64_t *last) 7191{ 7192 GLfixed x = cmd->x; 7193 GLfixed y = cmd->y; 7194 GLfixed z = cmd->z; 7195 GLfixed width = cmd->width; 7196 GLfixed height = cmd->height; 7197 CALL_DrawTexxOES(ctx->CurrentServerDispatch, (x, y, z, width, height)); 7198 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawTexxOES), 8) / 8); 7199 assert (cmd_size == cmd->cmd_base.cmd_size); 7200 return cmd_size; 7201} 7202void GLAPIENTRY 7203_mesa_marshal_DrawTexxOES(GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height) 7204{ 7205 GET_CURRENT_CONTEXT(ctx); 7206 int cmd_size = sizeof(struct marshal_cmd_DrawTexxOES); 7207 struct marshal_cmd_DrawTexxOES *cmd; 7208 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTexxOES, cmd_size); 7209 cmd->x = x; 7210 cmd->y = y; 7211 cmd->z = z; 7212 cmd->width = width; 7213 cmd->height = height; 7214} 7215 7216 7217/* DrawTexxvOES: marshalled asynchronously */ 7218struct marshal_cmd_DrawTexxvOES 7219{ 7220 struct marshal_cmd_base cmd_base; 7221 GLfixed coords[5]; 7222}; 7223uint32_t 7224_mesa_unmarshal_DrawTexxvOES(struct gl_context *ctx, const struct marshal_cmd_DrawTexxvOES *cmd, const uint64_t *last) 7225{ 7226 const GLfixed * coords = cmd->coords; 7227 CALL_DrawTexxvOES(ctx->CurrentServerDispatch, (coords)); 7228 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DrawTexxvOES), 8) / 8); 7229 assert (cmd_size == cmd->cmd_base.cmd_size); 7230 return cmd_size; 7231} 7232void GLAPIENTRY 7233_mesa_marshal_DrawTexxvOES(const GLfixed * coords) 7234{ 7235 GET_CURRENT_CONTEXT(ctx); 7236 int cmd_size = sizeof(struct marshal_cmd_DrawTexxvOES); 7237 struct marshal_cmd_DrawTexxvOES *cmd; 7238 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DrawTexxvOES, cmd_size); 7239 memcpy(cmd->coords, coords, 5 * sizeof(GLfixed)); 7240} 7241 7242 7243/* PointSizePointerOES: marshalled asynchronously */ 7244struct marshal_cmd_PointSizePointerOES 7245{ 7246 struct marshal_cmd_base cmd_base; 7247 GLenum type; 7248 GLsizei stride; 7249 const GLvoid * pointer; 7250}; 7251uint32_t 7252_mesa_unmarshal_PointSizePointerOES(struct gl_context *ctx, const struct marshal_cmd_PointSizePointerOES *cmd, const uint64_t *last) 7253{ 7254 GLenum type = cmd->type; 7255 GLsizei stride = cmd->stride; 7256 const GLvoid * pointer = cmd->pointer; 7257 CALL_PointSizePointerOES(ctx->CurrentServerDispatch, (type, stride, pointer)); 7258 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_PointSizePointerOES), 8) / 8); 7259 assert (cmd_size == cmd->cmd_base.cmd_size); 7260 return cmd_size; 7261} 7262void GLAPIENTRY 7263_mesa_marshal_PointSizePointerOES(GLenum type, GLsizei stride, const GLvoid * pointer) 7264{ 7265 GET_CURRENT_CONTEXT(ctx); 7266 int cmd_size = sizeof(struct marshal_cmd_PointSizePointerOES); 7267 struct marshal_cmd_PointSizePointerOES *cmd; 7268 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_PointSizePointerOES, cmd_size); 7269 cmd->type = type; 7270 cmd->stride = stride; 7271 cmd->pointer = pointer; 7272 if (COMPAT) _mesa_glthread_AttribPointer(ctx, VERT_ATTRIB_POINT_SIZE, 1, type, stride, pointer); 7273} 7274 7275 7276/* QueryMatrixxOES: marshalled synchronously */ 7277GLbitfield GLAPIENTRY 7278_mesa_marshal_QueryMatrixxOES(GLfixed * mantissa, GLint * exponent) 7279{ 7280 GET_CURRENT_CONTEXT(ctx); 7281 _mesa_glthread_finish_before(ctx, "QueryMatrixxOES"); 7282 return CALL_QueryMatrixxOES(ctx->CurrentServerDispatch, (mantissa, exponent)); 7283} 7284 7285 7286/* DiscardFramebufferEXT: marshalled asynchronously */ 7287struct marshal_cmd_DiscardFramebufferEXT 7288{ 7289 struct marshal_cmd_base cmd_base; 7290 GLenum target; 7291 GLsizei numAttachments; 7292 /* Next safe_mul(numAttachments, 1 * sizeof(GLenum)) bytes are GLenum attachments[numAttachments] */ 7293}; 7294uint32_t 7295_mesa_unmarshal_DiscardFramebufferEXT(struct gl_context *ctx, const struct marshal_cmd_DiscardFramebufferEXT *cmd, const uint64_t *last) 7296{ 7297 GLenum target = cmd->target; 7298 GLsizei numAttachments = cmd->numAttachments; 7299 GLenum * attachments; 7300 const char *variable_data = (const char *) (cmd + 1); 7301 attachments = (GLenum *) variable_data; 7302 CALL_DiscardFramebufferEXT(ctx->CurrentServerDispatch, (target, numAttachments, attachments)); 7303 return cmd->cmd_base.cmd_size; 7304} 7305void GLAPIENTRY 7306_mesa_marshal_DiscardFramebufferEXT(GLenum target, GLsizei numAttachments, const GLenum * attachments) 7307{ 7308 GET_CURRENT_CONTEXT(ctx); 7309 int attachments_size = safe_mul(numAttachments, 1 * sizeof(GLenum)); 7310 int cmd_size = sizeof(struct marshal_cmd_DiscardFramebufferEXT) + attachments_size; 7311 struct marshal_cmd_DiscardFramebufferEXT *cmd; 7312 if (unlikely(attachments_size < 0 || (attachments_size > 0 && !attachments) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 7313 _mesa_glthread_finish_before(ctx, "DiscardFramebufferEXT"); 7314 CALL_DiscardFramebufferEXT(ctx->CurrentServerDispatch, (target, numAttachments, attachments)); 7315 return; 7316 } 7317 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DiscardFramebufferEXT, cmd_size); 7318 cmd->target = target; 7319 cmd->numAttachments = numAttachments; 7320 char *variable_data = (char *) (cmd + 1); 7321 memcpy(variable_data, attachments, attachments_size); 7322} 7323 7324 7325/* FramebufferTexture2DMultisampleEXT: marshalled asynchronously */ 7326struct marshal_cmd_FramebufferTexture2DMultisampleEXT 7327{ 7328 struct marshal_cmd_base cmd_base; 7329 GLenum target; 7330 GLenum attachment; 7331 GLenum textarget; 7332 GLuint texture; 7333 GLint level; 7334 GLsizei samples; 7335}; 7336uint32_t 7337_mesa_unmarshal_FramebufferTexture2DMultisampleEXT(struct gl_context *ctx, const struct marshal_cmd_FramebufferTexture2DMultisampleEXT *cmd, const uint64_t *last) 7338{ 7339 GLenum target = cmd->target; 7340 GLenum attachment = cmd->attachment; 7341 GLenum textarget = cmd->textarget; 7342 GLuint texture = cmd->texture; 7343 GLint level = cmd->level; 7344 GLsizei samples = cmd->samples; 7345 CALL_FramebufferTexture2DMultisampleEXT(ctx->CurrentServerDispatch, (target, attachment, textarget, texture, level, samples)); 7346 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FramebufferTexture2DMultisampleEXT), 8) / 8); 7347 assert (cmd_size == cmd->cmd_base.cmd_size); 7348 return cmd_size; 7349} 7350void GLAPIENTRY 7351_mesa_marshal_FramebufferTexture2DMultisampleEXT(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) 7352{ 7353 GET_CURRENT_CONTEXT(ctx); 7354 int cmd_size = sizeof(struct marshal_cmd_FramebufferTexture2DMultisampleEXT); 7355 struct marshal_cmd_FramebufferTexture2DMultisampleEXT *cmd; 7356 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferTexture2DMultisampleEXT, cmd_size); 7357 cmd->target = target; 7358 cmd->attachment = attachment; 7359 cmd->textarget = textarget; 7360 cmd->texture = texture; 7361 cmd->level = level; 7362 cmd->samples = samples; 7363} 7364 7365 7366/* DepthRangeArrayfvOES: marshalled asynchronously */ 7367struct marshal_cmd_DepthRangeArrayfvOES 7368{ 7369 struct marshal_cmd_base cmd_base; 7370 GLuint first; 7371 GLsizei count; 7372 /* Next safe_mul((2 * count), 1 * sizeof(GLfloat)) bytes are GLfloat v[(2 * count)] */ 7373}; 7374uint32_t 7375_mesa_unmarshal_DepthRangeArrayfvOES(struct gl_context *ctx, const struct marshal_cmd_DepthRangeArrayfvOES *cmd, const uint64_t *last) 7376{ 7377 GLuint first = cmd->first; 7378 GLsizei count = cmd->count; 7379 GLfloat * v; 7380 const char *variable_data = (const char *) (cmd + 1); 7381 v = (GLfloat *) variable_data; 7382 CALL_DepthRangeArrayfvOES(ctx->CurrentServerDispatch, (first, count, v)); 7383 return cmd->cmd_base.cmd_size; 7384} 7385void GLAPIENTRY 7386_mesa_marshal_DepthRangeArrayfvOES(GLuint first, GLsizei count, const GLfloat * v) 7387{ 7388 GET_CURRENT_CONTEXT(ctx); 7389 int v_size = safe_mul((2 * count), 1 * sizeof(GLfloat)); 7390 int cmd_size = sizeof(struct marshal_cmd_DepthRangeArrayfvOES) + v_size; 7391 struct marshal_cmd_DepthRangeArrayfvOES *cmd; 7392 if (unlikely(v_size < 0 || (v_size > 0 && !v) || (unsigned)cmd_size > MARSHAL_MAX_CMD_SIZE)) { 7393 _mesa_glthread_finish_before(ctx, "DepthRangeArrayfvOES"); 7394 CALL_DepthRangeArrayfvOES(ctx->CurrentServerDispatch, (first, count, v)); 7395 return; 7396 } 7397 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DepthRangeArrayfvOES, cmd_size); 7398 cmd->first = first; 7399 cmd->count = count; 7400 char *variable_data = (char *) (cmd + 1); 7401 memcpy(variable_data, v, v_size); 7402} 7403 7404 7405/* DepthRangeIndexedfOES: marshalled asynchronously */ 7406struct marshal_cmd_DepthRangeIndexedfOES 7407{ 7408 struct marshal_cmd_base cmd_base; 7409 GLuint index; 7410 GLfloat n; 7411 GLfloat f; 7412}; 7413uint32_t 7414_mesa_unmarshal_DepthRangeIndexedfOES(struct gl_context *ctx, const struct marshal_cmd_DepthRangeIndexedfOES *cmd, const uint64_t *last) 7415{ 7416 GLuint index = cmd->index; 7417 GLfloat n = cmd->n; 7418 GLfloat f = cmd->f; 7419 CALL_DepthRangeIndexedfOES(ctx->CurrentServerDispatch, (index, n, f)); 7420 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_DepthRangeIndexedfOES), 8) / 8); 7421 assert (cmd_size == cmd->cmd_base.cmd_size); 7422 return cmd_size; 7423} 7424void GLAPIENTRY 7425_mesa_marshal_DepthRangeIndexedfOES(GLuint index, GLfloat n, GLfloat f) 7426{ 7427 GET_CURRENT_CONTEXT(ctx); 7428 int cmd_size = sizeof(struct marshal_cmd_DepthRangeIndexedfOES); 7429 struct marshal_cmd_DepthRangeIndexedfOES *cmd; 7430 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_DepthRangeIndexedfOES, cmd_size); 7431 cmd->index = index; 7432 cmd->n = n; 7433 cmd->f = f; 7434} 7435 7436 7437/* FramebufferParameteriMESA: marshalled asynchronously */ 7438struct marshal_cmd_FramebufferParameteriMESA 7439{ 7440 struct marshal_cmd_base cmd_base; 7441 GLenum target; 7442 GLenum pname; 7443 GLint param; 7444}; 7445uint32_t 7446_mesa_unmarshal_FramebufferParameteriMESA(struct gl_context *ctx, const struct marshal_cmd_FramebufferParameteriMESA *cmd, const uint64_t *last) 7447{ 7448 GLenum target = cmd->target; 7449 GLenum pname = cmd->pname; 7450 GLint param = cmd->param; 7451 CALL_FramebufferParameteriMESA(ctx->CurrentServerDispatch, (target, pname, param)); 7452 const unsigned cmd_size = (align(sizeof(struct marshal_cmd_FramebufferParameteriMESA), 8) / 8); 7453 assert (cmd_size == cmd->cmd_base.cmd_size); 7454 return cmd_size; 7455} 7456void GLAPIENTRY 7457_mesa_marshal_FramebufferParameteriMESA(GLenum target, GLenum pname, GLint param) 7458{ 7459 GET_CURRENT_CONTEXT(ctx); 7460 int cmd_size = sizeof(struct marshal_cmd_FramebufferParameteriMESA); 7461 struct marshal_cmd_FramebufferParameteriMESA *cmd; 7462 cmd = _mesa_glthread_allocate_command(ctx, DISPATCH_CMD_FramebufferParameteriMESA, cmd_size); 7463 cmd->target = target; 7464 cmd->pname = pname; 7465 cmd->param = param; 7466} 7467 7468 7469/* GetFramebufferParameterivMESA: marshalled synchronously */ 7470void GLAPIENTRY 7471_mesa_marshal_GetFramebufferParameterivMESA(GLenum target, GLenum pname, GLint * params) 7472{ 7473 GET_CURRENT_CONTEXT(ctx); 7474 _mesa_glthread_finish_before(ctx, "GetFramebufferParameterivMESA"); 7475 CALL_GetFramebufferParameterivMESA(ctx->CurrentServerDispatch, (target, pname, params)); 7476} 7477 7478 7479