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


C# FetchDrawcall.GetColor方法代码示例

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


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

示例1: AddDrawcall

        private TreelistView.Node AddDrawcall(FetchDrawcall drawcall, TreelistView.Node root)
        {
            if (m_Core.Config.EventBrowser_HideEmpty)
            {
                if ((drawcall.children == null || drawcall.children.Length == 0) && (drawcall.flags & DrawcallFlags.PushMarker) != 0)
                    return null;
            }

            UInt32 eventNum = drawcall.eventID;
            TreelistView.Node drawNode = null;

            if(drawcall.children.Length > 0)
                drawNode = MakeNode(eventNum, GetEndEventID(drawcall), drawcall.drawcallID, GetEndDrawID(drawcall), drawcall.name, 0.0);
            else
                drawNode = MakeNode(eventNum, drawcall.drawcallID, drawcall.name, 0.0);

            if (m_Core.Config.EventBrowser_ApplyColours)
            {
                // if alpha isn't 0, assume the colour is valid
                if ((drawcall.flags & (DrawcallFlags.PushMarker | DrawcallFlags.SetMarker)) > 0 && drawcall.markerColour[3] > 0.0f)
                {
                    float red = drawcall.markerColour[0];
                    float green = drawcall.markerColour[1];
                    float blue = drawcall.markerColour[2];
                    float alpha = drawcall.markerColour[3];

                    drawNode.TreeLineColor = drawcall.GetColor();
                    drawNode.TreeLineWidth = 3.0f;

                    if (m_Core.Config.EventBrowser_ColourEventRow)
                    {
                        drawNode.BackColor = drawcall.GetColor();
                        drawNode.ForeColor = drawcall.GetTextColor(eventView.ForeColor);
                    }
                }
            }

            DeferredEvent def = new DeferredEvent();
            def.eventID = eventNum;
            def.marker = (drawcall.flags & DrawcallFlags.SetMarker) != 0;

            drawNode.Tag = def;

            if (drawcall.children != null && drawcall.children.Length > 0)
            {
                for (int i = 0; i < drawcall.children.Length; i++)
                {
                    AddDrawcall(drawcall.children[i], drawNode);

                    if (i > 0 && drawNode.Nodes.Count >= 2 &&
                        (drawcall.children[i - 1].flags & DrawcallFlags.SetMarker) > 0)
                    {
                        DeferredEvent markerTag = drawNode.Nodes[drawNode.Nodes.Count - 2].Tag as DeferredEvent;
                        DeferredEvent drawTag = drawNode.Nodes.LastNode.Tag as DeferredEvent;
                        markerTag.eventID = drawTag.eventID;
                    }
                }

                bool found = false;

                for (int i = drawNode.Nodes.Count - 1; i >= 0; i--)
                {
                    DeferredEvent t = drawNode.Nodes[i].Tag as DeferredEvent;
                    if (t != null && !t.marker)
                    {
                        drawNode.Tag = drawNode.Nodes[i].Tag;
                        found = true;
                        break;
                    }
                }

                if (!found && !drawNode.Nodes.IsEmpty())
                    drawNode.Tag = drawNode.Nodes.LastNode.Tag;
            }

            if (drawNode.Nodes.IsEmpty() && (drawcall.flags & DrawcallFlags.PushMarker) != 0 && m_Core.Config.EventBrowser_HideEmpty)
                return null;

            root.Nodes.Add(drawNode);

            return drawNode;
        }
开发者ID:Nexuapex,项目名称:renderdoc,代码行数:82,代码来源:EventBrowser.cs

示例2: AddDrawcall

        private TreelistView.Node AddDrawcall(FetchDrawcall drawcall, TreelistView.Node root)
        {
            if (m_Core.Config.EventBrowser_HideEmpty)
            {
                if ((drawcall.children == null || drawcall.children.Length == 0) && (drawcall.flags & DrawcallFlags.PushMarker) != 0)
                    return null;
            }

            UInt32 eventNum = drawcall.eventID;
            TreelistView.Node drawNode = null;

            if(drawcall.children.Length > 0)
                drawNode = MakeNode(eventNum, GetEndEventID(drawcall), drawcall.drawcallID, drawcall.name, 0.0);
            else
                drawNode = MakeNode(eventNum, drawcall.drawcallID, drawcall.name, 0.0);

            if (m_Core.Config.EventBrowser_ApplyColours)
            {
                // if alpha isn't 0, assume the colour is valid
                if ((drawcall.flags & (DrawcallFlags.PushMarker | DrawcallFlags.SetMarker)) > 0 && drawcall.markerColour[3] > 0.0f)
                {
                    float red = drawcall.markerColour[0];
                    float green = drawcall.markerColour[1];
                    float blue = drawcall.markerColour[2];
                    float alpha = drawcall.markerColour[3];

                    drawNode.TreeLineColor = drawcall.GetColor();
                    drawNode.TreeLineWidth = 3.0f;

                    if (m_Core.Config.EventBrowser_ColourEventRow)
                    {
                        drawNode.BackColor = drawcall.GetColor();
                        if (drawcall.ShouldUseWhiteText())
                            drawNode.ForeColor = Color.White;
                    }
                }
            }

            DeferredEvent def = new DeferredEvent();
            def.eventID = eventNum;
            def.marker = (drawcall.flags & DrawcallFlags.SetMarker) != 0;

            if (drawcall.context != m_Core.FrameInfo.immContextId)
            {
                def.defCtx = drawcall.context;
                def.lastDefEv = drawcall.eventID;

                FetchDrawcall parent = drawcall.parent;
                while(!parent.name.Contains("ExecuteCommand"))
                    parent = parent.parent;

                def.eventID = parent.eventID-1;

                def.firstDefEv = parent.children[0].eventID;
                if(parent.children[0].events.Length > 0)
                    def.firstDefEv = parent.children[0].events[0].eventID;
            }

            drawNode.Tag = def;

            if (drawcall.children != null && drawcall.children.Length > 0)
            {
                for (int i = 0; i < drawcall.children.Length; i++)
                {
                    AddDrawcall(drawcall.children[i], drawNode);

                    if (i > 0 && drawNode.Nodes.Count >= 2 &&
                        (drawcall.children[i - 1].flags & DrawcallFlags.SetMarker) > 0)
                    {
                        drawNode.Nodes[drawNode.Nodes.Count - 2].Tag = drawNode.Nodes.LastNode.Tag;
                    }
                }

                bool found = false;

                for (int i = drawNode.Nodes.Count - 1; i >= 0; i--)
                {
                    DeferredEvent t = drawNode.Nodes[i].Tag as DeferredEvent;
                    if (t != null && !t.marker)
                    {
                        drawNode.Tag = drawNode.Nodes[i].Tag;
                        found = true;
                        break;
                    }
                }

                if (!found && !drawNode.Nodes.IsEmpty())
                    drawNode.Tag = drawNode.Nodes.LastNode.Tag;
            }

            if (drawNode.Nodes.IsEmpty() && (drawcall.flags & DrawcallFlags.PushMarker) != 0 && m_Core.Config.EventBrowser_HideEmpty)
                return null;

            root.Nodes.Add(drawNode);

            return drawNode;
        }
开发者ID:Cry-Filami,项目名称:renderdoc,代码行数:97,代码来源:EventBrowser.cs


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