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); }
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)); }
/// <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; }
internal override IEntryPointTranslator GetEntryPoinTranslator(EntryPointType type) { throw new NotImplementedException(); }
public EntryPointAttribute(EntryPointType type) { Type = type; }
public BindPointInfo(ShaderModel model, EntryPointType epType, int bindPoint) { Model = model; EntryPoint = epType; BindPoint = bindPoint; }
public EntryPoint(IFileInfo file, EntryPointType type) { File = file; Type = type; }
internal abstract IEntryPointTranslator GetEntryPoinTranslator(EntryPointType type);
public EntrypointAndType(CodePackageEntryPoint entryPoint, EntryPointType entryPointType) { this.EntryPoint = entryPoint; this.EntryPointType = entryPointType; }