Skip to main content

denoise_texture

Function denoise_texture 

Source
pub fn denoise_texture(
    device: &OidnDevice,
    wgpu_device: &Device,
    wgpu_queue: &Queue,
    input: &Texture,
    output: &Texture,
    format: DenoiseTextureFormat,
    options: &DenoiseOptions,
) -> Result<(), Error>
Expand description

Denoises a wgpu texture by readback → OIDN (CPU) → upload.

Input and output can be the same texture for in-place denoising, or different. Supported formats: DenoiseTextureFormat::Rgba32Float, DenoiseTextureFormat::Rgba16Float. Only RGB is denoised; alpha is preserved.

Texture usage: input must have TextureUsages::COPY_SRC; output must have TextureUsages::COPY_DST.

This is a blocking call: it submits copy commands, waits for readback, runs OIDN, then uploads.

§Errors

Returns Error::InvalidDimensions if texture sizes or array layers are incompatible, or Error::BufferMapFailed if wgpu buffer mapping fails. OIDN execution errors are returned as Error::OidnError or other Error variants.