Re: [Piglit] [PATCH] arb_tessellation_shader: fix broken compat gl_ClipVertex test

2019-08-02 Thread Kenneth Graunke
Ahh, this makes more sense.  Thanks Tim!

Reviewed-by: Kenneth Graunke 

On Thursday, August 1, 2019 7:24:22 PM PDT Timothy Arceri wrote:
> The expected projection wasn't being applied.
> ---
>  .../tes-clip-vertex-different-from-position.shader_test  | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git 
> a/tests/spec/arb_tessellation_shader/execution/compatibility/tes-clip-vertex-different-from-position.shader_test
>  
> b/tests/spec/arb_tessellation_shader/execution/compatibility/tes-clip-vertex-different-from-position.shader_test
> index b96ac10e4..4a0483c35 100644
> --- 
> a/tests/spec/arb_tessellation_shader/execution/compatibility/tes-clip-vertex-different-from-position.shader_test
> +++ 
> b/tests/spec/arb_tessellation_shader/execution/compatibility/tes-clip-vertex-different-from-position.shader_test
> @@ -27,12 +27,12 @@ void main(void)
>  layout(quads) in;
>  
>  void main() {
> - gl_Position = vec4(gl_TessCoord.xy * 2 - 1, 0, 1);;
> + gl_Position = gl_ModelViewProjectionMatrix * vec4(gl_TessCoord.xy * 2 - 
> 1, 0, 1);
>  
>   // Transform gl_ClipVertex in an arbitrary way so that
>   // we can verify it is being used for clipping instead of
>   // gl_Position.
> - gl_ClipVertex = gl_Position * vec4(10.0, 10.0, 1.0, 1.0);
> + gl_ClipVertex = vec4(gl_TessCoord.xy * 2 - 1, 0, 1) * vec4(10.0, 10.0, 
> 1.0, 1.0);
>  }
>  
>  [fragment shader]
> @@ -70,7 +70,6 @@ enable GL_CLIP_PLANE5
>  
>  patch parameter vertices 1
>  draw arrays GL_PATCHES 0 1
> -#draw rect 0.1 0.1 0.8 0.8
>  
>  # Test points inside each hexagon edge
>  relative probe rgba (0.3, 0.4) (1.0, 1.0, 1.0, 1.0)
> 



signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

Re: [Piglit] Should piglit drop bugzilla and move to using gitlab issues?

2019-03-01 Thread Kenneth Graunke
On Friday, March 1, 2019 1:30:48 PM PST Dylan Baker wrote:
> Quoting Jordan Justen (2019-03-01 12:22:18)
> > I guess piglit makes very light usage of bugzilla. Would it be simpler
> > to just use gitlab issues in the piglit gitlab project?
> > 
> > -Jordan
> 
> I think we should, anecdotally it seems like there are more spam bugs against
> piglit than real bugs anyway. And when I did some digging there's a grand 
> total
> of ~500 bugs filed against piglit for all time. 
> 
> Dylan

I would like to try it.

1. It would give Mesa developers some more experience with Gitlab issue
   tracking, without switching Mesa over - which we aren't ready to do.
   (I personally am fairly happy with Bugzilla as it stands.)

2. I think hardly anyone looks at Piglit Bugzilla.  There are very few
   bugs filed there---but more importantly, very few people actually
   read or update them.  Yesterday I went through them and found some
   bugs that were likely fixed ages ago, but never closed.  Others were
   filed years ago and long since forgotten.

   I think using Gitlab issues would provide greater visibility to any
   issues we want to track.  They'd be right there on the same webpage
   with MRs.  MR discussions can link to them.  Email notifications can
   happen and are easily customizable.

--Ken


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit

[Piglit] [PATCH] Fix 'piglit resume'

2018-12-14 Thread Kenneth Graunke
metadata.json contains 'force_glsl' but not 'glsl'.  I guess it must
have gotten renamed at some point.  Fixes the following traceback when
attempting to call 'piglit resume':

Traceback (most recent call last):
  File "/home/kayden/Projects/piglit/piglit", line 178, in 
main()
  File "/home/kayden/Projects/piglit/piglit", line 174, in main
sys.exit(runner(args))
  File "/home/kayden/Projects/piglit/framework/exceptions.py", line 52, in 
_inner
func(*args, **kwargs)
  File "/home/kayden/Projects/piglit/framework/programs/run.py", line 439, in 
resume
options.OPTIONS.force_glsl = results.options['glsl']
---
 framework/programs/run.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/programs/run.py b/framework/programs/run.py
index df6ebe7aa..d0a3fcfe9 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -436,7 +436,7 @@ def resume(input_):
 options.OPTIONS.process_isolation = results.options['process_isolation']
 options.OPTIONS.jobs = args.jobs
 options.OPTIONS.no_retry = args.no_retry
-options.OPTIONS.force_glsl = results.options['glsl']
+options.OPTIONS.force_glsl = results.options['force_glsl']
 
 core.get_config(args.config_file)
 
-- 
2.19.1

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


[Piglit] [PATCH] Probe pixel colors in bitmap-heart-dance test

2018-11-23 Thread Kenneth Graunke
This probes a single pixel at the center of each heart drawn, ensuring
it's the correct color.  Otherwise, failing to draw both halves would
cause the test to pass.
---
 tests/spec/gl-1.0/bitmap-heart-dance.c | 23 +--
 1 file changed, 21 insertions(+), 2 deletions(-)

diff --git a/tests/spec/gl-1.0/bitmap-heart-dance.c 
b/tests/spec/gl-1.0/bitmap-heart-dance.c
index cb1c7faa7..768fee6e4 100644
--- a/tests/spec/gl-1.0/bitmap-heart-dance.c
+++ b/tests/spec/gl-1.0/bitmap-heart-dance.c
@@ -146,6 +146,18 @@ draw_row(const float* color, int length,
}
 }
 
+static bool
+check_row(const float *color, int length, int x, int y, int spacex)
+{
+   bool pass = true;
+   for (int i = 0; i < length; i++) {
+   int probe_x = x + 8 + spacex + 4;
+   int probe_y = y + 4;
+   pass &= piglit_probe_pixel_rgb(probe_x, probe_y, color);
+   }
+   return pass;
+}
+
 static GLuint fragShader, program;
 
 enum piglit_result
@@ -203,8 +215,15 @@ piglit_display(void)
 
piglit_present_results();
 
-   pass = piglit_probe_rects_equal(0, 0, 0, piglit_height/2,
-   piglit_width, piglit_height/2, GL_RGB);
+   pass &= check_row( red, length, x, y + 5*spacing, spacing);
+   pass &= check_row(  salmon, length, x, y + 4*spacing, spacing);
+   pass &= check_row(pink, length, x, y + 3*spacing, spacing);
+   pass &= check_row(  orange, length, x, y + 2*spacing, spacing);
+   pass &= check_row(ltorange, length, x, y + 1*spacing, spacing);
+   pass &= check_row(  yellow, length, x, y + 0*spacing, spacing);
+
+   pass &= piglit_probe_rects_equal(0, 0, 0, piglit_height/2,
+piglit_width, piglit_height/2, GL_RGB);
 
return pass ? PIGLIT_PASS : PIGLIT_FAIL;
 }
-- 
2.19.1

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


[Piglit] [PATCH 1/2] Fix bogus assertions in builtin uniform test generator.

2018-05-09 Thread Kenneth Graunke
self.test_rows is measured in a number of 4x4 rectangles, but y is
measured in pixels, so they are not comparable.  The only reason this
doesn't trip is because self.test_rows is currently the number of 4x4
rectangles that can fit in a 250x250 window (62)...and no test has
nearly that many rows of rectangles.

Instead, just assert y fits in the window height.
---
 generated_tests/gen_builtin_uniform_tests.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/generated_tests/gen_builtin_uniform_tests.py 
b/generated_tests/gen_builtin_uniform_tests.py
index 50cced444..ac09a64fc 100644
--- a/generated_tests/gen_builtin_uniform_tests.py
+++ b/generated_tests/gen_builtin_uniform_tests.py
@@ -386,7 +386,7 @@ class ShaderTest(object):
 def draw_command(self, test_num):
 x = (test_num % self.tests_per_row) * self.rect_width
 y = (test_num // self.tests_per_row) * self.rect_height
-assert(y < self.test_rows)
+assert(y + self.rect_height <= self.win_height)
 return 'draw rect ortho {0} {1} {2} {3}\n'.format(x, y,
   self.rect_width,
   self.rect_height)
@@ -662,7 +662,7 @@ class TessellationShaderTest(ShaderTest):
 def draw_command(self, test_num):
 x = (test_num % self.tests_per_row) * self.rect_width
 y = (test_num // self.tests_per_row) * self.rect_height
-assert(y < self.test_rows)
+assert(y + self.rect_height <= self.win_height)
 return 'draw rect ortho patch {0} {1} {2} {3}\n'.format(x, y,
 
self.rect_width,
 
self.rect_height)
-- 
2.17.0

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


[Piglit] [PATCH 2/2] Specify an explicit window size in builtin uniform tests.

2018-05-09 Thread Kenneth Graunke
Currently, these tests assume a 250x250 window size, but don't specify
SIZE 250x250, which means they can break when using PIGLIT_DEFAULT_SIZE.

The tests draw multiple 4x4 rectangles side by side, and lay them out
based on the window size.  We bump the window width to 256 so that it's
a multiple of 4, and shrink y to fit the number of rows.
---
 generated_tests/gen_builtin_uniform_tests.py | 17 +
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/generated_tests/gen_builtin_uniform_tests.py 
b/generated_tests/gen_builtin_uniform_tests.py
index ac09a64fc..8001f7123 100644
--- a/generated_tests/gen_builtin_uniform_tests.py
+++ b/generated_tests/gen_builtin_uniform_tests.py
@@ -48,6 +48,7 @@ from __future__ import print_function, division, 
absolute_import
 from builtin_function import *
 import abc
 import numpy
+import math
 import optparse
 import os
 import os.path
@@ -357,15 +358,14 @@ class ShaderTest(object):
 # Size of the rectangles drawn by the test.
 self.rect_width = 4
 self.rect_height = 4
-# shader_runner currently defaults to a 250x250 window.  We
-# could reduce window size to cut test time, but there are
-# platform-dependent limits we haven't really characterized
-# (smaller on Linux than Windows, but still present in some
-# window managers).
-self.win_width = 250
-self.win_height = 250
+
+# Use a 256xN window.  Make it at least 160 pixels tall to avoid
+# window manager issues with small window sizes (see comments in
+# piglit_gl_test_config_init() for details).
+self.win_width = 256
 self.tests_per_row = (self.win_width // self.rect_width)
-self.test_rows = (self.win_height // self.rect_height)
+self.test_rows = math.ceil(len(test_vectors) / self.tests_per_row)
+self.win_height = max(self.test_rows * self.rect_height, 160)
 
 if use_if:
 self._comparator = BoolIfComparator(signature)
@@ -560,6 +560,7 @@ class ShaderTest(object):
 shader_test = '[require]\n'
 shader_test += 'GLSL >= {0:1.2f}\n'.format(
 float(self.glsl_version()) / 100)
+shader_test += 'SIZE {0}x{1}'.format(self.win_width, self.win_height)
 for extension in self.extensions():
 shader_test += 'GL_{}\n'.format(extension)
 shader_test += self.make_additional_requirements()
-- 
2.17.0

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


[Piglit] [PATCH] draw-vertices-2101010: Accept either SNORM conversion formula.

2017-12-25 Thread Kenneth Graunke
OpenGL defines two equations for converting from signed-normalized
to floating point data.  These are:

f = (2c + 1)/(2^b - 1)(equation 2.2)
f = max{c/2^(b-1) - 1), -1.0} (equation 2.3)

ARB_vertex_type_2_10_10_10_rev specifies equation 2.2 is to be used.

However, OpenGL 4.2 switched to use equation 2.3 in all scenarios.
This matched an earlier OpenGL ES 3.0 decision to only have one formula,
as well as a DirectX decision to change to equation 2.3.  Some hardware
also only supports equation 2.3.  So, basically no one can rely on
equation 2.2 happening, and some people do rely on 2.3.

This patch continues to require equation 2.3 for GL 4.2+, but relaxes
the test to allow either behavior for earlier GL versions.

See the following discussion for more details:
https://lists.freedesktop.org/archives/mesa-dev/2013-August/042680.html

This makes this test pass on i965 with Haswell and later.
---
 .../draw-vertices-2101010.c| 48 ++
 1 file changed, 32 insertions(+), 16 deletions(-)

diff --git a/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c 
b/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c
index 661fa9ca2..5ce4c0655 100644
--- a/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c
+++ b/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c
@@ -187,20 +187,28 @@ static void test_int_vertices_abi(float x1, float y1, 
float x2, float y2, int in
 struct test {
 void (*test)(float x1, float y1, float x2, float y2, int index);
 int index;
-float expected_color[4];
+float expected_color_equation_22[4];
+float expected_color_equation_23[4];
 const char *name;
 };
 
 struct test tests[] = {
-{test_packed_int_vertices, 0, {1, 1, 1, 1}, "Int vertices - 2/10/10/10"},
-{test_packed_int_vertices, 1, {1, 1, 1, 1}, "Unsigned Int vertices - 
2/10/10/10"},
-{test_packed_int_color_vertices, 0, {1, 0, 0, 0.333}, "Int Color - 
2/10/10/10"},
-{test_packed_int_color_vertices, 1, {1, 0, 0, 0}, "Unsigned Int Color - 
2/10/10/10"},
-{test_packed_int_color_vertices, 2, {0, 0, 1, 0.333}, "Int BGRA Color - 
2/10/10/10"},
-{test_packed_int_color_vertices, 3, {0, 0, 1, 0}, "Unsigned Int BGRA Color 
- 2/10/10/10"},
-
-{test_int_vertices_abi, 0, {1, 0, 0, 1}, "Int 2/10/10/10 - test ABI" },
-{test_int_vertices_abi, 1, {1, 0, 0, 1}, "Unsigned 2/10/10/10 - test ABI" 
},
+{test_packed_int_vertices, 0, {1, 1, 1, 1}, {1, 1, 1, 1},
+ "Int vertices - 2/10/10/10"},
+{test_packed_int_vertices, 1, {1, 1, 1, 1}, {1, 1, 1, 1},
+ "Unsigned Int vertices - 2/10/10/10"},
+{test_packed_int_color_vertices, 0, {1, 0, 0, 0.333}, {1, 0, 0, 0},
+ "Int Color - 2/10/10/10"},
+{test_packed_int_color_vertices, 1, {1, 0, 0, 0}, {1, 0, 0, 0},
+ "Unsigned Int Color - 2/10/10/10"},
+{test_packed_int_color_vertices, 2, {0, 0, 1, 0.333}, {0, 0, 1, 0},
+ "Int BGRA Color - 2/10/10/10"},
+{test_packed_int_color_vertices, 3, {0, 0, 1, 0}, {0, 0, 1, 0},
+ "Unsigned Int BGRA Color - 2/10/10/10"},
+{test_int_vertices_abi, 0, {1, 0, 0, 1}, {1, 0, 0, 1},
+ "Int 2/10/10/10 - test ABI" },
+{test_int_vertices_abi, 1, {1, 0, 0, 1}, {1, 0, 0, 1},
+ "Unsigned 2/10/10/10 - test ABI" },
 {0}
 };
 
@@ -213,7 +221,7 @@ piglit_display(void)
 /* To know what this is all about, see:
  * http://lists.freedesktop.org/archives/mesa-dev/2013-August/042680.html
  */
-GLboolean snorm_equation_23 = piglit_get_gl_version() >= 42;
+bool require_snorm_equation_23 = piglit_get_gl_version() >= 42;
 
 glClear(GL_COLOR_BUFFER_BIT);
 glEnableClientState(GL_VERTEX_ARRAY);
@@ -222,14 +230,22 @@ piglit_display(void)
 for (i = 0; tests[i].test; i++) {
 glBindBuffer(GL_ARRAY_BUFFER, 0);
 
-   if (snorm_equation_23 && fabs(tests[i].expected_color[3] - 0.333) < 
0.0001)
-   tests[i].expected_color[3] = 0;
-
-printf("%s\n", tests[i].name);
 tests[i].test(x, y, x+20, y+20, tests[i].index);
 if (!piglit_check_gl_error(GL_NO_ERROR))
piglit_report_result(PIGLIT_FAIL);
-pass = piglit_probe_pixel_rgba(x+5, y+5, tests[i].expected_color) && 
pass;
+
+printf("%s\n", tests[i].name);
+
+if (require_snorm_equation_23) {
+pass = piglit_probe_pixel_rgba(x+5, y+5, 
tests[i].expected_color_equation_23) && pass;
+} else {
+bool equation_22_pass = piglit_probe_pixel_rgba(x+5, y+5, 
tests[i].expected_color_equation_22);
+bool equation_23_pass = piglit_probe_pixel_rgba(x+5, y+5, 
tests[i].expected_color_equation_23);
+if (!equation_22_pass && equation_23_pass) {
+printf("warning: driver uses GL 4.2+ rules for signed 
normalized to float conversions\n");
+}
+pass = (equation_22_pass || equation_23_pass) && pass;
+}
 
 x += 20;
 if (x > 300) {
-- 

Re: [Piglit] [PATCH] Add tests for GLSL ES 1.00 mismatched uniform precision

2017-11-06 Thread Kenneth Graunke
On Monday, November 6, 2017 11:45:33 AM PST Dylan Baker wrote:
> For ES 1.00 a number of real world android apps depend on uniforms with
> mismatched precision linking as long as those uniforms are used in 1 or
> 0 shader stages. This patch adds a test for both the 0 or 1 test that is
> expected to pass (bug currently fails), and a test for the > 1 case that
> is expected to fail (and does).
> 
> Because GLSL ES 3.00 is more specific (declared uniforms precision must
> match) this also adds similar tests for ES 3.00 that test for failure in
> both cases.
> 
> bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97532

Bugzilla:

> Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> ---
>  ...mismatched-uniform-percision-unused.shader_test | 50 +
>  ...l-mismatched-uniform-percision-used.shader_test | 50 +
>  ...mismatched-uniform-percision-unused.shader_test | 52 
> ++
>  ...l-mismatched-uniform-percision-used.shader_test | 52 
> ++

filenames have a typo, should be 'precision' not 'percision'

>  4 files changed, 204 insertions(+)
>  create mode 100644 
> tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
>  create mode 100644 
> tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-used.shader_test
>  create mode 100644 
> tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
>  create mode 100644 
> tests/spec/glsl-es-3.00/linker/glsl-mismatched-uniform-percision-used.shader_test
> 
> diff --git 
> a/tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
>  
> b/tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
> new file mode 100644
> index 0..7efca4d79
> --- /dev/null
> +++ 
> b/tests/spec/glsl-es-1.00/linker/glsl-mismatched-uniform-percision-unused.shader_test
> @@ -0,0 +1,50 @@
> +# Copyright © 2017 Intel Corporation
> +
> +# Permission is hereby granted, free of charge, to any person obtaining a 
> copy
> +# of this software and associated documentation files (the "Software"), to 
> deal
> +# in the Software without restriction, including without limitation the 
> rights
> +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> +# copies of the Software, and to permit persons to whom the Software is
> +# furnished to do so, subject to the following conditions:
> +
> +# The above copyright notice and this permission notice shall be included in
> +# all copies or substantial portions of the Software.
> +
> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
> +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
> FROM,
> +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 
> THE
> +# SOFTWARE.
> +
> +# Test for https://bugs.freedesktop.org/show_bug.cgi?id=97532
> +#
> +# for GLSL ES 1.00 a number of apps depend on having different precision in
> +# uniforms in different shader stages, but this is only valid uniforms that 
> are
> +# used in one shader or are unused.
> +
> +[require]
> +GL ES >= 2.0
> +GLSL ES >= 1.00
> +
> +[vertex shader]
> +precision highp float;
> +uniform float f;
> +uniform mat4 M;

Please delete 'mat4 M' from these tests - it isn't used at all.

With that dropped, and the filename typos fixed,
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] glx-tfp: Use a nice orange color instead of red

2017-10-20 Thread Kenneth Graunke
On Thursday, October 19, 2017 8:08:24 PM PDT Jason Ekstrand wrote:
> The orange is not a 0/1 color.  If the driver messes up and gives the
> client sRGB decode on the texture, the test will now fail.
> ---
>  tests/glx/glx-tfp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/glx/glx-tfp.c b/tests/glx/glx-tfp.c
> index c27c89a..2640874 100644
> --- a/tests/glx/glx-tfp.c
> +++ b/tests/glx/glx-tfp.c
> @@ -41,8 +41,8 @@
>  #include "X11/extensions/Xrender.h"
>  
>  GLfloat tex_data[4][4] = {
> - { 1.0, 0.0, 0.0, 1.0 },
> - { 1.0, 0.0, 0.0, 0.5 },
> + { 1.0, 0.5, 0.0, 1.0 },
> + { 1.0, 0.5, 0.0, 0.5 },
>   { 0.0, 1.0, 0.0, 1.0 },
>   { 0.0, 1.0, 0.0, 0.5 },
>  };
> 

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Add KHR-GL46 to khr_gl.py

2017-09-18 Thread Kenneth Graunke
Following the pattern, if there ever were a OpenGL 4.6 CTS, it would
probably have tests named like this.
---
 tests/khr_gl.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/khr_gl.py b/tests/khr_gl.py
index 0cc86afff..6a4e845c4 100644
--- a/tests/khr_gl.py
+++ b/tests/khr_gl.py
@@ -89,5 +89,7 @@ profile = deqp.make_profile(  # pylint: disable=invalid-name
 deqp.gen_caselist_txt(_KHR_BIN, 'KHR-GL44-cases.txt', 
_EXTRA_ARGS)),
 deqp.iter_deqp_test_cases(
 deqp.gen_caselist_txt(_KHR_BIN, 'KHR-GL45-cases.txt', 
_EXTRA_ARGS)),
+deqp.iter_deqp_test_cases(
+deqp.gen_caselist_txt(_KHR_BIN, 'KHR-GL46-cases.txt', 
_EXTRA_ARGS)),
 ),
 DEQPKHRTest)
-- 
2.14.1

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


[Piglit] [PATCH] Respect GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT in binding-layout.c.

2017-06-04 Thread Kenneth Graunke
The spec/arb_shading_language_420pack/execution/binding-layout test
assumed that it could bind buffers at 16-byte offsets.  This may not
be true - we need to respect GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT.

This prevents crashes on drivers which require an alignment larger than
16 bytes.  The closed source AMD and NVIDIA drivers appear to require
an alignment of 256 bytes, and I have a patch to bump i965 to 32 bytes.
---
 .../execution/binding-layout.c   | 16 
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/tests/spec/arb_shading_language_420pack/execution/binding-layout.c 
b/tests/spec/arb_shading_language_420pack/execution/binding-layout.c
index bda43dd0d..acbb8f4dd 100644
--- a/tests/spec/arb_shading_language_420pack/execution/binding-layout.c
+++ b/tests/spec/arb_shading_language_420pack/execution/binding-layout.c
@@ -152,6 +152,7 @@ piglit_init(int argc, char **argv)
};
bool pass = true;
GLuint bo;
+   GLint alignment;
 
piglit_require_extension("GL_ARB_shading_language_420pack");
piglit_require_extension("GL_ARB_explicit_attrib_location");
@@ -167,14 +168,21 @@ piglit_init(int argc, char **argv)
if (!pass)
piglit_report_result(PIGLIT_FAIL);
 
+   /* Pad out to the alignment or the size of a vec4. */
+   glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, );
+   alignment = MAX2(alignment, 4 * sizeof(float));
+
glGenBuffers(1, );
glBindBuffer(GL_UNIFORM_BUFFER, bo);
-   glBufferData(GL_UNIFORM_BUFFER, sizeof(data), data, GL_STATIC_DRAW);
+   glBufferData(GL_UNIFORM_BUFFER, 3 * alignment, NULL, GL_STATIC_DRAW);
+   glBufferSubData(GL_UNIFORM_BUFFER, 0 * alignment, 16, [0]);
+   glBufferSubData(GL_UNIFORM_BUFFER, 1 * alignment, 16, [4]);
+   glBufferSubData(GL_UNIFORM_BUFFER, 2 * alignment, 16, [8]);
glBindBuffer(GL_UNIFORM_BUFFER, 0);
 
-   glBindBufferRange(GL_UNIFORM_BUFFER, 2, bo,  0, 16);
-   glBindBufferRange(GL_UNIFORM_BUFFER, 3, bo, 16, 16);
-   glBindBufferRange(GL_UNIFORM_BUFFER, 4, bo, 32, 16);
+   glBindBufferRange(GL_UNIFORM_BUFFER, 2, bo, 0 * alignment, 16);
+   glBindBufferRange(GL_UNIFORM_BUFFER, 3, bo, 1 * alignment, 16);
+   glBindBufferRange(GL_UNIFORM_BUFFER, 4, bo, 2 * alignment, 16);
 
glClearColor(0.5, 0.5, 0.5, 1.0);
 }
-- 
2.13.0

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


[Piglit] [PATCH 1/2] Set non-mipmap filter for CopyImage textures in namespace pollution test

2017-03-24 Thread Kenneth Graunke
glCopyImageSubData() requires mipmap completeness if the texture
object's min filter indicates that mipmapping is involved.

This test doesn't care about mipmapping, so set the min filter to
GL_NEAREST to bypass this.

Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16224
---
 tests/general/object-namespace-pollution.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/general/object-namespace-pollution.c 
b/tests/general/object-namespace-pollution.c
index 1c7501443..6ac6aee7b 100644
--- a/tests/general/object-namespace-pollution.c
+++ b/tests/general/object-namespace-pollution.c
@@ -1132,10 +1132,12 @@ do_CopyImageSubData(void)
glBindTexture(GL_TEXTURE_2D, tex[0]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 16, 16, 0,
 GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 
glBindTexture(GL_TEXTURE_2D, tex[1]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 16, 16, 0,
 GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
 
glBindTexture(GL_TEXTURE_2D, 0);
 
-- 
2.12.1

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


[Piglit] [PATCH 2/2] Set nearest filter for CopyImage textures in api errors test.

2017-03-24 Thread Kenneth Graunke
Integer textures are not complete if their min/mag filters indicate
LINEAR texel filtering or miplevel selection.   You have to use NEAREST
or NEAREST_MIPMAP_NEAREST.

Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=16224
---
 tests/spec/arb_copy_image/api_errors.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/tests/spec/arb_copy_image/api_errors.c 
b/tests/spec/arb_copy_image/api_errors.c
index a34810432..e032368ab 100644
--- a/tests/spec/arb_copy_image/api_errors.c
+++ b/tests/spec/arb_copy_image/api_errors.c
@@ -236,6 +236,9 @@ test_compressed_alignment_errors()
   GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, 128, 128);
glBindTexture(GL_TEXTURE_2D, tex[1]);
glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGBA16UI, 32, 32);
+   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
+   GL_NEAREST_MIPMAP_NEAREST);
 
/* Check for alignment constaints */
/* bad width = 21 */
@@ -264,6 +267,9 @@ test_compressed_alignment_errors()
 */
glBindTexture(GL_TEXTURE_2D, tex[2]);
glTexStorage2D(GL_TEXTURE_2D, 1, GL_RGB16UI, 32, 32);
+   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,
+   GL_NEAREST_MIPMAP_NEAREST);
glCopyImageSubData(tex[0], GL_TEXTURE_2D, 0, 0, 0, 0,
   tex[2], GL_TEXTURE_2D, 0, 0, 0, 0, 20, 20, 1);
pass &= piglit_check_gl_error(GL_INVALID_OPERATION);
-- 
2.12.1

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


[Piglit] [PATCH] Move dma buf stuff from the GL framework to those tests.

2017-03-21 Thread Kenneth Graunke
This was linking every single Piglit test against libdrm_intel directly.
I was recently experimenting with a change that made i965 no longer use
libdrm_intel, and expected missing symbol errors...but all Piglit tests
surprisingly kept working.  There's no reason for most tests to have
this linked in, so restrict it to only the tests that need it.
---
 .../ext_image_dma_buf_import/CMakeLists.gles1.txt  | 18 +-
 .../ext_image_dma_buf_import/CMakeLists.gles2.txt  | 16 
 tests/spec/ext_image_dma_buf_import/CMakeLists.txt | 26 +++
 .../intel_external_sampler_only.c  |  2 +-
 .../intel_unsupported_format.c |  2 +-
 .../ext_image_dma_buf_import/invalid_attributes.c  |  2 +-
 .../spec/ext_image_dma_buf_import/invalid_hints.c  |  2 +-
 .../ext_image_dma_buf_import/missing_attributes.c  |  2 +-
 .../ext_image_dma_buf_import/ownership_transfer.c  |  2 +-
 .../ext_image_dma_buf_import}/piglit_drm_dma_buf.c |  6 ++---
 .../ext_image_dma_buf_import}/piglit_drm_dma_buf.h |  6 ++---
 tests/spec/ext_image_dma_buf_import/refcount.c |  2 +-
 .../spec/ext_image_dma_buf_import/sample_common.c  |  2 +-
 .../transcode-nv12-as-r8-gr88.c|  2 +-
 tests/util/CMakeLists.txt  | 29 --
 tests/util/piglit-framework-gl.c   | 17 -
 .../util/piglit-framework-gl/piglit_gl_framework.c |  5 
 17 files changed, 52 insertions(+), 89 deletions(-)
 rename tests/{util/piglit-framework-gl => 
spec/ext_image_dma_buf_import}/piglit_drm_dma_buf.c (98%)
 rename tests/{util/piglit-framework-gl => 
spec/ext_image_dma_buf_import}/piglit_drm_dma_buf.h (91%)

diff --git a/tests/spec/ext_image_dma_buf_import/CMakeLists.gles1.txt 
b/tests/spec/ext_image_dma_buf_import/CMakeLists.gles1.txt
index 39a2b292d..c02291a14 100644
--- a/tests/spec/ext_image_dma_buf_import/CMakeLists.gles1.txt
+++ b/tests/spec/ext_image_dma_buf_import/CMakeLists.gles1.txt
@@ -11,18 +11,12 @@ link_libraries(
 
 # These tests rely on drm and are hence compiled only on linux/drm platforms
 if(PIGLIT_BUILD_DMA_BUF_TESTS)
-   add_definitions(-DHAVE_LIBDRM)
-
-   include_directories(
-   ${LIBDRM_INCLUDE_DIRS}
-   )
-
-   piglit_add_executable(ext_image_dma_buf_import-invalid_hints 
invalid_hints.c image_common.c)
-   piglit_add_executable(ext_image_dma_buf_import-invalid_attributes 
invalid_attributes.c image_common.c)
-   piglit_add_executable(ext_image_dma_buf_import-missing_attributes 
missing_attributes.c image_common.c)
-   piglit_add_executable(ext_image_dma_buf_import-ownership_transfer 
ownership_transfer.c image_common.c)
-   piglit_add_executable(ext_image_dma_buf_import-intel_unsupported_format 
intel_unsupported_format.c image_common.c)
-   
piglit_add_executable(ext_image_dma_buf_import-intel_external_sampler_only 
intel_external_sampler_only.c image_common.c)
+   piglit_add_executable(ext_image_dma_buf_import-invalid_hints 
invalid_hints.c image_common.c piglit_drm_dma_buf.c)
+   piglit_add_executable(ext_image_dma_buf_import-invalid_attributes 
invalid_attributes.c image_common.c piglit_drm_dma_buf.c)
+   piglit_add_executable(ext_image_dma_buf_import-missing_attributes 
missing_attributes.c image_common.c piglit_drm_dma_buf.c)
+   piglit_add_executable(ext_image_dma_buf_import-ownership_transfer 
ownership_transfer.c image_common.c piglit_drm_dma_buf.c)
+   piglit_add_executable(ext_image_dma_buf_import-intel_unsupported_format 
intel_unsupported_format.c image_common.c piglit_drm_dma_buf.c)
+   
piglit_add_executable(ext_image_dma_buf_import-intel_external_sampler_only 
intel_external_sampler_only.c image_common.c piglit_drm_dma_buf.c)
 endif()
 
 # vim: ft=cmake:
diff --git a/tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt 
b/tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt
index 93f43fad9..2bd90e1a5 100644
--- a/tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt
+++ b/tests/spec/ext_image_dma_buf_import/CMakeLists.gles2.txt
@@ -10,17 +10,11 @@ link_libraries(
)
 
 if(PIGLIT_BUILD_DMA_BUF_TESTS)
-   add_definitions(-DHAVE_LIBDRM)
-
-   include_directories(
-   ${LIBDRM_INCLUDE_DIRS}
-   )
-
-   piglit_add_executable(ext_image_dma_buf_import-refcount refcount.c 
sample_common.c image_common.c)
-   piglit_add_executable(ext_image_dma_buf_import-sample_yuv sample_yuv.c 
sample_common.c image_common.c)
-   piglit_add_executable(ext_image_dma_buf_import-sample_rgb sample_rgb.c 
sample_common.c image_common.c)
-   
piglit_add_executable(ext_image_dma_buf_import-intel_external_sampler_with_dma_only
 intel_external_sampler_with_dma_only.c image_common.c)
-   
piglit_add_executable(ext_image_dma_buf_import-transcode-nv12-as-r8-gr88 
transcode-nv12-as-r8-gr88.c image_common.c)
+   piglit_add_executable(ext_image_dma_buf_import-refcount refcount.c 

[Piglit] [PATCH] primitive-restart: Delete more glDrawArrays tests.

2017-02-21 Thread Kenneth Graunke
This interprets the new GL 4.5 rules (don't do primitive restart for
non-indexed-draws) as a clarification, even for the old NV tests.

Mesa dropped support for this in commit 96cbc1ca29e0b1f4f4d6c868b844,
causing test regressions here.  Piglit dropped a bunch of related tests
in commit 85360e3564a12a367e115f167aec7284d69047b6, but left some.
I don't think anybody actually wants this behavior, so let's just drop
the remaining tests.

Cc: Marek Olšák 
---
 tests/general/primitive-restart.c | 120 --
 1 file changed, 120 deletions(-)

diff --git a/tests/general/primitive-restart.c 
b/tests/general/primitive-restart.c
index 83f494dd1..dfa180420 100644
--- a/tests/general/primitive-restart.c
+++ b/tests/general/primitive-restart.c
@@ -502,125 +502,6 @@ test_array_element(VBO_CFG vbo_cfg, GLenum primMode, 
GLenum indexType)
 }
 
 
-/**
- * Test glDrawArrayss() with glPrimitiveRestartIndexNV().
- * We only test a line strip.
- */
-static bool
-test_draw_arrays(VBO_CFG vbo_cfg)
-{
-#define NUM_VERTS 12
-   GLfloat verts[NUM_VERTS+2][2];
-   const GLfloat dx = 20.0;
-   GLfloat x;
-   GLuint restart_index;
-   bool pass = true;
-   const char *primStr = "GL_LINE_STRIP";
-   GLuint test;
-   const GLenum primMode = GL_LINE_STRIP;
-   GLuint vbo = 0;
-
-   x = 0.0;
-
-   /* setup vertices */
-   {
-  GLuint i;
-  const GLfloat y = 0.5 * piglit_height;
-
-  glLineWidth(5.0);
-
-  for (i = 0; i < NUM_VERTS; i++) {
- verts[i][0] = x;
- verts[i][1] = y;
- x += dx;
-  }
-   }
-
-   piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
-
-   glColor4fv(green);
-
-   if ((vbo_cfg != DISABLE_VBO) && (vbo_cfg != VBO_INDEX_ONLY)) {
-  glGenBuffers(1, );
-  glBindBuffer(GL_ARRAY_BUFFER, vbo);
-  glBufferData(GL_ARRAY_BUFFER, sizeof(verts), verts, GL_STATIC_DRAW);
-  glVertexPointer(2, GL_FLOAT, 0, (void *)0);
-   } else {
-  glVertexPointer(2, GL_FLOAT, 2*sizeof(GLfloat), verts);
-   }
-
-   glEnableClientState(GL_VERTEX_ARRAY);
-   if (!piglit_check_gl_error(GL_NO_ERROR))
-  return false;
-
-   /*
-* Render and do checks.
-* Try three different restart indexes at start, end, middle.
-*/
-   for (test = 0; test < 3 && pass; test++) {
-  /* choose the restart index */
-  if (test == 0)
- restart_index = 0;
-  else if (test == 1)
- restart_index = NUM_VERTS - 1;
-  else
- restart_index = NUM_VERTS / 2;
-
-  /* draw */
-  glClear(GL_COLOR_BUFFER_BIT);
-  enable_restart(restart_index);
-  glDrawArrays(primMode, 0, NUM_VERTS);
-  disable_restart();
-
-  /* check */
-  {
- const GLfloat x0 = 0.0;
- const GLint iy = piglit_height / 2;
- GLint i;
-
- /* probe at midpoint of each line segment */
- for (i = 0; i < NUM_VERTS - 1 && pass; i++) {
-/* test midpoint of line to see if it was drawn */
-const float fx = x0 + 0.5 * dx + i * dx;
-const int ix = (int) fx;
-
-/* read pixel */
-if (restart_index == i || restart_index == i + 1) {
-   /* pixel should NOT be drawn here */
-   if (!piglit_probe_pixel_rgb(ix, iy, black)) {
-  if (0)
- fprintf(stderr, "bad pixel drawn\n");
-  pass = false;
-   }
-}
-else {
-   /* pixel should be drawn here */
-   if (!piglit_probe_pixel_rgb(ix, iy, green)) {
-  if (0)
- fprintf(stderr, "bad pixel drawn\n");
-  pass = false;
-   }
-}
- }
-  }
-   }
-
-   piglit_present_results();
-
-   if (vbo != 0) {
-  glBindBuffer(GL_ARRAY_BUFFER, 0);
-   }
-
-   if (!pass) {
-  fprintf(stderr, "%s: failure drawing with glDrawArrays(%s), "
-  "restart index = %u\n",
-  TestName, primStr, restart_index);
-   }
-
-   return pass;
-}
-
-
 bool
 primitive_restart_test(VBO_CFG vbo_cfg)
 {
@@ -642,7 +523,6 @@ primitive_restart_test(VBO_CFG vbo_cfg)
   pass = pass && test_array_element(vbo_cfg, GL_LINE_STRIP, 
GL_UNSIGNED_BYTE);
   pass = pass && test_array_element(vbo_cfg, GL_LINE_STRIP, 
GL_UNSIGNED_SHORT);
   pass = pass && test_array_element(vbo_cfg, GL_LINE_STRIP, 
GL_UNSIGNED_INT);
-  pass = pass && test_draw_arrays(vbo_cfg);
}
 
if (Have_31) {
-- 
2.11.1

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


[Piglit] [PATCH] arb_transform_feedback_overflow_query: skip QBO subtests if unsupported

2017-02-21 Thread Kenneth Graunke
We need GL_ARB_query_buffer_object to run the GL_QUERY_BUFFER subtests.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
Cc: Rafael Antognolli <rafael.antogno...@intel.com>
---
 tests/spec/arb_transform_feedback_overflow_query/basic.c | 6 ++
 1 file changed, 6 insertions(+)

diff --git a/tests/spec/arb_transform_feedback_overflow_query/basic.c 
b/tests/spec/arb_transform_feedback_overflow_query/basic.c
index 25c335578..0ca0afe6a 100644
--- a/tests/spec/arb_transform_feedback_overflow_query/basic.c
+++ b/tests/spec/arb_transform_feedback_overflow_query/basic.c
@@ -244,6 +244,12 @@ run_subtest(int n_streams, int array_sizes[], int stream, 
GLuint query_type,
const char *gs_text;
const char **gs_varyings;
 
+   if (!strcmp(test_type, "buffer_object") &&
+   !piglit_is_extension_supported("GL_ARB_query_buffer_object")) {
+   piglit_loge("context does not support "
+   "GL_ARB_query_buffer_object; skipping test");
+   return PIGLIT_SKIP;
+   }
 
if (n_streams > 1) {
if (!check_multistream_extensions())
-- 
2.11.1

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


Re: [Piglit] [PATCH] getteximage-formats: Disable dithering during glDrawPixels

2017-01-30 Thread Kenneth Graunke
On Monday, January 30, 2017 11:12:44 AM PST Chad Versace wrote:
> The test generates a mipmap by "copying" a client-array of pixels to
> miplevel 0 with glDrawPixels, then calling glGenerateMipmap. The test
> expects the rendered level 0 to match the client-array source. Dithering
> during glDrawPixels inteferes with that expectation.
> 
> Fixes on Intel Skylake:
>   spec.ext_framebuffer_object.getteximage-formats init-by-clear-and-render
>   spec.ext_framebuffer_object.getteximage-formats init-by-render
> 
> Regressed by Mesa:
>   commit c4b87f129eb036c9615df3adcc1cebd9df10fc84
>   Author: Chad Versace <chadvers...@chromium.org>
>   Subject: meta: Disable dithering during glGenerateMipmap
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99266
> Cc: Mark Janes <mark.a.ja...@intel.com>
> Cc: Kenneth Graunke <kenn...@whitecape.org>
> ---
>  tests/texturing/getteximage-formats.c | 25 +
>  1 file changed, 25 insertions(+)
> 
> diff --git a/tests/texturing/getteximage-formats.c 
> b/tests/texturing/getteximage-formats.c
> index 6f4fb029e..02d78d441 100644
> --- a/tests/texturing/getteximage-formats.c
> +++ b/tests/texturing/getteximage-formats.c
> @@ -110,8 +110,33 @@ make_texture_image(GLenum intFormat, GLubyte 
> upperRightTexel[4])
>  
>   glViewport(0, 0, TEX_SIZE, TEX_SIZE);
>  
> + /* Disable dithering during glDrawPixels to prevent
> +  * disagreement with glGenerateMipmap.  The spec requires
> +  * glDrawPixels to respect the dither state, but the spec
> +  * strongly implies that glGenerateMipmap should not dither.
> +  *
> +  * On dithering and glDrawPixels, see the OpenGL 4.5
> +  * Compatibility Specification, Section 18.1 Drawing Pixels,
> +  * p620:
> +  *
> +  *   Once pixels are transferred, DrawPixels performs final
> +  *   conversion on pixel values [...] which are processed in
> +  *   the same fashion as fragments generated by rasterization
> +  *   (see chapters 15 and 16).
> +  *
> +  * On dithering and glGenerateMipmap, see the Mesa commit
> +  * message in:
> +  *
> +  *   commit c4b87f129eb036c9615df3adcc1cebd9df10fc84
> +  *   Author: Chad Versace <chadvers...@chromium.org>
> +  *   Date:   Thu Dec 29 13:05:27 2016 -0800
> +  *   Subject: meta: Disable dithering during glGenerateMipmap
> +  */
> + glDisable(GL_DITHER);
>   glWindowPos2iARB(0, 0);
>   glDrawPixels(TEX_SIZE, TEX_SIZE, GL_RGBA, GL_UNSIGNED_BYTE, 
> tex);
> +         glEnable(GL_DITHER);
> +
>   glGenerateMipmap(GL_TEXTURE_2D);
>  
>   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
> 

Thank you, Chad!

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] glsl-1.10: return lowering tests

2016-12-19 Thread Kenneth Graunke
On Tuesday, December 20, 2016 2:32:43 PM PST Timothy Arceri wrote:
> ---
>  .../vs-nested-return-sibling-if.shader_test| 53 
> ++
>  .../vs-nested-return-sibling-if2.shader_test   | 53 
> ++
>  .../vs-nested-return-sibling-loop.shader_test  | 53 
> ++
>  .../vs-nested-return-sibling-loop2.shader_test | 53 
> ++
>  4 files changed, 212 insertions(+)
>  create mode 100644 
> tests/spec/glsl-1.10/execution/vs-nested-return-sibling-if.shader_test
>  create mode 100644 
> tests/spec/glsl-1.10/execution/vs-nested-return-sibling-if2.shader_test
>  create mode 100644 
> tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop.shader_test
>  create mode 100644 
> tests/spec/glsl-1.10/execution/vs-nested-return-sibling-loop2.shader_test

These look great.

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] Add a test for FDO bug #99154

2016-12-19 Thread Kenneth Graunke
On Monday, December 19, 2016 11:57:01 PM PST Niels Ole Salscheider wrote:
> builtin_builder::binop creates variables named x and y. Because of
> a bug these variables had mode ir_var_auto instead of
> ir_var_temporary. In this case, the variable names can collide when
> the function is inlined later on.
> Linking will fail in this test if this is the case.
> 
> Signed-off-by: Niels Ole Salscheider <niels_...@salscheider-online.de>

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

and pushed:

To ssh://git.freedesktop.org/git/piglit
   706de0e..b53a7c6  master -> master



signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] fbo-maxsize: Try to avoid allocating miplevels.

2016-12-12 Thread Kenneth Graunke
On Monday, December 12, 2016 10:14:35 AM PST Eric Anholt wrote:
> Kenneth Graunke <kenn...@whitecape.org> writes:
> 
> > A 16384x16384 RGBA buffer takes 1GB of RAM.  If the driver allocates
> > mipmap levels, that increases our storage requirements to 1.5GB.  The
> > test doesn't use mipmapping, so this seems like a waste.
> >
> > Disabling mipmap filtering before allocating the texture provides a hint
> > to the driver, suggesting that it should only allocate space for the
> > base level.  Most Mesa drivers (Gallium and i965) follow this practice.
> >
> > Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
> 
> It would probably be good for coverage if the fbo-maxsize test tested
> that you could render all the way down the miptree of a maximum-sized
> FBO, but given that it doesnt, this is:
> 
> Reviewed-by: Eric Anholt <e...@anholt.net>
> 

Thanks!  I screwed up and missed applying the Reviewed-by tag, and
apparently Piglit doesn't allow non-fast-forward pushes (like Mesa),
so I can't fix it.  Sorry :(


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] fbo-maxsize: Try to avoid allocating miplevels.

2016-12-10 Thread Kenneth Graunke
A 16384x16384 RGBA buffer takes 1GB of RAM.  If the driver allocates
mipmap levels, that increases our storage requirements to 1.5GB.  The
test doesn't use mipmapping, so this seems like a waste.

Disabling mipmap filtering before allocating the texture provides a hint
to the driver, suggesting that it should only allocate space for the
base level.  Most Mesa drivers (Gallium and i965) follow this practice.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 tests/fbo/fbo-maxsize.c | 5 +
 1 file changed, 5 insertions(+)

diff --git a/tests/fbo/fbo-maxsize.c b/tests/fbo/fbo-maxsize.c
index 64dcd99..cec6716 100644
--- a/tests/fbo/fbo-maxsize.c
+++ b/tests/fbo/fbo-maxsize.c
@@ -107,6 +107,11 @@ static int create_fbo(void)
glGenTextures(1, );
glBindTexture(GL_TEXTURE_2D, tex);
 
+   /* Turn off mipmap filtering as a hint to the driver that we don't
+* need multiple mipmap levels (as those can increase the memory
+* requirements by 50%, and we don't need them in this test.
+*/
+   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, maxsize, maxsize,
 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
 
-- 
2.10.2

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


Re: [Piglit] [PATCH] framework/profile: Use re.IGNORECASE for RegexFilter

2016-11-19 Thread Kenneth Graunke
On Wednesday, November 16, 2016 11:51:13 AM PST Dylan Baker wrote:
> This flag makes the regular expressions match case-insensitive, and is
> useful since piglit treats test names as case insensitive (lowering them
> all by default). This was inadvertently changed to not use the flag in
> e92555a647, which replaced the part that added this flag with a simpler
> implementation, so this patch reverts to the previous behavior.
> 
> cc: Alejandro Piñeiro <apinhe...@igalia.com>
> Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> ---
>  framework/profile.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/framework/profile.py b/framework/profile.py
> index 78b3a2d..94efd0a 100644
> --- a/framework/profile.py
> +++ b/framework/profile.py
> @@ -75,7 +75,7 @@ class RegexFilter(object):
>  """
>  
>  def __init__(self, filters, inverse=False):
> -self.filters = [re.compile(f) for f in filters]
> +self.filters = [re.compile(f, flags=re.IGNORECASE) for f in filters]
>  self.inverse = inverse
>  
>  def __call__(self, name, _):  # pylint: disable=invalid-name
> 

Given that we already destroy the original case in test names,
this makes sense to me.

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] draw-vertices-half-float: Add coverage for GL_OES_vertex_half_float

2016-11-09 Thread Kenneth Graunke
On Monday, October 10, 2016 2:25:02 PM PST Kevin Strasser wrote:
> Add ES2 implementation to the test to provide coverage for
> GL_OES_vertex_half_float extension. The tests will continue to pass on mesa
> for desktop GL as well as ES2 once supported is added.
> 
> Signed-off-by: Kevin Strasser 

Pushed with Tapani's review.  Thanks!


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [Patch 1/1] texelFetch, textureSize: replace deprecated gl_FragColor

2016-11-09 Thread Kenneth Graunke
On Wednesday, November 9, 2016 3:18:36 PM PST Sebastian Olender wrote:
> According to GLSLLangSpec: Use of gl_FragData and gl_FragColor
> is deprecated in version 1.3, using user-defined out instead.
> ---
>  tests/texturing/shaders/texelFetch.c  | 9 ++---
>  tests/texturing/shaders/textureSize.c | 9 ++---
>  2 files changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/texturing/shaders/texelFetch.c 
> b/tests/texturing/shaders/texelFetch.c
> index 0291a12..2e1d223 100644
> --- a/tests/texturing/shaders/texelFetch.c
> +++ b/tests/texturing/shaders/texelFetch.c
> @@ -627,9 +627,10 @@ generate_GLSL(enum shader_target test_stage)
>"#version %d\n"
>"flat in %s color;\n"
>"uniform vec4 divisor;\n"
> +  "out vec4 fragColor;\n"
>"void main()\n"
>"{\n"
> -  "gl_FragColor = vec4(color)/divisor;\n"
> +  "fragColor = vec4(color)/divisor;\n"
>"}\n",
>shader_version,
>sampler.return_type);
> @@ -676,9 +677,10 @@ generate_GLSL(enum shader_target test_stage)
>"#version %d\n"
>"flat in %s color;\n"
>"uniform vec4 divisor;\n"
> +  "out vec4 fragColor;\n"
>"void main()\n"
>"{\n"
> -  "gl_FragColor = vec4(color)/divisor;\n"
> +  "fragColor = vec4(color)/divisor;\n"
>"}\n",
>shader_version,
>sampler.return_type);
> @@ -703,10 +705,11 @@ generate_GLSL(enum shader_target test_stage)
>"flat in ivec4 tc;\n"
>"uniform vec4 divisor;\n"
>"uniform %s tex;\n"
> +  "out vec4 fragColor;\n"
>"void main()\n"
>"{\n"
>"vec4 color = texelFetch%s(tex, ivec%d(tc)%s%s);\n"
> -  "gl_FragColor = color/divisor;\n"
> +  "fragColor = color/divisor;\n"
>"}\n",
>shader_version,
>has_samples() ? "#extension 
> GL_ARB_texture_multisample: require" : "",
> diff --git a/tests/texturing/shaders/textureSize.c 
> b/tests/texturing/shaders/textureSize.c
> index c02c566..ac3df04 100644
> --- a/tests/texturing/shaders/textureSize.c
> +++ b/tests/texturing/shaders/textureSize.c
> @@ -284,9 +284,10 @@ generate_GLSL(enum shader_target test_stage)
>"#define ivec1 int\n"
>"#define vec1 float\n"
>"flat in ivec%d size;\n"
> +  "out vec4 fragColor;\n"
>"void main()\n"
>"{\n"
> -  "gl_FragColor = vec4(0.01 * size,%s 1);\n"
> +  "fragColor = vec4(0.01 * size,%s 1);\n"
>"}\n",
>shader_version, size, zeroes[3 - size]);
>   break;
> @@ -325,9 +326,10 @@ generate_GLSL(enum shader_target test_stage)
>"#define ivec1 int\n"
>"#define vec1 float\n"
>"flat in ivec%d size;\n"
> +  "out vec4 fragColor;\n"
>"void main()\n"
>"{\n"
> -  "gl_FragColor = vec4(0.01 * size,%s 1);\n"
> +  "fragColor = vec4(0.01 * size,%s 1);\n"
>"}\n",
>shader_version, size, zeroes[3 - size]);
>   break;
> @@ -345,10 +347,11 @@ generate_GLSL(enum shader_target test_stage)
>"#define ivec1 int\n"
>"uniform int lod;\n"
>"uniform %s tex;\n"
> +  "out vec4 fragColor;\n"
>"void main()\n"
>"{\n"
>"ivec%d size = textureSize(tex%s);\n"
> -  "gl_FragColor = vec4(0.01 * size,%s 1);\n"
> +  "fragColor = vec4(0.01 * size,%s 1);\n"
>"}\n",
>shader_version, extension, sampler.name, size, lod_arg,
>zeroes[3 - size]);
> 

I don't have a problem with this patch, but out of curiosity, is there
some reason you need to make this change?  gl_FragColor may be deprecated 
in 1.30 but it didn't actually go away until 4.20.

--Ken


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Delete GLSL ES 3.00 "nonflat" negative parser tests.

2016-10-05 Thread Kenneth Graunke
The GLSL ES specification is being updated to remove the rule that
these tests are trying to enforce.  Now that ES has geometry and
tessellation shaders, it makes sense that it would move to follow
modern desktop GL rules, which don't enforce this restriction.

Bugzilla: https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15465#c7
---
 .../nonflat-int-array.vert | 23 -
 .../interpolation-qualifiers/nonflat-int.vert  | 22 
 .../interpolation-qualifiers/nonflat-ivec4.vert| 22 
 .../interpolation-qualifiers/nonflat-uint.vert | 22 
 .../interpolation-qualifiers/nonflat-uvec4.vert| 22 
 .../varying-struct-nonflat-int.vert| 29 --
 .../varying-struct-nonflat-uint.vert   | 29 --
 7 files changed, 169 deletions(-)
 delete mode 100644 
tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int-array.vert
 delete mode 100644 
tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int.vert
 delete mode 100644 
tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-ivec4.vert
 delete mode 100644 
tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uint.vert
 delete mode 100644 
tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uvec4.vert
 delete mode 100644 
tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-int.vert
 delete mode 100644 
tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/varying-struct-nonflat-uint.vert

diff --git 
a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int-array.vert
 
b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int-array.vert
deleted file mode 100644
index 6a5aa17..000
--- 
a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int-array.vert
+++ /dev/null
@@ -1,23 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 3.00 es
-// check_link: true
-// [end config]
-//
-// Declare a non-flat integral vertex output.
-//
-// From section 4.3.6 ("Output Variables") of the GLSL ES 3.00 spec:
-//"Vertex shader inputs that are, or contain, signed or unsigned
-//integers or integer vectors must be qualified with the
-//interpolation qualifier flat."
-
-#version 300 es
-
-out int[2] x;
-
-void main()
-{
-   gl_Position = vec4(0.0);
-   x[0] = 1;
-   x[1] = 2;
-}
diff --git 
a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int.vert 
b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int.vert
deleted file mode 100644
index 2e3dde0..000
--- a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-int.vert
+++ /dev/null
@@ -1,22 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 3.00 es
-// check_link: true
-// [end config]
-//
-// Declare a non-flat integral vertex output.
-//
-// From section 4.3.6 ("Output Variables") of the GLSL ES 3.00 spec:
-//"Vertex shader inputs that are, or contain, signed or unsigned
-//integers or integer vectors must be qualified with the
-//interpolation qualifier flat."
-
-#version 300 es
-
-out int x;
-
-void main()
-{
-   gl_Position = vec4(0.0);
-   x = 1;
-}
diff --git 
a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-ivec4.vert 
b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-ivec4.vert
deleted file mode 100644
index d28b885..000
--- 
a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-ivec4.vert
+++ /dev/null
@@ -1,22 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 3.00 es
-// check_link: true
-// [end config]
-//
-// Declare a non-flat integral vertex output.
-//
-// From section 4.3.6 ("Output Variables") of the GLSL ES 3.00 spec:
-//"Vertex shader inputs that are, or contain, signed or unsigned
-//integers or integer vectors must be qualified with the
-//interpolation qualifier flat."
-
-#version 300 es
-
-out ivec4 x;
-
-void main()
-{
-   gl_Position = vec4(0.0);
-   x = ivec4(1, 2, 3, 4);
-}
diff --git 
a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uint.vert 
b/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uint.vert
deleted file mode 100644
index 6361db5..000
--- 
a/tests/spec/glsl-es-3.00/compiler/interpolation-qualifiers/nonflat-uint.vert
+++ /dev/null
@@ -1,22 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 3.00 es
-// check_link: true
-// [end config]
-//
-// Declare a non-flat integral vertex output.
-//
-// From section 4.3.6 ("Output Variables") of the GLSL ES 3.00 spec:
-//"Vertex shader inputs that are, or contain, signed or unsigned
-//integers or integer vectors must be qualified with the
-//interpolation qualifier flat."
-
-#version 300 es
-
-out uint x;
-
-void main()
-{
-   gl_Position = vec4(0.0);
-   x = 1u;
-}
diff 

Re: [Piglit] [PATCH] xts: Put the XTS results files in the piglit results directory.

2016-09-26 Thread Kenneth Graunke
On Saturday, September 24, 2016 11:47:22 AM PDT Eric Anholt wrote:
> Fixes races in the X Server's make check environment, which runs
> multiple "piglit-run.py -t xts" in parallel and would have the two
> runs overwriting each other's logs in between execution and parsing.
> ---
> 
> Note: I've noticed that image results from xts are broken as well, and
> I haven't debugged them yet.
> 
>  tests/xts.py | 26 +-
>  1 file changed, 21 insertions(+), 5 deletions(-)

LGTM.

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] arb_viewport_array: rework tests to work with GL_OES_viewport_array

2016-09-17 Thread Kenneth Graunke
On Friday, September 16, 2016 3:38:49 PM PDT Ilia Mirkin wrote:
> This makes some fairly simple changes to the existing tests to also work
> with GL_OES_viewport_array, which presents largely identical
> functionality. All of the tests continue to pass with desktop GL, and
> also work with my soon-to-be-posted GL ES implementation for mesa.
> 
> Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu>

I skimmed through this and it looks fine to me

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Fix TCS input array length in tcs-input-read-nonconst* tests.

2016-08-31 Thread Kenneth Graunke
According to the ARB_tessellation_shader spec,

   "Declaring an array size is optional.  If no size is specified, it
will be taken from the implementation-dependent maximum patch size
(gl_MaxPatchVertices).  If a size is specified, it must match the
maximum patch size; otherwise, a compile or link error will occur."

Just drop the explicit array size.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 .../execution/tcs-input-read-nonconst-interface.shader_test | 2 +-
 .../execution/tcs-input-read-nonconst.shader_test   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/tests/spec/arb_tessellation_shader/execution/tcs-input-read-nonconst-interface.shader_test
 
b/tests/spec/arb_tessellation_shader/execution/tcs-input-read-nonconst-interface.shader_test
index c83e6fb..f44c528 100644
--- 
a/tests/spec/arb_tessellation_shader/execution/tcs-input-read-nonconst-interface.shader_test
+++ 
b/tests/spec/arb_tessellation_shader/execution/tcs-input-read-nonconst-interface.shader_test
@@ -23,7 +23,7 @@ void main()
 
 in block {
float v;
-} verts[2];
+} verts[];
 layout(vertices = 1) out;
 
 void main()
diff --git 
a/tests/spec/arb_tessellation_shader/execution/tcs-input-read-nonconst.shader_test
 
b/tests/spec/arb_tessellation_shader/execution/tcs-input-read-nonconst.shader_test
index 2e3d1ff..591c9f1 100644
--- 
a/tests/spec/arb_tessellation_shader/execution/tcs-input-read-nonconst.shader_test
+++ 
b/tests/spec/arb_tessellation_shader/execution/tcs-input-read-nonconst.shader_test
@@ -19,7 +19,7 @@ void main()
 #version 150
 #extension GL_ARB_tessellation_shader : require
 
-in float v[2];
+in float v[];
 layout(vertices = 1) out;
 
 void main()
-- 
2.9.3

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


Re: [Piglit] [PATCH] glsl-1.50: add tests to verify that clip distance in VS doesn't mess up GS

2016-08-19 Thread Kenneth Graunke
On Friday, August 19, 2016 4:23:59 PM PDT Ilia Mirkin wrote:
> This includes both SSO and non-SSO versions of the same test, as they
> can end up hitting slightly different code paths.
> 
> Note: this presently fails on all intel generations
> 
> Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu>
> ---
>  .../clip-distance-vs-gs-out-sso.shader_test| 54 
> ++
>  .../geometry/clip-distance-vs-gs-out.shader_test   | 53 +
>  2 files changed, 107 insertions(+)
>  create mode 100644 
> tests/spec/glsl-1.50/execution/geometry/clip-distance-vs-gs-out-sso.shader_test
>  create mode 100644 
> tests/spec/glsl-1.50/execution/geometry/clip-distance-vs-gs-out.shader_test

Thanks for adding tests for this!
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/2] util: Add GL 4.4/4.5 to required_gl_version_from_glsl_version.

2016-08-11 Thread Kenneth Graunke
Fixes glslparsertest with an argument of 4.40 / 4.50.
---
 tests/util/piglit-util-gl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index 926a6b7..75d634c 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -644,6 +644,8 @@ required_gl_version_from_glsl_version(unsigned glsl_version)
case 410: return 41;
case 420: return 42;
case 430: return 43;
+   case 440: return 44;
+   case 450: return 45;
default: return 0;
}
 }
-- 
2.9.2

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


[Piglit] [PATCH 2/2] Add a simple parser test for 'inout' in 4.40.

2016-08-11 Thread Kenneth Graunke
Currently fails on Mesa, but I have a patch to fix it.
---
 .../glsl-4.40/compiler/inout-parameter-qualifier.frag   | 17 +
 1 file changed, 17 insertions(+)
 create mode 100644 tests/spec/glsl-4.40/compiler/inout-parameter-qualifier.frag

diff --git a/tests/spec/glsl-4.40/compiler/inout-parameter-qualifier.frag 
b/tests/spec/glsl-4.40/compiler/inout-parameter-qualifier.frag
new file mode 100644
index 000..feacc85
--- /dev/null
+++ b/tests/spec/glsl-4.40/compiler/inout-parameter-qualifier.frag
@@ -0,0 +1,17 @@
+// [config]
+// expect_result: pass
+// glsl_version: 4.40
+// check_link: false
+// [end config]
+
+#version 440
+
+/* At one point, Mesa broke inout parameter qualifier handling when
+ * trying to validate the xfb_buffer enhanced layouts qualifier.
+ */
+void
+f(inout float x)
+{
+x += 1.0;
+}
+
-- 
2.9.2

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


[Piglit] [PATCH - Mesa 09/10] meta: Make Meta's BlitFramebuffer() follow the GL 4.4 sRGB rules.

2016-08-04 Thread Kenneth Graunke
Just avoid whacking GL_FRAMEBUFFER_SRGB altogether, so we respect
the application's setting.  This appears to work.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 src/mesa/drivers/common/meta_blit.c | 80 +
 1 file changed, 28 insertions(+), 52 deletions(-)

Metaaa!!!

diff --git a/src/mesa/drivers/common/meta_blit.c 
b/src/mesa/drivers/common/meta_blit.c
index d6d3a42..8a79725 100644
--- a/src/mesa/drivers/common/meta_blit.c
+++ b/src/mesa/drivers/common/meta_blit.c
@@ -606,7 +606,6 @@ blitframebuffer_texture(struct gl_context *ctx,
 GLenum filter, GLint flipX, GLint flipY,
 GLboolean glsl_version, GLboolean do_depth)
 {
-   struct save_state *save = >Meta->Save[ctx->Meta->SaveStackDepth - 1];
int att_index = do_depth ? BUFFER_DEPTH : readFb->_ColorReadBufferIndex;
const struct gl_renderbuffer_attachment *readAtt =
   >Attachment[att_index];
@@ -719,57 +718,32 @@ blitframebuffer_texture(struct gl_context *ctx,
fb_tex_blit.samp_obj = _mesa_meta_setup_sampler(ctx, texObj, target, filter,
srcLevel);
 
-   /* For desktop GL, we do our blits with no net sRGB decode or encode.
-*
-* However, if both the src and dst can be srgb decode/encoded, enable them
-* so that we do any blending (from scaling or from MSAA resolves) in the
-* right colorspace.
-*
-* Our choice of not doing any net encode/decode is from the GL 3.0
-* specification:
-*
-* "Blit operations bypass the fragment pipeline. The only fragment
-*  operations which affect a blit are the pixel ownership test and the
-*  scissor test."
-*
-* The GL 4.4 specification disagrees and says that the sRGB part of the
-* fragment pipeline applies, but this was found to break applications
-* (such as Left 4 Dead 2).
-*
-* However, for ES 3.0, we follow the specification and perform sRGB
-* decoding and encoding.  The specification has always been clear in
-* the ES world, and hasn't changed over time.
-*/
if (ctx->Extensions.EXT_texture_sRGB_decode) {
-  bool src_srgb = _mesa_get_format_color_encoding(rb->Format) == GL_SRGB;
-  if (save->API == API_OPENGLES2 && ctx->Version >= 30) {
- /* From the ES 3.0.4 specification, page 198:
-  * "When values are taken from the read buffer, if the value of
-  *  FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING for the framebuffer
-  *  attachment corresponding to the read buffer is SRGB (see section
-  *  6.1.13), the red, green, and blue components are converted from
-  *  the non-linear sRGB color space according to equation 3.24.
-  *
-  *  When values are written to the draw buffers, blit operations
-  *  bypass the fragment pipeline. The only fragment operations which
-  *  affect a blit are the pixel ownership test, the scissor test,
-  *  and sRGB conversion (see section 4.1.8)."
-  */
- _mesa_set_sampler_srgb_decode(ctx, fb_tex_blit.samp_obj,
-   src_srgb ? GL_DECODE_EXT
-: GL_SKIP_DECODE_EXT);
- _mesa_set_framebuffer_srgb(ctx, drawFb->Visual.sRGBCapable);
-  } else {
- if (src_srgb && drawFb->Visual.sRGBCapable) {
-_mesa_set_sampler_srgb_decode(ctx, fb_tex_blit.samp_obj,
-  GL_DECODE_EXT);
-_mesa_set_framebuffer_srgb(ctx, GL_TRUE);
- } else {
-_mesa_set_sampler_srgb_decode(ctx, fb_tex_blit.samp_obj,
-  GL_SKIP_DECODE_EXT);
-/* set_framebuffer_srgb was set by _mesa_meta_begin(). */
- }
-  }
+  /* The GL 4.4 spec, section 18.3.1 ("Blitting Pixel Rectangles") says:
+   *
+   *"When values are taken from the read buffer, if FRAMEBUFFER_SRGB
+   * is enabled and the value of FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING
+   * for the framebuffer attachment corresponding to the read buffer
+   * is SRGB (see section 9.2.3), the red, green, and blue components
+   * are converted from the non-linear sRGB color space according to
+   * equation 3.24.
+   *
+   * When values are written to the draw buffers, blit operations
+   * bypass most of the fragment pipeline.  The only fragment
+   * operations which affect a blit are the pixel ownership test,
+   * the scissor test, and sRGB conversion (see section 17.3.9)."
+   *
+   * ES 3.0 contains nearly the exact same text, but omits the part
+   * about GL_FRAMEBUFFER_SRGB as that doesn't exist in ES.  Mesa
+   * defaults it 

[Piglit] [PATCH - Mesa 07/10] i965: Make BLORP do sRGB encode/decode on ES 2 as well.

2016-08-04 Thread Kenneth Graunke
This should have no effect, as all drivers which support BLORP also
support ES 3.0 - so ES 2.0 would be promoted and follow the ES 3 rules.

ES 1.0 doesn't have BlitFramebuffer.

This is purely to clarify the next patch a bit.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp 
b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 7532aac..20bbe7f 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -65,7 +65,7 @@ do_blorp_blit(struct brw_context *brw, GLbitfield buffer_bit,
struct intel_mipmap_tree *src_mt = find_miptree(buffer_bit, src_irb);
struct intel_mipmap_tree *dst_mt = find_miptree(buffer_bit, dst_irb);
 
-   const bool es3 = _mesa_is_gles3(>ctx);
+   const bool es = _mesa_is_gles(>ctx);
/* Do the blit */
brw_blorp_blit_miptrees(brw,
src_mt, src_irb->mt_level, src_irb->mt_layer,
@@ -75,7 +75,7 @@ do_blorp_blit(struct brw_context *brw, GLbitfield buffer_bit,
srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1,
filter, mirror_x, mirror_y,
-   es3, es3);
+   es, es);
 
dst_irb->need_downsample = true;
 }
-- 
2.9.2

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


[Piglit] [PATCH - Piglit 03/10] Change arb_framebuffer_srgb/blit to follow GL 4.4+ rules.

2016-08-04 Thread Kenneth Graunke
OpenGL originally never did sRGB decode/encode for BlitFramebuffer.
OpenGL ES 3.x has always done sRGB decode/encode for BlitFramebuffer.

OpenGL 4.x specifications attempted to unify this behavior, and
ultimately settled on doing decode/encode if GL_FRAMEBUFFER_SRGB is
enabled, which allows the full flexibility.  In the process, 4.1,
4.2, early 4.3, and later 4.3 all had somewhat broken rules.

This test was originally written when the latest specification (early
4.3) contained completely contradictory rules, and so simply enforced
a "copy the data unchanged" policy.  This patch updates it to follow
the rules they finally settled on for GL 4.4 and 4.5.

Thanks to Gu Yang and Miao Qiankun for their help analyzing the
differences between the various specifications.

This fixes 20 subtests with NVIDIA 367.35 on a GTX 980:
- blit {renderbuffer,texture} {linear_to_srgb,srgb_to_linear}
  {downsample, msaa, scaled, single_sampled, upsample} enabled

This will break those test cases for Mesa drivers.  I have patches
to make i965 handle the updated rules correctly.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 tests/spec/arb_framebuffer_srgb/blit.c | 160 ++---
 1 file changed, 128 insertions(+), 32 deletions(-)

diff --git a/tests/spec/arb_framebuffer_srgb/blit.c 
b/tests/spec/arb_framebuffer_srgb/blit.c
index ff07ad7..7518d37f 100644
--- a/tests/spec/arb_framebuffer_srgb/blit.c
+++ b/tests/spec/arb_framebuffer_srgb/blit.c
@@ -25,37 +25,30 @@
  *
  * Test the sRGB behaviour of blits.
  *
- * The GL 4.3 spec is contradictory about how blits should be handled
- * when the source or destination buffer is sRGB.  From section 18.3.1
- * Blitting Pixel Rectangles:
+ * The various GL 4.x specifications contain a lot of conflicting rules
+ * about how blits should be handled when the source or destination buffer
+ * is sRGB.
  *
- * (1) When values are taken from the read buffer, if the value of
- * FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING for the framebuffer
- * attachment corresponding to the read buffer is SRGB (see
- * section 9.2.3), the red, green, and blue components are
+ * Here are the latest rules from GL 4.4 (October 18th, 2013)
+ * section 18.3.1 Blitting Pixel Rectangles:
+ *
+ * (1) When values are taken from the read buffer, if [[FRAMEBUFFER_SRGB
+ * is enabled and]] the value of FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING
+ * for the framebuffer attachment corresponding to the read buffer is
+ * SRGB (see section 9.2.3), the red, green, and blue components are
  * converted from the non-linear sRGB color space according to
  * equation 8.14.
  *
- * (2) When values are taken from the read buffer, no linearization is
- * performed even if the format of the buffer is SRGB.
- *
- * (3) When values are written to the draw buffers, blit operations
+ * (2) When values are written to the draw buffers, blit operations
  * bypass most of the fragment pipeline. The only fragment
  * operations which affect a blit are the pixel ownership test,
  * the scissor test, and sRGB conversion (see section
  * 17.3.9). Color, depth, and stencil masks (see section 17.4.2)
  * are ignored.
  *
- * (4) If SAMPLE_BUFFERS for either the read framebuffer or draw
- * framebuffer is greater than zero, no copy is performed and an
- * INVALID_OPERATION error is generated if the dimensions of the
- * source and destination rectangles provided to BlitFramebuffer
- * are not identical, or if the formats of the read and draw
- * framebuffers are not identical.
- *
  * And from section 17.3.9 sRGB Conversion:
  *
- * (5) If FRAMEBUFFER_SRGB is enabled and the value of
+ * (3) If FRAMEBUFFER_SRGB is enabled and the value of
  * FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING for the framebuffer
  * attachment corresponding to the destination buffer is SRGB1
  * (see section 9.2.3), the R, G, and B values after blending are
@@ -64,19 +57,89 @@
  * the value of FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING is not SRGB,
  * then ... [no conversion is applied].
  *
- * Paragraphs (1) and (2) seem irreconcilable: the first says that
- * linearization should happen when reading from SRGB buffers, the
- * second says that it shouldn't.
+ * Rules differ in other specifications:
+ *
+ * ---
+ *
+ * ES 3.0 contains identical rules, however, ES has no FRAMEBUFFER_SRGB
+ * setting.  References to that are deleted, making encode and decode
+ * happen regardless.
+ *
+ * ---
+ *
+ * The GL 4.3 revision from February 14th, 2013 deletes the bracketed
+ * text in paragraph (1), which appears to indicate that sRGB decode
+ * should happen regardless of the GL_FRAMEBUFFER_SRGB setting.
+ *
+ * This forces decode, but allows encode or no encode.  This makes it
+ * impossible to do blits in a linear c

[Piglit] Switching to the GL 4.4 sRGB rules for glBlitFramebuffer().

2016-08-04 Thread Kenneth Graunke
Hello,

This combined patch series updates both Piglit and Mesa to implement
the modern GL 4.4+ rules for sRGB encoding/decoding in BlitFramebuffer().

The new GL 4.4 rules make it possible to match the behavior of ES 3.x
(always encode and decode), and the old behavior (never encode or decode).
If GL_FRAMEBUFFER_SRGB is enabled, encode and decode happen.  If not,
no conversions apply.  This is a change in behavior, which could break
applications.

Paul Berry wrote Piglit tests in 2012 which matched the NVIDIA driver
behavior at the time, which was to never apply conversions.  It appears
that NVIDIA has changed their behavior, and now implements the GL 4.4
rules.  They fail the Piglit tests, but begin passing after my patches.
I'm told that AMD/Catalyst follows the 4.4+ rules too, but I haven't
tested that personally.

Left 4 Dead 2 used to require the old behavior, but I retested with
these patches, and it seems to be working fine.  I'm assuming they
updated their application when the closed drivers changed behavior.

I've updated Gallium, Meta, and i965/blorp.  Please review - this
will impact everyone.  I highly recommend reading patch 3, as it
summarizes the changes in all GL 4.x specs.

Because working on sRGB drives people insane, here's an ode to
non-linear colorspaces:

sRGB rules, GL broke
some rendering glistened brightly
some rendering grew bleak
spec reformulations greatly bewilder
surprisingly reasonable GL became

should review go badly,
submitter's rationality goes b'bye

Thanks,
--Ken

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


[Piglit] [PATCH - Mesa 08/10] i965: Make BLORP's BlitFramebuffer follow the GL 4.4 sRGB rules.

2016-08-04 Thread Kenneth Graunke
OpenGL 4.4 specifies that BlitFramebuffer should perform sRGB encode
and decode like ES 3.x does, but only when GL_FRAMEBUFFER_SRGB is
enabled.  This is technically incompatible in certain cases, but is
more consistent across GL, ES, and WebGL, and more flexible.

The NVIDIA 367.35 drivers appear to follow this behavior.

For the awful spec analysis, please read Piglit's
tests/spec/arb_framebuffer_srgb/blit.c, which explains the differences
between GL 4.1, 4.2, 4.3 (2012), 4.3 (2013), and 4.4, and why this
is the right rule to implement.

Note that ctx->Color.sRGBEnabled is initialized to _mesa_is_gles(ctx),
and ES doesn't have enable/disable flags for GL_FRAMEBUFFER_SRGB, so
it's effectively on all the time.  This means the ES behavior should
be unchanged.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp 
b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 20bbe7f..b903de1 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -61,11 +61,14 @@ do_blorp_blit(struct brw_context *brw, GLbitfield 
buffer_bit,
   GLfloat dstX0, GLfloat dstY0, GLfloat dstX1, GLfloat dstY1,
   GLenum filter, bool mirror_x, bool mirror_y)
 {
+   const struct gl_context *ctx = >ctx;
+
/* Find source/dst miptrees */
struct intel_mipmap_tree *src_mt = find_miptree(buffer_bit, src_irb);
struct intel_mipmap_tree *dst_mt = find_miptree(buffer_bit, dst_irb);
 
-   const bool es = _mesa_is_gles(>ctx);
+   const bool do_srgb = ctx->Color.sRGBEnabled;
+
/* Do the blit */
brw_blorp_blit_miptrees(brw,
src_mt, src_irb->mt_level, src_irb->mt_layer,
@@ -75,7 +78,7 @@ do_blorp_blit(struct brw_context *brw, GLbitfield buffer_bit,
srcX0, srcY0, srcX1, srcY1,
dstX0, dstY0, dstX1, dstY1,
filter, mirror_x, mirror_y,
-   es, es);
+   do_srgb, do_srgb);
 
dst_irb->need_downsample = true;
 }
-- 
2.9.2

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


[Piglit] [PATCH - Piglit 01/10] Delete fbo-srgb-blit test.

2016-08-04 Thread Kenneth Graunke
This appears to be redundant with spec/arb_framebuffer_srgb/blit
which tests many more configurations.
---
 tests/all.py|   1 -
 tests/fbo/CMakeLists.gl.txt |   1 -
 tests/fbo/fbo-srgb-blit.c   | 145 
 3 files changed, 147 deletions(-)
 delete mode 100644 tests/fbo/fbo-srgb-blit.c

diff --git a/tests/all.py b/tests/all.py
index e76f157..6cacbd3 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2801,7 +2801,6 @@ with profile.group_manager(
 g(['fbo-blit'], run_concurrent=False)
 g(['fbo-copypix'], run_concurrent=False)
 g(['fbo-readdrawpix'], run_concurrent=False)
-g(['fbo-srgb-blit'])
 g(['fbo-sys-blit'], run_concurrent=False)
 g(['fbo-sys-sub-blit'], run_concurrent=False)
 g(['fbo-generatemipmap-versus-READ_FRAMEBUFFER'])
diff --git a/tests/fbo/CMakeLists.gl.txt b/tests/fbo/CMakeLists.gl.txt
index 0476b10..2e2cac9 100644
--- a/tests/fbo/CMakeLists.gl.txt
+++ b/tests/fbo/CMakeLists.gl.txt
@@ -81,7 +81,6 @@ piglit_add_executable (fbo-readpixels-depth-formats 
fbo-readpixels-depth-formats
 piglit_add_executable (fbo-rg fbo-rg.c)
 piglit_add_executable (fbo-scissor-blit fbo-scissor-blit.c)
 piglit_add_executable (fbo-srgb fbo-srgb.c)
-piglit_add_executable (fbo-srgb-blit fbo-srgb-blit.c)
 IF (UNIX)
target_link_libraries (fbo-srgb m)
 ENDIF (UNIX)
diff --git a/tests/fbo/fbo-srgb-blit.c b/tests/fbo/fbo-srgb-blit.c
deleted file mode 100644
index 8c7eff4..000
--- a/tests/fbo/fbo-srgb-blit.c
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * Copyright © 2011 Henri Verbeet 
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- *
- */
-
-/** @file fbo-srgb-blit.c
- *
- * Test FBO blits between sRGB and linear textures. Blits should happen in
- * linear color space.
- */
-
-#include "piglit-util-gl.h"
-
-PIGLIT_GL_TEST_CONFIG_BEGIN
-
-   config.supports_gl_compat_version = 10;
-
-   config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGB;
-
-PIGLIT_GL_TEST_CONFIG_END
-
-static GLuint src_tex, dst_tex;
-static GLuint src_fbo, dst_fbo;
-static uint32_t *tex_data;
-static bool has_fb_srgb;
-
-static void blit_rect(GLenum src_format, GLenum dst_format, float x, float y, 
float w, float h, bool stretch)
-{
-   glBindTexture(GL_TEXTURE_2D, src_tex);
-   glTexImage2D(GL_TEXTURE_2D, 0, src_format, 16, 16, 0, GL_BGRA, 
GL_UNSIGNED_INT_8_8_8_8_REV, tex_data);
-
-   glBindTexture(GL_TEXTURE_2D, dst_tex);
-   glTexImage2D(GL_TEXTURE_2D, 0, dst_format, 16, 16, 0, GL_BGRA, 
GL_UNSIGNED_INT_8_8_8_8_REV, NULL);
-
-   glBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, src_fbo);
-   glFramebufferTexture2DEXT(GL_READ_FRAMEBUFFER_EXT, 
GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, src_tex, 0);
-
-   if (has_fb_srgb)
-   glEnable(GL_FRAMEBUFFER_SRGB_EXT);
-   glBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, dst_fbo);
-   glFramebufferTexture2DEXT(GL_DRAW_FRAMEBUFFER_EXT, 
GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, dst_tex, 0);
-
-   if (stretch)
-   {
-   glBlitFramebufferEXT(7, 7, 9, 9, 0, 0, 8, 16, 
GL_COLOR_BUFFER_BIT, GL_LINEAR);
-   if (has_fb_srgb)
-   glDisable(GL_FRAMEBUFFER_SRGB_EXT);
-   glBlitFramebufferEXT(7, 7, 9, 9, 8, 0, 16, 16, 
GL_COLOR_BUFFER_BIT, GL_LINEAR);
-   }
-   else
-   {
-   glBlitFramebufferEXT(0, 0, 8, 16, 0, 0, 8, 16, 
GL_COLOR_BUFFER_BIT, GL_LINEAR);
-   if (has_fb_srgb)
-   glDisable(GL_FRAMEBUFFER_SRGB_EXT);
-   glBlitFramebufferEXT(8, 0, 16, 16, 8, 0, 16, 16, 
GL_COLOR_BUFFER_BIT, GL_LINEAR);
-   }
-
-   glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, piglit_winsys_fbo);
-
-   glBindTexture(GL_TEXTURE_2D, dst_tex);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
-   glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, 

[Piglit] [PATCH - Mesa 06/10] Revert "st/mesa: use sRGB formats for MSAA resolving if destination is sRGB"

2016-08-04 Thread Kenneth Graunke
This reverts commit 4e549ddb500cf677b6fa16d9ebdfa67cc23da097,
dropping the hack from Gallium that I just deleted from i965.

See the previous commit for rationale.
---
 src/mesa/state_tracker/st_cb_blit.c | 32 
 1 file changed, 32 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_blit.c 
b/src/mesa/state_tracker/st_cb_blit.c
index 826152d..5e7c34c 100644
--- a/src/mesa/state_tracker/st_cb_blit.c
+++ b/src/mesa/state_tracker/st_cb_blit.c
@@ -46,34 +46,6 @@
 
 
 static void
-st_adjust_blit_for_msaa_resolve(struct pipe_blit_info *blit)
-{
-   /* Even though we do multisample resolves at the time of the blit, OpenGL
-* specification defines them as if they happen at the time of rendering,
-* which means that the type of averaging we do during the resolve should
-* only depend on the source format; the destination format should be
-* ignored. But, specification doesn't seem to be strict about it.
-*
-* It has been observed that mulitisample resolves produce slightly better
-* looking images when averaging is done using destination format. NVIDIA's
-* proprietary OpenGL driver also follows this approach.
-*
-* When multisampling, if the source and destination formats are equal
-* (aside from the color space), we choose to blit in sRGB space to get
-* this higher quality image.
-*/
-   if (blit->src.resource->nr_samples > 1 &&
-   blit->dst.resource->nr_samples <= 1) {
-  blit->dst.format = blit->dst.resource->format;
-
-  if (util_format_is_srgb(blit->dst.resource->format))
- blit->src.format = util_format_srgb(blit->src.resource->format);
-  else
- blit->src.format = util_format_linear(blit->src.resource->format);
-   }
-}
-
-static void
 st_BlitFramebuffer(struct gl_context *ctx,
struct gl_framebuffer *readFB,
struct gl_framebuffer *drawFB,
@@ -232,8 +204,6 @@ st_BlitFramebuffer(struct gl_context *ctx,
   blit.src.box.z = srcAtt->Zoffset + srcAtt->CubeMapFace;
   blit.src.format = util_format_linear(srcObj->pt->format);
 
-  st_adjust_blit_for_msaa_resolve();
-
   st->pipe->blit(st->pipe, );
   dstRb->defined = true; /* front buffer tracking */
}
@@ -270,8 +240,6 @@ st_BlitFramebuffer(struct gl_context *ctx,
   blit.src.box.z = srcSurf->u.tex.first_layer;
   blit.src.format = util_format_linear(srcSurf->format);
 
-  st_adjust_blit_for_msaa_resolve();
-
   st->pipe->blit(st->pipe, );
   dstRb->defined = true; /* front buffer tracking */
}
-- 
2.9.2

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


[Piglit] [PATCH - Mesa 05/10] i965: Drop the "do resolves in sRGB" hack.

2016-08-04 Thread Kenneth Graunke
I've never quite understood the purpose of this hack - supposedly,
doing resolves in the sRGB colorspace is slightly more accurate.

Currently, BlitFramebuffer() ignores sRGB encoding and decoding
on OpenGL, although it encodes and decodes in GLES 3.x.

The updated OpenGL 4.4 rules also allow for encoding and decoding
if GL_FRAMEBUFFER_SRGB is enabled, allowing the application to
control what colorspace blits are done in.  I don't think this hack
makes any sense in such a world - the application can do what it
wants, and we shouldn't second guess them.

A related Piglit patch, "Make multisample accuracy test set
GL_FRAMEBUFFER_SRGB when resolving." makes the Piglit MSAA accuracy
test explicitly request SRGB encoding/decoding during resolves when
running "srgb" subtests.  Without that patch, this commit will regress
those tests, but with it, they should continue to work just fine.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp | 24 
 1 file changed, 24 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp 
b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index a54680e..7532aac 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -1659,30 +1659,6 @@ brw_blorp_blit_miptrees(struct brw_context *brw,
brw_blorp_surface_info_init(brw, , dst_mt, dst_level,
dst_layer, dst_format, true);
 
-   /* Even though we do multisample resolves at the time of the blit, OpenGL
-* specification defines them as if they happen at the time of rendering,
-* which means that the type of averaging we do during the resolve should
-* only depend on the source format; the destination format should be
-* ignored. But, specification doesn't seem to be strict about it.
-*
-* It has been observed that mulitisample resolves produce slightly better
-* looking images when averaging is done using destination format. NVIDIA's
-* proprietary OpenGL driver also follow this approach. So, we choose to
-* follow it in our driver.
-*
-* When multisampling, if the source and destination formats are equal
-* (aside from the color space), we choose to blit in sRGB space to get
-* this higher quality image.
-*/
-   if (params.src.num_samples > 1 &&
-   _mesa_get_format_color_encoding(dst_mt->format) == GL_SRGB &&
-   _mesa_get_srgb_format_linear(src_mt->format) ==
-   _mesa_get_srgb_format_linear(dst_mt->format)) {
-  assert(brw->format_supported_as_render_target[dst_mt->format]);
-  params.dst.brw_surfaceformat = brw->render_target_format[dst_mt->format];
-  params.src.brw_surfaceformat = 
brw_format_for_mesa_format(dst_mt->format);
-   }
-
/* When doing a multisample resolve of a GL_LUMINANCE32F or GL_INTENSITY32F
 * texture, the above code configures the source format for L32_FLOAT or
 * I32_FLOAT, and the destination format for R32_FLOAT.  On Sandy Bridge,
-- 
2.9.2

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


[Piglit] [PATCH - Mesa 04/10] i965: Bail on the BLT path if BlitFramebuffer requires sRGB conversion.

2016-08-04 Thread Kenneth Graunke
Modern OpenGL BlitFramebuffer require sRGB encode/decode when
GL_FRAMEBUFFER_SRGB is enabled.  The blitter can't handle this,
so we need to bail.  On Gen4-5, this means falling back to Meta,
which should handle it.

We allow sRGB <-> sRGB blits, as decode then encode ought to be a noop
(other than potential precision loss, which nobody wants anyway).

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 src/mesa/drivers/dri/i965/intel_blit.c | 4 ++--
 src/mesa/drivers/dri/i965/intel_fbo.c  | 8 
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_blit.c 
b/src/mesa/drivers/dri/i965/intel_blit.c
index 23e1ab6..8df5b48 100644
--- a/src/mesa/drivers/dri/i965/intel_blit.c
+++ b/src/mesa/drivers/dri/i965/intel_blit.c
@@ -211,8 +211,8 @@ intel_miptree_blit(struct brw_context *brw,
   return false;
 
/* No sRGB decode or encode is done by the hardware blitter, which is
-* consistent with what we want in the callers (glCopyTexSubImage(),
-* glBlitFramebuffer(), texture validation, etc.).
+* consistent with what we want in many callers (glCopyTexSubImage(),
+* texture validation, etc.).
 */
mesa_format src_format = _mesa_get_srgb_format_linear(src_mt->format);
mesa_format dst_format = _mesa_get_srgb_format_linear(dst_mt->format);
diff --git a/src/mesa/drivers/dri/i965/intel_fbo.c 
b/src/mesa/drivers/dri/i965/intel_fbo.c
index 707a9d2..573c3a8 100644
--- a/src/mesa/drivers/dri/i965/intel_fbo.c
+++ b/src/mesa/drivers/dri/i965/intel_fbo.c
@@ -828,6 +828,14 @@ intel_blit_framebuffer_with_blitter(struct gl_context *ctx,
 return mask;
  }
 
+ if (ctx->Color.sRGBEnabled &&
+ _mesa_get_format_color_encoding(src_irb->mt->format) !=
+ _mesa_get_format_color_encoding(dst_irb->mt->format)) {
+perf_debug("glBlitFramebuffer() with sRGB conversion cannot be "
+   "handled by BLT path.\n");
+return mask;
+ }
+
  if (!intel_miptree_blit(brw,
  src_irb->mt,
  src_irb->mt_level, src_irb->mt_layer,
-- 
2.9.2

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


[Piglit] [PATCH - Mesa 10/10] st/mesa: Make Gallium's BlitFramebuffer follow the GL 4.4 sRGB rules.

2016-08-04 Thread Kenneth Graunke
OpenGL 4.4 specifies that BlitFramebuffer should perform sRGB encode
and decode like ES 3.x does, but only when GL_FRAMEBUFFER_SRGB is
enabled.  This is technically incompatible in certain cases, but is
more consistent across GL, ES, and WebGL, and more flexible.

The NVIDIA 367.35 drivers appear to follow this behavior.

For the awful spec analysis, please read Piglit's
tests/spec/arb_framebuffer_srgb/blit.c, which explains the differences
between GL 4.1, 4.2, 4.3 (2012), 4.3 (2013), and 4.4, and why this
is the right rule to implement.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 src/mesa/state_tracker/st_cb_blit.c | 20 
 1 file changed, 16 insertions(+), 4 deletions(-)

Whoever designed this interface did a very nice job.  Making this change
was really simple.  I wrote the obvious code, tested it with llvmpipe,
and it appears to be working.

diff --git a/src/mesa/state_tracker/st_cb_blit.c 
b/src/mesa/state_tracker/st_cb_blit.c
index 5e7c34c..cfcf3f7 100644
--- a/src/mesa/state_tracker/st_cb_blit.c
+++ b/src/mesa/state_tracker/st_cb_blit.c
@@ -44,6 +44,14 @@
 
 #include "util/u_format.h"
 
+static void
+st_adjust_blit_for_srgb(struct pipe_blit_info *blit, bool framebuffer_srgb)
+{
+   if (!framebuffer_srgb) {
+  blit->dst.format = util_format_linear(blit->dst.format);
+  blit->src.format = util_format_linear(blit->src.format);
+   }
+}
 
 static void
 st_BlitFramebuffer(struct gl_context *ctx,
@@ -197,12 +205,14 @@ st_BlitFramebuffer(struct gl_context *ctx,
   blit.dst.resource = dstSurf->texture;
   blit.dst.level = dstSurf->u.tex.level;
   blit.dst.box.z = dstSurf->u.tex.first_layer;
-  blit.dst.format = util_format_linear(dstSurf->format);
+  blit.dst.format = dstSurf->format;
 
   blit.src.resource = srcObj->pt;
   blit.src.level = srcAtt->TextureLevel;
   blit.src.box.z = srcAtt->Zoffset + srcAtt->CubeMapFace;
-  blit.src.format = util_format_linear(srcObj->pt->format);
+  blit.src.format = srcObj->pt->format;
+
+  st_adjust_blit_for_srgb(, ctx->Color.sRGBEnabled);
 
   st->pipe->blit(st->pipe, );
   dstRb->defined = true; /* front buffer tracking */
@@ -233,12 +243,14 @@ st_BlitFramebuffer(struct gl_context *ctx,
   blit.dst.resource = dstSurf->texture;
   blit.dst.level = dstSurf->u.tex.level;
   blit.dst.box.z = dstSurf->u.tex.first_layer;
-  blit.dst.format = util_format_linear(dstSurf->format);
+  blit.dst.format = dstSurf->format;
 
   blit.src.resource = srcSurf->texture;
   blit.src.level = srcSurf->u.tex.level;
   blit.src.box.z = srcSurf->u.tex.first_layer;
-  blit.src.format = util_format_linear(srcSurf->format);
+  blit.src.format = srcSurf->format;
+
+  st_adjust_blit_for_srgb(, ctx->Color.sRGBEnabled);
 
   st->pipe->blit(st->pipe, );
   dstRb->defined = true; /* front buffer tracking */
-- 
2.9.2

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


[Piglit] [PATCH - Piglit 02/10] Make multisample accuracy test set GL_FRAMEBUFFER_SRGB when resolving.

2016-08-04 Thread Kenneth Graunke
For a long time, the Mesa i965 driver has contained a hack to override
color spaces to sRGB when doing multisample resolves, with the following
justification:

* It has been observed that mulitisample resolves produce slightly better
* looking images when averaging is done using destination format. NVIDIA's
* proprietary OpenGL driver also follow this approach.  So, we choose to
* follow it in our driver.
*
* When multisampling, if the source and destination formats are equal
* (aside from the color space), we choose to blit in sRGB space to get
* this higher quality image.

I've never understood the purpose of this hack.  It sort of makes sense
in a "never decode, never encode" world.  But with the new GL 4.4 rules,
where encoding and decoding is optional, I'm not sure that it has any
place - the colorspaces should be application directed.

That said, this Piglit test appears to expect that resolves will be
done in the sRGB color space for TEST_TYPE_SRGB, so let's make it
explicitly request OpenGL to make that happen.

This makes a number of subtests pass on NVIDIA 367.35 on a GTX 980:
- accuracy {2,4,8,32} srgb depthstencil
- accuracy {2,4,8,32} srgb depthstencil linear
- accuracy {2,4,8,32} srgb small depthstencil
- accuracy {2,4,8,32} srgb small depthstencil linear
(The 16x and all_samples variants still fail on NVIDIA.)

No change on i965, as it currently ignores GL_FRAMEBUFFER_SRGB but
has the hack to do resolves in sRGB regardless.  It will soon drop
the hack, but start respecting GL_FRAMEBUFFER_SRGB.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 tests/spec/ext_framebuffer_multisample/common.cpp | 4 
 1 file changed, 4 insertions(+)

diff --git a/tests/spec/ext_framebuffer_multisample/common.cpp 
b/tests/spec/ext_framebuffer_multisample/common.cpp
index 735bcc5..b6df91c 100644
--- a/tests/spec/ext_framebuffer_multisample/common.cpp
+++ b/tests/spec/ext_framebuffer_multisample/common.cpp
@@ -326,10 +326,14 @@ Test::resolve(Fbo *fbo, GLbitfield which_buffers)
glBindFramebuffer(GL_READ_FRAMEBUFFER, fbo->handle);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, resolve_fbo.handle);
resolve_fbo.set_viewport();
+
+   if (srgb)
+   glEnable(GL_FRAMEBUFFER_SRGB);
glBlitFramebuffer(0, 0, fbo->config.width, fbo->config.height,
  0, 0, resolve_fbo.config.width,
  resolve_fbo.config.height,
  which_buffers, filter_mode);
+   glDisable(GL_FRAMEBUFFER_SRGB);
 }
 
 /**
-- 
2.9.2

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


Re: [Piglit] [PATCH 2/2] shader_runner: Fix get_ints on 32-bit systems.

2016-06-06 Thread Kenneth Graunke
On Monday, June 6, 2016 3:56:09 PM PDT Mark Janes wrote:
> Kenneth Graunke <kenn...@whitecape.org> writes:
> 
> > The new ARB_vertex_attrib_64bit tests specify integer uniform values
> > as hex, such as 0xc21620c5.  As an integer value, this is beyond LONG_MAX
> > on 32-bit systems.  The intent is to parse it as an unsigned hex value and
> > bitcast it.
> >
> > However, we still need to handle parsing values with negative signs.
> >
> > Using strtoll and truncating works.
> >
> > Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
> > ---
> >  tests/shaders/shader_runner.c | 2 +-
> >  tests/util/piglit-vbo.cpp | 4 ++--
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> > index 94c7826..56fd97c 100644
> > --- a/tests/shaders/shader_runner.c
> > +++ b/tests/shaders/shader_runner.c
> > @@ -1398,7 +1398,7 @@ get_ints(const char *line, int *ints, unsigned count)
> > unsigned i;
> >  
> > for (i = 0; i < count; i++)
> > -   ints[i] = strtol(line, (char **) , 0);
> > +   ints[i] = strtoll(line, (char **) , 0);
> >  }
> >  
> >  
> > diff --git a/tests/util/piglit-vbo.cpp b/tests/util/piglit-vbo.cpp
> > index fd7e72a..50e6731 100644
> > --- a/tests/util/piglit-vbo.cpp
> > +++ b/tests/util/piglit-vbo.cpp
> > @@ -387,8 +387,8 @@ vertex_attrib_description::parse_datum(const char 
> > **text, void *data) const
> > break;
> > }
> > case GL_INT: {
> > -   long value = (long) strtoll(*text, , 0);
> > -   if (errno == ERANGE) {
> > +   long long value = strtoll(*text, , 0);
> > +   if (errno == ERANGE || (unsigned long long) value > 
> > 0xull) {
> ^
> with this check removed, the series corrects all 32 bit failures
> introduced by b7eb469, and is
> 
> Tested-by: Mark Janes <mark.a.ja...@intel.com>

Right, the value > 0xull bit is bogus - the sign bit gets
extended.  I've just dropped this locally.  It removes a bit of sanity
checking for bogus values written in .shader_test files, but we don't
sanity check most values, either.

--Ken


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 2/2] shader_runner: Fix get_ints on 32-bit systems.

2016-06-06 Thread Kenneth Graunke
The new ARB_vertex_attrib_64bit tests specify integer uniform values
as hex, such as 0xc21620c5.  As an integer value, this is beyond LONG_MAX
on 32-bit systems.  The intent is to parse it as an unsigned hex value and
bitcast it.

However, we still need to handle parsing values with negative signs.

Using strtoll and truncating works.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 tests/shaders/shader_runner.c | 2 +-
 tests/util/piglit-vbo.cpp | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 94c7826..56fd97c 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -1398,7 +1398,7 @@ get_ints(const char *line, int *ints, unsigned count)
unsigned i;
 
for (i = 0; i < count; i++)
-   ints[i] = strtol(line, (char **) , 0);
+   ints[i] = strtoll(line, (char **) , 0);
 }
 
 
diff --git a/tests/util/piglit-vbo.cpp b/tests/util/piglit-vbo.cpp
index fd7e72a..50e6731 100644
--- a/tests/util/piglit-vbo.cpp
+++ b/tests/util/piglit-vbo.cpp
@@ -387,8 +387,8 @@ vertex_attrib_description::parse_datum(const char **text, 
void *data) const
break;
}
case GL_INT: {
-   long value = (long) strtoll(*text, , 0);
-   if (errno == ERANGE) {
+   long long value = strtoll(*text, , 0);
+   if (errno == ERANGE || (unsigned long long) value > 
0xull) {
printf("Could not parse as signed integer\n");
return false;
}
-- 
2.8.3

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


[Piglit] [PATCH 1/2] shader_runner: Fix integer vbo attribute parsing on 32-bit systems.

2016-06-06 Thread Kenneth Graunke
The new ARB_vertex_attrib_64bit tests specify integer vertex attributes
with hex values, such as 0xc21620c5.  As an integer value, this is
beyond LONG_MAX on 32-bit systems.  The intent is to parse it as an
unsigned hex value and bitcast it.

However, we still need to handle parsing values with negative signs.

Using strtoll and truncating should work.  It breaks the errno-based
range validation, but we can still at least try to reject some cases.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 tests/util/piglit-vbo.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/util/piglit-vbo.cpp b/tests/util/piglit-vbo.cpp
index 1bdd9da..fd7e72a 100644
--- a/tests/util/piglit-vbo.cpp
+++ b/tests/util/piglit-vbo.cpp
@@ -387,7 +387,7 @@ vertex_attrib_description::parse_datum(const char **text, 
void *data) const
break;
}
case GL_INT: {
-   long value = strtol(*text, , 0);
+   long value = (long) strtoll(*text, , 0);
if (errno == ERANGE) {
printf("Could not parse as signed integer\n");
return false;
-- 
2.8.3

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


[Piglit] [PATCH] Delete spec/glsl-1.10/compiler/literals/invalid-float-suffix-*.vert.

2016-06-05 Thread Kenneth Graunke
In Mesa, we've decided to treat the GLSL 1.20 rules as a clarification,
rather than a change in behavior, and accept f/F suffixes but generate
a warning.  This means that we'll always fail these tests.

We may as well delete the tests.
---
 .../compiler/literals/invalid-float-suffix-capital-f.vert  | 10 --
 .../glsl-1.10/compiler/literals/invalid-float-suffix-f.vert| 10 --
 2 files changed, 20 deletions(-)
 delete mode 100644 
tests/spec/glsl-1.10/compiler/literals/invalid-float-suffix-capital-f.vert
 delete mode 100644 
tests/spec/glsl-1.10/compiler/literals/invalid-float-suffix-f.vert

diff --git 
a/tests/spec/glsl-1.10/compiler/literals/invalid-float-suffix-capital-f.vert 
b/tests/spec/glsl-1.10/compiler/literals/invalid-float-suffix-capital-f.vert
deleted file mode 100644
index 2022cdb..000
--- a/tests/spec/glsl-1.10/compiler/literals/invalid-float-suffix-capital-f.vert
+++ /dev/null
@@ -1,10 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 1.10
-// [end config]
-
-void main() {
-   // Float-suffixes are not in GLSL 1.10
-   float f = 1.0F;
-   gl_Position = vec4(1.0);
-}
diff --git a/tests/spec/glsl-1.10/compiler/literals/invalid-float-suffix-f.vert 
b/tests/spec/glsl-1.10/compiler/literals/invalid-float-suffix-f.vert
deleted file mode 100644
index 8c149a0..000
--- a/tests/spec/glsl-1.10/compiler/literals/invalid-float-suffix-f.vert
+++ /dev/null
@@ -1,10 +0,0 @@
-// [config]
-// expect_result: fail
-// glsl_version: 1.10
-// [end config]
-
-void main() {
-   // Float-suffixes are not in GLSL 1.10
-   float f = 1.0f;
-   gl_Position = vec4(1.0);
-}
-- 
2.8.3

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


Re: [Piglit] [PATCH] shader_runner: Use %u in "probe atomic counter" scanf calls.

2016-05-31 Thread Kenneth Graunke
On Wednesday, June 1, 2016 1:34:42 AM PDT Ilia Mirkin wrote:
> Because strtol() truncates the the maximum value of "long", as does
> scanf apparently. This will make it impossible to test that a counter
> == -1 though, right?

Yes, I suppose it would.  But you can always do == 4294967295 instead,
and that seems pretty reasonable (if a bit inconvenient) considering
the GLSL type is "atomic_uint"...

--Ken


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] shader_runner: Use %u in "probe atomic counter" scanf calls.

2016-05-31 Thread Kenneth Graunke
We're trying to compare two unsigned values, so we should use %u.

For whatever reason, using %d instead of %u causes
tests/spec/arb_compute_shader/execution/atomic-counter.shader_test
to read 2147483647 instead of 4294966784 for the expected value
which is written directly in the [test] script, but only on 32-bit
x86 platforms - x86_64 seems to work fine as is.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=9
Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
Cc: Mark Janes <mark.a.ja...@intel.com>
---
 tests/shaders/shader_runner.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

Technically using  and  works too - but you're supposed to pass
in pointers to unsigned variables, so I went ahead and did that.

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index ab72c1f..94c7826 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -2734,6 +2734,7 @@ piglit_display(void)
float c[32];
double d[4];
int x, y, z, w, h, l, tex, level;
+   unsigned ux, uy;
char s[32];
 
 
@@ -2969,9 +2970,9 @@ piglit_display(void)
pass = false;
}
} else if (sscanf(line,
- "probe atomic counter %d %s %d",
- , s, ) == 3) {
-   if (!probe_atomic_counter(x, s, y)) {
+ "probe atomic counter %u %s %u",
+ , s, ) == 3) {
+   if (!probe_atomic_counter(ux, s, uy)) {
piglit_report_result(PIGLIT_FAIL);
}
} else if (sscanf(line, "probe ssbo uint %d %d %s 0x%x",
-- 
2.8.3

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


[Piglit] [PATCH] Add gl_TessLevelInner/Outer tests that use non-constant array indices.

2016-05-31 Thread Kenneth Graunke
Constant indexing is easy.  Indirect addressing is easier to mess up.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 ...ner-tessouter-inputs-quads-indirect.shader_test | 75 +++
 ...nner-tessouter-inputs-tris-indirect.shader_test | 84 ++
 2 files changed, 159 insertions(+)
 create mode 100644 
tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-quads-indirect.shader_test
 create mode 100644 
tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-tris-indirect.shader_test

Apparently I wrote this test in November 2015 but never sent it...

diff --git 
a/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-quads-indirect.shader_test
 
b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-quads-indirect.shader_test
new file mode 100644
index 000..41487ab
--- /dev/null
+++ 
b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-quads-indirect.shader_test
@@ -0,0 +1,75 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+
+[vertex shader]
+in vec4 vertex;
+
+void main()
+{
+   gl_Position = vertex;
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+layout(vertices = 1) out;
+
+uniform int zero;
+uniform int one;
+uniform int two;
+uniform int three;
+
+void main() {
+   gl_TessLevelOuter[zero]  = 3.0;
+   gl_TessLevelOuter[one]   = 2.0;
+   gl_TessLevelOuter[two]   = 4.0;
+   gl_TessLevelOuter[three] = 5.0;
+
+   gl_TessLevelInner[zero]  = 6.0;
+   gl_TessLevelInner[one]   = 7.0;
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+layout(quads) in;
+
+uniform int zero;
+uniform int one;
+uniform int two;
+uniform int three;
+
+out vec4 color;
+
+void main() {
+   gl_Position = vec4(gl_TessCoord.xy * 2 - 1, 0, 1);
+   color = gl_TessLevelOuter[zero]  == 3.0 &&
+   gl_TessLevelOuter[one]   == 2.0 &&
+   gl_TessLevelOuter[two]   == 4.0 &&
+   gl_TessLevelOuter[three] == 5.0 &&
+   gl_TessLevelInner[zero]  == 6.0 &&
+   gl_TessLevelInner[one]   == 7.0 ?
+   vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+
+[fragment shader]
+in vec4 color;
+
+void main()
+{
+   gl_FragColor = color;
+}
+
+[test]
+uniform int zero  0
+uniform int one   1
+uniform int two   2
+uniform int three 3
+clear color 0.1 0.1 0.1 0.1
+clear
+patch parameter vertices 1
+draw arrays GL_PATCHES 0 1
+probe all rgba 0.0 1.0 0.0 1.0
diff --git 
a/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-tris-indirect.shader_test
 
b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-tris-indirect.shader_test
new file mode 100644
index 000..3d55e1e
--- /dev/null
+++ 
b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-tris-indirect.shader_test
@@ -0,0 +1,84 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+
+[vertex shader]
+in vec4 vertex;
+
+void main()
+{
+   gl_Position = vertex;
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+layout(vertices = 3) out;
+
+uniform int zero;
+uniform int one;
+uniform int two;
+uniform int three;
+
+void main() {
+   gl_out[gl_InvocationID].gl_Position = 
gl_in[gl_InvocationID].gl_Position;
+   gl_TessLevelOuter[zero]  = 3.0;
+   gl_TessLevelOuter[one]   = 2.0;
+   gl_TessLevelOuter[two]   = 4.0;
+   gl_TessLevelOuter[three] = 5.0;
+
+   gl_TessLevelInner[zero]  = 6.0;
+   gl_TessLevelInner[one]   = 7.0;
+}
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+layout(triangles) in;
+
+uniform int zero;
+uniform int one;
+uniform int two;
+
+out vec4 color;
+
+void main() {
+   gl_Position = gl_in[0].gl_Position * gl_TessCoord[0]
+   + gl_in[1].gl_Position * gl_TessCoord[1]
+   + gl_in[2].gl_Position * gl_TessCoord[2];
+   color = gl_TessLevelOuter[zero] == 3.0 &&
+   gl_TessLevelOuter[one]  == 2.0 &&
+   gl_TessLevelOuter[two]  == 4.0 &&
+   gl_TessLevelInner[zero] == 6.0 ?
+   vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+
+}
+
+
+[fragment shader]
+in vec4 color;
+
+void main()
+{
+   gl_FragColor = color;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+-1.0  1.0
+-1.0  1.0
+ 1.0 -1.0
+ 1.0  1.0
+
+[test]
+uniform int zero  0
+uniform int one   1
+uniform int two   2
+uniform int three 3
+clear color 0.1 0.1 0.1 0.1
+clear
+patch parameter vertices 3
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.8.3

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


Re: [Piglit] [PATCH] dsa/xfb: make the buffer large enough.

2016-05-31 Thread Kenneth Graunke
On Tuesday, May 31, 2016 9:54:08 AM PDT Dave Airlie wrote:
> From: Dave Airlie <airl...@redhat.com>
> 
> This bug in the test was triggered by a fix to mesa, the test creates
> a backing buffer smaller than the xfb range it requests then is surprised
> when it gets returned a truncated value for the size.
> 
> Signed-off-by: Dave Airlie <airl...@redhat.com>
> ---
>  tests/spec/arb_direct_state_access/gettransformfeedback.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96300
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

Pushed as commit 8a3ca58eecad48f7c479ef2df3929d8b7fd4bbe3.


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Fix GetProgramPipelineiv test with GLSL 4.30+.

2016-05-31 Thread Kenneth Graunke
The test was set up to use GLSL 4.30, 1.50, or 1.10, as available.

GLSL 4.20 removes the gl_FragColor variable, so the fragment shader
would fail to compile if GLSL 4.30 was available.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96301
Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
Cc: mark.a.ja...@intel.com
---
 tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c 
b/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c
index 1975180..2746e8b 100644
--- a/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c
+++ b/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c
@@ -119,9 +119,14 @@ piglit_init(int argc, char **argv)
"gl_Position = position;\n"
"}\n";
static const char fs_source[] =
+   "#if __VERSION__ >= 430\n"
+   "layout(location = 0) out vec4 color;\n"
+   "#else\n"
+   "#define color gl_FragColor\n"
+   "#endif\n"
"void main()\n"
"{\n"
-   "gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0);\n"
+   "color = vec4(0.0, 1.0, 0.0, 0.0);\n"
"}\n";
static const char gs_source[] =
"/* At least some versions of AMD's closed-source driver\n"
-- 
2.8.3

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


[Piglit] [PATCH] Make a version of isolines that uses a passthrough TCS.

2016-05-26 Thread Kenneth Graunke
This exposes a bug in i965.
---
 .../execution/isoline-no-tcs.shader_test   | 41 ++
 1 file changed, 41 insertions(+)
 create mode 100644 
tests/spec/arb_tessellation_shader/execution/isoline-no-tcs.shader_test

diff --git 
a/tests/spec/arb_tessellation_shader/execution/isoline-no-tcs.shader_test 
b/tests/spec/arb_tessellation_shader/execution/isoline-no-tcs.shader_test
new file mode 100644
index 000..84c7f3a
--- /dev/null
+++ b/tests/spec/arb_tessellation_shader/execution/isoline-no-tcs.shader_test
@@ -0,0 +1,41 @@
+# Check producing a single tessellated isoline doesn't give multiple lines
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+[vertex shader]
+
+void main()
+{
+}
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+layout(isolines, equal_spacing) in;
+flat out int good;
+
+void main()
+{
+   gl_Position = vec4(gl_TessCoord.xy * 2.0 - 1.0, 0.0, 1.0);
+   good = int(gl_TessCoord.y == 0.0);
+}
+
+
+[fragment shader]
+flat in int good;
+
+void main()
+{
+   if (bool(good))
+   gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+   else
+   gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+[test]
+clear color 0.0 1.0 0.0 1.0
+clear
+patch parameter vertices 2
+patch parameter default level outer 1 4 0 0
+draw arrays GL_PATCHES 0 2
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.8.2

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


Re: [Piglit] [PATCH] shader_runner: Initialize gl_max_varying_components more often.

2016-05-18 Thread Kenneth Graunke
On Tuesday, May 17, 2016 6:09:26 PM PDT Eric Anholt wrote:
> Back in the day it was called MAX_VARYING_FLOATS, which is an alias
> for MAX_VARYING_COMPONENTS.  Fixes a bunch of varying-components tests
> skipping on vc4.
> ---
>  tests/shaders/shader_runner.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 239735cba1c9..b1d30185a29c 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -3326,7 +3326,8 @@ piglit_init(int argc, char **argv)
>   piglit_is_extension_supported("GL_ARB_vertex_shader"))
>   glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
> _max_vertex_uniform_components);
> - if (piglit_get_gl_version() >= 30 ||
> + if (piglit_get_gl_version() >= 20 ||
> + piglit_is_extension_supported("GL_ARB_vertex_shader") ||
>   piglit_is_extension_supported("GL_ARB_geometry_shader4") ||
>   piglit_is_extension_supported("GL_EXT_geometry_shader4"))
>   glGetIntegerv(GL_MAX_VARYING_COMPONENTS,
> 

Yep, MAX_VARYING_FLOATS does indeed alias MAX_VARYING_COMPONENTS and
existed in OpenGL 2.0.

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2] Make ARB_shader_precision tests ignore 0.0 vs -0.0.

2016-05-16 Thread Kenneth Graunke
The multiplication precision tests were attempting to multiply
0.0 * -0.1 and expecting to get +0.0 (0x), and failing
if they received -0.0 (0x8000).  This seems fairly bogus.

According to the ARB_shader_precision specification:
"In general, correct signedness of 0 is not required."

To avoid this problem, remove the sign bit from both the results
and expected values when the value is equal to (+/-) 0.0.

v2: Use xs.dtype.type(0.0) (suggested by Dylan Baker).

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 generated_tests/gen_shader_precision_tests.py| 8 +++-
 generated_tests/templates/gen_shader_precision_tests/fs.mako | 4 ++--
 generated_tests/templates/gen_shader_precision_tests/gs.mako | 4 ++--
 generated_tests/templates/gen_shader_precision_tests/vs.mako | 4 ++--
 4 files changed, 13 insertions(+), 7 deletions(-)

I don't think it matters, but I'd actually thought about doing that
just to be safe anyway...

diff --git a/generated_tests/gen_shader_precision_tests.py 
b/generated_tests/gen_shader_precision_tests.py
index 43b6a25..6ab83e0 100644
--- a/generated_tests/gen_shader_precision_tests.py
+++ b/generated_tests/gen_shader_precision_tests.py
@@ -206,6 +206,11 @@ def shader_runner_format(values):
 
 return retval
 
+def drop_signbit(xs):
+if (np.isscalar(xs)):
+return xs.dtype.type(0.0) if xs == 0.0 else xs
+return np.array([xs.dtype.type(0.0) if x == 0.0 else x for x in xs],
+xs.dtype)
 
 def main():
 """ Main function """
@@ -225,7 +230,8 @@ def main():
 complex_tol_type = signature.rettype
 for test_vector in test_vectors:
 tolerance = _gen_tolerance(signature.name, signature.rettype, 
test_vector.arguments)
-refined_test_vectors.append(TestVector(test_vector.arguments, 
test_vector.result, tolerance))
+result = drop_signbit(test_vector.result)
+refined_test_vectors.append(TestVector(test_vector.arguments, 
result, tolerance))
 # Then generate the shader_test scripts
 for shader_stage in ('vs', 'fs', 'gs'):
 template = template_file('gen_shader_precision_tests', 
'{0}.mako'.format(shader_stage))
diff --git a/generated_tests/templates/gen_shader_precision_tests/fs.mako 
b/generated_tests/templates/gen_shader_precision_tests/fs.mako
index 0a66efa..a556bad 100644
--- a/generated_tests/templates/gen_shader_precision_tests/fs.mako
+++ b/generated_tests/templates/gen_shader_precision_tests/fs.mako
@@ -32,7 +32,7 @@ void main()
 ## build an array of bit-level representations of the floating point 
results calculated above
 ##
   int resultbits[${num_elements}] = int[${num_elements}](\
-${', '.join('floatBitsToInt(result{0})'.format(i) for i in indexers)}\
+${', '.join('result{0} == 0.0 ? 0x0 : floatBitsToInt(result{0})'.format(i) for 
i in indexers)}\
 );
 ##
 ## build an array of bit-level representations of the passed-in floating 
point expected results
@@ -84,7 +84,7 @@ max(ulps${indexers[len(indexers)-2]}, 
ulps${indexers[len(indexers)-1]})\
 ##
 ## if there is only a single result value generated, compare it directly
 ##
-  int resultbits = floatBitsToInt(result);
+  int resultbits = result == 0.0 ? 0x0 : floatBitsToInt(result);
   int expectedbits = floatBitsToInt(expected);
   bool signerr = resultbits>>31 != expectedbits>>31;
   float ulps = abs(resultbits - expectedbits);
diff --git a/generated_tests/templates/gen_shader_precision_tests/gs.mako 
b/generated_tests/templates/gen_shader_precision_tests/gs.mako
index a480594..d37a42b 100644
--- a/generated_tests/templates/gen_shader_precision_tests/gs.mako
+++ b/generated_tests/templates/gen_shader_precision_tests/gs.mako
@@ -43,7 +43,7 @@ void main()
 ## build an array of bit-level representations of the floating point 
results calculated above
 ##
   int resultbits[${num_elements}] = int[${num_elements}](\
-${', '.join('floatBitsToInt(result{0})'.format(i) for i in indexers)}\
+${', '.join('result{0} == 0.0 ? 0x0 : floatBitsToInt(result{0})'.format(i) for 
i in indexers)}\
 );
 ##
 ## build an array of bit-level representations of the passed-in floating 
point expected results
@@ -95,7 +95,7 @@ max(ulps${indexers[len(indexers)-2]}, 
ulps${indexers[len(indexers)-1]})\
 ##
 ## if there is only a single result value generated, compare it directly
 ##
-  int resultbits = floatBitsToInt(result);
+  int resultbits = result == 0.0 ? 0x0 : floatBitsToInt(result);
   int expectedbits = floatBitsToInt(expected);
   bool signerr = resultbits>>31 != expectedbits>>31;
   float ulps = abs(resultbits - expectedbits);
diff --git a/generated_tests/templates/gen_shader_precision_tests/vs.mako 
b/generated_tests/templates/gen_shader_precision_tests/vs.mako
index e7282f5..7ccdadc 100644
--- a/generated_tests/templa

[Piglit] [PATCH] Make ARB_shader_precision tests ignore 0.0 vs -0.0.

2016-05-16 Thread Kenneth Graunke
The multiplication precision tests were attempting to multiply
0.0 * -0.1 and expecting to get +0.0 (0x), and failing
if they received -0.0 (0x8000).  This seems fairly bogus.

According to the ARB_shader_precision specification:
"In general, correct signedness of 0 is not required."

To avoid this problem, remove the sign bit from both the results
and expected values when the value is equal to (+/-) 0.0.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 generated_tests/gen_shader_precision_tests.py| 7 ++-
 generated_tests/templates/gen_shader_precision_tests/fs.mako | 4 ++--
 generated_tests/templates/gen_shader_precision_tests/gs.mako | 4 ++--
 generated_tests/templates/gen_shader_precision_tests/vs.mako | 4 ++--
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/generated_tests/gen_shader_precision_tests.py 
b/generated_tests/gen_shader_precision_tests.py
index 43b6a25..60a6f4f 100644
--- a/generated_tests/gen_shader_precision_tests.py
+++ b/generated_tests/gen_shader_precision_tests.py
@@ -206,6 +206,10 @@ def shader_runner_format(values):
 
 return retval
 
+def drop_signbit(xs):
+if (np.isscalar(xs)):
+return 0.0 if xs == 0.0 else xs
+return np.array([0.0 if x == 0.0 else x for x in xs], xs.dtype)
 
 def main():
 """ Main function """
@@ -225,7 +229,8 @@ def main():
 complex_tol_type = signature.rettype
 for test_vector in test_vectors:
 tolerance = _gen_tolerance(signature.name, signature.rettype, 
test_vector.arguments)
-refined_test_vectors.append(TestVector(test_vector.arguments, 
test_vector.result, tolerance))
+result = drop_signbit(test_vector.result)
+refined_test_vectors.append(TestVector(test_vector.arguments, 
result, tolerance))
 # Then generate the shader_test scripts
 for shader_stage in ('vs', 'fs', 'gs'):
 template = template_file('gen_shader_precision_tests', 
'{0}.mako'.format(shader_stage))
diff --git a/generated_tests/templates/gen_shader_precision_tests/fs.mako 
b/generated_tests/templates/gen_shader_precision_tests/fs.mako
index 0a66efa..a556bad 100644
--- a/generated_tests/templates/gen_shader_precision_tests/fs.mako
+++ b/generated_tests/templates/gen_shader_precision_tests/fs.mako
@@ -32,7 +32,7 @@ void main()
 ## build an array of bit-level representations of the floating point 
results calculated above
 ##
   int resultbits[${num_elements}] = int[${num_elements}](\
-${', '.join('floatBitsToInt(result{0})'.format(i) for i in indexers)}\
+${', '.join('result{0} == 0.0 ? 0x0 : floatBitsToInt(result{0})'.format(i) for 
i in indexers)}\
 );
 ##
 ## build an array of bit-level representations of the passed-in floating 
point expected results
@@ -84,7 +84,7 @@ max(ulps${indexers[len(indexers)-2]}, 
ulps${indexers[len(indexers)-1]})\
 ##
 ## if there is only a single result value generated, compare it directly
 ##
-  int resultbits = floatBitsToInt(result);
+  int resultbits = result == 0.0 ? 0x0 : floatBitsToInt(result);
   int expectedbits = floatBitsToInt(expected);
   bool signerr = resultbits>>31 != expectedbits>>31;
   float ulps = abs(resultbits - expectedbits);
diff --git a/generated_tests/templates/gen_shader_precision_tests/gs.mako 
b/generated_tests/templates/gen_shader_precision_tests/gs.mako
index a480594..d37a42b 100644
--- a/generated_tests/templates/gen_shader_precision_tests/gs.mako
+++ b/generated_tests/templates/gen_shader_precision_tests/gs.mako
@@ -43,7 +43,7 @@ void main()
 ## build an array of bit-level representations of the floating point 
results calculated above
 ##
   int resultbits[${num_elements}] = int[${num_elements}](\
-${', '.join('floatBitsToInt(result{0})'.format(i) for i in indexers)}\
+${', '.join('result{0} == 0.0 ? 0x0 : floatBitsToInt(result{0})'.format(i) for 
i in indexers)}\
 );
 ##
 ## build an array of bit-level representations of the passed-in floating 
point expected results
@@ -95,7 +95,7 @@ max(ulps${indexers[len(indexers)-2]}, 
ulps${indexers[len(indexers)-1]})\
 ##
 ## if there is only a single result value generated, compare it directly
 ##
-  int resultbits = floatBitsToInt(result);
+  int resultbits = result == 0.0 ? 0x0 : floatBitsToInt(result);
   int expectedbits = floatBitsToInt(expected);
   bool signerr = resultbits>>31 != expectedbits>>31;
   float ulps = abs(resultbits - expectedbits);
diff --git a/generated_tests/templates/gen_shader_precision_tests/vs.mako 
b/generated_tests/templates/gen_shader_precision_tests/vs.mako
index e7282f5..7ccdadc 100644
--- a/generated_tests/templates/gen_shader_precision_tests/vs.mako
+++ b/generated_tests/templates/gen_shader_precision_tests/vs.mako
@@ -33,7 +33,7 @@ void main()
 ## build an array of bit-level representations of the floating point 
res

Re: [Piglit] [PATCH] glslparsertest: Handle compute and tessellation shaders in ES.

2016-05-13 Thread Kenneth Graunke
On Friday, May 13, 2016 9:37:22 AM PDT Ilia Mirkin wrote:
> On May 13, 2016 4:41 AM, "Kenneth Graunke" <kenn...@whitecape.org> wrote:
> >
> > We apparently have some generated parser tests for ES 3.x extensions
> > that use compute shaders.  These didn't work because glslparsertest
> > didn't actually support these features.
> >
> > For example, spec/oes_sample_variables/preprocessor/enabled-es.comp
> > failed as soon as I enabled the OES_sample_variables extension.
> > ---
> >  tests/glslparsertest/glslparsertest.c | 41
> +++
> >  1 file changed, 18 insertions(+), 23 deletions(-)
> >
> > diff --git a/tests/glslparsertest/glslparsertest.c
> b/tests/glslparsertest/glslparsertest.c
> > index d70f508..b0b73d7 100644
> > --- a/tests/glslparsertest/glslparsertest.c
> > +++ b/tests/glslparsertest/glslparsertest.c
> > @@ -227,17 +227,23 @@ attach_dummy_shader(GLuint shader_prog, GLenum type)
> >  static void
> >  attach_complementary_shader(GLuint shader_prog, GLenum type)
> >  {
> > -   switch (type) {
> > -   case GL_FRAGMENT_SHADER:
> > +   if (type == GL_FRAGMENT_SHADER)
> > attach_dummy_shader(shader_prog, GL_VERTEX_SHADER);
> > -   break;
> > -   case GL_VERTEX_SHADER:
> > +   else if (type == GL_VERTEX_SHADER)
> > attach_dummy_shader(shader_prog, GL_FRAGMENT_SHADER);
> > -   break;
> > -   default:
> > -   fprintf(stderr,
> > -   "Unexpected type in
> attach_complementary_shader()");
> > -   piglit_report_result(PIGLIT_FAIL);
> > +}
> > +
> > +static void
> > +require_feature(int gl_ver, const char *gl_ext, int es_ver, const char
> *es_ext)
> > +{
> > +   const int required_ver = piglit_is_gles() ? es_ver : gl_ver;
> > +   const char *required_ext = piglit_is_gles() ? es_ext : gl_ext;
> > +
> > +   if (piglit_get_gl_version() < required_ver &&
> > +   !piglit_is_extension_supported(required_ext)) {
> > +   printf("Test requires version %g or %s\n",
> > +  required_ver / 10.0, required_ext);
> > +   piglit_report_result(PIGLIT_SKIP);
> > }
> >  }
> >
> > @@ -258,7 +264,6 @@ test(void)
> > type = GL_FRAGMENT_SHADER;
> > else if (strcmp(filename + strlen(filename) - 4, "vert") == 0)
> > type = GL_VERTEX_SHADER;
> > -#ifdef PIGLIT_USE_OPENGL
> > else if (strcmp(filename + strlen(filename) - 4, "tesc") == 0)
> > type = GL_TESS_CONTROL_SHADER;
> > else if (strcmp(filename + strlen(filename) - 4, "tese") == 0)
> > @@ -267,7 +272,6 @@ test(void)
> > type = GL_GEOMETRY_SHADER;
> > else if (strcmp(filename + strlen(filename) - 4, "comp") == 0)
> > type = GL_COMPUTE_SHADER;
> > -#endif
> > else {
> > type = GL_NONE;
> > fprintf(stderr, "Couldn't determine type of program %s\n",
> > @@ -279,21 +283,12 @@ test(void)
> > piglit_require_fragment_shader();
> >
> > if (type == GL_TESS_CONTROL_SHADER || type ==
> GL_TESS_EVALUATION_SHADER) {
> > -   if
> (!piglit_is_extension_supported("GL_ARB_tessellation_shader") &&
> > -   (piglit_is_gles() || piglit_get_gl_version() < 40)) {
> > -   printf("Test requires GL version 4.0 or "
> > -  "GL_ARB_tessellation_shader\n");
> > -   piglit_report_result(PIGLIT_SKIP);
> > -   }
> > +   require_feature(43, "GL_ARB_tessellation_shader",
> 
> I guess you meant 40 here?

Right, I was more focused on the ES version and...too much copy and
paste.  Fixed locally.  Thanks :)


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] glslparsertest: Handle compute and tessellation shaders in ES.

2016-05-13 Thread Kenneth Graunke
We apparently have some generated parser tests for ES 3.x extensions
that use compute shaders.  These didn't work because glslparsertest
didn't actually support these features.

For example, spec/oes_sample_variables/preprocessor/enabled-es.comp
failed as soon as I enabled the OES_sample_variables extension.
---
 tests/glslparsertest/glslparsertest.c | 41 +++
 1 file changed, 18 insertions(+), 23 deletions(-)

diff --git a/tests/glslparsertest/glslparsertest.c 
b/tests/glslparsertest/glslparsertest.c
index d70f508..b0b73d7 100644
--- a/tests/glslparsertest/glslparsertest.c
+++ b/tests/glslparsertest/glslparsertest.c
@@ -227,17 +227,23 @@ attach_dummy_shader(GLuint shader_prog, GLenum type)
 static void
 attach_complementary_shader(GLuint shader_prog, GLenum type)
 {
-   switch (type) {
-   case GL_FRAGMENT_SHADER:
+   if (type == GL_FRAGMENT_SHADER)
attach_dummy_shader(shader_prog, GL_VERTEX_SHADER);
-   break;
-   case GL_VERTEX_SHADER:
+   else if (type == GL_VERTEX_SHADER)
attach_dummy_shader(shader_prog, GL_FRAGMENT_SHADER);
-   break;
-   default:
-   fprintf(stderr,
-   "Unexpected type in attach_complementary_shader()");
-   piglit_report_result(PIGLIT_FAIL);
+}
+
+static void
+require_feature(int gl_ver, const char *gl_ext, int es_ver, const char *es_ext)
+{
+   const int required_ver = piglit_is_gles() ? es_ver : gl_ver;
+   const char *required_ext = piglit_is_gles() ? es_ext : gl_ext;
+
+   if (piglit_get_gl_version() < required_ver &&
+   !piglit_is_extension_supported(required_ext)) {
+   printf("Test requires version %g or %s\n",
+  required_ver / 10.0, required_ext);
+   piglit_report_result(PIGLIT_SKIP);
}
 }
 
@@ -258,7 +264,6 @@ test(void)
type = GL_FRAGMENT_SHADER;
else if (strcmp(filename + strlen(filename) - 4, "vert") == 0)
type = GL_VERTEX_SHADER;
-#ifdef PIGLIT_USE_OPENGL
else if (strcmp(filename + strlen(filename) - 4, "tesc") == 0)
type = GL_TESS_CONTROL_SHADER;
else if (strcmp(filename + strlen(filename) - 4, "tese") == 0)
@@ -267,7 +272,6 @@ test(void)
type = GL_GEOMETRY_SHADER;
else if (strcmp(filename + strlen(filename) - 4, "comp") == 0)
type = GL_COMPUTE_SHADER;
-#endif
else {
type = GL_NONE;
fprintf(stderr, "Couldn't determine type of program %s\n",
@@ -279,21 +283,12 @@ test(void)
piglit_require_fragment_shader();
 
if (type == GL_TESS_CONTROL_SHADER || type == 
GL_TESS_EVALUATION_SHADER) {
-   if 
(!piglit_is_extension_supported("GL_ARB_tessellation_shader") &&
-   (piglit_is_gles() || piglit_get_gl_version() < 40)) {
-   printf("Test requires GL version 4.0 or "
-  "GL_ARB_tessellation_shader\n");
-   piglit_report_result(PIGLIT_SKIP);
-   }
+   require_feature(43, "GL_ARB_tessellation_shader",
+   32, "GL_OES_tessellation_shader");
}
 
if (type == GL_COMPUTE_SHADER) {
-   if (!piglit_is_extension_supported("GL_ARB_compute_shader") &&
-   (piglit_is_gles() || piglit_get_gl_version() < 43)) {
-   printf("Test requires GL version 4.3 or "
-  "GL_ARB_compute_shader\n");
-   piglit_report_result(PIGLIT_SKIP);
-   }
+   require_feature(43, "GL_ARB_compute_shader", 31, NULL);
}
 
prog_string = piglit_load_text_file(filename, NULL);
-- 
2.8.2

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


Re: [Piglit] [PATCH] Add a test for instanced GS inputs.

2016-05-08 Thread Kenneth Graunke
On Sunday, May 8, 2016 10:55:11 AM PDT Ilia Mirkin wrote:
> On Sun, May 8, 2016 at 8:33 AM, Kenneth Graunke <kenn...@whitecape.org> 
wrote:
> > All of our other tests for instanced geometry shaders don't actually
> > read input variables.  This is currently broken with the i965 driver's
> > INTEL_SCALAR_GS=1 backend; I have patches to fix it.
> > ---
> >  .../execution/instanced-inputs.shader_test | 60 +
+
> >  1 file changed, 60 insertions(+)
> >  create mode 100644 tests/spec/arb_gpu_shader5/execution/instanced-
inputs.shader_test
> >
> > diff --git a/tests/spec/arb_gpu_shader5/execution/instanced-
inputs.shader_test b/tests/spec/arb_gpu_shader5/execution/instanced-
inputs.shader_test
> > new file mode 100644
> > index 000..eceb6c3
> > --- /dev/null
> > +++ b/tests/spec/arb_gpu_shader5/execution/instanced-inputs.shader_test
> > @@ -0,0 +1,60 @@
> > +[require]
> > +GL >= 2.0
> > +GLSL >= 1.50
> 
> Should probably list the GL_ARB_gpu_shader5 require in here, no?
> Otherwise this will fail on GPUs that don't support gs5.

D'oh!  Thanks!  I was hacking up a bunch of tests in the same afternoon,
and added it to the wrong one by mistake.  I've fixed that locally.


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Add a test for instanced GS inputs.

2016-05-08 Thread Kenneth Graunke
All of our other tests for instanced geometry shaders don't actually
read input variables.  This is currently broken with the i965 driver's
INTEL_SCALAR_GS=1 backend; I have patches to fix it.
---
 .../execution/instanced-inputs.shader_test | 60 ++
 1 file changed, 60 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader5/execution/instanced-inputs.shader_test

diff --git a/tests/spec/arb_gpu_shader5/execution/instanced-inputs.shader_test 
b/tests/spec/arb_gpu_shader5/execution/instanced-inputs.shader_test
new file mode 100644
index 000..eceb6c3
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/execution/instanced-inputs.shader_test
@@ -0,0 +1,60 @@
+[require]
+GL >= 2.0
+GLSL >= 1.50
+
+[vertex shader]
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#extension GL_ARB_gpu_shader5 : require
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+layout(invocations = 4) in;
+
+in vec4 vertex_to_gs[3];
+
+void main()
+{
+vec2 offset;
+if (gl_InvocationID == 0)
+offset.xy = vec2(-0.5, -0.5);
+else if (gl_InvocationID == 1)
+offset.xy = vec2( 0.5, -0.5);
+else if (gl_InvocationID == 2)
+offset.xy = vec2(-0.5,  0.5);
+else if (gl_InvocationID == 3)
+offset.xy = vec2( 0.5,  0.5);
+
+for (int i = 0; i < 3; i++) {
+gl_Position = vertex_to_gs[i];
+gl_Position.xy += offset;
+EmitVertex();
+}
+}
+
+[fragment shader]
+void main()
+{
+gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[vertex data]
+vertex/float/2
+-0.5 -0.5
+ 0.5 -0.5
+-0.5  0.0
+ 0.5  0.0
+-0.5  0.5
+ 0.5  0.5
+
+[test]
+clear color 0.0 0.0 0.0 0.0
+clear
+draw arrays GL_TRIANGLE_STRIP 0 6
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.8.2

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


[Piglit] [PATCH] Add a test that reproduces a problem in GLideN64.

2016-04-29 Thread Kenneth Graunke
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95164
---
 .../compiler/vector-dereference-in-dereference.frag  | 12 
 1 file changed, 12 insertions(+)
 create mode 100644 
tests/spec/glsl-1.10/compiler/vector-dereference-in-dereference.frag

diff --git 
a/tests/spec/glsl-1.10/compiler/vector-dereference-in-dereference.frag 
b/tests/spec/glsl-1.10/compiler/vector-dereference-in-dereference.frag
new file mode 100644
index 000..6c03136
--- /dev/null
+++ b/tests/spec/glsl-1.10/compiler/vector-dereference-in-dereference.frag
@@ -0,0 +1,12 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.10
+ * [end config]
+ */
+uniform ivec4 v;
+uniform mat4 m;
+
+void main()
+{
+gl_FragColor = m[v[0]];
+}
-- 
2.8.0

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


Re: [Piglit] [Mesa-dev] [PATCH piglit v2] Test that glShaderSource does not change compile status.

2016-04-26 Thread Kenneth Graunke
 MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 
OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> + * DEALINGS IN THE SOFTWARE.
> + */
> +
> +/**
> + * \file shadersource-no-compile.c
> + * OpenGL 4.5 Core Profile section 7.1, in the documentation for 
CompileShader,
> + * says: "Changing the source code of a shader object with ShaderSource 
does not
> + * change its compile status or the compiled shader code."
> + *
> + * This test creates a shader, compiles it, changes its source, and links 
it.
> + * The spec requires rendering done with this shader to be consistent with 
the
> + * old source, not the new source, since the shader isn't compiled again 
after
> + * the source is changed.
> + *
> + * According to Karol Herbst, the game "Divinity: Original Sin - Enhanced
> + * Edition" depends on this odd quirk of the spec. See:
> + * https://lists.freedesktop.org/archives/mesa-dev/2016-March/109789.html
> + */
> +#include "piglit-util-gl.h"
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +
> + config.supports_gl_compat_version = 20;
> +
> + config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
> +
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +static const char vs_text[] =
> + "void main() { gl_Position = gl_Vertex; "
> + "gl_FrontColor = vec4(0.0, 1.0, 0.0, 1.0); }";
> +
> +static const char good_fs_text[] =
> + "void main() { gl_FragColor = gl_Color; }";
> +
> +/* It is important that this shader *not* use gl_Color.
> + */
> +static const char bad_fs_text[] =
> + "void main() { gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0); }";

Why not just have both shaders draw constant colors - one blue, the
other green - and skip using gl_Color / glColor3fv?  It seems like that
would reproduce the issue, too, and is a bit simpler.

Either way, this looks good to me.  Thanks for testing and fixing this!

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

> +
> +enum piglit_result
> +piglit_display(void)
> +{
> + static const float green[3] = { 0.0, 1.0, 0.0 };
> + static const float blue[3]  = { 0.0, 0.0, 1.0 };
> +
> + glClear(GL_COLOR_BUFFER_BIT);
> +
> + /* good_fs_text uses the color from the vertex shader, which is green.
> +  * bad_fs_text uses a constant red color. Both are distinct from the
> +  * color set here, and from the clear-color.
> +  */
> + glColor3fv(blue);
> +
> + piglit_draw_rect(-1, -1, 2, 2);
> + if (!piglit_probe_pixel_rgb(15, 15, green))
> + return PIGLIT_FAIL;
> +
> + return PIGLIT_PASS;
> +}
> +
> +void
> +piglit_init(int argc, char **argv)
> +{
> + GLuint vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vs_text);
> + GLuint fs = piglit_compile_shader_text(GL_FRAGMENT_SHADER, 
> good_fs_text);
> + const GLchar *bad_fs_texts[] = { bad_fs_text };
> + GLuint prog;
> +
> + /* Change the shader source, but don't recompile it before linking. */
> + glShaderSource(fs, 1, bad_fs_texts, NULL);
> + prog = piglit_link_simple_program(vs, fs);
> + if (!prog)
> + piglit_report_result(PIGLIT_FAIL);
> +
> + glDeleteShader(vs);
> + glDeleteShader(fs);
> +
> + glUseProgram(prog);
> +
> + glClearColor(0.3, 0.3, 0.3, 0.0);
> +}
> 



signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [Mesa-dev] [PATCH] glShaderSource must not change compile status.

2016-04-26 Thread Kenneth Graunke
On Monday, April 25, 2016 10:06:40 PM PDT Jamey Sharp wrote:
> OpenGL 4.5 Core Profile section 7.1, in the documentation for
> CompileShader, says: "Changing the source code of a shader object with
> ShaderSource does not change its compile status or the compiled shader
> code." (I haven't checked older versions of the spec.)
> 
> According to Karol Herbst, the game "Divinity: Original Sin - Enhanced
> Edition" depends on this odd quirk of the spec. See:
> https://lists.freedesktop.org/archives/mesa-dev/2016-March/109789.html
> 
> This patch, together with MESA_GL_VERSION_OVERRIDE=4.2, allows
> "Divinity" to start up successfully on i965, though rendering bugs
> remain.
> 
> Signed-off-by: Jamey Sharp <ja...@minilop.net>
> Cc: Karol Herbst <nouv...@karolherbst.de>
> ---
>  src/mesa/main/shaderapi.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> index b28b5ce..fc2e885 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -949,7 +949,6 @@ shader_source(struct gl_shader *sh, const GLchar 
*source)
> /* free old shader source string and install new one */
> free((void *)sh->Source);
> sh->Source = source;
> -   sh->CompileStatus = GL_FALSE;
>  #ifdef DEBUG
> sh->SourceChecksum = _mesa_str_checksum(sh->Source);
>  #endif
> 

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/2] registery: update gl.xml to r32598

2016-04-04 Thread Kenneth Graunke
Typo in the commit title - "registery" vs. "registry".

This patch is:
Acked-by: Kenneth Graunke <kenn...@whitecape.org>

Patch 2 is:
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/2] util: GL ES doesn't like glReadPixels(GL_RGB). Always use RGBA instead.

2016-04-04 Thread Kenneth Graunke
On Sunday, April 3, 2016 8:13:51 PM PDT Ilia Mirkin wrote:
> Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu>
> ---
>  tests/util/piglit-util-gl.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
> index d636810..dbdfb13 100644
> --- a/tests/util/piglit-util-gl.c
> +++ b/tests/util/piglit-util-gl.c
> @@ -1223,11 +1223,11 @@ piglit_probe_rect_rgb(int x, int y, int w, int h, 
const float *expected)
>   GLfloat *probe;
>   GLfloat *pixels;
>  
> - pixels = piglit_read_pixels_float(x, y, w, h, GL_RGB, NULL);
> + pixels = piglit_read_pixels_float(x, y, w, h, GL_RGBA, NULL);
>  
>   for (j = 0; j < h; j++) {
>   for (i = 0; i < w; i++) {
> - probe = [(j*w+i)*3];
> + probe = [(j*w+i)*4];
>  
>   for (p = 0; p < 3; ++p) {
>   if (fabs(probe[p] - expected[p]) >= 
> piglit_tolerance[p]) {
> 

These two are:
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] texsubimage: Option to run against fixed region

2016-04-04 Thread Kenneth Graunke
On Tuesday, March 1, 2016 12:13:21 PM PDT Topi Pohjolainen wrote:
> While working on bug 91926 I spent quite some time simplifying
> the test to increase the probability of the error on Intel SKL
> hardware. This series adds an option to run the test against
> fixed target, format and region.
> 
> The last patch is more of an request-for-comments type and not
> that important. It just helped me to understand the error a
> little more while I hacked the driver to use tex coordinates
> as color values.
> 
> Topi Pohjolainen (7):
>   texsubimage: Refactor single round for fixed region
>   texsubimage: Move texture size selection higher in the dispatch
>   texsubimage: Move sub-region selection higher in the dispatch
>   texsubimage: Move tex blit program setup higher in the dispatch
>   texsubimage: Add option to run against fixed region
>   texsubimage: Remove unnecessary clear
>   util: Print all image errors
> 
>  tests/texturing/texsubimage.c | 373 +++
+--
>  tests/util/piglit-util-gl.c   |   5 +-
>  2 files changed, 256 insertions(+), 122 deletions(-)

Patches 1-6 are:
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Add a copy of samplemaskin-basic that uses a non-const array index.

2016-04-04 Thread Kenneth Graunke
Currently triggers an assert fail in Mesa's GLSL compiler.
---
 .../execution/samplemaskin-indirect.shader_test| 27 ++
 1 file changed, 27 insertions(+)
 create mode 100644 
tests/spec/arb_gpu_shader5/execution/samplemaskin-indirect.shader_test

diff --git 
a/tests/spec/arb_gpu_shader5/execution/samplemaskin-indirect.shader_test 
b/tests/spec/arb_gpu_shader5/execution/samplemaskin-indirect.shader_test
new file mode 100644
index 000..6dc7bc9
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/execution/samplemaskin-indirect.shader_test
@@ -0,0 +1,27 @@
+[require]
+GLSL >= 1.50
+GL_ARB_gpu_shader5
+
+[vertex shader passthrough]
+
+[fragment shader]
+#extension GL_ARB_gpu_shader5 : enable
+
+out vec4 color;
+
+uniform int zero;
+
+void main()
+{
+   color = vec4(1.0, 0.0, 0.0, 1.0);
+
+   /* No MS set up, should just be the current fragment. */
+   if (gl_SampleMaskIn[zero] == 1) {
+   color.rg = vec2(0.0, 1.0);
+   }
+}
+
+[test]
+uniform int zero 0
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 1.0
-- 
2.7.4

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


[Piglit] [PATCH] Drop floating point suffix from a GLSL 1.10 shader.

2016-03-28 Thread Kenneth Graunke
The 'f' suffix isn't required, and in fact it isn't technically allowed
in GLSL 1.10 either.

Cc: Lars Hamre 
---
 tests/spec/arb_texture_cube_map_array/cubemap-lod.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Hi Lars,

I noticed this Piglit test regressed when applying your Mesa patch.
It turns out the test was broken :)

 --Ken

diff --git a/tests/spec/arb_texture_cube_map_array/cubemap-lod.c 
b/tests/spec/arb_texture_cube_map_array/cubemap-lod.c
index ceb347b..2816f9e 100644
--- a/tests/spec/arb_texture_cube_map_array/cubemap-lod.c
+++ b/tests/spec/arb_texture_cube_map_array/cubemap-lod.c
@@ -80,7 +80,7 @@ static const char *frag_shader_biased =
  "uniform samplerCubeArray tex; \n"
  "void main()\n"
  "{\n"
- " gl_FragColor = texture(tex, gl_TexCoord[0], 3.0f);\n"
+ " gl_FragColor = texture(tex, gl_TexCoord[0], 3.0);\n"
  "}\n";
 
 static const char *frag_shader_explicit =
@@ -88,7 +88,7 @@ static const char *frag_shader_explicit =
  "uniform samplerCubeArray tex; \n"
  "void main()\n"
  "{\n"
- " gl_FragColor = textureLod(tex, gl_TexCoord[0], 3.0f);\n"
+ " gl_FragColor = textureLod(tex, gl_TexCoord[0], 3.0);\n"
  "}\n";
 
 static GLuint frag_shader_cube_array_biased;
-- 
2.7.4

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


Re: [Piglit] [PATCH] framework: Add generic deqp options to piglit.conf

2016-03-10 Thread Kenneth Graunke
On Thursday, March 10, 2016 5:44:40 PM PST Dylan Baker wrote:
> Sometimes there are extra arguments to deqp that a developer wants for
> all of the test suites, this adds that option by putting a generic
> [deqp] section and add an extra_args. This new extra args gets joined
> with any suite specific extra_args
> 
> Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> ---
>  framework/test/deqp.py | 28 +---
>  piglit.conf.example|  4 
>  tests/cts.py   |  6 +-
>  tests/deqp_gles2.py|  7 ++-
>  tests/deqp_gles3.py|  6 +-
>  tests/deqp_gles31.py   |  6 +-
>  6 files changed, 42 insertions(+), 15 deletions(-)

I haven't tested this, but it looks good to me and sounds nice.
That way, I can specify --deqp-visibility=hidden once.

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Fix invalid glShaderSource call in pipeline_stats_comp.

2016-02-09 Thread Kenneth Graunke
The test was passing a pointer to an uninitialized integer value as the
glShaderSource length parameter.  This is meant to be an array
containing the length of each shader string.

Instead, just pass NULL, which makes the GL assume the strings are
null-terminated (which they are).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93335
Cc: Jordan Justen 
Cc: Mark Janes 
---
 tests/spec/arb_pipeline_statistics_query/pipeline_stats_comp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/spec/arb_pipeline_statistics_query/pipeline_stats_comp.c 
b/tests/spec/arb_pipeline_statistics_query/pipeline_stats_comp.c
index 47a36b0..3c511f1 100644
--- a/tests/spec/arb_pipeline_statistics_query/pipeline_stats_comp.c
+++ b/tests/spec/arb_pipeline_statistics_query/pipeline_stats_comp.c
@@ -79,7 +79,6 @@ static void
 dispatch_size(uint32_t x, uint32_t y, uint32_t z)
 {
char *compute_shader;
-   GLint shader_string_size;
GLuint shader = glCreateShader(GL_COMPUTE_SHADER);
GLint ok;
static GLint prog = 0;
@@ -92,7 +91,7 @@ dispatch_size(uint32_t x, uint32_t y, uint32_t z)
 
glShaderSource(shader, 1,
   (const GLchar **) _shader,
-  _string_size);
+  NULL);
 
glCompileShader(shader);
 
-- 
2.7.0

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


Re: [Piglit] [PATCH] counters/semantics: change the point emitted from TES that carries info

2016-01-03 Thread Kenneth Graunke
On Sunday, January 3, 2016 3:03:14 AM PST Ilia Mirkin wrote:
> Previously we emitted the point where x == y == 0. This was the first
> point and was always overwritten. Instead emit the x == 1, y == 0 point
> which is the last emitted in a ccw ordering.
> 
> Signed-off-by: Ilia Mirkin <imir...@alum.mit.edu>
> ---
>  tests/spec/arb_shader_atomic_counters/semantics.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/spec/arb_shader_atomic_counters/semantics.c b/tests/spec/
arb_shader_atomic_counters/semantics.c
> index 921c0e8..931f030 100644
> --- a/tests/spec/arb_shader_atomic_counters/semantics.c
> +++ b/tests/spec/arb_shader_atomic_counters/semantics.c
> @@ -338,7 +338,7 @@ run_test_tess_evaluation(void)
>  "   gl_in[1].gl_Position * gl_TessCoord.y +\n"
>  "   gl_in[2].gl_Position * gl_TessCoord.z;\n"
>  "   \n"
> -"   if (gl_TessCoord.z == 1.0) {\n"
> +"   if (gl_TessCoord.y == 0.0 && gl_TessCoord.x == 1.0) 
{\n"
>  "   tecolor.x = int(atomicCounterDecrement(x));
\n"
>  "   tecolor.y = int(atomicCounterIncrement(x));
\n"
>  "   tecolor.z = int(atomicCounterIncrement(x));
\n"
> 

Thanks!  This makes sense.  It also fixes the test on i965.

This test was mentioned in Mesa bug 93542:
https://bugs.freedesktop.org/show_bug.cgi?id=93542
but I'm not sure if it's worth referencing.  Up to you.

Reviewed-and-tested-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Add an SSO test which mix-and-matches TCS/TES with different interfaces.

2015-12-21 Thread Kenneth Graunke
On i965, the TCS writes a memory location which the TES reads.  Both
shader stages need to agree upon the layout.  With SSO, this is tricky,
as OpenGL allows developers to freely mix-and-match separate TCS and TES
programs that have never been linked together.

To test this, we compile two TCS programs with different outputs, and
create SSO pipelines that use them with the same TES.  A layout
determined by the TES alone would not suffice, so this ensures that
the layout is updated when the TCS changes.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 .../arb_separate_shader_objects/CMakeLists.gl.txt  |   1 +
 .../mix-and-match-tcs-tes.c| 209 +
 2 files changed, 210 insertions(+)
 create mode 100644 
tests/spec/arb_separate_shader_objects/mix-and-match-tcs-tes.c

Passes with Nouveau on NVE4.  Initially fails on i965, but passes with my new
Mesa patches to handle this case correctly.

diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt 
b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
index 3a55130..234d58d 100644
--- a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
+++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
@@ -15,6 +15,7 @@ piglit_add_executable 
(arb_separate_shader_object-compat-builtins compat-builtin
 piglit_add_executable (arb_separate_shader_object-GetProgramPipelineiv 
GetProgramPipelineiv.c)
 piglit_add_executable (arb_separate_shader_object-IsProgramPipeline 
IsProgramPipeline.c)
 piglit_add_executable 
(arb_separate_shader_object-mixed_explicit_and_non_explicit_locations 
mixed_explicit_and_non_explicit_locations.c sso-common.c)
+piglit_add_executable (arb_separate_shader_object-mix-and-match-tcs-tes 
mix-and-match-tcs-tes.c)
 piglit_add_executable (arb_separate_shader_object-ProgramUniform-coverage 
ProgramUniform-coverage.c)
 piglit_add_executable (arb_separate_shader_object-rendezvous_by_location 
rendezvous_by_location.c sso-common.c)
 piglit_add_executable 
(arb_separate_shader_object-rendezvous_by_location-3-stages 
rendezvous_by_location-3-stages.c)
diff --git a/tests/spec/arb_separate_shader_objects/mix-and-match-tcs-tes.c 
b/tests/spec/arb_separate_shader_objects/mix-and-match-tcs-tes.c
new file mode 100644
index 000..6e0643e
--- /dev/null
+++ b/tests/spec/arb_separate_shader_objects/mix-and-match-tcs-tes.c
@@ -0,0 +1,209 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * This program tests SSO pipelines where the TCS and TES are not linked
+ * together, but specified in separate shaders.  In particular, this means
+ * that the GLSL linker won't know the interface between the TCS and TES.
+ *
+ * We compile two TCS programs.  Both are largely the same, but the second
+ * has extra unused outputs, which means the two pipelines have a different
+ * number of per-patch outputs.  At least on i965, this requires a re-layout
+ * of the TCS/TES interface.
+ *
+ * The output is a single green square, but drawn in two halves, each with
+ * a different SSO pipeline.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 0;
+   config.supports_gl_core_version = 32;
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static GLuint pipeline[2];
+
+static const char *vs_code =
+   "#version 150\n"
+   "#extension GL_ARB_separate_shader_objects: require\n"
+   "in vec4 piglit_vertex;"
+   "void main()\n"
+   "{\n"
+   "gl_Position = piglit_vertex;\n"
+   "}\n"
+   ;
+
+#define TCS(vars, extra_code) \
+   "#version 150\n" \
+   "#extension GL_ARB_separate_shader_objects: requ

[Piglit] [PATCH] Replace vs-tes-tessinner-tessouter-inputs with two new tests.

2015-12-17 Thread Kenneth Graunke
(This is commit 42587e6d4bc8dd79be02b for the !TCS case.)

vs-tes-tessinner-tessouter-inputs tried to verify that all vector
components written by the TCS were present in the TES.  However, this
is not guaranteed.  According to the ARB_tessellation_shader spec:

"Tessellation Evaluation Shader Inputs
 [...]
 For triangular tessellation, gl_TessLevelOuter[3] and gl_TessLevelInner[1]
 will be undefined.  For isoline tessellation, gl_TessLevelOuter[2],
 gl_TessLevelOuter[3], and both values in gl_TessLevelInner[] are undefined."

This patch removes the broken test, and replaces it with two new ones.
One uses quads, and probes all 4/2 components.  The other uses
triangles, but only probes the 3/1 components that are actually defined.

Testing both types of domains is especially useful for i965, which
stores the data in different layouts depending on the domain.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
Cc: Ilia Mirkin <imir...@alum.mit.edu>
Cc: Marek Olšák <marek.ol...@amd.com>
---
 ...es-tessinner-tessouter-inputs-quads.shader_test | 53 
 ...tes-tessinner-tessouter-inputs-tris.shader_test | 57 ++
 .../vs-tes-tessinner-tessouter-inputs.shader_test  | 55 -
 3 files changed, 110 insertions(+), 55 deletions(-)
 create mode 100644 
tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs-quads.shader_test
 create mode 100644 
tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs-tris.shader_test
 delete mode 100644 
tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs.shader_test

diff --git 
a/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs-quads.shader_test
 
b/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs-quads.shader_test
new file mode 100644
index 000..67d5245
--- /dev/null
+++ 
b/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs-quads.shader_test
@@ -0,0 +1,53 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+
+[vertex shader]
+in vec4 vertex;
+
+void main()
+{
+   gl_Position = vertex;
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+layout(quads) in;
+
+out vec4 color;
+
+void main() {
+   gl_Position = vec4(gl_TessCoord.xy * 2 - 1, 0, 1);
+   color = gl_TessLevelOuter == float[4](2.0, 4.0, 7.0, 6.0) &&
+   gl_TessLevelInner == float[2](5.0, 3.0) ?
+   vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+
+[fragment shader]
+in vec4 color;
+
+void main()
+{
+   gl_FragColor = color;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+-1.0  1.0
+-1.0  1.0
+ 1.0 -1.0
+ 1.0  1.0
+
+[test]
+clear color 0.1 0.1 0.1 0.1
+clear
+patch parameter vertices 1
+patch parameter default level outer 2 4 7 6
+patch parameter default level inner 5 3
+draw arrays GL_PATCHES 0 1
+probe all rgba 0.0 1.0 0.0 1.0
diff --git 
a/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs-tris.shader_test
 
b/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs-tris.shader_test
new file mode 100644
index 000..bca8404
--- /dev/null
+++ 
b/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs-tris.shader_test
@@ -0,0 +1,57 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+
+[vertex shader]
+in vec4 vertex;
+
+void main()
+{
+   gl_Position = vertex;
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+layout(triangles) in;
+
+out vec4 color;
+
+void main() {
+   gl_Position = gl_in[0].gl_Position * gl_TessCoord[0]
+   + gl_in[1].gl_Position * gl_TessCoord[1]
+   + gl_in[2].gl_Position * gl_TessCoord[2];
+   color = gl_TessLevelOuter[0] == 2.0 &&
+   gl_TessLevelOuter[1] == 4.0 &&
+   gl_TessLevelOuter[2] == 7.0 &&
+   gl_TessLevelInner[0] == 5.0 ?
+   vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+
+[fragment shader]
+in vec4 color;
+
+void main()
+{
+   gl_FragColor = color;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+-1.0  1.0
+-1.0  1.0
+ 1.0 -1.0
+ 1.0  1.0
+
+[test]
+clear color 0.1 0.1 0.1 0.1
+clear
+patch parameter vertices 3
+patch parameter default level outer 2 4 7 6
+patch parameter default level inner 5 3
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
diff --git 
a/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs.shader_test
 
b/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs.shader_test
deleted file mode 100644
index 33be891..000
--- 
a/tests/spec/arb_tessellation_shader/execution/vs-tes-tessinner-tessouter-inputs.shader_test
+++ /dev/null
@@ -1,55 +0,0 @@
-[require]
-GLSL >= 

Re: [Piglit] [PATCH V4 1/5] shader_runner: Add basic SSO support to shader runner

2015-12-09 Thread Kenneth Graunke
On Monday, December 07, 2015 11:06:33 AM Timothy Arceri wrote:
> This sets up the basics for using SSO with shader runner. This will
> only support vertex and fragment shaders but is easily extended.
> 
> V2: delete pipeline in cleanup code rather than calling gen again,
> output error message when SSO fails to link
> 
> V3: add new option to [require] to allow separate shader objects to be
> enabled for the entire test.
> 
> V4:
> - remove infrastructure left over from V2 (as suggested by Ken)
> - rework linking so that we dont use glCreateShaderProgram() this
>  allows   us to support multiple shaders per stage.
> 
> Example use:
> [require]
> SSO ENABLED
> 
> Adding the ENABLED field rather than just using SSO will allow us to use
> DISABLED in future should we ever add the ability to automatically run
> all tests as SSO.
> 
> Example shader:
> 
> [require]
> GLSL >= 1.50
> SSO ENABLED
> 
> [vertex shader]
> 
> layout(location = 0) in vec4 piglit_vertex;
> 
> layout(location = 2) out vec3 a;
> layout(location = 3) out vec3 b;
> 
> void main()
> {
> gl_Position = piglit_vertex;
> a = vec3(0, 0, 1);
> b = vec3(1, 0, 0);
> }
> 
> [fragment shader]
> 
> layout(location = 0) out vec4 out_color;
> 
> layout(location = 2) in vec3 b; /* should get vec3(0, 0, 1) */
> layout(location = 3) in vec3 a; /* should get vec3(1, 0, 0) */
> 
> void main()
> {
> out_color = vec4(cross(b, a), 1);
> }
> 
> [test]
> draw rect -1 -1 2 2
> probe all rgb 0 1 0
> 
> Cc: Kenneth Graunke <kenn...@whitecape.org>
> ---
>  tests/shaders/shader_runner.c | 158 
> +-
>  1 file changed, 111 insertions(+), 47 deletions(-)
> 
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index eeb1aac..da21af2 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -123,10 +123,12 @@ GLint shader_string_size;
>  const char *vertex_data_start = NULL;
>  const char *vertex_data_end = NULL;
>  GLuint prog;
> +GLuint pipeline;
>  size_t num_vbo_rows = 0;
>  bool vbo_present = false;
>  bool link_ok = false;
>  bool prog_in_use = false;
> +bool sso_in_use = false;
>  GLchar *prog_err_info = NULL;
>  GLuint vao = 0;
>  GLuint fbo = 0;
> @@ -480,6 +482,44 @@ compile_and_bind_program(GLenum target, const char 
> *start, int len)
>   prog_in_use = true;
>  }
>  
> +void
> +link_sso(GLenum target)
> +{
> + GLint ok;
> +
> + glLinkProgram(prog);
> +
> + glGetProgramiv(prog, GL_LINK_STATUS, );
> + if (ok) {
> + link_ok = true;
> + } else {
> + GLint size;
> +
> + glGetProgramiv(prog, GL_INFO_LOG_LENGTH, );
> + prog_err_info = malloc(size);
> +
> + glGetProgramInfoLog(prog, size, NULL, prog_err_info);
> +
> + fprintf(stderr, "SSO glLinkProgram(%s) failed: %s\n",
> + target_to_short_name(target),
> + prog_err_info);
> +
> + free(prog_err_info);
> + piglit_report_result(PIGLIT_FAIL);
> +
> + return;
> + }
> +
> +     switch (target) {
> + case GL_VERTEX_SHADER:
> + glUseProgramStages(pipeline, GL_VERTEX_SHADER_BIT, prog);
> + break;
> + case GL_FRAGMENT_SHADER:
> + glUseProgramStages(pipeline, GL_FRAGMENT_SHADER_BIT, prog);
> + break;

May as well add the rest of the shader stages here, too?

Either way,
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH V3 1/4] shader_runner: Add basic SSO support to shader runner

2015-12-05 Thread Kenneth Graunke
On Sunday, December 06, 2015 01:58:31 PM Timothy Arceri wrote:
> This sets up the basics for using SSO with shader runner. This will
> only support vertex and fragment shaders but is easily extended.
> 
> V2: delete pipeline in cleanup code rather than calling gen again,
> output error message when SSO fails to link
> 
> V3: add new option to [require] to allow separate shader objects to be
> enabled for the entire test.
> 
> Example use:
> [require]
> SSO ENABLED
> 
> Adding the ENABLED field rather than just using SSO will allow us to use
> DISABLED in future should we ever add the ability to automatically run
> all tests as SSO.
> 
> Example shader:
> 
> [require]
> GLSL >= 1.50
> SSO ENABLED
> 
> [vertex shader]
> 
> layout(location = 0) in vec4 piglit_vertex;
> 
> layout(location = 2) out vec3 a;
> layout(location = 3) out vec3 b;
> 
> void main()
> {
> gl_Position = piglit_vertex;
> a = vec3(0, 0, 1);
> b = vec3(1, 0, 0);
> }
> 
> [fragment shader]
> 
> layout(location = 0) out vec4 out_color;
> 
> layout(location = 2) in vec3 b; /* should get vec3(0, 0, 1) */
> layout(location = 3) in vec3 a; /* should get vec3(1, 0, 0) */
> 
> void main()
> {
> out_color = vec4(cross(b, a), 1);
> }
> 
> [test]
> draw rect -1 -1 2 2
> probe all rgb 0 1 0
> 
> Cc: Kenneth Graunke <kenn...@whitecape.org>
> ---
>  tests/shaders/shader_runner.c | 90 
> +--
>  1 file changed, 86 insertions(+), 4 deletions(-)

I think you could simplify the code substantially by adding this to
the top of compile_glsl():

if (sso_in_use) {
create_sso(target, shader_string, shader_string_size);
return;
}

Then you could...

> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index eeb1aac..a5f456f 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -123,10 +123,12 @@ GLint shader_string_size;
>  const char *vertex_data_start = NULL;
>  const char *vertex_data_end = NULL;
>  GLuint prog;
> +GLuint pipeline;
>  size_t num_vbo_rows = 0;
>  bool vbo_present = false;
>  bool link_ok = false;
>  bool prog_in_use = false;
> +bool sso_in_use = false;
>  GLchar *prog_err_info = NULL;
>  GLuint vao = 0;
>  GLuint fbo = 0;
> @@ -137,12 +139,14 @@ enum states {
>   requirements,
>   vertex_shader,
>   vertex_shader_passthrough,
> + vertex_sso,

drop this

>   vertex_program,
>   tess_ctrl_shader,
>   tess_eval_shader,
>   geometry_shader,
>   geometry_layout,
>   fragment_shader,
> + fragment_sso,

and this

>   fragment_program,
>   compute_shader,
>   vertex_data,
> @@ -480,6 +484,55 @@ compile_and_bind_program(GLenum target, const char 
> *start, int len)
>   prog_in_use = true;
>  }
>  
> +void
> +create_sso(GLenum target, const char *start, int len)
> +{
> + GLuint prog;
> + GLint ok;
> + char *source;
> +
> + piglit_require_extension("GL_ARB_separate_shader_objects");
> +
> + source = malloc(len + 1);
> + memcpy(source, start, len);
> + source[len] = 0;
> + prog = glCreateShaderProgramv(target, 1,
> + (const GLchar *const *) );
> +
> + glGetProgramiv(prog, GL_LINK_STATUS, );
> + if (ok) {
> + link_ok = true;
> + } else {
> + GLint size;
> +
> + glGetProgramiv(prog, GL_INFO_LOG_LENGTH, );
> + prog_err_info = malloc(size);
> +
> + glGetProgramInfoLog(prog, size, NULL, prog_err_info);
> +
> + fprintf(stderr, "glCreateShaderProgramv(%s) failed: %s\n",
> + target_to_short_name(target),
> + prog_err_info);
> +
> + free(prog_err_info);
> + piglit_report_result(PIGLIT_FAIL);
> +
> + return;
> + }
> +
> + switch (target) {
> + case GL_VERTEX_SHADER:
> + glUseProgramStages(pipeline, GL_VERTEX_SHADER_BIT, prog);
> + break;
> + case GL_FRAGMENT_SHADER:
> + glUseProgramStages(pipeline, GL_FRAGMENT_SHADER_BIT, prog);
> + break;
> + }
> +
> + sso_in_use = true;

This doesn't seem useful now that we have a global option

> + prog_in_use = true;
> +}
> +
>  /**
>   * Compare two values given a specified comparison operator
>   */
> @@ -705,13 +758,14 @@ process_requirement(const char *line)
>   return;
>   }
>  
> - /* There are four types of req

Re: [Piglit] [PATCH 3/4] shader_runner: add support for setting glActiveShaderProgram()

2015-12-04 Thread Kenneth Graunke
On Friday, December 04, 2015 09:11:05 PM Timothy Arceri wrote:
> This will allow us to set uniforms in SSO.
> 
> For example to make the fragment program active:
> active shader program GL_FRAGMENT_SHADER
> ---
>  tests/shaders/shader_runner.c | 13 +
>  1 file changed, 13 insertions(+)

This looks great, Timothy, thanks!

Patches 2-3 are:
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>

Patch 1 looks good as well.  I think it'd be simpler to have a single
flag in the [require] block rather than using [vertex sso], [fragment
sso], and so on...saves confusion as to what happens if you mix and
match [vertex sso] and [geometry shader].  With that change, I'd be
happy to give it an R-b as well.


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 2/6] shader_runner: Don't call glDeleteProgram on an ARB program.

2015-11-24 Thread Kenneth Graunke
On Tuesday, November 24, 2015 02:20:10 PM Matt Turner wrote:
> On Wed, Nov 11, 2015 at 4:53 PM, Kenneth Graunke <kenn...@whitecape.org> 
> wrote:
> > On Tuesday, November 10, 2015 10:46:19 PM Matt Turner wrote:
> >> I don't feel good about this check, but it is done elsewhere in the same
> >> file ("prog == 0").
> >> ---
> >>  tests/shaders/shader_runner.c | 8 ++--
> >>  1 file changed, 6 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> >> index 4597b46..bb17381 100644
> >> --- a/tests/shaders/shader_runner.c
> >> +++ b/tests/shaders/shader_runner.c
> >> @@ -3081,8 +3081,12 @@ piglit_display(void)
> >>   if (piglit_automatic) {
> >>   free_subroutine_uniforms();
> >>   /* Free our resources, useful for valgrinding. */
> >> - glDeleteProgram(prog);
> >> - glUseProgram(0);
> >> + if (prog != 0) {
> >> + glDeleteProgram(prog);
> >> + glUseProgram(0);
> >> + } else {
> >> + glDeleteProgramsARB(1, );
> >> + }
> >>   }
> >>
> >>   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
> >>
> >
> > Wow.  Nasty.
> >
> > Both link_and_use_shaders() [GLSL] and compile_and_bind_program() [ARB]
> > set prog to a non-zero value.  So at first glance this seems utterly bunk.
> > However, compile_and_bind_program() creates a local "GLuint prog" variable
> > that shadows the global one, so it never actually sets this.  Heh.
> >
> > I was about to say this was correct.
> >
> > However, I don't see anything actually initializing the global prog
> > variable to 0...so won't this be using an uninitialized value?  (As
> > would the existing code you patterned this after?)
> 
> Sorry for the late reply -- I apparently didn't read your reply
> carefully enough initially.
> 
> Globals in C are automatically initialized to 0. Given that, I think
> this is okay.

Oh, right.  I think it's correct then.  Still nasty, but functional.

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 2/6] shader_runner: Don't call glDeleteProgram on an ARB program.

2015-11-11 Thread Kenneth Graunke
On Tuesday, November 10, 2015 10:46:19 PM Matt Turner wrote:
> I don't feel good about this check, but it is done elsewhere in the same
> file ("prog == 0").
> ---
>  tests/shaders/shader_runner.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 4597b46..bb17381 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -3081,8 +3081,12 @@ piglit_display(void)
>   if (piglit_automatic) {
>   free_subroutine_uniforms();
>   /* Free our resources, useful for valgrinding. */
> - glDeleteProgram(prog);
> - glUseProgram(0);
> + if (prog != 0) {
> + glDeleteProgram(prog);
> + glUseProgram(0);
> + } else {
> + glDeleteProgramsARB(1, );
> + }
>   }
>  
>   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
> 

Wow.  Nasty.

Both link_and_use_shaders() [GLSL] and compile_and_bind_program() [ARB]
set prog to a non-zero value.  So at first glance this seems utterly bunk.
However, compile_and_bind_program() creates a local "GLuint prog" variable
that shadows the global one, so it never actually sets this.  Heh.

I was about to say this was correct.

However, I don't see anything actually initializing the global prog
variable to 0...so won't this be using an uninitialized value?  (As
would the existing code you patterned this after?)


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 3/6] arb_vertex_program: Remove unnecessary fragment programs.

2015-11-11 Thread Kenneth Graunke
On Tuesday, November 10, 2015 10:46:20 PM Matt Turner wrote:
> These just performed actions the fixed-function processing would have
> done. Removing them allows these tests to execute on hardware that
> supports ARB_vertex_program but not ARB_fragment_program (like R200).

Patches 3-6 are:
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 1/6] shader_runner: Check feature support before querying GL_MAX_*.

2015-11-11 Thread Kenneth Graunke
On Tuesday, November 10, 2015 10:46:18 PM Matt Turner wrote:
> Otherwise, these will generate an error (to be noticed sometime later
> when glGetError() is called), often resulting in a test failure.
> ---
>  tests/shaders/shader_runner.c | 18 --
>  1 file changed, 12 insertions(+), 6 deletions(-)
> 
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 32ac7bd..4597b46 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -3111,12 +3111,18 @@ piglit_init(int argc, char **argv)
>   if (piglit_get_gl_version() >= 32)
>   glGetIntegerv(GL_MAX_VERTEX_OUTPUT_COMPONENTS,
> _max_vertex_output_components);
> - glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
> -   _max_fragment_uniform_components);
> - glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
> -   _max_vertex_uniform_components);
> - glGetIntegerv(GL_MAX_VARYING_COMPONENTS,
> -   _max_varying_components);
> + if (piglit_get_gl_version() >= 20 ||
> + piglit_is_extension_supported("GL_ARB_fragment_shader"))
> + glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS,
> +   _max_fragment_uniform_components);
> + if (piglit_get_gl_version() >= 20 ||
> + piglit_is_extension_supported("GL_ARB_vertex_shader"))
> + glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS,
> +   _max_vertex_uniform_components);

Above this, we call piglit_require_GLSL()...it seems like that
ought to be causing us to skip in this case.  Maybe we don't
return early enough?

There's also piglit_require_vertex_shader() and
piglit_require_fragment_shader() if those are useful to you...

> + if (piglit_get_gl_version() >= 30 ||
> + piglit_is_extension_supported("GL_EXT_geometry_shader4"))
> + glGetIntegerv(GL_MAX_VARYING_COMPONENTS,
> +   _max_varying_components);

There's also GL_ARB_geometry_shader4, which introduces this.

>   glGetIntegerv(GL_MAX_CLIP_PLANES, _max_clip_planes);
>  #else
>   glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS,
> 


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Replace vs-tcs-tes-tessinner-tessouter-inputs with two new tests.

2015-10-21 Thread Kenneth Graunke
vs-tcs-tes-tessinner-tessouter-inputs tried to verify that all vector
components written by the TCS were present in the TES.  However, this
is not guaranteed.  According to the ARB_tessellation_shader spec:

"Tessellation Evaluation Shader Inputs
 [...]
 For triangular tessellation, gl_TessLevelOuter[3] and gl_TessLevelInner[1]
 will be undefined.  For isoline tessellation, gl_TessLevelOuter[2],
 gl_TessLevelOuter[3], and both values in gl_TessLevelInner[] are undefined."

This patch removes the broken test, and replaces it with two new ones.
One uses quads, and probes all 4/2 components.  The other uses
triangles, but only probes the 3/1 components that are actually defined.

Testing both types of domains is especially useful for i965, which
stores the data in different layouts depending on the domain.

According to Ilia Mirkin, these both pass on nvc0.

Cc: Ilia Mirkin 
Cc: Marek Olšák 
---
 ...es-tessinner-tessouter-inputs-quads.shader_test | 52 +
 ...tes-tessinner-tessouter-inputs-tris.shader_test | 66 ++
 ...-tcs-tes-tessinner-tessouter-inputs.shader_test | 64 -
 3 files changed, 118 insertions(+), 64 deletions(-)
 create mode 100644 
tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-quads.shader_test
 create mode 100644 
tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-tris.shader_test
 delete mode 100644 
tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs.shader_test

diff --git 
a/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-quads.shader_test
 
b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-quads.shader_test
new file mode 100644
index 000..b2c03a6
--- /dev/null
+++ 
b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-quads.shader_test
@@ -0,0 +1,52 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+
+[vertex shader]
+in vec4 vertex;
+
+void main()
+{
+   gl_Position = vertex;
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+layout(vertices = 1) out;
+
+void main() {
+   gl_TessLevelOuter = float[4](3.0, 2.0, 4.0, 5.0);
+   gl_TessLevelInner = float[2](6.0, 7.0);
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+layout(quads) in;
+
+out vec4 color;
+
+void main() {
+   gl_Position = vec4(gl_TessCoord.xy * 2 - 1, 0, 1);
+   color = gl_TessLevelOuter == float[4](3.0, 2.0, 4.0, 5.0) &&
+   gl_TessLevelInner == float[2](6.0, 7.0) ?
+   vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+
+[fragment shader]
+in vec4 color;
+
+void main()
+{
+   gl_FragColor = color;
+}
+
+[test]
+clear color 0.1 0.1 0.1 0.1
+clear
+patch parameter vertices 1
+draw arrays GL_PATCHES 0 1
+probe all rgba 0.0 1.0 0.0 1.0
diff --git 
a/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-tris.shader_test
 
b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-tris.shader_test
new file mode 100644
index 000..3a75b36
--- /dev/null
+++ 
b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs-tris.shader_test
@@ -0,0 +1,66 @@
+[require]
+GLSL >= 1.50
+GL_ARB_tessellation_shader
+
+
+[vertex shader]
+in vec4 vertex;
+
+void main()
+{
+   gl_Position = vertex;
+}
+
+
+[tessellation control shader]
+#extension GL_ARB_tessellation_shader: require
+layout(vertices = 3) out;
+
+void main() {
+   gl_out[gl_InvocationID].gl_Position = 
gl_in[gl_InvocationID].gl_Position;
+   gl_TessLevelOuter = float[4](3.0, 2.0, 4.0, 5.0);
+   gl_TessLevelInner = float[2](6.0, 7.0);
+}
+
+
+[tessellation evaluation shader]
+#extension GL_ARB_tessellation_shader: require
+layout(triangles) in;
+
+out vec4 color;
+
+void main() {
+   gl_Position = gl_in[0].gl_Position * gl_TessCoord[0]
+   + gl_in[1].gl_Position * gl_TessCoord[1]
+   + gl_in[2].gl_Position * gl_TessCoord[2];
+   color = gl_TessLevelOuter[0] == 3.0 &&
+   gl_TessLevelOuter[1] == 2.0 &&
+   gl_TessLevelOuter[2] == 4.0 &&
+   gl_TessLevelInner[0] == 6.0 ?
+   vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+}
+
+
+[fragment shader]
+in vec4 color;
+
+void main()
+{
+   gl_FragColor = color;
+}
+
+[vertex data]
+vertex/float/2
+-1.0 -1.0
+ 1.0 -1.0
+-1.0  1.0
+-1.0  1.0
+ 1.0 -1.0
+ 1.0  1.0
+
+[test]
+clear color 0.1 0.1 0.1 0.1
+clear
+patch parameter vertices 3
+draw arrays GL_PATCHES 0 6
+probe all rgba 0.0 1.0 0.0 1.0
diff --git 
a/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs.shader_test
 
b/tests/spec/arb_tessellation_shader/execution/vs-tcs-tes-tessinner-tessouter-inputs.shader_test

[Piglit] [PATCH 3/3] Make shader_runner atomic tests more robust against race conditions.

2015-10-21 Thread Kenneth Graunke
This is the same fix as the previous patch.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 tests/shaders/shader_runner.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 32ac7bd..a967e52 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -2575,6 +2575,7 @@ static bool
 probe_atomic_counter(GLint counter_num, const char *op, uint32_t value)
 {
 uint32_t *p;
+   uint32_t observed;
enum comparison cmp;
bool result;
 
@@ -2589,13 +2590,14 @@ probe_atomic_counter(GLint counter_num, const char *op, 
uint32_t value)
 return false;
 }
 
-   result = compare_uint(value, *p, cmp);
+   observed = *p;
+   result = compare_uint(value, observed, cmp);
 
if (!result) {
printf("Atomic counter %d test failed: Reference %s Observed\n",
   counter_num, comparison_string(cmp));
printf("  Reference: %u\n", value);
-   printf("  Observed:  %u\n", *p);
+   printf("  Observed:  %u\n", observed);
glUnmapBuffer(GL_ATOMIC_COUNTER_BUFFER);
return false;
 }
-- 
2.6.1

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


[Piglit] [PATCH 2/3] Make cs-ids-common test more robust against race conditions.

2015-10-21 Thread Kenneth Graunke
This is the same fix as the previous patch.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 tests/spec/arb_compute_shader/cs-ids-common.c | 16 +---
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/tests/spec/arb_compute_shader/cs-ids-common.c 
b/tests/spec/arb_compute_shader/cs-ids-common.c
index 4a0452d..80477fc 100644
--- a/tests/spec/arb_compute_shader/cs-ids-common.c
+++ b/tests/spec/arb_compute_shader/cs-ids-common.c
@@ -115,6 +115,7 @@ confirm_size()
uint32_t i, x, y, z;
uint32_t xs, ys, zs;
uint32_t hx, hy, hz;
+   bool pass = true;
 
xs = local_x;
ys = local_y;
@@ -172,26 +173,27 @@ confirm_size()
}
 
for (i = 0; i < NUM_ATOMIC_COUNTERS; i++) {
+   uint32_t found = p[i];
if (verbose)
printf("Atomic counter %d\n"
   "  Reference: %u\n"
   "  Observed:  %u\n"
   "  Result: %s\n",
-  i, values[i], p[i],
-  values[i] == p[i] ? "pass" : "fail");
-   if (values[i] != p[i]) {
+  i, values[i], found,
+  values[i] == found ? "pass" : "fail");
+   if (values[i] != found) {
printf("Atomic counter test %d failed for (%d, %d, 
%d)\n",
   i, xs, ys, zs);
printf("  Reference: %u\n", values[i]);
-   printf("  Observed:  %u\n", p[i]);
-   glUnmapBuffer(GL_ATOMIC_COUNTER_BUFFER);
-   return PIGLIT_FAIL;
+   printf("  Observed:  %u\n", found);
+   pass = false;
+   break;
}
}
 
glUnmapBuffer(GL_ATOMIC_COUNTER_BUFFER);
 
-   return PIGLIT_PASS;
+   return pass ? PIGLIT_PASS : PIGLIT_FAIL;
 }
 
 
-- 
2.6.1

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


[Piglit] [PATCH 1/3] Make atomic counter tests more robust against race conditions.

2015-10-21 Thread Kenneth Graunke
From: Chris Wilson <ch...@chris-wilson.co.uk>

Drivers with synchronization bugs could generate errors such as:

Probe value at (0)
  Expected: 0x0001
  Observed: 0x0001

This is because the initial comparison and the print statement access
the buffer at different times, leading to the following scenario.

1. Comparison reads wrong value from the buffer (test properly fails).
2. Right value finally lands in buffer.
3. Error message prints the current value...which is the not the value
   used by the comparison.  Instead, it's the expected value, so the
   message makes no sense.

[Ken imported this patch from Chris Wilson's Bugzilla comment linked
 below and wrote a commit message.]

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91298
Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>
---
 tests/spec/arb_shader_atomic_counters/common.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

Chris, I made you the author on this patch since it's your code.
It didn't look like a patch ever hit the mailing list, so I went
ahead and put one together...

diff --git a/tests/spec/arb_shader_atomic_counters/common.c 
b/tests/spec/arb_shader_atomic_counters/common.c
index b966009..c732699 100644
--- a/tests/spec/arb_shader_atomic_counters/common.c
+++ b/tests/spec/arb_shader_atomic_counters/common.c
@@ -35,6 +35,7 @@ atomic_counters_probe_buffer(unsigned base, unsigned count,
 uint32_t *p = glMapBufferRange(
 GL_ATOMIC_COUNTER_BUFFER, base * sizeof(uint32_t),
 count * sizeof(uint32_t), GL_MAP_READ_BIT);
+bool pass = true;
 unsigned i;
 
 if (!p) {
@@ -43,17 +44,18 @@ atomic_counters_probe_buffer(unsigned base, unsigned count,
 }
 
 for (i = 0; i < count; ++i) {
-if (p[i] != expected[i]) {
+uint32_t found = p[i];
+if (found != expected[i]) {
 printf("Probe value at (%i)\n", i);
 printf("  Expected: 0x%08x\n", expected[i]);
-printf("  Observed: 0x%08x\n", p[i]);
-glUnmapBuffer(GL_ATOMIC_COUNTER_BUFFER);
-return false;
+printf("  Observed: 0x%08x\n", found);
+pass = false;
+break;
 }
 }
 
 glUnmapBuffer(GL_ATOMIC_COUNTER_BUFFER);
-return true;
+return pass;
 }
 
 bool
-- 
2.6.1

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


[Piglit] [PATCH] Fix oglconform integration.

2015-10-20 Thread Kenneth Graunke
Everything reported 'fail' all the time because interpretResult()
wasn't updated amdist all the Piglit framework rewriting.
---
 tests/oglconform.py | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

This seems to get it working again, but honestly at this point I hardly
even recognize the codebase...

diff --git a/tests/oglconform.py b/tests/oglconform.py
index 4ec127e..cdae4d4 100644
--- a/tests/oglconform.py
+++ b/tests/oglconform.py
@@ -55,12 +55,12 @@ class OGLCTest(Test):
 '-test', category, subtest])
 
 def interpret_result(self):
-if self.skip_re.search(self.result['out']) is not None:
-self.result['result'] = 'skip'
-elif re.search('Total Passed : 1', self.result['out']) is not None:
-self.result['result'] = 'pass'
+if self.skip_re.search(self.result.out) is not None:
+self.result.result = 'skip'
+elif re.search('Total Passed : 1', self.result.out) is not None:
+self.result.result = 'pass'
 else:
-self.result['result'] = 'fail'
+self.result.result = 'fail'
 
 # Create a new top-level 'oglconform' category
 
-- 
2.6.1

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


Re: [Piglit] [PATCH] framework: add clinfo to system information

2015-10-05 Thread Kenneth Graunke
On Wednesday, September 30, 2015 12:05:36 PM Dylan Baker wrote:
> It's like glxinfo or wglinfo, but for cl.
> 
> cc: Serge Martin <edb+pig...@sigluy.net>
> Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 1/2] sso: Add a rendezvous_by_location-3-stages test.

2015-09-12 Thread Kenneth Graunke
Having more than two stages makes SSO interface matching a lot more
interesting.  However, the five-stage variant won't run on i965 for
a while.  So, this patch adds a three-stage variant (VS/GS/FS, but
no tessellation).

Beyond that, this test is a little meaner: I made the VS have more
outputs than the GS has inputs, with the locations specified to have a
gap.  An implementation that lays out VS outputs and GS inputs
contiguously would fail; they have to match up properly.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 .../arb_separate_shader_objects/CMakeLists.gl.txt  |   1 +
 .../rendezvous_by_location-3-stages.c  | 152 +
 2 files changed, 153 insertions(+)
 create mode 100644 
tests/spec/arb_separate_shader_objects/rendezvous_by_location-3-stages.c

diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt 
b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
index abd6b37..f7feb27 100644
--- a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
+++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
@@ -16,6 +16,7 @@ piglit_add_executable 
(arb_separate_shader_object-GetProgramPipelineiv GetProgra
 piglit_add_executable (arb_separate_shader_object-IsProgramPipeline 
IsProgramPipeline.c)
 piglit_add_executable (arb_separate_shader_object-ProgramUniform-coverage 
ProgramUniform-coverage.c)
 piglit_add_executable (arb_separate_shader_object-rendezvous_by_location 
rendezvous_by_location.c)
+piglit_add_executable 
(arb_separate_shader_object-rendezvous_by_location-3-stages 
rendezvous_by_location-3-stages.c)
 piglit_add_executable 
(arb_separate_shader_object-rendezvous_by_location-5-stages 
rendezvous_by_location-5-stages.c)
 piglit_add_executable 
(arb_separate_shader_object-UseProgramStages-non-separable 
UseProgramStages-non-separable.c)
 piglit_add_executable (arb_separate_shader_object-ValidateProgramPipeline 
ValidateProgramPipeline.c)
diff --git 
a/tests/spec/arb_separate_shader_objects/rendezvous_by_location-3-stages.c 
b/tests/spec/arb_separate_shader_objects/rendezvous_by_location-3-stages.c
new file mode 100644
index 000..b8192a6
--- /dev/null
+++ b/tests/spec/arb_separate_shader_objects/rendezvous_by_location-3-stages.c
@@ -0,0 +1,152 @@
+/*
+ * Copyright © 2013 Intel Corporation
+ * Copyright © 2015 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * This test uses 3 separate shaders (VS, GS, FS) and tests whether
+ * separate shader objects combined with tessellation and geometry shaders
+ * all work together.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 0;
+   config.supports_gl_core_version = 32;
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static GLuint pipeline;
+
+static const char *vs_code =
+   "#version 150\n"
+   "#extension GL_ARB_separate_shader_objects: require\n"
+   "#extension GL_ARB_explicit_attrib_location: require\n"
+   "\n"
+   "layout(location = 0) in vec4 piglit_vertex;\n"
+   "\n"
+   "layout(location = 2) out vec3 a;\n"
+   "layout(location = 4) out vec3 b;\n"
+   "layout(location = 3) out vec3 c;\n"
+   "\n"
+   "void main()\n"
+   "{\n"
+   "gl_Position = piglit_vertex;\n"
+   "a = vec3(0.5, 0, 0.3);\n"
+   "b = vec3(0.4, 0, 0.2);\n"
+   "c = vec3(0.3, 0, 0.1);\n"
+   "}\n"
+   ;
+
+static const char *gs_code =
+   "#version 150\n"
+   "#extension GL_ARB_separate_shader_objects: require\n"
+   "#extension GL_ARB_explici

[Piglit] [PATCH 2/2] sso: Add a test that passes data using the legacy gl_TexCoord varyings.

2015-09-12 Thread Kenneth Graunke
In compatiblity profiles, the GL_ARB_separate_shader_objects extension
allows passing data via built-in varyings such as gl_TexCoord[].  We
don't do compatibility profiles, but we do expose SSO in legacy GL
contexts and allow it with GLSL 1.30.

This test actually tries to do that in a rendering test.

This is particularly interesting because Mesa's VARYING_SLOT_* enums
handle built-in varyings different than generic ones.  I wanted to be
able to see how those came through; this provides a simple example.

Signed-off-by: Kenneth Graunke <kenn...@whitecape.org>
---
 .../arb_separate_shader_objects/CMakeLists.gl.txt  |   1 +
 .../arb_separate_shader_objects/compat-builtins.c  | 111 +
 2 files changed, 112 insertions(+)
 create mode 100644 tests/spec/arb_separate_shader_objects/compat-builtins.c

diff --git a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt 
b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
index f7feb27..b596f67 100644
--- a/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
+++ b/tests/spec/arb_separate_shader_objects/CMakeLists.gl.txt
@@ -12,6 +12,7 @@ link_libraries (
 piglit_add_executable (arb_separate_shader_object-400-combinations 
400-combinations.c)
 piglit_add_executable (arb_separate_shader_object-active-sampler-conflict 
active-sampler-conflict.c)
 piglit_add_executable 
(arb_separate_shader_object-ActiveShaderProgram-invalid-program 
ActiveShaderProgram-invalid-program.c)
+piglit_add_executable (arb_separate_shader_object-compat-builtins 
compat-builtins.c)
 piglit_add_executable (arb_separate_shader_object-GetProgramPipelineiv 
GetProgramPipelineiv.c)
 piglit_add_executable (arb_separate_shader_object-IsProgramPipeline 
IsProgramPipeline.c)
 piglit_add_executable (arb_separate_shader_object-ProgramUniform-coverage 
ProgramUniform-coverage.c)
diff --git a/tests/spec/arb_separate_shader_objects/compat-builtins.c 
b/tests/spec/arb_separate_shader_objects/compat-builtins.c
new file mode 100644
index 000..e84b746
--- /dev/null
+++ b/tests/spec/arb_separate_shader_objects/compat-builtins.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ * Copyright © 2015 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_compat_version = 30;
+   config.supports_gl_core_version = 0;
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static GLuint pipeline;
+
+static const char *vs_code =
+   "#version 130\n"
+   "#extension GL_ARB_separate_shader_objects: require\n"
+   "#extension GL_ARB_explicit_attrib_location: require\n"
+   "\n"
+   "out vec4 gl_TexCoord[2];\n"
+   "\n"
+   "void main()\n"
+   "{\n"
+   "gl_Position = gl_Vertex;\n"
+   "gl_TexCoord[0] = vec4(0.1, 0.2, 0.3, 0.4);\n"
+   "gl_TexCoord[1] = vec4(0.01, 0.02, 0.03, 0.04);\n"
+   "}\n"
+   ;
+
+static const char *fs_code =
+   "#version 130\n"
+   "#extension GL_ARB_separate_shader_objects: require\n"
+   "#extension GL_ARB_explicit_attrib_location: require\n"
+   "\n"
+   "in vec4 gl_TexCoord[2];\n"
+   "\n"
+   "void main()\n"
+   "{\n"
+   "gl_FragColor = gl_TexCoord[0] + gl_TexCoord[1];\n"
+   "}\n"
+   ;
+
+enum piglit_result
+piglit_display(void)
+{
+   static const float expected[] = {
+   0.11, 0.22, 0.33, 0.44
+   };
+   bool pass;
+
+   glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
+   glClear(GL_COLOR_BUFFER_BIT);
+
+   

Re: [Piglit] [PATCH 9/9] tests/all: add fbo-mrt-new-bind

2015-09-02 Thread Kenneth Graunke
On Wednesday, September 02, 2015 12:51:24 PM Dylan Baker wrote:
> This was never added to all.py
> 
> cc: Mike Stroyan <m...@lunarg.com>
> cc: Kenneth Graunke <kenn...@whitecape.org>
> Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> ---
>  tests/all.py | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/tests/all.py b/tests/all.py
> index ca72b65..5211ff8 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -3930,6 +3930,7 @@ with profile.group_manager(
>  grouptools.join('spec', 'arb_draw_buffers')) as g:
>  g(['arb_draw_buffers-state_change'], run_concurrent=False)
>  g(['fbo-mrt-alphatest'], run_concurrent=False)
> +g(['fbo-mrt-new-bind'], run_concurrent=False)
>  
>  with profile.group_manager(
>  PiglitGLTest,
> 

Reviewed-by: Kenneth Graunke <kenn...@whitecape.org>


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Move shaders/*swizzle-swizzle* to spec/glsl-1.10/execution.

2015-08-21 Thread Kenneth Graunke
Also drop the glsl- prefix as most tests in spec/glsl-1.10/execution
don't seem to have that.

Suggested by Timothy Arceri.
---
 .../glsl-vs-swizzle-swizzle-lhs-2.shader_test   | 21 -
 .../glsl-vs-swizzle-swizzle-lhs-3.shader_test   | 21 -
 .../shaders/glsl-vs-swizzle-swizzle-lhs.shader_test | 21 -
 .../shaders/glsl-vs-swizzle-swizzle-rhs.shader_test | 20 
 .../execution/vs-swizzle-swizzle-lhs-2.shader_test  | 21 +
 .../execution/vs-swizzle-swizzle-lhs-3.shader_test  | 21 +
 .../execution/vs-swizzle-swizzle-lhs.shader_test| 21 +
 .../execution/vs-swizzle-swizzle-rhs.shader_test| 20 
 8 files changed, 83 insertions(+), 83 deletions(-)
 delete mode 100644 tests/shaders/glsl-vs-swizzle-swizzle-lhs-2.shader_test
 delete mode 100644 tests/shaders/glsl-vs-swizzle-swizzle-lhs-3.shader_test
 delete mode 100644 tests/shaders/glsl-vs-swizzle-swizzle-lhs.shader_test
 delete mode 100644 tests/shaders/glsl-vs-swizzle-swizzle-rhs.shader_test
 create mode 100644 
tests/spec/glsl-1.10/execution/vs-swizzle-swizzle-lhs-2.shader_test
 create mode 100644 
tests/spec/glsl-1.10/execution/vs-swizzle-swizzle-lhs-3.shader_test
 create mode 100644 
tests/spec/glsl-1.10/execution/vs-swizzle-swizzle-lhs.shader_test
 create mode 100644 
tests/spec/glsl-1.10/execution/vs-swizzle-swizzle-rhs.shader_test

diff --git a/tests/shaders/glsl-vs-swizzle-swizzle-lhs-2.shader_test 
b/tests/shaders/glsl-vs-swizzle-swizzle-lhs-2.shader_test
deleted file mode 100644
index 98b682b..000
--- a/tests/shaders/glsl-vs-swizzle-swizzle-lhs-2.shader_test
+++ /dev/null
@@ -1,21 +0,0 @@
-[require]
-GLSL = 1.10
-
-[vertex shader]
-void main()
-{
-   vec4 color = vec4(0.1, 0.2, 0.3, 0.4);
-   color.xy.x = 1.0;
-   gl_FrontColor = color;
-   gl_Position = gl_Vertex;
-}
-
-[fragment shader]
-void main()
-{
-   gl_FragColor = gl_Color;
-}
-
-[test]
-draw rect -1 -1 2 2
-probe rgba 1 1 1.0 0.2 0.3 0.4
diff --git a/tests/shaders/glsl-vs-swizzle-swizzle-lhs-3.shader_test 
b/tests/shaders/glsl-vs-swizzle-swizzle-lhs-3.shader_test
deleted file mode 100644
index 3213c25..000
--- a/tests/shaders/glsl-vs-swizzle-swizzle-lhs-3.shader_test
+++ /dev/null
@@ -1,21 +0,0 @@
-[require]
-GLSL = 1.10
-
-[vertex shader]
-void main()
-{
-   vec4 color = vec4(0.1, 0.2, 0.3, 0.4);
-   color.wxz.yx.y = 1.0;
-   gl_FrontColor = color;
-   gl_Position = gl_Vertex;
-}
-
-[fragment shader]
-void main()
-{
-   gl_FragColor = gl_Color;
-}
-
-[test]
-draw rect -1 -1 2 2
-probe rgba 1 1 0.1 0.2 0.3 1.0
diff --git a/tests/shaders/glsl-vs-swizzle-swizzle-lhs.shader_test 
b/tests/shaders/glsl-vs-swizzle-swizzle-lhs.shader_test
deleted file mode 100644
index 64ac072..000
--- a/tests/shaders/glsl-vs-swizzle-swizzle-lhs.shader_test
+++ /dev/null
@@ -1,21 +0,0 @@
-[require]
-GLSL = 1.10
-
-[vertex shader]
-void main()
-{
-   vec4 color = vec4(0.0, 0.0, 0.0, 0.0);
-   color.xzy.z = 1.0;
-   gl_FrontColor = color;
-   gl_Position = gl_Vertex;
-}
-
-[fragment shader]
-void main()
-{
-   gl_FragColor = gl_Color;
-}
-
-[test]
-draw rect -1 -1 2 2
-probe rgb 1 1 0.0 1.0 0.0
diff --git a/tests/shaders/glsl-vs-swizzle-swizzle-rhs.shader_test 
b/tests/shaders/glsl-vs-swizzle-swizzle-rhs.shader_test
deleted file mode 100644
index 6931b81..000
--- a/tests/shaders/glsl-vs-swizzle-swizzle-rhs.shader_test
+++ /dev/null
@@ -1,20 +0,0 @@
-[require]
-GLSL = 1.10
-
-[vertex shader]
-void main()
-{
-   vec4 color = vec4(1.0, 0.0, 0.0, 0.0);
-   gl_FrontColor = color.yzx.xzxx;
-   gl_Position = gl_Vertex;
-}
-
-[fragment shader]
-void main()
-{
-   gl_FragColor = gl_Color;
-}
-
-[test]
-draw rect -1 -1 2 2
-probe rgb 1 1 0.0 1.0 0.0
diff --git 
a/tests/spec/glsl-1.10/execution/vs-swizzle-swizzle-lhs-2.shader_test 
b/tests/spec/glsl-1.10/execution/vs-swizzle-swizzle-lhs-2.shader_test
new file mode 100644
index 000..98b682b
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/vs-swizzle-swizzle-lhs-2.shader_test
@@ -0,0 +1,21 @@
+[require]
+GLSL = 1.10
+
+[vertex shader]
+void main()
+{
+   vec4 color = vec4(0.1, 0.2, 0.3, 0.4);
+   color.xy.x = 1.0;
+   gl_FrontColor = color;
+   gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+void main()
+{
+   gl_FragColor = gl_Color;
+}
+
+[test]
+draw rect -1 -1 2 2
+probe rgba 1 1 1.0 0.2 0.3 0.4
diff --git 
a/tests/spec/glsl-1.10/execution/vs-swizzle-swizzle-lhs-3.shader_test 
b/tests/spec/glsl-1.10/execution/vs-swizzle-swizzle-lhs-3.shader_test
new file mode 100644
index 000..3213c25
--- /dev/null
+++ b/tests/spec/glsl-1.10/execution/vs-swizzle-swizzle-lhs-3.shader_test
@@ -0,0 +1,21 @@
+[require]
+GLSL = 1.10
+
+[vertex shader]
+void main()
+{
+   vec4 color = vec4(0.1, 0.2, 0.3, 0.4);
+   color.wxz.yx.y = 1.0;
+   gl_FrontColor = color;
+   gl_Position = gl_Vertex;
+}
+

[Piglit] [PATCH] Add meaner swizzle-swizzle-lhs tests.

2015-07-22 Thread Kenneth Graunke
Mesa's compiler happened to handle .xzy.z correctly, while .xy.x and
other combinations were broken.  Try that and a triply-nested one.

Cc: i...@freedesktop.org
Signed-off-by: Kenneth Graunke kenn...@whitecape.org
---
 .../glsl-vs-swizzle-swizzle-lhs-2.shader_test   | 21 +
 .../glsl-vs-swizzle-swizzle-lhs-3.shader_test   | 21 +
 2 files changed, 42 insertions(+)
 create mode 100644 tests/shaders/glsl-vs-swizzle-swizzle-lhs-2.shader_test
 create mode 100644 tests/shaders/glsl-vs-swizzle-swizzle-lhs-3.shader_test

diff --git a/tests/shaders/glsl-vs-swizzle-swizzle-lhs-2.shader_test 
b/tests/shaders/glsl-vs-swizzle-swizzle-lhs-2.shader_test
new file mode 100644
index 000..98b682b
--- /dev/null
+++ b/tests/shaders/glsl-vs-swizzle-swizzle-lhs-2.shader_test
@@ -0,0 +1,21 @@
+[require]
+GLSL = 1.10
+
+[vertex shader]
+void main()
+{
+   vec4 color = vec4(0.1, 0.2, 0.3, 0.4);
+   color.xy.x = 1.0;
+   gl_FrontColor = color;
+   gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+void main()
+{
+   gl_FragColor = gl_Color;
+}
+
+[test]
+draw rect -1 -1 2 2
+probe rgba 1 1 1.0 0.2 0.3 0.4
diff --git a/tests/shaders/glsl-vs-swizzle-swizzle-lhs-3.shader_test 
b/tests/shaders/glsl-vs-swizzle-swizzle-lhs-3.shader_test
new file mode 100644
index 000..3213c25
--- /dev/null
+++ b/tests/shaders/glsl-vs-swizzle-swizzle-lhs-3.shader_test
@@ -0,0 +1,21 @@
+[require]
+GLSL = 1.10
+
+[vertex shader]
+void main()
+{
+   vec4 color = vec4(0.1, 0.2, 0.3, 0.4);
+   color.wxz.yx.y = 1.0;
+   gl_FrontColor = color;
+   gl_Position = gl_Vertex;
+}
+
+[fragment shader]
+void main()
+{
+   gl_FragColor = gl_Color;
+}
+
+[test]
+draw rect -1 -1 2 2
+probe rgba 1 1 0.1 0.2 0.3 1.0
-- 
2.4.6

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


Re: [Piglit] [PATCH 00/40] Replace vpfp-generic with shader_runner.

2015-06-18 Thread Kenneth Graunke
On Saturday, June 06, 2015 07:11:26 PM Kenneth Graunke wrote:
 Hi all,
 
 This patch series ports all vpfp-generic tests to shader_runner,
 and then deletes vpfp-generic.
 
 A bit of history:
 - vpfp-generic was introduced by Nicolai Hähnle in 2009, as a generic
   ARB_vertex|fragment_program test runner.
 - shader_runner was introduced by Ian Romanick in 2010, as a generic
   GLSL shader runner.
 - shader_runner gained ARB program support in 2011 (courtesy of Eric Anholt).
 
 At this point, vpfp-generic is fairly redundant - shader_runner can do
 everything we need, and is much more widespread (12000+ tests).  I've
 been meaning to delete it for a few years, but never got around to it.
 
 One difference is that the new tests don't glClear() before drawing.  Since
 they draw the entire window, it's pretty unnecessary, and just makes the
 tests harder to debug.  Many shader_runner tests don't bother clearing.


I've gone ahead and added the clears back in, based on everyone's
feedback.

The original tests actually inspected the expected color - if a
component was  0.5, it used 0.0 as the clear color; otherwise it used
0.0.  That ensured that the clear color was always different than the
expected value.  Which seems useful, and perhaps hard to replicate in
a completely generic mechanism in shader_runner.

The new shader_runner tests should be functionally equivalent to the
old ones.  I've gone ahead and pushed them since I don't think anybody
actually wants to review these boring changes.

Here is the updated python script that handles clears, too:

#! /usr/bin/python3
import re
import sys

template = '''{comments}[require]
GL = 1.3
ARB_vertex_program
ARB_fragment_program

[vertex program]
{vptext}

[fragment program]
{fptext}

[test]
ortho 0 1 0 1
{script}'''

def convert(infile):
with open(infile, 'r') as f:
vpfp = f.read()

vpfp = re.sub('^;', '#', vpfp, flags=re.MULTILINE)

doublebang = vpfp.find('!!')
comments = vpfp[0:doublebang]
vpfp = vpfp[doublebang:]

parse = 
re.match('(^!!ARBvp1.0$.*^END$)\s*(^!!ARBfp1.0$.*^END$)\s*!!test\n(.*)', vpfp, 
re.MULTILINE | re.DOTALL)
vptext, fptext, vpfp_test = parse.groups()

script = ''
for line in vpfp_test.splitlines():
line = ' '.join(line.split()) # collapse whitespace
if line == '' or line == '!!test':
continue

parse = re.match('^expected ([^\s]+) ([^\s]+) ([^\s]+) ([^\s]+)', line)
if parse is not None:
params = parse.groups()
clear_color = [0.0 if float(x)  0.5 else 1.0 for x in params]
script += 'clear color {} {} {} {}\nclear\n'.format(*clear_color)
script += 'draw rect 0 0 1 1\nprobe all rgba {} {} {} 
{}\n'.format(*params)
continue

parse = re.match('^(fragment|vertex).(local|environment)\[([0-9]+)\] 
([^\s]+) ([^\s]+) ([^\s]+) ([^\s]+)', line)
if parse is not None:
params = parse.groups()
script += 'parameter {}_{}p {} ({}, {}, {}, 
{})\n'.format(params[1].replace('environment', 'env'), params[0][0], 
*params[2:])
continue

parse = re.match('^texcoord\[([0-9]+)\] ([^\s]+) ([^\s]+) ([^\s]+) 
([^\s]+)', line)
if parse is not None:
script += 'texcoord {} ({}, {}, {}, {})\n'.format(*parse.groups())
continue

raise Exception(unknown line:  + line)

print(template.format(comments=comments, vptext=vptext, fptext=fptext, 
script=script))

if __name__ == '__main__':
convert(sys.argv[1])


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 00/40] Replace vpfp-generic with shader_runner.

2015-06-08 Thread Kenneth Graunke
On Monday, June 08, 2015 03:42:36 PM Dave Airlie wrote:
 On 8 June 2015 at 15:31, Kenneth Graunke kenn...@whitecape.org wrote:
  On Monday, June 08, 2015 06:29:26 AM Dave Airlie wrote:
  On 7 June 2015 at 12:11, Kenneth Graunke kenn...@whitecape.org wrote:
   Hi all,
  
   This patch series ports all vpfp-generic tests to shader_runner,
   and then deletes vpfp-generic.
  
   A bit of history:
   - vpfp-generic was introduced by Nicolai Hähnle in 2009, as a generic
 ARB_vertex|fragment_program test runner.
   - shader_runner was introduced by Ian Romanick in 2010, as a generic
 GLSL shader runner.
   - shader_runner gained ARB program support in 2011 (courtesy of Eric 
   Anholt).
  
   At this point, vpfp-generic is fairly redundant - shader_runner can do
   everything we need, and is much more widespread (12000+ tests).  I've
   been meaning to delete it for a few years, but never got around to it.
  
   One difference is that the new tests don't glClear() before drawing.  
   Since
   they draw the entire window, it's pretty unnecessary, and just makes the
   tests harder to debug.  Many shader_runner tests don't bother clearing.
 
  This is actually annoying feature, esp if all tests use the same color
  for success,
 
  because we render one test, it passes, we render another test, it
  doesn't draw anything
  but it has gotten the back buffer from the previous tests, and it
  magically passes.
 
  This happens a lot more often on GPUs with VRAM.
 
  Dave.
 
  I don't know...the tests probe the entire window...so the only failure
  mode that will bite you like that is the driver didn't render anything
  at all.  And the assumption is that, even with such a broken driver,
  clearing will actually succeed at drawing...
 
 Yes but what happens if all the tests run and don't bother clearing,
 so drawing fails in test 1, test 2 passes because it doesn't clear,
 and it gets test1 result frame, where it passed, It looks like
 test2 passes when it clearly hasn't.
 
 You've actually said it, clearing would succeed, but the problem
 is the tests don't clear.
 
 and yes there are many reasons things don't render, the main
 one I see if where an earlier test has locked up the GPU but
 not totally.
 
 Dave.

So your thinking is that Test 2 exercises some functionality (i.e.
complex geometry shaders) which hang the GPU, but the clear is simple,
so it's likely to succeed, and is done first?  I suppose that makes
some sense.

Still, if your GPU is locking up, then it seems like tracking that down
(and either fixing or blacklisting those tests) ought to be your top
priority.  Finding the tests that hang is pretty straightforward:

$ piglit run --dmesg -1 -v quick results/hangs

I always assume Piglit results are invalid (or dubious at best) if a run
has hung the GPU.

We should probably check dmesg at least once, even on a normal run, and
log a message indicating that there was a GPU hang.  It wouldn't tell
you which hung, but you'd know your results were suspect and to re-run
with --dmesg to pinpoint it...

At any rate, are you asking me to rework my patches to preserve the
existing color clear?  There are a lot of Piglit tests done both ways.

--Ken


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH 00/40] Replace vpfp-generic with shader_runner.

2015-06-07 Thread Kenneth Graunke
On Monday, June 08, 2015 06:29:26 AM Dave Airlie wrote:
 On 7 June 2015 at 12:11, Kenneth Graunke kenn...@whitecape.org wrote:
  Hi all,
 
  This patch series ports all vpfp-generic tests to shader_runner,
  and then deletes vpfp-generic.
 
  A bit of history:
  - vpfp-generic was introduced by Nicolai Hähnle in 2009, as a generic
ARB_vertex|fragment_program test runner.
  - shader_runner was introduced by Ian Romanick in 2010, as a generic
GLSL shader runner.
  - shader_runner gained ARB program support in 2011 (courtesy of Eric 
  Anholt).
 
  At this point, vpfp-generic is fairly redundant - shader_runner can do
  everything we need, and is much more widespread (12000+ tests).  I've
  been meaning to delete it for a few years, but never got around to it.
 
  One difference is that the new tests don't glClear() before drawing.  Since
  they draw the entire window, it's pretty unnecessary, and just makes the
  tests harder to debug.  Many shader_runner tests don't bother clearing.
 
 This is actually annoying feature, esp if all tests use the same color
 for success,
 
 because we render one test, it passes, we render another test, it
 doesn't draw anything
 but it has gotten the back buffer from the previous tests, and it
 magically passes.
 
 This happens a lot more often on GPUs with VRAM.
 
 Dave.

I don't know...the tests probe the entire window...so the only failure
mode that will bite you like that is the driver didn't render anything
at all.  And the assumption is that, even with such a broken driver,
clearing will actually succeed at drawing...

Is that really so common?  i965 will usually either draw something,
or fail so spectacularly that even clear doesn't work...


signature.asc
Description: This is a digitally signed message part.
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 16/40] Port fp-dst-aliasing-1.vpfp to shader_runner

2015-06-06 Thread Kenneth Graunke
This commit was autogenerated by Python and Bash scripting.
---
 tests/all.py   |  1 -
 tests/shaders/generic/fp-dst-aliasing-1.vpfp   | 16 --
 .../fp-dst-aliasing-1.shader_test  | 25 ++
 3 files changed, 25 insertions(+), 17 deletions(-)
 delete mode 100644 tests/shaders/generic/fp-dst-aliasing-1.vpfp
 create mode 100644 
tests/spec/arb_fragment_program/fp-dst-aliasing-1.shader_test

diff --git a/tests/all.py b/tests/all.py
index c96dfd2..7742d4a 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1903,7 +1903,6 @@ with profile.group_manager(
 g(['trinity-fp1'], run_concurrent=False)
 g(['arb_fragment_program-sparse-samplers'], 'sparse-samplers')
 g(['incomplete-texture', 'arb_fp'], 'incomplete-texture-arb_fp')
-add_vpfpgeneric(g, 'fp-dst-aliasing-1')
 add_vpfpgeneric(g, 'fp-dst-aliasing-2')
 add_vpfpgeneric(g, 'fp-ex2-sat')
 add_vpfpgeneric(g, 'fp-two-constants')
diff --git a/tests/shaders/generic/fp-dst-aliasing-1.vpfp 
b/tests/shaders/generic/fp-dst-aliasing-1.vpfp
deleted file mode 100644
index 38a901a..000
--- a/tests/shaders/generic/fp-dst-aliasing-1.vpfp
+++ /dev/null
@@ -1,16 +0,0 @@
-!!ARBvp1.0
-OPTION ARB_position_invariant;
-END
-
-!!ARBfp1.0
-TEMP temp;
-MOV temp, program.local[0];
-DST temp, temp.xyyw, program.local[1];
-MOV result.color, temp;
-END
-
-!!test
-fragment.local[0] 0.1 0.2 0.3 0.4
-fragment.local[1] 0.5 0.5 0.5 0.5
-expected  1.0 0.1 0.2 0.5
-
diff --git a/tests/spec/arb_fragment_program/fp-dst-aliasing-1.shader_test 
b/tests/spec/arb_fragment_program/fp-dst-aliasing-1.shader_test
new file mode 100644
index 000..d187c70
--- /dev/null
+++ b/tests/spec/arb_fragment_program/fp-dst-aliasing-1.shader_test
@@ -0,0 +1,25 @@
+[require]
+GL = 1.3
+ARB_vertex_program
+ARB_fragment_program
+
+[vertex program]
+!!ARBvp1.0
+OPTION ARB_position_invariant;
+END
+
+[fragment program]
+!!ARBfp1.0
+TEMP temp;
+MOV temp, program.local[0];
+DST temp, temp.xyyw, program.local[1];
+MOV result.color, temp;
+END
+
+[test]
+ortho 0 1 0 1
+parameter local_fp 0 (0.1, 0.2, 0.3, 0.4)
+parameter local_fp 1 (0.5, 0.5, 0.5, 0.5)
+draw rect 0 0 1 1
+probe all rgba  1.0 0.1 0.2 0.5
+
-- 
2.4.2

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


[Piglit] [PATCH 07/40] Port fdo30337a.vpfp to shader_runner

2015-06-06 Thread Kenneth Graunke
This commit was autogenerated by Python and Bash scripting.
---
 tests/all.py   |  1 -
 tests/shaders/generic/fdo30337a.vpfp   | 17 --
 .../arb_fragment_program/fdo30337a.shader_test | 27 ++
 3 files changed, 27 insertions(+), 18 deletions(-)
 delete mode 100644 tests/shaders/generic/fdo30337a.vpfp
 create mode 100644 tests/spec/arb_fragment_program/fdo30337a.shader_test

diff --git a/tests/all.py b/tests/all.py
index 3ad8c22..759d31e 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1903,7 +1903,6 @@ with profile.group_manager(
 g(['trinity-fp1'], run_concurrent=False)
 g(['arb_fragment_program-sparse-samplers'], 'sparse-samplers')
 g(['incomplete-texture', 'arb_fp'], 'incomplete-texture-arb_fp')
-add_vpfpgeneric(g, 'fdo30337a')
 add_vpfpgeneric(g, 'fdo30337b')
 add_vpfpgeneric(g, 'fdo38145')
 add_vpfpgeneric(g, 'fp-cmp')
diff --git a/tests/shaders/generic/fdo30337a.vpfp 
b/tests/shaders/generic/fdo30337a.vpfp
deleted file mode 100644
index 48b97d7..000
--- a/tests/shaders/generic/fdo30337a.vpfp
+++ /dev/null
@@ -1,17 +0,0 @@
-!!ARBvp1.0
-OPTION ARB_position_invariant;
-END
-
-!!ARBfp1.0
-#This tests instructions like: ADD Temp[0], Temp[0], Temp[1] where one of
-#the source registers is the same as the destination register.  These
-#should not be replaced with presubtract operations.
-TEMP color;
-MOV color, {0.1, 0.4, 0.8, 1.0};
-ADD color.x, color.x, color.x;
-ADD color.y, color.x, color.y;
-MOV result.color, color;
-END
-
-!!test
-expected  0.2 0.6  0.8  1.0
diff --git a/tests/spec/arb_fragment_program/fdo30337a.shader_test 
b/tests/spec/arb_fragment_program/fdo30337a.shader_test
new file mode 100644
index 000..49e9619
--- /dev/null
+++ b/tests/spec/arb_fragment_program/fdo30337a.shader_test
@@ -0,0 +1,27 @@
+[require]
+GL = 1.3
+ARB_vertex_program
+ARB_fragment_program
+
+[vertex program]
+!!ARBvp1.0
+OPTION ARB_position_invariant;
+END
+
+[fragment program]
+!!ARBfp1.0
+#This tests instructions like: ADD Temp[0], Temp[0], Temp[1] where one of
+#the source registers is the same as the destination register.  These
+#should not be replaced with presubtract operations.
+TEMP color;
+MOV color, {0.1, 0.4, 0.8, 1.0};
+ADD color.x, color.x, color.x;
+ADD color.y, color.x, color.y;
+MOV result.color, color;
+END
+
+[test]
+ortho 0 1 0 1
+draw rect 0 0 1 1
+probe all rgba  0.2 0.6 0.8 1.0
+
-- 
2.4.2

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


[Piglit] [PATCH 14/40] Port fp-arb-fragment-coord-conventions-none.vpfp to shader_runner

2015-06-06 Thread Kenneth Graunke
This commit was autogenerated by Python and Bash scripting.

Then, I manually squashed in a fix to all.py to delete the empty group,
to prevent syntax errors.
---
 tests/all.py   |  5 -
 .../fp-arb-fragment-coord-conventions-none.vpfp| 14 -
 ...arb-fragment-coord-conventions-none.shader_test | 24 ++
 3 files changed, 24 insertions(+), 19 deletions(-)
 delete mode 100644 
tests/shaders/generic/fp-arb-fragment-coord-conventions-none.vpfp
 create mode 100644 
tests/spec/arb_fragment_coord_conventions/fp-arb-fragment-coord-conventions-none.shader_test

diff --git a/tests/all.py b/tests/all.py
index 9ea476b..a4d6599 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1920,11 +1920,6 @@ with profile.group_manager(
 
 with profile.group_manager(
 PiglitGLTest,
-grouptools.join('spec', 'arb_fragment_coord_conventions')) as g:
-add_vpfpgeneric(g, 'fp-arb-fragment-coord-conventions-none')
-
-with profile.group_manager(
-PiglitGLTest,
 grouptools.join('spec', 'ATI_fragment_shader')) as g:
 g(['ati-fs-bad-delete'])
 
diff --git a/tests/shaders/generic/fp-arb-fragment-coord-conventions-none.vpfp 
b/tests/shaders/generic/fp-arb-fragment-coord-conventions-none.vpfp
deleted file mode 100644
index 3674a36..000
--- a/tests/shaders/generic/fp-arb-fragment-coord-conventions-none.vpfp
+++ /dev/null
@@ -1,14 +0,0 @@
-; Tests the pixel center choice in the absence of
-; ARB_fragment_coord_conventions use.
-
-!!ARBvp1.0
-OPTION ARB_position_invariant;
-END
-
-!!ARBfp1.0
-MOV result.color, {0.0, 0.0, 0.0, 0.0};
-FRC result.color.xy, fragment.position;
-END
-
-!!test
-expected  0.5 0.5  0.0  0.0
diff --git 
a/tests/spec/arb_fragment_coord_conventions/fp-arb-fragment-coord-conventions-none.shader_test
 
b/tests/spec/arb_fragment_coord_conventions/fp-arb-fragment-coord-conventions-none.shader_test
new file mode 100644
index 000..7023ae9
--- /dev/null
+++ 
b/tests/spec/arb_fragment_coord_conventions/fp-arb-fragment-coord-conventions-none.shader_test
@@ -0,0 +1,24 @@
+# Tests the pixel center choice in the absence of
+# ARB_fragment_coord_conventions use.
+
+[require]
+GL = 1.3
+ARB_vertex_program
+ARB_fragment_program
+
+[vertex program]
+!!ARBvp1.0
+OPTION ARB_position_invariant;
+END
+
+[fragment program]
+!!ARBfp1.0
+MOV result.color, {0.0, 0.0, 0.0, 0.0};
+FRC result.color.xy, fragment.position;
+END
+
+[test]
+ortho 0 1 0 1
+draw rect 0 0 1 1
+probe all rgba  0.5 0.5 0.0 0.0
+
-- 
2.4.2

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


[Piglit] [PATCH 32/40] Port vp-constant-array-huge.vpfp to shader_runner

2015-06-06 Thread Kenneth Graunke
This commit was autogenerated by Python and Bash scripting.
---
 tests/all.py   |   1 -
 tests/shaders/generic/vp-constant-array-huge.vpfp  | 138 ---
 .../vp-constant-array-huge.shader_test | 147 +
 3 files changed, 147 insertions(+), 139 deletions(-)
 delete mode 100644 tests/shaders/generic/vp-constant-array-huge.vpfp
 create mode 100644 
tests/spec/arb_vertex_program/vp-constant-array-huge.shader_test

diff --git a/tests/all.py b/tests/all.py
index 3145317..a0f7add 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2593,7 +2593,6 @@ with profile.group_manager(
 g(['vp-bad-program'], run_concurrent=False)
 g(['vp-max-array'], run_concurrent=False)
 add_vpfpgeneric(g, 'vp-constant-array')
-add_vpfpgeneric(g, 'vp-constant-array-huge')
 add_vpfpgeneric(g, 'vp-constant-negate')
 add_vpfpgeneric(g, 'vp-exp-alias')
 add_vpfpgeneric(g, 'vp-max')
diff --git a/tests/shaders/generic/vp-constant-array-huge.vpfp 
b/tests/shaders/generic/vp-constant-array-huge.vpfp
deleted file mode 100644
index a838c2b..000
--- a/tests/shaders/generic/vp-constant-array-huge.vpfp
+++ /dev/null
@@ -1,138 +0,0 @@
-; Tests loading of an entry in a large constant array.  Caught failure in the
-; 965 driver where only the first entry of the constant array was necessarily
-; correct, and the state containing the transformation matrix wasn't set up.
-
-!!ARBvp1.0
-OPTION ARB_position_invariant;
-PARAM vals[] = {
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   {0.8, 1.0, 0.0, 0.0},
-   {0.5, 1.0, 2.0, 0.0},
-   {1.0, 0.0, 0.8, 0.0},
-   {1.0, 0.0, 0.5, 0.0},
-   

[Piglit] [PATCH 10/40] Port fogcoord-dp3.vpfp to shader_runner

2015-06-06 Thread Kenneth Graunke
This commit was autogenerated by Python and Bash scripting.
---
 tests/all.py   |  1 -
 tests/shaders/generic/fogcoord-dp3.vpfp| 17 --
 .../arb_vertex_program/fogcoord-dp3.shader_test| 27 ++
 3 files changed, 27 insertions(+), 18 deletions(-)
 delete mode 100644 tests/shaders/generic/fogcoord-dp3.vpfp
 create mode 100644 tests/spec/arb_vertex_program/fogcoord-dp3.shader_test

diff --git a/tests/all.py b/tests/all.py
index 6366daa..37475b1 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2603,7 +2603,6 @@ with profile.group_manager(
 g(['vp-address-04'], run_concurrent=False)
 g(['vp-bad-program'], run_concurrent=False)
 g(['vp-max-array'], run_concurrent=False)
-add_vpfpgeneric(g, 'fogcoord-dp3')
 add_vpfpgeneric(g, 'fogcoord-dph')
 add_vpfpgeneric(g, 'fogcoord-dp4')
 add_vpfpgeneric(g, 'vp-arl-constant-array')
diff --git a/tests/shaders/generic/fogcoord-dp3.vpfp 
b/tests/shaders/generic/fogcoord-dp3.vpfp
deleted file mode 100644
index 824ee2a..000
--- a/tests/shaders/generic/fogcoord-dp3.vpfp
+++ /dev/null
@@ -1,17 +0,0 @@
-; Tests whether the special fogcoord varying is treated correctly in
-; the face of an instruction that has no straight-forward mapping of
-; input components to output components.
-
-!!ARBvp1.0
-OPTION ARB_position_invariant;
-DP3 result.fogcoord, vertex.texcoord[0], vertex.texcoord[1];
-END
-
-!!ARBfp1.0
-MOV result.color, fragment.fogcoord;
-END
-
-!!test
-texcoord[0] 0.4 -0.3 0.1 0.5
-texcoord[1] -1 1 8 1
-expected 0.1 0 0 1
diff --git a/tests/spec/arb_vertex_program/fogcoord-dp3.shader_test 
b/tests/spec/arb_vertex_program/fogcoord-dp3.shader_test
new file mode 100644
index 000..c2906e9
--- /dev/null
+++ b/tests/spec/arb_vertex_program/fogcoord-dp3.shader_test
@@ -0,0 +1,27 @@
+# Tests whether the special fogcoord varying is treated correctly in
+# the face of an instruction that has no straight-forward mapping of
+# input components to output components.
+
+[require]
+GL = 1.3
+ARB_vertex_program
+ARB_fragment_program
+
+[vertex program]
+!!ARBvp1.0
+OPTION ARB_position_invariant;
+DP3 result.fogcoord, vertex.texcoord[0], vertex.texcoord[1];
+END
+
+[fragment program]
+!!ARBfp1.0
+MOV result.color, fragment.fogcoord;
+END
+
+[test]
+ortho 0 1 0 1
+texcoord 0 (0.4, -0.3, 0.1, 0.5)
+texcoord 1 (-1, 1, 8, 1)
+draw rect 0 0 1 1
+probe all rgba  0.1 0 0 1
+
-- 
2.4.2

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


[Piglit] [PATCH 38/40] Port vp-sge-alias.vpfp to shader_runner

2015-06-06 Thread Kenneth Graunke
This commit was autogenerated by Python and Bash scripting.
---
 tests/all.py   |  1 -
 tests/shaders/generic/vp-sge-alias.vpfp| 18 ---
 .../arb_vertex_program/vp-sge-alias.shader_test| 27 ++
 3 files changed, 27 insertions(+), 19 deletions(-)
 delete mode 100644 tests/shaders/generic/vp-sge-alias.vpfp
 create mode 100644 tests/spec/arb_vertex_program/vp-sge-alias.shader_test

diff --git a/tests/all.py b/tests/all.py
index ef462ad..6072563 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2592,7 +2592,6 @@ with profile.group_manager(
 g(['vp-address-04'], run_concurrent=False)
 g(['vp-bad-program'], run_concurrent=False)
 g(['vp-max-array'], run_concurrent=False)
-add_vpfpgeneric(g, 'vp-sge-alias')
 add_vpfpgeneric(g, 'vp-two-constants')
 
 with profile.group_manager(
diff --git a/tests/shaders/generic/vp-sge-alias.vpfp 
b/tests/shaders/generic/vp-sge-alias.vpfp
deleted file mode 100644
index 38e9994..000
--- a/tests/shaders/generic/vp-sge-alias.vpfp
+++ /dev/null
@@ -1,18 +0,0 @@
-; Detects whether or not the implementation correctly handles aliasing
-; of src/dest registers of SGE.  This caught a bug in the 965 driver.
-
-!!ARBvp1.0
-OPTION ARB_position_invariant;
-TEMP temp;
-MOV temp, {3, 0, 1, 0};
-SGE temp, temp, {2, 1, 0, -1};
-MOV result.color, temp;
-END
-
-!!ARBfp1.0
-MOV result.color, fragment.color;
-END
-
-!!test
-expected  1 0  1  1
-
diff --git a/tests/spec/arb_vertex_program/vp-sge-alias.shader_test 
b/tests/spec/arb_vertex_program/vp-sge-alias.shader_test
new file mode 100644
index 000..d97236c
--- /dev/null
+++ b/tests/spec/arb_vertex_program/vp-sge-alias.shader_test
@@ -0,0 +1,27 @@
+# Detects whether or not the implementation correctly handles aliasing
+# of src/dest registers of SGE.  This caught a bug in the 965 driver.
+
+[require]
+GL = 1.3
+ARB_vertex_program
+ARB_fragment_program
+
+[vertex program]
+!!ARBvp1.0
+OPTION ARB_position_invariant;
+TEMP temp;
+MOV temp, {3, 0, 1, 0};
+SGE temp, temp, {2, 1, 0, -1};
+MOV result.color, temp;
+END
+
+[fragment program]
+!!ARBfp1.0
+MOV result.color, fragment.color;
+END
+
+[test]
+ortho 0 1 0 1
+draw rect 0 0 1 1
+probe all rgba  1 0 1 1
+
-- 
2.4.2

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


[Piglit] [PATCH 19/40] Port fp-two-constants.vpfp to shader_runner

2015-06-06 Thread Kenneth Graunke
This commit was autogenerated by Python and Bash scripting.
---
 tests/all.py   |  1 -
 tests/shaders/generic/fp-two-constants.vpfp| 17 --
 .../fp-two-constants.shader_test   | 26 ++
 3 files changed, 26 insertions(+), 18 deletions(-)
 delete mode 100644 tests/shaders/generic/fp-two-constants.vpfp
 create mode 100644 tests/spec/arb_fragment_program/fp-two-constants.shader_test

diff --git a/tests/all.py b/tests/all.py
index 6c06325..9a8865e 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -1903,7 +1903,6 @@ with profile.group_manager(
 g(['trinity-fp1'], run_concurrent=False)
 g(['arb_fragment_program-sparse-samplers'], 'sparse-samplers')
 g(['incomplete-texture', 'arb_fp'], 'incomplete-texture-arb_fp')
-add_vpfpgeneric(g, 'fp-two-constants')
 
 with profile.group_manager(
 PiglitGLTest,
diff --git a/tests/shaders/generic/fp-two-constants.vpfp 
b/tests/shaders/generic/fp-two-constants.vpfp
deleted file mode 100644
index 2305bad..000
--- a/tests/shaders/generic/fp-two-constants.vpfp
+++ /dev/null
@@ -1,17 +0,0 @@
-; Detects whether or not the implementation correctly handles having two
-; constants in the same operand.
-;
-; This is a potential issue with gen4, and is something we should probably
-; make the optimizer handle.
-
-!!ARBvp1.0
-OPTION ARB_position_invariant;
-END
-
-!!ARBfp1.0
-ADD result.color, {1, 0, .25, 0}, {0.5, 0, 1, 0};
-END
-
-!!test
-expected  1.0 0.0  1.0  0.0
-
diff --git a/tests/spec/arb_fragment_program/fp-two-constants.shader_test 
b/tests/spec/arb_fragment_program/fp-two-constants.shader_test
new file mode 100644
index 000..b70f7db
--- /dev/null
+++ b/tests/spec/arb_fragment_program/fp-two-constants.shader_test
@@ -0,0 +1,26 @@
+# Detects whether or not the implementation correctly handles having two
+# constants in the same operand.
+#
+# This is a potential issue with gen4, and is something we should probably
+# make the optimizer handle.
+
+[require]
+GL = 1.3
+ARB_vertex_program
+ARB_fragment_program
+
+[vertex program]
+!!ARBvp1.0
+OPTION ARB_position_invariant;
+END
+
+[fragment program]
+!!ARBfp1.0
+ADD result.color, {1, 0, .25, 0}, {0.5, 0, 1, 0};
+END
+
+[test]
+ortho 0 1 0 1
+draw rect 0 0 1 1
+probe all rgba  1.0 0.0 1.0 0.0
+
-- 
2.4.2

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


  1   2   3   4   >