aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/Instructions
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2019-12-14 14:51:00 -0300
committerThog <thog@protonmail.com>2020-01-09 02:13:00 +0100
commit2eccc7023ae0d1247378516b14507d422e4915c5 (patch)
tree8ae9a8905394717347a775997ae0347483a9b0d8 /Ryujinx.Graphics.Shader/Instructions
parent1a550e810c71670e5a2f032ec136fb2f5f57ac9c (diff)
Partial support for shader memory barriers
Diffstat (limited to 'Ryujinx.Graphics.Shader/Instructions')
-rw-r--r--Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs25
1 files changed, 25 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs b/Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs
index 56688161..866df56d 100644
--- a/Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs
+++ b/Ryujinx.Graphics.Shader/Instructions/InstEmitMemory.cs
@@ -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;