• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# renderdoc.ResourceId类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



ResourceId类属于renderdoc命名空间,在下文中一共展示了ResourceId类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BufferFormatSpecifier

        public BufferFormatSpecifier(BufferViewer viewer, ResourceId buff, string format)
        {
            InitializeComponent();

            // WHY THE HELL do you require \r\n in text boxes?
            formatText.Text = format.Replace("\r\n", "\n").Replace("\n", Environment.NewLine);

            m_Viewer = viewer;
            m_Buffer = buff;
        }
开发者ID:n1nj4n,项目名称:renderdoc,代码行数:10,代码来源:BufferFormatSpecifier.cs


示例2: GetTexture

        public FetchTexture GetTexture(ResourceId id)
        {
            if (id == ResourceId.Null) return null;

            for (int t = 0; t < m_Textures.Length; t++)
                if (m_Textures[t].ID == id)
                    return m_Textures[t];

            return null;
        }
开发者ID:Zorro666,项目名称:renderdoc,代码行数:10,代码来源:Core.cs


示例3: ViewRawBuffer

        public void ViewRawBuffer(bool isBuffer, ResourceId id, string formatString)
        {
            if (m_Core.CurBuffers == null) return;

            m_FormatText = formatString;

            UInt64 len = 0;
            Text = "Buffer Contents";
            foreach (var b in m_Core.CurBuffers)
            {
                if (b.ID == id)
                {
                    Text = b.name + " - Contents";
                    len = b.byteSize;
                    break;
                }
            }

            Input input = new Input();

            string errors = "";

            FormatElement[] elems = FormatElement.ParseFormatString(formatString, len, true, out errors);

            input.Strides = new uint[] { elems.Last().offset + elems.Last().ByteSize };
            input.Buffers = new ResourceId[] { isBuffer ? id : ResourceId.Null, isBuffer ? ResourceId.Null : id };
            input.Offsets = new ulong[] { 0 };
            input.IndexBuffer = ResourceId.Null;
            input.BufferFormats = elems;
            input.IndexOffset = 0;

            largeBufferWarning.Visible = false;
            byteOffset.Enabled = false;

            m_VSIn.m_Input = input;

            ShowFormatSpecifier();

            m_FormatSpecifier.SetErrors(errors);

            ClearStoredData();

            uint byteoffset = ByteOffset;

            m_Core.Renderer.BeginInvoke((ReplayRenderer r) =>
            {
                if (IsDisposed) return;

                var contents = RT_FetchBufferContents(MeshDataStage.VSIn, r, input, byteoffset);

                this.BeginInvoke(new Action(() =>
                {
                    if (IsDisposed) return;

                    UI_SetRowsData(MeshDataStage.VSIn, contents, 0);
                    UI_SetColumns(MeshDataStage.VSIn, input.BufferFormats);
                }));
            });
        }
开发者ID:Zorro666,项目名称:renderdoc,代码行数:59,代码来源:BufferViewer.cs


示例4: GetBuffer

        public FetchBuffer GetBuffer(ResourceId id)
        {
            if (id == ResourceId.Null) return null;

            for (int b = 0; b < m_Buffers.Length; b++)
                if (m_Buffers[b].ID == id)
                    return m_Buffers[b];

            return null;
        }
开发者ID:Zorro666,项目名称:renderdoc,代码行数:10,代码来源:Core.cs


示例5: GetUsage

        public EventUsage[] GetUsage(ResourceId id)
        {
            IntPtr mem = CustomMarshal.Alloc(typeof(templated_array));

            bool success = ReplayRenderer_GetUsage(m_Real, id, mem);

            EventUsage[] ret = null;

            if (success)
                ret = (EventUsage[])CustomMarshal.GetTemplatedArray(mem, typeof(EventUsage), true);

            CustomMarshal.Free(mem);

            return ret;
        }
开发者ID:nsurface,项目名称:renderdoc,代码行数:15,代码来源:ReplayRenderer.cs


示例6: BufferResTag

 public BufferResTag(bool rw, UInt32 b, ResourceId id, ulong offs, ulong sz)
 {
     rwRes = rw; bindPoint = b; ID = id; offset = offs; size = sz;
 }
开发者ID:michaelkvance,项目名称:renderdoc,代码行数:4,代码来源:VulkanPipelineStateViewer.cs


示例7: GetCurrentMeshInput

        // used for the mesh view, to get the format of the mesh input from whichever stage that
        // we're looking at
        private Input GetCurrentMeshInput(FetchDrawcall draw, MeshDataStage type)
        {
            if (!MeshView)
                return null;

            FormatElement[] f = null;
            Input ret = new Input();
            ret.Drawcall = draw;
            ret.Topology = m_Core.CurPipelineState.DrawTopology;

            if (type != MeshDataStage.VSIn)
            {
                ShaderReflection details = null;

                if (type == MeshDataStage.VSOut)
                    details = m_Core.CurPipelineState.GetShaderReflection(ShaderStageType.Vertex);
                else if (type == MeshDataStage.GSOut)
                {
                    details = m_Core.CurPipelineState.GetShaderReflection(ShaderStageType.Geometry);
                    if (details == null)
                        details = m_Core.CurPipelineState.GetShaderReflection(ShaderStageType.Domain);
                }

                if (details == null)
                    return null;

                f = new FormatElement[details.OutputSig.Length];

                uint offset = 0;
                for (int i = 0; i < details.OutputSig.Length; i++)
                {
                    var sig = details.OutputSig[i];

                    f[i] = new FormatElement();

                    f[i].buffer = 0;
                    f[i].name = details.OutputSig[i].varName != "" ? details.OutputSig[i].varName : details.OutputSig[i].semanticIdxName;
                    f[i].format.compByteWidth = sizeof(float);
                    f[i].format.compCount = sig.compCount;
                    f[i].format.compType = sig.compType;
                    f[i].format.special = false;
                    f[i].format.rawType = 0;
                    f[i].offset = offset;
                    f[i].perinstance = false;
                    f[i].rowmajor = false;
                    f[i].matrixdim = 1;

                    offset += details.OutputSig[i].compCount * sizeof(float);
                }

                ret.BufferFormats = f;
                ret.Strides = new uint[] { offset };
                ret.Offsets = new uint[] { 0 };
                ret.Buffers = null;
                ret.IndexBuffer = ResourceId.Null;

                return ret;
            }

            CommonPipelineState.VBuffer[] vbs = m_Core.CurPipelineState.GetVBuffers();

            ResourceId[] bs = new ResourceId[vbs.Length];
            uint[] s = new uint[vbs.Length];
            uint[] o = new uint[vbs.Length];

            for (int i = 0; i < vbs.Length; i++)
            {
                bs[i] = vbs[i].Buffer;
                s[i] = vbs[i].ByteStride;
                o[i] = vbs[i].ByteOffset;
            }

            {
                var vinputs = m_Core.CurPipelineState.GetVertexInputs();
                f = new FormatElement[vinputs.Length];

                int i = 0;
                foreach (var a in vinputs)
                {
                    f[i] = new FormatElement(a.Name,
                                             a.VertexBuffer,
                                             a.RelativeByteOffset,
                                             a.PerInstance,
                                             false, // row major matrix
                                             1, // matrix dimension
                                             a.Format);
                    i++;
                }
            }

            ResourceId ibuffer = ResourceId.Null;
            uint ioffset = 0;
            ResourceFormat ifmt = null;

            m_Core.CurPipelineState.GetIBuffer(out ibuffer, out ioffset, out ifmt);

            if (draw != null && (draw.flags & DrawcallFlags.UseIBuffer) == 0)
            {
//.........这里部分代码省略.........
开发者ID:Waferix,项目名称:renderdoc,代码行数:101,代码来源:BufferViewer.cs


示例8: InitResourcePreview

        private void InitResourcePreview(ResourcePreview prev, ResourceId id, FormatComponentType typeHint, bool force, Following follow, string bindName, string slotName)
        {
            if (id != ResourceId.Null || force)
            {
                FetchTexture tex = null;
                foreach (var t in m_Core.CurTextures)
                    if (t.ID == id)
                        tex = t;

                FetchBuffer buf = null;
                foreach (var b in m_Core.CurBuffers)
                    if (b.ID == id)
                        buf = b;

                if (tex != null)
                {
                    string fullname = bindName;
                    if (tex.customName)
                    {
                        if (fullname.Length > 0)
                            fullname += " = ";
                        fullname += tex.name;
                    }
                    if (fullname.Length == 0)
                        fullname = tex.name;

                    prev.Init(fullname, tex.width, tex.height, tex.depth, tex.mips);
                    IntPtr handle = prev.ThumbnailHandle;
                    m_Core.Renderer.BeginInvoke((ReplayRenderer rep) =>
                    {
                        m_Output.AddThumbnail(handle, id, typeHint);
                    });
                }
                else if (buf != null)
                {
                    string fullname = bindName;
                    if (buf.customName)
                    {
                        if (fullname.Length > 0)
                            fullname += " = ";
                        fullname += buf.name;
                    }
                    if (fullname.Length == 0)
                        fullname = buf.name;

                    prev.Init(fullname, buf.length, 0, 0, 1);
                    IntPtr handle = prev.ThumbnailHandle;
                    m_Core.Renderer.BeginInvoke((ReplayRenderer rep) =>
                    {
                        m_Output.AddThumbnail(handle, ResourceId.Null, FormatComponentType.None);
                    });
                }
                else
                {
                    prev.Init();
                    IntPtr handle = prev.ThumbnailHandle;
                    m_Core.Renderer.BeginInvoke((ReplayRenderer rep) =>
                    {
                        m_Output.AddThumbnail(handle, ResourceId.Null, FormatComponentType.None);
                    });
                }

                prev.Tag = follow;
                prev.SlotName = slotName;
                prev.Visible = true;
                prev.Selected = (m_Following == follow);
            }
            else if (m_Following == follow)
            {
                FetchTexture tex = null;

                if(id != ResourceId.Null)
                    foreach (var t in m_Core.CurTextures)
                        if (t.ID == id)
                            tex = t;

                IntPtr handle = prev.ThumbnailHandle;
                if (id == ResourceId.Null || tex == null)
                    prev.Init();
                else
                    prev.Init("Unused", tex.width, tex.height, tex.depth, tex.mips);
                prev.Selected = true;
                m_Core.Renderer.BeginInvoke((ReplayRenderer rep) =>
                {
                    m_Output.AddThumbnail(handle, ResourceId.Null, FormatComponentType.None);
                });
            }
            else
            {
                prev.Init();
                prev.Visible = false;
            }
        }
开发者ID:Anteru,项目名称:renderdoc,代码行数:93,代码来源:TextureViewer.cs


示例9: GetOutputTargets

        public ResourceId[] GetOutputTargets()
        {
            if (LogLoaded)
            {
                if (IsLogD3D11)
                {
                    ResourceId[] ret = new ResourceId[m_D3D11.m_OM.RenderTargets.Length];
                    for (int i = 0; i < m_D3D11.m_OM.RenderTargets.Length; i++)
                    {
                        ret[i] = m_D3D11.m_OM.RenderTargets[i].Resource;
                        if (ret[i] == ResourceId.Null && i > m_D3D11.m_OM.UAVStartSlot)
                            ret[i] = m_D3D11.m_OM.UAVs[i - m_D3D11.m_OM.UAVStartSlot].Resource;
                    }

                    return ret;
                }
                else if (IsLogGL)
                {
                    return m_GL.m_FB.Color;
                }
            }

            return null;
        }
开发者ID:Waferix,项目名称:renderdoc,代码行数:24,代码来源:CommonPipelineState.cs


示例10: GetResources

        public ResourceId[] GetResources(ShaderStageType stage)
        {
            if (LogLoaded)
            {
                if (IsLogD3D11)
                {
                    D3D11PipelineState.ShaderStage s = null;

                    switch (stage)
                    {
                        case ShaderStageType.Vertex: s = m_D3D11.m_VS; break;
                        case ShaderStageType.Domain: s = m_D3D11.m_DS; break;
                        case ShaderStageType.Hull: s = m_D3D11.m_HS; break;
                        case ShaderStageType.Geometry: s = m_D3D11.m_GS; break;
                        case ShaderStageType.Pixel: s = m_D3D11.m_PS; break;
                        case ShaderStageType.Compute: s = m_D3D11.m_CS; break;
                    }

                    ResourceId[] ret = new ResourceId[s.SRVs.Length];
                    for (int i = 0; i < s.SRVs.Length; i++)
                        ret[i] = s.SRVs[i].Resource;

                    return ret;
                }
                else if (IsLogGL)
                {
                    ResourceId[] ret = new ResourceId[m_GL.Textures.Length];
                    for (int i = 0; i < m_GL.Textures.Length; i++)
                        ret[i] = m_GL.Textures[i].Resource;

                    return ret;
                }
            }

            return null;
        }
开发者ID:Waferix,项目名称:renderdoc,代码行数:36,代码来源:CommonPipelineState.cs


示例11: GetIBuffer

        public void GetIBuffer(out ResourceId buf, out uint ByteOffset, out ResourceFormat IndexFormat)
        {
            if (LogLoaded)
            {
                if (IsLogD3D11)
                {
                    buf = m_D3D11.m_IA.ibuffer.Buffer;
                    ByteOffset = m_D3D11.m_IA.ibuffer.Offset;
                    IndexFormat = m_D3D11.m_IA.ibuffer.Format;

                    return;
                }
                else if (IsLogGL)
                {
                    buf = m_GL.m_VtxIn.ibuffer.Buffer;
                    ByteOffset = m_GL.m_VtxIn.ibuffer.Offset;
                    IndexFormat = m_GL.m_VtxIn.ibuffer.Format;

                    return;
                }
            }

            buf = ResourceId.Null;
            ByteOffset = 0;
            IndexFormat = new ResourceFormat(FormatComponentType.UInt, 1, 2);
        }
开发者ID:Waferix,项目名称:renderdoc,代码行数:26,代码来源:CommonPipelineState.cs


示例12: GetConstantBuffer

        public void GetConstantBuffer(ShaderStageType stage, uint BindPoint, out ResourceId buf, out uint ByteOffset)
        {
            if (LogLoaded)
            {
                if (IsLogD3D11)
                {
                    D3D11PipelineState.ShaderStage s = null;

                    switch (stage)
                    {
                        case ShaderStageType.Vertex: s = m_D3D11.m_VS; break;
                        case ShaderStageType.Domain: s = m_D3D11.m_DS; break;
                        case ShaderStageType.Hull: s = m_D3D11.m_HS; break;
                        case ShaderStageType.Geometry: s = m_D3D11.m_GS; break;
                        case ShaderStageType.Pixel: s = m_D3D11.m_PS; break;
                        case ShaderStageType.Compute: s = m_D3D11.m_CS; break;
                    }

                    buf = s.ConstantBuffers[BindPoint].Buffer;
                    ByteOffset = s.ConstantBuffers[BindPoint].VecOffset * 4 * sizeof(float);

                    return;
                }
                else if (IsLogGL)
                {
                    buf = ResourceId.Null;
                    ByteOffset = 0;

                    return;
                }
            }

            buf = ResourceId.Null;
            ByteOffset = 0;
        }
开发者ID:Waferix,项目名称:renderdoc,代码行数:35,代码来源:CommonPipelineState.cs


示例13: GetConstantBuffer

        public void GetConstantBuffer(ShaderStageType stage, uint BufIdx, out ResourceId buf, out uint ByteOffset, out uint ByteSize)
        {
            if (LogLoaded)
            {
                if (IsLogD3D11)
                {
                    D3D11PipelineState.ShaderStage s = null;

                    switch (stage)
                    {
                        case ShaderStageType.Vertex: s = m_D3D11.m_VS; break;
                        case ShaderStageType.Domain: s = m_D3D11.m_DS; break;
                        case ShaderStageType.Hull: s = m_D3D11.m_HS; break;
                        case ShaderStageType.Geometry: s = m_D3D11.m_GS; break;
                        case ShaderStageType.Pixel: s = m_D3D11.m_PS; break;
                        case ShaderStageType.Compute: s = m_D3D11.m_CS; break;
                    }

                    if(BufIdx < s.ConstantBuffers.Length)
                    {
                        buf = s.ConstantBuffers[BufIdx].Buffer;
                        ByteOffset = s.ConstantBuffers[BufIdx].VecOffset * 4 * sizeof(float);
                        ByteSize = s.ConstantBuffers[BufIdx].VecCount * 4 * sizeof(float);

                        return;
                    }
                }
                else if (IsLogGL)
                {
                    GLPipelineState.ShaderStage s = null;

                    switch (stage)
                    {
                        case ShaderStageType.Vertex: s = m_GL.m_VS; break;
                        case ShaderStageType.Tess_Control: s = m_GL.m_TCS; break;
                        case ShaderStageType.Tess_Eval: s = m_GL.m_TES; break;
                        case ShaderStageType.Geometry: s = m_GL.m_GS; break;
                        case ShaderStageType.Fragment: s = m_GL.m_FS; break;
                        case ShaderStageType.Compute: s = m_GL.m_CS; break;
                    }

                    if(s.ShaderDetails != null && BufIdx < s.ShaderDetails.ConstantBlocks.Length)
                    {
                        if (s.ShaderDetails.ConstantBlocks[BufIdx].bindPoint >= 0)
                        {
                            int uboIdx = s.BindpointMapping.ConstantBlocks[s.ShaderDetails.ConstantBlocks[BufIdx].bindPoint].bind;
                            if (uboIdx >= 0 && uboIdx < m_GL.UniformBuffers.Length)
                            {
                                var b = m_GL.UniformBuffers[uboIdx];

                                buf = b.Resource;
                                ByteOffset = (uint)b.Offset;
                                ByteSize = (uint)b.Size;

                                return;
                            }
                        }
                    }
                }
            }

            buf = ResourceId.Null;
            ByteOffset = 0;
            ByteSize = 0;
        }
开发者ID:Lonesled,项目名称:renderdoc,代码行数:65,代码来源:CommonPipelineState.cs


示例14: SetContextFilter

        // setting a context filter allows replaying of deferred events. You can set the deferred
        // events to replay in a context, after replaying up to a given event on the main thread
        public void SetContextFilter(ILogViewerForm exclude, UInt32 frameID, UInt32 eventID,
            ResourceId ctx, UInt32 firstDeferred, UInt32 lastDeferred)
        {
            m_FrameID = frameID;
            m_EventID = eventID;

            m_DeferredEvent = lastDeferred;

            m_Renderer.Invoke((ReplayRenderer r) => { r.SetContextFilter(ctx, firstDeferred, lastDeferred); });
            m_Renderer.Invoke((ReplayRenderer r) => {
                r.SetFrameEvent(m_FrameID, m_EventID);
                m_D3D11PipelineState = r.GetD3D11PipelineState();
                m_GLPipelineState = r.GetGLPipelineState();
                m_PipelineState.SetStates(m_APIProperties, m_D3D11PipelineState, m_GLPipelineState);
            });

            foreach (var logviewer in m_LogViewers)
            {
                if (logviewer == exclude)
                    continue;

                Control c = (Control)logviewer;
                if (c.InvokeRequired)
                    c.BeginInvoke(new Action(() => logviewer.OnEventSelected(frameID, eventID)));
                else
                    logviewer.OnEventSelected(frameID, eventID);
            }
        }
开发者ID:Clever-Boy,项目名称:renderdoc,代码行数:30,代码来源:Core.cs


示例15: ViewTexture

        public void ViewTexture(ResourceId ID, bool focus)
        {
            if (this.InvokeRequired)
            {
                this.BeginInvoke(new Action(() => { this.ViewTexture(ID, focus); }));
                return;
            }

            TextureViewer_Load(null, null);

            if (lockedTabs.ContainsKey(ID))
            {
                if (!lockedTabs[ID].IsDisposed && !lockedTabs[ID].IsHidden)
                {
                    if (focus)
                        Show();

                    lockedTabs[ID].Show();
                    m_Core.Renderer.BeginInvoke(RT_UpdateAndDisplay);
                    return;
                }

                lockedTabs.Remove(ID);
            }

            for (int i = 0; i < m_Core.CurTextures.Length; i++)
            {
                if (m_Core.CurTextures[i].ID == ID)
                {
                    FetchTexture current = m_Core.CurTextures[i];

                    var newPanel = Helpers.WrapDockContent(dockPanel, renderToolstripContainer, current.name);

                    newPanel.DockState = DockState.Document;
                    newPanel.AllowEndUserDocking = false;

                    newPanel.Icon = Icon.FromHandle(global::renderdocui.Properties.Resources.page_white_link.GetHicon());

                    newPanel.Tag = current;

                    newPanel.DockHandler.TabPageContextMenuStrip = tabContextMenu;
                    newPanel.FormClosing += new FormClosingEventHandler(PreviewPanel_FormClosing);

                    newPanel.Show(m_PreviewPanel.Pane, null);

                    newPanel.Show();

                    if (focus)
                        Show();

                    lockedTabs.Add(ID, newPanel);

                    m_Core.Renderer.BeginInvoke(RT_UpdateAndDisplay);
                    return;
                }
            }

            for (int i = 0; i < m_Core.CurBuffers.Length; i++)
            {
                if (m_Core.CurBuffers[i].ID == ID)
                {
                    var viewer = new BufferViewer(m_Core, false);
                    viewer.ViewRawBuffer(true, 0, ulong.MaxValue, ID);
                    viewer.Show(DockPanel);
                    return;
                }
            }
        }
开发者ID:Anteru,项目名称:renderdoc,代码行数:68,代码来源:TextureViewer.cs


示例16: GoIconClickEventArgs

 public GoIconClickEventArgs(ResourceId i)
 {
     id = i;
 }
开发者ID:Cry-Filami,项目名称:renderdoc,代码行数:4,代码来源:TextureListBox.cs


示例17: HighlightResource

 public void HighlightResource(ResourceId id, string name, EventUsage[] usage)
 {
     m_HighlightResource = id;
     m_HighlightName = name;
     m_HighlightUsage = usage;
     panel.Invalidate();
 }
开发者ID:Anteru,项目名称:renderdoc,代码行数:7,代码来源:TimelineBar.cs


示例18: ViewRawBuffer

 public void ViewRawBuffer(ResourceId buff)
 {
     ViewRawBuffer(buff, "");
 }
开发者ID:Waferix,项目名称:renderdoc,代码行数:4,代码来源:BufferViewer.cs


示例19: PixelHistory

        public PixelModification[] PixelHistory(ResourceId target, UInt32 x, UInt32 y, UInt32 slice, UInt32 mip, UInt32 sampleIdx)
        {
            IntPtr mem = CustomMarshal.Alloc(typeof(templated_array));

            bool success = ReplayRenderer_PixelHistory(m_Real, target, x, y, slice, mip, sampleIdx, mem);

            PixelModification[] ret = null;

            if (success)
                ret = (PixelModification[])CustomMarshal.GetTemplatedArray(mem, typeof(PixelModification), true);

            CustomMarshal.Free(mem);

            return ret;
        }
开发者ID:nsurface,项目名称:renderdoc,代码行数:15,代码来源:ReplayRenderer.cs


示例20: OpenResourceContextMenu

        private void OpenResourceContextMenu(ResourceId id, bool thumbStripMenu, Control c, Point p)
        {
            var menuItems = new List<ToolStripItem>();

            int i = 0;
            for (i = 0; i < rightclickMenu.Items.Count; i++)
            {
                menuItems.Add(rightclickMenu.Items[i]);
                if (rightclickMenu.Items[i] == usedStartLabel)
                    break;

                menuItems[i].Visible = thumbStripMenu;
            }

            if (m_Core.CurPipelineState.SupportsBarriers)
            {
                imageInLayoutMenuItem.Visible = true;
                imageInLayoutMenuItem.Text = "Image is in layout " + m_Core.CurPipelineState.GetImageLayout(id);
            }
            else
            {
                imageInLayoutMenuItem.Visible = false;
            }

            if (id != ResourceId.Null)
            {
                usedSep.Visible = true;
                usedStartLabel.Visible = true;
                openNewTab.Visible = true;

                openNewTab.Tag = id;

                m_Core.Renderer.BeginInvoke((ReplayRenderer r) =>
                {
                    EventUsage[] usage = r.GetUsage(id);

                    this.BeginInvoke(new Action(() =>
                    {
                        uint start = 0;
                        uint end = 0;
                        ResourceUsage us = ResourceUsage.IndexBuffer;

                        foreach (var u in usage)
                        {
                            if (start == 0)
                            {
                                start = end = u.eventID;
                                us = u.usage;
                                continue;
                            }

                            var curDraw = m_Core.GetDrawcall(u.eventID);

                            bool distinct = false;

                            // if the usage is different from the last, add a new entry,
                            // or if the previous draw link is broken.
                            if (u.usage != us || curDraw == null || curDraw.previous == null)
                            {
                                distinct = true;
                            }
                            else
                            {
                                // otherwise search back through real draws, to see if the
                                // last event was where we were - otherwise it's a new
                                // distinct set of drawcalls and should have a separate
                                // entry in the context menu
                                FetchDrawcall prev = curDraw.previous;

                                while(prev != null && prev.eventID > end)
                                {
                                    if((prev.flags & (DrawcallFlags.Dispatch|DrawcallFlags.Drawcall|DrawcallFlags.CmdList)) == 0)
                                    {
                                        prev = prev.previous;
                                    }
                                    else
                                    {
                                        distinct = true;
                                        break;
                                    }

                                    if(prev == null)
                                        distinct = true;
                                }
                            }

                            if(distinct)
                            {
                                AddResourceUsageEntry(menuItems, start, end, us);
                                start = end = u.eventID;
                                us = u.usage;
                            }

                            end = u.eventID;
                        }

                        if (start != 0)
                            AddResourceUsageEntry(menuItems, start, end, us);

                        rightclickMenu.Items.Clear();
//.........这里部分代码省略.........
开发者ID:Anteru,项目名称:renderdoc,代码行数:101,代码来源:TextureViewer.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Code.Core类代码示例发布时间:2022-05-26
下一篇:
C# renderdoc.FetchDrawcall类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap