From f1b47bb299e72456d70cf3eae8086a5e01766c67 Mon Sep 17 00:00:00 2001 From: Chris Dalton Date: Fri, 6 Oct 2017 11:57:51 -0600 Subject: Add a cap for geometry shader invocations Bug: skia:7116 Change-Id: I3cc2ce7b2e5123c9adfd9781b2a5a8553747dfa5 Reviewed-on: https://skia-review.googlesource.com/56000 Reviewed-by: Brian Salomon Reviewed-by: Ethan Nicholas Commit-Queue: Chris Dalton --- tests/SkSLGLSLTest.cpp | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'tests/SkSLGLSLTest.cpp') diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp index 3845b8b438..28d5039121 100644 --- a/tests/SkSLGLSLTest.cpp +++ b/tests/SkSLGLSLTest.cpp @@ -1434,7 +1434,7 @@ DEF_TEST(SkSLInvocations, r) { "sk_Position = sk_in[0].sk_Position + float4(-0.5, 0, 0, sk_InvocationID);" "EmitVertex();" "}", - *SkSL::ShaderCapsFactory::MustImplementGSInvocationsWithLoop(), + *SkSL::ShaderCapsFactory::NoGSInvocationsSupport(), "#version 400\n" "int sk_InvocationID;\n" "layout (points) in ;\n" @@ -1454,6 +1454,27 @@ DEF_TEST(SkSLInvocations, r) { " }\n" "}\n", SkSL::Program::kGeometry_Kind); + test(r, + "layout(points, invocations = 2) in;" + "layout(invocations = 3) in;" + "layout(line_strip, max_vertices = 2) out;" + "void main() {" + "sk_Position = sk_in[0].sk_Position + float4(-0.5, 0, 0, sk_InvocationID);" + "EmitVertex();" + "EndPrimitive();" + "}", + *SkSL::ShaderCapsFactory::GSInvocationsExtensionString(), + "#version 400\n" + "#extension GL_ARB_gpu_shader5 : require\n" + "layout (points, invocations = 2) in ;\n" + "layout (invocations = 3) 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" + " EndPrimitive();\n" + "}\n", + SkSL::Program::kGeometry_Kind); } DEF_TEST(SkSLTypePrecision, r) { -- cgit v1.2.3