private void BindConstantBufferDeclaration(ConstantBufferSyntax declaration) { // Add constant buffer fields to global scope. throw new NotImplementedException(); //foreach (var field in declaration.Declarations) // BindGlobalVariable(field); }
public override void VisitConstantBuffer(ConstantBufferSyntax node) { ProcessItem(node.Name, node.Name.Text, node.GetTextSpanSafe(), NavigateToItemKind.Structure, node.Parent, Glyph.ConstantBuffer); foreach (var member in node.Declarations) { Visit(member); } }
internal ConstantBufferSymbol(ConstantBufferSyntax syntax, Symbol parent) : base(SymbolKind.ConstantBuffer, syntax.Name.Text, string.Empty, parent) { Syntax = syntax; SourceTree = syntax.SyntaxTree; Locations = ImmutableArray.Create(syntax.Name.SourceRange); DeclaringSyntaxNodes = ImmutableArray.Create((SyntaxNodeBase)syntax); }
public override void VisitConstantBuffer(ConstantBufferSyntax node) { CreateTag( BlockSpanType.Type, node.Name, node.CloseBraceToken, node.ConstantBufferKeyword, node.Name, false); base.VisitConstantBuffer(node); }
private AnnotationShaderGroup UpdateVariables(SyntaxTree tree, ShaderType header) { // Probably should use a combined approach of the compiled shader with the source for annotations to get this info. // // because now it will also show unused buffers/variables // Also when you register buffers to the same slot and use only one, the shader will compile and work, but I don't have // any idea about which buffer I need to bind to the pipeline, so current solution show errorbox AnnotationFactory.Start(header); IList <SyntaxNodeBase> nodes = tree.Root.ChildNodes; List <string> registers = new List <string>(); foreach (SyntaxNodeBase node in nodes) { if (node is ConstantBufferSyntax) { ConstantBufferSyntax structType = (ConstantBufferSyntax)node; string register = structType.Register.Register.ValueText; AnnotationFactory.BeginGroup(); if (registers.Contains(register)) { MessageBox.Show($"Register: {register}\nDefined multiple times, ShaderBox can not decides which one needs to be binded.\n\nWill be resolved in a future release.", "Unsupported operation", MessageBoxButton.OK, MessageBoxImage.Error); AnnotationFactory.DestroyGroup(); return(null); } registers.Add(register); AnnotationFactory.SetRegister(register); foreach (VariableDeclarationStatementSyntax syntax in structType.Declarations) { if (!ParseVariableDeclarationStatementSyntax(syntax, registers)) { return(null); } } AnnotationFactory.EndGroup(); } if (node is VariableDeclarationStatementSyntax) { AnnotationFactory.BeginGroup(); if (!ParseVariableDeclarationStatementSyntax((VariableDeclarationStatementSyntax)node, registers)) { return(null); } AnnotationFactory.EndGroup(); } } return(AnnotationFactory.End()); }
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())); }
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()); }
public override void VisitConstantBuffer(ConstantBufferSyntax node) { CreateTag(node.Name, node.CloseBraceToken); }
public override void VisitConstantBuffer(ConstantBufferSyntax node) { CreateTag(node.Name, HlslClassificationTypeNames.ConstantBufferIdentifier); base.VisitConstantBuffer(node); }
public override IEnumerable <EditorNavigationTarget> VisitConstantBuffer(ConstantBufferSyntax node) { yield return(CreateTypeTarget(node.Name, node.GetTextSpanSafe(), Glyph.ConstantBuffer, node.Declarations.OfType <VariableDeclarationStatementSyntax>())); }
public override void VisitConstantBuffer(ConstantBufferSyntax node) { CreateTag(node.Name, _classificationService.ClassIdentifier); base.VisitConstantBuffer(node); }
public ConstantBufferSymbol GetDeclaredSymbol(ConstantBufferSyntax syntax) { var result = _bindingResult.GetBoundNode(syntax) as BoundConstantBuffer; return result?.ConstantBufferSymbol; }
internal ConstantBufferSymbol(ConstantBufferSyntax syntax, Symbol parent) : base(SymbolKind.ConstantBuffer, syntax.Name.Text, string.Empty, parent) { Syntax = syntax; }
public virtual void VisitConstantBuffer(ConstantBufferSyntax node) { DefaultVisit(node); }
public ConstantBufferSymbol GetDeclaredSymbol(ConstantBufferSyntax syntax) { var result = _bindingResult.GetBoundNode(syntax) as BoundConstantBuffer; return(result?.ConstantBufferSymbol); }
public override void VisitConstantBuffer(ConstantBufferSyntax node) { ProcessItem(node.Name, node.Name.Text, node.GetTextSpanSafe(), NavigateToItemKind.Structure, node.Parent, Glyph.ConstantBuffer); foreach (var member in node.Declarations) Visit(member); }