コード例 #1
0
ファイル: ResourcePreview.cs プロジェクト: Anteru/renderdoc
        public ResourcePreview(Core core, ReplayOutput output)
        {
            InitializeComponent();

            descriptionLabel.Font = core.Config.PreferredFont;

            m_Name = "Unbound";
            m_Width = 1;
            m_Height = 1;
            m_Depth = 1;
            m_NumMips = 0;
            m_Unbound = true;
            thumbnail.Painting = false;

            m_Unbound = true;

            slotLabel.Text = "0";

            this.DoubleBuffered = true;

            SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true);

            m_Handle = thumbnail.Handle;

            m_Core = core;
            m_Output = output;

            Selected = false;
        }
コード例 #2
0
ファイル: TextureViewer.cs プロジェクト: Anteru/renderdoc
        public void OnLogfileLoaded()
        {
            var outConfig = new OutputConfig();
            outConfig.m_Type = OutputType.TexDisplay;

            saveTex.Enabled = gotoLocationButton.Enabled = viewTexBuffer.Enabled = true;

            m_Following = Following.Default;

            rwPanel.ClearThumbnails();
            roPanel.ClearThumbnails();

            RecreateRenderPanel();
            RecreateContextPanel();

            m_HighWaterStatusLength = 0;

            IntPtr contextHandle = pixelContext.Handle;
            IntPtr renderHandle = render.Handle;
            m_Core.Renderer.BeginInvoke((ReplayRenderer r) =>
            {
                m_Output = r.CreateOutput(renderHandle, OutputType.TexDisplay);
                m_Output.SetPixelContext(contextHandle);
                m_Output.SetOutputConfig(outConfig);

                this.BeginInvoke(new Action(UI_CreateThumbnails));
            });

            m_FSWatcher = new FileSystemWatcher(Core.ConfigDirectory, "*" + m_Core.APIProps.ShaderExtension);
            m_FSWatcher.EnableRaisingEvents = true;
            m_FSWatcher.Changed += new FileSystemEventHandler(CustomShaderModified);
            m_FSWatcher.Renamed += new RenamedEventHandler(CustomShaderModified);
            m_FSWatcher.Created += new FileSystemEventHandler(CustomShaderModified);
            m_FSWatcher.Deleted += new FileSystemEventHandler(CustomShaderModified);
            ReloadCustomShaders("");

            texturefilter.SelectedIndex = 0;
            texturefilter.Text = "";
            textureList.FillTextureList("", true, true);

            m_TexDisplay.darkBackgroundColour = darkBack;
            m_TexDisplay.lightBackgroundColour = lightBack;

            m_TexDisplay.typeHint = FormatComponentType.None;

            m_Core.Renderer.BeginInvoke(RT_UpdateAndDisplay);
        }
コード例 #3
0
ファイル: TextureViewer.cs プロジェクト: Anteru/renderdoc
        public void OnLogfileClosed()
        {
            if (IsDisposed) return;

            if(m_FSWatcher != null)
                m_FSWatcher.EnableRaisingEvents = false;
            m_FSWatcher = null;

            m_Output = null;

            m_TextureSettings.Clear();

            m_PrevSize = PointF.Empty;
            m_HighWaterStatusLength = 0;

            saveTex.Enabled = gotoLocationButton.Enabled = viewTexBuffer.Enabled = false;

            rwPanel.ClearThumbnails();
            roPanel.ClearThumbnails();

            RecreateRenderPanel();
            RecreateContextPanel();

            texturefilter.SelectedIndex = 0;

            m_TexDisplay = new TextureDisplay();
            m_TexDisplay.darkBackgroundColour = darkBack;
            m_TexDisplay.lightBackgroundColour = lightBack;

            m_TexDisplay.typeHint = FormatComponentType.None;

            PixelPicked = false;

            statusLabel.Text = "";
            m_PreviewPanel.Text = "Current";
            zoomOption.Text = "";
            mipLevel.Items.Clear();
            sliceFace.Items.Clear();
            rangeHistogram.SetRange(0.0f, 1.0f);

            channels.SelectedIndex = 0;
            overlay.SelectedIndex = 0;

            customShader.Items.Clear();
            m_CustomShaders.Clear();

            textureList.Items.Clear();

            render.Invalidate();

            renderHScroll.Enabled = false;
            renderVScroll.Enabled = false;

            hoverSwatch.BackColor = Color.Black;

            var tabs = m_PreviewPanel.Pane.TabStripControl.Tabs;

            for (int i = 0; i < tabs.Count; i++)
            {
                if (tabs[i].Content != m_PreviewPanel)
                {
                    (tabs[i].Content as DockContent).Close();
                    i--;
                }
            }

            (m_PreviewPanel as DockContent).Show();

            UI_UpdateTextureDetails();
            UI_UpdateChannels();
        }
コード例 #4
0
ファイル: BufferViewer.cs プロジェクト: Zorro666/renderdoc
        public void OnLogfileLoaded()
        {
            ClearStoredData();

            exportToToolStripMenuItem.Enabled = exportToolItem.Enabled = true;

            var draw = m_Core.CurDrawcall;

            previewTab.SelectedIndex = 0;

            uint byteoffs = ByteOffset;

            if (MeshView)
            {
                if (draw == null)
                {
                    m_VSIn.AbortThread();
                    m_VSOut.AbortThread();
                    m_GSOut.AbortThread();
                    return;
                }

                int curReq = m_ReqID;

                m_Core.Renderer.BeginInvoke((ReplayRenderer r) =>
                {
                    if (curReq != m_ReqID)
                        return;

                    m_Output = r.CreateOutput(RenderHandle, OutputType.MeshDisplay);
                    m_Output.SetOutputConfig(m_OutConfig);
                    RT_UpdateRenderOutput(r);
                    m_Output.Display(); // pump the display once, this will fetch postvs data

                    m_VSIn.m_Input = GetCurrentMeshInput(draw, MeshDataStage.VSIn);
                    m_VSOut.m_Input = GetCurrentMeshInput(draw, MeshDataStage.VSOut);
                    m_GSOut.m_Input = GetCurrentMeshInput(draw, MeshDataStage.GSOut);

                    var contentsVSIn = RT_FetchBufferContents(MeshDataStage.VSIn, r, m_VSIn.m_Input, byteoffs);
                    var contentsVSOut = RT_FetchBufferContents(MeshDataStage.VSOut, r, m_VSOut.m_Input, byteoffs);
                    var contentsGSOut = RT_FetchBufferContents(MeshDataStage.GSOut, r, m_GSOut.m_Input, byteoffs);

                    if (curReq != m_ReqID)
                        return;

                    this.BeginInvoke(new Action(() =>
                    {
                        if (curReq != m_ReqID)
                            return;

                        UI_AutoFetchRenderComponents(MeshDataStage.VSIn, true);
                        UI_AutoFetchRenderComponents(MeshDataStage.VSOut, true);
                        UI_AutoFetchRenderComponents(MeshDataStage.GSOut, true);
                        UI_AutoFetchRenderComponents(MeshDataStage.VSIn, false);
                        UI_AutoFetchRenderComponents(MeshDataStage.VSOut, false);
                        UI_AutoFetchRenderComponents(MeshDataStage.GSOut, false);
                        UI_UpdateMeshRenderComponents();

                        UI_SetAllColumns();

                        UI_SetRowsData(MeshDataStage.VSIn, contentsVSIn, 0);
                        if (m_VSOut.m_Input != null)
                            UI_SetRowsData(MeshDataStage.VSOut, contentsVSOut, 0);
                        if (m_GSOut.m_Input != null)
                            UI_SetRowsData(MeshDataStage.GSOut, contentsGSOut, 0);

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

                    m_Output = null;
                });
            }
        }
コード例 #5
0
ファイル: BufferViewer.cs プロジェクト: Zorro666/renderdoc
        public void OnLogfileClosed()
        {
            m_Output = null;

            ResetConfig();

            ClearStoredData();

            exportToToolStripMenuItem.Enabled = exportToolItem.Enabled = false;
        }
コード例 #6
0
ファイル: BufferViewer.cs プロジェクト: Waferix/renderdoc
        public void OnLogfileLoaded()
        {
            ClearStoredData();

            exportToToolStripMenuItem.Enabled = exportToolItem.Enabled = true;

            var draw = m_Core.CurDrawcall;

            if (MeshView)
            {
                if (draw == null)
                {
                    m_VSIn.AbortThread();
                    m_VSOut.AbortThread();
                    m_GSOut.AbortThread();
                    return;
                }

                int curReq = m_ReqID;

                m_Core.Renderer.BeginInvoke((ReplayRenderer r) =>
                {
                    if (curReq != m_ReqID)
                        return;

                    m_Output = r.CreateOutput(RenderHandle);
                    m_Output.SetOutputConfig(m_OutConfig);
                    RT_UpdateRenderOutput(r);

                    m_VSIn.m_Input = GetCurrentMeshInput(draw, MeshDataStage.VSIn);
                    m_VSOut.m_Input = GetCurrentMeshInput(draw, MeshDataStage.VSOut);
                    m_GSOut.m_Input = GetCurrentMeshInput(draw, MeshDataStage.GSOut);

                    var contentsVSIn = RT_FetchBufferContents(MeshDataStage.VSIn, r, m_VSIn.m_Input);
                    var contentsVSOut = RT_FetchBufferContents(MeshDataStage.VSOut, r, m_VSOut.m_Input);
                    var contentsGSOut = RT_FetchBufferContents(MeshDataStage.GSOut, r, m_GSOut.m_Input);

                    if (curReq != m_ReqID)
                        return;

                    this.BeginInvoke(new Action(() =>
                    {
                        if (curReq != m_ReqID)
                            return;

                        UI_SetColumns(MeshDataStage.VSIn, m_VSIn.m_Input.BufferFormats);
                        UI_SetRowsData(MeshDataStage.VSIn, contentsVSIn);

                        if (m_VSOut.m_Input != null)
                        {
                            UI_SetColumns(MeshDataStage.VSOut, m_VSOut.m_Input.BufferFormats);
                            UI_SetRowsData(MeshDataStage.VSOut, contentsVSOut);
                        }

                        if (m_GSOut.m_Input != null)
                        {
                            UI_SetColumns(MeshDataStage.GSOut, m_GSOut.m_Input.BufferFormats);
                            UI_SetRowsData(MeshDataStage.GSOut, contentsGSOut);
                        }
                    }));
                });
            }
            else
            {
                m_Core.Renderer.BeginInvoke((ReplayRenderer r) =>
                {
                    m_Output = r.CreateOutput(RenderHandle);
                    m_Output.SetOutputConfig(m_OutConfig);
                    RT_UpdateRenderOutput(r);
                });
            }
        }
コード例 #7
0
ファイル: TextureViewer.cs プロジェクト: n1nj4n/renderdoc
        public void OnLogfileLoaded()
        {
            var outConfig = new OutputConfig();
            outConfig.m_Type = OutputType.TexDisplay;

            saveTex.Enabled = true;

            m_Following = new Following(FollowType.RT_UAV, 0);

            IntPtr contextHandle = pixelContext.Handle;
            IntPtr renderHandle = render.Handle;
            m_Core.Renderer.BeginInvoke((ReplayRenderer r) =>
            {
                m_Output = r.CreateOutput(renderHandle);
                m_Output.SetPixelContext(contextHandle);
                m_Output.SetOutputConfig(outConfig);

                this.BeginInvoke(new Action(UI_CreateThumbnails));
            });

            m_FSWatcher = new FileSystemWatcher(Core.ConfigDirectory, "*.hlsl");
            m_FSWatcher.EnableRaisingEvents = true;
            m_FSWatcher.Changed += new FileSystemEventHandler(CustomShaderModified);
            m_FSWatcher.Renamed += new RenamedEventHandler(CustomShaderModified);
            m_FSWatcher.Created += new FileSystemEventHandler(CustomShaderModified);
            m_FSWatcher.Deleted += new FileSystemEventHandler(CustomShaderModified);
            ReloadCustomShaders("");

            texturefilter.SelectedIndex = 0;
            texturefilter.Text = "";
            textureList.FillTextureList("", true, true);

            m_Core.Renderer.BeginInvoke(RT_UpdateAndDisplay);
        }
コード例 #8
0
ファイル: TextureViewer.cs プロジェクト: n1nj4n/renderdoc
        public void OnLogfileClosed()
        {
            if (IsDisposed) return;

            if(m_FSWatcher != null)
                m_FSWatcher.EnableRaisingEvents = false;
            m_FSWatcher = null;

            m_Output = null;

            saveTex.Enabled = false;

            rtPanel.ClearThumbnails();
            texPanel.ClearThumbnails();

            texturefilter.SelectedIndex = 0;

            m_TexDisplay = new TextureDisplay();

            PixelPicked = false;

            statusLabel.Text = "";
            m_PreviewPanel.Text = "Current";
            zoomOption.Text = "";
            mipLevel.Items.Clear();
            sliceFace.Items.Clear();
            rangeHistogram.SetRange(0.0f, 1.0f);

            checkerBack.Checked = true;
            backcolorPick.Checked = false;

            checkerBack.Enabled = backcolorPick.Enabled = false;

            channels.SelectedIndex = 0;
            overlay.SelectedIndex = 0;

            customShader.Items.Clear();
            m_CustomShaders.Clear();

            textureList.Items.Clear();

            render.Invalidate();

            renderHScroll.Enabled = false;
            renderVScroll.Enabled = false;

            hoverSwatch.BackColor = Color.Black;

            var tabs = m_PreviewPanel.Pane.TabStripControl.Tabs;

            for (int i = 0; i < tabs.Count; i++)
            {
                if (tabs[i].Content != m_PreviewPanel)
                {
                    (tabs[i].Content as DockContent).Close();
                    i--;
                }
            }

            (m_PreviewPanel as DockContent).Show();

            UI_UpdateTextureDetails();
            UI_UpdateChannels();
        }
コード例 #9
0
ファイル: BufferViewer.cs プロジェクト: Nexuapex/renderdoc
        public void OnLogfileClosed()
        {
            if (IsDisposed) return;

            RecreateRenderPanel();

            m_Output = null;

            ResetConfig();

            ClearStoredData();

            exportToToolStripMenuItem.Enabled = exportToolItem.Enabled = false;
        }