summaryrefslogtreecommitdiff
path: root/src/shader_recompiler/backend/glsl/emit_context.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_context.cpp')
-rw-r--r--src/shader_recompiler/backend/glsl/emit_context.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp
index da29290a2..788679f40 100644
--- a/src/shader_recompiler/backend/glsl/emit_context.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_context.cpp
@@ -121,7 +121,6 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
121} 121}
122 122
123void EmitContext::SetupExtensions(std::string&) { 123void EmitContext::SetupExtensions(std::string&) {
124 header += "#extension GL_ARB_separate_shader_objects : enable\n";
125 // TODO: track this usage 124 // TODO: track this usage
126 header += "#extension GL_ARB_sparse_texture2 : enable\n"; 125 header += "#extension GL_ARB_sparse_texture2 : enable\n";
127 header += "#extension GL_EXT_texture_shadow_lod : enable\n"; 126 header += "#extension GL_EXT_texture_shadow_lod : enable\n";
@@ -171,11 +170,13 @@ void EmitContext::DefineStorageBuffers(Bindings& bindings) {
171 if (info.storage_buffers_descriptors.empty()) { 170 if (info.storage_buffers_descriptors.empty()) {
172 return; 171 return;
173 } 172 }
173 u32 index{};
174 for (const auto& desc : info.storage_buffers_descriptors) { 174 for (const auto& desc : info.storage_buffers_descriptors) {
175 header += 175 header += fmt::format("layout(std430,binding={}) buffer {}_ssbo_{}{{uint {}_ssbo{}[];}};",
176 fmt::format("layout(std430,binding={}) buffer ssbo_{}{{uint ssbo{}[];}};", 176 bindings.storage_buffer, stage_name, bindings.storage_buffer,
177 bindings.storage_buffer, bindings.storage_buffer, bindings.storage_buffer); 177 stage_name, index);
178 bindings.storage_buffer += desc.count; 178 bindings.storage_buffer += desc.count;
179 index += desc.count;
179 } 180 }
180} 181}
181 182