aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/SkSLGLSLTest.cpp
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2018-01-11 00:46:14 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-11 19:27:39 +0000
commit8fd7955d03aa37e65493a6d4eeaa5a36dd45c278 (patch)
tree4f675d65eba78b7d4556b8162a0e532b79e60d6e /tests/SkSLGLSLTest.cpp
parent1c153c0fba31a90e9c76156b7805448653f17226 (diff)
Enable the GL_EXT_geometry_shader extension where necessary
Bug: skia: Change-Id: I37bfb90efed28748d6c3e53be5c9703c291b036c Reviewed-on: https://skia-review.googlesource.com/93460 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'tests/SkSLGLSLTest.cpp')
-rw-r--r--tests/SkSLGLSLTest.cpp27
1 files changed, 24 insertions, 3 deletions
diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp
index 7c69de62be..1ae421f8af 100644
--- a/tests/SkSLGLSLTest.cpp
+++ b/tests/SkSLGLSLTest.cpp
@@ -1146,7 +1146,7 @@ DEF_TEST(SkSLGeometry, r) {
"EmitVertex();"
"EndPrimitive();"
"}",
- *SkSL::ShaderCapsFactory::Default(),
+ *SkSL::ShaderCapsFactory::GeometryShaderSupport(),
"#version 400\n"
"layout (points) in ;\n"
"layout (invocations = 2) in ;\n"
@@ -1485,7 +1485,7 @@ DEF_TEST(SkSLDeadLoopVar, r) {
);
}
-DEF_TEST(SkSLInvocations, r) {
+DEF_TEST(SkSLGeometryShaders, r) {
test(r,
"layout(points) in;"
"layout(invocations = 2) in;"
@@ -1539,6 +1539,27 @@ DEF_TEST(SkSLInvocations, r) {
" EndPrimitive();\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::GeometryShaderExtensionString(),
+ "#version 310es\n"
+ "#extension GL_EXT_geometry_shader : 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) {
@@ -1719,7 +1740,7 @@ DEF_TEST(SkSLNormalization, r) {
"EmitVertex();"
"EndPrimitive();"
"}",
- *SkSL::ShaderCapsFactory::Default(),
+ *SkSL::ShaderCapsFactory::GeometryShaderSupport(),
"#version 400\n"
"uniform vec4 sk_RTAdjust;\n"
"layout (points) in ;\n"