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
25,577 downloads per month
6.5MB
9K
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