Ver código fonte

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

Almamu 9 meses atrás
pai
commit
c5bb6a9ee6
1 arquivos alterados com 1 adições e 1 exclusões
  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"};
 }