Compare commits

...

3 Commits

Author SHA1 Message Date
Isaac Marovitz
45b810a97b
Merge fa239ac96d into 7d158acc3b 2024-09-30 21:12:42 +02:00
gdkchan
7d158acc3b
Do not try to create a texture pool if shader does not use textures (#7379) 2024-09-30 11:41:07 -03:00
Isaac Marovitz
fa239ac96d
Fix DLC error handling 2024-08-19 19:57:14 +01:00
2 changed files with 27 additions and 27 deletions

View File

@ -743,7 +743,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
constantBufferUsePerStageMask &= ~(1 << index);
}
if (checkTextures)
if (checkTextures && _allTextures.Length > 0)
{
TexturePool pool = channel.TextureManager.GetTexturePool(poolState.TexturePoolGpuVa, poolState.TexturePoolMaximumId);

View File

@ -135,13 +135,13 @@ namespace Ryujinx.Ava.UI.ViewModels
foreach (DownloadableContentNca downloadableContentNca in downloadableContentContainer.DownloadableContentNcaList)
{
using UniqueRef<IFile> ncaFile = new();
Nca nca = TryOpenNca(partitionFileSystem, downloadableContentNca.FullPath);
partitionFileSystem.OpenFile(ref ncaFile.Ref, downloadableContentNca.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure();
Nca nca = TryOpenNca(ncaFile.Get.AsStorage(), downloadableContentContainer.ContainerPath);
if (nca != null)
if (nca == null)
{
continue;
}
var content = new DownloadableContentModel(nca.Header.TitleId.ToString("X16"),
downloadableContentContainer.ContainerPath,
downloadableContentNca.FullPath,
@ -158,7 +158,6 @@ namespace Ryujinx.Ava.UI.ViewModels
}
}
}
}
// NOTE: Try to load downloadable contents from PFS last to preserve enabled state.
AddDownloadableContent(_applicationData.Path);
@ -189,17 +188,20 @@ namespace Ryujinx.Ava.UI.ViewModels
return false;
}
private Nca TryOpenNca(IStorage ncaStorage, string containerPath)
private Nca TryOpenNca(IFileSystem partitionFileSystem, string fullPath)
{
try
{
return new Nca(_virtualFileSystem.KeySet, ncaStorage);
using UniqueRef<IFile> ncaFile = new();
partitionFileSystem.OpenFile(ref ncaFile.Ref, fullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure();
return new Nca(_virtualFileSystem.KeySet, ncaFile.Get.AsStorage());
}
catch (Exception ex)
{
Dispatcher.UIThread.InvokeAsync(async () =>
{
await ContentDialogHelper.CreateErrorDialog(string.Format(LocaleManager.Instance[LocaleKeys.DialogLoadFileErrorMessage], ex.Message, containerPath));
await ContentDialogHelper.CreateErrorDialog(string.Format(LocaleManager.Instance[LocaleKeys.DialogLoadFileErrorMessage], ex.Message, fullPath));
});
}
@ -244,11 +246,8 @@ namespace Ryujinx.Ava.UI.ViewModels
bool success = false;
foreach (DirectoryEntryEx fileEntry in partitionFileSystem.EnumerateEntries("/", "*.nca"))
{
using var ncaFile = new UniqueRef<IFile>();
Nca nca = TryOpenNca(partitionFileSystem, fileEntry.FullPath);
partitionFileSystem.OpenFile(ref ncaFile.Ref, fileEntry.FullPath.ToU8Span(), OpenMode.Read).ThrowIfFailure();
Nca nca = TryOpenNca(ncaFile.Get.AsStorage(), path);
if (nca == null)
{
continue;
@ -261,7 +260,8 @@ namespace Ryujinx.Ava.UI.ViewModels
continue;
}
var content = new DownloadableContentModel(nca.Header.TitleId.ToString("X16"), path, fileEntry.FullPath, true);
var content = new DownloadableContentModel(nca.Header.TitleId.ToString("X16"), path,
fileEntry.FullPath, true);
DownloadableContents.Add(content);
Dispatcher.UIThread.InvokeAsync(() => SelectedDownloadableContents.Add(content));