From: Nicolai Hähnle <[email protected]>
Currently only 'd' for double, but will be extended for 64-bit integer
types.
---
generated_tests/gen_conversion.py | 21 +++++++++++++--------
1 file changed, 13 insertions(+), 8 deletions(-)
diff --git a/generated_tests/gen_conversion.py
b/generated_tests/gen_conversion.py
index fca3b17..456998b 100644
--- a/generated_tests/gen_conversion.py
+++ b/generated_tests/gen_conversion.py
@@ -258,29 +258,30 @@ class TestTuple(object):
"""Returns the inverted float32 hexadecimal representation from a
float64 hexadecimal representation.
"""
assert isinstance(hstr, str)
temp = np.divide(1.0, TestTuple.hex_to_double(hstr))
float_double = np.float32(temp)
return TestTuple.float_to_hex(float_double)
def __init__(self, ver, stage,
first_dimension, second_dimension,
- basic_type, names_only):
+ basic_type, target_type, names_only):
assert stage in ('vert', 'geom', 'frag')
assert first_dimension in ('1', '2', '3', '4')
assert second_dimension in ('1', '2', '3', '4')
assert isinstance(names_only, bool)
self._ver = ver
self._stage = stage
self._basic_type = basic_type
+ self._target_type = target_type
self._names_only = names_only
self._double_type = ''
self._conversion_type = ''
self._uniform_type = ''
self._amount = int(first_dimension) * int(second_dimension)
self._filenames = []
if first_dimension != '1':
dimensional_type = 'mat' + first_dimension
if first_dimension != second_dimension:
@@ -343,47 +344,51 @@ class RegularTestTuple(TestTuple):
"""
@staticmethod
def all_tests(names_only):
"""Returns all the possible contained conversion test instances."""
assert isinstance(names_only, bool)
stages = ['vert', 'geom', 'frag']
dimensions = ['1', '2', '3', '4']
basic_types = ['b', 'u', 'i', 'f']
+ target_types = ['d']
glsl_ver = ['GL_ARB_gpu_shader_fp64', '400']
if not names_only:
test_types = ['compiler', 'execution']
for ver, test_type in itertools.product(glsl_ver, test_types):
utils.safe_makedirs(get_dir_name(ver, test_type))
- for ver, stage, first_dimension, second_dimension, basic_type in
itertools.product(
+ for ver, stage, first_dimension, second_dimension, basic_type,
target_type in itertools.product(
glsl_ver,
stages,
dimensions,
dimensions,
- basic_types):
- if not (first_dimension != '1' and (second_dimension == '1' or
basic_type != 'f')):
+ basic_types,
+ target_types):
+ if (not (first_dimension != '1' and (second_dimension == '1' or
basic_type != 'f')) and