Commit 580058ed authored by Ian Romanick's avatar Ian Romanick
Browse files

Add piles of GL_ARB_explicit_attrib_location compiler tests

Also move the existing tests to the ARB_explicit_attrib_location test
group.
parent 2a0609e3
......@@ -679,11 +679,6 @@ add_plain_test(shaders, 'glsl-fwidth')
add_plain_test(shaders, 'glsl-lod-bias')
add_plain_test(shaders, 'vp-ignore-input')
add_plain_test(shaders, 'glsl-empty-vs-no-fs')
add_plain_test(shaders, 'glsl-explicit-location-01')
add_plain_test(shaders, 'glsl-explicit-location-02')
add_plain_test(shaders, 'glsl-explicit-location-03')
add_plain_test(shaders, 'glsl-explicit-location-04')
add_plain_test(shaders, 'glsl-explicit-location-05')
add_plain_test(shaders, 'glsl-useprogram-displaylist')
add_plain_test(shaders, 'glsl-vs-point-size')
add_plain_test(shaders, 'glsl-light-model')
......@@ -938,6 +933,20 @@ import_glsl_parser_tests(spec['ARB_shader_texture_lod'],
os.path.dirname(__file__) + '/spec/arb_shader_texture_lod',
[''])
# Group ARB_explicit_attrib_location
arb_explicit_attrib_location = Group()
spec['ARB_explicit_attrib_location'] = arb_explicit_attrib_location
import_glsl_parser_tests(arb_explicit_attrib_location,
os.path.dirname(__file__)
+ '/spec/arb_explicit_attrib_location',
[''])
add_plain_test(arb_explicit_attrib_location, 'glsl-explicit-location-01')
add_plain_test(arb_explicit_attrib_location, 'glsl-explicit-location-02')
add_plain_test(arb_explicit_attrib_location, 'glsl-explicit-location-03')
add_plain_test(arb_explicit_attrib_location, 'glsl-explicit-location-04')
add_plain_test(arb_explicit_attrib_location, 'glsl-explicit-location-05')
arb_texture_rectangle = Group()
spec['ARB_texture_rectangle'] = arb_texture_rectangle;
add_texwrap_test1(arb_texture_rectangle, 'RECT')
......
// [config]
// expect_result: fail
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
//
// The 'location' layout qualifier can only be used with 'in' and 'out'.
#version 110
#extension GL_ARB_explicit_attrib_location: require
layout(location = 0) attribute vec4 vertex;
void main()
{
gl_Position = vertex;
}
// [config]
// expect_result: pass
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
//
// "in" is allowed in shader input declarations in GLSL 1.10 when
// GL_ARB_explicit_attrib_location is enabled
#version 110
#extension GL_ARB_explicit_attrib_location: require
in vec4 color;
void main()
{
gl_FragColor = color;
}
// [config]
// expect_result: pass
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
//
// "in" is allowed in shader input declarations in GLSL 1.10 when
// GL_ARB_explicit_attrib_location is enabled
#version 110
#extension GL_ARB_explicit_attrib_location: require
in vec4 vertex;
void main()
{
gl_Position = vertex;
}
// [config]
// expect_result: fail
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
//
// "in" is not allowed on function local variables in GLSL 1.10 even when
// GL_ARB_explicit_attrib_location is enabled
#version 110
#extension GL_ARB_explicit_attrib_location: require
in vec4 color;
void main()
{
in vec4 foo;
gl_FragColor = color;
}
// [config]
// expect_result: fail
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
//
// "in" is not allowed on function local variables in GLSL 1.10 even when
// GL_ARB_explicit_attrib_location is enabled
#version 110
#extension GL_ARB_explicit_attrib_location: require
in vec4 vertex;
void main()
{
in vec4 foo;
gl_Position = vertex;
}
// [config]
// expect_result: fail
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
//
// GL_ARB_explicit_attrib_location interacts with the 'centroid' qualifier,
// but it does not make it available in 1.10 shaders.
#version 110
#extension GL_ARB_explicit_attrib_location: require
centroid in vec4 color;
void main()
{
gl_FragColor = color;
}
// [config]
// expect_result: pass
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
//
// From the GL_ARB_explicit_attrib_location spec:
//
// "Vertex shaders allow input layout qualifiers on input variable
// declarations."
//
// Just as output layouts are not allowed in vertex shaders, input
// layouts are not allowed in fragment shaders.
#version 110
#extension GL_ARB_explicit_attrib_location: require
layout(location = 0) in vec4 color;
void main()
{
gl_FragColor = color;
}
// [config]
// expect_result: pass
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
//
// "out" is allowed in fragment shader output declarations in GLSL 1.10 when
// GL_ARB_explicit_attrib_location is enabled
#version 110
#extension GL_ARB_explicit_attrib_location: require
layout(location = 0) out vec4 color;
void main()
{
color = vec4(1.0);
}
// [config]
// expect_result: pass
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
#version 110
#extension GL_ARB_explicit_attrib_location: require
layout(location = 0) in vec4 vertex;
void main()
{
gl_Position = vertex;
}
// [config]
// expect_result: fail
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
//
// 'location' must be an integer constant
#version 110
#extension GL_ARB_explicit_attrib_location: require
layout(location = 0.0) out vec4 color;
void main()
{
color = vec4(1.0);
}
// [config]
// expect_result: fail
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
//
// 'location' must be an integer constant
#version 110
#extension GL_ARB_explicit_attrib_location: require
layout(location = 0.0) in vec4 vertex;
void main()
{
gl_Position = vertex;
}
// [config]
// expect_result: pass
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
//
// 'location' must be an integer constant
#version 110
#extension GL_ARB_explicit_attrib_location: require
#define X 1
layout(location = X) out vec4 color;
void main()
{
color = vec4(1.0);
}
// [config]
// expect_result: pass
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
//
// 'location' must be an integer constant
#version 110
#extension GL_ARB_explicit_attrib_location: require
#define X 1
layout(location = X) in vec4 vertex;
void main()
{
gl_Position = vertex;
}
// [config]
// expect_result: fail
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
//
// 'location' must be an integer constant
#version 110
#extension GL_ARB_explicit_attrib_location: require
layout(location = 1 - 1) out vec4 color;
void main()
{
color = vec4(1.0);
}
// [config]
// expect_result: fail
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
//
// 'location' must be an integer constant
#version 110
#extension GL_ARB_explicit_attrib_location: require
layout(location = 1 - 1) in vec4 vertex;
void main()
{
gl_Position = vertex;
}
// [config]
// expect_result: fail
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
//
// The 'layout' qualifier must come before 'in' or 'out'
#version 110
#extension GL_ARB_explicit_attrib_location: require
out layout(location = 0) vec4 color;
void main()
{
color = vec4(1.0);
}
// [config]
// expect_result: fail
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
//
// The 'layout' qualifier must come before 'in' or 'out'
#version 110
#extension GL_ARB_explicit_attrib_location: require
in layout(location = 0) vec4 vertex;
void main()
{
gl_Position = vertex;
}
// [config]
// expect_result: pass
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
#version 110
#extension GL_ARB_explicit_attrib_location: require
layout(location = 01) out vec4 color;
void main()
{
color = vec4(1.0);
}
// [config]
// expect_result: pass
// glsl_version: 1.10
// extension: GL_ARB_explicit_attrib_location
// [end config]
#version 110
#extension GL_ARB_explicit_attrib_location: require
layout(location = 01) in vec4 vertex;
void main()
{
gl_Position = vertex;
}
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