HLSL: allow keyword-identifiers as cbuffer/struct names.

Issue #791 was partially fixed by PR #1161 (the mat mul implicit
truncations were its main point), but it still wouldn't compile due to
the use of ConstantBuffer as an identifier.  Apparently those fall into
the same class as "float float", where float is both a type and an
identifier.

This allows struct definitions with such keyword-identifiers,
and adds ConstantBuffer to the set.  'cbuffer int' is legal in HLSL,
and 'struct int' appears to only be rejected due to the redefinition
of the 'int' type.

Fixes #791
This commit is contained in:
LoopDawg
2017-11-27 14:45:36 -07:00
parent 792a94809b
commit 7ee29ba730
4 changed files with 460 additions and 3 deletions

View File

@@ -108,6 +108,7 @@ INSTANTIATE_TEST_CASE_P(
{"hlsl.calculatelod.dx10.frag", "main"},
{"hlsl.calculatelodunclamped.dx10.frag", "main"},
{"hlsl.cast.frag", "PixelShaderFunction"},
{"hlsl.cbuffer-identifier.vert", "main"},
{"hlsl.charLit.vert", "main"},
{"hlsl.clip.frag", "main"},
{"hlsl.clipdistance-1.frag", "main"},