{"id":3265,"date":"2018-03-19T17:02:59","date_gmt":"2018-03-19T17:02:59","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/pix\/?page_id=3265"},"modified":"2019-06-04T08:16:22","modified_gmt":"2019-06-04T15:16:22","slug":"directx-raytracing","status":"publish","type":"page","link":"https:\/\/devblogs.microsoft.com\/pix\/directx-raytracing\/","title":{"rendered":"DirectX Raytracing"},"content":{"rendered":"<p>PIX on Windows includes support for the final DirectX Raytracing (DXR) that\u2019s part of the Windows 10 October 2018 Update (a.k.a. \u201cRS5\u201d). This allows you to debug your raytracing code by capturing and analyzing your DXR applications with the same tools that you would use to capture and analyze your other D3D12 applications.<\/p>\n<p>&nbsp;<\/p>\n<h2>Getting Started<\/h2>\n<ul>\n<li>Follow the instructions for <a href=\"http:\/\/forums.directxtech.com\/index.php?topic=5985.0\">setting up your DXR development<\/a> environment.<\/li>\n<li>Download and install the <a href=\"https:\/\/devblogs.microsoft.com\/pix\/download\/\">latest version of PIX<\/a> from our blog.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>Features<\/h2>\n<p>Once you are set up, you can launch and take a GPU Capture of your DXR application. You can begin analyzing your capture by opening it and examining your DXR API calls in your event list:<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/03\/dxr_eventlist.png\"><img decoding=\"async\" class=\"wp-image-3315 size-full aligncenter\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/03\/dxr_eventlist.png\" alt=\"\" width=\"699\" height=\"394\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2018\/03\/dxr_eventlist.png 699w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2018\/03\/dxr_eventlist-300x169.png 300w\" sizes=\"(max-width: 699px) 100vw, 699px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>After starting analysis, you can select your <em>DispatchRays<\/em> calls and see the resources it used by looking at the \u201cPipeline\u201d view in the \u201cPipeline\u201d tab:<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/10\/1810.24-acc-structure-viewer.png\"><img decoding=\"async\" class=\"size-large wp-image-3925 aligncenter\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/10\/1810.24-acc-structure-viewer-1024x691.png\" alt=\"\" width=\"1024\" height=\"691\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2018\/10\/1810.24-acc-structure-viewer-1024x691.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2018\/10\/1810.24-acc-structure-viewer-300x202.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2018\/10\/1810.24-acc-structure-viewer-768x518.png 768w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2018\/10\/1810.24-acc-structure-viewer.png 1173w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>Clicking on an entry in the &#8216;Shader Tables&#8217; group on the left-hand side will show how the GPU will interpret the selected shader table:<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/10\/1810.24-shader-table-viewer.png\"><img decoding=\"async\" class=\"size-large wp-image-3915 aligncenter\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/10\/1810.24-shader-table-viewer-1024x311.png\" alt=\"\" width=\"1024\" height=\"311\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2018\/10\/1810.24-shader-table-viewer-1024x311.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2018\/10\/1810.24-shader-table-viewer-300x91.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2018\/10\/1810.24-shader-table-viewer-768x234.png 768w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2018\/10\/1810.24-shader-table-viewer.png 1161w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>Each remaining &#8216;group&#8217; within this list (e.g. &#8216;RayGenMain&#8217;) lists the resources used by a particular shader record within one of the shader tables. Its bolded title, such as \u201cMyHitGroup (Record 0)\u201d, shows the shader record\u2019s export name within your state object together with the shader record\u2019s index within its shader table (if applicable). Any shader record that uses resources, including your Ray Generation shader record and\/or entries in your Hit Group, Miss Shader, or Callable Shader shader tables, will be displayed in this list. For each shader record, PIX lists the resources bound to its shader, including all resources bound via global and\/or local root arguments.<\/p>\n<p>For each resource bound to a shader, you can click on the resource to view it in the same way that you would view resources for rasterization or compute shaders. You can also visualize the raytracing acceleration structures bound to your raytracing shaders:<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/03\/dxr_accelerationstructures.png\"><img decoding=\"async\" class=\"wp-image-3305 size-large aligncenter\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/03\/dxr_accelerationstructures-1024x535.png\" alt=\"\" width=\"1024\" height=\"535\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2018\/03\/dxr_accelerationstructures-1024x535.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2018\/03\/dxr_accelerationstructures-300x157.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2018\/03\/dxr_accelerationstructures-768x401.png 768w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2018\/03\/dxr_accelerationstructures.png 1314w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p style=\"text-align: right;\">(screenshot courtesy of Nir Benty and <a href=\"https:\/\/github.com\/nvidiagameworks\/falcor\">NVIDIA\u2019s Falcor<\/a>)<\/p>\n<p>Note that PIX visualizes acceleration structures after they are built by reading data back from the GPU. This means that the visualization will include any optimizations added by the driver during the build process, such as combined geometry.<\/p>\n<p>The \u201cAPI Object Table\u201d can be used to view your DXR API objects, such as your state objects, together with any other D3D12 API objects that were used in your capture. In particular, you can view the subobjects that make up your state objects in an easy-to-understand format:<\/p>\n<p>&nbsp;<\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/03\/dxr_stateobjects.png\"><img decoding=\"async\" class=\"wp-image-3335 size-full aligncenter\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/2018\/03\/dxr_stateobjects.png\" alt=\"\" width=\"488\" height=\"541\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2018\/03\/dxr_stateobjects.png 488w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2018\/03\/dxr_stateobjects-271x300.png 271w\" sizes=\"(max-width: 488px) 100vw, 488px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<h2>Known Issues and Restrictions<\/h2>\n<p>There are some additional restrictions on DXR API usage that your application must follow before you can take a GPU Capture of it. The restrictions are:<\/p>\n<ul>\n<li>Your acceleration structures must be stored in committed or placed resources<\/li>\n<\/ul>\n<p>Furthermore, some features in PIX show incomplete or incorrect data for GPU Captures that use DXR. These features will support DXR in a future release of PIX on Windows. These features include:<\/p>\n<ul>\n<li>Dr. PIX<\/li>\n<li>Shader Debugging<\/li>\n<\/ul>\n<p>For applications using the DXR Fallback Layer, both GPU Captures and Timing Captures will capture the compute work generated by the Fallback Layer as seen by the D3D12 runtime.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PIX on Windows includes support for the final DirectX Raytracing (DXR) that\u2019s part of the Windows 10 October 2018 Update (a.k.a. \u201cRS5\u201d). This allows you to debug your raytracing code by capturing and analyzing your DXR applications with the same tools that you would use to capture and analyze your other D3D12 applications. &nbsp; Getting [&hellip;]<\/p>\n","protected":false},"author":1899,"featured_media":4769,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-3265","page","type-page","status-publish","has-post-thumbnail","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/pages\/3265","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/users\/1899"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/comments?post=3265"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/pages\/3265\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/media\/4769"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/media?parent=3265"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}