From: Brian Paul Date: Thu, 17 Aug 2006 14:25:04 +0000 (+0000) Subject: added FEATURE_EXT_timer_query and tests X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9dc90cd5f35e1b286cc70f95f0dfe20ea356eeca;p=mesa.git added FEATURE_EXT_timer_query and tests --- diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index 6d4c41398c2..94014275fe6 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -293,6 +293,7 @@ #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 diff --git a/src/mesa/main/occlude.c b/src/mesa/main/occlude.c index 0227ebbc7f7..5fef4a800dc 100644 --- a/src/mesa/main/occlude.c +++ b/src/mesa/main/occlude.c @@ -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. diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 7009db2b332..6e620382af2 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -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);