diff options
author | Ethan Nicholas <ethannicholas@google.com> | 2017-06-12 12:05:44 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-15 18:06:58 +0000 |
commit | d5d323f45777c4766ddf4c74eedff36ee5d9bc56 (patch) | |
tree | b4af72c66c5265314b19113515e79931de627b26 /tests/SkSLGLSLTest.cpp | |
parent | eee3c09e96d0a925e1ecaec118cc3ac0294e86ea (diff) |
implemented mustImplementGSInvocationsWithLoop workaround in sksl
Bug: skia:
Change-Id: I8434be89537a8baf9e9c5c7a643d28c03108f4ea
Reviewed-on: https://skia-review.googlesource.com/18154
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
Diffstat (limited to 'tests/SkSLGLSLTest.cpp')
-rw-r--r-- | tests/SkSLGLSLTest.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp index 2ea6c7ec71..23888e0fbf 100644 --- a/tests/SkSLGLSLTest.cpp +++ b/tests/SkSLGLSLTest.cpp @@ -1393,4 +1393,34 @@ DEF_TEST(SkSLDeadLoopVar, r) { ); } +DEF_TEST(SkSLInvocations, 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();" + "}", + *SkSL::ShaderCapsFactory::MustImplementGSInvocationsWithLoop(), + "#version 400\n" + "layout (points) in ;\n" + "layout (line_strip, max_vertices = 4) out ;\n" + "void _invoke(int sk_InvocationID) {\n" + " gl_Position = gl_in[0].gl_Position + vec4(-0.5, 0.0, 0.0, float(sk_InvocationID));\n" + " EmitVertex();\n" + " gl_Position = gl_in[0].gl_Position + vec4(0.5, 0.0, 0.0, float(sk_InvocationID));\n" + " EmitVertex();\n" + "}\n" + "void main() {\n" + " for (int i = 0;i < 2; i++) {\n" + " _invoke(i);\n" + " EndPrimitive();\n" + " }\n" + "}\n", + SkSL::Program::kGeometry_Kind); +} + #endif |