VERY experimental Nintendo Switch 2 emulator
C++
glsl: Declare local memory in main
ameerjc446ada33ea9
diff --git a/src/shader_recompiler/backend/glsl/emit_glsl.cpp b/src/shader_recompiler/backend/glsl/emit_glsl.cppindex 8deaf5760f..46d72963d9 100644--- a/src/shader_recompiler/backend/glsl/emit_glsl.cpp+++ b/src/shader_recompiler/backend/glsl/emit_glsl.cpp@@ -217,14 +217,14 @@ std::string EmitGLSL(const Profile& profile, const RuntimeInfo& runtime_info, IREmitCode(ctx, program);const std::string version{fmt::format("#version 450{}\n", GlslVersionSpecifier(ctx))};ctx.header.insert(0, version);- if (program.local_memory_size > 0) {- ctx.header += fmt::format("uint lmem[{}];", Common::AlignUp(program.local_memory_size, 4));- }if (program.shared_memory_size > 0) {ctx.header +=fmt::format("shared uint smem[{}];", Common::AlignUp(program.shared_memory_size, 4));}ctx.header += "void main(){\n";+ if (program.local_memory_size > 0) {+ ctx.header += fmt::format("uint lmem[{}];", Common::AlignUp(program.local_memory_size, 4));+ }DefineVariables(ctx, ctx.header);if (ctx.uses_cc_carry) {ctx.header += "uint carry;";