KhronosGroup / KhronosGroup/WebGL
Forbid long symbol names staring with `_`
Nobody has claimed this yet.
- Dominant language
- HTML
- Stars
- 2.9k
- Forks
- 704
- Avg merge
- 2d 9h
- Merged PRs (30d)
- 4
Description
ANGLE's shader translator prefixes symbol names with _u, but it can't do that if the symbol name is at least 1022 characters. To avoid name collisions, it has validation that if a name is at least 1022 characters and starts with _u, compilation fails.
A while ago, we made that u in _u configurable, which means the check is not correct if the compiler is invoked with anything other than u. I've also recently found a case where it makes sense to use different prefixes for different symbols, so the check would have to verify multiple prefixes, like _u, _b, etc.
I'd like to change the validation to forbid any too-long name that starts with _ like this. This requires changing the conformance2/glsl3/shader-with-1024-character-identifier.frag.html test because it does use a long name that starts with _a.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/compiler/translator/ParseContext.cpp at the linked long-name validation, then inspect conformance2/glsl3/shader-with-1024-character-identifier.frag.html and the configurable prefix in include/GLSLANG/ShaderLang.h. Update the validation and adjust the named conformance test so the expected behavior covers long names beginning with any underscore prefix.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers, testing
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100