11 releases

0.1.11 Apr 7, 2024
0.1.10 Apr 7, 2024
0.1.9 Feb 12, 2024
0.1.6 Oct 3, 2023
0.1.4 Sep 28, 2023

#551 in Hardware support

Download history 96/week @ 2024-02-12 90/week @ 2024-02-19 24/week @ 2024-02-26 13/week @ 2024-03-04 26/week @ 2024-03-11 141/week @ 2024-04-01 66/week @ 2024-04-08

208 downloads per month

MIT license

6.5MB
9K SLoC

C++ 4K SLoC // 0.1% comments Python 3K SLoC // 0.4% comments Rust 1.5K SLoC // 0.0% comments GLSL 428 SLoC // 0.3% comments HLSL 417 SLoC // 0.3% comments C 9 SLoC // 0.6% comments AsciiDoc 5 SLoC

Unsafe Rust bindings for FidelityFX Super Resolution 2

Vulkan psuedo code

// Create the FSR interface
// The context created below should not out live the scratch buffer.
let mut scratch_buffer =
    vec![0u8; fsr::vk::get_scratch_memory_size(&vk_instance, vk_physical_device)];
let interface = fsr::vk::get_interface(
    &vk_entry,
    &vk_instance,
    vk_physical_device,
    &mut scratch_buffer,
).unwrap();

// Create the FSR context
let context_desc = fsr::ContextDescription {
    interface: fsr_interface,
    device: &fsr::vk::get_device(vk_device),
    display_size: [1920, 1080],
    max_render_size: [1280, 720],
    flags: fsr::InitializationFlagBits::ENABLE_HIGH_DYNAMIC_RANGE
    message_callback: None,
};
let context = fsr::Context::new(context_desc).unwrap();

// Dispatch gpu work
let desc = fsr::DispatchDescription::new(
    vk_command_list.into(),
    color,
    depth,
    velocity,
    output,
    delta_time_s,
    [1280, 720],
);
fsr_context.dispatch(desc).expect("Failed to dispatch fsr");

Dependencies

~1–42MB
~624K SLoC