From 70277f4b04c6fd5dfe22c26c2cca48ea99e53e80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Mon, 4 Nov 2019 14:48:56 +0100 Subject: [PATCH] doc: mention GLSL BOM issues in Windows troubleshooting guide. Even though any editor on any platform can add BOM, no serious ones do that by default. Thus this is pretty localized to Windows where Notepad adds BOM implicitly. --- doc/platforms-windows.dox | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/doc/platforms-windows.dox b/doc/platforms-windows.dox index 626bb5172..a3a24f67a 100644 --- a/doc/platforms-windows.dox +++ b/doc/platforms-windows.dox @@ -268,6 +268,21 @@ set_property(DIRECTORY ${PROJECT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT MyAppli The Magnum bootstrap projects set this automatically. +@subsection platform-windows-troubleshooting-bom-in-shaders UTF-8 BOM in shader code + +If your GLSL shaders fail to compile with the following error, it means you +have your file saved as UTF-8 with a BOM: + +@code{.shell-session} +GL::Shader::compile(): compilation of vertex shader 1 failed with the following message: +ERROR:2:1: `` : syntax error: illegal extended ASCII character (0xef) +ERROR:2:1: `` : syntax error: illegal extended ASCII character (0xbb) +ERROR:2:1: `` : syntax error: illegal extended ASCII character (0xbf) +@endcode + +While the C++ compilers can usually ignore the BOM marker, it's not so common +with GLSL compilers in the drivers. Save your file as UTF-8 without BOM. + @todoc DLL paths @todoc vcpkg @todoc desktop ES