-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposed RFC Feature: Introduce DirectX Agility SDK #154
Comments
Overall I like this addition. Dx12 RHI was bottlenecked by Agility SDK when it came to experimentation with new DX api so this is a welcome addition. A few points below
Tagging @spham-amzn and @nick-l-o3de to comment on ease of using Nuget for Agility SDK. |
|
The repo for 3rd Party packages is here. |
Before actually working on introducing DirectX Agility SDK, I am wondering whether the license of it is friendly enough? https://www.nuget.org/packages/Microsoft.Direct3D.D3D12/1.614.0/License |
Doesnt sound like it. Basically, unless the license is MIT/Apache it is probably not going to work for the core engine. 3p package is the way to go here |
Considering the discussion in Discord https://discord.com/channels/805939474655346758/821692567355523152/1293152651177099296, I prefer introducing DirectX Agility SDK like we did to introduce PIX, i.e., provide cmake option to enable/disable it, and allow users to configure the SDK's path, but the user have to think about the license issue and download the SDK manually. I am NOT going to put the DirectX Agility SDK inside O3DE or O3DE's 3rd party repo, and will NOT ship O3DE with DirectX Agility SDK by default. If the user enables agility SDK and provides the SDK's path, the SDK's dll would be included in the compile output, and I will set the required If this works, I am going to do it in this way. |
This could work as a start. Having a default 3rd party lib is also not a bad idea for the default engine (can be added later on) and people can override it easily with the setup mentioned above. But please add details related to this in the wiki here (https://github.com/o3de/o3de/wiki) or add documentation to the main site if possible. Otherwise folks will have no idea how to override it. |
Summary:
When using DirectX RHI, some advanced shader features are delivered by high version of shader model. The shader model version has a strong binding to the Windows version, therefore, lower version of Windows cannot use some advanced shader features. The DirectX Agility SDK is the only way to get rid of such restriction.
This proposal plans to introduce DirectX Agility SDK into O3DE, so that when using DX RHI, the engine itself can be independent of the windows system version even after introducing some advanced features that relies on higher version of shader model. (e.g., Windows 10 only supports shader version up to SM 6.5 according to this document).
You may see that Unreal Engine is doing exactly the same thing like this.
What is the relevance of this feature?
The ultimate goal is to make O3DE more compatible to lower version of Windows if running DX RHI, even after introducing some new advanced features needs higher version of shader model, for example, if a Gem requires 64-bit atomic operation, that would need shader model 6.6 and limits the compatible platform to Windows 11+ in DX12 RHI. After introducing DirectX Agility SDK, one may run it in some Windows 10 versions. This point has been verify by some of our real projects.
Feature design description:
According to the official blog of DirectX Agility SDK, to introduce it, I think the best and most efficient way to introduce it is to add the
D3D12SDKVersion
andD3D12SDKPath
keyword to the main.cpp, and use a compile flag to control whether or not enabling it.As mentioned before, you may see that Unreal Engine is also using this way like this.
Technical design description:
Introduce
USE_D3D12_AGILITY_SDK
macro to control whether or not enabling DirectX Agility SDK in compile time.I am planning to introduce
USE_D3D12_AGILITY_SDK
macro to control whether or not enabling it:in both
Code/Editor/CMakeLists.txt
andCode/LauncherUnified/CMakeLists.txt
, addAdd COMPILE_DEFINITIONS
$<$<BOOL:${USE_D3D12_AGILITY_SDK}>:USE_D3D12_AGILITY_SDK>
in both targetsLauncher.Game.Static
andEditor
Use DirectX Agility SDK in both Editor and GameLauncher:
in
Code/LauncherUnified/Platform/Windows/Launcher_Game_Windows.cpp
, appendin
Code/Editor/main.cpp
, add the following lines beforeint main(int argc, char* argv[])
Introduce DirectX Agility SDK as 3rdParty dependency?
For this part I am not quite sure about the correct way to do it, in our inner version we pre-built the binary and put them in our own 3rdParty server, so that the engine can download and introduce it when compiling, I am not sure what's the correct way to introduce a new 3rdParty package to the community version? And is it a good idea to introduce binary? Would it be better to include the source code of it just like the DirectX Shader Compiler here: o3de/DirectXShaderCompiler?
What are the advantages of the feature?
The engine can be better compatible to different Windows versions, and the developer still have the flexibility to control enable it or not.
What are the disadvantages of the feature?
The changes in main.cpp is a little bit ugly? But I couldn't find a better way to do it since it is required by the design of Agility SDK.
Are there any alternatives to this feature?
No
How will users learn this feature?
Users won't notice this feature, they will only find that in lower version of Windows they can still using some advanced shader features, the producer of the engine have the control of enabling or not.
Are there any open questions?
The best way to introduce the SDK, introduce a pre-built binary or introduce the source code and compile it along with the engine? I myself prefer introducing pre-built SDK, we are already using this way in our inner version, but I don't know how can I do it for the community version.
The text was updated successfully, but these errors were encountered: