glx: Implement GLX_EXT_stereo_tree

This is correct as it is, but only because we know no DRI drivers
implement stereo.

v2: Use new ATTRIB macro

Reviewed-by: James Jones <jajones@nvidia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Adam Jackson 2015-05-18 13:00:02 -04:00
parent a18238877b
commit d15cb654b6
3 changed files with 11 additions and 1 deletions

View File

@ -84,6 +84,7 @@ static const struct extension_info known_glx_extensions[] = {
{ GLX(EXT_create_context_es2_profile), VER(0,0), N, },
{ GLX(EXT_framebuffer_sRGB), VER(0,0), N, },
{ GLX(EXT_import_context), VER(0,0), Y, },
{ GLX(EXT_stereo_tree), VER(0,0), N, },
{ GLX(EXT_texture_from_pixmap), VER(0,0), Y, },
{ GLX(EXT_visual_info), VER(0,0), Y, },
{ GLX(EXT_visual_rating), VER(0,0), Y, },

View File

@ -46,6 +46,7 @@ enum {
EXT_create_context_es_profile_bit,
EXT_create_context_es2_profile_bit,
EXT_import_context_bit,
EXT_stereo_tree_bit,
EXT_texture_from_pixmap_bit,
EXT_visual_info_bit,
EXT_visual_rating_bit,

View File

@ -1921,6 +1921,11 @@ __glXDisp_CopySubBufferMESA(__GLXclientState * cl, GLbyte * pc)
return Success;
}
/* hack for old glxext.h */
#ifndef GLX_STEREO_TREE_EXT
#define GLX_STEREO_TREE_EXT 0x20F5
#endif
/*
** Get drawable attributes
*/
@ -1931,7 +1936,7 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
xGLXGetDrawableAttributesReply reply;
__GLXdrawable *pGlxDraw = NULL;
DrawablePtr pDraw;
CARD32 attributes[16];
CARD32 attributes[18];
int num = 0, error;
if (!validGlxDrawable(client, drawId, GLX_DRAWABLE_ANY,
@ -1964,6 +1969,9 @@ DoGetDrawableAttributes(__GLXclientState * cl, XID drawId)
if (pGlxDraw->type == GLX_DRAWABLE_PBUFFER) {
ATTRIB(GLX_PRESERVED_CONTENTS, GL_TRUE);
}
if (pGlxDraw->type == GLX_DRAWABLE_WINDOW) {
ATTRIB(GLX_STEREO_TREE_EXT, 0);
}
}
#undef ATTRIB