Prefer using collection expressions with implicit object creation when the type is clear
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user