Bug 57241 - Gallium drivers should support forward-compatible contexts
Summary: Gallium drivers should support forward-compatible contexts
Status: RESOLVED NOTABUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: git
Hardware: All All
: medium enhancement
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-18 01:49 UTC by nfxjfg
Modified: 2012-11-30 17:52 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments
GL-3.0-forward-compatible-context-test (6.46 KB, patch)
2012-11-19 19:31 UTC, Alexander Sabourenkov
Details | Splinter Review

Description nfxjfg 2012-11-18 01:49:21 UTC
Test program: http://sprunge.us/eGJa
Failing output: http://bpaste.net/show/58701/
Successfull output (on another setup): http://dpaste.com/832706/

What seems to trigger this is calling glXCreateContextAttribsARB() with the following context attributes included: GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_CORE_PROFILE_BIT_ARB, and GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB. Removing these seems to make it work.

The test program has been confirmed to work on Mesa with i965, and nvidia binary drivers 304.60. The actual program which triggered this also works on fglrx.

User's glxinfo: http://bpaste.net/show/58678/
X server: "x11-base/xorg-server-1.13.0-r1" on Gentoo
The test program is a modified version of http://www.opengl.org/wiki/Tutorial:_OpenGL_3.0_Context_Creation_(GLX)

It's not clear whether this is a bug or just a caveat, and it has been confirmed on one installation only so far.
Comment 1 nfxjfg 2012-11-18 15:56:19 UTC
What triggers the failure is indeed GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB. As far as I know, for drivers which can't handle anything beyond 3.0 or so, this should be a no-op.

GLX_CONTEXT_CORE_PROFILE_BIT_ARB is ignored (as it should should be with GL 3.0).
Comment 2 Michel Dänzer 2012-11-19 16:27:50 UTC
Please attach files here directly instead of referencing external sites.

This is probably an issue in a Gallium state tracker, not in the driver; reassigning.
Comment 3 Alexander Sabourenkov 2012-11-19 19:31:57 UTC
Created attachment 70274 [details] [review]
GL-3.0-forward-compatible-context-test
Comment 4 Alexander Sabourenkov 2012-11-19 19:40:37 UTC
Btw, it chokes at http://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/state_tracker/st_manager.c#n656
Comment 5 Ian Romanick 2012-11-20 01:54:22 UTC
So... is the problem that a forward-compatible context isn't created?  That's not actually a bug.  Drivers aren't required to support fc contexts.  It was only in 9.0 that i965 supported it.  That said, all of the required plumbing to support fc contexts is complete, so it should be pretty easy to enable it in other 3.0 capable drivers.
Comment 6 nfxjfg 2012-11-20 05:54:33 UTC
(In reply to comment #5)
> So... is the problem that a forward-compatible context isn't created? 
> That's not actually a bug.  Drivers aren't required to support fc contexts. 

This appears to be correct.

Relevant section from the GLX_ARB_create_context extension:

      * If <config> does not support compatible OpenGL contexts
	providing the requested API major and minor version,
	forward-compatible flag, and debug context flag, GLXBadFBConfig
	is generated.

(http://www.opengl.org/registry/specs/ARB/glx_create_context.txt)

This is indeed not a bug. Sorry for the noise.
Comment 7 Marek Olšák 2012-11-29 22:06:33 UTC
This is not a bug. Failing to create a forward compatible context is allowed by the specification.
Comment 8 Ian Romanick 2012-11-30 17:52:01 UTC
(In reply to comment #7)
> This is not a bug. Failing to create a forward compatible context is allowed
> by the specification.

Right... which is why I changed the subject and changed the severity to "enhancement."  It is, in fact, an enhancement request. :)  It doesn't matter because you've already implemented support for it.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.