Skip to content

Commit

Permalink
fix: use Util::IsDynamicResolution
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Oct 5, 2024
1 parent 76dc02a commit f737da2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions src/Features/VolumetricLighting.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include "Buffer.h"
#include "Feature.h"
#include "State.h"
#include "Util.h"

struct VolumetricLighting : Feature
{
Expand Down Expand Up @@ -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.
Expand All @@ -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<decltype(thunk)> func;
Expand Down
2 changes: 1 addition & 1 deletion src/XSEPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit f737da2

Please sign in to comment.