[Piglit] [PATCH] namespace-pollution: Initial framework and test cases for namespace pollution

2015-12-16 Thread Ian Romanick
From: Ian Romanick 

See the giant comment in the top of
tests/general/object-namespace-pollution.c for more details.  Currently
only buffer objects and texture objects are supported with glClear and
glGenerateMipmap.  Addtional objects and operations will be added.

Both glClear and glGenerateMipmap fail with buffer objects in Mesa
11.0.6 and earlier.  These texture object tests pass.

Signed-off-by: Ian Romanick 
Cc: Emil Velikov 
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=92363
---

I have tried to send this out a couple times, but git-send-mail keeps
failing in a way that I don't know how to debug.

There will be more subtests here.  I want to send the framework out for
review sooner rather than later.

I do not like the first_unused_texture hack.  Comments in the code
explain why it is necessary.  I believe this will need to be extended to
support framebuffer objects as well.  An alternative approach is to
modify the piglit infrastructure to not use glGenTextures or
glGenFramebuffers with -fbo on non-core profile.  I'm not convinced
that's better.

 tests/all.py   |   8 +
 tests/general/CMakeLists.gl.txt|   1 +
 tests/general/object-namespace-pollution.c | 603 +
 3 files changed, 612 insertions(+)
 create mode 100644 tests/general/object-namespace-pollution.c

diff --git a/tests/all.py b/tests/all.py
index e3719ee..cfd298e 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4579,5 +4579,13 @@ with profile.group_manager(
 for sample_count in (str(x) for x in MSAA_SAMPLE_COUNTS):
 g(['ext_shader_samples_identical', sample_count])
 
+with profile.group_manager(
+PiglitGLTest,
+grouptools.join('object namespace pollution')) as g:
+for object_type in ("buffer", "texture"):
+for operation in ("glClear", "glGenerateMipmap"):
+g(['object-namespace-pollution', operation, object_type],
+  '{} with {}'.format(object_type, operation))
+
 if platform.system() is 'Windows':
 profile.filter_tests(lambda p, _: not p.startswith('glx'))
diff --git a/tests/general/CMakeLists.gl.txt b/tests/general/CMakeLists.gl.txt
index 298f59c..4b59d1f 100644
--- a/tests/general/CMakeLists.gl.txt
+++ b/tests/general/CMakeLists.gl.txt
@@ -76,6 +76,7 @@ piglit_add_executable (line-flat-clip-color 
line-flat-clip-color.c)
 piglit_add_executable (lineloop lineloop.c)
 piglit_add_executable (longprim longprim.c)
 piglit_add_executable (masked-clear masked-clear.c)
+piglit_add_executable (object-namespace-pollution object-namespace-pollution.c)
 piglit_add_executable (pos-array pos-array.c)
 piglit_add_executable (pbo-drawpixels pbo-drawpixels.c)
 piglit_add_executable (pbo-read-argb pbo-read-argb.c)
diff --git a/tests/general/object-namespace-pollution.c 
b/tests/general/object-namespace-pollution.c
new file mode 100644
index 000..1d8859e
--- /dev/null
+++ b/tests/general/object-namespace-pollution.c
@@ -0,0 +1,603 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/**
+ * \file object-namespace-pollution.c
+ * Verify that the GL implementation does not pollute the object namespace.
+ *
+ * At least through Mesa 11.1.0, Mesa drivers that use "meta" have some
+ * problems with respect to the OpenGL object namespace.  Many places inside
+ * meta allocate objects using a mechanism similar to \c glGen*.  This poses
+ * serious problems for applications that create objects without using the
+ * associated \c glGen* function (so called "user generated names").
+ *
+ * Section 3.8.12 (Texture Objects) of the OpenGL 2.1 (May 16, 2008) spec
+ * says:
+ *
+ * "The command
+ *
+ * void GenTextures( sizei n, uint *textures );
+ *
+ * returns n previously unused texture object names in textures. These
+ * names are marked as used, for the purposes of GenTextures only, 

[Piglit] [PATCH 5/4] framework/backends/junit.py; timeouts are errors

2015-12-16 Thread baker . dylan . c
From: Dylan Baker 

Previously a timeout would be marked as pass, but that makes no sense.
This marks it as an error.

v6: - add this patch

Signed-off-by: Dylan Baker 
---

Apparently this isn't affecting anyone at the moment, but as soon as a
jenkins user turns on timeouts they're going to get some odd results.

 framework/backends/junit.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/framework/backends/junit.py b/framework/backends/junit.py
index 15c6c0b..abedff5 100644
--- a/framework/backends/junit.py
+++ b/framework/backends/junit.py
@@ -150,7 +150,7 @@ class JUnitBackend(FileBackend):
 else:
 res = etree.SubElement(element, 'failure')
 
-elif data.result == 'crash':
+elif data.result in ['crash', 'timeout']:
 if expected_result == "error":
 err.text += "\n\nWARN: passing test as an expected crash"
 res = etree.SubElement(element, 'skipped',
-- 
2.6.4

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


[Piglit] [PATCH v5 3/4] framework/tests/base_tests.py: use utils helper to simplify test

2015-12-16 Thread baker . dylan . c
From: Dylan Baker 

This just saves some code duplication.

v3: - fix tests to actually work.

Signed-off-by: Dylan Baker 
---
 framework/tests/base_tests.py | 20 
 1 file changed, 8 insertions(+), 12 deletions(-)

diff --git a/framework/tests/base_tests.py b/framework/tests/base_tests.py
index 31143b6..453ee50 100644
--- a/framework/tests/base_tests.py
+++ b/framework/tests/base_tests.py
@@ -52,6 +52,11 @@ class TestTest(Test):
 self.test_interpret_result()
 
 
+class TimeoutTest(Test):
+def interpret_result(self):
+super(TimeoutTest, self).interpret_result()
+
+
 # Tests
 def test_run_return_early():
 """ Test.run() exits early when Test._run_command() has exception """
@@ -70,29 +75,20 @@ def test_timeout():
 """test.base.Test.run(): Sets status to 'timeout' when timeout exceeded"""
 utils.binary_check('sleep', 1)
 
-class _Test(Test):
-def interpret_result(self):
-super(_Test, self).interpret_result()
-
-test = _Test(['sleep', '60'])
+test = TimeoutTest(['sleep', '60'])
 test.timeout = 1
 test.run()
 nt.eq_(test.result.result, 'timeout')
 
 
-@attr('slow')
 def test_timeout_pass():
 """test.base.Test.run(): Doesn't change status when timeout not exceeded
 """
 utils.binary_check('true')
 
-def helper():
-if (test.result.returncode == 0):
-test.result.result = "pass"
-
-test = TestTest(['true'])
-test.test_interpret_result = helper
+test = TimeoutTest(['true'])
 test.timeout = 1
+test.result.result = 'pass'
 test.run()
 nt.eq_(test.result.result, 'pass')
 
-- 
2.6.4

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


[Piglit] [PATCH v5 0/4] Use subprocess32 to provide thread safe timeouts

2015-12-16 Thread baker . dylan . c
From: Dylan Baker 

This is a pretty minor update to the v4. It adds a few comments, and
fixes a (pretty serious) but that caused test classes with no timeout
set to have a timeout of 0 seconds, instead of an unlimited timeout.

This is available at my github:
https://github.com/dcbaker/piglit submit/subprocess32

Dylan Baker (4):
  framework/tests: add helper for checking for 3rd party modules
  framework/tests/base_tests.py: fix descriptions of two timeout tests
  framework/tests/base_tests.py: use utils helper to simplify test
  framework/test/base.py: use subprocess32 for timeouts.

 framework/test/base.py  | 144 ++--
 framework/tests/base_tests.py   | 135 +++---
 framework/tests/junit_backends_tests.py |   3 +-
 framework/tests/utils.py|   9 ++
 tox.ini |   2 +
 5 files changed, 196 insertions(+), 97 deletions(-)

-- 
2.6.4

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


[Piglit] [PATCH v5 2/4] framework/tests/base_tests.py: fix descriptions of two timeout tests

2015-12-16 Thread baker . dylan . c
From: Dylan Baker 

These tests claimed to test the timeout mechanism, but what they're
really testing is the status changing ability of the timeout mechanism.

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

diff --git a/framework/tests/base_tests.py b/framework/tests/base_tests.py
index 20bea87..31143b6 100644
--- a/framework/tests/base_tests.py
+++ b/framework/tests/base_tests.py
@@ -67,7 +67,7 @@ def test_run_return_early():
 
 @attr('slow')
 def test_timeout():
-"""test.base.Test.run(): kills tests that exceed timeout when set"""
+"""test.base.Test.run(): Sets status to 'timeout' when timeout exceeded"""
 utils.binary_check('sleep', 1)
 
 class _Test(Test):
@@ -82,7 +82,7 @@ def test_timeout():
 
 @attr('slow')
 def test_timeout_pass():
-"""test.base.Test.run(): Result is returned when timeout is set but not 
exceeded
+"""test.base.Test.run(): Doesn't change status when timeout not exceeded
 """
 utils.binary_check('true')
 
-- 
2.6.4

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


[Piglit] [PATCH v5 1/4] framework/tests: add helper for checking for 3rd party modules

2015-12-16 Thread baker . dylan . c
From: Dylan Baker 

This little helper skips a test if a module isn't available.

Signed-off-by: Dylan Baker 
---
 framework/tests/junit_backends_tests.py | 3 +--
 framework/tests/utils.py| 9 +
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/framework/tests/junit_backends_tests.py 
b/framework/tests/junit_backends_tests.py
index 7d5a3fc..d0a6fd7 100644
--- a/framework/tests/junit_backends_tests.py
+++ b/framework/tests/junit_backends_tests.py
@@ -111,8 +111,7 @@ class TestJUnitSingleTest(TestJunitNoTests):
 
 def test_xml_valid(self):
 """backends.junit.JUnitBackend.write_test(): (once) produces valid 
xml"""
-if etree.__name__ != 'lxml.etree':
-raise SkipTest('Test requires lxml features')
+utils.module_check('lxml')
 schema = etree.XMLSchema(file=JUNIT_SCHEMA)
 with open(self.test_file, 'r') as f:
 nt.ok_(schema.validate(etree.parse(f)), msg='xml is not valid')
diff --git a/framework/tests/utils.py b/framework/tests/utils.py
index 2a9370c..aaf782c 100644
--- a/framework/tests/utils.py
+++ b/framework/tests/utils.py
@@ -34,6 +34,7 @@ import tempfile as tempfile_
 import functools
 import subprocess
 import errno
+import importlib
 from contextlib import contextmanager
 
 try:
@@ -314,6 +315,14 @@ def binary_check(bin_, errno_=None):
 e.returncode, errno_))
 
 
+def module_check(module):
+"""Check that an external module is available or skip."""
+try:
+importlib.import_module(module)
+except ImportError:
+raise SkipTest('Required module {} not available.'.format(module))
+
+
 def platform_check(plat):
 """If the platform is not in the list specified skip the test."""
 if not sys.platform.startswith(plat):
-- 
2.6.4

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


[Piglit] [PATCH v5 4/4] framework/test/base.py: use subprocess32 for timeouts.

2015-12-16 Thread baker . dylan . c
From: Dylan Baker 

Subprocess32 provides a backport of python 3.2's subprocess module,
which has a timeout parameter for Popen.communicate. When the timeout
runs out then an exception is raised, and when that exception is caught
we can kill the process.

This is fairly similar to the way the current timeout mechanism works,
except that the current mechanism is not thread safe. Since one of the
major features of piglit is that it offer's processes isolated
concurrency of tests, it makes sense to make the effort to provide a
timeout mechanism that supports concurrency. Unfortunately there isn't a
good cross platform mechanism for this in python 2.x, even with
subprocess 32 only *nix systems are supported, not windows.

The big advantage of this is it allows consistent behavior between
python 2.x and 3.x as we look toward the future and the possibility of
using a hybrid approach to transition to python 3.x while maintaining
2.x support until it's not needed.

This patch look pretty substantial. It's not as big as it looks, since
it adds some fairly big tests.

v3: - Wait before terminating process
- use os.getpgid instead of os.getsid
- use subprocess32 for accel profile in tox
- Add warning when using the dummy version of TimeoutExpired
- mark more unittests as slow and add timeouts to them
- Remove the use of a Mixin, timeouts are an important enough
  feature every test suite should have the option to use them, and
  by not using a mixin there is no need for the ugly interface.
v4: - Fix rebasing artifacts, including many changes in v3 that appeared
  to be unrelated
- do not wait to terminate in the timeout case
- Update timeout message to be clearer
- Fix test descriptions to not include TimeoutMixin, which was
  removed in a previous version of this patch
- Rebase on latest master
v5: - Set base timeout to None instead of 0. The default argument for
  timeout is None, so setting it to 0 makes the timeout period 0
  seconds instead of the intended unlimited. This broke test classes
  that didn't implement a timeout parameter.

Signed-off-by: Dylan Baker 
---
 framework/test/base.py| 144 ++
 framework/tests/base_tests.py | 117 +-
 tox.ini   |   2 +
 3 files changed, 179 insertions(+), 84 deletions(-)

diff --git a/framework/test/base.py b/framework/test/base.py
index 4232e6c..5e30ede 100644
--- a/framework/test/base.py
+++ b/framework/test/base.py
@@ -25,16 +25,43 @@
 from __future__ import print_function, absolute_import
 import errno
 import os
-import subprocess
 import time
 import sys
 import traceback
-from datetime import datetime
-import threading
-import signal
 import itertools
 import abc
 import copy
+import signal
+import warnings
+
+try:
+# subprocess32 only supports *nix systems, this is important because
+# "start_new_session" is not a valid argument on windows
+
+import subprocess32 as subprocess
+_EXTRA_POPEN_ARGS = {'start_new_session': True}
+except ImportError:
+# If there is no timeout support, fake it. Add a TimeoutExpired exception
+# and a Popen that accepts a timeout parameter (and ignores it), then
+# shadow the actual Popen with this wrapper.
+
+import subprocess
+
+class TimeoutExpired(Exception):
+pass
+
+class Popen(subprocess.Popen):
+"""Sublcass of Popen that accepts and ignores a timeout argument."""
+def communicate(self, *args, **kwargs):
+if 'timeout' in kwargs:
+del kwargs['timeout']
+return super(Popen, self).communicate(*args, **kwargs)
+
+subprocess.TimeoutExpired = TimeoutExpired
+subprocess.Popen = Popen
+_EXTRA_POPEN_ARGS = {}
+
+warnings.warn('Timeouts are not available')
 
 from framework import exceptions, options
 from framework.results import TestResult
@@ -62,56 +89,6 @@ class TestRunError(exceptions.PiglitException):
 self.status = status
 
 
-class ProcessTimeout(threading.Thread):
-""" Timeout class for test processes
-
-This class is for terminating tests that run for longer than a certain
-amount of time. Create an instance by passing it a timeout in seconds
-and the Popen object that is running your test. Then call the start
-method (inherited from Thread) to start the timer. The Popen object is
-killed if the timeout is reached and it has not completed. Wait for the
-outcome by calling the join() method from the parent.
-
-"""
-
-def __init__(self, timeout, proc):
-threading.Thread.__init__(self)
-self.proc = proc
-self.timeout = timeout
-self.status = 0
-
-def run(self):
-start_time = datetime.now()
-delta = 0
-
-# poll() returns the returncode attribute, which is either the return
-# code of the child process (which could be zero), or None if the
-# 

[Piglit] [PATCH] Add tests for GL_ARB_shader_draw_parameters

2015-12-16 Thread Kristian Høgsberg
From: Kristian Høgsberg Kristensen 

---

v2: Fix copy-paste error in drawid-indirect-vertexid case.

 tests/all.py   |  15 ++
 tests/spec/CMakeLists.txt  |   1 +
 .../arb_shader_draw_parameters/CMakeLists.gl.txt   |  14 ++
 .../spec/arb_shader_draw_parameters/CMakeLists.txt |   1 +
 tests/spec/arb_shader_draw_parameters/basevertex.c | 176 +
 .../arb_shader_draw_parameters/drawid-indirect.c   | 216 +
 tests/spec/arb_shader_draw_parameters/drawid.c | 173 +
 7 files changed, 596 insertions(+)
 create mode 100644 tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_shader_draw_parameters/CMakeLists.txt
 create mode 100644 tests/spec/arb_shader_draw_parameters/basevertex.c
 create mode 100644 tests/spec/arb_shader_draw_parameters/drawid-indirect.c
 create mode 100644 tests/spec/arb_shader_draw_parameters/drawid.c

diff --git a/tests/all.py b/tests/all.py
index f61ff15..39cffbb 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4552,5 +4552,20 @@ with profile.group_manager(
 for sample_count in (str(x) for x in MSAA_SAMPLE_COUNTS):
 g(['ext_shader_samples_identical', sample_count])
 
+# Group ARR_shader_draw_parameters
+with profile.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'ARB_shader_draw_parameters')) as g:
+g(['arb_shader_draw_parameters-drawid', 'drawid'], 'drawid')
+g(['arb_shader_draw_parameters-drawid', 'vertexid'], 'drawid-vertexid')
+g(['arb_shader_draw_parameters-basevertex', 'basevertex'], 'basevertex')
+g(['arb_shader_draw_parameters-basevertex', 'baseinstance'], 
'baseinstance')
+g(['arb_shader_draw_parameters-basevertex', 'basevertex-baseinstance'], 
'basevertex-baseinstance')
+g(['arb_shader_draw_parameters-basevertex', 'vertexid-zerobased'], 
'vertexid-zerobased')
+g(['arb_shader_draw_parameters-drawid-indirect', 'drawid'], 
'drawid-indirect')
+g(['arb_shader_draw_parameters-drawid-indirect', 'basevertex'], 
'drawid-indirect-basevertex')
+g(['arb_shader_draw_parameters-drawid-indirect', 'baseinstance'], 
'drawid-indirect-baseinstance')
+g(['arb_shader_draw_parameters-drawid-indirect', 'vertexid'], 
'drawid-indirect-vertexid')
+
 if platform.system() is 'Windows':
 profile.filter_tests(lambda p, _: not p.startswith('glx'))
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 57ac541..b499cd8 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -139,3 +139,4 @@ add_subdirectory (ext_framebuffer_blit)
 add_subdirectory (mesa_pack_invert)
 add_subdirectory (ext_texture_format_bgra)
 add_subdirectory (oes_draw_elements_base_vertex)
+add_subdirectory (arb_shader_draw_parameters)
diff --git a/tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt 
b/tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt
new file mode 100644
index 000..f711e2c
--- /dev/null
+++ b/tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt
@@ -0,0 +1,14 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+   ${piglit_SOURCE_DIR}/tests/mesa/util
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable (arb_shader_draw_parameters-basevertex basevertex.c)
+piglit_add_executable (arb_shader_draw_parameters-drawid drawid.c)
+piglit_add_executable (arb_shader_draw_parameters-drawid-indirect 
drawid-indirect.c)
diff --git a/tests/spec/arb_shader_draw_parameters/CMakeLists.txt 
b/tests/spec/arb_shader_draw_parameters/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_shader_draw_parameters/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_shader_draw_parameters/basevertex.c 
b/tests/spec/arb_shader_draw_parameters/basevertex.c
new file mode 100644
index 000..343c38c
--- /dev/null
+++ b/tests/spec/arb_shader_draw_parameters/basevertex.c
@@ -0,0 +1,176 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR 

[Piglit] [PATCH] arb_separate_shader_objects: make sure explicit locations match and don't just overlap

2015-12-16 Thread Timothy Arceri
Test results: Nvidia GeForce 840M - NVIDIA 352.41: fail
Mesa 11.2 (dev): pass
---
 ...fs-explicit-location-mismatch-array.shader_test | 50 ++
 1 file changed, 50 insertions(+)
 create mode 100644 
tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-mismatch-array.shader_test

diff --git 
a/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-mismatch-array.shader_test
 
b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-mismatch-array.shader_test
new file mode 100644
index 000..e359d63
--- /dev/null
+++ 
b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-mismatch-array.shader_test
@@ -0,0 +1,50 @@
+// From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.5 spec:
+//
+//"For the purposes of determining if a non-vertex input matches an output
+//from a previous shader stage, the location layout qualifier (if any)
+//must match."
+
+[require]
+GLSL >= 1.40
+GL_ARB_separate_shader_objects
+
+[vertex shader]
+#version 140
+#extension GL_ARB_separate_shader_objects : require
+
+in vec4 piglit_vertex;
+
+layout(location = 0) out vec4 out1[2];
+layout(location = 3) out vec4 out2;
+
+void main()
+{
+   gl_Position = piglit_vertex;
+   out1[0] = vec4(1.0, 0.0, 0.0, 1.0);
+   out1[1] = vec4(1.0, 1.0, 0.0, 1.0);
+   out2 = vec4(0.0);
+}
+
+[fragment shader]
+#version 140
+#extension GL_ARB_separate_shader_objects : require
+
+uniform int i;
+
+layout(location = 1) in vec4 out1[2];
+layout(location = 3) in vec4 out2;
+
+out vec4 color;
+
+void main()
+{
+   if (i == 0)
+   color = out1[0];
+   else if (i == 1)
+   color = out1[1];
+   else
+   color = out2;
+}
+
+[test]
+link error
-- 
2.4.3

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


Re: [Piglit] [PATCH] igt: Restore handling of special igt error codes

2015-12-16 Thread Dylan Baker
This will solve the issue, and shouldn't have any side effects. I think you
can actually just drop the super call (although, now that I look at it the
code in Test probably actually belongs in PiglitTest, but I digress).

On Wed, Dec 16, 2015 at 8:03 AM, Daniel Vetter 
wrote:

> In
>
> commit 5cbc1834fd47e7f475afc85e1638762e5b221a81
> Author: Dylan Baker 
> Date:   Mon Dec 14 15:34:11 2015 -0800
>
> framework/test/base.py: Handle fail cases for tests.
>
> the Test baseclass was made more robust in it's default behaviour, but
> that totally broke igt error code handling.
>
> CI is ... rather unhappy about it, so fix it asap.
>
> Cc: Dylan Baker 
> Cc: Mark Janes 
> Signed-off-by: Daniel Vetter 
> ---
>  tests/igt.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/igt.py b/tests/igt.py
> index 4998ab203a23..074df08cc88c 100644
> --- a/tests/igt.py
> +++ b/tests/igt.py
> @@ -109,6 +109,8 @@ class IGTTest(Test):
>  self.timeout = 600
>
>  def interpret_result(self):
> +super(IGTTest, self).interpret_result()
> +
>  if self.result.returncode == 0:
>  self.result.result = 'pass'
>  elif self.result.returncode == 77:
> @@ -118,8 +120,6 @@ class IGTTest(Test):
>  else:
>  self.result.result = 'fail'
>
> -super(IGTTest, self).interpret_result()
> -
>
>  def list_tests(listname):
>  """Parse igt test list and return them as a list."""
> --
> 2.6.4
>
>
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


Re: [Piglit] [PATCH] Add tests for GL_ARB_shader_draw_parameters

2015-12-16 Thread Ilia Mirkin
On Wed, Dec 16, 2015 at 1:28 PM, Kristian Høgsberg  wrote:
> From: Kristian Høgsberg Kristensen 
>
> ---
>  tests/all.py   |  15 ++
>  tests/spec/CMakeLists.txt  |   1 +
>  .../arb_shader_draw_parameters/CMakeLists.gl.txt   |  14 ++
>  .../spec/arb_shader_draw_parameters/CMakeLists.txt |   1 +
>  tests/spec/arb_shader_draw_parameters/basevertex.c | 176 +
>  .../arb_shader_draw_parameters/drawid-indirect.c   | 216 
> +
>  tests/spec/arb_shader_draw_parameters/drawid.c | 173 +
>  7 files changed, 596 insertions(+)
>  create mode 100644 tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt
>  create mode 100644 tests/spec/arb_shader_draw_parameters/CMakeLists.txt
>  create mode 100644 tests/spec/arb_shader_draw_parameters/basevertex.c
>  create mode 100644 tests/spec/arb_shader_draw_parameters/drawid-indirect.c
>  create mode 100644 tests/spec/arb_shader_draw_parameters/drawid.c
>
> diff --git a/tests/all.py b/tests/all.py
> index f61ff15..a5cd236 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -4552,5 +4552,20 @@ with profile.group_manager(
>  for sample_count in (str(x) for x in MSAA_SAMPLE_COUNTS):
>  g(['ext_shader_samples_identical', sample_count])
>
> +# Group ARR_shader_draw_parameters
> +with profile.group_manager(
> +PiglitGLTest,
> +grouptools.join('spec', 'ARB_shader_draw_parameters')) as g:
> +g(['arb_shader_draw_parameters-drawid', 'drawid'], 'drawid')
> +g(['arb_shader_draw_parameters-drawid', 'vertexid'], 'drawid-vertexid')
> +g(['arb_shader_draw_parameters-basevertex', 'basevertex'], 'basevertex')
> +g(['arb_shader_draw_parameters-basevertex', 'baseinstance'], 
> 'baseinstance')
> +g(['arb_shader_draw_parameters-basevertex', 'basevertex-baseinstance'], 
> 'basevertex-baseinstance')
> +g(['arb_shader_draw_parameters-basevertex', 'vertexid-zerobased'], 
> 'vertexid-zerobased')
> +g(['arb_shader_draw_parameters-drawid-indirect', 'drawid'], 
> 'drawid-indirect')
> +g(['arb_shader_draw_parameters-drawid-indirect', 'basevertex'], 
> 'drawid-indirect-basevertex')
> +g(['arb_shader_draw_parameters-drawid-indirect', 'baseinstance'], 
> 'drawid-indirect-baseinstance')
> +g(['arb_shader_draw_parameters-drawid-indirect', 'baseinstance'], 
> 'drawid-indirect-vertexid')

Probably vertexid here?
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] Add tests for GL_ARB_shader_draw_parameters

2015-12-16 Thread Kristian Høgsberg
From: Kristian Høgsberg Kristensen 

---
 tests/all.py   |  15 ++
 tests/spec/CMakeLists.txt  |   1 +
 .../arb_shader_draw_parameters/CMakeLists.gl.txt   |  14 ++
 .../spec/arb_shader_draw_parameters/CMakeLists.txt |   1 +
 tests/spec/arb_shader_draw_parameters/basevertex.c | 176 +
 .../arb_shader_draw_parameters/drawid-indirect.c   | 216 +
 tests/spec/arb_shader_draw_parameters/drawid.c | 173 +
 7 files changed, 596 insertions(+)
 create mode 100644 tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_shader_draw_parameters/CMakeLists.txt
 create mode 100644 tests/spec/arb_shader_draw_parameters/basevertex.c
 create mode 100644 tests/spec/arb_shader_draw_parameters/drawid-indirect.c
 create mode 100644 tests/spec/arb_shader_draw_parameters/drawid.c

diff --git a/tests/all.py b/tests/all.py
index f61ff15..a5cd236 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4552,5 +4552,20 @@ with profile.group_manager(
 for sample_count in (str(x) for x in MSAA_SAMPLE_COUNTS):
 g(['ext_shader_samples_identical', sample_count])
 
+# Group ARR_shader_draw_parameters
+with profile.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'ARB_shader_draw_parameters')) as g:
+g(['arb_shader_draw_parameters-drawid', 'drawid'], 'drawid')
+g(['arb_shader_draw_parameters-drawid', 'vertexid'], 'drawid-vertexid')
+g(['arb_shader_draw_parameters-basevertex', 'basevertex'], 'basevertex')
+g(['arb_shader_draw_parameters-basevertex', 'baseinstance'], 
'baseinstance')
+g(['arb_shader_draw_parameters-basevertex', 'basevertex-baseinstance'], 
'basevertex-baseinstance')
+g(['arb_shader_draw_parameters-basevertex', 'vertexid-zerobased'], 
'vertexid-zerobased')
+g(['arb_shader_draw_parameters-drawid-indirect', 'drawid'], 
'drawid-indirect')
+g(['arb_shader_draw_parameters-drawid-indirect', 'basevertex'], 
'drawid-indirect-basevertex')
+g(['arb_shader_draw_parameters-drawid-indirect', 'baseinstance'], 
'drawid-indirect-baseinstance')
+g(['arb_shader_draw_parameters-drawid-indirect', 'baseinstance'], 
'drawid-indirect-vertexid')
+
 if platform.system() is 'Windows':
 profile.filter_tests(lambda p, _: not p.startswith('glx'))
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 57ac541..b499cd8 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -139,3 +139,4 @@ add_subdirectory (ext_framebuffer_blit)
 add_subdirectory (mesa_pack_invert)
 add_subdirectory (ext_texture_format_bgra)
 add_subdirectory (oes_draw_elements_base_vertex)
+add_subdirectory (arb_shader_draw_parameters)
diff --git a/tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt 
b/tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt
new file mode 100644
index 000..f711e2c
--- /dev/null
+++ b/tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt
@@ -0,0 +1,14 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+   ${piglit_SOURCE_DIR}/tests/mesa/util
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable (arb_shader_draw_parameters-basevertex basevertex.c)
+piglit_add_executable (arb_shader_draw_parameters-drawid drawid.c)
+piglit_add_executable (arb_shader_draw_parameters-drawid-indirect 
drawid-indirect.c)
diff --git a/tests/spec/arb_shader_draw_parameters/CMakeLists.txt 
b/tests/spec/arb_shader_draw_parameters/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_shader_draw_parameters/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_shader_draw_parameters/basevertex.c 
b/tests/spec/arb_shader_draw_parameters/basevertex.c
new file mode 100644
index 000..343c38c
--- /dev/null
+++ b/tests/spec/arb_shader_draw_parameters/basevertex.c
@@ -0,0 +1,176 @@
+/*
+ * Copyright © 2015 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTH

Re: [Piglit] [PATCH] Add tests for GL_ARB_shader_draw_parameters

2015-12-16 Thread Kristian Høgsberg
On Wed, Dec 16, 2015 at 10:18 AM, Kristian Høgsberg  wrote:
> From: Kristian Høgsberg Kristensen 

Oops, disregard this one, sent it from the wrong repo.

Kristian

> ---
>  tests/spec/CMakeLists.txt  |   1 +
>  .../arb_shader_draw_parameters/CMakeLists.gl.txt   |  15 ++
>  .../spec/arb_shader_draw_parameters/CMakeLists.txt |   1 +
>  .../spec/arb_shader_draw_parameters/baseinstance.c | 164 
> +
>  tests/spec/arb_shader_draw_parameters/basevertex.c | 128 
>  .../arb_shader_draw_parameters/drawid-vertexid.c   | 164 
> +
>  tests/spec/arb_shader_draw_parameters/drawid.c | 161 
>  7 files changed, 634 insertions(+)
>  create mode 100644 tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt
>  create mode 100644 tests/spec/arb_shader_draw_parameters/CMakeLists.txt
>  create mode 100644 tests/spec/arb_shader_draw_parameters/baseinstance.c
>  create mode 100644 tests/spec/arb_shader_draw_parameters/basevertex.c
>  create mode 100644 tests/spec/arb_shader_draw_parameters/drawid-vertexid.c
>  create mode 100644 tests/spec/arb_shader_draw_parameters/drawid.c
>
> diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
> index 57b6878..4c519b1 100644
> --- a/tests/spec/CMakeLists.txt
> +++ b/tests/spec/CMakeLists.txt
> @@ -138,3 +138,4 @@ add_subdirectory (mesa_pack_invert)
>  add_subdirectory (ext_texture_format_bgra)
>  add_subdirectory (oes_draw_elements_base_vertex)
>  add_subdirectory (arb_query_buffer_object)
> +add_subdirectory (arb_shader_draw_parameters)
> diff --git a/tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt 
> b/tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt
> new file mode 100644
> index 000..5396484
> --- /dev/null
> +++ b/tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt
> @@ -0,0 +1,15 @@
> +include_directories(
> +   ${GLEXT_INCLUDE_DIR}
> +   ${OPENGL_INCLUDE_PATH}
> +   ${piglit_SOURCE_DIR}/tests/mesa/util
> +)
> +
> +link_libraries (
> +   piglitutil_${piglit_target_api}
> +   ${OPENGL_gl_LIBRARY}
> +)
> +
> +piglit_add_executable (basevertex basevertex.c)
> +piglit_add_executable (baseinstance baseinstance.c)
> +piglit_add_executable (drawid drawid.c)
> +piglit_add_executable (drawid-vertexid drawid-vertexid.c)
> diff --git a/tests/spec/arb_shader_draw_parameters/CMakeLists.txt 
> b/tests/spec/arb_shader_draw_parameters/CMakeLists.txt
> new file mode 100644
> index 000..144a306
> --- /dev/null
> +++ b/tests/spec/arb_shader_draw_parameters/CMakeLists.txt
> @@ -0,0 +1 @@
> +piglit_include_target_api()
> diff --git a/tests/spec/arb_shader_draw_parameters/baseinstance.c 
> b/tests/spec/arb_shader_draw_parameters/baseinstance.c
> new file mode 100644
> index 000..17ccc36
> --- /dev/null
> +++ b/tests/spec/arb_shader_draw_parameters/baseinstance.c
> @@ -0,0 +1,164 @@
> +/*
> + * Copyright © 2011 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
> + * DEALINGS IN THE SOFTWARE.
> + */
> +
> +/**
> + * \file baseinstance.c
> + *
> + * Test that gl_BaseInstanceARB has the correct values. Draw left side
> + * of window with a non-instanced draw call to verify
> + * gl_BaseInstanceARB is 0 in that case, then draw other half with
> + * base instance 7 and verifies that that works.
> + */
> +
> +#include "piglit-util-gl.h"
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +
> +   config.supports_gl_core_version = 31;
> +   config.window_visual = PIGLIT_GL_VISUAL_RGBA | 
> PIGLIT_GL_VISUAL_DOUBLE;
> +
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +static const char vs_text[] =
> +   "#version 330\n"
> +   "#extension GL_ARB_shader_draw_parameters: require\n"
> +   "\n"
> +   "/* This is floating point so we can use immediate mode */\n"
> +   "layout(location = 0) in vec2 pos;\n"
> +   "layout(location = 1) in vec4 in_color;\n"
> +   "out v

[Piglit] [PATCH] Add tests for GL_ARB_shader_draw_parameters

2015-12-16 Thread Kristian Høgsberg
From: Kristian Høgsberg Kristensen 

---
 tests/spec/CMakeLists.txt  |   1 +
 .../arb_shader_draw_parameters/CMakeLists.gl.txt   |  15 ++
 .../spec/arb_shader_draw_parameters/CMakeLists.txt |   1 +
 .../spec/arb_shader_draw_parameters/baseinstance.c | 164 +
 tests/spec/arb_shader_draw_parameters/basevertex.c | 128 
 .../arb_shader_draw_parameters/drawid-vertexid.c   | 164 +
 tests/spec/arb_shader_draw_parameters/drawid.c | 161 
 7 files changed, 634 insertions(+)
 create mode 100644 tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt
 create mode 100644 tests/spec/arb_shader_draw_parameters/CMakeLists.txt
 create mode 100644 tests/spec/arb_shader_draw_parameters/baseinstance.c
 create mode 100644 tests/spec/arb_shader_draw_parameters/basevertex.c
 create mode 100644 tests/spec/arb_shader_draw_parameters/drawid-vertexid.c
 create mode 100644 tests/spec/arb_shader_draw_parameters/drawid.c

diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 57b6878..4c519b1 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -138,3 +138,4 @@ add_subdirectory (mesa_pack_invert)
 add_subdirectory (ext_texture_format_bgra)
 add_subdirectory (oes_draw_elements_base_vertex)
 add_subdirectory (arb_query_buffer_object)
+add_subdirectory (arb_shader_draw_parameters)
diff --git a/tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt 
b/tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt
new file mode 100644
index 000..5396484
--- /dev/null
+++ b/tests/spec/arb_shader_draw_parameters/CMakeLists.gl.txt
@@ -0,0 +1,15 @@
+include_directories(
+   ${GLEXT_INCLUDE_DIR}
+   ${OPENGL_INCLUDE_PATH}
+   ${piglit_SOURCE_DIR}/tests/mesa/util
+)
+
+link_libraries (
+   piglitutil_${piglit_target_api}
+   ${OPENGL_gl_LIBRARY}
+)
+
+piglit_add_executable (basevertex basevertex.c)
+piglit_add_executable (baseinstance baseinstance.c)
+piglit_add_executable (drawid drawid.c)
+piglit_add_executable (drawid-vertexid drawid-vertexid.c)
diff --git a/tests/spec/arb_shader_draw_parameters/CMakeLists.txt 
b/tests/spec/arb_shader_draw_parameters/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/arb_shader_draw_parameters/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git a/tests/spec/arb_shader_draw_parameters/baseinstance.c 
b/tests/spec/arb_shader_draw_parameters/baseinstance.c
new file mode 100644
index 000..17ccc36
--- /dev/null
+++ b/tests/spec/arb_shader_draw_parameters/baseinstance.c
@@ -0,0 +1,164 @@
+/*
+ * Copyright © 2011 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * \file baseinstance.c
+ *
+ * Test that gl_BaseInstanceARB has the correct values. Draw left side
+ * of window with a non-instanced draw call to verify
+ * gl_BaseInstanceARB is 0 in that case, then draw other half with
+ * base instance 7 and verifies that that works.
+ */
+
+#include "piglit-util-gl.h"
+
+PIGLIT_GL_TEST_CONFIG_BEGIN
+
+   config.supports_gl_core_version = 31;
+   config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
+
+PIGLIT_GL_TEST_CONFIG_END
+
+static const char vs_text[] =
+   "#version 330\n"
+   "#extension GL_ARB_shader_draw_parameters: require\n"
+   "\n"
+   "/* This is floating point so we can use immediate mode */\n"
+   "layout(location = 0) in vec2 pos;\n"
+   "layout(location = 1) in vec4 in_color;\n"
+   "out vec4 color;\n"
+   "\n"
+   "void main()\n"
+   "{\n"
+   "  gl_Position = vec4(pos, 0.0, 1.0);\n"
+   "  color = vec4(equal(vec4(gl_BaseInstanceARB), in_color));\n"
+   "}\n";
+
+static const char fs_text[] =
+   "#version 130\n"
+   "\n"
+   "in vec4 color;\n"
+   "\n"
+   "void main()\n"
+   "{\n"
+   "

Re: [Piglit] [PATCH] igt: Restore handling of special igt error codes

2015-12-16 Thread Mark Janes
Reviewed-by: Mark Janes 

Daniel Vetter  writes:

> In
>
> commit 5cbc1834fd47e7f475afc85e1638762e5b221a81
> Author: Dylan Baker 
> Date:   Mon Dec 14 15:34:11 2015 -0800
>
> framework/test/base.py: Handle fail cases for tests.
>
> the Test baseclass was made more robust in it's default behaviour, but
> that totally broke igt error code handling.
>
> CI is ... rather unhappy about it, so fix it asap.
>
> Cc: Dylan Baker 
> Cc: Mark Janes 
> Signed-off-by: Daniel Vetter 
> ---
>  tests/igt.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/tests/igt.py b/tests/igt.py
> index 4998ab203a23..074df08cc88c 100644
> --- a/tests/igt.py
> +++ b/tests/igt.py
> @@ -109,6 +109,8 @@ class IGTTest(Test):
>  self.timeout = 600
>  
>  def interpret_result(self):
> +super(IGTTest, self).interpret_result()
> +
>  if self.result.returncode == 0:
>  self.result.result = 'pass'
>  elif self.result.returncode == 77:
> @@ -118,8 +120,6 @@ class IGTTest(Test):
>  else:
>  self.result.result = 'fail'
>  
> -super(IGTTest, self).interpret_result()
> -
>  
>  def list_tests(listname):
>  """Parse igt test list and return them as a list."""
> -- 
> 2.6.4
___
Piglit mailing list
Piglit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/piglit


[Piglit] [PATCH] igt: Restore handling of special igt error codes

2015-12-16 Thread Daniel Vetter
In

commit 5cbc1834fd47e7f475afc85e1638762e5b221a81
Author: Dylan Baker 
Date:   Mon Dec 14 15:34:11 2015 -0800

framework/test/base.py: Handle fail cases for tests.

the Test baseclass was made more robust in it's default behaviour, but
that totally broke igt error code handling.

CI is ... rather unhappy about it, so fix it asap.

Cc: Dylan Baker 
Cc: Mark Janes 
Signed-off-by: Daniel Vetter 
---
 tests/igt.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/igt.py b/tests/igt.py
index 4998ab203a23..074df08cc88c 100644
--- a/tests/igt.py
+++ b/tests/igt.py
@@ -109,6 +109,8 @@ class IGTTest(Test):
 self.timeout = 600
 
 def interpret_result(self):
+super(IGTTest, self).interpret_result()
+
 if self.result.returncode == 0:
 self.result.result = 'pass'
 elif self.result.returncode == 77:
@@ -118,8 +120,6 @@ class IGTTest(Test):
 else:
 self.result.result = 'fail'
 
-super(IGTTest, self).interpret_result()
-
 
 def list_tests(listname):
 """Parse igt test list and return them as a list."""
-- 
2.6.4

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


Re: [Piglit] [PATCH 2/2] framework/test/base.py: Handle fail cases for tests.

2015-12-16 Thread Daniel Vetter
On Mon, Dec 14, 2015 at 05:14:18PM -0800, Mark Janes wrote:
> Reviewed-by: Mark Janes 
> 
> baker.dyla...@gmail.com writes:
> 
> > From: Dylan Baker 
> >
> > I'm going to admit I'm a bit puzzled how this could have slipped through
> > without being caught (I'm guessing an unrelated change uncovered this).
> > But basically if a test doesn't raise an exception, and the returncode
> > is > 0, it should mark the test with a status of "fail", but it doesn't.
> > Instead the default status "notrun" is passed to the logger, which it
> > doesn't support, and an exception is raised.
> >
> > This patch corrects that problem.
> >
> > bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93340
> > cc: mark.a.ja...@intel.com
> > Signed-off-by: Dylan Baker 

This seems to break igt badly, which uses special return codes (decoded in
the igt runner) to mark tests as skipped. CI is pretty red because of this
now here :(

Not sure what exactly needs to be fixed here ...
-Daniel

> > ---
> >
> > I'm not really sure this is exactly the right solution. I wonder if we'd
> > be better just to get rid of the "warn" and just say if the returncode
> > is 0 leave it alone, if it's crash/timeout (as defined by the function),
> > do that, otherwise mark it as "fail".
> >
> >  framework/test/base.py|  7 +--
> >  framework/tests/base_tests.py | 15 +++
> >  2 files changed, 20 insertions(+), 2 deletions(-)
> >
> > diff --git a/framework/test/base.py b/framework/test/base.py
> > index 378f185..4232e6c 100644
> > --- a/framework/test/base.py
> > +++ b/framework/test/base.py
> > @@ -210,8 +210,11 @@ class Test(object):
> >  self.result.result = 'timeout'
> >  else:
> >  self.result.result = 'crash'
> > -elif self.result.returncode != 0 and self.result.result == 'pass':
> > -self.result.result = 'warn'
> > +elif self.result.returncode != 0:
> > +if self.result.result == 'pass':
> > +self.result.result = 'warn'
> > +else:
> > +self.result.result = 'fail'
> >  
> >  def run(self):
> >  """
> > diff --git a/framework/tests/base_tests.py b/framework/tests/base_tests.py
> > index c005273..20bea87 100644
> > --- a/framework/tests/base_tests.py
> > +++ b/framework/tests/base_tests.py
> > @@ -260,3 +260,18 @@ class TestValgrindMixinRun(object):
> >  test.result.returncode = 1
> >  test.run()
> >  nt.eq_(test.result.result, 'fail')
> > +
> > +
> > +def test_interpret_result_greater_zero():
> > +"""test.base.Test.interpret_result: A test with status > 0 is fail"""
> > +class _Test(Test):
> > +def interpret_result(self):
> > +super(_Test, self).interpret_result()
> > +
> > +test = _Test(['foobar'])
> > +test.result.returncode = 1
> > +test.result.out = 'this is some\nstdout'
> > +test.result.err = 'this is some\nerrors'
> > +test.interpret_result()
> > +
> > +nt.eq_(test.result.result, 'fail')
> > -- 
> > 2.6.4
> ___
> Piglit mailing list
> Piglit@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit

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


Re: [Piglit] [PATCH] texwrap: fix stencil texturing a bit

2015-12-16 Thread Brian Paul

On 12/15/2015 09:38 PM, srol...@vmware.com wrote:

From: Roland Scheidegger 

Previously, the test was actually using all-zeros in the end for the image,
so unsurprisingly it passed, except when border color was used.
Add the special stencil case handling in a couple more cases.
This will still not test depth/stencil textures in stencil texturing mode, and
furthermore because the spec doesn't seem to say what should happen with all
the channels make it ignore all errors on non-first channel.
---
  tests/texturing/texwrap.c | 16 +++-
  1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/tests/texturing/texwrap.c b/tests/texturing/texwrap.c
index ffe5e83..e10e6ec 100644
--- a/tests/texturing/texwrap.c
+++ b/tests/texturing/texwrap.c
@@ -724,6 +724,10 @@ static void sample_nearest(int x, int y, int z,
image[(coords[2]*size_y*size_x +
   coords[1]*size_x + coords[0])];
result[3] = 1;
+   } else if (format->stencil) {
+   result[0] = result[1] = result[2] = result[3] =
+   image[(coords[2]*size_y*size_x +
+  coords[1]*size_x + coords[0])];
} else {
memcpy(result,
   &image[(coords[2]*size_y*size_x +
@@ -1021,6 +1025,16 @@ static GLboolean probe_pixels(const struct format_desc 
*format, GLboolean npot,
for (j = 0; j < 4; j++) {
deltamax[j] = deltamax_lut[format->intensity];
}
+   } else if (format->stencil && !format->depth) {
+   deltamax[0] = deltamax_lut[format->stencil];
+   /*
+* XXX unless someone can figure out what the hell all
+* those channels should actually return... Right now
+* the test would expect the same value for all 
channels.
+*/
+   for (j = 1; j < 4; j++) {
+   deltamax[j] = 255;
+   }
} else {
if (format->luminance) {
for (j = 0; j < 3; j++) {
@@ -1427,7 +1441,7 @@ static void init_int_texture(const struct format_desc 
*format,
black = colors[5];

/* Set the colors to match the base format. */
-   if (format->intensity) {
+   if (format->intensity || format->stencil) {
for (i = 0; i < 7; i++) {
colors[i][3] = colors[i][2] = colors[i][1] = 
colors[i][0];
}



Reviewed-by: Brian Paul 


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


[Piglit] [PATCH] EXT_multisampled_render_to_texture: functional test

2015-12-16 Thread Magnus Wendt
EXT_multisampled_render_to_texture allows you to bind a singlesampled
texture to the color attachment of a multisampled framebuffer object.
Rendering is multisampled and the multisample data is implicitly
resolved and invalidated when texturing.

The test renders a ground truth image by drawing a slanted textured quad
to a multisampled fbo and resolves it using a blit to a singlesampled
fbo. This is textured onto the left half of the window.
It then renders the same thing into an implicitly resolved fbo and
textures that onto the right half of the screen. The two halfs are
compared. This is repeated for another slant and different clear colors
to check for possible interactions with fast clear.
The test passes if the two methods yeild identical results for all image
pairs.

Signed-off-by: Magnus Wendt 
---
 tests/all.py   |   7 +
 tests/spec/CMakeLists.txt  |   1 +
 .../CMakeLists.gles3.txt   |   5 +
 .../CMakeLists.txt |   1 +
 .../ext_multisampled_render_to_texture.c   | 367 +
 5 files changed, 381 insertions(+)
 create mode 100644 
tests/spec/ext_multisampled_render_to_texture/CMakeLists.gles3.txt
 create mode 100644 tests/spec/ext_multisampled_render_to_texture/CMakeLists.txt
 create mode 100644 
tests/spec/ext_multisampled_render_to_texture/ext_multisampled_render_to_texture.c

diff --git a/tests/all.py b/tests/all.py
index f61ff15..c17450b 100644
--- a/tests/all.py
+++ b/tests/all.py
@@ -4552,5 +4552,12 @@ with profile.group_manager(
 for sample_count in (str(x) for x in MSAA_SAMPLE_COUNTS):
 g(['ext_shader_samples_identical', sample_count])
 
+# Group EXT_multismapled_render_to_texture
+with profile.group_manager(
+PiglitGLTest,
+grouptools.join('spec', 'ext_multisampled_render_to_texture')) as g:
+for sample_count in (str(x) for x in MSAA_SAMPLE_COUNTS):
+g(['ext_multisampled_render_to_texture', sample_count])
+
 if platform.system() is 'Windows':
 profile.filter_tests(lambda p, _: not p.startswith('glx'))
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt
index 57ac541..21ec666 100644
--- a/tests/spec/CMakeLists.txt
+++ b/tests/spec/CMakeLists.txt
@@ -75,6 +75,7 @@ add_subdirectory (ext_depth_bounds_test)
 add_subdirectory (ext_fog_coord)
 add_subdirectory (ext_framebuffer_multisample)
 add_subdirectory (ext_framebuffer_multisample_blit_scaled)
+add_subdirectory (ext_multisampled_render_to_texture)
 add_subdirectory (ext_packed_depth_stencil)
 add_subdirectory (ext_packed_float)
 add_subdirectory (ext_shader_samples_identical)
diff --git a/tests/spec/ext_multisampled_render_to_texture/CMakeLists.gles3.txt 
b/tests/spec/ext_multisampled_render_to_texture/CMakeLists.gles3.txt
new file mode 100644
index 000..fbb688c
--- /dev/null
+++ b/tests/spec/ext_multisampled_render_to_texture/CMakeLists.gles3.txt
@@ -0,0 +1,5 @@
+link_libraries(
+   piglitutil_${piglit_target_api}
+   )
+
+piglit_add_executable(ext_multisampled_render_to_texture 
ext_multisampled_render_to_texture.c)
diff --git a/tests/spec/ext_multisampled_render_to_texture/CMakeLists.txt 
b/tests/spec/ext_multisampled_render_to_texture/CMakeLists.txt
new file mode 100644
index 000..144a306
--- /dev/null
+++ b/tests/spec/ext_multisampled_render_to_texture/CMakeLists.txt
@@ -0,0 +1 @@
+piglit_include_target_api()
diff --git 
a/tests/spec/ext_multisampled_render_to_texture/ext_multisampled_render_to_texture.c
 
b/tests/spec/ext_multisampled_render_to_texture/ext_multisampled_render_to_texture.c
new file mode 100644
index 000..6a7cb02
--- /dev/null
+++ 
b/tests/spec/ext_multisampled_render_to_texture/ext_multisampled_render_to_texture.c
@@ -0,0 +1,367 @@
+/*
+ * 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 (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+/** \file ext_

[Piglit] [PATCH] EXT_multisampled_render_to_texture: functional test

2015-12-16 Thread Magnus Wendt
Hi,

I have written a functional test for EXT_multisampled_render_to_texture.
I have an implementation of this for i965 that I will send to Mesa.

I do not have merge privilages so I would be grateful if someone would merge
this once it has been reviewed.

regards,

Magnus Wendt - Intel OTC

Magnus Wendt (1):
  EXT_multisampled_render_to_texture: functional test

 tests/all.py   |   7 +
 tests/spec/CMakeLists.txt  |   1 +
 .../CMakeLists.gles3.txt   |   5 +
 .../CMakeLists.txt |   1 +
 .../ext_multisampled_render_to_texture.c   | 367 +
 5 files changed, 381 insertions(+)
 create mode 100644 
tests/spec/ext_multisampled_render_to_texture/CMakeLists.gles3.txt
 create mode 100644 tests/spec/ext_multisampled_render_to_texture/CMakeLists.txt
 create mode 100644 
tests/spec/ext_multisampled_render_to_texture/ext_multisampled_render_to_texture.c

-- 
2.5.0

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