internal static CachedBinaryShaderIO GetCurrentImpl() { if (s_currentImpl != null) { return(s_currentImpl); } else if (s_currentBinShaderIODel != null) { return(s_currentImpl = s_currentBinShaderIODel()); } else { return(null); } }
protected bool LoadCompiledShader(string filename) { if (!EnableProgramBinaryCache) { return(false); } //-------------------------------------------- using (System.IO.Stream s = CachedBinaryShaderIO.InternalGetReadStream(filename)) { if (s != null) { using (System.IO.BinaryReader r = new System.IO.BinaryReader(s)) { return(_shaderProgram.LoadCompiledShader(r)); } } } return(false); }
protected bool SaveCompiledShader(string filename) { if (!EnableProgramBinaryCache) { return(false); } //-------------------------------------------- using (System.IO.Stream s = CachedBinaryShaderIO.InternalGetWriteStream(filename)) { if (s != null) { using (System.IO.BinaryWriter w = new System.IO.BinaryWriter(s)) { return(_shaderProgram.SaveCompiledShader(w)); } } } return(false); }
public static void ClearCurrentImpl() { s_currentImpl = null; }
public static void SetActualImpl(CachedBinaryShaderIO currentBinShaderIO) { s_currentImpl = currentBinShaderIO; }