From 96cf242bcf168b9f9e6a1e27200529466217f396 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Wed, 8 Feb 2023 04:48:09 -0300 Subject: Handle mismatching texture size with copy dependencies (#4364) * Handle mismatching texture size with copy dependencies * Create copy and render textures with the minimum possible size * Only align width for comparisons, assume that height is always exact * Fix IsExactMatch size check * Allow sampler and copy textures to match textures with larger width * Delete texture ChangeSize related code * Move AdjustSize to TextureInfo and give it a better name, adjust usages * Fix GetMinimumWidthInGob when minimumWidth > width * Only update render targets that are actually cleared for clear Avoids creating textures with incorrect sizes * Delete UpdateRenderTargetState method that is not needed anymore Clears now only ever sets the render targets that will be cleared rather than all of them --- Ryujinx.Graphics.Gpu/Image/TexturePool.cs | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'Ryujinx.Graphics.Gpu/Image/TexturePool.cs') diff --git a/Ryujinx.Graphics.Gpu/Image/TexturePool.cs b/Ryujinx.Graphics.Gpu/Image/TexturePool.cs index fc99fc99..0348ca01 100644 --- a/Ryujinx.Graphics.Gpu/Image/TexturePool.cs +++ b/Ryujinx.Graphics.Gpu/Image/TexturePool.cs @@ -77,22 +77,7 @@ namespace Ryujinx.Graphics.Gpu.Image } else { - if (texture.ChangedSize) - { - // Texture changed size at one point - it may be a different size than the sampler expects. - // This can be triggered when the size is changed by a size hint on copy or draw, but the texture has been sampled before. - - int baseLevel = descriptor.UnpackBaseLevel(); - int width = Math.Max(1, descriptor.UnpackWidth() >> baseLevel); - int height = Math.Max(1, descriptor.UnpackHeight() >> baseLevel); - - if (texture.Info.Width != width || texture.Info.Height != height) - { - texture.ChangeSize(width, height, texture.Info.DepthOrLayers); - } - } - - // Memory is automatically synchronized on texture creation. + // On the path above (texture not yet in the pool), memory is automatically synchronized on texture creation. texture.SynchronizeMemory(); } -- cgit v1.2.3