Exemplo n.º 1
0
 public static IKernel CompileClKernel(string sourceFileName, string entryPoint, string options = null)
 {
     return(Cache <IKernel> .AddCompiled(sourceFileName,
                                         String.Format("\"{0}\" /E {1} /Opts {2}", GetRelative(sourceFileName), entryPoint, options),
                                         () => Renderer.CompileClKernel(sourceFileName, entryPoint, options),
                                         null));
 }
Exemplo n.º 2
0
        public static IShader11 CompileShader11(string shaderFileName, string profile, string entryPoint = "main", string macroDefinitions = null)
        {
            var result = Cache <IShader11> .AddCompiled(shaderFileName,
                                                        String.Format("\"{0}\" /E {1} /T {2} /D {3}", GetRelative(shaderFileName), entryPoint, profile, macroDefinitions),
                                                        () => Renderer.CompileShader11(shaderFileName, entryPoint, profile, macroDefinitions),
                                                        Renderer.LoadShader11);

            Cache <IShader11> .Save(ShaderCachePath);

            return(result);
        }