wired up SPIR-V validator

Change-Id: I33dfd5e7ea3ea048b88c6db2f14389b16a0af7c8
Reviewed-on: https://skia-review.googlesource.com/9688
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
diff --git a/BUILD.gn b/BUILD.gn
index 4d1e4ef..c246371 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -33,6 +33,7 @@
   skia_enable_jumper = is_skia_dev_build
   skia_enable_gpu = true
   skia_enable_pdf = true
+  skia_enable_spirv_validation = is_skia_dev_build && is_debug
   skia_enable_tools = is_skia_dev_build
   skia_enable_vulkan_debug_layers = is_skia_dev_build && is_debug
   skia_vulkan_sdk = getenv("VULKAN_SDK")
@@ -432,6 +433,12 @@
       public_defines += [ "SK_ENABLE_VK_LAYERS" ]
     }
   }
+  if (skia_enable_spirv_validation) {
+    deps = [
+      "//third_party/spirv-tools",
+    ]
+    public_defines += [ "SK_ENABLE_SPIRV_VALIDATION" ]
+  }
 }
 
 optional("jpeg") {