[Piglit] [PATCH] tex-miplevel-selection: force compatibility when using 430 shader

2019-02-01 Thread Ilia Mirkin
Mesa will only consider the shader a compat shader if it has an explicit
"compatibility" token in the version. Without this, we don't get
gl_TexCoord, used by the test.

Signed-off-by: Ilia Mirkin 
---

I guess this gets skipped on Intel, since it wants a 430 compat context.
But it should also be failing on RadeonSI. Noticed the failure on
nouveau.

 tests/texturing/tex-miplevel-selection.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/texturing/tex-miplevel-selection.c 
b/tests/texturing/tex-miplevel-selection.c
index 7c0283cbd..d13ebb156 100644
--- a/tests/texturing/tex-miplevel-selection.c
+++ b/tests/texturing/tex-miplevel-selection.c
@@ -326,7 +326,7 @@ piglit_init(int argc, char **argv)
if (target == TEX_2D_ARRAY_SHADOW &&
test == GL3_TEXTURE_OFFSET) {
piglit_require_GLSL_version(430);
-   version = "430";
+   version = "430 compatibility";
}
 
switch (target) {
-- 
2.19.2

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 05/10] arb_enhanced_layouts: correct component usage with dvec{3, 4} tests

2019-02-01 Thread Timothy Arceri

Reviewed-by: Timothy Arceri 

On 2/2/19 4:55 am, Andres Gomez wrote:

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 
Cc: Kenneth Graunke 
Signed-off-by: Andres Gomez 
---
  .../arb_enhanced_layouts/compiler/component-layout/dvec3.vert | 2 +-
  .../arb_enhanced_layouts/compiler/component-layout/dvec4.vert | 2 +-
  .../execution/component-layout/vs-fs-array-dvec3.shader_test  | 4 ++--
  3 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec3.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec3.vert
index 84eaf3ef7..fcb2a5284 100644
--- a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec3.vert
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec3.vert
@@ -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()

  {
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec4.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec4.vert
index 3c6216310..78696f18d 100644
--- a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec4.vert
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec4.vert
@@ -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()

  {
diff --git 
a/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3.shader_test
 
b/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3.shader_test
index de348cbb3..ebd18ad5d 100644
--- 
a/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3.shader_test
+++ 
b/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3.shader_test
@@ -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;


___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 06/10] arb_separate_shader_objects: add location overlapping tests

2019-02-01 Thread Timothy Arceri

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 = 

Re: [Piglit] [PATCH 08/10] arb_separate_shader_objects: add unused location qualified input test

2019-02-01 Thread Timothy Arceri

Reviewed-by: Timothy Arceri 

On 2/2/19 4:55 am, Andres Gomez wrote:

New tests to check that an unused input varying, which would be
matched based on its explicit location, won't cause a link failure if
there is no matching output variable.

 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."

   ...

   " For program objects containing multiple shaders, LinkProgram will
 check for mismatches on interfaces between shader stages in the
 program being linked and generate a link error if a mismatch is
 detected.  A link error will be generated if any statically
 referenced input variable or block does not have a matching
 output."

Cc: Timothy Arceri 
Cc: Iago Toral Quiroga 
Cc: Samuel Iglesias Gonsálvez 
Cc: Tapani Pälli 
Cc: Ian Romanick 
Signed-off-by: Andres Gomez 
---
  ...explicit-location-unused-input.shader_test | 38 +++
  1 file changed, 38 insertions(+)
  create mode 100644 
tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test

diff --git 
a/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test
 
b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test
new file mode 100644
index 0..c39fd4033
--- /dev/null
+++ 
b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test
@@ -0,0 +1,38 @@
+// 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."
+//
+//   ...
+//
+//   " For program objects containing multiple shaders, LinkProgram
+// will check for mismatches on interfaces between shader stages
+// in the program being linked and generate a link error if a
+// mismatch is detected.  A link error will be generated if any
+// statically referenced input variable or block does not have a
+// matching output."
+
+[require]
+GLSL >= 1.40
+GL_ARB_separate_shader_objects
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 140
+#extension GL_ARB_separate_shader_objects : require
+
+layout(location = 0) in vec4 in1;
+
+void main()
+{
+}
+
+[test]
+link success


___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 10/10] arb_enhanced_layouts: add xfb_offset overlap test

2019-02-01 Thread Andres Gomez
From the GL_ARB_enhanced_layouts spec:

  " No aliasing in output buffers is allowed: It is a compile-time or
link-time error to specify variables with overlapping transform
feedback offsets."

Cc: Timothy Arceri 
Signed-off-by: Andres Gomez 
---
 .../xfb_offset/invalid-overlap.vert   | 23 +++
 1 file changed, 23 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_offset/invalid-overlap.vert

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_offset/invalid-overlap.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_offset/invalid-overlap.vert
new file mode 100644
index 0..0c523378b
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_offset/invalid-overlap.vert
@@ -0,0 +1,23 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//   " No aliasing in output buffers is allowed: It is a compile-time
+// or link-time error to specify variables with overlapping
+// transform feedback offsets."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_offset = 0) out vec4 a;
+layout(xfb_offset = 0) out vec4 b;
+
+void main()
+{
+  a = vec4(1.0);
+  b = vec4(0.0);
+}
-- 
2.20.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 09/10] arb_enhanced_layouts: add another xfb_stride overflow test

2019-02-01 Thread Andres Gomez
Additional check to address a bug in mesa in which a stride which
is a divisor of the declared offset for an overflowing varying
won't fail.

From the GL_ARB_enhanced_layouts spec:

  " It is a compile-time or link-time error to have any *xfb_offset*
that overflows *xfb_stride*, whether stated on declarations before
or after the *xfb_stride*, or in different compilation units."

Cc: Timothy Arceri 
Signed-off-by: Andres Gomez 
---
 .../xfb_stride/variable-stride-overflow2.vert | 28 +++
 1 file changed, 28 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_stride/variable-stride-overflow2.vert

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_stride/variable-stride-overflow2.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_stride/variable-stride-overflow2.vert
new file mode 100644
index 0..469c5e430
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_stride/variable-stride-overflow2.vert
@@ -0,0 +1,28 @@
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// check_link: true
+// require_extensions: GL_ARB_enhanced_layouts
+// [end config]
+//
+// Additional check to address a bug in mesa in which a stride which
+// is a divisor of the declared offset for an overflowing varying
+// won't fail.
+//
+// From the GL_ARB_enhanced_layouts spec:
+//
+//"It is a compile-time or link-time error to have any *xfb_offset*
+//that overflows *xfb_stride*, whether stated on declarations before or
+//after the *xfb_stride*, or in different compilation units."
+
+#version 140
+#extension GL_ARB_enhanced_layouts: require
+
+layout(xfb_stride = 16) out vec4 var;
+layout(xfb_offset = 16) out vec4 var2;
+
+void main()
+{
+  var = vec4(1.0);
+  var2 = vec4(0.0);
+}
-- 
2.20.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 04/10] arb_enhanced_layouts: add aliasing tests with mixed type widths

2019-02-01 Thread Andres Gomez
Added tests which check component aliasing between types that have
different bit widths.

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

"Further, when location aliasing, the aliases sharing the location
 must have the same underlying numerical type and bit
 width (floating-point or integer, 32-bit versus 64-bit, etc.)
 and the same auxiliary storage and interpolation
 qualification. The one exception where component aliasing is
 permitted is for two input variables (not block members) to a
 vertex shader, which are allowed to have component aliasing. This
 vertex-variable component aliasing is intended only to support
 vertex shaders where each execution path accesses at most one
 input per each aliased component. Implementations are permitted,
 but not required, to generate link-time errors if they detect
 that every path through the vertex shader executable accesses
 multiple inputs aliased to any single component."

Cc: Timothy Arceri 
Cc: Iago Toral Quiroga 
Cc: Ilia Mirkin 
Signed-off-by: Andres Gomez 
---
 .../type-mismatch-signed-double.vert  | 59 +++
 .../width-mismatch-float-double.vert  | 59 +++
 ...s-width-mismatch-double-float.shader_test} | 25 
 3 files changed, 131 insertions(+), 12 deletions(-)
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-double.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/width-mismatch-float-double.vert
 rename 
tests/spec/arb_enhanced_layouts/linker/component-layout/{vs-to-fs-type-mismatch-double-float.shader_test
 => vs-to-fs-width-mismatch-double-float.shader_test} (56%)

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-double.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-double.vert
new file mode 100644
index 0..01bfb0df1
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-double.vert
@@ -0,0 +1,59 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// check_link: true
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location 
GL_ARB_gpu_shader_fp64 GL_ARB_vertex_attrib_64bit
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
+//
+//   "Further, when location aliasing, the aliases sharing the location must
+//   have the same underlying numerical type (floating-point or integer) and
+//   the same auxiliary storage and interpolation qualification"
+//
+//   ...
+//
+//   "The one exception where component aliasing is permitted is for two input
+//   variables (not block members) to a vertex shader, which are allowed to
+//   have component aliasing. This vertex-variable component aliasing is
+//   intended only to support vertex shaders where each execution path
+//   accesses at most one input per each aliased component.  Implementations
+//   are permitted, but not required, to generate link-time errors if they
+//   detect that every path through the vertex shader executable accesses
+//   multiple inputs aliased to any single component."
+//
+//   Issue 16 from the ARB_enhanced_layouts spec:
+//
+//   "We do allow this for vertex shader inputs, because we've supported
+//   "aliasing" behavior since OpenGL 2.0. This allows for an "uber-shader"
+//with variables like:
+//
+//  layout(location=3) in float var1;
+//  layout(location=3) in int var2;
+//
+//   where sometimes it uses  and sometimes .  Since we don't
+//   treat the code above (with overlapping components) as an error, it
+//   would be strange to treat non-overlapping component assignments as an
+//   error."
+
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_explicit_attrib_location: require
+#extension GL_ARB_gpu_shader_fp64: require
+#extension GL_ARB_vertex_attrib_64bit: require
+
+uniform int i;
+
+// consume X/Y components
+layout(location = 0) in ivec2 a;
+
+// consume Z/W components
+layout(location = 0, component = 2) in double b;
+
+void main()
+{
+  if (i == 1)
+gl_Position = vec4(a, 1.0, 1.0);
+  else
+gl_Position = vec4(b);
+}
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/width-mismatch-float-double.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/width-mismatch-float-double.vert
new file mode 100644
index 0..74926c1ea
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/width-mismatch-float-double.vert
@@ -0,0 +1,59 @@
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// check_link: true
+// require_extensions: GL_ARB_enhanced_layouts GL_ARB_explicit_attrib_location 
GL_ARB_gpu_shader_fp64 GL_ARB_vertex_attrib_64bit
+// [end config]
+//
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.60 spec:
+//

[Piglit] [PATCH 07/10] arb_enhanced_layouts: add component aliasing tests

2019-02-01 Thread Andres Gomez
New tests for component aliasing with duplicated inputs which match
the same output variable in the previous stage.

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

  " Location aliasing is causing two variables or block members to
have the same location number. Component aliasing is assigning the
same (or overlapping) component numbers for two location
aliases. (Recall if component is not used, components are assigned
starting with 0.) With one exception, location aliasing is allowed
only if it does not cause component aliasing; it is a compile-time
or link-time error to cause component aliasing."

From Section 7.4.1 (Shader Interface Matching) of the OpenGL 4.60 spec:

  "   * An output variable is considered to match an input variable in
the subsequent shader if:

– the two variables match in name, type, and qualification,
  and neither has a location qualifier, or

– the two variables are declared with the same location and
  component layout qualifiers and match in type and
  qualification."

Cc: Timothy Arceri 
Cc: Iago Toral Quiroga 
Cc: Ilia Mirkin 
Signed-off-by: Andres Gomez 
---
 ...uplicated-input-overlap-double.shader_test | 62 +++
 ...to-fs-duplicated-input-overlap.shader_test | 59 ++
 2 files changed, 121 insertions(+)
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-duplicated-input-overlap-double.shader_test
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-duplicated-input-overlap.shader_test

diff --git 
a/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-duplicated-input-overlap-double.shader_test
 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-duplicated-input-overlap-double.shader_test
new file mode 100644
index 0..1c9117b9b
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-duplicated-input-overlap-double.shader_test
@@ -0,0 +1,62 @@
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.60 spec:
+//
+//   " Location aliasing is causing two variables or block members to
+// have the same location number. Component aliasing is assigning
+// the same (or overlapping) component numbers for two location
+// aliases. (Recall if component is not used, components are
+// assigned starting with 0.) With one exception, location
+// aliasing is allowed only if it does not cause component
+// aliasing; it is a compile-time or link-time error to cause
+// component aliasing."
+//
+// From Section 7.4.1 (Shader Interface Matching) of the OpenGL 4.60 spec:
+//
+//   "   * An output variable is considered to match an input variable
+// in the subsequent shader if:
+//
+// – the two variables match in name, type, and qualification,
+//   and neither has a location qualifier, or
+//
+// – the two variables are declared with the same location and
+//   component layout qualifiers and match in type and
+//   qualification."
+
+[require]
+GLSL >= 1.50
+GL_ARB_enhanced_layouts
+GL_ARB_gpu_shader_fp64
+GL_ARB_separate_shader_objects
+
+[vertex shader]
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_gpu_shader_fp64: require
+#extension GL_ARB_separate_shader_objects: require
+
+// consumes Z/W components
+layout(location = 0, component = 2) flat out double a;
+
+void main()
+{
+  a = 1.0;
+}
+
+[fragment shader]
+#version 150
+#extension GL_ARB_enhanced_layouts: require
+#extension GL_ARB_gpu_shader_fp64: require
+#extension GL_ARB_separate_shader_objects: require
+
+out vec4 color;
+
+// consumes Z/W components
+layout(location = 0, component = 2) flat in double b;
+layout(location = 0, component = 2) flat in double c;
+
+void main()
+{
+  color = vec4(c, b, 0.0, 1.0);
+}
+
+[test]
+link error
diff --git 
a/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-duplicated-input-overlap.shader_test
 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-duplicated-input-overlap.shader_test
new file mode 100644
index 0..3dea88a51
--- /dev/null
+++ 
b/tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-duplicated-input-overlap.shader_test
@@ -0,0 +1,59 @@
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.60 spec:
+//
+//   " Location aliasing is causing two variables or block members to
+// have the same location number. Component aliasing is assigning
+// the same (or overlapping) component numbers for two location
+// aliases. (Recall if component is not used, components are
+// assigned starting with 0.) With one exception, location
+// aliasing is allowed only if it does not cause component
+// aliasing; it is a compile-time or link-time error to cause
+// component aliasing."
+//
+// From Section 7.4.1 (Shader Interface Matching) of 

[Piglit] [PATCH 08/10] arb_separate_shader_objects: add unused location qualified input test

2019-02-01 Thread Andres Gomez
New tests to check that an unused input varying, which would be
matched based on its explicit location, won't cause a link failure if
there is no matching output variable.

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."

  ...

  " For program objects containing multiple shaders, LinkProgram will
check for mismatches on interfaces between shader stages in the
program being linked and generate a link error if a mismatch is
detected.  A link error will be generated if any statically
referenced input variable or block does not have a matching
output."

Cc: Timothy Arceri 
Cc: Iago Toral Quiroga 
Cc: Samuel Iglesias Gonsálvez 
Cc: Tapani Pälli 
Cc: Ian Romanick 
Signed-off-by: Andres Gomez 
---
 ...explicit-location-unused-input.shader_test | 38 +++
 1 file changed, 38 insertions(+)
 create mode 100644 
tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test

diff --git 
a/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test
 
b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test
new file mode 100644
index 0..c39fd4033
--- /dev/null
+++ 
b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test
@@ -0,0 +1,38 @@
+// 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."
+//
+//   ...
+//
+//   " For program objects containing multiple shaders, LinkProgram
+// will check for mismatches on interfaces between shader stages
+// in the program being linked and generate a link error if a
+// mismatch is detected.  A link error will be generated if any
+// statically referenced input variable or block does not have a
+// matching output."
+
+[require]
+GLSL >= 1.40
+GL_ARB_separate_shader_objects
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 140
+#extension GL_ARB_separate_shader_objects : require
+
+layout(location = 0) in vec4 in1;
+
+void main()
+{
+}
+
+[test]
+link success
-- 
2.20.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 06/10] arb_separate_shader_objects: add location overlapping tests

2019-02-01 Thread Andres Gomez
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 

[Piglit] [PATCH 02/10] arb_enhanced_layouts: GL_ARB_gpu_shader_fp64 requires GLSL 1.50

2019-02-01 Thread Andres Gomez
Cc: Timothy Arceri 
Signed-off-by: Andres Gomez 
---
 .../compiler/component-layout/double-component-1.vert | 4 ++--
 .../compiler/component-layout/double-component-3.vert | 4 ++--
 .../compiler/component-layout/dvec2.vert  | 4 ++--
 .../compiler/component-layout/dvec3.vert  | 4 ++--
 .../compiler/component-layout/dvec4.vert  | 4 ++--
 .../compiler/component-layout/overflow-double.vert| 4 ++--
 .../compiler/component-layout/overflow-dvec2.vert | 4 ++--
 .../component-layout/vs-fs-array-dvec3.shader_test| 6 +++---
 .../execution/component-layout/vs-fs-doubles.shader_test  | 6 +++---
 .../component-layout/vs-to-fs-double-overlap.shader_test  | 6 +++---
 .../vs-to-fs-type-mismatch-double-float.shader_test   | 8 
 11 files changed, 27 insertions(+), 27 deletions(-)

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/double-component-1.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/double-component-1.vert
index c8da16566..f0fb1616b 100644
--- 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/double-component-1.vert
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/double-component-1.vert
@@ -1,6 +1,6 @@
 // [config]
 // expect_result: fail
-// glsl_version: 1.40
+// glsl_version: 1.50
 // require_extensions: GL_ARB_enhanced_layouts GL_ARB_gpu_shader_fp64 
GL_ARB_separate_shader_objects
 // [end config]
 //
@@ -9,7 +9,7 @@
 //   "It is a compile-time error to use component 1 or 3 as the beginning of a
 //   double or dvec2."
 
-#version 140
+#version 150
 #extension GL_ARB_enhanced_layouts: require
 #extension GL_ARB_gpu_shader_fp64: require
 #extension GL_ARB_separate_shader_objects: require
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/double-component-3.vert
 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/double-component-3.vert
index d054cd2a5..3c0a197fc 100644
--- 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/double-component-3.vert
+++ 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/double-component-3.vert
@@ -1,6 +1,6 @@
 // [config]
 // expect_result: fail
-// glsl_version: 1.40
+// glsl_version: 1.50
 // require_extensions: GL_ARB_enhanced_layouts GL_ARB_gpu_shader_fp64 
GL_ARB_separate_shader_objects
 // [end config]
 //
@@ -9,7 +9,7 @@
 //   "It is a compile-time error to use component 1 or 3 as the beginning of a
 //   double or dvec2."
 
-#version 140
+#version 150
 #extension GL_ARB_enhanced_layouts: require
 #extension GL_ARB_gpu_shader_fp64: require
 #extension GL_ARB_separate_shader_objects: require
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec2.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec2.vert
index 090aac090..9cf96ea0d 100644
--- a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec2.vert
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec2.vert
@@ -1,6 +1,6 @@
 // [config]
 // expect_result: pass
-// glsl_version: 1.40
+// glsl_version: 1.50
 // require_extensions: GL_ARB_enhanced_layouts GL_ARB_gpu_shader_fp64 
GL_ARB_separate_shader_objects
 // [end config]
 //
@@ -10,7 +10,7 @@
 //   consume all four components available within a location. A dvec3 or dvec4
 //   can only be declared without specifying a component."
 
-#version 140
+#version 150
 #extension GL_ARB_enhanced_layouts: require
 #extension GL_ARB_gpu_shader_fp64: require
 #extension GL_ARB_separate_shader_objects: require
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec3.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec3.vert
index 192765809..84eaf3ef7 100644
--- a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec3.vert
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec3.vert
@@ -1,6 +1,6 @@
 // [config]
 // expect_result: fail
-// glsl_version: 1.40
+// glsl_version: 1.50
 // require_extensions: GL_ARB_enhanced_layouts GL_ARB_gpu_shader_fp64 
GL_ARB_separate_shader_objects
 // [end config]
 //
@@ -8,7 +8,7 @@
 //
 //   "A dvec3 or dvec4 can only be declared without specifying a component."
 
-#version 140
+#version 150
 #extension GL_ARB_enhanced_layouts: require
 #extension GL_ARB_gpu_shader_fp64: require
 #extension GL_ARB_separate_shader_objects: require
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec4.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec4.vert
index 35584170f..3c6216310 100644
--- a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec4.vert
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec4.vert
@@ -1,6 +1,6 @@
 // [config]
 // expect_result: fail
-// glsl_version: 1.40
+// glsl_version: 1.50
 // require_extensions: GL_ARB_enhanced_layouts GL_ARB_gpu_shader_fp64 
GL_ARB_separate_shader_objects
 // [end config]
 //
@@ -8,7 +8,7 @@
 //
 //   "A 

[Piglit] [PATCH 05/10] arb_enhanced_layouts: correct component usage with dvec{3, 4} tests

2019-02-01 Thread Andres Gomez
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 
Cc: Kenneth Graunke 
Signed-off-by: Andres Gomez 
---
 .../arb_enhanced_layouts/compiler/component-layout/dvec3.vert | 2 +-
 .../arb_enhanced_layouts/compiler/component-layout/dvec4.vert | 2 +-
 .../execution/component-layout/vs-fs-array-dvec3.shader_test  | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec3.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec3.vert
index 84eaf3ef7..fcb2a5284 100644
--- a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec3.vert
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec3.vert
@@ -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()
 {
diff --git 
a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec4.vert 
b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec4.vert
index 3c6216310..78696f18d 100644
--- a/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec4.vert
+++ b/tests/spec/arb_enhanced_layouts/compiler/component-layout/dvec4.vert
@@ -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()
 {
diff --git 
a/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3.shader_test
 
b/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3.shader_test
index de348cbb3..ebd18ad5d 100644
--- 
a/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3.shader_test
+++ 
b/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-fs-array-dvec3.shader_test
@@ -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;
-- 
2.20.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 01/10] arb_enhanced_layouts: corrected multiple comments

2019-02-01 Thread Andres Gomez
Cc: Timothy Arceri 
Signed-off-by: Andres Gomez 
---
 .../vs-gs-fs-double.shader_test   | 16 +++
 .../vs-tcs-tes-fs-double.shader_test  | 42 +--
 ...-fs-type-mismatch-double-float.shader_test |  4 +-
 ...-fs-type-mismatch-signed-float.shader_test |  4 +-
 ...-type-mismatch-signed-unsigned.shader_test |  4 +-
 ...s-type-mismatch-unsigned-float.shader_test |  4 +-
 6 files changed, 46 insertions(+), 28 deletions(-)

diff --git 
a/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-gs-fs-double.shader_test
 
b/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-gs-fs-double.shader_test
index bf5d6e8e6..1f753792a 100644
--- 
a/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-gs-fs-double.shader_test
+++ 
b/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-gs-fs-double.shader_test
@@ -12,10 +12,10 @@ GL_ARB_gpu_shader_fp64
 #extension GL_ARB_separate_shader_objects: require
 #extension GL_ARB_gpu_shader_fp64: require
 
-// consume X/Y/Z components
+// consume X/Y components in location 1
 layout(location = 0) flat out dvec3 a;
 
-// consumes W component
+// consume Z/W components
 layout(location = 1, component = 2) flat out double b;
 
 out vec4 vertex_to_gs;
@@ -39,18 +39,18 @@ void main()
 layout(triangles) in;
 layout(triangle_strip, max_vertices = 3) out;
 
-// consume X/Y/Z components
+// consume X/Y components in location 1
 layout(location = 0) flat in dvec3 a[3];
 
-// consumes W component
+// consume Z/W components
 layout(location = 1, component = 2) flat in double b[3];
 
 in vec4 vertex_to_gs[3];
 
-// consume X/Y/Z components
+// consume X/Y components in location 1
 layout(location = 0) flat out dvec3 a_to_fs;
 
-// consumes W component
+// consume Z/W components
 layout(location = 1, component = 2) flat out double b_to_fs;
 
 void main()
@@ -71,10 +71,10 @@ void main()
 
 out vec4 color;
 
-// consume X/Y/Z components
+// consume X/Y components in location 1
 layout(location = 0) flat in dvec3 a_to_fs;
 
-// consumes W component
+// consume Z/W components
 layout(location = 1, component = 2) flat in double b_to_fs;
 
 void main()
diff --git 
a/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-tcs-tes-fs-double.shader_test
 
b/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-tcs-tes-fs-double.shader_test
index 938d2703d..196729aab 100644
--- 
a/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-tcs-tes-fs-double.shader_test
+++ 
b/tests/spec/arb_enhanced_layouts/execution/component-layout/vs-tcs-tes-fs-double.shader_test
@@ -15,13 +15,16 @@ GL_ARB_gpu_shader_fp64
 
 in vec4 vertex;
 
-// consume Y/Z/W components
+// consume also X/Y components in location 1
 layout(location = 0) flat out dvec3 a;
 
-// consumes X component
+// consume Z/W components
 layout(location = 1, component = 2) flat out double b;
 
+// consume X/Y components
 layout(location = 2, component = 0) flat out double c;
+
+// consume Z/W components
 layout(location = 2, component = 2) flat out double d;
 
 void main()
@@ -44,22 +47,28 @@ void main()
 
 layout(vertices = 3) out;
 
-// consume Y/Z/W components
+// consume also X/Y components in location 1
 layout(location = 0) flat in dvec3 a[];
 
-// consumes X component
+// consume Z/W components
 layout(location = 1, component = 2) flat in double b[];
 
+// consume X/Y components
 layout(location = 2, component = 0) flat in double c[];
+
+// consume Z/W components
 layout(location = 2, component = 2) flat in double d[];
 
-// consume Y/Z/W components
+// consume also X/Y components in location 1
 layout(location = 0) flat out dvec3 a_tcs[];
 
-// consumes X component
+// consume Z/W components
 layout(location = 1, component = 2) flat out double b_tcs[];
 
+// consume X/Y components
 layout(location = 2, component = 0) flat out double c_tcs[];
+
+// consume Z/W components
 layout(location = 2, component = 2) flat out double d_tcs[];
 
 void main() {
@@ -82,22 +91,28 @@ void main() {
 
 layout(triangles) in;
 
-// consume Y/Z/W components
+// consume also X/Y components in location 1
 layout(location = 0) flat in dvec3 a_tcs[];
 
-// consumes X component
+// consume Z/W components
 layout(location = 1, component = 2) flat in double b_tcs[];
 
+// consume X/Y components
 layout(location = 2, component = 0) flat in double c_tcs[];
+
+// consume Z/W components
 layout(location = 2, component = 2) flat in double d_tcs[];
 
-// consume Y/Z/W components
+// consume also X/Y components in location 1
 layout(location = 0) flat out dvec3 a_tes;
 
-// consumes X component
+// consume Z/W components
 layout(location = 1, component = 2) flat out double b_tes;
 
+// consume X/Y components
 layout(location = 2, component = 0) flat out double c_tes;
+
+// consume Z/W components
 layout(location = 2, component = 2) flat out double d_tes;
 
 void main() {
@@ -119,13 +134,16 @@ void main() {
 
 out vec4 color;
 
-// consume Y/Z/W components
+// consume also X/Y components in 

[Piglit] [PATCH 00/10] arb_enhanced_layouts: additional tests

2019-02-01 Thread Andres Gomez
This series adds several arb_enhanced_layouts tests and some
arb_separate_shader_objects more addressing problems found in mesa and
not checked in piglit.

They are mostly related to the use of the location, component,
xfb_offset and xfb_stride layout qualifiers.

Andres Gomez (10):
  arb_enhanced_layouts: corrected multiple comments
  arb_enhanced_layouts: GL_ARB_gpu_shader_fp64 requires GLSL 1.50
  arb_enhanced_layouts: correct interpolation qualifiers
  arb_enhanced_layouts: add aliasing tests with mixed type widths
  arb_enhanced_layouts: correct component usage with dvec{3,4} tests
  arb_separate_shader_objects: add location overlapping tests
  arb_enhanced_layouts: add component aliasing tests
  arb_separate_shader_objects: add unused location qualified input test
  arb_enhanced_layouts: add another xfb_stride overflow test
  arb_enhanced_layouts: add xfb_offset overlap test

 .../component-layout/double-component-1.vert  |  4 +-
 .../component-layout/double-component-3.vert  |  4 +-
 .../compiler/component-layout/dvec2.vert  |  4 +-
 .../compiler/component-layout/dvec3.vert  |  6 +-
 .../compiler/component-layout/dvec4.vert  |  6 +-
 .../component-layout/overflow-double.vert |  4 +-
 .../component-layout/overflow-dvec2.vert  |  4 +-
 .../type-mismatch-signed-double.vert  | 59 ++
 .../width-mismatch-float-double.vert  | 59 ++
 .../xfb_offset/invalid-overlap.vert   | 23 +++
 .../xfb_stride/variable-stride-overflow2.vert | 28 +
 .../vs-fs-array-dvec3.shader_test | 10 +--
 .../vs-fs-doubles.shader_test |  6 +-
 .../vs-gs-fs-double.shader_test   | 16 ++---
 .../vs-tcs-tes-fs-double.shader_test  | 42 +
 .../vs-to-fs-double-overlap.shader_test   |  6 +-
 ...uplicated-input-overlap-double.shader_test | 62 +++
 ...to-fs-duplicated-input-overlap.shader_test | 59 ++
 ...t => vs-to-fs-signed-unsigned.shader_test} | 10 +--
 ...-fs-type-mismatch-double-float.shader_test | 59 --
 ...-fs-type-mismatch-signed-float.shader_test |  4 +-
 ...s-type-mismatch-unsigned-float.shader_test |  8 +--
 ...fs-width-mismatch-double-float.shader_test | 60 ++
 ...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 +++
 ...explicit-location-unused-input.shader_test | 38 
 28 files changed, 675 insertions(+), 117 deletions(-)
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/type-mismatch-signed-double.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/component-layout/width-mismatch-float-double.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_offset/invalid-overlap.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/compiler/transform-feedback-layout-qualifiers/xfb_stride/variable-stride-overflow2.vert
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-duplicated-input-overlap-double.shader_test
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-duplicated-input-overlap.shader_test
 rename 
tests/spec/arb_enhanced_layouts/linker/component-layout/{vs-to-fs-type-mismatch-signed-unsigned.shader_test
 => vs-to-fs-signed-unsigned.shader_test} (88%)
 delete mode 100644 
tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-type-mismatch-double-float.shader_test
 create mode 100644 
tests/spec/arb_enhanced_layouts/linker/component-layout/vs-to-fs-width-mismatch-double-float.shader_test
 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
 create mode 100644 
tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test

-- 
2.20.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] primitive-restart: extend the test to catch regressions of bug-109451

2019-02-01 Thread asimiklit . work
From: Andrii Simiklit 

Looks like this test should be able to catch this kind of the regressions
os I add it here.
This test should draw green rectangle if everything is ok.
But in case of bug which makes us unable to disable
the primitive restart option it should draw just one triangle.

The possible solution was suggested.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=109451
Signed-off-by: Andrii Simiklit 
---
 tests/general/primitive-restart.c | 72 +++
 1 file changed, 72 insertions(+)

diff --git a/tests/general/primitive-restart.c 
b/tests/general/primitive-restart.c
index 4219a6c5b..aef9bed41 100644
--- a/tests/general/primitive-restart.c
+++ b/tests/general/primitive-restart.c
@@ -75,6 +75,11 @@ static bool Have_31;
 static bool TestGL31;
 
 
+static void
+enable_restart(GLuint restart_index);
+static void
+disable_restart(void);
+
 static bool
 check_rendering(void)
 {
@@ -184,6 +189,71 @@ test_begin_end(GLenum primMode)
return pass;
 }
 
+static void
+write_vec2_value(GLfloat * verts, GLuint vidx, GLfloat x, GLfloat y)
+{
+   verts[(vidx * 2) + 0] = x;
+   verts[(vidx * 2) + 1] = y;
+}
+/* This test should draw green rectangle if everything is ok.
+ * But in case of bug which makes us unable to disable
+ * the primitive restart option it should draw just one triangle.
+ */
+static bool
+test_shared_ib_restart()
+{
+   bool pass = true;
+   GLfloat verts[256 * 2];
+   memset(, 0, sizeof(verts));
+   //left-bottom
+   write_vec2_value(verts, 0, 0.0f, 0.0f);
+   //right-bottom
+   write_vec2_value(verts, 1, piglit_width, 0.0f);
+   //left-top
+   write_vec2_value(verts, 2, 0.0f, piglit_height);
+   //right-top
+   write_vec2_value(verts, 255, piglit_width, piglit_height);
+
+   const GLubyte indices[] = { 0, 1, 2, 255, 0 };
+   const GLfloat expected[3] = { 0.0f, 1.0f, 0.0f };
+   GLuint vbo1, vbo2;
+
+   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
+
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   glColor4fv(green);
+
+   glGenBuffers(1, );
+   glBindBuffer(GL_ARRAY_BUFFER, vbo1);
+   glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts, GL_DYNAMIC_DRAW);
+   glVertexPointer(2, GL_FLOAT, 0, (void *)0);
+
+   glGenBuffers(1, );
+   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbo2);
+   glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(indices), indices, 
GL_STATIC_DRAW);
+   glEnableClientState(GL_VERTEX_ARRAY);
+
+   //We should draw something with an enabled restart option to check that
+   //it could be correctly disabled
+   enable_restart(0xff);
+   glDrawElements(GL_LINE_STRIP, ARRAY_SIZE(indices), GL_UNSIGNED_BYTE, 
(void*)0);
+   disable_restart();
+
+   //Draw full screen rectangle
+   glDrawElements(GL_TRIANGLE_STRIP, ARRAY_SIZE(indices) - 1, 
GL_UNSIGNED_BYTE, (void*)0);
+
+   glDisableClientState(GL_VERTEX_ARRAY);
+   glBindBuffer(GL_ARRAY_BUFFER, 0);
+   glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
+   glDeleteBuffers(1, );
+   glDeleteBuffers(1, );
+   glFinish();
+   pass = (piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height, expected) 
!= 0) && pass;
+   piglit_present_results();
+   return pass;
+}
+
 
 static void
 enable_restart(GLuint restart_index)
@@ -503,6 +573,7 @@ primitive_restart_test(VBO_CFG vbo_cfg)
 
if (Have_NV) {
   TestGL31 = false;
+  pass = test_shared_ib_restart() && pass;
   pass = test_begin_end(GL_TRIANGLE_STRIP) && pass;
   pass = test_begin_end(GL_LINE_STRIP) && pass;
   pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP, GL_UNSIGNED_BYTE) 
&& pass;
@@ -521,6 +592,7 @@ primitive_restart_test(VBO_CFG vbo_cfg)
 
if (Have_31) {
   TestGL31 = true;
+  pass = test_shared_ib_restart() && pass;
   pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP, GL_UNSIGNED_BYTE) 
&& pass;
   pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP, GL_UNSIGNED_SHORT) 
&& pass;
   pass = test_draw_elements(vbo_cfg, GL_TRIANGLE_STRIP, GL_UNSIGNED_INT) 
&& pass;
-- 
2.17.1

___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit