Implement native NGX feature-13 RR through a LUID-matched D3D12/Vulkan shared-memory and timeline-fence bridge. Add owned parameter snapshots, GPU resource lifetime handling, inherited/enhanced barriers, optional guides, sampled input formats and depth-plane support with stencil preservation. Separate RR initialization from the SR CUDA runtime and expose explicit backend/model selection through player configuration. Add synthetic bridge, snapshot and NGX lifecycle harnesses covering camera/history/reset, parameter mutation, delayed submission, early release, capability gating and unsupported-input rejection. Add exact gfx11 D/E model generation, verified caches, versioned local deployment with configuration backups, and isolated portable model tools with pinned Python, NumPy and glslang dependencies. Extend Windows K benchmarking and private native-cache selection. Fix LLVM 22 emitter/helper compatibility and preserve exact-output validation for local output-kernel optimization. Add native FSR RR provider diagnostics, local development package refresh tooling, installer/checker updates, FidelityFX headers and Windows parity documentation. Keep NVIDIA binaries, derived models and private optimized kernels out of distributable packages. Native RR evidence remains synthetic; game validation, FSR RR dispatch, installer integration and Linux performance parity remain incomplete.
58 lines
3.2 KiB
C++
58 lines
3.2 KiB
C++
#pragma once
|
|
#include <cstdint>
|
|
#include <initializer_list>
|
|
struct ID3D12Resource;
|
|
extern "C" {
|
|
void d4r_ngx_set_ull(void*, const char*, unsigned long long);
|
|
void d4r_ngx_set_float(void*, const char*, float);
|
|
void d4r_ngx_set_uint(void*, const char*, unsigned);
|
|
void d4r_ngx_set_int(void*, const char*, int);
|
|
void d4r_ngx_set_void(void*, const char*, void*);
|
|
void d4r_ngx_set_d3d12_resource(void*, const char*, ID3D12Resource*);
|
|
unsigned d4r_ngx_get_ull(void*, const char*, unsigned long long*);
|
|
unsigned d4r_ngx_get_float(void*, const char*, float*);
|
|
unsigned d4r_ngx_get_uint(void*, const char*, unsigned*);
|
|
unsigned d4r_ngx_get_int(void*, const char*, int*);
|
|
unsigned d4r_ngx_get_void(void*, const char*, void**);
|
|
unsigned d4r_ngx_get_d3d12_resource(void*, const char*, ID3D12Resource**);
|
|
void* d4r_ngx_parameters_create();
|
|
void d4r_ngx_parameters_destroy(void*);
|
|
}
|
|
namespace d4r::ngx {
|
|
inline unsigned uint_value(void* p, const char* name, unsigned fallback = 0) {
|
|
unsigned value = fallback; (void)d4r_ngx_get_uint(p, name, &value); return value;
|
|
}
|
|
inline int int_value(void* p, const char* name, int fallback = 0) {
|
|
int value = fallback; (void)d4r_ngx_get_int(p, name, &value); return value;
|
|
}
|
|
inline float float_value(void* p, const char* name, float fallback = 0) {
|
|
float value = fallback; (void)d4r_ngx_get_float(p, name, &value); return value;
|
|
}
|
|
inline void copy_create(void* source, void* dest) {
|
|
for (const char* name : {"Width", "Height", "OutWidth", "OutHeight", "CreationNodeMask", "VisibilityNodeMask",
|
|
"DLSS.Hint.Render.Preset.DLAA", "DLSS.Hint.Render.Preset.Quality", "DLSS.Hint.Render.Preset.Balanced",
|
|
"DLSS.Hint.Render.Preset.Performance", "DLSS.Hint.Render.Preset.UltraPerformance", "DLSS.Hint.Render.Preset.UltraQuality"}) {
|
|
unsigned value = 0;
|
|
if (d4r_ngx_get_uint(source, name, &value) == 1) d4r_ngx_set_uint(dest, name, value);
|
|
}
|
|
for (const char* name : {"PerfQualityValue", "DLSS.Feature.Create.Flags", "DLSS.Enable.Output.Subrects"}) {
|
|
int value = 0;
|
|
if (d4r_ngx_get_int(source, name, &value) == 1) d4r_ngx_set_int(dest, name, value);
|
|
}
|
|
}
|
|
inline void copy_frame(void* source, void* dest) {
|
|
for (const char* name : {"Jitter.Offset.X", "Jitter.Offset.Y", "Sharpness", "MV.Scale.X", "MV.Scale.Y",
|
|
"DLSS.Pre.Exposure", "DLSS.Exposure.Scale", "FrameTimeDeltaInMsec"}) {
|
|
const float fallback = name[0] == 'M' || name[0] == 'D' ? 1.f : name[0] == 'F' ? 16.666667f : 0.f;
|
|
d4r_ngx_set_float(dest, name, float_value(source, name, fallback));
|
|
}
|
|
for (const char* name : {"Reset", "Disable.Watermark", "DLSS.Indicator.Invert.X.Axis", "DLSS.Indicator.Invert.Y.Axis"})
|
|
d4r_ngx_set_int(dest, name, int_value(source, name));
|
|
for (const char* name : {"DLSS.Render.Subrect.Dimensions.Width", "DLSS.Render.Subrect.Dimensions.Height",
|
|
"DLSS.Input.Color.Subrect.Base.X", "DLSS.Input.Color.Subrect.Base.Y", "DLSS.Input.Depth.Subrect.Base.X",
|
|
"DLSS.Input.Depth.Subrect.Base.Y", "DLSS.Input.MV.Subrect.Base.X", "DLSS.Input.MV.Subrect.Base.Y",
|
|
"DLSS.Output.Subrect.Base.X", "DLSS.Output.Subrect.Base.Y"})
|
|
d4r_ngx_set_uint(dest, name, uint_value(source, name));
|
|
}
|
|
}
|