summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorAlejandro Piñeiro <apinheiro@igalia.com>2017-09-23 09:14:00 +0200
committerAlejandro Piñeiro <apinheiro@igalia.com>2018-08-21 11:06:12 +0200
commit804e96c6c3065cebf590bc29d09b1f21651a7061 (patch)
tree7aad3ee48e298026699995317f8e3183ede0c7a2 /framework
parent0baf4e2708c9aba8e16b0fa14340373aac83a029 (diff)
framework: add --glsl option
So when executing shader tests, they will be executed with -glsl. This is the force GLSL mode, that is only relevant if the shader test includes SPIR-V shaders. So for example: ./piglit run tests/shader.py -t ARB_gl_spirv --glsl results/results Will try to run all the shader tests for ARB_gl_spirv using GLSL instead of the default (for that extension) SPIR-V. Acked-by: Timothy Arceri <tarceri@itsqueeze.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/options.py1
-rw-r--r--framework/programs/run.py6
-rw-r--r--framework/test/shader_test.py10
3 files changed, 15 insertions, 2 deletions
diff --git a/framework/options.py b/framework/options.py
index f5f32af78..0500640b2 100644
--- a/framework/options.py
+++ b/framework/options.py
@@ -59,6 +59,7 @@ class _Options(object): # pylint: disable=too-many-instance-attributes
self.deqp_mustpass = False
self.process_isolation = True
self.jobs = None
+ self.force_glsl = False
# 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 8011a2966..23cb5e188 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -238,6 +238,10 @@ def _run_parser(input_):
type=path.realpath,
metavar="<Results Path>",
help="Path to results folder")
+ parser.add_argument("--glsl",
+ action="store_true",
+ help="Run shader runner tests with the -glsl (force GLSL) option")
+
return parser.parse_args(unparsed)
@@ -316,6 +320,7 @@ def run(input_):
options.OPTIONS.deqp_mustpass = args.deqp_mustpass
options.OPTIONS.process_isolation = args.process_isolation
options.OPTIONS.jobs = args.jobs
+ options.OPTIONS.force_glsl = args.glsl
# Set the platform to pass to waffle
options.OPTIONS.env['PIGLIT_PLATFORM'] = args.platform
@@ -430,6 +435,7 @@ def resume(input_):
options.OPTIONS.process_isolation = results.options['process_isolation']
options.OPTIONS.jobs = args.jobs
options.OPTIONS.no_retry = args.no_retry
+ options.OPTIONS.force_glsl = results.options['glsl']
core.get_config(args.config_file)
diff --git a/framework/test/shader_test.py b/framework/test/shader_test.py
index 680ae2d6b..6de3a6474 100644
--- a/framework/test/shader_test.py
+++ b/framework/test/shader_test.py
@@ -32,6 +32,7 @@ import re
from framework import exceptions
from framework import status
+from framework import options
from .base import ReducedProcessMixin, TestIsSkip
from .opengl import FastSkipMixin, FastSkip
from .piglit_test import PiglitBaseTest, ROOT_DIR
@@ -186,10 +187,15 @@ class ShaderTest(FastSkipMixin, PiglitBaseTest):
@PiglitBaseTest.command.getter
def command(self):
- """ Add -auto and -fbo to the test command """
+ """ Add -auto, -fbo and -glsl (if needed) to the test command """
+
command = super(ShaderTest, self).command
shaderfile = os.path.join(ROOT_DIR, command[1])
- return [command[0]] + [shaderfile, '-auto', '-fbo']
+
+ if options.OPTIONS.force_glsl:
+ return [command[0]] + [shaderfile, '-auto', '-fbo', '-glsl']
+ else:
+ return [command[0]] + [shaderfile, '-auto', '-fbo']
@command.setter
def command(self, new):