--- .../component-layout/fs-out-overlap.shader_test | 35 ++++++++++++++++++++++ .../component-layout/fs-out-overlap2.shader_test | 35 ++++++++++++++++++++++ .../component-layout/fs-out-overlap3.shader_test | 35 ++++++++++++++++++++++ .../fs-out-type-mismatch.shader_test | 35 ++++++++++++++++++++++ .../linker/component-layout/fs-out.shader_test | 35 ++++++++++++++++++++++ 5 files changed, 175 insertions(+) create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap.shader_test create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap2.shader_test create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap3.shader_test create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-type-mismatch.shader_test create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out.shader_test
diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap.shader_test new file mode 100644 index 0000000..c2cdb06 --- /dev/null +++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap.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 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; + +// consumes Z/W components +layout(location = 0, component = 1) 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-overlap2.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap2.shader_test new file mode 100644 index 0000000..44817ee --- /dev/null +++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap2.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) out vec3 a; + +// consumes Z/W components +layout(location = 0, component = 1) out float b; + +void main() +{ + a = vec3(0.0); + b = 1.0; +} + +[test] +link error diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap3.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap3.shader_test new file mode 100644 index 0000000..f6200b6 --- /dev/null +++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-overlap3.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) out vec3 a; + +// consumes Z/W components +layout(location = 0, component = 0) out float b; + +void main() +{ + a = vec3(0.0); + b = 1.0; +} + +[test] +link error diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-type-mismatch.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-type-mismatch.shader_test new file mode 100644 index 0000000..450c182 --- /dev/null +++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out-type-mismatch.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) out ivec2 a; + +// consumes Z/W components +layout(location = 0, component = 2) out vec2 b; + +void main() +{ + a = ivec2(0); + b = vec2(1.0); +} + +[test] +link error diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out.shader_test new file mode 100644 index 0000000..f1317c3 --- /dev/null +++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/fs-out.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 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; + +// consumes Z/W components +layout(location = 0, component = 2) out vec2 b; + +void main() +{ + a = vec2(0.0); + b = vec2(1.0); +} + +[test] +link success -- 2.4.3 _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit