コード例 #1
0
        static void dock_FormClosed(object sender, FormClosedEventArgs e)
        {
            ConstantBufferPreviewer cbp = sender as ConstantBufferPreviewer;

            m_Docks.Remove(cbp);
            cbp.m_Core.RemoveLogViewer(cbp);
        }
コード例 #2
0
        public static DockContent Has(ShaderStageType stage, UInt32 slot)
        {
            foreach (var d in m_Docks)
            {
                ConstantBufferPreviewer cb = d.Controls[0] as ConstantBufferPreviewer;

                if (cb.Stage == stage && cb.Slot == slot)
                {
                    return(cb.Parent as DockContent);
                }
            }

            return(null);
        }
コード例 #3
0
        private void ShowCBuffer(D3D11PipelineState.ShaderStage stage, UInt32 slot)
        {
            if (stage.ShaderDetails != null &&
                (stage.ShaderDetails.ConstantBlocks.Length <= slot ||
                 stage.ShaderDetails.ConstantBlocks[slot].name.Length == 0)
               )
            {
                // unused cbuffer, open regular buffer viewer
                var viewer = new BufferViewer(m_Core, false);

                if (stage.ConstantBuffers.Length < slot)
                    return;

                var buf = stage.ConstantBuffers[slot];
                viewer.ViewRawBuffer(true, buf.VecOffset * 4 * sizeof(float), buf.VecCount * 4 * sizeof(float), buf.Buffer);
                viewer.Show(m_DockContent.DockPanel);

                return;
            }

            var existing = ConstantBufferPreviewer.Has(stage.stage, slot, 0);
            if (existing != null)
            {
                existing.Show();
                return;
            }

            var prev = new ConstantBufferPreviewer(m_Core, stage.stage, slot, 0);

            prev.ShowDock(m_DockContent.Pane, DockAlignment.Right, 0.3);
        }
コード例 #4
0
        private void ShowCBuffer(GLPipelineState.ShaderStage stage, UInt32 slot)
        {
            var existing = ConstantBufferPreviewer.Has(stage.stage, slot);
            if (existing != null)
            {
                existing.Show();
                return;
            }

            var prev = new ConstantBufferPreviewer(m_Core, stage.stage, slot);

            prev.ShowDock(m_DockContent.Pane, DockAlignment.Right, 0.3);
        }
コード例 #5
0
        private void ShowCBuffer(D3D11PipelineState.ShaderStage stage, UInt32 bindPoint)
        {
            bool found = false;
            UInt32 slot = UInt32.MaxValue;

            if (stage.ShaderDetails != null)
            {
                UInt32 i = 0;
                foreach (var cb in stage.ShaderDetails.ConstantBlocks)
                {
                    if (cb.bindPoint == bindPoint)
                    {
                        slot = i;
                        found = true;
                        break;
                    }

                    i++;
                }
            }

            if (!found)
            {
                // unused cbuffer, open regular buffer viewer
                var viewer = new BufferViewer(m_Core, false);

                if (stage.ConstantBuffers.Length < bindPoint)
                    return;

                var buf = stage.ConstantBuffers[bindPoint];
                viewer.ViewRawBuffer(true, buf.VecOffset * 4 * sizeof(float), buf.VecCount * 4 * sizeof(float), buf.Buffer);
                viewer.Show(m_DockContent.DockPanel);

                return;
            }

            var existing = ConstantBufferPreviewer.Has(stage.stage, slot, 0);
            if (existing != null)
            {
                existing.Show();
                return;
            }

            var prev = new ConstantBufferPreviewer(m_Core, stage.stage, slot, 0);

            prev.ShowDock(m_DockContent.Pane, DockAlignment.Right, 0.3);
        }
コード例 #6
0
        private void ShowCBuffer(VulkanPipelineState.ShaderStage stage, CBufferTag tag)
        {
            if (tag == null || tag.slotIdx == uint.MaxValue) return;

            VulkanPipelineState.Pipeline pipe = m_Core.CurVulkanPipelineState.graphics;
            if(stage.stage == ShaderStageType.Compute)
                pipe = m_Core.CurVulkanPipelineState.compute;

            var existing = ConstantBufferPreviewer.Has(stage.stage, tag.slotIdx, tag.arrayIdx);
            if (existing != null)
            {
                existing.Show();
                return;
            }

            var prev = new ConstantBufferPreviewer(m_Core, stage.stage, tag.slotIdx, tag.arrayIdx);

            prev.ShowDock(m_DockContent.Pane, DockAlignment.Right, 0.3);
        }
コード例 #7
0
        private void ShowCBuffer(D3D11PipelineState.ShaderStage stage, UInt32 slot)
        {
            var existing = ConstantBufferPreviewer.Has(stage.stage, slot);
            if (existing != null)
            {
                existing.Show();
                return;
            }

            var prev = new ConstantBufferPreviewer(m_Core, stage.stage, slot);

            var dock = Helpers.WrapDockContent(m_DockContent.DockPanel, prev);
            dock.DockState = DockState.DockRight;
            dock.DockAreas |= DockAreas.Float;
            ConstantBufferPreviewer.ShowDock(dock, m_DockContent.Pane, DockAlignment.Right, 0.3);
        }
コード例 #8
0
        private void ShowCBuffer(D3D12PipelineState.ShaderStage stage, CBufTag tag)
        {
            if (tag.idx == uint.MaxValue)
            {
                // unused cbuffer, open regular buffer viewer
                var viewer = new BufferViewer(m_Core, false);

                var buf = stage.Spaces[tag.space].ConstantBuffers[tag.reg];
                viewer.ViewRawBuffer(true, buf.Offset, buf.ByteSize, buf.Buffer);
                viewer.Show(m_DockContent.DockPanel);

                return;
            }

            var existing = ConstantBufferPreviewer.Has(stage.stage, tag.idx, 0);
            if (existing != null)
            {
                existing.Show();
                return;
            }

            var prev = new ConstantBufferPreviewer(m_Core, stage.stage, tag.idx, 0);

            prev.ShowDock(m_DockContent.Pane, DockAlignment.Right, 0.3);
        }