diff options
author | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-06-14 01:12:03 +0200 |
---|---|---|
committer | ameerj <52414509+ameerj@users.noreply.github.com> | 2021-07-23 03:51:38 +0200 |
commit | a0d0704affa0f86ba29ef59d90fa06c1b7c974da (patch) | |
tree | 6bf42ec914e7911c5244f84191124d888f458fab /src/shader_recompiler/backend/glsl/emit_context.cpp | |
parent | glsl: Add stubs for sparse queries and variable aoffi when not supported (diff) | |
download | yuzu-a0d0704affa0f86ba29ef59d90fa06c1b7c974da.tar yuzu-a0d0704affa0f86ba29ef59d90fa06c1b7c974da.tar.gz yuzu-a0d0704affa0f86ba29ef59d90fa06c1b7c974da.tar.bz2 yuzu-a0d0704affa0f86ba29ef59d90fa06c1b7c974da.tar.lz yuzu-a0d0704affa0f86ba29ef59d90fa06c1b7c974da.tar.xz yuzu-a0d0704affa0f86ba29ef59d90fa06c1b7c974da.tar.zst yuzu-a0d0704affa0f86ba29ef59d90fa06c1b7c974da.zip |
Diffstat (limited to 'src/shader_recompiler/backend/glsl/emit_context.cpp')
-rw-r--r-- | src/shader_recompiler/backend/glsl/emit_context.cpp | 8 |
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 break; case Stage::Compute: stage_name = "cs"; + const u32 local_x{std::max(program.workgroup_size[0], 1u)}; + const u32 local_y{std::max(program.workgroup_size[1], 1u)}; + const u32 local_z{std::max(program.workgroup_size[2], 1u)}; header += fmt::format("layout(local_size_x={},local_size_y={},local_size_z={}) in;", - program.workgroup_size[0], program.workgroup_size[1], - program.workgroup_size[2]); + local_x, local_y, local_z); break; } SetupOutPerVertex(*this, header); @@ -346,7 +348,7 @@ EmitContext::EmitContext(IR::Program& program, Bindings& bindings, const Profile } void EmitContext::SetupExtensions() { - if (profile.support_gl_texture_shadow_lod) { + if (info.uses_shadow_lod && profile.support_gl_texture_shadow_lod) { header += "#extension GL_EXT_texture_shadow_lod : enable\n"; } if (info.uses_int64) { |