Commit 71d1b4c3 authored by Andres Gomez's avatar Andres Gomez

arb_separate_shader_objects: split linker tests

Most of the linker tests look for errors that may be already reported
during the compiling stage, depending on the
implementation. Therefore, let's split them into individual compiler
tests which also check for the linking stage.
Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
Reviewed-by: Timothy Arceri's avatarTimothy Arceri <tarceri@itsqueeze.com>
parent 0f8a8d16
// [config]
// expect_result: fail
// glsl_version: 1.40
// require_extensions: GL_ARB_separate_shader_objects
// check_link: true
// [end config]
//
// From the ARB_separate_shader_objects spec v.25:
//
// " * An output variable is considered to match an input variable
......@@ -13,26 +20,6 @@
//
// " 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
......@@ -50,6 +37,3 @@ void main()
else
color = in2;
}
[test]
link error
// [config]
// expect_result: fail
// glsl_version: 1.40
// require_extensions: GL_ARB_separate_shader_objects
// check_link: true
// [end config]
//
// 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."
#version 140
#extension GL_ARB_separate_shader_objects : require
in vec4 piglit_vertex;
layout(location = 0) out vec4 out1;
layout(location = 0) out vec4 out2;
void main()
{
gl_Position = piglit_vertex;
out1 = vec4(1.0, 0.0, 0.0, 1.0);
out2 = vec4(1.0, 1.0, 0.0, 1.0);
}
// [config]
// expect_result: fail
// glsl_version: 1.40
// require_extensions: GL_ARB_separate_shader_objects
// check_link: true
// [end config]
//
// Test for explicit varying location overlap by arrays
#version 140
#extension GL_ARB_separate_shader_objects : require
uniform int i;
layout(location = 0) in vec4 out1[2];
layout(location = 1) in vec4 out2;
out vec4 color;
void main()
{
if (i == 0)
color = out1[0];
else if (i == 1)
color = out1[1];
else
color = out2;
}
// [config]
// expect_result: fail
// glsl_version: 1.40
// require_extensions: GL_ARB_separate_shader_objects
// check_link: true
// [end config]
//
// Test for explicit varying location overlap by arrays
[require]
GLSL >= 1.40
GL_ARB_separate_shader_objects
[vertex shader]
#version 140
#extension GL_ARB_separate_shader_objects : require
......@@ -20,27 +21,3 @@ void main()
out1[1] = vec4(1.0, 1.0, 0.0, 1.0);
out2 = vec4(0.0);
}
[fragment shader]
#version 140
#extension GL_ARB_separate_shader_objects : require
uniform int i;
layout(location = 0) in vec4 out1[2];
layout(location = 1) in vec4 out2;
out vec4 color;
void main()
{
if (i == 0)
color = out1[0];
else if (i == 1)
color = out1[1];
else
color = out2;
}
[test]
link error
// [config]
// expect_result: fail
// glsl_version: 1.40
// require_extensions: GL_ARB_separate_shader_objects GL_ARB_arrays_of_arrays
// check_link: true
// [end config]
//
// Test for explicit varying location overlap by arrays of arrays
#version 140
#extension GL_ARB_separate_shader_objects : require
#extension GL_ARB_arrays_of_arrays : require
uniform int i;
layout(location = 0) in vec4 out1[2][2];
layout(location = 3) in vec4 out2;
out vec4 color;
void main()
{
if (i == 0)
color = out1[0][0];
else if (i == 1)
color = out1[0][1];
else if (i == 2)
color = out1[1][0];
else if (i == 3)
color = out1[1][1];
else
color = out2;
}
// [config]
// expect_result: fail
// glsl_version: 1.40
// require_extensions: GL_ARB_separate_shader_objects GL_ARB_arrays_of_arrays
// check_link: true
// [end config]
//
// Test for explicit varying location overlap by arrays of arrays
[require]
GLSL >= 1.40
GL_ARB_separate_shader_objects
GL_ARB_arrays_of_arrays
[vertex shader]
#version 140
#extension GL_ARB_separate_shader_objects : require
#extension GL_ARB_arrays_of_arrays : require
......@@ -24,32 +24,3 @@ void main()
out1[1][1] = vec4(1.0, 1.0, 1.0, 1.0);
out2 = vec4(0.0);
}
[fragment shader]
#version 140
#extension GL_ARB_separate_shader_objects : require
#extension GL_ARB_arrays_of_arrays : require
uniform int i;
layout(location = 0) in vec4 out1[2][2];
layout(location = 3) in vec4 out2;
out vec4 color;
void main()
{
if (i == 0)
color = out1[0][0];
else if (i == 1)
color = out1[0][1];
else if (i == 2)
color = out1[1][0];
else if (i == 3)
color = out1[1][1];
else
color = out2;
}
[test]
link error
// [config]
// expect_result: fail
// glsl_version: 1.40
// require_extensions: GL_ARB_separate_shader_objects
// check_link: true
// [end config]
//
// From the ARB_separate_shader_objects spec v.25:
//
// " A program will fail to link if any two non-vertex shader input
// variables are assigned to the same location."
#version 140
#extension GL_ARB_separate_shader_objects : require
uniform int i;
layout(location = 0) in mat2x4 in1;
layout(location = 1) in vec4 in2;
out vec4 color;
void main()
{
if (i == 0)
color = in1[0];
else if (i == 1)
color = in1[1];
else
color = in2;
}
// [config]
// expect_result: fail
// glsl_version: 1.40
// require_extensions: GL_ARB_separate_shader_objects
// check_link: true
// [end config]
//
// From the ARB_separate_shader_objects spec v.25:
//
// " 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
......@@ -23,27 +24,3 @@ void main()
out1[1] = vec4(1.0, 1.0, 0.0, 1.0);
out2 = vec4(0.0);
}
[fragment shader]
#version 140
#extension GL_ARB_separate_shader_objects : require
uniform int i;
layout(location = 0) in mat2x4 in1;
layout(location = 1) in vec4 in2;
out vec4 color;
void main()
{
if (i == 0)
color = in1[0];
else if (i == 1)
color = in1[1];
else
color = in2;
}
[test]
link error
// [config]
// expect_result: fail
// glsl_version: 1.50
// require_extensions: GL_ARB_separate_shader_objects GL_ARB_gpu_shader_fp64
// check_link: true
// [end config]
//
// From the ARB_separate_shader_objects spec v.25:
//
// " * An output variable is considered to match an input variable
......@@ -13,28 +20,6 @@
//
// " 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
......@@ -53,6 +38,3 @@ void main()
else
color = vec4(in2);
}
[test]
link error
// [config]
// expect_result: fail
// glsl_version: 1.50
// require_extensions: GL_ARB_separate_shader_objects GL_ARB_gpu_shader_fp64
// check_link: true
// [end config]
//
// 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."
#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;
layout(location = 0) flat out dvec4 out2;
void main()
{
gl_Position = piglit_vertex;
out1 = dvec4(1.0, 0.0, 0.0, 1.0);
out2 = dvec4(1.0, 1.0, 0.0, 1.0);
}
// [config]
// expect_result: fail
// glsl_version: 1.50
// require_extensions: GL_ARB_separate_shader_objects
// check_link: true
// [end config]
//
// Test for explicit varying location overlap by interface blocks
#version 150
#extension GL_ARB_separate_shader_objects : require
uniform int i;
layout(location = 0) in Block {
vec4 out1;
vec4 out2;
} b;
layout(location = 1) in vec4 out3;
out vec4 color;
void main()
{
if (i == 0)
color = b.out1;
else if (i == 1)
color = b.out2;
else
color = out3;
}
// [config]
// expect_result: fail
// glsl_version: 1.50
// require_extensions: GL_ARB_separate_shader_objects
// check_link: true
// [end config]
//
// Test for explicit varying location overlap by interface blocks
[require]
GLSL >= 1.50
GL_ARB_separate_shader_objects
[vertex shader]
#version 150
#extension GL_ARB_separate_shader_objects : require
......@@ -24,31 +25,3 @@ void main()
b.out2 = vec4(1.0, 1.0, 0.0, 1.0);
out3 = vec4(0.0);
}
[fragment shader]
#version 150
#extension GL_ARB_separate_shader_objects : require
uniform int i;
layout(location = 0) in Block {
vec4 out1;
vec4 out2;
} b;
layout(location = 1) in vec4 out3;
out vec4 color;
void main()
{
if (i == 0)
color = b.out1;
else if (i == 1)
color = b.out2;
else
color = out3;
}
[test]
link error
// [config]
// expect_result: fail
// glsl_version: 1.50
// require_extensions: GL_ARB_separate_shader_objects GL_ARB_gpu_shader_fp64
// check_link: true
// [end config]
//
// From the ARB_separate_shader_objects spec v.25:
//
// " A program will fail to link if any two non-vertex shader input
// variables are assigned to the same location."
#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 = 1) flat in dvec2 in2;
out vec4 color;
void main()
{
if (i == 0)
color = vec4(in1);
else
color = vec4(in2, in2);
}
// [config]
// expect_result: fail
// glsl_version: 1.50
// require_extensions: GL_ARB_separate_shader_objects GL_ARB_gpu_shader_fp64
// check_link: true
// [end config]
//
// From the ARB_separate_shader_objects spec v.25:
//
// " 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
......@@ -24,26 +24,3 @@ void main()
out1 = dvec4(1.0, 0.0, 0.0, 1.0);
out2 = dvec2(0.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 = 1) flat in dvec2 in2;
out vec4 color;
void main()
{
if (i == 0)
color = vec4(in1);
else
color = vec4(in2, in2);
}
[test]
link error
// [config]
// expect_result: fail
// glsl_version: 1.50
// require_extensions: GL_ARB_separate_shader_objects
// check_link: true
// [end config]
//
// Test for explicit varying location overlap by structs
#version 150
#extension GL_ARB_separate_shader_objects : require
uniform int i;
layout(location = 0) in struct S {
vec4 out1;
vec4 out2;
} s;
layout(location = 1) in vec4 out3;
out vec4 color;
void main()
{
if (i == 0)
color = s.out1;
else if (i == 1)
color = s.out2;
else
color = out3;
}
// [config]
// expect_result: fail
// glsl_version: 1.50
// require_extensions: GL_ARB_separate_shader_objects
// check_link: true
// [end config]
//
// Test for explicit varying location overlap by structs
[require]
GLSL >= 1.50
GL_ARB_separate_shader_objects
[vertex shader]
#version 150
#extension GL_ARB_separate_shader_objects : require
......@@ -24,31 +25,3 @@ void main()
s.out2 = vec4(1.0, 1.0, 0.0, 1.0);
out3 = vec4(0.0);
}
[fragment shader]
#version 150
#extension GL_ARB_separate_shader_objects : require
uniform int i;
layout(location = 0) in struct S {
vec4 out1;
vec4 out2;
} s;
layout(location = 1) in vec4 out3;
out vec4 color;
void main()
{
if (i == 0)
color = s.out1;
else if (i == 1)
color = s.out2;
else
color = out3;
}
[test]
link error
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment