当前位置: 首页>>代码示例>>C#>>正文


C# DeviceContext.End方法代码示例

本文整理汇总了C#中DeviceContext.End方法的典型用法代码示例。如果您正苦于以下问题:C# DeviceContext.End方法的具体用法?C# DeviceContext.End怎么用?C# DeviceContext.End使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DeviceContext的用法示例。


在下文中一共展示了DeviceContext.End方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: End

 public void End(DeviceContext context)
 {
     context.End(queryTimeStampEnd);
     context.End(queryTimeStampDisjoint);
 }
开发者ID:MaybeMars,项目名称:SharpDX-Samples,代码行数:5,代码来源:GPUProfiler.cs

示例2: Begin

 public void Begin(DeviceContext context)
 {
     context.Begin(queryTimeStampDisjoint);
     context.End(queryTimeStampStart);
 }
开发者ID:MaybeMars,项目名称:SharpDX-Samples,代码行数:5,代码来源:GPUProfiler.cs

示例3: BeginProfilePoint

        public static void BeginProfilePoint(DeviceContext context, String profilePointName)
        {
            context.End(m_HWQueries[m_CurrentQuery]);
            m_HWQueriesDescs[m_CurrentQuery] = profilePointName;
            m_QueriesStack.Push(m_CurrentQuery);

            IncrementCurrentQuery();
        }
开发者ID:shoff,项目名称:CSharpRenderer,代码行数:8,代码来源:GPUProfiler.cs

示例4: EndProfilePoint

 public static void EndProfilePoint(DeviceContext context)
 {
     context.End(m_HWQueries[m_CurrentQuery]);
     int beginQuery = m_QueriesStack.Pop();
     m_CorrespondingQueryEnds[beginQuery] = m_CurrentQuery;
     IncrementCurrentQuery();
 }
开发者ID:shoff,项目名称:CSharpRenderer,代码行数:7,代码来源:GPUProfiler.cs

示例5: EndFrameProfiling

        public static void EndFrameProfiling(DeviceContext context)
        {
            PendingFrameQueries pendingFrame = new PendingFrameQueries();

            pendingFrame.m_DisjointQueryId = m_CurrentDisjointQuery;
            pendingFrame.m_BeginQuery = m_CurrentFrameFirstQuery;
            pendingFrame.m_EndQuery = m_CurrentQuery;

            EndProfilePoint(context);

            if(m_QueriesStack.Count != 0)
            {
                throw new Exception("Wrong profile point count! Did you forget about EndProfilePoint?");
            }

            context.End(m_DisjointQueries[m_CurrentDisjointQuery]);

            m_PendingFrames.Enqueue(pendingFrame);

            IncrementCurrentDisjointQuery();
            
            // Time to fetch prev frames!
            if (m_PendingFrames.Count > 4)
            {
                pendingFrame = m_PendingFrames.Dequeue();
                TimestampQueryData disjointData = context.GetData<TimestampQueryData>(m_DisjointQueries[pendingFrame.m_DisjointQueryId]);
                ProfilerTreeMember parent = new ProfilerTreeMember();
                ProfilerTreeMember frameParent = parent;

                for (int queryIterator = pendingFrame.m_BeginQuery; queryIterator != (pendingFrame.m_EndQuery + 1) % MAX_HW_QUERIES; queryIterator = (queryIterator + 1) % MAX_HW_QUERIES)
                {
                    if (m_CorrespondingQueryEnds[queryIterator] != Int32.MaxValue)
                    {
                        var profilerObject = new ProfilerTreeMember();
                        int correspondingEnd = m_CorrespondingQueryEnds[queryIterator];
                        long beginProfilePointData = context.GetData<long>(m_HWQueries[queryIterator]);
                        long endProfilePointData = context.GetData<long>(m_HWQueries[correspondingEnd]);

                        profilerObject.m_Time = (double)(endProfilePointData - beginProfilePointData) / (double)disjointData.Frequency * 1000.0;
                        profilerObject.m_Name = m_HWQueriesDescs[queryIterator];
                        profilerObject.m_Parent = parent;

                        parent.m_ChildMembers.Add(profilerObject);
                        parent = profilerObject;
                    }
                    else
                    {
                        parent = parent.m_Parent;
                        if (parent == null)
                        {
                            throw new Exception("Error while constructing profiler tree");
                        }
                    }
                }
                if (frameParent.m_ChildMembers.Count < 1)
                {
                    throw new Exception("Error while constructing profiler tree");
                }

                m_CurrentFrameProfilerTree = frameParent.m_ChildMembers[0];
            }
        }
开发者ID:shoff,项目名称:CSharpRenderer,代码行数:62,代码来源:GPUProfiler.cs


注:本文中的DeviceContext.End方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。