[Piglit] [PATCH 6/6] ARB_sample_shading: Add compiler tests for new builtins
Anuj Phogat
anuj.phogat at gmail.com
Mon Oct 14 19:19:08 CEST 2013
Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
tests/all.tests | 4 ++++
tests/spec/arb_sample_shading/compiler/gl_NumSamples.frag | 12 ++++++++++++
tests/spec/arb_sample_shading/compiler/gl_SampleID.frag | 12 ++++++++++++
tests/spec/arb_sample_shading/compiler/gl_SampleMask.frag | 13 +++++++++++++
.../spec/arb_sample_shading/compiler/gl_SamplePosition.frag | 12 ++++++++++++
5 files changed, 53 insertions(+)
create mode 100644 tests/spec/arb_sample_shading/compiler/gl_NumSamples.frag
create mode 100644 tests/spec/arb_sample_shading/compiler/gl_SampleID.frag
create mode 100644 tests/spec/arb_sample_shading/compiler/gl_SampleMask.frag
create mode 100644 tests/spec/arb_sample_shading/compiler/gl_SamplePosition.frag
diff --git a/tests/all.tests b/tests/all.tests
index 562eca3..5f256c4 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -1348,6 +1348,10 @@ for num_samples in TEST_SAMPLE_COUNTS:
test_name)
arb_sample_shading[test_name] = PlainExecTest(executable)
+import_glsl_parser_tests(spec['ARB_sample_shading'],
+ os.path.join(testsDir, 'spec', 'arb_sample_shading'),
+ ['compiler'])
+
# Group ARB_debug_output
arb_debug_output = Group()
spec['ARB_debug_output'] = arb_debug_output
diff --git a/tests/spec/arb_sample_shading/compiler/gl_NumSamples.frag b/tests/spec/arb_sample_shading/compiler/gl_NumSamples.frag
new file mode 100644
index 0000000..d99e8b8
--- /dev/null
+++ b/tests/spec/arb_sample_shading/compiler/gl_NumSamples.frag
@@ -0,0 +1,12 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.30
+// require_extensions: GL_ARB_sample_shading
+// [end config]
+#version 130
+#extension GL_ARB_sample_shading : enable
+
+int func()
+{
+ return gl_NumSamples;
+}
diff --git a/tests/spec/arb_sample_shading/compiler/gl_SampleID.frag b/tests/spec/arb_sample_shading/compiler/gl_SampleID.frag
new file mode 100644
index 0000000..0d202be
--- /dev/null
+++ b/tests/spec/arb_sample_shading/compiler/gl_SampleID.frag
@@ -0,0 +1,12 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.30
+// require_extensions: GL_ARB_sample_shading
+// [end config]
+#version 130
+#extension GL_ARB_sample_shading : enable
+
+int func()
+{
+ return gl_SampleID;
+}
diff --git a/tests/spec/arb_sample_shading/compiler/gl_SampleMask.frag b/tests/spec/arb_sample_shading/compiler/gl_SampleMask.frag
new file mode 100644
index 0000000..1e659bc
--- /dev/null
+++ b/tests/spec/arb_sample_shading/compiler/gl_SampleMask.frag
@@ -0,0 +1,13 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.30
+// require_extensions: GL_ARB_sample_shading
+// [end config]
+#version 130
+#extension GL_ARB_sample_shading : enable
+
+int func()
+{
+ gl_SampleMask[0] = 0xff;
+ return 0;
+}
diff --git a/tests/spec/arb_sample_shading/compiler/gl_SamplePosition.frag b/tests/spec/arb_sample_shading/compiler/gl_SamplePosition.frag
new file mode 100644
index 0000000..be42d90
--- /dev/null
+++ b/tests/spec/arb_sample_shading/compiler/gl_SamplePosition.frag
@@ -0,0 +1,12 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.30
+// require_extensions: GL_ARB_sample_shading
+// [end config]
+#version 130
+#extension GL_ARB_sample_shading : enable
+
+vec2 func()
+{
+ return gl_SamplePosition;
+}
--
1.8.1.4
More information about the Piglit
mailing list