We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2206 - GLES2 context creation fails in x11 since 2.0.1
Summary: GLES2 context creation fails in x11 since 2.0.1
Status: RESOLVED INVALID
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: 2.0.1
Hardware: x86_64 Linux
: P2 normal
Assignee: Gabriel Jacobo
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-03 16:21 UTC by Carles Pagès
Modified: 2013-11-04 12:51 UTC (History)
0 users

See Also:


Attachments
Fixed test file (2.18 KB, text/x-c++src)
2013-11-04 12:51 UTC, Gabriel Jacobo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Carles Pagès 2013-11-03 16:21:38 UTC
Since SDL 2.0.1 gles2 context creation fails under x11.

I used the following code to reproduce the failure: http://sprunge.us/AJHe

I'm not sure if this is relevant, but this is on a laptop with an intel gm965 card.

I tracked down the change of behaviour to changeset 7659 (http://hg.libsdl.org/SDL/diff/ac4ce59c40e7/src/video/x11/SDL_x11opengl.c). Before, there was code to internally use the gles functions to create the context if SDL_GL_CONTEXT_EGL was set. Now, this decision is based on HAS_GLX_EXT_create_context_es2_profile, which is true in my system. So, X11_GL_CreateContext is used to try to create the gles context but it fails, specifically the last call to glXCreateContextAttribs returns null (with these attribs):
(gdb) print attribs
$4 = {8337, 2, 8338, 1, 37158, 4, 0, 0, 0}

I don't know how to further debug this, but a workaround would be to use again the gles internal functions to create the context when an 'es' context is needed.
Comment 1 Gabriel Jacobo 2013-11-04 12:51:18 UTC
Created attachment 1405 [details]
Fixed test file

Your test file fails here too. It's an easy fix though. See attached file.

(You didn't set the minor version for the context, and using SDL_GL_CONTEXT_EGL is deprecated).
Comment 2 Gabriel Jacobo 2013-11-04 12:51:43 UTC
Marking as invalid, feel free to reopen if this isn't the case.