Complain and exit if the given shader file doesn't exist.
[mesa.git] / main.cpp
index a613334d5cd20349de49f1363361d27caa908997..b8b99bf0bb060761b04aae6b294ca49e8ae89f1e 100644 (file)
--- a/main.cpp
+++ b/main.cpp
@@ -218,10 +218,15 @@ main(int argc, char **argv)
         usage_fail(argv[0]);
 
       shader->Source = load_text_file(argv[optind], &shader->SourceLen);
+      if (shader->Source == NULL) {
+        printf("File \"%s\" does not exist.\n", argv[optind]);
+        exit(EXIT_FAILURE);
+      }
 
       compile_shader(shader);
 
       if (!shader->CompileStatus) {
+        printf("Info log for %s:\n%s\n", argv[optind], shader->InfoLog);
         status = EXIT_FAILURE;
         break;
       }