glslang-zig/hlsl
steve-lunarg 5ca85ad9de HLSL: allow scalar type keywords as identifiers, and add half type support.
HLSL allows type keywords to also be identifiers, so a sequence such as "float half = 3" is
valid, or more bizzarely, something like "float.float = int.uint + bool;"

There are places this is not supported.  E.g, it's permitted for struct members, but not struct
names or functions.  Also, vector or matrix types such as "float3" are not permitted as
identifiers.

This PR adds that support, as well as support for the "half" type.  In production shaders,
this was seen with variables named "half".  The PR attempts to support this without breaking
useful grammar errors such as "; expected" at the end of unterminated statements, so it errs
on that side at the possible expense of failing to accept valid constructs containing a type
keyword identifier.  If others are discovered, they can be added.

Also, half is now accepted as a valid type, alongside the min*float types.
2016-12-27 11:26:45 -07:00
..
CMakeLists.txt HLSL: implement numthreads for compute shaders 2016-10-31 09:28:17 -06:00
hlslAttributes.cpp WIP: HLSL: Add GS support 2016-11-21 18:25:08 -07:00
hlslAttributes.h WIP: HLSL: Add GS support 2016-11-21 18:25:08 -07:00
hlslGrammar.cpp HLSL: allow scalar type keywords as identifiers, and add half type support. 2016-12-27 11:26:45 -07:00
hlslGrammar.h WIP: HLSL: Add GS support 2016-11-21 18:25:08 -07:00
hlslOpMap.cpp HLSL: Basic array grammar. 2016-06-19 11:50:34 -06:00
hlslOpMap.h HLSL: Add (almost) full expression grammar: Binary, unary (pre/post-fix), assign, ... 2016-05-03 23:33:00 -06:00
hlslParseables.cpp HLSL: add intrinsic function implicit promotions 2016-11-23 10:36:34 -07:00
hlslParseables.h Add lerp, fix sincos return type, ret type tests, non-square mats, HLSL->AST tx semantics 2016-06-21 10:10:48 -06:00
hlslParseHelper.cpp HLSL: More robust handling of bad shader input, catching a few more things. 2016-12-14 17:02:32 -07:00
hlslParseHelper.h Fix a large number of warnings about inconsistent usage of 'override' produced by clang 2016-12-21 12:48:08 +01:00
hlslScanContext.cpp HLSL: allow scalar type keywords as identifiers, and add half type support. 2016-12-27 11:26:45 -07:00
hlslScanContext.h HLSL: Implement basic "struct" grammar. 2016-06-12 23:54:31 -06:00
hlslTokens.h HLSL: allow scalar type keywords as identifiers, and add half type support. 2016-12-27 11:26:45 -07:00
hlslTokenStream.cpp HLSL: Fix a grammar error related to constructors in parenthetical expressions 2016-07-30 08:09:09 -06:00
hlslTokenStream.h HLSL: Fix a grammar error related to constructors in parenthetical expressions 2016-07-30 08:09:09 -06:00