Exemplo n.º 1
0
 internal void Initialize(TranslationRunner runner, ShaderLanguage language, List <string> preprocessorSymbols, TranslationFlags flags)
 {
     Flags        = flags;
     Runner       = runner;
     Language     = language;
     ParseOptions = new CSharpParseOptions(LanguageVersion.CSharp7_3, DocumentationMode.Parse, SourceCodeKind.Regular, preprocessorSymbols);
 }
Exemplo n.º 2
0
        private void SpawnDomain()
        {
            int id = Interlocked.Increment(ref _nextDomainID);

            _domain = AppDomain.CreateDomain($"{_domainName}_{id}");

            foreach (ShaderType.SupportedNamespace sn in ShaderType.SupportedNamespaces)
            {
                foreach (AssemblyName aName in sn.Assemblies)
                {
                    _domain.Load(aName);
                }
            }

            Type t = typeof(TranslationRunner);

            _runner = (TranslationRunner)_domain.CreateInstanceAndUnwrap(t.Assembly.FullName, t.FullName, false,
                                                                         BindingFlags.NonPublic | BindingFlags.Instance, null, null, CultureInfo.InvariantCulture, null);
        }