From f737da20330e31f5a451ca632b02de37c11048bf Mon Sep 17 00:00:00 2001 From: Alan Tse Date: Sat, 5 Oct 2024 00:28:02 -0700 Subject: [PATCH] fix: use Util::IsDynamicResolution --- src/Features/VolumetricLighting.h | 10 ++++------ src/XSEPlugin.cpp | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/Features/VolumetricLighting.h b/src/Features/VolumetricLighting.h index 471517aa0..25369189e 100644 --- a/src/Features/VolumetricLighting.h +++ b/src/Features/VolumetricLighting.h @@ -2,7 +2,7 @@ #include "Buffer.h" #include "Feature.h" -#include "State.h" +#include "Util.h" struct VolumetricLighting : Feature { @@ -90,7 +90,7 @@ struct VolumetricLighting : Feature struct CopyResource { - static void thunk(REX::W32::ID3D11DeviceContext* a_this, ID3D11Texture2D* a_renderTarget, ID3D11Texture2D* a_renderTargetSource) + static void thunk(ID3D11DeviceContext* a_this, ID3D11Resource* a_renderTarget, ID3D11Resource* a_renderTargetSource) { // In VR with dynamic resolution enabled, there's a bug with the depth stencil. // The depth stencil passed to IsFullScreenVR is scaled down incorrectly. @@ -102,10 +102,8 @@ struct VolumetricLighting : Feature // used in the next frame. auto* singleton = GetSingleton(); - auto* state = State::GetSingleton(); - - if (singleton && state && state->dynamicResolutionEnabled && !singleton->settings.EnabledVL) { - func(a_this, a_renderTarget, a_renderTargetSource); + if (singleton && !(Util::IsDynamicResolution() && singleton->settings.EnabledVL)) { + a_this->CopyResource(a_renderTarget, a_renderTargetSource); } } static inline REL::Relocation func; diff --git a/src/XSEPlugin.cpp b/src/XSEPlugin.cpp index fbfc317eb..b22be5975 100644 --- a/src/XSEPlugin.cpp +++ b/src/XSEPlugin.cpp @@ -139,7 +139,7 @@ bool Load() } if (REL::Module::IsVR()) { - REL::IDDatabase::get().IsVRAddressLibraryAtLeastVersion("0.154.0", true); + REL::IDDatabase::get().IsVRAddressLibraryAtLeastVersion("0.155.0", true); } auto messaging = SKSE::GetMessagingInterface();