aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs')
-rw-r--r--Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs64
1 files changed, 64 insertions, 0 deletions
diff --git a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs
index 5e46bb46..f976ec5e 100644
--- a/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs
+++ b/Ryujinx.Graphics.Shader/CodeGen/Glsl/Instructions/InstGenMemory.cs
@@ -365,6 +365,34 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
return $"{arrayName}[{offsetExpr}] = {src}";
}
+ public static string StoreShared16(CodeGenContext context, AstOperation operation)
+ {
+ IAstNode src1 = operation.GetSource(0);
+ IAstNode src2 = operation.GetSource(1);
+
+ string offsetExpr = GetSoureExpr(context, src1, GetSrcVarType(operation.Inst, 0));
+
+ VariableType srcType = OperandManager.GetNodeDestType(context, src2);
+
+ string src = TypeConversion.ReinterpretCast(context, src2, srcType, VariableType.U32);
+
+ return $"{HelperFunctionNames.StoreShared16}({offsetExpr}, {src})";
+ }
+
+ public static string StoreShared8(CodeGenContext context, AstOperation operation)
+ {
+ IAstNode src1 = operation.GetSource(0);
+ IAstNode src2 = operation.GetSource(1);
+
+ string offsetExpr = GetSoureExpr(context, src1, GetSrcVarType(operation.Inst, 0));
+
+ VariableType srcType = OperandManager.GetNodeDestType(context, src2);
+
+ string src = TypeConversion.ReinterpretCast(context, src2, srcType, VariableType.U32);
+
+ return $"{HelperFunctionNames.StoreShared8}({offsetExpr}, {src})";
+ }
+
public static string StoreStorage(CodeGenContext context, AstOperation operation)
{
IAstNode src1 = operation.GetSource(0);
@@ -383,6 +411,42 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Glsl.Instructions
return $"{sb} = {src}";
}
+ public static string StoreStorage16(CodeGenContext context, AstOperation operation)
+ {
+ IAstNode src1 = operation.GetSource(0);
+ IAstNode src2 = operation.GetSource(1);
+ IAstNode src3 = operation.GetSource(2);
+
+ string indexExpr = GetSoureExpr(context, src1, GetSrcVarType(operation.Inst, 0));
+ string offsetExpr = GetSoureExpr(context, src2, GetSrcVarType(operation.Inst, 1));
+
+ VariableType srcType = OperandManager.GetNodeDestType(context, src3);
+
+ string src = TypeConversion.ReinterpretCast(context, src3, srcType, VariableType.U32);
+
+ string sb = GetStorageBufferAccessor(indexExpr, offsetExpr, context.Config.Stage);
+
+ return $"{HelperFunctionNames.StoreStorage16}({indexExpr}, {offsetExpr}, {src})";
+ }
+
+ public static string StoreStorage8(CodeGenContext context, AstOperation operation)
+ {
+ IAstNode src1 = operation.GetSource(0);
+ IAstNode src2 = operation.GetSource(1);
+ IAstNode src3 = operation.GetSource(2);
+
+ string indexExpr = GetSoureExpr(context, src1, GetSrcVarType(operation.Inst, 0));
+ string offsetExpr = GetSoureExpr(context, src2, GetSrcVarType(operation.Inst, 1));
+
+ VariableType srcType = OperandManager.GetNodeDestType(context, src3);
+
+ string src = TypeConversion.ReinterpretCast(context, src3, srcType, VariableType.U32);
+
+ string sb = GetStorageBufferAccessor(indexExpr, offsetExpr, context.Config.Stage);
+
+ return $"{HelperFunctionNames.StoreStorage8}({indexExpr}, {offsetExpr}, {src})";
+ }
+
public static string TextureSample(CodeGenContext context, AstOperation operation)
{
AstTextureOperation texOp = (AstTextureOperation)operation;