[Piglit] [PATCH 2/2] Add compiler tests for overlapping attribute locations

Anuj Phogat anuj.phogat at gmail.com
Fri May 16 17:26:35 PDT 2014


On Fri, May 16, 2014 at 4:39 PM, Jordan Justen <jljusten at gmail.com> wrote:
> Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
For both the patches or just this one?
First one is:  "PATCH [1/2] Add test to verify overlapping locations of vertex
input attributes"
>
> On Mon, Mar 10, 2014 at 11:38 AM, Anuj Phogat <anuj.phogat at gmail.com> wrote:
>> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
>> ---
>>  .../compiler/overlapping-attrib-locations-1.vert   | 28 ++++++++++++++++++++++
>>  .../compiler/overlapping-attrib-locations-2.vert   | 28 ++++++++++++++++++++++
>>  2 files changed, 56 insertions(+)
>>  create mode 100644 tests/spec/arb_explicit_attrib_location/1.10/compiler/overlapping-attrib-locations-1.vert
>>  create mode 100644 tests/spec/arb_explicit_attrib_location/1.10/compiler/overlapping-attrib-locations-2.vert
>>
>> diff --git a/tests/spec/arb_explicit_attrib_location/1.10/compiler/overlapping-attrib-locations-1.vert b/tests/spec/arb_explicit_attrib_location/1.10/compiler/overlapping-attrib-locations-1.vert
>> new file mode 100644
>> index 0000000..af3b8ae
>> --- /dev/null
>> +++ b/tests/spec/arb_explicit_attrib_location/1.10/compiler/overlapping-attrib-locations-1.vert
>> @@ -0,0 +1,28 @@
>> +// [config]
>> +// expect_result: pass
>> +// glsl_version: 1.10
>> +// check_link: true
>> +// [end config]
>> +//
>> +// Binding more than one attribute name to the same location is referred
>> +// to as aliasing. It is allowed only on vertex shader input variables
>> +// in OpenGL (2.0 and above). Check that vertex shader compiles and links
>> +// successfully in case of overlapping input attribute locations. This
>> +// shader uses attributes of same size with same locations.
>> +
>> +#version 110
>> +#extension  GL_ARB_explicit_attrib_location : require
>> +
>> +layout(location=0) in vec4 p0;
>> +layout(location=0) in vec4 p1;
>> +uniform int x;
>> +
>> +void main()
>> +{
>> +    if (x == 0)
>> +       gl_Position = p0;
>> +    else if (x == 1)
>> +       gl_Position = p1;
>> +    else
>> +       gl_Position = vec4(0.0);
>> +}
>> diff --git a/tests/spec/arb_explicit_attrib_location/1.10/compiler/overlapping-attrib-locations-2.vert b/tests/spec/arb_explicit_attrib_location/1.10/compiler/overlapping-attrib-locations-2.vert
>> new file mode 100644
>> index 0000000..81af940
>> --- /dev/null
>> +++ b/tests/spec/arb_explicit_attrib_location/1.10/compiler/overlapping-attrib-locations-2.vert
>> @@ -0,0 +1,28 @@
>> +// [config]
>> +// expect_result: pass
>> +// glsl_version: 1.10
>> +// check_link: true
>> +// [end config]
>> +//
>> +// Binding more than one attribute name to the same location is referred
>> +// to as aliasing. It is allowed only on vertex shader input variables
>> +// in OpenGL (2.0 and above). Check that vertex shader compiles and links
>> +// successfully in case of overlapping input attribute locations. This
>> +// shader uses attributes of different sizes with overlapping locations.
>> +
>> +#version 110
>> +#extension  GL_ARB_explicit_attrib_location : require
>> +
>> +layout(location=0) in mat4 mat;
>> +layout(location=3) in vec4 p;
>> +uniform int x;
>> +
>> +void main()
>> +{
>> +    if (x == 0)
>> +       gl_Position = mat * vec4(1.0);
>> +    else if (x == 1)
>> +       gl_Position = p;
>> +    else
>> +       gl_Position = vec4(0.0);
>> +}
>> --
>> 1.8.3.1
>>
>> _______________________________________________
>> Piglit mailing list
>> Piglit at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list