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.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/shader_recompiler/backend/glsl/emit_context.cpp b/src/shader_recompiler/backend/glsl/emit_context.cpp
index d0880bdcb..e18f8257e 100644
--- a/src/shader_recompiler/backend/glsl/emit_context.cpp
+++ b/src/shader_recompiler/backend/glsl/emit_context.cpp
@@ -302,9 +302,11 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
302 break; 302 break;
303 case Stage::Compute: 303 case Stage::Compute:
304 stage_name = "cs"; 304 stage_name = "cs";
305 const u32 local_x{std::max(program.workgroup_size[0], 1u)};
306 const u32 local_y{std::max(program.workgroup_size[1], 1u)};
307 const u32 local_z{std::max(program.workgroup_size[2], 1u)};
305 header += fmt::format("layout(local_size_x={},local_size_y={},local_size_z={}) in;", 308 header += fmt::format("layout(local_size_x={},local_size_y={},local_size_z={}) in;",
306 program.workgroup_size[0], program.workgroup_size[1], 309 local_x, local_y, local_z);
307 program.workgroup_size[2]);
308 break; 310 break;
309 } 311 }
310 SetupOutPerVertex(*this, header); 312 SetupOutPerVertex(*this, header);
@@ -346,7 +348,7 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile
346} 348}
347 349
348void EmitContext::SetupExtensions() { 350void EmitContext::SetupExtensions() {
349 if (profile.support_gl_texture_shadow_lod) { 351 if (info.uses_shadow_lod && profile.support_gl_texture_shadow_lod) {
350 header += "#extension GL_EXT_texture_shadow_lod : enable\n"; 352 header += "#extension GL_EXT_texture_shadow_lod : enable\n";
351 } 353 }
352 if (info.uses_int64) { 354 if (info.uses_int64) {