[PATCH 4/8] wined3d: Add support for GL_ARB_timer_query.

Adam Martinson amartinson at codeweavers.com
Tue May 17 11:14:01 CDT 2011


---
 dlls/wined3d/directx.c    |    1 +
 dlls/wined3d/wined3d_gl.h |   19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 3d77c19..f720179 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -86,6 +86,7 @@ static const struct {
     {"GL_ARB_texture_non_power_of_two",     ARB_TEXTURE_NON_POWER_OF_TWO,   MAKEDWORD_VERSION(2, 0)     },
     {"GL_ARB_texture_rectangle",            ARB_TEXTURE_RECTANGLE,          0                           },
     {"GL_ARB_texture_rg",                   ARB_TEXTURE_RG,                 0                           },
+    {"GL_ARB_timer_query",                  ARB_TIMER_QUERY,                0                           },
     {"GL_ARB_vertex_array_bgra",            ARB_VERTEX_ARRAY_BGRA,          0                           },
     {"GL_ARB_vertex_blend",                 ARB_VERTEX_BLEND,               0                           },
     {"GL_ARB_vertex_buffer_object",         ARB_VERTEX_BUFFER_OBJECT,       0                           },
diff --git a/dlls/wined3d/wined3d_gl.h b/dlls/wined3d/wined3d_gl.h
index be50b2f..3248bdb 100644
--- a/dlls/wined3d/wined3d_gl.h
+++ b/dlls/wined3d/wined3d_gl.h
@@ -1769,6 +1769,7 @@ typedef enum wined3d_gl_extension
     ARB_TEXTURE_NON_POWER_OF_TWO,
     ARB_TEXTURE_RECTANGLE,
     ARB_TEXTURE_RG,
+    ARB_TIMER_QUERY,
     ARB_VERTEX_ARRAY_BGRA,
     ARB_VERTEX_BLEND,
     ARB_VERTEX_BUFFER_OBJECT,
@@ -2458,6 +2459,17 @@ typedef GLvoid (WINE_GLAPI *PGLFNGETSYNCIVPROC)(GLsync sync, GLenum pname, GLsiz
 #define GL_RG32UI                                           0x823c
 #endif
 
+/* GL_ARB_timer_query */
+#ifndef GL_ARB_timer_query
+#define GL_ARB_timer_query 1
+#define GL_TIME_ELAPSED_ARB                                 0x88bf
+#define GL_TIMESTAMP_ARB                                    0x8e28
+#endif
+
+typedef void (WINE_GLAPI *PGLFNGLQUERYCOUNTERPROC)(GLuint id, GLenum target);
+typedef void (WINE_GLAPI *PGLFNGLGETQUERYOBJECTI64VPROC)(GLuint id, GLenum pname, GLint64 *params);
+typedef void (WINE_GLAPI *PGLFNGLGETQUERYOBJECTUI64VPROC)(GLuint id, GLenum pname, GLuint64 *params);
+
 /* GL_ARB_vertex_blend */
 #ifndef GL_ARB_vertex_blend
 #define GL_ARB_vertex_blend 1
@@ -4002,6 +4014,13 @@ typedef BOOL (WINAPI *WINED3D_PFNWGLSWAPINTERVALEXTPROC)(int interval);
             glCompressedTexSubImage3DARB,               ARB_TEXTURE_COMPRESSION,        NULL) \
     USE_GL_FUNC(PGLFNGETCOMPRESSEDTEXIMAGEPROC, \
             glGetCompressedTexImageARB,                 ARB_TEXTURE_COMPRESSION,        NULL) \
+    /* GL_ARB_timer_query */ \
+    USE_GL_FUNC(PGLFNGLQUERYCOUNTERPROC, \
+            glQueryCounter,                             ARB_TIMER_QUERY,                NULL) \
+    USE_GL_FUNC(PGLFNGLGETQUERYOBJECTI64VPROC, \
+            glGetQueryObjecti64v,                       ARB_TIMER_QUERY,                NULL) \
+    USE_GL_FUNC(PGLFNGLGETQUERYOBJECTUI64VPROC, \
+            glGetQueryObjectui64v,                      ARB_TIMER_QUERY,                NULL) \
     /* GL_ARB_vertex_blend */ \
     USE_GL_FUNC(PGLFNGLWEIGHTPOINTERARB, \
             glWeightPointerARB,                         ARB_VERTEX_BLEND,               NULL) \
-- 
1.7.1


--------------060507020707010706000101
Content-Type: text/x-patch;
 name="0005-d3d9-tests-Add-tests-for-D3DQUERY_TIMESTAMP-queries.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename*0="0005-d3d9-tests-Add-tests-for-D3DQUERY_TIMESTAMP-queries.pat";
 filename*1="ch"



More information about the wine-devel mailing list