[Piglit] [PATCH v2 5/5] arb-enhanced-layouts: explicit-offset: add linker test

Emil Velikov emil.l.velikov at gmail.com
Tue Oct 27 08:34:45 PDT 2015


From: Emil Velikov <emil.velikov at collabora.com>

Check if the linker throws an error when the offset across two
identically named blocks' members are not the same.

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 ...sbo-different-offset-across-shaders.shader_test | 35 ++++++++++++++++++++++
 ...ubo-different-offset-across-shaders.shader_test | 32 ++++++++++++++++++++
 2 files changed, 67 insertions(+)
 create mode 100644 tests/spec/arb_enhanced_layouts/linker/explicit-offsets/ssbo-different-offset-across-shaders.shader_test
 create mode 100644 tests/spec/arb_enhanced_layouts/linker/explicit-offsets/ubo-different-offset-across-shaders.shader_test

diff --git a/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/ssbo-different-offset-across-shaders.shader_test b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/ssbo-different-offset-across-shaders.shader_test
new file mode 100644
index 0000000..5cfba90
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/ssbo-different-offset-across-shaders.shader_test
@@ -0,0 +1,35 @@
+[require]
+GLSL >= 4.30
+GL_ARB_enhanced_layouts
+GL_ARB_shader_storage_buffer_object
+
+[vertex shader]
+#version 430
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(std140) buffer b {
+       layout(offset = 0) vec4 var1;
+       layout(offset = 32) vec4 var2;
+};
+
+void main()
+{
+}
+
+[vertex shader]
+#version 430
+#extension GL_ARB_enhanced_layouts : enable
+#extension GL_ARB_shader_storage_buffer_object : enable
+
+layout(std140) buffer b {
+       layout(offset = 0) vec4 var1;
+       layout(offset = 64) vec4 var2; // Wrong: members and their respective offset must across identically named blocks
+};
+
+void main()
+{
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/ubo-different-offset-across-shaders.shader_test b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/ubo-different-offset-across-shaders.shader_test
new file mode 100644
index 0000000..ce278ce
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/ubo-different-offset-across-shaders.shader_test
@@ -0,0 +1,32 @@
+[require]
+GLSL >= 1.40
+GL_ARB_enhanced_layouts
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+
+layout(std140) uniform b {
+       layout(offset = 0) vec4 var1;
+       layout(offset = 32) vec4 var2;
+};
+
+void main()
+{
+}
+
+[vertex shader]
+#version 140
+#extension GL_ARB_enhanced_layouts : enable
+
+layout(std140) uniform b {
+       layout(offset = 0) vec4 var1;
+       layout(offset = 64) vec4 var2; // Wrong: members and their respective offset must across identically named blocks
+};
+
+void main()
+{
+}
+
+[test]
+link error
-- 
2.6.1



More information about the Piglit mailing list