Closed Bug 891204 Opened 11 years ago Closed 8 years ago

GFX shaders fail to compile when creating a OpenGL 3.2 Core profile

Categories

(Core :: Graphics: Layers, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: guillaume.abadie, Unassigned)

References

Details

Attachments

(1 file)

Attached file mozilla abort log
WebGL 2 prototype require an OpenGL 3.0 context or higher.

On Mac OS X, to get a OpenGL 3.0 context, we have to create a 3.2 core profile. But shaders are not compatible with 3.2 core profile.

Note that some WebGL 2 features like sampler objects would need a 3.3 context if note available by extension. So on Mac OS X, we would need to create a 4.3 context because they are only Core Profile.

To reproduce the bug, add the 2 following lines in GLContextProviderCGL.mm:62 :
NSOpenGLPFAOpenGLProfile,
NSOpenGLProfileVersion3_2Core,

Can surly be reproduced on other OS by the same way.
Blocks: 891033, webgl2
No longer blocks: webgl2
Attachment #772436 - Attachment mime type: text/x-log → text/plain
You may be able to get around this by adding a "#version 110" to the start of each shader in the text file (or modifying the script that generates the header file to insert it, which would be easier)
Vlad's suggestion should work as the short-term fix for this.
Component: Graphics → Graphics: Layers
Summary: GFX shaders compilation fail when creating a OpenGL Core profil needed by WebGL2 → GFX shaders fail to compile when creating a OpenGL 3.2 Core profile
(In reply to Vladimir Vukicevic [:vlad] [:vladv] from comment #1)
> You may be able to get around this by adding a "#version 110" to the start
> of each shader in the text file (or modifying the script that generates the
> header file to insert it, which would be easier)

That doesn't work either, I'm getting :
ERROR: 0:2: '' :  version '110' is not supported
ERROR: 0:3: '' :  #version required and missing.
ERROR: 0:18: 'varying' : syntax error syntax error

I think it's because the 3.2 core profile is only looking for GLSL 1.5.
GLSL preprocessor commands are a little weird. Check out this post about a similar problem on Mac:
http://stackoverflow.com/questions/8540489/glsl-version-gives-syntax-error-lwjgl-on-mac

Alternatively, check the 3.2 spec and GLSL specs themselves.
Depends on: 899264
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: