Twinklebear / oidn-rs

Rust bindings to Intel's OpenImageDenoise Library
MIT License
24 stars 12 forks source link

Albedo / Normal Buffer References Lifetime #5

Closed DasCapschen closed 3 years ago

DasCapschen commented 4 years ago

Is it really necessary to keep the normal and albedo buffer around in the struct with a 'b lifetime?
imo, this just complicates things and leads to unnecessary complaining of the borrow checker.
The only part of code where I saw it actually being used is the execute function, so we might as well pass them in when calling?
execute(&mut self, color: &[f32], albedo: Option<&[f32]>, normal: Option<&[f32]>, output: &mut [f32])

If we really do want to keep them around, could we use a different kind of reference without explicit lifetime?

Twinklebear commented 4 years ago

Changing execute to take the set of buffers is probably the cleanest API to provide actually, I'll update oidn-rs to do that

virtualritz commented 3 years ago

~+1~

Twinklebear commented 3 years ago

This is now resolved in release 1.2.0 https://github.com/Twinklebear/oidn-rs/releases/tag/1.2.0