gen_uniform_initializer_tests.py: optimize and cleanup further

This patch makes this generator use more python features:
- the with statement for open()
- enumerate
- str.format()
- lots of generators and generator statements
- remove unused function
- move assignments out of loops that don't need to be in the loop

This creates a cleaner, simpler generator that runs faster.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
interpolation_qualifier...: use with statement and print_function

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
interpolation-qualifier...: put templates in templates dir

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
interpolation-qualifier...: use if __name__ == '__main__' pattern

By pulling all of the loops into a single function we also get the
advantage of combining some code.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
interpolation_qualifier...: combine loops:

This uses a single loop (generated by itertools.product), and individual
generators functions to produce tests. The obvious advantage is that we
loop over the same data a fewer number of times, the other advantage is
a clearer division of code splitting a function with several hunderd
lines of code into multiple functions.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
interpolation-qualifier...: cleanup style problems

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
gen_shader_bit_encoding_tests.py: split template into separate file

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
gen_shader_bit_encoding: cleanup some style issues

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
gen_shader_bit_encoding_tests.py: use builtin operators

python provides operators to do most of what was being done with rolled
operators, so lets use them

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
gen_shader_bit_encoding_tests.py: Use with and print_function

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
gen_shader_bit_encoding_tests.py: minor refactors

Makes two changes:
- Use a namedtuple instead of a dictionary to represent functions (the
  sub elements of the funcs dict). This reduces the number of variables
  passed into the mako template
- convert funcs into a set of tuples. Since the dictionary is never
  actually used as a dictionary (ie, to select a key's associated
  value), it is faster to use tuples.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
gen_shader_bit_encoding_tests.py: simplify extension handling

The original code was designed to handle the requirements of multiple
extensions. However, the generator never uses multiple extensions, so
this adds a lot of needless complexity. This patch simplifies the
generator to simply check if an extension is required or not

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
gen_shader_bit_encoding_tests.py: change modifier_funcs to a set of tuples

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
gen_shader_bit_encoding_tests.py: cleanup remaining style issues

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
gen_non-lvalue_tests.py: refactor generator

Removes use of class and puts templates in the templates directory.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
gen_texture_lod_tests.py: Split templates

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
gen_texture_query_lod_tests.py: cleanup style problems

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
gen_texture_query_lod_tests.py: use with and print_function

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
gen_texture_query_lod_tests.py: Use if __name__ == __main__ pattern

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
gen_texture_query_lod_tests.py: move file generation up in loop

This moves the directory name generation and existence checking/creation
out of two loops, and allowing for more reuse.

Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>