Currently any leading whitespace in a line of the require section
results in that line being skipped. This is less than optimal because of
generated tests that may want to make their templates more readable at
the expense of having some odd indent in the produced shader.

This is required to get the new, faster templates later in this series
working.

Signed-off-by: Dylan Baker <[email protected]>
---
 tests/shaders/shader_runner.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 94c7826..5b1acb0 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -813,6 +813,11 @@ process_requirement(const char *line)
                return;
        }
 
+       /* Consume any leading whitespace before requirements. This is
+        * important for generated test files that may have odd whitespace
+        */
+       line = eat_whitespace(line);
+
        if (string_match("GL_", line)) {
                strcpy_to_space(buffer, line);
                piglit_require_extension(buffer);
-- 
2.8.3

_______________________________________________
Piglit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to