This series upgrades the ARB_shader_precision test generator with support for complex function tolerances.

The ARB_shader_precision spec does not give specific guidance in regard to acceptable error ranges for complex functions, supplying only the murky "Built-in functions defined in the specification with an equation built from the above operations inherit the above errors." Currently, the shader_precision tests allow zero tolerance for complex functions, but this is causing many false negatives and needs to be improved.

This series is my best attempt at due diligence - any discussion/input is certainly welcomed :)

The theory behind this is probably worth a blog post and I won't belabor the point here, but this series basically implements a filter for the test_suite dict that will drop any test vectors that would push a function's output into regions of greatly multiplied error - the "badlands". If the output does not trespass on the badlands, then the error estimate in ulps is calculated and attached to the current test vector for the shader_test to use as the allowable error range when analyzing the output generated on the GPU during test run-time.

The bigfloat package is a necessary dependency for this filter, as it provides both arbitrary-size floating point operations and it allows all floating point values and operations in a code block to be forced into a particular precision, leaving no question as to what precision was employed for an intermediate calculation. This comes in handy when running the reference versions of the complex built-ins. Performance impact is small (~6s for the entire gen_shader_precision_tests.py script on IvyBridge i7 @ 2.9GHz) and is localized to build-time.

The technique described above actually takes very little python code to construct - most of the complexity is in dealing with the polymorphic nature of the GLSL built-ins - componentwise vs. non-componentwise parameters, etc.


Micah Fedke (4):
arb_shader_precision: support scalar values in shader_runner_format
arb_shader_precision: add framework for calculating tolerances for complex functions
arb_shader_precision: add reference implementations of complex functions
arb_shader_precision: enable calculation of complex function tolerances - update mako templates to support vectors of tolerances

generated_tests/gen_shader_precision_tests.py | 376 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------- generated_tests/templates/gen_shader_precision_tests/fs.mako | 51 +++++++++++------ generated_tests/templates/gen_shader_precision_tests/gs.mako | 51 +++++++++++------ generated_tests/templates/gen_shader_precision_tests/vs.mako | 51 +++++++++++------
 4 files changed, 451 insertions(+), 78 deletions(-)

--

Micah Fedke
Collabora Ltd.
+44 1223 362967
https://www.collabora.com/
https://twitter.com/collaboraltd
_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to