From 1ae54bc22fc2161d9f7e3475a952c829c9b73a08 Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Tue, 29 Oct 2019 16:28:01 -0600 Subject: [PATCH] Add sampleVariablesStencilSupport to sksl standalone caps TBR=ethannicholas@google.com Change-Id: I53c2896470fd202f01f51c5aaddf3087b2cbb5ce Reviewed-on: https://skia-review.googlesource.com/c/skia/+/251556 Reviewed-by: Chris Dalton Commit-Queue: Chris Dalton --- src/sksl/README | 2 +- src/sksl/SkSLIRGenerator.cpp | 1 - src/sksl/SkSLUtil.h | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/sksl/README b/src/sksl/README index c1d7ae6b33..906fd81498 100644 --- a/src/sksl/README +++ b/src/sksl/README @@ -24,7 +24,7 @@ Differences from GLSL the same as if and switch in all respects other than it being a compile-time error to use a non-constant expression as a test. * GLSL caps can be referenced via the syntax 'sk_Caps.', e.g. - sk_Caps.sampleVariablesSupport. The value will be a constant boolean or int, + sk_Caps.canUseAnyFunctionInShader. The value will be a constant boolean or int, as appropriate. As SkSL supports constant folding and branch elimination, this means that an 'if' statement which statically queries a cap will collapse down to the chosen branch, meaning that: diff --git a/src/sksl/SkSLIRGenerator.cpp b/src/sksl/SkSLIRGenerator.cpp index 315010c374..b7c4f17538 100644 --- a/src/sksl/SkSLIRGenerator.cpp +++ b/src/sksl/SkSLIRGenerator.cpp @@ -127,7 +127,6 @@ static void fill_caps(const SKSL_CAPS_CLASS& caps, CAP(fbFetchNeedsCustomOutput); CAP(flatInterpolationSupport); CAP(noperspectiveInterpolationSupport); - CAP(sampleVariablesSupport); CAP(externalTextureSupport); CAP(mustEnableAdvBlendEqs); CAP(mustEnableSpecificAdvBlendEqs); diff --git a/src/sksl/SkSLUtil.h b/src/sksl/SkSLUtil.h index da8c101fff..8fbebb3791 100644 --- a/src/sksl/SkSLUtil.h +++ b/src/sksl/SkSLUtil.h @@ -100,6 +100,10 @@ public: return true; } + bool sampleVariablesStencilSupport() const { + return true; + } + bool externalTextureSupport() const { return true; }