fsr-rs icon indicating copy to clipboard operation
fsr-rs copied to clipboard

Add FSR 2 sources as submodule / build with CMake / update naming in bindings

Open ComfyFluffy opened this issue 1 year ago • 0 comments

Checklist

  • [x] I have read the Contributor Guide
  • [x] I have read and agree to the Code of Conduct
  • [x] I have added a description of my changes and why I'd like them included in the section below

Description of Changes

Note: fsr crate is not tested and is not keeped up for some changes.

I have only tested integrating the updated fsr-sys with Vulkan (ash&vulkano) on Windows 11: https://github.com/ComfyFluffy/block-world/blob/main/src/fsr.rs. Further tests and changes are wanted.

Compile

  • The FSR 2 Project is included as submodule, thus updating to 2.2.1. (https://github.com/EmbarkStudios/fsr-rs/issues/5)
  • FSR 2 is now built with CMake and linked at compile time, using official CMake scripts. This should also make future updates easier.
  • If feature flag vulkan is enabled, Vulkan library will be linked on compiling.

Naming

  • Prefix like ffxFsr2 is removed by regex r"(?i)^ffx_?(fsr2)?_?"
  • Suffix in Vulkan/DX12 bindings is removed by regex r"(DX12|VK)$"
  • Functions' first letters are made lowercase.

Bindgen

  • widestring is removed from fsr-sys.
  • Comments are excluded from bindgens. This solves test errors on doc test: https://github.com/EmbarkStudios/fsr-rs/issues/4. I suggest that we format the comments in Rust's format and include the documents manually in fsr-sys or only fsr.
  • Update other bindgen args. Not sure whether this can cause other issues. Link names now start with \u{1} in bindgens.

ComfyFluffy avatar Apr 06 '24 16:04 ComfyFluffy