1. 22 May, 2018 1 commit
  2. 02 Jul, 2016 1 commit
  3. 17 Apr, 2016 1 commit
  4. 16 Nov, 2015 1 commit
  5. 20 Aug, 2015 1 commit
  6. 29 Jul, 2015 1 commit
  7. 14 Jul, 2015 1 commit
  8. 10 Apr, 2015 3 commits
    • Eric Anholt's avatar
      gen_builtin_uniform_tests.py: Draw small rectangles per test, and probe them. · 2d4b9b84
      Eric Anholt authored
      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's avatarKenneth Graunke <kenneth@whitecape.org>
    • Eric Anholt's avatar
      gen_builtin_uniform_tests.py: Refactor how we generate draws/probes. · 4868ae91
      Eric Anholt authored
      I'm going to change our drawing code a bunch, and this structures
      things to make the functional changes more obvious.
      Reviewed-by: default avatarIan Romanick <ian.d.romanick@intel.com>
    • Eric Anholt's avatar
  9. 07 Apr, 2015 1 commit
  10. 23 Feb, 2015 5 commits
  11. 19 Dec, 2014 1 commit
  12. 13 Dec, 2014 1 commit
    • Dylan Baker's avatar
      generated_tests: Except error for os.makedirs · b59ff71e
      Dylan Baker authored
      Currently we check for the existence of a directory, and if it doesn't
      exist we create it. This would be fine, except that multiple generators
      can create the same directory trees. When os.makedirs tries to create a
      tree that already exists it raises and OSError exception, with the errno
      set to 17 (the File Exists Error). Since between the time that a check
      is made and the time the os.makedirs completes a second generator can
      create the directory tree we can have exceptions raised sporadically,
      especially as the number of threads being used to generate goes up.
      We maintain the check for existence before trying to create the
      directories because os.makedirs is slow, so not even trying is better
      than trying in vain.
      Signed-off-by: default avatarDylan Baker <dylanx.c.baker@intel.com>
  13. 22 Sep, 2014 3 commits
  14. 22 May, 2014 1 commit
  15. 29 Jan, 2014 1 commit
  16. 01 Aug, 2013 1 commit
  17. 29 Jul, 2013 1 commit
  18. 27 Feb, 2013 1 commit
    • Paul Berry's avatar
      generated_tests: Fix geometry shader tests to use gl_VerticesIn · ee8e683c
      Paul Berry authored
      Commit ff315ae8 (Add geometry testing to code-generated tests)
      erroneously omitted the parentheses when calling
      glPositionIn.length().  It also failed to account for the fact that
      the .length() method is unavailable in GLSL 1.10.
      This patch modifies the code to use gl_VerticesIn instead, since this
      is provided by ARB_geometry_shader4, and hence is available regardless
      of the GLSL version being tested.
      Thanks to Ken Phillis Jr for discovering this bug.
      Cc: Ken Phillis Jr <kphillisjr@gmail.com>
  19. 15 Feb, 2013 2 commits
    • Stuart Abercrombie's avatar
      shader_runner: remove explicit #version directive from generated_tests. · 00ae3c59
      Stuart Abercrombie authored
      It is instead inserted by shader_runner based on the GLSL requirement.
      Tested with all.tests - glean: same number of passes.
      Signed-off-by: default avatarStuart Abercrombie <sabercrombie@chromium.org>
      Reviewed-by: Paul Berry's avatarPaul Berry <stereotype441@gmail.com>
    • Paul Berry's avatar
      Add geometry testing to code-generated tests. · ff315ae8
      Paul Berry authored
      This patch adds geometry shader variants to the code-generated
      built-in function tests produced by gen_builtin_uniform_tests.py and
      Note that there are two ways in which an implementation may expose
      geometry shader support: via GLSL 1.50 or via ARB_geometry_shader4.
      After some discussion on IRC, I've provisionally decided to write most
      of the geometry shader tests using ARB_geometry_shader4, and then only
      supply GLSL-1.50-based tests for basic santy testing and to cover the
      cases where GLSL 1.50 and ARB_geometry_shader4 differ.
      Rationale: (a) Mesa is likely to implement ARB_geometry_shader4
      support before GLSL 1.50 support (since Bryan Cain already has some
      work-in-progress geometry shader patches that use
      ARB_geometry_shader4).  (b) there are likely to be some
      implementations that support geometry shaders but not GLSL 1.50
      (e.g. Mesa softpipe, or i965 Gen5); writing most of the tests for
      ARB_geometry_shader4 ensures that those implementations are
      Accordingly, these code-generated tests are written entirely using
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
  20. 01 Feb, 2013 1 commit
  21. 31 May, 2012 1 commit
  22. 22 May, 2012 2 commits
  23. 01 May, 2012 1 commit
  24. 18 Aug, 2011 3 commits
    • Paul Berry's avatar
      generated tests: Add uint and int tests for GLSL 1.30. · 5619ab33
      Paul Berry authored
      GLSL 1.30 allows int and ivecN types to be passed to the functions
      abs, sign, min, max, and clamp.  In addition, it adds new unsigned
      integer types uint and uvecN, which may be passed to min, max, clamp,
      lessThan, lessThanEqual, greaterThan, greaterThanEqual, equal,
      notEqual, and built-in operators.
      This patch adds auto-generated tests for all of these new integral
      built-in functions and operations.
      Reviewed-by: chadversary's avatarChad Versace <chad@chad-versace.us>
    • Paul Berry's avatar
      generated tests: Add builtin tests using if. · 2b045763
      Paul Berry authored
      For builtin functions and operators returning bool, added generated
      tests that use the return values in if statements like this:
      if (a < b)
        gl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);
        gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0);
      in addition to the existing tests that convert the return values to
      floats, like this:
      bool result = a < b;
      gl_FragColor = vec4(result, 0.0, 0.0, 0.0);
      Since implementations may produce substantially different GPU code for
      these two cases.
      Reviewed-by: chadversary's avatarChad Versace <chad@chad-versace.us>
    • Paul Berry's avatar
      generated tests: Make test generation happen in a deterministic order. · df0dd9a4
      Paul Berry authored
      This patch makes gen_builtin_uniform_tests.py and
      gen_constant_array_size_tests.py build tests in a deterministic order,
      so that when diffing their outputs from one revision to the next, it
      is easier to see what changed.
      There is no change in the actual tests generated, just in the *.list
      files that are created as a side effect.
      Reviewed-by: chadversary's avatarChad Versace <chad@chad-versace.us>
  25. 15 Aug, 2011 1 commit
    • Paul Berry's avatar
      Add operator tests to auto-generated built-in function tests. · 62f30256
      Paul Berry authored
      This patch adds tests for the following built-in GLSL operators:
      - op-add, op-sub, op-mult, op-div: binary arithemetic operators on
        floats, vecs, mats, ints, and ivecs.
      - op-uplus, op-neg: unary arithmetic operators on floats, vecs, mats,
        ints, and ivecs.
      - op-gt, op-lt, op-ge, op-le: comparison operators on ints and floats.
      - op-eq, op-ne: equality and inequality comparison on any GLSL 1.20 type.
      - op-and, op-or, op-xor: logical operations on bools.
      - op-not: unary logical not on bools.
      - op-selection: trinary selection operator (x?y:z), where the first
        argument is a bool and the second and third arguments are any GLSL
        1.20 type.
      Note that implicit type conversions are not tested.  So, for instance,
      int * ivec is tested, but float * ivec is not.  This was in an effort
      to avoid generating an outrageous number of tests.
      Note also that the "shortcut" behavior of logical and/or and trinary
      selection is not tested.
      These tests leverage the same test generation framework used to test
      built-in functions, so the tests exercise vertex shaders, fragment
      shaders, and constant folding.
      All in all 1332 tests are added, in the subtrees
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
  26. 05 Aug, 2011 2 commits
    • Paul Berry's avatar
      Add tolerance to auto-generated built-in function tests. · b4274e75
      Paul Berry authored
      Previously, the auto-generated tests converted their outputs to pixel
      values and tested them against the expected values using
      shader_runner's "probe rgba" command--as a result, the built-in
      functions only tested to a tolerance of 1 part in 255.
      This patch changes the auto-generated tests so that the expected value
      is checked inside the shader itself, to an explicit tolerance.
      Unfortunately, the GLSL and OpenGL specs are somewhat ambiguous as to
      how accurate the built-in functions need to be.  Section 2.1.1 of the
      OpenGL 2.1 spec, for instance, says that "individual results of
      floating point operations are accurate to about 1 part in 10^5".
      However, it's not clear whether a built-in function is intended to
      constitute a single "operation" in this context.  And in experimenting
      with the systems available to me (Mesa on Intel i965, both IronLake
      and SandyBridge, and an nVidia system running nVidia's proprietary
      Linux driver), I've found that trig functions in particular fail to
      meet this strict requirement.  Considering how trig functions are
      typically used in shaders (e.g. calculating lighting angles), it seems
      like 1 part in 10^5 is an unreasonably tight limit.
      So I've settled for the time being on the following compromise:
      - Trig functions are tested to a tolerance of 1 part in 10^3 relative
        to the output of the built-in function, or an absolute tolerance of
        10^-4, whichever is larger.
      - The cross product is tested to a tolerance of 1 part in 10^5,
        relative to the product of the magnitudes of the input vectors.
        This avoids an unreasonably tight tolerance in cases where the terms
        of the cross product cancel out, yielding a small result.
      - All other functions are tested to a tolerance of 1 part in 10^5
        relative to the output of the built-in function.
      To avoid additional sources of error due to floating-point
      conversions, all test vectors are generated as 32-bit floating-point
      As an aid in review, here is the generated test for the exp()
      GLSL >= 1.10
      [vertex shader]
      varying vec4 color;
      uniform float arg0;
      uniform float tolerance;
      uniform float expected;
      void main()
        gl_Position = gl_Vertex;
        float result = exp(arg0);
        color = distance(result, expected) <= tolerance ? vec4(0.0, 1.0, 0.0, 1.0) : vec4(1.0, 0.0, 0.0, 1.0);
      [fragment shader]
      varying vec4 color;
      void main()
        gl_FragColor = color;
      uniform float arg0 -2.0
      uniform float expected 0.13533528
      uniform float tolerance 1.3533528e-06
      draw rect -1 -1 2 2
      probe rgba 0 0 0.0 1.0 0.0 1.0
      uniform float arg0 -0.66666669
      uniform float expected 0.51341712
      uniform float tolerance 5.1341713e-06
      draw rect -1 -1 2 2
      probe rgba 1 0 0.0 1.0 0.0 1.0
      uniform float arg0 0.66666669
      uniform float expected 1.9477341
      uniform float tolerance 1.9477342e-05
      draw rect -1 -1 2 2
      probe rgba 2 0 0.0 1.0 0.0 1.0
      uniform float arg0 2.0
      uniform float expected 7.3890562
      uniform float tolerance 7.3890566e-05
      draw rect -1 -1 2 2
      probe rgba 3 0 0.0 1.0 0.0 1.0
    • Paul Berry's avatar
      Add comprehensive tests of builtin functions with uniform input. · cccc419e
      Paul Berry authored
      This patch adds 462 tests to piglit, which comprehensively test the
      behavior of GLSL built-in functions on vertex and fragment shaders.
      The test vectors are auto-generated in Python, by using the numpy
      library to simulate the behavior of the built-in functions on a
      variety of inputs (in builtin_function.py), and then producing
      shader_runner tests to verify the expected behavior (in
      Test generation happens as part of the piglit build process.  To run
      the test generation step by itself, use "make gen-tests" from the root
      of the piglit tree (after configuring using cmake).  The generated
      tests may be found in generated_tests/spec.
      The auto-generation code depends on Python 2.6 and on the numpy
      library (www.numpy.org).  I've updated the README to reflect these
      dependencies, and added code to CMakeLists.txt to check for them at
      configure time.  (Note: other parts of Piglit already depend on Python
      2.6, but the dependency wasn't previously explicit).