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

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

            markup.AppendName(SymbolMarkupKind.ConstantBufferVariableName, symbol.Name);
        }
Esempio n. 4
0
 public BoundConstantBuffer(ConstantBufferSymbol constantBufferSymbol, ImmutableArray <BoundMultipleVariableDeclarations> variables)
     : base(BoundNodeKind.ConstantBuffer)
 {
     ConstantBufferSymbol = constantBufferSymbol;
     Variables            = variables;
 }
Esempio n. 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);
        }