Run SPIR-V validation on SkSL unit test output

Fiddled with the logic a bit so that when we're in unit test mode, the
output still includes all of the SPIR-V (as well as the validation error
message), so that tracking them down is easier.

Bug: skia:10694
Change-Id: I15e7777af3d268a5952765dbe5d63612cad0ac07
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/338320
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
diff --git a/BUILD.gn b/BUILD.gn
index e53b4f8..443859f 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -558,7 +558,10 @@
 # `Compile Processors` and `Compile SkSL Tests` both rely on skslc.
 if (skia_compile_processors || skia_compile_sksl_tests) {
   executable("skslc") {
-    defines = [ "SKSL_STANDALONE" ]
+    defines = [
+      "SKSL_STANDALONE",
+      "SK_ENABLE_SPIRV_VALIDATION",
+    ]
     sources = [
       "src/core/SkMalloc.cpp",
       "src/core/SkMath.cpp",