Inheritance: ContainerSymbol
Esempio n. 1
0
        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());
        }
Esempio n. 2
0
 public BoundConstantBuffer(ConstantBufferSymbol constantBufferSymbol, ImmutableArray<BoundMultipleVariableDeclarations> variables)
     : base(BoundNodeKind.ConstantBuffer)
 {
     ConstantBufferSymbol = constantBufferSymbol;
     Variables = variables;
 }