Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(616)

Unified Diff: tests/SkSLGLSLTest.cpp

Issue 2437063002: re-re-land of skslc now automatically turns on derivatives support (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/sksl/ir/SkSLSymbolTable.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/SkSLGLSLTest.cpp
diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp
index b615f678140ecca0de5a7b38a1273a4cb1a5ba99..ad1fe0d9014671fc54ebafd1e93f229611d8caae 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");
+}
« no previous file with comments | « src/sksl/ir/SkSLSymbolTable.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698