diff options
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() { | |||
| 48 | } | 48 | } |
| 49 | u32 binding{}; | 49 | u32 binding{}; |
| 50 | for (const auto& desc : info.storage_buffers_descriptors) { | 50 | for (const auto& desc : info.storage_buffers_descriptors) { |
| 51 | Add("layout(std430,binding={}) buffer ssbo_{}_u32{{uint ssbo{}_u32[];}};", binding, binding, | 51 | if (True(info.used_storage_buffer_types & IR::Type::U32) || |
| 52 | desc.cbuf_index, desc.count); | 52 | True(info.used_storage_buffer_types & IR::Type::F32)) { |
| 53 | // TODO: Track ssbo data type usage | 53 | Add("layout(std430,binding={}) buffer ssbo_{}_u32{{uint ssbo{}_u32[];}};", binding, |
| 54 | Add("layout(std430,binding={}) buffer ssbo_{}_u64{{uvec2 ssbo{}_u64[];}};", binding, | 54 | binding, desc.cbuf_index, desc.count); |
| 55 | binding, desc.cbuf_index, desc.count); | 55 | } |
| 56 | if (True(info.used_storage_buffer_types & IR::Type::U32x2) || | ||
| 57 | True(info.used_storage_buffer_types & IR::Type::F32x2)) { | ||
| 58 | Add("layout(std430,binding={}) buffer ssbo_{}_u64{{uvec2 ssbo{}_u64[];}};", binding, | ||
| 59 | binding, desc.cbuf_index, desc.count); | ||
| 60 | } | ||
| 56 | ++binding; | 61 | ++binding; |
| 57 | } | 62 | } |
| 58 | } | 63 | } |