diff options
author | Leon Scroggins <scroggo@google.com> | 2016-11-11 18:44:37 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-11 18:44:49 +0000 |
commit | 857cb97a34ea1870b20ecbae6aa937a57243359c (patch) | |
tree | d4463c7074eeafa6600c85da06b4c576f4e9c792 /src/sksl/SkSLGLSLCodeGenerator.h | |
parent | 294870ff119b89fc902773643b054f14e5d1f554 (diff) |
Revert "re-land of skslc now uses standard Skia caps"
This reverts commit 498d403f7703cb2157bf3c877b84906db5a06cd4.
Reason for revert: Breaking compile bot:
https://uberchromegw.corp.google.com/i/client.skia.compile/builders/Build-Ubuntu-GCC-x86_64-Release-NoGPU/builds/10116/steps/compile_skia%20on%20Ubuntu/logs/stdio
undefined reference to `GrGLSLCaps::GrGLSLCaps(GrContextOptions const&)
Original change's description:
> re-land of skslc now uses standard Skia caps
>
> BUG=skia:
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4726
>
> Change-Id: Ib1ea5d4269396e6c57ee1f0d7209aa9a9f2798e8
> Reviewed-on: https://skia-review.googlesource.com/4726
> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
>
TBR=bsalomon@google.com,benjaminwagner@google.com,kjlubick@google.com,ethannicholas@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: I7ee96d6c658be6b7b79027c147b8950c78c79a70
Reviewed-on: https://skia-review.googlesource.com/4729
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Diffstat (limited to 'src/sksl/SkSLGLSLCodeGenerator.h')
-rw-r--r-- | src/sksl/SkSLGLSLCodeGenerator.h | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/src/sksl/SkSLGLSLCodeGenerator.h b/src/sksl/SkSLGLSLCodeGenerator.h index 5ed6104a09..97e6038146 100644 --- a/src/sksl/SkSLGLSLCodeGenerator.h +++ b/src/sksl/SkSLGLSLCodeGenerator.h @@ -12,7 +12,6 @@ #include <tuple> #include <unordered_map> -#include "glsl/GrGLSLCaps.h" #include "SkSLCodeGenerator.h" #include "ir/SkSLBinaryExpression.h" #include "ir/SkSLBoolLiteral.h" @@ -45,6 +44,28 @@ namespace SkSL { #define kLast_Capability SpvCapabilityMultiViewport +struct GLCaps { + GLCaps() {} + + int fVersion = 400; + enum { + kGL_Standard, + kGLES_Standard + } fStandard = kGL_Standard; + bool fIsCoreProfile = false; + bool fUsesPrecisionModifiers = false; + bool fMustDeclareFragmentShaderOutput = false; + bool fShaderDerivativeSupport = true; + // extension string to enable derivative support, or null if unnecessary + std::string fShaderDerivativeExtensionString; + // The Tegra3 compiler will sometimes never return if we have min(abs(x), y) + bool fCanUseMinAndAbsTogether = true; + // On Intel GPU there is an issue where it misinterprets an atan argument (second argument only, + // apparently) of the form "-<expr>" as an int, so we rewrite it as "-1.0 * <expr>" to avoid + // this problem + bool fMustForceNegatedAtanParamToFloat = false; +}; + /** * Converts a Program into GLSL code. */ @@ -71,9 +92,9 @@ public: kTopLevel_Precedence = 18 }; - GLSLCodeGenerator(const Context* context, const GrGLSLCaps* caps) + GLSLCodeGenerator(const Context* context, GLCaps caps) : fContext(*context) - , fCaps(*caps) {} + , fCaps(caps) {} void generateCode(const Program& program, std::ostream& out) override; @@ -155,7 +176,7 @@ private: void writeReturnStatement(const ReturnStatement& r); const Context& fContext; - const GrGLSLCaps& fCaps; + const GLCaps fCaps; std::ostream* fOut = nullptr; std::stringstream fHeader; std::string fFunctionHeader; |