summaryrefslogtreecommitdiffstats
path: root/src/glx/dri2_glx.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2013-02-15 22:35:55 -0800
committerIan Romanick <[email protected]>2013-11-07 18:12:33 -0800
commit4680d237c5ae2d1ce6446ff2ec2f0a91f8286554 (patch)
treea1f8a81c28ed5e74b307957ab88ffc795e9103b1 /src/glx/dri2_glx.c
parent419684091cb58e9c06e698c6eb2e86731815d279 (diff)
glx/dri2: Add DRI2 support for GLX_MESA_query_renderer
The new functions for this extension were added to a separate file (dri2_query_renderer.c) to facilitate unit testing. I tried putting them in dri2_glx.c, and it resulting in an unending chain of dependencies. It was the proverbial threading hanging from a sweater. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/glx/dri2_glx.c')
-rw-r--r--src/glx/dri2_glx.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 84e88ec2efd..3b333120cba 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -1117,12 +1117,23 @@ dri2BindExtensions(struct dri2_screen *psc, struct glx_display * priv,
&& strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0)
__glXEnableDirectExtension(&psc->base,
"GLX_ARB_create_context_robustness");
+
+ /* DRI2 version 3 is also required because GLX_MESA_query_renderer
+ * requires GLX_ARB_create_context_profile.
+ */
+ if (psc->dri2->base.version >= 3
+ && strcmp(extensions[i]->name, __DRI2_RENDERER_QUERY) == 0) {
+ psc->rendererQuery = (__DRI2rendererQueryExtension *) extensions[i];
+ __glXEnableDirectExtension(&psc->base, "GLX_MESA_query_renderer");
+ }
}
}
static const struct glx_screen_vtable dri2_screen_vtable = {
dri2_create_context,
- dri2_create_context_attribs
+ dri2_create_context_attribs,
+ dri2_query_renderer_integer,
+ dri2_query_renderer_string,
};
static struct glx_screen *