summaryrefslogtreecommitdiff
path: root/generated_tests
AgeCommit message (Collapse)AuthorFilesLines
2015-10-09tox: Add a test module for testing the generators.Dylan Baker1-0/+142
This test module provides a function that enumerates the test generators (it assumes that all files ending in .py are generators unless they're black listed), and generates a nose job for each of them. This allows us to ensure that the generators work in an automated fashion, and with a simple patch will allow us to test them with various versions of python (2.7 and 3.3+), which we claim to support with the generators. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2015-10-04cl: add popcount builtinSerge Martin1-4/+14
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
2015-09-16arb_shader_image_load_store/compiler: Add memoryBarrier() testsSamuel Iglesias Gonsalvez1-0/+8
Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2015-08-24arb_shader_precision: better calculate tolerances for complex functionsMicah Fedke4-102/+218
update mako templates to support vectors of tolerances Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-08-24arb_shader_precision: support scalar values in shader_runner_formatMicah Fedke1-14/+16
Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-08-20arb_shader_image_load_store/compiler/builtin-constants: Don't check ↵Francisco Jerez1-2/+0
tesselation constants. These are defined by the ARB_shader_image_load_store extension, but according to the section where the interactions with ARB_tessellation_shader are described: "If OpenGL 4.0 and ARB_tessellation_shader are not supported, references to tessellation control and evaluation shaders should be removed." What AFAICT implies that we cannot rely on them being defined based on the ARB_shader_image_load_store extension alone. Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2015-08-20shader_runner: Pass the desired image format explicitly to "image texture".Francisco Jerez1-1/+1
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2015-07-29gen_builtin_uniform_tests.py: Add tessellation control shader tests.Fabian Bieler1-4/+133
v2: fixed by Marek Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-29arb_tessellation_shader: Simplify tcs-input tests.Chris Forbes1-6/+5
The purpose of these tests is not to exercise the compiler's optimization of writes from the TCS -- we'll explore that in other tests. Reviewed-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
2015-07-27generated_tests: Test tessellation control shader input.Chris Forbes2-0/+305
for every GLSL variable type, generate two tests. One passes a varying of said type as a scalar from the vertex to the tessellation control shader and one that passes a two-element array. Fill the varying in the vertex shader from a uniform and compare it against the uniform in the tessellation control shader. Draw 4 patches, tessellate each into a quad that fills a quarter of the screen. Also test core profile built-in varyings.
2015-07-27generated_tests: Test tessellation evaluation shader input.Fabian Bieler2-0/+334
For every GLSL variable type, generate four tests. One passes a per-vertex and one a per-patch varying of said type as a scalar from the tessellation control to the tessellation evaluation shader. The two other tests do the same for a two-element array of that type. The varying gets filled in the tessellation control shader from a uniform and compared against the same uniform in the tessellation evaluation shader. Every test draws 4 patches, each of which gets tessellated into a quad that fills a quarter of the screen. Also test core profile built-in varyings in gl_PerVertex.
2015-07-14arb_compute_shader: Use GL_RGBA8 for image_load_store internal formatJordan Justen1-1/+1
The motivation for this is that (as noted by curro) ARB_shader_image_load_store doesn't support images with an internal format of GL_RGBA. See 'Table X.2' in https://www.opengl.org/registry/specs/ARB/shader_image_load_store.txt Therefore, in order to use image load/store in shader runner tests, we must override the default internal format when creating the image. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2015-06-09gen_variable_index_read_tests: make params.col behave like rowDylan Baker2-6/+10
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.py: reduce duplication with loopDylan Baker1-89/+39
This reduces the number of calls to make_{fs,vs} by using more loops. This means less code and makes some things easier to read and understand. 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 Baker6-1/+591
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-04-29cl: Add fmin, fmax testsJan Vesely1-0/+20
Pass on Intel CPU, and Turks GPU Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2015-04-20cl: Add tests for common builtin functionsJan Vesely3-21/+158
Move sign and mix out of math All tests pass on Turks All tests except step pass on Intel CPU, it fails in NaN cases. v2: Remove min/max NaN tests. OpenCL 1.1 changed the wording, making the results undefined Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2015-04-20cl: Fix generating tts testsJan Vesely1-9/+7
That's just 'mix' at this moment Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2015-04-10gen_builtin_uniform_tests.py: Draw small rectangles per test, and probe them.Eric Anholt1-13/+55
Before, we were drawing the whole window every time, while we only probed a single pixel. Instead, draw 4x4 rectangles across the window, and probe the whole rectangle. 4x4 is chosen to at least get several subspans rendering at the same time, in case drivers have bugs in that area. For what the effect looks like on generated shader_test code, before we had generated tests that looked like: [...] draw rect -1 -1 2 2 probe rgb 2 0 0.0 1.0 0.0 1.0 [...] draw rect -1 -1 2 2 probe rgb 3 0 0.0 1.0 0.0 1.0 and now we have: [...] draw rect ortho 8 0 4 4 [...] draw rect ortho 12 0 4 4 probe rect rgba (8, 0, 4, 4) (0.0, 1.0, 0.0, 1.0) probe rect rgba (12, 0, 4, 4) (1.0, 1.0, 1.0, 1.0) Piglit (-t glsl-1.10/execution/built-in-functions/fs-op) runtime effects: i965: -2.84009% +/- 2.67378% (n=26) simulated VC4: -99.082% +/- 0.61943% (n=4). (yes, from 15 minutes to 9 seconds) v2: Use probe rect instead of probe all rgba for the all-the-same-color case, to avoid spurious failures on windows. v3: Rebase on CS changes (avoids any generated code difference on CS). Drop the rest of the read-all-the-screen bits, since I dropped the window sizing patch to these tests due to issues with Linux window managers clamping size (not just Windows!). v4: Reword comment about default window size (Review feedback by Ken). Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v2) Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2015-04-10gen_builtin_uniform_tests.py: Refactor how we generate draws/probes.Eric Anholt1-24/+39
I'm going to change our drawing code a bunch, and this structures things to make the functional changes more obvious. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2015-04-10gen_builtin_uniform_tests.py: Take advantage of draw_rect support for core ↵Eric Anholt1-27/+7
contexts. Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2015-04-08cl: Fix tolerance requirements to match the specsJan Vesely1-12/+12
Whitespace errors for atanpi Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2015-04-07generator: clear before rendering with the builtin testsDave Airlie2-0/+4
Otherwise there is a chance you'll get the contents from the last test which are green, and if this test fails to renderer you'll pass. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
2015-03-30cl: Enable required extension before using double typeJan Vesely2-4/+4
Fixes failures on OCL-1.1 implementations that provide cl_khr_fp64 Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2015-03-26cl: add atan2pi testJan Vesely1-0/+11
copied from atan2 tested on clover and intel ocl-sdk Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2015-03-26cl: add asinpi testJan Vesely1-0/+10
copied from asin tested on clover and intel ocl Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
2015-03-26cl: add acospi testJan Vesely1-0/+10
copied from acos. tested on clover and intel ocl Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Tom Stellard <thomas.stellard@amd.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-24Revert "cl tests: move non-generated tests out of the generated tests dir"Dylan Baker2-0/+35
This reverts commit ff8898df3c78324b2d8945c855a9d2e0034f5525. This broke cl tests, and it's a very trivial self contained patch, so we'll just revert it. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> reported-by: Michel Dänzer <michel@daenzer.net>
2015-02-23generators: use __future__ absolute_importDylan Baker24-24/+24
Again, this doesn't change the output of any of the generators, but it helps to eliminate surprising behavior when switching from python2 to python3 v2: - add this patch Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2015-02-23generated tests: Use __future__ divisionDylan Baker23-23/+23
This coverts all of the generators to use python3 style division. None of these generators are currently affected by this change (generally the author of the generator has taken pains to ensure that python2 division does the right thing by explicitly converting between int and float), but it should reduce surprise to future modifiers, which is good. v2: - add this patch Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2015-02-23generated tests: add print function to remaining generatorsDylan Baker8-1/+8
These tests either already used parans around print (even though it wasn't necessary), or don't include print statements. I think it's worth while to have this because it helps to remove surprise for people modifying the generators, then they don't have to dig in and understand how python2 and python3's division is different. v2: - add this patch Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
2015-02-23gen_cl_store_tests.py: hybridize for python 2/3Dylan Baker1-1/+4
Uses six.moves.range Generates the same results before and after. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23genclbuiltins.py: hybridize for python3Dylan Baker1-3/+7
This allows gen_cl_int_builtins, gen_cl_math_builtins, and gen_cl_relational_tests to generate tests with python3 and python2, and to produce the same output Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23gen_cl_int_builtins.py: use __future__ divisionDylan Baker1-1/+2
in python2 without future division the division operator is retarded: 1/2 = 0 1/2.0 = 0.5 In python3 or python2 with future division there are two division operators: / and //, and they behave sanely: 1/2 = 0.5 1//2 = 0 1/2.0 = 0.5 1//2.0 = 0.0 This is obviously necessary for porting to python3 to get the same behavior between the python2 and the python3 generators. This generator produces teh same result before and after this change. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23genclbuiltins.py: remove tabsDylan Baker1-2/+2
mixing tabs and spaces are not allowed in python3, piglit uses spaces only, no tabs Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23cl tests: move non-generated tests out of the generated tests dirDylan Baker2-35/+0
It really doesn't make sense to have static tests in the generated tests directory, this patch adds them to the tests directory and adds the appropriate code to cl.py for this change Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23gen_cl_int_builtins.py: Replace use of Long typeDylan Baker1-1/+1
Python3 doesn't have long types (ints will now grow until you run out of memory). Use bit shifting instead. This produces the same output before and after Thanks to Jason Ekstrand for help with this. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23generators: use if __name__ == __main__ pattern in cl generatorsDylan Baker4-40/+49
This means that they only generate tests if they are called as the main script, but not if they are imported as modules. This is important for testing purposes. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23generators: rename cl generators so they can be importedDylan Baker5-4/+4
Doing any sort of testing of these generators is impossible (even just opening the interpreter and importing them) because they use dashes in their names, and python doesn't allow modules to have dashes in their names. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23gen_shader_bit_encoding_tests.py: python 2/3 hybridizeDylan Baker2-5/+8
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 Baker5-13/+17
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23gen_builtin_uniform_tests.py: python2/3 hybridizeDylan Baker1-6/+7
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23gen_builtin_uniform_tests_fp64: hybridize python2/3Dylan Baker1-9/+10
This requires removing some tabs. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23gen_interpolation_tests.py: hybridize python 2/3Dylan Baker1-3/+5
The python3 version has slightly better precision than the python2 version. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23gen_constant_array_size_tests_fp64.py: python2/3 hybridizeDylan Baker1-3/+5
This requires fixing range and removing tabs, because mixed tabs spaces raises a runtime error in python3 Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23gen_constant_array_size_tests.py: python2/3 hybridizeDylan Baker1-2/+4
This produces a bit more precision in python3 than in python2 Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2015-02-23gen_uniform_initializer_tests.py: hybridize for python2 and python3Dylan Baker1-10/+12
The python3 version has a very slight increase in precision. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>