diff options
author | 2016-10-18 09:09:49 -0400 | |
---|---|---|
committer | 2016-10-18 14:44:31 +0000 | |
commit | d7d1997643db3b9b5caaaac235c0e2cd0fa23ec2 (patch) | |
tree | a07313bdd338aaa90198908d927ad622ae22afff /tests | |
parent | afc0b0f6a0c182435f316014df4e32460637b732 (diff) |
re-land of skslc now automatically turns on derivatives support
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3602
Change-Id: I822fc23f7d4eac76d5059412706117818f3738f0
Reviewed-on: https://skia-review.googlesource.com/3602
Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/SkSLGLSLTest.cpp | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp index b615f67814..ad1fe0d901 100644 --- a/tests/SkSLGLSLTest.cpp +++ b/tests/SkSLGLSLTest.cpp @@ -27,15 +27,7 @@ static void test(skiatest::Reporter* r, const char* src, SkSL::GLCaps caps, cons } static SkSL::GLCaps default_caps() { - return { - 400, - SkSL::GLCaps::kGL_Standard, - false, // isCoreProfile - false, // usesPrecisionModifiers; - false, // mustDeclareFragmentShaderOutput - true, // canUseMinAndAbsTogether - false // mustForceNegatedAtanParamToFloat - }; + return SkSL::GLCaps(); } DEF_TEST(SkSLHelloWorld, r) { @@ -387,3 +379,30 @@ DEF_TEST(SkSLArrayConstructors, r) { "vec2 test2[] = vec2[](vec2(1.0, 2.0), vec2(3.0, 4.0));\n" "mat4 test3[] = mat4[]();\n"); } + +DEF_TEST(SkSLDerivatives, r) { + test(r, + "void main() { float x = dFdx(1); }", + default_caps(), + "#version 400\n" + "void main() {\n" + " float x = dFdx(1.0);\n" + "}\n"); + SkSL::GLCaps caps = default_caps(); + caps.fShaderDerivativeExtensionString = "GL_OES_standard_derivatives"; + test(r, + "void main() { float x = 1; }", + caps, + "#version 400\n" + "void main() {\n" + " float x = 1.0;\n" + "}\n"); + test(r, + "void main() { float x = dFdx(1); }", + caps, + "#version 400\n" + "#extension GL_OES_standard_derivatives : require\n" + "void main() {\n" + " float x = dFdx(1.0);\n" + "}\n"); +} |