{"id":6692,"date":"2023-01-06T14:26:34","date_gmt":"2023-01-06T22:26:34","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/directx\/?p=6692"},"modified":"2023-01-06T15:15:15","modified_gmt":"2023-01-06T23:15:15","slug":"updates-in-directx-headers-repo","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/directx\/updates-in-directx-headers-repo\/","title":{"rendered":"Updates in d3dx12.h: Nuget Packaging, Header Bloat Reduction, and D3DX12GetCopyableFootprints"},"content":{"rendered":"<p>Hey everyone, we recently updated our <code>d3dx12.h<\/code> file! Previously, users were required to head to <a href=\"https:\/\/github.com\/microsoft\/DirectX-Headers\">DirectX-Headers<\/a> repo to grab the nice <code>d3dx12.h<\/code> helper files. The recent Agility SDK <span class=\"ui-provider vj b c d e f g h i j k l m n o p q r s t u v w x y z ab ac ae af ag ah ai aj ak\" dir=\"ltr\">1.608.2 release bundles this repo with the <a href=\"https:\/\/www.nuget.org\/packages\/Microsoft.Direct3D.D3D12\">Nuget packages<\/a>! There are no differences between the two packages.<\/span><\/p>\n<p>&nbsp;<\/p>\n<h4 style=\"text-align: center;\">Header Bloat Reduction<\/h4>\n<p>&nbsp;<\/p>\n<p>Next, users of the <a href=\"https:\/\/github.com\/microsoft\/DirectX-Headers\">DirectX-Headers<\/a> repo may notice that <code>d3dx12.h<\/code> no longer contains 5500 lines of code (hooray)! Previously, users would include all 5500 lines of code despite being only interested in one function <code>d3dx12.h<\/code> provides. Today, developers can potentially reduce compile times by choosing to include from a set of more focused <code>d3dx12_&lt;foo&gt;.h<\/code> headers<\/p>\n<p>However, if you were happy with how things were, you could still include <code>d3dx12.h<\/code>, which is the equivalent of including all 28 files. We hope this change makes life easier for our users when determining which features to use and cut bloat from <code>d3dx12.h<\/code>.<\/p>\n<p>Before<\/p>\n<pre>\/\/ d3dx12.h\r\nstruct CD3DX12_DEFAULT {};\r\nextern const DECLSPEC_SELECTANY CD3DX12_DEFAULT D3D12_DEFAULT;\r\n\/\/----------------------------------------------------------------------------------------\r\nstruct CD3DX12_RECT : public D3D12_RECT\r\n{\r\n\r\n};\r\n\r\n\/\/---------------------------------------------------------------------------------------\r\nstruct CD3DX12_VIEWPORT : public D3D12_VIEWPORT\r\n\/\/\r\n\/\/ More code below..\r\n\/\/ (5500 lines, to be precise)\r\n\/\/<\/pre>\n<p>Now<\/p>\n<pre>#include \"d3d12.h\"\r\n\r\n#if defined( __cplusplus )\r\n\r\n#include \"d3dx12_barriers.h\"\r\n#include \"d3dx12_core.h\"\r\n#include \"d3dx12_default.h\"\r\n#include \"d3dx12_pipeline_state_stream.h\"\r\n#include \"d3dx12_render_pass.h\"\r\n#include \"d3dx12_resource_helpers.h\"\r\n#include \"d3dx12_root_signature.h\"\r\n#include \"d3dx12_property_format_table.h\"\r\n\r\n#ifndef D3DX12_NO_STATE_OBJECT_HELPERS\r\n#include \"d3dx12_state_object.h\"\r\n#endif \/\/ !D3DX12_NO_STATE_OBJECT_HELPERS\r\n\r\n#ifndef D3DX12_NO_CHECK_FEATURE_SUPPORT_CLASS\r\n#include \"d3dx12_check_feature_support.h\"\r\n#endif \/\/ !D3DX12_NO_CHECK_FEATURE_SUPPORT_CLASS\r\n#endif \/\/ defined( __cplusplus )\r\n#endif \/\/__D3DX12_H__\r\n\/\/ eof<\/pre>\n<p>&nbsp;<\/p>\n<p>Please use the headers with the latest Agility SDK release.<\/p>\n<p>&nbsp;<\/p>\n<h4 style=\"text-align: center;\">D3DX12GetCopyableFootprints<\/h4>\n<p>&nbsp;<\/p>\n<p>We have also open-sourced <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/win32\/api\/d3d12\/nf-d3d12-id3d12device-getcopyablefootprints\">ID3D12Device::GetCopyableFootprints<\/a> under <code>d3dx12_resource_helpers.h<\/code>. We hope this open-sourced version clarifies the calculations behind a resource&#8217;s size. However, we still recommend using <code>ID3D12Device::GetCopyableFootprints<\/code> as it has more comprehensive error checking built into the debug layer, whereas the open-sourced version <code>D3DX12GetCopyableFootprints<\/code> makes the assumption all inputs are correct.<\/p>\n<p>In addition, we have open-sourced the format layout tables. These require linking a .cpp file \/ static library to use. The files are <a href=\"https:\/\/github.com\/microsoft\/DirectX-Headers\/blob\/main\/src\/d3dx12_property_format_table.cpp\"><code>src\/D3DPropertyFormatTable.cpp<\/code><\/a> and <a href=\"https:\/\/github.com\/microsoft\/DirectX-Headers\/blob\/main\/include\/directx\/d3dx12_property_format_table.h\"><code>include\/directx\/D3DPropertyFormatTable.h<\/code><\/a>.<\/p>\n<p>As always, we appreciate everyone&#8217;s feedback on DirectX 12!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hey everyone, we recently updated our d3dx12.h file! Previously, users were required to head to DirectX-Headers repo to grab the nice d3dx12.h helper files. The recent Agility SDK 1.608.2 release bundles this repo with the Nuget packages! There are no differences between the two packages. &nbsp; Header Bloat Reduction &nbsp; Next, users of the DirectX-Headers [&hellip;]<\/p>\n","protected":false},"author":94365,"featured_media":12651,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6692","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-directx"],"acf":[],"blog_post_summary":"<p>Hey everyone, we recently updated our d3dx12.h file! Previously, users were required to head to DirectX-Headers repo to grab the nice d3dx12.h helper files. The recent Agility SDK 1.608.2 release bundles this repo with the Nuget packages! There are no differences between the two packages. &nbsp; Header Bloat Reduction &nbsp; Next, users of the DirectX-Headers [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/posts\/6692","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/users\/94365"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/comments?post=6692"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/posts\/6692\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/media\/12651"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/media?parent=6692"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/categories?post=6692"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/directx\/wp-json\/wp\/v2\/tags?post=6692"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}