Пример #1
0
 internal static CachedBinaryShaderIO GetCurrentImpl()
 {
     if (s_currentImpl != null)
     {
         return(s_currentImpl);
     }
     else if (s_currentBinShaderIODel != null)
     {
         return(s_currentImpl = s_currentBinShaderIODel());
     }
     else
     {
         return(null);
     }
 }
Пример #2
0
 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);
 }
Пример #3
0
        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);
        }
Пример #4
0
 public static void ClearCurrentImpl()
 {
     s_currentImpl = null;
 }
Пример #5
0
 public static void SetActualImpl(CachedBinaryShaderIO currentBinShaderIO)
 {
     s_currentImpl = currentBinShaderIO;
 }