[Piglit] [PATCH 4/6] gen_variable_index_read_tests: simplify color assignment with params.row

Dylan Baker baker.dylan.c at gmail.com
Fri May 29 12:37:37 PDT 2015


This makes the port a little less naive than it was before, and allows
us to remove logic from the template, by using logic in the params
instance.

Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
 .../templates/gen_variable_index_read_tests/helpers.mako          | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/generated_tests/templates/gen_variable_index_read_tests/helpers.mako b/generated_tests/templates/gen_variable_index_read_tests/helpers.mako
index dcbcb92..d75d936 100644
--- a/generated_tests/templates/gen_variable_index_read_tests/helpers.mako
+++ b/generated_tests/templates/gen_variable_index_read_tests/helpers.mako
@@ -141,13 +141,7 @@ void main()
        *     written."
        */
     % endif
-    ## TODO: Could probably simplify this with the use of params.row
-    % if params.expect_type == 'float':
-      color = (m${params.idx}[${params.col}][row] == expect) \
-    % else:
-      color = (m${params.idx}[${params.col}] == expect) \
-    % endif
-    ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
+    color = (m${params.idx}[${params.col}]${params.row} == expect) ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
   % endif
 }
 </%def>
-- 
2.4.2



More information about the Piglit mailing list