On 12/18/2012 10:43 AM, Paul Berry wrote:
> The nVidia driver violates these parts of the ARB_glx_create_context
> extension:
> 
>     <attrib_list> specifies a list of attributes for the context. The
>     list consists of a sequence of <name,value> pairs terminated by the
>     value None (0). If an attribute is not specified in <attrib_list>,
>     then the default value specified below is used instead.
> 
>     The default values for GLX_CONTEXT_MAJOR_VERSION_ARB and
>     GLX_CONTEXT_MINOR_VERSION_ARB are 1 and 0 respectively. In this
>     case, implementations will typically return the most recent version
>     of OpenGL they support which is backwards compatible with OpenGL 1.0
>     (e.g. 3.0, 3.1 + GL_ARB_compatibility, or 3.2 compatibility profile)
> 
> What the nVidia driver does, instead, is:
> 
> - If neither GLX_CONTEXT_MAJOR_VERSION_ARB nor
> GLX_CONTEXT_MINOR_VERSION_ARB is specified, it returns a 4.2 context.
> - If GLX_CONTEXT_MAJOR_VERSION=1 and GLX_CONTEXT_MINOR_VERSION_ARB=0 are
> specified, it returns a 2.1 context.
> 
> It's pretty clear to me that this is a violation of the spec.  Perhaps I
> should write to my congressman.

Yeah, it's very clear. Calling glXCreateContextAttribs with MAJOR=1 and
MINOR=0 should be equivalent to calling it without specifying MAJOR and
MINOR.

> Anyhow, for the moment I'm working around the problem by modifying
> glx_context_fill_attrib_list (waffle/src/waffle/glx/glx_context.c) so that
> it only provides attributes these two problematic attributes to the driver
> if (attrs->context_major_version != 1 || attrs->context_minor_version !=
> 0).  I can't decide whether I like this as a long term solution, though.

According to the GLX_ARB_create_context spec, calling it either way should
be equivalent, so I don't view your workaround as dirty. If, in order to
accommodate a buggy driver, we must replace one call in waffle with a
according-to-the-spec equivalent call, that seems to be an acceptable 
workaround.

_______________________________________________
waffle mailing list
waffle@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/waffle

Reply via email to