Răsfoiți Sursa

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

Almamu 9 luni în urmă
părinte
comite
c5bb6a9ee6
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  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"};
 }