Knowing which RHI has been used in a project from the code?

There no way to do this in compilation time as RHI is fully dynamic and can be switched on runtime, so on compilation time there no way to figure which RHI gonna be used and not mention as enigne is already compiled in launcher build. You need to check this on runtime, if you can not build specific functions if RHI is not active, you could do sperate module which loaded manually when specific RHI is used. You can get RHI information from here in im not mistaken

https://docs.unrealengine.com/en-US/API/Runtime/RHI/GetDynamicRHI/index.html

Pretty much everything in UE4 is modular and dynamic, only thing that i know that is statically build is platform support (FPlatform), but since platform can have multiple rendering library rendering is not part of it. No to mention Reader Hardware Interface has Interface in name for the reason

1 Like