Skip to content

DLSS 5 Neural Rendering for Images & Video with Frame Generation, RTX Video Super Resolution, HDR, and Color Grading

Add files via upload

Merserk2e749632d739
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..f3ab6a3
--- /dev/null
+++ b/README.md
@@ -0,0 +1,49 @@
+# Portable DLSS 5 Video Converter
+
+This Windows application renders every frame through the supplied DLSS 5 Neural Rendering feature-18 runtime and writes a new video with the original audio and metadata. Optical flow supplies only the current-to-previous motion vectors required by the model. No heuristic depth, masks, sharpening, denoising, resizing, DLAA, ReShade, or RenoDX stage modifies the image.
+
+## Start
+
+Double-click `start.bat`. The portable Gradio interface opens at `http://127.0.0.1:7860`. No installation or internet connection is required.
+
+1. Upload a video.
+2. **Strong / Cinematic** is selected by default. Faithful and Natural remain available for a milder result.
+3. Click **Render whole video**.
+4. Download the video and its JSON report. Every output frame must carry an exact successful feature-18 result or the render is rejected.
+
+Outputs and their JSON reports are written to the automatically created `outputs` directory. Temporary job data is removed after every completed, failed, or cancelled render. **Stop** terminates the decoder, DLSS worker, and encoder and removes incomplete output.
+
+## GPU support
+
+- RTX 40/50: primary support target.
+- RTX 30: allowed in beta mode and may be extremely slow.
+- RTX 20, non-RTX NVIDIA, AMD, and Intel GPUs: rejected for DLSS processing.
+
+The native host explicitly selects an NVIDIA adapter on hybrid AMD/Intel systems. It was functionally tested here on an RTX 4060 Ti with driver 616.56.
+
+## Output and limitations
+
+- Source resolution is always preserved. There is no pre-upscaling or DLSS Super Resolution pass.
+- H.264 NVENC MP4 with AAC is the default. HEVC, AV1, and MKV are available when the GPU and container support them. H.264/HEVC fall back to software encoding when NVENC is unavailable.
+- Variable timestamps are carried in a NUT stream to FFmpeg. The first video stream is processed; audio and metadata are remuxed, and MKV also preserves compatible subtitle streams.
+- HDR preservation is disabled because the verified path is RGBA8. HDR files are handled as SDR rather than being incorrectly tagged as HDR.
+- Optical-flow motion cannot equal engine-provided object motion. Fast motion, occlusions, thin objects, and cuts may show temporal artifacts.
+- The supplied modified model is experimental. Its original snippet checks that its caller is named `nvngx.dll`, so the standalone executable intentionally uses that filename; it is not NVIDIA's NGX core DLL.
+
+## Verified build
+
+Before release cleanup, the test sample rendered completely through the clean runtime: 124/124 direct feature-18 evaluations, 1344×768 H.264, AAC audio, and 5.166 s output duration. A Strong/Cinematic render differed from an encoding-only baseline by RGB MAE 7.41 and PSNR 27.33 dB. Test media and generated results are intentionally not included in this clean package.
+
+The worker uses binary protocol `D5V2`; launch it through `start.bat` rather than interactively.
+
+## Publishing to GitHub
+
+Portable FFmpeg and the DLSSNR model exceed GitHub's normal per-file size limit. This repository includes Git LFS attributes, so install Git LFS and run `git lfs install` before the first commit. Confirm that you have redistribution rights for the supplied modified NVIDIA model before publishing it publicly.
+
+## Source layout
+
+- `app.py` — Gradio interface.
+- `dlss5_converter` — probing, optical-flow motion generation, D5V2 worker protocol, encoding, cancellation, and verification.
+- `native/DLSS5-Feeder` — MIT reference host adapted with NVIDIA-adapter selection and video-frame transport.
+- `native/NVIDIA-DLSS` — the NVIDIA NGX headers, required x64 import library, and license needed to rebuild the worker.
+- `bin/runtime` — clean offline runtime containing only the standalone worker image and supplied DLSSNR model.
diff --git a/app.py b/app.py
new file mode 100644
index 0000000..32a834d
--- /dev/null
+++ b/app.py
@@ -0,0 +1,115 @@
+from __future__ import annotations
+
+import traceback
+from pathlib import Path
+
+import gradio as gr
+
+from dlss5_converter.core import (
+ ConversionOptions,
+ OUTPUTS,
+ cancel_active_job,
+ convert_video,
+ detect_gpu,
+)
+
+
+def gpu_banner() -> str:
+ try:
+ gpu = detect_gpu()
+ beta = " — RTX 30 beta mode" if gpu["beta"] else ""
+ return (
+ f"**Ready:** {gpu['name']} · driver {gpu['driver']} · "
+ f"{gpu['memory_mb'] // 1024} GB VRAM{beta}"
+ )
+ except Exception as exc:
+ return f"**Not ready:** {exc}"
+
+
+def render_video(
+ input_path: str,
+ profile: str,
+ codec: str,
+ container: str,
+ quality: str,
+ progress=gr.Progress(track_tqdm=False),
+):
+ if not input_path:
+ raise gr.Error("Choose a video first.")
+ options = ConversionOptions(
+ profile=profile,
+ codec=codec,
+ container=container,
+ quality=quality,
+ )
+
+ def report(value: float, message: str) -> None:
+ progress(value, desc=message)
+
+ try:
+ result = convert_video(input_path, options, progress=report)
+ except Exception as exc:
+ traceback.print_exc()
+ raise gr.Error(str(exc)) from exc
+ preview = result.output_path if Path(result.output_path).suffix.lower() == ".mp4" else None
+ status = (
+ f"Complete: {result.frames} frames processed on {result.gpu} in "
+ f"{result.elapsed_seconds:.1f}s. All {result.nr_count_evidence} frames returned success "
+ "from direct feature 18."
+ )
+ return preview, result.output_path, result.report_path, status
+
+
+with gr.Blocks(title="DLSS 5 Video Converter") as demo:
+ gr.Markdown(
+ "# DLSS 5 Video Converter\n"
+ "Render an entire video through the experimental NVIDIA DLSS 5 Neural Rendering runtime. "
+ "The supplied `nvngx_dlssnr.dll` is the only image-transforming stage. Optical flow supplies required motion vectors; "
+ "there is no DLAA, ReShade, RenoDX, depth enhancer, resize, sharpening, or denoising fallback.\n\n"
+ "> Experimental reverse-engineered integration. RTX 40/50 are primary; RTX 30 is beta. A failed feature-18 call aborts the render."
+ )
+ gr.Markdown(gpu_banner())
+ with gr.Row():
+ with gr.Column(scale=3):
+ source = gr.Video(label="Input video", sources=["upload"], format=None)
+ with gr.Column(scale=2):
+ profile = gr.Radio(
+ ["Faithful", "Natural", "Strong / Cinematic"], value="Strong / Cinematic", label="Native DLSS 5 profile"
+ )
+ quality = gr.Radio(["High", "Balanced", "Small"], value="High", label="Encoding quality")
+
+ with gr.Accordion("Output format", open=False):
+ with gr.Row():
+ codec = gr.Dropdown(["H.264", "HEVC", "AV1"], value="H.264", label="Video codec")
+ container = gr.Dropdown(["MP4", "MKV"], value="MP4", label="Container")
+ gr.Checkbox(
+ value=False,
+ interactive=False,
+ label="Preserve HDR (disabled: verified feature-18 path is currently RGBA8; HDR input is safely output as SDR)",
+ )
+
+ with gr.Row():
+ render = gr.Button("Render whole video", variant="primary")
+ stop = gr.Button("Stop", variant="stop")
+ status = gr.Textbox(label="Status", interactive=False)
+ preview = gr.Video(label="MP4 preview", interactive=False)
+ with gr.Row():
+ output_file = gr.File(label="Rendered video")
+ report_file = gr.File(label="Render report")
+
+ inputs = [
+ source, profile, codec, container, quality,
+ ]
+ render.click(render_video, inputs=inputs, outputs=[preview, output_file, report_file, status], concurrency_limit=1)
+ stop.click(cancel_active_job, outputs=status, queue=False)
+
+
+if __name__ == "__main__":
+ OUTPUTS.mkdir(exist_ok=True)
+ demo.queue(default_concurrency_limit=1).launch(
+ server_name="127.0.0.1",
+ inbrowser=True,
+ share=False,
+ allowed_paths=[str(OUTPUTS.resolve())],
+ show_error=True,
+ )
diff --git a/dlss5_converter/__init__.py b/dlss5_converter/__init__.py
new file mode 100644
index 0000000..267ce60
--- /dev/null
+++ b/dlss5_converter/__init__.py
@@ -0,0 +1,5 @@
+"""Portable experimental DLSS 5 video converter."""
+
+from .core import ConversionOptions, ConversionResult, convert_video, probe_video
+
+__all__ = ["ConversionOptions", "ConversionResult", "convert_video", "probe_video"]
diff --git a/dlss5_converter/core.py b/dlss5_converter/core.py
new file mode 100644
index 0000000..de7f4c6
--- /dev/null
+++ b/dlss5_converter/core.py
@@ -0,0 +1,481 @@
+from __future__ import annotations
+
+import json
+import hashlib
+import os
+import re
+import shutil
+import struct
+import subprocess
+import threading
+import time
+from dataclasses import asdict, dataclass
+from fractions import Fraction
+from pathlib import Path
+from typing import Callable
+
+import av
+import cv2
+import numpy as np
+
+from .guides import TemporalGuideGenerator
+
+
+ROOT = Path(__file__).resolve().parents[1]
+RUNTIME = ROOT / "bin" / "runtime"
+FFMPEG = ROOT / "bin" / "ffmpeg" / "bin" / "ffmpeg.exe"
+FFPROBE = ROOT / "bin" / "ffmpeg" / "bin" / "ffprobe.exe"
+WORKER = RUNTIME / "nvngx.dll" # executable image name required by the signed snippet caller check
+OUTPUTS = ROOT / "outputs"
+JOBS = ROOT / "jobs"
+
+VIDEO_MAGIC = 0x32563544
+FRAME_MAGIC = 0x314D5246
+OUT_MAGIC = 0x3154554F
+
+
+@dataclass(slots=True)
+class ConversionOptions:
+ profile: str = "Strong / Cinematic"
+ codec: str = "H.264"
+ container: str = "MP4"
+ quality: str = "High"
+ preserve_hdr: bool = False
+ warmup_frames: int = 120
+
+
+PROFILES = {
+ "Faithful": dict(profile=0, preset=0, style=0, auto_mask=0, ui_correction=0,
+ intensity=0.70, local_tone=0.75, local_structure=0.75, skin_structure=-1.0),
+ "Natural": dict(profile=1, preset=0, style=1, auto_mask=0, ui_correction=0,
+ intensity=1.00, local_tone=1.00, local_structure=1.00, skin_structure=-1.0),
+ "Strong / Cinematic": dict(profile=2, preset=2, style=2, auto_mask=1, ui_correction=0,
+ intensity=1.65, local_tone=1.40, local_structure=1.50, skin_structure=1.0),
+}
+
+
+@dataclass(slots=True)
+class ConversionResult:
+ output_path: str
+ report_path: str
+ frames: int
+ nr_count_evidence: int
+ elapsed_seconds: float
+ gpu: str
+
+
+class Cancelled(RuntimeError):
+ pass
+
+
+class JobController:
+ def __init__(self) -> None:
+ self.cancel = threading.Event()
+ self.lock = threading.Lock()
+ self.processes: list[subprocess.Popen] = []
+
+ def register(self, process: subprocess.Popen) -> None:
+ with self.lock:
+ self.processes.append(process)
+
+ def unregister(self, process: subprocess.Popen) -> None:
+ with self.lock:
+ if process in self.processes:
+ self.processes.remove(process)
+
+ def stop(self) -> None:
+ self.cancel.set()
+ with self.lock:
+ processes = list(self.processes)
+ for process in processes:
+ if process.poll() is None:
+ try:
+ process.terminate()
+ except OSError:
+ pass
+
+
+_ACTIVE_LOCK = threading.Lock()
+_ACTIVE: JobController | None = None
+
+
+def cancel_active_job() -> str:
+ global _ACTIVE
+ if _ACTIVE is None:
+ return "No render is running."
+ _ACTIVE.stop()
+ return "Stop requested; partial video will be removed and diagnostics retained."
+
+
+def _run_json(command: list[str]) -> dict:
+ result = subprocess.run(command, capture_output=True, text=True, encoding="utf-8", errors="replace")
+ if result.returncode:
+ raise RuntimeError(result.stderr.strip() or "Media probe failed")
+ return json.loads(result.stdout)
+
+
+def probe_video(path: str | os.PathLike[str]) -> dict:
+ data = _run_json(
+ [
+ str(FFPROBE),
+ "-v",
+ "error",
+ "-count_frames",
+ "-select_streams",
+ "v:0",
+ "-show_entries",
+ "stream=index,codec_name,width,height,avg_frame_rate,r_frame_rate,time_base,duration,nb_frames,nb_read_frames,color_primaries,color_transfer,color_space:stream_tags=rotate:stream_side_data=rotation",
+ "-show_entries",
+ "format=duration,format_name",
+ "-of",
+ "json",
+ str(path),
+ ]
+ )
+ streams = data.get("streams") or []
+ if not streams:
+ raise ValueError("The selected file contains no decodable video stream.")
+ stream = streams[0]
+ rotation = int((stream.get("tags") or {}).get("rotate", 0) or 0)
+ for side in stream.get("side_data_list") or []:
+ if "rotation" in side:
+ rotation = int(side["rotation"] or 0)
+ rotation %= 360
+ width, height = int(stream["width"]), int(stream["height"])
+ if rotation in (90, 270):
+ width, height = height, width
+ frames = int(stream.get("nb_read_frames") or stream.get("nb_frames") or 0)
+ if frames <= 0:
+ raise ValueError("Could not determine an exact frame count for this video.")
+ rate_text = stream.get("avg_frame_rate") or stream.get("r_frame_rate") or "30/1"
+ rate = Fraction(rate_text) if rate_text != "0/0" else Fraction(30, 1)
+ transfer = stream.get("color_transfer") or "unknown"
+ return {
+ "width": width,
+ "height": height,
+ "coded_width": int(stream["width"]),
+ "coded_height": int(stream["height"]),
+ "rotation": rotation,
+ "frames": frames,
+ "fps": float(rate),
+ "rate": rate,
+ "time_base": Fraction(stream.get("time_base") or "1/1000"),
+ "duration": float((data.get("format") or {}).get("duration") or stream.get("duration") or 0),
+ "codec": stream.get("codec_name") or "unknown",
+ "format": (data.get("format") or {}).get("format_name") or "unknown",
+ "color_transfer": transfer,
+ "hdr": transfer in {"smpte2084", "arib-std-b67"},
+ }
+
+
+def detect_gpu() -> dict:
+ command = [
+ "nvidia-smi",
+ "--query-gpu=name,driver_version,memory.total,compute_cap",
+ "--format=csv,noheader,nounits",
+ ]
+ try:
+ result = subprocess.run(command, capture_output=True, text=True, timeout=10)
+ except (OSError, subprocess.TimeoutExpired) as exc:
+ raise RuntimeError("NVIDIA driver tools are unavailable; an RTX GPU and current driver are required.") from exc
+ candidates = []
+ for line in result.stdout.splitlines():
+ parts = [part.strip() for part in line.split(",")]
+ if len(parts) >= 4 and "RTX" in parts[0].upper():
+ candidates.append(parts)
+ if not candidates:
+ raise RuntimeError("No supported NVIDIA RTX GPU was detected.")
+ name, driver, memory, capability = candidates[0]
+ match = re.search(r"RTX\s+(\d{2})", name.upper())
+ generation = int(match.group(1)) if match else 0
+ if generation < 30:
+ raise RuntimeError(f"{name} is outside the supported RTX 30/40/50 scope.")
+ return {
+ "name": name,
+ "driver": driver,
+ "memory_mb": int(memory),
+ "compute_capability": capability,
+ "generation": generation,
+ "beta": generation == 30,
+ }
+
+
+def resolve_size(metadata: dict, options: ConversionOptions) -> tuple[int, int]:
+ return int(metadata["width"]), int(metadata["height"])
+
+
+def _resize_fit(rgba: np.ndarray, width: int, height: int) -> np.ndarray:
+ source_h, source_w = rgba.shape[:2]
+ scale = min(width / source_w, height / source_h)
+ fit_w = max(1, min(width, int(round(source_w * scale))))
+ fit_h = max(1, min(height, int(round(source_h * scale))))
+ resized = cv2.resize(rgba, (fit_w, fit_h), interpolation=cv2.INTER_LANCZOS4)
+ canvas = np.zeros((height, width, 4), dtype=np.uint8)
+ canvas[..., 3] = 255
+ x = (width - fit_w) // 2
+ y = (height - fit_h) // 2
+ canvas[y : y + fit_h, x : x + fit_w] = resized
+ return canvas
+
+
+def _rotate(frame: np.ndarray, rotation: int) -> np.ndarray:
+ if rotation == 90:
+ return np.ascontiguousarray(np.rot90(frame, 3))
+ if rotation == 180:
+ return np.ascontiguousarray(np.rot90(frame, 2))
+ if rotation == 270:
+ return np.ascontiguousarray(np.rot90(frame, 1))
+ return frame
+
+
+def _read_exact(stream, size: int) -> bytes:
+ chunks = bytearray()
+ while len(chunks) < size:
+ block = stream.read(size - len(chunks))
+ if not block:
+ raise EOFError(f"Native worker stopped after {len(chunks)} of {size} output bytes")
+ chunks.extend(block)
+ return bytes(chunks)
+
+
+def _drain_text(stream, lines: list[str]) -> None:
+ for raw in iter(stream.readline, b""):
+ lines.append(raw.decode("utf-8", "replace").rstrip())
+
+
+def _encoder_probe(codec: str) -> bool:
+ command = [
+ str(FFMPEG), "-v", "error", "-f", "lavfi", "-i", "color=size=256x256:rate=1",
+ "-frames:v", "1", "-c:v", codec, "-f", "null", "-",
+ ]
+ return subprocess.run(command, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode == 0
+
+
+def _codec_command(options: ConversionOptions) -> tuple[list[str], str]:
+ cq = {"High": "17", "Balanced": "20", "Small": "24"}[options.quality]
+ if options.codec == "H.264":
+ if _encoder_probe("h264_nvenc"):
+ return ["-c:v", "h264_nvenc", "-preset", "p6", "-tune", "hq", "-rc", "vbr", "-cq", cq, "-b:v", "0", "-pix_fmt", "yuv420p"], "h264_nvenc"
+ return ["-c:v", "libx264", "-preset", "slow", "-crf", cq, "-pix_fmt", "yuv420p"], "libx264"
+ if options.codec == "HEVC":
+ if _encoder_probe("hevc_nvenc"):
+ return ["-c:v", "hevc_nvenc", "-preset", "p6", "-tune", "hq", "-rc", "vbr", "-cq", cq, "-b:v", "0", "-pix_fmt", "yuv420p"], "hevc_nvenc"
+ return ["-c:v", "libx265", "-preset", "slow", "-crf", cq, "-pix_fmt", "yuv420p"], "libx265"
+ if not _encoder_probe("av1_nvenc"):
+ raise RuntimeError("AV1 NVENC is not supported by this GPU/driver. Choose H.264 or HEVC.")
+ return ["-c:v", "av1_nvenc", "-preset", "p6", "-rc", "vbr", "-cq", cq, "-b:v", "0", "-pix_fmt", "yuv420p"], "av1_nvenc"
+
+
+def _start_encoder(temp_video: Path, options: ConversionOptions, controller: JobController):
+ codec_args, selected = _codec_command(options)
+ command = [
+ str(FFMPEG), "-hide_banner", "-loglevel", "warning", "-y", "-f", "nut", "-i", "pipe:0",
+ "-map", "0:v:0", "-an", *codec_args, "-fps_mode", "passthrough", str(temp_video),
+ ]
+ process = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.DEVNULL, stderr=subprocess.PIPE)
+ controller.register(process)
+ logs: list[str] = []
+ thread = threading.Thread(target=_drain_text, args=(process.stderr, logs), daemon=True)
+ thread.start()
+ return process, thread, logs, selected
+
+
+def _final_mux(temp_video: Path, source: Path, output: Path, options: ConversionOptions) -> None:
+ if options.container == "MKV":
+ maps = ["-map", "0:v:0", "-map", "1:a?", "-map", "1:s?"]
+ streams = ["-c:v", "copy", "-c:a", "copy", "-c:s", "copy"]
+ else:
+ maps = ["-map", "0:v:0", "-map", "1:a?"]
+ streams = ["-c:v", "copy", "-c:a", "aac", "-b:a", "192k", "-movflags", "+faststart"]
+ command = [
+ str(FFMPEG), "-hide_banner", "-loglevel", "warning", "-y", "-i", str(temp_video), "-i", str(source),
+ *maps, "-map_metadata", "1", "-map_chapters", "1", *streams, "-shortest", str(output),
+ ]
+ result = subprocess.run(command, capture_output=True, text=True, encoding="utf-8", errors="replace")
+ if result.returncode:
+ raise RuntimeError("Final audio/metadata mux failed:\n" + result.stderr[-4000:])
+
+
+def convert_video(
+ input_path: str | os.PathLike[str],
+ options: ConversionOptions | None = None,
+ progress: Callable[[float, str], None] | None = None,
+) -> ConversionResult:
+ global _ACTIVE
+ options = options or ConversionOptions()
+ source = Path(input_path).resolve()
+ if not source.is_file():
+ raise FileNotFoundError(source)
+ if options.preserve_hdr:
+ raise RuntimeError("HDR preservation is disabled in this build because the verified DLSSNR path is RGBA8. HDR input is converted to SDR instead of being mislabeled as HDR.")
+ required = [FFMPEG, FFPROBE, WORKER, RUNTIME / "nvngx_dlssnr.dll"]
+ missing = [str(path) for path in required if not path.exists()]
+ if missing:
+ raise RuntimeError("Portable runtime is incomplete:\n" + "\n".join(missing))
+
+ controller = JobController()
+ if not _ACTIVE_LOCK.acquire(blocking=False):
+ raise RuntimeError("Another GPU render is already running.")
+ _ACTIVE = controller
+ started = time.perf_counter()
+ job_dir: Path | None = None
+ output: Path | None = None
+ try:
+ metadata = probe_video(source)
+ gpu = detect_gpu()
+ width, height = resolve_size(metadata, options)
+ OUTPUTS.mkdir(exist_ok=True)
+ JOBS.mkdir(exist_ok=True)
+ stamp = time.strftime("%Y%m%d-%H%M%S") + f"-{time.time_ns() % 1_000_000:06d}"
+ job_dir = JOBS / f"{source.stem}-{stamp}-{os.getpid()}"
+ job_dir.mkdir(parents=True, exist_ok=False)
+ extension = ".mkv" if options.container == "MKV" else ".mp4"
+ output = OUTPUTS / f"{source.stem}_DLSS5_{stamp}{extension}"
+ temp_video = job_dir / "processed-video.mkv"
+ native = PROFILES.get(options.profile)
+ if native is None:
+ raise RuntimeError(f"Unknown native DLSS 5 profile: {options.profile}")
+ if progress:
+ progress(0.01, f"Starting feature 18 on {gpu['name']}")
+
+ creation_flags = getattr(subprocess, "CREATE_NO_WINDOW", 0)
+ worker = subprocess.Popen(
+ [str(WORKER), "--video"], cwd=RUNTIME, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE, creationflags=creation_flags,
+ )
+ controller.register(worker)
+ worker_logs: list[str] = []
+ worker_thread = threading.Thread(target=_drain_text, args=(worker.stderr, worker_logs), daemon=True)
+ worker_thread.start()
+ header = struct.pack(
+ "<10I4f", VIDEO_MAGIC, width, height, int(options.warmup_frames), int(metadata["frames"]),
+ native["profile"], native["preset"], native["style"], native["auto_mask"], native["ui_correction"],
+ native["intensity"], native["local_tone"], native["local_structure"], native["skin_structure"],
+ )
+ worker.stdin.write(header)
+ worker.stdin.flush()
+
+ encoder, encoder_thread, encoder_logs, selected_encoder = _start_encoder(temp_video, options, controller)
+ nut = av.open(encoder.stdin, mode="w", format="nut")
+ input_container = av.open(str(source))
+ input_stream = input_container.streams.video[0]
+ input_stream.thread_type = "AUTO"
+ rate = input_stream.average_rate or metadata["rate"]
+ raw_stream = nut.add_stream("rawvideo", rate=rate)
+ raw_stream.width = width
+ raw_stream.height = height
+ raw_stream.pix_fmt = "rgba"
+ raw_stream.time_base = input_stream.time_base or metadata["time_base"]
+ guides = TemporalGuideGenerator(width, height)
+ delivered = 0
+ scene_resets = 0
+ for index, frame in enumerate(input_container.decode(input_stream)):
+ if controller.cancel.is_set():
+ raise Cancelled("Render stopped by user.")
+ rgba = frame.to_ndarray(format="rgba")
+ rgba = _rotate(rgba, metadata["rotation"])
+ if rgba.shape[1] != width or rgba.shape[0] != height:
+ rgba = _resize_fit(rgba, width, height)
+ rgba = np.ascontiguousarray(rgba, dtype=np.uint8)
+ guide = guides.process(rgba)
+ scene_resets += int(guide.reset and index != 0)
+ pts = int(frame.pts if frame.pts is not None else index)
+ frame_header = struct.pack("<4Iq", FRAME_MAGIC, index, int(guide.reset), 0, pts)
+ worker.stdin.write(frame_header)
+ worker.stdin.write(rgba.tobytes())
+ worker.stdin.write(guide.motion.tobytes())
+ worker.stdin.flush()
+
+ result_header = _read_exact(worker.stdout, struct.calcsize("<5Iq"))
+ magic, out_index, ok, byte_count, ngx_result, out_pts = struct.unpack("<5Iq", result_header)
+ if magic != OUT_MAGIC or not ok or out_index != index or byte_count != width * height * 4:
+ raise RuntimeError(f"Invalid native worker response for frame {index}")
+ if ngx_result != 1:
+ raise RuntimeError(f"Direct feature-18 evaluation failed on frame {index}: 0x{ngx_result:08X}")
+ processed = np.frombuffer(_read_exact(worker.stdout, byte_count), dtype=np.uint8).reshape(height, width, 4)
+ out_frame = av.VideoFrame.from_ndarray(processed, format="rgba")
+ out_frame.pts = out_pts
+ out_frame.time_base = input_stream.time_base or metadata["time_base"]
+ for packet in raw_stream.encode(out_frame):
+ nut.mux(packet)
+ delivered += 1
+ if progress:
+ progress(0.04 + 0.84 * delivered / metadata["frames"], f"DLSS 5 frame {delivered}/{metadata['frames']}")
+
+ if delivered != metadata["frames"]:
+ raise RuntimeError(f"Decoded {delivered} frames but probe reported {metadata['frames']}; refusing an incomplete render.")
+ for packet in raw_stream.encode():
+ nut.mux(packet)
+ nut.close()
+ if encoder.stdin and not encoder.stdin.closed:
+ encoder.stdin.close()
+ input_container.close()
+ worker.stdin.close()
+ worker_code = worker.wait(timeout=60)
+ worker_thread.join(timeout=2)
+ controller.unregister(worker)
+ encoder_code = encoder.wait(timeout=120)
+ encoder_thread.join(timeout=2)
+ controller.unregister(encoder)
+ if worker_code:
+ raise RuntimeError("Native DLSS worker failed:\n" + "\n".join(worker_logs[-40:]))
+ if encoder_code:
+ raise RuntimeError("Video encoder failed:\n" + "\n".join(encoder_logs[-40:]))
+
+ nr_count = delivered
+ create_matches = re.findall(r"direct feature 18 ready:.*result=0x([0-9A-Fa-f]{8})", "\n".join(worker_logs))
+ if not create_matches:
+ raise RuntimeError("Direct feature-18 creation result was not reported; refusing unverifiable output.")
+ direct_create_result = f"0x{create_matches[-1].upper()}"
+ if progress:
+ progress(0.91, "Muxing original audio and metadata")
+ _final_mux(temp_video, source, output, options)
+ verified = probe_video(output)
+ if verified["frames"] != delivered:
+ raise RuntimeError(f"Output verification found {verified['frames']} frames instead of {delivered}.")
+
+ elapsed = time.perf_counter() - started
+ report = {
+ "status": "success",
+ "input": str(source),
+ "output": str(output),
+ "options": asdict(options),
+ "input_metadata": {key: str(value) if isinstance(value, Fraction) else value for key, value in metadata.items()},
+ "output_metadata": {key: str(value) if isinstance(value, Fraction) else value for key, value in verified.items()},
+ "gpu": gpu,
+ "encoder": selected_encoder,
+ "frames_processed": delivered,
+ "scene_resets": scene_resets,
+ "pipeline": "direct-dlssnr-feature18",
+ "feature_id": 18,
+ "feature_18_confirmed": True,
+ "direct_create_result": direct_create_result,
+ "successful_direct_evaluations": nr_count,
+ "model_sha256": hashlib.sha256((RUNTIME / "nvngx_dlssnr.dll").read_bytes()).hexdigest(),
+ "worker_sha256": hashlib.sha256(WORKER.read_bytes()).hexdigest(),
+ "loaded_module_inventory": ["nvngx.dll (standalone worker image)", "nvngx_dlssnr.dll", "system D3D12/DXGI/NGX core"],
+ "carrier_modules_absent": {"nvngx_dlss.dll": True, "ReShade": True, "RenoDX": True},
+ "native_settings": native,
+ "elapsed_seconds": elapsed,
+ "average_fps": delivered / elapsed,
+ "worker_log": worker_logs,
+ "encoder_log": encoder_logs,
+ }
+ report_path = output.with_suffix(output.suffix + ".report.json")
+ report_path.write_text(json.dumps(report, indent=2), encoding="utf-8")
+ if progress:
+ progress(1.0, "Complete — feature 18 confirmed")
+ return ConversionResult(str(output), str(report_path), delivered, nr_count, elapsed, gpu["name"])
+ except Exception as exc:
+ was_cancelled = controller.cancel.is_set()
+ controller.stop()
+ if output and output.exists():
+ output.unlink()
+ if was_cancelled and not isinstance(exc, Cancelled):
+ raise Cancelled("Render stopped by user.") from exc
+ raise
+ finally:
+ _ACTIVE = None
+ _ACTIVE_LOCK.release()
+ if job_dir and job_dir.exists():
+ shutil.rmtree(job_dir, ignore_errors=True)
diff --git a/dlss5_converter/guides.py b/dlss5_converter/guides.py
new file mode 100644
index 0000000..785f78b
--- /dev/null
+++ b/dlss5_converter/guides.py
@@ -0,0 +1,84 @@
+from __future__ import annotations
+
+from dataclasses import dataclass
+
+import cv2
+import numpy as np
+
+
+@dataclass(slots=True)
+class GuideFrame:
+ motion: np.ndarray
+ reset: bool
+ scene_score: float
+
+
+class TemporalGuideGenerator:
+ """Estimate the guide buffers an encoded video does not contain."""
+
+ def __init__(self, width: int, height: int, flow_width: int = 640) -> None:
+ self.width = width
+ self.height = height
+ scale = min(1.0, flow_width / width)
+ self.flow_width = max(64, int(round(width * scale / 2) * 2))
+ self.flow_height = max(64, int(round(height * scale / 2) * 2))
+ self.previous_gray: np.ndarray | None = None
+ self.dis = cv2.DISOpticalFlow_create(cv2.DISOPTICAL_FLOW_PRESET_MEDIUM)
+ self.dis.setUseSpatialPropagation(True)
+ self.dis.setFinestScale(1)
+
+ def _small_gray(self, rgba: np.ndarray) -> np.ndarray:
+ gray = cv2.cvtColor(rgba, cv2.COLOR_RGBA2GRAY)
+ return cv2.resize(gray, (self.flow_width, self.flow_height), interpolation=cv2.INTER_AREA)
+
+ def process(self, rgba: np.ndarray) -> GuideFrame:
+ current = self._small_gray(rgba)
+ pixels = self.width * self.height
+ if self.previous_gray is None:
+ motion = np.zeros((self.height, self.width, 2), dtype=np.float32)
+ reset = True
+ scene_score = 1.0
+ else:
+ scene_score = float(np.mean(cv2.absdiff(current, self.previous_gray))) / 255.0
+ reset = scene_score > 0.24
+ if reset:
+ motion = np.zeros((self.height, self.width, 2), dtype=np.float32)
+ else:
+ # NGX consumes current-to-previous motion in pixel units.
+ cur_to_prev = self.dis.calc(current, self.previous_gray, None)
+ prev_to_cur = self.dis.calc(self.previous_gray, current, None)
+ yy, xx = np.mgrid[0 : self.flow_height, 0 : self.flow_width].astype(np.float32)
+ sample_x = xx + cur_to_prev[..., 0]
+ sample_y = yy + cur_to_prev[..., 1]
+ reverse = cv2.remap(
+ prev_to_cur,
+ sample_x,
+ sample_y,
+ cv2.INTER_LINEAR,
+ borderMode=cv2.BORDER_CONSTANT,
+ )
+ consistency = cv2.magnitude(
+ cur_to_prev[..., 0] + reverse[..., 0],
+ cur_to_prev[..., 1] + reverse[..., 1],
+ )
+ warped_previous = cv2.remap(
+ self.previous_gray,
+ sample_x,
+ sample_y,
+ cv2.INTER_LINEAR,
+ borderMode=cv2.BORDER_REFLECT,
+ )
+ residual = cv2.absdiff(current, warped_previous).astype(np.float32) / 255.0
+ invalid = np.maximum(np.clip(consistency / 2.5, 0.0, 1.0), np.clip(residual * 4.0, 0.0, 1.0))
+ invalid = cv2.dilate(invalid, np.ones((3, 3), np.uint8), iterations=1)
+
+ motion = cv2.resize(cur_to_prev, (self.width, self.height), interpolation=cv2.INTER_LINEAR)
+ motion[..., 0] *= self.width / self.flow_width
+ motion[..., 1] *= self.height / self.flow_height
+ self.previous_gray = current
+ assert motion.size == pixels * 2
+ return GuideFrame(
+ motion=np.ascontiguousarray(motion.astype(np.float16)),
+ reset=reset,
+ scene_score=scene_score,
+ )
diff --git a/native/DLSS5-Feeder/LICENSE b/native/DLSS5-Feeder/LICENSE
new file mode 100644
index 0000000..8f2a5b5
--- /dev/null
+++ b/native/DLSS5-Feeder/LICENSE
@@ -0,0 +1,23 @@
+MIT License
+
+Copyright (c) 2026 Jean-Laurent ROUZIES
+
+Portions derived from dlss5-dx11-bridge, Copyright (c) 2026 NIGos (MIT), see external/bridge-1.0.19/LICENSE.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/native/DLSS5-Feeder/host/dlss5-feed-host64.cpp b/native/DLSS5-Feeder/host/dlss5-feed-host64.cpp
new file mode 100644
index 0000000..8def3af
--- /dev/null
+++ b/native/DLSS5-Feeder/host/dlss5-feed-host64.cpp
@@ -0,0 +1,1260 @@
+// dlss5-feed-host64 - the 64-bit half of DLSS5-Feeder for 32-bit games.
+//
+// A 32-bit game cannot load NGX or the DLSS 5 add-on (both x64-only). This little
+// process can: it puts ReShade x64 (dxgi.dll) and renodx-dlss5.addon64 next to
+// itself, opens a hidden 1x1 window with a minimal D3D12 swapchain -- so from the
+// DLSS 5 add-on's point of view it IS a D3D12 game -- and runs the NGX DLAA
+// evaluate on frames the game delivers through cross-process shared textures
+// (created game-side on D3D11; see the phase-0 spike) and shared fences.
+//
+// dlss5-feed-host64.exe --test stand-alone: synthetic pattern, no game needed
+// (phase-1 proof: "feature 18 created" in ReShade.log)
+// dlss5-feed-host64.exe <pid> serve the game with that PID over the pipe
+//
+// Logs to dlss5-feed-host.log next to the exe; the DLSS 5 add-on's own state
+// appears in the host's ReShade.log.
+
+#define WIN32_LEAN_AND_MEAN
+#define NOMINMAX
+#include <windows.h>
+#include <d3d12.h>
+#include <dxgi1_4.h>
+#include <cstdio>
+#include <cstdarg>
+#include <cstdint>
+#include <cstring>
+#include <algorithm>
+#include <fcntl.h>
+#include <io.h>
+#include <vector>
+
+#include <nvsdk_ngx.h>
+#include <nvsdk_ngx_helpers.h>
+
+#include "../src/feed_ipc.h"
+
+// ---------------------------------------------------------------------------
+// Logging
+// ---------------------------------------------------------------------------
+
+static char g_log_path[MAX_PATH];
+static bool g_show_window = false; // visible host window = the user's door to the DLSS 5 panel
+static bool g_renodx_lazy = false; // DLSS 5 add-on is v45+ (per-present rescan, lazy adoption)
+static bool g_video_mode = false; // stdin/stdout are a binary frame protocol in this mode
+
+static void Log(const char *fmt, ...);
+
+// Detect the DLSS 5 add-on generation next to this exe: v45+ ('EnableHooks' marker in
+// the binary) rescans every present and adopts missed features lazily, so the warm-up
+// re-create is unnecessary -- and its EnableHooks key should be '2' (NGX-only) for this
+// feeder, written into OUR ReShade.ini before ReShade loads and the add-on reads it.
+static void DetectRenodxAddon()
+{
+ char dir[MAX_PATH], path[MAX_PATH], ini[MAX_PATH];
+ GetModuleFileNameA(nullptr, dir, MAX_PATH);
+ if (char *s = strrchr(dir, '\\')) *(s + 1) = '\0';
+ sprintf_s(path, "%srenodx-dlss5.addon64", dir);
+ sprintf_s(ini, "%sReShade.ini", dir);
+
+ HANDLE f = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, nullptr, OPEN_EXISTING, 0, nullptr);
+ if (f == INVALID_HANDLE_VALUE) { Log("[host] renodx-dlss5.addon64 not found next to the host"); return; }
+ const DWORD size = GetFileSize(f, nullptr);
+ DWORD got = 0;
+ char *buf = (size > 0 && size < 8u * 1024 * 1024) ? static_cast<char *>(malloc(size)) : nullptr;
+ if (buf != nullptr && ReadFile(f, buf, size, &got, nullptr) && got == size)
+ for (DWORD i = 0; i + 11 < size; ++i)
+ if (memcmp(buf + i, "EnableHooks", 11) == 0) { g_renodx_lazy = true; break; }
+ free(buf);
+ CloseHandle(f);
+
+ char ver[48] = "?";
+ DWORD dummy = 0;
+ const DWORD vsize = GetFileVersionInfoSizeA(path, &dummy);
+ if (vsize > 0)
+ {
+ void *vdata = malloc(vsize);
+ VS_FIXEDFILEINFO *ffi = nullptr;
+ UINT flen = 0;
+ if (vdata != nullptr && GetFileVersionInfoA(path, 0, vsize, vdata) &&
+ VerQueryValueA(vdata, "\\", reinterpret_cast<void **>(&ffi), &flen) && ffi != nullptr)
+ sprintf_s(ver, "%u.%u.%u.%u", HIWORD(ffi->dwFileVersionMS), LOWORD(ffi->dwFileVersionMS),
+ HIWORD(ffi->dwFileVersionLS), LOWORD(ffi->dwFileVersionLS));
+ free(vdata);
+ }
+ Log("[host] DLSS 5 add-on: v%s -- %s engine", ver,
+ g_renodx_lazy ? "v45+ (lazy adoption; warm-up skipped)" : "classic (warm-up stays on)");
+
+ if (g_renodx_lazy)
+ {
+ char v[16] = {};
+ GetPrivateProfileStringA("RenoDX.DLSS5", "EnableHooks", "", v, sizeof(v), ini);
+ if (v[0] == '\0')
+ {
+ WritePrivateProfileStringA("RenoDX.DLSS5", "EnableHooks", "2", ini);
+ Log("[host] EnableHooks was unset; wrote EnableHooks=2 into the host's ReShade.ini");
+ }
+ else
+ Log("[host] EnableHooks=%s (user-set; leaving it alone)", v);
+ }
+}
+
+static void Log(const char *fmt, ...)
+{
+ char line[2048];
+ va_list ap;
+ va_start(ap, fmt);
+ _vsnprintf_s(line, sizeof(line), _TRUNCATE, fmt, ap);
+ va_end(ap);
+ SYSTEMTIME st;
+ GetLocalTime(&st);
+ FILE *console = g_video_mode ? stderr : stdout;
+ fprintf(console, "%02u:%02u:%02u.%03u %s\n", st.wHour, st.wMinute, st.wSecond, st.wMilliseconds, line);
+ fflush(console);
+ FILE *f = nullptr;
+ if (!g_video_mode && fopen_s(&f, g_log_path, "a") == 0 && f != nullptr)
+ {
+ fprintf(f, "%02u:%02u:%02u.%03u %s\n", st.wHour, st.wMinute, st.wSecond, st.wMilliseconds, line);
+ fclose(f);
+ }
+}
+
+static const char *NgxResultName(NVSDK_NGX_Result r)
+{
+ switch (static_cast<unsigned>(r))
+ {
+ case 0x1: return "Success";
+ case 0xBAD00005: return "InvalidParameter";
+ case 0xBAD00007: return "NotInitialized";
+ case 0xBAD00008: return "UnsupportedInputFormat";
+ case 0xBAD0000A: return "MissingInput";
+ case 0xBAD0000B: return "UnableToInitializeFeature";
+ case 0xBAD0000D: return "OutOfGPUMemory";
+ case 0xBAD0000E: return "UnsupportedFormat";
+ default: return "?";
+ }
+}
+
+// ---------------------------------------------------------------------------
+// State
+// ---------------------------------------------------------------------------
+
+struct Host
+{
+ HWND hwnd;
+ IDXGISwapChain1 *swap;
+ ID3D12Device *dev;
+ ID3D12CommandQueue *queue; // NGX work
+ ID3D12CommandQueue *pump_queue; // owns the dummy swapchain
+ ID3D12GraphicsCommandList *list;
+ static const int kFrames = 3;
+ ID3D12CommandAllocator *alloc[kFrames];
+ UINT64 alloc_fence[kFrames];
+ int frame_slot;
+ ID3D12Fence *fence; // internal (allocator ring)
+ HANDLE fence_event;
+ UINT64 fence_value;
+
+ // cross-process
+ ID3D12Fence *fence_in; // game signals, host waits
+ ID3D12Fence *fence_out; // host signals, game waits
+
+ bool ngx_inited;
+ NVSDK_NGX_Parameter *params;
+ NVSDK_NGX_Handle *feature;
+
+ ID3D12Resource *tex[FEED_SLOTS];
+ UINT width, height;
+ DXGI_FORMAT color_fmt, output_fmt;
+};
+
+static Host h;
+
+using PFN_NR_InitExt = NVSDK_NGX_Result (NVSDK_CONV *)(unsigned long long, const wchar_t *, ID3D12Device *, NVSDK_NGX_Version, const NVSDK_NGX_Parameter *);
+using PFN_NR_Create = NVSDK_NGX_Result (NVSDK_CONV *)(ID3D12GraphicsCommandList *, NVSDK_NGX_Feature, const NVSDK_NGX_Parameter *, NVSDK_NGX_Handle **);
+using PFN_NR_Evaluate = NVSDK_NGX_Result (NVSDK_CONV *)(ID3D12GraphicsCommandList *, const NVSDK_NGX_Handle *, const NVSDK_NGX_Parameter *, PFN_NVSDK_NGX_ProgressCallback);
+using PFN_NR_Release = NVSDK_NGX_Result (NVSDK_CONV *)(NVSDK_NGX_Handle *);
+static HMODULE g_nr_module;
+static PFN_NR_InitExt g_nr_init_ext;
+static PFN_NR_Create g_nr_create;
+static PFN_NR_Evaluate g_nr_evaluate;
+static PFN_NR_Release g_nr_release;
+static uint32_t g_create_result;
+static uint32_t g_eval_count;
+
+static bool InitDirectNr(const wchar_t *data_path)
+{
+ g_nr_module = LoadLibraryW(L"nvngx_dlssnr.dll");
+ if (!g_nr_module) { Log("[pure] LoadLibrary(nvngx_dlssnr.dll) failed %lu", GetLastError()); return false; }
+ g_nr_init_ext = reinterpret_cast<PFN_NR_InitExt>(GetProcAddress(g_nr_module, "NVSDK_NGX_D3D12_Init_Ext"));
+ g_nr_create = reinterpret_cast<PFN_NR_Create>(GetProcAddress(g_nr_module, "NVSDK_NGX_D3D12_CreateFeature"));
+ g_nr_evaluate = reinterpret_cast<PFN_NR_Evaluate>(GetProcAddress(g_nr_module, "NVSDK_NGX_D3D12_EvaluateFeature"));
+ g_nr_release = reinterpret_cast<PFN_NR_Release>(GetProcAddress(g_nr_module, "NVSDK_NGX_D3D12_ReleaseFeature"));
+ if (!g_nr_init_ext || !g_nr_create || !g_nr_evaluate || !g_nr_release) return false;
+ const auto r = g_nr_init_ext(0x1000000ULL, data_path, h.dev, NVSDK_NGX_Version_API, h.params);
+ Log("[pure] direct DLSSNR Init_Ext -> 0x%08X (%s)", r, NgxResultName(r));
+ return NVSDK_NGX_SUCCEED(r);
+}
+
+// ---------------------------------------------------------------------------
+// Command submission (allocator ring), same shape as the add-on
+// ---------------------------------------------------------------------------
+
+static bool BeginCommands()
+{
+ const int slot = h.frame_slot;
+ const UINT64 retire = h.alloc_fence[slot];
+ if (retire != 0 && h.fence->GetCompletedValue() < retire)
+ {
+ h.fence->SetEventOnCompletion(retire, h.fence_event);
+ if (WaitForSingleObject(h.fence_event, 2000) != WAIT_OBJECT_0)
+ { Log("[host] GPU did not retire allocator slot %d", slot); return false; }
+ }
+ if (FAILED(h.alloc[slot]->Reset())) return false;
+ return SUCCEEDED(h.list->Reset(h.alloc[slot], nullptr));
+}
+
+static UINT64 EndCommands()
+{
+ h.list->Close();
+ ID3D12CommandList *lists[] = { h.list };
+ h.queue->ExecuteCommandLists(1, lists);
+ const UINT64 v = ++h.fence_value;
+ h.queue->Signal(h.fence, v);
+ h.alloc_fence[h.frame_slot] = v;
+ h.frame_slot = (h.frame_slot + 1) % Host::kFrames;
+ return v;
+}
+
+static bool WaitFenceValue(ID3D12Fence *f, UINT64 v, DWORD ms)
+{
+ if (f->GetCompletedValue() >= v) return true;
+ f->SetEventOnCompletion(v, h.fence_event);
+ return WaitForSingleObject(h.fence_event, ms) == WAIT_OBJECT_0;
+}
+
+static void CloseListGuarded()
+{
+ __try { h.list->Close(); } __except (EXCEPTION_EXECUTE_HANDLER) {}
+}
+
+static void AbortCommands() // never execute a list NGX crashed in
+{
+ if (h.list == nullptr) return;
+ CloseListGuarded();
+ h.list->Release();
+ h.list = nullptr;
+ if (SUCCEEDED(h.dev->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, h.alloc[h.frame_slot], nullptr,
+ __uuidof(ID3D12GraphicsCommandList), reinterpret_cast<void **>(&h.list))))
+ h.list->Close();
+}
+
+static NVSDK_NGX_Result SafeCreateDLSS(NVSDK_NGX_DLSS_Create_Params *cp, DWORD *code)
+{
+ *code = 0;
+ __try { return NGX_D3D12_CREATE_DLSS_EXT(h.list, 1, 1, &h.feature, h.params, cp); }
+ __except (EXCEPTION_EXECUTE_HANDLER) { *code = GetExceptionCode(); return static_cast<NVSDK_NGX_Result>(0x7FFFFFFF); }
+}
+
+static NVSDK_NGX_Result SafeEvaluateDLSS(NVSDK_NGX_D3D12_DLSS_Eval_Params *ep, DWORD *code)
+{
+ *code = 0;
+ __try { return NGX_D3D12_EVALUATE_DLSS_EXT(h.list, h.feature, h.params, ep); }
+ __except (EXCEPTION_EXECUTE_HANDLER) { *code = GetExceptionCode(); return static_cast<NVSDK_NGX_Result>(0x7FFFFFFF); }
+}
+
+static void SafeReleaseFeature(NVSDK_NGX_Handle *f)
+{
+ if (f == nullptr) return;
+ __try { NVSDK_NGX_D3D12_ReleaseFeature(f); }
+ __except (EXCEPTION_EXECUTE_HANDLER) { Log("[host] ReleaseFeature raised 0x%08X (ignored)", GetExceptionCode()); }
+}
+
+// ---------------------------------------------------------------------------
+// The disguise: hidden window + minimal D3D12 swapchain so ReShade x64 loads
+// and the DLSS 5 add-on arms itself, exactly as in a real D3D12 game.
+// ---------------------------------------------------------------------------
+
+static LRESULT CALLBACK WndProc(HWND w, UINT m, WPARAM wp, LPARAM lp)
+{
+ if (m == WM_CLOSE) { ShowWindow(w, SW_HIDE); return 0; } // closing only hides; the feed lives on
+ return DefWindowProcW(w, m, wp, lp);
+}
+
+// --- banner: "32-bit DLSS 5 Feeder" rendered once with GDI, copied into every frame ---
+
+static ID3D12Resource *g_banner;
+static IDXGISwapChain3 *g_swap3;
+static ID3D12CommandAllocator *g_pump_alloc;
+static ID3D12GraphicsCommandList *g_pump_list;
+static ID3D12Fence *g_pump_fence;
+static UINT64 g_pump_val;
+static HANDLE g_pump_ev;
+
+static bool BeginCommands();
+static UINT64 EndCommands();
+static bool WaitFenceValue(ID3D12Fence *f, UINT64 v, DWORD ms);
+
+static void InitBanner()
+{
+ const int W = 960, H = 540;
+
+ // 1. Render the text with GDI into a 32-bit DIB.
+ BITMAPINFO bi = {};
+ bi.bmiHeader.biSize = sizeof(bi.bmiHeader);
+ bi.bmiHeader.biWidth = W;
+ bi.bmiHeader.biHeight = -H; // top-down
+ bi.bmiHeader.biPlanes = 1;
+ bi.bmiHeader.biBitCount = 32;
+ bi.bmiHeader.biCompression = BI_RGB;
+ void *bits = nullptr;
+ HDC dc = CreateCompatibleDC(nullptr);
+ HBITMAP bmp = CreateDIBSection(dc, &bi, DIB_RGB_COLORS, &bits, nullptr, 0);
+ if (dc == nullptr || bmp == nullptr || bits == nullptr) return;
+ HGDIOBJ old_bmp = SelectObject(dc, bmp);
+
+ RECT full = { 0, 0, W, H };
+ HBRUSH bg = CreateSolidBrush(RGB(18, 18, 22));
+ FillRect(dc, &full, bg);
+ DeleteObject(bg);
+ SetBkMode(dc, TRANSPARENT);
+
+ HFONT fnt_big = CreateFontW(64, 0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, DEFAULT_CHARSET, 0, 0,
+ CLEARTYPE_QUALITY, DEFAULT_PITCH, L"Segoe UI");
+ HFONT fnt_small = CreateFontW(26, 0, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE, DEFAULT_CHARSET, 0, 0,
+ CLEARTYPE_QUALITY, DEFAULT_PITCH, L"Segoe UI");
+ HGDIOBJ old_font = SelectObject(dc, fnt_big);
+ SetTextColor(dc, RGB(118, 185, 0));
+ RECT r1 = { 0, 150, W, 240 };
+ DrawTextW(dc, L"32-bit DLSS 5 Feeder", -1, &r1, DT_CENTER | DT_SINGLELINE | DT_VCENTER);
+ SelectObject(dc, fnt_small);
+ SetTextColor(dc, RGB(200, 200, 205));
+ RECT r2 = { 0, 260, W, 300 };
+ DrawTextW(dc, L"DLSS 5 neural rendering runs here for your 32-bit game.", -1, &r2,
+ DT_CENTER | DT_SINGLELINE | DT_VCENTER);
+ RECT r3 = { 0, 305, W, 345 };
+ DrawTextW(dc, L"Press Home in this window to tune it \x2022 closing only hides the window", -1, &r3,
+ DT_CENTER | DT_SINGLELINE | DT_VCENTER);
+ SelectObject(dc, old_font);
+ DeleteObject(fnt_big);
+ DeleteObject(fnt_small);
+ GdiFlush();
+
+ // 2. Upload it (BGRA -> RGBA) and keep it as a copy source.
+ D3D12_HEAP_PROPERTIES up = {};
+ up.Type = D3D12_HEAP_TYPE_UPLOAD;
+ const UINT pitch = (W * 4 + 255) & ~255u;
+ D3D12_RESOURCE_DESC bd = {};
+ bd.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;
+ bd.Width = static_cast<UINT64>(pitch) * H;
+ bd.Height = 1;
+ bd.DepthOrArraySize = 1;
+ bd.MipLevels = 1;
+ bd.SampleDesc.Count = 1;
+ bd.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;
+ ID3D12Resource *staging = nullptr;
+ D3D12_HEAP_PROPERTIES def = {};
+ def.Type = D3D12_HEAP_TYPE_DEFAULT;
+ D3D12_RESOURCE_DESC td = {};
+ td.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
+ td.Width = W;
+ td.Height = H;
+ td.DepthOrArraySize = 1;
+ td.MipLevels = 1;
+ td.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+ td.SampleDesc.Count = 1;
+ td.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
+ if (FAILED(h.dev->CreateCommittedResource(&up, D3D12_HEAP_FLAG_NONE, &bd, D3D12_RESOURCE_STATE_GENERIC_READ,
+ nullptr, __uuidof(ID3D12Resource), reinterpret_cast<void **>(&staging))) ||
+ FAILED(h.dev->CreateCommittedResource(&def, D3D12_HEAP_FLAG_NONE, &td, D3D12_RESOURCE_STATE_COPY_DEST,
+ nullptr, __uuidof(ID3D12Resource), reinterpret_cast<void **>(&g_banner))))
+ { SelectObject(dc, old_bmp); DeleteObject(bmp); DeleteDC(dc); return; }
+
+ BYTE *dst = nullptr;
+ staging->Map(0, nullptr, reinterpret_cast<void **>(&dst));
+ const BYTE *srcp = static_cast<const BYTE *>(bits);
+ for (int y = 0; y < H; ++y)
+ for (int x = 0; x < W; ++x)
+ {
+ const BYTE *p = srcp + (static_cast<size_t>(y) * W + x) * 4; // GDI: BGRA
+ BYTE *q = dst + static_cast<size_t>(y) * pitch + static_cast<size_t>(x) * 4;
+ q[0] = p[2]; q[1] = p[1]; q[2] = p[0]; q[3] = 0xFF;
+ }
+ staging->Unmap(0, nullptr);
+ SelectObject(dc, old_bmp);
+ DeleteObject(bmp);
+ DeleteDC(dc);
+
+ if (BeginCommands())
+ {
+ D3D12_TEXTURE_COPY_LOCATION src = {}, dcl = {};
+ src.pResource = staging;
+ src.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
+ src.PlacedFootprint.Footprint.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+ src.PlacedFootprint.Footprint.Width = W;
+ src.PlacedFootprint.Footprint.Height = H;
+ src.PlacedFootprint.Footprint.Depth = 1;
+ src.PlacedFootprint.Footprint.RowPitch = pitch;
+ dcl.pResource = g_banner;
+ dcl.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
+ h.list->CopyTextureRegion(&dcl, 0, 0, 0, &src, nullptr);
+ D3D12_RESOURCE_BARRIER b = {};
+ b.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
+ b.Transition.pResource = g_banner;
+ b.Transition.StateBefore = D3D12_RESOURCE_STATE_COPY_DEST;
+ b.Transition.StateAfter = D3D12_RESOURCE_STATE_COPY_SOURCE;
+ b.Transition.Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES;
+ h.list->ResourceBarrier(1, &b);
+ const UINT64 v = EndCommands();
+ WaitFenceValue(h.fence, v, 2000);
+ }
+ staging->Release();
+
+ // 3. A tiny allocator/list/fence pair on the pump queue for the per-frame copy.
+ h.dev->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, __uuidof(ID3D12CommandAllocator),
+ reinterpret_cast<void **>(&g_pump_alloc));
+ if (g_pump_alloc != nullptr)
+ h.dev->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, g_pump_alloc, nullptr,
+ __uuidof(ID3D12GraphicsCommandList), reinterpret_cast<void **>(&g_pump_list));
+ if (g_pump_list != nullptr) g_pump_list->Close();
+ h.dev->CreateFence(0, D3D12_FENCE_FLAG_NONE, __uuidof(ID3D12Fence), reinterpret_cast<void **>(&g_pump_fence));
+ g_pump_ev = CreateEventW(nullptr, FALSE, FALSE, nullptr);
+ h.swap->QueryInterface(__uuidof(IDXGISwapChain3), reinterpret_cast<void **>(&g_swap3));
+ Log("[host] banner ready");
+}
+
+typedef HRESULT (WINAPI *PFN_D3D12CreateDevice_)(IUnknown *, D3D_FEATURE_LEVEL, REFIID, void **);
+typedef HRESULT (WINAPI *PFN_CreateDXGIFactory1_)(REFIID, void **);
+
+static void PumpPresent()
+{
+ MSG msg;
+ while (PeekMessageW(&msg, nullptr, 0, 0, PM_REMOVE)) { TranslateMessage(&msg); DispatchMessageW(&msg); }
+ if (h.swap == nullptr) return;
+
+ // Paint the banner into the backbuffer (ReShade's overlay composites on top at Present).
+ if (g_banner != nullptr && g_pump_list != nullptr && g_swap3 != nullptr)
+ {
+ ID3D12Resource *bb = nullptr;
+ if (SUCCEEDED(g_swap3->GetBuffer(g_swap3->GetCurrentBackBufferIndex(), __uuidof(ID3D12Resource),
+ reinterpret_cast<void **>(&bb))) && bb != nullptr)
+ {
+ if (SUCCEEDED(g_pump_alloc->Reset()) && SUCCEEDED(g_pump_list->Reset(g_pump_alloc, nullptr)))
+ {
+ D3D12_RESOURCE_BARRIER b = {};
+ b.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
+ b.Transition.pResource = bb;
+ b.Transition.StateBefore = D3D12_RESOURCE_STATE_PRESENT;
+ b.Transition.StateAfter = D3D12_RESOURCE_STATE_COPY_DEST;
+ b.Transition.Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES;
+ g_pump_list->ResourceBarrier(1, &b);
+ g_pump_list->CopyResource(bb, g_banner);
+ b.Transition.StateBefore = D3D12_RESOURCE_STATE_COPY_DEST;
+ b.Transition.StateAfter = D3D12_RESOURCE_STATE_PRESENT;
+ g_pump_list->ResourceBarrier(1, &b);
+ g_pump_list->Close();
+ ID3D12CommandList *lists[] = { g_pump_list };
+ h.pump_queue->ExecuteCommandLists(1, lists);
+ h.pump_queue->Signal(g_pump_fence, ++g_pump_val);
+ if (g_pump_fence->GetCompletedValue() < g_pump_val && g_pump_ev != nullptr)
+ {
+ g_pump_fence->SetEventOnCompletion(g_pump_val, g_pump_ev);
+ WaitForSingleObject(g_pump_ev, 100);
+ }
+ }
+ bb->Release();
+ }
+ }
+ h.swap->Present(0, 0);
+}
+
+static bool InitDisguise()
+{
+ // Pure D3D12 setup. No window, swapchain, ReShade, RenoDX, or DLSS carrier.
+ HMODULE dxgi = LoadLibraryW(L"dxgi.dll");
+ HMODULE d3d12 = LoadLibraryW(L"d3d12.dll");
+ auto create_device = d3d12 ? reinterpret_cast<PFN_D3D12CreateDevice_>(GetProcAddress(d3d12, "D3D12CreateDevice")) : nullptr;
+ auto create_factory = dxgi ? reinterpret_cast<PFN_CreateDXGIFactory1_>(GetProcAddress(dxgi, "CreateDXGIFactory1")) : nullptr;
+ if (create_device == nullptr || create_factory == nullptr) { Log("[host] dxgi/d3d12 exports missing"); return false; }
+
+ IDXGIFactory2 *factory = nullptr;
+ HRESULT hr = create_factory(__uuidof(IDXGIFactory2), reinterpret_cast<void **>(&factory));
+ if (FAILED(hr)) { Log("[host] CreateDXGIFactory1 failed 0x%08X", hr); return false; }
+
+ // Hybrid laptops/desktops commonly expose the integrated adapter first. NGX initialization
+ // then fails even when a supported RTX card is present, so explicitly select NVIDIA.
+ IDXGIAdapter1 *nvidia = nullptr;
+ for (UINT i = 0; ; ++i)
+ {
+ IDXGIAdapter1 *candidate = nullptr;
+ if (factory->EnumAdapters1(i, &candidate) == DXGI_ERROR_NOT_FOUND) break;
+ DXGI_ADAPTER_DESC1 desc = {};
+ candidate->GetDesc1(&desc);
+ Log("[host] adapter %u: %ls vendor=0x%04X", i, desc.Description, desc.VendorId);
+ if (desc.VendorId == 0x10DE && !(desc.Flags & DXGI_ADAPTER_FLAG_SOFTWARE))
+ { nvidia = candidate; break; }
+ candidate->Release();
+ }
+ if (nvidia == nullptr) { factory->Release(); Log("[host] no NVIDIA adapter found"); return false; }
+
+ hr = create_device(nvidia, D3D_FEATURE_LEVEL_11_0, __uuidof(ID3D12Device),
+ reinterpret_cast<void **>(&h.dev));
+ nvidia->Release();
+ if (FAILED(hr)) { Log("[host] D3D12CreateDevice failed 0x%08X", hr); return false; }
+
+ factory->Release();
+ D3D12_COMMAND_QUEUE_DESC qd = {};
+ h.dev->CreateCommandQueue(&qd, __uuidof(ID3D12CommandQueue), reinterpret_cast<void **>(&h.queue));
+ if (h.queue == nullptr) { Log("[host] queue creation failed"); return false; }
+ Log("[pure] standalone D3D12 device ready; no swapchain or carrier modules");
+
+ // Ring + internal fence for our own submissions.
+ for (int i = 0; i < Host::kFrames; ++i)
+ h.dev->CreateCommandAllocator(D3D12_COMMAND_LIST_TYPE_DIRECT, __uuidof(ID3D12CommandAllocator),
+ reinterpret_cast<void **>(&h.alloc[i]));
+ if (h.alloc[0] != nullptr)
+ h.dev->CreateCommandList(0, D3D12_COMMAND_LIST_TYPE_DIRECT, h.alloc[0], nullptr,
+ __uuidof(ID3D12GraphicsCommandList), reinterpret_cast<void **>(&h.list));
+ if (h.list != nullptr) h.list->Close();
+ h.dev->CreateFence(0, D3D12_FENCE_FLAG_NONE, __uuidof(ID3D12Fence), reinterpret_cast<void **>(&h.fence));
+ h.fence_event = CreateEventW(nullptr, FALSE, FALSE, nullptr);
+ if (h.list == nullptr || h.fence == nullptr) { Log("[host] list/fence creation failed"); return false; }
+
+ return true;
+}
+
+static bool InitNgx()
+{
+ wchar_t data_path[MAX_PATH] = {};
+ GetModuleFileNameW(nullptr, data_path, MAX_PATH);
+ if (wchar_t *s = wcsrchr(data_path, L'\\')) *(s + 1) = L'\0';
+
+ NVSDK_NGX_Result r = NVSDK_NGX_D3D12_Init(0x1000000ULL, data_path, h.dev, nullptr, NVSDK_NGX_Version_API);
+ Log("[host] NVSDK_NGX_D3D12_Init -> 0x%08X (%s)", r, NgxResultName(r));
+ if (NVSDK_NGX_FAILED(r))
+ {
+ r = NVSDK_NGX_D3D12_Init_with_ProjectID("a0f57b54-1daf-4934-90ae-c4035c19df04", NVSDK_NGX_ENGINE_TYPE_CUSTOM,
+ "1.0", data_path, h.dev, nullptr, NVSDK_NGX_Version_API);
+ Log("[host] Init_with_ProjectID -> 0x%08X (%s)", r, NgxResultName(r));
+ }
+ if (NVSDK_NGX_FAILED(r)) return false;
+ h.ngx_inited = true;
+
+ r = NVSDK_NGX_D3D12_AllocateParameters(&h.params);
+ if (NVSDK_NGX_FAILED(r) || h.params == nullptr) { Log("[host] AllocateParameters failed 0x%08X", r); return false; }
+ return InitDirectNr(data_path);
+}
+
+static bool CreateFeature(UINT w, UINT h_, int flags, NVSDK_NGX_Result *out_r)
+{
+ (void)flags;
+ h.params->Reset();
+ h.params->Set("CreationNodeMask", 1u);
+ h.params->Set("VisibilityNodeMask", 1u);
+ h.params->Set("DLSSNR.Width", w); h.params->Set("DLSSNR.Height", h_);
+ h.params->Set("DLSSNR.InputWidth", w); h.params->Set("DLSSNR.InputHeight", h_);
+ h.params->Set("DLSSNR.OutputWidth", w); h.params->Set("DLSSNR.OutputHeight", h_);
+ h.params->Set("DLSSNR.Output.Width", w); h.params->Set("DLSSNR.Output.Height", h_);
+ h.params->Set("DLSSNR.Upscaling", 0); h.params->Set("DLSSNR.Scale", 1.0f);
+ h.params->Set("DLSSNR.ScalingRatio", 1.0f); h.params->Set("DLSSNR.Hint.Render.Preset", 0u);
+ h.params->Set("DLSS.Feature.Create.Flags", 0u);
+
+ if (!BeginCommands()) return false;
+ DWORD ccode = 0;
+ NVSDK_NGX_Result rf = static_cast<NVSDK_NGX_Result>(0x7FFFFFFF);
+ __try { rf = g_nr_create(h.list, NVSDK_NGX_Feature_Reserved18, h.params, &h.feature); }
+ __except (EXCEPTION_EXECUTE_HANDLER) { ccode = GetExceptionCode(); }
+ g_create_result = static_cast<uint32_t>(rf);
+ if (out_r != nullptr) *out_r = rf;
+ if (ccode != 0)
+ {
+ AbortCommands();
+ // NGX may have partially written *OutHandle before the fault; never trust it.
+ h.feature = nullptr;
+ Log("[host] CreateFeature raised 0x%08X (caught; nothing submitted)", ccode);
+ return false;
+ }
+ const UINT64 v = EndCommands();
+ if (!WaitFenceValue(h.fence, v, 30000)) { Log("[pure] feature create did not complete"); return false; }
+ if (NVSDK_NGX_FAILED(rf) || h.feature == nullptr)
+ { Log("[pure] direct feature 18 create failed 0x%08X (%s)", rf, NgxResultName(rf)); h.feature = nullptr; return false; }
+ Log("[pure] direct feature 18 ready: %ux%u result=0x%08X", w, h_, rf);
+ return true;
+}
+
+// A crashed CreateFeature can leave NGX's own internal state broken (seen in BioShock
+// Remastered: the add-on faulted once during a resolution/HDR change, and every following
+// create failed too, with the SEH catching a different exception each time -- NGX was
+// never going to recover on its own). Reset NGX itself as a last resort so the feed can
+// come back without the user having to restart the game.
+static bool ReinitNgx()
+{
+ Log("[host] NGX looks corrupted after repeated failures; reinitializing");
+ if (h.params != nullptr) { NVSDK_NGX_D3D12_DestroyParameters(h.params); h.params = nullptr; }
+ if (h.ngx_inited) { NVSDK_NGX_D3D12_Shutdown1(h.dev); h.ngx_inited = false; }
+ h.feature = nullptr;
+ return InitNgx();
+}
+
+static bool Evaluate(ID3D12Resource *color, ID3D12Resource *output, ID3D12Resource *depth, ID3D12Resource *mv,
+ UINT w, UINT h_, int reset, float mvsx, float mvsy)
+{
+ if (!BeginCommands()) return false;
+
+ NVSDK_NGX_D3D12_DLSS_Eval_Params ep = {};
+ ep.Feature.pInColor = color;
+ ep.Feature.pInOutput = output;
+ ep.pInDepth = depth;
+ ep.pInMotionVectors = mv;
+ ep.InRenderSubrectDimensions.Width = w;
+ ep.InRenderSubrectDimensions.Height = h_;
+ ep.InReset = reset;
+ ep.InMVScaleX = mvsx;
+ ep.InMVScaleY = mvsy;
+ ep.InPreExposure = 1.0f;
+ ep.InExposureScale = 1.0f;
+
+ DWORD ecode = 0;
+ NVSDK_NGX_Result re = SafeEvaluateDLSS(&ep, &ecode);
+ if (ecode != 0) { AbortCommands(); Log("[host] evaluate raised 0x%08X (caught; nothing submitted)", ecode); return false; }
+ EndCommands();
+ if (NVSDK_NGX_FAILED(re)) { Log("[host] evaluate failed 0x%08X (%s)", re, NgxResultName(re)); return false; }
+ return true;
+}
+
+// ---------------------------------------------------------------------------
+// --test: prove the whole stack with no game attached
+// ---------------------------------------------------------------------------
+
+static ID3D12Resource *MakeTex(UINT w, UINT h_, DXGI_FORMAT fmt, bool uav)
+{
+ D3D12_HEAP_PROPERTIES hp = {};
+ hp.Type = D3D12_HEAP_TYPE_DEFAULT;
+ D3D12_RESOURCE_DESC rd = {};
+ rd.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
+ rd.Width = w;
+ rd.Height = h_;
+ rd.DepthOrArraySize = 1;
+ rd.MipLevels = 1;
+ rd.Format = fmt;
+ rd.SampleDesc.Count = 1;
+ rd.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
+ rd.Flags = uav ? D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS : D3D12_RESOURCE_FLAG_NONE;
+ ID3D12Resource *t = nullptr;
+ h.dev->CreateCommittedResource(&hp, D3D12_HEAP_FLAG_NONE, &rd, D3D12_RESOURCE_STATE_COMMON, nullptr,
+ __uuidof(ID3D12Resource), reinterpret_cast<void **>(&t));
+ return t;
+}
+
+static int RunTest()
+{
+ const UINT W = 640, H = 360;
+ Log("[host] --test: %ux%u synthetic DLAA", W, H);
+
+ ID3D12Resource *color = MakeTex(W, H, DXGI_FORMAT_R8G8B8A8_UNORM, false);
+ ID3D12Resource *output = MakeTex(W, H, DXGI_FORMAT_R8G8B8A8_UNORM, true);
+ ID3D12Resource *depth = MakeTex(W, H, DXGI_FORMAT_R32_FLOAT, false);
+ ID3D12Resource *mv = MakeTex(W, H, DXGI_FORMAT_R16G16_FLOAT, false);
+ if (!color || !output || !depth || !mv) { Log("[host] test texture creation failed"); return 1; }
+
+ // Give the DLSS 5 add-on its hook-arming time, with the swapchain pumping.
+ for (int i = 0; i < 120; ++i) { PumpPresent(); Sleep(8); }
+
+ int flags = NVSDK_NGX_DLSS_Feature_Flags_MVLowRes | NVSDK_NGX_DLSS_Feature_Flags_AutoExposure |
+ NVSDK_NGX_DLSS_Feature_Flags_DepthInverted;
+ NVSDK_NGX_Result rf = NVSDK_NGX_Result_Fail;
+ if (!CreateFeature(W, H, flags, &rf)) return 1;
+
+ int good = 0;
+ for (int i = 0; i < 300; ++i)
+ {
+ PumpPresent();
+ if (Evaluate(color, output, depth, mv, W, H, i == 0 ? 1 : 0, 1.0f, 1.0f)) ++good;
+ else break;
+ if (i == 180) // the warm-up re-create, same medicine as in-game
+ {
+ Log("[host] warm-up: re-creating the feature once");
+ NVSDK_NGX_Handle *old = h.feature;
+ h.feature = nullptr;
+ if (!CreateFeature(W, H, flags, &rf)) { h.feature = old; Log("[host] keeping the previous feature"); }
+ else SafeReleaseFeature(old);
+ }
+ }
+ Log("[host] --test finished: %d/300 evaluates succeeded", good);
+ Log("[host] check the host's ReShade.log for 'feature 18 created' / 'evaluation succeeded'");
+ return good >= 250 ? 0 : 1;
+}
+
+// ---------------------------------------------------------------------------
+// --video: portable video-frame protocol for the Gradio front end
+// ---------------------------------------------------------------------------
+
+static constexpr uint32_t VIDEO_MAGIC = 0x32563544u; // "D5V2"
+static constexpr uint32_t FRAME_MAGIC = 0x314D5246u; // "FRM1"
+static constexpr uint32_t OUT_MAGIC = 0x3154554Fu; // "OUT1"
+
+#pragma pack(push, 1)
+struct VideoHeader
+{
+ uint32_t magic, width, height, warmup, frame_count, profile, preset, style, auto_mask, ui_correction;
+ float intensity, local_tone, local_structure, skin_structure;
+};
+struct VideoFrameHeader
+{
+ uint32_t magic, index, reset, reserved;
+ int64_t pts;
+};
+struct VideoResultHeader
+{
+ uint32_t magic, index, ok, bytes, ngx_result;
+ int64_t pts;
+};
+#pragma pack(pop)
+
+struct VideoTex
+{
+ ID3D12Resource *tex = nullptr;
+ ID3D12Resource *upload = nullptr;
+ D3D12_PLACED_SUBRESOURCE_FOOTPRINT fp = {};
+ UINT rows = 0;
+ UINT64 row_size = 0;
+};
+
+struct VideoState
+{
+ UINT w = 0, hgt = 0;
+ VideoTex color, depth, mv, mask;
+ ID3D12Resource *output = nullptr;
+ ID3D12Resource *readback = nullptr;
+ D3D12_PLACED_SUBRESOURCE_FOOTPRINT out_fp = {};
+ UINT out_rows = 0;
+ UINT64 out_row_size = 0;
+ bool inputs_ready = false;
+};
+
+static VideoHeader g_video_options = {};
+static uint32_t g_last_eval_result = 0;
+
+static bool ReadExact(FILE *f, void *p, size_t n)
+{
+ BYTE *dst = static_cast<BYTE *>(p);
+ while (n != 0)
+ {
+ const size_t got = fread(dst, 1, n, f);
+ if (got == 0) return false;
+ dst += got; n -= got;
+ }
+ return true;
+}
+
+static bool WriteExact(FILE *f, const void *p, size_t n)
+{
+ const BYTE *src = static_cast<const BYTE *>(p);
+ while (n != 0)
+ {
+ const size_t put = fwrite(src, 1, n, f);
+ if (put == 0) return false;
+ src += put; n -= put;
+ }
+ fflush(f);
+ return true;
+}
+
+static bool CreateVideoTex(VideoTex &v, UINT w, UINT hgt, DXGI_FORMAT fmt, UINT packed_pitch)
+{
+ D3D12_HEAP_PROPERTIES def = {};
+ def.Type = D3D12_HEAP_TYPE_DEFAULT;
+ D3D12_RESOURCE_DESC td = {};
+ td.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
+ td.Width = w; td.Height = hgt; td.DepthOrArraySize = 1; td.MipLevels = 1;
+ td.Format = fmt; td.SampleDesc.Count = 1; td.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
+ if (FAILED(h.dev->CreateCommittedResource(&def, D3D12_HEAP_FLAG_NONE, &td, D3D12_RESOURCE_STATE_COPY_DEST,
+ nullptr, __uuidof(ID3D12Resource), reinterpret_cast<void **>(&v.tex)))) return false;
+
+ UINT64 total = 0;
+ h.dev->GetCopyableFootprints(&td, 0, 1, 0, &v.fp, &v.rows, &v.row_size, &total);
+ if (v.rows != hgt || v.row_size < packed_pitch) return false;
+ D3D12_HEAP_PROPERTIES up = {};
+ up.Type = D3D12_HEAP_TYPE_UPLOAD;
+ D3D12_RESOURCE_DESC bd = {};
+ bd.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;
+ bd.Width = total; bd.Height = 1; bd.DepthOrArraySize = 1; bd.MipLevels = 1;
+ bd.SampleDesc.Count = 1; bd.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;
+ return SUCCEEDED(h.dev->CreateCommittedResource(&up, D3D12_HEAP_FLAG_NONE, &bd,
+ D3D12_RESOURCE_STATE_GENERIC_READ, nullptr, __uuidof(ID3D12Resource),
+ reinterpret_cast<void **>(&v.upload)));
+}
+
+static bool CreateVideoResources(VideoState &v, UINT w, UINT hgt)
+{
+ v.w = w; v.hgt = hgt;
+ if (!CreateVideoTex(v.color, w, hgt, DXGI_FORMAT_R8G8B8A8_UNORM, w * 4) ||
+ !CreateVideoTex(v.mv, w, hgt, DXGI_FORMAT_R16G16_FLOAT, w * 4))
+ return false;
+
+ D3D12_HEAP_PROPERTIES def = {};
+ def.Type = D3D12_HEAP_TYPE_DEFAULT;
+ D3D12_RESOURCE_DESC td = {};
+ td.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
+ td.Width = w; td.Height = hgt; td.DepthOrArraySize = 1; td.MipLevels = 1;
+ td.Format = DXGI_FORMAT_R8G8B8A8_UNORM; td.SampleDesc.Count = 1;
+ td.Layout = D3D12_TEXTURE_LAYOUT_UNKNOWN;
+ td.Flags = D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS;
+ if (FAILED(h.dev->CreateCommittedResource(&def, D3D12_HEAP_FLAG_NONE, &td,
+ D3D12_RESOURCE_STATE_UNORDERED_ACCESS, nullptr, __uuidof(ID3D12Resource),
+ reinterpret_cast<void **>(&v.output)))) return false;
+
+ UINT64 total = 0;
+ h.dev->GetCopyableFootprints(&td, 0, 1, 0, &v.out_fp, &v.out_rows, &v.out_row_size, &total);
+ D3D12_HEAP_PROPERTIES rb = {};
+ rb.Type = D3D12_HEAP_TYPE_READBACK;
+ D3D12_RESOURCE_DESC bd = {};
+ bd.Dimension = D3D12_RESOURCE_DIMENSION_BUFFER;
+ bd.Width = total; bd.Height = 1; bd.DepthOrArraySize = 1; bd.MipLevels = 1;
+ bd.SampleDesc.Count = 1; bd.Layout = D3D12_TEXTURE_LAYOUT_ROW_MAJOR;
+ return SUCCEEDED(h.dev->CreateCommittedResource(&rb, D3D12_HEAP_FLAG_NONE, &bd,
+ D3D12_RESOURCE_STATE_COPY_DEST, nullptr, __uuidof(ID3D12Resource),
+ reinterpret_cast<void **>(&v.readback)));
+}
+
+static bool FillUpload(VideoTex &v, const BYTE *src, UINT src_pitch, UINT hgt)
+{
+ BYTE *dst = nullptr;
+ if (FAILED(v.upload->Map(0, nullptr, reinterpret_cast<void **>(&dst)))) return false;
+ for (UINT y = 0; y < hgt; ++y)
+ memcpy(dst + static_cast<size_t>(y) * v.fp.Footprint.RowPitch,
+ src + static_cast<size_t>(y) * src_pitch, src_pitch);
+ v.upload->Unmap(0, nullptr);
+ return true;
+}
+
+static void CopyUpload(ID3D12GraphicsCommandList *list, VideoTex &v)
+{
+ D3D12_TEXTURE_COPY_LOCATION src = {}, dst = {};
+ src.pResource = v.upload;
+ src.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
+ src.PlacedFootprint = v.fp;
+ dst.pResource = v.tex;
+ dst.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
+ list->CopyTextureRegion(&dst, 0, 0, 0, &src, nullptr);
+}
+
+static D3D12_RESOURCE_BARRIER Transition(ID3D12Resource *r, D3D12_RESOURCE_STATES before,
+ D3D12_RESOURCE_STATES after)
+{
+ D3D12_RESOURCE_BARRIER b = {};
+ b.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
+ b.Transition.pResource = r;
+ b.Transition.StateBefore = before;
+ b.Transition.StateAfter = after;
+ b.Transition.Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES;
+ return b;
+}
+
+static bool UploadVideoFrame(VideoState &v, const BYTE *color, const BYTE *mv)
+{
+ if (!FillUpload(v.color, color, v.w * 4, v.hgt) ||
+ !FillUpload(v.mv, mv, v.w * 4, v.hgt) || !BeginCommands()) return false;
+ if (v.inputs_ready)
+ {
+ D3D12_RESOURCE_BARRIER pre[] = {
+ Transition(v.color.tex, D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE, D3D12_RESOURCE_STATE_COPY_DEST),
+ Transition(v.mv.tex, D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE, D3D12_RESOURCE_STATE_COPY_DEST),
+ };
+ h.list->ResourceBarrier(_countof(pre), pre);
+ }
+ CopyUpload(h.list, v.color); CopyUpload(h.list, v.mv);
+ D3D12_RESOURCE_BARRIER post[] = {
+ Transition(v.color.tex, D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE),
+ Transition(v.mv.tex, D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE),
+ };
+ h.list->ResourceBarrier(_countof(post), post);
+ const UINT64 fence = EndCommands();
+ v.inputs_ready = true;
+ return WaitFenceValue(h.fence, fence, 30000);
+}
+
+static bool EvaluateVideo(VideoState &v, int reset)
+{
+ if (!BeginCommands()) return false;
+ h.params->Reset();
+ h.params->Set("DLSSNR.Color", v.color.tex); h.params->Set("DLSSNR.Output", v.output);
+ h.params->Set("DLSSNR.MVec", v.mv.tex);
+ h.params->Set("DLSSNR.ColorSubrectBaseX", 0u); h.params->Set("DLSSNR.ColorSubrectBaseY", 0u);
+ h.params->Set("DLSSNR.ColorSubrectWidth", v.w); h.params->Set("DLSSNR.ColorSubrectHeight", v.hgt);
+ h.params->Set("DLSSNR.MVecSubrectBaseX", 0u); h.params->Set("DLSSNR.MVecSubrectBaseY", 0u);
+ h.params->Set("DLSSNR.MVecSubrectWidth", v.w); h.params->Set("DLSSNR.MVecSubrectHeight", v.hgt);
+ h.params->Set("DLSSNR.OutputSubrectBaseX", 0u); h.params->Set("DLSSNR.OutputSubrectBaseY", 0u);
+ h.params->Set("DLSSNR.OutputSubrectWidth", v.w); h.params->Set("DLSSNR.OutputSubrectHeight", v.hgt);
+ h.params->Set("DLSSNR.MVecScaleX", 1.0f); h.params->Set("DLSSNR.MVecScaleY", 1.0f);
+ h.params->Set("DLSSNR.Enabled", 1u); h.params->Set("DLSSNR.Reset", reset);
+ h.params->Set("DLSSNR.Intensity", g_video_options.intensity);
+ h.params->Set("DLSSNR.LocalToneStrength", g_video_options.local_tone);
+ h.params->Set("DLSSNR.LocalStructureStrength", g_video_options.local_structure);
+ h.params->Set("DLSSNR.SkinStructureStrength", g_video_options.skin_structure);
+ h.params->Set("DLSSNR.UseAutoMask", g_video_options.auto_mask);
+ h.params->Set("DLSSNR.Style", g_video_options.style);
+ h.params->Set("DLSSNR.UICorrection", g_video_options.ui_correction);
+ h.params->Set("DLSS.Pre.Exposure", 1.0f); h.params->Set("DLSS.Exposure.Scale", 1.0f);
+ DWORD code = 0;
+ NVSDK_NGX_Result result = static_cast<NVSDK_NGX_Result>(0x7FFFFFFF);
+ __try { result = g_nr_evaluate(h.list, h.feature, h.params, nullptr); }
+ __except (EXCEPTION_EXECUTE_HANDLER) { code = GetExceptionCode(); }
+ g_last_eval_result = static_cast<uint32_t>(result);
+ if (code != 0) { AbortCommands(); Log("[pure] direct evaluate exception 0x%08X", code); return false; }
+ const UINT64 fence = EndCommands();
+ if (NVSDK_NGX_FAILED(result)) { Log("[pure] direct evaluate failed 0x%08X (%s)", result, NgxResultName(result)); return false; }
+ ++g_eval_count;
+ return WaitFenceValue(h.fence, fence, 60000);
+}
+
+static bool DownloadVideoFrame(VideoState &v, std::vector<BYTE> &packed)
+{
+ if (!BeginCommands()) return false;
+ D3D12_RESOURCE_BARRIER a = Transition(v.output, D3D12_RESOURCE_STATE_UNORDERED_ACCESS,
+ D3D12_RESOURCE_STATE_COPY_SOURCE);
+ h.list->ResourceBarrier(1, &a);
+ D3D12_TEXTURE_COPY_LOCATION src = {}, dst = {};
+ src.pResource = v.output; src.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
+ dst.pResource = v.readback; dst.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
+ dst.PlacedFootprint = v.out_fp;
+ h.list->CopyTextureRegion(&dst, 0, 0, 0, &src, nullptr);
+ D3D12_RESOURCE_BARRIER b = Transition(v.output, D3D12_RESOURCE_STATE_COPY_SOURCE,
+ D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
+ h.list->ResourceBarrier(1, &b);
+ const UINT64 fence = EndCommands();
+ if (!WaitFenceValue(h.fence, fence, 60000)) return false;
+
+ BYTE *mapped = nullptr;
+ D3D12_RANGE read_range = { 0, static_cast<SIZE_T>(v.out_fp.Footprint.RowPitch) * v.hgt };
+ if (FAILED(v.readback->Map(0, &read_range, reinterpret_cast<void **>(&mapped)))) return false;
+ packed.resize(static_cast<size_t>(v.w) * v.hgt * 4);
+ for (UINT y = 0; y < v.hgt; ++y)
+ memcpy(packed.data() + static_cast<size_t>(y) * v.w * 4,
+ mapped + static_cast<size_t>(y) * v.out_fp.Footprint.RowPitch,
+ static_cast<size_t>(v.w) * 4);
+ D3D12_RANGE written = { 0, 0 };
+ v.readback->Unmap(0, &written);
+ return true;
+}
+
+static bool ReShadeHasFeature18()
+{
+ char path[MAX_PATH] = {};
+ GetModuleFileNameA(nullptr, path, MAX_PATH);
+ if (char *s = strrchr(path, '\\')) strcpy_s(s + 1, MAX_PATH - (s + 1 - path), "ReShade.log");
+ HANDLE file = CreateFileA(path, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
+ if (file == INVALID_HANDLE_VALUE) return false;
+ const DWORD n = GetFileSize(file, nullptr);
+ std::vector<char> data(n > 0 ? static_cast<size_t>(n) + 1 : 1, 0);
+ DWORD got = 0;
+ if (n > 0) ReadFile(file, data.data(), n, &got, nullptr);
+ CloseHandle(file);
+ return strstr(data.data(), "feature 18 created") != nullptr &&
+ strstr(data.data(), "inline feature 18 evaluation succeeded") != nullptr;
+}
+
+static bool ReadVideoPayload(VideoState &v, VideoFrameHeader &fh, std::vector<BYTE> &color,
+ std::vector<BYTE> &mv)
+{
+ if (!ReadExact(stdin, &fh, sizeof(fh)) || fh.magic != FRAME_MAGIC) return false;
+ const size_t pixels = static_cast<size_t>(v.w) * v.hgt;
+ color.resize(pixels * 4); mv.resize(pixels * 4);
+ return ReadExact(stdin, color.data(), color.size()) && ReadExact(stdin, mv.data(), mv.size());
+}
+
+static int RunVideo()
+{
+ _setmode(_fileno(stdin), _O_BINARY);
+ _setmode(_fileno(stdout), _O_BINARY);
+ VideoHeader vh = {};
+ if (!ReadExact(stdin, &vh, sizeof(vh)) || vh.magic != VIDEO_MAGIC || vh.width < 64 || vh.height < 64 ||
+ vh.width > 7680 || vh.height > 4320 || vh.frame_count == 0)
+ { Log("[video] invalid stream header"); return 2; }
+ g_video_options = vh;
+ Log("[video] stream %ux%u, %u frames, warmup=%u", vh.width, vh.height, vh.frame_count, vh.warmup);
+
+ VideoState v;
+ if (!CreateVideoResources(v, vh.width, vh.height)) { Log("[video] resource creation failed"); return 3; }
+ int flags = NVSDK_NGX_DLSS_Feature_Flags_MVLowRes | NVSDK_NGX_DLSS_Feature_Flags_AutoExposure |
+ NVSDK_NGX_DLSS_Feature_Flags_DepthInverted;
+ NVSDK_NGX_Result create_result = NVSDK_NGX_Result_Fail;
+ if (!CreateFeature(vh.width, vh.height, flags, &create_result)) return 4;
+
+ VideoFrameHeader fh = {};
+ std::vector<BYTE> color, mv, output;
+ for (uint32_t frame = 0; frame < vh.frame_count; ++frame)
+ {
+ if (!ReadVideoPayload(v, fh, color, mv)) { Log("[video] truncated frame %u", frame); return 5; }
+ if (!UploadVideoFrame(v, color.data(), mv.data())) return 6;
+ if (frame == 0)
+ {
+ const uint32_t warmup = (std::min)(240u, (std::max)(1u, vh.warmup));
+ for (uint32_t i = 0; i < warmup; ++i)
+ {
+ if (!EvaluateVideo(v, i == 0 ? 1 : 0)) return 7;
+ }
+ Log("[pure] direct feature 18 confirmed after %u discarded warmup frames", warmup);
+ }
+ if (!EvaluateVideo(v, (frame == 0 || fh.reset != 0) ? 1 : 0) || !DownloadVideoFrame(v, output))
+ return 9;
+ VideoResultHeader out = { OUT_MAGIC, fh.index, 1u, static_cast<uint32_t>(output.size()), g_last_eval_result, fh.pts };
+ if (!WriteExact(stdout, &out, sizeof(out)) || !WriteExact(stdout, output.data(), output.size())) return 10;
+ if (frame < 3 || ((frame + 1) % 30) == 0) Log("[video] delivered frame %u/%u", frame + 1, vh.frame_count);
+ }
+ Log("[pure] complete: %u frames delivered, %u direct evaluations", vh.frame_count, g_eval_count);
+ return 0;
+}
+
+// ---------------------------------------------------------------------------
+// Serve mode: the real pipe server for a 32-bit game
+// ---------------------------------------------------------------------------
+
+static bool ReadFull(HANDLE pipe, void *buf, DWORD len)
+{
+ DWORD got = 0;
+ return ReadFile(pipe, buf, len, &got, nullptr) && got == len;
+}
+
+static int Serve(DWORD game_pid)
+{
+ char name[128];
+ sprintf_s(name, FEED_PIPE_FMT, static_cast<unsigned long>(game_pid));
+ HANDLE pipe = CreateNamedPipeA(name, PIPE_ACCESS_DUPLEX, PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT,
+ 1, 1024, 1024, 0, nullptr);
+ if (pipe == INVALID_HANDLE_VALUE) { Log("[host] CreateNamedPipe failed %lu", GetLastError()); return 1; }
+ Log("[host] serving on %s", name);
+ if (!ConnectNamedPipe(pipe, nullptr) && GetLastError() != ERROR_PIPE_CONNECTED)
+ { Log("[host] ConnectNamedPipe failed %lu", GetLastError()); return 1; }
+
+ FeedHello hello = {};
+ if (!ReadFull(pipe, &hello, sizeof(hello)) || hello.magic != FEED_IPC_MAGIC)
+ { Log("[host] bad hello"); return 1; }
+ FeedHelloAck ack = { FEED_IPC_MAGIC, FEED_IPC_VERSION };
+ DWORD put = 0;
+ WriteFile(pipe, &ack, sizeof(ack), &put, nullptr);
+ Log("[host] game pid %u connected (protocol v%u)", hello.pid, hello.version);
+
+ HANDLE hgame = OpenProcess(PROCESS_DUP_HANDLE, FALSE, hello.pid);
+ if (hgame == nullptr) { Log("[host] OpenProcess failed %lu", GetLastError()); return 1; }
+
+ // Shared fences live for the whole session.
+ HANDLE hin = nullptr, hout = nullptr;
+ h.dev->CreateFence(0, D3D12_FENCE_FLAG_SHARED, __uuidof(ID3D12Fence), reinterpret_cast<void **>(&h.fence_in));
+ h.dev->CreateFence(0, D3D12_FENCE_FLAG_SHARED, __uuidof(ID3D12Fence), reinterpret_cast<void **>(&h.fence_out));
+ if (h.fence_in == nullptr || h.fence_out == nullptr ||
+ FAILED(h.dev->CreateSharedHandle(h.fence_in, nullptr, GENERIC_ALL, nullptr, &hin)) ||
+ FAILED(h.dev->CreateSharedHandle(h.fence_out, nullptr, GENERIC_ALL, nullptr, &hout)))
+ { Log("[host] shared fence creation failed"); return 1; }
+
+ HANDLE game_in = nullptr, game_out = nullptr;
+ DuplicateHandle(GetCurrentProcess(), hin, hgame, &game_in, 0, FALSE, DUPLICATE_SAME_ACCESS);
+ DuplicateHandle(GetCurrentProcess(), hout, hgame, &game_out, 0, FALSE, DUPLICATE_SAME_ACCESS);
+
+ int flags_active = 0;
+ bool transport_only = false;
+ float mvsx = 1.0f, mvsy = 1.0f;
+ // The DLSS 5 add-on arms its NGX hooks ~150 ms after NGX init; the first create must
+ // not race that (a 15 ms miss latched STANDBY in Blacklist), so hold it briefly.
+ UINT64 hold_until = GetTickCount64() + 800;
+ UINT64 evaluated = 0;
+ bool warm_done = g_renodx_lazy; // v45+ adopts missed creates on its own
+ int build_fails = 0;
+
+ for (;;)
+ {
+ // Peek the next message type by size: Build (big) vs FrameMsg (small).
+ // The pipe is byte-mode from a single writer, so read the smaller header
+ // first and decide -- FeedFrameMsg and FeedBuild share no prefix, so the
+ // client precedes every message with a 1-byte tag instead.
+ //
+ // A plain blocking ReadFile here starves the message pump (and Present)
+ // whenever the game stops feeding frames -- paused, loading, a menu -- and
+ // Windows shows the host window as "Not Responding". Poll instead, so the
+ // window (and its ReShade overlay) stays alive and clickable at all times.
+ BYTE tag = 0;
+ bool tag_read = false;
+ for (;;)
+ {
+ DWORD avail = 0;
+ if (!PeekNamedPipe(pipe, nullptr, 0, nullptr, &avail, nullptr)) break; // pipe broken
+ if (avail > 0) { tag_read = ReadFull(pipe, &tag, 1); break; }
+ PumpPresent();
+ Sleep(8);
+ }
+ if (!tag_read) { Log("[host] pipe closed by the game"); break; }
+
+ if (tag == 'B')
+ {
+ FeedBuild b = {};
+ if (!ReadFull(pipe, &b, sizeof(b))) break;
+ Log("[host] build: %ux%u color=%u output=%u hdr=%d inverted=%d", b.width, b.height,
+ b.color_fmt, b.output_fmt, b.hdr, b.depth_inverted);
+
+ // Tear down the old set.
+ SafeReleaseFeature(h.feature);
+ h.feature = nullptr;
+ for (int i = 0; i < FEED_SLOTS; ++i)
+ if (h.tex[i] != nullptr) { h.tex[i]->Release(); h.tex[i] = nullptr; }
+
+ // Open the game's textures (duplicate the handles out of the game).
+ bool ok = true;
+ for (int i = 0; i < FEED_SLOTS && ok; ++i)
+ {
+ HANDLE local = nullptr;
+ if (!DuplicateHandle(hgame, reinterpret_cast<HANDLE>(static_cast<uintptr_t>(b.tex[i])),
+ GetCurrentProcess(), &local, 0, FALSE, DUPLICATE_SAME_ACCESS))
+ { Log("[host] DuplicateHandle(tex %d) failed %lu", i, GetLastError()); ok = false; break; }
+ HRESULT hr = h.dev->OpenSharedHandle(local, __uuidof(ID3D12Resource),
+ reinterpret_cast<void **>(&h.tex[i]));
+ CloseHandle(local);
+ if (FAILED(hr)) { Log("[host] OpenSharedHandle(tex %d) failed 0x%08X", i, hr); ok = false; }
+ }
+
+ NVSDK_NGX_Result rf = NVSDK_NGX_Result_Fail;
+ if (ok)
+ {
+ h.width = b.width; h.height = b.height;
+ h.color_fmt = static_cast<DXGI_FORMAT>(b.color_fmt);
+ h.output_fmt = static_cast<DXGI_FORMAT>(b.output_fmt);
+ mvsx = b.mv_scale_x; mvsy = b.mv_scale_y;
+ transport_only = b.transport != 0;
+ flags_active = NVSDK_NGX_DLSS_Feature_Flags_MVLowRes | NVSDK_NGX_DLSS_Feature_Flags_AutoExposure;
+ if (b.depth_inverted) flags_active |= NVSDK_NGX_DLSS_Feature_Flags_DepthInverted;
+ if (b.hdr) flags_active |= NVSDK_NGX_DLSS_Feature_Flags_IsHDR;
+ if (b.flags_override >= 0) flags_active = b.flags_override;
+
+ if (transport_only)
+ {
+ rf = static_cast<NVSDK_NGX_Result>(1); // no NGX in the loop at all
+ Log("[host] transport-only mode: Color will be copied to Output, no evaluate");
+ }
+ else
+ {
+ const UINT64 now = GetTickCount64();
+ if (now < hold_until) Sleep(static_cast<DWORD>(hold_until - now)); // hook-arming grace
+ ok = CreateFeature(b.width, b.height, flags_active, &rf);
+ hold_until = GetTickCount64() + 1000; // next create not before +1 s
+
+ if (ok) build_fails = 0;
+ else if (++build_fails >= 2 && ReinitNgx())
+ {
+ Log("[host] retrying the create after an NGX reinit");
+ ok = CreateFeature(b.width, b.height, flags_active, &rf);
+ if (ok) build_fails = 0;
+ }
+ }
+ }
+
+ evaluated = 0;
+ warm_done = transport_only || g_renodx_lazy; // no warm-up without NGX / with v45+
+
+ FeedBuildAck back = {};
+ back.ok = ok ? 1 : 0;
+ back.ngx_result = static_cast<uint32_t>(rf);
+ back.fence_in = reinterpret_cast<uint64_t>(game_in);
+ back.fence_out = reinterpret_cast<uint64_t>(game_out);
+ WriteFile(pipe, &back, sizeof(back), &put, nullptr);
+ }
+ else if (tag == 'F')
+ {
+ FeedFrameMsg fm = {};
+ if (!ReadFull(pipe, &fm, sizeof(fm))) break;
+ if (h.feature == nullptr && !transport_only) { h.fence_out->Signal(fm.n); continue; }
+
+ if (!WaitFenceValue(h.fence_in, fm.n, 2000))
+ { Log("[host] frame %llu: in-fence never arrived", (unsigned long long)fm.n); h.fence_out->Signal(fm.n); continue; }
+ h.queue->Wait(h.fence_in, fm.n); // belt and braces on the GPU timeline
+
+ bool done = false;
+ if (transport_only)
+ {
+ if (BeginCommands())
+ {
+ // Deliberately copy only the LEFT half: a split screen in the game is
+ // unambiguous visual proof that the host's output reaches the screen.
+ D3D12_TEXTURE_COPY_LOCATION src = {}, dst = {};
+ src.pResource = h.tex[FEED_COLOR];
+ src.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
+ dst.pResource = h.tex[FEED_OUTPUT];
+ dst.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
+ D3D12_BOX box = { 0, 0, 0, h.width / 2, h.height, 1 };
+ h.list->CopyTextureRegion(&dst, 0, 0, 0, &src, &box);
+ EndCommands();
+ done = true;
+ }
+ }
+ else
+ done = Evaluate(h.tex[FEED_COLOR], h.tex[FEED_OUTPUT], h.tex[FEED_DEPTH], h.tex[FEED_MV],
+ h.width, h.height, fm.reset ? 1 : 0, mvsx, mvsy);
+
+ if (done)
+ {
+ h.queue->Signal(h.fence_out, fm.n);
+ // One warm-up re-create per build: the DLSS 5 add-on misses the very first
+ // create (STANDBY latch) when its hooks armed a moment too late.
+ if (!warm_done && ++evaluated >= 180)
+ {
+ warm_done = true;
+ Log("[host] warm-up: re-creating the feature once");
+ WaitFenceValue(h.fence, h.fence_value, 2000);
+ NVSDK_NGX_Handle *old = h.feature;
+ h.feature = nullptr;
+ NVSDK_NGX_Result rr = NVSDK_NGX_Result_Fail;
+ if (CreateFeature(h.width, h.height, flags_active, &rr)) SafeReleaseFeature(old);
+ else { h.feature = old; Log("[host] keeping the previous feature"); }
+ }
+ }
+ else
+ h.fence_out->Signal(fm.n); // CPU-signal so the game never hangs on us
+
+ if (fm.n <= 3 || (fm.n % 1800) == 0)
+ Log("[host] frame %llu evaluated", (unsigned long long)fm.n);
+ PumpPresent();
+ }
+ else
+ {
+ Log("[host] unknown tag 0x%02X", tag);
+ break;
+ }
+ }
+ return 0;
+}
+
+// ---------------------------------------------------------------------------
+
+int main(int argc, char **argv)
+{
+ for (int i = 1; i < argc; ++i)
+ if (strcmp(argv[i], "--video") == 0) g_video_mode = true;
+
+ GetModuleFileNameA(nullptr, g_log_path, MAX_PATH);
+ if (char *s = strrchr(g_log_path, '\\'))
+ strcpy_s(s + 1, MAX_PATH - (s + 1 - g_log_path), "dlss5-feed-host.log");
+ if (!g_video_mode) { FILE *f = nullptr; if (fopen_s(&f, g_log_path, "w") == 0 && f) fclose(f); }
+
+ Log("dlss5-feed-host64 (built %s %s)", __DATE__, __TIME__);
+
+ bool test = false, hide = false, video = false;
+ DWORD pid = 0;
+ for (int i = 1; i < argc; ++i)
+ {
+ if (strcmp(argv[i], "--test") == 0) test = true;
+ else if (strcmp(argv[i], "--video") == 0) video = true;
+ else if (strcmp(argv[i], "--hide") == 0) hide = true;
+ else pid = static_cast<DWORD>(strtoul(argv[i], nullptr, 10));
+ }
+ if (!test && !video && pid == 0)
+ {
+ Log("usage: dlss5-worker --test | --video | <game pid> [--hide]");
+ return 1;
+ }
+ g_show_window = !test && !video && !hide; // video/probe hosts remain hidden
+
+ if (!InitDisguise()) return 1;
+ if (!InitNgx()) { Log("[host] NGX unavailable"); return 1; }
+
+ if (test) return RunTest();
+ if (video) return RunVideo();
+ return Serve(pid);
+}
diff --git a/native/DLSS5-Feeder/src/feed_ipc.h b/native/DLSS5-Feeder/src/feed_ipc.h
new file mode 100644
index 0000000..1039186
--- /dev/null
+++ b/native/DLSS5-Feeder/src/feed_ipc.h
@@ -0,0 +1,65 @@
+// dlss5-feed IPC: the 32-bit in-game add-on <-> 64-bit host protocol.
+//
+// Everything heavy stays on the GPU: the game side CREATES the four shared
+// textures on D3D11 (the direction the driver accepts, see the phase-0 spike)
+// and sends its local NT-handle values; the host duplicates them out of the
+// game process and opens them on D3D12. The host creates the two shared
+// fences on D3D12 and duplicates them INTO the game process. The pipe carries
+// only these fixed-size structs.
+//
+// Sync per frame n: game copies inputs, Signal(in_fence, n), sends FeedFrameMsg,
+// records Wait(out_fence, n) + blit; host waits in_fence >= n, evaluates,
+// Signal(out_fence, n). A pipe break on either side means "stop feeding".
+
+#pragma once
+#include <cstdint>
+
+#define FEED_IPC_MAGIC 0x35534C44u // 'DLS5'
+#define FEED_IPC_VERSION 1u
+#define FEED_PIPE_FMT "\\\\.\\pipe\\dlss5-feed.%lu" // %lu = game PID
+
+enum FeedSlot { FEED_COLOR = 0, FEED_OUTPUT, FEED_DEPTH, FEED_MV, FEED_SLOTS };
+
+#pragma pack(push, 1)
+
+struct FeedHello // game -> host, once
+{
+ uint32_t magic;
+ uint32_t version;
+ uint32_t pid;
+};
+
+struct FeedHelloAck // host -> game, once
+{
+ uint32_t magic;
+ uint32_t version;
+};
+
+struct FeedBuild // game -> host, on every resolution/format change
+{
+ uint32_t width, height;
+ uint32_t color_fmt; // DXGI_FORMAT of the shared Color/Output pair
+ uint32_t output_fmt;
+ int32_t hdr; // resolved flags, not cfg values
+ int32_t depth_inverted;
+ int32_t flags_override; // -1 = none
+ int32_t transport; // 1 = no NGX: host copies Color -> Output (cross-process transport test)
+ float mv_scale_x, mv_scale_y;
+ uint64_t tex[FEED_SLOTS]; // NT-handle VALUES in the game process (host duplicates them out)
+};
+
+struct FeedBuildAck // host -> game
+{
+ int32_t ok; // 1 = feature ready
+ uint32_t ngx_result; // NVSDK_NGX_Result of the create (0x1 = success)
+ uint64_t fence_in; // handle values valid in the GAME process (host duplicated them in)
+ uint64_t fence_out;
+};
+
+struct FeedFrameMsg // game -> host, per frame
+{
+ uint64_t n; // fence value for this frame
+ uint32_t reset; // 1 = reset temporal history
+};
+
+#pragma pack(pop)
diff --git a/native/NVIDIA-DLSS/LICENSE.txt b/native/NVIDIA-DLSS/LICENSE.txt
new file mode 100644
index 0000000..4b5b447
--- /dev/null
+++ b/native/NVIDIA-DLSS/LICENSE.txt
@@ -0,0 +1,107 @@
+NVIDIA RTX SDKs LICENSE
+
+This license is a legal agreement between you and NVIDIA Corporation ("NVIDIA") and governs the use of the NVIDIA RTX software development kits, including the DLSS SDK, NGX SDK, RTXGI SDK, RTXDI SDK, RTX Video SDK, RTX Dynamic Vibrance SDK and/or NRD SDK, if and when made available to you under this license (in each case, the �SDK�).
+This license can be accepted only by an adult of legal age of majority in the country in which the SDK is used. If you are under the legal age of majority, you must ask your parent or legal guardian to consent to this license. If you are entering this license on behalf of a company or other legal entity, you represent that you have legal authority and �you� will mean the entity you represent.
+By using the SDK, you affirm that you have reached the legal age of majority, you accept the terms of this license, and you take legal and financial responsibility for the actions of your permitted users.
+
+You agree to use the SDK only for purposes that are permitted by (a) this license, and (b) any applicable law, regulation or generally accepted practices or guidelines in the relevant jurisdictions.
+
+1. LICENSE. Subject to the terms of this license and the terms in the supplement attached, NVIDIA hereby grants you a non-exclusive, non-transferable license, without the right to sublicense (except as expressly provided in this license) to:
+a. Install and use the SDK,
+b. Modify and create derivative works of sample source code delivered in the SDK, and
+c. Distribute any software and materials within the SDK, other than developer tools provided for your internal use, as incorporated in object code format into a software application subject to the distribution requirements indicated in this license.
+
+2. DISTRIBUTION REQUIREMENTS. These are the distribution requirements for you to exercise the grants above:
+a. An application must have material additional functionality, beyond the included portions of the SDK.
+b. The following notice shall be included in modifications and derivative works of source code distributed: �This software contains source code provided by NVIDIA Corporation.�
+c. You agree to distribute the SDK subject to the terms at least as protective as the terms of this license, including (without limitation) terms relating to the license grant, license restrictions and protection of NVIDIA�s intellectual property rights. Additionally, you agree that you will protect the privacy, security and legal rights of your application users.
+d. You agree to notify NVIDIA in writing of any known or suspected distribution or use of the SDK not in compliance with the requirements of this license, and to enforce the terms of your agreements with respect to the distributed portions of the SDK.
+
+3. AUTHORIZED USERS. You may allow employees and contractors of your entity or of your subsidiary(ies) to access and use the SDK from your secure network to perform work on your behalf. If you are an academic institution you may allow users enrolled or employed by the academic institution to access and use the SDK from your secure network. You are responsible for the compliance with the terms of this license by your authorized users.
+
+4. LIMITATIONS. Your license to use the SDK is restricted as follows:
+a. You may not reverse engineer, decompile or disassemble, or remove copyright or other proprietary notices from any portion of the SDK or copies of the SDK.
+b. Except as expressly provided in this license, you may not copy, sell, rent, sublicense, transfer, distribute, modify, or create derivative works of any portion of the SDK. For clarity, you may not distribute or sublicense the SDK as a stand-alone product.
+c. Unless you have an agreement with NVIDIA for this purpose, you may not indicate that an application created with the SDK is sponsored or endorsed by NVIDIA.
+d. You may not bypass, disable, or circumvent any technical limitation, encryption, security, digital rights management or authentication mechanism in the SDK.
+e. You may not use the SDK in any manner that would cause it to become subject to an open source software license. As examples, licenses that require as a condition of use, modification, and/or distribution that the SDK be: (i) disclosed or distributed in source code form; (ii) licensed for the purpose of making derivative works; or (iii) redistributable at no charge.
+f. Unless you have an agreement with NVIDIA for this purpose, you may not use the SDK with any system or application where the use or failure of the system or application can reasonably be expected to threaten or result in personal injury, death, or catastrophic loss. Examples include use in avionics, navigation, military, medical, life support or other life critical applications. NVIDIA does not design, test or manufacture the SDK for these critical uses and NVIDIA shall not be liable to you or any third party, in whole or in part, for any claims or damages arising from such uses.
+g. You agree to defend, indemnify and hold harmless NVIDIA and its affiliates, and their respective employees, contractors, agents, officers and directors, from and against any and all claims, damages, obligations, losses, liabilities, costs or debt, fines, restitutions and expenses (including but not limited to attorney�s fees and costs incident to establishing the right of indemnification) arising out of or related to your use of the SDK outside of the scope of this license, or not in compliance with its terms.
+
+5. UPDATES. NVIDIA may, at its option, make available patches, workarounds or other updates to this SDK. Unless the updates are provided with their separate governing terms, they are deemed part of the SDK licensed to you as provided in this license. Further, NVIDIA may, at its option, automatically update the SDK or other software in the system, except for those updates that you may opt-out via the SDK API. You agree that the form and content of the SDK that NVIDIA provides may change without prior notice to you. While NVIDIA generally maintains compatibility between versions, NVIDIA may in some cases make changes that introduce incompatibilities in future versions of the SDK.
+
+6. PRE-RELEASE VERSIONS. SDK versions identified as alpha, beta, preview, early access or otherwise as pre-release may not be fully functional, may contain errors or design flaws, and may have reduced or different security, privacy, availability, and reliability standards relative to commercial versions of NVIDIA software and materials. You may use a pre-release SDK version at your own risk, understanding that these versions are not intended for use in production or business-critical systems. NVIDIA may choose not to make available a commercial version of any pre-release SDK. NVIDIA may also choose to abandon development and terminate the availability of a pre-release SDK at any time without liability.
+
+7. THIRD-PARTY COMPONENTS. The SDK may include third-party components with separate legal notices or terms as may be described in proprietary notices accompanying the SDK. If and to the extent there is a conflict between the terms in this license and the third-party license terms, the third-party terms control only to the extent necessary to resolve the conflict.
+
+8. OWNERSHIP.
+
+8.1 NVIDIA reserves all rights, title and interest in and to the SDK not expressly granted to you under this license. NVIDIA and its suppliers hold all rights, title and interest in and to the SDK, including their respective intellectual property rights. The SDK is copyrighted and protected by the laws of the United States and other countries, and international treaty provisions.
+
+8.2 Subject to the rights of NVIDIA and its suppliers in the SDK, you hold all rights, title and interest in and to your applications and your derivative works of the sample source code delivered in the SDK including their respective intellectual property rights.
+
+9. FEEDBACK. You may, but are not obligated to, provide Feedback to NVIDIA. �Feedback� means all suggestions, fixes, modifications, feature requests or other feedback regarding the SDK. Feedback, even if designated as confidential by you, shall not create any confidentiality obligation for NVIDIA. If you provide Feedback, you hereby grant NVIDIA, its affiliates and its designees a non-exclusive, perpetual, irrevocable, sublicensable, worldwide, royalty-free, fully paid-up and transferable license, under your intellectual property rights, to publicly perform, publicly display, reproduce, use, make, have made, sell, offer for sale, distribute (through multiple tiers of distribution), import, create derivative works of and otherwise commercialize and exploit the Feedback at NVIDIA�s discretion. You will not give Feedback (i) that you have reason to believe is subject to any restriction that impairs the exercise of the grant stated in this section, such as third-party intellectual property rights or (ii) subject to license terms which seek to require any product incorporating or developed using such Feedback, or other intellectual property of NVIDIA or its affiliates, to be licensed to or otherwise shared with any third party.
+
+10. NO WARRANTIES. THE SDK IS PROVIDED AS-IS. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW NVIDIA AND ITS AFFILIATES EXPRESSLY DISCLAIM ALL WARRANTIES OF ANY KIND OR NATURE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, NON-INFRINGEMENT, FITNESS FOR A PARTICULAR PURPOSE, USAGE OF TRADE AND COURSE OF DEALING. NVIDIA DOES NOT WARRANT THAT THE SDK WILL MEET YOUR REQUIREMENTS OR THAT THE OPERATION THEREOF WILL BE UNINTERRUPTED OR ERROR-FREE, OR THAT ALL ERRORS WILL BE CORRECTED.
+
+11. LIMITATIONS OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW NVIDIA AND ITS AFFILIATES SHALL NOT BE LIABLE FOR ANY (I) SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL DAMAGES, OR FOR DAMAGES FOR (A) ANY LOST PROFITS, PROJECT DELAYS, LOSS OF USE, LOSS OF DATA OR LOSS OF GOODWILL, OR (B) THE COSTS OF PROCURING SUBSTITUTE PRODUCTS, ARISING OUT OF OR IN CONNECTION WITH THIS LICENSE OR THE USE OR PERFORMANCE OF THE SDK, WHETHER SUCH LIABILITY ARISES FROM ANY CLAIM BASED UPON BREACH OF CONTRACT, BREACH OF WARRANTY, TORT (INCLUDING NEGLIGENCE), PRODUCT LIABILITY OR ANY OTHER CAUSE OF ACTION OR THEORY OF LIABILITY, EVEN IF NVIDIA HAS PREVIOUSLY BEEN ADVISED OF, OR COULD REASONABLY HAVE FORESEEN, THE POSSIBILITY OF SUCH DAMAGES. IN NO EVENT WILL NVIDIA�S AND ITS AFFILIATES TOTAL CUMULATIVE LIABILITY UNDER OR ARISING OUT OF THIS LICENSE EXCEED US$10.00. THE NATURE OF THE LIABILITY OR THE NUMBER OF CLAIMS OR SUITS SHALL NOT ENLARGE OR EXTEND THIS LIMIT.
+
+12. TERMINATION. Your rights under this license will terminate automatically without notice from NVIDIA if you fail to comply with any term and condition of this license or if you commence or participate in any legal proceeding against NVIDIA with respect to the SDK. NVIDIA may terminate this license with advance written notice to you, if NVIDIA decides to no longer provide the SDK in a country or, in NVIDIA�s sole discretion, the continued use of it is no longer commercially viable. Upon any termination of this license, you agree to promptly discontinue use of the SDK and destroy all copies in your possession or control. Your prior distributions in accordance with this license are not affected by the termination of this license. All provisions of this license will survive termination, except for the license granted to you.
+
+13. APPLICABLE LAW. This license will be governed in all respects by the laws of the United States and of the State of Delaware, without regard to the conflicts of laws principles. The United Nations Convention on Contracts for the International Sale of Goods is specifically disclaimed. You agree to all terms of this license in the English language. The state or federal courts residing in Santa Clara County, California shall have exclusive jurisdiction over any dispute or claim arising out of this license. Notwithstanding this, you agree that NVIDIA shall still be allowed to apply for injunctive remedies or urgent legal relief in any jurisdiction.
+
+14. NO ASSIGNMENT. This license and your rights and obligations thereunder may not be assigned by you by any means or operation of law without NVIDIA�s permission. Any attempted assignment not approved by NVIDIA in writing shall be void and of no effect. NVIDIA may assign, delegate or transfer this license and its rights and obligations, and if to a non-affiliate you will be notified.
+
+15. EXPORT. The SDK is subject to United States export laws and regulations. You agree to comply with all applicable U.S. and international export laws, including the Export Administration Regulations (EAR) administered by the U.S. Department of Commerce and economic sanctions administered by the U.S. Department of Treasury�s Office of Foreign Assets Control (OFAC). These laws include restrictions on destinations, end-users and end-use. By accepting this license, you confirm that you are not currently residing in a country or region currently embargoed by the U.S. and that you are not otherwise prohibited from receiving the SDK.
+
+16. GOVERNMENT USE. The SDK, documentation and technology (�Protected Items�) are �Commercial products� as this term is defined at 48 C.F.R. 2.101, consisting of �commercial computer software� and �commercial computer software documentation� as such terms are used in, respectively, 48 C.F.R. 12.212 and 48 C.F.R. 227.7202 & 252.227-7014(a)(1). Before any Protected Items are supplied to the U.S. Government, you will (i) inform the U.S. Government in writing that the Protected Items are and must be treated as commercial computer software and commercial computer software documentation developed at private expense; (ii) inform the U.S. Government that the Protected Items are provided subject to the terms of the Agreement; and (iii) mark the Protected Items as commercial computer software and commercial computer software documentation developed at private expense. In no event will you permit the U.S. Government to acquire rights in Protected Items beyond those specified in 48 C.F.R. 52.227-19(b)(1)-(2) or 252.227-7013(c) except as expressly approved by NVIDIA in writing.
+
+17. NOTICES. You agree that any notices that NVIDIA sends you electronically, such as via email, will satisfy any legal communication requirements. Please direct your legal notices or other correspondence to NVIDIA Corporation, 2788 San Tomas Expressway, Santa Clara, California 95051, United States of America, Attention: Legal Department.
+
+18. ENTIRE AGREEMENT. This license is the final, complete and exclusive agreement between the parties relating to the subject matter of this license and supersedes all prior or contemporaneous understandings and agreements relating to this subject matter, whether oral or written. If any court of competent jurisdiction determines that any provision of this license is illegal, invalid or unenforceable, the remaining provisions will remain in full force and effect. Any amendment or waiver under this license shall be in writing and signed by representatives of both parties.
+
+19. LICENSING. If the distribution terms in this license are not suitable for your organization, or for any questions regarding this license, please contact NVIDIA at [email protected].
+(v. March 14, 2024)
+
+
+NVIDIA RTX SUPPLEMENT TO SOFTWARE LICENSE AGREEMENT FOR NVIDIA SOFTWARE DEVELOPMENT KITS
+The terms in this supplement govern your use of the NVIDIA RTX SDKs, including the DLSS SDK, NGX SDK, RTXGI SDK, RTXDI SDK, RTX Video SDK, RTX Dynamic Vibrance SDK and/or NRD SDK, if and when made available to you (in each case, the �SDK�) under the terms of your license agreement (�Agreement�) as modified by this supplement. Capitalized terms used but not defined below have the meaning assigned to them in the Agreement.
+This supplement is an exhibit to the Agreement and is incorporated as an integral part of the Agreement. In the event of conflict between the terms in this supplement and the terms in the Agreement, the terms in this supplement govern.
+
+1. Interoperability. Your applications that incorporate, or are based on, the SDK must be fully interoperable with compatible GPU hardware products designed by NVIDIA or its affiliates. Further, the DLSS SDK, NGX SDK and RTX Dynamic Vibrance SDK are licensed for you to develop applications only for their use in systems with NVIDIA GPUs.
+
+2. Game License. You may, but are not obligated to, provide your game or related content (�Game Content�) to NVIDIA. If you provide Game Content, you hereby grant NVIDIA, its affiliates and its designees a non-exclusive, perpetual, irrevocable, worldwide, royalty-free, fully paid-up license, to use the Game Content to improve NVIDIA DLSS SDK and DLSS Model Training.
+
+3. Limitations for the DLSS SDK, NGX SDK,RTX Video SDK and RTX Dynamic Vibrance SDK. Your applications that incorporate, or are based on, the DLSS SDK, NGX SDK, RTX Video SDK or RTX Dynamic Vibrance SDK may be deployed in a cloud service that runs on systems that consume NVIDIA vGPU software, and any other cloud service use of such SDKs or their functionality is outside of the scope of the Agreement. For the purpose of this section, cloud services include application service providers or service bureaus, operators of hosted/virtual system environments, or hosting, time sharing or providing any other type of service to others.
+
+4. Notification for the DLSS SDK, NGX SDK and RTX Dynamic Vibrance SDK. You are required to notify NVIDIA prior to commercial release of an application (including a plug-in to a commercial application) that incorporates, or is based on, the DLSS SDK, NGX SDK or RTX Dynamic Vibrance SDK. Please send notifications to: https://developer.nvidia.com/sw-notification and provide the following information in the email: company name, publisher and developer name, NVIDIA SDK used, application name, platform (i.e. PC, Linux), scheduled ship date, and weblink to product/video.
+
+5. Audio and Video Encoders and Decoders. You acknowledge and agree that it is your sole responsibility to obtain any additional third-party licenses required to make, have made, use, have used, sell, import, and offer for sale your products or services that include or incorporate any third-party software and content relating to audio and/or video encoders and decoders from, including but not limited to, Microsoft, Thomson, Fraunhofer IIS, Sisvel S.p.A., MPEG-LA, and Coding Technologies. NVIDIA does not grant to you under this Agreement any necessary patent or other rights with respect to any audio and/or video encoders and decoders.
+
+6. SDK Terms.
+6.1 Over the Air Updates. By installing or using the SDK you agree that NVIDIA can make over-the-air updates of the SDK in systems that have the SDK installed, including (without limitation) for quality, stability or performance improvements or to support new hardware.
+
+6.2 SDK Integration. If you publicly release a DLSS integration in an end user game or application that presents material stability, performance, image quality, or other technical issues impacting the user experience, you will work to quickly address the integration issues. In the case issues are not addressed, NVIDIA reserves the right, as a last resort, to temporarily disable the DLSS integration until the issues can be fixed.
+
+7. Marketing.
+7.1 Marketing Activities. Your license to the SDK(s) under the Agreement is subject to your compliance with the following marketing terms:
+(a) Identification by You in the DLSS SDK, NGX SDK, RTX Video SDK or Dynamic Vibrance SDK. During the term of the Agreement, NVIDIA agrees that you may identify NVIDIA on your websites, printed collateral, trade-show displays and other retail packaging materials, as the supplier of the DLSS SDK, NGX SDK, RTX Video SDK or Dynamic Vibrance SDK for the applications that were developed with use of such SDKs, provided that all such references to NVIDIA will be subject to NVIDIA's prior review and written approval, which will not be unreasonably withheld or delayed.
+(b) NVIDIA Trademark Placement in Applications with the DLSS SDK, NGX SDK, or RTX Video SDK. For applications that incorporate the DLSS SDK or NGX SDK or portions thereof, you must attribute the use of the applicable SDK and include the NVIDIA Marks on splash screens, in the about box of the application (if present), and in credits for game applications.
+(c) NVIDIA Trademark Placement in Applications with a licensed SDK, other than the DLSS SDK, RTX Video SDK or NGX SDK. For applications that incorporates and/or makes use of a licensed SDK, other than the DLSS SDK, RTX Video SDK or NGX SDK, you must attribute the use of the applicable SDK and include the NVIDIA Marks on the credit screen for applications that have such credit screen, or where a credit screen is not present prominently in end user documentation for the application.
+(d) Identification by NVIDIA in the DLSS SDK, NGX SDK, RTX Video SDK or Dynamic Vibrance SDK. You agree that NVIDIA may identify you on NVIDIA's websites, printed collateral, trade-show displays, and other retail packaging materials as an individual or entity that produces products and services which incorporate the DLSS SDK, NGX SDK, RTX Video SDK or Dynamic Vibrance SDK as applicable. To the extent that you provide NVIDIA with input or usage requests with regard to the use of your logo or materials, NVIDIA will use commercially reasonable efforts to comply with such requests. For the avoidance of doubt, NVIDIA�s rights pursuant to this section shall survive any expiration or termination of the Agreement with respect to existing applications which incorporate the DLSS SDK, RTX Video SDK or NGX SDK.
+(e) Applications Marketing Material in the DLSS SDK, NGX SDK, RTX Video SDK or Dynamic Vibrance SDK. You may provide NVIDIA with screenshots, imagery, and video footage of applications representative of your use of the NVIDIA DLSS SDK or NGX SDKs in your application (collectively, �Assets�). You hereby grant to NVIDIA the right to create and display self-promotional demo materials using the Assets, and after release of the application to the public to distribute, sub-license, and use the Assets to promote and market the NVIDIA RTX SDKs. To the extent you provide NVIDIA with input or usage requests with regard to the use of your logo or materials, NVIDIA will use commercially reasonable efforts to comply with such requests. For the avoidance of doubt, NVIDIA�s rights pursuant to this section shall survive any termination of the Agreement with respect to applications which incorporate the NVIDIA RTX SDK.
+
+7.2 Trademark Ownership and Licenses. Trademarks are owned and licenses as follows:
+(a) Ownership of Trademarks. Each party owns the trademarks, logos, and trade names (collectively "Marks") for their respective products or services, including without limitation in applications, and the NVIDIA RTX SDKs. Each party agrees to use the Marks of the other only as permitted in this exhibit.
+
+(b) Trademark License to NVIDIA. You grant to NVIDIA a non-exclusive, non-sub licensable, non-transferable (except as set forth in the assignment provision of the Agreement), worldwide license to refer to you and your applications, and to use your Marks on NVIDIA's marketing materials and on NVIDIA's website (subject to any reasonable conditions of you) solely for NVIDIA�s marketing activities set forth in this exhibit Sections 7 (d)-(e) above. NVIDIA will follow your specifications for your Marks as to style, color, and typeface as reasonably provided to NVIDIA.
+
+(c) Trademark License to You. NVIDIA grants to you a non-exclusive, non-sub licensable, non-transferable (except as set forth in the assignment provision of the Agreement), worldwide license, subject to the terms of this exhibit and the Agreement, to use NVIDIA RTX�, NVIDIA GeForce RTX� in combination with GeForce products, and/or NVIDIA Quadro RTX� in combination with Quadro products (collectively, the �NVIDIA Marks�) on your marketing materials and on your website (subject to any reasonable conditions of NVIDIA) solely for your marketing activities set forth in this exhibit Sections 7.1 (a)-(c) above. For the avoidance of doubt, you will not and will not permit others to use any NVIDIA Mark for any other goods or services, or in a way that tarnishes, degrades, disparages or reflects adversely any of the NVIDIA Marks or NVIDIA�s business or reputation, or that dilutes or otherwise harms the value, reputation or distinctiveness of or NVIDIA�s goodwill in any NVIDIA Mark. In addition to the termination rights set forth in the Agreement, NVIDIA may terminate this trademark license at any time upon written notice to you. You will follow NVIDIA's use guidelines and specifications for NVIDIA's Marks as to style, color and typeface as provided in NVIDIA Marks and submit a sample of each proposed use of NVIDIA's Marks at least two (2) weeks prior to the desired implementation of such use to obtain NVIDIA's prior written approval (which approval will not be unreasonably withheld or delayed). If NVIDIA does not respond within ten (10) business days of your submission of such sample, the sample will be deemed unapproved. All goodwill associated with use of NVIDIA Marks will inure to the sole benefit of NVIDIA. For the RTX Video SDK, contact NVIDIA at [email protected].
+
+7.3 Use Guidelines. Use of the NVIDIA Marks is subject to the following guidelines:
+(a) Business Practices. You covenant that you will: (a) conduct business with respect to NVIDIA�s products in a manner that reflects favorably at all times on the good name, goodwill and reputation of such products; (b) avoid deceptive, misleading or unethical practices that are detrimental to NVIDIA, its customers, or end users; (c) make no false or misleading representations with regard to NVIDIA or its products; and (d) not publish or employ or cooperate in the publication or employment of any misleading or deceptive advertising or promotional materials.
+
+(b) No Combination Marks or Similar Marks. You agree not to (a) combine NVIDIA Marks with any other content without NVIDIA�s prior written approval, or (b) use any other trademark, trade name, or other designation of source which creates a likelihood of confusion with NVIDIA Marks.
+
+(v. March 14, 2024)
+
diff --git a/native/NVIDIA-DLSS/include/nvsdk_ngx.h b/native/NVIDIA-DLSS/include/nvsdk_ngx.h
new file mode 100644
index 0000000..44427d2
--- /dev/null
+++ b/native/NVIDIA-DLSS/include/nvsdk_ngx.h
@@ -0,0 +1,705 @@
+/*
+ * SPDX-FileCopyrightText: Copyright (c) 2018-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
+ *
+ * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
+ * property and proprietary rights in and to this material, related
+ * documentation and any modifications thereto. Any use, reproduction,
+ * disclosure or distribution of this material and related documentation
+ * without an express license agreement from NVIDIA CORPORATION or
+ * its affiliates is strictly prohibited.
+ */
+
+/*
+* HOW TO USE:
+*
+* IMPORTANT: FOR DLSS/DLISP PLEASE SEE THE PROGRAMMING GUIDE
+*
+* IMPORTANT: Methods in this library are NOT thread safe. It is up to the
+* client to ensure that thread safety is enforced as needed.
+*
+* 1) Call NVSDK_CONV NVSDK_NGX_D3D11/D3D12/CUDA_Init and pass your app Id
+* and other parameters. This will initialize SDK or return an error code
+* if SDK cannot run on target machine. Depending on error user might
+* need to update drivers. Please note that application Id is provided
+* by NVIDIA so if you do not have one please contact us.
+*
+* 2) Call NVSDK_NGX_D3D11/D3D12/CUDA_GetCapabilityParameters to obtain pointer to
+* interface used to pass parameters to SDK. Interface instance is
+* allocated and released by SDK so there is no need to do any memory
+* management on client side.
+*
+* 3) Set key parameters for the feature you want to use. For example,
+* width and height are required for all features and they can be
+* set like this:
+* Params->Set(NVSDK_NGX_Parameter_Width,MY_WIDTH);
+* Params->Set(NVSDK_NGX_Parameter_Height,MY_HEIGHT);
+*
+* Please refer to samples since different features need different
+* parameters and hints.
+*
+* 4) Call NVSDK_NGX_D3D11/D3D12/CUDA_GetScratchBufferSize to obtain size of
+* the scratch buffer needed by specific feature. This D3D or CUDA buffer
+* should be allocated by client and passed as:
+* Params->Set(NVSDK_NGX_Parameter_Scratch,MY_SCRATCH_POINTER)
+* Params->Set(NVSDK_NGX_Parameter_Scratch_SizeInBytes,MY_SCRATCH_SIZE_IN_BYTES)
+* NOTE: Returned size can be 0 if feature does not use any scratch buffer.
+* It is OK to use bigger buffer or reuse buffers across features as long
+* as minimum size requirement is met.
+*
+* 5) Call NVSDK_NGX_D3D11/D3D12/CUDA_CreateFeature to create feature you need.
+* On success SDK will return a handle which must be used in any successive
+* calls to SDK which require feature handle. SDK will use all parameters
+* and hints provided by client to generate feature. If feature with the same
+* parameters already exists and error code will be returned.
+*
+* 6) Call NVSDK_NGX_D3D11/D3D12/CUDA_EvaluateFeature to invoke execution of
+* specific feature. Before feature can be evaluated input parameters must
+* be specified (like for example color/albedo buffer, motion vectors etc)
+*
+* 6) Call NVSDK_NGX_D3D11/D3D12/CUDA_ReleaseFeature when feature is no longer
+* needed. After this call feature handle becomes invalid and cannot be used.
+*
+* 7) Call NVSDK_NGX_D3D11/D3D12/CUDA_Shutdown when SDK is no longer needed to
+* release all resources.
+
+* Contact: [email protected]
+*/
+
+
+#ifndef NVSDK_NGX_H
+#define NVSDK_NGX_H
+
+#include <stddef.h> // For size_t
+
+#include "nvsdk_ngx_defs.h"
+#include "nvsdk_ngx_params.h"
+#ifndef __cplusplus
+#include <stdbool.h>
+#include <wchar.h>
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+typedef struct IDXGIAdapter IDXGIAdapter;
+typedef struct ID3D11Device ID3D11Device;
+typedef struct ID3D11Resource ID3D11Resource;
+typedef struct ID3D11DeviceContext ID3D11DeviceContext;
+
+typedef struct ID3D12Device ID3D12Device;
+typedef struct ID3D12GraphicsCommandList ID3D12GraphicsCommandList;
+
+typedef unsigned long long CUtexObject;
+
+// NOTE: Functions under the same name and different function signatures exist
+// between the NGX SDK, NGX Core (driver), and NGX Snippets. To discern the
+// different signatures here we check if NGX_SNIPPET_BUILD is defined. When that
+// is the case we know that the function signature in-use should be that of
+// between NGX Core and the Snippet. Otherwise the signature should be between
+// NGX SDK and NGX Core.
+//
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_Init
+// -----------------------------------------------------------------------------
+// Initializes a new SDK instance.
+//
+// DESCRIPTION:
+// Initializes a new SDK instance. Most NGX SDK functions require the NGX
+// SDK to be initialized for the corresponding graphics API and device to
+// function properly.
+//
+// NVSDK_NGX_Init requires an application ID provided by NVIDIA. If an
+// application ID is not available, use NVSDK_NGX_Init_with_ProjectID to
+// supply your own identifier.
+//
+// Be sure to call NVSDK_NGX_Shutdown to shut down the SDK when it is no
+// longer needed.
+//
+// PARAMETERS:
+// InApplicationId:
+// Unique ID provided by NVIDIA.
+//
+// InApplicationDataPath:
+// Directory to store logs and other temporary files. Write access is
+// required. Typically, this would be next to the application executable,
+// or in a location like Documents or ProgramData.
+//
+// InDevice (D3D11/12 only):
+// DirectX device to use.
+//
+// InFeatureInfo:
+// Contains information common to all features, including a list of paths
+// where feature DLLs can be located, other than the default path (application directory).
+//
+// InSDKVersion:
+// Version of the SDK currently in use. Typically, this should be left as
+// the default value, NVSDK_NGX_Version_API.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure. Common values include:
+// - NVSDK_NGX_Result_Success if the function executed successfully
+// - NVSDK_NGX_Result_FAIL_FeatureNotSupported if the NGX SDK is not
+// supported on the current system
+// Check the NGX logs for additional information about any failures.
+//
+#if defined(NGX_SNIPPET_BUILD)
+#ifdef __cplusplus
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, ID3D11Device *InDevice, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Init_Ext(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, ID3D11Device *InDevice, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API, const NVSDK_NGX_Parameter* InParameters = nullptr);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, ID3D12Device *InDevice, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_Init_Ext(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, ID3D12Device *InDevice, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API, const NVSDK_NGX_Parameter* InParameters = nullptr);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Init_Ext(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API, const NVSDK_NGX_Parameter* InParameters = nullptr);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Init_Ext1(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, NVSDK_NGX_CUDADevice *InDevice, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API, const NVSDK_NGX_Parameter* InParameters = nullptr);
+#else
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, ID3D11Device *InDevice, NVSDK_NGX_Version InSDKVersion);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Init_Ext(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, ID3D11Device *InDevice, NVSDK_NGX_Version InSDKVersion, const NVSDK_NGX_Parameter* InParameters);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, ID3D12Device *InDevice, NVSDK_NGX_Version InSDKVersion);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_Init_Ext(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, ID3D12Device *InDevice, NVSDK_NGX_Version InSDKVersion, const NVSDK_NGX_Parameter* InParameters);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, NVSDK_NGX_Version InSDKVersion);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Init_Ext(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, NVSDK_NGX_Version InSDKVersion, const NVSDK_NGX_Parameter* InParameters);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Init_Ext1(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, NVSDK_NGX_CUDADevice *InDevice, NVSDK_NGX_Version InSDKVersion, const NVSDK_NGX_Parameter* InParameters);
+#endif
+#else
+#ifdef __cplusplus
+NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, ID3D11Device *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API);
+NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, ID3D12Device *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API);
+NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API);
+NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Init1(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, NVSDK_NGX_CUDADevice *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API);
+#else
+NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, ID3D11Device *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion);
+NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, ID3D12Device *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion);
+NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion);
+NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Init1(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, NVSDK_NGX_CUDADevice *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion);
+#endif
+#endif // defined(NGX_SNIPPET_BUILD)
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_Init_with_ProjectID
+// -----------------------------------------------------------------------------
+// Initializes a new SDK instance using a project ID.
+//
+// DESCRIPTION:
+// Initializes a new SDK instance. Most NGX SDK functions require the NGX
+// SDK to be initialized for the corresponding graphics API and device to
+// function properly.
+//
+// Applications must provide a unique identifier to initialize the NGX SDK.
+// If an identifier was provided by NVIDIA, use NVSDK_NGX_Init instead.
+//
+// For projects using third-party engines such as Unreal Engine or
+// Omniverse, the integration for those engines should handle providing the
+// correct Project ID to NGX. Ensure that the project ID is set in the
+// engine's editor.
+//
+// For other engines, use NVSDK_NGX_EngineType CUSTOM. The driver will
+// validate that the Project ID is GUID-like, for example,
+// "a0f57b54-1daf-4934-90ae-c4035c19df04". Ensure your project ID matches
+// this format.
+//
+// Be sure to call NVSDK_NGX_Shutdown to shut down the SDK when it is no
+// longer needed.
+//
+// PARAMETERS:
+// InProjectId:
+// Unique ID provided by the rendering engine used. Must be a GUID-like
+// string.
+//
+// InEngineType:
+// Rendering engine used by the application/plugin. Use NVSDK_NGX_EngineType
+// CUSTOM if the specific engine type is not explicitly supported.
+//
+// InEngineVersion:
+// Version number of the rendering engine used by the application/plugin.
+//
+// InApplicationDataPath:
+// Directory to store logs and other temporary files (write access required).
+//
+// InDevice (D3D11/12 only):
+// DirectX device to use.
+//
+// InFeatureInfo:
+// Contains information common to all features, including a list of paths
+// where feature DLLs can be located in addition to the default path
+// (the application directory).
+//
+// InSDKVersion:
+// Version of the SDK currently in use. Typically, this should be left as
+// the default value, NVSDK_NGX_Version_API.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure. Common values include:
+// - NVSDK_NGX_Result_Success if the function executed successfully
+// - NVSDK_NGX_Result_InvalidParameter if the provided project ID is in
+// an invalid format
+// - NVSDK_NGX_Result_FAIL_FeatureNotSupported if the NGX SDK is not
+// supported on the current system
+// Check the NGX logs for additional information about any failures.
+//
+#if defined(NGX_SNIPPET_BUILD)
+// No NGX Core <---> Snippet interfaces
+#else
+#ifdef __cplusplus
+NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Init_with_ProjectID(const char *InProjectId, NVSDK_NGX_EngineType InEngineType, const char *InEngineVersion, const wchar_t *InApplicationDataPath, ID3D11Device *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API);
+NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_Init_with_ProjectID(const char *InProjectId, NVSDK_NGX_EngineType InEngineType, const char *InEngineVersion, const wchar_t *InApplicationDataPath, ID3D12Device *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API);
+NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Init_with_ProjectID(const char *InProjectId, NVSDK_NGX_EngineType InEngineType, const char *InEngineVersion, const wchar_t *InApplicationDataPath, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API);
+#else
+NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Init_with_ProjectID(const char *InProjectId, NVSDK_NGX_EngineType InEngineType, const char *InEngineVersion, const wchar_t *InApplicationDataPath, ID3D11Device *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion);
+NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_Init_with_ProjectID(const char *InProjectId, NVSDK_NGX_EngineType InEngineType, const char *InEngineVersion, const wchar_t *InApplicationDataPath, ID3D12Device *InDevice, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion);
+NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Init_with_ProjectID(const char *InProjectId, NVSDK_NGX_EngineType InEngineType, const char *InEngineVersion, const wchar_t *InApplicationDataPath, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion);
+#endif
+#endif // defined(NGX_SNIPPET_BUILD)
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_Shutdown
+// -----------------------------------------------------------------------------
+// Shuts down the current SDK instance and releases all resources.
+//
+// DESCRIPTION:
+// Shuts down the current SDK instance and releases all resources. If a
+// device is provided, NVSDK_NGX_Shutdown1 shuts down the instance
+// corresponding to the specified device. If nullptr is provided, all
+// instances are shut down.
+//
+// Deprecation Notice: The use of Shutdown() is deprecated. Please use
+// Shutdown1(nullptr) instead.
+//
+// PARAMETERS:
+// InDevice:
+// Device to shut down. If nullptr, the SDK is shut down for all devices.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure.
+//
+#ifdef NGX_ENABLE_DEPRECATED_SHUTDOWN
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Shutdown(void);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_Shutdown(void);
+#endif
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_Shutdown1(ID3D11Device *InDevice);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_Shutdown1(ID3D12Device *InDevice);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Shutdown(void);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_Shutdown1(NVSDK_NGX_CUDADevice *InDevice);
+
+#ifdef NGX_ENABLE_DEPRECATED_GET_PARAMETERS
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_GetParameters
+// -----------------------------------------------------------------------------
+// Retrieves a parameter map used to set parameters needed by the SDK.
+//
+// DEPRECATED: Use NVSDK_NGX_AllocateParameters or
+// NVSDK_NGX_GetCapabilityParameters instead.
+//
+// DESCRIPTION:
+// Retrieves the common NVSDK_NGX_Parameter map for providing parameters to
+// the SDK. The NVSDK_NGX_Parameter interface allows simple parameter setup
+// using named fields. For example, set the width by calling
+// Parameters->Set(NVSDK_NGX_Parameter_Width, 100) or provide a resource
+// pointer by calling Parameters->Set(NVSDK_NGX_Parameter_Color, resource).
+// For more details, see the sample code.
+//
+// Parameter maps returned by NVSDK_NGX_GetParameters are pre-populated
+// with NGX capabilities and available features. Unlike
+// NVSDK_NGX_AllocateParameters, parameter maps returned by
+// NVSDK_NGX_GetParameters have their lifetimes managed by NGX and must not
+// be destroyed by the application using NVSDK_NGX_DestroyParameters.
+//
+// This function may only be called after a successful call to
+// NVSDK_NGX_Init.
+//
+// Note: Allocated memory will be freed by NGX, so do not use the
+// free/delete operator.
+//
+// Deprecation Notice: NVSDK_NGX_GetParameters is deprecated. Applications
+// should use NVSDK_NGX_AllocateParameters and
+// NVSDK_NGX_GetCapabilityParameters when possible. However, if there is a
+// possibility that the user may be using an older driver version (driver
+// version 445 or older), NVSDK_NGX_GetParameters may still be used as a
+// fallback if NVSDK_NGX_AllocateParameters or
+// NVSDK_NGX_GetCapabilityParameters return
+// NVSDK_NGX_Result_FAIL_OutOfDate.
+//
+// PARAMETERS:
+// OutParameters:
+// Output pointer that will be populated with an NVSDK_NGX_Parameter
+// interface.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure.
+//
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_GetParameters(NVSDK_NGX_Parameter **OutParameters);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_GetParameters(NVSDK_NGX_Parameter **OutParameters);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_GetParameters(NVSDK_NGX_Parameter **OutParameters);
+#endif // NGX_ENABLE_DEPRECATED_GET_PARAMETERS
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_AllocateParameters
+// -----------------------------------------------------------------------------
+// Allocates a parameter map used to set parameters needed by the SDK.
+//
+// DESCRIPTION:
+// Allocates a new NVSDK_NGX_Parameter map for providing parameters to the
+// SDK. The lifetime of this parameter map must be managed by the
+// application. The NVSDK_NGX_Parameter interface allows simple parameter
+// setup using named fields. For example, set the width by calling
+// Parameters->Set(NVSDK_NGX_Parameter_Width, 100) or provide a resource
+// pointer by calling Parameters->Set(NVSDK_NGX_Parameter_Color, resource).
+// For more details, see the sample code.
+//
+// Use NVSDK_NGX_DestroyParameters to free a parameter map created by
+// NVSDK_NGX_AllocateParameters. Parameter maps created by
+// NVSDK_NGX_AllocateParameters must NOT be freed using the free/delete
+// operator.
+//
+// Parameter maps created by NVSDK_NGX_AllocateParameters do not come
+// pre-populated with NGX capabilities and available features. To create a
+// new parameter map pre-populated with such information, use
+// NVSDK_NGX_GetCapabilityParameters instead.
+//
+// This function may return NVSDK_NGX_Result_FAIL_OutOfDate if using an
+// older driver that does not support this API call. In such a case,
+// NVSDK_NGX_GetParameters may be used as a fallback.
+//
+// This function may only be called after a successful call to
+// NVSDK_NGX_Init.
+//
+// PARAMETERS:
+// OutParameters:
+// Output pointer that will be populated with the newly-allocated
+// NVSDK_NGX_Parameter interface.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure. Common values include:
+// - NVSDK_NGX_Result_Success if the function executed successfully
+// - NVSDK_NGX_Result_FAIL_OutOfDate if this function is not supported by
+// the current display driver
+// Check the NGX logs for additional information about any failures.
+//
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_AllocateParameters(NVSDK_NGX_Parameter** OutParameters);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_AllocateParameters(NVSDK_NGX_Parameter** OutParameters);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_AllocateParameters(NVSDK_NGX_Parameter** OutParameters);
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_GetCapabilityParameters
+// -----------------------------------------------------------------------------
+// Allocates a parameter map populated with NGX and feature capabilities.
+//
+// DESCRIPTION:
+// Allocates a new NVSDK_NGX_Parameter map pre-populated with NGX
+// capabilities and information about available features. The output
+// parameter map can also be used in the same ways as a parameter map
+// allocated with NVSDK_NGX_AllocateParameters. However, it is not
+// recommended to use NVSDK_NGX_GetCapabilityParameters unless querying NGX
+// capabilities due to the overhead associated with pre-populating the
+// parameter map.
+//
+// Use NVSDK_NGX_DestroyParameters to free a parameter map created by
+// NVSDK_NGX_GetCapabilityParameters. Parameter maps created by
+// NVSDK_NGX_GetCapabilityParameters must NOT be freed using the
+// free/delete operator.
+//
+// This function may return NVSDK_NGX_Result_FAIL_OutOfDate if using an
+// older driver that does not support this API call. In such a case,
+// NVSDK_NGX_GetParameters may be used as a fallback.
+//
+// This function may only be called after a successful call to
+// NVSDK_NGX_Init.
+//
+// PARAMETERS:
+// OutParameters:
+// Output pointer that will be populated with the newly-allocated
+// NVSDK_NGX_Parameter interface.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure. Common values include:
+// - NVSDK_NGX_Result_Success if the function executed successfully
+// - NVSDK_NGX_Result_FAIL_OutOfDate if this function is not supported by
+// the current display driver
+// Check the NGX logs for additional information about any failures.
+//
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_GetCapabilityParameters(NVSDK_NGX_Parameter** OutParameters);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_GetCapabilityParameters(NVSDK_NGX_Parameter** OutParameters);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_GetCapabilityParameters(NVSDK_NGX_Parameter** OutParameters);
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_DestroyParameters
+// -----------------------------------------------------------------------------
+// Destroys the specified parameter map.
+//
+// DESCRIPTION:
+// Destroys the input parameter map. Once NVSDK_NGX_DestroyParameters is
+// called on a parameter map, it must not be used again.
+//
+// NVSDK_NGX_DestroyParameters must not be called on any parameter map
+// returned by NVSDK_NGX_GetParameters; NGX will manage the lifetime of
+// those parameter maps.
+//
+// This function may only be called after a successful call to
+// NVSDK_NGX_Init.
+//
+// PARAMETERS:
+// InParameters:
+// The parameter map to be destroyed.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure.
+//
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_DestroyParameters(NVSDK_NGX_Parameter* InParameters);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_DestroyParameters(NVSDK_NGX_Parameter* InParameters);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_DestroyParameters(NVSDK_NGX_Parameter* InParameters);
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_GetScratchBufferSize
+// -----------------------------------------------------------------------------
+// Retrieves the size of the scratch buffer needed for the specified feature.
+//
+// DESCRIPTION:
+// The SDK requires a buffer of a certain size provided by the client to
+// initialize some NGX features. Once the feature is no longer needed, the
+// buffer can be released. It is safe to reuse the same scratch buffer for
+// different features as long as the minimum size requirement is met for
+// all features. Some features might not need a scratch buffer, so a return
+// size of 0 is completely valid.
+//
+// Note: Most current NGX features do not use scratch buffers. Please check
+// the documentation for the particular feature in use to determine whether
+// a scratch buffer needs to be created.
+//
+// PARAMETERS:
+// InFeatureId:
+// Identifier of the feature to query.
+//
+// InParameters:
+// Parameters used by the feature to determine scratch buffer size.
+//
+// OutSizeInBytes:
+// Number of bytes needed for the scratch buffer for the specified feature.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure.
+//
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_GetScratchBufferSize(NVSDK_NGX_Feature InFeatureId, const NVSDK_NGX_Parameter *InParameters, size_t *OutSizeInBytes);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_GetScratchBufferSize(NVSDK_NGX_Feature InFeatureId, const NVSDK_NGX_Parameter *InParameters, size_t *OutSizeInBytes);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_GetScratchBufferSize(NVSDK_NGX_Feature InFeatureId, const NVSDK_NGX_Parameter *InParameters, size_t *OutSizeInBytes);
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_CreateFeature
+// -----------------------------------------------------------------------------
+// Creates and initializes an instance of the specified NGX feature.
+//
+// DESCRIPTION:
+// Each feature needs to be created before it can be used. The parameters
+// required to create the feature vary. Refer to the feature's
+// documentation and/or sample code to find out which input parameters are
+// needed to create a specific feature.
+//
+// NVSDK_NGX_CreateFeature creates an NVSDK_NGX_Handle to the feature, which
+// is needed to reference the feature in later calls to
+// NVSDK_NGX_EvaluateFeature. Multiple instances of the same feature may be
+// created, and evaluating one instance of a feature should not change the
+// state of other instances.
+//
+// When a feature instance is no longer needed, it should be freed using
+// NVSDK_NGX_ReleaseFeature.
+//
+// PARAMETERS:
+// InCmdList (D3D12 only):
+// Command list to use to execute GPU commands. Must:
+// - Be open and recording
+// - Have a node mask that includes the device provided in
+// NVSDK_NGX_D3D12_Init
+// - Be executed on a non-copy command queue
+//
+// InDevCtx (D3D11 only):
+// Device context to use to execute GPU commands. Must be an immediate
+// context. Passing a deferred context is not supported and will cause the
+// API to return an error.
+//
+// InFeatureID:
+// Identifier of the feature to initialize.
+//
+// InParameters:
+// Parameters used to create the feature.
+//
+// OutHandle:
+// Handle which uniquely identifies the feature.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure. Common values include:
+// - NVSDK_NGX_Result_Success if the function executed successfully
+// - NVSDK_NGX_Result_FAIL_UnableToInitializeFeature if the feature
+// cannot be created, for example, because the feature is not supported
+// on the current hardware, or because the DLL could not be found
+// - NVSDK_NGX_Result_FAIL_InvalidParameter if any of the input
+// parameters are invalid
+// - NVSDK_NGX_Result_FAIL_FeatureAlreadyExists if a feature instance
+// with the same parameters has already been created, and the feature
+// doesn't allow multiple instances to be created with the same
+// parameters.
+// Check the NGX logs for additional information about any failures.
+//
+#if defined(NGX_SNIPPET_BUILD)
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_CreateFeature(ID3D11DeviceContext *InDevCtx, NVSDK_NGX_Feature InFeatureID, const NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_CreateFeature(ID3D12GraphicsCommandList *InCmdList, NVSDK_NGX_Feature InFeatureID, const NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_CreateFeature(NVSDK_NGX_Feature InFeatureID, const NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_CreateFeature1(NVSDK_NGX_CUDADevice *InDevice, NVSDK_NGX_Feature InFeatureID, const NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle);
+#else
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_CreateFeature(ID3D11DeviceContext *InDevCtx, NVSDK_NGX_Feature InFeatureID, NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_CreateFeature(ID3D12GraphicsCommandList *InCmdList, NVSDK_NGX_Feature InFeatureID, NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_CreateFeature(NVSDK_NGX_Feature InFeatureID, const NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_CreateFeature1(NVSDK_NGX_CUDADevice *InDevice, NVSDK_NGX_Feature InFeatureID, const NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle);
+
+#endif // defined(NGX_SNIPPET_BUILD)
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_ReleaseFeature
+// -----------------------------------------------------------------------------
+// Releases the specified NGX feature.
+//
+// DESCRIPTION:
+// Releases the feature associated with the given handle and frees its
+// memory. Handles are not reference counted, so after this call, it is
+// invalid to use the provided handle.
+//
+// PARAMETERS:
+// InHandle:
+// Handle to the feature to be released.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure.
+//
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_ReleaseFeature(NVSDK_NGX_Handle *InHandle);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_ReleaseFeature(NVSDK_NGX_Handle *InHandle);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_ReleaseFeature(NVSDK_NGX_Handle *InHandle);
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_GetFeatureRequirements
+// -----------------------------------------------------------------------------
+// Identifies system requirements to support a given NGX feature.
+//
+// DESCRIPTION:
+// Utility function used to identify system requirements to support a given
+// NGX feature on a system, given its display device subsystem adapter
+// information that will be subsequently used for creating the graphics
+// device. The output parameter OutSupported will be populated with
+// requirements and is valid if and only if the function returns
+// NVSDK_NGX_Result_Success. The result includes:
+// - FeatureSupported: Bitfield of reasons why the feature is
+// unsupported, as specified in NVSDK_NGX_Feature_Support_Result. 0 if
+// the feature is supported
+// - MinHWArchitecture: The hardware architecture version corresponding
+// to an NV_GPU_ARCHITECTURE_ID value defined in the NvAPI GPU
+// Framework
+// - MinOSVersion: The minimum OS version required for the provided
+// feature
+//
+// NVSDK_NGX_Init does NOT need to be called before calling this function.
+// Applications may wish to use this function to determine whether a
+// desired feature is supported before initializing the complete SDK.
+//
+// PARAMETERS:
+// Adapter (D3D11/12 only):
+// Physical adapter which will be used to create the graphics device.
+//
+// FeatureDiscoveryInfo:
+// Struct containing information about the feature to query and how it is
+// expected to be initialized, including the feature ID and information
+// that would be provided to NVSDK_NGX_Init.
+//
+// OutSupported:
+// Populated with the requirements for the specified feature.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure.
+//
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_GetFeatureRequirements(IDXGIAdapter *Adapter,
+ const NVSDK_NGX_FeatureDiscoveryInfo *FeatureDiscoveryInfo,
+ NVSDK_NGX_FeatureRequirement *OutSupported);
+
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_GetFeatureRequirements(IDXGIAdapter *Adapter,
+ const NVSDK_NGX_FeatureDiscoveryInfo *FeatureDiscoveryInfo,
+ NVSDK_NGX_FeatureRequirement *OutSupported);
+
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_GetFeatureRequirements(int CudaDevice,
+ const NVSDK_NGX_FeatureDiscoveryInfo *FeatureDiscoveryInfo,
+ NVSDK_NGX_FeatureRequirement *OutSupported);
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_EvaluateFeature
+// -----------------------------------------------------------------------------
+// Evaluates the specified NGX feature using the provided parameters.
+//
+// DESCRIPTION:
+// Evaluates the given feature using the provided parameters. The
+// parameters required to evaluate a feature vary. Refer to the feature's
+// documentation and sample code to determine which input parameters are
+// needed.
+//
+// To evaluate a feature, an NVSDK_NGX_Handle to an instance of that
+// feature, created with NVSDK_NGX_CreateFeature, must be provided.
+//
+// For most features, it is beneficial to pass as many input buffers and
+// parameters as possible (e.g., provide all render targets like color,
+// albedo, normals, depth, etc.). This will ensure maximum future
+// compatibility with new updates.
+//
+// PARAMETERS:
+// InCmdList (D3D12 only):
+// Command list to use to execute GPU commands. Must be:
+// - Open and recording
+// - With a node mask including the device provided in NVSDK_NGX_D3D12_Init
+// - Executed on a non-copy command queue
+//
+// InDevCtx (D3D11 only):
+// Device context to use to execute GPU commands. Must be an immediate
+// context. Passing a deferred context is not supported and will cause the
+// API to return an error.
+//
+// InFeatureHandle:
+// Handle representing the feature to be evaluated.
+//
+// InParameters:
+// List of parameters required to evaluate the feature.
+//
+// InCallback:
+// Optional callback for features that might take longer to execute. If
+// specified, the SDK will call it with progress values in the range 0.0f -
+// 1.0f. Not all features support progress callbacks. Refer to the
+// documentation for the specific feature to determine whether or not
+// progress callbacks are supported.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure. Common values include:
+// - NVSDK_NGX_Result_Success if the function executed successfully.
+// - NVSDK_NGX_Result_FAIL_InvalidParameter if any of the input
+// parameters are missing or invalid.
+// - NVSDK_NGX_Result_FAIL_FeatureNotFound if a feature with the provided
+// handle could not be found.
+// Check the NGX logs for additional information about any failures.
+//
+#ifdef __cplusplus
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_EvaluateFeature(ID3D11DeviceContext *InDevCtx, const NVSDK_NGX_Handle *InFeatureHandle, const NVSDK_NGX_Parameter *InParameters, PFN_NVSDK_NGX_ProgressCallback InCallback = NULL);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_EvaluateFeature(ID3D12GraphicsCommandList *InCmdList, const NVSDK_NGX_Handle *InFeatureHandle, const NVSDK_NGX_Parameter *InParameters, PFN_NVSDK_NGX_ProgressCallback InCallback = NULL);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_EvaluateFeature(const NVSDK_NGX_Handle *InFeatureHandle, const NVSDK_NGX_Parameter *InParameters, PFN_NVSDK_NGX_ProgressCallback InCallback = NULL);
+#endif
+
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D11_EvaluateFeature_C(ID3D11DeviceContext *InDevCtx, const NVSDK_NGX_Handle *InFeatureHandle, const NVSDK_NGX_Parameter *InParameters, PFN_NVSDK_NGX_ProgressCallback_C InCallback);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_D3D12_EvaluateFeature_C(ID3D12GraphicsCommandList *InCmdList, const NVSDK_NGX_Handle *InFeatureHandle, const NVSDK_NGX_Parameter *InParameters, PFN_NVSDK_NGX_ProgressCallback_C InCallback);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_CUDA_EvaluateFeature_C(const NVSDK_NGX_Handle *InFeatureHandle, const NVSDK_NGX_Parameter *InParameters, PFN_NVSDK_NGX_ProgressCallback_C InCallback);
+
+#if defined(NGX_SNIPPET_BUILD)
+// No NGX Core <---> Snippet interfaces
+#else
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_UpdateFeature(const NVSDK_NGX_Application_Identifier *ApplicationId, const NVSDK_NGX_Feature FeatureID);
+#endif // defined(NGX_SNIPPET_BUILD)
+
+// NGX return-code conversion-to-string utility only as a helper for debugging/logging - not for official use.
+const wchar_t* NVSDK_CONV GetNGXResultAsString(NVSDK_NGX_Result InNGXResult);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // #define NVSDK_NGX_H
diff --git a/native/NVIDIA-DLSS/include/nvsdk_ngx_defs.h b/native/NVIDIA-DLSS/include/nvsdk_ngx_defs.h
new file mode 100644
index 0000000..c1c1232
--- /dev/null
+++ b/native/NVIDIA-DLSS/include/nvsdk_ngx_defs.h
@@ -0,0 +1,859 @@
+/*
+ * SPDX-FileCopyrightText: Copyright (c) 2018-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
+ *
+ * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
+ * property and proprietary rights in and to this material, related
+ * documentation and any modifications thereto. Any use, reproduction,
+ * disclosure or distribution of this material and related documentation
+ * without an express license agreement from NVIDIA CORPORATION or
+ * its affiliates is strictly prohibited.
+ */
+
+#ifndef NVSDK_NGX_DEFS_H
+#define NVSDK_NGX_DEFS_H
+#pragma once
+
+#ifndef __cplusplus
+#include <stddef.h> // For size_t
+#include <stdbool.h>
+#include <wchar.h>
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#ifdef __cplusplus
+#if defined(NGX_CORE_BUILD) && defined(_WIN32)
+#define NVSDK_NGX_API extern "C" __declspec(dllexport)
+#else
+#define NVSDK_NGX_API extern "C"
+#endif
+#else
+#if defined(NGX_CORE_BUILD) && defined(_WIN32)
+#define NVSDK_NGX_API __declspec(dllexport)
+#else
+#define NVSDK_NGX_API
+#endif
+#endif
+
+#ifdef __GNUC__
+#define NVSDK_CONV
+#else
+#define NVSDK_CONV __cdecl
+#endif
+
+#define NVSDK_NGX_ARRAY_LEN(a) (sizeof(a) / sizeof((a)[0]))
+
+// Version Notes:
+// Version 0x0000014:
+// * Added a logging callback that the app may pass in on init
+// * Added ability for the app to override the logging level
+// Version 0x0000015:
+// * Support multiple GPUs (bug 3270533)
+#define NVSDK_NGX_VERSION_API_MACRO 0x0000015 // NGX_VERSION_DOT 1.5.0
+
+#ifdef __cplusplus
+#if __cplusplus >= 201402L
+#define SR_DEPRECATED_SHARPENING [[deprecated("Sharpness is not supported")]]
+#else
+#define SR_DEPRECATED_SHARPENING
+#endif
+#else
+#define SR_DEPRECATED_SHARPENING
+#endif
+
+typedef unsigned long long AppId;
+
+typedef enum NVSDK_NGX_DLSS_Hint_Render_Preset
+{
+ NVSDK_NGX_DLSS_Hint_Render_Preset_Default = 0, // default behavior, may or may not change after OTA
+ // NVSDK_NGX_DLSS_Hint_Render_Preset_A removed, use preset J or K
+ // NVSDK_NGX_DLSS_Hint_Render_Preset_B removed, use preset J or K
+ // NVSDK_NGX_DLSS_Hint_Render_Preset_C removed, use preset J or K
+ // NVSDK_NGX_DLSS_Hint_Render_Preset_D removed, use preset J or K
+ NVSDK_NGX_DLSS_Hint_Render_Preset_E = 5, // Deprecated
+ NVSDK_NGX_DLSS_Hint_Render_Preset_F = 6, // Deprecated
+ NVSDK_NGX_DLSS_Hint_Render_Preset_G = 7, // Do not use, reverts to default behavior
+ NVSDK_NGX_DLSS_Hint_Render_Preset_H_Reserved = 8, // Do not use, reverts to default behavior
+ NVSDK_NGX_DLSS_Hint_Render_Preset_I_Reserved = 9, // Do not use, reverts to default behavior
+ NVSDK_NGX_DLSS_Hint_Render_Preset_J = 10, // Similar to preset K. Preset J might exhibit slightly less ghosting at the cost of extra flickering. Preset K is generally recommended over preset J
+ NVSDK_NGX_DLSS_Hint_Render_Preset_K = 11, // Default preset for DLAA/Balanced/Quality modes that is transformer based. Best image quality preset at a higher performance cost
+ NVSDK_NGX_DLSS_Hint_Render_Preset_L = 12, // Default for Ultra Perf mode
+ NVSDK_NGX_DLSS_Hint_Render_Preset_M = 13, // Default for Perf mode
+ NVSDK_NGX_DLSS_Hint_Render_Preset_N = 14, // Do not use, reverts to default behavior
+ NVSDK_NGX_DLSS_Hint_Render_Preset_O = 15, // Do not use, reverts to default behavior
+} NVSDK_NGX_DLSS_Hint_Render_Preset;
+
+typedef struct NVSDK_NGX_Handle NVSDK_NGX_Handle;
+typedef struct NVSDK_NGX_Parameter NVSDK_NGX_Parameter;
+typedef struct NVSDK_NGX_FeatureCommonInfo_Internal NVSDK_NGX_FeatureCommonInfo_Internal;
+
+typedef enum NVSDK_NGX_Version { NVSDK_NGX_Version_API = NVSDK_NGX_VERSION_API_MACRO } NVSDK_NGX_Version;
+
+typedef enum NVSDK_NGX_Result
+{
+ // The operation completed successfully.
+ NVSDK_NGX_Result_Success = 0x1,
+
+ // Generic failure. Check the NGX logs for detailed information.
+ NVSDK_NGX_Result_Fail = 0xBAD00000,
+
+ // The NGX SDK or a specific feature is not supported by the current system,
+ // hardware, and/or graphics API.
+ NVSDK_NGX_Result_FAIL_FeatureNotSupported = NVSDK_NGX_Result_Fail | 1,
+
+ // An error occurred within the underlying platform, which includes the
+ // graphics API in use, the operating system, or other system libraries and
+ // dependencies that are not part of the NGX SDK, such as NvAPI. Consult the
+ // NGX logs and the graphics API's validation layers for detailed
+ // information.
+ NVSDK_NGX_Result_FAIL_PlatformError = NVSDK_NGX_Result_Fail | 2,
+
+ // The NGX feature could not be created because a feature with identical
+ // parameters already exists, and the feature does not support multiple
+ // identical instances.
+ NVSDK_NGX_Result_FAIL_FeatureAlreadyExists = NVSDK_NGX_Result_Fail | 3,
+
+ // A feature associated with the provided handle could not be found.
+ NVSDK_NGX_Result_FAIL_FeatureNotFound = NVSDK_NGX_Result_Fail | 4,
+
+ // One or more provided parameters had an incorrect value or type, or a
+ // required parameter was not provided.
+ NVSDK_NGX_Result_FAIL_InvalidParameter = NVSDK_NGX_Result_Fail | 5,
+
+ // The feature requires a scratch buffer, but none was provided or the
+ // provided buffer is too small. Use NVSDK_NGX_GetScratchBufferSize to
+ // determine the necessary size.
+ NVSDK_NGX_Result_FAIL_ScratchBufferTooSmall = NVSDK_NGX_Result_Fail | 6,
+
+ // A function that requires the NGX SDK to be initialized was called before
+ // the SDK was properly initialized.
+ NVSDK_NGX_Result_FAIL_NotInitialized = NVSDK_NGX_Result_Fail | 7,
+
+ // One or more input buffers supplied to the feature had an unsupported
+ // format.
+ NVSDK_NGX_Result_FAIL_UnsupportedInputFormat = NVSDK_NGX_Result_Fail | 8,
+
+ // The feature requires read/write access to output buffers, but one or more
+ // provided buffers did not have the correct access flags (UAV in
+ // D3D11/D3D12).
+ NVSDK_NGX_Result_FAIL_RWFlagMissing = NVSDK_NGX_Result_Fail | 9,
+
+ // A required input parameter was not provided.
+ NVSDK_NGX_Result_FAIL_MissingInput = NVSDK_NGX_Result_Fail | 10,
+
+ // The requested feature could not be initialized, likely because the
+ // library for that feature could not be found.
+ NVSDK_NGX_Result_FAIL_UnableToInitializeFeature = NVSDK_NGX_Result_Fail | 11,
+
+ // A function was used which requires a newer version of the NVIDIA Display
+ // Driver or feature library than is currently installed.
+ NVSDK_NGX_Result_FAIL_OutOfDate = NVSDK_NGX_Result_Fail | 12,
+
+ // An operation could not be completed because the system lacked sufficient
+ // GPU memory.
+ NVSDK_NGX_Result_FAIL_OutOfGPUMemory = NVSDK_NGX_Result_Fail | 13,
+
+ // One or more buffers provided to the feature had an unsupported format.
+ NVSDK_NGX_Result_FAIL_UnsupportedFormat = NVSDK_NGX_Result_Fail | 14,
+
+ // The SDK does not have the necessary write permissions for the path
+ // specified in InApplicationDataPath.
+ NVSDK_NGX_Result_FAIL_UnableToWriteToAppDataPath = NVSDK_NGX_Result_Fail | 15,
+
+ // A parameter supplied to the feature is either unsupported by the current
+ // version or has an unsupported value.
+ NVSDK_NGX_Result_FAIL_UnsupportedParameter = NVSDK_NGX_Result_Fail | 16,
+
+ // NVIDIA has restricted the use of this feature in the current application.
+ // Contact NVIDIA for further information.
+ NVSDK_NGX_Result_FAIL_Denied = NVSDK_NGX_Result_Fail | 17,
+
+ // The requested feature or functionality has not been implemented in the
+ // current version of the NGX SDK, display driver, or feature library.
+ NVSDK_NGX_Result_FAIL_NotImplemented = NVSDK_NGX_Result_Fail | 18,
+} NVSDK_NGX_Result;
+
+// Skip setting the debug overlay value if it is UNSET.
+#define NVSDK_NGX_DLSS_DEBUG_OVERLAY_VALUE_UNSET -1
+
+#define NVSDK_NGX_SUCCEED(value) (((value) & 0xFFF00000) != NVSDK_NGX_Result_Fail)
+#define NVSDK_NGX_FAILED(value) (((value) & 0xFFF00000) == NVSDK_NGX_Result_Fail)
+
+typedef enum NVSDK_NGX_Feature
+{
+ NVSDK_NGX_Feature_Reserved0 = 0,
+
+ NVSDK_NGX_Feature_SuperSampling = 1,
+
+ NVSDK_NGX_Feature_InPainting = 2,
+
+ NVSDK_NGX_Feature_ImageSuperResolution = 3,
+
+ NVSDK_NGX_Feature_SlowMotion = 4,
+
+ NVSDK_NGX_Feature_VideoSuperResolution = 5,
+
+ NVSDK_NGX_Feature_Reserved1 = 6,
+
+ NVSDK_NGX_Feature_Reserved2 = 7,
+
+ NVSDK_NGX_Feature_Reserved3 = 8,
+
+ NVSDK_NGX_Feature_ImageSignalProcessing = 9,
+
+ NVSDK_NGX_Feature_DeepResolve = 10,
+
+ NVSDK_NGX_Feature_FrameGeneration = 11,
+
+ NVSDK_NGX_Feature_DeepDVC = 12,
+
+ NVSDK_NGX_Feature_RayReconstruction = 13,
+
+ NVSDK_NGX_Feature_Reserved14 = 14,
+
+ NVSDK_NGX_Feature_Reserved15 = 15,
+
+ NVSDK_NGX_Feature_Reserved16 = 16,
+
+ NVSDK_NGX_Feature_Reserved17 = 17,
+
+ NVSDK_NGX_Feature_Reserved18 = 18,
+
+ // New features go here
+ NVSDK_NGX_Feature_Count,
+
+ // These members are not strictly NGX features, but are
+ // components of the NGX system, and it may sometimes
+ // be useful to identify them using the same enum
+ NVSDK_NGX_Feature_Reserved_SDK = 32764,
+
+ NVSDK_NGX_Feature_Reserved_Core = 32765,
+
+ NVSDK_NGX_Feature_Reserved_Unknown = 32766
+} NVSDK_NGX_Feature;
+
+//TODO create grayscale format (R32F?)
+typedef enum NVSDK_NGX_Buffer_Format
+{
+ NVSDK_NGX_Buffer_Format_Unknown,
+ NVSDK_NGX_Buffer_Format_RGB8UI,
+ NVSDK_NGX_Buffer_Format_RGB16F,
+ NVSDK_NGX_Buffer_Format_RGB32F,
+ NVSDK_NGX_Buffer_Format_RGBA8UI,
+ NVSDK_NGX_Buffer_Format_RGBA16F,
+ NVSDK_NGX_Buffer_Format_RGBA32F,
+} NVSDK_NGX_Buffer_Format;
+
+typedef enum NVSDK_NGX_PerfQuality_Value
+{
+ NVSDK_NGX_PerfQuality_Value_MaxPerf,
+ NVSDK_NGX_PerfQuality_Value_Balanced,
+ NVSDK_NGX_PerfQuality_Value_MaxQuality,
+ // Extended PerfQuality modes
+ NVSDK_NGX_PerfQuality_Value_UltraPerformance,
+ NVSDK_NGX_PerfQuality_Value_UltraQuality,
+ NVSDK_NGX_PerfQuality_Value_DLAA,
+} NVSDK_NGX_PerfQuality_Value;
+
+typedef enum NVSDK_NGX_RTX_Value
+{
+ NVSDK_NGX_RTX_Value_Off,
+ NVSDK_NGX_RTX_Value_On,
+} NVSDK_NGX_RTX_Value;
+
+// For each unique instance, a pointer to NVSDK_NGX_CUDADevice is passed in to
+// NVSDK_NGX_CUDA_Init1, NVSDK_NGX_CUDA_CreateFeature1 and NVSDK_NGX_CUDA_Shutdown1.
+// This is needed in the case of running multiple threads in a single process.
+// Depending on the app usage of CUDA, one or both of cudaContext and cudaStream can be set.
+typedef struct NVSDK_NGX_CUDADevice
+{
+ void* cudaContext; // CUcontext returned from cuCtxCreate
+ void* cudaStream; // CUstream returned from cuStreamCreate
+} NVSDK_NGX_CUDADevice;
+
+typedef enum NVSDK_NGX_DLSS_Mode
+{
+ NVSDK_NGX_DLSS_Mode_Off, // use existing in-engine AA + upscale solution
+ NVSDK_NGX_DLSS_Mode_DLSS_DLISP,
+ NVSDK_NGX_DLSS_Mode_DLISP_Only, // use existing in-engine AA solution
+ NVSDK_NGX_DLSS_Mode_DLSS, // DLSS will apply AA and upsample at the same time
+} NVSDK_NGX_DLSS_Mode;
+
+typedef enum NVSDK_NGX_DLSS_Feature_Flags
+{
+ NVSDK_NGX_DLSS_Feature_Flags_IsInvalid = 1 << 31,
+
+ NVSDK_NGX_DLSS_Feature_Flags_None = 0,
+ NVSDK_NGX_DLSS_Feature_Flags_IsHDR = 1 << 0,
+ NVSDK_NGX_DLSS_Feature_Flags_MVLowRes = 1 << 1,
+ NVSDK_NGX_DLSS_Feature_Flags_MVJittered = 1 << 2,
+ NVSDK_NGX_DLSS_Feature_Flags_DepthInverted = 1 << 3,
+ NVSDK_NGX_DLSS_Feature_Flags_Reserved_0 = 1 << 4,
+ NVSDK_NGX_DLSS_Feature_Flags_DoSharpening SR_DEPRECATED_SHARPENING = 1 << 5, // Sharpness is not supported
+ NVSDK_NGX_DLSS_Feature_Flags_AutoExposure = 1 << 6,
+ NVSDK_NGX_DLSS_Feature_Flags_AlphaUpscaling = 1 << 7,
+ NVSDK_NGX_DLSS_Feature_Flags_Reserved_8 = 1 << 8,
+} NVSDK_NGX_DLSS_Feature_Flags;
+
+typedef enum NVSDK_NGX_ToneMapperType
+{
+ NVSDK_NGX_TONEMAPPER_STRING = 0,
+ NVSDK_NGX_TONEMAPPER_REINHARD,
+ NVSDK_NGX_TONEMAPPER_ONEOVERLUMA,
+ NVSDK_NGX_TONEMAPPER_ACES,
+ NVSDK_NGX_TONEMAPPERTYPE_NUM
+} NVSDK_NGX_ToneMapperType;
+
+typedef enum NVSDK_NGX_GBufferType
+{
+ NVSDK_NGX_GBUFFER_ALBEDO = 0,
+ NVSDK_NGX_GBUFFER_ROUGHNESS,
+ NVSDK_NGX_GBUFFER_METALLIC,
+ NVSDK_NGX_GBUFFER_SPECULAR,
+ NVSDK_NGX_GBUFFER_SUBSURFACE,
+ NVSDK_NGX_GBUFFER_NORMALS,
+ NVSDK_NGX_GBUFFER_SHADINGMODELID, /* unique identifier for drawn object or how the object is drawn */
+ NVSDK_NGX_GBUFFER_MATERIALID, /* unique identifier for material */
+ NVSDK_NGX_GBUFFER_SPECULAR_ALBEDO,
+ NVSDK_NGX_GBUFFER_INDIRECT_ALBEDO,
+ NVSDK_NGX_GBUFFER_SPECULAR_MVEC,
+ NVSDK_NGX_GBUFFER_DISOCCL_MASK, /* deprecated: use NVSDK_NGX_GBUFFER_RESPONSIVITY_MASK*/
+ NVSDK_NGX_GBUFFER_EMISSIVE,
+ NVSDK_NGX_GBUFFER_RESPONSIVITY_MASK,
+ NVSDK_NGX_GBUFFERTYPE_NUM = 17
+} NVSDK_NGX_GBufferType;
+
+typedef struct NVSDK_NGX_Coordinates
+{
+ unsigned int X;
+ unsigned int Y;
+} NVSDK_NGX_Coordinates;
+
+typedef struct NVSDK_NGX_Dimensions
+{
+ unsigned int Width;
+ unsigned int Height;
+} NVSDK_NGX_Dimensions;
+
+typedef struct NVSDK_NGX_PrecisionInfo
+{
+ // 1 if and only if the associated resource buffer is considered low-precision
+ unsigned int IsLowPrecision;
+
+ // Bias and Scale values, such that `hi = lo * Scale + Bias`
+ float Bias;
+ float Scale;
+} NVSDK_NGX_PrecisionInfo;
+
+typedef struct NVSDK_NGX_PathListInfo
+{
+ // Pointer to a const string
+ wchar_t const* const* Path;
+ // Path-list length
+ unsigned int Length;
+} NVSDK_NGX_PathListInfo;
+
+typedef enum NVSDK_NGX_Logging_Level
+{
+ NVSDK_NGX_LOGGING_LEVEL_OFF = 0,
+ NVSDK_NGX_LOGGING_LEVEL_ON,
+ NVSDK_NGX_LOGGING_LEVEL_VERBOSE,
+ NVSDK_NGX_LOGGING_LEVEL_NUM
+} NVSDK_NGX_Logging_Level;
+
+// A logging callback provided by the app to allow piping log lines back to the app.
+// Please take careful note of the signature and calling convention.
+// The callback must be able to be called from any thread.
+// It must also be fully thread-safe and any number of threads may call into it concurrently.
+// It must fully process message by the time it returns, and there is no guarantee that
+// message will still be valid or allocated after it returns.
+// message will be a null-terminated string and may contain multibyte characters.
+#if defined(__GNUC__) || defined(__clang__)
+typedef void NVSDK_CONV(*NVSDK_NGX_AppLogCallback)(const char* message, NVSDK_NGX_Logging_Level loggingLevel, NVSDK_NGX_Feature sourceComponent);
+#else
+typedef void(NVSDK_CONV* NVSDK_NGX_AppLogCallback)(const char* message, NVSDK_NGX_Logging_Level loggingLevel, NVSDK_NGX_Feature sourceComponent);
+#endif
+
+typedef struct NVSDK_NGX_LoggingInfo
+{
+ // Fields below were introduced in SDK version 0x0000014
+
+ // App-provided logging callback
+ NVSDK_NGX_AppLogCallback LoggingCallback;
+
+ // The minimum logging level to use. If this is higher
+ // than the logging level otherwise configured, this will override
+ // that logging level. Otherwise, that logging level will be used.
+ NVSDK_NGX_Logging_Level MinimumLoggingLevel;
+
+ // Whether or not to disable writing log lines to sinks other than the app log callback. This
+ // may be useful if the app provides a logging callback. LoggingCallback must be non-null and point
+ // to a valid logging callback if this is set to true.
+ bool DisableOtherLoggingSinks;
+
+} NVSDK_NGX_LoggingInfo;
+
+typedef struct NVSDK_NGX_FeatureCommonInfo
+{
+ // List of all paths in descending order of search sequence to locate a feature dll in, other than the default path - application folder.
+ NVSDK_NGX_PathListInfo PathListInfo;
+ // Used internally by NGX
+ NVSDK_NGX_FeatureCommonInfo_Internal* InternalData; // Introduced in SDK version 0x0000013
+
+ // Fields below were introduced in SDK version 0x0000014
+ NVSDK_NGX_LoggingInfo LoggingInfo;
+} NVSDK_NGX_FeatureCommonInfo;
+
+typedef enum NVSDK_NGX_Opt_Level
+{
+ NVSDK_NGX_OPT_LEVEL_UNDEFINED = 0,
+ NVSDK_NGX_OPT_LEVEL_DEBUG = 20,
+ NVSDK_NGX_OPT_LEVEL_DEVELOP = 30,
+ NVSDK_NGX_OPT_LEVEL_RELEASE = 40
+} NVSDK_NGX_Opt_Level;
+
+typedef enum NVSDK_NGX_EngineType
+{
+ NVSDK_NGX_ENGINE_TYPE_CUSTOM = 0,
+ NVSDK_NGX_ENGINE_TYPE_UNREAL,
+ NVSDK_NGX_ENGINE_TYPE_UNITY,
+ NVSDK_NGX_ENGINE_TYPE_OMNIVERSE,
+ NVSDK_NGX_ENGINE_COUNT
+} NVSDK_NGX_EngineType;
+
+typedef enum NVSDK_NGX_GraphicsAPI
+{
+ NVSDK_NGX_GRAPHICS_API_CUDA = 0,
+ NVSDK_NGX_GRAPHICS_API_D3D11 = 1,
+ NVSDK_NGX_GRAPHICS_API_D3D12 = 2,
+ NVSDK_NGX_GRAPHICS_API_VULKAN = 3,
+ NVSDK_NGX_GRAPHICS_API_COUNT
+} NVSDK_NGX_GraphicsAPI;
+
+typedef enum NVSDK_NGX_Feature_Support_Result
+{
+ NVSDK_NGX_FeatureSupportResult_Supported = 0,
+ NVSDK_NGX_FeatureSupportResult_CheckNotPresent = 1,
+ NVSDK_NGX_FeatureSupportResult_DriverVersionUnsupported = 2,
+ NVSDK_NGX_FeatureSupportResult_AdapterUnsupported = 4,
+ NVSDK_NGX_FeatureSupportResult_OSVersionBelowMinimumSupported = 8,
+ NVSDK_NGX_FeatureSupportResult_NotImplemented = 16
+} NVSDK_NGX_Feature_Support_Result;
+
+typedef enum NVSDK_NGX_Application_Identifier_Type
+{
+ NVSDK_NGX_Application_Identifier_Type_Application_Id = 0,
+ NVSDK_NGX_Application_Identifier_Type_Project_Id = 1,
+} NVSDK_NGX_Application_Identifier_Type;
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_ProjectIdDescription
+// -------------------------------------
+// Contains information to identify an application built using a common rendering engine (list of supported rendering engines is defined in NVSDK_NGX_EngineType).
+// Should only be used by plugins for the supported rendering engines, unless using NVSDK_NGX_ENGINE_TYPE_CUSTOM as the engine type.
+//
+// ProjectId
+// Unique Id provided by the rendering engine used
+//
+// EngineType
+// Rendering engine used by the application / plugin.
+// Use NVSDK_NGX_ENGINE_TYPE_CUSTOM if the specific engine type is not supported explicitly
+//
+// EngineVersion
+// Version number of the rendering engine used by the application / plugin.
+//
+// DESCRIPTION:
+// Contains information to identify an application built using a common rendering engine (list of supported rendering engines is defined in NVSDK_NGX_EngineType).
+// Should only be used by plugins for the supported rendering engines, unless using NVSDK_NGX_ENGINE_TYPE_CUSTOM as the engine type.
+//
+typedef struct NVSDK_NGX_ProjectIdDescription
+{
+ const char* ProjectId;
+ NVSDK_NGX_EngineType EngineType;
+ const char* EngineVersion;
+} NVSDK_NGX_ProjectIdDescription;
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_Application_Identifier
+// -------------------------------------
+// Identifier for each application. Required for over the air updates (both optional and mandatory)
+// as well as for app-specific customizations for features like DLSS-SR
+//
+// IdentifierType:
+// Whether using a NVSDK_NGX_ProjectIdDescription or an Unique Application Identifier
+//
+// ProjectDesc:
+// If using NVSDK_NGX_ProjectIdDescription, this contains the project ID and engine info required to identify this app
+//
+// ApplicationIdentifier:
+// If not using NVSDK_NGX_ProjectIdDescription, this contains an ID provided by NVIDIA for this app
+// If your NVIDIA contact did not provide you an ID for this purpose, use ProjectDesc with NVSDK_NGX_ENGINE_TYPE_CUSTOM as the engine type
+//
+typedef struct NVSDK_NGX_Application_Identifier
+{
+ NVSDK_NGX_Application_Identifier_Type IdentifierType;
+ union v {
+ NVSDK_NGX_ProjectIdDescription ProjectDesc;
+ unsigned long long ApplicationId;
+ } v;
+} NVSDK_NGX_Application_Identifier;
+
+/////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_FeatureDiscoveryInfo
+// -------------------------------------
+// Contains information common to all features, used by NGX in determining requested Feature availability
+//
+// InSDKVersion:
+// API Struct version number
+//
+// FeatureID
+// Valid NVSDK_NGX_Feature enum corresponding to DLSS v3 Feature which is being queried for availability
+//
+// ApplicationId
+// Unique Id provided by NVIDIA corresponding to a particular Application or alternatively custom Id set by Engine
+//
+// InApplicationDataPath:
+// Folder to store logs and other temporary files (write access required),
+// Normally this would be a location in Documents or ProgramData.
+//
+// FeatureInfo:
+// Contains information common to all features, presently only a list of all paths
+// feature dlls can be located in, other than the default path - application directory.
+//
+typedef struct NVSDK_NGX_FeatureDiscoveryInfo
+{
+ NVSDK_NGX_Version SDKVersion;
+ NVSDK_NGX_Feature FeatureID;
+ NVSDK_NGX_Application_Identifier Identifier;
+ const wchar_t* ApplicationDataPath;
+ const NVSDK_NGX_FeatureCommonInfo* FeatureInfo;
+} NVSDK_NGX_FeatureDiscoveryInfo;
+
+typedef struct NVSDK_NGX_FeatureRequirement
+{
+ // Bitfield of bit shifted values specified in NVSDK_NGX_Feature_Support_Result. 0 if Feature is Supported.
+ NVSDK_NGX_Feature_Support_Result FeatureSupported;
+
+ // Returned HW Architecture value corresponding to NV_GPU_ARCHITECTURE_ID values defined in NvAPI GPU Framework.
+ unsigned int MinHWArchitecture;
+
+ // Value corresponding to minimum OS version required for NGX Feature Support
+ char MinOSVersion[255];
+} NVSDK_NGX_FeatureRequirement;
+
+// Callback function types
+typedef NVSDK_NGX_Result(NVSDK_CONV *PFN_NVSDK_NGX_DLSS_GetStatsCallback)(NVSDK_NGX_Parameter *InParams);
+typedef NVSDK_NGX_Result(NVSDK_CONV *PFN_NVSDK_NGX_DLSS_GetOptimalSettingsCallback)(NVSDK_NGX_Parameter *InParams);
+
+typedef struct IUnknown IUnknown;
+typedef struct D3D11_TEXTURE2D_DESC D3D11_TEXTURE2D_DESC;
+typedef struct D3D11_BUFFER_DESC D3D11_BUFFER_DESC;
+typedef struct ID3D11Buffer ID3D11Buffer;
+typedef struct ID3D11Texture2D ID3D11Texture2D;
+typedef struct ID3D12Resource ID3D12Resource;
+typedef struct D3D12_RESOURCE_DESC D3D12_RESOURCE_DESC;
+typedef struct CD3DX12_HEAP_PROPERTIES CD3DX12_HEAP_PROPERTIES;
+
+typedef void (NVSDK_CONV *PFN_NVSDK_NGX_D3D12_ResourceAllocCallback)(D3D12_RESOURCE_DESC *InDesc, int InState, CD3DX12_HEAP_PROPERTIES *InHeap, ID3D12Resource **OutResource);
+typedef void (NVSDK_CONV *PFN_NVSDK_NGX_D3D11_BufferAllocCallback)(D3D11_BUFFER_DESC *InDesc, ID3D11Buffer **OutResource);
+typedef void (NVSDK_CONV *PFN_NVSDK_NGX_D3D11_Tex2DAllocCallback)(D3D11_TEXTURE2D_DESC *InDesc, ID3D11Texture2D **OutResource);
+typedef void (NVSDK_CONV *PFN_NVSDK_NGX_ResourceReleaseCallback)(IUnknown *InResource);
+
+#ifdef __cplusplus
+typedef void (NVSDK_CONV *PFN_NVSDK_NGX_ProgressCallback)(float InCurrentProgress, bool &OutShouldCancel);
+#endif
+typedef void (NVSDK_CONV *PFN_NVSDK_NGX_ProgressCallback_C)(float InCurrentProgress, bool *OutShouldCancel);
+
+// Read-only parameters provided by NGX
+#define NVSDK_NGX_EParameter_Reserved00 "#\x00"
+#define NVSDK_NGX_EParameter_SuperSampling_Available "#\x01"
+#define NVSDK_NGX_EParameter_InPainting_Available "#\x02"
+#define NVSDK_NGX_EParameter_ImageSuperResolution_Available "#\x03"
+#define NVSDK_NGX_EParameter_SlowMotion_Available "#\x04"
+#define NVSDK_NGX_EParameter_VideoSuperResolution_Available "#\x05"
+#define NVSDK_NGX_EParameter_Reserved06 "#\x06"
+#define NVSDK_NGX_EParameter_Reserved07 "#\x07"
+#define NVSDK_NGX_EParameter_Reserved08 "#\x08"
+#define NVSDK_NGX_EParameter_ImageSignalProcessing_Available "#\x09"
+#define NVSDK_NGX_EParameter_ImageSuperResolution_ScaleFactor_2_1 "#\x0a"
+#define NVSDK_NGX_EParameter_ImageSuperResolution_ScaleFactor_3_1 "#\x0b"
+#define NVSDK_NGX_EParameter_ImageSuperResolution_ScaleFactor_3_2 "#\x0c"
+#define NVSDK_NGX_EParameter_ImageSuperResolution_ScaleFactor_4_3 "#\x0d"
+#define NVSDK_NGX_EParameter_NumFrames "#\x0e"
+#define NVSDK_NGX_EParameter_Scale "#\x0f"
+#define NVSDK_NGX_EParameter_Width "#\x10"
+#define NVSDK_NGX_EParameter_Height "#\x11"
+#define NVSDK_NGX_EParameter_OutWidth "#\x12"
+#define NVSDK_NGX_EParameter_OutHeight "#\x13"
+#define NVSDK_NGX_EParameter_Sharpness "#\x14"
+#define NVSDK_NGX_EParameter_Scratch "#\x15"
+#define NVSDK_NGX_EParameter_Scratch_SizeInBytes "#\x16"
+#define NVSDK_NGX_EParameter_EvaluationNode "#\x17" // valid since API 0x13 (replaced a deprecated param)
+#define NVSDK_NGX_EParameter_Input1 "#\x18"
+#define NVSDK_NGX_EParameter_Input1_Format "#\x19"
+#define NVSDK_NGX_EParameter_Input1_SizeInBytes "#\x1a"
+#define NVSDK_NGX_EParameter_Input2 "#\x1b"
+#define NVSDK_NGX_EParameter_Input2_Format "#\x1c"
+#define NVSDK_NGX_EParameter_Input2_SizeInBytes "#\x1d"
+#define NVSDK_NGX_EParameter_Color "#\x1e"
+#define NVSDK_NGX_EParameter_Color_Format "#\x1f"
+#define NVSDK_NGX_EParameter_Color_SizeInBytes "#\x20"
+#define NVSDK_NGX_EParameter_Albedo "#\x21"
+#define NVSDK_NGX_EParameter_Output "#\x22"
+#define NVSDK_NGX_EParameter_Output_Format "#\x23"
+#define NVSDK_NGX_EParameter_Output_SizeInBytes "#\x24"
+#define NVSDK_NGX_EParameter_Reset "#\x25"
+#define NVSDK_NGX_EParameter_BlendFactor "#\x26"
+#define NVSDK_NGX_EParameter_MotionVectors "#\x27"
+#define NVSDK_NGX_EParameter_Rect_X "#\x28"
+#define NVSDK_NGX_EParameter_Rect_Y "#\x29"
+#define NVSDK_NGX_EParameter_Rect_W "#\x2a"
+#define NVSDK_NGX_EParameter_Rect_H "#\x2b"
+#define NVSDK_NGX_EParameter_MV_Scale_X "#\x2c"
+#define NVSDK_NGX_EParameter_MV_Scale_Y "#\x2d"
+#define NVSDK_NGX_EParameter_Model "#\x2e"
+#define NVSDK_NGX_EParameter_Format "#\x2f"
+#define NVSDK_NGX_EParameter_SizeInBytes "#\x30"
+#define NVSDK_NGX_EParameter_ResourceAllocCallback "#\x31"
+#define NVSDK_NGX_EParameter_BufferAllocCallback "#\x32"
+#define NVSDK_NGX_EParameter_Tex2DAllocCallback "#\x33"
+#define NVSDK_NGX_EParameter_ResourceReleaseCallback "#\x34"
+#define NVSDK_NGX_EParameter_CreationNodeMask "#\x35"
+#define NVSDK_NGX_EParameter_VisibilityNodeMask "#\x36"
+#define NVSDK_NGX_EParameter_PreviousOutput "#\x37"
+#define NVSDK_NGX_EParameter_MV_Offset_X "#\x38"
+#define NVSDK_NGX_EParameter_MV_Offset_Y "#\x39"
+#define NVSDK_NGX_EParameter_Hint_UseFireflySwatter "#\x3a"
+#define NVSDK_NGX_EParameter_Resource_Width "#\x3b"
+#define NVSDK_NGX_EParameter_Resource_Height "#\x3c"
+#define NVSDK_NGX_EParameter_Depth "#\x3d"
+#define NVSDK_NGX_EParameter_DLSSOptimalSettingsCallback "#\x3e"
+#define NVSDK_NGX_EParameter_PerfQualityValue "#\x3f"
+#define NVSDK_NGX_EParameter_RTXValue "#\x40"
+#define NVSDK_NGX_EParameter_DLSSMode "#\x41"
+#define NVSDK_NGX_EParameter_DeepResolve_Available "#\x42"
+#define NVSDK_NGX_EParameter_Deprecated_43 "#\x43"
+#define NVSDK_NGX_EParameter_OptLevel "#\x44"
+#define NVSDK_NGX_EParameter_IsDevSnippetBranch "#\x45"
+#define NVSDK_NGX_EParameter_DeepDVC_Available "#\x46"
+#define NVSDK_NGX_EParameter_Graphics_API "#\x47"
+#define NVSDK_NGX_EParameter_Reserved_48 "#\x48"
+#define NVSDK_NGX_EParameter_Reserved_49 "#\x49"
+
+#define NVSDK_NGX_Parameter_OptLevel "Snippet.OptLevel"
+#define NVSDK_NGX_Parameter_IsDevSnippetBranch "Snippet.IsDevBranch"
+#define NVSDK_NGX_Parameter_SuperSampling_ScaleFactor "SuperSampling.ScaleFactor"
+#define NVSDK_NGX_Parameter_ImageSignalProcessing_ScaleFactor "ImageSignalProcessing.ScaleFactor"
+#define NVSDK_NGX_Parameter_SuperSampling_Available "SuperSampling.Available"
+#define NVSDK_NGX_Parameter_InPainting_Available "InPainting.Available"
+#define NVSDK_NGX_Parameter_ImageSuperResolution_Available "ImageSuperResolution.Available"
+#define NVSDK_NGX_Parameter_SlowMotion_Available "SlowMotion.Available"
+#define NVSDK_NGX_Parameter_VideoSuperResolution_Available "VideoSuperResolution.Available"
+#define NVSDK_NGX_Parameter_ImageSignalProcessing_Available "ImageSignalProcessing.Available"
+#define NVSDK_NGX_Parameter_DeepResolve_Available "DeepResolve.Available"
+#define NVSDK_NGX_Parameter_SuperSampling_NeedsUpdatedDriver "SuperSampling.NeedsUpdatedDriver"
+#define NVSDK_NGX_Parameter_InPainting_NeedsUpdatedDriver "InPainting.NeedsUpdatedDriver"
+#define NVSDK_NGX_Parameter_ImageSuperResolution_NeedsUpdatedDriver "ImageSuperResolution.NeedsUpdatedDriver"
+#define NVSDK_NGX_Parameter_SlowMotion_NeedsUpdatedDriver "SlowMotion.NeedsUpdatedDriver"
+#define NVSDK_NGX_Parameter_VideoSuperResolution_NeedsUpdatedDriver "VideoSuperResolution.NeedsUpdatedDriver"
+#define NVSDK_NGX_Parameter_ImageSignalProcessing_NeedsUpdatedDriver "ImageSignalProcessing.NeedsUpdatedDriver"
+#define NVSDK_NGX_Parameter_DeepResolve_NeedsUpdatedDriver "DeepResolve.NeedsUpdatedDriver"
+#define NVSDK_NGX_Parameter_FrameInterpolation_NeedsUpdatedDriver "FrameInterpolation.NeedsUpdatedDriver"
+#define NVSDK_NGX_Parameter_SuperSampling_MinDriverVersionMajor "SuperSampling.MinDriverVersionMajor"
+#define NVSDK_NGX_Parameter_InPainting_MinDriverVersionMajor "InPainting.MinDriverVersionMajor"
+#define NVSDK_NGX_Parameter_ImageSuperResolution_MinDriverVersionMajor "ImageSuperResolution.MinDriverVersionMajor"
+#define NVSDK_NGX_Parameter_SlowMotion_MinDriverVersionMajor "SlowMotion.MinDriverVersionMajor"
+#define NVSDK_NGX_Parameter_VideoSuperResolution_MinDriverVersionMajor "VideoSuperResolution.MinDriverVersionMajor"
+#define NVSDK_NGX_Parameter_ImageSignalProcessing_MinDriverVersionMajor "ImageSignalProcessing.MinDriverVersionMajor"
+#define NVSDK_NGX_Parameter_DeepResolve_MinDriverVersionMajor "DeepResolve.MinDriverVersionMajor"
+#define NVSDK_NGX_Parameter_FrameInterpolation_MinDriverVersionMajor "FrameInterpolation.MinDriverVersionMajor"
+#define NVSDK_NGX_Parameter_SuperSampling_MinDriverVersionMinor "SuperSampling.MinDriverVersionMinor"
+#define NVSDK_NGX_Parameter_InPainting_MinDriverVersionMinor "InPainting.MinDriverVersionMinor"
+#define NVSDK_NGX_Parameter_ImageSuperResolution_MinDriverVersionMinor "ImageSuperResolution.MinDriverVersionMinor"
+#define NVSDK_NGX_Parameter_SlowMotion_MinDriverVersionMinor "SlowMotion.MinDriverVersionMinor"
+#define NVSDK_NGX_Parameter_VideoSuperResolution_MinDriverVersionMinor "VideoSuperResolution.MinDriverVersionMinor"
+#define NVSDK_NGX_Parameter_ImageSignalProcessing_MinDriverVersionMinor "ImageSignalProcessing.MinDriverVersionMinor"
+#define NVSDK_NGX_Parameter_DeepResolve_MinDriverVersionMinor "DeepResolve.MinDriverVersionMinor"
+#define NVSDK_NGX_Parameter_SuperSampling_FeatureInitResult "SuperSampling.FeatureInitResult"
+#define NVSDK_NGX_Parameter_InPainting_FeatureInitResult "InPainting.FeatureInitResult"
+#define NVSDK_NGX_Parameter_ImageSuperResolution_FeatureInitResult "ImageSuperResolution.FeatureInitResult"
+#define NVSDK_NGX_Parameter_SlowMotion_FeatureInitResult "SlowMotion.FeatureInitResult"
+#define NVSDK_NGX_Parameter_VideoSuperResolution_FeatureInitResult "VideoSuperResolution.FeatureInitResult"
+#define NVSDK_NGX_Parameter_ImageSignalProcessing_FeatureInitResult "ImageSignalProcessing.FeatureInitResult"
+#define NVSDK_NGX_Parameter_DeepResolve_FeatureInitResult "DeepResolve.FeatureInitResult"
+#define NVSDK_NGX_Parameter_FrameInterpolation_FeatureInitResult "FrameInterpolation.FeatureInitResult"
+#define NVSDK_NGX_Parameter_ImageSuperResolution_ScaleFactor_2_1 "ImageSuperResolution.ScaleFactor.2.1"
+#define NVSDK_NGX_Parameter_ImageSuperResolution_ScaleFactor_3_1 "ImageSuperResolution.ScaleFactor.3.1"
+#define NVSDK_NGX_Parameter_ImageSuperResolution_ScaleFactor_3_2 "ImageSuperResolution.ScaleFactor.3.2"
+#define NVSDK_NGX_Parameter_ImageSuperResolution_ScaleFactor_4_3 "ImageSuperResolution.ScaleFactor.4.3"
+#define NVSDK_NGX_Parameter_NumFrames "NumFrames"
+#define NVSDK_NGX_Parameter_Scale "Scale"
+#define NVSDK_NGX_Parameter_Width "Width"
+#define NVSDK_NGX_Parameter_Height "Height"
+#define NVSDK_NGX_Parameter_OutWidth "OutWidth"
+#define NVSDK_NGX_Parameter_OutHeight "OutHeight"
+#define NVSDK_NGX_Parameter_Sharpness "Sharpness"
+#define NVSDK_NGX_Parameter_Scratch "Scratch"
+#define NVSDK_NGX_Parameter_Scratch_SizeInBytes "Scratch.SizeInBytes"
+#define NVSDK_NGX_Parameter_Input1 "Input1"
+#define NVSDK_NGX_Parameter_Input1_Format "Input1.Format"
+#define NVSDK_NGX_Parameter_Input1_SizeInBytes "Input1.SizeInBytes"
+#define NVSDK_NGX_Parameter_Input2 "Input2"
+#define NVSDK_NGX_Parameter_Input2_Format "Input2.Format"
+#define NVSDK_NGX_Parameter_Input2_SizeInBytes "Input2.SizeInBytes"
+#define NVSDK_NGX_Parameter_Color "Color"
+#define NVSDK_NGX_Parameter_Color_Format "Color.Format"
+#define NVSDK_NGX_Parameter_Color_SizeInBytes "Color.SizeInBytes"
+#define NVSDK_NGX_Parameter_FI_Color1 "Color1"
+#define NVSDK_NGX_Parameter_FI_Color2 "Color2"
+#define NVSDK_NGX_Parameter_Albedo "Albedo"
+#define NVSDK_NGX_Parameter_Output "Output"
+#define NVSDK_NGX_Parameter_Output_Format "Output.Format"
+#define NVSDK_NGX_Parameter_Output_SizeInBytes "Output.SizeInBytes"
+#define NVSDK_NGX_Parameter_FI_Output1 "Output1"
+#define NVSDK_NGX_Parameter_FI_Output2 "Output2"
+#define NVSDK_NGX_Parameter_FI_Output3 "Output3"
+#define NVSDK_NGX_Parameter_Reset "Reset"
+#define NVSDK_NGX_Parameter_BlendFactor "BlendFactor"
+#define NVSDK_NGX_Parameter_MotionVectors "MotionVectors"
+#define NVSDK_NGX_Parameter_FI_MotionVectors1 "MotionVectors1"
+#define NVSDK_NGX_Parameter_FI_MotionVectors2 "MotionVectors2"
+#define NVSDK_NGX_Parameter_Rect_X "Rect.X"
+#define NVSDK_NGX_Parameter_Rect_Y "Rect.Y"
+#define NVSDK_NGX_Parameter_Rect_W "Rect.W"
+#define NVSDK_NGX_Parameter_Rect_H "Rect.H"
+#define NVSDK_NGX_Parameter_OutRect_X "OutRect.X"
+#define NVSDK_NGX_Parameter_OutRect_Y "OutRect.Y"
+#define NVSDK_NGX_Parameter_OutRect_W "OutRect.W"
+#define NVSDK_NGX_Parameter_OutRect_H "OutRect.H"
+#define NVSDK_NGX_Parameter_MV_Scale_X "MV.Scale.X"
+#define NVSDK_NGX_Parameter_MV_Scale_Y "MV.Scale.Y"
+#define NVSDK_NGX_Parameter_Model "Model"
+#define NVSDK_NGX_Parameter_Format "Format"
+#define NVSDK_NGX_Parameter_SizeInBytes "SizeInBytes"
+#define NVSDK_NGX_Parameter_ResourceAllocCallback "ResourceAllocCallback"
+#define NVSDK_NGX_Parameter_BufferAllocCallback "BufferAllocCallback"
+#define NVSDK_NGX_Parameter_Tex2DAllocCallback "Tex2DAllocCallback"
+#define NVSDK_NGX_Parameter_ResourceReleaseCallback "ResourceReleaseCallback"
+#define NVSDK_NGX_Parameter_CreationNodeMask "CreationNodeMask"
+#define NVSDK_NGX_Parameter_VisibilityNodeMask "VisibilityNodeMask"
+#define NVSDK_NGX_Parameter_MV_Offset_X "MV.Offset.X"
+#define NVSDK_NGX_Parameter_MV_Offset_Y "MV.Offset.Y"
+#define NVSDK_NGX_Parameter_Hint_UseFireflySwatter "Hint.UseFireflySwatter"
+#define NVSDK_NGX_Parameter_Resource_Width "ResourceWidth"
+#define NVSDK_NGX_Parameter_Resource_Height "ResourceHeight"
+#define NVSDK_NGX_Parameter_Resource_OutWidth "ResourceOutWidth"
+#define NVSDK_NGX_Parameter_Resource_OutHeight "ResourceOutHeight"
+#define NVSDK_NGX_Parameter_Depth "Depth"
+#define NVSDK_NGX_Parameter_FI_Depth1 "Depth1"
+#define NVSDK_NGX_Parameter_FI_Depth2 "Depth2"
+#define NVSDK_NGX_Parameter_DLSSOptimalSettingsCallback "DLSSOptimalSettingsCallback"
+#define NVSDK_NGX_Parameter_DLSSGetStatsCallback "DLSSGetStatsCallback"
+#define NVSDK_NGX_Parameter_PerfQualityValue "PerfQualityValue"
+#define NVSDK_NGX_Parameter_RTXValue "RTXValue"
+#define NVSDK_NGX_Parameter_DLSSMode "DLSSMode"
+#define NVSDK_NGX_Parameter_FI_Mode "FIMode"
+#define NVSDK_NGX_Parameter_FI_OF_Preset "FIOFPreset"
+#define NVSDK_NGX_Parameter_FI_OF_GridSize "FIOFGridSize"
+#define NVSDK_NGX_Parameter_Jitter_Offset_X "Jitter.Offset.X"
+#define NVSDK_NGX_Parameter_Jitter_Offset_Y "Jitter.Offset.Y"
+#define NVSDK_NGX_Parameter_Denoise "Denoise"
+#define NVSDK_NGX_Parameter_TransparencyMask "TransparencyMask"
+#define NVSDK_NGX_Parameter_ExposureTexture "ExposureTexture" // a 1x1 texture containing the final exposure scale
+#define NVSDK_NGX_Parameter_DLSS_Feature_Create_Flags "DLSS.Feature.Create.Flags"
+#define NVSDK_NGX_Parameter_DLSS_Checkerboard_Jitter_Hack "DLSS.Checkerboard.Jitter.Hack"
+#define NVSDK_NGX_Parameter_GBuffer_Normals "GBuffer.Normals"
+#define NVSDK_NGX_Parameter_GBuffer_Albedo "GBuffer.Albedo"
+#define NVSDK_NGX_Parameter_GBuffer_Roughness "GBuffer.Roughness"
+#define NVSDK_NGX_Parameter_GBuffer_DiffuseAlbedo "GBuffer.DiffuseAlbedo"
+#define NVSDK_NGX_Parameter_GBuffer_SpecularAlbedo "GBuffer.SpecularAlbedo"
+#define NVSDK_NGX_Parameter_GBuffer_IndirectAlbedo "GBuffer.IndirectAlbedo"
+#define NVSDK_NGX_Parameter_GBuffer_SpecularMvec "GBuffer.SpecularMvec"
+#define NVSDK_NGX_Parameter_GBuffer_DisocclusionMask "GBuffer.DisocclusionMask"
+#define NVSDK_NGX_Parameter_GBuffer_Metallic "GBuffer.Metallic"
+#define NVSDK_NGX_Parameter_GBuffer_Specular "GBuffer.Specular"
+#define NVSDK_NGX_Parameter_GBuffer_Subsurface "GBuffer.Subsurface"
+#define NVSDK_NGX_Parameter_GBuffer_ShadingModelId "GBuffer.ShadingModelId"
+#define NVSDK_NGX_Parameter_GBuffer_MaterialId "GBuffer.MaterialId"
+#define NVSDK_NGX_Parameter_GBuffer_Atrrib_8 "GBuffer.Attrib.8"
+#define NVSDK_NGX_Parameter_GBuffer_Atrrib_9 "GBuffer.Attrib.9"
+#define NVSDK_NGX_Parameter_GBuffer_Atrrib_10 "GBuffer.Attrib.10"
+#define NVSDK_NGX_Parameter_GBuffer_Atrrib_11 "GBuffer.Attrib.11"
+#define NVSDK_NGX_Parameter_GBuffer_Atrrib_12 "GBuffer.Attrib.12"
+#define NVSDK_NGX_Parameter_GBuffer_Atrrib_13 "GBuffer.Attrib.13"
+#define NVSDK_NGX_Parameter_GBuffer_Atrrib_14 "GBuffer.Attrib.14"
+#define NVSDK_NGX_Parameter_GBuffer_Atrrib_15 "GBuffer.Attrib.15"
+#define NVSDK_NGX_Parameter_TonemapperType "TonemapperType"
+#define NVSDK_NGX_Parameter_FreeMemOnReleaseFeature "FreeMemOnReleaseFeature"
+#define NVSDK_NGX_Parameter_MotionVectors3D "MotionVectors3D"
+#define NVSDK_NGX_Parameter_IsParticleMask "IsParticleMask"
+#define NVSDK_NGX_Parameter_AnimatedTextureMask "AnimatedTextureMask"
+#define NVSDK_NGX_Parameter_DepthHighRes "DepthHighRes"
+#define NVSDK_NGX_Parameter_Position_ViewSpace "Position.ViewSpace"
+#define NVSDK_NGX_Parameter_FrameTimeDeltaInMsec "FrameTimeDeltaInMsec"
+#define NVSDK_NGX_Parameter_RayTracingHitDistance "RayTracingHitDistance"
+#define NVSDK_NGX_Parameter_MotionVectorsReflection "MotionVectorsReflection"
+#define NVSDK_NGX_Parameter_DLSS_Enable_Output_Subrects "DLSS.Enable.Output.Subrects"
+#define NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_X "DLSS.Input.Color.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_Y "DLSS.Input.Color.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_X "DLSS.Input.Depth.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_Y "DLSS.Input.Depth.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_X "DLSS.Input.MV.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_Y "DLSS.Input.MV.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_X "DLSS.Input.Translucency.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_Y "DLSS.Input.Translucency.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_X "DLSS.Output.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_Y "DLSS.Output.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Width "DLSS.Render.Subrect.Dimensions.Width"
+#define NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Height "DLSS.Render.Subrect.Dimensions.Height"
+#define NVSDK_NGX_Parameter_DLSS_Pre_Exposure "DLSS.Pre.Exposure"
+#define NVSDK_NGX_Parameter_DLSS_Exposure_Scale "DLSS.Exposure.Scale"
+#define NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_Mask "DLSS.Input.Bias.Current.Color.Mask"
+#define NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_X "DLSS.Input.Bias.Current.Color.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_Y "DLSS.Input.Bias.Current.Color.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSS_Indicator_Invert_Y_Axis "DLSS.Indicator.Invert.Y.Axis"
+#define NVSDK_NGX_Parameter_DLSS_Indicator_Invert_X_Axis "DLSS.Indicator.Invert.X.Axis"
+#define NVSDK_NGX_Parameter_DLSS_Overlay_Debug_Layer "DLSS.Overlay.Debug.Layer"
+#define NVSDK_NGX_Parameter_DLSS_Overlay_Full_Screen "DLSS.Overlay.Full.Screen"
+#define NVSDK_NGX_Parameter_DLSS_Overlay_Show_Nans "DLSS.Overlay.Show.Nans"
+#define NVSDK_NGX_Parameter_DLSS_Overlay_Jitter_Debug "DLSS.Overlay.Jitter.Debug"
+#define NVSDK_NGX_Parameter_DLSS_INV_VIEW_PROJECTION_MATRIX "InvViewProjectionMatrix"
+#define NVSDK_NGX_Parameter_DLSS_CLIP_TO_PREV_CLIP_MATRIX "ClipToPrevClipMatrix"
+
+#define NVSDK_NGX_Parameter_DLSS_TransparencyLayer "DLSS.TransparencyLayer"
+#define NVSDK_NGX_Parameter_DLSS_TransparencyLayer_Subrect_Base_X "DLSS.TransparencyLayer.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSS_TransparencyLayer_Subrect_Base_Y "DLSS.TransparencyLayer.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSS_TransparencyLayerOpacity "DLSS.TransparencyLayerOpacity"
+#define NVSDK_NGX_Parameter_DLSS_TransparencyLayerOpacity_Subrect_Base_X "DLSS.TransparencyLayerOpacity.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSS_TransparencyLayerOpacity_Subrect_Base_Y "DLSS.TransparencyLayerOpacity.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSS_TransparencyLayerMvecs "DLSS.TransparencyLayerMvecs"
+#define NVSDK_NGX_Parameter_DLSS_TransparencyLayerMvecs_Subrect_Base_X "DLSS.TransparencyLayerMvecs.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSS_TransparencyLayerMvecs_Subrect_Base_Y "DLSS.TransparencyLayerMvecs.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSS_DisocclusionMask "DLSS.DisocclusionMask"
+#define NVSDK_NGX_Parameter_DLSS_DisocclusionMask_Subrect_Base_X "DLSS.DisocclusionMask.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSS_DisocclusionMask_Subrect_Base_Y "DLSS.DisocclusionMask.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSS_ResponsivityMask "DLSS.ResponsivityMask"
+#define NVSDK_NGX_Parameter_DLSS_ResponsivityMask_Subrect_Base_X "DLSS.ResponsivityMask.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSS_ResponsivityMask_Subrect_Base_Y "DLSS.ResponsivityMask.Subrect.Base.Y"
+
+#define NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Max_Render_Width "DLSS.Get.Dynamic.Max.Render.Width"
+#define NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Max_Render_Height "DLSS.Get.Dynamic.Max.Render.Height"
+#define NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Width "DLSS.Get.Dynamic.Min.Render.Width"
+#define NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Height "DLSS.Get.Dynamic.Min.Render.Height"
+
+#define NVSDK_NGX_Parameter_DLSS_Hint_Render_Preset_DLAA "DLSS.Hint.Render.Preset.DLAA"
+#define NVSDK_NGX_Parameter_DLSS_Hint_Render_Preset_Quality "DLSS.Hint.Render.Preset.Quality"
+#define NVSDK_NGX_Parameter_DLSS_Hint_Render_Preset_Balanced "DLSS.Hint.Render.Preset.Balanced"
+#define NVSDK_NGX_Parameter_DLSS_Hint_Render_Preset_Performance "DLSS.Hint.Render.Preset.Performance"
+#define NVSDK_NGX_Parameter_DLSS_Hint_Render_Preset_UltraPerformance "DLSS.Hint.Render.Preset.UltraPerformance"
+#define NVSDK_NGX_Parameter_DLSS_Hint_Render_Preset_UltraQuality "DLSS.Hint.Render.Preset.UltraQuality"
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif
diff --git a/native/NVIDIA-DLSS/include/nvsdk_ngx_defs_dlssd.h b/native/NVIDIA-DLSS/include/nvsdk_ngx_defs_dlssd.h
new file mode 100644
index 0000000..d057599
--- /dev/null
+++ b/native/NVIDIA-DLSS/include/nvsdk_ngx_defs_dlssd.h
@@ -0,0 +1,166 @@
+/*
+ * SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
+ *
+ * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
+ * property and proprietary rights in and to this material, related
+ * documentation and any modifications thereto. Any use, reproduction,
+ * disclosure or distribution of this material and related documentation
+ * without an express license agreement from NVIDIA CORPORATION or
+ * its affiliates is strictly prohibited.
+ */
+
+#ifndef NVSDK_NGX_DEFS_DLSSD_H
+#define NVSDK_NGX_DEFS_DLSSD_H
+#pragma once
+
+typedef enum NVSDK_NGX_DLSS_Denoise_Mode
+{
+ NVSDK_NGX_DLSS_Denoise_Mode_Off = 0,
+ NVSDK_NGX_DLSS_Denoise_Mode_DLUnified = 1, // DL based unified upscaler
+} NVSDK_NGX_DLSS_Denoise_Mode;
+
+typedef enum NVSDK_NGX_DLSS_Roughness_Mode
+{
+ NVSDK_NGX_DLSS_Roughness_Mode_Unpacked = 0, // Read roughness separately
+ NVSDK_NGX_DLSS_Roughness_Mode_Packed = 1, // Read roughness from normals.w
+} NVSDK_NGX_DLSS_Roughness_Mode;
+
+typedef enum NVSDK_NGX_DLSS_Depth_Type
+{
+ NVSDK_NGX_DLSS_Depth_Type_Linear = 0, // Linear Depth
+ NVSDK_NGX_DLSS_Depth_Type_HW = 1, // HW Depth
+} NVSDK_NGX_DLSS_Depth_Type;
+
+
+typedef enum NVSDK_NGX_RayReconstruction_Hint_Render_Preset
+{
+ NVSDK_NGX_RayReconstruction_Hint_Render_Preset_Default = 0, // default behavior, may or may not change after OTA
+ // NVSDK_NGX_RayReconstruction_Hint_Render_Preset_A removed, use preset D or E
+ // NVSDK_NGX_RayReconstruction_Hint_Render_Preset_B removed, use preset D or E
+ // NVSDK_NGX_RayReconstruction_Hint_Render_Preset_C removed, use preset D or E
+ NVSDK_NGX_RayReconstruction_Hint_Render_Preset_D = 4, // Default model (transformer)
+ NVSDK_NGX_RayReconstruction_Hint_Render_Preset_E = 5, // Latest transformer model (must use if DoF guide is needed)
+ NVSDK_NGX_RayReconstruction_Hint_Render_Preset_F = 6, // Do not use. reverts to default behavior
+ NVSDK_NGX_RayReconstruction_Hint_Render_Preset_G = 7, // Do not use, reverts to default behavior
+ NVSDK_NGX_RayReconstruction_Hint_Render_Preset_H = 8, // Do not use, reverts to default behavior
+ NVSDK_NGX_RayReconstruction_Hint_Render_Preset_I = 9, // Do not use, reverts to default behavior
+ NVSDK_NGX_RayReconstruction_Hint_Render_Preset_J = 10, // Do not use, reverts to default behavior
+ NVSDK_NGX_RayReconstruction_Hint_Render_Preset_K = 11, // Do not use, reverts to default behavior
+ NVSDK_NGX_RayReconstruction_Hint_Render_Preset_L = 12, // Do not use, reverts to default behavior
+ NVSDK_NGX_RayReconstruction_Hint_Render_Preset_M = 13, // Do not use, reverts to default behavior
+ NVSDK_NGX_RayReconstruction_Hint_Render_Preset_N = 14, // Do not use, reverts to default behavior
+ NVSDK_NGX_RayReconstruction_Hint_Render_Preset_O = 15, // Do not use, reverts to default behavior
+} NVSDK_NGX_RayReconstruction_Hint_Render_Preset;
+
+#define NVSDK_NGX_Parameter_DLSS_Denoise_Mode "DLSS.Denoise.Mode"
+#define NVSDK_NGX_Parameter_DLSS_Roughness_Mode "DLSS.Roughness.Mode"
+#define NVSDK_NGX_Parameter_DiffuseAlbedo "DLSS.Input.DiffuseAlbedo"
+#define NVSDK_NGX_Parameter_SpecularAlbedo "DLSS.Input.SpecularAlbedo"
+#define NVSDK_NGX_Parameter_DLSS_Input_DiffuseAlbedo_Subrect_Base_X "DLSS.Input.DiffuseAlbedo.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSS_Input_DiffuseAlbedo_Subrect_Base_Y "DLSS.Input.DiffuseAlbedo.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSS_Input_SpecularAlbedo_Subrect_Base_X "DLSS.Input.SpecularAlbedo.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSS_Input_SpecularAlbedo_Subrect_Base_Y "DLSS.Input.SpecularAlbedo.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSS_Input_Normals_Subrect_Base_X "DLSS.Input.Normals.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSS_Input_Normals_Subrect_Base_Y "DLSS.Input.Normals.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSS_Input_Roughness_Subrect_Base_X "DLSS.Input.Roughness.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSS_Input_Roughness_Subrect_Base_Y "DLSS.Input.Roughness.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_ViewToClipMatrix "ViewToClipMatrix"
+#define NVSDK_NGX_Parameter_GBuffer_Emissive "GBuffer.Emissive"
+#define NVSDK_NGX_Parameter_Use_Folded_Network "DLSS.Use.Folded.Network"
+#define NVSDK_NGX_Parameter_Diffuse_Ray_Direction "Diffuse.Ray.Direction"
+#define NVSDK_NGX_Parameter_DLSS_WORLD_TO_VIEW_MATRIX "WorldToViewMatrix"
+#define NVSDK_NGX_Parameter_DLSS_VIEW_TO_CLIP_MATRIX "ViewToClipMatrix"
+#define NVSDK_NGX_Parameter_Use_HW_Depth "DLSS.Use.HW.Depth"
+#define NVSDK_NGX_Parameter_DLSSD_ReflectedAlbedo "DLSSD.ReflectedAlbedo"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeParticles "DLSSD.ColorBeforeParticles"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterParticles "DLSSD.ColorAfterParticles"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeTransparency "DLSSD.ColorBeforeTransparency"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterTransparency "DLSSD.ColorAfterTransparency"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeFog "DLSSD.ColorBeforeFog"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterFog "DLSSD.ColorAfterFog"
+#define NVSDK_NGX_Parameter_DLSSD_ScreenSpaceSubsurfaceScatteringGuide "DLSSD.ScreenSpaceSubsurfaceScatteringGuide"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceSubsurfaceScattering "DLSSD.ColorBeforeScreenSpaceSubsurfaceScattering"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceSubsurfaceScattering "DLSSD.ColorAfterScreenSpaceSubsurfaceScattering"
+#define NVSDK_NGX_Parameter_DLSSD_ScreenSpaceRefractionGuide "DLSSD.ScreenSpaceRefractionGuide"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceRefraction "DLSSD.ColorBeforeScreenSpaceRefraction"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceRefraction "DLSSD.ColorAfterScreenSpaceRefraction"
+#define NVSDK_NGX_Parameter_DLSSD_DepthOfFieldGuide "DLSSD.DepthOfFieldGuide"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeDepthOfField "DLSSD.ColorBeforeDepthOfField"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterDepthOfField "DLSSD.ColorAfterDepthOfField"
+#define NVSDK_NGX_Parameter_DLSSD_DiffuseHitDistance "DLSSD.DiffuseHitDistance"
+#define NVSDK_NGX_Parameter_DLSSD_SpecularHitDistance "DLSSD.SpecularHitDistance"
+#define NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirection "DLSSD.DiffuseRayDirection"
+#define NVSDK_NGX_Parameter_DLSSD_SpecularRayDirection "DLSSD.SpecularRayDirection"
+#define NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirectionHitDistance "DLSSD.DiffuseRayDirectionHitDistance"
+#define NVSDK_NGX_Parameter_DLSSD_SpecularRayDirectionHitDistance "DLSSD.SpecularRayDirectionHitDistance"
+#define NVSDK_NGX_Parameter_DLSSD_Alpha "DLSSD.Alpha"
+#define NVSDK_NGX_Parameter_DLSSD_OutputAlpha "DLSSD.OutputAlpha"
+#define NVSDK_NGX_Parameter_DLSSD_ResponsivityMask "DLSSD.ResponsivityMask"
+#define NVSDK_NGX_Parameter_DLSSD_Alpha_Subrect_Base_X "DLSSD.Alpha.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_Alpha_Subrect_Base_Y "DLSSD.Alpha.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_OutputAlpha_Subrect_Base_X "DLSSD.OutputAlpha.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_OutputAlpha_Subrect_Base_Y "DLSSD.OutputAlpha.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_ReflectedAlbedo_Subrect_Base_X "DLSSD.ReflectedAlbedo.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_ReflectedAlbedo_Subrect_Base_Y "DLSSD.ReflectedAlbedo.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeParticles_Subrect_Base_X "DLSSD.ColorBeforeParticles.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeParticles_Subrect_Base_Y "DLSSD.ColorBeforeParticles.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterParticles_Subrect_Base_X "DLSSD.ColorAfterParticles.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterParticles_Subrect_Base_Y "DLSSD.ColorAfterParticles.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeTransparency_Subrect_Base_X "DLSSD.ColorBeforeTransparency.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeTransparency_Subrect_Base_Y "DLSSD.ColorBeforeTransparency.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterTransparency_Subrect_Base_X "DLSSD.ColorAfterTransparency.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterTransparency_Subrect_Base_Y "DLSSD.ColorAfterTransparency.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeFog_Subrect_Base_X "DLSSD.ColorBeforeFog.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeFog_Subrect_Base_Y "DLSSD.ColorBeforeFog.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterFog_Subrect_Base_X "DLSSD.ColorAfterFog.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterFog_Subrect_Base_Y "DLSSD.ColorAfterFog.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_ScreenSpaceSubsurfaceScatteringGuide_Subrect_Base_X "DLSSD.ScreenSpaceSubsurfaceScatteringGuide.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_ScreenSpaceSubsurfaceScatteringGuide_Subrect_Base_Y "DLSSD.ScreenSpaceSubsurfaceScatteringGuide.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceSubsurfaceScattering_Subrect_Base_X "DLSSD.ColorBeforeScreenSpaceSubsurfaceScattering.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceSubsurfaceScattering_Subrect_Base_Y "DLSSD.ColorBeforeScreenSpaceSubsurfaceScattering.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceSubsurfaceScattering_Subrect_Base_X "DLSSD.ColorAfterScreenSpaceSubsurfaceScattering.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceSubsurfaceScattering_Subrect_Base_Y "DLSSD.ColorAfterScreenSpaceSubsurfaceScattering.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_ScreenSpaceRefractionGuide_Subrect_Base_X "DLSSD.ScreenSpaceRefractionGuide.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_ScreenSpaceRefractionGuide_Subrect_Base_Y "DLSSD.ScreenSpaceRefractionGuide.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceRefraction_Subrect_Base_X "DLSSD.ColorBeforeScreenSpaceRefraction.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceRefraction_Subrect_Base_Y "DLSSD.ColorBeforeScreenSpaceRefraction.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceRefraction_Subrect_Base_X "DLSSD.ColorAfterScreenSpaceRefraction.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceRefraction_Subrect_Base_Y "DLSSD.ColorAfterScreenSpaceRefraction.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_DepthOfFieldGuide_Subrect_Base_X "DLSSD.DepthOfFieldGuide.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_DepthOfFieldGuide_Subrect_Base_Y "DLSSD.DepthOfFieldGuide.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeDepthOfField_Subrect_Base_X "DLSSD.ColorBeforeDepthOfField.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_ColorBeforeDepthOfField_Subrect_Base_Y "DLSSD.ColorBeforeDepthOfField.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterDepthOfField_Subrect_Base_X "DLSSD.ColorAfterDepthOfField.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_ColorAfterDepthOfField_Subrect_Base_Y "DLSSD.ColorAfterDepthOfField.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_DiffuseHitDistance_Subrect_Base_X "DLSSD.DiffuseHitDistance.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_DiffuseHitDistance_Subrect_Base_Y "DLSSD.DiffuseHitDistance.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_SpecularHitDistance_Subrect_Base_X "DLSSD.SpecularHitDistance.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_SpecularHitDistance_Subrect_Base_Y "DLSSD.SpecularHitDistance.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirection_Subrect_Base_X "DLSSD.DiffuseRayDirection.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirection_Subrect_Base_Y "DLSSD.DiffuseRayDirection.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_SpecularRayDirection_Subrect_Base_X "DLSSD.SpecularRayDirection.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_SpecularRayDirection_Subrect_Base_Y "DLSSD.SpecularRayDirection.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirectionHitDistance_Subrect_Base_X "DLSSD.DiffuseRayDirectionHitDistance.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirectionHitDistance_Subrect_Base_Y "DLSSD.DiffuseRayDirectionHitDistance.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_SpecularRayDirectionHitDistance_Subrect_Base_X "DLSSD.SpecularRayDirectionHitDistance.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_SpecularRayDirectionHitDistance_Subrect_Base_Y "DLSSD.SpecularRayDirectionHitDistance.Subrect.Base.Y"
+#define NVSDK_NGX_Parameter_DLSSD_ResponsivityMask_Subrect_Base_X "DLSSD.ResponsivityMask.Subrect.Base.X"
+#define NVSDK_NGX_Parameter_DLSSD_ResponsivityMask_Subrect_Base_Y "DLSSD.ResponsivityMask.Subrect.Base.Y"
+
+#define NVSDK_NGX_Parameter_SuperSamplingDenoising_Available "SuperSamplingDenoising.Available"
+#define NVSDK_NGX_Parameter_SuperSamplingDenoising_NeedsUpdatedDriver "SuperSamplingDenoising.NeedsUpdatedDriver"
+#define NVSDK_NGX_Parameter_SuperSamplingDenoising_MinDriverVersionMajor "SuperSamplingDenoising.MinDriverVersionMajor"
+#define NVSDK_NGX_Parameter_SuperSamplingDenoising_MinDriverVersionMinor "SuperSamplingDenoising.MinDriverVersionMinor"
+#define NVSDK_NGX_Parameter_SuperSamplingDenoising_FeatureInitResult "SuperSamplingDenoising.FeatureInitResult"
+#define NVSDK_NGX_Parameter_DLSSDOptimalSettingsCallback "DLSSDOptimalSettingsCallback"
+#define NVSDK_NGX_Parameter_DLSSDGetStatsCallback "DLSSDGetStatsCallback"
+
+#define NVSDK_NGX_Parameter_RayReconstruction_Hint_Render_Preset_DLAA "RayReconstruction.Hint.Render.Preset.DLAA"
+#define NVSDK_NGX_Parameter_RayReconstruction_Hint_Render_Preset_Quality "RayReconstruction.Hint.Render.Preset.Quality"
+#define NVSDK_NGX_Parameter_RayReconstruction_Hint_Render_Preset_Balanced "RayReconstruction.Hint.Render.Preset.Balanced"
+#define NVSDK_NGX_Parameter_RayReconstruction_Hint_Render_Preset_Performance "RayReconstruction.Hint.Render.Preset.Performance"
+#define NVSDK_NGX_Parameter_RayReconstruction_Hint_Render_Preset_UltraPerformance "RayReconstruction.Hint.Render.Preset.UltraPerformance"
+#define NVSDK_NGX_Parameter_RayReconstruction_Hint_Render_Preset_UltraQuality "RayReconstruction.Hint.Render.Preset.UltraQuality"
+
+#endif // NVSDK_NGX_DEFS_DLSSD_H
diff --git a/native/NVIDIA-DLSS/include/nvsdk_ngx_defs_dlssg.h b/native/NVIDIA-DLSS/include/nvsdk_ngx_defs_dlssg.h
new file mode 100644
index 0000000..883422b
--- /dev/null
+++ b/native/NVIDIA-DLSS/include/nvsdk_ngx_defs_dlssg.h
@@ -0,0 +1,376 @@
+#pragma once
+/*
+* Copyright (c) 2021-2024 NVIDIA CORPORATION. All rights reserved.
+*
+* NVIDIA Corporation and its licensors retain all intellectual property and proprietary
+* rights in and to this software, related documentation and any modifications thereto.
+* Any use, reproduction, disclosure or distribution of this software and related
+* documentation without an express license agreement from NVIDIA Corporation is strictly
+* prohibited.
+*
+* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
+* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
+* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
+* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
+* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
+* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
+* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+* SUCH DAMAGES.
+*/
+
+
+#ifndef NVSDK_NGX_DEFS_DLSSG_H
+#define NVSDK_NGX_DEFS_DLSSG_H
+
+#include <stddef.h> // for size_t
+#include <stdint.h> // for uint64_t
+
+#include "nvsdk_ngx_defs.h"
+#include "nvsdk_ngx_params.h"
+
+typedef enum NVSDK_NGX_DLSSG_ResourceFlags
+{
+ NVSDK_NGX_DLSSG_ResourceFlags_Backbuffer = 1 << 0,
+ NVSDK_NGX_DLSSG_ResourceFlags_MVecs = 1 << 1,
+ NVSDK_NGX_DLSSG_ResourceFlags_Depth = 1 << 2,
+ NVSDK_NGX_DLSSG_ResourceFlags_HUDLess = 1 << 3,
+ NVSDK_NGX_DLSSG_ResourceFlags_UI = 1 << 4,
+ NVSDK_NGX_DLSSG_ResourceFlags_BidirectionalDistortionField = 1 << 5,
+ NVSDK_NGX_DLSSG_ResourceFlags_Reserved6 = 1 << 6,
+ NVSDK_NGX_DLSSG_ResourceFlags_UIAlpha = 1 << 7,
+
+ NVSDK_NGX_DLSSG_ResourceFlags_OutputInterpolated = 1 << 24,
+ NVSDK_NGX_DLSSG_ResourceFlags_OutputReal = 1 << 25,
+ NVSDK_NGX_DLSSG_ResourceFlags_OutputDisableInterpolation = 1 << 26,
+} NVSDK_NGX_DLSSG_ResourceFlags;
+
+#define NVSDK_NGX_Parameter_FrameGeneration_Available "FrameGeneration.Available"
+#define NVSDK_NGX_Parameter_FrameGeneration_FeatureInitResult "FrameGeneration.FeatureInitResult"
+#define NVSDK_NGX_Parameter_FrameGeneration_MinDriverVersionMajor "FrameGeneration.MinDriverVersionMajor"
+#define NVSDK_NGX_Parameter_FrameGeneration_MinDriverVersionMinor "FrameGeneration.MinDriverVersionMinor"
+#define NVSDK_NGX_Parameter_FrameGeneration_NeedsUpdatedDriver "FrameGeneration.NeedsUpdatedDriver"
+
+#define NVSDK_NGX_Parameter_FrameInterpolation_Available "FrameInterpolation.Available"
+#define NVSDK_NGX_Parameter_FrameInterpolation_FeatureInitResult "FrameInterpolation.FeatureInitResult"
+#define NVSDK_NGX_Parameter_FrameInterpolation_MinDriverVersionMajor "FrameInterpolation.MinDriverVersionMajor"
+#define NVSDK_NGX_Parameter_FrameInterpolation_MinDriverVersionMinor "FrameInterpolation.MinDriverVersionMinor"
+#define NVSDK_NGX_Parameter_FrameInterpolation_NeedsUpdatedDriver "FrameInterpolation.NeedsUpdatedDriver"
+
+#define NVSDK_NGX_DLSSG_Parameter_BackbufferFormat "DLSSG.BackbufferFormat"
+
+// Required Input Textures
+
+#define NVSDK_NGX_DLSSG_Parameter_Backbuffer "DLSSG.Backbuffer"
+#define NVSDK_NGX_DLSSG_Parameter_MVecs "DLSSG.MVecs"
+#define NVSDK_NGX_DLSSG_Parameter_Depth "DLSSG.Depth"
+
+// Optional Input Textures to improve Image Quality (strongly suggested)
+
+// NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionField: Resource describing post-processing distortion effects,
+// such as lens distortion, that have been applied to the final color. If you use this type of effect, the final
+// color is no longer aligned with the input depth, motion vectors, and camera information.
+// The bidirectional distortion field serves as a mapping between the pixels in the distorted color texture
+// and the undistorted guide buffers.
+#define NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionField "DLSSG.BidirectionalDistortionField"
+// NVSDK_NGX_DLSSG_Parameter_HUDLess: Contains the scene color before any UI or HUD elements
+// are drawn. Its content for non-UI pixels should be identical to the backbuffer.
+#define NVSDK_NGX_DLSSG_Parameter_HUDLess "DLSSG.HUDLess"
+// NVSDK_NGX_DLSSG_Parameter_UI: A four-channel resource containing the color and opacity/alpha of the UI.
+// The color should be pre-multiplied by the alpha value, such that for each pixel:
+// backbuffer_color = ui_color + (1 - ui_alpha) * hudless_scene_color
+#define NVSDK_NGX_DLSSG_Parameter_UI "DLSSG.UI"
+// NVSDK_NGX_DLSSG_Parameter_UIAlpha: A single channel resource of only the alpha UI values, between 0.0f and 1.0f.
+#define NVSDK_NGX_DLSSG_Parameter_UIAlpha "DLSSG.UIAlpha"
+// Note: Only one of NVSDK_NGX_DLSSG_Parameter_UIAlpha or NVSDK_NGX_DLSSG_Parameter_UI need to be provided.
+// For User Interface Recomposition (UIR) frame generation, both HUDless and one of UI or UIAlpha must be provided.
+// Additionally set the NVSDK_NGX_DLSSG_Parameter_UserInterfaceRecompositionEnabled parameter to trigger
+// the create time decisions required for this UIR mode. See that parameter description for more information.
+
+// Required Output Texture (same texture format as Backbuffer)
+#define NVSDK_NGX_DLSSG_Parameter_OutputInterpolated "DLSSG.OutputInterpolated"
+// Optional Output Texture (gives FG the opportunity to render text or debug info onto the real frame)
+#define NVSDK_NGX_DLSSG_Parameter_OutputReal "DLSSG.OutputReal"
+
+// Legacy names for the output interpolated and real frames. Use the equivalent parameters
+// NVSDK_NGX_DLSSG_Parameter_OutputInterpolated and NVSDK_NGX_DLSSG_Parameter_OutputReal
+// instead.
+#define NVSDK_NGX_Parameter_OutputInterpolated "DLSSG.OutputInterpolated"
+#define NVSDK_NGX_Parameter_OutputReal "DLSSG.OutputReal"
+
+// Create-time resource flag bitmasks (see NVSDK_NGX_DLSSG_ResourceFlags)
+// denoting resources that the application will always/never provide for the
+// lifetime of the feature instance. Setting these values may enable memory
+// optimizations to reduce VRAM. Resources not specified in either mask remain
+// optional, and may be provided on some frames, but not others. Resources
+// required by the algorithm (backbuffer, mvecs, depth, and output) are assumed
+// to be set in AlwaysProvidedFlags and unset in NeverProvidedFlags, regardless
+// of the actual values
+#define NVSDK_NGX_DLSSG_Parameter_ResourceAlwaysProvided_Flags "DLSSG.ResourceAlwaysProvidedFlags"
+#define NVSDK_NGX_DLSSG_Parameter_ResourceNeverProvided_Flags "DLSSG.ResourceNeverProvidedFlags"
+
+// DLFG-specific width/height parameters, to avoid name conflicts with other
+// features. If set in CreateFeature, these parameters will be used instead of
+// the generic NVSDK_NGX_Parameter{Width,Height}
+#define NVSDK_NGX_DLSSG_Parameter_Width "DLSSG.Width"
+#define NVSDK_NGX_DLSSG_Parameter_Height "DLSSG.Height"
+
+// Output resource which allows the snippet to hint to the host application that
+// the interpolated frame(s) should not be shown this frame. This resource must
+// be created by the application with a minimum size of 4 bytes, and will be filled
+// by the snippet: if interpolation should be disabled for this frame, boolean true
+// will be written to the first byte of the buffer.
+#define NVSDK_NGX_DLSSG_Parameter_OutputDisableInterpolation "DLSSG.OutputDisableInterpolation"
+
+// IMPORTANT: All matrices should NOT contain temporal AA jitter offset
+// Specifies matrix transformation from the camera view to the clip space.
+// Float4x4 as void*
+#define NVSDK_NGX_DLSSG_Parameter_CameraViewToClip "DLSSG.CameraViewToClip"
+// Float4x4 as void*
+#define NVSDK_NGX_DLSSG_Parameter_ClipToCameraView "DLSSG.ClipToCameraView"
+// Float4x4 as void*
+#define NVSDK_NGX_DLSSG_Parameter_ClipToLensClip "DLSSG.ClipToLensClip"
+// Float4x4 as void*
+#define NVSDK_NGX_DLSSG_Parameter_ClipToPrevClip "DLSSG.ClipToPrevClip"
+// Float4x4 as void*
+#define NVSDK_NGX_DLSSG_Parameter_PrevClipToClip "DLSSG.PrevClipToClip"
+
+// Specifies clip space jitter offset
+#define NVSDK_NGX_DLSSG_Parameter_JitterOffsetX "DLSSG.JitterOffsetX"
+#define NVSDK_NGX_DLSSG_Parameter_JitterOffsetY "DLSSG.JitterOffsetY"
+
+// Specifies scale factors used to normalize motion vectors (so the values are in [-1,1] range)
+#define NVSDK_NGX_DLSSG_Parameter_MvecScaleX "DLSSG.MvecScaleX"
+#define NVSDK_NGX_DLSSG_Parameter_MvecScaleY "DLSSG.MvecScaleY"
+
+// Specifies camera pinhole offset.
+#define NVSDK_NGX_DLSSG_Parameter_CameraPinholeOffsetX "DLSSG.CameraPinholeOffsetX"
+#define NVSDK_NGX_DLSSG_Parameter_CameraPinholeOffsetY "DLSSG.CameraPinholeOffsetY"
+
+// Specifies camera position in world space.
+#define NVSDK_NGX_DLSSG_Parameter_CameraPosX "DLSSG.CameraPosX"
+#define NVSDK_NGX_DLSSG_Parameter_CameraPosY "DLSSG.CameraPosY"
+#define NVSDK_NGX_DLSSG_Parameter_CameraPosZ "DLSSG.CameraPosZ"
+
+// Specifies camera up vector in world space.
+#define NVSDK_NGX_DLSSG_Parameter_CameraUpX "DLSSG.CameraUpX"
+#define NVSDK_NGX_DLSSG_Parameter_CameraUpY "DLSSG.CameraUpY"
+#define NVSDK_NGX_DLSSG_Parameter_CameraUpZ "DLSSG.CameraUpZ"
+
+// Specifies camera right vector in world space.
+#define NVSDK_NGX_DLSSG_Parameter_CameraRightX "DLSSG.CameraRightX"
+#define NVSDK_NGX_DLSSG_Parameter_CameraRightY "DLSSG.CameraRightY"
+#define NVSDK_NGX_DLSSG_Parameter_CameraRightZ "DLSSG.CameraRightZ"
+
+// Specifies camera forward vector in world space.
+#define NVSDK_NGX_DLSSG_Parameter_CameraFwdX "DLSSG.CameraFwdX"
+#define NVSDK_NGX_DLSSG_Parameter_CameraFwdY "DLSSG.CameraFwdY"
+#define NVSDK_NGX_DLSSG_Parameter_CameraFwdZ "DLSSG.CameraFwdZ"
+
+// Specifies camera near view plane distance.
+#define NVSDK_NGX_DLSSG_Parameter_CameraNear "DLSSG.CameraNear"
+
+// Specifies camera far view plane distance.
+#define NVSDK_NGX_DLSSG_Parameter_CameraFar "DLSSG.CameraFar"
+
+// Specifies camera field of view in radians.
+#define NVSDK_NGX_DLSSG_Parameter_CameraFOV "DLSSG.CameraFOV"
+
+// Specifies camera aspect ratio defined as view space width divided by height.
+#define NVSDK_NGX_DLSSG_Parameter_CameraAspectRatio "DLSSG.CameraAspectRatio"
+
+// Specifies if tagged color buffers are full HDR (rendering to an HDR monitor) or not
+#define NVSDK_NGX_DLSSG_Parameter_ColorBuffersHDR "DLSSG.ColorBuffersHDR"
+
+// Specifies if depth values are inverted (value closer to the camera is higher) or not.
+#define NVSDK_NGX_DLSSG_Parameter_DepthInverted "DLSSG.DepthInverted"
+
+// Specifies if camera motion is included in the MVec buffer.
+#define NVSDK_NGX_DLSSG_Parameter_CameraMotionIncluded "DLSSG.CameraMotionIncluded"
+
+// Specifies if motion vectors include jitter data.
+
+// Specifies if previous frame has no connection to the current one (motion vectors are invalid)
+#define NVSDK_NGX_DLSSG_Parameter_Reset "DLSSG.Reset"
+
+// Specifies if Automode overrode the input Reset flag to true.
+#define NVSDK_NGX_DLSSG_Parameter_AutomodeOverrideReset "DLSSG.AutomodeOverrideReset"
+
+// Specifies if application is not currently rendering game frames (paused in menu, playing video cut-scenes)
+#define NVSDK_NGX_DLSSG_Parameter_NotRenderingGameFrames "DLSSG.NotRenderingGameFrames"
+
+// Specifies if orthographic projection is used or not.
+#define NVSDK_NGX_DLSSG_Parameter_OrthoProjection "DLSSG.OrthoProjection"
+
+#define NVSDK_NGX_Parameter_DLSSGGetCurrentSettingsCallback "DLSSG.GetCurrentSettingsCallback"
+#define NVSDK_NGX_Parameter_DLSSGEstimateVRAMCallback "DLSSG.EstimateVRAMCallback"
+
+#define NVSDK_NGX_Parameter_DLSSGMustCallEval "DLSSG.MustCallEval"
+#define NVSDK_NGX_Parameter_DLSSGBurstCaptureRunning "DLSSG.BurstCaptureRunning"
+
+#define NVSDK_NGX_Parameter_DLSSGInvertXAxis "DLSSG.InvertXAxis"
+#define NVSDK_NGX_Parameter_DLSSGInvertYAxis "DLSSG.InvertYAxis"
+
+#define NVSDK_NGX_DLSSG_Parameter_UserDebugText "DLSSG.UserDebugText"
+
+#define NVSDK_NGX_DLSSG_Parameter_MvecInvalidValue "DLSSG.MvecInvalidValue"
+#define NVSDK_NGX_DLSSG_Parameter_MvecDilated "DLSSG.MvecDilated"
+#define NVSDK_NGX_DLSSG_Parameter_MvecJittered "DLSSG.MvecJittered"
+
+#define NVSDK_NGX_DLSSG_Parameter_MenuDetectionEnabled "DLSSG.MenuDetectionEnabled"
+
+// If true, allow the snippet to create internal resources on a separate thread, to avoid hitches during feature creation (default false)
+#define NVSDK_NGX_DLSSG_Parameter_AsyncCreateEnabled "DLSSG.AsyncCreateEnabled"
+
+// The DLSS Frame Generation algorithm processes all depth in a "linearized" depth space using the below formulation.
+//
+// if NVSDK_NGX_DLSSG_Parameter_DepthInverted is false: `lin_depth = 1 / (1 - depth)`
+// if NVSDK_NGX_DLSSG_Parameter_DepthInverted is true: `lin_depth = 1 / depth`
+//
+// This enables the algorithm to reliably threshold and characterize depth interactions.
+//
+// The Frame Generation algorithm is tuned such that most game integrations do not need to modify these values.
+// However, the below parameters provide mechanisms to control the shape of the internal depth processing space.
+// Typically useful when input raw depth units are compressed into a small dynamic range. The scale modifier
+// NVSDK_NGX_DLSSG_Parameter_LinearizedDepth_Scale is a good place to start that won't require more changes.
+//
+// Note: the input depth texture must be consistent with the input camera transformation matrices, e.g. clip2prevclip.
+
+// Optional scalar on the linearized depth before algorithm processing.
+//
+// Defaults to 1.0f. A value of 0.1f can help with a compressed input depth range.
+#define NVSDK_NGX_DLSSG_Parameter_LinearizedDepth_Scale "DLSSG.LinearizedDepth_Scale"
+
+// Optional heuristic that defines the z-distance to the depth plane that artificially partitions near from far objects.
+// DLSS Frame Generation uses this plane to restrict far plane object motion from scattering into near plane objects.
+//
+// Defaults to 600.0f. A value of 4000.0f can help with a compressed input depth range.
+#define NVSDK_NGX_DLSSG_Parameter_LinearizedDepth_NearFarPartition "DLSSG.LinearizedDepth_NearFarPartition"
+
+// Optional heuristic that specifies the minimum linearized depth difference between two objects in screen-space.
+// DLSS Frame Generation uses this heuristic to understand contiguous depth surfaces.
+//
+// Defaults to 40.0f.
+#define NVSDK_NGX_DLSSG_Parameter_MinRelativeLinearDepthObjectSeparation "DLSSG.MinRelativeLinearDepthObjectSeparation"
+
+// Texture Subrect Definitions
+
+// Subrect definitions for the input backbuffer (NVSDK_NGX_DLSSG_Parameter_Backbuffer)
+#define NVSDK_NGX_DLSSG_Parameter_InputBackbufferSubrectBaseX "DLSSG.InputBackbufferSubrectBaseX"
+#define NVSDK_NGX_DLSSG_Parameter_InputBackbufferSubrectBaseY "DLSSG.InputBackbufferSubrectBaseY"
+#define NVSDK_NGX_DLSSG_Parameter_InputBackbufferSubrectWidth "DLSSG.InputBackbufferSubrectWidth"
+#define NVSDK_NGX_DLSSG_Parameter_InputBackbufferSubrectHeight "DLSSG.InputBackbufferSubrectHeight"
+
+#define NVSDK_NGX_DLSSG_Parameter_MVecsSubrectBaseX "DLSSG.MVecsSubrectBaseX"
+#define NVSDK_NGX_DLSSG_Parameter_MVecsSubrectBaseY "DLSSG.MVecsSubrectBaseY"
+#define NVSDK_NGX_DLSSG_Parameter_MVecsSubrectWidth "DLSSG.MVecsSubrectWidth"
+#define NVSDK_NGX_DLSSG_Parameter_MVecsSubrectHeight "DLSSG.MVecsSubrectHeight"
+
+#define NVSDK_NGX_DLSSG_Parameter_DepthSubrectBaseX "DLSSG.DepthSubrectBaseX"
+#define NVSDK_NGX_DLSSG_Parameter_DepthSubrectBaseY "DLSSG.DepthSubrectBaseY"
+#define NVSDK_NGX_DLSSG_Parameter_DepthSubrectWidth "DLSSG.DepthSubrectWidth"
+#define NVSDK_NGX_DLSSG_Parameter_DepthSubrectHeight "DLSSG.DepthSubrectHeight"
+
+#define NVSDK_NGX_DLSSG_Parameter_HUDLessSubrectBaseX "DLSSG.HUDLessSubrectBaseX"
+#define NVSDK_NGX_DLSSG_Parameter_HUDLessSubrectBaseY "DLSSG.HUDLessSubrectBaseY"
+#define NVSDK_NGX_DLSSG_Parameter_HUDLessSubrectWidth "DLSSG.HUDLessSubrectWidth"
+#define NVSDK_NGX_DLSSG_Parameter_HUDLessSubrectHeight "DLSSG.HUDLessSubrectHeight"
+
+#define NVSDK_NGX_DLSSG_Parameter_UISubrectBaseX "DLSSG.UISubrectBaseX"
+#define NVSDK_NGX_DLSSG_Parameter_UISubrectBaseY "DLSSG.UISubrectBaseY"
+#define NVSDK_NGX_DLSSG_Parameter_UISubrectWidth "DLSSG.UISubrectWidth"
+#define NVSDK_NGX_DLSSG_Parameter_UISubrectHeight "DLSSG.UISubrectHeight"
+
+#define NVSDK_NGX_DLSSG_Parameter_UIAlphaSubrectBaseX "DLSSG.UIAlphaSubrectBaseX"
+#define NVSDK_NGX_DLSSG_Parameter_UIAlphaSubrectBaseY "DLSSG.UIAlphaSubrectBaseY"
+#define NVSDK_NGX_DLSSG_Parameter_UIAlphaSubrectWidth "DLSSG.UIAlphaSubrectWidth"
+#define NVSDK_NGX_DLSSG_Parameter_UIAlphaSubrectHeight "DLSSG.UIAlphaSubrectHeight"
+
+#define NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionFieldSubrectBaseX "DLSSG.BidirectionalDistortionFieldSubrectBaseX"
+#define NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionFieldSubrectBaseY "DLSSG.BidirectionalDistortionFieldSubrectBaseY"
+#define NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionFieldSubrectWidth "DLSSG.BidirectionalDistortionFieldSubrectWidth"
+#define NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionFieldSubrectHeight "DLSSG.BidirectionalDistortionFieldSubrectHeight"
+#define NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionField_LowPrecision_IsLowPrecision "DLSSG.BidirectionalDistortionFieldLowPrecision.IsLowPrecision"
+#define NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionField_LowPrecision_Bias "DLSSG.BidirectionalDistortionFieldLowPrecision.Bias"
+#define NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionField_LowPrecision_Scale "DLSSG.BidirectionalDistortionFieldLowPrecision.Scale"
+
+#define NVSDK_NGX_DLSSG_Parameter_OutputInterpolatedSubrectBaseX "DLSSG.OutputInterpolatedSubrectBaseX"
+#define NVSDK_NGX_DLSSG_Parameter_OutputInterpolatedSubrectBaseY "DLSSG.OutputInterpolatedSubrectBaseY"
+#define NVSDK_NGX_DLSSG_Parameter_OutputInterpolatedSubrectWidth "DLSSG.OutputInterpolatedSubrectWidth"
+#define NVSDK_NGX_DLSSG_Parameter_OutputInterpolatedSubrectHeight "DLSSG.OutputInterpolatedSubrectHeight"
+
+#define NVSDK_NGX_DLSSG_Parameter_OutputRealSubrectBaseX "DLSSG.OutputRealSubrectBaseX"
+#define NVSDK_NGX_DLSSG_Parameter_OutputRealSubrectBaseY "DLSSG.OutputRealSubrectBaseY"
+#define NVSDK_NGX_DLSSG_Parameter_OutputRealSubrectWidth "DLSSG.OutputRealSubrectWidth"
+#define NVSDK_NGX_DLSSG_Parameter_OutputRealSubrectHeight "DLSSG.OutputRealSubrectHeight"
+
+// DEPRECATED. Backbuffer subrect definitions. These apply to BOTH the input and
+// output backbuffer resources (Backbuffer, OutputInterpolated, OutputReal).
+//
+// Use InputBackbufferSubrect, OutputInterpolatedSubrect, and OutputRealSubrect
+// instead.
+#define NVSDK_NGX_DLSSG_Parameter_BackbufferSubrectBaseX "DLSSG.BackbufferSubrectBaseX"
+#define NVSDK_NGX_DLSSG_Parameter_BackbufferSubrectBaseY "DLSSG.BackbufferSubrectBaseY"
+#define NVSDK_NGX_DLSSG_Parameter_BackbufferSubrectWidth "DLSSG.BackbufferSubrectWidth"
+#define NVSDK_NGX_DLSSG_Parameter_BackbufferSubrectHeight "DLSSG.BackbufferSubrectHeight"
+
+// Specifies the internal resolution to be used (mainly for dynamic resolution)
+#define NVSDK_NGX_DLSSG_Parameter_InternalWidth "DLSSG.InternalWidth"
+#define NVSDK_NGX_DLSSG_Parameter_InternalHeight "DLSSG.InternalHeight"
+
+// If nonzero, we expect to use dynamic resolution (MVec and Depth res will change, possibly per frame)
+#define NVSDK_NGX_DLSSG_Parameter_DynamicResolution "DLSSG.DynamicResolution"
+
+typedef enum NVSDK_NGX_DLSSG_EvalFlags
+{
+ // The default behaviour for evaluate is to write the interpolated pixels inside of the
+ // backbuffer extent and uninterpolated pixels - outside of the extent. If this flag is
+ // set, then only the inside of the backbuffer extent is updated, the outside of the extent
+ // stays untouched.
+ NVSDK_NGX_DLSSG_EvalFlags_UpdateOnlyInsideExtents = (1 << 0)
+} NVSDK_NGX_DLSSG_EvalFlags;
+#define NVSDK_NGX_DLSSG_Parameter_EvalFlags "DLSSG.EvalFlags"
+
+typedef enum NVSDK_NGX_DLSSG_FullscreenMode
+{
+ NVSDK_NGX_DLSSG_FullscreenMode_Windowed = 0,
+ NVSDK_NGX_DLSSG_FullscreenMode_Borderless = 1,
+ NVSDK_NGX_DLSSG_FullscreenMode_Exclusive = 2
+} NVSDK_NGX_DLSSG_FullscreenMode;
+
+#define NVSDK_NGX_DLSSG_Parameter_FullscreenMode "DLSSG.FullscreenMode"
+#define NVSDK_NGX_DLSSG_Parameter_TargetFrameRate "DLSSG.TargetFrameRate"
+
+// Callback function types
+typedef NVSDK_NGX_Result(NVSDK_CONV* PFN_NVSDK_NGX_DLSSG_GetCurrentSettingsCallback)(const NVSDK_NGX_Handle* InHandle, NVSDK_NGX_Parameter* InParams);
+typedef NVSDK_NGX_Result(NVSDK_CONV* PFN_NVSDK_NGX_DLSSG_EstimateVRAMCallback)(uint32_t mvecDepthWidth, uint32_t mvecDepthHeight,
+ uint32_t colorWidth, uint32_t colorHeight,
+ uint32_t colorBufferFormat,
+ uint32_t mvecBufferFormat, uint32_t depthBufferFormat,
+ uint32_t hudLessBufferFormat, uint32_t uiBufferFormat, size_t* estimatedVRAMInBytes);
+
+// DLSS 4
+
+// Output Capability Parameters (access via GetDeviceCapabilityParameters)
+// The maximum number of generated frames supported by the feature (e.g. 3 for 4x)
+// If 1 or not set, multiframe is not supported
+#define NVSDK_NGX_DLSSG_Parameter_MultiFrameCountMax "DLSSG.MultiFrameCountMax"
+
+// InParameters
+// uint32_t, Total of Number Frames expected to Interpolate for given Real-Frame Pair. For 4x, this is 3. For 2x, this is 1.
+#define NVSDK_NGX_DLSSG_Parameter_MultiFrameCount "DLSSG.MultiFrameCount"
+// uint32_t, Current inner frame index. For 4x, this is 1, 2, and 3. For 2x, this is 1.
+#define NVSDK_NGX_DLSSG_Parameter_MultiFrameIndex "DLSSG.MultiFrameIndex"
+
+// Optional: uint64_t that increments by one for each fully rendered backbuffer frame such that
+// Current Backbuffer ID == (Previous Backbuffer ID + 1). The number should increment even
+// if FG is off, for example, when rendering a menu with FG temporarily disabled.
+#define NVSDK_NGX_DLSSG_Parameter_BackbufferFrameID "DLSSG.BackbufferFrameID"
+
+// Create Time Parameter: Specifies if User Interface Recomposition is enabled.
+// When enabled, the algorithm will generate output frames using the HUDless and UI Color & Alpha textures if present.
+// Boolean value: 0 (disabled) or 1 (enabled).
+// The end user can override this with Nvidia App DLSS Override.
+#define NVSDK_NGX_DLSSG_Parameter_UserInterfaceRecompositionEnabled "DLSSG.UserInterfaceRecompositionEnabled"
+
+#endif // NVSDK_NGX_DEFS_DLSSG_H
diff --git a/native/NVIDIA-DLSS/include/nvsdk_ngx_defs_vk.h b/native/NVIDIA-DLSS/include/nvsdk_ngx_defs_vk.h
new file mode 100644
index 0000000..98fc873
--- /dev/null
+++ b/native/NVIDIA-DLSS/include/nvsdk_ngx_defs_vk.h
@@ -0,0 +1,106 @@
+/*
+ * SPDX-FileCopyrightText: Copyright (c) 2019-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
+ *
+ * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
+ * property and proprietary rights in and to this material, related
+ * documentation and any modifications thereto. Any use, reproduction,
+ * disclosure or distribution of this material and related documentation
+ * without an express license agreement from NVIDIA CORPORATION or
+ * its affiliates is strictly prohibited.
+ */
+
+#ifndef NVSDK_NGX_DEFS_VK_H
+#define NVSDK_NGX_DEFS_VK_H
+#pragma once
+
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+typedef enum NVSDK_NGX_Resource_VK_Type
+{
+ NVSDK_NGX_RESOURCE_VK_TYPE_VK_IMAGEVIEW,
+ NVSDK_NGX_RESOURCE_VK_TYPE_VK_BUFFER
+} NVSDK_NGX_Resource_VK_Type;
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_ImageViewInfo_VK [Vulkan only]
+// Contains ImageView-specific metadata.
+// ImageView:
+// The VkImageView resource.
+//
+// Image:
+// The VkImage associated to this VkImageView.
+//
+// SubresourceRange:
+// The VkImageSubresourceRange associated to this VkImageView.
+//
+// Format:
+// The format of the resource.
+//
+// Width:
+// The width of the resource.
+//
+// Height:
+// The height of the resource.
+//
+typedef struct NVSDK_NGX_ImageViewInfo_VK {
+ VkImageView ImageView;
+ VkImage Image;
+ VkImageSubresourceRange SubresourceRange;
+ VkFormat Format;
+ unsigned int Width;
+ unsigned int Height;
+} NVSDK_NGX_ImageViewInfo_VK;
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_BufferInfo_VK [Vulkan only]
+// Contains Buffer-specific metadata.
+// Buffer
+// The VkBuffer resource.
+//
+// SizeInBytes:
+// The size of the resource (in bytes).
+//
+typedef struct NVSDK_NGX_BufferInfo_VK {
+ VkBuffer Buffer;
+ unsigned int SizeInBytes;
+} NVSDK_NGX_BufferInfo_VK;
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_Resource_VK [Vulkan only]
+//
+// ImageViewInfo:
+// The VkImageView resource, and VkImageView-specific metadata. A NVSDK_NGX_Resource_VK can only have one of ImageViewInfo or BufferInfo.
+//
+// BufferInfo:
+// The VkBuffer Resource, and VkBuffer-specific metadata. A NVSDK_NGX_Resource_VK can only have one of ImageViewInfo or BufferInfo.
+//
+// Type:
+// Whether or this resource is a VkImageView or a VkBuffer.
+//
+// ReadWrite:
+// True if the resource is available for read and write access.
+// For VkBuffer resources: VkBufferUsageFlags includes VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT or VK_BUFFER_USAGE_STORAGE_BUFFER_BIT
+// For VkImage resources: VkImageUsageFlags for associated VkImage includes VK_IMAGE_USAGE_STORAGE_BIT
+//
+typedef struct NVSDK_NGX_Resource_VK {
+ union {
+ NVSDK_NGX_ImageViewInfo_VK ImageViewInfo;
+ NVSDK_NGX_BufferInfo_VK BufferInfo;
+ } Resource;
+ NVSDK_NGX_Resource_VK_Type Type;
+ bool ReadWrite;
+} NVSDK_NGX_Resource_VK;
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // NVSDK_NGX_DEFS_VK_H
diff --git a/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers.h b/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers.h
new file mode 100644
index 0000000..da4be98
--- /dev/null
+++ b/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers.h
@@ -0,0 +1,559 @@
+/*
+ * SPDX-FileCopyrightText: Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
+ *
+ * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
+ * property and proprietary rights in and to this material, related
+ * documentation and any modifications thereto. Any use, reproduction,
+ * disclosure or distribution of this material and related documentation
+ * without an express license agreement from NVIDIA CORPORATION or
+ * its affiliates is strictly prohibited.
+ */
+
+#ifndef NVSDK_NGX_HELPERS_H
+#define NVSDK_NGX_HELPERS_H
+#pragma once
+
+#include "nvsdk_ngx.h"
+#include "nvsdk_ngx_defs.h"
+
+static inline NVSDK_NGX_Result NGX_DLSS_GET_STATS_2(
+ NVSDK_NGX_Parameter *pInParams,
+ unsigned long long *pVRAMAllocatedBytes,
+ unsigned int *pOptLevel, unsigned int *IsDevSnippetBranch)
+{
+ void *Callback = NULL;
+ NVSDK_NGX_Parameter_GetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSGetStatsCallback, &Callback);
+ if (!Callback)
+ {
+ // Possible reasons for this:
+ // - Installed DLSS is out of date and does not support the feature we need
+ // - You used NVSDK_NGX_AllocateParameters() for creating InParams. Try using NVSDK_NGX_GetCapabilityParameters() instead
+ return NVSDK_NGX_Result_FAIL_OutOfDate;
+ }
+
+ NVSDK_NGX_Result Res = NVSDK_NGX_Result_Success;
+ PFN_NVSDK_NGX_DLSS_GetStatsCallback PFNCallback = (PFN_NVSDK_NGX_DLSS_GetStatsCallback)Callback;
+ Res = PFNCallback(pInParams);
+ if (NVSDK_NGX_FAILED(Res))
+ {
+ return Res;
+ }
+ NVSDK_NGX_Parameter_GetULL(pInParams, NVSDK_NGX_Parameter_SizeInBytes, pVRAMAllocatedBytes);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_EParameter_OptLevel, pOptLevel);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_EParameter_IsDevSnippetBranch, IsDevSnippetBranch);
+ return Res;
+}
+
+static inline NVSDK_NGX_Result NGX_DLSS_GET_STATS_1(
+ NVSDK_NGX_Parameter *pInParams,
+ unsigned long long *pVRAMAllocatedBytes,
+ unsigned int *pOptLevel)
+{
+ unsigned int dummy = 0;
+ return NGX_DLSS_GET_STATS_2(pInParams, pVRAMAllocatedBytes, pOptLevel, &dummy);
+}
+
+static inline NVSDK_NGX_Result NGX_DLSS_GET_STATS(
+ NVSDK_NGX_Parameter *pInParams,
+ unsigned long long *pVRAMAllocatedBytes)
+{
+ unsigned int dummy = 0;
+ return NGX_DLSS_GET_STATS_2(pInParams, pVRAMAllocatedBytes, &dummy, &dummy);
+}
+
+static inline NVSDK_NGX_Result NGX_DLSS_GET_OPTIMAL_SETTINGS(
+ NVSDK_NGX_Parameter *pInParams,
+ unsigned int InUserSelectedWidth,
+ unsigned int InUserSelectedHeight,
+ NVSDK_NGX_PerfQuality_Value InPerfQualityValue,
+ unsigned int *pOutRenderOptimalWidth,
+ unsigned int *pOutRenderOptimalHeight,
+ unsigned int *pOutRenderMaxWidth,
+ unsigned int *pOutRenderMaxHeight,
+ unsigned int *pOutRenderMinWidth,
+ unsigned int *pOutRenderMinHeight,
+ float *pOutSharpness)
+{
+ void *Callback = NULL;
+ NVSDK_NGX_Parameter_GetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSOptimalSettingsCallback, &Callback);
+ if (!Callback)
+ {
+ // Possible reasons for this:
+ // - Installed DLSS is out of date and does not support the feature we need
+ // - You used NVSDK_NGX_AllocateParameters() for creating InParams. Try using NVSDK_NGX_GetCapabilityParameters() instead
+ return NVSDK_NGX_Result_FAIL_OutOfDate;
+ }
+
+ // These are selections made by user in UI
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, InUserSelectedWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, InUserSelectedHeight);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, InPerfQualityValue);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_RTXValue, false); // Some older DLSS dlls still expect this value to be set
+
+ NVSDK_NGX_Result Res = NVSDK_NGX_Result_Success;
+ PFN_NVSDK_NGX_DLSS_GetOptimalSettingsCallback PFNCallback = (PFN_NVSDK_NGX_DLSS_GetOptimalSettingsCallback)Callback;
+ Res = PFNCallback(pInParams);
+ if (NVSDK_NGX_FAILED(Res))
+ {
+ return Res;
+ }
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pOutRenderOptimalWidth);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pOutRenderOptimalHeight);
+ // If we have an older DLSS Dll those might need to be set to the optimal dimensions instead
+ *pOutRenderMaxWidth = *pOutRenderOptimalWidth;
+ *pOutRenderMaxHeight = *pOutRenderOptimalHeight;
+ *pOutRenderMinWidth = *pOutRenderOptimalWidth;
+ *pOutRenderMinHeight = *pOutRenderOptimalHeight;
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Max_Render_Width, pOutRenderMaxWidth);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Max_Render_Height, pOutRenderMaxHeight);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Width, pOutRenderMinWidth);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Height, pOutRenderMinHeight);
+ NVSDK_NGX_Parameter_GetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pOutSharpness);
+ return Res;
+}
+
+/*** D3D11 ***/
+typedef struct NVSDK_NGX_D3D11_Feature_Eval_Params
+{
+ ID3D11Resource* pInColor;
+ ID3D11Resource* pInOutput;
+ /*** OPTIONAL for DLSS ***/
+ float InSharpness;
+} NVSDK_NGX_D3D11_Feature_Eval_Params;
+
+typedef struct NVSDK_NGX_CUDA_Feature_Eval_Params
+{
+ CUtexObject* pInColor;
+ CUtexObject* pInOutput;
+ /*** OPTIONAL for DLSS ***/
+ float InSharpness;
+} NVSDK_NGX_CUDA_Feature_Eval_Params;
+
+typedef struct NVSDK_NGX_D3D11_GBuffer
+{
+ ID3D11Resource* pInAttrib[NVSDK_NGX_GBUFFERTYPE_NUM];
+} NVSDK_NGX_D3D11_GBuffer;
+
+typedef struct NVSDK_NGX_D3D11_DLSS_Eval_Params
+{
+ NVSDK_NGX_D3D11_Feature_Eval_Params Feature;
+ ID3D11Resource* pInDepth;
+ ID3D11Resource* pInMotionVectors;
+ float InJitterOffsetX; /* Jitter offset must be in input/render pixel space */
+ float InJitterOffsetY;
+ NVSDK_NGX_Dimensions InRenderSubrectDimensions;
+ /*** OPTIONAL - leave to 0/0.0f if unused ***/
+ int InReset; /* Set to 1 when scene changes completely (new level etc) */
+ float InMVScaleX; /* If MVs need custom scaling to convert to pixel space */
+ float InMVScaleY;
+ ID3D11Resource* pInTransparencyMask; /* Unused/Reserved for future use */
+ ID3D11Resource* pInExposureTexture;
+ ID3D11Resource* pInBiasCurrentColorMask;
+ NVSDK_NGX_Coordinates InColorSubrectBase;
+ NVSDK_NGX_Coordinates InDepthSubrectBase;
+ NVSDK_NGX_Coordinates InMVSubrectBase;
+ NVSDK_NGX_Coordinates InTranslucencySubrectBase;
+ NVSDK_NGX_Coordinates InBiasCurrentColorSubrectBase;
+ NVSDK_NGX_Coordinates InOutputSubrectBase;
+ float InPreExposure;
+ float InExposureScale;
+ int InIndicatorInvertXAxis;
+ int InIndicatorInvertYAxis;
+ /*** OPTIONAL - only for research purposes ***/
+ NVSDK_NGX_D3D11_GBuffer GBufferSurface;
+ NVSDK_NGX_ToneMapperType InToneMapperType;
+ ID3D11Resource* pInMotionVectors3D;
+ ID3D11Resource* pInIsParticleMask; /* to identify which pixels contains particles, essentially that are not drawn as part of base pass */
+ ID3D11Resource* pInAnimatedTextureMask; /* a binary mask covering pixels occupied by animated textures */
+ ID3D11Resource* pInDepthHighRes;
+ ID3D11Resource* pInPositionViewSpace;
+ float InFrameTimeDeltaInMsec; /* helps in determining the amount to denoise or anti-alias based on the speed of the object from motion vector magnitudes and fps as determined by this delta */
+ ID3D11Resource* pInRayTracingHitDistance; /* for each effect - approximation to the amount of noise in a ray-traced color */
+ ID3D11Resource* pInMotionVectorsReflections; /* motion vectors of reflected objects like for mirrored surfaces */
+} NVSDK_NGX_D3D11_DLSS_Eval_Params;
+
+typedef struct NVSDK_NGX_D3D11_DLISP_Eval_Params
+{
+ NVSDK_NGX_D3D11_Feature_Eval_Params Feature;
+ /*** OPTIONAL - leave to 0/0.0f if unused ***/
+ unsigned int InRectX;
+ unsigned int InRectY;
+ unsigned int InRectW;
+ unsigned int InRectH;
+ float InDenoise;
+} NVSDK_NGX_D3D11_DLISP_Eval_Params;
+
+typedef struct NVSDK_NGX_CUDA_DLISP_Eval_Params
+{
+ NVSDK_NGX_CUDA_Feature_Eval_Params Feature;
+ /*** OPTIONAL - leave to 0/0.0f if unused ***/
+ unsigned int InRectX;
+ unsigned int InRectY;
+ unsigned int InRectW;
+ unsigned int InRectH;
+ float InDenoise;
+} NVSDK_NGX_CUDA_DLISP_Eval_Params;
+
+
+static inline NVSDK_NGX_Result NGX_D3D11_CREATE_DLSS_EXT(
+ ID3D11DeviceContext *pInCtx,
+ NVSDK_NGX_Handle **ppOutHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_DLSS_Create_Params *pInDlssCreateParams)
+{
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pInDlssCreateParams->Feature.InWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pInDlssCreateParams->Feature.InHeight);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pInDlssCreateParams->Feature.InTargetWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pInDlssCreateParams->Feature.InTargetHeight);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, pInDlssCreateParams->Feature.InPerfQualityValue);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Feature_Create_Flags, pInDlssCreateParams->InFeatureCreateFlags);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Enable_Output_Subrects, pInDlssCreateParams->InEnableOutputSubrects ? 1 : 0);
+
+ return NVSDK_NGX_D3D11_CreateFeature(pInCtx, NVSDK_NGX_Feature_SuperSampling, pInParams, ppOutHandle);
+}
+
+
+static inline NVSDK_NGX_Result NGX_D3D11_EVALUATE_DLSS_EXT(
+ ID3D11DeviceContext *pInCtx,
+ NVSDK_NGX_Handle *pInHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_D3D11_DLSS_Eval_Params *pInDlssEvalParams)
+{
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Color, pInDlssEvalParams->Feature.pInColor);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Output, pInDlssEvalParams->Feature.pInOutput);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Depth, pInDlssEvalParams->pInDepth);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_MotionVectors, pInDlssEvalParams->pInMotionVectors);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_X, pInDlssEvalParams->InJitterOffsetX);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_Y, pInDlssEvalParams->InJitterOffsetY);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pInDlssEvalParams->Feature.InSharpness);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_Reset, pInDlssEvalParams->InReset);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_X, pInDlssEvalParams->InMVScaleX == 0.0f ? 1.0f : pInDlssEvalParams->InMVScaleX);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_Y, pInDlssEvalParams->InMVScaleY == 0.0f ? 1.0f : pInDlssEvalParams->InMVScaleY);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_TransparencyMask, pInDlssEvalParams->pInTransparencyMask);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_ExposureTexture, pInDlssEvalParams->pInExposureTexture);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_Mask, pInDlssEvalParams->pInBiasCurrentColorMask);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Albedo, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ALBEDO]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Roughness, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ROUGHNESS]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Metallic, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_METALLIC]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Specular, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SPECULAR]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Subsurface, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SUBSURFACE]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Normals, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_NORMALS]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_ShadingModelId, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SHADINGMODELID]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_MaterialId, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_MATERIALID]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_8, pInDlssEvalParams->GBufferSurface.pInAttrib[8]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_9, pInDlssEvalParams->GBufferSurface.pInAttrib[9]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_10, pInDlssEvalParams->GBufferSurface.pInAttrib[10]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_11, pInDlssEvalParams->GBufferSurface.pInAttrib[11]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_12, pInDlssEvalParams->GBufferSurface.pInAttrib[12]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_13, pInDlssEvalParams->GBufferSurface.pInAttrib[13]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_14, pInDlssEvalParams->GBufferSurface.pInAttrib[14]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_15, pInDlssEvalParams->GBufferSurface.pInAttrib[15]);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_TonemapperType, pInDlssEvalParams->InToneMapperType);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_MotionVectors3D, pInDlssEvalParams->pInMotionVectors3D);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_IsParticleMask, pInDlssEvalParams->pInIsParticleMask);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_AnimatedTextureMask, pInDlssEvalParams->pInAnimatedTextureMask);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DepthHighRes, pInDlssEvalParams->pInDepthHighRes);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Position_ViewSpace, pInDlssEvalParams->pInPositionViewSpace);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_FrameTimeDeltaInMsec, pInDlssEvalParams->InFrameTimeDeltaInMsec);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_RayTracingHitDistance, pInDlssEvalParams->pInRayTracingHitDistance);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_MotionVectorsReflection, pInDlssEvalParams->pInMotionVectorsReflections);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_X, pInDlssEvalParams->InColorSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_Y, pInDlssEvalParams->InColorSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_X, pInDlssEvalParams->InDepthSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_Y, pInDlssEvalParams->InDepthSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_X, pInDlssEvalParams->InMVSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_Y, pInDlssEvalParams->InMVSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_X, pInDlssEvalParams->InTranslucencySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_Y, pInDlssEvalParams->InTranslucencySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_X, pInDlssEvalParams->InBiasCurrentColorSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_Y, pInDlssEvalParams->InBiasCurrentColorSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_X, pInDlssEvalParams->InOutputSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_Y, pInDlssEvalParams->InOutputSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Width , pInDlssEvalParams->InRenderSubrectDimensions.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Height, pInDlssEvalParams->InRenderSubrectDimensions.Height);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Pre_Exposure, pInDlssEvalParams->InPreExposure == 0.0f ? 1.0f : pInDlssEvalParams->InPreExposure);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Exposure_Scale, pInDlssEvalParams->InExposureScale == 0.0f ? 1.0f : pInDlssEvalParams->InExposureScale);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_X_Axis, pInDlssEvalParams->InIndicatorInvertXAxis);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_Y_Axis, pInDlssEvalParams->InIndicatorInvertYAxis);
+
+ return NVSDK_NGX_D3D11_EvaluateFeature_C(pInCtx, pInHandle, pInParams, NULL);
+}
+
+static inline NVSDK_NGX_Result NGX_D3D11_CREATE_DLISP_EXT(
+ ID3D11DeviceContext *pInCtx,
+ NVSDK_NGX_Handle **ppOutHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_Feature_Create_Params *pDlispCreateParams)
+{
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pDlispCreateParams->InWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pDlispCreateParams->InHeight);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pDlispCreateParams->InTargetWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pDlispCreateParams->InTargetHeight);
+
+ return NVSDK_NGX_D3D11_CreateFeature(pInCtx, NVSDK_NGX_Feature_ImageSignalProcessing, pInParams, ppOutHandle);
+}
+
+static inline NVSDK_NGX_Result NGX_CUDA_CREATE_DLISP_EXT(
+ NVSDK_NGX_Handle** ppOutHandle,
+ NVSDK_NGX_Parameter* pInParams,
+ NVSDK_NGX_Feature_Create_Params* pDlispCreateParams)
+{
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pDlispCreateParams->InWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pDlispCreateParams->InHeight);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pDlispCreateParams->InTargetWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pDlispCreateParams->InTargetHeight);
+
+ return NVSDK_NGX_CUDA_CreateFeature(NVSDK_NGX_Feature_ImageSignalProcessing, pInParams, ppOutHandle);
+}
+
+static inline NVSDK_NGX_Result NGX_D3D11_EVALUATE_DLISP_EXT(
+ ID3D11DeviceContext *pInCtx,
+ NVSDK_NGX_Handle *pInHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_D3D11_DLISP_Eval_Params *pDlispEvalParams)
+{
+ if (pDlispEvalParams->Feature.InSharpness < 0.0f || pDlispEvalParams->Feature.InSharpness > 1.0f || pDlispEvalParams->InDenoise < 0.0f || pDlispEvalParams->InDenoise > 1.0f)
+ {
+ return NVSDK_NGX_Result_FAIL_InvalidParameter;
+ }
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Color, pDlispEvalParams->Feature.pInColor);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Output, pDlispEvalParams->Feature.pInOutput);
+ // Both sharpness and denoise in range [0.0f,1.0f]
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pDlispEvalParams->Feature.InSharpness);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Denoise, pDlispEvalParams->InDenoise);
+ // If input is atlas - use RECT to upscale only the required area
+ if (pDlispEvalParams->InRectW)
+ {
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_X, pDlispEvalParams->InRectX);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_Y, pDlispEvalParams->InRectY);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_W, pDlispEvalParams->InRectW);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_H, pDlispEvalParams->InRectH);
+ }
+
+ return NVSDK_NGX_D3D11_EvaluateFeature_C(pInCtx, pInHandle, pInParams, NULL);
+}
+
+static inline NVSDK_NGX_Result NGX_CUDA_EVALUATE_DLISP_EXT(
+ NVSDK_NGX_Handle *pInHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_CUDA_DLISP_Eval_Params *pDlispEvalParams)
+{
+ if (pDlispEvalParams->Feature.InSharpness < 0.0f || pDlispEvalParams->Feature.InSharpness > 1.0f || pDlispEvalParams->InDenoise < 0.0f || pDlispEvalParams->InDenoise > 1.0f)
+ {
+ return NVSDK_NGX_Result_FAIL_InvalidParameter;
+ }
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Color, pDlispEvalParams->Feature.pInColor);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Output, pDlispEvalParams->Feature.pInOutput);
+ // Both sharpness and denoise in range [0.0f,1.0f]
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pDlispEvalParams->Feature.InSharpness);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Denoise, pDlispEvalParams->InDenoise);
+ // If input is atlas - use RECT to upscale only the required area
+ if (pDlispEvalParams->InRectW)
+ {
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_X, pDlispEvalParams->InRectX);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_Y, pDlispEvalParams->InRectY);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_W, pDlispEvalParams->InRectW);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_H, pDlispEvalParams->InRectH);
+ }
+
+ return NVSDK_NGX_CUDA_EvaluateFeature_C(pInHandle, pInParams, NULL);
+}
+
+/*** D3D12 ***/
+typedef struct NVSDK_NGX_D3D12_Feature_Eval_Params
+{
+ ID3D12Resource* pInColor;
+ ID3D12Resource* pInOutput;
+ /*** OPTIONAL for DLSS ***/
+ float InSharpness;
+} NVSDK_NGX_D3D12_Feature_Eval_Params;
+
+typedef struct NVSDK_NGX_D3D12_GBuffer
+{
+ ID3D12Resource* pInAttrib[NVSDK_NGX_GBUFFERTYPE_NUM];
+} NVSDK_NGX_D3D12_GBuffer;
+
+typedef struct NVSDK_NGX_D3D12_DLSS_Eval_Params
+{
+ NVSDK_NGX_D3D12_Feature_Eval_Params Feature;
+ ID3D12Resource* pInDepth;
+ ID3D12Resource* pInMotionVectors;
+ float InJitterOffsetX; /* Jitter offset must be in input/render pixel space */
+ float InJitterOffsetY;
+ NVSDK_NGX_Dimensions InRenderSubrectDimensions;
+ /*** OPTIONAL - leave to 0/0.0f if unused ***/
+ int InReset; /* Set to 1 when scene changes completely (new level etc) */
+ float InMVScaleX; /* If MVs need custom scaling to convert to pixel space */
+ float InMVScaleY;
+ ID3D12Resource* pInTransparencyMask; /* Unused/Reserved for future use */
+ ID3D12Resource* pInExposureTexture;
+ ID3D12Resource* pInBiasCurrentColorMask;
+ NVSDK_NGX_Coordinates InColorSubrectBase;
+ NVSDK_NGX_Coordinates InDepthSubrectBase;
+ NVSDK_NGX_Coordinates InMVSubrectBase;
+ NVSDK_NGX_Coordinates InTranslucencySubrectBase;
+ NVSDK_NGX_Coordinates InBiasCurrentColorSubrectBase;
+ NVSDK_NGX_Coordinates InOutputSubrectBase;
+ float InPreExposure;
+ float InExposureScale;
+ int InIndicatorInvertXAxis;
+ int InIndicatorInvertYAxis;
+ /*** OPTIONAL - only for research purposes ***/
+ NVSDK_NGX_D3D12_GBuffer GBufferSurface;
+ NVSDK_NGX_ToneMapperType InToneMapperType;
+ ID3D12Resource* pInMotionVectors3D;
+ ID3D12Resource* pInIsParticleMask; /* to identify which pixels contains particles, essentially that are not drawn as part of base pass */
+ ID3D12Resource* pInAnimatedTextureMask; /* a binary mask covering pixels occupied by animated textures */
+ ID3D12Resource* pInDepthHighRes;
+ ID3D12Resource* pInPositionViewSpace;
+ float InFrameTimeDeltaInMsec; /* helps in determining the amount to denoise or anti-alias based on the speed of the object from motion vector magnitudes and fps as determined by this delta */
+ ID3D12Resource* pInRayTracingHitDistance; /* for each effect - approximation to the amount of noise in a ray-traced color */
+ ID3D12Resource* pInMotionVectorsReflections; /* motion vectors of reflected objects like for mirrored surfaces */
+} NVSDK_NGX_D3D12_DLSS_Eval_Params;
+
+typedef struct NVSDK_NGX_D3D12_DLISP_Eval_Params
+{
+ NVSDK_NGX_D3D12_Feature_Eval_Params Feature;
+ /*** OPTIONAL ***/
+ unsigned int InRectX;
+ unsigned int InRectY;
+ unsigned int InRectW;
+ unsigned int InRectH;
+ float InDenoise;
+} NVSDK_NGX_D3D12_DLISP_Eval_Params;
+
+
+static inline NVSDK_NGX_Result NGX_D3D12_CREATE_DLSS_EXT(
+ ID3D12GraphicsCommandList *pInCmdList,
+ unsigned int InCreationNodeMask,
+ unsigned int InVisibilityNodeMask,
+ NVSDK_NGX_Handle **ppOutHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_DLSS_Create_Params *pInDlssCreateParams)
+{
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_CreationNodeMask, InCreationNodeMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_VisibilityNodeMask, InVisibilityNodeMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pInDlssCreateParams->Feature.InWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pInDlssCreateParams->Feature.InHeight);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pInDlssCreateParams->Feature.InTargetWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pInDlssCreateParams->Feature.InTargetHeight);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, pInDlssCreateParams->Feature.InPerfQualityValue);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Feature_Create_Flags, pInDlssCreateParams->InFeatureCreateFlags);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Enable_Output_Subrects, pInDlssCreateParams->InEnableOutputSubrects ? 1 : 0);
+
+ return NVSDK_NGX_D3D12_CreateFeature(pInCmdList, NVSDK_NGX_Feature_SuperSampling, pInParams, ppOutHandle);
+}
+
+
+static inline NVSDK_NGX_Result NGX_D3D12_EVALUATE_DLSS_EXT(
+ ID3D12GraphicsCommandList *pInCmdList,
+ NVSDK_NGX_Handle *pInHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_D3D12_DLSS_Eval_Params *pInDlssEvalParams)
+{
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Color, pInDlssEvalParams->Feature.pInColor);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Output, pInDlssEvalParams->Feature.pInOutput);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Depth, pInDlssEvalParams->pInDepth);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_MotionVectors, pInDlssEvalParams->pInMotionVectors);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_X, pInDlssEvalParams->InJitterOffsetX);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_Y, pInDlssEvalParams->InJitterOffsetY);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pInDlssEvalParams->Feature.InSharpness);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_Reset, pInDlssEvalParams->InReset);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_X, pInDlssEvalParams->InMVScaleX == 0.0f ? 1.0f : pInDlssEvalParams->InMVScaleX);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_Y, pInDlssEvalParams->InMVScaleY == 0.0f ? 1.0f : pInDlssEvalParams->InMVScaleY);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_TransparencyMask, pInDlssEvalParams->pInTransparencyMask);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_ExposureTexture, pInDlssEvalParams->pInExposureTexture);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_Mask, pInDlssEvalParams->pInBiasCurrentColorMask);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Albedo, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ALBEDO]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Roughness, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ROUGHNESS]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Metallic, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_METALLIC]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Specular, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SPECULAR]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Subsurface, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SUBSURFACE]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Normals, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_NORMALS]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_ShadingModelId, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SHADINGMODELID]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_MaterialId, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_MATERIALID]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_8, pInDlssEvalParams->GBufferSurface.pInAttrib[8]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_9, pInDlssEvalParams->GBufferSurface.pInAttrib[9]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_10, pInDlssEvalParams->GBufferSurface.pInAttrib[10]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_11, pInDlssEvalParams->GBufferSurface.pInAttrib[11]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_12, pInDlssEvalParams->GBufferSurface.pInAttrib[12]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_13, pInDlssEvalParams->GBufferSurface.pInAttrib[13]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_14, pInDlssEvalParams->GBufferSurface.pInAttrib[14]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_15, pInDlssEvalParams->GBufferSurface.pInAttrib[15]);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_TonemapperType, pInDlssEvalParams->InToneMapperType);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_MotionVectors3D, pInDlssEvalParams->pInMotionVectors3D);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_IsParticleMask, pInDlssEvalParams->pInIsParticleMask);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_AnimatedTextureMask, pInDlssEvalParams->pInAnimatedTextureMask);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DepthHighRes, pInDlssEvalParams->pInDepthHighRes);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Position_ViewSpace, pInDlssEvalParams->pInPositionViewSpace);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_FrameTimeDeltaInMsec, pInDlssEvalParams->InFrameTimeDeltaInMsec);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_RayTracingHitDistance, pInDlssEvalParams->pInRayTracingHitDistance);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_MotionVectorsReflection, pInDlssEvalParams->pInMotionVectorsReflections);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_X, pInDlssEvalParams->InColorSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_Y, pInDlssEvalParams->InColorSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_X, pInDlssEvalParams->InDepthSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_Y, pInDlssEvalParams->InDepthSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_X, pInDlssEvalParams->InMVSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_Y, pInDlssEvalParams->InMVSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_X, pInDlssEvalParams->InTranslucencySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_Y, pInDlssEvalParams->InTranslucencySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_X, pInDlssEvalParams->InBiasCurrentColorSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_Y, pInDlssEvalParams->InBiasCurrentColorSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_X, pInDlssEvalParams->InOutputSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_Y, pInDlssEvalParams->InOutputSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Width , pInDlssEvalParams->InRenderSubrectDimensions.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Height, pInDlssEvalParams->InRenderSubrectDimensions.Height);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Pre_Exposure, pInDlssEvalParams->InPreExposure == 0.0f ? 1.0f : pInDlssEvalParams->InPreExposure);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Exposure_Scale, pInDlssEvalParams->InExposureScale == 0.0f ? 1.0f : pInDlssEvalParams->InExposureScale);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_X_Axis, pInDlssEvalParams->InIndicatorInvertXAxis);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_Y_Axis, pInDlssEvalParams->InIndicatorInvertYAxis);
+
+ return NVSDK_NGX_D3D12_EvaluateFeature_C(pInCmdList, pInHandle, pInParams, NULL);
+}
+
+static inline NVSDK_NGX_Result NGX_D3D12_CREATE_DLISP_EXT(
+ ID3D12GraphicsCommandList *InCmdList,
+ unsigned int InCreationNodeMask,
+ unsigned int InVisibilityNodeMask,
+ NVSDK_NGX_Handle **ppOutHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_Feature_Create_Params *pDlispCreateParams)
+{
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_CreationNodeMask, InCreationNodeMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_VisibilityNodeMask, InVisibilityNodeMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pDlispCreateParams->InWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pDlispCreateParams->InHeight);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pDlispCreateParams->InTargetWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pDlispCreateParams->InTargetHeight);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, pDlispCreateParams->InPerfQualityValue);
+
+ return NVSDK_NGX_D3D12_CreateFeature(InCmdList, NVSDK_NGX_Feature_ImageSignalProcessing, pInParams, ppOutHandle);
+}
+
+static inline NVSDK_NGX_Result NGX_D3D12_EVALUATE_DLISP_EXT(
+ ID3D12GraphicsCommandList *pInCmdList,
+ NVSDK_NGX_Handle *pInHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_D3D12_DLISP_Eval_Params *pDlispEvalParams)
+{
+ if (pDlispEvalParams->Feature.InSharpness < 0.0f || pDlispEvalParams->Feature.InSharpness > 1.0f || pDlispEvalParams->InDenoise < 0.0f || pDlispEvalParams->InDenoise > 1.0f)
+ {
+ return NVSDK_NGX_Result_FAIL_InvalidParameter;
+ }
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Color, pDlispEvalParams->Feature.pInColor);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Output, pDlispEvalParams->Feature.pInOutput);
+ // Both sharpness and denoise in range [0.0f,1.0f]
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pDlispEvalParams->Feature.InSharpness);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Denoise, pDlispEvalParams->InDenoise);
+ // If input is atlas - use RECT to upscale only the required area
+ if (pDlispEvalParams->InRectW)
+ {
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_X, pDlispEvalParams->InRectX);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_Y, pDlispEvalParams->InRectY);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_W, pDlispEvalParams->InRectW);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_H, pDlispEvalParams->InRectH);
+ }
+ return NVSDK_NGX_D3D12_EvaluateFeature_C(pInCmdList, pInHandle, pInParams, NULL);
+}
+#endif
diff --git a/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_dlssd.h b/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_dlssd.h
new file mode 100644
index 0000000..ae80408
--- /dev/null
+++ b/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_dlssd.h
@@ -0,0 +1,721 @@
+/*
+ * SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
+ *
+ * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
+ * property and proprietary rights in and to this material, related
+ * documentation and any modifications thereto. Any use, reproduction,
+ * disclosure or distribution of this material and related documentation
+ * without an express license agreement from NVIDIA CORPORATION or
+ * its affiliates is strictly prohibited.
+ */
+
+#ifndef NVSDK_NGX_HELPERS_DLSSD_H
+#define NVSDK_NGX_HELPERS_DLSSD_H
+#pragma once
+
+#include "nvsdk_ngx_helpers.h"
+#include "nvsdk_ngx_defs_dlssd.h"
+#include "nvsdk_ngx_params_dlssd.h"
+
+static inline NVSDK_NGX_Result NGX_DLSSD_GET_STATS_2(
+ NVSDK_NGX_Parameter* pInParams,
+ unsigned long long* pVRAMAllocatedBytes,
+ unsigned int* pOptLevel, unsigned int* IsDevSnippetBranch)
+{
+ void* Callback = NULL;
+ NVSDK_NGX_Parameter_GetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSDGetStatsCallback, &Callback);
+ if (!Callback)
+ {
+ // Possible reasons for this:
+ // - Installed DLSS is out of date and does not support the feature we need
+ // - You used NVSDK_NGX_AllocateParameters() for creating InParams. Try using NVSDK_NGX_GetCapabilityParameters() instead
+ return NVSDK_NGX_Result_FAIL_OutOfDate;
+ }
+
+ NVSDK_NGX_Result Res = NVSDK_NGX_Result_Success;
+ PFN_NVSDK_NGX_DLSS_GetStatsCallback PFNCallback = (PFN_NVSDK_NGX_DLSS_GetStatsCallback)Callback;
+ Res = PFNCallback(pInParams);
+ if (NVSDK_NGX_FAILED(Res))
+ {
+ return Res;
+ }
+ NVSDK_NGX_Parameter_GetULL(pInParams, NVSDK_NGX_Parameter_SizeInBytes, pVRAMAllocatedBytes);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_EParameter_OptLevel, pOptLevel);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_EParameter_IsDevSnippetBranch, IsDevSnippetBranch);
+ return Res;
+}
+
+static inline NVSDK_NGX_Result NGX_DLSSD_GET_STATS_1(
+ NVSDK_NGX_Parameter* pInParams,
+ unsigned long long* pVRAMAllocatedBytes,
+ unsigned int* pOptLevel)
+{
+ unsigned int dummy = 0;
+ return NGX_DLSSD_GET_STATS_2(pInParams, pVRAMAllocatedBytes, pOptLevel, &dummy);
+}
+
+static inline NVSDK_NGX_Result NGX_DLSSD_GET_STATS(
+ NVSDK_NGX_Parameter* pInParams,
+ unsigned long long* pVRAMAllocatedBytes)
+{
+ unsigned int dummy = 0;
+ return NGX_DLSSD_GET_STATS_2(pInParams, pVRAMAllocatedBytes, &dummy, &dummy);
+}
+
+static inline NVSDK_NGX_Result NGX_DLSSD_GET_OPTIMAL_SETTINGS(
+ NVSDK_NGX_Parameter* pInParams,
+ unsigned int InUserSelectedWidth,
+ unsigned int InUserSelectedHeight,
+ NVSDK_NGX_PerfQuality_Value InPerfQualityValue,
+ unsigned int* pOutRenderOptimalWidth,
+ unsigned int* pOutRenderOptimalHeight,
+ unsigned int* pOutRenderMaxWidth,
+ unsigned int* pOutRenderMaxHeight,
+ unsigned int* pOutRenderMinWidth,
+ unsigned int* pOutRenderMinHeight,
+ float* pOutSharpness)
+{
+ void* Callback = NULL;
+ NVSDK_NGX_Parameter_GetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSDOptimalSettingsCallback, &Callback);
+ if (!Callback)
+ {
+ // Possible reasons for this:
+ // - Installed DLSS is out of date and does not support the feature we need
+ // - You used NVSDK_NGX_AllocateParameters() for creating InParams. Try using NVSDK_NGX_GetCapabilityParameters() instead
+ return NVSDK_NGX_Result_FAIL_OutOfDate;
+ }
+
+ // These are selections made by user in UI
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, InUserSelectedWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, InUserSelectedHeight);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, InPerfQualityValue);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_RTXValue, false); // Some older DLSS dlls still expect this value to be set
+
+ NVSDK_NGX_Result Res = NVSDK_NGX_Result_Success;
+ PFN_NVSDK_NGX_DLSS_GetOptimalSettingsCallback PFNCallback = (PFN_NVSDK_NGX_DLSS_GetOptimalSettingsCallback)Callback;
+ Res = PFNCallback(pInParams);
+ if (NVSDK_NGX_FAILED(Res))
+ {
+ return Res;
+ }
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pOutRenderOptimalWidth);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pOutRenderOptimalHeight);
+ // If we have an older DLSS Dll those might need to be set to the optimal dimensions instead
+ *pOutRenderMaxWidth = *pOutRenderOptimalWidth;
+ *pOutRenderMaxHeight = *pOutRenderOptimalHeight;
+ *pOutRenderMinWidth = *pOutRenderOptimalWidth;
+ *pOutRenderMinHeight = *pOutRenderOptimalHeight;
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Max_Render_Width, pOutRenderMaxWidth);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Max_Render_Height, pOutRenderMaxHeight);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Width, pOutRenderMinWidth);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Height, pOutRenderMinHeight);
+ NVSDK_NGX_Parameter_GetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pOutSharpness);
+ return Res;
+}
+
+typedef struct NVSDK_NGX_D3D11_DLSSD_Eval_Params
+{
+ ID3D11Resource* pInDiffuseAlbedo;
+ ID3D11Resource* pInSpecularAlbedo;
+ ID3D11Resource* pInNormals;
+ ID3D11Resource* pInRoughness;
+
+ ID3D11Resource* pInColor;
+ ID3D11Resource* pInAlpha;
+ ID3D11Resource* pInOutput;
+ ID3D11Resource* pInOutputAlpha;
+ ID3D11Resource* pInDepth;
+ ID3D11Resource* pInMotionVectors;
+ float InJitterOffsetX; /* Jitter offset must be in input/render pixel space */
+ float InJitterOffsetY;
+ NVSDK_NGX_Dimensions InRenderSubrectDimensions;
+ /*** OPTIONAL - leave to 0/0.0f if unused ***/
+ int InReset; /* Set to 1 when scene changes completely (new level etc) */
+ float InMVScaleX; /* If MVs need custom scaling to convert to pixel space */
+ float InMVScaleY;
+ ID3D11Resource* pInTransparencyMask; /* Unused/Reserved for future use */
+ ID3D11Resource* pInExposureTexture;
+ ID3D11Resource* pInBiasCurrentColorMask;
+ NVSDK_NGX_Coordinates InAlphaSubrectBase;
+ NVSDK_NGX_Coordinates InOutputAlphaSubrectBase;
+ NVSDK_NGX_Coordinates InDiffuseAlbedoSubrectBase;
+ NVSDK_NGX_Coordinates InSpecularAlbedoSubrectBase;
+ NVSDK_NGX_Coordinates InNormalsSubrectBase;
+ NVSDK_NGX_Coordinates InRoughnessSubrectBase;
+ NVSDK_NGX_Coordinates InColorSubrectBase;
+ NVSDK_NGX_Coordinates InDepthSubrectBase;
+ NVSDK_NGX_Coordinates InMVSubrectBase;
+ NVSDK_NGX_Coordinates InTranslucencySubrectBase;
+ NVSDK_NGX_Coordinates InBiasCurrentColorSubrectBase;
+ NVSDK_NGX_Coordinates InOutputSubrectBase;
+
+ ID3D11Resource* pInReflectedAlbedo;
+ ID3D11Resource* pInColorBeforeParticles;
+ ID3D11Resource* pInColorAfterParticles;
+ ID3D11Resource* pInColorBeforeTransparency;
+ ID3D11Resource* pInColorAfterTransparency;
+ ID3D11Resource* pInColorBeforeFog;
+ ID3D11Resource* pInColorAfterFog;
+ ID3D11Resource* pInScreenSpaceSubsurfaceScatteringGuide;
+ ID3D11Resource* pInColorBeforeScreenSpaceSubsurfaceScattering;
+ ID3D11Resource* pInColorAfterScreenSpaceSubsurfaceScattering;
+ ID3D11Resource* pInScreenSpaceRefractionGuide;
+ ID3D11Resource* pInColorBeforeScreenSpaceRefraction;
+ ID3D11Resource* pInColorAfterScreenSpaceRefraction;
+ ID3D11Resource* pInDepthOfFieldGuide;
+ ID3D11Resource* pInColorBeforeDepthOfField;
+ ID3D11Resource* pInColorAfterDepthOfField;
+ ID3D11Resource* pInDiffuseHitDistance;
+ ID3D11Resource* pInSpecularHitDistance;
+ ID3D11Resource* pInDiffuseRayDirection;
+ ID3D11Resource* pInSpecularRayDirection;
+ ID3D11Resource* pInDiffuseRayDirectionHitDistance;
+ ID3D11Resource* pInSpecularRayDirectionHitDistance;
+ NVSDK_NGX_Coordinates InReflectedAlbedoSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeParticlesSubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterParticlesSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeTransparencySubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterTransparencySubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeFogSubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterFogSubrectBase;
+ NVSDK_NGX_Coordinates InScreenSpaceSubsurfaceScatteringGuideSubrectBase;
+ NVSDK_NGX_Coordinates InScreenSpaceRefractionGuideSubrectBase;
+ NVSDK_NGX_Coordinates InDepthOfFieldGuideSubrectBase;
+ NVSDK_NGX_Coordinates InDiffuseHitDistanceSubrectBase;
+ NVSDK_NGX_Coordinates InSpecularHitDistanceSubrectBase;
+ NVSDK_NGX_Coordinates InDiffuseRayDirectionSubrectBase;
+ NVSDK_NGX_Coordinates InSpecularRayDirectionSubrectBase;
+ NVSDK_NGX_Coordinates InDiffuseRayDirectionHitDistanceSubrectBase;
+ NVSDK_NGX_Coordinates InSpecularRayDirectionHitDistanceSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeScreenSpaceSubsurfaceScatteringSubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterScreenSpaceSubsurfaceScatteringSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeScreenSpaceRefractionSubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterScreenSpaceRefractionSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeDepthOfFieldSubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterDepthOfFieldSubtectBase;
+ float* pInWorldToViewMatrix;
+ float* pInViewToClipMatrix;
+
+ float InPreExposure;
+ float InExposureScale;
+ int InIndicatorInvertXAxis;
+ int InIndicatorInvertYAxis;
+ /*** OPTIONAL - only for research purposes ***/
+ NVSDK_NGX_D3D11_GBuffer GBufferSurface;
+ NVSDK_NGX_ToneMapperType InToneMapperType;
+ ID3D11Resource* pInMotionVectors3D;
+ ID3D11Resource* pInIsParticleMask; /* to identify which pixels contains particles, essentially that are not drawn as part of base pass */
+ ID3D11Resource* pInAnimatedTextureMask; /* a binary mask covering pixels occupied by animated textures */
+ ID3D11Resource* pInDepthHighRes;
+ ID3D11Resource* pInPositionViewSpace;
+ float InFrameTimeDeltaInMsec; /* helps in determining the amount to denoise or anti-alias based on the speed of the object from motion vector magnitudes and fps as determined by this delta */
+ ID3D11Resource* pInRayTracingHitDistance; /* for each effect - approximation to the amount of noise in a ray-traced color */
+ ID3D11Resource* pInMotionVectorsReflections; /* motion vectors of reflected objects like for mirrored surfaces */
+ ID3D11Resource* pInTransparencyLayer; /* optional input res particle layer */
+ NVSDK_NGX_Coordinates InTransparencyLayerSubrectBase;
+ ID3D11Resource* pInTransparencyLayerOpacity; /* optional input res particle opacity layer */
+ NVSDK_NGX_Coordinates InTransparencyLayerOpacitySubrectBase;
+ ID3D11Resource* pInTransparencyLayerMvecs; /* optional input res transparency layer mvecs */
+ NVSDK_NGX_Coordinates InTransparencyLayerMvecsSubrectBase;
+ ID3D11Resource* pInDisocclusionMask; /* optional input res disocclusion mask */
+ NVSDK_NGX_Coordinates InDisocclusionMaskSubrectBase;
+ ID3D11Resource* pInResponsivityMask; /* optional input res responsivity mask; one channel, API range [-1,1]; R16F or R8 SNORM */
+ NVSDK_NGX_Coordinates InResponsivityMaskSubrectBase;
+} NVSDK_NGX_D3D11_DLSSD_Eval_Params;
+
+static inline NVSDK_NGX_Result NGX_D3D11_CREATE_DLSSD_EXT(
+ ID3D11DeviceContext *pInCtx,
+ NVSDK_NGX_Handle **ppOutHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_DLSSD_Create_Params *pInDlssDCreateParams)
+{
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pInDlssDCreateParams->InWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pInDlssDCreateParams->InHeight);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pInDlssDCreateParams->InTargetWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pInDlssDCreateParams->InTargetHeight);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, pInDlssDCreateParams->InPerfQualityValue);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Feature_Create_Flags, pInDlssDCreateParams->InFeatureCreateFlags);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Enable_Output_Subrects, pInDlssDCreateParams->InEnableOutputSubrects ? 1 : 0);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Denoise_Mode, NVSDK_NGX_DLSS_Denoise_Mode_DLUnified);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Roughness_Mode, pInDlssDCreateParams->InRoughnessMode);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Use_HW_Depth, pInDlssDCreateParams->InUseHWDepth);
+
+ return NVSDK_NGX_D3D11_CreateFeature(pInCtx, NVSDK_NGX_Feature_RayReconstruction, pInParams, ppOutHandle);
+}
+
+static inline NVSDK_NGX_Result NGX_D3D11_EVALUATE_DLSSD_EXT(
+ ID3D11DeviceContext *pInCtx,
+ NVSDK_NGX_Handle *pInHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_D3D11_DLSSD_Eval_Params *pInDlssDEvalParams)
+{
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Color, pInDlssDEvalParams->pInColor);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Output, pInDlssDEvalParams->pInOutput);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Depth, pInDlssDEvalParams->pInDepth);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_MotionVectors, pInDlssDEvalParams->pInMotionVectors);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_X, pInDlssDEvalParams->InJitterOffsetX);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_Y, pInDlssDEvalParams->InJitterOffsetY);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_Reset, pInDlssDEvalParams->InReset);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_X, pInDlssDEvalParams->InMVScaleX == 0.0f ? 1.0f : pInDlssDEvalParams->InMVScaleX);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_Y, pInDlssDEvalParams->InMVScaleY == 0.0f ? 1.0f : pInDlssDEvalParams->InMVScaleY);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_TransparencyMask, pInDlssDEvalParams->pInTransparencyMask);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_ExposureTexture, pInDlssDEvalParams->pInExposureTexture);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_Mask, pInDlssDEvalParams->pInBiasCurrentColorMask);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Albedo, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ALBEDO]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Roughness, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ROUGHNESS]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Metallic, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_METALLIC]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Specular, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SPECULAR]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Subsurface, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SUBSURFACE]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Normals, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_NORMALS]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_ShadingModelId, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SHADINGMODELID]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_MaterialId, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_MATERIALID]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_8, pInDlssDEvalParams->GBufferSurface.pInAttrib[8]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_9, pInDlssDEvalParams->GBufferSurface.pInAttrib[9]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_SpecularMvec, pInDlssDEvalParams->pInMotionVectorsReflections);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_11, pInDlssDEvalParams->GBufferSurface.pInAttrib[11]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_12, pInDlssDEvalParams->GBufferSurface.pInAttrib[12]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_13, pInDlssDEvalParams->GBufferSurface.pInAttrib[13]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_14, pInDlssDEvalParams->GBufferSurface.pInAttrib[14]);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_15, pInDlssDEvalParams->GBufferSurface.pInAttrib[15]);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_TonemapperType, pInDlssDEvalParams->InToneMapperType);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_MotionVectors3D, pInDlssDEvalParams->pInMotionVectors3D);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_IsParticleMask, pInDlssDEvalParams->pInIsParticleMask);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_AnimatedTextureMask, pInDlssDEvalParams->pInAnimatedTextureMask);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DepthHighRes, pInDlssDEvalParams->pInDepthHighRes);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_Position_ViewSpace, pInDlssDEvalParams->pInPositionViewSpace);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_FrameTimeDeltaInMsec, pInDlssDEvalParams->InFrameTimeDeltaInMsec);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_RayTracingHitDistance, pInDlssDEvalParams->pInRayTracingHitDistance);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_X, pInDlssDEvalParams->InColorSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_Y, pInDlssDEvalParams->InColorSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_X, pInDlssDEvalParams->InDepthSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_Y, pInDlssDEvalParams->InDepthSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_X, pInDlssDEvalParams->InMVSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_Y, pInDlssDEvalParams->InMVSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_X, pInDlssDEvalParams->InTranslucencySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_Y, pInDlssDEvalParams->InTranslucencySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_X, pInDlssDEvalParams->InBiasCurrentColorSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_Y, pInDlssDEvalParams->InBiasCurrentColorSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_X, pInDlssDEvalParams->InOutputSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_Y, pInDlssDEvalParams->InOutputSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Width , pInDlssDEvalParams->InRenderSubrectDimensions.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Height, pInDlssDEvalParams->InRenderSubrectDimensions.Height);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Pre_Exposure, pInDlssDEvalParams->InPreExposure == 0.0f ? 1.0f : pInDlssDEvalParams->InPreExposure);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Exposure_Scale, pInDlssDEvalParams->InExposureScale == 0.0f ? 1.0f : pInDlssDEvalParams->InExposureScale);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_X_Axis, pInDlssDEvalParams->InIndicatorInvertXAxis);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_Y_Axis, pInDlssDEvalParams->InIndicatorInvertYAxis);
+
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DiffuseAlbedo, pInDlssDEvalParams->pInDiffuseAlbedo);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_SpecularAlbedo, pInDlssDEvalParams->pInSpecularAlbedo);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_DiffuseAlbedo_Subrect_Base_X, pInDlssDEvalParams->InDiffuseAlbedoSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_DiffuseAlbedo_Subrect_Base_Y, pInDlssDEvalParams->InDiffuseAlbedoSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_SpecularAlbedo_Subrect_Base_X, pInDlssDEvalParams->InSpecularAlbedoSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_SpecularAlbedo_Subrect_Base_Y, pInDlssDEvalParams->InSpecularAlbedoSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Normals_Subrect_Base_X, pInDlssDEvalParams->InNormalsSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Normals_Subrect_Base_Y, pInDlssDEvalParams->InNormalsSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Roughness_Subrect_Base_X, pInDlssDEvalParams->InRoughnessSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Roughness_Subrect_Base_Y, pInDlssDEvalParams->InRoughnessSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Emissive, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_EMISSIVE]);
+
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_Alpha, pInDlssDEvalParams->pInAlpha);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_OutputAlpha, pInDlssDEvalParams->pInOutputAlpha);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ReflectedAlbedo, pInDlssDEvalParams->pInReflectedAlbedo);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeParticles, pInDlssDEvalParams->pInColorBeforeParticles);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterParticles, pInDlssDEvalParams->pInColorAfterParticles);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeTransparency, pInDlssDEvalParams->pInColorBeforeTransparency);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterTransparency, pInDlssDEvalParams->pInColorAfterTransparency);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeFog, pInDlssDEvalParams->pInColorBeforeFog);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterFog, pInDlssDEvalParams->pInColorAfterFog);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceSubsurfaceScatteringGuide, pInDlssDEvalParams->pInScreenSpaceSubsurfaceScatteringGuide);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceSubsurfaceScattering, pInDlssDEvalParams->pInColorBeforeScreenSpaceSubsurfaceScattering);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceSubsurfaceScattering, pInDlssDEvalParams->pInColorAfterScreenSpaceSubsurfaceScattering);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceRefractionGuide, pInDlssDEvalParams->pInScreenSpaceRefractionGuide);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceRefraction, pInDlssDEvalParams->pInColorBeforeScreenSpaceRefraction);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceRefraction, pInDlssDEvalParams->pInColorAfterScreenSpaceRefraction);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_DepthOfFieldGuide, pInDlssDEvalParams->pInDepthOfFieldGuide);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeDepthOfField, pInDlssDEvalParams->pInColorBeforeDepthOfField);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterDepthOfField, pInDlssDEvalParams->pInColorAfterDepthOfField);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseHitDistance, pInDlssDEvalParams->pInDiffuseHitDistance);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularHitDistance, pInDlssDEvalParams->pInSpecularHitDistance);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirection, pInDlssDEvalParams->pInDiffuseRayDirection);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirection, pInDlssDEvalParams->pInSpecularRayDirection);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirectionHitDistance, pInDlssDEvalParams->pInDiffuseRayDirectionHitDistance);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirectionHitDistance, pInDlssDEvalParams->pInSpecularRayDirectionHitDistance);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_Alpha_Subrect_Base_X, pInDlssDEvalParams->InAlphaSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_Alpha_Subrect_Base_Y, pInDlssDEvalParams->InAlphaSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_OutputAlpha_Subrect_Base_X, pInDlssDEvalParams->InOutputAlphaSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_OutputAlpha_Subrect_Base_Y, pInDlssDEvalParams->InOutputAlphaSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ReflectedAlbedo_Subrect_Base_X, pInDlssDEvalParams->InReflectedAlbedoSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ReflectedAlbedo_Subrect_Base_Y, pInDlssDEvalParams->InReflectedAlbedoSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterParticles_Subrect_Base_X, pInDlssDEvalParams->InColorAfterParticlesSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterParticles_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterParticlesSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeParticles_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeParticlesSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeParticles_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeParticlesSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeTransparency_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeTransparencySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeTransparency_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeTransparencySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterTransparency_Subrect_Base_X, pInDlssDEvalParams->InColorAfterTransparencySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterTransparency_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterTransparencySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeFog_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeFogSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeFog_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeFogSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterFog_Subrect_Base_X, pInDlssDEvalParams->InColorAfterFogSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterFog_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterFogSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceSubsurfaceScatteringGuide_Subrect_Base_X, pInDlssDEvalParams->InScreenSpaceSubsurfaceScatteringGuideSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceSubsurfaceScatteringGuide_Subrect_Base_Y, pInDlssDEvalParams->InScreenSpaceSubsurfaceScatteringGuideSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceSubsurfaceScattering_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeScreenSpaceSubsurfaceScatteringSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceSubsurfaceScattering_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeScreenSpaceSubsurfaceScatteringSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceSubsurfaceScattering_Subrect_Base_X, pInDlssDEvalParams->InColorAfterScreenSpaceSubsurfaceScatteringSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceSubsurfaceScattering_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterScreenSpaceSubsurfaceScatteringSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceRefractionGuide_Subrect_Base_X, pInDlssDEvalParams->InScreenSpaceRefractionGuideSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceRefractionGuide_Subrect_Base_Y, pInDlssDEvalParams->InScreenSpaceRefractionGuideSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceRefraction_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeScreenSpaceRefractionSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceRefraction_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeScreenSpaceRefractionSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceRefraction_Subrect_Base_X, pInDlssDEvalParams->InColorAfterScreenSpaceRefractionSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceRefraction_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterScreenSpaceRefractionSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DepthOfFieldGuide_Subrect_Base_X, pInDlssDEvalParams->InDepthOfFieldGuideSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DepthOfFieldGuide_Subrect_Base_Y, pInDlssDEvalParams->InDepthOfFieldGuideSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeDepthOfField_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeDepthOfFieldSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeDepthOfField_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeDepthOfFieldSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterDepthOfField_Subrect_Base_X, pInDlssDEvalParams->InColorAfterDepthOfFieldSubtectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterDepthOfField_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterDepthOfFieldSubtectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseHitDistance_Subrect_Base_X, pInDlssDEvalParams->InDiffuseHitDistanceSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseHitDistance_Subrect_Base_Y, pInDlssDEvalParams->InDiffuseHitDistanceSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularHitDistance_Subrect_Base_X, pInDlssDEvalParams->InSpecularHitDistanceSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularHitDistance_Subrect_Base_Y, pInDlssDEvalParams->InSpecularHitDistanceSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirection_Subrect_Base_X, pInDlssDEvalParams->InDiffuseRayDirectionSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirection_Subrect_Base_Y, pInDlssDEvalParams->InDiffuseRayDirectionSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirection_Subrect_Base_X, pInDlssDEvalParams->InSpecularRayDirectionSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirection_Subrect_Base_Y, pInDlssDEvalParams->InSpecularRayDirectionSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirectionHitDistance_Subrect_Base_X, pInDlssDEvalParams->InDiffuseRayDirectionHitDistanceSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirectionHitDistance_Subrect_Base_Y, pInDlssDEvalParams->InDiffuseRayDirectionHitDistanceSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirectionHitDistance_Subrect_Base_X, pInDlssDEvalParams->InSpecularRayDirectionHitDistanceSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirectionHitDistance_Subrect_Base_Y, pInDlssDEvalParams->InSpecularRayDirectionHitDistanceSubrectBase.Y);
+
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_WORLD_TO_VIEW_MATRIX, pInDlssDEvalParams->pInWorldToViewMatrix);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_VIEW_TO_CLIP_MATRIX, pInDlssDEvalParams->pInViewToClipMatrix);
+
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Normals, pInDlssDEvalParams->pInNormals);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Roughness, pInDlssDEvalParams->pInRoughness);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayer, pInDlssDEvalParams->pInTransparencyLayer);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerOpacity, pInDlssDEvalParams->pInTransparencyLayerOpacity);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerMvecs, pInDlssDEvalParams->pInTransparencyLayerMvecs);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSS_DisocclusionMask, pInDlssDEvalParams->pInDisocclusionMask);
+ NVSDK_NGX_Parameter_SetD3d11Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ResponsivityMask, pInDlssDEvalParams->pInResponsivityMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayer_Subrect_Base_X, pInDlssDEvalParams->InTransparencyLayerSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayer_Subrect_Base_Y, pInDlssDEvalParams->InTransparencyLayerSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerOpacity_Subrect_Base_X, pInDlssDEvalParams->InTransparencyLayerOpacitySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerOpacity_Subrect_Base_Y, pInDlssDEvalParams->InTransparencyLayerOpacitySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerMvecs_Subrect_Base_X, pInDlssDEvalParams->InTransparencyLayerMvecsSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerMvecs_Subrect_Base_Y, pInDlssDEvalParams->InTransparencyLayerMvecsSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_DisocclusionMask_Subrect_Base_X, pInDlssDEvalParams->InDisocclusionMaskSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_DisocclusionMask_Subrect_Base_Y, pInDlssDEvalParams->InDisocclusionMaskSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ResponsivityMask_Subrect_Base_X, pInDlssDEvalParams->InResponsivityMaskSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ResponsivityMask_Subrect_Base_Y, pInDlssDEvalParams->InResponsivityMaskSubrectBase.Y);
+
+
+ return NVSDK_NGX_D3D11_EvaluateFeature_C(pInCtx, pInHandle, pInParams, NULL);
+}
+
+typedef struct NVSDK_NGX_D3D12_DLSSD_Eval_Params
+{
+ ID3D12Resource* pInDiffuseAlbedo;
+ ID3D12Resource* pInSpecularAlbedo;
+ ID3D12Resource* pInNormals;
+ ID3D12Resource* pInRoughness;
+
+ ID3D12Resource* pInColor;
+ ID3D12Resource* pInAlpha;
+ ID3D12Resource* pInOutput;
+ ID3D12Resource* pInOutputAlpha;
+ ID3D12Resource* pInDepth;
+ ID3D12Resource* pInMotionVectors;
+ float InJitterOffsetX; /* Jitter offset must be in input/render pixel space */
+ float InJitterOffsetY;
+ NVSDK_NGX_Dimensions InRenderSubrectDimensions;
+ /*** OPTIONAL - leave to 0/0.0f if unused ***/
+ int InReset; /* Set to 1 when scene changes completely (new level etc) */
+ float InMVScaleX; /* If MVs need custom scaling to convert to pixel space */
+ float InMVScaleY;
+ ID3D12Resource* pInTransparencyMask; /* Unused/Reserved for future use */
+ ID3D12Resource* pInExposureTexture;
+ ID3D12Resource* pInBiasCurrentColorMask;
+ NVSDK_NGX_Coordinates InAlphaSubrectBase;
+ NVSDK_NGX_Coordinates InOutputAlphaSubrectBase;
+ NVSDK_NGX_Coordinates InDiffuseAlbedoSubrectBase;
+ NVSDK_NGX_Coordinates InSpecularAlbedoSubrectBase;
+ NVSDK_NGX_Coordinates InNormalsSubrectBase;
+ NVSDK_NGX_Coordinates InRoughnessSubrectBase;
+ NVSDK_NGX_Coordinates InColorSubrectBase;
+ NVSDK_NGX_Coordinates InDepthSubrectBase;
+ NVSDK_NGX_Coordinates InMVSubrectBase;
+ NVSDK_NGX_Coordinates InTranslucencySubrectBase;
+ NVSDK_NGX_Coordinates InBiasCurrentColorSubrectBase;
+ NVSDK_NGX_Coordinates InOutputSubrectBase;
+
+ ID3D12Resource* pInReflectedAlbedo;
+ ID3D12Resource* pInColorBeforeParticles;
+ ID3D12Resource* pInColorAfterParticles;
+ ID3D12Resource* pInColorBeforeTransparency;
+ ID3D12Resource* pInColorAfterTransparency;
+ ID3D12Resource* pInColorBeforeFog;
+ ID3D12Resource* pInColorAfterFog;
+ ID3D12Resource* pInScreenSpaceSubsurfaceScatteringGuide;
+ ID3D12Resource* pInColorBeforeScreenSpaceSubsurfaceScattering;
+ ID3D12Resource* pInColorAfterScreenSpaceSubsurfaceScattering;
+ ID3D12Resource* pInScreenSpaceRefractionGuide;
+ ID3D12Resource* pInColorBeforeScreenSpaceRefraction;
+ ID3D12Resource* pInColorAfterScreenSpaceRefraction;
+ ID3D12Resource* pInDepthOfFieldGuide;
+ ID3D12Resource* pInColorBeforeDepthOfField;
+ ID3D12Resource* pInColorAfterDepthOfField;
+ ID3D12Resource* pInDiffuseHitDistance;
+ ID3D12Resource* pInSpecularHitDistance;
+ ID3D12Resource* pInDiffuseRayDirection;
+ ID3D12Resource* pInSpecularRayDirection;
+ ID3D12Resource* pInDiffuseRayDirectionHitDistance;
+ ID3D12Resource* pInSpecularRayDirectionHitDistance;
+ NVSDK_NGX_Coordinates InReflectedAlbedoSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeParticlesSubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterParticlesSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeTransparencySubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterTransparencySubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeFogSubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterFogSubrectBase;
+ NVSDK_NGX_Coordinates InScreenSpaceSubsurfaceScatteringGuideSubrectBase;
+ NVSDK_NGX_Coordinates InScreenSpaceRefractionGuideSubrectBase;
+ NVSDK_NGX_Coordinates InDepthOfFieldGuideSubrectBase;
+ NVSDK_NGX_Coordinates InDiffuseHitDistanceSubrectBase;
+ NVSDK_NGX_Coordinates InSpecularHitDistanceSubrectBase;
+ NVSDK_NGX_Coordinates InDiffuseRayDirectionSubrectBase;
+ NVSDK_NGX_Coordinates InSpecularRayDirectionSubrectBase;
+ NVSDK_NGX_Coordinates InDiffuseRayDirectionHitDistanceSubrectBase;
+ NVSDK_NGX_Coordinates InSpecularRayDirectionHitDistanceSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeScreenSpaceSubsurfaceScatteringSubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterScreenSpaceSubsurfaceScatteringSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeScreenSpaceRefractionSubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterScreenSpaceRefractionSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeDepthOfFieldSubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterDepthOfFieldSubtectBase;
+ float* pInWorldToViewMatrix;
+ float* pInViewToClipMatrix;
+
+ float InPreExposure;
+ float InExposureScale;
+ int InIndicatorInvertXAxis;
+ int InIndicatorInvertYAxis;
+ /*** OPTIONAL - only for research purposes ***/
+ NVSDK_NGX_D3D12_GBuffer GBufferSurface;
+ NVSDK_NGX_ToneMapperType InToneMapperType;
+ ID3D12Resource* pInMotionVectors3D;
+ ID3D12Resource* pInIsParticleMask; /* to identify which pixels contains particles, essentially that are not drawn as part of base pass */
+ ID3D12Resource* pInAnimatedTextureMask; /* a binary mask covering pixels occupied by animated textures */
+ ID3D12Resource* pInDepthHighRes;
+ ID3D12Resource* pInPositionViewSpace;
+ float InFrameTimeDeltaInMsec; /* helps in determining the amount to denoise or anti-alias based on the speed of the object from motion vector magnitudes and fps as determined by this delta */
+ ID3D12Resource* pInRayTracingHitDistance; /* for each effect - approximation to the amount of noise in a ray-traced color */
+ ID3D12Resource* pInMotionVectorsReflections; /* motion vectors of reflected objects like for mirrored surfaces */
+ ID3D12Resource* pInTransparencyLayer; /* optional input res particle layer */
+ NVSDK_NGX_Coordinates InTransparencyLayerSubrectBase;
+ ID3D12Resource* pInTransparencyLayerOpacity; /* optional input res particle opacity layer */
+ NVSDK_NGX_Coordinates InTransparencyLayerOpacitySubrectBase;
+ ID3D12Resource* pInTransparencyLayerMvecs; /* optional input res transparency layer mvecs */
+ NVSDK_NGX_Coordinates InTransparencyLayerMvecsSubrectBase;
+ ID3D12Resource* pInDisocclusionMask; /* optional input res disocclusion mask */
+ NVSDK_NGX_Coordinates InDisocclusionMaskSubrectBase;
+ ID3D12Resource* pInResponsivityMask; /* optional input res responsivity mask; one channel, R16F or R8 SNORM */
+ NVSDK_NGX_Coordinates InResponsivityMaskSubrectBase;
+
+} NVSDK_NGX_D3D12_DLSSD_Eval_Params;
+
+static inline NVSDK_NGX_Result NGX_D3D12_CREATE_DLSSD_EXT(
+ ID3D12GraphicsCommandList *pInCmdList,
+ unsigned int InCreationNodeMask,
+ unsigned int InVisibilityNodeMask,
+ NVSDK_NGX_Handle **ppOutHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_DLSSD_Create_Params *pInDlssDCreateParams)
+{
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_CreationNodeMask, InCreationNodeMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_VisibilityNodeMask, InVisibilityNodeMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pInDlssDCreateParams->InWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pInDlssDCreateParams->InHeight);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pInDlssDCreateParams->InTargetWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pInDlssDCreateParams->InTargetHeight);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, pInDlssDCreateParams->InPerfQualityValue);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Feature_Create_Flags, pInDlssDCreateParams->InFeatureCreateFlags);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Enable_Output_Subrects, pInDlssDCreateParams->InEnableOutputSubrects ? 1 : 0);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Denoise_Mode, NVSDK_NGX_DLSS_Denoise_Mode_DLUnified);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Roughness_Mode, pInDlssDCreateParams->InRoughnessMode);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Use_HW_Depth, pInDlssDCreateParams->InUseHWDepth);
+ return NVSDK_NGX_D3D12_CreateFeature(pInCmdList, NVSDK_NGX_Feature_RayReconstruction, pInParams, ppOutHandle);
+}
+
+static inline NVSDK_NGX_Result NGX_D3D12_EVALUATE_DLSSD_EXT(
+ ID3D12GraphicsCommandList *pInCmdList,
+ NVSDK_NGX_Handle *pInHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_D3D12_DLSSD_Eval_Params *pInDlssDEvalParams)
+{
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Color, pInDlssDEvalParams->pInColor);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Output, pInDlssDEvalParams->pInOutput);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Depth, pInDlssDEvalParams->pInDepth);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_MotionVectors, pInDlssDEvalParams->pInMotionVectors);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_X, pInDlssDEvalParams->InJitterOffsetX);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_Y, pInDlssDEvalParams->InJitterOffsetY);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_Reset, pInDlssDEvalParams->InReset);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_X, pInDlssDEvalParams->InMVScaleX == 0.0f ? 1.0f : pInDlssDEvalParams->InMVScaleX);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_Y, pInDlssDEvalParams->InMVScaleY == 0.0f ? 1.0f : pInDlssDEvalParams->InMVScaleY);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_TransparencyMask, pInDlssDEvalParams->pInTransparencyMask);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_ExposureTexture, pInDlssDEvalParams->pInExposureTexture);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_Mask, pInDlssDEvalParams->pInBiasCurrentColorMask);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Albedo, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ALBEDO]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Roughness, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ROUGHNESS]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Metallic, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_METALLIC]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Specular, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SPECULAR]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Subsurface, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SUBSURFACE]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Normals, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_NORMALS]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_ShadingModelId, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SHADINGMODELID]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_MaterialId, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_MATERIALID]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_8, pInDlssDEvalParams->GBufferSurface.pInAttrib[8]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_9, pInDlssDEvalParams->GBufferSurface.pInAttrib[9]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_11, pInDlssDEvalParams->GBufferSurface.pInAttrib[11]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_12, pInDlssDEvalParams->GBufferSurface.pInAttrib[12]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_13, pInDlssDEvalParams->GBufferSurface.pInAttrib[13]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_14, pInDlssDEvalParams->GBufferSurface.pInAttrib[14]);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_15, pInDlssDEvalParams->GBufferSurface.pInAttrib[15]);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_TonemapperType, pInDlssDEvalParams->InToneMapperType);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_MotionVectors3D, pInDlssDEvalParams->pInMotionVectors3D);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_IsParticleMask, pInDlssDEvalParams->pInIsParticleMask);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_AnimatedTextureMask, pInDlssDEvalParams->pInAnimatedTextureMask);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DepthHighRes, pInDlssDEvalParams->pInDepthHighRes);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_Position_ViewSpace, pInDlssDEvalParams->pInPositionViewSpace);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_FrameTimeDeltaInMsec, pInDlssDEvalParams->InFrameTimeDeltaInMsec);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_RayTracingHitDistance, pInDlssDEvalParams->pInRayTracingHitDistance);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_SpecularMvec, pInDlssDEvalParams->pInMotionVectorsReflections);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_X, pInDlssDEvalParams->InColorSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_Y, pInDlssDEvalParams->InColorSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_X, pInDlssDEvalParams->InDepthSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_Y, pInDlssDEvalParams->InDepthSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_X, pInDlssDEvalParams->InMVSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_Y, pInDlssDEvalParams->InMVSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_X, pInDlssDEvalParams->InTranslucencySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_Y, pInDlssDEvalParams->InTranslucencySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_X, pInDlssDEvalParams->InBiasCurrentColorSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_Y, pInDlssDEvalParams->InBiasCurrentColorSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_X, pInDlssDEvalParams->InOutputSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_Y, pInDlssDEvalParams->InOutputSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Width , pInDlssDEvalParams->InRenderSubrectDimensions.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Height, pInDlssDEvalParams->InRenderSubrectDimensions.Height);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Pre_Exposure, pInDlssDEvalParams->InPreExposure == 0.0f ? 1.0f : pInDlssDEvalParams->InPreExposure);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Exposure_Scale, pInDlssDEvalParams->InExposureScale == 0.0f ? 1.0f : pInDlssDEvalParams->InExposureScale);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_X_Axis, pInDlssDEvalParams->InIndicatorInvertXAxis);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_Y_Axis, pInDlssDEvalParams->InIndicatorInvertYAxis);
+
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Emissive, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_EMISSIVE]);
+
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DiffuseAlbedo, pInDlssDEvalParams->pInDiffuseAlbedo);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_SpecularAlbedo, pInDlssDEvalParams->pInSpecularAlbedo);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_DiffuseAlbedo_Subrect_Base_X, pInDlssDEvalParams->InDiffuseAlbedoSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_DiffuseAlbedo_Subrect_Base_Y, pInDlssDEvalParams->InDiffuseAlbedoSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_SpecularAlbedo_Subrect_Base_X, pInDlssDEvalParams->InSpecularAlbedoSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_SpecularAlbedo_Subrect_Base_Y, pInDlssDEvalParams->InSpecularAlbedoSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Normals_Subrect_Base_X, pInDlssDEvalParams->InNormalsSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Normals_Subrect_Base_Y, pInDlssDEvalParams->InNormalsSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Roughness_Subrect_Base_X, pInDlssDEvalParams->InRoughnessSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Roughness_Subrect_Base_Y, pInDlssDEvalParams->InRoughnessSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Normals, pInDlssDEvalParams->pInNormals);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_GBuffer_Roughness, pInDlssDEvalParams->pInRoughness);
+
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_Alpha, pInDlssDEvalParams->pInAlpha);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_OutputAlpha, pInDlssDEvalParams->pInOutputAlpha);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ReflectedAlbedo, pInDlssDEvalParams->pInReflectedAlbedo);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeParticles, pInDlssDEvalParams->pInColorBeforeParticles);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterParticles, pInDlssDEvalParams->pInColorAfterParticles);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeTransparency, pInDlssDEvalParams->pInColorBeforeTransparency);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterTransparency, pInDlssDEvalParams->pInColorAfterTransparency);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeFog, pInDlssDEvalParams->pInColorBeforeFog);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterFog, pInDlssDEvalParams->pInColorAfterFog);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceSubsurfaceScatteringGuide, pInDlssDEvalParams->pInScreenSpaceSubsurfaceScatteringGuide);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceSubsurfaceScattering, pInDlssDEvalParams->pInColorBeforeScreenSpaceSubsurfaceScattering);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceSubsurfaceScattering, pInDlssDEvalParams->pInColorAfterScreenSpaceSubsurfaceScattering);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceRefractionGuide, pInDlssDEvalParams->pInScreenSpaceRefractionGuide);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceRefraction, pInDlssDEvalParams->pInColorBeforeScreenSpaceRefraction);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceRefraction, pInDlssDEvalParams->pInColorAfterScreenSpaceRefraction);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_DepthOfFieldGuide, pInDlssDEvalParams->pInDepthOfFieldGuide);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeDepthOfField, pInDlssDEvalParams->pInColorBeforeDepthOfField);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterDepthOfField, pInDlssDEvalParams->pInColorAfterDepthOfField);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseHitDistance, pInDlssDEvalParams->pInDiffuseHitDistance);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularHitDistance, pInDlssDEvalParams->pInSpecularHitDistance);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirection, pInDlssDEvalParams->pInDiffuseRayDirection);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirection, pInDlssDEvalParams->pInSpecularRayDirection);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirectionHitDistance, pInDlssDEvalParams->pInDiffuseRayDirectionHitDistance);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirectionHitDistance, pInDlssDEvalParams->pInSpecularRayDirectionHitDistance);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_Alpha_Subrect_Base_X, pInDlssDEvalParams->InAlphaSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_Alpha_Subrect_Base_Y, pInDlssDEvalParams->InAlphaSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_OutputAlpha_Subrect_Base_X, pInDlssDEvalParams->InOutputAlphaSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_OutputAlpha_Subrect_Base_Y, pInDlssDEvalParams->InOutputAlphaSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ReflectedAlbedo_Subrect_Base_X, pInDlssDEvalParams->InReflectedAlbedoSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ReflectedAlbedo_Subrect_Base_Y, pInDlssDEvalParams->InReflectedAlbedoSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterParticles_Subrect_Base_X, pInDlssDEvalParams->InColorAfterParticlesSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterParticles_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterParticlesSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeParticles_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeParticlesSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeParticles_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeParticlesSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeTransparency_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeTransparencySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeTransparency_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeTransparencySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterTransparency_Subrect_Base_X, pInDlssDEvalParams->InColorAfterTransparencySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterTransparency_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterTransparencySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterFog_Subrect_Base_X, pInDlssDEvalParams->InColorAfterFogSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterFog_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterFogSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeFog_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeFogSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeFog_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeFogSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceSubsurfaceScatteringGuide_Subrect_Base_X, pInDlssDEvalParams->InScreenSpaceSubsurfaceScatteringGuideSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceSubsurfaceScatteringGuide_Subrect_Base_Y, pInDlssDEvalParams->InScreenSpaceSubsurfaceScatteringGuideSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceSubsurfaceScattering_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeScreenSpaceSubsurfaceScatteringSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceSubsurfaceScattering_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeScreenSpaceSubsurfaceScatteringSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceSubsurfaceScattering_Subrect_Base_X, pInDlssDEvalParams->InColorAfterScreenSpaceSubsurfaceScatteringSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceSubsurfaceScattering_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterScreenSpaceSubsurfaceScatteringSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceRefractionGuide_Subrect_Base_X, pInDlssDEvalParams->InScreenSpaceRefractionGuideSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceRefractionGuide_Subrect_Base_Y, pInDlssDEvalParams->InScreenSpaceRefractionGuideSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceRefraction_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeScreenSpaceRefractionSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceRefraction_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeScreenSpaceRefractionSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceRefraction_Subrect_Base_X, pInDlssDEvalParams->InColorAfterScreenSpaceRefractionSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceRefraction_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterScreenSpaceRefractionSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DepthOfFieldGuide_Subrect_Base_X, pInDlssDEvalParams->InDepthOfFieldGuideSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DepthOfFieldGuide_Subrect_Base_Y, pInDlssDEvalParams->InDepthOfFieldGuideSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeDepthOfField_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeDepthOfFieldSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeDepthOfField_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeDepthOfFieldSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterDepthOfField_Subrect_Base_X, pInDlssDEvalParams->InColorAfterDepthOfFieldSubtectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterDepthOfField_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterDepthOfFieldSubtectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseHitDistance_Subrect_Base_X, pInDlssDEvalParams->InDiffuseHitDistanceSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseHitDistance_Subrect_Base_Y, pInDlssDEvalParams->InDiffuseHitDistanceSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularHitDistance_Subrect_Base_X, pInDlssDEvalParams->InSpecularHitDistanceSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularHitDistance_Subrect_Base_Y, pInDlssDEvalParams->InSpecularHitDistanceSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirection_Subrect_Base_X, pInDlssDEvalParams->InDiffuseRayDirectionSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirection_Subrect_Base_Y, pInDlssDEvalParams->InDiffuseRayDirectionSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirection_Subrect_Base_X, pInDlssDEvalParams->InSpecularRayDirectionSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirection_Subrect_Base_Y, pInDlssDEvalParams->InSpecularRayDirectionSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirectionHitDistance_Subrect_Base_X, pInDlssDEvalParams->InDiffuseRayDirectionHitDistanceSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirectionHitDistance_Subrect_Base_Y, pInDlssDEvalParams->InDiffuseRayDirectionHitDistanceSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirectionHitDistance_Subrect_Base_X, pInDlssDEvalParams->InSpecularRayDirectionHitDistanceSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirectionHitDistance_Subrect_Base_Y, pInDlssDEvalParams->InSpecularRayDirectionHitDistanceSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_WORLD_TO_VIEW_MATRIX, pInDlssDEvalParams->pInWorldToViewMatrix);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_VIEW_TO_CLIP_MATRIX, pInDlssDEvalParams->pInViewToClipMatrix);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayer, pInDlssDEvalParams->pInTransparencyLayer);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerOpacity, pInDlssDEvalParams->pInTransparencyLayerOpacity);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerMvecs, pInDlssDEvalParams->pInTransparencyLayerMvecs);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSS_DisocclusionMask, pInDlssDEvalParams->pInDisocclusionMask);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_Parameter_DLSSD_ResponsivityMask, pInDlssDEvalParams->pInResponsivityMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayer_Subrect_Base_X, pInDlssDEvalParams->InTransparencyLayerSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayer_Subrect_Base_Y, pInDlssDEvalParams->InTransparencyLayerSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerOpacity_Subrect_Base_X, pInDlssDEvalParams->InTransparencyLayerOpacitySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerOpacity_Subrect_Base_Y, pInDlssDEvalParams->InTransparencyLayerOpacitySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerMvecs_Subrect_Base_X, pInDlssDEvalParams->InTransparencyLayerMvecsSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerMvecs_Subrect_Base_Y, pInDlssDEvalParams->InTransparencyLayerMvecsSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_DisocclusionMask_Subrect_Base_X, pInDlssDEvalParams->InDisocclusionMaskSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_DisocclusionMask_Subrect_Base_Y, pInDlssDEvalParams->InDisocclusionMaskSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ResponsivityMask_Subrect_Base_X, pInDlssDEvalParams->InResponsivityMaskSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ResponsivityMask_Subrect_Base_Y, pInDlssDEvalParams->InResponsivityMaskSubrectBase.Y);
+
+ return NVSDK_NGX_D3D12_EvaluateFeature_C(pInCmdList, pInHandle, pInParams, NULL);
+}
+
+#endif // NVSDK_NGX_HELPERS_DLSSD_H
diff --git a/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_dlssd_cuda.h b/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_dlssd_cuda.h
new file mode 100644
index 0000000..e3fc446
--- /dev/null
+++ b/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_dlssd_cuda.h
@@ -0,0 +1,364 @@
+/*
+ * SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
+ *
+ * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
+ * property and proprietary rights in and to this material, related
+ * documentation and any modifications thereto. Any use, reproduction,
+ * disclosure or distribution of this material and related documentation
+ * without an express license agreement from NVIDIA CORPORATION or
+ * its affiliates is strictly prohibited.
+ */
+
+#ifndef NVSDK_NGX_HELPERS_DLSSD_CUDA_H
+#define NVSDK_NGX_HELPERS_DLSSD_CUDA_H
+#pragma once
+
+#include "nvsdk_ngx_helpers.h"
+#include "nvsdk_ngx_defs_dlssd.h"
+#include "nvsdk_ngx_params_dlssd.h"
+#if 1
+static inline NVSDK_NGX_Result NGX_DLSSD_GET_STATS_2(
+ NVSDK_NGX_Parameter* pInParams,
+ unsigned long long* pVRAMAllocatedBytes,
+ unsigned int* pOptLevel, unsigned int* IsDevSnippetBranch)
+{
+ void* Callback = NULL;
+ NVSDK_NGX_Parameter_GetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSDGetStatsCallback, &Callback);
+ if (!Callback)
+ {
+ // Possible reasons for this:
+ // - Installed DLSS is out of date and does not support the feature we need
+ // - You used NVSDK_NGX_AllocateParameters() for creating InParams. Try using NVSDK_NGX_GetCapabilityParameters() instead
+ return NVSDK_NGX_Result_FAIL_OutOfDate;
+ }
+
+ NVSDK_NGX_Result Res = NVSDK_NGX_Result_Success;
+ PFN_NVSDK_NGX_DLSS_GetStatsCallback PFNCallback = (PFN_NVSDK_NGX_DLSS_GetStatsCallback)Callback;
+ Res = PFNCallback(pInParams);
+ if (NVSDK_NGX_FAILED(Res))
+ {
+ return Res;
+ }
+ NVSDK_NGX_Parameter_GetULL(pInParams, NVSDK_NGX_Parameter_SizeInBytes, pVRAMAllocatedBytes);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_EParameter_OptLevel, pOptLevel);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_EParameter_IsDevSnippetBranch, IsDevSnippetBranch);
+ return Res;
+}
+
+static inline NVSDK_NGX_Result NGX_DLSSD_GET_STATS_1(
+ NVSDK_NGX_Parameter* pInParams,
+ unsigned long long* pVRAMAllocatedBytes,
+ unsigned int* pOptLevel)
+{
+ unsigned int dummy = 0;
+ return NGX_DLSSD_GET_STATS_2(pInParams, pVRAMAllocatedBytes, pOptLevel, &dummy);
+}
+
+static inline NVSDK_NGX_Result NGX_DLSSD_GET_STATS(
+ NVSDK_NGX_Parameter* pInParams,
+ unsigned long long* pVRAMAllocatedBytes)
+{
+ unsigned int dummy = 0;
+ return NGX_DLSSD_GET_STATS_2(pInParams, pVRAMAllocatedBytes, &dummy, &dummy);
+}
+#endif
+
+static inline NVSDK_NGX_Result NGX_DLSSD_GET_OPTIMAL_SETTINGS(
+ NVSDK_NGX_Parameter* pInParams,
+ unsigned int InUserSelectedWidth,
+ unsigned int InUserSelectedHeight,
+ NVSDK_NGX_PerfQuality_Value InPerfQualityValue,
+ unsigned int* pOutRenderOptimalWidth,
+ unsigned int* pOutRenderOptimalHeight,
+ unsigned int* pOutRenderMaxWidth,
+ unsigned int* pOutRenderMaxHeight,
+ unsigned int* pOutRenderMinWidth,
+ unsigned int* pOutRenderMinHeight,
+ float* pOutSharpness)
+{
+ void* Callback = NULL;
+ NVSDK_NGX_Parameter_GetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSDOptimalSettingsCallback, &Callback);
+ if (!Callback)
+ {
+ // Possible reasons for this:
+ // - Installed DLSS is out of date and does not support the feature we need
+ // - You used NVSDK_NGX_AllocateParameters() for creating InParams. Try using NVSDK_NGX_GetCapabilityParameters() instead
+ return NVSDK_NGX_Result_FAIL_OutOfDate;
+ }
+
+ // These are selections made by user in UI
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, InUserSelectedWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, InUserSelectedHeight);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, InPerfQualityValue);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_RTXValue, false); // Some older DLSS dlls still expect this value to be set
+
+ NVSDK_NGX_Result Res = NVSDK_NGX_Result_Success;
+ PFN_NVSDK_NGX_DLSS_GetOptimalSettingsCallback PFNCallback = (PFN_NVSDK_NGX_DLSS_GetOptimalSettingsCallback)Callback;
+ Res = PFNCallback(pInParams);
+ if (NVSDK_NGX_FAILED(Res))
+ {
+ return Res;
+ }
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pOutRenderOptimalWidth);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pOutRenderOptimalHeight);
+ // If we have an older DLSS Dll those might need to be set to the optimal dimensions instead
+ *pOutRenderMaxWidth = *pOutRenderOptimalWidth;
+ *pOutRenderMaxHeight = *pOutRenderOptimalHeight;
+ *pOutRenderMinWidth = *pOutRenderOptimalWidth;
+ *pOutRenderMinHeight = *pOutRenderOptimalHeight;
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Max_Render_Width, pOutRenderMaxWidth);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Max_Render_Height, pOutRenderMaxHeight);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Width, pOutRenderMinWidth);
+ NVSDK_NGX_Parameter_GetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Get_Dynamic_Min_Render_Height, pOutRenderMinHeight);
+ NVSDK_NGX_Parameter_GetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pOutSharpness);
+ return Res;
+}
+
+typedef struct NVSDK_NGX_CUDA_GBuffer
+{
+ CUtexObject* pInAttrib[NVSDK_NGX_GBUFFERTYPE_NUM];
+} NVSDK_NGX_CUDA_GBuffer;
+
+typedef struct NVSDK_NGX_CUDA_DLSSD_Create_Params
+{
+ NVSDK_NGX_DLSSD_Create_Params Feature;
+ void* InCUContext;
+ void* InCUStream;
+} NVSDK_NGX_CUDA_DLSSD_Create_Params;
+
+static inline NVSDK_NGX_Result NGX_CUDA_CREATE_DLSSD_EXT(
+ NVSDK_NGX_Handle** ppOutHandle,
+ NVSDK_NGX_Parameter* pInParams,
+ NVSDK_NGX_CUDA_DLSSD_Create_Params* pInDlssDCreateParams)
+{
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Input1, pInDlssDCreateParams->InCUContext);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Input2, pInDlssDCreateParams->InCUStream);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pInDlssDCreateParams->Feature.InWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pInDlssDCreateParams->Feature.InHeight);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pInDlssDCreateParams->Feature.InTargetWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pInDlssDCreateParams->Feature.InTargetHeight);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, pInDlssDCreateParams->Feature.InPerfQualityValue);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Feature_Create_Flags, pInDlssDCreateParams->Feature.InFeatureCreateFlags);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Enable_Output_Subrects, pInDlssDCreateParams->Feature.InEnableOutputSubrects ? 1 : 0);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Denoise_Mode, NVSDK_NGX_DLSS_Denoise_Mode_DLUnified);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Roughness_Mode, pInDlssDCreateParams->Feature.InRoughnessMode);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Use_HW_Depth, pInDlssDCreateParams->Feature.InUseHWDepth);
+ return NVSDK_NGX_CUDA_CreateFeature(NVSDK_NGX_Feature_RayReconstruction, pInParams, ppOutHandle);
+}
+
+static inline NVSDK_NGX_Result NGX_CUDA_CREATE_DLSSD_EXT1(
+ NVSDK_NGX_CUDADevice *InDevice,
+ NVSDK_NGX_Handle** ppOutHandle,
+ NVSDK_NGX_Parameter* pInParams,
+ NVSDK_NGX_CUDA_DLSSD_Create_Params* pInDlssDCreateParams)
+{
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Input1, pInDlssDCreateParams->InCUContext);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Input2, pInDlssDCreateParams->InCUStream);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pInDlssDCreateParams->Feature.InWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pInDlssDCreateParams->Feature.InHeight);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pInDlssDCreateParams->Feature.InTargetWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pInDlssDCreateParams->Feature.InTargetHeight);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, pInDlssDCreateParams->Feature.InPerfQualityValue);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Feature_Create_Flags, pInDlssDCreateParams->Feature.InFeatureCreateFlags);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Enable_Output_Subrects, pInDlssDCreateParams->Feature.InEnableOutputSubrects ? 1 : 0);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Denoise_Mode, NVSDK_NGX_DLSS_Denoise_Mode_DLUnified);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Roughness_Mode, pInDlssDCreateParams->Feature.InRoughnessMode);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Use_HW_Depth, pInDlssDCreateParams->Feature.InUseHWDepth);
+ return NVSDK_NGX_CUDA_CreateFeature1(InDevice, NVSDK_NGX_Feature_RayReconstruction, pInParams, ppOutHandle);
+}
+
+typedef struct NVSDK_NGX_CUDA_DLSSD_Eval_Params
+{
+ void* pInDiffuseAlbedo;
+ void* pInSpecularAlbedo;
+ void* pInNormals;
+ void* pInRoughness;
+
+ void* pInColor;
+ void* pInOutput;
+ void* pInDepth;
+ void* pInMotionVectors;
+ float InJitterOffsetX; /* Jitter offset must be in input/render pixel space */
+ float InJitterOffsetY;
+ NVSDK_NGX_Dimensions InRenderSubrectDimensions;
+ /*** OPTIONAL - leave to 0/0.0f if unused ***/
+ int InReset; /* Set to 1 when scene changes completely (new level etc) */
+ float InMVScaleX; /* If MVs need custom scaling to convert to pixel space */
+ float InMVScaleY;
+ void* pInTransparencyMask; /* Unused/Reserved for future use */
+ void* pInExposureTexture;
+ void* pInBiasCurrentColorMask;
+ NVSDK_NGX_Coordinates InDiffuseAlbedoSubrectBase;
+ NVSDK_NGX_Coordinates InSpecularAlbedoSubrectBase;
+ NVSDK_NGX_Coordinates InNormalsSubrectBase;
+ NVSDK_NGX_Coordinates InRoughnessSubrectBase;
+ NVSDK_NGX_Coordinates InColorSubrectBase;
+ NVSDK_NGX_Coordinates InDepthSubrectBase;
+ NVSDK_NGX_Coordinates InMVSubrectBase;
+ NVSDK_NGX_Coordinates InTranslucencySubrectBase;
+ NVSDK_NGX_Coordinates InBiasCurrentColorSubrectBase;
+ NVSDK_NGX_Coordinates InOutputSubrectBase;
+
+ void* pInReflectedAlbedo;
+ void* pInColorBeforeParticles;
+ void* pInColorBeforeTransparency;
+ void* pInColorBeforeFog;
+ void* pInDiffuseHitDistance;
+ void* pInSpecularHitDistance;
+ void* pInDiffuseRayDirection;
+ void* pInSpecularRayDirection;
+ void* pInDiffuseRayDirectionHitDistance;
+ void* pInSpecularRayDirectionHitDistance;
+ NVSDK_NGX_Coordinates InReflectedAlbedoSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeParticlesSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeTransparencySubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeFogSubrectBase;
+ NVSDK_NGX_Coordinates InDiffuseHitDistanceSubrectBase;
+ NVSDK_NGX_Coordinates InSpecularHitDistanceSubrectBase;
+ NVSDK_NGX_Coordinates InDiffuseRayDirectionSubrectBase;
+ NVSDK_NGX_Coordinates InSpecularRayDirectionSubrectBase;
+ NVSDK_NGX_Coordinates InDiffuseRayDirectionHitDistanceSubrectBase;
+ NVSDK_NGX_Coordinates InSpecularRayDirectionHitDistanceSubrectBase;
+ float* pInWorldToViewMatrix;
+ float* pInViewToClipMatrix;
+
+ float InPreExposure;
+ float InExposureScale;
+ int InIndicatorInvertXAxis;
+ int InIndicatorInvertYAxis;
+ /*** OPTIONAL - only for research purposes ***/
+ NVSDK_NGX_CUDA_GBuffer GBufferSurface;
+ NVSDK_NGX_ToneMapperType InToneMapperType;
+ void* pInMotionVectors3D;
+ void* pInIsParticleMask; /* to identify which pixels contains particles, essentially that are not drawn as part of base pass */
+ void* pInAnimatedTextureMask; /* a binary mask covering pixels occupied by animated textures */
+ void* pInDepthHighRes;
+ void* pInPositionViewSpace;
+ float InFrameTimeDeltaInMsec; /* helps in determining the amount to denoise or anti-alias based on the speed of the object from motion vector magnitudes and fps as determined by this delta */
+ void* pInRayTracingHitDistance; /* for each effect - approximation to the amount of noise in a ray-traced color */
+ void* pInMotionVectorsReflections; /* motion vectors of reflected objects like for mirrored surfaces */
+ void* pInTransparencyLayer; /* optional input res particle layer */
+ NVSDK_NGX_Coordinates InTransparencyLayerSubrectBase;
+ void* pInTransparencyLayerOpacity; /* optional input res particle opacity layer */
+ NVSDK_NGX_Coordinates InTransparencyLayerOpacitySubrectBase;
+} NVSDK_NGX_CUDA_DLSSD_Eval_Params;
+
+static inline NVSDK_NGX_Result NGX_CUDA_EVALUATE_DLSSD_EXT(
+ NVSDK_NGX_Handle* pInHandle,
+ NVSDK_NGX_Parameter* pInParams,
+ NVSDK_NGX_CUDA_DLSSD_Eval_Params* pInDlssDEvalParams)
+{
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Color, pInDlssDEvalParams->pInColor);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Output, pInDlssDEvalParams->pInOutput);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Depth, pInDlssDEvalParams->pInDepth);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_MotionVectors, pInDlssDEvalParams->pInMotionVectors);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_X, pInDlssDEvalParams->InJitterOffsetX);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_Y, pInDlssDEvalParams->InJitterOffsetY);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_Reset, pInDlssDEvalParams->InReset);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_X, pInDlssDEvalParams->InMVScaleX == 0.0f ? 1.0f : pInDlssDEvalParams->InMVScaleX);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_Y, pInDlssDEvalParams->InMVScaleY == 0.0f ? 1.0f : pInDlssDEvalParams->InMVScaleY);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_TransparencyMask, pInDlssDEvalParams->pInTransparencyMask);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_ExposureTexture, pInDlssDEvalParams->pInExposureTexture);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_Mask, pInDlssDEvalParams->pInBiasCurrentColorMask);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Albedo, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ALBEDO]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Roughness, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ROUGHNESS]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Metallic, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_METALLIC]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Specular, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SPECULAR]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Subsurface, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SUBSURFACE]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Normals, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_NORMALS]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_ShadingModelId, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SHADINGMODELID]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_MaterialId, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_MATERIALID]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_8, pInDlssDEvalParams->GBufferSurface.pInAttrib[8]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_9, pInDlssDEvalParams->GBufferSurface.pInAttrib[9]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_11, pInDlssDEvalParams->GBufferSurface.pInAttrib[11]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_12, pInDlssDEvalParams->GBufferSurface.pInAttrib[12]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_13, pInDlssDEvalParams->GBufferSurface.pInAttrib[13]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_14, pInDlssDEvalParams->GBufferSurface.pInAttrib[14]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_15, pInDlssDEvalParams->GBufferSurface.pInAttrib[15]);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_TonemapperType, pInDlssDEvalParams->InToneMapperType);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_MotionVectors3D, pInDlssDEvalParams->pInMotionVectors3D);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_IsParticleMask, pInDlssDEvalParams->pInIsParticleMask);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_AnimatedTextureMask, pInDlssDEvalParams->pInAnimatedTextureMask);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DepthHighRes, pInDlssDEvalParams->pInDepthHighRes);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Position_ViewSpace, pInDlssDEvalParams->pInPositionViewSpace);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_FrameTimeDeltaInMsec, pInDlssDEvalParams->InFrameTimeDeltaInMsec);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_RayTracingHitDistance, pInDlssDEvalParams->pInRayTracingHitDistance);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_SpecularMvec, pInDlssDEvalParams->pInMotionVectorsReflections);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_X, pInDlssDEvalParams->InColorSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_Y, pInDlssDEvalParams->InColorSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_X, pInDlssDEvalParams->InDepthSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_Y, pInDlssDEvalParams->InDepthSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_X, pInDlssDEvalParams->InMVSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_Y, pInDlssDEvalParams->InMVSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_X, pInDlssDEvalParams->InTranslucencySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_Y, pInDlssDEvalParams->InTranslucencySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_X, pInDlssDEvalParams->InBiasCurrentColorSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_Y, pInDlssDEvalParams->InBiasCurrentColorSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_X, pInDlssDEvalParams->InOutputSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_Y, pInDlssDEvalParams->InOutputSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Width, pInDlssDEvalParams->InRenderSubrectDimensions.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Height, pInDlssDEvalParams->InRenderSubrectDimensions.Height);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Pre_Exposure, pInDlssDEvalParams->InPreExposure == 0.0f ? 1.0f : pInDlssDEvalParams->InPreExposure);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Exposure_Scale, pInDlssDEvalParams->InExposureScale == 0.0f ? 1.0f : pInDlssDEvalParams->InExposureScale);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_X_Axis, pInDlssDEvalParams->InIndicatorInvertXAxis);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_Y_Axis, pInDlssDEvalParams->InIndicatorInvertYAxis);
+
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Emissive, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_EMISSIVE]);
+
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DiffuseAlbedo, pInDlssDEvalParams->pInDiffuseAlbedo);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_SpecularAlbedo, pInDlssDEvalParams->pInSpecularAlbedo);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_DiffuseAlbedo_Subrect_Base_X, pInDlssDEvalParams->InDiffuseAlbedoSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_DiffuseAlbedo_Subrect_Base_Y, pInDlssDEvalParams->InDiffuseAlbedoSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_SpecularAlbedo_Subrect_Base_X, pInDlssDEvalParams->InSpecularAlbedoSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_SpecularAlbedo_Subrect_Base_Y, pInDlssDEvalParams->InSpecularAlbedoSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Normals_Subrect_Base_X, pInDlssDEvalParams->InNormalsSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Normals_Subrect_Base_Y, pInDlssDEvalParams->InNormalsSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Roughness_Subrect_Base_X, pInDlssDEvalParams->InRoughnessSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Roughness_Subrect_Base_Y, pInDlssDEvalParams->InRoughnessSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Normals, pInDlssDEvalParams->pInNormals);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Roughness, pInDlssDEvalParams->pInRoughness);
+
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ReflectedAlbedo, pInDlssDEvalParams->pInReflectedAlbedo);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeParticles, pInDlssDEvalParams->pInColorBeforeParticles);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeTransparency, pInDlssDEvalParams->pInColorBeforeTransparency);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeFog, pInDlssDEvalParams->pInColorBeforeFog);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseHitDistance, pInDlssDEvalParams->pInDiffuseHitDistance);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularHitDistance, pInDlssDEvalParams->pInSpecularHitDistance);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirection, pInDlssDEvalParams->pInDiffuseRayDirection);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirection, pInDlssDEvalParams->pInSpecularRayDirection);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirectionHitDistance, pInDlssDEvalParams->pInDiffuseRayDirectionHitDistance);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirectionHitDistance, pInDlssDEvalParams->pInSpecularRayDirectionHitDistance);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ReflectedAlbedo_Subrect_Base_X, pInDlssDEvalParams->InReflectedAlbedoSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ReflectedAlbedo_Subrect_Base_Y, pInDlssDEvalParams->InReflectedAlbedoSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeParticles_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeParticlesSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeParticles_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeParticlesSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeTransparency_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeTransparencySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeTransparency_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeTransparencySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeFog_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeFogSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeFog_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeFogSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseHitDistance_Subrect_Base_X, pInDlssDEvalParams->InDiffuseHitDistanceSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseHitDistance_Subrect_Base_Y, pInDlssDEvalParams->InDiffuseHitDistanceSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularHitDistance_Subrect_Base_X, pInDlssDEvalParams->InSpecularHitDistanceSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularHitDistance_Subrect_Base_Y, pInDlssDEvalParams->InSpecularHitDistanceSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirection_Subrect_Base_X, pInDlssDEvalParams->InDiffuseRayDirectionSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirection_Subrect_Base_Y, pInDlssDEvalParams->InDiffuseRayDirectionSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirection_Subrect_Base_X, pInDlssDEvalParams->InSpecularRayDirectionSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirection_Subrect_Base_Y, pInDlssDEvalParams->InSpecularRayDirectionSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirectionHitDistance_Subrect_Base_X, pInDlssDEvalParams->InDiffuseRayDirectionHitDistanceSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirectionHitDistance_Subrect_Base_Y, pInDlssDEvalParams->InDiffuseRayDirectionHitDistanceSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirectionHitDistance_Subrect_Base_X, pInDlssDEvalParams->InSpecularRayDirectionHitDistanceSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirectionHitDistance_Subrect_Base_Y, pInDlssDEvalParams->InSpecularRayDirectionHitDistanceSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_WORLD_TO_VIEW_MATRIX, pInDlssDEvalParams->pInWorldToViewMatrix);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_VIEW_TO_CLIP_MATRIX, pInDlssDEvalParams->pInViewToClipMatrix);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayer, pInDlssDEvalParams->pInTransparencyLayer);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerOpacity, pInDlssDEvalParams->pInTransparencyLayerOpacity);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayer_Subrect_Base_X, pInDlssDEvalParams->InTransparencyLayerSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayer_Subrect_Base_Y, pInDlssDEvalParams->InTransparencyLayerSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerOpacity_Subrect_Base_X, pInDlssDEvalParams->InTransparencyLayerOpacitySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerOpacity_Subrect_Base_Y, pInDlssDEvalParams->InTransparencyLayerOpacitySubrectBase.Y);
+
+ return NVSDK_NGX_CUDA_EvaluateFeature_C(pInHandle, pInParams, NULL);
+}
+
+#endif // NVSDK_NGX_HELPERS_DLSSD_CUDA_H
diff --git a/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_dlssd_vk.h b/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_dlssd_vk.h
new file mode 100644
index 0000000..7ebe159
--- /dev/null
+++ b/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_dlssd_vk.h
@@ -0,0 +1,379 @@
+/*
+ * SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
+ *
+ * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
+ * property and proprietary rights in and to this material, related
+ * documentation and any modifications thereto. Any use, reproduction,
+ * disclosure or distribution of this material and related documentation
+ * without an express license agreement from NVIDIA CORPORATION or
+ * its affiliates is strictly prohibited.
+ */
+
+#ifndef NVSDK_NGX_HELPERS_DLSSD_VK_H
+#define NVSDK_NGX_HELPERS_DLSSD_VK_H
+#pragma once
+
+#include "nvsdk_ngx_vk.h"
+#include "nvsdk_ngx_defs_dlssd.h"
+#include "nvsdk_ngx_params_dlssd.h"
+
+typedef struct NVSDK_NGX_VK_DLSSD_Eval_Params
+{
+ NVSDK_NGX_Resource_VK* pInDiffuseAlbedo;
+ NVSDK_NGX_Resource_VK* pInSpecularAlbedo;
+ NVSDK_NGX_Resource_VK* pInNormals;
+ NVSDK_NGX_Resource_VK* pInRoughness;
+
+ NVSDK_NGX_Resource_VK* pInColor;
+ NVSDK_NGX_Resource_VK* pInAlpha;
+ NVSDK_NGX_Resource_VK* pInOutput;
+ NVSDK_NGX_Resource_VK* pInOutputAlpha;
+ NVSDK_NGX_Resource_VK * pInDepth;
+ NVSDK_NGX_Resource_VK * pInMotionVectors;
+ float InJitterOffsetX; /* Jitter offset must be in input/render pixel space */
+ float InJitterOffsetY;
+ NVSDK_NGX_Dimensions InRenderSubrectDimensions;
+ /*** OPTIONAL - leave to 0/0.0f if unused ***/
+ int InReset; /* Set to 1 when scene changes completely (new level etc) */
+ float InMVScaleX; /* If MVs need custom scaling to convert to pixel space */
+ float InMVScaleY;
+ NVSDK_NGX_Resource_VK * pInTransparencyMask; /* Unused/Reserved for future use */
+ NVSDK_NGX_Resource_VK * pInExposureTexture;
+ NVSDK_NGX_Resource_VK * pInBiasCurrentColorMask;
+ NVSDK_NGX_Coordinates InAlphaSubrectBase;
+ NVSDK_NGX_Coordinates InOutputAlphaSubrectBase;
+ NVSDK_NGX_Coordinates InDiffuseAlbedoSubrectBase;
+ NVSDK_NGX_Coordinates InSpecularAlbedoSubrectBase;
+ NVSDK_NGX_Coordinates InNormalsSubrectBase;
+ NVSDK_NGX_Coordinates InRoughnessSubrectBase;
+ NVSDK_NGX_Coordinates InColorSubrectBase;
+ NVSDK_NGX_Coordinates InDepthSubrectBase;
+ NVSDK_NGX_Coordinates InMVSubrectBase;
+ NVSDK_NGX_Coordinates InTranslucencySubrectBase;
+ NVSDK_NGX_Coordinates InBiasCurrentColorSubrectBase;
+ NVSDK_NGX_Coordinates InOutputSubrectBase;
+ float InPreExposure;
+ float InExposureScale;
+ int InIndicatorInvertXAxis;
+ int InIndicatorInvertYAxis;
+ /*** OPTIONAL - only for research purposes ***/
+
+ NVSDK_NGX_Resource_VK* pInReflectedAlbedo;
+ NVSDK_NGX_Resource_VK* pInColorBeforeParticles;
+ NVSDK_NGX_Resource_VK* pInColorAfterParticles;
+ NVSDK_NGX_Resource_VK* pInColorBeforeTransparency;
+ NVSDK_NGX_Resource_VK* pInColorAfterTransparency;
+ NVSDK_NGX_Resource_VK* pInColorBeforeFog;
+ NVSDK_NGX_Resource_VK* pInColorAfterFog;
+ NVSDK_NGX_Resource_VK* pInScreenSpaceSubsurfaceScatteringGuide;
+ NVSDK_NGX_Resource_VK* pInColorBeforeScreenSpaceSubsurfaceScattering;
+ NVSDK_NGX_Resource_VK* pInColorAfterScreenSpaceSubsurfaceScattering;
+ NVSDK_NGX_Resource_VK* pInScreenSpaceRefractionGuide;
+ NVSDK_NGX_Resource_VK* pInColorBeforeScreenSpaceRefraction;
+ NVSDK_NGX_Resource_VK* pInColorAfterScreenSpaceRefraction;
+ NVSDK_NGX_Resource_VK* pInDepthOfFieldGuide;
+ NVSDK_NGX_Resource_VK* pInColorBeforeDepthOfField;
+ NVSDK_NGX_Resource_VK* pInColorAfterDepthOfField;
+ NVSDK_NGX_Resource_VK* pInDiffuseHitDistance;
+ NVSDK_NGX_Resource_VK* pInSpecularHitDistance;
+ NVSDK_NGX_Resource_VK* pInDiffuseRayDirection;
+ NVSDK_NGX_Resource_VK* pInSpecularRayDirection;
+ NVSDK_NGX_Resource_VK* pInDiffuseRayDirectionHitDistance;
+ NVSDK_NGX_Resource_VK* pInSpecularRayDirectionHitDistance;
+ NVSDK_NGX_Coordinates InReflectedAlbedoSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeParticlesSubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterParticlesSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeTransparencySubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterTransparencySubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeFogSubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterFogSubrectBase;
+ NVSDK_NGX_Coordinates InScreenSpaceSubsurfaceScatteringGuideSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeScreenSpaceSubsurfaceScatteringSubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterScreenSpaceSubsurfaceScatteringSubrectBase;
+ NVSDK_NGX_Coordinates InScreenSpaceRefractionGuideSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeScreenSpaceRefractionSubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterScreenSpaceRefractionSubrectBase;
+ NVSDK_NGX_Coordinates InDepthOfFieldGuideSubrectBase;
+ NVSDK_NGX_Coordinates InColorBeforeDepthOfFieldSubrectBase;
+ NVSDK_NGX_Coordinates InColorAfterDepthOfFieldSubrectBase;
+ NVSDK_NGX_Coordinates InDiffuseHitDistanceSubrectBase;
+ NVSDK_NGX_Coordinates InSpecularHitDistanceSubrectBase;
+ NVSDK_NGX_Coordinates InDiffuseRayDirectionSubrectBase;
+ NVSDK_NGX_Coordinates InSpecularRayDirectionSubrectBase;
+ NVSDK_NGX_Coordinates InDiffuseRayDirectionHitDistanceSubrectBase;
+ NVSDK_NGX_Coordinates InSpecularRayDirectionHitDistanceSubrectBase;
+ float* pInWorldToViewMatrix;
+ float* pInViewToClipMatrix;
+
+ NVSDK_NGX_VK_GBuffer GBufferSurface;
+ NVSDK_NGX_ToneMapperType InToneMapperType;
+ NVSDK_NGX_Resource_VK * pInMotionVectors3D;
+ NVSDK_NGX_Resource_VK * pInIsParticleMask; /* to identify which pixels contains particles, essentially that are not drawn as part of base pass */
+ NVSDK_NGX_Resource_VK * pInAnimatedTextureMask; /* a binary mask covering pixels occupied by animated textures */
+ NVSDK_NGX_Resource_VK * pInDepthHighRes;
+ NVSDK_NGX_Resource_VK * pInPositionViewSpace;
+ float InFrameTimeDeltaInMsec; /* helps in determining the amount to denoise or anti-alias based on the speed of the object from motion vector magnitudes and fps as determined by this delta */
+ NVSDK_NGX_Resource_VK * pInRayTracingHitDistance; /* for each effect - approximation to the amount of noise in a ray-traced color */
+ NVSDK_NGX_Resource_VK * pInMotionVectorsReflections; /* motion vectors of reflected objects like for mirrored surfaces */
+ NVSDK_NGX_Resource_VK* pInTransparencyLayer; /* optional input res particle layer */
+ NVSDK_NGX_Coordinates InTransparencyLayerSubrectBase;
+ NVSDK_NGX_Resource_VK* pInTransparencyLayerOpacity; /* optional input res particle opacity layer */
+ NVSDK_NGX_Coordinates InTransparencyLayerOpacitySubrectBase;
+ NVSDK_NGX_Resource_VK* pInTransparencyLayerMvecs; /* optional input res transparency layer mvecs */
+ NVSDK_NGX_Coordinates InTransparencyLayerMvecsSubrectBase;
+ NVSDK_NGX_Resource_VK* pInDisocclusionMask; /* optional input res disocclusion mask */
+ NVSDK_NGX_Coordinates InDisocclusionMaskSubrectBase;
+ NVSDK_NGX_Resource_VK* pInResponsivityMask; /* optional input res responsivity mask; one channel, R16F or R8 SNORM */
+ NVSDK_NGX_Coordinates InResponsivityMaskSubrectBase;
+} NVSDK_NGX_VK_DLSSD_Eval_Params;
+
+static inline NVSDK_NGX_Result NGX_VULKAN_CREATE_DLSSD_EXT1(
+ VkDevice InDevice,
+ VkCommandBuffer InCmdList,
+ unsigned int InCreationNodeMask,
+ unsigned int InVisibilityNodeMask,
+ NVSDK_NGX_Handle **ppOutHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_DLSSD_Create_Params *pInDlssDCreateParams)
+{
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_CreationNodeMask, InCreationNodeMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_VisibilityNodeMask, InVisibilityNodeMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pInDlssDCreateParams->InWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pInDlssDCreateParams->InHeight);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pInDlssDCreateParams->InTargetWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pInDlssDCreateParams->InTargetHeight);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, pInDlssDCreateParams->InPerfQualityValue);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Feature_Create_Flags, pInDlssDCreateParams->InFeatureCreateFlags);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Enable_Output_Subrects, pInDlssDCreateParams->InEnableOutputSubrects ? 1 : 0);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Denoise_Mode, NVSDK_NGX_DLSS_Denoise_Mode_DLUnified);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Roughness_Mode, pInDlssDCreateParams->InRoughnessMode);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Use_HW_Depth, pInDlssDCreateParams->InUseHWDepth);
+
+ if (InDevice) return NVSDK_NGX_VULKAN_CreateFeature1(InDevice, InCmdList, NVSDK_NGX_Feature_RayReconstruction, pInParams, ppOutHandle);
+ else return NVSDK_NGX_VULKAN_CreateFeature(InCmdList, NVSDK_NGX_Feature_RayReconstruction, pInParams, ppOutHandle);
+}
+
+static inline NVSDK_NGX_Result NGX_VULKAN_EVALUATE_DLSSD_EXT(
+ VkCommandBuffer InCmdList,
+ NVSDK_NGX_Handle *pInHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_VK_DLSSD_Eval_Params *pInDlssDEvalParams)
+{
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInColor);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInAlpha);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInMotionVectors);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInOutput);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInOutputAlpha);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInDepth);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInDiffuseAlbedo);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInSpecularAlbedo);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInTransparencyMask);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInExposureTexture);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInBiasCurrentColorMask);
+ for (size_t i = 0; i <= 15; i++)
+ {
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->GBufferSurface.pInAttrib[i]);
+ }
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInMotionVectors3D);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInIsParticleMask);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInAnimatedTextureMask);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInDepthHighRes);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInPositionViewSpace);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInRayTracingHitDistance);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInMotionVectorsReflections);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInReflectedAlbedo);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInColorBeforeParticles);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInColorAfterParticles);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInColorBeforeTransparency);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInColorAfterTransparency);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInColorBeforeFog);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInColorAfterFog);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInScreenSpaceSubsurfaceScatteringGuide);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInColorBeforeScreenSpaceSubsurfaceScattering);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInColorAfterScreenSpaceSubsurfaceScattering);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInScreenSpaceRefractionGuide);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInColorBeforeScreenSpaceRefraction);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInColorAfterScreenSpaceRefraction);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInDepthOfFieldGuide);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInColorBeforeDepthOfField);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInColorAfterDepthOfField);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInDiffuseHitDistance);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInSpecularHitDistance);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInDiffuseRayDirection);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInSpecularRayDirection);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInDiffuseRayDirectionHitDistance);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInSpecularRayDirectionHitDistance);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInTransparencyLayer);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInTransparencyLayerOpacity);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInTransparencyLayerMvecs);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInDisocclusionMask);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssDEvalParams->pInResponsivityMask);
+
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Color, pInDlssDEvalParams->pInColor);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Output, pInDlssDEvalParams->pInOutput);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Depth, pInDlssDEvalParams->pInDepth);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_MotionVectors, pInDlssDEvalParams->pInMotionVectors);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_X, pInDlssDEvalParams->InJitterOffsetX);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_Y, pInDlssDEvalParams->InJitterOffsetY);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_Reset, pInDlssDEvalParams->InReset);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_X, pInDlssDEvalParams->InMVScaleX == 0.0f ? 1.0f : pInDlssDEvalParams->InMVScaleX);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_Y, pInDlssDEvalParams->InMVScaleY == 0.0f ? 1.0f : pInDlssDEvalParams->InMVScaleY);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_TransparencyMask, pInDlssDEvalParams->pInTransparencyMask);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_ExposureTexture, pInDlssDEvalParams->pInExposureTexture);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_Mask, pInDlssDEvalParams->pInBiasCurrentColorMask);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Albedo, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ALBEDO]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Roughness, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ROUGHNESS]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Metallic, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_METALLIC]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Specular, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SPECULAR]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Subsurface, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SUBSURFACE]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Normals, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_NORMALS]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_ShadingModelId, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SHADINGMODELID]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_MaterialId, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_MATERIALID]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_8, pInDlssDEvalParams->GBufferSurface.pInAttrib[8]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_9, pInDlssDEvalParams->GBufferSurface.pInAttrib[9]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_SpecularMvec, pInDlssDEvalParams->pInMotionVectorsReflections);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_11, pInDlssDEvalParams->GBufferSurface.pInAttrib[11]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_12, pInDlssDEvalParams->GBufferSurface.pInAttrib[12]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_13, pInDlssDEvalParams->GBufferSurface.pInAttrib[13]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_14, pInDlssDEvalParams->GBufferSurface.pInAttrib[14]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_15, pInDlssDEvalParams->GBufferSurface.pInAttrib[15]);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_TonemapperType, pInDlssDEvalParams->InToneMapperType);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_MotionVectors3D, pInDlssDEvalParams->pInMotionVectors3D);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_IsParticleMask, pInDlssDEvalParams->pInIsParticleMask);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_AnimatedTextureMask, pInDlssDEvalParams->pInAnimatedTextureMask);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DepthHighRes, pInDlssDEvalParams->pInDepthHighRes);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Position_ViewSpace, pInDlssDEvalParams->pInPositionViewSpace);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_FrameTimeDeltaInMsec, pInDlssDEvalParams->InFrameTimeDeltaInMsec);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_RayTracingHitDistance, pInDlssDEvalParams->pInRayTracingHitDistance);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_X, pInDlssDEvalParams->InColorSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_Y, pInDlssDEvalParams->InColorSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_X, pInDlssDEvalParams->InDepthSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_Y, pInDlssDEvalParams->InDepthSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_X, pInDlssDEvalParams->InMVSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_Y, pInDlssDEvalParams->InMVSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_X, pInDlssDEvalParams->InTranslucencySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_Y, pInDlssDEvalParams->InTranslucencySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_X, pInDlssDEvalParams->InBiasCurrentColorSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_Y, pInDlssDEvalParams->InBiasCurrentColorSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_X, pInDlssDEvalParams->InOutputSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_Y, pInDlssDEvalParams->InOutputSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Width , pInDlssDEvalParams->InRenderSubrectDimensions.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Height, pInDlssDEvalParams->InRenderSubrectDimensions.Height);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Pre_Exposure, pInDlssDEvalParams->InPreExposure == 0.0f ? 1.0f : pInDlssDEvalParams->InPreExposure);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Exposure_Scale, pInDlssDEvalParams->InExposureScale == 0.0f ? 1.0f : pInDlssDEvalParams->InExposureScale);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_X_Axis, pInDlssDEvalParams->InIndicatorInvertXAxis);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_Y_Axis, pInDlssDEvalParams->InIndicatorInvertYAxis);
+
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Emissive, pInDlssDEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_EMISSIVE]);
+
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DiffuseAlbedo, pInDlssDEvalParams->pInDiffuseAlbedo);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_SpecularAlbedo, pInDlssDEvalParams->pInSpecularAlbedo);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Normals, pInDlssDEvalParams->pInNormals);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Roughness, pInDlssDEvalParams->pInRoughness);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_DiffuseAlbedo_Subrect_Base_X, pInDlssDEvalParams->InDiffuseAlbedoSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_DiffuseAlbedo_Subrect_Base_Y, pInDlssDEvalParams->InDiffuseAlbedoSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_SpecularAlbedo_Subrect_Base_X, pInDlssDEvalParams->InSpecularAlbedoSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_SpecularAlbedo_Subrect_Base_Y, pInDlssDEvalParams->InSpecularAlbedoSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Normals_Subrect_Base_X, pInDlssDEvalParams->InNormalsSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Normals_Subrect_Base_Y, pInDlssDEvalParams->InNormalsSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Roughness_Subrect_Base_X, pInDlssDEvalParams->InRoughnessSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Roughness_Subrect_Base_Y, pInDlssDEvalParams->InRoughnessSubrectBase.Y);
+
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_Alpha, pInDlssDEvalParams->pInAlpha);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_OutputAlpha, pInDlssDEvalParams->pInOutputAlpha);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ReflectedAlbedo, pInDlssDEvalParams->pInReflectedAlbedo);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeParticles, pInDlssDEvalParams->pInColorBeforeParticles);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterParticles, pInDlssDEvalParams->pInColorAfterParticles);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeTransparency, pInDlssDEvalParams->pInColorBeforeTransparency);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterTransparency, pInDlssDEvalParams->pInColorAfterTransparency);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeFog, pInDlssDEvalParams->pInColorBeforeFog);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterFog, pInDlssDEvalParams->pInColorAfterFog);
+
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceSubsurfaceScatteringGuide, pInDlssDEvalParams->pInScreenSpaceSubsurfaceScatteringGuide);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceSubsurfaceScattering, pInDlssDEvalParams->pInColorBeforeScreenSpaceSubsurfaceScattering);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceSubsurfaceScattering, pInDlssDEvalParams->pInColorAfterScreenSpaceSubsurfaceScattering);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceRefractionGuide, pInDlssDEvalParams->pInScreenSpaceRefractionGuide);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceRefraction, pInDlssDEvalParams->pInColorBeforeScreenSpaceRefraction);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceRefraction, pInDlssDEvalParams->pInColorAfterScreenSpaceRefraction);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_DepthOfFieldGuide, pInDlssDEvalParams->pInDepthOfFieldGuide);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeDepthOfField, pInDlssDEvalParams->pInColorBeforeDepthOfField);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterDepthOfField, pInDlssDEvalParams->pInColorAfterDepthOfField);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseHitDistance, pInDlssDEvalParams->pInDiffuseHitDistance);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularHitDistance, pInDlssDEvalParams->pInSpecularHitDistance);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirection, pInDlssDEvalParams->pInDiffuseRayDirection);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirection, pInDlssDEvalParams->pInSpecularRayDirection);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirectionHitDistance, pInDlssDEvalParams->pInDiffuseRayDirectionHitDistance);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirectionHitDistance, pInDlssDEvalParams->pInSpecularRayDirectionHitDistance);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_Alpha_Subrect_Base_X, pInDlssDEvalParams->InAlphaSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_Alpha_Subrect_Base_Y, pInDlssDEvalParams->InAlphaSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_OutputAlpha_Subrect_Base_X, pInDlssDEvalParams->InOutputAlphaSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_OutputAlpha_Subrect_Base_Y, pInDlssDEvalParams->InOutputAlphaSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ReflectedAlbedo_Subrect_Base_X, pInDlssDEvalParams->InReflectedAlbedoSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ReflectedAlbedo_Subrect_Base_Y, pInDlssDEvalParams->InReflectedAlbedoSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeParticles_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeParticlesSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeParticles_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeParticlesSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterParticles_Subrect_Base_X, pInDlssDEvalParams->InColorAfterParticlesSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterParticles_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterParticlesSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeTransparency_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeTransparencySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeTransparency_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeTransparencySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterTransparency_Subrect_Base_X, pInDlssDEvalParams->InColorAfterTransparencySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterTransparency_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterTransparencySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeFog_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeFogSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeFog_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeFogSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterFog_Subrect_Base_X, pInDlssDEvalParams->InColorAfterFogSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterFog_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterFogSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceSubsurfaceScatteringGuide_Subrect_Base_X, pInDlssDEvalParams->InScreenSpaceSubsurfaceScatteringGuideSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceSubsurfaceScatteringGuide_Subrect_Base_Y, pInDlssDEvalParams->InScreenSpaceSubsurfaceScatteringGuideSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceSubsurfaceScattering_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeScreenSpaceSubsurfaceScatteringSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceSubsurfaceScattering_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeScreenSpaceSubsurfaceScatteringSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceSubsurfaceScattering_Subrect_Base_X, pInDlssDEvalParams->InColorAfterScreenSpaceSubsurfaceScatteringSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceSubsurfaceScattering_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterScreenSpaceSubsurfaceScatteringSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceRefractionGuide_Subrect_Base_X, pInDlssDEvalParams->InScreenSpaceRefractionGuideSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ScreenSpaceRefractionGuide_Subrect_Base_Y, pInDlssDEvalParams->InScreenSpaceRefractionGuideSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceRefraction_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeScreenSpaceRefractionSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeScreenSpaceRefraction_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeScreenSpaceRefractionSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceRefraction_Subrect_Base_X, pInDlssDEvalParams->InColorAfterScreenSpaceRefractionSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterScreenSpaceRefraction_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterScreenSpaceRefractionSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DepthOfFieldGuide_Subrect_Base_X, pInDlssDEvalParams->InDepthOfFieldGuideSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DepthOfFieldGuide_Subrect_Base_Y, pInDlssDEvalParams->InDepthOfFieldGuideSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeDepthOfField_Subrect_Base_X, pInDlssDEvalParams->InColorBeforeDepthOfFieldSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorBeforeDepthOfField_Subrect_Base_Y, pInDlssDEvalParams->InColorBeforeDepthOfFieldSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterDepthOfField_Subrect_Base_X, pInDlssDEvalParams->InColorAfterDepthOfFieldSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ColorAfterDepthOfField_Subrect_Base_Y, pInDlssDEvalParams->InColorAfterDepthOfFieldSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseHitDistance_Subrect_Base_X, pInDlssDEvalParams->InDiffuseHitDistanceSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseHitDistance_Subrect_Base_Y, pInDlssDEvalParams->InDiffuseHitDistanceSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularHitDistance_Subrect_Base_X, pInDlssDEvalParams->InSpecularHitDistanceSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularHitDistance_Subrect_Base_Y, pInDlssDEvalParams->InSpecularHitDistanceSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirection_Subrect_Base_X, pInDlssDEvalParams->InDiffuseRayDirectionSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirection_Subrect_Base_Y, pInDlssDEvalParams->InDiffuseRayDirectionSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirection_Subrect_Base_X, pInDlssDEvalParams->InSpecularRayDirectionSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirection_Subrect_Base_Y, pInDlssDEvalParams->InSpecularRayDirectionSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirectionHitDistance_Subrect_Base_X, pInDlssDEvalParams->InDiffuseRayDirectionHitDistanceSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_DiffuseRayDirectionHitDistance_Subrect_Base_Y, pInDlssDEvalParams->InDiffuseRayDirectionHitDistanceSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirectionHitDistance_Subrect_Base_X, pInDlssDEvalParams->InSpecularRayDirectionHitDistanceSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_SpecularRayDirectionHitDistance_Subrect_Base_Y, pInDlssDEvalParams->InSpecularRayDirectionHitDistanceSubrectBase.Y);
+
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_WORLD_TO_VIEW_MATRIX, pInDlssDEvalParams->pInWorldToViewMatrix);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_VIEW_TO_CLIP_MATRIX, pInDlssDEvalParams->pInViewToClipMatrix);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayer, pInDlssDEvalParams->pInTransparencyLayer);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerOpacity, pInDlssDEvalParams->pInTransparencyLayerOpacity);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerMvecs, pInDlssDEvalParams->pInTransparencyLayerMvecs);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_DisocclusionMask, pInDlssDEvalParams->pInDisocclusionMask);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSSD_ResponsivityMask, pInDlssDEvalParams->pInResponsivityMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayer_Subrect_Base_X, pInDlssDEvalParams->InTransparencyLayerSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayer_Subrect_Base_Y, pInDlssDEvalParams->InTransparencyLayerSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerOpacity_Subrect_Base_X, pInDlssDEvalParams->InTransparencyLayerOpacitySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerOpacity_Subrect_Base_Y, pInDlssDEvalParams->InTransparencyLayerOpacitySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerMvecs_Subrect_Base_X, pInDlssDEvalParams->InTransparencyLayerMvecsSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_TransparencyLayerMvecs_Subrect_Base_Y, pInDlssDEvalParams->InTransparencyLayerMvecsSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_DisocclusionMask_Subrect_Base_X, pInDlssDEvalParams->InDisocclusionMaskSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_DisocclusionMask_Subrect_Base_Y, pInDlssDEvalParams->InDisocclusionMaskSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ResponsivityMask_Subrect_Base_X, pInDlssDEvalParams->InResponsivityMaskSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSSD_ResponsivityMask_Subrect_Base_Y, pInDlssDEvalParams->InResponsivityMaskSubrectBase.Y);
+
+
+ return NVSDK_NGX_VULKAN_EvaluateFeature_C(InCmdList, pInHandle, pInParams, NULL);
+}
+
+#endif // NVSDK_NGX_HELPERS_DLSSD_VK_H
diff --git a/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_dlssg.h b/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_dlssg.h
new file mode 100644
index 0000000..023828e
--- /dev/null
+++ b/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_dlssg.h
@@ -0,0 +1,229 @@
+/*
+* Copyright (c) 2021-2025 NVIDIA CORPORATION. All rights reserved.
+*
+* NVIDIA Corporation and its licensors retain all intellectual property and proprietary
+* rights in and to this software, related documentation and any modifications thereto.
+* Any use, reproduction, disclosure or distribution of this software and related
+* documentation without an express license agreement from NVIDIA Corporation is strictly
+* prohibited.
+*
+* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
+* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
+* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
+* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
+* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
+* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
+* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+* SUCH DAMAGES.
+*/
+
+#pragma once
+
+#ifndef NVSDK_NGX_HELPERS_DLSSG_H
+#define NVSDK_NGX_HELPERS_DLSSG_H
+
+#include <stdint.h> // for uint64_t
+
+#include "nvsdk_ngx.h" // DX11/12 here
+#include "nvsdk_ngx_defs_dlssg.h"
+#include "nvsdk_ngx_params_dlssg.h"
+
+typedef struct NVSDK_NGX_D3D12_DLSSG_Eval_Params
+{
+ ID3D12Resource* pBackbuffer;
+ ID3D12Resource* pDepth;
+ ID3D12Resource* pMVecs;
+ ID3D12Resource* pHudless; // Optional
+ ID3D12Resource* pUI; // Optional
+ ID3D12Resource* pUIAlpha; // Optional
+ ID3D12Resource* pBidirectionalDistortionField; // Optional
+ ID3D12Resource* pOutputInterpFrame;
+ ID3D12Resource* pOutputRealFrame; // Optional. In some cases, the feature may modify this frame (e.g. debugging)
+ ID3D12Resource* pOutputDisableInterpolation; // Optional
+} NVSDK_NGX_D3D12_DLSSG_Eval_Params;
+
+static inline NVSDK_NGX_Result NGX_D3D12_CREATE_DLSSG(
+ ID3D12GraphicsCommandList* pInCmdList,
+ unsigned int InCreationNodeMask,
+ unsigned int InVisibilityNodeMask,
+ NVSDK_NGX_Handle** ppOutHandle,
+ NVSDK_NGX_Parameter* pInParams,
+ NVSDK_NGX_DLSSG_Create_Params* pInDlssgCreateParams)
+{
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_CreationNodeMask, InCreationNodeMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_VisibilityNodeMask, InVisibilityNodeMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pInDlssgCreateParams->Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pInDlssgCreateParams->Height);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_BackbufferFormat, pInDlssgCreateParams->NativeBackbufferFormat);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_InternalWidth, pInDlssgCreateParams->RenderWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_InternalHeight, pInDlssgCreateParams->RenderHeight);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_DynamicResolution, pInDlssgCreateParams->DynamicResolutionScaling);
+
+ return NVSDK_NGX_D3D12_CreateFeature(pInCmdList, NVSDK_NGX_Feature_FrameGeneration, pInParams, ppOutHandle);
+}
+
+static inline NVSDK_NGX_Result NGX_D3D12_EVALUATE_DLSSG(
+ ID3D12GraphicsCommandList* pInCmdList,
+ NVSDK_NGX_Handle* pInHandle,
+ NVSDK_NGX_Parameter* pInParams,
+ NVSDK_NGX_D3D12_DLSSG_Eval_Params* pInDlssgEvalParams,
+ NVSDK_NGX_DLSSG_Opt_Eval_Params* pInDlssgOptEvalParams)
+{
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_DLSSG_Parameter_Backbuffer, pInDlssgEvalParams->pBackbuffer);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_DLSSG_Parameter_MVecs, pInDlssgEvalParams->pMVecs);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_DLSSG_Parameter_Depth, pInDlssgEvalParams->pDepth);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_DLSSG_Parameter_HUDLess, pInDlssgEvalParams->pHudless);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_DLSSG_Parameter_UI, pInDlssgEvalParams->pUI);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_DLSSG_Parameter_UIAlpha, pInDlssgEvalParams->pUIAlpha);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionField, pInDlssgEvalParams->pBidirectionalDistortionField);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputInterpolated, pInDlssgEvalParams->pOutputInterpFrame);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputReal, pInDlssgEvalParams->pOutputRealFrame);
+ NVSDK_NGX_Parameter_SetD3d12Resource(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputDisableInterpolation, pInDlssgEvalParams->pOutputDisableInterpolation);
+
+ if (pInDlssgOptEvalParams)
+ {
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_MultiFrameCount, pInDlssgOptEvalParams->multiFrameCount);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_MultiFrameIndex, pInDlssgOptEvalParams->multiFrameIndex);
+
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraViewToClip, pInDlssgOptEvalParams->cameraViewToClip);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_ClipToCameraView, pInDlssgOptEvalParams->clipToCameraView);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_ClipToLensClip, pInDlssgOptEvalParams->clipToLensClip);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_ClipToPrevClip, pInDlssgOptEvalParams->clipToPrevClip);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_PrevClipToClip, pInDlssgOptEvalParams->prevClipToClip);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_JitterOffsetX, pInDlssgOptEvalParams->jitterOffset[0]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_JitterOffsetY, pInDlssgOptEvalParams->jitterOffset[1]);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_MvecScaleX, pInDlssgOptEvalParams->mvecScale[0]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_MvecScaleY, pInDlssgOptEvalParams->mvecScale[1]);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraPinholeOffsetX, pInDlssgOptEvalParams->cameraPinholeOffset[0]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraPinholeOffsetY, pInDlssgOptEvalParams->cameraPinholeOffset[1]);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraPosX, pInDlssgOptEvalParams->cameraPos[0]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraPosY, pInDlssgOptEvalParams->cameraPos[1]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraPosZ, pInDlssgOptEvalParams->cameraPos[2]);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraUpX, pInDlssgOptEvalParams->cameraUp[0]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraUpY, pInDlssgOptEvalParams->cameraUp[1]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraUpZ, pInDlssgOptEvalParams->cameraUp[2]);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraRightX, pInDlssgOptEvalParams->cameraRight[0]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraRightY, pInDlssgOptEvalParams->cameraRight[1]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraRightZ, pInDlssgOptEvalParams->cameraRight[2]);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraFwdX, pInDlssgOptEvalParams->cameraFwd[0]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraFwdY, pInDlssgOptEvalParams->cameraFwd[1]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraFwdZ, pInDlssgOptEvalParams->cameraFwd[2]);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraNear, pInDlssgOptEvalParams->cameraNear);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraFar, pInDlssgOptEvalParams->cameraFar);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraFOV, pInDlssgOptEvalParams->cameraFOV);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraAspectRatio, pInDlssgOptEvalParams->cameraAspectRatio);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_ColorBuffersHDR, pInDlssgOptEvalParams->colorBuffersHDR);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_DepthInverted, pInDlssgOptEvalParams->depthInverted);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraMotionIncluded, pInDlssgOptEvalParams->cameraMotionIncluded);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_Reset, pInDlssgOptEvalParams->reset);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_AutomodeOverrideReset, pInDlssgOptEvalParams->automodeOverrideReset);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_NotRenderingGameFrames, pInDlssgOptEvalParams->notRenderingGameFrames);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OrthoProjection, pInDlssgOptEvalParams->orthoProjection);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_MvecInvalidValue, pInDlssgOptEvalParams->motionVectorsInvalidValue);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_MvecDilated, pInDlssgOptEvalParams->motionVectorsDilated);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_MenuDetectionEnabled, pInDlssgOptEvalParams->menuDetectionEnabled);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_MVecsSubrectBaseX, pInDlssgOptEvalParams->mvecsSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_MVecsSubrectBaseY, pInDlssgOptEvalParams->mvecsSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_MVecsSubrectWidth, pInDlssgOptEvalParams->mvecsSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_MVecsSubrectHeight, pInDlssgOptEvalParams->mvecsSubrectSize.Height);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_DepthSubrectBaseX, pInDlssgOptEvalParams->depthSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_DepthSubrectBaseY, pInDlssgOptEvalParams->depthSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_DepthSubrectWidth, pInDlssgOptEvalParams->depthSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_DepthSubrectHeight, pInDlssgOptEvalParams->depthSubrectSize.Height);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_HUDLessSubrectBaseX, pInDlssgOptEvalParams->hudLessSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_HUDLessSubrectBaseY, pInDlssgOptEvalParams->hudLessSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_HUDLessSubrectWidth, pInDlssgOptEvalParams->hudLessSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_HUDLessSubrectHeight, pInDlssgOptEvalParams->hudLessSubrectSize.Height);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_UISubrectBaseX, pInDlssgOptEvalParams->uiSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_UISubrectBaseY, pInDlssgOptEvalParams->uiSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_UISubrectWidth, pInDlssgOptEvalParams->uiSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_UISubrectHeight, pInDlssgOptEvalParams->uiSubrectSize.Height);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_UIAlphaSubrectBaseX, pInDlssgOptEvalParams->uiAlphaSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_UIAlphaSubrectBaseY, pInDlssgOptEvalParams->uiAlphaSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_UIAlphaSubrectWidth, pInDlssgOptEvalParams->uiAlphaSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_UIAlphaSubrectHeight, pInDlssgOptEvalParams->uiAlphaSubrectSize.Height);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionFieldSubrectBaseX, pInDlssgOptEvalParams->bidirectionalDistFieldSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionFieldSubrectBaseY, pInDlssgOptEvalParams->bidirectionalDistFieldSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionFieldSubrectWidth, pInDlssgOptEvalParams->bidirectionalDistFieldSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionFieldSubrectHeight, pInDlssgOptEvalParams->bidirectionalDistFieldSubrectSize.Height);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionField_LowPrecision_IsLowPrecision, pInDlssgOptEvalParams->bidirectionalDistFieldPrecisionInfo.IsLowPrecision);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionField_LowPrecision_Bias, pInDlssgOptEvalParams->bidirectionalDistFieldPrecisionInfo.Bias);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionField_LowPrecision_Scale, pInDlssgOptEvalParams->bidirectionalDistFieldPrecisionInfo.Scale);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_MinRelativeLinearDepthObjectSeparation, pInDlssgOptEvalParams->minRelativeLinearDepthObjectSeparation);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_InputBackbufferSubrectBaseX, pInDlssgOptEvalParams->backbufferSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_InputBackbufferSubrectBaseY, pInDlssgOptEvalParams->backbufferSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_InputBackbufferSubrectWidth, pInDlssgOptEvalParams->backbufferSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_InputBackbufferSubrectHeight, pInDlssgOptEvalParams->backbufferSubrectSize.Height);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputInterpolatedSubrectBaseX, pInDlssgOptEvalParams->outputInterpSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputInterpolatedSubrectBaseY, pInDlssgOptEvalParams->outputInterpSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputInterpolatedSubrectWidth, pInDlssgOptEvalParams->outputInterpSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputInterpolatedSubrectHeight, pInDlssgOptEvalParams->outputInterpSubrectSize.Height);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputRealSubrectBaseX, pInDlssgOptEvalParams->outputRealSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputRealSubrectBaseY, pInDlssgOptEvalParams->outputRealSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputRealSubrectWidth, pInDlssgOptEvalParams->outputRealSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputRealSubrectHeight, pInDlssgOptEvalParams->outputRealSubrectSize.Height);
+ }
+
+ return NVSDK_NGX_D3D12_EvaluateFeature_C(pInCmdList, pInHandle, pInParams, NULL);
+}
+
+static inline NVSDK_NGX_Result NGX_D3D12_ESTIMATE_VRAM_DLSSG(
+ NVSDK_NGX_Parameter* InParams,
+ uint32_t mvecDepthWidth, uint32_t mvecDepthHeight,
+ uint32_t colorWidth, uint32_t colorHeight,
+ uint32_t colorBufferFormat,
+ uint32_t mvecBufferFormat, uint32_t depthBufferFormat,
+ uint32_t hudLessBufferFormat, uint32_t uiBufferFormat,
+ size_t* estimatedVRAMInBytes
+)
+{
+ void* Callback = NULL;
+ NVSDK_NGX_Parameter_GetVoidPointer(InParams, NVSDK_NGX_Parameter_DLSSGEstimateVRAMCallback, &Callback);
+ if (!Callback)
+ {
+ // Possible reasons for this:
+ // - Installed feature is out of date and does not support the feature we need
+ // - You used NVSDK_NGX_AllocateParameters() for creating InParams. Try using NVSDK_NGX_GetCapabilityParameters() instead
+ return NVSDK_NGX_Result_FAIL_OutOfDate;
+ }
+
+ NVSDK_NGX_Result Res = NVSDK_NGX_Result_Success;
+ PFN_NVSDK_NGX_DLSSG_EstimateVRAMCallback PFNCallback = (PFN_NVSDK_NGX_DLSSG_EstimateVRAMCallback)Callback;
+ Res = PFNCallback(mvecDepthWidth, mvecDepthHeight, colorWidth, colorHeight,
+ colorBufferFormat, mvecBufferFormat, depthBufferFormat, hudLessBufferFormat, uiBufferFormat, estimatedVRAMInBytes);
+ if (NVSDK_NGX_FAILED(Res))
+ {
+ return Res;
+ }
+
+ return NVSDK_NGX_Result_Success;
+}
+
+#endif // NVSDK_NGX_HELPERS_DLSSG_H
diff --git a/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_dlssg_vk.h b/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_dlssg_vk.h
new file mode 100644
index 0000000..47ca4dd
--- /dev/null
+++ b/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_dlssg_vk.h
@@ -0,0 +1,227 @@
+#pragma once
+/*
+* Copyright (c) 2021-2024 NVIDIA CORPORATION. All rights reserved.
+*
+* NVIDIA Corporation and its licensors retain all intellectual property and proprietary
+* rights in and to this software, related documentation and any modifications thereto.
+* Any use, reproduction, disclosure or distribution of this software and related
+* documentation without an express license agreement from NVIDIA Corporation is strictly
+* prohibited.
+*
+* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
+* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
+* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
+* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
+* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
+* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
+* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+* SUCH DAMAGES.
+*/
+
+
+#ifndef NVSDK_NGX_HELPERS_DLSSG_VK_H
+#define NVSDK_NGX_HELPERS_DLSSG_VK_H
+
+#include <vulkan/vulkan.h>
+#include "nvsdk_ngx_defs_dlssg.h"
+#include "nvsdk_ngx_params_dlssg.h"
+#include "nvsdk_ngx_vk.h" // VK here
+
+typedef struct NVSDK_NGX_VK_DLSSG_Eval_Params
+{
+ NVSDK_NGX_Resource_VK* pBackbuffer;
+ NVSDK_NGX_Resource_VK* pDepth;
+ NVSDK_NGX_Resource_VK* pMVecs;
+ NVSDK_NGX_Resource_VK* pHudless; // Optional
+ NVSDK_NGX_Resource_VK* pUI; // Optional
+ NVSDK_NGX_Resource_VK* pUIAlpha; // Optional
+ NVSDK_NGX_Resource_VK* pBidirectionalDistortionField; // Optional
+ NVSDK_NGX_Resource_VK* pOutputInterpFrame;
+ NVSDK_NGX_Resource_VK* pOutputRealFrame; // Optional. In some cases, the feature may modify this frame (e.g. debugging)
+ NVSDK_NGX_Resource_VK* pOutputDisableInterpolation; // Optional
+} NVSDK_NGX_VK_DLSSG_Eval_Params;
+
+static inline NVSDK_NGX_Result NGX_VK_CREATE_DLSSG(
+ VkCommandBuffer pInCmdBuf,
+ unsigned int InCreationNodeMask,
+ unsigned int InVisibilityNodeMask,
+ NVSDK_NGX_Handle** ppOutHandle,
+ NVSDK_NGX_Parameter* pInParams,
+ NVSDK_NGX_DLSSG_Create_Params* pInDlssgCreateParams)
+{
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_CreationNodeMask, InCreationNodeMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_VisibilityNodeMask, InVisibilityNodeMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pInDlssgCreateParams->Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pInDlssgCreateParams->Height);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_BackbufferFormat, pInDlssgCreateParams->NativeBackbufferFormat);
+
+ return NVSDK_NGX_VULKAN_CreateFeature(pInCmdBuf, NVSDK_NGX_Feature_FrameGeneration, pInParams, ppOutHandle);
+}
+
+static inline NVSDK_NGX_Result NGX_VK_EVALUATE_DLSSG(
+ VkCommandBuffer pInCmdBuf,
+ NVSDK_NGX_Handle* pInHandle,
+ NVSDK_NGX_Parameter* pInParams,
+ NVSDK_NGX_VK_DLSSG_Eval_Params* pInDlssgEvalParams,
+ NVSDK_NGX_DLSSG_Opt_Eval_Params* pInDlssgOptEvalParams)
+{
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_Backbuffer, pInDlssgEvalParams->pBackbuffer);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_MVecs, pInDlssgEvalParams->pMVecs);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_Depth, pInDlssgEvalParams->pDepth);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_HUDLess, pInDlssgEvalParams->pHudless);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_UI, pInDlssgEvalParams->pUI);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_UIAlpha, pInDlssgEvalParams->pUIAlpha);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionField, pInDlssgEvalParams->pBidirectionalDistortionField);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputInterpolated, pInDlssgEvalParams->pOutputInterpFrame);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputReal, pInDlssgEvalParams->pOutputRealFrame);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputDisableInterpolation, pInDlssgEvalParams->pOutputDisableInterpolation);
+
+ if (pInDlssgOptEvalParams)
+ {
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_MultiFrameCount, pInDlssgOptEvalParams->multiFrameCount);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_MultiFrameIndex, pInDlssgOptEvalParams->multiFrameIndex);
+
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraViewToClip, pInDlssgOptEvalParams->cameraViewToClip);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_ClipToCameraView, pInDlssgOptEvalParams->clipToCameraView);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_ClipToLensClip, pInDlssgOptEvalParams->clipToLensClip);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_ClipToPrevClip, pInDlssgOptEvalParams->clipToPrevClip);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_DLSSG_Parameter_PrevClipToClip, pInDlssgOptEvalParams->prevClipToClip);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_JitterOffsetX, pInDlssgOptEvalParams->jitterOffset[0]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_JitterOffsetY, pInDlssgOptEvalParams->jitterOffset[1]);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_MvecScaleX, pInDlssgOptEvalParams->mvecScale[0]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_MvecScaleY, pInDlssgOptEvalParams->mvecScale[1]);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraPinholeOffsetX, pInDlssgOptEvalParams->cameraPinholeOffset[0]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraPinholeOffsetY, pInDlssgOptEvalParams->cameraPinholeOffset[1]);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraPosX, pInDlssgOptEvalParams->cameraPos[0]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraPosY, pInDlssgOptEvalParams->cameraPos[1]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraPosZ, pInDlssgOptEvalParams->cameraPos[2]);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraUpX, pInDlssgOptEvalParams->cameraUp[0]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraUpY, pInDlssgOptEvalParams->cameraUp[1]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraUpZ, pInDlssgOptEvalParams->cameraUp[2]);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraRightX, pInDlssgOptEvalParams->cameraRight[0]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraRightY, pInDlssgOptEvalParams->cameraRight[1]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraRightZ, pInDlssgOptEvalParams->cameraRight[2]);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraFwdX, pInDlssgOptEvalParams->cameraFwd[0]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraFwdY, pInDlssgOptEvalParams->cameraFwd[1]);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraFwdZ, pInDlssgOptEvalParams->cameraFwd[2]);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraNear, pInDlssgOptEvalParams->cameraNear);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraFar, pInDlssgOptEvalParams->cameraFar);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraFOV, pInDlssgOptEvalParams->cameraFOV);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraAspectRatio, pInDlssgOptEvalParams->cameraAspectRatio);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_ColorBuffersHDR, pInDlssgOptEvalParams->colorBuffersHDR);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_DepthInverted, pInDlssgOptEvalParams->depthInverted);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_CameraMotionIncluded, pInDlssgOptEvalParams->cameraMotionIncluded);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_Reset, pInDlssgOptEvalParams->reset);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_AutomodeOverrideReset, pInDlssgOptEvalParams->automodeOverrideReset);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_NotRenderingGameFrames, pInDlssgOptEvalParams->notRenderingGameFrames);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OrthoProjection, pInDlssgOptEvalParams->orthoProjection);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_MvecInvalidValue, pInDlssgOptEvalParams->motionVectorsInvalidValue);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_MvecDilated, pInDlssgOptEvalParams->motionVectorsDilated);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_MenuDetectionEnabled, pInDlssgOptEvalParams->menuDetectionEnabled);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_MVecsSubrectBaseX, pInDlssgOptEvalParams->mvecsSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_MVecsSubrectBaseY, pInDlssgOptEvalParams->mvecsSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_MVecsSubrectWidth, pInDlssgOptEvalParams->mvecsSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_MVecsSubrectHeight, pInDlssgOptEvalParams->mvecsSubrectSize.Height);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_DepthSubrectBaseX, pInDlssgOptEvalParams->depthSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_DepthSubrectBaseY, pInDlssgOptEvalParams->depthSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_DepthSubrectWidth, pInDlssgOptEvalParams->depthSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_DepthSubrectHeight, pInDlssgOptEvalParams->depthSubrectSize.Height);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_HUDLessSubrectBaseX, pInDlssgOptEvalParams->hudLessSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_HUDLessSubrectBaseY, pInDlssgOptEvalParams->hudLessSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_HUDLessSubrectWidth, pInDlssgOptEvalParams->hudLessSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_HUDLessSubrectHeight, pInDlssgOptEvalParams->hudLessSubrectSize.Height);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_UISubrectBaseX, pInDlssgOptEvalParams->uiSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_UISubrectBaseY, pInDlssgOptEvalParams->uiSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_UISubrectWidth, pInDlssgOptEvalParams->uiSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_UISubrectHeight, pInDlssgOptEvalParams->uiSubrectSize.Height);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_UIAlphaSubrectBaseX, pInDlssgOptEvalParams->uiAlphaSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_UIAlphaSubrectBaseY, pInDlssgOptEvalParams->uiAlphaSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_UIAlphaSubrectWidth, pInDlssgOptEvalParams->uiAlphaSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_UIAlphaSubrectHeight, pInDlssgOptEvalParams->uiAlphaSubrectSize.Height);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionFieldSubrectBaseX, pInDlssgOptEvalParams->bidirectionalDistFieldSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionFieldSubrectBaseY, pInDlssgOptEvalParams->bidirectionalDistFieldSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionFieldSubrectWidth, pInDlssgOptEvalParams->bidirectionalDistFieldSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionFieldSubrectHeight, pInDlssgOptEvalParams->bidirectionalDistFieldSubrectSize.Height);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionField_LowPrecision_IsLowPrecision, pInDlssgOptEvalParams->bidirectionalDistFieldPrecisionInfo.IsLowPrecision);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionField_LowPrecision_Bias, pInDlssgOptEvalParams->bidirectionalDistFieldPrecisionInfo.Bias);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_BidirectionalDistortionField_LowPrecision_Scale, pInDlssgOptEvalParams->bidirectionalDistFieldPrecisionInfo.Scale);
+
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_DLSSG_Parameter_MinRelativeLinearDepthObjectSeparation, pInDlssgOptEvalParams->minRelativeLinearDepthObjectSeparation);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_InputBackbufferSubrectBaseX, pInDlssgOptEvalParams->backbufferSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_InputBackbufferSubrectBaseY, pInDlssgOptEvalParams->backbufferSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_InputBackbufferSubrectWidth, pInDlssgOptEvalParams->backbufferSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_InputBackbufferSubrectHeight, pInDlssgOptEvalParams->backbufferSubrectSize.Height);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputInterpolatedSubrectBaseX, pInDlssgOptEvalParams->outputInterpSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputInterpolatedSubrectBaseY, pInDlssgOptEvalParams->outputInterpSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputInterpolatedSubrectWidth, pInDlssgOptEvalParams->outputInterpSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputInterpolatedSubrectHeight, pInDlssgOptEvalParams->outputInterpSubrectSize.Height);
+
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputRealSubrectBaseX, pInDlssgOptEvalParams->outputRealSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputRealSubrectBaseY, pInDlssgOptEvalParams->outputRealSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputRealSubrectWidth, pInDlssgOptEvalParams->outputRealSubrectSize.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_DLSSG_Parameter_OutputRealSubrectHeight, pInDlssgOptEvalParams->outputRealSubrectSize.Height);
+ }
+
+ // C version or cpp?
+ return NVSDK_NGX_VULKAN_EvaluateFeature_C(pInCmdBuf, pInHandle, pInParams, NULL);
+}
+
+static inline NVSDK_NGX_Result NGX_VK_ESTIMATE_VRAM_DLSSG(
+ NVSDK_NGX_Parameter* InParams,
+ uint32_t mvecDepthWidth, uint32_t mvecDepthHeight,
+ uint32_t colorWidth, uint32_t colorHeight,
+ uint32_t colorBufferFormat,
+ uint32_t mvecBufferFormat, uint32_t depthBufferFormat,
+ uint32_t hudLessBufferFormat, uint32_t uiBufferFormat,
+ size_t* estimatedVRAMInBytes
+)
+{
+ void* Callback = NULL;
+ NVSDK_NGX_Parameter_GetVoidPointer(InParams, NVSDK_NGX_Parameter_DLSSGEstimateVRAMCallback, &Callback);
+ if (!Callback)
+ {
+ // Possible reasons for this:
+ // - Installed feature is out of date and does not support the feature we need
+ // - You used NVSDK_NGX_AllocateParameters() for creating InParams. Try using NVSDK_NGX_GetCapabilityParameters() instead
+ return NVSDK_NGX_Result_FAIL_OutOfDate;
+ }
+
+ NVSDK_NGX_Result Res = NVSDK_NGX_Result_Success;
+ PFN_NVSDK_NGX_DLSSG_EstimateVRAMCallback PFNCallback = (PFN_NVSDK_NGX_DLSSG_EstimateVRAMCallback)Callback;
+ Res = PFNCallback(mvecDepthWidth, mvecDepthHeight, colorWidth, colorHeight,
+ colorBufferFormat, mvecBufferFormat, depthBufferFormat, hudLessBufferFormat, uiBufferFormat, estimatedVRAMInBytes);
+ if (NVSDK_NGX_FAILED(Res))
+ {
+ return Res;
+ }
+
+ return NVSDK_NGX_Result_Success;
+}
+
+#endif
diff --git a/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_vk.h b/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_vk.h
new file mode 100644
index 0000000..c46d4d1
--- /dev/null
+++ b/native/NVIDIA-DLSS/include/nvsdk_ngx_helpers_vk.h
@@ -0,0 +1,275 @@
+/*
+ * SPDX-FileCopyrightText: Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
+ *
+ * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
+ * property and proprietary rights in and to this material, related
+ * documentation and any modifications thereto. Any use, reproduction,
+ * disclosure or distribution of this material and related documentation
+ * without an express license agreement from NVIDIA CORPORATION or
+ * its affiliates is strictly prohibited.
+ */
+
+#ifndef NVSDK_NGX_HELPERS_VK_H
+#define NVSDK_NGX_HELPERS_VK_H
+#pragma once
+
+#include "nvsdk_ngx_vk.h"
+
+#define NVSDK_NGX_ENSURE_VK_IMAGEVIEW(InResource) if ((InResource) && (InResource)->Type != NVSDK_NGX_RESOURCE_VK_TYPE_VK_IMAGEVIEW) { return NVSDK_NGX_Result_FAIL_InvalidParameter; }
+
+static inline NVSDK_NGX_Resource_VK NVSDK_NGX_Create_ImageView_Resource_VK(VkImageView imageView, VkImage image, VkImageSubresourceRange subresourceRange, VkFormat format, unsigned int width, unsigned int height, bool readWrite)
+{
+ NVSDK_NGX_Resource_VK resourceVK = {0};
+ resourceVK.Type = NVSDK_NGX_RESOURCE_VK_TYPE_VK_IMAGEVIEW;
+ resourceVK.Resource.ImageViewInfo.ImageView = imageView;
+ resourceVK.Resource.ImageViewInfo.Image = image;
+ resourceVK.Resource.ImageViewInfo.SubresourceRange = subresourceRange;
+ resourceVK.Resource.ImageViewInfo.Height = height;
+ resourceVK.Resource.ImageViewInfo.Width = width;
+ resourceVK.Resource.ImageViewInfo.Format = format;
+ resourceVK.ReadWrite = readWrite;
+ return resourceVK;
+}
+
+static inline NVSDK_NGX_Resource_VK NVSDK_NGX_Create_Buffer_Resource_VK(VkBuffer buffer, unsigned int sizeInBytes, bool readWrite)
+{
+ NVSDK_NGX_Resource_VK resourceVK = {0};
+ resourceVK.Type = NVSDK_NGX_RESOURCE_VK_TYPE_VK_BUFFER;
+ resourceVK.Resource.BufferInfo.Buffer = buffer;
+ resourceVK.Resource.BufferInfo.SizeInBytes = sizeInBytes;
+ resourceVK.ReadWrite = readWrite;
+ return resourceVK;
+}
+
+typedef struct NVSDK_NGX_VK_Feature_Eval_Params
+{
+ NVSDK_NGX_Resource_VK *pInColor;
+ NVSDK_NGX_Resource_VK *pInOutput;
+ /*** OPTIONAL for DLSS ***/
+ float InSharpness;
+} NVSDK_NGX_VK_Feature_Eval_Params;
+
+typedef struct NVSDK_NGX_VK_GBuffer
+{
+ NVSDK_NGX_Resource_VK *pInAttrib[NVSDK_NGX_GBUFFERTYPE_NUM];
+} NVSDK_NGX_VK_GBuffer;
+
+typedef struct NVSDK_NGX_Coordinates_VK
+{
+ unsigned int X;
+ unsigned int Y;
+} NVSDK_NGX_Coordinates_VK;
+
+typedef struct NVSDK_NGX_VK_DLSS_Eval_Params
+{
+ NVSDK_NGX_VK_Feature_Eval_Params Feature;
+ NVSDK_NGX_Resource_VK * pInDepth;
+ NVSDK_NGX_Resource_VK * pInMotionVectors;
+ float InJitterOffsetX; /* Jitter offset must be in input/render pixel space */
+ float InJitterOffsetY;
+ NVSDK_NGX_Dimensions InRenderSubrectDimensions;
+ /*** OPTIONAL - leave to 0/0.0f if unused ***/
+ int InReset; /* Set to 1 when scene changes completely (new level etc) */
+ float InMVScaleX; /* If MVs need custom scaling to convert to pixel space */
+ float InMVScaleY;
+ NVSDK_NGX_Resource_VK * pInTransparencyMask; /* Unused/Reserved for future use */
+ NVSDK_NGX_Resource_VK * pInExposureTexture;
+ NVSDK_NGX_Resource_VK * pInBiasCurrentColorMask;
+ NVSDK_NGX_Coordinates InColorSubrectBase;
+ NVSDK_NGX_Coordinates InDepthSubrectBase;
+ NVSDK_NGX_Coordinates InMVSubrectBase;
+ NVSDK_NGX_Coordinates InTranslucencySubrectBase;
+ NVSDK_NGX_Coordinates InBiasCurrentColorSubrectBase;
+ NVSDK_NGX_Coordinates InOutputSubrectBase;
+ float InPreExposure;
+ float InExposureScale;
+ int InIndicatorInvertXAxis;
+ int InIndicatorInvertYAxis;
+ /*** OPTIONAL - only for research purposes ***/
+ NVSDK_NGX_VK_GBuffer GBufferSurface;
+ NVSDK_NGX_ToneMapperType InToneMapperType;
+ NVSDK_NGX_Resource_VK * pInMotionVectors3D;
+ NVSDK_NGX_Resource_VK * pInIsParticleMask; /* to identify which pixels contains particles, essentially that are not drawn as part of base pass */
+ NVSDK_NGX_Resource_VK * pInAnimatedTextureMask; /* a binary mask covering pixels occupied by animated textures */
+ NVSDK_NGX_Resource_VK * pInDepthHighRes;
+ NVSDK_NGX_Resource_VK * pInPositionViewSpace;
+ float InFrameTimeDeltaInMsec; /* helps in determining the amount to denoise or anti-alias based on the speed of the object from motion vector magnitudes and fps as determined by this delta */
+ NVSDK_NGX_Resource_VK * pInRayTracingHitDistance; /* for each effect - approximation to the amount of noise in a ray-traced color */
+ NVSDK_NGX_Resource_VK * pInMotionVectorsReflections; /* motion vectors of reflected objects like for mirrored surfaces */
+} NVSDK_NGX_VK_DLSS_Eval_Params;
+
+typedef struct NVSDK_NGX_VK_DLISP_Eval_Params
+{
+ NVSDK_NGX_VK_Feature_Eval_Params Feature;
+ /*** OPTIONAL - leave to 0/0.0f if unused ***/
+ unsigned int InRectX;
+ unsigned int InRectY;
+ unsigned int InRectW;
+ unsigned int InRectH;
+ float InDenoise;
+} NVSDK_NGX_VK_DLISP_Eval_Params;
+
+static inline NVSDK_NGX_Result NGX_VULKAN_CREATE_DLSS_EXT1(
+ VkDevice InDevice,
+ VkCommandBuffer InCmdList,
+ unsigned int InCreationNodeMask,
+ unsigned int InVisibilityNodeMask,
+ NVSDK_NGX_Handle **ppOutHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_DLSS_Create_Params *pInDlssCreateParams)
+{
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_CreationNodeMask, InCreationNodeMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_VisibilityNodeMask, InVisibilityNodeMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pInDlssCreateParams->Feature.InWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pInDlssCreateParams->Feature.InHeight);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pInDlssCreateParams->Feature.InTargetWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pInDlssCreateParams->Feature.InTargetHeight);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, pInDlssCreateParams->Feature.InPerfQualityValue);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Feature_Create_Flags, pInDlssCreateParams->InFeatureCreateFlags);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Enable_Output_Subrects, pInDlssCreateParams->InEnableOutputSubrects ? 1 : 0);
+
+ if (InDevice) return NVSDK_NGX_VULKAN_CreateFeature1(InDevice, InCmdList, NVSDK_NGX_Feature_SuperSampling, pInParams, ppOutHandle);
+ else return NVSDK_NGX_VULKAN_CreateFeature(InCmdList, NVSDK_NGX_Feature_SuperSampling, pInParams, ppOutHandle);
+}
+
+static inline NVSDK_NGX_Result NGX_VULKAN_CREATE_DLSS_EXT(
+ VkCommandBuffer InCmdList,
+ unsigned int InCreationNodeMask,
+ unsigned int InVisibilityNodeMask,
+ NVSDK_NGX_Handle **ppOutHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_DLSS_Create_Params *pInDlssCreateParams)
+{
+ return NGX_VULKAN_CREATE_DLSS_EXT1(NULL, InCmdList, InCreationNodeMask, InVisibilityNodeMask, ppOutHandle, pInParams, pInDlssCreateParams);
+}
+
+static inline NVSDK_NGX_Result NGX_VULKAN_EVALUATE_DLSS_EXT(
+ VkCommandBuffer InCmdList,
+ NVSDK_NGX_Handle *pInHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_VK_DLSS_Eval_Params *pInDlssEvalParams)
+{
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->Feature.pInColor);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInMotionVectors);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->Feature.pInOutput);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInDepth);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInTransparencyMask);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInExposureTexture);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInBiasCurrentColorMask);
+ for (size_t i = 0; i <= 15; i++)
+ {
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->GBufferSurface.pInAttrib[i]);
+ }
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInMotionVectors3D);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInIsParticleMask);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInAnimatedTextureMask);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInDepthHighRes);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInPositionViewSpace);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInRayTracingHitDistance);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlssEvalParams->pInMotionVectorsReflections);
+
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Color, pInDlssEvalParams->Feature.pInColor);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Output, pInDlssEvalParams->Feature.pInOutput);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Depth, pInDlssEvalParams->pInDepth);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_MotionVectors, pInDlssEvalParams->pInMotionVectors);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_X, pInDlssEvalParams->InJitterOffsetX);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Jitter_Offset_Y, pInDlssEvalParams->InJitterOffsetY);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pInDlssEvalParams->Feature.InSharpness);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_Reset, pInDlssEvalParams->InReset);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_X, pInDlssEvalParams->InMVScaleX == 0.0f ? 1.0f : pInDlssEvalParams->InMVScaleX);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_MV_Scale_Y, pInDlssEvalParams->InMVScaleY == 0.0f ? 1.0f : pInDlssEvalParams->InMVScaleY);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_TransparencyMask, pInDlssEvalParams->pInTransparencyMask);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_ExposureTexture, pInDlssEvalParams->pInExposureTexture);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_Mask, pInDlssEvalParams->pInBiasCurrentColorMask);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Albedo, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ALBEDO]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Roughness, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_ROUGHNESS]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Metallic, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_METALLIC]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Specular, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SPECULAR]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Subsurface, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SUBSURFACE]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Normals, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_NORMALS]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_ShadingModelId, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_SHADINGMODELID]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_MaterialId, pInDlssEvalParams->GBufferSurface.pInAttrib[NVSDK_NGX_GBUFFER_MATERIALID]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_8, pInDlssEvalParams->GBufferSurface.pInAttrib[8]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_9, pInDlssEvalParams->GBufferSurface.pInAttrib[9]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_10, pInDlssEvalParams->GBufferSurface.pInAttrib[10]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_11, pInDlssEvalParams->GBufferSurface.pInAttrib[11]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_12, pInDlssEvalParams->GBufferSurface.pInAttrib[12]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_13, pInDlssEvalParams->GBufferSurface.pInAttrib[13]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_14, pInDlssEvalParams->GBufferSurface.pInAttrib[14]);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_GBuffer_Atrrib_15, pInDlssEvalParams->GBufferSurface.pInAttrib[15]);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_TonemapperType, pInDlssEvalParams->InToneMapperType);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_MotionVectors3D, pInDlssEvalParams->pInMotionVectors3D);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_IsParticleMask, pInDlssEvalParams->pInIsParticleMask);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_AnimatedTextureMask, pInDlssEvalParams->pInAnimatedTextureMask);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_DepthHighRes, pInDlssEvalParams->pInDepthHighRes);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Position_ViewSpace, pInDlssEvalParams->pInPositionViewSpace);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_FrameTimeDeltaInMsec, pInDlssEvalParams->InFrameTimeDeltaInMsec);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_RayTracingHitDistance, pInDlssEvalParams->pInRayTracingHitDistance);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_MotionVectorsReflection, pInDlssEvalParams->pInMotionVectorsReflections);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_X, pInDlssEvalParams->InColorSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Color_Subrect_Base_Y, pInDlssEvalParams->InColorSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_X, pInDlssEvalParams->InDepthSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Depth_Subrect_Base_Y, pInDlssEvalParams->InDepthSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_X, pInDlssEvalParams->InMVSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_MV_SubrectBase_Y, pInDlssEvalParams->InMVSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_X, pInDlssEvalParams->InTranslucencySubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Translucency_SubrectBase_Y, pInDlssEvalParams->InTranslucencySubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_X, pInDlssEvalParams->InBiasCurrentColorSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Input_Bias_Current_Color_SubrectBase_Y, pInDlssEvalParams->InBiasCurrentColorSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_X, pInDlssEvalParams->InOutputSubrectBase.X);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Output_Subrect_Base_Y, pInDlssEvalParams->InOutputSubrectBase.Y);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Width , pInDlssEvalParams->InRenderSubrectDimensions.Width);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_DLSS_Render_Subrect_Dimensions_Height, pInDlssEvalParams->InRenderSubrectDimensions.Height);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Pre_Exposure, pInDlssEvalParams->InPreExposure == 0.0f ? 1.0f : pInDlssEvalParams->InPreExposure);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_DLSS_Exposure_Scale, pInDlssEvalParams->InExposureScale == 0.0f ? 1.0f : pInDlssEvalParams->InExposureScale);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_X_Axis, pInDlssEvalParams->InIndicatorInvertXAxis);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_DLSS_Indicator_Invert_Y_Axis, pInDlssEvalParams->InIndicatorInvertYAxis);
+
+ return NVSDK_NGX_VULKAN_EvaluateFeature_C(InCmdList, pInHandle, pInParams, NULL);
+}
+
+static inline NVSDK_NGX_Result NGX_VULKAN_CREATE_DLISP_EXT(
+ VkCommandBuffer InCmdList,
+ unsigned int InCreationNodeMask,
+ unsigned int InVisibilityNodeMask,
+ NVSDK_NGX_Handle **ppOutHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_Feature_Create_Params *pInDlispCreateParams)
+{
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_CreationNodeMask, InCreationNodeMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_VisibilityNodeMask, InVisibilityNodeMask);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Width, pInDlispCreateParams->InWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Height, pInDlispCreateParams->InHeight);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutWidth, pInDlispCreateParams->InTargetWidth);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_OutHeight, pInDlispCreateParams->InTargetHeight);
+ NVSDK_NGX_Parameter_SetI(pInParams, NVSDK_NGX_Parameter_PerfQualityValue, pInDlispCreateParams->InPerfQualityValue);
+
+ return NVSDK_NGX_VULKAN_CreateFeature(InCmdList, NVSDK_NGX_Feature_ImageSignalProcessing, pInParams, ppOutHandle);
+}
+
+static inline NVSDK_NGX_Result NGX_VULKAN_EVALUATE_DLISP_EXT(
+ VkCommandBuffer InCmdList,
+ NVSDK_NGX_Handle *InHandle,
+ NVSDK_NGX_Parameter *pInParams,
+ NVSDK_NGX_VK_DLISP_Eval_Params *pInDlispEvalParams)
+{
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlispEvalParams->Feature.pInColor);
+ NVSDK_NGX_ENSURE_VK_IMAGEVIEW(pInDlispEvalParams->Feature.pInOutput);
+
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Color, pInDlispEvalParams->Feature.pInColor);
+ NVSDK_NGX_Parameter_SetVoidPointer(pInParams, NVSDK_NGX_Parameter_Output, pInDlispEvalParams->Feature.pInOutput);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Sharpness, pInDlispEvalParams->Feature.InSharpness);
+ NVSDK_NGX_Parameter_SetF(pInParams, NVSDK_NGX_Parameter_Denoise, pInDlispEvalParams->InDenoise);
+ // If input is atlas - use RECT to upscale only the required area
+ if (pInDlispEvalParams->InRectW)
+ {
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_X, pInDlispEvalParams->InRectX);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_Y, pInDlispEvalParams->InRectY);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_W, pInDlispEvalParams->InRectW);
+ NVSDK_NGX_Parameter_SetUI(pInParams, NVSDK_NGX_Parameter_Rect_H, pInDlispEvalParams->InRectH);
+ }
+
+ return NVSDK_NGX_VULKAN_EvaluateFeature_C(InCmdList, InHandle, pInParams, NULL);
+}
+#endif // NVSDK_NGX_HELPERS_VK_H
diff --git a/native/NVIDIA-DLSS/include/nvsdk_ngx_params.h b/native/NVIDIA-DLSS/include/nvsdk_ngx_params.h
new file mode 100644
index 0000000..bb5af60
--- /dev/null
+++ b/native/NVIDIA-DLSS/include/nvsdk_ngx_params.h
@@ -0,0 +1,116 @@
+/*
+ * SPDX-FileCopyrightText: Copyright (c) 2019-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
+ *
+ * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
+ * property and proprietary rights in and to this material, related
+ * documentation and any modifications thereto. Any use, reproduction,
+ * disclosure or distribution of this material and related documentation
+ * without an express license agreement from NVIDIA CORPORATION or
+ * its affiliates is strictly prohibited.
+ */
+
+
+#ifndef NVSDK_NGX_PARAMS_H
+#define NVSDK_NGX_PARAMS_H
+
+#include "nvsdk_ngx_defs.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+typedef struct ID3D11Resource ID3D11Resource;
+typedef struct ID3D12Resource ID3D12Resource;
+
+typedef struct NVSDK_NGX_Feature_Create_Params
+{
+ unsigned int InWidth;
+ unsigned int InHeight;
+ unsigned int InTargetWidth;
+ unsigned int InTargetHeight;
+ /*** OPTIONAL ***/
+ NVSDK_NGX_PerfQuality_Value InPerfQualityValue;
+} NVSDK_NGX_Feature_Create_Params;
+
+typedef struct NVSDK_NGX_DLSS_Create_Params
+{
+ NVSDK_NGX_Feature_Create_Params Feature;
+ /*** OPTIONAL ***/
+ int InFeatureCreateFlags;
+ bool InEnableOutputSubrects;
+} NVSDK_NGX_DLSS_Create_Params;
+
+typedef struct NVSDK_NGX_DLDenoise_Create_Params
+{
+ NVSDK_NGX_Feature_Create_Params Feature;
+ /*** OPTIONAL ***/
+ int InFeatureCreateFlags;
+} NVSDK_NGX_DLDenoise_Create_Params;
+
+#ifdef __cplusplus
+typedef struct NVSDK_NGX_Parameter
+{
+ virtual void Set(const char * InName, unsigned long long InValue) = 0;
+ virtual void Set(const char * InName, float InValue) = 0;
+ virtual void Set(const char * InName, double InValue) = 0;
+ virtual void Set(const char * InName, unsigned int InValue) = 0;
+ virtual void Set(const char * InName, int InValue) = 0;
+ virtual void Set(const char * InName, ID3D11Resource *InValue) = 0;
+ virtual void Set(const char * InName, ID3D12Resource *InValue) = 0;
+ virtual void Set(const char * InName, void *InValue) = 0;
+
+ virtual NVSDK_NGX_Result Get(const char * InName, unsigned long long *OutValue) const = 0;
+ virtual NVSDK_NGX_Result Get(const char * InName, float *OutValue) const = 0;
+ virtual NVSDK_NGX_Result Get(const char * InName, double *OutValue) const = 0;
+ virtual NVSDK_NGX_Result Get(const char * InName, unsigned int *OutValue) const = 0;
+ virtual NVSDK_NGX_Result Get(const char * InName, int *OutValue) const = 0;
+ virtual NVSDK_NGX_Result Get(const char * InName, ID3D11Resource **OutValue) const = 0;
+ virtual NVSDK_NGX_Result Get(const char * InName, ID3D12Resource **OutValue) const = 0;
+ virtual NVSDK_NGX_Result Get(const char * InName, void **OutValue) const = 0;
+
+ virtual void Reset() = 0;
+} NVSDK_NGX_Parameter;
+#else
+typedef struct NVSDK_NGX_Parameter NVSDK_NGX_Parameter;
+#endif // _cplusplus
+
+typedef void (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_SetULL)(NVSDK_NGX_Parameter *InParameter, const char * InName, unsigned long long InValue);
+NVSDK_NGX_API void NVSDK_CONV NVSDK_NGX_Parameter_SetULL(NVSDK_NGX_Parameter *InParameter, const char * InName, unsigned long long InValue);
+typedef void (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_SetF)(NVSDK_NGX_Parameter *InParameter, const char * InName, float InValue);
+NVSDK_NGX_API void NVSDK_CONV NVSDK_NGX_Parameter_SetF(NVSDK_NGX_Parameter *InParameter, const char * InName, float InValue);
+typedef void (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_SetD)(NVSDK_NGX_Parameter *InParameter, const char * InName, double InValue);
+NVSDK_NGX_API void NVSDK_CONV NVSDK_NGX_Parameter_SetD(NVSDK_NGX_Parameter *InParameter, const char * InName, double InValue);
+typedef void (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_SetUI)(NVSDK_NGX_Parameter *InParameter, const char * InName, unsigned int InValue);
+NVSDK_NGX_API void NVSDK_CONV NVSDK_NGX_Parameter_SetUI(NVSDK_NGX_Parameter *InParameter, const char * InName, unsigned int InValue);
+typedef void (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_SetI)(NVSDK_NGX_Parameter *InParameter, const char * InName, int InValue);
+NVSDK_NGX_API void NVSDK_CONV NVSDK_NGX_Parameter_SetI(NVSDK_NGX_Parameter *InParameter, const char * InName, int InValue);
+typedef void (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_SetD3d11Resource)(NVSDK_NGX_Parameter *InParameter, const char * InName, ID3D11Resource *InValue);
+NVSDK_NGX_API void NVSDK_CONV NVSDK_NGX_Parameter_SetD3d11Resource(NVSDK_NGX_Parameter *InParameter, const char * InName, ID3D11Resource *InValue);
+typedef void (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_SetD3d12Resource)(NVSDK_NGX_Parameter *InParameter, const char * InName, ID3D12Resource *InValue);
+NVSDK_NGX_API void NVSDK_CONV NVSDK_NGX_Parameter_SetD3d12Resource(NVSDK_NGX_Parameter *InParameter, const char * InName, ID3D12Resource *InValue);
+typedef void (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_SetVoidPointer)(NVSDK_NGX_Parameter *InParameter, const char * InName, void *InValue);
+NVSDK_NGX_API void NVSDK_CONV NVSDK_NGX_Parameter_SetVoidPointer(NVSDK_NGX_Parameter *InParameter, const char * InName, void *InValue);
+typedef NVSDK_NGX_Result (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_GetULL)(NVSDK_NGX_Parameter *InParameter, const char * InName, unsigned long long *OutValue);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_Parameter_GetULL(NVSDK_NGX_Parameter *InParameter, const char * InName, unsigned long long *OutValue);
+typedef NVSDK_NGX_Result (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_GetF)(NVSDK_NGX_Parameter *InParameter, const char * InName, float *OutValue);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_Parameter_GetF(NVSDK_NGX_Parameter *InParameter, const char * InName, float *OutValue);
+typedef NVSDK_NGX_Result (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_GetD)(NVSDK_NGX_Parameter *InParameter, const char * InName, double *OutValue);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_Parameter_GetD(NVSDK_NGX_Parameter *InParameter, const char * InName, double *OutValue);
+typedef NVSDK_NGX_Result (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_GetUI)(NVSDK_NGX_Parameter *InParameter, const char * InName, unsigned int *OutValue);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_Parameter_GetUI(NVSDK_NGX_Parameter *InParameter, const char * InName, unsigned int *OutValue);
+typedef NVSDK_NGX_Result (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_GetI)(NVSDK_NGX_Parameter *InParameter, const char * InName, int *OutValue);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_Parameter_GetI(NVSDK_NGX_Parameter *InParameter, const char * InName, int *OutValue);
+typedef NVSDK_NGX_Result (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_GetD3d11Resource)(NVSDK_NGX_Parameter *InParameter, const char * InName, ID3D11Resource **OutValue);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_Parameter_GetD3d11Resource(NVSDK_NGX_Parameter *InParameter, const char * InName, ID3D11Resource **OutValue);
+typedef NVSDK_NGX_Result (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_GetD3d12Resource)(NVSDK_NGX_Parameter *InParameter, const char * InName, ID3D12Resource **OutValue);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_Parameter_GetD3d12Resource(NVSDK_NGX_Parameter *InParameter, const char * InName, ID3D12Resource **OutValue);
+typedef NVSDK_NGX_Result (NVSDK_CONV *PFN_NVSDK_NGX_Parameter_GetVoidPointer)(NVSDK_NGX_Parameter *InParameter, const char * InName, void **OutValue);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_Parameter_GetVoidPointer(NVSDK_NGX_Parameter *InParameter, const char * InName, void **OutValue);
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // #define NVSDK_NGX_PARAMS_H
diff --git a/native/NVIDIA-DLSS/include/nvsdk_ngx_params_dlssd.h b/native/NVIDIA-DLSS/include/nvsdk_ngx_params_dlssd.h
new file mode 100644
index 0000000..f52ab7a
--- /dev/null
+++ b/native/NVIDIA-DLSS/include/nvsdk_ngx_params_dlssd.h
@@ -0,0 +1,36 @@
+/*
+ * SPDX-FileCopyrightText: Copyright (c) 2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
+ *
+ * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
+ * property and proprietary rights in and to this material, related
+ * documentation and any modifications thereto. Any use, reproduction,
+ * disclosure or distribution of this material and related documentation
+ * without an express license agreement from NVIDIA CORPORATION or
+ * its affiliates is strictly prohibited.
+ */
+
+
+#ifndef NVSDK_NGX_PARAMS_DLSSD_H
+#define NVSDK_NGX_PARAMS_DLSSD_H
+
+#include "nvsdk_ngx_defs_dlssd.h"
+
+typedef struct NVSDK_NGX_DLSSD_Create_Params
+{
+ NVSDK_NGX_DLSS_Denoise_Mode InDenoiseMode;
+ NVSDK_NGX_DLSS_Roughness_Mode InRoughnessMode;
+ NVSDK_NGX_DLSS_Depth_Type InUseHWDepth;
+
+ unsigned int InWidth;
+ unsigned int InHeight;
+ unsigned int InTargetWidth;
+ unsigned int InTargetHeight;
+ /*** OPTIONAL ***/
+ NVSDK_NGX_PerfQuality_Value InPerfQualityValue;
+ int InFeatureCreateFlags;
+ bool InEnableOutputSubrects;
+} NVSDK_NGX_DLSSD_Create_Params;
+
+
+#endif // #define NVSDK_NGX_PARAMS_DLSSD_H
diff --git a/native/NVIDIA-DLSS/include/nvsdk_ngx_params_dlssg.h b/native/NVIDIA-DLSS/include/nvsdk_ngx_params_dlssg.h
new file mode 100644
index 0000000..f4dfa2b
--- /dev/null
+++ b/native/NVIDIA-DLSS/include/nvsdk_ngx_params_dlssg.h
@@ -0,0 +1,138 @@
+#pragma once
+/*
+* Copyright (c) 2021-2024 NVIDIA CORPORATION. All rights reserved.
+*
+* NVIDIA Corporation and its licensors retain all intellectual property and proprietary
+* rights in and to this software, related documentation and any modifications thereto.
+* Any use, reproduction, disclosure or distribution of this software and related
+* documentation without an express license agreement from NVIDIA Corporation is strictly
+* prohibited.
+*
+* TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, THIS SOFTWARE IS PROVIDED *AS IS*
+* AND NVIDIA AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES, EITHER EXPRESS OR IMPLIED,
+* INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+* PARTICULAR PURPOSE. IN NO EVENT SHALL NVIDIA OR ITS SUPPLIERS BE LIABLE FOR ANY
+* SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT
+* LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF
+* BUSINESS INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
+* INABILITY TO USE THIS SOFTWARE, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+* SUCH DAMAGES.
+*/
+
+
+#ifndef NVSDK_NGX_PARAMS_DLSSG_H
+#define NVSDK_NGX_PARAMS_DLSSG_H
+
+#include <stdint.h> // for uint64_t
+
+#include "nvsdk_ngx.h" // DX11/12 here
+#include "nvsdk_ngx_defs.h"
+
+typedef struct NVSDK_NGX_DLSSG_Create_Params
+{
+ unsigned int Width;
+ unsigned int Height;
+ unsigned int NativeBackbufferFormat;
+ unsigned int RenderWidth;
+ unsigned int RenderHeight;
+ bool DynamicResolutionScaling;
+} NVSDK_NGX_DLSSG_Create_Params;
+
+typedef struct NVSDK_NGX_DLSSG_Opt_Eval_Params
+{
+ //! Number of intermediate frames to generate between rendered frames
+ //! (1 = 2x, 2 = 3x, etc.)
+ unsigned int multiFrameCount = 1;
+ //! The index (starting at 1) of the intermediate frame being generated, up
+ //! to multiFrameCount (inclusive)
+ unsigned int multiFrameIndex = 1;
+
+ //! IMPORTANT: All matrices should NOT contain temporal AA jitter offset
+ //! Specifies matrix transformation from the camera view to the clip space.
+ float cameraViewToClip[4][4];
+ //! Specifies matrix transformation from the clip space to the camera view space.
+ float clipToCameraView[4][4];
+ //! Specifies matrix transformation describing lens distortion in clip space.
+ float clipToLensClip[4][4];
+ //! Specifies matrix transformation from the current clip to the previous clip space.
+ float clipToPrevClip[4][4];
+ //! Specifies matrix transformation from the previous clip to the current clip space.
+ float prevClipToClip[4][4];
+
+ //! Specifies clip space jitter offset
+ float jitterOffset[2];
+ //! Specifies scale factors used to normalize motion vectors (so the values are in [-1,1] range)
+ float mvecScale[2];
+ //! Specifies camera pinhole offset.
+ float cameraPinholeOffset[2];
+ //! Specifies camera position in world space.
+ float cameraPos[3];
+ //! Specifies camera up vector in world space.
+ float cameraUp[3];
+ //! Specifies camera right vector in world space.
+ float cameraRight[3];
+ //! Specifies camera forward vector in world space.
+ float cameraFwd[3];
+
+ //! Specifies camera near view plane distance.
+ float cameraNear;
+ //! Specifies camera far view plane distance.
+ float cameraFar;
+ //! Specifies camera field of view in radians.
+ float cameraFOV;
+ //! Specifies camera aspect ratio defined as view space width divided by height.
+ float cameraAspectRatio;
+
+ //! Specifies if tagged color buffers are full HDR (rendering to an HDR monitor) or not
+ bool colorBuffersHDR;
+ //! Specifies if depth values are inverted (value closer to the camera is higher) or not.
+ bool depthInverted;
+ //! Specifies if camera motion is included in the MVec buffer.
+ bool cameraMotionIncluded;
+ //! Specifies if previous frame has no connection to the current one (motion vectors are invalid)
+ bool reset;
+ //! Specifies if Automode overrode the input Reset flag to true.
+ bool automodeOverrideReset;
+ //! Specifies if application is not currently rendering game frames (paused in menu, playing video cut-scenes)
+ bool notRenderingGameFrames;
+ //! Specifies if orthographic projection is used or not.
+ bool orthoProjection;
+
+ //! Specifies which value represents an invalid (un-initialized) value in the motion vectors buffer
+ float motionVectorsInvalidValue;
+ //! Specifies if motion vectors are already dilated or not.
+ bool motionVectorsDilated;
+
+ //! Specifies whether or not fullscreen menu detection should be run
+ bool menuDetectionEnabled;
+
+ NVSDK_NGX_Coordinates mvecsSubrectBase = { 0, 0 };
+ NVSDK_NGX_Dimensions mvecsSubrectSize = { 0, 0 };
+ NVSDK_NGX_Coordinates depthSubrectBase = { 0, 0 };
+ NVSDK_NGX_Dimensions depthSubrectSize = { 0, 0 };
+
+ NVSDK_NGX_Coordinates hudLessSubrectBase = { 0, 0 };
+ NVSDK_NGX_Dimensions hudLessSubrectSize = { 0, 0 };
+ NVSDK_NGX_Coordinates uiSubrectBase = { 0, 0 };
+ NVSDK_NGX_Dimensions uiSubrectSize = { 0, 0 };
+ NVSDK_NGX_Coordinates uiAlphaSubrectBase = { 0, 0 };
+ NVSDK_NGX_Dimensions uiAlphaSubrectSize = { 0, 0 };
+
+ NVSDK_NGX_Coordinates bidirectionalDistFieldSubrectBase = { 0, 0 };
+ NVSDK_NGX_Dimensions bidirectionalDistFieldSubrectSize = { 0, 0 };
+ NVSDK_NGX_PrecisionInfo bidirectionalDistFieldPrecisionInfo = { 0, 0.0f, 0.0f };
+
+ //! Optional heuristic that specifies the minimum depth difference between two objects in screen-space.
+ //! See comment above NVSDK_NGX_DLSSG_Parameter_MinRelativeLinearDepthObjectSeparation for details.
+ float minRelativeLinearDepthObjectSeparation = 40.0f;
+
+ NVSDK_NGX_Coordinates backbufferSubrectBase = { 0, 0 };
+ NVSDK_NGX_Dimensions backbufferSubrectSize = { 0, 0 };
+
+ NVSDK_NGX_Coordinates outputInterpSubrectBase = { 0, 0 };
+ NVSDK_NGX_Dimensions outputInterpSubrectSize = { 0, 0 };
+ NVSDK_NGX_Coordinates outputRealSubrectBase = { 0, 0 };
+ NVSDK_NGX_Dimensions outputRealSubrectSize = { 0, 0 };
+} NVSDK_NGX_DLSSG_Opt_Eval_Params;
+
+#endif // NVSDK_NGX_PARAMS_DLSSG_H
diff --git a/native/NVIDIA-DLSS/include/nvsdk_ngx_vk.h b/native/NVIDIA-DLSS/include/nvsdk_ngx_vk.h
new file mode 100644
index 0000000..09eb3f8
--- /dev/null
+++ b/native/NVIDIA-DLSS/include/nvsdk_ngx_vk.h
@@ -0,0 +1,768 @@
+/*
+ * SPDX-FileCopyrightText: Copyright (c) 2019-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+ * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
+ *
+ * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
+ * property and proprietary rights in and to this material, related
+ * documentation and any modifications thereto. Any use, reproduction,
+ * disclosure or distribution of this material and related documentation
+ * without an express license agreement from NVIDIA CORPORATION or
+ * its affiliates is strictly prohibited.
+ */
+
+/*
+* HOW TO USE:
+*
+* IMPORTANT: Methods in this library are NOT thread safe. It is up to the
+* client to ensure that thread safety is enforced as needed.
+*
+* 1) Call NVSDK_CONV NVSDK_NGX_D3D11/D3D12/CUDA_Init and pass your app Id
+* and other parameters. This will initialize SDK or return an error code
+* if SDK cannot run on target machine. Depending on error user might
+* need to update drivers. Please note that application Id is provided
+* by NVIDIA so if you do not have one please contact us.
+*
+* 2) Call NVSDK_NGX_D3D11/D3D12/CUDA_GetParameters to obtain pointer to
+* interface used to pass parameters to SDK. Interface instance is
+* allocated and released by SDK so there is no need to do any memory
+* management on client side.
+*
+* 3) Set key parameters for the feature you want to use. For example,
+* width and height are required for all features and they can be
+* set like this:
+* Params->Set(NVSDK_NGX_Parameter_Width,MY_WIDTH);
+* Params->Set(NVSDK_NGX_Parameter_Height,MY_HEIGHT);
+*
+* Please refer to samples since different features need different
+* parameters and hints.
+*
+* 4) Call NVSDK_NGX_D3D11/D3D12/CUDA_GetScratchBufferSize to obtain size of
+* the scratch buffer needed by specific feature. This D3D or CUDA buffer
+* should be allocated by client and passed as:
+* Params->Set(NVSDK_NGX_Parameter_Scratch,MY_SCRATCH_POINTER)
+* Params->Set(NVSDK_NGX_Parameter_Scratch_SizeInBytes,MY_SCRATCH_SIZE_IN_BYTES)
+* NOTE: Returned size can be 0 if feature does not use any scratch buffer.
+* It is OK to use bigger buffer or reuse buffers across features as long
+* as minimum size requirement is met.
+*
+* 5) Call NVSDK_NGX_D3D11/D3D12/CUDA_CreateFeature to create feature you need.
+* On success SDK will return a handle which must be used in any successive
+* calls to SDK which require feature handle. SDK will use all parameters
+* and hints provided by client to generate feature. If feature with the same
+* parameters already exists and error code will be returned.
+*
+* 6) Call NVSDK_NGX_D3D11/D3D12/CUDA_EvaluateFeature to invoke execution of
+* specific feature. Before feature can be evaluated input parameters must
+* be specified (like for example color/albedo buffer, motion vectors etc)
+*
+* 6) Call NVSDK_NGX_D3D11/D3D12/CUDA_ReleaseFeature when feature is no longer
+* needed. After this call feature handle becomes invalid and cannot be used.
+*
+* 7) Call NVSDK_NGX_D3D11/D3D12/CUDA_Shutdown when SDK is no longer needed to
+* release all resources.
+
+* Contact: [email protected]
+*/
+
+
+#ifndef NVSDK_NGX_VK_H
+#define NVSDK_NGX_VK_H
+
+#include "nvsdk_ngx_defs.h"
+#include "nvsdk_ngx_defs_vk.h"
+#include "nvsdk_ngx_params.h"
+#ifndef __cplusplus
+#include <stdbool.h>
+#include <wchar.h>
+#endif
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_VULKAN_RequiredExtensions [Vulkan only]
+// -------------------------------------
+// DEPRECATED: Use NVSDK_NGX_VULKAN_GetFeatureInstanceExtensionRequirements() and
+// NVSDK_NGX_VULKAN_GetFeatureRequirements() instead.
+//
+// Retrieves the instance and device extensions required by NGX.
+//
+// DESCRIPTION:
+// This function returns the instance and device extensions required by
+// NGX. It is deprecated and should be replaced with
+// NVSDK_NGX_VULKAN_GetFeatureInstanceExtensionRequirements() and
+// NVSDK_NGX_VULKAN_GetFeatureRequirements().
+//
+// PARAMETERS:
+// OutInstanceExtCount:
+// Returns the number of instance extensions NGX requires.
+//
+// OutInstanceExts:
+// Returns a pointer to *OutInstanceExtCount strings of instance extensions.
+//
+// OutDeviceExtCount:
+// Returns the number of device extensions NGX requires.
+//
+// OutDeviceExts:
+// Returns a pointer to *OutDeviceExtCount strings of device extensions.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure.
+//
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_RequiredExtensions(unsigned int *OutInstanceExtCount, const char ***OutInstanceExts, unsigned int *OutDeviceExtCount, const char ***OutDeviceExts);
+
+// NOTE: Functions under the same name and different function signatures exist
+// between the NGX SDK, NGX Core (driver), and NGX Snippets. To discern the
+// different signatures here we check if NGX_SNIPPET_BUILD is defined. When that
+// is the case we know that the function signature in-use should be that of
+// between NGX Core and the Snippet. Otherwise the signature should be between
+// NGX SDK and NGX Core.
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_Init
+// -----------------------------------------------------------------------------
+// Initializes a new SDK instance.
+//
+// DESCRIPTION:
+// Initializes a new SDK instance. Most NGX SDK functions require the NGX
+// SDK to be initialized for the corresponding graphics API and device to
+// function properly.
+//
+// NVSDK_NGX_Init requires an application ID provided by NVIDIA. If an
+// application ID is not available, use NVSDK_NGX_Init_with_ProjectID to
+// supply your own identifier.
+//
+// Be sure to call NVSDK_NGX_Shutdown to shut down the SDK when it is no
+// longer needed.
+//
+// PARAMETERS:
+// InApplicationId:
+// Unique ID provided by NVIDIA.
+//
+// InApplicationDataPath:
+// Directory to store logs and other temporary files. Write access is
+// required. Typically, this would be next to the application executable,
+// or in a location like Documents or ProgramData.
+//
+// InInstance/InPD/InDevice:
+// Vulkan Instance, PhysicalDevice, and Device to use.
+//
+// InGIPA/InGDPA:
+// Optional Vulkan function pointers to vkGetInstanceProcAddr and
+// vkGetDeviceProcAddr.
+//
+// InFeatureInfo:
+// Contains information common to all features, including a list of paths
+// where feature DLLs can be located, other than the default path (application directory).
+//
+// InSDKVersion:
+// Version of the SDK currently in use. Typically, this should be left as
+// the default value, NVSDK_NGX_Version_API.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure. Common values include:
+// - NVSDK_NGX_Result_Success if the function executed successfully
+// - NVSDK_NGX_Result_FAIL_FeatureNotSupported if the NGX SDK is not
+// supported on the current system
+// Check the NGX logs for additional information about any failures.
+//
+#if defined(NGX_SNIPPET_BUILD)
+#ifdef __cplusplus
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Init_Ext(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API, const NVSDK_NGX_Parameter *InParameters = nullptr);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Init_Ext2(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, PFN_vkGetInstanceProcAddr InGIPA = nullptr, PFN_vkGetDeviceProcAddr InGDPA = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API, const NVSDK_NGX_Parameter *InParameters = nullptr);
+#else
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, NVSDK_NGX_Version InSDKVersion);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Init_Ext(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, NVSDK_NGX_Version InSDKVersion, const NVSDK_NGX_Parameter *InParameters);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Init_Ext2(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, PFN_vkGetInstanceProcAddr InGIPA, PFN_vkGetDeviceProcAddr InGDPA, NVSDK_NGX_Version InSDKVersion, const NVSDK_NGX_Parameter *InParameters);
+#endif
+#else
+#ifdef __cplusplus
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, PFN_vkGetInstanceProcAddr InGIPA = nullptr, PFN_vkGetDeviceProcAddr InGDPA = nullptr, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API);
+#else
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Init(unsigned long long InApplicationId, const wchar_t *InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, PFN_vkGetInstanceProcAddr InGIPA, PFN_vkGetDeviceProcAddr InGDPA, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion);
+#endif
+#endif // defined(NGX_SNIPPET_BUILD)
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_Init_with_ProjectID
+// -----------------------------------------------------------------------------
+// Initializes a new SDK instance using a project ID.
+//
+// DESCRIPTION:
+// Initializes a new SDK instance. Most NGX SDK functions require the NGX
+// SDK to be initialized for the corresponding graphics API and device to
+// function properly.
+//
+// Applications must provide a unique identifier to initialize the NGX SDK.
+// If an identifier was provided by NVIDIA, use NVSDK_NGX_Init instead.
+//
+// For projects using third-party engines such as Unreal Engine or
+// Omniverse, the integration for those engines should handle providing the
+// correct Project ID to NGX. Ensure that the project ID is set in the
+// engine's editor.
+//
+// For other engines, use NVSDK_NGX_EngineType CUSTOM. The driver will
+// validate that the Project ID is GUID-like, for example,
+// "a0f57b54-1daf-4934-90ae-c4035c19df04". Ensure your project ID matches
+// this format.
+//
+// Be sure to call NVSDK_NGX_Shutdown to shut down the SDK when it is no
+// longer needed.
+//
+// PARAMETERS:
+// InProjectId:
+// Unique ID provided by the rendering engine used. Must be a GUID-like
+// string.
+//
+// InEngineType:
+// Rendering engine used by the application/plugin. Use NVSDK_NGX_EngineType
+// CUSTOM if the specific engine type is not explicitly supported.
+//
+// InEngineVersion:
+// Version number of the rendering engine used by the application/plugin.
+//
+// InApplicationDataPath:
+// Directory to store logs and other temporary files (write access required).
+//
+// InInstance/InPD/InDevice:
+// Vulkan Instance, PhysicalDevice, and Device to use.
+//
+// InGIPA/InGDPA:
+// Optional Vulkan function pointers to vkGetInstanceProcAddr and
+// vkGetDeviceProcAddr.
+//
+// InFeatureInfo:
+// Contains information common to all features, including a list of paths
+// where feature DLLs can be located in addition to the default path
+// (the application directory).
+//
+// InSDKVersion:
+// Version of the SDK currently in use. Typically, this should be left as
+// the default value, NVSDK_NGX_Version_API.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure. Common values include:
+// - NVSDK_NGX_Result_Success if the function executed successfully
+// - NVSDK_NGX_Result_InvalidParameter if the provided project ID is in
+// an invalid format
+// - NVSDK_NGX_Result_FAIL_FeatureNotSupported if the NGX SDK is not
+// supported on the current system
+// Check the NGX logs for additional information about any failures.
+//
+#if defined(NGX_SNIPPET_BUILD)
+// No NGX Core <---> Snippet interfaces
+#else
+#ifdef __cplusplus
+NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Init_with_ProjectID(const char *InProjectId, NVSDK_NGX_EngineType InEngineType, const char *InEngineVersion, const wchar_t *InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, PFN_vkGetInstanceProcAddr InGIPA = nullptr, PFN_vkGetDeviceProcAddr InGDPA = nullptr, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo = nullptr, NVSDK_NGX_Version InSDKVersion = NVSDK_NGX_Version_API);
+#else
+NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Init_with_ProjectID(const char *InProjectId, NVSDK_NGX_EngineType InEngineType, const char *InEngineVersion, const wchar_t *InApplicationDataPath, VkInstance InInstance, VkPhysicalDevice InPD, VkDevice InDevice, PFN_vkGetInstanceProcAddr InGIPA, PFN_vkGetDeviceProcAddr InGDPA, const NVSDK_NGX_FeatureCommonInfo *InFeatureInfo, NVSDK_NGX_Version InSDKVersion);
+#endif
+#endif // defined(NGX_SNIPPET_BUILD)
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_Shutdown
+// -----------------------------------------------------------------------------
+// Shuts down the current SDK instance and releases all resources.
+//
+// DESCRIPTION:
+// Shuts down the current SDK instance and releases all resources. If a
+// device is provided, NVSDK_NGX_Shutdown1 shuts down the instance
+// corresponding to the specified device. If nullptr is provided, all
+// instances are shut down.
+//
+// Deprecation Notice: The use of Shutdown() is deprecated. Please use
+// Shutdown1(nullptr) instead.
+//
+// PARAMETERS:
+// InDevice:
+// Device to shut down. If nullptr, the SDK is shut down for all devices.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure.
+//
+#ifdef NGX_ENABLE_DEPRECATED_SHUTDOWN
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Shutdown(void);
+#endif
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_Shutdown1(VkDevice InDevice);
+
+#ifdef NGX_ENABLE_DEPRECATED_GET_PARAMETERS
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_GetParameters
+// -----------------------------------------------------------------------------
+// Retrieves a parameter map used to set parameters needed by the SDK.
+//
+// DEPRECATED: Use NVSDK_NGX_AllocateParameters or
+// NVSDK_NGX_GetCapabilityParameters instead.
+//
+// DESCRIPTION:
+// Retrieves the common NVSDK_NGX_Parameter map for providing parameters to
+// the SDK. The NVSDK_NGX_Parameter interface allows simple parameter setup
+// using named fields. For example, set the width by calling
+// Parameters->Set(NVSDK_NGX_Parameter_Width, 100) or provide a resource
+// pointer by calling Parameters->Set(NVSDK_NGX_Parameter_Color, resource).
+// For more details, see the sample code.
+//
+// Parameter maps returned by NVSDK_NGX_GetParameters are pre-populated
+// with NGX capabilities and available features. Unlike
+// NVSDK_NGX_AllocateParameters, parameter maps returned by
+// NVSDK_NGX_GetParameters have their lifetimes managed by NGX and must not
+// be destroyed by the application using NVSDK_NGX_DestroyParameters.
+//
+// This function may only be called after a successful call to
+// NVSDK_NGX_Init.
+//
+// Note: Allocated memory will be freed by NGX, so do not use the
+// free/delete operator.
+//
+// Deprecation Notice: NVSDK_NGX_GetParameters is deprecated. Applications
+// should use NVSDK_NGX_AllocateParameters and
+// NVSDK_NGX_GetCapabilityParameters when possible. However, if there is a
+// possibility that the user may be using an older driver version (driver
+// version 445 or older), NVSDK_NGX_GetParameters may still be used as a
+// fallback if NVSDK_NGX_AllocateParameters or
+// NVSDK_NGX_GetCapabilityParameters return
+// NVSDK_NGX_Result_FAIL_OutOfDate.
+//
+// PARAMETERS:
+// OutParameters:
+// Output pointer that will be populated with an NVSDK_NGX_Parameter
+// interface.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure.
+//
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_GetParameters(NVSDK_NGX_Parameter **OutParameters);
+#endif // NGX_ENABLE_DEPRECATED_GET_PARAMETERS
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_AllocateParameters
+// -----------------------------------------------------------------------------
+// Allocates a parameter map used to set parameters needed by the SDK.
+//
+// DESCRIPTION:
+// Allocates a new NVSDK_NGX_Parameter map for providing parameters to the
+// SDK. The lifetime of this parameter map must be managed by the
+// application. The NVSDK_NGX_Parameter interface allows simple parameter
+// setup using named fields. For example, set the width by calling
+// Parameters->Set(NVSDK_NGX_Parameter_Width, 100) or provide a resource
+// pointer by calling Parameters->Set(NVSDK_NGX_Parameter_Color, resource).
+// For more details, see the sample code.
+//
+// Use NVSDK_NGX_DestroyParameters to free a parameter map created by
+// NVSDK_NGX_AllocateParameters. Parameter maps created by
+// NVSDK_NGX_AllocateParameters must NOT be freed using the free/delete
+// operator.
+//
+// Parameter maps created by NVSDK_NGX_AllocateParameters do not come
+// pre-populated with NGX capabilities and available features. To create a
+// new parameter map pre-populated with such information, use
+// NVSDK_NGX_GetCapabilityParameters instead.
+//
+// This function may return NVSDK_NGX_Result_FAIL_OutOfDate if using an
+// older driver that does not support this API call. In such a case,
+// NVSDK_NGX_GetParameters may be used as a fallback.
+//
+// This function may only be called after a successful call to
+// NVSDK_NGX_Init.
+//
+// PARAMETERS:
+// OutParameters:
+// Output pointer that will be populated with the newly-allocated
+// NVSDK_NGX_Parameter interface.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure. Common values include:
+// - NVSDK_NGX_Result_Success if the function executed successfully
+// - NVSDK_NGX_Result_FAIL_OutOfDate if this function is not supported by
+// the current display driver
+// Check the NGX logs for additional information about any failures.
+//
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_AllocateParameters(NVSDK_NGX_Parameter** OutParameters);
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_GetCapabilityParameters
+// -----------------------------------------------------------------------------
+// Allocates a parameter map populated with NGX and feature capabilities.
+//
+// DESCRIPTION:
+// Allocates a new NVSDK_NGX_Parameter map pre-populated with NGX
+// capabilities and information about available features. The output
+// parameter map can also be used in the same ways as a parameter map
+// allocated with NVSDK_NGX_AllocateParameters. However, it is not
+// recommended to use NVSDK_NGX_GetCapabilityParameters unless querying NGX
+// capabilities due to the overhead associated with pre-populating the
+// parameter map.
+//
+// Use NVSDK_NGX_DestroyParameters to free a parameter map created by
+// NVSDK_NGX_GetCapabilityParameters. Parameter maps created by
+// NVSDK_NGX_GetCapabilityParameters must NOT be freed using the
+// free/delete operator.
+//
+// This function may return NVSDK_NGX_Result_FAIL_OutOfDate if using an
+// older driver that does not support this API call. In such a case,
+// NVSDK_NGX_GetParameters may be used as a fallback.
+//
+// This function may only be called after a successful call to
+// NVSDK_NGX_Init.
+//
+// PARAMETERS:
+// OutParameters:
+// Output pointer that will be populated with the newly-allocated
+// NVSDK_NGX_Parameter interface.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure. Common values include:
+// - NVSDK_NGX_Result_Success if the function executed successfully
+// - NVSDK_NGX_Result_FAIL_OutOfDate if this function is not supported by
+// the current display driver
+// Check the NGX logs for additional information about any failures.
+//
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_GetCapabilityParameters(NVSDK_NGX_Parameter** OutParameters);
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_DestroyParameters
+// -----------------------------------------------------------------------------
+// Destroys the specified parameter map.
+//
+// DESCRIPTION:
+// Destroys the input parameter map. Once NVSDK_NGX_DestroyParameters is
+// called on a parameter map, it must not be used again.
+//
+// NVSDK_NGX_DestroyParameters must not be called on any parameter map
+// returned by NVSDK_NGX_GetParameters; NGX will manage the lifetime of
+// those parameter maps.
+//
+// This function may only be called after a successful call to
+// NVSDK_NGX_Init.
+//
+// PARAMETERS:
+// InParameters:
+// The parameter map to be destroyed.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure.
+//
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_DestroyParameters(NVSDK_NGX_Parameter* InParameters);
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_GetScratchBufferSize
+// -----------------------------------------------------------------------------
+// Retrieves the size of the scratch buffer needed for the specified feature.
+//
+// DESCRIPTION:
+// The SDK requires a buffer of a certain size provided by the client to
+// initialize some NGX features. Once the feature is no longer needed, the
+// buffer can be released. It is safe to reuse the same scratch buffer for
+// different features as long as the minimum size requirement is met for
+// all features. Some features might not need a scratch buffer, so a return
+// size of 0 is completely valid.
+//
+// Note: Most current NGX features do not use scratch buffers. Please check
+// the documentation for the particular feature in use to determine whether
+// a scratch buffer needs to be created.
+//
+// PARAMETERS:
+// InFeatureId:
+// Identifier of the feature to query.
+//
+// InParameters:
+// Parameters used by the feature to determine scratch buffer size.
+//
+// OutSizeInBytes:
+// Number of bytes needed for the scratch buffer for the specified feature.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure.
+//
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_GetScratchBufferSize(NVSDK_NGX_Feature InFeatureId, const NVSDK_NGX_Parameter *InParameters, size_t *OutSizeInBytes);
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_CreateFeature
+// -----------------------------------------------------------------------------
+// Creates and initializes an instance of the specified NGX feature.
+//
+// DESCRIPTION:
+// Each feature needs to be created before it can be used. The parameters
+// required to create the feature vary. Refer to the feature's
+// documentation and/or sample code to find out which input parameters are
+// needed to create a specific feature.
+//
+// NVSDK_NGX_CreateFeature creates an NVSDK_NGX_Handle to the feature, which
+// is needed to reference the feature in later calls to
+// NVSDK_NGX_EvaluateFeature. Multiple instances of the same feature may be
+// created, and evaluating one instance of a feature should not change the
+// state of other instances.
+//
+// When a feature instance is no longer needed, it should be freed using
+// NVSDK_NGX_ReleaseFeature.
+//
+// If multiple devices are in use, the device to create the
+// feature on must be specified using CreateFeature1().
+//
+// PARAMETERS:
+// InCmdBuffer:
+// Command buffer to use to execute GPU commands. Must be open and
+// recording.
+//
+// InDevice:
+// Vulkan device on which to create the feature.
+//
+// InFeatureID:
+// Identifier of the feature to initialize.
+//
+// InParameters:
+// Parameters used to create the feature.
+//
+// OutHandle:
+// Handle which uniquely identifies the feature.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure. Common values include:
+// - NVSDK_NGX_Result_Success if the function executed successfully
+// - NVSDK_NGX_Result_FAIL_UnableToInitializeFeature if the feature
+// cannot be created, for example, because the feature is not supported
+// on the current hardware, or because the DLL could not be found
+// - NVSDK_NGX_Result_FAIL_InvalidParameter if any of the input
+// parameters are invalid
+// - NVSDK_NGX_Result_FAIL_FeatureAlreadyExists if a feature instance
+// with the same parameters has already been created, and the feature
+// doesn't allow multiple instances to be created with the same
+// parameters.
+// Check the NGX logs for additional information about any failures.
+//
+#if defined(NGX_SNIPPET_BUILD)
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_CreateFeature(VkCommandBuffer InCmdList, NVSDK_NGX_Feature InFeatureID, const NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_CreateFeature1(VkDevice InDevice, VkCommandBuffer InCmdList, NVSDK_NGX_Feature InFeatureID, const NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle);
+#else
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_CreateFeature(VkCommandBuffer InCmdBuffer, NVSDK_NGX_Feature InFeatureID, NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle);
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_CreateFeature1(VkDevice InDevice, VkCommandBuffer InCmdList, NVSDK_NGX_Feature InFeatureID, NVSDK_NGX_Parameter *InParameters, NVSDK_NGX_Handle **OutHandle);
+#endif // defined(NGX_SNIPPET_BUILD)
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_ReleaseFeature
+// -----------------------------------------------------------------------------
+// Releases the specified NGX feature.
+//
+// DESCRIPTION:
+// Releases the feature associated with the given handle and frees its
+// memory. Handles are not reference counted, so after this call, it is
+// invalid to use the provided handle.
+//
+// PARAMETERS:
+// InHandle:
+// Handle to the feature to be released.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure.
+//
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_ReleaseFeature(NVSDK_NGX_Handle *InHandle);
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_GetFeatureRequirements
+// -----------------------------------------------------------------------------
+// Identifies system requirements to support a given NGX feature.
+//
+// DESCRIPTION:
+// Utility function used to identify system requirements to support a given
+// NGX feature on a system, given its display device subsystem adapter
+// information that will be subsequently used for creating the graphics
+// device. The output parameter OutSupported will be populated with
+// requirements and is valid if and only if the function returns
+// NVSDK_NGX_Result_Success. The result includes:
+// - FeatureSupported: Bitfield of reasons why the feature is
+// unsupported, as specified in NVSDK_NGX_Feature_Support_Result. 0 if
+// the feature is supported
+// - MinHWArchitecture: The hardware architecture version corresponding
+// to an NV_GPU_ARCHITECTURE_ID value defined in the NvAPI GPU
+// Framework
+// - MinOSVersion: The minimum OS version required for the provided
+// feature
+//
+// NVSDK_NGX_Init does NOT need to be called before calling this function.
+// Applications may wish to use this function to determine whether a
+// desired feature is supported before initializing the complete SDK.
+//
+// PARAMETERS:
+// Instance:
+// VkInstance in use by the application.
+//
+// InPhysicalDevice:
+// VkPhysicalDevice in use by the application.
+//
+// FeatureDiscoveryInfo:
+// Struct containing information about the feature to query and how it is
+// expected to be initialized, including the feature ID and information
+// that would be provided to NVSDK_NGX_Init.
+//
+// OutSupported:
+// Populated with the requirements for the specified feature.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure.
+//
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_GetFeatureRequirements(const VkInstance Instance,
+ const VkPhysicalDevice PhysicalDevice,
+ const NVSDK_NGX_FeatureDiscoveryInfo *FeatureDiscoveryInfo,
+ NVSDK_NGX_FeatureRequirement *OutSupported);
+
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_VULKAN_GetFeatureInstanceExtensionRequirements
+// -----------------------------------------------------------------------------
+// Identifies Vulkan instance extensions required for NGX feature support.
+//
+// DESCRIPTION:
+// This utility function identifies the Vulkan instance extensions required
+// for a specific NGX feature, specified by its feature ID. The function
+// populates OutExtensionCount with the number of extensions required for
+// the NGX feature. It also populates OutExtensionProperties with a pointer
+// to an array of VkExtensionProperties structures, which contains details
+// about each required extension. The size of this array is equal to
+// OutExtensionCount.
+//
+// NVSDK_NGX_Init does NOT need to be called before calling this function.
+// This function should be called before the VkInstance for the application
+// is created so that the correct extensions can be enabled.
+//
+// PARAMETERS:
+// FeatureDiscoveryInfo:
+// Struct containing information about the feature to query and how it is
+// expected to be initialized, including the feature ID and information
+// that would be provided to NVSDK_NGX_Init.
+//
+// OutExtensionCount:
+// Output pointer that will be populated with the number of required
+// instance extensions.
+//
+// OutExtensionProperties:
+// Output pointer that will be populated with an array of
+// VkExtensionProperties structures required by the given feature.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure.
+//
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_GetFeatureInstanceExtensionRequirements(const NVSDK_NGX_FeatureDiscoveryInfo *FeatureDiscoveryInfo,
+ uint32_t *OutExtensionCount,
+ VkExtensionProperties **OutExtensionProperties);
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_VULKAN_GetFeatureDeviceExtensionRequirements
+// -----------------------------------------------------------------------------
+// Identifies Vulkan device extensions required for NGX feature support.
+//
+// DESCRIPTION:
+// This utility function identifies the Vulkan device extensions required
+// for a specific NGX feature, specified by its feature ID, and a given
+// VkInstance and VkPhysicalDevice. The function populates
+// OutExtensionCount with the number of extensions required for the NGX
+// feature. It also populates OutExtensionProperties with a pointer to an
+// array of VkExtensionProperties structures, which contains details about
+// each required extension. The size of this array is equal to
+// OutExtensionCount.
+//
+// NVSDK_NGX_Init does NOT need to be called before calling this function.
+// This function should be called before the VkDevice for the application
+// is created so that the correct extensions can be enabled.
+//
+// PARAMETERS:
+// Instance:
+// VkInstance in use by the application.
+//
+// InPhysicalDevice:
+// VkPhysicalDevice in use by the application.
+//
+// FeatureDiscoveryInfo:
+// Struct containing information about the feature to query and how it is
+// expected to be initialized, including the feature ID and information
+// that would be provided to NVSDK_NGX_Init.
+//
+// OutExtensionCount:
+// Output pointer that will be populated with the number of required
+// device extensions.
+//
+// OutExtensionProperties:
+// Output pointer that will be populated with an array of
+// VkExtensionProperties structures required by the given feature.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure.
+//
+#if defined(NGX_SNIPPET_BUILD)
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_GetFeatureDeviceExtensionRequirements(const VkInstance Instance,
+ const VkPhysicalDevice PhysicalDevice,
+ const NVSDK_NGX_FeatureDiscoveryInfo *FeatureDiscoveryInfo,
+ uint32_t *OutExtensionCount,
+ VkExtensionProperties **OutExtensionProperties);
+#else
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_GetFeatureDeviceExtensionRequirements(VkInstance Instance,
+ VkPhysicalDevice PhysicalDevice,
+ const NVSDK_NGX_FeatureDiscoveryInfo *FeatureDiscoveryInfo,
+ uint32_t *OutExtensionCount,
+ VkExtensionProperties **OutExtensionProperties);
+#endif // defined(NGX_SNIPPET_BUILD)
+
+////////////////////////////////////////////////////////////////////////////////
+// NVSDK_NGX_EvaluateFeature
+// -----------------------------------------------------------------------------
+// Evaluates the specified NGX feature using the provided parameters.
+//
+// DESCRIPTION:
+// Evaluates the given feature using the provided parameters. The
+// parameters required to evaluate a feature vary. Refer to the feature's
+// documentation and sample code to determine which input parameters are
+// needed.
+//
+// To evaluate a feature, an NVSDK_NGX_Handle to an instance of that
+// feature, created with NVSDK_NGX_CreateFeature, must be provided.
+//
+// For most features, it is beneficial to pass as many input buffers and
+// parameters as possible (e.g., provide all render targets like color,
+// albedo, normals, depth, etc.). This will ensure maximum future
+// compatibility with new updates.
+//
+// PARAMETERS:
+// InCmdBuffer:
+// Command buffer to use to execute GPU commands. Must be open and
+// recording.
+//
+// InFeatureHandle:
+// Handle representing the feature to be evaluated.
+//
+// InParameters:
+// List of parameters required to evaluate the feature.
+//
+// InCallback:
+// Optional callback for features that might take longer to execute. If
+// specified, the SDK will call it with progress values in the range 0.0f -
+// 1.0f. Not all features support progress callbacks. Refer to the
+// documentation for the specific feature to determine whether or not
+// progress callbacks are supported.
+//
+// RETURNS:
+// NVSDK_NGX_Result indicating success or failure. Common values include:
+// - NVSDK_NGX_Result_Success if the function executed successfully.
+// - NVSDK_NGX_Result_FAIL_InvalidParameter if any of the input
+// parameters are missing or invalid.
+// - NVSDK_NGX_Result_FAIL_FeatureNotFound if a feature with the provided
+// handle could not be found.
+// Check the NGX logs for additional information about any failures.
+//
+#ifdef __cplusplus
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_EvaluateFeature(VkCommandBuffer InCmdList, const NVSDK_NGX_Handle *InFeatureHandle, const NVSDK_NGX_Parameter *InParameters, PFN_NVSDK_NGX_ProgressCallback InCallback = NULL);
+#endif
+NVSDK_NGX_API NVSDK_NGX_Result NVSDK_CONV NVSDK_NGX_VULKAN_EvaluateFeature_C(VkCommandBuffer InCmdList, const NVSDK_NGX_Handle *InFeatureHandle, const NVSDK_NGX_Parameter *InParameters, PFN_NVSDK_NGX_ProgressCallback_C InCallback);
+
+#if defined(NGX_SNIPPET_BUILD)
+// No NGX Core <---> Snippet interfaces
+#else
+// NGX return-code conversion-to-string utility only as a helper for debugging/logging - not for official use.
+const wchar_t* NVSDK_CONV GetNGXResultAsString(NVSDK_NGX_Result InNGXResult);
+#endif
+
+#ifdef __cplusplus
+} // extern "C"
+#endif
+
+#endif // #define NVSDK_NGX_VK_H
diff --git a/native/NVIDIA-DLSS/lib/Windows_x86_64/x64/nvsdk_ngx_d.lib b/native/NVIDIA-DLSS/lib/Windows_x86_64/x64/nvsdk_ngx_d.lib
new file mode 100644
index 0000000..6887933
Binary files /dev/null and b/native/NVIDIA-DLSS/lib/Windows_x86_64/x64/nvsdk_ngx_d.lib differ
diff --git a/native/build_native.bat b/native/build_native.bat
new file mode 100644
index 0000000..2df2fc6
--- /dev/null
+++ b/native/build_native.bat
@@ -0,0 +1,12 @@
+@echo off
+setlocal
+cd /d "%~dp0\.."
+call "C:\Program Files\Microsoft Visual Studio\18\Community\VC\Auxiliary\Build\vcvars64.bat" >nul
+if errorlevel 1 exit /b 1
+if not exist "native\build" mkdir "native\build"
+cl /nologo /O2 /EHsc /W3 /MD /Fo:"native\build\\" /I"native\NVIDIA-DLSS\include" ^
+ "native\DLSS5-Feeder\host\dlss5-feed-host64.cpp" ^
+ /Fe:"bin\runtime\nvngx.dll" ^
+ /link "native\NVIDIA-DLSS\lib\Windows_x86_64\x64\nvsdk_ngx_d.lib" ^
+ version.lib kernel32.lib user32.lib gdi32.lib advapi32.lib ole32.lib
+exit /b %errorlevel%
diff --git a/others/THIRD_PARTY.md b/others/THIRD_PARTY.md
new file mode 100644
index 0000000..f3b0022
--- /dev/null
+++ b/others/THIRD_PARTY.md
@@ -0,0 +1,12 @@
+# Third-party components
+
+The application is distributed as an experimental local build. Refer to each upstream project for its full license and redistribution terms.
+
+| Component | Version/source | SHA-256 of staged runtime |
+| --- | --- | --- |
+| User-provided modified DLSSNR model | 310.8.0 approximate FP16 | `DCC0DC2414AEDEC4A8E084647070383BE068554042587180C20C784D4772D36F` |
+| Standalone direct feature-18 worker (`nvngx.dll`) | Adapted from MIT DLSS5-Feeder host | `99EF1F2976D9CD16B7FC269ADB6C6450FB64C81A522C9B9E6EDC6A28201DC904` |
+
+DLSS5-Feeder's MIT license is in `native/DLSS5-Feeder/LICENSE`. NVIDIA's SDK license is in `native/NVIDIA-DLSS/LICENSE.txt`. FFmpeg licensing information is in `bin/ffmpeg/LICENSE`.
+
+The model hash is informational only. Its modified signature is intentionally not used as a runtime rejection condition. ReShade, RenoDX, DLSS Super Resolution carrier binaries, test media, and generated outputs are not included.
diff --git a/requirements-lock.txt b/requirements-lock.txt
new file mode 100644
index 0000000..257b212
--- /dev/null
+++ b/requirements-lock.txt
@@ -0,0 +1,54 @@
+annotated-doc==0.0.5
+annotated-types==0.8.0
+anyio==4.14.2
+audioop-lts==0.2.2
+av==18.1.0
+brotli==1.2.0
+certifi==2026.7.22
+click==8.5.0
+colorama==0.4.6
+fastapi==0.141.1
+filelock==3.32.4
+fsspec==2026.7.0
+gradio==6.26.0
+gradio_client==2.6.1
+groovy==0.1.2
+h11==0.16.0
+hf-gradio==0.4.1
+hf-xet==1.6.0
+httpcore==1.0.9
+httpx==0.28.1
+huggingface_hub==1.29.0
+idna==3.19
+Jinja2==3.1.6
+markdown-it-py==4.2.0
+MarkupSafe==3.0.3
+mdurl==0.1.2
+numpy==2.5.2
+opencv-python-headless==5.0.0.93
+orjson==3.12.0
+packaging==26.3
+pandas==3.0.5
+pillow==12.3.0
+psutil==7.2.2
+pydantic==2.13.5
+pydantic_core==2.46.5
+pydub==0.25.1
+Pygments==2.21.0
+python-dateutil==2.9.0.post0
+python-multipart==0.0.32
+pytz==2026.3.post1
+PyYAML==6.0.3
+rich==15.0.0
+safehttpx==0.1.7
+semantic-version==2.10.0
+shellingham==1.5.4
+six==1.17.0
+starlette==1.6.0
+tomlkit==0.14.0
+tqdm==4.70.0
+typer==0.27.2
+typing-inspection==0.4.4
+typing_extensions==4.16.0
+tzdata==2026.3
+uvicorn==0.52.4
diff --git a/start.bat b/start.bat
new file mode 100644
index 0000000..441372e
--- /dev/null
+++ b/start.bat
@@ -0,0 +1,8 @@
+@echo off
+setlocal
+cd /d "%~dp0"
+set "PYTHONNOUSERSITE=1"
+set "PYTHONDONTWRITEBYTECODE=1"
+set "GRADIO_ANALYTICS_ENABLED=False"
+"%~dp0bin\python-3.13.15-embed-amd64\python.exe" "%~dp0app.py"
+if errorlevel 1 pause