diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2021-05-26 23:32:59 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:33 +0200 |
commit | adb591a757ccb289634920d51cf519b515ca32b6 (patch) | |
tree | 987c5cd0a346e69633791ad5ec355b6104ab036e /src/shader_recompiler/backend/glasm/emit_context.cpp | |
parent | glasm: Implement Y direction (diff) | |
download | yuzu-adb591a757ccb289634920d51cf519b515ca32b6.tar yuzu-adb591a757ccb289634920d51cf519b515ca32b6.tar.gz yuzu-adb591a757ccb289634920d51cf519b515ca32b6.tar.bz2 yuzu-adb591a757ccb289634920d51cf519b515ca32b6.tar.lz yuzu-adb591a757ccb289634920d51cf519b515ca32b6.tar.xz yuzu-adb591a757ccb289634920d51cf519b515ca32b6.tar.zst yuzu-adb591a757ccb289634920d51cf519b515ca32b6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/shader_recompiler/backend/glasm/emit_context.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/shader_recompiler/backend/glasm/emit_context.cpp b/src/shader_recompiler/backend/glasm/emit_context.cpp index b5b0e2204..e18526816 100644 --- a/src/shader_recompiler/backend/glasm/emit_context.cpp +++ b/src/shader_recompiler/backend/glasm/emit_context.cpp @@ -7,6 +7,7 @@ #include "shader_recompiler/backend/bindings.h" #include "shader_recompiler/backend/glasm/emit_context.h" #include "shader_recompiler/frontend/ir/program.h" +#include "shader_recompiler/profile.h" namespace Shader::Backend::GLASM { namespace { @@ -40,13 +41,21 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile Add("CBUFFER c{}[]={{program.buffer[{}]}};", desc.index, cbuf_index); ++cbuf_index; } + u32 ssbo_index{}; for (const auto& desc : info.storage_buffers_descriptors) { if (desc.count != 1) { throw NotImplementedException("Storage buffer descriptor array"); } + if (runtime_info.glasm_use_storage_buffers) { + Add("STORAGE ssbo{}[]={{program.storage[{}]}};", ssbo_index, bindings.storage_buffer); + ++bindings.storage_buffer; + ++ssbo_index; + } } - if (const size_t num = info.storage_buffers_descriptors.size(); num > 0) { - Add("PARAM c[{}]={{program.local[0..{}]}};", num, num - 1); + if (!runtime_info.glasm_use_storage_buffers) { + if (const size_t num = info.storage_buffers_descriptors.size(); num > 0) { + Add("PARAM c[{}]={{program.local[0..{}]}};", num, num - 1); + } } stage = program.stage; switch (program.stage) { |