1 /* DO NOT EDIT - This file generated automatically by glX_proto_size.py (from Mesa) script */
4 * (C) Copyright IBM Corporation 2005
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:
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
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
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
30 #include "glxserver.h"
31 #include "glxbyteorder.h"
32 #include "indirect_size.h"
33 #include "indirect_reqsize.h"
35 #define __GLX_PAD(x) (((x) + 3) & ~3)
37 #if defined(__CYGWIN__) || defined(__MINGW32__)
41 # define ALIAS2(from,to) \
42 int __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \
43 __attribute__ ((alias( # to )));
44 # define ALIAS(from,to) ALIAS2( from, __glX ## to ## ReqSize )
46 # define ALIAS(from,to) \
47 int __glX ## from ## ReqSize( const GLbyte * pc, Bool swap ) \
48 { return __glX ## to ## ReqSize( pc, swap ); }
53 __glXCallListsReqSize(const GLbyte *pc, Bool swap)
55 GLsizei n = *(GLsizei *) (pc + 0);
56 GLenum type = *(GLenum *) (pc + 4);
61 type = bswap_32(type);
64 compsize = __glCallLists_size(type);
65 return __GLX_PAD((compsize * n));
69 __glXBitmapReqSize(const GLbyte *pc, Bool swap)
71 GLint row_length = *(GLint *) (pc + 4);
72 GLint image_height = 0;
73 GLint skip_images = 0;
74 GLint skip_rows = *(GLint *) (pc + 8);
75 GLint alignment = *(GLint *) (pc + 16);
76 GLsizei width = *(GLsizei *) (pc + 20);
77 GLsizei height = *(GLsizei *) (pc + 24);
80 row_length = bswap_32(row_length);
81 skip_rows = bswap_32(skip_rows);
82 alignment = bswap_32(alignment);
83 width = bswap_32(width);
84 height = bswap_32(height);
87 return __glXImageSize(GL_COLOR_INDEX, GL_BITMAP, 0, width, height, 1,
88 image_height, row_length, skip_images,
89 skip_rows, alignment);
93 __glXFogfvReqSize(const GLbyte *pc, Bool swap)
95 GLenum pname = *(GLenum *) (pc + 0);
99 pname = bswap_32(pname);
102 compsize = __glFogfv_size(pname);
103 return __GLX_PAD((compsize * 4));
107 __glXLightfvReqSize(const GLbyte *pc, Bool swap)
109 GLenum pname = *(GLenum *) (pc + 4);
113 pname = bswap_32(pname);
116 compsize = __glLightfv_size(pname);
117 return __GLX_PAD((compsize * 4));
121 __glXLightModelfvReqSize(const GLbyte *pc, Bool swap)
123 GLenum pname = *(GLenum *) (pc + 0);
127 pname = bswap_32(pname);
130 compsize = __glLightModelfv_size(pname);
131 return __GLX_PAD((compsize * 4));
135 __glXMaterialfvReqSize(const GLbyte *pc, Bool swap)
137 GLenum pname = *(GLenum *) (pc + 4);
141 pname = bswap_32(pname);
144 compsize = __glMaterialfv_size(pname);
145 return __GLX_PAD((compsize * 4));
149 __glXPolygonStippleReqSize(const GLbyte *pc, Bool swap)
151 GLint row_length = *(GLint *) (pc + 4);
152 GLint image_height = 0;
153 GLint skip_images = 0;
154 GLint skip_rows = *(GLint *) (pc + 8);
155 GLint alignment = *(GLint *) (pc + 16);
158 row_length = bswap_32(row_length);
159 skip_rows = bswap_32(skip_rows);
160 alignment = bswap_32(alignment);
163 return __glXImageSize(GL_COLOR_INDEX, GL_BITMAP, 0, 32, 32, 1,
164 image_height, row_length, skip_images,
165 skip_rows, alignment);
169 __glXTexParameterfvReqSize(const GLbyte *pc, Bool swap)
171 GLenum pname = *(GLenum *) (pc + 4);
175 pname = bswap_32(pname);
178 compsize = __glTexParameterfv_size(pname);
179 return __GLX_PAD((compsize * 4));
183 __glXTexImage1DReqSize(const GLbyte *pc, Bool swap)
185 GLint row_length = *(GLint *) (pc + 4);
186 GLint image_height = 0;
187 GLint skip_images = 0;
188 GLint skip_rows = *(GLint *) (pc + 8);
189 GLint alignment = *(GLint *) (pc + 16);
190 GLenum target = *(GLenum *) (pc + 20);
191 GLsizei width = *(GLsizei *) (pc + 32);
192 GLenum format = *(GLenum *) (pc + 44);
193 GLenum type = *(GLenum *) (pc + 48);
196 row_length = bswap_32(row_length);
197 skip_rows = bswap_32(skip_rows);
198 alignment = bswap_32(alignment);
199 target = bswap_32(target);
200 width = bswap_32(width);
201 format = bswap_32(format);
202 type = bswap_32(type);
205 return __glXImageSize(format, type, target, width, 1, 1,
206 image_height, row_length, skip_images,
207 skip_rows, alignment);
211 __glXTexImage2DReqSize(const GLbyte *pc, Bool swap)
213 GLint row_length = *(GLint *) (pc + 4);
214 GLint image_height = 0;
215 GLint skip_images = 0;
216 GLint skip_rows = *(GLint *) (pc + 8);
217 GLint alignment = *(GLint *) (pc + 16);
218 GLenum target = *(GLenum *) (pc + 20);
219 GLsizei width = *(GLsizei *) (pc + 32);
220 GLsizei height = *(GLsizei *) (pc + 36);
221 GLenum format = *(GLenum *) (pc + 44);
222 GLenum type = *(GLenum *) (pc + 48);
225 row_length = bswap_32(row_length);
226 skip_rows = bswap_32(skip_rows);
227 alignment = bswap_32(alignment);
228 target = bswap_32(target);
229 width = bswap_32(width);
230 height = bswap_32(height);
231 format = bswap_32(format);
232 type = bswap_32(type);
235 return __glXImageSize(format, type, target, width, height, 1,
236 image_height, row_length, skip_images,
237 skip_rows, alignment);
241 __glXTexEnvfvReqSize(const GLbyte *pc, Bool swap)
243 GLenum pname = *(GLenum *) (pc + 4);
247 pname = bswap_32(pname);
250 compsize = __glTexEnvfv_size(pname);
251 return __GLX_PAD((compsize * 4));
255 __glXTexGendvReqSize(const GLbyte *pc, Bool swap)
257 GLenum pname = *(GLenum *) (pc + 4);
261 pname = bswap_32(pname);
264 compsize = __glTexGendv_size(pname);
265 return __GLX_PAD((compsize * 8));
269 __glXTexGenfvReqSize(const GLbyte *pc, Bool swap)
271 GLenum pname = *(GLenum *) (pc + 4);
275 pname = bswap_32(pname);
278 compsize = __glTexGenfv_size(pname);
279 return __GLX_PAD((compsize * 4));
283 __glXPixelMapfvReqSize(const GLbyte *pc, Bool swap)
285 GLsizei mapsize = *(GLsizei *) (pc + 4);
288 mapsize = bswap_32(mapsize);
291 return __GLX_PAD((mapsize * 4));
295 __glXPixelMapusvReqSize(const GLbyte *pc, Bool swap)
297 GLsizei mapsize = *(GLsizei *) (pc + 4);
300 mapsize = bswap_32(mapsize);
303 return __GLX_PAD((mapsize * 2));
307 __glXDrawPixelsReqSize(const GLbyte *pc, Bool swap)
309 GLint row_length = *(GLint *) (pc + 4);
310 GLint image_height = 0;
311 GLint skip_images = 0;
312 GLint skip_rows = *(GLint *) (pc + 8);
313 GLint alignment = *(GLint *) (pc + 16);
314 GLsizei width = *(GLsizei *) (pc + 20);
315 GLsizei height = *(GLsizei *) (pc + 24);
316 GLenum format = *(GLenum *) (pc + 28);
317 GLenum type = *(GLenum *) (pc + 32);
320 row_length = bswap_32(row_length);
321 skip_rows = bswap_32(skip_rows);
322 alignment = bswap_32(alignment);
323 width = bswap_32(width);
324 height = bswap_32(height);
325 format = bswap_32(format);
326 type = bswap_32(type);
329 return __glXImageSize(format, type, 0, width, height, 1,
330 image_height, row_length, skip_images,
331 skip_rows, alignment);
335 __glXPrioritizeTexturesReqSize(const GLbyte *pc, Bool swap)
337 GLsizei n = *(GLsizei *) (pc + 0);
343 return __GLX_PAD((n * 4) + (n * 4));
347 __glXTexSubImage1DReqSize(const GLbyte *pc, Bool swap)
349 GLint row_length = *(GLint *) (pc + 4);
350 GLint image_height = 0;
351 GLint skip_images = 0;
352 GLint skip_rows = *(GLint *) (pc + 8);
353 GLint alignment = *(GLint *) (pc + 16);
354 GLenum target = *(GLenum *) (pc + 20);
355 GLsizei width = *(GLsizei *) (pc + 36);
356 GLenum format = *(GLenum *) (pc + 44);
357 GLenum type = *(GLenum *) (pc + 48);
360 row_length = bswap_32(row_length);
361 skip_rows = bswap_32(skip_rows);
362 alignment = bswap_32(alignment);
363 target = bswap_32(target);
364 width = bswap_32(width);
365 format = bswap_32(format);
366 type = bswap_32(type);
369 return __glXImageSize(format, type, target, width, 1, 1,
370 image_height, row_length, skip_images,
371 skip_rows, alignment);
375 __glXTexSubImage2DReqSize(const GLbyte *pc, Bool swap)
377 GLint row_length = *(GLint *) (pc + 4);
378 GLint image_height = 0;
379 GLint skip_images = 0;
380 GLint skip_rows = *(GLint *) (pc + 8);
381 GLint alignment = *(GLint *) (pc + 16);
382 GLenum target = *(GLenum *) (pc + 20);
383 GLsizei width = *(GLsizei *) (pc + 36);
384 GLsizei height = *(GLsizei *) (pc + 40);
385 GLenum format = *(GLenum *) (pc + 44);
386 GLenum type = *(GLenum *) (pc + 48);
389 row_length = bswap_32(row_length);
390 skip_rows = bswap_32(skip_rows);
391 alignment = bswap_32(alignment);
392 target = bswap_32(target);
393 width = bswap_32(width);
394 height = bswap_32(height);
395 format = bswap_32(format);
396 type = bswap_32(type);
399 return __glXImageSize(format, type, target, width, height, 1,
400 image_height, row_length, skip_images,
401 skip_rows, alignment);
405 __glXColorTableReqSize(const GLbyte *pc, Bool swap)
407 GLint row_length = *(GLint *) (pc + 4);
408 GLint image_height = 0;
409 GLint skip_images = 0;
410 GLint skip_rows = *(GLint *) (pc + 8);
411 GLint alignment = *(GLint *) (pc + 16);
412 GLenum target = *(GLenum *) (pc + 20);
413 GLsizei width = *(GLsizei *) (pc + 28);
414 GLenum format = *(GLenum *) (pc + 32);
415 GLenum type = *(GLenum *) (pc + 36);
418 row_length = bswap_32(row_length);
419 skip_rows = bswap_32(skip_rows);
420 alignment = bswap_32(alignment);
421 target = bswap_32(target);
422 width = bswap_32(width);
423 format = bswap_32(format);
424 type = bswap_32(type);
427 return __glXImageSize(format, type, target, width, 1, 1,
428 image_height, row_length, skip_images,
429 skip_rows, alignment);
433 __glXColorTableParameterfvReqSize(const GLbyte *pc, Bool swap)
435 GLenum pname = *(GLenum *) (pc + 4);
439 pname = bswap_32(pname);
442 compsize = __glColorTableParameterfv_size(pname);
443 return __GLX_PAD((compsize * 4));
447 __glXColorSubTableReqSize(const GLbyte *pc, Bool swap)
449 GLint row_length = *(GLint *) (pc + 4);
450 GLint image_height = 0;
451 GLint skip_images = 0;
452 GLint skip_rows = *(GLint *) (pc + 8);
453 GLint alignment = *(GLint *) (pc + 16);
454 GLenum target = *(GLenum *) (pc + 20);
455 GLsizei count = *(GLsizei *) (pc + 28);
456 GLenum format = *(GLenum *) (pc + 32);
457 GLenum type = *(GLenum *) (pc + 36);
460 row_length = bswap_32(row_length);
461 skip_rows = bswap_32(skip_rows);
462 alignment = bswap_32(alignment);
463 target = bswap_32(target);
464 count = bswap_32(count);
465 format = bswap_32(format);
466 type = bswap_32(type);
469 return __glXImageSize(format, type, target, count, 1, 1,
470 image_height, row_length, skip_images,
471 skip_rows, alignment);
475 __glXConvolutionFilter1DReqSize(const GLbyte *pc, Bool swap)
477 GLint row_length = *(GLint *) (pc + 4);
478 GLint image_height = 0;
479 GLint skip_images = 0;
480 GLint skip_rows = *(GLint *) (pc + 8);
481 GLint alignment = *(GLint *) (pc + 16);
482 GLenum target = *(GLenum *) (pc + 20);
483 GLsizei width = *(GLsizei *) (pc + 28);
484 GLenum format = *(GLenum *) (pc + 36);
485 GLenum type = *(GLenum *) (pc + 40);
488 row_length = bswap_32(row_length);
489 skip_rows = bswap_32(skip_rows);
490 alignment = bswap_32(alignment);
491 target = bswap_32(target);
492 width = bswap_32(width);
493 format = bswap_32(format);
494 type = bswap_32(type);
497 return __glXImageSize(format, type, target, width, 1, 1,
498 image_height, row_length, skip_images,
499 skip_rows, alignment);
503 __glXConvolutionFilter2DReqSize(const GLbyte *pc, Bool swap)
505 GLint row_length = *(GLint *) (pc + 4);
506 GLint image_height = 0;
507 GLint skip_images = 0;
508 GLint skip_rows = *(GLint *) (pc + 8);
509 GLint alignment = *(GLint *) (pc + 16);
510 GLenum target = *(GLenum *) (pc + 20);
511 GLsizei width = *(GLsizei *) (pc + 28);
512 GLsizei height = *(GLsizei *) (pc + 32);
513 GLenum format = *(GLenum *) (pc + 36);
514 GLenum type = *(GLenum *) (pc + 40);
517 row_length = bswap_32(row_length);
518 skip_rows = bswap_32(skip_rows);
519 alignment = bswap_32(alignment);
520 target = bswap_32(target);
521 width = bswap_32(width);
522 height = bswap_32(height);
523 format = bswap_32(format);
524 type = bswap_32(type);
527 return __glXImageSize(format, type, target, width, height, 1,
528 image_height, row_length, skip_images,
529 skip_rows, alignment);
533 __glXConvolutionParameterfvReqSize(const GLbyte *pc, Bool swap)
535 GLenum pname = *(GLenum *) (pc + 4);
539 pname = bswap_32(pname);
542 compsize = __glConvolutionParameterfv_size(pname);
543 return __GLX_PAD((compsize * 4));
547 __glXTexImage3DReqSize(const GLbyte *pc, Bool swap)
549 GLint row_length = *(GLint *) (pc + 4);
550 GLint image_height = *(GLint *) (pc + 8);
551 GLint skip_rows = *(GLint *) (pc + 16);
552 GLint skip_images = *(GLint *) (pc + 20);
553 GLint alignment = *(GLint *) (pc + 32);
554 GLenum target = *(GLenum *) (pc + 36);
555 GLsizei width = *(GLsizei *) (pc + 48);
556 GLsizei height = *(GLsizei *) (pc + 52);
557 GLsizei depth = *(GLsizei *) (pc + 56);
558 GLenum format = *(GLenum *) (pc + 68);
559 GLenum type = *(GLenum *) (pc + 72);
562 row_length = bswap_32(row_length);
563 image_height = bswap_32(image_height);
564 skip_rows = bswap_32(skip_rows);
565 skip_images = bswap_32(skip_images);
566 alignment = bswap_32(alignment);
567 target = bswap_32(target);
568 width = bswap_32(width);
569 height = bswap_32(height);
570 depth = bswap_32(depth);
571 format = bswap_32(format);
572 type = bswap_32(type);
575 if (*(CARD32 *) (pc + 76))
578 return __glXImageSize(format, type, target, width, height, depth,
579 image_height, row_length, skip_images,
580 skip_rows, alignment);
584 __glXTexSubImage3DReqSize(const GLbyte *pc, Bool swap)
586 GLint row_length = *(GLint *) (pc + 4);
587 GLint image_height = *(GLint *) (pc + 8);
588 GLint skip_rows = *(GLint *) (pc + 16);
589 GLint skip_images = *(GLint *) (pc + 20);
590 GLint alignment = *(GLint *) (pc + 32);
591 GLenum target = *(GLenum *) (pc + 36);
592 GLsizei width = *(GLsizei *) (pc + 60);
593 GLsizei height = *(GLsizei *) (pc + 64);
594 GLsizei depth = *(GLsizei *) (pc + 68);
595 GLenum format = *(GLenum *) (pc + 76);
596 GLenum type = *(GLenum *) (pc + 80);
599 row_length = bswap_32(row_length);
600 image_height = bswap_32(image_height);
601 skip_rows = bswap_32(skip_rows);
602 skip_images = bswap_32(skip_images);
603 alignment = bswap_32(alignment);
604 target = bswap_32(target);
605 width = bswap_32(width);
606 height = bswap_32(height);
607 depth = bswap_32(depth);
608 format = bswap_32(format);
609 type = bswap_32(type);
612 return __glXImageSize(format, type, target, width, height, depth,
613 image_height, row_length, skip_images,
614 skip_rows, alignment);
618 __glXCompressedTexImage1DARBReqSize(const GLbyte *pc, Bool swap)
620 GLsizei imageSize = *(GLsizei *) (pc + 20);
623 imageSize = bswap_32(imageSize);
626 return __GLX_PAD(imageSize);
630 __glXCompressedTexImage2DARBReqSize(const GLbyte *pc, Bool swap)
632 GLsizei imageSize = *(GLsizei *) (pc + 24);
635 imageSize = bswap_32(imageSize);
638 return __GLX_PAD(imageSize);
642 __glXCompressedTexImage3DARBReqSize(const GLbyte *pc, Bool swap)
644 GLsizei imageSize = *(GLsizei *) (pc + 28);
647 imageSize = bswap_32(imageSize);
650 return __GLX_PAD(imageSize);
654 __glXCompressedTexSubImage3DARBReqSize(const GLbyte *pc, Bool swap)
656 GLsizei imageSize = *(GLsizei *) (pc + 36);
659 imageSize = bswap_32(imageSize);
662 return __GLX_PAD(imageSize);
666 __glXProgramStringARBReqSize(const GLbyte *pc, Bool swap)
668 GLsizei len = *(GLsizei *) (pc + 8);
674 return __GLX_PAD(len);
678 __glXDrawBuffersARBReqSize(const GLbyte *pc, Bool swap)
680 GLsizei n = *(GLsizei *) (pc + 0);
686 return __GLX_PAD((n * 4));
690 __glXPointParameterfvEXTReqSize(const GLbyte *pc, Bool swap)
692 GLenum pname = *(GLenum *) (pc + 0);
696 pname = bswap_32(pname);
699 compsize = __glPointParameterfvEXT_size(pname);
700 return __GLX_PAD((compsize * 4));
704 __glXProgramParameters4dvNVReqSize(const GLbyte *pc, Bool swap)
706 GLuint num = *(GLuint *) (pc + 8);
712 return __GLX_PAD((num * 32));
716 __glXProgramParameters4fvNVReqSize(const GLbyte *pc, Bool swap)
718 GLuint num = *(GLuint *) (pc + 8);
724 return __GLX_PAD((num * 16));
728 __glXVertexAttribs1dvNVReqSize(const GLbyte *pc, Bool swap)
730 GLsizei n = *(GLsizei *) (pc + 4);
736 return __GLX_PAD((n * 8));
740 __glXVertexAttribs2dvNVReqSize(const GLbyte *pc, Bool swap)
742 GLsizei n = *(GLsizei *) (pc + 4);
748 return __GLX_PAD((n * 16));
752 __glXVertexAttribs3dvNVReqSize(const GLbyte *pc, Bool swap)
754 GLsizei n = *(GLsizei *) (pc + 4);
760 return __GLX_PAD((n * 24));
764 __glXVertexAttribs3fvNVReqSize(const GLbyte *pc, Bool swap)
766 GLsizei n = *(GLsizei *) (pc + 4);
772 return __GLX_PAD((n * 12));
776 __glXVertexAttribs3svNVReqSize(const GLbyte *pc, Bool swap)
778 GLsizei n = *(GLsizei *) (pc + 4);
784 return __GLX_PAD((n * 6));
788 __glXVertexAttribs4dvNVReqSize(const GLbyte *pc, Bool swap)
790 GLsizei n = *(GLsizei *) (pc + 4);
796 return __GLX_PAD((n * 32));
800 __glXProgramNamedParameter4fvNVReqSize(const GLbyte *pc, Bool swap)
802 GLsizei len = *(GLsizei *) (pc + 4);
808 return __GLX_PAD(len);
812 ALIAS(Lightiv, Lightfv)
813 ALIAS(LightModeliv, LightModelfv)
814 ALIAS(Materialiv, Materialfv)
815 ALIAS(TexParameteriv, TexParameterfv)
816 ALIAS(TexEnviv, TexEnvfv)
817 ALIAS(TexGeniv, TexGenfv)
818 ALIAS(PixelMapuiv, PixelMapfv)
819 ALIAS(ColorTableParameteriv, ColorTableParameterfv)
820 ALIAS(ConvolutionParameteriv, ConvolutionParameterfv)
821 ALIAS(CompressedTexSubImage1DARB, CompressedTexImage1DARB)
822 ALIAS(CompressedTexSubImage2DARB, CompressedTexImage3DARB)
823 ALIAS(LoadProgramNV, ProgramStringARB)
824 ALIAS(RequestResidentProgramsNV, DrawBuffersARB)
825 ALIAS(VertexAttribs1fvNV, PixelMapfv)
826 ALIAS(VertexAttribs1svNV, PixelMapusv)
827 ALIAS(VertexAttribs2fvNV, VertexAttribs1dvNV)
828 ALIAS(VertexAttribs2svNV, PixelMapfv)
829 ALIAS(VertexAttribs4fvNV, VertexAttribs2dvNV)
830 ALIAS(VertexAttribs4svNV, VertexAttribs1dvNV)
831 ALIAS(VertexAttribs4ubvNV, PixelMapfv)
832 ALIAS(PointParameterivNV, PointParameterfvEXT)
833 ALIAS(ProgramNamedParameter4dvNV, CompressedTexSubImage3DARB)
834 ALIAS(DeleteFramebuffersEXT, DrawBuffersARB)
835 ALIAS(DeleteRenderbuffersEXT, DrawBuffersARB)