HLSL: Fix #1203: Declare anonymous members for cbuffer with no ';'

The grammar for no semicolon and no object name for cbuffer/tbuffer
was correct, but the production still skipped the anonymous declarations
if an identifier followed.
This commit is contained in:
John Kessenich
2018-01-02 11:27:54 -07:00
parent fd1e8a78a8
commit 132cf53737
4 changed files with 271 additions and 207 deletions

View File

@@ -31,7 +31,17 @@ float foo() // float looks like identifier, but can't be part of tbuffer
return 1.0;
}
float4 PixelShaderFunction(float4 input : SV_POSITION) : SV_TARGET0
{
return (input + v1 + v2 + v3 + v4) * foo();
struct id {
float4 a;
};
cbuffer cbufName2 {
float4 v24;
}
id PixelShaderFunction(float4 input : SV_POSITION) : SV_TARGET0 // id looks like id for cbuffer name, but can't be
{
id ret;
ret.a = v24 + (input + v1 + v2 + v3 + v4) * foo();
return ret;
}