aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SkSLGLSLTest.cpp
diff options
context:
space:
mode:
authorGravatar Ethan Nicholas <ethannicholas@google.com>2017-02-16 16:37:32 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-17 22:00:23 +0000
commit52cad15d0b4443b763a7d41ec8d1131a7638f866 (patch)
tree67c5e00fd79130b1c49b93556152cf29480b3a58 /tests/SkSLGLSLTest.cpp
parentc12551c1f3f34f50cd58b4e3fb0697c7fe40e8f0 (diff)
sksl support for geometry shaders
BUG=skia: Change-Id: I8541b98aadcf4c2484fef73e2f49be3ee38bc1e2 Reviewed-on: https://skia-review.googlesource.com/8409 Reviewed-by: Ben Wagner <benjaminwagner@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'tests/SkSLGLSLTest.cpp')
-rw-r--r--tests/SkSLGLSLTest.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp
index a57fd9d4fb..a0fdb98dcf 100644
--- a/tests/SkSLGLSLTest.cpp
+++ b/tests/SkSLGLSLTest.cpp
@@ -750,4 +750,31 @@ DEF_TEST(SkSLArrayTypes, r) {
"}\n");
}
+DEF_TEST(SkSLGeometry, r) {
+ test(r,
+ "layout(points) in;"
+ "layout(invocations = 2) in;"
+ "layout(line_strip, max_vertices = 2) out;"
+ "void main() {"
+ "gl_Position = sk_in[0].gl_Position + vec4(-0.5, 0, 0, sk_InvocationID);"
+ "EmitVertex();"
+ "gl_Position = sk_in[0].gl_Position + vec4(0.5, 0, 0, sk_InvocationID);"
+ "EmitVertex();"
+ "EndPrimitive();"
+ "}",
+ *SkSL::ShaderCapsFactory::Default(),
+ "#version 400\n"
+ "layout (points) in ;\n"
+ "layout (invocations = 2) in ;\n"
+ "layout (line_strip, max_vertices = 2) out ;\n"
+ "void main() {\n"
+ " gl_Position = gl_in[0].gl_Position + vec4(-0.5, 0.0, 0.0, float(gl_InvocationID));\n"
+ " EmitVertex();\n"
+ " gl_Position = gl_in[0].gl_Position + vec4(0.5, 0.0, 0.0, float(gl_InvocationID));\n"
+ " EmitVertex();\n"
+ " EndPrimitive();\n"
+ "}\n",
+ SkSL::Program::kGeometry_Kind);
+}
+
#endif