Esempio n. 1
0
        public GraphicsFence CreateGraphicsFence(GraphicsFenceType fenceType, SynchronisationStageFlags stage)
        {
            GraphicsFence newFence = new GraphicsFence();

            newFence.m_Ptr = CreateGPUFence_Internal(fenceType, stage);
            newFence.InitPostAllocation();
            newFence.Validate();
            return(newFence);
        }
Esempio n. 2
0
    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();
    }
Esempio n. 3
0
        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);
            }
        }
Esempio n. 5
0
 public void WaitOnAsyncGraphicsFence(GraphicsFence fence, SynchronisationStage stage)
 {
     WaitOnAsyncGraphicsFence(fence, GraphicsFence.TranslateSynchronizationStageToFlags(stage));
 }
Esempio n. 6
0
 public void WaitOnAsyncGraphicsFence(GraphicsFence fence)
 {
     WaitOnAsyncGraphicsFence(fence, SynchronisationStage.VertexProcessing);
 }
Esempio n. 7
0
 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));
        }