FidelityFX-FSR2 icon indicating copy to clipboard operation
FidelityFX-FSR2 copied to clipboard

FSR2 usage as a CMake library dependency

Open jeremyong-az opened this issue 2 years ago • 2 comments

Hey FSR2 team! I wanted to raise a few issues that, if fixed, would make FSR2 integration a bit more streamlined in other OSS projects/renderers. It's fairly inconvenient to restrict FSR2 usage to vendored compiled libraries. Renderers/codebases that use CMake would likely prefer to include FSR2 in the source tree directly if possible.

Some issues preventing this at the moment:

  • From a single source tree, there isn't a way (without modification) to compile both VK and DX12 backends even if this is what you'd want in Windows
  • The build requires Cauldron, which while great when exploring the samples, is a lot of unneeded code to fetch/build as part of the project when only the lib is needed. At the moment, cmake scripts in FSR2 reference common.cmake in libs/cauldron It may be that the CMakeLists filex that reference these scripts aren't actually needed when just building the lib itself
  • A number of the cmake options and parts of the implementation assume MSVC usage. Using /MP or parsing the linker flags to determine if we are targeting a 32 or 64 bit architecture for example.
  • The CMake script requires that the Vulkan SDK be found and installed, but strictly speaking this should not be necessary for VK applications that use the runtime loader. Graphics engineers will have the SDK installed as a matter of course, but endusers might not

jeremyong-az avatar Oct 03 '22 02:10 jeremyong-az

Trying things out a bit, it may not be too difficult to alleviate the second issue there. All that's needed is a cmake option to exclude the sample from building (which would exclude src/DX12 and src/VK)

jeremyong-az avatar Oct 03 '22 03:10 jeremyong-az

I'd definitely be interested in using this as a CMake dependency!

I think there's some related work in https://github.com/GPUOpen-Effects/FidelityFX-FSR2/pull/60.

ectucker1 avatar Oct 03 '22 19:10 ectucker1