[Piglit] [PATCH] shader_runner: skip GLSL version check when running SPIR-V shaders

Alejandro Piñeiro apinheiro at igalia.com
Sat Feb 2 11:19:06 UTC 2019

Because after all, you are not running GLSL shaders in that
case. SPIR-V requirements are OpenGL version >= 3.30 and having
ARB_gl_spirv available.

About why this is needed: most SPIR-V tests include the GLSL used to
generate the SPIR-V, so the SPIR-V could be regenerated easily if we
test needs any fix, and also to run the test on GLSL mode, that was
found to be useful for debug. For the latter, it is needed to keep the
GLSL version required, that is usually 4.50 (ARB_gl_spirv is written
against GLSL 4.50, without requiring it, so it is easier to just use
4.50 GLSL shaders).

Without this change, on systems with OpenGL 3.30, the SPIR-V shader
will not run for not fullfilling the GLSL version required.
 tests/shaders/shader_runner.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 6df8bd860..285f83944 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -1130,7 +1130,7 @@ process_requirement(const char *line)
 		   parse_word_copy(line, buffer, sizeof(buffer), &line)) {
 		if (piglit_is_extension_supported(buffer))
 			return PIGLIT_SKIP;
-	} else if (parse_str(line, "GLSL", &line)) {
+	} else if (parse_str(line, "GLSL", &line) && !spirv_replaces_glsl) {
 		enum comparison cmp;
 		parse_version_comparison(line, &cmp, &glsl_req_version,

More information about the Piglit mailing list