From 96d74138b1c0273e88933220d99a893858b649cd Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 5 Dec 2011 10:56:07 -0800 Subject: glx: Extend __GLXscreen::createContext to take attributes The attributes will be used for glXCreateContextAttribsARB additions in follow-on patches. v2: Add missing 'int *error' parameters noticed by Christopher James Halse Rogers. v3: Remove redundant 'int err;' declaration noticed by Christopher James Halse Rogers. This was supposed to be in v2, but I missed it. v4: Add comma missing from additions in v2. Ugh. Signed-off-by: Ian Romanick Reviewed-by: Jesse Barnes Reviewed-by: Christopher James Halse Rogers --- glx/glxcmds.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'glx/glxcmds.c') diff --git a/glx/glxcmds.c b/glx/glxcmds.c index 5c70afabe..308c14a4e 100644 --- a/glx/glxcmds.c +++ b/glx/glxcmds.c @@ -276,8 +276,14 @@ DoCreateContext(__GLXclientState * cl, GLXContextID gcId, /* ** Allocate memory for the new context */ - if (!isDirect) - glxc = pGlxScreen->createContext(pGlxScreen, config, shareglxc); + if (!isDirect) { + /* Without any attributes, the only error that the driver should be + * able to generate is BadAlloc. As result, just drop the error + * returned from the driver on the floor. + */ + glxc = pGlxScreen->createContext(pGlxScreen, config, shareglxc, + 0, NULL, &err); + } else glxc = __glXdirectContextCreate(pGlxScreen, config, shareglxc); if (!glxc) { -- cgit v1.2.3