summaryrefslogtreecommitdiff
path: root/generated_tests/templates
AgeCommit message (Collapse)AuthorFilesLines
2017-02-02gen_conversion: generate tests for 64-bit integersNicolai Hähnle1-1/+1
This adds 264 execution tests (all in the same directory, so will run quite quickly with --process-isolation false) and 192 compiler tests. Acked-by: Dave Airlie <airlied@redhat.com> Acked-by: Dylan Baker <dylan@pnwbakers.com>
2017-02-02gen_conversion: refactor templates to allow multiple extensionsNicolai Hähnle3-8/+12
This will be needed for the interaction of GL_ARB_gpu_shader_fp64 with GL_ARB_gpu_shader_int64. Acked-by: Dave Airlie <airlied@redhat.com> Acked-by: Dylan Baker <dylan@pnwbakers.com>
2017-02-02Rename gen_conversion_fp64 to gen_conversionNicolai Hähnle19-0/+0
We will extend it with int64 types. Acked-by: Dave Airlie <airlied@redhat.com> Acked-by: Dylan Baker <dylan@pnwbakers.com>
2016-07-21generators/gen_vs_in_fp64: Different VBO values per vertexAndres Gomez2-35/+49
Before, in every drawing we were having the same VBO values per vertex to be compared against the values in the uniforms. Now, we also have different values per vertex so we can be sure that it is truly its own data. Signed-off-by: Andres Gomez <agomez@igalia.com> Acked-by: Juan A. Suarez <jasuarez@igalia.com> Acked-by: Dylan Baker <dylan@pnwbakers.com>
2016-07-02generators/gen_vs_in_fp64: Adds support to specify the GL type in the VBOAndres Gomez1-5/+6
Signed-off-by: Andres Gomez <agomez@igalia.com> Acked-by: Alejandro Piñeiro <apinheiro@igalia.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2016-07-02util: Add u/byte, u/short and half support to [vertex data]Andres Gomez2-5/+5
This allows to set data of u/byte, u/short and half types for attributes with the shader runner. For example: 0/byte/int attname1/ushort/uint attname3/half/float The syntax has been extended so the recommended way has replaced the old COUNT field in the [vertex data] header line with the corresponding GLSL type for the old TYPE field. In any case, the extended syntax is backward compatible so it is still possible to specify a vec3 attribute like: attname/float/3 In addition to the now recommended format: attname/float/vec3 Due to this, the arb_vertex_attrib_64bit input tests generator has been also adapted to the new syntax. Signed-off-by: Andres Gomez <agomez@igalia.com> Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2016-07-01arb_gpu_shader_fp64: emit GS output for every vertexAndres Gomez1-1/+1
Because EmitVertex() will invalidate all previous output writes, we need to set the value of the output variables for every vertex Signed-off-by: Andres Gomez <agomez@igalia.com> Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2016-06-14arb_gpu_shader_fp64: fix GS tests generatorSamuel Pitoiset1-1/+1
In order to emit a color for each vertex, we need to move fs_color inside the loop because EmitVertex() will invalidate all previous output writes, and there is an interpolated varying in the fragment shader. Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Andres Gomez <agomez@igalia.com>
2016-06-13generators/gen_vs_in_fp64: Use modules.typesDylan Baker2-58/+22
This removes a significant amount of string parsing from both the module and the templates, and simplifies some statements. The result is that the generator is roughly 50% faster. This string parsing comes from the rows and cols functions, which are present in both the generator and the templates. Each of these functions gets called roughly 40 million times. 40 million. The cols function in particular accounts for nearly 20 seconds of runtime (and the rows about 5). The replacements account for about 1 second of runtime each, in total. When you consider that the runtime is about 70 seconds before this patch, and about 35 after, that's another big win, probably enough that it's not worth optimizing it further (if that's even really possible). The remaining significant time sinks are the collections.deque (which is called from within mako and is part of the python stdlib, thus we can't optimize it) and the regular.shader_test.mako. While I can spot some micro optimizations that might get us a few tenths of a second here and there, I don't see anything that's going to win even a couple of seconds except for maybe writing the list file from within the generator. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Andres Gomez <agomez@igalia.com>
2016-06-09generators/gen_vs_in_fp64: reimplement require_execution templateDylan Baker8-258/+161
This cuts the runtime for this generator by 3/4 on my system. That's 4 minutes to 1 minute. That's pretty impressive, and for both my system and for our CI system this is a nice improvement. The generated files are the same, minus whitespace changes (diff -NaurBw notes no differences). While I think the new template is more readable than the original code, and it is definitely faster, it does introduce more code duplication that could be cleaned up in a follow on patch. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Andres Gomez <agomez@igalia.com>
2016-06-09generators/gen_vs_in_fp64: Rewrite the columns test generatorDylan Baker3-58/+137
This rewrites the columns generator to use a single template rather than the inherited template. The net result is that these tests are generated in 1/3 of the time. These are the minority tests from this generator. I measure that they take about .3 seconds to generate (with this patch). So while this is saving us a little bit of time, it's not going to make a big difference. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Andres Gomez <agomez@igalia.com>
2016-06-06arb_vertex_attrib_64bit: Adds double vertex input tests generator (v2)Andres Gomez9-0/+316
Generator which create test combinations of different vertex inputs types, including a double derived type. Note that this generator creates a big amount of test: ~6000. v2: - Include tests with interleaved u/int derived types. - Values are never repeated in a shader variable to avoid identical array members or columns in the same matrix (Alejandro). Also, removed one redundant test. Acked-by: Dave Airlie <airlied@redhat.com> Acked-by: Alejandro Piñeiro <apinheiro@igalia.com> Signed-off-by: Andres Gomez <agomez@igalia.com>
2016-05-20Make ARB_shader_precision tests ignore 0.0 vs -0.0.Kenneth Graunke3-6/+6
The multiplication precision tests were attempting to multiply 0.0 * -0.1 and expecting to get +0.0 (0x00000000), and failing if they received -0.0 (0x80000000). This seems fairly bogus. According to the ARB_shader_precision specification: "In general, correct signedness of 0 is not required." To avoid this problem, remove the sign bit from both the results and expected values when the value is equal to (+/-) 0.0. v2: Use xs.dtype.type(0.0) (suggested by Dylan Baker). Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Acked-by: Matt Turner <mattst88@gmail.com>
2016-05-11arb_gpu_shader_fp64: Adds conversion tests generatorAndres Gomez19-0/+313
Also, removed 5 redundant tests replaced by the generator. Reviewed-by: Antia Puentes <apuentes@igalia.com> Acked-by: Dylan Baker <baker.dylan.c@gmail.com> Signed-off-by: Andres Gomez <agomez@igalia.com>
2016-05-05python: Make mako template dirs robustDylan Baker1-4/+7
This puts the templates in a directory structure that makes them robust to both changes in python version and mako version. This fixes errors caused by downgrading mako, which isn't that common, unless you're running the unit tests with use the oldest supported mako, and may conflict with the compiled templates from the system mako. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-04-29gen_flat_interpolation_qualifier.py: Adds non-flat interpolation tests generatorAndres Gomez2-0/+148
Generator for error checking on "flat" keyword. This generator adds, additionally, checks for variables inside structs and interface blocks, which weren't explicitly mentioned in the GLSL specs and, partially, in the GLSL ES specs. For a discussion about this check https://lists.freedesktop.org/archives/mesa-dev/2016-March/109117.html and Khronos bug #15671. Also, removed 8 redundant tests replaced by the generator. Reviewed-by: Dylan Baker <baker.dylan.c@gmail.com> Acked-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Andres Gomez <agomez@igalia.com>
2016-04-29arb_gpu_shader_fp64: use generator to test in/out attributesJuan A. Suarez Romero3-0/+119
Vertex shader inputs and fragment shader outputs can only be single-precision values. From GL_ARB_gpu_shader_fp64 spec: "Modify Section 4.3.4, Inputs, p. 31 (modify third paragraph of the section, p. 31) ... Vertex shader inputs can only be single-precision floating-point scalars, vectors, or matrices, or signed and unsigned integers and integer vectors. Vertex shader inputs can also form arrays of these types, but not structures." "Modify Section 4.3.6, Outputs, p. 33 (modify third paragraph of the section, p. 33) They can only be float, double, single- or double-precision floating-point vectors or matrices, signed or unsigned integers or integer vectors, or arrays or structures of any these. (modify last paragraph, p. 33) ... Fragment outputs can only be float, single-precision floating-point vectors, signed or unsigned integers or integer vectors, or arrays of these. ..." Contributed by Andres Gomez. Acked-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Eduardo Lima Mitev <elima@igalia.com> Signed-off-by: Andres Gomez <agomez@igalia.com>
2016-04-14generators: port gen_variable_index_write to pythonDylan Baker3-0/+310
This ports the final bash generator from shell to python. Other than white space changes, the generated files are exactly the same as the previous shell files. This is currently not hooked up in Cmake. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-04-13generators: port vp-tex.sh to pythonDylan Baker4-0/+149
There are only whitespace differences between the python generator and the bash generator. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2016-04-13generators: Add a simple generator for enabled and disabled definesDylan Baker3-0/+120
This replaces a large number of handrolled tests (and adds many new ones) for testing that preprocessor defines are exposed correctly (either exposed if the extension is enabled, or not if it's disabled) across all shader stages. It tests for support in legacy (non core/compat) mode and in profile mode, unless the extension itself requires GLSL >= 140. It also covers all stages (fs, vs, gs, tcs, tes, and cs), and both GLES and GL. It drives all of this from a simple, easily extended list in the generator, and replaces over 1000 lines of code with about 300, including the template files, and generates over 1500 tests currently. These are GLSL parser tests and don't take more than a few seconds to run. The only known issue is that an extension can not currently be tested in both GLES and OpenGL. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-08-24arb_shader_precision: better calculate tolerances for complex functionsMicah Fedke3-75/+100
update mako templates to support vectors of tolerances Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-06-09gen_variable_index_read_tests: make params.col behave like rowDylan Baker1-4/+4
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>
2015-06-09gen_variable_index_read_tests: simplify color assignment with params.rowDylan Baker1-7/+1
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@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2015-06-09gen_variable_index_read_tests use bools instead of 0 and 1Dylan Baker3-11/+9
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2015-06-09generators: port variable-index-read.sh to pythonDylan Baker3-0/+300
This patch replaces a bash based generator with a python generator. This has the obvious advantage of remove a large swath of generated tests from the check-in, and prevents modification of a generated file. It also is much faster than the bash generator, so running at compile time isn't a problem. There are no functional differences between the bash generated versions and the python generated versions, only whitespace/line-wrapping differences, and small changes to the copyright header. All tests that passed with the bash versions pass with the python versions on the i965 driver with multiple hardware revisions. Tested with python2.7 and python3.3 v2: - rename generated test .list file (Emil) - Use a shared function to add the license text (also removes a typo in the text spotted by Emil) Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Acked-by: Jose Fonseca <jfonseca@vmware.com>
2015-03-13framework: Add python version to mako template dirsDylan Baker1-0/+2
Since these templates are at the very least not compatible betwen 3.x and 2.x, and possibly not backwards compatible from 3.x to 3.x-1 it makes better sense to actually maintain the version. This allows easy transition between python versions without blowing away the mako cache on every iteration. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2015-02-23gen_shader_bit_encoding_tests.py: python 2/3 hybridizeDylan Baker1-1/+2
This requires modifications to the mako template and to the generator Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23gen_builtin_packing_tests.py: python2/3 hybridizeDylan Baker4-12/+16
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23gen_shader_precision_tests.py: python2/3 hybridizeDylan Baker3-12/+21
This produces no changes in output. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23gen_texture_query_lod_tests.py: make pyhthon2/3 hybridDylan Baker1-1/+1
One of the things that changed between python2 and 3 is the way str.translate works. It's a complicated thing to convert, and just doing the obvious code seems better. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23generators: python2/3 hybridize gen_outerproduct_tests.pyDylan Baker1-7/+11
This uses six in both the mako templates and in the main python script to create a generator that runs under both python2.7 and python 3.2, and this produces no differences when run with python2 or python3. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23generated_tests: use future division in mako templatesDylan Baker1-0/+5
This provides consistency between the behavior of python2 and python3 There are no changes in the generated files before and after this change, it simply ensures that things work the same for both versions of python. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-01-19arb_shader_precision: Add positional argument specifiers.Vinson Lee3-6/+6
Fix build errors with Python < 2.7. Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2015-01-19arb_shader_precision: add tests for floating point precisionMicah Fedke3-0/+389
Note: A bunch of these currently don't pass on i965. Reviewed-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
2014-12-08generators: Add positional argument specifiers.Vinson Lee1-1/+1
Fix build errors with Python < 2.7. Signed-off-by: Vinson Lee <vlee@freedesktop.org>
2014-12-01gen_interpolation_tests.py: put template in templates dirDylan Baker1-0/+74
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2014-12-01gen_outerproduct_invalid_params.py: Put template in templates dirDylan Baker1-0/+10
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2014-12-01gen_non-lvalue_tests.py: refactor generatorDylan Baker2-0/+57
Removes use of class and puts templates in the templates directory. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2014-12-01interpolation-qualifier...: put templates in templates dirDylan Baker5-0/+185
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2014-12-01gen_uniform_initializer_tests templates: minor cleanups and refactorsDylan Baker8-52/+48
This patch changes some of the implementation details of the templates. These can be changes can be broken down into two types, using mako features: - converting from ${'{}.{}'.format(a, b)} to ${a}.${b} making the code more pythonic and less C-like Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2014-12-01gen_uniform_initializer_tests.py: Use templates folder for templatesDylan Baker8-0/+270
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2014-12-01gen_outerproduct_tests.py: Move template to templates dirDylan Baker1-0/+123
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2014-11-24gen_builtin_packing_tests templates: Use xrange instead of rangeDylan Baker4-12/+12
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> acked-by: Matt Turner <mattst88@gmail.com>
2014-11-24gen_builtin_packing_tests.py: put templates in templates directoryDylan Baker6-0/+394
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> acked-by: Matt Turner <mattst88@gmail.com>
2014-11-24gen_const_builtin_equal_tests.py: put template in templates dirDylan Baker1-0/+20
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> acked-by: Matt Turner <mattst88@gmail.com>
2014-11-24gen_texture_query_lod_tests.py: Split template into templates folderDylan Baker1-0/+33
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> acked-by: Matt Turner <mattst88@gmail.com>
2014-11-24gen_texture_lod_tests.py: Split templatesDylan Baker3-0/+53
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> acked-by: Matt Turner <mattst88@gmail.com>
2014-11-24gen_shader_bit_encoding_tests.py: split template into separate fileDylan Baker1-0/+87
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> acked-by: Matt Turner <mattst88@gmail.com>
2014-11-24test generators: add templates folderDylan Baker1-0/+81
Also adds a couple of helper functions to the templates __init__.py Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> acked-by: Matt Turner <mattst88@gmail.com>