mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-11-18 20:40:53 -05:00
Shader Memory Barriers
Fixes some of the shader generation failures in Sonic Frontiers
This commit is contained in:
committed by
Evan Husted
parent
d42f0e5945
commit
6229f3bb4c
@@ -600,6 +600,13 @@ 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)}";
|
||||
|
||||
Reference in New Issue
Block a user