public GraphicsFence CreateGraphicsFence(GraphicsFenceType fenceType, SynchronisationStageFlags stage) { GraphicsFence newFence = new GraphicsFence(); newFence.m_Ptr = CreateGPUFence_Internal(fenceType, stage); newFence.InitPostAllocation(); newFence.Validate(); return(newFence); }
public void SyncTasks() { //Debug.Log($"Syncing {currentTasksCount} tasks."); // Create GPU Fence UnityEngine.Rendering.GraphicsFence fence = Graphics.CreateAsyncGraphicsFence(); fenceCBs.AddLast(new KeyValuePair <UnityEngine.Rendering.GraphicsFence, LinkedList <ChunkRenderer_GPUComputeMesh> >(fence, tmp)); ResetQueue(); }
public void WaitOnAsyncGraphicsFence(GraphicsFence fence, SynchronisationStageFlags stage) { if (fence.m_FenceType != GraphicsFenceType.AsyncQueueSynchronisation) { throw new ArgumentException("Attempting to call WaitOnAsyncGPUFence on a fence that is not of GraphicsFenceType.AsyncQueueSynchronization"); } fence.Validate(); //Don't wait on a fence that's already known to have passed if (fence.IsFencePending()) { WaitOnGPUFence_Internal(fence.m_Ptr, stage); } }
internal void InitPostAllocation() { bool flag = this.m_Ptr == IntPtr.Zero; if (flag) { bool supportsGraphicsFence = SystemInfo.supportsGraphicsFence; if (supportsGraphicsFence) { throw new NullReferenceException("The internal fence ptr is null, this should not be possible for fences that have been correctly constructed using Graphics.CreateGraphicsFence() or CommandBuffer.CreateGraphicsFence()"); } this.m_Version = this.GetPlatformNotSupportedVersion(); } else { this.m_Version = GraphicsFence.GetVersionNumber(this.m_Ptr); } }
public void WaitOnAsyncGraphicsFence(GraphicsFence fence, SynchronisationStage stage) { WaitOnAsyncGraphicsFence(fence, GraphicsFence.TranslateSynchronizationStageToFlags(stage)); }
public void WaitOnAsyncGraphicsFence(GraphicsFence fence) { WaitOnAsyncGraphicsFence(fence, SynchronisationStage.VertexProcessing); }
public GraphicsFence CreateAsyncGraphicsFence(SynchronisationStage stage) { return(CreateGraphicsFence(GraphicsFenceType.AsyncQueueSynchronisation, GraphicsFence.TranslateSynchronizationStageToFlags(stage))); }
internal bool IsFencePending() { bool flag = this.m_Ptr == IntPtr.Zero; return(!flag && this.m_Version == GraphicsFence.GetVersionNumber(this.m_Ptr)); }