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()));
        }
Exemple #2
0
        private static void AppendConstantBuffer(this ICollection <SymbolMarkupToken> markup, ConstantBufferSymbol symbol)
        {
            markup.AppendPlainText("(constant buffer)");
            markup.AppendSpace();

            markup.AppendName(SymbolMarkupKind.ConstantBufferVariableName, symbol.Name);
        }
        private static void AppendConstantBuffer(this ICollection<SymbolMarkupToken> markup, ConstantBufferSymbol symbol)
        {
            markup.AppendPlainText("(constant buffer)");
            markup.AppendSpace();

            markup.AppendName(SymbolMarkupKind.ConstantBufferVariableName, symbol.Name);
        }
 public BoundConstantBuffer(ConstantBufferSymbol constantBufferSymbol, ImmutableArray <BoundMultipleVariableDeclarations> variables)
     : base(BoundNodeKind.ConstantBuffer)
 {
     ConstantBufferSymbol = constantBufferSymbol;
     Variables            = variables;
 }
Exemple #5
0
        private static void AppendConstantBuffer(this ICollection <SymbolMarkupToken> markup, ConstantBufferSymbol symbol, SymbolDisplayFormat format)
        {
            if (format == SymbolDisplayFormat.QuickInfo)
            {
                markup.AppendPlainText("(constant buffer)");
                markup.AppendSpace();
            }

            markup.AppendName(SymbolMarkupKind.ConstantBufferVariableName, symbol.Name);
        }