mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-11-19 17:21:15 +01:00
misc: chore: Use collection expressions
This commit is contained in:
1 parent
4d5757417e
commit
e2973a875a
236 files changed
+9843
-7561
No files matched your search
@@ -14,7 +14,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
||||
private const int DefaultLocalMemorySize = 128;
|
||||
private const int DefaultSharedMemorySize = 4096;
|
||||
|
||||
private static readonly string[] _stagePrefixes = new string[] { "cp", "vp", "tcp", "tep", "gp", "fp" };
|
||||
private static readonly string[] _stagePrefixes = ["cp", "vp", "tcp", "tep", "gp", "fp"];
|
||||
|
||||
private readonly IGpuAccessor _gpuAccessor;
|
||||
private readonly ShaderStage _stage;
|
||||
@@ -73,7 +73,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
||||
_sbSlots = new();
|
||||
_sbSlotsReverse = new();
|
||||
|
||||
_usedConstantBufferBindings = new();
|
||||
_usedConstantBufferBindings = [];
|
||||
|
||||
_usedTextures = new();
|
||||
_usedImages = new();
|
||||
@@ -514,7 +514,7 @@ namespace Ryujinx.Graphics.Shader.Translation
|
||||
|
||||
private static TextureDescriptor[] GetDescriptors(IReadOnlyDictionary<TextureInfo, TextureMeta> usedResources, bool includeArrays)
|
||||
{
|
||||
List<TextureDescriptor> descriptors = new();
|
||||
List<TextureDescriptor> descriptors = [];
|
||||
|
||||
bool hasAnyArray = false;
|
||||
|
||||
@@ -611,20 +611,18 @@ namespace Ryujinx.Graphics.Shader.Translation
|
||||
|
||||
private void AddNewConstantBuffer(int setIndex, int binding, string name)
|
||||
{
|
||||
StructureType type = new(new[]
|
||||
{
|
||||
new StructureField(AggregateType.Array | AggregateType.Vector4 | AggregateType.FP32, "data", Constants.ConstantBufferSize / 16),
|
||||
});
|
||||
StructureType type = new([
|
||||
new StructureField(AggregateType.Array | AggregateType.Vector4 | AggregateType.FP32, "data", Constants.ConstantBufferSize / 16)
|
||||
]);
|
||||
|
||||
Properties.AddOrUpdateConstantBuffer(new(BufferLayout.Std140, setIndex, binding, name, type));
|
||||
}
|
||||
|
||||
private void AddNewStorageBuffer(int setIndex, int binding, string name)
|
||||
{
|
||||
StructureType type = new(new[]
|
||||
{
|
||||
new StructureField(AggregateType.Array | AggregateType.U32, "data", 0),
|
||||
});
|
||||
StructureType type = new([
|
||||
new StructureField(AggregateType.Array | AggregateType.U32, "data", 0)
|
||||
]);
|
||||
|
||||
Properties.AddOrUpdateStorageBuffer(new(BufferLayout.Std430, setIndex, binding, name, type));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user