|
@@ -218,7 +218,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
|
|
|
|
|
|
|
foreach (MemoryDefinition memory in memories)
|
|
foreach (MemoryDefinition memory in memories)
|
|
|
{
|
|
{
|
|
|
- string arraySize = "";
|
|
|
|
|
|
|
+ string arraySize = string.Empty;
|
|
|
if ((memory.Type & AggregateType.Array) != 0)
|
|
if ((memory.Type & AggregateType.Array) != 0)
|
|
|
{
|
|
{
|
|
|
arraySize = $"[{memory.ArrayLength}]";
|
|
arraySize = $"[{memory.ArrayLength}]";
|
|
@@ -240,7 +240,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
|
|
BufferDefinition buffer = buffers[i];
|
|
BufferDefinition buffer = buffers[i];
|
|
|
|
|
|
|
|
bool needsPadding = buffer.Layout == BufferLayout.Std140;
|
|
bool needsPadding = buffer.Layout == BufferLayout.Std140;
|
|
|
- string fsiSuffix = !constant && fsi ? " [[raster_order_group(0)]]" : "";
|
|
|
|
|
|
|
+ string fsiSuffix = !constant && fsi ? " [[raster_order_group(0)]]" : string.Empty;
|
|
|
|
|
|
|
|
bufferDec[i] = $"{addressSpace} {Defaults.StructPrefix}_{buffer.Name}* {buffer.Name}{fsiSuffix};";
|
|
bufferDec[i] = $"{addressSpace} {Defaults.StructPrefix}_{buffer.Name}* {buffer.Name}{fsiSuffix};";
|
|
|
|
|
|
|
@@ -257,7 +257,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
|
|
type &= ~AggregateType.Array;
|
|
type &= ~AggregateType.Array;
|
|
|
|
|
|
|
|
string typeName = GetVarTypeName(type);
|
|
string typeName = GetVarTypeName(type);
|
|
|
- string arraySuffix = "";
|
|
|
|
|
|
|
+ string arraySuffix = string.Empty;
|
|
|
|
|
|
|
|
if (field.Type.HasFlag(AggregateType.Array))
|
|
if (field.Type.HasFlag(AggregateType.Array))
|
|
|
{
|
|
{
|
|
@@ -353,7 +353,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
|
|
imageTypeName = $"array<{imageTypeName}, {image.ArrayLength}>";
|
|
imageTypeName = $"array<{imageTypeName}, {image.ArrayLength}>";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- string fsiSuffix = fsi ? " [[raster_order_group(0)]]" : "";
|
|
|
|
|
|
|
+ string fsiSuffix = fsi ? " [[raster_order_group(0)]]" : string.Empty;
|
|
|
|
|
|
|
|
imageDec[i] = $"{imageTypeName} {image.Name}{fsiSuffix};";
|
|
imageDec[i] = $"{imageTypeName} {image.Name}{fsiSuffix};";
|
|
|
}
|
|
}
|
|
@@ -454,7 +454,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
|
|
IoVariable.VertexIndex => "[[vertex_id]]",
|
|
IoVariable.VertexIndex => "[[vertex_id]]",
|
|
|
// IoVariable.PointCoord => "[[point_coord]]",
|
|
// IoVariable.PointCoord => "[[point_coord]]",
|
|
|
IoVariable.UserDefined => context.Definitions.Stage == ShaderStage.Fragment ? $"[[user(loc{ioDefinition.Location})]]" : $"[[attribute({ioDefinition.Location})]]",
|
|
IoVariable.UserDefined => context.Definitions.Stage == ShaderStage.Fragment ? $"[[user(loc{ioDefinition.Location})]]" : $"[[attribute({ioDefinition.Location})]]",
|
|
|
- _ => ""
|
|
|
|
|
|
|
+ _ => string.Empty
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
context.AppendLine($"{type} {name} {iq}{suffix};");
|
|
context.AppendLine($"{type} {name} {iq}{suffix};");
|
|
@@ -545,7 +545,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
|
|
IoVariable.FragmentOutputColor => $"[[color({ioDefinition.Location})]]",
|
|
IoVariable.FragmentOutputColor => $"[[color({ioDefinition.Location})]]",
|
|
|
IoVariable.FragmentOutputDepth => "[[depth(any)]]",
|
|
IoVariable.FragmentOutputDepth => "[[depth(any)]]",
|
|
|
IoVariable.ClipDistance => $"[[clip_distance]][{Defaults.TotalClipDistances}]",
|
|
IoVariable.ClipDistance => $"[[clip_distance]][{Defaults.TotalClipDistances}]",
|
|
|
- _ => ""
|
|
|
|
|
|
|
+ _ => string.Empty
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
context.AppendLine($"{type} {name} {suffix};");
|
|
context.AppendLine($"{type} {name} {suffix};");
|