{"id":493,"date":"2014-07-02T09:57:00","date_gmt":"2014-07-02T09:57:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/vcblog\/2014\/07\/02\/graphics-diagnostics-in-visual-studio-2013-update-3-rc\/"},"modified":"2021-10-11T14:23:17","modified_gmt":"2021-10-11T14:23:17","slug":"graphics-diagnostics-in-visual-studio-2013-update-3-rc","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/cppblog\/graphics-diagnostics-in-visual-studio-2013-update-3-rc\/","title":{"rendered":"Graphics Diagnostics in Visual Studio 2013 Update 3 RC"},"content":{"rendered":"<p>Hello again! Three months have passed since we talked about what&#8217;s new for <a href=\"http:\/\/blogs.msdn.com\/b\/vcblog\/archive\/2014\/04\/08\/directx-graphics-development-with-visual-studio-2013-and-update-2.aspx\">Graphics Development in Visual Studio 2013 Update 2<\/a>. Since then the team has been working to bring even more <strong>Graphics Diagnostics<\/strong> features into Visual Studio. I&#8217;m very excited to share with you what we have put in Visual Studio 2013 Update 3 RC that just shipped! (<a href=\"http:\/\/go.microsoft.com\/fwlink\/p\/?LinkId=397827\">Download VS 2013 Update 3 RC<\/a>, <a title=\"Brian Harry's announcement blog post\" href=\"http:\/\/blogs.msdn.com\/b\/bharry\/archive\/2014\/07\/02\/vs-tfs-2013-3-update-3-rc.aspx\">Brian Harry&#8217;s announcement blog post<\/a>, and <a href=\"http:\/\/www.visualstudio.com\/news\/2014-jul-2-vs\">release notes<\/a>).<\/p>\n<p><strong>Visual Studio Graphics Diagnostics (VSGD)<\/strong> is a tool to help diagnose graphics rendering and performance issues in DirectX apps. It can be launched by using the menu DEBUG-&gt;Graphics-&gt;Start Diagnostics or Alt+F5 on the current solution or an exe in VS. If you haven&#8217;t used or read about VSGD before, <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/hh873207.aspx\">Graphics Diagnostics Overview<\/a> is a good start. Here is a high level summary of what&#8217;s new in VSGD in VS 2013 Update 3 RC:<\/p>\n<ul>\n<li>New Visual Studio Graphics Analyzer IDE: A dedicated space for analyzing graphics frames<\/li>\n<li>Shader Edit and Apply: View the impact of shader code changes in a captured log without re-running the app<\/li>\n<li>Configure capture options in TOOLS-&gt;Options-&gt;Graphics Diagnostics<\/li>\n<li>Command line tool for capturing and playing back frames<\/li>\n<\/ul>\n<p>If you prefer to watch these features in action, check&nbsp;out the latest <a title=\"Channel9 video where I demo the following features\" href=\"https:\/\/channel9.msdn.com\/Shows\/C9-GoingNative\/GoingNative-27-Improvements-to-Visual-Studio-Graphics-Diagnostics\">Channel9 video where I demo the following features<\/a>. As a bonus, you&#8217;ll also see team members who are behind this feature as well as what our offices look like in this video. <span style=\"font-family: Wingdings\">J<\/span><\/p>\n<h2>New Visual Studio Graphics Analyzer IDE: A dedicated space for analyzing graphics frames<\/h2>\n<p>We heard your feedback that the <strong>Capture Frame<\/strong> button wasn&#8217;t the easiest thing to find; we heard your feedback that <strong>managing various graphics tool windows<\/strong> inside the VS IDE wasn&#8217;t easy. So, we made a number of changes to the experience and hopefully you&#8217;ll like them.<\/p>\n<p>First of all, the <strong>Graphics Diagnostics<\/strong> tool is now running in the <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2013\/07\/12\/performance-and-diagnostics-hub-in-visual-studio-2013.aspx\"><strong>Performance and Diagnostics<\/strong> hub<\/a> to provide a consistent view with other diagnostics tools you might be familiar with such as <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/02\/28\/new-cpu-usage-tool-in-the-performance-and-diagnostics-hub-in-visual-studio-2013.aspx\">CPU Usage<\/a> and <a href=\"http:\/\/blogs.msdn.com\/b\/visualstudioalm\/archive\/2014\/04\/02\/diagnosing-memory-issues-with-the-new-memory-usage-tool-in-visual-studio.aspx\">Memory Usage<\/a> (although the Graphics Diagnostics tool is only available via the DEBUG -&gt; Graphics menu and cannot be started from the hub launch page). In the upper part of the session file, there is one swimlane for <strong>Frame time<\/strong> and another one for <strong>FPS<\/strong> which would give you an idea of how fast your app is running. The red line marks the threshold value which you can configure in the dropdown for each swimlane. By default it&#8217;s set to 60 FPS. The bottom part lists the frames captured in the current session along with a BIG <strong>Capture Frame<\/strong> button in case you didn&#8217;t notice. <span style=\"font-family: Wingdings\">J<\/span><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/7652.070214_1657_GraphicsDia1.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/7652.070214_1657_GraphicsDia1.png\" alt=\"Image 7652 070214 1657 GraphicsDia1\" width=\"861\" height=\"461\" class=\"aligncenter size-full wp-image-29547\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/7652.070214_1657_GraphicsDia1.png 861w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/7652.070214_1657_GraphicsDia1-300x161.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/7652.070214_1657_GraphicsDia1-768x411.png 768w\" sizes=\"(max-width: 861px) 100vw, 861px\" \/><\/a><\/p>\n<p>We also improved the experienced for <strong>analyzing frames<\/strong>. It has been a challenge for us to try to find a better way to help you easily manage the various graphics tool windows in the VS IDE. We explored many options for how to provide a focused environment for analyzing frames without interfering with other tasks that might be going on in the VS IDE, and so here is the new experience in Update 3 RC:<\/p>\n<p>Once frames are captured, double clicking on any frame in the <em>diagsession<\/em> file, or just clicking on the <strong>Frame#<\/strong> link will open the frame in another instance of VS named <strong>Visual Studio Graphics Analyzer<\/strong> (VSGA). VSGA is a customized VS environment that only contains the necessary components for analyzing frames. It&#8217;s lightweight and has a low memory footprint. It provides a familiar (it&#8217;s the same VS Shell!) yet highly focused environment for analyzing frames in which you can access all the related information the same way you used to, including Event List, Pixel History, Pipeline Stage, Objects, Event Call Stack, and debugging shader code. You can also configure how VSGA looks so it&#8217;s easier to distinguish it from your regular VS IDE window by using VIEW-&gt;Options page in VSGA. Notice the VSGA window in the screenshot is using the dark theme while VS is using the light theme.<\/p>\n<p>You can save the <em>diagsession<\/em> file in VS or save the <em>vsglog<\/em> file in VSGA for later inspections.&nbsp;<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/5102.070214_1657_GraphicsDia2.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/5102.070214_1657_GraphicsDia2.png\" alt=\"Image 5102 070214 1657 GraphicsDia2\" width=\"864\" height=\"557\" class=\"aligncenter size-full wp-image-29546\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/5102.070214_1657_GraphicsDia2.png 864w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/5102.070214_1657_GraphicsDia2-300x193.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/5102.070214_1657_GraphicsDia2-768x495.png 768w\" sizes=\"(max-width: 864px) 100vw, 864px\" \/><\/a><\/p>\n<h2>Shader Edit and Apply: View the impact of shader code changes without re-running the app<\/h2>\n<p>The shader editing experience has also been improved with new shader <strong>Edit &amp; Apply<\/strong> functionality as well as a <strong>side by side view<\/strong> of shader source code and compiler output disassembly code.<\/p>\n<p>Clicking on the shader file name in the <strong>Pipeline Stages<\/strong> window or the <strong>Pixel History<\/strong> window will open the shader editor. On the left of the side by side view it shows the source code if available and on the right side it shows disassembly code generated by HLSL Shader Compiler. You can make changes in the source code, and once the tool detects differences in output, the <strong>Apply<\/strong> button at the top will be enabled. Click <strong>Apply<\/strong> to apply the changes to the current vsglog file and you can view how the changes impact the rendering result immediately, including Render Target view, Pipeline Stages, and Pixel History windows.<\/p>\n<p>A few things to call out:<\/p>\n<ol>\n<li>The source code being edited here is a copy of the original shader file and we keep it in a temporary location (the path is underneath the window) and changes are only applied to the vsglog file and does not affect your original source. You can use the vsglog file as a &#8220;playground&#8221; to try out different shader effects and view their impacts. The changes can be easily reverted back to when the frame was captured by clicking the <strong>Reset<\/strong> button. If you&#8217;re satisfied with the changes and want to move the changes to the original source, you can use the <strong>Copy to&hellip;<\/strong> button which brings up a dialog where you can specify the location of the source file we should copy these changes to.<\/li>\n<li>During shader debugging, you can make changes to the shader code, but the <strong>Apply<\/strong> button will only be enabled after debugging is stopped.<\/li>\n<\/ol>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/7752.070214_1657_GraphicsDia3.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/7752.070214_1657_GraphicsDia3.png\" alt=\"Image 7752 070214 1657 GraphicsDia3\" width=\"862\" height=\"586\" class=\"aligncenter size-full wp-image-29548\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/7752.070214_1657_GraphicsDia3.png 862w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/7752.070214_1657_GraphicsDia3-300x204.png 300w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/7752.070214_1657_GraphicsDia3-768x522.png 768w\" sizes=\"(max-width: 862px) 100vw, 862px\" \/><\/a><\/p>\n<h2>Configure capture options in TOOLS-&gt;Options-&gt;Graphics Diagnostics<\/h2>\n<p>We are now exposing a number of options for capture which you can find by opening <strong>TOOLS<\/strong>-&gt;<strong>Options<\/strong>-&gt;<strong>Graphics Diagnostics<\/strong> page in <strong>VS<\/strong>. Note it&#8217;s not in the VSGA IDE, which was designed for analysis only. <span style=\"font-family: Wingdings\">J<\/span> You can now decide whether to collect call stacks, whether to disable HUD, or whether to capture in compatibility mode.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/2500.070214_1657_GraphicsDia4.png\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/2500.070214_1657_GraphicsDia4.png\" alt=\"Image 2500 070214 1657 GraphicsDia4\" width=\"758\" height=\"442\" class=\"aligncenter size-full wp-image-29545\" srcset=\"https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/2500.070214_1657_GraphicsDia4.png 758w, https:\/\/devblogs.microsoft.com\/cppblog\/wp-content\/uploads\/sites\/9\/2014\/07\/2500.070214_1657_GraphicsDia4-300x175.png 300w\" sizes=\"(max-width: 758px) 100vw, 758px\" \/><\/a><\/p>\n<h2>Command line tool for capturing and playing back frames<\/h2>\n<p>We heard your feedback that sometimes you need to capture frames on machines that don&#8217;t have VS installed. We&#8217;re now shipping a command line tool for capture and playback (<strong>dxcap.exe<\/strong>) as part of Windows SDK. Since the Windows SDK&nbsp;comes with VS, you&#8217;ll already have it if you install VS.&nbsp;You can use this tool to capture frames from desktop apps, store apps, and phone apps.<\/p>\n<p>Once you installed VS 2013 Update 3 RC (<a href=\"http:\/\/go.microsoft.com\/fwlink\/p\/?LinkId=397827\">Download<\/a>) or standalone Windows SDK (<a href=\"http:\/\/msdn.microsoft.com\/en-us\/windows\/desktop\/bg162891.aspx\">Download<\/a>). You can find <strong>dxcap.exe<\/strong> in <strong>C:\\Windows\\System32<\/strong> and <strong>C:\\Windows\\SysWOW64<\/strong>. Simply pass in <em>-c<\/em> and the name of the exe to capture and <em>&ndash;p<\/em> to playback the most recent captured log.<\/p>\n<p>A quick example:<\/p>\n<p>To capture frame&nbsp;100&nbsp;from a desktop app: <em>dxcap.exe &ndash;frame 100 -c &#8220;C:\\TestProjects\\MyApp.exe&#8221;<\/em><\/p>\n<p>To playback: <em>dxcap.exe -p<\/em><\/p>\n<p>There are more options that can be used, such as to specify which frames to capture, whether to capture in compatibility mode, or what to use as the output filename. You can find details in DXCap&#8217;s help information (Dxcap \/?) or MSDN document <a href=\"http:\/\/msdn.microsoft.com\/en-us\/library\/dn774939.aspx\">Command-Line Capture Tool<\/a> .<\/p>\n<h4>Summary<\/h4>\n<p>As always, we look forward to hearing what you think. Download Visual Studio 2013 Update 3 RC (<a href=\"http:\/\/go.microsoft.com\/fwlink\/p\/?LinkId=397827\">Download<\/a>), try it out, and let us know. <span style=\"font-family: Wingdings\">J<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello again! Three months have passed since we talked about what&#8217;s new for Graphics Development in Visual Studio 2013 Update 2. Since then the team has been working to bring even more Graphics Diagnostics features into Visual Studio. I&#8217;m very excited to share with you what we have put in Visual Studio 2013 Update 3 [&hellip;]<\/p>\n","protected":false},"author":269,"featured_media":35994,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[140,106,195],"class_list":["post-493","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cplusplus","tag-c","tag-graphics","tag-vs2013"],"acf":[],"blog_post_summary":"<p>Hello again! Three months have passed since we talked about what&#8217;s new for Graphics Development in Visual Studio 2013 Update 2. Since then the team has been working to bring even more Graphics Diagnostics features into Visual Studio. I&#8217;m very excited to share with you what we have put in Visual Studio 2013 Update 3 [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/493","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/users\/269"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/comments?post=493"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/posts\/493\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media\/35994"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/media?parent=493"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/categories?post=493"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/cppblog\/wp-json\/wp\/v2\/tags?post=493"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}