From f17415d431777bb234714a3c6a97072872b2cc71 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Tue, 30 Jul 2019 00:21:46 -0300 Subject: shader_ir: Implement ST_S This instruction writes to a memory buffer shared with threads within the same work group. It is known as "shared" memory in GLSL. --- src/video_core/shader/shader_ir.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/video_core/shader/shader_ir.cpp') diff --git a/src/video_core/shader/shader_ir.cpp b/src/video_core/shader/shader_ir.cpp index 1e5c7f660..bbbab0bca 100644 --- a/src/video_core/shader/shader_ir.cpp +++ b/src/video_core/shader/shader_ir.cpp @@ -137,6 +137,10 @@ Node ShaderIR::GetLocalMemory(Node address) { return MakeNode(std::move(address)); } +Node ShaderIR::GetSharedMemory(Node address) { + return MakeNode(std::move(address)); +} + Node ShaderIR::GetTemporary(u32 id) { return GetRegister(Register::ZeroIndex + 1 + id); } @@ -378,6 +382,11 @@ void ShaderIR::SetLocalMemory(NodeBlock& bb, Node address, Node value) { Operation(OperationCode::Assign, GetLocalMemory(std::move(address)), std::move(value))); } +void ShaderIR::SetSharedMemory(NodeBlock& bb, Node address, Node value) { + bb.push_back( + Operation(OperationCode::Assign, GetSharedMemory(std::move(address)), std::move(value))); +} + void ShaderIR::SetTemporary(NodeBlock& bb, u32 id, Node value) { SetRegister(bb, Register::ZeroIndex + 1 + id, std::move(value)); } -- cgit v1.2.3