Files
d4r/engine/game_rr.h
T
woutermans db24805160 rr: Cyberpunk's extra inputs (SSS guide, colour before particles) and hardware depth
- GameFrameR/RFrameImages: DLSSD.ScreenSpaceSubsurfaceScatteringGuide (arg 264)
  and DLSSD.ColorBeforeParticles (output stage, texture 416 with its own history
  pair 384/392, zero-initialised on first use); guides array 6 -> 8
- DLSS.Use.HW.Depth: byte 980 and output byte 443 bit 24 (Cyberpunk passes the
  nonlinear depth buffer); replay's 'inverted' field becomes a bitmask
- shim: bind the two new resources, read the HW-depth flag, and accept every
  preset hint except E's 5 by mapping it to D's diamond_wallaby kernels
  (harness captures show 0x80000002/0x80000005 run preset D)
- harness: D4R_HARNESS_RR_EXTRA=particles,sss and D4R_HARNESS_RR_HW_DEPTH=1
- ptx2rr: out-of-range integer fetches return zero, matching ZLUDA's behaviour
  (the reference the stages are checked against)
- engine/rr/README: the capture findings behind the offsets
2026-10-12 13:06:59 +02:00

30 lines
1.3 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;
// optional too: DLSSD.ScreenSpaceSubsurfaceScatteringGuide, DLSSD.ColorBeforeParticles
GameImage subsurfaceGuide, colorBeforeParticles;
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