Streamline icon indicating copy to clipboard operation
Streamline copied to clipboard

[DLSS-G] Add runtime gating of IDXGISwapChainProvider to prevent early PresentBefore hook

Open torbjornsoderman opened this issue 6 months ago • 0 comments

We're integrating DLSS-G (DLSS Frame Generation) using the 4.0.2 version into a real-time Unreal Engine 5.5.4 game and encountering a critical issue:


🔥 Issue Summary

When the DLSS-G plugin is loaded (even with all activation cvars set to 0), the Streamline framework (version v2.7.30.afa89bde) immediately registers a DXGI PresentBefore hook via IDXGISwapChainProvider.

This causes a GPU hang in packaged builds when startup movies (e.g., Bink) are playing — even though DLSS-G is disabled in all config cvars.


🧪 Repro Conditions

  • DLSS-G plugin is "Enabled": true in .uproject (required to cook shaders like FStreamlineVelocityCombineCS)

  • DefaultEngine.ini has:

    r.Streamline.Enable=0
    r.Streamline.Load.DLSSG=0
    r.Streamline.DLSSG.Enable=0
    
    
    • Bink movie plugin plays a fullscreen startup movie
    • No DLSS-G features are initialized or used
    • On startup: GPU crash (device removed during early DXGI present)

    ✅ Expected Behavior

    If r.Streamline.Load.DLSSG=0, the DLSS-G module should not register any DXGI hooks during StartupModule() or plugin load time.

    This would allow us to:

    • Cook DLSS-G shaders
    • Delay plugin activation manually (e.g., after movie playback)
    • Avoid early DXGI interference

    🚧 Current Workarounds Attempted

    • Delayed LoadModuleChecked() → fails due to missing cooked shaders (requires "Enabled": true)
    • Runtime cvar toggling → DXGI hook already registered too early
    • Tried Optional: true and EnablePlugins.Add(...) — no effect
    • Full Streamline SDK integration → not applicable to DLSS-G (precompiled only)

    🧩 Suggested Solution

    Please consider exposing a cvar like: r.Streamline.DelayHookRegistrationUntilFirstPresent=1 or a deferred DXGI hook registration like:

    if (r.Streamline.Load.DLSSG != 0)
    {
        RegisterIDXGISwapChainProvider();
    }
    
    
    

Torbjörn Söderman Technical Director, GOALS

torbjornsoderman avatar Jun 26 '25 11:06 torbjornsoderman