[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Public WebGL] ESSL 3.5 Comments Compliance

Hello WebGL'ers,

This salutation cannot be used in shader comments in the latest WebKit
nightly (since r75175 : http://trac.webkit.org/changeset/75175 re
https://bugs.webkit.org/show_bug.cgi?id=50929 ) due to its use of the
single quotation mark. Other banned characters include @ and $. This
behavior is not compliant with the ESSL 1.0.17 spec Sec. 3.5 which

"If a comment resides entirely within a single line, it is treated
syntactically as a single space."

While the character check is obviously necessary for setUniform et al
as strings passed here are parsed according to the ESSL grammar, this
check shouldn't be used source code strings because the spec does
allow comments to contain these characters. Important use cases that
require this include:
- email addresses in comments
- CVS escaping ($Id$)
- as Zhenyao describes in WebKit bug 50929, Apple and Google copyright symbols

It should be noted that comments in shaders in the ESSL spec contain
characters not in the grammar character set. See a unicode not_equals
character in Sec 4.6.2 and many uses of both ASCII and Unicode
quotation marks in their example comments.

These character set checks should be done post-lexing not on the raw
string data. Additionally, these post-lexing checks should emit lex
location information to let shader authors track down legitimately
erroneous characters in their source code rather than simply refusing
to compile with a generic error message.


David Sheets
Ashima Arts
You are currently subscribed to public_webgl@khronos.org.
To unsubscribe, send an email to majordomo@khronos.org with
the following command in the body of your email:
unsubscribe public_webgl