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

#125 in Graphics APIs

Download history 9/week @ 2024-08-25 43/week @ 2024-09-01 24/week @ 2024-09-08 27/week @ 2024-09-15 53/week @ 2024-09-22 2153/week @ 2024-09-29 2778/week @ 2024-10-06 4892/week @ 2024-10-13 4507/week @ 2024-10-20 5869/week @ 2024-10-27 6370/week @ 2024-11-03 6160/week @ 2024-11-10 6043/week @ 2024-11-17 5924/week @ 2024-11-24 7450/week @ 2024-12-01

25,577 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

~0.8–41MB
~589K SLoC