Files
d4r/tools/d4r_motion_dilation.h
T
ayo 34e6b0fe71 rr: add FSR Ray Regeneration, exact RDNA3 inference and motion experiments
Add an experimental FSR Ray Regeneration backend for D3D12 RR requests:
- Convert depth, motion, normals and albedos into AMD denoiser inputs.
- Split and recompose diffuse/specular signals, then run Super Sampling.
- Add stability/detail controls, demodulation guards and halo limiting.
- Handle AMD provider discovery under NVIDIA GPU spoofing.
- Add runtime probes, synthetic reference scenes and per-dispatch profiling.

Add exact gfx11 DLSS-RR inference using f16 cooperative matrices:
- Reproduce FP8 conversions, accumulation and camera reprojection arithmetic.
- Widen model weights and avoid requiring VK_EXT_shader_float8.
- Extend model building, replay tools and descriptor metadata.

Expand motion preprocessing and experimental AW2 native-motion support:
- Add tiled LDS dilation, padded allocation handling and thin-only sky fill.
- Order dilation with input waits and NGX on the selected stream.
- Add jitter-aligned native composition, hybrid routing and wire history repair.
- Add prepared masks, sparse repair and independent motion/repair controls.

Add optional fused R11G11B10 input/output conversion, sampled stage timings
and profile summarization. Extend configuration, packaging, documentation,
FidelityFX headers and CPU/GPU regression coverage.
2026-10-16 04:55:25 -04:00

45 lines
1.8 KiB
C

#pragma once
#include <stdint.h>
/* Shared Wine/HIP ABI. Pitches are bytes; motion pixels are packed RG16F. */
typedef struct D4rMotionDilationParams
{
uint64_t depth, motion, output;
uint64_t depth_pitch, motion_pitch;
uint32_t render_width, render_height, motion_width, motion_height;
float jitter_x, jitter_y;
uint32_t radius, reversed_depth;
} D4rMotionDilationParams;
/* Exact LDS specialization; allocation padding is outside this active grid. */
static inline int d4r_motion_dilation_lds_eligible(const D4rMotionDilationParams* p)
{
return p->motion_width == p->render_width && p->motion_height == p->render_height &&
p->jitter_x == 0 && p->jitter_y == 0 && p->radius >= 1 && p->radius <= 2;
}
/* Low-resolution velocity and depth share the render raster grid. Allocation
padding is not part of that grid; retain the original NGX flags and MV scale.
Display-resolution velocity still needs the jittered depth-grid mapping. */
static inline int d4r_motion_dilation_geometry(D4rMotionDilationParams* p, uint32_t flags,
uint32_t output_width, uint32_t output_height)
{
if ((flags & 4u) != 0 || p->render_width == 0 || p->render_height == 0)
return 0; /* Jittered motion values remain unsupported. */
if ((flags & 2u) != 0)
{
if (p->motion_width < p->render_width || p->motion_height < p->render_height)
return 0;
p->motion_width = p->render_width;
p->motion_height = p->render_height;
p->jitter_x = p->jitter_y = 0;
return 1;
}
return p->motion_width == output_width && p->motion_height == output_height;
}
#ifdef __cplusplus
static_assert(sizeof(D4rMotionDilationParams) == 72, "motion dilation ABI");
#else
_Static_assert(sizeof(D4rMotionDilationParams) == 72, "motion dilation ABI");
#endif