Re: [Piglit] [PATCH 06/10] arb_separate_shader_objects: add location overlapping tests
Reviewed-by: Timothy Arceri On 2/2/19 4:55 am, Andres Gomez wrote: New tests for location overlap with scalars, doubles and for duplicated inputs which match the same output variable in the previous stage. From the ARB_separate_shader_objects spec v.25: " * An output variable is considered to match an input variable in the subequent shader if: * the two variables match in name, type, and qualification; or * the two variables are declared with the same location layout qualifier and match in type and qualification." ... " A program will fail to link if any two non-vertex shader input variables are assigned to the same location." Cc: Timothy Arceri Cc: Iago Toral Quiroga Cc: Ilia Mirkin Signed-off-by: Andres Gomez --- ...uplicated-input-overlap-double.shader_test | 58 +++ ...ation-duplicated-input-overlap.shader_test | 55 ++ ...plicit-location-overlap-double.shader_test | 49 ...o-fs-explicit-location-overlap.shader_test | 49 4 files changed, 211 insertions(+) create mode 100644 tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-duplicated-input-overlap-double.shader_test create mode 100644 tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-duplicated-input-overlap.shader_test create mode 100644 tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-overlap-double.shader_test create mode 100644 tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-overlap.shader_test diff --git a/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-duplicated-input-overlap-double.shader_test b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-duplicated-input-overlap-double.shader_test new file mode 100644 index 0..f0a966e6a --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-duplicated-input-overlap-double.shader_test @@ -0,0 +1,58 @@ +// From the ARB_separate_shader_objects spec v.25: +// +// " * An output variable is considered to match an input variable +// in the subequent shader if: +// +// * the two variables match in name, type, and qualification; +// or +// +// * the two variables are declared with the same location +// layout qualifier and match in type and qualification." +// +// ... +// +// " A program will fail to link if any two non-vertex shader input +// variables are assigned to the same location." + +[require] +GLSL >= 1.50 +GL_ARB_separate_shader_objects +GL_ARB_gpu_shader_fp64 + +[vertex shader] +#version 150 +#extension GL_ARB_separate_shader_objects : require +#extension GL_ARB_gpu_shader_fp64 : require + +in vec4 piglit_vertex; + +layout(location = 0) flat out dvec4 out1; + +void main() +{ + gl_Position = piglit_vertex; + out1 = dvec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 150 +#extension GL_ARB_separate_shader_objects : require +#extension GL_ARB_gpu_shader_fp64 : require + +uniform int i; + +layout(location = 0) flat in dvec4 in1; +layout(location = 0) flat in dvec4 in2; + +out vec4 color; + +void main() +{ + if (i == 0) + color = vec4(in1); + else + color = vec4(in2); +} + +[test] +link error diff --git a/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-duplicated-input-overlap.shader_test b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-duplicated-input-overlap.shader_test new file mode 100644 index 0..d7e5769b3 --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-duplicated-input-overlap.shader_test @@ -0,0 +1,55 @@ +// From the ARB_separate_shader_objects spec v.25: +// +// " * An output variable is considered to match an input variable +// in the subequent shader if: +// +// * the two variables match in name, type, and qualification; +// or +// +// * the two variables are declared with the same location +// layout qualifier and match in type and qualification." +// +// ... +// +// " A program will fail to link if any two non-vertex shader input +// variables are assigned to the same location." + +[require] +GLSL >= 1.40 +GL_ARB_separate_shader_objects + +[vertex shader] +#version 140 +#extension GL_ARB_separate_shader_objects : require + +in vec4 piglit_vertex; + +layout(location = 0) out vec4 out1; + +void main() +{ + gl_Position = piglit_vertex; + out1 = vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 140 +#extension GL_ARB_separate_shader_objects : require + +uniform int i; + +layout(location = 0) in vec4 in1; +layout(location = 0) in vec4 in2; + +out vec4 color; + +void main() +{ + if (i == 0) + color = in1; + else + color = in
[Piglit] [PATCH 06/10] arb_separate_shader_objects: add location overlapping tests
New tests for location overlap with scalars, doubles and for duplicated inputs which match the same output variable in the previous stage. From the ARB_separate_shader_objects spec v.25: " * An output variable is considered to match an input variable in the subequent shader if: * the two variables match in name, type, and qualification; or * the two variables are declared with the same location layout qualifier and match in type and qualification." ... " A program will fail to link if any two non-vertex shader input variables are assigned to the same location." Cc: Timothy Arceri Cc: Iago Toral Quiroga Cc: Ilia Mirkin Signed-off-by: Andres Gomez --- ...uplicated-input-overlap-double.shader_test | 58 +++ ...ation-duplicated-input-overlap.shader_test | 55 ++ ...plicit-location-overlap-double.shader_test | 49 ...o-fs-explicit-location-overlap.shader_test | 49 4 files changed, 211 insertions(+) create mode 100644 tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-duplicated-input-overlap-double.shader_test create mode 100644 tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-duplicated-input-overlap.shader_test create mode 100644 tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-overlap-double.shader_test create mode 100644 tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-overlap.shader_test diff --git a/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-duplicated-input-overlap-double.shader_test b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-duplicated-input-overlap-double.shader_test new file mode 100644 index 0..f0a966e6a --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-duplicated-input-overlap-double.shader_test @@ -0,0 +1,58 @@ +// From the ARB_separate_shader_objects spec v.25: +// +// " * An output variable is considered to match an input variable +// in the subequent shader if: +// +// * the two variables match in name, type, and qualification; +// or +// +// * the two variables are declared with the same location +// layout qualifier and match in type and qualification." +// +// ... +// +// " A program will fail to link if any two non-vertex shader input +// variables are assigned to the same location." + +[require] +GLSL >= 1.50 +GL_ARB_separate_shader_objects +GL_ARB_gpu_shader_fp64 + +[vertex shader] +#version 150 +#extension GL_ARB_separate_shader_objects : require +#extension GL_ARB_gpu_shader_fp64 : require + +in vec4 piglit_vertex; + +layout(location = 0) flat out dvec4 out1; + +void main() +{ + gl_Position = piglit_vertex; + out1 = dvec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 150 +#extension GL_ARB_separate_shader_objects : require +#extension GL_ARB_gpu_shader_fp64 : require + +uniform int i; + +layout(location = 0) flat in dvec4 in1; +layout(location = 0) flat in dvec4 in2; + +out vec4 color; + +void main() +{ + if (i == 0) + color = vec4(in1); + else + color = vec4(in2); +} + +[test] +link error diff --git a/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-duplicated-input-overlap.shader_test b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-duplicated-input-overlap.shader_test new file mode 100644 index 0..d7e5769b3 --- /dev/null +++ b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-duplicated-input-overlap.shader_test @@ -0,0 +1,55 @@ +// From the ARB_separate_shader_objects spec v.25: +// +// " * An output variable is considered to match an input variable +// in the subequent shader if: +// +// * the two variables match in name, type, and qualification; +// or +// +// * the two variables are declared with the same location +// layout qualifier and match in type and qualification." +// +// ... +// +// " A program will fail to link if any two non-vertex shader input +// variables are assigned to the same location." + +[require] +GLSL >= 1.40 +GL_ARB_separate_shader_objects + +[vertex shader] +#version 140 +#extension GL_ARB_separate_shader_objects : require + +in vec4 piglit_vertex; + +layout(location = 0) out vec4 out1; + +void main() +{ + gl_Position = piglit_vertex; + out1 = vec4(1.0, 0.0, 0.0, 1.0); +} + +[fragment shader] +#version 140 +#extension GL_ARB_separate_shader_objects : require + +uniform int i; + +layout(location = 0) in vec4 in1; +layout(location = 0) in vec4 in2; + +out vec4 color; + +void main() +{ + if (i == 0) + color = in1; + else + color = in2; +} + +[test] +link error diff --git a/tests/spec/arb_separate_shader_objects/linker/