1 /* Copyright © 2013, Intel Corporation
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal
5 * in the Software without restriction, including without limitation the rights
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 * copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 /* The prototypes for some OpenGL functions changed at one point from:
26 * const void* *indices
28 * const void* const coist *indices
30 * This makes it difficult for us to provide an implementation of
31 * these functions that is consistent with the locally-available gl.h
32 * since we don't know if the extra const will be present or not.
34 * To workaround this problem, we simply #define away const altogether
35 * before including gl.h.
37 * Kudos to Keith Packard for suggesting this kludge.
41 #define GL_GLEXT_PROTOTYPES
50 /* The first appearance of the GLfixed datatype in Mesa was with
51 * glext.h of version 20130624. So we'll assume that any older glext.h
52 * cannot have any function accepting a GLfixed parameter. */
53 #if GL_GLEXT_VERSION >= 20130624
54 #define HAVE_GLFIXED 1
57 /* As of glext.h version 20131008 some types changed.
59 * I have no idea why some internalFormats changed from GLenum to
60 * GLint while others changed from GLint to GLenum.
62 * But, in order to compile with either version, we track these.
64 #if GL_GLEXT_VERSION >= 20131008
65 #define GLint_or_enum GLenum
66 #define GLenum_or_int GLint
68 #define GLint_or_enum GLint
69 #define GLenum_or_int GLenum
72 static void *gl_handle;
74 /* Switch metrics operation persistently, (until next SWITCH) */
75 #define SWITCH_METRICS_OP(op) \
76 context_counter_stop (); \
77 context_set_current_op (op); \
78 context_counter_start ();
80 /* Switch metrics operation temporarily, see RESTORE_METRICS_OP */
81 #define SAVE_THEN_SWITCH_METRICS_OP(op) \
82 metrics_op_t save = context_get_current_op (); \
83 SWITCH_METRICS_OP (op);
85 /* Switch back to metrics operation saved by SAVE_THEN_SWITCH_METRICS_OP */
86 #define RESTORE_METRICS_OP() \
87 SWITCH_METRICS_OP (save);
90 glwrap_set_gl_handle (void *handle)
92 if (gl_handle == NULL)
97 glwrap_lookup (char *name)
101 /* We don't call dlopen here to find the library in which to
102 * perform a dlsym lookup. That's because the application may
103 * be loading libGL.so or libGLESv2.so for its OpenGL symbols.
105 * So we instead watch for one of those filenames to go by in
106 * our dlopen wrapper, which will then call
107 * glwrap_set_gl_handle to give us the handle to use here.
109 * If the application hasn't called dlopen on a "libGL"
110 * library, then presumably the application is linked directly
111 * to an OpenGL implementation. In this case, we can use
112 * RTLD_NEXT to find the symbol.
114 * But just in case, we also let the user override that by
115 * specifying the FIPS_LIBGL environment variable to the path
116 * of the real libGL.so library that fips should dlopen here.
118 if (gl_handle == NULL) {
121 path = getenv ("FIPS_LIBGL");
123 path = getenv ("GLAZE_LIBGL");
125 gl_handle = dlopen (path, RTLD_LAZY);
127 if (gl_handle == NULL) {
128 fprintf (stderr, "Failed to dlopen FIPS_LIBGL: "
133 gl_handle = RTLD_NEXT;
137 ret = dlwrap_real_dlsym (gl_handle, name);
140 fprintf (stderr, "fips: Error: glwrap_lookup failed to dlsym %s\n",
148 /* With a program change, we stop the counter, update the
149 * active program, then start the counter up again. */
151 glUseProgram (GLuint program)
153 SWITCH_METRICS_OP (METRICS_OP_SHADER + program);
155 GLWRAP_DEFER(glUseProgram, program);
159 glUseProgramObjectARB (GLhandleARB programObj)
161 SWITCH_METRICS_OP (METRICS_OP_SHADER + programObj);
163 GLWRAP_DEFER(glUseProgramObjectARB, programObj);
166 /* METRICS_OP_ACCUM */
168 glAccum (GLenum op, GLfloat value)
170 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_ACCUM);
172 GLWRAP_DEFER (glAccum, op, value);
174 RESTORE_METRICS_OP ();
178 glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
180 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_ACCUM);
182 GLWRAP_DEFER (glClearAccum, red, green, blue, alpha);
184 RESTORE_METRICS_OP ();
189 glClearAccumxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
191 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_ACCUM);
193 GLWRAP_DEFER (glClearAccumxOES, red, green, blue, alpha);
195 RESTORE_METRICS_OP ();
199 /* METRICS_OP_BUFFER_DATA */
201 glBufferData (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage)
203 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
205 GLWRAP_DEFER (glBufferData, target, size, data, usage);
207 RESTORE_METRICS_OP ();
211 glNamedBufferDataEXT (GLuint buffer, GLsizeiptr size, const GLvoid *data,
214 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
216 GLWRAP_DEFER (glNamedBufferDataEXT, buffer, size, data, usage);
218 RESTORE_METRICS_OP ();
222 glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size,
225 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
227 GLWRAP_DEFER (glBufferSubData, target, offset, size, data);
229 RESTORE_METRICS_OP ();
233 glNamedBufferSubDataEXT (GLuint buffer, GLintptr offset, GLsizeiptr size,
236 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
238 GLWRAP_DEFER (glNamedBufferSubDataEXT, buffer, offset, size, data);
240 RESTORE_METRICS_OP ();
244 glMapBuffer (GLenum target, GLenum access)
248 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
250 GLWRAP_DEFER_WITH_RETURN (ret, glMapBuffer, target, access);
252 RESTORE_METRICS_OP ();
258 glMapBufferARB (GLenum target, GLenum access)
262 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
264 GLWRAP_DEFER_WITH_RETURN (ret, glMapBufferARB, target, access);
266 RESTORE_METRICS_OP ();
272 glMapBufferRange (GLenum target, GLintptr offset, GLsizeiptr length,
277 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
279 GLWRAP_DEFER_WITH_RETURN (ret, glMapBufferRange, target, offset,
282 RESTORE_METRICS_OP ();
288 glUnmapBuffer (GLenum target)
292 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
294 GLWRAP_DEFER_WITH_RETURN (ret, glUnmapBuffer, target);
296 RESTORE_METRICS_OP ();
302 glUnmapNamedBufferEXT (GLuint buffer)
306 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
308 GLWRAP_DEFER_WITH_RETURN (ret, glUnmapNamedBufferEXT, buffer);
310 RESTORE_METRICS_OP ();
316 glUnmapBufferARB (GLenum target)
320 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
322 GLWRAP_DEFER_WITH_RETURN (ret, glUnmapBufferARB, target);
324 RESTORE_METRICS_OP ();
330 glFlushMappedBufferRange (GLenum target, GLintptr offset, GLsizeiptr length)
332 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
334 GLWRAP_DEFER (glFlushMappedBufferRange, target, offset, length);
336 RESTORE_METRICS_OP ();
340 glFlushMappedBufferRangeAPPLE (GLenum target, GLintptr offset, GLsizeiptr size)
342 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
344 GLWRAP_DEFER (glFlushMappedBufferRangeAPPLE, target, offset, size);
346 RESTORE_METRICS_OP ();
350 glFlushMappedNamedBufferRangeEXT (GLuint buffer, GLintptr offset,
353 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
355 GLWRAP_DEFER (glFlushMappedNamedBufferRangeEXT, buffer, offset, length);
357 RESTORE_METRICS_OP ();
361 glMapNamedBufferEXT (GLuint buffer, GLenum access)
365 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
367 GLWRAP_DEFER_WITH_RETURN (ret, glMapNamedBufferEXT, buffer, access);
369 RESTORE_METRICS_OP ();
375 glMapNamedBufferRangeEXT (GLuint buffer, GLintptr offset, GLsizeiptr length,
380 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_DATA);
382 GLWRAP_DEFER_WITH_RETURN (ret, glMapNamedBufferRangeEXT, buffer,
383 offset, length, access);
385 RESTORE_METRICS_OP ();
390 /* METRICS_OP_BUFFER_SUB_DATA */
392 glCopyBufferSubData (GLenum readTarget, GLenum writeTarget,
393 GLintptr readOffset, GLintptr writeOffset,
396 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_SUB_DATA);
398 GLWRAP_DEFER (glCopyBufferSubData, readTarget, writeTarget,
399 readOffset, writeOffset, size);
401 RESTORE_METRICS_OP ();
405 glNamedCopyBufferSubDataEXT (GLuint readBuffer, GLuint writeBuffer,
406 GLintptr readOffset, GLintptr writeOffset,
409 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BUFFER_SUB_DATA);
411 GLWRAP_DEFER (glNamedCopyBufferSubDataEXT, readBuffer,
412 writeBuffer, readOffset, writeOffset, size);
414 RESTORE_METRICS_OP ();
417 /* METRICS_OP_BITMAP */
419 glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
420 GLfloat xmove, GLfloat ymove, const GLubyte *bitmap)
422 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BITMAP);
424 GLWRAP_DEFER (glBitmap, width, height, xorig, yorig,
425 xmove, ymove, bitmap);
427 RESTORE_METRICS_OP ();
432 glBitmapxOES (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig,
433 GLfixed xmove, GLfixed ymove, const GLubyte *bitmap)
435 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BITMAP);
437 GLWRAP_DEFER (glBitmapxOES, width, height, xorig, yorig,
438 xmove, ymove, bitmap);
440 RESTORE_METRICS_OP ();
444 /* METRICS_OP_BLIT_FRAMEBUFFER */
446 glBlitFramebuffer (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
447 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
448 GLbitfield mask, GLenum filter)
450 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BLIT_FRAMEBUFFER);
452 GLWRAP_DEFER (glBlitFramebuffer, srcX0, srcY0, srcX1, srcY1,
453 dstX0, dstY0, dstX1, dstY1, mask, filter);
455 RESTORE_METRICS_OP ();
459 glBlitFramebufferEXT (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
460 GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
461 GLbitfield mask, GLenum filter)
463 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_BLIT_FRAMEBUFFER);
465 GLWRAP_DEFER (glBlitFramebufferEXT, srcX0, srcY0, srcX1, srcY1,
466 dstX0, dstY0, dstX1, dstY1, mask, filter);
468 RESTORE_METRICS_OP ();
471 /* METRICS_OP_CLEAR */
473 glClear (GLbitfield mask)
475 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_CLEAR);
477 GLWRAP_DEFER (glClear, mask);
479 RESTORE_METRICS_OP ();
483 glClearBufferfi (GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
485 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_CLEAR);
487 GLWRAP_DEFER (glClearBufferfi, buffer, drawbuffer, depth, stencil);
489 RESTORE_METRICS_OP ();
493 glClearBufferfv (GLenum buffer, GLint drawbuffer, const GLfloat *value)
495 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_CLEAR);
497 GLWRAP_DEFER (glClearBufferfv, buffer, drawbuffer, value);
499 RESTORE_METRICS_OP ();
503 glClearBufferiv (GLenum buffer, GLint drawbuffer, const GLint *value)
505 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_CLEAR);
507 GLWRAP_DEFER (glClearBufferiv, buffer, drawbuffer, value);
509 RESTORE_METRICS_OP ();
513 glClearBufferuiv (GLenum buffer, GLint drawbuffer, const GLuint *value)
515 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_CLEAR);
517 GLWRAP_DEFER (glClearBufferuiv, buffer, drawbuffer, value);
519 RESTORE_METRICS_OP ();
522 /* METRICS_OP_CLEAR_BUFFER_DATA */
525 glClearBufferData (GLenum target, GLenum internalformat, GLenum format,
526 GLenum type, const void *data)
528 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_CLEAR_BUFFER_DATA);
530 GLWRAP_DEFER (glClearBufferData, target, internalformat, format,
533 RESTORE_METRICS_OP ();
537 glClearBufferSubData (GLenum target, GLenum internalformat, GLintptr offset,
538 GLsizeiptr size, GLenum format, GLenum type,
541 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_CLEAR_BUFFER_DATA);
543 GLWRAP_DEFER (glClearBufferSubData, target, internalformat,
544 offset, size, format, type, data);
546 RESTORE_METRICS_OP ();
550 glClearNamedBufferDataEXT (GLuint buffer, GLenum internalformat, GLenum format,
551 GLenum type, const void *data)
553 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_CLEAR_BUFFER_DATA);
555 GLWRAP_DEFER (glClearNamedBufferDataEXT, buffer, internalformat,
558 RESTORE_METRICS_OP ();
561 #if GL_GLEXT_VERSION < 20131212
563 glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat,
564 GLenum format, GLenum type, GLsizeiptr offset,
565 GLsizeiptr size, const void *data)
567 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_CLEAR_BUFFER_DATA);
569 GLWRAP_DEFER (glClearNamedBufferSubDataEXT, buffer,
570 internalformat, format, type, offset, size, data);
572 RESTORE_METRICS_OP ();
576 glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat,
577 GLsizeiptr offset, GLsizeiptr size,
578 GLenum format, GLenum type,
581 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_CLEAR_BUFFER_DATA);
583 GLWRAP_DEFER (glClearNamedBufferSubDataEXT, buffer, internalformat,
584 offset, size, format, type, data);
586 RESTORE_METRICS_OP ();
590 /* METRICS_OP_CLEAR_TEX_IMAGE */
593 /* METRICS_OP_COPY_PIXELS */
595 glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type )
597 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_PIXELS);
599 GLWRAP_DEFER (glCopyPixels, x, y, width, height, type);
601 RESTORE_METRICS_OP ();
604 /* METRICS_OP_COPY_TEX_IMAGE */
606 glCopyTexImage1D (GLenum target, GLint level, GLenum internalformat,
607 GLint x, GLint y, GLsizei width, GLint border)
609 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
611 GLWRAP_DEFER (glCopyTexImage1D, target, level, internalformat,
612 x, y, width, border);
614 RESTORE_METRICS_OP ();
618 glCopyTexImage1DEXT (GLenum target, GLint level, GLenum internalformat,
619 GLint x, GLint y, GLsizei width, GLint border)
621 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
623 GLWRAP_DEFER (glCopyTexImage1DEXT, target, level, internalformat,
624 x, y, width, border);
626 RESTORE_METRICS_OP ();
630 glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat,
631 GLint x, GLint y, GLsizei width, GLsizei height,
634 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
636 GLWRAP_DEFER (glCopyTexImage2D, target, level, internalformat,
637 x, y, width, height, border);
639 RESTORE_METRICS_OP ();
643 glCopyTexImage2DEXT (GLenum target, GLint level, GLenum internalformat,
644 GLint x, GLint y, GLsizei width, GLsizei height,
647 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
649 GLWRAP_DEFER (glCopyTexImage2DEXT, target, level, internalformat,
650 x, y, width, height, border);
652 RESTORE_METRICS_OP ();
656 glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset,
657 GLint x, GLint y, GLsizei width)
659 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
661 GLWRAP_DEFER (glCopyTexSubImage1D, target, level, xoffset,
664 RESTORE_METRICS_OP ();
668 glCopyTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset,
669 GLint x, GLint y, GLsizei width)
671 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
673 GLWRAP_DEFER (glCopyTexSubImage1DEXT, target, level, xoffset,
676 RESTORE_METRICS_OP ();
680 glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset,
681 GLint yoffset, GLint x, GLint y, GLsizei width,
684 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
686 GLWRAP_DEFER (glCopyTexSubImage2D, target, level, xoffset, yoffset,
687 x, y, width, height);
689 RESTORE_METRICS_OP ();
693 glCopyTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset,
694 GLint yoffset, GLint x, GLint y, GLsizei width,
697 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
699 GLWRAP_DEFER (glCopyTexSubImage2DEXT, target, level, xoffset, yoffset,
700 x, y, width, height);
702 RESTORE_METRICS_OP ();
706 glCopyTexSubImage3D (GLenum target, GLint level, GLint xoffset,
707 GLint yoffset, GLint zoffset, GLint x, GLint y,
708 GLsizei width, GLsizei height)
710 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
712 GLWRAP_DEFER (glCopyTexSubImage3D, target, level, xoffset, yoffset,
713 zoffset, x, y, width, height);
715 RESTORE_METRICS_OP ();
719 glCopyTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset,
720 GLint yoffset, GLint zoffset, GLint x, GLint y,
721 GLsizei width, GLsizei height)
723 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
725 GLWRAP_DEFER (glCopyTexSubImage3DEXT, target, level, xoffset, yoffset,
726 zoffset, x, y, width, height);
728 RESTORE_METRICS_OP ();
732 glCopyTextureImage1DEXT (GLuint texture, GLenum target, GLint level,
733 GLenum internalformat, GLint x, GLint y,
734 GLsizei width, GLint border)
736 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
738 GLWRAP_DEFER (glCopyTextureImage1DEXT, texture, target, level,
739 internalformat, x, y, width, border);
741 RESTORE_METRICS_OP ();
745 glCopyTextureImage2DEXT (GLuint texture, GLenum target, GLint level,
746 GLenum internalformat, GLint x, GLint y, GLsizei width,
747 GLsizei height, GLint border)
749 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
751 GLWRAP_DEFER (glCopyTextureImage2DEXT, texture, target,
752 level, internalformat, x, y, width, height, border);
754 RESTORE_METRICS_OP ();
758 glCopyTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level,
759 GLint xoffset, GLint x, GLint y, GLsizei width)
761 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
763 GLWRAP_DEFER (glCopyTextureSubImage1DEXT, texture, target, level,
764 xoffset, x, y, width);
766 RESTORE_METRICS_OP ();
770 glCopyTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level,
771 GLint xoffset, GLint yoffset, GLint x, GLint y,
772 GLsizei width, GLsizei height)
774 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
776 GLWRAP_DEFER (glCopyTextureSubImage2DEXT, texture, target, level,
777 xoffset, yoffset, x, y, width, height);
779 RESTORE_METRICS_OP ();
783 glCopyTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level,
784 GLint xoffset, GLint yoffset, GLint zoffset,
785 GLint x, GLint y, GLsizei width, GLsizei height)
787 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
789 GLWRAP_DEFER (glCopyTextureSubImage3DEXT, texture, target, level,
790 xoffset, yoffset, zoffset, x, y, width, height);
792 RESTORE_METRICS_OP ();
796 glCopyMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level,
797 GLenum internalformat, GLint x, GLint y,
798 GLsizei width, GLint border)
800 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
802 GLWRAP_DEFER (glCopyMultiTexImage1DEXT, texunit, target, level,
803 internalformat, x, y, width, border);
805 RESTORE_METRICS_OP ();
809 glCopyMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level,
810 GLenum internalformat, GLint x, GLint y,
811 GLsizei width, GLsizei height, GLint border)
813 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
815 GLWRAP_DEFER (glCopyMultiTexImage2DEXT, texunit, target, level,
816 internalformat, x, y, width, height, border);
818 RESTORE_METRICS_OP ();
822 glCopyMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level,
823 GLint xoffset, GLint x, GLint y, GLsizei width)
825 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
827 GLWRAP_DEFER (glCopyMultiTexSubImage1DEXT, texunit, target, level,
828 xoffset, x, y, width);
830 RESTORE_METRICS_OP ();
834 glCopyMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level,
835 GLint xoffset, GLint yoffset, GLint x, GLint y,
836 GLsizei width, GLsizei height)
838 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
840 GLWRAP_DEFER (glCopyMultiTexSubImage2DEXT, texunit, target, level,
841 xoffset, yoffset, x, y, width, height);
843 RESTORE_METRICS_OP ();
847 glCopyMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level,
848 GLint xoffset, GLint yoffset, GLint zoffset,
849 GLint x, GLint y, GLsizei width, GLsizei height)
851 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_COPY_TEX_IMAGE);
853 GLWRAP_DEFER (glCopyMultiTexSubImage3DEXT, texunit, target, level,
854 xoffset, yoffset, zoffset, x, y, width, height);
856 RESTORE_METRICS_OP ();
859 /* METRICS_OP_DRAW_PIXELS */
861 glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type,
862 const GLvoid *pixels)
864 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_DRAW_PIXELS);
866 GLWRAP_DEFER (glDrawPixels, width, height, format, type, pixels);
868 RESTORE_METRICS_OP ();
871 /* METRICS_OP_GET_TEX_IMAGE */
874 glGetCompressedMultiTexImageEXT (GLenum texunit, GLenum target,
875 GLint lod, GLvoid *img)
877 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_GET_TEX_IMAGE);
879 GLWRAP_DEFER (glGetCompressedMultiTexImageEXT, texunit,
882 RESTORE_METRICS_OP ();
886 glGetCompressedTexImage (GLenum target, GLint level, GLvoid *img)
888 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_GET_TEX_IMAGE);
890 GLWRAP_DEFER (glGetCompressedTexImage, target, level, img);
892 RESTORE_METRICS_OP ();
896 glGetCompressedTexImageARB (GLenum target, GLint level, GLvoid *img)
898 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_GET_TEX_IMAGE);
900 GLWRAP_DEFER (glGetCompressedTexImageARB, target, level, img);
902 RESTORE_METRICS_OP ();
906 glGetCompressedTextureImageEXT (GLuint texture, GLenum target,
907 GLint lod, GLvoid *img)
909 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_GET_TEX_IMAGE);
911 GLWRAP_DEFER (glGetCompressedTextureImageEXT, texture,
914 RESTORE_METRICS_OP ();
918 glGetMultiTexImageEXT (GLenum texunit, GLenum target, GLint level,
919 GLenum format, GLenum type, GLvoid *pixels)
921 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_GET_TEX_IMAGE);
923 GLWRAP_DEFER (glGetMultiTexImageEXT, texunit,
924 target, level, format, type, pixels);
926 RESTORE_METRICS_OP ();
930 glGetnCompressedTexImageARB (GLenum target, GLint lod,
931 GLsizei bufSize, GLvoid *img)
933 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_GET_TEX_IMAGE);
935 GLWRAP_DEFER (glGetnCompressedTexImageARB, target, lod, bufSize, img);
937 RESTORE_METRICS_OP ();
941 glGetnTexImageARB (GLenum target, GLint level, GLenum format,
942 GLenum type, GLsizei bufSize, GLvoid *img)
944 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_GET_TEX_IMAGE);
946 GLWRAP_DEFER (glGetnTexImageARB, target, level,
947 format, type, bufSize, img);
949 RESTORE_METRICS_OP ();
953 glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type,
956 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_GET_TEX_IMAGE);
958 GLWRAP_DEFER (glGetTexImage, target, level, format, type, pixels);
960 RESTORE_METRICS_OP ();
963 /* METRICS_OP_READ_PIXELS */
965 glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height,
966 GLenum format, GLenum type, GLvoid *pixels )
968 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_READ_PIXELS);
970 GLWRAP_DEFER (glReadPixels, x, y, width, height, format, type, pixels);
972 RESTORE_METRICS_OP ();
976 glReadnPixelsARB (GLint x, GLint y, GLsizei width, GLsizei height,
977 GLenum format, GLenum type, GLsizei bufSize, GLvoid *data)
979 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_READ_PIXELS);
981 GLWRAP_DEFER (glReadnPixelsARB, x, y, width, height,
982 format, type, bufSize, data);
984 RESTORE_METRICS_OP ();
987 /* METRICS_OP_TEX_IMAGE */
989 glTexImage1D (GLenum target, GLint level, GLint internalFormat,
990 GLsizei width, GLint border, GLenum format, GLenum type,
991 const GLvoid *pixels)
993 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
995 GLWRAP_DEFER (glTexImage1D, target, level, internalFormat, width,
996 border, format, type, pixels);
998 RESTORE_METRICS_OP ();
1002 glTexImage2D (GLenum target, GLint level, GLint internalFormat,
1003 GLsizei width, GLsizei height, GLint border, GLenum format,
1004 GLenum type, const GLvoid *pixels )
1006 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1008 GLWRAP_DEFER (glTexImage2D, target, level, internalFormat,
1009 width, height, border, format, type, pixels);
1011 RESTORE_METRICS_OP ();
1016 glTexImage2DMultisample (GLenum target, GLsizei samples,
1017 GLint_or_enum internalformat,
1018 GLsizei width, GLsizei height,
1019 GLboolean fixedsamplelocations)
1021 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1023 GLWRAP_DEFER (glTexImage2DMultisample, target, samples,
1024 internalformat, width, height, fixedsamplelocations);
1026 RESTORE_METRICS_OP ();
1030 glTexImage2DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples,
1031 GLsizei colorSamples, GLint internalFormat,
1032 GLsizei width, GLsizei height,
1033 GLboolean fixedSampleLocations)
1035 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1037 GLWRAP_DEFER (glTexImage2DMultisampleCoverageNV, target,
1038 coverageSamples, colorSamples, internalFormat,
1039 width, height, fixedSampleLocations);
1041 RESTORE_METRICS_OP ();
1045 glTexImage3D (GLenum target, GLint level, GLint internalformat,
1046 GLsizei width, GLsizei height, GLsizei depth, GLint border,
1047 GLenum format, GLenum type, const GLvoid *pixels)
1049 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1051 GLWRAP_DEFER (glTexImage3D, target, level, internalformat,
1052 width, height, depth, border, format, type, pixels);
1054 RESTORE_METRICS_OP ();
1058 glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat,
1059 GLsizei width, GLsizei height, GLsizei depth, GLint border,
1060 GLenum format, GLenum type, const GLvoid *pixels)
1062 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1064 GLWRAP_DEFER (glTexImage3DEXT, target, level, internalformat,
1065 width, height, depth, border, format, type, pixels);
1067 RESTORE_METRICS_OP ();
1071 glTexImage3DMultisample (GLenum target, GLsizei samples,
1072 GLint_or_enum internalformat,
1073 GLsizei width, GLsizei height, GLsizei depth,
1074 GLboolean fixedsamplelocations)
1076 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1078 GLWRAP_DEFER (glTexImage3DMultisample, target, samples,
1079 internalformat, width, height, depth,
1080 fixedsamplelocations);
1082 RESTORE_METRICS_OP ();
1086 glTexImage3DMultisampleCoverageNV (GLenum target, GLsizei coverageSamples,
1087 GLsizei colorSamples, GLint internalFormat,
1088 GLsizei width, GLsizei height, GLsizei depth,
1089 GLboolean fixedSampleLocations)
1091 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1093 GLWRAP_DEFER (glTexImage3DMultisampleCoverageNV, target,
1094 coverageSamples, colorSamples, internalFormat,
1095 width, height, depth, fixedSampleLocations);
1097 RESTORE_METRICS_OP ();
1101 glTexImage4DSGIS (GLenum target, GLint level, GLenum internalformat,
1102 GLsizei width, GLsizei height, GLsizei depth,
1103 GLsizei size4d, GLint border, GLenum format,
1104 GLenum type, const GLvoid *pixels)
1106 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1108 GLWRAP_DEFER (glTexImage4DSGIS, target, level,
1109 internalformat, width, height, depth,
1110 size4d, border, format, type, pixels);
1112 RESTORE_METRICS_OP ();
1116 glTexSubImage1D (GLenum target, GLint level, GLint xoffset,
1117 GLsizei width, GLenum format, GLenum type,
1118 const GLvoid *pixels)
1120 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1122 GLWRAP_DEFER (glTexSubImage1D, target, level, xoffset,
1123 width, format, type, pixels);
1125 RESTORE_METRICS_OP ();
1129 glTexSubImage1DEXT (GLenum target, GLint level, GLint xoffset,
1130 GLsizei width, GLenum format, GLenum type,
1131 const GLvoid *pixels)
1133 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1135 GLWRAP_DEFER (glTexSubImage1DEXT, target, level, xoffset,
1136 width, format, type, pixels);
1138 RESTORE_METRICS_OP ();
1142 glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset,
1143 GLsizei width, GLsizei height, GLenum format, GLenum type,
1144 const GLvoid *pixels)
1146 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1148 GLWRAP_DEFER (glTexSubImage2D, target, level, xoffset, yoffset,
1149 width, height, format, type, pixels);
1151 RESTORE_METRICS_OP ();
1155 glTexSubImage2DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset,
1156 GLsizei width, GLsizei height, GLenum format, GLenum type,
1157 const GLvoid *pixels)
1159 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1161 GLWRAP_DEFER (glTexSubImage2DEXT, target, level, xoffset, yoffset,
1162 width, height, format, type, pixels);
1164 RESTORE_METRICS_OP ();
1168 glTexSubImage3D (GLenum target, GLint level, GLint xoffset, GLint yoffset,
1169 GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
1170 GLenum format, GLenum type, const GLvoid *pixels)
1172 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1174 GLWRAP_DEFER (glTexSubImage3D, target, level, xoffset, yoffset,
1175 zoffset, width, height, depth, format, type, pixels);
1177 RESTORE_METRICS_OP ();
1181 glTexSubImage3DEXT (GLenum target, GLint level, GLint xoffset, GLint yoffset,
1182 GLint zoffset, GLsizei width, GLsizei height, GLsizei depth,
1183 GLenum format, GLenum type, const GLvoid *pixels)
1185 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1187 GLWRAP_DEFER (glTexSubImage3DEXT, target, level, xoffset, yoffset,
1188 zoffset, width, height, depth, format, type, pixels);
1190 RESTORE_METRICS_OP ();
1194 glTexSubImage4DSGIS (GLenum target, GLint level, GLint xoffset, GLint yoffset,
1195 GLint zoffset, GLint woffset, GLsizei width,
1196 GLsizei height, GLsizei depth, GLsizei size4d,
1197 GLenum format, GLenum type, const GLvoid *pixels)
1199 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1201 GLWRAP_DEFER (glTexSubImage4DSGIS, target, level, xoffset,
1202 yoffset, zoffset, woffset, width, height,
1203 depth, size4d, format, type, pixels);
1205 RESTORE_METRICS_OP ();
1209 glCompressedMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level,
1210 GLenum internalformat, GLsizei width,
1211 GLint border, GLsizei imageSize,
1214 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1216 GLWRAP_DEFER (glCompressedMultiTexImage1DEXT, texunit, target,
1217 level, internalformat, width, border, imageSize, bits);
1219 RESTORE_METRICS_OP ();
1223 glCompressedMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level,
1224 GLenum internalformat, GLsizei width,
1225 GLsizei height, GLint border,
1226 GLsizei imageSize, const GLvoid *bits)
1228 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1230 GLWRAP_DEFER (glCompressedMultiTexImage2DEXT, texunit, target, level,
1231 internalformat, width, height, border, imageSize, bits);
1233 RESTORE_METRICS_OP ();
1237 glCompressedMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level,
1238 GLenum internalformat, GLsizei width,
1239 GLsizei height, GLsizei depth, GLint border,
1240 GLsizei imageSize, const GLvoid *bits)
1242 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1244 GLWRAP_DEFER (glCompressedMultiTexImage3DEXT, texunit, target,
1245 level, internalformat, width, height, depth,
1246 border, imageSize, bits);
1248 RESTORE_METRICS_OP ();
1252 glCompressedMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level,
1253 GLint xoffset, GLsizei width, GLenum format,
1254 GLsizei imageSize, const GLvoid *bits)
1256 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1258 GLWRAP_DEFER (glCompressedMultiTexSubImage1DEXT, texunit, target,
1259 level, xoffset, width, format, imageSize, bits);
1261 RESTORE_METRICS_OP ();
1265 glCompressedMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level,
1266 GLint xoffset, GLint yoffset, GLsizei width,
1267 GLsizei height, GLenum format,
1268 GLsizei imageSize, const GLvoid *bits)
1270 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1272 GLWRAP_DEFER (glCompressedMultiTexSubImage2DEXT, texunit, target, level,
1273 xoffset, yoffset, width, height, format, imageSize, bits);
1275 RESTORE_METRICS_OP ();
1279 glCompressedMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level,
1280 GLint xoffset, GLint yoffset, GLint zoffset,
1281 GLsizei width, GLsizei height, GLsizei depth,
1282 GLenum format, GLsizei imageSize,
1285 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1287 GLWRAP_DEFER (glCompressedMultiTexSubImage3DEXT, texunit, target,
1288 level, xoffset, yoffset, zoffset, width, height,
1289 depth, format, imageSize, bits);
1291 RESTORE_METRICS_OP ();
1295 glCompressedTexImage1D (GLenum target, GLint level, GLenum internalformat,
1296 GLsizei width, GLint border, GLsizei imageSize,
1299 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1301 GLWRAP_DEFER (glCompressedTexImage1D, target, level,
1302 internalformat, width, border, imageSize, data);
1304 RESTORE_METRICS_OP ();
1308 glCompressedTexImage1DARB (GLenum target, GLint level, GLenum internalformat,
1309 GLsizei width, GLint border, GLsizei imageSize,
1312 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1314 GLWRAP_DEFER (glCompressedTexImage1DARB, target, level, internalformat,
1315 width, border, imageSize, data);
1317 RESTORE_METRICS_OP ();
1321 glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat,
1322 GLsizei width, GLsizei height, GLint border,
1323 GLsizei imageSize, const GLvoid *data)
1325 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1327 GLWRAP_DEFER (glCompressedTexImage2D, target, level, internalformat,
1328 width, height, border, imageSize, data);
1330 RESTORE_METRICS_OP ();
1334 glCompressedTexImage2DARB (GLenum target, GLint level, GLenum internalformat,
1335 GLsizei width, GLsizei height, GLint border,
1336 GLsizei imageSize, const GLvoid *data)
1338 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1340 GLWRAP_DEFER (glCompressedTexImage2DARB, target, level, internalformat,
1341 width, height, border, imageSize, data);
1343 RESTORE_METRICS_OP ();
1347 glCompressedTexImage3D (GLenum target, GLint level, GLenum internalformat,
1348 GLsizei width, GLsizei height, GLsizei depth,
1349 GLint border, GLsizei imageSize, const GLvoid *data)
1351 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1353 GLWRAP_DEFER (glCompressedTexImage3D, target, level, internalformat,
1354 width, height, depth, border, imageSize, data);
1356 RESTORE_METRICS_OP ();
1360 glCompressedTexImage3DARB (GLenum target, GLint level, GLenum internalformat,
1361 GLsizei width, GLsizei height, GLsizei depth,
1362 GLint border, GLsizei imageSize, const GLvoid *data)
1364 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1366 GLWRAP_DEFER (glCompressedTexImage3DARB, target, level, internalformat,
1367 width, height, depth, border, imageSize, data);
1369 RESTORE_METRICS_OP ();
1373 glCompressedTexSubImage1D (GLenum target, GLint level, GLint xoffset,
1374 GLsizei width, GLenum format, GLsizei imageSize,
1377 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1379 GLWRAP_DEFER (glCompressedTexSubImage1D, target, level, xoffset,
1380 width, format, imageSize, data);
1382 RESTORE_METRICS_OP ();
1386 glCompressedTexSubImage1DARB (GLenum target, GLint level, GLint xoffset,
1387 GLsizei width, GLenum format, GLsizei imageSize,
1390 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1392 GLWRAP_DEFER (glCompressedTexSubImage1DARB, target, level, xoffset,
1393 width, format, imageSize, data);
1395 RESTORE_METRICS_OP ();
1399 glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset,
1400 GLint yoffset, GLsizei width, GLsizei height,
1401 GLenum format, GLsizei imageSize, const GLvoid *data)
1403 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1405 GLWRAP_DEFER (glCompressedTexSubImage2D, target, level, xoffset,
1406 yoffset, width, height, format, imageSize, data);
1408 RESTORE_METRICS_OP ();
1412 glCompressedTexSubImage2DARB (GLenum target, GLint level, GLint xoffset,
1413 GLint yoffset, GLsizei width, GLsizei height,
1414 GLenum format, GLsizei imageSize,
1417 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1419 GLWRAP_DEFER (glCompressedTexSubImage2DARB, target, level, xoffset,
1420 yoffset, width, height, format, imageSize, data);
1422 RESTORE_METRICS_OP ();
1426 glCompressedTexSubImage3D (GLenum target, GLint level, GLint xoffset,
1427 GLint yoffset, GLint zoffset, GLsizei width,
1428 GLsizei height, GLsizei depth, GLenum format,
1429 GLsizei imageSize, const GLvoid *data)
1431 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1433 GLWRAP_DEFER (glCompressedTexSubImage3D, target, level, xoffset,
1434 yoffset, zoffset, width, height, depth, format,
1437 RESTORE_METRICS_OP ();
1441 glCompressedTexSubImage3DARB (GLenum target, GLint level, GLint xoffset,
1442 GLint yoffset, GLint zoffset, GLsizei width,
1443 GLsizei height, GLsizei depth, GLenum format,
1444 GLsizei imageSize, const GLvoid *data)
1446 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1448 GLWRAP_DEFER (glCompressedTexSubImage3DARB, target, level, xoffset,
1449 yoffset, zoffset, width, height, depth, format,
1452 RESTORE_METRICS_OP ();
1456 glCompressedTextureImage1DEXT (GLuint texture, GLenum target, GLint level,
1457 GLenum internalformat, GLsizei width,
1458 GLint border, GLsizei imageSize,
1461 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1463 GLWRAP_DEFER (glCompressedTextureImage1DEXT, texture, target, level,
1464 internalformat, width, border, imageSize, bits);
1466 RESTORE_METRICS_OP ();
1470 glCompressedTextureImage2DEXT (GLuint texture, GLenum target, GLint level,
1471 GLenum internalformat, GLsizei width,
1472 GLsizei height, GLint border,
1473 GLsizei imageSize, const GLvoid *bits)
1475 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1477 GLWRAP_DEFER (glCompressedTextureImage2DEXT, texture, target, level,
1478 internalformat, width, height, border, imageSize, bits);
1480 RESTORE_METRICS_OP ();
1484 glCompressedTextureImage3DEXT (GLuint texture, GLenum target, GLint level,
1485 GLenum internalformat, GLsizei width,
1486 GLsizei height, GLsizei depth, GLint border,
1487 GLsizei imageSize, const GLvoid *bits)
1489 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1491 GLWRAP_DEFER (glCompressedTextureImage3DEXT, texture, target,
1492 level, internalformat, width, height, depth,
1493 border, imageSize, bits);
1495 RESTORE_METRICS_OP ();
1499 glCompressedTextureSubImage1DEXT (GLuint texture, GLenum target, GLint level,
1500 GLint xoffset, GLsizei width, GLenum format,
1501 GLsizei imageSize, const GLvoid *bits)
1503 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1505 GLWRAP_DEFER (glCompressedTextureSubImage1DEXT, texture, target,
1506 level, xoffset, width, format, imageSize, bits);
1508 RESTORE_METRICS_OP ();
1512 glCompressedTextureSubImage2DEXT (GLuint texture, GLenum target, GLint level,
1513 GLint xoffset, GLint yoffset, GLsizei width,
1514 GLsizei height, GLenum format,
1515 GLsizei imageSize, const GLvoid *bits)
1517 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1519 GLWRAP_DEFER (glCompressedTextureSubImage2DEXT, texture, target, level,
1520 xoffset, yoffset, width, height, format, imageSize, bits);
1522 RESTORE_METRICS_OP ();
1526 glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level,
1527 GLint xoffset, GLint yoffset, GLint zoffset,
1528 GLsizei width, GLsizei height, GLsizei depth,
1529 GLenum format, GLsizei imageSize,
1532 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1534 GLWRAP_DEFER (glCompressedTextureSubImage3DEXT, texture, target,
1535 level, xoffset, yoffset, zoffset, width, height,
1536 depth, format, imageSize, bits);
1538 RESTORE_METRICS_OP ();
1542 glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level,
1543 GLenum_or_int internalformat,
1544 GLsizei width, GLint border,
1545 GLenum format, GLenum type, const GLvoid *pixels)
1547 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1549 GLWRAP_DEFER (glMultiTexImage1DEXT, texunit, target, level,
1550 internalformat, width, border, format, type, pixels);
1552 RESTORE_METRICS_OP ();
1556 glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level,
1557 GLenum_or_int internalformat,
1558 GLsizei width, GLsizei height,
1559 GLint border, GLenum format, GLenum type,
1560 const GLvoid *pixels)
1562 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1564 GLWRAP_DEFER (glMultiTexImage2DEXT, texunit, target, level,
1565 internalformat, width, height, border, format,
1568 RESTORE_METRICS_OP ();
1572 glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level,
1573 GLenum_or_int internalformat,
1574 GLsizei width, GLsizei height,
1575 GLsizei depth, GLint border, GLenum format,
1576 GLenum type, const GLvoid *pixels)
1578 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1580 GLWRAP_DEFER (glMultiTexImage3DEXT, texunit, target, level,
1581 internalformat, width, height, depth, border,
1582 format, type, pixels);
1584 RESTORE_METRICS_OP ();
1588 glMultiTexSubImage1DEXT (GLenum texunit, GLenum target, GLint level,
1589 GLint xoffset, GLsizei width, GLenum format,
1590 GLenum type, const GLvoid *pixels)
1592 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1594 GLWRAP_DEFER (glMultiTexSubImage1DEXT, texunit, target, level,
1595 xoffset, width, format, type, pixels);
1597 RESTORE_METRICS_OP ();
1601 glMultiTexSubImage2DEXT (GLenum texunit, GLenum target, GLint level,
1602 GLint xoffset, GLint yoffset, GLsizei width,
1603 GLsizei height, GLenum format, GLenum type,
1604 const GLvoid *pixels)
1606 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1608 GLWRAP_DEFER (glMultiTexSubImage2DEXT, texunit, target, level, xoffset,
1609 yoffset, width, height, format, type, pixels);
1611 RESTORE_METRICS_OP ();
1615 glMultiTexSubImage3DEXT (GLenum texunit, GLenum target, GLint level,
1616 GLint xoffset, GLint yoffset, GLint zoffset,
1617 GLsizei width, GLsizei height, GLsizei depth,
1618 GLenum format, GLenum type, const GLvoid *pixels)
1620 SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
1622 GLWRAP_DEFER (glMultiTexSubImage3DEXT, texunit, target, level,
1623 xoffset, yoffset, zoffset, width, height, depth,
1624 format, type, pixels);
1626 RESTORE_METRICS_OP ();