[63/63] shader_runner/spirv: skip compat profile tests on SPIR-V mode

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

Details

Message ID 20190223234551.21111-64-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.
From ARB_gl_spirv spec:

  "Changes to Chapter 3 of the OpenGL Shading Language 4.50 Specification
   (Basics)

    After describing the compatibility profile rules, add:

       "Compatibility-profile features are not available when
        generating SPIR-V.""

With this commit, tests that require a compatibility profile are
skipped if trying to be run on SPIR-V mode. This includes if we
specify force spirv on the command line or if the test includes a
SPIRV YES. The latter can happen as the GLSL from those tests can be
compatible, so glslang (or any other GLSL->SPIR-V backend) could be
able to generate the SPIRV.
---
 tests/shaders/shader_runner.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 92861c5fc..faf78b2d2 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -2033,7 +2033,8 @@  struct requirement_parse_results {
 
 static void
 parse_required_config(struct requirement_parse_results *results,
-		      const char *script_name)
+		      const char *script_name,
+		      bool force_spirv)
 {
 	unsigned text_size;
 	char *text = piglit_load_text_file(script_name, &text_size);
@@ -2077,6 +2078,11 @@  parse_required_config(struct requirement_parse_results *results,
 					results->found_glsl = true;
 					version_copy(&results->glsl_version, &version);
 				}
+
+				if (version.compat && force_spirv) {
+					printf("ARB_gl_spirv is not compatible with compatibility profile\n");
+					piglit_report_result(PIGLIT_SKIP);
+				}
 			} else if (parse_str(line, "GL", &line)) {
 				enum comparison cmp;
 				struct component_version version;
@@ -2089,6 +2095,10 @@  parse_required_config(struct requirement_parse_results *results,
 					results->found_gl = true;
 					version_copy(&results->gl_version, &version);
 				}
+				if (version.compat && force_spirv) {
+					printf("ARB_gl_spirv is not compatible with compatibility profile\n");
+					piglit_report_result(PIGLIT_SKIP);
+				}
 			} else if (parse_str(line, "SIZE", &line)) {
 				results->found_size = true;
 				parse_uints(line, results->size, 2, NULL);
@@ -2165,7 +2175,7 @@  get_required_config(const char *script_name, bool force_spirv,
 	struct requirement_parse_results parse_results;
 	struct component_version required_gl_version;
 
-	parse_required_config(&parse_results, script_name);
+	parse_required_config(&parse_results, script_name, force_spirv);
 	choose_required_gl_version(&parse_results, &required_gl_version);
 
 	if (force_spirv || parse_results.found_spirv) {