From 20e0e6dbd8ccd4477c8d1627728304a8f95ae959 Mon Sep 17 00:00:00 2001 From: Jake Maxwell <82926063+jota2rz@users.noreply.github.com> Date: Tue, 12 May 2026 13:19:46 -0400 Subject: [PATCH] fix(upscaling): preserve D3D12 proxy swap chain for SKSE plugin compatibility --- src/Features/Upscaling.cpp | 7 ++++++- src/Hooks.cpp | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Features/Upscaling.cpp b/src/Features/Upscaling.cpp index eb0d599103..b3a0190b6c 100644 --- a/src/Features/Upscaling.cpp +++ b/src/Features/Upscaling.cpp @@ -133,7 +133,12 @@ HRESULT WINAPI hk_D3D11CreateDeviceAndSwapChainUpscaling( if (upscaling.IsBackendInitialized()) { upscaling.UpgradeBackendInterface((void**)&(*ppDevice)); - upscaling.UpgradeBackendInterface((void**)&(*ppSwapChain)); + // Don't wrap the swap chain with Streamline when using the D3D12 + // proxy. The proxy's GetDevice() returns the D3D11 device for + // IID_ID3D11Device, which other SKSE plugins (e.g. SkyrimPlatform) + // rely on. Streamline's wrapper would bypass this override and + // forward to the underlying D3D12 swap chain, causing + // E_NOINTERFACE. The proxy must remain the outermost layer. upscaling.SetBackendD3DDevice(*ppDevice); // Some features (notably Reflex/PCL) may report availability only after device bind. upscaling.CheckBackendFeatures(pAdapter); diff --git a/src/Hooks.cpp b/src/Hooks.cpp index d3dd4f8cc6..cd7dbb0538 100644 --- a/src/Hooks.cpp +++ b/src/Hooks.cpp @@ -313,8 +313,10 @@ struct IDXGISwapChain_Present // OMGetRenderTargets to find a target to render overlays into. Without this, they // get nullptr (we unbound everything for the ApplyHDR resource hazard) and their // UI elements are invisible. - if (hdrReady && !frameGenActive) { - hdr->ClearUIBuffer(); // restores kFRAMEBUFFER.RTV to original backbuffer RTV + if (hdrReady) { + if (!frameGenActive) { + hdr->ClearUIBuffer(); // restores kFRAMEBUFFER.RTV to original backbuffer RTV + } auto& data = globals::game::renderer->GetRuntimeData().renderTargets[RE::RENDER_TARGET::kFRAMEBUFFER]; globals::d3d::context->OMSetRenderTargets(1, &data.RTV, nullptr); }