Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FSR 2.2 temporal upscaling and antialiasing #12768

Closed
wants to merge 9 commits into from
Closed

Conversation

JMS55
Copy link
Contributor

@JMS55 JMS55 commented Mar 28, 2024

Objective

  • Add a new plugin that provides a much better TAA/TSR solution for Vulkan/DirectX12 backends.
  • Closes Support for AMD FSR 2.0 #5232 (This is my 3rd attempt, we'll see if third time's the charm 😃)
  • Not in scope: FSR3 Frame Generation
    • Same with DLSS, DLSS Frame Generation, XeSS, MTLFXTemporalScaler, and DirectSR/Streamline.

Solution

  • Add the fsr_sys crate
  • FSR has no official support for Linux, I had to modify the build system to get it to build.
  • Add bevy_core_pipeline::FsrPlugin

Wgpu does not have a great interop story with native graphics APIs at the moment. I'm only 30% sure this is in any way sane, and it may break due to horrible race conditions or deadlocks with multithreaded resource access or changes to rendering. I've tried to make it as safe as possible, but it may be breakable if users are doing custom rendering or as the codebase develops over time.

TODO

  • Vendor new headers, regenerate bindings, and rebuild static libraries for FSR 2.2
  • Finish FsrManager
  • Setup ECS systems and render nodes to run FSR for a given camera
  • Transparency/reactivity mask support
  • User docs
  • Validation to prevent API misuse
  • Document fsr_sys build process and add windows support
  • Ensure everything works on linux, windows, debug, and release profiles
  • DirectX12 support
  • Multiple camera support (maybe)

Changelog

  • Added bevy_core_pipeline::FsrPlugin and associated types which provides a better TAA/TSR solution than bevy_core_pipeline::TemporalAntiAliasPlugin. FSR is guarded behind the fsr feature flag, and it is only supported on certain platforms - read the docs for details.

@JMS55 JMS55 added C-Feature A new feature, making something new possible A-Rendering Drawing game state to the screen O-Vulkan Specific to the Vulkan render API O-DX12 Specific to the DX12 render API labels Mar 28, 2024
@JMS55 JMS55 added S-Blocked This cannot move forward until something else changes X-Controversial There is active debate or serious implications around merging this PR labels Mar 29, 2024
@JMS55
Copy link
Contributor Author

JMS55 commented Mar 31, 2024

The main blocker at this point is that we don't have any way of overriding rendering to happen at a lower internal resolution, and then upscaling to the camera's target resolution. I've looked into adding support for this, but it gets insanely complicated. I don't know how to solve this.

@JMS55
Copy link
Contributor Author

JMS55 commented Aug 8, 2024

I'd still like to implement this, but it requires a lot of work in existing rendering code to support upscaling mid-frame.

@JMS55 JMS55 closed this Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Feature A new feature, making something new possible O-DX12 Specific to the DX12 render API O-Vulkan Specific to the Vulkan render API S-Blocked This cannot move forward until something else changes X-Controversial There is active debate or serious implications around merging this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for AMD FSR 2.0
1 participant