Removed GOG VRAM Leak Fix in favor of a separately built plugin
This commit is contained in:
parent
b402f5a747
commit
45f75ce86f
@ -24,10 +24,7 @@ Beware, spoilers ahead!
|
||||
- Removed the Blueprint keyword from the Dreamflower Elixir Recipe to avoid sorting it into the blueprint storage (reported by Fubz).
|
||||
- Fixed an exploit allowing to collect more gold from containers (reported by LevinLozenges).
|
||||
- All localizations have been brought up to date.
|
||||
|
||||
Engine patches:
|
||||
- Automatically detects and warns about form type collisions when using incompatible Skyrim mods.
|
||||
- Included GOG Memory (VRAM) Leak Fix by DwemerEngineer.
|
||||
|
||||
Lirk:
|
||||
- Fixed several issues with weapon impact sounds.
|
||||
|
||||
@ -8,6 +8,5 @@ ForceBorderless = true
|
||||
AttachLightHitEffectCrashFix = true
|
||||
AutoScaleHeroMenu = true
|
||||
WarnFormTypeCollisions = true
|
||||
GogVramLeakFix = true
|
||||
MenuAspectRatioFix = true
|
||||
LoadScreenFrameFix = true
|
||||
|
||||
@ -15,7 +15,6 @@
|
||||
#include "Patches/AttachLightHitEffectCrash.h"
|
||||
#include "Patches/PluginsTxtPatch.h"
|
||||
#include "Patches/FormTypeCollisionDetector.h"
|
||||
#include "Patches/GogVramLeakFix.h"
|
||||
#include "Patches/ForceLanguage.h"
|
||||
#include "Patches/MenuAspectRatioFix.h"
|
||||
|
||||
@ -32,7 +31,6 @@ static std::map<std::string, bool> g_settings{
|
||||
{ "ForceBorderless", true },
|
||||
{ "AttachLightHitEffectCrashFix", true },
|
||||
{ "AutoScaleHeroMenu", true },
|
||||
{ "GogVramLeakFix", true },
|
||||
{ "MenuAspectRatioFix", true },
|
||||
{ "LoadScreenFrameFix", true }
|
||||
};
|
||||
@ -75,11 +73,6 @@ namespace {
|
||||
|
||||
if (message->type == MessagingInterface::kPostLoad) {
|
||||
if (!REL::Module::IsVR()) {
|
||||
if (g_settings.at("GogVramLeakFix") && REL::Module::get().version() == REL::Version(1, 6, 1179, 0) && !GetLoadInterface()->GetPluginInfo("GOG-Leak-Fix")) {
|
||||
logger::info("Installing GOG VRAM leak fix...");
|
||||
GogVramLeakFix::Install();
|
||||
}
|
||||
|
||||
if (g_settings.at("AttachLightHitEffectCrashFix")) {
|
||||
logger::info("Installing light attach crash fix...");
|
||||
AttachLightHitEffectCrash::Install();
|
||||
|
||||
@ -1,36 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// Fix GOG VRAM leak by properly releasing Direct3D texture resources
|
||||
// Based on https://github.com/SaneEngineer/GOG-Leak-Fix
|
||||
namespace GogVramLeakFix
|
||||
{
|
||||
struct ReplaceRelease
|
||||
{
|
||||
static void thunk(RE::BSGraphics::Renderer* a_renderer, RE::BSGraphics::Texture* a_texture)
|
||||
{
|
||||
if (_InterlockedExchangeAdd(&a_texture->refCount, 0xFFFFFFFF) == 1) {
|
||||
if (a_texture->resourceView) {
|
||||
a_texture->resourceView->Release();
|
||||
}
|
||||
if (a_texture->texture) {
|
||||
a_texture->texture->Release();
|
||||
}
|
||||
if (a_texture->UAV) {
|
||||
a_texture->UAV->Release();
|
||||
}
|
||||
|
||||
REL::Relocation<void(void*, int)> NiMemFree{ REL::RelocationID(102158, 109588) };
|
||||
NiMemFree(a_texture, 0x28);
|
||||
}
|
||||
}
|
||||
|
||||
static inline REL::Relocation<decltype(thunk)> func;
|
||||
};
|
||||
|
||||
void Install()
|
||||
{
|
||||
SKSE::AllocTrampoline(14);
|
||||
SKSE::stl::write_thunk_jump<ReplaceRelease>(REL::RelocationID(75527, 77322).address());
|
||||
logger::info("Initialized GOG VRAM Leak Fix");
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user