We can't mix floats and doubles so test for mismatchh rather than overlap. --- .../compiler/component-layout/overlap-double.vert | 31 ------------ ...vs-to-fs-type-mismatch-double-float.shader_test | 59 ++++++++++++++++++++++ 2 files changed, 59 insertions(+), 31 deletions(-) delete mode 100644 tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-double.vert create mode 100644 tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-double-float.shader_test
diff --git a/tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-double.vert b/tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-double.vert deleted file mode 100644 index 255ecdf..0000000 --- a/tests/spec/arb_enhanced_layouts/compiler/component-layout/overlap-double.vert +++ /dev/null @@ -1,31 +0,0 @@ -// [config] -// expect_result: fail -// glsl_version: 1.40 -// check_link: true -// require_extensions: GL_ARB_enhanced_layouts GL_ARB_gpu_shader_fp64 GL_ARB_separate_shader_objects -// [end config] -// -// 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." - -#version 140 -#extension GL_ARB_enhanced_layouts: require -#extension GL_ARB_gpu_shader_fp64: require -#extension GL_ARB_separate_shader_objects: require - -// consume X/Y components -layout(location = 7, component = 0) out double a; - -// consumes Y component -layout(location = 7, component = 1) out float b; - -void main() -{ -} diff --git a/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-double-float.shader_test b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-double-float.shader_test new file mode 100644 index 0000000..7e51c4c --- /dev/null +++ b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-double-float.shader_test @@ -0,0 +1,59 @@ +// 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 +GL_ARB_gpu_shader_fp64 + +[vertex shader] +#version 140 +#extension GL_ARB_enhanced_layouts: require +#extension GL_ARB_gpu_shader_fp64: require +#extension GL_ARB_separate_shader_objects: require + +// consume X/Y components +layout(location = 7, component = 0) flat out double a; + +// consumes Y component +layout(location = 7, component = 2) out float b; + +void main() +{ + a = 1.0LF; + b = 0.0; +} + +[fragment shader] +#version 140 +#extension GL_ARB_enhanced_layouts: require +#extension GL_ARB_gpu_shader_fp64: require +#extension GL_ARB_separate_shader_objects: require + +out vec4 color; + +// consume X/Y components +layout(location = 7, component = 0) flat in double a; + +// consumes Y component +layout(location = 7, component = 2) in float b; + +void main() +{ + color = vec4(b, a, 1.0, 1.0); +} + +[test] +link error -- 2.4.3 _______________________________________________ Piglit mailing list Piglit@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/piglit