diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-05-23 05:03:27 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:36 +0200 |
commit | ac7b0ebcb77f6c99d054e9d10412e669eefa0de6 (patch) | |
tree | 322952f22d0c1cac6c4ae6423e73aeb124403498 /src/shader_recompiler/backend/glsl/emit_context.cpp | |
parent | glsl: FP function fixes (diff) | |
download | yuzu-ac7b0ebcb77f6c99d054e9d10412e669eefa0de6.tar yuzu-ac7b0ebcb77f6c99d054e9d10412e669eefa0de6.tar.gz yuzu-ac7b0ebcb77f6c99d054e9d10412e669eefa0de6.tar.bz2 yuzu-ac7b0ebcb77f6c99d054e9d10412e669eefa0de6.tar.lz yuzu-ac7b0ebcb77f6c99d054e9d10412e669eefa0de6.tar.xz yuzu-ac7b0ebcb77f6c99d054e9d10412e669eefa0de6.tar.zst yuzu-ac7b0ebcb77f6c99d054e9d10412e669eefa0de6.zip |
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_context.cpp')
-rw-r--r-- | src/shader_recompiler/backend/glsl/emit_context.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp index da379360a..67772c46d 100644 --- a/src/shader_recompiler/backend/glsl/emit_context.cpp +++ b/src/shader_recompiler/backend/glsl/emit_context.cpp @@ -48,11 +48,16 @@ void EmitContext::DefineStorageBuffers() { } u32 binding{}; for (const auto& desc : info.storage_buffers_descriptors) { - Add("layout(std430,binding={}) buffer ssbo_{}_u32{{uint ssbo{}_u32[];}};", binding, binding, - desc.cbuf_index, desc.count); - // TODO: Track ssbo data type usage - Add("layout(std430,binding={}) buffer ssbo_{}_u64{{uvec2 ssbo{}_u64[];}};", binding, - binding, desc.cbuf_index, desc.count); + if (True(info.used_storage_buffer_types & IR::Type::U32) || + True(info.used_storage_buffer_types & IR::Type::F32)) { + Add("layout(std430,binding={}) buffer ssbo_{}_u32{{uint ssbo{}_u32[];}};", binding, + binding, desc.cbuf_index, desc.count); + } + if (True(info.used_storage_buffer_types & IR::Type::U32x2) || + True(info.used_storage_buffer_types & IR::Type::F32x2)) { + Add("layout(std430,binding={}) buffer ssbo_{}_u64{{uvec2 ssbo{}_u64[];}};", binding, + binding, desc.cbuf_index, desc.count); + } ++binding; } } |