Blender V5.3
denoiser_dlss.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2025 NVIDIA Corporation
2 * SPDX-FileCopyrightText: 2011-2022 Blender Foundation
3 *
4 * SPDX-License-Identifier: Apache-2.0 */
5
6#pragma once
7
8#ifdef WITH_DLSS
9
11
12struct NVSDK_NGX_Handle;
13struct NVSDK_NGX_CUDADevice;
14
16
17/* Implementation of denoising API which uses DLSS. */
18class DLSSDenoiser : public DenoiserGPU {
19 public:
20 DLSSDenoiser(Device *denoiser_device, const DenoiseParams &params);
21 ~DLSSDenoiser();
22
23 static bool is_device_supported(const DeviceInfo &device);
24
25 private:
26 bool denoise_create_if_needed(DenoiseContext &context) override;
27
28 bool denoise_configure_if_needed(DenoiseContext &context) override;
29
30 bool denoise_filter_color_preprocess(const DenoiseContext &context,
31 const DenoisePass &pass) override;
32 bool denoise_filter_color_postprocess(const DenoiseContext &context,
33 const DenoisePass &pass) override;
34
35 bool denoise_filter_guiding_preprocess(DenoiseContext &context) override;
36
37 bool denoise_run(const DenoiseContext &context, const DenoisePass &pass) override;
38
39 NVSDK_NGX_Handle *handle_ = nullptr;
40 NVSDK_NGX_CUDADevice *ngx_device_ = nullptr;
41
42 struct CUDATexture {
43 void init(Device *device, int width, int height, int num_components);
44 void destroy();
45
46 void *array = nullptr;
47 uint64_t texture_handle = 0;
48 uint64_t surface_handle = 0;
49 };
50 CUDATexture tex_color_;
51 CUDATexture tex_depth_;
52 CUDATexture tex_diffuse_albedo_;
53 CUDATexture tex_specular_albedo_;
54 CUDATexture tex_normal_roughness_;
55 CUDATexture tex_motion_;
56 CUDATexture tex_specular_motion_;
57 CUDATexture tex_output_;
58
59 int last_width_ = 0;
60 int last_height_ = 0;
61 float last_upscale_factor_ = 0.0f;
62};
63
65
66#endif
void init()
unsigned long long int uint64_t
#define CCL_NAMESPACE_END