{"id":1896,"date":"2018-12-17T16:24:44","date_gmt":"2018-12-17T14:24:44","guid":{"rendered":"https:\/\/alax.info\/blog\/?p=1896"},"modified":"2018-12-17T22:34:43","modified_gmt":"2018-12-17T20:34:43","slug":"direct3d-11-video-processors","status":"publish","type":"post","link":"https:\/\/alax.info\/blog\/1896","title":{"rendered":"Direct3D 11 Video Processors"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/desktop\/api\/d3d11\/nf-d3d11-id3d11videocontext-videoprocessorsetoutputtargetrect\"><code>ID3D11VideoContext::VideoProcessorSetOutputTargetRect<\/code><\/a> method:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\"><p>The target rectangle is the area within the destination surface where the output will be drawn. The target rectangle is given in pixel coordinates, relative to the destination surface.\nIf this method is never called, or if the Enable parameter is FALSE, the video processor writes to the entire destination surface.<\/p><\/blockquote>\n\n\n\n<p class=\"wp-block-paragraph\">Okay, let us try it out deflating output rectangle &#8220;creating a margin&#8221;.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>OutputPosition.SetRect(0, 0, OutputTextureDescription.Width, OutputTextureDescription.Height);\nOutputPosition.DeflateRect(OutputTextureDescription.Width \/ 8, OutputTextureDescription.Height \/ 8);\npVideoContext->VideoProcessorSetOutputTargetRect(pVideoProcessor, TRUE, OutputPosition);<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"669\" height=\"600\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2018\/12\/output-669x600.png\" alt=\"\" class=\"wp-image-1897\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2018\/12\/output-669x600.png 669w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2018\/12\/output-320x287.png 320w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2018\/12\/output-768x688.png 768w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2018\/12\/output-600x538.png 600w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2018\/12\/output.png 1168w\" sizes=\"auto, (max-width: 669px) 100vw, 669px\" \/><figcaption><br>Ability to take care of destination rectangle, Radeon RX 570 Series vs. Intel(R) UHD Graphics 630<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Why worry, maybe it is just one small bug for today? Oh, no. Forget\u00c2\u00a0SetOutputTargetRect, now just plain texture-to-texture with the same DXGI format. These two are produced on the same system, just different GPUs. NVIDIA GeForce GTX 1080 Ti adds a purple tint to the output when it is basically not expected to:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"747\" height=\"600\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2018\/12\/output2-747x600.png\" alt=\"\" class=\"wp-image-1898\" srcset=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2018\/12\/output2-747x600.png 747w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2018\/12\/output2-320x257.png 320w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2018\/12\/output2-768x617.png 768w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2018\/12\/output2-600x482.png 600w, https:\/\/alax.info\/blog\/wp-content\/uploads\/2018\/12\/output2.png 1108w\" sizes=\"auto, (max-width: 747px) 100vw, 747px\" \/><figcaption>Ability to keep colors right, NVIDIA GeForce GTX 1080 Ti vs. Intel(R) UHD Graphics 630<\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">This one does not even look a bug compared to mentioned above. Even though it was an &#8220;optimal quality&#8221; request Radeon&#8217;s optimal quality is not really impressing:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"261\" height=\"267\" src=\"https:\/\/alax.info\/blog\/wp-content\/uploads\/2018\/12\/optimalquality.png\" alt=\"\" class=\"wp-image-1899\"\/><figcaption>Text downscaling, Radeon RX 570 Series vs. Intel(R) UHD Graphics 630<\/figcaption><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>ID3D11VideoContext::VideoProcessorSetOutputTargetRect method: The target rectangle is the area within the destination surface where the output will be drawn. The target rectangle is given in pixel coordinates, relative to the destination surface. If this method is never called, or if the Enable parameter is FALSE, the video processor writes to the entire destination surface. Okay, let&hellip; <\/p>\n<p><a class=\"moretag\" href=\"https:\/\/alax.info\/blog\/1896\">Read the full article<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[544,486],"class_list":["post-1896","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-direct3d-11","tag-video"],"_links":{"self":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1896","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/comments?post=1896"}],"version-history":[{"count":0,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/posts\/1896\/revisions"}],"wp:attachment":[{"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/media?parent=1896"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/categories?post=1896"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/alax.info\/blog\/wp-json\/wp\/v2\/tags?post=1896"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}