mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2024-12-26 18:43:04 +00:00
Consolodate barriers
This commit is contained in:
parent
a31e461db8
commit
558752594c
3 changed files with 6 additions and 15 deletions
|
@ -122,8 +122,6 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
|
|||
{
|
||||
case Instruction.Ballot:
|
||||
return Ballot(context, operation);
|
||||
case Instruction.Barrier:
|
||||
return Barrier(context, operation);
|
||||
case Instruction.Call:
|
||||
return Call(context, operation);
|
||||
case Instruction.FSIBegin:
|
||||
|
@ -132,7 +130,8 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
|
|||
return "|| FSI END ||";
|
||||
case Instruction.GroupMemoryBarrier:
|
||||
case Instruction.MemoryBarrier:
|
||||
return MemoryBarrier(context, operation);
|
||||
case Instruction.Barrier:
|
||||
return Barrier(context, operation);
|
||||
case Instruction.ImageLoad:
|
||||
case Instruction.ImageStore:
|
||||
case Instruction.ImageAtomic:
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
using Ryujinx.Graphics.Shader.IntermediateRepresentation;
|
||||
using Ryujinx.Graphics.Shader.StructuredIr;
|
||||
using Ryujinx.Graphics.Shader.Translation;
|
||||
|
||||
using static Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions.InstGenHelper;
|
||||
using static Ryujinx.Graphics.Shader.StructuredIr.InstructionInfo;
|
||||
|
||||
namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
|
||||
{
|
||||
|
@ -10,7 +7,9 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
|
|||
{
|
||||
public static string Barrier(CodeGenContext context, AstOperation operation)
|
||||
{
|
||||
return "threadgroup_barrier(mem_flags::mem_threadgroup)";
|
||||
var device = (operation.Inst & Instruction.Mask) == Instruction.MemoryBarrier;
|
||||
|
||||
return $"threadgroup_barrier(mem_flags::mem_{(device ? "device" : "threadgroup")})";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -600,13 +600,6 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions
|
|||
return $"float2(as_type<half2>({srcExpr})){GetMask(operation.Index)}";
|
||||
}
|
||||
|
||||
public static string MemoryBarrier(CodeGenContext context, AstOperation operation)
|
||||
{
|
||||
var grouped = (operation.Inst & Instruction.Mask) == Instruction.GroupMemoryBarrier;
|
||||
|
||||
return $"threadgroup_barrier(mem_flags::mem_{(grouped ? "threadgroup" : "device")})";
|
||||
}
|
||||
|
||||
private static string GetMask(int index)
|
||||
{
|
||||
return $".{"xy".AsSpan(index, 1)}";
|
||||
|
|
Loading…
Reference in a new issue