[Piglit] [PATCH] glsl-fs-pointcoord: add additional FS inputs
Iago Toral Quiroga
itoral at igalia.com
Mon Feb 26 11:15:24 UTC 2018
We have recently found a regression in the i965 driver related to
gl_PointCoord which was not being caught by this test. This patch
changes the test slightly so that we can expose the problem for
future regression testing.
The problem occured because the driver was not using the correct
number of FS inputs to to program a certain piece of HW state, as
it did not account for some inputs that require special treatment,
such as gl_PointCoord.
However, this test was not able to find this because the hardware
also has a restriction by which it needs to program, at least,
2 FS inputs, so if we only have gl_PointCoord as input, which is
what we had here, it would still work.
This patch adds a couple of additional varyings so we have 3
inputs in total, ensuring that we trigger the problem.
Besides this, it also removes a sampler uniform that was not used
in the fragment shader, and includes the GLSL version that was
missing in the vertex shader.
---
tests/shaders/glsl-fs-pointcoord.frag | 7 ++++++-
tests/shaders/glsl-fs-pointcoord.vert | 8 ++++++++
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/tests/shaders/glsl-fs-pointcoord.frag b/tests/shaders/glsl-fs-pointcoord.frag
index 4e242f01d..138f25883 100644
--- a/tests/shaders/glsl-fs-pointcoord.frag
+++ b/tests/shaders/glsl-fs-pointcoord.frag
@@ -1,7 +1,12 @@
#version 120
-uniform sampler2D tex;
+
+varying vec4 var0;
+varying vec4 var1;
void main()
{
gl_FragColor = vec4(gl_PointCoord.xy * 1.1 - 0.05, 0, 0);
+
+ if (var0 != vec4(0, 1, 2, 3) || var1 != vec4(4, 5, 6, 7))
+ gl_FragColor.z = 1; /* something is wrong */
}
diff --git a/tests/shaders/glsl-fs-pointcoord.vert b/tests/shaders/glsl-fs-pointcoord.vert
index 92f5bde9c..66855544f 100644
--- a/tests/shaders/glsl-fs-pointcoord.vert
+++ b/tests/shaders/glsl-fs-pointcoord.vert
@@ -1,5 +1,13 @@
+#version 120
+
+varying vec4 var0;
+varying vec4 var1;
+
void main()
{
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+
+ var0 = vec4(0, 1, 2, 3);
+ var1 = vec4(4, 5, 6, 7);
}
--
2.14.1
More information about the Piglit
mailing list