added FEATURE_EXT_timer_query and tests
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 17 Aug 2006 14:25:04 +0000 (14:25 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 17 Aug 2006 14:25:04 +0000 (14:25 +0000)
src/mesa/main/config.h
src/mesa/main/occlude.c
src/mesa/main/state.c

index 6d4c41398c2935a76c4fcf3fd3db7d2eee2cd497..94014275fe6d75eefaa76b96835475b6c3214438 100644 (file)
 #define FEATURE_ARB_vertex_program  _HAVE_FULL_GL
 #define FEATURE_ARB_fragment_program  _HAVE_FULL_GL
 #define FEATURE_ARB_occlusion_query  _HAVE_FULL_GL
+#define FEATURE_EXT_timer_query  _HAVE_FULL_GL
 #define FEATURE_EXT_pixel_buffer_object  _HAVE_FULL_GL
 #define FEATURE_MESA_program_debug  _HAVE_FULL_GL
 #define FEATURE_NV_fence  _HAVE_FULL_GL
index 0227ebbc7f72b91be9fe6ec458a6a9940929ed22..5fef4a800dc6242b77919e12fb11201789f32899 100644 (file)
@@ -175,6 +175,7 @@ _mesa_BeginQueryARB(GLenum target, GLuint id)
             return;
          }
          break;
+#if FEATURE_EXT_timer_query
       case GL_TIME_ELAPSED_EXT:
          if (!ctx->Extensions.EXT_timer_query) {
             _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)");
@@ -185,6 +186,7 @@ _mesa_BeginQueryARB(GLenum target, GLuint id)
             return;
          }
          break;
+#endif
       default:
          _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)");
          return;
@@ -221,9 +223,11 @@ _mesa_BeginQueryARB(GLenum target, GLuint id)
    if (target == GL_SAMPLES_PASSED_ARB) {
       ctx->Query.CurrentOcclusionObject = q;
    }
+#if FEATURE_EXT_timer_query
    else if (target == GL_TIME_ELAPSED_EXT) {
       ctx->Query.CurrentTimerObject = q;
    }
+#endif
 
    if (ctx->Driver.BeginQuery) {
       ctx->Driver.BeginQuery(ctx, target, q);
@@ -249,6 +253,7 @@ _mesa_EndQueryARB(GLenum target)
          q = ctx->Query.CurrentOcclusionObject;
          ctx->Query.CurrentOcclusionObject = NULL;
          break;
+#if FEATURE_EXT_timer_query
       case GL_TIME_ELAPSED_EXT:
          if (!ctx->Extensions.EXT_timer_query) {
             _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)");
@@ -257,6 +262,7 @@ _mesa_EndQueryARB(GLenum target)
          q = ctx->Query.CurrentTimerObject;
          ctx->Query.CurrentTimerObject = NULL;
          break;
+#endif
       default:
          _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)");
          return;
@@ -294,6 +300,7 @@ _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params)
          }
          q = ctx->Query.CurrentOcclusionObject;
          break;
+#if FEATURE_EXT_timer_query
       case GL_TIME_ELAPSED_EXT:
          if (!ctx->Extensions.EXT_timer_query) {
             _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)");
@@ -301,6 +308,7 @@ _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params)
          }
          q = ctx->Query.CurrentTimerObject;
          break;
+#endif
       default:
          _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivARB(target)");
          return;
@@ -408,6 +416,8 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params)
 }
 
 
+#if FEATURE_EXT_timer_query
+
 /**
  * New with GL_EXT_timer_query
  */
@@ -489,6 +499,8 @@ _mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params)
    }
 }
 
+#endif /* FEATURE_EXT_timer_query */
+
 
 /**
  * Allocate/init the context state related to query objects.
index 7009db2b332a9b653360722bbd9ca182c56c8170..6e620382af2d2801ccc5208702708e830931404c 100644 (file)
@@ -70,7 +70,7 @@
 #include "lines.h"
 #include "macros.h"
 #include "matrix.h"
-#if FEATURE_ARB_occlusion_query
+#if FEATURE_ARB_occlusion_query || FEATURE_EXT_timer_query
 #include "occlude.h"
 #endif
 #include "pixel.h"
@@ -790,15 +790,16 @@ _mesa_init_exec_table(struct _glapi_table *exec)
    SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT);
 #endif
 
-   /* GL_EXT_timer_query */
+#if FEATURE_EXT_timer_query
    SET_GetQueryObjecti64vEXT(exec, _mesa_GetQueryObjecti64vEXT);
    SET_GetQueryObjectui64vEXT(exec, _mesa_GetQueryObjectui64vEXT);
+#endif
 
 #if FEATURE_EXT_framebuffer_blit
    SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT);
 #endif
 
-   /* GL_EXT_gpu_program_parmaeters */
+   /* GL_EXT_gpu_program_parameters */
 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
    SET_ProgramEnvParameters4fvEXT(exec, _mesa_ProgramEnvParameters4fvEXT);
    SET_ProgramLocalParameters4fvEXT(exec, _mesa_ProgramLocalParameters4fvEXT);