public ShanqQueryExecutor(ExecutionModel model, Stream outputStream, IVectorTypeLibrary vectorLibrary, string entryPointName) { this.model = model; this.outputStream = outputStream; this.vectorLibrary = vectorLibrary; this.entryPointName = entryPointName; }
private static ShaderModule CreateModule <TOutput>(Device device, IVectorTypeLibrary vectorLibrary, ExecutionModel model, Func <IShanqFactory, IQueryable <TOutput> > shaderFunction) { var shaderStream = new MemoryStream(); Create(model, shaderStream, vectorLibrary, shaderFunction); int shaderLength = (int)shaderStream.Length; var shaderBytes = shaderStream.GetBuffer(); var shaderData = LoadShaderData(shaderBytes, shaderLength); return(device.CreateShaderModule(shaderLength, shaderData)); }
public ShanqExpressionVisitor(SpirvFile file, IVectorTypeLibrary vectorLibrary) { var visitMethods = this.GetType() .GetMethods(BindingFlags.NonPublic | BindingFlags.Instance) .Where(method => method.GetCustomAttribute <NodeTypeAttribute>() != null); foreach (var method in visitMethods) { var attribute = method.GetCustomAttribute <NodeTypeAttribute>(); this.expressionVisitors.Add(attribute.NodeType, x => (ResultId)method.Invoke(this, new object[] { x })); } this.file = file; this.vectorLibrary = vectorLibrary; }
public static ShaderModule CreateFragmentModule <TOutput>(Device device, IVectorTypeLibrary vectorLibrary, Func <IShanqFactory, IQueryable <TOutput> > shaderFunction) { return(CreateModule(device, vectorLibrary, ExecutionModel.Fragment, shaderFunction)); }
public static void CreateFragment <TOutput>(Stream outputStream, IVectorTypeLibrary vectorLibrary, Func <IShanqFactory, IQueryable <TOutput> > shaderFunction) { Create(ExecutionModel.Fragment, outputStream, vectorLibrary, shaderFunction); }
public static void Create <TOutput>(ExecutionModel model, Stream outputStream, IVectorTypeLibrary vectorLibrary, Func <IShanqFactory, IQueryable <TOutput> > shaderFunction) { var factory = new ShanqFactory(model, outputStream, vectorLibrary); shaderFunction(factory).ToArray(); }
public ShanqFactory(ExecutionModel model, Stream outputStream, IVectorTypeLibrary vectorLibrary) { this.executor = new ShanqQueryExecutor(model, outputStream, vectorLibrary); }
public static ShaderModule CreateVertexModule <TOutput>(Device device, IVectorTypeLibrary vectorLibrary, Func <IShanqFactory, IQueryable <TOutput> > shaderFunction, string entryPointName = DefaultModuleEntryPoint) { return(CreateModule(device, vectorLibrary, ExecutionModel.Vertex, shaderFunction)); }
public static void CreateFragment <TOutput>(Stream outputStream, IVectorTypeLibrary vectorLibrary, Func <IShanqFactory, IQueryable <TOutput> > shaderFunction, string entryPointName = DefaultModuleEntryPoint) { Create(ExecutionModel.Fragment, outputStream, vectorLibrary, shaderFunction); }
public static void Create <TOutput>(ExecutionModel model, Stream outputStream, IVectorTypeLibrary vectorLibrary, Func <IShanqFactory, IQueryable <TOutput> > shaderFunction, string entryPointName = DefaultModuleEntryPoint) { var factory = new ShanqFactory(model, outputStream, vectorLibrary, entryPointName); shaderFunction(factory).ToArray(); }
public ShanqFactory(ExecutionModel model, Stream outputStream, IVectorTypeLibrary vectorLibrary, string entryPointName) { this.executor = new ShanqQueryExecutor(model, outputStream, vectorLibrary, entryPointName); }
public ShanqQueryExecutor(ExecutionModel model, Stream outputStream, IVectorTypeLibrary vectorLibrary) { this.model = model; this.outputStream = outputStream; this.vectorLibrary = vectorLibrary; }