diff options
author | Leon Scroggins <scroggo@google.com> | 2016-11-11 15:50:45 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-11 15:51:01 +0000 |
commit | b0b5360ae4078560b2f5f8508471129e4dd1cee6 (patch) | |
tree | 20b240c09f4d833fbd6f80f7dbce8447b5221f42 /src/sksl/SkSLGLSLCodeGenerator.h | |
parent | 8af38a96475ac5ce83b20c16d9cf82bf1006b8c4 (diff) |
Revert "skslc now uses standard Skia caps"
This reverts commit 8af38a96475ac5ce83b20c16d9cf82bf1006b8c4.
Reason for revert: Breaking compile bots, e.g. from https://uberchromegw.corp.google.com/i/client.skia.compile/builders/Build-Ubuntu-GCC-x86_64-Debug-NoGPU/builds/10029/steps/compile_skia%20on%20Ubuntu/logs/stdio :
In function `sk_make_sp<GrGLSLCaps, GrContextOptions>'
undefined reference to `GrGLSLCaps::GrGLSLCaps(GrContextOptions const&)
In function `_Z10sk_make_spI10GrGLSLCapsI16GrContextOptionsEE5sk_spIT_EDpOT0_':
undefined reference to `GrGLSLCaps::GrGLSLCaps(GrContextOptions const&)
Original change's description:
> skslc now uses standard Skia caps
>
> BUG=skia:
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4660
>
> Change-Id: Idaedae3f81426b97f5052bb872cdf0610e47a84f
> Reviewed-on: https://skia-review.googlesource.com/4660
> Reviewed-by: Ben Wagner <benjaminwagner@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
>
TBR=bsalomon@google.com,benjaminwagner@google.com,ethannicholas@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: Ic7f987f5c050ac2e333f5a0f16c8de85c1047a74
Reviewed-on: https://skia-review.googlesource.com/4697
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; |