Compare commits

..

No commits in common. "23f5a22b2c16d23b5be5b275f3731becd16b19d4" and "7290470ea68a2ddb897007fab2bee9e632d507a0" have entirely different histories.

2 changed files with 32 additions and 37 deletions

View file

@ -257,7 +257,7 @@ RR {dev->RequestRender} 0x{(long) dev->ImmediateContext->IfNonZeroSkipPostTickPr
CurrentHeight = rtm->Resolution_Height;
}
private static void GetScaledWidthHeight(uint width, uint height, float scale, out uint widthS, out uint heightS)
private void GetScaledWidthHeight(uint width, uint height, float scale, out uint widthS, out uint heightS)
{
heightS = (uint) MathF.Round(height * scale);
widthS = (width * heightS) / height;
@ -311,10 +311,18 @@ RR {dev->RequestRender} 0x{(long) dev->ImmediateContext->IfNonZeroSkipPostTickPr
var dev = (DeviceEx*) Device.Instance();
var rtm = (RenderTargetManagerEx*) RenderTargetManager.Instance();
using var scale = new ScaleState();
var _Width = dev->Width;
var _Height = dev->Height;
var scale = MathF.Max(1f, cfg.Scale);
GetScaledWidthHeight(_Width, _Height, scale, out dev->Width, out dev->Height);
Service.PluginLog.Debug($"Regenerating RTM resources: {dev->Width} x {dev->Height}");
_rtmRegenAfterResizeHook.OriginalDisposeSafe();
Service.PluginLog.Debug($"After: 0x{(long) (nint) rtm->_.Unk20[0].Value->D3D11Texture2D:X16}");
dev->Width = _Width;
dev->Height = _Height;
}
private void ICDX11ProcessCommandsDetour(ImmediateContext* ctx, RenderCommandBufferGroup* cmds, uint count)
@ -341,8 +349,18 @@ RR {dev->RequestRender} 0x{(long) dev->ImmediateContext->IfNonZeroSkipPostTickPr
lock (_renderLock)
{
using var scale = new ScaleState();
var dev = (DeviceEx*) Device.Instance();
var _Width = dev->Width;
var _Height = dev->Height;
var scale = MathF.Max(1f, cfg.Scale);
GetScaledWidthHeight(_Width, _Height, scale, out dev->Width, out dev->Height);
_taskRenderGraphicsRenderHook.OriginalDisposeSafe();
dev->Width = _Width;
dev->Height = _Height;
}
}
@ -352,29 +370,6 @@ RR {dev->RequestRender} 0x{(long) dev->ImmediateContext->IfNonZeroSkipPostTickPr
_1_FakeInv,
_2_ToScale
}
private struct ScaleState : IDisposable
{
public uint Width;
public uint Height;
public ScaleState()
{
var dev = (DeviceEx*) Device.Instance();
Width = dev->Width;
Height = dev->Height;
var scale = MathF.Max(1f, Service.Config._.Game.Scale);
GetScaledWidthHeight(Width, Height, scale, out dev->Width, out dev->Height);
}
public void Dispose()
{
var dev = (DeviceEx*) Device.Instance();
dev->Width = Width;
dev->Height = Height;
}
}
}

View file

@ -247,8 +247,15 @@ This is still being worked on before the v1.0 release.");
if (ImGui.IsItemHovered())
{
ImGui.SetTooltip(@"Smaller tweaks and fixes, f.e. for DXVK on Windows,
or to allow making the window smaller than 1024x768.");
ImGui.SetTooltip(@"Fixes DXVK borderless window causing black screens when alt-tabbing.
This can *possibly* impact performance, depending on your Windows version and GPU.
Feel free to experiment with this toggle.
Make sure to switch the game to windowed and then back to borderless windowed when changing.
Works even with the scaling above disabled.
Not intended to be used with proper fullscreen.");
}
if (!imTab.Success)
@ -276,15 +283,8 @@ or to allow making the window smaller than 1024x768.");
if (ImGui.IsItemHovered())
{
ImGui.SetTooltip(@"Fixes DXVK borderless window causing black screens when alt-tabbing.
This can *possibly* impact performance, depending on your Windows version and GPU.
Feel free to experiment with this toggle.
Make sure to switch the game to windowed and then back to borderless windowed when changing.
Works even with the scaling above disabled.
Not intended to be used with proper fullscreen.");
ImGui.SetTooltip(@"Smaller tweaks and fixes, f.e. for DXVK on Windows,
or to allow making the window smaller than 1024x768.");
}
if (ImGui.BeginCombo("Minimum window size", _.MinSizeMode.ToHumanNameString()))