Compare commits

...

11 Commits

Author SHA1 Message Date
LotP1
d83d80de73 here we go 2024-12-25 23:22:38 +01:00
LotP1
097836bfac NO-BREAK SPACE is now escaped 2024-12-25 22:14:20 +01:00
LotP1
695f9e277d v3 2024-12-25 22:13:54 +01:00
LotP1
b19ee23c6b this won't work 2024-12-25 20:48:28 +01:00
LotP1
748e93ba65 lets give this another shot
moved from netstandard to netframework
2024-12-25 17:09:57 +01:00
LotP1
732a1af863 copying is not necessary anymore 2024-12-25 04:02:22 +01:00
LotP1
f538cee2e8 please don't fail 2024-12-25 03:56:59 +01:00
LotP1
4275a778aa update gitignore 2024-12-24 23:28:44 +01:00
Evan Husted
b05eab21a2 misc: always log backend when creating embeddedwindow 2024-12-24 01:40:29 -06:00
Evan Husted
ff667a5c84 chore: Fix .ctor message source 2024-12-24 01:35:27 -06:00
Evan Husted
2f540dc88c infra: chore: fix/silence compile warnings 2024-12-24 01:23:01 -06:00
13 changed files with 108 additions and 41 deletions

3
.gitignore vendored
View File

@@ -19,6 +19,9 @@ build/
AppDir/
publish_appimage/
# Validation project assemblies folder
/src/Ryujinx.BuildValidationTasks/temp_assemblies/
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
!packages/*/build/

View File

@@ -10,12 +10,13 @@
<PackageVersion Include="Avalonia.Markup.Xaml.Loader" Version="11.0.10" />
<PackageVersion Include="Avalonia.Svg" Version="11.0.0.18" />
<PackageVersion Include="Avalonia.Svg.Skia" Version="11.0.0.18" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.11.4" />
<PackageVersion Include="Microsoft.Build.Framework" Version="17.12.6" />
<PackageVersion Include="Microsoft.Build.Tasks.Core" Version="17.12.6" />
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.12.6" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="Projektanker.Icons.Avalonia" Version="9.4.0" />
<PackageVersion Include="Projektanker.Icons.Avalonia.FontAwesome" Version="9.4.0"/>
<PackageVersion Include="Projektanker.Icons.Avalonia.MaterialDesign" Version="9.4.0"/>
<PackageVersion Include="Projektanker.Icons.Avalonia.FontAwesome" Version="9.4.0" />
<PackageVersion Include="Projektanker.Icons.Avalonia.MaterialDesign" Version="9.4.0" />
<PackageVersion Include="CommandLineParser" Version="2.9.1" />
<PackageVersion Include="Concentus" Version="2.2.0" />
<PackageVersion Include="DiscordRichPresence" Version="1.2.1.24" />
@@ -54,6 +55,9 @@
<PackageVersion Include="SPB" Version="0.0.4-build32" />
<PackageVersion Include="System.IO.Hashing" Version="9.0.0" />
<PackageVersion Include="System.Management" Version="9.0.0" />
<PackageVersion Include="System.Memory" Version="4.6.0" />
<PackageVersion Include="System.Text.Encodings.Web" Version="9.0.0" />
<PackageVersion Include="System.Text.Json" Version="9.0.0" />
<PackageVersion Include="UnicornEngine.Unicorn" Version="2.0.2-rc1-fb78016" />
</ItemGroup>
</Project>
</Project>

View File

@@ -80,6 +80,7 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.Horizon.Kernel.Generators", "src\Ryujinx.Horizon.Kernel.Generators\Ryujinx.Horizon.Kernel.Generators.csproj", "{7F55A45D-4E1D-4A36-ADD3-87F29A285AA2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Ryujinx.HLE.Generators", "src\Ryujinx.HLE.Generators\Ryujinx.HLE.Generators.csproj", "{B575BCDE-2FD8-4A5D-8756-31CDD7FE81F0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Ryujinx.Graphics.Metal", "src\Ryujinx.Graphics.Metal\Ryujinx.Graphics.Metal.csproj", "{C08931FA-1191-417A-864F-3882D93E683B}"
ProjectSection(ProjectDependencies) = postProject
{A602AE97-91A5-4608-8DF1-EBF4ED7A0B9E} = {A602AE97-91A5-4608-8DF1-EBF4ED7A0B9E}
@@ -258,13 +259,12 @@ Global
{B575BCDE-2FD8-4A5D-8756-31CDD7FE81F0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B575BCDE-2FD8-4A5D-8756-31CDD7FE81F0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B575BCDE-2FD8-4A5D-8756-31CDD7FE81F0}.Release|Any CPU.Build.0 = Release|Any CPU
{4A89A234-4F19-497D-A576-DDE8CDFC5B22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A89A234-4F19-497D-A576-DDE8CDFC5B22}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4A89A234-4F19-497D-A576-DDE8CDFC5B22}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C08931FA-1191-417A-864F-3882D93E683B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C08931FA-1191-417A-864F-3882D93E683B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C08931FA-1191-417A-864F-3882D93E683B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C08931FA-1191-417A-864F-3882D93E683B}.Release|Any CPU.Build.0 = Release|Any CPU
{4A89A234-4F19-497D-A576-DDE8CDFC5B22}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4A89A234-4F19-497D-A576-DDE8CDFC5B22}.Release|Any CPU.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@@ -3,27 +3,19 @@ using Microsoft.Build.Utilities;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using Newtonsoft.Json;
using System.Text.Json;
using Microsoft.Build.Framework;
using System.Text.Encodings.Web;
namespace Ryujinx.BuildValidationTasks
{
public class LocaleValidationTask : Task
public class LocalesValidationTask : Task
{
public string Path { get; set; }
public override bool Execute()
{
string path = System.Reflection.Assembly.GetExecutingAssembly().Location;
if (path.Split(["src"], StringSplitOptions.None).Length == 1)
{
//i assume that we are in a build directory in the solution dir
path = new FileInfo(path).Directory!.Parent!.GetDirectories("src")[0].GetDirectories("Ryujinx")[0].GetDirectories("Assets")[0].GetFiles("locales.json")[0].FullName;
}
else
{
path = path.Split(["src"], StringSplitOptions.None)[0];
path = new FileInfo(path).Directory!.GetDirectories("src")[0].GetDirectories("Ryujinx")[0].GetDirectories("Assets")[0].GetFiles("locales.json")[0].FullName;
}
string path = Path;
string data;
@@ -32,7 +24,21 @@ namespace Ryujinx.BuildValidationTasks
data = sr.ReadToEnd();
}
LocalesJson json = JsonConvert.DeserializeObject<LocalesJson>(data);
LocalesJson json;
try
{
json = JsonSerializer.Deserialize<LocalesJson>(data);
}
catch (Exception e)
{
Log.LogError($"Json Validation failed! {e.Message}");
return false;
}
for (int i = 0; i < json.Locales.Count; i++)
{
@@ -48,7 +54,13 @@ namespace Ryujinx.BuildValidationTasks
json.Locales[i] = locale;
}
string jsonString = JsonConvert.SerializeObject(json, Formatting.Indented);
JsonSerializerOptions jsonOptions = new JsonSerializerOptions()
{
WriteIndented = true,
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping
};
string jsonString = JsonSerializer.Serialize(json, jsonOptions);
using (StreamWriter sw = new(path))
{

View File

@@ -1,19 +1,56 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<temp_assemblies>$(MSBuildThisFileDirectory)temp_assemblies/</temp_assemblies>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Build.Tasks.Core" />
<PackageReference Include="Microsoft.Build.Utilities.Core" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="Microsoft.Build.Framework" />
<PackageReference Include="System.Text.Json" GeneratePathProperty="true" />
<PackageReference Include="System.Text.Encodings.Web" GeneratePathProperty="true" />
<PackageReference Include="System.Memory" GeneratePathProperty="true" />
</ItemGroup>
<UsingTask TaskName="Ryujinx.BuildValidationTasks.LocaleValidationTask" TaskFactory="TaskHostFactory" AssemblyFile="$(OutDir)Ryujinx.BuildValidationTasks.dll" />
<Target Name="ValidationTask">
<Message Text="Running Validations..." Importance="high" />
<Target Name="LocalesJsonValidation" AfterTargets="AfterRebuild">
<LocaleValidationTask />
<!--Run Validation Targets Here-->
<CallTarget Targets="MasterLocalesValidationTask" />
<Message Text="Validations Succeeded!" Importance="high" />
</Target>
<!--__________________________________________________Start LocalesValidation Task__________________________________________________-->
<PropertyGroup>
<!--Name of Validation Task. <Name> refers to this name-->
<Name>LocalesValidation</Name>
</PropertyGroup>
<UsingTask TaskName="Ryujinx.BuildValidationTasks.$(Name)Task" TaskFactory="RoslynCodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll">
<ParameterGroup>
<Path Required="true" />
</ParameterGroup>
<Task>
<Reference Include="$(PkgSystem_Text_Json)/lib/netstandard2.0/System.Text.Json.dll" />
<Reference Include="$(PkgSystem_Text_Encodings_Web)/lib/netstandard2.0/System.Text.Encodings.Web.dll" />
<Reference Include="$(PkgSystem_Memory)/lib/netstandard2.0/System.Memory.dll" Version="4.6.0" />
<Code Language="cs" Source="$(MSBuildThisFileDirectory)$(Name)Task.cs" />
</Task>
</UsingTask>
<!--Name should be "Master<Name>Task"-->
<Target Name="MasterLocalesValidationTask">
<Message Text="Running $(Name)Task... " Importance="high" />
<!--Should call "Ryujinx.BuildValidationTasks.<Name>Task"-->
<Ryujinx.BuildValidationTasks.LocalesValidationTask Path="$(MSBuildThisFileDirectory)../Ryujinx/Assets/locales.json" />
<Message Text="$(Name)Task finished!" Importance="high" />
</Target>
</Project>

View File

@@ -838,6 +838,7 @@ namespace Ryujinx.Graphics.Gpu.Shader
TargetApi.OpenGL => TargetLanguage.Glsl,
TargetApi.Vulkan => GraphicsConfig.EnableSpirvCompilationOnVulkan ? TargetLanguage.Spirv : TargetLanguage.Glsl,
TargetApi.Metal => TargetLanguage.Msl,
_ => throw new NotImplementedException()
};
return new TranslationOptions(lang, api, flags);

View File

@@ -1767,6 +1767,7 @@ namespace Ryujinx.Graphics.Metal
Constants.StorageBuffersSetIndex => Constants.StorageBuffersIndex,
Constants.TexturesSetIndex => Constants.TexturesIndex,
Constants.ImagesSetIndex => Constants.ImagesIndex,
_ => throw new NotImplementedException()
};
}

View File

@@ -21,9 +21,12 @@ namespace Ryujinx.Graphics.Metal
private Pipeline _pipeline;
private Window _window;
public uint ProgramCount { get; set; } = 0;
public uint ProgramCount { get; set; }
#pragma warning disable CS0067 // The event is never used
public event EventHandler<ScreenCaptureImageInfo> ScreenCaptured;
#pragma warning restore CS0067
public bool PreferThreading => true;
public IPipeline Pipeline => _pipeline;
public IWindow Window => _window;

View File

@@ -125,6 +125,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
Instruction.Add => "PreciseFAdd",
Instruction.Subtract => "PreciseFSub",
Instruction.Multiply => "PreciseFMul",
_ => throw new NotImplementedException()
};
return $"{func}({expr[0]}, {expr[1]})";

View File

@@ -917,7 +917,7 @@ namespace Ryujinx.Ava
if (ShouldInitMetal)
{
#pragma warning disable CA1416 This call site is reachable on all platforms
#pragma warning disable CA1416 // This call site is reachable on all platforms
// The condition does a check for Mac, on top of checking if it's an ARM Mac. This isn't a problem.
renderer = new MetalRenderer((RendererHost.EmbeddedWindow as EmbeddedWindowMetal)!.CreateSurface);
#pragma warning restore CA1416

View File

@@ -3797,7 +3797,7 @@
"el_GR": "Ζώνη Ώρας Συστήματος:",
"en_US": "System Time Zone:",
"es_ES": "Zona horaria del sistema:",
"fr_FR": "Fuseau horaire du système :",
"fr_FR": "Fuseau horaire du système\u00A0:",
"he_IL": "אזור זמן מערכת:",
"it_IT": "Fuso orario del sistema:",
"ja_JP": "タイムゾーン:",
@@ -15125,7 +15125,7 @@
"el_GR": "",
"en_US": "Aspect Ratio applied to the renderer window.\n\nOnly change this if you're using an aspect ratio mod for your game, otherwise the graphics will be stretched.\n\nLeave on 16:9 if unsure.",
"es_ES": "Relación de aspecto aplicada a la ventana del renderizador.\n\nSolamente modificar esto si estás utilizando un mod de relación de aspecto para su juego, en cualquier otro caso los gráficos se estirarán.\n\nDejar en 16:9 si no sabe que hacer.",
"fr_FR": "Format d'affichage appliqué à la fenêtre du moteur de rendu.\n\nChangez cela uniquement si vous utilisez un mod changeant le format d'affichage pour votre jeu, sinon les graphismes seront étirés.\n\nLaissez sur 16:9 si vous n'êtes pas sûr.",
"fr_FR": "Format\u00A0d'affichage appliqué à la fenêtre du moteur de rendu.\n\nChangez cela uniquement si vous utilisez un mod changeant le format\u00A0d'affichage pour votre jeu, sinon les graphismes seront étirés.\n\nLaissez sur 16:9 si vous n'êtes pas sûr.",
"he_IL": "",
"it_IT": "Proporzioni dello schermo applicate alla finestra di renderizzazione.\n\nCambialo solo se stai usando una mod di proporzioni per il tuo gioco, altrimenti la grafica verrà allungata.\n\nLasciare il 16:9 se incerto.",
"ja_JP": "レンダリングウインドウに適用するアスペクト比です.\n\nゲームにアスペクト比を変更する mod を使用している場合のみ変更してください.\n\nわからない場合は16:9のままにしておいてください.\n",
@@ -20213,7 +20213,7 @@
"el_GR": "Όνομα",
"en_US": "Name",
"es_ES": "Nombre",
"fr_FR": "Nom ",
"fr_FR": "Nom\u00A0",
"he_IL": "שם",
"it_IT": "Nome",
"ja_JP": "名称",
@@ -21694,4 +21694,4 @@
}
}
]
}
}

View File

@@ -13,8 +13,8 @@
<DefaultItemExcludes>$(DefaultItemExcludes);._*</DefaultItemExcludes>
</PropertyGroup>
<Target Name="BuildValidationProj" BeforeTargets="BeforeRebuild">
<MSBuild Projects="..\Ryujinx.BuildValidationTasks\Ryujinx.BuildValidationTasks.csproj" Targets="Rebuild">
<Target Name="BuildValidationProj" BeforeTargets="BeforeBuild">
<MSBuild Projects="..\Ryujinx.BuildValidationTasks\Ryujinx.BuildValidationTasks.csproj" Targets="ValidationTask" >
</MSBuild>
</Target>

View File

@@ -62,11 +62,6 @@ namespace Ryujinx.Ava.UI.Renderer
KnownGreatMetalTitles.ContainsIgnoreCase(titleId)
? new EmbeddedWindowMetal()
: new EmbeddedWindowVulkan();
string backendText = EmbeddedWindow is EmbeddedWindowVulkan ? "Vulkan" : "Metal";
Logger.Info?.Print(LogClass.Gpu, $"Auto: Using {backendText}");
break;
case GraphicsBackend.OpenGl:
EmbeddedWindow = new EmbeddedWindowOpenGL();
@@ -78,6 +73,16 @@ namespace Ryujinx.Ava.UI.Renderer
EmbeddedWindow = new EmbeddedWindowVulkan();
break;
}
string backendText = EmbeddedWindow switch
{
EmbeddedWindowVulkan => "Vulkan",
EmbeddedWindowOpenGL => "OpenGL",
EmbeddedWindowMetal => "Metal",
_ => throw new NotImplementedException()
};
Logger.Info?.PrintMsg(LogClass.Gpu, $"Backend ({ConfigurationState.Instance.Graphics.GraphicsBackend.Value}): {backendText}");
Initialize();
}