#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.
*
/* 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
RESTORE_METRICS_OP ();
}
+#if HAVE_GLFIXED
void
glClearAccumxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)
{
RESTORE_METRICS_OP ();
}
+#endif
/* METRICS_OP_BUFFER_DATA */
void
RESTORE_METRICS_OP ();
}
+#if HAVE_GLFIXED
void
glBitmapxOES (GLsizei width, GLsizei height, GLfixed xorig, GLfixed yorig,
GLfixed xmove, GLfixed ymove, const GLubyte *bitmap)
RESTORE_METRICS_OP ();
}
+#endif
/* METRICS_OP_BLIT_FRAMEBUFFER */
void
RESTORE_METRICS_OP ();
}
+#if GL_GLEXT_VERSION < 20131212
void
glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat,
GLenum format, GLenum type, GLsizeiptr offset,
RESTORE_METRICS_OP ();
}
+#else
+void
+glClearNamedBufferSubDataEXT (GLuint buffer, GLenum internalformat,
+ GLsizeiptr offset, GLsizeiptr size,
+ GLenum format, GLenum type,
+ const void *data)
+{
+ SAVE_THEN_SWITCH_METRICS_OP (METRICS_OP_CLEAR_BUFFER_DATA);
+
+ GLWRAP_DEFER (glClearNamedBufferSubDataEXT, buffer, internalformat,
+ offset, size, format, type, data);
+
+ RESTORE_METRICS_OP ();
+}
+#endif
/* METRICS_OP_CLEAR_TEX_IMAGE */