This commit is contained in:
Marco Carvalho 2024-12-27 14:38:15 -03:00
parent 00b86407a2
commit 82cae0455a
12 changed files with 14 additions and 14 deletions

View File

@ -13,7 +13,7 @@ namespace ARMeilleure.CodeGen.Arm64
public static void RunPass(ControlFlowGraph cfg) public static void RunPass(ControlFlowGraph cfg)
{ {
var constants = new Dictionary<ulong, Operand>(); Dictionary<ulong, Operand> constants = [];
Operand GetConstantCopy(BasicBlock block, Operation operation, Operand source) Operand GetConstantCopy(BasicBlock block, Operation operation, Operand source)
{ {

View File

@ -13,7 +13,7 @@ namespace ARMeilleure.CodeGen.X86
public static void RunPass(ControlFlowGraph cfg) public static void RunPass(ControlFlowGraph cfg)
{ {
var constants = new Dictionary<ulong, Operand>(); Dictionary<ulong, Operand> constants = [];
Operand GetConstantCopy(BasicBlock block, Operation operation, Operand source) Operand GetConstantCopy(BasicBlock block, Operation operation, Operand source)
{ {

View File

@ -260,7 +260,7 @@ namespace ARMeilleure.Translation
Logger.EndPass(PassName.RegisterUsage); Logger.EndPass(PassName.RegisterUsage);
var retType = OperandType.I64; var retType = OperandType.I64;
var argTypes = new OperandType[] { OperandType.I64 }; OperandType[] argTypes = [ OperandType.I64 ];
var options = highCq ? CompilerOptions.HighCq : CompilerOptions.None; var options = highCq ? CompilerOptions.HighCq : CompilerOptions.None;

View File

@ -58,7 +58,7 @@ namespace Ryujinx.Graphics.Gpu.Engine.Threed
_registerToGroupMapping = new byte[BlockSize]; _registerToGroupMapping = new byte[BlockSize];
_callbacks = new Action[entries.Length]; _callbacks = new Action[entries.Length];
var fieldToDelegate = new Dictionary<string, int>(); Dictionary<string, int> fieldToDelegate = [];
for (int entryIndex = 0; entryIndex < entries.Length; entryIndex++) for (int entryIndex = 0; entryIndex < entries.Length; entryIndex++)
{ {

View File

@ -92,7 +92,7 @@ namespace Ryujinx.Graphics.OpenGL.Effects.Smaa
var blendShaderData = EmbeddedResources.ReadAllText("Ryujinx.Graphics.OpenGL/Effects/Shaders/smaa_blend.glsl"); var blendShaderData = EmbeddedResources.ReadAllText("Ryujinx.Graphics.OpenGL/Effects/Shaders/smaa_blend.glsl");
var neighbourShaderData = EmbeddedResources.ReadAllText("Ryujinx.Graphics.OpenGL/Effects/Shaders/smaa_neighbour.glsl"); var neighbourShaderData = EmbeddedResources.ReadAllText("Ryujinx.Graphics.OpenGL/Effects/Shaders/smaa_neighbour.glsl");
var shaders = new string[] { presets, edgeShaderData }; string[] shaders = [ presets, edgeShaderData ];
var edgeProgram = ShaderHelper.CompileProgram(shaders, ShaderType.ComputeShader); var edgeProgram = ShaderHelper.CompileProgram(shaders, ShaderType.ComputeShader);
shaders[1] = blendShaderData; shaders[1] = blendShaderData;

View File

@ -307,7 +307,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Spirv
{ {
AstBlockVisitor visitor = new(block); AstBlockVisitor visitor = new(block);
var loopTargets = new Dictionary<AstBlock, (SpvInstruction, SpvInstruction)>(); Dictionary<AstBlock, (SpvInstruction, SpvInstruction)> loopTargets = [];
context.LoopTargets = loopTargets; context.LoopTargets = loopTargets;

View File

@ -57,7 +57,7 @@ namespace Ryujinx.Graphics.Shader.Instructions
private static IReadOnlyDictionary<int, AttributeEntry> CreateMap() private static IReadOnlyDictionary<int, AttributeEntry> CreateMap()
{ {
var map = new Dictionary<int, AttributeEntry>(); Dictionary<int, AttributeEntry> map = [];
Add(map, 0x060, AggregateType.S32, IoVariable.PrimitiveId, StagesMask.TessellationGeometryFragment, StagesMask.Geometry); Add(map, 0x060, AggregateType.S32, IoVariable.PrimitiveId, StagesMask.TessellationGeometryFragment, StagesMask.Geometry);
Add(map, 0x064, AggregateType.S32, IoVariable.Layer, StagesMask.Fragment, StagesMask.VertexTessellationGeometry); Add(map, 0x064, AggregateType.S32, IoVariable.Layer, StagesMask.Fragment, StagesMask.VertexTessellationGeometry);
@ -84,7 +84,7 @@ namespace Ryujinx.Graphics.Shader.Instructions
private static IReadOnlyDictionary<int, AttributeEntry> CreatePerPatchMap() private static IReadOnlyDictionary<int, AttributeEntry> CreatePerPatchMap()
{ {
var map = new Dictionary<int, AttributeEntry>(); Dictionary<int, AttributeEntry> map = [];
Add(map, 0x000, AggregateType.Vector4 | AggregateType.FP32, IoVariable.TessellationLevelOuter, StagesMask.TessellationEvaluation, StagesMask.TessellationControl); Add(map, 0x000, AggregateType.Vector4 | AggregateType.FP32, IoVariable.TessellationLevelOuter, StagesMask.TessellationEvaluation, StagesMask.TessellationControl);
Add(map, 0x010, AggregateType.Vector2 | AggregateType.FP32, IoVariable.TessellationLevelInner, StagesMask.TessellationEvaluation, StagesMask.TessellationControl); Add(map, 0x010, AggregateType.Vector2 | AggregateType.FP32, IoVariable.TessellationLevelInner, StagesMask.TessellationEvaluation, StagesMask.TessellationControl);

View File

@ -138,7 +138,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldn.UserServiceCreator.LdnMitm.Proxy
lock (_scanLock) lock (_scanLock)
{ {
var results = new Dictionary<ulong, NetworkInfo>(); Dictionary<ulong, NetworkInfo> results = [];
foreach (KeyValuePair<ulong, NetworkInfo> last in _scanResultsLast) foreach (KeyValuePair<ulong, NetworkInfo> last in _scanResultsLast)
{ {

View File

@ -28,7 +28,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
{ {
fileSystem.ImportTickets(partitionFileSystem); fileSystem.ImportTickets(partitionFileSystem);
var programs = new Dictionary<ulong, ContentMetaData>(); Dictionary<ulong, ContentMetaData> programs = [];
foreach (DirectoryEntryEx fileEntry in partitionFileSystem.EnumerateEntries("/", "*.cnmt.nca")) foreach (DirectoryEntryEx fileEntry in partitionFileSystem.EnumerateEntries("/", "*.cnmt.nca"))
{ {

View File

@ -125,7 +125,7 @@ namespace Ryujinx.Ava.Common.Locale
private static Dictionary<LocaleKeys, string> LoadJsonLanguage(string languageCode) private static Dictionary<LocaleKeys, string> LoadJsonLanguage(string languageCode)
{ {
var localeStrings = new Dictionary<LocaleKeys, string>(); Dictionary<LocaleKeys, string> localeStrings = [];
_localeData ??= EmbeddedResources.ReadAllText("Ryujinx/Assets/locales.json") _localeData ??= EmbeddedResources.ReadAllText("Ryujinx/Assets/locales.json")
.Into(it => JsonHelper.Deserialize(it, LocalesJsonContext.Default.LocalesJson)); .Into(it => JsonHelper.Deserialize(it, LocalesJsonContext.Default.LocalesJson));

View File

@ -50,7 +50,7 @@ namespace Ryujinx.Ava.UI.Windows
public static SKColor GetColor(SKBitmap image) public static SKColor GetColor(SKBitmap image)
{ {
var colors = new PaletteColor[TotalColors]; var colors = new PaletteColor[TotalColors];
var dominantColorBin = new Dictionary<int, int>(); Dictionary<int, int> dominantColorBin = [];
var buffer = GetBuffer(image); var buffer = GetBuffer(image);

View File

@ -16,7 +16,7 @@ namespace Ryujinx.Ava.Utilities.SystemInfo
if (cpuName == null) if (cpuName == null)
{ {
var cpuDict = new Dictionary<string, string>(StringComparer.Ordinal) Dictionary<string, string> cpuDict = new(StringComparer.Ordinal)
{ {
["model name"] = null, ["model name"] = null,
["Processor"] = null, ["Processor"] = null,
@ -28,7 +28,7 @@ namespace Ryujinx.Ava.Utilities.SystemInfo
cpuName = cpuDict["model name"] ?? cpuDict["Processor"] ?? cpuDict["Hardware"] ?? "Unknown"; cpuName = cpuDict["model name"] ?? cpuDict["Processor"] ?? cpuDict["Hardware"] ?? "Unknown";
} }
var memDict = new Dictionary<string, string>(StringComparer.Ordinal) Dictionary<string, string> memDict = new(StringComparer.Ordinal)
{ {
["MemTotal"] = null, ["MemTotal"] = null,
["MemAvailable"] = null, ["MemAvailable"] = null,