[Piglit] Core context tests and ARB_compatibility

Chad Versace chad.versace at linux.intel.com
Wed Feb 13 14:34:57 PST 2013

On 02/13/2013 01:54 PM, Dave Airlie wrote:
> On Thu, Feb 14, 2013 at 7:04 AM, Matt Turner <mattst88 at gmail.com> wrote:
>> On Mon, Feb 11, 2013 at 11:32 PM, Alexander Monakov <amonakov at gmail.com> wrote:
>>> Hello,
>>> I think there is a problem in piglit implementation that "breaks" some
>>> tests on nvidia proprietary drivers, for instance "textureSize 140 fs
>>> sampler2D -auto -fbo" produces:
>>> piglit: info: Failed to create GL 3.1 core context
>>> GLSL 1.40 not supported.
>>> Stepping through the test in gdb I see that it first acquires a 3.1
>>> core context, but decides to throw it away since it has
>>> ARB_compatibility. Then the tests asks for a 1.0 compat context, and
>>> gets a 2.1 context with glsl-1.20.
>>> I'm told this test somehow works on amd proprietary drivers.
>>> Alexander
>> There's a comment in tests/util/piglit-framework-gl.h that explains this:
>> * Piglit handles a request for a GL 3.1 compatibility context as
>> * a special case.  As noted above, Waffle ignores the profile
>> * attribute when choosing a 3.1 config. However, the concept of
>> * "compatibility profile" is still applicable to 3.1 contexts and is
>> * indicated by the context's support for the GL_ARB_compatibility
>> * extension. Therefore, Piglit attempts to run under a GL 3.1
>> * compatibility context by first creating the context and then
>> * skipping the attempt if the context lacks the GL_ARB_compatibility
>> * extension.
>> So if you have ARB_compatibility, there's no way to get a core-only
>> 3.1 context. You could, I suppose, request a forward-compatible
>> context but I'm not sure if there are things in 3.1 minus
>> ARB_compatibility that are deprecated and wouldn't be available.
> But why would that matter, surely a 3.1 compat context is > a 3.1 core context,
> so tests shouldn't care.

Some tests do care. See `tests/spec/gl-3.1/genned-names.c`. The core context
requires that object names passed to glBind* be generated with glGen*. The
compatibility context has looser requirements.


Could you please check if your problem still occurs with Waffle master? I think
the patch below may have fixed your problem.

commit a84f39fcf8e16f421aeed1fe6b60fc631108c5b9
Author: Chad Versace <chad.versace at linux.intel.com>
Date:   Wed Dec 19 12:04:53 2012 -0800

    glx: Add glXCreateContextAttribs workaround for NVidia bug

    With NVidia, calling glXCreateContextAttribsARB with MAJOR=1 and MINOR=0
    returns an OpenGL 2.1 context. Calling it with MAJOR and MINOR unspecified
    returns a context of the latest supported OpenGL version. However, according to
    the GLX_ARB_create_context spec, the two calls should behave identically.
    Calling with MAJOR and MINOR unspecified produces the expected behavior.
    As a workaround, do not specify GLX_CONTEXT_MAJOR_VERSION_ARB and
    GLX_CONTEXT_MINOR_VERSION_ARB in the call to glXCreateContextAttribsARB if the
    user requested an OpenGL context of unspecified version or if the user
    explicitly requested an OpenGL 1.0 context.

More information about the Piglit mailing list