Преглед изворни кода

fix: ensure #endif is added after the last line, as some shaders could end in a comment and fail compilation

Almamu пре 9 месеци
родитељ
комит
c5bb6a9ee6
1 измењених фајлова са 1 додато и 1 уклоњено
  1. 1 1
      src/WallpaperEngine/Render/Shaders/GLSLContext.cpp

+ 1 - 1
src/WallpaperEngine/Render/Shaders/GLSLContext.cpp

@@ -191,7 +191,7 @@ std::pair<std::string, std::string> GLSLContext::toGlsl (const std::string& vert
     options.es = false;
     fragmentCompiler .set_common_options(options);
 
-    return {vertexCompiler.compile() + "#if 0\n" + vertex + "#endif", fragmentCompiler.compile() + "#if 0\n" + fragment + "#endif"};
+    return {vertexCompiler.compile() + "#if 0\n" + vertex + "\n#endif", fragmentCompiler.compile() + "#if 0\n" + fragment + "\n#endif"};
 }