From d98da47a0fd7966be34a37c89a262902b9fa413a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Arrouye?= <5017270+tarrouye@users.noreply.github.com> Date: Sun, 4 Jun 2023 17:48:11 -0700 Subject: [PATCH 1/4] Better application grid flex (#5218) --- src/Ryujinx.Ava/UI/Controls/ApplicationGridView.axaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx.Ava/UI/Controls/ApplicationGridView.axaml b/src/Ryujinx.Ava/UI/Controls/ApplicationGridView.axaml index f7a120b1a..3d55793f9 100644 --- a/src/Ryujinx.Ava/UI/Controls/ApplicationGridView.axaml +++ b/src/Ryujinx.Ava/UI/Controls/ApplicationGridView.axaml @@ -32,10 +32,10 @@ + JustifyContent="FlexStart" /> From 68848000f77e587ed4cd99e84a234fcf79fd7ea3 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Mon, 5 Jun 2023 12:33:09 +0100 Subject: [PATCH 2/4] Texture: Fix 3D texture size when totalBlocksOfGobsInZ > 1 (#5228) * Texture: Fix 3D texture size when totalBlocksOfGobsInZ > 0 When there is a remainder when dividing depth by gobs in z, it is used to remove the unused part of the 3D texture's size. This was done to calculate correct sizes for single slice views of 3D textures. However, this case can also apply to 3D textures with many slices, and more than one total block of gobs in z. In this case it's meant to trim off the end of the level size. Most textures won't encounter this as their size will be aligned, but UE4 games tend to use 3D textures with funny unaligned sizes. The size offset should have been applied to the level size instead of the slice size, and it should only affect the slice size if it ends up larger. Hopefully should fix issues with UE4 games without breaking other stuff, I don't have much time to test. * Whoops --- src/Ryujinx.Graphics.Texture/SizeCalculator.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Ryujinx.Graphics.Texture/SizeCalculator.cs b/src/Ryujinx.Graphics.Texture/SizeCalculator.cs index 4ddd8d4df..0120bd7ac 100644 --- a/src/Ryujinx.Graphics.Texture/SizeCalculator.cs +++ b/src/Ryujinx.Graphics.Texture/SizeCalculator.cs @@ -90,6 +90,7 @@ namespace Ryujinx.Graphics.Texture mipOffsets[level] = layerSize; sliceSizes[level] = totalBlocksOfGobsInY * robSize; + levelSizes[level] = totalBlocksOfGobsInZ * sliceSizes[level]; if (is3D) { @@ -116,12 +117,15 @@ namespace Ryujinx.Graphics.Texture // The slice only covers up to the end of this slice's depth, rather than the full aligned size. // Avoids size being too large on partial views of 3d textures. - sliceSizes[level] -= gobSize * (mipGobBlocksInZ - gobRemainderZ); + levelSizes[level] -= gobSize * (mipGobBlocksInZ - gobRemainderZ); + + if (sliceSizes[level] > levelSizes[level]) + { + sliceSizes[level] = levelSizes[level]; + } } } - levelSizes[level] = totalBlocksOfGobsInZ * sliceSizes[level]; - layerSize += levelSizes[level]; depthLevelOffset += d; From af1906ea04dad5972a6a2771a44f353c97dec326 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Mon, 5 Jun 2023 09:01:33 -0300 Subject: [PATCH 3/4] Fix wrong unaligned SB state when fetching compute shaders (#5223) --- .../Engine/Compute/ComputeClass.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/Ryujinx.Graphics.Gpu/Engine/Compute/ComputeClass.cs b/src/Ryujinx.Graphics.Gpu/Engine/Compute/ComputeClass.cs index 8227a7ff1..d8103ac71 100644 --- a/src/Ryujinx.Graphics.Gpu/Engine/Compute/ComputeClass.cs +++ b/src/Ryujinx.Graphics.Gpu/Engine/Compute/ComputeClass.cs @@ -151,8 +151,6 @@ namespace Ryujinx.Graphics.Gpu.Engine.Compute ShaderProgramInfo info = cs.Shaders[0].Info; - bool hasUnaligned = _channel.BufferManager.HasUnalignedStorageBuffers; - for (int index = 0; index < info.SBuffers.Count; index++) { BufferDescriptor sb = info.SBuffers[index]; @@ -177,9 +175,17 @@ namespace Ryujinx.Graphics.Gpu.Engine.Compute _channel.BufferManager.SetComputeStorageBuffer(sb.Slot, sbDescriptor.PackAddress(), size, sb.Flags); } - if ((_channel.BufferManager.HasUnalignedStorageBuffers) != hasUnaligned) + if (_channel.BufferManager.HasUnalignedStorageBuffers != computeState.HasUnalignedStorageBuffer) { // Refetch the shader, as assumptions about storage buffer alignment have changed. + computeState = new GpuChannelComputeState( + qmd.CtaThreadDimension0, + qmd.CtaThreadDimension1, + qmd.CtaThreadDimension2, + localMemorySize, + sharedMemorySize, + _channel.BufferManager.HasUnalignedStorageBuffers); + cs = memoryManager.Physical.ShaderCache.GetComputeShader(_channel, poolState, computeState, shaderGpuVa); _context.Renderer.Pipeline.SetProgram(cs.HostProgram); From 5813b2e354e072d43eb30c51083e737cf6bc1ee2 Mon Sep 17 00:00:00 2001 From: Kurochi51 Date: Mon, 5 Jun 2023 15:19:17 +0300 Subject: [PATCH 4/4] Updater: Ignore files introduced by the user in base directory (#5092) * Updater: Ignore files introduced by the user in base directory * Replicate logic in Avalonia version. * Address requested changes * Updater: Ignore files introduced by the user in base directory * Replicate logic in Avalonia version. * Address requested changes * Address requested changes * Address requested changes * Comment cleanup * Address feedback * Forgot comment, tehe --- src/Ryujinx.Ava/Modules/Updater/Updater.cs | 12 ++++++++++++ src/Ryujinx/Modules/Updater/Updater.cs | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/Ryujinx.Ava/Modules/Updater/Updater.cs b/src/Ryujinx.Ava/Modules/Updater/Updater.cs index 77d77d794..839526c4e 100644 --- a/src/Ryujinx.Ava/Modules/Updater/Updater.cs +++ b/src/Ryujinx.Ava/Modules/Updater/Updater.cs @@ -740,6 +740,18 @@ namespace Ryujinx.Modules { var files = Directory.EnumerateFiles(HomeDir); // All files directly in base dir. + // Determine and exclude user files only when the updater is running, not when cleaning old files + if (_running) + { + // Compare the loose files in base directory against the loose files from the incoming update, and store foreign ones in a user list. + var oldFiles = Directory.EnumerateFiles(HomeDir, "*", SearchOption.TopDirectoryOnly).Select(Path.GetFileName); + var newFiles = Directory.EnumerateFiles(UpdatePublishDir, "*", SearchOption.TopDirectoryOnly).Select(Path.GetFileName); + var userFiles = oldFiles.Except(newFiles).Select(filename => Path.Combine(HomeDir, filename)); + + // Remove user files from the paths in files. + files = files.Except(userFiles); + } + if (OperatingSystem.IsWindows()) { foreach (string dir in WindowsDependencyDirs) diff --git a/src/Ryujinx/Modules/Updater/Updater.cs b/src/Ryujinx/Modules/Updater/Updater.cs index 3e0dc99b4..344edf9e5 100644 --- a/src/Ryujinx/Modules/Updater/Updater.cs +++ b/src/Ryujinx/Modules/Updater/Updater.cs @@ -565,6 +565,18 @@ namespace Ryujinx.Modules { var files = Directory.EnumerateFiles(HomeDir); // All files directly in base dir. + // Determine and exclude user files only when the updater is running, not when cleaning old files + if (Running) + { + // Compare the loose files in base directory against the loose files from the incoming update, and store foreign ones in a user list. + var oldFiles = Directory.EnumerateFiles(HomeDir, "*", SearchOption.TopDirectoryOnly).Select(Path.GetFileName); + var newFiles = Directory.EnumerateFiles(UpdatePublishDir, "*", SearchOption.TopDirectoryOnly).Select(Path.GetFileName); + var userFiles = oldFiles.Except(newFiles).Select(filename => Path.Combine(HomeDir, filename)); + + // Remove user files from the paths in files. + files = files.Except(userFiles); + } + if (OperatingSystem.IsWindows()) { foreach (string dir in WindowsDependencyDirs)