mirror of
https://github.com/RPCS3/glslang.git
synced 2024-12-03 16:41:30 +00:00
a64ed3eba0
Unlike other qualifiers, HLSL allows "sample" to be either a qualifier keyword or an identifier (e.g, a variable or function name). A fix to allow this was made a while ago, but that fix was insufficient when 'sample' was used in an expression. The problem was around the initial ambiguity between: sample float a; // "sample" is part of a fully specified type and sample.xyz; // sample is a keyword in a dot expression Both start the same. The "sample" was being accepted as a qualifier before enough further parsing was done to determine we were not a declaration after all. This consumed the token, causing it to fail for its real purpose. Now, when accepting a fully specified type, the token is pushed back onto the stack if the thing is not a fully specified type. This leaves it available for subsequent purposes. Changed the "hlsl.identifier.sample.frag" test to exercise this situation, distilled down from a production shaders. |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
hlslAttributes.cpp | ||
hlslAttributes.h | ||
hlslGrammar.cpp | ||
hlslGrammar.h | ||
hlslOpMap.cpp | ||
hlslOpMap.h | ||
hlslParseables.cpp | ||
hlslParseables.h | ||
hlslParseHelper.cpp | ||
hlslParseHelper.h | ||
hlslScanContext.cpp | ||
hlslScanContext.h | ||
hlslTokens.h | ||
hlslTokenStream.cpp | ||
hlslTokenStream.h |