| Crates.io | nrd-sys |
| lib.rs | nrd-sys |
| version | 0.2.0 |
| created_at | 2023-09-11 23:29:24.121025+00 |
| updated_at | 2023-12-17 05:42:53.744104+00 |
| description | Rust FFI for NVIDIA Realtime Denoiser |
| homepage | |
| repository | https://github.com/dust-engine/nrd-sys |
| max_upload_size | |
| id | 970218 |
| size | 74,915 |
Rust bindings for the NVIDIA Real Time Denoisers SDK, targeting Vulkan applications.
NVIDIA Real-Time Denoisers (NRD) is a spatio-temporal API agnostic denoising library. The library has been designed to work with low rpp (ray per pixel) signals. NRD is a fast solution that slightly depends on input signals and environment conditions.
Supports both Windows and Linux. Pre-compiled binaries are automatically downloaded and linked.
The binaries are compiled from a custom NRD fork, which is necessary to make the SDK work better with Rust. The fork contains the following changes:
CI to compile the binaries.
Updated the allocator interface so that the allocation size and alignments (as required by the Rust allocation API) are passed in on free.
fn main() {
let lib_desc = nrd_sys::Instance::library_desc();
let id1 = nrd_sys::Identifier(0);
let mut instance = nrd_sys::Instance::new(&[nrd_sys::DenoiserDesc {
identifier: id1,
denoiser: nrd_sys::Denoiser::ReblurDiffuse,
render_width: 100,
render_height: 100,
}])
.unwrap();
let desc = instance.desc();
instance
.set_common_settings(&nrd_sys::CommonSettings::default())
.unwrap();
instance
.set_denoiser_settings(id1, &nrd_sys::ReferenceSettings::default())
.unwrap();
let dispatches = instance.get_compute_dispatches(&[id1]).unwrap();
// Now, make API calls based on `dispatches`
}
The pre-compiled binaries included with this package only contains SPIR-V shader. If you need DXIL / DXBC shader for DirectX integration, feel free to make that a Cargo feature and create a PR.