Add support for SkASSERTF and SkDEBUGFAIL(F) in SKSL_STANDALONE.

This is a simple safeguard to prevent against code that compiles
properly in full Skia builds, but fails in a SkSL standalone build.

A few SkASSERT(false) calls have been replaced with
SkDEBUGFAIL("message") in order to exercise the new call.

This CL should unblock
https://skia-review.googlesource.com/c/skia/+/292689

Change-Id: I83b0b9d28bd74c5cb1869510b0fb34792c6b2385
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/292693
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
diff --git a/src/sksl/SkSLDefines.h b/src/sksl/SkSLDefines.h
index d0ba9d7..1138c50 100644
--- a/src/sksl/SkSLDefines.h
+++ b/src/sksl/SkSLDefines.h
@@ -22,6 +22,9 @@
 
 #ifdef SKSL_STANDALONE
 #define SkASSERT(x) do { if (!(x)) abort(); } while (false)
+#define SkASSERTF(x, __VA_ARGS__) do { if (!(x)) { printf(__VA_ARGS__); abort(); } } while (false)
+#define SkDEBUGFAIL(x) do { printf("%s", x); abort(); } while (false)
+#define SkDEBUGFAILF(fmt, ...) do { printf(__VA_ARGS__); abort(); } while (false)
 #define SkAssertResult(x) do { if (!(x)) abort(); } while (false)
 #define SkDEBUGCODE(...) __VA_ARGS__
 #define SK_API
diff --git a/src/sksl/SkSLMetalCodeGenerator.cpp b/src/sksl/SkSLMetalCodeGenerator.cpp
index 2b222d8..a8a407b 100644
--- a/src/sksl/SkSLMetalCodeGenerator.cpp
+++ b/src/sksl/SkSLMetalCodeGenerator.cpp
@@ -791,7 +791,7 @@
                 this->write("vertex Outputs vertexMain");
                 break;
             default:
-                SkASSERT(false);
+                SkDEBUGFAIL("unsupported kind of program");
         }
         this->write("(Inputs _in [[stage_in]]");
         if (-1 != fUniformBuffer) {
@@ -951,7 +951,7 @@
                 this->writeLine("return *_out;"); // FIXME - detect if function already has return
                 break;
             default:
-                SkASSERT(false);
+                SkDEBUGFAIL("unsupported kind of program");
         }
     }
     fIndentation--;