Commit 4b925c82 authored by Andres Gomez's avatar Andres Gomez

arb_enhanced_layouts: correct component usage with dvec{3,4} tests

There was a pre-existing test using "component = 0" with dvec3 which
was not failing as it should. This was because the other tests
checking for the usage of the component keyword with dvec3 and dvec4
were failing due to a different restriction: the component sequence
was overflowing 3 and/or a double based type was using component 1 o
3.

Now we fix them by using "component = 0" when need to fail and
removing the keyword when need to succeed.

From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:

  " It is a compile-time error if this sequence of components gets
    larger than 3. A scalar double will consume two of these
    components, and a dvec2 will consume all four components available
    within a location. A dvec3 or dvec4 can only be declared without
    specifying a component."

...

  " It is a compile-time error to use component 1 or 3 as the
    beginning of a double or dvec2."

Cc: Timothy Arceri <tarceri@itsqueeze.com>
Cc: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Andres Gomez's avatarAndres Gomez <agomez@igalia.com>
Reviewed-by: Timothy Arceri's avatarTimothy Arceri <tarceri@itsqueeze.com>
parent 140cb0ee
......@@ -13,7 +13,7 @@
#extension GL_ARB_gpu_shader_fp64: require
#extension GL_ARB_separate_shader_objects: require
layout(location = 0, component = 1) out dvec3 b;
layout(location = 0, component = 0) out dvec3 b;
void main()
{
......
......@@ -13,7 +13,7 @@
#extension GL_ARB_gpu_shader_fp64: require
#extension GL_ARB_separate_shader_objects: require
layout(location = 0, component = 1) out dvec4 b;
layout(location = 0, component = 0) out dvec4 b;
void main()
{
......
......@@ -13,7 +13,7 @@ GL_ARB_gpu_shader_fp64
#extension GL_ARB_gpu_shader_fp64: require
// XYZW components of 0 & 2, XY components of 1 & 3
layout(location = 0, component = 0) flat out dvec3 a[2];
layout(location = 0) flat out dvec3 a[2];
// ZW component of 1
layout(location = 1, component = 2) flat out double b;
......@@ -38,7 +38,7 @@ void main()
out vec4 color;
// XYZW components of 0 & 2, XY components of 1 & 3
layout(location = 0, component = 0) flat in dvec3 a[2];
layout(location = 0) flat in dvec3 a[2];
// ZW component of 1
layout(location = 1, component = 2) flat in double b;
......
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