diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-05-27 06:26:16 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:36 +0200 |
commit | ed14d31f663e126a8f9fe0ea8abff8e27c46248b (patch) | |
tree | 6bfe4bec1eda9960aef7c80dfa5926ab97984bd3 /src/shader_recompiler/backend/glsl/emit_glsl_memory.cpp | |
parent | glsl: textures wip (diff) | |
download | yuzu-ed14d31f663e126a8f9fe0ea8abff8e27c46248b.tar yuzu-ed14d31f663e126a8f9fe0ea8abff8e27c46248b.tar.gz yuzu-ed14d31f663e126a8f9fe0ea8abff8e27c46248b.tar.bz2 yuzu-ed14d31f663e126a8f9fe0ea8abff8e27c46248b.tar.lz yuzu-ed14d31f663e126a8f9fe0ea8abff8e27c46248b.tar.xz yuzu-ed14d31f663e126a8f9fe0ea8abff8e27c46248b.tar.zst yuzu-ed14d31f663e126a8f9fe0ea8abff8e27c46248b.zip |
Diffstat (limited to '')
-rw-r--r-- | src/shader_recompiler/backend/glsl/emit_glsl_memory.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_memory.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_memory.cpp index 8994c02a2..32cee7d3e 100644 --- a/src/shader_recompiler/backend/glsl/emit_glsl_memory.cpp +++ b/src/shader_recompiler/backend/glsl/emit_glsl_memory.cpp @@ -34,19 +34,23 @@ void EmitLoadStorageS16([[maybe_unused]] EmitContext& ctx, void EmitLoadStorage32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, const IR::Value& offset) { - ctx.AddU32("{}=ssbo{}[{}];", inst, binding.U32(), offset.U32()); + const auto offset_var{ctx.reg_alloc.Consume(offset)}; + ctx.AddU32("{}=ssbo{}[{}];", inst, binding.U32(), offset_var); } void EmitLoadStorage64(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, const IR::Value& offset) { - ctx.AddU32x2("{}=uvec2(ssbo{}[{}],ssbo{}[{}]);", inst, binding.U32(), offset.U32(), - binding.U32(), offset.U32() + 1); + const auto offset_var{ctx.reg_alloc.Consume(offset)}; + ctx.AddU32x2("{}=uvec2(ssbo{}[{}],ssbo{}[{}+1]);", inst, binding.U32(), offset_var, + binding.U32(), offset_var); } -void EmitLoadStorage128([[maybe_unused]] EmitContext& ctx, - [[maybe_unused]] const IR::Value& binding, - [[maybe_unused]] const IR::Value& offset) { - throw NotImplementedException("GLSL Instrucion"); +void EmitLoadStorage128(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding, + const IR::Value& offset) { + const auto offset_var{ctx.reg_alloc.Consume(offset)}; + ctx.AddU32x4("{}=uvec4(ssbo{}[{}],ssbo{}[{}+1],ssbo{}[{}+2],ssbo{}[{}+3]);", inst, + binding.U32(), offset_var, binding.U32(), offset_var, binding.U32(), offset_var, + binding.U32(), offset_var); } void EmitWriteStorageU8([[maybe_unused]] EmitContext& ctx, |