Esempio n. 1
0
 /// <summary>
 /// \see <see cref="Compile"/>
 /// </summary>
 public CompileResult Compile(Stream source, Stage stage, CompileOptions options, string name, string entryPoint = "main")
 {
     using (StreamReader sr = new StreamReader(source))
     {
         return(Compile(sr.ReadToEnd(), stage, options, name, entryPoint));
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Compile a given source to spirv bytecode
        /// </summary>
        /// <param name="source">The source string of the shader</param>
        /// <param name="stage">The stage in the pipeline</param>
        /// <param name="options">The compile options</param>
        /// <param name="name">The name of the shader that will be used for include directives</param>
        /// <param name="entryPoint">The name of the entry point</param>
        /// <returns>The result</returns>
        public CompileResult Compile(string source, Stage stage, CompileOptions options, string name, string entryPoint = "main")
        {
            IntPtr resultPtr = ShadercNative.shaderc_compile_into_spv(_handle, source, new UIntPtr((uint)source.Length), (int)stage, name, entryPoint, options.NativeHandle);

            return(new CompileResult(resultPtr));
        }