OpenGL ES support on Windows via ANGLE

Hello all,

TL;DR SDL is giving me a regular desktop context if I ask for OpenGL
ES on Windows.

Long version:

I am using SDL 2.0.1 on Windows in order to create an OpenGL ES
context via the ANGLE Project
(https://code.google.com/p/angleproject/).

I use SDL_GL_SetAttribute with the following settings:

SDL_GL_CONTEXT_EGL, 1
SDL_GL_CONTEXT_PROFILE_MASK, SDL_CONTEXT_PROFILE_ES
SDL_GL_CONTEXT_MAJOR_VERSION, 2
SDL_GL_CONTEXT_MINOR_VERSION, 0

The context is constructed successfully and I use SDL_GL_GetAttribute
to verify that I am getting an OpenGL ES context.

However, when I try to compile a simple ES shader, I get the following error:

ERROR: 0:2: ‘precision’ : syntax error syntax error

This error occurs when you get a regular desktop OpenGL context
instead of an OpenGL ES context. I have verified this by using EGL
directly:

EGL (es2 context) => shader compiles successfully
WGL (desktop context) => ERROR: 0:2: ‘precision’ : syntax error syntax error
SDL (desktop context) => ERROR: 0:2: ‘precision’ : syntax error syntax error
SDL (es2 context) => ERROR: 0:2: ‘precision’ : syntax error syntax error

Does SDL support EGL on Windows? If not, context construction should
fail, or SDL_GL_GetAttribute should not report an EGL+ES context. If
yes, something appears to be broken somewhere.

Any ideas how to proceed with this?

If you haven’t already, please enter a bug at bugzilla.libsdl.org

Thanks!On Fri, Nov 8, 2013 at 12:32 AM, Stefanos A. wrote:

Hello all,

TL;DR SDL is giving me a regular desktop context if I ask for OpenGL
ES on Windows.

Long version:

I am using SDL 2.0.1 on Windows in order to create an OpenGL ES
context via the ANGLE Project
(https://code.google.com/p/angleproject/).

I use SDL_GL_SetAttribute with the following settings:

SDL_GL_CONTEXT_EGL, 1
SDL_GL_CONTEXT_PROFILE_MASK, SDL_CONTEXT_PROFILE_ES
SDL_GL_CONTEXT_MAJOR_VERSION, 2
SDL_GL_CONTEXT_MINOR_VERSION, 0

The context is constructed successfully and I use SDL_GL_GetAttribute
to verify that I am getting an OpenGL ES context.

However, when I try to compile a simple ES shader, I get the following
error:

ERROR: 0:2: ‘precision’ : syntax error syntax error

This error occurs when you get a regular desktop OpenGL context
instead of an OpenGL ES context. I have verified this by using EGL
directly:

EGL (es2 context) => shader compiles successfully
WGL (desktop context) => ERROR: 0:2: ‘precision’ : syntax error syntax
error
SDL (desktop context) => ERROR: 0:2: ‘precision’ : syntax error syntax
error
SDL (es2 context) => ERROR: 0:2: ‘precision’ : syntax error syntax error

Does SDL support EGL on Windows? If not, context construction should
fail, or SDL_GL_GetAttribute should not report an EGL+ES context. If
yes, something appears to be broken somewhere.

Any ideas how to proceed with this?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Reported at https://bugzilla.libsdl.org/show_bug.cgi?id=2222

Using OpenGL ES / ANGLE on Windows is useful (a) for development (i.e. test
without an Android emulator) and (b) for compatibility (i.e. for GPUs
without proper OpenGL drivers). ANGLE is also the only way to use OpenGL in
a Metro application.

2013/11/9 Sam Lantinga > If you haven’t already, please enter a bug at bugzilla.libsdl.org

Thanks!

On Fri, Nov 8, 2013 at 12:32 AM, Stefanos A. <@Stefanos_A> wrote:

Hello all,

TL;DR SDL is giving me a regular desktop context if I ask for OpenGL
ES on Windows.

Long version:

I am using SDL 2.0.1 on Windows in order to create an OpenGL ES
context via the ANGLE Project
(https://code.google.com/p/angleproject/).

I use SDL_GL_SetAttribute with the following settings:

SDL_GL_CONTEXT_EGL, 1
SDL_GL_CONTEXT_PROFILE_MASK, SDL_CONTEXT_PROFILE_ES
SDL_GL_CONTEXT_MAJOR_VERSION, 2
SDL_GL_CONTEXT_MINOR_VERSION, 0

The context is constructed successfully and I use SDL_GL_GetAttribute
to verify that I am getting an OpenGL ES context.

However, when I try to compile a simple ES shader, I get the following
error:

ERROR: 0:2: ‘precision’ : syntax error syntax error

This error occurs when you get a regular desktop OpenGL context
instead of an OpenGL ES context. I have verified this by using EGL
directly:

EGL (es2 context) => shader compiles successfully
WGL (desktop context) => ERROR: 0:2: ‘precision’ : syntax error syntax
error
SDL (desktop context) => ERROR: 0:2: ‘precision’ : syntax error syntax
error
SDL (es2 context) => ERROR: 0:2: ‘precision’ : syntax error syntax error

Does SDL support EGL on Windows? If not, context construction should
fail, or SDL_GL_GetAttribute should not report an EGL+ES context. If
yes, something appears to be broken somewhere.

Any ideas how to proceed with this?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Worth noting:

ANGLE is also used by Chrome and Firefox. It provides a fully
compliant and regression tested OpenGL ES v2 and EGL. I wonder if
the fact that it is implemented on top of DirectX 9 or 11 as
necessary has anything to do with the problem?

JosephOn Sat, Nov 09, 2013 at 10:55:29AM +0100, Stefanos A. wrote:

Reported at https://bugzilla.libsdl.org/show_bug.cgi?id=2222

Using OpenGL ES / ANGLE on Windows is useful (a) for development (i.e. test
without an Android emulator) and (b) for compatibility (i.e. for GPUs
without proper OpenGL drivers). ANGLE is also the only way to use OpenGL in
a Metro application.

2013/11/9 Sam Lantinga

If you haven’t already, please enter a bug at bugzilla.libsdl.org

Thanks!

On Fri, Nov 8, 2013 at 12:32 AM, Stefanos A. wrote:

Hello all,

TL;DR SDL is giving me a regular desktop context if I ask for OpenGL
ES on Windows.

Long version:

I am using SDL 2.0.1 on Windows in order to create an OpenGL ES
context via the ANGLE Project
(https://code.google.com/p/angleproject/).

I use SDL_GL_SetAttribute with the following settings:

SDL_GL_CONTEXT_EGL, 1
SDL_GL_CONTEXT_PROFILE_MASK, SDL_CONTEXT_PROFILE_ES
SDL_GL_CONTEXT_MAJOR_VERSION, 2
SDL_GL_CONTEXT_MINOR_VERSION, 0

The context is constructed successfully and I use SDL_GL_GetAttribute
to verify that I am getting an OpenGL ES context.

However, when I try to compile a simple ES shader, I get the following
error:

ERROR: 0:2: ‘precision’ : syntax error syntax error

This error occurs when you get a regular desktop OpenGL context
instead of an OpenGL ES context. I have verified this by using EGL
directly:

EGL (es2 context) => shader compiles successfully
WGL (desktop context) => ERROR: 0:2: ‘precision’ : syntax error syntax
error
SDL (desktop context) => ERROR: 0:2: ‘precision’ : syntax error syntax
error
SDL (es2 context) => ERROR: 0:2: ‘precision’ : syntax error syntax error

Does SDL support EGL on Windows? If not, context construction should
fail, or SDL_GL_GetAttribute should not report an EGL+ES context. If
yes, something appears to be broken somewhere.

Any ideas how to proceed with this?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

No, the implementation of ANGLE should not affect anything here. I have
verified that ANGLE is working correctly by initializing an EGL context
directly through libEGL instead of SDL.

I haven’t had time to check the SDL source code, but this shouldn’t be too
hard to fix.

2013/11/10 T. Joseph Carter > Worth noting:

ANGLE is also used by Chrome and Firefox. It provides a fully compliant
and regression tested OpenGL ES v2 and EGL. I wonder if the fact that it
is implemented on top of DirectX 9 or 11 as necessary has anything to do
with the problem?

Joseph

On Sat, Nov 09, 2013 at 10:55:29AM +0100, Stefanos A. wrote:

Reported at https://bugzilla.libsdl.org/show_bug.cgi?id=2222

Using OpenGL ES / ANGLE on Windows is useful (a) for development (i.e.
test
without an Android emulator) and (b) for compatibility (i.e. for GPUs
without proper OpenGL drivers). ANGLE is also the only way to use OpenGL
in
a Metro application.

2013/11/9 Sam Lantinga

If you haven’t already, please enter a bug at bugzilla.libsdl.org

Thanks!

On Fri, Nov 8, 2013 at 12:32 AM, Stefanos A. <@Stefanos_A> wrote:

Hello all,

TL;DR SDL is giving me a regular desktop context if I ask for OpenGL
ES on Windows.

Long version:

I am using SDL 2.0.1 on Windows in order to create an OpenGL ES
context via the ANGLE Project
(https://code.google.com/p/angleproject/).

I use SDL_GL_SetAttribute with the following settings:

SDL_GL_CONTEXT_EGL, 1
SDL_GL_CONTEXT_PROFILE_MASK, SDL_CONTEXT_PROFILE_ES
SDL_GL_CONTEXT_MAJOR_VERSION, 2
SDL_GL_CONTEXT_MINOR_VERSION, 0

The context is constructed successfully and I use SDL_GL_GetAttribute
to verify that I am getting an OpenGL ES context.

However, when I try to compile a simple ES shader, I get the following
error:

ERROR: 0:2: ‘precision’ : syntax error syntax error

This error occurs when you get a regular desktop OpenGL context
instead of an OpenGL ES context. I have verified this by using EGL
directly:

EGL (es2 context) => shader compiles successfully
WGL (desktop context) => ERROR: 0:2: ‘precision’ : syntax error syntax
error
SDL (desktop context) => ERROR: 0:2: ‘precision’ : syntax error syntax
error
SDL (es2 context) => ERROR: 0:2: ‘precision’ : syntax error syntax error

Does SDL support EGL on Windows? If not, context construction should
fail, or SDL_GL_GetAttribute should not report an EGL+ES context. If
yes, something appears to be broken somewhere.

Any ideas how to proceed with this?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org