Move GrShaderCaps from Program::Settings to Compiler

This ties the caps to the compiler instance, paving the way for
pre-optimizing the shared code. Most of the time, the compiler is
created and owned the GPU instance, so this is fine. For runtime
effects, we now use the shared (device-agnostic) compiler instance
for the first compile, even on GPU. It's configured with caps that
apply no workarounds. We pass the user's SkSL to the backend as
cleanly as possible, and then apply any workarounds once it's part
of the full program.

Bug: skia:10905
Bug: skia:10868
Change-Id: Ifcf8d7ebda5d43ad8e180f06700a261811da83de
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/331493
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Reviewed-by: John Stiles <johnstiles@google.com>
diff --git a/src/sksl/SkSLInliner.cpp b/src/sksl/SkSLInliner.cpp
index 6f80c20..c64bae1 100644
--- a/src/sksl/SkSLInliner.cpp
+++ b/src/sksl/SkSLInliner.cpp
@@ -304,10 +304,11 @@
 }
 
 void Inliner::reset(const Context* context, ModifiersPool* modifiers,
-                    const Program::Settings* settings) {
+                    const Program::Settings* settings, const ShaderCapsClass* caps) {
     fContext = context;
     fModifiers = modifiers;
     fSettings = settings;
+    fCaps = caps;
     fInlineVarCounter = 0;
 }
 
@@ -764,7 +765,7 @@
         return false;
     }
 
-    if (!fSettings->fCaps || !fSettings->fCaps->canUseDoLoops()) {
+    if (!fCaps || !fCaps->canUseDoLoops()) {
         // We don't have do-while loops. We use do-while loops to simulate early returns, so we
         // can't inline functions that have an early return.
         bool hasEarlyReturn = has_early_return(*functionDef);