summaryrefslogtreecommitdiffstats
path: root/src/shader_recompiler/backend/glsl/emit_glsl_memory.cpp
diff options
context:
space:
mode:
authorameerj <52414509+ameerj@users.noreply.github.com>2021-05-25 07:35:30 +0200
committerameerj <52414509+ameerj@users.noreply.github.com>2021-07-23 03:51:36 +0200
commit11ba190462c7b69a47598b2d1572fac3bccc4adc (patch)
treee24682860686eba5710716579a583312c1db2652 /src/shader_recompiler/backend/glsl/emit_glsl_memory.cpp
parentglsl: implement phi nodes (diff)
downloadyuzu-11ba190462c7b69a47598b2d1572fac3bccc4adc.tar
yuzu-11ba190462c7b69a47598b2d1572fac3bccc4adc.tar.gz
yuzu-11ba190462c7b69a47598b2d1572fac3bccc4adc.tar.bz2
yuzu-11ba190462c7b69a47598b2d1572fac3bccc4adc.tar.lz
yuzu-11ba190462c7b69a47598b2d1572fac3bccc4adc.tar.xz
yuzu-11ba190462c7b69a47598b2d1572fac3bccc4adc.tar.zst
yuzu-11ba190462c7b69a47598b2d1572fac3bccc4adc.zip
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_glsl_memory.cpp')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_glsl_memory.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl_memory.cpp b/src/shader_recompiler/backend/glsl/emit_glsl_memory.cpp
index d1e6f074d..8994c02a2 100644
--- a/src/shader_recompiler/backend/glsl/emit_glsl_memory.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_glsl_memory.cpp
@@ -34,12 +34,13 @@ void EmitLoadStorageS16([[maybe_unused]] EmitContext& ctx,
void EmitLoadStorage32(EmitContext& ctx, IR::Inst& inst, const IR::Value& binding,
const IR::Value& offset) {
- ctx.AddU32("{}=ssbo{}_u32[{}];", inst, binding.U32(), offset.U32());
+ ctx.AddU32("{}=ssbo{}[{}];", inst, binding.U32(), offset.U32());
}
-void EmitLoadStorage64([[maybe_unused]] EmitContext& ctx, [[maybe_unused]] const IR::Value& binding,
- [[maybe_unused]] const IR::Value& offset) {
- throw NotImplementedException("GLSL Instrucion");
+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);
}
void EmitLoadStorage128([[maybe_unused]] EmitContext& ctx,
@@ -78,12 +79,13 @@ void EmitWriteStorageS16([[maybe_unused]] EmitContext& ctx,
void EmitWriteStorage32(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
std::string_view value) {
- ctx.Add("ssbo{}_u32[{}]={};", binding.U32(), offset.U32(), value);
+ ctx.Add("ssbo{}[{}]={};", binding.U32(), offset.U32(), value);
}
void EmitWriteStorage64(EmitContext& ctx, const IR::Value& binding, const IR::Value& offset,
std::string_view value) {
- ctx.Add("ssbo{}_u32x2[{}]={};", binding.U32(), offset.U32(), value);
+ ctx.Add("ssbo{}[{}]={}.x;", binding.U32(), offset.U32(), value);
+ ctx.Add("ssbo{}[{}]={}.y;", binding.U32(), offset.U32() + 1, value);
}
void EmitWriteStorage128([[maybe_unused]] EmitContext& ctx,