Prefer using collection expressions with implicit object creation when the type is clear

This commit is contained in:
Marco Carvalho
2024-12-27 13:23:31 -03:00
parent 850df38f1e
commit 57d1486da9
510 changed files with 6022 additions and 6212 deletions

View File

@@ -143,7 +143,7 @@ namespace Ryujinx.Graphics.Shader.Translation
ops.Add(operation);
}
output[0] = new FunctionCode(ops.ToArray());
output[0] = new FunctionCode([.. ops]);
for (int i = 1; i < a.Length; i++)
{
@@ -386,10 +386,10 @@ namespace Ryujinx.Graphics.Shader.Translation
if (IsTransformFeedbackEmulated)
{
StructureType tfeDataStruct = new(new StructureField[]
{
new StructureField(AggregateType.Array | AggregateType.U32, "data", 0)
});
StructureType tfeDataStruct = new(
[
new(AggregateType.Array | AggregateType.U32, "data", 0)
]);
for (int i = 0; i < ResourceReservations.TfeBuffersCount; i++)
{
@@ -405,10 +405,10 @@ namespace Ryujinx.Graphics.Shader.Translation
BufferDefinition vertexInfoBuffer = new(BufferLayout.Std140, 0, vertexInfoCbBinding, "vb_info", VertexInfoBuffer.GetStructureType());
resourceManager.AddVertexAsComputeConstantBuffer(vertexInfoBuffer);
StructureType vertexOutputStruct = new(new StructureField[]
{
new StructureField(AggregateType.Array | AggregateType.FP32, "data", 0)
});
StructureType vertexOutputStruct = new(
[
new(AggregateType.Array | AggregateType.FP32, "data", 0)
]);
int vertexOutputSbBinding = resourceManager.Reservations.VertexOutputStorageBufferBinding;
BufferDefinition vertexOutputBuffer = new(BufferLayout.Std430, 1, vertexOutputSbBinding, "vertex_output", vertexOutputStruct);
@@ -442,10 +442,10 @@ namespace Ryujinx.Graphics.Shader.Translation
BufferDefinition geometryVbOutputBuffer = new(BufferLayout.Std430, 1, geometryVbOutputSbBinding, "geometry_vb_output", vertexOutputStruct);
resourceManager.AddVertexAsComputeStorageBuffer(geometryVbOutputBuffer);
StructureType geometryIbOutputStruct = new(new StructureField[]
{
new StructureField(AggregateType.Array | AggregateType.U32, "data", 0)
});
StructureType geometryIbOutputStruct = new(
[
new(AggregateType.Array | AggregateType.U32, "data", 0)
]);
int geometryIbOutputSbBinding = resourceManager.Reservations.GeometryIndexOutputStorageBufferBinding;
BufferDefinition geometryIbOutputBuffer = new(BufferLayout.Std430, 1, geometryIbOutputSbBinding, "geometry_ib_output", geometryIbOutputStruct);
@@ -507,10 +507,10 @@ namespace Ryujinx.Graphics.Shader.Translation
resourceManager.AddVertexAsComputeConstantBuffer(vertexInfoBuffer);
}
StructureType vertexInputStruct = new(new StructureField[]
{
new StructureField(AggregateType.Array | AggregateType.FP32, "data", 0)
});
StructureType vertexInputStruct = new(
[
new(AggregateType.Array | AggregateType.FP32, "data", 0)
]);
int vertexDataSbBinding = reservations.VertexOutputStorageBufferBinding;
BufferDefinition vertexOutputBuffer = new(BufferLayout.Std430, 1, vertexDataSbBinding, "vb_input", vertexInputStruct);