Ejemplo n.º 1
0
 /// <summary>
 /// Switch the render target to fast memory on platform that have it and copies the content.
 /// </summary>
 /// <param name="cmd">Command buffer used for rendering.</param>
 /// <param name="residencyFraction">How much of the render target is to be switched into fast memory (between 0 and 1).</param>
 /// <param name="flags">Flag to determine what parts of the render target is spilled if not fully resident in fast memory.</param>
 public void CopyToFastMemory(CommandBuffer cmd,
                              float residencyFraction = 1.0f,
                              FastMemoryFlags flags   = FastMemoryFlags.SpillTop
                              )
 {
     SwitchToFastMemory(cmd, residencyFraction, flags, copyContents: true);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Switch the render target to fast memory on platform that have it.
        /// </summary>
        /// <param name="cmd">Command buffer used for rendering.</param>
        /// <param name="residencyFraction">How much of the render target is to be switched into fast memory (between 0 and 1).</param>
        /// <param name="flags">Flag to determine what parts of the render target is spilled if not fully resident in fast memory.</param>
        /// <param name="copyContents">Whether the content of render target are copied or not when switching to fast memory.</param>

        public void SwitchToFastMemory(CommandBuffer cmd,
                                       float residencyFraction = 1.0f,
                                       FastMemoryFlags flags   = FastMemoryFlags.SpillTop,
                                       bool copyContents       = false
                                       )
        {
            residencyFraction = Mathf.Clamp01(residencyFraction);
            cmd.SwitchIntoFastMemory(m_RT, flags, residencyFraction, copyContents);
        }
 public static void SwitchIntoFastMemory(this CommandBuffer cmd, RenderTargetIdentifier rid, FastMemoryFlags fastMemoryFlags, float residency, bool copyContents)
 {
     Internal_SwitchIntoFastMemory(cmd, ref rid, fastMemoryFlags, residency, copyContents);
 }
 private static extern void Internal_SwitchIntoFastMemory(CommandBuffer cmd, ref RenderTargetIdentifier rt, FastMemoryFlags fastMemoryFlags, float residency, bool copyContents);