[Piglit] Fix bugs in recent summary changes

2015-09-23 Thread Dylan Baker
This series fixes 3 bugs in the recent summary changes. There is a
fourth bug reported by Ilia regrading skip in regressions, which I have
confirmed and am investigating. However, I have these 3 patches done,
which fix problems, and I thought I would send them out sooner rather
than later.

Patch 1: Fixes a unit test. It served it's purpose as-is, but this
 changes makes the test better
Patch 2: Fixes odd results in tests with subtests
Patch 3: Fixes html summaries that compare two results with differing
 subtests
Patch 4: Fixes a bug which leaves command out of the json results.

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


[Piglit] [PATCH 4/4] framework/results.py: write command to json

2015-09-23 Thread Dylan Baker
This was an oversight, it should have always been written to the json,
but was missed in the to_json method.

cc: Dave Airlie 
Signed-off-by: Dylan Baker 
---

sorry about that Dave, this should correct the problem you're seeing.

 framework/results.py | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/framework/results.py b/framework/results.py
index d358cca..c5f90e8 100644
--- a/framework/results.py
+++ b/framework/results.py
@@ -147,13 +147,14 @@ class TestResult(object):
 """Return the TestResult as a json serializable object."""
 obj = {
 '__type__': 'TestResult',
-'returncode': self.returncode,
+'command': self.command,
+'environment': self.environment,
 'err': self.err,
 'out': self.out,
-'time': self.time,
-'environment': self.environment,
-'subtests': self.subtests,
 'result': self.result,
+'returncode': self.returncode,
+'subtests': self.subtests,
+'time': self.time,
 }
 return obj
 
-- 
2.5.3

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


[Piglit] [PATCH 3/4] templates/index.mako: handle missing subtests correctly

2015-09-23 Thread Dylan Baker
This patch fixes the handling of subtests when more than one result is
presented. Currently this will raise a KeyError and die horribly.

cc: Ilia Mirkin 
Signed-off-by: Dylan Baker 
---

Ilia, this seems to have fixed the problem, can you confirm that this
does fix the problem for you appropriately?

 templates/index.mako | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/templates/index.mako b/templates/index.mako
index 6efcd41..d2b84b5 100644
--- a/templates/index.mako
+++ b/templates/index.mako
@@ -161,8 +161,9 @@
escape_filename(test)))
 else:
   raw = res.tests.get(grouptools.groupname(test))
-  if raw is not None:
-result = raw.subtests[grouptools.testname(test)]
+  name = grouptools.testname(test)
+  if raw is not None and name in raw.subtests:
+result = raw.subtests[name]
 href = normalize_href(posixpath.join(escape_pathname(res.name),
  
escape_filename(grouptools.groupname(test
   else:
-- 
2.5.3

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


[Piglit] [PATCH 1/4] framework/tests/results_tests.py: fix copy and paste error in test

2015-09-23 Thread Dylan Baker
Signed-off-by: Dylan Baker 
---
 framework/tests/results_tests.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/framework/tests/results_tests.py b/framework/tests/results_tests.py
index c7baa4c..ab5f0d3 100644
--- a/framework/tests/results_tests.py
+++ b/framework/tests/results_tests.py
@@ -159,8 +159,8 @@ def test_TestResult_result_getter_subtests():
 """results.TestResult.result: Getter returns worst subtest when subtests 
are present"""
 test = results.TestResult('pass')
 test.subtests['a'] = 'fail'
-test.subtests['a'] = 'crash'
-test.subtests['a'] = 'incomplete'
+test.subtests['b'] = 'crash'
+test.subtests['c'] = 'incomplete'
 nt.eq_(test.result, 'incomplete')
 
 
-- 
2.5.3

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


[Piglit] [PATCH 2/4] framework/results.py: Fix Subtests class

2015-09-23 Thread Dylan Baker
Sub-classing built-in types in python is an error-prone leap, and many
corner cases came out to bit us in this instance. By wrapping a dict
inside of another class we can get the desired results, it means more
code, but it also means less corner cases.

Also change the equality test of two unit tests, since Subtests isn't a
dictionary anymore assert_dict_equal wont work anymore.

cc: Mark Janes 
Signed-off-by: Dylan Baker 
---

Mark, this appears to clear up most of our jenkins changes from my
series.

 framework/results.py | 32 +++-
 framework/tests/piglit_test_tests.py |  3 +--
 framework/tests/results_tests.py |  2 +-
 3 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/framework/results.py b/framework/results.py
index 61841b7..d358cca 100644
--- a/framework/results.py
+++ b/framework/results.py
@@ -34,9 +34,31 @@ __all__ = [
 ]
 
 
-class Subtests(dict):
+class Subtests(collections.MutableMapping):
+"""A dict-like object that stores Statuses as values."""
+def __init__(self, dict_=None):
+self.__container = {}
+
+if dict_ is not None:
+self.update(dict_)
+
 def __setitem__(self, name, value):
-super(Subtests, self).__setitem__(name, status.status_lookup(value))
+self.__container[name] = status.status_lookup(value)
+
+def __getitem__(self, name):
+return self.__container[name]
+
+def __delitem__(self, name):
+del self.__container[name]
+
+def __iter__(self):
+return iter(self.__container)
+
+def __len__(self):
+return len(self.__container)
+
+def __repr__(self):
+return repr(self.__container)
 
 def to_json(self):
 res = dict(self)
@@ -45,10 +67,10 @@ class Subtests(dict):
 
 @classmethod
 def from_dict(cls, dict_):
-res = cls(dict_)
+if '__type__' in dict_:
+del dict_['__type__']
 
-if '__type__' in res:
-del res['__type__']
+res = cls(dict_)
 
 return res
 
diff --git a/framework/tests/piglit_test_tests.py 
b/framework/tests/piglit_test_tests.py
index db4c8b0..c7c4c8f 100644
--- a/framework/tests/piglit_test_tests.py
+++ b/framework/tests/piglit_test_tests.py
@@ -72,8 +72,7 @@ def test_piglitest_no_clobber():
 test.result.returncode = 0
 test.interpret_result()
 
-nt.assert_dict_equal(test.result.subtests,
- {'test1': 'pass', 'test2': 'pass'})
+nt.eq_(test.result.subtests, {'test1': 'pass', 'test2': 'pass'})
 
 
 def test_piglittest_command_getter_serial():
diff --git a/framework/tests/results_tests.py b/framework/tests/results_tests.py
index ab5f0d3..a28d78b 100644
--- a/framework/tests/results_tests.py
+++ b/framework/tests/results_tests.py
@@ -68,7 +68,7 @@ def test_Subtests_to_json():
 test['foo'] = status.PASS
 test['bar'] = status.CRASH
 
-nt.assert_dict_equal(baseline, test.to_json())
+nt.eq_(baseline, test.to_json())
 
 
 def test_Subtests_from_dict():
-- 
2.5.3

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


Re: [Piglit] [PATCH] all.py: s/occlusion_query_conformance/occlusion_query_conform/

2015-09-23 Thread Ilia Mirkin
On Wed, Sep 23, 2015 at 7:17 PM, Brian Paul  wrote:
> Missed this change when committing "Port arb occlusion query
> conformance tests from Glean to Piglit".
> ---
>  tests/all.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tests/all.py b/tests/all.py
> index 08edebb..02d8c0b 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -2121,7 +2121,7 @@ with profile.group_manager(
>  PiglitGLTest,
>  grouptools.join('spec', 'ARB_occlusion_query')) as g:
>  g(['occlusion_query'])
> -g(['occlusion_query_conformance'])
> +g(['occlusion_query_conform'])
>  g(['occlusion_query_lifetime'])
>  g(['occlusion_query_meta_fragments'])
>  g(['occlusion_query_meta_no_fragments'])

Reviewed-by: Ilia Mirkin 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] all.py: s/occlusion_query_conformance/occlusion_query_conform/

2015-09-23 Thread Brian Paul
Missed this change when committing "Port arb occlusion query
conformance tests from Glean to Piglit".
---
 tests/all.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/all.py b/tests/all.py
index 08edebb..02d8c0b 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -2121,7 +2121,7 @@ with profile.group_manager(
 PiglitGLTest,
 grouptools.join('spec', 'ARB_occlusion_query')) as g:
 g(['occlusion_query'])
-g(['occlusion_query_conformance'])
+g(['occlusion_query_conform'])
 g(['occlusion_query_lifetime'])
 g(['occlusion_query_meta_fragments'])
 g(['occlusion_query_meta_no_fragments'])
-- 
1.9.1

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


Re: [Piglit] [PATCH v7] Port arb occlusion query conformance tests from Glean to Piglit

2015-09-23 Thread Ilia Mirkin
On Thu, Sep 17, 2015 at 8:33 PM, Juliet Fru  wrote:
> This test replaces the original glean toccluqry.cpp test.
> ---
>  tests/all.py   |   1 +
>  tests/spec/arb_occlusion_query/CMakeLists.gl.txt   |   1 +
>  .../arb_occlusion_query/occlusion_query_conform.c  | 556 
> +
>  3 files changed, 558 insertions(+)
>  create mode 100644 tests/spec/arb_occlusion_query/occlusion_query_conform.c
>
> diff --git a/tests/all.py b/tests/all.py
> index fe088f5..748165f 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -2115,6 +2115,7 @@ with profile.group_manager(
>  PiglitGLTest,
>  grouptools.join('spec', 'ARB_occlusion_query')) as g:
>  g(['occlusion_query'])
> +g(['occlusion_query_conformance'])
>  g(['occlusion_query_lifetime'])
>  g(['occlusion_query_meta_fragments'])
>  g(['occlusion_query_meta_no_fragments'])
> diff --git a/tests/spec/arb_occlusion_query/CMakeLists.gl.txt 
> b/tests/spec/arb_occlusion_query/CMakeLists.gl.txt
> index 01a499d..025c2cd 100644
> --- a/tests/spec/arb_occlusion_query/CMakeLists.gl.txt
> +++ b/tests/spec/arb_occlusion_query/CMakeLists.gl.txt
> @@ -10,6 +10,7 @@ link_libraries (
>  )
>
>  piglit_add_executable (occlusion_query occlusion_query.c)
> +piglit_add_executable (occlusion_query_conform occlusion_query_conform.c)
>  piglit_add_executable (occlusion_query_lifetime occlusion_query_lifetime.c)
>  piglit_add_executable (occlusion_query_meta_no_fragments 
> occlusion_query_meta_no_fragments.c)
>  piglit_add_executable (occlusion_query_meta_fragments 
> occlusion_query_meta_fragments.c)

Oops? Looks like Brian pushed this... The names of the binary built
and test run don't match up :(
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH v2 1/2] shader_runner: make active_uniforms's all_types variable be global

2015-09-23 Thread Ian Romanick
Series is

Reviewed-by: Ian Romanick 

On 09/23/2015 02:28 AM, Samuel Iglesias Gonsalvez wrote:
> Signed-off-by: Samuel Iglesias Gonsalvez 
> ---
>  tests/shaders/shader_runner.c | 156 
> +-
>  1 file changed, 78 insertions(+), 78 deletions(-)
> 
> diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
> index 0614c7f..7a647a1 100644
> --- a/tests/shaders/shader_runner.c
> +++ b/tests/shaders/shader_runner.c
> @@ -158,6 +158,84 @@ enum comparison {
>   less_equal
>  };
>  
> +static const struct string_to_enum all_types[] = {
> + ENUM_STRING(GL_FLOAT),
> + ENUM_STRING(GL_FLOAT_VEC2),
> + ENUM_STRING(GL_FLOAT_VEC3),
> + ENUM_STRING(GL_FLOAT_VEC4),
> + ENUM_STRING(GL_DOUBLE),
> + ENUM_STRING(GL_DOUBLE_VEC2),
> + ENUM_STRING(GL_DOUBLE_VEC3),
> + ENUM_STRING(GL_DOUBLE_VEC4),
> + ENUM_STRING(GL_INT),
> + ENUM_STRING(GL_INT_VEC2),
> + ENUM_STRING(GL_INT_VEC3),
> + ENUM_STRING(GL_INT_VEC4),
> + ENUM_STRING(GL_UNSIGNED_INT),
> + ENUM_STRING(GL_UNSIGNED_INT_VEC2),
> + ENUM_STRING(GL_UNSIGNED_INT_VEC3),
> + ENUM_STRING(GL_UNSIGNED_INT_VEC4),
> + ENUM_STRING(GL_BOOL),
> + ENUM_STRING(GL_BOOL_VEC2),
> + ENUM_STRING(GL_BOOL_VEC3),
> + ENUM_STRING(GL_BOOL_VEC4),
> + ENUM_STRING(GL_FLOAT_MAT2),
> + ENUM_STRING(GL_FLOAT_MAT3),
> + ENUM_STRING(GL_FLOAT_MAT4),
> + ENUM_STRING(GL_FLOAT_MAT2x3),
> + ENUM_STRING(GL_FLOAT_MAT2x4),
> + ENUM_STRING(GL_FLOAT_MAT3x2),
> + ENUM_STRING(GL_FLOAT_MAT3x4),
> + ENUM_STRING(GL_FLOAT_MAT4x2),
> + ENUM_STRING(GL_FLOAT_MAT4x3),
> + ENUM_STRING(GL_DOUBLE_MAT2),
> + ENUM_STRING(GL_DOUBLE_MAT3),
> + ENUM_STRING(GL_DOUBLE_MAT4),
> + ENUM_STRING(GL_DOUBLE_MAT2x3),
> + ENUM_STRING(GL_DOUBLE_MAT2x4),
> + ENUM_STRING(GL_DOUBLE_MAT3x2),
> + ENUM_STRING(GL_DOUBLE_MAT3x4),
> + ENUM_STRING(GL_DOUBLE_MAT4x2),
> + ENUM_STRING(GL_DOUBLE_MAT4x3),
> + ENUM_STRING(GL_SAMPLER_1D),
> + ENUM_STRING(GL_SAMPLER_2D),
> + ENUM_STRING(GL_SAMPLER_3D),
> + ENUM_STRING(GL_SAMPLER_CUBE),
> + ENUM_STRING(GL_SAMPLER_1D_SHADOW),
> + ENUM_STRING(GL_SAMPLER_2D_SHADOW),
> + ENUM_STRING(GL_SAMPLER_1D_ARRAY),
> + ENUM_STRING(GL_SAMPLER_2D_ARRAY),
> + ENUM_STRING(GL_SAMPLER_1D_ARRAY_SHADOW),
> + ENUM_STRING(GL_SAMPLER_2D_ARRAY_SHADOW),
> + ENUM_STRING(GL_SAMPLER_2D_MULTISAMPLE),
> + ENUM_STRING(GL_SAMPLER_2D_MULTISAMPLE_ARRAY),
> + ENUM_STRING(GL_SAMPLER_CUBE_SHADOW),
> + ENUM_STRING(GL_SAMPLER_BUFFER),
> + ENUM_STRING(GL_SAMPLER_2D_RECT),
> + ENUM_STRING(GL_SAMPLER_2D_RECT_SHADOW),
> + ENUM_STRING(GL_INT_SAMPLER_1D),
> + ENUM_STRING(GL_INT_SAMPLER_2D),
> + ENUM_STRING(GL_INT_SAMPLER_3D),
> + ENUM_STRING(GL_INT_SAMPLER_CUBE),
> + ENUM_STRING(GL_INT_SAMPLER_1D_ARRAY),
> + ENUM_STRING(GL_INT_SAMPLER_2D_ARRAY),
> + ENUM_STRING(GL_INT_SAMPLER_2D_MULTISAMPLE),
> + ENUM_STRING(GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY),
> + ENUM_STRING(GL_INT_SAMPLER_BUFFER),
> + ENUM_STRING(GL_INT_SAMPLER_2D_RECT),
> + ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_1D),
> + ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_2D),
> + ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_3D),
> + ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_CUBE),
> + ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_1D_ARRAY),
> + ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_2D_ARRAY),
> + ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE),
> + ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY),
> + ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_BUFFER),
> + ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_2D_RECT),
> + { NULL, 0 }
> +};
> +
>  GLenum
>  lookup_enum_string(const struct string_to_enum *table, const char **line,
>  const char *error_desc)
> @@ -1860,84 +1938,6 @@ active_uniform(const char *line)
>   { NULL, 0 }
>   };
>  
> - static const struct string_to_enum all_types[] = {
> - ENUM_STRING(GL_FLOAT),
> - ENUM_STRING(GL_FLOAT_VEC2),
> - ENUM_STRING(GL_FLOAT_VEC3),
> - ENUM_STRING(GL_FLOAT_VEC4),
> - ENUM_STRING(GL_DOUBLE),
> - ENUM_STRING(GL_DOUBLE_VEC2),
> - ENUM_STRING(GL_DOUBLE_VEC3),
> - ENUM_STRING(GL_DOUBLE_VEC4),
> - ENUM_STRING(GL_INT),
> - ENUM_STRING(GL_INT_VEC2),
> - ENUM_STRING(GL_INT_VEC3),
> - ENUM_STRING(GL_INT_VEC4),
> - ENUM_STRING(GL_UNSIGNED_INT),
> - ENUM_STRING(GL_UNSIGNED_INT_VEC2),
> - ENUM_STRING(GL_UNSIGNED_INT_VEC3),
> - ENUM_STRING(GL_UNSIGNED_INT_VEC4),
> - ENUM_STRING(GL_BOOL),
> - ENUM_STRING(GL_BOOL_VEC2),
> - ENUM_STRING(GL_BOOL_VEC3),
> - ENUM_STRING(GL_BOOL_VEC4),
> - ENUM_STRING(GL_FLOAT_MAT2),
> - ENUM_STRING(GL_FLOAT_MAT3),
> - ENUM_STRING(GL_FLOAT_M

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

2015-09-23 Thread Ian Romanick
On 09/11/2015 11:52 PM, Kenneth Graunke wrote:
> 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 
> ---
>  .../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.
> + */
> +
> +/**
> + */

Something missing here? :)

> +
> +#include "piglit-util-gl.h"
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +
> + config.supports_gl_compat_version = 30;

Other than using "in" and "out", this doesn't really need anything from
GLSL 1.30, does it?

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

Don't need GL_ARB_explicit_attrib_location here or below.

> + "\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"

This probably can't suffer from the "out of order" problem, but I'd
still be tempted to use the cross-product method from
rendezvous_by_location.c. *s

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

2015-09-23 Thread Ian Romanick
On 09/11/2015 11:52 PM, Kenneth Graunke wrote:
> 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 
> ---
>  .../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_explicit_attrib_location: req

Re: [Piglit] [PATCH 2/2] framework/log: add an HTTP logger

2015-09-23 Thread Thomas Wood
On 22 September 2015 at 21:11, Dylan Baker  wrote:
> This looks good, thanks for making changes.
>
> I have one rather lengthy comment below, but I'm fine with this landing
> pretty much as-is, once my question about the previous patch is
> answered.
>
> On Tue, Sep 22, 2015 at 05:22:24PM +0100, Thomas Wood wrote:
>> Add an HTTP logger so that it is possible to monitor the progress and
>> status of piglit remotely through a webserver. The webserver runs on
>> port 8080 by default and can be configured to run on a different port by
>> setting the "port" key in the "http" section of the configuration file.
>> The server responds to requests for /summary, which provides a summary
>> of the current state in JSON format.
>>
>> v2: Add appropriate locking when reading state data for the web server
>> Stop the server after the request for the final results
>> Remove the full results page
>> Add a configuration option to set the server port
>>
>> Signed-off-by: Thomas Wood 
>> ---
>>  framework/log.py  | 76 
>> +++
>>  framework/programs/run.py |  2 +-
>>  2 files changed, 77 insertions(+), 1 deletion(-)
>>
>> diff --git a/framework/log.py b/framework/log.py
>> index 6d5a31c..868561e 100644
>> --- a/framework/log.py
>> +++ b/framework/log.py
>> @@ -32,6 +32,14 @@ import abc
>>  import itertools
>>  import threading
>>  import collections
>> +import ConfigParser
>> +from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
>> +try:
>> +import simplejson as json
>> +except ImportError:
>> +import json
>> +
>> +from framework.core import PIGLIT_CONFIG
>>
>>  __all__ = ['LogManager']
>>
>> @@ -252,6 +260,68 @@ class DummyLog(BaseLog):
>>  pass
>>
>>
>> +class HTTPLogServer(threading.Thread):
>> +class RequestHandler(BaseHTTPRequestHandler):
>> +INDENT = 4
>> +
>> +def do_GET(self):
>> +if self.path == "/summary":
>> +self.send_response(200)
>> +self.end_headers()
>> +with self.server.state_lock:
>> +status = {
>> +"complete": self.server.state["complete"],
>> +"running" : self.server.state["running"],
>> +"total"   : self.server.state["total"],
>> +"results" : self.server.state["summary"],
>> +}
>> +self.wfile.write(json.dumps(status, indent=self.INDENT))
>> +else:
>> +self.send_response(404)
>> +self.end_headers()
>> +
>> +def __init__(self, state, state_lock):
>> +super(HTTPLogServer, self).__init__()
>> +try:
>> +port = PIGLIT_CONFIG.getint("http", "port")
>> +except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
>> +port = 8080
>
> The PIGLIT_CONFIG constant is actually a subclass of SafeConfigParser.
> (Actually, this example shows me that I should extend the safe_get
> method a little). I've sent out a patch to add a fallback option which
> would make this even simpler.
>
> You could implement this as:
> try:
> port = int(PIGLIT_CONFIG.safe_get('http', 'port'))
> except TypeError:
> port = 8080
>
> This isn't much better, but at least it avoids importing ConfigParser.
>
>
> With the patch I sent to the list it would be:
> port = int(PIGLIT_CONFIG.safe_get('http', 'port', fallback=8080))

I've sent a new version of the patch using the new fallback parameter.


>
> I'm okay with you not taking any of these suggestions. If you choose not
> to, would you be so kind as to add a 'FIXME: use safe_get here'?
>
>> +self._httpd = HTTPServer(("", port), HTTPLogServer.RequestHandler)
>> +self._httpd.state = state
>> +self._httpd.state_lock = state_lock
>> +
>> +def run(self):
>> +while True:
>> +with self._httpd.state_lock:
>> +# stop handling requests after the request for the final 
>> results
>> +if self._httpd.state["complete"] == 
>> self._httpd.state["total"]:
>> +break;
>> +self._httpd.handle_request()
>> +
>> +
>> +class HTTPLog(BaseLog):
>> +""" A Logger that serves status information over http """
>> +
>> +def __init__(self, state, state_lock):
>> +super(HTTPLog, self).__init__(state, state_lock)
>> +self._name = None
>> +
>> +def start(self, name):
>> +with self._LOCK:
>> +self._name = name
>> +self._state['running'].append(self._name)
>> +
>> +def log(self, status):
>> +with self._LOCK:
>> +self._state['running'].remove(self._name)
>> +self._state['complete'] += 1
>> +assert status in self.SUMMARY_KEYS
>> +self._state['summary'][status] += 1

Now that commit b365367 (framework: replace TestResult dict with an
object) has been pushed, status is no longer a strin

Re: [Piglit] [PATCH 1/2] framework/log: declare the state and state lock together

2015-09-23 Thread Thomas Wood
On 22 September 2015 at 20:41, Dylan Baker  wrote:
> I haven't tested this yet, but this looks like it breaks the existing
> loggers, have you tested this with the Quiet and Verbose logs?

It doesn't break the quiet and verbose loggers because they use *args
and **kwargs when overriding __init__, but it does break the dummy
logger. I've sent a new version of the patch with this fixed.


>
> On Tue, Sep 22, 2015 at 05:22:23PM +0100, Thomas Wood wrote:
>> Declare the state and state lock variables at the same time so that the
>> same lock can be always used when accessing the state variable.
>>
>> Signed-off-by: Thomas Wood 
>> ---
>>  framework/log.py | 8 +---
>>  1 file changed, 5 insertions(+), 3 deletions(-)
>>
>> diff --git a/framework/log.py b/framework/log.py
>> index 759974a..6d5a31c 100644
>> --- a/framework/log.py
>> +++ b/framework/log.py
>> @@ -51,9 +51,10 @@ class BaseLog(object):
>>  SUMMARY_KEYS = set([
>>  'pass', 'fail', 'warn', 'crash', 'skip', 'dmesg-warn', 'dmesg-fail',
>>  'dry-run', 'timeout'])
>> -_LOCK = threading.Lock()
>> +_LOCK = None
>>
>> -def __init__(self, state):
>> +def __init__(self, state, state_lock):
>> +self._LOCK = state_lock
>>  self._state = state
>>  self._pad = len(str(state['total']))
>>
>> @@ -285,7 +286,8 @@ class LogManager(object):
>>  'complete': 0,
>>  'running': [],
>>  }
>> +self._state_lock = threading.Lock()
>>
>>  def get(self):
>>  """ Return a new log instance """
>> -return self._log(self._state)
>> +return self._log(self._state, self._state_lock)
>> --
>> 1.9.1
>>
>> ___
>> Piglit mailing list
>> Piglit@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v3 2/2] framework/log: add an HTTP logger

2015-09-23 Thread Thomas Wood
Add an HTTP logger so that it is possible to monitor the progress and
status of piglit remotely through a web server. The web server runs on
port 8080 by default and can be configured to run on a different port by
setting the "port" key in the "http" section of the configuration file.
The server responds to requests for /summary, which provides a summary
of the current state in JSON format.

v2: Add appropriate locking when reading state data for the web server
Stop the server after the request for the final results
Remove the full results page
Add a configuration option to set the server port
v3: Use the new fallback parameter of safe_get
Convert the test result status back to string

Signed-off-by: Thomas Wood 
---
 framework/log.py  | 72 +++
 framework/programs/run.py |  2 +-
 2 files changed, 73 insertions(+), 1 deletion(-)

diff --git a/framework/log.py b/framework/log.py
index 423479f..623082a 100644
--- a/framework/log.py
+++ b/framework/log.py
@@ -32,6 +32,13 @@ import abc
 import itertools
 import threading
 import collections
+from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
+try:
+import simplejson as json
+except ImportError:
+import json
+
+from framework.core import PIGLIT_CONFIG
 
 __all__ = ['LogManager']
 
@@ -252,6 +259,65 @@ class DummyLog(BaseLog):
 pass
 
 
+class HTTPLogServer(threading.Thread):
+class RequestHandler(BaseHTTPRequestHandler):
+INDENT = 4
+
+def do_GET(self):
+if self.path == "/summary":
+self.send_response(200)
+self.end_headers()
+with self.server.state_lock:
+status = {
+"complete": self.server.state["complete"],
+"running" : self.server.state["running"],
+"total"   : self.server.state["total"],
+"results" : self.server.state["summary"],
+}
+self.wfile.write(json.dumps(status, indent=self.INDENT))
+else:
+self.send_response(404)
+self.end_headers()
+
+def __init__(self, state, state_lock):
+super(HTTPLogServer, self).__init__()
+port = int(PIGLIT_CONFIG.safe_get("http", "port", fallback=8080))
+self._httpd = HTTPServer(("", port), HTTPLogServer.RequestHandler)
+self._httpd.state = state
+self._httpd.state_lock = state_lock
+
+def run(self):
+while True:
+with self._httpd.state_lock:
+# stop handling requests after the request for the final 
results
+if self._httpd.state["complete"] == self._httpd.state["total"]:
+break;
+self._httpd.handle_request()
+
+
+class HTTPLog(BaseLog):
+""" A Logger that serves status information over http """
+
+def __init__(self, state, state_lock):
+super(HTTPLog, self).__init__(state, state_lock)
+self._name = None
+
+def start(self, name):
+with self._LOCK:
+self._name = name
+self._state['running'].append(self._name)
+
+def log(self, status):
+with self._LOCK:
+self._state['running'].remove(self._name)
+self._state['complete'] += 1
+assert status in self.SUMMARY_KEYS
+self._state['summary'][str(status)] += 1
+
+def summary(self):
+pass
+
+
 class LogManager(object):
 """ Creates new log objects
 
@@ -274,6 +340,7 @@ class LogManager(object):
 'quiet': QuietLog,
 'verbose': VerboseLog,
 'dummy': DummyLog,
+'http': HTTPLog,
 }
 
 def __init__(self, logger, total):
@@ -288,6 +355,11 @@ class LogManager(object):
 }
 self._state_lock = threading.Lock()
 
+# start the http server for http logger
+if logger == 'http':
+self.log_server = HTTPLogServer(self._state, self._state_lock)
+self.log_server.start()
+
 def get(self):
 """ Return a new log instance """
 return self._log(self._state, self._state_lock)
diff --git a/framework/programs/run.py b/framework/programs/run.py
index 16c3d37..c35783d 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -158,7 +158,7 @@ def _run_parser(input_):
 log_parser.add_argument("-l", "--log-level",
 dest="log_level",
 action="store",
-choices=['quiet', 'verbose', 'dummy'],
+choices=['quiet', 'verbose', 'dummy', 'http'],
 default='quiet',
 help="Set the logger verbosity level")
 parser.add_argument("--test-list",
-- 
1.9.1

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


[Piglit] [PATCH v3 1/2] framework/log: declare the state and state lock together

2015-09-23 Thread Thomas Wood
Declare the state and state lock variables at the same time so that the
same lock can be always used when accessing the state variable.

v2: fix dummy logger

Signed-off-by: Thomas Wood 
---
 framework/log.py | 10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/framework/log.py b/framework/log.py
index 759974a..423479f 100644
--- a/framework/log.py
+++ b/framework/log.py
@@ -51,9 +51,10 @@ class BaseLog(object):
 SUMMARY_KEYS = set([
 'pass', 'fail', 'warn', 'crash', 'skip', 'dmesg-warn', 'dmesg-fail',
 'dry-run', 'timeout'])
-_LOCK = threading.Lock()
+_LOCK = None
 
-def __init__(self, state):
+def __init__(self, state, state_lock):
+self._LOCK = state_lock
 self._state = state
 self._pad = len(str(state['total']))
 
@@ -238,7 +239,7 @@ class VerboseLog(QuietLog):
 
 class DummyLog(BaseLog):
 """ A Logger that does nothing """
-def __init__(self, state):
+def __init__(self, state, state_lock):
 pass
 
 def start(self, name):
@@ -285,7 +286,8 @@ class LogManager(object):
 'complete': 0,
 'running': [],
 }
+self._state_lock = threading.Lock()
 
 def get(self):
 """ Return a new log instance """
-return self._log(self._state)
+return self._log(self._state, self._state_lock)
-- 
1.9.1

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


Re: [Piglit] [Intel-gfx] [PATCH i-g-t v2] scripts: add quick-testlist.py

2015-09-23 Thread Daniel Vetter
On Thu, Sep 17, 2015 at 12:42:44PM +0100, Thomas Wood wrote:
> Add a script to take a piglit results file and create a list of tests
> that ran in under 60 seconds. This list can be used by the --test-list
> option of piglit.
> 
> v2: exclude incomplete tests
> 
> Signed-off-by: Thomas Wood 

I think this might be generally useful for piglit uses, maybe in contrib/?

Anyway adding piglit m-l.
-Daniel

> ---
>  scripts/quick-testlist.py | 46 ++
>  1 file changed, 46 insertions(+)
>  create mode 100755 scripts/quick-testlist.py
> 
> diff --git a/scripts/quick-testlist.py b/scripts/quick-testlist.py
> new file mode 100755
> index 000..0dd4c69
> --- /dev/null
> +++ b/scripts/quick-testlist.py
> @@ -0,0 +1,46 @@
> +#!/usr/bin/env python
> +#
> +# 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.
> +
> +from __future__ import print_function
> +import json
> +import sys
> +
> +def filter_results(filename):
> +with open(filename) as data:
> +json_data = json.load(data)
> +
> +for test_name in json_data["tests"]:
> +if json_data["tests"][test_name]["result"] == "incomplete":
> +continue
> +if json_data["tests"][test_name]["time"] < 60:
> +print(test_name)
> +
> +
> +if len(sys.argv) < 2:
> +print("Usage: quick-testlist.py RESULTS")
> +print("Read piglit results from RESULTS and print the tests that 
> executed"
> +  " in under 60 seconds, excluding any incomplete tests. The list 
> can"
> +  " be used by the --test-list option of piglit.")
> +sys.exit(1)
> +
> +filter_results(sys.argv[1])
> -- 
> 1.9.1
> 
> ___
> Intel-gfx mailing list
> intel-...@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] glsl-1.50: test shader compiles with unused uniform block

2015-09-23 Thread Tapani Pälli

Reviewed-by: Tapani Pälli 

On 09/23/2015 06:36 AM, Timothy Arceri wrote:

Tests the second bug mentioned in the bug report.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83508
---
  .../uniform_block/unused-interface-array.vert | 19 +++
  1 file changed, 19 insertions(+)
  create mode 100644 
tests/spec/glsl-1.50/compiler/uniform_block/unused-interface-array.vert

diff --git 
a/tests/spec/glsl-1.50/compiler/uniform_block/unused-interface-array.vert 
b/tests/spec/glsl-1.50/compiler/uniform_block/unused-interface-array.vert
new file mode 100644
index 000..e28ffe9
--- /dev/null
+++ b/tests/spec/glsl-1.50/compiler/uniform_block/unused-interface-array.vert
@@ -0,0 +1,19 @@
+/* [config]
+ * expect_result: pass
+ * glsl_version: 1.50
+ * [end config]
+ *
+ * Tests that shader still compiles with an unused uniform block. A packed
+ * layout means the implementation can eliminate the block entirely.
+ */
+#version 150
+
+layout(packed) uniform ArrayBlock
+{
+  mat4 a;
+} i[4];
+
+void main()
+{
+  gl_Position = vec4(1.0);
+}


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


Re: [Piglit] [PATCH] framework/core: add fallback to PiglitConfig.safe_get

2015-09-23 Thread Thomas Wood
On 22 September 2015 at 21:04, Dylan Baker  wrote:
> This is in keeping with the way that piglitconfig.get() works in python3
> (although there are some corner case differences since in python3 it
> uses keyword only arguments).
>
> Signed-off-by: Dylan Baker 

Reviewed-by: Thomas Wood 


> ---
>
> This would actually be pretty useful in a number of cases in piglit
> currently, and a few patches on the mailing list.
>
>  framework/core.py | 6 +++---
>  framework/tests/core_tests.py | 4 
>  2 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/framework/core.py b/framework/core.py
> index 63cb911..dbd6895 100644
> --- a/framework/core.py
> +++ b/framework/core.py
> @@ -58,7 +58,7 @@ class PiglitConfig(ConfigParser.SafeConfigParser):
>  ConfigParser.SafeConfigParser.readfp(self, fp, filename)
>  self.filename = os.path.abspath(filename or fp.name)
>
> -def safe_get(self, *args, **kwargs):
> +def safe_get(self, section, option, fallback=None, **kwargs):
>  """A version of self.get that doesn't raise NoSectionError or
>  NoOptionError.
>
> @@ -67,9 +67,9 @@ class PiglitConfig(ConfigParser.SafeConfigParser):
>
>  """
>  try:
> -return self.get(*args, **kwargs)
> +return self.get(section, option, **kwargs)
>  except (ConfigParser.NoOptionError, ConfigParser.NoSectionError):
> -return None
> +return fallback
>
>  def required_get(self, section, option, **kwargs):
>  """A version fo self.get that raises PiglitFatalError.
> diff --git a/framework/tests/core_tests.py b/framework/tests/core_tests.py
> index af09339..9be9c57 100644
> --- a/framework/tests/core_tests.py
> +++ b/framework/tests/core_tests.py
> @@ -267,3 +267,7 @@ class TestPiglitConfig(object):
>  """core.PiglitConfig: required_get raises PiglitFatalError if the 
> section is missing
>  """
>  self.conf.required_get('invalid', 'invalid')
> +
> +def test_safe_get_fallback(self):
> +"""core.PiglitConfig: safe_get returns the value of fallback when 
> the section or option is missing"""
> +nt.eq_(self.conf.safe_get('invalid', 'invalid', fallback='foo'), 
> 'foo')
> --
> 2.5.3
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] glsl-1.50: test shader compiles with unused uniform block

2015-09-23 Thread Samuel Iglesias Gonsálvez
Reviewed-by: Samuel Iglesias Gonsálvez 

On 23/09/15 05:36, Timothy Arceri wrote:
> Tests the second bug mentioned in the bug report.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83508
> ---
>  .../uniform_block/unused-interface-array.vert | 19 
> +++
>  1 file changed, 19 insertions(+)
>  create mode 100644 
> tests/spec/glsl-1.50/compiler/uniform_block/unused-interface-array.vert
> 
> diff --git 
> a/tests/spec/glsl-1.50/compiler/uniform_block/unused-interface-array.vert 
> b/tests/spec/glsl-1.50/compiler/uniform_block/unused-interface-array.vert
> new file mode 100644
> index 000..e28ffe9
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/uniform_block/unused-interface-array.vert
> @@ -0,0 +1,19 @@
> +/* [config]
> + * expect_result: pass
> + * glsl_version: 1.50
> + * [end config]
> + * 
> + * Tests that shader still compiles with an unused uniform block. A packed
> + * layout means the implementation can eliminate the block entirely.
> + */
> +#version 150
> +
> +layout(packed) uniform ArrayBlock
> +{
> +  mat4 a;
> +} i[4];
> +
> +void main()
> +{
> +  gl_Position = vec4(1.0);
> +}
> 
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 1/2] shader_runner: make active_uniforms's all_types variable be global

2015-09-23 Thread Samuel Iglesias Gonsalvez
Signed-off-by: Samuel Iglesias Gonsalvez 
---
 tests/shaders/shader_runner.c | 156 +-
 1 file changed, 78 insertions(+), 78 deletions(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 0614c7f..7a647a1 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -158,6 +158,84 @@ enum comparison {
less_equal
 };
 
+static const struct string_to_enum all_types[] = {
+   ENUM_STRING(GL_FLOAT),
+   ENUM_STRING(GL_FLOAT_VEC2),
+   ENUM_STRING(GL_FLOAT_VEC3),
+   ENUM_STRING(GL_FLOAT_VEC4),
+   ENUM_STRING(GL_DOUBLE),
+   ENUM_STRING(GL_DOUBLE_VEC2),
+   ENUM_STRING(GL_DOUBLE_VEC3),
+   ENUM_STRING(GL_DOUBLE_VEC4),
+   ENUM_STRING(GL_INT),
+   ENUM_STRING(GL_INT_VEC2),
+   ENUM_STRING(GL_INT_VEC3),
+   ENUM_STRING(GL_INT_VEC4),
+   ENUM_STRING(GL_UNSIGNED_INT),
+   ENUM_STRING(GL_UNSIGNED_INT_VEC2),
+   ENUM_STRING(GL_UNSIGNED_INT_VEC3),
+   ENUM_STRING(GL_UNSIGNED_INT_VEC4),
+   ENUM_STRING(GL_BOOL),
+   ENUM_STRING(GL_BOOL_VEC2),
+   ENUM_STRING(GL_BOOL_VEC3),
+   ENUM_STRING(GL_BOOL_VEC4),
+   ENUM_STRING(GL_FLOAT_MAT2),
+   ENUM_STRING(GL_FLOAT_MAT3),
+   ENUM_STRING(GL_FLOAT_MAT4),
+   ENUM_STRING(GL_FLOAT_MAT2x3),
+   ENUM_STRING(GL_FLOAT_MAT2x4),
+   ENUM_STRING(GL_FLOAT_MAT3x2),
+   ENUM_STRING(GL_FLOAT_MAT3x4),
+   ENUM_STRING(GL_FLOAT_MAT4x2),
+   ENUM_STRING(GL_FLOAT_MAT4x3),
+   ENUM_STRING(GL_DOUBLE_MAT2),
+   ENUM_STRING(GL_DOUBLE_MAT3),
+   ENUM_STRING(GL_DOUBLE_MAT4),
+   ENUM_STRING(GL_DOUBLE_MAT2x3),
+   ENUM_STRING(GL_DOUBLE_MAT2x4),
+   ENUM_STRING(GL_DOUBLE_MAT3x2),
+   ENUM_STRING(GL_DOUBLE_MAT3x4),
+   ENUM_STRING(GL_DOUBLE_MAT4x2),
+   ENUM_STRING(GL_DOUBLE_MAT4x3),
+   ENUM_STRING(GL_SAMPLER_1D),
+   ENUM_STRING(GL_SAMPLER_2D),
+   ENUM_STRING(GL_SAMPLER_3D),
+   ENUM_STRING(GL_SAMPLER_CUBE),
+   ENUM_STRING(GL_SAMPLER_1D_SHADOW),
+   ENUM_STRING(GL_SAMPLER_2D_SHADOW),
+   ENUM_STRING(GL_SAMPLER_1D_ARRAY),
+   ENUM_STRING(GL_SAMPLER_2D_ARRAY),
+   ENUM_STRING(GL_SAMPLER_1D_ARRAY_SHADOW),
+   ENUM_STRING(GL_SAMPLER_2D_ARRAY_SHADOW),
+   ENUM_STRING(GL_SAMPLER_2D_MULTISAMPLE),
+   ENUM_STRING(GL_SAMPLER_2D_MULTISAMPLE_ARRAY),
+   ENUM_STRING(GL_SAMPLER_CUBE_SHADOW),
+   ENUM_STRING(GL_SAMPLER_BUFFER),
+   ENUM_STRING(GL_SAMPLER_2D_RECT),
+   ENUM_STRING(GL_SAMPLER_2D_RECT_SHADOW),
+   ENUM_STRING(GL_INT_SAMPLER_1D),
+   ENUM_STRING(GL_INT_SAMPLER_2D),
+   ENUM_STRING(GL_INT_SAMPLER_3D),
+   ENUM_STRING(GL_INT_SAMPLER_CUBE),
+   ENUM_STRING(GL_INT_SAMPLER_1D_ARRAY),
+   ENUM_STRING(GL_INT_SAMPLER_2D_ARRAY),
+   ENUM_STRING(GL_INT_SAMPLER_2D_MULTISAMPLE),
+   ENUM_STRING(GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY),
+   ENUM_STRING(GL_INT_SAMPLER_BUFFER),
+   ENUM_STRING(GL_INT_SAMPLER_2D_RECT),
+   ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_1D),
+   ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_2D),
+   ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_3D),
+   ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_CUBE),
+   ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_1D_ARRAY),
+   ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_2D_ARRAY),
+   ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE),
+   ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY),
+   ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_BUFFER),
+   ENUM_STRING(GL_UNSIGNED_INT_SAMPLER_2D_RECT),
+   { NULL, 0 }
+};
+
 GLenum
 lookup_enum_string(const struct string_to_enum *table, const char **line,
   const char *error_desc)
@@ -1860,84 +1938,6 @@ active_uniform(const char *line)
{ NULL, 0 }
};
 
-   static const struct string_to_enum all_types[] = {
-   ENUM_STRING(GL_FLOAT),
-   ENUM_STRING(GL_FLOAT_VEC2),
-   ENUM_STRING(GL_FLOAT_VEC3),
-   ENUM_STRING(GL_FLOAT_VEC4),
-   ENUM_STRING(GL_DOUBLE),
-   ENUM_STRING(GL_DOUBLE_VEC2),
-   ENUM_STRING(GL_DOUBLE_VEC3),
-   ENUM_STRING(GL_DOUBLE_VEC4),
-   ENUM_STRING(GL_INT),
-   ENUM_STRING(GL_INT_VEC2),
-   ENUM_STRING(GL_INT_VEC3),
-   ENUM_STRING(GL_INT_VEC4),
-   ENUM_STRING(GL_UNSIGNED_INT),
-   ENUM_STRING(GL_UNSIGNED_INT_VEC2),
-   ENUM_STRING(GL_UNSIGNED_INT_VEC3),
-   ENUM_STRING(GL_UNSIGNED_INT_VEC4),
-   ENUM_STRING(GL_BOOL),
-   ENUM_STRING(GL_BOOL_VEC2),
-   ENUM_STRING(GL_BOOL_VEC3),
-   ENUM_STRING(GL_BOOL_VEC4),
-   ENUM_STRING(GL_FLOAT_MAT2),
-   ENUM_STRING(GL_FLOAT_MAT3),
-   ENUM_STRING(GL_FLOAT_MAT4),
-   ENUM_STRING(GL_FLOAT_MAT2x3),
-   ENUM_STRING(GL_FLOAT_MAT2x4),
-   ENUM_STRING(GL_FLOAT_MA

Re: [Piglit] [Announce] Summary updates have arrived

2015-09-23 Thread Dave Airlie
I'm not sure if it's related, but I'm not seeing the command lines in
the html summary anymore.

Dave.

On 23 September 2015 at 08:05, Dylan Baker  wrote:
> Just a heads up. My series reworking summaries had landed.
>
> Most of this work is meant to be user-transparent, but I'm sure there
> are one or two corner cases I didn't catch, please direct any bugs with
> the summary my way, and I'll try to be prompt in fixing them.
>
> What has changed is the console output.
> This now returns a more obviously formatted output, with tidy columns
> using the name of the result as the header, and calculating
> changes/regressions/fixes/etc on a column by column basis (ie,
> regressions in column 2 are regressions between column 1 and column 2).
> This should be more useful.
>
> Dylan
>
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit