defold / editor2-issues

DEPRECATED
44 stars 4 forks source link

#extension directive in shaders fail due to stuff inserted in top of shaders at build time [DEFEDIT-1126] [DEF-2793] #1155

Closed Malmer closed 7 years ago

Malmer commented 7 years ago

Adding #extension directive like: #extension GL_EXT_shader_framebuffer_fetch : require

On top of a shader will give the following error message: WARNING:GRAPHICS: ERROR: 0:9: '' : syntax error: #extension must always be before any non-preprocessor tokens

This is caused by Defold inserting things at the top of the shader when building. Defold should insert these declarations after any initial # lines in the file (Typical things Defold inserts in the actual file are float precision modifiers and such).

Some special cases:

Malmer commented 7 years ago

DEF-2793