Write relative paths with forward slashes to the code generation hashes.

This should avoid generating diffs when running the code generation with
different source directories or on different platforms.

BUG=angleproject:2695

Change-Id: I67776883bdbeb867a49bea00f16998c04f7857b4
Reviewed-on: https://chromium-review.googlesource.com/1127355
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/scripts/run_code_generation.py b/scripts/run_code_generation.py
index bf0f6a5..40f5a86 100755
--- a/scripts/run_code_generation.py
+++ b/scripts/run_code_generation.py
@@ -22,9 +22,18 @@
     # All script names are relative to ANGLE's root
     return os.path.dirname(os.path.abspath(os.path.join(root_dir, script)))
 
+# Replace all backslashes with forward slashes to be platform independent
+def clean_path_slashes(path):
+    return path.replace("\\", "/")
+
+# Takes a script input file name which is relative to the code generation script's directory and
+# changes it to be relative to the angle root directory
+def rebase_script_input_path(script_path, input_file_path):
+    return os.path.relpath(os.path.join(os.path.dirname(script_path), input_file_path), root_dir);
+
 def grab_from_script(script, param):
     res = subprocess.check_output(['python', script, param]).strip()
-    return [os.path.abspath(os.path.join(os.path.dirname(script), name)) for name in res.split(',')]
+    return [clean_path_slashes(rebase_script_input_path(script, name)) for name in res.split(',')]
 
 def auto_script(script):
     # Set the CWD to the script directory.
diff --git a/scripts/run_code_generation_hashes.json b/scripts/run_code_generation_hashes.json
index 1fadd96..d67c8f6 100644
--- a/scripts/run_code_generation_hashes.json
+++ b/scripts/run_code_generation_hashes.json
@@ -69,12 +69,12 @@
     "be1ca0bd596cf826d8f38d110fba35b0",
   "Vulkan format:src/libANGLE/renderer/vulkan/vk_format_map.json":
     "8b02327195f831c782b0a30b36b589d6",
-  "Vulkan internal shader programs:C:\\src\\angle\\src\\libANGLE\\renderer\\vulkan\\shaders\\src\\FullScreenQuad.vert":
-    "ab897aa9eb45f83f66080ee082e7d51e",
-  "Vulkan internal shader programs:C:\\src\\angle\\src\\libANGLE\\renderer\\vulkan\\shaders\\src\\PushConstantColor.frag":
-    "3b931f51bfee8310f3d6497d5c9ed8a1",
   "Vulkan internal shader programs:src/libANGLE/renderer/vulkan/gen_vk_internal_shaders.py":
     "d651e28ab62477029093152e37ed49c9",
+  "Vulkan internal shader programs:src/libANGLE/renderer/vulkan/shaders/src/FullScreenQuad.vert":
+    "ab897aa9eb45f83f66080ee082e7d51e",
+  "Vulkan internal shader programs:src/libANGLE/renderer/vulkan/shaders/src/PushConstantColor.frag":
+    "3b931f51bfee8310f3d6497d5c9ed8a1",
   "Vulkan mandatory format support table:src/libANGLE/renderer/angle_format.py":
     "ddf4dae07bfad22bbf13f4b14e43d8f4",
   "Vulkan mandatory format support table:src/libANGLE/renderer/vulkan/gen_vk_mandatory_format_support_table.py":