[2/7] arb_tessellation_shader: Add tests for TCS output size redeclaration

Submitted by Andres Gomez on Oct. 22, 2016, 8:42 p.m.

Details

Message ID 20161022204226.31193-3-agomez@igalia.com
State Accepted
Commit 91c00be97e8821298ade9e3459fb04b07fbad05c
Headers show
Series "More duplicated layout-qualifier-names tests" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Andres Gomez Oct. 22, 2016, 8:42 p.m.
From the ARB_tessellation_shader spec:

    "All tessellation control shader layout declarations in a program must
     specify the same output patch vertex count."

Signed-off-by: Andres Gomez <agomez@igalia.com>
---
 ...e-qualifier-declarations-vertices-mismatch.tesc | 23 ++++++++++++++++++++++
 ...t-multiple-qualifier-declarations-vertices.tesc | 23 ++++++++++++++++++++++
 2 files changed, 46 insertions(+)
 create mode 100644 tests/spec/arb_tessellation_shader/compiler/layout-multiple-qualifier-declarations-vertices-mismatch.tesc
 create mode 100644 tests/spec/arb_tessellation_shader/compiler/layout-multiple-qualifier-declarations-vertices.tesc

Patch hide | download patch | download mbox

diff --git a/tests/spec/arb_tessellation_shader/compiler/layout-multiple-qualifier-declarations-vertices-mismatch.tesc b/tests/spec/arb_tessellation_shader/compiler/layout-multiple-qualifier-declarations-vertices-mismatch.tesc
new file mode 100644
index 0000000..62e369e
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/compiler/layout-multiple-qualifier-declarations-vertices-mismatch.tesc
@@ -0,0 +1,23 @@ 
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_tessellation_shader
+// check_link: true
+// [end config]
+//
+// From the ARB_tessellation_shader spec:
+//
+//    "All tessellation control shader layout declarations in a program must
+//     specify the same output patch vertex count."
+
+#version 150
+#extension GL_ARB_tessellation_shader: require
+
+layout(vertices = 3) out;
+layout(vertices = 4) out;
+
+void main() {
+    gl_out[gl_InvocationID].gl_Position = vec4(0.0);
+    gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 1.0);
+    gl_TessLevelInner = float[2](1.0, 1.0);
+}
diff --git a/tests/spec/arb_tessellation_shader/compiler/layout-multiple-qualifier-declarations-vertices.tesc b/tests/spec/arb_tessellation_shader/compiler/layout-multiple-qualifier-declarations-vertices.tesc
new file mode 100644
index 0000000..62a2fba
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/compiler/layout-multiple-qualifier-declarations-vertices.tesc
@@ -0,0 +1,23 @@ 
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_tessellation_shader
+// check_link: true
+// [end config]
+//
+// From the ARB_tessellation_shader spec:
+//
+//    "All tessellation control shader layout declarations in a program must
+//     specify the same output patch vertex count."
+
+#version 150
+#extension GL_ARB_tessellation_shader: require
+
+layout(vertices = 3) out;
+layout(vertices = 3) out;
+
+void main() {
+    gl_out[gl_InvocationID].gl_Position = vec4(0.0);
+    gl_TessLevelOuter = float[4](1.0, 1.0, 1.0, 1.0);
+    gl_TessLevelInner = float[2](1.0, 1.0);
+}