diff options
author | Iago Toral Quiroga <itoral@igalia.com> | 2018-02-26 12:15:24 +0100 |
---|---|---|
committer | Mark Janes <mark.a.janes@intel.com> | 2018-02-26 12:45:17 -0800 |
commit | 4ce0887e2f7f848d2be2e435a2d0f3c80e44ea3b (patch) | |
tree | 283aa32352d7726ffe9f6128b4ef58a48a0225c1 /tests | |
parent | 47b42158f3d8037ae968f5c3ceef930e4973e8af (diff) |
glsl-fs-pointcoord: add additional FS inputs
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.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/shaders/glsl-fs-pointcoord.frag | 7 | ||||
-rw-r--r-- | tests/shaders/glsl-fs-pointcoord.vert | 8 |
2 files changed, 14 insertions, 1 deletions
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); } |