Files
d4r/engine/game_rr.h
T
woutermans 50fa65d87b engine/rr: native Ray Reconstruction stages with capture/replay and shim integration
- engine/rr: d4r's own shaders for the denoiser frame (exposure, six encoders,
  five decoders, hkpn output stage) at NGX layouts, plus PTX->GLSL/HIP packing
  scripts, reference implementations and weight extraction
- runtime.h/runtime_rr.inc, game_rr.{h,cpp}: GameDenoiser wired into the engine
  build (d4r-rr replay binary) and the D3D12 shim's feature-13 path
- shim: answer GetFeatureRequirements from d4r's own state only (the old
  cross-binary CUDA handoff crashed OptiScaler's scan); drop the core's
  CUDA GetFeatureRequirements import
- shim/harness: exact guide capture/replay of a frame's RR inputs
- kernels/rr: expanded enc0/engine prototypes; kernels/tools: ptxsim rewrite
  plus rrsim and an engine test; vulkan: ptx2glsl FP8/cooperative-matrix
  support, kvk inout buffers and KVK_DISABLE_OPTIMIZATION
- bridge: report the surface array in cuSurfObjectCreate traces
- packaging: RR settings and the ICU launch overrides in D4R_README
2026-10-12 12:47:53 +02:00

28 lines
1.2 KiB
C++

// Adapter between a game's own textures and the Ray Reconstruction engine (REngine): input conversion where a
// texture cannot be sampled directly, the frame and the copy into the game's output texture, all recorded into the
// game's command buffer.
#pragma once
#include "game.h"
namespace d4r {
struct GameFrameR {
GameImage color, depth, motion, normals, roughness, diffuseAlbedo, specularAlbedo, output;
// optional (image null: the game passes none): DLSSD.SpecularHitDistance, DLSS.DisocclusionMask
GameImage specularHitDistance, disocclusionMask;
RFrameSettings settings;
};
class GameDenoiser {
public:
// The model must outlive this object. The render size is fixed.
GameDenoiser(RModel& model, VkPhysicalDevice physical, VkDevice device, uint32_t outputWidth, uint32_t outputHeight,
uint32_t renderWidth, uint32_t renderHeight);
~GameDenoiser(); // only once every recorded frame has completed on the GPU
GameDenoiser(const GameDenoiser&) = delete;
GameDenoiser& operator=(const GameDenoiser&) = delete;
void record(VkCommandBuffer command, const GameFrameR& frame);
private:
struct Impl;
std::unique_ptr<Impl> impl;
};
} // namespace d4r