summaryrefslogtreecommitdiffstats
path: root/src/glx/indirect_glx.c
diff options
context:
space:
mode:
authorTomasz Lis <[email protected]>2013-07-17 13:49:18 +0200
committerIan Romanick <[email protected]>2013-07-18 16:03:42 -0700
commit27c8aa5cfbcf6f2ad21564dfcdabbe747c277cab (patch)
tree6a63a21b1770cebeeed83a94438f17083776b719 /src/glx/indirect_glx.c
parent1c748dff6b13ff127c02790fa6078cc68eb42291 (diff)
glx: Store the RENDER_TYPE in indirect rendering
v2 (idr): Open-code the check for GLX_RENDER_TYPE. dri2_convert_glx_attribs can't be called from here because that function only exists in direct-rendering builds. Also add a stub version of indirect_create_context_attribs to tests/fake_glx_screen.cpp to prevent 'make check' regressions. Signed-off-by: Tomasz Lis <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glx/indirect_glx.c')
-rw-r--r--src/glx/indirect_glx.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c
index ff869e2dc8f..11e92979156 100644
--- a/src/glx/indirect_glx.c
+++ b/src/glx/indirect_glx.c
@@ -362,6 +362,8 @@ indirect_create_context(struct glx_screen *psc,
gc->isDirect = GL_FALSE;
gc->vtable = &indirect_context_vtable;
state = calloc(1, sizeof(struct __GLXattributeRec));
+ gc->renderType = renderType;
+
if (state == NULL) {
/* Out of memory */
free(gc);
@@ -430,7 +432,7 @@ indirect_create_context(struct glx_screen *psc,
return gc;
}
-static struct glx_context *
+_X_HIDDEN struct glx_context *
indirect_create_context_attribs(struct glx_screen *base,
struct glx_config *config_base,
struct glx_context *shareList,
@@ -438,18 +440,24 @@ indirect_create_context_attribs(struct glx_screen *base,
const uint32_t *attribs,
unsigned *error)
{
- /* All of the attribute validation for indirect contexts is handled on the
- * server, so there's not much to do here.
- */
- (void) num_attribs;
- (void) attribs;
+ int renderType = GLX_RGBA_TYPE;
+ unsigned i;
/* The error parameter is only used on the server so that correct GLX
* protocol errors can be generated. On the client, it can be ignored.
*/
(void) error;
- return indirect_create_context(base, config_base, shareList, 0);
+ /* All of the attribute validation for indirect contexts is handled on the
+ * server, so there's not much to do here. Still, we need to parse the
+ * attributes to correctly set renderType.
+ */
+ for (i = 0; i < num_attribs; i++) {
+ if (attribs[i * 2] == GLX_RENDER_TYPE)
+ renderType = attribs[i * 2 + 1];
+ }
+
+ return indirect_create_context(base, config_base, shareList, renderType);
}
struct glx_screen_vtable indirect_screen_vtable = {