I’ve been porting DX12 samples to odin to practice both a bit, I’ve been stuck at the WorkGraphs sample (this one) because that requires to compile a shader with the target “lib_6_8” and the compiler keeps failing with a error: invalid profile lib_6_8
After a lot of trial and error, I managed to make it work by copying dxcompiler.dll and dxil.dll from the Microsoft samples into the working directory of my project. Copying the ones that come with odin does not work, which makes me think those are quite old.
I’m not sure how does odin find dll files or dynamic linking in general yet, it might be that something in my system is interfering.
Ok, I have learned about something called the Agility SDK and now I’m questioning my decisions.
TLDR: DirectX is apparently no longer being mainly updated through SO updates but you can get that SDK to get the latest features. The normal way to get the SDK is through NuGet.
So that particular sample I’m fighting against is using some of this latest features that require all of that to work.
Getting Agility SDK to work with directx12 has been a pain for me too. I was trying to use it through NRI (GitHub - steinarb1234/NRI-odin: Odin bindings for Nvidia NRI · GitHub). Eventually I gave up and decided to use Vulkan only but then I went to SDL3. SDL GPU uses a minimal feature set that doesn’t require Agility SDK, which is fine by me but your requirements might be different. If you get it working, can you post about it here?
I’ve gotten it to work, but at what price
First, you need to download the binaries
With those in place, you also need to get the bindings. This is where my approach is “suboptimal” (to say the least) I should be using an automatic binding generator like this one, but I’m doing it by hand just because I can (there is a d3d12.h in the SDK that has more stuff than the d3d12.h that you’ll have by default, so I’m adding the new things I need to my own d3d12.odin in a way that is compatible with the d3d12.odin that is in the vendor folder). One day I might do it the right way and put it somewhere on the internet. Today is not that day.
Once you have that, you need to put D3D12Core.dll and d3d12SDKLayers.dll in a folder near the executable (NOT THE WORKING DIRECTORY, that tripped me for a long time). All the docs assume the folder is called. You should not place it on the same directory because there is a bug that happens if you do so.
Finally you need to tell d3d12 to that you want to use the modern features and dlls, to do so you need to add this symbols to the code you’ll be turning into a .exe:
@(export, rodata)
D3D12SDKVersion: u32 = 619
@(export, rodata)
D3D12SDKPath: cstring = ".\\D3D12\\"
The first tells you the version you want to use. The second is the path from the executable to the folder you have stored the dlls
1 Like