summaryrefslogtreecommitdiff
path: root/src/shader_recompiler
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp b/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp
index 33af83212..26b03587e 100644
--- a/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp
+++ b/src/shader_recompiler/backend/glasm/emit_glasm_memory.cpp
@@ -37,8 +37,8 @@ void GlobalStorageOp(EmitContext& ctx, Register address, std::string_view then_e
37 continue; 37 continue;
38 } 38 }
39 const auto& ssbo{ctx.info.storage_buffers_descriptors[index]}; 39 const auto& ssbo{ctx.info.storage_buffers_descriptors[index]};
40 ctx.Add("LDC.U64 DC.x,c[{}];" // ssbo_addr 40 ctx.Add("LDC.U64 DC.x,c{}[{}];" // ssbo_addr
41 "LDC.U32 RC.x,c[{}];" // ssbo_size_u32 41 "LDC.U32 RC.x,c{}[{}];" // ssbo_size_u32
42 "CVT.U64.U32 DC.y,RC.x;" // ssbo_size = ssbo_size_u32 42 "CVT.U64.U32 DC.y,RC.x;" // ssbo_size = ssbo_size_u32
43 "ADD.U64 DC.y,DC.y,DC.x;" // ssbo_end = ssbo_addr + ssbo_size 43 "ADD.U64 DC.y,DC.y,DC.x;" // ssbo_end = ssbo_addr + ssbo_size
44 "SGE.U64 RC.x,{}.x,DC.x;" // a = input_addr >= ssbo_addr ? -1 : 1 44 "SGE.U64 RC.x,{}.x,DC.x;" // a = input_addr >= ssbo_addr ? -1 : 1
@@ -48,9 +48,10 @@ void GlobalStorageOp(EmitContext& ctx, Register address, std::string_view then_e
48 "SUB.U64 DC.x,{}.x,DC.x;" // offset = input_addr - ssbo_addr 48 "SUB.U64 DC.x,{}.x,DC.x;" // offset = input_addr - ssbo_addr
49 "PK64.U DC.y,c[{}];" // host_ssbo = cbuf 49 "PK64.U DC.y,c[{}];" // host_ssbo = cbuf
50 "ADD.U64 DC.x,DC.x,DC.y;" // host_addr = host_ssbo + offset 50 "ADD.U64 DC.x,DC.x,DC.y;" // host_addr = host_ssbo + offset
51 "{}", 51 "{}"
52 "ELSE;", index, index, ssbo.cbuf_offset, ssbo.cbuf_offset + 8, address, address, 52 "ELSE;",
53 address, index, then_expr); 53 ssbo.cbuf_index, ssbo.cbuf_offset, ssbo.cbuf_index, ssbo.cbuf_offset + 8, address,
54 address, address, index, then_expr);
54 } 55 }
55 if (!else_expr.empty()) { 56 if (!else_expr.empty()) {
56 ctx.Add("{}", else_expr); 57 ctx.Add("{}", else_expr);