From 857cb97a34ea1870b20ecbae6aa937a57243359c Mon Sep 17 00:00:00 2001 From: Leon Scroggins Date: Fri, 11 Nov 2016 18:44:37 +0000 Subject: 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 > Commit-Queue: Ethan Nicholas > 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 Reviewed-by: Leon Scroggins --- src/sksl/SkSLGLSLCodeGenerator.h | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) (limited to 'src/sksl/SkSLGLSLCodeGenerator.h') 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 #include -#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 "-" as an int, so we rewrite it as "-1.0 * " 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; -- cgit v1.2.3