/// <summary> /// \see <see cref="Assemble"/> /// </summary> public CompileResult Assemble(Stream source, Stage stage, CompileOptions options, string name, string entryPoint = "main") { using (StreamReader sr = new StreamReader(source)) { return(Preprocess(sr.ReadToEnd(), stage, options, name, entryPoint)); } }
/// <summary> /// Similar to Compile, but instead of spv bytecode returns the preprocessed shader /// </summary> /// <param name="source"></param> /// <param name="stage"></param> /// <param name="options"></param> /// <param name="name"></param> /// <param name="entryPoint"></param> /// <returns></returns> public CompileResult Preprocess(string source, Stage stage, CompileOptions options, string name, string entryPoint = "main") { IntPtr resultPtr = ShadercNative.shaderc_compile_into_preprocessed_text(_handle, source, new UIntPtr((uint)source.Length), (int)stage, name, entryPoint, options.NativeHandle); return(new CompileResult(resultPtr)); }