{"id":5009,"date":"2020-09-04T07:30:19","date_gmt":"2020-09-04T14:30:19","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/pix\/?p=5009"},"modified":"2020-09-03T21:13:53","modified_gmt":"2020-09-04T04:13:53","slug":"d3d-video","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/pix\/d3d-video\/","title":{"rendered":"GPU Captures: Support for D3D video"},"content":{"rendered":"<p>PIX on Windows version 2008.26 added support for taking GPU Captures of applications that use D3D video APIs. This means that you can now use PIX to capture regions of GPU work that involve videos, such as title screens in games or videos playing in web browsers. In this blog post, we\u2019ll talk about how PIX captures video workloads and what is and isn\u2019t supported.<\/p>\n<p>&nbsp;<\/p>\n<h3>Summary<\/h3>\n<ul>\n<li>PIX on Windows supports taking GPU Captures of applications that use D3D12 video APIs.<\/li>\n<li>D3D11 video work can be captured by using the \u201cForce D3D11On12\u201d option in PIX.<\/li>\n<li>PIX does not support capturing applications that use video DRM. Please turn off DRM before trying to take a PIX capture.<\/li>\n<li>PIX does not capture and replay D3D12 video work directly. Instead, PIX will notice any modifications to D3D12 resources that are made by \u201cdecode\u201d or \u201cprocess\u201d video APIs at capture time, and PIX will make equivalent modifications to the resources during replay.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h3>In-Depth Walkthrough<\/h3>\n<p>Here is a screenshot from a multi-frame GPU Capture of Microsoft Edge playing a video. This was captured using D3D11On12, but the workflow in PIX would be the same if we captured an application that used D3D12 video APIs directly.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5011\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture1.png\" alt=\"Image Picture1\" width=\"1248\" height=\"703\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture1.png 1248w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture1-300x169.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture1-1024x577.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture1-768x433.png 768w\" sizes=\"(max-width: 1248px) 100vw, 1248px\" \/><\/p>\n<p>The above screenshot is for Global ID 72, which is the first Present() in the capture file. If we select an event later in the capture, then we can see the contents of the video change:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5012\" style=\"font-size: 1rem;\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture2.png\" alt=\"Image Picture2\" width=\"1248\" height=\"702\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture2.png 1248w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture2-300x169.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture2-1024x576.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture2-768x432.png 768w\" sizes=\"(max-width: 1248px) 100vw, 1248px\" \/><\/p>\n<p>If we select a Draw() call that renders the video\u2019s contents onto the backbuffer, then we can see the individual planes of the NV12 video texture that are sampled by the Pixel Shader:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5013\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture3.png\" alt=\"Image Picture3\" width=\"1248\" height=\"753\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture3.png 1248w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture3-300x181.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture3-1024x618.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture3-768x463.png 768w\" sizes=\"(max-width: 1248px) 100vw, 1248px\" \/><\/p>\n<p>As described in the Summary section, PIX doesn\u2019t capture\/replay the video API calls made by the application. Instead, PIX notices when D3D12 resources are modified by video APIs at capture time, and PIX will make the equivalent modifications at replay time. These modifications are shown as \u201cUpdateResourceAfterVideoWork\u201d events in the CPU Timeline:<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-5014\" src=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture4.png\" alt=\"Image Picture4\" width=\"1248\" height=\"567\" srcset=\"https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture4.png 1248w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture4-300x136.png 300w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture4-1024x465.png 1024w, https:\/\/devblogs.microsoft.com\/pix\/wp-content\/uploads\/sites\/41\/2020\/09\/Picture4-768x349.png 768w\" sizes=\"(max-width: 1248px) 100vw, 1248px\" \/><\/p>\n<p>All other PIX features, such as Shader Debugging and Pixel History, should work as expected. Performance analysis features, such as Collect Timing Data, should also work but they will not include performance data for D3D12 video work.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PIX on Windows version 2008.26 added support for taking GPU Captures of applications that use D3D video APIs. This means that you can now use PIX to capture regions of GPU work that involve videos, such as title screens in games or videos playing in web browsers. In this blog post, we\u2019ll talk about how [&hellip;]<\/p>\n","protected":false},"author":1899,"featured_media":4769,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5009","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-pix"],"acf":[],"blog_post_summary":"<p>PIX on Windows version 2008.26 added support for taking GPU Captures of applications that use D3D video APIs. This means that you can now use PIX to capture regions of GPU work that involve videos, such as title screens in games or videos playing in web browsers. In this blog post, we\u2019ll talk about how [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/posts\/5009","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/types\/post"}],"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=5009"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/posts\/5009\/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=5009"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/categories?post=5009"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/pix\/wp-json\/wp\/v2\/tags?post=5009"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}