1. 21 Aug, 2011 3 commits
  2. 19 Aug, 2011 8 commits
    • Ian Romanick's avatar
      glsl-1.10 / glsl-1.20: Add non-constant index write tests · d1696bb8
      Ian Romanick authored
      All of these tests follow a similar form.  An array of matrices is set
      to some values that have one incorrect element.  A non-constant index
      write is used to fix that incorrect element.  The result is verified.
      The tests vary on:
      
        - Storage qualifier of the array/matrix (uniform, temporary, varying).
        - Array / not an array.
        - Matrix size (mat2, mat3, mat4).
        - Whether or not the array index is a non-constant.
        - Whether or not the matrix column is a non-constant.
        - Whether or not the matrix row is a non-constant.
      
      Since the base type is always a matrix, attributes and fragment shader
      outputs are not tested.
      d1696bb8
    • Ian Romanick's avatar
      glsl-1.10 / glsl-1.20: Add non-constant index read tests · f7747a2c
      Ian Romanick authored
      All of these tests follow a similar form.  A simple shader that reads
      a particular array element, matrix column, and vector element (matrix
      row) and compares it to some expected value.  The tests vary on:
      
       - Storage qualifier of the array/matrix (uniform, temporary, varying).
       - Array / not an array.
       - Matrix size (mat2, mat3, mat4).
       - Whether or not the array index is a non-constant.
       - Whether or not the matrix column is a non-constant.
       - Whether or not the matrix row is a non-constant.
      
      Since the base type is always a matrix, attributes and fragment shader
      outputs are not tested.
      f7747a2c
    • Ian Romanick's avatar
      Set rlimit on glsl-*-explosion.shader_test, remove from blacklist · 01dff3f8
      Ian Romanick authored
      Setting the rlimit should prevent the tests from completely exhausting
      system memory and swap.  Since the tests are more system friendly,
      they are removed from the blacklist.
      Acked-by: Jose Fonseca's avatarJosé Fonseca <jfonseca@vmware.com>
      01dff3f8
    • Ian Romanick's avatar
    • Ian Romanick's avatar
      Remove redundant test · 2154c5ce
      Ian Romanick authored
      This test is made redundant by the spec/glsl-1.20/recursion tests.  As
      is, this test may not have been valid.  It expected the error to be
      generated at compile time, but many implementations generate this
      error at link time.
      Acked-by: Jose Fonseca's avatarJosé Fonseca <jfonseca@vmware.com>
      2154c5ce
    • Ian Romanick's avatar
      glsl-1.20: Add serveral tests for recursion in shaders · a834e686
      Ian Romanick authored
      These aren't done as shader_runner tests because there is no way to
      expect linking or compilation to fail in shader_runner.
      
      All of these tests pass on NVIDIA's closed-source driver except
      'unreachable' and 'unreachable-constant-folding'.
      
      All of these tests fail on AMD's closed-source driver, and 'simple',
      'unreachable', and 'unreachable-constant-folding' crash inside the
      driver.  It looks like the compiler tries to recursively inline the
      functions until the stack overflows.
      
      Mesa currently produces pretty much the same results as AMD, but Mesa
      can occasionally OOM instead of running out of stack.
      
      I have not tested Apple's driver or Intel's Windows driver.
      Reviewed-by: chadversary's avatarChad Versace <chad@chad-versace.us>
      Acked-by: Jose Fonseca's avatarJosé Fonseca <jfonseca@vmware.com>
      a834e686
    • Ian Romanick's avatar
    • Ian Romanick's avatar
      Add piglit_set_rlimit utility function · b8d96338
      Ian Romanick authored
      This function sets the maximum amount of memory that a process can
      have in its address space.  This is useful for tests that use
      "infinite" memory on failing implementations.  Setting this low can
      prevent the test from exhausting system memory and adversely affecting
      other tests.
      Acked-by: Jose Fonseca's avatarJosé Fonseca <jfonseca@vmware.com>
      b8d96338
  3. 18 Aug, 2011 9 commits
  4. 16 Aug, 2011 1 commit
  5. 15 Aug, 2011 2 commits
    • Pierre-Eric Pelloux-Prayer's avatar
      2a626860
    • 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
      spec/glsl-1.{10,20}/{compiler,execution}/built-in-functions.
      Reviewed-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
      62f30256
  6. 14 Aug, 2011 1 commit
  7. 12 Aug, 2011 2 commits
  8. 11 Aug, 2011 8 commits
    • Paul Berry's avatar
      Add tests for gl_ClipDistance and gl_ClipVertex. · 9d059906
      Paul Berry authored
      This patch is a preparation for work I'm about to do to add
      gl_ClipDistance support to Mesa, and future work that I hope to do to
      fix bugs in gl_ClipVertex in Mesa.  It adds a thorough set of tests
      for the following behaviors of gl_ClipDistance and gl_ClipVertex:
      
      For gl_ClipVertex:
      - It behaves properly when equal to gl_Position.
      - It behaves properly when not equal to gl_Position.
      - It falls back to gl_Position when it is not set.
      - Its homogeneous coordinate is respected.
      - The homogeneous coordinate is respected when falling back to gl_Position.
      
      For gl_ClipDistance:
      - It works when all 6 clip planes are enabled.
      - Its behavior is properly affected by clip plane enable flags.
      - It can be explicitly or implicitly sized in the vertex shader.
      - It can be sized up to gl_MaxClipDistances but no higher.
      - In the fragment shader, it contains properly interpolated values.
      
      For the interaction between the two:
      - It is an error to assign to both gl_ClipDistance and gl_ClipVertex.
      
      In addition, this patch renames a few of the existing clipping tests
      so that their names more clearly reflect what they're testing.
      
      All of these tests have been validated on the proprietary nVidia
      driver for Linux, except the following:
      
      - fs-clip-distance-interpolated: this fails with the error message
        "gl_ClipDistance is not accessible in this profile".  Based on a
        google search for this error message, I suspect this is an nVidia
        driver bug.  If I replace the fragment shader's reference to
        gl_ClipDistance with a reference to a user-defined vertex shader
        output that contains the same data, the test passes.
      
      - vs-clip-based-on-position and
        vs-clip-based-on-position-homogeneity: these tests fail--no
        clipping occurs.  But they pass if I add the line "gl_ClipVertex =
        gl_Position;" to the end of the vertex shader.  The GLSL 1.30 spec
        clearly states that if neither gl_ClipVertex nor gl_ClipDistance is
        statically written by the vertex shader, then gl_Position should be
        used for clipping, so I conclude that this is an nVidia driver bug.
      
      - mixing-clip-distance-and-clip-vertex-disallowed: the nVidia driver
        fails to detect this error condition, in spite of clear language in
        the GLSL 1.30 spec.  I conclude that this is an nVidia driver bug.
      9d059906
    • Paul Berry's avatar
      Add constant array size builtin tests. · 8a3e129c
      Paul Berry authored
      This patch adds a new set of generated tests which parallels those
      introduced by commt cccc419e (Add comprehensive tests of builtin
      functions with uniform input.)
      
      The new tests validate the correctness of built-in functions when used
      to compute array sizes.  The tests work by creating arrays whose size
      is 1 if the result of applying the built-in function is within
      tolerance of the correct answer, and -1 if not.  Since negative array
      sizes are prohibited, any improperly computed values will generate a
      compile error.
      
      Though it may seem absurd to compute an array size based on the result
      of calling a built-in function, it's worth testing for two reasons:
      
      (1) It is explicitly allowed in GLSL versions since 1.20.
      
      (2) Since array sizes need to be computed at compile time, this is a
      convenient way of testing that the GLSL compiler properly implements
      constant folding of built-in functions.  Indeed, the original
      motivation for these tests was to validate bug fixes to Mesa's
      constant folding logic.
      
      Here is an example of one of the generated tests (this test is
      exp2-vec2.vert):
      
      /* [config]
       * expect_result: pass
       * glsl_version: 1.20
       * [end config]
       *
       * Check that the following test vectors are constant folded correctly:
       * exp2(vec2(-2.0, -0.66666669)) => vec2(0.25, 0.62996054)
       * exp2(vec2(0.66666669, 2.0)) => vec2(1.587401, 4.0)
       */
      
      void main()
      {
        float[distance(exp2(vec2(-2.0, -0.66666669)), vec2(0.25, 0.62996054)) <= 6.7775386e-06 ? 1 : -1] array0;
        float[distance(exp2(vec2(0.66666669, 2.0)), vec2(1.587401, 4.0)) <= 4.3034684e-05 ? 1 : -1] array1;
        gl_Position = vec4(array0.length() + array1.length());
      }
      8a3e129c
    • Paul Berry's avatar
      Fix import_glsl_parser_tests' dependency on the number of dirs in basepath. · 76c27e13
      Paul Berry authored
      To figure out where a test file belongs in the test hierarchy,
      import_glsl_parser_tests has to determine the test file's path
      relative to the "basepath" argument.
      
      Before this patch, it worked out the relative path by dropping the
      first three directories from the test file's path.  This worked
      because import_glsl_parser_tests was always called with a basepath
      that contained exactly three directory names, e.g. "./spec/glsl-1.00".
      But it was a fragile assumption.
      
      This patch changes import_glsl_parser_tests so that it uses
      os.path.relpath() to work out the relative path.
      
      I've also taken the liberty of fixing a typo in the docstring
      explaining how basebath is used, and I've changed
      "assert(type(testname) is str)" to "assert isinstance(testname,
      basestring)", which works properly with Unicode.
      Reviewed-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
      76c27e13
    • Paul Berry's avatar
      Refactor cmake script to generate tests for later reuse. · 3599bede
      Paul Berry authored
      This patch creates a function, piglit_make_generated_tests (in
      generated_tests/CMakeLists.txt), to encapsulate the logic that builds
      a custom command.  The new function can be reused to generate tests
      using other python scripts.
      3599bede
    • Paul Berry's avatar
      Increase the range of values used to test atan(x) and atan(x,y) · 978488e9
      Paul Berry authored
      This patch ensures that Piglit tests both atan(x) and atan(x,y) for
      both very small and very large inputs.
      
      Previously, Piglit only tested the atan() functions over a small range
      of input values, causing it to miss a bug in Mesa (which has since
      been fixed--see Mesa commit b1b4ea0b).
      978488e9
    • Paul Berry's avatar
      Fix JSON problems with non-ASCII characters, by explicitly decoding test output. · 43542f5a
      Paul Berry authored
      Due to a design flaw in Python 2.x, if an 8-bit string containing a
      non-ASCII character is ever used in a context requiring a unicode
      string, the Python interpreter will raise an exception.  This happens
      because Python lazily decodes 8-bit strings to unicode as needed, and
      when it does the decoding it assumes the 8-bit string is in ASCII
      format.  Because of this lazy decoding behavior, this means
      that 8-bit strings containing non-ASCII characters are unsafe in any
      Python program that also uses unicode.
      
      Since Python 3.x doesn't have 8-bit strings (it has "byte arrays",
      which don't autoconvert to unicode strings), the most
      forward-compatible way to address this problem is to find the source
      of the unsafe 8-bit strings, and introduce an explicit decoding step
      that translates them to unicode strings and handles errors properly.
      
      This problem manifested in Piglit if the output of a test ever
      contained a non-ASCII character.  Due to Python 2.x's lazy string
      decoding semantics, the exception wouldn't occur until attempting to
      serialize the test output as JSON.
      
      This patch introduces an explicit step, right after running a test,
      which decodes the test output from 8-bit strings into unicode.  The
      decoding assumes UTF-8, and silently replaces invalid UTF-8 sequences
      with the unicode "replacement character" rather than raise an
      exception.
      43542f5a
    • Paul Berry's avatar
      Changed piglit-summary-html to explicitly encode its output as UTF-8. · da3126ce
      Paul Berry authored
      Previously piglit-summary-html didn't explicitly encode its output at
      all--it relied on the default behavior of the Python file.write()
      method (which, in Python 2.x, is to write 8-bit strings verbatim and
      to encode unicode strings using ASCII).  This meant that if a
      non-ASCII character appeared in any of the test data,
      piglit-summary-html would fail with an exception.
      
      This patch changes piglit-summary-html to explicitly encode its output
      using UTF-8.  It also updates all of the HTML templates to specify
      UTF-8 as the encoding, so that when results are viewed in a web
      browser, non-ASCII characters will display correctly.
      da3126ce
    • Brian Paul's avatar
  9. 10 Aug, 2011 4 commits
    • Paul Berry's avatar
      Generated tests: unify code for testing exp2 across all numpy versions. · b0517d17
      Paul Berry authored
      Versions of numpy previous to 1.3.0 (such as the one that ships with
      Snow Leopard, which is 1.2.1) didn't include an exp2() function, so
      commit a5180ddc worked around the problem by emulating it using
      power(2, x) when the numpy version was less than 1.3.0.
      
      There is no real advantage to using exp2() over power(2, x) (other
      than to save a few keystrokes), but there is a maintenance advantage
      to being as consistent as possible across numpy versions.  So this
      patch changes Piglit to use power(2, x) regardless of the numpy
      version.
      b0517d17
    • Paul Berry's avatar
      Fix autogeneration of builtin uniform tests on Windows. · 1e773649
      Paul Berry authored
      This patch modifies the invocation of CMake's add_custom_command()
      function so that instead of specifying all 462 output files
      explicitly, it instead specifies a single file,
      builtin_uniform_tests.list, which receives a list of all the files
      generated.
      
      It is safe not to specify the individual output files since there are
      no other build steps that depend on them, so there is no danger of the
      build step happening at the wrong time.
      
      This prevents CMake from trying to output an outrageously long
      diagnostic message listing all the files generated by the custom
      command, a message that was too long to work with the NMake back-end
      used on Windows.
      
      Bugzilla:https://bugs.freedesktop.org/show_bug.cgi?id=39873
      1e773649
    • Ben Widawsky's avatar
      spec/arb_copy_buffer: Add a new test for copy_buffer. · c8bb6461
      Ben Widawsky authored
      This is failing on Intel pre-GEN6, but will be fixed shortly.
      c8bb6461
    • Brian Paul's avatar
      texture-integer: disable assertion · f861777b
      Brian Paul authored
      The GL_TEXTURE_INTERNAL_FORMAT query isn't an important part of this test.
      See http://bugs.freedesktop.org/show_bug.cgi?id=39964
      f861777b
  10. 09 Aug, 2011 2 commits