run_code_generation.py should fail more gracefully on find out dir.

The script checks a series of conditions, but only fails gracefully if
the first condition fails. If other conditions fails, it will not retry
or output an error message.

Bug: angleproject:3227

Change-Id: Ibb47c2bb1eac90f61f01d87a5051af182816bcad
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1533063
Commit-Queue: Jonah Ryan-Davis <jonahr@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
diff --git a/scripts/run_code_generation_hashes.json b/scripts/run_code_generation_hashes.json
index 5141ab4..b2af9bd 100644
--- a/scripts/run_code_generation_hashes.json
+++ b/scripts/run_code_generation_hashes.json
@@ -192,7 +192,7 @@
   "Vulkan format:src/libANGLE/renderer/vulkan/vk_format_table_autogen.cpp":
     "ef0ea80cf33e60f76391bcfed10b3c0a",
   "Vulkan internal shader programs:src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py":
-    "e5fa1f79a91ff812f24b5755eba8e145",
+    "2919fe20f762acb6811e3576e320daa0",
   "Vulkan internal shader programs:src/libANGLE/renderer/vulkan/shaders/gen/BufferUtils.comp.00000000.inc":
     "155f523ecd36bae6b6abec5a41379e68",
   "Vulkan internal shader programs:src/libANGLE/renderer/vulkan/shaders/gen/BufferUtils.comp.00000001.inc":
diff --git a/src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py b/src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py
index 130a43f..762c73b 100644
--- a/src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py
+++ b/src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py
@@ -185,12 +185,11 @@
                     argsgn = os.path.join(subdir, "args.gn")
                     if os.path.isfile(argsgn):
                         return subdir
+    parent = os.path.join(path, "..")
+    if (os.path.isdir(parent)):
+        return find_build_path(parent)
     else:
-        parent = os.path.join(path, "..")
-        if (os.path.isdir(parent)):
-            return find_build_path(parent)
-        else:
-            raise Exception("Could not find GN out directory")
+        raise Exception("Could not find GN out directory")
 
 # Generates the code for a shader blob array entry.
 def gen_shader_blob_entry(shader):