Expand Windows GPU support, add native FSR RR, and improve SR interop
Add a native D3D12 FSR Ray Regeneration route for gfx1200/gfx1201, using the game's device and queue with embedded HLSL guide preparation and output composition. Preserve the vkd3d compatibility route for RDNA3 and expose explicit route overrides and diagnostics. Improve Windows runtime compatibility: - Retry rejected application-ID initialization with a project identity. - Defer expensive RR backend creation until feature creation. - Recover from transient submission failures without disabling later frames. - Add shared-buffer export fallbacks through explicit heaps and a private device on the same adapter. - Safely evict old RR descriptor sets when input views change. - Treat requested RR presets as hints when a configured model is available. - Expand SR/RR input formats and handle diffuse/specular hit distances, packed normals, depth-stencil resources, and unused FSR guides. Reduce SR overhead by batching output downloads and format conversion under one completion wait. Optimize strict M enc2/tube attention with bounded FP32 accumulation and the original FP64 fallback for ambiguous rounding cases. Extend RDNA4 tooling with gfx1200/gfx1201 native FP8 RR model builds, capability checks, architecture-aware deployment, and experimental K/M kernel paths. Require matching model and runtime arithmetic families. Add optional embedded FSR shader optimizations keyed by shader hash and exact original SPIR-V contents. Preserve reflected metadata and record optimizer provenance, artifact hashes, and cache identity. Simplify Windows installation with automatic backend dependency downloads, download progress and ETA, backed-up absolute OptiScaler library paths, and recovery from interrupted RR model builds. Add build-kernels.bat and a kernels-only build matrix for all eleven registered RDNA targets, with code-object target validation and SHA256 manifests. Expand conversion probes, numerical stress tests, temporal benchmark tooling, installer/deployment tests, and setup documentation. Document synthetic regression and timing results, experimental build options, and remaining RDNA4 hardware validation requirements.
This commit is contained in:
1 parent
a617c818de
commit
ac4ee6c225
67 files changed
+3147
-326
No files matched your search
@@ -2,6 +2,7 @@
|
||||
#include "rr_native_backend.h"
|
||||
#include "rr_native_packet.h"
|
||||
#include "rr_bridge_replay.h"
|
||||
#include "rr_input_formats.h"
|
||||
#include "d3d12_command_hooks.h"
|
||||
#include <mutex>
|
||||
|
||||
@@ -13,32 +14,7 @@ std::mutex dispatchMutex;
|
||||
using Packet = rr_bridge::NativePacket;
|
||||
using Device = rr_bridge::NativeDevice;
|
||||
size_t resource_index(size_t plane) { return plane < 7 ? plane : plane + 2; }
|
||||
rr_bridge::Plane input_format(DXGI_FORMAT format, size_t plane) {
|
||||
// Match Linux's direct sampled-image route. These formats preserve the
|
||||
// stored texel values; no CPU conversion or reinterpretation is involved.
|
||||
if (plane == Snapshot::Motion) {
|
||||
if (format == DXGI_FORMAT_R16G16_FLOAT) return {nullptr, VK_FORMAT_R16G16_SFLOAT, 4};
|
||||
if (format == DXGI_FORMAT_R32G32_FLOAT) return {nullptr, VK_FORMAT_R32G32_SFLOAT, 8};
|
||||
} else if (plane == Snapshot::Depth || plane == Snapshot::HitDistance || plane == Snapshot::Disocclusion || plane == Snapshot::Subsurface) {
|
||||
if (plane == Snapshot::Depth && (format == DXGI_FORMAT_R32_TYPELESS || format == DXGI_FORMAT_D32_FLOAT ||
|
||||
format == DXGI_FORMAT_R32G8X24_TYPELESS || format == DXGI_FORMAT_D32_FLOAT_S8X24_UINT || format == DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS))
|
||||
return {nullptr, VK_FORMAT_R32_SFLOAT, 4};
|
||||
if (format == DXGI_FORMAT_R32_FLOAT) return {nullptr, VK_FORMAT_R32_SFLOAT, 4};
|
||||
if (format == DXGI_FORMAT_R16_FLOAT) return {nullptr, VK_FORMAT_R16_SFLOAT, 2};
|
||||
if (plane != Snapshot::Depth && format == DXGI_FORMAT_R8_UNORM) return {nullptr, VK_FORMAT_R8_UNORM, 1};
|
||||
} else {
|
||||
if (format == DXGI_FORMAT_R16G16B16A16_FLOAT) return {nullptr, VK_FORMAT_R16G16B16A16_SFLOAT, 8};
|
||||
if (format == DXGI_FORMAT_R32G32B32A32_FLOAT) return {nullptr, VK_FORMAT_R32G32B32A32_SFLOAT, 16};
|
||||
if (format == DXGI_FORMAT_R8G8B8A8_UNORM) return {nullptr, VK_FORMAT_R8G8B8A8_UNORM, 4};
|
||||
if (format == DXGI_FORMAT_R10G10B10A2_UNORM) return {nullptr, VK_FORMAT_A2B10G10R10_UNORM_PACK32, 4};
|
||||
if (plane == Snapshot::Roughness) {
|
||||
if (format == DXGI_FORMAT_R16_FLOAT) return {nullptr, VK_FORMAT_R16_SFLOAT, 2};
|
||||
if (format == DXGI_FORMAT_R32_FLOAT) return {nullptr, VK_FORMAT_R32_SFLOAT, 4};
|
||||
if (format == DXGI_FORMAT_R8_UNORM) return {nullptr, VK_FORMAT_R8_UNORM, 1};
|
||||
}
|
||||
}
|
||||
throw std::runtime_error("Unsupported native RR sampled input format");
|
||||
}
|
||||
rr_bridge::Plane input_format(DXGI_FORMAT format, size_t plane) { return guide_format(format, plane, "native RR"); }
|
||||
DXGI_FORMAT copy_format(ID3D12Device* device, ID3D12Resource* texture, size_t plane) {
|
||||
const auto desc = resource_desc(texture);
|
||||
if (plane != Snapshot::Depth) return desc.Format;
|
||||
@@ -111,7 +87,11 @@ struct Backend::Impl {
|
||||
replay = std::make_unique<rr_bridge::Replay>(layout, native->physical, native->device, directory);
|
||||
const unsigned indices[] = {3, 2, 1, 4, 5, 0};
|
||||
const auto requested = creation.presets[indices[creation.quality]];
|
||||
if (requested && requested != replay->model->preset()) throw std::runtime_error("Configured RR model differs from requested preset");
|
||||
// The preset is a hint (Cyberpunk 2077 asks for one per quality mode). Serve the locally
|
||||
// built model rather than failing RR; the log names both so the user can build that preset.
|
||||
if (requested && requested != replay->model->preset())
|
||||
std::fprintf(stderr, "d4r: RR preset %u requested; serving the configured preset %u model (build the requested one with install.bat to match)\n",
|
||||
unsigned(requested), unsigned(replay->model->preset()));
|
||||
shared = make_buffer(d3d.Get(), layout.bytes, D3D12_HEAP_TYPE_DEFAULT, D3D12_HEAP_FLAG_SHARED, D3D12_RESOURCE_STATE_COMMON);
|
||||
dx(d3d->CreateFence(0, D3D12_FENCE_FLAG_SHARED, IID_PPV_ARGS(&fence)), "RR shared fence");
|
||||
Handle memoryHandle, fenceHandle;
|
||||
|
||||
Reference in new issue
Block a user