summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <baker.dylan.c@gmail.com>2015-05-27 13:22:06 -0700
committerDylan Baker <baker.dylan.c@gmail.com>2015-06-09 15:09:05 -0700
commit5121b26ba39dc3747fd7a9a680b51edb627f801c (patch)
treef41567a97cd7ea3968c34ed951e7c236c4e0c65f
parentc814d800f1530f898e8474f330c0ec709be07769 (diff)
gen_variable_index_read_tests: make params.col behave like row
params.row and params.idx automatically add [] around the value for lookups. col is unique in that it doesn't. This patch changes the behavior to be more like the other parameters. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
-rw-r--r--generated_tests/gen_variable_index_read_tests.py8
-rw-r--r--generated_tests/templates/gen_variable_index_read_tests/helpers.mako8
2 files changed, 10 insertions, 6 deletions
diff --git a/generated_tests/gen_variable_index_read_tests.py b/generated_tests/gen_variable_index_read_tests.py
index 1f600d1c0..cc6f49bdb 100644
--- a/generated_tests/gen_variable_index_read_tests.py
+++ b/generated_tests/gen_variable_index_read_tests.py
@@ -49,7 +49,7 @@ class TestParams(object):
self.array_dim = array_dim
self.mode = mode
self.index_value = index_value
- self.col = col
+ self.__col = col
self.expect_type = expect_type
assert glsl_version in [110, 120]
@@ -97,6 +97,10 @@ class TestParams(object):
return ''
@lazy_property
+ def col(self):
+ return '[{}]'.format(self.__col)
+
+ @lazy_property
def test_sizes(self):
if self.array_dim == 0:
return [1]
@@ -107,7 +111,7 @@ class TestParams(object):
@lazy_property
def test_columns(self):
- if self.col == 'col':
+ if self.col == '[col]':
return list(range(1, 1 + self.matrix_dim))
else:
return [2]
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 d75d9367f..155eb8c4e 100644
--- a/generated_tests/templates/gen_variable_index_read_tests/helpers.mako
+++ b/generated_tests/templates/gen_variable_index_read_tests/helpers.mako
@@ -97,7 +97,7 @@ ${base_type}(${matrix_data(c * matrix_dim**2 + 1, matrix_dim)})\
uniform int index;
% endif
- % if params.col == 'col':
+ % if params.col == '[col]':
uniform int col;
% endif
@@ -141,7 +141,7 @@ void main()
* written."
*/
% endif
- 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);
+ 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>
@@ -164,7 +164,7 @@ void main()
% if params.mode == 'temp':
${emit_set_matrix(params)}
% endif
- gl_FragColor = (m${params.idx}[${params.col}]${params.row} == expect) \
+ gl_FragColor = (m${params.idx}${params.col}${params.row} == expect) \
% if not do_compare:
? color : vec4(1.0, 0.0, 0.0, 1.0);
% else:
@@ -201,7 +201,7 @@ void main()
<% x_base = ((size - 1) * (15 * params.matrix_dim + 10)) %>
% for column in params.test_columns:
<%block filter="newlines">
- % if params.col == 'col':
+ % if params.col == '[col]':
uniform int col ${column - 1}
% endif
</%block>