Add a pass to turn global memory access into storage access, and do all storage related transformations on IR

This commit is contained in:
gdk 2019-11-30 23:53:09 -03:00 committed by Thog
parent 396768f3b4
commit 6a98c643ca
28 changed files with 532 additions and 282 deletions

View file

@ -49,12 +49,18 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
if (argIndex == 0 && atomic)
{
switch (inst & Instruction.MrMask)
Instruction memRegion = inst & Instruction.MrMask;
switch (memRegion)
{
// TODO: Global.
case Instruction.MrShared: args += LoadShared (context, operation); break;
case Instruction.MrStorage: args += LoadStorage(context, operation); break;
default: throw new InvalidOperationException($"Invalid memory region \"{memRegion}\".");
}
// We use the first 2 operands above.
argIndex++;
}
else
{
@ -150,8 +156,6 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
}
}
return "0";
throw new InvalidOperationException($"Unexpected instruction type \"{info.Type}\".");
}
}