Re: [Piglit] [PATCH] glsl-deriv-varyings: Fixes compilation warnings and adds extra regular subtest

2015-02-23 Thread Andres Gomez
Hi,

sorry for the delay in answering I've not been able to devote much time
for this lately.

On Thu, 2015-02-19 at 13:25 -0800, Matt Turner wrote:
> On Thu, Feb 19, 2015 at 10:39 AM, Ian Romanick  wrote:
> > So... where did we end up with this?  I just pushed a patch from the bug
> > that makes shaders 4 and 5 actually run.  Both fail, but Matt thought
> > that the fix to Mesa was committed.
> 
> Indeed, it's upstream as commit 8517e665.

When introducing the patch in commit 8517e665 we were fixing fdo#82991.

As there was not a piglit test for that case, in order to track
regressions I extended the piglit "glsl-deriv-varyings" test with 3 more
cases.

The first one of those 3 was failing before mesa commit 8517e665 and is
passing afterwards.

The other 2 cases, however, fail before and after that commit. That
means that, while extending "glsl-deriv-varyings" I found, AFAIU, 2 new
bugs in mesa. I filed fdo#87407 to track those.

However, I've tested those 2 new cases with swrast, nouveau, i965 and
the proprietary NVIDIA driver in GNU/Linux and all of them fail
consistently with the same results. Therefore, I'm not totally sure the
expected results I added for those 2 extra cases are correct and I will
welcome another pair of eyes.

If the expected results are not correct, they should be corrected in the
piglit test and, probably, fdo#87407 should be invalidated.

Other than that, I agree with Ian that this test should be converted to
shader_runner. I will try to find some time to do this.

Hope this clarifies the status.

-- 
Br,

Andres

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


Re: [Piglit] [PATCH] glsl-deriv-varyings: Fixes compilation warnings and adds extra regular subtest

2015-02-19 Thread Matt Turner
On Thu, Feb 19, 2015 at 10:39 AM, Ian Romanick  wrote:
> So... where did we end up with this?  I just pushed a patch from the bug
> that makes shaders 4 and 5 actually run.  Both fail, but Matt thought
> that the fix to Mesa was committed.

Indeed, it's upstream as commit 8517e665.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] glsl-deriv-varyings: Fixes compilation warnings and adds extra regular subtest

2015-02-19 Thread Ian Romanick
So... where did we end up with this?  I just pushed a patch from the bug
that makes shaders 4 and 5 actually run.  Both fail, but Matt thought
that the fix to Mesa was committed.

Given how crufty this (very old) test is, I'd still like to see it
converted to shader_runner.

On 12/19/2014 05:43 PM, Andres Gomez wrote:
> A new subtest has been introduced for testing the regular expected
> values when using dFdx/dFdy in combination with the negative and abs
> register modifiers.
> ---
>  tests/shaders/glsl-deriv-varyings.c | 62 
> ++---
>  1 file changed, 50 insertions(+), 12 deletions(-)
> 
> diff --git a/tests/shaders/glsl-deriv-varyings.c 
> b/tests/shaders/glsl-deriv-varyings.c
> index fa72eec..c3492df 100644
> --- a/tests/shaders/glsl-deriv-varyings.c
> +++ b/tests/shaders/glsl-deriv-varyings.c
> @@ -55,6 +55,8 @@ static GLint prog4;
>  static GLint fs4;
>  static GLint prog5;
>  static GLint fs5;
> +static GLint prog6;
> +static GLint fs6;
>  
>  
>  static GLfloat verts[12] = {175.0, 125.0, 0.0,
> @@ -86,7 +88,6 @@ static const char *fragShaderText =
>   "} \n";
>  
>  static const char *fragShaderText2 =
> - "uniform sampler2D tex2d;\n"
>   "varying vec2 texCoords;\n"
>   "void main()\n"
>   "{ \n"
> @@ -96,7 +97,6 @@ static const char *fragShaderText2 =
>   "} \n";
>  
>  static const char *fragShaderText3 =
> - "uniform sampler2D tex2d;\n"
>   "varying vec2 texCoords;\n"
>   "void main()\n"
>   "{ \n"
> @@ -106,7 +106,6 @@ static const char *fragShaderText3 =
>   "} \n";
>  
>  static const char *fragShaderText4 =
> - "uniform sampler2D tex2d;\n"
>   "varying vec2 texCoords;\n"
>   "void main()\n"
>   "{ \n"
> @@ -116,12 +115,20 @@ static const char *fragShaderText4 =
>   "} \n";
>  
>  static const char *fragShaderText5 =
> - "uniform sampler2D tex2d;\n"
>   "varying vec2 texCoords;\n"
>   "void main()\n"
>   "{ \n"
>   "   gl_FragColor = vec4(dFdx(-abs(texCoords.x)) * -40.0,\n"
> - "   dFdy(-abs(texCoords.y) * -40.0,\n"
> + "   dFdy(-abs(texCoords.y)) * -40.0,\n"
> + "   0.0, 1.0);\n"
> + "} \n";
> +
> +static const char *fragShaderText6 =
> + "varying vec2 texCoords;\n"
> + "void main()\n"
> + "{ \n"
> + "   gl_FragColor = vec4(dFdx(abs(texCoords.x)) * 40.0,\n"
> + "   dFdy(abs(texCoords.y)) * 40.0,\n"
>   "   0.0, 1.0);\n"
>   "} \n";
>  
> @@ -158,12 +165,15 @@ compileLinkProg(void)
>  
>   fs5 = glCreateShader(GL_FRAGMENT_SHADER);
>  
> + fs6 = glCreateShader(GL_FRAGMENT_SHADER);
> +
>   glShaderSource(vs1, 1, (const GLchar **) &vertShaderText, NULL);
>   glShaderSource(fs1, 1, (const GLchar **) &fragShaderText, NULL);
>   glShaderSource(fs2, 1, (const GLchar **) &fragShaderText2, NULL);
>   glShaderSource(fs3, 1, (const GLchar **) &fragShaderText3, NULL);
> - glShaderSource(fs4, 1, (const GLchar **) &fragShaderText3, NULL);
> - glShaderSource(fs5, 1, (const GLchar **) &fragShaderText3, NULL);
> + glShaderSource(fs4, 1, (const GLchar **) &fragShaderText4, NULL);
> + glShaderSource(fs5, 1, (const GLchar **) &fragShaderText5, NULL);
> + glShaderSource(fs6, 1, (const GLchar **) &fragShaderText6, NULL);
>  
>   glCompileShader(vs1);
>   glGetShaderiv(vs1, GL_COMPILE_STATUS, &stat);
> @@ -207,6 +217,13 @@ compileLinkProg(void)
>   exit(1);
>   }
>  
> + glCompileShader(fs6);
> + glGetShaderiv(fs6, GL_COMPILE_STATUS, &stat);
> + if (!stat) {
> + printf("error compiling fragment shader6!\n");
> + exit(1);
> + }
> +
>  
>   prog1 = glCreateProgram();
>   glAttachShader(prog1, vs1);
> @@ -281,6 +298,21 @@ compileLinkProg(void)
>   texCoords);
>   glEnableVertexAttribArray(0);
>   glEnableVertexAttribArray(1);
> +
> +
> + prog6 = glCreateProgram();
> + glAttachShader(prog6, vs1);
> + glAttachShader(prog6, fs6);
> + glBindAttribLocation(prog6, 1, "textureCoords");
> + glLinkProgram(prog6);
> + glUseProgram(prog6);
> +
> + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3*sizeof(GLfloat),
> +   verts);
> + glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 2*sizeof(GLfloat),
> + texCoords);
> + glEnableVertexAttribArray(0);
> + glEnableVertexAttribArray(1);
>  }
>  
>  static void
> @@ -359,13 +391,19 @@ piglit_display(void)
>   glUseProgram(prog5);
>   glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
>  
> + glTranslatef(75.0, 0.0, 0.0);
> +
> + glUseProgram(prog6);
> + glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
> +
>   glPopMatrix();
>  
> - pass = pass && piglit_probe_pixel_rgb(132, 125, green);
> - pass = pass && piglit_probe_pixel_rgb(205, 125, deriv);
> -   

[Piglit] [PATCH] glsl-deriv-varyings: Fixes compilation warnings and adds extra regular subtest

2014-12-19 Thread Andres Gomez
A new subtest has been introduced for testing the regular expected
values when using dFdx/dFdy in combination with the negative and abs
register modifiers.
---
 tests/shaders/glsl-deriv-varyings.c | 62 ++---
 1 file changed, 50 insertions(+), 12 deletions(-)

diff --git a/tests/shaders/glsl-deriv-varyings.c 
b/tests/shaders/glsl-deriv-varyings.c
index fa72eec..c3492df 100644
--- a/tests/shaders/glsl-deriv-varyings.c
+++ b/tests/shaders/glsl-deriv-varyings.c
@@ -55,6 +55,8 @@ static GLint prog4;
 static GLint fs4;
 static GLint prog5;
 static GLint fs5;
+static GLint prog6;
+static GLint fs6;
 
 
 static GLfloat verts[12] = {175.0, 125.0, 0.0,
@@ -86,7 +88,6 @@ static const char *fragShaderText =
"} \n";
 
 static const char *fragShaderText2 =
-   "uniform sampler2D tex2d;\n"
"varying vec2 texCoords;\n"
"void main()\n"
"{ \n"
@@ -96,7 +97,6 @@ static const char *fragShaderText2 =
"} \n";
 
 static const char *fragShaderText3 =
-   "uniform sampler2D tex2d;\n"
"varying vec2 texCoords;\n"
"void main()\n"
"{ \n"
@@ -106,7 +106,6 @@ static const char *fragShaderText3 =
"} \n";
 
 static const char *fragShaderText4 =
-   "uniform sampler2D tex2d;\n"
"varying vec2 texCoords;\n"
"void main()\n"
"{ \n"
@@ -116,12 +115,20 @@ static const char *fragShaderText4 =
"} \n";
 
 static const char *fragShaderText5 =
-   "uniform sampler2D tex2d;\n"
"varying vec2 texCoords;\n"
"void main()\n"
"{ \n"
"   gl_FragColor = vec4(dFdx(-abs(texCoords.x)) * -40.0,\n"
-   "   dFdy(-abs(texCoords.y) * -40.0,\n"
+   "   dFdy(-abs(texCoords.y)) * -40.0,\n"
+   "   0.0, 1.0);\n"
+   "} \n";
+
+static const char *fragShaderText6 =
+   "varying vec2 texCoords;\n"
+   "void main()\n"
+   "{ \n"
+   "   gl_FragColor = vec4(dFdx(abs(texCoords.x)) * 40.0,\n"
+   "   dFdy(abs(texCoords.y)) * 40.0,\n"
"   0.0, 1.0);\n"
"} \n";
 
@@ -158,12 +165,15 @@ compileLinkProg(void)
 
fs5 = glCreateShader(GL_FRAGMENT_SHADER);
 
+   fs6 = glCreateShader(GL_FRAGMENT_SHADER);
+
glShaderSource(vs1, 1, (const GLchar **) &vertShaderText, NULL);
glShaderSource(fs1, 1, (const GLchar **) &fragShaderText, NULL);
glShaderSource(fs2, 1, (const GLchar **) &fragShaderText2, NULL);
glShaderSource(fs3, 1, (const GLchar **) &fragShaderText3, NULL);
-   glShaderSource(fs4, 1, (const GLchar **) &fragShaderText3, NULL);
-   glShaderSource(fs5, 1, (const GLchar **) &fragShaderText3, NULL);
+   glShaderSource(fs4, 1, (const GLchar **) &fragShaderText4, NULL);
+   glShaderSource(fs5, 1, (const GLchar **) &fragShaderText5, NULL);
+   glShaderSource(fs6, 1, (const GLchar **) &fragShaderText6, NULL);
 
glCompileShader(vs1);
glGetShaderiv(vs1, GL_COMPILE_STATUS, &stat);
@@ -207,6 +217,13 @@ compileLinkProg(void)
exit(1);
}
 
+   glCompileShader(fs6);
+   glGetShaderiv(fs6, GL_COMPILE_STATUS, &stat);
+   if (!stat) {
+   printf("error compiling fragment shader6!\n");
+   exit(1);
+   }
+
 
prog1 = glCreateProgram();
glAttachShader(prog1, vs1);
@@ -281,6 +298,21 @@ compileLinkProg(void)
texCoords);
glEnableVertexAttribArray(0);
glEnableVertexAttribArray(1);
+
+
+   prog6 = glCreateProgram();
+   glAttachShader(prog6, vs1);
+   glAttachShader(prog6, fs6);
+   glBindAttribLocation(prog6, 1, "textureCoords");
+   glLinkProgram(prog6);
+   glUseProgram(prog6);
+
+   glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3*sizeof(GLfloat),
+   verts);
+   glVertexAttribPointer(1, 2, GL_FLOAT, GL_FALSE, 2*sizeof(GLfloat),
+   texCoords);
+   glEnableVertexAttribArray(0);
+   glEnableVertexAttribArray(1);
 }
 
 static void
@@ -359,13 +391,19 @@ piglit_display(void)
glUseProgram(prog5);
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
 
+   glTranslatef(75.0, 0.0, 0.0);
+
+   glUseProgram(prog6);
+   glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+
glPopMatrix();
 
-   pass = pass && piglit_probe_pixel_rgb(132, 125, green);
-   pass = pass && piglit_probe_pixel_rgb(205, 125, deriv);
-   pass = pass && piglit_probe_pixel_rgb(280, 125, deriv);
-   pass = pass && piglit_probe_pixel_rgb(355, 125, deriv);
-   pass = pass && piglit_probe_pixel_rgb(430, 125, deriv);
+   pass = pass && piglit_probe_pixel_rgb(132, 130, green);
+   pass = pass && piglit_probe_pixel_rgb(205, 130, deriv);
+   pass = pass && piglit_probe_pixel_rgb(280, 130, deriv);
+   pass = pass && piglit_probe_pixel_rgb(355, 130, deriv