Bug 110462

Summary: Epic Games Launcher renders nothing with "-opengl" option
Product: Mesa Reporter: Danylo <danylo.piliaiev>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact: mesa-dev
Severity: normal    
Priority: medium CC: danylo.piliaiev
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Danylo 2019-04-17 11:43:26 UTC
If Epic Game Launcher launched via wine with "-opengl" command line option - only black/corrupted rectangle could be seen.

It is true for radeonsi and i965 however it renders correctly on proprietary Nvidia drivers.
Comment 1 Danylo 2019-04-17 11:52:21 UTC
This happens because Epic Games Launcher uses deprecated GL functionality while creating core 4.4 context. The workaround will be launching it with MESA_GL_VERSION_OVERRIDE=4.4COMPAT environment variable or using "force_compat_profile" drirc option. 

Submitted merge requests:
https://gitlab.freedesktop.org/mesa/mesa/merge_requests/676 - add EGS to drirc
https://gitlab.freedesktop.org/mesa/mesa/merge_requests/677 - add support of "force_compat_profile" to i965
Comment 2 Timothy Arceri 2019-04-17 23:49:36 UTC
Are you sure it is actually requesting a core profile?

On i965 and older versions of radeonsi we fall back to core profile because they don't/didn't support compat profile in GL 4.4.
Comment 3 Danylo 2019-04-18 11:41:58 UTC
It creates several contexts (from apitrace):

glXCreateContextAttribsARB(dpy = 0x7e1e57b0, config = 0x7e875070, share_context = 0x7e9c0450, direct = True, attrib_list = [GLX_CONTEXT_MAJOR_VERSION_ARB, 3, GLX_CONTEXT_MINOR_VERSION_ARB, 2, GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB, GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, 0]) = 0x7ebf4410

glXCreateContextAttribsARB(dpy = 0x7e1e57b0, config = 0x7e875070, share_context = NULL, direct = True, attrib_list = [GLX_CONTEXT_MAJOR_VERSION_ARB, 4, GLX_CONTEXT_MINOR_VERSION_ARB, 4, 0]) = 0x7ec33570

glXCreateContextAttribsARB(dpy = 0x7e1e57b0, config = 0x7e875070, share_context = NULL, direct = True, attrib_list = [GLX_CONTEXT_MAJOR_VERSION_ARB, 4, GLX_CONTEXT_MINOR_VERSION_ARB, 4, GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB, 0]) = 0x7f526c0010d0

So for 3.2 it requests compat profile. For 4.4 - it doesn't and it uses 4.4 context to render the interface.
Comment 4 Marek Olšák 2019-04-22 20:05:16 UTC
I pushed your fix. Closing.
Comment 5 Timothy Arceri 2019-04-22 23:19:53 UTC
(In reply to Danylo from comment #3)
> It creates several contexts (from apitrace):
> 
> glXCreateContextAttribsARB(dpy = 0x7e1e57b0, config = 0x7e875070,
> share_context = 0x7e9c0450, direct = True, attrib_list =
> [GLX_CONTEXT_MAJOR_VERSION_ARB, 3, GLX_CONTEXT_MINOR_VERSION_ARB, 2,
> GLX_CONTEXT_PROFILE_MASK_ARB, GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
> GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB, 0]) =
> 0x7ebf4410
> 
> glXCreateContextAttribsARB(dpy = 0x7e1e57b0, config = 0x7e875070,
> share_context = NULL, direct = True, attrib_list =
> [GLX_CONTEXT_MAJOR_VERSION_ARB, 4, GLX_CONTEXT_MINOR_VERSION_ARB, 4, 0]) =
> 0x7ec33570
> 
> glXCreateContextAttribsARB(dpy = 0x7e1e57b0, config = 0x7e875070,
> share_context = NULL, direct = True, attrib_list =
> [GLX_CONTEXT_MAJOR_VERSION_ARB, 4, GLX_CONTEXT_MINOR_VERSION_ARB, 4,
> GLX_CONTEXT_FLAGS_ARB, GLX_CONTEXT_DEBUG_BIT_ARB, 0]) = 0x7f526c0010d0
> 
> So for 3.2 it requests compat profile. For 4.4 - it doesn't and it uses 4.4
> context to render the interface.

As far as I recall apitrace records the profile it was given not the profile that the application requests.
Comment 6 Danylo 2019-04-23 08:59:26 UTC
> As far as I recall apitrace records the profile it was given not the profile that the application requests.

I have copied the function call itself which I think apitrace doesn't change. It can show a different info in a current state of the call but that's another story.

However I rechecked by adding logs and here what is passed to dri2_convert_glx_attribs which is called by glXCreateContextAttribsARB:

major: 1, minor: 0, compat: 0
major: 1, minor: 0, compat: 0
major: 3, minor: 2, compat: 1
major: 1, minor: 0, compat: 0
major: 4, minor: 4, compat: 0
major: 1, minor: 0, compat: 0
major: 3, minor: 2, compat: 1

So 4.4 created without compat.

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.