diff --git a/examples/array_multiplication/src/Main.cpp b/examples/array_multiplication/src/Main.cpp index 1b02f316b..be1be9d5d 100755 --- a/examples/array_multiplication/src/Main.cpp +++ b/examples/array_multiplication/src/Main.cpp @@ -5,11 +5,15 @@ #include "kompute/Kompute.hpp" -static std::vector +static +std::vector compileSource( const std::string& source) { - if (system(std::string("glslangValidator --stdin -S comp -V -o tmp_kp_shader.comp.spv << END\n" + source + "\nEND").c_str())) + std::ofstream fileOut("tmp_kp_shader.comp"); + fileOut << source; + fileOut.close(); + if (system(std::string("glslangValidator -V tmp_kp_shader.comp -o tmp_kp_shader.comp.spv").c_str())) throw std::runtime_error("Error running glslangValidator command"); std::ifstream fileStream("tmp_kp_shader.comp.spv", std::ios::binary); std::vector buffer;