[50/63] framework: add --spirv option

Submitted by apinheiro on Feb. 23, 2019, 11:45 p.m.

Details

Message ID 20190223234551.21111-51-apinheiro@igalia.com
State New
Headers show
Series "ARB_gl_spirv full series" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

apinheiro Feb. 23, 2019, 11:45 p.m.
So when executing shader tests, they will be executed with -spirv.

So for example:
./piglit run tests/shader.py -t ARB_explicit_uniform_location --spirv results/explicit_uniform_location-spirv

Will run all the shader tests for that extension using -spirv.
---
 framework/options.py          | 1 +
 framework/programs/run.py     | 7 +++++++
 framework/test/shader_test.py | 2 ++
 3 files changed, 10 insertions(+)

Patch hide | download patch | download mbox

diff --git a/framework/options.py b/framework/options.py
index 0abe1f63d..fa5de34be 100644
--- a/framework/options.py
+++ b/framework/options.py
@@ -61,6 +61,7 @@  class _Options(object):  # pylint: disable=too-many-instance-attributes
         self.process_isolation = True
         self.jobs = None
         self.force_glsl = False
+        self.spirv = 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 d0a3fcfe9..b3e04ccf8 100644
--- a/framework/programs/run.py
+++ b/framework/programs/run.py
@@ -239,10 +239,15 @@  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")
 
+    parser.add_argument("--spirv",
+                        action="store_true",
+                        help="Run shader runner tests with the -spirv (try SPIR-V) option")
+
     return parser.parse_args(unparsed)
 
 
@@ -322,6 +327,7 @@  def run(input_):
     options.OPTIONS.process_isolation = args.process_isolation
     options.OPTIONS.jobs = args.jobs
     options.OPTIONS.force_glsl = args.glsl
+    options.OPTIONS.spirv = args.spirv
 
     # Set the platform to pass to waffle
     options.OPTIONS.env['PIGLIT_PLATFORM'] = args.platform
@@ -437,6 +443,7 @@  def resume(input_):
     options.OPTIONS.jobs = args.jobs
     options.OPTIONS.no_retry = args.no_retry
     options.OPTIONS.force_glsl = results.options['force_glsl']
+    options.OPTIONS.spirv = results.options['spirv']
 
     core.get_config(args.config_file)
 
diff --git a/framework/test/shader_test.py b/framework/test/shader_test.py
index 3f6f7bb0f..63d840d0f 100644
--- a/framework/test/shader_test.py
+++ b/framework/test/shader_test.py
@@ -193,6 +193,8 @@  class ShaderTest(FastSkipMixin, PiglitBaseTest):
 
         if options.OPTIONS.force_glsl:
             return [command[0]] + [shaderfile, '-auto', '-fbo', '-glsl']
+        elif options.OPTIONS.spirv:
+            return [command[0]] + [shaderfile, '-auto', '-fbo', '-spirv']
         else:
             return [command[0]] + [shaderfile, '-auto', '-fbo']