On 06/11/17 23:22, Iago Toral Quiroga wrote:
This is not allowed so we check that we produce a linker error.
It's not 100% obvious why this wouldn't be allowed. Can we have a spec quote added to the test header?
--- .../vs-to-fs-type-not-numerical.shader_test | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-not-numerical.shader_test diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-not-numerical.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-not-numerical.shader_test new file mode 100644 index 000000000..aede6ce8d --- /dev/null +++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-not-numerical.shader_test @@ -0,0 +1,52 @@ +# Test for link error between vertex and fragment shaders when +# component qualifiers don't match. This case checks that +# location aliasing is not permitted for non-numerical types +# such as a struct + +[require] +GLSL >= 3.30 +GL_ARB_enhanced_layouts +GL_ARB_separate_shader_objects + +[vertex shader] +#version 330 +#extension GL_ARB_enhanced_layouts: require +#extension GL_ARB_separate_shader_objects: require + +struct S { + vec3 foo; + vec4 bar; +}; + +layout(location = 0, component = 3) out float b; +layout(location = 0) out S a; + +void main() +{ + a.foo = vec3(1.0); + a.bar = vec4(1.0); + b = 0.5; +} + +[fragment shader] +#version 330 +#extension GL_ARB_enhanced_layouts: require +#extension GL_ARB_separate_shader_objects: require + +struct S { + vec3 foo; + vec4 bar; +}; + +layout(location = 0, component = 3) in float b; +layout(location = 0) in S a; + +out vec4 color; + +void main() +{ + color = vec4(a.foo + a.bar.xyz, b); +} + +[test] +link error
_______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/piglit