示例#1
0
 public VarDecl(HLSLDeclaration decl, TextSpan loc)
 {
     varDeclaration = decl;
     varLocation = loc;
 }
示例#2
0
 //Adds a struct type and its members
 public void AddStructType(LexValue loc)
 {
     if (!shouldAddDeclarations())
     {
         return;
     }
     HLSLDeclaration structDecl = new HLSLDeclaration("struct", loc.str, GLYPHSTRUCT, loc.str);
     //            structDecls.Add(structDecl);
     //Need to keep this static member for the initial lex since the source hasn't been created yet,
     //but really only need it for the names, the sources still keep their own struct decls
     if(!structDecls.ContainsKey(loc.str))
         structDecls.Add(loc.str, new StructMembers(loc.str, tempMembers, structDecl));
     _source.structDecls.Add(loc.str, new StructMembers(loc.str, tempMembers, structDecl));
     tempMembers.Clear();
 }
示例#3
0
 public StructMembers(string name, List<HLSLDeclaration> members, HLSLDeclaration decl)
 {
     structName = name;
     structMembers = new List<HLSLDeclaration>(members);
     structDecl = decl;
 }
示例#4
0
 public void AddFunctionParamVar(LexValue varName, LexValue type, LexLocation loc)
 {
     if (!shouldAddDeclarations())
     {
         return;
     }
     HLSLDeclaration newDecl = new HLSLDeclaration(type.str, varName.str, GLYPHVARIABLE, varName.str);
     tempFunctionVars.Add(varName.str, new VarDecl(newDecl, MkTSpan(loc)));
 }
示例#5
0
 internal static void AddFloatProperty(this PropertyCollector collector, string referenceName, float defaultValue, HLSLDeclaration declarationType = HLSLDeclaration.DoNotDeclare)
 {
     collector.AddShaderProperty(new Vector1ShaderProperty
     {
         floatType = FloatType.Default,
         hidden    = true,
         overrideHLSLDeclaration = true,
         hlslDeclarationOverride = declarationType,
         value = defaultValue,
         overrideReferenceName = referenceName,
     });
 }
示例#6
0
        internal override void ForeachHLSLProperty(Action <HLSLProperty> action)
        {
            HLSLDeclaration decl = GetDefaultHLSLDeclaration();

            action(new HLSLProperty(HLSLType._float2, referenceName, decl, concretePrecision));
        }
 // Texture2D properties cannot be set via Hybrid path at the moment; disallow that choice
 internal override bool AllowHLSLDeclaration(HLSLDeclaration decl) => (decl != HLSLDeclaration.HybridPerInstance) && (decl != HLSLDeclaration.DoNotDeclare);
示例#8
0
 internal static void AddToggleProperty(this PropertyCollector collector, string referenceName, bool defaultValue, HLSLDeclaration declarationType = HLSLDeclaration.DoNotDeclare)
 {
     collector.AddShaderProperty(new BooleanShaderProperty
     {
         value  = defaultValue,
         hidden = true,
         overrideHLSLDeclaration = true,
         hlslDeclarationOverride = declarationType,
         displayName             = referenceName,
         overrideReferenceName   = referenceName,
     });
 }