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.
diff --git a/Test/hlsl.buffer.frag b/Test/hlsl.buffer.frag
index 520de09..73f42e8 100644
--- a/Test/hlsl.buffer.frag
+++ b/Test/hlsl.buffer.frag
@@ -31,7 +31,17 @@
return 1.0;
}
-float4 PixelShaderFunction(float4 input : SV_POSITION) : SV_TARGET0
+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
{
- return (input + v1 + v2 + v3 + v4) * foo();
+ id ret;
+ ret.a = v24 + (input + v1 + v2 + v3 + v4) * foo();
+ return ret;
}