To use the DirectX12 Agility SDK the executable needs to export two constants
https://devblogs.microsoft.com/directx/gettingstarted-dx12agility/#parametersa
Currently it is only possible to export methods by using the UnmanagedCallersOnly attribute
https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.unmanagedcallersonlyattribute?view=net-7.0
It's possible to export constants from a native AOT executable by linking it with a static lib that contains these. But you need to make sure that anything else in this lib is actually used so that the linker does not drop it.
It would be nice if there would be a way to have these constants directly in a C# code file instead.
To use the DirectX12 Agility SDK the executable needs to export two constants
https://devblogs.microsoft.com/directx/gettingstarted-dx12agility/#parametersa
Currently it is only possible to export methods by using the UnmanagedCallersOnly attribute
https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.unmanagedcallersonlyattribute?view=net-7.0
It's possible to export constants from a native AOT executable by linking it with a static lib that contains these. But you need to make sure that anything else in this lib is actually used so that the linker does not drop it.
It would be nice if there would be a way to have these constants directly in a C# code file instead.