Implement FSR 2.2 temporal upscaling

Full FSR 2.2 pipeline with depth-based motion vector reprojection,
temporal accumulation with YCoCg neighborhood clamping, and RCAS
contrast-adaptive sharpening.

Architecture (designed for FSR 3.x frame generation readiness):
- Camera: Halton(2,3) sub-pixel jitter with unjittered projection
  stored separately for motion vector computation
- Motion vectors: compute shader reconstructs world position from
  depth + inverse VP, reprojects with previous frame's VP
- Temporal accumulation: compute shader blends 5-10% current frame
  with 90-95% clamped history, adaptive blend for disocclusion
- History: ping-pong R16G16B16A16 buffers at display resolution
- Sharpening: RCAS fragment pass with contrast-adaptive weights

Integration:
- FSR2 replaces both FSR1 and MSAA when enabled
- Scene renders to internal resolution framebuffer (no MSAA)
- Compute passes run between scene and swapchain render passes
- Camera cut detection resets history on teleport
- Quality presets shared with FSR1 (0.50-0.77 scale factors)
- UI: "Upscaling" combo with Off/FSR 1.0/FSR 2.2 options
This commit is contained in:
Kelsi 2026-03-07 23:13:01 -08:00
parent 0ffeabd4ed
commit 52317d1edd
11 changed files with 957 additions and 12 deletions

View file

@ -6290,13 +6290,21 @@ void GameScreen::renderSettingsWindow() {
saveSettings();
}
}
// FSR 1.0 Upscaling
// FSR Upscaling
{
if (ImGui::Checkbox("FSR Upscaling (Experimental)", &pendingFSR)) {
if (renderer) renderer->setFSREnabled(pendingFSR);
// FSR mode selection: Off, FSR 1.0 (Spatial), FSR 2.2 (Temporal)
const char* fsrModeLabels[] = { "Off", "FSR 1.0 (Spatial)", "FSR 2.2 (Temporal)" };
int fsrMode = pendingFSR ? 1 : 0;
if (renderer && renderer->isFSR2Enabled()) fsrMode = 2;
if (ImGui::Combo("Upscaling", &fsrMode, fsrModeLabels, 3)) {
pendingFSR = (fsrMode == 1);
if (renderer) {
renderer->setFSREnabled(fsrMode == 1);
renderer->setFSR2Enabled(fsrMode == 2);
}
saveSettings();
}
if (pendingFSR) {
if (fsrMode > 0) {
const char* fsrQualityLabels[] = { "Ultra Quality (77%)", "Quality (67%)", "Balanced (59%)", "Performance (50%)" };
static const float fsrScaleFactors[] = { 0.77f, 0.67f, 0.59f, 0.50f };
if (ImGui::Combo("FSR Quality", &pendingFSRQuality, fsrQualityLabels, 4)) {