Compare commits
1 commit
8cf725f4c1
...
67c0a2cd48
Author | SHA1 | Date | |
---|---|---|---|
|
67c0a2cd48 |
3 changed files with 7 additions and 30 deletions
|
@ -72,7 +72,7 @@ namespace Ryujinx.Graphics.Metal
|
||||||
Add(Format.D32FloatS8Uint, MTLPixelFormat.Depth32FloatStencil8);
|
Add(Format.D32FloatS8Uint, MTLPixelFormat.Depth32FloatStencil8);
|
||||||
Add(Format.R8G8B8A8Srgb, MTLPixelFormat.RGBA8UnormsRGB);
|
Add(Format.R8G8B8A8Srgb, MTLPixelFormat.RGBA8UnormsRGB);
|
||||||
// Add(Format.R4G4Unorm, MTLPixelFormat.R4G4Unorm);
|
// Add(Format.R4G4Unorm, MTLPixelFormat.R4G4Unorm);
|
||||||
Add(Format.R4G4B4A4Unorm, MTLPixelFormat.RGBA8Unorm);
|
// Add(Format.R4G4B4A4Unorm, MTLPixelFormat.R4G4B4A4Unorm);
|
||||||
// Add(Format.R5G5B5X1Unorm, MTLPixelFormat.R5G5B5X1Unorm);
|
// Add(Format.R5G5B5X1Unorm, MTLPixelFormat.R5G5B5X1Unorm);
|
||||||
Add(Format.R5G5B5A1Unorm, MTLPixelFormat.BGR5A1Unorm);
|
Add(Format.R5G5B5A1Unorm, MTLPixelFormat.BGR5A1Unorm);
|
||||||
Add(Format.R5G6B5Unorm, MTLPixelFormat.B5G6R5Unorm);
|
Add(Format.R5G6B5Unorm, MTLPixelFormat.B5G6R5Unorm);
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
using Ryujinx.Common;
|
using Ryujinx.Common;
|
||||||
using Ryujinx.Common.Logging;
|
|
||||||
using Ryujinx.Graphics.Shader.IntermediateRepresentation;
|
using Ryujinx.Graphics.Shader.IntermediateRepresentation;
|
||||||
using Ryujinx.Graphics.Shader.StructuredIr;
|
using Ryujinx.Graphics.Shader.StructuredIr;
|
||||||
using Ryujinx.Graphics.Shader.Translation;
|
using Ryujinx.Graphics.Shader.Translation;
|
||||||
|
@ -309,7 +308,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
||||||
{
|
{
|
||||||
if (context.Definitions.IaIndexing)
|
if (context.Definitions.IaIndexing)
|
||||||
{
|
{
|
||||||
Logger.Warning?.PrintMsg(LogClass.Gpu, "Unhandled IA Indexing!");
|
// Not handled
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -391,9 +390,9 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
||||||
|
|
||||||
private static void DeclareOutputAttributes(CodeGenContext context, IEnumerable<IoDefinition> outputs)
|
private static void DeclareOutputAttributes(CodeGenContext context, IEnumerable<IoDefinition> outputs)
|
||||||
{
|
{
|
||||||
if (context.Definitions.OaIndexing)
|
if (context.Definitions.IaIndexing)
|
||||||
{
|
{
|
||||||
Logger.Warning?.PrintMsg(LogClass.Gpu, "Unhandled OA Indexing!");
|
// Not handled
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -416,29 +415,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
||||||
|
|
||||||
context.EnterScope();
|
context.EnterScope();
|
||||||
|
|
||||||
outputs = outputs.OrderBy(x => x.Location);
|
foreach (var ioDefinition in outputs.OrderBy(x => x.Location))
|
||||||
|
|
||||||
if (context.Definitions.Stage == ShaderStage.Fragment && context.Definitions.DualSourceBlend)
|
|
||||||
{
|
|
||||||
IoDefinition firstOutput = outputs.ElementAtOrDefault(0);
|
|
||||||
IoDefinition secondOutput = outputs.ElementAtOrDefault(1);
|
|
||||||
|
|
||||||
if (firstOutput.Location + 1 == secondOutput.Location)
|
|
||||||
{
|
|
||||||
var type1 = GetVarTypeName(context.Definitions.GetFragmentOutputColorType(firstOutput.Location));
|
|
||||||
var type2 = GetVarTypeName(context.Definitions.GetFragmentOutputColorType(secondOutput.Location));
|
|
||||||
|
|
||||||
var name1 = $"color{firstOutput.Location}";
|
|
||||||
var name2 = $"color{secondOutput.Location}";
|
|
||||||
|
|
||||||
context.AppendLine($"{type1} {name1} [[color({firstOutput.Location}, index(0)]]");
|
|
||||||
context.AppendLine($"{type2} {name2} [[color({firstOutput.Location}, index(1)]]");
|
|
||||||
|
|
||||||
outputs = outputs.Skip(2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var ioDefinition in outputs)
|
|
||||||
{
|
{
|
||||||
string type = ioDefinition.IoVariable switch
|
string type = ioDefinition.IoVariable switch
|
||||||
{
|
{
|
||||||
|
|
|
@ -76,7 +76,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
||||||
return value.ToString(CultureInfo.InvariantCulture);
|
return value.ToString(CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $"as_type<int>(0x{value.ToString("X", CultureInfo.InvariantCulture)})";
|
return "0x" + value.ToString("X", CultureInfo.InvariantCulture);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static string FormatUint(uint value)
|
public static string FormatUint(uint value)
|
||||||
|
@ -86,7 +86,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl
|
||||||
return value.ToString(CultureInfo.InvariantCulture) + "u";
|
return value.ToString(CultureInfo.InvariantCulture) + "u";
|
||||||
}
|
}
|
||||||
|
|
||||||
return $"as_type<uint>(0x{value.ToString("X", CultureInfo.InvariantCulture)})";
|
return "0x" + value.ToString("X", CultureInfo.InvariantCulture) + "u";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue