Mesa version: 8.1-devel How to reproduce: Compile a shader that includes a line like this: #line 5 "/home/user/my-shader.frag" What should happen: GLSL compiler picks this up and uses this line / file for error reporting What happens: GLSL compiler exits with the error "0:2(2): preprocessor error: Invalid tokens after #" The #line directive above is a standard output of the excellent MCPP ( http://mcpp.sourceforge.net/ ) preprocessor, and it is recognized by both NVIDIA and ATI closed drivers.
This cannot be valid GLSL: the double-quote character isn't a valid character in shaders at all. It sucks that AMD and NVIDIA accept this. This is valid C / C++ (mcpp is a C / C++ preprocessor). Page 16 (page 22 of the PDF) of GLSL 4.20 spec says: "#line must have, after macro substitution, one of the following forms: #line line #line line source-string-number where line and source-string-number are constant integer expressions." "/home/user/my-shader.frag" is not a constant integer expression.
Okay, then I was mislead by the fact that closed drivers not only allow this line, but also mention in potential error messages that they belong to the file "/home/user/my-shader.frag".
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.