]> git.cworth.org Git - fips/blobdiff - glwrap.c
Search for proper name of AMD_performance_monitor.
[fips] / glwrap.c
index aa560386feca11db8abbf18a3a5412f14be5fbe3..42eaa80e2766bc8261f85402564cbf2343734f48 100644 (file)
--- a/glwrap.c
+++ b/glwrap.c
 
 #include "glwrap.h"
 
-#include "metrics.h"
+#include "context.h"
+
+/* The first appearance of the GLfixed datatype in Mesa was with
+ * glext.h of version 20130624. So we'll assume that any older glext.h
+ * cannot have any function accepting a GLfixed parameter. */
+#if GL_GLEXT_VERSION >= 20130624
+#define HAVE_GLFIXED 1
+#endif
+
+/* As of glext.h version 20131008 some types changed.
+ *
+ * I have no idea why some internalFormats changed from GLenum to
+ * GLint while others changed from GLint to GLenum.
+ *
+ * But, in order to compile with either version, we track these.
+ */
+#if GL_GLEXT_VERSION >= 20131008
+#define GLint_or_enum GLenum
+#define GLenum_or_int GLint
+#else
+#define GLint_or_enum GLint
+#define GLenum_or_int GLenum
+#endif
 
 static void *gl_handle;
 
 /* Switch metrics operation persistently, (until next SWITCH) */
 #define SWITCH_METRICS_OP(op)                  \
-       metrics_counter_stop ();                \
-       metrics_set_current_op (op);            \
-       metrics_counter_start ();
+       context_counter_stop ();                \
+       context_set_current_op (op);            \
+       context_counter_start ();
 
 /* Switch metrics operation temporarily, see RESTORE_METRICS_OP */
 #define SAVE_THEN_SWITCH_METRICS_OP(op)                        \
-       metrics_op_t save = metrics_get_current_op ();  \
+       metrics_op_t save = context_get_current_op ();  \
        SWITCH_METRICS_OP (op);
 
 /* Switch back to metrics operation saved by SAVE_THEN_SWITCH_METRICS_OP */
-#define RESTORE_METRICS_OP(op)                         \
+#define RESTORE_METRICS_OP()                           \
        SWITCH_METRICS_OP (save);
 
 void
@@ -162,6 +184,7 @@ glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha)
        RESTORE_METRICS_OP ();
 }
 
+#if HAVE_GLFIXED
 void
 glClearAccumxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
 {
@@ -171,6 +194,7 @@ glClearAccumxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
 
        RESTORE_METRICS_OP ();
 }
+#endif
 
 /* METRICS_OP_BUFFER_DATA */
 void
@@ -403,6 +427,7 @@ glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig,
        RESTORE_METRICS_OP ();
 }
 
+#if HAVE_GLFIXED
 void
 glBitmapxOES (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig,
              GLfixed xmove, GLfixed ymove, const GLubyte *bitmap)
@@ -414,6 +439,7 @@ glBitmapxOES (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig,
 
        RESTORE_METRICS_OP ();
 }
+#endif
 
 /* METRICS_OP_BLIT_FRAMEBUFFER */
 void
@@ -972,7 +998,8 @@ glTexImage2D (GLenum target, GLint level, GLint internalFormat,
 
 void
 glTexImage2DMultisample (GLenum target, GLsizei samples,
-                        GLint internalformat, GLsizei width, GLsizei height,
+                        GLint_or_enum internalformat,
+                        GLsizei width, GLsizei height,
                         GLboolean fixedsamplelocations)
 {
        SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
@@ -1025,7 +1052,8 @@ glTexImage3DEXT (GLenum target, GLint level, GLenum internalformat,
 }
 
 void
-glTexImage3DMultisample (GLenum target, GLsizei samples, GLint internalformat,
+glTexImage3DMultisample (GLenum target, GLsizei samples,
+                        GLint_or_enum internalformat,
                         GLsizei width, GLsizei height, GLsizei depth,
                         GLboolean fixedsamplelocations)
 {
@@ -1496,7 +1524,8 @@ glCompressedTextureSubImage3DEXT (GLuint texture, GLenum target, GLint level,
 
 void
 glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level,
-                     GLenum internalformat, GLsizei width, GLint border,
+                     GLenum_or_int internalformat,
+                     GLsizei width, GLint border,
                      GLenum format, GLenum type, const GLvoid *pixels)
 {
        SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_TEX_IMAGE);
@@ -1509,7 +1538,8 @@ glMultiTexImage1DEXT (GLenum texunit, GLenum target, GLint level,
 
 void
 glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level,
-                     GLenum internalformat, GLsizei width, GLsizei height,
+                     GLenum_or_int internalformat,
+                     GLsizei width, GLsizei height,
                      GLint border, GLenum format, GLenum type,
                      const GLvoid *pixels)
 {
@@ -1524,7 +1554,8 @@ glMultiTexImage2DEXT (GLenum texunit, GLenum target, GLint level,
 
 void
 glMultiTexImage3DEXT (GLenum texunit, GLenum target, GLint level,
-                     GLenum internalformat, GLsizei width, GLsizei height,
+                     GLenum_or_int internalformat,
+                     GLsizei width, GLsizei height,
                      GLsizei depth, GLint border, GLenum format,
                      GLenum type, const GLvoid *pixels)
 {