]> git.djapps.eu Git - pkg/ggml/sources/ggml/commitdiff
vulkan: check glslc executable string (llama/17144)
authorRuben Ortlam <redacted>
Mon, 10 Nov 2025 15:59:26 +0000 (16:59 +0100)
committerGeorgi Gerganov <redacted>
Mon, 17 Nov 2025 13:34:43 +0000 (15:34 +0200)
src/ggml-vulkan/vulkan-shaders/vulkan-shaders-gen.cpp

index c2e42cf006e96daf8e823acbbb394b71b105785c..c8a6f97ecff223568233d8d07aabd91abb7bc61c 100644 (file)
@@ -18,6 +18,7 @@
 #include <algorithm>
 #include <sys/stat.h>
 #include <sys/types.h>
+#include <filesystem>
 
 #ifdef _WIN32
     #define NOMINMAX
@@ -1080,6 +1081,11 @@ int main(int argc, char** argv) {
 
     if (args.find("--glslc") != args.end()) {
         GLSLC = args["--glslc"]; // Path to glslc
+
+        if (!std::filesystem::exists(GLSLC) || !std::filesystem::is_regular_file(GLSLC)) {
+            std::cerr << "Error: glslc not found at " << GLSLC << std::endl;
+            return EXIT_FAILURE;
+        }
     }
     if (args.find("--source") != args.end()) {
         input_filepath = args["--source"]; // The shader source file to compile