Partial support for shader memory barriers

This commit is contained in:
gdkchan 2019-12-14 14:51:00 -03:00 committed by Thog
parent 1a550e810c
commit 2eccc7023a
9 changed files with 98 additions and 0 deletions

View file

@ -77,6 +77,17 @@ namespace Ryujinx.Graphics.Shader.Instructions
context.Copy(GetDest(context), res);
}
public static void Bar(EmitterContext context)
{
OpCodeBarrier op = (OpCodeBarrier)context.CurrOp;
// TODO: Support other modes.
if (op.Mode == BarrierMode.Sync)
{
context.Barrier();
}
}
public static void Ipa(EmitterContext context)
{
OpCodeIpa op = (OpCodeIpa)context.CurrOp;
@ -162,6 +173,20 @@ namespace Ryujinx.Graphics.Shader.Instructions
EmitLoad(context, MemoryRegion.Shared);
}
public static void Membar(EmitterContext context)
{
OpCodeMemoryBarrier op = (OpCodeMemoryBarrier)context.CurrOp;
if (op.Level == BarrierLevel.Cta)
{
context.GroupMemoryBarrier();
}
else
{
context.MemoryBarrier();
}
}
public static void Out(EmitterContext context)
{
OpCode op = context.CurrOp;