private BoundConstantBuffer BindConstantBufferDeclaration(ConstantBufferSyntax declaration)
{
var constantBufferSymbol = new ConstantBufferSymbol(declaration, null);
var variables = new List<BoundMultipleVariableDeclarations>();
// Add constant buffer fields to global scope.
foreach (var field in declaration.Declarations)
{
var boundStatement = Bind(field, x => BindVariableDeclarationStatement(x, constantBufferSymbol));
variables.Add(boundStatement);
foreach (var boundDeclaration in boundStatement.VariableDeclarations)
constantBufferSymbol.AddMember(boundDeclaration.VariableSymbol);
}
return new BoundConstantBuffer(constantBufferSymbol, variables.ToImmutableArray());
}