summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_extensions.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2012-12-09 10:08:13 +0000
committerJosé Fonseca <[email protected]>2012-12-20 16:33:49 +0000
commit3160b0b9fc2b49b0e9fe684b955eebf3691024ff (patch)
tree8125293ed921fa635998dbaefe99d639af7cb609 /src/mesa/state_tracker/st_extensions.c
parent9976216bf699be092e14b66ba3a3ecfa3859e87f (diff)
mesa/st: Implement GL_TIME_ELAPSED w/ PIPE_QUERY_TIMESTAMP.
ARB/EXT_timer_query's definition of GL_TIME_ELAPSED match precisely the subtraction of two GL_TIMESTAMP queries. And for a lot of drivers, that's precisely how they have to implement internally -- by emitting two hardware timestamp queries. So, to simplify driver implementation, simply allow doing so in the state tracker. Eventually if no driver implements PIPE_QUERY_TIME_ELAPSED then we could retire it. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_extensions.c')
-rw-r--r--src/mesa/state_tracker/st_extensions.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c
index f7deb9c6083..e7cf4f3bb8c 100644
--- a/src/mesa/state_tracker/st_extensions.c
+++ b/src/mesa/state_tracker/st_extensions.c
@@ -371,6 +371,7 @@ void st_init_extensions(struct st_context *st)
{ o(ARB_shader_texture_lod), PIPE_CAP_SM3 },
{ o(ARB_shadow), PIPE_CAP_TEXTURE_SHADOW_MAP },
{ o(ARB_texture_non_power_of_two), PIPE_CAP_NPOT_TEXTURES },
+ { o(ARB_timer_query), PIPE_CAP_QUERY_TIMESTAMP },
{ o(ARB_transform_feedback2), PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME },
{ o(ARB_transform_feedback3), PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME },
@@ -382,7 +383,6 @@ void st_init_extensions(struct st_context *st)
{ o(EXT_texture_filter_anisotropic), PIPE_CAP_ANISOTROPIC_FILTER },
{ o(EXT_texture_mirror_clamp), PIPE_CAP_TEXTURE_MIRROR_CLAMP },
{ o(EXT_texture_swizzle), PIPE_CAP_TEXTURE_SWIZZLE },
- { o(EXT_timer_query), PIPE_CAP_QUERY_TIME_ELAPSED },
{ o(EXT_transform_feedback), PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS },
{ o(AMD_seamless_cubemap_per_texture), PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE },
@@ -652,9 +652,12 @@ void st_init_extensions(struct st_context *st)
if (ctx->Const.MaxDualSourceDrawBuffers > 0)
ctx->Extensions.ARB_blend_func_extended = GL_TRUE;
- if (screen->get_param(screen, PIPE_CAP_QUERY_TIME_ELAPSED) &&
- screen->get_param(screen, PIPE_CAP_QUERY_TIMESTAMP)) {
- ctx->Extensions.ARB_timer_query = GL_TRUE;
+ st->has_time_elapsed =
+ screen->get_param(screen, PIPE_CAP_QUERY_TIME_ELAPSED);
+
+ if (st->has_time_elapsed ||
+ ctx->Extensions.ARB_timer_query) {
+ ctx->Extensions.EXT_timer_query = GL_TRUE;
}
if (ctx->Extensions.ARB_transform_feedback2 &&