diff options
author | Timothy Arceri <timothy.arceri@collabora.com> | 2016-01-13 18:25:26 +1100 |
---|---|---|
committer | Timothy Arceri <timothy.arceri@collabora.com> | 2016-01-22 11:53:21 +1100 |
commit | 15619b40cf344a9f8363ba97bf11fe939746de6a (patch) | |
tree | 465572edab1102cfec5e98b7fe8160d6d2423997 | |
parent | 67560b624c9698c60eb58d5008504cb232f5836e (diff) |
arb_enhanced_layouts: more fs output tests
4 files changed, 143 insertions, 0 deletions
diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-array.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-array.shader_test new file mode 100644 index 000000000..df96f89d2 --- /dev/null +++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-array.shader_test @@ -0,0 +1,36 @@ +// From Section 4.4.2 (Output Layout Qualifiers) of the GLSL 4.40 spec: +// +// "Additionally, for fragment shader outputs, if two variables are placed +// within the same location, they must have the same underlying type +// (floating-point or integer). No component aliasing of output variables or +// members is allowed." + +[require] +GLSL >= 1.40 +GL_ARB_enhanced_layouts +GL_ARB_separate_shader_objects +GL_ARB_explicit_attrib_location + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_enhanced_layouts: require +#extension GL_ARB_separate_shader_objects: require +#extension GL_ARB_explicit_attrib_location: require + +// consume X/Y components +layout(location = 0) out vec2 a[2]; + +// consumes Z/W components +layout(location = 1, component = 2) out vec2 b; + +void main() +{ + a[0] = vec2(0.0); + a[1] = vec2(0.5); + b = vec2(1.0); +} + +[test] +link success diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap-array.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap-array.shader_test new file mode 100644 index 000000000..2bdabf4d1 --- /dev/null +++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap-array.shader_test @@ -0,0 +1,36 @@ +// From Section 4.4.2 (Output Layout Qualifiers) of the GLSL 4.40 spec: +// +// "Additionally, for fragment shader outputs, if two variables are placed +// within the same location, they must have the same underlying type +// (floating-point or integer). No component aliasing of output variables or +// members is allowed." + +[require] +GLSL >= 1.40 +GL_ARB_enhanced_layouts +GL_ARB_separate_shader_objects +GL_ARB_explicit_attrib_location + +[vertex shader passthrough] + +[fragment shader] +#version 140 +#extension GL_ARB_enhanced_layouts: require +#extension GL_ARB_separate_shader_objects: require +#extension GL_ARB_explicit_attrib_location: require + +// consume X/Y components +layout(location = 0) out vec2 a[2]; + +// consumes Z/W components +layout(location = 1, component = 1) out vec2 b; + +void main() +{ + a[0] = vec2(0.0); + a[1] = vec2(0.5); + b = vec2(1.0); +} + +[test] +link error diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap4.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap4.shader_test new file mode 100644 index 000000000..43ac05607 --- /dev/null +++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap4.shader_test @@ -0,0 +1,35 @@ +// From Section 4.4.2 (Output Layout Qualifiers) of the GLSL 4.40 spec: +// +// "Additionally, for fragment shader outputs, if two variables are placed +// within the same location, they must have the same underlying type +// (floating-point or integer). No component aliasing of output variables or +// members is allowed." + +[require] +GLSL >= 1.40 +GL_ARB_enhanced_layouts +GL_ARB_separate_shader_objects +GL_ARB_explicit_attrib_location + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_enhanced_layouts: require +#extension GL_ARB_separate_shader_objects: require +#extension GL_ARB_explicit_attrib_location: require + +// consume X/Y components +layout(location = 0, component = 1) out vec2 a; + +// consumes Z/W components +layout(location = 0) out vec2 b; + +void main() +{ + a = vec2(0.0); + b = vec2(1.0); +} + +[test] +link error diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-type-mismatch-array.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-type-mismatch-array.shader_test new file mode 100644 index 000000000..7ca5543d0 --- /dev/null +++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-type-mismatch-array.shader_test @@ -0,0 +1,36 @@ +// From Section 4.4.2 (Output Layout Qualifiers) of the GLSL 4.40 spec: +// +// "Additionally, for fragment shader outputs, if two variables are placed +// within the same location, they must have the same underlying type +// (floating-point or integer). No component aliasing of output variables or +// members is allowed." + +[require] +GLSL >= 1.40 +GL_ARB_enhanced_layouts +GL_ARB_separate_shader_objects +GL_ARB_explicit_attrib_location + +[vertex shader passthrough] + +[fragment shader] +#version 150 +#extension GL_ARB_enhanced_layouts: require +#extension GL_ARB_separate_shader_objects: require +#extension GL_ARB_explicit_attrib_location: require + +// consume X/Y components +layout(location = 0) out ivec2 a[2]; + +// consumes Z/W components +layout(location = 1, component = 2) out vec2 b; + +void main() +{ + a[0] = ivec2(0); + a[1] = ivec2(2); + b = vec2(1.0); +} + +[test] +link error |