From 423da5cc911bf7545746ad4fd184eff42f32dd9b Mon Sep 17 00:00:00 2001 From: gdkchan Date: Thu, 29 Oct 2020 18:57:34 -0300 Subject: Scale texture resolution before sending to backend (#1646) * Work * Propagate scale factor to copy temp. Not really needed, just here for consistency * PR feedback --- Ryujinx.Graphics.Gpu/Image/Texture.cs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Image/Texture.cs') diff --git a/Ryujinx.Graphics.Gpu/Image/Texture.cs b/Ryujinx.Graphics.Gpu/Image/Texture.cs index 2b1aaa0a..01610629 100644 --- a/Ryujinx.Graphics.Gpu/Image/Texture.cs +++ b/Ryujinx.Graphics.Gpu/Image/Texture.cs @@ -181,7 +181,7 @@ namespace Ryujinx.Graphics.Gpu.Image { Debug.Assert(!isView); - TextureCreateInfo createInfo = TextureManager.GetCreateInfo(Info, _context.Capabilities); + TextureCreateInfo createInfo = TextureManager.GetCreateInfo(Info, _context.Capabilities, ScaleFactor); HostTexture = _context.Renderer.CreateTexture(createInfo, ScaleFactor); SynchronizeMemory(); // Load the data. @@ -204,7 +204,7 @@ namespace Ryujinx.Graphics.Gpu.Image ScaleFactor = GraphicsConfig.ResScale; } - TextureCreateInfo createInfo = TextureManager.GetCreateInfo(Info, _context.Capabilities); + TextureCreateInfo createInfo = TextureManager.GetCreateInfo(Info, _context.Capabilities, ScaleFactor); HostTexture = _context.Renderer.CreateTexture(createInfo, ScaleFactor); } } @@ -232,8 +232,7 @@ namespace Ryujinx.Graphics.Gpu.Image ScaleFactor, ScaleMode); - TextureCreateInfo createInfo = TextureManager.GetCreateInfo(info, _context.Capabilities); - + TextureCreateInfo createInfo = TextureManager.GetCreateInfo(info, _context.Capabilities, ScaleFactor); texture.HostTexture = HostTexture.CreateView(createInfo, firstLayer, firstLevel); _viewStorage.AddView(texture); @@ -375,7 +374,7 @@ namespace Ryujinx.Graphics.Gpu.Image Info.SwizzleB, Info.SwizzleA)); - TextureCreateInfo createInfo = TextureManager.GetCreateInfo(Info, _context.Capabilities); + TextureCreateInfo createInfo = TextureManager.GetCreateInfo(Info, _context.Capabilities, ScaleFactor); if (_viewStorage != this) { @@ -451,7 +450,7 @@ namespace Ryujinx.Graphics.Gpu.Image Info.SwizzleB, Info.SwizzleA); - TextureCreateInfo createInfo = TextureManager.GetCreateInfo(viewInfo, _context.Capabilities); + TextureCreateInfo createInfo = TextureManager.GetCreateInfo(viewInfo, _context.Capabilities, ScaleFactor); for (int i = 0; i < Info.DepthOrLayers; i++) { @@ -475,8 +474,7 @@ namespace Ryujinx.Graphics.Gpu.Image { if (storage == null) { - TextureCreateInfo createInfo = TextureManager.GetCreateInfo(Info, _context.Capabilities); - + TextureCreateInfo createInfo = TextureManager.GetCreateInfo(Info, _context.Capabilities, scale); storage = _context.Renderer.CreateTexture(createInfo, scale); } @@ -530,12 +528,10 @@ namespace Ryujinx.Graphics.Gpu.Image Logger.Debug?.Print(LogClass.Gpu, $" Recreating view {Info.Width}x{Info.Height} {Info.FormatInfo.Format.ToString()}."); view.ScaleFactor = scale; - TextureCreateInfo viewCreateInfo = TextureManager.GetCreateInfo(view.Info, _context.Capabilities); - + TextureCreateInfo viewCreateInfo = TextureManager.GetCreateInfo(view.Info, _context.Capabilities, scale); ITexture newView = HostTexture.CreateView(viewCreateInfo, view._firstLayer - _firstLayer, view._firstLevel - _firstLevel); view.ReplaceStorage(newView); - view.ScaleMode = newScaleMode; } } -- cgit v1.2.3