Exemplo n.º 1
0
        private bool CompiledEffect(FileInfo effectFile)
        {
            List <EP>      entryPoints = new List <EP>();
            string         rootPath    = effectFile.DirectoryName;
            EntryPointType nextInstructionEntryPoint = EntryPointType.None;

            //Open file and extract all Entry points
            using (TextReader reader = effectFile.OpenText())
            {
                string line = null;
                while ((line = reader.ReadLine()) != null)
                {
                    if (line.Contains("ENTRY POINT]"))
                    {
                        switch (line.Substring(3, 2))
                        {
                        case "VS":
                            nextInstructionEntryPoint = EntryPointType.vs;
                            break;

                        case "GS":
                            nextInstructionEntryPoint = EntryPointType.gs;
                            break;

                        case "PS":
                            nextInstructionEntryPoint = EntryPointType.ps;
                            break;

                        default:
                            break;
                        }
                        continue;
                    }

                    if (nextInstructionEntryPoint != EntryPointType.None)
                    {
                        string entryPoint = CheckForEntryPoint(line);
                        if (entryPoint != null)
                        {
                            entryPoints.Add(new EP()
                            {
                                Name = entryPoint, Type = nextInstructionEntryPoint
                            });
                            nextInstructionEntryPoint = EntryPointType.None;
                        }
                    }
                }
            }

            //Do compilation
            foreach (EP entryPoint in entryPoints)
            {
                CompileEffect(effectFile, entryPoint);
            }

            return(entryPoints.Count > 0);
        }
Exemplo n.º 2
0
 internal override IEntryPointTranslator GetEntryPoinTranslator(EntryPointType type)
 {
     if (_epTranslators.TryGetValue(type, out IEntryPointTranslator translator))
     {
         return(translator);
     }
     else
     {
         return(null);
     }
 }
            private static EntrypointAndType GetCodepackageEntrypointToRestart(RestartDeployedCodePackageAction action, DeployedCodePackage codepackage)
            {
                if (codepackage == null ||
                    (codepackage.EntryPoint == null &&
                     codepackage.SetupEntryPoint == null))
                {
                    throw new FabricException(
                              StringHelper.Format(StringResources.Error_CodePackageNotDeployedOnNode, action.ApplicationName, action.CodePackageName, action.NodeName),
                              FabricErrorCode.CodePackageNotFound);
                }

                CodePackageEntryPoint restartedEntryPoint     = null;
                EntryPointType        restartedEntryPointType = EntryPointType.None;

                if (codepackage.EntryPoint != null && codepackage.EntryPoint.EntryPointStatus == EntryPointStatus.Started)
                {
                    restartedEntryPoint     = codepackage.EntryPoint;
                    restartedEntryPointType = EntryPointType.Main;
                }
                else if (codepackage.SetupEntryPoint != null && codepackage.SetupEntryPoint.EntryPointStatus == EntryPointStatus.Started)
                {
                    restartedEntryPoint     = codepackage.SetupEntryPoint;
                    restartedEntryPointType = EntryPointType.Setup;
                }

                if (restartedEntryPoint == null || restartedEntryPointType == EntryPointType.None)
                {
                    throw new InvalidOperationException(StringResources.Error_CodePackageCannotBeRestarted);
                }

                if (action.CodePackageInstanceId != 0 && restartedEntryPoint.CodePackageInstanceId != action.CodePackageInstanceId)
                {
                    throw new FabricException(StringResources.Error_InstanceIdMismatch, FabricErrorCode.InstanceIdMismatch);
                }

                return(new EntrypointAndType(restartedEntryPoint, restartedEntryPointType));
            }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a new instance of <see cref="RegisterAttribute"/>.
 /// </summary>
 /// <param name="slot"></param>
 /// <param name="entryPoint">The target shader profile of the register.</param>
 /// <param name="model">The target shader model of the register.</param>
 public RegisterAttribute(uint slot, EntryPointType entryPoint = EntryPointType.AnyOrNone, ShaderModel model = ShaderModel.SM_5_0)
 {
     Slot  = slot;
     Model = ShaderModel.SM_5_0;
     ApplicableEntryPoint = EntryPointType.AnyOrNone;
 }
Exemplo n.º 5
0
 internal override IEntryPointTranslator GetEntryPoinTranslator(EntryPointType type)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 6
0
 public EntryPointAttribute(EntryPointType type)
 {
     Type = type;
 }
Exemplo n.º 7
0
 public BindPointInfo(ShaderModel model, EntryPointType epType, int bindPoint)
 {
     Model      = model;
     EntryPoint = epType;
     BindPoint  = bindPoint;
 }
Exemplo n.º 8
0
 public EntryPoint(IFileInfo file, EntryPointType type)
 {
     File = file;
     Type = type;
 }
Exemplo n.º 9
0
 internal abstract IEntryPointTranslator GetEntryPoinTranslator(EntryPointType type);
 public EntrypointAndType(CodePackageEntryPoint entryPoint, EntryPointType entryPointType)
 {
     this.EntryPoint     = entryPoint;
     this.EntryPointType = entryPointType;
 }