[Piglit] [PATCH 3/8] arb_enhanced_layouts: check for type packing mismatch in linker rather than compiler
Timothy Arceri
timothy.arceri at collabora.com
Sun Nov 29 14:19:52 PST 2015
---
.../type-mismatch-signed-float-illegal.vert | 28 -----------
.../type-mismatch-signed-unsigned-illegal.vert | 28 -----------
.../type-mismatch-unsigned-float-illegal.vert | 28 -----------
...vs-to-fs-type-mismatch-signed-float.shader_test | 56 ++++++++++++++++++++++
...to-fs-type-mismatch-signed-unsigned.shader_test | 56 ++++++++++++++++++++++
...-to-fs-type-mismatch-unsigned-float.shader_test | 56 ++++++++++++++++++++++
6 files changed, 168 insertions(+), 84 deletions(-)
delete mode 100644 tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-float-illegal.vert
delete mode 100644 tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-unsigned-illegal.vert
delete mode 100644 tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-unsigned-float-illegal.vert
create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-signed-float.shader_test
create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-signed-unsigned.shader_test
create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-unsigned-float.shader_test
diff --git a/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-float-illegal.vert b/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-float-illegal.vert
deleted file mode 100644
index 4464b51..0000000
--- a/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-float-illegal.vert
+++ /dev/null
@@ -1,28 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 1.40
-// check_link: true
-// require_extensions: GL_ARB_enhanced_layouts GL_ARB_separate_shader_objects
-// [end config]
-//
-// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
-//
-// "Further, when location aliasing, the aliases sharing the location must
-// have the same underlying numerical type (floating-point or integer) and
-// the same auxiliary storage and interpolation qualification"
-
-#version 140
-#extension GL_ARB_enhanced_layouts: require
-#extension GL_ARB_separate_shader_objects: require
-
-// consume X/Y/Z components
-layout(location = 0) out ivec3 a;
-
-// consumes W component
-layout(location = 0, component = 3) out float b;
-
-void main()
-{
- a = ivec3(0);
- b = 1.0;
-}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-unsigned-illegal.vert b/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-unsigned-illegal.vert
deleted file mode 100644
index 48dd641..0000000
--- a/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-unsigned-illegal.vert
+++ /dev/null
@@ -1,28 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 1.40
-// check_link: true
-// require_extensions: GL_ARB_enhanced_layouts GL_ARB_separate_shader_objects
-// [end config]
-//
-// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
-//
-// "Further, when location aliasing, the aliases sharing the location must
-// have the same underlying numerical type (floating-point or integer) and
-// the same auxiliary storage and interpolation qualification"
-
-#version 140
-#extension GL_ARB_enhanced_layouts: require
-#extension GL_ARB_separate_shader_objects: require
-
-// consume X/Y/Z components
-layout(location = 0) out ivec3 a;
-
-// consumes W component
-layout(location = 0, component = 3) out uint b;
-
-void main()
-{
- a = ivec3(0);
- b = 1u;
-}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-unsigned-float-illegal.vert b/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-unsigned-float-illegal.vert
deleted file mode 100644
index 352b846..0000000
--- a/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-unsigned-float-illegal.vert
+++ /dev/null
@@ -1,28 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 1.40
-// check_link: true
-// require_extensions: GL_ARB_enhanced_layouts GL_ARB_separate_shader_objects
-// [end config]
-//
-// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
-//
-// "Further, when location aliasing, the aliases sharing the location must
-// have the same underlying numerical type (floating-point or integer) and
-// the same auxiliary storage and interpolation qualification"
-
-#version 140
-#extension GL_ARB_enhanced_layouts: require
-#extension GL_ARB_separate_shader_objects: require
-
-// consume X/Y/Z components
-layout(location = 0) out uvec3 a;
-
-// consumes W component
-layout(location = 0, component = 3) out float b;
-
-void main()
-{
- a = uvec3(0);
- b = 1.0;
-}
diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-signed-float.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-signed-float.shader_test
new file mode 100644
index 0000000..8c62198
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-signed-float.shader_test
@@ -0,0 +1,56 @@
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+// "Location aliasing is causing two variables or block members to have the
+// same location number. Component aliasing is assigning the same (or
+// overlapping) component numbers for two location aliases. (Recall if
+// component is not used, components are assigned starting with 0.) With one
+// exception, location aliasing is allowed only if it does not cause
+// component aliasing; it is a compile-time or link-time error to cause
+// component aliasing."
+//
+// "Further, when location aliasing, the aliases sharing the location must
+// have the same underlying numerical type (floating-point or integer) and
+// the same auxiliary storage and interpolation qualification"
+
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+GL_ARB_separate_shader_objects
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+// consume X/Y/Z components
+layout(location = 0) flat out ivec3 a;
+
+// consumes W component
+layout(location = 0, component = 3) flat out float b;
+
+void main()
+{
+ a = ivec3(0);
+ b = 1.0;
+}
+
+[fragment shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+out vec4 color;
+
+// consume Y/Z/W components of 32 vectors
+layout(location = 0) flat in ivec3 a;
+
+// consumes X component of first vector
+layout(location = 0, component = 3) flat in float b;
+
+void main()
+{
+ color = vec4(b, a);
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-signed-unsigned.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-signed-unsigned.shader_test
new file mode 100644
index 0000000..62bd8ef
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-signed-unsigned.shader_test
@@ -0,0 +1,56 @@
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+// "Location aliasing is causing two variables or block members to have the
+// same location number. Component aliasing is assigning the same (or
+// overlapping) component numbers for two location aliases. (Recall if
+// component is not used, components are assigned starting with 0.) With one
+// exception, location aliasing is allowed only if it does not cause
+// component aliasing; it is a compile-time or link-time error to cause
+// component aliasing."
+//
+// "Further, when location aliasing, the aliases sharing the location must
+// have the same underlying numerical type (floating-point or integer) and
+// the same auxiliary storage and interpolation qualification"
+
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+GL_ARB_separate_shader_objects
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+// consume X/Y/Z components
+layout(location = 0) out ivec3 a;
+
+// consumes W component
+layout(location = 0, component = 3) out uint b;
+
+void main()
+{
+ a = ivec3(0);
+ b = 1u;
+}
+
+[fragment shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+out vec4 color;
+
+// consume Y/Z/W components of 32 vectors
+layout(location = 0) flat in ivec3 a;
+
+// consumes X component of first vector
+layout(location = 0, component = 3) flat in uint b;
+
+void main()
+{
+ color = vec4(b, a);
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-unsigned-float.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-unsigned-float.shader_test
new file mode 100644
index 0000000..1d84723
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-unsigned-float.shader_test
@@ -0,0 +1,56 @@
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+// "Location aliasing is causing two variables or block members to have the
+// same location number. Component aliasing is assigning the same (or
+// overlapping) component numbers for two location aliases. (Recall if
+// component is not used, components are assigned starting with 0.) With one
+// exception, location aliasing is allowed only if it does not cause
+// component aliasing; it is a compile-time or link-time error to cause
+// component aliasing."
+//
+// "Further, when location aliasing, the aliases sharing the location must
+// have the same underlying numerical type (floating-point or integer) and
+// the same auxiliary storage and interpolation qualification"
+
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+GL_ARB_separate_shader_objects
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+// consume X/Y/Z components
+layout(location = 0) out uvec3 a;
+
+// consumes W component
+layout(location = 0, component = 3) out float b;
+
+void main()
+{
+ a = uvec3(0);
+ b = 1.0;
+}
+
+[fragment shader]
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_separate_shader_objects: require
+
+out vec4 color;
+
+// consume Y/Z/W components of 32 vectors
+layout(location = 0) flat in uvec3 a;
+
+// consumes X component of first vector
+layout(location = 0, component = 3) flat in float b;
+
+void main()
+{
+ color = vec4(b, a);
+}
+
+[test]
+link error
--
2.4.3
More information about the Piglit
mailing list