Skip to content
  • 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: default avatarEric Anholt <eric@anholt.net>
    62f30256