Skip to content

Added d3d12 interop and FSR4.1 SRAPI backend - #193

Open
sssxks wants to merge 19 commits into
IReallyWantToSleep:devfrom
sssxks:issue-192-d3d12-srapi
Open

Added d3d12 interop and FSR4.1 SRAPI backend#193
sssxks wants to merge 19 commits into
IReallyWantToSleep:devfrom
sssxks:issue-192-d3d12-srapi

Conversation

@sssxks

@sssxks sssxks commented Jul 30, 2026

Copy link
Copy Markdown

Summary

Adds a Windows x64 Direct3D 12 interop path and AMD FSR 4.1 upscaling backend through SRAPI.

Changes

  • Add the D3D12 render API to SRAPI.
  • Add D3D12 device, command-list, texture-resource, and resource-state support.
  • Add the SuperResolutionD3D12Interop native library.
  • Implement OpenGL/Direct3D 12 interop using:
    • Shared D3D12 textures and Win32 shared handles
    • Shared timeline-fence synchronization
    • Adapter matching between the OpenGL and D3D12 devices
    • Dedicated D3D12 command queue, allocator, and command list
  • Add the SuperResolutionFSR4 native provider.
  • Integrate AMD FidelityFX SDK 2.3.0 FFX API headers.
  • Dynamically load amd_fidelityfx_upscaler_dx12.dll and expose FSR 4.1 through the existing SRAPI provider model.
  • Register AMD FSR 4.1 (D3D12) as an available upscaling algorithm for supported Windows systems.
  • Add remote download metadata for the FSR 4.1 upscaler DLL.
  • Make the interop resource lifecycle resize-safe by rebuilding complete resource generations and retaining the previous generation until replacement resources are ready.
  • Guard dispatch while a resize is pending and reset upscaler history after resource replacement.
  • Enable the native integration for the supported Minecraft configurations.
  • Fix LWJGL STB dependency version selection so gradlew :neoforge:runClient no longer errors.

Rendering flow

  1. OpenGL input textures are copied into shared D3D12 resources.
  2. OpenGL signals the shared D3D12 fence.
  3. FSR 4.1 dispatches through the FFX API on the D3D12 command list.
  4. D3D12 signals completion through the shared fence.
  5. OpenGL reacquires the shared resources and copies the vertically flipped output into the regular OpenGL output texture.

Requirements

  • Windows x64
  • OpenGL 4.6
  • GL_EXT_memory_object
  • GL_EXT_memory_object_win32
  • GL_EXT_semaphore
  • GL_EXT_semaphore_win32
  • A GPU and driver supporting Direct3D 12
  • The AMD FFX API upscaler DLL

Validation

  • in game verification in neoforge 1.21.1 and fabric 26.2.

Known Issues

  • despite quality improvements, on my 7900XT, FSR 4.1 takes ~4ms to generate, while FSR 3.1.4 takes ~1ms.
  • lag increase when booting game and resize windows.

@sssxks sssxks changed the title Implemented d3d12 interop and FSR4.1 Added d3d12 interop and FSR4.1 SRAPI backend Jul 30, 2026
@187J3X1-114514
187J3X1-114514 self-requested a review July 30, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant