aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2017-10-14 22:12:33 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-17 17:22:32 +0000
commit8580d51cd8cb733321978966621056fa38b7be8c (patch)
treebff686d40a5083437b052385b7e70fc5dec58550 /tests
parent87d54cd1aec2d282b0e7f1ef9c8bb8fc3da06a84 (diff)
Add sk_InstanceID
Bug: skia: Change-Id: I79b0dce96d9af7632f027afa5317a7725e96cda3 Reviewed-on: https://skia-review.googlesource.com/59861 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/SkSLGLSLTest.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/SkSLGLSLTest.cpp b/tests/SkSLGLSLTest.cpp
index 28d5039121..29b3129230 100644
--- a/tests/SkSLGLSLTest.cpp
+++ b/tests/SkSLGLSLTest.cpp
@@ -1037,6 +1037,18 @@ DEF_TEST(SkSLVertexID, r) {
SkSL::Program::kVertex_Kind);
}
+DEF_TEST(SkSLInstanceID, r) {
+ test(r,
+ "out int id; void main() { id = sk_InstanceID; }",
+ *SkSL::ShaderCapsFactory::Default(),
+ "#version 400\n"
+ "out int id;\n"
+ "void main() {\n"
+ " id = gl_InstanceID;\n"
+ "}\n",
+ SkSL::Program::kVertex_Kind);
+}
+
DEF_TEST(SkSLClipDistance, r) {
test(r,
"void main() { sk_ClipDistance[0] = 0; }",