[Piglit] [PATCH v2 12/16] squash! shader_runner: add ability to run multiple tests per process

2016-09-30 Thread Dylan Baker
Bug fixes from me for the above patch.

I've split these out to make them easier to review. Before merging to
master this will be squashed into the previous patch.

Changes:
 - Fix the assertion of subuniform_locations
 - Add teardown function for UBOs that destroys objects and frees memory
 - Print 'PIGLIT TEST:' instead of test. This is more likely to be
   unique, and is needed by the framework for recovering from crashes
 - Print the 'PIGLIT TEST:' line to stderr as well as stdout
 - After freeing subuniform_locations also set the values back to NULL
 - Add a flag for subtest reporting. This allows the piglit framework to
   tell shader_runner that it wants the results as subtest reports, but
   allows the current users to continue to get the results the expect
   without making any changes. It also covers a few corners of resuming.
 - Ensure that shaders are cleaned-up after linking
 - Cleanup textures after each test
 - Simplify the logic for calling piglit_present_results

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---

This patch is unchanged since v1, and was acked in v1. All further changes are
in the next patch.

 tests/shaders/shader_runner.c | 163 +++
 1 file changed, 108 insertions(+), 55 deletions(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index eeab08a..50bda7c 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -118,6 +118,8 @@ static GLuint fragment_shaders[256];
 static unsigned num_fragment_shaders = 0;
 static GLuint compute_shaders[256];
 static unsigned num_compute_shaders = 0;
+static GLuint textures[256];
+static unsigned num_textures = 0;
 static int num_uniform_blocks;
 static GLuint *uniform_block_bos;
 static GLenum geometry_layout_input_type = GL_TRIANGLES;
@@ -151,6 +153,8 @@ static GLuint vao = 0;
 static GLuint fbo = 0;
 static GLint render_width, render_height;
 
+static bool report_subtests = false;
+
 enum states {
none = 0,
requirements,
@@ -1082,50 +1086,26 @@ link_and_use_shaders(void)
 
result = process_shader(GL_VERTEX_SHADER, num_vertex_shaders, 
vertex_shaders);
if (result != PIGLIT_PASS)
-   return result;
+   goto cleanup;
result = process_shader(GL_TESS_CONTROL_SHADER, num_tess_ctrl_shaders, 
tess_ctrl_shaders);
if (result != PIGLIT_PASS)
-   return result;
+   goto cleanup;
result = process_shader(GL_TESS_EVALUATION_SHADER, 
num_tess_eval_shaders, tess_eval_shaders);
if (result != PIGLIT_PASS)
-   return result;
+   goto cleanup;
result = process_shader(GL_GEOMETRY_SHADER, num_geometry_shaders, 
geometry_shaders);
if (result != PIGLIT_PASS)
-   return result;
+   goto cleanup;
result = process_shader(GL_FRAGMENT_SHADER, num_fragment_shaders, 
fragment_shaders);
if (result != PIGLIT_PASS)
-   return result;
+   goto cleanup;
result = process_shader(GL_COMPUTE_SHADER, num_compute_shaders, 
compute_shaders);
if (result != PIGLIT_PASS)
-   return result;
+   goto cleanup;
 
if (!sso_in_use)
glLinkProgram(prog);
 
-   for (i = 0; i < num_vertex_shaders; i++) {
-   glDeleteShader(vertex_shaders[i]);
-   }
-
-   for (i = 0; i < num_tess_ctrl_shaders; i++) {
-   glDeleteShader(tess_ctrl_shaders[i]);
-   }
-
-   for (i = 0; i < num_tess_eval_shaders; i++) {
-   glDeleteShader(tess_eval_shaders[i]);
-   }
-
-   for (i = 0; i < num_geometry_shaders; i++) {
-   glDeleteShader(geometry_shaders[i]);
-   }
-
-   for (i = 0; i < num_fragment_shaders; i++) {
-   glDeleteShader(fragment_shaders[i]);
-   }
-
-   for (i = 0; i < num_compute_shaders; i++) {
-   glDeleteShader(compute_shaders[i]);
-   }
-
if (!sso_in_use) {
glGetProgramiv(prog, GL_LINK_STATUS, );
if (ok) {
@@ -1138,7 +1118,8 @@ link_and_use_shaders(void)
 
glGetProgramInfoLog(prog, size, NULL, prog_err_info);
 
-   return PIGLIT_PASS;
+   result = PIGLIT_PASS;
+   goto cleanup;
}
 
glUseProgram(prog);
@@ -1155,7 +1136,39 @@ link_and_use_shaders(void)
 
glGetProgramInfoLog(prog, size, NULL, prog_err_info);
}
-   return PIGLIT_PASS;
+
+cleanup:
+   for (i = 0; i < num_vertex_shaders; i++) {
+   glDeleteShader(vertex_shaders[i]);
+   }
+   num_vertex_shaders = 0;
+
+   for (i = 0; i < num_tess_ctrl_shaders; i++) {
+   glDeleteShader(tess_ctrl_shaders[i]);
+   }
+   num_tess_ctrl_shaders = 0;
+
+   for (i = 0; i < num_tess_eval_shaders; i++)

[Piglit] [PATCH v2 15/16] framework: Plug in fast-skipping to MultiShaderTest

2016-09-30 Thread Dylan Baker
This adds fast-skipping support to the MultiShaderTest class. Both
patches seemed significant enough to warrant splitting them in two.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 framework/test/base.py|  8 +-
 framework/test/shader_test.py | 49 +++-
 2 files changed, 44 insertions(+), 13 deletions(-)

diff --git a/framework/test/base.py b/framework/test/base.py
index 224ca61..5f0491d 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -467,11 +467,17 @@ class ReducedProcessMixin(object):
 """
 
 def __init__(self, command, subtests=None, **kwargs):
-assert subtests  # This covers both "not None" and len(subtests) > 1
+assert subtests is not None
 super(ReducedProcessMixin, self).__init__(command, **kwargs)
 self._expected = subtests
 self._populate_subtests()
 
+def is_skip(self):
+"""Skip if the length of expected is 0."""
+if not self._expected:
+raise TestIsSkip('All subtests skipped')
+super(ReducedProcessMixin, self).is_skip()
+
 def __find_sub(self):
 """Helper for getting the next index."""
 return len([l for l in self.result.out.split('\n')
diff --git a/framework/test/shader_test.py b/framework/test/shader_test.py
index e72e2ec..447e8c0 100644
--- a/framework/test/shader_test.py
+++ b/framework/test/shader_test.py
@@ -32,8 +32,8 @@ import re
 
 from framework import exceptions
 from framework import status
-from .base import ReducedProcessMixin
-from .opengl import FastSkipMixin
+from .base import ReducedProcessMixin, TestIsSkip
+from .opengl import FastSkipMixin, FastSkip
 from .piglit_test import PiglitBaseTest
 
 __all__ = [
@@ -185,24 +185,49 @@ class MultiShaderTest(ReducedProcessMixin, 
PiglitBaseTest):
 """
 
 def __init__(self, filenames):
-# TODO fast skip.
-parser = Parser(filenames[0])
-parser.parse()
-prog = parser.prog
-files = [parser.filename]
-
-for each in filenames[1:]:
+assert filenames
+prog = None
+files = []
+subtests = []
+skips = []
+
+# Walk each subtest, and either add it to the list of tests to run, or
+# determine it is skip, and set the result of that test in the subtests
+# dictionary to skip without adding it ot the liest of tests to run
+for each in filenames:
 parser = Parser(each)
 parser.parse()
-assert parser.prog == prog
+subtest = os.path.basename(os.path.splitext(each)[0]).lower()
+
+if prog is not None:
+assert parser.prog == prog
+else:
+prog = parser.prog
+
+try:
+skipper = FastSkip(gl_required=parser.gl_required,
+   gl_version=parser.gl_version,
+   gles_version=parser.gles_version,
+   glsl_version=parser.glsl_version,
+   glsl_es_version=parser.glsl_es_version)
+skipper.test()
+except TestIsSkip:
+skips.append(subtest)
+continue
 files.append(parser.filename)
+subtests.append(subtest)
+
+assert len(subtests) + len(skips) == len(filenames), \
+'not all tests accounted for'
 
 super(MultiShaderTest, self).__init__(
 [prog] + files,
-subtests=[os.path.basename(os.path.splitext(f)[0]).lower()
-  for f in filenames],
+subtests=subtests,
 run_concurrent=True)
 
+for name in skips:
+self.result.subtests[name] = status.SKIP
+
 @PiglitBaseTest.command.getter  # pylint: disable=no-member
 def command(self):
 """Add -auto to the test command."""
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 16/16] framework: add boilerplate to turn off process isolation

2016-09-30 Thread Dylan Baker
This adds a switch to to turn off process isolation (it is normally on),
for now this only affects shader_runner, but in the future could affect
more tests, like glslparsertest or dEQP.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 framework/options.py  |  1 +
 framework/programs/run.py | 23 +++
 piglit.conf.example   |  7 +++
 tests/all.py  | 37 ++---
 tests/shader.py   |  4 ++--
 5 files changed, 63 insertions(+), 9 deletions(-)

diff --git a/framework/options.py b/framework/options.py
index 94a8084..5cb88aa 100644
--- a/framework/options.py
+++ b/framework/options.py
@@ -197,6 +197,7 @@ class _Options(object):  # pylint: 
disable=too-many-instance-attributes
 self.monitored = False
 self.sync = False
 self.deqp_mustpass = False
+self.process_isolation = True
 
 # env is used to set some base environment variables that are not going
 # to change across runs, without sending them to os.environ which is
diff --git a/framework/programs/run.py b/framework/programs/run.py
index f531b37..ecfc36f 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -41,6 +41,16 @@ __all__ = ['run',
'resume']
 
 
+def booltype(val):
+if val.lower() in ['false', 'no', '0']:
+return False
+elif val.lower() in ['true', 'yes', '1']:
+return True
+raise argparse.ArgumentTypeError(
+'Case insensitve values of "yes", "no", "false", "true", and "0" or '
+'"1" are accepted.')
+
+
 def _default_platform():
 """ Logic to determine the default platform to use
 
@@ -183,6 +193,17 @@ def _run_parser(input_):
 help='Run only the tests in the deqp mustpass list '
  'when running a deqp gles{2,3,31} profile, '
  'otherwise run all tests.')
+parser.add_argument('--process-isolation',
+dest='process_isolation',
+action='store',
+type=booltype,
+default=core.PIGLIT_CONFIG.safe_get(
+'core', 'process isolation', 'true'),
+metavar='',
+help='Set this to allow tests to run without process '
+ 'isolation. This allows, but does not require, '
+ 'tests to run multiple tests per process. '
+ 'This value can also be set in piglit.conf.')
 parser.add_argument("test_profile",
 metavar="",
 nargs='+',
@@ -264,6 +285,7 @@ def run(input_):
 options.OPTIONS.monitored = args.monitored
 options.OPTIONS.sync = args.sync
 options.OPTIONS.deqp_mustpass = args.deqp_mustpass
+options.OPTIONS.process_isolation = args.process_isolation
 
 # Set the platform to pass to waffle
 options.OPTIONS.env['PIGLIT_PLATFORM'] = args.platform
@@ -352,6 +374,7 @@ def resume(input_):
 options.OPTIONS.monitored = results.options['monitored']
 options.OPTIONS.sync = results.options['sync']
 options.OPTIONS.deqp_mustpass = results.options['deqp_mustpass']
+options.OPTIONS.proces_isolation = results.options['process_isolation']
 
 core.get_config(args.config_file)
 
diff --git a/piglit.conf.example b/piglit.conf.example
index 56eb83d..17f2329 100644
--- a/piglit.conf.example
+++ b/piglit.conf.example
@@ -170,6 +170,13 @@ run_test=./%(test_name)s
 ; Default: 'bz2'
 ;compression=bz2
 
+; Set this value to change whether piglit defaults to using process isolation
+; or not. Care should be taken when using this option since it provides a
+; performance improvement, but with a cost in stability and reproducibility.
+; 
+; Default: True
+;process isolation=True
+
 [expected-failures]
 ; Provide a list of test names that are expected to fail.  These tests
 ; will be listed as passing in JUnit output when they fail.  Any
diff --git a/tests/all.py b/tests/all.py
index 278286d..2382054 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4,22 +4,27 @@
 from __future__ import (
 absolute_import, division, print_function, unicode_literals
 )
+import collections
 import itertools
 import os
 import platform
 
+import six
 from six.moves import range
 
 from framework import grouptools
+from framework import options
 from framework.profile import TestProfile
-from framework.test import (PiglitGLTest, GleanTest, ShaderTest, 
PiglitBaseTest,
-GLSLParserTest, GLSLParserNoConfigError)
 from framework.driver_classifier import DriverClassifier
-
+from framework.test import (PiglitGLTest, GleanTest, PiglitBaseTest,
+GLSLParserTest, GLSLParserNoConfigError)
+from framework.test.shader_test import Sha

[Piglit] [PATCH v2 13/16] squash! shader_runner: add ability to run multiple tests per process

2016-09-30 Thread Dylan Baker
These are changes since version 1, again split out for easier review.

 - use glClearDepthf for GL ES instead of glClearDepth, which doesn't
   exist in GLES
 - Never attempt to disable GL_PROGRAM_POINT_SIZE in OpenGL ES (which
   causes failures, and I can't seem to find any evidence of it's
   existence in ES)
 - Don't call glMatrixMode in GLES (which I also can't find references
   to in the spec).
 - disable clip panes based on GL_MAX_CLIP_PLANES, rather than assuming
   the number of planes. This fixes tests on i965/gen4 hardware
 - Fix patching of tessellation shaders for ES 3.2 and with
   OES_tessellation_shader
 - Move check for argc < 2 before OpenGL calls
 - Set num_uniform_blocks to 0 when tearing down UBOs
---

This patch in new in v2

 tests/shaders/shader_runner.c | 66 +---
 1 file changed, 40 insertions(+), 26 deletions(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 50bda7c..6323c64 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -2806,6 +2806,7 @@ teardown_ubos(void)
glDeleteBuffers(num_uniform_blocks, uniform_block_bos);
free(uniform_block_bos);
uniform_block_bos = NULL;
+   num_uniform_blocks = 0;
 }
 
 static enum piglit_result
@@ -3589,6 +3590,10 @@ piglit_init(int argc, char **argv)
float default_piglit_tolerance[4];
 
report_subtests = piglit_strip_arg(, argv, "-report-subtests");
+   if (argc < 2) {
+   printf("usage: shader_runner \n");
+   exit(1);
+   }
 
memcpy(default_piglit_tolerance, piglit_tolerance,
   sizeof(piglit_tolerance));
@@ -3621,7 +3626,6 @@ piglit_init(int argc, char **argv)
piglit_is_extension_supported("GL_EXT_geometry_shader4"))
glGetIntegerv(GL_MAX_VARYING_COMPONENTS,
  _max_varying_components);
-   glGetIntegerv(GL_MAX_CLIP_PLANES, _max_clip_planes);
 #else
glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS,
  _max_fragment_uniform_components);
@@ -3632,8 +3636,9 @@ piglit_init(int argc, char **argv)
gl_max_fragment_uniform_components *= 4;
gl_max_vertex_uniform_components *= 4;
gl_max_varying_components *= 4;
-   gl_max_clip_planes = 0;
 #endif
+   glGetIntegerv(GL_MAX_CLIP_PLANES, _max_clip_planes);
+
if (gl_version.num >= 20 ||
piglit_is_extension_supported("GL_ARB_vertex_shader"))
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS,
@@ -3641,16 +3646,11 @@ piglit_init(int argc, char **argv)
else
gl_max_vertex_attribs = 16;
 
-   if (argc < 2) {
-   printf("usage: shader_runner \n");
-   exit(1);
-   }
-
render_width = piglit_width;
render_height = piglit_height;
 
/* Automatic mode can run multiple tests per session. */
-   if (piglit_automatic) {
+   if (report_subtests) {
char testname[4096], *ext;
int i, j;
 
@@ -3705,33 +3705,29 @@ piglit_init(int argc, char **argv)
 
/* Clear GL states to defaults. */
glClearColor(0, 0, 0, 0);
+# if PIGLIT_USE_OPENGL
glClearDepth(1);
+# else
+   glClearDepthf(1.0);
+# endif
glBindFramebuffer(GL_FRAMEBUFFER, piglit_winsys_fbo);
glActiveTexture(GL_TEXTURE0);
glUseProgram(0);
glDisable(GL_DEPTH_TEST);
glBindBuffer(GL_ARRAY_BUFFER, 0);
-   glDisable(GL_CLIP_PLANE0);
-   glDisable(GL_CLIP_PLANE1);
-   glDisable(GL_CLIP_PLANE2);
-   glDisable(GL_CLIP_PLANE3);
-   glDisable(GL_CLIP_PLANE4);
-   glDisable(GL_CLIP_PLANE5);
-   if (es || gl_version.num >= 30) {
-   glDisable(GL_CLIP_PLANE0+6);
-   glDisable(GL_CLIP_PLANE0+7);
+
+   for (int k = 0; k < gl_max_clip_planes; k++) {
+   glDisable(GL_CLIP_PLANE0 + k);
}
 
-   if (es)
-   glEnable(GL_PROGRAM_POINT_SIZE);
-   else if (gl_version.num >= 20 ||
-
piglit_is_extension_supported("GL_ARB_vertex_program"))
+   if (!(es) && (gl_version.num >= 20 ||
+
piglit_is_extension_supported("GL_ARB_vertex_program")))
glDisable(GL_PROGRAM_POINT_SIZE);
 
for (int i = 0; i < 16; i++)
glDisableVertexAttribArray(i);
 
-   if (!piglit_is_core_profile) {
+   if (!piglit_is_core_profile && !es) {
   

[Piglit] [PATCH v2 2/16] framework: Split the file parsing code out of ShaderTest

2016-09-30 Thread Dylan Baker
This is both nicer since it provides better code quality (a separation
of roles), and because it's going to make writing a shader_test class
that can do N:1 tests much easier.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 framework/test/shader_test.py | 106 ++-
 1 file changed, 68 insertions(+), 38 deletions(-)

diff --git a/framework/test/shader_test.py b/framework/test/shader_test.py
index e67c5ed..2b14f17 100644
--- a/framework/test/shader_test.py
+++ b/framework/test/shader_test.py
@@ -38,13 +38,9 @@ __all__ = [
 ]
 
 
-class ShaderTest(FastSkipMixin, PiglitBaseTest):
-""" Parse a shader test file and return a PiglitTest instance
-
-This function parses a shader test to determine if it's a GL, GLES2 or
-GLES3 test, and then returns a PiglitTest setup properly.
+class Parser(object):
+"""An object responsible for parsing a shader_test file."""
 
-"""
 _is_gl = re.compile(r'GL (<|<=|=|>=|>) \d\.\d')
 _match_gl_version = re.compile(
 r'^GL\s+(?PES)?\s*(?P(<|<=|=|>=|>))\s*(?P\d\.\d)')
@@ -52,20 +48,23 @@ class ShaderTest(FastSkipMixin, PiglitBaseTest):
 r'^GLSL\s+(?PES)?\s*(?P(<|<=|=|>=|>))\s*(?P\d\.\d+)')
 
 def __init__(self, filename):
-gl_required = set()
-gl_version = None
-gles_version = None
-glsl_version = None
-glsl_es_version = None
-op = None
-sl_op = None
-
+self.filename = filename
+self.gl_required = set()
+self._gl_version = None
+self._gles_version = None
+self._glsl_version = None
+self._glsl_es_version = None
+self.prog = None
+self.__op = None
+self.__sl_op = None
+
+def parse(self):
 # Iterate over the lines in shader file looking for the config section.
 # By using a generator this can be split into two for loops at minimal
 # cost. The first one looks for the start of the config block or raises
 # an exception. The second looks for the GL version or raises an
 # exception
-with io.open(filename, mode='r', encoding='utf-8') as shader_file:
+with io.open(self.filename, mode='r', encoding='utf-8') as shader_file:
 # The mock in python 3.3 doesn't support readlines(), so use
 # read().split() as a workaround
 lines = (l for l in shader_file.read().split('\n'))
@@ -80,33 +79,33 @@ class ShaderTest(FastSkipMixin, PiglitBaseTest):
 break
 else:
 raise exceptions.PiglitFatalError(
-"In file {}: Config block not found".format(filename))
+"In file {}: Config block not found".format(self.filename))
 
 for line in lines:
 if line.startswith('GL_') and not line.startswith('GL_MAX'):
-gl_required.add(line.strip())
+self.gl_required.add(line.strip())
 continue
 
 # Find any GLES requirements.
-if not (gl_version or gles_version):
+if not (self._gl_version or self._gles_version):
 m = self._match_gl_version.match(line)
 if m:
-op = m.group('op')
+self.__op = m.group('op')
 if m.group('es'):
-gles_version = float(m.group('ver'))
+self._gles_version = float(m.group('ver'))
 else:
-gl_version = float(m.group('ver'))
+self._gl_version = float(m.group('ver'))
 continue
 
-if not (glsl_version or glsl_es_version):
+if not (self._glsl_version or self._glsl_es_version):
 # Find any GLSL requirements
 m = self._match_glsl_version.match(line)
 if m:
-sl_op = m.group('op')
+self.__sl_op = m.group('op')
 if m.group('es'):
-glsl_es_version = float(m.group('ver'))
+self._glsl_es_version = float(m.group('ver'))
 else:
-glsl_version = float(m.group('ver'))
+self._glsl_version = float(m.group('ver'))
 continue
 
 if line.startswith('['):
@@ -115,24 +114,55 @@ class ShaderTest(FastSkipMixin, PiglitBaseTest):
 # Select the correct binary to run the test, but be as conservative as
 # possible by always selecting the lowest version that meets the
 # criteria.
-if gles_version:
-if op in ['<', '<='] or op in ['=', '>='] and gles_version < 3:
-prog = 'shader_runner_gles2'
+if self._gles_version:
+

[Piglit] [PATCH v2 8/16] util: always set piglit_is_core_profile

2016-09-30 Thread Dylan Baker
From: Marek Olk 

---
 tests/util/piglit-framework-gl/piglit_glut_framework.c | 7 ---
 tests/util/piglit-framework-gl/piglit_wfl_framework.c  | 2 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/util/piglit-framework-gl/piglit_glut_framework.c 
b/tests/util/piglit-framework-gl/piglit_glut_framework.c
index 075ee0d..8ac2f65 100644
--- a/tests/util/piglit-framework-gl/piglit_glut_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_glut_framework.c
@@ -391,9 +391,10 @@ piglit_glut_framework_create(const struct 
piglit_gl_test_config *test_config)
 /* Check if we actually have a core profile */
{
int actual_version = piglit_get_gl_version();
-   if (actual_version >= 31 &&
-   !piglit_is_extension_supported("GL_ARB_compatibility"))
-   piglit_is_core_profile = true;
+
+   piglit_is_core_profile =
+   actual_version >= 31 &&
+   !piglit_is_extension_supported("GL_ARB_compatibility");
}
 
if (!check_gl_version(test_config))
diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c 
b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index 65174da..d312ef9 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -544,6 +544,8 @@ make_context_current(struct piglit_wfl_framework *wfl_fw,
}
}
 
+   piglit_is_core_profile = false;
+
if (test_config->supports_gl_core_version &&
test_config->supports_gl_compat_version) {
/* The above attempt to create a core context failed. */
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 7/16] util: guard against double context destruction

2016-09-30 Thread Dylan Baker
From: Marek Olk 

this no longer crashes:
- create context (calls atexit)
- teardown context
- create context 2 (calls atexit)
- exit()
---
 tests/util/piglit-framework-gl.c | 4 
 1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/tests/util/piglit-framework-gl.c b/tests/util/piglit-framework-gl.c
index 1c25f2c..001b23a 100644
--- a/tests/util/piglit-framework-gl.c
+++ b/tests/util/piglit-framework-gl.c
@@ -177,8 +177,12 @@ piglit_gl_process_args(int *argc, char *argv[],
 static void
 destroy(void)
 {
+   if (!gl_fw)
+   return;
+
if (gl_fw->destroy)
gl_fw->destroy(gl_fw);
+   gl_fw = NULL;
 }
 
 void
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 1/16] framework/results: Lower subtest names

2016-09-30 Thread Dylan Baker
This makes the behavior of the Subtests class more like that of the
TestDict class, and fixes a bug in MultiShaderRunner, which will be
added in a subsequent patch in this series.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 framework/results.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/framework/results.py b/framework/results.py
index 2095d90..756d261 100644
--- a/framework/results.py
+++ b/framework/results.py
@@ -47,13 +47,13 @@ class Subtests(collections.MutableMapping):
 self.update(dict_)
 
 def __setitem__(self, name, value):
-self.__container[name] = status.status_lookup(value)
+self.__container[name.lower()] = status.status_lookup(value)
 
 def __getitem__(self, name):
-return self.__container[name]
+return self.__container[name.lower()]
 
 def __delitem__(self, name):
-del self.__container[name]
+del self.__container[name.lower()]
 
 def __iter__(self):
 return iter(self.__container)
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 0/16] Add support for shader_runner to run more than one test per process

2016-09-30 Thread Dylan Baker
This allows shader_runner to consume more than one test at a time. When
it does this it reports the results as subtests rather than as regular
tests. It also updates the python framework to handle and resume from
crashes in the tests. When this mode is enabled, shader_runner runs an
entire directory of shader_test files at a time.

This makes shader_runner (which takes up the bulk of piglit) run much
faster, even compared to per-process with fast skipping enabled, but at
the cost of the robustness and reproducibility of process isolation. For that
reason its an option that must be enabled, the default should always be
robustness not speed. This can be turned on permanently on in piglit.conf.

>From a performance standpoint it's impressive (this is a 4 thread HSW):
PIGLIT_NO_FAST_SKIP=1 ./piglit run shader ns_w_is -c
936.35s user 611.18s system 301% cpu 8:33.71 total
./piglit run shader fs_w_is -c
726.21s user 398.25s system 306% cpu 6:07.23 total
PIGLIT_NO_FAST_SKIP=1 ./piglit run shader ns_no_is -c --process-isolation=false
334.21s user 122.04s system 201% cpu 3:46.55 total
./piglit run shader fs_no_is -c --process-isolation=false
160.47s user 7.83s system 293% cpu 57.327 total

For the general use case (With fast skipping) this is a reduction of 5
minutes of runtime.

This work is part mine, and partially from Marek.

Changes since v1:
 - Add the second squash! commit, which is all v1 changes

The biggest changes are fixing more GL vs GLES differences, doing all of
our guarding at the front of the function, and doing a better job
cleaning up between tests.

Dylan Baker (10):
  framework/results: Lower subtest names
  framework: Split the file parsing code out of ShaderTest
  framework: Split FastSkipMixin.
  framework: Bump JSON on disk format to version 9
  framework: Add a Mixin class for running multiple tests in a single process
  squash! shader_runner: add ability to run multiple tests per process
  squash! shader_runner: add ability to run multiple tests per process
  framework: Add class for running multiple shader_tests in a single process
  framework: Plug in fast-skipping to MultiShaderTest
  framework: add boilerplate to turn off process isolation

Marek Olk (6):
  shader_runner: propagate all errors to piglit_init
  util: guard against double context destruction
  util: always set piglit_is_core_profile
  util: rename 
piglit_gl_reinitialize_extensions->piglit_gl_invalidate_extensions
  util: move PIGLIT_PATH_SEP to piglit-util.h
  shader_runner: add ability to run multiple tests per process

 framework/backends/json.py |  18 +-
 framework/options.py   |   1 +-
 framework/programs/run.py  |  23 +-
 framework/results.py   |   8 +-
 framework/test/base.py | 155 ++-
 framework/test/deqp.py |   4 +-
 framework/test/opengl.py   | 182 ++-
 framework/test/shader_test.py  | 201 ++-
 piglit.conf.example|   7 +-
 tests/all.py   |  37 +-
 tests/shader.py|   4 +-
 tests/shaders/shader_runner.c  | 582 +++---
 tests/util/piglit-framework-gl.c   |   4 +-
 tests/util/piglit-framework-gl/piglit_glut_framework.c |   7 +-
 tests/util/piglit-framework-gl/piglit_wfl_framework.c  |   5 +-
 tests/util/piglit-util-gl.c|   2 +-
 tests/util/piglit-util-gl.h|   2 +-
 tests/util/piglit-util.c   |   6 +-
 tests/util/piglit-util.h   |   6 +-
 unittests/framework/backends/schema/piglit-9.json  | 122 ++-
 unittests/framework/backends/shared.py |   4 +-
 unittests/framework/backends/test_json_update.py   |  85 +-
 unittests/framework/test/test_base.py  | 138 +-
 unittests/framework/test/test_opengl.py| 192 +--
 unittests/framework/test/test_shader_test.py   |  63 +-
 25 files changed, 1533 insertions(+), 325 deletions(-)
 create mode 100644 unittests/framework/backends/schema/piglit-9.json

-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 9/16] util: rename piglit_gl_reinitialize_extensions->piglit_gl_invalidate_extensions

2016-09-30 Thread Dylan Baker
From: Marek Olk 

---
 tests/util/piglit-framework-gl/piglit_wfl_framework.c | 3 ++-
 tests/util/piglit-util-gl.c   | 2 +-
 tests/util/piglit-util-gl.h   | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c 
b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index d312ef9..5968459 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -508,6 +508,7 @@ make_context_current_singlepass(struct piglit_wfl_framework 
*wfl_fw,
if (!ok)
goto fail;
 
+   piglit_gl_invalidate_extensions();
return true;
 
 fail:
@@ -520,7 +521,7 @@ fail:
wfl_fw->context = NULL;
wfl_fw->config = NULL;
 
-   piglit_gl_reinitialize_extensions();
+   piglit_gl_invalidate_extensions();
 
return false;
 }
diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index 75d634c..95eadd0 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -115,7 +115,7 @@ static void initialize_piglit_extension_support(void)
}
 }
 
-void piglit_gl_reinitialize_extensions()
+void piglit_gl_invalidate_extensions()
 {
if (gl_extensions != NULL) {
free(gl_extensions);
diff --git a/tests/util/piglit-util-gl.h b/tests/util/piglit-util-gl.h
index b416e50..78390c1 100644
--- a/tests/util/piglit-util-gl.h
+++ b/tests/util/piglit-util-gl.h
@@ -74,7 +74,7 @@ bool piglit_is_extension_supported(const char *name);
 /**
  * reinitialize the supported extension List.
  */
-void piglit_gl_reinitialize_extensions();
+void piglit_gl_invalidate_extensions();
 
 /**
  * \brief Convert a GL error to a string.
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 4/16] framework: Bump JSON on disk format to version 9

2016-09-30 Thread Dylan Baker
This change makes the TestResult.pid field into a list of ints instead
of a list. This will be used by the multiple test per process tests to
ensure that all PIDs are recorded when the cherry features is invoked.

This is groundwork for later patches in the series.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 framework/backends/json.py|  18 +-
 framework/results.py  |   2 +-
 framework/test/base.py|   2 +-
 unittests/framework/backends/schema/piglit-9.json | 122 +++-
 unittests/framework/backends/shared.py|   4 +-
 unittests/framework/backends/test_json_update.py  |  85 ++-
 6 files changed, 228 insertions(+), 5 deletions(-)
 create mode 100644 unittests/framework/backends/schema/piglit-9.json

diff --git a/framework/backends/json.py b/framework/backends/json.py
index 69f5319..f279f2f 100644
--- a/framework/backends/json.py
+++ b/framework/backends/json.py
@@ -53,7 +53,7 @@ __all__ = [
 ]
 
 # The current version of the JSON results
-CURRENT_JSON_VERSION = 8
+CURRENT_JSON_VERSION = 9
 
 # The level to indent a final file
 INDENT = 4
@@ -339,6 +339,7 @@ def _update_results(results, filepath):
 5: _update_five_to_six,
 6: _update_six_to_seven,
 7: _update_seven_to_eight,
+8: _update_eight_to_nine,
 }
 
 while results.results_version < CURRENT_JSON_VERSION:
@@ -636,6 +637,21 @@ def _update_seven_to_eight(result):
 return result
 
 
+def _update_eight_to_nine(result):
+"""Update json results from version 8 to 9.
+
+This changes the PID feild of the TestResult object to alist of Integers or
+null rather than a single integer or null.
+
+"""
+for test in compat.viewvalues(result.tests):
+test.pid = [test.pid]
+
+result.results_version = 9
+
+return result
+
+
 REGISTRY = Registry(
 extensions=['', '.json'],
 backend=JSONBackend,
diff --git a/framework/results.py b/framework/results.py
index 756d261..f9ddcb4 100644
--- a/framework/results.py
+++ b/framework/results.py
@@ -162,7 +162,7 @@ class TestResult(object):
 self.images = None
 self.traceback = None
 self.exception = None
-self.pid = None
+self.pid = []
 if result:
 self.result = result
 else:
diff --git a/framework/test/base.py b/framework/test/base.py
index 63fcaf4..b667b15 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -322,7 +322,7 @@ class Test(object):
 universal_newlines=True,
 **_EXTRA_POPEN_ARGS)
 
-self.result.pid = proc.pid
+self.result.pid.append(proc.pid)
 if not _SUPPRESS_TIMEOUT:
 out, err = proc.communicate(timeout=self.timeout)
 else:
diff --git a/unittests/framework/backends/schema/piglit-9.json 
b/unittests/framework/backends/schema/piglit-9.json
new file mode 100644
index 000..1d401ae
--- /dev/null
+++ b/unittests/framework/backends/schema/piglit-9.json
@@ -0,0 +1,122 @@
+{
+"$schema": "http://json-schema.org/draft-04/schema#;,
+"title": "TestrunResult",
+"description": "The collection of all results",
+"type": "object",
+"properties": {
+"__type__": { "type": "string" },
+"clinfo": { "type": ["string", "null"] },
+"glxinfo": { "type": ["string", "null"] },
+"lspci": { "type": ["string", "null"] },
+"wglinfo": { "type": ["string", "null"] },
+"name": { "type": "string" },
+"results_version": { "type": "number" },
+"uname": { "type": [ "string", "null" ] },
+"time_elapsed": { "$ref": "#/definitions/timeAttribute" },
+"options": {
+"descrption": "The options that were invoked with this run. These 
are implementation specific and not required.",
+"type": "object",
+"properties": {
+"exclude_tests": { 
+"type": "array",
+"items": { "type": "string" },
+"uniqueItems": true
+},
+"include_filter": { 
+"type": "array",
+"items": { "type": "string" }
+},
+  

[Piglit] [PATCH v2 11/16] shader_runner: add ability to run multiple tests per process

2016-09-30 Thread Dylan Baker
From: Marek Olk 

The performance is measured by running these:
spec/glsl-1.30/execution/built-in-functions/ (1420 tests)

Running piglit-run.py using the old way: 98 s
Running .../shader_runner *.shader_test:  8 s

It's more than 12x faster!!

The tests being run must be compatible. (we can't mix core, compat, and ES
tests) Thus, running shader_runner once per each spec/ directory should
be OK.

The context-window combo is destroyed and re-created with a different
configuration when test requirements demand it.

shader_runner tries to re-set all states between tests to prevent side
effects.

shader_runner isn't immune to crashes. The python framework must re-launch
shader_runner to run the remaining tests.
---
 tests/shaders/shader_runner.c | 226 ++-
 1 file changed, 221 insertions(+), 5 deletions(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 4c52194..eeab08a 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -28,10 +28,16 @@
 #include "piglit-util.h"
 #include "piglit-util-gl.h"
 #include "piglit-vbo.h"
+#include "piglit-framework-gl/piglit_gl_framework.h"
 
 #include "shader_runner_gles_workarounds.h"
 #include "parser_utils.h"
 
+#define DEFAULT_WINDOW_WIDTH 250
+#define DEFAULT_WINDOW_HEIGHT 250
+
+static struct piglit_gl_test_config current_config;
+
 static void
 get_required_config(const char *script_name,
struct piglit_gl_test_config *config);
@@ -43,8 +49,8 @@ get_uints(const char *line, unsigned *uints, unsigned count);
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.window_width = 250;
-   config.window_height = 250;
+   config.window_width = DEFAULT_WINDOW_WIDTH;
+   config.window_height = DEFAULT_WINDOW_HEIGHT;
config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
 
if (argc > 1)
@@ -52,6 +58,8 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
else
config.supports_gl_compat_version = 10;
 
+   current_config = config;
+
 PIGLIT_GL_TEST_CONFIG_END
 
 static const char passthrough_vertex_shader_source[] =
@@ -84,6 +92,7 @@ struct string_to_enum {
 
 extern float piglit_tolerance[4];
 
+static int test_num = 1;
 static struct component_version gl_version;
 static struct component_version glsl_version;
 static struct component_version glsl_req_version;
@@ -3477,6 +3486,62 @@ init_test(const char *file)
return PIGLIT_PASS;
 }
 
+static void
+recreate_gl_context(char *exec_arg, int param_argc, char **param_argv)
+{
+   int argc = param_argc + 3;
+   char **argv = malloc(sizeof(char*) * argc);
+
+   if (!argv) {
+   fprintf(stderr, "%s: malloc failed.\n", __func__);
+   piglit_report_result(PIGLIT_FAIL);
+   }
+
+   argv[0] = exec_arg;
+   memcpy([1], param_argv, param_argc * sizeof(char*));
+   argv[argc-2] = "-auto";
+   argv[argc-1] = "-fbo";
+
+   if (gl_fw->destroy)
+   gl_fw->destroy(gl_fw);
+   gl_fw = NULL;
+
+   exit(main(argc, argv));
+}
+
+static bool
+validate_current_gl_context(const char *filename)
+{
+   struct piglit_gl_test_config config = {};
+
+   config.window_width = DEFAULT_WINDOW_WIDTH;
+   config.window_height = DEFAULT_WINDOW_HEIGHT;
+
+   get_required_config(filename, );
+
+   if (!current_config.supports_gl_compat_version !=
+   !config.supports_gl_compat_version)
+   return false;
+
+   if (!current_config.supports_gl_core_version !=
+   !config.supports_gl_core_version)
+   return false;
+
+   if (!current_config.supports_gl_es_version !=
+   !config.supports_gl_es_version)
+   return false;
+
+   if (current_config.window_width != config.window_width ||
+   current_config.window_height != config.window_height)
+   return false;
+
+   if (!(current_config.window_visual & PIGLIT_GL_VISUAL_DEPTH) &&
+   config.window_visual & PIGLIT_GL_VISUAL_DEPTH)
+   return false;
+
+   return true;
+}
+
 void
 piglit_init(int argc, char **argv)
 {
@@ -3485,6 +3550,10 @@ piglit_init(int argc, char **argv)
bool core = piglit_is_core_profile;
bool es;
enum piglit_result result;
+   float default_piglit_tolerance[4];
+
+   memcpy(default_piglit_tolerance, piglit_tolerance,
+  sizeof(piglit_tolerance));
 
piglit_require_GLSL();
 
@@ -3539,11 +3608,158 @@ piglit_init(int argc, char **argv)
exit(1);
}
 
+   render_width = piglit_width;
+   render_height = piglit_height;
+
+   /* Automatic mode can run multiple tests per session. */
+   if (piglit_automatic) {
+   char testname[4096], *ext;
+   int i, j;
+
+   for (i = 1; i < argc; i++) {
+   const char *hit, *filename = argv[i];
+
+   

[Piglit] [PATCH v2 10/16] util: move PIGLIT_PATH_SEP to piglit-util.h

2016-09-30 Thread Dylan Baker
From: Marek Olk 

---
 tests/util/piglit-util.c | 6 --
 tests/util/piglit-util.h | 6 ++
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c
index 0a66a85..6ed9c9c 100644
--- a/tests/util/piglit-util.c
+++ b/tests/util/piglit-util.c
@@ -533,12 +533,6 @@ piglit_source_dir(void)
 return s;
 }
 
-#ifdef _WIN32
-#  define PIGLIT_PATH_SEP '\\'
-#else
-#  define PIGLIT_PATH_SEP '/'
-#endif
-
 size_t
 piglit_join_paths(char buf[], size_t buf_size, int n, ...)
 {
diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
index 4328863..ac8eb88 100644
--- a/tests/util/piglit-util.h
+++ b/tests/util/piglit-util.h
@@ -131,6 +131,12 @@ ffs(int i)
 #endif /* !__MINGW32__ */
 #endif /* !HAVE_FFS*/
 
+#ifdef _WIN32
+#  define PIGLIT_PATH_SEP '\\'
+#else
+#  define PIGLIT_PATH_SEP '/'
+#endif
+
 enum piglit_result {
PIGLIT_PASS,
PIGLIT_FAIL,
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 6/16] shader_runner: propagate all errors to piglit_init

2016-09-30 Thread Dylan Baker
From: Marek Olk 

piglit_report_result prevents running multiple tests per process.
---
 tests/shaders/shader_runner.c | 229 +--
 1 file changed, 139 insertions(+), 90 deletions(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index fe91e34..4c52194 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -360,7 +360,7 @@ target_to_short_name(GLenum target)
 }
 
 
-static void
+static enum piglit_result
 compile_glsl(GLenum target)
 {
GLuint shader = glCreateShader(target);
@@ -368,33 +368,42 @@ compile_glsl(GLenum target)
 
switch (target) {
case GL_VERTEX_SHADER:
-   piglit_require_vertex_shader();
+   if (piglit_get_gl_version() < 20 &&
+   !(piglit_is_extension_supported("GL_ARB_shader_objects") &&
+ piglit_is_extension_supported("GL_ARB_vertex_shader")))
+   return PIGLIT_SKIP;
break;
case GL_FRAGMENT_SHADER:
-   piglit_require_fragment_shader();
+   if (piglit_get_gl_version() < 20 &&
+   !(piglit_is_extension_supported("GL_ARB_shader_objects") &&
+ piglit_is_extension_supported("GL_ARB_fragment_shader")))
+   return PIGLIT_SKIP;
break;
case GL_TESS_CONTROL_SHADER:
case GL_TESS_EVALUATION_SHADER:
if (gl_version.num < (gl_version.es ? 32 : 40))
-   piglit_require_extension(gl_version.es ?
-"GL_OES_tessellation_shader" :
-"GL_ARB_tessellation_shader");
+   if (!piglit_is_extension_supported(gl_version.es ?
+  
"GL_OES_tessellation_shader" :
+  
"GL_ARB_tessellation_shader"))
+   return PIGLIT_SKIP;
break;
case GL_GEOMETRY_SHADER:
if (gl_version.num < 32)
-   piglit_require_extension(gl_version.es ?
-"GL_OES_geometry_shader" :
-"GL_ARB_geometry_shader4");
+   if (!piglit_is_extension_supported(gl_version.es ?
+  
"GL_OES_geometry_shader" :
+  
"GL_ARB_geometry_shader4"))
+   return PIGLIT_SKIP;
break;
case GL_COMPUTE_SHADER:
if (gl_version.num < (gl_version.es ? 31 : 43))
-   piglit_require_extension("GL_ARB_compute_shader");
+   if 
(!piglit_is_extension_supported("GL_ARB_compute_shader"))
+   return PIGLIT_SKIP;
break;
}
 
if (!glsl_req_version.num) {
printf("GLSL version requirement missing\n");
-   piglit_report_result(PIGLIT_FAIL);
+   return PIGLIT_FAIL;
}
 
if (!strstr(shader_string, "#version ")) {
@@ -441,7 +450,7 @@ compile_glsl(GLenum target)
info);
 
free(info);
-   piglit_report_result(PIGLIT_FAIL);
+   return PIGLIT_FAIL;
}
 
switch (target) {
@@ -470,9 +479,10 @@ compile_glsl(GLenum target)
num_compute_shaders++;
break;
}
+   return PIGLIT_PASS;
 }
 
-static void
+static enum piglit_result
 compile_and_bind_program(GLenum target, const char *start, int len)
 {
GLuint prog;
@@ -480,10 +490,12 @@ compile_and_bind_program(GLenum target, const char 
*start, int len)
 
switch (target) {
case GL_VERTEX_PROGRAM_ARB:
-   piglit_require_extension("GL_ARB_vertex_program");
+   if (!piglit_is_extension_supported("GL_ARB_vertex_program"))
+   return PIGLIT_SKIP;
break;
case GL_FRAGMENT_PROGRAM_ARB:
-   piglit_require_extension("GL_ARB_fragment_program");
+   if (!piglit_is_extension_supported("GL_ARB_fragment_program"))
+   return PIGLIT_SKIP;
break;
}
 
@@ -496,9 +508,11 @@ compile_and_bind_program(GLenum target, const char *start, 
int len)
glBindProgramARB(target, prog);
link_ok = true;
prog_in_use = true;
+
+   return PIGLIT_PASS;
 }
 
-static void
+static enum piglit_result
 link_sso(GLenum target)
 {
GLint ok;
@@ -521,9 +535,7 @@ link_sso(GLenum target)
prog_err_info);
 
free(prog_err_info);
-   piglit_report_result(PIGLIT_FAIL);
-
-   return;
+   return PIGLIT_FAIL;
 

[Piglit] [PATCH v2 3/16] framework: Split FastSkipMixin.

2016-09-30 Thread Dylan Baker
This splits the FastSkipMixin into two classes. One that actually does
the fast skipping, and one that provides a mixin for Test.

This split will allow the class to be used in the traditional way, but
also in shader_test.MultiShaderTest.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 framework/test/opengl.py| 182 ++--
 unittests/framework/test/test_opengl.py | 192 ++---
 2 files changed, 251 insertions(+), 123 deletions(-)

diff --git a/framework/test/opengl.py b/framework/test/opengl.py
index 6fe8670..e19e437 100644
--- a/framework/test/opengl.py
+++ b/framework/test/opengl.py
@@ -37,6 +37,7 @@ from .base import TestIsSkip
 # pylint: disable=too-few-public-methods
 
 __all__ = [
+'FastSkip',
 'FastSkipMixin',
 ]
 
@@ -287,23 +288,11 @@ class WflInfo(object):
 return ret
 
 
-class FastSkipMixin(object):
-"""Fast test skipping for OpenGL based suites.
-
-This provides an is_skip() method which will skip the test if an of it's
-requirements are not met.
+class FastSkip(object):
+"""A class for testing OpenGL requirements.
 
-It also provides new attributes:
-gl_reqruied -- This is a set of extensions that are required for running
-   the extension.
-gl_version -- A float that is the required version number for an OpenGL
-  test.
-gles_version -- A float that is the required version number for an OpenGL
-ES test
-glsl_version -- A float that is the required version number of OpenGL
-Shader Language for a test
-glsl_ES_version -- A float that is the required version number of OpenGL ES
-   Shader Language for a test
+This class provides a mechanism for testing OpenGL requirements, and
+skipping tests that have unmet requirements
 
 This requires wflinfo to be installed and accessible to provide it's
 functionality, however, it will no-op if wflinfo is not accessible.
@@ -312,75 +301,186 @@ class FastSkipMixin(object):
 it is better to run a few tests that could have been skipped, than to skip
 all the tests that could have, but also a few that should have run.
 
+Keyword Arguments:
+gl_reqruied -- This is a set of extensions that are required for
+   running the extension.
+gl_version  -- A float that is the required version number for an
+   OpenGL test.
+gles_version-- A float that is the required version number for an
+   OpenGL ES test
+glsl_version-- A float that is the required version number of OpenGL
+   Shader Language for a test
+glsl_es_version -- A float that is the required version number of OpenGL ES
+   Shader Language for a test
 """
-# XXX: This still gets called once for each thread. (4 times with 4
-# threads), this is a synchronization issue and I don't know how to stop it
-# other than querying each value before starting the thread pool.
-__info = WflInfo()
+__slots__ = ['gl_required', 'gl_version', 'gles_version', 'glsl_version',
+ 'glsl_es_version']
 
-def __init__(self, command, gl_required=None, gl_version=None,
- gles_version=None, glsl_version=None, glsl_es_version=None,
- **kwargs):  # pylint: disable=too-many-arguments
-super(FastSkipMixin, self).__init__(command, **kwargs)
+info = WflInfo()
+
+def __init__(self, gl_required=None, gl_version=None, gles_version=None,
+ glsl_version=None, glsl_es_version=None):
 self.gl_required = gl_required or set()
 self.gl_version = gl_version
 self.gles_version = gles_version
 self.glsl_version = glsl_version
 self.glsl_es_version = glsl_es_version
 
-def is_skip(self):
+def test(self):
 """Skip this test if any of it's feature requirements are unmet.
 
 If no extensions were calculated (if wflinfo isn't installed) then run
 all tests.
 
+Raises:
+TestIsSkip   -- if any of the conditions passed to self are false
 """
-if self.__info.gl_extensions:
+if self.info.gl_extensions:
 for extension in self.gl_required:
-if extension not in self.__info.gl_extensions:
+if extension not in self.info.gl_extensions:
 raise TestIsSkip(
 'Test requires extension {} '
 'which is not available'.format(extension))
 
 # TODO: Be able to handle any operator
-if (self.__info.gl_version is not None
+if (self.info.gl_version is not None
 and self.gl_version is not None
-and self.gl_version > self.__info.gl_version):
+  

[Piglit] [PATCH 1/2] tests: remove unused variable from ext_image_dma_buf_import/refcount

2016-09-30 Thread Dylan Baker
tests/spec/ext_image_dma_buf_import/refcount.c:59:6: warning: unused variable 
‘cpp’
  int cpp = 4;
  ^~~

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/spec/ext_image_dma_buf_import/refcount.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tests/spec/ext_image_dma_buf_import/refcount.c 
b/tests/spec/ext_image_dma_buf_import/refcount.c
index bc15ff5..7ea200e 100644
--- a/tests/spec/ext_image_dma_buf_import/refcount.c
+++ b/tests/spec/ext_image_dma_buf_import/refcount.c
@@ -56,7 +56,6 @@ piglit_display(void)
0xff, 0x00, 0x00, 0xff,
0xff, 0xff, 0xff, 0xff
};
-   int cpp = 4;
enum piglit_result res;
struct piglit_dma_buf *buf;
EGLImageKHR img1, img2;
-- 
2.10.0

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


[Piglit] [PATCH 2/2] tests: fix unused variable in gles versions of arb_viewport_array/queries

2016-09-30 Thread Dylan Baker
tests/spec/arb_viewport_array/queries.c: In function ‘piglit_init’:
tests/spec/arb_viewport_array/queries.c:58:11: warning: unused variable ‘vald’
  GLdouble vald[4] = {0.0, 0.0, 0.0, 0.0};

Which is only used if compiled with OpenGL support, but not when
compiled for GLES.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/spec/arb_viewport_array/queries.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/spec/arb_viewport_array/queries.c 
b/tests/spec/arb_viewport_array/queries.c
index 2b10b3a..4973931 100644
--- a/tests/spec/arb_viewport_array/queries.c
+++ b/tests/spec/arb_viewport_array/queries.c
@@ -55,7 +55,9 @@ piglit_init(int argc, char **argv)
bool pass = true;
GLint maxVP;
GLboolean scEnabled;
+#ifdef PIGLIT_USE_OPENGL
GLdouble vald[4] = {0.0, 0.0, 0.0, 0.0};
+#endif
GLfloat valf[4] = {0.0, 0.0, 0.0, 0.0};
GLint vali[4] = {0, 0, 0, 0};
int i;
-- 
2.10.0

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


[Piglit] [PATCH 2/2] framework/log: Add new test to running in start not constructor

2016-09-30 Thread Dylan Baker
Otherwise there will be a spinner in the final call to summary that's
printed when piglit finishes.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 framework/log.py | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/framework/log.py b/framework/log.py
index 213b04f..083c0ac 100644
--- a/framework/log.py
+++ b/framework/log.py
@@ -122,10 +122,12 @@ class QuietLog(BaseLog):
 self._endcode = '\n'
 
 self.__counter = next(self._test_counter)
-self._state['running'].append(self.__counter)
 
 def start(self, name):
-pass
+# This cannot be done in the constructor, since the constructor gets
+# called for the final summary too.
+with self._LOCK:
+self._state['running'].append(self.__counter)
 
 def _log(self, status):
 """ non-locked helper for logging
-- 
2.10.0

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


[Piglit] [PATCH 1/2] framework: If exiting a run, ensure that the status is readable

2016-09-30 Thread Dylan Baker
This patch catches C-c, and any Exception while tests are running,
prints the status again with a newline, and then raises the exception.
This makes the output visible even when a stacktrace is printed.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 framework/profile.py | 34 +-
 1 file changed, 21 insertions(+), 13 deletions(-)

diff --git a/framework/profile.py b/framework/profile.py
index 34c1a3c..7b0cb07 100644
--- a/framework/profile.py
+++ b/framework/profile.py
@@ -350,19 +350,27 @@ class TestProfile(object):
 single = multiprocessing.dummy.Pool(1)
 multi = multiprocessing.dummy.Pool()
 
-if options.OPTIONS.concurrent == "all":
-run_threads(multi, six.iteritems(self.test_list))
-elif options.OPTIONS.concurrent == "none":
-run_threads(single, six.iteritems(self.test_list))
-else:
-# Filter and return only thread safe tests to the threaded pool
-run_threads(multi, (x for x in six.iteritems(self.test_list)
-if x[1].run_concurrent))
-# Filter and return the non thread safe tests to the single pool
-run_threads(single, (x for x in six.iteritems(self.test_list)
- if not x[1].run_concurrent))
-
-log.get().summary()
+try:
+if options.OPTIONS.concurrent == "all":
+run_threads(multi, six.iteritems(self.test_list))
+elif options.OPTIONS.concurrent == "none":
+run_threads(single, six.iteritems(self.test_list))
+else:
+# Filter and return only thread safe tests to the threaded pool
+run_threads(multi, (x for x in six.iteritems(self.test_list)
+if x[1].run_concurrent))
+# Filter and return the non thread safe tests to the single
+# pool
+run_threads(single, (x for x in six.iteritems(self.test_list)
+ if not x[1].run_concurrent))
+
+log.get().summary()
+except (KeyboardInterrupt, Exception):
+# In the event that C-c is pressed, or any sort of exception would
+# generate a stacktrace, print the status line so that it's clear,
+# then die. Pressing C-c again will kill immediately.
+log.get().summary()
+raise
 
 self._post_run_hook()
 
-- 
2.10.0

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


Re: [Piglit] [PATCH v2] utils: define DRM_FORMATS needed by dma_buf tests

2016-09-28 Thread Dylan Baker
Quoting Dylan Baker (2016-09-28 12:09:09)
> If they're not defined by the installed libdrm already.
> 
> This moves code already defined in transcode-nv12-as-r8-gr88 to the
> utils level, so that all tests that require these formats get them, and also
> adds on additional define that wasn't in the mentioned test.
> 
> bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97951
> cc: Vinson Lee <v...@freedesktop.org>
> cc: Rob Clark <robdcl...@gmail.com>
> Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> ---
> 
> This is a completely different approach than the last time, but I think this
> might be better than the previous approach too.
> 
> I've compile tested this and it's running through CI now.

CI says no regressions.


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


[Piglit] [PATCH v2] utils: define DRM_FORMATS needed by dma_buf tests

2016-09-28 Thread Dylan Baker
If they're not defined by the installed libdrm already.

This moves code already defined in transcode-nv12-as-r8-gr88 to the
utils level, so that all tests that require these formats get them, and also
adds on additional define that wasn't in the mentioned test.

bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97951
cc: Vinson Lee <v...@freedesktop.org>
cc: Rob Clark <robdcl...@gmail.com>
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---

This is a completely different approach than the last time, but I think this
might be better than the previous approach too.

I've compile tested this and it's running through CI now.

 .../ext_image_dma_buf_import/transcode-nv12-as-r8-gr88.c  | 12 
 tests/util/piglit-framework-gl/piglit_drm_dma_buf.c   | 15 +++
 2 files changed, 15 insertions(+), 12 deletions(-)

diff --git a/tests/spec/ext_image_dma_buf_import/transcode-nv12-as-r8-gr88.c 
b/tests/spec/ext_image_dma_buf_import/transcode-nv12-as-r8-gr88.c
index f968539..7e5d5c8 100644
--- a/tests/spec/ext_image_dma_buf_import/transcode-nv12-as-r8-gr88.c
+++ b/tests/spec/ext_image_dma_buf_import/transcode-nv12-as-r8-gr88.c
@@ -48,18 +48,6 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 
 PIGLIT_GL_TEST_CONFIG_END
 
-/* The kernel header drm_fourcc.h defines the DRM formats below. We duplicate
- * some of the definitions so that building Piglit won't require bleeding-edge
- * kernel headers.
- */
-#ifndef DRM_FORMAT_R8
-#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ')
-#endif
-
-#ifndef DRM_FORMAT_GR88
-#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8')
-#endif
-
 /* Fake data for a 4x4 pixel image in NV12 format. */
 static const uint8_t y_data[] = {
0x00, 0x11, 0x22, 0x33,
diff --git a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c 
b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
index c3225c3..a0a2fc4 100644
--- a/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
+++ b/tests/util/piglit-framework-gl/piglit_drm_dma_buf.c
@@ -40,6 +40,21 @@
 #include 
 #include 
 
+/* These definitions were added in libdrm 2.4.68, since that's still pretty
+ * recent defined these to allow older libdrm to continue working.
+ */
+#ifndef DRM_FORMAT_R8
+#define DRM_FORMAT_R8 fourcc_code('R', '8', ' ', ' ')
+#endif
+
+#ifndef DRM_FORMAT_RG88
+#define DRM_FORMAT_RG88 fourcc_code('R', 'G', '8', '8')
+#endif
+
+#ifndef DRM_FORMAT_GR88
+#define DRM_FORMAT_GR88 fourcc_code('G', 'R', '8', '8')
+#endif
+
 #define ALIGN(value, alignment) (((value) + alignment - 1) & ~(alignment - 1))
 
 struct piglit_drm_driver {
-- 
2.10.0

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


Re: [Piglit] [PATCH] CMake: Don't turn on dma-buf tests for intel without libdrm >= 2.4.68

2016-09-28 Thread Dylan Baker
Quoting Vinson Lee (2016-09-28 11:21:12)
> On Tue, Sep 27, 2016 at 3:17 PM, Dylan Baker <dy...@pnwbakers.com> wrote:
> > Quoting Dylan Baker (2016-09-27 15:14:18)
> >> This version of libdrm was the first to privde DRM_FORMAT_R8,
> >> DRM_FORMAT_GR88 and DRM_FORMAT_RG88, which are needed for dma-buf tests
> >> since commit 0222f5db00fd47fb745402514a6d8cf2747f8434.
> >>
> >> bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97951
> >> cc: Vinson Lee <v...@freedesktop.org>
> >> Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> >> ---
> >>  CMakeLists.txt | 6 +++---
> >>  1 file changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/CMakeLists.txt b/CMakeLists.txt
> >> index 4002fe9..084ccf0 100644
> >> --- a/CMakeLists.txt
> >> +++ b/CMakeLists.txt
> >> @@ -178,11 +178,11 @@ ENDIF()
> >>  # The presence of libdrm is not sufficient. At least one 
> >> libdrm_${hardware}
> >>  # library is also needed.
> >>  #
> >> -# When building for Intel, libdrm_intel>=2.4.38 is required because 
> >> support for
> >> -# drm-prime arrived in that version.
> >> +# When building for Intel, libdrm_intel>=2.4.68 is required because 
> >> support
> >> +# DRM_FORMAT_R8 and friends arrived in that commit.
> >>  #
> >>  if(LIBDRM_FOUND AND XCB_DRI2_FOUND AND
> >> -   ((LIBDRM_INTEL_VERSION VERSION_GREATER "2.4.37") OR
> >> +   ((LIBDRM_INTEL_VERSION VERSION_GREATER "2.4.68") OR
> >
> > And cmake, stupidity, this should be VERSION_GREATER "2.4.67"
> >
> > I've changed it locally.
> >
> >>   PIGLIT_HAS_GBM_BO_MAP))
> >> set(PIGLIT_BUILD_DMA_BUF_TESTS_IS_VALID true)
> >>  else()
> >> --
> >> 2.10.0
> >>
> 
> I get this error with this patch on Ubuntu 16.04.
> 
> CMake Error at CMakeLists.txt:201 (message):
>   PIGLIT_BUILD_DMA_BUF_TESTS require libdrm, libdrm_intel>=2.4.38, and
>   xcb-dri2
> 
> Is this expected behavior or should it continue building without build
> the dma-buf tests?
> 
> Vinson

Although, that said, You should hit that error, since you presumably don't have
a new enough LIBDRM_INTEL and you don't have a new enough mesa.


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


Re: [Piglit] [PATCH] CMake: Don't turn on dma-buf tests for intel without libdrm >= 2.4.68

2016-09-28 Thread Dylan Baker
Quoting Vinson Lee (2016-09-28 11:21:12)
> On Tue, Sep 27, 2016 at 3:17 PM, Dylan Baker <dy...@pnwbakers.com> wrote:
> > Quoting Dylan Baker (2016-09-27 15:14:18)
> >> This version of libdrm was the first to privde DRM_FORMAT_R8,
> >> DRM_FORMAT_GR88 and DRM_FORMAT_RG88, which are needed for dma-buf tests
> >> since commit 0222f5db00fd47fb745402514a6d8cf2747f8434.
> >>
> >> bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97951
> >> cc: Vinson Lee <v...@freedesktop.org>
> >> Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> >> ---
> >>  CMakeLists.txt | 6 +++---
> >>  1 file changed, 3 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/CMakeLists.txt b/CMakeLists.txt
> >> index 4002fe9..084ccf0 100644
> >> --- a/CMakeLists.txt
> >> +++ b/CMakeLists.txt
> >> @@ -178,11 +178,11 @@ ENDIF()
> >>  # The presence of libdrm is not sufficient. At least one 
> >> libdrm_${hardware}
> >>  # library is also needed.
> >>  #
> >> -# When building for Intel, libdrm_intel>=2.4.38 is required because 
> >> support for
> >> -# drm-prime arrived in that version.
> >> +# When building for Intel, libdrm_intel>=2.4.68 is required because 
> >> support
> >> +# DRM_FORMAT_R8 and friends arrived in that commit.
> >>  #
> >>  if(LIBDRM_FOUND AND XCB_DRI2_FOUND AND
> >> -   ((LIBDRM_INTEL_VERSION VERSION_GREATER "2.4.37") OR
> >> +   ((LIBDRM_INTEL_VERSION VERSION_GREATER "2.4.68") OR
> >
> > And cmake, stupidity, this should be VERSION_GREATER "2.4.67"
> >
> > I've changed it locally.
> >
> >>   PIGLIT_HAS_GBM_BO_MAP))
> >> set(PIGLIT_BUILD_DMA_BUF_TESTS_IS_VALID true)
> >>  else()
> >> --
> >> 2.10.0
> >>
> 
> I get this error with this patch on Ubuntu 16.04.
> 
> CMake Error at CMakeLists.txt:201 (message):
>   PIGLIT_BUILD_DMA_BUF_TESTS require libdrm, libdrm_intel>=2.4.38, and
>   xcb-dri2
> 
> Is this expected behavior or should it continue building without build
> the dma-buf tests?
> 
> Vinson

No, the check is still wrong. Let me think about it a bit more and spin a v2.


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


Re: [Piglit] [PATCH] CMake: Don't turn on dma-buf tests for intel without libdrm >= 2.4.68

2016-09-27 Thread Dylan Baker
Quoting Dylan Baker (2016-09-27 15:14:18)
> This version of libdrm was the first to privde DRM_FORMAT_R8,
> DRM_FORMAT_GR88 and DRM_FORMAT_RG88, which are needed for dma-buf tests
> since commit 0222f5db00fd47fb745402514a6d8cf2747f8434.
> 
> bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97951
> cc: Vinson Lee <v...@freedesktop.org>
> Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> ---
>  CMakeLists.txt | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index 4002fe9..084ccf0 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -178,11 +178,11 @@ ENDIF()
>  # The presence of libdrm is not sufficient. At least one libdrm_${hardware}
>  # library is also needed.
>  #
> -# When building for Intel, libdrm_intel>=2.4.38 is required because support 
> for
> -# drm-prime arrived in that version.
> +# When building for Intel, libdrm_intel>=2.4.68 is required because support
> +# DRM_FORMAT_R8 and friends arrived in that commit.
>  #
>  if(LIBDRM_FOUND AND XCB_DRI2_FOUND AND
> -   ((LIBDRM_INTEL_VERSION VERSION_GREATER "2.4.37") OR
> +   ((LIBDRM_INTEL_VERSION VERSION_GREATER "2.4.68") OR

And cmake, stupidity, this should be VERSION_GREATER "2.4.67"

I've changed it locally.

>   PIGLIT_HAS_GBM_BO_MAP))
> set(PIGLIT_BUILD_DMA_BUF_TESTS_IS_VALID true)
>  else()
> -- 
> 2.10.0
> 


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


[Piglit] [PATCH] CMake: Don't turn on dma-buf tests for intel without libdrm >= 2.4.68

2016-09-27 Thread Dylan Baker
This version of libdrm was the first to privde DRM_FORMAT_R8,
DRM_FORMAT_GR88 and DRM_FORMAT_RG88, which are needed for dma-buf tests
since commit 0222f5db00fd47fb745402514a6d8cf2747f8434.

bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97951
cc: Vinson Lee <v...@freedesktop.org>
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 CMakeLists.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4002fe9..084ccf0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -178,11 +178,11 @@ ENDIF()
 # The presence of libdrm is not sufficient. At least one libdrm_${hardware}
 # library is also needed.
 #
-# When building for Intel, libdrm_intel>=2.4.38 is required because support for
-# drm-prime arrived in that version.
+# When building for Intel, libdrm_intel>=2.4.68 is required because support
+# DRM_FORMAT_R8 and friends arrived in that commit.
 #
 if(LIBDRM_FOUND AND XCB_DRI2_FOUND AND
-   ((LIBDRM_INTEL_VERSION VERSION_GREATER "2.4.37") OR
+   ((LIBDRM_INTEL_VERSION VERSION_GREATER "2.4.68") OR
  PIGLIT_HAS_GBM_BO_MAP))
set(PIGLIT_BUILD_DMA_BUF_TESTS_IS_VALID true)
 else()
-- 
2.10.0

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


Re: [Piglit] [PATCH] Add profile cts_gl45

2016-09-27 Thread Dylan Baker
Quoting Marek Olšák (2016-09-27 09:48:53)
> From: Marek Olšák <marek.ol...@amd.com>
> 
> Older versions are broken at the moment and I don't find them useful
> anyway. This also creates the test list faster.
> ---
>  tests/cts_gl45.py | 68 
> +++
>  1 file changed, 68 insertions(+)
>  create mode 100644 tests/cts_gl45.py
> 
> diff --git a/tests/cts_gl45.py b/tests/cts_gl45.py
> new file mode 100644
> index 000..2782e18
> --- /dev/null
> +++ b/tests/cts_gl45.py
> @@ -0,0 +1,68 @@
> +# Copyright (c) 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 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.
> +
> +"""Piglit integration for Khronos CTS tests.
> +
> +This will run GL45 test cases only.
> +
> +This integration requires some configuration in piglit.conf, or the use of
> +environment variables.
> +
> +In piglit.conf one should set the following:
> +[cts_gl]:bin -- Path to the glcts binary
> +[cts_gl]:extra_args -- any extra arguments to be passed to cts (optional)
> +
> +Alternatively (or in addition, since environment variables have precedence),
> +one could set:
> +PIGLIT_CTS_GL_BIN -- environment equivalent of [cts_gl]:bin
> +PIGLIT_CTS_GL_EXTRA_ARGS -- environment equivalent of [cts_gl]:extra_args

The values described in this docstring conflict with the ones in gl_cts.py.
Could you fix these to be cts_gl_45 or something?

Also, could you add the sections to piglit.conf.example, it's a pretty
straightforward copy-n-paste operation.

> +
> +"""
> +
> +from __future__ import (
> +absolute_import, division, print_function, unicode_literals
> +)
> +import itertools
> +
> +from framework.test import deqp
> +
> +__all__ = ['profile']
> +
> +_CTS_BIN = deqp.get_option('PIGLIT_CTS_GL_BIN', ('cts_gl', 'bin'),
> +   required=True)
> +
> +_EXTRA_ARGS = deqp.get_option('PIGLIT_CTS_GL_EXTRA_ARGS', ('cts_gl', 
> 'extra_args'),
> +  default='').split()

Some with the environment variables here.

> +
> +
> +class DEQPCTSTest(deqp.DEQPBaseTest):
> +deqp_bin = _CTS_BIN
> +
> +@property
> +def extra_args(self):
> +return super(DEQPCTSTest, self).extra_args + \
> +[x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]
> +
> +profile = deqp.make_profile(  # pylint: disable=invalid-name
> +itertools.chain(
> +deqp.iter_deqp_test_cases(
> +    deqp.gen_caselist_txt(_CTS_BIN, 'GL45-CTS-cases.txt', 
> _EXTRA_ARGS)),
> +),
> +DEQPCTSTest)
> -- 
> 2.7.4
> 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit

With those changes:
Reviewed-by: Dylan Baker <dy...@pnwbakers.com>


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


Re: [Piglit] [PATCH 1/2] unittests: Add test for DriverClassifier.get_glxinfo

2016-09-16 Thread Dylan Baker
piglit is broken on python3 without these, I'm planning to push soon.

Quoting Dylan Baker (2016-09-16 13:46:04)
> Ensure that it converts bytes to str and also collects correctly.
> 
> Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
> ---
>  unittests/framework/test_driver_classifier.py | 25 +
>  1 file changed, 25 insertions(+)
> 
> diff --git a/unittests/framework/test_driver_classifier.py 
> b/unittests/framework/test_driver_classifier.py
> index a4b043a..4c20842 100644
> --- a/unittests/framework/test_driver_classifier.py
> +++ b/unittests/framework/test_driver_classifier.py
> @@ -19,10 +19,23 @@
>  # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
> DEALINGS
>  # IN THE SOFTWARE.
>  
> +"""Tests for the driver_classifier module."""
> +
> +from __future__ import (
> +absolute_import, division, print_function, unicode_literals
> +)
> +
> +try:
> +import mock
> +except ImportError:
> +from unittest import mock
> +
>  import pytest
>  import six
> +
>  from framework import driver_classifier
>  
> +
>  class DriverClassifierTester(driver_classifier.DriverClassifier):
>  """Test class for the driver classifier, taking in a fixed
>  
> @@ -58,3 +71,15 @@ class TestDriverClassifier(object):
>  categories list comes back.
>  """
>  assert DriverClassifierTester(renderer).categories == categories
> +
> +def test_collect_glxinfo(self):
> +"""Should set self.renderer."""
> +test = driver_classifier.DriverClassifier()
> +with 
> mock.patch('framework.driver_classifier.subprocess.check_output',
> +mock.Mock(return_value=b'some data\nand some more\n'
> +   b'OpenGL renderer string: '
> +   b'sentinal\nand some other '
> +   b'stuff')):
> +test.collect_glxinfo()
> +assert isinstance(test.renderer, six.text_type)
> +assert test.renderer == 'sentinal'
> -- 
> 2.9.3
> 


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


[Piglit] [PATCH 2/2] framework: Make driver_classifier convert to str (unicode)

2016-09-16 Thread Dylan Baker
In python2 the code as is works, although there might be odd corners. In
python 3 it fails because the code tries to match bytes and strs, which
doesn't work at all.

This patch fixes the issue by converting the output from bytes to str
(unicode) immediately, so we don't have to think about it again.

CC: Eric Anholt <e...@anholt.net>
Reported-by: Dan Kegel <d...@kegel.com>
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 framework/driver_classifier.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/framework/driver_classifier.py b/framework/driver_classifier.py
index c63b88d..dcef6cd 100644
--- a/framework/driver_classifier.py
+++ b/framework/driver_classifier.py
@@ -55,8 +55,8 @@ class DriverClassifier(object):
 """
 
 try:
-output = subprocess.check_output(['glxinfo'],
- stderr=subprocess.STDOUT)
+output = subprocess.check_output(
+['glxinfo'], stderr=subprocess.STDOUT).decode('utf-8')
 except OSError as e:
 if e.errno not in [errno.ENOENT, errno.EACCES]:
 raise
-- 
2.9.3

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


[Piglit] [PATCH 1/2] unittests: Add test for DriverClassifier.get_glxinfo

2016-09-16 Thread Dylan Baker
Ensure that it converts bytes to str and also collects correctly.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 unittests/framework/test_driver_classifier.py | 25 +
 1 file changed, 25 insertions(+)

diff --git a/unittests/framework/test_driver_classifier.py 
b/unittests/framework/test_driver_classifier.py
index a4b043a..4c20842 100644
--- a/unittests/framework/test_driver_classifier.py
+++ b/unittests/framework/test_driver_classifier.py
@@ -19,10 +19,23 @@
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 # IN THE SOFTWARE.
 
+"""Tests for the driver_classifier module."""
+
+from __future__ import (
+absolute_import, division, print_function, unicode_literals
+)
+
+try:
+import mock
+except ImportError:
+from unittest import mock
+
 import pytest
 import six
+
 from framework import driver_classifier
 
+
 class DriverClassifierTester(driver_classifier.DriverClassifier):
 """Test class for the driver classifier, taking in a fixed
 
@@ -58,3 +71,15 @@ class TestDriverClassifier(object):
 categories list comes back.
 """
 assert DriverClassifierTester(renderer).categories == categories
+
+def test_collect_glxinfo(self):
+"""Should set self.renderer."""
+test = driver_classifier.DriverClassifier()
+with mock.patch('framework.driver_classifier.subprocess.check_output',
+mock.Mock(return_value=b'some data\nand some more\n'
+   b'OpenGL renderer string: '
+   b'sentinal\nand some other '
+   b'stuff')):
+test.collect_glxinfo()
+assert isinstance(test.renderer, six.text_type)
+assert test.renderer == 'sentinal'
-- 
2.9.3

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


Re: [Piglit] Fresh driver_classifier.py type error fix

2016-09-16 Thread Dylan Baker
Quoting Dan Kegel (2016-09-16 09:12:21)
> piglit stopped working for me this morning with a TypeError on ubuntu 16.04.
> That's what I get for running off of tip, the file that broke was only
> created six hours ago :-)
> 
> Here's a tiny change that got me running again.
> 
> From 80a2d9c6d7eaa322e87a4400d9bb2076d0341b35 Mon Sep 17 00:00:00 2001
> From: Dan Kegel 
> Date: Fri, 16 Sep 2016 09:07:21 -0700
> Subject: [PATCH] Work around Typeerror: cannot use a string pattern on
> a bytes-like object on ubuntu 16.04
> 
> ---
>  framework/driver_classifier.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/framework/driver_classifier.py b/framework/driver_classifier.py
> index af25665..c2d7a13 100644
> --- a/framework/driver_classifier.py
> +++ b/framework/driver_classifier.py
> @@ -64,7 +64,7 @@ class DriverClassifier(object):
>  return
> 
>  for line in output.splitlines():
> -m = re.match('OpenGL renderer string: (.*)', line)
> +m = re.match('OpenGL renderer string: (.*)', 
> line.decode('utf-8'))
>  if m is not None:
>  self.renderer = m.group(1)
>  break
> --
> libgit2 0.24.0
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit

I'm not sure this is the right place to fix this. I think we should just
decode the output in collect_glxinfo when we assign to self.renderer.

Dylan


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


[Piglit] [PATCH v2] framework: Fix FastSkipMixin version comparisons

2016-09-15 Thread Dylan Baker
Currently the FastSkipMixin assumes that versions will always be a
minimum required version, and nothing else. This is mostly true of
piglit tests, but isn't always true. Sometimes tests specify that they
need a version greater-or-equal, and a few have less-than or
less-than-equal.

This patch fixes that, and also generalizes the fast-skip mechanism a
bit. It does this by allowing the caller to set an operation as well as
a value.

This also updates glslparsertest and shadertest to use the newly updated
interfaces.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---

v2: - fix >= and <=

 framework/test/glsl_parser_test.py|  23 +--
 framework/test/opengl.py  | 209 +-
 framework/test/shader_test.py |  28 ++-
 unittests/framework/test/test_glsl_parser_test.py |  12 +-
 unittests/framework/test/test_opengl.py   | 195 +++-
 unittests/framework/test/test_shader_test.py  |  21 ++-
 6 files changed, 282 insertions(+), 206 deletions(-)

diff --git a/framework/test/glsl_parser_test.py 
b/framework/test/glsl_parser_test.py
index b1acb18..9cfbc65 100644
--- a/framework/test/glsl_parser_test.py
+++ b/framework/test/glsl_parser_test.py
@@ -24,6 +24,7 @@
 from __future__ import (
 absolute_import, division, print_function, unicode_literals
 )
+import operator
 import os
 import re
 import io
@@ -31,7 +32,7 @@ import six
 
 from framework import exceptions
 from .base import TestIsSkip
-from .opengl import FastSkipMixin
+from .opengl import FastSkipMixin, VersionSkip, ExtensionsSkip
 from .piglit_test import PiglitBaseTest, TEST_BIN_DIR
 
 __all__ = [
@@ -115,29 +116,31 @@ class GLSLParserTest(FastSkipMixin, PiglitBaseTest):
 glsl = config.get('glsl_version')
 if glsl:
 if _is_gles_version(glsl):
-self.glsl_es_version = float(glsl[:3])
+self.glsl_es_version = VersionSkip(
+operator.ge, float(glsl[:3]), '>=')
 else:
-self.glsl_version = float(glsl)
+self.glsl_version = VersionSkip(
+operator.ge, float(glsl), '>=')
 
 req = config.get('require_extensions')
 if req:
-self.gl_required = set(
-r for r in req.split() if not r.startswith('!'))
+self.gl_required = ExtensionsSkip(set(
+r for r in req.split() if not r.startswith('!')))
 
 # If GLES is requested, but piglit was not built with a gles version,
 # then ARB_ES3_compatibility is required. Add it to
 # self.gl_required
 if self.glsl_es_version and not _HAS_GLES_BIN:
-if self.glsl_es_version == 1.0:
+if self.glsl_es_version.version == 1.0:
 ver = '2'
-elif self.glsl_es_version == 3.0:
+elif self.glsl_es_version.version == 3.0:
 ver = '3'
-elif self.glsl_es_version == 3.1:
+elif self.glsl_es_version.version == 3.1:
 ver = '3_1'
-elif self.glsl_es_version == 3.2:
+elif self.glsl_es_version.version == 3.2:
 ver = '3_2'
 ext = 'ARB_ES{}_compatibility'.format(ver)
-self.gl_required.add(ext)
+self.gl_required.extensions.add(ext)
 self._command.append(ext)
 
 @staticmethod
diff --git a/framework/test/opengl.py b/framework/test/opengl.py
index 6fe8670..5146051 100644
--- a/framework/test/opengl.py
+++ b/framework/test/opengl.py
@@ -31,6 +31,7 @@ import warnings
 import six
 
 from framework import exceptions, core
+from framework import compat
 from framework.options import OPTIONS
 from .base import TestIsSkip
 
@@ -45,6 +46,21 @@ __all__ = [
 _DISABLED = bool(os.environ.get('PIGLIT_NO_FAST_SKIP', False))
 
 
+@compat.python_2_unicode_compatible
+class FastSkip(exceptions.PiglitInternalError):
+"""Exception class raised when a test should fast skip.
+
+This is used internally by the FastSkipMixin and is reraised as a
+TestIsSkip exception.
+"""
+def __init__(self, msg=''):
+super(FastSkip, self).__init__()
+self.msg = msg
+
+def __str__(self):
+return self.msg
+
+
 class StopWflinfo(exceptions.PiglitException):
 """Exception called when wlfinfo getter should stop."""
 def __init__(self, reason):
@@ -287,6 +303,96 @@ class WflInfo(object):
 return ret
 
 
+class VersionSkip(object):
+"""Class that implements skip conditions based on versions.
+
+This class adds support for checking one version against another.
+
+>>> import operator
+>>> test = VersionSkip(operator.lt, 3.0, rep='<')
+>>> test.test(4.0)
+Traceback (most recent call last):
+...
+framework.test.opengl.FastSkip: ...
+
+>&g

Re: [Piglit] [PATCH 0/3] apitrace test runner for piglit

2016-09-14 Thread Dylan Baker
Quoting Eric Anholt (2016-09-14 03:03:28)
> I've applied Dylan's comments to the RFC series, and I've pushed a
> starting trace-db with reference images for my i965 and vc4:
> 
> https://github.com/anholt/trace-db
> 
> Eric Anholt (3):
>   framework: Add a driver classifier based on the renderer string.
>   apitrace: Add a script for capturing and comparing trace images.
>   all.py: Test any apitraces we find under tests/apitrace/traces.
> 
>  framework/driver_classifier.py| 121 +
>  framework/test/piglit_test.py |   1 +
>  tests/all.py  |  22 +++-
>  tests/apitrace/test-trace.py  | 149 
> ++
>  unittests/framework/test_driver_classifier.py |  60 +++
>  5 files changed, 352 insertions(+), 1 deletion(-)
>  create mode 100644 framework/driver_classifier.py
>  create mode 100755 tests/apitrace/test-trace.py
>  create mode 100644 unittests/framework/test_driver_classifier.py
> 
> -- 
> 2.9.3
> 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit

I haven't look too closely at them this time, but everything seemed
good. For the python bits at least,
Reviewed-by: Dylan Baker <dy...@pnwbakers.com>


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


Re: [Piglit] [PATCH 0/15] Add support for shader_runner to run more than one test per process

2016-09-13 Thread Dylan Baker
Quoting Dylan Baker (2016-09-13 13:46:11)
> Quoting Marek Olšák (2016-09-13 13:27:21)
> > On Tue, Sep 13, 2016 at 8:30 PM, Dylan Baker <dy...@pnwbakers.com> wrote:
> > > So, there were a few comments I've addressed, and Marek acked one patch.
> > > Do y'all want to see a v2, or should I just push this?
> > 
> > There are at least 2 piglit regressions with --process-isolation 0:
> > 
> > shaders/glsl-vs-ff-frag
> > shaders/loopfunc
> > 
> > Marek
> 
> I swear I fixed those... Did I push the wrong branch or something?
> 
> Anyway, the issue I ran into was tests that didn't define a fragment
> shader got tripped up after tests that bound textures.
> 
> H.

I can't replicate those two failing, they pass for me on i965, and I
don't have access to anything except Intel hardware at work.

Dylan


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


Re: [Piglit] [PATCH 0/15] Add support for shader_runner to run more than one test per process

2016-09-13 Thread Dylan Baker
Quoting Marek Olšák (2016-09-13 13:27:21)
> On Tue, Sep 13, 2016 at 8:30 PM, Dylan Baker <dy...@pnwbakers.com> wrote:
> > So, there were a few comments I've addressed, and Marek acked one patch.
> > Do y'all want to see a v2, or should I just push this?
> 
> There are at least 2 piglit regressions with --process-isolation 0:
> 
> shaders/glsl-vs-ff-frag
> shaders/loopfunc
> 
> Marek

I swear I fixed those... Did I push the wrong branch or something?

Anyway, the issue I ran into was tests that didn't define a fragment
shader got tripped up after tests that bound textures.

H.


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


Re: [Piglit] [PATCH 0/15] Add support for shader_runner to run more than one test per process

2016-09-10 Thread Dylan Baker


On Sat, Sep 10, 2016, at 06:56, Marek Olšák wrote:
> Thanks a lot of doing this!!
> 
> BTW, --no-process-isolation is not a valid parameter.

Yeah, I decided to change the parameter after I ran the benchmarks, when
I was writing documentation and proper commit messages. I realized that
I'd promised a piglit.conf option to force this on, and that would
either require two switches, or just changing the switch to take a
parameter to get consistent behavior.

So instead it's '--process-isolation' with an argument that can be
roughly translated as True or False (1, 0, true, false, yes, no; with
any capitalization). I forgot to update the cover letter.

Dylan

> 
> Marek
> 
> On Fri, Sep 9, 2016 at 9:18 PM, Dylan Baker <dy...@pnwbakers.com> wrote:
> > This allows shader_runner to consume more than one test at a time. When
> > it does this it reports the results as subtests rather than as regular
> > tests. It also updates the python framework to handle and resume from
> > crashes in the tests. When this mode is enabled, shader_runner runs an
> > entire directory of shader_test files at a time.
> >
> > This makes shader_runner (which takes up the bulk of piglit) run much
> > faster, even compared to per-process with fast skipping enabled, but at
> > the cost of the robustness and precision of process isolation. For that
> > reason its an option that must be enabled, the default should always be
> > robustness not speed. This can be forced on in piglit.conf.
> >
> > From a performance standpoint it's impressive (this is a 4 thread HSW):
> > PIGLIT_NO_FAST_SKIP=1 ./piglit run shader ns_w_is -c
> > 936.35s user 611.18s system 301% cpu 8:33.71 total
> > ./piglit run shader fs_w_is -c
> > 726.21s user 398.25s system 306% cpu 6:07.23 total
> > PIGLIT_NO_FAST_SKIP=1 ./piglit run shader ns_no_is -c --no-process-isolation
> > 334.21s user 122.04s system 201% cpu 3:46.55 total
> > ./piglit run shader fs_no_is -c --no-process-isolation
> > 160.47s user 7.83s system 293% cpu 57.327 total
> >
> > For the general use case (With fast skipping) this is a reduction of 5
> > minutes of runtime. With fast-skipping seems pretty useful, as it
> > reduces runtime by 3 minutes even with the removal of process isolation.
> >
> > Dylan Baker (9):
> >   framework/results: Lower subtest names
> >   framework: Split the file parsing code out of ShaderTest
> >   framework: Split FastSkipMixin.
> >   framework: Bump JSON on disk format to version 9
> >   framework: Add a Mixin class for running multiple tests in a single 
> > process
> >   squash! shader_runner: add ability to run multiple tests per process
> >   framework: Add class for running multiple shader_tests in a single process
> >   framework: Plug in fast-skipping to MultiShaderTest
> >   framework: add boilerplate to turn off process isolation
> >
> > Marek Olšák (6):
> >   shader_runner: propagate all errors to piglit_init
> >   util: guard against double context destruction
> >   util: always set piglit_is_core_profile
> >   util: rename 
> > piglit_gl_reinitialize_extensions->piglit_gl_invalidate_extensions
> >   util: move PIGLIT_PATH_SEP to piglit-util.h
> >   shader_runner: add ability to run multiple tests per process
> >
> >  framework/backends/json.py |  18 +-
> >  framework/options.py   |   1 +-
> >  framework/programs/run.py  |  22 +-
> >  framework/results.py   |   8 +-
> >  framework/test/base.py | 155 ++-
> >  framework/test/deqp.py |   4 +-
> >  framework/test/opengl.py   | 182 ++-
> >  framework/test/shader_test.py  | 201 +++-
> >  piglit.conf.example|   7 +-
> >  tests/all.py   |  34 +-
> >  tests/shader.py|   4 +-
> >  tests/shaders/shader_runner.c  | 560 +++---
> >  tests/util/piglit-framework-gl.c   |   4 +-
> >  tests/util/piglit-framework-gl/piglit_glut_framework.c |   7 +-
> >  tests/util/piglit-framework-gl/piglit_wfl_framework.c  |   5 +-
> >  tests/util/piglit-util-gl.c|   2 +-
> >  tests/util/piglit-util-gl.h|   2 +-
> >  tests/util/piglit-util.c   |   6 +-
> >  tests/util/piglit-util.h   |   6 +-
> >  unittes

[Piglit] [PATCH 3/4] generators: add ARB_shader_viewport_layer_array to gen_extensions_defined

2016-09-09 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 generated_tests/gen_extensions_defined.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/generated_tests/gen_extensions_defined.py 
b/generated_tests/gen_extensions_defined.py
index cbacc12..745eb4a 100644
--- a/generated_tests/gen_extensions_defined.py
+++ b/generated_tests/gen_extensions_defined.py
@@ -102,6 +102,7 @@ EXTENSIONS = [
 Ext("GL_ARB_shader_subroutine", "150"),
 Ext("GL_ARB_shader_texture_image_samples", "110"),
 Ext("GL_ARB_shader_texture_lod", "110"),
+Ext("GL_ARB_shader_viewport_layer_array", "410", ['vert', 'geom', 'tese']),
 Ext("GL_ARB_shading_language_420pack", "110"),
 Ext("GL_ARB_shading_language_packing", "110"),
 Ext("GL_ARB_tessellation_shader", "150"),
-- 
2.9.3

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


[Piglit] [PATCH 4/4] tests: port tests for arb_shader_viewport_layer_array

2016-09-09 Thread Dylan Baker
This adds a couple of original compiler tests, and ports the tests for
amd_vertex_shader_layer and amd_vertex_shader_viewport_index to the ARB
extension.

These tests touch the VS, but not the tes eval.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |   8 +
 tests/spec/CMakeLists.txt  |   1 +
 .../CMakeLists.gl.txt  |  24 ++
 .../arb_shader_viewport_layer_array/CMakeLists.txt |   1 +
 .../compiler/write-viewportindex.frag  |  15 +
 .../compiler/write-viewportindex.tesc  |  15 +
 .../compiler/write-viewportindex.tese  |  17 ++
 .../compiler/write-viewportindex.vert  |  17 ++
 .../layered-2d-texture-render.c| 339 +
 .../layered-depth-texture-render.c | 239 +++
 .../spec/arb_shader_viewport_layer_array/render.c  | 152 +
 11 files changed, 828 insertions(+)
 create mode 100644 tests/spec/arb_shader_viewport_layer_array/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_shader_viewport_layer_array/CMakeLists.txt
 create mode 100644 
tests/spec/arb_shader_viewport_layer_array/compiler/write-viewportindex.frag
 create mode 100644 
tests/spec/arb_shader_viewport_layer_array/compiler/write-viewportindex.tesc
 create mode 100644 
tests/spec/arb_shader_viewport_layer_array/compiler/write-viewportindex.tese
 create mode 100644 
tests/spec/arb_shader_viewport_layer_array/compiler/write-viewportindex.vert
 create mode 100644 
tests/spec/arb_shader_viewport_layer_array/layered-2d-texture-render.c
 create mode 100644 
tests/spec/arb_shader_viewport_layer_array/layered-depth-texture-render.c
 create mode 100644 tests/spec/arb_shader_viewport_layer_array/render.c

diff --git a/tests/all.py b/tests/all.py
index 3961656..edec9d0 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4749,6 +4749,14 @@ with profile.group_manager(
 g(['arb_shader_draw_parameters-drawid-indirect', 'baseinstance'], 
'drawid-indirect-baseinstance')
 g(['arb_shader_draw_parameters-drawid-indirect', 'vertexid'], 
'drawid-indirect-vertexid')
 
+with profile.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'ARB_shader_viewport_layer_array')) as g:
+for test in ['layered-depth-texture-render',
+ 'layered-depth-texture-render',
+ 'render-vs']:
+g(['arb_shader_viewport_layer_array-{}'.format(test)], test)
+
 # Group ARB_indirect_parameters
 with profile.group_manager(
 PiglitGLTest,
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 9b0f73e..d56c501 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -54,6 +54,7 @@ add_subdirectory (arb_shader_atomic_counters)
 add_subdirectory (arb_shader_objects)
 add_subdirectory (arb_shader_image_load_store)
 add_subdirectory (arb_shader_image_size)
+add_subdirectory (arb_shader_viewport_layer_array)
 add_subdirectory (arb_shading_language_420pack/execution)
 add_subdirectory (arb_stencil_texturing)
 add_subdirectory (arb_sync)
diff --git a/tests/spec/arb_shader_viewport_layer_array/CMakeLists.gl.txt 
b/tests/spec/arb_shader_viewport_layer_array/CMakeLists.gl.txt
new file mode 100644
index 000..ebbca99
--- /dev/null
+++ b/tests/spec/arb_shader_viewport_layer_array/CMakeLists.gl.txt
@@ -0,0 +1,24 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable(
+   arb_shader_viewport_layer_array-layered-2d-texture-render
+   layered-2d-texture-render.c
+)
+piglit_add_executable(
+   arb_shader_viewport_layer_array-layered-depth-texture-render
+   layered-depth-texture-render.c
+)
+piglit_add_executable(
+   arb_shader_viewport_layer_array-render-vs
+   render.c
+)
+
+# vim: ft=cmake
diff --git a/tests/spec/arb_shader_viewport_layer_array/CMakeLists.txt 
b/tests/spec/arb_shader_viewport_layer_array/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_shader_viewport_layer_array/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git 
a/tests/spec/arb_shader_viewport_layer_array/compiler/write-viewportindex.frag 
b/tests/spec/arb_shader_viewport_layer_array/compiler/write-viewportindex.frag
new file mode 100644
index 000..5acf23c
--- /dev/null
+++ 
b/tests/spec/arb_shader_viewport_layer_array/compiler/write-viewportindex.frag
@@ -0,0 +1,15 @@
+/* gl_ViewportIndex should be undefined in a Fragment Shader.
+ *
+ * [config]
+ * expect_result: fail
+ * glsl_version: 4.10
+ * require_extensions: GL_ARB_shader_viewport_layer_array
+ * [end config]
+ */
+
+#version 410
+
+void main()
+{
+gl_ViewportIndex = 1;
+}
diff --git 
a/tests/spec/arb_shader_viewport_layer_array/compiler/write-viewportindex.tesc 
b/test

[Piglit] [PATCH 1/4] generators: Extend gen_extensions_defined for stage requirements

2016-09-09 Thread Dylan Baker
This allows extensions to specify which stages they support, allowing
such extensions as ARB_shader_viewport_layer_array to be added.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 generated_tests/gen_extensions_defined.py | 176 --
 1 file changed, 94 insertions(+), 82 deletions(-)

diff --git a/generated_tests/gen_extensions_defined.py 
b/generated_tests/gen_extensions_defined.py
index d42e6ad..aee2af6 100644
--- a/generated_tests/gen_extensions_defined.py
+++ b/generated_tests/gen_extensions_defined.py
@@ -52,83 +52,93 @@ ENABLED_TEMPLATE = 
_TEMPLATES.get_template('enabled.glsl.mako')
 DISABLED_TEMPLATE = _TEMPLATES.get_template('disabled.glsl.mako')
 UNDEFINED_TEMPLATE = _TEMPLATES.get_template('undefined-require.glsl.mako')
 
+
+class Ext(object):
+"""Represents an OpenGL (ES) extension."""
+
+def __init__(self, name, version, stages=None):
+self.name = name
+self.version = glsl.Version(version)
+self.stages = stages or ['vert', 'frag', 'geom', 'tesc', 'tese', 
'comp']
+
+
 # A list of tuples with the full preprocess defined name, and the minimum
-# supported version of that extension.
+# supported version of that extension, optionally it may contain a list of
+# stages supported.
 EXTENSIONS = [
-("GL_ARB_draw_instanced", "110"),
-("GL_ARB_draw_buffers", "110"),
-("GL_ARB_enhanced_layouts", "140"),
-("GL_ARB_separate_shader_objects", "110"),
-("GL_ARB_texture_rectangle", "110"),
-("GL_AMD_shader_trinary_minmax", "110"),
-("GL_EXT_texture_array", "110"),
-("GL_ARB_ES3_1_compatibility", "430"),
-("GL_ARB_arrays_of_arrays", "110"),
-("GL_ARB_fragment_coord_conventions", "110"),
-("GL_ARB_fragment_layer_viewport", "150"),
-("GL_ARB_explicit_attrib_location", "110"),
-("GL_ARB_explicit_uniform_location", "110"),
-("GL_ARB_shader_texture_lod", "110"),
-("GL_AMD_conservative_depth", "110"),
-("GL_ARB_conservative_depth", "110"),
-("GL_ARB_shader_bit_encoding", "110"),
-("GL_ARB_shader_clock", "110"),
-("GL_ARB_uniform_buffer_object", "110"),
-("GL_ARB_texture_cube_map_array", "110"),
-("GL_ARB_shading_language_packing", "110"),
-("GL_ARB_texture_multisample", "110"),
-("GL_ARB_texture_query_levels", "110"),
-("GL_ARB_texture_query_lod", "110"),
-("GL_ARB_gpu_shader5", "150"),
-("GL_ARB_gpu_shader_fp64", "150"),
-("GL_ARB_vertex_attrib_64bit", "150"),
-("GL_AMD_vertex_shader_layer", "130"),
-("GL_AMD_vertex_shader_viewport_index", "110"),
-("GL_ARB_shading_language_420pack", "110"),
-("GL_ARB_sample_shading", "110"),
-("GL_ARB_texture_gather", "110"),
-("GL_ARB_shader_atomic_counters", "110"),
-("GL_ARB_shader_atomic_counter_ops", "140"),
-("GL_ARB_viewport_array", "110"),
-("GL_ARB_compute_shader", "110"),
-("GL_ARB_shader_image_load_store", "130"),
-("GL_ARB_shader_image_size", "110"),
-("GL_ARB_shader_texture_image_samples", "110"),
+Ext("GL_ARB_draw_instanced", "110"),
+Ext("GL_ARB_draw_buffers", "110"),
+Ext("GL_ARB_enhanced_layouts", "140"),
+Ext("GL_ARB_separate_shader_objects", "110"),
+Ext("GL_ARB_texture_rectangle", "110"),
+Ext("GL_AMD_shader_trinary_minmax", "110"),
+Ext("GL_EXT_texture_array", "110"),
+Ext("GL_ARB_ES3_1_compatibility", "430"),
+Ext("GL_ARB_arrays_of_arrays", "110"),
+Ext("GL_ARB_fragment_coord_conventions", "110"),
+Ext("GL_ARB_fragment_layer_viewport", "150"),
+Ext("GL_ARB_explicit_attrib_location", "110"),
+Ext("GL_ARB_explicit_uniform_location", "110"),
+Ext("GL_ARB_shader_texture_lod", "110"),
+Ext("GL_AMD_conservative_depth", "110"),
+Ext("GL_ARB_conservative_depth", "110"),
+Ext("GL_ARB_shader_bit_encoding", "110"),
+Ext("GL_ARB_s

[Piglit] [PATCH 2/4] generated_tests: sort gen_extensions_defined list

2016-09-09 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 generated_tests/gen_extensions_defined.py | 101 +++---
 1 file changed, 50 insertions(+), 51 deletions(-)

diff --git a/generated_tests/gen_extensions_defined.py 
b/generated_tests/gen_extensions_defined.py
index aee2af6..cbacc12 100644
--- a/generated_tests/gen_extensions_defined.py
+++ b/generated_tests/gen_extensions_defined.py
@@ -66,78 +66,77 @@ class Ext(object):
 # supported version of that extension, optionally it may contain a list of
 # stages supported.
 EXTENSIONS = [
-Ext("GL_ARB_draw_instanced", "110"),
-Ext("GL_ARB_draw_buffers", "110"),
-Ext("GL_ARB_enhanced_layouts", "140"),
-Ext("GL_ARB_separate_shader_objects", "110"),
-Ext("GL_ARB_texture_rectangle", "110"),
+Ext("GL_AMD_conservative_depth", "110"),
+Ext("GL_AMD_shader_stencil_export", "120"),
 Ext("GL_AMD_shader_trinary_minmax", "110"),
-Ext("GL_EXT_texture_array", "110"),
+Ext("GL_AMD_vertex_shader_layer", "130"),
+Ext("GL_AMD_vertex_shader_viewport_index", "110"),
 Ext("GL_ARB_ES3_1_compatibility", "430"),
 Ext("GL_ARB_arrays_of_arrays", "110"),
-Ext("GL_ARB_fragment_coord_conventions", "110"),
-Ext("GL_ARB_fragment_layer_viewport", "150"),
+Ext("GL_ARB_compute_shader", "110"),
+Ext("GL_ARB_conservative_depth", "110"),
+Ext("GL_ARB_derivative_control", "150"),
+Ext("GL_ARB_draw_buffers", "110"),
+Ext("GL_ARB_draw_instanced", "110"),
+Ext("GL_ARB_enhanced_layouts", "140"),
 Ext("GL_ARB_explicit_attrib_location", "110"),
 Ext("GL_ARB_explicit_uniform_location", "110"),
-Ext("GL_ARB_shader_texture_lod", "110"),
-Ext("GL_AMD_conservative_depth", "110"),
-Ext("GL_ARB_conservative_depth", "110"),
-Ext("GL_ARB_shader_bit_encoding", "110"),
-Ext("GL_ARB_shader_clock", "110"),
-Ext("GL_ARB_uniform_buffer_object", "110"),
-Ext("GL_ARB_texture_cube_map_array", "110"),
-Ext("GL_ARB_shading_language_packing", "110"),
-Ext("GL_ARB_texture_multisample", "110"),
-Ext("GL_ARB_texture_query_levels", "110"),
-Ext("GL_ARB_texture_query_lod", "110"),
+Ext("GL_ARB_fragment_coord_conventions", "110"),
+Ext("GL_ARB_fragment_layer_viewport", "150"),
+Ext("GL_ARB_geometry_shader4", "110"),
 Ext("GL_ARB_gpu_shader5", "150"),
 Ext("GL_ARB_gpu_shader_fp64", "150"),
-Ext("GL_ARB_vertex_attrib_64bit", "150"),
-Ext("GL_AMD_vertex_shader_layer", "130"),
-Ext("GL_AMD_vertex_shader_viewport_index", "110"),
-Ext("GL_ARB_shading_language_420pack", "110"),
 Ext("GL_ARB_sample_shading", "110"),
-Ext("GL_ARB_texture_gather", "110"),
-Ext("GL_ARB_shader_atomic_counters", "110"),
+Ext("GL_ARB_separate_shader_objects", "110"),
 Ext("GL_ARB_shader_atomic_counter_ops", "140"),
-Ext("GL_ARB_viewport_array", "110"),
-Ext("GL_ARB_compute_shader", "110"),
+Ext("GL_ARB_shader_atomic_counters", "110"),
+Ext("GL_ARB_shader_bit_encoding", "110"),
+Ext("GL_ARB_shader_clock", "110"),
+Ext("GL_ARB_shader_draw_parameters", "140"),
+Ext("GL_ARB_shader_group_vote", "110"),
 Ext("GL_ARB_shader_image_load_store", "130"),
 Ext("GL_ARB_shader_image_size", "110"),
-Ext("GL_ARB_shader_texture_image_samples", "110"),
-# That is what the original hand written test required.
-Ext("GL_ARB_derivative_control", "150"),
 Ext("GL_ARB_shader_precision", "110"),
+Ext("GL_ARB_shader_stencil_export", "120"),
 Ext("GL_ARB_shader_storage_buffer_object", "110"),
-Ext("GL_ARB_tessellation_shader", "150"),
 Ext("GL_ARB_shader_subroutine", "150"),
-Ext("GL_ARB_shader_draw_parameters", &quo

[Piglit] [PATCH 9/15] util: rename piglit_gl_reinitialize_extensions->piglit_gl_invalidate_extensions

2016-09-09 Thread Dylan Baker
From: Marek Olk 

---
 tests/util/piglit-framework-gl/piglit_wfl_framework.c | 3 ++-
 tests/util/piglit-util-gl.c   | 2 +-
 tests/util/piglit-util-gl.h   | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c 
b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index d312ef9..5968459 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -508,6 +508,7 @@ make_context_current_singlepass(struct piglit_wfl_framework 
*wfl_fw,
if (!ok)
goto fail;
 
+   piglit_gl_invalidate_extensions();
return true;
 
 fail:
@@ -520,7 +521,7 @@ fail:
wfl_fw->context = NULL;
wfl_fw->config = NULL;
 
-   piglit_gl_reinitialize_extensions();
+   piglit_gl_invalidate_extensions();
 
return false;
 }
diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index 75d634c..95eadd0 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -115,7 +115,7 @@ static void initialize_piglit_extension_support(void)
}
 }
 
-void piglit_gl_reinitialize_extensions()
+void piglit_gl_invalidate_extensions()
 {
if (gl_extensions != NULL) {
free(gl_extensions);
diff --git a/tests/util/piglit-util-gl.h b/tests/util/piglit-util-gl.h
index b416e50..78390c1 100644
--- a/tests/util/piglit-util-gl.h
+++ b/tests/util/piglit-util-gl.h
@@ -74,7 +74,7 @@ bool piglit_is_extension_supported(const char *name);
 /**
  * reinitialize the supported extension List.
  */
-void piglit_gl_reinitialize_extensions();
+void piglit_gl_invalidate_extensions();
 
 /**
  * \brief Convert a GL error to a string.
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 15/15] framework: add boilerplate to turn off process isolation

2016-09-09 Thread Dylan Baker
This adds a switch to to turn off process isolation (it is normally on),
for now this only affects shader_runner, but in the future could affect
more tests, like glslparsertest or dEQP.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 framework/options.py  |  1 +
 framework/programs/run.py | 22 ++
 piglit.conf.example   |  7 +++
 tests/all.py  | 34 +-
 tests/shader.py   |  4 ++--
 5 files changed, 61 insertions(+), 7 deletions(-)

diff --git a/framework/options.py b/framework/options.py
index 94a8084..5cb88aa 100644
--- a/framework/options.py
+++ b/framework/options.py
@@ -197,6 +197,7 @@ class _Options(object):  # pylint: 
disable=too-many-instance-attributes
 self.monitored = False
 self.sync = False
 self.deqp_mustpass = False
+self.process_isolation = True
 
 # env is used to set some base environment variables that are not going
 # to change across runs, without sending them to os.environ which is
diff --git a/framework/programs/run.py b/framework/programs/run.py
index f531b37..2f0e9dc 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -41,6 +41,16 @@ __all__ = ['run',
'resume']
 
 
+def booltype(val):
+if val.lower() in ['false', 'no', '0']:
+return False
+elif val.lower() in ['true', 'yes', '1']:
+return True
+raise argparse.ArgumentTypeError(
+'Case insensitve values of "yes", "no", "false", "true", and "0" or '
+'"1" are accepted.')
+
+
 def _default_platform():
 """ Logic to determine the default platform to use
 
@@ -183,6 +193,16 @@ def _run_parser(input_):
 help='Run only the tests in the deqp mustpass list '
  'when running a deqp gles{2,3,31} profile, '
  'otherwise run all tests.')
+parser.add_argument('--process-isolation',
+dest='process_isolation',
+action='store',
+type=booltype,
+default=core.PIGLIT_CONFIG.safe_get(
+'core', 'process isolation', 'true'),
+help='Set this to allow tests to run without process '
+ 'isolation. This allows, but does not require, '
+ 'tests to run multiple tests per process.
+ 'This value can also be set in piglit.conf.')
 parser.add_argument("test_profile",
 metavar="",
 nargs='+',
@@ -264,6 +284,7 @@ def run(input_):
 options.OPTIONS.monitored = args.monitored
 options.OPTIONS.sync = args.sync
 options.OPTIONS.deqp_mustpass = args.deqp_mustpass
+options.OPTIONS.process_isolation = args.process_isolation
 
 # Set the platform to pass to waffle
 options.OPTIONS.env['PIGLIT_PLATFORM'] = args.platform
@@ -352,6 +373,7 @@ def resume(input_):
 options.OPTIONS.monitored = results.options['monitored']
 options.OPTIONS.sync = results.options['sync']
 options.OPTIONS.deqp_mustpass = results.options['deqp_mustpass']
+options.OPTIONS.proces_isolation = results.options['process_isolation']
 
 core.get_config(args.config_file)
 
diff --git a/piglit.conf.example b/piglit.conf.example
index 56eb83d..17f2329 100644
--- a/piglit.conf.example
+++ b/piglit.conf.example
@@ -170,6 +170,13 @@ run_test=./%(test_name)s
 ; Default: 'bz2'
 ;compression=bz2
 
+; Set this value to change whether piglit defaults to using process isolation
+; or not. Care should be taken when using this option since it provides a
+; performance improvement, but with a cost in stability and reproducibility.
+; 
+; Default: True
+;process isolation=True
+
 [expected-failures]
 ; Provide a list of test names that are expected to fail.  These tests
 ; will be listed as passing in JUnit output when they fail.  Any
diff --git a/tests/all.py b/tests/all.py
index 3961656..2399d5e 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4,20 +4,26 @@
 from __future__ import (
 absolute_import, division, print_function, unicode_literals
 )
+import collections
 import itertools
 import os
 import platform
 
+import six
 from six.moves import range
 
 from framework import grouptools
+from framework import options
 from framework.profile import TestProfile
-from framework.test import (PiglitGLTest, GleanTest, ShaderTest,
+from framework.test import (PiglitGLTest, GleanTest,
 GLSLParserTest, GLSLParserNoConfigError)
+from framework.test.shader_test import ShaderTest, MultiShaderTest
 from .py_modules.constants import TESTS_DIR, GENERATED_TESTS_DIR
 
 __all__ = ['profile']
 
+PROCESS_ISOLATION = options.OPTIONS.process_isolation
+
 # Disable bad hanging indent error

[Piglit] [PATCH 11/15] shader_runner: add ability to run multiple tests per process

2016-09-09 Thread Dylan Baker
From: Marek Olk 

The performance is measured by running these:
spec/glsl-1.30/execution/built-in-functions/ (1420 tests)

Running piglit-run.py using the old way: 98 s
Running .../shader_runner *.shader_test:  8 s

It's more than 12x faster!!

The tests being run must be compatible. (we can't mix core, compat, and ES
tests) Thus, running shader_runner once per each spec/ directory should
be OK.

The context-window combo is destroyed and re-created with a different
configuration when test requirements demand it.

shader_runner tries to re-set all states between tests to prevent side
effects.

shader_runner isn't immune to crashes. The python framework must re-launch
shader_runner to run the remaining tests.
---
 tests/shaders/shader_runner.c | 226 ++-
 1 file changed, 221 insertions(+), 5 deletions(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index e7667c3..0056337 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -28,10 +28,16 @@
 #include "piglit-util.h"
 #include "piglit-util-gl.h"
 #include "piglit-vbo.h"
+#include "piglit-framework-gl/piglit_gl_framework.h"
 
 #include "shader_runner_gles_workarounds.h"
 #include "parser_utils.h"
 
+#define DEFAULT_WINDOW_WIDTH 250
+#define DEFAULT_WINDOW_HEIGHT 250
+
+static struct piglit_gl_test_config current_config;
+
 static void
 get_required_config(const char *script_name,
struct piglit_gl_test_config *config);
@@ -43,8 +49,8 @@ get_uints(const char *line, unsigned *uints, unsigned count);
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
 
-   config.window_width = 250;
-   config.window_height = 250;
+   config.window_width = DEFAULT_WINDOW_WIDTH;
+   config.window_height = DEFAULT_WINDOW_HEIGHT;
config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
 
if (argc > 1)
@@ -52,6 +58,8 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
else
config.supports_gl_compat_version = 10;
 
+   current_config = config;
+
 PIGLIT_GL_TEST_CONFIG_END
 
 static const char passthrough_vertex_shader_source[] =
@@ -84,6 +92,7 @@ struct string_to_enum {
 
 extern float piglit_tolerance[4];
 
+static int test_num = 1;
 static struct component_version gl_version;
 static struct component_version glsl_version;
 static struct component_version glsl_req_version;
@@ -3470,6 +3479,62 @@ init_test(const char *file)
return PIGLIT_PASS;
 }
 
+static void
+recreate_gl_context(char *exec_arg, int param_argc, char **param_argv)
+{
+   int argc = param_argc + 3;
+   char **argv = malloc(sizeof(char*) * argc);
+
+   if (!argv) {
+   fprintf(stderr, "%s: malloc failed.\n", __func__);
+   piglit_report_result(PIGLIT_FAIL);
+   }
+
+   argv[0] = exec_arg;
+   memcpy([1], param_argv, param_argc * sizeof(char*));
+   argv[argc-2] = "-auto";
+   argv[argc-1] = "-fbo";
+
+   if (gl_fw->destroy)
+   gl_fw->destroy(gl_fw);
+   gl_fw = NULL;
+
+   exit(main(argc, argv));
+}
+
+static bool
+validate_current_gl_context(const char *filename)
+{
+   struct piglit_gl_test_config config = {};
+
+   config.window_width = DEFAULT_WINDOW_WIDTH;
+   config.window_height = DEFAULT_WINDOW_HEIGHT;
+
+   get_required_config(filename, );
+
+   if (!current_config.supports_gl_compat_version !=
+   !config.supports_gl_compat_version)
+   return false;
+
+   if (!current_config.supports_gl_core_version !=
+   !config.supports_gl_core_version)
+   return false;
+
+   if (!current_config.supports_gl_es_version !=
+   !config.supports_gl_es_version)
+   return false;
+
+   if (current_config.window_width != config.window_width ||
+   current_config.window_height != config.window_height)
+   return false;
+
+   if (!(current_config.window_visual & PIGLIT_GL_VISUAL_DEPTH) &&
+   config.window_visual & PIGLIT_GL_VISUAL_DEPTH)
+   return false;
+
+   return true;
+}
+
 void
 piglit_init(int argc, char **argv)
 {
@@ -3478,6 +3543,10 @@ piglit_init(int argc, char **argv)
bool core = piglit_is_core_profile;
bool es;
enum piglit_result result;
+   float default_piglit_tolerance[4];
+
+   memcpy(default_piglit_tolerance, piglit_tolerance,
+  sizeof(piglit_tolerance));
 
piglit_require_GLSL();
 
@@ -3532,11 +3601,158 @@ piglit_init(int argc, char **argv)
exit(1);
}
 
+   render_width = piglit_width;
+   render_height = piglit_height;
+
+   /* Automatic mode can run multiple tests per session. */
+   if (piglit_automatic) {
+   char testname[4096], *ext;
+   int i, j;
+
+   for (i = 1; i < argc; i++) {
+   const char *hit, *filename = argv[i];
+
+   

[Piglit] [PATCH 14/15] framework: Plug in fast-skipping to MultiShaderTest

2016-09-09 Thread Dylan Baker
This adds fast-skipping support to the MultiShaderTest class. Both
patches seemed significant enough to warrant splitting them in two.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 framework/test/base.py|  8 +-
 framework/test/shader_test.py | 49 +++-
 2 files changed, 44 insertions(+), 13 deletions(-)

diff --git a/framework/test/base.py b/framework/test/base.py
index 224ca61..5f0491d 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -467,11 +467,17 @@ class ReducedProcessMixin(object):
 """
 
 def __init__(self, command, subtests=None, **kwargs):
-assert subtests  # This covers both "not None" and len(subtests) > 1
+assert subtests is not None
 super(ReducedProcessMixin, self).__init__(command, **kwargs)
 self._expected = subtests
 self._populate_subtests()
 
+def is_skip(self):
+"""Skip if the length of expected is 0."""
+if not self._expected:
+raise TestIsSkip('All subtests skipped')
+super(ReducedProcessMixin, self).is_skip()
+
 def __find_sub(self):
 """Helper for getting the next index."""
 return len([l for l in self.result.out.split('\n')
diff --git a/framework/test/shader_test.py b/framework/test/shader_test.py
index e72e2ec..447e8c0 100644
--- a/framework/test/shader_test.py
+++ b/framework/test/shader_test.py
@@ -32,8 +32,8 @@ import re
 
 from framework import exceptions
 from framework import status
-from .base import ReducedProcessMixin
-from .opengl import FastSkipMixin
+from .base import ReducedProcessMixin, TestIsSkip
+from .opengl import FastSkipMixin, FastSkip
 from .piglit_test import PiglitBaseTest
 
 __all__ = [
@@ -185,24 +185,49 @@ class MultiShaderTest(ReducedProcessMixin, 
PiglitBaseTest):
 """
 
 def __init__(self, filenames):
-# TODO fast skip.
-parser = Parser(filenames[0])
-parser.parse()
-prog = parser.prog
-files = [parser.filename]
-
-for each in filenames[1:]:
+assert filenames
+prog = None
+files = []
+subtests = []
+skips = []
+
+# Walk each subtest, and either add it to the list of tests to run, or
+# determine it is skip, and set the result of that test in the subtests
+# dictionary to skip without adding it ot the liest of tests to run
+for each in filenames:
 parser = Parser(each)
 parser.parse()
-assert parser.prog == prog
+subtest = os.path.basename(os.path.splitext(each)[0]).lower()
+
+if prog is not None:
+assert parser.prog == prog
+else:
+prog = parser.prog
+
+try:
+skipper = FastSkip(gl_required=parser.gl_required,
+   gl_version=parser.gl_version,
+   gles_version=parser.gles_version,
+   glsl_version=parser.glsl_version,
+   glsl_es_version=parser.glsl_es_version)
+skipper.test()
+except TestIsSkip:
+skips.append(subtest)
+continue
 files.append(parser.filename)
+subtests.append(subtest)
+
+assert len(subtests) + len(skips) == len(filenames), \
+'not all tests accounted for'
 
 super(MultiShaderTest, self).__init__(
 [prog] + files,
-subtests=[os.path.basename(os.path.splitext(f)[0]).lower()
-  for f in filenames],
+subtests=subtests,
 run_concurrent=True)
 
+for name in skips:
+self.result.subtests[name] = status.SKIP
+
 @PiglitBaseTest.command.getter  # pylint: disable=no-member
 def command(self):
 """Add -auto to the test command."""
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 10/15] util: move PIGLIT_PATH_SEP to piglit-util.h

2016-09-09 Thread Dylan Baker
From: Marek Olk 

---
 tests/util/piglit-util.c | 6 --
 tests/util/piglit-util.h | 6 ++
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/util/piglit-util.c b/tests/util/piglit-util.c
index 0a66a85..6ed9c9c 100644
--- a/tests/util/piglit-util.c
+++ b/tests/util/piglit-util.c
@@ -533,12 +533,6 @@ piglit_source_dir(void)
 return s;
 }
 
-#ifdef _WIN32
-#  define PIGLIT_PATH_SEP '\\'
-#else
-#  define PIGLIT_PATH_SEP '/'
-#endif
-
 size_t
 piglit_join_paths(char buf[], size_t buf_size, int n, ...)
 {
diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
index 4328863..ac8eb88 100644
--- a/tests/util/piglit-util.h
+++ b/tests/util/piglit-util.h
@@ -131,6 +131,12 @@ ffs(int i)
 #endif /* !__MINGW32__ */
 #endif /* !HAVE_FFS*/
 
+#ifdef _WIN32
+#  define PIGLIT_PATH_SEP '\\'
+#else
+#  define PIGLIT_PATH_SEP '/'
+#endif
+
 enum piglit_result {
PIGLIT_PASS,
PIGLIT_FAIL,
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 12/15] squash! shader_runner: add ability to run multiple tests per process

2016-09-09 Thread Dylan Baker
Bug fixes from me for the above patch.

I've split these out to make them easier to review. Before merging to
master this will be squashed into the previous patch.

Changes:
 - Fix the assertion of subuniform_locations
 - Add teardown function for UBOs that destroys objects and frees memory
 - Print 'PIGLIT TEST:' instead of test. This is more likely to be
   unique, and is needed by the framework for recovering from crashes
 - Print the 'PIGLIT TEST:' line to stderr as well as stdout
 - After freeing subuniform_locations also set the values back to NULL
 - Add a flag for subtest reporting. This allows the piglit framework to
   tell shader_runner that it wants the results as subtest reports, but
   allows the current users to continue to get the results the expect
   without making any changes. It also covers a few corners of resuming.
 - Ensure that shaders are cleaned-up after linking
 - call glDisable with GL_TEXTURE_2D
 - Cleanup textures after each test
 - Simplify the logic for calling piglit_present_results

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/shaders/shader_runner.c | 165 +++
 1 file changed, 110 insertions(+), 55 deletions(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 0056337..fc0de88 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -118,6 +118,8 @@ static GLuint fragment_shaders[256];
 static unsigned num_fragment_shaders = 0;
 static GLuint compute_shaders[256];
 static unsigned num_compute_shaders = 0;
+static GLuint textures[256];
+static unsigned num_textures = 0;
 static int num_uniform_blocks;
 static GLuint *uniform_block_bos;
 static GLenum geometry_layout_input_type = GL_TRIANGLES;
@@ -151,6 +153,8 @@ static GLuint vao = 0;
 static GLuint fbo = 0;
 static GLint render_width, render_height;
 
+static bool report_subtests = false;
+
 enum states {
none = 0,
requirements,
@@ -1082,50 +1086,26 @@ link_and_use_shaders(void)
 
result = process_shader(GL_VERTEX_SHADER, num_vertex_shaders, 
vertex_shaders);
if (result != PIGLIT_PASS)
-   return result;
+   goto cleanup;
result = process_shader(GL_TESS_CONTROL_SHADER, num_tess_ctrl_shaders, 
tess_ctrl_shaders);
if (result != PIGLIT_PASS)
-   return result;
+   goto cleanup;
result = process_shader(GL_TESS_EVALUATION_SHADER, 
num_tess_eval_shaders, tess_eval_shaders);
if (result != PIGLIT_PASS)
-   return result;
+   goto cleanup;
result = process_shader(GL_GEOMETRY_SHADER, num_geometry_shaders, 
geometry_shaders);
if (result != PIGLIT_PASS)
-   return result;
+   goto cleanup;
result = process_shader(GL_FRAGMENT_SHADER, num_fragment_shaders, 
fragment_shaders);
if (result != PIGLIT_PASS)
-   return result;
+   goto cleanup;
result = process_shader(GL_COMPUTE_SHADER, num_compute_shaders, 
compute_shaders);
if (result != PIGLIT_PASS)
-   return result;
+   goto cleanup;
 
if (!sso_in_use)
glLinkProgram(prog);
 
-   for (i = 0; i < num_vertex_shaders; i++) {
-   glDeleteShader(vertex_shaders[i]);
-   }
-
-   for (i = 0; i < num_tess_ctrl_shaders; i++) {
-   glDeleteShader(tess_ctrl_shaders[i]);
-   }
-
-   for (i = 0; i < num_tess_eval_shaders; i++) {
-   glDeleteShader(tess_eval_shaders[i]);
-   }
-
-   for (i = 0; i < num_geometry_shaders; i++) {
-   glDeleteShader(geometry_shaders[i]);
-   }
-
-   for (i = 0; i < num_fragment_shaders; i++) {
-   glDeleteShader(fragment_shaders[i]);
-   }
-
-   for (i = 0; i < num_compute_shaders; i++) {
-   glDeleteShader(compute_shaders[i]);
-   }
-
if (!sso_in_use) {
glGetProgramiv(prog, GL_LINK_STATUS, );
if (ok) {
@@ -1138,7 +1118,8 @@ link_and_use_shaders(void)
 
glGetProgramInfoLog(prog, size, NULL, prog_err_info);
 
-   return PIGLIT_PASS;
+   result = PIGLIT_PASS;
+   goto cleanup;
}
 
glUseProgram(prog);
@@ -1155,7 +1136,39 @@ link_and_use_shaders(void)
 
glGetProgramInfoLog(prog, size, NULL, prog_err_info);
}
-   return PIGLIT_PASS;
+
+cleanup:
+   for (i = 0; i < num_vertex_shaders; i++) {
+   glDeleteShader(vertex_shaders[i]);
+   }
+   num_vertex_shaders = 0;
+
+   for (i = 0; i < num_tess_ctrl_shaders; i++) {
+   glDeleteShader(tess_ctrl_shaders[i]);
+   }
+   num_tess_ctrl_shaders = 0;
+
+   for (i = 0; i < num_tess_eval_shaders; i++) {
+   glDeleteShader(tess_eval_shaders[i]);
+   }

[Piglit] [PATCH 8/15] util: always set piglit_is_core_profile

2016-09-09 Thread Dylan Baker
From: Marek Olk 

---
 tests/util/piglit-framework-gl/piglit_glut_framework.c | 7 ---
 tests/util/piglit-framework-gl/piglit_wfl_framework.c  | 2 ++
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/util/piglit-framework-gl/piglit_glut_framework.c 
b/tests/util/piglit-framework-gl/piglit_glut_framework.c
index 075ee0d..8ac2f65 100644
--- a/tests/util/piglit-framework-gl/piglit_glut_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_glut_framework.c
@@ -391,9 +391,10 @@ piglit_glut_framework_create(const struct 
piglit_gl_test_config *test_config)
 /* Check if we actually have a core profile */
{
int actual_version = piglit_get_gl_version();
-   if (actual_version >= 31 &&
-   !piglit_is_extension_supported("GL_ARB_compatibility"))
-   piglit_is_core_profile = true;
+
+   piglit_is_core_profile =
+   actual_version >= 31 &&
+   !piglit_is_extension_supported("GL_ARB_compatibility");
}
 
if (!check_gl_version(test_config))
diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c 
b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index 65174da..d312ef9 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -544,6 +544,8 @@ make_context_current(struct piglit_wfl_framework *wfl_fw,
}
}
 
+   piglit_is_core_profile = false;
+
if (test_config->supports_gl_core_version &&
test_config->supports_gl_compat_version) {
/* The above attempt to create a core context failed. */
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 4/15] framework: Bump JSON on disk format to version 9

2016-09-09 Thread Dylan Baker
This change makes the TestResult.pid field into a list of ints instead
of a list. This will be used by the multiple test per process tests to
ensure that all PIDs are recorded when the cherry features is invoked.

This is groundwork for later patches in the series.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 framework/backends/json.py|  18 +-
 framework/results.py  |   2 +-
 framework/test/base.py|   2 +-
 unittests/framework/backends/schema/piglit-9.json | 122 +++-
 unittests/framework/backends/shared.py|   4 +-
 unittests/framework/backends/test_json_update.py  |  85 ++-
 6 files changed, 228 insertions(+), 5 deletions(-)
 create mode 100644 unittests/framework/backends/schema/piglit-9.json

diff --git a/framework/backends/json.py b/framework/backends/json.py
index 7533f53..a954882 100644
--- a/framework/backends/json.py
+++ b/framework/backends/json.py
@@ -47,7 +47,7 @@ __all__ = [
 ]
 
 # The current version of the JSON results
-CURRENT_JSON_VERSION = 8
+CURRENT_JSON_VERSION = 9
 
 # The level to indent a final file
 INDENT = 4
@@ -296,6 +296,7 @@ def _update_results(results, filepath):
 5: _update_five_to_six,
 6: _update_six_to_seven,
 7: _update_seven_to_eight,
+8: _update_eight_to_nine,
 }
 
 while results.results_version < CURRENT_JSON_VERSION:
@@ -593,6 +594,21 @@ def _update_seven_to_eight(result):
 return result
 
 
+def _update_eight_to_nine(result):
+"""Update json results from version 8 to 9.
+
+This changes the PID feild of the TestResult object to alist of Integers or
+null rather than a single integer or null.
+
+"""
+for test in compat.viewvalues(result.tests):
+test.pid = [test.pid]
+
+result.results_version = 9
+
+return result
+
+
 REGISTRY = Registry(
 extensions=['', '.json'],
 backend=JSONBackend,
diff --git a/framework/results.py b/framework/results.py
index 756d261..f9ddcb4 100644
--- a/framework/results.py
+++ b/framework/results.py
@@ -162,7 +162,7 @@ class TestResult(object):
 self.images = None
 self.traceback = None
 self.exception = None
-self.pid = None
+self.pid = []
 if result:
 self.result = result
 else:
diff --git a/framework/test/base.py b/framework/test/base.py
index 63fcaf4..b667b15 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -322,7 +322,7 @@ class Test(object):
 universal_newlines=True,
 **_EXTRA_POPEN_ARGS)
 
-self.result.pid = proc.pid
+self.result.pid.append(proc.pid)
 if not _SUPPRESS_TIMEOUT:
 out, err = proc.communicate(timeout=self.timeout)
 else:
diff --git a/unittests/framework/backends/schema/piglit-9.json 
b/unittests/framework/backends/schema/piglit-9.json
new file mode 100644
index 000..33f7eef
--- /dev/null
+++ b/unittests/framework/backends/schema/piglit-9.json
@@ -0,0 +1,122 @@
+{
+"$schema": "http://json-schema.org/draft-04/schema#;,
+"title": "TestrunResult",
+"description": "The collection of all results",
+"type": "object",
+"properties": {
+"__type__": { "type": "string" },
+"clinfo": { "type": ["string", "null"] },
+"glxinfo": { "type": ["string", "null"] },
+"lspci": { "type": ["string", "null"] },
+"wglinfo": { "type": ["string", "null"] },
+"name": { "type": "string" },
+"results_version": { "type": "number" },
+"uname": { "type": [ "string", "null" ] },
+"time_elapsed": { "$ref": "#/definitions/timeAttribute" },
+"options": {
+"descrption": "The options that were invoked with this run. These 
are implementation specific and not required.",
+"type": "object",
+"properties": {
+"exclude_tests": { 
+"type": "array",
+"items": { "type": "string" },
+"uniqueItems": true
+},
+"include_filter": { 
+"type": "array",
+"items": { "type": "string" }
+},
+  

[Piglit] [PATCH 5/15] framework: Add a Mixin class for running multiple tests in a single process

2016-09-09 Thread Dylan Baker
This Mixin makes writing classes for handling tests that run multiple
tests in a single process simpler. It does this through the use of the
subtest feature. It makes it possible to implement two new methods, and
an aware interpret_result method and have support for this feature,
including a cherry-like resume feature that starts again after a test
crashes, without rerunning the crashed test.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 framework/test/base.py| 147 ++-
 framework/test/deqp.py|   4 +-
 unittests/framework/test/test_base.py | 138 -
 3 files changed, 280 insertions(+), 9 deletions(-)

diff --git a/framework/test/base.py b/framework/test/base.py
index b667b15..224ca61 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -40,6 +40,7 @@ import six
 from six.moves import range
 
 from framework import exceptions, options
+from framework import status
 from framework.results import TestResult
 
 # We're doing some special crazy here to make timeouts work on python 2. pylint
@@ -258,7 +259,9 @@ class Test(object):
 try:
 self.is_skip()
 except TestIsSkip as e:
-self.result.result = 'skip'
+self.result.result = status.SKIP
+for each in six.iterkeys(self.result.subtests):
+self.result.subtests[each] = status.SKIP
 self.result.out = e.reason
 self.result.returncode = None
 return
@@ -267,6 +270,8 @@ class Test(object):
 self._run_command()
 except TestRunError as e:
 self.result.result = six.text_type(e.status)
+for each in six.iterkeys(self.result.subtests):
+self.result.subtests[each] = six.text_type(e.status)
 self.result.out = six.text_type(e)
 self.result.returncode = None
 return
@@ -282,13 +287,18 @@ class Test(object):
 """
 pass
 
-def _run_command(self):
+def _run_command(self, **kwargs):
 """ Run the test command and get the result
 
 This method sets environment options, then runs the executable. If the
 executable isn't found it sets the result to skip.
 
 """
+# This allows the ReducedProcessMixin to work without having to whack
+# self.command (which should be treated as immutable), but is
+# considered private.
+command = kwargs.pop('_command', self.command)
+
 # Setup the environment for the test. Environment variables are taken
 # from the following sources, listed in order of increasing precedence:
 #
@@ -314,7 +324,7 @@ class Test(object):
 fullenv = {f(k): f(v) for k, v in _base}
 
 try:
-proc = subprocess.Popen(self.command,
+proc = subprocess.Popen(command,
 stdout=subprocess.PIPE,
 stderr=subprocess.PIPE,
 cwd=self.cwd,
@@ -382,7 +392,7 @@ class WindowResizeMixin(object):
 see: https://bugzilla.gnome.org/show_bug.cgi?id=680214
 
 """
-def _run_command(self):
+def _run_command(self, *args, **kwargs):
 """Run a test up 5 times when window resize is detected.
 
 Rerun the command up to 5 times if the window size changes, if it
@@ -391,7 +401,7 @@ class WindowResizeMixin(object):
 
 """
 for _ in range(5):
-super(WindowResizeMixin, self)._run_command()
+super(WindowResizeMixin, self)._run_command(*args, **kwargs)
 if "Got spurious window resize" not in self.result.out:
 return
 
@@ -439,3 +449,130 @@ class ValgrindMixin(object):
 else:
 # Test passed but has valgrind errors.
 self.result.result = 'fail'
+
+
+@six.add_metaclass(abc.ABCMeta)
+class ReducedProcessMixin(object):
+"""This Mixin simplifies writing Test classes that run more than one test
+in a single process.
+
+Although one of the benefits of piglit is it's process isolation, there are
+times that process isolation is too expensive for day to day runs, and
+running more than one test in a single process is a valid trade-off for
+decreased run times. This class helps to ease writing a Test class for such
+a purpose, while not suffering all of the drawback of the approach.
+
+The first way that this helps is that it provides crash detection and
+recovery, allowing a single subtest to crash
+"""
+
+def __init__(self, command, subtests=None, **kwargs):
+assert subtests  # This covers both "not None" and len(subtests) > 1
+super(ReducedProcessMixin, self).__init__(command, **kwargs)
+self._expecte

[Piglit] [PATCH 7/15] util: guard against double context destruction

2016-09-09 Thread Dylan Baker
From: Marek Olk 

this no longer crashes:
- create context (calls atexit)
- teardown context
- create context 2 (calls atexit)
- exit()
---
 tests/util/piglit-framework-gl.c | 4 
 1 file changed, 4 insertions(+), 0 deletions(-)

diff --git a/tests/util/piglit-framework-gl.c b/tests/util/piglit-framework-gl.c
index 9748ddf..1e03c73 100644
--- a/tests/util/piglit-framework-gl.c
+++ b/tests/util/piglit-framework-gl.c
@@ -177,8 +177,12 @@ piglit_gl_process_args(int *argc, char *argv[],
 static void
 destroy(void)
 {
+   if (!gl_fw)
+   return;
+
if (gl_fw->destroy)
gl_fw->destroy(gl_fw);
+   gl_fw = NULL;
 }
 
 void
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 6/15] shader_runner: propagate all errors to piglit_init

2016-09-09 Thread Dylan Baker
From: Marek Olk 

piglit_report_result prevents running multiple tests per process.
---
 tests/shaders/shader_runner.c | 231 +--
 1 file changed, 140 insertions(+), 91 deletions(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 8e29346..e7667c3 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -360,7 +360,7 @@ target_to_short_name(GLenum target)
 }
 
 
-static void
+static enum piglit_result
 compile_glsl(GLenum target)
 {
GLuint shader = glCreateShader(target);
@@ -368,33 +368,42 @@ compile_glsl(GLenum target)
 
switch (target) {
case GL_VERTEX_SHADER:
-   piglit_require_vertex_shader();
+   if (piglit_get_gl_version() < 20 &&
+   !(piglit_is_extension_supported("GL_ARB_shader_objects") &&
+ piglit_is_extension_supported("GL_ARB_vertex_shader")))
+   return PIGLIT_SKIP;
break;
case GL_FRAGMENT_SHADER:
-   piglit_require_fragment_shader();
+   if (piglit_get_gl_version() < 20 &&
+   !(piglit_is_extension_supported("GL_ARB_shader_objects") &&
+ piglit_is_extension_supported("GL_ARB_fragment_shader")))
+   return PIGLIT_SKIP;
break;
case GL_TESS_CONTROL_SHADER:
case GL_TESS_EVALUATION_SHADER:
if (gl_version.num < (gl_version.es ? 32 : 40))
-   piglit_require_extension(gl_version.es ?
-"GL_OES_tessellation_shader" :
-"GL_ARB_tessellation_shader");
+   if (!piglit_is_extension_supported(gl_version.es ?
+  
"GL_OES_tessellation_shader" :
+  
"GL_ARB_tessellation_shader"))
+   return PIGLIT_SKIP;
break;
case GL_GEOMETRY_SHADER:
if (gl_version.num < 32)
-   piglit_require_extension(gl_version.es ?
-"GL_OES_geometry_shader" :
-"GL_ARB_geometry_shader4");
+   if (!piglit_is_extension_supported(gl_version.es ?
+  
"GL_OES_geometry_shader" :
+  
"GL_ARB_geometry_shader4"))
+   return PIGLIT_SKIP;
break;
case GL_COMPUTE_SHADER:
if (gl_version.num < (gl_version.es ? 31 : 43))
-   piglit_require_extension("GL_ARB_compute_shader");
+   if 
(!piglit_is_extension_supported("GL_ARB_compute_shader"))
+   return PIGLIT_SKIP;
break;
}
 
if (!glsl_req_version.num) {
printf("GLSL version requirement missing\n");
-   piglit_report_result(PIGLIT_FAIL);
+   return PIGLIT_FAIL;
}
 
if (!strstr(shader_string, "#version ")) {
@@ -441,7 +450,7 @@ compile_glsl(GLenum target)
info);
 
free(info);
-   piglit_report_result(PIGLIT_FAIL);
+   return PIGLIT_FAIL;
}
 
switch (target) {
@@ -470,9 +479,10 @@ compile_glsl(GLenum target)
num_compute_shaders++;
break;
}
+   return PIGLIT_PASS;
 }
 
-static void
+static enum piglit_result
 compile_and_bind_program(GLenum target, const char *start, int len)
 {
GLuint prog;
@@ -480,25 +490,29 @@ compile_and_bind_program(GLenum target, const char 
*start, int len)
 
switch (target) {
case GL_VERTEX_PROGRAM_ARB:
-   piglit_require_extension("GL_ARB_vertex_program");
+   if (!piglit_is_extension_supported("GL_ARB_vertex_program"))
+   return PIGLIT_SKIP;
break;
case GL_FRAGMENT_PROGRAM_ARB:
-   piglit_require_extension("GL_ARB_fragment_program");
+   if (!piglit_is_extension_supported("GL_ARB_fragment_program"))
+   return PIGLIT_SKIP;
break;
}
 
source = malloc(len + 1);
memcpy(source, start, len);
source[len] = 0;
-   prog = piglit_compile_program(target, source);
+   prog = piglit_compile_program(target, source);//TODO
 
glEnable(target);
glBindProgramARB(target, prog);
link_ok = true;
prog_in_use = true;
+
+   return PIGLIT_PASS;
 }
 
-static void
+static enum piglit_result
 link_sso(GLenum target)
 {
GLint ok;
@@ -521,9 +535,7 @@ link_sso(GLenum target)
prog_err_info);
 
  

[Piglit] [PATCH 3/15] framework: Split FastSkipMixin.

2016-09-09 Thread Dylan Baker
This splits the FastSkipMixin into two classes. One that actually does
the fast skipping, and one that provides a mixin for Test.

This split will allow the class to be used in the traditional way, but
also in shader_test.MultiShaderTest.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 framework/test/opengl.py| 182 ++--
 unittests/framework/test/test_opengl.py | 192 ++---
 2 files changed, 251 insertions(+), 123 deletions(-)

diff --git a/framework/test/opengl.py b/framework/test/opengl.py
index 6fe8670..e19e437 100644
--- a/framework/test/opengl.py
+++ b/framework/test/opengl.py
@@ -37,6 +37,7 @@ from .base import TestIsSkip
 # pylint: disable=too-few-public-methods
 
 __all__ = [
+'FastSkip',
 'FastSkipMixin',
 ]
 
@@ -287,23 +288,11 @@ class WflInfo(object):
 return ret
 
 
-class FastSkipMixin(object):
-"""Fast test skipping for OpenGL based suites.
-
-This provides an is_skip() method which will skip the test if an of it's
-requirements are not met.
+class FastSkip(object):
+"""A class for testing OpenGL requirements.
 
-It also provides new attributes:
-gl_reqruied -- This is a set of extensions that are required for running
-   the extension.
-gl_version -- A float that is the required version number for an OpenGL
-  test.
-gles_version -- A float that is the required version number for an OpenGL
-ES test
-glsl_version -- A float that is the required version number of OpenGL
-Shader Language for a test
-glsl_ES_version -- A float that is the required version number of OpenGL ES
-   Shader Language for a test
+This class provides a mechanism for testing OpenGL requirements, and
+skipping tests that have unmet requirements
 
 This requires wflinfo to be installed and accessible to provide it's
 functionality, however, it will no-op if wflinfo is not accessible.
@@ -312,75 +301,186 @@ class FastSkipMixin(object):
 it is better to run a few tests that could have been skipped, than to skip
 all the tests that could have, but also a few that should have run.
 
+Keyword Arguments:
+gl_reqruied -- This is a set of extensions that are required for
+   running the extension.
+gl_version  -- A float that is the required version number for an
+   OpenGL test.
+gles_version-- A float that is the required version number for an
+   OpenGL ES test
+glsl_version-- A float that is the required version number of OpenGL
+   Shader Language for a test
+glsl_es_version -- A float that is the required version number of OpenGL ES
+   Shader Language for a test
 """
-# XXX: This still gets called once for each thread. (4 times with 4
-# threads), this is a synchronization issue and I don't know how to stop it
-# other than querying each value before starting the thread pool.
-__info = WflInfo()
+__slots__ = ['gl_required', 'gl_version', 'gles_version', 'glsl_version',
+ 'glsl_es_version']
 
-def __init__(self, command, gl_required=None, gl_version=None,
- gles_version=None, glsl_version=None, glsl_es_version=None,
- **kwargs):  # pylint: disable=too-many-arguments
-super(FastSkipMixin, self).__init__(command, **kwargs)
+info = WflInfo()
+
+def __init__(self, gl_required=None, gl_version=None, gles_version=None,
+ glsl_version=None, glsl_es_version=None):
 self.gl_required = gl_required or set()
 self.gl_version = gl_version
 self.gles_version = gles_version
 self.glsl_version = glsl_version
 self.glsl_es_version = glsl_es_version
 
-def is_skip(self):
+def test(self):
 """Skip this test if any of it's feature requirements are unmet.
 
 If no extensions were calculated (if wflinfo isn't installed) then run
 all tests.
 
+Raises:
+TestIsSkip   -- if any of the conditions passed to self are false
 """
-if self.__info.gl_extensions:
+if self.info.gl_extensions:
 for extension in self.gl_required:
-if extension not in self.__info.gl_extensions:
+if extension not in self.info.gl_extensions:
 raise TestIsSkip(
 'Test requires extension {} '
 'which is not available'.format(extension))
 
 # TODO: Be able to handle any operator
-if (self.__info.gl_version is not None
+if (self.info.gl_version is not None
 and self.gl_version is not None
-and self.gl_version > self.__info.gl_version):
+  

[Piglit] [PATCH 0/15] Add support for shader_runner to run more than one test per process

2016-09-09 Thread Dylan Baker
This allows shader_runner to consume more than one test at a time. When
it does this it reports the results as subtests rather than as regular
tests. It also updates the python framework to handle and resume from
crashes in the tests. When this mode is enabled, shader_runner runs an
entire directory of shader_test files at a time.

This makes shader_runner (which takes up the bulk of piglit) run much
faster, even compared to per-process with fast skipping enabled, but at
the cost of the robustness and precision of process isolation. For that
reason its an option that must be enabled, the default should always be
robustness not speed. This can be forced on in piglit.conf.

>From a performance standpoint it's impressive (this is a 4 thread HSW):
PIGLIT_NO_FAST_SKIP=1 ./piglit run shader ns_w_is -c
936.35s user 611.18s system 301% cpu 8:33.71 total
./piglit run shader fs_w_is -c
726.21s user 398.25s system 306% cpu 6:07.23 total
PIGLIT_NO_FAST_SKIP=1 ./piglit run shader ns_no_is -c --no-process-isolation
334.21s user 122.04s system 201% cpu 3:46.55 total
./piglit run shader fs_no_is -c --no-process-isolation
160.47s user 7.83s system 293% cpu 57.327 total

For the general use case (With fast skipping) this is a reduction of 5
minutes of runtime. With fast-skipping seems pretty useful, as it
reduces runtime by 3 minutes even with the removal of process isolation.

Dylan Baker (9):
  framework/results: Lower subtest names
  framework: Split the file parsing code out of ShaderTest
  framework: Split FastSkipMixin.
  framework: Bump JSON on disk format to version 9
  framework: Add a Mixin class for running multiple tests in a single process
  squash! shader_runner: add ability to run multiple tests per process
  framework: Add class for running multiple shader_tests in a single process
  framework: Plug in fast-skipping to MultiShaderTest
  framework: add boilerplate to turn off process isolation

Marek Olk (6):
  shader_runner: propagate all errors to piglit_init
  util: guard against double context destruction
  util: always set piglit_is_core_profile
  util: rename 
piglit_gl_reinitialize_extensions->piglit_gl_invalidate_extensions
  util: move PIGLIT_PATH_SEP to piglit-util.h
  shader_runner: add ability to run multiple tests per process

 framework/backends/json.py |  18 +-
 framework/options.py   |   1 +-
 framework/programs/run.py  |  22 +-
 framework/results.py   |   8 +-
 framework/test/base.py | 155 ++-
 framework/test/deqp.py |   4 +-
 framework/test/opengl.py   | 182 ++-
 framework/test/shader_test.py  | 201 +++-
 piglit.conf.example|   7 +-
 tests/all.py   |  34 +-
 tests/shader.py|   4 +-
 tests/shaders/shader_runner.c  | 560 +++---
 tests/util/piglit-framework-gl.c   |   4 +-
 tests/util/piglit-framework-gl/piglit_glut_framework.c |   7 +-
 tests/util/piglit-framework-gl/piglit_wfl_framework.c  |   5 +-
 tests/util/piglit-util-gl.c|   2 +-
 tests/util/piglit-util-gl.h|   2 +-
 tests/util/piglit-util.c   |   6 +-
 tests/util/piglit-util.h   |   6 +-
 unittests/framework/backends/schema/piglit-9.json  | 122 ++-
 unittests/framework/backends/shared.py |   4 +-
 unittests/framework/backends/test_json_update.py   |  85 ++-
 unittests/framework/test/test_base.py  | 138 +-
 unittests/framework/test/test_opengl.py| 192 +--
 unittests/framework/test/test_shader_test.py   |  63 +-
 25 files changed, 1514 insertions(+), 318 deletions(-)
 create mode 100644 unittests/framework/backends/schema/piglit-9.json

-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH 2/15] framework: Split the file parsing code out of ShaderTest

2016-09-09 Thread Dylan Baker
This is both nicer since it provides better code quality (a separation
of roles), and because it's going to make writing a shader_test class
that can do N:1 tests much easier.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 framework/test/shader_test.py | 106 ++-
 1 file changed, 68 insertions(+), 38 deletions(-)

diff --git a/framework/test/shader_test.py b/framework/test/shader_test.py
index e67c5ed..2b14f17 100644
--- a/framework/test/shader_test.py
+++ b/framework/test/shader_test.py
@@ -38,13 +38,9 @@ __all__ = [
 ]
 
 
-class ShaderTest(FastSkipMixin, PiglitBaseTest):
-""" Parse a shader test file and return a PiglitTest instance
-
-This function parses a shader test to determine if it's a GL, GLES2 or
-GLES3 test, and then returns a PiglitTest setup properly.
+class Parser(object):
+"""An object responsible for parsing a shader_test file."""
 
-"""
 _is_gl = re.compile(r'GL (<|<=|=|>=|>) \d\.\d')
 _match_gl_version = re.compile(
 r'^GL\s+(?PES)?\s*(?P(<|<=|=|>=|>))\s*(?P\d\.\d)')
@@ -52,20 +48,23 @@ class ShaderTest(FastSkipMixin, PiglitBaseTest):
 r'^GLSL\s+(?PES)?\s*(?P(<|<=|=|>=|>))\s*(?P\d\.\d+)')
 
 def __init__(self, filename):
-gl_required = set()
-gl_version = None
-gles_version = None
-glsl_version = None
-glsl_es_version = None
-op = None
-sl_op = None
-
+self.filename = filename
+self.gl_required = set()
+self._gl_version = None
+self._gles_version = None
+self._glsl_version = None
+self._glsl_es_version = None
+self.prog = None
+self.__op = None
+self.__sl_op = None
+
+def parse(self):
 # Iterate over the lines in shader file looking for the config section.
 # By using a generator this can be split into two for loops at minimal
 # cost. The first one looks for the start of the config block or raises
 # an exception. The second looks for the GL version or raises an
 # exception
-with io.open(filename, mode='r', encoding='utf-8') as shader_file:
+with io.open(self.filename, mode='r', encoding='utf-8') as shader_file:
 # The mock in python 3.3 doesn't support readlines(), so use
 # read().split() as a workaround
 lines = (l for l in shader_file.read().split('\n'))
@@ -80,33 +79,33 @@ class ShaderTest(FastSkipMixin, PiglitBaseTest):
 break
 else:
 raise exceptions.PiglitFatalError(
-"In file {}: Config block not found".format(filename))
+"In file {}: Config block not found".format(self.filename))
 
 for line in lines:
 if line.startswith('GL_') and not line.startswith('GL_MAX'):
-gl_required.add(line.strip())
+self.gl_required.add(line.strip())
 continue
 
 # Find any GLES requirements.
-if not (gl_version or gles_version):
+if not (self._gl_version or self._gles_version):
 m = self._match_gl_version.match(line)
 if m:
-op = m.group('op')
+self.__op = m.group('op')
 if m.group('es'):
-gles_version = float(m.group('ver'))
+self._gles_version = float(m.group('ver'))
 else:
-gl_version = float(m.group('ver'))
+self._gl_version = float(m.group('ver'))
 continue
 
-if not (glsl_version or glsl_es_version):
+if not (self._glsl_version or self._glsl_es_version):
 # Find any GLSL requirements
 m = self._match_glsl_version.match(line)
 if m:
-sl_op = m.group('op')
+self.__sl_op = m.group('op')
 if m.group('es'):
-glsl_es_version = float(m.group('ver'))
+self._glsl_es_version = float(m.group('ver'))
 else:
-glsl_version = float(m.group('ver'))
+self._glsl_version = float(m.group('ver'))
 continue
 
 if line.startswith('['):
@@ -115,24 +114,55 @@ class ShaderTest(FastSkipMixin, PiglitBaseTest):
 # Select the correct binary to run the test, but be as conservative as
 # possible by always selecting the lowest version that meets the
 # criteria.
-if gles_version:
-if op in ['<', '<='] or op in ['=', '>='] and gles_version < 3:
-prog = 'shader_runner_gles2'
+if self._gles_version:
+

Re: [Piglit] [PATCH] cts_gl.py: only generate tests for GL45-CTS

2016-09-09 Thread Dylan Baker
Quoting Marek Olšák (2016-09-09 06:10:56)
> From: Marek Olšák 
> 
> Older versions don't work and there is no interest in fixing the official
> gl45release CTS branch, so it's useless to add those forever-broken tests.
> 
> Using '-t gl45-cts' is annoying, because adding '-t cube' adds non-GL45
> tests instead of filtering the already filtered list.

-t takes a regex so you could do something like -t 'gl45*cube'

That said I have no opinion one way or the other about this.

Dylan

> ---
>  tests/cts_gl.py | 18 --
>  1 file changed, 18 deletions(-)
> 
> diff --git a/tests/cts_gl.py b/tests/cts_gl.py
> index d650ffd..f647613 100644
> --- a/tests/cts_gl.py
> +++ b/tests/cts_gl.py
> @@ -62,31 +62,13 @@ class DEQPCTSTest(deqp.DEQPBaseTest):
>  
>  @property
>  def extra_args(self):
>  return super(DEQPCTSTest, self).extra_args + \
>  [x for x in _EXTRA_ARGS if not x.startswith('--deqp-case')]
>  
>  # Add all of the suites by default, users can use filters to remove them.
>  profile = deqp.make_profile(  # pylint: disable=invalid-name
>  itertools.chain(
>  deqp.iter_deqp_test_cases(
> -deqp.gen_caselist_txt(_CTS_BIN, 'GL30-CTS-cases.txt', 
> _EXTRA_ARGS)),
> -deqp.iter_deqp_test_cases(
> -deqp.gen_caselist_txt(_CTS_BIN, 'GL31-CTS-cases.txt', 
> _EXTRA_ARGS)),
> -deqp.iter_deqp_test_cases(
> -deqp.gen_caselist_txt(_CTS_BIN, 'GL32-CTS-cases.txt', 
> _EXTRA_ARGS)),
> -deqp.iter_deqp_test_cases(
> -deqp.gen_caselist_txt(_CTS_BIN, 'GL33-CTS-cases.txt', 
> _EXTRA_ARGS)),
> -deqp.iter_deqp_test_cases(
> -deqp.gen_caselist_txt(_CTS_BIN, 'GL40-CTS-cases.txt', 
> _EXTRA_ARGS)),
> -deqp.iter_deqp_test_cases(
> -deqp.gen_caselist_txt(_CTS_BIN, 'GL41-CTS-cases.txt', 
> _EXTRA_ARGS)),
> -deqp.iter_deqp_test_cases(
> -deqp.gen_caselist_txt(_CTS_BIN, 'GL42-CTS-cases.txt', 
> _EXTRA_ARGS)),
> -deqp.iter_deqp_test_cases(
> -deqp.gen_caselist_txt(_CTS_BIN, 'GL43-CTS-cases.txt', 
> _EXTRA_ARGS)),
> -deqp.iter_deqp_test_cases(
> -deqp.gen_caselist_txt(_CTS_BIN, 'GL44-CTS-cases.txt', 
> _EXTRA_ARGS)),
> -deqp.iter_deqp_test_cases(
>  deqp.gen_caselist_txt(_CTS_BIN, 'GL45-CTS-cases.txt', 
> _EXTRA_ARGS)),
>  ),
>  DEQPCTSTest)
> -- 
> 2.7.4
> 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit


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


Re: [Piglit] [PATCH] egl-khr-debug: Start adding tests for EGL_KHR_debug

2016-09-08 Thread Dylan Baker
Quoting Adam Jackson (2016-09-08 10:41:30)
> First test does some basic API error checking, then provokes an error
> against the (implicit) thread object. There is clearly much more to
> cover here, but this at least touches all of the new entrypoints and
> verifies that it errors reasonably when misused.
> 
> Signed-off-by: Adam Jackson 
> ---
>  tests/all.py   |   6 +
>  tests/egl/spec/CMakeLists.txt  |   1 +
>  tests/egl/spec/egl_khr_debug/CMakeLists.no_api.txt |  14 ++
>  tests/egl/spec/egl_khr_debug/CMakeLists.txt|   1 +
>  tests/egl/spec/egl_khr_debug/common.c  |  44 ++
>  tests/egl/spec/egl_khr_debug/egl-khr-debug.h   |  36 +
>  tests/egl/spec/egl_khr_debug/thread.c  | 153 
> +
>  7 files changed, 255 insertions(+)
>  create mode 100644 tests/egl/spec/egl_khr_debug/CMakeLists.no_api.txt
>  create mode 100644 tests/egl/spec/egl_khr_debug/CMakeLists.txt
>  create mode 100644 tests/egl/spec/egl_khr_debug/common.c
>  create mode 100644 tests/egl/spec/egl_khr_debug/egl-khr-debug.h
>  create mode 100644 tests/egl/spec/egl_khr_debug/thread.c
> 
> diff --git a/tests/all.py b/tests/all.py
> index 3961656..5de994f 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -4433,6 +4433,12 @@ with profile.group_manager(
>  
>  with profile.group_manager(
>  PiglitGLTest,
> +grouptools.join('spec', 'egl_khr_debug'),
> +exclude_platforms=['glx']) as g:
> +g(['egl-khr-debug-thread'], 'thread object', run_concurrent=True)

run_concurrent=True is the default value, so no need for it.


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


Re: [Piglit] Newbie question: command to run tests that passed before?

2016-09-07 Thread Dylan Baker
Quoting Dylan Baker (2016-09-07 16:23:43)
> Quoting Dan Kegel (2016-09-07 15:59:21)
> > Hi!
> > I'd like to use piglit as a regression test for my opengl test rigs.
> > My plan is to run piglit a few times on each OS/card combo I need to 
> > support,
> > get a list of tests that reliably pass on each platform, and then
> > forevermore run just those tests.
> > 
> > I know about the -t and -x options, and the --test-list option, and
> > about writing test profiles,
> > but am still not sure what the best way to generate a list of passing
> > tests to pass to e.g. --test-list.
> > Test names are a little hard for this newbie to identify in the output
> > of piglit summary console.
> > 
> > After looking at the source a bit, I tried generating a list of passed
> > tests like this:
> > ./piglit summary console results/quick | grep ': pass$' | sed
> > 's/:.*//' | tr / @ > tests.list
> > but that includes output
> > spec@!opengl 1.1@max-texture-size-level
> > spec@!opengl 1.1@max-texture-size@GL_PROXY_TEXTURE_1D-GL_RGBA16
> > 
> > which leads to errors from --test-list tests.list like
> > Fatal Error: Cannot reorder test: "spec@!opengl
> > 1.1@max-texture-size@GL_PROXY_TEXTURE_1D-GL_RGBA16", it is not in the
> > profile.
> > 
> > Suggestions?
> 
> That's an interesting corner you've found. What's happening is that
> GL_PROXY_TEXTURE_1D-GL_RGBA16 is a subtest of 
> spec@!opengl 1.1@max-texture-size, and thus isn't in the test list at
> all.
> 
> This is actually an odd corner of a known deficiency, the inability to
> filter on subtests. I've been thinking a lot about how to fix this, but
> there isn't a straight forward way to fix it (that I've been able to
> come up with). I guess I should bump this up on my list of things to do.
> 
> The easiest thing I can com up with off the top my head would be to
> write a little script to parse the output and output what you want.
> 
> Something like this should work (untested):
> 
> """
> import argparse
> 
> from framework import backends
> 
> def main():
> parser = argparse.ArgumentParser()
> parser.add_argument('file')
> args = parser.parse_args()
> 
> results = backends.load(args._file)

Oops, that should be 'args.file'. Just my auto-completion being
"helpful".

> with open('myfile', 'w') as f:
> for name, value in results.tests.items():
> if value.result == 'pass':
> f.write(name)
> f.write('\n')
> 
> 
> if __name__ == '__main__':
> main()
> """
> 
> Obviously you'll need to be in the piglit source directory or add it to
> your PYTHON_PATH to make this work, since it relies on using the piglit
> framework.
> 
> Dylan
> 
> 
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/piglit


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


Re: [Piglit] Newbie question: command to run tests that passed before?

2016-09-07 Thread Dylan Baker
Quoting Mark Janes (2016-09-07 16:24:11)
> Piglit converts "known failing" tests to a "skip" status.

This is only true of the JUnit backend. I've never bothered to get that
working with the default JSON backend. Its on my list of things to do,
just not very high up on that list.

Dylan


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


Re: [Piglit] Newbie question: command to run tests that passed before?

2016-09-07 Thread Dylan Baker
Quoting Dan Kegel (2016-09-07 16:10:46)
> Hrm.  A solution that involved Jenkins would be way overkill.
> I'm just looking for the little core idiom for running just the
> test of tests that passed in the, um, past.
> 
> Maybe that's not the way people do it?  Does everyone just compare
> logs against old logs?

The Intel CI system is set up to do regression testing, tests that
failed before the CI system was created or are new and fail immediately
are marked as expected failures and ignored, only tests that previously
passed but now fail are considered bugs. We also blacklist tests (per
platform) that pass or fail sporadically.

Dylan


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


Re: [Piglit] Newbie question: command to run tests that passed before?

2016-09-07 Thread Dylan Baker
Quoting Dan Kegel (2016-09-07 15:59:21)
> Hi!
> I'd like to use piglit as a regression test for my opengl test rigs.
> My plan is to run piglit a few times on each OS/card combo I need to support,
> get a list of tests that reliably pass on each platform, and then
> forevermore run just those tests.
> 
> I know about the -t and -x options, and the --test-list option, and
> about writing test profiles,
> but am still not sure what the best way to generate a list of passing
> tests to pass to e.g. --test-list.
> Test names are a little hard for this newbie to identify in the output
> of piglit summary console.
> 
> After looking at the source a bit, I tried generating a list of passed
> tests like this:
> ./piglit summary console results/quick | grep ': pass$' | sed
> 's/:.*//' | tr / @ > tests.list
> but that includes output
> spec@!opengl 1.1@max-texture-size-level
> spec@!opengl 1.1@max-texture-size@GL_PROXY_TEXTURE_1D-GL_RGBA16
> 
> which leads to errors from --test-list tests.list like
> Fatal Error: Cannot reorder test: "spec@!opengl
> 1.1@max-texture-size@GL_PROXY_TEXTURE_1D-GL_RGBA16", it is not in the
> profile.
> 
> Suggestions?

That's an interesting corner you've found. What's happening is that
GL_PROXY_TEXTURE_1D-GL_RGBA16 is a subtest of 
spec@!opengl 1.1@max-texture-size, and thus isn't in the test list at
all.

This is actually an odd corner of a known deficiency, the inability to
filter on subtests. I've been thinking a lot about how to fix this, but
there isn't a straight forward way to fix it (that I've been able to
come up with). I guess I should bump this up on my list of things to do.

The easiest thing I can com up with off the top my head would be to
write a little script to parse the output and output what you want.

Something like this should work (untested):

"""
import argparse

from framework import backends

def main():
parser = argparse.ArgumentParser()
parser.add_argument('file')
args = parser.parse_args()

results = backends.load(args._file)
with open('myfile', 'w') as f:
for name, value in results.tests.items():
if value.result == 'pass':
f.write(name)
f.write('\n')


if __name__ == '__main__':
main()
"""

Obviously you'll need to be in the piglit source directory or add it to
your PYTHON_PATH to make this work, since it relies on using the piglit
framework.

Dylan


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


[Piglit] [PATCH v2 33/37] glean/tfragprog1: port exp-fog tests to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  2 +-
 tests/glean/tfragprog1.cpp | 43 +---
 tests/spec/arb_fragment_program/fog/calculated-exp.shader_test | 35 ++-
 tests/spec/arb_fragment_program/fog/exp.shader_test| 24 -
 4 files changed, 59 insertions(+), 45 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/fog/calculated-exp.shader_test
 create mode 100644 tests/spec/arb_fragment_program/fog/exp.shader_test

diff --git a/tests/all.py b/tests/all.py
index 84999e6..f533893 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -379,8 +379,6 @@ glean_fp_tests = [
   'Z-write test',
   'Divide by zero test',
   'Infinity and nan test',
-  'ARB_fog_exp test',
-  'Computed fog exp test',
   'ARB_fog_exp2 test',
   'Computed fog exp2 test']
 
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index feb6bdc..b34a348 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -131,49 +131,6 @@ static const FragmentProgram Programs[] = {
},
 
// = Fog tests 
-   // Exp fog
-#define FOG_FACT 0.2231   // = exp(-Density * Coord)
-   {
-   "ARB_fog_exp test",
-   "!!ARBfp1.0\n"
-   "OPTION ARB_fog_exp; \n"
-   "MOV result.color, fragment.color; \n"
-   "END \n",
-   { FragColor[0] * FOG_FACT + FogColor[0] * (1.0 - FOG_FACT),
- FragColor[1] * FOG_FACT + FogColor[1] * (1.0 - FOG_FACT),
- FragColor[2] * FOG_FACT + FogColor[2] * (1.0 - FOG_FACT),
- FragColor[3]
-   },
-   DONT_CARE_Z
-   },
-#undef FOG_FACT
-#define FOG_FACT 0.3535   // = ex2(-Density * Coord)
-   {
-   // NOTE: we could also do this with the POW instruction
-   "Computed fog exp test",
-   "!!ARBfp1.0\n"
-   "# fogParams.x = density \n"
-   "# fogParams.y = start \n"
-   "# fogParams.z = end \n"
-   "# fogParams.w = 1/(end-start) \n"
-   "PARAM fogParams = state.fog.params; \n"
-   "ATTRIB fogCoord = fragment.fogcoord; \n"
-   "PARAM fogColor = state.fog.color; \n"
-   "TEMP f, dc; \n"
-   "# f = exp(-density * coord) \n"
-   "MUL dc.x, fogParams.x, fogCoord.x; \n"
-   "EX2_SAT f, -dc.x; \n"
-   "LRP result.color.rgb, f, fragment.color, fogColor; \n"
-   "MOV result.color.a, fragment.color.a; \n"
-   "END \n",
-   { FragColor[0] * FOG_FACT + FogColor[0] * (1.0 - FOG_FACT),
- FragColor[1] * FOG_FACT + FogColor[1] * (1.0 - FOG_FACT),
- FragColor[2] * FOG_FACT + FogColor[2] * (1.0 - FOG_FACT),
-  FragColor[3]
-   },
-   DONT_CARE_Z
-   },
-#undef FOG_FACT
 
// Exp2 fog
 #define FOG_FACT 0.1054   // = exp(-(Density * Coord)^2)
diff --git a/tests/spec/arb_fragment_program/fog/calculated-exp.shader_test 
b/tests/spec/arb_fragment_program/fog/calculated-exp.shader_test
new file mode 100644
index 000..0602d24
--- /dev/null
+++ b/tests/spec/arb_fragment_program/fog/calculated-exp.shader_test
@@ -0,0 +1,35 @@
+[require]
+GL >= 1.4
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+# fogParams.x = density
+# fogParams.y = start
+# fogParams.z = end
+# fogParams.w = 1/(end-start)
+PARAM fogParams = state.fog.params;
+ATTRIB fogCoord = fragment.fogcoord;
+PARAM p = {0.2, 0.4, 0.6, 0.8};
+PARAM fogColor = state.fog.color;
+TEMP f, dc;
+# f = exp(-density * coord)
+MUL dc.x, fogParams.x, fogCoord.x;
+EX2_SAT f, -dc.x;
+LRP result.color.rgb, f, p, fogColor;
+MOV result.color.a, p.a;
+END
+
+[test]
+fog start 10.0
+fog end 100.0
+fog density 0.03
+fog color (1.0, 1.0, 0.0, 0.0)
+fog coord_src fog_coord
+fog coord 50.0
+
+clear color 0.5 0.5 0.5 0.5
+clear
+
+draw rect -1 -1 2 2 
+probe all rgba 0.7127 0.7879 0.2121 0.8
diff --git a/tests/spec/arb_fragment_program/fog/exp.shader_test 
b/tests/spec/arb_fragment_program/fog/exp.shader_test
new file mode 100644
index 000..8448d72
--- /dev/null
+++ b/tests/spec/arb_fragment_program/fog/exp.shader_test
@@ -0,0 +1,24 @@
+[require]
+GL >= 1.4
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+OPTION ARB_fog_exp;
+PARAM color = {0.2, 0.4, 0.6, 0.8};
+MOV result.color, color;
+END
+
+[test]
+fog start 10.0
+fog end 100.0
+fog density 0.03
+fog color (1.0, 1.0, 0.0, 0.0)
+fog c

[Piglit] [PATCH v2 35/37] glean/tfragprog1: port z-write test to shader_runner

2016-09-06 Thread Dylan Baker
Thanks to Ken for helping me work out a couple of bugs in this test.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py|  1 +-
 tests/glean/tfragprog1.cpp  | 15 +--
 tests/spec/arb_fragment_program/z-write.shader_test | 21 ++-
 3 files changed, 21 insertions(+), 16 deletions(-)
 create mode 100644 tests/spec/arb_fragment_program/z-write.shader_test

diff --git a/tests/all.py b/tests/all.py
index 682b8c9..596501d 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'Z-write test',
   'Divide by zero test',
   'Infinity and nan test',
 ]
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index abee647..340da20 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -81,21 +81,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // These are the specific fragment programs which we'll test
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
-   {
-   "Z-write test",
-   "!!ARBfp1.0\n"
-   "PARAM p = program.local[1]; \n"
-   "MOV result.color, p; \n"
-   "MOV result.depth.z, p.y; \n"
-   "END \n",
-   { Param1[0],
- Param1[1],
- Param1[2],
- Param1[3]
-   },
-   Param1[1]
-   },
-
// = Numeric stress tests =
// Basically just check that we don't crash when we do divides by
// zero, etc.
diff --git a/tests/spec/arb_fragment_program/z-write.shader_test 
b/tests/spec/arb_fragment_program/z-write.shader_test
new file mode 100644
index 000..64609f2
--- /dev/null
+++ b/tests/spec/arb_fragment_program/z-write.shader_test
@@ -0,0 +1,21 @@
+[require]
+GL_ARB_fragment_program
+depthbuffer
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+MOV result.color, p;
+MOV result.depth.z, p.y;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear depth 0.75
+clear
+enable GL_DEPTH_TEST
+
+parameter local_fp 0 (0.5, 0.25, 1.0, 0.5)
+draw rect -1 -1 2 2
+probe all rgba 0.5 0.25 1.0 0.5  # Just to be sure the color doesn't change
+probe depth 0 0 0.25
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 31/37] shader_runner: add command for glFog

2016-09-06 Thread Dylan Baker
I've added this with the intention of using it to ease porting the
numerous fog tests from glean to the piglit framework, many of which can
easily be ported to shader_runner, except for the need for glFog setup.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/shaders/shader_runner.c | 74 -
 1 file changed, 74 insertions(+), 0 deletions(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 8e29346..ba193c6 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -2592,6 +2592,78 @@ decode_drawing_mode(const char *mode_str)
 }
 
 static void
+handle_fog(const char *line)
+{
+   static const struct string_to_enum fog_pname[] = {
+   { "mode",  GL_FOG_MODE  },
+   { "density",   GL_FOG_DENSITY   },
+   { "start", GL_FOG_START },
+   { "end",   GL_FOG_END   },
+   { "index", GL_FOG_INDEX },
+   { "color", GL_FOG_COLOR },
+   { "coord_src", GL_FOG_COORD_SRC },
+   { "frag_depth",GL_FRAGMENT_DEPTH_EXT},
+   { NULL, 0 }
+   };
+   static const struct string_to_enum modes[] = {
+   { "linear", GL_LINEAR },
+   { "exp",GL_EXP },
+   { "exp2",   GL_EXP2 },
+   { NULL, 0 }
+   };
+#ifdef PIGLIT_USE_OPENGL
+   static const struct string_to_enum coord_src[] = {
+   { "fog_coord", GL_FOG_COORD },
+   { "frag_depth", GL_FRAGMENT_DEPTH },
+   { NULL, 0 }
+   };
+#endif
+   float v[4];
+   GLenum target, e;
+
+   // call glFogCoord
+   if (string_match("coord ", line)) {
+   line += strlen("coord ");
+   get_floats(line, v, 1);
+   glFogCoordf(v[0]);
+   return;
+   }
+
+   target = lookup_enum_string(fog_pname, , "glFog pname");
+   switch (target) {
+   case GL_FOG_MODE:
+   e = lookup_enum_string(modes, ,
+  "glFog(GL_FOG_MODE, param)");
+   glFogi(target, e);
+   break;
+   case GL_FOG_COORD_SRC:
+#ifdef PIGLIT_USE_OPENGL
+   e = lookup_enum_string(coord_src, ,
+  "glFog(GL_FOG_CCORD_SRC, param)");
+   glFogi(target, e);
+   break;
+#else
+   printf("glFog for GLES doesn't support coord_src\n");
+   piglit_report_result(PIGLIT_FAIL);
+#endif
+   case GL_FOG_COLOR:
+   sscanf(line, "( %f , %f , %f , %f )",
+  [0], [1], [2], [3]);
+   glFogfv(target, v);
+   break;
+   case GL_FOG_DENSITY:
+   case GL_FOG_START:
+   case GL_FOG_END:
+   case GL_FOG_INDEX:
+   get_floats(line, v, 1);
+   glFogf(target, v[0]);
+   break;
+   default:
+   assert(0);
+   }
+}
+
+static void
 handle_texparameter(const char *line)
 {
static const struct string_to_enum texture_target[] = {
@@ -3370,6 +3442,8 @@ piglit_display(void)
active_uniform(line + strlen("active uniform "));
} else if (string_match("verify program_interface_query ", 
line)) {
active_program_interface(line + strlen("verify 
program_interface_query "));
+   } else if (string_match("fog ", line)) {
+   handle_fog(line + strlen("fog "));
} else if ((line[0] != '\n') && (line[0] != '\0')
   && (line[0] != '#')) {
printf("unknown command \"%s\"\n", line);
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 36/37] glean/tfragprog1: remove stress tests

2016-09-06 Thread Dylan Baker
These test divide by zero and divide by HUGE_NUMBER and -HUGE_NUMBER,
which don't seem particularly useful, especially since there are already
tests for that in GLSL, and if it's going to be a problem it'll be in
the compiler.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  2 --
 tests/glean/tfragprog1.cpp | 35 ---
 2 files changed, 0 insertions(+), 37 deletions(-)

diff --git a/tests/all.py b/tests/all.py
index 596501d..f4941bb 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,8 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'Divide by zero test',
-  'Infinity and nan test',
 ]
 
 glean_vp_tests = ['ABS test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 340da20..248169a 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -81,41 +81,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // These are the specific fragment programs which we'll test
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
-   // = Numeric stress tests =
-   // Basically just check that we don't crash when we do divides by
-   // zero, etc.
-   {
-   "Divide by zero test",
-   "!!ARBfp1.0\n"
-   "PARAM zero = program.local[0]; \n"
-   "RCP result.color.x, zero.x; \n"
-   "RCP result.color.y, zero.y; \n"
-   "RCP result.color.z, zero.z; \n"
-   "RCP result.color.w, zero.w; \n"
-   "END \n",
-   { DONT_CARE_COLOR,
- DONT_CARE_COLOR,
- DONT_CARE_COLOR,
- DONT_CARE_COLOR
-   },
-   DONT_CARE_Z
-   },
-   {
-   "Infinity and nan test",
-   "!!ARBfp1.0\n"
-   "PARAM zero = program.local[0]; \n"
-   "PARAM infNan = program.local[9]; \n"
-   "ADD result.color, infNan, zero; \n"
-   "END \n",
-   { DONT_CARE_COLOR,
- DONT_CARE_COLOR,
- DONT_CARE_COLOR,
- DONT_CARE_COLOR
-   },
-   DONT_CARE_Z
-   },
-
-   // XXX add lots more tests here!
{ NULL, NULL, {0,0,0,0}, 0 } // end of list sentinal
 };
 
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 34/37] glean/tfragprog1: port exp2 fog tests to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py|  3 +-
 tests/glean/tfragprog1.cpp  | 47 +---
 tests/spec/arb_fragment_program/fog/calculated-exp2.shader_test | 36 +-
 tests/spec/arb_fragment_program/fog/exp2.shader_test| 24 -
 4 files changed, 61 insertions(+), 49 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/fog/calculated-exp2.shader_test
 create mode 100644 tests/spec/arb_fragment_program/fog/exp2.shader_test

diff --git a/tests/all.py b/tests/all.py
index f533893..682b8c9 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -379,8 +379,7 @@ glean_fp_tests = [
   'Z-write test',
   'Divide by zero test',
   'Infinity and nan test',
-  'ARB_fog_exp2 test',
-  'Computed fog exp2 test']
+]
 
 glean_vp_tests = ['ABS test',
   'ADD test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index b34a348..abee647 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -130,53 +130,6 @@ static const FragmentProgram Programs[] = {
DONT_CARE_Z
},
 
-   // = Fog tests 
-
-   // Exp2 fog
-#define FOG_FACT 0.1054   // = exp(-(Density * Coord)^2)
-   {
-   "ARB_fog_exp2 test",
-   "!!ARBfp1.0\n"
-   "OPTION ARB_fog_exp2; \n"
-   "MOV result.color, fragment.color; \n"
-   "END \n",
-   { FragColor[0] * FOG_FACT + FogColor[0] * (1.0 - FOG_FACT),
- FragColor[1] * FOG_FACT + FogColor[1] * (1.0 - FOG_FACT),
- FragColor[2] * FOG_FACT + FogColor[2] * (1.0 - FOG_FACT),
- FragColor[3]
-   },
-   DONT_CARE_Z
-   },
-#undef FOG_FACT
-#define FOG_FACT 0.2102   // = ex2(-(Density * Coord)^2)
-   {
-   // NOTE: we could also do this with the POW instruction
-   "Computed fog exp2 test",
-   "!!ARBfp1.0\n"
-   "# fogParams.x = density \n"
-   "# fogParams.y = start \n"
-   "# fogParams.z = end \n"
-   "# fogParams.w = 1/(end-start) \n"
-   "PARAM fogParams = state.fog.params; \n"
-   "ATTRIB fogCoord = fragment.fogcoord; \n"
-   "PARAM fogColor = state.fog.color; \n"
-   "TEMP f, dc; \n"
-   "# f = exp(-(density * coord)^2) \n"
-   "MUL dc.x, fogParams.x, fogCoord.x; \n"
-   "MUL dc.x, dc.x, dc.x; \n"
-   "EX2_SAT f, -dc.x; \n"
-   "LRP result.color.rgb, f, fragment.color, fogColor; \n"
-   "MOV result.color.a, fragment.color.a; \n"
-   "END \n",
-   { FragColor[0] * FOG_FACT + FogColor[0] * (1.0 - FOG_FACT),
- FragColor[1] * FOG_FACT + FogColor[1] * (1.0 - FOG_FACT),
- FragColor[2] * FOG_FACT + FogColor[2] * (1.0 - FOG_FACT),
- FragColor[3]
-   },
-   DONT_CARE_Z
-   },
-#undef FOG_FACT
-
// XXX add lots more tests here!
{ NULL, NULL, {0,0,0,0}, 0 } // end of list sentinal
 };
diff --git a/tests/spec/arb_fragment_program/fog/calculated-exp2.shader_test 
b/tests/spec/arb_fragment_program/fog/calculated-exp2.shader_test
new file mode 100644
index 000..34ec794
--- /dev/null
+++ b/tests/spec/arb_fragment_program/fog/calculated-exp2.shader_test
@@ -0,0 +1,36 @@
+[require]
+GL >= 1.4
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+# fogParams.x = density
+# fogParams.y = start
+# fogParams.z = end
+# fogParams.w = 1/(end-start)
+PARAM fogParams = state.fog.params;
+ATTRIB fogCoord = fragment.fogcoord;
+PARAM fogColor = state.fog.color;
+PARAM p = {0.2, 0.4, 0.6, 0.8};
+TEMP f, dc;
+# f = exp(-(density * coord)^2)
+MUL dc.x, fogParams.x, fogCoord.x;
+MUL dc.x, dc.x, dc.x;
+EX2_SAT f, -dc.x;
+LRP result.color.rgb, f, p, fogColor;
+MOV result.color.a, p.a;
+END
+
+[test]
+fog start 10.0
+fog end 100.0
+fog density 0.03
+fog color (1.0, 1.0, 0.0, 0.0)
+fog coord_src fog_coord
+fog coord 50.0
+
+clear color 0.5 0.5 0.5 0.5
+clear
+
+draw rect -1 -1 2 2 
+probe all rgba 0.8318 0.8739 0.1261 0.8
diff --git a/tests/spec/arb_fragment_program/fog/exp2.shader_test 
b/tests/spec/arb_fragment_program/fog/exp2.shader_test
new file mode 100644
index 000..6d7b09a
--- /dev/null
+++ b/tests/spec/arb_fragment_program/fog/exp2.shader_test
@@ -0,0 +1,24 @@
+[require]
+GL >= 1.4
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+OPTION ARB_fog_exp2;
+PARAM color = {0.

[Piglit] [PATCH v2 30/37] glean/tfragprog1: port XPD test to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  1 -
 tests/glean/tfragprog1.cpp | 14 
--
 tests/spec/arb_fragment_program/built-in-functions/xpd.shader_test | 21 
+
 3 files changed, 21 insertions(+), 15 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/xpd.shader_test

diff --git a/tests/all.py b/tests/all.py
index c03ef2c..b2c41dd 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'XPD test 1',
   'Z-write test',
   'Divide by zero test',
   'Infinity and nan test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 23e20bf..9db40a4 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,20 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "XPD test 1",
-   "!!ARBfp1.0\n"
-   "PARAM p1 = program.local[1]; \n"
-   "PARAM p2 = program.local[2]; \n"
-   "XPD result.color, p1, p2; \n"
-   "END \n",
-   { CLAMP01(Param1[1] * Param2[2] - Param1[2] * Param2[1]),
- CLAMP01(Param1[2] * Param2[0] - Param1[0] * Param2[2]),
- CLAMP01(Param1[0] * Param2[1] - Param1[1] * Param2[0]),
- DONT_CARE_COLOR
-   },
-   DONT_CARE_Z
-   },
-   {
"Z-write test",
"!!ARBfp1.0\n"
"PARAM p = program.local[1]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/xpd.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/xpd.shader_test
new file mode 100644
index 000..7b90433
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/xpd.shader_test
@@ -0,0 +1,21 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+PARAM r = {1.0, 1.0, 1.0, 1.0};
+MOV result.color, r;
+XPD result.color, p, q;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.5, 0.25, 1.0, 0.5)
+parameter local_fp 1 (0.9, 0.5, 0.8, 0.0)
+draw rect -1 -1 2 2
+# x will be -0.3 and clamped
+probe all rgba 0.0 0.5 0.025 1.0
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 8/37] glean/tfragprog1: port DPH test to shader_runner

2016-09-06 Thread Dylan Baker
This is a simplified version of the same test, but without some extra
operations.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  1 -
 tests/glean/tfragprog1.cpp | 16 

 tests/spec/arb_fragment_program/built-in-functions/dph.shader_test | 18 
++
 3 files changed, 18 insertions(+), 17 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/dph.shader_test

diff --git a/tests/all.py b/tests/all.py
index 0058af6..dcb0c73 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'DPH test',
   'DST test',
   'EX2 test',
   'FLR test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 0028b39..2c56f28 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,22 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "DPH test",
-   "!!ARBfp1.0\n"
-   "PARAM p1 = program.local[1]; \n"
-"PARAM scale = {0.1, 0.1, 0.1, 0.1}; \n"
-"TEMP t; \n"
-   "DPH t, p1, fragment.color; \n"
-   "MUL result.color, t, scale; \n"
-   "END \n",
-   { SMEAR(CLAMP01((Param1[0] * FragColor[0] +
- Param1[1] * FragColor[1] +
- Param1[2] * FragColor[2] +
- FragColor[3]) * 0.1))
-   },
-   DONT_CARE_Z
-   },
-   {
"DST test",
"!!ARBfp1.0\n"
"# let d = 0.4 \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/dph.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/dph.shader_test
new file mode 100644
index 000..b63e5b2
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/dph.shader_test
@@ -0,0 +1,18 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+DPH result.color, p, q;
+END
+
+[test]
+clear color 1.0 1.0 1.0 1.0
+clear
+
+parameter local_fp 0 (0.4, 0.6, 0.7, 0.5)
+parameter local_fp 1 (0.1, 0.2, 0.3, 0.4)
+draw rect -1 -1 2 2
+probe all rgba 0.77 0.77 0.77 0.77
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 32/37] glean/tfragprog1: port linear fog tests to shader_runner

2016-09-06 Thread Dylan Baker
These make use of the new fog feature for shader_runner.

The ported tests differ slightly in that they use the non EXT version of
fog_coord, and thus require GL >= 1.4

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py  |  2 --
 tests/glean/tfragprog1.cpp| 41 
-
 tests/spec/arb_fragment_program/fog/calculated-linear.shader_test | 35 
+++
 tests/spec/arb_fragment_program/fog/linear.shader_test| 24 

 4 files changed, 59 insertions(+), 43 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/fog/calculated-linear.shader_test
 create mode 100644 tests/spec/arb_fragment_program/fog/linear.shader_test

diff --git a/tests/all.py b/tests/all.py
index b2c41dd..84999e6 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -379,8 +379,6 @@ glean_fp_tests = [
   'Z-write test',
   'Divide by zero test',
   'Infinity and nan test',
-  'ARB_fog_linear test',
-  'Computed fog linear test',
   'ARB_fog_exp test',
   'Computed fog exp test',
   'ARB_fog_exp2 test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 9db40a4..feb6bdc 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -131,47 +131,6 @@ static const FragmentProgram Programs[] = {
},
 
// = Fog tests 
-   // Linear fog
-#define FOG_FACT ((FogEnd - FogCoord) / (FogEnd - FogStart))
-   {
-   "ARB_fog_linear test",
-   "!!ARBfp1.0\n"
-   "OPTION ARB_fog_linear; \n"
-   "MOV result.color, fragment.color; \n"
-   "END \n",
-   { FragColor[0] * FOG_FACT + FogColor[0] * (1.0 - FOG_FACT),
- FragColor[1] * FOG_FACT + FogColor[1] * (1.0 - FOG_FACT),
- FragColor[2] * FOG_FACT + FogColor[2] * (1.0 - FOG_FACT),
- FragColor[3]
-   },
-   DONT_CARE_Z
-   },
-   {
-   "Computed fog linear test",
-   "!!ARBfp1.0\n"
-   "# fogParams.x = density \n"
-   "# fogParams.y = start \n"
-   "# fogParams.z = end \n"
-   "# fogParams.w = 1/(end-start) \n"
-   "PARAM fogParams = state.fog.params; \n"
-   "ATTRIB fogCoord = fragment.fogcoord; \n"
-   "PARAM fogColor = state.fog.color; \n"
-   "TEMP numerator, f; \n"
-   "# f = (end - coord) / (end - start) \n"
-   "SUB numerator, fogParams.z, fogCoord.x; \n"
-   "MUL_SAT f, numerator, fogParams.w; \n"
-   "LRP result.color.rgb, f, fragment.color, fogColor; \n"
-   "MOV result.color.a, fragment.color.a; \n"
-   "END \n",
-   { FragColor[0] * FOG_FACT + FogColor[0] * (1.0 - FOG_FACT),
- FragColor[1] * FOG_FACT + FogColor[1] * (1.0 - FOG_FACT),
- FragColor[2] * FOG_FACT + FogColor[2] * (1.0 - FOG_FACT),
- FragColor[3]
-   },
-   DONT_CARE_Z
-   },
-#undef FOG_FACT
-
// Exp fog
 #define FOG_FACT 0.2231   // = exp(-Density * Coord)
{
diff --git a/tests/spec/arb_fragment_program/fog/calculated-linear.shader_test 
b/tests/spec/arb_fragment_program/fog/calculated-linear.shader_test
new file mode 100644
index 000..73018eb
--- /dev/null
+++ b/tests/spec/arb_fragment_program/fog/calculated-linear.shader_test
@@ -0,0 +1,35 @@
+[require]
+GL >= 1.4
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+# fogParams.x = density
+# fogParams.y = start
+# fogParams.z = end
+# fogParams.w = 1/(end-start)
+PARAM fogParams = state.fog.params;
+PARAM p = {0.2, 0.4, 0.6, 0.8};
+ATTRIB fogCoord = fragment.fogcoord;
+PARAM fogColor = state.fog.color;
+TEMP numerator, f;
+# f = (end - coord) / (end - start)
+SUB numerator, fogParams.z, fogCoord.x;
+MUL_SAT f, numerator, fogParams.w;
+LRP result.color.rgb, f, p, fogColor;
+MOV result.color.a, p.a;
+END
+
+[test]
+fog start 10.0
+fog end 100.0
+fog density 0.03
+fog color (1.0, 1.0, 0.0, 0.0)
+fog coord_src fog_coord
+fog coord 50.0
+
+clear color 0.5 0.5 0.5 0.5
+clear
+
+draw rect -1 -1 2 2 
+probe all rgba 0. 0. 0. 0.8
diff --git a/tests/spec/arb_fragment_program/fog/linear.shader_test 
b/tests/spec/arb_fragment_program/fog/linear.shader_test
new file mode 100644
index 000..083ecf0
--- /dev/null
+++ b/tests/spec/arb_fragment_program/fog/linear.shader_tes

[Piglit] [PATCH v2 26/37] glean/tfragprog1: port SIN tests to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  
2 --
 tests/glean/tfragprog1.cpp | 
31 ---
 tests/spec/arb_fragment_program/built-in-functions/sin-clamped.shader_test | 
20 
 tests/spec/arb_fragment_program/built-in-functions/sin.shader_test | 
20 
 4 files changed, 40 insertions(+), 33 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/sin-clamped.shader_test
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/sin.shader_test

diff --git a/tests/all.py b/tests/all.py
index 76b0f6a..2e72c8d 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,8 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'SIN test',
-  'SIN test 2',
   'SLT test',
   'SUB test (with swizzle)',
   'SUB with saturation',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 955166b..ccaded2 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,37 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "SIN test",
-   "!!ARBfp1.0\n"
-   "PARAM values = { 1.57079, -1.57079, 0.5, 1.0 }; \n"
-   "SIN result.color.x, values.x; \n"
-   "SIN result.color.y, values.y; \n"
-   "SIN result.color.z, values.z; \n"
-   "SIN result.color.w, values.w; \n"
-   "END \n",
-   { CLAMP01(1.0),
- CLAMP01(-1.0),
- CLAMP01(0.4794),
- CLAMP01(0.8414)
-   },
-   DONT_CARE_Z
-   },
-   {
-   "SIN test 2",
-   "!!ARBfp1.0\n"
-   "PARAM values = { 3.14159, -3.14159, 6.78319, -5.78319 }; \n"
-   "SIN result.color.x, values.x; \n"
-   "SIN result.color.y, values.y; \n"
-   "SIN result.color.z, values.z; \n"
-   "SIN result.color.w, values.w; \n"
-   "END \n",
-   { CLAMP01(0.0),
- CLAMP01(0.0),
- CLAMP01(0.4794),
- CLAMP01(0.4794)
-   },
-   DONT_CARE_Z
-   },
{
"SLT test",
"!!ARBfp1.0\n"
diff --git 
a/tests/spec/arb_fragment_program/built-in-functions/sin-clamped.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/sin-clamped.shader_test
new file mode 100644
index 000..443857c
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/sin-clamped.shader_test
@@ -0,0 +1,20 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+SIN result.color.x, p.x;
+SIN result.color.y, p.y;
+SIN result.color.z, p.z;
+SIN result.color.w, p.w;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (3.14159, -3.14159, 6.78319, -5.78319)
+draw rect -1 -1 2 2
+# Note the y will be clamped
+probe all rgba 0.0 0.0 0.4794 0.4794
diff --git a/tests/spec/arb_fragment_program/built-in-functions/sin.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/sin.shader_test
new file mode 100644
index 000..319845f
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/sin.shader_test
@@ -0,0 +1,20 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+SIN result.color.x, p.x;
+SIN result.color.y, p.y;
+SIN result.color.z, p.z;
+SIN result.color.w, p.w;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (1.57079, -1.57079, 0.5, 1.0)
+draw rect -1 -1 2 2
+# Note the y will be clamped from -1.0
+probe all rgba 1.0 0.0 0.4794 0.8414
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 23/37] glean/tfragprog1: port RSQ tests to shader_runner

2016-09-06 Thread Dylan Baker
This single test combines the two tests in glean into one, adding a
negative number.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  2 --
 tests/glean/tfragprog1.cpp | 28 

 tests/spec/arb_fragment_program/built-in-functions/rsq.shader_test | 21 
+
 3 files changed, 21 insertions(+), 30 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/rsq.shader_test

diff --git a/tests/all.py b/tests/all.py
index 8b76c48..1d944d8 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,8 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'RSQ test 1 (reciprocal square root)',
-  'RSQ test 2 (reciprocal square root of negative value)',
   'SCS test',
   'SGE test',
   'SIN test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 827a818..ab1a8ea 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,34 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "RSQ test 1 (reciprocal square root)",
-   "!!ARBfp1.0\n"
-   "PARAM values = {1, 4, 9, 100 }; \n"
-   "RSQ result.color.x, values.x; \n"
-   "RSQ result.color.y, values.y; \n"
-   "RSQ result.color.z, values.z; \n"
-   "RSQ result.color.w, values.w; \n"
-   "END \n",
-   { 1.0, 0.5, 0., 0.1 },
-   DONT_CARE_Z
-   },
-   {
-   "RSQ test 2 (reciprocal square root of negative value)",
-   "!!ARBfp1.0\n"
-   "PARAM values = {0, -100, -5, -1}; \n"
-   "RSQ result.color.x, values.x; \n"
-   "RSQ result.color.y, values.y; \n"
-   "RSQ result.color.z, values.z; \n"
-   "RSQ result.color.w, values.w; \n"
-   "END \n",
-   { DONT_CARE_COLOR,
- 0.1,
- 0.447,
- 1.0,
-   },
-   DONT_CARE_Z
-   },
-   {
"SCS test",
"!!ARBfp1.0\n"
"PARAM values = { 0.5, 0.5, 0.0, 0.0 }; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/rsq.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/rsq.shader_test
new file mode 100644
index 000..2f61261
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/rsq.shader_test
@@ -0,0 +1,21 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = {1.0, 1.0, 1.0, 1.0};
+MOV result.color, q;
+RSQ result.color.x, p.x;
+RSQ result.color.y, p.y;
+RSQ result.color.z, p.z;
+RSQ result.color.w, p.w;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.0, 4.0, 9.0, -100.0)
+draw rect -1 -1 2 2
+probe all rgba 1.0 0.5 0. 0.1
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 15/37] glean/tfragprog1: port LRP test to shader_runner

2016-09-06 Thread Dylan Baker
It's worth noting that this test wasn't included in all.py, and
therefore hasn't been running.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/glean/tfragprog1.cpp | 14 
--
 tests/spec/arb_fragment_program/built-in-functions/lrp.shader_test | 20 

 2 files changed, 20 insertions(+), 14 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/lrp.shader_test

diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index f26f07f..bb79963 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -81,20 +81,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // These are the specific fragment programs which we'll test
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
-{
-   "LRP test",
-   "!!ARBfp1.0\n"
-   "PARAM p1 = program.local[1]; \n"
-   "PARAM t = {0.2, 0.5, 1.0, 0.0}; \n"
-   "LRP result.color, t, fragment.color, p1; \n"
-   "END \n",
-   { 0.2 * FragColor[0] + (1.0 - 0.2) * Param1[0],
- 0.5 * FragColor[1] + (1.0 - 0.5) * Param1[1],
- 1.0 * FragColor[2] + (1.0 - 1.0) * Param1[2],
- 0.0 * FragColor[3] + (1.0 - 0.0) * Param1[3]
-   },
-   DONT_CARE_Z
-   },
{
"MAD test",
"!!ARBfp1.0\n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/lrp.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/lrp.shader_test
new file mode 100644
index 000..96a55c2
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/lrp.shader_test
@@ -0,0 +1,20 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+PARAM r = program.local[2];
+LRP result.color, p, q, r;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.5, 0.25, 1.0, 0.5)
+parameter local_fp 1 (0.2, 0.5, 0.8, 0.0)
+parameter local_fp 2 (0.3, 0.2, 0.1, 0.4)
+draw rect -1 -1 2 2
+probe all rgba 0.25 0.275 0.8 0.2
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 3/37] glean/tfragprog1: port ADD tests to shader_runner

2016-09-06 Thread Dylan Baker
This ports the following tests:
- ADD test
- ADD with saturation
- ADD an immediate
- ADD negative immediate

It does not port ADD negative "immediate (2)", which adds MOV, MUL, and
swizzling. It might be a useful test but it's not really testing ADD
other than that it tests that ADD can be used with a swizzle.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>

v2: - Cover more cases in the ADD_SAT test
---
 tests/all.py   
   |  5 +-
 tests/glean/tfragprog1.cpp 
   | 75 
+
 tests/spec/arb_fragment_program/built-in-functions/add-immediate.shader_test   
   | 16 +++-
 
tests/spec/arb_fragment_program/built-in-functions/add-negative-immediate.shader_test
 | 16 +++-
 tests/spec/arb_fragment_program/built-in-functions/add.shader_test 
   | 18 +-
 tests/spec/arb_fragment_program/built-in-functions/add_sat.shader_test 
   | 22 +-
 6 files changed, 72 insertions(+), 80 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/add-immediate.shader_test
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/add-negative-immediate.shader_test
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/add.shader_test
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/add_sat.shader_test

diff --git a/tests/all.py b/tests/all.py
index 0f4a3c5..e655251 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,11 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'ADD test',
-  'ADD with saturation',
-  'ADD an immediate',
-  'ADD negative immediate',
-  'ADD negative immediate (2)',
   'CMP test',
   'COS test',
   'COS test 2',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index bc340ed..1cbe243 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,81 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "ADD test",
-   "!!ARBfp1.0\n"
-   "PARAM p = program.local[1]; \n"
-   "ADD result.color, fragment.color, p; \n"
-   "END \n",
-   { CLAMP01(FragColor[0] + Param1[0]),
- CLAMP01(FragColor[1] + Param1[1]),
- CLAMP01(FragColor[2] + Param1[2]),
- CLAMP01(FragColor[3] + Param1[3])
-   },
-   DONT_CARE_Z
-   },
-   {
-   "ADD with saturation",
-   "!!ARBfp1.0\n"
-   "PARAM p = program.local[1]; \n"
-"TEMP t; \n"
-"ADD t, p, p; \n"
-   "ADD_SAT result.color, t, p; \n"
-   "END \n",
-   { CLAMP01(Param1[0] + Param1[0] + Param1[0]),
- CLAMP01(Param1[1] + Param1[1] + Param1[1]),
- CLAMP01(Param1[2] + Param1[2] + Param1[2]),
- CLAMP01(Param1[3] + Param1[3] + Param1[3]),
-   },
-   DONT_CARE_Z
-   },
-
-   {
-   "ADD an immediate",
-   "!!ARBfp1.0\n"
-   "PARAM p = program.local[1]; \n"
-   "ADD result.color, p, {0.25, 0.0, 0.5, 0.25}; \n"
-   "END \n",
-   { CLAMP01(Param1[0] + 0.25),
- CLAMP01(Param1[1] + 0.0),
- CLAMP01(Param1[2] + 0.5),
- CLAMP01(Param1[3] + 0.25),
-   },
-   DONT_CARE_Z
-   },
-
-   {
-   "ADD negative immediate",
-   "!!ARBfp1.0\n"
-   "PARAM p = program.local[1]; \n"
-   "ADD result.color, p, {-0.25, -0.2, 0.0, -0.25}; \n"
-   "END \n",
-   { CLAMP01(Param1[0] - 0.25),
- CLAMP01(Param1[1] - 0.2),
- CLAMP01(Param1[2] - 0.0),
- CLAMP01(Param1[3] - 0.25),
-   },
-   DONT_CARE_Z
-   },
-
-   {
-   "ADD negative immediate (2)",
-   "!!ARBfp1.0\n"
-   "PARAM p = program.local[1]; \n"
-   "TEMP t; \n"
-   "MOV t, p; \n"
-   "MUL t.xyz, t, 2.0; \n"
-   "ADD t.xyz, t, -1.0; \n&quo

[Piglit] [PATCH v2 13/37] glean/tfragprog1: port LG2 test to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  1 -
 tests/glean/tfragprog1.cpp | 19 
---
 tests/spec/arb_fragment_program/built-in-functions/lg2.shader_test | 22 
++
 3 files changed, 22 insertions(+), 20 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/lg2.shader_test

diff --git a/tests/all.py b/tests/all.py
index 5f6fac1..1fb1dce 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'LG2 test',
   'LIT test 1',
   'LIT test 2 (degenerate case: 0 ^ 0 -> 1)',
   'LIT test 3 (case x < 0)',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index a65fa38..91f1171 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,25 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "LG2 test",
-   "!!ARBfp1.0\n"
-   "PARAM values = {64.0, 1, 30, 4}; \n"
-   "PARAM scale = {0.1, 0.1, 0.1, 0.1}; \n"
-   "TEMP t; \n"
-   "LG2 t.x, values.x; \n"
-   "LG2 t.y, values.y; \n"
-   "LG2 t.z, values.z; \n"
-   "LG2 t.w, values.w; \n"
-   "MUL result.color, t, scale; \n"
-   "END \n",
-   { 0.6,
- 0.0,
- 0.49,
- 0.2
-   },
-   DONT_CARE_Z
-   },
-   {
"LIT test 1",
"!!ARBfp1.0\n"
"PARAM values = {0.65, 0.9, 0.0, 8.0}; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/lg2.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/lg2.shader_test
new file mode 100644
index 000..eaa1f35
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/lg2.shader_test
@@ -0,0 +1,22 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM scale = {0.1, 0.1, 0.1, 0.1};
+TEMP t;
+LG2 t.x, p.x;
+LG2 t.y, p.y;
+LG2 t.z, p.z;
+LG2 t.w, p.w;
+MUL result.color, t, scale;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (64.0, 1.0, 30.0, 4.0)
+draw rect -1 -1 2 2 
+probe all rgba 0.6 0.0 0.49 0.2
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 25/37] glean/tfragprog1: port SGE test to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  1 -
 tests/glean/tfragprog1.cpp | 14 
--
 tests/spec/arb_fragment_program/built-in-functions/sge.shader_test | 20 

 3 files changed, 20 insertions(+), 15 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/sge.shader_test

diff --git a/tests/all.py b/tests/all.py
index 3a82887..76b0f6a 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'SGE test',
   'SIN test',
   'SIN test 2',
   'SLT test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 0ca8837..955166b 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,20 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "SGE test",
-   "!!ARBfp1.0\n"
-   "PARAM p0 = program.local[0]; \n"
-   "PARAM p2 = program.local[2]; \n"
-   "SGE result.color, p2, p0; \n"
-   "END \n",
-   { Param2[0] >= Param0[0] ? 1.0 : 0.0,
- Param2[1] >= Param0[1] ? 1.0 : 0.0,
- Param2[2] >= Param0[2] ? 1.0 : 0.0,
- Param2[3] >= Param0[3] ? 1.0 : 0.0,
-   },
-   DONT_CARE_Z
-   },
-   {
"SIN test",
"!!ARBfp1.0\n"
"PARAM values = { 1.57079, -1.57079, 0.5, 1.0 }; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/sge.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/sge.shader_test
new file mode 100644
index 000..c2a774f
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/sge.shader_test
@@ -0,0 +1,20 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+PARAM r = {1.0, 1.0, 0.0, 0.0};
+MOV result.color, q;
+SGE result.color, p, q;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (1.0, 0.1,  0.0, -0.5)
+parameter local_fp 1 (0.0, 0.0, -1.0,  1.0)
+draw rect -1 -1 2 2
+probe all rgba 1.0 1.0 1.0 0.0
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 29/37] glean/tfragprog1: port swizzle tests to shader_runner

2016-09-06 Thread Dylan Baker
This includes the SWZ tests and the swizzled ADD and MOV tests.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py  |  3 
---
 tests/glean/tfragprog1.cpp| 42 
--
 tests/spec/arb_fragment_program/built-in-functions/swz.shader_test| 17 
+
 tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-add.shader_test | 18 
++
 tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-mov.shader_test | 16 

 tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-sub.shader_test | 10 
++
 6 files changed, 53 insertions(+), 53 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/swz.shader_test
 create mode 100644 
tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-add.shader_test
 create mode 100644 
tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-mov.shader_test

diff --git a/tests/all.py b/tests/all.py
index c2c3103..c03ef2c 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,9 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'SWZ test',
-  'swizzled move test',
-  'swizzled add test',
   'XPD test 1',
   'Z-write test',
   'Divide by zero test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 342b17d..23e20bf 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,48 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "SWZ test",
-   "!!ARBfp1.0\n"
-   "PARAM p = program.local[1]; \n"
-   "SWZ result.color, p, -1,-y,z,0; \n"
-   "END \n",
-   { CLAMP01(-1.0),
- CLAMP01(-Param1[1]),
- CLAMP01(Param1[2]),
- CLAMP01(0.0)
-   },
-   DONT_CARE_Z
-   },
-   {
-   // this test checks that SOA execution is handled correctly
-   "swizzled move test",
-   "!!ARBfp1.0\n"
-   "TEMP t; \n"
-   "PARAM p = program.local[1]; \n"
-   "MOV t, p; \n"
-   "MOV t, t.yxwz; \n"  // "in-place" swizzle
-   "MOV result.color, t; \n"
-   "END \n",
-   { Param1[1], Param1[0], Param1[3], Param1[2] },
-   DONT_CARE_Z
-   },
-   {
-   // this test checks that SOA execution is handled correctly
-   "swizzled add test",
-   "!!ARBfp1.0\n"
-   "TEMP t; \n"
-   "PARAM p = program.local[1]; \n"
-   "MOV t, p; \n"
-   "ADD t, t, t.yxwz; \n"  // "in-place" swizzled add
-   "MOV result.color, t; \n"
-   "END \n",
-   { CLAMP01(Param1[0] + Param1[1]),
- CLAMP01(Param1[1] + Param1[0]),
- CLAMP01(Param1[2] + Param1[3]),
- CLAMP01(Param1[3] + Param1[2]) },
-   DONT_CARE_Z
-   },
-   {
"XPD test 1",
"!!ARBfp1.0\n"
"PARAM p1 = program.local[1]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/swz.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/swz.shader_test
new file mode 100644
index 000..3b338fd
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/swz.shader_test
@@ -0,0 +1,17 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+SWZ result.color, p, 0,z,x,y;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (-1.0, 0.0, 1.0, 0.5)
+draw rect -1 -1 2 2
+# z will be clamped
+probe all rgba 0.0 1.0 0.0 0.0
diff --git 
a/tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-add.shader_test 
b/tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-add.shader_test
new file mode 100644
index 000..152f163
--- /dev/null
+++ b/tests/spec/arb_fragment_program/swizzle-and-mask/swizzled-add.shader_test
@@ -0,0 +1,18 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+ADD result.color, p.yxwz, q.yxwz;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (1.0, 0.0,  0.5, -1.0)
+parameter local_fp 1 (1.0, 0.0, -0.5,  0.5)
+draw r

[Piglit] [PATCH v2 24/37] glean/tfragprog1: port SCS test to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  1 -
 tests/glean/tfragprog1.cpp | 14 
--
 tests/spec/arb_fragment_program/built-in-functions/scs.shader_test | 19 
+++
 3 files changed, 19 insertions(+), 15 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/scs.shader_test

diff --git a/tests/all.py b/tests/all.py
index 1d944d8..3a82887 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'SCS test',
   'SGE test',
   'SIN test',
   'SIN test 2',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index ab1a8ea..0ca8837 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,20 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "SCS test",
-   "!!ARBfp1.0\n"
-   "PARAM values = { 0.5, 0.5, 0.0, 0.0 }; \n"
-   "SCS result.color.x, values.x; \n"
-   "SCS result.color.y, values.y; \n"
-   "END \n",
-   { CLAMP01(0.8775),
- CLAMP01(0.4794),
- DONT_CARE_COLOR,
- DONT_CARE_COLOR,
-   },
-   DONT_CARE_Z
-   },
-   {
"SGE test",
"!!ARBfp1.0\n"
"PARAM p0 = program.local[0]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/scs.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/scs.shader_test
new file mode 100644
index 000..4f20728
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/scs.shader_test
@@ -0,0 +1,19 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = {1.0, 1.0, 0.0, 0.0};
+MOV result.color, q;
+SCS result.color.x, p.x;
+SCS result.color.y, p.y;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.5, 0.5, 0.0, 0.0)
+draw rect -1 -1 2 2
+probe all rgba 0.8775 0.4794 0.0 0.0
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 7/37] glean/tfragprog1: port DP4 test to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  1 -
 tests/glean/tfragprog1.cpp | 13 
-
 tests/spec/arb_fragment_program/built-in-functions/dp4.shader_test | 18 
++
 3 files changed, 18 insertions(+), 14 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/dp4.shader_test

diff --git a/tests/all.py b/tests/all.py
index 8132bbb..0058af6 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'DP4 test',
   'DPH test',
   'DST test',
   'EX2 test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index bf95a20..0028b39 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,19 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "DP4 test",
-   "!!ARBfp1.0\n"
-   "PARAM p1 = program.local[1]; \n"
-   "DP4 result.color, p1, fragment.color; \n"
-   "END \n",
-   { SMEAR(CLAMP01(Param1[0] * FragColor[0] +
-Param1[1] * FragColor[1] +
-Param1[2] * FragColor[2] +
-Param1[3] * FragColor[3]))
-   },
-   DONT_CARE_Z
-   },
-   {
"DPH test",
"!!ARBfp1.0\n"
"PARAM p1 = program.local[1]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/dp4.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/dp4.shader_test
new file mode 100644
index 000..2101639
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/dp4.shader_test
@@ -0,0 +1,18 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+DP4 result.color, p, q;
+END
+
+[test]
+clear color 1.0 1.0 1.0 1.0
+clear
+
+parameter local_fp 0 (0.4, 0.6, 0.7, 0.5)
+parameter local_fp 1 (0.1, 0.2, 0.3, 0.4)
+draw rect -1 -1 2 2
+probe all rgba 0.57 0.57 0.57 0.57
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 20/37] glean/tfragprog1: port MUL tests to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py|  2 --
 tests/glean/tfragprog1.cpp  | 28 

 tests/spec/arb_fragment_program/built-in-functions/mul.shader_test  | 19 
+++
 tests/spec/arb_fragment_program/swizzle-and-mask/masked-mul.shader_test | 19 
+++
 4 files changed, 38 insertions(+), 30 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/mul.shader_test
 create mode 100644 
tests/spec/arb_fragment_program/swizzle-and-mask/masked-mul.shader_test

diff --git a/tests/all.py b/tests/all.py
index 1ba96a4..0ebd5fc 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,8 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'MUL test',
-  'masked MUL test',
   'POW test (exponentiation)',
   'RCP test (reciprocal)',
   'RCP test 2 (reciprocal)',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index b13e6cb..32b8313 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,34 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "MUL test",
-   "!!ARBfp1.0\n"
-   "PARAM p = program.local[1]; \n"
-   "MUL result.color, fragment.color, p; \n"
-   "END \n",
-   { CLAMP01(FragColor[0] * Param1[0]),
- CLAMP01(FragColor[1] * Param1[1]),
- CLAMP01(FragColor[2] * Param1[2]),
- CLAMP01(FragColor[3] * Param1[3])
-   },
-   DONT_CARE_Z
-   },
-   {
-   "masked MUL test",
-   "!!ARBfp1.0\n"
-   "PARAM zero = program.local[0]; \n"
-   "PARAM p = program.local[1]; \n"
-   "MOV result.color, zero; \n"
-   "MUL result.color.xy, fragment.color, p; \n"
-   "END \n",
-   { CLAMP01(FragColor[0] * Param1[0]),
- CLAMP01(FragColor[1] * Param1[1]),
- 0.0,
- 0.0
-   },
-   DONT_CARE_Z
-   },
-   {
"POW test (exponentiation)",
"!!ARBfp1.0\n"
"PARAM values = {0.5, 2, 3, 4}; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/mul.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/mul.shader_test
new file mode 100644
index 000..b407eb9
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/mul.shader_test
@@ -0,0 +1,19 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+MUL result.color, p, q;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 ( 1.0, 0.5, 0.0, -1.0)
+parameter local_fp 1 ( 0.5, 0.5, 1.0,  1.0)
+draw rect -1 -1 2 2
+# Note that the w value will be clamped
+probe all rgba 0.5 0.25 0.0 0.0
diff --git 
a/tests/spec/arb_fragment_program/swizzle-and-mask/masked-mul.shader_test 
b/tests/spec/arb_fragment_program/swizzle-and-mask/masked-mul.shader_test
new file mode 100644
index 000..d3add77
--- /dev/null
+++ b/tests/spec/arb_fragment_program/swizzle-and-mask/masked-mul.shader_test
@@ -0,0 +1,19 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+MOV result.color, {0.0, 0.0, 0.0, 0.0};
+MUL result.color.y, q, p;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.0, 1.0, 0.0, 0.0)
+parameter local_fp 1 (1.0, 1.0, 1.0, 1.0)
+draw rect -1 -1 2 2 
+probe all rgba 0.0 1.0 0.0 0.0
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 21/37] glean/tfragprog1: port POW test to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  1 -
 tests/glean/tfragprog1.cpp | 15 
---
 tests/spec/arb_fragment_program/built-in-functions/pow.shader_test | 19 
+++
 3 files changed, 19 insertions(+), 16 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/pow.shader_test

diff --git a/tests/all.py b/tests/all.py
index 0ebd5fc..3c857d9 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'POW test (exponentiation)',
   'RCP test (reciprocal)',
   'RCP test 2 (reciprocal)',
   'RSQ test 1 (reciprocal square root)',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 32b8313..37c70c1 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,21 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "POW test (exponentiation)",
-   "!!ARBfp1.0\n"
-   "PARAM values = {0.5, 2, 3, 4}; \n"
-   "POW result.color.x, values.x, values.y; \n"
-   "POW result.color.y, values.x, values.z; \n"
-   "POW result.color.z, values.x, values.w; \n"
-   "POW result.color.w, values.w, values.x; \n"
-   "END \n",
-   { 0.5 * 0.5,
- 0.5 * 0.5 * 0.5,
- 0.5 * 0.5 * 0.5 * 0.5,
- CLAMP01(2.0) },
-   DONT_CARE_Z
-   },
-   {
"RCP test (reciprocal)",
"!!ARBfp1.0\n"
"PARAM values = {8, -10, 1, 12 }; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/pow.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/pow.shader_test
new file mode 100644
index 000..eb6f890
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/pow.shader_test
@@ -0,0 +1,19 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+POW result.color.x, p.x, p.y;
+POW result.color.y, p.x, p.z;
+POW result.color.z, p.x, p.w;
+POW result.color.w, p.w, p.x;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.5, 2.0, 3.0, 4.0)
+draw rect -1 -1 2 2
+probe all rgba 0.25 0.125 0.0625 1.0
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 16/37] glean/tfragprog1: port MAD test to shader_runner

2016-09-06 Thread Dylan Baker
This isn't an exact port, some of the values were changed to be simpler,
easier for humans to calculate values, but it shouldn't affect the
viability of the test.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  1 -
 tests/glean/tfragprog1.cpp | 14 
--
 tests/spec/arb_fragment_program/built-in-functions/mad.shader_test | 20 

 3 files changed, 20 insertions(+), 15 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/mad.shader_test

diff --git a/tests/all.py b/tests/all.py
index 3b10361..bf4e60f 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'MAD test',
   'MAX test',
   'MIN test',
   'MOV test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index bb79963..9254e11 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,20 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "MAD test",
-   "!!ARBfp1.0\n"
-   "PARAM p1 = program.local[1]; \n"
-   "PARAM p2 = program.local[2]; \n"
-   "MAD result.color, fragment.color, p1, p2; \n"
-   "END \n",
-   { CLAMP01(FragColor[0] * Param1[0] + Param2[0]),
- CLAMP01(FragColor[1] * Param1[1] + Param2[1]),
- CLAMP01(FragColor[2] * Param1[2] + Param2[2]),
- CLAMP01(FragColor[3] * Param1[3] + Param2[3])
-   },
-   DONT_CARE_Z
-   },
-   {
"MAX test",
"!!ARBfp1.0\n"
"PARAM p1 = program.local[1]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/mad.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/mad.shader_test
new file mode 100644
index 000..8895117
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/mad.shader_test
@@ -0,0 +1,20 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+PARAM r = program.local[2];
+MAD result.color, p, q, r;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 ( 1.0, 0.5, 0.0, -1.0)
+parameter local_fp 1 ( 0.5, 0.5, 1.0,  1.0)
+parameter local_fp 2 (0.25, 0.0, 0.5, -1.0)
+draw rect -1 -1 2 2
+probe all rgba 0.75 0.25 0.5 0.0
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 22/37] glean/tfragprog1: port RCP tests to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py  
|  2 --
 tests/glean/tfragprog1.cpp
| 23 ---
 tests/spec/arb_fragment_program/built-in-functions/rcp-replicated.shader_test 
| 19 +++
 tests/spec/arb_fragment_program/built-in-functions/rcp.shader_test
| 22 ++
 4 files changed, 41 insertions(+), 25 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/rcp-replicated.shader_test
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/rcp.shader_test

diff --git a/tests/all.py b/tests/all.py
index 3c857d9..8b76c48 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,8 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'RCP test (reciprocal)',
-  'RCP test 2 (reciprocal)',
   'RSQ test 1 (reciprocal square root)',
   'RSQ test 2 (reciprocal square root of negative value)',
   'SCS test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 37c70c1..827a818 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,29 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "RCP test (reciprocal)",
-   "!!ARBfp1.0\n"
-   "PARAM values = {8, -10, 1, 12 }; \n"
-   "RCP result.color.x, values.x; \n"
-   "RCP result.color.y, values.y; \n"
-   "RCP result.color.z, values.z; \n"
-   "RCP result.color.w, values.w; \n"
-   "END \n",
-   { 1.0 / 8.0, CLAMP01(1.0 / -10.0), 1, 1.0 / 12.0 },
-   DONT_CARE_Z
-   },
-   {
-   /* check that RCP result is replicated across XYZW */
-   "RCP test 2 (reciprocal)",
-   "!!ARBfp1.0\n"
-   "PARAM values = {8, -10, 1, 12 }; \n"
-   "MOV result.color, values; \n"
-   "RCP result.color, values.x; \n"
-   "END \n",
-   { 1.0 / 8.0, 1.0 / 8.0, 1.0 / 8.0, 1.0 / 8.0 },
-   DONT_CARE_Z
-   },
-   {
"RSQ test 1 (reciprocal square root)",
"!!ARBfp1.0\n"
"PARAM values = {1, 4, 9, 100 }; \n"
diff --git 
a/tests/spec/arb_fragment_program/built-in-functions/rcp-replicated.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/rcp-replicated.shader_test
new file mode 100644
index 000..382a556
--- /dev/null
+++ 
b/tests/spec/arb_fragment_program/built-in-functions/rcp-replicated.shader_test
@@ -0,0 +1,19 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = {1.0, 1.0, 1.0, 1.0};
+MOV result.color, q;
+RCP result.color, p.x;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (8.0, -10.0, 1.0, 12.0)
+draw rect -1 -1 2 2
+# The y value will be clamped from -0.1
+probe all rgba 0.125 0.125 0.125 0.125
diff --git a/tests/spec/arb_fragment_program/built-in-functions/rcp.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/rcp.shader_test
new file mode 100644
index 000..80f155e
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/rcp.shader_test
@@ -0,0 +1,22 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = {1.0, 1.0, 1.0, 1.0};
+MOV result.color, q;
+RCP result.color.x, p.x;
+RCP result.color.y, p.y;
+RCP result.color.z, p.z;
+RCP result.color.w, p.w;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (8.0, -10.0, 1.0, 12.0)
+draw rect -1 -1 2 2
+# The y value will be clamped from -0.1
+probe all rgba 0.125 0.0 1.0 0.0833
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 2/37] glean/tfragprog1: port ABS test to shader_runner

2016-09-06 Thread Dylan Baker
Possible duplicate tests:
shaders/fp-abs-01.c
shaders/fp-abs-02.c

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  2 +-
 tests/glean/tfragprog1.cpp | 13 
-
 tests/spec/arb_fragment_program/built-in-functions/abs.shader_test | 16 

 3 files changed, 17 insertions(+), 14 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/abs.shader_test

diff --git a/tests/all.py b/tests/all.py
index 3961656..0f4a3c5 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -375,7 +375,7 @@ glean_glsl_tests = ['Primary plus secondary color',
 'varying read but not written',
 'texcoord varying']
 
-glean_fp_tests = ['ABS test',
+glean_fp_tests = [
   'ADD test',
   'ADD with saturation',
   'ADD an immediate',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 837382c..bc340ed 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,19 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "ABS test",
-   "!!ARBfp1.0\n"
-   "PARAM p = program.local[2]; \n"
-   "ABS result.color, p; \n"
-   "END \n",
-   { ABS(Param2[0]),
- ABS(Param2[1]),
- ABS(Param2[2]),
- ABS(Param2[3])
-   },
-   DONT_CARE_Z,
-   },
-   {
"ADD test",
"!!ARBfp1.0\n"
"PARAM p = program.local[1]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/abs.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/abs.shader_test
new file mode 100644
index 000..87949d1
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/abs.shader_test
@@ -0,0 +1,16 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+ABS result.color, p;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.0, -1.0, 0.25, -0.5)
+draw rect -1 -1 2 2 
+probe all rgba 0.0 1.0 0.25 0.5
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 0/37] Port Glean Frag-prog tests to shader_runner

2016-09-06 Thread Dylan Baker
This series takes a swing at porting some of the glean tests to the
native piglit framework, all through shader_runner.

For the most part these are pretty much straight across ports, with a
few modifications since these don't have all of the shared setup before
they run, and in a few cases to simplify the tests, or to have them draw
green on success like most piglit tests do.

There is one change I'm a little bit skeptical about is adding support
for GL_FOG to shader_runner. It does make the rest of the tests easy to
port, but it's yet more code in shader_runner, which is already a giant
mess.

Dylan Baker (37):
  editorconfig: update the editorconfig file
  glean/tfragprog1: port ABS test to shader_runner
  glean/tfragprog1: port ADD tests to shader_runner
  glean/tfragprog1: Port CMP test to shader_runner
  glean/tfragprog1: port COS tests to shader runner
  glean/tfragprog1: port DP3 tests to shader_runner
  glean/tfragprog1: port DP4 test to shader_runner
  glean/tfragprog1: port DPH test to shader_runner
  glean/tfragprog1: port DST test to shader_runner
  glean/tfragprog1: port EX2 test to shader_runner
  glean/tfragprog1: port FLR test to shader_runner
  glean/tfragprog1: port FRC test to shader_runner
  glean/tfragprog1: port LG2 test to shader_runner
  glean/tfragprog1: port LIT tests to shader_runner
  glean/tfragprog1: port LRP test to shader_runner
  glean/tfragprog1: port MAD test to shader_runner
  glean/tfragprog1: port MAX test to shader_runner
  glean/tfragprog1: port MIN test to shader_runner
  glean/tfragprog1: port MOV tests to shader_runner
  glean/tfragprog1: port MUL tests to shader_runner
  glean/tfragprog1: port POW test to shader_runner
  glean/tfragprog1: port RCP tests to shader_runner
  glean/tfragprog1: port RSQ tests to shader_runner
  glean/tfragprog1: port SCS test to shader_runner
  glean/tfragprog1: port SGE test to shader_runner
  glean/tfragprog1: port SIN tests to shader_runner
  glean/tfragprog1: replace SLT test with shader_runner test
  glean/tfragprog1: port SUB tests to shader_runner
  glean/tfragprog1: port swizzle tests to shader_runner
  glean/tfragprog1: port XPD test to shader_runner
  shader_runner: add command for glFog
  glean/tfragprog1: port linear fog tests to shader_runner
  glean/tfragprog1: port exp-fog tests to shader_runner
  glean/tfragprog1: port exp2 fog tests to shader_runner
  glean/tfragprog1: port z-write test to shader_runner
  glean/tfragprog1: remove stress tests
  glean: delete the now empty tfragprog1.cpp

 .editorconfig  
   |4 +-
 tests/all.py   
   |   54 +---
 tests/glean/CMakeLists.gl.txt  
   |1 +-
 tests/glean/tfragprog1.cpp 
   | 1125 
+
 tests/glean/tfragprog1.h   
   |   92 +--
 tests/shaders/shader_runner.c  
   |   74 +-
 tests/spec/arb_fragment_program/built-in-functions/abs.shader_test 
   |   16 +-
 tests/spec/arb_fragment_program/built-in-functions/add-immediate.shader_test   
   |   16 +-
 
tests/spec/arb_fragment_program/built-in-functions/add-negative-immediate.shader_test
 |   16 +-
 tests/spec/arb_fragment_program/built-in-functions/add.shader_test 
   |   18 +-
 tests/spec/arb_fragment_program/built-in-functions/add_sat.shader_test 
   |   22 +-
 tests/spec/arb_fragment_program/built-in-functions/cmp.shader_test 
   |   20 +-
 tests/spec/arb_fragment_program/built-in-functions/cmp_sat.shader_test 
   |   20 +-
 
tests/spec/arb_fragment_program/built-in-functions/cos-clamped-values.shader_test
 |   22 +-
 tests/spec/arb_fragment_program/built-in-functions/cos.shader_test 
   |   19 +-
 tests/spec/arb_fragment_program/built-in-functions/dp3.shader_test 
   |   18 +-
 tests/spec/arb_fragment_program/built-in-functions/dp4.shader_test 
   |   18 +-
 tests/spec/arb_fragment_program/built-in-functions/dph.shader_test 
   |   18 +-
 tests/spec/arb_fragment_program/built-in-functions/dst.shader_test 
   |   18 +-
 tests/spec/arb_fragment_program/built-in-functions/ex2.shader_test 
   |   22 +-
 tests/spec/arb_fragment_program/built-in-functions/flr.shader_test 
   |   19 +-
 tests/spec/arb_fragment_program/built-in-functions/frc.shader_test 
   |   16 +-
 tests/spec/arb_fragment_program/built-in-functions/lg2.shader_test 
   |   22 +-
 tests/spec/arb_fragment_program/built-in-functions/lit-0-to-0.shader_test  
   |   18 +-
 tests/spec/arb_fragment_program/built

[Piglit] [PATCH v2 19/37] glean/tfragprog1: port MOV tests to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  1 -
 tests/glean/tfragprog1.cpp |  8 

 tests/spec/arb_fragment_program/built-in-functions/mov.shader_test | 16 

 3 files changed, 16 insertions(+), 9 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/mov.shader_test

diff --git a/tests/all.py b/tests/all.py
index 2666271..1ba96a4 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'MOV test',
   'MUL test',
   'masked MUL test',
   'POW test (exponentiation)',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index d8ba52c..b13e6cb 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,14 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "MOV test",
-   "!!ARBfp1.0\n"
-   "MOV result.color, fragment.color; \n"
-   "END \n",
-   FRAGCOLOR,
-   DONT_CARE_Z,
-   },
-   {
"MUL test",
"!!ARBfp1.0\n"
"PARAM p = program.local[1]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/mov.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/mov.shader_test
new file mode 100644
index 000..1995692
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/mov.shader_test
@@ -0,0 +1,16 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+MOV result.color, p;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.0, 1.0, 0.0, 0.0)
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 17/37] glean/tfragprog1: port MAX test to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  1 -
 tests/glean/tfragprog1.cpp | 14 
--
 tests/spec/arb_fragment_program/built-in-functions/max.shader_test | 18 
++
 3 files changed, 18 insertions(+), 15 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/max.shader_test

diff --git a/tests/all.py b/tests/all.py
index bf4e60f..3c6d9a1 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'MAX test',
   'MIN test',
   'MOV test',
   'MUL test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 9254e11..2a77702 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,20 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "MAX test",
-   "!!ARBfp1.0\n"
-   "PARAM p1 = program.local[1]; \n"
-   "PARAM p2 = program.local[2]; \n"
-   "MAX result.color, p1, p2; \n"
-   "END \n",
-   { MAX(Param1[0], Param2[0]),
- MAX(Param1[1], Param2[1]),
- MAX(Param1[2], Param2[2]),
- MAX(Param1[3], Param2[3]),
-   },
-   DONT_CARE_Z
-   },
-   {
"MIN test",
"!!ARBfp1.0\n"
"PARAM p1 = program.local[1]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/max.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/max.shader_test
new file mode 100644
index 000..c9a175a
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/max.shader_test
@@ -0,0 +1,18 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+MAX result.color, p, q;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (1.0, 0.5, 0.0, -1.0)
+parameter local_fp 1 (0.5, 1.0, 1.0,  1.0)
+draw rect -1 -1 2 2
+probe all rgba 1.0 1.0 1.0 1.0
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 5/37] glean/tfragprog1: port COS tests to shader runner

2016-09-06 Thread Dylan Baker
This ports both of the COS tests to shader runner.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   
   |  2 --
 tests/glean/tfragprog1.cpp 
   | 32 
 
tests/spec/arb_fragment_program/built-in-functions/cos-clamped-values.shader_test
 | 22 ++
 tests/spec/arb_fragment_program/built-in-functions/cos.shader_test 
   | 19 +++
 4 files changed, 41 insertions(+), 34 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/cos-clamped-values.shader_test
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/cos.shader_test

diff --git a/tests/all.py b/tests/all.py
index 5a86c32..b3b6605 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,8 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'COS test',
-  'COS test 2',
   'DP3 test',
   'DP3 test (2)',
   'DP4 test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 878e7ac..85e8ecd 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,38 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "COS test",
-   "!!ARBfp1.0\n"
-   "PARAM values = { 0.0, 3.14159, 0.5, 1.0 }; \n"
-   "COS result.color.x, values.x; \n"
-   "COS result.color.y, values.y; \n"
-   "COS result.color.z, values.z; \n"
-   "COS result.color.w, values.w; \n"
-   "END \n",
-   { CLAMP01(1.0),
- CLAMP01(-1.0),
- CLAMP01(0.8775),
- CLAMP01(0.5403)
-   },
-   DONT_CARE_Z
-   },
-   {
-   "COS test 2",
-   "!!ARBfp1.0\n"
-   "PARAM values = { 6.78318, 7.28318, 6.28318, -5.78318 }; \n"
-   "COS result.color.x, values.x; \n"
-   "COS result.color.y, values.y; \n"
-   "COS result.color.z, values.z; \n"
-   "COS result.color.w, values.w; \n"
-   "END \n",
-   { CLAMP01(0.8775),
- CLAMP01(0.5403),
- CLAMP01(1.0),
- CLAMP01(0.8775)
-   },
-   DONT_CARE_Z
-   },
-   {
"DP3 test",
"!!ARBfp1.0\n"
"PARAM p1 = program.local[1]; \n"
diff --git 
a/tests/spec/arb_fragment_program/built-in-functions/cos-clamped-values.shader_test
 
b/tests/spec/arb_fragment_program/built-in-functions/cos-clamped-values.shader_test
new file mode 100644
index 000..e6ea4d8
--- /dev/null
+++ 
b/tests/spec/arb_fragment_program/built-in-functions/cos-clamped-values.shader_test
@@ -0,0 +1,22 @@
+# Variant of the COS test that uses values that are all clamped by the nature
+# of COS
+
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+COS result.color.x, p.x;
+COS result.color.y, p.y;
+COS result.color.z, p.z;
+COS result.color.w, p.w;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (6.78318, 7.28318, 6.28318, -5.78318)
+draw rect -1 -1 2 2
+probe all rgba 0.8775 0.5403 1.0 0.8775
diff --git a/tests/spec/arb_fragment_program/built-in-functions/cos.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/cos.shader_test
new file mode 100644
index 000..932b1ae
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/cos.shader_test
@@ -0,0 +1,19 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+COS result.color.x, p.x;
+COS result.color.y, p.y;
+COS result.color.z, p.z;
+COS result.color.w, p.w;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (0.0, 3.14159, 0.5, 1.0)
+draw rect -1 -1 2 2
+probe all rgba 1.0 0.0 0.8775 0.5403
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 14/37] glean/tfragprog1: port LIT tests to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py  |  3 
---
 tests/glean/tfragprog1.cpp| 39 
---
 tests/spec/arb_fragment_program/built-in-functions/lit-0-to-0.shader_test | 18 
++
 tests/spec/arb_fragment_program/built-in-functions/lit-x-lt-0.shader_test | 19 
+++
 tests/spec/arb_fragment_program/built-in-functions/lit.shader_test| 17 
+
 5 files changed, 54 insertions(+), 42 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/lit-0-to-0.shader_test
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/lit-x-lt-0.shader_test
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/lit.shader_test

diff --git a/tests/all.py b/tests/all.py
index 1fb1dce..3b10361 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,9 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'LIT test 1',
-  'LIT test 2 (degenerate case: 0 ^ 0 -> 1)',
-  'LIT test 3 (case x < 0)',
   'MAD test',
   'MAX test',
   'MIN test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 91f1171..f26f07f 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -81,45 +81,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // These are the specific fragment programs which we'll test
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
-   {
-   "LIT test 1",
-   "!!ARBfp1.0\n"
-   "PARAM values = {0.65, 0.9, 0.0, 8.0}; \n"
-   "LIT result.color, values; \n"
-   "END \n",
-   { 1.0,
- 0.65,// values.x
- 0.433,   // roughly Pow(values.y, values.w)
- 1.0
-   },
-   DONT_CARE_Z
-   },
-   {
-   "LIT test 2 (degenerate case: 0 ^ 0 -> 1)",
-   "!!ARBfp1.0\n"
-   "PARAM values = {0.65, 0.0, 0.0, 0.0}; \n"
-   "LIT result.color, values; \n"
-   "END \n",
-   { 1.0,
- 0.65,// values.x
- 1.0, // 0^0
- 1.0
-   },
-   DONT_CARE_Z
-   },
-   {
-   "LIT test 3 (case x < 0)",
-   "!!ARBfp1.0\n"
-   "PARAM values = {-0.5, 0.0, 0.0, 0.0}; \n"
-   "LIT result.color, values; \n"
-   "END \n",
-   { 1.0,
- CLAMP01(-0.5),// values.x
- 0.0,
- 1.0
-   },
-   DONT_CARE_Z
-   },
 {
"LRP test",
"!!ARBfp1.0\n"
diff --git 
a/tests/spec/arb_fragment_program/built-in-functions/lit-0-to-0.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/lit-0-to-0.shader_test
new file mode 100644
index 000..acddb29
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/lit-0-to-0.shader_test
@@ -0,0 +1,18 @@
+# Covers the 0^0 = 1 case
+
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+LIT result.color, p;
+END
+
+[test]
+clear
+
+parameter local_fp 0 (0.65, 0.0, 0.0, 0.0)
+draw rect -1 -1 2 2 
+# The 0.65 is p.x, and 0.433 is roughly pow(0.65, 0.9)
+probe all rgba 1.0 0.65 1.0 1.0
diff --git 
a/tests/spec/arb_fragment_program/built-in-functions/lit-x-lt-0.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/lit-x-lt-0.shader_test
new file mode 100644
index 000..99dc19f
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/lit-x-lt-0.shader_test
@@ -0,0 +1,19 @@
+# Covers the x < 0 case
+
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+LIT result.color, p;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (-0.5, 0.0, 0.0, 0.0)
+draw rect -1 -1 2 2 
+# The 0.65 is p.x, and 0.433 is roughly pow(0.65, 0.9)
+probe all rgba 1.0 0.65 1.0 1.0
diff --git a/tests/spec/arb_fragment_program/built-in-functions/lit.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/lit.shader_test
new file mode 100644
index 000..e1d62d7
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/lit.shader_test
@@ -0,0 +1,17 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+LIT result.color, p;
+END
+
+[test]
+

[Piglit] [PATCH v2 12/37] glean/tfragprog1: port FRC test to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  1 -
 tests/glean/tfragprog1.cpp |  9 
-
 tests/spec/arb_fragment_program/built-in-functions/frc.shader_test | 16 

 3 files changed, 16 insertions(+), 10 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/frc.shader_test

diff --git a/tests/all.py b/tests/all.py
index 428d1cb..5f6fac1 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'FRC test',
   'LG2 test',
   'LIT test 1',
   'LIT test 2 (degenerate case: 0 ^ 0 -> 1)',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index f71d032..a65fa38 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,15 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "FRC test",
-   "!!ARBfp1.0\n"
-   "PARAM values = {-1.1, 0.1, -2.2, 2.4 }; \n"
-   "FRC result.color, values; \n"
-   "END \n",
-   { 0.9, 0.1, 0.8, 0.4 },
-   DONT_CARE_Z
-   },
-   {
"LG2 test",
"!!ARBfp1.0\n"
"PARAM values = {64.0, 1, 30, 4}; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/frc.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/frc.shader_test
new file mode 100644
index 000..54c7be1
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/frc.shader_test
@@ -0,0 +1,16 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+FRC result.color, p;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (-1.1, 0.1, -2.2, 2.4)
+draw rect -1 -1 2 2
+probe all rgba 0.9 0.1 0.8 0.4
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 4/37] glean/tfragprog1: Port CMP test to shader_runner

2016-09-06 Thread Dylan Baker
This also adds a similar CMP_SAT test.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  1 -
 tests/glean/tfragprog1.cpp | 11 
---
 tests/spec/arb_fragment_program/built-in-functions/cmp.shader_test | 20 

 tests/spec/arb_fragment_program/built-in-functions/cmp_sat.shader_test | 20 

 4 files changed, 40 insertions(+), 12 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/cmp.shader_test
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/cmp_sat.shader_test

diff --git a/tests/all.py b/tests/all.py
index e655251..5a86c32 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'CMP test',
   'COS test',
   'COS test 2',
   'DP3 test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 1cbe243..878e7ac 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,17 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "CMP test",
-   "!!ARBfp1.0\n"
-   "PARAM zero = program.local[0]; \n"
-   "PARAM p1 = program.local[1]; \n"
-   "PARAM p2 = program.local[2]; \n"
-   "CMP result.color, p2, zero, p1; \n"
-   "END \n",
-   { Param0[0], Param1[1], Param1[2], Param0[3] },
-   DONT_CARE_Z
-   },
-   {
"COS test",
"!!ARBfp1.0\n"
"PARAM values = { 0.0, 3.14159, 0.5, 1.0 }; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/cmp.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/cmp.shader_test
new file mode 100644
index 000..eb89a17
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/cmp.shader_test
@@ -0,0 +1,20 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+PARAM r = program.local[2];
+CMP result.color, p, q, r;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 ( -1.0, 0.0, 1.0, 0.5 )
+parameter local_fp 1 (  0.0, 0.0, 1.0, 1.0 )
+parameter local_fp 2 (  1.0, 1.0, 0.0, 0.0 )
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
diff --git 
a/tests/spec/arb_fragment_program/built-in-functions/cmp_sat.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/cmp_sat.shader_test
new file mode 100644
index 000..48fdc13
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/cmp_sat.shader_test
@@ -0,0 +1,20 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+PARAM r = program.local[2];
+CMP_SAT result.color, p, q, r;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 ( -1.0, 0.0, 1.0, 0.5 )
+parameter local_fp 1 (  0.0, 0.0, 1.0, 1.0 )
+parameter local_fp 2 (  2.0, 1.0, 0.0, 0.0 )
+draw rect -1 -1 2 2
+probe all rgba 0.0 1.0 0.0 0.0
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 9/37] glean/tfragprog1: port DST test to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  1 -
 tests/glean/tfragprog1.cpp | 15 
---
 tests/spec/arb_fragment_program/built-in-functions/dst.shader_test | 18 
++
 3 files changed, 18 insertions(+), 16 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/dst.shader_test

diff --git a/tests/all.py b/tests/all.py
index dcb0c73..2d2314d 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'DST test',
   'EX2 test',
   'FLR test',
   'FRC test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 2c56f28..b39862d 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,21 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "DST test",
-   "!!ARBfp1.0\n"
-   "# let d = 0.4 \n"
-   "PARAM v1 = {9.9, 0.16, 0.16, 9.9}; \n"
-   "PARAM v2 = {9.9, 2.5, 9.9, 2.5}; \n"
-   "DST result.color, v1, v2; \n"
-   "END \n",
-   { 1.0,
- 0.4,   // v1.y * v2.y
- 0.16,  // v1.z
- CLAMP01(2.5)   // v2.w
-   },
-   DONT_CARE_Z
-   },
-   {
"EX2 test",
"!!ARBfp1.0\n"
 "PARAM scale = {0.01, 0.01, 0.01, 0.01}; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/dst.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/dst.shader_test
new file mode 100644
index 000..d5ef557
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/dst.shader_test
@@ -0,0 +1,18 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+DST result.color, p, q;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (9.9, 0.16, 0.16, 9.9)
+parameter local_fp 1 (9.9, 2.5, 9.9, 2.5)
+draw rect -1 -1 2 2
+probe all rgba 1.0 0.4 0.16 1.0
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 1/37] editorconfig: update the editorconfig file

2016-09-06 Thread Dylan Baker
- set python to utf-8
- remove "remove trailing whitespace" from python (like the emacs config)
- add glsl shaders to C style

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 .editorconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.editorconfig b/.editorconfig
index c614fcc..5e140a8 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -3,9 +3,9 @@ root = true
 [*.py]
 indent_style = space
 indent_size = 4
-trim_trailing_whitespace = true
+charset = utf-8
 
-[*.{c,cpp,h,hpp}]
+[*.{c,cpp,h,hpp,shader_test,frag,vert,geom,tesc,tese,comp}]
 indent_style = tab
 tab_width = 8
 
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 6/37] glean/tfragprog1: port DP3 tests to shader_runner

2016-09-06 Thread Dylan Baker
This ports the first test and just removes the second test, which like
some of the other dropped tests doesn't really focus on DP3, or on a
reported bug for DP3, it just adds complexity.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  2 --
 tests/glean/tfragprog1.cpp | 27 
---
 tests/spec/arb_fragment_program/built-in-functions/dp3.shader_test | 18 
++
 3 files changed, 18 insertions(+), 29 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/dp3.shader_test

diff --git a/tests/all.py b/tests/all.py
index b3b6605..8132bbb 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,8 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'DP3 test',
-  'DP3 test (2)',
   'DP4 test',
   'DPH test',
   'DST test',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index 85e8ecd..bf95a20 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,33 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "DP3 test",
-   "!!ARBfp1.0\n"
-   "PARAM p1 = program.local[1]; \n"
-   "DP3 result.color, p1, fragment.color; \n"
-   "END \n",
-   { SMEAR(CLAMP01(Param1[0] * FragColor[0] +
-Param1[1] * FragColor[1] +
-Param1[2] * FragColor[2]))
-   },
-   DONT_CARE_Z
-   },
-   {
-   "DP3 test (2)",
-   "!!ARBfp1.0\n"
-   "PARAM p1 = program.local[1]; \n"
-   "TEMP t, r; \n"
-   "MOV t, p1; \n"
-   "DP3 r.x, t, t; \n"
-   "MUL result.color, r., 0.5; \n"
-   "END \n",
-   { SMEAR(CLAMP01((Param1[0] * Param1[0] +
-Param1[1] * Param1[1] +
-Param1[2] * Param1[2]) * 0.5))
-   },
-   DONT_CARE_Z
-   },
-   {
"DP4 test",
"!!ARBfp1.0\n"
"PARAM p1 = program.local[1]; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/dp3.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/dp3.shader_test
new file mode 100644
index 000..43095a4
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/dp3.shader_test
@@ -0,0 +1,18 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM q = program.local[1];
+DP3 result.color, p, q;
+END
+
+[test]
+clear color 1.0 1.0 1.0 1.0
+clear
+
+parameter local_fp 0 (0.4, 0.6, 0.7, 0.5)
+parameter local_fp 1 (0.1, 0.2, 0.3, 0.4)
+draw rect -1 -1 2 2
+probe all rgba 0.37 0.37 0.37 0.37
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 11/37] glean/tfragprog1: port FLR test to shader_runner

2016-09-06 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 tests/all.py   |  1 -
 tests/glean/tfragprog1.cpp | 16 

 tests/spec/arb_fragment_program/built-in-functions/flr.shader_test | 19 
+++
 3 files changed, 19 insertions(+), 17 deletions(-)
 create mode 100644 
tests/spec/arb_fragment_program/built-in-functions/flr.shader_test

diff --git a/tests/all.py b/tests/all.py
index 57a5114..428d1cb 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -376,7 +376,6 @@ glean_glsl_tests = ['Primary plus secondary color',
 'texcoord varying']
 
 glean_fp_tests = [
-  'FLR test',
   'FRC test',
   'LG2 test',
   'LIT test 1',
diff --git a/tests/glean/tfragprog1.cpp b/tests/glean/tfragprog1.cpp
index eac70e0..f71d032 100644
--- a/tests/glean/tfragprog1.cpp
+++ b/tests/glean/tfragprog1.cpp
@@ -82,22 +82,6 @@ static GLfloat FogCoord = 50.0;  /* Between FogStart and 
FogEnd */
 // Alphabetical order, please
 static const FragmentProgram Programs[] = {
{
-   "FLR test",
-   "!!ARBfp1.0\n"
-   "PARAM values = {4.8, 0.3, -0.2, 1.2}; \n"
-   "PARAM scale = {0.1, 0.1, 0.1, 0.1}; \n"
-   "TEMP t; \n"
-   "FLR t, values; \n"
-   "MUL result.color, t, scale; \n"
-   "END \n",
-   { 0.4,
- 0.0,
- CLAMP01(-0.1),
- 0.1
-   },
-   DONT_CARE_Z
-   },
-   {
"FRC test",
"!!ARBfp1.0\n"
"PARAM values = {-1.1, 0.1, -2.2, 2.4 }; \n"
diff --git a/tests/spec/arb_fragment_program/built-in-functions/flr.shader_test 
b/tests/spec/arb_fragment_program/built-in-functions/flr.shader_test
new file mode 100644
index 000..0aa50e2
--- /dev/null
+++ b/tests/spec/arb_fragment_program/built-in-functions/flr.shader_test
@@ -0,0 +1,19 @@
+[require]
+GL_ARB_fragment_program
+
+[fragment program]
+!!ARBfp1.0
+PARAM p = program.local[0];
+PARAM scale = {0.1, 0.1, 0.1, 0.1};
+TEMP t;
+FLR t, p;
+MUL result.color, t, scale;
+END
+
+[test]
+clear color 0.5 0.5 0.5 0.5
+clear
+
+parameter local_fp 0 (4.8, 0.2, -0.2, 1.2)
+draw rect -1 -1 2 2
+probe all rgba 0.4 0.0 0.0 0.1
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] Building current piglit on ubuntu 12.04?

2016-09-04 Thread Dylan Baker
Quoting Ilia Mirkin (2016-09-03 20:59:23)
> piglit does not require python3, it is meant to be able to run with
> either python2.7 or python3.3+. If you find that something *requires*
> python3, please report that separately.

Indeed. The chbangs for all of the scripts are python3 because we have
to pick one or the other, and python3 enables more features without
external requirements, so we picked that one. You can still call it via
python2  

[Piglit] [PATCH] framework: Fix FastSkipMixin version comparisons

2016-09-02 Thread Dylan Baker
Currently the FastSkipMixin assumes that versions will always be a
minimum required version, and nothing else. This is mostly true of
piglit tests, but isn't always true. Sometimes tests specify that they
need a version greater-or-equal, and a few have less-than or
less-than-equal.

This patch fixes that, and also generalizes the fast-skip mechanism a
bit. It does this by allowing the caller to set an operation as well as
a value.

This also updates glslparsertest and shadertest to use the newly updated
interfaces.
---
 framework/test/glsl_parser_test.py|  23 +--
 framework/test/opengl.py  | 209 +-
 framework/test/shader_test.py |  28 ++-
 unittests/framework/test/test_glsl_parser_test.py |  12 +-
 unittests/framework/test/test_opengl.py   | 190 +++-
 unittests/framework/test/test_shader_test.py  |  21 ++-
 6 files changed, 277 insertions(+), 206 deletions(-)

diff --git a/framework/test/glsl_parser_test.py 
b/framework/test/glsl_parser_test.py
index b1acb18..9cfbc65 100644
--- a/framework/test/glsl_parser_test.py
+++ b/framework/test/glsl_parser_test.py
@@ -24,6 +24,7 @@
 from __future__ import (
 absolute_import, division, print_function, unicode_literals
 )
+import operator
 import os
 import re
 import io
@@ -31,7 +32,7 @@ import six
 
 from framework import exceptions
 from .base import TestIsSkip
-from .opengl import FastSkipMixin
+from .opengl import FastSkipMixin, VersionSkip, ExtensionsSkip
 from .piglit_test import PiglitBaseTest, TEST_BIN_DIR
 
 __all__ = [
@@ -115,29 +116,31 @@ class GLSLParserTest(FastSkipMixin, PiglitBaseTest):
 glsl = config.get('glsl_version')
 if glsl:
 if _is_gles_version(glsl):
-self.glsl_es_version = float(glsl[:3])
+self.glsl_es_version = VersionSkip(
+operator.ge, float(glsl[:3]), '>=')
 else:
-self.glsl_version = float(glsl)
+self.glsl_version = VersionSkip(
+operator.ge, float(glsl), '>=')
 
 req = config.get('require_extensions')
 if req:
-self.gl_required = set(
-r for r in req.split() if not r.startswith('!'))
+self.gl_required = ExtensionsSkip(set(
+r for r in req.split() if not r.startswith('!')))
 
 # If GLES is requested, but piglit was not built with a gles version,
 # then ARB_ES3_compatibility is required. Add it to
 # self.gl_required
 if self.glsl_es_version and not _HAS_GLES_BIN:
-if self.glsl_es_version == 1.0:
+if self.glsl_es_version.version == 1.0:
 ver = '2'
-elif self.glsl_es_version == 3.0:
+elif self.glsl_es_version.version == 3.0:
 ver = '3'
-elif self.glsl_es_version == 3.1:
+elif self.glsl_es_version.version == 3.1:
 ver = '3_1'
-elif self.glsl_es_version == 3.2:
+elif self.glsl_es_version.version == 3.2:
 ver = '3_2'
 ext = 'ARB_ES{}_compatibility'.format(ver)
-self.gl_required.add(ext)
+self.gl_required.extensions.add(ext)
 self._command.append(ext)
 
 @staticmethod
diff --git a/framework/test/opengl.py b/framework/test/opengl.py
index 6fe8670..6e63190 100644
--- a/framework/test/opengl.py
+++ b/framework/test/opengl.py
@@ -25,12 +25,14 @@ from __future__ import (
 )
 import errno
 import os
+import operator
 import subprocess
 import warnings
 
 import six
 
 from framework import exceptions, core
+from framework import compat
 from framework.options import OPTIONS
 from .base import TestIsSkip
 
@@ -45,6 +47,21 @@ __all__ = [
 _DISABLED = bool(os.environ.get('PIGLIT_NO_FAST_SKIP', False))
 
 
+@compat.python_2_unicode_compatible
+class FastSkip(exceptions.PiglitInternalError):
+"""Exception class raised when a test should fast skip.
+
+This is used internally by the FastSkipMixin and is reraised as a
+TestIsSkip exception.
+"""
+def __init__(self, msg=''):
+super(FastSkip, self).__init__()
+self.msg = msg
+
+def __str__(self):
+return self.msg
+
+
 class StopWflinfo(exceptions.PiglitException):
 """Exception called when wlfinfo getter should stop."""
 def __init__(self, reason):
@@ -287,6 +304,95 @@ class WflInfo(object):
 return ret
 
 
+class VersionSkip(object):
+"""Class that implements skip conditions based on versions.
+
+This class adds support for checking one version against another.
+
+>>> import operator
+>>> test = VersionSkip(operator.lt, 3.0, rep='<')
+>>> test.test(4.0)
+Traceback (most recent call last):
+...
+framework.test.opengl.FastSkip: ...
+
+>>> import operator
+>>> test = VersionSkip(operator.lt, 3.0, rep='<')
+>>> test.test(1.0)
+
+

[Piglit] [PATCH] tests: fix ext_shader_samples_identical ES 3.1 vert test

2016-09-01 Thread Dylan Baker
This test is currently completely broken. It uses names defined in
GL_OES_texture_storage_multisample_2d_array without adding a #extension
directive or a config requirement. It also doesn't declare precision.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
cc: i...@freedesktop.org
---
 .../glsl-es-3.10/compiler/all-functions.vert  | 15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git 
a/tests/spec/ext_shader_samples_identical/glsl-es-3.10/compiler/all-functions.vert
 
b/tests/spec/ext_shader_samples_identical/glsl-es-3.10/compiler/all-functions.vert
index cc188ab..e1b154d 100644
--- 
a/tests/spec/ext_shader_samples_identical/glsl-es-3.10/compiler/all-functions.vert
+++ 
b/tests/spec/ext_shader_samples_identical/glsl-es-3.10/compiler/all-functions.vert
@@ -1,18 +1,19 @@
 // [config]
 // expect_result: pass
 // glsl_version: 3.10
-// require_extensions: GL_EXT_shader_samples_identical
+// require_extensions: GL_EXT_shader_samples_identical 
GL_OES_texture_storage_multisample_2d_array
 // [end config]
 
 #version 310 es
 #extension GL_EXT_shader_samples_identical: require
+#extension GL_OES_texture_storage_multisample_2d_array: require
 
-uniform sampler2DMS s1;
-uniform isampler2DMS s2;
-uniform usampler2DMS s3;
-uniform sampler2DMSArray s4;
-uniform isampler2DMSArray s5;
-uniform usampler2DMSArray s6;
+uniform mediump sampler2DMS s1;
+uniform mediump isampler2DMS s2;
+uniform mediump usampler2DMS s3;
+uniform mediump sampler2DMSArray s4;
+uniform mediump isampler2DMSArray s5;
+uniform mediump usampler2DMSArray s6;
 
 flat out ivec2 data;
 
-- 
2.9.3

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


Re: [Piglit] [PATCH 1/5] gl-1.0: Move scissor tests here.

2016-09-01 Thread Dylan Baker
Quoting Dylan Baker (2016-09-01 12:03:35)
> 
> Maybe it's also a good time to evaluate whether these actually need to
> be run serially?
> 

Or maybe I should read all the patches before I send comments.


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


Re: [Piglit] [PATCH 1/5] gl-1.0: Move scissor tests here.

2016-09-01 Thread Dylan Baker
Quoting Matt Turner (2016-09-01 11:44:48)
> ---
>  tests/all.py   | 16 
>  tests/general/CMakeLists.gl.txt|  8 
>  tests/spec/gl-1.0/CMakeLists.gl.txt|  8 
>  tests/{general => spec/gl-1.0}/scissor-bitmap.c|  0
>  tests/{general => spec/gl-1.0}/scissor-clear.c |  0
>  tests/{general => spec/gl-1.0}/scissor-copypixels.c|  0
>  tests/{general => spec/gl-1.0}/scissor-depth-clear.c   |  0
>  tests/{general => spec/gl-1.0}/scissor-many.c  |  0
>  tests/{general => spec/gl-1.0}/scissor-offscreen.c |  0
>  tests/{general => spec/gl-1.0}/scissor-polygon.c   |  0
>  tests/{general => spec/gl-1.0}/scissor-stencil-clear.c |  0
>  11 files changed, 16 insertions(+), 16 deletions(-)
>  rename tests/{general => spec/gl-1.0}/scissor-bitmap.c (100%)
>  rename tests/{general => spec/gl-1.0}/scissor-clear.c (100%)
>  rename tests/{general => spec/gl-1.0}/scissor-copypixels.c (100%)
>  rename tests/{general => spec/gl-1.0}/scissor-depth-clear.c (100%)
>  rename tests/{general => spec/gl-1.0}/scissor-many.c (100%)
>  rename tests/{general => spec/gl-1.0}/scissor-offscreen.c (100%)
>  rename tests/{general => spec/gl-1.0}/scissor-polygon.c (100%)
>  rename tests/{general => spec/gl-1.0}/scissor-stencil-clear.c (100%)
> 
> diff --git a/tests/all.py b/tests/all.py
> index e110f59..276f5a8 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -859,14 +859,6 @@ with profile.group_manager(
>  g(['readpix-z'])
>  g(['roundmode-getintegerv'], run_concurrent=False)
>  g(['roundmode-pixelstore'], run_concurrent=False)
> -g(['scissor-bitmap'], run_concurrent=False)
> -g(['scissor-clear'], run_concurrent=False)
> -g(['scissor-copypixels'], run_concurrent=False)
> -g(['scissor-depth-clear'], run_concurrent=False)
> -g(['scissor-many'], run_concurrent=False)
> -g(['scissor-offscreen'], run_concurrent=False)
> -g(['scissor-polygon'])
> -g(['scissor-stencil-clear'], run_concurrent=False)
>  g(['select', 'gl11'], 'GL_SELECT - no test function', 
> run_concurrent=False)
>  g(['select', 'depth'], 'GL_SELECT - depth-test enabled',
>run_concurrent=False)
> @@ -971,6 +963,14 @@ with profile.group_manager(
>  g(['gl-1.0-logicop'])
>  g(['gl-1.0-no-op-paths'])
>  g(['gl-1.0-simple-readbuffer'])
> +g(['gl-1.0-scissor-bitmap'], run_concurrent=False)
> +g(['gl-1.0-scissor-clear'], run_concurrent=False)
> +g(['gl-1.0-scissor-copypixels'], run_concurrent=False)
> +g(['gl-1.0-scissor-depth-clear'], run_concurrent=False)
> +g(['gl-1.0-scissor-many'], run_concurrent=False)
> +g(['gl-1.0-scissor-offscreen'], run_concurrent=False)
> +g(['gl-1.0-scissor-polygon'])
> +g(['gl-1.0-scissor-stencil-clear'], run_concurrent=False)

Maybe it's also a good time to evaluate whether these actually need to
be run serially?

>  
>  with profile.group_manager(
>  PiglitGLTest,
> diff --git a/tests/general/CMakeLists.gl.txt b/tests/general/CMakeLists.gl.txt
> index 3a46fb0..ceec9f0 100644
> --- a/tests/general/CMakeLists.gl.txt
> +++ b/tests/general/CMakeLists.gl.txt
> @@ -99,14 +99,6 @@ piglit_add_executable (read-front read-front.c)
>  piglit_add_executable (readpix-z readpix-z.c)
>  piglit_add_executable (roundmode-getintegerv roundmode-getintegerv.c)
>  piglit_add_executable (roundmode-pixelstore roundmode-pixelstore.c)
> -piglit_add_executable (scissor-bitmap scissor-bitmap.c)
> -piglit_add_executable (scissor-clear scissor-clear.c)
> -piglit_add_executable (scissor-copypixels scissor-copypixels.c)
> -piglit_add_executable (scissor-depth-clear scissor-depth-clear.c)
> -piglit_add_executable (scissor-many scissor-many.c)
> -piglit_add_executable (scissor-offscreen scissor-offscreen.c)
> -piglit_add_executable (scissor-polygon scissor-polygon.c)
> -piglit_add_executable (scissor-stencil-clear scissor-stencil-clear.c)
>  piglit_add_executable (select select.c)
>  piglit_add_executable (stencil-drawpixels stencil-drawpixels.c)
>  piglit_add_executable (stencil-twoside stencil-twoside.c)
> diff --git a/tests/spec/gl-1.0/CMakeLists.gl.txt 
> b/tests/spec/gl-1.0/CMakeLists.gl.txt
> index 219b9b1..e79f0cb 100644
> --- a/tests/spec/gl-1.0/CMakeLists.gl.txt
> +++ b/tests/spec/gl-1.0/CMakeLists.gl.txt
> @@ -29,6 +29,14 @@ piglit_add_executable (gl-1.0-rastercolor rastercolor.c)
>  piglit_add_executable (gl-1.0-readpixsanity readpix.c)
>  piglit_add_executable (gl-1.0-readpixels-oob readpixels-oob.c)
>  piglit_add_executable (gl-1.0-rendermode-feedback rendermode-feedback.c)
> +piglit_add_executable (gl-1.0-scissor-bitmap scissor-bitmap.c)
> +piglit_add_executable (gl-1.0-scissor-clear scissor-clear.c)
> +piglit_add_executable (gl-1.0-scissor-copypixels scissor-copypixels.c)
> +piglit_add_executable (gl-1.0-scissor-depth-clear scissor-depth-clear.c)
> +piglit_add_executable (gl-1.0-scissor-many scissor-many.c)
> 

[Piglit] [PATCH v2 5/5] unittests: don't require totals section in schema

2016-09-01 Thread Dylan Baker
We generate this on the fly if it's not there and add it.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 unittests/framework/backends/schema/piglit-8.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/unittests/framework/backends/schema/piglit-8.json 
b/unittests/framework/backends/schema/piglit-8.json
index 8661f40..9b000fd 100644
--- a/unittests/framework/backends/schema/piglit-8.json
+++ b/unittests/framework/backends/schema/piglit-8.json
@@ -102,7 +102,7 @@
 }
 },
 "additionalProperties": false,
-"required": [ "__type__", "clinfo", "glxinfo", "lspci", "wglinfo", "name", 
"results_version", "uname", "time_elapsed", "totals", "tests" ],
+"required": [ "__type__", "clinfo", "glxinfo", "lspci", "wglinfo", "name", 
"results_version", "uname", "time_elapsed", "tests" ],
 "definitions": {
 "timeAttribute": {
 "type": "object",
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 4/5] unittests: Fix JSON schema test to pass time_elapsed

2016-09-01 Thread Dylan Baker
Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 unittests/framework/backends/test_json.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/unittests/framework/backends/test_json.py 
b/unittests/framework/backends/test_json.py
index e6574a6..0c49aff 100644
--- a/unittests/framework/backends/test_json.py
+++ b/unittests/framework/backends/test_json.py
@@ -112,7 +112,8 @@ class TestJSONBackend(object):
 test.initialize(shared.INITIAL_METADATA)
 with test.write_test(self.name) as t:
 t(self.result)
-test.finalize()
+test.finalize(
+{'time_elapsed': results.TimeAttribute(start=0.0, end=1.0)})
 
 def test_metadata_removed(self, tmpdir):
 assert not tmpdir.join('metadata.json').check()
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH v2 3/5] tox: add a streams target.

2016-09-01 Thread Dylan Baker
Also enables the target in travis and appveyor.

Signed-off-by: Dylan Baker <dylanx.c.ba...@intel.com>
---
 .travis.yml  | 8 
 appveyor.yml | 8 
 tox.ini  | 3 ++-
 3 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 5c3bf08..97a97a7 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -2,10 +2,10 @@ language: python
 python: 3.5
 cache: pip
 env:
-- TOX_ENV="py27-{noaccel,accel-nix}"
-- TOX_ENV="py33-{noaccel,accel-nix}"
-- TOX_ENV="py34-{noaccel,accel-nix}"
-- TOX_ENV="py35-{noaccel,accel-nix}"
+- TOX_ENV="py27-{noaccel,accel-nix,streams}"
+- TOX_ENV="py33-{noaccel,accel-nix,streams}"
+- TOX_ENV="py34-{noaccel,accel-nix,streams}"
+- TOX_ENV="py35-{noaccel,accel-nix,streams}"
 install:
 pip install tox
 script:
diff --git a/appveyor.yml b/appveyor.yml
index 3588df8..0e30177 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -13,25 +13,25 @@ environment:
 WITH_COMPILER: 'cmd /E:ON /V:ON /C .\ci\appveyor\compiler.cmd'
 
 matrix:
-- TOXENV: 'py27-{noaccel,accel-win}'
+- TOXENV: 'py27-{noaccel,accel-win,streams}'
   TOXPYTHON: C:\Python27\python.exe
   PYTHON_HOME: C:\Python27
   PYTHON_VERSION: '2.7'
   PYTHON_ARCH: '32'
 
-- TOXENV: 'py33-{noaccel,accel-win}'
+- TOXENV: 'py33-{noaccel,accel-win,streams}'
   TOXPYTHON: C:\Python33\python.exe
   PYTHON_HOME: C:\Python33
   PYTHON_VERSION: '3.3'
   PYTHON_ARCH: '32'
 
-- TOXENV: 'py34-{noaccel,accel-win}'
+- TOXENV: 'py34-{noaccel,accel-win,streams}'
   TOXPYTHON: C:\Python34\python.exe
   PYTHON_HOME: C:\Python34
   PYTHON_VERSION: '3.4'
   PYTHON_ARCH: '32'
 
-- TOXENV: 'py35-{noaccel,accel-win}'
+- TOXENV: 'py35-{noaccel,accel-win,streams}'
   TOXPYTHON: C:\Python35\python.exe
   PYTHON_HOME: C:\Python35
   PYTHON_VERSION: '3.5'
diff --git a/tox.ini b/tox.ini
index 04e025d..c7e18cf 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
 [tox]
-envlist = py{27,33,34,35}-{generator,noaccel}, py{27,33,34,35}-accel-{win,nix}
+envlist = py{27,33,34,35}-{generator,noaccel}, 
py{27,33,34,35}-accel-{win,nix}, py{27,33,34,35}-streams
 skipsdist = True
 
 [pytest]
@@ -33,3 +33,4 @@ deps =
 commands = 
 {accel,noaccel}: py.test -rw unittests/framework unittests/suites []
 generator: py.test -rw unittests/generators []
+streams: py.test -rw unittests/framework/backends/test_json.py []
-- 
git-series 0.8.10
___
Piglit mailing list
Piglit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/piglit


<    2   3   4   5   6   7   8   9   10   11   >